Function Macro

GObjectDEFINE_ENUM_TYPE

since: 2.74

Declaration [src]

#define G_DEFINE_ENUM_TYPE (
  TypeName,
  type_name,
  ...
)

Description [src]

A convenience macro for defining enumeration types.

This macro will generate a *_get_type() function for the given TypeName, using type_name as the function prefix.

G_DEFINE_ENUM_TYPE (GtkOrientation, gtk_orientation,
  G_DEFINE_ENUM_VALUE (GTK_ORIENTATION_HORIZONTAL, "horizontal"),
  G_DEFINE_ENUM_VALUE (GTK_ORIENTATION_VERTICAL, "vertical"))

For projects that have multiple enumeration types, or enumeration types with many values, you should consider using glib-mkenums to generate the type function.

Available since: 2.74

This function is not directly available to language bindings.

Parameters

TypeName

Type: -

The enumeration type, in CamelCase.

type_name

Type: -

The enumeration type prefixed, in snake_case.

...

Type: -

A list of enumeration values, defined using G_DEFINE_ENUM_VALUE().