2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
#include "evas_private.h"
|
|
|
|
|
2009-11-05 07:24:48 -08:00
|
|
|
static void
|
|
|
|
_evas_event_havemap_adjust(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
|
|
|
{
|
|
|
|
Evas_Object *pmap;
|
|
|
|
|
|
|
|
if (!obj->havemap_parent) return;
|
|
|
|
pmap = obj->smart.parent;
|
|
|
|
if (!pmap) return;
|
|
|
|
while (pmap)
|
|
|
|
{
|
|
|
|
if ((pmap->cur.map) && (pmap->cur.map->count == 4) && (pmap->cur.usemap))
|
|
|
|
break;
|
2009-11-06 02:30:24 -08:00
|
|
|
pmap = pmap->smart.parent;
|
2009-11-05 07:24:48 -08:00
|
|
|
}
|
|
|
|
if (!pmap) return;
|
|
|
|
evas_map_coords_get(pmap->cur.map, *x, *y, x, y, obj->mouse_grabbed);
|
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
static Eina_List *
|
2009-11-05 07:24:48 -08:00
|
|
|
_evas_event_object_list_in_get(Evas *e, Eina_List *in,
|
|
|
|
const Eina_Inlist *list, Evas_Object *stop,
|
|
|
|
int x, int y, int *no_rep, int parmap)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Object *obj;
|
2005-10-26 19:44:36 -07:00
|
|
|
if (!list) return in;
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_REVERSE_FOREACH(list, obj)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
if (parmap) obj->havemap_parent = 1;
|
|
|
|
else obj->havemap_parent = 0;
|
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj == stop)
|
|
|
|
{
|
|
|
|
*no_rep = 1;
|
|
|
|
return in;
|
|
|
|
}
|
2009-11-05 07:24:48 -08:00
|
|
|
if (evas_event_passes_through(obj)) continue;
|
|
|
|
if ((obj->cur.visible) && (obj->delete_me == 0) &&
|
|
|
|
(!obj->clip.clipees) &&
|
|
|
|
(evas_object_clippers_is_visible(obj)))
|
|
|
|
{
|
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
|
|
|
int norep;
|
|
|
|
int inside;
|
|
|
|
|
|
|
|
norep = 0;
|
|
|
|
if (((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap)))
|
|
|
|
{
|
|
|
|
inside = evas_object_is_in_output_rect(obj, x, y, 1, 1);
|
|
|
|
if (inside)
|
|
|
|
{
|
|
|
|
if (!evas_map_coords_get(obj->cur.map, x, y,
|
|
|
|
&(obj->cur.map->mx),
|
|
|
|
&(obj->cur.map->my), 0))
|
|
|
|
{
|
|
|
|
inside = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
parmap = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
inside = 0;
|
|
|
|
if (inside)
|
|
|
|
{
|
|
|
|
in = _evas_event_object_list_in_get
|
|
|
|
(e, in,
|
|
|
|
evas_object_smart_members_get_direct(obj),
|
|
|
|
stop,
|
|
|
|
obj->cur.geometry.x + obj->cur.map->mx,
|
|
|
|
obj->cur.geometry.y + obj->cur.map->my,
|
|
|
|
&norep, parmap);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
in = _evas_event_object_list_in_get
|
|
|
|
(e, in, evas_object_smart_members_get_direct(obj),
|
|
|
|
stop, x, y, &norep, parmap);
|
|
|
|
}
|
|
|
|
if (norep)
|
|
|
|
{
|
|
|
|
*no_rep = 1;
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int inside = 1;
|
|
|
|
|
|
|
|
if (((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap)))
|
|
|
|
{
|
|
|
|
inside = evas_object_is_in_output_rect(obj, x, y, 1, 1);
|
|
|
|
if (inside)
|
|
|
|
{
|
|
|
|
if (!evas_map_coords_get(obj->cur.map, x, y,
|
|
|
|
&(obj->cur.map->mx),
|
|
|
|
&(obj->cur.map->my), 0))
|
|
|
|
inside = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
inside = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
inside = evas_object_is_in_output_rect(obj, x, y, 1, 1);
|
|
|
|
if (inside && ((!obj->precise_is_inside) ||
|
|
|
|
(evas_object_is_inside(obj, x, y))))
|
|
|
|
{
|
|
|
|
in = eina_list_append(in, obj);
|
|
|
|
if (!obj->repeat_events)
|
|
|
|
{
|
|
|
|
*no_rep = 1;
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
*no_rep = 0;
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
|
|
|
|
{
|
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
|
|
|
|
|
|
|
if (!e->layers) 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
|
|
|
{
|
2005-10-26 19:44:36 -07:00
|
|
|
int norep;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
norep = 0;
|
2009-11-05 07:24:48 -08:00
|
|
|
in = _evas_event_object_list_in_get(e, in,
|
|
|
|
EINA_INLIST_GET(lay->objects),
|
|
|
|
stop, x, y, &norep, 0);
|
2005-10-26 19:44:36 -07:00
|
|
|
if (norep) 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);
|
|
|
|
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 */
|
|
|
|
|
2004-08-15 22:13:25 -07:00
|
|
|
/**
|
|
|
|
* @defgroup Evas_Event_Freezing_Group Evas Event Freezing Functions
|
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* Functions that deal with the freezing of event processing of an
|
|
|
|
* evas.
|
2004-08-15 22:13:25 -07:00
|
|
|
*/
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Freeze all event processing.
|
|
|
|
* @param e The canvas to freeze event processing on.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function will indicate to evas that the canvas @p e is to have
|
|
|
|
* all event processing frozen until a matching evas_event_thaw()
|
|
|
|
* function is called on the same canvas. Every freeze call must be
|
|
|
|
* matched by a thaw call in order to completely thaw out a canvas.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2004-04-15 18:38:14 -07:00
|
|
|
* Example:
|
|
|
|
* @code
|
|
|
|
* extern Evas *evas;
|
|
|
|
* extern Evas_Object *object;
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2004-04-15 18:38:14 -07:00
|
|
|
* evas_event_freeze(evas);
|
|
|
|
* evas_object_move(object, 50, 100);
|
|
|
|
* evas_object_resize(object, 200, 200);
|
|
|
|
* evas_event_thaw(evas);
|
|
|
|
* @endcode
|
2004-08-15 22:13:25 -07:00
|
|
|
* @ingroup Evas_Event_Freezing_Group
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_event_freeze(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
e->events_frozen++;
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Thaw a canvas out after freezing.
|
|
|
|
*
|
|
|
|
* @param e The canvas to thaw out.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This will thaw out a canvas after a matching evas_event_freeze()
|
|
|
|
* call. If this call completely thaws out a canvas, events will start
|
|
|
|
* being processed again after this call, but this call will not
|
|
|
|
* invole any "missed" events to be evaluated.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2004-04-15 18:38:14 -07:00
|
|
|
* See evas_event_freeze() for an example.
|
2004-08-15 22:13:25 -07:00
|
|
|
* @ingroup Evas_Event_Freezing_Group
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_event_thaw(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
e->events_frozen--;
|
2005-07-22 03:28:11 -07:00
|
|
|
if (e->events_frozen == 0)
|
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
2005-07-22 03:28:11 -07:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Object *obj;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_FOREACH(lay->objects, obj)
|
2005-07-22 03:28:11 -07:00
|
|
|
{
|
2005-07-30 02:52:53 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
evas_object_recalc_clippees(obj);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-01-27 18:43:13 -08:00
|
|
|
if (e->events_frozen < 0)
|
|
|
|
evas_debug_generic(" Thaw of events when already thawed!!!\n");
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Return the freeze count of a given canvas.
|
|
|
|
* @param e The canvas to fetch the freeze count from.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This returns the number of times the canvas has been told to freeze
|
|
|
|
* events. It is possible to call evas_event_freeze() multiple times,
|
|
|
|
* and these must be matched by evas_event_thaw() calls. This call
|
|
|
|
* allows the program to discover just how many times things have been
|
|
|
|
* frozen in case it may want to break out of a deep freeze state
|
|
|
|
* where the count is high.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2004-04-15 18:38:14 -07:00
|
|
|
* Example:
|
|
|
|
* @code
|
|
|
|
* extern Evas *evas;
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2004-04-15 18:38:14 -07:00
|
|
|
* while (evas_event_freeze_get(evas) > 0) evas_event_thaw(evas);
|
|
|
|
* @endcode
|
2004-08-15 22:13:25 -07:00
|
|
|
* @ingroup Evas_Event_Freezing_Group
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_event_freeze_get(const Evas *e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return e->events_frozen;
|
|
|
|
}
|
|
|
|
|
2009-09-17 15:38:10 -07:00
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Mouse down event feed.
|
|
|
|
*
|
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param b The button number.
|
|
|
|
* @param flags The evas button flags.
|
|
|
|
* @param timestamp The timestamp of the mouse down event.
|
|
|
|
* @param data The data for canvas.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function will set some evas properties that is necessary when
|
|
|
|
* the mouse button is pressed. It prepares information to be treated
|
|
|
|
* by the callback function.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l, *copy;
|
2010-01-18 03:55:52 -08:00
|
|
|
Eina_List *ins;
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Down ev;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
|
|
|
if (e->events_frozen > 0) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2010-01-18 03:55:52 -08:00
|
|
|
ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y);
|
|
|
|
/* 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;
|
2002-11-08 00:02:15 -08:00
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2007-07-24 07:20:07 -07:00
|
|
|
if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
|
|
|
|
{
|
|
|
|
obj->mouse_grabbed++;
|
|
|
|
e->pointer.mouse_grabbed++;
|
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2004-01-27 20:48:52 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_DOWN, &ev);
|
2007-04-29 21:22:42 -07:00
|
|
|
if (e->delete_me) 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++;
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2004-04-15 18:38:14 -07:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Mouse up event feed.
|
2004-04-15 18:38:14 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param b The button number.
|
|
|
|
* @param flags evas button flags.
|
|
|
|
* @param timestamp The timestamp of the mouse up event.
|
|
|
|
* @param data The data for canvas.
|
|
|
|
*
|
|
|
|
* This function will set some evas properties that is necessary when
|
|
|
|
* the mouse button is released. It prepares information to be treated
|
|
|
|
* by the callback function.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2004-04-15 18:38:14 -07:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l, *copy;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07: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));
|
|
|
|
|
|
|
|
if (e->events_frozen > 0) 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
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Up ev;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
ev.button = b;
|
|
|
|
ev.output.x = e->pointer.x;
|
|
|
|
ev.output.y = e->pointer.y;
|
2006-11-15 19:20:24 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
2003-01-09 20:58:51 -08:00
|
|
|
ev.data = (void *)data;
|
2002-12-16 16:00:38 -08:00
|
|
|
ev.modifiers = &(e->modifiers);
|
2004-09-11 21:49:07 -07:00
|
|
|
ev.locks = &(e->locks);
|
2004-12-13 19:21:32 -08:00
|
|
|
ev.flags = flags;
|
2005-07-25 02:55:47 -07:00
|
|
|
ev.timestamp = timestamp;
|
2008-01-23 01:00:59 -08:00
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-01-23 01:00:59 -08:00
|
|
|
_evas_walk(e);
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
2008-01-23 01:00:59 -08:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2008-01-23 01:00:59 -08:00
|
|
|
if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
|
|
|
|
(obj->mouse_in) && (obj->mouse_grabbed > 0))
|
|
|
|
{
|
|
|
|
obj->mouse_grabbed--;
|
|
|
|
e->pointer.mouse_grabbed--;
|
|
|
|
}
|
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_UP, &ev);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2008-01-23 01:00:59 -08:00
|
|
|
e->last_mouse_up_counter++;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2005-05-21 19:49:50 -07:00
|
|
|
if (!e->pointer.button)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *ins;
|
|
|
|
Eina_List *l;
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Out ev;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-01-23 01:00:59 -08:00
|
|
|
/* get new list of ins */
|
|
|
|
ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y);
|
|
|
|
/* go thru old list of in objects */
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2008-10-21 09:31:05 -07:00
|
|
|
if ((!eina_list_data_find(ins, obj)) ||
|
2008-01-23 01:00:59 -08:00
|
|
|
(!e->pointer.inside))
|
|
|
|
{
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-01-23 01:00:59 -08:00
|
|
|
obj->mouse_in = 0;
|
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
|
|
|
}
|
|
|
|
if (e->delete_me) break;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2004-09-17 06:46:55 -07:00
|
|
|
if (e->pointer.inside)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_In ev;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(ins, l, obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2008-10-21 09:31:05 -07:00
|
|
|
if (!eina_list_data_find(e->pointer.object.in, obj))
|
2004-09-17 06:46:55 -07:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2004-09-17 06:46:55 -07:00
|
|
|
obj->mouse_in = 1;
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2004-09-17 06:46:55 -07:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev);
|
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
if (e->delete_me) break;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
2004-09-17 06:46:55 -07:00
|
|
|
else
|
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
ins = eina_list_free(ins);
|
2004-09-17 06:46:55 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08: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);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = ins;
|
2004-09-17 06:46:55 -07:00
|
|
|
if (e->pointer.inside)
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y, 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!",
|
2009-09-21 09:08:51 -07:00
|
|
|
e->pointer.mouse_grabbed);
|
2008-11-14 21:13:09 -08:00
|
|
|
}
|
2007-07-24 07:20:07 -07:00
|
|
|
|
2008-11-14 21:13:09 -08:00
|
|
|
if ((e->pointer.button == 0) && (e->pointer.mouse_grabbed != 0))
|
2006-05-19 00:56:53 -07:00
|
|
|
{
|
2009-10-22 08:22:22 -07:00
|
|
|
INF("restore to 0 grabs (from %i)", e->pointer.mouse_grabbed);
|
2006-05-19 00:56:53 -07:00
|
|
|
e->pointer.mouse_grabbed = 0;
|
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2009-09-17 15:38:10 -07:00
|
|
|
|
2008-05-18 21:15:22 -07:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Mouse cancel event feed.
|
2008-05-18 21:15:22 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param timestamp The timestamp of the mouse up event.
|
|
|
|
* @param data The data for canvas.
|
|
|
|
*
|
|
|
|
* This function will call evas_event_feed_mouse_up() when a
|
|
|
|
* mouse cancel event happens.
|
2008-05-18 21:15:22 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
EAPI void
|
|
|
|
evas_event_feed_mouse_cancel(Evas *e, unsigned int timestamp, const void *data)
|
|
|
|
{
|
|
|
|
int i;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-05-18 21:15:22 -07:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
if (e->events_frozen > 0) 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++)
|
|
|
|
{
|
|
|
|
if ((e->pointer.button & (1 << i)))
|
|
|
|
evas_event_feed_mouse_up(e, i + 1, 0, timestamp, data);
|
|
|
|
}
|
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Mouse wheel event feed.
|
|
|
|
*
|
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param direction The wheel mouse direction.
|
|
|
|
* @param z How much mouse wheel was scrolled up or down.
|
|
|
|
* @param timestamp The timestamp of the mouse up event.
|
|
|
|
* @param data The data for canvas.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function will set some evas properties that is necessary when
|
|
|
|
* the mouse wheel is scrolled up or down. It prepares information to
|
|
|
|
* be treated by the callback function.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestamp, const void *data)
|
2004-12-13 19:21:32 -08:00
|
|
|
{
|
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;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2004-12-13 19:21:32 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
if (e->events_frozen > 0) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
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
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
2005-09-21 19:52:53 -07:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2004-12-13 19:21:32 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_WHEEL, &ev);
|
2007-04-29 21:22:42 -07:00
|
|
|
if (e->delete_me) break;
|
2005-09-21 19:52:53 -07:00
|
|
|
}
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2004-12-13 19:21:32 -08:00
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2004-12-13 19:21:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Mouse move event feed.
|
2004-12-13 19:21:32 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param x The horizontal position of the mouse pointer.
|
|
|
|
* @param y The vertical position of the mouse pointer.
|
|
|
|
* @param timestamp The timestamp of the mouse up event.
|
|
|
|
* @param data The data for canvas.
|
|
|
|
*
|
|
|
|
* This function will set some evas properties that is necessary when
|
|
|
|
* the mouse is moved from its last position. It prepares information
|
|
|
|
* to be treated by the callback function.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2004-12-13 19:21:32 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const void *data)
|
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
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
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
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if (e->events_frozen > 0) 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;
|
|
|
|
//// e->pointer.canvas_x = evas_coord_screen_x_to_world(e, x);
|
|
|
|
//// e->pointer.canvas_y = evas_coord_screen_y_to_world(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);
|
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
|
|
|
{
|
|
|
|
/* go thru old list of in objects */
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *outs = NULL;
|
|
|
|
Eina_List *l, *copy;
|
2004-09-11 21:49:07 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Move ev;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-01-23 01:00:59 -08: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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.cur.canvas.x = e->pointer.x;
|
|
|
|
ev.cur.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y);
|
2008-01-23 01:00:59 -08:00
|
|
|
if ((obj->cur.visible) &&
|
|
|
|
(evas_object_clippers_is_visible(obj)) &&
|
|
|
|
(!evas_event_passes_through(obj)) &&
|
|
|
|
(!obj->clip.clipees))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-01-23 01:00:59 -08:00
|
|
|
if ((px != x) || (py != y))
|
|
|
|
{
|
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2008-01-23 01:00:59 -08:00
|
|
|
else
|
2008-10-21 09:31:05 -07:00
|
|
|
outs = eina_list_append(outs, obj);
|
2008-01-23 01:00:59 -08:00
|
|
|
if (e->delete_me) break;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Out ev;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2008-01-23 01:00:59 -08:00
|
|
|
while (outs)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Object *obj;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-01-23 01:00:59 -08:00
|
|
|
obj = outs->data;
|
2008-10-21 09:31:05 -07:00
|
|
|
outs = eina_list_remove(outs, obj);
|
2008-11-14 21:13:09 -08:00
|
|
|
if ((obj->mouse_grabbed == 0) && (!e->delete_me))
|
2005-01-19 22:54:45 -08:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2008-10-21 09:31:05 -07:00
|
|
|
e->pointer.object.in = eina_list_remove(e->pointer.object.in, obj);
|
2009-11-05 07:24:48 -08:00
|
|
|
obj->mouse_in = 0;
|
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
2005-05-21 19:49:50 -07:00
|
|
|
}
|
2005-01-19 22:54:45 -08:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *ins;
|
|
|
|
Eina_List *l, *copy;
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Move ev;
|
|
|
|
Evas_Event_Mouse_Out ev2;
|
|
|
|
Evas_Event_Mouse_In ev3;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-01-23 01:00:59 -08: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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
|
|
|
|
|
|
|
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 = EVAS_EVENT_FLAG_NONE;
|
|
|
|
|
|
|
|
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 = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* get all new in objects */
|
|
|
|
ins = evas_event_objects_event_list(e, NULL, x, y);
|
|
|
|
/* go thru old list of in objects */
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
/* if its under the pointer and its visible and its in the new */
|
|
|
|
/* in list */
|
2005-05-21 19:49:50 -07:00
|
|
|
// FIXME: i don't think we need this
|
2005-04-03 07:22:17 -07:00
|
|
|
// evas_object_clip_recalc(obj);
|
2005-05-21 19:49:50 -07:00
|
|
|
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
|
2002-11-08 00:02:15 -08:00
|
|
|
(obj->cur.visible) &&
|
|
|
|
(evas_object_clippers_is_visible(obj)) &&
|
2008-10-21 09:31:05 -07:00
|
|
|
(eina_list_data_find(ins, obj)) &&
|
2004-06-13 23:04:22 -07:00
|
|
|
(!evas_event_passes_through(obj)) &&
|
2007-07-23 07:22:57 -07:00
|
|
|
(!obj->clip.clipees) &&
|
|
|
|
((!obj->precise_is_inside) ||
|
|
|
|
(evas_object_is_inside(obj, x, y))))
|
2002-11-08 00:02:15 -08: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;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2004-01-27 20:30:55 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* otherwise it has left the object */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
obj->mouse_in = 0;
|
2009-11-05 07:24:48 -08:00
|
|
|
ev2.canvas.x = e->pointer.x;
|
|
|
|
ev2.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev2.canvas.x, &ev2.canvas.y);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2008-01-23 01:00:59 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev2);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
if (e->delete_me) break;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2004-02-16 11:22:48 -08:00
|
|
|
/* go thru our current list of ins */
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(ins, l, obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev3.canvas.x = e->pointer.x;
|
|
|
|
ev3.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev3.canvas.x, &ev3.canvas.y);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* if its not in the old list of ins send an enter event */
|
2008-10-21 09:31:05 -07:00
|
|
|
if (!eina_list_data_find(e->pointer.object.in, obj))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
obj->mouse_in = 1;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2008-01-23 01:00:59 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev3);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
if (e->delete_me) break;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
/* free our old list of ins */
|
2008-10-21 09:31:05 -07:00
|
|
|
eina_list_free(e->pointer.object.in);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = ins;
|
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Mouse in event feed.
|
|
|
|
*
|
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param timestamp The timestamp of the mouse up event.
|
|
|
|
* @param data The data for canvas.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function will set some evas properties that is necessary when
|
|
|
|
* the mouse in event happens. It prepares information to be treated
|
|
|
|
* by the callback function.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
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;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
e->pointer.inside = 1;
|
2004-09-17 06:46:55 -07:00
|
|
|
|
|
|
|
if (e->events_frozen > 0) 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
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2004-09-17 06:46:55 -07:00
|
|
|
/* get new list of ins */
|
|
|
|
ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y);
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(ins, l, obj)
|
2004-09-17 06:46:55 -07:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2008-10-21 09:31:05 -07:00
|
|
|
if (!eina_list_data_find(e->pointer.object.in, obj))
|
2004-09-17 06:46:55 -07:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2004-09-17 06:46:55 -07:00
|
|
|
obj->mouse_in = 1;
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2004-09-17 06:46:55 -07:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev);
|
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
if (e->delete_me) break;
|
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;
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y, timestamp, data);
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Mouse out event feed.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param timestamp Timestamp of the mouse up event.
|
|
|
|
* @param data The data for canvas.
|
|
|
|
*
|
|
|
|
* This function will set some evas properties that is necessary when
|
|
|
|
* the mouse out event happens. It prepares information to be treated
|
|
|
|
* by the callback function.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-01-23 01:00:59 -08:00
|
|
|
Evas_Event_Mouse_Out ev;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
e->pointer.inside = 0;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2004-09-17 06:46:55 -07:00
|
|
|
if (e->events_frozen > 0) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2005-05-21 19:49:50 -07:00
|
|
|
/* if our mouse button is grabbed to any objects */
|
2004-09-17 06:46:55 -07:00
|
|
|
if (e->pointer.mouse_grabbed == 0)
|
|
|
|
{
|
|
|
|
/* go thru old list of in objects */
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Object *obj;
|
2004-09-17 06:46:55 -07:00
|
|
|
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
2004-09-17 06:46:55 -07:00
|
|
|
{
|
2009-11-05 07:24:48 -08:00
|
|
|
ev.canvas.x = e->pointer.x;
|
|
|
|
ev.canvas.y = e->pointer.y;
|
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
|
|
|
obj->mouse_in = 0;
|
2008-10-21 09:31:05 -07:00
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
if (e->delete_me) break;
|
2004-09-17 06:46:55 -07:00
|
|
|
}
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2004-09-21 02:33:18 -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
|
|
|
}
|
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
|
2010-01-17 00:52:21 -08:00
|
|
|
evas_event_feed_multi_down(Evas *e,
|
|
|
|
int d, int x, int y,
|
|
|
|
double rad, double radx, double rady,
|
|
|
|
double pres, double ang,
|
|
|
|
double fx, double fy,
|
|
|
|
Evas_Button_Flags flags, unsigned int timestamp,
|
|
|
|
const void *data)
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Event_Multi_Down ev;
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
if (e->events_frozen > 0) return;
|
|
|
|
e->last_timestamp = timestamp;
|
|
|
|
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
|
|
|
|
|
|
|
_evas_walk(e);
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
|
|
|
{
|
|
|
|
ev.canvas.x = x;
|
|
|
|
ev.canvas.y = y;
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.canvas.xsub = fx;
|
|
|
|
ev.canvas.ysub = fy;
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2010-01-17 00:52:21 -08: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
|
2010-01-16 04:20:22 -08:00
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_DOWN, &ev);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
|
|
|
if (copy) eina_list_free(copy);
|
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-01-17 00:52:21 -08:00
|
|
|
evas_event_feed_multi_up(Evas *e,
|
|
|
|
int d, int x, int y,
|
|
|
|
double rad, double radx, double rady,
|
|
|
|
double pres, double ang,
|
|
|
|
double fx, double fy,
|
|
|
|
Evas_Button_Flags flags, unsigned int timestamp,
|
|
|
|
const void *data)
|
2010-01-16 04:20:22 -08:00
|
|
|
{
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Event_Multi_Up ev;
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
if (e->events_frozen > 0) return;
|
|
|
|
e->last_timestamp = timestamp;
|
|
|
|
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
|
|
|
|
|
|
|
_evas_walk(e);
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
|
|
|
{
|
|
|
|
ev.canvas.x = x;
|
|
|
|
ev.canvas.y = y;
|
2010-01-17 00:52:21 -08:00
|
|
|
ev.canvas.xsub = fx;
|
|
|
|
ev.canvas.ysub = fy;
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y);
|
2010-01-17 00:52:21 -08: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
|
2010-01-16 04:20:22 -08:00
|
|
|
if (e->events_frozen <= 0)
|
2010-01-19 06:29:20 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_UP, &ev);
|
2010-01-16 04:20:22 -08:00
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
|
|
|
if (copy) copy = eina_list_free(copy);
|
|
|
|
|
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2010-01-17 00:52:21 -08:00
|
|
|
evas_event_feed_multi_move(Evas *e,
|
|
|
|
int d, int x, int y,
|
|
|
|
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
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
if (e->events_frozen > 0) return;
|
|
|
|
e->last_timestamp = timestamp;
|
|
|
|
|
|
|
|
if (!e->pointer.inside) return;
|
|
|
|
|
|
|
|
_evas_walk(e);
|
|
|
|
/* if our mouse button is grabbed to any objects */
|
|
|
|
if (e->pointer.mouse_grabbed > 0)
|
|
|
|
{
|
|
|
|
/* go thru old list of in objects */
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Event_Multi_Move ev;
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
|
|
|
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
|
|
|
{
|
|
|
|
if ((obj->cur.visible) &&
|
|
|
|
(evas_object_clippers_is_visible(obj)) &&
|
|
|
|
(!evas_event_passes_through(obj)) &&
|
|
|
|
(!obj->clip.clipees))
|
|
|
|
{
|
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;
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y);
|
2010-01-17 00:52:21 -08:00
|
|
|
if (x != ev.cur.canvas.x)
|
|
|
|
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
|
2010-01-16 04:20:22 -08:00
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev);
|
|
|
|
}
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Eina_List *ins;
|
|
|
|
Eina_List *l, *copy;
|
|
|
|
Evas_Event_Multi_Move ev;
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
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;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
|
|
|
|
|
|
|
/* get all new in objects */
|
|
|
|
ins = evas_event_objects_event_list(e, NULL, x, y);
|
|
|
|
/* go thru old list of in objects */
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
|
|
|
{
|
|
|
|
/* if its under the pointer and its visible and its in the new */
|
|
|
|
/* in list */
|
|
|
|
// FIXME: i don't think we need this
|
|
|
|
// evas_object_clip_recalc(obj);
|
|
|
|
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
|
|
|
|
(obj->cur.visible) &&
|
|
|
|
(evas_object_clippers_is_visible(obj)) &&
|
|
|
|
(eina_list_data_find(ins, obj)) &&
|
|
|
|
(!evas_event_passes_through(obj)) &&
|
|
|
|
(!obj->clip.clipees) &&
|
|
|
|
((!obj->precise_is_inside) ||
|
|
|
|
(evas_object_is_inside(obj, x, y))))
|
|
|
|
{
|
|
|
|
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;
|
2010-01-16 04:20:22 -08:00
|
|
|
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y);
|
2010-01-17 00:52:21 -08:00
|
|
|
if (x != ev.cur.canvas.x)
|
|
|
|
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
|
2010-01-16 04:20:22 -08:00
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev);
|
|
|
|
}
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
|
|
|
if (copy) copy = eina_list_free(copy);
|
|
|
|
/* free our old list of ins */
|
|
|
|
eina_list_free(e->pointer.object.in);
|
|
|
|
/* and set up the new one */
|
|
|
|
e->pointer.object.in = ins;
|
|
|
|
}
|
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Key down event feed
|
|
|
|
*
|
|
|
|
* @param e The canvas to thaw out
|
|
|
|
* @param keyname Name of the key
|
|
|
|
* @param key The key pressed.
|
|
|
|
* @param string A String
|
|
|
|
* @param compose The compose string
|
|
|
|
* @param timestamp Timestamp of the mouse up event
|
|
|
|
* @param data Data for canvas.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function will set some evas properties that is necessary when
|
|
|
|
* a key is pressed. It prepares information to be treated by the
|
|
|
|
* callback function.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_key_down(Evas *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
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (!keyname) return;
|
|
|
|
if (e->events_frozen > 0) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2002-12-16 16:00:38 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Key_Down ev;
|
2003-07-07 23:08:26 -07:00
|
|
|
int exclusive;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2003-07-07 23:08:26 -07:00
|
|
|
exclusive = 0;
|
2003-01-09 20:58:51 -08:00
|
|
|
ev.keyname = (char *)keyname;
|
|
|
|
ev.data = (void *)data;
|
2002-12-16 16:00:38 -08:00
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
2004-12-13 19:21:32 -08:00
|
|
|
ev.key = key;
|
|
|
|
ev.string = string;
|
|
|
|
ev.compose = compose;
|
2005-07-25 02:55:47 -07:00
|
|
|
ev.timestamp = timestamp;
|
2008-01-23 01:00:59 -08:00
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2003-01-05 04:55:37 -08:00
|
|
|
if (e->grabs)
|
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Key_Grab *g;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2003-07-07 23:08:26 -07:00
|
|
|
e->walking_grabs++;
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(e->grabs, l, g)
|
2003-01-05 04:55:37 -08:00
|
|
|
{
|
2003-07-07 23:08:26 -07:00
|
|
|
if (g->just_added)
|
|
|
|
{
|
|
|
|
g->just_added = 0;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (g->delete_me) continue;
|
2003-01-19 21:17:21 -08:00
|
|
|
if (((e->modifiers.mask & g->modifiers) ||
|
|
|
|
(g->modifiers == e->modifiers.mask)) &&
|
2003-01-05 04:55:37 -08:00
|
|
|
(!strcmp(keyname, g->keyname)))
|
|
|
|
{
|
2005-09-24 03:22:55 -07:00
|
|
|
if (!(e->modifiers.mask & g->not_modifiers))
|
|
|
|
{
|
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(g->object, EVAS_CALLBACK_KEY_DOWN, &ev);
|
|
|
|
if (g->exclusive) exclusive = 1;
|
|
|
|
}
|
2003-07-07 23:08:26 -07:00
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
if (e->delete_me) break;
|
2003-07-07 23:08:26 -07:00
|
|
|
}
|
|
|
|
e->walking_grabs--;
|
|
|
|
if (e->walking_grabs <= 0)
|
|
|
|
{
|
|
|
|
while (e->delete_grabs > 0)
|
|
|
|
{
|
|
|
|
e->delete_grabs--;
|
2003-07-16 00:39:28 -07:00
|
|
|
for (l = e->grabs; l;)
|
2003-07-07 23:08:26 -07:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
g = eina_list_data_get(l);
|
|
|
|
l = eina_list_next(l);
|
2003-07-07 23:08:26 -07:00
|
|
|
if (g->delete_me)
|
2003-07-16 00:39:28 -07:00
|
|
|
evas_key_grab_free(g->object, g->keyname, g->modifiers, g->not_modifiers);
|
2003-07-07 23:08:26 -07:00
|
|
|
}
|
|
|
|
}
|
2003-01-05 04:55:37 -08:00
|
|
|
}
|
|
|
|
}
|
2003-07-07 23:08:26 -07:00
|
|
|
if ((e->focused) && (!exclusive))
|
2003-01-29 15:37:10 -08:00
|
|
|
{
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2004-01-27 20:30:55 -08:00
|
|
|
evas_object_event_callback_call(e->focused, EVAS_CALLBACK_KEY_DOWN, &ev);
|
2003-01-29 15:37:10 -08:00
|
|
|
}
|
2003-01-05 04:55:37 -08:00
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_unwalk(e);
|
2002-12-16 16:00:38 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Key up event feed
|
|
|
|
*
|
|
|
|
* @param e The canvas to thaw out
|
|
|
|
* @param keyname Name of the key
|
|
|
|
* @param key The key released.
|
|
|
|
* @param string string
|
|
|
|
* @param compose compose
|
|
|
|
* @param timestamp Timestamp of the mouse up event
|
|
|
|
* @param data Data for canvas.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function will set some evas properties that is necessary when
|
|
|
|
* a key is released. It prepares information to be treated by the
|
|
|
|
* callback function.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_key_up(Evas *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
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (!keyname) return;
|
|
|
|
if (e->events_frozen > 0) return;
|
2005-07-25 02:55:47 -07:00
|
|
|
e->last_timestamp = timestamp;
|
2007-04-29 21:22:42 -07:00
|
|
|
_evas_walk(e);
|
2002-12-16 16:00:38 -08:00
|
|
|
{
|
|
|
|
Evas_Event_Key_Up ev;
|
2003-07-07 23:08:26 -07:00
|
|
|
int exclusive;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
|
|
|
exclusive = 0;
|
2003-01-09 20:58:51 -08:00
|
|
|
ev.keyname = (char *)keyname;
|
|
|
|
ev.data = (void *)data;
|
2002-12-16 16:00:38 -08:00
|
|
|
ev.modifiers = &(e->modifiers);
|
|
|
|
ev.locks = &(e->locks);
|
2004-12-13 19:21:32 -08:00
|
|
|
ev.key = key;
|
|
|
|
ev.string = string;
|
|
|
|
ev.compose = compose;
|
2005-07-25 02:55:47 -07:00
|
|
|
ev.timestamp = timestamp;
|
2008-01-23 01:00:59 -08:00
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2003-01-05 04:55:37 -08:00
|
|
|
if (e->grabs)
|
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Key_Grab *g;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2003-07-07 23:08:26 -07:00
|
|
|
e->walking_grabs++;
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(e->grabs, l, g)
|
2003-01-05 04:55:37 -08:00
|
|
|
{
|
2003-07-07 23:08:26 -07:00
|
|
|
if (g->just_added)
|
|
|
|
{
|
|
|
|
g->just_added = 0;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (g->delete_me) continue;
|
2003-01-19 21:17:21 -08:00
|
|
|
if (((e->modifiers.mask & g->modifiers) ||
|
|
|
|
(g->modifiers == e->modifiers.mask)) &&
|
|
|
|
(!((e->modifiers.mask & g->not_modifiers) ||
|
|
|
|
(g->not_modifiers == ~e->modifiers.mask))) &&
|
2003-01-05 04:55:37 -08:00
|
|
|
(!strcmp(keyname, g->keyname)))
|
|
|
|
{
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2004-01-27 20:30:55 -08:00
|
|
|
evas_object_event_callback_call(g->object, EVAS_CALLBACK_KEY_UP, &ev);
|
2003-07-07 23:08:26 -07:00
|
|
|
if (g->exclusive) exclusive = 1;
|
2005-05-21 19:49:50 -07:00
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
if (e->delete_me) break;
|
2003-01-05 04:55:37 -08:00
|
|
|
}
|
2003-07-07 23:08:26 -07:00
|
|
|
e->walking_grabs--;
|
|
|
|
if (e->walking_grabs <= 0)
|
|
|
|
{
|
|
|
|
while (e->delete_grabs > 0)
|
|
|
|
{
|
2009-06-17 11:12:55 -07:00
|
|
|
Eina_List *l, *l_next;
|
|
|
|
Evas_Key_Grab *g;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2003-07-07 23:08:26 -07:00
|
|
|
e->delete_grabs--;
|
2009-06-17 11:12:55 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(e->grabs, l, l_next, g)
|
2003-07-07 23:08:26 -07:00
|
|
|
{
|
|
|
|
if (g->delete_me)
|
2003-07-16 00:39:28 -07:00
|
|
|
evas_key_grab_free(g->object, g->keyname, g->modifiers, g->not_modifiers);
|
2003-07-07 23:08:26 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-01-05 04:55:37 -08:00
|
|
|
}
|
2003-07-07 23:08:26 -07:00
|
|
|
if ((e->focused) && (!exclusive))
|
2003-01-29 15:37:10 -08:00
|
|
|
{
|
2005-09-21 19:52:53 -07:00
|
|
|
if (e->events_frozen <= 0)
|
2004-01-27 20:30:55 -08:00
|
|
|
evas_object_event_callback_call(e->focused, EVAS_CALLBACK_KEY_UP, &ev);
|
2003-01-29 15:37:10 -08:00
|
|
|
}
|
2003-01-05 04:55:37 -08:00
|
|
|
}
|
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
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Hold event feed
|
|
|
|
*
|
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param hold The hold.
|
|
|
|
* @param timestamp The timestamp of the mouse up event.
|
|
|
|
* @param data The data for canvas.
|
2008-03-31 14:38:38 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function makes the object to stop sending events.
|
2008-03-31 14:38:38 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
EAPI void
|
|
|
|
evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const void *data)
|
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l, *copy;
|
2008-03-31 14:38:38 -07:00
|
|
|
Evas_Event_Hold ev;
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Object *obj;
|
2008-03-31 14:38:38 -07:00
|
|
|
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
if (e->events_frozen > 0) return;
|
|
|
|
e->last_timestamp = timestamp;
|
|
|
|
|
|
|
|
ev.hold = hold;
|
|
|
|
ev.data = (void *)data;
|
|
|
|
ev.timestamp = timestamp;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-07-18 04:04:06 -07:00
|
|
|
|
2008-03-31 14:38:38 -07:00
|
|
|
_evas_walk(e);
|
|
|
|
copy = evas_event_list_copy(e->pointer.object.in);
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(copy, l, obj)
|
2008-03-31 14:38:38 -07:00
|
|
|
{
|
|
|
|
if (e->events_frozen <= 0)
|
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_HOLD, &ev);
|
|
|
|
if (e->delete_me) break;
|
|
|
|
}
|
2008-10-21 09:31:05 -07:00
|
|
|
if (copy) copy = eina_list_free(copy);
|
2008-03-31 14:38:38 -07:00
|
|
|
_evas_unwalk(e);
|
|
|
|
}
|
|
|
|
|
2006-12-07 23:51:48 -08:00
|
|
|
|
2008-11-01 14:50:36 -07:00
|
|
|
/**
|
2008-11-01 15:21:10 -07:00
|
|
|
* @addtogroup Evas_Object_Group
|
2008-11-01 14:50:36 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2006-12-07 23:51:48 -08:00
|
|
|
/**
|
|
|
|
* Set an object's pass events state.
|
|
|
|
* @param obj the evas object
|
|
|
|
* @param pass whether to pass events or not
|
|
|
|
*
|
|
|
|
* If @p pass is true, this will cause events on @p obj to be ignored.
|
|
|
|
* They will be triggered on the next lower object (that is not set to
|
|
|
|
* pass events) instead.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2006-12-07 23:51:48 -08:00
|
|
|
* If @p pass is false, events will be processed as normal.
|
2008-07-18 04:04:06 -07:00
|
|
|
*
|
2006-12-07 23:51:48 -08:00
|
|
|
* @ingroup Evas_Object_Event_Flags_Group
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_object_pass_events_set(Evas_Object *obj, Eina_Bool pass)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj->pass_events = pass;
|
2005-07-22 03:28:11 -07:00
|
|
|
evas_object_smart_member_cache_invalidate(obj);
|
2005-05-21 19:49:50 -07:00
|
|
|
if (evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
2007-07-23 07:22:57 -07:00
|
|
|
obj->layer->evas->pointer.y, 1, 1) &&
|
|
|
|
((!obj->precise_is_inside) ||
|
|
|
|
(evas_object_is_inside(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y))))
|
2005-05-21 19:49:50 -07:00
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
2004-12-13 19:21:32 -08:00
|
|
|
obj->layer->evas->pointer.y,
|
2005-07-25 02:55:47 -07:00
|
|
|
obj->layer->evas->last_timestamp,
|
2004-12-13 19:21:32 -08:00
|
|
|
NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2006-12-07 23:51:48 -08:00
|
|
|
* Determine whether an object is set to pass events.
|
|
|
|
* @param obj
|
|
|
|
* @return pass events state
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2006-12-07 23:51:48 -08:00
|
|
|
* @ingroup Evas_Object_Event_Flags_Group
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_pass_events_get(const Evas_Object *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return obj->pass_events;
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2006-12-07 23:51:48 -08:00
|
|
|
* Set an object's repeat events state.
|
|
|
|
* @param obj the object
|
|
|
|
* @param repeat wheter to repeat events or not
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2006-12-07 23:51:48 -08:00
|
|
|
* If @p repeat is true, this will cause events on @p obj to trigger
|
|
|
|
* callbacks, but also to be repeated on the next lower object in the
|
|
|
|
* stack.
|
|
|
|
*
|
|
|
|
* If @p repeat is false, events occuring on @p obj will be processed
|
|
|
|
* normally.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2006-12-07 23:51:48 -08:00
|
|
|
* @ingroup Evas_Object_Event_Flags_Group
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_object_repeat_events_set(Evas_Object *obj, Eina_Bool repeat)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj->repeat_events = repeat;
|
2005-05-21 19:49:50 -07:00
|
|
|
if (evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
2007-07-23 07:22:57 -07:00
|
|
|
obj->layer->evas->pointer.y, 1, 1) &&
|
|
|
|
((!obj->precise_is_inside) ||
|
|
|
|
(evas_object_is_inside(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y))))
|
2005-05-21 19:49:50 -07:00
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
2004-12-13 19:21:32 -08:00
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
2005-07-25 02:55:47 -07:00
|
|
|
obj->layer->evas->last_timestamp,
|
2004-12-13 19:21:32 -08:00
|
|
|
NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2006-12-07 23:51:48 -08:00
|
|
|
* Determine whether an object is set to repeat events.
|
|
|
|
* @param obj
|
|
|
|
* @return repeat events state
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2006-12-07 23:51:48 -08:00
|
|
|
* @ingroup Evas_Object_Event_Flags_Group
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_repeat_events_get(const Evas_Object *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return obj->repeat_events;
|
|
|
|
}
|
2005-10-29 22:07:51 -07:00
|
|
|
|
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Set whether events on a smart member object should propagate to its
|
|
|
|
* parent.
|
2005-10-29 22:07:51 -07:00
|
|
|
*
|
2006-12-07 23:51:48 -08:00
|
|
|
* @param obj the smart member object
|
|
|
|
* @param prop wheter to propagate events or not
|
|
|
|
*
|
|
|
|
* This function has no effect if @p obj is not a member of a smart
|
|
|
|
* object.
|
2005-10-29 22:07:51 -07:00
|
|
|
*
|
2008-07-18 04:04:06 -07:00
|
|
|
* If @p prop is true, events occuring on this object will propagate on
|
2006-12-07 23:51:48 -08:00
|
|
|
* to the smart object of which @p obj is a member.
|
|
|
|
*
|
|
|
|
* If @p prop is false, events for which callbacks are set on the member
|
|
|
|
* object, @p obj, will not be passed on to the parent smart object.
|
|
|
|
*
|
|
|
|
* The default value is true.
|
|
|
|
* @ingroup Evas_Object_Event_Flags_Group
|
2005-10-29 22:07:51 -07:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_object_propagate_events_set(Evas_Object *obj, Eina_Bool prop)
|
2005-10-29 22:07:51 -07:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj->no_propagate = !prop;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2006-12-07 23:51:48 -08:00
|
|
|
* Determine whether an object is set to propagate events.
|
|
|
|
* @param obj
|
|
|
|
* @return propogate events state
|
2005-10-29 22:07:51 -07:00
|
|
|
*
|
2006-12-07 23:51:48 -08:00
|
|
|
* @ingroup Evas_Object_Event_Flags_Group
|
2005-10-29 22:07:51 -07:00
|
|
|
*/
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_propagate_events_get(const Evas_Object *obj)
|
2005-10-29 22:07:51 -07:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return !(obj->no_propagate);
|
|
|
|
}
|
2007-07-24 07:20:07 -07:00
|
|
|
|
2008-11-01 14:50:36 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2007-07-24 07:20:07 -07:00
|
|
|
/**
|
|
|
|
* Set pointer behavior.
|
|
|
|
*
|
|
|
|
* @param obj
|
|
|
|
* @param setting desired behavior.
|
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function has direct effect on event callbacks related to
|
|
|
|
* mouse.
|
2007-07-24 07:20:07 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* If @p setting is EVAS_OBJECT_POINTER_MODE_AUTOGRAB, then when mouse
|
|
|
|
* is down at this object, events will be restricted to it as source,
|
|
|
|
* mouse moves, for example, will be emitted even if outside this
|
|
|
|
* object area.
|
2007-07-24 07:20:07 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* If @p setting is EVAS_OBJECT_POINTER_MODE_NOGRAB, then events will
|
|
|
|
* be emitted just when inside this object area.
|
2007-07-24 07:20:07 -07:00
|
|
|
*
|
|
|
|
* The default value is EVAS_OBJECT_POINTER_MODE_AUTOGRAB.
|
|
|
|
*/
|
|
|
|
EAPI void
|
|
|
|
evas_object_pointer_mode_set(Evas_Object *obj, Evas_Object_Pointer_Mode setting)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj->pointer_mode = setting;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine how pointer will behave.
|
|
|
|
* @param obj
|
|
|
|
* @return pointer behavior.
|
|
|
|
*/
|
|
|
|
EAPI Evas_Object_Pointer_Mode
|
2008-02-08 13:42:01 -08:00
|
|
|
evas_object_pointer_mode_get(const Evas_Object *obj)
|
2007-07-24 07:20:07 -07:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return obj->pointer_mode;
|
|
|
|
}
|