Implement AtkImplementor on ClutterActor
authorAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 13 Apr 2010 11:23:15 +0000 (13:23 +0200)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 24 May 2010 14:54:54 +0000 (15:54 +0100)
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
clutter/clutter-actor.c

index f1e9bca..b71d1e6 100644 (file)
@@ -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@ \
index efe22dd..4657fe9 100644 (file)
@@ -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)
 {