summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-23 15:54:03 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-23 15:57:49 +0900
commit87aa053e58f82473ff10b877ce61e0df38d7cb4a (patch)
tree1bdb299edd1789931d55c6eb20692cd2517523b6
parente8b7f5f255ce37fbc47dbe38bd379bf1e824e0d2 (diff)
elm_test: Remove calls to fill+expand (EO)
Wherever the EO API is used, i.e. efl_add() is used to create evas objects, we can skip the calls to set fill/expand. This new set of defaults indeed saves ~60 loc in the tests (out of 115 objects created). I found only 3 cases where the align had to be set manually (to the old default of 0.5). See 1a1b8bc45155dcb96129013c4177d742a06434e6 And e8b7f5f255ce37fbc47dbe38bd379bf1e824e0d2 Ref T5301
-rw-r--r--src/bin/elementary/test_bg.c6
-rw-r--r--src/bin/elementary/test_box.c14
-rw-r--r--src/bin/elementary/test_code.c12
-rw-r--r--src/bin/elementary/test_efl_gfx_map.c2
-rw-r--r--src/bin/elementary/test_efl_ui_text.c5
-rw-r--r--src/bin/elementary/test_evas_map.c2
-rw-r--r--src/bin/elementary/test_evas_mask.c11
-rw-r--r--src/bin/elementary/test_evas_snapshot.c13
-rw-r--r--src/bin/elementary/test_events.c4
-rw-r--r--src/bin/elementary/test_gfx_filters.c11
-rw-r--r--src/bin/elementary/test_grid_static.c3
-rw-r--r--src/bin/elementary/test_panes.c3
-rw-r--r--src/bin/elementary/test_photocam.c4
-rw-r--r--src/bin/elementary/test_ui_box.c1
-rw-r--r--src/bin/elementary/test_ui_grid.c3
-rw-r--r--src/bin/elementary/test_win_inline.c1
16 files changed, 17 insertions, 78 deletions
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index ff043cde29..8ffbd65780 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -345,14 +345,14 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
345 elm_colorselector_palette_color_add(efl_added, 0, 64, 64, 64), 345 elm_colorselector_palette_color_add(efl_added, 0, 64, 64, 64),
346 elm_colorselector_palette_color_add(efl_added, 0, 0, 0, 0), 346 elm_colorselector_palette_color_add(efl_added, 0, 0, 0, 0),
347 efl_event_callback_add(efl_added, ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED, _colorsel_cb, win), 347 efl_event_callback_add(efl_added, ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED, _colorsel_cb, win),
348 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0), 348 efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
349 efl_pack(box, efl_added)); 349 efl_pack(box, efl_added));
350 350
351 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); 351 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
352 efl_add(EFL_UI_IMAGE_CLASS, win, 352 efl_add(EFL_UI_IMAGE_CLASS, win,
353 efl_file_set(efl_added, buf, NULL), 353 efl_file_set(efl_added, buf, NULL),
354 efl_gfx_size_hint_min_set(efl_added, 64, 64), 354 efl_gfx_size_hint_min_set(efl_added, 64, 64),
355 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0), 355 efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
356 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _file_cb, win), 356 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _file_cb, win),
357 efl_pack(box, efl_added)); 357 efl_pack(box, efl_added));
358 358
@@ -360,7 +360,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
360 efl_add(EFL_UI_IMAGE_CLASS, win, 360 efl_add(EFL_UI_IMAGE_CLASS, win,
361 efl_file_set(efl_added, buf, NULL), 361 efl_file_set(efl_added, buf, NULL),
362 efl_gfx_size_hint_min_set(efl_added, 64, 64), 362 efl_gfx_size_hint_min_set(efl_added, 64, 64),
363 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0), 363 efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
364 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _image_cb, win), 364 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _image_cb, win),
365 efl_pack(box, efl_added)); 365 efl_pack(box, efl_added));
366 366
diff --git a/src/bin/elementary/test_box.c b/src/bin/elementary/test_box.c
index c75025d186..82e5968604 100644
--- a/src/bin/elementary/test_box.c
+++ b/src/bin/elementary/test_box.c
@@ -895,37 +895,29 @@ test_box_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
895 895
896 efl_gfx_color_set(efl_part(win, "background"), 24, 24, 64, 255); 896 efl_gfx_color_set(efl_part(win, "background"), 24, 24, 64, 255);
897 897
898 /* stacked box, with items in the center-bottom */ 898 /* stacked box, with items in the center-bottom. its default weight makes
899 * the window resizable */
899 bx = efl_add(EFL_UI_BOX_STACK_CLASS, win, 900 bx = efl_add(EFL_UI_BOX_STACK_CLASS, win,
900 efl_pack_align_set(efl_added, 0.5, 1.0)); 901 efl_pack_align_set(efl_added, 0.5, 1.0));
901 efl_content_set(win, bx); 902 efl_content_set(win, bx);
902 903
903 /* stretched rectangle */ 904 /* stretched rectangle */
904 o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, 905 o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win,
905 efl_gfx_color_set(efl_added, 0, 64, 128, 255), 906 efl_gfx_color_set(efl_added, 0, 64, 128, 255));
906 efl_gfx_size_hint_align_set(efl_added, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL),
907 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND));
908 efl_pack(bx, o); 907 efl_pack(bx, o);
909 908
910 /* rectangle with a max size */ 909 /* rectangle with a max size */
911 o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, 910 o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win,
912 efl_gfx_color_set(efl_added, 64, 128, 64, 255), 911 efl_gfx_color_set(efl_added, 64, 128, 64, 255),
913 efl_gfx_size_hint_align_set(efl_added, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL),
914 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
915 efl_gfx_size_hint_max_set(efl_added, 128, 20)); 912 efl_gfx_size_hint_max_set(efl_added, 128, 20));
916 efl_pack(bx, o); 913 efl_pack(bx, o);
917 914
918 /* image with a forced min size */ 915 /* image with a forced min size */
919 snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get()); 916 snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
920 o = efl_add(EFL_UI_IMAGE_CLASS, win, 917 o = efl_add(EFL_UI_IMAGE_CLASS, win,
921 efl_gfx_size_hint_align_set(efl_added, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL),
922 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
923 efl_gfx_size_hint_min_set(efl_added, 64, 64), 918 efl_gfx_size_hint_min_set(efl_added, 64, 64),
924 efl_file_set(efl_added, buf, NULL)); 919 efl_file_set(efl_added, buf, NULL));
925 efl_pack(bx, o); 920 efl_pack(bx, o);
926 921
927 /* make window resizable: add a weight to its content */
928 efl_gfx_size_hint_weight_set(bx, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
929
930 efl_gfx_size_set(win, 300, 300); 922 efl_gfx_size_set(win, 300, 300);
931} 923}
diff --git a/src/bin/elementary/test_code.c b/src/bin/elementary/test_code.c
index e46d1371b4..235adde00b 100644
--- a/src/bin/elementary/test_code.c
+++ b/src/bin/elementary/test_code.c
@@ -72,9 +72,6 @@ _elm_code_test_welcome_setup(Evas_Object *parent)
72 elm_code_line_token_add(line, 17, 19, 1, ELM_CODE_TOKEN_TYPE_MATCH); 72 elm_code_line_token_add(line, 17, 19, 1, ELM_CODE_TOKEN_TYPE_MATCH);
73 line = elm_code_file_line_get(code->file, 4); 73 line = elm_code_file_line_get(code->file, 4);
74 elm_code_line_token_add(line, 18, 20, 1, ELM_CODE_TOKEN_TYPE_MATCH); 74 elm_code_line_token_add(line, 18, 20, 1, ELM_CODE_TOKEN_TYPE_MATCH);
75
76 evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
77 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
78 75
79 elm_code_widget_selection_start(widget, 1, 3); 76 elm_code_widget_selection_start(widget, 1, 3);
80 elm_code_widget_selection_end(widget, 1, 13); 77 elm_code_widget_selection_end(widget, 1, 13);
@@ -111,9 +108,6 @@ _elm_code_test_editor_setup(Evas_Object *parent, Eina_Bool log)
111 elm_code_callback_fire(code, &ELM_CODE_EVENT_LINE_LOAD_DONE, line); 108 elm_code_callback_fire(code, &ELM_CODE_EVENT_LINE_LOAD_DONE, line);
112 } 109 }
113 110
114 evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
115 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
116
117 return widget; 111 return widget;
118} 112}
119 113
@@ -142,9 +136,6 @@ _elm_code_test_syntax_setup(Evas_Object *parent)
142 _append_line(code->file, " return 0;"); 136 _append_line(code->file, " return 0;");
143 _append_line(code->file, "}"); 137 _append_line(code->file, "}");
144 138
145 evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
146 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
147
148 return widget; 139 return widget;
149} 140}
150 141
@@ -172,9 +163,6 @@ _elm_code_test_diff_inline_setup(Evas_Object *parent)
172 code = elm_code_create(); 163 code = elm_code_create();
173 diff = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code)); 164 diff = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
174 165
175 evas_object_size_hint_weight_set(diff, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
176 evas_object_size_hint_align_set(diff, EVAS_HINT_FILL, EVAS_HINT_FILL);
177
178 elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_DIFF); 166 elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_DIFF);
179 elm_code_file_open(code, PACKAGE_DATA_DIR "/testdiff.diff"); 167 elm_code_file_open(code, PACKAGE_DATA_DIR "/testdiff.diff");
180 168
diff --git a/src/bin/elementary/test_efl_gfx_map.c b/src/bin/elementary/test_efl_gfx_map.c
index ce2eea0992..e462425db3 100644
--- a/src/bin/elementary/test_efl_gfx_map.c
+++ b/src/bin/elementary/test_efl_gfx_map.c
@@ -52,8 +52,6 @@ test_efl_gfx_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
52 /* image with a min size */ 52 /* image with a min size */
53 snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get()); 53 snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get());
54 img = efl_add(EFL_UI_IMAGE_CLASS, win, 54 img = efl_add(EFL_UI_IMAGE_CLASS, win,
55 efl_gfx_size_hint_align_set(efl_added, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL),
56 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
57 efl_gfx_size_hint_min_set(efl_added, 64, 64), 55 efl_gfx_size_hint_min_set(efl_added, 64, 64),
58 efl_file_set(efl_added, buf, NULL)); 56 efl_file_set(efl_added, buf, NULL));
59 efl_ui_image_scale_type_set(img, EFL_UI_IMAGE_SCALE_TYPE_FILL); 57 efl_ui_image_scale_type_set(img, EFL_UI_IMAGE_SCALE_TYPE_FILL);
diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c
index 5882617682..862c832e16 100644
--- a/src/bin/elementary/test_efl_ui_text.c
+++ b/src/bin/elementary/test_efl_ui_text.c
@@ -30,9 +30,6 @@ _create_label(Eo *win, Eo *bx)
30 en = efl_add(EFL_UI_TEXT_CLASS, win); 30 en = efl_add(EFL_UI_TEXT_CLASS, win);
31 printf("Added Efl.Ui.Text object\n"); 31 printf("Added Efl.Ui.Text object\n");
32 efl_ui_text_interactive_editable_set(en, EINA_FALSE); 32 efl_ui_text_interactive_editable_set(en, EINA_FALSE);
33
34 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
35 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
36 elm_box_pack_end(bx, en); 33 elm_box_pack_end(bx, en);
37 return en; 34 return en;
38} 35}
@@ -201,8 +198,6 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
201 198
202 efl_ui_text_interactive_editable_set(en, EINA_TRUE); 199 efl_ui_text_interactive_editable_set(en, EINA_TRUE);
203 efl_ui_text_scrollable_set(en, EINA_TRUE); 200 efl_ui_text_scrollable_set(en, EINA_TRUE);
204 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
205 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
206 elm_box_pack_end(bx, en); 201 elm_box_pack_end(bx, en);
207 elm_object_focus_set(en, EINA_TRUE); 202 elm_object_focus_set(en, EINA_TRUE);
208 203
diff --git a/src/bin/elementary/test_evas_map.c b/src/bin/elementary/test_evas_map.c
index 36a048c0c1..7f4e8481e7 100644
--- a/src/bin/elementary/test_evas_map.c
+++ b/src/bin/elementary/test_evas_map.c
@@ -60,8 +60,6 @@ test_evas_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
60 /* image with a min size */ 60 /* image with a min size */
61 snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get()); 61 snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get());
62 img = efl_add(EFL_UI_IMAGE_CLASS, win, 62 img = efl_add(EFL_UI_IMAGE_CLASS, win,
63 efl_gfx_size_hint_align_set(efl_added, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL),
64 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
65 efl_gfx_size_hint_min_set(efl_added, 64, 64), 63 efl_gfx_size_hint_min_set(efl_added, 64, 64),
66 efl_file_set(efl_added, buf, NULL)); 64 efl_file_set(efl_added, buf, NULL));
67 efl_ui_image_scale_type_set(img, EFL_UI_IMAGE_SCALE_TYPE_FILL); 65 efl_ui_image_scale_type_set(img, EFL_UI_IMAGE_SCALE_TYPE_FILL);
diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c
index 482fe12e94..a8fd92a0f8 100644
--- a/src/bin/elementary/test_evas_mask.c
+++ b/src/bin/elementary/test_evas_mask.c
@@ -113,8 +113,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
113 efl_ui_win_autodel_set(efl_added, 1)); 113 efl_ui_win_autodel_set(efl_added, 1));
114 114
115 box = efl_add(EFL_UI_BOX_CLASS, win, 115 box = efl_add(EFL_UI_BOX_CLASS, win,
116 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), 116 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
117 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0));
118 efl_content_set(win, box); 117 efl_content_set(win, box);
119 118
120 // FIXME: No API to set background as "tile" :( 119 // FIXME: No API to set background as "tile" :(
@@ -124,9 +123,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
124 // FIXME: layout EO API 123 // FIXME: layout EO API
125 snprintf(buf, sizeof(buf), "%s/objects/test_masking.edj", elm_app_data_dir_get()); 124 snprintf(buf, sizeof(buf), "%s/objects/test_masking.edj", elm_app_data_dir_get());
126 ly = efl_add(EFL_UI_LAYOUT_CLASS, win, 125 ly = efl_add(EFL_UI_LAYOUT_CLASS, win,
127 efl_file_set(efl_added, buf, "masking"), 126 efl_file_set(efl_added, buf, "masking"));
128 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0),
129 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0));
130 efl_pack(box, ly); 127 efl_pack(box, ly);
131 128
132 // FIXME: No genlist in EO API 129 // FIXME: No genlist in EO API
@@ -158,23 +155,25 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
158 box2 = efl_add(EFL_UI_BOX_CLASS, win, 155 box2 = efl_add(EFL_UI_BOX_CLASS, win,
159 efl_ui_direction_set(efl_added, EFL_UI_DIR_LTR), 156 efl_ui_direction_set(efl_added, EFL_UI_DIR_LTR),
160 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 157 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
161 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
162 efl_pack(box, efl_added)); 158 efl_pack(box, efl_added));
163 159
164 // FIXME: button EO API 160 // FIXME: button EO API
165 efl_add(EFL_UI_BUTTON_CLASS, win, 161 efl_add(EFL_UI_BUTTON_CLASS, win,
166 efl_text_set(efl_added, "Toggle mask"), 162 efl_text_set(efl_added, "Toggle mask"),
167 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_mask, ly), 163 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_mask, ly),
164 efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0),
168 efl_pack(box2, efl_added)); 165 efl_pack(box2, efl_added));
169 166
170 efl_add(EFL_UI_BUTTON_CLASS, win, 167 efl_add(EFL_UI_BUTTON_CLASS, win,
171 efl_text_set(efl_added, "Toggle map"), 168 efl_text_set(efl_added, "Toggle map"),
172 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_map, ly), 169 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_map, ly),
170 efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0),
173 efl_pack(box2, efl_added)); 171 efl_pack(box2, efl_added));
174 172
175 efl_add(EFL_UI_BUTTON_CLASS, win, 173 efl_add(EFL_UI_BUTTON_CLASS, win,
176 efl_text_set(efl_added, "Rotate Window"), 174 efl_text_set(efl_added, "Rotate Window"),
177 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _rotate_win, win), 175 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _rotate_win, win),
176 efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0),
178 efl_pack(box2, efl_added)); 177 efl_pack(box2, efl_added));
179 178
180 efl_gfx_size_set(win, 500, 600); 179 efl_gfx_size_set(win, 500, 600);
diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c
index f47756d672..cb13386320 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -30,8 +30,6 @@ _image_create(Eo *win, const char *path)
30{ 30{
31 return efl_add(EFL_UI_IMAGE_CLASS, win, 31 return efl_add(EFL_UI_IMAGE_CLASS, win,
32 efl_file_set(efl_added, path, NULL), 32 efl_file_set(efl_added, path, NULL),
33 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
34 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0),
35 efl_gfx_size_hint_min_set(efl_added, 20, 20)); 33 efl_gfx_size_hint_min_set(efl_added, 20, 20));
36} 34}
37 35
@@ -127,9 +125,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
127 efl_ui_win_autodel_set(efl_added, 1)); 125 efl_ui_win_autodel_set(efl_added, 1));
128 126
129 grid = efl_add(EFL_UI_GRID_CLASS, win, 127 grid = efl_add(EFL_UI_GRID_CLASS, win,
130 efl_pack_padding_set(efl_added, 5, 5, 1), 128 efl_pack_padding_set(efl_added, 5, 5, 1));
131 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
132 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0));
133 efl_content_set(win, grid); 129 efl_content_set(win, grid);
134 130
135 // Objects below the snapshot 131 // Objects below the snapshot
@@ -149,8 +145,6 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
149 snap = efl_add(EFL_CANVAS_SNAPSHOT_CLASS, win, 145 snap = efl_add(EFL_CANVAS_SNAPSHOT_CLASS, win,
150 efl_gfx_filter_program_set(efl_added, filter, "filter"), 146 efl_gfx_filter_program_set(efl_added, filter, "filter"),
151 efl_gfx_filter_data_set(efl_added, "radius", "tonumber(5)", EINA_TRUE), 147 efl_gfx_filter_data_set(efl_added, "radius", "tonumber(5)", EINA_TRUE),
152 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
153 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0),
154 efl_pack_grid(grid, efl_added, 1, 1, GRID_SIZE - 2, GRID_SIZE - 2)); 148 efl_pack_grid(grid, efl_added, 1, 1, GRID_SIZE - 2, GRID_SIZE - 2));
155 149
156 // Objects above snapshot 150 // Objects above snapshot
@@ -177,7 +171,6 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
177 elm_slider_min_max_set(efl_added, 0, 64), 171 elm_slider_min_max_set(efl_added, 0, 64),
178 elm_slider_value_set(efl_added, 5), 172 elm_slider_value_set(efl_added, 5),
179 elm_slider_unit_format_set(efl_added, "%.0f px"), 173 elm_slider_unit_format_set(efl_added, "%.0f px"),
180 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
181 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 174 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
182 efl_pack_grid(grid, efl_added, 0, GRID_SIZE, GRID_SIZE, 1), 175 efl_pack_grid(grid, efl_added, 0, GRID_SIZE, GRID_SIZE, 1),
183 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _radius_set, win)); 176 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _radius_set, win));
@@ -189,28 +182,24 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
189 182
190 efl_add(EFL_UI_BUTTON_CLASS, win, 183 efl_add(EFL_UI_BUTTON_CLASS, win,
191 efl_text_set(efl_added, "Toggle animation"), 184 efl_text_set(efl_added, "Toggle animation"),
192 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
193 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 185 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
194 efl_pack(box, efl_added), 186 efl_pack(box, efl_added),
195 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _anim_toggle, win)); 187 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _anim_toggle, win));
196 188
197 efl_add(EFL_UI_BUTTON_CLASS, win, 189 efl_add(EFL_UI_BUTTON_CLASS, win,
198 efl_text_set(efl_added, "Save to file"), 190 efl_text_set(efl_added, "Save to file"),
199 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
200 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 191 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
201 efl_pack(box, efl_added), 192 efl_pack(box, efl_added),
202 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _save_image, win)); 193 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _save_image, win));
203 194
204 efl_add(EFL_UI_BUTTON_CLASS, win, 195 efl_add(EFL_UI_BUTTON_CLASS, win,
205 efl_text_set(efl_added, "Map"), 196 efl_text_set(efl_added, "Map"),
206 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
207 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 197 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
208 efl_pack(box, efl_added), 198 efl_pack(box, efl_added),
209 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_map, win)); 199 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_map, win));
210 200
211 efl_add(EFL_UI_BUTTON_CLASS, win, 201 efl_add(EFL_UI_BUTTON_CLASS, win,
212 efl_text_set(efl_added, "Close"), 202 efl_text_set(efl_added, "Close"),
213 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
214 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 203 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
215 efl_pack(box, efl_added), 204 efl_pack(box, efl_added),
216 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _close_do, win)); 205 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _close_do, win));
diff --git a/src/bin/elementary/test_events.c b/src/bin/elementary/test_events.c
index ae88b01c86..013bd91cd5 100644
--- a/src/bin/elementary/test_events.c
+++ b/src/bin/elementary/test_events.c
@@ -168,8 +168,6 @@ test_events(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
168 168
169 bx = efl_add(EFL_UI_BOX_CLASS, win, 169 bx = efl_add(EFL_UI_BOX_CLASS, win,
170 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL)); 170 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
171 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
172 evas_object_size_hint_align_set(bx, -1, -1);
173 efl_content_set(win, bx); 171 efl_content_set(win, bx);
174 td->win = win; 172 td->win = win;
175 173
@@ -197,8 +195,6 @@ test_events(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
197 evas_object_show(bt); 195 evas_object_show(bt);
198 196
199 o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win); 197 o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
200 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
201 evas_object_size_hint_align_set(o, -1, -1);
202 efl_pack(bx, o); 198 efl_pack(bx, o);
203 199
204 efl_event_callback_add(td->button, EFL_UI_EVENT_CLICKED, _clicked_button1, td); 200 efl_event_callback_add(td->button, EFL_UI_EVENT_CLICKED, _clicked_button1, td);
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index a3b4d2e7c0..455606dccc 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -330,8 +330,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
330 efl_ui_win_autodel_set(efl_added, 1)); 330 efl_ui_win_autodel_set(efl_added, 1));
331 331
332 box = efl_add(EFL_UI_BOX_CLASS, win, 332 box = efl_add(EFL_UI_BOX_CLASS, win,
333 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL), 333 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
334 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0));
335 334
336 efl_content_set(win, box); 335 efl_content_set(win, box);
337 336
@@ -432,15 +431,11 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
432 } 431 }
433 432
434 o = split = efl_add(EFL_UI_PANES_CLASS, win, 433 o = split = efl_add(EFL_UI_PANES_CLASS, win,
435 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0),
436 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
437 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL)); 434 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
438 efl_pack(box, split); 435 efl_pack(box, split);
439 436
440 { 437 {
441 flip = efl_add(EFL_UI_FLIP_CLASS, win, 438 flip = efl_add(EFL_UI_FLIP_CLASS, win);
442 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
443 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0));
444 efl_content_set(efl_part(split, "top"), flip); 439 efl_content_set(efl_part(split, "top"), flip);
445 440
446 box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win, 441 box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win,
@@ -507,8 +502,6 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
507 "blend { color = 'lime' }"; 502 "blend { color = 'lime' }";
508 503
509 o = code = efl_add(EFL_UI_TEXT_EDITABLE_CLASS, win, 504 o = code = efl_add(EFL_UI_TEXT_EDITABLE_CLASS, win,
510 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0),
511 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
512 efl_ui_text_scrollable_set(efl_added, 1), 505 efl_ui_text_scrollable_set(efl_added, 1),
513 efl_text_multiline_set(efl_added, 1)); 506 efl_text_multiline_set(efl_added, 1));
514 efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed, win); 507 efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed, win);
diff --git a/src/bin/elementary/test_grid_static.c b/src/bin/elementary/test_grid_static.c
index 175b5bb207..e02f06296c 100644
--- a/src/bin/elementary/test_grid_static.c
+++ b/src/bin/elementary/test_grid_static.c
@@ -110,8 +110,7 @@ test_grid_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
110 efl_ui_win_autodel_set(efl_added, EINA_TRUE), 110 efl_ui_win_autodel_set(efl_added, EINA_TRUE),
111 efl_event_callback_add(efl_added, EFL_EVENT_DEL, _win_del, api)); 111 efl_event_callback_add(efl_added, EFL_EVENT_DEL, _win_del, api));
112 112
113 gd = efl_add(EFL_UI_GRID_STATIC_CLASS, win, 113 gd = efl_add(EFL_UI_GRID_STATIC_CLASS, win);
114 efl_gfx_size_hint_weight_set(efl_added, 1, 1));
115 efl_content_set(win, gd); 114 efl_content_set(win, gd);
116 api->data.grid = gd; 115 api->data.grid = gd;
117 116
diff --git a/src/bin/elementary/test_panes.c b/src/bin/elementary/test_panes.c
index f2434da72d..a7849d8939 100644
--- a/src/bin/elementary/test_panes.c
+++ b/src/bin/elementary/test_panes.c
@@ -116,13 +116,12 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
116 ); 116 );
117 117
118 panes = efl_add(EFL_UI_PANES_CLASS, win, 118 panes = efl_add(EFL_UI_PANES_CLASS, win,
119 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
120 efl_content_set(win, efl_added), 119 efl_content_set(win, efl_added),
121 efl_ui_panes_split_ratio_set(efl_added, 0.7) 120 efl_ui_panes_split_ratio_set(efl_added, 0.7)
122 ); 121 );
123 122
124 efl_add(EFL_UI_BUTTON_CLASS, win, 123 efl_add(EFL_UI_BUTTON_CLASS, win,
125 efl_text_set(efl_added, "Left - combined min size(110,110)"), 124 efl_text_set(efl_added, "Left - user set min size(110,110)"),
126 efl_gfx_size_hint_min_set(efl_added, 110, 110), 125 efl_gfx_size_hint_min_set(efl_added, 110, 110),
127 efl_content_set(efl_part(panes, "first"), efl_added) 126 efl_content_set(efl_part(panes, "first"), efl_added)
128 ); 127 );
diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c
index 871ee87b94..490255b6da 100644
--- a/src/bin/elementary/test_photocam.c
+++ b/src/bin/elementary/test_photocam.c
@@ -812,12 +812,12 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
812 812
813 bx = efl_add(EFL_UI_BOX_CLASS, win, 813 bx = efl_add(EFL_UI_BOX_CLASS, win,
814 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN), 814 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN),
815 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
816 efl_content_set(win, efl_added)); 815 efl_content_set(win, efl_added));
817 816
818 efl_add(EFL_UI_TEXT_CLASS, bx, 817 efl_add(EFL_UI_TEXT_CLASS, bx,
819 efl_text_set(efl_added, "Clicking the image will play/pause animation."), 818 efl_text_set(efl_added, "Clicking the image will play/pause animation."),
820 efl_ui_text_interactive_editable_set(efl_added, EINA_FALSE), 819 efl_ui_text_interactive_editable_set(efl_added, EINA_FALSE),
820 efl_gfx_size_hint_weight_set(efl_added, 1, 0),
821 efl_canvas_text_style_set(efl_added, NULL, "DEFAULT='align=center font=Sans font_size=10 color=#fff wrap=word'"), 821 efl_canvas_text_style_set(efl_added, NULL, "DEFAULT='align=center font=Sans font_size=10 color=#fff wrap=word'"),
822 efl_pack(bx, efl_added) 822 efl_pack(bx, efl_added)
823 ); 823 );
@@ -825,8 +825,6 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
825 snprintf(buf, sizeof(buf), "%s/images/animated_logo.gif", elm_app_data_dir_get()); 825 snprintf(buf, sizeof(buf), "%s/images/animated_logo.gif", elm_app_data_dir_get());
826 zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win, 826 zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win,
827 efl_file_set(efl_added, buf, NULL), 827 efl_file_set(efl_added, buf, NULL),
828 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
829 efl_gfx_size_hint_align_set(efl_added, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL),
830 efl_pack(bx, efl_added), 828 efl_pack(bx, efl_added),
831 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _zoomable_clicked_cb, NULL) 829 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _zoomable_clicked_cb, NULL)
832 ); 830 );
diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c
index fdf768e9e8..1929369c52 100644
--- a/src/bin/elementary/test_ui_box.c
+++ b/src/bin/elementary/test_ui_box.c
@@ -225,7 +225,6 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
225 vbox = efl_add(EFL_UI_BOX_CLASS, win, 225 vbox = efl_add(EFL_UI_BOX_CLASS, win,
226 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); 226 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
227 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE); 227 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
228 efl_gfx_size_hint_weight_set(vbox, 1, 1);
229 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5); 228 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
230 elm_win_resize_object_add(win, vbox); 229 elm_win_resize_object_add(win, vbox);
231 230
diff --git a/src/bin/elementary/test_ui_grid.c b/src/bin/elementary/test_ui_grid.c
index 0cd6837fb5..b9b7972cab 100644
--- a/src/bin/elementary/test_ui_grid.c
+++ b/src/bin/elementary/test_ui_grid.c
@@ -408,8 +408,6 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
408 efl_gfx_visible_set(grid, 1); 408 efl_gfx_visible_set(grid, 1);
409 409
410 objects[i++] = o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win); 410 objects[i++] = o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
411 efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
412 efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
413 efl_gfx_size_hint_min_set(o, 10, 10); 411 efl_gfx_size_hint_min_set(o, 10, 10);
414 efl_gfx_color_set(o, 64, 96, 128, 255); 412 efl_gfx_color_set(o, 64, 96, 128, 255);
415 efl_pack_grid(grid, o, 0, 0, 3, 1); 413 efl_pack_grid(grid, o, 0, 0, 3, 1);
@@ -506,7 +504,6 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
506 vbox = efl_add(EFL_UI_BOX_CLASS, win, 504 vbox = efl_add(EFL_UI_BOX_CLASS, win,
507 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); 505 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
508 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE); 506 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
509 efl_gfx_size_hint_weight_set(vbox, 1, 1);
510 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5); 507 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
511 elm_win_resize_object_add(win, vbox); 508 elm_win_resize_object_add(win, vbox);
512 efl_gfx_visible_set(vbox, 1); 509 efl_gfx_visible_set(vbox, 1);
diff --git a/src/bin/elementary/test_win_inline.c b/src/bin/elementary/test_win_inline.c
index c290c87d56..5209b20014 100644
--- a/src/bin/elementary/test_win_inline.c
+++ b/src/bin/elementary/test_win_inline.c
@@ -227,7 +227,6 @@ test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
227 227
228 box = efl_add(EFL_UI_BOX_CLASS, win, 228 box = efl_add(EFL_UI_BOX_CLASS, win,
229 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL)); 229 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
230 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
231 elm_win_resize_object_add(win, box); 230 elm_win_resize_object_add(win, box);
232 231
233 win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE); 232 win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);