alternative to assert
[gtkD.git] / gtkD / src / gobject / Boxed.d
bloba1e93389239c036b05f7f3525e4bd76ed83226d9
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD 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
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gobject-Boxed-Types.html
26 * outPack = gobject
27 * outFile = Boxed
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = Boxed
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - g_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * module aliases:
47 * local aliases:
50 module gobject.Boxed;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.gobjecttypes;
62 private import gtkc.gobject;
65 private import glib.Str;
70 /**
71 * Description
72 * GBoxed is a generic wrapper mechanism for arbitrary C structures. The only
73 * thing the type system needs to know about the structures is how to copy and
74 * free them, beyond that they are treated as opaque chunks of memory.
75 * Boxed types are useful for simple value-holder structures like rectangles or
76 * points. They can also be used for wrapping structures defined in non-GObject
77 * based libraries.
79 public class Boxed
82 /**
87 /**
88 * Provide a copy of a boxed structure src_boxed which is of type boxed_type.
89 * boxed_type:
90 * The type of src_boxed.
91 * src_boxed:
92 * The boxed structure to be copied.
93 * Returns:
94 * The newly created copy of the boxed structure.
96 public static void* boxedCopy(GType boxedType, void* srcBoxed)
98 // gpointer g_boxed_copy (GType boxed_type, gconstpointer src_boxed);
99 return g_boxed_copy(boxedType, srcBoxed);
103 * Free the boxed structure boxed which is of type boxed_type.
104 * boxed_type:
105 * The type of boxed.
106 * boxed:
107 * The boxed structure to be freed.
109 public static void boxedFree(GType boxedType, void* boxed)
111 // void g_boxed_free (GType boxed_type, gpointer boxed);
112 g_boxed_free(boxedType, boxed);
116 * This function creates a new G_TYPE_BOXED derived type id for a new
117 * boxed type with name name. Boxed type handling functions have to be
118 * provided to copy and free opaque boxed structures of this type.
119 * name:
120 * Name of the new boxed type.
121 * boxed_copy:
122 * Boxed structure copy function.
123 * boxed_free:
124 * Boxed structure free function.
125 * Returns:
126 * New G_TYPE_BOXED derived type id for name.
128 public static GType boxedTypeRegisterStatic(char[] name, GBoxedCopyFunc boxedCopy, GBoxedFreeFunc boxedFree)
130 // GType g_boxed_type_register_static (const gchar *name, GBoxedCopyFunc boxed_copy, GBoxedFreeFunc boxed_free);
131 return g_boxed_type_register_static(Str.toStringz(name), boxedCopy, boxedFree);
135 * Creates a new G_TYPE_POINTER derived type id for a new
136 * pointer type with name name.
137 * name:
138 * the name of the new pointer type.
139 * Returns:
140 * a new G_TYPE_POINTER derived type id for name.
142 public static GType pointerTypeRegisterStatic(char[] name)
144 // GType g_pointer_type_register_static (const gchar *name);
145 return g_pointer_type_register_static(Str.toStringz(name));