2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
#include "evas_private.h"
|
|
|
|
|
2012-01-17 00:35:32 -08:00
|
|
|
static Eina_List *
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
|
2012-01-17 00:35:32 -08:00
|
|
|
const Eina_Inlist *list, Evas_Object *stop,
|
2012-10-23 01:44:11 -07:00
|
|
|
int x, int y, int *no_rep, Eina_Bool source);
|
2012-01-17 00:35:32 -08:00
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
static Eina_List *
|
|
|
|
evas_event_list_copy(Eina_List *list);
|
|
|
|
|
|
|
|
|
2009-11-05 07:24:48 -08:00
|
|
|
static void
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed)
|
2009-11-05 07:24:48 -08:00
|
|
|
{
|
2010-09-17 23:31:41 -07:00
|
|
|
if (obj->smart.parent)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *smart_parent_obj = eo_data_get(obj->smart.parent, EVAS_OBJ_CLASS);
|
|
|
|
_evas_event_havemap_adjust(obj->smart.parent, smart_parent_obj, x, y, mouse_grabbed);
|
|
|
|
}
|
2010-09-17 23:30:59 -07:00
|
|
|
|
2011-10-21 02:53:26 -07:00
|
|
|
if ((!obj->cur.usemap) || (!obj->cur.map) || (!obj->cur.map->count == 4))
|
2010-09-17 23:31:41 -07:00
|
|
|
return;
|
2010-09-17 23:31:12 -07:00
|
|
|
|
2011-10-21 02:53:26 -07:00
|
|
|
evas_map_coords_get(obj->cur.map, *x, *y, x, y, mouse_grabbed);
|
|
|
|
*x += obj->cur.geometry.x;
|
|
|
|
*y += obj->cur.geometry.y;
|
2009-11-05 07:24:48 -08:00
|
|
|
}
|
|
|
|
|
2012-08-16 01:08:44 -07:00
|
|
|
static void
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_framespace_adjust(Evas_Object *eo_obj, Evas_Coord *x, Evas_Coord *y)
|
2012-08-16 01:08:44 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-08-22 07:53:45 -07:00
|
|
|
if (obj->is_frame) return;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((!obj->smart.parent) && (obj->is_smart))
|
2012-08-16 01:08:44 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Public_Data *evas;
|
2012-08-22 07:53:45 -07:00
|
|
|
|
|
|
|
evas = obj->layer->evas;
|
|
|
|
if (x) *x -= evas->framespace.x;
|
|
|
|
if (y) *y -= evas->framespace.y;
|
2012-08-16 01:08:44 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
static Eina_List *
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
|
2012-01-17 00:35:32 -08:00
|
|
|
const Eina_Inlist *list, Evas_Object *stop,
|
2012-10-23 01:44:11 -07:00
|
|
|
int x, int y, int *no_rep, Eina_Bool source)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
2011-12-19 23:06:53 -08:00
|
|
|
int inside;
|
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
if (!list) return in;
|
2012-10-08 18:58:41 -07:00
|
|
|
for (obj = _EINA_INLIST_CONTAINER(obj, list);
|
|
|
|
obj;
|
2012-01-17 00:35:32 -08:00
|
|
|
obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev))
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
|
|
|
if (eo_obj == stop)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
|
|
|
*no_rep = 1;
|
|
|
|
return in;
|
|
|
|
}
|
2012-10-23 01:44:11 -07:00
|
|
|
if (!source)
|
|
|
|
{
|
|
|
|
if (evas_event_passes_through(eo_obj, obj)) continue;
|
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
|
|
|
}
|
|
|
|
if ((obj->delete_me == 0) &&
|
|
|
|
((source) || ((obj->cur.visible) && (!obj->clip.clipees) &&
|
|
|
|
evas_object_clippers_is_visible(eo_obj, obj))))
|
2009-11-05 07:24:48 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2009-11-05 07:24:48 -08:00
|
|
|
{
|
2012-06-13 10:37:19 -07:00
|
|
|
int norep = 0;
|
|
|
|
|
2011-12-19 23:06:53 -08:00
|
|
|
if ((obj->cur.usemap) && (obj->cur.map) &&
|
|
|
|
(obj->cur.map->count == 4))
|
2009-11-05 07:24:48 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
inside = evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1);
|
2009-11-05 07:24:48 -08:00
|
|
|
if (inside)
|
|
|
|
{
|
|
|
|
if (!evas_map_coords_get(obj->cur.map, x, y,
|
|
|
|
&(obj->cur.map->mx),
|
|
|
|
&(obj->cur.map->my), 0))
|
2010-09-17 23:30:30 -07:00
|
|
|
{
|
|
|
|
inside = 0;
|
|
|
|
}
|
2009-11-05 07:24:48 -08:00
|
|
|
else
|
2010-09-17 23:30:30 -07:00
|
|
|
{
|
|
|
|
in = _evas_event_object_list_in_get
|
2012-10-08 18:58:41 -07:00
|
|
|
(eo_e, in,
|
|
|
|
evas_object_smart_members_get_direct(eo_obj),
|
2010-09-17 23:30:30 -07:00
|
|
|
stop,
|
|
|
|
obj->cur.geometry.x + obj->cur.map->mx,
|
2011-12-19 23:06:53 -08:00
|
|
|
obj->cur.geometry.y + obj->cur.map->my,
|
2012-10-23 01:44:11 -07:00
|
|
|
&norep, source);
|
2010-09-17 23:30:30 -07:00
|
|
|
}
|
2009-11-05 07:24:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-06-07 00:10:36 -07:00
|
|
|
if (!obj->child_has_map)
|
2012-10-10 00:23:00 -07:00
|
|
|
evas_object_smart_bounding_box_update(eo_obj, obj);
|
2012-05-01 00:31:42 -07:00
|
|
|
if (obj->child_has_map ||
|
|
|
|
(obj->cur.bounding_box.x <= x &&
|
|
|
|
obj->cur.bounding_box.x + obj->cur.bounding_box.w >= x &&
|
|
|
|
obj->cur.bounding_box.y <= y &&
|
2012-05-03 03:58:12 -07:00
|
|
|
obj->cur.bounding_box.y + obj->cur.bounding_box.h >= y) ||
|
2012-06-12 23:08:01 -07:00
|
|
|
(obj->cur.geometry.x <= x &&
|
|
|
|
obj->cur.geometry.y + obj->cur.geometry.w >= x &&
|
|
|
|
obj->cur.geometry.y <= y &&
|
|
|
|
obj->cur.geometry.y + obj->cur.geometry.h >= y))
|
2012-05-01 00:31:42 -07:00
|
|
|
in = _evas_event_object_list_in_get
|
2012-10-08 18:58:41 -07:00
|
|
|
(eo_e, in, evas_object_smart_members_get_direct(eo_obj),
|
2012-10-23 01:44:11 -07:00
|
|
|
stop, x, y, &norep, source);
|
2012-06-13 10:37:19 -07:00
|
|
|
}
|
|
|
|
if (norep)
|
|
|
|
{
|
|
|
|
if (!obj->repeat_events)
|
|
|
|
{
|
|
|
|
*no_rep = 1;
|
|
|
|
return in;
|
|
|
|
}
|
2009-11-05 07:24:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
inside = evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1);
|
2012-06-13 10:37:19 -07:00
|
|
|
|
2012-06-15 03:34:22 -07:00
|
|
|
if (inside)
|
2009-11-05 07:24:48 -08:00
|
|
|
{
|
2012-06-15 03:34:22 -07:00
|
|
|
if ((obj->cur.usemap) && (obj->cur.map) &&
|
|
|
|
(obj->cur.map->count == 4))
|
2009-11-05 07:24:48 -08:00
|
|
|
{
|
2012-06-15 03:34:22 -07:00
|
|
|
if (!evas_map_coords_get(obj->cur.map, x, y,
|
|
|
|
&(obj->cur.map->mx),
|
|
|
|
&(obj->cur.map->my), 0))
|
|
|
|
{
|
|
|
|
inside = 0;
|
|
|
|
}
|
2009-11-05 07:24:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (inside && ((!obj->precise_is_inside) ||
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_object_is_inside(eo_obj, obj, x, y))))
|
2009-11-05 07:24:48 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!evas_event_freezes_through(eo_obj, obj))
|
|
|
|
in = eina_list_append(in, eo_obj);
|
2009-11-05 07:24:48 -08:00
|
|
|
if (!obj->repeat_events)
|
|
|
|
{
|
|
|
|
*no_rep = 1;
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
*no_rep = 0;
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2012-10-23 01:44:11 -07:00
|
|
|
static void
|
2012-10-25 08:12:54 -07:00
|
|
|
_evas_event_source_events_call(Evas_Object_Protected_Data *src, Evas_Callback_Type type, void *ev, int event_id)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *child_eo;
|
|
|
|
Evas_Object_Protected_Data *child;
|
2012-10-25 08:24:27 -07:00
|
|
|
EINA_LIST_FOREACH(src->proxy.src_event_in, l, child_eo)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
if (src->delete_me) return;
|
|
|
|
child = eo_data_get(child_eo, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_event_callback_call(child_eo, child, type, ev, event_id);
|
|
|
|
if (src->layer->evas->delete_me) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_transform_to_src_space(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *src, Evas_Coord *x, Evas_Coord *y)
|
|
|
|
{
|
|
|
|
Evas_Coord obj_w = obj->cur.geometry.w, obj_h = obj->cur.geometry.h;
|
|
|
|
Evas_Coord src_w = src->cur.geometry.w, src_h = src->cur.geometry.h;
|
|
|
|
Evas_Coord tmp_x = *x;
|
|
|
|
Evas_Coord tmp_y = *y;
|
|
|
|
|
|
|
|
tmp_x -= obj->cur.geometry.x;
|
|
|
|
tmp_y -= obj->cur.geometry.y;
|
|
|
|
|
|
|
|
if (obj_w != src_w)
|
|
|
|
tmp_x = (Evas_Coord) ((float)tmp_x * ((float)src_w / (float)obj_w));
|
|
|
|
if (obj_h != src_h)
|
|
|
|
tmp_y = (Evas_Coord) ((float)tmp_y * ((float)src_h / (float)obj_h));
|
|
|
|
|
|
|
|
tmp_x += src->cur.geometry.x;
|
|
|
|
tmp_y += src->cur.geometry.y;
|
|
|
|
*x = tmp_x;
|
|
|
|
*y = tmp_y;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Down *ev, int event_id)
|
2012-10-23 01:44:11 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-23 01:44:11 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Point output = ev->output;
|
|
|
|
Evas_Coord_Point canvas = ev->canvas;
|
2012-10-24 00:10:17 -07:00
|
|
|
|
2012-10-25 08:12:54 -07:00
|
|
|
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
2012-10-24 21:03:06 -07:00
|
|
|
|
2012-10-25 08:12:54 -07:00
|
|
|
_transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
|
2012-10-24 00:10:17 -07:00
|
|
|
|
2012-10-25 08:12:54 -07:00
|
|
|
ev->output.x = ev->canvas.x;
|
|
|
|
ev->output.y = ev->canvas.y;
|
2012-10-24 00:10:17 -07:00
|
|
|
|
2012-10-25 08:24:27 -07:00
|
|
|
if (src->proxy.src_event_in)
|
|
|
|
src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
|
2012-10-25 08:12:54 -07:00
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
int no_rep = 0;
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
|
|
|
Evas_Object_Protected_Data *child;
|
|
|
|
|
2012-10-23 01:44:11 -07:00
|
|
|
if (src->is_smart)
|
|
|
|
{
|
2012-10-25 08:24:27 -07:00
|
|
|
src->proxy.src_event_in = _evas_event_object_list_raw_in_get(eo_e, src->proxy.src_event_in, evas_object_smart_members_get_direct(eo_src), NULL, ev->canvas.x, ev->canvas.y, &no_rep, EINA_TRUE);
|
2012-10-23 01:44:11 -07:00
|
|
|
}
|
|
|
|
else
|
2012-10-26 05:44:52 -07:00
|
|
|
src->proxy.src_event_in = eina_list_append(src->proxy.src_event_in, src);
|
|
|
|
|
|
|
|
int addgrab = 0;
|
|
|
|
if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(src->proxy.src_event_in, l, eo_child)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *child = eo_data_get(eo_child,
|
|
|
|
EVAS_OBJ_CLASS);
|
|
|
|
if ((child->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) ||
|
|
|
|
(child->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN))
|
|
|
|
{
|
|
|
|
child->mouse_grabbed += (addgrab + 1);
|
|
|
|
e->pointer.mouse_grabbed += (addgrab + 1);
|
|
|
|
if (child->pointer_mode ==
|
|
|
|
EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
|
|
|
|
{
|
|
|
|
e->pointer.nogrep++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Evas_Coord point_x = ev->canvas.x;
|
|
|
|
Evas_Coord point_y = ev->canvas.y;
|
|
|
|
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
ev->canvas.x = point_x;
|
|
|
|
ev->canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child, &ev->canvas.x,
|
|
|
|
&ev->canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child, &ev->canvas.x,
|
|
|
|
&ev->canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_DOWN, ev, event_id);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
if (obj->pointer_mode ==
|
|
|
|
EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
2012-10-25 08:12:54 -07:00
|
|
|
ev->canvas = canvas;
|
|
|
|
ev->output = output;
|
2012-10-23 01:44:11 -07:00
|
|
|
}
|
|
|
|
|
2012-10-25 08:12:54 -07:00
|
|
|
static void
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Move *ev, int event_id)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-26 05:44:52 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Position cur_pos = ev->cur;
|
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
2012-10-25 08:12:54 -07:00
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
_transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y);
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
ev->cur.output.x = ev->cur.canvas.x;
|
|
|
|
ev->cur.output.y = ev->cur.canvas.y;
|
|
|
|
|
|
|
|
//FIXME: transform previous coords also.
|
2012-10-26 05:44:52 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
|
|
|
Evas_Object_Protected_Data *child;
|
|
|
|
Evas_Coord point_x = ev->cur.canvas.x;
|
|
|
|
Evas_Coord point_y = ev->cur.canvas.y;
|
|
|
|
|
|
|
|
if (e->pointer.mouse_grabbed)
|
|
|
|
{
|
|
|
|
Eina_List *outs = NULL;
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
|
|
|
|
if ((evas_object_clippers_is_visible(eo_child, child) ||
|
|
|
|
child->mouse_grabbed) &&
|
|
|
|
(!evas_event_passes_through(eo_child, child)) &&
|
|
|
|
(!evas_event_freezes_through(eo_child, child)) &&
|
|
|
|
(!child->clip.clipees))
|
|
|
|
{
|
|
|
|
ev->cur.canvas.x = point_x;
|
|
|
|
ev->cur.canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child, &ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child, &ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
if ((e->pointer.x != ev->cur.canvas.x) ||
|
|
|
|
(e->pointer.y != ev->cur.canvas.y))
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
ev, event_id);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
outs = eina_list_append(outs, eo_child);
|
|
|
|
if (e->delete_me || e->is_frozen) break;
|
|
|
|
//FIXME: take care nograb object
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
|
|
|
|
|
|
|
while (outs)
|
|
|
|
{
|
|
|
|
eo_child = outs->data;
|
|
|
|
outs = eina_list_remove(outs, eo_child);
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
if ((child->mouse_grabbed == 0) && (!e->delete_me))
|
|
|
|
{
|
|
|
|
if (child->mouse_in) continue;
|
|
|
|
child->mouse_in = 0;
|
|
|
|
if (child->delete_me || e->is_frozen) continue;
|
|
|
|
ev->cur.canvas.x = cur_pos.canvas.x;
|
|
|
|
ev->cur.canvas.y = cur_pos.canvas.y;
|
|
|
|
_evas_event_framespace_adjust(eo_child, &ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child, &ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
src->proxy.src_event_in =
|
|
|
|
eina_list_remove(src->proxy.src_event_in, eo_child);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_OUT,
|
|
|
|
ev, event_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Eina_List *ins = NULL;
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
if (src->is_smart)
|
|
|
|
{
|
|
|
|
int no_rep = 0;
|
|
|
|
ins = _evas_event_object_list_raw_in_get(eo_e, ins, evas_object_smart_members_get_direct(eo_src), NULL, ev->cur.canvas.x, ev->cur.canvas.y, &no_rep, EINA_TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ins = eina_list_append(ins, eo_src);
|
2012-10-25 08:12:54 -07:00
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
|
|
|
|
ev->cur.canvas.x = point_x;
|
|
|
|
ev->cur.canvas.y = point_y;
|
|
|
|
|
|
|
|
if (evas_object_is_in_output_rect(eo_child, child,
|
|
|
|
ev->cur.canvas.x,
|
|
|
|
ev->cur.canvas.y, 1, 1) &&
|
|
|
|
(evas_object_clippers_is_visible(eo_child, child) ||
|
|
|
|
child->mouse_grabbed) &&
|
|
|
|
eina_list_data_find(ins, eo_child) &&
|
|
|
|
(!evas_event_passes_through(eo_child, child)) &&
|
|
|
|
(!evas_event_freezes_through(eo_child, child)) &&
|
|
|
|
(!child->clip.clipees) &&
|
|
|
|
((!child->precise_is_inside) ||
|
|
|
|
evas_object_is_inside(eo_child, child, ev->cur.canvas.x,
|
|
|
|
ev->cur.canvas.y)))
|
|
|
|
{
|
|
|
|
_evas_event_havemap_adjust(eo_child, child, &ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
if ((e->pointer.x != ev->cur.canvas.x) ||
|
|
|
|
(e->pointer.y != ev->cur.canvas.y))
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_MOVE,
|
|
|
|
ev, event_id);
|
|
|
|
}
|
|
|
|
else if (child->mouse_in)
|
|
|
|
{
|
|
|
|
child->mouse_in = 0;
|
|
|
|
if (e->is_frozen) continue;
|
|
|
|
ev->cur.canvas.x = point_x;
|
|
|
|
ev->cur.canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child,
|
|
|
|
&ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child,
|
|
|
|
&ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_OUT,
|
|
|
|
ev, event_id);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (e->delete_me || e->is_frozen) break;
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
|
|
|
_evas_object_event_new();
|
|
|
|
int event_id2 = _evas_event_counter;
|
|
|
|
EINA_LIST_FOREACH(ins, l, eo_child)
|
|
|
|
{
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
if (!eina_list_data_find(src->proxy.src_event_in, eo_child))
|
|
|
|
{
|
|
|
|
if (!child->mouse_in)
|
|
|
|
{
|
|
|
|
child->mouse_in = 1;
|
|
|
|
if (e->is_frozen) continue;
|
|
|
|
ev->cur.canvas.x = point_x;
|
|
|
|
ev->cur.canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child,
|
|
|
|
&ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child,
|
|
|
|
&ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_IN,
|
|
|
|
ev, event_id2);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
|
|
|
{
|
|
|
|
if (src->proxy.src_event_in)
|
|
|
|
eina_list_free(src->proxy.src_event_in);
|
|
|
|
src->proxy.src_event_in = ins;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ins) eina_list_free(ins);
|
|
|
|
}
|
|
|
|
}
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
ev->cur = cur_pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Up *ev, int event_id)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-26 05:44:52 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Point output = ev->output;
|
|
|
|
Evas_Coord_Point canvas = ev->canvas;
|
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
_transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
|
|
|
|
|
|
|
|
ev->output.x = ev->canvas.x;
|
|
|
|
ev->output.y = ev->canvas.y;
|
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
|
|
|
Evas_Object_Protected_Data *child;
|
|
|
|
Evas_Coord point_x = ev->canvas.x;
|
|
|
|
Evas_Coord point_y = ev->canvas.y;
|
|
|
|
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
if (src->delete_me) return;
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
if ((child->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) &&
|
|
|
|
(child->mouse_grabbed > 0))
|
|
|
|
{
|
|
|
|
child->mouse_grabbed--;
|
|
|
|
e->pointer.mouse_grabbed--;
|
|
|
|
}
|
|
|
|
|
|
|
|
ev->canvas.x = point_x;
|
|
|
|
ev->canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child,
|
|
|
|
&ev->canvas.x,
|
|
|
|
&ev->canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child,
|
|
|
|
&ev->canvas.x,
|
|
|
|
&ev->canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_UP, ev, event_id);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
if (obj->pointer_mode ==
|
|
|
|
EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
|
|
|
|
{
|
|
|
|
if (e->pointer.nogrep > 0) e->pointer.nogrep--;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
ev->canvas = canvas;
|
|
|
|
ev->output = output;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-28 00:54:42 -07:00
|
|
|
_evas_event_source_hold_events(Evas_Object *eo_obj, Evas *eo_e EINA_UNUSED, void *ev, int event_id)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-26 05:44:52 -07:00
|
|
|
|
2012-10-25 08:12:54 -07:00
|
|
|
if (obj->layer->evas->is_frozen) return;
|
2012-10-26 05:44:52 -07:00
|
|
|
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *child_eo;
|
|
|
|
Evas_Object_Protected_Data *child;
|
|
|
|
EINA_LIST_FOREACH(src->proxy.src_event_in, l, child_eo)
|
|
|
|
{
|
|
|
|
if (src->delete_me) return;
|
|
|
|
child = eo_data_get(child_eo, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_event_callback_call(child_eo, child, EVAS_CALLBACK_HOLD, ev,
|
|
|
|
event_id);
|
|
|
|
if (src->layer->evas->delete_me) break;
|
|
|
|
}
|
2012-10-25 08:12:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Wheel *ev, int event_id)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-26 05:44:52 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Point output = ev->output;
|
|
|
|
Evas_Coord_Point canvas = ev->canvas;
|
|
|
|
|
|
|
|
if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return;
|
|
|
|
|
|
|
|
_transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
|
|
|
|
|
|
|
|
ev->output.x = ev->canvas.x;
|
|
|
|
ev->output.y = ev->canvas.y;
|
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
|
|
|
Evas_Object_Protected_Data *child;
|
|
|
|
Evas_Coord point_x = ev->canvas.x;
|
|
|
|
Evas_Coord point_y = ev->canvas.y;
|
2012-10-25 08:12:54 -07:00
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
if (src->delete_me) return;
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
ev->canvas.x = point_x;
|
|
|
|
ev->canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child,
|
|
|
|
&ev->canvas.x,
|
|
|
|
&ev->canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child,
|
|
|
|
&ev->canvas.x,
|
|
|
|
&ev->canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_WHEEL, ev, event_id);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
2012-10-25 08:12:54 -07:00
|
|
|
ev->canvas = canvas;
|
|
|
|
ev->output = output;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_multi_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Multi_Down *ev, int event_id)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-26 05:44:52 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Point output = ev->output;
|
|
|
|
Evas_Coord_Precision_Point canvas = ev->canvas;
|
|
|
|
|
|
|
|
if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return;
|
|
|
|
|
|
|
|
_transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
|
|
|
|
//FIXME: transform precision
|
|
|
|
|
|
|
|
ev->output.x = ev->canvas.x;
|
|
|
|
ev->output.y = ev->canvas.y;
|
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
2012-10-28 00:54:46 -07:00
|
|
|
Evas_Object_Protected_Data *child = NULL;
|
2012-10-26 05:44:52 -07:00
|
|
|
|
|
|
|
int addgrab = 0;
|
|
|
|
if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(src->proxy.src_event_in, l, eo_child)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *child = eo_data_get(eo_child,
|
|
|
|
EVAS_OBJ_CLASS);
|
|
|
|
if (child->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
|
|
|
|
{
|
|
|
|
child->mouse_grabbed += (addgrab + 1);
|
|
|
|
e->pointer.mouse_grabbed += (addgrab + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
Evas_Coord point_x = ev->canvas.x;
|
|
|
|
Evas_Coord point_y = ev->canvas.y;
|
2012-10-28 00:54:46 -07:00
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
ev->canvas.x = point_x;
|
|
|
|
ev->canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child,
|
|
|
|
&ev->canvas.x,
|
|
|
|
&ev->canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child,
|
|
|
|
&ev->canvas.x,
|
|
|
|
&ev->canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MULTI_DOWN, ev, event_id);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
ev->canvas = canvas;
|
|
|
|
ev->output = output;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_multi_up_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Multi_Up *ev, int event_id)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-26 05:44:52 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Point output = ev->output;
|
|
|
|
Evas_Coord_Precision_Point canvas = ev->canvas;
|
|
|
|
|
|
|
|
if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return;
|
|
|
|
|
|
|
|
_transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
|
|
|
|
//FIXME: transform precision
|
|
|
|
|
|
|
|
ev->output.x = ev->canvas.x;
|
|
|
|
ev->output.y = ev->canvas.y;
|
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
Evas_Coord point_x = ev->canvas.x;
|
|
|
|
Evas_Coord point_y = ev->canvas.y;
|
|
|
|
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
2012-10-28 00:54:46 -07:00
|
|
|
Evas_Object_Protected_Data *child = NULL;
|
2012-10-26 05:44:52 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
ev->canvas.x = point_x;
|
|
|
|
ev->canvas.y = point_y;
|
|
|
|
if ((child->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
|
|
|
|
(child->mouse_grabbed > 0))
|
|
|
|
{
|
|
|
|
child->mouse_grabbed--;
|
|
|
|
e->pointer.mouse_grabbed--;
|
|
|
|
}
|
|
|
|
_evas_event_framespace_adjust(eo_child,
|
|
|
|
&ev->canvas.x,
|
|
|
|
&ev->canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child,
|
|
|
|
&ev->canvas.x,
|
|
|
|
&ev->canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MULTI_UP,
|
|
|
|
ev, event_id);
|
|
|
|
if (e->delete_me || e->is_frozen) break;
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
ev->canvas = canvas;
|
|
|
|
ev->output = output;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Multi_Move *ev, int event_id)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-26 05:44:52 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Precision_Position cur_pos = ev->cur;
|
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
_transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y);
|
|
|
|
|
|
|
|
ev->cur.output.x = ev->cur.canvas.x;
|
|
|
|
ev->cur.output.y = ev->cur.canvas.y;
|
2012-10-26 05:44:52 -07:00
|
|
|
//FIXME: transform precision
|
|
|
|
|
|
|
|
Evas_Coord point_x = ev->cur.canvas.x;
|
|
|
|
Evas_Coord point_y = ev->cur.canvas.y;
|
2012-10-25 08:12:54 -07:00
|
|
|
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_object_event_new();
|
|
|
|
event_id = _evas_event_counter;
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
|
|
|
Evas_Object_Protected_Data *child;
|
|
|
|
|
|
|
|
if (e->pointer.mouse_grabbed > 0)
|
|
|
|
{
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
2012-10-28 00:54:39 -07:00
|
|
|
if (((evas_object_clippers_is_visible(eo_child, child)) ||
|
|
|
|
((child->mouse_grabbed) &&
|
2012-10-26 05:44:52 -07:00
|
|
|
(!evas_event_passes_through(eo_child, child)) &&
|
|
|
|
(!evas_event_freezes_through(eo_child, child)) &&
|
2012-10-28 00:54:39 -07:00
|
|
|
(!child->clip.clipees))))
|
2012-10-26 05:44:52 -07:00
|
|
|
{
|
|
|
|
ev->cur.canvas.x = point_x;
|
|
|
|
ev->cur.canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child,
|
|
|
|
&ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child,
|
|
|
|
&ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MULTI_MOVE, ev,
|
|
|
|
event_id);
|
|
|
|
if (e->delete_me || e->is_frozen) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Eina_List *ins = NULL;
|
|
|
|
|
|
|
|
if (src->is_smart)
|
|
|
|
{
|
|
|
|
int no_rep = 0;
|
|
|
|
ins = _evas_event_object_list_raw_in_get(eo_e, ins, evas_object_smart_members_get_direct(eo_src), NULL, ev->cur.canvas.x, ev->cur.canvas.y, &no_rep, EINA_TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ins = eina_list_append(ins, src);
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
ev->cur.canvas.x = point_x;
|
|
|
|
ev->cur.canvas.y = point_y;
|
|
|
|
|
|
|
|
if (evas_object_is_in_output_rect(eo_child, child,
|
|
|
|
ev->cur.canvas.x,
|
|
|
|
ev->cur.canvas.y, 1, 1) &&
|
|
|
|
(evas_object_clippers_is_visible(eo_child, child) ||
|
|
|
|
child->mouse_grabbed) &&
|
|
|
|
eina_list_data_find(ins, eo_child) &&
|
|
|
|
(!evas_event_passes_through(eo_child, child)) &&
|
|
|
|
(!evas_event_freezes_through(eo_child, child)) &&
|
|
|
|
(!child->clip.clipees) &&
|
|
|
|
((!child->precise_is_inside) ||
|
|
|
|
evas_object_is_inside(eo_child, child, ev->cur.canvas.x,
|
|
|
|
ev->cur.canvas.y)))
|
|
|
|
{
|
|
|
|
_evas_event_framespace_adjust(eo_child,
|
|
|
|
&ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child,
|
|
|
|
&ev->cur.canvas.x,
|
|
|
|
&ev->cur.canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MULTI_MOVE, ev,
|
|
|
|
event_id);
|
|
|
|
if (e->delete_me || e->is_frozen) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eina_list_free(copy);
|
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
|
|
|
{
|
|
|
|
eina_list_free(src->proxy.src_event_in);
|
|
|
|
src->proxy.src_event_in = ins;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
eina_list_free(ins);
|
|
|
|
}
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
ev->cur = cur_pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-28 07:48:43 -07:00
|
|
|
_evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_In *ev, int event_id)
|
2012-10-25 08:12:54 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-28 07:48:43 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Point output = ev->output;
|
|
|
|
Evas_Coord_Point canvas = ev->canvas;
|
|
|
|
|
2012-10-28 07:48:43 -07:00
|
|
|
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
_transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
|
|
|
|
|
|
|
|
ev->output.x = ev->canvas.x;
|
|
|
|
ev->output.y = ev->canvas.y;
|
|
|
|
|
2012-10-28 07:48:43 -07:00
|
|
|
Eina_List *ins = NULL;
|
|
|
|
if (src->is_smart)
|
|
|
|
{
|
|
|
|
int no_rep = 0;
|
|
|
|
ins = _evas_event_object_list_raw_in_get(eo_e, ins, evas_object_smart_members_get_direct(eo_src), NULL, ev->canvas.x, ev->canvas.y, &no_rep, EINA_TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ins = eina_list_append(ins, src);
|
|
|
|
|
|
|
|
Evas_Coord point_x = ev->canvas.x;
|
|
|
|
Evas_Coord point_y = ev->canvas.y;
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
|
|
|
EINA_LIST_FOREACH(ins, l, eo_child)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *child = eo_data_get(eo_child,
|
|
|
|
EVAS_OBJ_CLASS);
|
|
|
|
if (!eina_list_data_find(src->proxy.src_event_in, eo_child))
|
|
|
|
{
|
|
|
|
if(child->mouse_in) continue;
|
|
|
|
child->mouse_in = 1;
|
|
|
|
ev->canvas.x = point_x;
|
|
|
|
ev->canvas.y = point_y;
|
|
|
|
_evas_event_framespace_adjust(eo_child, &ev->canvas.x,
|
|
|
|
&ev->canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child, &ev->canvas.x,
|
|
|
|
&ev->canvas.y,
|
|
|
|
child->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_IN, ev,
|
|
|
|
event_id);
|
|
|
|
if (e->delete_me || e->is_frozen) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
|
|
|
|
src->proxy.src_event_in = ins;
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
ev->canvas = canvas;
|
|
|
|
ev->output = output;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-10-28 07:48:43 -07:00
|
|
|
_evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Out *ev, int event_id)
|
2012-10-23 21:36:02 -07:00
|
|
|
{
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
|
|
|
|
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
2012-10-28 07:48:43 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2012-10-25 08:24:27 -07:00
|
|
|
Evas_Point output = ev->output;
|
2012-10-25 08:12:54 -07:00
|
|
|
Evas_Coord_Point canvas = ev->canvas;
|
|
|
|
|
2012-10-28 07:48:43 -07:00
|
|
|
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
_transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
|
|
|
|
|
|
|
|
ev->output.x = ev->canvas.x;
|
|
|
|
ev->output.y = ev->canvas.y;
|
|
|
|
|
2012-10-28 07:48:43 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *eo_child;
|
|
|
|
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
|
|
|
Evas_Coord point_x = ev->canvas.x;
|
|
|
|
Evas_Coord point_y = ev->canvas.y;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_child)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *child = eo_data_get(eo_child,
|
|
|
|
EVAS_OBJ_CLASS);
|
|
|
|
if (!child->mouse_in) continue;
|
|
|
|
child->mouse_in = 0;
|
|
|
|
|
|
|
|
if (child->delete_me) continue;
|
|
|
|
|
|
|
|
ev->canvas.x = point_x;
|
|
|
|
ev->canvas.y = point_y;
|
|
|
|
|
|
|
|
_evas_event_framespace_adjust(eo_child, &ev->canvas.x, &ev->canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_child, child, &ev->canvas.x,
|
|
|
|
&ev->canvas.y, child->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_child, child,
|
|
|
|
EVAS_CALLBACK_MOUSE_OUT, ev, event_id);
|
|
|
|
if (e->is_frozen) continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
eina_list_free(copy);
|
|
|
|
src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
|
2012-10-25 08:12:54 -07:00
|
|
|
|
|
|
|
ev->canvas = canvas;
|
|
|
|
ev->output = output;
|
2012-10-23 21:36:02 -07:00
|
|
|
}
|
|
|
|
|
2012-01-17 00:35:32 -08:00
|
|
|
static Eina_List *
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
|
2012-01-17 00:35:32 -08:00
|
|
|
const Eina_Inlist *list, Evas_Object *stop,
|
2012-10-23 01:44:11 -07:00
|
|
|
int x, int y, int *no_rep, Eina_Bool source)
|
2012-01-17 00:35:32 -08:00
|
|
|
{
|
|
|
|
if (!list) return NULL;
|
2012-10-08 18:58:41 -07:00
|
|
|
return _evas_event_object_list_raw_in_get(eo_e, in, list->last, stop, x, y,
|
2012-10-23 01:44:11 -07:00
|
|
|
no_rep, source);
|
2012-01-17 00:35:32 -08:00
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *in = NULL;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((!e->layers) || (e->is_frozen)) return NULL;
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-06-12 23:08:01 -07:00
|
|
|
int no_rep = 0;
|
2012-10-08 18:58:41 -07:00
|
|
|
in = _evas_event_object_list_in_get(eo_e, in,
|
2011-09-21 03:35:03 -07:00
|
|
|
EINA_INLIST_GET(lay->objects),
|
2012-10-23 01:44:11 -07:00
|
|
|
stop, x, y, &no_rep, EINA_FALSE);
|
2012-06-12 23:08:01 -07:00
|
|
|
if (no_rep) return in;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
static Eina_List *
|
|
|
|
evas_event_list_copy(Eina_List *list)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l, *new_l = NULL;
|
|
|
|
const void *data;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(list, l, data)
|
|
|
|
new_l = eina_list_append(new_l, data);
|
2002-11-08 00:02:15 -08:00
|
|
|
return new_l;
|
|
|
|
}
|
|
|
|
/* public functions */
|
|
|
|
|
2011-12-16 01:24:18 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_default_flags_set(Evas *eo_e, Evas_Event_Flags flags)
|
2011-12-16 01:24:18 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2011-12-16 01:24:18 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, evas_canvas_event_default_flags_set(flags));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_default_flags_set(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Event_Flags flags = va_arg(*list, Evas_Event_Flags);
|
|
|
|
Evas_Public_Data *e = _pd;
|
2011-12-16 01:24:18 -08:00
|
|
|
e->default_event_flags = flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Event_Flags
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_default_flags_get(const Evas *eo_e)
|
2011-12-16 01:24:18 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2011-12-16 01:24:18 -08:00
|
|
|
return EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Event_Flags flags = EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
eo_do((Eo *)eo_e, evas_canvas_event_default_flags_get(&flags));
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_default_flags_get(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Event_Flags *ret = va_arg(*list, Evas_Event_Flags *);
|
|
|
|
const Evas_Public_Data *e = _pd;
|
|
|
|
*ret = e->default_event_flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
_canvas_event_thaw_eval_internal(Eo *eo_e, Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
evas_event_feed_mouse_move(eo_e, e->pointer.x, e->pointer.y,
|
|
|
|
e->last_timestamp, NULL);
|
2011-12-16 01:24:18 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_freeze(Evas *eo_e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, eo_event_freeze());
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_thaw(Evas *eo_e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, eo_event_thaw());
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_freeze(Eo *eo_e, void *_pd, va_list *list EINA_UNUSED)
|
|
|
|
{
|
|
|
|
eo_do_super(eo_e, eo_event_freeze());
|
|
|
|
Evas_Public_Data *e = _pd;
|
|
|
|
e->is_frozen = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_thaw(Eo *eo_e, void *_pd, va_list *list EINA_UNUSED)
|
|
|
|
{
|
|
|
|
int fcount = -1;
|
|
|
|
eo_do_super(eo_e,
|
|
|
|
eo_event_thaw(),
|
|
|
|
eo_event_freeze_get(&fcount));
|
|
|
|
if (0 == fcount)
|
2005-07-22 03:28:11 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Public_Data *e = _pd;
|
2011-09-21 03:35:03 -07:00
|
|
|
Evas_Layer *lay;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
e->is_frozen = EINA_FALSE;
|
2011-09-21 03:35:03 -07:00
|
|
|
EINA_INLIST_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(lay->objects, obj)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj = obj->object;
|
|
|
|
evas_object_clip_recalc(eo_obj, obj);
|
|
|
|
evas_object_recalc_clippees(eo_obj, obj);
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
|
|
|
|
_canvas_event_thaw_eval_internal(eo_e, e);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_freeze_get(const Evas *eo_e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
int ret = 0;
|
|
|
|
eo_do((Eo *)eo_e, eo_event_freeze_get(&ret));
|
|
|
|
return ret;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2011-05-27 01:26:11 -07:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_thaw_eval(Evas *eo_e)
|
2011-05-27 01:26:11 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2011-05-27 01:26:11 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
|
|
|
if (0 == evas_event_freeze_get(eo_e))
|
|
|
|
{
|
|
|
|
_canvas_event_thaw_eval_internal(eo_e, e);
|
|
|
|
}
|
2011-05-27 01:26:11 -07:00
|
|
|
}
|
2009-09-17 15:38:10 -07:00
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_down(Evas *eo_e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
eo_do(eo_e, evas_canvas_event_feed_mouse_down(b, flags, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_mouse_down(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
int b = va_arg(*list, int);
|
|
|
|
Evas_Button_Flags flags = va_arg(*list, Evas_Button_Flags);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l, *copy;
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Down ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-12 21:59:36 -08:00
|
|
|
int addgrab = 0;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2011-12-14 21:25:37 -08:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if ((b < 1) || (b > 32)) return;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->pointer.button |= (1 << (b - 1));
|
2011-12-12 21:59:36 -08:00
|
|
|
e->pointer.downs++;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2008-01-23 01:00:59 -08:00
|
|
|
ev.button = b;
|
|
|
|
ev.output.x = e->pointer.x;
|
|
|
|
ev.output.y = e->pointer.y;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.flags = flags;
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* append new touch point to the touch point list */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_append(eo_e, 0, e->pointer.x, e->pointer.y);
|
2011-06-28 22:05:32 -07:00
|
|
|
/* If this is the first finger down, i.e no other fingers pressed,
|
|
|
|
* get a new event list, otherwise, keep the current grabbed list. */
|
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Eina_List *ins = evas_event_objects_event_list(eo_e,
|
2011-10-27 03:36:09 -07:00
|
|
|
NULL,
|
|
|
|
e->pointer.x,
|
|
|
|
e->pointer.y);
|
2011-06-28 22:05:32 -07:00
|
|
|
/* free our old list of ins */
|
|
|
|
e->pointer.object.in = eina_list_free(e->pointer.object.in);
|
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = ins;
|
2011-12-12 21:59:36 -08:00
|
|
|
/* adjust grabbed count by the nuymber of currently held down
|
|
|
|
* fingers/buttons */
|
|
|
|
if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1;
|
2011-06-28 22:05:32 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-01-17 00:35:32 -08:00
|
|
|
if ((obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) ||
|
|
|
|
(obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN))
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2011-12-12 21:59:36 -08:00
|
|
|
obj->mouse_grabbed += addgrab + 1;
|
|
|
|
e->pointer.mouse_grabbed += addgrab + 1;
|
2012-01-17 00:35:32 -08:00
|
|
|
if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
|
|
|
|
{
|
|
|
|
e->pointer.nogrep++;
|
|
|
|
break;
|
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2011-09-25 19:45:06 -07:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2011-09-25 19:45:06 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2011-09-25 19:45:06 -07:00
|
|
|
if (obj->delete_me) continue;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x, &ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
|
2011-09-23 21:01:36 -07:00
|
|
|
|
2012-10-25 21:41:59 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_DOWN, &ev,
|
|
|
|
event_id);
|
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
|
|
|
_evas_event_source_mouse_down_events(eo_obj, eo_e, &ev,
|
|
|
|
event_id);
|
|
|
|
if (e->is_frozen || e->delete_me) break;
|
2012-01-17 00:35:32 -08:00
|
|
|
if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
|
|
|
|
break;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2009-06-12 17:04:25 -07:00
|
|
|
if (copy) eina_list_free(copy);
|
2006-08-25 13:47:32 -07:00
|
|
|
e->last_mouse_down_counter++;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* update touch point's state to EVAS_TOUCH_POINT_STILL */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_update(eo_e, 0, e->pointer.x, e->pointer.y, EVAS_TOUCH_POINT_STILL);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2011-06-13 03:00:25 -07:00
|
|
|
static int
|
2012-10-08 18:58:41 -07:00
|
|
|
_post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data)
|
2011-06-13 03:00:25 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
2011-06-13 03:00:25 -07:00
|
|
|
Eina_List *l, *copy, *ins, *ll;
|
|
|
|
Evas_Event_Mouse_Out ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-06-13 03:00:25 -07:00
|
|
|
int post_called = 0;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-06-13 03:00:25 -07:00
|
|
|
_evas_object_event_new();
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-06-13 03:00:25 -07:00
|
|
|
ev.buttons = e->pointer.button;
|
|
|
|
ev.output.x = e->pointer.x;
|
|
|
|
ev.output.y = e->pointer.y;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2011-06-13 03:00:25 -07:00
|
|
|
/* get new list of ins */
|
2012-10-08 18:58:41 -07:00
|
|
|
ins = evas_event_objects_event_list(eo_e, NULL, e->pointer.x, e->pointer.y);
|
2011-06-13 03:00:25 -07:00
|
|
|
/* go thru old list of in objects */
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, ll, eo_obj)
|
2011-06-13 03:00:25 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-10-25 22:52:42 -07:00
|
|
|
if ((!eina_list_data_find(ins, eo_obj)) || (!e->pointer.inside))
|
2011-06-13 03:00:25 -07:00
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
if (!obj->mouse_in) continue;
|
|
|
|
obj->mouse_in = 0;
|
|
|
|
if (!e->is_frozen)
|
2011-06-13 03:00:25 -07:00
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x,
|
|
|
|
&ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x,
|
|
|
|
&ev.canvas.y, obj->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_OUT,
|
|
|
|
&ev, event_id);
|
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-28 07:48:43 -07:00
|
|
|
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev,
|
2012-10-25 22:52:42 -07:00
|
|
|
event_id);
|
|
|
|
if (e->delete_me) break;
|
2011-06-13 03:00:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-06-13 03:00:25 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
|
|
|
if (e->pointer.inside)
|
|
|
|
{
|
2011-06-14 07:04:07 -07:00
|
|
|
Evas_Event_Mouse_In ev_in;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj_itr;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-06-13 03:00:25 -07:00
|
|
|
_evas_object_event_new();
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-06-14 07:04:07 -07:00
|
|
|
ev_in.buttons = e->pointer.button;
|
|
|
|
ev_in.output.x = e->pointer.x;
|
|
|
|
ev_in.output.y = e->pointer.y;
|
|
|
|
ev_in.canvas.x = e->pointer.x;
|
|
|
|
ev_in.canvas.y = e->pointer.y;
|
|
|
|
ev_in.data = (void *)data;
|
|
|
|
ev_in.modifiers = &(e->modifiers);
|
|
|
|
ev_in.locks = &(e->locks);
|
|
|
|
ev_in.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev_in.event_flags = e->default_event_flags;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(ins, l, eo_obj_itr)
|
2011-06-13 03:00:25 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj_itr = eo_data_get(eo_obj_itr, EVAS_OBJ_CLASS);
|
|
|
|
if (!eina_list_data_find(e->pointer.object.in, eo_obj_itr))
|
2011-06-13 03:00:25 -07:00
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
if (obj_itr->mouse_in) continue;
|
|
|
|
obj_itr->mouse_in = 1;
|
|
|
|
if (e->is_frozen) continue;
|
|
|
|
ev_in.canvas.x = e->pointer.x;
|
|
|
|
ev_in.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj_itr, &ev_in.canvas.x,
|
|
|
|
&ev_in.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj_itr, obj_itr,
|
|
|
|
&ev_in.canvas.x, &ev_in.canvas.y,
|
|
|
|
obj_itr->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj_itr, obj_itr,
|
|
|
|
EVAS_CALLBACK_MOUSE_IN,
|
|
|
|
&ev_in, event_id);
|
|
|
|
if ((obj_itr->proxy.is_proxy) &&
|
|
|
|
(obj_itr->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_in_events(eo_obj_itr, eo_e, &ev_in,
|
2012-10-25 22:52:42 -07:00
|
|
|
event_id);
|
|
|
|
if (e->delete_me) break;
|
2011-06-13 03:00:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
post_called = 1;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2011-06-13 03:00:25 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ins = eina_list_free(ins);
|
|
|
|
}
|
2011-06-28 22:05:35 -07:00
|
|
|
|
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
|
|
|
{
|
|
|
|
/* free our old list of ins */
|
|
|
|
eina_list_free(e->pointer.object.in);
|
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = ins;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* free our cur ins */
|
|
|
|
eina_list_free(ins);
|
|
|
|
}
|
2011-06-13 03:00:25 -07:00
|
|
|
if (e->pointer.inside)
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_move(eo_e, e->pointer.x, e->pointer.y, timestamp, data);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2011-06-13 03:00:25 -07:00
|
|
|
return post_called;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_up(Evas *eo_e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, evas_canvas_event_feed_mouse_up(b, flags, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_mouse_up(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
int b = va_arg(*list, int);
|
|
|
|
Evas_Button_Flags flags = va_arg(*list, Evas_Button_Flags);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if ((b < 1) || (b > 32)) return;
|
2012-07-31 22:43:50 -07:00
|
|
|
if (e->pointer.downs <= 0) return;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->pointer.button &= ~(1 << (b - 1));
|
2011-12-12 21:59:36 -08:00
|
|
|
e->pointer.downs--;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-09-21 03:35:03 -07:00
|
|
|
Evas_Event_Mouse_Up ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-09-21 03:35:03 -07:00
|
|
|
ev.button = b;
|
|
|
|
ev.output.x = e->pointer.x;
|
|
|
|
ev.output.y = e->pointer.y;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.flags = flags;
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2011-09-21 03:35:03 -07:00
|
|
|
_evas_walk(e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* update released touch point */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_update(eo_e, 0, e->pointer.x, e->pointer.y, EVAS_TOUCH_POINT_UP);
|
2011-09-21 03:35:03 -07:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-01-17 00:35:32 -08:00
|
|
|
if ((obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) &&
|
2011-09-23 21:01:36 -07:00
|
|
|
(obj->mouse_grabbed > 0))
|
|
|
|
{
|
|
|
|
obj->mouse_grabbed--;
|
|
|
|
e->pointer.mouse_grabbed--;
|
|
|
|
}
|
|
|
|
if (!obj->delete_me)
|
2010-08-23 19:53:33 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((!e->is_frozen) &&
|
|
|
|
(!evas_event_freezes_through(eo_obj, obj)))
|
2012-10-23 01:44:11 -07:00
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x,
|
|
|
|
&ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x,
|
|
|
|
&ev.canvas.y,
|
|
|
|
obj->mouse_grabbed);
|
2012-10-23 01:44:11 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_UP,
|
|
|
|
&ev, event_id);
|
2012-10-25 08:24:27 -07:00
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_up_events(eo_obj, eo_e, &ev,
|
2012-10-25 08:12:54 -07:00
|
|
|
event_id);
|
2012-10-25 22:52:42 -07:00
|
|
|
if (e->delete_me) break;
|
2012-10-23 01:44:11 -07:00
|
|
|
}
|
2010-08-23 19:53:33 -07:00
|
|
|
}
|
2012-01-17 00:35:32 -08:00
|
|
|
if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
|
|
|
|
{
|
|
|
|
if (e->pointer.nogrep > 0) e->pointer.nogrep--;
|
|
|
|
break;
|
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
if (copy) copy = eina_list_free(copy);
|
|
|
|
e->last_mouse_up_counter++;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2011-06-23 23:59:30 -07:00
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
_post_up_handle(eo_e, timestamp, data);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2007-07-24 07:20:07 -07:00
|
|
|
|
|
|
|
if (e->pointer.mouse_grabbed < 0)
|
2008-11-14 21:13:09 -08:00
|
|
|
{
|
2009-10-22 08:22:22 -07:00
|
|
|
ERR("BUG? e->pointer.mouse_grabbed (=%d) < 0!",
|
2011-09-21 03:35:03 -07:00
|
|
|
e->pointer.mouse_grabbed);
|
2008-11-14 21:13:09 -08:00
|
|
|
}
|
2011-12-30 07:17:13 -08:00
|
|
|
/* remove released touch point from the touch point list */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_remove(eo_e, 0);
|
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2008-05-18 21:15:22 -07:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_cancel(Evas *eo_e, unsigned int timestamp, const void *data)
|
2008-05-18 21:15:22 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2008-05-18 21:15:22 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, evas_canvas_event_feed_mouse_cancel(timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_mouse_cancel(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (e->is_frozen) return;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-05-18 21:15:22 -07:00
|
|
|
_evas_walk(e);
|
|
|
|
for (i = 0; i < 32; i++)
|
|
|
|
{
|
2011-09-21 03:35:03 -07:00
|
|
|
if ((e->pointer.button & (1 << i)))
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_up(eo_e, i + 1, 0, timestamp, data);
|
2008-05-18 21:15:22 -07:00
|
|
|
}
|
2011-12-30 07:17:13 -08:00
|
|
|
// FIXME: multi cancel too?
|
2008-05-18 21:15:22 -07:00
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_wheel(Evas *eo_e, int direction, int z, unsigned int timestamp, const void *data)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
eo_do(eo_e, evas_canvas_event_feed_mouse_wheel(direction, z, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_mouse_wheel(Eo *eo_e, void *_pd, va_list *list)
|
2004-12-13 19:21:32 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
int direction = va_arg(*list, int);
|
|
|
|
int z = va_arg(*list, int);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l, *copy;
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Wheel ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2008-01-23 01:00:59 -08:00
|
|
|
ev.direction = direction;
|
|
|
|
ev.z = z;
|
|
|
|
ev.output.x = e->pointer.x;
|
|
|
|
ev.output.y = e->pointer.y;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
ev.data = (void *) data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2004-12-13 19:21:32 -08:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2005-09-21 19:52:53 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-10-25 22:52:42 -07:00
|
|
|
if (!evas_event_freezes_through(eo_obj, obj))
|
2012-10-23 01:44:11 -07:00
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x, &ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y,
|
|
|
|
obj->mouse_grabbed);
|
2012-10-23 01:44:11 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_WHEEL, &ev,
|
|
|
|
event_id);
|
2012-10-25 08:24:27 -07:00
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_wheel_events(eo_obj, eo_e, &ev, event_id);
|
2012-10-25 22:52:42 -07:00
|
|
|
if (e->delete_me || e->is_frozen) break;
|
2012-10-23 01:44:11 -07:00
|
|
|
}
|
2005-09-21 19:52:53 -07:00
|
|
|
}
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2004-12-13 19:21:32 -08:00
|
|
|
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2004-12-13 19:21:32 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_move(Evas *eo_e, int x, int y, unsigned int timestamp, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
eo_do(eo_e, evas_canvas_event_feed_mouse_move(x, y, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
int x = va_arg(*list, int);
|
|
|
|
int y = va_arg(*list, int);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
2012-01-17 00:35:32 -08:00
|
|
|
Evas_Object *nogrep_obj = NULL;
|
2002-11-08 00:02:15 -08:00
|
|
|
int px, py;
|
2006-11-15 19:20:24 -08:00
|
|
|
//// Evas_Coord pcx, pcy;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
px = e->pointer.x;
|
|
|
|
py = e->pointer.y;
|
2006-11-15 19:20:24 -08:00
|
|
|
//// pcx = e->pointer.canvas_x;
|
|
|
|
//// pcy = e->pointer.canvas_y;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->pointer.x = x;
|
|
|
|
e->pointer.y = y;
|
2006-11-15 19:20:24 -08:00
|
|
|
//// e->pointer.canvas_x = x;
|
|
|
|
//// e->pointer.canvas_y = y;
|
2012-10-08 18:58:41 -07:00
|
|
|
//// e->pointer.canvas_x = evas_coord_screen_x_to_world(eo_e, x);
|
|
|
|
//// e->pointer.canvas_y = evas_coord_screen_y_to_world(eo_e, y);
|
2004-09-17 06:46:55 -07:00
|
|
|
if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return;
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* update moved touch point */
|
|
|
|
if ((px != x) || (py != y))
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_update(eo_e, 0, e->pointer.x, e->pointer.y, EVAS_TOUCH_POINT_MOVE);
|
2005-05-21 19:49:50 -07:00
|
|
|
/* if our mouse button is grabbed to any objects */
|
2006-04-19 07:37:49 -07:00
|
|
|
if (e->pointer.mouse_grabbed > 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-09-21 03:35:03 -07:00
|
|
|
/* go thru old list of in objects */
|
|
|
|
Eina_List *outs = NULL;
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Move ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-09-21 03:35:03 -07:00
|
|
|
ev.buttons = e->pointer.button;
|
|
|
|
ev.cur.output.x = e->pointer.x;
|
|
|
|
ev.cur.output.y = e->pointer.y;
|
|
|
|
ev.cur.canvas.x = e->pointer.x;
|
|
|
|
ev.cur.canvas.y = e->pointer.y;
|
|
|
|
ev.prev.output.x = px;
|
|
|
|
ev.prev.output.y = py;
|
|
|
|
ev.prev.canvas.x = px;
|
|
|
|
ev.prev.canvas.y = py;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
2011-09-21 03:35:03 -07:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
if ((!e->is_frozen) &&
|
|
|
|
(evas_object_clippers_is_visible(eo_obj, obj) ||
|
2011-11-15 07:10:19 -08:00
|
|
|
obj->mouse_grabbed) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
(!evas_event_passes_through(eo_obj, obj)) &&
|
|
|
|
(!evas_event_freezes_through(eo_obj, obj)) &&
|
2012-10-21 23:48:21 -07:00
|
|
|
(!evas_object_is_source_invisible(eo_obj, obj)) &&
|
2011-09-23 21:01:36 -07:00
|
|
|
(!obj->clip.clipees))
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
ev.cur.canvas.x = e->pointer.x;
|
|
|
|
ev.cur.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.cur.canvas.x,
|
|
|
|
&ev.cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x,
|
|
|
|
&ev.cur.canvas.y,
|
|
|
|
obj->mouse_grabbed);
|
|
|
|
|
2011-09-21 03:35:03 -07:00
|
|
|
if ((px != x) || (py != y))
|
2012-10-23 01:44:11 -07:00
|
|
|
{
|
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
|
2012-10-25 22:52:42 -07:00
|
|
|
if ((obj->proxy.is_proxy) &&
|
|
|
|
(obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_move_events(eo_obj, eo_e,
|
|
|
|
&ev,
|
2012-10-25 22:52:42 -07:00
|
|
|
event_id);
|
2012-10-23 01:44:11 -07:00
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
else
|
2012-10-08 18:58:41 -07:00
|
|
|
outs = eina_list_append(outs, eo_obj);
|
2012-01-17 00:35:32 -08:00
|
|
|
if ((obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) &&
|
|
|
|
(e->pointer.nogrep > 0))
|
|
|
|
{
|
|
|
|
eina_list_free(copy);
|
2012-10-08 18:58:41 -07:00
|
|
|
nogrep_obj = eo_obj;
|
2012-01-17 00:35:32 -08:00
|
|
|
goto nogrep;
|
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Out ev;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-09-21 03:35:03 -07:00
|
|
|
ev.buttons = e->pointer.button;
|
|
|
|
ev.output.x = e->pointer.x;
|
|
|
|
ev.output.y = e->pointer.y;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2011-09-21 03:35:03 -07:00
|
|
|
if (copy) eina_list_free(copy);
|
|
|
|
while (outs)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
|
|
|
eo_obj = outs->data;
|
|
|
|
outs = eina_list_remove(outs, eo_obj);
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2011-09-21 03:35:03 -07:00
|
|
|
if ((obj->mouse_grabbed == 0) && (!e->delete_me))
|
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
if (!obj->mouse_in) continue;
|
|
|
|
obj->mouse_in = 0;
|
|
|
|
if (obj->delete_me || e->is_frozen) continue;
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
2012-10-25 22:52:42 -07:00
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x,
|
|
|
|
&ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x,
|
|
|
|
&ev.canvas.y,
|
|
|
|
obj->mouse_grabbed);
|
2012-10-08 18:58:41 -07:00
|
|
|
e->pointer.object.in = eina_list_remove(e->pointer.object.in, eo_obj);
|
2012-10-25 22:52:42 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_OUT,
|
|
|
|
&ev, event_id);
|
|
|
|
if ((obj->proxy.is_proxy) &&
|
|
|
|
(obj->proxy.src_events))
|
2012-10-28 07:48:43 -07:00
|
|
|
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev,
|
|
|
|
event_id);
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-21 03:35:03 -07:00
|
|
|
Eina_List *ins;
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Event_Mouse_Move ev;
|
|
|
|
Evas_Event_Mouse_Out ev2;
|
|
|
|
Evas_Event_Mouse_In ev3;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0, event_id2 = 0;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-09-21 03:35:03 -07:00
|
|
|
ev.buttons = e->pointer.button;
|
|
|
|
ev.cur.output.x = e->pointer.x;
|
|
|
|
ev.cur.output.y = e->pointer.y;
|
|
|
|
ev.cur.canvas.x = e->pointer.x;
|
|
|
|
ev.cur.canvas.y = e->pointer.y;
|
|
|
|
ev.prev.output.x = px;
|
|
|
|
ev.prev.output.y = py;
|
|
|
|
ev.prev.canvas.x = px;
|
|
|
|
ev.prev.canvas.y = py;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2011-09-21 03:35:03 -07:00
|
|
|
ev2.buttons = e->pointer.button;
|
|
|
|
ev2.output.x = e->pointer.x;
|
|
|
|
ev2.output.y = e->pointer.y;
|
|
|
|
ev2.canvas.x = e->pointer.x;
|
|
|
|
ev2.canvas.y = e->pointer.y;
|
|
|
|
ev2.data = (void *)data;
|
|
|
|
ev2.modifiers = &(e->modifiers);
|
|
|
|
ev2.locks = &(e->locks);
|
|
|
|
ev2.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev2.event_flags = e->default_event_flags;
|
2012-09-17 03:12:48 -07:00
|
|
|
ev2.dev = ev.dev;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
|
|
|
ev3.buttons = e->pointer.button;
|
|
|
|
ev3.output.x = e->pointer.x;
|
|
|
|
ev3.output.y = e->pointer.y;
|
|
|
|
ev3.canvas.x = e->pointer.x;
|
|
|
|
ev3.canvas.y = e->pointer.y;
|
|
|
|
ev3.data = (void *)data;
|
|
|
|
ev3.modifiers = &(e->modifiers);
|
|
|
|
ev3.locks = &(e->locks);
|
|
|
|
ev3.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev3.event_flags = e->default_event_flags;
|
2012-09-17 03:12:48 -07:00
|
|
|
ev3.dev = ev.dev;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
|
|
|
/* get all new in objects */
|
2012-10-08 18:58:41 -07:00
|
|
|
ins = evas_event_objects_event_list(eo_e, NULL, x, y);
|
2011-09-21 03:35:03 -07:00
|
|
|
/* go thru old list of in objects */
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2011-09-21 03:35:03 -07:00
|
|
|
/* if its under the pointer and its visible and its in the new */
|
|
|
|
/* in list */
|
|
|
|
// FIXME: i don't think we need this
|
2012-10-08 18:58:41 -07:00
|
|
|
// evas_object_clip_recalc(eo_obj);
|
|
|
|
if ((!e->is_frozen) &&
|
|
|
|
evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1) &&
|
|
|
|
(evas_object_clippers_is_visible(eo_obj, obj) ||
|
2011-11-15 07:10:19 -08:00
|
|
|
obj->mouse_grabbed) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
eina_list_data_find(ins, eo_obj) &&
|
|
|
|
(!evas_event_passes_through(eo_obj, obj)) &&
|
|
|
|
(!evas_event_freezes_through(eo_obj, obj)) &&
|
2012-10-21 23:48:21 -07:00
|
|
|
(!evas_object_is_source_invisible(eo_obj, obj)) &&
|
2011-09-21 03:35:03 -07:00
|
|
|
(!obj->clip.clipees) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
((!obj->precise_is_inside) || evas_object_is_inside(eo_obj, obj, x, y))
|
2011-11-15 07:10:19 -08:00
|
|
|
)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
|
|
|
if ((px != x) || (py != y))
|
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.cur.canvas.x = e->pointer.x;
|
|
|
|
ev.cur.canvas.y = e->pointer.y;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
|
2012-10-25 08:24:27 -07:00
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_move_events(eo_obj, eo_e, &ev,
|
2012-10-25 08:12:54 -07:00
|
|
|
event_id);
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* otherwise it has left the object */
|
|
|
|
else
|
|
|
|
{
|
2010-09-03 20:53:34 -07:00
|
|
|
if (obj->mouse_in)
|
|
|
|
{
|
|
|
|
obj->mouse_in = 0;
|
2012-10-25 22:52:42 -07:00
|
|
|
if (e->is_frozen) continue;
|
2010-09-03 20:53:34 -07:00
|
|
|
ev2.canvas.x = e->pointer.x;
|
|
|
|
ev2.canvas.y = e->pointer.y;
|
2012-10-25 22:52:42 -07:00
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev2.canvas.x,
|
|
|
|
&ev2.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev2.canvas.x,
|
|
|
|
&ev2.canvas.y,
|
|
|
|
obj->mouse_grabbed);
|
2012-10-25 21:41:59 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_OUT,
|
|
|
|
&ev2, event_id);
|
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-28 07:48:43 -07:00
|
|
|
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev2,
|
2012-10-25 21:41:59 -07:00
|
|
|
event_id);
|
2012-10-25 22:52:42 -07:00
|
|
|
if (e->delete_me) break;
|
2010-09-03 20:53:34 -07:00
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2010-03-04 06:48:21 -08:00
|
|
|
|
2011-09-21 03:35:03 -07:00
|
|
|
_evas_object_event_new();
|
2010-03-04 06:48:21 -08:00
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id2 = _evas_event_counter;
|
2011-09-21 03:35:03 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
|
|
|
/* go thru our current list of ins */
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(ins, l, eo_obj)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2011-09-21 03:35:03 -07:00
|
|
|
/* if its not in the old list of ins send an enter event */
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!eina_list_data_find(e->pointer.object.in, eo_obj))
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2010-09-03 20:53:34 -07:00
|
|
|
if (!obj->mouse_in)
|
|
|
|
{
|
|
|
|
obj->mouse_in = 1;
|
2012-10-25 22:52:42 -07:00
|
|
|
if (e->is_frozen) continue;
|
|
|
|
ev3.canvas.x = e->pointer.x;
|
|
|
|
ev3.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev3.canvas.x,
|
|
|
|
&ev3.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev3.canvas.x,
|
|
|
|
&ev3.canvas.y,
|
|
|
|
obj->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_IN,
|
|
|
|
&ev3, event_id2);
|
|
|
|
if ((obj->proxy.is_proxy) &&
|
|
|
|
(obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_in_events(eo_obj, eo_e, &ev3,
|
2012-10-25 22:52:42 -07:00
|
|
|
event_id2);
|
|
|
|
if (e->delete_me) break;
|
2010-09-03 20:53:34 -07:00
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
}
|
2011-06-28 22:05:35 -07:00
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
|
|
|
{
|
|
|
|
/* free our old list of ins */
|
|
|
|
eina_list_free(e->pointer.object.in);
|
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = ins;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* free our cur ins */
|
|
|
|
eina_list_free(ins);
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-25 21:41:59 -07:00
|
|
|
_evas_unwalk(e);
|
2012-01-17 00:35:32 -08:00
|
|
|
return;
|
|
|
|
nogrep:
|
|
|
|
{
|
|
|
|
Eina_List *ins = NULL;
|
|
|
|
Eina_List *newin = NULL;
|
|
|
|
Eina_List *l, *copy, *lst = NULL;
|
|
|
|
Evas_Event_Mouse_Move ev;
|
|
|
|
Evas_Event_Mouse_Out ev2;
|
|
|
|
Evas_Event_Mouse_In ev3;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj, *eo_below_obj;
|
2012-01-17 00:35:32 -08:00
|
|
|
int event_id = 0, event_id2 = 0;
|
|
|
|
int norep = 0, breaknext = 0;
|
|
|
|
|
|
|
|
_evas_object_event_new();
|
|
|
|
|
|
|
|
event_id = _evas_event_counter;
|
|
|
|
ev.buttons = e->pointer.button;
|
|
|
|
ev.cur.output.x = e->pointer.x;
|
|
|
|
ev.cur.output.y = e->pointer.y;
|
|
|
|
ev.cur.canvas.x = e->pointer.x;
|
|
|
|
ev.cur.canvas.y = e->pointer.y;
|
|
|
|
ev.prev.output.x = px;
|
|
|
|
ev.prev.output.y = py;
|
|
|
|
ev.prev.canvas.x = px;
|
|
|
|
ev.prev.canvas.y = py;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2012-01-17 00:35:32 -08:00
|
|
|
ev2.buttons = e->pointer.button;
|
|
|
|
ev2.output.x = e->pointer.x;
|
|
|
|
ev2.output.y = e->pointer.y;
|
|
|
|
ev2.canvas.x = e->pointer.x;
|
|
|
|
ev2.canvas.y = e->pointer.y;
|
|
|
|
ev2.data = (void *)data;
|
|
|
|
ev2.modifiers = &(e->modifiers);
|
|
|
|
ev2.locks = &(e->locks);
|
|
|
|
ev2.timestamp = timestamp;
|
|
|
|
ev2.event_flags = e->default_event_flags;
|
2012-09-17 03:12:48 -07:00
|
|
|
ev2.dev = ev.dev;
|
|
|
|
|
2012-01-17 00:35:32 -08:00
|
|
|
ev3.buttons = e->pointer.button;
|
|
|
|
ev3.output.x = e->pointer.x;
|
|
|
|
ev3.output.y = e->pointer.y;
|
|
|
|
ev3.canvas.x = e->pointer.x;
|
|
|
|
ev3.canvas.y = e->pointer.y;
|
|
|
|
ev3.data = (void *)data;
|
|
|
|
ev3.modifiers = &(e->modifiers);
|
|
|
|
ev3.locks = &(e->locks);
|
|
|
|
ev3.timestamp = timestamp;
|
|
|
|
ev3.event_flags = e->default_event_flags;
|
2012-09-17 03:12:48 -07:00
|
|
|
ev3.dev = ev.dev;
|
2012-01-17 00:35:32 -08:00
|
|
|
|
|
|
|
/* go thru old list of in objects */
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2012-01-17 00:35:32 -08:00
|
|
|
{
|
|
|
|
if (breaknext)
|
|
|
|
{
|
|
|
|
lst = l;
|
|
|
|
break;
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
if (eo_obj == nogrep_obj) breaknext = 1;
|
2012-01-17 00:35:32 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2012-01-17 00:35:32 -08:00
|
|
|
/* get all new in objects */
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_below_obj = evas_object_below_get(nogrep_obj);
|
|
|
|
if (eo_below_obj)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *below_obj = eo_data_get(eo_below_obj, EVAS_OBJ_CLASS);
|
|
|
|
ins = _evas_event_object_list_raw_in_get(eo_e, NULL,
|
2012-01-17 00:35:32 -08:00
|
|
|
EINA_INLIST_GET(below_obj), NULL,
|
|
|
|
e->pointer.x, e->pointer.y,
|
2012-10-23 01:44:11 -07:00
|
|
|
&norep, EINA_FALSE);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2012-01-17 00:35:32 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
newin = eina_list_append(newin, eo_obj);
|
|
|
|
if (eo_obj == nogrep_obj) break;
|
2012-01-17 00:35:32 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(ins, l, eo_obj)
|
2012-01-17 00:35:32 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
newin = eina_list_append(newin, eo_obj);
|
2012-01-17 00:35:32 -08:00
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(lst, l, eo_obj)
|
2012-01-17 00:35:32 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-01-17 00:35:32 -08:00
|
|
|
/* if its under the pointer and its visible and its in the new */
|
|
|
|
/* in list */
|
|
|
|
// FIXME: i don't think we need this
|
2012-10-08 18:58:41 -07:00
|
|
|
// evas_object_clip_recalc(eo_obj);
|
|
|
|
if ((!e->is_frozen) &&
|
|
|
|
evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1) &&
|
|
|
|
(evas_object_clippers_is_visible(eo_obj, obj) ||
|
2012-01-17 00:35:32 -08:00
|
|
|
obj->mouse_grabbed) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
eina_list_data_find(newin, eo_obj) &&
|
|
|
|
(!evas_event_passes_through(eo_obj, obj)) &&
|
|
|
|
(!evas_event_freezes_through(eo_obj, obj)) &&
|
2012-10-21 23:48:21 -07:00
|
|
|
(!evas_object_is_source_invisible(eo_obj, obj)) &&
|
2012-01-17 00:35:32 -08:00
|
|
|
(!obj->clip.clipees) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
((!obj->precise_is_inside) || evas_object_is_inside(eo_obj, obj, x, y))
|
2012-01-17 00:35:32 -08:00
|
|
|
)
|
|
|
|
{
|
|
|
|
if ((px != x) || (py != y))
|
|
|
|
{
|
|
|
|
ev.cur.canvas.x = e->pointer.x;
|
|
|
|
ev.cur.canvas.y = e->pointer.y;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.cur.canvas.x, &ev.cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
|
2012-10-25 08:24:27 -07:00
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_move_events(eo_obj, eo_e, &ev,
|
2012-10-25 08:12:54 -07:00
|
|
|
event_id);
|
2012-01-17 00:35:32 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* otherwise it has left the object */
|
|
|
|
else
|
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
if (!obj->mouse_in) continue;
|
|
|
|
obj->mouse_in = 0;
|
|
|
|
if (e->is_frozen) continue;
|
|
|
|
ev2.canvas.x = e->pointer.x;
|
|
|
|
ev2.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev2.canvas.x,
|
|
|
|
&ev2.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev2.canvas.x,
|
|
|
|
&ev2.canvas.y, obj->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_OUT, &ev2,
|
|
|
|
event_id);
|
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-28 07:48:43 -07:00
|
|
|
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev2,
|
|
|
|
event_id);
|
2012-01-17 00:35:32 -08:00
|
|
|
}
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-01-17 00:35:32 -08:00
|
|
|
|
|
|
|
_evas_object_event_new();
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2012-01-17 00:35:32 -08:00
|
|
|
event_id2 = _evas_event_counter;
|
|
|
|
if (copy) copy = eina_list_free(copy);
|
|
|
|
/* go thru our current list of ins */
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(newin, l, eo_obj)
|
2012-01-17 00:35:32 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-01-17 00:35:32 -08:00
|
|
|
/* if its not in the old list of ins send an enter event */
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!eina_list_data_find(e->pointer.object.in, eo_obj))
|
2012-01-17 00:35:32 -08:00
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
if (obj->mouse_in) continue;
|
|
|
|
obj->mouse_in = 1;
|
|
|
|
if (e->is_frozen) continue;
|
|
|
|
ev3.canvas.x = e->pointer.x;
|
|
|
|
ev3.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev3.canvas.x,
|
|
|
|
&ev3.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev3.canvas.x,
|
|
|
|
&ev3.canvas.y, obj->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_IN, &ev3,
|
|
|
|
event_id2);
|
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_in_events(eo_obj, eo_e, &ev3,
|
|
|
|
event_id2);
|
2012-10-25 22:52:42 -07:00
|
|
|
if (e->delete_me) break;
|
2012-01-17 00:35:32 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* free our old list of ins */
|
|
|
|
eina_list_free(e->pointer.object.in);
|
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = newin;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2012-01-17 00:35:32 -08:00
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_in(Evas *eo_e, unsigned int timestamp, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
eo_do(eo_e, evas_canvas_event_feed_mouse_in(timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_mouse_in(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *ins;
|
|
|
|
Eina_List *l;
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_In ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->pointer.inside = 1;
|
2004-09-17 06:46:55 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2004-09-21 02:33:18 -07:00
|
|
|
|
|
|
|
if (e->pointer.mouse_grabbed != 0) return;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2008-01-23 01:00:59 -08:00
|
|
|
ev.buttons = e->pointer.button;
|
|
|
|
ev.output.x = e->pointer.x;
|
|
|
|
ev.output.y = e->pointer.y;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2004-09-17 06:46:55 -07:00
|
|
|
/* get new list of ins */
|
2012-10-08 18:58:41 -07:00
|
|
|
ins = evas_event_objects_event_list(eo_e, NULL, e->pointer.x, e->pointer.y);
|
|
|
|
EINA_LIST_FOREACH(ins, l, eo_obj)
|
2004-09-17 06:46:55 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
if (!eina_list_data_find(e->pointer.object.in, eo_obj))
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-25 22:52:42 -07:00
|
|
|
if (obj->mouse_in) continue;
|
|
|
|
obj->mouse_in = 1;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x, &ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y,
|
|
|
|
obj->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_IN, &ev,
|
|
|
|
event_id);
|
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_mouse_in_events(eo_obj, eo_e, &ev, event_id);
|
2012-10-25 22:52:42 -07:00
|
|
|
if (e->delete_me || e->is_frozen) break;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2004-09-17 06:46:55 -07:00
|
|
|
}
|
|
|
|
/* free our old list of ins */
|
2008-10-21 09:31:05 -07:00
|
|
|
e->pointer.object.in = eina_list_free(e->pointer.object.in);
|
2004-09-17 06:46:55 -07:00
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = ins;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
|
|
|
evas_event_feed_mouse_move(eo_e, e->pointer.x, e->pointer.y, timestamp, data);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_out(Evas *eo_e, unsigned int timestamp, const void *data)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
eo_do(eo_e, evas_canvas_event_feed_mouse_out(timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_mouse_out(Eo *eo_e, void *_pd, va_list *list)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Out ev;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->pointer.inside = 0;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2008-01-23 01:00:59 -08:00
|
|
|
ev.buttons = e->pointer.button;
|
|
|
|
ev.output.x = e->pointer.x;
|
|
|
|
ev.output.y = e->pointer.y;
|
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
2012-10-28 07:51:42 -07:00
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2011-12-30 07:20:15 -08:00
|
|
|
/* if our mouse button is inside any objects */
|
2012-10-28 07:51:42 -07:00
|
|
|
/* go thru old list of in objects */
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Object *eo_obj;
|
2004-09-17 06:46:55 -07:00
|
|
|
|
2012-10-28 07:51:42 -07:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
|
|
|
if (!obj->mouse_in) continue;
|
|
|
|
obj->mouse_in = 0;
|
|
|
|
if (!obj->delete_me)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-28 07:51:42 -07:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x, &ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y,
|
|
|
|
obj->mouse_grabbed);
|
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MOUSE_OUT, &ev,
|
|
|
|
event_id);
|
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
|
|
|
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev, event_id);
|
|
|
|
if (e->delete_me || e->is_frozen) break;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2012-10-28 07:51:42 -07:00
|
|
|
obj->mouse_grabbed = 0;
|
2004-09-17 06:46:55 -07:00
|
|
|
}
|
2012-10-28 07:51:42 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
|
|
|
/* free our old list of ins */
|
|
|
|
e->pointer.object.in = eina_list_free(e->pointer.object.in);
|
|
|
|
e->pointer.mouse_grabbed = 0;
|
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2010-01-16 04:20:22 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_multi_down(Evas *eo_e,
|
2011-09-21 03:35:03 -07:00
|
|
|
int d, int x, int y,
|
2010-01-17 00:52:21 -08:00
|
|
|
double rad, double radx, double rady,
|
|
|
|
double pres, double ang,
|
|
|
|
double fx, double fy,
|
2011-09-21 03:35:03 -07:00
|
|
|
Evas_Button_Flags flags, unsigned int timestamp,
|
2010-01-17 00:52:21 -08:00
|
|
|
const void *data)
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
eo_do(eo_e, evas_canvas_event_feed_multi_down(d, x, y, rad, radx, rady, pres, ang, fx, fy, flags, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_multi_down(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
int d = va_arg(*list, int);
|
|
|
|
int x = va_arg(*list, int);
|
|
|
|
int y = va_arg(*list, int);
|
|
|
|
double rad = va_arg(*list, double);
|
|
|
|
double radx = va_arg(*list, double);
|
|
|
|
double rady = va_arg(*list, double);
|
|
|
|
double pres = va_arg(*list, double);
|
|
|
|
double ang = va_arg(*list, double);
|
|
|
|
double fx = va_arg(*list, double);
|
|
|
|
double fy = va_arg(*list, double);
|
|
|
|
Evas_Button_Flags flags = va_arg(*list, Evas_Button_Flags);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
2010-01-16 04:20:22 -08:00
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Event_Multi_Down ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-12 21:59:36 -08:00
|
|
|
int addgrab = 0;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2010-01-16 04:20:22 -08:00
|
|
|
|
2011-12-12 21:59:36 -08:00
|
|
|
e->pointer.downs++;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2010-01-16 04:20:22 -08:00
|
|
|
e->last_timestamp = timestamp;
|
|
|
|
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2010-01-16 04:20:22 -08:00
|
|
|
ev.device = d;
|
|
|
|
ev.output.x = x;
|
|
|
|
ev.output.y = y;
|
|
|
|
ev.canvas.x = x;
|
|
|
|
ev.canvas.y = y;
|
|
|
|
ev.radius = rad;
|
|
|
|
ev.radius_x = radx;
|
|
|
|
ev.radius_y = rady;
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.pressure = pres;
|
|
|
|
ev.angle = ang;
|
|
|
|
ev.canvas.xsub = fx;
|
|
|
|
ev.canvas.ysub = fy;
|
2010-01-16 04:20:22 -08:00
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.flags = flags;
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_walk(e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* append new touch point to the touch point list */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_append(eo_e, d, x, y);
|
2011-12-12 21:59:36 -08:00
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
|
|
|
{
|
|
|
|
if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1;
|
|
|
|
}
|
2010-01-16 04:20:22 -08:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2011-09-25 19:45:06 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2011-09-25 19:45:06 -07:00
|
|
|
if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
|
|
|
|
{
|
2011-12-12 21:59:36 -08:00
|
|
|
obj->mouse_grabbed += addgrab + 1;
|
|
|
|
e->pointer.mouse_grabbed += addgrab + 1;
|
2011-09-25 19:45:06 -07:00
|
|
|
}
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2011-09-23 21:01:36 -07:00
|
|
|
ev.canvas.x = x;
|
|
|
|
ev.canvas.y = y;
|
|
|
|
ev.canvas.xsub = fx;
|
|
|
|
ev.canvas.ysub = fy;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x, &ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
|
2011-09-23 21:01:36 -07:00
|
|
|
if (x != ev.canvas.x)
|
|
|
|
ev.canvas.xsub = ev.canvas.x; // fixme - lost precision
|
|
|
|
if (y != ev.canvas.y)
|
|
|
|
ev.canvas.ysub = ev.canvas.y; // fixme - lost precision
|
2012-10-25 21:41:59 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj,
|
|
|
|
EVAS_CALLBACK_MULTI_DOWN, &ev,
|
|
|
|
event_id);
|
|
|
|
if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_multi_down_events(eo_obj, eo_e, &ev, event_id);
|
2012-10-25 21:41:59 -07:00
|
|
|
if (e->delete_me || e->is_frozen) break;
|
2010-01-16 04:20:22 -08:00
|
|
|
}
|
|
|
|
if (copy) eina_list_free(copy);
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* update touch point's state to EVAS_TOUCH_POINT_STILL */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_update(eo_e, d, x, y, EVAS_TOUCH_POINT_STILL);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_multi_up(Evas *eo_e,
|
2011-09-21 03:35:03 -07:00
|
|
|
int d, int x, int y,
|
2010-01-17 00:52:21 -08:00
|
|
|
double rad, double radx, double rady,
|
|
|
|
double pres, double ang,
|
|
|
|
double fx, double fy,
|
2011-09-21 03:35:03 -07:00
|
|
|
Evas_Button_Flags flags, unsigned int timestamp,
|
2010-01-17 00:52:21 -08:00
|
|
|
const void *data)
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
eo_do(eo_e, evas_canvas_event_feed_multi_up(d, x, y, rad, radx, rady, pres, ang, fx, fy, flags, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_multi_up(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
int d = va_arg(*list, int);
|
|
|
|
int x = va_arg(*list, int);
|
|
|
|
int y = va_arg(*list, int);
|
|
|
|
double rad = va_arg(*list, double);
|
|
|
|
double radx = va_arg(*list, double);
|
|
|
|
double rady = va_arg(*list, double);
|
|
|
|
double pres = va_arg(*list, double);
|
|
|
|
double ang = va_arg(*list, double);
|
|
|
|
double fx = va_arg(*list, double);
|
|
|
|
double fy = va_arg(*list, double);
|
|
|
|
Evas_Button_Flags flags = va_arg(*list, Evas_Button_Flags);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
2010-01-16 04:20:22 -08:00
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Event_Multi_Up ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2010-01-16 04:20:22 -08:00
|
|
|
|
2012-07-31 22:43:50 -07:00
|
|
|
if (e->pointer.downs <= 0) return;
|
2011-12-12 21:59:36 -08:00
|
|
|
e->pointer.downs--;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2010-01-16 04:20:22 -08:00
|
|
|
e->last_timestamp = timestamp;
|
|
|
|
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2010-01-16 04:20:22 -08:00
|
|
|
ev.device = d;
|
|
|
|
ev.output.x = x;
|
|
|
|
ev.output.y = y;
|
|
|
|
ev.canvas.x = x;
|
|
|
|
ev.canvas.y = y;
|
|
|
|
ev.radius = rad;
|
|
|
|
ev.radius_x = radx;
|
|
|
|
ev.radius_y = rady;
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.pressure = pres;
|
|
|
|
ev.angle = ang;
|
|
|
|
ev.canvas.xsub = fx;
|
|
|
|
ev.canvas.ysub = fy;
|
2010-01-16 04:20:22 -08:00
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.flags = flags;
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_walk(e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* update released touch point */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_update(eo_e, d, x, y, EVAS_TOUCH_POINT_UP);
|
2010-01-16 04:20:22 -08:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2011-09-23 21:01:36 -07:00
|
|
|
ev.canvas.x = x;
|
|
|
|
ev.canvas.y = y;
|
|
|
|
ev.canvas.xsub = fx;
|
|
|
|
ev.canvas.ysub = fy;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.canvas.x, &ev.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
|
2011-09-23 21:01:36 -07:00
|
|
|
if (x != ev.canvas.x)
|
|
|
|
ev.canvas.xsub = ev.canvas.x; // fixme - lost precision
|
|
|
|
if (y != ev.canvas.y)
|
|
|
|
ev.canvas.ysub = ev.canvas.y; // fixme - lost precision
|
|
|
|
if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
|
|
|
|
(obj->mouse_grabbed > 0))
|
2011-06-13 03:00:25 -07:00
|
|
|
{
|
2011-09-23 21:01:36 -07:00
|
|
|
obj->mouse_grabbed--;
|
|
|
|
e->pointer.mouse_grabbed--;
|
2011-06-13 03:00:25 -07:00
|
|
|
}
|
2012-10-25 21:41:59 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_UP,
|
|
|
|
&ev, event_id);
|
|
|
|
if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_multi_up_events(eo_obj, eo_e, &ev, event_id);
|
2012-10-25 21:41:59 -07:00
|
|
|
if (e->delete_me || e->is_frozen) break;
|
2010-01-16 04:20:22 -08:00
|
|
|
}
|
|
|
|
if (copy) copy = eina_list_free(copy);
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((e->pointer.mouse_grabbed == 0) && !_post_up_handle(eo_e, timestamp, data))
|
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* remove released touch point from the touch point list */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_remove(eo_e, d);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_multi_move(Evas *eo_e,
|
2011-09-21 03:35:03 -07:00
|
|
|
int d, int x, int y,
|
2010-01-17 00:52:21 -08:00
|
|
|
double rad, double radx, double rady,
|
|
|
|
double pres, double ang,
|
|
|
|
double fx, double fy,
|
|
|
|
unsigned int timestamp, const void *data)
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2010-01-16 04:20:22 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, evas_canvas_event_feed_multi_move(d, x, y, rad, radx, rady, pres, ang, fx, fy, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_multi_move(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
int d = va_arg(*list, int);
|
|
|
|
int x = va_arg(*list, int);
|
|
|
|
int y = va_arg(*list, int);
|
|
|
|
double rad = va_arg(*list, double);
|
|
|
|
double radx = va_arg(*list, double);
|
|
|
|
double rady = va_arg(*list, double);
|
|
|
|
double pres = va_arg(*list, double);
|
|
|
|
double ang = va_arg(*list, double);
|
|
|
|
double fx = va_arg(*list, double);
|
|
|
|
double fy = va_arg(*list, double);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
|
|
|
|
|
|
|
if (e->is_frozen) return;
|
2010-01-16 04:20:22 -08:00
|
|
|
e->last_timestamp = timestamp;
|
|
|
|
|
2011-12-27 04:01:17 -08:00
|
|
|
if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_walk(e);
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] [Evas] Patch to provide information of
touched points
Hello,
I made a new patch to get information of current touched point instead
of Touch Event.
I added touch_points (Eina_List) to the Evas structure and it maintains touched points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.
The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event. coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum.
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE,
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)
There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned int n);
I added APIs to get each information instead of exposing whole
structure to make it easy to expand in the future as you mentioned in
the below e-mail :)
SVN revision: 64373
2011-10-24 22:03:50 -07:00
|
|
|
/* update moved touch point */
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_touch_point_update(eo_e, d, x, y, EVAS_TOUCH_POINT_MOVE);
|
2010-01-16 04:20:22 -08:00
|
|
|
/* if our mouse button is grabbed to any objects */
|
|
|
|
if (e->pointer.mouse_grabbed > 0)
|
|
|
|
{
|
2011-09-21 03:35:03 -07:00
|
|
|
/* go thru old list of in objects */
|
|
|
|
Eina_List *l, *copy;
|
2010-01-16 04:20:22 -08:00
|
|
|
Evas_Event_Multi_Move ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2010-01-16 04:20:22 -08:00
|
|
|
|
2011-09-21 03:35:03 -07:00
|
|
|
_evas_object_event_new();
|
2010-03-04 06:48:21 -08:00
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2010-01-16 04:20:22 -08:00
|
|
|
ev.device = d;
|
|
|
|
ev.cur.output.x = x;
|
|
|
|
ev.cur.output.y = y;
|
|
|
|
ev.cur.canvas.x = x;
|
|
|
|
ev.cur.canvas.y = y;
|
|
|
|
ev.radius = rad;
|
|
|
|
ev.radius_x = radx;
|
|
|
|
ev.radius_y = rady;
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.pressure = pres;
|
|
|
|
ev.angle = ang;
|
|
|
|
ev.cur.canvas.xsub = fx;
|
|
|
|
ev.cur.canvas.ysub = fy;
|
2010-01-16 04:20:22 -08:00
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
2012-10-26 05:23:35 -07:00
|
|
|
|
2010-01-16 04:20:22 -08:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-10-25 21:41:59 -07:00
|
|
|
if ((evas_object_clippers_is_visible(eo_obj, obj) ||
|
2012-10-21 21:57:32 -07:00
|
|
|
obj->mouse_grabbed) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
(!evas_event_passes_through(eo_obj, obj)) &&
|
|
|
|
(!evas_event_freezes_through(eo_obj, obj)) &&
|
2012-10-21 23:48:21 -07:00
|
|
|
(!evas_object_is_source_invisible(eo_obj, obj)) &&
|
2011-09-23 21:01:36 -07:00
|
|
|
(!obj->clip.clipees))
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.cur.canvas.x = x;
|
|
|
|
ev.cur.canvas.y = y;
|
|
|
|
ev.cur.canvas.xsub = fx;
|
|
|
|
ev.cur.canvas.ysub = fy;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.cur.canvas.x, &ev.cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
|
2011-09-21 03:35:03 -07:00
|
|
|
if (x != ev.cur.canvas.x)
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
|
|
|
|
if (y != ev.cur.canvas.y)
|
|
|
|
ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
|
2012-10-23 01:44:11 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id);
|
2012-10-25 08:24:27 -07:00
|
|
|
if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_multi_move_events(eo_obj, eo_e, &ev,
|
|
|
|
event_id);
|
|
|
|
|
|
|
|
if (e->delete_me || e->is_frozen) break;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
}
|
2012-10-26 05:23:35 -07:00
|
|
|
eina_list_free(copy);
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2010-01-16 04:20:22 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-21 03:35:03 -07:00
|
|
|
Eina_List *ins;
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Event_Multi_Move ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-09-21 03:35:03 -07:00
|
|
|
ev.device = d;
|
|
|
|
ev.cur.output.x = x;
|
|
|
|
ev.cur.output.y = y;
|
|
|
|
ev.cur.canvas.x = x;
|
|
|
|
ev.cur.canvas.y = y;
|
2010-01-16 04:20:22 -08:00
|
|
|
ev.radius = rad;
|
|
|
|
ev.radius_x = radx;
|
|
|
|
ev.radius_y = rady;
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.pressure = pres;
|
|
|
|
ev.angle = ang;
|
|
|
|
ev.cur.canvas.xsub = fx;
|
|
|
|
ev.cur.canvas.ysub = fy;
|
2011-09-21 03:35:03 -07:00
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2011-09-21 03:35:03 -07:00
|
|
|
/* get all new in objects */
|
2012-10-08 18:58:41 -07:00
|
|
|
ins = evas_event_objects_event_list(eo_e, NULL, x, y);
|
2011-09-21 03:35:03 -07:00
|
|
|
/* go thru old list of in objects */
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2011-09-21 03:35:03 -07:00
|
|
|
/* if its under the pointer and its visible and its in the new */
|
|
|
|
/* in list */
|
|
|
|
// FIXME: i don't think we need this
|
2012-10-08 18:58:41 -07:00
|
|
|
// evas_object_clip_recalc(eo_obj);
|
2012-10-25 21:41:59 -07:00
|
|
|
if (evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_object_clippers_is_visible(eo_obj, obj) ||
|
2011-11-15 07:10:19 -08:00
|
|
|
obj->mouse_grabbed) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
eina_list_data_find(ins, eo_obj) &&
|
|
|
|
(!evas_event_passes_through(eo_obj, obj)) &&
|
|
|
|
(!evas_event_freezes_through(eo_obj, obj)) &&
|
2012-10-21 23:48:21 -07:00
|
|
|
(!evas_object_is_source_invisible(eo_obj, obj)) &&
|
2011-09-21 03:35:03 -07:00
|
|
|
(!obj->clip.clipees) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
((!obj->precise_is_inside) || evas_object_is_inside(eo_obj, obj, x, y))
|
2011-11-15 07:10:19 -08:00
|
|
|
)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2010-01-16 04:20:22 -08:00
|
|
|
ev.cur.canvas.x = x;
|
|
|
|
ev.cur.canvas.y = y;
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.cur.canvas.xsub = fx;
|
|
|
|
ev.cur.canvas.ysub = fy;
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_event_framespace_adjust(eo_obj, &ev.cur.canvas.x, &ev.cur.canvas.y);
|
|
|
|
_evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
|
2011-09-21 03:35:03 -07:00
|
|
|
if (x != ev.cur.canvas.x)
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
|
|
|
|
if (y != ev.cur.canvas.y)
|
|
|
|
ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id);
|
2012-10-25 08:24:27 -07:00
|
|
|
if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_multi_move_events(eo_obj, eo_e, &ev,
|
|
|
|
event_id);
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2012-10-25 21:41:59 -07:00
|
|
|
if (e->delete_me || e->is_frozen) break;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
if (copy) copy = eina_list_free(copy);
|
2011-06-28 22:05:35 -07:00
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
|
|
|
{
|
|
|
|
/* free our old list of ins */
|
|
|
|
eina_list_free(e->pointer.object.in);
|
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = ins;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* free our cur ins */
|
|
|
|
eina_list_free(ins);
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2010-01-16 04:20:22 -08:00
|
|
|
}
|
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_key_down(Evas *eo_e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data)
|
2002-12-16 16:00:38 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2002-12-16 16:00:38 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, evas_canvas_event_feed_key_down(keyname, key, string, compose, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_key_down(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
const char *keyname = va_arg(*list, const char *);
|
|
|
|
const char *key = va_arg(*list, const char *);
|
|
|
|
const char *string = va_arg(*list, const char *);
|
|
|
|
const char *compose = va_arg(*list, const char *);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
int event_id = 0;
|
|
|
|
Evas_Public_Data *e = _pd;
|
2011-11-11 23:51:58 -08:00
|
|
|
|
2002-12-16 16:00:38 -08:00
|
|
|
if (!keyname) return;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-11-11 23:01:38 -08:00
|
|
|
Evas_Event_Key_Down ev;
|
|
|
|
Eina_Bool exclusive;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-11-11 23:01:38 -08:00
|
|
|
_evas_object_event_new();
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-11-11 23:01:38 -08:00
|
|
|
exclusive = EINA_FALSE;
|
|
|
|
ev.keyname = (char *)keyname;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.key = key;
|
|
|
|
ev.string = string;
|
|
|
|
ev.compose = compose;
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2011-11-11 23:01:38 -08:00
|
|
|
if (e->grabs)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Key_Grab *g;
|
|
|
|
|
|
|
|
e->walking_grabs++;
|
|
|
|
EINA_LIST_FOREACH(e->grabs, l, g)
|
|
|
|
{
|
|
|
|
if (g->just_added)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2011-11-12 00:06:30 -08:00
|
|
|
g->just_added = EINA_FALSE;
|
2011-11-11 23:01:38 -08:00
|
|
|
continue;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
if (g->delete_me) continue;
|
|
|
|
if (((e->modifiers.mask & g->modifiers) ||
|
|
|
|
(g->modifiers == e->modifiers.mask)) &&
|
|
|
|
(!strcmp(keyname, g->keyname)))
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2011-11-11 23:01:38 -08:00
|
|
|
if (!(e->modifiers.mask & g->not_modifiers))
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *object_obj = eo_data_get(g->object, EVAS_OBJ_CLASS);
|
|
|
|
if (!e->is_frozen &&
|
|
|
|
!evas_event_freezes_through(g->object, object_obj))
|
2012-10-23 21:36:02 -07:00
|
|
|
{
|
|
|
|
evas_object_event_callback_call(g->object,
|
|
|
|
object_obj,
|
|
|
|
EVAS_CALLBACK_KEY_DOWN, &ev, event_id);
|
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
if (g->exclusive) exclusive = EINA_TRUE;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
if (e->delete_me) break;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
e->walking_grabs--;
|
|
|
|
if (e->walking_grabs <= 0)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2011-11-11 23:01:38 -08:00
|
|
|
while (e->delete_grabs > 0)
|
|
|
|
{
|
|
|
|
e->delete_grabs--;
|
|
|
|
for (l = e->grabs; l;)
|
|
|
|
{
|
|
|
|
g = eina_list_data_get(l);
|
|
|
|
l = eina_list_next(l);
|
|
|
|
if (g->delete_me)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *g_object_obj = eo_data_get(g->object, EVAS_OBJ_CLASS);
|
|
|
|
evas_key_grab_free(g->object, g_object_obj, g->keyname,
|
|
|
|
g->modifiers, g->not_modifiers);
|
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
}
|
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2003-01-05 04:55:37 -08:00
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
if ((e->focused) && (!exclusive))
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *focused_obj = eo_data_get(e->focused, EVAS_OBJ_CLASS);
|
|
|
|
if (!e->is_frozen && !evas_event_freezes_through(e->focused, focused_obj))
|
2012-10-23 01:44:11 -07:00
|
|
|
evas_object_event_callback_call(e->focused, focused_obj,
|
|
|
|
EVAS_CALLBACK_KEY_DOWN,
|
|
|
|
&ev, event_id);
|
2011-11-11 23:01:38 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-12-16 16:00:38 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_key_up(Evas *eo_e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data)
|
2002-12-16 16:00:38 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2002-12-16 16:00:38 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, evas_canvas_event_feed_key_up(keyname, key, string, compose, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_key_up(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
const char *keyname = va_arg(*list, const char *);
|
|
|
|
const char *key = va_arg(*list, const char *);
|
|
|
|
const char *string = va_arg(*list, const char *);
|
|
|
|
const char *compose = va_arg(*list, const char *);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
int event_id = 0;
|
|
|
|
Evas_Public_Data *e = _pd;
|
2002-12-16 16:00:38 -08:00
|
|
|
if (!keyname) return;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-11-11 23:01:38 -08:00
|
|
|
Evas_Event_Key_Up ev;
|
|
|
|
Eina_Bool exclusive;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-11-11 23:01:38 -08:00
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2011-11-11 23:01:38 -08:00
|
|
|
exclusive = EINA_FALSE;
|
|
|
|
ev.keyname = (char *)keyname;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
|
|
|
ev.key = key;
|
|
|
|
ev.string = string;
|
|
|
|
ev.compose = compose;
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2011-11-11 23:01:38 -08:00
|
|
|
if (e->grabs)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Key_Grab *g;
|
2011-09-21 03:35:03 -07:00
|
|
|
|
2011-11-11 23:01:38 -08:00
|
|
|
e->walking_grabs++;
|
|
|
|
EINA_LIST_FOREACH(e->grabs, l, g)
|
|
|
|
{
|
|
|
|
if (g->just_added)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2011-11-12 00:06:30 -08:00
|
|
|
g->just_added = EINA_FALSE;
|
2011-11-11 23:01:38 -08:00
|
|
|
continue;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
if (g->delete_me) continue;
|
|
|
|
if (((e->modifiers.mask & g->modifiers) ||
|
|
|
|
(g->modifiers == e->modifiers.mask)) &&
|
|
|
|
(!((e->modifiers.mask & g->not_modifiers) ||
|
|
|
|
(g->not_modifiers == ~e->modifiers.mask))) &&
|
|
|
|
(!strcmp(keyname, g->keyname)))
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *object_obj = eo_data_get(g->object, EVAS_OBJ_CLASS);
|
|
|
|
if (!e->is_frozen &&
|
|
|
|
!evas_event_freezes_through(g->object, object_obj))
|
2012-10-23 01:44:11 -07:00
|
|
|
{
|
|
|
|
evas_object_event_callback_call(g->object, object_obj,
|
|
|
|
EVAS_CALLBACK_KEY_UP,
|
|
|
|
&ev, event_id);
|
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
if (g->exclusive) exclusive = EINA_TRUE;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
if (e->delete_me) break;
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
e->walking_grabs--;
|
|
|
|
if (e->walking_grabs <= 0)
|
2011-09-21 03:35:03 -07:00
|
|
|
{
|
2011-11-11 23:01:38 -08:00
|
|
|
while (e->delete_grabs > 0)
|
|
|
|
{
|
|
|
|
Eina_List *ll, *l_next;
|
|
|
|
Evas_Key_Grab *gr;
|
|
|
|
|
|
|
|
e->delete_grabs--;
|
|
|
|
EINA_LIST_FOREACH_SAFE(e->grabs, ll, l_next, gr)
|
|
|
|
{
|
|
|
|
if (gr->delete_me)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *gr_object_obj =
|
|
|
|
eo_data_get(gr->object, EVAS_OBJ_CLASS);
|
|
|
|
evas_key_grab_free(gr->object, gr_object_obj, gr->keyname,
|
2011-11-11 23:01:38 -08:00
|
|
|
gr->modifiers, gr->not_modifiers);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
}
|
|
|
|
}
|
2011-09-21 03:35:03 -07:00
|
|
|
}
|
2003-01-05 04:55:37 -08:00
|
|
|
}
|
2011-11-11 23:01:38 -08:00
|
|
|
if ((e->focused) && (!exclusive))
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *focused_obj = eo_data_get(e->focused, EVAS_OBJ_CLASS);
|
|
|
|
if (!e->is_frozen && !evas_event_freezes_through(e->focused, focused_obj))
|
2012-10-23 01:44:11 -07:00
|
|
|
evas_object_event_callback_call(e->focused, focused_obj,
|
|
|
|
EVAS_CALLBACK_KEY_UP,
|
|
|
|
&ev, event_id);
|
2011-11-11 23:01:38 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-12-16 16:00:38 -08:00
|
|
|
}
|
|
|
|
|
2008-03-31 14:38:38 -07:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_hold(Evas *eo_e, int hold, unsigned int timestamp, const void *data)
|
2008-03-31 14:38:38 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_e, evas_canvas_event_feed_hold(hold, timestamp, data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_feed_hold(Eo *eo_e, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
int hold = va_arg(*list, int);
|
|
|
|
unsigned int timestamp = va_arg(*list, unsigned int);
|
|
|
|
const void *data = va_arg(*list, const void *);
|
|
|
|
|
|
|
|
Evas_Public_Data *e = _pd;
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l, *copy;
|
2008-03-31 14:38:38 -07:00
|
|
|
Evas_Event_Hold ev;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2008-03-31 14:38:38 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (e->is_frozen) return;
|
2008-03-31 14:38:38 -07:00
|
|
|
e->last_timestamp = timestamp;
|
|
|
|
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
event_id = _evas_event_counter;
|
2008-03-31 14:38:38 -07:00
|
|
|
ev.hold = hold;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.timestamp = timestamp;
|
2011-12-16 01:24:18 -08:00
|
|
|
ev.event_flags = e->default_event_flags;
|
2012-10-08 18:58:41 -07:00
|
|
|
ev.dev = _evas_device_top_get(eo_e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_ref(ev.dev);
|
|
|
|
|
2008-03-31 14:38:38 -07:00
|
|
|
_evas_walk(e);
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, eo_obj)
|
2008-03-31 14:38:38 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
2012-10-25 21:41:59 -07:00
|
|
|
if ( !evas_event_freezes_through(eo_obj, obj))
|
2012-10-23 01:44:11 -07:00
|
|
|
{
|
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD,
|
|
|
|
&ev, event_id);
|
2012-10-25 08:24:27 -07:00
|
|
|
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
2012-10-26 05:44:52 -07:00
|
|
|
_evas_event_source_hold_events(eo_obj, eo_e, &ev, event_id);
|
2012-10-23 01:44:11 -07:00
|
|
|
}
|
2012-10-25 21:41:59 -07:00
|
|
|
if (e->delete_me || e->is_frozen) break;
|
2008-03-31 14:38:38 -07:00
|
|
|
}
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(eo_e, e);
|
2012-09-17 03:12:48 -07:00
|
|
|
if (ev.dev) _evas_device_unref(ev.dev);
|
2008-03-31 14:38:38 -07:00
|
|
|
_evas_unwalk(e);
|
2010-03-22 00:04:04 -07:00
|
|
|
_evas_object_event_new();
|
2008-03-31 14:38:38 -07:00
|
|
|
}
|
|
|
|
|
2011-10-27 03:36:09 -07:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_freeze_events_set(Evas_Object *eo_obj, Eina_Bool freeze)
|
2011-10-27 03:36:09 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2011-10-27 03:36:09 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_freeze_events_set(freeze));
|
|
|
|
}
|
2011-10-27 03:36:09 -07:00
|
|
|
|
2012-10-18 05:13:04 -07:00
|
|
|
static void
|
|
|
|
_feed_mouse_move_eval_internal(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
Evas_Public_Data *evas = obj->layer->evas;
|
|
|
|
Eina_Bool in_output_rect;
|
|
|
|
in_output_rect = evas_object_is_in_output_rect(eo_obj, obj, evas->pointer.x,
|
|
|
|
evas->pointer.y, 1, 1);
|
|
|
|
if ((in_output_rect) &&
|
|
|
|
((!obj->precise_is_inside) || (evas_object_is_inside(eo_obj, obj,
|
|
|
|
evas->pointer.x,
|
|
|
|
evas->pointer.y))))
|
|
|
|
evas_event_feed_mouse_move(evas->evas,
|
|
|
|
evas->pointer.x,
|
|
|
|
evas->pointer.y,
|
|
|
|
evas->last_timestamp,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
void
|
|
|
|
_freeze_events_set(Eo *eo_obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool freeze = va_arg(*list, int);
|
|
|
|
Evas_Object_Protected_Data *obj = _pd;
|
2011-10-27 03:36:09 -07:00
|
|
|
freeze = !!freeze;
|
|
|
|
if (obj->freeze_events == freeze) return;
|
|
|
|
obj->freeze_events = freeze;
|
2012-10-18 04:30:04 -07:00
|
|
|
evas_object_smart_member_cache_invalidate(eo_obj, EINA_FALSE, EINA_TRUE,
|
|
|
|
EINA_FALSE);
|
2012-10-18 04:42:03 -07:00
|
|
|
if (obj->freeze_events) return;
|
2012-10-18 05:13:04 -07:00
|
|
|
_feed_mouse_move_eval_internal(eo_obj, obj);
|
2011-10-27 03:36:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_freeze_events_get(const Evas_Object *eo_obj)
|
2011-10-27 03:36:09 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2011-11-11 22:12:42 -08:00
|
|
|
return EINA_FALSE;
|
2011-10-27 03:36:09 -07:00
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
Eina_Bool freeze_events = EINA_FALSE;
|
|
|
|
eo_do((Eo *)eo_obj, evas_obj_freeze_events_get(&freeze_events));
|
|
|
|
return freeze_events;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_freeze_events_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *freeze_events = va_arg(*list, Eina_Bool *);
|
|
|
|
const Evas_Object_Protected_Data *obj = _pd;
|
|
|
|
if (freeze_events) *freeze_events = obj->freeze_events;
|
2011-10-27 03:36:09 -07:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_pass_events_set(Evas_Object *eo_obj, Eina_Bool pass)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_pass_events_set(pass));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_pass_events_set(Eo *eo_obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool pass = va_arg(*list, int);
|
|
|
|
Evas_Object_Protected_Data *obj = _pd;
|
2010-08-23 19:55:09 -07:00
|
|
|
pass = !!pass;
|
|
|
|
if (obj->pass_events == pass) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->pass_events = pass;
|
2012-10-18 04:30:04 -07:00
|
|
|
evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_FALSE, EINA_FALSE);
|
2012-10-18 05:13:04 -07:00
|
|
|
_feed_mouse_move_eval_internal(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_pass_events_get(const Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2011-11-11 22:12:42 -08:00
|
|
|
return EINA_FALSE;
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
Eina_Bool pass_events = EINA_FALSE;
|
|
|
|
eo_do((Eo *)eo_obj, evas_obj_pass_events_get(&pass_events));
|
|
|
|
return pass_events;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_pass_events_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *pass_events = va_arg(*list, Eina_Bool *);
|
|
|
|
const Evas_Object_Protected_Data *obj = _pd;
|
|
|
|
if (pass_events) *pass_events = obj->pass_events;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_repeat_events_set(Evas_Object *eo_obj, Eina_Bool repeat)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_repeat_events_set(repeat));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_repeat_events_set(Eo *eo_obj, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool repeat = va_arg(*list, int);
|
|
|
|
Evas_Object_Protected_Data *obj = _pd;
|
2010-08-23 19:55:09 -07:00
|
|
|
repeat = !!repeat;
|
|
|
|
if (obj->repeat_events == repeat) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->repeat_events = repeat;
|
2012-10-18 05:13:04 -07:00
|
|
|
_feed_mouse_move_eval_internal(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_repeat_events_get(const Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2011-11-11 22:12:42 -08:00
|
|
|
return EINA_FALSE;
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
Eina_Bool repeat_events = EINA_FALSE;
|
|
|
|
eo_do((Eo *)eo_obj, evas_obj_repeat_events_get(&repeat_events));
|
|
|
|
return repeat_events;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_repeat_events_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *repeat_events = va_arg(*list, Eina_Bool *);
|
|
|
|
const Evas_Object_Protected_Data *obj = _pd;
|
|
|
|
if (repeat_events) *repeat_events = obj->repeat_events;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-10-29 22:07:51 -07:00
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_propagate_events_set(Evas_Object *eo_obj, Eina_Bool prop)
|
2005-10-29 22:07:51 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2005-10-29 22:07:51 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_propagate_events_set(prop));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_propagate_events_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool prop = va_arg(*list, int);
|
|
|
|
Evas_Object_Protected_Data *obj = _pd;
|
2005-10-29 22:07:51 -07:00
|
|
|
obj->no_propagate = !prop;
|
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_propagate_events_get(const Evas_Object *eo_obj)
|
2005-10-29 22:07:51 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2011-11-11 22:12:42 -08:00
|
|
|
return EINA_FALSE;
|
2005-10-29 22:07:51 -07:00
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
Eina_Bool no_propagate = EINA_FALSE;
|
|
|
|
eo_do((Eo *)eo_obj, evas_obj_propagate_events_get(&no_propagate));
|
|
|
|
return no_propagate;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_propagate_events_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Eina_Bool *no_propagate = va_arg(*list, Eina_Bool *);
|
|
|
|
const Evas_Object_Protected_Data *obj = _pd;
|
|
|
|
if (no_propagate) *no_propagate = !(obj->no_propagate);
|
2005-10-29 22:07:51 -07:00
|
|
|
}
|
2007-07-24 07:20:07 -07:00
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_pointer_mode_set(Evas_Object *eo_obj, Evas_Object_Pointer_Mode setting)
|
2007-07-24 07:20:07 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2007-07-24 07:20:07 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_pointer_mode_set(setting));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_pointer_mode_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Object_Pointer_Mode setting = va_arg(*list, Evas_Object_Pointer_Mode);
|
|
|
|
Evas_Object_Protected_Data *obj = _pd;
|
2007-07-24 07:20:07 -07:00
|
|
|
obj->pointer_mode = setting;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object_Pointer_Mode
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_pointer_mode_get(const Evas_Object *eo_obj)
|
2007-07-24 07:20:07 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2011-11-11 22:12:42 -08:00
|
|
|
return EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
|
2007-07-24 07:20:07 -07:00
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Pointer_Mode setting = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
|
|
|
|
eo_do((Eo *)eo_obj, evas_obj_pointer_mode_get(&setting));
|
|
|
|
return setting;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_pointer_mode_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Object_Pointer_Mode *setting = va_arg(*list, Evas_Object_Pointer_Mode *);
|
|
|
|
const Evas_Object_Protected_Data *obj = _pd;
|
|
|
|
if (setting) *setting = obj->pointer_mode;
|
2007-07-24 07:20:07 -07:00
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_refeed_event(Evas *eo_e, void *event_copy, Evas_Callback_Type event_type)
|
|
|
|
{
|
|
|
|
eo_do(eo_e, evas_canvas_event_refeed_event(event_copy, event_type));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_refeed_event(Eo *eo_e, void *_pd EINA_UNUSED, va_list *list)
|
2011-07-07 06:59:50 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
void *event_copy = va_arg(*list, void *);
|
|
|
|
Evas_Callback_Type event_type = va_arg(*list, Evas_Callback_Type);
|
|
|
|
|
2012-05-01 19:40:03 -07:00
|
|
|
if (!event_copy) return;
|
|
|
|
|
2011-12-27 04:03:03 -08:00
|
|
|
switch (event_type)
|
2011-07-07 06:59:50 -07:00
|
|
|
{
|
|
|
|
case EVAS_CALLBACK_MOUSE_IN:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_In *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_in(eo_e, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_MOUSE_OUT:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Out *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_out(eo_e, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_MOUSE_DOWN:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Down *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_down(eo_e, ev->button, ev->flags, ev-> timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_MOUSE_UP:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Up *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_up(eo_e, ev->button, ev->flags, ev-> timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_MOUSE_MOVE:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Move *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_move(eo_e, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_MOUSE_WHEEL:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Wheel *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_wheel(eo_e, ev->direction, ev-> z, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_MULTI_DOWN:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Multi_Down *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_multi_down(eo_e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_MULTI_UP:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Multi_Up *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_multi_up(eo_e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_MULTI_MOVE:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Multi_Move *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_multi_move(eo_e, ev->device, ev->cur.canvas.x, ev->cur.canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->cur.canvas.xsub, ev->cur.canvas.ysub, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_KEY_DOWN:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Key_Down *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_key_down(eo_e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
case EVAS_CALLBACK_KEY_UP:
|
2011-12-27 04:03:03 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Key_Up *ev = event_copy;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_key_up(eo_e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data);
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
|
|
|
}
|
2011-07-07 06:59:50 -07:00
|
|
|
default: /* All non-input events are not handeled */
|
2011-12-27 04:03:03 -08:00
|
|
|
break;
|
2011-07-07 06:59:50 -07:00
|
|
|
}
|
|
|
|
}
|
2011-12-27 04:01:17 -08:00
|
|
|
|
|
|
|
EAPI int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_down_count_get(const Evas *eo_e)
|
2011-12-27 04:01:17 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
2011-12-27 04:01:17 -08:00
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
int ret = 0;
|
|
|
|
eo_do((Eo *)eo_e, evas_canvas_event_down_count_get(&ret));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_canvas_event_down_count_get(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
int *ret = va_arg(*list, int *);
|
|
|
|
const Evas_Public_Data *e = _pd;
|
|
|
|
*ret = e->pointer.downs;
|
2011-12-27 04:01:17 -08:00
|
|
|
}
|