test: Removed size hint macros from reference codes.
authorDaniel Juyung Seo <seojuyung2@gmail.com>
Sun, 2 Feb 2014 08:25:25 +0000 (17:25 +0900)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Sun, 2 Feb 2014 10:41:17 +0000 (19:41 +0900)
Using additional macros in reference codes was not a good idea.
This will make codes more inconsistent and confusing.

legacy/elementary/src/bin/test_gengrid.c
legacy/elementary/src/bin/test_genlist.c
legacy/elementary/src/bin/test_naviframe_complex.c

index e425cff..3fa9f86 100644 (file)
@@ -5,11 +5,6 @@
 #endif
 #include <Elementary.h>
 
-#define WEIGHT evas_object_size_hint_weight_set
-#define ALIGN_ evas_object_size_hint_align_set
-#define EXPAND(X) WEIGHT((X), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
-#define FILL(X) ALIGN_((X), EVAS_HINT_FILL, EVAS_HINT_FILL)
-
 static Elm_Gengrid_Item_Class *gic, *ggic;
 
 Evas_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)
         elm_gengrid_item_size_set(grid,
                                   elm_config_scale_get() * 150,
                                   elm_config_scale_get() * 150);
-        EXPAND(grid); FILL(grid);
+        evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+        evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
      }
 
    ic = elm_gengrid_item_class_new();
@@ -929,7 +925,8 @@ _item_styles_list_create(Evas_Object *parent)
    Evas_Object *list;
 
    list = elm_list_add(parent);
-   EXPAND(list); FILL(list);
+   evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_list_item_append(list, "default", NULL, NULL,
                         _item_style_sel_cb, "default");
    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)
 
    rect = evas_object_rectangle_add(evas_object_evas_get(table));
    evas_object_size_hint_min_set(rect, w, h);
-   EXPAND(rect); FILL(rect);
+   evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_table_pack(table, rect, 0, 0, 1, 1);
 
-   EXPAND(obj); FILL(obj);
+   evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_table_pack(table, obj, 0, 0, 1, 1);
 
    return table;
@@ -982,7 +981,7 @@ test_gengrid_item_styles(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
 
    box = elm_box_add(win);
    elm_box_horizontal_set(box, EINA_TRUE);
-   EXPAND(box);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, box);
    evas_object_show(box);
 
@@ -990,8 +989,8 @@ test_gengrid_item_styles(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
    evas_object_show(list);
 
    table = _elm_min_set(list, box, 100, 0);
-   WEIGHT(table, 0, EVAS_HINT_EXPAND);
-   FILL(table);
+   evas_object_size_hint_weight_set(table, 0.0, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(box, table);
    evas_object_show(table);
 
index 2e2558e..f4247af 100644 (file)
@@ -5,11 +5,6 @@
 #endif
 #include <Elementary.h>
 
-#define WEIGHT evas_object_size_hint_weight_set
-#define ALIGN_ evas_object_size_hint_align_set
-#define EXPAND(X) WEIGHT((X), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
-#define FILL(X) ALIGN_((X), EVAS_HINT_FILL, EVAS_HINT_FILL)
-
 Evas_Object * _elm_min_set(Evas_Object *obj, Evas_Object *parent,
                            Evas_Coord w, Evas_Coord h);
 
@@ -3455,7 +3450,8 @@ _item_styles_list_create(Evas_Object *parent)
    int i = 0;
 
    list = elm_list_add(parent);
-   EXPAND(list); FILL(list);
+   evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
    while (_genlist_styles[i])
      {
@@ -3478,7 +3474,7 @@ test_genlist_item_styles(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
 
    box = elm_box_add(win);
    elm_box_horizontal_set(box, EINA_TRUE);
-   EXPAND(box);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, box);
    evas_object_show(box);
 
@@ -3486,13 +3482,14 @@ test_genlist_item_styles(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
    evas_object_show(list);
 
    table = _elm_min_set(list, box, 200, 0);
-   WEIGHT(table, 0, EVAS_HINT_EXPAND);
-   FILL(table);
+   evas_object_size_hint_weight_set(table, 0.0, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(box, table);
    evas_object_show(table);
 
    gl = elm_genlist_add(box);
-   EXPAND(gl); FILL(gl);
+   evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
     _genlist_renew(gl, "default");
    elm_box_pack_end(box, gl);
    evas_object_show(gl);
index ace6776..439fb05 100644 (file)
@@ -3,11 +3,6 @@
 #endif
 #include <Elementary.h>
 
-#define WEIGHT evas_object_size_hint_weight_set
-#define ALIGN_ evas_object_size_hint_align_set
-#define EXPAND(X) WEIGHT((X), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
-#define FILL(X) ALIGN_((X), EVAS_HINT_FILL, EVAS_HINT_FILL)
-
 #define BUTTON_TEXT_SET(BT, TEXT) \
    elm_object_text_set((BT), (TEXT)); \
    elm_object_tooltip_text_set((BT), (TEXT)); \
@@ -316,22 +311,22 @@ test_naviframe_complex(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
    elm_win_autodel_set(win, EINA_TRUE);
 
    box = elm_box_add(win);
-   EXPAND(box);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_box_horizontal_set(box, EINA_TRUE);
    elm_win_resize_object_add(win, box);
    evas_object_show(box);
 
    tb = elm_toolbar_add(win);
-   WEIGHT(tb, 0, EVAS_HINT_EXPAND);
-   FILL(tb);
+   evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_toolbar_horizontal_set(tb, EINA_FALSE);
    elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS);
    elm_box_pack_end(box, tb);
    evas_object_show(tb);
 
    nf = elm_naviframe_add(win);
-   EXPAND(nf);
-   FILL(nf);
+   evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(nf, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(box, nf);
    evas_object_show(nf);
 
@@ -339,7 +334,7 @@ test_naviframe_complex(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
      {
         const char *label[] = { "View 1", "View 2", "View 3", "View 4" };
         o = elm_naviframe_add(win);
-        EXPAND(o);
+        evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
         btn = elm_button_add(o);
         evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);