From 105c8583eed5ec205621c31de2b856b4630e7a5a Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Tue, 2 Jan 2024 09:19:16 +0100 Subject: [PATCH] cally/util: Use macros for subclassing boilerplate Part-of: --- clutter/clutter/cally/cally-util.h | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/clutter/clutter/cally/cally-util.h b/clutter/clutter/cally/cally-util.h index faaf6a6dc..41cbc2619 100644 --- a/clutter/clutter/cally/cally-util.h +++ b/clutter/clutter/cally/cally-util.h @@ -30,23 +30,16 @@ G_BEGIN_DECLS #define CALLY_TYPE_UTIL (cally_util_get_type ()) -#define CALLY_UTIL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALLY_TYPE_UTIL, CallyUtil)) -#define CALLY_UTIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALLY_TYPE_UTIL, CallyUtilClass)) -#define CALLY_IS_UTIL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALLY_TYPE_UTIL)) -#define CALLY_IS_UTIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALLY_TYPE_UTIL)) -#define CALLY_UTIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALLY_TYPE_UTIL, CallyUtilClass)) typedef struct _CallyUtil CallyUtil; typedef struct _CallyUtilClass CallyUtilClass; -typedef struct _CallyUtilPrivate CallyUtilPrivate; -struct _CallyUtil -{ - /*< private >*/ - AtkUtil parent; - - CallyUtilPrivate *priv; -}; +CLUTTER_EXPORT +G_DECLARE_DERIVABLE_TYPE (CallyUtil, + cally_util, + CALLY, + UTIL, + AtkUtil) struct _CallyUtilClass { @@ -54,9 +47,6 @@ struct _CallyUtilClass AtkUtilClass parent_class; }; -CLUTTER_EXPORT -GType cally_util_get_type (void) G_GNUC_CONST; - void _cally_util_override_atk_util (void); gboolean cally_snoop_key_event (ClutterStage *stage,