e-modules/comp-scale: added option to show iconifed windows in scale. ignore dock (illume?) windows

SVN revision: 60641
This commit is contained in:
Hannes Janetzek 2011-06-23 16:18:05 +00:00
parent 54ee445efd
commit dcd38269b5
5 changed files with 82 additions and 43 deletions

View File

@ -8,12 +8,14 @@ struct _E_Config_Dialog_Data
double spacing;
int grow;
int tight;
int show_iconic;
int desks_layout_mode;
double desks_duration;
double desks_spacing;
int desks_grow;
int desks_tight;
int desks_show_iconic;
int fade_popups;
int fade_desktop;
@ -81,6 +83,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
{
cfdata->tight = scale_conf->tight;
cfdata->grow = scale_conf->grow;
cfdata->show_iconic = scale_conf->show_iconic;
cfdata->duration = scale_conf->scale_duration;
cfdata->spacing = scale_conf->spacing;
cfdata->desks_duration = scale_conf->desks_duration;
@ -92,6 +95,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->desks_layout_mode = scale_conf->desks_layout_mode;
cfdata->desks_tight = scale_conf->desks_tight;
cfdata->desks_grow = scale_conf->desks_grow;
cfdata->desks_show_iconic = scale_conf->desks_show_iconic;
cfdata->pager_duration = scale_conf->pager_duration;
cfdata->pager_fade_popups = scale_conf->pager_fade_popups;
cfdata->pager_fade_desktop = scale_conf->pager_fade_desktop;
@ -136,6 +140,9 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
ow = e_widget_check_add(evas, D_("Keep it tight!"),
&(cfdata->tight));
e_widget_framelist_object_append(of, ow);
ow = e_widget_check_add(evas, D_("Show iconified windows"),
&(cfdata->show_iconic));
e_widget_framelist_object_append(of, ow);
e_widget_list_object_append(o, of, 1, 1, 0.5);
e_widget_table_object_append(ot, o, 0, 0, 1, 1, 1, 1, 0, 0);
@ -166,6 +173,9 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
ow = e_widget_check_add(evas, D_("Fade in windows"),
&(cfdata->fade_windows));
e_widget_framelist_object_append(of, ow);
ow = e_widget_check_add(evas, D_("Show iconified windows"),
&(cfdata->desks_show_iconic));
e_widget_framelist_object_append(of, ow);
e_widget_list_object_append(o, of, 1, 1, 0.5);
e_widget_table_object_append(ot, o, 1, 0, 1, 1, 1, 1, 0, 0);
@ -211,6 +221,7 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
scale_conf->grow = cfdata->grow;
scale_conf->tight = cfdata->tight;
scale_conf->show_iconic = cfdata->show_iconic;
scale_conf->scale_duration = cfdata->duration;
scale_conf->spacing = cfdata->spacing;
scale_conf->desks_duration = cfdata->desks_duration;
@ -223,6 +234,7 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
scale_conf->desks_layout_mode = cfdata->desks_layout_mode;
scale_conf->desks_grow = cfdata->desks_grow;
scale_conf->desks_tight = cfdata->desks_tight;
scale_conf->desks_show_iconic = cfdata->desks_show_iconic;
scale_conf->pager_duration = cfdata->pager_duration;
scale_conf->pager_fade_popups = cfdata->pager_fade_popups;
scale_conf->pager_fade_windows = cfdata->pager_fade_windows;

View File

@ -194,12 +194,14 @@ e_modapi_init(E_Module *m)
E_CONFIG_VAL(D, T, layout_mode, INT);
E_CONFIG_VAL(D, T, grow, UCHAR);
E_CONFIG_VAL(D, T, show_iconic, UCHAR);
E_CONFIG_VAL(D, T, tight, UCHAR);
E_CONFIG_VAL(D, T, scale_duration, DOUBLE);
E_CONFIG_VAL(D, T, spacing, DOUBLE);
E_CONFIG_VAL(D, T, desks_layout_mode, INT);
E_CONFIG_VAL(D, T, desks_grow, UCHAR);
E_CONFIG_VAL(D, T, desks_show_iconic, UCHAR);
E_CONFIG_VAL(D, T, desks_tight, UCHAR);
E_CONFIG_VAL(D, T, desks_duration, DOUBLE);
E_CONFIG_VAL(D, T, desks_spacing, DOUBLE);

View File

@ -40,6 +40,7 @@ struct _Config
int layout_mode;
unsigned char tight;
unsigned char grow;
unsigned char show_iconic;
double scale_duration;
double spacing;
@ -47,6 +48,7 @@ struct _Config
int desks_layout_mode;
unsigned char desks_tight;
unsigned char desks_grow;
unsigned char desks_show_iconic;
double desks_duration;
double desks_spacing;
unsigned char fade_windows;

View File

@ -92,15 +92,13 @@ _pager_place_desks(double scale)
o = eina_list_data_get(l);
evas_object_move(o,
(scale * (min_x + (x - current_desk->x) * zone->w)) +
(1.0 - scale) * (min_x + x * desk_w),
(scale * (min_y + (y - current_desk->y) * zone->h)) +
(1.0 - scale) * (min_y + y * desk_h));
(scale * (double)(min_x + (x - current_desk->x) * zone->w)) +
(1.0 - scale) * (double)(min_x + x * desk_w),
(scale * (double)(min_y + (y - current_desk->y) * zone->h)) +
(1.0 - scale) * (double)(min_y + y * desk_h));
evas_object_resize(o,
(scale * zone->w) +
(1.0 - scale) * (desk_w - OFFSET),
(scale * zone->h) +
(1.0 - scale) * (desk_h - OFFSET));
(scale * (double)zone->w) + (1.0 - scale) * (double)(desk_w - OFFSET),
(scale * (double)zone->h) + (1.0 - scale) * (double)(desk_h - OFFSET));
evas_object_color_set(o, a, a, a, a);
@ -117,8 +115,8 @@ _pager_place_windows(double scale)
EINA_LIST_FOREACH(items, l, it)
{
it->cur_w = it->bd->w * scale + it->w * (1.0 - scale);
it->cur_h = it->bd->h * scale + it->h * (1.0 - scale);
it->cur_w = (double)it->bd->w * scale + it->w * (1.0 - scale);
it->cur_h = (double)it->bd->h * scale + it->h * (1.0 - scale);
it->cur_x = it->bd_x * scale + it->x * (1.0 - scale);
it->cur_y = it->bd_y * scale + it->y * (1.0 - scale);
@ -659,6 +657,12 @@ _pager_win_new(Evas *e, E_Manager *man, E_Manager_Comp_Source *src)
if (cw->bd->iconic)
return NULL;
if (cw->bd->client.qtopia.soft_menu)
return NULL;
if (cw->bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DOCK)
return NULL;
it = E_NEW(Item, 1);
it->bd = cw->bd;
it->desk = it->bd->desk;

View File

@ -19,6 +19,7 @@ struct _Item
double scale;
Eina_Bool was_hidden;
Eina_Bool was_shaded;
Eina_Bool fade;
double x;
@ -105,8 +106,9 @@ static int step_count;
static Item *background = NULL;
static Item *selected_item = NULL;
static E_Desk *current_desk = NULL;
static int show_all_desks = EINA_FALSE;
static int send_to_desk = EINA_FALSE;
static Eina_Bool show_all_desks = EINA_FALSE;
static Eina_Bool show_iconified = EINA_FALSE;
static Eina_Bool send_to_desk = EINA_FALSE;
static int scale_layout;
static int init_method = 0;
static const char *match_class = NULL;
@ -126,10 +128,10 @@ _scale_place_windows(double scale)
EINA_LIST_FOREACH(items, l, it)
{
it->cur_w = it->bd->w * scale + it->w * (1.0 - scale);
it->cur_h = it->bd->h * scale + it->h * (1.0 - scale);
it->cur_x = it->bd_x * scale + it->x * (1.0 - scale);
it->cur_y = it->bd_y * scale + it->y * (1.0 - scale);
it->cur_w = (double)it->bd->w * scale + it->w * (1.0 - scale) - 0.5;
it->cur_h = (double)it->bd->h * scale + it->h * (1.0 - scale) - 0.5;
it->cur_x = it->bd_x * scale + it->x * (1.0 - scale) + 0.5;
it->cur_y = it->bd_y * scale + it->y * (1.0 - scale) + 0.5;
evas_object_move(it->o, it->cur_x, it->cur_y);
evas_object_resize(it->o, it->cur_w, it->cur_h);
@ -412,6 +414,9 @@ _scale_finish()
it->was_hidden = EINA_FALSE;
e_border_uniconify(it->bd);
}
it->was_shaded = EINA_FALSE;
}
EINA_LIST_FREE(items, it)
@ -646,7 +651,11 @@ _scale_win_del(Item *it)
e_border_hide(it->bd, 1);
evas_object_hide(it->cw->shobj);
}
if (it->was_shaded)
{
e_border_shade(it->bd, E_DIRECTION_DOWN);
}
evas_object_del(it->o_win);
evas_object_del(it->o);
@ -707,18 +716,19 @@ _scale_win_new(Evas *e, E_Manager *man, E_Manager_Comp_Source *src, E_Desk *desk
if ((!show_all_desks) && (cw->bd->desk != desk))
return NULL;
if (cw->bd->client.qtopia.soft_menu)
return NULL;
if (cw->bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DOCK)
return NULL;
if (cw->bd->iconic)
{
if (!match_class)
{
/* TODO make option */
return NULL;
}
else if (!e_util_glob_match(cw->bd->client.icccm.class, match_class))
{
return NULL;
}
if (!show_iconified)
return NULL;
if ((match_class) && (!e_util_glob_match(cw->bd->client.icccm.class, match_class)))
return NULL;
}
it = E_NEW(Item, 1);
@ -748,6 +758,20 @@ _scale_win_new(Evas *e, E_Manager *man, E_Manager_Comp_Source *src, E_Desk *desk
evas_object_event_callback_add(it->o_win, EVAS_CALLBACK_DEL,
_scale_win_cb_delorig, it);
if (!it->bd->visible)
e_border_show(it->bd);
if (it->bd->shaded)
{
/* int tmp = e_config->border_shade_animate;
* e_config->border_shade_animate = EINA_FALSE;
*
* e_border_unshade(it->bd, E_DIRECTION_DOWN);
* it->was_shaded = EINA_TRUE;
*
* e_config->border_shade_animate = tmp; */
}
it->dx = cw->bd->desk->x - desk->x;
it->dy = cw->bd->desk->y - desk->y;
@ -765,26 +789,18 @@ _scale_win_new(Evas *e, E_Manager *man, E_Manager_Comp_Source *src, E_Desk *desk
it->cur_w = it->w;
it->cur_h = it->h;
if (!it->bd->visible)
e_border_show(it->bd);
/* if (it->bd->shaded)
* e_border_unshade(it->bd, ); */
edje_object_part_text_set(it->o, "e.text.label", e_border_name_get(it->bd));
edje_object_signal_emit(it->o, "show", "e");
if (it->bd->iconic)
{
evas_object_color_set(it->o, 0, 0, 0, 0);
it->was_hidden = EINA_TRUE;
}
if (match_class)
{
if (e_util_glob_match(cw->bd->client.icccm.class, match_class))
{
if (it->bd->iconic)
{
evas_object_color_set(it->o, 0, 0, 0, 0);
it->was_hidden = EINA_TRUE;
}
}
else
if (!e_util_glob_match(cw->bd->client.icccm.class, match_class))
{
items_fade = eina_list_append(items_fade, it);
@ -794,8 +810,8 @@ _scale_win_new(Evas *e, E_Manager *man, E_Manager_Comp_Source *src, E_Desk *desk
evas_object_move(it->o, it->bd->x, it->bd->y);
evas_object_resize(it->o, it->cw->pw, it->cw->ph);
evas_object_pass_events_set(it->o, 1);
return it;
return it;
}
}
@ -1366,6 +1382,7 @@ scale_run(E_Manager *man, const char *params, int _init_method)
{
scale_layout = scale_conf->desks_layout_mode;
show_all_desks = EINA_TRUE;
show_iconified = scale_conf->desks_show_iconic;
opt = params+12;
}
else if (!strncmp(params, "go_scale_class:", 15))
@ -1375,6 +1392,7 @@ scale_run(E_Manager *man, const char *params, int _init_method)
scale_layout = 1; /* slotted */
show_all_desks = EINA_TRUE;
show_iconified = EINA_TRUE;
opt = params+15;
eina_stringshare_replace(&match_class, opt);
}
@ -1382,6 +1400,7 @@ scale_run(E_Manager *man, const char *params, int _init_method)
{
scale_layout = scale_conf->layout_mode;
show_all_desks = EINA_FALSE;
show_iconified = scale_conf->show_iconic;
opt = params+8;
}
else