- match action also against subtype

- helper to get the path from an url
- added keybindings, 


SVN revision: 48411
This commit is contained in:
Hannes Janetzek 2010-04-29 00:00:08 +00:00
parent 3880adae76
commit 4b51ec0c20
5 changed files with 52 additions and 24 deletions

View File

@ -64,9 +64,13 @@ typedef int Evry_Type;
#define EVRY_ACTN(_item) ((Evry_Action *) _item)
#define EVRY_PLUGIN(_plugin) ((Evry_Plugin *) _plugin)
#define EVRY_VIEW(_view) ((Evry_View *) _view)
#define EVRY_FILE(_it) ((Evry_Item_File *) _it)
#define CHECK_TYPE(_item, _type) (((Evry_Item *)_item)->type == _type)
#define CHECK_SUBTYPE(_item, _type) (((Evry_Item *)_item)->subtype == _type)
#define CHECK_TYPE(_item, _type) \
(((Evry_Item *)_item)->type && ((Evry_Item *)_item)->type == _type)
#define CHECK_SUBTYPE(_item, _type) \
(((Evry_Item *)_item)->subtype && ((Evry_Item *)_item)->subtype == _type)
#define GET_APP(_app, _item) Evry_Item_App *_app = (Evry_Item_App *) _item
#define GET_FILE(_file, _item) Evry_Item_File *_file = (Evry_Item_File *) _item
@ -435,6 +439,7 @@ EAPI char *evry_util_unescape(const char *string, int length);
EAPI void evry_util_file_detail_set(Evry_Item_File *file);
EAPI Eina_Bool evry_util_module_config_check(const char *module_name, int conf, int epoch, int version);
EAPI Evas_Object *evry_util_icon_get(Evry_Item *it, Evas *e);
EAPI const char *evry_file_path_get(Evry_Item *it);
/* e_mod_main.c */
/* set plugin trigger and view mode first before register !*/

View File

@ -39,12 +39,9 @@ _begin(Evry_Plugin *plugin, const Evry_Item *it)
GET_PLUGIN(p, plugin);
Evry_Action *act;
Eina_List *l;
Evry_Type type;
if (!it || !it->type) return NULL;
type = it->type;
if (it->browseable)
{
EINA_LIST_FOREACH(evry_conf->actions, l, act)
@ -64,9 +61,10 @@ _begin(Evry_Plugin *plugin, const Evry_Item *it)
EINA_LIST_FOREACH(evry_conf->actions, l, act)
{
if ((!act->it1.type) ||
((act->it1.type == type) &&
(!act->check_item || act->check_item(act, it))))
if (((!act->it1.type) ||
(CHECK_TYPE(it, act->it1.type)) ||
(CHECK_SUBTYPE(it, act->it1.type))) &&
(!act->check_item || act->check_item(act, it)))
{
act->base.plugin = plugin;

View File

@ -1140,8 +1140,8 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
if (s->plugin->view_mode == VIEW_MODE_NONE)
{
if ((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
(!strcmp(key, "2")))
if (((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
(!strcmp(key, "2"))) || !strcmp(key, "XF86Back"))
{
if (v->mode == VIEW_MODE_LIST)
v->mode = VIEW_MODE_DETAIL;
@ -1153,8 +1153,8 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
_update_frame(v->span);
goto end;
}
else if ((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
(!strcmp(key, "3")))
else if (((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
(!strcmp(key, "3"))) || !strcmp(key, "XF86Forward"))
{
if (v->mode != VIEW_MODE_THUMB)
{

View File

@ -658,3 +658,27 @@ evry_util_url_escape(const char *string, int inlength)
ns[strindex]=0; /* terminate it */
return ns;
}
EAPI const char*
evry_file_path_get(Evry_Item *it)
{
const char *tmp;
char *path;
GET_FILE(file, it);
if (file->path)
return file->path;
if (!strncmp(file->url, "file://", 7))
tmp = file->url + 7;
else return NULL;
if (!(path = evry_util_unescape(tmp, 0)))
return NULL;
file->path = eina_stringshare_add(path);
E_FREE(path);
return file->path;
}

View File

@ -20,7 +20,7 @@ _animator(void *data)
Tab_View *v = data;
double da;
double spd = (8.0 / (double)e_config->framerate);
double spd = (15.0 / (double)e_config->framerate);
if (spd > 0.9) spd = 0.9;
int wait = 0;
@ -288,17 +288,18 @@ _tabs_key_down(Tab_View *v, const Ecore_Event_Key *ev)
if (!v->state || !v->state->cur_plugins) return 0;
if (!strcmp(key, "Next"))
{
_plugin_next(v);
return 1;
}
else if (!strcmp(key, "Prior"))
{
_plugin_prev(v);
return -1;
}
else if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT)
/* if (!strcmp(key, "Next"))
* {
* _plugin_next(v);
* return 1;
* }
* else if (!strcmp(key, "Prior"))
* {
* _plugin_prev(v);
* return -1;
* }
* else */
if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT)
{
if (!strcmp(key, "Left"))
{