forked from enlightenment/enlightenment
e17/evry: better EVRY_MODULE_NEW/FREE macros
SVN revision: 62395
This commit is contained in:
parent
1e6baa34a9
commit
1ea8e5a0e1
|
@ -264,12 +264,13 @@ typedef void (*Evry_Item_Free_Cb) (Evry_Item *it);
|
|||
l = eina_list_append(l, _module); \
|
||||
e_datastore_set("evry_modules", l); \
|
||||
if ((_evry = e_datastore_get("evry_api"))) \
|
||||
evry_module->active = _init(_evry); \
|
||||
_module->active = _init(_evry); \
|
||||
}
|
||||
|
||||
#define EVRY_MODULE_FREE(_module) \
|
||||
{ \
|
||||
_module->shutdown(); \
|
||||
if (_module->active) _module->shutdown(); \
|
||||
_module->active = EINA_FALSE; \
|
||||
Eina_List *l = e_datastore_get("evry_modules"); \
|
||||
l = eina_list_remove(l, _module); \
|
||||
if (l) e_datastore_set("evry_modules", l); \
|
||||
|
|
|
@ -1018,9 +1018,6 @@ _plugins_init(const Evry_API *api)
|
|||
Eina_List *l;
|
||||
Evry_Action *act;
|
||||
|
||||
if (evry_module->active)
|
||||
return EINA_TRUE;
|
||||
|
||||
evry = api;
|
||||
|
||||
if (!evry->api_version_check(EVRY_API_VERSION))
|
||||
|
@ -1138,9 +1135,6 @@ _plugins_shutdown(void)
|
|||
Efreet_Desktop *d;
|
||||
Ecore_Event_Handler *h;
|
||||
|
||||
if (!evry_module->active)
|
||||
return;
|
||||
|
||||
EINA_LIST_FREE(apps_cache, d)
|
||||
efreet_desktop_unref(d);
|
||||
|
||||
|
@ -1152,8 +1146,6 @@ _plugins_shutdown(void)
|
|||
|
||||
EINA_LIST_FREE(handlers, h)
|
||||
ecore_event_handler_del(h);
|
||||
|
||||
evry_module->active = EINA_FALSE;
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
|
|
@ -240,9 +240,6 @@ _cb_del(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
static int
|
||||
_plugins_init(const Evry_API *_api)
|
||||
{
|
||||
if (evry_module->active)
|
||||
return EINA_TRUE;
|
||||
|
||||
evry = _api;
|
||||
|
||||
if (!evry->api_version_check(EVRY_API_VERSION))
|
||||
|
@ -276,14 +273,10 @@ _plugins_init(const Evry_API *_api)
|
|||
static void
|
||||
_plugins_shutdown(void)
|
||||
{
|
||||
if (!evry_module->active) return;
|
||||
|
||||
ecore_event_handler_del(action_handler);
|
||||
action_handler = NULL;
|
||||
|
||||
EVRY_PLUGIN_FREE(_plug);
|
||||
|
||||
evry_module->active = EINA_FALSE;
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
|
|
@ -1311,9 +1311,6 @@ _plugins_init(const Evry_API *api)
|
|||
Evry_Plugin *p;
|
||||
int prio = 0;
|
||||
|
||||
if (evry_module->active)
|
||||
return EINA_TRUE;
|
||||
|
||||
evry = api;
|
||||
|
||||
if (!evry->api_version_check(EVRY_API_VERSION))
|
||||
|
@ -1413,9 +1410,6 @@ _plugins_shutdown(void)
|
|||
Evry_Action *act;
|
||||
Evry_Plugin *p;
|
||||
|
||||
if (!evry_module->active)
|
||||
return;
|
||||
|
||||
eina_stringshare_del(_mime_dir);
|
||||
eina_stringshare_del(_mime_mount);
|
||||
eina_stringshare_del(_mime_unknown);
|
||||
|
@ -1429,8 +1423,6 @@ _plugins_shutdown(void)
|
|||
|
||||
EINA_LIST_FREE(_actions, act)
|
||||
evry->action_free(act);
|
||||
|
||||
evry_module->active = EINA_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -176,9 +176,6 @@ _action(Evry_Action *act)
|
|||
static int
|
||||
_plugins_init(const Evry_API *_api)
|
||||
{
|
||||
if (evry_module->active)
|
||||
return EINA_TRUE;
|
||||
|
||||
evry = _api;
|
||||
|
||||
if (!evry->api_version_check(EVRY_API_VERSION))
|
||||
|
@ -205,13 +202,9 @@ _plugins_init(const Evry_API *_api)
|
|||
static void
|
||||
_plugins_shutdown(void)
|
||||
{
|
||||
if (!evry_module->active) return;
|
||||
|
||||
EVRY_PLUGIN_FREE(p);
|
||||
|
||||
EVRY_ACTION_FREE(act);
|
||||
|
||||
evry_module->active = EINA_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -406,9 +406,6 @@ _plugins_init(const Evry_API *_api)
|
|||
{
|
||||
Evry_Action *act;
|
||||
|
||||
if (evry_module->active)
|
||||
return EINA_TRUE;
|
||||
|
||||
evry = _api;
|
||||
|
||||
if (!evry->api_version_check(EVRY_API_VERSION))
|
||||
|
@ -465,14 +462,10 @@ _plugins_shutdown(void)
|
|||
{
|
||||
Evry_Action *act;
|
||||
|
||||
if (!evry_module->active) return;
|
||||
|
||||
EVRY_PLUGIN_FREE(_plug);
|
||||
|
||||
EINA_LIST_FREE(_actions, act)
|
||||
EVRY_ACTION_FREE(act);
|
||||
|
||||
evry_module->active = EINA_FALSE;
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue