2003-06-23 19:33:04 -07:00
|
|
|
#include "edje_private.h"
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_hold_signal_cb(void *data, const Efl_Event *event)
|
2008-03-31 14:38:51 -07:00
|
|
|
{
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Hold *ev;
|
2008-03-31 14:38:51 -07:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
2016-04-12 07:23:55 -07:00
|
|
|
ev = event->info;
|
2008-03-31 14:38:51 -07:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2016-06-20 07:31:31 -07:00
|
|
|
if (!rp) return;
|
2016-08-25 03:20:10 -07:00
|
|
|
if (efl_input_hold_get(ev))
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, efl_input_device_get(ev),
|
|
|
|
"hold,on", rp->part->name);
|
2008-03-31 14:38:51 -07:00
|
|
|
else
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, efl_input_device_get(ev),
|
|
|
|
"hold,off", rp->part->name);
|
2008-03-31 14:38:51 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_focus_in_signal_cb(void *data, const Efl_Event *event)
|
2010-02-23 05:39:19 -08:00
|
|
|
{
|
edje: support seat on focus action and signals
Seat goes as an optional parameter for FOCUS_SET (if not
provided, act over default seat), and emit signals
with seat suffix:
* focus,in,$SEAT
* focus,out,$SEAT
* focus,part,in,$SEAT
* focus,part,out,$SEAT
2016-11-17 09:21:02 -08:00
|
|
|
Efl_Input_Focus *ev;
|
2010-02-23 05:39:19 -08:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
edje: support seat on focus action and signals
Seat goes as an optional parameter for FOCUS_SET (if not
provided, act over default seat), and emit signals
with seat suffix:
* focus,in,$SEAT
* focus,out,$SEAT
* focus,part,in,$SEAT
* focus,part,out,$SEAT
2016-11-17 09:21:02 -08:00
|
|
|
ev = event->info;
|
2010-02-23 05:39:19 -08:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2010-02-23 05:39:19 -08:00
|
|
|
if ((!rp) || (!ed))
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2010-02-23 05:39:19 -08:00
|
|
|
|
edje: support seat on focus action and signals
Seat goes as an optional parameter for FOCUS_SET (if not
provided, act over default seat), and emit signals
with seat suffix:
* focus,in,$SEAT
* focus,out,$SEAT
* focus,part,in,$SEAT
* focus,part,out,$SEAT
2016-11-17 09:21:02 -08:00
|
|
|
_edje_seat_emit(ed, efl_input_device_get(ev),
|
|
|
|
"focus,part,in", rp->part->name);
|
2010-02-23 05:39:19 -08:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_focus_out_signal_cb(void *data, const Efl_Event *event)
|
2010-02-23 05:39:19 -08:00
|
|
|
{
|
edje: support seat on focus action and signals
Seat goes as an optional parameter for FOCUS_SET (if not
provided, act over default seat), and emit signals
with seat suffix:
* focus,in,$SEAT
* focus,out,$SEAT
* focus,part,in,$SEAT
* focus,part,out,$SEAT
2016-11-17 09:21:02 -08:00
|
|
|
Efl_Input_Focus *ev;
|
2010-02-23 05:39:19 -08:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
|
edje: support seat on focus action and signals
Seat goes as an optional parameter for FOCUS_SET (if not
provided, act over default seat), and emit signals
with seat suffix:
* focus,in,$SEAT
* focus,out,$SEAT
* focus,part,in,$SEAT
* focus,part,out,$SEAT
2016-11-17 09:21:02 -08:00
|
|
|
ev = event->info;
|
2010-02-23 05:39:19 -08:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2010-02-23 05:39:19 -08:00
|
|
|
if ((!rp) || (!ed))
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2010-02-23 05:39:19 -08:00
|
|
|
|
edje: support seat on focus action and signals
Seat goes as an optional parameter for FOCUS_SET (if not
provided, act over default seat), and emit signals
with seat suffix:
* focus,in,$SEAT
* focus,out,$SEAT
* focus,part,in,$SEAT
* focus,part,out,$SEAT
2016-11-17 09:21:02 -08:00
|
|
|
_edje_seat_emit(ed, efl_input_device_get(ev),
|
|
|
|
"focus,part,out", rp->part->name);
|
2010-02-23 05:39:19 -08:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_mouse_in_signal_cb(void *data, const Efl_Event *event)
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Pointer_Data *ev;
|
2003-06-23 19:33:04 -07:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
|
2003-06-23 19:33:04 -07:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2015-06-25 07:02:41 -07:00
|
|
|
if (rp)
|
|
|
|
{
|
2017-02-07 15:08:19 -08:00
|
|
|
if (!(ev->event_flags) || !(rp->ignore_flags & ev->event_flags))
|
|
|
|
_edje_seat_emit(ed, ev->device, "mouse,in", rp->part->name);
|
2015-06-25 07:02:41 -07:00
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ev->event_flags |= rp->mask_flags;
|
2015-06-25 07:02:41 -07:00
|
|
|
}
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_mouse_out_signal_cb(void *data, const Efl_Event *event)
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Pointer_Data *ev;
|
2003-06-23 19:33:04 -07:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
|
2003-06-23 19:33:04 -07:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2015-06-25 07:02:41 -07:00
|
|
|
if (rp)
|
|
|
|
{
|
2017-02-07 15:08:19 -08:00
|
|
|
if (!(ev->event_flags) || !(rp->ignore_flags & ev->event_flags))
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, "mouse,out", rp->part->name);
|
2015-06-25 07:02:41 -07:00
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ev->event_flags |= rp->mask_flags;
|
2015-06-25 07:02:41 -07:00
|
|
|
}
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_mouse_down_signal_cb(void *data, const Efl_Event *event)
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Pointer_Data *ev;
|
2003-06-23 19:33:04 -07:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
char buf[256];
|
2008-04-01 14:33:17 -07:00
|
|
|
int ignored;
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
|
2003-06-23 19:33:04 -07:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2016-06-20 07:31:31 -07:00
|
|
|
if (!rp) return;
|
2008-04-01 14:33:17 -07:00
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ignored = rp->ignore_flags & ev->event_flags;
|
2008-04-01 14:33:17 -07:00
|
|
|
|
2003-08-25 17:16:49 -07:00
|
|
|
_edje_ref(ed);
|
2014-03-18 07:00:14 -07:00
|
|
|
_edje_util_freeze(ed);
|
2008-04-01 14:33:17 -07:00
|
|
|
|
2008-04-03 11:22:22 -07:00
|
|
|
if ((!ev->event_flags) || (!ignored))
|
2008-04-01 14:33:17 -07:00
|
|
|
{
|
2016-06-19 21:37:56 -07:00
|
|
|
if (ev->button_flags & EVAS_BUTTON_TRIPLE_CLICK)
|
2015-06-08 11:43:00 -07:00
|
|
|
snprintf(buf, sizeof(buf), "mouse,down,%i,triple", ev->button);
|
2016-06-19 21:37:56 -07:00
|
|
|
else if (ev->button_flags & EVAS_BUTTON_DOUBLE_CLICK)
|
2015-06-08 11:43:00 -07:00
|
|
|
snprintf(buf, sizeof(buf), "mouse,down,%i,double", ev->button);
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), "mouse,down,%i", ev->button);
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
|
2008-04-01 14:33:17 -07:00
|
|
|
}
|
2005-07-26 06:59:03 -07:00
|
|
|
|
2013-04-06 19:39:20 -07:00
|
|
|
if (rp->part->dragable.event_id >= 0)
|
2005-07-26 12:27:02 -07:00
|
|
|
{
|
2013-04-06 19:39:20 -07:00
|
|
|
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: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_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 12:27:02 -07:00
|
|
|
}
|
2005-07-26 06:59:03 -07:00
|
|
|
|
2009-08-11 07:55:26 -07:00
|
|
|
if (rp->drag)
|
2003-08-15 06:35:25 -07:00
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
if (rp->drag->down.count == 0)
|
|
|
|
{
|
|
|
|
if (rp->part->dragable.x)
|
2016-06-13 05:01:04 -07:00
|
|
|
rp->drag->down.x = ev->cur.x;
|
2015-06-08 11:43:00 -07:00
|
|
|
if (rp->part->dragable.y)
|
2016-06-13 05:01:04 -07:00
|
|
|
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;
|
2015-06-08 11:43:00 -07:00
|
|
|
}
|
|
|
|
rp->drag->down.count++;
|
2003-08-15 06:35:25 -07:00
|
|
|
}
|
2009-08-11 07:55:26 -07:00
|
|
|
|
2003-06-23 19:33:04 -07:00
|
|
|
if (rp->clicked_button == 0)
|
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
rp->clicked_button = ev->button;
|
2010-11-20 22:28:13 -08:00
|
|
|
if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
|
2015-06-08 11:43:00 -07:00
|
|
|
rp->still_in = EINA_TRUE;
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
2008-11-14 03:06:15 -08:00
|
|
|
// _edje_recalc_do(ed);
|
2014-03-18 07:00:14 -07:00
|
|
|
_edje_util_thaw(ed);
|
2003-08-25 17:16:49 -07:00
|
|
|
_edje_unref(ed);
|
2013-06-17 00:55:22 -07:00
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ev->event_flags |= rp->mask_flags;
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_mouse_up_signal_cb(void *data, const Efl_Event *event)
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Pointer_Data *ev;
|
2003-06-23 19:33:04 -07:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
char buf[256];
|
2008-04-01 14:33:17 -07:00
|
|
|
int ignored;
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
|
2003-06-23 19:33:04 -07:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2016-06-20 07:31:31 -07:00
|
|
|
if (!rp) return;
|
2005-07-26 06:59:03 -07:00
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ignored = rp->ignore_flags & ev->event_flags;
|
2008-04-01 14:33:17 -07:00
|
|
|
|
2003-08-25 17:16:49 -07:00
|
|
|
_edje_ref(ed);
|
2014-03-18 07:00:14 -07:00
|
|
|
_edje_util_freeze(ed);
|
2005-07-26 06:59:03 -07:00
|
|
|
|
2008-04-03 11:22:22 -07:00
|
|
|
if ((!ev->event_flags) || (!ignored))
|
2005-07-26 12:27:02 -07:00
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
snprintf(buf, sizeof(buf), "mouse,up,%i", ev->button);
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
|
2005-10-31 20:10:01 -08:00
|
|
|
}
|
2005-07-26 06:59:03 -07:00
|
|
|
|
2013-04-06 19:39:20 -07:00
|
|
|
if (rp->part->dragable.event_id >= 0)
|
2008-04-01 14:33:17 -07:00
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
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: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
|
2015-06-08 11:43:00 -07:00
|
|
|
}
|
2009-08-11 07:55:26 -07:00
|
|
|
}
|
2008-04-01 14:33:17 -07:00
|
|
|
|
2009-08-11 07:55:26 -07:00
|
|
|
if (rp->drag)
|
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
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;
|
2015-06-08 11:43:00 -07:00
|
|
|
rp->drag->need_reset = 1;
|
2012-09-04 22:38:01 -07:00
|
|
|
ed->recalc_call = EINA_TRUE;
|
2015-06-08 11:43:00 -07:00
|
|
|
ed->dirty = EINA_TRUE;
|
2009-08-10 08:16:51 -07:00
|
|
|
#ifdef EDJE_CALC_CACHE
|
2015-06-08 11:43:00 -07:00
|
|
|
rp->invalidate = EINA_TRUE;
|
2009-08-10 08:16:51 -07:00
|
|
|
#endif
|
2015-06-08 11:43:00 -07:00
|
|
|
if (!ignored && rp->drag->started)
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_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);
|
2015-06-08 11:43:00 -07:00
|
|
|
}
|
|
|
|
}
|
2003-08-15 06:35:25 -07:00
|
|
|
}
|
2009-08-11 05:47:00 -07:00
|
|
|
|
2016-05-11 06:44:27 -07:00
|
|
|
if ((rp->still_in) && (rp->clicked_button == ev->button) && (!ev->event_flags))
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
snprintf(buf, sizeof(buf), "mouse,clicked,%i", ev->button);
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
2006-12-18 00:50:25 -08:00
|
|
|
rp->clicked_button = 0;
|
2013-11-20 20:00:55 -08:00
|
|
|
rp->still_in = EINA_FALSE;
|
2006-12-18 00:50:25 -08:00
|
|
|
|
2008-11-14 03:06:15 -08:00
|
|
|
// _edje_recalc_do(ed);
|
2014-03-18 07:00:14 -07:00
|
|
|
_edje_util_thaw(ed);
|
2003-08-25 17:16:49 -07:00
|
|
|
_edje_unref(ed);
|
2013-06-17 00:55:22 -07:00
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ev->event_flags |= rp->mask_flags;
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_mouse_move_signal_cb(void *data, const Efl_Event *event)
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Pointer_Data *ev;
|
2003-06-23 19:33:04 -07:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
2008-04-01 14:33:17 -07:00
|
|
|
int ignored;
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
|
2003-06-23 19:33:04 -07:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2016-06-20 07:31:31 -07:00
|
|
|
if (!rp) return;
|
2013-04-06 19:39:20 -07:00
|
|
|
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
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ignored = rp->ignore_flags & ev->event_flags;
|
2008-04-01 14:33:17 -07:00
|
|
|
|
2005-10-31 20:10:01 -08:00
|
|
|
_edje_ref(ed);
|
2008-04-03 11:22:22 -07:00
|
|
|
if ((!ev->event_flags) || (!ignored))
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, "mouse,move", rp->part->name);
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2003-06-23 19:33:04 -07:00
|
|
|
if (rp->still_in)
|
|
|
|
{
|
2010-11-20 22:28:13 -08:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
2013-11-20 20:00:55 -08:00
|
|
|
rp->still_in = EINA_FALSE;
|
2010-11-20 22:28:13 -08:00
|
|
|
else
|
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
|
2016-05-18 08:17:36 -07:00
|
|
|
evas_object_geometry_get(event->object, &x, &y, &w, &h);
|
2016-06-13 05:01:04 -07:00
|
|
|
if ((ev->cur.x < x) || (ev->cur.y < y) ||
|
|
|
|
(ev->cur.x >= (x + w)) || (ev->cur.y >= (y + h)))
|
edje_callbacks: Add mouse,pressed,in/out signal.
Summary:
The mouse,in/out signal has missing parts to use.
When user send down event on specific object, then move cursor to outside of object.
the mouse,in signal must be called in case. but it's not in traditional implement.
So i added this signal for support above use case.
In order to satisfy above use case, user can add both of the signals(mouse,in mouse,pressed,in).
(Adding new name of signals to do not break compatibility with before implements.)
@feature
Test Plan:
Add mouse,pressed,in/out program to object.
Press object which added signals before.
Move mouse cursor to out of object, then check the program works.
Reviewers: Hermet, cedric, raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2992
2015-12-23 01:58:43 -08:00
|
|
|
{
|
2016-06-13 05:01:04 -07:00
|
|
|
if ((ev->pressed_buttons) && ((!ev->event_flags) || (!ignored)))
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, "mouse,pressed,out",
|
|
|
|
rp->part->name);
|
edje_callbacks: Add mouse,pressed,in/out signal.
Summary:
The mouse,in/out signal has missing parts to use.
When user send down event on specific object, then move cursor to outside of object.
the mouse,in signal must be called in case. but it's not in traditional implement.
So i added this signal for support above use case.
In order to satisfy above use case, user can add both of the signals(mouse,in mouse,pressed,in).
(Adding new name of signals to do not break compatibility with before implements.)
@feature
Test Plan:
Add mouse,pressed,in/out program to object.
Press object which added signals before.
Move mouse cursor to out of object, then check the program works.
Reviewers: Hermet, cedric, raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2992
2015-12-23 01:58:43 -08:00
|
|
|
|
|
|
|
rp->still_in = EINA_FALSE;
|
|
|
|
}
|
2010-11-20 22:28:13 -08:00
|
|
|
}
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
2003-06-25 14:40:32 -07:00
|
|
|
else
|
|
|
|
{
|
2010-11-20 22:28:13 -08:00
|
|
|
if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
|
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
2010-11-20 22:28:13 -08:00
|
|
|
|
2016-05-18 08:17:36 -07:00
|
|
|
evas_object_geometry_get(event->object, &x, &y, &w, &h);
|
2016-06-13 05:01:04 -07:00
|
|
|
if ((ev->cur.x >= x) && (ev->cur.y >= y) &&
|
|
|
|
(ev->cur.x < (x + w)) && (ev->cur.y < (y + h)))
|
edje_callbacks: Add mouse,pressed,in/out signal.
Summary:
The mouse,in/out signal has missing parts to use.
When user send down event on specific object, then move cursor to outside of object.
the mouse,in signal must be called in case. but it's not in traditional implement.
So i added this signal for support above use case.
In order to satisfy above use case, user can add both of the signals(mouse,in mouse,pressed,in).
(Adding new name of signals to do not break compatibility with before implements.)
@feature
Test Plan:
Add mouse,pressed,in/out program to object.
Press object which added signals before.
Move mouse cursor to out of object, then check the program works.
Reviewers: Hermet, cedric, raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2992
2015-12-23 01:58:43 -08:00
|
|
|
{
|
2016-06-13 05:01:04 -07:00
|
|
|
if ((ev->pressed_buttons) && ((!ev->event_flags) || (!ignored)))
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, "mouse,pressed,in",
|
|
|
|
rp->part->name);
|
edje_callbacks: Add mouse,pressed,in/out signal.
Summary:
The mouse,in/out signal has missing parts to use.
When user send down event on specific object, then move cursor to outside of object.
the mouse,in signal must be called in case. but it's not in traditional implement.
So i added this signal for support above use case.
In order to satisfy above use case, user can add both of the signals(mouse,in mouse,pressed,in).
(Adding new name of signals to do not break compatibility with before implements.)
@feature
Test Plan:
Add mouse,pressed,in/out program to object.
Press object which added signals before.
Move mouse cursor to out of object, then check the program works.
Reviewers: Hermet, cedric, raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2992
2015-12-23 01:58:43 -08:00
|
|
|
|
|
|
|
rp->still_in = EINA_TRUE;
|
|
|
|
}
|
2010-11-20 22:28:13 -08:00
|
|
|
}
|
2003-06-25 14:40:32 -07:00
|
|
|
}
|
2014-03-18 07:00:14 -07:00
|
|
|
_edje_util_freeze(ed);
|
2009-08-11 05:47:00 -07:00
|
|
|
if (rp->drag)
|
2003-08-15 06:35:25 -07:00
|
|
|
{
|
2015-06-08 11:43:00 -07:00
|
|
|
if (rp->drag->down.count > 0)
|
|
|
|
{
|
|
|
|
if (rp->part->dragable.x)
|
2016-06-13 05:01:04 -07:00
|
|
|
rp->drag->tmp.x = ev->cur.x - rp->drag->down.x;
|
2015-06-08 11:43:00 -07:00
|
|
|
if (rp->part->dragable.y)
|
2016-06-13 05:01:04 -07:00
|
|
|
rp->drag->tmp.y = ev->cur.y - rp->drag->down.y;
|
2012-09-04 22:38:01 -07:00
|
|
|
ed->recalc_call = EINA_TRUE;
|
2015-06-08 11:43:00 -07:00
|
|
|
ed->dirty = EINA_TRUE;
|
2009-08-10 08:16:51 -07:00
|
|
|
#ifdef EDJE_CALC_CACHE
|
2015-06-08 11:43:00 -07:00
|
|
|
rp->invalidate = EINA_TRUE;
|
2009-08-10 08:16:51 -07:00
|
|
|
#endif
|
2015-06-08 11:43:00 -07:00
|
|
|
}
|
|
|
|
_edje_recalc_do(ed);
|
|
|
|
|
|
|
|
if (rp->drag->down.count > 0)
|
|
|
|
{
|
|
|
|
FLOAT_T dx, dy;
|
|
|
|
|
|
|
|
_edje_part_dragable_calc(ed, rp, &dx, &dy);
|
2016-12-20 16:00:05 -08:00
|
|
|
if ((NEQ(dx, rp->drag->val.x)) || (NEQ(dy, rp->drag->val.y)))
|
2015-06-08 11:43:00 -07:00
|
|
|
{
|
|
|
|
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: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_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;
|
|
|
|
}
|
2012-09-04 22:38:01 -07:00
|
|
|
ed->recalc_call = EINA_TRUE;
|
2015-06-08 11:43:00 -07:00
|
|
|
ed->dirty = EINA_TRUE;
|
2009-08-10 08:16:51 -07:00
|
|
|
#ifdef EDJE_CALC_CACHE
|
2015-06-08 11:43:00 -07:00
|
|
|
rp->invalidate = EINA_TRUE;
|
2009-08-10 08:16:51 -07:00
|
|
|
#endif
|
2015-06-08 11:43:00 -07:00
|
|
|
_edje_recalc_do(ed);
|
|
|
|
}
|
|
|
|
}
|
2003-08-15 06:35:25 -07:00
|
|
|
}
|
2003-08-25 17:16:49 -07:00
|
|
|
_edje_unref(ed);
|
2014-03-18 07:00:14 -07:00
|
|
|
_edje_util_thaw(ed);
|
2013-06-17 00:55:22 -07:00
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ev->event_flags |= rp->mask_flags;
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_mouse_wheel_signal_cb(void *data, const Efl_Event *event)
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Pointer_Data *ev;
|
2003-06-23 19:33:04 -07:00
|
|
|
Edje *ed;
|
|
|
|
Edje_Real_Part *rp;
|
|
|
|
char buf[256];
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS);
|
2003-06-23 19:33:04 -07:00
|
|
|
ed = data;
|
2016-05-18 08:17:36 -07:00
|
|
|
rp = evas_object_data_get(event->object, "real_part");
|
2015-06-25 07:02:41 -07:00
|
|
|
if (rp)
|
|
|
|
{
|
2017-02-07 15:08:19 -08:00
|
|
|
if (!(ev->event_flags) || !(rp->ignore_flags & ev->event_flags))
|
2015-06-25 07:02:41 -07:00
|
|
|
{
|
2016-06-13 05:01:04 -07:00
|
|
|
snprintf(buf, sizeof(buf), "mouse,wheel,%i,%i",
|
2017-08-09 05:04:10 -07:00
|
|
|
ev->wheel.horizontal,
|
2016-06-13 05:01:04 -07:00
|
|
|
(ev->wheel.z < 0) ? (-1) : (1));
|
edje: add new signals providing seat information
Add the following signals:
* mouse,in,$SEAT
* mouse,out,$SEAT
* mouse,move,$SEAT
* mouse,clicked,$BUTTON,$SEAT
* hold,on,$SEAT
* hold,off,$SEAT
* drag,$SEAT
* drag,start,$SEAT
* drag,stop,$SEAT
2016-11-08 11:50:23 -08:00
|
|
|
_edje_seat_emit(ed, ev->device, buf, rp->part->name);
|
2015-06-25 07:02:41 -07:00
|
|
|
}
|
2008-04-01 14:33:17 -07:00
|
|
|
|
2017-02-07 15:08:19 -08:00
|
|
|
ev->event_flags |= rp->mask_flags;
|
2015-06-25 07:02:41 -07:00
|
|
|
}
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
void
|
2016-08-30 05:34:10 -07:00
|
|
|
_edje_timer_cb(void *data, const Efl_Event *event EINA_UNUSED)
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
|
|
|
double t;
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *l;
|
2016-01-25 16:29:36 -08:00
|
|
|
Eina_List *newl = NULL;
|
|
|
|
Edje *ed = data;
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2008-11-01 19:43:43 -07:00
|
|
|
t = ecore_loop_time_get();
|
2016-01-25 16:29:36 -08:00
|
|
|
_edje_ref(ed);
|
|
|
|
|
|
|
|
_edje_block(ed);
|
|
|
|
_edje_util_freeze(ed);
|
|
|
|
if ((!ed->paused) && (!ed->delete_me))
|
2003-06-23 19:33:04 -07:00
|
|
|
{
|
2017-08-04 21:10:33 -07:00
|
|
|
Edje_Running_Program *tmp;
|
2015-06-08 11:43:00 -07:00
|
|
|
|
2016-01-25 16:29:36 -08:00
|
|
|
ed->walking_actions = EINA_TRUE;
|
|
|
|
EINA_LIST_FOREACH(ed->actions, l, tmp)
|
2017-08-04 21:10:33 -07:00
|
|
|
{
|
|
|
|
tmp->ref++;
|
|
|
|
newl = eina_list_append(newl, tmp);
|
|
|
|
}
|
2016-01-25 16:29:36 -08:00
|
|
|
while (newl)
|
2015-06-08 11:43:00 -07:00
|
|
|
{
|
2016-01-25 16:29:36 -08:00
|
|
|
Edje_Running_Program *runp;
|
2015-06-08 11:43:00 -07:00
|
|
|
|
2016-01-25 16:29:36 -08:00
|
|
|
runp = eina_list_data_get(newl);
|
|
|
|
newl = eina_list_remove(newl, eina_list_data_get(newl));
|
2017-08-04 21:10:33 -07:00
|
|
|
runp->ref--;
|
2016-01-25 16:29:36 -08:00
|
|
|
if (!runp->delete_me)
|
|
|
|
_edje_program_run_iterate(runp, t);
|
|
|
|
if (_edje_block_break(ed))
|
2015-06-08 11:43:00 -07:00
|
|
|
{
|
2017-08-04 21:10:33 -07:00
|
|
|
EINA_LIST_FREE(newl, tmp)
|
|
|
|
{
|
|
|
|
tmp->ref--;
|
|
|
|
if ((tmp->delete_me) && (tmp->ref == 0))
|
|
|
|
{
|
|
|
|
_edje_program_run_cleanup(ed, tmp);
|
|
|
|
free(tmp);
|
|
|
|
}
|
|
|
|
}
|
2016-01-25 16:29:36 -08:00
|
|
|
newl = NULL;
|
|
|
|
goto break_prog;
|
2015-06-08 11:43:00 -07:00
|
|
|
}
|
2016-01-25 16:29:36 -08:00
|
|
|
}
|
|
|
|
EINA_LIST_FOREACH(ed->actions, l, tmp)
|
2017-08-04 21:10:33 -07:00
|
|
|
{
|
|
|
|
tmp->ref++;
|
|
|
|
newl = eina_list_append(newl, tmp);
|
|
|
|
}
|
2016-01-25 16:29:36 -08:00
|
|
|
while (newl)
|
|
|
|
{
|
|
|
|
Edje_Running_Program *runp;
|
2015-06-08 11:43:00 -07:00
|
|
|
|
2016-01-25 16:29:36 -08:00
|
|
|
runp = eina_list_data_get(newl);
|
|
|
|
newl = eina_list_remove(newl, eina_list_data_get(newl));
|
2017-08-04 21:10:33 -07:00
|
|
|
runp->ref--;
|
|
|
|
if ((runp->delete_me) && (runp->ref == 0))
|
2016-01-25 16:29:36 -08:00
|
|
|
{
|
|
|
|
_edje_program_run_cleanup(ed, runp);
|
|
|
|
free(runp);
|
2015-06-08 11:43:00 -07:00
|
|
|
}
|
|
|
|
}
|
2016-01-25 16:29:36 -08:00
|
|
|
ed->walking_actions = EINA_FALSE;
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
2016-01-25 16:29:36 -08:00
|
|
|
break_prog:
|
|
|
|
_edje_unblock(ed);
|
|
|
|
_edje_util_thaw(ed);
|
|
|
|
_edje_unref(ed);
|
2003-06-23 19:33:04 -07:00
|
|
|
}
|
2003-06-27 21:20:41 -07:00
|
|
|
|
2010-06-24 09:16:50 -07:00
|
|
|
Eina_Bool
|
2003-06-27 21:20:41 -07:00
|
|
|
_edje_pending_timer_cb(void *data)
|
|
|
|
{
|
|
|
|
Edje_Pending_Program *pp;
|
2007-09-08 11:31:56 -07:00
|
|
|
|
2003-06-27 21:20:41 -07:00
|
|
|
pp = data;
|
2008-10-22 04:34:42 -07:00
|
|
|
pp->edje->pending_actions = eina_list_remove(pp->edje->pending_actions, pp);
|
2018-05-08 10:26:13 -07:00
|
|
|
_edje_program_run(pp->edje, pp->program, 1, "", "", NULL);
|
2017-02-03 23:48:55 -08:00
|
|
|
pp->timer = NULL;
|
2003-06-27 21:20:41 -07:00
|
|
|
free(pp);
|
2010-06-24 09:16:50 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2003-06-27 21:20:41 -07:00
|
|
|
}
|
2007-04-04 05:51:51 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(edje_callbacks,
|
2016-05-30 23:31:17 -07:00
|
|
|
{ EFL_EVENT_HOLD, _edje_hold_signal_cb },
|
2016-06-13 05:01:04 -07:00
|
|
|
{ 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
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(edje_focus_callbacks,
|
2016-11-18 08:56:20 -08:00
|
|
|
{ EFL_EVENT_FOCUS_IN, _edje_focus_in_signal_cb },
|
|
|
|
{ EFL_EVENT_FOCUS_OUT, _edje_focus_out_signal_cb });
|
2013-06-17 00:55:22 -07:00
|
|
|
|
2007-04-04 05:51:51 -07:00
|
|
|
void
|
|
|
|
_edje_callbacks_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp)
|
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_array_add(obj, edje_callbacks(), ed);
|
2007-04-04 05:51:51 -07:00
|
|
|
evas_object_data_set(obj, "real_part", rp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-02-23 05:39:19 -08:00
|
|
|
_edje_callbacks_del(Evas_Object *obj, Edje *ed)
|
2007-04-04 05:51:51 -07:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_array_del(obj, edje_callbacks(), ed);
|
2007-04-04 05:51:51 -07:00
|
|
|
evas_object_data_del(obj, "real_part");
|
|
|
|
}
|
2010-02-23 05:39:19 -08:00
|
|
|
|
|
|
|
void
|
|
|
|
_edje_callbacks_focus_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp)
|
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_array_add(obj, edje_focus_callbacks(), ed);
|
2010-02-23 05:39:19 -08:00
|
|
|
evas_object_data_set(obj, "real_part", rp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_edje_callbacks_focus_del(Evas_Object *obj, Edje *ed)
|
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_array_del(obj, edje_focus_callbacks(), ed);
|
2013-06-17 00:55:22 -07:00
|
|
|
evas_object_data_del(obj, "real_part");
|
2010-02-23 05:39:19 -08:00
|
|
|
}
|
2015-06-08 11:43:00 -07:00
|
|
|
|