enlightenment_my/src/modules/quickaccess/e_mod_config.c

566 lines
16 KiB
C
Raw Normal View History

super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
#include "e_mod_main.h"
typedef struct Config_Entry
{
EINA_INLIST;
const char *id;
E_Quick_Access_Entry *entry;
} Config_Entry;
struct _E_Config_Dialog_Data
{
const char *entry;
Evas_Object *o_list_entry;
Evas_Object *o_list_transient;
E_Entry_Dialog *ed;
Eina_Inlist *entries;
Eina_Inlist *transient_entries;
int autohide;
int hide_when_behind;
int skip_taskbar;
int skip_pager;
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
int dont_bug_me;
int first_run;
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
};
static E_Config_DD *conf_edd, *entry_edd;
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
/**
* in priority order:
*
* @todo configure match name (to be used by actions)
*
* @todo configure match icccm match class and name.
*
* @todo configure show/hide effects:
* - fullscreen
* - centered
* - slide from top, bottom, left or right
*
* @todo match more than one, doing tabs (my idea is to do another
* tabbing module first, experiment with that, maybe use/reuse
* it here)
*/
static Config_Entry *
_config_entry_new(E_Quick_Access_Entry *entry)
{
Config_Entry *ce;
ce = E_NEW(Config_Entry, 1);
ce->entry = entry;
entry->cfg_entry = ce;
return ce;
}
static void
_config_entry_free(Config_Entry *ce)
{
if (!ce) return;
ce->entry->cfg_entry = NULL;
eina_stringshare_del(ce->id);
if (ce->entry->transient)
qa_mod->cfd->cfdata->transient_entries = eina_inlist_remove(qa_mod->cfd->cfdata->transient_entries, EINA_INLIST_GET(ce));
else
qa_mod->cfd->cfdata->entries = eina_inlist_remove(qa_mod->cfd->cfdata->entries, EINA_INLIST_GET(ce));
free(ce);
}
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
Eina_List *l;
E_Quick_Access_Entry *entry;
cfdata->autohide = qa_config->autohide;
cfdata->hide_when_behind = qa_config->hide_when_behind;
cfdata->skip_taskbar = qa_config->skip_taskbar;
cfdata->skip_pager = qa_config->skip_pager;
cfdata->dont_bug_me = qa_config->dont_bug_me;
cfdata->first_run = qa_config->first_run;
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
EINA_LIST_FOREACH(qa_config->entries, l, entry)
cfdata->entries = eina_inlist_append(cfdata->entries, EINA_INLIST_GET(_config_entry_new(entry)));
EINA_LIST_FOREACH(qa_config->transient_entries, l, entry)
cfdata->transient_entries = eina_inlist_append(cfdata->transient_entries, EINA_INLIST_GET(_config_entry_new(entry)));
}
static void *
_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
_fill_data(cfdata);
qa_mod->cfd = cfd;
return cfdata;
}
static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
Eina_Inlist *l;
Config_Entry *ce;
EINA_INLIST_FOREACH_SAFE(cfdata->entries, l, ce)
_config_entry_free(ce);
EINA_INLIST_FOREACH_SAFE(cfdata->transient_entries, l, ce)
_config_entry_free(ce);
free(cfdata);
qa_mod->cfd = NULL;
}
static int
_advanced_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
Config_Entry *ce;
#define CHECK(X) \
if (cfdata->X != qa_config->X) return 1
CHECK(dont_bug_me);
CHECK(first_run);
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
EINA_INLIST_FOREACH(cfdata->entries, ce)
if (ce->id) return 1;
EINA_INLIST_FOREACH(cfdata->transient_entries, ce)
if (ce->id) return 1;
#undef CHECK
return 0;
}
static int
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
#define CHECK(X) \
if (cfdata->X != qa_config->X) return 1
CHECK(autohide);
CHECK(skip_pager);
CHECK(skip_taskbar);
CHECK(hide_when_behind);
#undef CHECK
return 0;
}
static void
_list_select(void *data)
{
(void) data;
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
}
static void
_list_fill(E_Config_Dialog_Data *cfdata, Evas_Object *list, Eina_Bool transient)
{
Config_Entry *ce;
EINA_INLIST_FOREACH(transient ? cfdata->transient_entries : cfdata->entries, ce)
{
e_widget_ilist_append(list, NULL, ce->id ?: ce->entry->id, _list_select, ce, ce->entry->id);
}
e_widget_ilist_selected_set(list, 0);
}
static void
_rename_del(void *data)
{
E_Config_Dialog_Data *cfdata = e_object_data_get(data);
if (!cfdata) return;
cfdata->ed = NULL;
}
static void
_rename_ok(void *data, char *text)
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
{
Config_Entry *ce = data;
const char *name;
Evas_Object *list;
name = eina_stringshare_add(text);
if (name == ce->id)
{
eina_stringshare_del(name);
return;
}
if (name == ce->entry->id)
{
eina_stringshare_del(name);
if (!ce->id) return;
eina_stringshare_replace(&ce->id, NULL);
}
else
eina_stringshare_replace(&ce->id, text);
list = ce->entry->transient ? qa_mod->cfd->cfdata->o_list_transient : qa_mod->cfd->cfdata->o_list_entry;
e_widget_ilist_clear(list);
_list_fill(qa_mod->cfd->cfdata, list, ce->entry->transient);
}
static void
_list_delete(void *data __UNUSED__, void *list)
{
Config_Entry *ce;
ce = e_widget_ilist_selected_data_get(list);
if (!ce) return;
e_qa_entry_free(ce->entry);
}
static void
_list_rename(void *data, void *list)
{
E_Config_Dialog_Data *cfdata = data;
Config_Entry *ce;
if (cfdata->ed)
{
e_win_raise(cfdata->ed->dia->win);
return;
}
ce = e_widget_ilist_selected_data_get(list);
if (!ce) return;
cfdata->ed = e_entry_dialog_show(_("Rename"), "edit-rename", _("Enter a unique name for this entry"),
ce->id ?: ce->entry->id, NULL, NULL,
_rename_ok, NULL, ce);
e_object_data_set(E_OBJECT(cfdata->ed), cfdata);
e_object_del_attach_func_set(E_OBJECT(cfdata->ed), _rename_del);
}
static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
{
Evas_Object *ob, *ol, *otb, *tab;
int w, h;
tab = e_widget_table_add(evas, 0);
evas_object_name_set(tab, "dia_table");
otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
/////////////////////////////////////////////////////////////////
ol = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Disable Warning Dialogs"), (int*)&(cfdata->dont_bug_me));
e_widget_list_object_append(ol, ob, 1, 0, 0.5);
ob = e_widget_check_add(evas, _("Disable Startup Tutorial"), (int*)&(cfdata->first_run));
e_widget_list_object_append(ol, ob, 1, 0, 0.5);
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
e_widget_toolbook_page_append(otb, NULL, _("Behavior"), ol, 1, 1, 1, 1, 0.5, 0.5);
/////////////////////////////////////////////////////////////////
ol = e_widget_table_add(evas, 0);
e_widget_table_freeze(ol);
cfdata->o_list_entry = ob = e_widget_ilist_add(evas, 0, 0, &cfdata->entry);
evas_event_freeze(evas_object_evas_get(ob));
edje_freeze();
e_widget_ilist_freeze(ob);
_list_fill(cfdata, ob, EINA_FALSE);
e_widget_size_min_get(ob, &w, &h);
e_widget_size_min_set(ob, MIN(w, 200), MIN(h, 100));
e_widget_ilist_go(ob);
e_widget_ilist_thaw(ob);
edje_thaw();
evas_event_thaw(evas_object_evas_get(ol));
e_widget_table_object_append(ol, ob, 0, 0, 2, 1, 1, 1, 1, 1);
ob = e_widget_button_add(evas, _("Rename"), "edit-rename", _list_rename, cfdata, cfdata->o_list_entry);
e_widget_table_object_append(ol, ob, 0, 1, 1, 1, 1, 1, 0, 0);
ob = e_widget_button_add(evas, _("Delete"), "edit-delete", _list_delete, cfdata, cfdata->o_list_entry);
e_widget_table_object_append(ol, ob, 1, 1, 1, 1, 1, 1, 0, 0);
e_widget_table_thaw(ol);
e_widget_toolbook_page_append(otb, NULL, _("Entries"), ol, 1, 1, 1, 1, 0.5, 0.5);
/////////////////////////////////////////////////////////////////
ol = e_widget_table_add(evas, 0);
e_widget_table_freeze(ol);
cfdata->o_list_transient = ob = e_widget_ilist_add(evas, 0, 0, &cfdata->entry);
evas_event_freeze(evas_object_evas_get(ob));
edje_freeze();
e_widget_ilist_freeze(ob);
_list_fill(cfdata, ob, EINA_TRUE);
e_widget_size_min_get(ob, &w, &h);
e_widget_size_min_set(ob, MIN(w, 200), MIN(h, 100));
e_widget_ilist_go(ob);
e_widget_ilist_thaw(ob);
edje_thaw();
evas_event_thaw(evas_object_evas_get(ol));
e_widget_table_object_append(ol, ob, 0, 0, 2, 1, 1, 1, 1, 1);
ob = e_widget_button_add(evas, _("Rename"), "edit-rename", _list_rename, cfdata, cfdata->o_list_transient);
e_widget_table_object_append(ol, ob, 0, 1, 1, 1, 1, 1, 0, 0);
ob = e_widget_button_add(evas, _("Delete"), "edit-delete", _list_delete, cfdata, cfdata->o_list_transient);
e_widget_table_object_append(ol, ob, 1, 1, 1, 1, 1, 1, 0, 0);
e_widget_table_thaw(ol);
e_widget_toolbook_page_append(otb, NULL, _("Transients"), ol, 1, 1, 1, 1, 0.5, 0.5);
/////////////////////////////////////////////////////////////////
e_widget_toolbook_page_show(otb, 0);
e_widget_table_object_append(tab, otb, 0, 0, 1, 1, 1, 1, 1, 1);
return tab;
}
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
{
Evas_Object *ob, *ol, *otb, *tab;
cfdata->o_list_entry = cfdata->o_list_transient = NULL;
tab = e_widget_table_add(evas, 0);
evas_object_name_set(tab, "dia_table");
otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
ol = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Hide Instead Of Raising"), &cfdata->hide_when_behind);
e_widget_list_object_append(ol, ob, 1, 0, 0.5);
ob = e_widget_check_add(evas, _("Hide If Focus Lost"), &cfdata->autohide);
e_widget_list_object_append(ol, ob, 1, 0, 0.5);
ob = e_widget_check_add(evas, _("Skip Taskbar"), &cfdata->skip_taskbar);
e_widget_list_object_append(ol, ob, 1, 0, 0.5);
ob = e_widget_check_add(evas, _("Skip Pager"), &cfdata->skip_pager);
e_widget_list_object_append(ol, ob, 1, 0, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Behavior"), ol, 1, 1, 1, 1, 0.5, 0.5);
e_widget_toolbook_page_show(otb, 0);
e_widget_table_object_append(tab, otb, 0, 0, 1, 1, 1, 1, 1, 1);
return tab;
}
static int
_advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
Config_Entry *ce;
Eina_Bool entry_changed = EINA_FALSE, transient_changed = EINA_FALSE;
#define SET(X) qa_config->X = cfdata->X
SET(dont_bug_me);
SET(first_run);
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
EINA_INLIST_FOREACH(cfdata->entries, ce)
{
if (!ce->id) continue;
if (!e_qa_entry_rename(ce->entry, ce->id))
entry_changed = EINA_TRUE;
eina_stringshare_replace(&ce->id, NULL);
}
EINA_INLIST_FOREACH(cfdata->transient_entries, ce)
{
if (!ce->id) continue;
if (!e_qa_entry_rename(ce->entry, ce->id))
transient_changed = EINA_TRUE;
eina_stringshare_replace(&ce->id, NULL);
}
if (entry_changed)
{
e_widget_ilist_clear(cfdata->o_list_entry);
_list_fill(qa_mod->cfd->cfdata, cfdata->o_list_entry, EINA_FALSE);
}
if (transient_changed)
{
e_widget_ilist_clear(cfdata->o_list_transient);
_list_fill(qa_mod->cfd->cfdata, cfdata->o_list_transient, EINA_TRUE);
}
e_config_save_queue();
return 1;
}
static int
_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
#define SET(X) qa_config->X = cfdata->X
SET(autohide);
SET(hide_when_behind);
SET(skip_taskbar);
SET(skip_pager);
e_qa_entries_update();
e_config_save_queue();
return 1;
}
static void
_list_item_add(E_Quick_Access_Entry *entry)
{
Evas_Object *list;
Config_Entry *ce = entry->cfg_entry;
list = ce->entry->transient ? qa_mod->cfd->cfdata->o_list_transient : qa_mod->cfd->cfdata->o_list_entry;
if (!list) return;
e_widget_ilist_append(list, NULL, ce->id ?: ce->entry->id, _list_select, ce, ce->entry->id);
if (e_widget_ilist_selected_get(list) == -1) e_widget_ilist_selected_set(list, 0);
}
static void
_list_item_delete(E_Quick_Access_Entry *entry)
{
const Eina_List *l, *ll;
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
E_Ilist_Item *ili;
Evas_Object *list;
unsigned int x = 0;
list = entry->transient ? qa_mod->cfd->cfdata->o_list_transient : qa_mod->cfd->cfdata->o_list_entry;
if (!list) return;
l = e_widget_ilist_items_get(list);
EINA_LIST_FOREACH(l, ll, ili)
{
if (e_widget_ilist_item_data_get(ili) == entry->cfg_entry)
{
e_widget_ilist_remove_num(list, x);
break;
}
x++;
}
if (e_widget_ilist_selected_get(list) == -1) e_widget_ilist_selected_set(list, 0);
}
//////////////////////////////////////////////////////////////////////////////
E_Config_DD *
e_qa_config_dd_new(void)
{
conf_edd = E_CONFIG_DD_NEW("Quickaccess_Config", Config);
entry_edd = E_CONFIG_DD_NEW("E_Quick_Access_Entry", E_Quick_Access_Entry);
#undef T
#undef D
#define T E_Quick_Access_Entry
#define D entry_edd
E_CONFIG_VAL(D, T, id, STR);
E_CONFIG_VAL(D, T, name, STR);
E_CONFIG_VAL(D, T, class, STR);
E_CONFIG_VAL(D, T, cmd, STR);
E_CONFIG_VAL(D, T, win, UINT);
E_CONFIG_VAL(D, T, config.autohide, UCHAR);
E_CONFIG_VAL(D, T, config.relaunch, UCHAR);
E_CONFIG_VAL(D, T, config.hidden, UCHAR);
E_CONFIG_VAL(D, T, config.jump, UCHAR);
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
E_CONFIG_VAL(D, T, transient, UCHAR);
#undef T
#undef D
#define T Config
#define D conf_edd
E_CONFIG_VAL(D, T, config_version, UINT);
E_CONFIG_LIST(D, T, entries, entry_edd);
E_CONFIG_LIST(D, T, transient_entries, entry_edd);
E_CONFIG_VAL(D, T, autohide, UCHAR);
E_CONFIG_VAL(D, T, hide_when_behind, UCHAR);
E_CONFIG_VAL(D, T, skip_taskbar, UCHAR);
E_CONFIG_VAL(D, T, skip_pager, UCHAR);
E_CONFIG_VAL(D, T, dont_bug_me, UCHAR);
E_CONFIG_VAL(D, T, first_run, UCHAR);
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
return conf_edd;
}
void *
e_qa_config_dd_free(void)
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
{
E_CONFIG_DD_FREE(entry_edd);
E_CONFIG_DD_FREE(conf_edd);
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
return NULL;
}
void
e_qa_config_free(Config *conf)
{
if (!conf) return;
E_FREE_LIST(conf->entries, e_qa_entry_free);
E_FREE_LIST(conf->transient_entries, e_qa_entry_free);
free(conf);
}
Config *
e_qa_config_new(void)
{
Config *conf;
conf = E_NEW(Config, 1);
conf->skip_taskbar = 1;
conf->skip_pager = 1;
return conf;
}
void
e_qa_config_entry_transient_convert(E_Quick_Access_Entry *entry)
{
if (!entry) return;
if (!entry->cfg_entry) return;
_list_item_delete(entry);
entry->transient = !entry->transient;
_list_item_add(entry);
entry->transient = !entry->transient;
}
void
e_qa_config_entry_free(E_Quick_Access_Entry *entry)
{
if (!entry) return;
if (!entry->cfg_entry) return;
_list_item_delete(entry);
_config_entry_free(entry->cfg_entry);
entry->cfg_entry = NULL;
}
void
e_qa_config_entry_add(E_Quick_Access_Entry *entry)
{
Config_Entry *ce;
if (!entry) return;
if (!qa_mod->cfd) return;
ce = _config_entry_new(entry);
if (entry->transient)
qa_mod->cfd->cfdata->transient_entries = eina_inlist_append(qa_mod->cfd->cfdata->transient_entries, EINA_INLIST_GET(ce));
else
qa_mod->cfd->cfdata->entries = eina_inlist_append(qa_mod->cfd->cfdata->entries, EINA_INLIST_GET(ce));
_list_item_add(entry);
}
E_Config_Dialog *
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
e_int_config_qa_module(E_Comp *comp, const char *params __UNUSED__)
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
char buf[PATH_MAX];
if (qa_mod->cfd) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
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->basic.check_changed = _basic_check_changed;
v->advanced.apply_cfdata = _advanced_apply_data;
v->advanced.create_widgets = _advanced_create_widgets;
v->advanced.check_changed = _advanced_check_changed;
snprintf(buf, sizeof(buf), "%s/e-module-quickaccess.edj", e_module_dir_get(qa_mod->module));
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
cfd = e_config_dialog_new(comp, _("Quickaccess Settings"),
super sekrit module mostly complete: introducing the new and rewritten quickaccess module! found in the Launcher category, this module allows for windows to be hidden/shown using bindings, and can be used to turn any window/application into a quake-style drop-down terminal or whatever else you would use triggered window hiding/showing for. config options: * autohide - hides window when focus is lost * hide instead of raise - by default, qa will raise an activated window if it doesn't have focus; use this option to make it hide instead of raising * automatically reopen when closed - this option, when set, causes qa to relaunch the application which created the window if the window is closed. it should (probably) only be used for terminals, and requires some magic for setting window names on terminals which I have created some infra for extending to non-standard terminal types; currently all xterm clones, urxvt, and terminology are supported. note that setting this option will cause the entry to become permanent, as any entry which is set to restart itself when closed cannot be transient * transient - a window added to qa is initially a transient entry, meaning it's temporary: once you close the window, the binding is deleted, though the binding will remain if you restart e17. if you uncheck this option, it will become a permanent entry which can only be deleted either through the quickaccess advanced settings or the keybindings dialog. fun fact: you can get to the quickaccess settings faster by clicking the Quickaccess... border menu item SVN revision: 75550
2012-08-22 06:55:41 -07:00
"E", "launcher/quickaccess", buf, 32, v, NULL);
return cfd;
}