4
#include "test-interfaces.h"
7
test_hello_dbus_say_hello (TestHello *hello,
11
*message = test_hello_say_hello (hello);
16
test_goodbye_dbus_say_goodbye (TestGoodbye *goodbye,
20
*message = test_goodbye_say_goodbye (goodbye);
24
#include "test-hello-glue.h"
25
#include "test-goodbye-glue.h"
32
static guint signals[LAST_SIGNAL];
35
test_hello_class_init (gpointer g_iface)
37
GType iface_type = G_TYPE_FROM_INTERFACE (g_iface);
40
g_signal_new ("greetings",
43
G_STRUCT_OFFSET (TestHelloIface, greetings),
45
g_cclosure_marshal_VOID__VOID,
49
dbus_g_object_type_install_info (iface_type,
50
&dbus_glib_test_hello_object_info);
54
test_hello_get_type (void)
56
static GType the_type = 0;
58
if (G_UNLIKELY (the_type == 0)) {
59
static const GTypeInfo info = {
60
sizeof (TestHelloIface),
62
(GClassInitFunc) test_hello_class_init,
63
NULL, NULL, 0, 0, NULL
66
the_type = g_type_register_static (G_TYPE_INTERFACE,
67
g_intern_static_string ("TestHello"),
69
g_type_interface_add_prerequisite (the_type, G_TYPE_OBJECT);
75
test_hello_say_hello (TestHello *hello)
77
g_return_val_if_fail (TEST_IS_HELLO (hello), NULL);
79
return (* TEST_HELLO_GET_IFACE (hello)->say_hello) (hello);
83
test_hello_greetings (TestHello *hello)
85
g_return_if_fail (TEST_IS_HELLO (hello));
87
g_signal_emit (hello, signals[GREETINGS], 0);
91
test_goodbye_class_init (gpointer g_iface)
93
GType iface_type = G_TYPE_FROM_INTERFACE (g_iface);
95
dbus_g_object_type_install_info (iface_type,
96
&dbus_glib_test_goodbye_object_info);
100
test_goodbye_get_type (void)
102
static GType the_type = 0;
104
if (G_UNLIKELY (the_type == 0)) {
105
static const GTypeInfo info = {
106
sizeof (TestGoodbyeIface),
108
(GClassInitFunc) test_goodbye_class_init,
109
NULL, NULL, 0, 0, NULL
112
the_type = g_type_register_static (G_TYPE_INTERFACE,
113
g_intern_static_string ("TestGoodbye"),
115
g_type_interface_add_prerequisite (the_type, G_TYPE_OBJECT);
121
test_goodbye_say_goodbye (TestGoodbye *goodbye)
123
g_return_val_if_fail (TEST_IS_GOODBYE (goodbye), NULL);
125
return (* TEST_GOODBYE_GET_IFACE (goodbye)->say_goodbye) (goodbye);