2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
#include "evas_private.h"
|
|
|
|
|
2010-11-26 02:01:18 -08:00
|
|
|
EVAS_MEMPOOL(_mp_obj);
|
|
|
|
EVAS_MEMPOOL(_mp_sh);
|
|
|
|
|
2008-10-17 04:23:18 -07:00
|
|
|
static Eina_Inlist *
|
2009-11-27 01:51:08 -08:00
|
|
|
get_layer_objects(Evas_Layer *l)
|
2006-01-22 22:54:04 -08:00
|
|
|
{
|
2010-11-26 02:01:18 -08:00
|
|
|
if ((!l) || (!l->objects)) return NULL;
|
2009-11-27 01:51:08 -08:00
|
|
|
return (EINA_INLIST_GET(l->objects));
|
2006-01-22 22:54:04 -08:00
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* evas internal stuff */
|
|
|
|
Evas_Object *
|
2010-08-18 07:44:23 -07:00
|
|
|
evas_object_new(Evas *e __UNUSED__)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
2010-11-26 02:01:18 -08:00
|
|
|
EVAS_MEMPOOL_INIT(_mp_obj, "evas_object", Evas_Object, 512, NULL);
|
|
|
|
obj = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!obj) return NULL;
|
2010-11-26 02:01:18 -08:00
|
|
|
EVAS_MEMPOOL_PREP(_mp_obj, obj, Evas_Object);
|
2011-06-08 19:45:59 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->magic = MAGIC_OBJ;
|
2008-09-09 07:14:26 -07:00
|
|
|
obj->cur.scale = 1.0;
|
|
|
|
obj->prev.scale = 1.0;
|
2011-12-26 15:09:45 -08:00
|
|
|
obj->is_frame = EINA_FALSE;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2012-05-16 05:59:33 -07:00
|
|
|
void
|
|
|
|
evas_object_change_reset(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
obj->changed = EINA_FALSE;
|
|
|
|
obj->changed_move = EINA_FALSE;
|
2012-05-18 00:17:34 -07:00
|
|
|
obj->changed_color = EINA_FALSE;
|
2012-05-16 05:59:33 -07:00
|
|
|
obj->changed_map = EINA_FALSE;
|
|
|
|
obj->changed_pchange = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
|
|
|
evas_object_free(Evas_Object *obj, int clean_layer)
|
|
|
|
{
|
2005-10-26 19:44:36 -07:00
|
|
|
int was_smart_child = 0;
|
2006-07-30 07:30:24 -07:00
|
|
|
|
2011-06-02 03:40:43 -07:00
|
|
|
#if 0 // filtering disabled
|
2011-04-20 01:06:59 -07:00
|
|
|
evas_filter_free(obj);
|
2011-06-08 19:45:59 -07:00
|
|
|
#endif
|
2011-10-02 20:28:52 -07:00
|
|
|
if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(obj, NULL);
|
2010-03-01 06:50:56 -08:00
|
|
|
evas_object_map_set(obj, NULL);
|
2003-01-05 04:55:37 -08:00
|
|
|
evas_object_grabs_cleanup(obj);
|
2002-12-14 16:33:57 -08:00
|
|
|
evas_object_intercept_cleanup(obj);
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent) was_smart_child = 1;
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_smart_cleanup(obj);
|
|
|
|
obj->func->free(obj);
|
2005-10-26 19:44:36 -07:00
|
|
|
if (!was_smart_child) evas_object_release(obj, clean_layer);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (obj->clip.clipees)
|
2008-10-21 09:31:05 -07:00
|
|
|
eina_list_free(obj->clip.clipees);
|
2009-04-14 20:14:41 -07:00
|
|
|
evas_object_clip_changes_clean(obj);
|
2007-02-21 13:43:45 -08:00
|
|
|
evas_object_event_callback_all_del(obj);
|
2002-12-14 16:33:57 -08:00
|
|
|
evas_object_event_callback_cleanup(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
while (obj->data.elements)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
Evas_Data_Node *node;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2011-06-08 19:45:59 -07:00
|
|
|
node = obj->data.elements->data;
|
|
|
|
obj->data.elements = eina_list_remove(obj->data.elements, node);
|
|
|
|
free(node);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
obj->magic = 0;
|
2010-11-26 02:01:18 -08:00
|
|
|
if (obj->size_hints)
|
|
|
|
{
|
|
|
|
EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints);
|
|
|
|
}
|
|
|
|
EVAS_MEMPOOL_FREE(_mp_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
evas_object_change(Evas_Object *obj)
|
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l;
|
2009-11-06 21:01:43 -08:00
|
|
|
Evas_Object *obj2;
|
2012-05-17 03:51:54 -07:00
|
|
|
Eina_Bool movch = EINA_FALSE;
|
|
|
|
|
|
|
|
if (obj->layer->evas->nochange) return;
|
|
|
|
obj->layer->evas->changed = EINA_TRUE;
|
2011-06-08 19:45:59 -07:00
|
|
|
|
2011-01-19 03:59:53 -08:00
|
|
|
if (obj->changed_move)
|
|
|
|
{
|
2012-05-17 03:51:54 -07:00
|
|
|
movch = EINA_TRUE;
|
2012-03-28 00:17:39 -07:00
|
|
|
obj->changed_move = EINA_FALSE;
|
2011-01-19 03:59:53 -08:00
|
|
|
}
|
2012-05-17 03:51:54 -07:00
|
|
|
|
|
|
|
if (obj->changed) return;
|
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
evas_render_object_recalc(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* set changed flag on all objects this one clips too */
|
2011-01-19 03:59:53 -08:00
|
|
|
if (!((movch) && (obj->is_static_clip)))
|
|
|
|
{
|
2012-03-28 00:17:39 -07:00
|
|
|
EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
|
2011-12-26 15:09:45 -08:00
|
|
|
evas_object_change(obj2);
|
2011-01-19 03:59:53 -08:00
|
|
|
}
|
2011-05-19 06:01:44 -07:00
|
|
|
EINA_LIST_FOREACH(obj->proxy.proxies, l, obj2)
|
|
|
|
{
|
|
|
|
evas_object_change(obj2);
|
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent) evas_object_change(obj->smart.parent);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
void
|
2009-04-15 06:40:37 -07:00
|
|
|
evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-12-26 15:09:45 -08:00
|
|
|
if (obj->smart.smart) return;
|
|
|
|
if (is_v == was_v) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (is_v)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_add_rect(rects,
|
|
|
|
obj->cur.cache.clip.x,
|
|
|
|
obj->cur.cache.clip.y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_add_rect(rects,
|
|
|
|
obj->prev.cache.clip.x,
|
|
|
|
obj->prev.cache.clip.y,
|
|
|
|
obj->prev.cache.clip.w,
|
|
|
|
obj->prev.cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
void
|
2009-04-15 06:40:37 -07:00
|
|
|
evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-12-26 15:09:45 -08:00
|
|
|
if (obj->smart.smart) return;
|
|
|
|
if (obj->cur.clipper == obj->prev.clipper) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
if ((obj->cur.clipper) && (obj->prev.clipper))
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
/* get difference rects between clippers */
|
|
|
|
evas_rects_return_difference_rects(rects,
|
|
|
|
obj->cur.clipper->cur.cache.clip.x,
|
|
|
|
obj->cur.clipper->cur.cache.clip.y,
|
|
|
|
obj->cur.clipper->cur.cache.clip.w,
|
|
|
|
obj->cur.clipper->cur.cache.clip.h,
|
|
|
|
obj->prev.clipper->prev.cache.clip.x,
|
|
|
|
obj->prev.clipper->prev.cache.clip.y,
|
|
|
|
obj->prev.clipper->prev.cache.clip.w,
|
|
|
|
obj->prev.clipper->prev.cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
else if (obj->cur.clipper)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_rects_return_difference_rects(rects,
|
|
|
|
obj->cur.geometry.x,
|
|
|
|
obj->cur.geometry.y,
|
|
|
|
obj->cur.geometry.w,
|
|
|
|
obj->cur.geometry.h,
|
2006-11-15 19:20:24 -08:00
|
|
|
//// rl = evas_rects_return_difference_rects(obj->cur.cache.geometry.x,
|
|
|
|
//// obj->cur.cache.geometry.y,
|
|
|
|
//// obj->cur.cache.geometry.w,
|
|
|
|
//// obj->cur.cache.geometry.h,
|
2011-06-08 19:45:59 -07:00
|
|
|
obj->cur.clipper->cur.cache.clip.x,
|
|
|
|
obj->cur.clipper->cur.cache.clip.y,
|
|
|
|
obj->cur.clipper->cur.cache.clip.w,
|
|
|
|
obj->cur.clipper->cur.cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
else if (obj->prev.clipper)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_rects_return_difference_rects(rects,
|
|
|
|
obj->prev.geometry.x,
|
|
|
|
obj->prev.geometry.y,
|
|
|
|
obj->prev.geometry.w,
|
|
|
|
obj->prev.geometry.h,
|
2006-11-15 19:20:24 -08:00
|
|
|
//// rl = evas_rects_return_difference_rects(obj->prev.cache.geometry.x,
|
|
|
|
//// obj->prev.cache.geometry.y,
|
|
|
|
//// obj->prev.cache.geometry.w,
|
|
|
|
//// obj->prev.cache.geometry.h,
|
2011-06-08 19:45:59 -07:00
|
|
|
obj->prev.clipper->prev.cache.clip.x,
|
|
|
|
obj->prev.clipper->prev.cache.clip.y,
|
|
|
|
obj->prev.clipper->prev.cache.clip.w,
|
|
|
|
obj->prev.clipper->prev.cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
void
|
2009-04-15 06:40:37 -07:00
|
|
|
evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-07-07 14:29:29 -07:00
|
|
|
evas_add_rect(rects,
|
2009-11-03 07:41:36 -08:00
|
|
|
obj->cur.cache.clip.x,
|
|
|
|
obj->cur.cache.clip.y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
evas_add_rect(rects,
|
|
|
|
obj->prev.cache.clip.x,
|
|
|
|
obj->prev.cache.clip.y,
|
|
|
|
obj->prev.cache.clip.w,
|
|
|
|
obj->prev.cache.clip.h);
|
2012-03-28 00:17:39 -07:00
|
|
|
/*
|
2009-11-03 07:41:36 -08:00
|
|
|
evas_add_rect(rects,
|
|
|
|
obj->cur.geometry.x,
|
|
|
|
obj->cur.geometry.y,
|
|
|
|
obj->cur.geometry.w,
|
|
|
|
obj->cur.geometry.h);
|
2006-11-15 19:20:24 -08:00
|
|
|
//// obj->cur.cache.geometry.x,
|
|
|
|
//// obj->cur.cache.geometry.y,
|
|
|
|
//// obj->cur.cache.geometry.w,
|
|
|
|
//// obj->cur.cache.geometry.h);
|
2009-11-03 07:41:36 -08:00
|
|
|
evas_add_rect(rects,
|
|
|
|
obj->prev.geometry.x,
|
|
|
|
obj->prev.geometry.y,
|
|
|
|
obj->prev.geometry.w,
|
|
|
|
obj->prev.geometry.h);
|
2006-11-15 19:20:24 -08:00
|
|
|
//// obj->prev.cache.geometry.x,
|
|
|
|
//// obj->prev.cache.geometry.y,
|
|
|
|
//// obj->prev.cache.geometry.w,
|
|
|
|
//// obj->prev.cache.geometry.h);
|
2009-11-03 07:41:36 -08:00
|
|
|
*/
|
2005-05-21 19:49:50 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2009-04-14 05:15:07 -07:00
|
|
|
void
|
|
|
|
evas_object_clip_changes_clean(Evas_Object *obj)
|
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2009-04-14 05:15:07 -07:00
|
|
|
|
2012-03-28 00:17:39 -07:00
|
|
|
EINA_LIST_FREE(obj->clip.changes, r)
|
2011-12-26 15:09:45 -08:00
|
|
|
eina_rectangle_free(r);
|
2009-04-14 05:15:07 -07:00
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
2012-01-19 08:49:47 -08:00
|
|
|
evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v __UNUSED__)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2002-11-08 00:02:15 -08:00
|
|
|
Evas_Object *clipper;
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l;
|
2008-07-07 14:29:29 -07:00
|
|
|
unsigned int i;
|
2009-04-15 06:40:37 -07:00
|
|
|
Eina_Array_Iterator it;
|
2008-07-07 14:29:29 -07:00
|
|
|
int x, y, w, h;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
if (obj->smart.smart) goto end;
|
2002-11-08 00:02:15 -08:00
|
|
|
/* FIXME: was_v isn't used... why? */
|
|
|
|
if (!obj->clip.clipees)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
|
|
|
|
{
|
|
|
|
/* get updates and clip to current clip */
|
|
|
|
x = r->x;
|
|
|
|
y = r->y;
|
|
|
|
w = r->w;
|
|
|
|
h = r->h;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
|
|
|
obj->cur.cache.clip.x,
|
|
|
|
obj->cur.cache.clip.y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
if ((w > 0) && (h > 0))
|
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
|
|
|
|
x, y, w, h);
|
|
|
|
/* get updates and clip to previous clip */
|
|
|
|
x = r->x;
|
|
|
|
y = r->y;
|
|
|
|
w = r->w;
|
|
|
|
h = r->h;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
|
|
|
obj->prev.cache.clip.x,
|
|
|
|
obj->prev.cache.clip.y,
|
|
|
|
obj->prev.cache.clip.w,
|
|
|
|
obj->prev.cache.clip.h);
|
|
|
|
if ((w > 0) && (h > 0))
|
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
|
|
|
|
x, y, w, h);
|
|
|
|
}
|
|
|
|
/* if the object is actually visible, take any parent clip changes */
|
|
|
|
if (is_v)
|
|
|
|
{
|
|
|
|
clipper = obj->cur.clipper;
|
|
|
|
while (clipper)
|
|
|
|
{
|
|
|
|
EINA_LIST_FOREACH(clipper->clip.changes, l, r)
|
|
|
|
{
|
|
|
|
/* get updates and clip to current clip */
|
|
|
|
x = r->x; y = r->y; w = r->w; h = r->h;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
|
|
|
obj->cur.cache.clip.x,
|
|
|
|
obj->cur.cache.clip.y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
if ((w > 0) && (h > 0))
|
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
|
|
|
|
x, y, w, h);
|
|
|
|
/* get updates and clip to previous clip */
|
|
|
|
x = r->x; y = r->y; w = r->w; h = r->h;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
|
|
|
obj->prev.cache.clip.x,
|
|
|
|
obj->prev.cache.clip.y,
|
|
|
|
obj->prev.cache.clip.w,
|
|
|
|
obj->prev.cache.clip.h);
|
|
|
|
if ((w > 0) && (h > 0))
|
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(obj->layer->evas->engine.data.output,
|
|
|
|
x, y, w, h);
|
|
|
|
}
|
|
|
|
clipper = clipper->cur.clipper;
|
|
|
|
}
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_object_clip_changes_clean(obj);
|
|
|
|
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
|
|
|
|
obj->clip.changes = eina_list_append(obj->clip.changes, r);
|
|
|
|
eina_array_clean(rects);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2008-07-07 14:29:29 -07:00
|
|
|
|
|
|
|
end:
|
2009-04-15 06:40:37 -07:00
|
|
|
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
|
2009-06-23 06:57:27 -07:00
|
|
|
eina_rectangle_free(r);
|
2009-04-15 06:40:37 -07:00
|
|
|
eina_array_clean(rects);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
if (obj->smart.smart) return 0;
|
|
|
|
/* assumes coords have been recalced */
|
|
|
|
if ((RECTS_INTERSECT(x, y, w, h,
|
2011-06-08 19:45:59 -07:00
|
|
|
obj->prev.cache.clip.x,
|
|
|
|
obj->prev.cache.clip.y,
|
|
|
|
obj->prev.cache.clip.w,
|
|
|
|
obj->prev.cache.clip.h)))
|
2002-11-08 00:02:15 -08:00
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
evas_object_was_opaque(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
if (obj->smart.smart) return 0;
|
2005-05-21 19:49:50 -07:00
|
|
|
if (obj->prev.cache.clip.a == 255)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->func->was_opaque)
|
|
|
|
return obj->func->was_opaque(obj);
|
|
|
|
return 1;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-07-23 07:22:57 -07:00
|
|
|
int
|
|
|
|
evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
|
|
|
if (obj->smart.smart) return 0;
|
|
|
|
if (obj->func->is_inside)
|
|
|
|
return obj->func->is_inside(obj, x, y);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
|
|
|
if (obj->smart.smart) return 0;
|
|
|
|
if (obj->func->was_inside)
|
|
|
|
return obj->func->was_inside(obj, x, y);
|
|
|
|
return 0;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
/* routines apps will call */
|
|
|
|
|
2011-03-08 04:23:37 -08:00
|
|
|
EAPI void
|
|
|
|
evas_object_ref(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj->ref++;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_unref(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->ref == 0) return;
|
|
|
|
obj->ref--;
|
|
|
|
if ((obj->del_ref) && (obj->ref == 0)) evas_object_del(obj);
|
|
|
|
}
|
|
|
|
|
2012-03-29 00:46:30 -07:00
|
|
|
EAPI int
|
|
|
|
evas_object_ref_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return obj->ref;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_del(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2006-10-15 07:39:16 -07:00
|
|
|
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return;
|
2006-07-12 17:26:25 -07:00
|
|
|
|
2011-03-08 04:23:37 -08:00
|
|
|
if (obj->ref > 0)
|
|
|
|
{
|
2012-03-28 00:17:39 -07:00
|
|
|
obj->del_ref = EINA_TRUE;
|
2011-03-08 04:23:37 -08:00
|
|
|
return;
|
|
|
|
}
|
2010-05-21 00:10:45 -07:00
|
|
|
|
2011-03-08 22:16:46 -08:00
|
|
|
evas_object_hide(obj);
|
|
|
|
if (obj->focused)
|
|
|
|
{
|
2012-03-28 00:17:39 -07:00
|
|
|
obj->focused = EINA_FALSE;
|
2011-06-08 19:45:59 -07:00
|
|
|
obj->layer->evas->focused = NULL;
|
|
|
|
_evas_object_event_new();
|
2011-12-14 22:23:53 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL, _evas_event_counter);
|
2011-03-08 22:16:46 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas);
|
|
|
|
}
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
2011-12-14 22:23:53 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_DEL, NULL, _evas_event_counter);
|
2010-05-04 08:58:10 -07:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas);
|
2011-09-24 21:43:02 -07:00
|
|
|
if (obj->mouse_grabbed > 0)
|
|
|
|
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
|
|
|
|
if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
|
|
|
|
obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
|
|
|
|
obj->mouse_grabbed = 0;
|
|
|
|
obj->mouse_in = 0;
|
2006-07-12 17:26:25 -07:00
|
|
|
if (obj->name) evas_object_name_set(obj, NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!obj->layer)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_object_free(obj, 1);
|
|
|
|
return;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2003-01-05 04:55:37 -08:00
|
|
|
evas_object_grabs_cleanup(obj);
|
2011-06-08 20:08:50 -07:00
|
|
|
while (obj->clip.clipees)
|
2011-02-09 10:39:54 -08:00
|
|
|
evas_object_clip_unset(obj->clip.clipees->data);
|
2011-02-06 20:27:48 -08:00
|
|
|
while (obj->proxy.proxies)
|
2011-02-09 10:39:54 -08:00
|
|
|
evas_object_image_source_unset(obj->proxy.proxies->data);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (obj->cur.clipper) evas_object_clip_unset(obj);
|
2009-10-28 01:59:01 -07:00
|
|
|
evas_object_map_set(obj, NULL);
|
2012-04-30 13:47:54 -07:00
|
|
|
if (obj->smart.smart) evas_object_smart_del(obj);
|
2010-03-04 06:48:21 -08:00
|
|
|
_evas_object_event_new();
|
2011-12-14 22:23:53 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL, _evas_event_counter);
|
2010-05-04 08:58:10 -07:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas);
|
2003-01-09 21:38:47 -08:00
|
|
|
evas_object_smart_cleanup(obj);
|
2004-03-07 18:42:08 -08:00
|
|
|
obj->delete_me = 1;
|
|
|
|
evas_object_change(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2012-05-01 00:31:42 -07:00
|
|
|
void
|
|
|
|
evas_object_update_bounding_box(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Eina_Bool propagate = EINA_FALSE;
|
2012-05-02 21:40:09 -07:00
|
|
|
Eina_Bool computeminmax = EINA_FALSE;
|
2012-05-01 00:31:42 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
Evas_Coord px, py, pw, ph;
|
2012-05-02 21:40:09 -07:00
|
|
|
Eina_Bool noclip;
|
2012-05-01 00:31:42 -07:00
|
|
|
|
|
|
|
if (!obj->smart.parent) return ;
|
|
|
|
if (obj->child_has_map) return ; /* Disable bounding box computation for this object and its parent */
|
|
|
|
/* We could also remove object that are not visible from the bounding box, use the clipping information
|
|
|
|
to reduce the bounding of the object they are clipping, but for the moment this will do it's jobs */
|
2012-05-02 21:40:09 -07:00
|
|
|
noclip = !(obj->clip.clipees || obj->is_static_clip);
|
2012-05-01 00:31:42 -07:00
|
|
|
|
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
|
|
|
x = obj->cur.bounding_box.x;
|
|
|
|
y = obj->cur.bounding_box.y;
|
|
|
|
w = obj->cur.bounding_box.w;
|
|
|
|
h = obj->cur.bounding_box.h;
|
|
|
|
px = obj->prev.bounding_box.x;
|
|
|
|
py = obj->prev.bounding_box.y;
|
|
|
|
pw = obj->prev.bounding_box.w;
|
|
|
|
ph = obj->prev.bounding_box.h;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x = obj->cur.geometry.x;
|
|
|
|
y = obj->cur.geometry.y;
|
|
|
|
w = obj->cur.geometry.w;
|
|
|
|
h = obj->cur.geometry.h;
|
|
|
|
px = obj->prev.geometry.x;
|
|
|
|
py = obj->prev.geometry.y;
|
|
|
|
pw = obj->prev.geometry.w;
|
|
|
|
ph = obj->prev.geometry.h;
|
|
|
|
}
|
|
|
|
|
2012-05-01 19:17:33 -07:00
|
|
|
/* We are not yet trying to find the smallest bounding box, but we want to find a good approximation quickly.
|
|
|
|
* That's why we initialiaze min and max search to geometry of the parent object.
|
|
|
|
*/
|
|
|
|
|
2012-05-02 20:58:27 -07:00
|
|
|
if (obj->smart.parent->cur.valid_bounding_box)
|
2012-05-01 00:31:42 -07:00
|
|
|
{
|
2012-05-02 20:58:27 -07:00
|
|
|
/* Update left limit */
|
2012-05-02 21:40:09 -07:00
|
|
|
if (noclip && x < obj->smart.parent->cur.bounding_box.x)
|
2012-05-01 00:31:42 -07:00
|
|
|
{
|
2012-05-02 20:58:27 -07:00
|
|
|
obj->smart.parent->cur.bounding_box.w += obj->smart.parent->cur.bounding_box.x - x;
|
|
|
|
obj->smart.parent->cur.bounding_box.x = x;
|
|
|
|
propagate = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if ((px == obj->smart.parent->prev.bounding_box.x && x > obj->smart.parent->cur.bounding_box.x)
|
2012-05-02 21:40:09 -07:00
|
|
|
|| (!noclip && x == obj->smart.parent->cur.bounding_box.x))
|
2012-05-02 20:58:27 -07:00
|
|
|
{
|
2012-05-02 21:40:09 -07:00
|
|
|
computeminmax = EINA_TRUE;
|
2012-05-01 00:31:42 -07:00
|
|
|
}
|
|
|
|
|
2012-05-02 20:58:27 -07:00
|
|
|
/* Update top limit */
|
2012-05-02 21:40:09 -07:00
|
|
|
if (noclip && y < obj->smart.parent->cur.bounding_box.y)
|
2012-05-01 00:31:42 -07:00
|
|
|
{
|
2012-05-02 20:58:27 -07:00
|
|
|
obj->smart.parent->cur.bounding_box.h += obj->smart.parent->cur.bounding_box.x - x;
|
|
|
|
obj->smart.parent->cur.bounding_box.y = y;
|
2012-05-01 00:31:42 -07:00
|
|
|
propagate = EINA_TRUE;
|
|
|
|
}
|
2012-05-02 20:58:27 -07:00
|
|
|
else if ((py == obj->smart.parent->prev.bounding_box.y && y > obj->smart.parent->cur.bounding_box.y)
|
2012-05-02 21:40:09 -07:00
|
|
|
|| (!noclip && y == obj->smart.parent->cur.bounding_box.y))
|
2012-05-02 20:58:27 -07:00
|
|
|
{
|
2012-05-02 21:40:09 -07:00
|
|
|
computeminmax = EINA_TRUE;
|
2012-05-01 00:31:42 -07:00
|
|
|
}
|
|
|
|
|
2012-05-02 20:58:27 -07:00
|
|
|
/* Update right limit */
|
2012-05-02 21:40:09 -07:00
|
|
|
if (noclip && x + w > obj->smart.parent->cur.bounding_box.x + obj->smart.parent->cur.bounding_box.w)
|
2012-05-01 00:31:42 -07:00
|
|
|
{
|
2012-05-02 20:58:27 -07:00
|
|
|
obj->smart.parent->cur.bounding_box.w = x + w - obj->smart.parent->cur.bounding_box.x;
|
2012-05-01 00:31:42 -07:00
|
|
|
propagate = EINA_TRUE;
|
|
|
|
}
|
2012-05-02 20:58:27 -07:00
|
|
|
else if ((px + pw == obj->smart.parent->prev.bounding_box.x + obj->smart.parent->prev.bounding_box.w &&
|
|
|
|
x + w < obj->smart.parent->cur.bounding_box.x + obj->smart.parent->cur.bounding_box.w)
|
2012-05-02 21:40:09 -07:00
|
|
|
|| (!noclip && x + w == obj->smart.parent->cur.bounding_box.x + obj->smart.parent->cur.bounding_box.w))
|
2012-05-02 20:58:27 -07:00
|
|
|
{
|
2012-05-02 21:40:09 -07:00
|
|
|
computeminmax = EINA_TRUE;
|
2012-05-01 00:31:42 -07:00
|
|
|
}
|
|
|
|
|
2012-05-02 20:58:27 -07:00
|
|
|
/* Update bottom limit */
|
2012-05-02 21:40:09 -07:00
|
|
|
if (noclip && y + h > obj->smart.parent->cur.bounding_box.y + obj->smart.parent->cur.bounding_box.h)
|
2012-05-01 00:31:42 -07:00
|
|
|
{
|
2012-05-02 20:58:27 -07:00
|
|
|
obj->smart.parent->cur.bounding_box.h = y + h - obj->smart.parent->cur.bounding_box.y;
|
2012-05-01 00:31:42 -07:00
|
|
|
propagate = EINA_TRUE;
|
|
|
|
}
|
2012-05-02 20:58:27 -07:00
|
|
|
else if ((py + ph == obj->smart.parent->prev.bounding_box.y + obj->smart.parent->prev.bounding_box.h &&
|
|
|
|
y + h < obj->smart.parent->cur.bounding_box.y + obj->smart.parent->cur.bounding_box.h) ||
|
2012-05-02 21:40:09 -07:00
|
|
|
(!noclip && y + h == obj->smart.parent->cur.bounding_box.y + obj->smart.parent->cur.bounding_box.h))
|
|
|
|
{
|
|
|
|
computeminmax = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (computeminmax)
|
2012-05-02 20:58:27 -07:00
|
|
|
{
|
2012-06-07 00:10:36 -07:00
|
|
|
evas_object_smart_need_bounding_box_update(obj->smart.parent);
|
2012-05-02 20:58:27 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-05-02 21:40:09 -07:00
|
|
|
if (noclip)
|
2012-05-01 00:31:42 -07:00
|
|
|
{
|
2012-05-02 20:58:27 -07:00
|
|
|
obj->smart.parent->cur.bounding_box.x = x;
|
|
|
|
obj->smart.parent->cur.bounding_box.y = y;
|
|
|
|
obj->smart.parent->cur.bounding_box.w = w;
|
|
|
|
obj->smart.parent->cur.bounding_box.h = h;
|
|
|
|
obj->smart.parent->cur.valid_bounding_box = EINA_TRUE;
|
2012-05-01 00:31:42 -07:00
|
|
|
propagate = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (propagate)
|
|
|
|
evas_object_update_bounding_box(obj->smart.parent);
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2003-10-17 20:34:00 -07:00
|
|
|
evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-10-31 07:50:00 -07:00
|
|
|
int is, was = 0, pass = 0, freeze = 0;
|
2011-12-26 15:09:45 -08:00
|
|
|
int nx = 0, ny = 0;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
|
|
|
nx = x;
|
|
|
|
ny = y;
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2012-03-28 00:17:39 -07:00
|
|
|
if (!obj->is_frame)
|
2011-12-26 15:09:45 -08:00
|
|
|
{
|
|
|
|
int fx, fy;
|
|
|
|
|
|
|
|
evas_output_framespace_get(obj->layer->evas, &fx, &fy, NULL, NULL);
|
2012-03-28 00:17:39 -07:00
|
|
|
if (!obj->smart.parent)
|
2012-01-02 13:27:46 -08:00
|
|
|
{
|
|
|
|
nx += fx;
|
|
|
|
ny += fy;
|
|
|
|
}
|
2011-12-26 15:09:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (evas_object_intercept_call_move(obj, nx, ny)) return;
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2010-10-14 22:39:53 -07:00
|
|
|
if (obj->doing.in_move > 0)
|
2006-10-07 10:35:14 -07:00
|
|
|
{
|
2010-10-14 22:39:53 -07:00
|
|
|
WRN("evas_object_move() called on object %p when in the middle of moving the same object", obj);
|
|
|
|
return;
|
2006-10-07 10:35:14 -07:00
|
|
|
}
|
2011-12-26 15:09:45 -08:00
|
|
|
|
|
|
|
if ((obj->cur.geometry.x == nx) && (obj->cur.geometry.y == ny)) return;
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2005-07-22 03:28:11 -07:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
pass = evas_event_passes_through(obj);
|
2011-10-31 07:50:00 -07:00
|
|
|
freeze = evas_event_freezes_through(obj);
|
|
|
|
if ((!pass) && (!freeze))
|
2011-06-08 19:45:59 -07:00
|
|
|
was = evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2010-10-14 22:39:53 -07:00
|
|
|
obj->doing.in_move++;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2010-10-14 22:39:53 -07:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->smart.smart->smart_class->move)
|
2011-12-26 15:09:45 -08:00
|
|
|
obj->smart.smart->smart_class->move(obj, nx, ny);
|
2010-10-14 22:39:53 -07:00
|
|
|
}
|
2011-12-26 15:09:45 -08:00
|
|
|
|
|
|
|
obj->cur.geometry.x = nx;
|
|
|
|
obj->cur.geometry.y = ny;
|
|
|
|
|
2012-05-01 00:31:42 -07:00
|
|
|
evas_object_update_bounding_box(obj);
|
|
|
|
|
2006-11-15 19:20:24 -08:00
|
|
|
//// obj->cur.cache.geometry.validity = 0;
|
2012-03-28 00:17:39 -07:00
|
|
|
obj->changed_move = EINA_TRUE;
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_change(obj);
|
2005-04-03 07:22:17 -07:00
|
|
|
evas_object_clip_dirty(obj);
|
2010-10-14 22:39:53 -07:00
|
|
|
obj->doing.in_move--;
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_object_recalc_clippees(obj);
|
|
|
|
if (!pass)
|
|
|
|
{
|
|
|
|
if (!obj->smart.smart)
|
|
|
|
{
|
|
|
|
is = evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1);
|
|
|
|
if ((is ^ was) && obj->cur.visible)
|
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
evas_object_inform_call_move(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2003-10-17 20:34:00 -07:00
|
|
|
evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-10-31 07:50:00 -07:00
|
|
|
int is, was = 0, pass = 0, freeze =0;
|
2011-12-26 15:09:45 -08:00
|
|
|
int nw = 0, nh = 0;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return;
|
2009-09-23 21:55:01 -07:00
|
|
|
if (w < 0) w = 0; if (h < 0) h = 0;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
|
|
|
nw = w;
|
|
|
|
nh = h;
|
2012-03-28 00:17:39 -07:00
|
|
|
if (!obj->is_frame)
|
2011-12-26 15:09:45 -08:00
|
|
|
{
|
|
|
|
int fw, fh;
|
|
|
|
|
|
|
|
evas_output_framespace_get(obj->layer->evas, NULL, NULL, &fw, &fh);
|
2012-03-28 00:17:39 -07:00
|
|
|
if (!obj->smart.parent)
|
2012-01-02 13:27:46 -08:00
|
|
|
{
|
|
|
|
nw = w - fw;
|
|
|
|
nh = h - fh;
|
|
|
|
if (nw < 0) nw = 0;
|
|
|
|
if (nh < 0) nh = 0;
|
|
|
|
}
|
2011-12-26 15:09:45 -08:00
|
|
|
}
|
|
|
|
|
2011-12-29 10:02:23 -08:00
|
|
|
if (evas_object_intercept_call_resize(obj, nw, nh)) return;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2010-10-14 22:39:53 -07:00
|
|
|
if (obj->doing.in_resize > 0)
|
2006-10-07 10:35:14 -07:00
|
|
|
{
|
2010-10-14 22:39:53 -07:00
|
|
|
WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj);
|
|
|
|
return;
|
2006-10-07 10:35:14 -07:00
|
|
|
}
|
2011-12-26 15:09:45 -08:00
|
|
|
|
|
|
|
if ((obj->cur.geometry.w == nw) && (obj->cur.geometry.h == nh)) return;
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2005-07-22 03:28:11 -07:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
pass = evas_event_passes_through(obj);
|
2011-10-31 07:50:00 -07:00
|
|
|
freeze = evas_event_freezes_through(obj);
|
|
|
|
if ((!pass) && (!freeze))
|
2011-06-08 19:45:59 -07:00
|
|
|
was = evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2010-10-14 22:39:53 -07:00
|
|
|
obj->doing.in_resize++;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2010-10-14 22:39:53 -07:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
|
|
|
if (obj->smart.smart->smart_class->resize)
|
2011-12-26 15:09:45 -08:00
|
|
|
obj->smart.smart->smart_class->resize(obj, nw, nh);
|
2010-10-14 22:39:53 -07:00
|
|
|
}
|
2011-12-26 15:09:45 -08:00
|
|
|
|
|
|
|
obj->cur.geometry.w = nw;
|
|
|
|
obj->cur.geometry.h = nh;
|
|
|
|
|
2012-05-01 00:31:42 -07:00
|
|
|
evas_object_update_bounding_box(obj);
|
|
|
|
|
2006-11-15 19:20:24 -08:00
|
|
|
//// obj->cur.cache.geometry.validity = 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_change(obj);
|
2005-04-03 07:22:17 -07:00
|
|
|
evas_object_clip_dirty(obj);
|
2010-10-14 22:39:53 -07:00
|
|
|
obj->doing.in_resize--;
|
2009-08-07 13:35:30 -07:00
|
|
|
/* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-08-07 13:35:30 -07:00
|
|
|
/* NB: If this creates glitches on screen then move to above position */
|
|
|
|
evas_object_recalc_clippees(obj);
|
|
|
|
|
2011-06-08 19:45:59 -07:00
|
|
|
// if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
|
|
|
|
if (!pass)
|
|
|
|
{
|
|
|
|
if (!obj->smart.smart)
|
|
|
|
{
|
|
|
|
is = evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1);
|
|
|
|
if ((is ^ was) && (obj->cur.visible))
|
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2004-09-20 20:15:42 -07:00
|
|
|
evas_object_inform_call_resize(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
|
|
|
|
return;
|
2004-03-07 18:42:08 -08:00
|
|
|
}
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if (x) *x = obj->cur.geometry.x;
|
|
|
|
if (y) *y = obj->cur.geometry.y;
|
|
|
|
if (w) *w = obj->cur.geometry.w;
|
|
|
|
if (h) *h = obj->cur.geometry.h;
|
|
|
|
}
|
|
|
|
|
2008-10-04 09:57:02 -07:00
|
|
|
static void
|
|
|
|
_evas_object_size_hint_alloc(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
if (obj->size_hints) return;
|
2009-09-03 22:13:19 -07:00
|
|
|
|
2010-11-26 02:01:18 -08:00
|
|
|
EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 512, );
|
|
|
|
obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints);
|
|
|
|
if (!obj->size_hints) return;
|
|
|
|
EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints);
|
2008-10-04 09:57:02 -07:00
|
|
|
obj->size_hints->max.w = -1;
|
|
|
|
obj->size_hints->max.h = -1;
|
|
|
|
obj->size_hints->align.x = 0.5;
|
|
|
|
obj->size_hints->align.y = 0.5;
|
|
|
|
}
|
2008-04-11 16:12:20 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
if (w) *w = 0; if (h) *h = 0;
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2008-04-30 15:51:08 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (w) *w = 0; if (h) *h = 0;
|
|
|
|
return;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
2008-04-30 15:51:08 -07:00
|
|
|
if (w) *w = obj->size_hints->min.w;
|
|
|
|
if (h) *h = obj->size_hints->min.h;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2008-10-04 09:57:02 -07:00
|
|
|
_evas_object_size_hint_alloc(obj);
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->min.w == w) && (obj->size_hints->min.h == h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->min.w = w;
|
|
|
|
obj->size_hints->min.h = h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
|
|
|
evas_object_inform_call_changed_size_hints(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
2008-10-04 09:53:47 -07:00
|
|
|
if (w) *w = -1; if (h) *h = -1;
|
2008-04-11 16:12:20 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2008-04-30 15:51:08 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (w) *w = -1; if (h) *h = -1;
|
|
|
|
return;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
2008-04-30 15:51:08 -07:00
|
|
|
if (w) *w = obj->size_hints->max.w;
|
|
|
|
if (h) *h = obj->size_hints->max.h;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2008-10-04 09:57:02 -07:00
|
|
|
_evas_object_size_hint_alloc(obj);
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->max.w == w) && (obj->size_hints->max.h == h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->max.w = w;
|
|
|
|
obj->size_hints->max.h = h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
|
|
|
evas_object_inform_call_changed_size_hints(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_request_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
if (w) *w = 0; if (h) *h = 0;
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2008-04-30 15:51:08 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (w) *w = 0; if (h) *h = 0;
|
|
|
|
return;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
2008-04-30 15:51:08 -07:00
|
|
|
if (w) *w = obj->size_hints->request.w;
|
|
|
|
if (h) *h = obj->size_hints->request.h;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_request_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2008-10-04 09:57:02 -07:00
|
|
|
_evas_object_size_hint_alloc(obj);
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->request.w == w) && (obj->size_hints->request.h == h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->request.w = w;
|
|
|
|
obj->size_hints->request.h = h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
|
|
|
evas_object_inform_call_changed_size_hints(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
|
|
|
|
if (w) *w = 0; if (h) *h = 0;
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2008-04-30 15:51:08 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
|
|
|
|
if (w) *w = 0; if (h) *h = 0;
|
|
|
|
return;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
2008-04-30 15:51:08 -07:00
|
|
|
if (aspect) *aspect = obj->size_hints->aspect.mode;
|
|
|
|
if (w) *w = obj->size_hints->aspect.size.w;
|
|
|
|
if (h) *h = obj->size_hints->aspect.size.h;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2008-10-04 09:57:02 -07:00
|
|
|
_evas_object_size_hint_alloc(obj);
|
2008-10-04 20:47:52 -07:00
|
|
|
if ((obj->size_hints->aspect.mode == aspect) && (obj->size_hints->aspect.size.w == w) && (obj->size_hints->aspect.size.h == h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->aspect.mode = aspect;
|
|
|
|
obj->size_hints->aspect.size.w = w;
|
|
|
|
obj->size_hints->aspect.size.h = h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
|
|
|
evas_object_inform_call_changed_size_hints(obj);
|
|
|
|
}
|
|
|
|
|
2008-10-04 09:11:23 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_align_get(const Evas_Object *obj, double *x, double *y)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
2008-10-04 09:12:48 -07:00
|
|
|
if (x) *x = 0.5; if (y) *y = 0.5;
|
2008-10-04 09:11:23 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (x) *x = 0.5; if (y) *y = 0.5;
|
|
|
|
return;
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
if (x) *x = obj->size_hints->align.x;
|
|
|
|
if (y) *y = obj->size_hints->align.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_align_set(Evas_Object *obj, double x, double y)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2008-10-04 09:57:02 -07:00
|
|
|
_evas_object_size_hint_alloc(obj);
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->align.x == x) && (obj->size_hints->align.y == y)) return;
|
2008-10-04 09:11:23 -07:00
|
|
|
obj->size_hints->align.x = x;
|
2008-10-04 10:10:44 -07:00
|
|
|
obj->size_hints->align.y = y;
|
2008-10-04 09:11:23 -07:00
|
|
|
|
|
|
|
evas_object_inform_call_changed_size_hints(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_weight_get(const Evas_Object *obj, double *x, double *y)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
2008-10-04 09:42:04 -07:00
|
|
|
if (x) *x = 0.0; if (y) *y = 0.0;
|
2008-10-04 09:11:23 -07:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (x) *x = 0.0; if (y) *y = 0.0;
|
|
|
|
return;
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
if (x) *x = obj->size_hints->weight.x;
|
|
|
|
if (y) *y = obj->size_hints->weight.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2008-10-04 09:57:02 -07:00
|
|
|
_evas_object_size_hint_alloc(obj);
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->weight.x == x) && (obj->size_hints->weight.y == y)) return;
|
2008-10-04 09:11:23 -07:00
|
|
|
obj->size_hints->weight.x = x;
|
2008-10-04 10:10:44 -07:00
|
|
|
obj->size_hints->weight.y = y;
|
2008-10-04 09:11:23 -07:00
|
|
|
|
|
|
|
evas_object_inform_call_changed_size_hints(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_padding_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
if (l) *l = 0; if (r) *r = 0;
|
|
|
|
if (t) *t = 0; if (b) *b = 0;
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (l) *l = 0; if (r) *r = 0;
|
|
|
|
if (t) *t = 0; if (b) *b = 0;
|
|
|
|
return;
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
if (l) *l = obj->size_hints->padding.l;
|
|
|
|
if (r) *r = obj->size_hints->padding.r;
|
|
|
|
if (t) *t = obj->size_hints->padding.t;
|
|
|
|
if (b) *b = obj->size_hints->padding.b;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_padding_set(Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2008-10-04 09:57:02 -07:00
|
|
|
_evas_object_size_hint_alloc(obj);
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->padding.l == l) && (obj->size_hints->padding.r == r) && (obj->size_hints->padding.t == t) && (obj->size_hints->padding.b == b)) return;
|
2008-10-04 10:28:43 -07:00
|
|
|
obj->size_hints->padding.l = l;
|
2008-10-04 09:11:23 -07:00
|
|
|
obj->size_hints->padding.r = r;
|
|
|
|
obj->size_hints->padding.t = t;
|
|
|
|
obj->size_hints->padding.b = b;
|
|
|
|
|
|
|
|
evas_object_inform_call_changed_size_hints(obj);
|
|
|
|
}
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_show(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return;
|
2002-12-14 16:33:57 -08:00
|
|
|
if (evas_object_intercept_call_show(obj)) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2003-10-08 20:05:17 -07:00
|
|
|
if (obj->smart.smart->smart_class->show)
|
2011-06-08 19:45:59 -07:00
|
|
|
obj->smart.smart->smart_class->show(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (obj->cur.visible)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2002-12-09 22:45:18 -08:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->cur.visible = 1;
|
|
|
|
evas_object_change(obj);
|
2005-04-03 07:22:17 -07:00
|
|
|
evas_object_clip_dirty(obj);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2010-09-02 02:40:23 -07:00
|
|
|
evas_object_clip_across_clippees_check(obj);
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_object_recalc_clippees(obj);
|
2011-10-31 07:50:00 -07:00
|
|
|
if ((!evas_event_passes_through(obj)) &&
|
|
|
|
(!evas_event_freezes_through(obj)))
|
2011-06-08 19:45:59 -07:00
|
|
|
{
|
|
|
|
if (!obj->smart.smart)
|
|
|
|
{
|
|
|
|
if (evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1))
|
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
evas_object_inform_call_show(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_hide(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return;
|
2002-12-14 16:33:57 -08:00
|
|
|
if (evas_object_intercept_call_hide(obj)) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2003-10-08 20:05:17 -07:00
|
|
|
if (obj->smart.smart->smart_class->hide)
|
2011-06-08 19:45:59 -07:00
|
|
|
obj->smart.smart->smart_class->hide(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (!obj->cur.visible)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2002-12-09 22:45:18 -08:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->cur.visible = 0;
|
|
|
|
evas_object_change(obj);
|
2005-04-03 07:22:17 -07:00
|
|
|
evas_object_clip_dirty(obj);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2005-05-21 19:49:50 -07:00
|
|
|
{
|
2010-09-02 02:40:23 -07:00
|
|
|
evas_object_clip_across_clippees_check(obj);
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_object_recalc_clippees(obj);
|
2011-10-31 07:50:00 -07:00
|
|
|
if ((!evas_event_passes_through(obj)) &&
|
|
|
|
(!evas_event_freezes_through(obj)))
|
2011-06-08 19:45:59 -07:00
|
|
|
{
|
|
|
|
if ((!obj->smart.smart) ||
|
2010-08-23 19:53:33 -07:00
|
|
|
((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap)))
|
2011-06-08 19:45:59 -07:00
|
|
|
{
|
2011-09-25 19:45:06 -07:00
|
|
|
if (!obj->mouse_grabbed)
|
|
|
|
{
|
|
|
|
if (evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1))
|
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
|
|
|
}
|
2011-09-24 21:43:02 -07:00
|
|
|
/* this is at odds to handling events when an obj is moved out of the mouse
|
|
|
|
* ore resized out or clipped out. if mouse is grabbed - regardless of
|
|
|
|
* visibility, mouse move events should keep happening and mouse up.
|
|
|
|
* for better or worse it's at least consistent.
|
2011-09-25 19:45:06 -07:00
|
|
|
if (obj->delete_me) return;
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->mouse_grabbed > 0)
|
2011-09-24 21:43:02 -07:00
|
|
|
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
|
2008-11-14 21:13:09 -08:00
|
|
|
if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
|
2011-09-24 21:43:02 -07:00
|
|
|
obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
|
2008-11-14 21:13:09 -08:00
|
|
|
obj->mouse_grabbed = 0;
|
|
|
|
if (obj->layer->evas->events_frozen > 0)
|
|
|
|
{
|
|
|
|
obj->mouse_in = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (obj->mouse_in)
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Out ev;
|
2009-09-03 22:13:19 -07:00
|
|
|
|
2011-06-08 19:45:59 -07:00
|
|
|
_evas_object_event_new();
|
2010-03-04 06:48:21 -08:00
|
|
|
|
2008-11-14 21:13:09 -08:00
|
|
|
obj->mouse_in = 0;
|
|
|
|
ev.buttons = obj->layer->evas->pointer.button;
|
|
|
|
ev.output.x = obj->layer->evas->pointer.x;
|
|
|
|
ev.output.y = obj->layer->evas->pointer.y;
|
|
|
|
ev.canvas.x = obj->layer->evas->pointer.x;
|
|
|
|
ev.canvas.y = obj->layer->evas->pointer.y;
|
|
|
|
ev.data = NULL;
|
|
|
|
ev.modifiers = &(obj->layer->evas->modifiers);
|
|
|
|
ev.locks = &(obj->layer->evas->locks);
|
2011-06-08 19:45:59 -07:00
|
|
|
ev.timestamp = obj->layer->evas->last_timestamp;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2008-11-14 21:13:09 -08:00
|
|
|
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
2010-05-04 08:58:10 -07:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas);
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
2011-09-24 21:43:02 -07:00
|
|
|
*/
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-08-01 06:52:55 -07:00
|
|
|
else
|
|
|
|
{
|
2012-03-28 00:17:39 -07:00
|
|
|
/*
|
2011-07-06 01:43:18 -07:00
|
|
|
if (obj->mouse_grabbed > 0)
|
2011-09-24 21:43:02 -07:00
|
|
|
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
|
|
|
|
obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
|
|
|
|
obj->mouse_grabbed = 0;
|
|
|
|
obj->mouse_in = 0;
|
2011-09-24 21:43:02 -07:00
|
|
|
*/
|
2005-08-01 06:52:55 -07:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
evas_object_inform_call_hide(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_visible_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();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
return obj->cur.visible;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (r > 255) r = 255; if (r < 0) r = 0;
|
|
|
|
if (g > 255) g = 255; if (g < 0) g = 0;
|
|
|
|
if (b > 255) b = 255; if (b < 0) b = 0;
|
|
|
|
if (a > 255) a = 255; if (a < 0) a = 0;
|
2012-03-16 08:02:01 -07:00
|
|
|
if (r > a)
|
|
|
|
{
|
|
|
|
r = a;
|
2012-04-08 20:43:45 -07:00
|
|
|
ERR("Evas only handles pre multiplied colors!");
|
2012-03-16 08:02:01 -07:00
|
|
|
}
|
|
|
|
if (g > a)
|
|
|
|
{
|
|
|
|
g = a;
|
2012-04-08 20:43:45 -07:00
|
|
|
ERR("Evas only handles pre multiplied colors!");
|
2012-03-16 08:02:01 -07:00
|
|
|
}
|
|
|
|
if (b > a)
|
|
|
|
{
|
|
|
|
b = a;
|
2012-04-08 20:43:45 -07:00
|
|
|
ERR("Evas only handles pre multiplied colors!");
|
2012-03-16 08:02:01 -07:00
|
|
|
}
|
2012-02-22 20:53:19 -08:00
|
|
|
|
2007-08-22 09:45:37 -07:00
|
|
|
if (evas_object_intercept_call_color_set(obj, r, g, b, a)) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2003-10-08 20:05:17 -07:00
|
|
|
if (obj->smart.smart->smart_class->color_set)
|
2011-06-08 19:45:59 -07:00
|
|
|
obj->smart.smart->smart_class->color_set(obj, r, g, b, a);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
if ((obj->cur.color.r == r) &&
|
|
|
|
(obj->cur.color.g == g) &&
|
|
|
|
(obj->cur.color.b == b) &&
|
|
|
|
(obj->cur.color.a == a)) return;
|
|
|
|
obj->cur.color.r = r;
|
|
|
|
obj->cur.color.g = g;
|
|
|
|
obj->cur.color.b = b;
|
2009-04-14 03:47:15 -07:00
|
|
|
evas_object_clip_dirty(obj);
|
2012-05-18 00:17:34 -07:00
|
|
|
|
2010-09-26 09:10:59 -07:00
|
|
|
if ((obj->cur.color.a == 0) && (a == 0) && (obj->cur.render_op == EVAS_RENDER_BLEND)) return;
|
2005-05-21 19:49:50 -07:00
|
|
|
obj->cur.color.a = a;
|
2012-05-18 00:17:34 -07:00
|
|
|
obj->changed_color = EINA_TRUE;
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_change(obj);
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (r) *r = 0; if (g) *g = 0; if (b) *b = 0; if (a) *a = 0;
|
|
|
|
return;
|
2004-03-07 18:42:08 -08:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
if (r) *r = obj->cur.color.r;
|
|
|
|
if (g) *g = obj->cur.color.g;
|
|
|
|
if (b) *b = obj->cur.color.b;
|
|
|
|
if (a) *a = obj->cur.color.a;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_object_anti_alias_set(Evas_Object *obj, Eina_Bool anti_alias)
|
2005-12-03 01:27:53 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me) return;
|
2010-08-23 19:56:04 -07:00
|
|
|
anti_alias = !!anti_alias;
|
|
|
|
if (obj->cur.anti_alias == anti_alias)return;
|
|
|
|
obj->cur.anti_alias = anti_alias;
|
2006-05-02 00:28:49 -07:00
|
|
|
evas_object_change(obj);
|
2005-12-03 01:27:53 -08:00
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_anti_alias_get(const Evas_Object *obj)
|
2005-12-03 01:27:53 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me) return 0;
|
|
|
|
return obj->cur.anti_alias;
|
|
|
|
}
|
|
|
|
|
2008-09-09 07:14:26 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_scale_set(Evas_Object *obj, double scale)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me) return;
|
2010-08-23 19:56:04 -07:00
|
|
|
if (obj->cur.scale == scale) return;
|
2008-09-09 07:14:26 -07:00
|
|
|
obj->cur.scale = scale;
|
|
|
|
evas_object_change(obj);
|
2008-11-15 02:39:46 -08:00
|
|
|
if (obj->func->scale_update) obj->func->scale_update(obj);
|
2008-09-09 07:14:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI double
|
|
|
|
evas_object_scale_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me) return 1.0;
|
|
|
|
return obj->cur.scale;
|
|
|
|
}
|
|
|
|
|
2006-05-02 00:28:49 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op render_op)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me) return;
|
2011-12-15 23:22:09 -08:00
|
|
|
if (obj->cur.render_op == render_op) return;
|
2006-05-02 00:28:49 -07:00
|
|
|
obj->cur.render_op = render_op;
|
|
|
|
evas_object_change(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Render_Op
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_render_op_get(const Evas_Object *obj)
|
2006-05-02 00:28:49 -07:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (obj->delete_me) return EVAS_RENDER_BLEND;
|
|
|
|
return obj->cur.render_op;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas *
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_evas_get(const Evas_Object *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2009-08-24 03:52:40 -07:00
|
|
|
if (obj->delete_me) return NULL;
|
2002-11-08 00:02:15 -08:00
|
|
|
return obj->layer->evas;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_object_top_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2002-11-08 00:02:15 -08:00
|
|
|
int xx, yy;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2006-11-15 19:20:24 -08:00
|
|
|
xx = x;
|
|
|
|
yy = y;
|
|
|
|
//// xx = evas_coord_world_x_to_screen(e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(e, y);
|
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
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
|
|
|
if (obj->delete_me) continue;
|
2011-11-15 07:10:19 -08:00
|
|
|
if ((!include_pass_events_objects) &&
|
|
|
|
(evas_event_passes_through(obj))) continue;
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
|
|
|
|
(!obj->clip.clipees))
|
|
|
|
return obj;
|
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2008-02-08 13:42:01 -08:00
|
|
|
evas_object_top_at_pointer_get(const Evas *e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-11-15 07:10:19 -08:00
|
|
|
return evas_object_top_at_xy_get(e, e->pointer.x, e->pointer.y, EINA_TRUE,
|
|
|
|
EINA_TRUE);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_object_top_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2002-11-08 00:02:15 -08:00
|
|
|
int xx, yy, ww, hh;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2006-11-15 19:20:24 -08:00
|
|
|
xx = x;
|
|
|
|
yy = y;
|
|
|
|
ww = w;
|
|
|
|
hh = h;
|
|
|
|
//// xx = evas_coord_world_x_to_screen(e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(e, y);
|
|
|
|
//// ww = evas_coord_world_x_to_screen(e, w);
|
|
|
|
//// hh = evas_coord_world_y_to_screen(e, h);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (ww < 1) ww = 1;
|
|
|
|
if (hh < 1) hh = 1;
|
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
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
|
|
|
if (obj->delete_me) continue;
|
2011-11-15 07:10:19 -08:00
|
|
|
if ((!include_pass_events_objects) &&
|
|
|
|
(evas_event_passes_through(obj))) continue;
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
|
|
|
|
(!obj->clip.clipees))
|
|
|
|
return obj;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
EAPI Eina_List *
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_objects_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *in = NULL;
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2002-11-08 00:02:15 -08:00
|
|
|
int xx, yy;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2006-11-15 19:20:24 -08:00
|
|
|
xx = x;
|
|
|
|
yy = y;
|
|
|
|
//// xx = evas_coord_world_x_to_screen(e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(e, y);
|
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
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
|
|
|
if (obj->delete_me) continue;
|
2011-11-15 07:10:19 -08:00
|
|
|
if ((!include_pass_events_objects) &&
|
|
|
|
(evas_event_passes_through(obj))) continue;
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
|
|
|
|
(!obj->clip.clipees))
|
|
|
|
in = eina_list_prepend(in, obj);
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2009-09-17 15:38:10 -07:00
|
|
|
/**
|
|
|
|
* Retrieves the objects in the given rectangle region
|
|
|
|
* @param 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.
|
|
|
|
*
|
|
|
|
*/
|
2008-10-21 09:31:05 -07:00
|
|
|
EAPI Eina_List *
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_objects_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *in = NULL;
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2002-11-08 00:02:15 -08:00
|
|
|
int xx, yy, ww, hh;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2006-11-15 19:20:24 -08:00
|
|
|
xx = x;
|
|
|
|
yy = y;
|
2008-10-17 04:23:18 -07:00
|
|
|
ww = w;
|
2006-11-15 19:20:24 -08:00
|
|
|
hh = h;
|
|
|
|
//// xx = evas_coord_world_x_to_screen(e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(e, y);
|
|
|
|
//// ww = evas_coord_world_x_to_screen(e, w);
|
|
|
|
//// hh = evas_coord_world_y_to_screen(e, h);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (ww < 1) ww = 1;
|
|
|
|
if (hh < 1) hh = 1;
|
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
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
|
|
|
if (obj->delete_me) continue;
|
2011-11-15 07:10:19 -08:00
|
|
|
if ((!include_pass_events_objects) &&
|
|
|
|
(evas_event_passes_through(obj))) continue;
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
|
|
|
|
(!obj->clip.clipees))
|
|
|
|
in = eina_list_prepend(in, obj);
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI const char *
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_type_get(const Evas_Object *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return "";
|
2002-11-08 00:02:15 -08:00
|
|
|
return obj->type;
|
|
|
|
}
|
2007-07-23 07:22:57 -07:00
|
|
|
|
|
|
|
EAPI void
|
2009-06-17 03:01:52 -07:00
|
|
|
evas_object_precise_is_inside_set(Evas_Object *obj, Eina_Bool precise)
|
2007-07-23 07:22:57 -07:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj->precise_is_inside = precise;
|
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2008-02-08 14:35:19 -08:00
|
|
|
evas_object_precise_is_inside_get(const Evas_Object *obj)
|
2007-07-23 07:22:57 -07:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return obj->precise_is_inside;
|
|
|
|
}
|
2010-09-02 17:06:56 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_static_clip_set(Evas_Object *obj, Eina_Bool is_static_clip)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj->is_static_clip = is_static_clip;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_static_clip_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return obj->is_static_clip;
|
|
|
|
}
|
|
|
|
|
2012-03-28 00:17:39 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame)
|
2011-12-26 15:09:45 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj->is_frame = is_frame;
|
|
|
|
}
|
|
|
|
|
2012-03-28 00:17:39 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_is_frame_object_get(Evas_Object *obj)
|
2011-12-26 15:09:45 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return EINA_FALSE;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return obj->is_frame;
|
|
|
|
}
|