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:
48 * - GFlagsValue* -> Flags
54 private import gobject
.gobjecttypes
;
56 private import lib
.gobject
;
58 private import glib
.Str
;
59 private import gobject
.Flags
;
63 * The GLib type system provides fundamental types for enumeration and flags types. (Flags types
64 * are like enumerations, but allow their values to be combined by bitwise or). A registered
65 * enumeration or flags type associates a name and a nickname with each allowed value, and
66 * the methods g_enum_get_value_by_name(), g_enum_get_value_by_nick(), g_flags_get_value_by_name()
67 * and g_flags_get_value_by_nick() can look up values by their name or nickname.
68 * When an enumeration or flags type is registered with the GLib type system, it can
69 * be used as value type for object properties, using g_param_spec_enum() or
70 * g_param_spec_flags().
71 * GObject ships with a utility called glib-mkenums that can
72 * construct suitable type registration functions from C enumeration definitions.
77 /** the main Gtk struct */
78 protected GFlagsValue
* gFlagsValue
;
81 public GFlagsValue
* getFlagsStruct()
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gFlagsValue
;
94 * Sets our main struct and passes it to the parent class
96 public this (GFlagsValue
* gFlagsValue
)
98 this.gFlagsValue
= gFlagsValue
;
122 * Returns the first GFlagsValue which is set in value.
128 * the first GFlagsValue which is set in value, or NULL if none is set
130 public static Flags
getFirstValue(GFlagsClass
* flagsClass
, uint value
)
132 // GFlagsValue* g_flags_get_first_value (GFlagsClass *flags_class, guint value);
133 return new Flags( g_flags_get_first_value(flagsClass
, value
) );
137 * Looks up a GFlagsValue by name.
141 * the name to look up
143 * the GFlagsValue with name name, or NULL if there is no flag with
146 public static Flags
getValueByName(GFlagsClass
* flagsClass
, char[] name
)
148 // GFlagsValue* g_flags_get_value_by_name (GFlagsClass *flags_class, const gchar *name);
149 return new Flags( g_flags_get_value_by_name(flagsClass
, Str
.toStringz(name
)) );
153 * Looks up a GFlagsValue by nickname.
157 * the nickname to look up
159 * the GFlagsValue with nickname nick, or NULL if there is no flag
162 public static Flags
getValueByNick(GFlagsClass
* flagsClass
, char[] nick
)
164 // GFlagsValue* g_flags_get_value_by_nick (GFlagsClass *flags_class, const gchar *nick);
165 return new Flags( g_flags_get_value_by_nick(flagsClass
, Str
.toStringz(nick
)) );
170 * Registers a new static flags type with the name name.
171 * It is normally more convenient to let glib-mkenums
172 * generate a my_flags_get_type() function from a usual C enumeration definition
173 * than to write one yourself using g_flags_register_static().
175 * A nul-terminated string used as the name of the new type.
178 * The new type identifier.
180 public static GType
registerStatic(char[] name
, Flags _StaticValues
)
182 // GType g_flags_register_static (const gchar *name, const GFlagsValue *const _static_values);
183 return g_flags_register_static(Str
.toStringz(name
), (_StaticValues
is null) ?
null : _StaticValues
.getFlagsStruct());
188 * This function is meant to be called from the complete_type_info() function
189 * of a GTypePlugin implementation, see the example for
190 * g_enumeration_complete_type_info() above.
192 * the type identifier of the type being completed
194 * the GTypeInfo struct to be filled in
197 * GParamSpecEnum, GParamSpecFlags, g_param_spec_enum(), g_param_spec_flags(),
200 public static void completeTypeInfo(GType type
, GTypeInfo
* info
, Flags _Values
)
202 // void g_flags_complete_type_info (GType g_flags_type, GTypeInfo *info, const GFlagsValue *const _values);
203 g_flags_complete_type_info(type
, info
, (_Values
is null) ?
null : _Values
.getFlagsStruct());