efl/src/lib/edje/edje_callbacks.c

486 lines
14 KiB
C
Raw Normal View History

#include "edje_private.h"
#define EFL_INTERNAL_UNSTABLE
#include "interfaces/efl_common_internal.h"
static void
_edje_hold_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Hold *ev;
Edje *ed;
Edje_Real_Part *rp;
ev = event->info;
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if (!rp) return;
if (efl_input_hold_get(ev))
_edje_seat_emit(ed, efl_input_device_get(ev),
"hold,on", rp->part->name);
else
_edje_seat_emit(ed, efl_input_device_get(ev),
"hold,off", rp->part->name);
}
static void
_edje_focus_in_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Focus *ev;
Edje *ed;
Edje_Real_Part *rp;
ev = event->info;
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if ((!rp) || (!ed))
return;
_edje_seat_emit(ed, efl_input_device_get(ev),
"focus,part,in", rp->part->name);
}
static void
_edje_focus_out_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Focus *ev;
Edje *ed;
Edje_Real_Part *rp;
ev = event->info;
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if ((!rp) || (!ed))
return;
_edje_seat_emit(ed, efl_input_device_get(ev),
"focus,part,out", rp->part->name);
}
static void
_edje_mouse_in_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Pointer_Data *ev;
Edje *ed;
Edje_Real_Part *rp;
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if (rp)
{
if (!(ev->event_flags) || !(rp->ignore_flags & ev->event_flags))
_edje_seat_emit(ed, ev->device, "mouse,in", rp->part->name);
ev->event_flags |= rp->mask_flags;
}
}
static void
_edje_mouse_out_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Pointer_Data *ev;
Edje *ed;
Edje_Real_Part *rp;
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if (rp)
{
if (!(ev->event_flags) || !(rp->ignore_flags & ev->event_flags))
_edje_seat_emit(ed, ev->device, "mouse,out", rp->part->name);
ev->event_flags |= rp->mask_flags;
}
}
static void
_edje_mouse_down_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Pointer_Data *ev;
Edje *ed;
Edje_Real_Part *rp;
char buf[256];
int ignored;
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if (!rp) return;
ignored = rp->ignore_flags & ev->event_flags;
_edje_ref(ed);
_edje_util_freeze(ed);
if ((!ev->event_flags) || (!ignored))
{
if (ev->button_flags & EVAS_BUTTON_TRIPLE_CLICK)
snprintf(buf, sizeof(buf), "mouse,down,%i,triple", ev->button);
else if (ev->button_flags & EVAS_BUTTON_DOUBLE_CLICK)
snprintf(buf, sizeof(buf), "mouse,down,%i,double", ev->button);
else
snprintf(buf, sizeof(buf), "mouse,down,%i", ev->button);
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
}
2005-07-26 06:59:03 -07:00
if (rp->part->dragable.event_id >= 0)
{
rp = ed->table_parts[rp->part->dragable.event_id % ed->table_parts_size];
From: SHILPA ONKAR SINGH <shilpa.singh@samsung.com> Subject: [E-devel] [Edje]: Bug Fix: Edje draggable jumps when external events is used. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. SVN revision: 71277
2012-05-21 03:08:18 -07:00
if (!ignored)
{
snprintf(buf, sizeof(buf), "mouse,down,%i", ev->button);
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
From: SHILPA ONKAR SINGH <shilpa.singh@samsung.com> Subject: [E-devel] [Edje]: Bug Fix: Edje draggable jumps when external events is used. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. SVN revision: 71277
2012-05-21 03:08:18 -07:00
}
}
2005-07-26 06:59:03 -07:00
if (rp->drag)
{
if (rp->drag->down.count == 0)
{
if (rp->part->dragable.x)
rp->drag->down.x = ev->cur.x;
if (rp->part->dragable.y)
rp->drag->down.y = ev->cur.y;
2013-07-18 23:39:49 -07:00
rp->drag->threshold_x = EINA_FALSE;
rp->drag->threshold_y = EINA_FALSE;
rp->drag->threshold_started_x = EINA_TRUE;
rp->drag->threshold_started_y = EINA_TRUE;
}
rp->drag->down.count++;
}
if (rp->clicked_button == 0)
{
rp->clicked_button = ev->button;
if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
rp->still_in = EINA_TRUE;
}
// _edje_recalc_do(ed);
_edje_util_thaw(ed);
_edje_unref(ed);
ev->event_flags |= rp->mask_flags;
}
static void
_edje_mouse_up_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Pointer_Data *ev;
Edje *ed;
Edje_Real_Part *rp;
char buf[256];
int ignored;
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if (!rp) return;
2005-07-26 06:59:03 -07:00
ignored = rp->ignore_flags & ev->event_flags;
_edje_ref(ed);
_edje_util_freeze(ed);
2005-07-26 06:59:03 -07:00
if ((!ev->event_flags) || (!ignored))
{
snprintf(buf, sizeof(buf), "mouse,up,%i", ev->button);
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
}
2005-07-26 06:59:03 -07:00
if (rp->part->dragable.event_id >= 0)
{
rp = ed->table_parts[rp->part->dragable.event_id % ed->table_parts_size];
if (!ignored)
{
snprintf(buf, sizeof(buf), "mouse,up,%i", ev->button);
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
}
}
if (rp->drag)
{
if (rp->drag->down.count > 0)
{
rp->drag->down.count--;
if (rp->drag->down.count == 0)
{
2013-07-18 23:39:49 -07:00
rp->drag->threshold_started_x = EINA_FALSE;
rp->drag->threshold_started_y = EINA_FALSE;
rp->drag->need_reset = 1;
ed->recalc_call = EINA_TRUE;
ed->dirty = EINA_TRUE;
#ifdef EDJE_CALC_CACHE
rp->invalidate = EINA_TRUE;
#endif
if (!ignored && rp->drag->started)
_edje_seat_emit(ed, ev->device, "drag,stop",
rp->part->name);
2013-07-18 23:39:49 -07:00
rp->drag->started = EINA_FALSE;
_edje_recalc_do(ed);
}
}
}
if ((rp->still_in) && (rp->clicked_button == ev->button) && (!ev->event_flags))
{
snprintf(buf, sizeof(buf), "mouse,clicked,%i", ev->button);
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
}
rp->clicked_button = 0;
2013-11-20 20:00:55 -08:00
rp->still_in = EINA_FALSE;
// _edje_recalc_do(ed);
_edje_util_thaw(ed);
_edje_unref(ed);
ev->event_flags |= rp->mask_flags;
}
static void
_edje_mouse_move_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Pointer_Data *ev;
Edje *ed;
Edje_Real_Part *rp;
int ignored;
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if (!rp) return;
if (rp->part->dragable.event_id >= 0)
{
rp = ed->table_parts[rp->part->dragable.event_id % ed->table_parts_size];
}
2005-07-26 06:59:03 -07:00
ignored = rp->ignore_flags & ev->event_flags;
_edje_ref(ed);
if ((!ev->event_flags) || (!ignored))
_edje_seat_emit(ed, ev->device, "mouse,move", rp->part->name);
if (rp->still_in)
{
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
2013-11-20 20:00:55 -08:00
rp->still_in = EINA_FALSE;
else
{
Evas_Coord x, y, w, h;
evas_object_geometry_get(event->object, &x, &y, &w, &h);
if ((ev->cur.x < x) || (ev->cur.y < y) ||
(ev->cur.x >= (x + w)) || (ev->cur.y >= (y + h)))
{
if ((ev->pressed_buttons) && ((!ev->event_flags) || (!ignored)))
_edje_seat_emit(ed, ev->device, "mouse,pressed,out",
rp->part->name);
rp->still_in = EINA_FALSE;
}
}
}
else
{
if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
{
Evas_Coord x, y, w, h;
evas_object_geometry_get(event->object, &x, &y, &w, &h);
if ((ev->cur.x >= x) && (ev->cur.y >= y) &&
(ev->cur.x < (x + w)) && (ev->cur.y < (y + h)))
{
if ((ev->pressed_buttons) && ((!ev->event_flags) || (!ignored)))
_edje_seat_emit(ed, ev->device, "mouse,pressed,in",
rp->part->name);
rp->still_in = EINA_TRUE;
}
}
}
_edje_util_freeze(ed);
if (rp->drag)
{
if (rp->drag->down.count > 0)
{
if (rp->part->dragable.x)
rp->drag->tmp.x = ev->cur.x - rp->drag->down.x;
if (rp->part->dragable.y)
rp->drag->tmp.y = ev->cur.y - rp->drag->down.y;
ed->recalc_call = EINA_TRUE;
ed->dirty = EINA_TRUE;
#ifdef EDJE_CALC_CACHE
rp->invalidate = EINA_TRUE;
#endif
}
_edje_recalc_do(ed);
if (rp->drag->down.count > 0)
{
FLOAT_T dx, dy;
_edje_part_dragable_calc(ed, rp, &dx, &dy);
if ((NEQ(dx, rp->drag->val.x)) || (NEQ(dy, rp->drag->val.y)))
{
rp->drag->val.x = dx;
rp->drag->val.y = dy;
if (!ignored)
2013-07-18 23:39:49 -07:00
{
if (!rp->drag->started)
_edje_seat_emit(ed, ev->device, "drag,start",
rp->part->name);
_edje_seat_emit(ed, ev->device, "drag", rp->part->name);
2013-07-18 23:39:49 -07:00
rp->drag->started = EINA_TRUE;
}
ed->recalc_call = EINA_TRUE;
ed->dirty = EINA_TRUE;
#ifdef EDJE_CALC_CACHE
rp->invalidate = EINA_TRUE;
#endif
_edje_recalc_do(ed);
}
}
}
_edje_unref(ed);
_edje_util_thaw(ed);
ev->event_flags |= rp->mask_flags;
}
static void
_edje_mouse_wheel_signal_cb(void *data, const Efl_Event *event)
{
Efl_Input_Pointer_Data *ev;
Edje *ed;
Edje_Real_Part *rp;
char buf[256];
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
ed = data;
rp = evas_object_data_get(event->object, "real_part");
if (rp)
{
if (!(ev->event_flags) || !(rp->ignore_flags & ev->event_flags))
{
snprintf(buf, sizeof(buf), "mouse,wheel,%i,%i",
ev->wheel.dir == EFL_ORIENT_HORIZONTAL ? 1 : 0,
(ev->wheel.z < 0) ? (-1) : (1));
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
}
ev->event_flags |= rp->mask_flags;
}
}
void
_edje_timer_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
double t;
Eina_List *l;
Eina_List *newl = NULL;
Edje *ed = data;
2008-11-01 19:43:43 -07:00
t = ecore_loop_time_get();
_edje_ref(ed);
_edje_block(ed);
_edje_util_freeze(ed);
if ((!ed->paused) && (!ed->delete_me))
{
const void *tmp;
ed->walking_actions = EINA_TRUE;
EINA_LIST_FOREACH(ed->actions, l, tmp)
newl = eina_list_append(newl, tmp);
while (newl)
{
Edje_Running_Program *runp;
runp = eina_list_data_get(newl);
newl = eina_list_remove(newl, eina_list_data_get(newl));
if (!runp->delete_me)
_edje_program_run_iterate(runp, t);
if (_edje_block_break(ed))
{
eina_list_free(newl);
newl = NULL;
goto break_prog;
}
}
EINA_LIST_FOREACH(ed->actions, l, tmp)
newl = eina_list_append(newl, tmp);
while (newl)
{
Edje_Running_Program *runp;
runp = eina_list_data_get(newl);
newl = eina_list_remove(newl, eina_list_data_get(newl));
if (runp->delete_me)
{
_edje_program_run_cleanup(ed, runp);
free(runp);
}
}
ed->walking_actions = EINA_FALSE;
}
break_prog:
_edje_unblock(ed);
_edje_util_thaw(ed);
_edje_unref(ed);
}
Eina_Bool
_edje_pending_timer_cb(void *data)
{
Edje_Pending_Program *pp;
pp = data;
pp->edje->pending_actions = eina_list_remove(pp->edje->pending_actions, pp);
_edje_program_run(pp->edje, pp->program, 1, "", "");
pp->timer = NULL;
free(pp);
return ECORE_CALLBACK_CANCEL;
}
EFL_CALLBACKS_ARRAY_DEFINE(edje_callbacks,
{ EFL_EVENT_HOLD, _edje_hold_signal_cb },
{ EFL_EVENT_POINTER_IN, _edje_mouse_in_signal_cb },
{ EFL_EVENT_POINTER_OUT, _edje_mouse_out_signal_cb },
{ EFL_EVENT_POINTER_DOWN, _edje_mouse_down_signal_cb },
{ EFL_EVENT_POINTER_UP, _edje_mouse_up_signal_cb },
{ EFL_EVENT_POINTER_MOVE, _edje_mouse_move_signal_cb },
{ EFL_EVENT_POINTER_WHEEL, _edje_mouse_wheel_signal_cb });
2013-07-16 04:03:33 -07:00
EFL_CALLBACKS_ARRAY_DEFINE(edje_focus_callbacks,
{ EFL_EVENT_FOCUS_IN, _edje_focus_in_signal_cb },
{ EFL_EVENT_FOCUS_OUT, _edje_focus_out_signal_cb });
void
_edje_callbacks_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp)
{
efl_event_callback_array_add(obj, edje_callbacks(), ed);
evas_object_data_set(obj, "real_part", rp);
}
void
_edje_callbacks_del(Evas_Object *obj, Edje *ed)
{
efl_event_callback_array_del(obj, edje_callbacks(), ed);
evas_object_data_del(obj, "real_part");
}
void
_edje_callbacks_focus_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp)
{
efl_event_callback_array_add(obj, edje_focus_callbacks(), ed);
evas_object_data_set(obj, "real_part", rp);
}
void
_edje_callbacks_focus_del(Evas_Object *obj, Edje *ed)
{
efl_event_callback_array_del(obj, edje_focus_callbacks(), ed);
evas_object_data_del(obj, "real_part");
}