evas/events - removed events_frozen check in evas_event_passes_through()

in most cases, it is performed twice inside and outside of the function in inefficient way.

and calling of events_frozen in the passes_through() is not understable in the view of functional consistency.

Check is separately would be better.




SVN revision: 65269
This commit is contained in:
ChunEon Park 2011-11-15 15:10:19 +00:00
parent 15f0f3e044
commit 61655ba055
4 changed files with 76 additions and 87 deletions

View File

@ -111,7 +111,7 @@ evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
Evas_Layer *lay; Evas_Layer *lay;
Eina_List *in = NULL; Eina_List *in = NULL;
if (!e->layers) return NULL; if ((!e->layers) || (e->events_frozen > 0)) return NULL;
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay) EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{ {
int norep = 0; int norep = 0;
@ -575,18 +575,18 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
{ {
ev.cur.canvas.x = e->pointer.x; ev.cur.canvas.x = e->pointer.x;
ev.cur.canvas.y = e->pointer.y; ev.cur.canvas.y = e->pointer.y;
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); _evas_event_havemap_adjust(obj, &ev.cur.canvas.x,
if (((evas_object_clippers_is_visible(obj)) || &ev.cur.canvas.y,
(obj->mouse_grabbed)) && obj->mouse_grabbed);
if ((e->events_frozen <= 0) &&
(evas_object_clippers_is_visible(obj) ||
obj->mouse_grabbed) &&
(!evas_event_passes_through(obj)) && (!evas_event_passes_through(obj)) &&
(!evas_event_freezes_through(obj)) && (!evas_event_freezes_through(obj)) &&
(!obj->clip.clipees)) (!obj->clip.clipees))
{ {
if ((px != x) || (py != y)) if ((px != x) || (py != y))
{ evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
if (e->events_frozen <= 0)
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
}
} }
else else
outs = eina_list_append(outs, obj); outs = eina_list_append(outs, obj);
@ -695,23 +695,23 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
/* in list */ /* in list */
// FIXME: i don't think we need this // FIXME: i don't think we need this
// evas_object_clip_recalc(obj); // evas_object_clip_recalc(obj);
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) && if ((e->events_frozen <= 0) &&
((evas_object_clippers_is_visible(obj)) || evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
(obj->mouse_grabbed)) && (evas_object_clippers_is_visible(obj) ||
(eina_list_data_find(ins, obj)) && obj->mouse_grabbed) &&
eina_list_data_find(ins, obj) &&
(!evas_event_passes_through(obj)) && (!evas_event_passes_through(obj)) &&
(!evas_event_freezes_through(obj)) && (!evas_event_freezes_through(obj)) &&
(!obj->clip.clipees) && (!obj->clip.clipees) &&
((!obj->precise_is_inside) || ((!obj->precise_is_inside) || evas_object_is_inside(obj, x, y))
(evas_object_is_inside(obj, x, y)))) )
{ {
if ((px != x) || (py != y)) if ((px != x) || (py != y))
{ {
ev.cur.canvas.x = e->pointer.x; ev.cur.canvas.x = e->pointer.x;
ev.cur.canvas.y = e->pointer.y; ev.cur.canvas.y = e->pointer.y;
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
if (e->events_frozen <= 0) evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
} }
} }
/* otherwise it has left the object */ /* otherwise it has left the object */
@ -1087,8 +1087,8 @@ evas_event_feed_multi_move(Evas *e,
copy = evas_event_list_copy(e->pointer.object.in); copy = evas_event_list_copy(e->pointer.object.in);
EINA_LIST_FOREACH(copy, l, obj) EINA_LIST_FOREACH(copy, l, obj)
{ {
if (((evas_object_clippers_is_visible(obj)) || if ((e->events_frozen <= 0) &&
(obj->mouse_grabbed)) && (evas_object_clippers_is_visible(obj) || obj->mouse_grabbed) &&
(!evas_event_passes_through(obj)) && (!evas_event_passes_through(obj)) &&
(!evas_event_freezes_through(obj)) && (!evas_event_freezes_through(obj)) &&
(!obj->clip.clipees)) (!obj->clip.clipees))
@ -1102,7 +1102,6 @@ evas_event_feed_multi_move(Evas *e,
ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
if (y != ev.cur.canvas.y) if (y != ev.cur.canvas.y)
ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
if (e->events_frozen <= 0)
evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev); evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev);
} }
if (e->delete_me) break; if (e->delete_me) break;
@ -1146,15 +1145,16 @@ evas_event_feed_multi_move(Evas *e,
/* in list */ /* in list */
// FIXME: i don't think we need this // FIXME: i don't think we need this
// evas_object_clip_recalc(obj); // evas_object_clip_recalc(obj);
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) && if ((e->events_frozen <= 0) &&
((evas_object_clippers_is_visible(obj)) || evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
(obj->mouse_grabbed)) && (evas_object_clippers_is_visible(obj) ||
(eina_list_data_find(ins, obj)) && obj->mouse_grabbed) &&
eina_list_data_find(ins, obj) &&
(!evas_event_passes_through(obj)) && (!evas_event_passes_through(obj)) &&
(!evas_event_freezes_through(obj)) && (!evas_event_freezes_through(obj)) &&
(!obj->clip.clipees) && (!obj->clip.clipees) &&
((!obj->precise_is_inside) || ((!obj->precise_is_inside) || evas_object_is_inside(obj, x, y))
(evas_object_is_inside(obj, x, y)))) )
{ {
ev.cur.canvas.x = x; ev.cur.canvas.x = x;
ev.cur.canvas.y = y; ev.cur.canvas.y = y;
@ -1165,7 +1165,6 @@ evas_event_feed_multi_move(Evas *e,
ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
if (y != ev.cur.canvas.y) if (y != ev.cur.canvas.y)
ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
if (e->events_frozen <= 0)
evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev); evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev);
} }
if (e->delete_me) break; if (e->delete_me) break;

View File

@ -1130,7 +1130,8 @@ evas_object_top_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool i
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj) EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{ {
if (obj->delete_me) continue; if (obj->delete_me) continue;
if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue; if ((!include_pass_events_objects) &&
(evas_event_passes_through(obj))) continue;
if ((!include_hidden_objects) && (!obj->cur.visible)) continue; if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
evas_object_clip_recalc(obj); evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) && if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
@ -1144,8 +1145,8 @@ evas_object_top_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool i
EAPI Evas_Object * EAPI Evas_Object *
evas_object_top_at_pointer_get(const Evas *e) evas_object_top_at_pointer_get(const Evas *e)
{ {
//// return evas_object_top_at_xy_get(e, e->pointer.canvas_x, e->pointer.canvas_y, 0, 0); return evas_object_top_at_xy_get(e, e->pointer.x, e->pointer.y, EINA_TRUE,
return evas_object_top_at_xy_get(e, e->pointer.x, e->pointer.y, 1, 1); EINA_TRUE);
} }
EAPI Evas_Object * EAPI Evas_Object *
@ -1174,7 +1175,8 @@ evas_object_top_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj) EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{ {
if (obj->delete_me) continue; if (obj->delete_me) continue;
if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue; if ((!include_pass_events_objects) &&
(evas_event_passes_through(obj))) continue;
if ((!include_hidden_objects) && (!obj->cur.visible)) continue; if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
evas_object_clip_recalc(obj); evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) && if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
@ -1206,7 +1208,8 @@ evas_objects_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool incl
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj) EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{ {
if (obj->delete_me) continue; if (obj->delete_me) continue;
if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue; if ((!include_pass_events_objects) &&
(evas_event_passes_through(obj))) continue;
if ((!include_hidden_objects) && (!obj->cur.visible)) continue; if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
evas_object_clip_recalc(obj); evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) && if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
@ -1256,7 +1259,8 @@ evas_objects_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Co
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj) EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{ {
if (obj->delete_me) continue; if (obj->delete_me) continue;
if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue; if ((!include_pass_events_objects) &&
(evas_event_passes_through(obj))) continue;
if ((!include_hidden_objects) && (!obj->cur.visible)) continue; if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
evas_object_clip_recalc(obj); evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) && if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&

View File

@ -54,8 +54,7 @@ evas_object_raise(Evas_Object *obj)
else else
{ {
if (obj->in_layer) if (obj->in_layer)
obj->layer->objects = (Evas_Object *)eina_inlist_demote(EINA_INLIST_GET(obj->layer->objects), obj->layer->objects = (Evas_Object *)eina_inlist_demote(EINA_INLIST_GET(obj->layer->objects), EINA_INLIST_GET(obj));
EINA_INLIST_GET(obj));
} }
if (obj->clip.clipees) if (obj->clip.clipees)
{ {
@ -66,23 +65,20 @@ evas_object_raise(Evas_Object *obj)
obj->restack = EINA_TRUE; obj->restack = EINA_TRUE;
evas_object_change(obj); evas_object_change(obj);
evas_object_inform_call_restack(obj); evas_object_inform_call_restack(obj);
if (obj->layer->evas->events_frozen <= 0) if (obj->layer->evas->events_frozen > 0) return;
if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
{ {
if ((!evas_event_passes_through(obj)) && if (!obj->smart.smart)
(!evas_event_freezes_through(obj)))
{ {
if (!obj->smart.smart) if (evas_object_is_in_output_rect(obj,
{
if (evas_object_is_in_output_rect(obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1) &&
obj->cur.visible)
evas_event_feed_mouse_move(obj->layer->evas,
obj->layer->evas->pointer.x, obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp, 1, 1) && obj->cur.visible)
NULL); evas_event_feed_mouse_move(obj->layer->evas,
} obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
} }
} }
} }
@ -116,23 +112,20 @@ evas_object_lower(Evas_Object *obj)
obj->restack = EINA_TRUE; obj->restack = EINA_TRUE;
evas_object_change(obj); evas_object_change(obj);
evas_object_inform_call_restack(obj); evas_object_inform_call_restack(obj);
if (obj->layer->evas->events_frozen <= 0) if (obj->layer->evas->events_frozen > 0) return;
if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
{ {
if ((!evas_event_passes_through(obj)) && if (!obj->smart.smart)
(!evas_event_freezes_through(obj)))
{ {
if (!obj->smart.smart) if (evas_object_is_in_output_rect(obj,
{
if (evas_object_is_in_output_rect(obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1) &&
obj->cur.visible)
evas_event_feed_mouse_move(obj->layer->evas,
obj->layer->evas->pointer.x, obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp, 1, 1) && obj->cur.visible)
NULL); evas_event_feed_mouse_move(obj->layer->evas,
} obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
} }
} }
} }
@ -197,23 +190,20 @@ evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
obj->restack = EINA_TRUE; obj->restack = EINA_TRUE;
evas_object_change(obj); evas_object_change(obj);
evas_object_inform_call_restack(obj); evas_object_inform_call_restack(obj);
if (obj->layer->evas->events_frozen <= 0) if (obj->layer->evas->events_frozen > 0) return;
if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
{ {
if ((!evas_event_passes_through(obj)) && if (!obj->smart.smart)
(!evas_event_freezes_through(obj)))
{ {
if (!obj->smart.smart) if (evas_object_is_in_output_rect(obj,
{
if (evas_object_is_in_output_rect(obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1) &&
obj->cur.visible)
evas_event_feed_mouse_move(obj->layer->evas,
obj->layer->evas->pointer.x, obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp, 1, 1) && obj->cur.visible)
NULL); evas_event_feed_mouse_move(obj->layer->evas,
} obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
} }
} }
} }
@ -278,23 +268,20 @@ evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
obj->restack = EINA_TRUE; obj->restack = EINA_TRUE;
evas_object_change(obj); evas_object_change(obj);
evas_object_inform_call_restack(obj); evas_object_inform_call_restack(obj);
if (obj->layer->evas->events_frozen <= 0) if (obj->layer->evas->events_frozen > 0) return;
if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
{ {
if ((!evas_event_passes_through(obj)) && if (!obj->smart.smart)
(!evas_event_freezes_through(obj)))
{ {
if (!obj->smart.smart) if (evas_object_is_in_output_rect(obj,
{
if (evas_object_is_in_output_rect(obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1) &&
obj->cur.visible)
evas_event_feed_mouse_move(obj->layer->evas,
obj->layer->evas->pointer.x, obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp, 1, 1) && obj->cur.visible)
NULL); evas_event_feed_mouse_move(obj->layer->evas,
} obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
} }
} }
} }

View File

@ -86,7 +86,6 @@ evas_event_freezes_through(Evas_Object *obj)
static inline int static inline int
evas_event_passes_through(Evas_Object *obj) evas_event_passes_through(Evas_Object *obj)
{ {
if (obj->layer->evas->events_frozen > 0) return 1;
if (obj->pass_events) return 1; if (obj->pass_events) return 1;
if (obj->parent_cache.pass_events_valid) if (obj->parent_cache.pass_events_valid)
return obj->parent_cache.pass_events; return obj->parent_cache.pass_events;