Add two new functions to check sequence return values. Also fixes a
[platform/upstream/gobject-introspection.git] / tests / parser / foo-object.h
1 #ifndef __FOO_OBJECT_H__
2 #define __FOO_OBJECT_H__
3
4 #include <glib-object.h>
5 #include "utility.h"
6
7 #define FOO_TYPE_INTERFACE           (foo_interface_get_type ())
8 #define FOO_INTERFACE(object)        (G_TYPE_CHECK_INSTANCE_CAST ((object), FOO_TYPE_INTERFACE, FooInterface))
9 #define FOO_IS_INTERFACE(object)     (G_TYPE_CHECK_INSTANCE_TYPE ((object), FOO_TYPE_INTERFACE))
10
11 #define FOO_TYPE_OBJECT              (foo_object_get_type ())
12 #define FOO_OBJECT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), FOO_TYPE_OBJECT, FooObject))
13 #define FOO_IS_OBJECT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), FOO_TYPE_OBJECT))
14
15 #define FOO_TYPE_SUBOBJECT           (foo_subobject_get_type ())
16 #define FOO_SUBOBJECT(subobject)     (G_TYPE_CHECK_INSTANCE_CAST ((subobject), FOO_TYPE_SUBOBJECT, FooSubobject))
17 #define FOO_IS_SUBOBJECT(subobject)  (G_TYPE_CHECK_INSTANCE_TYPE ((subobject), FOO_TYPE_SUBOBJECT))
18
19 typedef struct _FooInterface       FooInterface;
20 typedef struct _FooInterfaceIface  FooInterfaceIface;
21 typedef struct _FooObject          FooObject;
22 typedef struct _FooObjectClass     FooObjectClass;
23 typedef struct _FooSubobject       FooSubobject;
24 typedef struct _FooSubobjectClass  FooSubobjectClass;
25
26 struct _FooInterfaceIface
27 {
28   GTypeInterface parent_iface;
29 };
30
31 GType                 foo_interface_get_type       (void) G_GNUC_CONST;
32
33 struct _FooObject
34 {
35   GObject parent_instance;
36 };
37
38 struct _FooObjectClass
39 {
40   GObjectClass parent_class;
41
42   gboolean (* virtual_method) (FooObject *object, int first_param);
43 };
44
45 gint                  foo_init                     (void);
46
47 GType                 foo_object_get_type          (void) G_GNUC_CONST;
48 FooObject*            foo_object_new               ();
49 gint                  foo_object_method            (FooObject *object);
50 UtilityObject*        foo_object_external_type     (FooObject *object);
51 gint                  foo_object_out               (FooObject *object,
52                                                     int       *outarg);
53 GObject*              foo_object_create_object     (FooObject *object);
54 gint                  foo_object_inout             (FooObject *object, int *inoutarg);
55 gint                  foo_object_inout2            (FooObject *object, int *inoutarg);
56 gint                  foo_object_inout3            (FooObject *object, int *inoutarg);
57 gint                  foo_object_in                (FooObject *object, int *inarg);
58 gint                  foo_object_calleeowns        (FooObject *object, GObject *toown);
59 gint                  foo_object_calleesowns       (FooObject *object, GObject *toown1, GObject *toown2);
60 GList*                foo_object_get_strings       (FooObject *object);
61 GSList*               foo_object_get_objects       (FooObject *object);
62
63
64 struct _FooSubobject
65 {
66   FooObject parent_instance;
67 };
68
69 struct _FooSubobjectClass
70 {
71   FooObjectClass parent_class;
72 };
73
74 GType                 foo_subobject_get_type       (void) G_GNUC_CONST;
75 FooSubobject*         foo_subobject_new            ();
76
77 typedef enum
78 {
79   FOO_ENUM_ALPHA,
80   FOO_ENUM_BETA,
81   FOO_ENUM_DELTA
82 } FooEnumType;
83
84 GType foo_enum_type_get_type (void);
85
86 int                   foo_enum_type_method         (FooEnumType foo_enum);
87
88 typedef enum
89 {
90   FOO_FLAGS_FIRST  = 1 << 0,
91   FOO_FLAGS_SECOND = 1 << 1,
92   FOO_FLAGS_THIRD  = 1 << 2
93 } FooFlagsType;
94
95 typedef enum
96 {
97   FOO_ENUM_UN = 1,
98   FOO_ENUM_DEUX = 2,
99   FOO_ENUM_TROIS = 3,
100 } FooEnumNoType;
101
102 GType foo_flags_type_get_type (void);
103
104 typedef struct _FooBoxed FooBoxed;
105
106 GType                 foo_boxed_get_type       (void) G_GNUC_CONST;
107 FooBoxed*             foo_boxed_new            (void);
108 void                  foo_boxed_method         (FooBoxed* boxed);
109
110 /* FIXME: Scanner does not support this yet
111 const char *FOO_CONSTANT_STR = "foo-constant-str";
112 const int FOO_CONSTANT_INT = 10;
113 const float FOO_CONSTANT_FLOAT = 10;
114 */
115
116 /* Callback */
117 typedef gboolean (* FooCallback) (FooObject *foo, gboolean b, gpointer data);
118
119 /* Invalid comments, should be ignored */
120
121 /* @ */
122 /* @: */
123
124 #endif /* __FOO_OBJECT_H__ */