From a59bd4cfbb08501a9ba6ccf8061ee461b2271a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Tue, 13 Apr 2010 13:23:15 +0200 Subject: [PATCH] Implement AtkImplementor on ClutterActor Implements AtkImplementor interface on ClutterActor, and his method atk_implementor_ref_accessible. More information: http://library.gnome.org/devel/atk/stable/AtkObject.html#AtkImplementor --- clutter/Makefile.am | 1 + clutter/clutter-actor.c | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/clutter/Makefile.am b/clutter/Makefile.am index f1e9bca53..b71d1e6d2 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -313,6 +313,7 @@ Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_ --c-include='clutter/clutter.h' \ --include=GL-1.0 \ --include=GObject-2.0 \ + --include=Atk-1.0 \ --include=Pango-1.0 \ --include=PangoCairo-1.0 \ --include=Cogl-@CLUTTER_API_VERSION@ \ diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index efe22dd19..4657fe910 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -578,6 +578,7 @@ static guint actor_signals[LAST_SIGNAL] = { 0, }; static void clutter_scriptable_iface_init (ClutterScriptableIface *iface); static void clutter_animatable_iface_init (ClutterAnimatableIface *iface); +static void atk_implementor_iface_init (AtkImplementorIface *iface); static void _clutter_actor_apply_modelview_transform (ClutterActor *self); @@ -645,7 +646,9 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ClutterActor, G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE, clutter_scriptable_iface_init) G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_ANIMATABLE, - clutter_animatable_iface_init)); + clutter_animatable_iface_init) + G_IMPLEMENT_INTERFACE (ATK_TYPE_IMPLEMENTOR, + atk_implementor_iface_init)); static const gchar * get_actor_debug_name (ClutterActor *actor) @@ -3358,6 +3361,23 @@ clutter_actor_real_get_accessible (ClutterActor *actor) return accessible; } +static AtkObject* +_clutter_actor_ref_accessible (AtkImplementor *implementor) +{ + AtkObject *accessible; + + accessible = clutter_actor_get_accessible (CLUTTER_ACTOR (implementor)); + if (accessible) + g_object_ref (accessible); + return accessible; +} + +static void +atk_implementor_iface_init (AtkImplementorIface *iface) +{ + iface->ref_accessible = _clutter_actor_ref_accessible; +} + static void clutter_actor_class_init (ClutterActorClass *klass) {