summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-02-02 17:25:25 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-02-02 19:41:17 +0900
commit597ffe0f2e3f2d0c25ae7a7a0ff018152abfcc2e (patch)
tree0caf4310d9774761d1232d1f362dcddb9ace6fd4
parent13baac0bcf92ccf14eaed84deea72613f1223c6d (diff)
test: Removed size hint macros from reference codes.
Using additional macros in reference codes was not a good idea. This will make codes more inconsistent and confusing.
-rw-r--r--src/bin/test_gengrid.c23
-rw-r--r--src/bin/test_genlist.c17
-rw-r--r--src/bin/test_naviframe_complex.c17
3 files changed, 24 insertions, 33 deletions
diff --git a/src/bin/test_gengrid.c b/src/bin/test_gengrid.c
index e425cffd2..3fa9f864f 100644
--- a/src/bin/test_gengrid.c
+++ b/src/bin/test_gengrid.c
@@ -5,11 +5,6 @@
5#endif 5#endif
6#include <Elementary.h> 6#include <Elementary.h>
7 7
8#define WEIGHT evas_object_size_hint_weight_set
9#define ALIGN_ evas_object_size_hint_align_set
10#define EXPAND(X) WEIGHT((X), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
11#define FILL(X) ALIGN_((X), EVAS_HINT_FILL, EVAS_HINT_FILL)
12
13static Elm_Gengrid_Item_Class *gic, *ggic; 8static Elm_Gengrid_Item_Class *gic, *ggic;
14 9
15Evas_Object *grid_content_get(void *data, Evas_Object *obj, const char *part); 10Evas_Object *grid_content_get(void *data, Evas_Object *obj, const char *part);
@@ -890,7 +885,8 @@ _gengrid_create(Evas_Object *obj, int items, const char *style)
890 elm_gengrid_item_size_set(grid, 885 elm_gengrid_item_size_set(grid,
891 elm_config_scale_get() * 150, 886 elm_config_scale_get() * 150,
892 elm_config_scale_get() * 150); 887 elm_config_scale_get() * 150);
893 EXPAND(grid); FILL(grid); 888 evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
889 evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
894 } 890 }
895 891
896 ic = elm_gengrid_item_class_new(); 892 ic = elm_gengrid_item_class_new();
@@ -929,7 +925,8 @@ _item_styles_list_create(Evas_Object *parent)
929 Evas_Object *list; 925 Evas_Object *list;
930 926
931 list = elm_list_add(parent); 927 list = elm_list_add(parent);
932 EXPAND(list); FILL(list); 928 evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
929 evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
933 elm_list_item_append(list, "default", NULL, NULL, 930 elm_list_item_append(list, "default", NULL, NULL,
934 _item_style_sel_cb, "default"); 931 _item_style_sel_cb, "default");
935 elm_list_item_append(list, "default_style", NULL, NULL, 932 elm_list_item_append(list, "default_style", NULL, NULL,
@@ -962,10 +959,12 @@ _elm_min_set(Evas_Object *obj, Evas_Object *parent, Evas_Coord w, Evas_Coord h)
962 959
963 rect = evas_object_rectangle_add(evas_object_evas_get(table)); 960 rect = evas_object_rectangle_add(evas_object_evas_get(table));
964 evas_object_size_hint_min_set(rect, w, h); 961 evas_object_size_hint_min_set(rect, w, h);
965 EXPAND(rect); FILL(rect); 962 evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
963 evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
966 elm_table_pack(table, rect, 0, 0, 1, 1); 964 elm_table_pack(table, rect, 0, 0, 1, 1);
967 965
968 EXPAND(obj); FILL(obj); 966 evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
967 evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
969 elm_table_pack(table, obj, 0, 0, 1, 1); 968 elm_table_pack(table, obj, 0, 0, 1, 1);
970 969
971 return table; 970 return table;
@@ -982,7 +981,7 @@ test_gengrid_item_styles(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
982 981
983 box = elm_box_add(win); 982 box = elm_box_add(win);
984 elm_box_horizontal_set(box, EINA_TRUE); 983 elm_box_horizontal_set(box, EINA_TRUE);
985 EXPAND(box); 984 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
986 elm_win_resize_object_add(win, box); 985 elm_win_resize_object_add(win, box);
987 evas_object_show(box); 986 evas_object_show(box);
988 987
@@ -990,8 +989,8 @@ test_gengrid_item_styles(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
990 evas_object_show(list); 989 evas_object_show(list);
991 990
992 table = _elm_min_set(list, box, 100, 0); 991 table = _elm_min_set(list, box, 100, 0);
993 WEIGHT(table, 0, EVAS_HINT_EXPAND); 992 evas_object_size_hint_weight_set(table, 0.0, EVAS_HINT_EXPAND);
994 FILL(table); 993 evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
995 elm_box_pack_end(box, table); 994 elm_box_pack_end(box, table);
996 evas_object_show(table); 995 evas_object_show(table);
997 996
diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c
index 2e2558e88..f4247af06 100644
--- a/src/bin/test_genlist.c
+++ b/src/bin/test_genlist.c
@@ -5,11 +5,6 @@
5#endif 5#endif
6#include <Elementary.h> 6#include <Elementary.h>
7 7
8#define WEIGHT evas_object_size_hint_weight_set
9#define ALIGN_ evas_object_size_hint_align_set
10#define EXPAND(X) WEIGHT((X), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
11#define FILL(X) ALIGN_((X), EVAS_HINT_FILL, EVAS_HINT_FILL)
12
13Evas_Object * _elm_min_set(Evas_Object *obj, Evas_Object *parent, 8Evas_Object * _elm_min_set(Evas_Object *obj, Evas_Object *parent,
14 Evas_Coord w, Evas_Coord h); 9 Evas_Coord w, Evas_Coord h);
15 10
@@ -3455,7 +3450,8 @@ _item_styles_list_create(Evas_Object *parent)
3455 int i = 0; 3450 int i = 0;
3456 3451
3457 list = elm_list_add(parent); 3452 list = elm_list_add(parent);
3458 EXPAND(list); FILL(list); 3453 evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3454 evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
3459 3455
3460 while (_genlist_styles[i]) 3456 while (_genlist_styles[i])
3461 { 3457 {
@@ -3478,7 +3474,7 @@ test_genlist_item_styles(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
3478 3474
3479 box = elm_box_add(win); 3475 box = elm_box_add(win);
3480 elm_box_horizontal_set(box, EINA_TRUE); 3476 elm_box_horizontal_set(box, EINA_TRUE);
3481 EXPAND(box); 3477 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3482 elm_win_resize_object_add(win, box); 3478 elm_win_resize_object_add(win, box);
3483 evas_object_show(box); 3479 evas_object_show(box);
3484 3480
@@ -3486,13 +3482,14 @@ test_genlist_item_styles(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
3486 evas_object_show(list); 3482 evas_object_show(list);
3487 3483
3488 table = _elm_min_set(list, box, 200, 0); 3484 table = _elm_min_set(list, box, 200, 0);
3489 WEIGHT(table, 0, EVAS_HINT_EXPAND); 3485 evas_object_size_hint_weight_set(table, 0.0, EVAS_HINT_EXPAND);
3490 FILL(table); 3486 evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
3491 elm_box_pack_end(box, table); 3487 elm_box_pack_end(box, table);
3492 evas_object_show(table); 3488 evas_object_show(table);
3493 3489
3494 gl = elm_genlist_add(box); 3490 gl = elm_genlist_add(box);
3495 EXPAND(gl); FILL(gl); 3491 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3492 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
3496 _genlist_renew(gl, "default"); 3493 _genlist_renew(gl, "default");
3497 elm_box_pack_end(box, gl); 3494 elm_box_pack_end(box, gl);
3498 evas_object_show(gl); 3495 evas_object_show(gl);
diff --git a/src/bin/test_naviframe_complex.c b/src/bin/test_naviframe_complex.c
index ace67768b..439fb05e7 100644
--- a/src/bin/test_naviframe_complex.c
+++ b/src/bin/test_naviframe_complex.c
@@ -3,11 +3,6 @@
3#endif 3#endif
4#include <Elementary.h> 4#include <Elementary.h>
5 5
6#define WEIGHT evas_object_size_hint_weight_set
7#define ALIGN_ evas_object_size_hint_align_set
8#define EXPAND(X) WEIGHT((X), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
9#define FILL(X) ALIGN_((X), EVAS_HINT_FILL, EVAS_HINT_FILL)
10
11#define BUTTON_TEXT_SET(BT, TEXT) \ 6#define BUTTON_TEXT_SET(BT, TEXT) \
12 elm_object_text_set((BT), (TEXT)); \ 7 elm_object_text_set((BT), (TEXT)); \
13 elm_object_tooltip_text_set((BT), (TEXT)); \ 8 elm_object_tooltip_text_set((BT), (TEXT)); \
@@ -316,22 +311,22 @@ test_naviframe_complex(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
316 elm_win_autodel_set(win, EINA_TRUE); 311 elm_win_autodel_set(win, EINA_TRUE);
317 312
318 box = elm_box_add(win); 313 box = elm_box_add(win);
319 EXPAND(box); 314 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
320 elm_box_horizontal_set(box, EINA_TRUE); 315 elm_box_horizontal_set(box, EINA_TRUE);
321 elm_win_resize_object_add(win, box); 316 elm_win_resize_object_add(win, box);
322 evas_object_show(box); 317 evas_object_show(box);
323 318
324 tb = elm_toolbar_add(win); 319 tb = elm_toolbar_add(win);
325 WEIGHT(tb, 0, EVAS_HINT_EXPAND); 320 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
326 FILL(tb); 321 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
327 elm_toolbar_horizontal_set(tb, EINA_FALSE); 322 elm_toolbar_horizontal_set(tb, EINA_FALSE);
328 elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS); 323 elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS);
329 elm_box_pack_end(box, tb); 324 elm_box_pack_end(box, tb);
330 evas_object_show(tb); 325 evas_object_show(tb);
331 326
332 nf = elm_naviframe_add(win); 327 nf = elm_naviframe_add(win);
333 EXPAND(nf); 328 evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
334 FILL(nf); 329 evas_object_size_hint_align_set(nf, EVAS_HINT_FILL, EVAS_HINT_FILL);
335 elm_box_pack_end(box, nf); 330 elm_box_pack_end(box, nf);
336 evas_object_show(nf); 331 evas_object_show(nf);
337 332
@@ -339,7 +334,7 @@ test_naviframe_complex(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
339 { 334 {
340 const char *label[] = { "View 1", "View 2", "View 3", "View 4" }; 335 const char *label[] = { "View 1", "View 2", "View 3", "View 4" };
341 o = elm_naviframe_add(win); 336 o = elm_naviframe_add(win);
342 EXPAND(o); 337 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
343 338
344 btn = elm_button_add(o); 339 btn = elm_button_add(o);
345 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); 340 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);