00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
00023 #error "Only <glib-object.h> can be included directly."
00024 #endif
00025
00026 #ifndef __G_VALUE_H__
00027 #define __G_VALUE_H__
00028
00029 #include <_ansi.h>
00030 #include <gobject/gtype.h>
00031
00032 G_BEGIN_DECLS
00033
00034
00035 #define G_TYPE_IS_VALUE(type) (g_type_check_is_value_type (type))
00036 #define G_IS_VALUE(value) (G_TYPE_CHECK_VALUE (value))
00037 #define G_VALUE_TYPE(value) (((GValue*) (value))->g_type)
00038 #define G_VALUE_TYPE_NAME(value) (g_type_name (G_VALUE_TYPE (value)))
00039 #define G_VALUE_HOLDS(value,type) (G_TYPE_CHECK_VALUE_TYPE ((value), (type)))
00040
00041
00042
00043 typedef void (*GValueTransform) (const GValue *src_value,
00044 GValue *dest_value);
00045 struct _GValue
00046 {
00047
00048 GType g_type;
00049
00050
00051 union {
00052 gint v_int;
00053 guint v_uint;
00054 glong v_long;
00055 gulong v_ulong;
00056 gint64 v_int64;
00057 guint64 v_uint64;
00058 gfloat v_float;
00059 gdouble v_double;
00060 gpointer v_pointer;
00061 } data[2];
00062 };
00063
00064
00065
00066 IMPORT_C GValue* g_value_init (GValue *value,
00067 GType g_type);
00068 IMPORT_C void g_value_copy (const GValue *src_value,
00069 GValue *dest_value);
00070 IMPORT_C GValue* g_value_reset (GValue *value);
00071 IMPORT_C void g_value_unset (GValue *value);
00072 IMPORT_C void g_value_set_instance (GValue *value,
00073 gpointer instance);
00074
00075
00076
00077 IMPORT_C gboolean g_value_fits_pointer (const GValue *value);
00078 IMPORT_C gpointer g_value_peek_pointer (const GValue *value);
00079
00080
00081
00082 IMPORT_C gboolean g_value_type_compatible (GType src_type,
00083 GType dest_type);
00084 IMPORT_C gboolean g_value_type_transformable (GType src_type,
00085 GType dest_type);
00086 IMPORT_C gboolean g_value_transform (const GValue *src_value,
00087 GValue *dest_value);
00088 IMPORT_C void g_value_register_transform_func (GType src_type,
00089 GType dest_type,
00090 GValueTransform transform_func);
00091 #define G_VALUE_NOCOPY_CONTENTS (1 << 27)
00092
00093
00094 G_END_DECLS
00095
00096 #endif