aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_clip.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2012-10-09 01:58:41 +0000
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2012-10-09 01:58:41 +0000
commita01418aff884f9d6f3d68e4fcee1414e736a7313 (patch)
tree89d28034bc658515e91e8b49c76f2351193e0bb2 /legacy/evas/src/lib/canvas/evas_clip.c
parentephysics: fix sandbox shutdown (diff)
downloadefl-a01418aff884f9d6f3d68e4fcee1414e736a7313.tar.gz
eo: changes made for the support of the Eo concept
Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com> SVN revision: 77604
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_clip.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_clip.c269
1 files changed, 165 insertions, 104 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_clip.c b/legacy/evas/src/lib/canvas/evas_clip.c
index f1e9de339a..d412e435fa 100644
--- a/legacy/evas/src/lib/canvas/evas_clip.c
+++ b/legacy/evas/src/lib/canvas/evas_clip.c
@@ -2,7 +2,7 @@
#include "evas_private.h"
void
-evas_object_clip_dirty(Evas_Object *obj)
+evas_object_clip_dirty(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
Eina_List *l;
Evas_Object *data;
@@ -10,32 +10,43 @@ evas_object_clip_dirty(Evas_Object *obj)
if (obj->cur.cache.clip.dirty) return;
obj->cur.cache.clip.dirty = 1;
+ Evas_Object_Protected_Data *clipee = NULL;
EINA_LIST_FOREACH(obj->clip.clipees, l, data)
- evas_object_clip_dirty(data);
+ {
+ clipee = eo_data_get(data, EVAS_OBJ_CLASS);
+ evas_object_clip_dirty(data, clipee);
+ }
}
void
-evas_object_recalc_clippees(Evas_Object *obj)
+evas_object_recalc_clippees(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
Eina_List *l;
Evas_Object *data;
if (obj->cur.cache.clip.dirty)
{
- evas_object_clip_recalc(obj);
+ evas_object_clip_recalc(eo_obj, obj);
EINA_LIST_FOREACH(obj->clip.clipees, l, data)
- evas_object_recalc_clippees(data);
+ {
+ Evas_Object_Protected_Data *clipee = eo_data_get(data, EVAS_OBJ_CLASS);
+ evas_object_recalc_clippees(data, clipee);
+ }
}
}
int
-evas_object_clippers_was_visible(Evas_Object *obj)
+evas_object_clippers_was_visible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if (obj->prev.visible)
{
- if (obj->prev.clipper)
- return evas_object_clippers_is_visible(obj->prev.clipper);
- return 1;
+ if (obj->prev.clipper)
+ {
+ Evas_Object_Protected_Data *prev_clipper =
+ eo_data_get(obj->prev.clipper, EVAS_OBJ_CLASS);
+ return evas_object_clippers_is_visible(obj->prev.clipper, prev_clipper);
+ }
+ return 1;
}
return 0;
}
@@ -76,63 +87,71 @@ evas_object_clippers_was_visible(Evas_Object *obj)
#define MAP_ACROSS 1
static void
-evas_object_child_map_across_mark(Evas_Object *obj, Evas_Object *map_obj, Eina_Bool force)
+evas_object_child_map_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *map_obj, Eina_Bool force)
{
#ifdef MAP_ACROSS
if ((obj->cur.map_parent != map_obj) || force)
{
obj->cur.map_parent = map_obj;
obj->cur.cache.clip.dirty = 1;
- evas_object_clip_recalc(obj);
- if (obj->smart.smart)
+ evas_object_clip_recalc(eo_obj, obj);
+ if (obj->is_smart)
{
- Evas_Object *obj2;
+ Evas_Object_Protected_Data *obj2;
- EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
+ EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
{
// if obj has its own map - skip it. already done
if ((obj2->cur.map) && (obj2->cur.usemap)) continue;
- evas_object_child_map_across_mark(obj2, map_obj, force);
+ Evas_Object *eo_obj2 = obj2->object;
+ evas_object_child_map_across_mark(eo_obj2, obj2, map_obj, force);
}
}
else if (obj->clip.clipees)
{
Eina_List *l;
- Evas_Object *obj2;
+ Evas_Object *eo_obj2;
- EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
- evas_object_child_map_across_mark(obj2, map_obj, force);
+ 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);
+ }
}
}
#endif
}
void
-evas_object_clip_across_check(Evas_Object *obj)
+evas_object_clip_across_check(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
#ifdef MAP_ACROSS
if (!obj->cur.clipper) return;
- if (obj->cur.clipper->cur.map_parent != obj->cur.map_parent)
- evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1);
+ Evas_Object_Protected_Data *clipper = eo_data_get(obj->cur.clipper, EVAS_OBJ_CLASS);
+ if (clipper->cur.map_parent != obj->cur.map_parent)
+ evas_object_child_map_across_mark(eo_obj, obj, obj->cur.map_parent, 1);
#endif
}
void
-evas_object_clip_across_clippees_check(Evas_Object *obj)
+evas_object_clip_across_clippees_check(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
#ifdef MAP_ACROSS
Eina_List *l;
- Evas_Object *obj2;
+ Evas_Object *eo_obj2;
if (!obj->clip.clipees) return;
// schloooooooooooow:
-// evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1);
+// evas_object_child_map_across_mark(eo_obj, obj->cur.map_parent, 1);
// buggy:
- evas_object_child_map_across_mark(obj, obj->cur.map_parent, 0);
+ evas_object_child_map_across_mark(eo_obj, obj, obj->cur.map_parent, 0);
if (obj->cur.cache.clip.dirty)
{
- EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
- evas_object_clip_across_clippees_check(obj2);
+ 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);
+ }
}
#endif
}
@@ -142,19 +161,23 @@ evas_object_clip_across_clippees_check(Evas_Object *obj)
//
// FIXME: flip2 test broken in elm - might be show/hide of clips
void
-evas_object_mapped_clip_across_mark(Evas_Object *obj)
+evas_object_mapped_clip_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
#ifdef MAP_ACROSS
if ((obj->cur.map) && (obj->cur.usemap))
- evas_object_child_map_across_mark(obj, obj, 0);
+ evas_object_child_map_across_mark(eo_obj, obj, eo_obj, 0);
else
{
if (obj->smart.parent)
- evas_object_child_map_across_mark
- (obj, obj->smart.parent->cur.map_parent, 0);
+ {
+ Evas_Object_Protected_Data *smart_parent_obj =
+ eo_data_get(obj->smart.parent, EVAS_OBJ_CLASS);
+ evas_object_child_map_across_mark
+ (eo_obj, obj, smart_parent_obj->cur.map_parent, 0);
+ }
else
- evas_object_child_map_across_mark(obj, NULL, 0);
- }
+ evas_object_child_map_across_mark(eo_obj, obj, NULL, 0);
+ }
#endif
}
@@ -162,40 +185,51 @@ evas_object_mapped_clip_across_mark(Evas_Object *obj)
extern const char *o_rect_type;
EAPI void
-evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
+evas_object_clip_set(
+ Evas_Object *eo_obj,
+ Evas_Object *clip)
{
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
- if (!clip)
+ eo_do(eo_obj, evas_obj_clip_set(clip));
+}
+
+void
+_clip_set(Eo *eo_obj, void *_pd, va_list *list)
+{
+ Evas_Object *eo_clip = va_arg(*list, Evas_Object *);
+ Evas_Object_Protected_Data *obj = _pd;
+ if (!eo_clip)
{
- evas_object_clip_unset(obj);
+ evas_object_clip_unset(eo_obj);
return;
}
- MAGIC_CHECK(clip, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_clip, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
- if (obj->cur.clipper == clip) return;
- if (obj == clip)
+ Evas_Object_Protected_Data *clip = eo_data_get(eo_clip, EVAS_OBJ_CLASS);
+ if (obj->cur.clipper == eo_clip) return;
+ if (eo_obj == eo_clip)
{
- CRIT("Setting clip %p on itself", obj);
+ CRIT("Setting clip %p on itself", eo_obj);
return;
}
if (clip->delete_me)
{
- CRIT("Setting deleted object %p as clip obj %p", clip, obj);
+ CRIT("Setting deleted object %p as clip obj %p", eo_clip, eo_obj);
abort();
return;
}
if (obj->delete_me)
{
- CRIT("Setting object %p as clip to deleted obj %p", clip, obj);
+ CRIT("Setting object %p as clip to deleted obj %p", eo_clip, eo_obj);
abort();
return;
}
if (!obj->layer)
{
- CRIT("No evas surface associated with object (%p)", obj);
+ CRIT("No evas surface associated with object (%p)", eo_obj);
abort();
return;
}
@@ -207,34 +241,34 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
return;
}
- if (evas_object_intercept_call_clip_set(obj, clip)) return;
+ if (evas_object_intercept_call_clip_set(eo_obj, obj, eo_clip)) return;
// illegal to set anything but a rect as a clip
if (clip->type != o_rect_type)
{
ERR("For now a clip on other object than a rectangle is disabled");
return;
}
- if (obj->smart.smart)
+ if (obj->is_smart)
{
- if (obj->smart.smart->smart_class->clip_set)
- obj->smart.smart->smart_class->clip_set(obj, clip);
+ eo_do(eo_obj, evas_obj_smart_clip_set(eo_clip));
}
if (obj->cur.clipper)
{
- /* unclip */
- obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj);
- if (!obj->cur.clipper->clip.clipees)
+ /* unclip */
+ Evas_Object_Protected_Data *cur_clipper = eo_data_get(obj->cur.clipper, EVAS_OBJ_CLASS);
+ cur_clipper->clip.clipees = eina_list_remove(cur_clipper->clip.clipees, eo_obj);
+ if (!cur_clipper->clip.clipees)
{
- obj->cur.clipper->cur.have_clipees = 0;
- if (obj->cur.clipper->cur.visible)
- evas_damage_rectangle_add(obj->cur.clipper->layer->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);
+ cur_clipper->cur.have_clipees = 0;
+ if (cur_clipper->cur.visible)
+ evas_damage_rectangle_add(cur_clipper->layer->evas->evas,
+ cur_clipper->cur.geometry.x,
+ cur_clipper->cur.geometry.y,
+ cur_clipper->cur.geometry.w,
+ cur_clipper->cur.geometry.h);
}
- evas_object_change(obj->cur.clipper);
- evas_object_change(obj);
+ evas_object_change(obj->cur.clipper, cur_clipper);
+ evas_object_change(eo_obj, obj);
obj->cur.clipper = NULL;
}
/* clip me */
@@ -243,115 +277,142 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
/* Basically it just went invisible */
clip->changed = 1;
clip->layer->evas->changed = 1;
- evas_damage_rectangle_add(clip->layer->evas,
+ evas_damage_rectangle_add(clip->layer->evas->evas,
clip->cur.geometry.x, clip->cur.geometry.y,
clip->cur.geometry.w, clip->cur.geometry.h);
}
- obj->cur.clipper = clip;
- clip->clip.clipees = eina_list_append(clip->clip.clipees, obj);
+ obj->cur.clipper = eo_clip;
+ clip->clip.clipees = eina_list_append(clip->clip.clipees, eo_obj);
if (clip->clip.clipees)
{
clip->cur.have_clipees = 1;
if (clip->changed)
- evas_object_update_bounding_box(clip);
+ evas_object_update_bounding_box(eo_clip, clip);
}
/* If it's NOT a rectangle set the mask bits too */
/* FIXME: Optmz ths chck */
if (clip->type == o_rect_type)
- obj->cur.mask = NULL;
+ obj->cur.mask = NULL;
else
{
void *engdata;
- obj->cur.mask = clip;
- engdata = clip->func->engine_data_get(clip);
+ obj->cur.mask = eo_clip;
+ engdata = clip->func->engine_data_get(eo_clip);
/* FIXME: Images only */
clip->layer->evas->engine.func->image_mask_create(
clip->layer->evas->engine.data.output,
engdata);
}
- evas_object_change(clip);
- evas_object_change(obj);
- evas_object_clip_dirty(obj);
- evas_object_recalc_clippees(obj);
- if ((!obj->smart.smart) &&
+ 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) &&
(!((obj->cur.map) && (obj->cur.usemap))))
{
- if (evas_object_is_in_output_rect(obj,
+ if (evas_object_is_in_output_rect(eo_obj, obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1))
- evas_event_feed_mouse_move(obj->layer->evas,
+ evas_event_feed_mouse_move(obj->layer->evas->evas,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
}
- evas_object_clip_across_check(obj);
+ evas_object_clip_across_check(eo_obj, obj);
}
EAPI Evas_Object *
-evas_object_clip_get(const Evas_Object *obj)
+evas_object_clip_get(const Evas_Object *eo_obj)
{
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return NULL;
MAGIC_CHECK_END();
- return obj->cur.clipper;
+ 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;
+ *clip = obj->cur.clipper;
}
EAPI void
-evas_object_clip_unset(Evas_Object *obj)
+evas_object_clip_unset(Evas_Object *eo_obj)
{
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ 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;
if (!obj->cur.clipper) return;
/* unclip */
- if (evas_object_intercept_call_clip_unset(obj)) return;
- if (obj->smart.smart)
+ if (evas_object_intercept_call_clip_unset(eo_obj)) return;
+ if (obj->is_smart)
{
- if (obj->smart.smart->smart_class->clip_unset)
- obj->smart.smart->smart_class->clip_unset(obj);
+ eo_do(eo_obj, evas_obj_smart_clip_unset());
}
if (obj->cur.clipper)
{
- obj->cur.clipper->clip.clipees = eina_list_remove(obj->cur.clipper->clip.clipees, obj);
- if (!obj->cur.clipper->clip.clipees)
+ Evas_Object_Protected_Data *cur_clipper = eo_data_get(obj->cur.clipper, EVAS_OBJ_CLASS);
+ cur_clipper->clip.clipees = eina_list_remove(cur_clipper->clip.clipees, eo_obj);
+ if (!cur_clipper->clip.clipees)
{
- obj->cur.clipper->cur.have_clipees = 0;
- if (obj->cur.clipper->cur.visible)
- evas_damage_rectangle_add(obj->cur.clipper->layer->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);
+ cur_clipper->cur.have_clipees = 0;
+ if (cur_clipper->cur.visible)
+ evas_damage_rectangle_add(cur_clipper->layer->evas->evas,
+ cur_clipper->cur.geometry.x,
+ cur_clipper->cur.geometry.y,
+ cur_clipper->cur.geometry.w,
+ cur_clipper->cur.geometry.h);
}
- evas_object_change(obj->cur.clipper);
+ evas_object_change(obj->cur.clipper, cur_clipper);
}
obj->cur.clipper = NULL;
- evas_object_change(obj);
- evas_object_clip_dirty(obj);
- evas_object_recalc_clippees(obj);
- if ((!obj->smart.smart) &&
+ evas_object_change(eo_obj, obj);
+ evas_object_clip_dirty(eo_obj, obj);
+ evas_object_recalc_clippees(eo_obj, obj);
+ if ((!obj->is_smart) &&
(!((obj->cur.map) && (obj->cur.usemap))))
{
- if (evas_object_is_in_output_rect(obj,
+ if (evas_object_is_in_output_rect(eo_obj, obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1))
- evas_event_feed_mouse_move(obj->layer->evas,
+ evas_event_feed_mouse_move(obj->layer->evas->evas,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
}
- evas_object_clip_across_check(obj);
+ evas_object_clip_across_check(eo_obj, obj);
}
EAPI const Eina_List *
-evas_object_clipees_get(const Evas_Object *obj)
+evas_object_clipees_get(const Evas_Object *eo_obj)
{
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return NULL;
MAGIC_CHECK_END();
- return obj->clip.clipees;
+ 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;
}