forked from enlightenment/enlightenment
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);
|
||||
|
||||
evry_module = E_NEW(Evry_Module, 1);
|
||||
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);
|
||||
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||
|
||||
/* taken from e_exebuf.c */
|
||||
exelist_exe_edd = E_CONFIG_DD_NEW("E_Exe", E_Exe);
|
||||
|
@ -1392,10 +1386,7 @@ e_modapi_init(E_Module *m)
|
|||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||
{
|
||||
_plugins_shutdown();
|
||||
|
||||
EVRY_MODULE_UNREGISTER(evry_module);
|
||||
E_FREE(evry_module);
|
||||
EVRY_MODULE_FREE(evry_module);
|
||||
|
||||
_conf_shutdown();
|
||||
|
||||
|
|
|
@ -637,13 +637,7 @@ e_modapi_init(E_Module *m)
|
|||
{
|
||||
_conf_init(m);
|
||||
|
||||
evry_module = E_NEW(Evry_Module, 1);
|
||||
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);
|
||||
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||
|
||||
e_module_delayed_set(m, 1);
|
||||
|
||||
|
@ -653,11 +647,8 @@ e_modapi_init(E_Module *m)
|
|||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||
{
|
||||
_plugins_shutdown();
|
||||
|
||||
EVRY_MODULE_UNREGISTER(evry_module);
|
||||
E_FREE(evry_module);
|
||||
|
||||
EVRY_MODULE_FREE(evry_module);
|
||||
|
||||
_conf_shutdown();
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -298,13 +298,7 @@ EAPI E_Module_Api e_modapi =
|
|||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
evry_module = E_NEW(Evry_Module, 1);
|
||||
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);
|
||||
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||
|
||||
e_module_delayed_set(m, 1);
|
||||
|
||||
|
@ -314,10 +308,7 @@ e_modapi_init(E_Module *m)
|
|||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||
{
|
||||
_plugins_shutdown();
|
||||
|
||||
EVRY_MODULE_UNREGISTER(evry_module);
|
||||
E_FREE(evry_module);
|
||||
EVRY_MODULE_FREE(evry_module);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1647,13 +1647,7 @@ e_modapi_init(E_Module *m)
|
|||
{
|
||||
_conf_init(m);
|
||||
|
||||
evry_module = E_NEW(Evry_Module, 1);
|
||||
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);
|
||||
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||
|
||||
e_module_delayed_set(m, 1);
|
||||
|
||||
|
@ -1663,10 +1657,7 @@ e_modapi_init(E_Module *m)
|
|||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||
{
|
||||
_plugins_shutdown();
|
||||
|
||||
EVRY_MODULE_UNREGISTER(evry_module);
|
||||
E_FREE(evry_module);
|
||||
EVRY_MODULE_FREE(evry_module);
|
||||
|
||||
_conf_shutdown();
|
||||
|
||||
|
|
|
@ -227,27 +227,18 @@ EAPI E_Module_Api e_modapi =
|
|||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
evry_module = E_NEW(Evry_Module, 1);
|
||||
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);
|
||||
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||
|
||||
e_module_delayed_set(m, 1);
|
||||
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||
{
|
||||
_plugins_shutdown();
|
||||
|
||||
EVRY_MODULE_UNREGISTER(evry_module);
|
||||
E_FREE(evry_module);
|
||||
|
||||
EVRY_MODULE_FREE(evry_module);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -488,13 +488,7 @@ EAPI E_Module_Api e_modapi =
|
|||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
evry_module = E_NEW(Evry_Module, 1);
|
||||
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);
|
||||
EVRY_MODULE_NEW(evry_module, evry, _plugins_init, _plugins_shutdown);
|
||||
|
||||
e_module_delayed_set(m, 1);
|
||||
|
||||
|
@ -504,10 +498,7 @@ e_modapi_init(E_Module *m)
|
|||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||
{
|
||||
_plugins_shutdown();
|
||||
|
||||
EVRY_MODULE_UNREGISTER(evry_module);
|
||||
E_FREE(evry_module);
|
||||
EVRY_MODULE_FREE(evry_module);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -132,9 +132,9 @@ e_modapi_init(E_Module *m)
|
|||
evry_history_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);
|
||||
|
||||
evry_plug_collection_init();
|
||||
|
@ -161,10 +161,10 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
|||
Eina_List *l;
|
||||
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();
|
||||
|
||||
e_datastore_del("everything_loaded");
|
||||
e_datastore_del("evry_api");
|
||||
E_FREE(_api);
|
||||
|
||||
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))
|
||||
#endif
|
||||
|
||||
#define EVRY_MODULE_REGISTER(_module) { \
|
||||
Eina_List *l = e_datastore_get("everything_modules"); \
|
||||
#define EVRY_MODULE_NEW(_module, _evry_api, _init, _shutdown) \
|
||||
{ \
|
||||
_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); \
|
||||
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_FREE(_module) \
|
||||
{ \
|
||||
_module->shutdown(); \
|
||||
Eina_List *l = e_datastore_get("evry_modules"); \
|
||||
l = eina_list_remove(l, _module); \
|
||||
if (l) e_datastore_set("evry_modules", l); \
|
||||
else e_datastore_del("evry_modules"); \
|
||||
E_FREE(_module); \
|
||||
}
|
||||
|
||||
#define EVRY_MODULE_UNREGISTER(_module) { \
|
||||
Eina_List *l = e_datastore_get("everything_modules"); \
|
||||
l = eina_list_remove(l, _module); \
|
||||
if (l) e_datastore_set("everything_modules", l); \
|
||||
else e_datastore_del("everything_modules"); }
|
||||
|
||||
/*** handy macros ***/
|
||||
|
||||
|
|
Loading…
Reference in New Issue