[gobject-introspection] regress: Use G_DEFINE_INTERFACE



commit 14eefe4776bc1e08238bfcf53619e8d260413834
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Jul 15 22:47:53 2012 -0400

    regress: Use G_DEFINE_INTERFACE
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679981

 tests/scanner/regress.c |   17 +++--------------
 1 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 43db1b0..910f01a 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -3429,24 +3429,13 @@ regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback)
 /* interface */
 
 static void
-regress_test_interface_class_init(void *g_iface)
+regress_test_interface_default_init(RegressTestInterfaceIface *iface)
 {
 }
 
-GType
-regress_test_interface_get_type(void)
-{
-    static GType type = 0;
-    if (type == 0) {
-        type = g_type_register_static_simple (G_TYPE_INTERFACE,
-                                              "RegressTestInterface",
-                                              sizeof (RegressTestInterfaceIface),
-                                              (GClassInitFunc) regress_test_interface_class_init,
-                                              0, NULL, 0);
-    }
+typedef RegressTestInterfaceIface RegressTestInterfaceInterface;
+G_DEFINE_INTERFACE (RegressTestInterface, regress_test_interface, G_TYPE_OBJECT)
 
-    return type;
-}
 
 /* gobject with non-standard prefix */
 G_DEFINE_TYPE(RegressTestWi8021x, regress_test_wi_802_1x, G_TYPE_OBJECT);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]