From befb21cbb27a8fd04ede3943a35727ef6bdbff9a Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Tue, 2 Jan 2024 09:28:07 +0100 Subject: [PATCH] cally/clone: Use macros for subclassing boilerplate Part-of: --- clutter/clutter/cally/cally-clone.h | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/clutter/clutter/cally/cally-clone.h b/clutter/clutter/cally/cally-clone.h index d6eadf12a..26c32fb13 100644 --- a/clutter/clutter/cally/cally-clone.h +++ b/clutter/clutter/cally/cally-clone.h @@ -30,23 +30,16 @@ G_BEGIN_DECLS #define CALLY_TYPE_CLONE (cally_clone_get_type ()) -#define CALLY_CLONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALLY_TYPE_CLONE, CallyClone)) -#define CALLY_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALLY_TYPE_CLONE, CallyCloneClass)) -#define CALLY_IS_CLONE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALLY_TYPE_CLONE)) -#define CALLY_IS_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALLY_TYPE_CLONE)) -#define CALLY_CLONE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALLY_TYPE_CLONE, CallyCloneClass)) -typedef struct _CallyClone CallyClone; -typedef struct _CallyCloneClass CallyCloneClass; -typedef struct _CallyClonePrivate CallyClonePrivate; +CLUTTER_EXPORT +G_DECLARE_DERIVABLE_TYPE (CallyClone, + cally_clone, + CALLY, + CLONE, + CallyActor) -struct _CallyClone -{ - /*< private >*/ - CallyActor parent; - - CallyClonePrivate *priv; -}; +typedef struct _CallyClone CallyClone; +typedef struct _CallyCloneClass CallyCloneClass; struct _CallyCloneClass { @@ -54,8 +47,6 @@ struct _CallyCloneClass CallyActorClass parent_class; }; -CLUTTER_EXPORT -GType cally_clone_get_type (void) G_GNUC_CONST; CLUTTER_EXPORT AtkObject *cally_clone_new (ClutterActor *actor);