From 478863862a4e669e652d2e6ed9b7204b39503a08 Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Fri, 17 Jan 2020 15:06:18 +0900 Subject: [PATCH 01/15] efl_text_cursor: correct class description name of simple class Summary: Name of `Efl_Class_Description` should be eo-style class name. Please check there is no segmentation fault on Test code below. Thanks to @woohyun for reporting and test case. Test Plan: ``` //mcs test.cs -out:test.exe `pkg-config --libs efl-mono` using System; class Program { public static void Main() { Efl.All.Init(Efl.Csharp.Components.Ui); Efl.Ui.Win win = new Efl.Ui.Win(null); Efl.Ui.Box box = new Efl.Ui.Box(win); Efl.Ui.Textbox tb = new Efl.Ui.Textbox(win); Efl.Ui.Button btn = new Efl.Ui.Button(box); btn.Text = "Click Me!"; btn.ClickedEvent += (s, e) => { Efl.Text.Cursor cur1, cur2; tb.GetSelectionCursors(out cur1, out cur2); cur1.SetPosition(3); cur2.SetPosition(7); }; box.Pack(btn); box.Pack(tb); win.SetContent(box); win.SetSize(new Eina.Size2D(200, 400)); Efl.Ui.Config.Run(); Efl.All.Shutdown(); } } ``` Reviewers: woohyun, ali.alzyod, bu5hm4n Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers, woohyun Tags: #efl Differential Revision: https://phab.enlightenment.org/D11115 --- src/lib/evas/canvas/efl_text_cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/efl_text_cursor.c b/src/lib/evas/canvas/efl_text_cursor.c index c0a6c627d9..0a19a3b281 100644 --- a/src/lib/evas/canvas/efl_text_cursor.c +++ b/src/lib/evas/canvas/efl_text_cursor.c @@ -21,7 +21,7 @@ struct _Evas_Textblock_Selection_Iterator typedef struct _Evas_Textblock_Selection_Iterator Evas_Textblock_Selection_Iterator; -EFL_CLASS_SIMPLE_CLASS(efl_text_cursor, "efl_text_cursor", EFL_TEXT_CURSOR_CLASS) +EFL_CLASS_SIMPLE_CLASS(efl_text_cursor, "Efl.Text.Cursor", EFL_TEXT_CURSOR_CLASS) EOLIAN static void _efl_text_cursor_position_set(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, int position) From a0523ebba577a02b8b4e84acb5e0805223a85f2d Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Fri, 17 Jan 2020 12:56:51 +0100 Subject: [PATCH 02/15] docs: Typo in Efl.Text_Cursor --- src/lib/evas/canvas/efl_text_cursor.eo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/efl_text_cursor.eo b/src/lib/evas/canvas/efl_text_cursor.eo index e63e080b78..9b90854a23 100644 --- a/src/lib/evas/canvas/efl_text_cursor.eo +++ b/src/lib/evas/canvas/efl_text_cursor.eo @@ -190,7 +190,7 @@ abstract @beta Efl.Text.Cursor extends Efl.Object implements Efl.Duplicate{ cur2: Efl.Text.Cursor; [[End of range.]] } return: iterator @move; [[ - Iterator on all geoemtries of the given range.]] + Iterator on all geometries of the given range.]] } range_precise_geometry_get { From cf45cbf6dd918b9e5af40f88cc948e9337c72fef Mon Sep 17 00:00:00 2001 From: ali Date: Fri, 17 Jan 2020 08:20:14 +0000 Subject: [PATCH 03/15] efl: correct class description name of simple class Name of Efl_Class_Description should be eo-style class name. related to D11115 Reviewed-by: YeongJong Lee Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11117 --- src/tests/elementary/efl_ui_suite.c | 2 +- src/tests/elementary/efl_ui_test_spotlight.c | 4 ++-- src/tests/elementary/spec/efl_ui_spec_suite.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c index 4eef980f92..b9d8e9bbff 100644 --- a/src/tests/elementary/efl_ui_suite.c +++ b/src/tests/elementary/efl_ui_suite.c @@ -49,7 +49,7 @@ static const Efl_Test_Case etc[] = { { NULL, NULL } }; -EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS); +EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "Efl.Ui.Widget", EFL_UI_WIDGET_CLASS); int main(int argc, char **argv) diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c index 9d5f433e44..f4e39ffdf0 100644 --- a/src/tests/elementary/efl_ui_test_spotlight.c +++ b/src/tests/elementary/efl_ui_test_spotlight.c @@ -6,8 +6,8 @@ #include "efl_ui_suite.h" #include "eo_internal.h" -EFL_CLASS_SIMPLE_CLASS(efl_ui_spotlight_manager, "efl_ui_spotlight_manager", EFL_UI_SPOTLIGHT_MANAGER_CLASS); -EFL_CLASS_SIMPLE_CLASS(efl_ui_spotlight_indicator, "efl_ui_spotlight_indicator", EFL_UI_SPOTLIGHT_INDICATOR_CLASS); +EFL_CLASS_SIMPLE_CLASS(efl_ui_spotlight_manager, "Efl.Ui.Spotlight.Manager", EFL_UI_SPOTLIGHT_MANAGER_CLASS); +EFL_CLASS_SIMPLE_CLASS(efl_ui_spotlight_indicator, "Efl.Ui.Spotlight.Indicator", EFL_UI_SPOTLIGHT_INDICATOR_CLASS); static Efl_Ui_Win *win; static Efl_Ui_Spotlight_Container *container; diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c index d59072b51e..49ca5a993f 100644 --- a/src/tests/elementary/spec/efl_ui_spec_suite.c +++ b/src/tests/elementary/spec/efl_ui_spec_suite.c @@ -13,8 +13,8 @@ Evas_Object *widget = NULL; Eo *collection_grid = NULL; const Efl_Class *test_content_klass = NULL; const Efl_Class *widget_klass = NULL; -EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS); -EFL_CLASS_SIMPLE_CLASS(efl_ui_item, "efl_ui_item", EFL_UI_ITEM_CLASS); +EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "Efl.Ui.Widget", EFL_UI_WIDGET_CLASS); +EFL_CLASS_SIMPLE_CLASS(efl_ui_item, "Efl.Ui.Item", EFL_UI_ITEM_CLASS); #define EFL_UI_ITEM_REALIZED_CLASS efl_ui_item_realized_class_get() From 4250494f11dc53f86f8364ec21fa26ea1f7ae9d2 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 17 Jan 2020 09:49:13 -0500 Subject: [PATCH 04/15] efl_ui_suite: fix test code of grid Summary: this test code seemed buggy, we used the iterator *after* the content was changed. Additionally, we freed the iterator with free instead of eina_iterator_free. This fixes test test suite. Depends on D11123 Reviewers: raster, zmike, cedric, segfaultxavi Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11124 --- src/tests/elementary/efl_ui_test_grid.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tests/elementary/efl_ui_test_grid.c b/src/tests/elementary/efl_ui_test_grid.c index 7ec1763545..db19e58d87 100644 --- a/src/tests/elementary/efl_ui_test_grid.c +++ b/src/tests/elementary/efl_ui_test_grid.c @@ -89,16 +89,15 @@ EFL_START_TEST(efl_ui_grid_unpack_all) ck_assert(grid_item_pack(grid, count_before, NULL) != EINA_FALSE); - itor = efl_content_iterate(grid); efl_pack_unpack_all(grid); count = efl_content_count(grid); ck_assert(count == 0); + itor = efl_content_iterate(grid); EINA_ITERATOR_FOREACH(itor, item) - efl_del(item); - - free(itor); + ck_assert(EINA_FALSE); + eina_iterator_free(itor); } EFL_END_TEST From 25e52f81066b79fdf758cbd97830a85fdb88c0a9 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Fri, 17 Jan 2020 09:51:24 -0500 Subject: [PATCH 05/15] C++: Fix use of @c_type tag in struct definition Summary: Depends on D11090 Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11099 --- src/lib/eolian_cxx/grammar/type_impl.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp b/src/lib/eolian_cxx/grammar/type_impl.hpp index 29d28857f9..b43641a052 100644 --- a/src/lib/eolian_cxx/grammar/type_impl.hpp +++ b/src/lib/eolian_cxx/grammar/type_impl.hpp @@ -283,7 +283,14 @@ struct visitor_generate } else { - if(as_generator + if(regular.type_type == attributes::typedecl_type::struct_ + || regular.type_type == attributes::typedecl_type::struct_opaque) + { + std::copy (c_type.begin(), c_type.end(), sink); + return true; + } + else + if(as_generator ( *(string << "_") << string From bac185e8f3ed5a17d9c29e5daf2e2038b6734767 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 17 Jan 2020 16:06:52 +0100 Subject: [PATCH 06/15] Introduce Separator Summary: this is just like elm_separator, just written for unified widgets. This inherits from item, which has the advantage that this separator can also be added into item container. Reviewers: zmike, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11125 --- data/elementary/themes/default.edc | 1 + data/elementary/themes/edc/efl/separator.edc | 29 ++++++++++++ src/bin/elementary/meson.build | 1 + src/bin/elementary/test.c | 3 +- src/bin/elementary/test_ui_separator.c | 26 +++++++++++ src/lib/elementary/Efl_Ui.h | 1 + src/lib/elementary/efl_ui_separator.c | 46 ++++++++++++++++++++ src/lib/elementary/efl_ui_separator.eo | 20 +++++++++ src/lib/elementary/meson.build | 4 +- src/tests/elementary/spec/efl_test_basics.c | 3 +- 10 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 data/elementary/themes/edc/efl/separator.edc create mode 100644 src/bin/elementary/test_ui_separator.c create mode 100644 src/lib/elementary/efl_ui_separator.c create mode 100644 src/lib/elementary/efl_ui_separator.eo diff --git a/data/elementary/themes/default.edc b/data/elementary/themes/default.edc index 315a5e7ca3..47d8e6c7c0 100644 --- a/data/elementary/themes/default.edc +++ b/data/elementary/themes/default.edc @@ -209,4 +209,5 @@ collections { #include "edc/efl/tab_page.edc" #include "edc/efl/collection.edc" #include "edc/efl/group_item.edc" +#include "edc/efl/separator.edc" } diff --git a/data/elementary/themes/edc/efl/separator.edc b/data/elementary/themes/edc/efl/separator.edc new file mode 100644 index 0000000000..5107bfabff --- /dev/null +++ b/data/elementary/themes/edc/efl/separator.edc @@ -0,0 +1,29 @@ +group { name: "efl/separator/horizontal"; + data.item: "version" "124"; + images.image: "bevel_dark_in.png" COMP; + parts { + part { name: "base"; + description { state: "default" 0.0; + min: 2 2; + max: 99999 2; + rel1.offset: 4 4; + rel2.offset: -5 -5; + image.normal: "bevel_dark_in.png"; + image.border: 2 2 2 2; + fill.smooth: 0; + } + } + } +} +group { name: "efl/separator/vertical"; + data.item: "version" "124"; + inherit: "efl/separator/horizontal"; + parts { + part { name: "base"; + description { state: "default" 0.0; + max: 2 99999; + } + } + } +} + diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build index 2195ded204..7eddf03b48 100644 --- a/src/bin/elementary/meson.build +++ b/src/bin/elementary/meson.build @@ -161,6 +161,7 @@ elementary_test_src = [ 'test_ui_collection_view.c', 'test_ui_items.c', 'test_ui_frame.c', + 'test_ui_separator.c', 'test_efl_ui_vg_animation.c', 'test_efl_gfx_vg_value_provider.c', 'test.h' diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 94b4b3df91..b86505a370 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -409,6 +409,7 @@ void test_ui_frame(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e void test_efl_ui_vg_animation(void *data, Evas_Object *obj, void *event_info); void test_efl_gfx_vg_value_provider(void *data, Evas_Object *obj, void *event_info); +void test_ui_separator(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED); static void _list_udpate(void); @@ -1151,7 +1152,7 @@ add_tests: // FIXME: add frame test ADD_TEST(NULL, "Boundaries", "Bubble", test_bubble); ADD_TEST(NULL, "Boundaries", "Separator", test_separator); - + ADD_TEST_EO(NULL, "Boundaries", "Separator", test_ui_separator); //------------------------------// ADD_TEST(NULL, "Range Values", "Spinner", test_spinner); ADD_TEST_EO(NULL, "Range Values", "Efl.Ui.Spin", test_ui_spin); diff --git a/src/bin/elementary/test_ui_separator.c b/src/bin/elementary/test_ui_separator.c new file mode 100644 index 0000000000..d30afd3a12 --- /dev/null +++ b/src/bin/elementary/test_ui_separator.c @@ -0,0 +1,26 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#include + +void +test_ui_separator(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Eo *win, *table, *sep; + + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_text_set(efl_added, "Efl.Ui.Separator"), + efl_ui_win_autodel_set(efl_added, EINA_TRUE)); + + table = efl_add(EFL_UI_TABLE_CLASS, win); + efl_content_set(win, table); + + sep = efl_add(EFL_UI_SEPARATOR_CLASS, win); + efl_pack_table(table, sep, 0, 0, 2, 1); + + sep = efl_add(EFL_UI_SEPARATOR_CLASS, win, + efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL)); + efl_pack_table(table, sep, 0, 0, 2, 1); + + efl_gfx_entity_size_set(win, EINA_SIZE2D(100, 120)); +} diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 2fe6b95961..4ec831f2a2 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -328,6 +328,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator; # include # include # include +# include /** * Initialize Elementary diff --git a/src/lib/elementary/efl_ui_separator.c b/src/lib/elementary/efl_ui_separator.c new file mode 100644 index 0000000000..887cfb3c40 --- /dev/null +++ b/src/lib/elementary/efl_ui_separator.c @@ -0,0 +1,46 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include "elm_priv.h" + +typedef struct { + Efl_Ui_Layout_Orientation dir; +} Efl_Ui_Separator_Data; + +#define MY_CLASS EFL_UI_SEPARATOR_CLASS + + +EOLIAN static Efl_Object* +_efl_ui_separator_efl_object_constructor(Eo *obj, Efl_Ui_Separator_Data *pd EINA_UNUSED) +{ + if (!elm_widget_theme_klass_get(obj)) + elm_widget_theme_klass_set(obj, "separator"); + return efl_constructor(efl_super(obj, MY_CLASS)); +} + +EOLIAN static void +_efl_ui_separator_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_Separator_Data *pd, Efl_Ui_Layout_Orientation dir) +{ + pd->dir = dir; +} + +EOLIAN static Efl_Ui_Layout_Orientation +_efl_ui_separator_efl_ui_layout_orientable_orientation_get(const Eo *ob EINA_UNUSED, Efl_Ui_Separator_Data *pd) +{ + return pd->dir; +} + +EOLIAN static Eina_Error +_efl_ui_separator_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Separator_Data *pd) +{ + if (efl_ui_layout_orientation_is_horizontal(pd->dir, EINA_TRUE)) + elm_widget_theme_element_set(obj, "horizontal"); + else + elm_widget_theme_element_set(obj, "vertical"); + return efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); +} + + +#include "efl_ui_separator.eo.c" diff --git a/src/lib/elementary/efl_ui_separator.eo b/src/lib/elementary/efl_ui_separator.eo new file mode 100644 index 0000000000..9dd0ef4491 --- /dev/null +++ b/src/lib/elementary/efl_ui_separator.eo @@ -0,0 +1,20 @@ +class Efl.Ui.Separator extends Efl.Ui.Item implements Efl.Ui.Layout_Orientable +{ + [[Vertical or horizontal separator line. + + Use it to separate groups of buttons in a toolbar, for example, or items on a list. + The length of the line adapts to the size of the container, and its width is + controlled by the theme. + + @since 1.24 + ]] + + implements { + Efl.Object.constructor; + Efl.Ui.Widget.theme_apply; + Efl.Ui.Layout_Orientable.orientation { get; set; } + } + constructors { + Efl.Ui.Layout_Orientable.orientation; + } +} diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 3ca7b935c6..6606f084de 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -189,6 +189,7 @@ pub_eo_files = [ 'efl_ui_grid_view.eo', 'efl_ui_pager.eo', 'efl_ui_stack.eo', + 'efl_ui_separator.eo' ] foreach eo_file : pub_eo_files @@ -945,7 +946,8 @@ elementary_src = [ 'efl_ui_view_model.c', 'efl_ui_collection_view.c', 'efl_ui_pager.c', - 'efl_ui_stack.c' + 'efl_ui_stack.c', + 'efl_ui_separator.c' ] elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, efreet_mime, efreet_trash, eio, atspi, dl, intl] diff --git a/src/tests/elementary/spec/efl_test_basics.c b/src/tests/elementary/spec/efl_test_basics.c index 81f134af33..2774b2ae8f 100644 --- a/src/tests/elementary/spec/efl_test_basics.c +++ b/src/tests/elementary/spec/efl_test_basics.c @@ -49,7 +49,8 @@ "Efl.Ui.Table", "Efl.Ui.Flip", "Efl.Ui.Stack", - "Efl.Ui.Pager" + "Efl.Ui.Pager", + "Efl.Ui.Separator" ], "custom-mapping" : { "Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS", From fbb77e7d1c3116f4187370ec9406755f38cf44be Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Fri, 10 Jan 2020 09:26:32 +0000 Subject: [PATCH 07/15] efl_ui_scrollbar: change scrollbar state when theme is reloaded. Scrollbar visible state is not synchronized when theme is reloaded. Differential Revision: https://phab.enlightenment.org/D10649 --- src/lib/efl/interfaces/efl_ui_scrollbar.eo | 12 +++++ src/lib/elementary/efl_ui_scroll_manager.c | 7 +++ src/lib/elementary/efl_ui_scroll_manager.eo | 1 + src/lib/elementary/efl_ui_scroll_util.c | 14 +++++ .../elementary/efl_ui_test_list_collection.c | 4 +- src/tests/elementary/efl_ui_test_scroller.c | 51 +++++++++++++++++++ 6 files changed, 87 insertions(+), 2 deletions(-) diff --git a/src/lib/efl/interfaces/efl_ui_scrollbar.eo b/src/lib/efl/interfaces/efl_ui_scrollbar.eo index 5741df6b8f..3b4696f00b 100644 --- a/src/lib/efl/interfaces/efl_ui_scrollbar.eo +++ b/src/lib/efl/interfaces/efl_ui_scrollbar.eo @@ -60,6 +60,18 @@ interface Efl.Ui.Scrollbar and $[1.0] (the bottom side of the thumb is touching the bottom edge of the widget).]] } } + @property bar_visibility { + [[Current visibility state of the scrollbars. + This is useful in @Efl.Ui.Scrollbar_Mode.auto mode where EFL decides if the scrollbars + are shown or hidden. See also the @[.bar,show] and @[.bar,hide] events. + ]] + get { + } + values { + hbar: bool; [[Whether the horizontal scrollbar is currently visible.]] + vbar: bool; [[Whether the vertical scrollbar is currently visible.]] + } + } bar_visibility_update @protected @beta{ [[Update bar visibility. diff --git a/src/lib/elementary/efl_ui_scroll_manager.c b/src/lib/elementary/efl_ui_scroll_manager.c index 3d332e94fb..650a726bc1 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.c +++ b/src/lib/elementary/efl_ui_scroll_manager.c @@ -2187,6 +2187,13 @@ _efl_ui_scrollbar_v_visibility_adjust(Eo *obj) if (scroll_v_vis_change) _efl_ui_scroll_manager_scrollbar_v_visibility_apply(sd); } +EOLIAN static void +_efl_ui_scroll_manager_efl_ui_scrollbar_bar_visibility_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, Eina_Bool *hbar, Eina_Bool *vbar) +{ + if (hbar) *hbar = sd->hbar_visible; + if (vbar) *vbar = sd->vbar_visible; +} + EOLIAN static void _efl_ui_scroll_manager_efl_ui_scrollbar_bar_visibility_update(Eo *obj, Efl_Ui_Scroll_Manager_Data *sd EINA_UNUSED) { diff --git a/src/lib/elementary/efl_ui_scroll_manager.eo b/src/lib/elementary/efl_ui_scroll_manager.eo index 957a4f4d4d..9dcd9f8a88 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.eo +++ b/src/lib/elementary/efl_ui_scroll_manager.eo @@ -39,6 +39,7 @@ class @beta Efl.Ui.Scroll.Manager extends Efl.Object implements Efl.Ui.Scrollbar.bar_mode { get; set; } Efl.Ui.Scrollbar.bar_size { get; } Efl.Ui.Scrollbar.bar_position { get; set; } + Efl.Ui.Scrollbar.bar_visibility { get; } Efl.Ui.Scrollbar.bar_visibility_update; Efl.Ui.Scrollable.scroll; } diff --git a/src/lib/elementary/efl_ui_scroll_util.c b/src/lib/elementary/efl_ui_scroll_util.c index 673cac2eae..6a7378e3b4 100644 --- a/src/lib/elementary/efl_ui_scroll_util.c +++ b/src/lib/elementary/efl_ui_scroll_util.c @@ -38,6 +38,20 @@ _scroll_connector_reload_cb(void *data, const char *source EINA_UNUSED) { Scroll_Connector_Context *ctx = data; + ELM_WIDGET_DATA_GET_OR_RETURN(ctx->obj, wd); + Eina_Bool hbar_visible = EINA_FALSE, vbar_visible = EINA_FALSE; + + efl_ui_scrollbar_bar_visibility_get(ctx->smanager, &hbar_visible, &vbar_visible); + + if (hbar_visible) + efl_layout_signal_emit(wd->resize_obj, "efl,horizontal_bar,visible,on", "efl"); + else + efl_layout_signal_emit(wd->resize_obj, "efl,horizontal_bar,visible,off", "efl"); + + if (vbar_visible) + efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,on", "efl"); + else + efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,off", "efl"); efl_ui_scrollbar_bar_visibility_update(ctx->smanager); } diff --git a/src/tests/elementary/efl_ui_test_list_collection.c b/src/tests/elementary/efl_ui_test_list_collection.c index 1d4f913901..94bafbd010 100644 --- a/src/tests/elementary/efl_ui_test_list_collection.c +++ b/src/tests/elementary/efl_ui_test_list_collection.c @@ -161,7 +161,7 @@ EFL_START_TEST(placement_test_group) r = efl_gfx_entity_geometry_get(core_item[i]); ck_assert_int_eq(r.x, 1); - ck_assert_int_eq(r.y, 21+(i - 1)*40); + ck_assert_int_eq(r.y, 22+(i - 1)*40); ck_assert_int_eq(r.w, 183); // 200 - 2px border - X for the width of the scrollbar. ck_assert_int_eq(r.h, 40); } @@ -181,7 +181,7 @@ EFL_START_TEST(placement_test_group) r = efl_gfx_entity_geometry_get(core_item[i]); ck_assert_int_eq(r.x, 1); - ck_assert_int_eq(r.y, 1+(i-2)*40); + ck_assert_int_eq(r.y, 2+(i-2)*40); ck_assert_int_eq(r.w, 183); // 200 - 2px border - X for the width of the scrollbar. ck_assert_int_eq(r.h, 40); } diff --git a/src/tests/elementary/efl_ui_test_scroller.c b/src/tests/elementary/efl_ui_test_scroller.c index e1aa4ef53b..78f8bfaf7f 100644 --- a/src/tests/elementary/efl_ui_test_scroller.c +++ b/src/tests/elementary/efl_ui_test_scroller.c @@ -144,7 +144,58 @@ EFL_START_TEST(efl_ui_test_scroller_events) } EFL_END_TEST +EFL_START_TEST(efl_ui_test_scroller_scrollbar) +{ + Eo *sc; + + Eo *win = win_add(); + Eina_Bool hbar_visible = EINA_FALSE, vbar_visible = EINA_FALSE; + efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500)); + + sc = efl_add(EFL_UI_SCROLLER_CLASS, win, + efl_ui_scrollbar_bar_mode_set(efl_added, EFL_UI_SCROLLBAR_MODE_AUTO, EFL_UI_SCROLLBAR_MODE_AUTO), + efl_content_set(win, efl_added)); + + /*Scrollbar auto mode test.*/ + efl_loop_iterate(efl_main_loop_get()); + + efl_ui_scrollbar_bar_visibility_get(sc, &hbar_visible, &vbar_visible); + ck_assert(hbar_visible == EINA_FALSE); + ck_assert(vbar_visible == EINA_FALSE); + + /*Scrollbar auto mode test.*/ + efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_object_evas_get(sc), + efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(5000, 5000)), + efl_content_set(sc, efl_added)); + + efl_loop_iterate(efl_main_loop_get()); + + efl_ui_scrollbar_bar_visibility_get(sc, &hbar_visible, &vbar_visible); + ck_assert(hbar_visible == EINA_TRUE); + ck_assert(vbar_visible == EINA_TRUE); + + /*Scrollbar off mode test.*/ + efl_ui_scrollbar_bar_mode_set(sc, EFL_UI_SCROLLBAR_MODE_OFF, EFL_UI_SCROLLBAR_MODE_OFF); + + efl_loop_iterate(efl_main_loop_get()); + + efl_ui_scrollbar_bar_visibility_get(sc, &hbar_visible, &vbar_visible); + ck_assert(hbar_visible == EINA_FALSE); + ck_assert(vbar_visible == EINA_FALSE); + + /*Scrollbar on mode test.*/ + efl_ui_scrollbar_bar_mode_set(sc, EFL_UI_SCROLLBAR_MODE_ON, EFL_UI_SCROLLBAR_MODE_ON); + + efl_loop_iterate(efl_main_loop_get()); + + efl_ui_scrollbar_bar_visibility_get(sc, &hbar_visible, &vbar_visible); + ck_assert(hbar_visible == EINA_TRUE); + ck_assert(vbar_visible == EINA_TRUE); +} +EFL_END_TEST + void efl_ui_test_scroller(TCase *tc) { tcase_add_test(tc, efl_ui_test_scroller_events); + tcase_add_test(tc, efl_ui_test_scroller_scrollbar); } From 3aa250e17ff34a1b0466b65fe55ffe1fced291ff Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 17 Jan 2020 12:14:11 +0000 Subject: [PATCH 08/15] evas - fix access-after-free where during destroy hash item not cleared leave it in the hash unfreed as it will be freed when the hash is soon after durint destruction. @fix --- src/lib/evas/canvas/evas_device.c | 6 ++++-- src/lib/evas/canvas/evas_main.c | 4 ++-- src/lib/evas/include/evas_private.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c index 112132574d..10e98fef44 100644 --- a/src/lib/evas/canvas/evas_device.c +++ b/src/lib/evas/canvas/evas_device.c @@ -108,7 +108,9 @@ _del_cb(void *data, const Efl_Event *ev) } if (devtype == EFL_INPUT_DEVICE_TYPE_MOUSE) - _evas_pointer_data_remove(e, ev->object); + { + _evas_pointer_data_remove(e, ev->object, EINA_TRUE); + } eina_hash_del_by_key(e->locks.masks, &ev->object); eina_hash_del_by_key(e->modifiers.masks, &ev->object); efl_event_callback_call(e->evas, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED, @@ -363,7 +365,7 @@ evas_device_class_set(Evas_Device *dev, Evas_Device_Class clas) return; if (_is_pointer(klass)) - _evas_pointer_data_remove(edata, dev); + _evas_pointer_data_remove(edata, dev, EINA_FALSE); efl_input_device_type_set(dev, clas); diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index 86a7881473..b64f8724ae 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c @@ -1480,7 +1480,7 @@ _evas_pointer_data_add(Evas_Public_Data *edata, Evas_Device *pointer) } void -_evas_pointer_data_remove(Evas_Public_Data *edata, Evas_Device *pointer) +_evas_pointer_data_remove(Evas_Public_Data *edata, Evas_Device *pointer, Eina_Bool nofree) { Evas_Pointer_Data *pdata; Evas_Pointer_Seat *pseat; @@ -1492,7 +1492,7 @@ _evas_pointer_data_remove(Evas_Public_Data *edata, Evas_Device *pointer) if (pdata->pointer == pointer) { pseat->pointers = eina_inlist_remove(pseat->pointers, EINA_INLIST_GET(pdata)); - free(pdata); + if (!nofree) free(pdata); hit = pseat; break; } diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index e57910f930..51f4ce22bd 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1935,7 +1935,7 @@ void _evas_focus_dispatch_event(Evas_Object_Protected_Data *obj, Efl_Input_Device *seat, Eina_Bool in); Evas_Pointer_Data *_evas_pointer_data_by_device_get(Evas_Public_Data *edata, Efl_Input_Device *pointer); Evas_Pointer_Data *_evas_pointer_data_add(Evas_Public_Data *edata, Efl_Input_Device *pointer); -void _evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer); +void _evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer, Eina_Bool nofree); Eina_List *_evas_pointer_list_in_rect_get(Evas_Public_Data *edata, Evas_Object *obj, Evas_Object_Protected_Data *obj_data, From 444f7eed01a23e0cc3c20cd2e6a201cc684b6108 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 17 Jan 2020 13:09:29 +0000 Subject: [PATCH 09/15] elm - fix filesel deferred unref to not crash @fix --- src/lib/elementary/elc_fileselector_entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/elc_fileselector_entry.c b/src/lib/elementary/elc_fileselector_entry.c index 52d901ba9b..632f17385b 100644 --- a/src/lib/elementary/elc_fileselector_entry.c +++ b/src/lib/elementary/elc_fileselector_entry.c @@ -450,7 +450,7 @@ _elm_fileselector_entry_efl_ui_view_model_get(const Eo *obj, Elm_Fileselector_En ret = efl_add_ref(efl_class_get(bmodel), (Eo*) obj, efl_io_model_path_set(efl_added, sd->path), efl_loop_model_volatile_make(efl_added)); - eina_freeq_ptr_add(postponed_fq, ret, EINA_FREE_CB(efl_unref), sizeof (void*)); + eina_freeq_ptr_add(postponed_fq, ret, EINA_FREE_CB(efl_unref), 0); return ret; } From 28aa1a65b695362d2ae8f5caf905f6d3c0fd663e Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 17 Jan 2020 22:23:25 +0000 Subject: [PATCH 10/15] ecore_con - freebsd bind blocking workaround this is to try do a workaround a hard to reproduce blocking bind on some freebsd systems (i can't repro it on my fbsd vm), so try use file locks as an extra barrier and hope they do the right thing without other mysterious problems. @fix --- src/lib/ecore_con/efl_net_server_unix.c | 77 ++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c index ed8735fb0b..226d557c29 100644 --- a/src/lib/ecore_con/efl_net_server_unix.c +++ b/src/lib/ecore_con/efl_net_server_unix.c @@ -18,6 +18,26 @@ #include #endif +// BSD workaround - unable to reproduce.... but we seem to +// get a blocking bind here if 2 processes fight over the same +// socket where one of them loses out by sitting here and +// blockign forever - as i can't reproduce in the freebsd vm +// i have, so i'm limited in what to do so this is a +// workaround to try mitigate this +#if defined (__FreeBSD__) +# define BIND_HANG_WORKAROUND 1 +#else +// only need on freebsd +//# define BIND_HANG_WORKAROUND 1 +#endif + +#ifdef BIND_HANG_WORKAROUND +# include +# include +# include +# include +#endif + /* no include EVIL as it's not supposed to be compiled on Windows */ #define MY_CLASS EFL_NET_SERVER_UNIX_CLASS @@ -29,6 +49,52 @@ typedef struct _Efl_Net_Server_Unix_Data Eina_Bool unlink_before_bind; } Efl_Net_Server_Unix_Data; +#ifdef BIND_HANG_WORKAROUND +static Eina_Error +_efl_net_server_unix_bind_hang_lock_workaround(const char *address, Eina_Bool lock) +{ + size_t addrlen; + char *lockfile; + int lockfile_fd, ret; + Eina_Error err = 0; + + if (strncmp(address, "abstract:", strlen("abstract:")) == 0) return err; + + addrlen = strlen(address); + lockfile = malloc(addrlen + 1 + 5); + if (!lockfile) return err; + + strcpy(lockfile, address); + strncpy(lockfile + addrlen, ".lock", 6); +#ifdef HAVE_OPEN_CLOEXEC + lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, + S_IRUSR | S_IWUSR); + if (lockfile_fd < 0) return err; +#else + lockfile_fd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR); + if (lockfile_fd < 0) return err; + eina_file_close_on_exec(lockfile_fd, EINA_TRUE); +#endif + + errno = 0; + if (lock) + { + ret = flock(lockfile_fd, LOCK_EX | LOCK_NB); + if ((ret != 0) && (errno == EWOULDBLOCK)) + err = EADDRINUSE; + } + else + { + flock(lockfile_fd, LOCK_UN | LOCK_NB); + unlink(lockfile); + } + close(lockfile_fd); + free(lockfile); + return err; +} +#endif + EOLIAN static void _efl_net_server_unix_efl_object_destructor(Eo *o, Efl_Net_Server_Unix_Data *pd EINA_UNUSED) { @@ -38,7 +104,12 @@ _efl_net_server_unix_efl_object_destructor(Eo *o, Efl_Net_Server_Unix_Data *pd E { const char *address = efl_net_server_address_get(o); if ((address) && (strncmp(address, "abstract:", strlen("abstract:")) != 0)) - unlink(address); + { + unlink(address); +#ifdef BIND_HANG_WORKAROUND + _efl_net_server_unix_bind_hang_lock_workaround(address, EINA_FALSE); +#endif + } } efl_destructor(efl_super(o, MY_CLASS)); @@ -101,6 +172,10 @@ _efl_net_server_unix_bind(Eo *o, Efl_Net_Server_Unix_Data *pd) unlink(addr.sun_path); } +#ifdef BIND_HANG_WORKAROUND + if (_efl_net_server_unix_bind_hang_lock_workaround(address, EINA_TRUE)) + goto error; +#endif r = bind(fd, (struct sockaddr *)&addr, addrlen); if (r != 0) { From de4a698c9674422cfa1e633197ee80b4b0e72aef Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 17 Jan 2020 22:24:26 +0000 Subject: [PATCH 11/15] elm win + ecore evas - fix csd stuff like base size and min sizing this fixes a lot that was broken with csd... but not everything. @fix --- src/lib/elementary/efl_ui_win.c | 28 +++++++-- .../wayland/ecore_evas_wayland_common.c | 58 ++++++++++--------- .../ecore_evas/engines/x/ecore_evas_x.c | 20 +++++-- 3 files changed, 66 insertions(+), 40 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index e6fb0191b4..7ca87e9359 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -210,6 +210,7 @@ struct _Efl_Ui_Win_Data int norender; int modal_count; int response; + int ignore_frame_resize; Eina_Bool req_wh : 1; Eina_Bool req_xy : 1; @@ -1558,16 +1559,25 @@ _elm_win_frame_geometry_adjust(Efl_Ui_Win_Data *sd) { int fw, fh, ox, oy, ow, oh; evas_object_geometry_get(sd->frame_obj, NULL, NULL, &fw, &fh); + sd->ignore_frame_resize++; + evas_object_resize(sd->frame_obj, 1000, 1000); if (elm_widget_is_legacy(sd->obj)) edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque", &ox, &oy, &ow, &oh); else edje_object_part_geometry_get(sd->frame_obj, "efl.spacer.opaque", &ox, &oy, &ow, &oh); + evas_object_resize(sd->frame_obj, fw, fh); + sd->ignore_frame_resize--; + fw = 1000; fh = 1000; l = ox; t = oy; r = fw - ow - l; b = fh - oh - t; + if (l < 0) l = 0; + if (r < 0) r = 0; + if (t < 0) t = 0; + if (b < 0) b = 0; } ecore_evas_shadow_geometry_set(sd->ee, l, r, t, b); } @@ -1590,17 +1600,22 @@ _elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force) int ox, oy, ow, oh; int cx, cy, cw, ch; int w, h; + int l, r, t, b; if (!sd->frame_obj) return; if (!sd->csd.need) return; _elm_win_frame_geometry_adjust(sd); + ecore_evas_shadow_geometry_get(sd->ee, &l, &r, &t, &b); + sd->ignore_frame_resize++; evas_object_geometry_get(sd->frame_obj, &ox, &oy, &ow, &oh); + evas_object_resize(sd->frame_obj, 1000, 1000); if (elm_widget_is_legacy(sd->obj)) edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.content", &cx, &cy, &cw, &ch); else edje_object_part_geometry_get(sd->frame_obj, "efl.spacer.content", &cx, &cy, &cw, &ch); - - if (!_elm_win_framespace_set(sd, cx, cy, ow - cw, oh - ch) && (!force)) return; + evas_object_resize(sd->frame_obj, ow, oh); + sd->ignore_frame_resize--; + if (!_elm_win_framespace_set(sd, cx, cy, 1000 - cw, 1000 - ch) && (!force)) return; _elm_win_frame_geometry_adjust(sd); if (!sd->first_draw) return; @@ -3733,10 +3748,10 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize) int fw, fh; evas_output_framespace_get(sd->evas, NULL, NULL, &fw, &fh); - minw += fw; - minh += fh; - maxw += fw; - maxh += fh; +// minw += fw; +// minh += fh; +// maxw += fw; +// maxh += fh; } sd->tmp_updating_hints = 1; @@ -4215,6 +4230,7 @@ _elm_win_frame_obj_resize(void *data, if (!(sd = data)) return; if (!sd->legacy.edje) return; + if (sd->ignore_frame_resize > 0) return; _elm_win_frame_obj_update(sd, 0); } diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index ad922474cd..c14bdbcd33 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -313,7 +313,7 @@ static void _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h) { Ecore_Evas_Engine_Wl_Data *wdata; - int ow, oh, ew, eh; + int ow, oh, ew, eh, fw, fh; int diff = 0; LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -326,6 +326,8 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h) ee->req.w = w; ee->req.h = h; + evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); + /* TODO: wayland client can resize the ecore_evas directly. * In the future, we will remove ee->req value in wayland backend */ ew = ee->w; @@ -335,55 +337,52 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h) if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min) { - wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w, ee->prop.min.h); + wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w + fw, ee->prop.min.h + fh); wdata->win->pending.min = 0; } if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max) { - wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w, ee->prop.max.h); + wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w + fw, ee->prop.max.h + fh); wdata->win->pending.max = 0; } if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min) { - wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h); + wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w + fw, ee->prop.min.h + fh); wdata->win->pending.min = 0; } if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max) { - wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w, ee->prop.max.h); + wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w + fw, ee->prop.max.h + fh); wdata->win->pending.max = 0; } if (!ee->prop.fullscreen) { - int fw = 0, fh = 0; int maxw = 0, maxh = 0; int minw = 0, minh = 0; - evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); - if (ECORE_EVAS_PORTRAIT(ee)) { if (ee->prop.min.w > 0) - minw = (ee->prop.min.w - fw); + minw = (ee->prop.min.w); if (ee->prop.min.h > 0) - minh = (ee->prop.min.h - fh); + minh = (ee->prop.min.h); if (ee->prop.max.w > 0) - maxw = (ee->prop.max.w + fw); + maxw = (ee->prop.max.w); if (ee->prop.max.h > 0) - maxh = (ee->prop.max.h + fh); + maxh = (ee->prop.max.h); } else { if (ee->prop.min.w > 0) - minw = (ee->prop.min.w - fh); + minw = (ee->prop.min.w); if (ee->prop.min.h > 0) - minh = (ee->prop.min.h - fw); + minh = (ee->prop.min.h); if (ee->prop.max.w > 0) - maxw = (ee->prop.max.w + fh); + maxw = (ee->prop.max.w); if (ee->prop.max.h > 0) - maxh = (ee->prop.max.h + fw); + maxh = (ee->prop.max.h); } if ((maxw > 0) && (w > maxw)) @@ -401,13 +400,13 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h) /* calc new size using base size & step size */ if (ee->prop.step.w > 1) { - int bw = ee->prop.base.w ?: minw; + int bw = ee->prop.base.w; w = (bw + (((w - bw) / ee->prop.step.w) * ee->prop.step.w)); } if (ee->prop.step.h > 1) { - int bh = ee->prop.base.h ?: minh; + int bh = ee->prop.base.h; h = (bh + (((h - bh) / ee->prop.step.h) * ee->prop.step.h)); } @@ -1671,6 +1670,7 @@ _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char * static void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h) { + int fw, fh; Ecore_Evas_Engine_Wl_Data *wdata; LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -1682,14 +1682,15 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h) ee->prop.min.w = w; ee->prop.min.h = h; wdata = ee->engine.data; + evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel) { - wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, w, h); + wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, w + fw, h + fh); wdata->win->pending.min = 0; } if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel) { - wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h); + wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w + fw, h + fh); wdata->win->pending.min = 0; } else @@ -1700,6 +1701,7 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h) static void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h) { + int fw, fh; Ecore_Evas_Engine_Wl_Data *wdata; LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -1710,14 +1712,15 @@ _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h) ee->prop.max.w = w; ee->prop.max.h = h; wdata = ee->engine.data; + evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel) { - wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, w, h); + wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, w + fw, h + fh); wdata->win->pending.max = 0; } if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel) { - wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h); + wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w + fw, h + fh); wdata->win->pending.max = 0; } else @@ -2153,31 +2156,30 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee) { int fw, fh; + evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min) { - wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w, ee->prop.min.h); + wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w + fw, ee->prop.min.h + fh); wdata->win->pending.min = 0; } if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max) { - wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w, ee->prop.max.h); + wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w + fw, ee->prop.max.h + fh); wdata->win->pending.max = 0; } if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min) { - wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h); + wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w + fw, ee->prop.min.h + fh); wdata->win->pending.min = 0; } if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel && wdata->win->pending.max) { - wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w, ee->prop.max.h); + wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, ee->prop.max.w + fw, ee->prop.max.h + fh); wdata->win->pending.max = 0; } _ecore_evas_wayland_window_update(ee, wdata, ee->alpha); - evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh); - ecore_wl2_window_show(wdata->win); einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas); if (einfo) diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c index 97e5fb2d10..abea314d33 100644 --- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c +++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c @@ -1534,6 +1534,8 @@ _ecore_evas_x_shadow_update(Ecore_Evas *ee) ECORE_X_ATOM_CARDINAL, 32, shadow, 4); } +static void _ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee); + static Eina_Bool _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { @@ -1672,6 +1674,8 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE } } } + if (framespace_resized) + _ecore_evas_x_size_pos_hints_update(ee); } return ECORE_CALLBACK_PASS_ON; } @@ -1763,15 +1767,19 @@ _ecore_evas_x_event_window_hide(void *data EINA_UNUSED, int type EINA_UNUSED, vo static void _ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee) { + int fw, fh; + + fw = ee->framespace.w; + fh = ee->framespace.h; ecore_x_icccm_size_pos_hints_set(ee->prop.window, ee->prop.request_pos /*request_pos */, ECORE_X_GRAVITY_NW /* gravity */, - ee->prop.min.w /* min_w */, - ee->prop.min.h /* min_h */, - ee->prop.max.w /* max_w */, - ee->prop.max.h /* max_h */, - ee->prop.base.w /* base_w */, - ee->prop.base.h /* base_h */, + ee->prop.min.w + fw /* min_w */, + ee->prop.min.h + fh /* min_h */, + ee->prop.max.w + fw /* max_w */, + ee->prop.max.h + fh /* max_h */, + ee->prop.base.w + fw /* base_w */, + ee->prop.base.h + fh /* base_h */, ee->prop.step.w /* step_x */, ee->prop.step.h /* step_y */, ee->prop.aspect /* min_aspect */, From 7eeeb3c6f9e8ed3a12ed22263d9a73c6d1da1b9b Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sat, 18 Jan 2020 12:25:08 +0000 Subject: [PATCH 12/15] evas - fix access-after-free number 2 follow on from 3aa250e17ff34a1b0466b65fe55ffe1fced291ff and T8534 looking into more possible problems and fixes @fix --- src/lib/evas/canvas/evas_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index b64f8724ae..95d0f36bd0 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c @@ -1499,9 +1499,9 @@ _evas_pointer_data_remove(Evas_Public_Data *edata, Evas_Device *pointer, Eina_Bo } EINA_SAFETY_ON_NULL_RETURN(hit); if (hit->pointers) return; - eina_list_free(hit->object.in); + hit->object.in = eina_list_free(hit->object.in); edata->seats = eina_inlist_remove(edata->seats, EINA_INLIST_GET(hit)); - free(hit); + if (!nofree) free(hit); } Eina_List * From f576ea65c34baf9a97f866b2fd6d2e20c6d87d2e Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 19 Jan 2020 10:51:29 +0000 Subject: [PATCH 13/15] elm test - make window 480x490 to differentiate width vs height --- src/bin/elementary/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index b86505a370..d52240011b 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -1362,7 +1362,7 @@ add_tests: } /* set an initial window size */ - evas_object_resize(win, 480 * elm_config_scale_get(), 480 * elm_config_scale_get()); + evas_object_resize(win, 480 * elm_config_scale_get(), 490 * elm_config_scale_get()); evas_object_show(win); } From 6f209e48be8f875872e59e524940134f4e354c4e Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 19 Jan 2020 10:52:34 +0000 Subject: [PATCH 14/15] elm win - fix client side move/resize req handling csd in x we dont keep our window id up to date... it changes somewhere along the way during init.... (ecore evas does this e.g. go from normal to alpha window it has tocreate a new window id anyway)... so stay up to date so we send a req for the right window id... @fix --- src/lib/elementary/efl_ui_win.c | 236 +++++++++++++++++++++----------- 1 file changed, 153 insertions(+), 83 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 7ca87e9359..2430b50638 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -467,6 +467,69 @@ _elm_win_first_frame_do(void *data, Evas *e EINA_UNUSED, void *event_info EINA_U evas_event_callback_del_full(e, EVAS_CALLBACK_RENDER_POST, _elm_win_first_frame_do, data); } +Ecore_X_Window +_elm_ee_xwin_get(const Ecore_Evas *ee) +{ +#ifdef HAVE_ELEMENTARY_X + const char *engine_name; + if (!ee) return 0; + + engine_name = ecore_evas_engine_name_get(ee); + if (EINA_UNLIKELY(!engine_name)) return 0; + + if (!strcmp(engine_name, ELM_SOFTWARE_X11)) + { + return ecore_evas_software_x11_window_get(ee); + } + else if (!strcmp(engine_name, ELM_OPENGL_X11)) + { + return ecore_evas_gl_x11_window_get(ee); + } +#else + (void)ee; +#endif + return 0; +} + +#ifdef HAVE_ELEMENTARY_X +static void +_internal_elm_win_xwindow_get(Efl_Ui_Win_Data *sd) +{ + Ecore_X_Window pwin = sd->x.xwin; + sd->x.xwin = _elm_ee_xwin_get(sd->ee); + if (sd->x.xwin != pwin) + { + char buf[128]; + + snprintf(buf, sizeof(buf), "%x", sd->x.xwin); + eina_stringshare_del(sd->stack_id); + sd->stack_id = eina_stringshare_add(buf); + } +} +#endif + +Ecore_Wl2_Window * +_elm_ee_wlwin_get(const Ecore_Evas *ee) +{ +#ifdef HAVE_ELEMENTARY_WL2 + const char *engine_name; + + if (!ee) return NULL; + + engine_name = ecore_evas_engine_name_get(ee); + if (EINA_UNLIKELY(!engine_name)) return NULL; + + if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) || + (!strcmp(engine_name, ELM_WAYLAND_EGL))) + { + return ecore_evas_wayland2_window_get(ee); + } +#else + (void)ee; +#endif + return NULL; +} + static void _win_noblank_eval(void) { @@ -482,6 +545,7 @@ _win_noblank_eval(void) if (sd->x.xwin) { + _internal_elm_win_xwindow_get(sd); if ((sd->noblank) && (!sd->minimized) && (!sd->withdrawn) && evas_object_visible_get(obj)) noblanks++; @@ -526,6 +590,7 @@ _elm_win_apply_alpha(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) #ifdef HAVE_ELEMENTARY_X if (sd->x.xwin) { + _internal_elm_win_xwindow_get(sd); enabled |= (sd->csd.need && !sd->fullscreen); if (!ecore_x_screen_is_composited(0)) { @@ -1083,7 +1148,10 @@ _elm_win_pre_render(Ecore_Evas *ee) if (sd->pointer.obj) evas_object_show(sd->pointer.obj); #ifdef ELEMENTARY_X if (sd->type == ELM_WIN_TOOLTIP) - ecore_x_window_shape_input_rectangle_set(sd->x.xwin, 0, 0, 0, 0); + { + _internal_elm_win_xwindow_get(sd); + ecore_x_window_shape_input_rectangle_set(sd->x.xwin, 0, 0, 0, 0); + } #endif sd->first_draw = EINA_TRUE; /* set this to handle ecore-evas engine code which incorrectly @@ -1622,7 +1690,9 @@ _elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force) evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h); if (w && h) - TRAP(sd, resize, w, h); + { + TRAP(sd, resize, w, h); + } } static int @@ -3223,7 +3293,7 @@ _efl_ui_win_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz evas_object_image_size_set(sd->img_obj, sz.w, sz.h); } - _elm_win_frame_geometry_adjust(sd); + _elm_win_frame_obj_update(sd, 1); if (!sd->response) { sd->req_wh = EINA_TRUE; @@ -3268,69 +3338,6 @@ _elm_win_delete_request(Ecore_Evas *ee) evas_object_unref(obj); } -Ecore_X_Window -_elm_ee_xwin_get(const Ecore_Evas *ee) -{ -#ifdef HAVE_ELEMENTARY_X - const char *engine_name; - if (!ee) return 0; - - engine_name = ecore_evas_engine_name_get(ee); - if (EINA_UNLIKELY(!engine_name)) return 0; - - if (!strcmp(engine_name, ELM_SOFTWARE_X11)) - { - return ecore_evas_software_x11_window_get(ee); - } - else if (!strcmp(engine_name, ELM_OPENGL_X11)) - { - return ecore_evas_gl_x11_window_get(ee); - } -#else - (void)ee; -#endif - return 0; -} - -#ifdef HAVE_ELEMENTARY_X -static void -_internal_elm_win_xwindow_get(Efl_Ui_Win_Data *sd) -{ - Ecore_X_Window pwin = sd->x.xwin; - sd->x.xwin = _elm_ee_xwin_get(sd->ee); - if (sd->x.xwin != pwin) - { - char buf[128]; - - snprintf(buf, sizeof(buf), "%x", sd->x.xwin); - eina_stringshare_del(sd->stack_id); - sd->stack_id = eina_stringshare_add(buf); - } -} -#endif - -Ecore_Wl2_Window * -_elm_ee_wlwin_get(const Ecore_Evas *ee) -{ -#ifdef HAVE_ELEMENTARY_WL2 - const char *engine_name; - - if (!ee) return NULL; - - engine_name = ecore_evas_engine_name_get(ee); - if (EINA_UNLIKELY(!engine_name)) return NULL; - - if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) || - (!strcmp(engine_name, ELM_WAYLAND_EGL))) - { - return ecore_evas_wayland2_window_get(ee); - } -#else - (void)ee; -#endif - return NULL; -} - #ifdef HAVE_ELEMENTARY_WL2 static void _elm_win_wlwindow_get(Efl_Ui_Win_Data *sd) @@ -3491,6 +3498,7 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd) _internal_elm_win_xwindow_get(sd); if (!sd->x.xwin) return; /* nothing more to do */ + _internal_elm_win_xwindow_get(sd); if (sd->stack_master_id) { @@ -3509,6 +3517,7 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd) if (sd->parent) { ELM_WIN_DATA_GET(sd->parent, sdp); + _internal_elm_win_xwindow_get(sdp); if (sdp) ecore_x_icccm_transient_for_set(sd->x.xwin, sdp->x.xwin); } } @@ -3896,6 +3905,7 @@ _elm_win_client_message(void *data, Ecore_X_Event_Client_Message *e = event; if (e->format != 32) return ECORE_CALLBACK_PASS_ON; + _internal_elm_win_xwindow_get(sd); if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH) { if ((unsigned int)e->data.l[0] == sd->x.xwin) @@ -3998,6 +4008,7 @@ _elm_win_property_change(void *data, if (e->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE) { + _internal_elm_win_xwindow_get(sd); if (e->win == sd->x.xwin) { sd->legacy.indmode = (Elm_Win_Indicator_Mode)ecore_x_e_illume_indicator_state_get(e->win); @@ -4319,6 +4330,7 @@ _win_move_start(Efl_Ui_Win_Data *sd) { int x, y; + _internal_elm_win_xwindow_get(sd); sd->resizing = EINA_TRUE; ecore_x_pointer_ungrab(); ecore_x_pointer_root_xy_get(&x, &y); @@ -4372,6 +4384,7 @@ _win_move_resize_start(Efl_Ui_Win_Data *sd, Efl_Ui_Win_Move_Resize_Mode mode) if (sd->x.xwin) { int x, y; + _internal_elm_win_xwindow_get(sd); ecore_x_pointer_ungrab(); ecore_x_pointer_root_xy_get(&x, &y); ecore_x_netwm_moveresize_request_send(sd->x.xwin, x, y, ri->x_dir, 1); @@ -4777,7 +4790,9 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style) _elm_win_frame_geometry_adjust(sd); ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h); if ((w > 1) && (h > 1)) - ecore_evas_resize(sd->ee, w, h); + { + ecore_evas_resize(sd->ee, w, h); + } } static void @@ -6240,6 +6255,7 @@ _efl_ui_win_center(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool h, Eina_Bool v) static Ecore_X_Atom state = 0; static Ecore_X_Atom centered = 0; + _internal_elm_win_xwindow_get(sd); if (!centered) centered = ecore_x_atom_get ("__E_ATOM_WINDOW_STATE_CENTERED"); if (!state) state = ecore_x_atom_get @@ -6924,8 +6940,11 @@ _efl_ui_win_keyboard_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_W sd->kbdmode = mode; #ifdef HAVE_ELEMENTARY_X if (sd->x.xwin) - ecore_x_e_virtual_keyboard_state_set - (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode); + { + _internal_elm_win_xwindow_get(sd); + ecore_x_e_virtual_keyboard_state_set + (sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode); + } #endif } @@ -7147,7 +7166,8 @@ _efl_ui_win_stack_master_id_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const if (sd->shown) return; eina_stringshare_replace(&(sd->stack_master_id), id); #ifdef HAVE_ELEMENTARY_X - if (sd->x.xwin) _elm_win_xwin_update(sd); + if (sd->x.xwin) + _elm_win_xwin_update(sd); else #endif { @@ -7230,6 +7250,7 @@ _efl_ui_win_stack_pop_to(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) int i, num = 0; Eina_Bool del = EINA_FALSE; + _internal_elm_win_xwindow_get(sd); ecore_x_grab(); _x_transients_for_list (ecore_x_window_root_get(sd->x.xwin), @@ -7285,6 +7306,7 @@ elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating) _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) { + _internal_elm_win_xwindow_get(sd); if (sd->floating) ecore_x_e_illume_window_state_set (sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING); @@ -7900,6 +7922,7 @@ elm_win_xwindow_get(const Evas_Object *obj) if (!sd) return 0; #ifdef HAVE_ELEMENTARY_X + _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) return sd->x.xwin; if (sd->parent) return elm_win_xwindow_get(sd->parent); #endif @@ -8023,6 +8046,7 @@ elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel) _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) { + _internal_elm_win_xwindow_get(sd); ecore_x_e_illume_quickpanel_set(sd->x.xwin, quickpanel); if (quickpanel) { @@ -8049,7 +8073,10 @@ elm_win_quickpanel_get(const Evas_Object *obj) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - return ecore_x_e_illume_quickpanel_get(sd->x.xwin); + { + _internal_elm_win_xwindow_get(sd); + return ecore_x_e_illume_quickpanel_get(sd->x.xwin); + } #else (void)sd; #endif @@ -8066,7 +8093,10 @@ elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority); + { + _internal_elm_win_xwindow_get(sd); + ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority); + } #else (void)sd; (void)priority; @@ -8082,7 +8112,10 @@ elm_win_quickpanel_priority_major_get(const Evas_Object *obj) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - return ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin); + { + _internal_elm_win_xwindow_get(sd); + return ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin); + } #else (void)sd; #endif @@ -8099,7 +8132,10 @@ elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority); + { + _internal_elm_win_xwindow_get(sd); + ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority); + } #else (void)sd; (void)priority; @@ -8115,7 +8151,10 @@ elm_win_quickpanel_priority_minor_get(const Evas_Object *obj) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - return ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin); + { + _internal_elm_win_xwindow_get(sd); + return ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin); + } #else (void)sd; #endif @@ -8132,7 +8171,10 @@ elm_win_quickpanel_zone_set(Evas_Object *obj, int zone) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone); + { + _internal_elm_win_xwindow_get(sd); + ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone); + } #else (void)sd; (void)zone; @@ -8148,7 +8190,10 @@ elm_win_quickpanel_zone_get(const Evas_Object *obj) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - return ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin); + { + _internal_elm_win_xwindow_get(sd); + return ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin); + } #else (void)sd; #endif @@ -8176,6 +8221,7 @@ elm_win_indicator_mode_set(Evas_Object *obj, Elm_Win_Indicator_Mode mode) #ifdef HAVE_ELEMENTARY_X if (sd->x.xwin) { + _internal_elm_win_xwindow_get(sd); if (sd->legacy.indmode == ELM_WIN_INDICATOR_SHOW) ecore_x_e_illume_indicator_state_set (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON); @@ -8221,6 +8267,7 @@ elm_win_indicator_opacity_set(Evas_Object *obj, Elm_Win_Indicator_Opacity_Mode m _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) { + _internal_elm_win_xwindow_get(sd); if (sd->legacy.ind_o_mode == ELM_WIN_INDICATOR_OPAQUE) ecore_x_e_illume_indicator_opacity_set (sd->x.xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE); @@ -8260,7 +8307,10 @@ elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard); + { + _internal_elm_win_xwindow_get(sd); + ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard); + } #else (void)sd; (void)is_keyboard; @@ -8275,7 +8325,11 @@ elm_win_keyboard_win_get(const Evas_Object *obj) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); - if (sd->x.xwin) return ecore_x_e_virtual_keyboard_get(sd->x.xwin); + if (sd->x.xwin) + { + _internal_elm_win_xwindow_get(sd); + return ecore_x_e_virtual_keyboard_get(sd->x.xwin); + } #else (void)sd; #endif @@ -8291,7 +8345,10 @@ elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - ecore_x_e_illume_conformant_set(sd->x.xwin, conformant); + { + _internal_elm_win_xwindow_get(sd); + ecore_x_e_illume_conformant_set(sd->x.xwin, conformant); + } #else (void)sd; (void)conformant; @@ -8307,7 +8364,10 @@ elm_win_conformant_get(const Evas_Object *obj) #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - return ecore_x_e_illume_conformant_get(sd->x.xwin); + { + _internal_elm_win_xwindow_get(sd); + return ecore_x_e_illume_conformant_get(sd->x.xwin); + } #else (void)sd; #endif @@ -8610,6 +8670,7 @@ elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void * _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) { + _internal_elm_win_xwindow_get(sd); switch (command) { case ELM_ILLUME_COMMAND_FOCUS_BACK: @@ -8719,7 +8780,11 @@ _elm_win_window_id_get(Efl_Ui_Win_Data *sd) #endif #ifdef HAVE_ELEMENTARY_X _internal_elm_win_xwindow_get(sd); - if (sd->x.xwin) return (Ecore_Window)sd->x.xwin; + if (sd->x.xwin) + { + _internal_elm_win_xwindow_get(sd); + return (Ecore_Window)sd->x.xwin; + } if (sd->parent) { Ecore_Window xwin = elm_win_xwindow_get(sd->parent); @@ -8788,6 +8853,7 @@ elm_win_main_menu_get(Evas_Object *obj) #ifdef HAVE_ELEMENTARY_X if (use_dbus && _elm_dbus_menu_register(sd->main_menu)) { + _internal_elm_win_xwindow_get(sd); _elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu, _dbus_menu_set, obj); } @@ -8970,6 +9036,7 @@ elm_win_keygrab_set(Elm_Win *obj, const char *key, _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) { + _internal_elm_win_xwindow_get(sd); Ecore_X_Win_Keygrab_Mode x_grab_mode; switch (grab_mode) { @@ -9010,7 +9077,10 @@ elm_win_keygrab_unset(Elm_Win *obj, const char *key, EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE); _internal_elm_win_xwindow_get(sd); if (sd->x.xwin) - ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0); + { + _internal_elm_win_xwindow_get(sd); + ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0); + } #else (void)obj; (void)key; From ad633751997324274303176696cbfc14e1ecba5d Mon Sep 17 00:00:00 2001 From: ali Date: Mon, 20 Jan 2020 10:07:40 +0900 Subject: [PATCH 15/15] efl.text.cursor: movement types rename Summary: replace prev with previous, replace char with character Reviewers: woohyun, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8567 Differential Revision: https://phab.enlightenment.org/D11095 --- .../efl_ui_internal_text_interactive.c | 23 ++++++++------- src/lib/evas/canvas/efl_text_cursor.c | 8 +++--- src/lib/evas/canvas/efl_text_cursor.eo | 28 +++++++++---------- src/tests/evas/evas_test_textblock.c | 26 ++++++++--------- 4 files changed, 42 insertions(+), 43 deletions(-) diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index 8e1ad98c6a..829c952a65 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -540,7 +540,7 @@ _entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUS for (i = 0; i < (preedit_end_pos - preedit_start_pos); i++) { - efl_text_cursor_move(en->preedit_start, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV); + efl_text_cursor_move(en->preedit_start, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS); } en->have_preedit = EINA_TRUE; @@ -913,19 +913,19 @@ _delete_emit(Eo *obj, Efl_Text_Cursor *c, Efl_Ui_Internal_Text_Interactive_Data Eo * cur = efl_duplicate(c); if (backspace) { - if (!efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV)) + if (!efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS)) { return; } - efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT); + efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT); } else { - if (!efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT)) + if (!efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT)) { return; } - efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV); + efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS); } efl_del(cur); cur = NULL; @@ -1183,7 +1183,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void #endif if (efl_text_interactive_have_selection_get(obj)) ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - if (efl_text_cursor_move(cur,EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV)) + if (efl_text_cursor_move(cur,EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS)) ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; _key_down_sel_post(obj, cur, en, shift); @@ -1202,7 +1202,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void #endif if (efl_text_interactive_have_selection_get(obj)) ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - if (efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT)) + if (efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT)) ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; _key_down_sel_post(obj, cur, en, shift); @@ -1214,9 +1214,8 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void { // del to start of previous word Efl_Text_Cursor *tc = efl_canvas_textblock_cursor_create(obj); - _cur_pos_copy(cur, tc); - efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV); + efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START); _range_del_emit(obj, cur, tc); @@ -1252,7 +1251,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void _cur_pos_copy(cur, tc); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END); - efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT); + efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT); _range_del_emit(obj, cur, tc); @@ -1589,7 +1588,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN else { efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END); - efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT); + efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT); } _sel_extend(cur, obj, en); } @@ -1603,7 +1602,7 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START); _sel_init(cur, obj, en); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END); - efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT); + efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT); _sel_extend(cur, obj, en); } goto end; diff --git a/src/lib/evas/canvas/efl_text_cursor.c b/src/lib/evas/canvas/efl_text_cursor.c index 0a19a3b281..c1e344136d 100644 --- a/src/lib/evas/canvas/efl_text_cursor.c +++ b/src/lib/evas/canvas/efl_text_cursor.c @@ -140,16 +140,16 @@ _efl_text_cursor_move(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, Efl_Text_Cu int pos = evas_textblock_cursor_pos_get(pd->handle); switch (type) { - case EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT : + case EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT : moved = evas_textblock_cursor_char_next(pd->handle); break; - case EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV : + case EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS : moved = evas_textblock_cursor_char_prev(pd->handle); break; case EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT : moved = evas_textblock_cursor_cluster_next(pd->handle); break; - case EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREV : + case EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREVIOUS : moved = evas_textblock_cursor_cluster_prev(pd->handle); break; case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_START : @@ -191,7 +191,7 @@ _efl_text_cursor_move(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, Efl_Text_Cu case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT : moved = evas_textblock_cursor_paragraph_next(pd->handle); break; - case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_PREV : + case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_PREVIOUS : moved = evas_textblock_cursor_paragraph_prev(pd->handle); break; } diff --git a/src/lib/evas/canvas/efl_text_cursor.eo b/src/lib/evas/canvas/efl_text_cursor.eo index 9b90854a23..2c77f84a14 100644 --- a/src/lib/evas/canvas/efl_text_cursor.eo +++ b/src/lib/evas/canvas/efl_text_cursor.eo @@ -10,22 +10,22 @@ enum @beta Efl.Text.Cursor_Type enum @beta Efl.Text.Cursor_Move_Type { [[Text cursor movement types.]] - char_next, [[Advances to the next character.]] - char_prev, [[Advances to the previous character.]] - cluster_next, [[Advances to the next grapheme cluster + character_next, [[Advances to the next character.]] + character_previous, [[Advances to the previous character.]] + cluster_next, [[Advances to the next grapheme cluster (A character sequence rendered together. See https://unicode.org/reports/tr29/).]] - cluster_prev, [[Advances to the previous grapheme cluster + cluster_previous, [[Advances to the previous grapheme cluster (A character sequence rendered together. See https://unicode.org/reports/tr29/).]] - paragraph_start, [[Advances to the first character in current paragraph.]] - paragraph_end, [[Advances to the last character in current paragraph.]] - word_start, [[Advance to current word start.]] - word_end, [[Advance to current word end.]] - line_start, [[Advance to current line first character.]] - line_end, [[Advance to current line last character.]] - first, [[Advance to first character in the first paragraph.]] - last, [[Advance to last character in the last paragraph.]] - paragraph_next, [[Advances to the start of the next paragraph.]] - paragraph_prev [[Advances to the end of the previous paragraph.]] + paragraph_start, [[Advances to the first character in current paragraph.]] + paragraph_end, [[Advances to the last character in current paragraph.]] + word_start, [[Advance to current word start.]] + word_end, [[Advance to current word end.]] + line_start, [[Advance to current line first character.]] + line_end, [[Advance to current line last character.]] + first, [[Advance to first character in the first paragraph.]] + last, [[Advance to last character in the last paragraph.]] + paragraph_next, [[Advances to the start of the next paragraph.]] + paragraph_previous [[Advances to the end of the previous paragraph.]] } abstract @beta Efl.Text.Cursor extends Efl.Object implements Efl.Duplicate{ diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 8560e36e7c..1fee7eb5b1 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -4536,10 +4536,10 @@ EFL_START_TEST(efl_canvas_textblock_cursor) ck_assert_int_eq(changed_emit, 6); efl_text_set(txt, ""); - ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT)); - ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV)); + ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT)); + ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS)); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT)); - ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREV)); + ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREVIOUS)); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_START)); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_END)); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START)); @@ -4547,7 +4547,7 @@ EFL_START_TEST(efl_canvas_textblock_cursor) ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START)); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END)); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_NEXT)); - ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_PREV)); + ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_PREVIOUS)); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST)); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LAST)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); @@ -4555,13 +4555,13 @@ EFL_START_TEST(efl_canvas_textblock_cursor) ck_assert_int_eq(changed_emit, 7); efl_text_markup_set(txt, "Hello WorldThis is EFL
Enlightenment"); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 1); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 1); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREV)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_PREVIOUS)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); efl_text_cursor_position_set(cur_obj, 0); @@ -4575,11 +4575,11 @@ EFL_START_TEST(efl_canvas_textblock_cursor) ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END)); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5); ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 10); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT)); ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END)); ck_assert_int_ne(efl_text_cursor_position_get(cur_obj), 10); @@ -4591,7 +4591,7 @@ EFL_START_TEST(efl_canvas_textblock_cursor) ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 12); ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 12); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS)); ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); @@ -4604,11 +4604,11 @@ EFL_START_TEST(efl_canvas_textblock_cursor) ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 3); ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_PREVIOUS)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 4); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 5); - ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT)); + ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 6); ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_CLUSTER_NEXT)); ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 7);