mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-21 22:59:16 +02:00
docs: Mention alternatives for defining enumeration types
We should mention glib-mkenums in the documentation for G_DEFINE_ENUM_TYPE and G_DEFINE_FLAGS_TYPE. We should also mention the macros in the documentation for glib-mkenums. This way, developers can choose the most appropriate tool for their use case.
This commit is contained in:
parent
6cbf7a7461
commit
fa05ebe27c
@ -44,6 +44,12 @@ input. The options specified control the text that generated, substituting vario
|
|||||||
keywords enclosed in <literal>@</literal> characters in the templates.
|
keywords enclosed in <literal>@</literal> characters in the templates.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>Since version 2.74, GLib provides the <literal>G_DEFINE_ENUM_TYPE</literal>
|
||||||
|
and <literal>G_DEFINE_FLAGS_TYPE</literal> C pre-processor macros. These macros
|
||||||
|
can be used to define a GType for projects that have few, small enumeration
|
||||||
|
types without going through the complexities of generating code at build
|
||||||
|
time.</para>
|
||||||
|
|
||||||
<refsect2><title>Production text substitutions</title>
|
<refsect2><title>Production text substitutions</title>
|
||||||
<para>
|
<para>
|
||||||
Certain keywords enclosed in <literal>@</literal> characters will be substituted in the
|
Certain keywords enclosed in <literal>@</literal> characters will be substituted in the
|
||||||
|
@ -307,6 +307,10 @@ void g_flags_complete_type_info (GType g_flags_type,
|
|||||||
* G_DEFINE_ENUM_VALUE (GTK_ORIENTATION_VERTICAL, "vertical"))
|
* 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.
|
||||||
|
*
|
||||||
* Since: 2.74
|
* Since: 2.74
|
||||||
*/
|
*/
|
||||||
#define G_DEFINE_ENUM_TYPE(TypeName, type_name, values) \
|
#define G_DEFINE_ENUM_TYPE(TypeName, type_name, values) \
|
||||||
@ -345,6 +349,10 @@ type_name ## _get_type (void) { \
|
|||||||
* G_DEFINE_ENUM_VALUE (G_SETTINGS_BIND_INVERT_BOOLEAN, "invert-boolean"))
|
* 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.
|
||||||
|
*
|
||||||
* Since: 2.74
|
* Since: 2.74
|
||||||
*/
|
*/
|
||||||
#define G_DEFINE_FLAGS_TYPE(TypeName, type_name, values) \
|
#define G_DEFINE_FLAGS_TYPE(TypeName, type_name, values) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user