[cally] Removed default actions on CallyActor

This commit is contained in:
Alejandro Piñeiro 2011-05-19 12:58:36 +02:00
parent d007155ac4
commit 46aadb745b

View File

@ -79,21 +79,20 @@
* *
* ### * ###
* *
* #AtkAction implementation. As ClutterActor has signals for "press" * #AtkAction implementation: on previous releases ClutterActor added
* and "release", and most of the general Clutter objects are being * the actions "press", "release" and "click", as at that time some
* used as buttons, it has sense to implement #AtkAction on * general-purpose actors like textures were directly used as buttons.
* #CallyActor, so this actions were added in this level.
* *
* So we should search a way to extend #AtkAction on subclasses, to * But now, new toolkits appeared, providing high-level widgets, like
* add actions. The direct solution would be just extend it normally, * buttons. So in this environment, it doesn't make sense to keep
* but we also should have the option to remove actions if required. * adding them as default.
* *
* So it was used the solution implemented in GailCell: maintain a * Anyway, current implementation of AtkAction is done at CallyActor
* list of actions, and add a _add_action and _remove_action public * providing methods to add and remove actions. This is based on the
* methods. * one used at gailcell, and proposed as a change on #AtkAction
* interface:
* *
* This is another reason to not isolate CALLY as GAIL (although the * https://bugzilla.gnome.org/show_bug.cgi?id=649804
* current idea is to not do that).
* *
*/ */
@ -204,9 +203,6 @@ static G_CONST_RETURN gchar* cally_actor_action_get_name (AtkAction *acti
static gboolean cally_actor_action_set_description (AtkAction *action, static gboolean cally_actor_action_set_description (AtkAction *action,
gint i, gint i,
const gchar *desc); const gchar *desc);
static void _cally_actor_press_action (CallyActor *cally_actor);
static void _cally_actor_release_action (CallyActor *cally_actor);
static void _cally_actor_click_action (CallyActor *cally_actor);
static void _cally_actor_destroy_action_info (gpointer action_info, static void _cally_actor_destroy_action_info (gpointer action_info,
gpointer user_data); gpointer user_data);
static void _cally_actor_clean_action_list (CallyActor *cally_actor); static void _cally_actor_clean_action_list (CallyActor *cally_actor);
@ -303,16 +299,6 @@ cally_actor_initialize (AtkObject *obj,
g_object_set_data (G_OBJECT (obj), "atk-component-layer", g_object_set_data (G_OBJECT (obj), "atk-component-layer",
GINT_TO_POINTER (ATK_LAYER_MDI)); GINT_TO_POINTER (ATK_LAYER_MDI));
/* add basic actions */
cally_actor_add_action (self, "press", NULL, NULL,
_cally_actor_press_action);
cally_actor_add_action (self, "release", NULL, NULL,
_cally_actor_release_action);
cally_actor_add_action (self, "click", NULL, NULL,
_cally_actor_click_action);
/* Depends if the object implement ClutterContainer */ /* Depends if the object implement ClutterContainer */
if (CLUTTER_IS_CONTAINER(actor)) if (CLUTTER_IS_CONTAINER(actor))
{ {
@ -1302,69 +1288,6 @@ _cally_actor_get_action_info (CallyActor *cally_actor,
return (CallyActorActionInfo *)(node->data); return (CallyActorActionInfo *)(node->data);
} }
static void
_cally_actor_click_action (CallyActor *cally_actor)
{
ClutterEvent tmp_event;
ClutterActor *stage = NULL;
ClutterActor *actor = NULL;
actor = CALLY_GET_CLUTTER_ACTOR (cally_actor);
stage = clutter_actor_get_stage (actor);
/* press */
tmp_event.button.type = CLUTTER_BUTTON_PRESS;
tmp_event.button.time = CLUTTER_CURRENT_TIME;
tmp_event.button.stage = CLUTTER_STAGE (stage);
tmp_event.button.source = actor;
tmp_event.button.button = 1;
clutter_actor_event (actor, &tmp_event, FALSE);
/* release */
tmp_event.button.type = CLUTTER_BUTTON_RELEASE;
clutter_actor_event (actor, &tmp_event, FALSE);
}
static void
_cally_actor_press_action (CallyActor *cally_actor)
{
ClutterEvent tmp_event;
ClutterActor *stage = NULL;
ClutterActor *actor = NULL;
actor = CALLY_GET_CLUTTER_ACTOR (cally_actor);
stage = clutter_actor_get_stage (actor);
tmp_event.button.type = CLUTTER_BUTTON_PRESS;
tmp_event.button.time = CLUTTER_CURRENT_TIME;
tmp_event.button.stage = CLUTTER_STAGE (stage);
tmp_event.button.source = actor;
tmp_event.button.button = 1;
clutter_actor_event (actor, &tmp_event, FALSE);
}
static void
_cally_actor_release_action (CallyActor *cally_actor)
{
ClutterEvent tmp_event;
ClutterActor *stage = NULL;
ClutterActor *actor = NULL;
actor = CALLY_GET_CLUTTER_ACTOR (cally_actor);
stage = clutter_actor_get_stage (actor);
tmp_event.button.type = CLUTTER_BUTTON_RELEASE;
tmp_event.button.time = CLUTTER_CURRENT_TIME;
tmp_event.button.stage = CLUTTER_STAGE (stage);
tmp_event.button.source = actor;
tmp_event.button.button = 1;
clutter_actor_event (actor, &tmp_event, FALSE);
}
/** /**
* cally_actor_add_action: (skip) * cally_actor_add_action: (skip)
* @cally_actor: a #CallyActor * @cally_actor: a #CallyActor