binding-pool: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
This commit is contained in:
parent
e729e63963
commit
ae23caa537
@ -33,7 +33,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, 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 (ClutterBackend, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindingPool, 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)
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterBindingPool
|
* ClutterBindingPool
|
||||||
*
|
*
|
||||||
* Pool for key bindings
|
* Pool for key bindings
|
||||||
*
|
*
|
||||||
* #ClutterBindingPool is a data structure holding a set of key bindings.
|
* #ClutterBindingPool is a data structure holding a set of key bindings.
|
||||||
@ -101,16 +101,12 @@
|
|||||||
#include "clutter/clutter-marshal.h"
|
#include "clutter/clutter-marshal.h"
|
||||||
#include "clutter/clutter-private.h"
|
#include "clutter/clutter-private.h"
|
||||||
|
|
||||||
#define CLUTTER_BINDING_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPoolClass))
|
#define BINDING_MOD_MASK ((CLUTTER_SHIFT_MASK | \
|
||||||
#define CLUTTER_IS_BINDING_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CLUTTER_TYPE_BINDING_POOL))
|
|
||||||
#define CLUTTER_BINDING_POOL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPoolClass))
|
|
||||||
|
|
||||||
#define BINDING_MOD_MASK ((CLUTTER_SHIFT_MASK | \
|
|
||||||
CLUTTER_CONTROL_MASK | \
|
CLUTTER_CONTROL_MASK | \
|
||||||
CLUTTER_MOD1_MASK | \
|
CLUTTER_MOD1_MASK | \
|
||||||
CLUTTER_SUPER_MASK | \
|
CLUTTER_SUPER_MASK | \
|
||||||
CLUTTER_HYPER_MASK | \
|
CLUTTER_HYPER_MASK | \
|
||||||
CLUTTER_META_MASK) | CLUTTER_RELEASE_MASK)
|
CLUTTER_META_MASK) | CLUTTER_RELEASE_MASK)
|
||||||
|
|
||||||
typedef struct _ClutterBindingEntry ClutterBindingEntry;
|
typedef struct _ClutterBindingEntry ClutterBindingEntry;
|
||||||
|
|
||||||
@ -127,11 +123,6 @@ struct _ClutterBindingPool
|
|||||||
GHashTable *entries_hash;
|
GHashTable *entries_hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterBindingPoolClass
|
|
||||||
{
|
|
||||||
GObjectClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _ClutterBindingEntry
|
struct _ClutterBindingEntry
|
||||||
{
|
{
|
||||||
gchar *name; /* interned string, do not free */
|
gchar *name; /* interned string, do not free */
|
||||||
@ -155,7 +146,7 @@ enum
|
|||||||
|
|
||||||
static GParamSpec *obj_props[PROP_LAST];
|
static GParamSpec *obj_props[PROP_LAST];
|
||||||
|
|
||||||
G_DEFINE_TYPE (ClutterBindingPool, clutter_binding_pool, G_TYPE_OBJECT);
|
G_DEFINE_FINAL_TYPE (ClutterBindingPool, clutter_binding_pool, G_TYPE_OBJECT);
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
binding_entry_hash (gconstpointer v)
|
binding_entry_hash (gconstpointer v)
|
||||||
|
@ -34,11 +34,13 @@
|
|||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CLUTTER_TYPE_BINDING_POOL (clutter_binding_pool_get_type ())
|
#define CLUTTER_TYPE_BINDING_POOL (clutter_binding_pool_get_type ())
|
||||||
#define CLUTTER_BINDING_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPool))
|
|
||||||
#define CLUTTER_IS_BINDING_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BINDING_POOL))
|
|
||||||
|
|
||||||
typedef struct _ClutterBindingPool ClutterBindingPool;
|
CLUTTER_EXPORT
|
||||||
typedef struct _ClutterBindingPoolClass ClutterBindingPoolClass;
|
G_DECLARE_FINAL_TYPE (ClutterBindingPool,
|
||||||
|
clutter_binding_pool,
|
||||||
|
CLUTTER,
|
||||||
|
BINDING_POOL,
|
||||||
|
GObject)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterBindingActionFunc:
|
* ClutterBindingActionFunc:
|
||||||
@ -61,9 +63,6 @@ typedef gboolean (* ClutterBindingActionFunc) (GObject *gobject,
|
|||||||
ClutterModifierType modifiers,
|
ClutterModifierType modifiers,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
GType clutter_binding_pool_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterBindingPool * clutter_binding_pool_new (const gchar *name);
|
ClutterBindingPool * clutter_binding_pool_new (const gchar *name);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
Loading…
Reference in New Issue
Block a user