1
0
Fork 0

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
This commit is contained in:
Niels De Graef 2019-01-08 15:35:01 +01:00 committed by Jonas Ådahl
parent b77e6f0c98
commit 41a69f194d
3 changed files with 8 additions and 16 deletions

View file

@ -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;

View file

@ -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

View file

@ -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);