align-constraint: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
This commit is contained in:
parent
ae23caa537
commit
1565756fea
3 changed files with 6 additions and 20 deletions
|
@ -24,7 +24,7 @@
|
|||
|
||||
/**
|
||||
* ClutterAlignConstraint:
|
||||
*
|
||||
*
|
||||
* A constraint aligning the position of an actor
|
||||
*
|
||||
* #ClutterAlignConstraint is a [class@Constraint] that aligns the position
|
||||
|
@ -45,10 +45,6 @@
|
|||
|
||||
#include <math.h>
|
||||
|
||||
#define CLUTTER_ALIGN_CONSTRAINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ALIGN_CONSTRAINT, ClutterAlignConstraintClass))
|
||||
#define CLUTTER_IS_ALIGN_CONSTRAINT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ALIGN_CONSTRAINT))
|
||||
#define CLUTTER_ALIGN_CONSTRAINT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ALIGN_CONSTRAINT, ClutterAlignConstraintClass))
|
||||
|
||||
struct _ClutterAlignConstraint
|
||||
{
|
||||
ClutterConstraint parent_instance;
|
||||
|
@ -60,11 +56,6 @@ struct _ClutterAlignConstraint
|
|||
gfloat factor;
|
||||
};
|
||||
|
||||
struct _ClutterAlignConstraintClass
|
||||
{
|
||||
ClutterConstraintClass parent_class;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
@ -79,9 +70,9 @@ enum
|
|||
|
||||
static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
G_DEFINE_TYPE (ClutterAlignConstraint,
|
||||
clutter_align_constraint,
|
||||
CLUTTER_TYPE_CONSTRAINT);
|
||||
G_DEFINE_FINAL_TYPE (ClutterAlignConstraint,
|
||||
clutter_align_constraint,
|
||||
CLUTTER_TYPE_CONSTRAINT);
|
||||
|
||||
static void
|
||||
source_queue_relayout (ClutterActor *actor,
|
||||
|
|
|
@ -33,14 +33,10 @@
|
|||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_ALIGN_CONSTRAINT (clutter_align_constraint_get_type ())
|
||||
#define CLUTTER_ALIGN_CONSTRAINT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ALIGN_CONSTRAINT, ClutterAlignConstraint))
|
||||
#define CLUTTER_IS_ALIGN_CONSTRAINT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ALIGN_CONSTRAINT))
|
||||
|
||||
typedef struct _ClutterAlignConstraint ClutterAlignConstraint;
|
||||
typedef struct _ClutterAlignConstraintClass ClutterAlignConstraintClass;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_align_constraint_get_type (void) G_GNUC_CONST;
|
||||
G_DECLARE_FINAL_TYPE (ClutterAlignConstraint, clutter_align_constraint,
|
||||
CLUTTER, ALIGN_CONSTRAINT, ClutterConstraint)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterConstraint *clutter_align_constraint_new (ClutterActor *source,
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#ifndef __GI_SCANNER__
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackend, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBlurEffect, g_object_unref)
|
||||
|
|
Loading…
Reference in a new issue