alternative to assert
[gtkD.git] / gtkD / src / gtk / Types.d
blob7e4281be80b842266ab7c1b09c00fb22cdddc52e
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 = gtk-Types.html
26 * outPack = gtk
27 * outFile = Types
28 * strct = GtkType
29 * realStrct=
30 * ctorStrct=
31 * clss = Types
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_type_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * structWrap:
47 * module aliases:
48 * local aliases:
51 module gtk.Types;
53 version(noAssert)
55 version(Tango)
57 import tango.io.Stdout; // use the tango loging?
61 private import gtkc.gtktypes;
63 private import gtkc.gtk;
66 private import glib.Str;
71 /**
72 * Description
73 * The GTK+ type system is extensible. Because of that, types have to be
74 * managed at runtime.
76 public class Types
79 /** the main Gtk struct */
80 protected GtkType* gtkType;
83 public GtkType* getTypesStruct()
85 return gtkType;
89 /** the main Gtk struct as a void* */
90 protected void* getStruct()
92 return cast(void*)gtkType;
95 /**
96 * Sets our main struct and passes it to the parent class
98 public this (GtkType* gtkType)
100 version(noAssert)
102 if ( gtkType is null )
104 int zero = 0;
105 version(Tango)
107 Stdout("struct gtkType is null on constructor").newline;
109 else
111 printf("struct gtkType is null on constructor");
113 zero = zero / zero;
116 else
118 assert(gtkType !is null, "struct gtkType is null on constructor");
120 this.gtkType = gtkType;
186 * Warning
187 * gtk_type_init is deprecated and should not be used in newly-written code.
188 * Initializes the data structures associated with GTK+ types.
189 * debug_flags:
191 public static void init(GTypeDebugFlags debugFlags)
193 // void gtk_type_init (GTypeDebugFlags debug_flags);
194 gtk_type_init(debugFlags);
198 * Warning
199 * gtk_type_unique is deprecated and should not be used in newly-written code.
200 * Creates a new, unique type.
201 * parent_type:
202 * if zero, a fundamental type is created.
203 * gtkinfo:
204 * Returns:
205 * the new GtkType.
207 public static GtkType unique(GtkType parentType, GtkTypeInfo* gtkinfo)
209 // GtkType gtk_type_unique (GtkType parent_type, const GtkTypeInfo *gtkinfo);
210 return gtk_type_unique(parentType, gtkinfo);
217 * Returns a pointer pointing to the class of type or NULL if there was
218 * any trouble identifying type. Initializes the class if necessary.
219 * type:
220 * a GtkType.
221 * Returns:
222 * pointer to the class.
224 public static void* clss(GtkType type)
226 // gpointer gtk_type_class (GtkType type);
227 return gtk_type_class(type);
231 * Warning
232 * gtk_type_new is deprecated and should not be used in newly-written code.
233 * Creates a new object of a given type, and return a pointer to it.
234 * Returns NULL if you give it an invalid type. It allocates the object
235 * out of the type's memory chunk if there is a memory chunk. The object
236 * has all the proper initializers called.
237 * type:
238 * a GtkType.
239 * Returns:
240 * pointer to a GtkTypeObject.
242 public static void* newTypes(GtkType type)
244 // gpointer gtk_type_new (GtkType type);
245 return gtk_type_new(type);
250 * Warning
251 * gtk_type_enum_get_values is deprecated and should not be used in newly-written code.
252 * If enum_type has values, then return a pointer to all of them.
253 * enum_type:
254 * a GtkType.
255 * Returns:
256 * GtkEnumValue*
258 public static GtkEnumValue* enumGetValues(GtkType enumType)
260 // GtkEnumValue* gtk_type_enum_get_values (GtkType enum_type);
261 return gtk_type_enum_get_values(enumType);
265 * Warning
266 * gtk_type_flags_get_values is deprecated and should not be used in newly-written code.
267 * If flags_type has values, then return a pointer to all of them.
268 * flags_type:
269 * a GtkType.
270 * Returns:
271 * GtkFlagValue*
273 public static GtkFlagValue* flagsGetValues(GtkType flagsType)
275 // GtkFlagValue* gtk_type_flags_get_values (GtkType flags_type);
276 return gtk_type_flags_get_values(flagsType);
280 * Warning
281 * gtk_type_enum_find_value is deprecated and should not be used in newly-written code.
282 * Returns a pointer to one of enum_type's GtkEnumValues's whose name (or nickname) matches value_name.
283 * enum_type:
284 * a GtkType.
285 * value_name:
286 * the name to look for.
287 * Returns:
288 * GtkEnumValue*
290 public static GtkEnumValue* enumFindValue(GtkType enumType, char[] valueName)
292 // GtkEnumValue* gtk_type_enum_find_value (GtkType enum_type, const gchar *value_name);
293 return gtk_type_enum_find_value(enumType, Str.toStringz(valueName));
297 * Warning
298 * gtk_type_flags_find_value is deprecated and should not be used in newly-written code.
299 * Returns a pointer to one of flag_type's GtkFlagValue's whose name (or nickname) matches value_name.
300 * flags_type:
301 * a GtkType.
302 * value_name:
303 * the name to look for.
304 * Returns:
305 * GtkFlagValue*
307 public static GtkFlagValue* flagsFindValue(GtkType flagsType, char[] valueName)
309 // GtkFlagValue* gtk_type_flags_find_value (GtkType flags_type, const gchar *value_name);
310 return gtk_type_flags_find_value(flagsType, Str.toStringz(valueName));