8605f26793e71a1a5db6c286d2bfa31808f15016
[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
61
62 struct _FooSubobject
63 {
64   FooObject parent_instance;
65 };
66
67 struct _FooSubobjectClass
68 {
69   FooObjectClass parent_class;
70 };
71
72 GType                 foo_subobject_get_type       (void) G_GNUC_CONST;
73 FooSubobject*         foo_subobject_new            ();
74
75 typedef enum
76 {
77   FOO_ENUM_ALPHA,
78   FOO_ENUM_BETA,
79   FOO_ENUM_DELTA
80 } FooEnumType;
81
82 GType foo_enum_type_get_type (void);
83
84 int                   foo_enum_type_method         (FooEnumType foo_enum);
85
86 typedef enum
87 {
88   FOO_FLAGS_FIRST  = 1 << 0,
89   FOO_FLAGS_SECOND = 1 << 1,
90   FOO_FLAGS_THIRD  = 1 << 2
91 } FooFlagsType;
92
93 typedef enum
94 {
95   FOO_ENUM_UN = 1,
96   FOO_ENUM_DEUX = 2,
97   FOO_ENUM_TROIS = 3,
98 } FooEnumNoType;
99
100 GType foo_flags_type_get_type (void);
101
102 typedef struct _FooBoxed FooBoxed;
103
104 GType                 foo_boxed_get_type       (void) G_GNUC_CONST;
105 FooBoxed*             foo_boxed_new            (void);
106 void                  foo_boxed_method         (FooBoxed* boxed);
107
108 /* FIXME: Scanner does not support this yet
109 const char *FOO_CONSTANT_STR = "foo-constant-str";
110 const int FOO_CONSTANT_INT = 10;
111 const float FOO_CONSTANT_FLOAT = 10;
112 */
113
114 /* Callback */
115 typedef gboolean (* FooCallback) (FooObject *foo, gboolean b, gpointer data);
116
117 /* Invalid comments, should be ignored */
118
119 /* @ */
120 /* @: */
121
122 #endif /* __FOO_OBJECT_H__ */