2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
#include "evas_private.h"
|
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_dirty(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *data;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-09-11 04:43:17 -07:00
|
|
|
if (obj->cur.cache.clip.dirty) return;
|
2011-03-21 08:18:26 -07:00
|
|
|
|
2012-10-19 05:22:42 -07:00
|
|
|
obj->cur.cache.clip.dirty = EINA_TRUE;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *clipee = NULL;
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(obj->clip.clipees, l, data)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
clipee = eo_data_get(data, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_clip_dirty(data, clipee);
|
|
|
|
}
|
2005-04-03 07:22:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_recalc_clippees(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2005-04-03 07:22:17 -07:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *data;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2005-07-30 02:52:53 -07:00
|
|
|
if (obj->cur.cache.clip.dirty)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_recalc(eo_obj, obj);
|
2012-09-11 04:43:17 -07:00
|
|
|
EINA_LIST_FOREACH(obj->clip.clipees, l, data)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *clipee = eo_data_get(data, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_recalc_clippees(data, clipee);
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clippers_was_visible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
if (obj->prev.visible)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->prev.clipper)
|
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
return evas_object_clippers_is_visible(obj->prev.eo_clipper, obj->prev.clipper);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
return 1;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-08-31 15:16:08 -07:00
|
|
|
/* aaaaargh (pirate voice) ... notes!
|
2012-09-11 04:43:17 -07:00
|
|
|
*
|
2010-08-31 15:16:08 -07:00
|
|
|
* we have a big problem until now that's gone undetected... until yesterday.
|
|
|
|
* that problem involves clips and maps and smart objects. hooray! 3 of the
|
|
|
|
* more complex bits of evas - and maps and smart objects being one of the
|
|
|
|
* nastiest ones.
|
2012-09-11 04:43:17 -07:00
|
|
|
*
|
2010-08-31 15:16:08 -07:00
|
|
|
* what is the problem? when a clip crosses a map boundary. that is to say
|
|
|
|
* that when the clipper and clippee are not within the child tree of the
|
|
|
|
* mapped object. in this case "bad stuff" happens. basically as clips are
|
|
|
|
* then used to render objects, but they no longer apply as you'd expect as
|
|
|
|
* the map transfomr the objects to-be-clipped separately from the objects
|
|
|
|
* that clip them and this whole relationship is broken by maps. it somehow
|
|
|
|
* managed to not break with the advent of smart objects. lucky me... but
|
|
|
|
* maps killed it. now... what do we do? that is a good question. detect
|
|
|
|
* such a broken link and "turn off clipping" in that event - sure. but this
|
|
|
|
* isn't going to be cheap as ANY addition or deletion of a map to an object
|
|
|
|
* or any change in clipper of an object or any change in smart object
|
|
|
|
* membership needs to walk the obj tree both up and down from the changed
|
|
|
|
* object and probably walk entire object trees to find these and mark them.
|
|
|
|
* thats silly-expensive and i was about to fix it that way but it has since
|
|
|
|
* dawned on me that that is just going to kill performance in some critical
|
|
|
|
* areas like during object setup and manipulation, as well as teardown.
|
2012-09-11 04:43:17 -07:00
|
|
|
*
|
2010-08-31 15:16:08 -07:00
|
|
|
* aaaaagh! best for now is to document this as a "don't do it damnit!" thing
|
|
|
|
* and have the apps avoid it. but even then - how to do this? this is not
|
|
|
|
* easy. everywhere i turn so far i come up to either expensive operations,
|
|
|
|
* breaks in logic, or nasty re-work of apps or4 the whole concept of clipping,
|
|
|
|
* smart objects and maps... and that will have to wait for evas 2.0
|
2012-09-11 04:43:17 -07:00
|
|
|
*
|
2010-09-01 14:38:34 -07:00
|
|
|
* the below does clip fixups etc. in the even a clip spans a map boundary.
|
|
|
|
* not pretty, but necessary.
|
2010-08-31 15:16:08 -07:00
|
|
|
*/
|
|
|
|
|
2010-09-01 14:37:10 -07:00
|
|
|
#define MAP_ACROSS 1
|
2010-08-31 15:16:08 -07:00
|
|
|
static void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_child_map_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *map_obj, Eina_Bool force)
|
2010-08-31 15:16:08 -07:00
|
|
|
{
|
2010-09-01 14:37:10 -07:00
|
|
|
#ifdef MAP_ACROSS
|
2013-01-21 01:36:19 -08:00
|
|
|
if ((obj->map.cur.map_parent != map_obj) || force)
|
2010-08-31 15:16:08 -07:00
|
|
|
{
|
2013-01-21 01:36:19 -08:00
|
|
|
obj->map.cur.map_parent = map_obj;
|
2010-09-01 14:37:10 -07:00
|
|
|
obj->cur.cache.clip.dirty = 1;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_recalc(eo_obj, obj);
|
|
|
|
if (obj->is_smart)
|
2010-09-01 14:37:10 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj2;
|
2012-09-11 04:43:17 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
|
2010-09-01 14:37:10 -07:00
|
|
|
{
|
|
|
|
// if obj has its own map - skip it. already done
|
2013-01-21 01:36:19 -08:00
|
|
|
if ((obj2->map.cur.map) && (obj2->map.cur.usemap)) continue;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj2 = obj2->object;
|
|
|
|
evas_object_child_map_across_mark(eo_obj2, obj2, map_obj, force);
|
2010-09-01 14:37:10 -07:00
|
|
|
}
|
|
|
|
}
|
2010-09-02 02:40:23 -07:00
|
|
|
else if (obj->clip.clipees)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj2;
|
2012-09-11 04:43:17 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(obj->clip.clipees, l, eo_obj2)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj2 = eo_data_get(eo_obj2, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_child_map_across_mark(eo_obj2, obj2, map_obj, force);
|
|
|
|
}
|
2010-09-02 02:40:23 -07:00
|
|
|
}
|
2010-08-31 15:16:08 -07:00
|
|
|
}
|
2012-09-11 04:43:17 -07:00
|
|
|
#endif
|
2010-08-31 15:16:08 -07:00
|
|
|
}
|
|
|
|
|
2010-09-02 02:40:23 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_across_check(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2010-09-01 14:37:10 -07:00
|
|
|
{
|
2010-09-02 02:40:23 -07:00
|
|
|
#ifdef MAP_ACROSS
|
2010-09-01 14:37:10 -07:00
|
|
|
if (!obj->cur.clipper) return;
|
2013-01-21 01:36:19 -08:00
|
|
|
if (obj->cur.clipper->map.cur.map_parent != obj->map.cur.map_parent)
|
|
|
|
evas_object_child_map_across_mark(eo_obj, obj, obj->map.cur.map_parent, 1);
|
2012-09-11 04:43:17 -07:00
|
|
|
#endif
|
2010-09-02 02:40:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_across_clippees_check(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2010-09-02 02:40:23 -07:00
|
|
|
{
|
|
|
|
#ifdef MAP_ACROSS
|
|
|
|
Eina_List *l;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj2;
|
2010-09-02 02:40:23 -07:00
|
|
|
|
|
|
|
if (!obj->clip.clipees) return;
|
2010-09-03 01:23:38 -07:00
|
|
|
// schloooooooooooow:
|
2013-01-21 01:36:19 -08:00
|
|
|
// evas_object_child_map_across_mark(eo_obj, obj->map.cur.map_parent, 1);
|
2010-09-03 01:23:38 -07:00
|
|
|
// buggy:
|
2013-01-21 01:36:19 -08:00
|
|
|
evas_object_child_map_across_mark(eo_obj, obj, obj->map.cur.map_parent, 0);
|
2010-09-02 02:40:23 -07:00
|
|
|
if (obj->cur.cache.clip.dirty)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
EINA_LIST_FOREACH(obj->clip.clipees, l, eo_obj2)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj2 = eo_data_get(eo_obj2, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_clip_across_clippees_check(eo_obj2, obj2);
|
|
|
|
}
|
2010-09-02 02:40:23 -07:00
|
|
|
}
|
2012-09-11 04:43:17 -07:00
|
|
|
#endif
|
2010-09-01 14:37:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// this function is called on an object when map is enabled or disabled on it
|
|
|
|
// thus creating a "map boundary" at that point.
|
2012-09-11 04:43:17 -07:00
|
|
|
//
|
2010-09-01 15:51:00 -07:00
|
|
|
// FIXME: flip2 test broken in elm - might be show/hide of clips
|
2010-08-31 15:16:08 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_mapped_clip_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2010-08-31 15:16:08 -07:00
|
|
|
{
|
2010-09-01 14:37:10 -07:00
|
|
|
#ifdef MAP_ACROSS
|
2013-01-21 01:36:19 -08:00
|
|
|
if ((obj->map.cur.map) && (obj->map.cur.usemap))
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_child_map_across_mark(eo_obj, obj, eo_obj, 0);
|
2010-08-31 15:16:08 -07:00
|
|
|
else
|
2010-09-01 14:37:10 -07:00
|
|
|
{
|
|
|
|
if (obj->smart.parent)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *smart_parent_obj =
|
|
|
|
eo_data_get(obj->smart.parent, EVAS_OBJ_CLASS);
|
|
|
|
evas_object_child_map_across_mark
|
2013-01-21 01:36:19 -08:00
|
|
|
(eo_obj, obj, smart_parent_obj->map.cur.map_parent, 0);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
2010-09-01 14:37:10 -07:00
|
|
|
else
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_child_map_across_mark(eo_obj, obj, NULL, 0);
|
|
|
|
}
|
2011-06-14 17:48:38 -07:00
|
|
|
#endif
|
2010-08-31 15:16:08 -07:00
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* public functions */
|
2011-06-02 03:00:05 -07:00
|
|
|
extern const char *o_rect_type;
|
2008-11-01 14:50:36 -07:00
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_set(
|
|
|
|
Evas_Object *eo_obj,
|
|
|
|
Evas_Object *clip)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_clip_set(clip));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_clip_set(Eo *eo_obj, void *_pd, va_list *list)
|
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
Evas_Object_Protected_Data *clip;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_clip = va_arg(*list, Evas_Object *);
|
|
|
|
Evas_Object_Protected_Data *obj = _pd;
|
2012-10-10 00:23:00 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!eo_clip)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_unset(eo_obj);
|
2012-09-11 04:43:17 -07:00
|
|
|
return;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-10 00:23:00 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_clip, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-10 00:23:00 -07:00
|
|
|
|
|
|
|
clip = eo_data_get(eo_clip, EVAS_OBJ_CLASS);
|
|
|
|
if (obj->cur.eo_clipper == eo_clip) return;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (eo_obj == eo_clip)
|
2012-08-07 02:43:22 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
CRIT("Setting clip %p on itself", eo_obj);
|
2012-08-07 02:43:22 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (clip->delete_me)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
CRIT("Setting deleted object %p as clip obj %p", eo_clip, eo_obj);
|
2012-08-07 02:43:22 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (obj->delete_me)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
CRIT("Setting object %p as clip to deleted obj %p", eo_clip, eo_obj);
|
2012-08-07 02:43:22 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!obj->layer)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
CRIT("No evas surface associated with object (%p)", eo_obj);
|
2012-08-07 02:43:22 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((obj->layer && clip->layer) &&
|
|
|
|
(obj->layer->evas != clip->layer->evas))
|
|
|
|
{
|
|
|
|
CRIT("Setting object %p from Evas (%p) to another Evas (%p)", obj, obj->layer->evas, clip->layer->evas);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (evas_object_intercept_call_clip_set(eo_obj, obj, eo_clip)) return;
|
2011-06-02 03:00:05 -07:00
|
|
|
// illegal to set anything but a rect as a clip
|
2012-08-07 02:43:22 -07:00
|
|
|
if (clip->type != o_rect_type)
|
|
|
|
{
|
|
|
|
ERR("For now a clip on other object than a rectangle is disabled");
|
|
|
|
return;
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_smart_clip_set(eo_clip));
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
if (obj->cur.clipper)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
/* unclip */
|
2012-10-10 00:23:00 -07:00
|
|
|
obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, eo_obj);
|
|
|
|
if (!obj->cur.clipper->clip.clipees)
|
2012-09-11 04:43:17 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
obj->cur.clipper->cur.have_clipees = 0;
|
|
|
|
if (obj->cur.clipper->cur.visible)
|
|
|
|
evas_damage_rectangle_add(obj->cur.clipper->layer->evas->evas,
|
|
|
|
obj->cur.clipper->cur.geometry.x,
|
|
|
|
obj->cur.clipper->cur.geometry.y,
|
|
|
|
obj->cur.clipper->cur.geometry.w,
|
|
|
|
obj->cur.clipper->cur.geometry.h);
|
2012-09-11 04:43:17 -07:00
|
|
|
}
|
2012-10-10 00:23:00 -07:00
|
|
|
evas_object_change(obj->cur.eo_clipper, obj->cur.clipper);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
2012-09-11 04:43:17 -07:00
|
|
|
obj->cur.clipper = NULL;
|
2012-10-10 00:23:00 -07:00
|
|
|
obj->cur.eo_clipper = NULL;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
/* clip me */
|
2010-08-21 06:52:25 -07:00
|
|
|
if ((!clip->clip.clipees) && (clip->cur.visible))
|
2004-09-21 21:37:51 -07:00
|
|
|
{
|
2012-09-11 04:43:17 -07:00
|
|
|
/* Basically it just went invisible */
|
|
|
|
clip->changed = 1;
|
|
|
|
clip->layer->evas->changed = 1;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_damage_rectangle_add(clip->layer->evas->evas,
|
2012-09-11 04:43:17 -07:00
|
|
|
clip->cur.geometry.x, clip->cur.geometry.y,
|
|
|
|
clip->cur.geometry.w, clip->cur.geometry.h);
|
2004-09-21 21:37:51 -07:00
|
|
|
}
|
2012-10-10 00:23:00 -07:00
|
|
|
obj->cur.eo_clipper = eo_clip;
|
|
|
|
obj->cur.clipper = clip;
|
2012-10-08 18:58:41 -07:00
|
|
|
clip->clip.clipees = eina_list_append(clip->clip.clipees, eo_obj);
|
2012-05-01 00:31:42 -07:00
|
|
|
if (clip->clip.clipees)
|
|
|
|
{
|
|
|
|
clip->cur.have_clipees = 1;
|
|
|
|
if (clip->changed)
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_update_bounding_box(eo_clip, clip);
|
2012-05-01 00:31:42 -07:00
|
|
|
}
|
2011-04-05 22:38:38 -07:00
|
|
|
|
|
|
|
/* If it's NOT a rectangle set the mask bits too */
|
|
|
|
/* FIXME: Optmz ths chck */
|
2012-12-05 05:52:59 -08:00
|
|
|
if (clip->type != o_rect_type)
|
2011-04-05 22:38:38 -07:00
|
|
|
{
|
2012-12-05 05:52:59 -08:00
|
|
|
ERR("Not supported clipping to type '%s', just rectangles.",
|
|
|
|
clip->type);
|
2011-04-05 22:38:38 -07:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_clip, clip);
|
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
evas_object_clip_dirty(eo_obj, obj);
|
|
|
|
evas_object_recalc_clippees(eo_obj, obj);
|
|
|
|
if ((!obj->is_smart) &&
|
2013-01-21 01:36:19 -08:00
|
|
|
(!((obj->map.cur.map) && (obj->map.cur.usemap))))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (evas_object_is_in_output_rect(eo_obj, obj,
|
2012-09-11 04:43:17 -07:00
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1))
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
2012-09-11 04:43:17 -07:00
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_across_check(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_get(const Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *clip = NULL;
|
|
|
|
eo_do((Eo *)eo_obj, evas_obj_clip_get(&clip));
|
|
|
|
return clip;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_clip_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
Evas_Object **clip = va_arg(*list, Evas_Object **);
|
|
|
|
const Evas_Object_Protected_Data *obj = _pd;
|
2012-10-10 00:23:00 -07:00
|
|
|
*clip = obj->cur.eo_clipper;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_unset(Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_clip_unset());
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_clip_unset(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = _pd;
|
2012-10-10 00:23:00 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!obj->cur.clipper) return;
|
|
|
|
/* unclip */
|
2012-10-08 18:58:41 -07:00
|
|
|
if (evas_object_intercept_call_clip_unset(eo_obj)) return;
|
|
|
|
if (obj->is_smart)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_do(eo_obj, evas_obj_smart_clip_unset());
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2009-09-03 22:13:19 -07:00
|
|
|
if (obj->cur.clipper)
|
2006-09-08 10:59:19 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, eo_obj);
|
|
|
|
if (!obj->cur.clipper->clip.clipees)
|
2012-09-11 04:43:17 -07:00
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
obj->cur.clipper->cur.have_clipees = 0;
|
|
|
|
if (obj->cur.clipper->cur.visible)
|
|
|
|
evas_damage_rectangle_add(obj->cur.clipper->layer->evas->evas,
|
|
|
|
obj->cur.clipper->cur.geometry.x,
|
|
|
|
obj->cur.clipper->cur.geometry.y,
|
|
|
|
obj->cur.clipper->cur.geometry.w,
|
|
|
|
obj->cur.clipper->cur.geometry.h);
|
2012-09-11 04:43:17 -07:00
|
|
|
}
|
2012-10-10 00:23:00 -07:00
|
|
|
evas_object_change(obj->cur.eo_clipper, obj->cur.clipper);
|
2006-09-08 10:59:19 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->cur.clipper = NULL;
|
2012-10-10 00:23:00 -07:00
|
|
|
obj->cur.eo_clipper = NULL;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
evas_object_clip_dirty(eo_obj, obj);
|
|
|
|
evas_object_recalc_clippees(eo_obj, obj);
|
|
|
|
if ((!obj->is_smart) &&
|
2013-01-21 01:36:19 -08:00
|
|
|
(!((obj->map.cur.map) && (obj->map.cur.usemap))))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (evas_object_is_in_output_rect(eo_obj, obj,
|
2012-09-11 04:43:17 -07:00
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1))
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
2012-09-11 04:43:17 -07:00
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
2005-07-25 02:55:47 -07:00
|
|
|
obj->layer->evas->last_timestamp,
|
2012-09-11 04:43:17 -07:00
|
|
|
NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_across_check(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
EAPI const Eina_List *
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clipees_get(const Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
const Eina_List *clipees = NULL;
|
|
|
|
eo_do((Eo *)eo_obj, evas_obj_clipees_get(&clipees));
|
|
|
|
return clipees;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_clipees_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|
|
|
{
|
|
|
|
const Eina_List **clipees = va_arg(*list, const Eina_List **);
|
|
|
|
const Evas_Object_Protected_Data *obj = _pd;
|
|
|
|
*clipees = obj->clip.clipees;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-09-11 04:43:17 -07:00
|
|
|
|