1 #include "annotation.h"
3 static char backslash_parsing_tester = '\\';
5 G_DEFINE_TYPE (AnnotationObject, annotation_object, G_TYPE_OBJECT);
8 annotation_object_class_init (AnnotationObjectClass *klass)
14 annotation_object_init (AnnotationObject *object)
20 * annotation_object_method:
23 * Return value: an int
26 annotation_object_method (AnnotationObject *object)
32 * annotation_object_out:
35 * This is a test for out arguments
37 * @outarg: (out): This is an argument test
38 * Return value: an int
41 annotation_object_out (AnnotationObject *object, int *outarg)
48 * annotation_object_in:
51 * This is a test for in arguments
53 * @inarg: (in): This is an argument test
54 * Return value: an int
57 annotation_object_in (AnnotationObject *object, int *inarg)
64 * annotation_object_inout:
67 * This is a test for out arguments
69 * @inoutarg: (inout): This is an argument test
70 * Return value: an int
73 annotation_object_inout (AnnotationObject *object, int *inoutarg)
75 return *inoutarg += 1;
79 * annotation_object_inout2:
82 * This is a second test for out arguments
84 * @inoutarg: (inout): This is an argument test
85 * Return value: an int
88 annotation_object_inout2 (AnnotationObject *object, int *inoutarg)
90 return *inoutarg += 1;
95 * annotation_object_inout3:
98 * This is a 3th test for out arguments
100 * @inoutarg: (inout) (allow-none): This is an argument test
101 * Return value: an int
104 annotation_object_inout3 (AnnotationObject *object, int *inoutarg)
107 return *inoutarg + 1;
112 * annotation_object_calleeowns:
113 * @object: a #GObject
115 * This is a test for out arguments; GObject defaults to transfer
117 * @toown: (out): a #GObject
118 * Return value: an int
121 annotation_object_calleeowns (AnnotationObject *object, GObject **toown)
128 * annotation_object_calleesowns:
129 * @object: a #GObject
131 * This is a test for out arguments, one transferred, other not
133 * @toown1: (out) (transfer): a #GObject
134 * @toown2: (out) (transfer none): a #GObject
135 * Return value: an int
138 annotation_object_calleesowns (AnnotationObject *object,
147 * annotation_object_get_strings:
148 * @object: a #GObject
150 * This is a test for returning a list of strings, where
151 * each string needs to be freed.
153 * Return value: (element-type utf8) (transfer): list of strings
156 annotation_object_get_strings (AnnotationObject *object)
159 list = g_list_prepend (list, g_strdup ("annotation"));
160 list = g_list_prepend (list, g_strdup ("bar"));
165 * annotation_object_get_hash:
166 * @object: a #GObject
168 * This is a test for returning a hash table mapping strings to
171 * Return value: (element-type utf8 GObject): hash table
174 annotation_object_get_hash (AnnotationObject *object)
176 GHashTable *hash = g_hash_table_new_full (g_str_hash, g_str_equal,
177 g_free, g_object_unref);
178 g_hash_table_insert (hash, g_strdup ("one"), g_object_ref (object));
179 g_hash_table_insert (hash, g_strdup ("two"), g_object_ref (object));
184 * annotation_object_with_voidp
185 * @data: Opaque pointer handle
188 annotation_object_with_voidp (AnnotationObject *object, void *data)
194 * annotation_object_get_objects:
195 * @object: a #GObject
197 * This is a test for returning a list of objects.
198 * The list itself should be freed, but not the internal objects,
199 * intentionally similar example to gtk_container_get_children
201 * Return value: (element-type AnnotationObject) (transfer container): list of objects
204 annotation_object_get_objects (AnnotationObject *object)
207 list = g_slist_prepend (list, object);
212 * annotation_object_create_object:
213 * @object: a #GObject
215 * Test returning a caller-owned object
217 * Return value: (transfer): The object
220 annotation_object_create_object (AnnotationObject *object)
222 return g_object_ref (object);
226 annotation_object_use_buffer (AnnotationObject *object,
233 * annotation_object_compute_sum:
234 * @object: a #GObject
235 * @nums: (array): Sequence of numbers
237 * Test taking a zero-terminated array
240 annotation_object_compute_sum (AnnotationObject *object,
247 * annotation_object_compute_sum_n:
248 * @object: a #GObject
249 * @nums: (array length=n_nums): Sequence of numbers
250 * @n_nums: Length of number array
252 * Test taking an array with length parameter
255 annotation_object_compute_sum_n(AnnotationObject *object,
263 * annotation_object_compute_sum_nz:
264 * @object: a #AnnotationObject
265 * @nums: (array length=n_nums zero-terminated=1): Sequence of numbers
266 * @n_nums: Length of number array
268 * Test taking a zero-terminated array with length parameter
271 annotation_object_compute_sum_nz(AnnotationObject *object,
279 * annotation_object_parse_args:
280 * @object: a #AnnotationObject
281 * @argc: (inout): Length of the argument vector
282 * @argv: (inout) (array length=argc zero-terminated=1): Argument vector
284 * Test taking a zero-terminated array with length parameter
287 annotation_object_parse_args(AnnotationObject *object,
295 * annotation_object_allow_none:
296 * @object: a #GObject
297 * @somearg: (allow-none):
300 annotation_object_allow_none (AnnotationObject *object, const gchar *somearg)
306 * annotation_object_notrans:
307 * @object: a #GObject
309 * Returns: (transfer none): An object, not referenced
313 annotation_object_notrans (AnnotationObject *object)
319 * annotation_object_do_not_use:
320 * @object: a #GObject
322 * Deprecated: 0.12: Use annotation_object_create_object() instead.
325 annotation_object_do_not_use (AnnotationObject *object)
332 * @argc: (inout): The number of args.
333 * @argv: (inout) (array length=argc zero-terminated=1): The arguments.
336 annotation_init (int *argc, char ***argv)
342 static char backslash_parsing_tester_2 = '\\';