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 
62 private import glib.Str;
63 
64 
65 
66 
67 /**
68  * GBoxed is a generic wrapper mechanism for arbitrary C structures. The only
69  * thing the type system needs to know about the structures is how to copy and
70  * free them, beyond that they are treated as opaque chunks of memory.
71  *
72  * Boxed types are useful for simple value-holder structures like rectangles or
73  * points. They can also be used for wrapping structures defined in non-GObject
74  * based libraries.
75  */
76 public class Boxed
77 {
78 	
79 	/**
80 	 */
81 	
82 	/**
83 	 * Provide a copy of a boxed structure src_boxed which is of type boxed_type.
84 	 * Params:
85 	 * boxedType = The type of src_boxed.
86 	 * srcBoxed = The boxed structure to be copied.
87 	 * Returns: The newly created copy of the boxed structure.
88 	 */
89 	public static void* boxedCopy(GType boxedType, void* srcBoxed)
90 	{
91 		// gpointer g_boxed_copy (GType boxed_type,  gconstpointer src_boxed);
92 		return g_boxed_copy(boxedType, srcBoxed);
93 	}
94 	
95 	/**
96 	 * Free the boxed structure boxed which is of type boxed_type.
97 	 * Params:
98 	 * boxedType = The type of boxed.
99 	 * boxed = The boxed structure to be freed.
100 	 */
101 	public static void boxedFree(GType boxedType, void* boxed)
102 	{
103 		// void g_boxed_free (GType boxed_type,  gpointer boxed);
104 		g_boxed_free(boxedType, boxed);
105 	}
106 	
107 	/**
108 	 * This function creates a new G_TYPE_BOXED derived type id for a new
109 	 * boxed type with name name. Boxed type handling functions have to be
110 	 * provided to copy and free opaque boxed structures of this type.
111 	 * Params:
112 	 * name = Name of the new boxed type.
113 	 * boxedCopy = Boxed structure copy function.
114 	 * boxedFree = Boxed structure free function.
115 	 * Returns: New G_TYPE_BOXED derived type id for name.
116 	 */
117 	public static GType boxedTypeRegisterStatic(string name, GBoxedCopyFunc boxedCopy, GBoxedFreeFunc boxedFree)
118 	{
119 		// GType g_boxed_type_register_static (const gchar *name,  GBoxedCopyFunc boxed_copy,  GBoxedFreeFunc boxed_free);
120 		return g_boxed_type_register_static(Str.toStringz(name), boxedCopy, boxedFree);
121 	}
122 	
123 	/**
124 	 * Creates a new G_TYPE_POINTER derived type id for a new
125 	 * pointer type with name name.
126 	 * Params:
127 	 * name = the name of the new pointer type.
128 	 * Returns: a new G_TYPE_POINTER derived type id for name.
129 	 */
130 	public static GType pointerTypeRegisterStatic(string name)
131 	{
132 		// GType g_pointer_type_register_static (const gchar *name);
133 		return g_pointer_type_register_static(Str.toStringz(name));
134 	}
135 }