forked from enlightenment/efl
evas: Avoid useless calls to eo_data_scope_get
Use an internal variant of the function for evas when we already have the protected data pointer.
This commit is contained in:
parent
9dc0a15499
commit
05cc5ab940
|
@ -332,7 +332,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob
|
|||
}
|
||||
|
||||
if (_efl_canvas_object_clip_set_block(eo_obj, obj, eo_clip, clip)) return;
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, eo_clip)) return;
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, eo_clip)) return;
|
||||
|
||||
if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class &&
|
||||
obj->smart.smart->smart_class->clip_set)
|
||||
|
@ -430,7 +430,7 @@ static void
|
|||
_clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
||||
{
|
||||
if (_efl_canvas_object_clip_unset_block(eo_obj, obj)) return;
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, NULL)) return;
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, NULL)) return;
|
||||
if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class &&
|
||||
obj->smart.smart->smart_class->clip_unset)
|
||||
{
|
||||
|
|
|
@ -134,9 +134,8 @@ _efl_canvas_object_seat_focus_del(Eo *eo_obj,
|
|||
{
|
||||
if (dev != seat)
|
||||
continue;
|
||||
if (_evas_object_intercept_call(eo_obj,
|
||||
EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET,
|
||||
1, EINA_FALSE))
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET,
|
||||
1, EINA_FALSE))
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
@ -175,8 +174,8 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
|
|||
if (_already_focused(obj->focused_by_seats, seat))
|
||||
goto end;
|
||||
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET,
|
||||
1, EINA_TRUE))
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET,
|
||||
1, EINA_TRUE))
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
|
|
@ -216,15 +216,13 @@ evas_object_layer_set(Evas_Object *obj, short l)
|
|||
}
|
||||
|
||||
EOLIAN void
|
||||
_efl_canvas_object_efl_gfx_stack_layer_set(Eo *eo_obj,
|
||||
Evas_Object_Protected_Data *obj,
|
||||
short l)
|
||||
_efl_canvas_object_efl_gfx_stack_layer_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, short l)
|
||||
{
|
||||
Evas *eo_e;
|
||||
|
||||
if (obj->delete_me) return;
|
||||
evas_object_async_block(obj);
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_LAYER_SET, 1, l)) return;
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_LAYER_SET, 1, l)) return;
|
||||
if (obj->smart.parent) return;
|
||||
if (obj->cur->layer == l)
|
||||
{
|
||||
|
|
|
@ -82,31 +82,24 @@ EVAS_OBJECT_INTERCEPT_CALL(focus_set, (COMMON_ARGS, int focus), UNPACK_ARG1(fo
|
|||
EVAS_OBJECT_INTERCEPT_CALL(color_set, (COMMON_ARGS, int r, int g, int b, int a), UNPACK_ARG4(r, g, b, a))
|
||||
EVAS_OBJECT_INTERCEPT_CALL(clip_set, (COMMON_ARGS, Evas_Object *clip), UNPACK_ARG1(clip))
|
||||
|
||||
|
||||
/* This is a legacy-only compatibility function.
|
||||
* Made public for other parts of EFL (elm, ecore_evas).
|
||||
*/
|
||||
EWAPI Eina_Bool
|
||||
_evas_object_intercept_call(Evas_Object *eo_obj, Evas_Object_Intercept_Cb_Type cb_type,
|
||||
int internal, ...)
|
||||
static Eina_Bool
|
||||
_evas_object_intercept_call_internal(Evas_Object *eo_obj,
|
||||
Evas_Object_Protected_Data *obj,
|
||||
Evas_Object_Intercept_Cb_Type cb_type,
|
||||
int internal, va_list args)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
Eina_Bool blocked = 0;
|
||||
Evas_Object *eo_other;
|
||||
int r, g, b, a, i, j;
|
||||
va_list args;
|
||||
|
||||
EVAS_OBJECT_DATA_ALIVE_CHECK(obj, 1);
|
||||
evas_object_async_block(obj);
|
||||
|
||||
va_start(args, internal);
|
||||
|
||||
switch (cb_type)
|
||||
{
|
||||
case EVAS_OBJECT_INTERCEPT_CB_VISIBLE:
|
||||
i = !!va_arg(args, int);
|
||||
if (i == obj->cur->visible) goto end_block;
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (i == obj->cur->visible) return 1;
|
||||
if (!obj->interceptors) return 0;
|
||||
if (i) blocked = evas_object_intercept_call_show(eo_obj, obj);
|
||||
else blocked = evas_object_intercept_call_hide(eo_obj, obj);
|
||||
break;
|
||||
|
@ -116,7 +109,7 @@ _evas_object_intercept_call(Evas_Object *eo_obj, Evas_Object_Intercept_Cb_Type c
|
|||
{
|
||||
WRN("evas_object_move() called on object %p (%s) in the middle "
|
||||
"of moving the same object", eo_obj, efl_class_name_get(eo_obj));
|
||||
goto end_block;
|
||||
return 1;
|
||||
}
|
||||
i = va_arg(args, int);
|
||||
j = va_arg(args, int);
|
||||
|
@ -133,47 +126,47 @@ _evas_object_intercept_call(Evas_Object *eo_obj, Evas_Object_Intercept_Cb_Type c
|
|||
i = va_arg(args, int);
|
||||
j = va_arg(args, int);
|
||||
if (_efl_canvas_object_efl_gfx_size_set_block(eo_obj, obj, i, j, internal))
|
||||
goto end_block;
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
return 1;
|
||||
if (!obj->interceptors) return 0;
|
||||
blocked = evas_object_intercept_call_resize(eo_obj, obj, i, j);
|
||||
break;
|
||||
|
||||
case EVAS_OBJECT_INTERCEPT_CB_RAISE:
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
blocked = evas_object_intercept_call_raise(eo_obj, obj);
|
||||
break;
|
||||
|
||||
case EVAS_OBJECT_INTERCEPT_CB_LOWER:
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
blocked = evas_object_intercept_call_lower(eo_obj, obj);
|
||||
break;
|
||||
|
||||
case EVAS_OBJECT_INTERCEPT_CB_STACK_ABOVE:
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
eo_other = va_arg(args, Evas_Object *);
|
||||
blocked = evas_object_intercept_call_stack_above(eo_obj, obj, eo_other);
|
||||
break;
|
||||
|
||||
case EVAS_OBJECT_INTERCEPT_CB_STACK_BELOW:
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
eo_other = va_arg(args, Evas_Object *);
|
||||
blocked = evas_object_intercept_call_stack_below(eo_obj, obj, eo_other);
|
||||
break;
|
||||
|
||||
case EVAS_OBJECT_INTERCEPT_CB_LAYER_SET:
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
i = va_arg(args, int);
|
||||
blocked = evas_object_intercept_call_layer_set(eo_obj, obj, i);
|
||||
break;
|
||||
|
||||
case EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET:
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
i = va_arg(args, int);
|
||||
blocked = evas_object_intercept_call_focus_set(eo_obj, obj, !!i);
|
||||
break;
|
||||
|
||||
case EVAS_OBJECT_INTERCEPT_CB_COLOR_SET:
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
r = va_arg(args, int);
|
||||
g = va_arg(args, int);
|
||||
b = va_arg(args, int);
|
||||
|
@ -188,9 +181,9 @@ _evas_object_intercept_call(Evas_Object *eo_obj, Evas_Object_Intercept_Cb_Type c
|
|||
if (!internal)
|
||||
{
|
||||
if (_efl_canvas_object_clip_set_block(eo_obj, obj, eo_other, NULL))
|
||||
goto end_block;
|
||||
return 1;
|
||||
}
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
blocked = evas_object_intercept_call_clip_set(eo_obj, obj, eo_other);
|
||||
}
|
||||
else
|
||||
|
@ -198,24 +191,52 @@ _evas_object_intercept_call(Evas_Object *eo_obj, Evas_Object_Intercept_Cb_Type c
|
|||
if (!internal)
|
||||
{
|
||||
if (_efl_canvas_object_clip_unset_block(eo_obj, obj))
|
||||
goto end_block;
|
||||
return 1;
|
||||
}
|
||||
if (!obj->interceptors) goto end_noblock;
|
||||
if (!obj->interceptors) return 0;
|
||||
blocked = evas_object_intercept_call_clip_unset(eo_obj, obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
return blocked;
|
||||
}
|
||||
|
||||
end_block:
|
||||
va_end(args);
|
||||
return 1;
|
||||
/* This is a legacy-only compatibility function.
|
||||
* Made public for other parts of EFL (elm, ecore_evas).
|
||||
*/
|
||||
EWAPI Eina_Bool
|
||||
_evas_object_intercept_call(Evas_Object *eo_obj, Evas_Object_Intercept_Cb_Type cb_type,
|
||||
int internal, ...)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
Eina_Bool ret;
|
||||
va_list args;
|
||||
|
||||
end_noblock:
|
||||
EVAS_OBJECT_DATA_ALIVE_CHECK(obj, 1);
|
||||
|
||||
va_start(args, internal);
|
||||
ret = _evas_object_intercept_call_internal(eo_obj, obj, cb_type, internal, args);
|
||||
va_end(args);
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
_evas_object_intercept_call_evas(Evas_Object_Protected_Data *obj,
|
||||
Evas_Object_Intercept_Cb_Type cb_type,
|
||||
int internal, ...)
|
||||
{
|
||||
Eina_Bool ret;
|
||||
va_list args;
|
||||
|
||||
EVAS_OBJECT_DATA_ALIVE_CHECK(obj, 1);
|
||||
|
||||
va_start(args, internal);
|
||||
ret = _evas_object_intercept_call_internal(obj->object, obj, cb_type, internal, args);
|
||||
va_end(args);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* public calls */
|
||||
|
|
|
@ -1143,7 +1143,7 @@ _efl_canvas_object_efl_gfx_position_set(Eo *eo_obj, Evas_Object_Protected_Data *
|
|||
Eina_Bool source_invisible = EINA_FALSE;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 1, x, y))
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 1, x, y))
|
||||
return;
|
||||
|
||||
Evas_Map *map;
|
||||
|
@ -1230,7 +1230,7 @@ _efl_canvas_object_efl_gfx_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|||
if (w < 0) w = 0;
|
||||
if (h < 0) h = 0;
|
||||
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 1, w, h))
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 1, w, h))
|
||||
return;
|
||||
|
||||
if (!(obj->layer->evas->is_frozen))
|
||||
|
@ -1818,7 +1818,7 @@ EOLIAN static void
|
|||
_efl_canvas_object_efl_gfx_visible_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
||||
Eina_Bool vis)
|
||||
{
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 1, vis))
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 1, vis))
|
||||
return;
|
||||
|
||||
if (vis) _show(eo_obj, obj);
|
||||
|
@ -1850,7 +1850,7 @@ _efl_canvas_object_efl_gfx_color_set(Eo *eo_obj, Evas_Object_Protected_Data *obj
|
|||
if (EVAS_COLOR_SANITIZE(r, g, b, a))
|
||||
ERR("Evas only handles premultiplied colors (0 <= R,G,B <= A <= 255)");
|
||||
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_COLOR_SET, 1, r, g, b, a)) return;
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_COLOR_SET, 1, r, g, b, a)) return;
|
||||
if ((obj->cur->color.r == r) &&
|
||||
(obj->cur->color.g == g) &&
|
||||
(obj->cur->color.b == b) &&
|
||||
|
|
|
@ -46,8 +46,8 @@ evas_object_raise(Evas_Object *obj)
|
|||
EOLIAN void
|
||||
_efl_canvas_object_efl_gfx_stack_raise(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
||||
{
|
||||
evas_object_async_block(obj);
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_RAISE, 1)) return;
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_RAISE, 1))
|
||||
return;
|
||||
|
||||
if (!((EINA_INLIST_GET(obj))->next))
|
||||
{
|
||||
|
@ -95,8 +95,8 @@ evas_object_lower(Evas_Object *obj)
|
|||
EOLIAN void
|
||||
_efl_canvas_object_efl_gfx_stack_lower(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
||||
{
|
||||
evas_object_async_block(obj);
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_LOWER, 1)) return;
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_LOWER, 1))
|
||||
return;
|
||||
|
||||
if (!((EINA_INLIST_GET(obj))->prev))
|
||||
{
|
||||
|
@ -145,14 +145,13 @@ evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
|
|||
EOLIAN void
|
||||
_efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Stack *eo_above)
|
||||
{
|
||||
evas_object_async_block(obj);
|
||||
if (!eo_above)
|
||||
{
|
||||
evas_object_raise(eo_obj);
|
||||
return;
|
||||
}
|
||||
if (eo_obj == eo_above) return;
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_STACK_ABOVE, 1, eo_above)) return;
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_STACK_ABOVE, 1, eo_above)) return;
|
||||
Evas_Object_Protected_Data *above = efl_data_scope_get(eo_above, EFL_CANVAS_OBJECT_CLASS);
|
||||
if ((EINA_INLIST_GET(obj))->prev == EINA_INLIST_GET(above))
|
||||
{
|
||||
|
@ -223,14 +222,13 @@ evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
|
|||
EOLIAN void
|
||||
_efl_canvas_object_efl_gfx_stack_stack_below(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Stack *eo_below)
|
||||
{
|
||||
evas_object_async_block(obj);
|
||||
if (!eo_below)
|
||||
{
|
||||
evas_object_lower(eo_obj);
|
||||
return;
|
||||
}
|
||||
if (eo_obj == eo_below) return;
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_STACK_BELOW, 1, eo_below)) return;
|
||||
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_STACK_BELOW, 1, eo_below)) return;
|
||||
Evas_Object_Protected_Data *below = efl_data_scope_get(eo_below, EFL_CANVAS_OBJECT_CLASS);
|
||||
if ((EINA_INLIST_GET(obj))->next == EINA_INLIST_GET(below))
|
||||
{
|
||||
|
|
|
@ -1729,6 +1729,8 @@ void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t,
|
|||
void _evas_object_text_rehint(Evas_Object *obj);
|
||||
void _evas_object_textblock_rehint(Evas_Object *obj);
|
||||
|
||||
Eina_Bool _evas_object_intercept_call_evas(Evas_Object_Protected_Data *obj, Evas_Object_Intercept_Cb_Type cb_type, int internal, ...);
|
||||
|
||||
void evas_unref_queue_image_put(Evas_Public_Data *pd, void *image);
|
||||
void evas_unref_queue_glyph_put(Evas_Public_Data *pd, void *glyph);
|
||||
void evas_unref_queue_texts_put(Evas_Public_Data *pd, void *glyph);
|
||||
|
|
Loading…
Reference in New Issue