From: Enlightenment S. <no-...@en...> - 2010-12-07 19:18:24
|
Log: Indenting and removing bogus code blocks. Author: glima Date: 2010-12-07 11:18:14 -0800 (Tue, 07 Dec 2010) New Revision: 55364 Trac: http://trac.enlightenment.org/e/changeset/55364 Modified: trunk/TMP/st/elementary/src/bin/test_fileselector.c trunk/TMP/st/elementary/src/bin/test_fileselector_button.c trunk/TMP/st/elementary/src/bin/test_fileselector_entry.c trunk/TMP/st/elementary/src/lib/elc_fileselector.c trunk/TMP/st/elementary/src/lib/elc_fileselector_button.c trunk/TMP/st/elementary/src/lib/elm_genlist.c Modified: trunk/TMP/st/elementary/src/bin/test_fileselector.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test_fileselector.c 2010-12-07 19:18:05 UTC (rev 55363) +++ trunk/TMP/st/elementary/src/bin/test_fileselector.c 2010-12-07 19:18:14 UTC (rev 55364) @@ -4,20 +4,24 @@ #endif #ifndef ELM_LIB_QUICKLAUNCH static void -my_fileselector_done(void *data, Evas_Object *obj __UNUSED__, void *event_info) +my_fileselector_done(void *data, + Evas_Object *obj __UNUSED__, + void *event_info) { /* event_info conatin the full path of the selected file * or NULL if none is selected or cancel is pressed */ - const char *selected = event_info; + const char *selected = event_info; - if (selected) - printf("Selected file: %s\n", selected); - else - evas_object_del(data); /* delete the test window */ + if (selected) + printf("Selected file: %s\n", selected); + else + evas_object_del(data); /* delete the test window */ } static void -my_fileselector_selected(void *data __UNUSED__, Evas_Object *obj, void *event_info) +my_fileselector_selected(void *data __UNUSED__, + Evas_Object *obj, + void *event_info) { /* event_info conatin the full path of the selected file */ const char *selected = event_info; @@ -28,54 +32,66 @@ } static void -_is_save_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_is_save_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; printf("Toggle Is save\n"); if (elm_fileselector_is_save_get(fs)) - elm_fileselector_is_save_set(fs, EINA_FALSE); + elm_fileselector_is_save_set(fs, EINA_FALSE); else - elm_fileselector_is_save_set(fs, EINA_TRUE); + elm_fileselector_is_save_set(fs, EINA_TRUE); } static void -_folder_only_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_folder_only_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; printf("Toggle Folder only\n"); if (elm_fileselector_folder_only_get(fs)) - elm_fileselector_folder_only_set(fs, EINA_FALSE); + elm_fileselector_folder_only_set(fs, EINA_FALSE); else - elm_fileselector_folder_only_set(fs, EINA_TRUE); + elm_fileselector_folder_only_set(fs, EINA_TRUE); } static void -_expandable_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_expandable_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; printf("Toggle Expandable\n"); if (elm_fileselector_expandable_get(fs)) - elm_fileselector_expandable_set(fs, EINA_FALSE); + elm_fileselector_expandable_set(fs, EINA_FALSE); else - elm_fileselector_expandable_set(fs, EINA_TRUE); + elm_fileselector_expandable_set(fs, EINA_TRUE); } static void -_sel_get_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_sel_get_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; printf("Get Selected: %s\n", elm_fileselector_selected_get(fs)); } static void -_path_get_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_path_get_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; printf("Get Path: %s\n", elm_fileselector_path_get(fs)); } void -test_fileselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_fileselector(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *win, *fs, *bg, *vbox, *hbox, *bt, *sep; @@ -111,12 +127,13 @@ evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(vbox, fs); evas_object_show(fs); // TODO fix this is the widget - + /* the 'done' cb is called when the user press ok/cancel */ evas_object_smart_callback_add(fs, "done", my_fileselector_done, win); /* the 'selected' cb is called when the user click on a file/dir */ - evas_object_smart_callback_add(fs, "selected", my_fileselector_selected, win); - + evas_object_smart_callback_add(fs, "selected", my_fileselector_selected, + win); + /* test buttons */ sep = elm_separator_add(win); elm_separator_horizontal_set(sep, EINA_TRUE); @@ -127,14 +144,14 @@ elm_box_horizontal_set(hbox, EINA_TRUE); elm_box_pack_end(vbox, hbox); evas_object_show(hbox); - + bt = elm_check_add(win); elm_check_label_set(bt, "is save"); elm_check_state_set(bt, elm_fileselector_is_save_get(fs)); evas_object_smart_callback_add(bt, "changed", _is_save_clicked, fs); elm_box_pack_end(hbox, bt); evas_object_show(bt); - + bt = elm_check_add(win); elm_check_label_set(bt, "folder only"); elm_check_state_set(bt, elm_fileselector_folder_only_get(fs)); @@ -169,4 +186,5 @@ evas_object_resize(win, 240, 350); evas_object_show(win); } + #endif Modified: trunk/TMP/st/elementary/src/bin/test_fileselector_button.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test_fileselector_button.c 2010-12-07 19:18:05 UTC (rev 55363) +++ trunk/TMP/st/elementary/src/bin/test_fileselector_button.c 2010-12-07 19:18:14 UTC (rev 55364) @@ -5,7 +5,9 @@ #ifndef ELM_LIB_QUICKLAUNCH static void -_file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_file_chosen(void *data, + Evas_Object *obj __UNUSED__, + void *event_info) { Evas_Object *entry = data; const char *file = event_info; @@ -19,7 +21,9 @@ } static void -_inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_inwin_mode_toggle(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs_bt = data; Eina_Bool value = elm_fileselector_button_inwin_mode_get(fs_bt); @@ -28,7 +32,9 @@ } static void -_current_sel_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_current_sel_toggle(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs_bt = data; Eina_Bool value = elm_fileselector_button_is_save_get(fs_bt); @@ -38,7 +44,9 @@ } static void -_folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_folder_only_toggle(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs_bt = data; Eina_Bool value = elm_fileselector_button_folder_only_get(fs_bt); @@ -47,7 +55,9 @@ } static void -_expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_expandable_toggle(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs_bt = data; Eina_Bool value = elm_fileselector_button_expandable_get(fs_bt); @@ -56,7 +66,9 @@ } void -test_fileselector_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_fileselector_button(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_bt, *en, *lb; @@ -74,11 +86,6 @@ evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(vbox); - vbox = elm_box_add(win); - evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_win_resize_object_add(win, vbox); - evas_object_show(vbox); - /* file selector button */ ic = elm_icon_add(win); elm_icon_standard_set(ic, "file"); @@ -136,4 +143,5 @@ evas_object_resize(win, 400, 400); evas_object_show(win); } + #endif Modified: trunk/TMP/st/elementary/src/bin/test_fileselector_entry.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test_fileselector_entry.c 2010-12-07 19:18:05 UTC (rev 55363) +++ trunk/TMP/st/elementary/src/bin/test_fileselector_entry.c 2010-12-07 19:18:14 UTC (rev 55364) @@ -5,7 +5,9 @@ #ifndef ELM_LIB_QUICKLAUNCH static void -_file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_file_chosen(void *data, + Evas_Object *obj __UNUSED__, + void *event_info) { Evas_Object *entry = data; char *file = event_info; @@ -14,7 +16,9 @@ } static void -_inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_inwin_mode_toggle(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs_en = data; Eina_Bool value = elm_fileselector_entry_inwin_mode_get(fs_en); @@ -23,7 +27,9 @@ } static void -_folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_folder_only_toggle(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs_en = data; Evas_Object *ic = elm_fileselector_entry_button_icon_get(fs_en); @@ -43,7 +49,9 @@ } static void -_expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_expandable_toggle(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs_en = data; Eina_Bool value = elm_fileselector_entry_expandable_get(fs_en); @@ -52,7 +60,9 @@ } static void -_disabled_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_disabled_toggle(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs_en = data; Eina_Bool value = elm_object_disabled_get(fs_en); @@ -61,7 +71,9 @@ } void -test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_fileselector_entry(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_en, *en, *lb; @@ -75,12 +87,7 @@ evas_object_show(bg); vbox = elm_box_add(win); - elm_win_resize_object_add(win, vbox); evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(vbox); - - vbox = elm_box_add(win); - evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, vbox); evas_object_show(vbox); @@ -138,7 +145,6 @@ elm_box_pack_end(hbox, bt); evas_object_show(bt); - en = elm_entry_add(win); elm_entry_line_wrap_set(en, EINA_FALSE); elm_entry_editable_set(en, EINA_FALSE); @@ -149,4 +155,5 @@ evas_object_resize(win, 400, 500); evas_object_show(win); } + #endif Modified: trunk/TMP/st/elementary/src/lib/elc_fileselector.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elc_fileselector.c 2010-12-07 19:18:05 UTC (rev 55363) +++ trunk/TMP/st/elementary/src/lib/elc_fileselector.c 2010-12-07 19:18:14 UTC (rev 55364) @@ -1,10 +1,10 @@ /** * @defgroup Fileselector Fileselector * - * A fileselector is a widget that allows a user to navigate through a tree - * of files. It contains buttons for Home(~) and Up(..) as well as cancel/ok - * buttons to confirm/cancel a selection. This widget is currently very much - * in progress. + * A fileselector is a widget that allows a user to navigate through a + * tree of files. It contains buttons for Home(~) and Up(..) as well + * as cancel/ok buttons to confirm/cancel a selection. This widget is + * currently very much in progress. * * TODO * userdefined icon/label cb @@ -18,7 +18,8 @@ * Signals that you can add callbacks for are: * * "selected" - the user clicks on a file - * "directory,open" - the list is populated with a new content. event_info is a directory. + * "directory,open" - the list is populated with new content. + * event_info is a directory. * "done" - the user clicks on the ok or cancel button */ @@ -39,38 +40,41 @@ Evas_Object *ok_button; Evas_Object *cancel_button; - const char *path; - const char *selection; + const char *path; + const char *selection; Ecore_Idler *sel_idler; - const char *path_separator; + const char *path_separator; - Eina_Bool only_folder : 1; - Eina_Bool expand : 1; + Eina_Bool only_folder : 1; + Eina_Bool expand : 1; }; struct sel_data { Evas_Object *fs; - const char *path; + const char *path; }; Elm_Genlist_Item_Class itc; static const char *widtype = NULL; -static const char SIG_DIRECTORY_OPEN[]= "directory,open"; +static const char SIG_DIRECTORY_OPEN[] = "directory,open"; static const char SIG_DONE[] = "done"; static const char SIG_SELECTED[] = "selected"; static const Evas_Smart_Cb_Description _signals[] = { - {SIG_DIRECTORY_OPEN, "s"}, - {SIG_DONE, "s"}, - {SIG_SELECTED, "s"}, - {NULL, NULL} + {SIG_DIRECTORY_OPEN, "s"}, + {SIG_DONE, "s"}, + {SIG_SELECTED, "s"}, + {NULL, NULL} }; -static void _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent); -static void _do_anchors(Evas_Object *obj, const char *path); +static void _populate(Evas_Object *obj, + const char *path, + Elm_Genlist_Item *parent); +static void _do_anchors(Evas_Object *obj, + const char *path); /*** ELEMENTARY WIDGET ***/ static void @@ -86,8 +90,8 @@ if (wd->selection) eina_stringshare_del(wd->selection); if (wd->sel_idler) { - sd = ecore_idler_del(wd->sel_idler); - free(sd); + sd = ecore_idler_del(wd->sel_idler); + free(sd); } free(wd); } @@ -103,15 +107,15 @@ evas_object_size_hint_min_set(obj, minw, minh); } -#define SWALLOW(part_name, object_ptn) \ - if (object_ptn) \ - { \ - elm_widget_style_set(object_ptn, buf); \ - if (edje_object_part_swallow(wd->edje, part_name, object_ptn)) \ - evas_object_show(object_ptn); \ - else \ - evas_object_hide(object_ptn); \ - } +#define SWALLOW(part_name, object_ptn) \ + if (object_ptn) \ + { \ + elm_widget_style_set(object_ptn, buf); \ + if (edje_object_part_swallow(wd->edje, part_name, object_ptn)) \ + evas_object_show(object_ptn); \ + else \ + evas_object_hide(object_ptn); \ + } static void _theme_hook(Evas_Object *obj) @@ -125,7 +129,7 @@ _elm_theme_object_set(obj, wd->edje, "fileselector", "base", style); if (elm_object_disabled_get(obj)) - edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm"); + edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm"); data = edje_object_data_get(wd->edje, "path_separator"); if (data) @@ -153,25 +157,32 @@ } /*** GENLIST "MODEL" ***/ -static char* -_itc_label_get(void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) +static char * +_itc_label_get(void *data, + Evas_Object *obj __UNUSED__, + const char *source __UNUSED__) { - return strdup(ecore_file_file_get(data)); // NOTE this will be free() by the caller + return strdup(ecore_file_file_get(data)); /* NOTE this will be + * free() by the + * caller */ } -static Evas_Object* -_itc_icon_get(void *data, Evas_Object *obj, const char *source) +static Evas_Object * +_itc_icon_get(void *data, + Evas_Object *obj, + const char *source) { Evas_Object *ic; if (!strcmp(source, "elm.swallow.icon")) { ic = elm_icon_add(obj); - if (ecore_file_is_dir((char*)data)) + if (ecore_file_is_dir((char *)data)) elm_icon_standard_set(ic, "folder"); else elm_icon_standard_set(ic, "file"); - evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, + 1, 1); evas_object_show(ic); return ic; } @@ -179,19 +190,24 @@ } static Eina_Bool -_itc_state_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) +_itc_state_get(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + const char *source __UNUSED__) { return EINA_FALSE; } static void -_itc_del(void *data, Evas_Object *obj __UNUSED__) +_itc_del(void *data, + Evas_Object *obj __UNUSED__) { eina_stringshare_del(data); } static void -_expand_done(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_expand_done(void *data, + Evas_Object *obj __UNUSED__, + void *event_info) { Elm_Genlist_Item *it = event_info; const char *path = elm_genlist_item_data_get(it); @@ -199,21 +215,27 @@ } static void -_contract_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +_contract_done(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info) { Elm_Genlist_Item *it = event_info; elm_genlist_item_subitems_clear(it); } static void -_expand_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +_expand_req(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info) { Elm_Genlist_Item *it = event_info; elm_genlist_item_expanded_set(it, 1); } static void -_contract_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +_contract_req(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info) { Elm_Genlist_Item *it = event_info; elm_genlist_item_expanded_set(it, 0); @@ -237,7 +259,8 @@ if (wd->expand) { _do_anchors(sd->fs, path); - if (wd->filename_entry) elm_scrolled_entry_entry_set(wd->filename_entry, ""); + if (wd->filename_entry) + elm_scrolled_entry_entry_set(wd->filename_entry, ""); } else { @@ -251,19 +274,22 @@ else { if (wd->filename_entry) - elm_scrolled_entry_entry_set(wd->filename_entry, ecore_file_file_get(path)); + elm_scrolled_entry_entry_set(wd->filename_entry, + ecore_file_file_get(path)); } evas_object_smart_callback_call(sd->fs, SIG_SELECTED, (void *)path); - end: +end: wd->sel_idler = NULL; free(sd); return ECORE_CALLBACK_CANCEL; } static void -_sel(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_sel(void *data, + Evas_Object *obj __UNUSED__, + void *event_info) { struct sel_data *sd; Widget_Data *wd; @@ -287,7 +313,7 @@ { eina_stringshare_replace(&wd->path, ""); } - + if (wd->sel_idler) { old_sd = ecore_idler_del(wd->sel_idler); @@ -297,7 +323,9 @@ } static void -_up(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_up(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; char *parent; @@ -310,29 +338,37 @@ } static void -_home(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_home(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; _populate(fs, getenv("HOME"), NULL); } static void -_ok(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_ok(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; evas_object_smart_callback_call(fs, SIG_DONE, - (void *)elm_fileselector_selected_get(fs)); + (void *)elm_fileselector_selected_get(fs)); } static void -_canc(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_canc(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Evas_Object *fs = data; evas_object_smart_callback_call(fs, SIG_DONE, NULL); } static void -_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_anchor_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info) { Evas_Object *fs = data; Widget_Data *wd = elm_widget_data_get(fs); @@ -347,10 +383,11 @@ } static void -_do_anchors(Evas_Object *obj, const char *path) +_do_anchors(Evas_Object *obj, + const char *path) { Widget_Data *wd = elm_widget_data_get(obj); - char **tok, buf[PATH_MAX*3]; + char **tok, buf[PATH_MAX * 3]; int i, j; if (!wd) return; buf[0] = '\0'; @@ -378,7 +415,9 @@ } static void -_populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent) +_populate(Evas_Object *obj, + const char *path, + Elm_Genlist_Item *parent) { Widget_Data *wd = elm_widget_data_get(obj); DIR *dir; @@ -401,10 +440,12 @@ if (wd->filename_entry) elm_scrolled_entry_entry_set(wd->filename_entry, ""); while ((dp = readdir(dir))) { - if (dp->d_name[0] == '.') continue; // TODO make this configurable + if (dp->d_name[0] == '.') continue; // TODO make this configurable snprintf(buf, sizeof(buf), "%s/%s", path, dp->d_name); - real = ecore_file_realpath(buf); //TODO this will resolv symlinks...I dont like it + real = ecore_file_realpath(buf); /* TODO: this will resolv + * symlinks...I dont like + * it*/ if (ecore_file_is_dir(real)) dirs = eina_list_append(dirs, real); else if (!wd->only_folder) @@ -412,7 +453,8 @@ } closedir(dir); - files = eina_list_sort(files, eina_list_count(files), EINA_COMPARE_CB(strcoll)); + files = eina_list_sort(files, eina_list_count(files), + EINA_COMPARE_CB(strcoll)); dirs = eina_list_sort(dirs, eina_list_count(dirs), EINA_COMPARE_CB(strcoll)); EINA_LIST_FOREACH(dirs, l, real) { @@ -564,7 +606,8 @@ * @ingroup Fileselector */ EAPI void -elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save) +elm_fileselector_is_save_set(Evas_Object *obj, + Eina_Bool is_save) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -595,7 +638,6 @@ return elm_object_disabled_get(wd->filename_entry); } - /** * This enables/disables folder-only view in the fileselector. * @@ -606,7 +648,8 @@ * @ingroup Fileselector */ EAPI void -elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only) +elm_fileselector_folder_only_set(Evas_Object *obj, + Eina_Bool only) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -615,7 +658,6 @@ wd->only_folder = !!only; } - /** * This gets the state of file display in the fileselector. * @@ -634,7 +676,6 @@ return wd->only_folder; } - /** * This enables/disables the ok,cancel buttons. * @@ -645,7 +686,8 @@ * @ingroup Fileselector */ EAPI void -elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool visible) +elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, + Eina_Bool visible) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -701,7 +743,6 @@ return wd->ok_button ? EINA_TRUE : EINA_FALSE; } - /** * This enables tree view in the fileselector. Arrows are created on the * sides of directories, allowing them to expand in place. @@ -713,7 +754,8 @@ * @ingroup Fileselector */ EAPI void -elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand) +elm_fileselector_expandable_set(Evas_Object *obj, + Eina_Bool expand) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd; @@ -751,7 +793,8 @@ * @ingroup Fileselector */ EAPI void -elm_fileselector_path_set(Evas_Object *obj, const char *path) +elm_fileselector_path_set(Evas_Object *obj, + const char *path) { ELM_CHECK_WIDTYPE(obj, widtype); _populate(obj, path, NULL); @@ -818,7 +861,8 @@ * @ingroup Fileselector */ EAPI Eina_Bool -elm_fileselector_selected_set(Evas_Object *obj, const char *path) +elm_fileselector_selected_set(Evas_Object *obj, + const char *path) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); @@ -834,7 +878,8 @@ _populate(obj, ecore_file_dir_get(path), NULL); if (wd->filename_entry) { - elm_scrolled_entry_entry_set(wd->filename_entry, ecore_file_file_get(path)); + elm_scrolled_entry_entry_set(wd->filename_entry, + ecore_file_file_get(path)); eina_stringshare_replace(&wd->selection, path); } } Modified: trunk/TMP/st/elementary/src/lib/elc_fileselector_button.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elc_fileselector_button.c 2010-12-07 19:18:05 UTC (rev 55363) +++ trunk/TMP/st/elementary/src/lib/elc_fileselector_button.c 2010-12-07 19:18:14 UTC (rev 55364) @@ -1,7 +1,7 @@ #include <Elementary.h> #include "elm_priv.h" - /** +/** * @defgroup File_Selector_Button File Selector Button * * A button that, when clicked, creates an Elementary window (or inner @@ -15,15 +15,16 @@ struct _Widget_Data { Evas_Object *self, *btn, *fs, *fsw; - const char *window_title; - Evas_Coord w, h; - struct { + const char *window_title; + Evas_Coord w, h; + struct + { const char *path; - Eina_Bool expandable:1; - Eina_Bool folder_only:1; - Eina_Bool is_save:1; + Eina_Bool expandable : 1; + Eina_Bool folder_only : 1; + Eina_Bool is_save : 1; } fsd; - Eina_Bool inwin_mode:1; + Eina_Bool inwin_mode : 1; }; #define DEFAULT_WINDOW_TITLE "Select a file" @@ -34,15 +35,21 @@ static void _theme_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); -static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _on_focus_hook(void *data, Evas_Object *obj); -static void _selection_done(void *data, Evas_Object *obj, void *event_info); +static void _changed_size_hints(void *data, + Evas *e, + Evas_Object *obj, + void *event_info); +static void _on_focus_hook(void *data, + Evas_Object *obj); +static void _selection_done(void *data, + Evas_Object *obj, + void *event_info); static void _activate(Widget_Data *wd); static const char SIG_FILE_CHOSEN[] = "file,chosen"; static const Evas_Smart_Cb_Description _signals[] = { - {SIG_FILE_CHOSEN, "s"}, - {NULL, NULL} + {SIG_FILE_CHOSEN, "s"}, + {NULL, NULL} }; static void @@ -58,14 +65,15 @@ if (wd->fsd.path) eina_stringshare_del(wd->fsd.path); if (wd->fs) { - win = evas_object_data_del(obj, "win"); - evas_object_del(win); + win = evas_object_data_del(obj, "win"); + evas_object_del(win); } free(wd); } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) +_on_focus_hook(void *data __UNUSED__, + Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -79,7 +87,8 @@ Widget_Data *wd = elm_widget_data_get(obj); char buf[4096]; if (!wd) return; - snprintf(buf, sizeof(buf), "fileselector_button/%s", elm_widget_style_get(obj)); + snprintf(buf, sizeof(buf), "fileselector_button/%s", + elm_widget_style_get(obj)); elm_object_style_set(wd->btn, buf); _sizing_eval(obj); } @@ -105,7 +114,10 @@ } static void -_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_changed_size_hints(void *data, + Evas *e __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -122,7 +134,9 @@ } static void -_button_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_button_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { _activate(data); } @@ -163,11 +177,11 @@ if (wd->inwin_mode) { - wd->fsw = _parent_win_get(wd->self); + wd->fsw = _parent_win_get(wd->self); - if (!wd->fsw) + if (!wd->fsw) wd->fsw = _new_window_add(wd); - else + else { wd->fsw = elm_win_inwin_add(wd->fsw); is_inwin = EINA_TRUE; @@ -182,25 +196,27 @@ elm_fileselector_is_save_set(wd->fs, wd->fsd.is_save); elm_fileselector_selected_set(wd->fs, wd->fsd.path); evas_object_size_hint_weight_set(wd->fs, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); + EVAS_HINT_EXPAND); evas_object_size_hint_align_set(wd->fs, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add(wd->fs, "done", _selection_done, wd); evas_object_show(wd->fs); if (is_inwin) { - elm_win_inwin_content_set(wd->fsw, wd->fs); - elm_win_inwin_activate(wd->fsw); + elm_win_inwin_content_set(wd->fsw, wd->fs); + elm_win_inwin_activate(wd->fsw); } else { - elm_win_resize_object_add(wd->fsw, wd->fs); - evas_object_show(wd->fsw); + elm_win_resize_object_add(wd->fsw, wd->fs); + evas_object_show(wd->fsw); } } static void -_selection_done(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_selection_done(void *data, + Evas_Object *obj __UNUSED__, + void *event_info) { const char *file = event_info; Widget_Data *wd = data; @@ -214,7 +230,7 @@ wd->fsw = NULL; evas_object_del(del); - evas_object_smart_callback_call(wd->self, SIG_FILE_CHOSEN, + evas_object_smart_callback_call(wd->self, SIG_FILE_CHOSEN, (void *)wd->fsd.path); } @@ -260,7 +276,7 @@ wd->btn = elm_button_add(parent); elm_widget_resize_object_set(obj, wd->btn); evas_object_event_callback_add(wd->btn, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); + _changed_size_hints, obj); evas_object_smart_callback_add(wd->btn, "clicked", _button_clicked, wd); elm_widget_sub_object_add(obj, wd->btn); @@ -278,7 +294,8 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_label_set(Evas_Object *obj, const char *label) +elm_fileselector_button_label_set(Evas_Object *obj, + const char *label) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -286,7 +303,6 @@ elm_button_label_set(wd->btn, label); } - /** * Get the label used in the file selector button. * @@ -316,7 +332,8 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_window_title_set(Evas_Object *obj, const char *title) +elm_fileselector_button_window_title_set(Evas_Object *obj, + const char *title) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -359,7 +376,9 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height) +elm_fileselector_button_window_size_set(Evas_Object *obj, + Evas_Coord width, + Evas_Coord height) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -382,7 +401,9 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height) +elm_fileselector_button_window_size_get(const Evas_Object *obj, + Evas_Coord *width, + Evas_Coord *height) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -404,7 +425,8 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_path_set(Evas_Object *obj, const char *path) +elm_fileselector_button_path_set(Evas_Object *obj, + const char *path) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -414,7 +436,6 @@ if (wd->fs) elm_fileselector_selected_set(wd->fs, wd->fsd.path); - } /** @@ -445,7 +466,8 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_expandable_set(Evas_Object *obj, Eina_Bool value) +elm_fileselector_button_expandable_set(Evas_Object *obj, + Eina_Bool value) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -485,7 +507,8 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_folder_only_set(Evas_Object *obj, Eina_Bool value) +elm_fileselector_button_folder_only_set(Evas_Object *obj, + Eina_Bool value) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -525,7 +548,8 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_is_save_set(Evas_Object *obj, Eina_Bool value) +elm_fileselector_button_is_save_set(Evas_Object *obj, + Eina_Bool value) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -566,7 +590,8 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_inwin_mode_set(Evas_Object *obj, Eina_Bool value) +elm_fileselector_button_inwin_mode_set(Evas_Object *obj, + Eina_Bool value) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -606,7 +631,8 @@ * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_icon_set(Evas_Object *obj, Evas_Object *icon) +elm_fileselector_button_icon_set(Evas_Object *obj, + Evas_Object *icon) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -653,3 +679,4 @@ if (!wd) return NULL; return elm_button_icon_unset(wd->btn); } + Modified: trunk/TMP/st/elementary/src/lib/elm_genlist.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elm_genlist.c 2010-12-07 19:18:05 UTC (rev 55363) +++ trunk/TMP/st/elementary/src/lib/elm_genlist.c 2010-12-07 19:18:14 UTC (rev 55364) @@ -2,9 +2,9 @@ #include <Elementary_Cursor.h> #include "elm_priv.h" -#define SWIPE_MOVES 12 +#define SWIPE_MOVES 12 #define MAX_ITEMS_PER_BLOCK 32 -#define LONGPRESS_TIMEOUT 1.0 +#define LONGPRESS_TIMEOUT 1.0 /** * @defgroup Genlist Genlist @@ -263,174 +263,185 @@ */ typedef struct _Widget_Data Widget_Data; -typedef struct _Item_Block Item_Block; -typedef struct _Pan Pan; -typedef struct _Item_Cache Item_Cache; +typedef struct _Item_Block Item_Block; +typedef struct _Pan Pan; +typedef struct _Item_Cache Item_Cache; struct _Widget_Data { - Evas_Object *obj, *scr, *pan_smart; - Eina_Inlist *items, *blocks; - Pan *pan; - Evas_Coord pan_x, pan_y, w, h, minw, minh, realminw, prev_viewport_w; - Ecore_Job *calc_job, *update_job; - Ecore_Idler *queue_idler; - Ecore_Idler *must_recalc_idler; - Eina_List *queue, *selected; + Evas_Object *obj, *scr, *pan_smart; + Eina_Inlist *items, *blocks; + Pan *pan; + Evas_Coord pan_x, pan_y, w, h, minw, minh, realminw, prev_viewport_w; + Ecore_Job *calc_job, *update_job; + Ecore_Idler *queue_idler; + Ecore_Idler *must_recalc_idler; + Eina_List *queue, *selected; Elm_Genlist_Item *show_item; Elm_Genlist_Item *last_selected_item; - Eina_Inlist *item_cache; + Eina_Inlist *item_cache; Elm_Genlist_Item *anchor_item; - Evas_Coord anchor_y; - Elm_List_Mode mode; - Eina_Bool on_hold : 1; - Eina_Bool multi : 1; - Eina_Bool always_select : 1; - Eina_Bool longpressed : 1; - Eina_Bool wasselected : 1; - Eina_Bool no_select : 1; - Eina_Bool bring_in : 1; - Eina_Bool compress : 1; - Eina_Bool height_for_width : 1; - Eina_Bool homogeneous : 1; - Eina_Bool clear_me : 1; - Eina_Bool swipe : 1; - struct { - Evas_Coord x, y; + Evas_Coord anchor_y; + Elm_List_Mode mode; + Eina_Bool on_hold : 1; + Eina_Bool multi : 1; + Eina_Bool always_select : 1; + Eina_Bool longpressed : 1; + Eina_Bool wasselected : 1; + Eina_Bool no_select : 1; + Eina_Bool bring_in : 1; + Eina_Bool compress : 1; + Eina_Bool height_for_width : 1; + Eina_Bool homogeneous : 1; + Eina_Bool clear_me : 1; + Eina_Bool swipe : 1; + struct + { + Evas_Coord x, y; } history[SWIPE_MOVES]; - int item_cache_count; - int item_cache_max; - int movements; - int walking; - int item_width; - int item_height; - int max_items_per_block; - double longpress_timeout; + int item_cache_count; + int item_cache_max; + int movements; + int walking; + int item_width; + int item_height; + int max_items_per_block; + double longpress_timeout; }; struct _Item_Block { EINA_INLIST; - int count; - int num; + int count; + int num; Widget_Data *wd; - Eina_List *items; - Evas_Coord x, y, w, h, minw, minh; - Eina_Bool want_unrealize : 1; - Eina_Bool realized : 1; - Eina_Bool changed : 1; - Eina_Bool updateme : 1; - Eina_Bool showme : 1; - Eina_Bool must_recalc : 1; + Eina_List *items; + Evas_Coord x, y, w, h, minw, minh; + Eina_Bool want_unrealize : 1; + Eina_Bool realized : 1; + Eina_Bool changed : 1; + Eina_Bool updateme : 1; + Eina_Bool showme : 1; + Eina_Bool must_recalc : 1; }; struct _Elm_Genlist_Item { - Elm_Widget_Item base; + Elm_Widget_Item base; EINA_INLIST; - Widget_Data *wd; - Item_Block *block; - Eina_List *items; - Evas_Coord x, y, w, h, minw, minh; + Widget_Data *wd; + Item_Block *block; + Eina_List *items; + Evas_Coord x, y, w, h, minw, minh; const Elm_Genlist_Item_Class *itc; - Elm_Genlist_Item *parent; - Elm_Genlist_Item_Flags flags; - struct { - Evas_Smart_Cb func; - const void *data; + Elm_Genlist_Item *parent; + Elm_Genlist_Item_Flags flags; + struct + { + Evas_Smart_Cb func; + const void *data; } func; - Evas_Object *spacer; - Eina_List *labels, *icons, *states, *icon_objs; - Ecore_Timer *long_timer; - Ecore_Timer *swipe_timer; - Evas_Coord dx, dy; + Evas_Object *spacer; + Eina_List *labels, *icons, *states, *icon_objs; + Ecore_Timer *long_timer; + Ecore_Timer *swipe_timer; + Evas_Coord dx, dy; Elm_Genlist_Item *rel; - struct { - const void *data; - Elm_Tooltip_Item_Content_Cb content_cb; - Evas_Smart_Cb del_cb; - const char *style; + struct + { + const void *data; + Elm_Tooltip_Item_Content_Cb content_cb; + Evas_Smart_Cb del_cb; + const char *style; } tooltip; const char *mouse_cursor; - int relcount; - int walking; - int expanded_depth; - int order_num_in; - - Eina_Bool before : 1; + int relcount; + int walking; + int expanded_depth; + int order_num_in; - Eina_Bool want_unrealize : 1; - Eina_Bool realized : 1; - Eina_Bool selected : 1; - Eina_Bool hilighted : 1; - Eina_Bool expanded : 1; - Eina_Bool disabled : 1; - Eina_Bool display_only : 1; - Eina_Bool mincalcd : 1; - Eina_Bool queued : 1; - Eina_Bool showme : 1; - Eina_Bool delete_me : 1; - Eina_Bool down : 1; - Eina_Bool dragging : 1; - Eina_Bool updateme : 1; + Eina_Bool before : 1; + + Eina_Bool want_unrealize : 1; + Eina_Bool realized : 1; + Eina_Bool selected : 1; + Eina_Bool hilighted : 1; + Eina_Bool expanded : 1; + Eina_Bool disabled : 1; + Eina_Bool display_only : 1; + Eina_Bool mincalcd : 1; + Eina_Bool queued : 1; + Eina_Bool showme : 1; + Eina_Bool delete_me : 1; + Eina_Bool down : 1; + Eina_Bool dragging : 1; + Eina_Bool updateme : 1; }; struct _Item_Cache { - EINA_INLIST; + EINA_INLIST; - Evas_Object *base_view, *spacer; - - const char *item_style; // it->itc->item_style - Eina_Bool tree : 1; // it->flags & ELM_GENLIST_ITEM_SUBITEMS - Eina_Bool compress : 1; // it->wd->compress - Eina_Bool odd : 1; // in & 0x1 - - Eina_Bool selected : 1; // it->selected - Eina_Bool disabled : 1; // it->disabled - Eina_Bool expanded : 1; // it->expanded + Evas_Object *base_view, *spacer; + + const char *item_style; // it->itc->item_style + Eina_Bool tree : 1; // it->flags & ELM_GENLIST_ITEM_SUBITEMS + Eina_Bool compress : 1; // it->wd->compress + Eina_Bool odd : 1; // in & 0x1 + + Eina_Bool selected : 1; // it->selected + Eina_Bool disabled : 1; // it->disabled + Eina_Bool expanded : 1; // it->expanded }; -#define ELM_GENLIST_ITEM_FROM_INLIST(item) \ +#define ELM_GENLIST_ITEM_FROM_INLIST(item) \ ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Genlist_Item) : NULL) struct _Pan { Evas_Object_Smart_Clipped_Data __clipped_data; - Widget_Data *wd; - Ecore_Job *resize_job; + Widget_Data *wd; + Ecore_Job *resize_job; }; static const char *widtype = NULL; -static void _item_cache_zero(Widget_Data *wd); -static void _del_hook(Evas_Object *obj); -static void _theme_hook(Evas_Object *obj); +static void _item_cache_zero(Widget_Data *wd); +static void _del_hook(Evas_Object *obj); +static void _theme_hook(Evas_Object *obj); //static void _show_region_hook(void *data, Evas_Object *obj); -static void _sizing_eval(Evas_Object *obj); -static void _item_unrealize(Elm_Genlist_Item *it); -static void _item_block_unrealize(Item_Block *itb); -static void _calc_job(void *data); -static void _on_focus_hook(void *data, Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); +static void _sizing_eval(Evas_Object *obj); +static void _item_unrealize(Elm_Genlist_Item *it); +static void _item_block_unrealize(Item_Block *itb); +static void _calc_job(void *data); +static void _on_focus_hook(void *data, + Evas_Object *obj); +static Eina_Bool _event_hook(Evas_Object *obj, + Evas_Object *src, + Evas_Callback_Type type, + void *event_info); static Eina_Bool _item_multi_select_up(Widget_Data *wd); static Eina_Bool _item_multi_select_down(Widget_Data *wd); static Eina_Bool _item_single_select_up(Widget_Data *wd); static Eina_Bool _item_single_select_down(Widget_Data *wd); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); +static Eina_Bool _event_hook(Evas_Object *obj, + Evas_Object *src, + Evas_Callback_Type type, + void *event_info); static Eina_Bool _deselect_all_items(Widget_Data *wd); -static void _pan_calculate(Evas_Object *obj); +static void _pan_calculate(Evas_Object *obj); static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION; static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) +_event_hook(Evas_Object *obj, + Evas_Object *src __UNUSED__, + Evas_Callback_Type type, + void *event_info) { if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; Evas_Event_Key_Down *ev = event_info; @@ -459,14 +470,15 @@ { x -= step_x; } - else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) + else if ((!strcmp(ev->keyname, "Right")) || + (!strcmp(ev->keyname, "KP_Right"))) { x += step_x; } - else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) + else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) { if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_up(wd))) + (_item_multi_select_up(wd))) || (_item_single_select_up(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; @@ -478,7 +490,7 @@ else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) { if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_down(wd))) + (_item_multi_select_down(wd))) || (_item_single_select_down(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; @@ -530,9 +542,9 @@ } else if (!strcmp(ev->keyname, "Escape")) { - if (!_deselect_all_items(wd)) return EINA_FALSE; - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; + if (!_deselect_all_items(wd)) return EINA_FALSE; + ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; + return EINA_TRUE; } else return EINA_FALSE; @@ -640,7 +652,8 @@ } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) +_on_focus_hook(void *data __UNUSED__, + Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -687,37 +700,38 @@ Item_Block *itb; if (!wd) return; _item_cache_zero(wd); - elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base", elm_widget_style_get(obj)); + elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base", + elm_widget_style_get(obj)); // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); wd->item_width = wd->item_height = 0; wd->minw = wd->minh = wd->realminw = 0; EINA_INLIST_FOREACH(wd->blocks, itb) - { - Eina_List *l; - Elm_Genlist_Item *it; + { + Eina_List *l; + Elm_Genlist_Item *it; - if (itb->realized) _item_block_unrealize(itb); - EINA_LIST_FOREACH(itb->items, l, it) - it->mincalcd = EINA_FALSE; + if (itb->realized) _item_block_unrealize(itb); + EINA_LIST_FOREACH(itb->items, l, it) + it->mincalcd = EINA_FALSE; - itb->changed = EINA_TRUE; - } + itb->changed = EINA_TRUE; + } if (wd->calc_job) ecore_job_del(wd->calc_job); wd->calc_job = ecore_job_add(_calc_job, wd); _sizing_eval(obj); } /* -static void -_show_region_hook(void *data, Evas_Object *obj) -{ + static void + _show_region_hook(void *data, Evas_Object *obj) + { Widget_Data *wd = elm_widget_data_get(data); Evas_Coord x, y, w, h; if (!wd) return; elm_widget_show_region_get(obj, &x, &y, &w, &h); elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); -} -*/ + } + */ static void _sizing_eval(Evas_Object *obj) @@ -730,41 +744,42 @@ minh = -1; if (wd->height_for_width) { - Evas_Coord vw, vh; - - elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); - if ((vw != 0) && (vw != wd->prev_viewport_w)) - { - Item_Block *itb; - - wd->prev_viewport_w = vw; - EINA_INLIST_FOREACH(wd->blocks, itb) + Evas_Coord vw, vh; + + elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); + if ((vw != 0) && (vw != wd->prev_viewport_w)) + { + Item_Block *itb; + + wd->prev_viewport_w = vw; + EINA_INLIST_FOREACH(wd->blocks, itb) { - itb->must_recalc = EINA_TRUE; + itb->must_recalc = EINA_TRUE; } - if (wd->calc_job) ecore_job_del(wd->calc_job); - wd->calc_job = ecore_job_add(_calc_job, wd); - } + if (wd->calc_job) ecore_job_del(wd->calc_job); + wd->calc_job = ecore_job_add(_calc_job, wd); + } } if (wd->mode == ELM_LIST_LIMIT) { - Evas_Coord vmw, vmh, vw, vh; + Evas_Coord vmw, vmh, vw, vh; minw = wd->realminw; maxw = -1; elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); if ((minw > 0) && (vw < minw)) vw = minw; - else if ((maxw > 0) && (vw > maxw)) vw = maxw; + else if ((maxw > 0) && (vw > maxw)) + vw = maxw; edje_object_size_min_calc - (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh); + (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh); minw = vmw + minw; } else { - Evas_Coord vmw, vmh; + Evas_Coord vmw, vmh; edje_object_size_min_calc - (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh); + (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh); minw = vmw; minh = vmh; } @@ -824,7 +839,8 @@ itbp->count++; itbp->changed = EINA_TRUE; } - it->wd->blocks = eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb)); + it->wd->blocks = eina_inlist_remove(it->wd->blocks, + EINA_INLIST_GET(itb)); free(itb); } else if ((itbn) && ((itbn->count + itb->count) < 48)) @@ -841,7 +857,7 @@ itbn->changed = EINA_TRUE; } it->wd->blocks = - eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb)); + eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb)); free(itb); } } @@ -877,7 +893,7 @@ if (it->tooltip.del_cb) it->tooltip.del_cb((void *)it->tooltip.data, it->base.widget, it); - + elm_widget_item_del(it); } @@ -892,7 +908,7 @@ } it->selected = EINA_TRUE; it->wd->selected = eina_list_append(it->wd->selected, it); - call: +call: it->walking++; it->wd->walking++; if (it->func.func) it->func.func((void *)it->func.data, it->base.widget, it); @@ -901,7 +917,7 @@ it->walking--; it->wd->walking--; if ((it->wd->clear_me) && (!it->wd->walking)) - elm_genlist_clear(it->base.widget); + elm_genlist_clear(it->base.widget); else { if ((!it->walking) && (it->delete_me)) @@ -924,7 +940,7 @@ if ((selectraise) && (!strcmp(selectraise, "on"))) { if ((stacking) && (!strcmp(stacking, "below"))) - evas_object_lower(it->base.view); + evas_object_lower(it->base.view); } it->hilighted = EINA_FALSE; if (it->selected) @@ -936,7 +952,10 @@ } static void -_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_mouse_move(void *data, + Evas *evas __UNUSED__, + Evas_Object *obj, + void *event_info) { Elm_Genlist_Item *it = data; Evas_Event_Mouse_Move *ev = event_info; @@ -948,7 +967,7 @@ { it->wd->on_hold = EINA_TRUE; if (!it->wd->wasselected) - _item_unselect(it); + _item_unselect(it); } } if ((it->dragging) && (it->down)) @@ -958,7 +977,8 @@ { it->wd->history[it->wd->movements].x = ev->cur.canvas.x; it->wd->history[it->wd->movements].y = ev->cur.canvas.y; - if (abs((it->wd->history[it->wd->movements].x - it->wd->history[0].x)) > 40) + if (abs((it->wd->history[it->wd->movements].x - + it->wd->history[0].x)) > 40) it->wd->swipe = EINA_TRUE; else it->wd->movements++; @@ -971,7 +991,7 @@ evas_object_smart_callback_call(it->base.widget, "drag", it); return; } - if ((!it->down)/* || (it->wd->on_hold)*/ || (it->wd->longpressed)) + if ((!it->down) /* || (it->wd->on_hold)*/ || (it->wd->longpressed)) { if (it->long_timer) { @@ -1006,29 +1026,30 @@ if (dy < 0) { if (ady > adx) - evas_object_smart_callback_call(it->base.widget, "drag,start,up", it); + evas_object_smart_callback_call(it->base.widget, + "drag,start,up", it); else { if (dx < 0) - evas_object_smart_callback_call(it->base.widget, + evas_object_smart_callback_call(it->base.widget, "drag,start,left", it); else - evas_object_smart_callback_call(it->base.widget, + evas_object_smart_callback_call(it->base.widget, "drag,start,right", it); } } else { if (ady > adx) - evas_object_smart_callback_call(it->base.widget, + evas_object_smart_callback_call(it->base.widget, "drag,start,down", it); else { if (dx < 0) - evas_object_smart_callback_call(it->base.widget, + evas_object_smart_callback_call(it->base.widget, "drag,start,left", it); else - evas_object_smart_callback_call(it->base.widget, + evas_object_smart_callback_call(it->base.widget, "drag,start,right", it); } } @@ -1041,7 +1062,8 @@ Elm_Genlist_Item *it = data; it->long_timer = NULL; - if ((it->disabled) || (it->dragging) || (it->display_only)) return ECORE_CALLBACK_CANCEL; + if ((it->disabled) || (it->dragging) || (it->display_only)) + return ECORE_CALLBACK_CANCEL; it->wd->longpressed = EINA_TRUE; evas_object_smart_callback_call(it->base.widget, "longpressed", it); return ECORE_CALLBACK_CANCEL; @@ -1077,7 +1099,10 @@ } static void -_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_mouse_down(void *data, + Evas *evas __UNUSED__, + Evas_Object *obj, + void *event_info) { Elm_Genlist_Item *it = data; Evas_Event_Mouse_Down *ev = event_info; @@ -1085,12 +1110,12 @@ if (ev->button != 1) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) - { - it->wd->on_hold = EINA_TRUE; - } + { + it->wd->on_hold = EINA_TRUE; + } it->down = 1; - it->dragging = 0; + it->dragging = 0; evas_object_geometry_get(obj, &x, &y, NULL, NULL); it->dx = ev->canvas.x - x; it->dy = ev->canvas.y - y; @@ -1106,7 +1131,8 @@ if (it->swipe_timer) ecore_timer_del(it->swipe_timer); it->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it); if (it->realized) - it->long_timer = ecore_timer_add(it->wd->longpress_timeout, _long_press, it); + it->long_timer = ecore_timer_add(it->wd->longpress_timeout, _long_press, + it); else it->long_timer = NULL; it->wd->swipe = EINA_FALSE; @@ -1114,7 +1140,10 @@ } static void -_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +_mouse_up(void *data, + Evas *evas __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info) { Elm_Genlist_Item *it = data; Evas_Event_Mouse_Up *ev = event_info; @@ -1191,7 +1220,7 @@ Elm_Genlist_Item *it2; EINA_LIST_FOREACH_SAFE(it->wd->selected, l, l_next, it2) - if (it2 != it) _item_unselect(it2); + if (it2 != it) _item_unselect(it2); //_item_hilight(it); //_item_select(it); } @@ -1201,7 +1230,10 @@ } static void -_signal_expand_toggle(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +_signal_expand_toggle(void *data, + Evas_Object *obj __UNUSED__, + const char *emission __UNUSED__, + const char *source __UNUSED__) { Elm_Genlist_Item *it = data; @@ -1212,7 +1244,10 @@ } static void -_signal_expand(void *data, Evas_Object *obj __UNUSED__, const char *emission _... [truncated message content] |