forked from enlightenment/enlightenment
e17/evry: api change: recompile exrta evry modules.
- more work on evry gadget for illume (only works with tablet profile) SVN revision: 63097
This commit is contained in:
parent
0cdba19a2a
commit
9f6e4a581d
|
@ -30,7 +30,6 @@ EAPI E_Module_Api e_modapi =
|
|||
"Everything"
|
||||
};
|
||||
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
|
@ -120,7 +119,6 @@ e_modapi_init(E_Module *m)
|
|||
SET(util_plugin_items_add);
|
||||
SET(util_md5_sum);
|
||||
SET(util_icon_get);
|
||||
SET(items_sort_func);
|
||||
SET(item_changed);
|
||||
SET(file_path_get);
|
||||
SET(file_url_get);
|
||||
|
|
|
@ -45,6 +45,14 @@ struct _Evry_Window
|
|||
Eina_Bool grab;
|
||||
|
||||
Evry_State *state_clearing;
|
||||
|
||||
struct
|
||||
{
|
||||
void (*hide) (Evry_Window *win, int finished);
|
||||
} func;
|
||||
|
||||
/* only to be used by creator of win */
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct _Evry_Selector
|
||||
|
@ -226,9 +234,9 @@ void evry_util_file_detail_set(Evry_Item_File *file);
|
|||
int evry_util_module_config_check(const char *module_name, int conf, int epoch, int version);
|
||||
Evas_Object *evry_util_icon_get(Evry_Item *it, Evas *e);
|
||||
int evry_util_plugin_items_add(Evry_Plugin *p, Eina_List *items, const char *input, int match_detail, int set_usage);
|
||||
int evry_items_sort_func(const void *data1, const void *data2);
|
||||
void evry_item_changed(Evry_Item *it, int change_icon, int change_selected);
|
||||
char *evry_util_md5_sum(const char *str);
|
||||
void evry_util_items_sort(Eina_List **items, int flags);
|
||||
|
||||
const char *evry_file_path_get(Evry_Item_File *file);
|
||||
const char *evry_file_url_get(Evry_Item_File *file);
|
||||
|
|
|
@ -32,6 +32,7 @@ static Eina_Bool _evry_cb_update_timer(void *data);
|
|||
static Evry_State *_evry_state_new(Evry_Selector *sel, Eina_List *plugins);
|
||||
static void _evry_state_pop(Evry_Selector *sel, int immediate);
|
||||
static void _evry_state_clear(Evry_Window *win);
|
||||
static void _evry_hide_func(Evry_Window *win, int finished);
|
||||
|
||||
static Evry_Selector *_evry_selector_new(Evry_Window *win, int type);
|
||||
static void _evry_selector_free(Evry_Selector *sel);
|
||||
|
@ -264,9 +265,18 @@ evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params, Eina_Bool popup)
|
|||
_evry_selector_activate(SUBJ_SEL, 0);
|
||||
}
|
||||
|
||||
win->func.hide = &_evry_hide_func;
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
static void
|
||||
_evry_hide_func(Evry_Window *win, int finished)
|
||||
{
|
||||
if ((finished) && (win->grab))
|
||||
evry_hide(win, 0);
|
||||
}
|
||||
|
||||
void
|
||||
evry_hide(Evry_Window *win, int clear)
|
||||
{
|
||||
|
@ -278,10 +288,12 @@ evry_hide(Evry_Window *win, int clear)
|
|||
_evry_state_clear(win);
|
||||
|
||||
if ((clear && CUR_SEL) &&
|
||||
/* pop states */
|
||||
((eina_list_count((SUBJ_SEL)->states) > 1) ||
|
||||
/* move to subject selector */
|
||||
(CUR_SEL != SUBJ_SEL) ||
|
||||
(((CUR_SEL)->state) &&
|
||||
((CUR_SEL)->state->input[0]))))
|
||||
/* clear input */
|
||||
(((CUR_SEL)->state) && ((CUR_SEL)->state->input[0]))))
|
||||
{
|
||||
int slide = 0;
|
||||
Evry_Selector *sel;
|
||||
|
@ -312,16 +324,16 @@ evry_hide(Evry_Window *win, int clear)
|
|||
_evry_aggregator_fetch(s);
|
||||
_evry_selector_update(sel);
|
||||
_evry_update_text_label(s);
|
||||
_evry_view_show(win, s->view, slide);
|
||||
s->view->update(s->view);
|
||||
|
||||
if (s->view)
|
||||
{
|
||||
_evry_view_show(win, s->view, slide);
|
||||
s->view->update(s->view);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (_evry_selectors_shift(win, -1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
win->visible = EINA_FALSE;
|
||||
|
||||
|
@ -1101,7 +1113,6 @@ _evry_selector_new(Evry_Window *win, int type)
|
|||
|
||||
EINA_LIST_FOREACH(pcs, l, pc)
|
||||
{
|
||||
if (!pc->enabled && !win->plugin_dedicated) continue;
|
||||
if (!pc->plugin) continue;
|
||||
if (pc->plugin == sel->aggregator) continue;
|
||||
sel->plugins = eina_list_append(sel->plugins, pc->plugin);
|
||||
|
@ -1424,6 +1435,9 @@ _evry_selector_plugins_get(Evry_Selector *sel, Evry_Item *it, const char *plugin
|
|||
|
||||
EINA_LIST_FOREACH(sel->plugins, l, p)
|
||||
{
|
||||
if (!p->config->enabled && !win->plugin_dedicated)
|
||||
continue;
|
||||
|
||||
if (plugin_name && strcmp(plugin_name, p->name))
|
||||
continue;
|
||||
|
||||
|
@ -1712,33 +1726,29 @@ int
|
|||
evry_browse_back(Evry_Selector *sel)
|
||||
{
|
||||
Evry_Window *win;
|
||||
Evry_State *s;
|
||||
|
||||
if (!sel) return 0;
|
||||
|
||||
|
||||
if ((!sel) || !(win = sel->win))
|
||||
return 0;
|
||||
|
||||
if (!(s = sel->state) || (!sel->states->next))
|
||||
if ((!sel->state) || (!sel->states->next))
|
||||
return 0;
|
||||
|
||||
/* next = eina_list_data_get(sel->states->next);
|
||||
* edje_object_part_unswallow(win->o_main, next->view->o_list); */
|
||||
|
||||
_evry_state_pop(sel, 0);
|
||||
|
||||
s = sel->state;
|
||||
|
||||
/* _evry_aggregator_fetch(s); */
|
||||
|
||||
_evry_selector_update(sel);
|
||||
_evry_update_text_label(sel->state);
|
||||
|
||||
if (sel == SUBJ_SEL)
|
||||
_evry_selector_update_actions(ACTN_SEL);
|
||||
_evry_update_text_label(s);
|
||||
_evry_view_show(win, s->view, SLIDE_RIGHT);
|
||||
s->view->update(s->view);
|
||||
|
||||
if (sel->state->view)
|
||||
{
|
||||
_evry_view_show(win, sel->state->view, SLIDE_RIGHT);
|
||||
sel->state->view->update(sel->state->view);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -2469,9 +2479,9 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
|
|||
{
|
||||
_evry_clear(CUR_SEL);
|
||||
}
|
||||
else if ((finished) && win->grab)
|
||||
{
|
||||
evry_hide(win, 0);
|
||||
else
|
||||
{
|
||||
win->func.hide(win, finished);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "evry_types.h"
|
||||
|
||||
#define EVRY_API_VERSION 28
|
||||
#define EVRY_API_VERSION 29
|
||||
|
||||
#define EVRY_ACTION_OTHER 0
|
||||
#define EVRY_ACTION_FINISHED 1
|
||||
|
@ -111,7 +111,6 @@ struct _Evry_API
|
|||
int (*util_plugin_items_add)(Evry_Plugin *p, Eina_List *items, const char *input, int match_detail, int set_usage);
|
||||
char *(*util_md5_sum)(const char *str);
|
||||
Evas_Object *(*util_icon_get)(Evry_Item *it, Evas *e);
|
||||
int (*items_sort_func)(const void *data1, const void *data2);
|
||||
|
||||
const char *(*file_path_get)(Evry_Item_File *file);
|
||||
const char *(*file_url_get)(Evry_Item_File *file);
|
||||
|
|
|
@ -512,6 +512,9 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdat
|
|||
|
||||
of = e_widget_framelist_add(e, _("Sorting"), 0);
|
||||
rg = e_widget_radio_group_new(&cfdata->history_sort_mode);
|
||||
ob = e_widget_radio_add(e, _("No Sorting"), 3, rg);
|
||||
e_widget_radio_toggle_set(ob, (cfdata->history_sort_mode == 3));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_radio_add(e, _("By usage"), 0, rg);
|
||||
e_widget_radio_toggle_set(ob, (cfdata->history_sort_mode == 0));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
|
|
@ -5,6 +5,8 @@ typedef struct _Instance Instance;
|
|||
|
||||
struct _Instance
|
||||
{
|
||||
EINA_INLIST;
|
||||
|
||||
E_Gadcon_Client *gcc;
|
||||
Evas_Object *o_button;
|
||||
|
||||
|
@ -15,7 +17,14 @@ struct _Instance
|
|||
E_Menu *menu;
|
||||
|
||||
int mouse_down;
|
||||
|
||||
|
||||
Ecore_Animator *hide_animator;
|
||||
double hide_start;
|
||||
int hide_x, hide_y;
|
||||
|
||||
Eina_List *handlers;
|
||||
|
||||
Eina_Bool hidden;
|
||||
};
|
||||
|
||||
static void _button_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
@ -31,16 +40,17 @@ static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
|
|||
static Gadget_Config *_conf_item_get(const char *id);
|
||||
|
||||
static void _conf_dialog(Instance *inst);
|
||||
static Eina_Inlist *instances = NULL;
|
||||
|
||||
static const E_Gadcon_Client_Class _gadcon_class =
|
||||
{
|
||||
GADCON_CLIENT_CLASS_VERSION,
|
||||
"evry-starter",
|
||||
{
|
||||
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL,
|
||||
e_gadcon_site_is_not_toolbar
|
||||
},
|
||||
E_GADCON_CLIENT_STYLE_PLAIN
|
||||
GADCON_CLIENT_CLASS_VERSION,
|
||||
"evry-starter",
|
||||
{
|
||||
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL,
|
||||
e_gadcon_site_is_not_toolbar
|
||||
},
|
||||
E_GADCON_CLIENT_STYLE_PLAIN
|
||||
};
|
||||
|
||||
static int uuid = 0;
|
||||
|
@ -74,6 +84,9 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
|||
|
||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_button_cb_mouse_down, inst);
|
||||
|
||||
instances = eina_inlist_append(instances, EINA_INLIST_GET(inst));
|
||||
|
||||
return gcc;
|
||||
}
|
||||
|
||||
|
@ -83,6 +96,9 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
Instance *inst;
|
||||
|
||||
inst = gcc->data;
|
||||
|
||||
instances = eina_inlist_remove(instances, EINA_INLIST_GET(inst));
|
||||
|
||||
if (inst->del_fn && inst->win)
|
||||
e_object_delfn_del(E_OBJECT(inst->win->ewin), inst->del_fn);
|
||||
|
||||
|
@ -174,6 +190,8 @@ static void _del_func(void *data, void *obj __UNUSED__)
|
|||
|
||||
e_gadcon_locked_set(inst->gcc->gadcon, 0);
|
||||
e_object_delfn_del(E_OBJECT(inst->win->ewin), inst->del_fn);
|
||||
|
||||
if (inst->hide_animator) ecore_animator_del(inst->hide_animator);
|
||||
inst->del_fn = NULL;
|
||||
inst->win = NULL;
|
||||
edje_object_signal_emit(inst->o_button, "e,state,unfocused", "e");
|
||||
|
@ -205,6 +223,213 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
|
|||
inst->mouse_down = 1;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_hide_animator(void *data)
|
||||
{
|
||||
Instance *inst = data;
|
||||
E_Win *ewin = inst->win->ewin;
|
||||
double val;
|
||||
int finished = 0;
|
||||
|
||||
if (!inst->hide_start)
|
||||
inst->hide_start = ecore_loop_time_get();
|
||||
|
||||
val = (ecore_loop_time_get() - inst->hide_start) / 0.4;
|
||||
if (val > 0.99) finished = 1;
|
||||
|
||||
val = ecore_animator_pos_map(val, ECORE_POS_MAP_DECELERATE, 0.0, 0.0);
|
||||
|
||||
e_border_fx_offset(ewin->border, (val * inst->hide_x), (val * inst->hide_y));
|
||||
|
||||
if (finished)
|
||||
{
|
||||
inst->hide_animator = NULL;
|
||||
e_border_iconify(ewin->border);
|
||||
e_border_fx_offset(ewin->border, 0, 0);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_evry_hide_func(Evry_Window *win, int finished)
|
||||
{
|
||||
Instance *inst = win->data;
|
||||
|
||||
inst->hide_start = 0;
|
||||
inst->hide_animator = ecore_animator_add(_hide_animator, inst);
|
||||
|
||||
inst->hidden = EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_focus_out(void *data, int type __UNUSED__, void *event)
|
||||
{
|
||||
E_Event_Border_Focus_Out *ev;
|
||||
Instance *inst;
|
||||
|
||||
ev = event;
|
||||
|
||||
EINA_INLIST_FOREACH(instances, inst)
|
||||
if (inst == data) break;
|
||||
|
||||
if ((!inst) || (!inst->win))
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
if (inst->hide_animator)
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
if (inst->win->ewin->border != ev->border)
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
_evry_hide_func(inst->win, 0);
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
static void
|
||||
_gadget_popup_show(Instance *inst)
|
||||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
int cx, cy, pw, ph;
|
||||
E_Win *ewin = inst->win->ewin;
|
||||
|
||||
pw = ewin->w;
|
||||
ph = ewin->h;
|
||||
|
||||
evas_object_geometry_get(inst->o_button, &x, &y, &w, &h);
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, NULL, NULL);
|
||||
x += cx;
|
||||
y += cy;
|
||||
|
||||
switch (inst->gcc->gadcon->orient)
|
||||
{
|
||||
case E_GADCON_ORIENT_TOP:
|
||||
case E_GADCON_ORIENT_CORNER_TL:
|
||||
case E_GADCON_ORIENT_CORNER_TR:
|
||||
e_win_move(ewin, x, y + h);
|
||||
inst->hide_y = -ph;
|
||||
break;
|
||||
case E_GADCON_ORIENT_BOTTOM:
|
||||
case E_GADCON_ORIENT_CORNER_BR:
|
||||
case E_GADCON_ORIENT_CORNER_BL:
|
||||
e_win_move(ewin, x, y - ph);
|
||||
inst->hide_y = ph;
|
||||
break;
|
||||
case E_GADCON_ORIENT_LEFT:
|
||||
case E_GADCON_ORIENT_CORNER_LT:
|
||||
case E_GADCON_ORIENT_CORNER_LB:
|
||||
e_win_move(ewin, x + w, y);
|
||||
inst->hide_x = -pw;
|
||||
break;
|
||||
case E_GADCON_ORIENT_RIGHT:
|
||||
case E_GADCON_ORIENT_CORNER_RT:
|
||||
case E_GADCON_ORIENT_CORNER_RB:
|
||||
e_win_move(ewin, x - pw, y);
|
||||
inst->hide_x = pw;
|
||||
break;
|
||||
case E_GADCON_ORIENT_FLOAT:
|
||||
case E_GADCON_ORIENT_HORIZ:
|
||||
case E_GADCON_ORIENT_VERT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (ewin->x + pw > inst->win->zone->w)
|
||||
e_win_move(ewin, inst->win->zone->w - pw, ewin->y);
|
||||
|
||||
if (ewin->y + ph > inst->win->zone->h)
|
||||
e_win_move(ewin, ewin->x, inst->win->zone->h - ph);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
_gadget_window_show(Instance *inst)
|
||||
{
|
||||
int zx, zy, zw, zh;
|
||||
int gx, gy, gw, gh;
|
||||
int cx, cy;
|
||||
int pw, ph;
|
||||
|
||||
E_Win *ewin = inst->win->ewin;
|
||||
|
||||
e_zone_useful_geometry_get(inst->win->zone, &zx, &zy, &zw, &zh);
|
||||
|
||||
evas_object_geometry_get(inst->o_button, &gx, &gy, &gw, &gh);
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, NULL, NULL);
|
||||
gx += cx;
|
||||
gy += cy;
|
||||
|
||||
switch (inst->gcc->gadcon->orient)
|
||||
{
|
||||
case E_GADCON_ORIENT_TOP:
|
||||
case E_GADCON_ORIENT_CORNER_TL:
|
||||
case E_GADCON_ORIENT_CORNER_TR:
|
||||
pw = zw/2;
|
||||
ph = zh/2;
|
||||
inst->hide_y = -ph;
|
||||
e_win_move(ewin, zx, gy + gh);
|
||||
break;
|
||||
case E_GADCON_ORIENT_BOTTOM:
|
||||
case E_GADCON_ORIENT_CORNER_BR:
|
||||
case E_GADCON_ORIENT_CORNER_BL:
|
||||
pw = zw/2;
|
||||
ph = zh/2;
|
||||
inst->hide_y = ph;
|
||||
e_win_move(ewin, zx, gy - ph);
|
||||
break;
|
||||
case E_GADCON_ORIENT_LEFT:
|
||||
case E_GADCON_ORIENT_CORNER_LT:
|
||||
case E_GADCON_ORIENT_CORNER_LB:
|
||||
pw = zw/2.5;
|
||||
ph = zh;
|
||||
inst->hide_x = -pw;
|
||||
e_win_move(ewin, gx + gw, zy);
|
||||
break;
|
||||
case E_GADCON_ORIENT_RIGHT:
|
||||
case E_GADCON_ORIENT_CORNER_RT:
|
||||
case E_GADCON_ORIENT_CORNER_RB:
|
||||
pw = zw/2.5;
|
||||
ph = zh;
|
||||
inst->hide_x = pw;
|
||||
e_win_move(ewin, gx - pw, zy);
|
||||
break;
|
||||
case E_GADCON_ORIENT_FLOAT:
|
||||
case E_GADCON_ORIENT_HORIZ:
|
||||
case E_GADCON_ORIENT_VERT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
e_win_resize(ewin, pw, ph);
|
||||
e_win_show(ewin);
|
||||
|
||||
e_border_focus_set(ewin->border, 1, 1);
|
||||
ewin->border->client.netwm.state.skip_pager = 1;
|
||||
ewin->border->sticky = 1;
|
||||
|
||||
inst->hidden = EINA_FALSE;
|
||||
inst->handlers = eina_list_append(inst->handlers,
|
||||
ecore_event_handler_add(E_EVENT_BORDER_FOCUS_OUT,
|
||||
_cb_focus_out, inst));
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_illume_running()
|
||||
{
|
||||
/* hack to find out out if illume is running, dont grab if
|
||||
this is the case... */
|
||||
|
||||
Eina_List *l;
|
||||
E_Module *m;
|
||||
|
||||
EINA_LIST_FOREACH(e_module_list(), l, m)
|
||||
if (!strcmp(m->name, "illume2") && m->enabled)
|
||||
return EINA_TRUE;
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_button_cb_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
{
|
||||
|
@ -214,113 +439,64 @@ _button_cb_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
|
|||
inst = data;
|
||||
if (!inst->mouse_down)
|
||||
return;
|
||||
|
||||
|
||||
inst->mouse_down = 0;
|
||||
|
||||
|
||||
ev = event_info;
|
||||
if (ev->button == 1)
|
||||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
int cx, cy, pw, ph;
|
||||
Evry_Window *win;
|
||||
E_Border *bd;
|
||||
|
||||
Eina_Bool show_windowed;
|
||||
|
||||
if (inst->win)
|
||||
{
|
||||
win = inst->win;
|
||||
bd = win->ewin->border;
|
||||
|
||||
if (!bd->focused)
|
||||
if (inst->hide_animator)
|
||||
{
|
||||
e_border_show(bd);
|
||||
ecore_animator_del(inst->hide_animator);
|
||||
inst->hide_animator = NULL;
|
||||
}
|
||||
|
||||
if (inst->hidden || !bd->focused)
|
||||
{
|
||||
e_border_fx_offset(bd, 0, 0);
|
||||
e_border_uniconify(bd);
|
||||
e_border_raise(bd);
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
inst->hidden = EINA_FALSE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
evry_hide(win, 1);
|
||||
Ecore_Event_Handler *h;
|
||||
|
||||
EINA_LIST_FREE(inst->handlers, h)
|
||||
ecore_event_handler_del(h);
|
||||
|
||||
evry_hide(win, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* hack to find out out if illume is running, dont grab if
|
||||
this is the case... */
|
||||
int show_windowed = 0;
|
||||
Eina_List *l;
|
||||
E_Module *m;
|
||||
|
||||
EINA_LIST_FOREACH(e_module_list(), l, m)
|
||||
if (!strcmp(m->name, "illume2") && m->enabled)
|
||||
break;
|
||||
|
||||
if (m) show_windowed = 1;
|
||||
show_windowed = _illume_running();
|
||||
|
||||
win = evry_show(e_util_zone_current_get(e_manager_current_get()),
|
||||
0, inst->cfg->plugin, !show_windowed);
|
||||
if (!win) return;
|
||||
|
||||
ecore_x_netwm_window_type_set(win->ewin->evas_win,
|
||||
ECORE_X_WINDOW_TYPE_UTILITY);
|
||||
inst->win = win;
|
||||
win->data = inst;
|
||||
win->func.hide = &_evry_hide_func;
|
||||
|
||||
ecore_evas_name_class_set(win->ewin->ecore_evas, "E", "everything-window");
|
||||
|
||||
evas_object_geometry_get(inst->o_button, &x, &y, &w, &h);
|
||||
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon,
|
||||
&cx, &cy, NULL, NULL);
|
||||
x += cx;
|
||||
y += cy;
|
||||
|
||||
pw = win->ewin->w;
|
||||
ph = win->ewin->h;
|
||||
|
||||
switch (inst->gcc->gadcon->orient)
|
||||
{
|
||||
|
||||
case E_GADCON_ORIENT_TOP:
|
||||
case E_GADCON_ORIENT_CORNER_TL:
|
||||
case E_GADCON_ORIENT_CORNER_TR:
|
||||
e_win_move(win->ewin, x, y + h);
|
||||
break;
|
||||
case E_GADCON_ORIENT_BOTTOM:
|
||||
case E_GADCON_ORIENT_CORNER_BR:
|
||||
case E_GADCON_ORIENT_CORNER_BL:
|
||||
e_win_move(win->ewin, x, y - ph);
|
||||
break;
|
||||
case E_GADCON_ORIENT_LEFT:
|
||||
case E_GADCON_ORIENT_CORNER_LT:
|
||||
case E_GADCON_ORIENT_CORNER_LB:
|
||||
e_win_move(win->ewin, x + w, y);
|
||||
break;
|
||||
case E_GADCON_ORIENT_RIGHT:
|
||||
case E_GADCON_ORIENT_CORNER_RT:
|
||||
case E_GADCON_ORIENT_CORNER_RB:
|
||||
e_win_move(win->ewin, x - pw, y);
|
||||
break;
|
||||
case E_GADCON_ORIENT_FLOAT:
|
||||
case E_GADCON_ORIENT_HORIZ:
|
||||
case E_GADCON_ORIENT_VERT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (win->ewin->x + pw > win->zone->w)
|
||||
e_win_move(win->ewin, win->zone->w - pw, win->ewin->y);
|
||||
|
||||
if (win->ewin->y + ph > win->zone->h)
|
||||
e_win_move(win->ewin, win->ewin->x, win->zone->h - ph);
|
||||
|
||||
if (show_windowed)
|
||||
{
|
||||
e_win_show(win->ewin);
|
||||
bd = win->ewin->border;
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
/* bd->client.netwm.state.skip_taskbar = 1; */
|
||||
bd->client.netwm.state.skip_pager = 1;
|
||||
bd->sticky = 1;
|
||||
}
|
||||
|
||||
inst->win = win;
|
||||
_gadget_window_show(inst);
|
||||
else
|
||||
_gadget_popup_show(inst);
|
||||
|
||||
e_gadcon_locked_set(inst->gcc->gadcon, 1);
|
||||
|
||||
|
@ -420,9 +596,9 @@ _create_data(E_Config_Dialog *cfd)
|
|||
|
||||
#define CP(_name) cfdata->_name = (gc->_name ? strdup(gc->_name) : NULL);
|
||||
#define C(_name) cfdata->_name = gc->_name;
|
||||
CP(plugin);
|
||||
C(hide_after_action);
|
||||
C(popup);
|
||||
CP(plugin);
|
||||
C(hide_after_action);
|
||||
C(popup);
|
||||
#undef CP
|
||||
#undef C
|
||||
|
||||
|
@ -473,7 +649,7 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
|
||||
#define CP(_name) \
|
||||
if (gc->_name) \
|
||||
eina_stringshare_del(gc->_name); \
|
||||
eina_stringshare_del(gc->_name); \
|
||||
gc->_name = eina_stringshare_add(cfdata->_name);
|
||||
#define C(_name) gc->_name = cfdata->_name;
|
||||
eina_stringshare_del(gc->plugin); \
|
||||
|
|
|
@ -362,7 +362,14 @@ evry_history_item_usage_set(Evry_Item *it, const char *input, const char *ctxt)
|
|||
History_Item *hi = NULL;
|
||||
Eina_List *l;
|
||||
int rem_ctxt = 1;
|
||||
it->usage = 0.0;
|
||||
|
||||
if (evry_conf->history_sort_mode == 3)
|
||||
{
|
||||
it->usage = -1;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
it->usage = 0.0;
|
||||
|
||||
if ((!it->plugin->history) && (!CHECK_TYPE(it, EVRY_TYPE_PLUGIN)))
|
||||
return 0;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
//TODO min input for items not in history
|
||||
|
||||
#define MAX_ITEMS 50
|
||||
#define MAX_PLUGIN 15
|
||||
|
||||
typedef struct _Plugin Plugin;
|
||||
|
||||
|
@ -36,8 +37,8 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
if ((eina_list_count(sel->states) == 1))
|
||||
top_level = 1;
|
||||
|
||||
/* get current items' context,
|
||||
* which is the previous selectors selected item */
|
||||
/* get current items' context, which is
|
||||
* the previous selectors selected item */
|
||||
if (sel == sels[0])
|
||||
{
|
||||
subj_sel = 1;
|
||||
|
@ -134,7 +135,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
evry_history_item_usage_set(it, input, context);
|
||||
if (it->fuzzy_match == 0)
|
||||
it->fuzzy_match = evry_fuzzy_match(it->label, input);
|
||||
|
||||
|
||||
items = eina_list_append(items, it);
|
||||
}
|
||||
}
|
||||
|
@ -178,24 +179,8 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
if (!lp && !items)
|
||||
return 0;
|
||||
|
||||
/* if there is only one plugin append all items */
|
||||
if (lp && !lp->next)
|
||||
{
|
||||
pp = eina_list_data_get(lp);
|
||||
|
||||
EINA_LIST_FOREACH(pp->items, l, it)
|
||||
{
|
||||
if (it->usage >= 0)
|
||||
evry_history_item_usage_set(it, input, context);
|
||||
|
||||
if (it->fuzzy_match == 0)
|
||||
it->fuzzy_match = evry_fuzzy_match(it->label, input);
|
||||
|
||||
items = eina_list_append(items, it);
|
||||
}
|
||||
}
|
||||
/* if there is input append all items that match */
|
||||
else if (input)
|
||||
if (input)
|
||||
{
|
||||
EINA_LIST_FOREACH(lp, l, pp)
|
||||
{
|
||||
|
@ -218,15 +203,17 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
/* no input: append all items that are in history */
|
||||
else
|
||||
{
|
||||
EINA_LIST_FOREACH(lp, l, pp)
|
||||
EINA_LIST_FOREACH(lp, l, pp)
|
||||
{
|
||||
EINA_LIST_FOREACH(pp->items, ll, it)
|
||||
int cnt = 1;
|
||||
EINA_LIST_FOREACH(pp->items, ll, it)
|
||||
{
|
||||
if ((!subj_sel) || (it->usage < 0) ||
|
||||
(evry_history_item_usage_set(it, input, context)))
|
||||
{
|
||||
it->fuzzy_match = 0;
|
||||
items = eina_list_append(items, it);
|
||||
if (++cnt > MAX_PLUGIN) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -246,8 +233,8 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
}
|
||||
}
|
||||
|
||||
items = eina_list_sort(items, -1, evry_items_sort_func);
|
||||
|
||||
evry_util_items_sort(&items, 0 /* !input */);
|
||||
|
||||
EINA_LIST_FOREACH(items, l, it)
|
||||
{
|
||||
/* remove duplicates provided by different plugins. e.g.
|
||||
|
|
|
@ -804,6 +804,14 @@ _recentf_files_filter(Plugin *p)
|
|||
if (p->dirs_only && !it->browseable)
|
||||
continue;
|
||||
|
||||
if (!p->input)
|
||||
{
|
||||
if (!it->browseable)
|
||||
it->priority = 1;
|
||||
new = eina_list_append(new, it);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (it->fuzzy_match <= 0)
|
||||
{
|
||||
if ((match = evry->fuzzy_match(it->label, p->input)) ||
|
||||
|
@ -815,7 +823,7 @@ _recentf_files_filter(Plugin *p)
|
|||
DBG("check match %d %s", it->fuzzy_match, it->label);
|
||||
}
|
||||
|
||||
if (_conf->show_recent || it->fuzzy_match)
|
||||
if (it->fuzzy_match)
|
||||
{
|
||||
if (!it->browseable)
|
||||
it->priority = 1;
|
||||
|
|
|
@ -251,58 +251,70 @@ evry_fuzzy_match_sort(Eina_List *items)
|
|||
return eina_list_sort(items, -1, _evry_fuzzy_match_sort_cb);
|
||||
}
|
||||
|
||||
int
|
||||
evry_items_sort_func(const void *data1, const void *data2)
|
||||
|
||||
static int _sort_flags = 0;
|
||||
|
||||
static int
|
||||
_evry_items_sort_func(const void *data1, const void *data2)
|
||||
{
|
||||
const Evry_Item *it1 = data1;
|
||||
const Evry_Item *it2 = data2;
|
||||
|
||||
if ((it1->type == EVRY_TYPE_ACTION ||
|
||||
it1->subtype == EVRY_TYPE_ACTION) &&
|
||||
(it2->type == EVRY_TYPE_ACTION ||
|
||||
it2->subtype == EVRY_TYPE_ACTION))
|
||||
if (!((!_sort_flags) &&
|
||||
(it1->type == EVRY_TYPE_ACTION) &&
|
||||
(it2->type == EVRY_TYPE_ACTION)))
|
||||
{
|
||||
const Evry_Action *act1 = data1;
|
||||
const Evry_Action *act2 = data2;
|
||||
/* only sort actions when there is input otherwise show default order */
|
||||
|
||||
/* sort actions that match the specific type before
|
||||
those matching general type */
|
||||
if (act1->it1.item && act2->it1.item)
|
||||
if (((it1->type == EVRY_TYPE_ACTION) || (it1->subtype == EVRY_TYPE_ACTION)) &&
|
||||
((it2->type == EVRY_TYPE_ACTION) || (it2->subtype == EVRY_TYPE_ACTION)))
|
||||
{
|
||||
if ((act1->it1.type == act1->it1.item->type) &&
|
||||
(act2->it1.type != act2->it1.item->type))
|
||||
return -1;
|
||||
const Evry_Action *act1 = data1;
|
||||
const Evry_Action *act2 = data2;
|
||||
|
||||
if ((act1->it1.type != act1->it1.item->type) &&
|
||||
(act2->it1.type == act2->it1.item->type))
|
||||
return 1;
|
||||
}
|
||||
/* sort actions that match the specific type before
|
||||
those matching general type */
|
||||
if (act1->it1.item && act2->it1.item)
|
||||
{
|
||||
if ((act1->it1.type == act1->it1.item->type) &&
|
||||
(act2->it1.type != act2->it1.item->type))
|
||||
return -1;
|
||||
|
||||
/* sort context specific actions before
|
||||
general actions */
|
||||
if (act1->remember_context)
|
||||
{
|
||||
if (!act2->remember_context)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (act2->remember_context)
|
||||
return 1;
|
||||
if ((act1->it1.type != act1->it1.item->type) &&
|
||||
(act2->it1.type == act2->it1.item->type))
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* sort context specific actions before
|
||||
general actions */
|
||||
if (act1->remember_context)
|
||||
{
|
||||
if (!act2->remember_context)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (act2->remember_context)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_sort_flags)
|
||||
{
|
||||
/* when there is no input sort items with higher
|
||||
* plugin priority first */
|
||||
if (it1->type != EVRY_TYPE_ACTION &&
|
||||
it2->type != EVRY_TYPE_ACTION)
|
||||
{
|
||||
int prio1 = it1->plugin->config->priority;
|
||||
int prio2 = it2->plugin->config->priority;
|
||||
|
||||
/* if (it1->type == EVRY_TYPE_PLUGIN &&
|
||||
* it2->type != EVRY_TYPE_PLUGIN)
|
||||
* {
|
||||
* return (it1->usage > it2->usage ? -1 : 1);
|
||||
* }
|
||||
* else if (it2->type == EVRY_TYPE_PLUGIN &&
|
||||
* it1->type != EVRY_TYPE_PLUGIN)
|
||||
* {
|
||||
* return (it1->usage > it2->usage ? -1 : 1);
|
||||
* } */
|
||||
|
||||
if (prio1 - prio2)
|
||||
return (prio1 - prio2);
|
||||
}
|
||||
}
|
||||
|
||||
/* sort items which match input or which
|
||||
match much better first */
|
||||
if (it1->fuzzy_match > 0 || it2->fuzzy_match > 0)
|
||||
|
@ -349,6 +361,14 @@ evry_items_sort_func(const void *data1, const void *data2)
|
|||
return strcasecmp(it1->label, it2->label);
|
||||
}
|
||||
|
||||
void
|
||||
evry_util_items_sort(Eina_List **items, int flags)
|
||||
{
|
||||
_sort_flags = flags;
|
||||
*items = eina_list_sort(*items, -1, _evry_items_sort_func);
|
||||
_sort_flags = 0;
|
||||
}
|
||||
|
||||
int
|
||||
evry_util_plugin_items_add(Evry_Plugin *p, Eina_List *items, const char *input,
|
||||
int match_detail, int set_usage)
|
||||
|
@ -384,7 +404,7 @@ evry_util_plugin_items_add(Evry_Plugin *p, Eina_List *items, const char *input,
|
|||
p->items = eina_list_append(p->items, it);
|
||||
}
|
||||
|
||||
p->items = eina_list_sort(p->items, -1, evry_items_sort_func);
|
||||
p->items = eina_list_sort(p->items, -1, _evry_items_sort_func);
|
||||
|
||||
return !!(p->items);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ static void _animator_del(Evas_Object *obj);
|
|||
static Eina_Bool _animator(void *data);
|
||||
|
||||
static void
|
||||
_thumb_gen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_cb_thumb_gen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
Item *it = data;
|
||||
|
@ -105,6 +105,18 @@ _thumb_gen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
|||
it->image = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_preload(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
Item *it = data;
|
||||
|
||||
if (!it->frame) return;
|
||||
printf("preload callback!!!!\n");
|
||||
|
||||
edje_object_part_swallow(it->frame, "e.swallow.icon", it->image);
|
||||
/* evas_object_show(it->image); */
|
||||
}
|
||||
|
||||
static int
|
||||
_check_item(const Evry_Item *it)
|
||||
{
|
||||
|
@ -309,10 +321,15 @@ _item_show(View *v, Item *it, Evas_Object *list)
|
|||
else
|
||||
it->max_w = -1;
|
||||
|
||||
edje_object_part_swallow(it->frame, "e.swallow.icon", it->image);
|
||||
|
||||
if (!e_icon_preload_get(it->image))
|
||||
evas_object_show(it->image);
|
||||
if (0 && e_icon_preload_get(it->image) && !evas_object_visible_get(it->image))
|
||||
{
|
||||
evas_object_smart_callback_add(it->image, "preloaded", _cb_preload, it);
|
||||
}
|
||||
else
|
||||
{
|
||||
edje_object_part_swallow(it->frame, "e.swallow.icon", it->image);
|
||||
evas_object_show(it->image);
|
||||
}
|
||||
}
|
||||
else it->have_thumb = EINA_TRUE;
|
||||
}
|
||||
|
@ -328,7 +345,7 @@ _item_show(View *v, Item *it, Evas_Object *list)
|
|||
|
||||
GET_FILE(file, it->item);
|
||||
|
||||
evas_object_smart_callback_add(it->thumb, "e_thumb_gen", _thumb_gen, it);
|
||||
evas_object_smart_callback_add(it->thumb, "e_thumb_gen", _cb_thumb_gen, it);
|
||||
|
||||
e_thumb_icon_size_set(it->thumb, it->w, it->h);
|
||||
|
||||
|
|
Loading…
Reference in New Issue