#define PLUGIN(_p, _plugin) Plugin *_p = (Plugin*) _plugin
#define VIEW(_v, _view) View *_v = (View*) _view
-#define EVRY_PLUGIN_ITEMS_CLEAR(_p) \
+#define EVRY_PLUGIN_ITEMS_CLEAR(_p) \
if (EVRY_PLUGIN(_p)->items) \
eina_list_free(EVRY_PLUGIN(_p)->items); \
EVRY_PLUGIN(_p)->items = NULL;
/* optional: more information to be shown */
const char *detail;
-
+
/* optional: for 'static' fdo icon name, otherwise use _icon_get */
const char *icon;
-
+
/* item can be browsed, e.g. folders */
Eina_Bool browseable;
/* optional */
const char *subtype;
-
+
/* do not set by plugin! */
Evry_Item *next;
Eina_Bool selected;
/* provide default icon */
const char *icon;
- /* use plugin for first second or third part of an action
+ /* use plugin for first second or third part of an action
if actions are no dynamical lists better use Evry_Action */
enum { type_subject, type_action, type_object } type;
/* plugin provides items of this type */
const char *type_out;
-
+
/* plugin accepts this type in begin function */
const char *type_in;
/* get an icon for an item. will be freed automatically */
Evas_Object *(*icon_get) (Evry_Plugin *p, const Evry_Item *it, Evas *e);
-
+
/* only used when plugin is of type_action */
int (*action) (Evry_Plugin *p, const Evry_Item *item);
/* optional: use this when you extend the plugin struct */
void (*free) (Evry_Plugin *p);
-
+
/* show in aggregator */
/* default TRUE */
Eina_Bool aggregate;
-
+
/* whether the plugin uses evry_async_update to add new items. */
/* default FALSE */
Eina_Bool async_fetch;
/* if transient, item is removed from history on shutdown */
/* default FALSE */
Eina_Bool transient;
-
+
/* not to be set by plugin! */
Plugin_Config *config;
/* optional: use this when you keep stuff in 'data' */
void (*free) (Evry_Action *act);
-
+
/* use icon name from theme */
const char *icon;
int width, height;
Eina_List *modules;
-
+
/* generic plugin config */
Eina_List *conf_subjects;
Eina_List *conf_actions;
int view_zoom;
int history_sort_mode;
-
+
/* use up/down keys for prev/next in thumb view */
int cycle_mode;
unsigned char first_run;
-
+
/* not saved data */
Eina_List *actions;
Eina_List *views;
-
+
int min_w, min_h;
};
int trigger_only;
int view_mode;
-
+
Evry_Plugin *plugin;
};
EVRY_EVENT_ITEM_SELECT = ecore_event_type_new();
if (!EVRY_EVENT_ITEM_CHANGED)
EVRY_EVENT_ITEM_CHANGED = ecore_event_type_new();
-
+
e_module_delayed_set(m, 0);
/* make sure module is loaded before others */
e_module_priority_set(m, -1000);
e_datastore_set("everything_loaded", "");
-
+
return m;
}
E_Config_Dialog *cfd;
Evry_Plugin *p;
Evry_Action *a;
-
+
evry_shutdown();
/* remove module-supplied menu additions */
view_help_shutdown();
evry_plug_clipboard_shutdown();
evry_plug_text_shutdown();
-
+
/* EINA_LIST_FREE(evry_conf->plugins, p)
* evry_plugin_free(p, 1); */
EINA_LIST_FREE(evry_conf->actions, a)
- evry_action_free(a);
+ evry_action_free(a);
while ((cfd = e_config_dialog_get("E", "_config_everything_dialog")))
e_object_del(E_OBJECT(cfd));
E_CONFIG_DD_FREE(plugin_conf_edd);
E_CONFIG_DD_FREE(plugin_setting_edd);
e_datastore_del("everything_loaded");
-
+
return 1;
}
Plugin_Config *pc;
Eina_List *conf[3];
int i;
-
+
conf[0] = evry_conf->conf_subjects;
conf[1] = evry_conf->conf_actions;
conf[2] = evry_conf->conf_objects;
evry_conf->conf_subjects = NULL;
evry_conf->conf_actions = NULL;
evry_conf->conf_objects = NULL;
-
+
evry_conf->version = CONFIG_VERSION;
}
_config_free();
evry_conf = NULL;
}
-
+
if (!evry_conf)
{
evry_conf = E_NEW(Evry_Config, 1);
evry_show(zone, params);
else
evry_show(zone, NULL);
-
+
/* FIXME popup flickers sometimes when deferes*/
/* if (params && params[0])
* evry_show(zone, params);
{
const Plugin_Config *pc1 = data1;
const Plugin_Config *pc2 = data2;
-
+
return pc1->priority - pc2->priority;
}
p->history = EINA_TRUE;
p->view_mode = VIEW_MODE_NONE;
-
+
return p;
}
act->action = action;
act->check_item = check_item;
act->icon = (icon ? eina_stringshare_add(icon) : NULL);
-
+
return act;
}
Plugin_Config *pc;
Eina_List *conf[3];
int i = 0;
-
+
conf[0] = evry_conf->conf_subjects;
conf[1] = evry_conf->conf_actions;
conf[2] = evry_conf->conf_objects;
pc->view_mode = p->view_mode;
if (p->trigger)
{
- pc->trigger = eina_stringshare_add(p->trigger);
+ pc->trigger = eina_stringshare_add(p->trigger);
pc->trigger_only = 1;
}
conf[p->type] = eina_list_append(conf[p->type], pc);
}
-
+
p->config = pc;
pc->plugin = p;
-
+
conf[p->type] = eina_list_sort(conf[p->type], -1, _evry_cb_plugin_sort);
EINA_LIST_FOREACH(conf[p->type], l, pc)
pc->priority = i++;
-
+
evry_conf->conf_subjects = conf[0];
evry_conf->conf_actions = conf[1];
evry_conf->conf_objects = conf[2];
evry_plugin_unregister(Evry_Plugin *p)
{
DBG("%s", p->name);
-
+
/* evry_conf->plugins = eina_list_remove(evry_conf->plugins, p); */
if (p->type == type_subject)
{
evry_conf->views = eina_list_remove(evry_conf->views, view);
}
-
-
void (*update) (Tab_View *tv);
void (*clear) (Tab_View *tv);
int (*key_down) (Tab_View *tv, const Ecore_Event_Key *ev);
-
+
double align;
double align_to;
Ecore_Animator *animator;
if (evry_conf->first_run)
{
- _evry_view_toggle(s, "?");
+ _evry_view_toggle(s, "?");
evry_conf->first_run = EINA_FALSE;
}
else
{
s->view = view->create(view, s, list->o_main);
-
+
_evry_view_show(s->view);
}
}
{
return 0;
}
-
+
_evry_list_win_show();
return 0;
_evry_selector_subjects_get(params);
_evry_selector_update(selectors[0]);
_evry_selector_activate(selectors[0]);
-
+
if (!evry_conf->hide_input)
{
edje_object_part_text_set(win->o_main, "e.text.label", "Search:");
if (!eina_list_data_find(s->cur_plugins, p)) return;
s->cur_plugins = eina_list_remove(s->cur_plugins, p);
-
+
if (s->plugin == p)
_evry_plugin_select(s, NULL);
}
{
_evry_selector_update(sel);
}
-
+
_evry_view_update(s, NULL);
}
else if (action == EVRY_ASYNC_UPDATE_REFRESH)
Evas_Object *o;
const char *tmp;
int offset_s = 0;
-
+
popup = e_popup_new(zone, 0, 0, 1, 1);
if (!popup) return NULL;
if (evry_conf->width > mw)
mw = evry_conf->width;
evry_conf->width = mw;
-
+
mw += offset_s*2;
mh += offset_s*2;
x = (zone->w * evry_conf->rel_x) - (mw / 2);
evas_object_show(o);
sel->aggregator = evry_plug_aggregator_new(sel, type);
-
+
if (type == type_subject)
{
sel->history = evry_hist->subjects;
if (list->visible && (sel == selector))
_evry_view_clear(sel->state);
-
+
while (sel->states)
_evry_state_pop(sel);
EVRY_PLUGIN_FREE(sel->aggregator);
EVRY_PLUGIN_FREE(sel->actions);
-
+
if (sel->plugins) eina_list_free(sel->plugins);
if (sel->update_timer)
evas_object_del(sel->o_icon);
sel->o_icon = NULL;
}
-
+
e_icon_size_get(sel->o_thumb, &w, &h);
edje_extern_object_aspect_set(sel->o_thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
edje_object_part_swallow(sel->o_main, "e.swallow.thumb", sel->o_thumb);
EINA_LIST_FOREACH(sel->plugins, l, plugin)
{
- if ((plugin == sel->actions) ||
+ if ((plugin == sel->actions) ||
(plugin->type_in && type_out && plugin->type_in == type_out))
{
if (plugin->begin)
s->inp = malloc(INPUTLEN);
s->inp[0] = 0;
s->input = s->inp;
-
+
s->plugins = plugins;
sel->states = eina_list_prepend(sel->states, s);
evry_hide();
return 1;
}
-
+
if (!selector || !selector->state)
return 1;
s = selector->state;
evry_item_ref(it);
s->item_auto_selected = EINA_FALSE;
-
+
if (it->plugin->complete)
action = it->plugin->complete(it->plugin, it, &input);
else
}
E_FREE(input);
-
+
evry_item_free(it);
}
else if ((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
{
if (!s || !s->cur_item)
goto end;
-
+
int delete = (!strcmp(key, "Delete") && (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT));
int promote = (!strcmp(key, "Insert"));
History_Entry *he;
History_Item *hi;
Eina_List *l, *ll;
Evry_Item *it = s->cur_item;
-
+
if (!(he = eina_hash_find
(selector->history, (it->id ? it->id : it->label))))
goto end;
-
+
EINA_LIST_FOREACH_SAFE(he->items, l, ll, hi)
{
if (hi->plugin != it->plugin->name)
goto end;
else if ((ev->compose && !(ev->modifiers & ECORE_EVENT_MODIFIER_ALT)))
{
- int len = strlen(s->inp);
+ int len = strlen(s->inp);
if (len == 0 && (_evry_view_toggle(s, ev->compose)))
goto end;
if (len < (INPUTLEN - strlen(ev->compose)))
{
strcat(s->inp, ev->compose);
-
+
/* if (isspace(*ev->compose))
* {
* /\* do not update matches on space *\/
{
s->inp[0] = 0;
s->input = s->inp;
-
+
_evry_update(sel, 1);
if (!list->visible && evry_conf->hide_input)
edje_object_signal_emit(list->o_main, "e,state,entry_hide", "e");
if (!v) return;
v->clear(v, slide);
-
+
if (v->o_list)
{
edje_object_part_unswallow(list->o_main, v->o_list);
Evry_View *view, *v = NULL;
Eina_List *l, *ll;
Eina_Bool triggered = FALSE;
-
+
if (trigger)
{
EINA_LIST_FOREACH(evry_conf->views, ll, view)
Evry_Plugin *p;
Eina_List *l;
const char *input;
- s->changed = 1;
-
+ s->changed = 1;
+
if (s->inp[0])
input = s->inp;
else
input = NULL;
if (!input || !s->trigger_active)
- {
+ {
EINA_LIST_FREE(s->cur_plugins, p);
s->trigger_active = EINA_FALSE;
}
{
int len_trigger = 0;
int len_inp = strlen(s->inp);
-
+
EINA_LIST_FOREACH(s->plugins, l, p)
{
/* input matches plugin trigger? */
s->inp[0] = '>';
s->inp[1] = '\0';
}
- s->input = s->inp + 1;
- _evry_update_text_label(s);
+ s->input = s->inp + 1;
+ _evry_update_text_label(s);
}
}
-
+
if (!s->cur_plugins)
{
s->input = s->inp;
-
+
EINA_LIST_FOREACH(s->plugins, l, p)
{
if (!(win->plugin_dedicated) &&
}
if (sel->aggregator->fetch(sel->aggregator, input))
- _evry_plugin_list_insert(s, sel->aggregator);
+ _evry_plugin_list_insert(s, sel->aggregator);
if (s->plugin_auto_selected ||
(s->plugin && (!eina_list_data_find(s->cur_plugins, s->plugin))))
_evry_plugin_select(s, NULL);
else
- _evry_plugin_select(s, s->plugin);
-
+ _evry_plugin_select(s, s->plugin);
+
if (sel->update_timer)
ecore_timer_del(sel->update_timer);
sel->update_timer = NULL;
evry_plugin_select(const Evry_State *s, Evry_Plugin *p)
{
Evry_Selector *sel;
-
+
_evry_plugin_select((Evry_State *) s, p);
sel = _evry_selector_for_plugin_get(p);
-
- if (sel)
+
+ if (sel)
_evry_selector_update(sel);
}
if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) ||
(ev->selection == ECORE_X_SELECTION_PRIMARY))
{
- if (strcmp(ev->target, ECORE_X_SELECTION_TARGET_UTF8_STRING) == 0)
- {
- Ecore_X_Selection_Data_Text *text_data;
+ if (strcmp(ev->target, ECORE_X_SELECTION_TARGET_UTF8_STRING) == 0)
+ {
+ Ecore_X_Selection_Data_Text *text_data;
- text_data = ev->data;
+ text_data = ev->data;
strncat(s->input, text_data->text, (INPUTLEN - strlen(s->input)) - 1);
_evry_update(selector, 1);
- }
+ }
}
return 1;
}
-
Evas_Object *o_view_list;
Evas_Object *o_view_detail;
Evas_Object *o_view_thumb;
-
+
Eina_List *configs;
-
+
char *trigger;
int trigger_only;
int view_mode;
double rel_x, rel_y;
int scroll_animate;
double scroll_speed;
-
+
char *cmd_terminal;
char *cmd_sudo;
C(scroll_speed);
#undef C
- cfdata->page[0].configs = eina_list_clone(evry_conf->conf_subjects);
- cfdata->page[1].configs = eina_list_clone(evry_conf->conf_actions);
- cfdata->page[2].configs = eina_list_clone(evry_conf->conf_objects);
-
+ cfdata->page[0].configs = eina_list_clone(evry_conf->conf_subjects);
+ cfdata->page[1].configs = eina_list_clone(evry_conf->conf_actions);
+ cfdata->page[2].configs = eina_list_clone(evry_conf->conf_objects);
+
if (evry_conf->cmd_terminal)
- cfdata->cmd_terminal = strdup(evry_conf->cmd_terminal);
+ cfdata->cmd_terminal = strdup(evry_conf->cmd_terminal);
if (evry_conf->cmd_sudo)
- cfdata->cmd_sudo = strdup(evry_conf->cmd_sudo);
+ cfdata->cmd_sudo = strdup(evry_conf->cmd_sudo);
}
static void *
_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
int i;
-
+
#define C(_name) evry_conf->_name = cfdata->_name
C(height);
C(width);
if (evry_conf->conf_subjects) eina_list_free(evry_conf->conf_subjects);
if (evry_conf->conf_actions) eina_list_free(evry_conf->conf_actions);
if (evry_conf->conf_objects) eina_list_free(evry_conf->conf_objects);
-
+
evry_conf->conf_subjects = eina_list_clone(cfdata->page[0].configs);
evry_conf->conf_actions = eina_list_clone(cfdata->page[1].configs);
evry_conf->conf_objects = eina_list_clone(cfdata->page[2].configs);
cfdata->page[i].cur->trigger = eina_stringshare_add(cfdata->page[i].trigger);
else
cfdata->page[i].cur->trigger = NULL;
-
+
cfdata->page[i].cur->trigger_only = cfdata->page[i].trigger_only;
cfdata->page[i].cur->view_mode = cfdata->page[i].view_mode;
}
}
-
+
if (evry_conf->cmd_terminal)
eina_stringshare_del(evry_conf->cmd_terminal);
evry_conf->cmd_terminal = eina_stringshare_add(cfdata->cmd_terminal);
if (evry_conf->cmd_sudo)
eina_stringshare_del(evry_conf->cmd_sudo);
evry_conf->cmd_sudo = eina_stringshare_add(cfdata->cmd_sudo);
-
+
e_config_save_queue();
return 1;
}
edje_freeze();
e_widget_ilist_freeze(obj);
e_widget_ilist_clear(obj);
-
+
EINA_LIST_FOREACH(plugins, l, pc)
e_widget_ilist_append(obj, NULL, pc->name, NULL, pc, NULL);
-
+
e_widget_ilist_go(obj);
e_widget_size_min_get(obj, &w, NULL);
e_widget_size_min_set(obj, w > 180 ? w : 180, 200);
Eina_List *l1, *l2;
sel = e_widget_ilist_selected_get(list);
-
+
if ((sel >= 1 && dir > 0) || (sel >= 2 && dir < 0))
{
Plugin_Config *pc;
int sel = e_widget_ilist_selected_get(obj);
Plugin_Config *pc;
Plugin_Page *page = data;
-
+
if (sel >= 0)
{
pc = eina_list_nth(page->configs, sel);
e_widget_entry_text_set(page->o_trigger, pc->trigger);
- e_widget_disabled_set(page->o_trigger, 0);
+ e_widget_disabled_set(page->o_trigger, 0);
- e_widget_check_checked_set(page->o_trigger_only, pc->trigger_only);
- e_widget_disabled_set(page->o_trigger_only, 0);
+ e_widget_check_checked_set(page->o_trigger_only, pc->trigger_only);
+ e_widget_disabled_set(page->o_trigger_only, 0);
e_widget_disabled_set(page->o_view_default, 0);
e_widget_disabled_set(page->o_view_detail, 0);
e_widget_disabled_set(page->o_view_thumb, 0);
if (pc->view_mode == -1)
- e_widget_radio_toggle_set(page->o_view_default, 1);
+ e_widget_radio_toggle_set(page->o_view_default, 1);
else if (pc->view_mode == 0)
e_widget_radio_toggle_set(page->o_view_list, 1);
else if (pc->view_mode == 1)
e_widget_radio_toggle_set(page->o_view_detail, 1);
else if (pc->view_mode == 2)
e_widget_radio_toggle_set(page->o_view_thumb, 1);
-
+
page->cur = pc;
}
else
{
e_widget_entry_text_set(page->o_trigger, "");
- e_widget_disabled_set(page->o_trigger, 1);
+ e_widget_disabled_set(page->o_trigger, 1);
e_widget_disabled_set(page->o_trigger_only, 1);
e_widget_disabled_set(page->o_view_default, 1);
e_widget_disabled_set(page->o_view_detail, 1);
e_widget_disabled_set(page->o_view_list, 1);
e_widget_disabled_set(page->o_view_thumb, 1);
-
+
page->cur = NULL;
}
}
Evas_Object *ot, *o, *of, *ob;
E_Radio_Group *rg;
Evas_Object *list;
-
+
of = e_widget_framelist_add(e, _("Active Plugins"), 0);
page->list = e_widget_ilist_add(e, 24, 24, NULL);
e_widget_on_change_hook_set(page->list, _list_select_cb, page);
* cfdata->p_subject);
* e_widget_framelist_object_append(of, o); */
/* e_widget_table_object_append(ob, of, 1, 2, 1, 1, 1, 0, 1, 0); */
-
+
return ob;
}
{
Evas_Object *ot, *o, *of, *ob, *otb, *otb2;
E_Radio_Group *rg;
-
+
otb = e_widget_toolbook_add(e, 48 * e_scale, 48 * e_scale);
o = e_widget_table_add(e, 0);
ob = e_widget_label_add(e, _("Quick Navigation"));
e_widget_framelist_object_append(of, ob);
-
+
rg = e_widget_radio_group_new(&cfdata->quick_nav);
ob = e_widget_radio_add(e, _("Off"), 0, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(e, _("Vi style (ALT + h,j,k,l,n,p,m,i)"), 1, rg);
e_widget_framelist_object_append(of, ob);
- e_widget_table_object_append(o, of, 0, 0, 1, 1, 0, 0, 0, 0);
+ e_widget_table_object_append(o, of, 0, 0, 1, 1, 0, 0, 0, 0);
of = e_widget_framelist_add(e, _("Default View"), 0);
- rg = e_widget_radio_group_new(&cfdata->view_mode);
+ rg = e_widget_radio_group_new(&cfdata->view_mode);
ob = e_widget_radio_add(e, _("List"), 0, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(e, _("Detailed"), 1, rg);
/* ob = e_widget_slider_add(e, 1, 0, _("%1.1f"),
* 5, 20, 0.1, 0, &(cfdata->scroll_speed), NULL, 10);
* e_widget_framelist_object_append(of, ob); */
-
+
ob = e_widget_check_add(e, _("Up/Down select next item in icon view"),
&(cfdata->cycle_mode));
e_widget_framelist_object_append(of, ob);
- e_widget_table_object_append(o, of, 1, 0, 1, 1, 0, 1, 0, 0);
+ e_widget_table_object_append(o, of, 1, 0, 1, 1, 0, 1, 0, 0);
of = e_widget_framelist_add(e, _("Sorting"), 0);
- rg = e_widget_radio_group_new(&cfdata->history_sort_mode);
+ rg = e_widget_radio_group_new(&cfdata->history_sort_mode);
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);
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(o, of, 0, 1, 2, 1, 1, 0, 0, 0);
-
+
of = e_widget_framelist_add(e, _("Commands"), 0);
ob = e_widget_label_add(e, _("Terminal Command"));
e_widget_framelist_object_append(of, ob);
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(o, of, 0, 2, 2, 1, 1, 0, 0, 0);
-
+
e_widget_toolbook_page_append(otb, NULL, _("General Settings"),
o, 1, 0, 1, 0, 0.5, 0.0);
ob = _create_plugin_page(cfdata, e, &cfdata->page[2]);
e_widget_toolbook_page_append(otb2, NULL, _("Object Plugins"),
ob, 1, 0, 1, 0, 0.5, 0.0);
-
+
e_widget_toolbook_page_append(otb, NULL, _("Plugins"),
otb2, 1, 0, 1, 0, 0.5, 0.0);
evry_conf->min_w, 800, 5, 0, NULL,
&(cfdata->width), 200);
e_widget_framelist_object_append(of, ob);
-
+
ob = e_widget_label_add(e, _("Popup Height"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(e, 1, 0, _("%1.0f"),
0.0, 1.0, 0.01, 0,
&(cfdata->rel_y), NULL, 200);
e_widget_framelist_object_append(of, ob);
-
+
ob = e_widget_label_add(e, _("Horizontal"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(e, 1, 0, _("%1.2f"),
e_widget_toolbook_page_append(otb, NULL, _("Geometry"),
o, 1, 0, 1, 0, 0.5, 0.0);
-
+
e_widget_toolbook_page_show(otb, 0);
return otb;
hi->count--;
hi->last_used = d->time - SEVEN_DAYS/2;
}
-
+
/* item is transient or too old */
if (!hi->count || hi->transient)
{
evry_history_load(void)
{
evry_hist = e_config_domain_load("module.everything.history", hist_edd);
-
+
if (evry_hist && evry_hist->version != HISTORY_VERSION)
{
eina_hash_foreach(evry_hist->subjects, _hist_free_cb, NULL);
eina_hash_foreach(evry_hist->actions, _hist_free_cb, NULL);
eina_hash_free(evry_hist->subjects);
eina_hash_free(evry_hist->actions);
-
+
E_FREE(evry_hist);
evry_hist = NULL;
}
History_Item *hi = NULL;
Eina_List *l;
const char *id;
-
+
if (!it || !it->plugin->history) return NULL;
id = (it->id ? it->id : it->label);
if (!it->plugin->history)
return 0;
-
+
it->usage = 0.0;
if (!(he = eina_hash_find(hist, (it->id ? it->id : it->label))))
return 0;
-
+
EINA_LIST_FOREACH(he->items, l, hi)
{
if (hi->plugin != it->plugin->name)
* if (hi->last_used > it->usage)
* it->usage = hi->last_used;
* } */
-
+
if (evry_conf->history_sort_mode == 0)
{
-
+
if (!input || !hi->input)
{
it->usage += hi->usage * hi->count;
else if (evry_conf->history_sort_mode == 1)
{
it->usage = hi->count * (hi->last_used / 10000000000.0);
-
+
}
else if (evry_conf->history_sort_mode == 2)
{
it->usage = hi->last_used;
}
}
-
+
if (it->usage > 0.0)
return 1;
return 0;
}
-
{
Evry_Action *act;
Evry_Selector *sel;
-
+
if (p->type == type_subject)
sel = selectors[0];
else
{
Evry_Action *act;
Eina_List *l;
- const char *type;
+ const char *type;
Evry_Selector *sel;
-
+
if (p->type == type_subject)
sel = selectors[0];
else
type = it->plugin->type_out;
if (!type) return NULL;
}
-
+
EINA_LIST_FOREACH(evry_conf->actions, l, act)
{
if ((!act->type_in1) ||
}
if (!sel->cur_actions) return NULL;
-
+
return p;
}
}
if (!p->items) return 0;
-
+
if (input)
EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort);
return (it1->priority - it2->priority);
return strcmp(it1->label, it2->label);
-
+
return 1;
}
{
const Evry_Item *it1 = data1;
const Evry_Item *it2 = data2;
-
+
if (it1->usage && it2->usage)
return (it1->usage > it2->usage ? -1 : 1);
if (it1->usage && !it2->usage)
if ((it1->plugin == it2->plugin) &&
(it1->priority - it2->priority))
return (it1->priority - it2->priority);
-
+
if (it1->fuzzy_match > 0 || it2->fuzzy_match > 0)
{
if (it2->fuzzy_match <= 0)
plugin->changed = 1;
s = p->selector->state;
-
+
if (!s || !s->cur_plugins || !s->cur_plugins->next)
return 0;
/* first is aggregator itself */
lp = s->cur_plugins;
-
+
EVRY_PLUGIN_ITEMS_FREE(p);
/* get current 'context' ... */
{
item = selectors[i-1]->state->cur_item;
context = item->context;
- }
+ }
}
if (input)
EINA_LIST_FOREACH(lp, l, pp)
{
if (!pp->aggregate) continue;
-
+
EINA_LIST_FOREACH(pp->items, ll, it)
{
if (it->fuzzy_match == 0)
{
if (!pp->aggregate) continue;
cnt = 0;
-
+
EINA_LIST_FOREACH(pp->items, ll, it)
{
if (cnt++ == MAX_ITEMS) break;
-
+
if (!eina_list_data_find_list(items, it))
{
it->fuzzy_match = 0;
EINA_LIST_FOREACH(lp, l, pp)
{
if (!pp->aggregate) continue;
-
+
EINA_LIST_FOREACH(pp->items, ll, it)
{
if (evry_history_item_usage_set(p->selector->history, it, input, context) &&
EINA_LIST_FOREACH_SAFE(p->base.items, l, ll, it)
{
if (cnt++ < MAX_ITEMS) continue;
- evry_item_free(it);
+ evry_item_free(it);
p->base.items = eina_list_remove_list(p->base.items, l);
}
evry_plug_aggregator_new(Evry_Selector *sel, int type)
{
Plugin *p;
-
+
p = E_NEW(Plugin, 1);
EVRY_PLUGIN_NEW(EVRY_PLUGIN(p), N_("All"), type, "", "",
NULL, _cleanup, _fetch, _icon_get, NULL);
_action(Evry_Action *act)
{
const Evry_Item *it = act->item1;
-
+
ecore_x_selection_primary_set(clipboard_win, it->label, strlen(it->label));
ecore_x_selection_clipboard_set(clipboard_win, it->label, strlen(it->label));
ecore_x_window_free(clipboard_win);
evry_action_free(act);
}
-
_fetch(Evry_Plugin *p, const char *input)
{
Evry_Item *it;
-
+
EVRY_PLUGIN_ITEMS_FREE(p);
if (input)
return 1;
}
-
+
return 0;
}
Eina_Bool
evry_plug_text_init(void)
{
- p1 = EVRY_PLUGIN_NEW(NULL, N_("Text"), type_subject, NULL, "TEXT",
+ p1 = EVRY_PLUGIN_NEW(NULL, N_("Text"), type_subject, NULL, "TEXT",
NULL, _cleanup, _fetch, NULL, NULL);
p2 = EVRY_PLUGIN_NEW(NULL, N_("Text"), type_object, NULL, "TEXT",
p2->icon = "accessories-text-editor";
p1->trigger = ".";
p2->trigger = ".";
-
+
evry_plugin_register(p1, 999);
evry_plugin_register(p2, 999);
EVRY_PLUGIN_FREE(p1);
EVRY_PLUGIN_FREE(p2);
}
-
-
" an action, then press <hilight><return></hilight>.<br>"
/* "You might want to know <br>some mo keybinding to ease your experience though.<br>" */
" <hilight><?></hilight> show this page<br>"
- " <hilight><return></hilight> run action<br>"
- " <hilight><ctrl+return></hilight> run action and continue<br>"
- " <hilight><tab></hilight> toggle between selectors<br>"
- " <hilight><ctrl+tab></hilight> complete input (depends on plugin)<br>"
+ " <hilight><return></hilight> run action<br>"
+ " <hilight><ctrl+return></hilight> run action and continue<br>"
+ " <hilight><tab></hilight> toggle between selectors<br>"
+ " <hilight><ctrl+tab></hilight> complete input (depends on plugin)<br>"
" <hilight><ctrl+'x'></hilight> jump to plugin beginning with 'x'<br>"
" <hilight><ctrl+left/right></hilight> cycle through plugins<br>"
" <hilight><ctrl+1></hilight> toggle view modes (exit this page ;)<br>"
evry_view_unregister(view);
E_FREE(view);
}
-
Ecore_Animator *animator;
int slide_offset;
- double slide;
- double slide_to;
+ double slide;
+ double slide_to;
int sliding;
int clearing;
evas_object_show(it->image);
}
else it->have_thumb = EINA_TRUE;
-
+
/* dirbrowse fetches the mimetype for icon_get */
if (!it->get_thumb && _check_item(it->item))
it->get_thumb = EINA_TRUE;
mw = mh = 0;
EINA_LIST_FOREACH(sd->items, l, it)
{
- if (x > (sd->w - ww))
- {
- x = 0;
- y += hh;
- }
-
- it->x = x;
- it->y = y;
- it->w = ww;
- it->h = hh;
-
- if ((x + ww) > mw) mw = x + ww;
- if ((y + hh) > mh) mh = y + hh;
- x += ww;
+ if (x > (sd->w - ww))
+ {
+ x = 0;
+ y += hh;
+ }
+
+ it->x = x;
+ it->y = y;
+ it->w = ww;
+ it->h = hh;
+
+ if ((x + ww) > mw) mw = x + ww;
+ if ((y + hh) > mh) mh = y + hh;
+ x += ww;
}
if (sd->view->mode == VIEW_MODE_LIST ||
if ((mw != sd->cw) || (mh != sd->ch))
{
- sd->cw = mw;
- sd->ch = mh;
-
- if (sd->cx > (sd->cw - sd->w))
- {
- sd->cx = sd->cw - sd->w;
- redo = 1;
- }
- if (sd->cy > (sd->ch - sd->h))
- {
- sd->cy = sd->ch - sd->h;
- redo = 1;
- }
- if (sd->cx < 0)
- {
- sd->cx = 0;
- redo = 1;
- }
- if (sd->cy < 0)
- {
- sd->cy = 0;
- redo = 1;
- }
- /* if (redo)
+ sd->cw = mw;
+ sd->ch = mh;
+
+ if (sd->cx > (sd->cw - sd->w))
+ {
+ sd->cx = sd->cw - sd->w;
+ redo = 1;
+ }
+ if (sd->cy > (sd->ch - sd->h))
+ {
+ sd->cy = sd->ch - sd->h;
+ redo = 1;
+ }
+ if (sd->cx < 0)
+ {
+ sd->cx = 0;
+ redo = 1;
+ }
+ if (sd->cy < 0)
+ {
+ sd->cy = 0;
+ redo = 1;
+ }
+ /* if (redo)
* {
* recursion = 1;
* _e_smart_reconfigure_do(obj);
* recursion = 0;
* } */
- changed = 1;
+ changed = 1;
}
if (sd->view->mode == VIEW_MODE_THUMB)
EINA_LIST_FOREACH(sd->items, l, it)
{
- xx = sd->x - sd->cx + it->x + ox;
- yy = sd->y - sd->cy + it->y + oy;
+ xx = sd->x - sd->cx + it->x + ox;
+ yy = sd->y - sd->cy + it->y + oy;
- if (E_INTERSECTS(xx, yy, it->w, it->h, 0, sd->y - (it->h*4),
+ if (E_INTERSECTS(xx, yy, it->w, it->h, 0, sd->y - (it->h*4),
sd->x + sd->w, sd->y + sd->h + it->h*8))
- {
+ {
if (!it->visible)
{
if (!it->frame)
it->visible = EINA_TRUE;
}
- /* fixme */
+ /* fixme */
if (!eina_list_data_find(sd->queue, it))
sd->queue = eina_list_append(sd->queue, it);
evas_object_move(it->frame, xx, yy);
evas_object_resize(it->frame, it->w, it->h);
- }
- else if (it->visible)
+ }
+ else if (it->visible)
{
sd->queue = eina_list_remove(sd->queue, it);
if (it->do_thumb) e_thumb_icon_end(it->thumb);
EINA_LIST_FREE(sd->items, it)
{
if (it->do_thumb) e_thumb_icon_end(it->thumb);
- if (it->thumb) evas_object_del(it->thumb);
- if (it->frame) evas_object_del(it->frame);
- if (it->image) evas_object_del(it->image);
+ if (it->thumb) evas_object_del(it->thumb);
+ if (it->frame) evas_object_del(it->frame);
+ if (it->image) evas_object_del(it->image);
evry_item_free(it->item);
- free(it);
+ free(it);
}
free(sd);
evas_object_smart_data_set(obj, NULL);
Smart_Data *sd = evas_object_smart_data_get(obj);
if (x)
{
- if (sd->w < sd->cw) *x = sd->cw - sd->w;
- else *x = 0;
+ if (sd->w < sd->cw) *x = sd->cw - sd->w;
+ else *x = 0;
}
if (y)
{
- if (sd->h < sd->ch) *y = sd->ch - sd->h;
- else *y = 0;
+ if (sd->h < sd->ch) *y = sd->ch - sd->h;
+ else *y = 0;
}
}
double spd = (25.0/(double)e_config->framerate) / (double) (1 + sd->view->zoom);
/* if (sd->sliding) spd *= 1.5; */
if (spd > 0.9) spd = 0.9;
-
+
int wait = 0;
if (sd->sel_pos != sd->sel_pos_to)
if (sd->sliding)
{
sd->slide = (sd->slide * (1.0 - spd)) + (sd->slide_to * spd);
-
+
da = sd->slide - sd->slide_to;
if (da < 0.0) da = -da;
if (da < 0.02)
if (sd->clearing)
{
- _view_clear(EVRY_VIEW(sd->view), 0);
+ _view_clear(EVRY_VIEW(sd->view), 0);
sd->animator = NULL;
return 0;
}
evas_object_move(sd->view->span, sd->slide, sd->y);
}
-
+
if (wait) return 1;
sd->animator = NULL;
sd->sel_pos = align_to * it->h;
sd->sel_pos_to = sd->sel_pos;
}
-
+
if (align >= 0)
{
sd->scroll_align = align;
if (slide)
{
if (sd->items && !sd->animator)
- sd->animator = ecore_animator_add(_animator, v->span);
+ sd->animator = ecore_animator_add(_animator, v->span);
sd->sliding = 1;
sd->slide = sd->x;
sd->slide_to = sd->x + sd->w * -slide;
}
if (sd->animator)
- ecore_animator_del(sd->animator);
+ ecore_animator_del(sd->animator);
}
sd->clearing = EINA_FALSE;
-
+
_clear_items(v->span);
EINA_LIST_FREE(sd->items, it)
int pos, last_pos, last_vis = 0, first_vis = 0;
Eina_Bool update = EINA_FALSE;
Evry_Plugin *p = v->state->plugin;
-
+
sd->cur_item = NULL;
if (!p)
}
if (p != v->plugin)
- {
+ {
if (p->config->view_mode >= 0)
{
if (p->config->view_mode != v->mode)
_clear_items(v->span);
-
+
v->mode = p->config->view_mode;
}
else
v->mode = v->mode_prev;
}
}
-
+
/* go through current view items */
EINA_LIST_FOREACH(sd->items, l, v_it)
{
sd->items = eina_list_sort(sd->items, eina_list_count(sd->items), _sort_cb);
if (!sd->cur_item && sd->items) sd->cur_item = sd->items->data;
-
+
if (update || !last_vis || v->plugin != p)
{
v->plugin = p;
if (slide)
{
if (sd->items && !sd->animator)
- sd->animator = ecore_animator_add(_animator, v->span);
+ sd->animator = ecore_animator_add(_animator, v->span);
sd->sliding = 1;
sd->slide_to = sd->x;
sd->slide = sd->x + sd->w * -slide;
else if (sd->sliding)
{
if (!sd->animator)
- sd->animator = ecore_animator_add(_animator, v->span);
+ sd->animator = ecore_animator_add(_animator, v->span);
}
}
-
+
return 0;
}
Item *it = NULL;
const Evry_State *s = v->state;
int slide;
-
+
if (!s->plugin)
return 0;
goto end;
}
}
-
+
if ((slide = v->tabs->key_down(v->tabs, ev)))
{
/* _view_update(view, -slide); */
l = eina_list_data_find_list(sd->items, sd->cur_item);
if (!l)
l = sd->items;
-
+
if (v->mode == VIEW_MODE_THUMB && !evry_conf->cycle_mode)
{
if (!strcmp(ev->key, "Right"))
v->mode = parent->mode;
v->mode_prev = v->mode;
-
+
v->zoom = parent->zoom;
v->bg = edje_object_add(v->evas);
e_theme_edje_object_set(v->bg, "base/theme/widgets",
- "e/modules/everything/thumbview/main/window");
+ "e/modules/everything/thumbview/main/window");
// scrolled thumbs
v->span = _pan_add(v->evas);
_pan_view_set(v->span, v);
// the scrollframe holding the scrolled thumbs
v->sframe = e_scrollframe_add(v->evas);
e_scrollframe_custom_theme_set(v->sframe, "base/theme/widgets",
- "e/modules/everything/thumbview/main/scrollframe");
+ "e/modules/everything/thumbview/main/scrollframe");
e_scrollframe_extern_pan_set(v->sframe, v->span,
- _pan_set, _pan_get, _pan_max_get,
- _pan_child_size_get);
+ _pan_set, _pan_get, _pan_max_get,
+ _pan_child_size_get);
edje_object_part_swallow(v->bg, "e.swallow.list", v->sframe);
-
+
evas_object_show(v->sframe);
evas_object_show(v->span);
-
+
v->tabs = evry_tab_view_new(s, v->evas);
EVRY_VIEW(v)->o_list = v->bg;
evry_view_unregister(EVRY_VIEW(view));
E_FREE(view);
}
-
if (EVRY_ITEM(file)->detail)
return;
-
+
if (!home_dir)
{
home_dir = e_user_homedir_get();
home_dir_len = strlen(home_dir);
}
-
+
path = ecore_file_dir_get(file->path);
-
+
if (path && !strncmp(path, home_dir, home_dir_len))
{
if (*(path + home_dir_len) == '\0')
snprintf(dir_buf, sizeof(dir_buf), "~%s", path + home_dir_len);
else
snprintf(dir_buf, sizeof(dir_buf), "~%s/", path + home_dir_len);
-
+
EVRY_ITEM(file)->detail = eina_stringshare_add(dir_buf);
}
else
{
if (!strncmp(path, "//", 2)) path++;
-
+
EVRY_ITEM(file)->detail = eina_stringshare_add(path);
}
}
if (strlen(str) != m_len)
sum += 10;
}
-
+
return sum;
}
{
return eina_list_sort(items, eina_list_count(items), _evry_fuzzy_match_sort_cb);
}
-
+
/* taken from e_utils. just changed 48 to 72.. we need
evry_icon_theme_set(Evas_Object *obj, const char *icon,
_evry_icon_mime_theme_get(const char *mime, Evas *e)
{
Evas_Object *o = NULL;
-
+
char buf[1024];
const char *file;
o = _evry_icon_mime_theme_get(mime, e);
if (o) return o;
-
+
icon = efreet_mime_type_icon_get(mime, e_config->icon_theme, 128);
if (icon)
{
free(icon);
}
if (o) return o;
-
+
return _evry_icon_mime_theme_get(mime, e);
}
if (!it_app) return 0;
ITEM_APP(app, it_app);
-
+
zone = e_util_zone_current_get(e_manager_current_get());
if (app->desktop)
ITEM_FILE(file, it_file);
/* files = eina_list_append(files, file->path);
- *
+ *
* e_exec(zone, NULL, app->file, files, NULL);
- *
+ *
* if (files)
* eina_list_free(files); */
e_util_dialog_internal(_("Configuration Updated"), data);
return 0;
}
-
+
EAPI Eina_Bool
evry_util_module_config_check(const char *module_name, int conf, int epoch, int version)
{
- if ((conf >> 16) < epoch)
+ if ((conf >> 16) < epoch)
{
char *too_old =
_("%s Configuration data needed "
ecore_timer_add(1.0, _conf_timer, buf);
return EINA_FALSE;
}
- else if (conf > version)
+ else if (conf > version)
{
char *too_new =
_("Your %s Module configuration is NEWER "
/* encode it */
newlen += 2; /* the size grows with two, since this'll become a %XX */
if(newlen > alloc) {
- alloc *= 2;
- testing_ptr = realloc(ns, alloc);
- if(!testing_ptr) {
- free( ns );
- return NULL;
- }
- else {
- ns = testing_ptr;
- }
+ alloc *= 2;
+ testing_ptr = realloc(ns, alloc);
+ if(!testing_ptr) {
+ free( ns );
+ return NULL;
+ }
+ else {
+ ns = testing_ptr;
+ }
}
snprintf(&ns[strindex], 4, "%%%02X", in);
ns[strindex]=0; /* terminate it */
return ns;
}
-
-
_animator(void *data)
{
Tab_View *v = data;
-
+
double da;
double spd = (5.0 / (double)e_config->framerate);
if (spd > 0.9) spd = 0.9;
e_box_size_min_get(v->o_tabs, &mw, NULL);
evas_object_geometry_get(v->o_tabs, NULL, NULL, &w, NULL);
-
+
if (mw < w)
{
e_box_align_set(v->o_tabs, 0.0, 0.5);
_timer_cb(void *data)
{
Tab_View *v = data;
-
+
_tabs_update(v);
v->timer = NULL;
return 0;
-
+
}
static void
Evas_Coord w, x;
Evas_Object *o;
- edje_object_calc_force(v->o_tabs);
+ edje_object_calc_force(v->o_tabs);
evas_object_geometry_get(v->o_tabs, &x, NULL, &w, NULL);
if (!w && !v->timer)
{
- v->timer = ecore_timer_add(0.1, _timer_cb, v);
+ v->timer = ecore_timer_add(0.1, _timer_cb, v);
return;
}
-
+
/* remove tabs for not active plugins */
e_box_freeze(v->o_tabs);
/* if (eina_list_count(s->cur_plugins) == 2)
* {
* v->align = 0;
- * e_box_align_set(v->o_tabs, 0.0, 0.5);
+ * e_box_align_set(v->o_tabs, 0.0, 0.5);
* } */
/* else */
if (s->plugin)
const char *key = ev->key;
if (!v->state || !v->state->cur_plugins) return 0;
-
+
if (!strcmp(key, "Next"))
{
_plugin_next(v);
_plugin_next(v);
return 1;
}
-
+
}
else if (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL)
{
v->clear = &_tabs_clear;
v->key_down = &_tabs_key_down;
v->state = s;
-
+
v->evas = e;
o = e_box_add(e);
e_box_orientation_set(o, 1);
evry_tab_view_free(Tab_View *v)
{
Tab *tab;
-
+
EINA_LIST_FREE(v->tabs, tab)
{
e_box_unpack(tab->o_tab);
E_FREE(tab);
}
- evas_object_del(v->o_tabs);
+ evas_object_del(v->o_tabs);
if (v->animator)
ecore_animator_del(v->animator);
if (v->timer)
ecore_timer_del(v->timer);
-
+
E_FREE(v);
}