Function

GObjectenum_register_static

Declaration [src]

GType
g_enum_register_static (
  const gchar* name,
  const GEnumValue* const_static_values
)

Description [src]

Registers a new static enumeration type with the name name.

It is normally more convenient to let [glib-mkenums][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().

Parameters

name

Type: const gchar*

A nul-terminated string used as the name of the new type.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
const_static_values

Type: GEnumValue

An array of GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated.

The data is owned by the caller of the function.

Return value

Type: GType

The new type identifier.