1 #include "test-unknown.h"
4 PROP_SOME_PROPERTY
= 1,
9 test_interface_base_init (gpointer g_iface
)
11 static gboolean initialized
= FALSE
;
15 g_object_interface_install_property (g_iface
,
16 g_param_spec_string ("some-property",
18 "A simple test property",
27 test_interface_get_type (void)
29 static GType gtype
= 0;
33 static const GTypeInfo info
=
35 sizeof (TestInterfaceIface
), /* class_size */
36 test_interface_base_init
, /* base_init */
37 NULL
, /* base_finalize */
39 NULL
, /* class_finalize */
40 NULL
, /* class_data */
47 g_type_register_static (G_TYPE_INTERFACE
, "TestInterface",
50 g_type_interface_add_prerequisite (gtype
, G_TYPE_OBJECT
);
56 static void test_unknown_iface_method (TestInterface
*iface
)
61 test_unknown_test_interface_init (TestInterfaceIface
*iface
)
63 iface
->iface_method
= test_unknown_iface_method
;
66 G_DEFINE_TYPE_WITH_CODE (TestUnknown
, test_unknown
, G_TYPE_OBJECT
,
67 G_IMPLEMENT_INTERFACE (TEST_TYPE_INTERFACE
,
68 test_unknown_test_interface_init
));
70 static void test_unknown_init (TestUnknown
*self
) {}
74 test_unknown_get_property (GObject
*object
,
83 test_unknown_set_property (GObject
*object
,
91 static void test_unknown_class_init (TestUnknownClass
*klass
)
93 GObjectClass
*gobject_class
= (GObjectClass
*) klass
;
95 gobject_class
->get_property
= test_unknown_get_property
;
96 gobject_class
->set_property
= test_unknown_set_property
;
99 g_object_class_install_property (G_OBJECT_CLASS (klass
),
101 g_param_spec_string ("some-property",
103 "A simple test property",
108 void test_interface_iface_method (TestInterface
*instance
)
110 TestInterfaceIface
*iface
= TEST_INTERFACE_GET_IFACE (instance
);
112 (* iface
->iface_method
) (instance
);