mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
clutter: Animatable: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for `g_autoptr`, and removes the typedef hack inside clutter-scroll-actor.c. https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
This commit is contained in:
parent
41a69f194d
commit
16a2eab290
@ -1023,7 +1023,7 @@ typedef struct _TransitionClosure
|
||||
|
||||
static void clutter_container_iface_init (ClutterContainerIface *iface);
|
||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
||||
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
||||
static void atk_implementor_iface_init (AtkImplementorIface *iface);
|
||||
|
||||
/* These setters are all static for now, maybe they should be in the
|
||||
@ -15119,7 +15119,7 @@ clutter_actor_set_final_state (ClutterAnimatable *animatable,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
||||
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||
{
|
||||
iface->find_property = clutter_actor_find_property;
|
||||
iface->get_initial_state = clutter_actor_get_initial_state;
|
||||
|
@ -30,7 +30,7 @@
|
||||
* to control how a #ClutterAnimation will animate a property.
|
||||
*
|
||||
* Each #ClutterAnimatable should implement the
|
||||
* #ClutterAnimatableIface.interpolate_property() virtual function of the
|
||||
* #ClutterAnimatableInterface.interpolate_property() virtual function of the
|
||||
* interface to compute the animation state between two values of an interval
|
||||
* depending on a progress factor, expressed as a floating point value.
|
||||
*
|
||||
@ -57,7 +57,6 @@
|
||||
#include "deprecated/clutter-animatable.h"
|
||||
#include "deprecated/clutter-animation.h"
|
||||
|
||||
typedef ClutterAnimatableIface ClutterAnimatableInterface;
|
||||
G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
|
||||
|
||||
static void
|
||||
@ -101,7 +100,7 @@ clutter_animatable_animate_property (ClutterAnimatable *animatable,
|
||||
gdouble progress,
|
||||
GValue *value)
|
||||
{
|
||||
ClutterAnimatableIface *iface;
|
||||
ClutterAnimatableInterface *iface;
|
||||
gboolean res;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
||||
@ -155,7 +154,7 @@ GParamSpec *
|
||||
clutter_animatable_find_property (ClutterAnimatable *animatable,
|
||||
const gchar *property_name)
|
||||
{
|
||||
ClutterAnimatableIface *iface;
|
||||
ClutterAnimatableInterface *iface;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), NULL);
|
||||
g_return_val_if_fail (property_name != NULL, NULL);
|
||||
@ -185,7 +184,7 @@ clutter_animatable_get_initial_state (ClutterAnimatable *animatable,
|
||||
const gchar *property_name,
|
||||
GValue *value)
|
||||
{
|
||||
ClutterAnimatableIface *iface;
|
||||
ClutterAnimatableInterface *iface;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
||||
g_return_if_fail (property_name != NULL);
|
||||
@ -214,7 +213,7 @@ clutter_animatable_set_final_state (ClutterAnimatable *animatable,
|
||||
const gchar *property_name,
|
||||
const GValue *value)
|
||||
{
|
||||
ClutterAnimatableIface *iface;
|
||||
ClutterAnimatableInterface *iface;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
|
||||
g_return_if_fail (property_name != NULL);
|
||||
@ -260,7 +259,7 @@ clutter_animatable_interpolate_value (ClutterAnimatable *animatable,
|
||||
gdouble progress,
|
||||
GValue *value)
|
||||
{
|
||||
ClutterAnimatableIface *iface;
|
||||
ClutterAnimatableInterface *iface;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
|
||||
g_return_val_if_fail (property_name != NULL, FALSE);
|
||||
|
@ -33,24 +33,15 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_ANIMATABLE (clutter_animatable_get_type ())
|
||||
#define CLUTTER_ANIMATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatable))
|
||||
#define CLUTTER_IS_ANIMATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATABLE))
|
||||
#define CLUTTER_ANIMATABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatableIface))
|
||||
#define CLUTTER_TYPE_ANIMATABLE (clutter_animatable_get_type ())
|
||||
|
||||
typedef struct _ClutterAnimatableIface ClutterAnimatableIface;
|
||||
CLUTTER_EXPORT
|
||||
G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable,
|
||||
CLUTTER, ANIMATABLE,
|
||||
GObject)
|
||||
|
||||
/**
|
||||
* ClutterAnimatable:
|
||||
*
|
||||
* #ClutterAnimatable is an opaque structure whose members cannot be directly
|
||||
* accessed
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* ClutterAnimatableIface:
|
||||
* ClutterAnimatableInterface:
|
||||
* @animate_property: virtual function for custom interpolation of a
|
||||
* property. This virtual function is deprecated
|
||||
* @find_property: virtual function for retrieving the #GParamSpec of
|
||||
@ -67,7 +58,7 @@ typedef struct _ClutterAnimatableIface ClutterAnimatableIface;
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
struct _ClutterAnimatableIface
|
||||
struct _ClutterAnimatableInterface
|
||||
{
|
||||
/*< private >*/
|
||||
GTypeInterface parent_iface;
|
||||
@ -95,9 +86,6 @@ struct _ClutterAnimatableIface
|
||||
GValue *value);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GType clutter_animatable_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GParamSpec *clutter_animatable_find_property (ClutterAnimatable *animatable,
|
||||
const gchar *property_name);
|
||||
|
@ -34,7 +34,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAction, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorMeta, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAnimatable, 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 (ClutterBindingPool, g_object_unref)
|
||||
|
@ -84,9 +84,9 @@ enum
|
||||
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
||||
static GParamSpec *animatable_props[ANIM_PROP_LAST] = { NULL, };
|
||||
|
||||
static ClutterAnimatableIface *parent_animatable_iface = NULL;
|
||||
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
|
||||
|
||||
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
||||
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_ACTOR,
|
||||
G_ADD_PRIVATE (ClutterScrollActor)
|
||||
@ -240,7 +240,7 @@ clutter_scroll_actor_get_initial_state (ClutterAnimatable *animatable,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
||||
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||
{
|
||||
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
|
@ -279,7 +279,7 @@ static const ClutterColor default_selected_text_color = { 0, 0, 0, 255 };
|
||||
|
||||
static CoglPipeline *default_color_pipeline = NULL;
|
||||
|
||||
static ClutterAnimatableIface *parent_animatable_iface = NULL;
|
||||
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
|
||||
static ClutterScriptableIface *parent_scriptable_iface = NULL;
|
||||
|
||||
/* ClutterTextInputFocus */
|
||||
@ -389,7 +389,7 @@ clutter_text_input_focus_new (ClutterText *text)
|
||||
|
||||
/* ClutterText */
|
||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
|
||||
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (ClutterText,
|
||||
clutter_text,
|
||||
@ -3547,7 +3547,7 @@ clutter_text_set_final_state (ClutterAnimatable *animatable,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
|
||||
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
|
||||
{
|
||||
parent_animatable_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user