summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-12-13 10:14:05 +0900
committerHermet Park <hermetpark@gmail.com>2019-12-13 10:14:05 +0900
commita8b1cfb6fca185537ebd42d91bc41bebd3248770 (patch)
treea04c9ed14a1b2aeea24ff1db918fc5149df18e0f
parent421836c1166dbc2c5c54fe9497766bab2cb979bc (diff)
parentdeb4cc896575caf145a457a429056d8cf9682e9c (diff)
Merge branch 'master' into devs/hermet/lottie
-rw-r--r--NEWS11
-rw-r--r--src/bin/edje/edje_cc_handlers.c81
-rw-r--r--src/bin/elementary/meson.build1
-rw-r--r--src/bin/elementary/test.c6
-rw-r--r--src/bin/elementary/test_bg.c4
-rw-r--r--src/bin/elementary/test_calendar.c2
-rw-r--r--src/bin/elementary/test_canvas_textblock.c59
-rw-r--r--src/bin/elementary/test_efl_gfx_mapping.c2
-rw-r--r--src/bin/elementary/test_efl_gfx_vg_value_provider.c4
-rw-r--r--src/bin/elementary/test_efl_ui_animation_view.c6
-rw-r--r--src/bin/elementary/test_efl_ui_text.c3
-rw-r--r--src/bin/elementary/test_evas_map.c2
-rw-r--r--src/bin/elementary/test_evas_mask.c2
-rw-r--r--src/bin/elementary/test_evas_snapshot.c2
-rw-r--r--src/bin/elementary/test_gfx_filters.c4
-rw-r--r--src/bin/elementary/test_label.c256
-rw-r--r--src/bin/elementary/test_part_bg.c4
-rw-r--r--src/bin/elementary/test_part_shadow.c2
-rw-r--r--src/bin/elementary/test_photocam.c4
-rw-r--r--src/bin/elementary/test_ui_box_stack.c2
-rw-r--r--src/bin/elementary/test_ui_button.c2
-rw-r--r--src/bin/elementary/test_ui_clock.c4
-rw-r--r--src/bin/elementary/test_ui_collection.c7
-rw-r--r--src/bin/elementary/test_ui_frame.c4
-rw-r--r--src/bin/elementary/test_ui_image.c2
-rw-r--r--src/bin/elementary/test_ui_items.c5
-rw-r--r--src/bin/elementary/test_ui_panel.c4
-rw-r--r--src/bin/elementary/test_ui_panes.c2
-rw-r--r--src/bin/elementary/test_ui_popup.c16
-rw-r--r--src/bin/elementary/test_ui_progressbar.c2
-rw-r--r--src/bin/elementary/test_ui_relative_container.c2
-rw-r--r--src/bin/elementary/test_ui_scroller.c6
-rw-r--r--src/bin/elementary/test_ui_slider.c4
-rw-r--r--src/bin/elementary/test_ui_slider_interval.c4
-rw-r--r--src/bin/elementary/test_ui_spin.c2
-rw-r--r--src/bin/elementary/test_ui_spin_button.c2
-rw-r--r--src/bin/elementary/test_ui_table_static.c2
-rw-r--r--src/bin/elementary/test_win_dialog.c4
-rw-r--r--src/bin/elementary/test_win_indicator.c2
-rw-r--r--src/bin/elementary/test_win_stack.c12
-rw-r--r--src/bin/eolian_mono/eolian/mono/blacklist.hh4
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh146
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh12
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh129
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_fields.hh40
-rw-r--r--src/bindings/mono/eina_mono/eina_list.cs364
-rw-r--r--src/bindings/mono/meson.build3
-rw-r--r--src/examples/elementary/efl_ui_list_example_1.c6
-rw-r--r--src/lib/ecore/ecore_exe_posix.c13
-rw-r--r--src/lib/edje/edje_data.c2
-rw-r--r--src/lib/edje/edje_entry.c1
-rw-r--r--src/lib/edje/edje_private.h3
-rw-r--r--src/lib/edje/edje_textblock.c103
-rw-r--r--src/lib/eet/Eet.h23
-rw-r--r--src/lib/eeze/eeze_sensor.c1
-rw-r--r--src/lib/eina/eina_cow.h18
-rw-r--r--src/lib/eina/eina_rbtree.c2
-rw-r--r--src/lib/elementary/efl_ui_collection.c1
-rw-r--r--src/lib/elementary/efl_ui_collection_view.c9
-rw-r--r--src/lib/elementary/efl_ui_popup.c8
-rw-r--r--src/lib/elementary/efl_ui_popup.eo1
-rw-r--r--src/lib/elementary/efl_ui_position_manager_data_access_v1.eo1
-rw-r--r--src/lib/elementary/efl_ui_position_manager_grid.c36
-rw-r--r--src/lib/elementary/efl_ui_position_manager_list.c29
-rw-r--r--src/lib/elementary/efl_ui_widget_factory.c14
-rw-r--r--src/lib/elementary/elm_priv.h6
-rw-r--r--src/lib/eo/eo_base_class.c137
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp5
-rw-r--r--src/lib/evas/canvas/evas_object_image.c31
-rw-r--r--src/lib/evas/canvas/evas_object_main.c4
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c496
-rw-r--r--src/lib/evas/canvas/evas_textblock_legacy.h100
-rw-r--r--src/lib/evas/common/evas_font.h53
-rw-r--r--src/lib/evas/common/evas_font_load.c6
-rw-r--r--src/lib/evas/common/evas_font_main.c296
-rw-r--r--src/lib/evas/common/evas_font_query.c55
-rw-r--r--src/lib/evas/common/evas_text_utils.c6
-rw-r--r--src/modules/eeze/meson.build1
-rw-r--r--src/modules/eeze/sensor/tizen/meson.build8
-rw-r--r--src/modules/eeze/sensor/tizen/tizen.c1383
-rw-r--r--src/tests/efl_mono/Eina.cs71
-rw-r--r--src/tests/efl_mono/List.cs193
-rw-r--r--src/tests/efl_mono/Structs.cs50
-rw-r--r--src/tests/efl_mono/meson.build3
-rw-r--r--src/tests/elementary/efl_ui_suite.c1
-rw-r--r--src/tests/elementary/efl_ui_suite.h1
-rw-r--r--src/tests/elementary/efl_ui_test_position_manager_common.c1
-rw-r--r--src/tests/elementary/efl_ui_test_text.c141
-rw-r--r--src/tests/elementary/meson.build1
-rw-r--r--src/tests/elementary/spec/efl_test_basics.c1
-rw-r--r--src/tests/eo/suite/eo_test_event.c35
-rw-r--r--src/tests/evas/evas_buffer_helper.c199
-rw-r--r--src/tests/evas/evas_buffer_helper.h32
-rw-r--r--src/tests/evas/evas_test_object_smart.c2
-rw-r--r--src/tests/evas/evas_test_textblock.c30
-rw-r--r--src/tests/evas/meson.build1
96 files changed, 2973 insertions, 1890 deletions
diff --git a/NEWS b/NEWS
index 3cfa365..76b8b92 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,17 @@
2EFL 1.23.0 2EFL 1.23.0
3========== 3==========
4 4
5Changes since 1.23.0:
6---------------------
7
8Removals:
9
10 * emotion & evas: remove gstreamer 0.10 support
11 * escape: remove library from tree
12 * ecore_x: remove support XGesture extension
13 * elocation: remove beta library
14 * eeze: remove tizen module support from eeze sensor
15
5Changes since 1.22.0: 16Changes since 1.22.0:
6--------------------- 17---------------------
7 18
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 2851a51..106a47b 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -419,6 +419,8 @@ static void st_collections_group_parts_part_description_text_repch(void);
419static void st_collections_group_parts_part_description_text_size(void); 419static void st_collections_group_parts_part_description_text_size(void);
420static void st_collections_group_parts_part_description_text_size_range(void); 420static void st_collections_group_parts_part_description_text_size_range(void);
421static void st_collections_group_parts_part_description_text_fit(void); 421static void st_collections_group_parts_part_description_text_fit(void);
422static void st_collections_group_parts_part_description_text_fit_step(void);
423static void st_collections_group_parts_part_description_text_fit_size_array(void);
422static void st_collections_group_parts_part_description_text_min(void); 424static void st_collections_group_parts_part_description_text_min(void);
423static void st_collections_group_parts_part_description_text_max(void); 425static void st_collections_group_parts_part_description_text_max(void);
424static void st_collections_group_parts_part_description_text_align(void); 426static void st_collections_group_parts_part_description_text_align(void);
@@ -955,6 +957,8 @@ New_Statement_Handler statement_handlers[] =
955 {"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size}, 957 {"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size},
956 {"collections.group.parts.part.description.text.size_range", st_collections_group_parts_part_description_text_size_range}, 958 {"collections.group.parts.part.description.text.size_range", st_collections_group_parts_part_description_text_size_range},
957 {"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit}, 959 {"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit},
960 {"collections.group.parts.part.description.text.fit_step", st_collections_group_parts_part_description_text_fit_step},
961 {"collections.group.parts.part.description.text.fit_size_array", st_collections_group_parts_part_description_text_fit_size_array},
958 {"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min}, 962 {"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min},
959 {"collections.group.parts.part.description.text.max", st_collections_group_parts_part_description_text_max}, 963 {"collections.group.parts.part.description.text.max", st_collections_group_parts_part_description_text_max},
960 {"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align}, 964 {"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align},
@@ -11673,6 +11677,83 @@ st_collections_group_parts_part_description_text_fit(void)
11673 ed->text.fit_y = parse_bool(1); 11677 ed->text.fit_y = parse_bool(1);
11674} 11678}
11675 11679
11680
11681/**
11682 @page edcref
11683
11684 @property
11685 fit_step
11686 @parameters
11687 [font step size in points (pt)]
11688 @effect
11689 Sets the font step size for the text part. when fitting text
11690
11691 Defaults: 1
11692 @since 1.24.0
11693 @endproperty
11694 */
11695static void
11696st_collections_group_parts_part_description_text_fit_step(void)
11697{
11698 Edje_Part_Description_Text *ed;
11699
11700 check_arg_count(1);
11701
11702 if (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)
11703 {
11704 ERR("parse error %s:%i. text attributes in non-TEXTBLOCK part.",
11705 file_in, line - 1);
11706 exit(-1);
11707 }
11708
11709 ed = (Edje_Part_Description_Text *)current_desc;
11710
11711 ed->text.fit_step = parse_int(0);
11712
11713 if (ed->text.fit_step < 1)
11714 {
11715 ERR("parse error %s:%i. fit step less than 1.",
11716 file_in, line - 1);
11717 exit(-1);
11718 }
11719}
11720
11721/**
11722 @page edcref
11723
11724 @property
11725 fit
11726 @parameters
11727 [Array of font sizes in points]
11728 @effect
11729 Sets the allowed font sizes array for the text part.
11730 @since 1.24.0
11731 @endproperty
11732 */
11733static void
11734st_collections_group_parts_part_description_text_fit_size_array(void)
11735{
11736 int n, argc;
11737 Edje_Part_Description_Text *ed;
11738
11739 if (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)
11740 {
11741 ERR("parse error %s:%i. text attributes in non-TEXTBLOCK part.",
11742 file_in, line - 1);
11743 exit(-1);
11744 }
11745
11746 ed = (Edje_Part_Description_Text *)current_desc;
11747 check_min_arg_count(1);
11748
11749 for (n = 0, argc = get_arg_count(); n < argc; n++)
11750 {
11751 unsigned int *value = malloc(sizeof(unsigned int));
11752 *value = (unsigned int) parse_int(n);
11753 ed->text.fit_size_array = eina_list_append(ed->text.fit_size_array, value);
11754 }
11755}
11756
11676/** 11757/**
11677 @page edcref 11758 @page edcref
11678 11759
diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build
index 342e184..27dabe6 100644
--- a/src/bin/elementary/meson.build
+++ b/src/bin/elementary/meson.build
@@ -139,6 +139,7 @@ elementary_test_src = [
139 'test_ui_table.c', 139 'test_ui_table.c',
140 'test_ui_popup.c', 140 'test_ui_popup.c',
141 'test_ui_textpath.c', 141 'test_ui_textpath.c',
142 'test_canvas_textblock.c',
142 'test_video.c', 143 'test_video.c',
143 'test_weather.c', 144 'test_weather.c',
144 'test_web.c', 145 'test_web.c',
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 355a5cc..4150ab2 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -240,9 +240,11 @@ void test_flip_page_eo(void *data, Evas_Object *obj, void *event_info);
240void test_label(void *data, Evas_Object *obj, void *event_info); 240void test_label(void *data, Evas_Object *obj, void *event_info);
241void test_label_slide(void *data, Evas_Object *obj, void *event_info); 241void test_label_slide(void *data, Evas_Object *obj, void *event_info);
242void test_label_wrap(void *data, Evas_Object *obj, void *event_info); 242void test_label_wrap(void *data, Evas_Object *obj, void *event_info);
243void test_textblock_fit(void *data, Evas_Object *obj, void *event_info);
243void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info); 244void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info);
244void test_label_colors(void *data, Evas_Object *obj, void *event_info); 245void test_label_colors(void *data, Evas_Object *obj, void *event_info);
245void test_label_emoji(void *data, Evas_Object *obj, void *event_info); 246void test_label_emoji(void *data, Evas_Object *obj, void *event_info);
247void test_label_variation_sequence(void *data, Evas_Object *obj, void *event_info);
246void test_conformant(void *data, Evas_Object *obj, void *event_info); 248void test_conformant(void *data, Evas_Object *obj, void *event_info);
247void test_conformant2(void *data, Evas_Object *obj, void *event_info); 249void test_conformant2(void *data, Evas_Object *obj, void *event_info);
248void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info); 250void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info);
@@ -372,6 +374,7 @@ void test_evas_snapshot(void *data, Evas_Object *obj, void *event_info);
372void test_evas_map(void *data, Edje_Object *obj, void *event_info); 374void test_evas_map(void *data, Edje_Object *obj, void *event_info);
373void test_efl_gfx_mapping(void *data, Edje_Object *obj, void *event_info); 375void test_efl_gfx_mapping(void *data, Edje_Object *obj, void *event_info);
374void test_ui_textpath(void *data, Edje_Object *obj, void *event_info); 376void test_ui_textpath(void *data, Edje_Object *obj, void *event_info);
377void test_canvas_textblock(void *data, Edje_Object *obj, void *event_info);
375 378
376void test_efl_anim_alpha(void *data, Evas_Object *obj, void *event_info); 379void test_efl_anim_alpha(void *data, Evas_Object *obj, void *event_info);
377void test_efl_anim_rotate(void *data, Evas_Object *obj, void *event_info); 380void test_efl_anim_rotate(void *data, Evas_Object *obj, void *event_info);
@@ -1205,10 +1208,13 @@ add_tests:
1205 ADD_TEST(NULL, "Text", "Label", test_label); 1208 ADD_TEST(NULL, "Text", "Label", test_label);
1206 ADD_TEST(NULL, "Text", "Label Slide", test_label_slide); 1209 ADD_TEST(NULL, "Text", "Label Slide", test_label_slide);
1207 ADD_TEST(NULL, "Text", "Label Wrap", test_label_wrap); 1210 ADD_TEST(NULL, "Text", "Label Wrap", test_label_wrap);
1211 ADD_TEST(NULL, "Text", "Textblock Fit", test_textblock_fit);
1208 ADD_TEST(NULL, "Text", "Label Ellipsis", test_label_ellipsis); 1212 ADD_TEST(NULL, "Text", "Label Ellipsis", test_label_ellipsis);
1209 ADD_TEST(NULL, "Text", "Label Colors", test_label_colors); 1213 ADD_TEST(NULL, "Text", "Label Colors", test_label_colors);
1210 ADD_TEST(NULL, "Text", "Label Emoji", test_label_emoji); 1214 ADD_TEST(NULL, "Text", "Label Emoji", test_label_emoji);
1215 ADD_TEST(NULL, "Text", "Label Variation Sequnece", test_label_variation_sequence);
1211 ADD_TEST_EO(NULL, "Text", "Efl.Ui.Textpath", test_ui_textpath); 1216 ADD_TEST_EO(NULL, "Text", "Efl.Ui.Textpath", test_ui_textpath);
1217 ADD_TEST_EO(NULL, "Text", "Efl.Canvas.Textblock style", test_canvas_textblock);
1212 1218
1213 //------------------------------// 1219 //------------------------------//
1214 ADD_TEST(NULL, "Stored Surface Buffer", "Launcher", test_launcher); 1220 ADD_TEST(NULL, "Stored Surface Buffer", "Launcher", test_launcher);
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index 29fdeec..c4a0b0b 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -332,7 +332,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
332 Evas_Object *win, *box, *cs; 332 Evas_Object *win, *box, *cs;
333 char buf[PATH_MAX]; 333 char buf[PATH_MAX];
334 334
335 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 335 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
336 efl_text_set(efl_added, "Bg EOAPI (Efl.Ui.Win)"), 336 efl_text_set(efl_added, "Bg EOAPI (Efl.Ui.Win)"),
337 efl_ui_win_autodel_set(efl_added, EINA_TRUE), 337 efl_ui_win_autodel_set(efl_added, EINA_TRUE),
338 efl_ui_win_alpha_set(efl_added, 1)); 338 efl_ui_win_alpha_set(efl_added, 1));
@@ -408,7 +408,7 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
408 Evas_Object *rd, *c; 408 Evas_Object *rd, *c;
409 char buf[PATH_MAX]; 409 char buf[PATH_MAX];
410 410
411 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 411 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
412 efl_text_set(efl_added, "Bg EOAPI (Efl.Ui.Bg)"), 412 efl_text_set(efl_added, "Bg EOAPI (Efl.Ui.Bg)"),
413 efl_ui_win_autodel_set(efl_added, EINA_TRUE), 413 efl_ui_win_autodel_set(efl_added, EINA_TRUE),
414 efl_ui_win_alpha_set(efl_added, EINA_FALSE)); 414 efl_ui_win_alpha_set(efl_added, EINA_FALSE));
diff --git a/src/bin/elementary/test_calendar.c b/src/bin/elementary/test_calendar.c
index b3f54f5..8c5fc85d 100644
--- a/src/bin/elementary/test_calendar.c
+++ b/src/bin/elementary/test_calendar.c
@@ -433,7 +433,7 @@ test_efl_ui_calendar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
433 current_date = time(NULL) + SEC_PER_YEAR; 433 current_date = time(NULL) + SEC_PER_YEAR;
434 localtime_r(&current_date, &max_date); 434 localtime_r(&current_date, &max_date);
435 435
436 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 436 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
437 efl_text_set(efl_added, "Efl Ui Calendar"), 437 efl_text_set(efl_added, "Efl Ui Calendar"),
438 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 438 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
439 439
diff --git a/src/bin/elementary/test_canvas_textblock.c b/src/bin/elementary/test_canvas_textblock.c
new file mode 100644
index 0000000..1c20ac5
--- /dev/null
+++ b/src/bin/elementary/test_canvas_textblock.c
@@ -0,0 +1,59 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <Efl_Ui.h>
5#include <Elementary.h>
6
7static void
8_apply_style(const Eo *input, Eo *textblock)
9{
10 const char *style = efl_text_get(input);
11 efl_canvas_textblock_style_apply(textblock, style);
12}
13
14static void
15_style_changed_cb(void *data, const Efl_Event *ev)
16{
17 _apply_style(ev->object, data);
18}
19
20
21void
22test_canvas_textblock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
23{
24 Eo *win, *box, *textblock, *input;
25 const char *default_style;
26
27 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
28 efl_text_set(efl_added, "Efl.Canvas.Textblock style"),
29 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
30
31 box = efl_add(EFL_UI_BOX_CLASS, win,
32 efl_content_set(win, efl_added),
33 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
34
35 efl_add(EFL_UI_TEXTBOX_CLASS, box,
36 efl_gfx_hint_weight_set(efl_added, 1, 0),
37 efl_text_set(efl_added, "Live style editor. Enter a style string below:"),
38 efl_pack(box, efl_added));
39
40 input = efl_add(EFL_UI_TEXTBOX_CLASS, box,
41 efl_gfx_hint_weight_set(efl_added, 1, 0),
42 efl_text_set(efl_added, "font=Sans font_size=24 color=white"),
43 efl_pack(box, efl_added));
44 efl_ui_textbox_scrollable_set(input, EINA_TRUE);
45
46 textblock = efl_add(EFL_CANVAS_TEXTBLOCK_CLASS, box,
47 efl_text_multiline_set(efl_added, EINA_TRUE),
48 efl_text_set(efl_added, "This is a sample text block."),
49 efl_pack(box, efl_added));
50
51 efl_event_callback_add(input, EFL_TEXT_INTERACTIVE_EVENT_CHANGED_USER,
52 _style_changed_cb, textblock),
53
54 efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 240));
55
56 default_style = efl_canvas_textblock_all_styles_get(textblock);
57 printf("Default style string: %s\n", default_style);
58 _apply_style(input, textblock);
59}
diff --git a/src/bin/elementary/test_efl_gfx_mapping.c b/src/bin/elementary/test_efl_gfx_mapping.c
index fecfc45..a895d82 100644
--- a/src/bin/elementary/test_efl_gfx_mapping.c
+++ b/src/bin/elementary/test_efl_gfx_mapping.c
@@ -46,7 +46,7 @@ test_efl_gfx_mapping(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
46 Evas_Object *win, *img; 46 Evas_Object *win, *img;
47 char buf[PATH_MAX]; 47 char buf[PATH_MAX];
48 48
49 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 49 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
50 efl_text_set(efl_added, "Efl Gfx Map"), 50 efl_text_set(efl_added, "Efl Gfx Map"),
51 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 51 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
52 52
diff --git a/src/bin/elementary/test_efl_gfx_vg_value_provider.c b/src/bin/elementary/test_efl_gfx_vg_value_provider.c
index 9a800e7..9982652 100644
--- a/src/bin/elementary/test_efl_gfx_vg_value_provider.c
+++ b/src/bin/elementary/test_efl_gfx_vg_value_provider.c
@@ -299,7 +299,7 @@ test_efl_gfx_vg_value_provider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
299 // This line must to need. 299 // This line must to need.
300 setenv("ELM_ACCEL", "gl", 1); 300 setenv("ELM_ACCEL", "gl", 1);
301 301
302 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 302 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
303 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), 303 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
304 efl_text_set(efl_added, "Efl_Ui_Animation_View demo"), 304 efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
305 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 305 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
@@ -573,7 +573,7 @@ test_efl_gfx_vg_value_provider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
573 Eo *win, *box; 573 Eo *win, *box;
574 char buf[255]; 574 char buf[255];
575 575
576 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 576 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
577 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), 577 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
578 efl_text_set(efl_added, "Efl_Ui_Animation_View demo"), 578 efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
579 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 579 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
diff --git a/src/bin/elementary/test_efl_ui_animation_view.c b/src/bin/elementary/test_efl_ui_animation_view.c
index 9dc2352..f5a73df 100644
--- a/src/bin/elementary/test_efl_ui_animation_view.c
+++ b/src/bin/elementary/test_efl_ui_animation_view.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Elementary.h> 4#include <Elementary.h>
5#include <Efl_Ui.h> 5#include <Efl_Ui.h>
6#include "elm_priv.h" //FIXME remove this once efl.ui.text doesn't need elm_general.h 6
7#ifndef EFL_BETA_API_SUPPORT 7#ifndef EFL_BETA_API_SUPPORT
8#define EFL_BETA_API_SUPPORT 8#define EFL_BETA_API_SUPPORT
9#endif 9#endif
@@ -141,7 +141,7 @@ test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
141 Eo *win, *box, *box2, *box3, *box4, *label, *anim_view, *check, *slider; 141 Eo *win, *box, *box2, *box3, *box4, *label, *anim_view, *check, *slider;
142 char buf[255]; 142 char buf[255];
143 143
144 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 144 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
145 efl_text_set(efl_added, "Efl_Ui_Animation_View demo"), 145 efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
146 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 146 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
147 147
@@ -295,7 +295,7 @@ test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
295 Eo *win, *box; 295 Eo *win, *box;
296 char buf[255]; 296 char buf[255];
297 297
298 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 298 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
299 efl_text_set(efl_added, "Efl_Ui_Animation_View demo"), 299 efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
300 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 300 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
301 301
diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c
index 40b88bf..066e732 100644
--- a/src/bin/elementary/test_efl_ui_text.c
+++ b/src/bin/elementary/test_efl_ui_text.c
@@ -4,7 +4,6 @@
4#define EO_BETA_API 4#define EO_BETA_API
5#include <Efl_Ui.h> 5#include <Efl_Ui.h>
6#include <Elementary.h> 6#include <Elementary.h>
7#include "elm_priv.h" //FIXME remove this once efl.ui.text doesn't need elm_general.h
8 7
9static void 8static void
10_apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style) 9_apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style)
@@ -42,7 +41,7 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
42 Eo *en; 41 Eo *en;
43 char *markup; 42 char *markup;
44 43
45 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 44 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
46 efl_text_set(efl_added, "Efl Canvas_Layout"), 45 efl_text_set(efl_added, "Efl Canvas_Layout"),
47 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 46 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
48 47
diff --git a/src/bin/elementary/test_evas_map.c b/src/bin/elementary/test_evas_map.c
index 0687a33..78800ab 100644
--- a/src/bin/elementary/test_evas_map.c
+++ b/src/bin/elementary/test_evas_map.c
@@ -54,7 +54,7 @@ test_evas_map(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
54 Evas_Object *win, *img; 54 Evas_Object *win, *img;
55 char buf[PATH_MAX]; 55 char buf[PATH_MAX];
56 56
57 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 57 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
58 efl_text_set(efl_added, "Evas Map"), 58 efl_text_set(efl_added, "Evas Map"),
59 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 59 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
60 60
diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c
index 4a263e0..f1620af 100644
--- a/src/bin/elementary/test_evas_mask.c
+++ b/src/bin/elementary/test_evas_mask.c
@@ -122,7 +122,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
122 Elm_Genlist_Item_Class *itc; 122 Elm_Genlist_Item_Class *itc;
123 char buf[PATH_MAX]; 123 char buf[PATH_MAX];
124 124
125 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 125 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
126 efl_text_set(efl_added, "Evas masking demo"), 126 efl_text_set(efl_added, "Evas masking demo"),
127 efl_ui_win_autodel_set(efl_added, 1)); 127 efl_ui_win_autodel_set(efl_added, 1));
128 128
diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c
index 40513bb..b6ac7bc 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -124,7 +124,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
124 Eo *win, *table, *o, *snap, *box; 124 Eo *win, *table, *o, *snap, *box;
125 const char *path; 125 const char *path;
126 126
127 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 127 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
128 efl_text_set(efl_added, "Evas Snapshot"), 128 efl_text_set(efl_added, "Evas Snapshot"),
129 efl_ui_win_autodel_set(efl_added, 1)); 129 efl_ui_win_autodel_set(efl_added, 1));
130 130
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index a890aba..7ab9a63 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -5,7 +5,7 @@
5#include <Elementary.h> 5#include <Elementary.h>
6#include <Efl_Ui.h> 6#include <Efl_Ui.h>
7#include "elm_spinner_eo.h" 7#include "elm_spinner_eo.h"
8#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h 8
9static const int default_font_size = 48; 9static const int default_font_size = 48;
10 10
11typedef struct _Filter_Image 11typedef struct _Filter_Image
@@ -332,7 +332,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
332{ 332{
333 Eo *win, *box, *box2, *o, *text = NULL, *spinner, *code, *split, *flip, *tb; 333 Eo *win, *box, *box2, *o, *text = NULL, *spinner, *code, *split, *flip, *tb;
334 334
335 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 335 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
336 efl_text_set(efl_added, "Gfx Filter Editor"), 336 efl_text_set(efl_added, "Gfx Filter Editor"),
337 efl_ui_win_autodel_set(efl_added, 1)); 337 efl_ui_win_autodel_set(efl_added, 1));
338 338
diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c
index 233ce01..5b3e5e8 100644
--- a/src/bin/elementary/test_label.c
+++ b/src/bin/elementary/test_label.c
@@ -309,6 +309,238 @@ test_label_slide(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
309 evas_object_show(win); 309 evas_object_show(win);
310} 310}
311 311
312
313
314/*** FIT TEXT **************************************************************/
315enum BUTTON{
316 BUTTON_MODE = 0,
317 BUTTON_MAX = 1,
318 BUTTON_MIN = 2,
319 BUTTON_STEP = 3,
320 BUTTON_ARRAY = 4,
321 BUTTON_CONTENT = 5,
322 BUTTON_STYLE = 6,
323 BUTTON_ALL = BUTTON_STYLE+1,
324};
325
326char* BUTTON_STR[BUTTON_ALL] ={
327 "MODE",
328 "MAX",
329 "MIN",
330 "STEP",
331 "ARRAY",
332 "CONTENT",
333 "STYLE",
334};
335
336char *contents[] = {
337 "Hello World",
338 "This is Line<br>THis is other Line",
339 "This text contains <font_size=20 color=#F00>SPECIFIC SIZE</font_size>that does not effected by fit mode"
340 };
341
342char *styles[] = {
343 "DEFAULT='font=sans font_size=30 color=#000 wrap=mixed ellipsis=1.0'",
344 "DEFAULT='font=sans font_size=30 color=#000 wrap=mixed'",
345 "DEFAULT='font=sans font_size=30 color=#000 ellipsis=1.0'",
346 "DEFAULT='font=sans font_size=30 color=#000'",
347 };
348
349char *styles_names[] = {
350 "wrap=<color=#F00>mixed</color> ellipsis=<color=#F00>1.0</color>",
351 "wrap=<color=#F00>mixed</color> ellipsis=<color=#F00>NONE</color>",
352 "wrap=<color=#F00>NONE</color> ellipsis=<color=#F00>1.0</color>",
353 "wrap=<color=#F00>NONE</color> ellipsis=<color=#F00>NONE</color>",
354 };
355
356typedef struct _APP
357{
358 Evas_Object *win, *box, *txtblock,*bg, *boxHor, *boxHor2;
359 Eo *btn[BUTTON_ALL];
360 Eo *lbl_status;
361 char * str;
362 unsigned int i_contnet, i_style;
363} APP;
364APP *app;
365
366char * get_fit_status(Eo * textblock);
367
368static void _btn_clicked(void *data EINA_UNUSED, Eo *obj, void *eventInfo EINA_UNUSED){
369 if (obj == app->btn[BUTTON_MODE])
370 {
371 unsigned int options;
372 evas_textblock_fit_options_get(app->txtblock, &options);
373 if (options == TEXTBLOCK_FIT_MODE_NONE)
374 evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_HEIGHT);
375 else if (options == TEXTBLOCK_FIT_MODE_HEIGHT)
376 evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_WIDTH);
377 else if (options == TEXTBLOCK_FIT_MODE_WIDTH)
378 evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_ALL);
379 else if (options == TEXTBLOCK_FIT_MODE_ALL)
380 evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_NONE);
381 }
382 else if (obj == app->btn[BUTTON_MAX])
383 {
384 unsigned int min, max;
385 evas_textblock_fit_size_range_get(app->txtblock, &min, &max);
386 max -= 5;
387 evas_textblock_fit_size_range_set(app->txtblock, min, max);
388 }
389 else if (obj == app->btn[BUTTON_MIN])
390 {
391 unsigned int min, max;
392 evas_textblock_fit_size_range_get(app->txtblock, &min, &max);
393 min += 5;
394 evas_textblock_fit_size_range_set(app->txtblock, min, max);
395 }
396 else if (obj == app->btn[BUTTON_STEP])
397 {
398 unsigned int step;
399 evas_textblock_fit_step_size_get(app->txtblock, &step);
400 step++;
401 evas_textblock_fit_step_size_set(app->txtblock, step);
402 }
403 else if (obj == app->btn[BUTTON_ARRAY])
404 {
405 unsigned int font_size[] = {10, 50, 100 ,150};
406 evas_textblock_fit_size_array_set(app->txtblock,font_size,4);
407 }
408 else if (obj == app->btn[BUTTON_CONTENT])
409 {
410 app->i_contnet++;
411 if(app->i_contnet>=sizeof(contents)/sizeof(char*))
412 app->i_contnet=0;
413 evas_object_textblock_text_markup_set(app->txtblock,contents[app->i_contnet]);
414 }
415 else if (obj == app->btn[BUTTON_STYLE])
416 {
417 app->i_style++;
418 if(app->i_style>=sizeof(styles)/sizeof(char*))
419 app->i_style=0;
420
421 Evas_Textblock_Style *style = evas_object_textblock_style_get(app->txtblock);
422 evas_textblock_style_set(style,styles[app->i_style]);
423 }
424
425 elm_object_text_set(app->lbl_status, get_fit_status(app->txtblock));
426}
427
428char * get_fit_status(Eo * textblock)
429{
430 static char status[0xFFF];
431 unsigned int options,min,max,step,size_array[256];
432 size_t size_array_len;
433 evas_textblock_fit_options_get(textblock,&options);
434 evas_textblock_fit_size_range_get(textblock,&min,&max);
435 evas_textblock_fit_step_size_get(textblock,&step);
436 evas_textblock_fit_size_array_get(textblock,NULL,&size_array_len,0);
437 if (size_array_len>255)
438 size_array_len = 255;
439 evas_textblock_fit_size_array_get(textblock,size_array,NULL,size_array_len);
440
441 strcpy(status,"Mode : ");
442 if (options == TEXTBLOCK_FIT_MODE_NONE)
443 strcat(status,"MODE_NONE");
444 else if (options == TEXTBLOCK_FIT_MODE_HEIGHT)
445 strcat(status,"MODE_HEIGHT");
446 else if (options == TEXTBLOCK_FIT_MODE_WIDTH)
447 strcat(status,"MODE_WIDTH");
448 else if (options == TEXTBLOCK_FIT_MODE_ALL)
449 strcat(status,"MODE_ALL");
450
451 strcat(status,"<br>");
452 sprintf(status + strlen(status),"Max : %d<br>",max);
453 sprintf(status + strlen(status),"Min : %d<br>",min);
454 sprintf(status + strlen(status),"Step : %d<br>",step);
455 sprintf(status + strlen(status),"Array : [ ");
456 for (size_t i = 0 ; i < 10 ; i++)
457 {
458 if(i<size_array_len)
459 sprintf(status + strlen(status)," %d,",size_array[i]);
460 }
461
462 if(10<size_array_len)
463 sprintf(status + strlen(status)," ... ");
464 sprintf(status + strlen(status)," ]");
465
466 sprintf(status + strlen(status),"<br>");
467 sprintf(status + strlen(status),"%s",styles_names[app->i_style]);
468
469
470
471 return status;
472}
473
474void
475test_textblock_fit(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
476{
477 app = calloc(sizeof(APP), 1);
478
479 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
480
481 app->win = elm_win_util_standard_add("Main", "App");
482 elm_win_autodel_set(app->win, EINA_TRUE);
483
484 app->box = elm_box_add(app->win);
485 app->boxHor = elm_box_add(app->box);
486 app->boxHor2 = elm_box_add(app->box);
487 app->txtblock = evas_object_textblock_add(app->box);
488 app->bg = elm_bg_add(app->box);
489 elm_bg_color_set(app->bg,255,255,255);
490
491 Evas_Textblock_Style *style = evas_textblock_style_new();
492 evas_textblock_style_set(style,styles[0]);
493 evas_object_textblock_style_set(app->txtblock,style);
494 evas_object_textblock_text_markup_set(app->txtblock,contents[0]);
495
496 elm_box_horizontal_set(app->boxHor, EINA_TRUE);
497 elm_box_horizontal_set(app->boxHor2, EINA_TRUE);
498
499 evas_object_size_hint_weight_set(app->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
500 evas_object_size_hint_align_set(app->box, EVAS_HINT_FILL, EVAS_HINT_FILL);
501
502
503 evas_object_size_hint_weight_set(app->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
504 evas_object_size_hint_align_set(app->box, EVAS_HINT_FILL, EVAS_HINT_FILL);
505
506 evas_object_show(app->txtblock);
507 evas_object_show(app->bg);
508 evas_object_show(app->box);
509 evas_object_show(app->boxHor);
510 evas_object_show(app->boxHor2);
511
512 elm_box_pack_end(app->box, app->bg);
513 elm_box_pack_end(app->box, app->boxHor);
514 elm_box_pack_end(app->box, app->boxHor2);
515
516 elm_object_content_set(app->bg,app->txtblock);
517
518 elm_win_resize_object_add(app->win, app->box);
519 evas_object_resize(app->win, 320, 480);
520
521 for(int i = 0 ; i < BUTTON_ALL ; i++)
522 {
523 app->btn[i] = elm_button_add(app->boxHor);
524 evas_object_smart_callback_add(app->btn[i], "clicked", _btn_clicked, NULL);
525 elm_object_text_set(app->btn[i], BUTTON_STR[i]);
526 elm_box_pack_end(app->boxHor, app->btn[i]);
527 evas_object_show(app->btn[i]);
528 }
529
530 app->lbl_status = elm_label_add(app->boxHor2);
531 elm_object_text_set(app->lbl_status, get_fit_status(app->txtblock));
532 elm_box_pack_end(app->boxHor2, app->lbl_status);
533 evas_object_show(app->lbl_status);
534
535 evas_object_size_hint_weight_set(app->txtblock, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
536 evas_object_size_hint_align_set(app->txtblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
537
538 evas_object_size_hint_weight_set(app->bg, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
539 evas_object_size_hint_align_set(app->bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
540
541 evas_object_show(app->win);
542}
543
312/*** Label Wrap **************************************************************/ 544/*** Label Wrap **************************************************************/
313void 545void
314test_label_wrap(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 546test_label_wrap(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
@@ -403,6 +635,30 @@ test_label_colors(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
403 evas_object_show(win); 635 evas_object_show(win);
404} 636}
405 637
638/*** Label variation sequence **************************************************************/
639void
640test_label_variation_sequence(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
641{
642 Evas_Object *win, *lb;
643
644 win = elm_win_util_standard_add("label-variation sequence", "Label variation sequnece");
645 elm_win_autodel_set(win, EINA_TRUE);
646
647 lb = elm_label_add(win);
648 elm_object_text_set(lb,
649 "You need to have at least on font contains variation sequence<br>"
650 "Three different 8 glyphs : <br>"
651 "8<tab>8&#xfe0f;<tab>8&#xfe0f;&#x20E3;<br>"
652 "line with 3 variation glyphs : <br>"
653 "8&#xfe0f;&#x20E3;&#x262a;&#xfe0f;AAA&#x262a;&#xfe0E;1234567&#xfe0f;&#x20E3;"
654 );
655 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
656 elm_win_resize_object_add(win, lb);
657 evas_object_show(lb);
658
659 evas_object_show(win);
660}
661
406/*** Label Emoji *************************************************************/ 662/*** Label Emoji *************************************************************/
407static char * 663static char *
408_fontlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 664_fontlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
diff --git a/src/bin/elementary/test_part_bg.c b/src/bin/elementary/test_part_bg.c
index 04aa723..850377b 100644
--- a/src/bin/elementary/test_part_bg.c
+++ b/src/bin/elementary/test_part_bg.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Efl_Ui.h> 4#include <Efl_Ui.h>
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h 6
7#define MAX_NUM_OF_CONTENT 17 7#define MAX_NUM_OF_CONTENT 17
8 8
9const Efl_Class *content_class[MAX_NUM_OF_CONTENT]; 9const Efl_Class *content_class[MAX_NUM_OF_CONTENT];
@@ -146,7 +146,7 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
146 content_class[15] = EFL_UI_SPIN_CLASS; 146 content_class[15] = EFL_UI_SPIN_CLASS;
147 content_class[16] = EFL_UI_SPIN_BUTTON_CLASS; 147 content_class[16] = EFL_UI_SPIN_BUTTON_CLASS;
148 148
149 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 149 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
150 efl_text_set(efl_added, "Widget Part Background"), 150 efl_text_set(efl_added, "Widget Part Background"),
151 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 151 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
152 152
diff --git a/src/bin/elementary/test_part_shadow.c b/src/bin/elementary/test_part_shadow.c
index 8378473..c8e0f18 100644
--- a/src/bin/elementary/test_part_shadow.c
+++ b/src/bin/elementary/test_part_shadow.c
@@ -86,7 +86,7 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
86 86
87 td = calloc(1, sizeof(*td)); 87 td = calloc(1, sizeof(*td));
88 88
89 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 89 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
90 efl_ui_win_name_set(efl_added, "shadow"), 90 efl_ui_win_name_set(efl_added, "shadow"),
91 efl_text_set(efl_added, "Shadow effects")); 91 efl_text_set(efl_added, "Shadow effects"));
92 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _delete_cb, td); 92 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _delete_cb, td);
diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c
index 5f3e30b..166f669 100644
--- a/src/bin/elementary/test_photocam.c
+++ b/src/bin/elementary/test_photocam.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Efl_Ui.h> 4#include <Efl_Ui.h>
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h 6
7static const struct { 7static const struct {
8 Evas_Image_Orient orient; 8 Evas_Image_Orient orient;
9 const char *name; 9 const char *name;
@@ -805,7 +805,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
805 Eo *win, *bx, *zoomable, *rect; 805 Eo *win, *bx, *zoomable, *rect;
806 char buf[PATH_MAX]; 806 char buf[PATH_MAX];
807 807
808 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 808 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
809 efl_text_set(efl_added, "Efl.Ui.Image_Zoomable animation"), 809 efl_text_set(efl_added, "Efl.Ui.Image_Zoomable animation"),
810 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 810 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
811 811
diff --git a/src/bin/elementary/test_ui_box_stack.c b/src/bin/elementary/test_ui_box_stack.c
index 0e876b3..c272805 100644
--- a/src/bin/elementary/test_ui_box_stack.c
+++ b/src/bin/elementary/test_ui_box_stack.c
@@ -12,7 +12,7 @@ test_ui_box_stack(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
12 Evas_Object *win, *bx, *o; 12 Evas_Object *win, *bx, *o;
13 char buf[PATH_MAX]; 13 char buf[PATH_MAX];
14 14
15 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 15 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
16 efl_text_set(efl_added, "Efl.Ui.Box_Stack"), 16 efl_text_set(efl_added, "Efl.Ui.Box_Stack"),
17 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 17 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
18 18
diff --git a/src/bin/elementary/test_ui_button.c b/src/bin/elementary/test_ui_button.c
index 0cd1e93..eaafb8a 100644
--- a/src/bin/elementary/test_ui_button.c
+++ b/src/bin/elementary/test_ui_button.c
@@ -29,7 +29,7 @@ test_ui_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
29 Eo *win, *bx, *btn; 29 Eo *win, *bx, *btn;
30 char buf[PATH_MAX]; 30 char buf[PATH_MAX];
31 31
32 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 32 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
33 efl_text_set(efl_added, "Efl.Ui.Button"), 33 efl_text_set(efl_added, "Efl.Ui.Button"),
34 efl_ui_win_autodel_set(efl_added, EINA_TRUE) 34 efl_ui_win_autodel_set(efl_added, EINA_TRUE)
35 ); 35 );
diff --git a/src/bin/elementary/test_ui_clock.c b/src/bin/elementary/test_ui_clock.c
index 2ded458..79e9074 100644
--- a/src/bin/elementary/test_ui_clock.c
+++ b/src/bin/elementary/test_ui_clock.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Efl_Ui.h> 4#include <Efl_Ui.h>
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h 6
7/* A simple test, just displaying clock in its default format */ 7/* A simple test, just displaying clock in its default format */
8 8
9Evas_Object *dt1, *dt2, *dt3, *dt4; 9Evas_Object *dt1, *dt2, *dt3, *dt4;
@@ -48,7 +48,7 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
48{ 48{
49 Evas_Object *win, *bx; 49 Evas_Object *win, *bx;
50 50
51 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 51 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
52 efl_text_set(efl_added, "Efl.Ui.Clock"), 52 efl_text_set(efl_added, "Efl.Ui.Clock"),
53 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 53 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
54 54
diff --git a/src/bin/elementary/test_ui_collection.c b/src/bin/elementary/test_ui_collection.c
index 2397e14..6e4d832 100644
--- a/src/bin/elementary/test_ui_collection.c
+++ b/src/bin/elementary/test_ui_collection.c
@@ -2,7 +2,6 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#include <Elementary.h>
6#include <Efl_Ui.h> 5#include <Efl_Ui.h>
7 6
8static void 7static void
@@ -114,7 +113,7 @@ _add_item(Efl_Ui_Collection *c, Eo *cont)
114 snprintf(buf, sizeof(buf), "%d - Test %d", i, i%13); 113 snprintf(buf, sizeof(buf), "%d - Test %d", i, i%13);
115 efl_text_set(il, buf); 114 efl_text_set(il, buf);
116 115
117 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_object_evas_get(c)); 116 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, c);
118 switch (i % 5) 117 switch (i % 5)
119 { 118 {
120 case 0: 119 case 0:
@@ -312,14 +311,14 @@ void create_item_container_ui(const Efl_Class *collection_class, const Efl_Class
312} 311}
313 312
314void test_efl_ui_collection_grid(void *data EINA_UNUSED, 313void test_efl_ui_collection_grid(void *data EINA_UNUSED,
315 Evas_Object *obj EINA_UNUSED, 314 Efl_Object *obj EINA_UNUSED,
316 void *event_info EINA_UNUSED) 315 void *event_info EINA_UNUSED)
317{ 316{
318 create_item_container_ui(EFL_UI_GRID_CLASS, EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Grid"); 317 create_item_container_ui(EFL_UI_GRID_CLASS, EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Grid");
319} 318}
320 319
321void test_efl_ui_collection_list(void *data EINA_UNUSED, 320void test_efl_ui_collection_list(void *data EINA_UNUSED,
322 Evas_Object *obj EINA_UNUSED, 321 Efl_Object *obj EINA_UNUSED,
323 void *event_info EINA_UNUSED) 322 void *event_info EINA_UNUSED)
324{ 323{
325 create_item_container_ui(EFL_UI_LIST_CLASS, EFL_UI_LIST_DEFAULT_ITEM_CLASS, "Efl.Ui.List"); 324 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_frame.c b/src/bin/elementary/test_ui_frame.c
index d5d496d..4271f41 100644
--- a/src/bin/elementary/test_ui_frame.c
+++ b/src/bin/elementary/test_ui_frame.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Efl_Ui.h> 4#include <Efl_Ui.h>
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h 6
7static void 7static void
8_inc_clicked(void *data, const Efl_Event *ev EINA_UNUSED) 8_inc_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
9{ 9{
@@ -15,7 +15,7 @@ test_ui_frame(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
15{ 15{
16 Eo *win, *bx, *f, *txt; 16 Eo *win, *bx, *f, *txt;
17 17
18 win = efl_add_ref(EFL_UI_WIN_CLASS, efl_main_loop_get(), 18 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
19 efl_text_set(efl_added, "Efl.Ui.Frame"), 19 efl_text_set(efl_added, "Efl.Ui.Frame"),
20 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 20 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
21 21
diff --git a/src/bin/elementary/test_ui_image.c b/src/bin/elementary/test_ui_image.c
index 1608605..fc8a9fb 100644
--- a/src/bin/elementary/test_ui_image.c
+++ b/src/bin/elementary/test_ui_image.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Elementary.h> 4#include <Elementary.h>
5#include <Efl_Ui.h> 5#include <Efl_Ui.h>
6#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h 6
7static const struct { 7static const struct {
8 Efl_Gfx_Image_Orientation orient; 8 Efl_Gfx_Image_Orientation orient;
9 const char *name; 9 const char *name;
diff --git a/src/bin/elementary/test_ui_items.c b/src/bin/elementary/test_ui_items.c
index 826f4e4..36c5f97 100644
--- a/src/bin/elementary/test_ui_items.c
+++ b/src/bin/elementary/test_ui_items.c
@@ -2,7 +2,6 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#include <Elementary.h>
6#include <Efl_Ui.h> 5#include <Efl_Ui.h>
7 6
8static Efl_Ui_Widget* 7static Efl_Ui_Widget*
@@ -15,7 +14,7 @@ _item_add(Eo *box, const Efl_Class *c, int i)
15 snprintf(buf, sizeof(buf), "%d - Test %d", i, i%13); 14 snprintf(buf, sizeof(buf), "%d - Test %d", i, i%13);
16 efl_text_set(il, buf); 15 efl_text_set(il, buf);
17 16
18 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_object_evas_get(il)); 17 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, il);
19 switch (i % 5) 18 switch (i % 5)
20 { 19 {
21 case 0: 20 case 0:
@@ -49,7 +48,7 @@ _item_add(Eo *box, const Efl_Class *c, int i)
49} 48}
50 49
51void test_efl_ui_item(void *data EINA_UNUSED, 50void test_efl_ui_item(void *data EINA_UNUSED,
52 Evas_Object *obj EINA_UNUSED, 51 Efl_Object *obj EINA_UNUSED,
53 void *event_info EINA_UNUSED) 52 void *event_info EINA_UNUSED)
54{ 53{
55 Eo *win, *box, *o; 54 Eo *win, *box, *o;
diff --git a/src/bin/elementary/test_ui_panel.c b/src/bin/elementary/test_ui_panel.c
index d5045c6..7a280a3 100644
--- a/src/bin/elementary/test_ui_panel.c
+++ b/src/bin/elementary/test_ui_panel.c
@@ -10,7 +10,7 @@ test_ui_panel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
10 char buf[PATH_MAX] = {0}; 10 char buf[PATH_MAX] = {0};
11 Eo *win, *table, *panel; 11 Eo *win, *table, *panel;
12 12
13 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 13 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
14 efl_text_set(efl_added, "Efl.Ui.Panel"), 14 efl_text_set(efl_added, "Efl.Ui.Panel"),
15 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 15 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
16 16
@@ -102,7 +102,7 @@ test_ui_panel2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
102 int i; 102 int i;
103 Eo *win, *box, *check, *btn, *table, *list, *panel; 103 Eo *win, *box, *check, *btn, *table, *list, *panel;
104 104
105 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 105 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
106 efl_text_set(efl_added, "Efl.Ui.Panel"), 106 efl_text_set(efl_added, "Efl.Ui.Panel"),
107 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 107 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
108 108
diff --git a/src/bin/elementary/test_ui_panes.c b/src/bin/elementary/test_ui_panes.c
index 72d2ab9..bbdf004 100644
--- a/src/bin/elementary/test_ui_panes.c
+++ b/src/bin/elementary/test_ui_panes.c
@@ -9,7 +9,7 @@ test_panes_minsize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
9{ 9{
10 Eo *win, *panes, *panes_h; 10 Eo *win, *panes, *panes_h;
11 11
12 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 12 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
13 efl_text_set(efl_added, "Efl.Ui.Panes"), 13 efl_text_set(efl_added, "Efl.Ui.Panes"),
14 efl_ui_win_autodel_set(efl_added, EINA_TRUE) 14 efl_ui_win_autodel_set(efl_added, EINA_TRUE)
15 ); 15 );
diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c
index 11b7d60..2388c2e 100644
--- a/src/bin/elementary/test_ui_popup.c
+++ b/src/bin/elementary/test_ui_popup.c
@@ -219,7 +219,7 @@ _win_del(void *data, const Efl_Event *ev EINA_UNUSED)
219 /* only free pointer if the other window has already been freed */ 219 /* only free pointer if the other window has already been freed */
220 if (!p_data->win) 220 if (!p_data->win)
221 free(p_data); 221 free(p_data);
222 efl_unref(win); 222 efl_del(win);
223 printf("window is deleted\n"); 223 printf("window is deleted\n");
224} 224}
225 225
@@ -232,7 +232,7 @@ _panel_win_del(void *data, const Efl_Event *ev EINA_UNUSED)
232 /* only free pointer if the other window has already been freed */ 232 /* only free pointer if the other window has already been freed */
233 if (!p_data->win) 233 if (!p_data->win)
234 free(p_data); 234 free(p_data);
235 efl_unref(win); 235 efl_del(win);
236 printf("window is deleted\n"); 236 printf("window is deleted\n");
237} 237}
238 238
@@ -241,14 +241,14 @@ test_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
241{ 241{
242 efl_ui_popup_data *p_data = (efl_ui_popup_data*)calloc(1, sizeof(efl_ui_popup_data)); 242 efl_ui_popup_data *p_data = (efl_ui_popup_data*)calloc(1, sizeof(efl_ui_popup_data));
243 243
244 Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 244 Eo *win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
245 efl_text_set(efl_added, "Efl.Ui.Popup"), 245 efl_text_set(efl_added, "Efl.Ui.Popup"),
246 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 246 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
247 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _win_del, p_data); 247 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _win_del, p_data);
248 248
249 efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500)); 249 efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500));
250 250
251 Eo *panel_win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 251 Eo *panel_win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
252 efl_text_set(efl_added, "Efl.Ui.Popup Panel"), 252 efl_text_set(efl_added, "Efl.Ui.Popup Panel"),
253 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 253 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
254 efl_event_callback_add(panel_win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _panel_win_del, p_data); 254 efl_event_callback_add(panel_win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _panel_win_del, p_data);
@@ -360,7 +360,7 @@ test_ui_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
360{ 360{
361 char buf[PATH_MAX]; 361 char buf[PATH_MAX];
362 362
363 Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 363 Eo *win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
364 efl_text_set(efl_added, "Efl.Ui.Popup.Alert"), 364 efl_text_set(efl_added, "Efl.Ui.Popup.Alert"),
365 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 365 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
366 366
@@ -515,7 +515,7 @@ _alert_scroll_case5_cb(void *data, const Efl_Event *ev EINA_UNUSED)
515void 515void
516test_ui_scroll_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 516test_ui_scroll_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
517{ 517{
518 Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 518 Eo *win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
519 efl_text_set(efl_added, "Efl.Ui.Popup.Alert.Scroll"), 519 efl_text_set(efl_added, "Efl.Ui.Popup.Alert.Scroll"),
520 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 520 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
521 521
@@ -898,7 +898,7 @@ _alert_text_case14_cb(void *data, const Efl_Event *ev EINA_UNUSED)
898void 898void
899test_ui_text_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 899test_ui_text_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
900{ 900{
901 Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 901 Eo *win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
902 efl_text_set(efl_added, "Efl.Ui.Popup.Alert.Text"), 902 efl_text_set(efl_added, "Efl.Ui.Popup.Alert.Text"),
903 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 903 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
904 904
@@ -1008,7 +1008,7 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
1008 1008
1009 char buf[PATH_MAX]; 1009 char buf[PATH_MAX];
1010 1010
1011 Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 1011 Eo *win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
1012 efl_text_set(efl_added, "Efl.Ui.Popup.Anchor"), 1012 efl_text_set(efl_added, "Efl.Ui.Popup.Anchor"),
1013 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 1013 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
1014 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _win_del, p_data); 1014 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _win_del, p_data);
diff --git a/src/bin/elementary/test_ui_progressbar.c b/src/bin/elementary/test_ui_progressbar.c
index c0bf12f..a9ca9a8 100644
--- a/src/bin/elementary/test_ui_progressbar.c
+++ b/src/bin/elementary/test_ui_progressbar.c
@@ -151,7 +151,7 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf
151 151
152 pd = (pbdata *)calloc(1, sizeof(pbdata)); 152 pd = (pbdata *)calloc(1, sizeof(pbdata));
153 153
154 pd->win = win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 154 pd->win = win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
155 efl_text_set(efl_added, "Efl.Ui.Progressbar"), 155 efl_text_set(efl_added, "Efl.Ui.Progressbar"),
156 efl_ui_win_autodel_set(efl_added, EINA_TRUE), 156 efl_ui_win_autodel_set(efl_added, EINA_TRUE),
157 efl_event_callback_add(efl_added, EFL_UI_WIN_EVENT_DELETE_REQUEST, 157 efl_event_callback_add(efl_added, EFL_UI_WIN_EVENT_DELETE_REQUEST,
diff --git a/src/bin/elementary/test_ui_relative_container.c b/src/bin/elementary/test_ui_relative_container.c
index 5ed7a84..1578256 100644
--- a/src/bin/elementary/test_ui_relative_container.c
+++ b/src/bin/elementary/test_ui_relative_container.c
@@ -4,8 +4,8 @@
4 4
5#include <Efl_Ui.h> 5#include <Efl_Ui.h>
6#include <Elementary.h> 6#include <Elementary.h>
7#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h
8#include "test.h" 7#include "test.h"
8
9static Eo *layout, *btn1, *btn2, *btn3; 9static Eo *layout, *btn1, *btn2, *btn3;
10 10
11typedef enum { 11typedef enum {
diff --git a/src/bin/elementary/test_ui_scroller.c b/src/bin/elementary/test_ui_scroller.c
index e5f2a61..29597b0 100644
--- a/src/bin/elementary/test_ui_scroller.c
+++ b/src/bin/elementary/test_ui_scroller.c
@@ -31,7 +31,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
31 Eo *win, *sc, *sc2, *sc3, *bx, *bx2, *gd, *gd2; 31 Eo *win, *sc, *sc2, *sc3, *bx, *bx2, *gd, *gd2;
32 int i, j; 32 int i, j;
33 33
34 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 34 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
35 efl_text_set(efl_added, "Efl Ui Scroller"), 35 efl_text_set(efl_added, "Efl Ui Scroller"),
36 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 36 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
37 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400)); 37 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400));
@@ -135,7 +135,7 @@ test_efl_ui_scroller_simple(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED
135 Eo *win, *sc, *bx; 135 Eo *win, *sc, *bx;
136 int i; 136 int i;
137 137
138 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 138 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
139 efl_text_set(efl_added, "Efl Ui Scroller Simple"), 139 efl_text_set(efl_added, "Efl Ui Scroller Simple"),
140 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 140 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
141 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400)); 141 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400));
@@ -170,7 +170,7 @@ test_efl_ui_scroller_simple2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
170 Eo *win, *sc, *tb; 170 Eo *win, *sc, *tb;
171 int i; 171 int i;
172 172
173 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 173 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
174 efl_text_set(efl_added, "Efl Ui Scroller Simple2"), 174 efl_text_set(efl_added, "Efl Ui Scroller Simple2"),
175 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 175 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
176 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400)); 176 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400));
diff --git a/src/bin/elementary/test_ui_slider.c b/src/bin/elementary/test_ui_slider.c
index 5b901a2..81d4cf1 100644
--- a/src/bin/elementary/test_ui_slider.c
+++ b/src/bin/elementary/test_ui_slider.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Efl_Ui.h> 4#include <Efl_Ui.h>
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h 6
7static void 7static void
8_slider_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev) 8_slider_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
9{ 9{
@@ -52,7 +52,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
52{ 52{
53 Eo *win, *bx, *hbx; 53 Eo *win, *bx, *hbx;
54 54
55 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 55 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
56 efl_text_set(efl_added, "Efl.Ui.Slider"), 56 efl_text_set(efl_added, "Efl.Ui.Slider"),
57 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 57 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
58 58
diff --git a/src/bin/elementary/test_ui_slider_interval.c b/src/bin/elementary/test_ui_slider_interval.c
index de4d983..29dd76b 100644
--- a/src/bin/elementary/test_ui_slider_interval.c
+++ b/src/bin/elementary/test_ui_slider_interval.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Efl_Ui.h> 4#include <Efl_Ui.h>
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h 6
7static double 7static double
8_step_size_calculate(double min, double max) 8_step_size_calculate(double min, double max)
9{ 9{
@@ -33,7 +33,7 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
33 Eo *win, *bx, *hbx; 33 Eo *win, *bx, *hbx;
34 double step; 34 double step;
35 35
36 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 36 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
37 efl_text_set(efl_added, "Efl.Ui.Slider_Interval"), 37 efl_text_set(efl_added, "Efl.Ui.Slider_Interval"),
38 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 38 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
39 39
diff --git a/src/bin/elementary/test_ui_spin.c b/src/bin/elementary/test_ui_spin.c
index 965c88e..ce2208a 100644
--- a/src/bin/elementary/test_ui_spin.c
+++ b/src/bin/elementary/test_ui_spin.c
@@ -39,7 +39,7 @@ test_ui_spin(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
39{ 39{
40 Eo *win, *bx, *sp; 40 Eo *win, *bx, *sp;
41 41
42 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 42 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
43 efl_text_set(efl_added, "Efl.Ui.Spin"), 43 efl_text_set(efl_added, "Efl.Ui.Spin"),
44 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 44 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
45 45
diff --git a/src/bin/elementary/test_ui_spin_button.c b/src/bin/elementary/test_ui_spin_button.c
index 600611e..4adbfb1 100644
--- a/src/bin/elementary/test_ui_spin_button.c
+++ b/src/bin/elementary/test_ui_spin_button.c
@@ -28,7 +28,7 @@ test_ui_spin_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
28 {9, "September"}, {10, "October"}, {11, "November"}, {12, "December"} 28 {9, "September"}, {10, "October"}, {11, "November"}, {12, "December"}
29 }; 29 };
30 30
31 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 31 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
32 efl_text_set(efl_added, "Efl.Ui.Spin_Button"), 32 efl_text_set(efl_added, "Efl.Ui.Spin_Button"),
33 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 33 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
34 34
diff --git a/src/bin/elementary/test_ui_table_static.c b/src/bin/elementary/test_ui_table_static.c
index 7656bbc..8f66aeb 100644
--- a/src/bin/elementary/test_ui_table_static.c
+++ b/src/bin/elementary/test_ui_table_static.c
@@ -103,7 +103,7 @@ test_ui_table_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
103 Eo *win, *table, *bt, *rc, *en; 103 Eo *win, *table, *bt, *rc, *en;
104 api_data *api = calloc(1, sizeof(*api)); 104 api_data *api = calloc(1, sizeof(*api));
105 105
106 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 106 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
107 efl_ui_win_name_set(efl_added, "table"), 107 efl_ui_win_name_set(efl_added, "table"),
108 efl_text_set(efl_added, "Table"), 108 efl_text_set(efl_added, "Table"),
109 efl_ui_win_autodel_set(efl_added, EINA_TRUE), 109 efl_ui_win_autodel_set(efl_added, EINA_TRUE),
diff --git a/src/bin/elementary/test_win_dialog.c b/src/bin/elementary/test_win_dialog.c
index e3b4698..0504669 100644
--- a/src/bin/elementary/test_win_dialog.c
+++ b/src/bin/elementary/test_win_dialog.c
@@ -4,8 +4,6 @@
4#include <Efl_Ui.h> 4#include <Efl_Ui.h>
5#include <Elementary.h> 5#include <Elementary.h>
6 6
7#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h
8
9static void 7static void
10_bt_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 8_bt_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
11{ 9{
@@ -104,7 +102,7 @@ _bt4_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
104{ 102{
105 Efl_Canvas_Object *dia, *lb; 103 Efl_Canvas_Object *dia, *lb;
106 104
107 dia = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 105 dia = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
108 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC), 106 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC),
109 efl_ui_win_name_set(efl_added, "window-dia-4"), 107 efl_ui_win_name_set(efl_added, "window-dia-4"),
110 efl_ui_win_autodel_set(efl_added, EINA_TRUE), 108 efl_ui_win_autodel_set(efl_added, EINA_TRUE),
diff --git a/src/bin/elementary/test_win_indicator.c b/src/bin/elementary/test_win_indicator.c
index 98ba2e2..693c1f9 100644
--- a/src/bin/elementary/test_win_indicator.c
+++ b/src/bin/elementary/test_win_indicator.c
@@ -92,7 +92,7 @@ test_win_indicator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
92 indicator = _create_indicator(); 92 indicator = _create_indicator();
93 93
94 // FIXME: Resizing window should no cause sizing issues! 94 // FIXME: Resizing window should no cause sizing issues!
95 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 95 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
96 efl_text_set(efl_added, "Efl.Win.Indicator"), 96 efl_text_set(efl_added, "Efl.Win.Indicator"),
97 efl_gfx_hint_size_max_set(efl_added, EINA_SIZE2D(300, -1)), 97 efl_gfx_hint_size_max_set(efl_added, EINA_SIZE2D(300, -1)),
98 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 98 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
diff --git a/src/bin/elementary/test_win_stack.c b/src/bin/elementary/test_win_stack.c
index c16c07b..72510d0 100644
--- a/src/bin/elementary/test_win_stack.c
+++ b/src/bin/elementary/test_win_stack.c
@@ -14,18 +14,18 @@ static void _bt_popto(void *data, Evas_Object *obj, void *event_info);
14static void _bt_pressed(void *data, Evas_Object *obj, void *event_info); 14static void _bt_pressed(void *data, Evas_Object *obj, void *event_info);
15 15
16static Evas_Object * 16static Evas_Object *
17_win_new(Evas_Object *stack_top, const char *title) 17_win_new(Evas_Object* parent, Evas_Object *stack_top, const char *title)
18{ 18{
19 Evas_Object *bg, *bx, *bt, *lb, *win; 19 Evas_Object *bg, *bx, *bt, *lb, *win;
20 20
21 if (level >= 3) 21 if (level >= 3)
22 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 22 win = efl_add(EFL_UI_WIN_CLASS, parent,
23 efl_ui_win_name_set(efl_added, "window-stack"), 23 efl_ui_win_name_set(efl_added, "window-stack"),
24 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_NAVIFRAME_BASIC), 24 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_NAVIFRAME_BASIC),
25 efl_text_set(efl_added, title), 25 efl_text_set(efl_added, title),
26 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 26 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
27 else 27 else
28 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 28 win = efl_add(EFL_UI_WIN_CLASS, parent,
29 efl_ui_win_name_set(efl_added, "window-stack"), 29 efl_ui_win_name_set(efl_added, "window-stack"),
30 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC), 30 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_DIALOG_BASIC),
31 efl_text_set(efl_added, title), 31 efl_text_set(efl_added, title),
@@ -63,7 +63,7 @@ _win_new(Evas_Object *stack_top, const char *title)
63 63
64 bt = elm_button_add(win); 64 bt = elm_button_add(win);
65 elm_object_text_set(bt, "Push"); 65 elm_object_text_set(bt, "Push");
66 evas_object_smart_callback_add(bt, "clicked", _bt_pressed, stack_top); 66 evas_object_smart_callback_add(bt, "clicked", _bt_pressed, parent);
67 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 67 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
68 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 68 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
69 elm_box_pack_end(bx, bt); 69 elm_box_pack_end(bx, bt);
@@ -82,12 +82,12 @@ _bt_popto(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info
82static void 82static void
83_bt_pressed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 83_bt_pressed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
84{ 84{
85 Evas_Object *win; 85 Evas_Object *win = (Evas_Object*) data;
86 char buf[100]; 86 char buf[100];
87 87
88 level++; 88 level++;
89 snprintf(buf, sizeof(buf), "Level %i", level); 89 snprintf(buf, sizeof(buf), "Level %i", level);
90 win = _win_new(data, buf); 90 win = _win_new(win, obj, buf);
91 efl_ui_win_stack_master_id_set(win, efl_ui_win_stack_id_get(data)); 91 efl_ui_win_stack_master_id_set(win, efl_ui_win_stack_id_get(data));
92} 92}
93 93
diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh
index 07c365f..8d8de9d 100644
--- a/src/bin/eolian_mono/eolian/mono/blacklist.hh
+++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh
@@ -150,9 +150,9 @@ inline bool is_alias_blacklisted(attributes::alias_def const& alias, Context con
150 return name_helpers::alias_full_eolian_name(alias) == "Eina.Error"; 150 return name_helpers::alias_full_eolian_name(alias) == "Eina.Error";
151} 151}
152 152
153inline bool is_property_blacklisted(std::string const& name) 153inline bool is_property_blacklisted(std::string const&)
154{ 154{
155 return name == "Efl.IText.Text"; 155 return false;
156} 156}
157 157
158template<typename Context> 158template<typename Context>
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index 0a2179b..d009e45 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -42,18 +42,15 @@ struct documentation_generator
42 : scope_size(scope_size) {} 42 : scope_size(scope_size) {}
43 43
44 44
45 // Returns the number of parameters (values + keys) that a property method requires 45 // Returns the number of keys that a property method requires
46 // Specify if you want the Setter or the Getter method. 46 // Specify if you want the Setter or the Getter method.
47 static int property_num_parameters(const ::Eolian_Function *function, ::Eolian_Function_Type ftype) 47 static int property_num_keys(const ::Eolian_Function *function, ::Eolian_Function_Type ftype)
48 { 48 {
49 Eina_Iterator *itr = ::eolian_property_keys_get(function, ftype); 49 Eina_Iterator *itr = ::eolian_property_keys_get(function, ftype);
50 Eolian_Function_Parameter *pr; 50 Eolian_Function_Parameter *pr;
51 int n = 0; 51 int n = 0;
52 EINA_ITERATOR_FOREACH(itr, pr) { n++; } 52 EINA_ITERATOR_FOREACH(itr, pr) { n++; }
53 eina_iterator_free(itr); 53 eina_iterator_free(itr);
54 itr = ::eolian_property_values_get(function, ftype);
55 EINA_ITERATOR_FOREACH(itr, pr) { n++; }
56 eina_iterator_free(itr);
57 return n; 54 return n;
58 } 55 }
59 56
@@ -125,14 +122,13 @@ struct documentation_generator
125 break; 122 break;
126 case ::EOLIAN_PROPERTY: 123 case ::EOLIAN_PROPERTY:
127 { 124 {
128 int getter_params = property_num_parameters(function, ::EOLIAN_PROP_GET); 125 int getter_nkeys = property_num_keys(function, ::EOLIAN_PROP_GET);
129 int setter_params = property_num_parameters(function, ::EOLIAN_PROP_SET); 126 int setter_nkeys = property_num_keys(function, ::EOLIAN_PROP_SET);
130 std::string short_name = name_helpers::property_managed_name(klass_d, eo_name); 127 std::string short_name = name_helpers::property_managed_name(klass_d, eo_name);
131 bool blacklisted = blacklist::is_property_blacklisted(name + "." + short_name); 128 bool blacklisted = blacklist::is_property_blacklisted(name + "." + short_name);
132 // EO properties with keys, with more than one value, or blacklisted, are not 129 // EO properties with keys or blacklisted are not converted into C# properties.
133 // converted into C# properties.
134 // In these cases we refer to the getter method instead of the property. 130 // In these cases we refer to the getter method instead of the property.
135 if ((getter_params > 1) || (setter_params > 1) || (blacklisted)) name += ".Get" + short_name; 131 if ((getter_nkeys > 0) || (setter_nkeys > 0) || (blacklisted)) name += ".Get" + short_name;
136 else if (name_tail == ".get") name += ".Get" + short_name; 132 else if (name_tail == ".get") name += ".Get" + short_name;
137 else if (name_tail == ".set") name += ".Set" + short_name; 133 else if (name_tail == ".set") name += ".Set" + short_name;
138 else name += "." + short_name; 134 else name += "." + short_name;
@@ -234,68 +230,84 @@ struct documentation_generator
234 static std::string syntax_conversion(std::string text, const Eolian_State *state, bool want_beta) 230 static std::string syntax_conversion(std::string text, const Eolian_State *state, bool want_beta)
235 { 231 {
236 std::string new_text, ref; 232 std::string new_text, ref;
237 ::Eolian_Doc_Token token;
238 const char *text_ptr = text.c_str();
239 ::eolian_doc_token_init(&token);
240 ::Eolian_Doc_Token_Type previous_token_type = ::EOLIAN_DOC_TOKEN_UNKNOWN; 233 ::Eolian_Doc_Token_Type previous_token_type = ::EOLIAN_DOC_TOKEN_UNKNOWN;
241 while ((text_ptr = ::eolian_documentation_tokenize(text_ptr, &token)) != NULL) 234 ::Eina_List *paragraphs = ::eolian_documentation_string_split(text.c_str());
235 if (!paragraphs) return new_text;
236 ::Eina_List *data = paragraphs;
237 // For every paragraph
238 do
242 { 239 {
243 std::string token_text, name_tail; 240 char *par = (char *)::eina_list_data_get(data);
244 char *token_text_cstr = ::eolian_doc_token_text_get(&token); 241 const char *text_ptr = par;
245 if (token_text_cstr) 242 ::Eolian_Doc_Token token;
243 ::eolian_doc_token_init(&token);
244 // For every token inside the paragraph
245 while ((text_ptr = ::eolian_documentation_tokenize(text_ptr, &token)) != NULL)
246 { 246 {
247 token_text = token_text_cstr; 247 std::string token_text, name_tail;
248 free(token_text_cstr); 248 char *token_text_cstr = ::eolian_doc_token_text_get(&token);
249 if (token_text.length() > 4) 249 if (token_text_cstr)
250 name_tail = token_text.substr(token_text.length() - 4, 4);
251 }
252 ::Eolian_Doc_Token_Type token_type = ::eolian_doc_token_type_get(&token);
253 switch(token_type)
254 {
255 case ::EOLIAN_DOC_TOKEN_TEXT:
256 // If previous token was a reference and this text token starts with
257 // parentheses, remove them, since the reference will be rendered
258 // with the parentheses already.
259 if ((previous_token_type == ::EOLIAN_DOC_TOKEN_REF) &&
260 (token_text.substr(0, 2) == "()"))
261 token_text = token_text.substr(2, token_text.length() - 2);
262 new_text += token_text;
263 break;
264 case ::EOLIAN_DOC_TOKEN_REF:
265 ref = ref_conversion(&token, state, name_tail, want_beta);
266 if (ref != "")
267 { 250 {
268 if (utils::ends_with(ref, BETA_REF_SUFFIX)) 251 token_text = token_text_cstr;
269 new_text += "<span class=\"text-muted\">" + ref + "</span>"; 252 free(token_text_cstr);
270 else 253 if (token_text.length() > 4)
271 new_text += "<see cref=\"" + ref + "\"/>"; 254 name_tail = token_text.substr(token_text.length() - 4, 4);
272 } 255 }
273 else 256 ::Eolian_Doc_Token_Type token_type = ::eolian_doc_token_type_get(&token);
274 // Unresolved references are passed through. 257 switch(token_type)
275 // They will appear in the docs as plain text, without link, 258 {
276 // but at least they won't be removed by DocFX. 259 case ::EOLIAN_DOC_TOKEN_TEXT:
277 new_text += token_text; 260 // If previous token was a reference and this text token starts with
278 break; 261 // parentheses, remove them, since the reference will be rendered
279 case ::EOLIAN_DOC_TOKEN_MARK_NOTE: 262 // with the parentheses already.
280 new_text += "NOTE: " + token_text; 263 if ((previous_token_type == ::EOLIAN_DOC_TOKEN_REF) &&
281 break; 264 (token_text.substr(0, 2) == "()"))
282 case ::EOLIAN_DOC_TOKEN_MARK_WARNING: 265 token_text = token_text.substr(2, token_text.length() - 2);
283 new_text += "WARNING: " + token_text; 266 new_text += token_text;
284 break; 267 break;
285 case ::EOLIAN_DOC_TOKEN_MARK_REMARK: 268 case ::EOLIAN_DOC_TOKEN_REF:
286 new_text += "REMARK: " + token_text; 269 ref = ref_conversion(&token, state, name_tail, want_beta);
287 break; 270 if (ref != "")
288 case ::EOLIAN_DOC_TOKEN_MARK_TODO: 271 {
289 new_text += "TODO: " + token_text; 272 if (utils::ends_with(ref, BETA_REF_SUFFIX))
290 break; 273 new_text += "<span class=\"text-muted\">" + ref + "</span>";
291 case ::EOLIAN_DOC_TOKEN_MARKUP_MONOSPACE: 274 else
292 new_text += "<c>" + token_text + "</c>"; 275 new_text += "<see cref=\"" + ref + "\"/>";
293 break; 276 }
294 default: 277 else
295 break; 278 // Unresolved references are passed through.
296 } 279 // They will appear in the docs as plain text, without link,
297 previous_token_type = token_type; 280 // but at least they won't be removed by DocFX.
298 } 281 new_text += token_text;
282 break;
283 case ::EOLIAN_DOC_TOKEN_MARK_NOTE:
284 new_text += "<b>NOTE: </b>";
285 break;
286 case ::EOLIAN_DOC_TOKEN_MARK_WARNING:
287 new_text += "<b>WARNING: </b>";
288 break;
289 case ::EOLIAN_DOC_TOKEN_MARK_REMARK:
290 new_text += "<b>REMARK: </b>";
291 break;
292 case ::EOLIAN_DOC_TOKEN_MARK_TODO:
293 new_text += "<b>TODO: </b>";
294 break;
295 case ::EOLIAN_DOC_TOKEN_MARKUP_MONOSPACE:
296 new_text += "<c>" + token_text + "</c>";
297 break;
298 default:
299 break;
300 }
301 previous_token_type = token_type;
302 }
303 // Free this paragraph
304 free(par);
305 // Fetch the next paragraph
306 data = ::eina_list_next(data);
307 // If there's another paragraph afterwards, separate them with a blank line
308 if (data) new_text += "\n\n";
309 } while (data);
310 ::eina_list_free(paragraphs);
299 return new_text; 311 return new_text;
300 } 312 }
301 313
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index deb9a9e..d27889f 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -747,7 +747,7 @@ struct convert_in_variable_generator
747 ) 747 )
748 return true; 748 return true;
749 749
750 if (!complex->subtypes.front().is_value_type && complex->subtypes.front().has_own 750 if ((param.type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own))
751 && !as_generator( 751 && !as_generator(
752 escape_keyword(param.param_name) << ".OwnContent = false;\n" 752 escape_keyword(param.param_name) << ".OwnContent = false;\n"
753 ).generate(sink, attributes::unused, context)) 753 ).generate(sink, attributes::unused, context))
@@ -987,7 +987,7 @@ struct convert_out_assign_generator
987 return as_generator( 987 return as_generator(
988 string << " = new " << type << "(" << string 988 string << " = new " << type << "(" << string
989 << ", " << (param.type.has_own ? "true" : "false") 989 << ", " << (param.type.has_own ? "true" : "false")
990 << ", " << (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own ? "true" : "false") 990 << ", " << (param.type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own) ? "true" : "false")
991 << ");\n" 991 << ");\n"
992 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context); 992 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context);
993 } 993 }
@@ -1116,7 +1116,7 @@ struct convert_return_generator
1116 if (!complex) 1116 if (!complex)
1117 return false; 1117 return false;
1118 if (!as_generator("return new " << type << "(_ret_var, " << std::string{ret_type.has_own ? "true" : "false"} 1118 if (!as_generator("return new " << type << "(_ret_var, " << std::string{ret_type.has_own ? "true" : "false"}
1119 << ", " << (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own ? "true" : "false") 1119 << ", " << (ret_type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own) ? "true" : "false")
1120 << ");\n") 1120 << ");\n")
1121 .generate(sink, ret_type, context)) 1121 .generate(sink, ret_type, context))
1122 return false; 1122 return false;
@@ -1268,9 +1268,9 @@ struct native_convert_out_assign_generator
1268 ) 1268 )
1269 return true; 1269 return true;
1270 1270
1271 if (!complex->subtypes.front().is_value_type && complex->subtypes.front().has_own 1271 if ((param.type.has_own && (complex->subtypes.front().is_value_type && complex->subtypes.front().has_own))
1272 && !as_generator( 1272 && !as_generator(
1273 string << ".OwnContent = false;\n" 1273 string << ".OwnContent = false;\n"
1274 ).generate(sink, outvar, context)) 1274 ).generate(sink, outvar, context))
1275 return false; 1275 return false;
1276 } 1276 }
@@ -1395,7 +1395,7 @@ struct native_convert_return_generator
1395 && ret_type.c_type != "Eina_Accessor *" && ret_type.c_type != "const Eina_Accessor *" 1395 && ret_type.c_type != "Eina_Accessor *" && ret_type.c_type != "const Eina_Accessor *"
1396 ) 1396 )
1397 { 1397 {
1398 if (!complex->subtypes.front().is_value_type && complex->subtypes.front().has_own 1398 if ((ret_type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own))
1399 && !as_generator("_ret_var.OwnContent = false; ") 1399 && !as_generator("_ret_var.OwnContent = false; ")
1400 .generate(sink, attributes::unused, context)) 1400 .generate(sink, attributes::unused, context))
1401 return false; 1401 return false;
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index d83e91b..403778f 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -403,6 +403,121 @@ struct struct_internal_definition_generator
403 403
404struct struct_definition_generator 404struct struct_definition_generator
405{ 405{
406 /**
407 * Generates an implicit operator for packing only if the struct has more
408 * than one attribute. Then operator will receive a tuple with the same of
409 * each attribute's type in the same order they were declared.
410 *
411 * Remarks: due to the MCS compiler's limitations, no operator is generated
412 * for structs with more than 4 fields.
413 */
414 template <typename OutputIterator, typename Context>
415 bool generate_implicit_operator(attributes::struct_def const& struct_
416 , OutputIterator sink
417 , Context const& context) const
418 {
419 if (struct_.fields.size() <= 1 || struct_.fields.size() > 4)
420 return true;
421
422 auto struct_name = binding_struct_name(struct_);
423 auto const& indent = current_indentation(context);
424
425 if (!as_generator(
426 indent << scope_tab << "/// <summary>Packs tuple into " << struct_name << " object.\n"
427 << indent << scope_tab << "///<para>Since EFL 1.24.</para>\n"
428 << indent << scope_tab << "///</summary>\n"
429 ).generate(sink, attributes::unused, context))
430 return false;
431
432 if (!as_generator(
433 indent << scope_tab << "public static implicit operator " << struct_name << "(\n"
434 << indent << scope_tab << scope_tab << "(\n"
435 << ((indent << scope_tab << scope_tab << " " << field_argument_decl) % ",\n") << "\n"
436 << indent << scope_tab << scope_tab << ") tuple)\n"
437 << indent << scope_tab << "{\n"
438 ).generate(sink, struct_.fields, context))
439 return false;
440
441 // object constructor
442 if (!as_generator(
443 indent << scope_tab << scope_tab << "return new " << struct_name << "{\n"
444 ).generate(sink, attributes::unused, context))
445 return false;
446
447 for (const auto& field: struct_.fields)
448 {
449 auto field_name = name_helpers::to_field_name(field.name);
450
451 if (!as_generator(
452 indent << scope_tab << scope_tab << scope_tab << field_name << " = tuple." << field_name << ",\n"
453 ).generate(sink, attributes::unused, context))
454 return false;
455 }
456
457 if (!as_generator(
458 indent << scope_tab << scope_tab << "};\n"
459 << indent << scope_tab << "}\n"
460 ).generate(sink, attributes::unused, context))
461 return false;
462
463 return true;
464 }
465
466 template <typename OutputIterator, typename Context>
467 bool generate_deconstruct_method(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
468 {
469 auto const& indent = current_indentation(context);
470 auto struct_name = binding_struct_name(struct_);
471
472 if (!as_generator(
473 indent << scope_tab << "/// <summary>Unpacks " << struct_name << " into tuple.\n"
474 << indent << scope_tab << "/// <para>Since EFL 1.24.</para>\n"
475 << indent << scope_tab << "/// </summary>\n"
476 << indent << scope_tab << "public void Deconstruct(\n"
477 ).generate(sink, attributes::unused, context))
478 return false;
479
480 // parameters
481 {
482 auto i = 0u;
483 for (auto const& field : struct_.fields)
484 {
485 auto field_name = name_helpers::to_field_name(field.name);
486
487 auto suffix = i == struct_.fields.size() - 1 ? "\n" : ",\n";
488
489 if (!as_generator(
490 indent << scope_tab << scope_tab << "out " << type << " " << field_name << suffix
491 ).generate(sink, std::make_tuple(field.type), context))
492 return false;
493
494 ++i;
495 }
496 }
497
498 if (!as_generator(
499 indent << scope_tab << ")\n"
500 << indent << scope_tab << "{\n"
501 ).generate(sink, attributes::unused, context))
502 return false;
503
504 // assigments
505 for (auto const& field : struct_.fields)
506 {
507 auto field_name = name_helpers::to_field_name(field.name);
508
509 if (!as_generator(
510 indent << scope_tab << scope_tab << field_name << " = this." << field_name << ";\n"
511 ).generate(sink, attributes::unused, context))
512 return false;
513 }
514
515 // the end
516 return as_generator(
517 indent << scope_tab << "}\n"
518 ).generate(sink, attributes::unused, context);
519 }
520
406 template <typename OutputIterator, typename Context> 521 template <typename OutputIterator, typename Context>
407 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const 522 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
408 { 523 {
@@ -473,7 +588,13 @@ struct struct_definition_generator
473 << *(indent << scope_tab << scope_tab << field_argument_assignment << ";\n") 588 << *(indent << scope_tab << scope_tab << field_argument_assignment << ";\n")
474 << indent << scope_tab << "}\n\n") 589 << indent << scope_tab << "}\n\n")
475 .generate(sink, std::make_tuple(struct_.fields, struct_name, struct_.fields, struct_.fields), context)) 590 .generate(sink, std::make_tuple(struct_.fields, struct_name, struct_.fields, struct_.fields), context))
476 return false; 591 return false;
592
593 if (!generate_implicit_operator(struct_, sink, context))
594 return false;
595
596 if (!generate_deconstruct_method(sink, struct_, context))
597 return false;
477 } 598 }
478 599
479 std::string since_line; 600 std::string since_line;
@@ -546,9 +667,9 @@ struct struct_definition_generator
546 ).generate(sink, attributes::unused, context)) 667 ).generate(sink, attributes::unused, context))
547 return false; 668 return false;
548 } 669 }
549 670
550 671
551 if (!as_generator( 672 if (!as_generator(
552 indent << scope_tab << scope_tab << ";\n" 673 indent << scope_tab << scope_tab << ";\n"
553 << indent << scope_tab << "}\n" 674 << indent << scope_tab << "}\n"
554 ).generate(sink, attributes::unused, context)) 675 ).generate(sink, attributes::unused, context))
diff --git a/src/bin/eolian_mono/eolian/mono/struct_fields.hh b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
index b8bb0a2..76e0f64 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_fields.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
@@ -28,6 +28,30 @@
28 28
29namespace eolian_mono { 29namespace eolian_mono {
30 30
31struct field_argument_name_generator
32{
33 template<typename OutputIterator, typename Context>
34 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
35 {
36 if (!as_generator(name_helpers::to_field_name(field.name))
37 .generate(sink, attributes::unused, context))
38 return false;
39 return true;
40 }
41} const field_argument_name {};
42
43struct field_argument_decl_generator
44{
45 template<typename OutputIterator, typename Context>
46 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
47 {
48 if (!as_generator(type << " " << string)
49 .generate(sink, std::make_tuple(field.type, name_helpers::to_field_name(field.name)), context))
50 return false;
51 return true;
52 }
53} const field_argument_decl {};
54
31struct field_argument_default_generator 55struct field_argument_default_generator
32{ 56{
33 template<typename OutputIterator, typename Context> 57 template<typename OutputIterator, typename Context>
@@ -70,6 +94,16 @@ struct field_argument_docs_generator
70namespace efl { namespace eolian { namespace grammar { 94namespace efl { namespace eolian { namespace grammar {
71 95
72template<> 96template<>
97struct is_eager_generator< ::eolian_mono::field_argument_name_generator> : std::true_type {};
98template<>
99struct is_generator< ::eolian_mono::field_argument_name_generator> : std::true_type {};
100
101template<>
102struct is_eager_generator< ::eolian_mono::field_argument_decl_generator> : std::true_type {};
103template<>
104struct is_generator< ::eolian_mono::field_argument_decl_generator> : std::true_type {};
105
106template<>
73struct is_eager_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {}; 107struct is_eager_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {};
74template<> 108template<>
75struct is_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {}; 109struct is_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {};
@@ -87,6 +121,12 @@ struct is_generator< ::eolian_mono::field_argument_docs_generator> : std::true_t
87namespace type_traits { 121namespace type_traits {
88 122
89template <> 123template <>
124struct attributes_needed< ::eolian_mono::field_argument_name_generator> : std::integral_constant<int, 1> {};
125
126template <>
127struct attributes_needed< ::eolian_mono::field_argument_decl_generator> : std::integral_constant<int, 1> {};
128
129template <>
90struct attributes_needed< ::eolian_mono::field_argument_default_generator> : std::integral_constant<int, 1> {}; 130struct attributes_needed< ::eolian_mono::field_argument_default_generator> : std::integral_constant<int, 1> {};
91 131
92template <> 132template <>
diff --git a/src/bindings/mono/eina_mono/eina_list.cs b/src/bindings/mono/eina_mono/eina_list.cs
index 70f2d91..d14dd26 100644
--- a/src/bindings/mono/eina_mono/eina_list.cs
+++ b/src/bindings/mono/eina_mono/eina_list.cs
@@ -124,19 +124,22 @@ public static class ListNativeFunctions
124/// <summary>Native wrapper around a linked list of items. 124/// <summary>Native wrapper around a linked list of items.
125/// <para>Since EFL 1.23.</para> 125/// <para>Since EFL 1.23.</para>
126/// </summary> 126/// </summary>
127public class List<T> : IEnumerable<T>, IDisposable 127public class List<T> : IList<T>, IEnumerable<T>, IDisposable
128{ 128{
129 129
130 [EditorBrowsable(EditorBrowsableState.Never)] 130 [EditorBrowsable(EditorBrowsableState.Never)]
131 public IntPtr Handle {get;set;} = IntPtr.Zero; 131 public IntPtr Handle {get; set; } = IntPtr.Zero;
132
132 /// <summary>Whether this managed list owns the native one. 133 /// <summary>Whether this managed list owns the native one.
133 /// <para>Since EFL 1.23.</para> 134 /// <para>Since EFL 1.23.</para>
134 /// </summary> 135 /// </summary>
135 public bool Own {get;set;} 136 internal bool Own { get; set; }
137
136 /// <summary>Whether the native list wrapped owns the content it points to. 138 /// <summary>Whether the native list wrapped owns the content it points to.
137 /// <para>Since EFL 1.23.</para> 139 /// <para>Since EFL 1.23.</para>
138 ///</summary> 140 ///</summary>
139 public bool OwnContent {get;set;} 141 internal bool OwnContent { get; set; }
142
140 143
141 /// <summary>Delegate for comparing two elements of this list. 144 /// <summary>Delegate for comparing two elements of this list.
142 /// <para>Since EFL 1.23.</para> 145 /// <para>Since EFL 1.23.</para>
@@ -146,15 +149,16 @@ public class List<T> : IEnumerable<T>, IDisposable
146 /// <returns>-1, 0 or 1 for respectively smaller, equal or larger.</returns> 149 /// <returns>-1, 0 or 1 for respectively smaller, equal or larger.</returns>
147 public delegate int Compare(T a, T b); 150 public delegate int Compare(T a, T b);
148 151
149 /// <summary>The number of elements on this list. 152 public bool IsReadOnly { get => !OwnContent; }
150 /// <para>Since EFL 1.23.</para> 153
154 /// <summary>The number of elements in this list.
155 /// <para>Since EFL 1.24.</para>
151 /// </summary> 156 /// </summary>
152 public int Length 157 public int Count
153 { 158 {
154 get { return Count(); } 159 get => (int)eina_list_count_custom_export_mono(Handle);
155 } 160 }
156 161
157
158 private void InitNew() 162 private void InitNew()
159 { 163 {
160 Handle = IntPtr.Zero; 164 Handle = IntPtr.Zero;
@@ -163,38 +167,85 @@ public class List<T> : IEnumerable<T>, IDisposable
163 } 167 }
164 168
165 private IntPtr InternalLast() 169 private IntPtr InternalLast()
166 { 170 => eina_list_last_custom_export_mono(Handle);
167 return eina_list_last_custom_export_mono(Handle);
168 }
169 171
170 private static IntPtr InternalNext(IntPtr list) 172 private static IntPtr InternalNext(IntPtr list)
173 => eina_list_next_custom_export_mono(list);
174
175 private static IntPtr InternalPrev(IntPtr list)
176 => eina_list_prev_custom_export_mono(list);
177
178 private static IntPtr InternalDataGet(IntPtr list)
179 => eina_list_data_get_custom_export_mono(list);
180
181 private static IntPtr InternalDataSet(IntPtr list, IntPtr data)
182 => eina_list_data_set_custom_export_mono(list, data);
183
184 private IntPtr GetNative(int idx, Func<IntPtr, uint, IntPtr> f)
171 { 185 {
172 return eina_list_next_custom_export_mono(list); 186 if (!(0 <= idx && idx < Count))
187 {
188 throw new ArgumentOutOfRangeException();
189 }
190
191 var ele = f(Handle, (uint)idx);
192 if (ele == IntPtr.Zero)
193 {
194 throw new ArgumentOutOfRangeException();
195 }
196
197 return ele;
173 } 198 }
174 199
175 private static IntPtr InternalPrev(IntPtr list) 200 private IntPtr GetNativeDataPointer(int idx)
201 => GetNative(idx, eina_list_nth);
202
203 private IntPtr GetNativePointer(int idx)
204 => GetNative(idx, eina_list_nth_list);
205
206 private void RequireWritable()
176 { 207 {
177 return eina_list_prev_custom_export_mono(list); 208 if (IsReadOnly)
209 {
210 throw new NotSupportedException("Cannot modify read-only container.");
211 }
178 } 212 }
179 213
180 private static IntPtr InternalDataGet(IntPtr list) 214 private void CheckOwnerships()
181 { 215 {
182 return eina_list_data_get_custom_export_mono(list); 216 if ((Own == false) && (OwnContent == true))
217 {
218 throw new InvalidOperationException(nameof(Own) + "/" + nameof(OwnContent));
219 }
183 } 220 }
184 221
185 private static IntPtr InternalDataSet(IntPtr list, IntPtr data) 222 private void DeleteData(IntPtr ele)
186 { 223 {
187 return eina_list_data_set_custom_export_mono(list, data); 224 if (OwnContent)
225 {
226 NativeFree<T>(InternalDataGet(ele));
227 }
188 } 228 }
189 229
230 private U LoopingThrough<U>(T val, Func<int, U> f1, Func<U> f2)
231 {
232 int i = 0;
233 IntPtr cur = Handle;
234 for (; cur != IntPtr.Zero; ++i, cur = InternalNext(cur))
235 {
236 if (NativeToManaged<T>(InternalDataGet(cur)).Equals(val))
237 {
238 return f1(i);
239 }
240 }
241
242 return f2();
243 }
190 244
191 /// <summary>Creates a new empty list. 245 /// <summary>Creates a new empty list.
192 /// <para>Since EFL 1.23.</para> 246 /// <para>Since EFL 1.23.</para>
193 /// </summary> 247 /// </summary>
194 public List() 248 public List() => InitNew();
195 {
196 InitNew();
197 }
198 249
199 /// <summary>Creates a new list wrapping the given handle.</summary> 250 /// <summary>Creates a new list wrapping the given handle.</summary>
200 [EditorBrowsable(EditorBrowsableState.Never)] 251 [EditorBrowsable(EditorBrowsableState.Never)]
@@ -203,6 +254,7 @@ public class List<T> : IEnumerable<T>, IDisposable
203 Handle = handle; 254 Handle = handle;
204 Own = own; 255 Own = own;
205 OwnContent = own; 256 OwnContent = own;
257 CheckOwnerships();
206 } 258 }
207 259
208 /// <summary>Creates a new list wrapping the given handle.</summary> 260 /// <summary>Creates a new list wrapping the given handle.</summary>
@@ -212,15 +264,13 @@ public class List<T> : IEnumerable<T>, IDisposable
212 Handle = handle; 264 Handle = handle;
213 Own = own; 265 Own = own;
214 OwnContent = ownContent; 266 OwnContent = ownContent;
267 CheckOwnerships();
215 } 268 }
216 269
217 /// <summary>Finalizes this list. 270 /// <summary>Finalizes this list.
218 /// <para>Since EFL 1.23.</para> 271 /// <para>Since EFL 1.23.</para>
219 /// </summary> 272 /// </summary>
220 ~List() 273 ~List() => Dispose(false);
221 {
222 Dispose(false);
223 }
224 274
225 /// <summary>Disposes of this list. 275 /// <summary>Disposes of this list.
226 /// <para>Since EFL 1.23.</para> 276 /// <para>Since EFL 1.23.</para>
@@ -236,12 +286,14 @@ public class List<T> : IEnumerable<T>, IDisposable
236 return; 286 return;
237 } 287 }
238 288
239 if (Own && OwnContent) 289 for (IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr))
240 { 290 {
241 for (IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr)) 291 if (!OwnContent)
242 { 292 {
243 NativeFree<T>(InternalDataGet(curr)); 293 break;
244 } 294 }
295
296 DeleteData(curr);
245 } 297 }
246 298
247 if (Own) 299 if (Own)
@@ -269,30 +321,17 @@ public class List<T> : IEnumerable<T>, IDisposable
269 /// <summary>Disposes of this list. 321 /// <summary>Disposes of this list.
270 /// <para>Since EFL 1.23.</para> 322 /// <para>Since EFL 1.23.</para>
271 /// </summary> 323 /// </summary>
272 public void Free() 324 public void Free() => Dispose();
273 {
274 Dispose();
275 }
276
277 /// <summary>Relinquishes of the native list.
278 /// <para>Since EFL 1.23.</para>
279 /// </summary>
280 /// <returns>The previously wrapped native list handle.</returns>
281 public IntPtr Release()
282 {
283 IntPtr h = Handle;
284 Handle = IntPtr.Zero;
285 return h;
286 }
287 325
288 /// <summary>Sets whether this wrapper should own the native list or not. 326 /// <summary>Sets whether this wrapper should own the native list or not.
289 /// <para>Since EFL 1.23.</para> 327 /// <para>Since EFL 1.23.</para>
290 /// </summary> 328 /// </summary>
291 /// <param name="ownAll">If the hash own for all ownerships.</param> 329 /// <param name="ownAll">If the hash own for all ownerships.</param>
292 public void SetOwnership(bool ownAll) 330 internal void SetOwnership(bool ownAll)
293 { 331 {
294 Own = ownAll; 332 Own = ownAll;
295 OwnContent = ownAll; 333 OwnContent = ownAll;
334 CheckOwnerships();
296 } 335 }
297 336
298 /// <summary>Sets whether this wrapper should own the native list and 337 /// <summary>Sets whether this wrapper should own the native list and
@@ -301,19 +340,11 @@ public class List<T> : IEnumerable<T>, IDisposable
301 /// </summary> 340 /// </summary>
302 /// <param name="own">If own the object.</param> 341 /// <param name="own">If own the object.</param>
303 /// <param name="ownContent">If own the content's object.</param> 342 /// <param name="ownContent">If own the content's object.</param>
304 public void SetOwnership(bool own, bool ownContent) 343 internal void SetOwnership(bool own, bool ownContent)
305 { 344 {
306 Own = own; 345 Own = own;
307 OwnContent = ownContent; 346 OwnContent = ownContent;
308 } 347 CheckOwnerships();
309
310 /// <summary>Returns the number of elements in this list.
311 /// <para>Since EFL 1.23.</para>
312 /// </summary>
313 /// <returns>The number of elements.</returns>
314 public int Count()
315 {
316 return (int)eina_list_count_custom_export_mono(Handle);
317 } 348 }
318 349
319 /// <summary>Appends <c>val</c> to the list. 350 /// <summary>Appends <c>val</c> to the list.
@@ -322,8 +353,9 @@ public class List<T> : IEnumerable<T>, IDisposable
322 /// <param name="val">The item to be appended.</param> 353 /// <param name="val">The item to be appended.</param>
323 public void Append(T val) 354 public void Append(T val)
324 { 355 {
325 IntPtr ele = ManagedToNativeAlloc(val); 356 RequireWritable();
326 Handle = eina_list_append(Handle, ele); 357
358 Handle = eina_list_append(Handle, ManagedToNativeAlloc(val));
327 } 359 }
328 360
329 /// <summary>Prepends <c>val</c> to the list. 361 /// <summary>Prepends <c>val</c> to the list.
@@ -332,8 +364,9 @@ public class List<T> : IEnumerable<T>, IDisposable
332 /// <param name="val">The item to be prepended.</param> 364 /// <param name="val">The item to be prepended.</param>
333 public void Prepend(T val) 365 public void Prepend(T val)
334 { 366 {
335 IntPtr ele = ManagedToNativeAlloc(val); 367 RequireWritable();
336 Handle = eina_list_prepend(Handle, ele); 368
369 Handle = eina_list_prepend(Handle, ManagedToNativeAlloc(val));
337 } 370 }
338 371
339 /// <summary>Inserts <c>val</c> in the list in a sorted manner. 372 /// <summary>Inserts <c>val</c> in the list in a sorted manner.
@@ -343,8 +376,11 @@ public class List<T> : IEnumerable<T>, IDisposable
343 /// <param name="val">The item to be inserted.</param> 376 /// <param name="val">The item to be inserted.</param>
344 public void SortedInsert(T val) 377 public void SortedInsert(T val)
345 { 378 {
346 IntPtr ele = ManagedToNativeAlloc(val); 379 RequireWritable();
347 Handle = eina_list_sorted_insert(Handle, EinaCompareCb<T>(), ele); 380
381 Handle = eina_list_sorted_insert(Handle,
382 EinaCompareCb<T>(),
383 ManagedToNativeAlloc(val));
348 } 384 }
349 385
350 /// <summary>Inserts <c>val</c> in the list in a sorted manner with the 386 /// <summary>Inserts <c>val</c> in the list in a sorted manner with the
@@ -356,8 +392,11 @@ public class List<T> : IEnumerable<T>, IDisposable
356 /// <param name="val">The item to be inserted.</param> 392 /// <param name="val">The item to be inserted.</param>
357 public void SortedInsert(Compare compareCb, T val) 393 public void SortedInsert(Compare compareCb, T val)
358 { 394 {
359 IntPtr ele = ManagedToNativeAlloc(val); 395 RequireWritable();
360 Handle = eina_list_sorted_insert(Handle, Marshal.GetFunctionPointerForDelegate(GetNativeCompareCb(compareCb)), ele); 396
397 Handle = eina_list_sorted_insert(Handle,
398 Marshal.GetFunctionPointerForDelegate(GetNativeCompareCb(compareCb)),
399 ManagedToNativeAlloc(val));
361 } 400 }
362 401
363 /// <summary>Sorts <c>limit</c> elements in this list inplace. 402 /// <summary>Sorts <c>limit</c> elements in this list inplace.
@@ -366,6 +405,8 @@ public class List<T> : IEnumerable<T>, IDisposable
366 /// <param name="limit">The max number of elements to be sorted.</param> 405 /// <param name="limit">The max number of elements to be sorted.</param>
367 public void Sort(int limit = 0) 406 public void Sort(int limit = 0)
368 { 407 {
408 RequireWritable();
409
369 Handle = eina_list_sort(Handle, (uint)limit, EinaCompareCb<T>()); 410 Handle = eina_list_sort(Handle, (uint)limit, EinaCompareCb<T>());
370 } 411 }
371 412
@@ -375,7 +416,10 @@ public class List<T> : IEnumerable<T>, IDisposable
375 /// <param name="compareCb">The function to compare two elements of the list.</param> 416 /// <param name="compareCb">The function to compare two elements of the list.</param>
376 public void Sort(Compare compareCb) 417 public void Sort(Compare compareCb)
377 { 418 {
378 Handle = eina_list_sort(Handle, 0, Marshal.GetFunctionPointerForDelegate(GetNativeCompareCb(compareCb))); 419 RequireWritable();
420
421 Handle = eina_list_sort(Handle, (uint)0,
422 Marshal.GetFunctionPointerForDelegate(GetNativeCompareCb(compareCb)));
379 } 423 }
380 424
381 /// <summary>Sorts <c>limit</c> elements in this list inplace. 425 /// <summary>Sorts <c>limit</c> elements in this list inplace.
@@ -385,15 +429,16 @@ public class List<T> : IEnumerable<T>, IDisposable
385 /// <param name="compareCb">The function to compare two elements of the list.</param> 429 /// <param name="compareCb">The function to compare two elements of the list.</param>
386 public void Sort(int limit, Compare compareCb) 430 public void Sort(int limit, Compare compareCb)
387 { 431 {
388 Handle = eina_list_sort(Handle, (uint)limit, Marshal.GetFunctionPointerForDelegate(GetNativeCompareCb(compareCb))); 432 RequireWritable();
433
434 Handle = eina_list_sort(Handle, (uint)limit,
435 Marshal.GetFunctionPointerForDelegate(GetNativeCompareCb(compareCb)));
389 } 436 }
390 437
391 private Eina.Callbacks.EinaCompareCb GetNativeCompareCb(Compare managedCb) 438 private Eina.Callbacks.EinaCompareCb GetNativeCompareCb(Compare managedCb)
392 { 439 => (IntPtr a, IntPtr b)
393 return (IntPtr a, IntPtr b) => { 440 => managedCb(NativeToManaged<T>(a), NativeToManaged<T>(b));
394 return managedCb(NativeToManaged<T>(a), NativeToManaged<T>(b)); 441
395 };
396 }
397 442
398 /// <summary>Returns the <c>n</c>th element of this list. Due to marshalling details, the returned element 443 /// <summary>Returns the <c>n</c>th element of this list. Due to marshalling details, the returned element
399 /// may be a different C# object from the one you used to append. 444 /// may be a different C# object from the one you used to append.
@@ -401,33 +446,20 @@ public class List<T> : IEnumerable<T>, IDisposable
401 /// </summary> 446 /// </summary>
402 /// <param name="n">The 0-based index to be retrieved.</param> 447 /// <param name="n">The 0-based index to be retrieved.</param>
403 /// <returns>The value in the specified element.</returns> 448 /// <returns>The value in the specified element.</returns>
404 public T Nth(int n) 449 public T Nth(int n) => NativeToManaged<T>(GetNativeDataPointer(n));
405 {
406 // TODO: check bounds ???
407 IntPtr ele = eina_list_nth(Handle, (uint)n);
408 return NativeToManaged<T>(ele);
409 }
410 450
411 /// <summary>Sets the data at the <c>idx</c> position. 451 /// <summary>Sets the data at the <c>idx</c> position.
412 /// <para>Since EFL 1.23.</para> 452 /// <para>Since EFL 1.23.</para>
413 /// </summary> 453 /// </summary>
414 /// <param name="idx">The 0-based index to be set.</param> 454 /// <param name="idx">The 0-based index to be set.</param>
415 /// <param name="val">The value to be inserted.</param> 455 /// <param name="val">The value to be inserted.</param>
416 public void DataSet(int idx, T val) 456 internal void DataSet(int idx, T val)
417 { 457 {
418 IntPtr pos = eina_list_nth_list(Handle, (uint)idx); 458 RequireWritable();
419 if (pos == IntPtr.Zero)
420 {
421 throw new IndexOutOfRangeException();
422 }
423 459
424 if (OwnContent) 460 IntPtr pos = GetNativePointer(idx);
425 { 461 DeleteData(pos);
426 NativeFree<T>(InternalDataGet(pos)); 462 InternalDataSet(pos, ManagedToNativeAlloc(val));
427 }
428
429 IntPtr ele = ManagedToNativeAlloc(val);
430 InternalDataSet(pos, ele);
431 } 463 }
432 464
433 /// <summary>Accessor for the data at the <c>idx</c> position. 465 /// <summary>Accessor for the data at the <c>idx</c> position.
@@ -451,10 +483,7 @@ public class List<T> : IEnumerable<T>, IDisposable
451 /// </summary> 483 /// </summary>
452 /// <returns>The value contained in the last list position.</returns> 484 /// <returns>The value contained in the last list position.</returns>
453 public T LastDataGet() 485 public T LastDataGet()
454 { 486 => NativeToManaged<T>(eina_list_last_data_get_custom_export_mono(Handle));
455 IntPtr ele = eina_list_last_data_get_custom_export_mono(Handle);
456 return NativeToManaged<T>(ele);
457 }
458 487
459 /// <summary>Reverses this list in place. 488 /// <summary>Reverses this list in place.
460 /// <para>Since EFL 1.23.</para> 489 /// <para>Since EFL 1.23.</para>
@@ -462,6 +491,8 @@ public class List<T> : IEnumerable<T>, IDisposable
462 /// <returns>A reference to this object.</returns> 491 /// <returns>A reference to this object.</returns>
463 public List<T> Reverse() 492 public List<T> Reverse()
464 { 493 {
494 RequireWritable();
495
465 Handle = eina_list_reverse(Handle); 496 Handle = eina_list_reverse(Handle);
466 return this; 497 return this;
467 } 498 }
@@ -471,6 +502,8 @@ public class List<T> : IEnumerable<T>, IDisposable
471 /// </summary> 502 /// </summary>
472 public void Shuffle() 503 public void Shuffle()
473 { 504 {
505 RequireWritable();
506
474 Handle = eina_list_shuffle(Handle, IntPtr.Zero); 507 Handle = eina_list_shuffle(Handle, IntPtr.Zero);
475 } 508 }
476 509
@@ -480,9 +513,10 @@ public class List<T> : IEnumerable<T>, IDisposable
480 /// <returns>A managed array of the elements.</returns> 513 /// <returns>A managed array of the elements.</returns>
481 public T[] ToArray() 514 public T[] ToArray()
482 { 515 {
483 var managed = new T[Count()]; 516 var managed = new T[Count];
484 int i = 0; 517 int i = 0;
485 for (IntPtr curr = Handle; curr != IntPtr.Zero; curr = InternalNext(curr), ++i) 518 for (IntPtr curr = Handle; curr != IntPtr.Zero;
519 curr = InternalNext(curr), ++i)
486 { 520 {
487 managed[i] = NativeToManaged<T>(InternalDataGet(curr)); 521 managed[i] = NativeToManaged<T>(InternalDataGet(curr));
488 } 522 }
@@ -494,8 +528,10 @@ public class List<T> : IEnumerable<T>, IDisposable
494 /// <para>Since EFL 1.23.</para> 528 /// <para>Since EFL 1.23.</para>
495 /// </summary> 529 /// </summary>
496 /// <param name="values">The values to be appended.</param> 530 /// <param name="values">The values to be appended.</param>
497 public void AppendArray(T[] values) 531 public void Append(T[] values)
498 { 532 {
533 RequireWritable();
534
499 foreach (T v in values) 535 foreach (T v in values)
500 { 536 {
501 Append(v); 537 Append(v);
@@ -508,18 +544,14 @@ public class List<T> : IEnumerable<T>, IDisposable
508 /// </summary> 544 /// </summary>
509 /// <returns>The iterator.</returns> 545 /// <returns>The iterator.</returns>
510 public Eina.Iterator<T> GetIterator() 546 public Eina.Iterator<T> GetIterator()
511 { 547 => new Eina.Iterator<T>(eina_list_iterator_new(Handle), true);
512 return new Eina.Iterator<T>(eina_list_iterator_new(Handle), true);
513 }
514 548
515 /// <summary>Gets an iterator that iterates this list in reverse order. 549 /// <summary>Gets an iterator that iterates this list in reverse order.
516 /// <para>Since EFL 1.23.</para> 550 /// <para>Since EFL 1.23.</para>
517 /// </summary> 551 /// </summary>
518 /// <returns>The iterator.</returns> 552 /// <returns>The iterator.</returns>
519 public Eina.Iterator<T> GetReversedIterator() 553 public Eina.Iterator<T> GetReversedIterator()
520 { 554 => new Eina.Iterator<T>(eina_list_iterator_reversed_new(Handle), true);
521 return new Eina.Iterator<T>(eina_list_iterator_reversed_new(Handle), true);
522 }
523 555
524 /// <summary>Gets an enumerator into this list. 556 /// <summary>Gets an enumerator into this list.
525 /// <para>Since EFL 1.23.</para> 557 /// <para>Since EFL 1.23.</para>
@@ -538,18 +570,136 @@ public class List<T> : IEnumerable<T>, IDisposable
538 /// </summary> 570 /// </summary>
539 /// <returns>The enumerator.</returns> 571 /// <returns>The enumerator.</returns>
540 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() 572 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
541 { 573 => this.GetEnumerator();
542 return this.GetEnumerator();
543 }
544 574
545 /// <summary> Gets an Accessor for this List. 575 /// <summary> Gets an Accessor for this List.
546 /// <para>Since EFL 1.23.</para> 576 /// <para>Since EFL 1.23.</para>
547 /// </summary> 577 /// </summary>
548 /// <returns>The accessor.</returns> 578 /// <returns>The accessor.</returns>
549 public Eina.Accessor<T> GetAccessor() 579 public Eina.Accessor<T> GetAccessor()
580 => new Eina.Accessor<T>(eina_list_accessor_new(Handle),
581 Ownership.Managed);
582
583 /// <summary>
584 /// Removes the first occurrence of a specific object.
585 /// <para>Since EFL 1.24.</para>
586 /// </summary>
587 /// <param name="val">The object to remove.</param>
588 public bool Remove(T val)
550 { 589 {
551 return new Eina.Accessor<T>(eina_list_accessor_new(Handle), Ownership.Managed); 590 RequireWritable();
591
592 var prev_count = Count;
593 var deleted = LoopingThrough(val,
594 (i) =>
595 {
596 RemoveAt(i);
597 return true;
598 },
599 () => false);
600
601 return deleted && (prev_count - 1 == Count);
552 } 602 }
603
604 /// <summary>
605 /// Adds an item.
606 /// <para>Since EFL 1.24.</para>
607 /// </summary>
608 /// <param name="val">The object to add.</param>
609 public void Add(T val) => Append(val);
610
611 /// <summary>
612 /// Removes all items.
613 /// <para>Since EFL 1.24.</para>
614 /// </summary>
615 public void Clear()
616 {
617 RequireWritable();
618
619 for (; Handle != IntPtr.Zero;)
620 {
621 Handle = eina_list_remove_list(Handle, Handle);
622 }
623 }
624
625 /// <summary>
626 /// Determines whether the <see cref="List{T}" /> contains a specific value.
627 /// <para>Since EFL 1.24.</para>
628 /// </summary>
629 /// <param name="val">The object to locate.</param>
630 public bool Contains(T val)
631 => LoopingThrough(val, (i) => true, () => false);
632
633 /// <summary>
634 /// Determines the index of a specific item.
635 /// <para>Since EFL 1.24.</para>
636 /// </summary>
637 /// <param name="val">The object to locate.</param>
638 public int IndexOf(T val)
639 => LoopingThrough(val, (i) => i, () => -1);
640
641 /// <summary>
642 /// Inserts an item to the <see cref="List{T}" /> at the specified index.
643 /// <para>Since EFL 1.24.</para>
644 /// </summary>
645 /// <param name="idx">The zero-based index at which item should be inserted.</param>
646 /// <param name="val">The object to insert.</param>
647 public void Insert(int idx, T val)
648 {
649 RequireWritable();
650
651 if (idx == 0)
652 {
653 Prepend(val);
654 return;
655 }
656
657 if (idx == Count)
658 {
659 Append(val);
660 return;
661 }
662
663 if (idx < 0)
664 {
665 throw new ArgumentOutOfRangeException(nameof(idx), $"{nameof(idx)} cannot be negative.");
666 }
667
668 if (Count < idx)
669 {
670 throw new ArgumentOutOfRangeException(nameof(idx), $"{nameof(idx)} cannot be greater than {nameof(Count)} + 1.");
671 }
672
673 Handle = eina_list_prepend_relative_list(Handle, ManagedToNativeAlloc(val),
674 GetNativePointer(idx));
675 }
676
677 /// <summary>
678 /// Removes the <see cref="List{T}" /> item at the specified index.
679 /// <para>Since EFL 1.24.</para>
680 /// </summary>
681 /// <param name="idx">The zero-based index of the item to remove.</param>
682 public void RemoveAt(int idx)
683 {
684 RequireWritable();
685
686 var ele = GetNativePointer(idx);
687 DeleteData(ele);
688 Handle = eina_list_remove_list(Handle, ele);
689 }
690
691 /// <summary>
692 /// Copies the elements of the <see cref="List{T}" /> to an
693 /// <see cref="Array" />, starting at a particular <see cref="Array" /> index.
694 /// <para>Since EFL 1.24.</para>
695 /// </summary>
696 /// <param name="array">The one-dimensional <see cref="Array" /> that is the
697 /// destination of the elements copied from <see cref="List{T}" />.
698 /// The <see cref="Array" /> must have zero-based indexing.</param>
699 /// <param name="arrayIndex">The zero-based index in array at which copying
700 /// begins.</param>
701 public void CopyTo(T[] array, int arrayIndex)
702 => ToArray().CopyTo(array, arrayIndex);
553} 703}
554 704
555} 705}
diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build
index 86cef4d..f98aa5e 100644
--- a/src/bindings/mono/meson.build
+++ b/src/bindings/mono/meson.build
@@ -199,12 +199,13 @@ if (get_option('dotnet'))
199 ) 199 )
200 200
201else 201else
202 extra_cs_args += '-d:MONO'
202 203
203 efl_mono = library('efl_mono', 204 efl_mono = library('efl_mono',
204 mono_generator_target + mono_files + [efl_src], 205 mono_generator_target + mono_files + [efl_src],
205 install : true, 206 install : true,
206 install_dir : efl_mono_install_dir, 207 install_dir : efl_mono_install_dir,
207 cs_args : extra_cs_args + ['-doc:' + efl_mono_xml_doc, '-warnaserror+'] 208 cs_args : extra_cs_args + ['-doc:' + efl_mono_xml_doc, '-warnaserror+'],
208 ) 209 )
209 210
210 meson.add_install_script(join_paths(meson.source_root(), 'meson', 'meson_csharp_docs.sh'), 211 meson.add_install_script(join_paths(meson.source_root(), 'meson', 'meson_csharp_docs.sh'),
diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c
index 7a010fb..d9ade67 100644
--- a/src/examples/elementary/efl_ui_list_example_1.c
+++ b/src/examples/elementary/efl_ui_list_example_1.c
@@ -13,12 +13,6 @@
13#include <Eio.h> 13#include <Eio.h>
14#include <stdio.h> 14#include <stdio.h>
15 15
16//FIXME this can go away when efl_ui_text doesn't need elm_general
17# include <elm_general.h>
18# include <efl_text_interactive.eo.h>
19# include <efl_ui_textbox.eo.h>
20# include <efl_ui_textbox_async.eo.h>
21
22#define NUM_ITEMS 400 16#define NUM_ITEMS 400
23 17
24typedef struct _List_Scroll_Data { 18typedef struct _List_Scroll_Data {
diff --git a/src/lib/ecore/ecore_exe_posix.c b/src/lib/ecore/ecore_exe_posix.c
index 4a9b7a3..44d9c73 100644
--- a/src/lib/ecore/ecore_exe_posix.c
+++ b/src/lib/ecore/ecore_exe_posix.c
@@ -372,19 +372,6 @@ _impl_ecore_exe_efl_object_finalize(Eo *obj, Ecore_Exe_Data *exe)
372 _ecore_exe_exec_it(exe_cmd, flags); /* no return */ 372 _ecore_exe_exec_it(exe_cmd, flags); /* no return */
373 } 373 }
374 } 374 }
375
376 /* Something went 'orribly wrong. */
377 vfork_exec_errno = errno;
378
379 /* Close the pipes. */
380 if (flags & ECORE_EXE_PIPE_ERROR)
381 E_NO_ERRNO(result, close(errorPipe[1]), ok);
382 if (flags & ECORE_EXE_PIPE_READ)
383 E_NO_ERRNO(result, close(readPipe[1]), ok);
384 if (flags & ECORE_EXE_PIPE_WRITE)
385 E_NO_ERRNO(result, close(writePipe[0]), ok);
386 E_NO_ERRNO(result, close(statusPipe[1]), ok);
387
388 _exit(-1); 375 _exit(-1);
389 } 376 }
390 else /* parent */ 377 else /* parent */
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index 2216c83..24619f6 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -1191,6 +1191,8 @@ _edje_edd_init(void)
1191 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.size_range_max", text.size_range_max, EET_T_INT); 1191 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.size_range_max", text.size_range_max, EET_T_INT);
1192 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.fit_x", text.fit_x, EET_T_UCHAR); 1192 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.fit_x", text.fit_x, EET_T_UCHAR);
1193 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.fit_y", text.fit_y, EET_T_UCHAR); 1193 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.fit_y", text.fit_y, EET_T_UCHAR);
1194 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.fit_step", text.fit_step, EET_T_UINT);
1195 EET_DATA_DESCRIPTOR_ADD_LIST_UINT(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.fit_size_array", text.fit_size_array);
1194 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.min_x", text.min_x, EET_T_UCHAR); 1196 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.min_x", text.min_x, EET_T_UCHAR);
1195 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.min_y", text.min_y, EET_T_UCHAR); 1197 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.min_y", text.min_y, EET_T_UCHAR);
1196 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.max_x", text.max_x, EET_T_UCHAR); 1198 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.max_x", text.max_x, EET_T_UCHAR);
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index e87576b..1469618 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -4750,6 +4750,7 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_
4750 } 4750 }
4751 *itr = 0; 4751 *itr = 0;
4752 4752
4753 free(plain_text);
4753 plain_text = strdup(u_text); 4754 plain_text = strdup(u_text);
4754 free(u_text); 4755 free(u_text);
4755 u_text = NULL; 4756 u_text = NULL;
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 4298043..266c588 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1468,6 +1468,9 @@ struct _Edje_Part_Description_Spec_Text
1468 int id_text_source; /* -1 if none */ 1468 int id_text_source; /* -1 if none */
1469 int size_range_min; 1469 int size_range_min;
1470 int size_range_max; /* -1 means, no bound. */ 1470 int size_range_max; /* -1 means, no bound. */
1471 unsigned int fit_step;
1472 /*FIXME THIS SHOULD BE EINA_LIST*/
1473 Eina_List *fit_size_array;
1471 1474
1472 unsigned char fit_x; /* resize font size down to fit in x dir */ 1475 unsigned char fit_x; /* resize font size down to fit in x dir */
1473 unsigned char fit_y; /* resize font size down to fit in y dir */ 1476 unsigned char fit_y; /* resize font size down to fit in y dir */
diff --git a/src/lib/edje/edje_textblock.c b/src/lib/edje/edje_textblock.c
index 76f3b2a..d0c5c6d 100644
--- a/src/lib/edje/edje_textblock.c
+++ b/src/lib/edje/edje_textblock.c
@@ -1,25 +1,5 @@
1#include "edje_private.h" 1#include "edje_private.h"
2 2
3static double
4_edje_part_recalc_single_textblock_scale_range_adjust(Edje_Part_Description_Text *chosen_desc, double base_scale, double scale)
5{
6 double size, min, max;
7
8 if (chosen_desc->text.size == 0)
9 return scale;
10
11 min = base_scale * chosen_desc->text.size_range_min;
12 max = chosen_desc->text.size_range_max * base_scale;
13 size = chosen_desc->text.size * scale;
14
15 if ((size > max) && (max > 0))
16 scale = max / (double)chosen_desc->text.size;
17 else if (size < min)
18 scale = min / (double)chosen_desc->text.size;
19
20 return scale;
21}
22
23/* 3/*
24 * Legacy function for min/max calculation of textblock part. 4 * Legacy function for min/max calculation of textblock part.
25 * It can't calculate min/max properly in many cases. 5 * It can't calculate min/max properly in many cases.
@@ -528,7 +508,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
528 508
529 if (chosen_desc) 509 if (chosen_desc)
530 { 510 {
531 Eina_Size2D size;
532 511
533 if (ep->part->scale) 512 if (ep->part->scale)
534 evas_object_scale_set(ep->object, TO_DOUBLE(sc)); 513 evas_object_scale_set(ep->object, TO_DOUBLE(sc));
@@ -539,76 +518,28 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
539 { 518 {
540 if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y)) 519 if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y))
541 { 520 {
542 double base_s = 1.0; 521 unsigned int size_array[255];
543 double orig_s; 522 size_t size_array_len = 0;
544 double s = base_s; 523 Eina_List *l;
545 524 unsigned int *value;
546 if (ep->part->scale) base_s = TO_DOUBLE(sc); 525 EINA_LIST_FOREACH(chosen_desc->text.fit_size_array, l, value)
547 efl_gfx_entity_scale_set(ep->object, base_s);
548 size = efl_canvas_textblock_size_native_get(ep->object);
549
550 orig_s = base_s;
551 /* Now make it bigger so calculations will be more accurate
552 * and less influenced by hinting... */
553 {
554 orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
555 orig_s * TO_INT(params->eval.w) / size.w);
556 efl_gfx_entity_scale_set(ep->object, orig_s);
557 size = efl_canvas_textblock_size_native_get(ep->object);
558 }
559 if (chosen_desc->text.fit_x)
560 { 526 {
561 if (size.w > 0) 527 size_array[size_array_len++] = *value;
562 {
563 s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
564 orig_s * TO_INT(params->eval.w) / size.w);
565 efl_gfx_entity_scale_set(ep->object, s);
566 efl_canvas_textblock_size_native_get(ep->object);
567 }
568 } 528 }
529 unsigned int mode = TEXTBLOCK_FIT_MODE_NONE;
530
531 if (chosen_desc->text.fit_x)
532 mode |= TEXTBLOCK_FIT_MODE_WIDTH;
569 if (chosen_desc->text.fit_y) 533 if (chosen_desc->text.fit_y)
534 mode |= TEXTBLOCK_FIT_MODE_HEIGHT;
535 evas_textblock_fit_options_set(ep->object, mode);
536 evas_textblock_fit_step_size_set(ep->object, chosen_desc->text.fit_step);
537 if ( chosen_desc->text.size_range_min || chosen_desc->text.size_range_max)
538 evas_textblock_fit_size_range_set(ep->object, chosen_desc->text.size_range_min, chosen_desc->text.size_range_max);
539 if (size_array_len>0)
570 { 540 {
571 if (size.h > 0) 541 evas_textblock_fit_size_array_set(ep->object,size_array,size_array_len);
572 {
573 double tmp_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
574 orig_s * TO_INT(params->eval.h) / size.h);
575 /* If we already have X fit, restrict Y to be no bigger
576 * than what we got with X. */
577 if (!((chosen_desc->text.fit_x) && (tmp_s > s)))
578 {
579 s = tmp_s;
580 }
581
582 efl_gfx_entity_scale_set(ep->object, s);
583 efl_canvas_textblock_size_native_get(ep->object);
584 }
585 } 542 }
586
587 /* Final tuning, try going down 90% at a time, hoping it'll
588 * actually end up being correct. */
589 {
590 int i = 5; /* Tries before we give up. */
591 Eina_Size2D size;
592 size = efl_canvas_textblock_size_native_get(ep->object);
593
594 /* If we are still too big, try reducing the size to
595 * 95% each try. */
596 while ((i > 0) &&
597 ((chosen_desc->text.fit_x && (size.w > TO_INT(params->eval.w))) ||
598 (chosen_desc->text.fit_y && (size.h > TO_INT(params->eval.h)))))
599 {
600 double tmp_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, s * 0.95);
601
602 /* Break if we are not making any progress. */
603 if (EQ(tmp_s, s))
604 break;
605 s = tmp_s;
606
607 efl_gfx_entity_scale_set(ep->object, s);
608 size = efl_canvas_textblock_size_native_get(ep->object);
609 i--;
610 }
611 }
612 } 543 }
613 544
614 if ((ed->file->efl_version.major >= 1) && (ed->file->efl_version.minor >= 19)) 545 if ((ed->file->efl_version.major >= 1) && (ed->file->efl_version.minor >= 19))
diff --git a/src/lib/eet/Eet.h b/src/lib/eet/Eet.h
index 25babe1..eb7cb53 100644
--- a/src/lib/eet/Eet.h
+++ b/src/lib/eet/Eet.h
@@ -3538,6 +3538,29 @@ eet_data_descriptor_encode(Eet_Data_Descriptor *edd,
3538 3538
3539/** 3539/**
3540 * @ingroup Eet_Data_Group 3540 * @ingroup Eet_Data_Group
3541 * @brief Adds a linked list of unsigned integers to a data descriptor.
3542 * @param edd The data descriptor to add the type to.
3543 * @param struct_type The type of the struct.
3544 * @param name The string name to use to encode/decode this member
3545 * (must be a constant global and never change).
3546 * @param member The struct member itself to be encoded.
3547 *
3548 * This macro lets you easily add a linked list of unsigned int. All the
3549 * parameters are the same as for EET_DATA_DESCRIPTOR_ADD_BASIC().
3550 *
3551 * @since 1.24.0
3552 */
3553#define EET_DATA_DESCRIPTOR_ADD_LIST_UINT(edd, struct_type, name, member) \
3554 do { \
3555 struct_type ___ett; \
3556 eet_data_descriptor_element_add(edd, name, EET_T_UINT, EET_G_LIST, \
3557 (char *)(& (___ett.member)) - \
3558 (char *)(& (___ett)), \
3559 0, /* 0, */ NULL, NULL); \
3560 } while (0)
3561
3562/**
3563 * @ingroup Eet_Data_Group
3541 * @brief Adds a hash type to a data descriptor. 3564 * @brief Adds a hash type to a data descriptor.
3542 * @param edd The data descriptor to add the type to. 3565 * @param edd The data descriptor to add the type to.
3543 * @param struct_type The type of the struct. 3566 * @param struct_type The type of the struct.
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index f147e8a..ee31b1e 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -42,7 +42,6 @@ static Eina_Prefix *pfx;
42 * re-think the priority handling, but we should do this when the need arise. 42 * re-think the priority handling, but we should do this when the need arise.
43 */ 43 */
44static const char *_module_priority[] = { 44static const char *_module_priority[] = {
45 "tizen",
46 "fake", 45 "fake",
47 "udev", 46 "udev",
48 NULL 47 NULL
diff --git a/src/lib/eina/eina_cow.h b/src/lib/eina/eina_cow.h
index 800371b..4836d3e 100644
--- a/src/lib/eina/eina_cow.h
+++ b/src/lib/eina/eina_cow.h
@@ -177,6 +177,24 @@ EAPI Eina_Bool eina_cow_gc(Eina_Cow *cow);
177 while (0); 177 while (0);
178 178
179/** 179/**
180 * @def EINA_COW_WRITE_END_NOGC
181 * @brief Definition for the macro to close the writeable pointer without triggering the GC.
182 *
183 * @param[in,out] Cow The Eina_Cow where the const pointer came from.
184 * @param[in] Read The const pointer to get a writable handler from.
185 * @param[in] Write The name of the variable where to put the writeable pointer to.
186 *
187 * @since 1.8.0
188 *
189 * @note This macro closes the scope opened by EINA_COW_WRITE_BEGIN().
190 */
191#define EINA_COW_WRITE_END_NOGC(Cow, Read, Write) \
192 eina_cow_done(Cow, ((const Eina_Cow_Data**)&(Read)), Write, \
193 EINA_FALSE); \
194 } \
195 while (0);
196
197/**
180 * @} 198 * @}
181 */ 199 */
182 200
diff --git a/src/lib/eina/eina_rbtree.c b/src/lib/eina/eina_rbtree.c
index 8c074a4..b7373c7 100644
--- a/src/lib/eina/eina_rbtree.c
+++ b/src/lib/eina/eina_rbtree.c
@@ -131,7 +131,7 @@ _eina_rbtree_iterator_free(Eina_Iterator_Rbtree *it)
131 free(item); 131 free(item);
132 } 132 }
133 133
134 eina_array_flush(it->stack); 134 eina_array_clean(it->stack);
135 135
136 eina_spinlock_take(&iterator_trash_lock); 136 eina_spinlock_take(&iterator_trash_lock);
137 eina_array_push(&iterator_trash, it); 137 eina_array_push(&iterator_trash, it);
diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c
index 3e54f79..43b1b19 100644
--- a/src/lib/elementary/efl_ui_collection.c
+++ b/src/lib/elementary/efl_ui_collection.c
@@ -961,6 +961,7 @@ _efl_ui_collection_position_manager_set(Eo *obj, Efl_Ui_Collection_Data *pd, Efl
961 { 961 {
962 case 1: 962 case 1:
963 efl_ui_position_manager_data_access_v1_data_access_set(pd->pos_man, 963 efl_ui_position_manager_data_access_v1_data_access_set(pd->pos_man,
964 efl_provider_find(obj, EFL_UI_WIN_CLASS),
964 &pd->obj_accessor, _obj_accessor_get_at, NULL, 965 &pd->obj_accessor, _obj_accessor_get_at, NULL,
965 &pd->size_accessor, _size_accessor_get_at, NULL, 966 &pd->size_accessor, _size_accessor_get_at, NULL,
966 eina_list_count(pd->items)); 967 eina_list_count(pd->items));
diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index 4aca77c..dcf8f91 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -520,6 +520,10 @@ _entity_fetched_cb(Eo *obj, void *data, const Eina_Value v)
520 unsigned int i, len; 520 unsigned int i, len;
521 uint64_t updated_size_start_id = 0, updated_entity_start_id = 0; 521 uint64_t updated_size_start_id = 0, updated_entity_start_id = 0;
522 Eina_Bool updated_size = EINA_FALSE, updated_entity = EINA_FALSE; 522 Eina_Bool updated_size = EINA_FALSE, updated_entity = EINA_FALSE;
523 Evas *e;
524
525 e = evas_object_evas_get(obj);
526 evas_event_freeze(e);
523 527
524 EINA_VALUE_ARRAY_FOREACH(&v, len, i, child) 528 EINA_VALUE_ARRAY_FOREACH(&v, len, i, child)
525 { 529 {
@@ -627,6 +631,9 @@ _entity_fetched_cb(Eo *obj, void *data, const Eina_Value v)
627 } 631 }
628 } 632 }
629 633
634 evas_event_thaw(e);
635 evas_event_thaw_eval(e);
636
630 // Currently position manager will flush its entire size cache on update, so only do 637 // Currently position manager will flush its entire size cache on update, so only do
631 // it when necessary to improve performance. 638 // it when necessary to improve performance.
632 if (updated_size || request->need_size) 639 if (updated_size || request->need_size)
@@ -1641,6 +1648,7 @@ _efl_ui_collection_view_position_manager_set(Eo *obj, Efl_Ui_Collection_View_Dat
1641 { 1648 {
1642 case 1: 1649 case 1:
1643 efl_ui_position_manager_data_access_v1_data_access_set(pd->manager, 1650 efl_ui_position_manager_data_access_v1_data_access_set(pd->manager,
1651 efl_provider_find(obj, EFL_UI_WIN_CLASS),
1644 efl_ref(obj), _batch_entity_cb, _unref_cb, 1652 efl_ref(obj), _batch_entity_cb, _unref_cb,
1645 efl_ref(obj), _batch_size_cb, _unref_cb, 1653 efl_ref(obj), _batch_size_cb, _unref_cb,
1646 count); 1654 count);
@@ -1985,6 +1993,7 @@ _efl_ui_collection_view_model_changed(void *data, const Efl_Event *event)
1985 { 1993 {
1986 case 1: 1994 case 1:
1987 efl_ui_position_manager_data_access_v1_data_access_set(pd->manager, 1995 efl_ui_position_manager_data_access_v1_data_access_set(pd->manager,
1996 efl_provider_find(data, EFL_UI_WIN_CLASS),
1988 efl_ref(data), _batch_entity_cb, _unref_cb, 1997 efl_ref(data), _batch_entity_cb, _unref_cb,
1989 efl_ref(data), _batch_size_cb, _unref_cb, 1998 efl_ref(data), _batch_size_cb, _unref_cb,
1990 count); 1999 count);
diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c
index edf7107..da152b4 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -568,9 +568,15 @@ _efl_ui_popup_efl_object_constructor(Eo *obj, Efl_Ui_Popup_Data *pd)
568} 568}
569 569
570EOLIAN static void 570EOLIAN static void
571_efl_ui_popup_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Data *pd) 571_efl_ui_popup_efl_object_invalidate(Eo *obj, Efl_Ui_Popup_Data *pd)
572{ 572{
573 ELM_SAFE_DEL(pd->backwall); 573 ELM_SAFE_DEL(pd->backwall);
574 efl_invalidate(efl_super(obj, MY_CLASS));
575}
576
577EOLIAN static void
578_efl_ui_popup_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Data *pd)
579{
574 _anchor_detach(obj, pd); 580 _anchor_detach(obj, pd);
575 581
576 efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _parent_geom_cb, 582 efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _parent_geom_cb,
diff --git a/src/lib/elementary/efl_ui_popup.eo b/src/lib/elementary/efl_ui_popup.eo
index 322a7f8..66d8829 100644
--- a/src/lib/elementary/efl_ui_popup.eo
+++ b/src/lib/elementary/efl_ui_popup.eo
@@ -125,6 +125,7 @@ class Efl.Ui.Popup extends Efl.Ui.Layout_Base implements Efl.Content, Efl.Ui.Foc
125 implements { 125 implements {
126 Efl.Object.constructor; 126 Efl.Object.constructor;
127 Efl.Object.destructor; 127 Efl.Object.destructor;
128 Efl.Object.invalidate;
128 Efl.Canvas.Group.group_calculate; 129 Efl.Canvas.Group.group_calculate;
129 Efl.Gfx.Entity.position { set; } 130 Efl.Gfx.Entity.position { set; }
130 Efl.Gfx.Entity.size { set;} 131 Efl.Gfx.Entity.size { set;}
diff --git a/src/lib/elementary/efl_ui_position_manager_data_access_v1.eo b/src/lib/elementary/efl_ui_position_manager_data_access_v1.eo
index ab55c09..d7d42c4 100644
--- a/src/lib/elementary/efl_ui_position_manager_data_access_v1.eo
+++ b/src/lib/elementary/efl_ui_position_manager_data_access_v1.eo
@@ -116,6 +116,7 @@ interface @beta Efl.Ui.Position_Manager.Data_Access_V1 {
116 set { 116 set {
117 } 117 }
118 values { 118 values {
119 canvas: Efl.Ui.Win; [[Will use this object to freeze/thaw canvas events.]]
119 obj_access : Efl.Ui.Position_Manager.Object_Batch_Callback; [[Function callback for canvas objects, even if 120 obj_access : Efl.Ui.Position_Manager.Object_Batch_Callback; [[Function callback for canvas objects, even if
120 the start_id is valid, the returned objects 121 the start_id is valid, the returned objects
121 may be $NULL.]] 122 may be $NULL.]]
diff --git a/src/lib/elementary/efl_ui_position_manager_grid.c b/src/lib/elementary/efl_ui_position_manager_grid.c
index 7b0ed30..2cec569 100644
--- a/src/lib/elementary/efl_ui_position_manager_grid.c
+++ b/src/lib/elementary/efl_ui_position_manager_grid.c
@@ -13,30 +13,37 @@
13 Efl_Ui_Position_Manager_Grid_Data *pd = efl_data_scope_get(obj, MY_CLASS); 13 Efl_Ui_Position_Manager_Grid_Data *pd = efl_data_scope_get(obj, MY_CLASS);
14 14
15typedef struct { 15typedef struct {
16 unsigned int size; 16 Api_Callbacks callbacks;
17 unsigned int groups; 17
18 Eina_Inarray *group_cache;
19 int *size_cache;
20 Eo *last_group;
21 Eina_Future *rebuild_absolut_size;
22 Efl_Ui_Win *window;
23 Evas *canvas;
24
25 Vis_Segment prev_run;
26
18 Eina_Rect viewport; 27 Eina_Rect viewport;
19 Eina_Vector2 scroll_position; 28 Eina_Vector2 scroll_position;
20 Efl_Ui_Layout_Orientation dir;
21 Vis_Segment prev_run;
22 unsigned int prev_consumed_space;
23 Eina_Size2D max_min_size; 29 Eina_Size2D max_min_size;
24 Eina_Size2D last_viewport_size; 30 Eina_Size2D last_viewport_size;
25 Eina_Size2D prev_min_size; 31 Eina_Size2D prev_min_size;
26 32
27 Eina_Inarray *group_cache; 33 Efl_Ui_Layout_Orientation dir;
34
35 unsigned int size;
36 unsigned int groups;
37 unsigned int prev_consumed_space;
38
28 Eina_Bool group_cache_dirty; 39 Eina_Bool group_cache_dirty;
29 int *size_cache;
30 Eina_Bool size_cache_dirty; 40 Eina_Bool size_cache_dirty;
31 Eo *last_group;
32 Eina_Future *rebuild_absolut_size;
33 Api_Callbacks callbacks;
34} Efl_Ui_Position_Manager_Grid_Data; 41} Efl_Ui_Position_Manager_Grid_Data;
35 42
36typedef struct { 43typedef struct {
37 Eina_Bool real_group;
38 Eina_Size2D group_header_size; 44 Eina_Size2D group_header_size;
39 int items; 45 int items;
46 Eina_Bool real_group;
40} Group_Cache_Line; 47} Group_Cache_Line;
41 48
42static inline void 49static inline void
@@ -769,7 +776,7 @@ _efl_ui_position_manager_grid_efl_ui_position_manager_entity_version(Eo *obj EIN
769} 776}
770 777
771EOLIAN static void 778EOLIAN static void
772_efl_ui_position_manager_grid_efl_ui_position_manager_data_access_v1_data_access_set(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd, void *obj_access_data, Efl_Ui_Position_Manager_Object_Batch_Callback obj_access, Eina_Free_Cb obj_access_free_cb, void *size_access_data, Efl_Ui_Position_Manager_Size_Batch_Callback size_access, Eina_Free_Cb size_access_free_cb, int size) 779_efl_ui_position_manager_grid_efl_ui_position_manager_data_access_v1_data_access_set(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd, Efl_Ui_Win *canvas, void *obj_access_data, Efl_Ui_Position_Manager_Object_Batch_Callback obj_access, Eina_Free_Cb obj_access_free_cb, void *size_access_data, Efl_Ui_Position_Manager_Size_Batch_Callback size_access, Eina_Free_Cb size_access_free_cb, int size)
773{ 780{
774 // Cleanup cache first 781 // Cleanup cache first
775 _group_cache_invalidate(obj, pd); 782 _group_cache_invalidate(obj, pd);
@@ -781,6 +788,9 @@ _efl_ui_position_manager_grid_efl_ui_position_manager_data_access_v1_data_access
781 pd->callbacks.size.free_cb(pd->callbacks.size.data); 788 pd->callbacks.size.free_cb(pd->callbacks.size.data);
782 789
783 // Set them 790 // Set them
791 efl_replace(&pd->window, canvas);
792 efl_replace(&pd->canvas, canvas ? evas_object_evas_get(canvas) : NULL);
793
784 pd->callbacks.object.data = obj_access_data; 794 pd->callbacks.object.data = obj_access_data;
785 pd->callbacks.object.access = obj_access; 795 pd->callbacks.object.access = obj_access;
786 pd->callbacks.object.free_cb = obj_access_free_cb; 796 pd->callbacks.object.free_cb = obj_access_free_cb;
@@ -797,7 +807,7 @@ EOLIAN static void
797_efl_ui_position_manager_grid_efl_object_invalidate(Eo *obj, 807_efl_ui_position_manager_grid_efl_object_invalidate(Eo *obj,
798 Efl_Ui_Position_Manager_Grid_Data *pd EINA_UNUSED) 808 Efl_Ui_Position_Manager_Grid_Data *pd EINA_UNUSED)
799{ 809{
800 efl_ui_position_manager_data_access_v1_data_access_set(obj, NULL, NULL, NULL, NULL, NULL, NULL, 0); 810 efl_ui_position_manager_data_access_v1_data_access_set(obj, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
801 811
802 efl_invalidate(efl_super(obj, EFL_UI_POSITION_MANAGER_GRID_CLASS)); 812 efl_invalidate(efl_super(obj, EFL_UI_POSITION_MANAGER_GRID_CLASS));
803} 813}
diff --git a/src/lib/elementary/efl_ui_position_manager_list.c b/src/lib/elementary/efl_ui_position_manager_list.c
index 34d7e5f..3980e12 100644
--- a/src/lib/elementary/efl_ui_position_manager_list.c
+++ b/src/lib/elementary/efl_ui_position_manager_list.c
@@ -14,18 +14,25 @@
14 Efl_Ui_Position_Manager_List_Data *pd = efl_data_scope_get(obj, MY_CLASS); 14 Efl_Ui_Position_Manager_List_Data *pd = efl_data_scope_get(obj, MY_CLASS);
15 15
16typedef struct { 16typedef struct {
17 unsigned int size; 17 Api_Callbacks callbacks;
18
18 Eina_Future *rebuild_absolut_size; 19 Eina_Future *rebuild_absolut_size;
20 int *size_cache;
21 Efl_Gfx_Entity *last_group;
22 Efl_Ui_Win *window;
23 Evas *canvas;
24
25 Vis_Segment prev_run;
26
19 Eina_Rect viewport; 27 Eina_Rect viewport;
20 Eina_Size2D abs_size; 28 Eina_Size2D abs_size;
21 Eina_Vector2 scroll_position; 29 Eina_Vector2 scroll_position;
30
22 Efl_Ui_Layout_Orientation dir; 31 Efl_Ui_Layout_Orientation dir;
23 int *size_cache; 32
33 unsigned int size;
24 int average_item_size; 34 int average_item_size;
25 int maximum_min_size; 35 int maximum_min_size;
26 Vis_Segment prev_run;
27 Efl_Gfx_Entity *last_group;
28 Api_Callbacks callbacks;
29} Efl_Ui_Position_Manager_List_Data; 36} Efl_Ui_Position_Manager_List_Data;
30 37
31/* 38/*
@@ -193,6 +200,8 @@ _position_items(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, Vis_
193 else 200 else
194 geom.x -= (relevant_space_size - cache_access(obj, pd, new.start_id)); 201 geom.x -= (relevant_space_size - cache_access(obj, pd, new.start_id));
195 202
203 evas_event_freeze(pd->canvas);
204
196 for (i = new.start_id; i < new.end_id; ++i) 205 for (i = new.start_id; i < new.end_id; ++i)
197 { 206 {
198 Eina_Size2D size; 207 Eina_Size2D size;
@@ -291,6 +300,9 @@ _position_items(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, Vis_
291 300
292 efl_gfx_entity_position_set(first_group, first_group_pos); 301 efl_gfx_entity_position_set(first_group, first_group_pos);
293 efl_gfx_entity_size_set(first_group, first_group_size); 302 efl_gfx_entity_size_set(first_group, first_group_size);
303
304 evas_event_thaw(pd->canvas);
305 evas_event_thaw_eval(pd->canvas);
294} 306}
295 307
296 308
@@ -503,7 +515,7 @@ _efl_ui_position_manager_list_efl_object_invalidate(Eo *obj, Efl_Ui_Position_Man
503 if (pd->rebuild_absolut_size) 515 if (pd->rebuild_absolut_size)
504 eina_future_cancel(pd->rebuild_absolut_size); 516 eina_future_cancel(pd->rebuild_absolut_size);
505 517
506 efl_ui_position_manager_data_access_v1_data_access_set(obj, NULL, NULL, NULL, NULL, NULL, NULL, 0); 518 efl_ui_position_manager_data_access_v1_data_access_set(obj, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
507 519
508 efl_invalidate(efl_super(obj, MY_CLASS)); 520 efl_invalidate(efl_super(obj, MY_CLASS));
509} 521}
@@ -542,7 +554,7 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_version(Eo *obj EIN
542} 554}
543 555
544EOLIAN static void 556EOLIAN static void
545_efl_ui_position_manager_list_efl_ui_position_manager_data_access_v1_data_access_set(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, void *obj_access_data, Efl_Ui_Position_Manager_Object_Batch_Callback obj_access, Eina_Free_Cb obj_access_free_cb, void *size_access_data, Efl_Ui_Position_Manager_Size_Batch_Callback size_access, Eina_Free_Cb size_access_free_cb, int size) 557_efl_ui_position_manager_list_efl_ui_position_manager_data_access_v1_data_access_set(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, Efl_Ui_Win *canvas, void *obj_access_data, Efl_Ui_Position_Manager_Object_Batch_Callback obj_access, Eina_Free_Cb obj_access_free_cb, void *size_access_data, Efl_Ui_Position_Manager_Size_Batch_Callback size_access, Eina_Free_Cb size_access_free_cb, int size)
546{ 558{
547 // Cleanup cache first 559 // Cleanup cache first
548 cache_invalidate(obj, pd); 560 cache_invalidate(obj, pd);
@@ -554,6 +566,9 @@ _efl_ui_position_manager_list_efl_ui_position_manager_data_access_v1_data_access
554 pd->callbacks.size.free_cb(pd->callbacks.size.data); 566 pd->callbacks.size.free_cb(pd->callbacks.size.data);
555 567
556 // Set them 568 // Set them
569 efl_replace(&pd->window, canvas);
570 efl_replace(&pd->canvas, canvas ? evas_object_evas_get(canvas) : NULL);
571
557 pd->callbacks.object.data = obj_access_data; 572 pd->callbacks.object.data = obj_access_data;
558 pd->callbacks.object.access = obj_access; 573 pd->callbacks.object.access = obj_access;
559 pd->callbacks.object.free_cb = obj_access_free_cb; 574 pd->callbacks.object.free_cb = obj_access_free_cb;
diff --git a/src/lib/elementary/efl_ui_widget_factory.c b/src/lib/elementary/efl_ui_widget_factory.c
index 5ab9477..43c9d27 100644
--- a/src/lib/elementary/efl_ui_widget_factory.c
+++ b/src/lib/elementary/efl_ui_widget_factory.c
@@ -279,6 +279,10 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data
279 { 279 {
280 Efl_Ui_Widget *w = NULL; 280 Efl_Ui_Widget *w = NULL;
281 Eina_Value r; 281 Eina_Value r;
282 Evas *e;
283
284 e = evas_object_evas_get(obj);
285 evas_event_freeze(e);
282 286
283 eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4); 287 eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4);
284 288
@@ -286,11 +290,19 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data
286 { 290 {
287 w = _efl_ui_widget_create(obj, pd->klass, pd->parenting_widget, model); 291 w = _efl_ui_widget_create(obj, pd->klass, pd->parenting_widget, model);
288 292
289 if (!w) return efl_loop_future_rejected(obj, ENOMEM); 293 if (!w)
294 {
295 evas_event_thaw(e);
296 evas_event_thaw_eval(e);
297 return efl_loop_future_rejected(obj, ENOMEM);
298 }
290 eina_value_array_append(&r, w); 299 eina_value_array_append(&r, w);
291 } 300 }
292 eina_iterator_free(models); 301 eina_iterator_free(models);
293 302
303 evas_event_thaw(e);
304 evas_event_thaw_eval(e);
305
294 return efl_loop_future_resolved(obj, r); 306 return efl_loop_future_resolved(obj, r);
295 } 307 }
296 308
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index c1f936c..ca3ab06 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -167,12 +167,6 @@
167# include "efl_ui_selection_manager.eo.h" 167# include "efl_ui_selection_manager.eo.h"
168# include "efl_datetime_manager.eo.h" 168# include "efl_datetime_manager.eo.h"
169 169
170//FIXME this needs to not use elm_general.h and go to Efl_Ui.h
171# include <elm_general.h>
172# include <efl_text_interactive.eo.h>
173# include <efl_ui_textbox.eo.h>
174# include <efl_ui_textbox_async.eo.h>
175
176extern const char *_efl_model_property_itemw; 170extern const char *_efl_model_property_itemw;
177extern const char *_efl_model_property_itemh; 171extern const char *_efl_model_property_itemh;
178extern const char *_efl_model_property_selfw; 172extern const char *_efl_model_property_selfw;
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 66e6032..9fd4d2b 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -23,6 +23,18 @@ static int event_freeze_count = 0;
23 23
24typedef struct _Eo_Callback_Description Eo_Callback_Description; 24typedef struct _Eo_Callback_Description Eo_Callback_Description;
25typedef struct _Efl_Event_Callback_Frame Efl_Event_Callback_Frame; 25typedef struct _Efl_Event_Callback_Frame Efl_Event_Callback_Frame;
26typedef struct _Efl_Event_Forwarder Efl_Event_Forwarder;
27
28struct _Efl_Event_Forwarder
29{
30 const Efl_Event_Description *desc;
31 Eo *source;
32 Eo *new_obj;
33
34 short priority;
35
36 Eina_Bool inserted : 1;
37};
26 38
27struct _Efl_Event_Callback_Frame 39struct _Efl_Event_Callback_Frame
28{ 40{
@@ -41,6 +53,7 @@ typedef struct
41 Eo ***wrefs; 53 Eo ***wrefs;
42 Eina_Hash *providers; 54 Eina_Hash *providers;
43 Eina_Hash *schedulers; 55 Eina_Hash *schedulers;
56 Eina_Hash *forwarders;
44} Efl_Object_Extension; 57} Efl_Object_Extension;
45 58
46#define EFL_OBJECT_EVENT_CALLBACK(Event) Eina_Bool event_cb_##Event : 1; 59#define EFL_OBJECT_EVENT_CALLBACK(Event) Eina_Bool event_cb_##Event : 1;
@@ -124,6 +137,8 @@ typedef struct
124 if ((pd)->event_frame) (pd)->event_frame = (pd)->event_frame->next; \ 137 if ((pd)->event_frame) (pd)->event_frame = (pd)->event_frame->next; \
125} while (0) 138} while (0)
126 139
140static void _efl_event_forwarder_callback(void *data, const Efl_Event *event);
141
127static int _eo_nostep_alloc = -1; 142static int _eo_nostep_alloc = -1;
128 143
129static void 144static void
@@ -162,7 +177,8 @@ _efl_object_extension_noneed(Efl_Object_Data *pd)
162 (ext->wrefs) || 177 (ext->wrefs) ||
163 (ext->composite_parent) || 178 (ext->composite_parent) ||
164 (ext->providers) || 179 (ext->providers) ||
165 (ext->schedulers)) return; 180 (ext->schedulers) ||
181 (ext->forwarders)) return;
166 _efl_object_extension_free(pd->ext); 182 _efl_object_extension_free(pd->ext);
167 pd->ext = NULL; 183 pd->ext = NULL;
168} 184}
@@ -172,6 +188,13 @@ _efl_object_invalidate(Eo *obj_id, Efl_Object_Data *pd)
172{ 188{
173 _efl_pending_futures_clear(pd); 189 _efl_pending_futures_clear(pd);
174 190
191 if (pd->ext && pd->ext->forwarders)
192 {
193 eina_hash_free(pd->ext->forwarders);
194 pd->ext->forwarders = NULL;
195 _efl_object_extension_noneed(pd);
196 }
197
175 if (pd->ext && pd->ext->providers) 198 if (pd->ext && pd->ext->providers)
176 { 199 {
177 eina_hash_free(pd->ext->providers); 200 eina_hash_free(pd->ext->providers);
@@ -1282,6 +1305,24 @@ _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, const Efl_Callback_Arr
1282 EO_OBJ_DONE(obj_id); 1305 EO_OBJ_DONE(obj_id);
1283 } 1306 }
1284 1307
1308 if (pd->ext && pd->ext->forwarders)
1309 {
1310 Efl_Event_Forwarder *forwarder;
1311 Eina_List *l;
1312
1313 // Check if some event need to be forwarded now
1314 EINA_LIST_FOREACH(eina_hash_find(pd->ext->forwarders, it->desc), l, forwarder)
1315 {
1316 if (!forwarder->source) continue;
1317 if (forwarder->inserted) continue;
1318 efl_event_callback_priority_add(forwarder->source,
1319 forwarder->desc,
1320 forwarder->priority,
1321 _efl_event_forwarder_callback, obj_id);
1322 forwarder->inserted = EINA_TRUE;
1323 }
1324 }
1325
1285 if (update_hash) 1326 if (update_hash)
1286 { 1327 {
1287 unsigned char event_hash; 1328 unsigned char event_hash;
@@ -2193,6 +2234,27 @@ _efl_event_forwarder_callback(void *data, const Efl_Event *event)
2193 } 2234 }
2194} 2235}
2195 2236
2237static void
2238_forwarders_list_clean(void *data)
2239{
2240 Efl_Event_Forwarder *forwarder;
2241 Eina_List *l = data;
2242
2243 EINA_LIST_FREE(l, forwarder)
2244 {
2245 if (forwarder->source)
2246 {
2247 if (forwarder->inserted)
2248 efl_event_callback_del(forwarder->source,
2249 forwarder->desc,
2250 _efl_event_forwarder_callback,
2251 forwarder->new_obj);
2252 efl_wref_del(forwarder->source, &forwarder->source);
2253 }
2254 free(forwarder);
2255 }
2256}
2257
2196EOLIAN static void 2258EOLIAN static void
2197_efl_object_event_callback_forwarder_priority_add(Eo *obj, Efl_Object_Data *pd EINA_UNUSED, 2259_efl_object_event_callback_forwarder_priority_add(Eo *obj, Efl_Object_Data *pd EINA_UNUSED,
2198 const Efl_Event_Description *desc, 2260 const Efl_Event_Description *desc,
@@ -2201,8 +2263,50 @@ _efl_object_event_callback_forwarder_priority_add(Eo *obj, Efl_Object_Data *pd E
2201{ 2263{
2202 EO_OBJ_POINTER_RETURN(new_obj, new_data); 2264 EO_OBJ_POINTER_RETURN(new_obj, new_data);
2203 EO_OBJ_DONE(new_obj); 2265 EO_OBJ_DONE(new_obj);
2266 Efl_Event_Forwarder *forwarder;
2267 Efl_Object_Extension *ext;
2268 Efl_Object_Data *dpd;
2269 Eina_List *l;
2270
2271 dpd = efl_data_scope_safe_get(new_obj, EFL_OBJECT_CLASS);
2272 EINA_SAFETY_ON_NULL_RETURN(dpd);
2273
2274 ext = _efl_object_extension_need(dpd);
2275 EINA_SAFETY_ON_NULL_RETURN(ext);
2276
2277 // Prevent double insertion for the same object source and event description
2278 EINA_LIST_FOREACH(eina_hash_find(ext->forwarders, desc), l, forwarder)
2279 {
2280 if (forwarder->desc == desc &&
2281 forwarder->new_obj == new_obj &&
2282 forwarder->source == obj)
2283 {
2284 ERR("Forwarder added on '%s' for event '%s' toward '%s' has already been set.\n",
2285 efl_debug_name_get(obj), desc->name, efl_debug_name_get(new_obj));
2286 return;
2287 }
2288 }
2289