forked from enlightenment/enlightenment
remember stuff is now... a... DIALOG too :)
SVN revision: 17705
This commit is contained in:
parent
1cb7757daa
commit
8a0ea631a8
|
@ -97,7 +97,8 @@ e_config_dialog.h \
|
||||||
e_int_config_focus.h \
|
e_int_config_focus.h \
|
||||||
e_icon_layout.h \
|
e_icon_layout.h \
|
||||||
e_int_border_locks.h \
|
e_int_border_locks.h \
|
||||||
e_thumb.h
|
e_thumb.h \
|
||||||
|
e_int_border_remember.h
|
||||||
|
|
||||||
enlightenment_src = \
|
enlightenment_src = \
|
||||||
e_user.c \
|
e_user.c \
|
||||||
|
@ -176,6 +177,7 @@ e_int_config_focus.c \
|
||||||
e_icon_layout.c \
|
e_icon_layout.c \
|
||||||
e_int_border_locks.c \
|
e_int_border_locks.c \
|
||||||
e_thumb.c \
|
e_thumb.c \
|
||||||
|
e_int_border_remember.c \
|
||||||
$(ENLIGHTENMENTHEADERS)
|
$(ENLIGHTENMENTHEADERS)
|
||||||
|
|
||||||
enlightenment_SOURCES = \
|
enlightenment_SOURCES = \
|
||||||
|
|
|
@ -2589,6 +2589,11 @@ _e_border_free(E_Border *bd)
|
||||||
e_object_del(E_OBJECT(bd->border_locks_dialog));
|
e_object_del(E_OBJECT(bd->border_locks_dialog));
|
||||||
bd->border_locks_dialog = NULL;
|
bd->border_locks_dialog = NULL;
|
||||||
}
|
}
|
||||||
|
if (bd->border_remember_dialog)
|
||||||
|
{
|
||||||
|
e_object_del(E_OBJECT(bd->border_remember_dialog));
|
||||||
|
bd->border_remember_dialog = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
_e_border_menus_del(bd);
|
_e_border_menus_del(bd);
|
||||||
|
|
||||||
|
@ -2609,8 +2614,11 @@ _e_border_free(E_Border *bd)
|
||||||
}
|
}
|
||||||
if (bd->remember)
|
if (bd->remember)
|
||||||
{
|
{
|
||||||
e_remember_unuse(bd->remember);
|
E_Remember *rem;
|
||||||
|
|
||||||
|
rem = bd->remember;
|
||||||
bd->remember = NULL;
|
bd->remember = NULL;
|
||||||
|
e_remember_unuse(rem);
|
||||||
}
|
}
|
||||||
if (!bd->already_unparented)
|
if (!bd->already_unparented)
|
||||||
{
|
{
|
||||||
|
@ -2688,6 +2696,11 @@ _e_border_del(E_Border *bd)
|
||||||
e_object_del(E_OBJECT(bd->border_locks_dialog));
|
e_object_del(E_OBJECT(bd->border_locks_dialog));
|
||||||
bd->border_locks_dialog = NULL;
|
bd->border_locks_dialog = NULL;
|
||||||
}
|
}
|
||||||
|
if (bd->border_remember_dialog)
|
||||||
|
{
|
||||||
|
e_object_del(E_OBJECT(bd->border_remember_dialog));
|
||||||
|
bd->border_remember_dialog = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
_e_border_menus_del(bd);
|
_e_border_menus_del(bd);
|
||||||
if (bd->raise_timer)
|
if (bd->raise_timer)
|
||||||
|
@ -2768,12 +2781,6 @@ _e_border_menus_del(E_Border *bd)
|
||||||
{
|
{
|
||||||
int was_menu = 0;
|
int was_menu = 0;
|
||||||
|
|
||||||
if (bd->border_remember_menu)
|
|
||||||
{
|
|
||||||
e_object_del(E_OBJECT(bd->border_remember_menu));
|
|
||||||
bd->border_remember_menu = NULL;
|
|
||||||
was_menu = 1;
|
|
||||||
}
|
|
||||||
if (bd->border_stacking_menu)
|
if (bd->border_stacking_menu)
|
||||||
{
|
{
|
||||||
e_object_del(E_OBJECT(bd->border_stacking_menu));
|
e_object_del(E_OBJECT(bd->border_stacking_menu));
|
||||||
|
@ -5726,449 +5733,6 @@ _e_border_cb_border_menu_end(void *data, E_Menu *m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
e_remember_unuse(bd->remember);
|
|
||||||
e_remember_del(bd->remember);
|
|
||||||
bd->remember = NULL;
|
|
||||||
for (l = bd->border_remember_menu->items; l; l = l->next)
|
|
||||||
{
|
|
||||||
E_Menu_Item *mi2;
|
|
||||||
|
|
||||||
mi2 = l->data;
|
|
||||||
e_menu_item_toggle_set(mi2, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_first(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bd->remember->apply_first_only = e_menu_item_toggle_get(mi);
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_match_name(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->match |= E_REMEMBER_MATCH_NAME;
|
|
||||||
else
|
|
||||||
bd->remember->match &= ~E_REMEMBER_MATCH_NAME;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_match_class(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->match |= E_REMEMBER_MATCH_CLASS;
|
|
||||||
else
|
|
||||||
bd->remember->match &= ~E_REMEMBER_MATCH_CLASS;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_match_title(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->match |= E_REMEMBER_MATCH_TITLE;
|
|
||||||
else
|
|
||||||
bd->remember->match &= ~E_REMEMBER_MATCH_TITLE;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_match_role(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->match |= E_REMEMBER_MATCH_ROLE;
|
|
||||||
else
|
|
||||||
bd->remember->match &= ~E_REMEMBER_MATCH_ROLE;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_match_type(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->match |= E_REMEMBER_MATCH_TYPE;
|
|
||||||
else
|
|
||||||
bd->remember->match &= ~E_REMEMBER_MATCH_TYPE;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_match_transient(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->match |= E_REMEMBER_MATCH_TRANSIENT;
|
|
||||||
else
|
|
||||||
bd->remember->match &= ~E_REMEMBER_MATCH_TRANSIENT;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_pos(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_POS;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_POS;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_size(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_SIZE;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_SIZE;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_layer(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_LAYER;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_LAYER;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_locks(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_LOCKS;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_LOCKS;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_border(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_BORDER;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_BORDER;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_sticky(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_STICKY;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_STICKY;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_desktop(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_DESKTOP;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_DESKTOP;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_shade(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_SHADE;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_SHADE;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_zone(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_ZONE;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_ZONE;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_skip_winlist(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_SKIP_WINLIST;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_SKIP_WINLIST;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember_apply_run(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (!bd->remember)
|
|
||||||
{
|
|
||||||
bd->remember = e_remember_new();
|
|
||||||
if (bd->remember)
|
|
||||||
{
|
|
||||||
e_remember_use(bd->remember);
|
|
||||||
e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (e_menu_item_toggle_get(mi))
|
|
||||||
bd->remember->apply |= E_REMEMBER_APPLY_RUN;
|
|
||||||
else
|
|
||||||
bd->remember->apply &= ~E_REMEMBER_APPLY_RUN;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_border_menu_cb_locks(void *data, E_Menu *m, E_Menu_Item *mi)
|
_e_border_menu_cb_locks(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
{
|
{
|
||||||
|
@ -6179,6 +5743,15 @@ _e_border_menu_cb_locks(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
e_int_border_locks(bd);
|
e_int_border_locks(bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_remember(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
bd = data;
|
||||||
|
if (bd->border_remember_dialog) return;
|
||||||
|
e_int_border_remember(bd);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_Time timestamp)
|
_e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_Time timestamp)
|
||||||
{
|
{
|
||||||
|
@ -6187,52 +5760,6 @@ _e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_T
|
||||||
|
|
||||||
if (bd->border_menu) return;
|
if (bd->border_menu) return;
|
||||||
|
|
||||||
m = e_menu_new();
|
|
||||||
bd->border_remember_menu = m;
|
|
||||||
|
|
||||||
#define NEW_REMEMBER_MI(txt, flag, var, cb) \
|
|
||||||
mi = e_menu_item_new(m); \
|
|
||||||
e_menu_item_label_set(mi, txt); \
|
|
||||||
e_menu_item_check_set(mi, 1); \
|
|
||||||
if ((bd->remember) && (bd->remember->flag & var)) \
|
|
||||||
e_menu_item_toggle_set(mi, 1); \
|
|
||||||
e_menu_item_callback_set(mi, cb, bd);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Remember This Window")); \
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
if (bd->remember)
|
|
||||||
e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_remember, bd);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
NEW_REMEMBER_MI(_("Remember This Instance Only"), apply_first_only, 1, _e_border_menu_cb_remember_first);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
NEW_REMEMBER_MI(_("Match by Name"), match, E_REMEMBER_MATCH_NAME, _e_border_menu_cb_remember_match_name);
|
|
||||||
NEW_REMEMBER_MI(_("Match by Class"), match, E_REMEMBER_MATCH_CLASS, _e_border_menu_cb_remember_match_class);
|
|
||||||
NEW_REMEMBER_MI(_("Match by Title"), match, E_REMEMBER_MATCH_TITLE, _e_border_menu_cb_remember_match_title);
|
|
||||||
NEW_REMEMBER_MI(_("Match by Role"), match, E_REMEMBER_MATCH_ROLE, _e_border_menu_cb_remember_match_role);
|
|
||||||
NEW_REMEMBER_MI(_("Match by Window Type"), match, E_REMEMBER_MATCH_TYPE, _e_border_menu_cb_remember_match_type);
|
|
||||||
NEW_REMEMBER_MI(_("Match by Transient Status"), match, E_REMEMBER_MATCH_TRANSIENT, _e_border_menu_cb_remember_match_transient);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Position"), apply, E_REMEMBER_APPLY_POS, _e_border_menu_cb_remember_apply_pos);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Size"), apply, E_REMEMBER_APPLY_SIZE, _e_border_menu_cb_remember_apply_size);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Stacking"), apply, E_REMEMBER_APPLY_LAYER, _e_border_menu_cb_remember_apply_layer);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Locks"), apply, E_REMEMBER_APPLY_LOCKS, _e_border_menu_cb_remember_apply_locks);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Border"), apply, E_REMEMBER_APPLY_BORDER, _e_border_menu_cb_remember_apply_border);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Stickiness"), apply, E_REMEMBER_APPLY_STICKY, _e_border_menu_cb_remember_apply_sticky);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Desktop"), apply, E_REMEMBER_APPLY_DESKTOP, _e_border_menu_cb_remember_apply_desktop);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Shaded State"), apply, E_REMEMBER_APPLY_SHADE, _e_border_menu_cb_remember_apply_shade);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Zone"), apply, E_REMEMBER_APPLY_ZONE, _e_border_menu_cb_remember_apply_zone);
|
|
||||||
NEW_REMEMBER_MI(_("Remember Skip Window List"), apply, E_REMEMBER_APPLY_SKIP_WINLIST, _e_border_menu_cb_remember_apply_skip_winlist);
|
|
||||||
/*
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
NEW_REMEMBER_MI(_("Run this porgram on login"), apply, E_REMEMBER_APPLY_RUN, _e_border_menu_cb_remember_apply_run);
|
|
||||||
*/
|
|
||||||
|
|
||||||
m = e_menu_new();
|
m = e_menu_new();
|
||||||
bd->border_stacking_menu = m;
|
bd->border_stacking_menu = m;
|
||||||
/* Only allow to change layer for windows in "normal" layers */
|
/* Only allow to change layer for windows in "normal" layers */
|
||||||
|
@ -6412,7 +5939,7 @@ _e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_T
|
||||||
"widgets/border/default/locks");
|
"widgets/border/default/locks");
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
e_menu_item_label_set(mi, _("Remember"));
|
e_menu_item_label_set(mi, _("Remember"));
|
||||||
e_menu_item_submenu_set(mi, bd->border_remember_menu);
|
e_menu_item_callback_set(mi, _e_border_menu_cb_remember, bd);
|
||||||
e_menu_item_icon_edje_set(mi,
|
e_menu_item_icon_edje_set(mi,
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
"widgets/border/default/remember"),
|
"widgets/border/default/remember"),
|
||||||
|
|
|
@ -352,7 +352,7 @@ struct _E_Border
|
||||||
Evas_List *stick_desks;
|
Evas_List *stick_desks;
|
||||||
E_Menu *border_menu;
|
E_Menu *border_menu;
|
||||||
E_Config_Dialog *border_locks_dialog;
|
E_Config_Dialog *border_locks_dialog;
|
||||||
E_Menu *border_remember_menu;
|
E_Config_Dialog *border_remember_dialog;
|
||||||
E_Menu *border_stacking_menu;
|
E_Menu *border_stacking_menu;
|
||||||
Evas_List *pending_move_resize;
|
Evas_List *pending_move_resize;
|
||||||
|
|
||||||
|
|
|
@ -155,14 +155,18 @@ static void
|
||||||
_e_config_dialog_cb_apply(void *data, E_Dialog *dia)
|
_e_config_dialog_cb_apply(void *data, E_Dialog *dia)
|
||||||
{
|
{
|
||||||
E_Config_Dialog *cfd;
|
E_Config_Dialog *cfd;
|
||||||
|
int ok = 0;
|
||||||
|
|
||||||
cfd = dia->data;
|
cfd = dia->data;
|
||||||
if (cfd->view_type == E_CONFIG_DIALOG_CFDATA_TYPE_BASIC)
|
if (cfd->view_type == E_CONFIG_DIALOG_CFDATA_TYPE_BASIC)
|
||||||
cfd->view.basic.apply_cfdata(cfd, cfd->cfdata);
|
ok = cfd->view.basic.apply_cfdata(cfd, cfd->cfdata);
|
||||||
else
|
else
|
||||||
cfd->view.advanced.apply_cfdata(cfd, cfd->cfdata);
|
ok = cfd->view.advanced.apply_cfdata(cfd, cfd->cfdata);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
e_dialog_button_disable_num_set(cfd->dia, 0, 1);
|
e_dialog_button_disable_num_set(cfd->dia, 0, 1);
|
||||||
e_dialog_button_disable_num_set(cfd->dia, 1, 1);
|
e_dialog_button_disable_num_set(cfd->dia, 1, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -938,6 +938,10 @@ _e_container_free(E_Container *con)
|
||||||
ecore_x_window_del(con->event_win);
|
ecore_x_window_del(con->event_win);
|
||||||
/* We can't use e_object_del here, because border adds a ref to itself
|
/* We can't use e_object_del here, because border adds a ref to itself
|
||||||
* when it is removed, and the ref is never unref'ed */
|
* when it is removed, and the ref is never unref'ed */
|
||||||
|
/* FIXME: had to disable this as it was freeing already freed items during
|
||||||
|
* looping (particularly remember/lock config dialogs). this is just
|
||||||
|
* disabled until we put in some special handling for this
|
||||||
|
*
|
||||||
for (i = 0; i < 7; i++)
|
for (i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
for (l = con->layers[i].clients; l;)
|
for (l = con->layers[i].clients; l;)
|
||||||
|
@ -947,6 +951,7 @@ _e_container_free(E_Container *con)
|
||||||
e_object_free(E_OBJECT(tmp->data));
|
e_object_free(E_OBJECT(tmp->data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
for (l = con->zones; l;)
|
for (l = con->zones; l;)
|
||||||
{
|
{
|
||||||
tmp = l;
|
tmp = l;
|
||||||
|
|
|
@ -60,7 +60,7 @@ e_int_border_locks(E_Border *bd)
|
||||||
v.basic.create_widgets = _basic_create_widgets;
|
v.basic.create_widgets = _basic_create_widgets;
|
||||||
v.advanced.apply_cfdata = _advanced_apply_data;
|
v.advanced.apply_cfdata = _advanced_apply_data;
|
||||||
v.advanced.create_widgets = _advanced_create_widgets;
|
v.advanced.create_widgets = _advanced_create_widgets;
|
||||||
/* create config diaolg for NULL object/data */
|
/* create config diaolg for bd object/data */
|
||||||
cfd = e_config_dialog_new(bd->zone->container,
|
cfd = e_config_dialog_new(bd->zone->container,
|
||||||
_("Window Locks"), NULL, 0, &v, bd);
|
_("Window Locks"), NULL, 0, &v, bd);
|
||||||
bd->border_locks_dialog = cfd;
|
bd->border_locks_dialog = cfd;
|
||||||
|
|
|
@ -0,0 +1,486 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
#include "e.h"
|
||||||
|
|
||||||
|
/* PROTOTYPES - same all the time */
|
||||||
|
typedef struct _CFData CFData;
|
||||||
|
|
||||||
|
static void *_create_data(E_Config_Dialog *cfd);
|
||||||
|
static void _free_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
static int _basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
static int _advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata);
|
||||||
|
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata);
|
||||||
|
|
||||||
|
/* Actual config data we will be playing with whil the dialog is active */
|
||||||
|
#define MODE_NOTHING 0
|
||||||
|
#define MODE_GEOMETRY 1
|
||||||
|
#define MODE_LOCKS 2
|
||||||
|
#define MODE_GEOMETRY_LOCKS 3
|
||||||
|
#define MODE_ALL 4
|
||||||
|
struct _CFData
|
||||||
|
{
|
||||||
|
E_Border *border;
|
||||||
|
/*- BASIC -*/
|
||||||
|
int mode;
|
||||||
|
int warned;
|
||||||
|
/*- ADVANCED -*/
|
||||||
|
struct {
|
||||||
|
int match_name;
|
||||||
|
int match_class;
|
||||||
|
int match_title;
|
||||||
|
int match_role;
|
||||||
|
int match_type;
|
||||||
|
int match_transient;
|
||||||
|
int apply_first_only;
|
||||||
|
int apply_pos;
|
||||||
|
int apply_size;
|
||||||
|
int apply_layer;
|
||||||
|
int apply_locks;
|
||||||
|
int apply_border;
|
||||||
|
int apply_sticky;
|
||||||
|
int apply_desktop;
|
||||||
|
int apply_shade;
|
||||||
|
int apply_zone;
|
||||||
|
int apply_skip_winlist;
|
||||||
|
int apply_run; // unused atm
|
||||||
|
} remember;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* a nice easy setup function that does the dirty work */
|
||||||
|
void
|
||||||
|
e_int_border_remember(E_Border *bd)
|
||||||
|
{
|
||||||
|
E_Config_Dialog *cfd;
|
||||||
|
E_Config_Dialog_View v;
|
||||||
|
|
||||||
|
/* methods */
|
||||||
|
v.create_cfdata = _create_data;
|
||||||
|
v.free_cfdata = _free_data;
|
||||||
|
v.basic.apply_cfdata = _basic_apply_data;
|
||||||
|
v.basic.create_widgets = _basic_create_widgets;
|
||||||
|
v.advanced.apply_cfdata = _advanced_apply_data;
|
||||||
|
v.advanced.create_widgets = _advanced_create_widgets;
|
||||||
|
/* create config dialog for bd object/data */
|
||||||
|
cfd = e_config_dialog_new(bd->zone->container,
|
||||||
|
_("Window Remember"), NULL, 0, &v, bd);
|
||||||
|
bd->border_remember_dialog = cfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**--CREATE--**/
|
||||||
|
static void
|
||||||
|
_fill_data(CFData *cfdata)
|
||||||
|
{
|
||||||
|
if (cfdata->border->remember)
|
||||||
|
{
|
||||||
|
if (cfdata->border->remember->apply_first_only) cfdata->remember.apply_first_only = 1;
|
||||||
|
if (cfdata->border->remember->match & E_REMEMBER_MATCH_NAME) cfdata->remember.match_name = 1;
|
||||||
|
if (cfdata->border->remember->match & E_REMEMBER_MATCH_CLASS) cfdata->remember.match_class = 1;
|
||||||
|
if (cfdata->border->remember->match & E_REMEMBER_MATCH_TITLE) cfdata->remember.match_title = 1;
|
||||||
|
if (cfdata->border->remember->match & E_REMEMBER_MATCH_ROLE) cfdata->remember.match_role = 1;
|
||||||
|
if (cfdata->border->remember->match & E_REMEMBER_MATCH_TYPE) cfdata->remember.match_type = 1;
|
||||||
|
if (cfdata->border->remember->match & E_REMEMBER_MATCH_TRANSIENT) cfdata->remember.match_transient = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_POS) cfdata->remember.apply_pos = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_SIZE) cfdata->remember.apply_size = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_LAYER) cfdata->remember.apply_layer = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_LOCKS) cfdata->remember.apply_locks = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_BORDER) cfdata->remember.apply_border = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_STICKY) cfdata->remember.apply_sticky = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_DESKTOP) cfdata->remember.apply_desktop = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_SHADE) cfdata->remember.apply_shade = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_ZONE) cfdata->remember.apply_zone = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_SKIP_WINLIST) cfdata->remember.apply_skip_winlist = 1;
|
||||||
|
if (cfdata->border->remember->apply & E_REMEMBER_APPLY_RUN) cfdata->remember.apply_run = 1;
|
||||||
|
}
|
||||||
|
if (!cfdata->border->remember) cfdata->mode = MODE_NOTHING;
|
||||||
|
else if ((cfdata->remember.apply_pos) && (cfdata->remember.apply_size) &&
|
||||||
|
(cfdata->remember.apply_locks) && (cfdata->remember.apply_layer) &&
|
||||||
|
(cfdata->remember.apply_border) && (cfdata->remember.apply_sticky) &&
|
||||||
|
(cfdata->remember.apply_desktop) && (cfdata->remember.apply_shade) &&
|
||||||
|
(cfdata->remember.apply_zone) && (cfdata->remember.apply_skip_winlist))
|
||||||
|
cfdata->mode = MODE_ALL;
|
||||||
|
else if ((cfdata->remember.apply_pos) && (cfdata->remember.apply_size) &&
|
||||||
|
(cfdata->remember.apply_locks))
|
||||||
|
cfdata->mode = MODE_GEOMETRY_LOCKS;
|
||||||
|
else if ((cfdata->remember.apply_pos) && (cfdata->remember.apply_size))
|
||||||
|
cfdata->mode = MODE_GEOMETRY;
|
||||||
|
else if ((cfdata->remember.apply_locks))
|
||||||
|
cfdata->mode = MODE_LOCKS;
|
||||||
|
else cfdata->mode = MODE_NOTHING;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
_create_data(E_Config_Dialog *cfd)
|
||||||
|
{
|
||||||
|
/* Create cfdata - cfdata is a temporary block of config data that this
|
||||||
|
* dialog will be dealing with while configuring. it will be applied to
|
||||||
|
* the running systems/config in the apply methods
|
||||||
|
*/
|
||||||
|
CFData *cfdata;
|
||||||
|
|
||||||
|
cfdata = E_NEW(CFData, 1);
|
||||||
|
cfdata->border = cfd->data;
|
||||||
|
_fill_data(cfdata);
|
||||||
|
return cfdata;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_free_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
/* Free the cfdata */
|
||||||
|
cfdata->border->border_remember_dialog = NULL;
|
||||||
|
free(cfdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**--APPLY--**/
|
||||||
|
static int
|
||||||
|
_check_matches(E_Border *bd, int matchflags)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Evas_List *l;
|
||||||
|
int n = 0;
|
||||||
|
char *title;
|
||||||
|
|
||||||
|
title = (char *)e_border_name_get(bd);
|
||||||
|
for (l = e_border_client_list(); l; l = l->next)
|
||||||
|
{
|
||||||
|
E_Border *bd2;
|
||||||
|
int required_matches;
|
||||||
|
int matches;
|
||||||
|
char *title2;
|
||||||
|
|
||||||
|
bd2 = l->data;
|
||||||
|
matches = 0;
|
||||||
|
required_matches = 0;
|
||||||
|
if (matchflags & E_REMEMBER_MATCH_NAME) required_matches++;
|
||||||
|
if (matchflags & E_REMEMBER_MATCH_CLASS) required_matches++;
|
||||||
|
if (matchflags & E_REMEMBER_MATCH_TITLE) required_matches++;
|
||||||
|
if (matchflags & E_REMEMBER_MATCH_ROLE) required_matches++;
|
||||||
|
if (matchflags & E_REMEMBER_MATCH_TYPE) required_matches++;
|
||||||
|
if (matchflags & E_REMEMBER_MATCH_TRANSIENT) required_matches++;
|
||||||
|
title2 = (char *)e_border_name_get(bd2);
|
||||||
|
if ((matchflags & E_REMEMBER_MATCH_NAME) &&
|
||||||
|
((!e_util_strcmp(bd->client.icccm.name, bd2->client.icccm.name)) ||
|
||||||
|
(e_util_both_str_empty(bd->client.icccm.name, bd2->client.icccm.name))))
|
||||||
|
matches++;
|
||||||
|
if ((matchflags & E_REMEMBER_MATCH_CLASS) &&
|
||||||
|
((!e_util_strcmp(bd->client.icccm.class, bd2->client.icccm.class)) ||
|
||||||
|
(e_util_both_str_empty(bd->client.icccm.class, bd2->client.icccm.class))))
|
||||||
|
matches++;
|
||||||
|
if ((matchflags & E_REMEMBER_MATCH_TITLE) &&
|
||||||
|
((!e_util_strcmp(title, title2)) ||
|
||||||
|
(e_util_both_str_empty(title, title2))))
|
||||||
|
matches++;
|
||||||
|
if ((matchflags & E_REMEMBER_MATCH_ROLE) &&
|
||||||
|
((!e_util_strcmp(bd->client.icccm.window_role, bd2->client.icccm.window_role)) ||
|
||||||
|
(e_util_both_str_empty(bd->client.icccm.window_role, bd2->client.icccm.window_role))))
|
||||||
|
matches++;
|
||||||
|
if ((matchflags & E_REMEMBER_MATCH_TYPE) &&
|
||||||
|
(bd->client.netwm.type == bd2->client.netwm.type))
|
||||||
|
matches++;
|
||||||
|
if ((matchflags & E_REMEMBER_MATCH_TRANSIENT) &&
|
||||||
|
(((bd->client.icccm.transient_for) && (bd2->client.icccm.transient_for != 0)) ||
|
||||||
|
((!bd->client.icccm.transient_for) && (bd2->client.icccm.transient_for == 0))))
|
||||||
|
matches++;
|
||||||
|
if (matches >= required_matches) n++;
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
/* Actually take our cfdata settings and apply them in real life */
|
||||||
|
|
||||||
|
if (cfdata->mode == MODE_NOTHING)
|
||||||
|
{
|
||||||
|
if (cfdata->border->remember)
|
||||||
|
{
|
||||||
|
E_Remember *rem;
|
||||||
|
|
||||||
|
rem = cfdata->border->remember;
|
||||||
|
cfdata->border->remember = NULL;
|
||||||
|
e_remember_unuse(rem);
|
||||||
|
e_remember_del(rem);
|
||||||
|
}
|
||||||
|
e_config_save_queue();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (!cfdata->warned)
|
||||||
|
{
|
||||||
|
if (_check_matches(cfdata->border, E_REMEMBER_MATCH_NAME | E_REMEMBER_MATCH_CLASS | E_REMEMBER_MATCH_ROLE | E_REMEMBER_MATCH_TYPE | E_REMEMBER_MATCH_TRANSIENT) > 1)
|
||||||
|
{
|
||||||
|
E_Dialog *dia;
|
||||||
|
|
||||||
|
dia = e_dialog_new(cfd->con);
|
||||||
|
e_dialog_title_set(dia, _("Window properties are not a unique match"));
|
||||||
|
e_dialog_text_set
|
||||||
|
(dia,
|
||||||
|
_("You are trying to ask Enlightenment to remember to apply<br>"
|
||||||
|
"properties (such as size, location, border style etc.) to<br>"
|
||||||
|
"a window that <hilight>does not have unique properties</hilight>.<br>"
|
||||||
|
"<br>"
|
||||||
|
"This means it shares Name/Class, Transience, Role etc. properties<br>"
|
||||||
|
"with more than 1 other window on the screen and remembering<br>"
|
||||||
|
"properties for this window will apply to all other windows<br>"
|
||||||
|
"that match these properties.<br>"
|
||||||
|
"<br>"
|
||||||
|
"This is just a warning in case you did not intend this to happen.<br>"
|
||||||
|
"If you did, simply press <hilight>Apply</hilight> or <hilight>OK</hilight> buttons<br>"
|
||||||
|
"and your settings will be accepted. Press <hilight>Cancel</hilight> if you<br>"
|
||||||
|
"are not sure and nothing will be affected.")
|
||||||
|
);
|
||||||
|
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
|
||||||
|
e_win_centered_set(dia->win, 1);
|
||||||
|
e_dialog_show(dia);
|
||||||
|
cfdata->warned = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!cfdata->border->remember)
|
||||||
|
{
|
||||||
|
cfdata->border->remember = e_remember_new();
|
||||||
|
if (cfdata->border->remember)
|
||||||
|
{
|
||||||
|
e_remember_use(cfdata->border->remember);
|
||||||
|
e_remember_update(cfdata->border->remember, cfdata->border);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (cfdata->border->remember)
|
||||||
|
{
|
||||||
|
cfdata->border->remember->match = E_REMEMBER_MATCH_NAME | E_REMEMBER_MATCH_CLASS | E_REMEMBER_MATCH_ROLE | E_REMEMBER_MATCH_TYPE | E_REMEMBER_MATCH_TRANSIENT;
|
||||||
|
if (cfdata->mode == MODE_GEOMETRY)
|
||||||
|
cfdata->border->remember->apply = E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE;
|
||||||
|
else if (cfdata->mode == MODE_LOCKS)
|
||||||
|
cfdata->border->remember->apply = E_REMEMBER_APPLY_LOCKS;
|
||||||
|
else if (cfdata->mode == MODE_GEOMETRY_LOCKS)
|
||||||
|
cfdata->border->remember->apply = E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE | E_REMEMBER_APPLY_LOCKS;
|
||||||
|
else if (cfdata->mode == MODE_ALL)
|
||||||
|
cfdata->border->remember->apply = E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE | E_REMEMBER_APPLY_LAYER | E_REMEMBER_APPLY_LOCKS | E_REMEMBER_APPLY_BORDER | E_REMEMBER_APPLY_STICKY | E_REMEMBER_APPLY_DESKTOP | E_REMEMBER_APPLY_SHADE | E_REMEMBER_APPLY_ZONE | E_REMEMBER_APPLY_SKIP_WINLIST;
|
||||||
|
cfdata->border->remember->apply_first_only = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
e_config_save_queue();
|
||||||
|
return 1; /* Apply was OK */
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
/* Actually take our cfdata settings and apply them in real life */
|
||||||
|
|
||||||
|
if (!((cfdata->remember.apply_pos) || (cfdata->remember.apply_size) &&
|
||||||
|
(cfdata->remember.apply_locks) || (cfdata->remember.apply_layer) &&
|
||||||
|
(cfdata->remember.apply_border) || (cfdata->remember.apply_sticky) &&
|
||||||
|
(cfdata->remember.apply_desktop) || (cfdata->remember.apply_shade) &&
|
||||||
|
(cfdata->remember.apply_zone) || (cfdata->remember.apply_skip_winlist)))
|
||||||
|
{
|
||||||
|
if (cfdata->border->remember)
|
||||||
|
{
|
||||||
|
e_remember_unuse(cfdata->border->remember);
|
||||||
|
e_remember_del(cfdata->border->remember);
|
||||||
|
cfdata->border->remember = NULL;
|
||||||
|
}
|
||||||
|
e_config_save_queue();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cfdata->remember.match_name) cfdata->remember.match_class = 1;
|
||||||
|
else cfdata->remember.match_class = 0;
|
||||||
|
|
||||||
|
if (!((cfdata->remember.match_name) || (cfdata->remember.match_class) ||
|
||||||
|
(cfdata->remember.match_title) || (cfdata->remember.match_role) ||
|
||||||
|
(cfdata->remember.match_type) || (cfdata->remember.match_transient)))
|
||||||
|
{
|
||||||
|
E_Dialog *dia;
|
||||||
|
|
||||||
|
dia = e_dialog_new(cfd->con);
|
||||||
|
e_dialog_title_set(dia, _("No match properties set"));
|
||||||
|
e_dialog_text_set
|
||||||
|
(dia,
|
||||||
|
_("You are trying to ask Enlightenment to remember to apply<br>"
|
||||||
|
"properties (such as size, location, border style etc.) to<br>"
|
||||||
|
"a window <hilight>without specifying how to remember it</hilight>.<br>"
|
||||||
|
"<br>"
|
||||||
|
"You must specify at least 1 way of remembering this window.")
|
||||||
|
);
|
||||||
|
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
|
||||||
|
e_win_centered_set(dia->win, 1);
|
||||||
|
e_dialog_show(dia);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (!cfdata->warned)
|
||||||
|
{
|
||||||
|
int matchflags = 0;
|
||||||
|
|
||||||
|
if (cfdata->remember.match_name) matchflags |= E_REMEMBER_MATCH_NAME;
|
||||||
|
if (cfdata->remember.match_class) matchflags |= E_REMEMBER_MATCH_CLASS;
|
||||||
|
if (cfdata->remember.match_title) matchflags |= E_REMEMBER_MATCH_TITLE;
|
||||||
|
if (cfdata->remember.match_role) matchflags |= E_REMEMBER_MATCH_ROLE;
|
||||||
|
if (cfdata->remember.match_type) matchflags |= E_REMEMBER_MATCH_TYPE;
|
||||||
|
if (cfdata->remember.match_transient) matchflags |= E_REMEMBER_MATCH_TRANSIENT;
|
||||||
|
if ((!cfdata->remember.apply_first_only) &&
|
||||||
|
(_check_matches(cfdata->border, matchflags) > 1))
|
||||||
|
{
|
||||||
|
E_Dialog *dia;
|
||||||
|
|
||||||
|
dia = e_dialog_new(cfd->con);
|
||||||
|
e_dialog_title_set(dia, _("No match properties set"));
|
||||||
|
e_dialog_text_set
|
||||||
|
(dia,
|
||||||
|
_("You are trying to ask Enlightenment to remember to apply<br>"
|
||||||
|
"properties (such as size, location, border style etc.) to<br>"
|
||||||
|
"a window that <hilight>does not have unique properties</hilight>.<br>"
|
||||||
|
"<br>"
|
||||||
|
"This means it shares Name/Class, Transience, Role etc. properties<br>"
|
||||||
|
"with more than 1 other window on the screen and remembering<br>"
|
||||||
|
"properties for this window will apply to all other windows<br>"
|
||||||
|
"that match these properties.<br>"
|
||||||
|
"<br>"
|
||||||
|
"You may wish to enable the <hilight>Match only one window</hilight> option if<br>"
|
||||||
|
"you only intend one instance of this window to be modified, with<br>"
|
||||||
|
"additional instances not being modified.<br>"
|
||||||
|
"<br>"
|
||||||
|
"This is just a warning in case you did not intend this to happen.<br>"
|
||||||
|
"If you did, simply press <hilight>Apply</hilight> or <hilight>OK</hilight> buttons<br>"
|
||||||
|
"and your settings will be accepted. Press <hilight>Cancel</hilight> if you<br>"
|
||||||
|
"are not sure and nothing will be affected.")
|
||||||
|
);
|
||||||
|
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
|
||||||
|
e_win_centered_set(dia->win, 1);
|
||||||
|
e_dialog_show(dia);
|
||||||
|
cfdata->warned = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!cfdata->border->remember)
|
||||||
|
{
|
||||||
|
cfdata->border->remember = e_remember_new();
|
||||||
|
if (cfdata->border->remember)
|
||||||
|
{
|
||||||
|
e_remember_use(cfdata->border->remember);
|
||||||
|
e_remember_update(cfdata->border->remember, cfdata->border);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (cfdata->border->remember)
|
||||||
|
{
|
||||||
|
cfdata->border->remember->apply = 0;
|
||||||
|
if (cfdata->remember.match_name) cfdata->border->remember->match |= E_REMEMBER_MATCH_NAME;
|
||||||
|
if (cfdata->remember.match_class) cfdata->border->remember->match |= E_REMEMBER_MATCH_CLASS;
|
||||||
|
if (cfdata->remember.match_title) cfdata->border->remember->match |= E_REMEMBER_MATCH_TITLE;
|
||||||
|
if (cfdata->remember.match_role) cfdata->border->remember->match |= E_REMEMBER_MATCH_ROLE;
|
||||||
|
if (cfdata->remember.match_type) cfdata->border->remember->match |= E_REMEMBER_MATCH_TYPE;
|
||||||
|
if (cfdata->remember.match_transient) cfdata->border->remember->match |= E_REMEMBER_MATCH_TRANSIENT;
|
||||||
|
if (cfdata->remember.apply_pos) cfdata->border->remember->apply |= E_REMEMBER_APPLY_POS;
|
||||||
|
if (cfdata->remember.apply_size) cfdata->border->remember->apply |= E_REMEMBER_APPLY_SIZE;
|
||||||
|
if (cfdata->remember.apply_layer) cfdata->border->remember->apply |= E_REMEMBER_APPLY_LAYER;
|
||||||
|
if (cfdata->remember.apply_locks) cfdata->border->remember->apply |= E_REMEMBER_APPLY_LOCKS;
|
||||||
|
if (cfdata->remember.apply_border) cfdata->border->remember->apply |= E_REMEMBER_APPLY_BORDER;
|
||||||
|
if (cfdata->remember.apply_sticky) cfdata->border->remember->apply |= E_REMEMBER_APPLY_STICKY;
|
||||||
|
if (cfdata->remember.apply_desktop) cfdata->border->remember->apply |= E_REMEMBER_APPLY_DESKTOP;
|
||||||
|
if (cfdata->remember.apply_shade) cfdata->border->remember->apply |= E_REMEMBER_APPLY_SHADE;
|
||||||
|
if (cfdata->remember.apply_zone) cfdata->border->remember->apply |= E_REMEMBER_APPLY_ZONE;
|
||||||
|
if (cfdata->remember.apply_skip_winlist) cfdata->border->remember->apply |= E_REMEMBER_APPLY_SKIP_WINLIST;
|
||||||
|
if (cfdata->remember.apply_run) cfdata->border->remember->apply |= E_REMEMBER_APPLY_RUN;
|
||||||
|
cfdata->border->remember->apply_first_only = cfdata->remember.apply_first_only;
|
||||||
|
}
|
||||||
|
|
||||||
|
e_config_save_queue();
|
||||||
|
return 1; /* Apply was OK */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**--GUI--**/
|
||||||
|
static Evas_Object *
|
||||||
|
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
|
||||||
|
{
|
||||||
|
/* generate the core widget layout for a basic dialog */
|
||||||
|
Evas_Object *o, *ob;
|
||||||
|
E_Radio_Group *rg;
|
||||||
|
|
||||||
|
_fill_data(cfdata);
|
||||||
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
|
rg = e_widget_radio_group_new(&(cfdata->mode));
|
||||||
|
ob = e_widget_radio_add(evas, _("Nothing"), MODE_NOTHING, rg);
|
||||||
|
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||||
|
ob = e_widget_radio_add(evas, _("Size and Position"), MODE_GEOMETRY, rg);
|
||||||
|
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||||
|
ob = e_widget_radio_add(evas, _("Locks"), MODE_LOCKS, rg);
|
||||||
|
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||||
|
ob = e_widget_radio_add(evas, _("Size, Position and Locks"), MODE_GEOMETRY_LOCKS, rg);
|
||||||
|
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||||
|
ob = e_widget_radio_add(evas, _("Everything"), MODE_ALL, rg);
|
||||||
|
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
|
||||||
|
{
|
||||||
|
/* generate the core widget layout for an advanced dialog */
|
||||||
|
Evas_Object *o, *ob, *of;
|
||||||
|
E_Radio_Group *rg;
|
||||||
|
|
||||||
|
_fill_data(cfdata);
|
||||||
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Remember using"), 0);
|
||||||
|
ob = e_widget_check_add(evas, _("Window name and class"), &(cfdata->remember.match_name));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
if (strlen(e_border_name_get(cfdata->border)) > 0)
|
||||||
|
{
|
||||||
|
ob = e_widget_check_add(evas, _("Title"), &(cfdata->remember.match_title));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cfdata->remember.match_title = 0;
|
||||||
|
if ((cfdata->border->client.icccm.window_role) &&
|
||||||
|
(strlen(cfdata->border->client.icccm.window_role) > 0))
|
||||||
|
{
|
||||||
|
ob = e_widget_check_add(evas, _("Window Role"), &(cfdata->remember.match_role));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cfdata->remember.match_role = 0;
|
||||||
|
if (cfdata->border->client.netwm.type != ECORE_X_WINDOW_TYPE_UNKNOWN)
|
||||||
|
{
|
||||||
|
ob = e_widget_check_add(evas, _("Window type"), &(cfdata->remember.match_type));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cfdata->remember.match_type = 0;
|
||||||
|
ob = e_widget_check_add(evas, _("Transience"), &(cfdata->remember.match_transient));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
ob = e_widget_check_add(evas, _("Match only one window"), &(cfdata->remember.apply_first_only));
|
||||||
|
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||||
|
|
||||||
|
of = e_widget_frametable_add(evas, _("Properties to remember"), 0);
|
||||||
|
ob = e_widget_check_add(evas, _("Position"), &(cfdata->remember.apply_pos));
|
||||||
|
e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Size"), &(cfdata->remember.apply_size));
|
||||||
|
e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Stacking"), &(cfdata->remember.apply_layer));
|
||||||
|
e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Locks"), &(cfdata->remember.apply_locks));
|
||||||
|
e_widget_frametable_object_append(of, ob, 0, 3, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Border style"), &(cfdata->remember.apply_border));
|
||||||
|
e_widget_frametable_object_append(of, ob, 0, 4, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Stickiness"), &(cfdata->remember.apply_sticky));
|
||||||
|
e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Virtual Desktop"), &(cfdata->remember.apply_desktop));
|
||||||
|
e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Shaded state"), &(cfdata->remember.apply_shade));
|
||||||
|
e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Screen zone"), &(cfdata->remember.apply_zone));
|
||||||
|
e_widget_frametable_object_append(of, ob, 1, 3, 1, 1, 1, 1, 1, 1);
|
||||||
|
ob = e_widget_check_add(evas, _("Window list skip"), &(cfdata->remember.apply_skip_winlist));
|
||||||
|
e_widget_frametable_object_append(of, ob, 1, 4, 1, 1, 1, 1, 1, 1);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
#ifdef E_TYPEDEFS
|
||||||
|
#else
|
||||||
|
#ifndef E_INT_BORDER_REMEMBER_H
|
||||||
|
#define E_INT_BORDER_REMEMBER_H
|
||||||
|
|
||||||
|
EAPI void e_int_border_remember(E_Border *bd);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -75,7 +75,20 @@ e_remember_del(E_Remember *rem)
|
||||||
if (rem->delete_me) return;
|
if (rem->delete_me) return;
|
||||||
if (rem->used_count != 0)
|
if (rem->used_count != 0)
|
||||||
{
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
rem->delete_me = 1;
|
rem->delete_me = 1;
|
||||||
|
for (l = e_border_client_list(); l; l = l->next)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = l->data;
|
||||||
|
if (bd->remember == rem)
|
||||||
|
{
|
||||||
|
bd->remember = NULL;
|
||||||
|
e_remember_unuse(rem);
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_e_remember_free(rem);
|
_e_remember_free(rem);
|
||||||
|
|
Loading…
Reference in New Issue