return 1;
}
+EAPI void
+e_zone_all_edge_flip_eval(void)
+{
+ Eina_List *l, *ll, *lll;
+ E_Manager *man;
+ E_Container *con;
+ E_Zone *zone;
+
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
+ {
+ EINA_LIST_FOREACH(man->containers, ll, con)
+ {
+ EINA_LIST_FOREACH(con->zones, lll, zone)
+ {
+ e_zone_edge_flip_eval(zone);
+ }
+ }
+ }
+}
+
static void
_e_zone_black_new(E_Zone *zone)
{
e_object_ref(E_OBJECT(ev->zone));
ecore_event_add(E_EVENT_ZONE_ADD, ev, _e_zone_event_add_free, NULL);
+ e_zone_all_edge_flip_eval();
return zone;
}
zone->x = x;
zone->y = y;
evas_object_move(zone->bg_object, x, y);
- if (zone->bg_scrollframe)
- evas_object_move(zone->bg_scrollframe, x, y);
evas_object_move(zone->bg_event_object, x, y);
evas_object_move(zone->bg_clip_object, x, y);
zone->w = w;
zone->h = h;
evas_object_resize(zone->bg_object, w, h);
- if (zone->bg_scrollframe)
- evas_object_resize(zone->bg_scrollframe, w, h);
evas_object_resize(zone->bg_event_object, w, h);
evas_object_resize(zone->bg_clip_object, w, h);
zone->h = h;
evas_object_move(zone->bg_object, x, y);
- if (zone->bg_scrollframe)
- evas_object_move(zone->bg_scrollframe, x, y);
evas_object_move(zone->bg_event_object, x, y);
evas_object_move(zone->bg_clip_object, x, y);
evas_object_resize(zone->bg_object, w, h);
- if (zone->bg_scrollframe)
- evas_object_resize(zone->bg_scrollframe, w, h);
evas_object_resize(zone->bg_event_object, w, h);
evas_object_resize(zone->bg_clip_object, w, h);
else
{
noflip:
-
if (zone->flip.es)
e_shelf_toggle(zone->flip.es, 0);
zone->flip.es = NULL;
EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
if (es->zone != zone) continue;
- switch(es->gadcon->orient)
+ switch (es->gadcon->orient)
{
case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL:
zone->flip.es = es;
e_shelf_toggle(es, 1);
}
- switch(edge)
+ switch (edge)
{
case E_ZONE_EDGE_LEFT:
if (E_ZONE_FLIP_LEFT(zone)) ok = 1;
}
if (!ok) return;
bind = e_bindings_edge_get("desk_flip_in_direction", edge, 0);
+ if (!bind) bind = e_bindings_edge_get("desk_flip_by", edge, 0);
if (bind)
{
zev = E_NEW(E_Event_Zone_Edge, 1);
e_desk_show(desk);
}
+ e_zone_edge_flip_eval(zone);
+
ev = E_NEW(E_Event_Zone_Desk_Count_Set, 1);
if (!ev) return;
ev->zone = zone;
dx = zone->desk_x_current + dx;
dy = zone->desk_y_current + dy;
e_zone_desk_flip_to(zone, dx, dy);
+ e_zone_edge_flip_eval(zone);
}
EAPI void
}
desk = e_desk_at_xy_get(zone, x, y);
if (desk) e_desk_show(desk);
+ e_zone_edge_flip_eval(zone);
}
EAPI void
while (dx < 0)
dx += (zone->desk_x_count * zone->desk_y_count);
e_zone_desk_linear_flip_to(zone, dx);
+ e_zone_edge_flip_eval(zone);
}
EAPI void
y = x / zone->desk_x_count;
x = x - (y * zone->desk_x_count);
e_zone_desk_flip_to(zone, x, y);
+ e_zone_edge_flip_eval(zone);
}
EAPI void
if (zone->corner.bottom_right) ecore_x_window_show(zone->corner.bottom_right);
if (zone->corner.bottom_left) ecore_x_window_show(zone->corner.bottom_left);
if (zone->corner.left_bottom) ecore_x_window_show(zone->corner.left_bottom);
+ e_zone_edge_flip_eval(zone);
}
}
}
}
EAPI void
+e_zone_edges_desk_flip_capable(E_Zone *zone, Eina_Bool l, Eina_Bool r, Eina_Bool t, Eina_Bool b)
+{
+ if (l)
+ {
+ if (e_bindings_edge_flippable_get(E_ZONE_EDGE_LEFT))
+ {
+ if (zone->edge.left) ecore_x_window_show(zone->edge.left);
+ }
+ }
+ else
+ {
+ if (zone->edge.left) ecore_x_window_hide(zone->edge.left);
+ }
+ if (r)
+ {
+ if (e_bindings_edge_flippable_get(E_ZONE_EDGE_RIGHT))
+ {
+ if (zone->edge.right) ecore_x_window_show(zone->edge.right);
+ }
+ }
+ else
+ {
+ if (zone->edge.right) ecore_x_window_hide(zone->edge.right);
+ }
+ if (t)
+ {
+ if (e_bindings_edge_flippable_get(E_ZONE_EDGE_TOP))
+ {
+ if (zone->edge.top) ecore_x_window_show(zone->edge.top);
+ }
+ }
+ else
+ {
+ if (zone->edge.top) ecore_x_window_hide(zone->edge.top);
+ }
+ if (b)
+ {
+ if (e_bindings_edge_flippable_get(E_ZONE_EDGE_BOTTOM))
+ {
+ if (zone->edge.bottom) ecore_x_window_show(zone->edge.bottom);
+ }
+ }
+ else
+ {
+ if (zone->edge.bottom) ecore_x_window_hide(zone->edge.bottom);
+ }
+ if ((!l) && (!t))
+ {
+ if (zone->corner.left_top) ecore_x_window_hide(zone->corner.left_top);
+ if (zone->corner.top_left) ecore_x_window_hide(zone->corner.top_left);
+ }
+ else
+ {
+ if (e_bindings_edge_flippable_get(E_ZONE_EDGE_TOP_LEFT))
+ {
+ if (zone->corner.left_top) ecore_x_window_show(zone->corner.left_top);
+ if (zone->corner.top_left) ecore_x_window_show(zone->corner.top_left);
+ }
+ }
+ if ((!r) && (!t))
+ {
+ if (zone->corner.right_top) ecore_x_window_hide(zone->corner.right_top);
+ if (zone->corner.top_right) ecore_x_window_hide(zone->corner.top_right);
+ }
+ else
+ {
+ if (e_bindings_edge_flippable_get(E_ZONE_EDGE_TOP_RIGHT))
+ {
+ if (zone->corner.right_top) ecore_x_window_show(zone->corner.right_top);
+ if (zone->corner.top_right) ecore_x_window_show(zone->corner.top_right);
+ }
+ }
+ if ((!l) && (!b))
+ {
+ if (zone->corner.left_bottom) ecore_x_window_hide(zone->corner.left_bottom);
+ if (zone->corner.bottom_left) ecore_x_window_hide(zone->corner.bottom_left);
+ }
+ else
+ {
+ if (e_bindings_edge_flippable_get(E_ZONE_EDGE_BOTTOM_LEFT))
+ {
+ if (zone->corner.left_bottom) ecore_x_window_show(zone->corner.left_bottom);
+ if (zone->corner.bottom_left) ecore_x_window_show(zone->corner.bottom_left);
+ }
+ }
+ if ((!r) && (!b))
+ {
+ if (zone->corner.right_bottom) ecore_x_window_hide(zone->corner.right_bottom);
+ if (zone->corner.bottom_right) ecore_x_window_hide(zone->corner.bottom_right);
+ }
+ else
+ {
+ if (e_bindings_edge_flippable_get(E_ZONE_EDGE_BOTTOM_RIGHT))
+ {
+ if (zone->corner.right_bottom) ecore_x_window_show(zone->corner.right_bottom);
+ if (zone->corner.bottom_right) ecore_x_window_show(zone->corner.bottom_right);
+ }
+ }
+}
+
+EAPI Eina_Bool
+e_zone_exists_direction(E_Zone *zone, E_Zone_Edge edge)
+{
+ Eina_List *l;
+ E_Zone *z2;
+
+ EINA_LIST_FOREACH(zone->container->zones, l, z2)
+ {
+ if (zone == z2) continue;
+
+ switch (edge)
+ {
+ case E_ZONE_EDGE_TOP_LEFT:
+ if (((E_SPANS_COMMON(0, zone->x + zone->w, z2->x, z2->w)) &&
+ (z2->y < zone->y)) ||
+ ((E_SPANS_COMMON(0, zone->y + zone->h, z2->y, z2->h)) &&
+ (z2->x < zone->x)))
+ return EINA_TRUE;
+ break;
+ case E_ZONE_EDGE_TOP:
+ if ((E_SPANS_COMMON(zone->x, zone->w, z2->x, z2->w)) &&
+ (z2->y < zone->y))
+ return EINA_TRUE;
+ break;
+ case E_ZONE_EDGE_TOP_RIGHT:
+ if (((E_SPANS_COMMON(zone->x, 99999, z2->x, z2->w)) &&
+ (z2->y < zone->y)) ||
+ ((E_SPANS_COMMON(0, zone->y + zone->h, z2->y, z2->h)) &&
+ (z2->x >= (zone->x + zone->w))))
+ return EINA_TRUE;
+ break;
+
+ case E_ZONE_EDGE_LEFT:
+ if ((E_SPANS_COMMON(zone->y, zone->h, z2->y, z2->h)) &&
+ (z2->x < zone->x))
+ return EINA_TRUE;
+ break;
+
+ case E_ZONE_EDGE_RIGHT:
+ if ((E_SPANS_COMMON(zone->y, zone->h, z2->y, z2->h)) &&
+ (z2->x >= (zone->x + zone->w)))
+ return EINA_TRUE;
+ break;
+
+ case E_ZONE_EDGE_BOTTOM_LEFT:
+ if (((E_SPANS_COMMON(0, zone->x + zone->w, z2->x, z2->w)) &&
+ (z2->y >= (zone->y + zone->h))) ||
+ ((E_SPANS_COMMON(zone->y, 99999, z2->y, z2->h)) &&
+ (z2->x < zone->x)))
+ return EINA_TRUE;
+ break;
+ case E_ZONE_EDGE_BOTTOM:
+ if ((E_SPANS_COMMON(zone->x, zone->w, z2->x, z2->w)) &&
+ (z2->y >= (zone->y + zone->h)))
+ return EINA_TRUE;
+ break;
+ case E_ZONE_EDGE_BOTTOM_RIGHT:
+ if (((E_SPANS_COMMON(zone->x, 99999, z2->x, z2->w)) &&
+ (z2->y >= (zone->y + zone->h))) ||
+ ((E_SPANS_COMMON(zone->y, 99999, z2->y, z2->h)) &&
+ (z2->x < zone->x)))
+ return EINA_TRUE;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return EINA_FALSE;
+}
+
+
+EAPI void
+e_zone_edge_flip_eval(E_Zone *zone)
+{
+ Eina_Bool lf, rf, tf, bf;
+
+ lf = rf = tf = bf = EINA_TRUE;
+ if (zone->desk_x_count <= 1) lf = rf = EINA_FALSE;
+ else if (!e_config->desk_flip_wrap)
+ {
+ if (zone->desk_x_current == 0) lf = EINA_FALSE;
+ if (zone->desk_x_current == (zone->desk_x_count - 1)) rf = EINA_FALSE;
+ }
+ if (zone->desk_y_count <= 1) tf = bf = EINA_FALSE;
+ else if (!e_config->desk_flip_wrap)
+ {
+ if (zone->desk_y_current == 0) tf = EINA_FALSE;
+ if (zone->desk_y_current == (zone->desk_y_count - 1)) bf = EINA_FALSE;
+ }
+ e_zone_edges_desk_flip_capable(zone, lf, rf, tf, bf);
+}
+
+EAPI void
e_zone_edge_new(E_Zone_Edge edge)
{
Eina_List *l, *ll, *lll;
E_Zone *zone;
int cw, ch;
+ // explicitly disallow edge bindings when we have more than 1 root
+ // window (ie pure old multihead) since we don't know which direction
+ // other root windows are in
+ if (eina_list_count(e_manager_list()) > 1) return;
EINA_LIST_FOREACH(e_manager_list(), l, man)
{
EINA_LIST_FOREACH(man->containers, ll, con)
{
EINA_LIST_FOREACH(con->zones, lll, zone)
{
+ // don't allow bindings on edges that are on the boundary
+ // between zones
+ if (e_zone_exists_direction(zone, edge)) continue;
cw = zone->w * E_ZONE_CORNER_RATIO;
ch = zone->h * E_ZONE_CORNER_RATIO;
switch (edge)
{
case E_ZONE_EDGE_NONE:
- /* noop */
+ /* noop */
break;
case E_ZONE_EDGE_LEFT:
switch (edge)
{
case E_ZONE_EDGE_NONE:
- /* noop */
+ /* noop */
break;
case E_ZONE_EDGE_LEFT:
_e_zone_free(E_Zone *zone)
{
E_Container *con;
- Ecore_Animator *anim;
- void *data;
int x, y;
/* Delete the edge windows if they exist */
con = zone->container;
if (zone->name) eina_stringshare_del(zone->name);
con->zones = eina_list_remove(con->zones, zone);
- anim = evas_object_data_get(zone->bg_object, "switch_animator");
- if (anim) ecore_animator_del(anim);
- data = evas_object_data_get(zone->bg_object, "switch_animator_params");
- if (data) E_FREE(data);
evas_object_del(zone->bg_event_object);
evas_object_del(zone->bg_clip_object);
evas_object_del(zone->bg_object);
- evas_object_del(zone->bg_scrollframe);
if (zone->prev_bg_object) evas_object_del(zone->prev_bg_object);
if (zone->transition_object) evas_object_del(zone->transition_object);
zone->flip.bind->timer = NULL;
E_FREE(zone->flip.ev);
- return ECORE_CALLBACK_RENEW;
+ return ECORE_CALLBACK_CANCEL;
}
static void