1 #ifndef __FOO_OBJECT_H__
2 #define __FOO_OBJECT_H__
4 #include <glib-object.h>
6 #define FOO_TYPE_INTERFACE (foo_interface_get_type ())
7 #define FOO_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), FOO_TYPE_INTERFACE, FooInterface))
8 #define FOO_IS_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), FOO_TYPE_INTERFACE))
10 #define FOO_TYPE_OBJECT (foo_object_get_type ())
11 #define FOO_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), FOO_TYPE_OBJECT, FooObject))
12 #define FOO_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), FOO_TYPE_OBJECT))
14 #define FOO_TYPE_SUBOBJECT (foo_subobject_get_type ())
15 #define FOO_SUBOBJECT(subobject) (G_TYPE_CHECK_INSTANCE_CAST ((subobject), FOO_TYPE_SUBOBJECT, FooSubobject))
16 #define FOO_IS_SUBOBJECT(subobject) (G_TYPE_CHECK_INSTANCE_TYPE ((subobject), FOO_TYPE_SUBOBJECT))
18 typedef struct _FooInterface FooInterface;
19 typedef struct _FooInterfaceIface FooInterfaceIface;
20 typedef struct _FooObject FooObject;
21 typedef struct _FooObjectClass FooObjectClass;
22 typedef struct _FooSubobject FooSubobject;
23 typedef struct _FooSubobjectClass FooSubobjectClass;
25 struct _FooInterfaceIface
27 GTypeInterface parent_iface;
30 GType foo_interface_get_type (void) G_GNUC_CONST;
34 GObject parent_instance;
37 struct _FooObjectClass
39 GObjectClass parent_class;
47 GType foo_object_get_type (void) G_GNUC_CONST;
48 FooObject* foo_object_new ();
49 gint foo_object_method (FooObject *object);
53 FooObject parent_instance;
56 struct _FooSubobjectClass
58 FooObjectClass parent_class;
61 GType foo_subobject_get_type (void) G_GNUC_CONST;
62 FooSubobject* foo_subobject_new ();
71 GType foo_enum_get_type (void);
75 FOO_FLAGS_FIRST = 1 << 0,
76 FOO_FLAGS_SECOND = 1 << 1,
77 FOO_FLAGS_THIRD = 1 << 2
87 GType foo_flags_get_type (void);
89 typedef struct _FooBoxed FooBoxed;
91 GType foo_boxed_get_type (void) G_GNUC_CONST;
92 FooBoxed* foo_boxed_new (void);
93 void foo_boxed_method (FooBoxed* boxed);
95 /* Invalid comments, should be ignored */
100 #endif /* __FOO_OBJECT_H__ */