Bug 556475 – support Shadows: annotation
[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  * Attributes: (org.example.Test cows)
30  */
31 typedef struct _AnnotationObject          AnnotationObject;
32 typedef struct _AnnotationObjectClass     AnnotationObjectClass;
33
34 typedef void (*AnnotationForeachFunc) (AnnotationObject *object,
35                                        const char *item,
36                                        gpointer user_data);
37
38 struct _AnnotationObject
39 {
40   GObject parent_instance;
41 };
42
43 struct _AnnotationObjectClass
44 {
45   GObjectClass parent_class;
46 };
47
48 GType    annotation_object_get_type (void);
49
50 gint     annotation_object_method       (AnnotationObject *object);
51 gint     annotation_object_out          (AnnotationObject *object,
52                                          int              *outarg);
53 GObject* annotation_object_create_object(AnnotationObject *object);
54 GObject* annotation_object_allow_none   (AnnotationObject *object,
55                                          const gchar      *somearg);
56 GObject* annotation_object_notrans      (AnnotationObject *object);
57 gint     annotation_object_inout        (AnnotationObject *object,
58                                          int              *inoutarg);
59 gint     annotation_object_inout2       (AnnotationObject *object,
60                                          int              *inoutarg);
61 gint     annotation_object_inout3       (AnnotationObject *object,
62                                          int              *inoutarg);
63 gint     annotation_object_in           (AnnotationObject *object,
64                                          int              *inarg);
65 gint     annotation_object_calleeowns   (AnnotationObject *object,
66                                          GObject          **toown);
67 gint     annotation_object_calleesowns  (AnnotationObject *object,
68                                          GObject          **toown1,
69                                          GObject          **toown2);
70 GList*   annotation_object_get_strings  (AnnotationObject *object);
71 GHashTable*annotation_object_get_hash   (AnnotationObject *object);
72 void     annotation_object_with_voidp   (AnnotationObject *object,
73                                          void             *data);
74 GSList*  annotation_object_get_objects  (AnnotationObject *object);
75
76 void     annotation_object_use_buffer   (AnnotationObject *object,
77                                          guchar           *bytes);
78
79 void     annotation_object_compute_sum  (AnnotationObject *object,
80                                          int              *nums);
81
82 void     annotation_object_compute_sum_n(AnnotationObject *object,
83                                          int              *nums,
84                                          int               n_nums);
85 void     annotation_object_compute_sum_nz(AnnotationObject *object,
86                                           int             *nums,
87                                           int              n_nums);
88 void     annotation_object_parse_args   (AnnotationObject *object,
89                                          int              *argc,
90                                          char           ***argv);
91 gboolean annotation_object_string_out   (AnnotationObject *object,
92                                          char            **str_out);
93 void     annotation_object_foreach      (AnnotationObject *object,
94                                          AnnotationForeachFunc func,
95                                          gpointer user_data);
96
97 void     annotation_object_set_data     (AnnotationObject *object,
98                                          const guchar     *data,
99                                          gsize             length);
100 void     annotation_object_set_data2    (AnnotationObject *object,
101                                          const gchar      *data,
102                                          gsize             length);
103 void     annotation_object_set_data3    (AnnotationObject *object,
104                                          gpointer          data,
105                                          gsize             length);
106
107 GObject* annotation_object_do_not_use   (AnnotationObject *object);
108 void     annotation_object_watch        (AnnotationObject *object,
109                                          AnnotationForeachFunc func,
110                                          gpointer user_data);
111 void     annotation_object_watch_full   (AnnotationObject *object,
112                                          AnnotationForeachFunc func,
113                                          gpointer user_data,
114                                          GDestroyNotify destroy);
115
116 void     annotation_init                (int              *argc, 
117                                          char           ***argv);
118 char **  annotation_return_array        (int             *length);
119 void     annotation_versioned           (void);
120 char **  annotation_string_zero_terminated (void);
121 void     annotation_string_zero_terminated_out (char ***out);
122
123 void     annotation_object_extra_annos (AnnotationObject *object);
124
125 char *   annotation_get_source_file (void);
126 void     annotation_set_source_file (const char *fname);
127
128 /**
129  * AnnotationStruct:
130  *
131  * This is a test of an array of object in an field of a struct.
132  */
133 struct AnnotationStruct
134 {
135   AnnotationObject *objects[10];
136 };
137
138 #endif /* __ANNOTATION_OBJECT_H__ */