actor: Put get_accessible() at the end of the class structure

New virtual functions cannot go wherever they want, if we need to
preserve the ABI.

Also, the coding style should match the rest of ClutterActor and
Clutter's own coding style.
This commit is contained in:
Emmanuele Bassi 2010-05-25 12:54:59 +01:00
parent b0c0f24bd2
commit 7bf93e3e84
2 changed files with 14 additions and 23 deletions

View File

@ -3320,7 +3320,7 @@ clutter_actor_finalize (GObject *object)
/** /**
* clutter_actor_get_accessible: * clutter_actor_get_accessible:
* @actor: a #ClutterActor * @self: a #ClutterActor
* *
* Returns the accessible object that describes the actor to an * Returns the accessible object that describes the actor to an
* assistive technology. * assistive technology.
@ -3337,38 +3337,29 @@ clutter_actor_finalize (GObject *object)
* *
* Returns: (transfer none): the #AtkObject associated with @actor * Returns: (transfer none): the #AtkObject associated with @actor
*/ */
AtkObject* AtkObject *
clutter_actor_get_accessible (ClutterActor *actor) clutter_actor_get_accessible (ClutterActor *self)
{ {
ClutterActorClass *klass; g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); return CLUTTER_ACTOR_GET_CLASS (self)->get_accessible (actor);
klass = CLUTTER_ACTOR_GET_CLASS (actor);
g_return_val_if_fail (klass->get_accessible != NULL, NULL);
return klass->get_accessible (actor);
} }
static AtkObject* static AtkObject *
clutter_actor_real_get_accessible (ClutterActor *actor) clutter_actor_real_get_accessible (ClutterActor *actor)
{ {
AtkObject* accessible; return atk_gobject_accessible_for_object (G_OBJECT (actor));
accessible = atk_gobject_accessible_for_object (G_OBJECT (actor));
return accessible;
} }
static AtkObject* static AtkObject *
_clutter_actor_ref_accessible (AtkImplementor *implementor) _clutter_actor_ref_accessible (AtkImplementor *implementor)
{ {
AtkObject *accessible; AtkObject *accessible;
accessible = clutter_actor_get_accessible (CLUTTER_ACTOR (implementor)); accessible = clutter_actor_get_accessible (CLUTTER_ACTOR (implementor));
if (accessible) if (accessible != NULL)
g_object_ref (accessible); g_object_ref (accessible);
return accessible; return accessible;
} }

View File

@ -276,9 +276,6 @@ struct _ClutterActorClass
void (* apply_transform) (ClutterActor *actor, void (* apply_transform) (ClutterActor *actor,
CoglMatrix *matrix); CoglMatrix *matrix);
/* accessibility support */
AtkObject* (*get_accessible) (ClutterActor *actor);
/* event signals */ /* event signals */
gboolean (* event) (ClutterActor *actor, gboolean (* event) (ClutterActor *actor,
ClutterEvent *event); ClutterEvent *event);
@ -305,6 +302,9 @@ struct _ClutterActorClass
void (* queue_relayout) (ClutterActor *actor); void (* queue_relayout) (ClutterActor *actor);
/* accessibility support */
AtkObject * (* get_accessible) (ClutterActor *actor);
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[30]; gpointer _padding_dummy[30];
@ -570,7 +570,7 @@ void clutter_actor_pop_internal (ClutterActor *sel
gboolean clutter_actor_has_allocation (ClutterActor *self); gboolean clutter_actor_has_allocation (ClutterActor *self);
AtkObject* clutter_actor_get_accessible (ClutterActor *actor); AtkObject * clutter_actor_get_accessible (ClutterActor *self);
G_END_DECLS G_END_DECLS