enlightenment/src/modules/quickaccess/e_mod_main.c

96 lines
2.4 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"
EINTERN int _e_quick_access_log_dom = -1;
static E_Config_DD *conf_edd = NULL;
Mod *qa_mod = NULL;
Config *qa_config = NULL;
/**
* in priority order:
*
* @todo config (see e_mod_config.c)
*
* @todo custom border based on E_Quick_Access_Entry_Mode/E_Gadcon_Orient
*
* @todo 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)
*/
E_API E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Quickaccess"};
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
_e_modapi_shutdown(void)
{
e_qa_shutdown();
conf_edd = e_qa_config_dd_free();
eina_log_domain_unregister(_e_quick_access_log_dom);
_e_quick_access_log_dom = -1;
e_configure_registry_item_del("launcher/quickaccess");
e_configure_registry_category_del("launcher");
e_qa_config_free(qa_config);
E_FREE(qa_mod);
qa_config = NULL;
}
E_API 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_modapi_init(E_Module *m)
{
e_configure_registry_category_add("launcher", 80, _("Launcher"), NULL,
"modules-launcher");
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_configure_registry_item_add("launcher/quickaccess", 1, _("Quickaccess"), NULL,
"preferences-applications-personal", e_int_config_qa_module);
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
qa_mod = E_NEW(Mod, 1);
qa_mod->module = m;
m->data = qa_mod;
conf_edd = e_qa_config_dd_new();
qa_config = e_config_domain_load("module.quickaccess", conf_edd);
if (qa_config)
{
if (!e_util_module_config_check(_("Quickaccess"), qa_config->config_version, MOD_CONFIG_FILE_VERSION))
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_qa_config_free(qa_config);
qa_config = NULL;
}
}
if (!qa_config) qa_config = e_qa_config_new();
qa_config->config_version = MOD_CONFIG_FILE_VERSION;
_e_quick_access_log_dom = eina_log_domain_register("quickaccess", EINA_COLOR_ORANGE);
2014-07-27 12:53:41 -07:00
eina_log_domain_level_set("quickaccess", EINA_LOG_LEVEL_ERR);
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
if (!e_qa_init())
{
_e_modapi_shutdown();
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;
}
return m;
}
E_API int
e_modapi_shutdown(E_Module *m EINA_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_modapi_shutdown();
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 1;
}
E_API int
e_modapi_save(E_Module *m EINA_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_domain_save("module.quickaccess", conf_edd, qa_config);
return 1;
}