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:
48 * - GFlagsValue* -> Flags
59 import tango
.io
.Stdout
; // use the tango loging?
63 private import gtkc
.gobjecttypes
;
65 private import gtkc
.gobject
;
68 private import glib
.Str
;
69 private import gobject
.Flags
;
76 * The GLib type system provides fundamental types for enumeration and flags types. (Flags types
77 * are like enumerations, but allow their values to be combined by bitwise or). A registered
78 * enumeration or flags type associates a name and a nickname with each allowed value, and
79 * the methods g_enum_get_value_by_name(), g_enum_get_value_by_nick(), g_flags_get_value_by_name()
80 * and g_flags_get_value_by_nick() can look up values by their name or nickname.
81 * When an enumeration or flags type is registered with the GLib type system, it can
82 * be used as value type for object properties, using g_param_spec_enum() or
83 * g_param_spec_flags().
84 * GObject ships with a utility called glib-mkenums that can
85 * construct suitable type registration functions from C enumeration definitions.
90 /** the main Gtk struct */
91 protected GFlagsValue
* gFlagsValue
;
94 public GFlagsValue
* getFlagsStruct()
100 /** the main Gtk struct as a void* */
101 protected void* getStruct()
103 return cast(void*)gFlagsValue
;
107 * Sets our main struct and passes it to the parent class
109 public this (GFlagsValue
* gFlagsValue
)
113 if ( gFlagsValue
is null )
118 Stdout("struct gFlagsValue is null on constructor").newline
;
122 printf("struct gFlagsValue is null on constructor");
129 assert(gFlagsValue
!is null, "struct gFlagsValue is null on constructor");
131 this.gFlagsValue
= gFlagsValue
;
155 * Returns the first GFlagsValue which is set in value.
161 * the first GFlagsValue which is set in value, or NULL if none is set
163 public static Flags
getFirstValue(GFlagsClass
* flagsClass
, uint value
)
165 // GFlagsValue* g_flags_get_first_value (GFlagsClass *flags_class, guint value);
166 return new Flags( g_flags_get_first_value(flagsClass
, value
) );
170 * Looks up a GFlagsValue by name.
174 * the name to look up
176 * the GFlagsValue with name name, or NULL if there is no flag with
179 public static Flags
getValueByName(GFlagsClass
* flagsClass
, char[] name
)
181 // GFlagsValue* g_flags_get_value_by_name (GFlagsClass *flags_class, const gchar *name);
182 return new Flags( g_flags_get_value_by_name(flagsClass
, Str
.toStringz(name
)) );
186 * Looks up a GFlagsValue by nickname.
190 * the nickname to look up
192 * the GFlagsValue with nickname nick, or NULL if there is no flag
195 public static Flags
getValueByNick(GFlagsClass
* flagsClass
, char[] nick
)
197 // GFlagsValue* g_flags_get_value_by_nick (GFlagsClass *flags_class, const gchar *nick);
198 return new Flags( g_flags_get_value_by_nick(flagsClass
, Str
.toStringz(nick
)) );
203 * Registers a new static flags type with the name name.
204 * It is normally more convenient to let glib-mkenums
205 * generate a my_flags_get_type() function from a usual C enumeration definition
206 * than to write one yourself using g_flags_register_static().
208 * A nul-terminated string used as the name of the new type.
211 * The new type identifier.
213 public static GType
registerStatic(char[] name
, Flags _StaticValues
)
215 // GType g_flags_register_static (const gchar *name, const GFlagsValue *const _static_values);
216 return g_flags_register_static(Str
.toStringz(name
), (_StaticValues
is null) ?
null : _StaticValues
.getFlagsStruct());
221 * This function is meant to be called from the complete_type_info() function
222 * of a GTypePlugin implementation, see the example for
223 * g_enumeration_complete_type_info() above.
225 * the type identifier of the type being completed
227 * the GTypeInfo struct to be filled in
230 * GParamSpecEnum, GParamSpecFlags, g_param_spec_enum(), g_param_spec_flags(),
233 public static void completeTypeInfo(GType type
, GTypeInfo
* info
, Flags _Values
)
235 // void g_flags_complete_type_info (GType g_flags_type, GTypeInfo *info, const GFlagsValue *const _values);
236 g_flags_complete_type_info(type
, info
, (_Values
is null) ?
null : _Values
.getFlagsStruct());