bind-constraint: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
This commit is contained in:
parent
1565756fea
commit
7e7e9795fe
3 changed files with 6 additions and 20 deletions
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackend, 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)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBlurEffect, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBoxLayout, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBoxLayout, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBrightnessContrastEffect, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBrightnessContrastEffect, g_object_unref)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterBindConstraint:
|
* ClutterBindConstraint:
|
||||||
*
|
*
|
||||||
* A constraint binding the position or size of an actor
|
* A constraint binding the position or size of an actor
|
||||||
*
|
*
|
||||||
* #ClutterBindConstraint is a [class@Constraint] that binds the
|
* #ClutterBindConstraint is a [class@Constraint] that binds the
|
||||||
|
@ -94,10 +94,6 @@
|
||||||
#include "clutter/clutter-enum-types.h"
|
#include "clutter/clutter-enum-types.h"
|
||||||
#include "clutter/clutter-private.h"
|
#include "clutter/clutter-private.h"
|
||||||
|
|
||||||
#define CLUTTER_BIND_CONSTRAINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BIND_CONSTRAINT, ClutterBindConstraintClass))
|
|
||||||
#define CLUTTER_IS_BIND_CONSTRAINT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BIND_CONSTRAINT))
|
|
||||||
#define CLUTTER_BIND_CONSTRAINT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BIND_CONSTRAINT, ClutterBindConstraintClass))
|
|
||||||
|
|
||||||
struct _ClutterBindConstraint
|
struct _ClutterBindConstraint
|
||||||
{
|
{
|
||||||
ClutterConstraint parent_instance;
|
ClutterConstraint parent_instance;
|
||||||
|
@ -108,11 +104,6 @@ struct _ClutterBindConstraint
|
||||||
gfloat offset;
|
gfloat offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterBindConstraintClass
|
|
||||||
{
|
|
||||||
ClutterConstraintClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
@ -126,9 +117,9 @@ enum
|
||||||
|
|
||||||
static GParamSpec *obj_props[PROP_LAST];
|
static GParamSpec *obj_props[PROP_LAST];
|
||||||
|
|
||||||
G_DEFINE_TYPE (ClutterBindConstraint,
|
G_DEFINE_FINAL_TYPE (ClutterBindConstraint,
|
||||||
clutter_bind_constraint,
|
clutter_bind_constraint,
|
||||||
CLUTTER_TYPE_CONSTRAINT);
|
CLUTTER_TYPE_CONSTRAINT);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
source_queue_relayout (ClutterActor *source,
|
source_queue_relayout (ClutterActor *source,
|
||||||
|
|
|
@ -33,14 +33,10 @@
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_BIND_CONSTRAINT (clutter_bind_constraint_get_type ())
|
#define CLUTTER_TYPE_BIND_CONSTRAINT (clutter_bind_constraint_get_type ())
|
||||||
#define CLUTTER_BIND_CONSTRAINT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BIND_CONSTRAINT, ClutterBindConstraint))
|
|
||||||
#define CLUTTER_IS_BIND_CONSTRAINT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BIND_CONSTRAINT))
|
|
||||||
|
|
||||||
typedef struct _ClutterBindConstraint ClutterBindConstraint;
|
|
||||||
typedef struct _ClutterBindConstraintClass ClutterBindConstraintClass;
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
GType clutter_bind_constraint_get_type (void) G_GNUC_CONST;
|
G_DECLARE_FINAL_TYPE (ClutterBindConstraint, clutter_bind_constraint,
|
||||||
|
CLUTTER, BIND_CONSTRAINT, ClutterConstraint)
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterConstraint * clutter_bind_constraint_new (ClutterActor *source,
|
ClutterConstraint * clutter_bind_constraint_new (ClutterActor *source,
|
||||||
|
|
Loading…
Reference in a new issue