[mutter/wip/nielsdg/use-g-declare-interface: 2/2] clutter: MasterClock: use G_DECLARE_INTERFACE()
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/nielsdg/use-g-declare-interface: 2/2] clutter: MasterClock: use G_DECLARE_INTERFACE()
- Date: Tue, 8 Jan 2019 14:44:13 +0000 (UTC)
commit 011dd92fdaeefc12d15929ea51dd28446e37f3fd
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.
clutter/clutter/clutter-master-clock-default.c | 7 +++----
clutter/clutter/clutter-master-clock.c | 4 ----
clutter/clutter/clutter-master-clock.h | 15 +++++----------
3 files changed, 8 insertions(+), 18 deletions(-)
---
diff --git a/clutter/clutter/clutter-master-clock-default.c b/clutter/clutter/clutter-master-clock-default.c
index a0909ff95..60a893bf5 100644
--- a/clutter/clutter/clutter-master-clock-default.c
+++ b/clutter/clutter/clutter-master-clock-default.c
@@ -109,9 +109,8 @@ static GSourceFuncs clock_funcs = {
NULL
};
-static void clutter_master_clock_iface_init (ClutterMasterClockIface *iface);
-
-#define clutter_master_clock_default_get_type _clutter_master_clock_default_get_type
+static void
+clutter_master_clock_iface_init (ClutterMasterClockInterface *iface);
G_DEFINE_TYPE_WITH_CODE (ClutterMasterClockDefault,
clutter_master_clock_default,
@@ -689,7 +688,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]