forked from enlightenment/enlightenment
Remove wasted whitespace. Fix some formatting.
SVN revision: 44835
This commit is contained in:
parent
22580d466d
commit
46387d608c
|
@ -38,68 +38,43 @@ struct _E_Config_Dialog_Data
|
||||||
*/
|
*/
|
||||||
const CFTypes _types[] =
|
const CFTypes _types[] =
|
||||||
{
|
{
|
||||||
{"appearance", N_("Appearance"), "preferences-appearance"},
|
{"appearance", N_("Appearance"), "preferences-appearance"},
|
||||||
{"config", N_("Settings"), "preferences-system"},
|
{"config", N_("Settings"), "preferences-system"},
|
||||||
{"fileman", N_("File Manager"), "system-file-manager"},
|
{"fileman", N_("File Manager"), "system-file-manager"},
|
||||||
{"shelf", N_("Shelf"), "preferences-desktop-shelf"}, //FIXME use gadget icon
|
{"shelf", N_("Shelf"), "preferences-desktop-shelf"}, //FIXME use gadget icon
|
||||||
{"system", N_("System"), "system"},
|
{"system", N_("System"), "system"},
|
||||||
{NULL, NULL, NULL}
|
{NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* local function protos */
|
/* local function protos */
|
||||||
static void *_create_data (E_Config_Dialog *cfd);
|
static void *_create_data(E_Config_Dialog *cfd);
|
||||||
static void _fill_data (E_Config_Dialog_Data *cfdata);
|
static void _fill_data(E_Config_Dialog_Data *cfdata);
|
||||||
static void _free_data (E_Config_Dialog *cfd,
|
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
E_Config_Dialog_Data *cfdata);
|
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||||
static Evas_Object *_basic_create (E_Config_Dialog *cfd, Evas *evas,
|
static void _fill_type_hash(void);
|
||||||
E_Config_Dialog_Data *cfdata);
|
static void _load_modules(const char *dir);
|
||||||
static void _fill_type_hash (void);
|
static void _fill_list(Evas_Object *obj, int enabled);
|
||||||
static void _load_modules (const char *dir);
|
static Eina_Bool _fill_list_types_avail(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata);
|
||||||
static void _fill_list (Evas_Object *obj, int enabled);
|
static Eina_Bool _fill_list_types_load(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata);
|
||||||
static Eina_Bool _fill_list_types_avail(const Eina_Hash *hash __UNUSED__,
|
static Eina_Bool _fill_list_types(Evas_Object *obj, CFType *cft, int enabled);
|
||||||
const void *key __UNUSED__,
|
static Eina_Bool _types_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__);
|
||||||
void *data, void *fdata);
|
static Eina_Bool _mod_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__);
|
||||||
static Eina_Bool _fill_list_types_load (const Eina_Hash *hash __UNUSED__,
|
static Eina_Bool _mod_hash_avail_list(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata);
|
||||||
const void *key __UNUSED__,
|
static Eina_Bool _mod_hash_load_list(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata);
|
||||||
void *data, void *fdata);
|
static int _mod_list_sort(const void *data1, const void *data2);
|
||||||
static Eina_Bool _fill_list_types (Evas_Object *obj, CFType *cft,
|
static void _list_widget_load(Evas_Object *obj, Eina_List *list);
|
||||||
int enabled);
|
static void _avail_list_cb_change(void *data, Evas_Object *obj);
|
||||||
static Eina_Bool _types_hash_cb_free (const Eina_Hash *hash __UNUSED__,
|
static void _load_list_cb_change(void *data, Evas_Object *obj);
|
||||||
const void *key __UNUSED__,
|
static void _unselect_all_modules(void);
|
||||||
void *data, void *fdata __UNUSED__);
|
static Eina_Bool _mod_hash_unselect(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__);
|
||||||
static Eina_Bool _mod_hash_cb_free (const Eina_Hash *hash __UNUSED__,
|
static void _select_all_modules(Evas_Object *obj, void *data);
|
||||||
const void *key __UNUSED__,
|
static void _btn_cb_unload(void *data, void *data2);
|
||||||
void *data, void *fdata __UNUSED__);
|
static void _btn_cb_load(void *data, void *data2);
|
||||||
static Eina_Bool _mod_hash_avail_list (const Eina_Hash *hash __UNUSED__,
|
static Eina_Bool _mod_hash_load(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__);
|
||||||
const void *key __UNUSED__,
|
static Eina_Bool _mod_hash_unload(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__);
|
||||||
void *data, void *fdata);
|
static void _enable_modules(int enable);
|
||||||
static Eina_Bool _mod_hash_load_list (const Eina_Hash *hash __UNUSED__,
|
static Eina_Bool _enable_modules_types_enable(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata);
|
||||||
const void *key __UNUSED__,
|
static Eina_Bool _enable_modules_types_disable(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata);
|
||||||
void *data, void *fdata);
|
|
||||||
static int _mod_list_sort (const void *data1, const void *data2);
|
|
||||||
static void _list_widget_load (Evas_Object *obj, Eina_List *list);
|
|
||||||
static void _avail_list_cb_change (void *data, Evas_Object *obj);
|
|
||||||
static void _load_list_cb_change (void *data, Evas_Object *obj);
|
|
||||||
static void _unselect_all_modules (void);
|
|
||||||
static Eina_Bool _mod_hash_unselect (const Eina_Hash *hash __UNUSED__,
|
|
||||||
const void *key __UNUSED__,
|
|
||||||
void *data, void *fdata __UNUSED__);
|
|
||||||
static void _select_all_modules (Evas_Object *obj, void *data);
|
|
||||||
static void _btn_cb_unload (void *data, void *data2);
|
|
||||||
static void _btn_cb_load (void *data, void *data2);
|
|
||||||
static Eina_Bool _mod_hash_load (const Eina_Hash *hash __UNUSED__,
|
|
||||||
const void *key __UNUSED__,
|
|
||||||
void *data, void *fdata __UNUSED__);
|
|
||||||
static Eina_Bool _mod_hash_unload (const Eina_Hash *hash __UNUSED__,
|
|
||||||
const void *key __UNUSED__,
|
|
||||||
void *data, void *fdata __UNUSED__);
|
|
||||||
static void _enable_modules (int enable);
|
|
||||||
static Eina_Bool _enable_modules_types_enable (const Eina_Hash *hash __UNUSED__,
|
|
||||||
const void *key __UNUSED__,
|
|
||||||
void *data, void *fdata);
|
|
||||||
static Eina_Bool _enable_modules_types_disable (const Eina_Hash *hash __UNUSED__,
|
|
||||||
const void *key __UNUSED__,
|
|
||||||
void *data, void *fdata);
|
|
||||||
|
|
||||||
/* local variables */
|
/* local variables */
|
||||||
static Eina_Hash *types_hash = NULL;
|
static Eina_Hash *types_hash = NULL;
|
||||||
|
@ -240,10 +215,8 @@ _fill_type_hash(void)
|
||||||
static void
|
static void
|
||||||
_load_modules(const char *dir)
|
_load_modules(const char *dir)
|
||||||
{
|
{
|
||||||
Eina_List *files = NULL;
|
Eina_List *files = NULL, *l;
|
||||||
Eina_List *l;
|
char *mod = NULL, *file;
|
||||||
char *mod = NULL;
|
|
||||||
char *file;
|
|
||||||
|
|
||||||
if (!dir) return;
|
if (!dir) return;
|
||||||
if (!(files = ecore_file_ls(dir))) return;
|
if (!(files = ecore_file_ls(dir))) return;
|
||||||
|
@ -255,7 +228,7 @@ _load_modules(const char *dir)
|
||||||
CFType *cft = NULL;
|
CFType *cft = NULL;
|
||||||
CFModule *cfm = NULL;
|
CFModule *cfm = NULL;
|
||||||
const char *type = NULL;
|
const char *type = NULL;
|
||||||
char buf[4096];
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
/* check that we have a desktop file for this module */
|
/* check that we have a desktop file for this module */
|
||||||
snprintf(buf, sizeof(buf), "%s/%s/module.desktop", dir, mod);
|
snprintf(buf, sizeof(buf), "%s/%s/module.desktop", dir, mod);
|
||||||
|
@ -346,8 +319,7 @@ _fill_list(Evas_Object *obj, int enabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_fill_list_types_avail(const Eina_Hash *hash __UNUSED__,
|
_fill_list_types_avail(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata)
|
||||||
const void *key __UNUSED__, void *data, void *fdata)
|
|
||||||
{
|
{
|
||||||
CFType *cft;
|
CFType *cft;
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
|
@ -416,8 +388,7 @@ _fill_list_types(Evas_Object *obj, CFType *cft, int enabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_types_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
_types_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
|
||||||
void *data, void *fdata __UNUSED__)
|
|
||||||
{
|
{
|
||||||
CFType *type = NULL;
|
CFType *type = NULL;
|
||||||
|
|
||||||
|
@ -436,8 +407,7 @@ _types_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_mod_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
_mod_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
|
||||||
void *data, void *fdata __UNUSED__)
|
|
||||||
{
|
{
|
||||||
CFModule *mod = NULL;
|
CFModule *mod = NULL;
|
||||||
|
|
||||||
|
@ -452,8 +422,7 @@ _mod_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_mod_hash_avail_list(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
_mod_hash_avail_list(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata)
|
||||||
void *data, void *fdata)
|
|
||||||
{
|
{
|
||||||
Eina_List **l;
|
Eina_List **l;
|
||||||
CFModule *mod = NULL;
|
CFModule *mod = NULL;
|
||||||
|
@ -466,8 +435,7 @@ _mod_hash_avail_list(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED_
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_mod_hash_load_list(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
_mod_hash_load_list(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata)
|
||||||
void *data, void *fdata)
|
|
||||||
{
|
{
|
||||||
Eina_List **l;
|
Eina_List **l;
|
||||||
CFModule *mod = NULL;
|
CFModule *mod = NULL;
|
||||||
|
@ -503,7 +471,7 @@ _list_widget_load(Evas_Object *obj, Eina_List *list)
|
||||||
{
|
{
|
||||||
Evas_Object *ic = NULL;
|
Evas_Object *ic = NULL;
|
||||||
char *path;
|
char *path;
|
||||||
char buf[4096];
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
if (!mod) continue;
|
if (!mod) continue;
|
||||||
if (mod->icon)
|
if (mod->icon)
|
||||||
|
@ -597,8 +565,7 @@ _unselect_all_modules(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_mod_hash_unselect(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
_mod_hash_unselect(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
|
||||||
void *data, void *fdata __UNUSED__)
|
|
||||||
{
|
{
|
||||||
CFModule *mod = NULL;
|
CFModule *mod = NULL;
|
||||||
|
|
||||||
|
@ -619,8 +586,8 @@ _select_all_modules(Evas_Object *obj, void *data)
|
||||||
EINA_LIST_FOREACH(e_widget_ilist_items_get(obj), l, item)
|
EINA_LIST_FOREACH(e_widget_ilist_items_get(obj), l, item)
|
||||||
{
|
{
|
||||||
CFModule *mod = NULL;
|
CFModule *mod = NULL;
|
||||||
i++;
|
|
||||||
|
|
||||||
|
i++;
|
||||||
if ((!item) || (!item->selected)) continue;
|
if ((!item) || (!item->selected)) continue;
|
||||||
if (!(mod = e_widget_ilist_nth_data_get(obj, i))) continue;
|
if (!(mod = e_widget_ilist_nth_data_get(obj, i))) continue;
|
||||||
mod->selected = 1;
|
mod->selected = 1;
|
||||||
|
@ -694,34 +661,29 @@ _enable_modules(int enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_enable_modules_types_enable(const Eina_Hash *hash __UNUSED__,
|
_enable_modules_types_enable(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata)
|
||||||
const void *key __UNUSED__, void *data,
|
|
||||||
void *fdata)
|
|
||||||
{
|
{
|
||||||
CFType *cft;
|
CFType *cft;
|
||||||
|
|
||||||
cft = data;
|
cft = data;
|
||||||
if (cft && cft->modules)
|
if ((cft) && (cft->modules))
|
||||||
eina_hash_foreach(cft->modules, _mod_hash_load, NULL);
|
eina_hash_foreach(cft->modules, _mod_hash_load, NULL);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_enable_modules_types_disable(const Eina_Hash *hash __UNUSED__,
|
_enable_modules_types_disable(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata)
|
||||||
const void *key __UNUSED__, void *data,
|
|
||||||
void *fdata)
|
|
||||||
{
|
{
|
||||||
CFType *cft;
|
CFType *cft;
|
||||||
|
|
||||||
cft = data;
|
cft = data;
|
||||||
if (cft && cft->modules)
|
if ((cft) && (cft->modules))
|
||||||
eina_hash_foreach(cft->modules, _mod_hash_unload, NULL);
|
eina_hash_foreach(cft->modules, _mod_hash_unload, NULL);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_mod_hash_load(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
_mod_hash_load(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
|
||||||
void *data, void *fdata __UNUSED__)
|
|
||||||
{
|
{
|
||||||
CFModule *mod = NULL;
|
CFModule *mod = NULL;
|
||||||
E_Module *module = NULL;
|
E_Module *module = NULL;
|
||||||
|
@ -737,8 +699,7 @@ _mod_hash_load(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_mod_hash_unload(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
|
_mod_hash_unload(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
|
||||||
void *data, void *fdata __UNUSED__)
|
|
||||||
{
|
{
|
||||||
CFModule *mod = NULL;
|
CFModule *mod = NULL;
|
||||||
E_Module *module = NULL;
|
E_Module *module = NULL;
|
||||||
|
|
Loading…
Reference in New Issue