forked from enlightenment/enlightenment
fix last commit.
started to make item type checking better SVN revision: 48391
This commit is contained in:
parent
7016b51af8
commit
b76df169ab
|
@ -75,7 +75,7 @@ _begin_open_with(Evry_Plugin *plugin, const Evry_Item *item)
|
|||
|
||||
const char *mime;
|
||||
|
||||
if (!evry_item_type_check(item, "FILE", NULL))
|
||||
if (!evry_item_type_check(item, EVRY_TYPE_FILE, NULL))
|
||||
return 0;
|
||||
|
||||
GET_FILE(file, item);
|
||||
|
@ -341,7 +341,7 @@ _item_add(Plugin *p, Efreet_Desktop *desktop, const char *file, int match)
|
|||
|
||||
EVRY_ACTN(app)->action = &_exec_open_file_action;
|
||||
EVRY_ITEM(app)->id = eina_stringshare_add(desktop->exec);
|
||||
EVRY_ITEM(app)->subtype = eina_stringshare_add("ACTION");
|
||||
EVRY_ITEM(app)->subtype = EVRY_TYPE_ACTION;
|
||||
|
||||
if (desktop->comment)
|
||||
EVRY_ITEM(app)->detail = eina_stringshare_add(desktop->comment);
|
||||
|
@ -353,7 +353,7 @@ _item_add(Plugin *p, Efreet_Desktop *desktop, const char *file, int match)
|
|||
app = EVRY_ITEM_NEW(Evry_Item_App, p, file, _icon_get, _item_free);
|
||||
EVRY_ITEM(app)->id = eina_stringshare_add(file);
|
||||
EVRY_ACTN(app)->action = &_exec_open_file_action;
|
||||
EVRY_ITEM(app)->subtype = eina_stringshare_add("ACTION");
|
||||
EVRY_ITEM(app)->subtype = EVRY_TYPE_ACTION;
|
||||
}
|
||||
|
||||
app->desktop = desktop;
|
||||
|
@ -746,7 +746,7 @@ _complete(Evry_Plugin *plugin, const Evry_Item *it, char **input)
|
|||
static int
|
||||
_exec_app_check_item(Evry_Action *act, const Evry_Item *it)
|
||||
{
|
||||
/* if (!evry_item_type_check(it, "APPLICATION", NULL)) return 0; */
|
||||
/* if (!evry_item_type_check(it, EVRY_TYPE_APP, NULL)) return 0; */
|
||||
|
||||
/* ITEM_APP(app, it); */
|
||||
|
||||
|
@ -792,8 +792,6 @@ _exec_term_action(Evry_Action *act)
|
|||
static int
|
||||
_exec_term_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
||||
{
|
||||
/* if (!evry_item_type_check(it, NULL, "APPLICATION")) return 0; */
|
||||
|
||||
GET_APP(app, it);
|
||||
|
||||
if (app->file)
|
||||
|
@ -826,8 +824,6 @@ _exec_sudo_action(Evry_Action *act)
|
|||
static int
|
||||
_edit_app_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
||||
{
|
||||
/* if (!evry_item_type_check(it, NULL, "APPLICATION")) return 0; */
|
||||
|
||||
GET_APP(app, it);
|
||||
|
||||
if (app->desktop)
|
||||
|
@ -862,8 +858,6 @@ _edit_app_action(Evry_Action *act)
|
|||
static int
|
||||
_new_app_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
||||
{
|
||||
/* if (!evry_item_type_check(it, NULL, "APPLICATION")) return 0; */
|
||||
|
||||
GET_APP(app, it);
|
||||
|
||||
if (app->desktop)
|
||||
|
@ -949,43 +943,59 @@ _plugins_init(void)
|
|||
if (!evry_api_version_check(EVRY_API_VERSION))
|
||||
return EINA_FALSE;
|
||||
|
||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Applications"), NULL, "APPLICATION",
|
||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Applications"), NULL, EVRY_TYPE_APP,
|
||||
_begin, _finish, _fetch, NULL);
|
||||
p->complete = &_complete;
|
||||
p->config_path = "extensions/everything-apps";
|
||||
evry_plugin_register(p, EVRY_PLUGIN_SUBJECT, 1);
|
||||
plug_apps = p;
|
||||
|
||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Open With..."), NULL, "APPLICATION",
|
||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Open With..."), NULL, EVRY_TYPE_APP,
|
||||
_begin_open_with, _finish, _fetch, NULL);
|
||||
|
||||
/* p->action = &_open_with_action; */
|
||||
p->config_path = "extensions/everything-apps";
|
||||
evry_plugin_register(p, EVRY_PLUGIN_ACTION, 1);
|
||||
plug_action = p;
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Launch"), "APPLICATION", NULL,
|
||||
"everything-launch", _exec_app_action, _exec_app_check_item);
|
||||
act = EVRY_ACTION_NEW(N_("Launch"),
|
||||
EVRY_TYPE_APP, NULL,
|
||||
"everything-launch",
|
||||
_exec_app_action,
|
||||
_exec_app_check_item);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Open File..."), "APPLICATION", "FILE", "document-open",
|
||||
_exec_app_action, _exec_app_check_item);
|
||||
act = EVRY_ACTION_NEW(N_("Open File..."),
|
||||
EVRY_TYPE_APP, EVRY_TYPE_FILE,
|
||||
"document-open",
|
||||
_exec_app_action,
|
||||
_exec_app_check_item);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Run in Terminal"), "APPLICATION", NULL, "system-run",
|
||||
_exec_term_action, _exec_term_check_item);
|
||||
act = EVRY_ACTION_NEW(N_("Run in Terminal"),
|
||||
EVRY_TYPE_APP, NULL,
|
||||
"system-run",
|
||||
_exec_term_action,
|
||||
_exec_term_check_item);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Edit Application Entry"), "APPLICATION", NULL, "everything-launch",
|
||||
_edit_app_action, _edit_app_check_item);
|
||||
act = EVRY_ACTION_NEW(N_("Edit Application Entry"),
|
||||
EVRY_TYPE_APP, NULL,
|
||||
"everything-launch",
|
||||
_edit_app_action,
|
||||
_edit_app_check_item);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("New Application Entry"), "APPLICATION", NULL, "everything-launch",
|
||||
_new_app_action, _new_app_check_item);
|
||||
act = EVRY_ACTION_NEW(N_("New Application Entry"),
|
||||
EVRY_TYPE_APP, NULL,
|
||||
"everything-launch",
|
||||
_new_app_action,
|
||||
_new_app_check_item);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Run with Sudo"), "APPLICATION", NULL, "system-run",
|
||||
_exec_sudo_action, NULL);
|
||||
act = EVRY_ACTION_NEW(N_("Run with Sudo"),
|
||||
EVRY_TYPE_APP, NULL,
|
||||
"system-run",
|
||||
_exec_sudo_action, NULL);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
EINA_LIST_FOREACH(_actions, l, act)
|
||||
|
|
|
@ -329,8 +329,8 @@ _plugins_init(void)
|
|||
if (!evry_api_version_check(EVRY_API_VERSION))
|
||||
return EINA_FALSE;
|
||||
|
||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Spell Checker"), "accessories-dictionary", "TEXT",
|
||||
NULL, _cleanup, _fetch, NULL);
|
||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Spell Checker"),"accessories-dictionary",
|
||||
EVRY_TYPE_TEXT, NULL, _cleanup, _fetch, NULL);
|
||||
|
||||
p->aggregate = EINA_FALSE;
|
||||
p->history = EINA_FALSE;
|
||||
|
|
|
@ -232,7 +232,7 @@ _plugins_init(void)
|
|||
if (!evry_api_version_check(EVRY_API_VERSION))
|
||||
return EINA_FALSE;
|
||||
|
||||
p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Calculator"), "accessories-calculator", "TEXT",
|
||||
p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Calculator"), "accessories-calculator", EVRY_TYPE_TEXT,
|
||||
_begin, _cleanup, _fetch, NULL);
|
||||
|
||||
p1->view_mode = VIEW_MODE_LIST;
|
||||
|
|
|
@ -75,8 +75,6 @@ static Eina_List *_actions = NULL;
|
|||
static void _cleanup(Evry_Plugin *plugin);
|
||||
|
||||
static const char *_mime_dir;
|
||||
static const char *_type_file;
|
||||
|
||||
|
||||
static void
|
||||
_item_fill(Evry_Item_File *file)
|
||||
|
@ -441,7 +439,7 @@ _begin(Evry_Plugin *plugin, const Evry_Item *it)
|
|||
Plugin *p = NULL;
|
||||
|
||||
/* is FILE ? */
|
||||
if (it && evry_item_type_check(it, "FILE", NULL))
|
||||
if (it && evry_item_type_check(it, EVRY_TYPE_FILE, NULL))
|
||||
{
|
||||
GET_FILE(file, it);
|
||||
|
||||
|
@ -488,7 +486,7 @@ _hist_add(Evry_Plugin *plugin, Evry_Item_File *file)
|
|||
|
||||
EINA_LIST_FOREACH(he->items, l, hi)
|
||||
{
|
||||
if (hi->type != _type_file)
|
||||
if (hi->type != EVRY_TYPE_FILE)
|
||||
continue;
|
||||
|
||||
if (hi->data)
|
||||
|
@ -622,7 +620,7 @@ _hist_items_add_cb(const Eina_Hash *hash, const void *key, void *data, void *fda
|
|||
|
||||
EINA_LIST_FOREACH(he->items, l, hi)
|
||||
{
|
||||
if (hi->type != _type_file)
|
||||
if (hi->type != EVRY_TYPE_FILE)
|
||||
continue;
|
||||
|
||||
/* filter out files that we already have from history */
|
||||
|
@ -991,45 +989,45 @@ _plugins_init(void)
|
|||
if (!evry_api_version_check(EVRY_API_VERSION))
|
||||
return EINA_FALSE;
|
||||
|
||||
p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Files"), NULL, "FILE", _begin, _cleanup, _fetch, NULL);
|
||||
p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Files"), NULL, EVRY_TYPE_FILE, _begin, _cleanup, _fetch, NULL);
|
||||
p1->config_path = "extensions/everything-files";
|
||||
evry_plugin_register(p1, EVRY_PLUGIN_SUBJECT, 3);
|
||||
/* p1->complete = &_complete; */
|
||||
|
||||
p2 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Files"), NULL, "FILE", _begin, _cleanup, _fetch, NULL);
|
||||
p2 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Files"), NULL, EVRY_TYPE_FILE, _begin, _cleanup, _fetch, NULL);
|
||||
p2->config_path = "extensions/everything-files";
|
||||
evry_plugin_register(p2, EVRY_PLUGIN_OBJECT, 1);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Open Folder (EFM)"), "FILE", NULL, "folder-open",
|
||||
act = EVRY_ACTION_NEW(N_("Open Folder (EFM)"), EVRY_TYPE_FILE, NULL, "folder-open",
|
||||
_open_folder_action, _open_folder_check);
|
||||
evry_action_register(act, 0);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Open Terminal here"), "FILE", NULL, "system-run",
|
||||
act = EVRY_ACTION_NEW(N_("Open Terminal here"), EVRY_TYPE_FILE, NULL, "system-run",
|
||||
_open_term_action, NULL);
|
||||
evry_action_register(act, 2);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Move to Trash"), "FILE", NULL, "edit-delete",
|
||||
act = EVRY_ACTION_NEW(N_("Move to Trash"), EVRY_TYPE_FILE, NULL, "edit-delete",
|
||||
_file_trash_action, NULL);
|
||||
EVRY_ITEM_DATA_INT_SET(act, ACT_TRASH);
|
||||
evry_action_register(act, 2);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Delete"), "FILE", NULL, "list-remove",
|
||||
act = EVRY_ACTION_NEW(N_("Delete"), EVRY_TYPE_FILE, NULL, "list-remove",
|
||||
_file_trash_action, NULL);
|
||||
EVRY_ITEM_DATA_INT_SET(act, ACT_DELETE);
|
||||
evry_action_register(act, 2);
|
||||
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Copy To ..."), "FILE", "FILE", "go-next",
|
||||
act = EVRY_ACTION_NEW(N_("Copy To ..."), EVRY_TYPE_FILE, EVRY_TYPE_FILE, "go-next",
|
||||
_file_copy_action, NULL);
|
||||
EVRY_ITEM_DATA_INT_SET(act, ACT_COPY);
|
||||
evry_action_register(act, 2);
|
||||
_actions = eina_list_append(_actions, act);
|
||||
|
||||
act = EVRY_ACTION_NEW(N_("Move To ..."), "FILE", "FILE", "go-next",
|
||||
act = EVRY_ACTION_NEW(N_("Move To ..."), EVRY_TYPE_FILE, EVRY_TYPE_FILE, "go-next",
|
||||
_file_copy_action, NULL);
|
||||
EVRY_ITEM_DATA_INT_SET(act, ACT_MOVE);
|
||||
evry_action_register(act, 2);
|
||||
|
@ -1253,7 +1251,6 @@ e_modapi_init(E_Module *m)
|
|||
_conf_init(m);
|
||||
|
||||
_mime_dir = eina_stringshare_add("inode/directory");
|
||||
_type_file = eina_stringshare_add("FILE");
|
||||
|
||||
e_module_delayed_set(m, 1);
|
||||
|
||||
|
@ -1267,7 +1264,6 @@ e_modapi_shutdown(E_Module *m)
|
|||
_plugins_shutdown();
|
||||
|
||||
eina_stringshare_del(_mime_dir);
|
||||
eina_stringshare_del(_type_file);
|
||||
|
||||
_conf_shutdown();
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ static Evry_Action *_act;
|
|||
static int
|
||||
_action(Evry_Action *act)
|
||||
{
|
||||
if (!evry_item_type_check(act->it1.item, "FILE", NULL))
|
||||
if (!evry_item_type_check(act->it1.item, EVRY_TYPE_FILE, NULL))
|
||||
return 0;
|
||||
|
||||
GET_FILE(file, act->it1.item);
|
||||
|
@ -73,7 +73,7 @@ static void
|
|||
_item_add(Evry_Item *it, const char *name, int method, const char *icon)
|
||||
{
|
||||
Evry_Action *act;
|
||||
act = EVRY_ACTION_NEW(name, "FILE", NULL, icon, _action, NULL);
|
||||
act = EVRY_ACTION_NEW(name, EVRY_TYPE_FILE, NULL, icon, _action, NULL);
|
||||
|
||||
EVRY_ITEM_DATA_INT_SET(act, method);
|
||||
EVRY_ITEM(act)->subtype = eina_stringshare_add("WALLPAPER");
|
||||
|
@ -104,7 +104,7 @@ _plugins_init(void)
|
|||
return EINA_FALSE;
|
||||
|
||||
_act = EVRY_ACTION_NEW(_("Set as Wallpaper"),
|
||||
"FILE", NULL,
|
||||
EVRY_TYPE_FILE, NULL,
|
||||
"preferences-desktop-wallpaper",
|
||||
NULL, _check);
|
||||
_act->fetch = _fetch;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "e.h"
|
||||
|
||||
#define EVRY_API_VERSION 7
|
||||
#define EVRY_API_VERSION 8
|
||||
|
||||
#define EVRY_ACTION_OTHER 0
|
||||
#define EVRY_ACTION_FINISHED 1
|
||||
|
@ -57,7 +57,6 @@ typedef struct _Config Evry_Config;
|
|||
typedef struct _Plugin_Config Plugin_Config;
|
||||
typedef struct _Plugin_Setting Plugin_Setting;
|
||||
|
||||
|
||||
#define EVRY_ITEM(_item) ((Evry_Item *)_item)
|
||||
#define EVRY_ACTN(_item) ((Evry_Action *) _item)
|
||||
#define EVRY_PLUGIN(_plugin) ((Evry_Plugin *) _plugin)
|
||||
|
@ -466,9 +465,17 @@ struct _Evry_Event_Item_Changed
|
|||
Evry_Item *item;
|
||||
};
|
||||
|
||||
extern EAPI int EVRY_EVENT_ITEM_SELECT;
|
||||
extern EAPI int EVRY_EVENT_ITEM_CHANGED;
|
||||
extern EAPI int EVRY_EVENT_ITEMS_UPDATE;
|
||||
EAPI extern int EVRY_EVENT_ITEM_SELECT;
|
||||
EAPI extern int EVRY_EVENT_ITEM_CHANGED;
|
||||
EAPI extern int EVRY_EVENT_ITEMS_UPDATE;
|
||||
|
||||
EAPI extern const char *EVRY_TYPE_FILE;
|
||||
EAPI extern const char *EVRY_TYPE_APP;
|
||||
EAPI extern const char *EVRY_TYPE_ACTION;
|
||||
EAPI extern const char *EVRY_TYPE_PLUGIN;
|
||||
EAPI extern const char *EVRY_TYPE_NONE;
|
||||
EAPI extern const char *EVRY_TYPE_BORDER;
|
||||
EAPI extern const char *EVRY_TYPE_TEXT;
|
||||
|
||||
EAPI extern Evry_History *evry_hist;
|
||||
EAPI extern Evry_Config *evry_conf;
|
||||
|
|
|
@ -39,6 +39,14 @@ EAPI int EVRY_EVENT_ITEM_SELECT;
|
|||
EAPI int EVRY_EVENT_ITEM_CHANGED;
|
||||
EAPI int EVRY_EVENT_ITEMS_UPDATE;
|
||||
|
||||
EAPI const char *EVRY_TYPE_FILE;
|
||||
EAPI const char *EVRY_TYPE_APP;
|
||||
EAPI const char *EVRY_TYPE_ACTION;
|
||||
EAPI const char *EVRY_TYPE_PLUGIN;
|
||||
EAPI const char *EVRY_TYPE_NONE;
|
||||
EAPI const char *EVRY_TYPE_BORDER;
|
||||
EAPI const char *EVRY_TYPE_TEXT;
|
||||
|
||||
/* module setup */
|
||||
EAPI E_Module_Api e_modapi =
|
||||
{
|
||||
|
@ -98,6 +106,14 @@ e_modapi_init(E_Module *m)
|
|||
if (!EVRY_EVENT_ITEM_CHANGED)
|
||||
EVRY_EVENT_ITEM_CHANGED = ecore_event_type_new();
|
||||
|
||||
EVRY_TYPE_FILE = eina_stringshare_add("EVRY_FILE");
|
||||
EVRY_TYPE_APP = eina_stringshare_add("EVRY_APP");
|
||||
EVRY_TYPE_ACTION = eina_stringshare_add("EVRY_ACTN");
|
||||
EVRY_TYPE_PLUGIN = eina_stringshare_add("EVRY_PLUG");
|
||||
EVRY_TYPE_NONE = eina_stringshare_add("EVRY_NONE");
|
||||
EVRY_TYPE_BORDER = eina_stringshare_add("EVRY_BORDER");
|
||||
EVRY_TYPE_TEXT = eina_stringshare_add("EVRY_TEXT");
|
||||
|
||||
e_module_delayed_set(m, 0);
|
||||
|
||||
/* make sure module is loaded before others */
|
||||
|
@ -123,6 +139,14 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
|||
_config_free();
|
||||
evry_history_free();
|
||||
|
||||
eina_stringshare_del(EVRY_TYPE_FILE);
|
||||
eina_stringshare_del(EVRY_TYPE_APP);
|
||||
eina_stringshare_del(EVRY_TYPE_ACTION);
|
||||
eina_stringshare_del(EVRY_TYPE_PLUGIN);
|
||||
eina_stringshare_del(EVRY_TYPE_NONE);
|
||||
eina_stringshare_del(EVRY_TYPE_BORDER);
|
||||
eina_stringshare_del(EVRY_TYPE_TEXT);
|
||||
|
||||
e_configure_registry_item_del("extensions/run_everything");
|
||||
e_configure_registry_category_del("extensions");
|
||||
|
||||
|
@ -437,7 +461,7 @@ evry_plugin_new(Evry_Plugin *base, const char *name, const char *label,
|
|||
evry_item_new(EVRY_ITEM(p), NULL, label, NULL, _evry_plugin_free);
|
||||
|
||||
p->base.icon = icon;
|
||||
p->base.type = eina_stringshare_add("PLUGIN");
|
||||
p->base.type = eina_stringshare_ref(EVRY_TYPE_PLUGIN);
|
||||
|
||||
if (item_type)
|
||||
p->base.subtype = eina_stringshare_add(item_type);
|
||||
|
|
|
@ -88,7 +88,6 @@ static Ecore_X_Window input_window = 0;
|
|||
static Eina_List *handlers = NULL;
|
||||
|
||||
static Evry_Selector *selector = NULL;
|
||||
static const char *thumb_types = NULL;
|
||||
|
||||
Evry_Selector **selectors = NULL;
|
||||
|
||||
|
@ -96,7 +95,6 @@ Evry_Selector **selectors = NULL;
|
|||
int
|
||||
evry_init(void)
|
||||
{
|
||||
thumb_types = eina_stringshare_add("FILE");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -105,7 +103,6 @@ evry_shutdown(void)
|
|||
{
|
||||
evry_hide();
|
||||
|
||||
eina_stringshare_del(thumb_types);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -925,7 +922,7 @@ _evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it)
|
|||
evas_object_del(sel->o_thumb);
|
||||
sel->o_thumb = NULL;
|
||||
|
||||
if (it->type != thumb_types) return 0;
|
||||
if (it->type != EVRY_TYPE_FILE) return 0;
|
||||
|
||||
GET_FILE(file, it);
|
||||
|
||||
|
@ -1147,7 +1144,7 @@ _evry_selector_objects_get(Evry_Action *act)
|
|||
|
||||
EINA_LIST_FOREACH(sel->plugins, l, p)
|
||||
{
|
||||
if (!evry_item_type_check(EVRY_ITEM(p), NULL, act->type_in2))
|
||||
if (!evry_item_type_check(EVRY_ITEM(p), NULL, act->it2.type))
|
||||
continue;
|
||||
|
||||
if (p->begin)
|
||||
|
@ -1335,7 +1332,7 @@ _evry_selectors_switch(int dir)
|
|||
(it->plugin == selector->actions))
|
||||
{
|
||||
GET_ACTION(act,it);
|
||||
if (act->type_in2)
|
||||
if (act->it2.type)
|
||||
{
|
||||
_evry_selector_objects_get(act);
|
||||
_evry_selector_update(selectors[2]);
|
||||
|
@ -1737,8 +1734,8 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
|
|||
if (!(it_act = s_act->cur_item))
|
||||
return;
|
||||
|
||||
if (evry_item_type_check(it_act, "ACTION", NULL) ||
|
||||
evry_item_type_check(it_act, NULL, "ACTION"))
|
||||
if (evry_item_type_check(it_act, EVRY_TYPE_ACTION, NULL) ||
|
||||
evry_item_type_check(it_act, NULL, EVRY_TYPE_ACTION))
|
||||
{
|
||||
GET_ACTION(act, it_act);
|
||||
|
||||
|
@ -1746,7 +1743,7 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
|
|||
return;
|
||||
|
||||
/* get object item for action, when required */
|
||||
if (act->type_in2)
|
||||
if (act->it2.type)
|
||||
{
|
||||
/* check if object is provided */
|
||||
if (selectors[2]->state)
|
||||
|
@ -1762,16 +1759,16 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
|
|||
return;
|
||||
}
|
||||
|
||||
act->item2 = it_obj;
|
||||
act->it2.item = it_obj;
|
||||
}
|
||||
|
||||
if (s_subj->sel_items)
|
||||
{
|
||||
EINA_LIST_REVERSE_FOREACH(s_subj->sel_items, l, it)
|
||||
{
|
||||
if (it->type != act->type_in1)
|
||||
if (it->type != act->it1.type)
|
||||
continue;
|
||||
act->item1 = it;
|
||||
act->it1.item = it;
|
||||
act->action(act);
|
||||
}
|
||||
}
|
||||
|
@ -1779,36 +1776,19 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
|
|||
{
|
||||
EINA_LIST_FOREACH(s_obj->sel_items, l, it)
|
||||
{
|
||||
if (it->type != act->type_in2)
|
||||
if (it->type != act->it2.type)
|
||||
continue;
|
||||
act->item2 = it;
|
||||
act->it2.item = it;
|
||||
act->action(act);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
act->item1 = it_subj;
|
||||
act->it1.item = it_subj;
|
||||
if (!act->action(act))
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* else if (s_act->plugin->action)
|
||||
* {
|
||||
* if (s_subj->sel_items)
|
||||
* {
|
||||
* EINA_LIST_REVERSE_FOREACH(s_subj->sel_items, l, it)
|
||||
* {
|
||||
* if (it->plugin->type_out != it_act->plugin->type_in)
|
||||
* continue;
|
||||
* s_act->plugin->action(s_act->plugin, it_act, it);
|
||||
* }
|
||||
* }
|
||||
* else
|
||||
* {
|
||||
* if (!s_act->plugin->action(s_act->plugin, it_act, it_subj))
|
||||
* return;
|
||||
* }
|
||||
* } */
|
||||
else return;
|
||||
|
||||
if (s_subj && it_subj)
|
||||
|
|
|
@ -210,7 +210,7 @@ evry_action_new(const char *name, const char *label,
|
|||
|
||||
evry_item_new(EVRY_ITEM(act), _base_plug, label, NULL, _action_free_cb);
|
||||
act->base.icon = icon;
|
||||
act->base.type = eina_stringshare_add("ACTION");
|
||||
act->base.type = eina_stringshare_ref(EVRY_TYPE_ACTION);
|
||||
|
||||
act->name = eina_stringshare_add(name);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ evry_plug_clipboard_init(void)
|
|||
if (!win) return EINA_FALSE;
|
||||
|
||||
//FIXME: Icon name doesnt follow FDO Spec
|
||||
act = EVRY_ACTION_NEW(N_("Copy to Clipboard"), "TEXT", NULL, "everything-clipboard",
|
||||
act = EVRY_ACTION_NEW(N_("Copy to Clipboard"), EVRY_TYPE_TEXT, NULL, "everything-clipboard",
|
||||
_action, _check_item);
|
||||
|
||||
evry_action_register(act, 10);
|
||||
|
|
|
@ -33,11 +33,11 @@ Eina_Bool
|
|||
evry_plug_text_init(void)
|
||||
{
|
||||
p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Text"),
|
||||
"accessories-text-editor", "TEXT",
|
||||
"accessories-text-editor", EVRY_TYPE_TEXT,
|
||||
NULL, _cleanup, _fetch, NULL);
|
||||
|
||||
p2 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Text"),
|
||||
"accessories-text-editor", "TEXT",
|
||||
"accessories-text-editor", EVRY_TYPE_TEXT,
|
||||
NULL, _cleanup, _fetch, NULL);
|
||||
p1->trigger = " ";
|
||||
p2->trigger = " ";
|
||||
|
|
|
@ -76,8 +76,6 @@ struct _Item
|
|||
};
|
||||
|
||||
static View *view = NULL;
|
||||
static const char *view_types = NULL;
|
||||
|
||||
|
||||
static void _view_clear(Evry_View *view, int slide);
|
||||
|
||||
|
@ -105,7 +103,7 @@ _thumb_gen(void *data, Evas_Object *obj, void *event_info)
|
|||
static int
|
||||
_check_item(const Evry_Item *it)
|
||||
{
|
||||
if (it->type != view_types) return 0;
|
||||
if (it->type != EVRY_TYPE_FILE) return 0;
|
||||
|
||||
GET_FILE(file, it);
|
||||
|
||||
|
@ -1489,15 +1487,12 @@ view_thumb_init(void)
|
|||
|
||||
view = v;
|
||||
|
||||
view_types = eina_stringshare_add("FILE");
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
view_thumb_shutdown(void)
|
||||
{
|
||||
eina_stringshare_del(view_types);
|
||||
evry_view_unregister(EVRY_VIEW(view));
|
||||
E_FREE(view);
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ evry_util_icon_get(Evry_Item *it, Evas *e)
|
|||
if (!o && it->icon)
|
||||
o = evry_icon_theme_get(it->icon, e);
|
||||
|
||||
if (evry_item_type_check(it, "FILE", NULL))
|
||||
if (evry_item_type_check(it, EVRY_TYPE_FILE, NULL))
|
||||
o = _file_icon_get(it, e);
|
||||
|
||||
/* TODO default type: files, apps */
|
||||
|
|
Loading…
Reference in New Issue