1 /* doc-examples-obj.c */
3 #include "doc-examples-obj.h"
8 * This is an example of how to document a class
10 * This class has a signal: #DocExamplesObj::signal-example.
12 * And also has a property: #DocExamplesObj:property-example.
17 G_DEFINE_TYPE (DocExamplesObj, doc_examples_obj, G_TYPE_OBJECT)
20 doc_examples_obj_get_property (GObject *object,
28 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
33 doc_examples_obj_set_property (GObject *object,
41 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
46 doc_examples_obj_class_init (DocExamplesObjClass *klass)
48 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
51 gobject_class->get_property = doc_examples_obj_get_property;
52 gobject_class->set_property = doc_examples_obj_set_property;
55 * DocExamplesObj::signal-example:
57 * @int_param: a parameter of type int
58 * @float_param: a parameter of type float
60 * This is an example of how to document a signal.
64 g_signal_new ("signal-example",
65 G_TYPE_FROM_CLASS (gobject_class),
69 G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
72 * DocExamplesObj:property-example:
74 * This is an example of how to document a property.
76 * Type: GLib.HashTable(utf8,gint8)
81 pspec = g_param_spec_boxed ("property-example",
83 "A contained GHashTable",
86 g_object_class_install_property (gobject_class,
92 doc_examples_obj_init (DocExamplesObj *self)
98 doc_examples_obj_new (void)
100 return g_object_new (DOC_EXAMPLES_TYPE_OBJ, NULL);
104 * doc_examples_obj_method:
105 * @first_arg: first argument
106 * @second_arg: second argument
108 * This is an example of how to document a method.
113 doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg)