e17/evry: hide e_datastore_get(evry_api) stuff from modules. maybe there'll be a better way for synchronous intermodule communication someday
SVN revision: 58256
This commit is contained in:
parent
17d1ec22ed
commit
d3cc6515b0
|
@ -1361,13 +1361,7 @@ e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
_conf_init(m);
|
_conf_init(m);
|
||||||
|
|
||||||
evry_module = E_NEW(Evry_Module, 1);
|
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||||
evry_module->init = &_plugins_init;
|
|
||||||
evry_module->shutdown = &_plugins_shutdown;
|
|
||||||
EVRY_MODULE_REGISTER(evry_module);
|
|
||||||
|
|
||||||
if ((evry = e_datastore_get("everything_loaded")))
|
|
||||||
evry_module->active = _plugins_init(evry);
|
|
||||||
|
|
||||||
/* taken from e_exebuf.c */
|
/* taken from e_exebuf.c */
|
||||||
exelist_exe_edd = E_CONFIG_DD_NEW("E_Exe", E_Exe);
|
exelist_exe_edd = E_CONFIG_DD_NEW("E_Exe", E_Exe);
|
||||||
|
@ -1392,10 +1386,7 @@ e_modapi_init(E_Module *m)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||||
{
|
{
|
||||||
_plugins_shutdown();
|
EVRY_MODULE_FREE(evry_module);
|
||||||
|
|
||||||
EVRY_MODULE_UNREGISTER(evry_module);
|
|
||||||
E_FREE(evry_module);
|
|
||||||
|
|
||||||
_conf_shutdown();
|
_conf_shutdown();
|
||||||
|
|
||||||
|
|
|
@ -637,13 +637,7 @@ e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
_conf_init(m);
|
_conf_init(m);
|
||||||
|
|
||||||
evry_module = E_NEW(Evry_Module, 1);
|
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||||
evry_module->init = &_plugins_init;
|
|
||||||
evry_module->shutdown = &_plugins_shutdown;
|
|
||||||
EVRY_MODULE_REGISTER(evry_module);
|
|
||||||
|
|
||||||
if ((evry = e_datastore_get("everything_loaded")))
|
|
||||||
evry_module->active = _plugins_init(evry);
|
|
||||||
|
|
||||||
e_module_delayed_set(m, 1);
|
e_module_delayed_set(m, 1);
|
||||||
|
|
||||||
|
@ -653,10 +647,7 @@ e_modapi_init(E_Module *m)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||||
{
|
{
|
||||||
_plugins_shutdown();
|
EVRY_MODULE_FREE(evry_module);
|
||||||
|
|
||||||
EVRY_MODULE_UNREGISTER(evry_module);
|
|
||||||
E_FREE(evry_module);
|
|
||||||
|
|
||||||
_conf_shutdown();
|
_conf_shutdown();
|
||||||
|
|
||||||
|
|
|
@ -298,13 +298,7 @@ EAPI E_Module_Api e_modapi =
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *m)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
evry_module = E_NEW(Evry_Module, 1);
|
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||||
evry_module->init = &_plugins_init;
|
|
||||||
evry_module->shutdown = &_plugins_shutdown;
|
|
||||||
EVRY_MODULE_REGISTER(evry_module);
|
|
||||||
|
|
||||||
if ((evry = e_datastore_get("everything_loaded")))
|
|
||||||
evry_module->active = _plugins_init(evry);
|
|
||||||
|
|
||||||
e_module_delayed_set(m, 1);
|
e_module_delayed_set(m, 1);
|
||||||
|
|
||||||
|
@ -314,10 +308,7 @@ e_modapi_init(E_Module *m)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||||
{
|
{
|
||||||
_plugins_shutdown();
|
EVRY_MODULE_FREE(evry_module);
|
||||||
|
|
||||||
EVRY_MODULE_UNREGISTER(evry_module);
|
|
||||||
E_FREE(evry_module);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1647,13 +1647,7 @@ e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
_conf_init(m);
|
_conf_init(m);
|
||||||
|
|
||||||
evry_module = E_NEW(Evry_Module, 1);
|
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||||
evry_module->init = &_plugins_init;
|
|
||||||
evry_module->shutdown = &_plugins_shutdown;
|
|
||||||
EVRY_MODULE_REGISTER(evry_module);
|
|
||||||
|
|
||||||
if ((evry = e_datastore_get("everything_loaded")))
|
|
||||||
evry_module->active = _plugins_init(evry);
|
|
||||||
|
|
||||||
e_module_delayed_set(m, 1);
|
e_module_delayed_set(m, 1);
|
||||||
|
|
||||||
|
@ -1663,10 +1657,7 @@ e_modapi_init(E_Module *m)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||||
{
|
{
|
||||||
_plugins_shutdown();
|
EVRY_MODULE_FREE(evry_module);
|
||||||
|
|
||||||
EVRY_MODULE_UNREGISTER(evry_module);
|
|
||||||
E_FREE(evry_module);
|
|
||||||
|
|
||||||
_conf_shutdown();
|
_conf_shutdown();
|
||||||
|
|
||||||
|
|
|
@ -227,13 +227,7 @@ EAPI E_Module_Api e_modapi =
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *m)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
evry_module = E_NEW(Evry_Module, 1);
|
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||||
evry_module->init = &_plugins_init;
|
|
||||||
evry_module->shutdown = &_plugins_shutdown;
|
|
||||||
EVRY_MODULE_REGISTER(evry_module);
|
|
||||||
|
|
||||||
if ((evry = e_datastore_get("everything_loaded")))
|
|
||||||
evry_module->active = _plugins_init(evry);
|
|
||||||
|
|
||||||
e_module_delayed_set(m, 1);
|
e_module_delayed_set(m, 1);
|
||||||
|
|
||||||
|
@ -243,10 +237,7 @@ e_modapi_init(E_Module *m)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||||
{
|
{
|
||||||
_plugins_shutdown();
|
EVRY_MODULE_FREE(evry_module);
|
||||||
|
|
||||||
EVRY_MODULE_UNREGISTER(evry_module);
|
|
||||||
E_FREE(evry_module);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,13 +488,7 @@ EAPI E_Module_Api e_modapi =
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *m)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
evry_module = E_NEW(Evry_Module, 1);
|
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||||
evry_module->init = &_plugins_init;
|
|
||||||
evry_module->shutdown = &_plugins_shutdown;
|
|
||||||
EVRY_MODULE_REGISTER(evry_module);
|
|
||||||
|
|
||||||
if ((evry = e_datastore_get("everything_loaded")))
|
|
||||||
evry_module->active = _plugins_init(evry);
|
|
||||||
|
|
||||||
e_module_delayed_set(m, 1);
|
e_module_delayed_set(m, 1);
|
||||||
|
|
||||||
|
@ -504,10 +498,7 @@ e_modapi_init(E_Module *m)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||||
{
|
{
|
||||||
_plugins_shutdown();
|
EVRY_MODULE_FREE(evry_module);
|
||||||
|
|
||||||
EVRY_MODULE_UNREGISTER(evry_module);
|
|
||||||
E_FREE(evry_module);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,9 +132,9 @@ e_modapi_init(E_Module *m)
|
||||||
evry_history_init();
|
evry_history_init();
|
||||||
evry_plug_actions_init();
|
evry_plug_actions_init();
|
||||||
|
|
||||||
e_datastore_set("everything_loaded", _api);
|
e_datastore_set("evry_api", _api);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e_datastore_get("everything_modules"), l, em)
|
EINA_LIST_FOREACH(e_datastore_get("evry_modules"), l, em)
|
||||||
em->active = em->init(_api);
|
em->active = em->init(_api);
|
||||||
|
|
||||||
evry_plug_collection_init();
|
evry_plug_collection_init();
|
||||||
|
@ -161,10 +161,10 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Evry_Module *em;
|
Evry_Module *em;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e_datastore_get("everything_modules"), l, em)
|
EINA_LIST_FOREACH(e_datastore_get("evry_modules"), l, em)
|
||||||
em->shutdown();
|
em->shutdown();
|
||||||
|
|
||||||
e_datastore_del("everything_loaded");
|
e_datastore_del("evry_api");
|
||||||
E_FREE(_api);
|
E_FREE(_api);
|
||||||
|
|
||||||
evry_gadget_shutdown();
|
evry_gadget_shutdown();
|
||||||
|
|
|
@ -260,16 +260,28 @@ typedef void (*Evry_Item_Free_Cb) (Evry_Item *it);
|
||||||
#define EVRY_ACTION_FREE(_act) if (_act) evry->action_free(EVRY_ACTN(_act))
|
#define EVRY_ACTION_FREE(_act) if (_act) evry->action_free(EVRY_ACTN(_act))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EVRY_MODULE_REGISTER(_module) { \
|
#define EVRY_MODULE_NEW(_module, _evry_api, _init, _shutdown) \
|
||||||
Eina_List *l = e_datastore_get("everything_modules"); \
|
{ \
|
||||||
|
_module = E_NEW(Evry_Module, 1); \
|
||||||
|
_module->init = &_init; \
|
||||||
|
_module->shutdown = &_shutdown; \
|
||||||
|
Eina_List *l = e_datastore_get("evry_modules"); \
|
||||||
l = eina_list_append(l, _module); \
|
l = eina_list_append(l, _module); \
|
||||||
e_datastore_set("everything_modules", l); }
|
e_datastore_set("evry_modules", l); \
|
||||||
|
if ((_evry_api = e_datastore_get("evry_api"))) \
|
||||||
|
evry_module->active = _init(_evry_api); \
|
||||||
|
}
|
||||||
|
|
||||||
#define EVRY_MODULE_UNREGISTER(_module) { \
|
#define EVRY_MODULE_FREE(_module) \
|
||||||
Eina_List *l = e_datastore_get("everything_modules"); \
|
{ \
|
||||||
|
_module->shutdown(); \
|
||||||
|
Eina_List *l = e_datastore_get("evry_modules"); \
|
||||||
l = eina_list_remove(l, _module); \
|
l = eina_list_remove(l, _module); \
|
||||||
if (l) e_datastore_set("everything_modules", l); \
|
if (l) e_datastore_set("evry_modules", l); \
|
||||||
else e_datastore_del("everything_modules"); }
|
else e_datastore_del("evry_modules"); \
|
||||||
|
E_FREE(_module); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*** handy macros ***/
|
/*** handy macros ***/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue