Add zone as a parameter to some functions so we can make sure that these

functions operate only on the current zone.



SVN revision: 44635
This commit is contained in:
Christopher Michael 2009-12-21 17:19:32 +00:00
parent 3f6dd189c8
commit f9f0e3f2fb
3 changed files with 60 additions and 51 deletions

View File

@ -329,7 +329,7 @@ illume_border_is_conformant(E_Border *bd)
}
Eina_List *
illume_border_valid_borders_get(void)
illume_border_valid_borders_get(E_Zone *zone)
{
Eina_List *bds, *l, *ret = NULL;
E_Border *bd;
@ -338,6 +338,7 @@ illume_border_valid_borders_get(void)
EINA_LIST_FOREACH(bds, l, bd)
{
if (!bd) continue;
if (bd->zone != zone) continue;
if (illume_border_is_top_shelf(bd)) continue;
if (illume_border_is_bottom_panel(bd)) continue;
if (illume_border_is_keyboard(bd)) continue;
@ -348,7 +349,7 @@ illume_border_valid_borders_get(void)
}
E_Border *
illume_border_valid_border_get(void)
illume_border_valid_border_get(E_Zone *zone)
{
Eina_List *bds, *l;
E_Border *bd, *ret = NULL;
@ -357,6 +358,7 @@ illume_border_valid_border_get(void)
EINA_LIST_FOREACH(bds, l, bd)
{
if (!bd) continue;
if (bd->zone != zone) continue;
if (illume_border_is_top_shelf(bd)) continue;
if (illume_border_is_bottom_panel(bd)) continue;
if (illume_border_is_keyboard(bd)) continue;
@ -368,24 +370,24 @@ illume_border_valid_border_get(void)
}
int
illume_border_valid_count_get(void)
illume_border_valid_count_get(E_Zone *zone)
{
Eina_List *l;
int count;
l = illume_border_valid_borders_get();
l = illume_border_valid_borders_get(zone);
count = eina_list_count(l);
eina_list_free(l);
return count;
}
E_Border *
illume_border_at_xy_get(int x, int y)
illume_border_at_xy_get(E_Zone *zone, int x, int y)
{
Eina_List *bds, *l;
E_Border *bd, *b = NULL;
bds = illume_border_valid_borders_get();
bds = illume_border_valid_borders_get(zone);
EINA_LIST_FOREACH(bds, l, bd)
{
if (((bd->fx.x == x) && (bd->fx.y == y)) ||
@ -400,12 +402,12 @@ illume_border_at_xy_get(int x, int y)
}
E_Border *
illume_border_in_region_get(int x, int y, int w, int h)
illume_border_in_region_get(E_Zone *zone, int x, int y, int w, int h)
{
Eina_List *bds, *l;
E_Border *bd, *b = NULL;
bds = illume_border_valid_borders_get();
bds = illume_border_valid_borders_get(zone);
EINA_LIST_FOREACH(bds, l, bd)
{
if (E_INSIDE(bd->x, bd->fx.y, x, y, w, h))
@ -419,7 +421,7 @@ illume_border_in_region_get(int x, int y, int w, int h)
}
E_Border *
illume_border_top_shelf_get(void)
illume_border_top_shelf_get(E_Zone *zone)
{
Eina_List *bds, *l;
E_Border *bd, *b = NULL;
@ -427,6 +429,7 @@ illume_border_top_shelf_get(void)
bds = e_border_client_list();
EINA_LIST_FOREACH(bds, l, bd)
{
if (bd->zone != zone) continue;
if (!illume_border_is_top_shelf(bd)) continue;
b = bd;
break;
@ -435,7 +438,7 @@ illume_border_top_shelf_get(void)
}
E_Border *
illume_border_bottom_panel_get(void)
illume_border_bottom_panel_get(E_Zone *zone)
{
Eina_List *bds, *l;
E_Border *bd, *b = NULL;
@ -443,6 +446,7 @@ illume_border_bottom_panel_get(void)
bds = e_border_client_list();
EINA_LIST_FOREACH(bds, l, bd)
{
if (bd->zone != zone) continue;
if (!illume_border_is_bottom_panel(bd)) continue;
b = bd;
break;
@ -451,41 +455,41 @@ illume_border_bottom_panel_get(void)
}
void
illume_border_top_shelf_pos_get(int *x, int *y)
illume_border_top_shelf_pos_get(E_Zone *zone, int *x, int *y)
{
E_Border *bd;
if (!(bd = illume_border_top_shelf_get())) return;
if (!(bd = illume_border_top_shelf_get(zone))) return;
if (x) *x = bd->x;
if (y) *y = bd->y;
}
void
illume_border_top_shelf_size_get(int *w, int *h)
illume_border_top_shelf_size_get(E_Zone *zone, int *w, int *h)
{
E_Border *bd;
if (!(bd = illume_border_top_shelf_get())) return;
if (!(bd = illume_border_top_shelf_get(zone))) return;
if (w) *w = bd->w;
if (h) *h = bd->h;
}
void
illume_border_bottom_panel_pos_get(int *x, int *y)
illume_border_bottom_panel_pos_get(E_Zone *zone, int *x, int *y)
{
E_Border *bd;
if (!(bd = illume_border_bottom_panel_get())) return;
if (!(bd = illume_border_bottom_panel_get(zone))) return;
if (x) *x = bd->x;
if (y) *y = bd->y;
}
void
illume_border_bottom_panel_size_get(int *w, int *h)
illume_border_bottom_panel_size_get(E_Zone *zone, int *w, int *h)
{
E_Border *bd;
if (!(bd = illume_border_bottom_panel_get())) return;
if (!(bd = illume_border_bottom_panel_get(zone))) return;
if (w) *w = bd->w;
if (h) *h = bd->h;
}
@ -542,7 +546,7 @@ illume_border_app1_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h)
if (!zone) return;
e_kbd_safe_app_region_get(zone, &nx, &ny, &nw, &nh);
illume_border_top_shelf_pos_get(NULL, &ty);
illume_border_top_shelf_pos_get(zone, NULL, &ty);
if (nh >= zone->h) nh = (ny + ty);
if (x) *x = nx;
if (y) *y = ny;
@ -558,9 +562,9 @@ illume_border_app2_safe_region_get(E_Zone *zone, int *x, int *y, int *w, int *h)
if (!zone) return;
e_kbd_safe_app_region_get(zone, &nx, NULL, &nw, &nh);
illume_border_top_shelf_pos_get(NULL, &ty);
illume_border_top_shelf_size_get(NULL, &th);
illume_border_bottom_panel_size_get(NULL, &bh);
illume_border_top_shelf_pos_get(zone, NULL, &ty);
illume_border_top_shelf_size_get(zone, NULL, &th);
illume_border_bottom_panel_size_get(zone, NULL, &bh);
ny = (ty + th);
nh = (nh - ny - bh);
if (x) *x = nx;
@ -792,6 +796,7 @@ _cb_event_client_message(void *data, int type, void *event)
{
Ecore_X_Illume_Mode mode;
E_Border *bd;
E_Zone *zone;
int lock = 1;
mode = ecore_x_e_illume_mode_get(ev->win);
@ -807,10 +812,12 @@ _cb_event_client_message(void *data, int type, void *event)
{
if (il_cfg->policy.mode.side == 0) lock = 0;
}
bd = illume_border_top_shelf_get();
zone = e_zone_current_get(e_container_current_get(e_manager_current_get()));
bd = illume_border_top_shelf_get(zone);
if (bd)
ecore_x_e_illume_drag_locked_set(bd->client.win, lock);
bd = illume_border_bottom_panel_get();
bd = illume_border_bottom_panel_get(zone);
if (bd)
ecore_x_e_illume_drag_locked_set(bd->client.win, lock);
}

View File

@ -55,18 +55,19 @@ Eina_Bool illume_border_is_side_pane_right(E_Border *bd);
Eina_Bool illume_border_is_overlay(E_Border *bd);
Eina_Bool illume_border_is_conformant(E_Border *bd);
Eina_List *illume_border_valid_borders_get(void);
E_Border *illume_border_valid_border_get(void);
int illume_border_valid_count_get(void);
E_Border *illume_border_at_xy_get(int x, int y);
E_Border *illume_border_in_region_get(int x, int y, int w, int h);
E_Border *illume_border_keyboard_get(void);
E_Border *illume_border_top_shelf_get(void);
E_Border *illume_border_bottom_panel_get(void);
void illume_border_top_shelf_pos_get(int *x, int *y);
void illume_border_top_shelf_size_get(int *w, int *h);
void illume_border_bottom_panel_pos_get(int *x, int *y);
void illume_border_bottom_panel_size_get(int *w, int *h);
Eina_List *illume_border_valid_borders_get(E_Zone *zone);
E_Border *illume_border_valid_border_get(E_Zone *zone);
int illume_border_valid_count_get(E_Zone *zone);
E_Border *illume_border_at_xy_get(E_Zone *zone, int x, int y);
E_Border *illume_border_in_region_get(E_Zone *zone, int x, int y, int w, int h);
E_Border *illume_border_keyboard_get(E_Zone *zone);
E_Border *illume_border_top_shelf_get(E_Zone *zone);
E_Border *illume_border_bottom_panel_get(E_Zone *zone);
void illume_border_top_shelf_pos_get(E_Zone *zone, int *x, int *y);
void illume_border_top_shelf_size_get(E_Zone *zone, int *w, int *h);
void illume_border_bottom_panel_pos_get(E_Zone *zone, int *x, int *y);
void illume_border_bottom_panel_size_get(E_Zone *zone, int *w, int *h);
void illume_border_slide_to(E_Border *bd, int x, int y, Illume_Anim_Class aclass);
void illume_border_min_get(E_Border *bd, int *mw, int *mh);
void illume_border_max_get(E_Border *bd, int *mw, int *mh);

View File

@ -109,14 +109,14 @@ _border_add(E_Border *bd)
bd->lock_user_stacking = 1;
/* conformant fullscreen borders just hide bottom panel */
b = illume_border_bottom_panel_get();
b = illume_border_bottom_panel_get(bd->zone);
if (b) e_border_fx_offset(b, 0, -panelsize);
/* for non-conformant fullscreen borders,
* we hide top shelf and bottom panel in all cases */
if (!conform)
{
b = illume_border_top_shelf_get();
b = illume_border_top_shelf_get(bd->zone);
if (b) e_border_fx_offset(b, 0, -shelfsize);
}
}
@ -134,7 +134,7 @@ _border_add(E_Border *bd)
&& (!bd->lock_focus_out))
e_border_focus_set(bd, 1, 1);
if (bd == illume_border_top_shelf_get())
if (bd == illume_border_top_shelf_get(bd->zone))
{
Ecore_X_Window xwin;
Ecore_X_Illume_Mode mode;
@ -155,14 +155,14 @@ _border_del(E_Border *bd)
E_Border *b;
/* conformant fullscreen borders just get bottom panel shown */
b = illume_border_bottom_panel_get();
b = illume_border_bottom_panel_get(bd->zone);
if (b) e_border_fx_offset(b, 0, 0);
/* for non-conformant fullscreen borders,
* we show top shelf and bottom panel in all cases */
if (!illume_border_is_conformant(bd))
{
b = illume_border_top_shelf_get();
b = illume_border_top_shelf_get(bd->zone);
if (b) e_border_fx_offset(b, 0, 0);
}
}
@ -358,7 +358,7 @@ _zone_layout_dual(E_Border *bd)
{
int ty;
illume_border_top_shelf_pos_get(NULL, &ty);
illume_border_top_shelf_pos_get(bd->zone, NULL, &ty);
if (ty <= bd->zone->y)
_zone_layout_dual_top(bd);
else
@ -375,7 +375,7 @@ _zone_layout_dual_top(E_Border *bd)
int count, conform;
/* get count of valid borders */
count = illume_border_valid_count_get();
count = illume_border_valid_count_get(bd->zone);
/* fetch if this border is conformant */
conform = illume_border_is_conformant(bd);
@ -407,7 +407,7 @@ _zone_layout_dual_top(E_Border *bd)
bw = kw;
bh = (kh - ss - ps);
/* grab the border at this location */
b = illume_border_at_xy_get(kx, shelfsize);
b = illume_border_at_xy_get(bd->zone, kx, shelfsize);
if ((b) && (bd != b))
{
@ -444,7 +444,7 @@ _zone_layout_dual_top(E_Border *bd)
else
{
/* no border at this location */
b = illume_border_valid_border_get();
b = illume_border_valid_border_get(bd->zone);
by = ky + ss;
bh = (ky - b->h);
}
@ -461,7 +461,7 @@ _zone_layout_dual_top_custom(E_Border *bd)
int zx, zy, zw, zh;
/* get count of valid borders */
count = illume_border_valid_count_get();
count = illume_border_valid_count_get(bd->zone);
/* fetch if this border is conformant */
conform = illume_border_is_conformant(bd);
@ -503,12 +503,12 @@ _zone_layout_dual_top_custom(E_Border *bd)
else
{
/* grab the border at this location */
bt = illume_border_at_xy_get(kx, ay);
bt = illume_border_at_xy_get(bd->zone, kx, ay);
if ((bt) && (bd != bt))
{
/* is there a border in the bottom section */
bb = illume_border_at_xy_get(kx, zy);
bb = illume_border_at_xy_get(bd->zone, kx, zy);
if (!bb)
{
bh = zh;
@ -566,7 +566,7 @@ _zone_layout_dual_left(E_Border *bd)
int count, conform;
/* get count of valid borders */
count = illume_border_valid_count_get();
count = illume_border_valid_count_get(bd->zone);
/* fetch if this border is conformant */
conform = illume_border_is_conformant(bd);
@ -597,8 +597,9 @@ _zone_layout_dual_left(E_Border *bd)
by = (ky + ss);
bw = kw;
bh = (kh - ss - ps);
/* grab the border at this location */
b = illume_border_at_xy_get(kx, shelfsize);
b = illume_border_at_xy_get(bd->zone, kx, shelfsize);
if ((b) && (bd != b))
{
@ -635,7 +636,7 @@ _zone_layout_dual_left(E_Border *bd)
else
{
/* no border at this location */
b = illume_border_valid_border_get();
b = illume_border_valid_border_get(bd->zone);
bx = kx;
bw = (kw - b->w);
}