aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-18 14:35:22 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-18 14:42:52 +0900
commit3bff7363b54b541aa78d8ed0f743631582086a95 (patch)
tree52e4cdf991bc97b05815352a08b65bbf3d559dc3 /src/bin
parentefl: Use Eina.Size2D for size hint max (diff)
downloadefl-3bff7363b54b541aa78d8ed0f743631582086a95.tar.gz
efl: Use Eina.Size2D for size hint min
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/elementary/test_bg.c4
-rw-r--r--src/bin/elementary/test_box.c2
-rw-r--r--src/bin/elementary/test_efl_gfx_map.c2
-rw-r--r--src/bin/elementary/test_evas_map.c2
-rw-r--r--src/bin/elementary/test_evas_snapshot.c2
-rw-r--r--src/bin/elementary/test_gfx_filters.c6
-rw-r--r--src/bin/elementary/test_panes.c6
-rw-r--r--src/bin/elementary/test_ui_box.c4
-rw-r--r--src/bin/elementary/test_ui_clock.c4
-rw-r--r--src/bin/elementary/test_ui_grid.c6
-rw-r--r--src/bin/elementary/test_ui_textpath.c4
-rw-r--r--src/bin/elementary/test_win_dialog.c14
12 files changed, 28 insertions, 28 deletions
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index dbe1132531..8402a59509 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -351,7 +351,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
efl_add(EFL_UI_IMAGE_CLASS, win,
efl_file_set(efl_added, buf, NULL),
- efl_gfx_size_hint_min_set(efl_added, 64, 64),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _file_cb, win),
efl_pack(box, efl_added));
@@ -359,7 +359,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", elm_app_data_dir_get());
efl_add(EFL_UI_IMAGE_CLASS, win,
efl_file_set(efl_added, buf, NULL),
- efl_gfx_size_hint_min_set(efl_added, 64, 64),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _image_cb, win),
efl_pack(box, efl_added));
diff --git a/src/bin/elementary/test_box.c b/src/bin/elementary/test_box.c
index ae437623be..5439234056 100644
--- a/src/bin/elementary/test_box.c
+++ b/src/bin/elementary/test_box.c
@@ -915,7 +915,7 @@ test_box_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
/* image with a forced min size */
snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
o = efl_add(EFL_UI_IMAGE_CLASS, win,
- efl_gfx_size_hint_min_set(efl_added, 64, 64),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
efl_file_set(efl_added, buf, NULL));
efl_pack(bx, o);
diff --git a/src/bin/elementary/test_efl_gfx_map.c b/src/bin/elementary/test_efl_gfx_map.c
index c9bd77ddfd..a05b27748d 100644
--- a/src/bin/elementary/test_efl_gfx_map.c
+++ b/src/bin/elementary/test_efl_gfx_map.c
@@ -52,7 +52,7 @@ test_efl_gfx_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
/* image with a min size */
snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get());
img = efl_add(EFL_UI_IMAGE_CLASS, win,
- efl_gfx_size_hint_min_set(efl_added, 64, 64),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
efl_file_set(efl_added, buf, NULL));
efl_ui_image_scale_type_set(img, EFL_UI_IMAGE_SCALE_TYPE_FILL);
evas_object_event_callback_add(img, EVAS_CALLBACK_RESIZE,
diff --git a/src/bin/elementary/test_evas_map.c b/src/bin/elementary/test_evas_map.c
index 2eeeee9b73..6a7c38d2b7 100644
--- a/src/bin/elementary/test_evas_map.c
+++ b/src/bin/elementary/test_evas_map.c
@@ -60,7 +60,7 @@ test_evas_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
/* image with a min size */
snprintf(buf, sizeof(buf), "%s/images/rock_02.jpg", elm_app_data_dir_get());
img = efl_add(EFL_UI_IMAGE_CLASS, win,
- efl_gfx_size_hint_min_set(efl_added, 64, 64),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(64, 64)),
efl_file_set(efl_added, buf, NULL));
efl_ui_image_scale_type_set(img, EFL_UI_IMAGE_SCALE_TYPE_FILL);
evas_object_event_callback_add(img, EVAS_CALLBACK_RESIZE,
diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c
index ec6c1efb68..625901943d 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -30,7 +30,7 @@ _image_create(Eo *win, const char *path)
{
return efl_add(EFL_UI_IMAGE_CLASS, win,
efl_file_set(efl_added, path, NULL),
- efl_gfx_size_hint_min_set(efl_added, 20, 20));
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(20, 20)));
}
static void
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index 7bd8aca9e6..de8eb5deac 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -240,7 +240,7 @@ _text_resize(void *data EINA_UNUSED, const Efl_Event *ev)
Eina_Size2D sz;
sz = efl_gfx_size_get(ev->object);
- efl_gfx_size_hint_min_set(ev->object, sz.w, sz.h);
+ efl_gfx_size_hint_min_set(ev->object, sz);
}
static void
@@ -250,7 +250,7 @@ _textblock_resize(void *data EINA_UNUSED, const Efl_Event *ev)
evas_object_textblock_size_native_get(ev->object, &w, &h);
evas_object_textblock_style_insets_get(ev->object, &l, &r, &t, &b);
- efl_gfx_size_hint_min_set(ev->object, w + l + r, h + t + b);
+ efl_gfx_size_hint_min_set(ev->object, EINA_SIZE2D(w + l + r, h + t + b));
}
static void
@@ -392,7 +392,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0),
efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
efl_gfx_size_hint_max_set(efl_added, size),
- efl_gfx_size_hint_min_set(efl_added, ELM_SCALE_SIZE(48), ELM_SCALE_SIZE(48)),
+ efl_gfx_size_hint_min_set(efl_added, size),
efl_file_set(efl_added, buf, NULL),
efl_name_set(efl_added, images[k].src_name),
elm_object_tooltip_text_set(efl_added, images[k].src_name));
diff --git a/src/bin/elementary/test_panes.c b/src/bin/elementary/test_panes.c
index 755cbe46c3..a4d6894b0f 100644
--- a/src/bin/elementary/test_panes.c
+++ b/src/bin/elementary/test_panes.c
@@ -122,7 +122,7 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
efl_add(EFL_UI_BUTTON_CLASS, win,
efl_text_set(efl_added, "Left - user set min size(110,110)"),
- efl_gfx_size_hint_min_set(efl_added, 110, 110),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(110, 110)),
efl_content_set(efl_part(panes, "first"), efl_added)
);
@@ -132,14 +132,14 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
);
efl_add(EFL_UI_BUTTON_CLASS, win,
efl_text_set(efl_added, "Up - user set min size(10,0)"),
- efl_gfx_size_hint_min_set(efl_added, 10, 0),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(10, 0)),
efl_content_set(efl_part(panes_h, "first"), efl_added)
);
efl_ui_panes_part_hint_min_allow_set(efl_part(panes_h, "first"), EINA_TRUE);
efl_add(EFL_UI_BUTTON_CLASS, win,
efl_text_set(efl_added, "Down - min size 50 40"),
- efl_gfx_size_hint_min_set(efl_added, 50, 40),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(50, 40)),
efl_content_set(efl_part(panes_h, "second"), efl_added)
);
diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c
index 218d20bc60..5ddd0e6784 100644
--- a/src/bin/elementary/test_ui_box.c
+++ b/src/bin/elementary/test_ui_box.c
@@ -65,7 +65,7 @@ user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
int val = elm_slider_value_get(event->object);
- efl_gfx_size_hint_min_set(objects[3], val, val);
+ efl_gfx_size_hint_min_set(objects[3], EINA_SIZE2D(val, val));
}
static void
@@ -461,7 +461,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
elm_slider_horizontal_set(o, 1);
efl_gfx_size_hint_align_set(o, 0.5, -1);
efl_gfx_size_hint_weight_set(o, 1, 0);
- efl_gfx_size_hint_min_set(o, 100, 0);
+ efl_gfx_size_hint_min_set(o, EINA_SIZE2D(100, 0));
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_slider_cb, win);
elm_slider_min_max_set(o, -0.1, 1.0);
elm_slider_step_set(o, 0.1);
diff --git a/src/bin/elementary/test_ui_clock.c b/src/bin/elementary/test_ui_clock.c
index 8d52340153..b911f9ca58 100644
--- a/src/bin/elementary/test_ui_clock.c
+++ b/src/bin/elementary/test_ui_clock.c
@@ -54,7 +54,7 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_content_set(win, efl_added),
- efl_gfx_size_hint_min_set(efl_added, 360, 240));
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(360, 240)));
dt1 = efl_add(EFL_UI_CLOCK_CLASS, bx,
efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
@@ -88,7 +88,7 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
efl_text_set(efl_added, "Editable Clock:"),
efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0),
efl_gfx_size_hint_align_set(efl_added, 0, EVAS_HINT_FILL),
- efl_gfx_size_hint_min_set(efl_added, 100, 25),
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 25)),
efl_pack(bx, efl_added));
dt4 = efl_add(EFL_UI_CLOCK_CLASS, bx,
diff --git a/src/bin/elementary/test_ui_grid.c b/src/bin/elementary/test_ui_grid.c
index 5704453580..d976c57499 100644
--- a/src/bin/elementary/test_ui_grid.c
+++ b/src/bin/elementary/test_ui_grid.c
@@ -71,7 +71,7 @@ user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
int val = elm_slider_value_get(event->object);
for (int i = 0; i < 6; i++)
- efl_gfx_size_hint_min_set(objects[i], val, val);
+ efl_gfx_size_hint_min_set(objects[i], EINA_SIZE2D(val, val));
}
static void
@@ -163,7 +163,7 @@ _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED)
eina_iterator_free(it);
end:
- efl_gfx_size_hint_min_set(pack, gmw * cols, gmh * rows);
+ efl_gfx_size_hint_min_set(pack, EINA_SIZE2D(gmw * cols, gmh * rows));
}
void
@@ -407,7 +407,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
efl_gfx_visible_set(grid, 1);
objects[i++] = o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
- efl_gfx_size_hint_min_set(o, 10, 10);
+ efl_gfx_size_hint_min_set(o, EINA_SIZE2D(10, 10));
efl_gfx_color_set(o, 64, 96, 128, 255);
efl_pack_grid(grid, o, 0, 0, 3, 1);
diff --git a/src/bin/elementary/test_ui_textpath.c b/src/bin/elementary/test_ui_textpath.c
index d4f9b4d3c1..9b27cdb7ac 100644
--- a/src/bin/elementary/test_ui_textpath.c
+++ b/src/bin/elementary/test_ui_textpath.c
@@ -146,7 +146,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
elm_slider_value_set(sld, 0);
efl_gfx_size_hint_align_set(sld, 0.5, EFL_GFX_SIZE_HINT_FILL);
efl_gfx_size_hint_weight_set(sld, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
- efl_gfx_size_hint_min_set(sld, 150, 0);
+ efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0));
efl_event_callback_add(sld, EFL_UI_SLIDER_EVENT_CHANGED, _angle_changed_cb, txtpath);
elm_box_pack_end(hbox, sld);
efl_gfx_visible_set(sld, EINA_TRUE);
@@ -158,7 +158,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
elm_slider_value_set(sld, 99);
efl_gfx_size_hint_align_set(sld, 0.5, EFL_GFX_SIZE_HINT_FILL);
efl_gfx_size_hint_weight_set(sld, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND);
- efl_gfx_size_hint_min_set(sld, 150, 0);
+ efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0));
efl_event_callback_add(sld, EFL_UI_SLIDER_EVENT_CHANGED, _slice_no_changed_cb, txtpath);
elm_box_pack_end(hbox, sld);
efl_gfx_visible_set(sld, EINA_TRUE);
diff --git a/src/bin/elementary/test_win_dialog.c b/src/bin/elementary/test_win_dialog.c
index 011cb54a79..4b163a7abf 100644
--- a/src/bin/elementary/test_win_dialog.c
+++ b/src/bin/elementary/test_win_dialog.c
@@ -41,7 +41,7 @@ _bt2_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
lb = efl_add(EFL_UI_TEXT_CLASS, dia,
efl_text_set(efl_added, "This is a non-resizable dialog."),
- efl_gfx_size_hint_min_set(efl_added, 300, 150),
+ efl_gfx_size_hint_min_set(efl_added, size),
efl_gfx_size_hint_max_set(efl_added, size),
efl_gfx_size_hint_weight_set(efl_added, 0, 0));
@@ -52,21 +52,21 @@ _bt2_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
static void
_size_update(void *data, const Efl_Event *ev)
{
- int w, h, wc, hc;
- Eina_Size2D sz, max;
+ int wc, hc;
+ Eina_Size2D sz, max, min;
char buf[2048];
Eo *dia = ev->object;
Eo *lbl = data;
efl_gfx_size_hint_combined_min_get(dia, &wc, &hc);
- efl_gfx_size_hint_min_get(dia, &w, &h);
+ min = efl_gfx_size_hint_min_get(dia);
max = efl_gfx_size_hint_max_get(dia);
sz = efl_gfx_size_get(dia);
sprintf(buf, "This is a dialog with min/max size<br>"
"Min size: %dx%d (requested) %dx%d (effective)<br>"
"Max size: %dx%d<br>"
- "Current size: %dx%d", w, h, wc, hc, max.w, max.h, sz.w, sz.h);
+ "Current size: %dx%d", min.w, min.h, wc, hc, max.w, max.h, sz.w, sz.h);
//efl_text_set(lbl, buf);
elm_object_text_set(lbl, buf);
}
@@ -93,7 +93,7 @@ _bt3_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
efl_content_set(dia, lb);
// Set min & max size (app-side)
- efl_gfx_size_hint_min_set(dia, ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100));
+ efl_gfx_size_hint_min_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100)));
efl_gfx_size_hint_max_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(600)));
}
@@ -120,7 +120,7 @@ _bt4_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
efl_content_set(dia, lb);
// Set min & max size (app-side)
- efl_gfx_size_hint_min_set(dia, ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100));
+ efl_gfx_size_hint_min_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(0), ELM_SCALE_SIZE(100)));
efl_gfx_size_hint_max_set(dia, EINA_SIZE2D(ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(600)));
efl_ui_win_center(dia, EINA_TRUE, EINA_TRUE);