1 #ifndef __FOO_OBJECT_H__
2 #define __FOO_OBJECT_H__
4 #include <glib-object.h>
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))
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))
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))
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;
26 struct _FooInterfaceIface
28 GTypeInterface parent_iface;
31 GType foo_interface_get_type (void) G_GNUC_CONST;
35 GObject parent_instance;
38 struct _FooObjectClass
40 GObjectClass parent_class;
42 gboolean (* virtual_method) (FooObject *object, int first_param);
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,
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);
64 FooObject parent_instance;
67 struct _FooSubobjectClass
69 FooObjectClass parent_class;
72 GType foo_subobject_get_type (void) G_GNUC_CONST;
73 FooSubobject* foo_subobject_new ();
82 GType foo_enum_type_get_type (void);
84 int foo_enum_type_method (FooEnumType foo_enum);
88 FOO_FLAGS_FIRST = 1 << 0,
89 FOO_FLAGS_SECOND = 1 << 1,
90 FOO_FLAGS_THIRD = 1 << 2
100 GType foo_flags_type_get_type (void);
102 typedef struct _FooBoxed FooBoxed;
104 GType foo_boxed_get_type (void) G_GNUC_CONST;
105 FooBoxed* foo_boxed_new (void);
106 void foo_boxed_method (FooBoxed* boxed);
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;
115 typedef gboolean (* FooCallback) (FooObject *foo, gboolean b, gpointer data);
117 /* Invalid comments, should be ignored */
122 #endif /* __FOO_OBJECT_H__ */