aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-08-22 14:29:02 +0900
committerHermet Park <hermetpark@gmail.com>2019-08-22 14:29:02 +0900
commit6b1bd2d33454b639a985fbe9337a5b4401a57f79 (patch)
tree7e133000cce1bcd8456d53acf60d747be1cf242e /src/bin
parentRevert "ector: code refactoring." (diff)
parentedje/style: fix memory leak because of typo. (diff)
downloadefl-6b1bd2d33454b639a985fbe9337a5b4401a57f79.tar.gz
Merge branch 'master' into devs/hermet/lottie
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/elementary/meson.build3
-rw-r--r--src/bin/elementary/test.c6
-rw-r--r--src/bin/elementary/test_efl_ui_animation_view.c328
-rw-r--r--src/bin/elementary/test_part_bg.c14
-rw-r--r--src/bin/elementary/test_slider.c16
-rw-r--r--src/bin/elementary/test_ui_collection.c (renamed from src/bin/elementary/test_ui_item_container.c)38
-rw-r--r--src/bin/elementary/test_ui_items.c9
-rw-r--r--src/bin/elementary/test_ui_popup.c10
8 files changed, 399 insertions, 25 deletions
diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build
index 6c453298f3..388623d5c0 100644
--- a/src/bin/elementary/meson.build
+++ b/src/bin/elementary/meson.build
@@ -156,9 +156,10 @@ elementary_test_src = [
'test_gesture_framework.c',
'test_ui_tab_pager.c',
'test_ui_relative_layout.c',
- 'test_ui_item_container.c',
+ 'test_ui_collection.c',
'test_ui_items.c',
'test_ui_frame.c',
+ 'test_efl_ui_animation_view.c',
'test.h'
]
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 186af020b8..27abd2656d 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -404,6 +404,8 @@ void test_efl_ui_collection_grid(void *data, Evas_Object *obj, void *event_info)
void test_efl_ui_item(void *data, Evas_Object *obj, void *event_info);
void test_ui_frame(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
+void test_efl_ui_animation_view(void *data, Evas_Object *obj, void *event_info);
+
static void _list_udpate(void);
static Evas_Object *win, *tbx, *entry; // TODO: refactoring
@@ -1294,6 +1296,10 @@ add_tests:
//------------------------------//
ADD_TEST_EO(NULL, "Widgets Part", "Part Background", test_part_background);
ADD_TEST_EO(NULL, "Widgets Part", "Part Shadow", test_part_shadow);
+
+ //------------------------------//
+ ADD_TEST_EO(NULL, "Vector Animation", "Animation View", test_efl_ui_animation_view);
+
#undef ADD_TEST
if (autorun)
diff --git a/src/bin/elementary/test_efl_ui_animation_view.c b/src/bin/elementary/test_efl_ui_animation_view.c
new file mode 100644
index 0000000000..36e28c4421
--- /dev/null
+++ b/src/bin/elementary/test_efl_ui_animation_view.c
@@ -0,0 +1,328 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+#include <Efl_Ui.h>
+
+#ifndef EFL_BETA_API_SUPPORT
+#define EFL_BETA_API_SUPPORT
+#endif
+
+#ifndef EFL_EO_API_SUPPORT
+#define EFL_EO_API_SUPPORT
+#endif
+
+#ifdef BUILD_VG_LOADER_JSON
+
+static void
+btn_clicked_cb(void *data , const Efl_Event *ev )
+{
+ Evas_Object *anim_view = data;
+ const char *text = efl_text_get(ev->object);
+
+ if (!text) return;
+
+ if (!strcmp("Play", text))
+ efl_ui_animation_view_play(anim_view);
+ else if (!strcmp("Pause", text))
+ efl_ui_animation_view_pause(anim_view);
+ else if (!strcmp("Resume", text))
+ efl_ui_animation_view_resume(anim_view);
+ else if (!strcmp("Play Back", text))
+ efl_ui_animation_view_play_back(anim_view);
+ else if (!strcmp("Stop", text))
+ efl_ui_animation_view_stop(anim_view);
+}
+
+static void
+check_changed_cb(void *data, const Efl_Event *event)
+{
+ Evas_Object *anim_view = data;
+ efl_ui_animation_view_auto_repeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
+}
+
+static void
+speed_changed_cb(void *data, const Efl_Event *event)
+{
+ Evas_Object *anim_view = data;
+ double speed = 1;
+ if (efl_ui_selectable_selected_get(event->object)) speed = 0.25;
+ efl_ui_animation_view_speed_set(anim_view, speed);
+}
+
+static void
+limit_frame_cb(void *data, const Efl_Event *event)
+{
+ Evas_Object *anim_view = data;
+ int frame_count = efl_ui_animation_view_frame_count_get(anim_view);
+ printf("Total Frame Count : %d\n", frame_count);
+ if (efl_ui_selectable_selected_get(event->object))
+ {
+ efl_ui_animation_view_min_frame_set(anim_view, 5);
+ efl_ui_animation_view_max_frame_set(anim_view, 10);
+ printf("Frames to show 5-10 only\n");
+ }
+ else
+ {
+ efl_ui_animation_view_min_frame_set(anim_view, 0);
+ efl_ui_animation_view_max_frame_set(anim_view, frame_count);
+ printf("Showing all frames now\n");
+ }
+}
+
+static void
+update_anim_view_state(Evas_Object *anim_view, Evas_Object *label)
+{
+ Efl_Ui_Animation_View_State state = efl_ui_animation_view_state_get(anim_view);
+
+ switch (state)
+ {
+ case EFL_UI_ANIMATION_VIEW_STATE_NOT_READY:
+ efl_text_set(label, "State = Not Ready");
+ break;
+ case EFL_UI_ANIMATION_VIEW_STATE_PLAY:
+ efl_text_set(label, "State = Playing");
+ break;
+ case EFL_UI_ANIMATION_VIEW_STATE_PLAY_BACK:
+ efl_text_set(label, "State = Playing Back");
+ break;
+ case EFL_UI_ANIMATION_VIEW_STATE_PAUSE:
+ efl_text_set(label, "State = Paused");
+ break;
+ case EFL_UI_ANIMATION_VIEW_STATE_STOP:
+ efl_text_set(label, "State = Stopped");
+ break;
+ }
+}
+
+static void
+_play_updated(void *data, Evas_Object *obj, void *ev EINA_UNUSED)
+{
+ Evas_Object *slider = data;
+ efl_ui_range_value_set(slider, efl_ui_animation_view_progress_get(obj));
+}
+
+static void
+_state_update(void *data, Evas_Object *obj, void *ev EINA_UNUSED)
+{
+ Evas_Object *label = data;
+ update_anim_view_state(obj, label);
+}
+
+static void
+_play_done(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
+{
+ printf("done!\n");
+}
+
+static void
+_play_repeated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
+{
+ printf("repeated!\n");
+}
+
+static void
+_slider_changed_cb(void *data, const Efl_Event *ev)
+{
+ Evas_Object *anim_view = data;
+ efl_ui_animation_view_progress_set(anim_view, efl_ui_range_value_get(ev->object));
+}
+
+static void
+_slider_reset(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
+{
+ Evas_Object *slider = data;
+ efl_ui_range_value_set(slider, 0);
+}
+
+void
+test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *box, *box2, *box3, *box4, *label, *anim_view, *check, *slider;
+ char buf[255];
+
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
+ efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE));
+
+ // Create a box in Canvas
+ box = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
+ efl_content_set(win, efl_added));
+
+ //Create a label to show state of animation
+ label = efl_add(EFL_UI_TEXT_CLASS, win,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
+ efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
+ efl_pack(box, efl_added));
+
+ //Create Animation View to play animation directly from JSON file
+ snprintf(buf, sizeof(buf), "%s/images/emoji_wink.json", elm_app_data_dir_get());
+ anim_view = efl_add(EFL_UI_ANIMATION_VIEW_CLASS, win,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(600, 600)),
+ efl_file_set(efl_added, buf),
+ efl_pack(box, efl_added));
+
+ // Controller Set : 0
+ box2 = efl_add(EFL_UI_BOX_CLASS, box,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
+ efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
+ efl_pack(box, efl_added));
+
+ //Loop
+ check = efl_add(EFL_UI_CHECK_CLASS, box2,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_pack(box2, efl_added));
+ efl_text_set(check, "Loop");
+ efl_event_callback_add(check, EFL_UI_EVENT_SELECTED_CHANGED, check_changed_cb, anim_view);
+
+ //Speed: 0.5x
+ check = efl_add(EFL_UI_CHECK_CLASS, box2,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_pack(box2, efl_added));
+ efl_text_set(check, "Speed: 0.25x");
+ efl_event_callback_add(check, EFL_UI_EVENT_SELECTED_CHANGED, speed_changed_cb, anim_view);
+
+ //Limit Frames
+ check = efl_add(EFL_UI_CHECK_CLASS, box2,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_pack(box2, efl_added));
+ efl_text_set(check, "Limit Frames");
+ efl_event_callback_add(check, EFL_UI_EVENT_SELECTED_CHANGED, limit_frame_cb, anim_view);
+
+
+ //Duration Text
+ snprintf(buf, sizeof(buf), "Duration: %1.2fs", efl_ui_animation_view_duration_time_get(anim_view));
+ efl_add(EFL_UI_TEXT_CLASS, box2,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_text_set(efl_added, buf),
+ efl_pack(box2, efl_added));
+
+ //Slider
+ slider = efl_add(EFL_UI_SLIDER_CLASS, box,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_ui_range_limits_set(efl_added, 0, 1),
+ efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED, _slider_changed_cb, anim_view),
+ efl_pack(box, efl_added));
+
+ //Controller Set: 1
+ box3 = efl_add(EFL_UI_BOX_CLASS, box,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, 1),
+ efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
+ efl_pack(box, efl_added));
+
+ //Play Button
+ efl_add(EFL_UI_BUTTON_CLASS, box3,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_text_set(efl_added, "Play"),
+ efl_pack(box3, efl_added),
+ efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
+
+
+ //Play Back Button
+ efl_add(EFL_UI_BUTTON_CLASS, box3,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_text_set(efl_added, "Play Back"),
+ efl_pack(box3, efl_added),
+ efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
+
+ //Stop Button
+ efl_add(EFL_UI_BUTTON_CLASS, box3,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_text_set(efl_added, "Stop"),
+ efl_pack(box3, efl_added),
+ efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
+
+ //Controller Set: 2
+ box4 = efl_add(EFL_UI_BOX_CLASS, box,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, 1),
+ efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
+ efl_pack(box, efl_added));
+
+ //Pause Button
+ efl_add(EFL_UI_BUTTON_CLASS, box3,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_text_set(efl_added, "Pause"),
+ efl_pack(box4, efl_added),
+ efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
+
+ //Resume Button
+ efl_add(EFL_UI_BUTTON_CLASS, box3,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_text_set(efl_added, "Resume"),
+ efl_pack(box4, efl_added),
+ efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
+
+ evas_object_smart_callback_add(anim_view, "play,start", _state_update, label);
+ evas_object_smart_callback_add(anim_view, "play,stop", _state_update, label);
+ evas_object_smart_callback_add(anim_view, "play,pause", _state_update, label);
+ evas_object_smart_callback_add(anim_view, "play,resume", _state_update, label);
+
+ evas_object_smart_callback_add(anim_view, "play,repeat", _play_repeated, label);
+ evas_object_smart_callback_add(anim_view, "play,done", _play_done, label);
+
+ evas_object_smart_callback_add(anim_view, "play,update", _play_updated, slider);
+ evas_object_smart_callback_add(anim_view, "play,stop", _slider_reset, slider);
+
+ update_anim_view_state(anim_view, label);
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 730));
+}
+
+#else
+
+void
+test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *box;
+ char buf[255];
+
+ win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
+ efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE));
+
+ // Create a box
+ box = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
+ efl_content_set(win, efl_added));
+
+ efl_add(EFL_UI_TEXT_CLASS, win,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
+ efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
+ efl_text_set(efl_added, "Evas Vg Json (Lottie) Loader is not supported, Only Static Vector Image is available!"),
+ efl_pack(box, efl_added));
+
+ //Create Vector object.
+ snprintf(buf, sizeof(buf), "%s/images/tiger.svg", elm_app_data_dir_get());
+ efl_add(EFL_CANVAS_VG_OBJECT_CLASS, win,
+ efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
+ efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
+ efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(600, 600)),
+ efl_file_simple_load(efl_added, buf, NULL),
+ efl_gfx_entity_visible_set(efl_added, EINA_TRUE),
+ efl_pack(box, efl_added));
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 730));
+}
+
+#endif
diff --git a/src/bin/elementary/test_part_bg.c b/src/bin/elementary/test_part_bg.c
index d3d6ea3629..c192cdef36 100644
--- a/src/bin/elementary/test_part_bg.c
+++ b/src/bin/elementary/test_part_bg.c
@@ -57,23 +57,23 @@ static Efl_Ui_Radio_Group *
_create_box_contents(Evas_Object *box)
{
Evas_Object *hbox;
- Evas_Object *radio_group, *radio;
+ Evas_Object *radio;
Evas_Object *content;
- Efl_Ui_Radio_Group *group;
+ Efl_Ui_Radio_Group *radio_group;
char buf[PATH_MAX];
unsigned int i;
- group = efl_new(EFL_UI_RADIO_GROUP_IMPL_CLASS, NULL);
+ radio_group = efl_new(EFL_UI_RADIO_GROUP_IMPL_CLASS, NULL);
hbox = efl_add(EFL_UI_BOX_CLASS, box,
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, 1, 1),
efl_pack_end(box, efl_added));
- radio_group = radio = efl_add(EFL_UI_RADIO_CLASS, hbox);
+ radio = efl_add(EFL_UI_RADIO_CLASS, hbox);
efl_gfx_hint_weight_set(radio, 0, 0);
efl_ui_radio_state_value_set(radio, 0);
- efl_ui_radio_group_register(group, radio);
+ efl_ui_radio_group_register(radio_group, radio);
efl_pack_end(hbox, radio);
content = efl_add(EFL_UI_BOX_CLASS, hbox,
@@ -96,7 +96,7 @@ _create_box_contents(Evas_Object *box)
radio = efl_add(EFL_UI_RADIO_CLASS, hbox);
efl_ui_radio_state_value_set(radio, i + 1);
efl_gfx_hint_weight_set(radio, 0, 0);
- efl_ui_radio_group_register(group, radio);
+ efl_ui_radio_group_register(radio_group, radio);
efl_pack_end(hbox, radio);
content = efl_add(content_class[i], hbox,
@@ -114,7 +114,7 @@ _create_box_contents(Evas_Object *box)
evas_object_data_set(radio, "data", content);
}
- efl_ui_radio_group_selected_value_set(group, 0);
+ efl_ui_radio_group_selected_value_set(radio_group, 0);
return radio_group;
}
diff --git a/src/bin/elementary/test_slider.c b/src/bin/elementary/test_slider.c
index 1b0b2999c3..10c21441c7 100644
--- a/src/bin/elementary/test_slider.c
+++ b/src/bin/elementary/test_slider.c
@@ -24,6 +24,18 @@ _change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
elm_slider_value_set(data, val);
}
+void
+_drag_start_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ printf("drag,started! slider value : %d\n", (int)round(elm_slider_value_get(obj)));
+}
+
+void
+_drag_stop_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ printf("drag,stopped! slider value : %d\n", (int)round(elm_slider_value_get(obj)));
+}
+
static void
_ok_btn_clicked(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@@ -244,6 +256,10 @@ test_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
evas_object_show(ic);
evas_object_show(sl);
+ evas_object_smart_callback_add(sl, "slider,drag,start", _drag_start_cb, NULL);
+ evas_object_smart_callback_add(sl, "slider,drag,stop", _drag_stop_cb, NULL);
+
+
// horizontally inverted slider
ic = elm_icon_add(bx);
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
diff --git a/src/bin/elementary/test_ui_item_container.c b/src/bin/elementary/test_ui_collection.c
index ec2b2dfb8c..b60cf35f75 100644
--- a/src/bin/elementary/test_ui_item_container.c
+++ b/src/bin/elementary/test_ui_collection.c
@@ -86,7 +86,7 @@ _widget_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
}
static void
-_add_item(Efl_Ui_Collection *c)
+_add_item(Efl_Ui_Collection *c, Eo *cont)
{
Efl_Class *itc = efl_key_data_get(c, "__item_class");
char buf[PATH_MAX];
@@ -126,7 +126,7 @@ _add_item(Efl_Ui_Collection *c)
efl_gfx_hint_size_min_set(il, EINA_SIZE2D(100, 180));
else
efl_gfx_hint_size_min_set(il, EINA_SIZE2D(40, 40+(i%2)*40));
- efl_pack_end(c, il);
+ efl_pack_end(cont, il);
}
static void
@@ -138,7 +138,7 @@ _remove_all_cb(void *data, const Efl_Event *ev EINA_UNUSED)
static void
_add_one_item(void *data, const Efl_Event *ev EINA_UNUSED)
{
- _add_item(data);
+ _add_item(data, data);
}
static void
@@ -146,7 +146,7 @@ _add_thousend_items(void *data, const Efl_Event *ev EINA_UNUSED)
{
for (int i = 0; i < 1000; ++i)
{
- _add_item(data);
+ _add_item(data, data);
}
}
@@ -158,9 +158,9 @@ _select_value_cb(void *data, const Efl_Event *ev)
efl_ui_select_mode_set(c, efl_ui_radio_group_selected_value_get(ev->object));
}
-void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl_Class *item, const char *name)
+void create_item_container_ui(const Efl_Class *collection_class, const Efl_Class *item, const char *name)
{
- Efl_Ui_Win *win, *o, *tbl, *item_container, *bx;
+ Efl_Ui_Win *win, *o, *tbl, *item_container, *bx, *git;
Match_Content_Ctx *ctx = calloc(1, sizeof(*ctx));
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
@@ -170,14 +170,28 @@ void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl
tbl = efl_add(EFL_UI_TABLE_CLASS, win);
efl_content_set(win, tbl);
- item_container = o = efl_add(EFL_UI_COLLECTION_CLASS, win,
- efl_ui_collection_position_manager_set(efl_added, manager));
+ item_container = o = efl_add(collection_class, win);
efl_key_data_set(o, "__item_class", item);
efl_event_callback_add(o, EFL_EVENT_DEL, _widget_del_cb, ctx);
- for (int i = 0; i < 2000; ++i)
+ for (int i = 0; i < 200; ++i)
{
- _add_item(o);
+ _add_item(o, o);
}
+ for (int j = 0; j < 5; ++j)
+ {
+ Eina_Strbuf *buf = eina_strbuf_new();
+
+ eina_strbuf_append_printf(buf, "Group #%d", j);
+ git = efl_add(EFL_UI_GROUP_ITEM_CLASS, o);
+ efl_text_set(git, eina_strbuf_release(buf));
+ efl_pack_end(o, git);
+ efl_gfx_hint_size_min_set(git, EINA_SIZE2D(40, 40+40));
+ for (int i = 0; i < 200; ++i)
+ {
+ _add_item(o, git);
+ }
+ }
+
efl_pack_table(tbl, o, 1, 0, 1, 12);
ctx->c = o;
@@ -278,12 +292,12 @@ void test_efl_ui_collection_grid(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- create_item_container_ui(efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS), EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container Grid");
+ create_item_container_ui(EFL_UI_GRID_CLASS, EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Grid");
}
void test_efl_ui_collection_list(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- create_item_container_ui(efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS), EFL_UI_LIST_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container List");
+ create_item_container_ui(EFL_UI_LIST_CLASS, EFL_UI_LIST_DEFAULT_ITEM_CLASS, "Efl.Ui.List");
}
diff --git a/src/bin/elementary/test_ui_items.c b/src/bin/elementary/test_ui_items.c
index 4c2254ad25..901226a3b3 100644
--- a/src/bin/elementary/test_ui_items.c
+++ b/src/bin/elementary/test_ui_items.c
@@ -84,4 +84,13 @@ void test_efl_ui_item(void *data EINA_UNUSED,
efl_gfx_hint_size_min_set(o, EINA_SIZE2D(40, 40));
efl_ui_widget_disabled_set(o, EINA_TRUE);
efl_pack_end(box, o);
+
+ o = _item_add(box, EFL_UI_GROUP_ITEM_CLASS, 5);
+ efl_gfx_hint_size_min_set(o, EINA_SIZE2D(40, 40+40));
+ efl_pack_end(box, o);
+
+ o = _item_add(box, EFL_UI_GROUP_ITEM_CLASS, 6);
+ efl_gfx_hint_size_min_set(o, EINA_SIZE2D(40, 40));
+ efl_ui_widget_disabled_set(o, EINA_TRUE);
+ efl_pack_end(box, o);
}
diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c
index 16b0b9ccb1..208b7bd260 100644
--- a/src/bin/elementary/test_ui_popup.c
+++ b/src/bin/elementary/test_ui_popup.c
@@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
-#define EFL_UI_ANCHOR_POPUP_BETA
+#define EFL_UI_POPUP_BETA
#define EFL_UI_SCROLL_ALERT_POPUP_BETA
#include <Efl_Ui.h>
#include <Elementary.h>
@@ -992,13 +992,13 @@ test_ui_text_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
static void
_anchor_set_cb(void *data, const Efl_Event *ev)
{
- efl_ui_anchor_popup_anchor_set(data, ev->object);
+ efl_ui_popup_anchor_set(data, ev->object);
}
static void
_anchor_unset_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
- efl_ui_anchor_popup_anchor_set(data, NULL);
+ efl_ui_popup_anchor_set(data, NULL);
}
void
@@ -1021,12 +1021,12 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_gfx_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_content_set(win, layout);
- Eo *efl_ui_popup = efl_add(EFL_UI_ANCHOR_POPUP_CLASS, win);
+ Eo *efl_ui_popup = efl_add(EFL_UI_POPUP_CLASS, win);
efl_ui_popup_part_backwall_repeat_events_set(efl_part(efl_ui_popup, "backwall"), EINA_TRUE);
//Default align priority order is top, left, right, bottom, center.
- efl_ui_anchor_popup_align_priority_set(efl_ui_popup, EFL_UI_POPUP_ALIGN_TOP,
+ efl_ui_popup_align_priority_set(efl_ui_popup, EFL_UI_POPUP_ALIGN_TOP,
EFL_UI_POPUP_ALIGN_BOTTOM,
EFL_UI_POPUP_ALIGN_LEFT,
EFL_UI_POPUP_ALIGN_RIGHT,