gboxed.h

Go to the documentation of this file.
00001 /* GObject - GLib Type, Object, Parameter and Signal Library
00002  * Copyright (C) 2000-2001 Red Hat, Inc.
00003  * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General
00016  * Public License along with this library; if not, write to the
00017  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
00018  * Boston, MA 02111-1307, USA.
00019  */
00020 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
00021 #error "Only <glib-object.h> can be included directly."
00022 #endif
00023 
00024 #ifndef __G_BOXED_H__
00025 #define __G_BOXED_H__
00026 
00027 #include <_ansi.h>
00028 #include        <gobject/gtype.h>
00029 
00030 G_BEGIN_DECLS
00031 
00032 /* --- type macros --- */
00033 #define G_TYPE_IS_BOXED(type)      (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED)
00034 #define G_VALUE_HOLDS_BOXED(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOXED))
00035 
00036 
00037 /* --- typedefs --- */
00038 typedef gpointer (*GBoxedCopyFunc)      (gpointer        boxed);
00039 typedef void     (*GBoxedFreeFunc)      (gpointer        boxed);
00040 
00041 
00042 /* --- prototypes --- */
00043 IMPORT_C gpointer       g_boxed_copy                    (GType           boxed_type,
00044                                                  gconstpointer   src_boxed);
00045 IMPORT_C void           g_boxed_free                    (GType           boxed_type,
00046                                                  gpointer        boxed);
00047 IMPORT_C void           g_value_set_boxed               (GValue         *value,
00048                                                  gconstpointer   v_boxed);
00049 IMPORT_C void           g_value_set_static_boxed        (GValue         *value,
00050                                                  gconstpointer   v_boxed);
00051 IMPORT_C gpointer       g_value_get_boxed               (const GValue   *value);
00052 IMPORT_C gpointer       g_value_dup_boxed               (const GValue   *value);
00053 
00054 
00055 /* --- convenience --- */
00056 IMPORT_C GType  g_boxed_type_register_static            (const gchar    *name,
00057                                                  GBoxedCopyFunc  boxed_copy,
00058                                                  GBoxedFreeFunc  boxed_free);
00059 
00060 
00061 /* --- GLib boxed types --- */
00062 #define G_TYPE_CLOSURE          (g_closure_get_type ())
00063 #define G_TYPE_VALUE            (g_value_get_type ())
00064 #define G_TYPE_VALUE_ARRAY      (g_value_array_get_type ())
00065 #define G_TYPE_DATE             (g_date_get_type ())
00066 #define G_TYPE_STRV             (g_strv_get_type ())
00067 #define G_TYPE_GSTRING          (g_gstring_get_type ())
00068 #define G_TYPE_HASH_TABLE       (g_hash_table_get_type ())
00069 
00070 
00071 IMPORT_C void    g_value_take_boxed      (GValue                *value,
00072                                  gconstpointer   v_boxed);
00073 #ifndef G_DISABLE_DEPRECATED
00074 IMPORT_C void   g_value_set_boxed_take_ownership        (GValue         *value,
00075                                                  gconstpointer   v_boxed);
00076 #endif
00077 IMPORT_C GType  g_closure_get_type      (void)  G_GNUC_CONST;
00078 IMPORT_C GType  g_value_get_type        (void)  G_GNUC_CONST;
00079 IMPORT_C GType  g_value_array_get_type  (void)  G_GNUC_CONST;
00080 IMPORT_C GType  g_date_get_type         (void)  G_GNUC_CONST;
00081 IMPORT_C GType  g_strv_get_type         (void)  G_GNUC_CONST;
00082 IMPORT_C GType  g_gstring_get_type      (void)  G_GNUC_CONST;
00083 IMPORT_C GType   g_hash_table_get_type   (void)  G_GNUC_CONST;
00084 
00085 typedef gchar** GStrv;
00086      
00087 G_END_DECLS
00088 
00089 #endif  /* __G_BOXED_H__ */

Copyright © Nokia Corporation 2001-2008
Back to top