70cf3c707a7fe1adf264ed1a7bbc70442a5b6f27
[gnome.gobject-introspection] / tests / scanner / annotation.h
1 #ifndef __ANNOTATION_OBJECT_H__
2 #define __ANNOTATION_OBJECT_H__
3
4 #include <glib-object.h>
5
6 /**
7  * AnnotationCallback:
8  * @in: (in) (transfer none): array of ints
9  *
10  * This is a callback.
11  * Return value: (transfer none): array of ints
12  */
13 typedef const gint* (*AnnotationCallback) (const gint *in);
14
15 /**
16  * AnnotationListCallback:
17  * @in: (in) (transfer none) (element-type utf8): list of strings
18  *
19  * This is a callback taking a list.
20  * Return value: (transfer container) (element-type utf8): list of strings
21  */
22 typedef GList* (*AnnotationListCallback) (GList *in);
23
24 /**
25  * AnnotationObject:
26  *
27  * This is an object used to test annotations.
28  */
29 typedef struct _AnnotationObject          AnnotationObject;
30 typedef struct _AnnotationObjectClass     AnnotationObjectClass;
31
32 typedef void (*AnnotationForeachFunc) (AnnotationObject *object,
33                                        const char *item,
34                                        gpointer user_data);
35
36 struct _AnnotationObject
37 {
38   GObject parent_instance;
39 };
40
41 struct _AnnotationObjectClass
42 {
43   GObjectClass parent_class;
44 };
45
46 GType    annotation_object_get_type (void);
47
48 gint     annotation_object_method       (AnnotationObject *object);
49 gint     annotation_object_out          (AnnotationObject *object,
50                                          int              *outarg);
51 GObject* annotation_object_create_object(AnnotationObject *object);
52 GObject* annotation_object_allow_none   (AnnotationObject *object,
53                                          const gchar      *somearg);
54 GObject* annotation_object_notrans      (AnnotationObject *object);
55 gint     annotation_object_inout        (AnnotationObject *object,
56                                          int              *inoutarg);
57 gint     annotation_object_inout2       (AnnotationObject *object,
58                                          int              *inoutarg);
59 gint     annotation_object_inout3       (AnnotationObject *object,
60                                          int              *inoutarg);
61 gint     annotation_object_in           (AnnotationObject *object,
62                                          int              *inarg);
63 gint     annotation_object_calleeowns   (AnnotationObject *object,
64                                          GObject          **toown);
65 gint     annotation_object_calleesowns  (AnnotationObject *object,
66                                          GObject          **toown1,
67                                          GObject          **toown2);
68 GList*   annotation_object_get_strings  (AnnotationObject *object);
69 GHashTable*annotation_object_get_hash   (AnnotationObject *object);
70 GSList*  annotation_object_get_objects  (AnnotationObject *object);
71
72 void     annotation_object_use_buffer   (AnnotationObject *object,
73                                          guchar           *bytes);
74
75 void     annotation_object_compute_sum  (AnnotationObject *object,
76                                          int              *nums);
77
78 void     annotation_object_compute_sum_n(AnnotationObject *object,
79                                          int              *nums,
80                                          int               n_nums);
81 void     annotation_object_compute_sum_nz(AnnotationObject *object,
82                                           int             *nums,
83                                           int              n_nums);
84 void     annotation_object_parse_args   (AnnotationObject *object,
85                                          int              *argc,
86                                          char           ***argv);
87 gboolean annotation_object_string_out   (AnnotationObject *object,
88                                          char            **str_out);
89 void     annotation_object_foreach      (AnnotationObject *object,
90                                          AnnotationForeachFunc func,
91                                          gpointer user_data);
92
93 void     annotation_object_set_data     (AnnotationObject *object,
94                                          const guchar     *data,
95                                          gsize             length);
96 void     annotation_object_set_data2    (AnnotationObject *object,
97                                          const gchar      *data,
98                                          gsize             length);
99 void     annotation_object_set_data3    (AnnotationObject *object,
100                                          gpointer          data,
101                                          gsize             length);
102
103 GObject* annotation_object_do_not_use   (AnnotationObject *object);
104
105 void     annotation_init                (int              *argc, 
106                                          char           ***argv);
107 char **  annotation_return_array        (int             *length);
108 void     annotation_versioned           (void);
109 char **  annotation_string_zero_terminated (void);
110 void     annotation_string_zero_terminated_out (char ***out);
111
112 /**
113  * AnnotationStruct:
114  *
115  * This is a test of an array of object in an field of a struct.
116  */
117 struct AnnotationStruct
118 {
119   AnnotationObject *objects[10];
120 };
121
122 #endif /* __ANNOTATION_OBJECT_H__ */