summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorGustavo Lima Chaves <glima@profusion.mobi>2010-12-07 19:18:14 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2010-12-07 19:18:14 +0000
commit7da54d59a7ebb823ed442c8d03bd2e49a698f044 (patch)
tree878697489804d5b67f3c2851eca2190f961da35d /src/bin
parentfdb124466d41253bf39fe66b795c56c4da5c0448 (diff)
Indenting and removing bogus code blocks.
SVN revision: 55364
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/test_fileselector.c66
-rw-r--r--src/bin/test_fileselector_button.c30
-rw-r--r--src/bin/test_fileselector_entry.c31
3 files changed, 80 insertions, 47 deletions
diff --git a/src/bin/test_fileselector.c b/src/bin/test_fileselector.c
index 027ed1543..a0e003008 100644
--- a/src/bin/test_fileselector.c
+++ b/src/bin/test_fileselector.c
@@ -4,20 +4,24 @@
4#endif 4#endif
5#ifndef ELM_LIB_QUICKLAUNCH 5#ifndef ELM_LIB_QUICKLAUNCH
6static void 6static void
7my_fileselector_done(void *data, Evas_Object *obj __UNUSED__, void *event_info) 7my_fileselector_done(void *data,
8 Evas_Object *obj __UNUSED__,
9 void *event_info)
8{ 10{
9 /* event_info conatin the full path of the selected file 11 /* event_info conatin the full path of the selected file
10 * or NULL if none is selected or cancel is pressed */ 12 * or NULL if none is selected or cancel is pressed */
11 const char *selected = event_info; 13 const char *selected = event_info;
12 14
13 if (selected) 15 if (selected)
14 printf("Selected file: %s\n", selected); 16 printf("Selected file: %s\n", selected);
15 else 17 else
16 evas_object_del(data); /* delete the test window */ 18 evas_object_del(data); /* delete the test window */
17} 19}
18 20
19static void 21static void
20my_fileselector_selected(void *data __UNUSED__, Evas_Object *obj, void *event_info) 22my_fileselector_selected(void *data __UNUSED__,
23 Evas_Object *obj,
24 void *event_info)
21{ 25{
22 /* event_info conatin the full path of the selected file */ 26 /* event_info conatin the full path of the selected file */
23 const char *selected = event_info; 27 const char *selected = event_info;
@@ -28,54 +32,66 @@ my_fileselector_selected(void *data __UNUSED__, Evas_Object *obj, void *event_in
28} 32}
29 33
30static void 34static void
31_is_save_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 35_is_save_clicked(void *data,
36 Evas_Object *obj __UNUSED__,
37 void *event_info __UNUSED__)
32{ 38{
33 Evas_Object *fs = data; 39 Evas_Object *fs = data;
34 printf("Toggle Is save\n"); 40 printf("Toggle Is save\n");
35 if (elm_fileselector_is_save_get(fs)) 41 if (elm_fileselector_is_save_get(fs))
36 elm_fileselector_is_save_set(fs, EINA_FALSE); 42 elm_fileselector_is_save_set(fs, EINA_FALSE);
37 else 43 else
38 elm_fileselector_is_save_set(fs, EINA_TRUE); 44 elm_fileselector_is_save_set(fs, EINA_TRUE);
39} 45}
40 46
41static void 47static void
42_folder_only_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 48_folder_only_clicked(void *data,
49 Evas_Object *obj __UNUSED__,
50 void *event_info __UNUSED__)
43{ 51{
44 Evas_Object *fs = data; 52 Evas_Object *fs = data;
45 printf("Toggle Folder only\n"); 53 printf("Toggle Folder only\n");
46 if (elm_fileselector_folder_only_get(fs)) 54 if (elm_fileselector_folder_only_get(fs))
47 elm_fileselector_folder_only_set(fs, EINA_FALSE); 55 elm_fileselector_folder_only_set(fs, EINA_FALSE);
48 else 56 else
49 elm_fileselector_folder_only_set(fs, EINA_TRUE); 57 elm_fileselector_folder_only_set(fs, EINA_TRUE);
50} 58}
51 59
52static void 60static void
53_expandable_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 61_expandable_clicked(void *data,
62 Evas_Object *obj __UNUSED__,
63 void *event_info __UNUSED__)
54{ 64{
55 Evas_Object *fs = data; 65 Evas_Object *fs = data;
56 printf("Toggle Expandable\n"); 66 printf("Toggle Expandable\n");
57 if (elm_fileselector_expandable_get(fs)) 67 if (elm_fileselector_expandable_get(fs))
58 elm_fileselector_expandable_set(fs, EINA_FALSE); 68 elm_fileselector_expandable_set(fs, EINA_FALSE);
59 else 69 else
60 elm_fileselector_expandable_set(fs, EINA_TRUE); 70 elm_fileselector_expandable_set(fs, EINA_TRUE);
61} 71}
62 72
63static void 73static void
64_sel_get_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 74_sel_get_clicked(void *data,
75 Evas_Object *obj __UNUSED__,
76 void *event_info __UNUSED__)
65{ 77{
66 Evas_Object *fs = data; 78 Evas_Object *fs = data;
67 printf("Get Selected: %s\n", elm_fileselector_selected_get(fs)); 79 printf("Get Selected: %s\n", elm_fileselector_selected_get(fs));
68} 80}
69 81
70static void 82static void
71_path_get_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 83_path_get_clicked(void *data,
84 Evas_Object *obj __UNUSED__,
85 void *event_info __UNUSED__)
72{ 86{
73 Evas_Object *fs = data; 87 Evas_Object *fs = data;
74 printf("Get Path: %s\n", elm_fileselector_path_get(fs)); 88 printf("Get Path: %s\n", elm_fileselector_path_get(fs));
75} 89}
76 90
77void 91void
78test_fileselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 92test_fileselector(void *data __UNUSED__,
93 Evas_Object *obj __UNUSED__,
94 void *event_info __UNUSED__)
79{ 95{
80 Evas_Object *win, *fs, *bg, *vbox, *hbox, *bt, *sep; 96 Evas_Object *win, *fs, *bg, *vbox, *hbox, *bt, *sep;
81 97
@@ -111,12 +127,13 @@ test_fileselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
111 evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL); 127 evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
112 elm_box_pack_end(vbox, fs); 128 elm_box_pack_end(vbox, fs);
113 evas_object_show(fs); // TODO fix this is the widget 129 evas_object_show(fs); // TODO fix this is the widget
114 130
115 /* the 'done' cb is called when the user press ok/cancel */ 131 /* the 'done' cb is called when the user press ok/cancel */
116 evas_object_smart_callback_add(fs, "done", my_fileselector_done, win); 132 evas_object_smart_callback_add(fs, "done", my_fileselector_done, win);
117 /* the 'selected' cb is called when the user click on a file/dir */ 133 /* the 'selected' cb is called when the user click on a file/dir */
118 evas_object_smart_callback_add(fs, "selected", my_fileselector_selected, win); 134 evas_object_smart_callback_add(fs, "selected", my_fileselector_selected,
119 135 win);
136
120 /* test buttons */ 137 /* test buttons */
121 sep = elm_separator_add(win); 138 sep = elm_separator_add(win);
122 elm_separator_horizontal_set(sep, EINA_TRUE); 139 elm_separator_horizontal_set(sep, EINA_TRUE);
@@ -127,14 +144,14 @@ test_fileselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
127 elm_box_horizontal_set(hbox, EINA_TRUE); 144 elm_box_horizontal_set(hbox, EINA_TRUE);
128 elm_box_pack_end(vbox, hbox); 145 elm_box_pack_end(vbox, hbox);
129 evas_object_show(hbox); 146 evas_object_show(hbox);
130 147
131 bt = elm_check_add(win); 148 bt = elm_check_add(win);
132 elm_check_label_set(bt, "is save"); 149 elm_check_label_set(bt, "is save");
133 elm_check_state_set(bt, elm_fileselector_is_save_get(fs)); 150 elm_check_state_set(bt, elm_fileselector_is_save_get(fs));
134 evas_object_smart_callback_add(bt, "changed", _is_save_clicked, fs); 151 evas_object_smart_callback_add(bt, "changed", _is_save_clicked, fs);
135 elm_box_pack_end(hbox, bt); 152 elm_box_pack_end(hbox, bt);
136 evas_object_show(bt); 153 evas_object_show(bt);
137 154
138 bt = elm_check_add(win); 155 bt = elm_check_add(win);
139 elm_check_label_set(bt, "folder only"); 156 elm_check_label_set(bt, "folder only");
140 elm_check_state_set(bt, elm_fileselector_folder_only_get(fs)); 157 elm_check_state_set(bt, elm_fileselector_folder_only_get(fs));
@@ -169,4 +186,5 @@ test_fileselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
169 evas_object_resize(win, 240, 350); 186 evas_object_resize(win, 240, 350);
170 evas_object_show(win); 187 evas_object_show(win);
171} 188}
189
172#endif 190#endif
diff --git a/src/bin/test_fileselector_button.c b/src/bin/test_fileselector_button.c
index 61eae2048..00c8d076f 100644
--- a/src/bin/test_fileselector_button.c
+++ b/src/bin/test_fileselector_button.c
@@ -5,7 +5,9 @@
5 5
6#ifndef ELM_LIB_QUICKLAUNCH 6#ifndef ELM_LIB_QUICKLAUNCH
7static void 7static void
8_file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info) 8_file_chosen(void *data,
9 Evas_Object *obj __UNUSED__,
10 void *event_info)
9{ 11{
10 Evas_Object *entry = data; 12 Evas_Object *entry = data;
11 const char *file = event_info; 13 const char *file = event_info;
@@ -19,7 +21,9 @@ _file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info)
19} 21}
20 22
21static void 23static void
22_inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 24_inwin_mode_toggle(void *data,
25 Evas_Object *obj __UNUSED__,
26 void *event_info __UNUSED__)
23{ 27{
24 Evas_Object *fs_bt = data; 28 Evas_Object *fs_bt = data;
25 Eina_Bool value = elm_fileselector_button_inwin_mode_get(fs_bt); 29 Eina_Bool value = elm_fileselector_button_inwin_mode_get(fs_bt);
@@ -28,7 +32,9 @@ _inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
28} 32}
29 33
30static void 34static void
31_current_sel_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 35_current_sel_toggle(void *data,
36 Evas_Object *obj __UNUSED__,
37 void *event_info __UNUSED__)
32{ 38{
33 Evas_Object *fs_bt = data; 39 Evas_Object *fs_bt = data;
34 Eina_Bool value = elm_fileselector_button_is_save_get(fs_bt); 40 Eina_Bool value = elm_fileselector_button_is_save_get(fs_bt);
@@ -38,7 +44,9 @@ _current_sel_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __
38} 44}
39 45
40static void 46static void
41_folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 47_folder_only_toggle(void *data,
48 Evas_Object *obj __UNUSED__,
49 void *event_info __UNUSED__)
42{ 50{
43 Evas_Object *fs_bt = data; 51 Evas_Object *fs_bt = data;
44 Eina_Bool value = elm_fileselector_button_folder_only_get(fs_bt); 52 Eina_Bool value = elm_fileselector_button_folder_only_get(fs_bt);
@@ -47,7 +55,9 @@ _folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __
47} 55}
48 56
49static void 57static void
50_expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 58_expandable_toggle(void *data,
59 Evas_Object *obj __UNUSED__,
60 void *event_info __UNUSED__)
51{ 61{
52 Evas_Object *fs_bt = data; 62 Evas_Object *fs_bt = data;
53 Eina_Bool value = elm_fileselector_button_expandable_get(fs_bt); 63 Eina_Bool value = elm_fileselector_button_expandable_get(fs_bt);
@@ -56,7 +66,9 @@ _expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
56} 66}
57 67
58void 68void
59test_fileselector_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 69test_fileselector_button(void *data __UNUSED__,
70 Evas_Object *obj __UNUSED__,
71 void *event_info __UNUSED__)
60{ 72{
61 Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_bt, *en, *lb; 73 Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_bt, *en, *lb;
62 74
@@ -74,11 +86,6 @@ test_fileselector_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, voi
74 evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 86 evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
75 evas_object_show(vbox); 87 evas_object_show(vbox);
76 88
77 vbox = elm_box_add(win);
78 evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
79 elm_win_resize_object_add(win, vbox);
80 evas_object_show(vbox);
81
82 /* file selector button */ 89 /* file selector button */
83 ic = elm_icon_add(win); 90 ic = elm_icon_add(win);
84 elm_icon_standard_set(ic, "file"); 91 elm_icon_standard_set(ic, "file");
@@ -136,4 +143,5 @@ test_fileselector_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, voi
136 evas_object_resize(win, 400, 400); 143 evas_object_resize(win, 400, 400);
137 evas_object_show(win); 144 evas_object_show(win);
138} 145}
146
139#endif 147#endif
diff --git a/src/bin/test_fileselector_entry.c b/src/bin/test_fileselector_entry.c
index 9b8f31b15..0359dd519 100644
--- a/src/bin/test_fileselector_entry.c
+++ b/src/bin/test_fileselector_entry.c
@@ -5,7 +5,9 @@
5 5
6#ifndef ELM_LIB_QUICKLAUNCH 6#ifndef ELM_LIB_QUICKLAUNCH
7static void 7static void
8_file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info) 8_file_chosen(void *data,
9 Evas_Object *obj __UNUSED__,
10 void *event_info)
9{ 11{
10 Evas_Object *entry = data; 12 Evas_Object *entry = data;
11 char *file = event_info; 13 char *file = event_info;
@@ -14,7 +16,9 @@ _file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info)
14} 16}
15 17
16static void 18static void
17_inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 19_inwin_mode_toggle(void *data,
20 Evas_Object *obj __UNUSED__,
21 void *event_info __UNUSED__)
18{ 22{
19 Evas_Object *fs_en = data; 23 Evas_Object *fs_en = data;
20 Eina_Bool value = elm_fileselector_entry_inwin_mode_get(fs_en); 24 Eina_Bool value = elm_fileselector_entry_inwin_mode_get(fs_en);
@@ -23,7 +27,9 @@ _inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
23} 27}
24 28
25static void 29static void
26_folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 30_folder_only_toggle(void *data,
31 Evas_Object *obj __UNUSED__,
32 void *event_info __UNUSED__)
27{ 33{
28 Evas_Object *fs_en = data; 34 Evas_Object *fs_en = data;
29 Evas_Object *ic = elm_fileselector_entry_button_icon_get(fs_en); 35 Evas_Object *ic = elm_fileselector_entry_button_icon_get(fs_en);
@@ -43,7 +49,9 @@ _folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __
43} 49}
44 50
45static void 51static void
46_expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 52_expandable_toggle(void *data,
53 Evas_Object *obj __UNUSED__,
54 void *event_info __UNUSED__)
47{ 55{
48 Evas_Object *fs_en = data; 56 Evas_Object *fs_en = data;
49 Eina_Bool value = elm_fileselector_entry_expandable_get(fs_en); 57 Eina_Bool value = elm_fileselector_entry_expandable_get(fs_en);
@@ -52,7 +60,9 @@ _expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
52} 60}
53 61
54static void 62static void
55_disabled_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 63_disabled_toggle(void *data,
64 Evas_Object *obj __UNUSED__,
65 void *event_info __UNUSED__)
56{ 66{
57 Evas_Object *fs_en = data; 67 Evas_Object *fs_en = data;
58 Eina_Bool value = elm_object_disabled_get(fs_en); 68 Eina_Bool value = elm_object_disabled_get(fs_en);
@@ -61,7 +71,9 @@ _disabled_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNU
61} 71}
62 72
63void 73void
64test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 74test_fileselector_entry(void *data __UNUSED__,
75 Evas_Object *obj __UNUSED__,
76 void *event_info __UNUSED__)
65{ 77{
66 Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_en, *en, *lb; 78 Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_en, *en, *lb;
67 79
@@ -75,11 +87,6 @@ test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void
75 evas_object_show(bg); 87 evas_object_show(bg);
76 88
77 vbox = elm_box_add(win); 89 vbox = elm_box_add(win);
78 elm_win_resize_object_add(win, vbox);
79 evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
80 evas_object_show(vbox);
81
82 vbox = elm_box_add(win);
83 evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 90 evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
84 elm_win_resize_object_add(win, vbox); 91 elm_win_resize_object_add(win, vbox);
85 evas_object_show(vbox); 92 evas_object_show(vbox);
@@ -138,7 +145,6 @@ test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void
138 elm_box_pack_end(hbox, bt); 145 elm_box_pack_end(hbox, bt);
139 evas_object_show(bt); 146 evas_object_show(bt);
140 147
141
142 en = elm_entry_add(win); 148 en = elm_entry_add(win);
143 elm_entry_line_wrap_set(en, EINA_FALSE); 149 elm_entry_line_wrap_set(en, EINA_FALSE);
144 elm_entry_editable_set(en, EINA_FALSE); 150 elm_entry_editable_set(en, EINA_FALSE);
@@ -149,4 +155,5 @@ test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void
149 evas_object_resize(win, 400, 500); 155 evas_object_resize(win, 400, 500);
150 evas_object_show(win); 156 evas_object_show(win);
151} 157}
158
152#endif 159#endif