fix warning/unsued stuff

keep refs to .desktops of recently used apps


SVN revision: 56272
This commit is contained in:
Hannes Janetzek 2011-01-23 22:34:28 +00:00
parent 5d4d9705e8
commit e9e9c7a066
18 changed files with 218 additions and 141 deletions

View File

@ -3,6 +3,8 @@
#include "evry_api.h"
#include "e_mod_main.h"
// FIXME clear cache on .desktop chage event
/* #undef DBG
* #define DBG(...) ERR(__VA_ARGS__) */
@ -48,6 +50,7 @@ struct _Module_Config
static const Evry_API *evry = NULL;
static Evry_Module *evry_module = NULL;
static Eina_List *handlers = NULL;
static Module_Config *_conf;
@ -61,7 +64,7 @@ static E_Config_DD *exelist_edd = NULL;
static DIR *exe_dir = NULL;
static Eina_List *exe_list = NULL;
static Eina_List *exe_list2 = NULL;
static Eina_List *apps_cache = NULL;
static void _scan_executables();
/***************************************************************************/
@ -78,9 +81,22 @@ _icon_get(Evry_Item *it, Evas *e)
GET_APP(app, it);
Evas_Object *o = NULL;
if (app->desktop)
if (app->desktop && app->desktop->icon)
{
o = evry->icon_theme_get(app->desktop->icon, e);
if (app->desktop->icon[0] == '/')
{
o = e_icon_add(e);
e_icon_preload_set(o, 1);
if (!e_icon_file_set(o, app->desktop->icon))
{
evas_object_del(o);
o = NULL;
}
}
if (!o)
o = evry->icon_theme_get(app->desktop->icon, e);
if (!o)
o = e_util_desktop_icon_add(app->desktop, 128, e);
@ -183,7 +199,7 @@ _item_exe_add(Plugin *p, const char *exe, int match)
}
static Eina_Bool
_hist_exe_get_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
_hist_exe_get_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data, void *fdata)
{
History_Entry *he = data;
History_Item *hi;
@ -228,11 +244,11 @@ _fetch_exe(Evry_Plugin *plugin, const char *input)
Eina_List *l;
Evry_Item *it;
History_Types *ht;
int len = (input ? strlen(input) : 0);
unsigned int len = (input ? strlen(input) : 0);
double max = 0.0;
const char *tmp, *file = NULL;
int min = 0, cnt = 0, end = len, tmp_len;
int query = (len >= plugin->config->min_query);
unsigned int min = 0, cnt = 0, end = len, tmp_len;
unsigned int query = (len >= (unsigned int)plugin->config->min_query);
EVRY_PLUGIN_ITEMS_CLEAR(p);
p->input = input;
@ -451,7 +467,7 @@ _desktop_list_get(void)
}
static Eina_Bool
_hist_items_get_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
_hist_items_get_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data, void *fdata)
{
History_Entry *he = data;
History_Item *hi;
@ -462,32 +478,44 @@ _hist_items_get_cb(const Eina_Hash *hash, const void *key, void *data, void *fda
EINA_LIST_FOREACH(he->items, l, hi)
{
d = NULL;
if (hi->transient)
continue;
if (strcmp(hi->plugin, EVRY_PLUGIN(p)->name))
continue;
/* d = NULL;
* if (hi->data)
* d = efreet_desktop_new(hi->data);
* if (!d) */
d = efreet_util_desktop_exec_find(exec);
/* if (!d) */
EINA_LIST_FOREACH(p->apps_all, ll, d)
EINA_LIST_FOREACH(apps_cache, ll, d)
if (d->exec && !strcmp(d->exec, exec)) break;
if (!d)
{
if (!p->apps_all)
p->apps_all = _desktop_list_get();
EINA_LIST_FOREACH(p->apps_all, ll, d)
if (d->exec && !strcmp(d->exec, exec)) break;
if (d)
{
efreet_desktop_ref(d);
apps_cache = eina_list_append(apps_cache, d);
}
else
{
/* remove from history */
DBG("no desktop: %s", exec);
hi->transient = 1;
}
}
if (!d)
{
DBG("app not found %s", exec);
break;
}
/* if (hi->data)
* eina_stringshare_del(hi->data);
* hi->data = NULL;
*
* if (d->orig_path)
* hi->data = eina_stringshare_add(d->orig_path); */
p->apps_hist = eina_list_append(p->apps_hist, d);
break;
}
@ -541,11 +569,11 @@ _fetch(Evry_Plugin *plugin, const char *input)
EVRY_PLUGIN_ITEMS_CLEAR(p);
if (!p->apps_all)
p->apps_all = _desktop_list_get();
if (input)
{
if (!p->apps_all)
p->apps_all = _desktop_list_get();
_desktop_list_add(p, p->apps_all, input);
}
else
@ -700,7 +728,7 @@ _fetch_mime(Evry_Plugin *plugin, const char *input)
static int
_complete(Evry_Plugin *plugin, const Evry_Item *it, char **input)
_complete(Evry_Plugin *plugin __UNUSED__, const Evry_Item *it, char **input)
{
GET_APP(app, it);
@ -725,7 +753,7 @@ _complete(Evry_Plugin *plugin, const Evry_Item *it, char **input)
/***************************************************************************/
static int
_exec_app_check_item(Evry_Action *act, const Evry_Item *it)
_exec_app_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it __UNUSED__)
{
return 1;
}
@ -948,6 +976,16 @@ _open_term_action(Evry_Action *act)
}
/***************************************************************************/
static Eina_Bool
_desktop_cache_update(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
{
Efreet_Desktop *d;
EINA_LIST_FREE(apps_cache, d)
efreet_desktop_unref(d);
return EINA_TRUE;
}
static int
_plugins_init(const Evry_API *api)
@ -1000,7 +1038,7 @@ _plugins_init(const Evry_API *api)
act = EVRY_ACTION_NEW(N_("Launch"),
EVRY_TYPE_APP, 0,
"everything-launch",
"system-run",
_exec_app_action,
_exec_app_check_item);
_actions = eina_list_append(_actions, act);
@ -1055,6 +1093,10 @@ _plugins_init(const Evry_API *api)
EINA_LIST_FOREACH(_actions, l, act)
evry->action_register(act, prio++);
handlers = eina_list_append
(handlers, ecore_event_handler_add
(EFREET_EVENT_DESKTOP_CACHE_UPDATE, _desktop_cache_update, NULL));
return EINA_TRUE;
}
@ -1063,16 +1105,24 @@ _plugins_shutdown(void)
{
Evry_Action *act;
Evry_Plugin *p;
Efreet_Desktop *d;
Ecore_Event_Handler *h;
if (!evry_module->active)
return;
EINA_LIST_FREE(apps_cache, d)
efreet_desktop_unref(d);
EINA_LIST_FREE(_plugins, p)
EVRY_PLUGIN_FREE(p);
EINA_LIST_FREE(_actions, act)
EVRY_ACTION_FREE(act);
EINA_LIST_FREE(handlers, h)
ecore_event_handler_del(h);
evry_module->active = EINA_FALSE;
}
@ -1093,7 +1143,7 @@ static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dia
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static E_Config_Dialog *
_conf_dialog(E_Container *con, const char *params)
_conf_dialog(E_Container *con, const char *params __UNUSED__)
{
E_Config_Dialog *cfd = NULL;
E_Config_Dialog_View *v = NULL;
@ -1121,7 +1171,7 @@ _conf_dialog(E_Container *con, const char *params)
/* Local Functions */
static void *
_create_data(E_Config_Dialog *cfd)
_create_data(E_Config_Dialog *cfd __UNUSED__)
{
E_Config_Dialog_Data *cfdata = NULL;
@ -1131,14 +1181,14 @@ _create_data(E_Config_Dialog *cfd)
}
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
_conf->cfd = NULL;
E_FREE(cfdata);
}
static Evas_Object *
_basic_create(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *e, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o = NULL, *of = NULL, *ow = NULL;
@ -1173,7 +1223,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
}
static int
_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
_basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
#define CP(_name) \
if (_conf->_name) \
@ -1313,7 +1363,7 @@ e_modapi_init(E_Module *m)
}
EAPI int
e_modapi_shutdown(E_Module *m)
e_modapi_shutdown(E_Module *m __UNUSED__)
{
_plugins_shutdown();
@ -1329,7 +1379,7 @@ e_modapi_shutdown(E_Module *m)
}
EAPI int
e_modapi_save(E_Module *m)
e_modapi_save(E_Module *m __UNUSED__)
{
e_config_domain_save("module.everything-apps", conf_edd, _conf);
return 1;
@ -1340,7 +1390,7 @@ e_modapi_save(E_Module *m)
/* taken from e_exebuf.c */
static Eina_Bool
_scan_idler(void *data)
_scan_idler(void *data __UNUSED__)
{
struct stat st;
struct dirent *dp;

View File

@ -270,7 +270,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
{
GET_PLUGIN(p, plugin);
const char *s;
int len;
unsigned int len;
if (!input) return 0;
@ -443,7 +443,7 @@ static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dia
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static E_Config_Dialog *
_conf_dialog(E_Container *con, const char *params)
_conf_dialog(E_Container *con, const char *params __UNUSED__)
{
E_Config_Dialog *cfd = NULL;
E_Config_Dialog_View *v = NULL;
@ -467,7 +467,7 @@ _conf_dialog(E_Container *con, const char *params)
}
static Evas_Object *
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o = NULL, *of = NULL, *ow = NULL;
E_Radio_Group *rg;
@ -507,7 +507,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
}
static void *
_create_data(E_Config_Dialog *cfd)
_create_data(E_Config_Dialog *cfd __UNUSED__)
{
E_Config_Dialog_Data *cfdata = NULL;
@ -517,7 +517,7 @@ _create_data(E_Config_Dialog *cfd)
}
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
E_FREE(cfdata->custom);
E_FREE(cfdata->lang);
@ -538,7 +538,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
}
static int
_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
_basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
#define CP(_name) \
if (_conf->_name) \
@ -655,7 +655,7 @@ e_modapi_init(E_Module *m)
}
EAPI int
e_modapi_shutdown(E_Module *m)
e_modapi_shutdown(E_Module *m __UNUSED__)
{
_plugins_shutdown();
@ -668,7 +668,7 @@ e_modapi_shutdown(E_Module *m)
}
EAPI int
e_modapi_save(E_Module *m)
e_modapi_save(E_Module *m __UNUSED__)
{
e_config_domain_save(_config_domain, _conf_edd, _conf);
return 1;

View File

@ -18,6 +18,7 @@ static Eina_List *handlers = NULL;
static int error = 0;
static Eina_Bool active = EINA_FALSE;
static char _module_icon[] = "accessories-calculator";
static Evry_Item *cur_item = NULL;
static Evry_Plugin *
_begin(Evry_Plugin *p, const Evry_Item *item __UNUSED__)
@ -42,8 +43,8 @@ _begin(Evry_Plugin *p, const Evry_Item *item __UNUSED__)
it = EVRY_ITEM_NEW(Evry_Item, p, "0", NULL, NULL);
it->context = eina_stringshare_ref(p->name);
p->items = eina_list_prepend(p->items, it);
cur_item = it;
active = EINA_TRUE;
return p;
}
@ -171,7 +172,7 @@ _fetch(Evry_Plugin *p, const char *input)
error = 0;
}
return 1;
return !!(p->items);
}
static Eina_Bool
@ -185,24 +186,32 @@ _cb_data(void *data, int type __UNUSED__, void *event)
if (ev->lines)
{
it = p->items->data;
it = cur_item;
eina_stringshare_del(it->label);
it->label = eina_stringshare_add(ev->lines->line);
if (it) evry->item_changed(it, 0, 0);
if (!(it = eina_list_data_get(p->items)) || (it != cur_item))
{
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);
}
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_cb_error(void *data __UNUSED__, int type __UNUSED__, void *event)
_cb_error(void *data, int type __UNUSED__, void *event)
{
Ecore_Exe_Event_Data *ev = event;
Evry_Plugin *p = data;
if (ev->exe != exe)
return ECORE_CALLBACK_PASS_ON;
p->items = eina_list_remove(p->items, cur_item);
EVRY_PLUGIN_UPDATE(p, EVRY_UPDATE_ADD);
error = 1;
return ECORE_CALLBACK_PASS_ON;
@ -294,7 +303,7 @@ e_modapi_init(E_Module *m)
}
EAPI int
e_modapi_shutdown(E_Module *m)
e_modapi_shutdown(E_Module *m __UNUSED__)
{
_plugins_shutdown();
@ -305,7 +314,7 @@ e_modapi_shutdown(E_Module *m)
}
EAPI int
e_modapi_save(E_Module *m)
e_modapi_save(E_Module *m __UNUSED__)
{
return 1;
}

View File

@ -170,7 +170,6 @@ static void
_scan_func(void *data, Ecore_Thread *thread)
{
Data *d = data;
Plugin *p = d->plugin;
Eina_Iterator *ls;
Eina_File_Direct_Info *info;
Evry_Item_File *file;
@ -180,11 +179,10 @@ _scan_func(void *data, Ecore_Thread *thread)
EINA_ITERATOR_FOREACH(ls, info)
{
if ((p->show_hidden) != (*(info->path + info->name_start) == '.'))
if ((d->plugin->show_hidden) != (*(info->path + info->name_start) == '.'))
continue;
file = EVRY_ITEM_NEW(Evry_Item_File, p,
NULL, NULL, _item_free);
file = EVRY_ITEM_NEW(Evry_Item_File, d->plugin, NULL, NULL, _item_free);
file->path = strdup(info->path);
EVRY_ITEM(file)->label = strdup(info->path + info->name_start);
EVRY_ITEM(file)->browseable = (info->type == EINA_FILE_DIR);
@ -233,7 +231,7 @@ _files_filter(Plugin *p)
int cnt = 0;
Evry_Item *it;
Eina_List *l;
int len = p->input ? strlen(p->input) : 0;
unsigned int len = p->input ? strlen(p->input) : 0;
EVRY_PLUGIN_ITEMS_CLEAR(p);
@ -374,13 +372,12 @@ _file_add(Plugin *p, Evry_Item *item)
}
static void
_scan_end_func(void *data, Ecore_Thread *thread)
_scan_end_func(void *data, Ecore_Thread *thread __UNUSED__)
{
Data *d = data;
Plugin *p = d->plugin;
Evry_Item *item;
Evry_Item_File *file;
char *filename, *path;
Eina_List *l, *ll;
History_Types *ht = NULL;
@ -446,7 +443,7 @@ _scan_end_func(void *data, Ecore_Thread *thread)
}
static void
_dir_watcher(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
_dir_watcher(void *data, Ecore_File_Monitor *em __UNUSED__, Ecore_File_Event event, const char *path)
{
Plugin *p = data;
Evry_Item_File *file;
@ -660,7 +657,7 @@ static int
_fetch(Evry_Plugin *plugin, const char *input)
{
GET_PLUGIN(p, plugin);
int len = (input ? strlen(input) : 0);
unsigned int len = (input ? strlen(input) : 0);
if (!p->command)
EVRY_PLUGIN_ITEMS_CLEAR(p);
@ -831,8 +828,8 @@ _recentf_files_filter(Plugin *p)
EINA_LIST_FREE(new, it)
{
if (cnt++ < MAX_SHOWN);
EVRY_PLUGIN_ITEM_APPEND(p, it);
if (cnt++ < MAX_SHOWN)
EVRY_PLUGIN_ITEM_APPEND(p, it);
}
return cnt;
@ -913,7 +910,7 @@ _recentf_end_func(void *data)
#endif
static Eina_Bool
_recentf_items_add_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
_recentf_items_add_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data, void *fdata)
{
History_Entry *he = data;
History_Item *hi = NULL, *hi2;
@ -1453,7 +1450,7 @@ static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dia
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static E_Config_Dialog *
_conf_dialog(E_Container *con, const char *params)
_conf_dialog(E_Container *con, const char *params __UNUSED__)
{
E_Config_Dialog *cfd = NULL;
E_Config_Dialog_View *v = NULL;
@ -1476,13 +1473,13 @@ _conf_dialog(E_Container *con, const char *params)
}
static void
_clear_cache_cb(void *data, void *data2)
_clear_cache_cb(void *data __UNUSED__, void *data2 __UNUSED__)
{
clear_cache = EINA_TRUE;
}
static Evas_Object *
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o = NULL, *of = NULL, *ow = NULL;
@ -1522,7 +1519,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
}
static void *
_create_data(E_Config_Dialog *cfd)
_create_data(E_Config_Dialog *cfd __UNUSED__)
{
E_Config_Dialog_Data *cfdata = NULL;
@ -1532,7 +1529,7 @@ _create_data(E_Config_Dialog *cfd)
}
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
_conf->cfd = NULL;
E_FREE(cfdata);
@ -1551,7 +1548,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
}
static int
_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
_basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
#define C(_name) _conf->_name = cfdata->_name;
C(show_homedir);
@ -1664,7 +1661,7 @@ e_modapi_init(E_Module *m)
}
EAPI int
e_modapi_shutdown(E_Module *m)
e_modapi_shutdown(E_Module *m __UNUSED__)
{
_plugins_shutdown();
@ -1677,7 +1674,7 @@ e_modapi_shutdown(E_Module *m)
}
EAPI int
e_modapi_save(E_Module *m)
e_modapi_save(E_Module *m __UNUSED__)
{
e_config_domain_save("module.everything-files", conf_edd, _conf);
return 1;

View File

@ -154,7 +154,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
}
static int
_action_check(Evry_Action *act, const Evry_Item *item)
_action_check(Evry_Action *act __UNUSED__, const Evry_Item *item)
{
return !!(((Settings_Item*)item)->eci);
}
@ -241,7 +241,7 @@ e_modapi_init(E_Module *m)
}
EAPI int
e_modapi_shutdown(E_Module *m)
e_modapi_shutdown(E_Module *m __UNUSED__)
{
_plugins_shutdown();
@ -252,7 +252,7 @@ e_modapi_shutdown(E_Module *m)
}
EAPI int
e_modapi_save(E_Module *m)
e_modapi_save(E_Module *m __UNUSED__)
{
return 1;
}

View File

@ -98,7 +98,7 @@ _cb_border_add(void *data, __UNUSED__ int type, void *event)
{
E_Event_Border_Add *ev = event;
Plugin *p = data;
int min;
unsigned int min;
if (!_border_item_add(p, ev->border))
return ECORE_CALLBACK_PASS_ON;
@ -505,7 +505,7 @@ e_modapi_init(E_Module *m)
}
EAPI int
e_modapi_shutdown(E_Module *m)
e_modapi_shutdown(E_Module *m __UNUSED__)
{
_plugins_shutdown();
@ -516,7 +516,7 @@ e_modapi_shutdown(E_Module *m)
}
EAPI int
e_modapi_save(E_Module *m)
e_modapi_save(E_Module *m __UNUSED__)
{
return 1;
}

View File

@ -317,7 +317,7 @@ evry_view_unregister(Evry_View *view)
/***************************************************************************/
static Eina_Bool
_cleanup_history(void *data)
_cleanup_history(void *data __UNUSED__)
{
/* evrything is active */
if (evry_hist)
@ -538,7 +538,7 @@ _e_mod_action_cb(E_Object *obj, const char *params)
}
static void
_e_mod_action_cb_edge(E_Object *obj, const char *params, E_Event_Zone_Edge *ev)
_e_mod_action_cb_edge(E_Object *obj __UNUSED__, const char *params, E_Event_Zone_Edge *ev)
{
IF_RELEASE(_params);
if (params && params[0])

View File

@ -392,4 +392,8 @@ EAPI extern E_Module_Api e_modapi;
extern Eina_List *_refd;
#endif
#ifdef CHECK_TIME
extern double _evry_time;
#endif
#endif

View File

@ -14,6 +14,9 @@
/* #undef DBG
* #define DBG(...) ERR(__VA_ARGS__) */
#undef DBG
#define DBG(...)
static void _evry_matches_update(Evry_Selector *sel, int async);
static void _evry_plugin_action(Evry_Selector *sel, int finished);
static void _evry_plugin_select(Evry_State *s, Evry_Plugin *p);
@ -63,6 +66,15 @@ static Eina_Bool _evry_cb_mouse(void *data, int type, void *event);
static Eina_List *windows = NULL;
#ifdef CHECK_TIME
double _evry_time;
#endif
#ifdef CHECK_REFS
static int _item_cnt = 0;
Eina_List *_refd = NULL;
#endif
#define SUBJ_SEL win->selectors[0]
#define ACTN_SEL win->selectors[1]
#define OBJ_SEL win->selectors[2]
@ -137,6 +149,11 @@ evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params)
Evry_Window *win;
Evry_Selector *sel;
#ifdef CHECK_TIME
_evry_time = ecore_time_get();
DBG("_____evry_show______");
#endif
E_OBJECT_CHECK_RETURN(zone, 0);
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
@ -396,11 +413,6 @@ _evry_selectors_shift(Evry_Window *win, int dir)
return 0;
}
#ifdef CHECK_REFS
static int _item_cnt = 0;
Eina_List *_refd = NULL;
#endif
Evry_Item *
evry_item_new(Evry_Item *base, Evry_Plugin *p, const char *label,
Evas_Object *(*icon_get) (Evry_Item *it, Evas *e),
@ -698,7 +710,7 @@ _evry_cb_win_delete(E_Win *ewin)
}
static void
_evry_cb_win_move(E_Win *ewin)
_evry_cb_win_move(E_Win *ewin __UNUSED__)
{
/* Evry_Window *win = ewin->data; */
/* evas_object_resize(win->o_main, ewin->w, ewin->h); */
@ -965,7 +977,7 @@ _evry_window_free(Evry_Window *win)
}
static void
_evry_selector_cb_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
_evry_selector_cb_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
Evry_Selector *sel = data;
@ -978,7 +990,7 @@ _evry_selector_cb_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
}
static void
_evry_selector_cb_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
_evry_selector_cb_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Wheel *ev = event_info;
Evry_Selector *sel = data;
@ -997,7 +1009,7 @@ _evry_selector_cb_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
}
static void
_evry_selector_cb_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
_evry_selector_cb_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Up *ev = event_info;
Evry_Selector *sel = data;
@ -1185,7 +1197,7 @@ _evry_selector_activate(Evry_Selector *sel, int slide)
}
static void
_evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info)
_evry_selector_thumb_gen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Coord w, h;
Evry_Selector *sel = data;
@ -1907,7 +1919,7 @@ _evry_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
mod |= E_BINDING_MODIFIER_WIN;
if (!(bind->key && (!strcmp(bind->key, ev->keyname)) &&
((bind->modifiers == mod) || (bind->any_mod))))
(((unsigned int)bind->modifiers == mod) || (bind->any_mod))))
continue;
if (win->level > 0)
@ -2113,7 +2125,7 @@ _evry_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
}
else if ((ev->compose && !(ev->modifiers & ECORE_EVENT_MODIFIER_ALT)))
{
int len = strlen(s->inp);
unsigned int len = strlen(s->inp);
if (len == 0 && (evry_view_toggle(s, ev->compose)))
goto end;
@ -2243,7 +2255,7 @@ _evry_clear(Evry_Selector *sel)
}
static void
_evry_cb_free_action_performed(void *data, void *event)
_evry_cb_free_action_performed(void *data __UNUSED__, void *event)
{
Evry_Event_Action_Performed *ev = event;
@ -2670,6 +2682,8 @@ _evry_matches_update(Evry_Selector *sel, int async)
s->changed = 1;
s->request++;
DBG("matches update %f", ecore_time_get() - _evry_time);
if (sel->update_timer)
{
ecore_timer_del(sel->update_timer);
@ -2781,6 +2795,8 @@ _evry_matches_update(Evry_Selector *sel, int async)
if (p->fetch(p, input))
{
DBG("fetch %s %f", p->name, ecore_time_get() - _evry_time);
s->cur_plugins = eina_list_append(s->cur_plugins, p);
continue;
}
@ -2852,7 +2868,7 @@ _evry_plugin_select(Evry_State *s, Evry_Plugin *p)
}
static void
_evry_cb_free_plugin_selected(void *data, void *event)
_evry_cb_free_plugin_selected(void *data __UNUSED__, void *event)
{
Evry_Event_Item_Selected *ev = event;
@ -2905,7 +2921,7 @@ _evry_plugin_list_insert(Evry_State *s, Evry_Plugin *p)
}
static Eina_Bool
_evry_cb_selection_notify(void *data, int type, void *event)
_evry_cb_selection_notify(void *data, int type __UNUSED__, void *event)
{
Ecore_X_Event_Selection_Notify *ev;
Evry_Window *win = data;

View File

@ -259,13 +259,13 @@ _plugin_move(Plugin_Page *page, int dir)
}
static void
_plugin_move_up_cb(void *data, void *data2)
_plugin_move_up_cb(void *data, void *data2 __UNUSED__)
{
_plugin_move(data, -1);
}
static void
_plugin_move_down_cb(void *data, void *data2)
_plugin_move_down_cb(void *data, void *data2 __UNUSED__)
{
_plugin_move(data, 1);
}
@ -339,7 +339,7 @@ _list_select_cb (void *data, Evas_Object *obj)
}
static void
_plugin_config_cb(void *data, void *data2)
_plugin_config_cb(void *data, void *data2 __UNUSED__)
{
Plugin_Page *page = data;
Evry_Plugin *p = page->cur->plugin;
@ -353,7 +353,7 @@ _plugin_config_cb(void *data, void *data2)
}
static Evas_Object *
_create_plugin_page(E_Config_Dialog_Data *cfdata, Evas *e, Plugin_Page *page)
_create_plugin_page(E_Config_Dialog_Data *cfdata __UNUSED__, Evas *e, Plugin_Page *page)
{
Evas_Object *o, *of, *ob;
E_Radio_Group *rg;
@ -687,7 +687,7 @@ _cat_create_data(E_Config_Dialog *cfd)
}
static void
_cat_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
_cat_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
if (cfdata->page[0].configs) eina_list_free(cfdata->page[0].configs);
@ -732,7 +732,7 @@ _cat_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
}
static Evas_Object *
_cat_basic_create_widgets(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdata)
_cat_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *e, E_Config_Dialog_Data *cfdata)
{
Evas_Object *ob, *otb;

View File

@ -73,7 +73,7 @@ _gc_shutdown(E_Gadcon_Client *gcc)
}
static void
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
{
Instance *inst;
Evas_Coord mw, mh;
@ -90,13 +90,13 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
}
static char *
_gc_label(E_Gadcon_Client_Class *client_class)
_gc_label(E_Gadcon_Client_Class *client_class __UNUSED__)
{
return _("Everything Starter");
}
static Evas_Object *
_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas)
_gc_icon(E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas __UNUSED__)
{
/* Evas_Object *o; */
/* char buf[4096];
@ -109,7 +109,7 @@ _gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas)
}
static const char *
_gc_id_new(E_Gadcon_Client_Class *client_class)
_gc_id_new(E_Gadcon_Client_Class *client_class __UNUSED__)
{
return _gadcon_class.name;
}
@ -117,7 +117,7 @@ _gc_id_new(E_Gadcon_Client_Class *client_class)
/***************************************************************************/
static void _del_func(void *data, void *obj)
static void _del_func(void *data, void *obj __UNUSED__)
{
Instance *inst = data;
@ -129,7 +129,7 @@ static void _del_func(void *data, void *obj)
}
static void
_button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
_button_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Instance *inst;
Evas_Event_Mouse_Down *ev;

View File

@ -64,7 +64,7 @@ evry_history_init(void)
}
static Eina_Bool
_hist_entry_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
_hist_entry_free_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
{
History_Entry *he = data;
History_Item *hi;
@ -88,7 +88,7 @@ _hist_entry_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fd
}
static Eina_Bool
_hist_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
_hist_free_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
{
History_Types *ht = data;
@ -104,7 +104,7 @@ _hist_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
}
static Eina_Bool
_hist_entry_cleanup_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
_hist_entry_cleanup_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data, void *fdata)
{
History_Entry *he = data;
Cleanup_Data *d = fdata;
@ -120,7 +120,7 @@ _hist_entry_cleanup_cb(const Eina_Hash *hash, const void *key, void *data, void
}
/* item is transient or too old */
if (!hi->count || hi->transient)
if ((hi->count < 1) || hi->transient)
{
if (hi->input)
eina_stringshare_del(hi->input);
@ -146,7 +146,7 @@ _hist_entry_cleanup_cb(const Eina_Hash *hash, const void *key, void *data, void
}
static Eina_Bool
_hist_cleanup_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
_hist_cleanup_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data, void *fdata)
{
History_Types *ht = data;
Cleanup_Data *d = fdata;

View File

@ -68,7 +68,7 @@ _add_item(Plugin *p, Plugin_Config *pc)
}
static Evry_Plugin *
_begin(Evry_Plugin *plugin, const Evry_Item *item)
_begin(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
{
Plugin_Config *pc;
Eina_List *l;
@ -83,7 +83,7 @@ _begin(Evry_Plugin *plugin, const Evry_Item *item)
}
static Evry_Plugin *
_begin_all(Evry_Plugin *plugin, const Evry_Item *item)
_begin_all(Evry_Plugin *plugin, const Evry_Item *item __UNUSED__)
{
Plugin_Config *pc;
Eina_List *l;
@ -116,7 +116,7 @@ _finish(Evry_Plugin *plugin)
EINA_LIST_FREE(p->plugins, it)
EVRY_ITEM_FREE(it);
E_FREE(p);
}

View File

@ -4,7 +4,7 @@ static Evry_Plugin *p1;
static Evry_Plugin *p2;
static Evry_Plugin *
_begin(Evry_Plugin *p, const Evry_Item *it)
_begin(Evry_Plugin *p, const Evry_Item *it __UNUSED__)
{
return p;
}

View File

@ -455,7 +455,7 @@ _evry_icon_mime_theme_get(const char *mime, Evas *e)
char buf[1024];
const char *file;
if (snprintf(buf, sizeof(buf), "e/icons/fileman/mime/%s", mime) >= sizeof(buf))
if (snprintf(buf, sizeof(buf), "e/icons/fileman/mime/%s", mime) >= (int)sizeof(buf))
return NULL;
file = e_theme_edje_file_get("base/theme/icons", buf);
@ -866,7 +866,7 @@ evry_file_url_get(Evry_Item_File *file)
}
static void
_cb_free_item_changed(void *data, void *event)
_cb_free_item_changed(void *data __UNUSED__, void *event)
{
Evry_Event_Item_Changed *ev = event;

View File

@ -80,7 +80,7 @@ static void _animator_del(Evas_Object *obj);
static Eina_Bool _animator(void *data);
static void
_thumb_gen(void *data, Evas_Object *obj, void *event_info)
_thumb_gen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Coord w, h;
Item *it = data;
@ -199,7 +199,7 @@ _thumb_idler(void *data)
}
static void
_item_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
_item_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
Item *it = data;
@ -234,7 +234,7 @@ _item_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
}
static void
_item_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
_item_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Up *ev = event_info;
Item *it = data;
@ -615,19 +615,19 @@ _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
}
static void
_e_smart_show(Evas_Object *obj){}
_e_smart_show(Evas_Object *obj __UNUSED__){}
static void
_e_smart_hide(Evas_Object *obj){}
_e_smart_hide(Evas_Object *obj __UNUSED__){}
static void
_e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a){}
_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, Evas_Object * clip){}
_e_smart_clip_set(Evas_Object *obj __UNUSED__, Evas_Object * clip __UNUSED__){}
static void
_e_smart_clip_unset(Evas_Object *obj){}
_e_smart_clip_unset(Evas_Object *obj __UNUSED__){}
static Evas_Object *
_pan_add(Evas *evas)
@ -649,6 +649,9 @@ _pan_add(Evas *evas)
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
smart = evas_smart_class_new(&sc);
@ -1398,7 +1401,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
}
static Eina_Bool
_cb_item_changed(void *data, int type, void *event)
_cb_item_changed(void *data, int type __UNUSED__, void *event)
{
Evry_Event_Item_Changed *ev = event;
View *v = data;
@ -1448,7 +1451,7 @@ _cb_item_changed(void *data, int type, void *event)
}
static void
_view_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
_view_cb_mouse_wheel(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Wheel *ev = event_info;
Smart_Data *sd = evas_object_smart_data_get(obj);
@ -1462,7 +1465,7 @@ _view_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
}
static void
_view_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
_view_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
Smart_Data *sd = evas_object_smart_data_get(data);
@ -1474,7 +1477,7 @@ _view_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
}
static void
_view_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
_view_cb_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
/* Evas_Event_Mouse_Up *ev = event_info; */
Smart_Data *sd = evas_object_smart_data_get(data);
@ -1489,7 +1492,7 @@ _view_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
#define SLIDE_RESISTANCE 80
static void
_view_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
_view_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Move *ev = event_info;
Smart_Data *sd = evas_object_smart_data_get(data);
@ -1604,9 +1607,7 @@ _view_create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow)
}
v->plugin = s->plugin;
v->mode_prev = v->mode;
v->zoom = parent->zoom;
v->bg = edje_object_add(v->evas);

View File

@ -13,7 +13,7 @@ _view_clear(Evry_View *v)
}
static int
_view_update(Evry_View *v)
_view_update(Evry_View *v __UNUSED__)
{
return 1;
}
@ -58,7 +58,7 @@ _cb_key_down(Evry_View *v, const Ecore_Event_Key *ev)
}
static Evry_View *
_view_create(Evry_View *v, const Evry_State *s, const Evas_Object *swallow)
_view_create(Evry_View *v, const Evry_State *s __UNUSED__, const Evas_Object *swallow)
{
Evas_Object *o;
int mw, mh;

View File

@ -29,13 +29,13 @@ _timer_cb(void *data)
}
static void
_tab_cb_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
_tab_cb_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
/* Evas_Event_Mouse_Down *ev = event_info; */
}
static void
_tab_cb_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
_tab_cb_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Up *ev = event_info;
Tab *tab = data;
@ -55,7 +55,7 @@ _tab_cb_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
}
}
static void
_tabs_cb_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
_tabs_cb_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Wheel *ev = event_info;
Tab_View *v = data;
@ -115,7 +115,7 @@ _tabs_update(Tab_View *v)
Tab *tab;
Evas_Coord w, x;
Evas_Object *o;
int cur = 0, i = 0;
unsigned int cur = 0, i = 0;
if (s->delete_me)
return;