aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-02-20 10:51:58 +0000
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-02-22 13:18:30 +0000
commit159373a340b888ce4cdf9985010b90b0b64c237c (patch)
tree4f002f72989b18994c0126e46ba9e793a2082f71
parent35d246bbf4f2f83ee779e2c0af1bafe557dd80ee (diff)
downloadenlightenment-159373a340b888ce4cdf9985010b90b0b64c237c.tar.gz
enlightenment-159373a340b888ce4cdf9985010b90b0b64c237c.tar.xz
enlightenment-159373a340b888ce4cdf9985010b90b0b64c237c.zip
add comp util functions for returning the layer and effective layer of a comp object
-rw-r--r--src/bin/e_comp.c50
-rw-r--r--src/bin/e_comp.h12
2 files changed, 62 insertions, 0 deletions
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index bc298bc50..bc19d6c47 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -5208,3 +5208,53 @@ e_comp_block_window_del(void)
c->block_win = 0;
}
}
+
+
+EAPI unsigned int
+e_comp_e_object_layer_get(const E_Object *obj)
+{
+ if (!obj) return 0;
+ switch (obj->type)
+ {
+ E_Gadcon *gc;
+
+ case E_GADCON_TYPE:
+ gc = (E_Gadcon *)obj;
+ if (gc->shelf)
+ {
+ if (gc->shelf->popup)
+ return E_COMP_CANVAS_LAYER_LAYOUT + gc->shelf->popup->layer;
+ return E_COMP_CANVAS_LAYER_DESKTOP_TOP;
+ }
+ if (!gc->toolbar) return E_COMP_CANVAS_LAYER_DESKTOP;
+ return E_COMP_CANVAS_LAYER_LAYOUT + gc->toolbar->fwin->border->layer;
+
+ case E_GADCON_CLIENT_TYPE:
+ gc = ((E_Gadcon_Client *)(obj))->gadcon;
+ if (gc->shelf)
+ {
+ if (gc->shelf->popup)
+ return E_COMP_CANVAS_LAYER_LAYOUT + gc->shelf->popup->layer;
+ return E_COMP_CANVAS_LAYER_DESKTOP_TOP;
+ }
+ if (!gc->toolbar) return E_COMP_CANVAS_LAYER_DESKTOP;
+ return E_COMP_CANVAS_LAYER_LAYOUT + gc->toolbar->fwin->border->layer;
+
+ case E_WIN_TYPE:
+ return E_COMP_CANVAS_LAYER_LAYOUT + ((E_Win *)(obj))->border->layer;
+
+ case E_ZONE_TYPE:
+ return E_COMP_CANVAS_LAYER_DESKTOP;
+
+ case E_BORDER_TYPE:
+ return E_COMP_CANVAS_LAYER_LAYOUT + ((E_Win *)(obj))->border->layer;
+
+ case E_POPUP_TYPE:
+ return ((E_Popup *)(obj))->comp_layer + ((E_Popup *)(obj))->layer;
+
+ /* FIXME: add more types as needed */
+ default:
+ break;
+ }
+ return 0;
+}
diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h
index 7aef22ac9..f14495e70 100644
--- a/src/bin/e_comp.h
+++ b/src/bin/e_comp.h
@@ -256,6 +256,7 @@ EAPI void e_comp_ignore_win_add(Ecore_X_Window win);
#define E_LAYER_LAYOUT_ADD_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_ABOVE)
EAPI void e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Layer layer, E_Comp_Canvas_Stack stack);
+EAPI unsigned int e_comp_e_object_layer_get(const E_Object *obj);
static inline E_Comp *
e_comp_util_evas_object_comp_get(Evas_Object *obj)
@@ -281,6 +282,17 @@ e_comp_win_ignore_events_set(E_Comp_Win *cw, Eina_Bool ignore)
evas_object_pass_events_set(cw->shobj, ignore);
}
+static inline unsigned int
+e_comp_e_object_layer_effective_get(const E_Object *obj)
+{
+ unsigned int layer;
+
+ layer = e_comp_e_object_layer_get(obj);
+ if ((layer > E_COMP_CANVAS_LAYER_LAYOUT) && (layer < E_COMP_CANVAS_LAYER_POPUP))
+ layer = E_COMP_CANVAS_LAYER_LAYOUT;
+ return layer;
+}
+
EAPI void e_comp_util_wins_print(const E_Comp *c);
#endif