summaryrefslogtreecommitdiff
path: root/gobject/gtype.h
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2015-04-20 14:11:12 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2015-05-25 14:02:43 +0100
commit5e7e058a9c26fa735386cf45b41ad91cc7768137 (patch)
tree7d10c189f314c85f3df9f7311400291f8f6be581 /gobject/gtype.h
parent7313195ae776dad441b18fb948149dfdd6ae76cc (diff)
downloadglib-5e7e058a9c26fa735386cf45b41ad91cc7768137.tar.gz
docs: Add an example of G_DEFINE_BOXED_TYPE
Mention that the GType of the boxed type is stored inside the g_define_type_id variable. See bug: https://bugzilla.gnome.org/show_bug.cgi?id=723394
Diffstat (limited to 'gobject/gtype.h')
-rw-r--r--gobject/gtype.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/gobject/gtype.h b/gobject/gtype.h
index 68bc051f1..611e637b6 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -2021,7 +2021,17 @@ type_name##_get_type (void) \
* A convenience macro for boxed type implementations.
* Similar to G_DEFINE_BOXED_TYPE(), but allows to insert custom code into the
* type_name_get_type() function, e.g. to register value transformations with
- * g_value_register_transform_func().
+ * g_value_register_transform_func(), for instance:
+ *
+ * |[<!-- language="C" -->
+ * G_DEFINE_BOXED_TYPE_WITH_CODE (GdkRectangle, gdk_rectangle,
+ * gdk_rectangle_copy,
+ * gdk_rectangle_free,
+ * register_rectangle_transform_funcs (g_define_type_id))
+ * ]|
+ *
+ * Similarly to the %G_DEFINE_TYPE family of macros, the #GType of the newly
+ * defined boxed type is exposed in the `g_define_type_id` variable.
*
* Since: 2.26
*/