Start work on dual-mode window sizing/position.

SVN revision: 44109
This commit is contained in:
Christopher Michael 2009-12-01 20:51:30 +00:00
parent a94c2e4e6b
commit 540383bfe7
1 changed files with 34 additions and 14 deletions

View File

@ -4,6 +4,14 @@
#include "e_mod_layout.h"
#include "e_mod_layout_illume.h"
/* local function prototypes */
static void _border_calc_position(E_Zone *z, E_Border *bd, int *x, int *y, int *w, int *h);
/* local variables */
static int shelfsize = 0;
static int kbdsize = 0;
static int panelsize = 0;
static void
_border_add(E_Border *bd)
{ // handle a border being added
@ -34,11 +42,6 @@ _zone_layout(E_Zone *z)
Eina_List *l, *borders;
E_Border *bd;
// data for state
int shelfsize = 0;
int kbdsize = 0;
int panelsize = 0;
// phase 1. loop through borders to figure out sizes of things
borders = e_border_client_list();
EINA_LIST_FOREACH(borders, l, bd)
@ -94,7 +97,10 @@ _zone_layout(E_Zone *z)
}
else if (illume_border_is_home(bd))
{
e_border_move_resize(bd, z->x, z->y + shelfsize, z->w, z->h - shelfsize);
int x, y, w, h;
_border_calc_position(z, bd, &x, &y, &w, &h);
e_border_move_resize(bd, x, y, w, h);
if (bd->layer != 50) e_border_layer_set(bd, 50);
}
else if (illume_border_is_dialog(bd))
@ -105,14 +111,10 @@ _zone_layout(E_Zone *z)
}
else
{
if (il_cfg->policy.mode.dual)
{
/* determine where to place this border based on if any
* other borders are present, and also based on what the
* current policy 'side' is set to */
}
else
e_border_move_resize(bd, z->x, z->y + shelfsize, z->w, z->h - shelfsize - kbdsize);
int x, y, w, h;
_border_calc_position(z, bd, &x, &y, &w, &h);
e_border_move_resize(bd, x, y, w, h);
if (bd->layer != 100) e_border_layer_set(bd, 100);
}
}
@ -124,6 +126,24 @@ _zone_move_resize(E_Zone *z)
_zone_layout(z);
}
/* local functions */
static void
_border_calc_position(E_Zone *z, E_Border *bd, int *x, int *y, int *w, int *h)
{
if ((!z) || (!bd)) return;
if (il_cfg->policy.mode.dual)
{
}
else
{
if (x) *x = z->x;
if (y) *y = (z->y + shelfsize);
if (w) *w = z->w;
if (h) *h = (z->h - shelfsize - panelsize);
}
}
//////////////////////////////////////////////////////////////////////////////
const Illume_Layout_Mode laymode =
{