1
0
Fork 0

bind-constraint: 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-10 15:28:19 +01:00
parent 1565756fea
commit 7e7e9795fe
3 changed files with 6 additions and 20 deletions

View file

@ -31,7 +31,6 @@
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, 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 (ClutterBoxLayout, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBrightnessContrastEffect, g_object_unref)

View file

@ -24,7 +24,7 @@
/**
* ClutterBindConstraint:
*
*
* A constraint binding the position or size of an actor
*
* #ClutterBindConstraint is a [class@Constraint] that binds the
@ -94,10 +94,6 @@
#include "clutter/clutter-enum-types.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
{
ClutterConstraint parent_instance;
@ -108,11 +104,6 @@ struct _ClutterBindConstraint
gfloat offset;
};
struct _ClutterBindConstraintClass
{
ClutterConstraintClass parent_class;
};
enum
{
PROP_0,
@ -126,9 +117,9 @@ enum
static GParamSpec *obj_props[PROP_LAST];
G_DEFINE_TYPE (ClutterBindConstraint,
clutter_bind_constraint,
CLUTTER_TYPE_CONSTRAINT);
G_DEFINE_FINAL_TYPE (ClutterBindConstraint,
clutter_bind_constraint,
CLUTTER_TYPE_CONSTRAINT);
static void
source_queue_relayout (ClutterActor *source,

View file

@ -33,14 +33,10 @@
G_BEGIN_DECLS
#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
GType clutter_bind_constraint_get_type (void) G_GNUC_CONST;
G_DECLARE_FINAL_TYPE (ClutterBindConstraint, clutter_bind_constraint,
CLUTTER, BIND_CONSTRAINT, ClutterConstraint)
CLUTTER_EXPORT
ClutterConstraint * clutter_bind_constraint_new (ClutterActor *source,