I've no idea here...
[gtkD.git] / src / gobject / Boxed.d
blob2d64a51b9838716459928f5aa6f883300822f6b0
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 * local aliases:
49 module gobject.Boxed;
51 private import gobject.gobjecttypes;
53 private import lib.gobject;
55 private import glib.Str;
57 /**
58 * Description
59 * GBoxed is a generic wrapper mechanism for arbitrary C structures. The only
60 * thing the type system needs to know about the structures is how to copy and
61 * free them, beyond that they are treated as opaque chunks of memory.
62 * Boxed types are useful for simple value-holder structures like rectangles or
63 * points. They can also be used for wrapping structures defined in non-GObject
64 * based libraries.
66 public class Boxed
69 /**
74 /**
75 * Provide a copy of a boxed structure src_boxed which is of type boxed_type.
76 * boxed_type:
77 * The type of src_boxed.
78 * src_boxed:
79 * The boxed structure to be copied.
80 * Returns:
81 * The newly created copy of the boxed structure.
83 public static void* boxedCopy(GType boxedType, void* srcBoxed)
85 // gpointer g_boxed_copy (GType boxed_type, gconstpointer src_boxed);
86 return g_boxed_copy(boxedType, srcBoxed);
89 /**
90 * Free the boxed structure boxed which is of type boxed_type.
91 * boxed_type:
92 * The type of boxed.
93 * boxed:
94 * The boxed structure to be freed.
96 public static void boxedFree(GType boxedType, void* boxed)
98 // void g_boxed_free (GType boxed_type, gpointer boxed);
99 g_boxed_free(boxedType, boxed);
103 * This function creates a new G_TYPE_BOXED derived type id for a new
104 * boxed type with name name. Boxed type handling functions have to be
105 * provided to copy and free opaque boxed structures of this type.
106 * name:
107 * Name of the new boxed type.
108 * boxed_copy:
109 * Boxed structure copy function.
110 * boxed_free:
111 * Boxed structure free function.
112 * Returns:
113 * New G_TYPE_BOXED derived type id for name.
115 public static GType boxedTypeRegisterStatic(char[] name, GBoxedCopyFunc boxedCopy, GBoxedFreeFunc boxedFree)
117 // GType g_boxed_type_register_static (const gchar *name, GBoxedCopyFunc boxed_copy, GBoxedFreeFunc boxed_free);
118 return g_boxed_type_register_static(Str.toStringz(name), boxedCopy, boxedFree);
122 * Creates a new G_TYPE_POINTER derived type id for a new
123 * pointer type with name name.
124 * name:
125 * the name of the new pointer type.
126 * Returns:
127 * a new G_TYPE_POINTER derived type id for name.
129 public static GType pointerTypeRegisterStatic(char[] name)
131 // GType g_pointer_type_register_static (const gchar *name);
132 return g_pointer_type_register_static(Str.toStringz(name));