From a944889f49c5ef63b4d59ae0ea4a38ad1fec5a64 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Fri, 10 Nov 2023 16:34:07 +0100 Subject: [PATCH] tap-action: Use macros for subclassing boilerplate Part-of: --- clutter/clutter/clutter-autocleanups.h | 1 - clutter/clutter/clutter-tap-action.h | 23 ++++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/clutter/clutter/clutter-autocleanups.h b/clutter/clutter/clutter-autocleanups.h index 63cb21c95..64661d1e9 100644 --- a/clutter/clutter/clutter-autocleanups.h +++ b/clutter/clutter/clutter-autocleanups.h @@ -51,7 +51,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterScrollActor, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterShaderEffect, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterStage, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterSwipeAction, g_object_unref) -G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterTapAction, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterTextBuffer, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterText, g_object_unref) diff --git a/clutter/clutter/clutter-tap-action.h b/clutter/clutter/clutter-tap-action.h index 702060e99..1b01013a8 100644 --- a/clutter/clutter/clutter-tap-action.h +++ b/clutter/clutter/clutter-tap-action.h @@ -42,21 +42,13 @@ G_BEGIN_DECLS #define CLUTTER_TYPE_TAP_ACTION (clutter_tap_action_get_type ()) -#define CLUTTER_TAP_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TAP_ACTION, ClutterTapAction)) -#define CLUTTER_IS_TAP_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TAP_ACTION)) -#define CLUTTER_TAP_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TAP_ACTION, ClutterTapActionClass)) -#define CLUTTER_IS_TAP_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TAP_ACTION)) -#define CLUTTER_TAP_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TAP_ACTION, ClutterTapActionClass)) -typedef struct _ClutterTapAction ClutterTapAction; -typedef struct _ClutterTapActionPrivate ClutterTapActionPrivate; -typedef struct _ClutterTapActionClass ClutterTapActionClass; - -struct _ClutterTapAction -{ - /*< private >*/ - ClutterGestureAction parent_instance; -}; +CLUTTER_EXPORT +G_DECLARE_DERIVABLE_TYPE (ClutterTapAction, + clutter_tap_action, + CLUTTER, + TAP_ACTION, + ClutterGestureAction) /** * ClutterTapActionClass: @@ -75,9 +67,6 @@ struct _ClutterTapActionClass ClutterActor *actor); }; -CLUTTER_EXPORT -GType clutter_tap_action_get_type (void) G_GNUC_CONST; - CLUTTER_EXPORT ClutterAction * clutter_tap_action_new (void); G_END_DECLS