[mutter/wip/nielsdg/use-g-declare-interface: 52/53] clutter: MasterClock: Use G_DECLARE_INTERFACE()
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/nielsdg/use-g-declare-interface: 52/53] clutter: MasterClock: Use G_DECLARE_INTERFACE()
- Date: Wed, 27 Feb 2019 16:44:54 +0000 (UTC)
commit 41a69f194d6333d654b5a82a364fae73d27452b5
Author: Niels De Graef <niels degraef barco 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]