sl@0: /* GObject - GLib Type, Object, Parameter and Signal Library sl@0: * Copyright (C) 2000-2001 Red Hat, Inc. sl@0: * Portions copyright (c) 2006 Nokia Corporation. All rights reserved. sl@0: * sl@0: * This library is free software; you can redistribute it and/or sl@0: * modify it under the terms of the GNU Lesser General Public sl@0: * License as published by the Free Software Foundation; either sl@0: * version 2 of the License, or (at your option) any later version. sl@0: * sl@0: * This library is distributed in the hope that it will be useful, sl@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of sl@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU sl@0: * Lesser General Public License for more details. sl@0: * sl@0: * You should have received a copy of the GNU Lesser General sl@0: * Public License along with this library; if not, write to the sl@0: * Free Software Foundation, Inc., 59 Temple Place, Suite 330, sl@0: * Boston, MA 02111-1307, USA. sl@0: */ sl@0: #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION) sl@0: #error "Only can be included directly." sl@0: #endif sl@0: sl@0: #ifndef __G_BOXED_H__ sl@0: #define __G_BOXED_H__ sl@0: sl@0: #include <_ansi.h> sl@0: #include sl@0: sl@0: G_BEGIN_DECLS sl@0: sl@0: /* --- type macros --- */ sl@0: #define G_TYPE_IS_BOXED(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED) sl@0: #define G_VALUE_HOLDS_BOXED(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOXED)) sl@0: sl@0: sl@0: /* --- typedefs --- */ sl@0: typedef gpointer (*GBoxedCopyFunc) (gpointer boxed); sl@0: typedef void (*GBoxedFreeFunc) (gpointer boxed); sl@0: sl@0: sl@0: /* --- prototypes --- */ sl@0: IMPORT_C gpointer g_boxed_copy (GType boxed_type, sl@0: gconstpointer src_boxed); sl@0: IMPORT_C void g_boxed_free (GType boxed_type, sl@0: gpointer boxed); sl@0: IMPORT_C void g_value_set_boxed (GValue *value, sl@0: gconstpointer v_boxed); sl@0: IMPORT_C void g_value_set_static_boxed (GValue *value, sl@0: gconstpointer v_boxed); sl@0: IMPORT_C gpointer g_value_get_boxed (const GValue *value); sl@0: IMPORT_C gpointer g_value_dup_boxed (const GValue *value); sl@0: sl@0: sl@0: /* --- convenience --- */ sl@0: IMPORT_C GType g_boxed_type_register_static (const gchar *name, sl@0: GBoxedCopyFunc boxed_copy, sl@0: GBoxedFreeFunc boxed_free); sl@0: sl@0: sl@0: /* --- GLib boxed types --- */ sl@0: #define G_TYPE_CLOSURE (g_closure_get_type ()) sl@0: #define G_TYPE_VALUE (g_value_get_type ()) sl@0: #define G_TYPE_VALUE_ARRAY (g_value_array_get_type ()) sl@0: #define G_TYPE_DATE (g_date_get_type ()) sl@0: #define G_TYPE_STRV (g_strv_get_type ()) sl@0: #define G_TYPE_GSTRING (g_gstring_get_type ()) sl@0: #define G_TYPE_HASH_TABLE (g_hash_table_get_type ()) sl@0: sl@0: sl@0: IMPORT_C void g_value_take_boxed (GValue *value, sl@0: gconstpointer v_boxed); sl@0: #ifndef G_DISABLE_DEPRECATED sl@0: IMPORT_C void g_value_set_boxed_take_ownership (GValue *value, sl@0: gconstpointer v_boxed); sl@0: #endif sl@0: IMPORT_C GType g_closure_get_type (void) G_GNUC_CONST; sl@0: IMPORT_C GType g_value_get_type (void) G_GNUC_CONST; sl@0: IMPORT_C GType g_value_array_get_type (void) G_GNUC_CONST; sl@0: IMPORT_C GType g_date_get_type (void) G_GNUC_CONST; sl@0: IMPORT_C GType g_strv_get_type (void) G_GNUC_CONST; sl@0: IMPORT_C GType g_gstring_get_type (void) G_GNUC_CONST; sl@0: IMPORT_C GType g_hash_table_get_type (void) G_GNUC_CONST; sl@0: sl@0: typedef gchar** GStrv; sl@0: sl@0: G_END_DECLS sl@0: sl@0: #endif /* __G_BOXED_H__ */