evas: move more canvas functions into evas_main.c

typechecking is an important part of compilation
This commit is contained in:
Mike Blumenkrantz 2018-02-14 21:14:52 -05:00
parent 4b91654e5f
commit 0a9bb2543f
2 changed files with 198 additions and 198 deletions

View File

@ -1380,6 +1380,204 @@ _evas_pointer_list_in_rect_get(Evas_Public_Data *edata, Evas_Object *obj,
return list;
}
static Eina_Inlist *
get_layer_objects(Evas_Layer *l)
{
if ((!l) || (!l->objects)) return NULL;
return (EINA_INLIST_GET(l->objects));
}
EOLIAN Evas_Object*
_evas_canvas_object_top_at_xy_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Evas_Layer *lay;
int xx, yy;
xx = x;
yy = y;
//// xx = evas_coord_world_x_to_screen(eo_e, x);
//// yy = evas_coord_world_y_to_screen(eo_e, y);
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
Evas_Object *eo_obj;
Evas_Object_Protected_Data *obj;
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{
eo_obj = obj->object;
if (obj->delete_me) continue;
if ((!include_pass_events_objects) &&
(evas_event_passes_through(eo_obj, obj))) continue;
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
(!obj->clip.clipees) &&
RECTS_INTERSECT(xx, yy, 1, 1,
obj->cur->geometry.x, obj->cur->geometry.y,
obj->cur->geometry.w, obj->cur->geometry.h))
return eo_obj;
}
}
return NULL;
}
EAPI Evas_Object *
evas_object_top_at_pointer_get(const Evas *eo_e)
{
Evas_Public_Data *e = efl_isa(eo_e, EVAS_CANVAS_CLASS) ?
efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS) : NULL;
if (!e) return NULL;
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
return evas_canvas_object_top_at_xy_get((Eo *)eo_e, pdata->seat->x, pdata->seat->y, EINA_TRUE, EINA_TRUE);
}
EOLIAN Evas_Object*
_evas_canvas_object_top_in_rectangle_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Evas_Layer *lay;
int xx, yy, ww, hh;
xx = x;
yy = y;
ww = w;
hh = h;
//// xx = evas_coord_world_x_to_screen(eo_e, x);
//// yy = evas_coord_world_y_to_screen(eo_e, y);
//// ww = evas_coord_world_x_to_screen(eo_e, w);
//// hh = evas_coord_world_y_to_screen(eo_e, h);
if (ww < 1) ww = 1;
if (hh < 1) hh = 1;
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
Evas_Object *eo_obj;
Evas_Object_Protected_Data *obj;
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{
eo_obj = obj->object;
if (obj->delete_me) continue;
if ((!include_pass_events_objects) &&
(evas_event_passes_through(eo_obj, obj))) continue;
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
(!obj->clip.clipees) &&
RECTS_INTERSECT(xx, yy, ww, hh,
obj->cur->geometry.x, obj->cur->geometry.y,
obj->cur->geometry.w, obj->cur->geometry.h)) return eo_obj;
}
}
return NULL;
}
EOLIAN Eina_List*
_evas_canvas_objects_at_xy_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Eina_List *in = NULL;
Evas_Layer *lay;
int xx, yy;
xx = x;
yy = y;
//// xx = evas_coord_world_x_to_screen(eo_e, x);
//// yy = evas_coord_world_y_to_screen(eo_e, y);
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
Evas_Object *eo_obj;
Evas_Object_Protected_Data *obj;
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{
eo_obj = obj->object;
// FIXME - Daniel: we don't know yet how to handle the next line
if (obj->delete_me) continue;
if ((!include_pass_events_objects) &&
(evas_event_passes_through(eo_obj, obj))) continue;
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
(!obj->clip.clipees))
{
// evas_object_is_in_output_rect is based on the clip which
// may be larger than the geometry (bounding box)
if (!RECTS_INTERSECT(xx, yy, 1, 1,
obj->cur->geometry.x,
obj->cur->geometry.y,
obj->cur->geometry.w,
obj->cur->geometry.h))
continue;
in = eina_list_prepend(in, eo_obj);
}
}
}
return in;
}
/**
* Retrieves the objects in the given rectangle region
* @param eo_e The given evas object.
* @param x The horizontal coordinate.
* @param y The vertical coordinate.
* @param w The width size.
* @param h The height size.
* @param include_pass_events_objects Boolean Flag to include or not pass events objects
* @param include_hidden_objects Boolean Flag to include or not hidden objects
* @return The list of evas object in the rectangle region.
*
*/
EOLIAN Eina_List*
_evas_canvas_objects_in_rectangle_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Eina_List *in = NULL;
Evas_Layer *lay;
int xx, yy, ww, hh;
xx = x;
yy = y;
ww = w;
hh = h;
//// xx = evas_coord_world_x_to_screen(eo_e, x);
//// yy = evas_coord_world_y_to_screen(eo_e, y);
//// ww = evas_coord_world_x_to_screen(eo_e, w);
//// hh = evas_coord_world_y_to_screen(eo_e, h);
if (ww < 1) ww = 1;
if (hh < 1) hh = 1;
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
Evas_Object *eo_obj;
Evas_Object_Protected_Data *obj;
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{
eo_obj = obj->object;
// FIXME - Daniel: we don't know yet how to handle the next line
if (obj->delete_me) continue;
if ((!include_pass_events_objects) &&
(evas_event_passes_through(eo_obj, obj))) continue;
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
(!obj->clip.clipees))
{
if (!RECTS_INTERSECT(xx, yy, ww, hh,
obj->cur->geometry.x,
obj->cur->geometry.y,
obj->cur->geometry.w,
obj->cur->geometry.h))
continue;
in = eina_list_prepend(in, eo_obj);
}
}
}
return in;
}
/* font related api */
EOLIAN static void

View File

@ -12,13 +12,6 @@ EVAS_MEMPOOL(_mp_sh);
#define MY_CLASS_NAME "Evas_Object"
static Eina_Inlist *
get_layer_objects(Evas_Layer *l)
{
if ((!l) || (!l->objects)) return NULL;
return (EINA_INLIST_GET(l->objects));
}
/* evas internal stuff */
static const Evas_Object_Proxy_Data default_proxy = {
NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0
@ -2348,197 +2341,6 @@ _efl_canvas_object_efl_loop_consumer_loop_get(Eo *eo_obj EINA_UNUSED, Evas_Objec
return efl_main_loop_get();
}
EOLIAN Evas_Object*
_evas_canvas_object_top_at_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Evas_Layer *lay;
int xx, yy;
xx = x;
yy = y;
//// xx = evas_coord_world_x_to_screen(eo_e, x);
//// yy = evas_coord_world_y_to_screen(eo_e, y);
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
Evas_Object *eo_obj;
Evas_Object_Protected_Data *obj;
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{
eo_obj = obj->object;
if (obj->delete_me) continue;
if ((!include_pass_events_objects) &&
(evas_event_passes_through(eo_obj, obj))) continue;
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
(!obj->clip.clipees) &&
RECTS_INTERSECT(xx, yy, 1, 1,
obj->cur->geometry.x, obj->cur->geometry.y,
obj->cur->geometry.w, obj->cur->geometry.h))
return eo_obj;
}
}
return NULL;
}
EAPI Evas_Object *
evas_object_top_at_pointer_get(const Evas *eo_e)
{
Evas_Public_Data *e = efl_isa(eo_e, EVAS_CANVAS_CLASS) ?
efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS) : NULL;
if (!e) return NULL;
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
return evas_canvas_object_top_at_xy_get((Eo *)eo_e, pdata->seat->x, pdata->seat->y, EINA_TRUE, EINA_TRUE);
}
EOLIAN Evas_Object*
_evas_canvas_object_top_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Evas_Layer *lay;
int xx, yy, ww, hh;
xx = x;
yy = y;
ww = w;
hh = h;
//// xx = evas_coord_world_x_to_screen(eo_e, x);
//// yy = evas_coord_world_y_to_screen(eo_e, y);
//// ww = evas_coord_world_x_to_screen(eo_e, w);
//// hh = evas_coord_world_y_to_screen(eo_e, h);
if (ww < 1) ww = 1;
if (hh < 1) hh = 1;
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
Evas_Object *eo_obj;
Evas_Object_Protected_Data *obj;
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{
eo_obj = obj->object;
if (obj->delete_me) continue;
if ((!include_pass_events_objects) &&
(evas_event_passes_through(eo_obj, obj))) continue;
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
(!obj->clip.clipees) &&
RECTS_INTERSECT(xx, yy, ww, hh,
obj->cur->geometry.x, obj->cur->geometry.y,
obj->cur->geometry.w, obj->cur->geometry.h)) return eo_obj;
}
}
return NULL;
}
EOLIAN Eina_List*
_evas_canvas_objects_at_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Eina_List *in = NULL;
Evas_Layer *lay;
int xx, yy;
xx = x;
yy = y;
//// xx = evas_coord_world_x_to_screen(eo_e, x);
//// yy = evas_coord_world_y_to_screen(eo_e, y);
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
Evas_Object *eo_obj;
Evas_Object_Protected_Data *obj;
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{
eo_obj = obj->object;
// FIXME - Daniel: we don't know yet how to handle the next line
if (obj->delete_me) continue;
if ((!include_pass_events_objects) &&
(evas_event_passes_through(eo_obj, obj))) continue;
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
(!obj->clip.clipees))
{
// evas_object_is_in_output_rect is based on the clip which
// may be larger than the geometry (bounding box)
if (!RECTS_INTERSECT(xx, yy, 1, 1,
obj->cur->geometry.x,
obj->cur->geometry.y,
obj->cur->geometry.w,
obj->cur->geometry.h))
continue;
in = eina_list_prepend(in, eo_obj);
}
}
}
return in;
}
/**
* Retrieves the objects in the given rectangle region
* @param eo_e The given evas object.
* @param x The horizontal coordinate.
* @param y The vertical coordinate.
* @param w The width size.
* @param h The height size.
* @param include_pass_events_objects Boolean Flag to include or not pass events objects
* @param include_hidden_objects Boolean Flag to include or not hidden objects
* @return The list of evas object in the rectangle region.
*
*/
EOLIAN Eina_List*
_evas_canvas_objects_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
{
Eina_List *in = NULL;
Evas_Layer *lay;
int xx, yy, ww, hh;
xx = x;
yy = y;
ww = w;
hh = h;
//// xx = evas_coord_world_x_to_screen(eo_e, x);
//// yy = evas_coord_world_y_to_screen(eo_e, y);
//// ww = evas_coord_world_x_to_screen(eo_e, w);
//// hh = evas_coord_world_y_to_screen(eo_e, h);
if (ww < 1) ww = 1;
if (hh < 1) hh = 1;
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
Evas_Object *eo_obj;
Evas_Object_Protected_Data *obj;
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
{
eo_obj = obj->object;
// FIXME - Daniel: we don't know yet how to handle the next line
if (obj->delete_me) continue;
if ((!include_pass_events_objects) &&
(evas_event_passes_through(eo_obj, obj))) continue;
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
(!obj->clip.clipees))
{
if (!RECTS_INTERSECT(xx, yy, ww, hh,
obj->cur->geometry.x,
obj->cur->geometry.y,
obj->cur->geometry.w,
obj->cur->geometry.h))
continue;
in = eina_list_prepend(in, eo_obj);
}
}
}
return in;
}
EOLIAN static void
_efl_canvas_object_type_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, const char *type)
{