1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = gobject-Boxed-Types.html
27  * outPack = gobject
28  * outFile = Boxed
29  * strct   = 
30  * realStrct=
31  * ctorStrct=
32  * clss    = Boxed
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * structWrap:
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gobject.Boxed;
54 
55 public  import gtkc.gobjecttypes;
56 
57 private import gtkc.gobject;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 private import glib.Str;
62 
63 
64 
65 /**
66  * GBoxed is a generic wrapper mechanism for arbitrary C structures. The only
67  * thing the type system needs to know about the structures is how to copy and
68  * free them, beyond that they are treated as opaque chunks of memory.
69  *
70  * Boxed types are useful for simple value-holder structures like rectangles or
71  * points. They can also be used for wrapping structures defined in non-GObject
72  * based libraries.
73  */
74 public class Boxed
75 {
76 	
77 	/**
78 	 */
79 	
80 	/**
81 	 * Provide a copy of a boxed structure src_boxed which is of type boxed_type.
82 	 * Params:
83 	 * boxedType = The type of src_boxed.
84 	 * srcBoxed = The boxed structure to be copied.
85 	 * Returns: The newly created copy of the boxed structure.
86 	 */
87 	public static void* boxedCopy(GType boxedType, void* srcBoxed)
88 	{
89 		// gpointer g_boxed_copy (GType boxed_type,  gconstpointer src_boxed);
90 		return g_boxed_copy(boxedType, srcBoxed);
91 	}
92 	
93 	/**
94 	 * Free the boxed structure boxed which is of type boxed_type.
95 	 * Params:
96 	 * boxedType = The type of boxed.
97 	 * boxed = The boxed structure to be freed.
98 	 */
99 	public static void boxedFree(GType boxedType, void* boxed)
100 	{
101 		// void g_boxed_free (GType boxed_type,  gpointer boxed);
102 		g_boxed_free(boxedType, boxed);
103 	}
104 	
105 	/**
106 	 * This function creates a new G_TYPE_BOXED derived type id for a new
107 	 * boxed type with name name. Boxed type handling functions have to be
108 	 * provided to copy and free opaque boxed structures of this type.
109 	 * Params:
110 	 * name = Name of the new boxed type.
111 	 * boxedCopy = Boxed structure copy function.
112 	 * boxedFree = Boxed structure free function.
113 	 * Returns: New G_TYPE_BOXED derived type id for name.
114 	 */
115 	public static GType boxedTypeRegisterStatic(string name, GBoxedCopyFunc boxedCopy, GBoxedFreeFunc boxedFree)
116 	{
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);
119 	}
120 	
121 	/**
122 	 * Creates a new G_TYPE_POINTER derived type id for a new
123 	 * pointer type with name name.
124 	 * Params:
125 	 * name = the name of the new pointer type.
126 	 * Returns: a new G_TYPE_POINTER derived type id for name.
127 	 */
128 	public static GType pointerTypeRegisterStatic(string name)
129 	{
130 		// GType g_pointer_type_register_static (const gchar *name);
131 		return g_pointer_type_register_static(Str.toStringz(name));
132 	}
133 }