1 /*
2  * Distributed under the Boost Software License, Version 1.0.
3  *    (See accompanying file LICENSE_1_0.txt or copy at
4  *          http://www.boost.org/LICENSE_1_0.txt)
5  */
6 module gobject.gboxed;
7 
8 import gobject.gtype;
9 import gobject.gvalue;
10 import glib.gtypes;
11 
12 
13 //#ifndef __GI_SCANNER__
14 //#include        <gobject/glib-types.h>
15 //#endif
16 
17 // /* --- type macros --- */
18 // #define G_TYPE_IS_BOXED(type)      (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED)
19 // /**
20 //  * G_VALUE_HOLDS_BOXED:
21 //  * @value: a valid #GValue structure
22 //  *
23 //  * Checks whether the given #GValue can hold values derived
24 //  * from type %G_TYPE_BOXED.
25 //  *
26 //  * Returns: %TRUE on success.
27 //  */
28 // #define G_VALUE_HOLDS_BOXED(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOXED))
29 
30 extern(C):
31 
32 alias GBoxedCopyFunc = gpointer function (gpointer boxed);
33 alias GBoxedFreeFunc = void function (gpointer boxed);
34 
35 /* --- prototypes --- */
36 
37 gpointer g_boxed_copy                     (GType boxed_type,
38                                            gconstpointer  src_boxed);
39 
40 void     g_boxed_free                     (GType          boxed_type,
41                                            gpointer       boxed);
42 
43 void     g_value_set_boxed                (GValue        *value,
44                                            gconstpointer  v_boxed);
45 
46 void     g_value_set_static_boxed         (GValue        *value,
47                                            gconstpointer  v_boxed);
48 
49 void     g_value_take_boxed               (GValue        *value,
50                                            gconstpointer  v_boxed);
51 deprecated("use g_value_take_boxed")
52 void     g_value_set_boxed_take_ownership (GValue        *value,
53                                            gconstpointer  v_boxed);
54 
55 gpointer g_value_get_boxed                (const(GValue)  *value);
56 
57 gpointer g_value_dup_boxed                (const(GValue)  *value);
58 
59 
60 /* --- convenience --- */
61 
62 GType    g_boxed_type_register_static     (const(gchar)   *name,
63                                            GBoxedCopyFunc boxed_copy,
64                                            GBoxedFreeFunc boxed_free);
65 
66 /* --- GObject boxed types --- */
67 /**
68  * G_TYPE_CLOSURE:
69  *
70  * The #GType for #GClosure.
71  */
72 // #define G_TYPE_CLOSURE (g_closure_get_type ())
73 
74 /**
75  * G_TYPE_VALUE:
76  *
77  * The type ID of the "GValue" type which is a boxed type,
78  * used to pass around pointers to GValues.
79  */
80 // #define G_TYPE_VALUE (g_value_get_type ())
81 
82 
83 pure GType   g_closure_get_type         ();
84 
85 pure GType   g_value_get_type           ();
86