[mutter/wip/nielsdg/use-g-declare-interface: 155/156] clutter: MasterClock: Use G_DECLARE_INTERFACE()



commit 28bcc6618bd21d8e156a1705c3a248769cc7629c
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Tue Jan 8 15:35:01 2019 +0100

    clutter: MasterClock: Use G_DECLARE_INTERFACE()
    
    It cuts away a bit of the GObject boilerplate, gives us support for
    `g_autoptr`, and removes the typedef hack inside clutter-master-clock.c.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/380

 clutter/clutter/clutter-master-clock-default.c |  5 +++--
 clutter/clutter/clutter-master-clock.c         |  4 ----
 clutter/clutter/clutter-master-clock.h         | 15 +++++----------
 3 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/clutter/clutter/clutter-master-clock-default.c b/clutter/clutter/clutter-master-clock-default.c
index a0909ff95..0647c3a7f 100644
--- a/clutter/clutter/clutter-master-clock-default.c
+++ b/clutter/clutter/clutter-master-clock-default.c
@@ -109,7 +109,8 @@ static GSourceFuncs clock_funcs = {
   NULL
 };
 
-static void clutter_master_clock_iface_init (ClutterMasterClockIface *iface);
+static void
+clutter_master_clock_iface_init (ClutterMasterClockInterface *iface);
 
 #define clutter_master_clock_default_get_type   _clutter_master_clock_default_get_type
 
@@ -689,7 +690,7 @@ clutter_master_clock_default_set_paused (ClutterMasterClock *clock,
 }
 
 static void
-clutter_master_clock_iface_init (ClutterMasterClockIface *iface)
+clutter_master_clock_iface_init (ClutterMasterClockInterface *iface)
 {
   iface->add_timeline = clutter_master_clock_default_add_timeline;
   iface->remove_timeline = clutter_master_clock_default_remove_timeline;
diff --git a/clutter/clutter/clutter-master-clock.c b/clutter/clutter/clutter-master-clock.c
index 6a0c87364..c4dff9676 100644
--- a/clutter/clutter/clutter-master-clock.c
+++ b/clutter/clutter/clutter-master-clock.c
@@ -37,10 +37,6 @@
 #include "clutter-master-clock-default.h"
 #include "clutter-private.h"
 
-#define clutter_master_clock_get_type   _clutter_master_clock_get_type
-
-typedef ClutterMasterClockIface ClutterMasterClockInterface;
-
 G_DEFINE_INTERFACE (ClutterMasterClock, clutter_master_clock, G_TYPE_OBJECT)
 
 static void
diff --git a/clutter/clutter/clutter-master-clock.h b/clutter/clutter/clutter-master-clock.h
index 542b9176b..36e974f53 100644
--- a/clutter/clutter/clutter-master-clock.h
+++ b/clutter/clutter/clutter-master-clock.h
@@ -28,15 +28,12 @@
 
 G_BEGIN_DECLS
 
-#define CLUTTER_TYPE_MASTER_CLOCK               (_clutter_master_clock_get_type ())
-#define CLUTTER_MASTER_CLOCK(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClock))
-#define CLUTTER_IS_MASTER_CLOCK(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
CLUTTER_TYPE_MASTER_CLOCK))
-#define CLUTTER_MASTER_CLOCK_GET_IFACE(obj)     (G_TYPE_INSTANCE_GET_INTERFACE ((obj), 
CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClockIface))
+#define CLUTTER_TYPE_MASTER_CLOCK (clutter_master_clock_get_type ())
+G_DECLARE_INTERFACE (ClutterMasterClock, clutter_master_clock,
+                     CLUTTER, MASTER_CLOCK,
+                     GObject)
 
-typedef struct _ClutterMasterClock      ClutterMasterClock; /* dummy */
-typedef struct _ClutterMasterClockIface ClutterMasterClockIface;
-
-struct _ClutterMasterClockIface
+struct _ClutterMasterClockInterface
 {
   /*< private >*/
   GTypeInterface parent_iface;
@@ -51,8 +48,6 @@ struct _ClutterMasterClockIface
                                    gboolean            paused);
 };
 
-GType _clutter_master_clock_get_type (void) G_GNUC_CONST;
-
 ClutterMasterClock *    _clutter_master_clock_get_default               (void);
 void                    _clutter_master_clock_add_timeline              (ClutterMasterClock *master_clock,
                                                                          ClutterTimeline    *timeline);


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