2010-04-10 13:05:57 -07:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
|
|
|
|
2010-05-10 16:45:49 -07:00
|
|
|
#include "e.h"
|
2010-04-10 13:05:57 -07:00
|
|
|
#include "e_mod_main.h"
|
2010-05-10 16:45:49 -07:00
|
|
|
#include "evry_api.h"
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
#define BORDER_SHOW 1
|
|
|
|
#define BORDER_HIDE 2
|
|
|
|
#define BORDER_FULLSCREEN 3
|
|
|
|
#define BORDER_TODESK 4
|
|
|
|
#define BORDER_CLOSE 5
|
|
|
|
|
2010-05-10 16:45:49 -07:00
|
|
|
static const Evry_API *evry = NULL;
|
|
|
|
static Evry_Module *evry_module = NULL;
|
|
|
|
|
2010-04-15 14:42:30 -07:00
|
|
|
static Evry_Plugin *p1;
|
2010-04-10 13:05:57 -07:00
|
|
|
static Eina_List *handlers = NULL;
|
|
|
|
static Eina_Hash *border_hash = NULL;
|
2010-04-27 20:22:40 -07:00
|
|
|
static Eina_List *_actions = NULL;
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-30 05:55:01 -07:00
|
|
|
/* static char _module_icon[] = "preferences-winlist"; */
|
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
static int
|
|
|
|
_cb_border_remove(void *data, int type, void *event)
|
|
|
|
{
|
|
|
|
E_Event_Border_Remove *ev = event;
|
|
|
|
Evry_Item *it;
|
|
|
|
Evry_Plugin *p = data;
|
|
|
|
|
|
|
|
it = eina_hash_find(border_hash, &(ev->border));
|
|
|
|
|
|
|
|
if (!it) return 1;
|
|
|
|
|
|
|
|
p->items = eina_list_remove(p->items, it);
|
2010-04-27 20:22:40 -07:00
|
|
|
eina_hash_del_by_key(border_hash, &(ev->border));
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-05-10 15:35:13 -07:00
|
|
|
EVRY_PLUGIN_UPDATE(p, EVRY_UPDATE_ADD);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void _hash_free(void *data)
|
|
|
|
{
|
|
|
|
Evry_Item *it = data;
|
2010-05-10 16:45:49 -07:00
|
|
|
evry->item_free(it);
|
2010-04-10 13:05:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evry_Plugin *
|
|
|
|
_begin(Evry_Plugin *p, const Evry_Item *it)
|
|
|
|
{
|
|
|
|
handlers = eina_list_append
|
|
|
|
(handlers, ecore_event_handler_add
|
|
|
|
(E_EVENT_BORDER_REMOVE, _cb_border_remove, p));
|
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
border_hash = eina_hash_pointer_new(_hash_free);
|
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cleanup(Evry_Plugin *p)
|
|
|
|
{
|
|
|
|
Ecore_Event_Handler *h;
|
2010-04-27 20:22:40 -07:00
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
EINA_LIST_FREE(handlers, h)
|
|
|
|
ecore_event_handler_del(h);
|
|
|
|
|
|
|
|
if (border_hash) eina_hash_free(border_hash);
|
|
|
|
border_hash = NULL;
|
2010-04-27 20:22:40 -07:00
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_free(Evry_Item *it)
|
|
|
|
{
|
|
|
|
if (it->data)
|
|
|
|
e_object_unref(E_OBJECT(it->data));
|
|
|
|
|
|
|
|
E_FREE(it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2010-04-27 20:22:40 -07:00
|
|
|
_icon_get(Evry_Item *it, Evas *e)
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
|
|
|
Evas_Object *o = NULL;
|
|
|
|
E_Border *bd = it->data;
|
|
|
|
|
|
|
|
if (bd->internal)
|
|
|
|
{
|
|
|
|
o = edje_object_add(e);
|
|
|
|
if (!bd->internal_icon)
|
|
|
|
e_util_edje_icon_set(o, "enlightenment/e");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!bd->internal_icon_key)
|
|
|
|
{
|
|
|
|
char *ext;
|
|
|
|
ext = strrchr(bd->internal_icon, '.');
|
|
|
|
if ((ext) && ((!strcmp(ext, ".edj"))))
|
|
|
|
{
|
|
|
|
if (!edje_object_file_set(o, bd->internal_icon, "icon"))
|
|
|
|
e_util_edje_icon_set(o, "enlightenment/e");
|
|
|
|
}
|
|
|
|
else if (ext)
|
|
|
|
{
|
|
|
|
evas_object_del(o);
|
|
|
|
o = e_icon_add(e);
|
|
|
|
e_icon_file_set(o, bd->internal_icon);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!e_util_edje_icon_set(o, bd->internal_icon))
|
|
|
|
e_util_edje_icon_set(o, "enlightenment/e");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_file_set(o, bd->internal_icon,
|
|
|
|
bd->internal_icon_key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!o && bd->desktop)
|
|
|
|
o = e_util_desktop_icon_add(bd->desktop, 128, e);
|
|
|
|
|
|
|
|
if (!o && bd->client.netwm.icons)
|
|
|
|
{
|
|
|
|
int i, size, tmp, found = 0;
|
|
|
|
o = e_icon_add(e);
|
|
|
|
|
|
|
|
size = bd->client.netwm.icons[0].width;
|
|
|
|
|
|
|
|
for (i = 1; i < bd->client.netwm.num_icons; i++)
|
|
|
|
{
|
|
|
|
if ((tmp = bd->client.netwm.icons[i].width) > size)
|
|
|
|
{
|
|
|
|
size = tmp;
|
|
|
|
found = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
e_icon_data_set(o, bd->client.netwm.icons[found].data,
|
|
|
|
bd->client.netwm.icons[found].width,
|
|
|
|
bd->client.netwm.icons[found].height);
|
|
|
|
e_icon_alpha_set(o, 1);
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!o)
|
|
|
|
o = e_border_icon_add(bd, e);
|
|
|
|
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-27 20:22:40 -07:00
|
|
|
_item_add(Evry_Plugin *p, E_Border *bd, int match, int *prio)
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
Evry_Item *it = NULL;
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if ((it = eina_hash_find(border_hash, &bd)))
|
|
|
|
{
|
|
|
|
it->priority = *prio;
|
|
|
|
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
|
|
|
it->fuzzy_match = match;
|
|
|
|
*prio += 1;
|
|
|
|
return;
|
|
|
|
}
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
it = EVRY_ITEM_NEW(Evry_Item, p, e_border_name_get(bd), _icon_get, _item_free);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
e_object_ref(E_OBJECT(bd));
|
|
|
|
it->data = bd;
|
|
|
|
it->fuzzy_match = match;
|
|
|
|
it->priority = *prio;
|
|
|
|
it->id = eina_stringshare_add(e_util_winid_str_get(bd->win));
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
*prio += 1;
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
eina_hash_add(border_hash, &bd, it);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
2010-04-10 13:05:57 -07:00
|
|
|
}
|
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
static int
|
|
|
|
_cb_sort(const void *data1, const void *data2)
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
const Evry_Item *it1 = data1;
|
|
|
|
const Evry_Item *it2 = data2;
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (it1->fuzzy_match - it2->fuzzy_match)
|
|
|
|
return (it1->fuzzy_match - it2->fuzzy_match);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
return (it1->priority - it2->priority);
|
2010-04-10 13:05:57 -07:00
|
|
|
}
|
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
static int
|
|
|
|
_fetch(Evry_Plugin *p, const char *input)
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
E_Zone *zone;
|
2010-04-10 13:05:57 -07:00
|
|
|
E_Border *bd;
|
2010-04-27 20:22:40 -07:00
|
|
|
Eina_List *l;
|
|
|
|
int prio = 0;
|
|
|
|
int m1, m2;
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
zone = e_util_zone_current_get(e_manager_current_get());
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
EINA_LIST_FOREACH(e_border_focus_stack_get(), l, bd)
|
|
|
|
{
|
|
|
|
if (zone == bd->zone)
|
|
|
|
{
|
|
|
|
if (!input)
|
|
|
|
_item_add(p, bd, 0, &prio);
|
|
|
|
else
|
|
|
|
{
|
2010-05-10 16:45:49 -07:00
|
|
|
m1 = evry->fuzzy_match(e_border_name_get(bd), input);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (bd->client.icccm.name)
|
|
|
|
{
|
2010-05-10 16:45:49 -07:00
|
|
|
m2 = evry->fuzzy_match(bd->client.icccm.name, input);
|
2010-04-27 20:22:40 -07:00
|
|
|
if (!m1 || (m2 && m2 < m1))
|
|
|
|
m1 = m2;
|
|
|
|
}
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (bd->desktop)
|
|
|
|
{
|
2010-05-10 16:45:49 -07:00
|
|
|
m2 = evry->fuzzy_match(bd->desktop->name, input);
|
2010-04-27 20:22:40 -07:00
|
|
|
if (!m1 || (m2 && m2 < m1))
|
|
|
|
m1 = m2;
|
|
|
|
}
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (m1)
|
|
|
|
_item_add(p, bd, m1, &prio);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (!p->items) return 0;
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
return 1;
|
2010-04-10 13:05:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2010-04-27 20:22:40 -07:00
|
|
|
_check_border(Evry_Action *act, const Evry_Item *it)
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
int action = EVRY_ITEM_DATA_INT_GET(act);
|
2010-04-20 17:10:31 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
E_Border *bd = it->data;
|
|
|
|
E_Zone *zone = e_util_zone_current_get(e_manager_current_get());
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
switch (action)
|
|
|
|
{
|
|
|
|
case BORDER_CLOSE:
|
|
|
|
if (bd->lock_close)
|
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BORDER_SHOW:
|
|
|
|
if (bd->lock_focus_in)
|
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BORDER_HIDE:
|
|
|
|
if (bd->lock_user_iconify)
|
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BORDER_FULLSCREEN:
|
|
|
|
if (!bd->lock_user_fullscreen)
|
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BORDER_TODESK:
|
|
|
|
if (bd->desk == (e_desk_current_get(zone)))
|
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
}
|
2010-04-10 13:05:57 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2010-04-27 20:22:40 -07:00
|
|
|
_act_border(Evry_Action *act)
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
int action = EVRY_ITEM_DATA_INT_GET(act);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-28 05:58:24 -07:00
|
|
|
E_Border *bd = act->it1.item->data;
|
2010-04-27 20:22:40 -07:00
|
|
|
E_Zone *zone = e_util_zone_current_get(e_manager_current_get());
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
int focus = 0;
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
switch (action)
|
|
|
|
{
|
|
|
|
case BORDER_CLOSE:
|
|
|
|
e_border_act_close_begin(bd);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BORDER_SHOW:
|
|
|
|
if (bd->desk != (e_desk_current_get(zone)))
|
|
|
|
e_desk_show(bd->desk);
|
|
|
|
focus = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BORDER_HIDE:
|
|
|
|
e_border_iconify(bd);
|
2010-05-01 07:20:30 -07:00
|
|
|
break;
|
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
case BORDER_FULLSCREEN:
|
|
|
|
if (!bd->fullscreen)
|
|
|
|
e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
|
|
|
|
else
|
|
|
|
e_border_unfullscreen(bd);
|
2010-05-01 07:20:30 -07:00
|
|
|
break;
|
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
case BORDER_TODESK:
|
|
|
|
if (bd->desk != (e_desk_current_get(zone)))
|
|
|
|
e_border_desk_set(bd, e_desk_current_get(zone));
|
|
|
|
focus = 1;
|
2010-05-01 07:20:30 -07:00
|
|
|
break;
|
|
|
|
default:
|
2010-05-01 07:22:01 -07:00
|
|
|
break;
|
2010-04-27 20:22:40 -07:00
|
|
|
}
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (focus)
|
|
|
|
{
|
|
|
|
if (bd->shaded)
|
|
|
|
e_border_unshade(bd, E_DIRECTION_UP);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (bd->iconic)
|
|
|
|
e_border_uniconify(bd);
|
|
|
|
else
|
|
|
|
e_border_raise(bd);
|
2010-05-01 07:22:01 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
e_border_focus_set_with_pointer(bd);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-05-10 16:45:49 -07:00
|
|
|
static int
|
|
|
|
_plugins_init(const Evry_API *_api)
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
2010-05-10 16:45:49 -07:00
|
|
|
Evry_Plugin *p;
|
2010-04-27 20:22:40 -07:00
|
|
|
Evry_Action *act;
|
2010-05-10 16:45:49 -07:00
|
|
|
|
2010-05-11 10:24:38 -07:00
|
|
|
if (evry_module->active)
|
2010-05-10 16:45:49 -07:00
|
|
|
return EINA_TRUE;
|
2010-04-27 20:22:40 -07:00
|
|
|
|
2010-05-10 16:45:49 -07:00
|
|
|
evry = _api;
|
|
|
|
|
|
|
|
if (!evry->api_version_check(EVRY_API_VERSION))
|
2010-04-10 13:05:57 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
|
2010-04-28 09:39:50 -07:00
|
|
|
p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Windows"), NULL, EVRY_TYPE_BORDER,
|
2010-04-27 20:22:40 -07:00
|
|
|
_begin, _cleanup, _fetch, NULL);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
p1->transient = EINA_TRUE;
|
2010-05-10 16:45:49 -07:00
|
|
|
evry->plugin_register(p1, EVRY_PLUGIN_SUBJECT, 2);
|
2010-04-27 20:22:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
act = EVRY_ACTION_NEW(_("Switch to Window"),
|
2010-04-28 09:39:50 -07:00
|
|
|
EVRY_TYPE_BORDER, 0, "go-next",
|
2010-04-27 20:22:40 -07:00
|
|
|
_act_border, _check_border);
|
|
|
|
EVRY_ITEM_DATA_INT_SET(act, BORDER_SHOW);
|
2010-05-10 16:45:49 -07:00
|
|
|
evry->action_register(act, 1);
|
2010-04-27 20:22:40 -07:00
|
|
|
|
|
|
|
_actions = eina_list_append(_actions, act);
|
|
|
|
|
|
|
|
act = EVRY_ACTION_NEW(_("Iconify"),
|
2010-04-28 09:39:50 -07:00
|
|
|
EVRY_TYPE_BORDER, 0, "iconic",
|
2010-04-27 20:22:40 -07:00
|
|
|
_act_border, _check_border);
|
|
|
|
EVRY_ITEM_DATA_INT_SET(act, BORDER_HIDE);
|
|
|
|
_actions = eina_list_append(_actions, act);
|
2010-05-10 16:45:49 -07:00
|
|
|
evry->action_register(act, 2);
|
2010-04-27 20:22:40 -07:00
|
|
|
|
|
|
|
act = EVRY_ACTION_NEW(_("Toggle Fullscreen"),
|
2010-04-28 09:39:50 -07:00
|
|
|
EVRY_TYPE_BORDER, 0, "view-fullscreen",
|
2010-04-27 20:22:40 -07:00
|
|
|
_act_border, _check_border);
|
|
|
|
EVRY_ITEM_DATA_INT_SET(act, BORDER_FULLSCREEN);
|
|
|
|
_actions = eina_list_append(_actions, act);
|
2010-05-10 16:45:49 -07:00
|
|
|
evry->action_register(act, 4);
|
2010-04-27 20:22:40 -07:00
|
|
|
|
|
|
|
act = EVRY_ACTION_NEW(_("Close"),
|
2010-04-28 09:39:50 -07:00
|
|
|
EVRY_TYPE_BORDER, 0, "view-fullscreen",
|
2010-04-27 20:22:40 -07:00
|
|
|
_act_border, _check_border);
|
|
|
|
EVRY_ITEM_DATA_INT_SET(act, BORDER_CLOSE);
|
|
|
|
_actions = eina_list_append(_actions, act);
|
2010-05-10 16:45:49 -07:00
|
|
|
evry->action_register(act, 3);
|
2010-04-27 20:22:40 -07:00
|
|
|
|
|
|
|
act = EVRY_ACTION_NEW(_("Send to Desktop"),
|
2010-04-28 09:39:50 -07:00
|
|
|
EVRY_TYPE_BORDER, 0, "go-previous",
|
2010-04-27 20:22:40 -07:00
|
|
|
_act_border, _check_border);
|
|
|
|
EVRY_ITEM_DATA_INT_SET(act, BORDER_TODESK);
|
|
|
|
_actions = eina_list_append(_actions, act);
|
2010-05-10 16:45:49 -07:00
|
|
|
evry->action_register(act, 3);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-24 16:07:13 -07:00
|
|
|
_plugins_shutdown(void)
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
Evry_Action *act;
|
|
|
|
|
2010-05-11 10:24:38 -07:00
|
|
|
if (!evry_module->active) return;
|
2010-05-10 16:45:49 -07:00
|
|
|
|
2010-04-15 14:42:30 -07:00
|
|
|
EVRY_PLUGIN_FREE(p1);
|
2010-04-10 14:38:36 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
EINA_LIST_FREE(_actions, act)
|
2010-05-10 16:45:49 -07:00
|
|
|
evry->action_free(act);
|
|
|
|
|
2010-05-11 10:24:38 -07:00
|
|
|
evry_module->active = EINA_FALSE;
|
2010-04-10 13:05:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
EAPI E_Module_Api e_modapi =
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
|
|
|
E_MODULE_API_VERSION,
|
|
|
|
"everything-windows"
|
|
|
|
};
|
|
|
|
|
|
|
|
EAPI void *
|
|
|
|
e_modapi_init(E_Module *m)
|
|
|
|
{
|
2010-05-10 16:45:49 -07:00
|
|
|
evry_module = E_NEW(Evry_Module, 1);
|
|
|
|
evry_module->init = &_plugins_init;
|
|
|
|
evry_module->shutdown = &_plugins_shutdown;
|
2010-05-10 18:53:34 -07:00
|
|
|
EVRY_MODULE_REGISTER(evry_module);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-05-11 10:24:38 -07:00
|
|
|
if ((evry = e_datastore_get("everything_loaded")))
|
2010-05-11 13:20:56 -07:00
|
|
|
evry_module->active = _plugins_init(evry);
|
2010-05-11 10:24:38 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
e_module_delayed_set(m, 1);
|
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_shutdown(E_Module *m)
|
|
|
|
{
|
2010-05-11 10:24:38 -07:00
|
|
|
_plugins_shutdown();
|
|
|
|
|
2010-05-10 18:53:34 -07:00
|
|
|
EVRY_MODULE_UNREGISTER(evry_module);
|
2010-05-10 16:45:49 -07:00
|
|
|
E_FREE(evry_module);
|
2010-04-27 20:22:40 -07:00
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_save(E_Module *m)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|