genums.h File Reference

__G_ENUMS_H__

G_TYPE_IS_ENUM

G_TYPE_IS_ENUM: : a GType ID.

Checks whether "is a" G_TYPE_ENUM.

Returns: TRUE if "is a" G_TYPE_ENUM.

G_ENUM_CLASS

G_IS_ENUM_CLASS

G_ENUM_CLASS_TYPE

G_ENUM_CLASS_TYPE_NAME

G_TYPE_IS_FLAGS

G_TYPE_IS_FLAGS: : a GType ID.

Checks whether "is a" G_TYPE_FLAGS.

Returns: TRUE if "is a" G_TYPE_FLAGS.

G_FLAGS_CLASS

G_IS_FLAGS_CLASS

G_FLAGS_CLASS_TYPE

G_FLAGS_CLASS_TYPE_NAME

G_VALUE_HOLDS_ENUM

G_VALUE_HOLDS_ENUM: : a valid GValue structure

Checks whether the given GValue can hold values derived from type G_TYPE_ENUM.

Returns: TRUE on success.

G_VALUE_HOLDS_FLAGS

G_VALUE_HOLDS_FLAGS: : a valid GValue structure

Checks whether the given GValue can hold values derived from type G_TYPE_FLAGS.

Returns: TRUE on success.

Typedef GEnumClass

typedef struct _GEnumClassGEnumClass

Typedef GFlagsClass

typedef struct _GFlagsClassGFlagsClass

Typedef GEnumValue

typedef struct _GEnumValueGEnumValue

Typedef GFlagsValue

typedef struct _GFlagsValueGFlagsValue

g_enum_get_value ( GEnumClass *, gint )

IMPORT_C GEnumValue *g_enum_get_value(GEnumClass *enum_class,
gintvalue
)

g_enum_get_value: : a GEnumClass : the value to look up

Returns the GEnumValue for a value.

Returns: the GEnumValue for , or NULL if is not a member of the enumeration

g_enum_get_value_by_name ( GEnumClass *, const gchar * )

IMPORT_C GEnumValue *g_enum_get_value_by_name(GEnumClass *enum_class,
const gchar *name
)

g_enum_get_value_by_nick ( GEnumClass *, const gchar * )

IMPORT_C GEnumValue *g_enum_get_value_by_nick(GEnumClass *enum_class,
const gchar *nick
)

g_enum_get_value_by_nick: : a GEnumClass : the nickname to look up

Looks up a GEnumValue by nickname.

Returns: the GEnumValue with nickname , or NULL if the enumeration doesn't have a member with that nickname

g_flags_get_first_value ( GFlagsClass *, guint )

IMPORT_C GFlagsValue *g_flags_get_first_value(GFlagsClass *flags_class,
guintvalue
)

g_flags_get_first_value: : a GFlagsClass : the value

Returns the first GFlagsValue which is set in .

Returns: the first GFlagsValue which is set in , or NULL if none is set

g_flags_get_value_by_name ( GFlagsClass *, const gchar * )

IMPORT_C GFlagsValue *g_flags_get_value_by_name(GFlagsClass *flags_class,
const gchar *name
)

g_flags_get_value_by_nick ( GFlagsClass *, const gchar * )

IMPORT_C GFlagsValue *g_flags_get_value_by_nick(GFlagsClass *flags_class,
const gchar *nick
)

g_flags_get_value_by_nick: : a GFlagsClass : the nickname to look up

Looks up a GFlagsValue by nickname.

Returns: the GFlagsValue with nickname , or NULL if there is no flag with that nickname

g_value_set_enum ( GValue *, gint )

IMPORT_C voidg_value_set_enum(GValue *value,
gintv_enum
)

g_value_set_enum: : a valid GValue whose type is derived from G_TYPE_ENUM : enum value to be set

Set the contents of a G_TYPE_ENUM GValue to .

g_value_get_enum ( const GValue * )

IMPORT_C gintg_value_get_enum(const GValue *value)

g_value_get_enum: : a valid GValue whose type is derived from G_TYPE_ENUM

Get the contents of a G_TYPE_ENUM GValue.

Returns: enum contents of

g_value_set_flags ( GValue *, guint )

IMPORT_C voidg_value_set_flags(GValue *value,
guintv_flags
)

g_value_set_flags: : a valid GValue whose type is derived from G_TYPE_FLAGS : flags value to be set

Set the contents of a G_TYPE_FLAGS GValue to .

g_value_get_flags ( const GValue * )

IMPORT_C guintg_value_get_flags(const GValue *value)

g_value_get_flags: : a valid GValue whose type is derived from G_TYPE_FLAGS

Get the contents of a G_TYPE_FLAGS GValue.

Returns: flags contents of

g_enum_register_static ( const gchar *, const GEnumValue * )

IMPORT_C GTypeg_enum_register_static(const gchar *name,
const GEnumValue *const_static_values
)

g_flags_register_static ( const gchar *, const GFlagsValue * )

IMPORT_C GTypeg_flags_register_static(const gchar *name,
const GFlagsValue *const_static_values
)

g_enum_complete_type_info ( GType, GTypeInfo *, const GEnumValue * )

IMPORT_C voidg_enum_complete_type_info(GTypeg_enum_type,
GTypeInfo *info,
const GEnumValue *const_values
)

g_enum_complete_type_info: : the type identifier of the type being completed : the GTypeInfo struct to be filled in : An array of GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.

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_flags_complete_type_info ( GType, GTypeInfo *, const GFlagsValue * )

IMPORT_C voidg_flags_complete_type_info(GTypeg_flags_type,
GTypeInfo *info,
const GFlagsValue *const_values
)

g_flags_complete_type_info: : the type identifier of the type being completed : the GTypeInfo struct to be filled in : An array of GFlagsValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.

This function is meant to be called from the complete_type_info() function of a GTypePlugin implementation, see the example for g_enum_complete_type_info() above.