Add UNUSED where needed.

Remove whitespace.
Fix formatting, etc, etc.



SVN revision: 51413
This commit is contained in:
Christopher Michael 2010-08-19 16:52:09 +00:00
parent 4c42c4f167
commit aaf6cebcb6
9 changed files with 105 additions and 113 deletions

View File

@ -1,18 +1,9 @@
#include "e.h"
#include "e_mod_main.h"
/***************************************************************************/
/**/
/* actual module specifics */
static E_Module *conf_module = NULL;
/**/
/***************************************************************************/
/***************************************************************************/
/**/
/*
* These are the currently planned wizard pages:
*
@ -39,11 +30,6 @@ static E_Module *conf_module = NULL;
* with pointer focus and ibar icons/desktop makes no sense.
*/
/**/
/***************************************************************************/
/***************************************************************************/
/**/
/* module setup */
EAPI E_Module_Api e_modapi =
{
@ -51,8 +37,8 @@ EAPI E_Module_Api e_modapi =
"Wizard"
};
static int _cb_sort_files(char *f1, char *f2)
static int
_cb_sort_files(char *f1, char *f2)
{
return strcmp(f1, f2);
}
@ -99,7 +85,7 @@ e_modapi_init(E_Module *m)
}
EAPI int
e_modapi_shutdown(E_Module *m)
e_modapi_shutdown(E_Module *m __UNUSED__)
{
e_wizard_shutdown();
conf_module = NULL;
@ -110,7 +96,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

@ -21,23 +21,23 @@ EAPI int
e_wizard_init(void)
{
Eina_List *l;
for (l = e_manager_list(); l; l = l->next)
{
E_Manager *man;
Eina_List *l2;
man = l->data;
for (l2 = man->containers; l2; l2 = l2->next)
{
E_Container *con;
Eina_List *l3;
con = l2->data;
for (l3 = con->zones; l3; l3 = l3->next)
{
E_Zone *zone;
zone = l3->data;
if (!pop)
pop = _e_wizard_main_new(zone);
@ -95,11 +95,11 @@ EAPI void
e_wizard_apply(void)
{
Eina_List *l;
for (l = pages; l; l = l->next)
{
E_Wizard_Page *pg;
pg = l->data;
if (pg->apply) pg->apply(pg);
}
@ -109,7 +109,7 @@ EAPI void
e_wizard_next(void)
{
Eina_List *l;
for (l = pages; l; l = l->next)
{
if (l->data == curpage)
@ -148,12 +148,12 @@ e_wizard_next(void)
EAPI void
e_wizard_page_show(Evas_Object *obj)
{
Evas_Coord minw, minh;
if (o_content) evas_object_del(o_content);
o_content = obj;
if (obj)
{
Evas_Coord minw, minh;
e_widget_size_min_get(obj, &minw, &minh);
edje_extern_object_min_size_set(obj, minw, minh);
edje_object_part_swallow(o_bg, "e.swallow.content", obj);
@ -173,21 +173,21 @@ e_wizard_page_add(void *handle,
)
{
E_Wizard_Page *pg;
pg = E_NEW(E_Wizard_Page, 1);
if (!pg) return NULL;
pg->handle = handle;
pg->evas = pop->evas;
pg->init = init;
pg->shutdown = shutdown;
pg->show = show;
pg->hide = hide;
pg->apply = apply;
pages = eina_list_append(pages, pg);
return pg;
}
@ -222,7 +222,7 @@ static void
_e_wizard_next_eval(void)
{
int ok;
ok = next_can;
if (!next_ok) ok = 0;
if (next_prev != ok)
@ -240,7 +240,7 @@ _e_wizard_main_new(E_Zone *zone)
Evas_Object *o;
Evas_Modifier_Mask mask;
Eina_Bool kg;
pop = e_popup_new(zone, 0, 0, zone->w, zone->h);
e_popup_layer_set(pop, 255);
o = edje_object_add(pop->evas);
@ -252,24 +252,24 @@ _e_wizard_main_new(E_Zone *zone)
edje_object_signal_callback_add(o, "e,action,next", "",
_e_wizard_cb_next, pop);
o_bg = o;
o = evas_object_rectangle_add(pop->evas);
mask = 0;
kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0);
if (!kg)
fprintf(stderr,"ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
fprintf(stderr,"ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
mask = evas_key_modifier_mask_get(pop->evas, "Shift");
kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0);
if (!kg)
fprintf(stderr,"ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
fprintf(stderr,"ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
mask = 0;
kg = evas_object_key_grab(o, "Return", mask, ~mask, 0);
if (!kg)
fprintf(stderr,"ERROR: unable to redirect \"Return\" key events to object %p.\n", o);
fprintf(stderr,"ERROR: unable to redirect \"Return\" key events to object %p.\n", o);
mask = 0;
kg = evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0);
if (!kg)
fprintf(stderr,"ERROR: unable to redirect \"KP_Enter\" key events to object %p.\n", o);
fprintf(stderr,"ERROR: unable to redirect \"KP_Enter\" key events to object %p.\n", o);
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN,
_e_wizard_cb_key_down, pop);
@ -277,7 +277,7 @@ _e_wizard_main_new(E_Zone *zone)
edje_object_part_text_set(o_bg, "e.text.title", _("Welcome to Enlightenment"));
edje_object_signal_emit(o_bg, "e,state,next,disable", "e");
e_wizard_labels_update();
e_popup_edje_bg_object_set(pop, o_bg);
e_popup_show(pop);
if (!e_grabinput_get(ecore_evas_software_x11_window_get(pop->ecore_evas),
@ -294,7 +294,7 @@ _e_wizard_extra_new(E_Zone *zone)
{
E_Popup *pop;
Evas_Object *o;
pop = e_popup_new(zone, 0, 0, zone->w, zone->h);
e_popup_layer_set(pop, 255);
o = edje_object_add(pop->evas);
@ -308,10 +308,10 @@ _e_wizard_extra_new(E_Zone *zone)
}
static void
_e_wizard_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event)
_e_wizard_cb_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
{
Evas_Event_Key_Down *ev;
ev = event;
if (!o_content) return;
if (!strcmp(ev->keyname, "Tab"))
@ -326,14 +326,14 @@ _e_wizard_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event)
(!strcmp(ev->keyname, "space"))))
{
Evas_Object *o;
o = e_widget_focused_object_get(o_content);
if (o) e_widget_activate(o);
}
}
static void
_e_wizard_cb_next(void *data, Evas_Object *obj, const char *emission, const char *source)
_e_wizard_cb_next(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
e_wizard_next();
}

View File

@ -4,19 +4,19 @@
#include "e_mod_main.h"
EAPI int
wizard_page_init(E_Wizard_Page *pg)
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg)
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
static Eina_Bool
_next_page(__UNUSED__ void *data)
_next_page(void *data __UNUSED__)
{
e_wizard_button_next_enable_set(1);
e_wizard_next();
@ -24,7 +24,7 @@ _next_page(__UNUSED__ void *data)
}
EAPI int
wizard_page_show(E_Wizard_Page *pg)
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
e_wizard_title_set(_("Enlightenment"));
e_wizard_button_next_enable_set(0);
@ -33,13 +33,13 @@ wizard_page_show(E_Wizard_Page *pg)
}
EAPI int
wizard_page_hide(E_Wizard_Page *pg)
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
EAPI int
wizard_page_apply(E_Wizard_Page *pg)
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}

View File

@ -67,7 +67,7 @@ _basic_lang_list_sort(const void *data1, const void *data2)
}
EAPI int
wizard_page_init(E_Wizard_Page *pg)
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
{
FILE *output;
@ -122,7 +122,7 @@ wizard_page_init(E_Wizard_Page *pg)
}
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg)
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
// FIXME: free blang_list
return 1;
@ -185,7 +185,7 @@ wizard_page_hide(E_Wizard_Page *pg)
}
EAPI int
wizard_page_apply(E_Wizard_Page *pg)
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
// do this again as we want it to apply to the new profile
eina_stringshare_del(e_config->language);

View File

@ -6,7 +6,7 @@ static const char *profile = NULL;
static Evas_Object *textblock = NULL;
static void
_profile_change(void *data, Evas_Object *obj)
_profile_change(void *data __UNUSED__, Evas_Object *obj __UNUSED__)
{
char buf[PATH_MAX];
const char *dir;
@ -32,13 +32,13 @@ _profile_change(void *data, Evas_Object *obj)
}
EAPI int
wizard_page_init(E_Wizard_Page *pg)
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg)
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
@ -151,7 +151,7 @@ wizard_page_hide(E_Wizard_Page *pg)
}
EAPI int
wizard_page_apply(E_Wizard_Page *pg)
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
// no need. done in page_070's wizard_page_show()
return 1;

View File

@ -25,7 +25,7 @@ check_menu_dir(const char *dir)
}
EAPI int
wizard_page_init(E_Wizard_Page *pg)
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
{
char buf[PATH_MAX];
const char *dirs[] =
@ -61,7 +61,7 @@ wizard_page_init(E_Wizard_Page *pg)
}
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg)
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
// FIXME: free menus
return 1;
@ -194,7 +194,7 @@ wizard_page_hide(E_Wizard_Page *pg)
}
EAPI int
wizard_page_apply(E_Wizard_Page *pg)
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
if ((xdg_sel) && (!strcmp("/etc/xdg/menus/applications.menu", xdg_sel)))
{
@ -203,6 +203,5 @@ wizard_page_apply(E_Wizard_Page *pg)
}
e_config->default_system_menu = eina_stringshare_ref(xdg_sel);
efreet_menu_file_set(e_config->default_system_menu);
// FIXME: no normal config dialog to change this!
return 1;
}

View File

@ -120,57 +120,57 @@ _app_write(App *a)
}
EAPI int
wizard_page_init(E_Wizard_Page *pg)
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
{
Eina_List *desks = NULL;
Efreet_Desktop *desk;
int i;
desks = efreet_util_desktop_name_glob_list("*");
EINA_LIST_FREE(desks, desk)
{
char dbuf[4096];
{
char dbuf[4096];
if (!desk->exec)
{
efreet_desktop_free(desk);
continue;
}
if (sscanf(desk->exec, "%4000s", dbuf) == 1)
if (!desk->exec)
{
efreet_desktop_free(desk);
continue;
}
if (sscanf(desk->exec, "%4000s", dbuf) == 1)
{
for (i = 0; i < (sizeof(apps) / sizeof(App)); i++)
{
for (i = 0; i < (sizeof(apps) / sizeof(App)); i++)
if (apps[i].found == 0)
{
if (apps[i].found == 0)
{
char abuf[4096];
char abuf[4096];
if (sscanf(apps[i].exec, "%4000s", abuf) == 1)
{
char *p1, *p2;
if (sscanf(apps[i].exec, "%4000s", abuf) == 1)
{
char *p1, *p2;
if (!ecore_file_app_installed(abuf))
{
/* can't find exe - mark as not available */
apps[i].found = -1;
}
else
{
p1 = strrchr(dbuf, '/');
if (p1) p1++;
else p1 = dbuf;
p2 = strrchr(abuf, '/');
if (p2) p2++;
else p2 = abuf;
if (!strcmp(p1, p2))
/* mark as found in .desktops */
apps[i].found = 2;
}
if (!ecore_file_app_installed(abuf))
{
/* can't find exe - mark as not available */
apps[i].found = -1;
}
else
{
p1 = strrchr(dbuf, '/');
if (p1) p1++;
else p1 = dbuf;
p2 = strrchr(abuf, '/');
if (p2) p2++;
else p2 = abuf;
if (!strcmp(p1, p2))
/* mark as found in .desktops */
apps[i].found = 2;
}
}
}
}
efreet_desktop_free(desk);
}
efreet_desktop_free(desk);
}
// FIXME: list all apps and of the apps either already installed, or to be
// created, offer them to be added to ibar by default. (actually should be
@ -178,10 +178,11 @@ wizard_page_init(E_Wizard_Page *pg)
return 1;
}
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg)
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
@ -255,7 +256,7 @@ wizard_page_hide(E_Wizard_Page *pg)
return 1;
}
EAPI int
wizard_page_apply(E_Wizard_Page *pg)
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
// FIXME: write ~/.e/e/applications/bar/default/.order
// which should contain whatever apps the user wants in their bar by

View File

@ -15,7 +15,7 @@ _cb_sort_desks(Efreet_Desktop *d1, Efreet_Desktop *d2)
}
EAPI int
wizard_page_init(E_Wizard_Page *pg)
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
{
Eina_List *desks = NULL;
Efreet_Desktop *desk;
@ -23,14 +23,14 @@ wizard_page_init(E_Wizard_Page *pg)
desks = efreet_util_desktop_name_glob_list("*");
desks = eina_list_sort(desks, 0, (Eina_Compare_Cb)_cb_sort_desks);
EINA_LIST_FREE(desks, desk)
{
if (!desk->exec)
{
if (!desk->exec)
{
efreet_desktop_free(desk);
continue;
}
desktops = eina_list_append(desktops, desk);
efreet_desktop_free(desk);
continue;
}
desktops = eina_list_append(desktops, desk);
}
if (desktops)
{
desktops_num = eina_list_count(desktops);
@ -38,13 +38,15 @@ wizard_page_init(E_Wizard_Page *pg)
}
return 1;
}
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg)
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
EAPI int
wizard_page_show(E_Wizard_Page *pg)
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
Evas_Object *o, *of, *ob, *li, *ck;
Evas_Coord mw, mh;
@ -93,14 +95,16 @@ wizard_page_show(E_Wizard_Page *pg)
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
}
EAPI int
wizard_page_hide(E_Wizard_Page *pg)
{
evas_object_del(pg->data);
return 1;
}
EAPI int
wizard_page_apply(E_Wizard_Page *pg)
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
Efreet_Desktop *desk;
Eina_List *l;

View File

@ -2,17 +2,19 @@
#include "e_mod_main.h"
EAPI int
wizard_page_init(E_Wizard_Page *pg)
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg)
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
EAPI int
wizard_page_show(E_Wizard_Page *pg)
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
char buf[PATH_MAX];
@ -33,7 +35,7 @@ wizard_page_hide(E_Wizard_Page *pg)
return 1;
}
EAPI int
wizard_page_apply(E_Wizard_Page *pg)
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
char buf[PATH_MAX];
// setup ~/Desktop and ~/.e/e/fileman/favorites and