make plugin module loading completely independent of evry being loaded
cleanups SVN revision: 49154
This commit is contained in:
parent
ee49a80a1b
commit
318dc79c85
|
@ -231,9 +231,7 @@ _plugins_init(const Evry_API *_api)
|
|||
if (!evry->api_version_check(EVRY_API_VERSION))
|
||||
return EINA_FALSE;
|
||||
|
||||
EVRY_TYPE_TEXT = evry->type_register("TEXT");
|
||||
|
||||
action_handler = ecore_event_handler_add(EVRY_EVENT_ACTION_PERFORMED,
|
||||
action_handler = evry->event_handler_add(EVRY_EVENT_ACTION_PERFORMED,
|
||||
_cb_action_performed, NULL);
|
||||
|
||||
_plug = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Calculator"),
|
||||
|
|
|
@ -2,19 +2,9 @@
|
|||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
|
||||
/* TODO
|
||||
- watch plugin directories
|
||||
- get plugins from ~/.e/e/everything_plugins
|
||||
*/
|
||||
|
||||
#include "e_mod_main.h"
|
||||
|
||||
/* #undef DBG
|
||||
* #define DBG(...) ERR(__VA_ARGS__) */
|
||||
|
||||
#define CONFIG_VERSION 15
|
||||
|
||||
/* actual module specifics */
|
||||
static void _e_mod_action_cb(E_Object *obj, const char *params);
|
||||
static int _e_mod_run_defer_cb(void *data);
|
||||
static void _e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
|
@ -22,37 +12,23 @@ static void _e_mod_menu_add(void *data, E_Menu *m);
|
|||
static void _config_init(void);
|
||||
static void _config_free(void);
|
||||
static void _plugin_config_free(void);
|
||||
static int _cleanup_history(void *data);
|
||||
static int _cleanup_history(void *data);
|
||||
static void _evry_type_init(const char *type);
|
||||
|
||||
static Evry_API *_api = NULL;
|
||||
|
||||
static Eina_List *_evry_types = NULL;
|
||||
static E_Int_Menu_Augmentation *maug = NULL;
|
||||
static E_Action *act = NULL;
|
||||
static Ecore_Timer *cleanup_timer;
|
||||
|
||||
/* static Eina_Array *plugins = NULL; */
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
static E_Config_DD *plugin_conf_edd = NULL;
|
||||
static E_Config_DD *plugin_setting_edd = NULL;
|
||||
|
||||
static Ecore_Timer *cleanup_timer;
|
||||
|
||||
Evry_Config *evry_conf = NULL;
|
||||
int _evry_events[4];
|
||||
int _e_module_evry_log_dom = -1;
|
||||
|
||||
Evry_Config *evry_conf = NULL;
|
||||
|
||||
EAPI int EVRY_EVENT_ITEM_SELECT;
|
||||
EAPI int EVRY_EVENT_ITEM_CHANGED;
|
||||
EAPI int EVRY_EVENT_ITEMS_UPDATE;
|
||||
EAPI int EVRY_EVENT_ACTION_PERFORMED;
|
||||
|
||||
EAPI Evry_Type EVRY_TYPE_FILE;
|
||||
EAPI Evry_Type EVRY_TYPE_DIR;
|
||||
EAPI Evry_Type EVRY_TYPE_APP;
|
||||
EAPI Evry_Type EVRY_TYPE_ACTION;
|
||||
EAPI Evry_Type EVRY_TYPE_PLUGIN;
|
||||
EAPI Evry_Type EVRY_TYPE_NONE;
|
||||
EAPI Evry_Type EVRY_TYPE_BORDER;
|
||||
EAPI Evry_Type EVRY_TYPE_TEXT;
|
||||
|
||||
/* module setup */
|
||||
EAPI E_Module_Api e_modapi =
|
||||
|
@ -61,7 +37,6 @@ EAPI E_Module_Api e_modapi =
|
|||
"Everything"
|
||||
};
|
||||
|
||||
static Eina_List *_evry_types = NULL;
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
|
@ -79,14 +54,14 @@ e_modapi_init(E_Module *m)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
EVRY_TYPE_NONE = evry_type_register("NONE");
|
||||
EVRY_TYPE_FILE = evry_type_register("FILE");
|
||||
EVRY_TYPE_DIR = evry_type_register("DIRECTORY");
|
||||
EVRY_TYPE_APP = evry_type_register("APPLICATION");
|
||||
EVRY_TYPE_ACTION = evry_type_register("ACTION");
|
||||
EVRY_TYPE_PLUGIN = evry_type_register("PLUGIN");
|
||||
EVRY_TYPE_BORDER = evry_type_register("BORDER");
|
||||
EVRY_TYPE_TEXT = evry_type_register("TEXT");
|
||||
_evry_type_init("NONE");
|
||||
_evry_type_init("FILE");
|
||||
_evry_type_init("DIRECTORY");
|
||||
_evry_type_init("APPLICATION");
|
||||
_evry_type_init("ACTION");
|
||||
_evry_type_init("PLUGIN");
|
||||
_evry_type_init("BORDER");
|
||||
_evry_type_init("TEXT");
|
||||
|
||||
_config_init();
|
||||
evry_history_init();
|
||||
|
@ -119,14 +94,11 @@ e_modapi_init(E_Module *m)
|
|||
NULL, "system-run", evry_config_dialog);
|
||||
evry_init();
|
||||
|
||||
if (!EVRY_EVENT_ITEMS_UPDATE)
|
||||
EVRY_EVENT_ITEMS_UPDATE = ecore_event_type_new();
|
||||
if (!EVRY_EVENT_ITEM_SELECT)
|
||||
EVRY_EVENT_ITEM_SELECT = ecore_event_type_new();
|
||||
if (!EVRY_EVENT_ITEM_CHANGED)
|
||||
EVRY_EVENT_ITEM_CHANGED = ecore_event_type_new();
|
||||
if (!EVRY_EVENT_ACTION_PERFORMED)
|
||||
EVRY_EVENT_ACTION_PERFORMED = ecore_event_type_new();
|
||||
|
||||
_evry_events[EVRY_EVENT_ITEMS_UPDATE] = ecore_event_type_new();
|
||||
_evry_events[EVRY_EVENT_ITEM_SELECTED] = ecore_event_type_new();
|
||||
_evry_events[EVRY_EVENT_ITEM_CHANGED] = ecore_event_type_new();
|
||||
_evry_events[EVRY_EVENT_ACTION_PERFORMED] = ecore_event_type_new();
|
||||
|
||||
e_module_delayed_set(m, 0);
|
||||
|
||||
|
@ -169,6 +141,7 @@ e_modapi_init(E_Module *m)
|
|||
SET(history_item_add);
|
||||
SET(history_types_get);
|
||||
SET(history_item_usage_set);
|
||||
SET(event_handler_add);
|
||||
#undef SET
|
||||
|
||||
e_datastore_set("everything_loaded", _api);
|
||||
|
@ -249,11 +222,18 @@ e_modapi_save(E_Module *m __UNUSED__)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
Ecore_Event_Handler *
|
||||
evry_event_handler_add(int type, int (*func) (void *data, int type, void *event), const void *data)
|
||||
{
|
||||
return ecore_event_handler_add(_evry_events[type], func, data);
|
||||
}
|
||||
|
||||
|
||||
Evry_Type
|
||||
evry_type_register(const char *type)
|
||||
{
|
||||
const char *t = eina_stringshare_add(type);
|
||||
Evry_Type ret = 0;
|
||||
Evry_Type ret = NUM_EVRY_TYPES;
|
||||
const char *i;
|
||||
Eina_List *l;
|
||||
|
||||
|
@ -273,6 +253,13 @@ evry_type_register(const char *type)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_evry_type_init(const char *type)
|
||||
{
|
||||
const char *t = eina_stringshare_add(type);
|
||||
_evry_types = eina_list_append(_evry_types, t);
|
||||
}
|
||||
|
||||
const char *
|
||||
evry_type_get(Evry_Type type)
|
||||
{
|
||||
|
@ -455,8 +442,9 @@ _config_free(void)
|
|||
E_FREE(evry_conf);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* action callback */
|
||||
|
||||
static Ecore_Idle_Enterer *_idler = NULL;
|
||||
static const char *_params = NULL;
|
||||
|
||||
|
@ -505,6 +493,7 @@ _e_mod_action_cb(E_Object *obj, const char *params)
|
|||
static void
|
||||
_e_mod_run_cb(void *data __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__)
|
||||
{
|
||||
IF_RELEASE(_params);
|
||||
ecore_idle_enterer_add(_e_mod_run_defer_cb, m->zone);
|
||||
}
|
||||
|
||||
|
|
|
@ -302,8 +302,11 @@ int evry_state_push(Evry_Selector *sel, Eina_List *plugins);
|
|||
void evry_selectors_switch(int dir);
|
||||
int evry_view_toggle(Evry_State *s, const char *trigger);
|
||||
|
||||
Ecore_Event_Handler *evry_event_handler_add(int type, int (*func) (void *data, int type, void *event), const void *data);
|
||||
|
||||
extern Evry_History *evry_hist;
|
||||
extern Evry_Config *evry_conf;
|
||||
extern int _evry_events[4];
|
||||
|
||||
#define EVRY_ITEM_NEW(_base, _plugin, _label, _icon_get, _free) \
|
||||
(_base *) evry_item_new(EVRY_ITEM(E_NEW(_base, 1)), EVRY_PLUGIN(_plugin), \
|
||||
|
|
|
@ -233,7 +233,7 @@ evry_show(E_Zone *zone, const char *params)
|
|||
_evry_cb_selection_notify, win));
|
||||
|
||||
win->handlers = eina_list_append
|
||||
(win->handlers, ecore_event_handler_add
|
||||
(win->handlers, evry_event_handler_add
|
||||
(EVRY_EVENT_ITEM_CHANGED,
|
||||
_evry_cb_item_changed, NULL));
|
||||
|
||||
|
@ -2160,7 +2160,7 @@ _evry_action_do(Evry_Action *act)
|
|||
if (ev->it2)
|
||||
EVRY_ITEM_REF(ev->it2);
|
||||
|
||||
ecore_event_add(EVRY_EVENT_ACTION_PERFORMED, ev,
|
||||
ecore_event_add(_evry_events[EVRY_EVENT_ACTION_PERFORMED], ev,
|
||||
_evry_cb_free_action_performed, NULL);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "evry_types.h"
|
||||
|
||||
#define EVRY_API_VERSION 23
|
||||
#define EVRY_API_VERSION 25
|
||||
|
||||
#define EVRY_ACTION_OTHER 0
|
||||
#define EVRY_ACTION_FINISHED 1
|
||||
|
@ -26,19 +26,20 @@
|
|||
#define EVRY_PLUGIN_ACTION 1
|
||||
#define EVRY_PLUGIN_OBJECT 2
|
||||
|
||||
EAPI extern Evry_Type EVRY_TYPE_NONE;
|
||||
EAPI extern Evry_Type EVRY_TYPE_FILE;
|
||||
EAPI extern Evry_Type EVRY_TYPE_DIR;
|
||||
EAPI extern Evry_Type EVRY_TYPE_APP;
|
||||
EAPI extern Evry_Type EVRY_TYPE_ACTION;
|
||||
EAPI extern Evry_Type EVRY_TYPE_PLUGIN;
|
||||
EAPI extern Evry_Type EVRY_TYPE_BORDER;
|
||||
EAPI extern Evry_Type EVRY_TYPE_TEXT;
|
||||
#define EVRY_TYPE_NONE 0
|
||||
#define EVRY_TYPE_FILE 1
|
||||
#define EVRY_TYPE_DIR 2
|
||||
#define EVRY_TYPE_APP 3
|
||||
#define EVRY_TYPE_ACTION 4
|
||||
#define EVRY_TYPE_PLUGIN 5
|
||||
#define EVRY_TYPE_BORDER 6
|
||||
#define EVRY_TYPE_TEXT 7
|
||||
#define NUM_EVRY_TYPES 8
|
||||
|
||||
EAPI extern int EVRY_EVENT_ITEM_SELECT;
|
||||
EAPI extern int EVRY_EVENT_ITEM_CHANGED;
|
||||
EAPI extern int EVRY_EVENT_ITEMS_UPDATE;
|
||||
EAPI extern int EVRY_EVENT_ACTION_PERFORMED;
|
||||
#define EVRY_EVENT_ITEM_SELECTED 0
|
||||
#define EVRY_EVENT_ITEM_CHANGED 1
|
||||
#define EVRY_EVENT_ITEMS_UPDATE 2
|
||||
#define EVRY_EVENT_ACTION_PERFORMED 3
|
||||
|
||||
typedef struct _Evry_API Evry_API;
|
||||
typedef struct _Evry_Module Evry_Module;
|
||||
|
@ -46,29 +47,6 @@ typedef struct _Evry_Module Evry_Module;
|
|||
typedef struct _Evry_Event_Item_Changed Evry_Event_Item_Changed;
|
||||
typedef struct _Evry_Event_Action_Performed Evry_Event_Action_Performed;
|
||||
|
||||
/***************************************************
|
||||
|
||||
static Evry_Module *evry_module;
|
||||
static const Evry_API evry;
|
||||
|
||||
in e_modapi_init do:
|
||||
|
||||
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")))
|
||||
_plugins_init(evry);
|
||||
|
||||
in e_modapi_shutdown:
|
||||
|
||||
_plugins_shutdown();
|
||||
|
||||
EVRY_MODULE_UNREGISTER(evry_module);
|
||||
E_FREE(evry_module);
|
||||
|
||||
***************************************************/
|
||||
|
||||
struct _Evry_Module
|
||||
{
|
||||
|
@ -138,6 +116,8 @@ struct _Evry_API
|
|||
History_Types *(*history_types_get)(Evry_Type type);
|
||||
int (*history_item_usage_set)(Evry_Item *it, const char *input, const char *ctxt);
|
||||
|
||||
Ecore_Event_Handler *(*event_handler_add)(int type, int (*func) (void *data, int type, void *event), const void *data);
|
||||
|
||||
int log_dom;
|
||||
};
|
||||
|
||||
|
@ -157,7 +137,6 @@ struct _Evry_Event_Action_Performed
|
|||
|
||||
|
||||
/*** cast default types ***/
|
||||
|
||||
#define EVRY_ITEM(_item) ((Evry_Item *)_item)
|
||||
#define EVRY_ACTN(_item) ((Evry_Action *) _item)
|
||||
#define EVRY_PLUGIN(_plugin) ((Evry_Plugin *) _plugin)
|
||||
|
@ -168,56 +147,101 @@ struct _Evry_Event_Action_Performed
|
|||
#define GET_CMD(_app, _item) Evry_Item_App *_app = (Evry_Item_App *) _item
|
||||
#define GET_FILE(_file, _item) Evry_Item_File *_file = (Evry_Item_File *) _item
|
||||
#define GET_EVRY_PLUGIN(_p, _plugin) Evry_Plugin *_p = (Evry_Plugin*) _plugin
|
||||
#define GET_PLUGIN(_p, _plugin) Plugin *_p = (Plugin*) _plugin
|
||||
#define GET_VIEW(_v, _view) View *_v = (View*) _view
|
||||
#define GET_ACTION(_act, _item) Evry_Action *_act = (Evry_Action *) _item
|
||||
#define GET_PLUGIN(_p, _plugin) Plugin *_p = (Plugin*) _plugin
|
||||
#define GET_ITEM(_it, _any) Evry_Item *_it = (Evry_Item *) _any
|
||||
|
||||
#define EVRY_ITEM_DATA_INT_SET(_item, _data) ((Evry_Item *)_item)->data = (void*)(long) _data
|
||||
#define EVRY_ITEM_DATA_INT_GET(_item) (long) ((Evry_Item *)_item)->data
|
||||
/*** Evry_Item macros ***/
|
||||
#ifndef EVRY_H
|
||||
#define EVRY_ITEM_NEW(_base, _plugin, _label, _icon_get, _free) \
|
||||
(_base *) evry->item_new(EVRY_ITEM(E_NEW(_base, 1)), \
|
||||
EVRY_PLUGIN(_plugin), \
|
||||
_label, _icon_get, _free)
|
||||
|
||||
#define EVRY_ITEM_DETAIL_SET(_it, _detail) \
|
||||
if (EVRY_ITEM(_it)->detail) eina_stringshare_del(EVRY_ITEM(_it)->detail); \
|
||||
#define EVRY_ITEM_FREE(_item) evry->item_free((Evry_Item *)_item)
|
||||
#define EVRY_ITEM_REF(_item) evry->item_ref((Evry_Item *)_item)
|
||||
#endif
|
||||
|
||||
#define EVRY_ITEM_DATA_INT_SET(_item, _data) \
|
||||
((Evry_Item *)_item)->data = (void*)(long) _data
|
||||
|
||||
#define EVRY_ITEM_DATA_INT_GET(_item) (long) \
|
||||
((Evry_Item *)_item)->data
|
||||
|
||||
#define EVRY_ITEM_DETAIL_SET(_it, _detail) \
|
||||
if (EVRY_ITEM(_it)->detail) \
|
||||
eina_stringshare_del(EVRY_ITEM(_it)->detail); \
|
||||
EVRY_ITEM(_it)->detail = eina_stringshare_add(_detail);
|
||||
|
||||
#define EVRY_ITEM_LABEL_SET(_it, _label) \
|
||||
if (EVRY_ITEM(_it)->label) eina_stringshare_del(EVRY_ITEM(_it)->label); \
|
||||
#define EVRY_ITEM_LABEL_SET(_it, _label) \
|
||||
if (EVRY_ITEM(_it)->label) \
|
||||
eina_stringshare_del(EVRY_ITEM(_it)->label); \
|
||||
EVRY_ITEM(_it)->label = eina_stringshare_add(_label);
|
||||
|
||||
#define EVRY_ITEM_CONTEXT_SET(_it, _context) \
|
||||
if (EVRY_ITEM(_it)->context) eina_stringshare_del(EVRY_ITEM(_it)->context); \
|
||||
#define EVRY_ITEM_CONTEXT_SET(_it, _context) \
|
||||
if (EVRY_ITEM(_it)->context) \
|
||||
eina_stringshare_del(EVRY_ITEM(_it)->context); \
|
||||
EVRY_ITEM(_it)->context = eina_stringshare_add(_context);
|
||||
|
||||
#define EVRY_ITEM_ICON_SET(_it, _icon) \
|
||||
if (EVRY_ITEM(_it)->icon) eina_stringshare_del(EVRY_ITEM(_it)->icon); \
|
||||
#define EVRY_ITEM_ICON_SET(_it, _icon) \
|
||||
if (EVRY_ITEM(_it)->icon) \
|
||||
eina_stringshare_del(EVRY_ITEM(_it)->icon); \
|
||||
EVRY_ITEM(_it)->icon = eina_stringshare_add(_icon);
|
||||
|
||||
#define CHECK_TYPE(_item, _type) \
|
||||
#define CHECK_TYPE(_item, _type) \
|
||||
(((Evry_Item *)_item)->type && ((Evry_Item *)_item)->type == _type)
|
||||
|
||||
#define CHECK_SUBTYPE(_item, _type) \
|
||||
#define CHECK_SUBTYPE(_item, _type) \
|
||||
(((Evry_Item *)_item)->subtype && ((Evry_Item *)_item)->subtype == _type)
|
||||
|
||||
#define IS_BROWSEABLE(_item) ((Evry_Item *)_item)->browseable
|
||||
|
||||
#define EVRY_PLUGIN_ITEMS_SORT(_p, _sortcb) \
|
||||
EVRY_PLUGIN(_p)->items = eina_list_sort \
|
||||
/*** Evry_Plugin macros ***/
|
||||
#ifndef EVRY_H
|
||||
#define EVRY_PLUGIN_NEW(_base, _name, _icon, _item_type, _begin, _finish, _fetch, _free) \
|
||||
evry->plugin_new(EVRY_PLUGIN(E_NEW(_base, 1)), _name, _(_name), _icon, _item_type, \
|
||||
_begin, _finish, _fetch, _free)
|
||||
|
||||
#define EVRY_PLUGIN_FREE(_p) if (_p) evry->plugin_free(EVRY_PLUGIN(_p))
|
||||
|
||||
#define EVRY_PLUGIN_ITEMS_FREE(_p) { \
|
||||
Evry_Item *it; \
|
||||
EINA_LIST_FREE(EVRY_PLUGIN(_p)->items, it) \
|
||||
evry->item_free(it); }
|
||||
|
||||
#define EVRY_PLUGIN_ITEMS_ADD(_plugin, _items, _input, _match_detail, _set_usage) \
|
||||
evry->util_plugin_items_add(EVRY_PLUGIN(_plugin), _items, _input, _match_detail, _set_usage)
|
||||
|
||||
#define EVRY_PLUGIN_UPDATE(_p, _action) \
|
||||
if (_p) evry->plugin_update(EVRY_PLUGIN(_p), _action)
|
||||
#endif
|
||||
#define EVRY_PLUGIN_ITEMS_SORT(_p, _sortcb) \
|
||||
EVRY_PLUGIN(_p)->items = eina_list_sort \
|
||||
(EVRY_PLUGIN(_p)->items, eina_list_count(EVRY_PLUGIN(_p)->items), _sortcb)
|
||||
|
||||
#define EVRY_PLUGIN_ITEM_APPEND(_p, _item) \
|
||||
#define EVRY_PLUGIN_ITEM_APPEND(_p, _item) \
|
||||
EVRY_PLUGIN(_p)->items = eina_list_append(EVRY_PLUGIN(_p)->items, EVRY_ITEM(_item))
|
||||
|
||||
#define EVRY_PLUGIN_INSTANCE(_p, _plugin) { \
|
||||
_p = E_NEW(Plugin, 1); \
|
||||
_p->base = *_plugin; \
|
||||
_p->base.items = NULL; \
|
||||
_p->base.base.plugin = (Evry_Plugin*)_p; } \
|
||||
#define EVRY_PLUGIN_INSTANCE(_p, _plugin) { \
|
||||
_p = E_NEW(Plugin, 1); \
|
||||
_p->base = *_plugin; \
|
||||
_p->base.items = NULL; \
|
||||
_p->base.base.plugin = (Evry_Plugin*)_p; } \
|
||||
|
||||
#define EVRY_PLUGIN_ITEMS_CLEAR(_p) { \
|
||||
Evry_Item *it; \
|
||||
EINA_LIST_FREE(EVRY_PLUGIN(_p)->items, it) \
|
||||
#define EVRY_PLUGIN_ITEMS_CLEAR(_p) { \
|
||||
Evry_Item *it; \
|
||||
EINA_LIST_FREE(EVRY_PLUGIN(_p)->items, it) \
|
||||
if (it) it->fuzzy_match = 0; }
|
||||
|
||||
/*** Evry_Action macros ***/
|
||||
#ifndef EVRY_H
|
||||
#define EVRY_ACTION_NEW(_name, _in1, _in2, _icon, _action, _check) \
|
||||
evry->action_new(_name, _(_name), _in1, _in2, _icon, _action, _check)
|
||||
|
||||
#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"); \
|
||||
l = eina_list_append(l, _module); \
|
||||
|
@ -230,53 +254,16 @@ struct _Evry_Event_Action_Performed
|
|||
|
||||
/*** handy macros ***/
|
||||
|
||||
#define IF_RELEASE(x) do { \
|
||||
if (x) { \
|
||||
const char *__tmp; __tmp = (x); (x) = NULL; eina_stringshare_del(__tmp); \
|
||||
} \
|
||||
(x) = NULL; \
|
||||
#define IF_RELEASE(x) do { \
|
||||
if (x) { \
|
||||
const char *__tmp; __tmp = (x); \
|
||||
(x) = NULL; eina_stringshare_del(__tmp); \
|
||||
} \
|
||||
(x) = NULL; \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
#ifndef EVRY_H
|
||||
/*** Evry_Item macros ***/
|
||||
|
||||
#define EVRY_ITEM_NEW(_base, _plugin, _label, _icon_get, _free) \
|
||||
(_base *) evry->item_new(EVRY_ITEM(E_NEW(_base, 1)), EVRY_PLUGIN(_plugin), \
|
||||
_label, _icon_get, _free)
|
||||
|
||||
#define EVRY_ITEM_FREE(_item) evry->item_free((Evry_Item *)_item)
|
||||
#define EVRY_ITEM_REF(_item) evry->item_ref((Evry_Item *)_item)
|
||||
|
||||
/*** Evry_Plugin macros ***/
|
||||
|
||||
#define EVRY_PLUGIN_NEW(_base, _name, _icon, _item_type, _begin, _finish, _fetch, _free) \
|
||||
evry->plugin_new(EVRY_PLUGIN(E_NEW(_base, 1)), _name, _(_name), _icon, _item_type, \
|
||||
_begin, _finish, _fetch, _free)
|
||||
|
||||
#define EVRY_PLUGIN_FREE(_p) if (_p) evry->plugin_free(EVRY_PLUGIN(_p))
|
||||
|
||||
#define EVRY_PLUGIN_ITEMS_FREE(_p) { \
|
||||
Evry_Item *it; \
|
||||
EINA_LIST_FREE(EVRY_PLUGIN(_p)->items, it) \
|
||||
evry->item_free(it); }
|
||||
|
||||
// should be renamed to ITEMS_FILTER
|
||||
#define EVRY_PLUGIN_ITEMS_ADD(_plugin, _items, _input, _match_detail, _set_usage) \
|
||||
evry->util_plugin_items_add(EVRY_PLUGIN(_plugin), _items, _input, _match_detail, _set_usage)
|
||||
|
||||
#define EVRY_PLUGIN_UPDATE(_p, _action) \
|
||||
if (_p) evry->plugin_update(EVRY_PLUGIN(_p), _action)
|
||||
|
||||
/*** Evry_Action macros ***/
|
||||
|
||||
#define EVRY_ACTION_NEW(_name, _in1, _in2, _icon, _action, _check) \
|
||||
evry->action_new(_name, _(_name), _in1, _in2, _icon, _action, _check)
|
||||
|
||||
#define EVRY_ACTION_FREE(_act) if (_act) evry->action_free(EVRY_ACTN(_act))
|
||||
|
||||
|
||||
|
||||
#ifndef EINA_LOG_DEFAULT_COLOR
|
||||
#define EINA_LOG_DEFAULT_COLOR EINA_COLOR_CYAN
|
||||
|
|
|
@ -187,7 +187,8 @@ _fill_list(Eina_List *plugins, Evas_Object *obj, int enabled __UNUSED__)
|
|||
Evas_Coord w;
|
||||
Eina_List *l;
|
||||
Plugin_Config *pc;
|
||||
|
||||
Evas_Object *end;
|
||||
|
||||
/* freeze evas, edje, and list widget */
|
||||
evas = evas_object_evas_get(obj);
|
||||
evas_event_freeze(evas);
|
||||
|
@ -197,10 +198,7 @@ _fill_list(Eina_List *plugins, Evas_Object *obj, int enabled __UNUSED__)
|
|||
|
||||
EINA_LIST_FOREACH(plugins, l, pc)
|
||||
{
|
||||
Evas_Object *end = edje_object_add(evas);
|
||||
|
||||
if (!end)
|
||||
continue;
|
||||
if (!(end = edje_object_add(evas))) break;
|
||||
|
||||
if (e_theme_edje_object_set(end, "base/theme/widgets",
|
||||
"e/widgets/ilist/toggle_end"))
|
||||
|
@ -210,7 +208,6 @@ _fill_list(Eina_List *plugins, Evas_Object *obj, int enabled __UNUSED__)
|
|||
}
|
||||
else
|
||||
{
|
||||
EINA_LOG_ERR("your theme misses 'e/widgets/ilist/toggle_end'!");
|
||||
evas_object_del(end);
|
||||
end = NULL;
|
||||
}
|
||||
|
|
|
@ -1658,7 +1658,7 @@ _view_create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow)
|
|||
EVRY_VIEW(v)->o_list = v->bg;
|
||||
EVRY_VIEW(v)->o_bar = v->tabs->o_tabs;
|
||||
|
||||
h = ecore_event_handler_add(EVRY_EVENT_ITEM_CHANGED, _cb_item_changed, v);
|
||||
h = evry_event_handler_add(EVRY_EVENT_ITEM_CHANGED, _cb_item_changed, v);
|
||||
v->handlers = eina_list_append(v->handlers, h);
|
||||
|
||||
return EVRY_VIEW(v);
|
||||
|
|
|
@ -170,6 +170,9 @@ struct _Evry_Plugin
|
|||
have extended plugin struct */
|
||||
void (*free) (Evry_Plugin *p);
|
||||
|
||||
/* optiona: actions only used with this plugin, dont require */
|
||||
Eina_List *actions;
|
||||
|
||||
/* optional: set type which the plugin can handle in begin */
|
||||
Evry_Type input_type;
|
||||
|
||||
|
|
|
@ -882,7 +882,7 @@ evry_item_changed(Evry_Item *it, int icon, int selected)
|
|||
ev->changed_selection = selected;
|
||||
ev->changed_icon = icon;
|
||||
evry_item_ref(it);
|
||||
ecore_event_add(EVRY_EVENT_ITEM_CHANGED, ev, _cb_free_item_changed, NULL);
|
||||
ecore_event_add(_evry_events[EVRY_EVENT_ITEM_CHANGED], ev, _cb_free_item_changed, NULL);
|
||||
}
|
||||
|
||||
static char thumb_buf[4096];
|
||||
|
|
Loading…
Reference in New Issue