1 /* GObject - GLib Type, Object, Parameter and Signal Library
2 * Copyright (C) 1997, 1998, 1999, 2000 Tim Janik and Red Hat, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General
15 * Public License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * gvalue.h: generic GValue functions
25 #include <gobject/gtype.h>
29 #endif /* __cplusplus */
32 /* --- type macros --- */
33 #define G_TYPE_IS_VALUE(type) (g_type_value_table_peek (type) != NULL)
34 #define G_IS_VALUE(value) (G_TYPE_CHECK_VALUE (value))
35 #define G_VALUE_HOLDS(value, g_type) (G_TYPE_CHECK_VALUE_TYPE ((value), (g_type)))
36 #define G_VALUE_TYPE(value) (((GValue*) (value))->g_type)
37 #define G_VALUE_TYPE_NAME(value) (g_type_name (G_VALUE_TYPE (value)))
40 /* --- typedefs & structures --- */
41 typedef void (*GValueExchange) (GValue *value1,
48 /* public for GTypeValueTable methods */
61 /* --- prototypes --- */
62 void g_value_init (GValue *value,
64 void g_value_copy (const GValue *src_value,
66 gboolean g_value_convert (const GValue *src_value,
68 void g_value_reset (GValue *value);
69 void g_value_unset (GValue *value);
70 gboolean g_value_fits_pointer (const GValue *value);
71 gpointer g_value_get_as_pointer (const GValue *value);
72 void g_value_set_instance (GValue *value,
76 /* --- implementation details --- */
77 gboolean g_values_exchange (GValue *value1,
79 gboolean g_value_types_exchangable (GType value_type1,
81 void g_value_register_exchange_func (GType value_type1,
84 #define G_VALUE_STATIC_TAG (1 << 27)
88 #endif /* __cplusplus */
90 #endif /* __G_VALUE_H__ */