Function Macro

GObjectDEFINE_FLAGS_TYPE

Declaration

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

Description

A convenience macro for defining flag types.

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

G_DEFINE_FLAGS_TYPE (GSettingsBindFlags, g_settings_bind_flags,
  G_DEFINE_ENUM_VALUE (G_SETTINGS_BIND_DEFAULT, "default"),
  G_DEFINE_ENUM_VALUE (G_SETTINGS_BIND_GET, "get"),
  G_DEFINE_ENUM_VALUE (G_SETTINGS_BIND_SET, "set"),
  G_DEFINE_ENUM_VALUE (G_SETTINGS_BIND_NO_SENSITIVITY, "no-sensitivity"),
  G_DEFINE_ENUM_VALUE (G_SETTINGS_BIND_GET_NO_CHANGES, "get-no-changes"),
  G_DEFINE_ENUM_VALUE (G_SETTINGS_BIND_INVERT_BOOLEAN, "invert-boolean"))

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()