aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_layer.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_layer.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_layer.c114
1 files changed, 70 insertions, 44 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_layer.c b/legacy/evas/src/lib/canvas/evas_layer.c
index 7b89069655..fa86aa9334 100644
--- a/legacy/evas/src/lib/canvas/evas_layer.c
+++ b/legacy/evas/src/lib/canvas/evas_layer.c
@@ -4,7 +4,7 @@
static void _evas_layer_free(Evas_Layer *lay);
void
-evas_object_inject(Evas_Object *obj, Evas *e)
+evas_object_inject(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas *e)
{
Evas_Layer *lay;
@@ -16,17 +16,17 @@ evas_object_inject(Evas_Object *obj, Evas *e)
lay->layer = obj->cur.layer;
evas_layer_add(lay);
}
- lay->objects = (Evas_Object *)eina_inlist_append(EINA_INLIST_GET(lay->objects), EINA_INLIST_GET(obj));
+ lay->objects = (Evas_Object_Protected_Data *)eina_inlist_append(EINA_INLIST_GET(lay->objects), EINA_INLIST_GET(obj));
lay->usage++;
obj->layer = lay;
obj->in_layer = 1;
}
void
-evas_object_release(Evas_Object *obj, int clean_layer)
+evas_object_release(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, int clean_layer)
{
if (!obj->in_layer) return;
- obj->layer->objects = (Evas_Object *)eina_inlist_remove(EINA_INLIST_GET(obj->layer->objects), EINA_INLIST_GET(obj));
+ obj->layer->objects = (Evas_Object_Protected_Data *)eina_inlist_remove(EINA_INLIST_GET(obj->layer->objects), EINA_INLIST_GET(obj));
obj->layer->usage--;
if (clean_layer)
{
@@ -41,8 +41,9 @@ evas_object_release(Evas_Object *obj, int clean_layer)
}
Evas_Layer *
-evas_layer_new(Evas *e)
+evas_layer_new(Evas *eo_e)
{
+ Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
Evas_Layer *lay;
lay = calloc(1, sizeof(Evas_Layer));
@@ -60,12 +61,12 @@ _evas_layer_free(Evas_Layer *lay)
void
evas_layer_pre_free(Evas_Layer *lay)
{
- Evas_Object *obj;
+ Evas_Object_Protected_Data *obj;
EINA_INLIST_FOREACH(lay->objects, obj)
{
if ((!obj->smart.parent) && (!obj->delete_me))
- evas_object_del(obj);
+ evas_object_del(obj->object);
}
}
@@ -74,16 +75,17 @@ evas_layer_free_objects(Evas_Layer *lay)
{
while (lay->objects)
{
- Evas_Object *obj;
+ Evas_Object_Protected_Data *obj;
- obj = (Evas_Object *)lay->objects;
- evas_object_free(obj, 0);
+ obj = (Evas_Object_Protected_Data *)lay->objects;
+ evas_object_free(obj->object, 0);
}
}
void
-evas_layer_clean(Evas *e)
+evas_layer_clean(Evas *eo_e)
{
+ Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
Evas_Layer *tmp;
while (e->layers)
@@ -95,8 +97,9 @@ evas_layer_clean(Evas *e)
}
Evas_Layer *
-evas_layer_find(Evas *e, short layer_num)
+evas_layer_find(Evas *eo_e, short layer_num)
{
+ Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
Evas_Layer *layer;
EINA_INLIST_FOREACH(e->layers, layer)
@@ -127,30 +130,33 @@ evas_layer_add(Evas_Layer *lay)
void
evas_layer_del(Evas_Layer *lay)
{
- Evas *e;
+ Evas_Public_Data *e;
e = lay->evas;
e->layers = (Evas_Layer *)eina_inlist_remove(EINA_INLIST_GET(e->layers), EINA_INLIST_GET(lay));
}
static void
-_evas_object_layer_set_child(Evas_Object *obj, Evas_Object *par, short l)
+_evas_object_layer_set_child(Evas_Object *eo_obj, Evas_Object *par, short l)
{
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ Evas_Object_Protected_Data *par_obj = eo_data_get(par, EVAS_OBJ_CLASS);
+
if (obj->delete_me) return;
if (obj->cur.layer == l) return;
- evas_object_release(obj, 1);
+ evas_object_release(eo_obj, obj, 1);
obj->cur.layer = l;
- obj->layer = par->layer;
+ obj->layer = par_obj->layer;
obj->layer->usage++;
- if (obj->smart.smart)
+ if (obj->is_smart)
{
Eina_Inlist *contained;
- Evas_Object *member;
+ Evas_Object_Protected_Data *member;
- contained = (Eina_Inlist *)evas_object_smart_members_get_direct(obj);
+ contained = (Eina_Inlist *)evas_object_smart_members_get_direct(eo_obj);
EINA_INLIST_FOREACH(contained, member)
{
- _evas_object_layer_set_child(member, obj, l);
+ _evas_object_layer_set_child(member->object, eo_obj, l);
}
}
}
@@ -158,41 +164,50 @@ _evas_object_layer_set_child(Evas_Object *obj, Evas_Object *par, short l)
/* public functions */
EAPI void
-evas_object_layer_set(Evas_Object *obj, short l)
+evas_object_layer_set(Evas_Object *eo_obj, short l)
{
- Evas *e;
-
- 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_layer_set(l));
+}
+
+void
+_layer_set(Eo *eo_obj, void *_obj, va_list *list)
+{
+ short l = va_arg(*list, int);
+
+ Evas *eo_e;
+ Evas_Object_Protected_Data *obj = _obj;
+
if (obj->delete_me) return;
- if (evas_object_intercept_call_layer_set(obj, l)) return;
+ if (evas_object_intercept_call_layer_set(eo_obj, l)) return;
if (obj->smart.parent) return;
if (obj->cur.layer == l)
{
- evas_object_raise(obj);
+ evas_object_raise(eo_obj);
return;
}
- e = obj->layer->evas;
- evas_object_release(obj, 1);
+ eo_e = obj->layer->evas->evas;
+ evas_object_release(eo_obj, obj, 1);
obj->cur.layer = l;
- evas_object_inject(obj, e);
+ evas_object_inject(eo_obj, obj, eo_e);
obj->restack = 1;
- evas_object_change(obj);
+ evas_object_change(eo_obj, obj);
if (obj->clip.clipees)
{
- evas_object_inform_call_restack(obj);
+ evas_object_inform_call_restack(eo_obj);
return;
}
- evas_object_change(obj);
- if (!obj->smart.smart)
+ evas_object_change(eo_obj, obj);
+ if (!obj->is_smart)
{
- 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) &&
obj->cur.visible)
if (eina_list_data_find(obj->layer->evas->pointer.object.in, obj))
- 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,
@@ -201,26 +216,37 @@ evas_object_layer_set(Evas_Object *obj, short l)
else
{
Eina_Inlist *contained;
- Evas_Object *member;
-
- contained = (Eina_Inlist *)evas_object_smart_members_get_direct(obj);
+ Evas_Object_Protected_Data *member;
+
+ contained = (Eina_Inlist *)evas_object_smart_members_get_direct(eo_obj);
EINA_INLIST_FOREACH(contained, member)
{
- _evas_object_layer_set_child(member, obj, l);
+ _evas_object_layer_set_child(member->object, eo_obj, l);
}
}
- evas_object_inform_call_restack(obj);
+ evas_object_inform_call_restack(eo_obj);
}
EAPI short
-evas_object_layer_get(const Evas_Object *obj)
+evas_object_layer_get(const Evas_Object *eo_obj)
{
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
+ short layer = 0;
+ eo_do((Eo *)eo_obj, evas_obj_layer_get(&layer));
+ return layer;
+}
+
+void
+_layer_get(Eo *eo_obj EINA_UNUSED, void *_obj, va_list *list)
+{
+ short *layer = va_arg(*list, short *);
+ const Evas_Object_Protected_Data *obj = _obj;
if (obj->smart.parent)
{
- return obj->smart.parent->cur.layer;
+ Evas_Object_Protected_Data *smart_parent_obj = eo_data_get(obj->smart.parent, EVAS_OBJ_CLASS);
+ *layer = smart_parent_obj->cur.layer;
}
- return obj->cur.layer;
+ *layer = obj->cur.layer;
}