ATTN: JEFFDAMETH!

YOUR CODE FORMATTING IS BROKEN! PLEASE FIX THIS IN YOUR EDITOR ASAP!


SVN revision: 65704
This commit is contained in:
Mike Blumenkrantz 2011-11-30 03:32:54 +00:00
parent 03411559de
commit 0cc0f8c658
21 changed files with 4939 additions and 4885 deletions

View File

@ -26,10 +26,10 @@ E_Module *_mod_evry = NULL;
/* module setup */
EAPI E_Module_Api e_modapi =
{
{
E_MODULE_API_VERSION,
"Everything"
};
};
EAPI void *
e_modapi_init(E_Module *m)
@ -41,7 +41,7 @@ e_modapi_init(E_Module *m)
_e_module_evry_log_dom = eina_log_domain_register
("e_module_everything", EINA_LOG_DEFAULT_COLOR);
if(_e_module_evry_log_dom < 0)
if (_e_module_evry_log_dom < 0)
{
EINA_LOG_ERR
("impossible to create a log domain for everything module");
@ -140,7 +140,7 @@ e_modapi_init(E_Module *m)
evry_plug_calc_init(m);
e_datastore_set("evry_api", evry);
EINA_LIST_FOREACH(e_datastore_get("evry_modules"), l, em)
EINA_LIST_FOREACH (e_datastore_get("evry_modules"), l, em)
em->active = em->init(evry);
evry_plug_collection_init();
@ -167,7 +167,7 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
Eina_List *l;
Evry_Module *em;
EINA_LIST_FOREACH(e_datastore_get("evry_modules"), l, em)
EINA_LIST_FOREACH (e_datastore_get("evry_modules"), l, em)
{
if (em->active)
em->shutdown();
@ -196,7 +196,7 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
_config_free();
evry_history_free();
EINA_LIST_FREE(_evry_types, t)
EINA_LIST_FREE (_evry_types, t)
eina_stringshare_del(t);
e_configure_registry_item_del("launcher/run_everything");
@ -231,7 +231,7 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
#ifdef CHECK_REFS
Evry_Item *it;
EINA_LIST_FREE(_refd, it)
EINA_LIST_FREE (_refd, it)
printf("%d %s\n", it->ref, it->label);
#endif
@ -257,12 +257,11 @@ e_modapi_save(E_Module *m __UNUSED__)
/***************************************************************************/
Ecore_Event_Handler *
evry_event_handler_add(int type, Eina_Bool (*func) (void *data, int type, void *event), const void *data)
evry_event_handler_add(int type, Eina_Bool (*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)
{
@ -271,13 +270,13 @@ evry_type_register(const char *type)
const char *i;
Eina_List *l;
EINA_LIST_FOREACH(_evry_types, l, i)
EINA_LIST_FOREACH (_evry_types, l, i)
{
if (i == t) break;
ret++;
}
if(!l)
if (!l)
{
_evry_types = eina_list_append(_evry_types, t);
return ret;
@ -304,7 +303,8 @@ evry_type_get(Evry_Type type)
return ret;
}
int evry_api_version_check(int version)
int
evry_api_version_check(int version)
{
if (EVRY_API_VERSION == version)
return 1;
@ -314,7 +314,6 @@ int evry_api_version_check(int version)
return 0;
}
static int
_evry_cb_view_sort(const void *data1, const void *data2)
{
@ -323,7 +322,6 @@ _evry_cb_view_sort(const void *data1, const void *data2)
return v1->priority - v2->priority;
}
void
evry_view_register(Evry_View *view, int priority)
{
@ -499,32 +497,32 @@ _config_free(void)
Plugin_Config *pc, *pc2;
Gadget_Config *gc;
EINA_LIST_FREE(evry_conf->collections, pc)
EINA_LIST_FREE(pc->plugins, pc2)
EINA_LIST_FREE (evry_conf->collections, pc)
EINA_LIST_FREE (pc->plugins, pc2)
{
IF_RELEASE(pc2->name);
IF_RELEASE(pc2->trigger);
E_FREE(pc2);
}
EINA_LIST_FREE(evry_conf->conf_subjects, pc)
EINA_LIST_FREE (evry_conf->conf_subjects, pc)
{
IF_RELEASE(pc->name);
IF_RELEASE(pc->trigger);
E_FREE(pc);
}
EINA_LIST_FREE(evry_conf->conf_actions, pc)
EINA_LIST_FREE (evry_conf->conf_actions, pc)
{
IF_RELEASE(pc->name);
IF_RELEASE(pc->trigger);
E_FREE(pc);
}
EINA_LIST_FREE(evry_conf->conf_objects, pc)
EINA_LIST_FREE (evry_conf->conf_objects, pc)
{
IF_RELEASE(pc->name);
IF_RELEASE(pc->trigger);
E_FREE(pc);
}
EINA_LIST_FREE(evry_conf->gadgets, gc)
EINA_LIST_FREE (evry_conf->gadgets, gc)
{
IF_RELEASE(gc->id);
IF_RELEASE(gc->plugin);
@ -612,3 +610,4 @@ _e_mod_menu_add(void *data __UNUSED__, E_Menu *m)
e_util_menu_item_theme_icon_set(mi, "system-run");
e_menu_item_callback_set(mi, _e_mod_run_cb, NULL);
}

View File

@ -60,7 +60,6 @@ static int _evry_view_key_press(Evry_State *s, Ecore_Event_Key *ev);
static void _evry_view_show(Evry_Window *win, Evry_View *v, int slide);
static void _evry_view_hide(Evry_Window *win, Evry_View *v, int slide);
static void _evry_item_desel(Evry_State *s);
static void _evry_item_sel(Evry_State *s, Evry_Item *it);
@ -93,7 +92,7 @@ evry_init(void)
int
evry_shutdown(void)
{
while(windows)
while (windows)
evry_hide(windows->data, 0);
return 1;
@ -185,7 +184,7 @@ evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params, Eina_Bool popup)
if (params)
win->plugin_dedicated = EINA_TRUE;
win->sel_list = E_NEW(Evry_Selector*, 4);
win->sel_list = E_NEW(Evry_Selector *, 4);
win->sel_list[3] = NULL;
win->selectors = win->sel_list;
_evry_selector_new(win, EVRY_PLUGIN_SUBJECT);
@ -339,7 +338,7 @@ evry_hide(Evry_Window *win, int clear)
E_FREE(win->sel_list);
EINA_LIST_FREE(win->handlers, ev)
EINA_LIST_FREE (win->handlers, ev)
ecore_event_handler_del(ev);
if (win->grab)
@ -357,7 +356,7 @@ evry_hide(Evry_Window *win, int clear)
int _cnt = eina_list_count(_refd);
Eina_List *_l;
printf("__________________________");
EINA_LIST_FOREACH(_refd, _l, _it)
EINA_LIST_FOREACH (_refd, _l, _it)
printf("%d %s\n", _it->ref, _it->label);
printf("sum: %d", _cnt);
#endif
@ -376,7 +375,7 @@ _evry_selectors_shift(Evry_Window *win, int dir)
for (i = 1; i < 3; i++)
_evry_selector_item_clear(win->selectors[i]);
if (!(new_sel = realloc(win->sel_list, sizeof(Evry_Selector*) * 6)))
if (!(new_sel = realloc(win->sel_list, sizeof(Evry_Selector *) * 6)))
return 0;
win->sel_list = new_sel;
@ -433,8 +432,8 @@ _evry_selectors_shift(Evry_Window *win, int dir)
Evry_Item *
evry_item_new(Evry_Item *it, Evry_Plugin *p, const char *label,
Evas_Object *(*icon_get) (Evry_Item *it, Evas *e),
void (*cb_free) (Evry_Item *item))
Evas_Object *(*icon_get)(Evry_Item * it, Evas * e),
void (*cb_free)(Evry_Item *item))
{
if (!it)
{
@ -500,7 +499,6 @@ evry_item_ref(Evry_Item *it)
#ifdef PRINT_REFS
printf("%d, %d\t ref : %s\n", it->ref, _item_cnt, it->label);
#endif
}
static int
@ -685,7 +683,6 @@ evry_plugin_update(Evry_Plugin *p, int action)
_evry_clear(SUBJ_SEL);
}
}
}
else if (action == EVRY_UPDATE_REFRESH)
{
@ -818,8 +815,8 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge)
if (edge == E_ZONE_EDGE_NONE)
{
mw += offset_s*2;
mh += offset_s*2;
mw += offset_s * 2;
mh += offset_s * 2;
x = (zone->x + (zone->w * evry_conf->rel_x)) - (mw / 2);
y = (zone->y + (zone->h * evry_conf->rel_y)) - (mh / 2);
@ -834,22 +831,25 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge)
x = to_side - offset_s;
y = to_side - offset_s;
break;
case E_ZONE_EDGE_TOP_RIGHT:
x = zone->w - (mw + offset_s + to_side);
y = to_side - offset_s;
break;
case E_ZONE_EDGE_BOTTOM_RIGHT:
x = zone->w - (mw + offset_s + to_side);
y = zone->h - (mh + offset_s + to_side);
break;
case E_ZONE_EDGE_BOTTOM_LEFT:
x = to_side - offset_s;
y = zone->h - (mh + offset_s + to_side);
break;
default:
mw += offset_s*2;
mh += offset_s*2;
mw += offset_s * 2;
mh += offset_s * 2;
x = (zone->w * evry_conf->rel_x) - (mw / 2);
y = (zone->h * evry_conf->rel_y) - (mh / 2);
break;
@ -858,8 +858,8 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge)
x += zone->x;
y += zone->y;
mw += offset_s*2;
mh += offset_s*2;
mw += offset_s * 2;
mh += offset_s * 2;
}
e_win_move_resize(win->ewin, x, y, mw, mh);
@ -888,6 +888,7 @@ _evry_cb_drag_finished(E_Drag *drag, int dropped)
{
E_FREE(drag->data);
}
#endif
static Eina_Bool
@ -1056,7 +1057,6 @@ _evry_selector_cb_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__
else
_evry_selectors_switch(win, 1);
}
else if (sel == ACTN_SEL)
{
if (CUR_SEL == SUBJ_SEL)
@ -1108,7 +1108,7 @@ _evry_selector_new(Evry_Window *win, int type)
_evry_selector_cb_wheel, sel);
}
EINA_LIST_FOREACH(pcs, l, pc)
EINA_LIST_FOREACH (pcs, l, pc)
{
if (!pc->plugin) continue;
if (pc->plugin == sel->aggregator) continue;
@ -1318,7 +1318,7 @@ _evry_selector_item_update(Evry_Selector *sel)
if ((!s) || !(s->cur_item))
{
/* no items for this state - clear selector */
_evry_selector_label_set(sel, "e.text.label","");
_evry_selector_label_set(sel, "e.text.label", "");
if (sel == CUR_SEL && s && s->plugin)
_evry_selector_label_set(sel, "e.text.plugin",
@ -1430,7 +1430,7 @@ _evry_selector_plugins_get(Evry_Selector *sel, Evry_Item *it, const char *plugin
if (it && CHECK_TYPE(it, EVRY_TYPE_ACTION))
act = (Evry_Action *)it;
EINA_LIST_FOREACH(sel->plugins, l, p)
EINA_LIST_FOREACH (sel->plugins, l, p)
{
if (!p->config->enabled && !win->plugin_dedicated)
continue;
@ -1475,7 +1475,7 @@ _evry_state_new(Evry_Selector *sel, Eina_List *plugins)
s->plugins = eina_list_append(s->plugins, p);
s->aggregator = p;
EINA_LIST_FOREACH(s->plugins, l, p)
EINA_LIST_FOREACH (s->plugins, l, p)
p->state = s;
return s;
@ -1527,7 +1527,7 @@ _evry_state_pop(Evry_Selector *sel, int immediate)
sel->states = eina_list_remove_list(sel->states, sel->states);
prev = eina_list_data_get(sel->states);
EINA_LIST_FREE(s->plugins, p)
EINA_LIST_FREE (s->plugins, p)
{
/* skip non top-level plugins */
if (prev && eina_list_data_find(prev->plugins, p))
@ -1564,7 +1564,7 @@ evry_state_push(Evry_Selector *sel, Eina_List *plugins)
return 0;
}
EINA_LIST_FOREACH(plugins, l, p)
EINA_LIST_FOREACH (plugins, l, p)
p->state = new_state;
if (s && s->view)
@ -1637,7 +1637,7 @@ evry_browse_item(Evry_Item *it)
/* items of type NONE can only be browsed by their own plugin */
if (!CHECK_TYPE(it, EVRY_TYPE_NONE))
{
EINA_LIST_FOREACH(sel->plugins, l, p)
EINA_LIST_FOREACH (sel->plugins, l, p)
{
if (!p->browse)
continue;
@ -1784,7 +1784,7 @@ evry_selectors_switch(Evry_Window *win, int dir, int slide)
if (!s || !(it = s->cur_item) || !(CHECK_TYPE(it, EVRY_TYPE_ACTION)))
return 0;
GET_ACTION(act,it);
GET_ACTION(act, it);
if (!act->it2.type)
return 0;
@ -1851,7 +1851,6 @@ _evry_input_complete(Evry_State *s)
static int
_evry_cheat_history(Evry_State *s, int promote, int delete)
{
History_Entry *he;
History_Item *hi;
History_Types *ht;
@ -1866,7 +1865,7 @@ _evry_cheat_history(Evry_State *s, int promote, int delete)
if (!(he = eina_hash_find(ht->types, (it->id ? it->id : it->label))))
return 1;
EINA_LIST_FOREACH_SAFE(he->items, l, ll, hi)
EINA_LIST_FOREACH_SAFE (he->items, l, ll, hi)
{
if (hi->plugin != it->plugin->name)
continue;
@ -1985,7 +1984,7 @@ _evry_cb_key_down(void *data, int type __UNUSED__, void *event)
Eina_List *ll;
Evry_Plugin *p;
EINA_LIST_FOREACH((SUBJ_SEL)->plugins, ll, p)
EINA_LIST_FOREACH ((SUBJ_SEL)->plugins, ll, p)
if (!strcmp(bind->params, p->name)) break;
if (p)
@ -2183,7 +2182,7 @@ _evry_cb_key_down(void *data, int type __UNUSED__, void *event)
}
}
end:
end:
ev->key = old;
return ECORE_CALLBACK_PASS_ON;
}
@ -2421,7 +2420,7 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
if (!(act->it1.item && CHECK_TYPE(act->it1.item, EVRY_TYPE_PLUGIN)))
act->it1.item = it_subj;
EINA_LIST_FOREACH(s_obj->sel_items, l, it)
EINA_LIST_FOREACH (s_obj->sel_items, l, it)
{
if (it->type != act->it2.type)
continue;
@ -2432,7 +2431,7 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
}
else if (s_subj->sel_items && !(act->it1.accept_list))
{
EINA_LIST_FOREACH(s_subj->sel_items, l, it)
EINA_LIST_FOREACH (s_subj->sel_items, l, it)
{
if (it->type != act->it1.type)
continue;
@ -2661,7 +2660,6 @@ _evry_view_create(Evry_State *s)
return 0;
}
static int
_evry_view_update(Evry_Window *win, Evry_State *s)
{
@ -2708,7 +2706,7 @@ evry_view_toggle(Evry_State *s, const char *trigger)
if (trigger)
{
EINA_LIST_FOREACH(evry_conf->views, ll, view)
EINA_LIST_FOREACH (evry_conf->views, ll, view)
{
if (view->trigger && !strncmp(trigger, view->trigger, 1) &&
(!s->view || (view->id != s->view->id)) &&
@ -2735,7 +2733,7 @@ evry_view_toggle(Evry_State *s, const char *trigger)
else
l = evry_conf->views;
EINA_LIST_FOREACH(l, ll, view)
EINA_LIST_FOREACH (l, ll, view)
{
if ((!view->trigger) &&
((!s->view || (view->id != s->view->id)) &&
@ -2744,7 +2742,7 @@ evry_view_toggle(Evry_State *s, const char *trigger)
}
}
found:
found:
if (!v) return 0;
_evry_list_win_show(win);
@ -2804,7 +2802,7 @@ _evry_matches_update(Evry_Selector *sel, int async)
{
s->plugin_auto_selected = EINA_FALSE;
EINA_LIST_FOREACH(s->cur_plugins, l, p)
EINA_LIST_FOREACH (s->cur_plugins, l, p)
{
p->request = s->request;
p->fetch(p, s->input);
@ -2812,14 +2810,14 @@ _evry_matches_update(Evry_Selector *sel, int async)
goto found;
}
EINA_LIST_FREE(s->cur_plugins, p);
EINA_LIST_FREE (s->cur_plugins, p) ;
/* check if input matches plugin trigger */
if (input)
{
int len_trigger = 0;
EINA_LIST_FOREACH(s->plugins, l, p)
EINA_LIST_FOREACH (s->plugins, l, p)
{
if (!p->config->trigger) continue;
int len = strlen(p->config->trigger);
@ -2833,7 +2831,7 @@ _evry_matches_update(Evry_Selector *sel, int async)
len_trigger = len;
s->cur_plugins = eina_list_append(s->cur_plugins, p);
p->request = s->request;
if(len_inp == len)
if (len_inp == len)
p->fetch(p, NULL);
else
p->fetch(p, s->input + len);
@ -2860,7 +2858,7 @@ _evry_matches_update(Evry_Selector *sel, int async)
}
/* query all other plugins for this state */
EINA_LIST_FOREACH(s->plugins, l, p)
EINA_LIST_FOREACH (s->plugins, l, p)
{
p->request = s->request;
@ -2899,12 +2897,12 @@ _evry_matches_update(Evry_Selector *sel, int async)
continue;
}
next:
next:
if (s->plugin == p)
s->plugin = NULL;
}
found:
found:
_evry_aggregator_fetch(s);
if (s->plugin_auto_selected)
@ -2915,7 +2913,7 @@ _evry_matches_update(Evry_Selector *sel, int async)
if (!s->plugin)
return;
EINA_LIST_FOREACH(s->plugin->items, l, it)
EINA_LIST_FOREACH (s->plugin->items, l, it)
if (it->marked)
s->sel_items = eina_list_append(s->sel_items, it);
}
@ -2974,7 +2972,6 @@ _evry_plugin_select(Evry_State *s, Evry_Plugin *p)
_evry_view_show(s->selector->win, s->view, 0);
s->view->update(s->view);
}
}
}
@ -3016,7 +3013,7 @@ _evry_plugin_list_insert(Evry_State *s, Evry_Plugin *p)
Eina_List *l;
Evry_Plugin *p2;
EINA_LIST_FOREACH(s->cur_plugins, l, p2)
EINA_LIST_FOREACH (s->cur_plugins, l, p2)
{
if (p == p2)
return;
@ -3060,3 +3057,4 @@ _evry_cb_selection_notify(void *data, int type __UNUSED__, void *event)
return ECORE_CALLBACK_PASS_ON;
}

View File

@ -1,9 +1,9 @@
#include "e_mod_main.h"
static void *_create_data (E_Config_Dialog *cfd);
static void _free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
typedef struct _Plugin_Page Plugin_Page;
@ -59,7 +59,6 @@ struct _E_Config_Dialog_Data
Plugin_Page page[3];
};
EAPI E_Config_Dialog *
evry_config_dialog(E_Container *con, const char *params __UNUSED__)
{
@ -200,7 +199,7 @@ _fill_list(Eina_List *plugins, Evas_Object *obj, int enabled __UNUSED__)
e_widget_ilist_freeze(obj);
e_widget_ilist_clear(obj);
EINA_LIST_FOREACH(plugins, l, pc)
EINA_LIST_FOREACH (plugins, l, pc)
{
/* if (!(end = edje_object_add(evas))) break; */
@ -256,7 +255,7 @@ _plugin_move(Plugin_Page *page, int dir)
_fill_list(page->configs, page->list, 0);
e_widget_ilist_selected_set(page->list, sel + dir);
EINA_LIST_FOREACH(page->configs, l1, pc)
EINA_LIST_FOREACH (page->configs, l1, pc)
pc->priority = prio++;
}
}
@ -274,7 +273,7 @@ _plugin_move_down_cb(void *data, void *data2 __UNUSED__)
}
static void
_list_select_cb (void *data, Evas_Object *obj)
_list_select_cb(void *data, Evas_Object *obj)
{
int sel = e_widget_ilist_selected_get(obj);
Plugin_Config *pc = NULL;
@ -600,7 +599,6 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdat
return otb;
}
/***************************************************************************/
static void *_cat_create_data(E_Config_Dialog *cfd);
@ -652,7 +650,7 @@ _cat_create_data(E_Config_Dialog *cfd)
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->page[0].collection = EINA_TRUE;
EINA_LIST_FOREACH(evry_conf->conf_subjects, l, pc)
EINA_LIST_FOREACH (evry_conf->conf_subjects, l, pc)
{
if (pc->name == p->name)
continue;
@ -665,7 +663,7 @@ _cat_create_data(E_Config_Dialog *cfd)
!strcmp(pc->name, "Plugins"))
continue;
EINA_LIST_FOREACH(p->config->plugins, ll, pc2)
EINA_LIST_FOREACH (p->config->plugins, ll, pc2)
if (pc->name == pc2->name)
break;
@ -743,3 +741,4 @@ _cat_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *e, E_Config_Dia
return otb;
}

View File

@ -64,7 +64,7 @@ _illume_running(void)
Eina_List *l;
E_Module *m;
EINA_LIST_FOREACH(e_module_list(), l, m)
EINA_LIST_FOREACH (e_module_list(), l, m)
if (!strcmp(m->name, "illume2") && m->enabled)
return EINA_TRUE;
@ -110,7 +110,6 @@ _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);
if (_illume_running())
{
inst->illume_mode = EINA_TRUE;
@ -135,7 +134,7 @@ _gc_shutdown(E_Gadcon_Client *gcc)
instances = eina_inlist_remove(instances, EINA_INLIST_GET(inst));
EINA_LIST_FREE(inst->handlers, h)
EINA_LIST_FREE (inst->handlers, h)
ecore_event_handler_del(h);
if (inst->del_fn && inst->win)
@ -210,8 +209,8 @@ _gc_id_new(E_Gadcon_Client_Class *client_class __UNUSED__)
/***************************************************************************/
static void _del_func(void *data, void *obj __UNUSED__)
static void
_del_func(void *data, void *obj __UNUSED__)
{
Instance *inst = data;
@ -293,7 +292,7 @@ _cb_focus_out(void *data, int type __UNUSED__, void *event)
ev = event;
EINA_INLIST_FOREACH(instances, inst)
EINA_INLIST_FOREACH (instances, inst)
if (inst == data) break;
if ((!inst) || (!inst->win))
@ -309,6 +308,7 @@ _cb_focus_out(void *data, int type __UNUSED__, void *event)
return ECORE_CALLBACK_PASS_ON;
}
static void
_gadget_popup_show(Instance *inst)
{
@ -332,24 +332,28 @@ _gadget_popup_show(Instance *inst)
e_win_move(ewin, x, y + h);
inst->hide_y = -1;
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 = 1;
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 = -1;
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 = 1;
break;
case E_GADCON_ORIENT_FLOAT:
case E_GADCON_ORIENT_HORIZ:
case E_GADCON_ORIENT_VERT:
@ -362,7 +366,6 @@ _gadget_popup_show(Instance *inst)
if (ewin->y + ph > inst->win->zone->h)
e_win_move(ewin, ewin->x, inst->win->zone->h - ph);
}
static void
@ -389,35 +392,39 @@ _gadget_window_show(Instance *inst)
case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_TR:
pw = zw/2;
ph = zh/2;
pw = zw / 2;
ph = zh / 2;
inst->hide_y = -1;
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;
pw = zw / 2;
ph = zh / 2;
inst->hide_y = 1;
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;
pw = zw / 2.5;
ph = zh;
inst->hide_x = -1;
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;
pw = zw / 2.5;
ph = zh;
inst->hide_x = 1;
e_win_move(ewin, gx - pw, zy);
break;
case E_GADCON_ORIENT_FLOAT:
case E_GADCON_ORIENT_HORIZ:
case E_GADCON_ORIENT_VERT:
@ -537,7 +544,6 @@ _button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
* inst->mouse_down = 1;
* } */
int
evry_gadget_init(void)
{
@ -647,7 +653,7 @@ _fill_list(Eina_List *plugins, Evas_Object *obj, E_Config_Dialog_Data *cfdata)
e_widget_ilist_append(obj, NULL, _("All"), NULL, NULL, NULL);
EINA_LIST_FOREACH(plugins, l, pc)
EINA_LIST_FOREACH (plugins, l, pc)
{
if (!pc->plugin) continue;
e_widget_ilist_append(obj, NULL, pc->plugin->base.label, NULL, NULL, pc->name);
@ -674,8 +680,8 @@ _list_select_cb(void *data __UNUSED__, Evas_Object *obj)
int sel = e_widget_ilist_selected_get(obj);
e_widget_ilist_nth_data_get(obj, sel);
}
#endif
static Evas_Object *
@ -748,3 +754,4 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
return 1;
}

View File

@ -72,7 +72,7 @@ _hist_entry_free_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__
History_Entry *he = data;
History_Item *hi;
EINA_LIST_FREE(he->items, hi)
EINA_LIST_FREE (he->items, hi)
{
if (hi->input)
eina_stringshare_del(hi->input);
@ -114,12 +114,12 @@ _hist_entry_cleanup_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *
History_Item *hi;
Eina_List *l, *ll;
EINA_LIST_FOREACH_SAFE(he->items, l, ll, hi)
EINA_LIST_FOREACH_SAFE (he->items, l, ll, hi)
{
if (hi->last_used < d->time - SEVEN_DAYS)
{
hi->count--;
hi->last_used = d->time - SEVEN_DAYS/2.0;
hi->last_used = d->time - SEVEN_DAYS / 2.0;
}
/* item is transient or too old */
@ -158,12 +158,13 @@ _hist_cleanup_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data,
{
eina_hash_foreach(ht->types, _hist_entry_cleanup_cb, fdata);
EINA_LIST_FREE(d->keys, key)
EINA_LIST_FREE (d->keys, key)
eina_hash_del_by_key(ht->types, key);
}
return EINA_TRUE;
}
void
evry_history_free(void)
{
@ -214,7 +215,6 @@ evry_history_load(void)
evry_hist->subjects = eina_hash_string_superfast_new(NULL);
}
void
evry_history_unload(void)
{
@ -305,7 +305,7 @@ evry_history_item_add(Evry_Item *it, const char *ctxt, const char *input)
}
else
{
EINA_LIST_FOREACH(he->items, l, hi)
EINA_LIST_FOREACH (he->items, l, hi)
if ((hi->plugin == it->plugin->name) &&
(!rem_ctxt || (ctxt == hi->context)))
break;
@ -399,7 +399,7 @@ evry_history_item_usage_set(Evry_Item *it, const char *input, const char *ctxt)
rem_ctxt = 0;
}
EINA_LIST_FOREACH(he->items, l, hi)
EINA_LIST_FOREACH (he->items, l, hi)
{
if (hi->plugin != it->plugin->name)
continue;
@ -456,7 +456,7 @@ evry_history_item_usage_set(Evry_Item *it, const char *input, const char *ctxt)
it->usage = hi->last_used;
}
if (it->fuzzy_match > 0)
it->usage /= (double) it->fuzzy_match;
it->usage /= (double)it->fuzzy_match;
else
it->usage /= 100.0;
@ -467,3 +467,4 @@ evry_history_item_usage_set(Evry_Item *it, const char *input, const char *ctxt)
return 0;
}

View File

@ -23,7 +23,7 @@ _finish(Evry_Plugin *plugin)
EVRY_PLUGIN_ITEMS_CLEAR(p);
EINA_LIST_FREE(p->actions, act);
EINA_LIST_FREE (p->actions, act) ;
E_FREE(p);
}
@ -57,7 +57,7 @@ _begin(Evry_Plugin *plugin, const Evry_Item *it)
if (!(CHECK_TYPE(it, EVRY_TYPE_PLUGIN)))
{
EINA_LIST_FOREACH(evry_conf->actions, l, act)
EINA_LIST_FOREACH (evry_conf->actions, l, act)
{
if (!((!act->it1.type) ||
(CHECK_TYPE(it, act->it1.type)) ||
@ -77,7 +77,7 @@ _begin(Evry_Plugin *plugin, const Evry_Item *it)
if (it->plugin)
{
EINA_LIST_FOREACH(it->plugin->actions, l, act)
EINA_LIST_FOREACH (it->plugin->actions, l, act)
{
act->base.plugin = EVRY_PLUGIN(p);
@ -119,7 +119,6 @@ _cb_sort(const void *data1, const void *data2)
}
if (it1->fuzzy_match || it2->fuzzy_match)
if (it1->fuzzy_match || it2->fuzzy_match)
{
if (it1->fuzzy_match && !it2->fuzzy_match)
@ -129,11 +128,11 @@ _cb_sort(const void *data1, const void *data2)
return 1;
if (it1->fuzzy_match - it2->fuzzy_match)
return (it1->fuzzy_match - it2->fuzzy_match);
return it1->fuzzy_match - it2->fuzzy_match;
}
if (it1->priority - it2->priority)
return (it1->priority - it2->priority);
return it1->priority - it2->priority;
return 0;
}
@ -148,7 +147,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
EVRY_PLUGIN_ITEMS_CLEAR(p);
EINA_LIST_FOREACH(p->actions, l, it)
EINA_LIST_FOREACH (p->actions, l, it)
{
match = evry_fuzzy_match(it->label, input);
@ -189,11 +188,10 @@ evry_plug_actions_shutdown()
evry_plugin_free(_plug);
/* bypass unregister, because it modifies the list */
EINA_LIST_FREE(evry_conf->actions, it)
EINA_LIST_FREE (evry_conf->actions, it)
evry_item_free(it);
}
void
evry_action_register(Evry_Action *act, int priority)
{
@ -224,8 +222,8 @@ Evry_Action *
evry_action_new(const char *name, const char *label,
Evry_Type type_in1, Evry_Type type_in2,
const char *icon,
int (*action) (Evry_Action *act),
int (*check_item) (Evry_Action *act, const Evry_Item *it))
int (*action)(Evry_Action *act),
int (*check_item)(Evry_Action *act, const Evry_Item *it))
{
Evry_Action *act = EVRY_ITEM_NEW(Evry_Action, _plug, label,
NULL, _action_free_cb);
@ -251,7 +249,6 @@ evry_action_free(Evry_Action *act)
evry_item_free(EVRY_ITEM(act));
}
/* TODO assign actions to plugins othersie there will be too liitle
names soon */
Evry_Action *
@ -262,7 +259,7 @@ evry_action_find(const char *name)
const char *n = eina_stringshare_add(name);
EINA_LIST_FOREACH(evry_conf->actions, l, act)
EINA_LIST_FOREACH (evry_conf->actions, l, act)
if (act->name == n)
break;
@ -270,3 +267,4 @@ evry_action_find(const char *name)
return act;
}

View File

@ -17,7 +17,7 @@ struct _Plugin
static int
_fetch(Evry_Plugin *plugin, const char *input)
{
Plugin *p = (Plugin *) plugin;
Plugin *p = (Plugin *)plugin;
Evry_Plugin *pp;
Eina_List *l, *ll, *lp = NULL;
Evry_Item *it, *it2;
@ -58,7 +58,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
EVRY_PLUGIN_ITEMS_FREE(p);
/* collect plugins to be shown in aggregator */
EINA_LIST_FOREACH(s->cur_plugins, l, pp)
EINA_LIST_FOREACH (s->cur_plugins, l, pp)
{
/* dont show in aggregator */
if (!pp->config->aggregate)
@ -75,7 +75,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
/* show non-top-level plugins as item */
if ((top_level) && (!s->trigger_active))
{
EINA_LIST_FOREACH(s->plugins, l, pp)
EINA_LIST_FOREACH (s->plugins, l, pp)
{
int min_fuzz = 0;
double max_usage = 0.0;
@ -90,7 +90,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
continue;
/* give plugin item the highest priority of its items */
EINA_LIST_FOREACH(pp->items, ll, it)
EINA_LIST_FOREACH (pp->items, ll, it)
{
if (it->usage >= 0)
evry_history_item_usage_set(it, input, context);
@ -130,7 +130,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
{
eina_list_free(items);
items = NULL;
EINA_LIST_FOREACH(pp->items, l, it)
EINA_LIST_FOREACH (pp->items, l, it)
{
if (it->usage >= 0)
evry_history_item_usage_set(it, input, context);
@ -145,13 +145,13 @@ _fetch(Evry_Plugin *plugin, const char *input)
/* append all plugins as items (which were not added above) */
if (inp_len >= plugin->config->min_query)
{
EINA_LIST_FOREACH(s->plugins, l, pp)
EINA_LIST_FOREACH (s->plugins, l, pp)
{
if (!strcmp(pp->name, "Actions"))
continue;
/* items MUST only conatin plugins here ! */
EINA_LIST_FOREACH(items, ll, pp2)
EINA_LIST_FOREACH (items, ll, pp2)
if (pp2->name == pp->name) break;
if (pp2)
continue;
@ -183,9 +183,9 @@ _fetch(Evry_Plugin *plugin, const char *input)
/* if there is input append all items that match */
if (input)
{
EINA_LIST_FOREACH(lp, l, pp)
EINA_LIST_FOREACH (lp, l, pp)
{
EINA_LIST_FOREACH(pp->items, ll, it)
EINA_LIST_FOREACH (pp->items, ll, it)
{
if (it->fuzzy_match == 0)
it->fuzzy_match = evry_fuzzy_match(it->label, input);
@ -204,10 +204,10 @@ _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)
{
int cnt = 1;
EINA_LIST_FOREACH(pp->items, ll, it)
EINA_LIST_FOREACH (pp->items, ll, it)
{
if ((!subj_sel) || (it->usage < 0) ||
(evry_history_item_usage_set(it, input, context)))
@ -222,9 +222,9 @@ _fetch(Evry_Plugin *plugin, const char *input)
if ((!top_level) && (eina_list_count(items) < MAX_ITEMS))
{
EINA_LIST_FOREACH(lp, l, pp)
EINA_LIST_FOREACH (lp, l, pp)
{
EINA_LIST_FOREACH(pp->items, ll, it)
EINA_LIST_FOREACH (pp->items, ll, it)
{
if (eina_list_data_find_list(items, it))
continue;
@ -236,13 +236,13 @@ _fetch(Evry_Plugin *plugin, const char *input)
evry_util_items_sort(&items, 0 /* !input */);
EINA_LIST_FOREACH(items, l, it)
EINA_LIST_FOREACH (items, l, it)
{
/* remove duplicates provided by different plugins. e.g.
files / places and tracker can find the same files */
if (it->id)
{
EINA_LIST_FOREACH(p->base.items, ll, it2)
EINA_LIST_FOREACH (p->base.items, ll, it2)
{
if ((it->plugin->name != it2->plugin->name) &&
(it->type == it2->type) &&
@ -259,7 +259,6 @@ _fetch(Evry_Plugin *plugin, const char *input)
if (cnt++ > MAX_ITEMS)
break;
}
if (lp) eina_list_free(lp);
@ -269,7 +268,6 @@ _fetch(Evry_Plugin *plugin, const char *input)
eina_list_free(items);
return EVRY_PLUGIN_HAS_ITEMS(p);
}
/* 'text' and 'actions' are always loaded */
else if ((subj_sel) && (eina_list_count(s->plugins) == 2))
{
@ -332,3 +330,4 @@ evry_aggregator_new(int type)
return p;
}

View File

@ -30,7 +30,7 @@ struct _Plugin
Eina_List *menu_items;
Eina_Hash *added;
Efreet_Menu *menu;;
Efreet_Menu *menu;
Evry_Item_App *command;
};
@ -59,7 +59,7 @@ struct _Item_Menu
{
Evry_Item base;
Efreet_Menu *menu;;
Efreet_Menu *menu;
};
static const Evry_API *evry = NULL;
@ -81,12 +81,12 @@ static Eina_List *exe_list2 = NULL;
static Eina_List *apps_cache = NULL;
static void _scan_executables();
#define GET_MENU(_m, _it) Item_Menu *_m = (Item_Menu *)_it
#define GET_MENU(_m, _it) Item_Menu * _m = (Item_Menu *)_it
/***************************************************************************/
static void _hash_free(void *data)
static void
_hash_free(void *data)
{
GET_APP(app, data);
EVRY_ITEM_FREE(app);
@ -154,7 +154,7 @@ _cb_sort(const void *data1, const void *data2)
const Evry_Item *it2 = data2;
if (it1->usage && it2->usage)
return (it1->usage > it2->usage ? -1 : 1);
return it1->usage > it2->usage ? -1 : 1;
if (it1->usage && !it2->usage)
return -1;
if (it2->usage && !it1->usage)
@ -169,7 +169,7 @@ _cb_sort(const void *data1, const void *data2)
return 1;
if (it1->fuzzy_match - it2->fuzzy_match)
return (it1->fuzzy_match - it2->fuzzy_match);
return it1->fuzzy_match - it2->fuzzy_match;
}
return strcasecmp(it1->label, it2->label);
@ -211,7 +211,7 @@ _hist_exe_get_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data,
int match;
const char *exe = key;
EINA_LIST_FOREACH(he->items, l, hi)
EINA_LIST_FOREACH (he->items, l, hi)
{
app = NULL;
@ -266,7 +266,7 @@ _fetch_exe(Evry_Plugin *plugin, const char *input)
if ((!exe_list) && (!exe_scan_idler))
_scan_executables();
EINA_LIST_FOREACH(exe_list, l, tmp)
EINA_LIST_FOREACH (exe_list, l, tmp)
{
tmp_len = strlen(tmp);
@ -304,7 +304,7 @@ _fetch_exe(Evry_Plugin *plugin, const char *input)
}
}
EINA_LIST_FOREACH(plugin->items, l, it)
EINA_LIST_FOREACH (plugin->items, l, it)
{
evry->history_item_usage_set(it, input, NULL);
if (input && (it->usage > max) && !strncmp(input, it->label, len))
@ -356,7 +356,7 @@ _finish_exe(Evry_Plugin *plugin)
closedir(exe_dir);
exe_dir = NULL;
}
EINA_LIST_FREE(exe_path, str)
EINA_LIST_FREE (exe_path, str)
free(str);
if (exe_scan_idler)
@ -364,9 +364,9 @@ _finish_exe(Evry_Plugin *plugin)
ecore_idler_del(exe_scan_idler);
exe_scan_idler = NULL;
}
EINA_LIST_FREE(exe_list, str)
EINA_LIST_FREE (exe_list, str)
free(str);
EINA_LIST_FREE(exe_list2, str)
EINA_LIST_FREE (exe_list2, str)
free(str);
E_FREE(p);
@ -414,7 +414,7 @@ _desktop_list_add(Plugin *p, Eina_List *apps, const char *input)
const char *exec, *end;
char buf[PATH_MAX];
EINA_LIST_FOREACH(apps, l, desktop)
EINA_LIST_FOREACH (apps, l, desktop)
{
if (eina_list_count(p->base.items) >= MAX_ITEMS) break;
@ -457,7 +457,7 @@ _desktop_list_get(void)
/* remove screensaver */
cat_ss = efreet_util_desktop_category_list("Screensaver");
EINA_LIST_FOREACH(cat_ss, l, d)
EINA_LIST_FOREACH (cat_ss, l, d)
{
if ((ll = eina_list_data_find_list(apps, d)))
{
@ -482,7 +482,7 @@ _hist_items_get_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data
Eina_List *l, *ll;
const char *exec = key;
EINA_LIST_FOREACH(he->items, l, hi)
EINA_LIST_FOREACH (he->items, l, hi)
{
d = NULL;
@ -492,7 +492,7 @@ _hist_items_get_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data
if (strcmp(hi->plugin, EVRY_PLUGIN(p)->name))
continue;
EINA_LIST_FOREACH(apps_cache, ll, d)
EINA_LIST_FOREACH (apps_cache, ll, d)
if (d->exec && !strcmp(d->exec, exec)) break;
if (!d)
@ -500,7 +500,7 @@ _hist_items_get_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data
if (!p->apps_all)
p->apps_all = _desktop_list_get();
EINA_LIST_FOREACH(p->apps_all, ll, d)
EINA_LIST_FOREACH (p->apps_all, ll, d)
if (d->exec && !strcmp(d->exec, exec)) break;
if (d)
@ -582,15 +582,15 @@ _finish(Evry_Plugin *plugin)
if ((!p->browse) && (p->menu))
efreet_menu_free(p->menu);
EINA_LIST_FREE(p->apps_all, desktop)
EINA_LIST_FREE (p->apps_all, desktop)
efreet_desktop_free(desktop);
EINA_LIST_FREE(p->apps_hist, desktop);
EINA_LIST_FREE (p->apps_hist, desktop) ;
EINA_LIST_FREE(p->apps_mime, desktop)
EINA_LIST_FREE (p->apps_mime, desktop)
efreet_desktop_free(desktop);
EINA_LIST_FREE(p->menu_items, it)
EINA_LIST_FREE (p->menu_items, it)
EVRY_ITEM_FREE(it);
E_FREE(p);
@ -634,7 +634,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
_desktop_list_add(p, p->apps_hist, NULL);
}
EINA_LIST_FOREACH(plugin->items, l, it)
EINA_LIST_FOREACH (plugin->items, l, it)
evry->history_item_usage_set(it, input, NULL);
EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort);
@ -642,7 +642,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
if ((p->menu) && (!p->menu_items))
{
EINA_LIST_FOREACH(p->menu->entries, l, entry)
EINA_LIST_FOREACH (p->menu->entries, l, entry)
{
if (entry->type == EFREET_MENU_ENTRY_DESKTOP)
{
@ -659,8 +659,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
}
}
EINA_LIST_FOREACH(p->menu_items, l, it)
EINA_LIST_FOREACH (p->menu_items, l, it)
{
if (!input)
{
@ -723,7 +722,7 @@ _begin_mime(Evry_Plugin *plugin, const Evry_Item *item)
{
l = efreet_util_desktop_mime_list("text/plain");
EINA_LIST_FREE(l, d)
EINA_LIST_FREE (l, d)
{
if (!eina_list_data_find_list(p->apps_mime, d))
p->apps_mime = eina_list_append(p->apps_mime, d);
@ -736,7 +735,7 @@ _begin_mime(Evry_Plugin *plugin, const Evry_Item *item)
{
l = efreet_util_desktop_mime_list("x-directory/normal");
EINA_LIST_FREE(l, d)
EINA_LIST_FREE (l, d)
{
if (!eina_list_data_find_list(p->apps_mime, d))
p->apps_mime = eina_list_append(p->apps_mime, d);
@ -774,7 +773,7 @@ _finish_mime(Evry_Plugin *plugin)
if (p->added)
eina_hash_free(p->added);
EINA_LIST_FREE(p->apps_mime, desktop)
EINA_LIST_FREE (p->apps_mime, desktop)
efreet_desktop_free(desktop);
E_FREE(p);
@ -792,7 +791,7 @@ _fetch_mime(Evry_Plugin *plugin, const char *input)
/* add apps for a given mimetype */
_desktop_list_add(p, p->apps_mime, input);
EINA_LIST_FOREACH(plugin->items, l, it)
EINA_LIST_FOREACH (plugin->items, l, it)
evry->history_item_usage_set(it, input, NULL);
if (input)
@ -801,7 +800,6 @@ _fetch_mime(Evry_Plugin *plugin, const char *input)
return 1;
}
static int
_complete(Evry_Plugin *plugin __UNUSED__, const Evry_Item *it, char **input)
{
@ -1074,7 +1072,7 @@ _desktop_cache_update(void *data __UNUSED__, int type __UNUSED__, void *event __
{
Efreet_Desktop *d;
EINA_LIST_FREE(apps_cache, d)
EINA_LIST_FREE (apps_cache, d)
efreet_desktop_unref(d);
return EINA_TRUE;
@ -1101,7 +1099,6 @@ _plugins_init(const Evry_API *api)
evry->plugin_register(p, EVRY_PLUGIN_SUBJECT, 1);
_plugins = eina_list_append(_plugins, p);
p = EVRY_PLUGIN_BASE("Exebuf", _module_icon, EVRY_TYPE_APP,
_begin_exe, _finish_exe, _fetch_exe);
p->complete = &_complete;
@ -1184,7 +1181,7 @@ _plugins_init(const Evry_API *api)
_check_executable);
_actions = eina_list_append(_actions, act);
EINA_LIST_FOREACH(_actions, l, act)
EINA_LIST_FOREACH (_actions, l, act)
evry->action_register(act, prio++);
handlers = eina_list_append
@ -1202,16 +1199,16 @@ _plugins_shutdown(void)
Efreet_Desktop *d;
Ecore_Event_Handler *h;
EINA_LIST_FREE(apps_cache, d)
EINA_LIST_FREE (apps_cache, d)
efreet_desktop_unref(d);
EINA_LIST_FREE(_plugins, p)
EINA_LIST_FREE (_plugins, p)
EVRY_PLUGIN_FREE(p);
EINA_LIST_FREE(_actions, act)
EINA_LIST_FREE (_actions, act)
EVRY_ACTION_FREE(act);
EINA_LIST_FREE(handlers, h)
EINA_LIST_FREE (handlers, h)
ecore_event_handler_del(h);
}
@ -1298,7 +1295,6 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *e, E_Config_Dialog_Data *cf
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
#define CP(_name) cfdata->_name = strdup(_conf->_name);
#define C(_name) cfdata->_name = _conf->_name;
CP(cmd_terminal);
@ -1383,7 +1379,6 @@ _conf_init(E_Module *m)
_conf = e_config_domain_load("module.everything-apps", conf_edd);
if (_conf && !e_util_module_config_check(_("Everything Applications"),
_conf->version,
MOD_CONFIG_FILE_VERSION))
@ -1449,7 +1444,6 @@ evry_plug_apps_save(void)
/***************************************************************************/
/* taken from e_exebuf.c */
static Eina_Bool
_scan_idler(void *data __UNUSED__)
@ -1578,7 +1572,7 @@ _scan_executables()
{
E_Exe *ee;
EINA_LIST_FREE(el->list, ee)
EINA_LIST_FREE (el->list, ee)
{
exe_list = eina_list_append(exe_list, strdup(ee->path));
eina_stringshare_del(ee->path);
@ -1607,3 +1601,4 @@ _scan_executables()
exe_scan_idler = ecore_idler_add(_scan_idler, NULL);
}

View File

@ -41,7 +41,7 @@ _begin(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
{
const char *result;
EINA_LIST_FREE(history, result)
EINA_LIST_FREE (history, result)
{
it = EVRY_ITEM_NEW(Evry_Item, p, result, NULL, NULL);
it->context = eina_stringshare_ref(p->base.name);
@ -89,7 +89,7 @@ _finish(Evry_Plugin *plugin)
Evry_Item *it;
int items = 0;
EINA_LIST_FREE(p->base.items, it)
EINA_LIST_FREE (p->base.items, it)
{
if ((items++ > 1) && (items < 10))
history = eina_list_prepend(history, eina_stringshare_add(it->label));
@ -97,7 +97,7 @@ _finish(Evry_Plugin *plugin)
EVRY_ITEM_FREE(it);
}
EINA_LIST_FREE(handlers, h)
EINA_LIST_FREE (handlers, h)
ecore_event_handler_del(h);
if (exe)
@ -130,7 +130,7 @@ _cb_action_performed(__UNUSED__ void *data, __UNUSED__ int type, void *event)
{
it = p->items->data;
EINA_LIST_FOREACH(p->items->next, l, it2)
EINA_LIST_FOREACH (p->items->next, l, it2)
{
if (!strcmp(it->label, it2->label))
{
@ -203,7 +203,8 @@ _cb_data(void *data, int type __UNUSED__, void *event)
p->items = eina_list_prepend(p->items, cur_item);
EVRY_PLUGIN_UPDATE(p, EVRY_UPDATE_ADD);
}
else if (it) evry->item_changed(it, 0, 0);
else if (it)
evry->item_changed(it, 0, 0);
}
return ECORE_CALLBACK_PASS_ON;
@ -295,3 +296,4 @@ evry_plug_calc_shutdown(void)
void
evry_plug_calc_save(void){}

View File

@ -17,7 +17,7 @@ _action(Evry_Action *act)
static int
_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
{
return (it && it->label && (strlen(it->label) > 0));
return it && it->label && (strlen(it->label) > 0);
}
Eina_Bool
@ -48,3 +48,4 @@ evry_plug_clipboard_shutdown(void)
ecore_x_window_free(clipboard_win);
evry_action_free(act);
}

View File

@ -1,6 +1,5 @@
#include "e_mod_main.h"
typedef struct _Plugin Plugin;
struct _Plugin
@ -75,7 +74,7 @@ _begin(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
EVRY_PLUGIN_INSTANCE(p, plugin);
EINA_LIST_FOREACH(plugin->config->plugins, l, pc)
EINA_LIST_FOREACH (plugin->config->plugins, l, pc)
_add_item(p, pc);
return EVRY_PLUGIN(p);
@ -90,7 +89,7 @@ _begin_all(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
EVRY_PLUGIN_INSTANCE(p, plugin);
EINA_LIST_FOREACH(evry_conf->conf_subjects, l, pc)
EINA_LIST_FOREACH (evry_conf->conf_subjects, l, pc)
{
if (!strcmp(pc->name, "All") ||
!strcmp(pc->name, "Actions") ||
@ -113,7 +112,7 @@ _finish(Evry_Plugin *plugin)
EVRY_PLUGIN_ITEMS_CLEAR(p);
EINA_LIST_FREE(p->plugins, it)
EINA_LIST_FREE (p->plugins, it)
EVRY_ITEM_FREE(it);
E_FREE(p);
@ -181,7 +180,7 @@ evry_plug_collection_init(void)
p->config->view_mode = VIEW_MODE_THUMB;
}
EINA_LIST_FOREACH(evry_conf->collections, l, pc)
EINA_LIST_FOREACH (evry_conf->collections, l, pc)
{
p = _add_plugin(pc->name);
EVRY_ITEM_ICON_SET(p, "start-here");
@ -200,7 +199,7 @@ evry_plug_collection_shutdown(void)
{
Evry_Plugin *p;
EINA_LIST_FREE(plugins, p)
EINA_LIST_FREE (plugins, p)
{
if (p->config_path)
{
@ -211,3 +210,4 @@ evry_plug_collection_shutdown(void)
EVRY_PLUGIN_FREE(p);
}
}

View File

@ -1,8 +1,8 @@
/***************************************************
TODO option for maximum items to cache
TODO keep common list for recent file instances
FIXME
*/
FIXME
*/
#include "e.h"
#include "evry_api.h"
@ -126,7 +126,6 @@ _item_fill(Evry_Item_File *file)
if (!EVRY_ITEM(file)->detail)
evry->util_file_detail_set(file);
evry->util_file_detail_set(file);
}
@ -144,7 +143,7 @@ _cb_sort(const void *data1, const void *data2)
if (it1->fuzzy_match && it2->fuzzy_match)
if (it1->fuzzy_match - it2->fuzzy_match)
return (it1->fuzzy_match - it2->fuzzy_match);
return it1->fuzzy_match - it2->fuzzy_match;
return strcasecmp(it1->label, it2->label);
}
@ -181,7 +180,7 @@ _scan_func(void *data, Ecore_Thread *thread)
if (!(ls = eina_file_stat_ls(d->directory)))
return;
EINA_ITERATOR_FOREACH(ls, info)
EINA_ITERATOR_FOREACH (ls, info)
{
if ((d->plugin->show_hidden) != (*(info->path + info->name_start) == '.'))
continue;
@ -210,7 +209,7 @@ _scan_mime_func(void *data, Ecore_Thread *thread)
Eina_List *l;
int cnt = 0;
EINA_LIST_FOREACH(d->files, l, file)
EINA_LIST_FOREACH (d->files, l, file)
{
if (ecore_thread_check(thread))
break;
@ -247,7 +246,7 @@ _files_filter(Plugin *p)
return 0;
}
EINA_LIST_FOREACH(p->files, l, it)
EINA_LIST_FOREACH (p->files, l, it)
{
if (cnt >= MAX_SHOWN) break;
@ -283,7 +282,7 @@ _scan_cancel_func(void *data, Ecore_Thread *thread __UNUSED__)
/* EINA_LIST_FREE(p->files, file)
* EVRY_ITEM_FREE(file); */
EINA_LIST_FREE(d->files, file)
EINA_LIST_FREE (d->files, file)
{
if (file->base.label) free((char *)(file->base.label));
if (file->path) free((char *)file->path);
@ -308,7 +307,7 @@ _cache_mime_get(History_Types *ht, Evry_Item_File *file)
if ((he = eina_hash_find(ht->types, file->path)))
{
EINA_LIST_FOREACH(he->items, l, hi)
EINA_LIST_FOREACH (he->items, l, hi)
{
if (!hi->data)
continue;
@ -331,7 +330,7 @@ _cache_dir_add(Eina_List *files)
History_Item *hi;
int cnt = 0;
EINA_LIST_REVERSE_FOREACH(files, l, item)
EINA_LIST_REVERSE_FOREACH (files, l, item)
{
GET_FILE(file, item);
@ -339,7 +338,7 @@ _cache_dir_add(Eina_List *files)
(hi = evry->history_item_add(item, NULL, NULL)))
{
hi->last_used = SIX_DAYS_AGO;
hi->usage = MIN_USAGE * (double) cnt++;
hi->usage = MIN_USAGE * (double)cnt++;
hi->data = eina_stringshare_ref(file->mime);
item->hi = hi;
}
@ -347,7 +346,7 @@ _cache_dir_add(Eina_List *files)
(item->hi->last_used < SIX_DAYS_AGO))
{
item->hi->last_used = SIX_DAYS_AGO;
item->hi->usage = MIN_USAGE * (double) cnt++;
item->hi->usage = MIN_USAGE * (double)cnt++;
}
}
}
@ -358,7 +357,7 @@ _file_add(Plugin *p, Evry_Item *item)
GET_FILE(file, item);
char *filename = (char *)item->label;
char *path = (char *) file->path;
char *path = (char *)file->path;
file->path = eina_stringshare_add(path);
file->mime = eina_stringshare_ref(file->mime);
@ -390,7 +389,7 @@ _scan_end_func(void *data, Ecore_Thread *thread __UNUSED__)
if (!d->run_cnt) /* _scan_func finished */
{
EINA_LIST_FOREACH_SAFE(d->files, l, ll, item)
EINA_LIST_FOREACH_SAFE (d->files, l, ll, item)
{
GET_FILE(file, item);
@ -412,10 +411,10 @@ _scan_end_func(void *data, Ecore_Thread *thread __UNUSED__)
}
else /* _scan_mime_func finished */
{
EINA_LIST_FREE(d->files, file)
EINA_LIST_FREE (d->files, file)
{
if (!file->mime) break;
_file_add(p, (Evry_Item*) file);
_file_add(p, (Evry_Item *)file);
}
}
@ -457,7 +456,7 @@ _dir_watcher(void *data, Ecore_File_Monitor *em __UNUSED__, Ecore_File_Event eve
switch (event)
{
case ECORE_FILE_EVENT_DELETED_SELF:
EINA_LIST_FREE(p->files, file)
EINA_LIST_FREE (p->files, file)
evry->item_free(EVRY_ITEM(file));
break;
@ -479,7 +478,7 @@ _dir_watcher(void *data, Ecore_File_Monitor *em __UNUSED__, Ecore_File_Event eve
case ECORE_FILE_EVENT_DELETED_DIRECTORY:
label = eina_stringshare_add(path);
EINA_LIST_FOREACH_SAFE(p->files, l, ll, file)
EINA_LIST_FOREACH_SAFE (p->files, l, ll, file)
{
if (file->path != label) continue;
@ -627,7 +626,7 @@ _free_files(Plugin *p)
ecore_thread_cancel(p->thread);
p->thread = NULL;
EINA_LIST_FREE(p->files, file)
EINA_LIST_FREE (p->files, file)
EVRY_ITEM_FREE(file);
if (p->dir_mon)
@ -690,7 +689,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
return 0;
}
int len = strlen(p->directory);
len = (len == 1) ? len : len+1;
len = (len == 1) ? len : len + 1;
p->input = eina_stringshare_add(input + len);
}
@ -780,11 +779,11 @@ _cb_sort_recent(const void *data1, const void *data2)
return 1;
if (it1->hi && it2->hi)
return (it1->hi->last_used > it2->hi->last_used ? -1 : 1);
return it1->hi->last_used > it2->hi->last_used ? -1 : 1;
if (it1->fuzzy_match && it2->fuzzy_match)
if (it1->fuzzy_match - it2->fuzzy_match)
return (it1->fuzzy_match - it2->fuzzy_match);
return it1->fuzzy_match - it2->fuzzy_match;
return strcasecmp(it1->label, it2->label);
}
@ -799,7 +798,7 @@ _recentf_files_filter(Plugin *p)
EVRY_PLUGIN_ITEMS_CLEAR(p);
EINA_LIST_FOREACH(p->files, l, it)
EINA_LIST_FOREACH (p->files, l, it)
{
if (p->dirs_only && !it->browseable)
continue;
@ -833,7 +832,7 @@ _recentf_files_filter(Plugin *p)
new = eina_list_sort(new, -1, _cb_sort_recent);
EINA_LIST_FREE(new, it)
EINA_LIST_FREE (new, it)
{
if (cnt++ < MAX_SHOWN)
EVRY_PLUGIN_ITEM_APPEND(p, it);
@ -842,7 +841,6 @@ _recentf_files_filter(Plugin *p)
return cnt;
}
#if 0
/* use thread only to not block ui for ecore_file_exists ... */
@ -853,7 +851,7 @@ _recentf_func(void *data)
Eina_List *l;
Evry_Item_File *file;
EINA_LIST_FOREACH(d->files, l, file)
EINA_LIST_FOREACH (d->files, l, file)
{
if ((!evry->file_path_get(file)) ||
(!ecore_file_exists(file->path)))
@ -871,7 +869,7 @@ _recentf_cancel_func(void *data)
Plugin *p = d->plugin;
Evry_Item_File *file;
EINA_LIST_FREE(d->files, file)
EINA_LIST_FREE (d->files, file)
EVRY_ITEM_FREE(file);
E_FREE(d);
@ -887,7 +885,7 @@ _recentf_end_func(void *data)
Plugin *p = d->plugin;
Evry_Item *it;
EINA_LIST_FREE(d->files, it)
EINA_LIST_FREE (d->files, it)
{
GET_FILE(file, it);
@ -912,6 +910,7 @@ _recentf_end_func(void *data)
p->thread = NULL;
E_FREE(d);
}
#endif
static Eina_Bool
@ -928,7 +927,7 @@ _recentf_items_add_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *d
const char *path;
int match = 0;
EINA_LIST_FOREACH(he->items, l, hi2)
EINA_LIST_FOREACH (he->items, l, hi2)
if (hi2->last_used > last_used)
{
last_used = hi2->last_used;
@ -962,14 +961,14 @@ _recentf_items_add_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *d
return EINA_TRUE;
}
path = (const char *) key;
path = (const char *)key;
if (!(label = ecore_file_file_get(path)))
return EINA_TRUE;
path = eina_stringshare_add(path);
EINA_LIST_FOREACH(p->files, ll, file)
EINA_LIST_FOREACH (p->files, ll, file)
{
if (file->path == path)
{
@ -1105,7 +1104,7 @@ _recentf_fetch(Evry_Plugin *plugin, const char *input)
Data *d = E_NEW(Data, 1);
d->plugin = p;
eina_hash_foreach(ht->types, _recentf_items_add_cb, d);
EINA_LIST_FREE(d->files, file)
EINA_LIST_FREE (d->files, file)
p->files = eina_list_append(p->files, file);
E_FREE(d);
@ -1130,7 +1129,7 @@ _recentf_fetch(Evry_Plugin *plugin, const char *input)
static int
_open_folder_check(Evry_Action *act __UNUSED__, const Evry_Item *it)
{
return (it->browseable && e_action_find("fileman"));
return it->browseable && e_action_find("fileman");
}
static int
@ -1185,7 +1184,7 @@ _file_trash_action(Evry_Action *act)
efreet_uri_free(euri);
}
return (ok > 0);
return ok > 0;
}
static int
@ -1234,7 +1233,7 @@ _sort_by_date(Plugin *p)
Evry_Item_File *file;
struct stat s;
EINA_LIST_FOREACH(p->files, l, file)
EINA_LIST_FOREACH (p->files, l, file)
{
if (file->modified)
continue;
@ -1249,22 +1248,21 @@ _sort_by_date(Plugin *p)
_files_filter(p);
EVRY_PLUGIN_UPDATE(p, EVRY_UPDATE_ADD);
}
static void
_sort_by_name(Plugin *p)
{
Eina_List *l;
Evry_Item *it;
EINA_LIST_FOREACH(p->files, l, it)
EINA_LIST_FOREACH (p->files, l, it)
it->usage = 0;
p->files = eina_list_sort(p->files, -1, _cb_sort);
_files_filter(p);
EVRY_PLUGIN_UPDATE(p, EVRY_UPDATE_ADD);
}
static int
@ -1304,7 +1302,6 @@ _cb_key_down(Evry_Plugin *plugin, const Ecore_Event_Key *ev)
return 0;
}
static int
_plugins_init(const Evry_API *api)
{
@ -1356,7 +1353,6 @@ _plugins_init(const Evry_API *api)
#undef ACTION_NEW
p = EVRY_PLUGIN_BASE("Files", _module_icon, EVRY_TYPE_FILE,
_begin, _finish, _fetch);
p->input_type = EVRY_TYPE_FILE;
@ -1370,7 +1366,6 @@ _plugins_init(const Evry_API *api)
if (evry->plugin_register(p, EVRY_PLUGIN_SUBJECT, 2))
p->config->min_query = 1;
p = EVRY_PLUGIN_BASE("Files", _module_icon, EVRY_TYPE_FILE,
_begin, _finish, _fetch);
p->cb_key_down = &_cb_key_down;
@ -1421,18 +1416,17 @@ _plugins_shutdown(void)
eina_stringshare_del(_mime_mount);
eina_stringshare_del(_mime_unknown);
EINA_LIST_FREE(_plugins, p)
EINA_LIST_FREE (_plugins, p)
{
if (p->actions)
eina_list_free(p->actions);
EVRY_PLUGIN_FREE(p);
}
EINA_LIST_FREE(_actions, act)
EINA_LIST_FREE (_actions, act)
evry->action_free(act);
}
/***************************************************************************/
static E_Config_DD *conf_edd = NULL;
@ -1516,20 +1510,19 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
NULL, NULL);
e_widget_framelist_object_append(of, ow);
e_widget_list_object_append(o, of, 1, 1, 0.5);
return o;
}
static void *
_create_data(E_Config_Dialog *cfd __UNUSED__)
{
{
E_Config_Dialog_Data *cfdata = NULL;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
_fill_data(cfdata);
return cfdata;
}
}
static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
@ -1664,3 +1657,4 @@ evry_plug_files_save(void)
{
e_config_domain_save("module.everything-files", conf_edd, _conf);
}

View File

@ -34,10 +34,10 @@ _finish(Evry_Plugin *plugin)
EVRY_PLUGIN_ITEMS_CLEAR(p);
EINA_LIST_FREE(p->items, it)
EINA_LIST_FREE (p->items, it)
EVRY_ITEM_FREE(it);
EINA_LIST_FREE(p->categories, it)
EINA_LIST_FREE (p->categories, it)
EVRY_ITEM_FREE(it);
E_FREE(p);
@ -46,7 +46,7 @@ _finish(Evry_Plugin *plugin)
static Evas_Object *
_icon_get(Evry_Item *item, Evas *e __UNUSED__)
{
Settings_Item *it = (Settings_Item *) item;
Settings_Item *it = (Settings_Item *)item;
if (!item->icon)
{
@ -69,14 +69,14 @@ _browse(Evry_Plugin *plugin, const Evry_Item *item)
if (!CHECK_TYPE(item, E_SETTINGS))
return NULL;
it = (Settings_Item *) item;
it = (Settings_Item *)item;
EVRY_PLUGIN_INSTANCE(p, plugin);
p->parent = EINA_TRUE;
GET_PLUGIN(parent, item->plugin);
EINA_LIST_FOREACH(parent->items, l, it2)
EINA_LIST_FOREACH (parent->items, l, it2)
{
if (it2->ecat == it->ecat)
{
@ -117,7 +117,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
E_Configure_Cat *ecat;
E_Configure_It *eci;
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
EINA_LIST_FOREACH (e_configure_registry, l, ecat)
{
if ((ecat->pri < 0) || (!ecat->items)) continue;
if (!strcmp(ecat->cat, "system")) continue;
@ -127,7 +127,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
EVRY_ITEM(it)->browseable = EINA_TRUE;
p->categories = eina_list_append(p->categories, it);
EINA_LIST_FOREACH(ecat->items, ll, eci)
EINA_LIST_FOREACH (ecat->items, ll, eci)
{
if (eci->pri < 0) continue;
@ -152,7 +152,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
static int
_action_check(Evry_Action *act __UNUSED__, const Evry_Item *item)
{
return !!(((Settings_Item*)item)->eci);
return !!(((Settings_Item *)item)->eci);
}
static int
@ -161,7 +161,7 @@ _action(Evry_Action *act)
char buf[1024];
Settings_Item *it;
it = (Settings_Item *) act->it1.item;
it = (Settings_Item *)act->it1.item;
snprintf(buf, sizeof(buf), "%s/%s", it->ecat->cat, it->eci->item);
@ -200,7 +200,6 @@ _plugins_shutdown(void)
EVRY_ACTION_FREE(act);
}
/***************************************************************************/
Eina_Bool
@ -221,3 +220,4 @@ evry_plug_settings_shutdown(void)
void
evry_plug_settings_save(void){}

View File

@ -91,3 +91,4 @@ evry_plug_text_shutdown(void)
EVRY_PLUGIN_FREE(p1);
EVRY_PLUGIN_FREE(p2);
}

View File

@ -33,8 +33,7 @@ static Evas_Object *_icon_get(Evry_Item *it, Evas *e);
/***************************************************************************/
#define GET_BORDER(_bd, _it) Border_Item *_bd = (Border_Item *)_it;
#define GET_BORDER(_bd, _it) Border_Item * _bd = (Border_Item *)_it;
static void
_border_item_free(Evry_Item *it)
@ -81,7 +80,7 @@ _cb_border_remove(void *data, __UNUSED__ int type, void *event)
Eina_List *l;
Plugin *p = data;
EINA_LIST_FOREACH(p->borders, l, bi)
EINA_LIST_FOREACH (p->borders, l, bi)
if (bi->border == ev->border)
break;
@ -98,6 +97,7 @@ _cb_border_remove(void *data, __UNUSED__ int type, void *event)
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_cb_border_add(void *data, __UNUSED__ int type, void *event)
{
@ -116,7 +116,6 @@ _cb_border_add(void *data, __UNUSED__ int type, void *event)
return ECORE_CALLBACK_PASS_ON;
}
static Evry_Plugin *
_begin(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
{
@ -134,7 +133,7 @@ _begin(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
(p->handlers, ecore_event_handler_add
(E_EVENT_BORDER_ADD, _cb_border_add, p));
EINA_LIST_FOREACH(e_border_focus_stack_get(), l, bd)
EINA_LIST_FOREACH (e_border_focus_stack_get(), l, bd)
_border_item_add(p, bd);
return EVRY_PLUGIN(p);
@ -152,10 +151,10 @@ _finish(Evry_Plugin *plugin)
EVRY_PLUGIN_ITEMS_CLEAR(p);
EINA_LIST_FREE(p->borders, bi)
EINA_LIST_FREE (p->borders, bi)
EVRY_ITEM_FREE(bi);
EINA_LIST_FREE(p->handlers, h)
EINA_LIST_FREE (p->handlers, h)
ecore_event_handler_del(h);
E_FREE(p);
@ -243,7 +242,7 @@ _icon_get(Evry_Item *it, Evas *e)
if (o) return o;
}
_use_netwm_icon:
_use_netwm_icon:
if (bd->client.netwm.icons)
{
int i, size, tmp, found = 0;
@ -276,7 +275,6 @@ _icon_get(Evry_Item *it, Evas *e)
return o;
}
/***************************************************************************/
static int
@ -369,6 +367,7 @@ _act_border(Evry_Action *act)
e_border_desk_set(bd, e_desk_current_get(zone));
focus = 1;
break;
default:
break;
}
@ -474,7 +473,7 @@ _plugins_shutdown(void)
EVRY_PLUGIN_FREE(_plug);
EINA_LIST_FREE(_actions, act)
EINA_LIST_FREE (_actions, act)
EVRY_ACTION_FREE(act);
}
@ -496,3 +495,4 @@ evry_plug_windows_shutdown(void)
void
evry_plug_windows_save(void){}

View File

@ -13,11 +13,10 @@ evry_plugins_shutdown(void)
{
Evry_Action *act;
EINA_LIST_FREE(actions, act)
EINA_LIST_FREE (actions, act)
evry_action_free(act);
}
static int
_evry_cb_plugin_sort(const void *data1, const void *data2)
{
@ -47,10 +46,10 @@ _evry_plugin_free(Evry_Item *it)
Evry_Plugin *
evry_plugin_new(Evry_Plugin *base, const char *name, const char *label,
const char *icon, Evry_Type item_type,
Evry_Plugin *(*begin) (Evry_Plugin *p, const Evry_Item *item),
void (*finish) (Evry_Plugin *p),
int (*fetch) (Evry_Plugin *p, const char *input),
void (*cb_free) (Evry_Plugin *p))
Evry_Plugin *(*begin)(Evry_Plugin * p, const Evry_Item * item),
void (*finish)(Evry_Plugin *p),
int (*fetch)(Evry_Plugin *p, const char *input),
void (*cb_free)(Evry_Plugin *p))
{
Evry_Plugin *p;
Evry_Item *it;
@ -134,7 +133,7 @@ evry_plugin_register(Evry_Plugin *p, int type, int priority)
else if (type == EVRY_PLUGIN_OBJECT)
conf = evry_conf->conf_objects;
EINA_LIST_FOREACH(conf, l, pc)
EINA_LIST_FOREACH (conf, l, pc)
if (pc->name && p->name && !strcmp(pc->name, p->name))
break;
@ -227,7 +226,7 @@ evry_plugin_find(const char *name)
Eina_List *l;
const char *n = eina_stringshare_add(name);
EINA_LIST_FOREACH(evry_conf->conf_subjects, l, pc)
EINA_LIST_FOREACH (evry_conf->conf_subjects, l, pc)
{
if (!pc->plugin) continue;
if (pc->name == n)
@ -240,3 +239,4 @@ evry_plugin_find(const char *name)
return pc->plugin;
}

View File

@ -73,14 +73,14 @@ evry_fuzzy_match(const char *str, const char *match)
return 0;
/* remove white spaces at the beginning */
for (; (*match != 0) && isspace(*match); match++);
for (; (*str != 0) && isspace(*str); str++);
for (; (*match != 0) && isspace(*match); match++) ;
for (; (*str != 0) && isspace(*str); str++) ;
/* count words in match */
for (m = match; (*m != 0) && (m_num < MAX_WORDS);)
for (m = match; (*m != 0) && (m_num < MAX_WORDS); )
{
for (; (*m != 0) && !isspace(*m); m++);
for (; (*m != 0) && isspace(*m); m++);
for (; (*m != 0) && !isspace(*m); m++) ;
for (; (*m != 0) && isspace(*m); m++) ;
m_min[m_num++] = MAX_FUZZ;
}
for (m = match; ip && (*m != 0); m++)
@ -94,7 +94,7 @@ evry_fuzzy_match(const char *str, const char *match)
next = str;
m = match;
while((m_cnt < m_num) && (*next != 0))
while ((m_cnt < m_num) && (*next != 0))
{
/* reset match */
if (m_cnt == 0) m = match;
@ -117,15 +117,15 @@ evry_fuzzy_match(const char *str, const char *match)
if (m_cnt < m_num - 1)
{
/* test next match */
for (; (*m != 0) && !isspace(*m); m++);
for (; (*m != 0) && isspace(*m); m++);
for (; (*m != 0) && !isspace(*m); m++) ;
for (; (*m != 0) && isspace(*m); m++) ;
m_cnt++;
break;
}
else
{
/* go to next word */
for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p++);
for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p++) ;
cnt++;
next = p;
m_cnt = 0;
@ -172,21 +172,21 @@ evry_fuzzy_match(const char *str, const char *match)
else
{
/* go to next match */
for (; (*m != 0) && !isspace(*m); m++);
for (; (*m != 0) && !isspace(*m); m++) ;
}
if (m_cnt < m_num - 1)
{
/* test next match */
for (; (*m != 0) && isspace(*m); m++);
for (; (*m != 0) && isspace(*m); m++) ;
m_cnt++;
break;
}
else if(*p != 0)
else if (*p != 0)
{
/* go to next word */
for (; (*p != 0) && !((isspace(*p) || (ip && ispunct(*p)))); p++);
for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p++);
for (; (*p != 0) && !((isspace(*p) || (ip && ispunct(*p)))); p++) ;
for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p++) ;
cnt++;
next = p;
m_cnt = 0;
@ -228,7 +228,7 @@ _evry_fuzzy_match_sort_cb(const void *data1, const void *data2)
const Evry_Item *it2 = data2;
if (it1->priority - it2->priority)
return (it1->priority - it2->priority);
return it1->priority - it2->priority;
if (it1->fuzzy_match || it2->fuzzy_match)
{
@ -239,7 +239,7 @@ _evry_fuzzy_match_sort_cb(const void *data1, const void *data2)
return 1;
if (it1->fuzzy_match - it2->fuzzy_match)
return (it1->fuzzy_match - it2->fuzzy_match);
return it1->fuzzy_match - it2->fuzzy_match;
}
return 0;
@ -251,7 +251,6 @@ evry_fuzzy_match_sort(Eina_List *items)
return eina_list_sort(items, -1, _evry_fuzzy_match_sort_cb);
}
static int _sort_flags = 0;
static int
@ -311,7 +310,7 @@ _evry_items_sort_func(const void *data1, const void *data2)
int prio2 = it2->plugin->config->priority;
if (prio1 - prio2)
return (prio1 - prio2);
return prio1 - prio2;
}
}
@ -326,26 +325,26 @@ _evry_items_sort_func(const void *data1, const void *data2)
return 1;
if (abs (it1->fuzzy_match - it2->fuzzy_match) > 5)
return (it1->fuzzy_match - it2->fuzzy_match);
return it1->fuzzy_match - it2->fuzzy_match;
}
/* sort recently/most frequently used items first */
if (it1->usage > 0.0 || it2->usage > 0.0)
{
return (it1->usage > it2->usage ? -1 : 1);
return it1->usage > it2->usage ? -1 : 1;
}
/* sort items which match input better first */
if (it1->fuzzy_match > 0 || it2->fuzzy_match > 0)
{
if (it1->fuzzy_match - it2->fuzzy_match)
return (it1->fuzzy_match - it2->fuzzy_match);
return it1->fuzzy_match - it2->fuzzy_match;
}
/* sort itemswith higher priority first */
if ((it1->plugin == it2->plugin) &&
(it1->priority - it2->priority))
return (it1->priority - it2->priority);
return it1->priority - it2->priority;
/* sort items with higher plugin priority first */
if (it1->type != EVRY_TYPE_ACTION &&
@ -355,7 +354,7 @@ _evry_items_sort_func(const void *data1, const void *data2)
int prio2 = it2->plugin->config->priority;
if (prio1 - prio2)
return (prio1 - prio2);
return prio1 - prio2;
}
return strcasecmp(it1->label, it2->label);
@ -377,7 +376,7 @@ evry_util_plugin_items_add(Evry_Plugin *p, Eina_List *items, const char *input,
Evry_Item *it;
int match = 0;
EINA_LIST_FOREACH(items, l, it)
EINA_LIST_FOREACH (items, l, it)
{
it->fuzzy_match = 0;
@ -438,7 +437,6 @@ evry_icon_theme_get(const char *icon, Evas *e)
return o;
}
Evas_Object *
evry_util_icon_get(Evry_Item *it, Evas *e)
{
@ -470,7 +468,7 @@ evry_util_icon_get(Evry_Item *it, Evas *e)
}
if ((!it->icon) && (file->mime) &&
(/*(!strncmp(file->mime, "image/", 6)) || */
( /*(!strncmp(file->mime, "image/", 6)) || */
(!strncmp(file->mime, "video/", 6)) ||
(!strncmp(file->mime, "application/pdf", 15))) &&
(evry_file_url_get(file)))
@ -559,7 +557,7 @@ evry_util_exec_app(const Evry_Item *it_app, const Evry_Item *it_file)
opens folders, pass only the dir */
if (!IS_BROWSEABLE(file))
{
EINA_LIST_FOREACH(app->desktop->mime_types, l, mime)
EINA_LIST_FOREACH (app->desktop->mime_types, l, mime)
{
if (!mime)
continue;
@ -619,7 +617,7 @@ evry_util_exec_app(const Evry_Item *it_app, const Evry_Item *it_file)
}
else
{
exe = (char *) app->file;
exe = (char *)app->file;
e_exec(zone, NULL, exe, NULL, NULL);
}
}
@ -637,24 +635,24 @@ evry_util_exec_app(const Evry_Item *it_app, const Evry_Item *it_file)
* If length == 0, the length is assumed to be strlen(string).
* If olen == NULL, no output length is stored.
*/
#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
#define ISXDIGIT(x) (isxdigit((int)((unsigned char)x)))
char *
evry_util_url_unescape(const char *string, int length)
{
int alloc = (length?length:(int)strlen(string))+1;
int alloc = (length ? length : (int)strlen(string)) + 1;
char *ns = malloc(alloc);
unsigned char in;
int strindex=0;
int strindex = 0;
unsigned long hex;
if( !ns )
if ( !ns )
return NULL;
while(--alloc > 0)
while (--alloc > 0)
{
in = *string;
if(('%' == in) && ISXDIGIT(string[1]) && ISXDIGIT(string[2]))
if (('%' == in) && ISXDIGIT(string[1]) && ISXDIGIT(string[2]))
{
/* this is two hexadecimal digits following a '%' */
char hexstr[3];
@ -664,17 +662,17 @@ evry_util_url_unescape(const char *string, int length)
hexstr[2] = 0;
hex = strtoul(hexstr, &ptr, 16);
in = (unsigned char)(hex & (unsigned long) 0xFF);
in = (unsigned char)(hex & (unsigned long)0xFF);
// in = ultouc(hex); /* this long is never bigger than 255 anyway */
string+=2;
alloc-=2;
string += 2;
alloc -= 2;
}
ns[strindex++] = in;
string++;
}
ns[strindex]=0; /* terminate it */
ns[strindex] = 0; /* terminate it */
return ns;
}
@ -686,19 +684,70 @@ _isalnum(unsigned char in)
{
switch (in)
{
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case 'a': case 'b': case 'c': case 'd': case 'e':
case 'f': case 'g': case 'h': case 'i': case 'j':
case 'k': case 'l': case 'm': case 'n': case 'o':
case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
case 'K': case 'L': case 'M': case 'N': case 'O':
case 'P': case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
return EINA_TRUE;
default:
break;
}
@ -708,38 +757,38 @@ _isalnum(unsigned char in)
char *
evry_util_url_escape(const char *string, int inlength)
{
size_t alloc = (inlength?(size_t)inlength:strlen(string))+1;
size_t alloc = (inlength ? (size_t)inlength : strlen(string)) + 1;
char *ns;
char *testing_ptr = NULL;
unsigned char in; /* we need to treat the characters unsigned */
size_t newlen = alloc;
int strindex=0;
int strindex = 0;
size_t length;
ns = malloc(alloc);
if(!ns)
if (!ns)
return NULL;
length = alloc-1;
while(length--)
length = alloc - 1;
while (length--)
{
in = *string;
if (_isalnum(in))
{
/* just copy this */
ns[strindex++]=in;
ns[strindex++] = in;
}
else {
/* encode it */
newlen += 2; /* the size grows with two, since this'll become a %XX */
if(newlen > alloc)
if (newlen > alloc)
{
alloc *= 2;
testing_ptr = realloc(ns, alloc);
if(!testing_ptr)
if (!testing_ptr)
{
free( ns );
free(ns);
return NULL;
}
else
@ -750,15 +799,15 @@ evry_util_url_escape(const char *string, int inlength)
snprintf(&ns[strindex], 4, "%%%02X", in);
strindex+=3;
strindex += 3;
}
string++;
}
ns[strindex]=0; /* terminate it */
ns[strindex] = 0; /* terminate it */
return ns;
}
const char*
const char *
evry_file_path_get(Evry_Item_File *file)
{
const char *tmp;
@ -784,7 +833,7 @@ evry_file_path_get(Evry_Item_File *file)
return file->path;
}
const char*
const char *
evry_file_url_get(Evry_Item_File *file)
{
char dest[PATH_MAX * 3 + 7];
@ -850,7 +899,7 @@ evry_util_md5_sum(const char *str)
int n;
char md5out[(2 * MD5_HASHBYTES) + 1];
MD5Init (&ctx);
MD5Update (&ctx, (unsigned char const*)str,
MD5Update (&ctx, (unsigned char const *)str,
(unsigned)strlen (str));
MD5Final (hash, &ctx);
@ -863,3 +912,4 @@ evry_util_md5_sum(const char *str)
return strdup(md5out);
}

View File

@ -7,7 +7,6 @@ typedef struct _Item Item;
#define SIZE_LIST 28
#define SIZE_DETAIL 36
struct _View
{
Evry_View view;
@ -317,7 +316,7 @@ _item_show(View *v, Item *it, Evas_Object *list)
e_icon_size_get(it->image, &it->max_w, &it->max_h);
if ((it->max_w > 0) && (it->max_h > 0))
evas_object_size_hint_max_set(it->image, it->max_w*2, it->max_h*2);
evas_object_size_hint_max_set(it->image, it->max_w * 2, it->max_h * 2);
else
it->max_w = -1;
@ -334,7 +333,6 @@ _item_show(View *v, Item *it, Evas_Object *list)
else it->have_thumb = EINA_TRUE;
}
if ((it->get_thumb) || (CHECK_TYPE(it->item, EVRY_TYPE_FILE) && _check_item(it->item)))
{
char *suffix;
@ -386,7 +384,6 @@ _item_hide(Item *it)
it->visible = EINA_FALSE;
}
static int
_place_items(Smart_Data *sd)
{
@ -419,7 +416,7 @@ _place_items(Smart_Data *sd)
div = sd->w / w;
if (div < 1) div = 1;
ww = w + (sd->w - div * w) / div;
hh = ((double)h/(double)w * (double)ww);
hh = ((double)h / (double)w * (double)ww);
}
else
{
@ -443,7 +440,7 @@ _place_items(Smart_Data *sd)
}
}
EINA_LIST_FOREACH(sd->items, l, it)
EINA_LIST_FOREACH (sd->items, l, it)
{
it->x = x;
it->y = y;
@ -519,13 +516,13 @@ _e_smart_reconfigure_do(void *data)
time = ecore_time_get();
EINA_LIST_FOREACH(sd->items, l, it)
EINA_LIST_FOREACH (sd->items, l, it)
{
xx = sd->x - sd->cx + it->x;
yy = sd->y - sd->cy + it->y;
if (E_INTERSECTS(xx, yy, it->w, it->h, 0, sd->y - it->h*3,
sd->x + sd->w, sd->y + sd->h + it->h*6))
if (E_INTERSECTS(xx, yy, it->w, it->h, 0, sd->y - it->h * 3,
sd->x + sd->w, sd->y + sd->h + it->h * 6))
{
if (!it->visible)
_item_show(sd->view, it, obj);
@ -613,7 +610,7 @@ static void
_e_smart_color_set(Evas_Object *obj __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__){}
static void
_e_smart_clip_set(Evas_Object *obj __UNUSED__, Evas_Object * clip __UNUSED__){}
_e_smart_clip_set(Evas_Object *obj __UNUSED__, Evas_Object *clip __UNUSED__){}
static void
_e_smart_clip_unset(Evas_Object *obj __UNUSED__){}
@ -754,8 +751,8 @@ _animator(void *data)
if (!sd) return ECORE_CALLBACK_CANCEL;
double da;
double spd = ((25.0/ (double)e_config->framerate) /
(double) (1 + sd->view->zoom));
double spd = ((25.0 / (double)e_config->framerate) /
(double)(1 + sd->view->zoom));
if (spd > 0.9) spd = 0.9;
int wait = 0;
@ -782,7 +779,6 @@ _animator(void *data)
_animator_del(data);
return ECORE_CALLBACK_CANCEL;
}
static int
@ -892,14 +888,14 @@ _clear_items(Evas_Object *obj)
_animator_del(obj);
EINA_LIST_FOREACH(sd->items, l, it)
EINA_LIST_FOREACH (sd->items, l, it)
_item_hide(it);
}
static void
_view_clear(Evry_View *view)
{
View *v = (View*) view;
View *v = (View *)view;
Smart_Data *sd = evas_object_smart_data_get(v->span);
Item *it;
if (!sd) return;
@ -913,7 +909,7 @@ _view_clear(Evry_View *view)
if (sd->items)
{
EINA_LIST_FREE(sd->items, it)
EINA_LIST_FREE (sd->items, it)
{
evry_item_free(it->item);
E_FREE(it);
@ -997,14 +993,14 @@ _view_update(Evry_View *view)
}
/* go through current view items */
EINA_LIST_FOREACH(sd->items, l, v_it)
EINA_LIST_FOREACH (sd->items, l, v_it)
{
last_pos = v_it->pos;
v_it->pos = 0;
pos = 1;
/* go through plugins current items */
EINA_LIST_FOREACH(p->items, ll, p_it)
EINA_LIST_FOREACH (p->items, ll, p_it)
{
if (v_it->item == p_it)
{
@ -1022,7 +1018,7 @@ _view_update(Evry_View *view)
{
if (v_it->selected && v_it->frame)
edje_object_signal_emit
(v_it->frame,"e,state,unselected", "e");
(v_it->frame, "e,state,unselected", "e");
v_it->selected = EINA_FALSE;
}
break;
@ -1051,12 +1047,12 @@ _view_update(Evry_View *view)
}
}
EINA_LIST_FREE(v_remove, v_it)
EINA_LIST_FREE (v_remove, v_it)
_pan_item_remove(v->span, v_it);
/* go through plugins current items */
pos = 1;
EINA_LIST_FOREACH(p->items, l, p_it)
EINA_LIST_FOREACH (p->items, l, p_it)
{
/* item is not already in view */
if (!eina_list_data_find_list(v_items, p_it))
@ -1096,7 +1092,7 @@ _view_update(Evry_View *view)
static int
_cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
{
View *v = (View *) view;
View *v = (View *)view;
Smart_Data *sd = evas_object_smart_data_get(v->span);
Eina_List *l = NULL, *ll;
Item *it = NULL;
@ -1188,7 +1184,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
if ((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
(!strcmp(key, "plus")))
{
EINA_LIST_FOREACH(sd->items, ll, it)
EINA_LIST_FOREACH (sd->items, ll, it)
{
if (!it->item->marked)
{
@ -1202,7 +1198,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
else if ((ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) &&
(!strcmp(key, "minus")))
{
EINA_LIST_FOREACH(sd->items, ll, it)
EINA_LIST_FOREACH (sd->items, ll, it)
{
if (it->item->marked)
{
@ -1290,7 +1286,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
(!evry_conf->cycle_mode) &&
(sd->cur_item))
{
EINA_LIST_FOREACH(l, ll, it)
EINA_LIST_FOREACH (l, ll, it)
{
if (it->y > sd->cur_item->y &&
it->x >= sd->cur_item->x)
@ -1314,7 +1310,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
(!evry_conf->cycle_mode) &&
(sd->cur_item))
{
for(ll = l; ll; ll = ll->prev)
for (ll = l; ll; ll = ll->prev)
{
it = ll->data;
@ -1341,7 +1337,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
if (sd->cur_item)
cur = sd->cur_item->y;
EINA_LIST_FOREACH(sd->items, l, it)
EINA_LIST_FOREACH (sd->items, l, it)
{
if (next)
{
@ -1377,7 +1373,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
return 0;
end:
end:
return 1;
}
@ -1391,7 +1387,7 @@ _cb_item_changed(void *data, int type __UNUSED__, void *event)
Smart_Data *sd = evas_object_smart_data_get(v->span);
if (!sd) return ECORE_CALLBACK_PASS_ON;
EINA_LIST_FOREACH(sd->items, l, it)
EINA_LIST_FOREACH (sd->items, l, it)
if (it->item == ev->item)
break;
@ -1437,9 +1433,8 @@ _cb_action_performed(void *data, int type __UNUSED__, void *event)
sd = evas_object_smart_data_get(v->span);
if (!sd) return ECORE_CALLBACK_PASS_ON;
EINA_LIST_FOREACH(sd->items, l, it)
EINA_LIST_FOREACH (sd->items, l, it)
{
if ((it->item == ev->it1) ||
(it->item == ev->it2))
break;
@ -1515,7 +1510,7 @@ _view_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
diff_x = abs(ev->cur.canvas.x - sd->mouse_x);
diff_y = abs(ev->cur.canvas.y - sd->mouse_y);
if (diff_y > 15 + (diff_x/2))
if (diff_y > 15 + (diff_x / 2))
{
edje_object_signal_emit(sd->view->bg, "e,action,hide,into", "e");
edje_object_signal_emit(sd->view->bg, "e,action,hide,back", "e");
@ -1572,19 +1567,22 @@ _view_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
}
return;
end:
end:
sd->it_down = NULL;
sd->mouse_x = 0;
sd->mouse_y = 0;
}
static void _cb_list_hide(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
static void
_cb_list_hide(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
View *v = data;
v->hiding = EINA_TRUE;
}
static void _cb_list_show(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
static void
_cb_list_show(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
View *v = data;
@ -1687,7 +1685,7 @@ _view_destroy(Evry_View *view)
evry_tab_view_free(v->tabs);
EINA_LIST_FREE(v->handlers, h)
EINA_LIST_FREE (v->handlers, h)
ecore_event_handler_del(h);
E_FREE(v);
@ -1723,3 +1721,4 @@ evry_view_shutdown(void)
evry_view_unregister(EVRY_VIEW(view));
E_FREE(view);
}

View File

@ -32,7 +32,7 @@ _cb_key_down(Evry_View *v, const Ecore_Event_Key *ev)
if (!h) h = 1;
e_box_align_get(o, NULL, &align);
align = align - 10.0/(double)h;
align = align - 10.0 / (double)h;
if (align < 0.0) align = 0.0;
e_box_align_set(v->o_list, 0.5, align);
@ -46,7 +46,7 @@ _cb_key_down(Evry_View *v, const Ecore_Event_Key *ev)
if (!h) h = 1;
e_box_align_get(o, NULL, &align);
align = align + 10.0/(double)h;
align = align + 10.0 / (double)h;
if (align > 1.0) align = 1.0;
e_box_align_set(v->o_list, 0.5, align);
@ -141,3 +141,4 @@ evry_view_help_shutdown(void)
evry_view_unregister(view);
E_FREE(view);
}

View File

@ -1,6 +1,5 @@
#include "e_mod_main.h"
typedef struct _Tab Tab;
struct _Tab
@ -54,6 +53,7 @@ _tab_cb_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev
evry_browse_back(v->state->selector);
}
}
static void
_tabs_cb_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
@ -71,6 +71,7 @@ _tabs_cb_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
v->view->update(v->view);
}
}
static Tab *
_add_tab(Tab_View *v, Evry_Plugin *p)
{
@ -132,7 +133,7 @@ _tabs_update(Tab_View *v)
/* remove tabs for not active plugins */
e_box_freeze(v->o_tabs);
EINA_LIST_FOREACH(v->tabs, l, tab)
EINA_LIST_FOREACH (v->tabs, l, tab)
{
if (!tab->plugin)
continue;
@ -153,11 +154,11 @@ _tabs_update(Tab_View *v)
o = tab->o_tab;
evas_object_show(o);
e_box_pack_end(v->o_tabs, o);
e_box_pack_options_set(o, 1, 1, 0, 0, 0.0, 0.5, w/4, 10, w/3, 9999);
e_box_pack_options_set(o, 1, 1, 0, 0, 0.0, 0.5, w / 4, 10, w / 3, 9999);
}
}
for(l = s->cur_plugins; l; l = l->next, cur++)
for (l = s->cur_plugins; l; l = l->next, cur++)
if (l->data == s->plugin) break;
if (cur > 2)
@ -173,9 +174,9 @@ _tabs_update(Tab_View *v)
}
/* show/update tabs of active plugins */
EINA_LIST_FOREACH(plugins, l, p)
EINA_LIST_FOREACH (plugins, l, p)
{
EINA_LIST_FOREACH(v->tabs, ll, tab)
EINA_LIST_FOREACH (v->tabs, ll, tab)
if (tab->plugin == p) break;
if (!tab && !(tab = _add_tab(v, p)))
@ -184,7 +185,7 @@ _tabs_update(Tab_View *v)
o = tab->o_tab;
evas_object_show(o);
e_box_pack_end(v->o_tabs, o);
e_box_pack_options_set(o, 1, 1, 0, 0, 0.0, 0.5, w/4, 10, w/3, 9999);
e_box_pack_options_set(o, 1, 1, 0, 0, 0.0, 0.5, w / 4, 10, w / 3, 9999);
if (s->plugin == p)
edje_object_signal_emit(o, "e,state,selected", "e");
@ -198,7 +199,6 @@ _tabs_update(Tab_View *v)
e_box_thaw(v->o_tabs);
}
static void
_tabs_clear(Tab_View *v)
{
@ -206,7 +206,7 @@ _tabs_clear(Tab_View *v)
Tab *tab;
e_box_freeze(v->o_tabs);
EINA_LIST_FOREACH(v->tabs, l, tab)
EINA_LIST_FOREACH (v->tabs, l, tab)
{
if (!tab->plugin)
continue;
@ -254,7 +254,7 @@ _plugin_next_by_name(Tab_View *v, const char *key)
if (!s->plugin) return;
EINA_LIST_FOREACH(s->cur_plugins, l, p)
EINA_LIST_FOREACH (s->cur_plugins, l, p)
{
/* if (!p)
* {
@ -306,7 +306,6 @@ _plugin_prev(Tab_View *v)
if (p) _plugin_select(v, p);
}
static int
_tabs_key_down(Tab_View *v, const Ecore_Event_Key *ev)
{
@ -349,7 +348,6 @@ _tabs_key_down(Tab_View *v, const Ecore_Event_Key *ev)
return 0;
}
Tab_View *
evry_tab_view_new(Evry_View *view, const Evry_State *s, Evas *e)
{
@ -379,7 +377,7 @@ evry_tab_view_free(Tab_View *v)
{
Tab *tab;
EINA_LIST_FREE(v->tabs, tab)
EINA_LIST_FREE (v->tabs, tab)
{
e_box_unpack(tab->o_tab);
evas_object_del(tab->o_tab);
@ -396,3 +394,4 @@ evry_tab_view_free(Tab_View *v)
E_FREE(v);
}

View File

@ -30,23 +30,26 @@ void byteReverse(unsigned char *buf, unsigned longs);
/*
* Note: this code is harmless on little-endian machines.
*/
void byteReverse(unsigned char *buf, unsigned longs)
void
byteReverse(unsigned char *buf, unsigned longs)
{
uint32_t t;
do {
t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
((unsigned) buf[1] << 8 | buf[0]);
*(uint32_t *) buf = t;
t = (uint32_t)((unsigned)buf[3] << 8 | buf[2]) << 16 |
((unsigned)buf[1] << 8 | buf[0]);
*(uint32_t *)buf = t;
buf += 4;
} while (--longs);
}
#endif
/*
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
* initialization constants.
*/
void MD5Init(MD5_CTX *ctx)
void
MD5Init(MD5_CTX *ctx)
{
ctx->buf[0] = 0x67452301;
ctx->buf[1] = 0xefcdab89;
@ -61,14 +64,15 @@ void MD5Init(MD5_CTX *ctx)
* Update context to reflect the concatenation of another buffer full
* of bytes.
*/
void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len)
void
MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len)
{
uint32_t t;
/* Update bitcount */
t = ctx->bits[0];
if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
if ((ctx->bits[0] = t + ((uint32_t)len << 3)) < t)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29;
@ -76,17 +80,19 @@ void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len)
/* Handle any leading odd-sized chunks */
if (t) {
unsigned char *p = (unsigned char *) ctx->in + t;
if (t)
{
unsigned char *p = (unsigned char *)ctx->in + t;
t = 64 - t;
if (len < t) {
if (len < t)
{
memcpy(p, buf, len);
return;
}
memcpy(p, buf, t);
byteReverse(ctx->in, 16);
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
MD5Transform(ctx->buf, (uint32_t *)ctx->in);
buf += t;
len -= t;
}
@ -95,7 +101,7 @@ void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len)
while (len >= 64) {
memcpy(ctx->in, buf, 64);
byteReverse(ctx->in, 16);
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
MD5Transform(ctx->buf, (uint32_t *)ctx->in);
buf += 64;
len -= 64;
}
@ -109,7 +115,8 @@ void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len)
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void MD5Final(unsigned char digest[16], MD5_CTX *ctx)
void
MD5Final(unsigned char digest[16], MD5_CTX *ctx)
{
unsigned count;
unsigned char *p;
@ -126,28 +133,30 @@ void MD5Final(unsigned char digest[16], MD5_CTX *ctx)
count = 64 - 1 - count;
/* Pad out to 56 mod 64 */
if (count < 8) {
if (count < 8)
{
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
byteReverse(ctx->in, 16);
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
MD5Transform(ctx->buf, (uint32_t *)ctx->in);
/* Now fill the next block with 56 bytes */
memset(ctx->in, 0, 56);
} else {
}
else {
/* Pad block to 56 bytes */
memset(p, 0, count - 8);
}
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
((uint32_t *) ctx->in)[14] = ctx->bits[0];
((uint32_t *) ctx->in)[15] = ctx->bits[1];
((uint32_t *)ctx->in)[14] = ctx->bits[0];
((uint32_t *)ctx->in)[15] = ctx->bits[1];
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
MD5Transform(ctx->buf, (uint32_t *)ctx->in);
byteReverse((unsigned char *)ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset((char *) ctx, 0, sizeof(ctx)); /* In case it's sensitive */
memset((char *)ctx, 0, sizeof(ctx)); /* In case it's sensitive */
}
/* The four core functions - F1 is optimized somewhat */
@ -160,14 +169,15 @@ void MD5Final(unsigned char digest[16], MD5_CTX *ctx)
/* This is the central step in the MD5 algorithm. */
#define MD5STEP(f, w, x, y, z, data, s) \
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
(w += f(x, y, z) + data, w = w << s | w >> (32 - s), w += x)
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
void MD5Transform(uint32_t buf[4], uint32_t const in[16])
void
MD5Transform(uint32_t buf[4], uint32_t const in[16])
{
register uint32_t a, b, c, d;
@ -249,3 +259,4 @@ void MD5Transform(uint32_t buf[4], uint32_t const in[16])
buf[2] += c;
buf[3] += d;
}