gobject.Enums.Enums Class Reference

List of all members.

Detailed Description

Description The GLib type system provides fundamental types for enumeration and flags types.

(Flags types are like enumerations, but allow their values to be combined by bitwise or). A registered enumeration or flags type associates a name and a nickname with each allowed value, and the methods g_enum_get_value_by_name(), g_enum_get_value_by_nick(), g_flags_get_value_by_name() and g_flags_get_value_by_nick() can look up values by their name or nickname. When an enumeration or flags type is registered with the GLib type system, it can be used as value type for object properties, using g_param_spec_enum() or g_param_spec_flags(). GObject ships with a utility called glib-mkenums that can construct suitable type registration functions from C enumeration definitions.


Public Member Functions

GEnumValuegetEnumsStruct ()
 this (GEnumValue *gEnumValue)
 Sets our main struct and passes it to the parent class.

Static Public Member Functions

static GEnumValuegetValue (GEnumClass *enumClass, int value)
 Returns the GEnumValue for a value.
static GEnumValuegetValueByName (GEnumClass *enumClass, char[] name)
 Looks up a GEnumValue by name.
static GEnumValuegetValueByNick (GEnumClass *enumClass, char[] nick)
 Looks up a GEnumValue by nickname.
static GType registerStatic (char[] name, GEnumValue *_StaticValues)
 Registers a new static enumeration type with the name name.
static void completeTypeInfo (GType type, GTypeInfo *info, GEnumValue *_Values)
 This function is meant to be called from the complete_type_info() function of a GTypePlugin implementation, as in the following example: static void my_enum_complete_type_info (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table) { static const GEnumValue values[] = { { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" }, { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }, { 0, NULL, NULL } }; g_enum_complete_type_info (type, info, values); } g_enum_type: the type identifier of the type being completed info: the GTypeInfo struct to be filled in _values:.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GEnumValuegEnumValue
 the main Gtk struct


Constructor & Destructor Documentation

gobject.Enums.Enums.this ( GEnumValue gEnumValue  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

static void gobject.Enums.Enums.completeTypeInfo ( GType  type,
GTypeInfo info,
GEnumValue _Values 
) [static]

This function is meant to be called from the complete_type_info() function of a GTypePlugin implementation, as in the following example: static void my_enum_complete_type_info (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table) { static const GEnumValue values[] = { { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" }, { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }, { 0, NULL, NULL } }; g_enum_complete_type_info (type, info, values); } g_enum_type: the type identifier of the type being completed info: the GTypeInfo struct to be filled in _values:.

GEnumValue* gobject.Enums.Enums.getEnumsStruct (  ) 

void* gobject.Enums.Enums.getStruct (  )  [protected]

the main Gtk struct as a void*

static GEnumValue* gobject.Enums.Enums.getValue ( GEnumClass enumClass,
int  value 
) [static]

Returns the GEnumValue for a value.

enum_class: a GEnumClass value: the value to look up Returns: the GEnumValue for value, or NULL if value is not a member of the enumeration

static GEnumValue* gobject.Enums.Enums.getValueByName ( GEnumClass enumClass,
char[]  name 
) [static]

Looks up a GEnumValue by name.

enum_class: a GEnumClass name: the name to look up Returns: the GEnumValue with name name, or NULL if the enumeration doesn' t have a member with that name

static GEnumValue* gobject.Enums.Enums.getValueByNick ( GEnumClass enumClass,
char[]  nick 
) [static]

Looks up a GEnumValue by nickname.

enum_class: a GEnumClass nick: the nickname to look up Returns: the GEnumValue with nickname nick, or NULL if the enumeration doesn' t have a member with that nickname

static GType gobject.Enums.Enums.registerStatic ( char[]  name,
GEnumValue _StaticValues 
) [static]

Registers a new static enumeration type with the name name.

It is normally more convenient to let glib-mkenums generate a my_enum_get_type() function from a usual C enumeration definition than to write one yourself using g_enum_register_static(). name: A nul-terminated string used as the name of the new type. _static_values: Returns: The new type identifier.


Member Data Documentation

GEnumValue* gobject.Enums.Enums.gEnumValue [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo