page-turn-effect: Use macros for subclassing boilerplate

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
This commit is contained in:
Bilal Elmoussaoui 2023-11-11 09:19:57 +01:00
parent 581343dc9a
commit 9bd12d7e88
3 changed files with 5 additions and 17 deletions

View File

@ -41,7 +41,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterFlowLayout, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterGridLayout, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterGridLayout, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInputDevice, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInputDevice, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInterval, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInterval, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPageTurnEffect, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterScrollActor, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterScrollActor, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterStage, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterStage, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterText, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterText, g_object_unref)

View File

@ -27,7 +27,7 @@
/** /**
* ClutterPageTurnEffect: * ClutterPageTurnEffect:
* *
* A page turning effect * A page turning effect
* *
* A simple page turning effect * A simple page turning effect
@ -42,10 +42,6 @@
#include "clutter/clutter-debug.h" #include "clutter/clutter-debug.h"
#include "clutter/clutter-private.h" #include "clutter/clutter-private.h"
#define CLUTTER_PAGE_TURN_EFFECT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CLUTTER_TYPE_PAGE_TURN_EFFECT, ClutterPageTurnEffectClass))
#define CLUTTER_IS_PAGE_TURN_EFFECT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CLUTTER_TYPE_PAGE_TURN_EFFECT))
#define CLUTTER_PAGE_TURN_EFFECT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CLUTTER_TYPE_PAGE_TURN_EFFECT, ClutterPageTurnEffectClass))
struct _ClutterPageTurnEffect struct _ClutterPageTurnEffect
{ {
ClutterDeformEffect parent_instance; ClutterDeformEffect parent_instance;
@ -56,11 +52,6 @@ struct _ClutterPageTurnEffect
gfloat radius; gfloat radius;
}; };
struct _ClutterPageTurnEffectClass
{
ClutterDeformEffectClass parent_class;
};
enum enum
{ {
PROP_0, PROP_0,

View File

@ -36,14 +36,12 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define CLUTTER_TYPE_PAGE_TURN_EFFECT (clutter_page_turn_effect_get_type ()) #define CLUTTER_TYPE_PAGE_TURN_EFFECT (clutter_page_turn_effect_get_type ())
#define CLUTTER_PAGE_TURN_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_PAGE_TURN_EFFECT, ClutterPageTurnEffect))
#define CLUTTER_IS_PAGE_TURN_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_PAGE_TURN_EFFECT))
typedef struct _ClutterPageTurnEffect ClutterPageTurnEffect;
typedef struct _ClutterPageTurnEffectClass ClutterPageTurnEffectClass;
CLUTTER_EXPORT CLUTTER_EXPORT
GType clutter_page_turn_effect_get_type (void) G_GNUC_CONST; G_DECLARE_FINAL_TYPE (ClutterPageTurnEffect,
clutter_page_turn_effect,
CLUTTER, PAGE_TURN_EFFECT,
ClutterDeformEffect)
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterEffect *clutter_page_turn_effect_new (gdouble period, ClutterEffect *clutter_page_turn_effect_new (gdouble period,