diff options
author | Tomeu Vizoso <tomeu@sugarlabs.org> | 2009-05-05 16:33:55 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@sugarlabs.org> | 2009-05-05 16:33:55 (GMT) |
commit | ca0b5b6a4693c20e6750e6c055bb833c79a78ba2 (patch) | |
tree | 81941a514d36b306a8fb0ac09af150fde9a6ba35 | |
parent | b52ad5856b2f5d890afa6b3598f9a80ff2222112 (diff) |
Add an interface to Everything
-rw-r--r-- | tests/everything/everything.c | 22 | ||||
-rw-r--r-- | tests/everything/everything.h | 13 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/everything/everything.c b/tests/everything/everything.c index 7348a50..5e3e7ad 100644 --- a/tests/everything/everything.c +++ b/tests/everything/everything.c @@ -1004,3 +1004,25 @@ test_callback_infinte (TestCallbackUserData callback, return callback(user_data); } +/* interface */ + +static void +test_interface_class_init(void *g_iface) +{ +} + +GType +test_interface_get_type(void) +{ + static GType type = 0; + if (type == 0) { + type = g_type_register_static_simple (G_TYPE_INTERFACE, + "TestInterface", + sizeof (TestInterfaceIface), + (GClassInitFunc) test_interface_class_init, + 0, NULL, 0); + } + + return type; +} + diff --git a/tests/everything/everything.h b/tests/everything/everything.h index b62b8bf..2af628f 100644 --- a/tests/everything/everything.h +++ b/tests/everything/everything.h @@ -226,5 +226,18 @@ int test_callback_thaw_notifications (void); int test_callback_infinte (TestCallbackUserData callback, gpointer user_data); +/* interface */ +#define TEST_TYPE_INTERFACE (test_interface_get_type ()) +#define TEST_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_INTERFACE, TestInterface)) +#define TEST_IS_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_INTERFACE)) +#define TEST_INTERFACE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEST_TYPE_INTERFACE, TestInterfaceIface)) + +typedef struct _TestInterfaceIface TestInterfaceIface; + +struct _TestInterfaceIface { + GTypeInterface base_iface; +}; + +GType test_interface_get_type (void) G_GNUC_CONST; #endif /* __GITESTTYPES_H__ */ |