Re: [E-devel] [EGIT] [core/efl] master 01/01: elm_code: set the color scheme from the default edc.
This is awesome! I could definitely use this as a reference for Ui.Text. -- Danny (herdsman) Hirt On 11/26/2017 02:37 PM, Al Poole wrote: netstar pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5abeeb980a9fb82136a70c24f822cdc3eb633dd0 commit 5abeeb980a9fb82136a70c24f822cdc3eb633dd0 Author: Al Poole Date: Sun Nov 26 12:36:42 2017 + elm_code: set the color scheme from the default edc. This allows us to override in the application also. Work from myself and @ajwillia.ms. --- data/elementary/themes/edc/elm/code.edc | 38 + src/lib/elementary/elm_code_widget.c| 132 ++-- 2 files changed, 95 insertions(+), 75 deletions(-) diff --git a/data/elementary/themes/edc/elm/code.edc b/data/elementary/themes/edc/elm/code.edc index fc589b8fcb..608b16f671 100644 --- a/data/elementary/themes/edc/elm/code.edc +++ b/data/elementary/themes/edc/elm/code.edc @@ -18,3 +18,41 @@ group { name: "elm/code/layout/default"; } } } + +color_classes { +color_class { name: "elm/code/status/default"; color: 36 36 36 255; } +color_class { name: "elm/code/status/current"; color: 12 12 12 255; } +color_class { name: "elm/code/status/ignored"; color: 36 36 36 255; } +color_class { name: "elm/code/status/note"; color: 221 119 17 255; } +color_class { name: "elm/code/status/warning"; color: 221 119 17 255; } +color_class { name: "elm/code/status/error"; color: 204 17 17 255; } +color_class { name: "elm/code/status/fatal"; color: 204 17 17 255; } +color_class { name: "elm/code/status/added"; color: 36 96 36 255; } +color_class { name: "elm/code/status/removed"; color: 96 36 36 255; } +color_class { name: "elm/code/status/changed"; color: 36 36 96 255; } +color_class { name: "elm/code/status/passed"; color: 54 96 54 255; } +color_class { name: "elm/code/status/failed"; color: 96 54 54 255; } +color_class { name: "elm/code/status/todo"; color: 51 85 187 255; } + +color_class { name: "elm/code/token/default"; color: 187 187 187 255; } +color_class { name: "elm/code/token/comment"; color: 85 85 85 255; } +color_class { name: "elm/code/token/string"; color: 255 136 119 255; } +color_class { name: "elm/code/token/number"; color: 170 153 34 255; } +color_class { name: "elm/code/token/brace"; color: 170 102 170 255; } +color_class { name: "elm/code/token/type"; color: 255 255 255 255; } +color_class { name: "elm/code/token/class"; color: 255 255 255 255; } +color_class { name: "elm/code/token/function"; color: 255 255 255 255; } +color_class { name: "elm/code/token/param"; color: 187 187 187 255; } +color_class { name: "elm/code/token/keyword"; color: 68 136 204 255; } +color_class { name: "elm/code/token/preprocessor"; color: 102 255 85 255; } +color_class { name: "elm/code/token/added"; color: 54 255 54 255; } +color_class { name: "elm/code/token/removed"; color: 255 54 54 255; } +color_class { name: "elm/code/token/changed"; color: 54 54 255 255; } +color_class { name: "elm/code/token/match"; color: 187 187 51 255; } + +color_class { name: "elm/code/widget/color/selection"; color: 51 153 255 255; } +color_class { name: "elm/code/widget/color/gutter/bg"; color: 75 75 75 255; } +color_class { name: "elm/code/widget/color/gutter/fg"; color: 139 139 139 255; } +color_class { name: "elm/code/widget/color/gutter/scope/bg"; color: 54 54 54 255; } +color_class { name: "elm/code/widget/color/whitespace"; color: 50 50 50 127; } +} diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c index ce42ab53e4..e61aa6afea 100644 --- a/src/lib/elementary/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c @@ -1782,87 +1782,64 @@ _elm_code_widget_elm_widget_widget_event(Eo *obj EINA_UNUSED, Elm_Code_Widget_Da return EINA_FALSE; } +// load a named colour class from the theme and apply it to the grid's specified palette static void -_elm_code_widget_setup_palette(Evas_Object *o) +_elm_code_widget_setup_palette_item(Evas_Object *grid, int type, const char *name, Evas_Object *edje) { - double feint = 0.5; + int r, g, b, a; + + if (!edje_object_color_class_get(edje, name, &r, &g, &b, &a, +NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)) + return; + + evas_object_textgrid_palette_set(grid, EVAS_TEXTGRID_PALETTE_STANDARD, type, r, g, b, a); +} + +static void +_elm_code_widget_setup_palette(Evas_Object *o, Evas_Object *layout) +{ + Evas_Object *edje; + + edje = elm_layout_edje_get(layout); // setup status colors - evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_STATUS_TYPE_DEFAULT, -36, 36, 36, 255); - evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_STATUS_TYPE_CURRENT, -
Re: [E-devel] [EGIT] [core/efl] master 01/01: Revert "Edje: use textblock by default"
Hi, On 11/11/2017 05:06 PM, Carsten Haitzler wrote: [snipped] 12:04AM ~/C/th-efl/data ⎇ devs/raster/theme/flat2 ⚡ 1 > git status elementary/themes/edc/sys.edc On branch devs/raster/theme/flat2 Your branch is up to date with 'origin/devs/raster/theme/flat2'. nothing to commit, working tree clean. it's committed. The following (with the "nothere" file) shows the same output: ➜ efl git:(devs/raster/theme/flat2) ✗ git status nothere On branch devs/raster/theme/flat2 Your branch is up to date with 'origin/devs/raster/theme/flat2'. nothing to commit, working tree clean It looks like it (maybe more) were removed with: 6e867dd66a6f2abb3981781c0ce44df9e101aed7 A quick search suggests the following usage (see output): ➜ efltmp git:(devs/raster/theme/flat2) git ls-files --error-unmatch data/elementary/themes/edc/sys.edc error: pathspec 'data/elementary/themes/edc/sys.edc' did not match any file(s) known to git. Did you forget to 'git add'? Best, Danny. [snipped] -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [EGIT] [core/efl] master 01/01: Revert "Edje: use textblock by default"
Hi, On 11/11/2017 05:21 AM, Carsten Haitzler wrote: [snipped] This breaks E. pager ono my right screen looks like: http://devs.enlightenment.org/~raster/shot-2017-11-11_12-13-14.png Thanks. Is there anything else to observe here other than the CPU usage? on my left screen shellf keeps swapping between 2 dizes wobbling back and forth every frame eating cpu and making it "blurry"... Hmmm... Not sure how to reproduce this. Do I need two screens? What widgets in the shelf are doing that? note - theme is the flat one in devs/raster/theme/flat2 branch. so this change certainly breaks something... This work is based on the default theme and there is no apparent odd behavior here even when using shelves on two different screens (laptop + monitor). Also, I can't build the theme from your branch, as some files seem to be missing. This is the first error I get: make[2]: *** No rule to make target 'elementary/themes/edc/sys.edc', needed by 'elementary/themes/default.edj'. Stop. Thanks for the feedback. Let's try to get it reproduced on my machine so I can fix it and get it back on master. [snipped] -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] EFL event not firing
Hi Andrew, Testing this, I get the same result, even though I see it does the call in the implementation. I will check what's wrong there. As a side note, Phabricator is probably a more suitable platform for bug reports. Thanks for reporting. Best, -- Danny (herdsman) Hirt On 10/19/2017 04:58 PM, Andrew Williams wrote: Hi, I have an Efl.Ui.Text that is set to be editable. I have added a callback using the following but it never fires. efl_event_callback_add(editor, EFL_UI_TEXT_EVENT_CHANGED_USER, _gui_editor_changed_cb, editor); Any hints - I also tried EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER? Thanks, Andrew -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [EGIT] [core/efl] master 01/01: Canvas layout: fix Efl.text (non-legacy) TEXT parts
Hi all, The broken dialog and notification windows were introduced in a previous commit of mine. This commit fixes those issues for me. What do I need to run to reproduce the issues? -- Danny (herdsman) Hirt On 10/02/2017 06:10 PM, Al Poole wrote: Desktop notifications too (in case that's fixed/handled differently). On Mon, Oct 2, 2017 at 12:42 PM, Carsten Haitzler wrote: On Mon, 02 Oct 2017 01:13:41 -0700 Daniel Hirt said: now all of e's error dialogs are broke with visible tags.. herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id= eadf313702f81f05d39ba6c47385b8d8420a1330 commit eadf313702f81f05d39ba6c47385b8d8420a1330 Author: Daniel Hirt Date: Mon Oct 2 11:03:37 2017 +0300 Canvas layout: fix Efl.text (non-legacy) TEXT parts Current implementation should also support TEXT parts (like button) with usage of efl_text_set. Follow-up to 0061a4bb349e6c8e122913791bf83f7f40b0cede. --- src/lib/edje/edje_util.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index db0a3939c7..8db4ffd9a3 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1861,25 +1861,19 @@ _edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Par else if (text) { -if (legacy) +if (legacy || (rp->part->type == EDJE_PART_TYPE_TEXT) || set_markup) { rp->typedata.text->text = eina_stringshare_add(text); } -else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) +else // !legacy && (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) + // && !set_markup { - if (set_markup) - { - rp->typedata.text->text = eina_stringshare_add(text); - } - else - { - char *mkup; - mkup = efl_text_markup_util_text_to_markup( - EFL_TEXT_MARKUP_UTIL_CLASS, - text); - rp->typedata.text->text = eina_stringshare_add(mkup); - free(mkup); - } + char *mkup; + mkup = efl_text_markup_util_text_to_markup( +EFL_TEXT_MARKUP_UTIL_CLASS, +text); + rp->typedata.text->text = eina_stringshare_add(mkup); + free(mkup); } } ed->dirty = EINA_TRUE; -- -- - Codito, ergo sum - "I code, therefore I am" -- Carsten Haitzler - ras...@rasterman.com -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/01: Canvas layout: fix Efl.text (non-legacy) TEXT parts
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=eadf313702f81f05d39ba6c47385b8d8420a1330 commit eadf313702f81f05d39ba6c47385b8d8420a1330 Author: Daniel Hirt Date: Mon Oct 2 11:03:37 2017 +0300 Canvas layout: fix Efl.text (non-legacy) TEXT parts Current implementation should also support TEXT parts (like button) with usage of efl_text_set. Follow-up to 0061a4bb349e6c8e122913791bf83f7f40b0cede. --- src/lib/edje/edje_util.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index db0a3939c7..8db4ffd9a3 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1861,25 +1861,19 @@ _edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Par else if (text) { -if (legacy) +if (legacy || (rp->part->type == EDJE_PART_TYPE_TEXT) || set_markup) { rp->typedata.text->text = eina_stringshare_add(text); } -else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) +else // !legacy && (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) + // && !set_markup { - if (set_markup) - { - rp->typedata.text->text = eina_stringshare_add(text); - } - else - { - char *mkup; - mkup = efl_text_markup_util_text_to_markup( - EFL_TEXT_MARKUP_UTIL_CLASS, - text); - rp->typedata.text->text = eina_stringshare_add(mkup); - free(mkup); - } + char *mkup; + mkup = efl_text_markup_util_text_to_markup( +EFL_TEXT_MARKUP_UTIL_CLASS, +text); + rp->typedata.text->text = eina_stringshare_add(mkup); + free(mkup); } } ed->dirty = EINA_TRUE; --
[EGIT] [core/efl] master 01/02: Canvas layout: improve legacy code paths for Efl.Text
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0061a4bb349e6c8e122913791bf83f7f40b0cede commit 0061a4bb349e6c8e122913791bf83f7f40b0cede Author: Daniel Hirt Date: Sun Oct 1 18:38:18 2017 +0300 Canvas layout: improve legacy code paths for Efl.Text Better handling of specific cases where you want to efl_text_set on a TEXTBLOCK part. Follow-up to af1595fd0160f76de82cddeb2576143f65492c0b. --- src/lib/edje/edje_part_text.c | 4 ++-- src/lib/edje/edje_private.h | 2 +- src/lib/edje/edje_util.c | 39 +-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c index 0e5e4aa4ae..56c96ee7e0 100644 --- a/src/lib/edje/edje_part_text.c +++ b/src/lib/edje/edje_part_text.c @@ -11,7 +11,7 @@ _efl_canvas_layout_part_text_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text) { PROXY_DATA_GET(obj, pd); - _edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_FALSE); + _edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_FALSE); RETURN_VOID; } @@ -36,7 +36,7 @@ _efl_canvas_layout_part_text_efl_text_markup_markup_set(Eo *obj, void *_pd EINA_UNUSED, const char *text) { PROXY_DATA_GET(obj, pd); - _edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_TRUE); + _edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_TRUE); RETURN_VOID; } diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index c65f560071..d84d004f70 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -3160,7 +3160,7 @@ Evas_Object *_edje_object_part_external_content_get(Edje *ed, const char *part, /* part text */ Eo *_edje_text_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp); -Eina_Bool _edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text, Eina_Bool set_markup); +Eina_Bool _edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text, Eina_Bool legacy, Eina_Bool set_markup); const char *_edje_efl_text_get(Eo *obj, Edje *ed, const char *part, Eina_Bool legacy, Eina_Bool get_markup); Eina_Bool _edje_efl_text_markup_set(Eo *obj, Edje *ed, const char *part, const char *markup); const char *_edje_efl_text_markup_get(Eo *obj, Edje *ed, const char *part); diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index c175c140f1..db0a3939c7 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1842,7 +1842,7 @@ _edje_object_text_change_cb_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Text_Change_ } Eina_Bool -_edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text, Eina_Bool set_markup) +_edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text, Eina_Bool set_markup, Eina_Bool legacy) { if ((rp->type != EDJE_RP_TYPE_TEXT) || (!rp->typedata.text)) return EINA_TRUE; @@ -1861,18 +1861,25 @@ _edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Par else if (text) { -if (set_markup && (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)) +if (legacy) { - char *mkup; - mkup = -efl_text_markup_util_text_to_markup(EFL_TEXT_MARKUP_UTIL_CLASS, -text); - rp->typedata.text->text = eina_stringshare_add(mkup); - free(mkup); + rp->typedata.text->text = eina_stringshare_add(text); } -else +else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) { - rp->typedata.text->text = eina_stringshare_add(text); + if (set_markup) + { + rp->typedata.text->text = eina_stringshare_add(text); + } + else + { + char *mkup; + mkup = efl_text_markup_util_text_to_markup( + EFL_TEXT_MARKUP_UTIL_CLASS, + text); + rp->typedata.text->text = eina_stringshare_add(mkup); + free(mkup); + } } } ed->dirty = EINA_TRUE; @@ -1891,7 +1898,7 @@ Eina_Bool _edje_object_part_text_raw_set(Edje *ed, Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text) { return _edje_object_part_text_raw_generic_set(ed, obj, rp, part, text, - EINA_FALSE); + EINA_FALSE, EINA_TRUE); } void @@ -1924,7 +1931,7 @@ _edje_user_define_string(Edje *ed, const char *part, const char *raw_text, Edje_ Eina_Bool _edje_efl_text_set(Eo *obj, Edj
[EGIT] [core/efl] master 02/02: Ui layout: handle Efl.Text legacy code better
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3462390b5cda12ca0b37cf00a2a20a5d3636d4b5 commit 3462390b5cda12ca0b37cf00a2a20a5d3636d4b5 Author: Daniel Hirt Date: Sun Oct 1 18:40:50 2017 +0300 Ui layout: handle Efl.Text legacy code better This should cover the cases without need to duplicate a lot of code. Follow-up to deca3c947ff1a2bed3f4baadce576105055af266. --- src/lib/elementary/efl_ui_layout.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 37fe34d29f..d091b0500b 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -1255,17 +1255,19 @@ _efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *par if (!text) return EINA_TRUE; - if (is_markup) + if (wd->legacy) { if (!edje_object_part_text_escaped_set (wd->resize_obj, part, text)) return EINA_FALSE; } + else if (is_markup) + { +efl_text_markup_set(efl_part(wd->resize_obj, part), text); + } else { -if (!edje_object_part_text_unescaped_set - (wd->resize_obj, part, text)) - return EINA_FALSE; +efl_text_set(efl_part(wd->resize_obj, part), text); } if (!sub_d) --
[EGIT] [core/efl] master 01/01: Canvas layout: fix legacy text set
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=af1595fd0160f76de82cddeb2576143f65492c0b commit af1595fd0160f76de82cddeb2576143f65492c0b Author: Daniel Hirt Date: Sun Oct 1 11:37:42 2017 +0300 Canvas layout: fix legacy text set Keep the legacy code path when using edje_object_part_text_set. Fixes e's notification that got broken after 3642b3ae679e3bedba4155fb9e54b44483b3b9e1. Also, limit new efl_text_markup set to TEXTBLOCK parts. --- src/lib/edje/edje_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 8ed6cc3d0a..c175c140f1 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1861,7 +1861,7 @@ _edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Par else if (text) { -if (set_markup) +if (set_markup && (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)) { char *mkup; mkup = @@ -6134,7 +6134,7 @@ edje_object_part_swallow_get(const Edje_Object *obj, const char *part) EAPI Eina_Bool edje_object_part_text_set(const Edje_Object *obj, const char *part, const char *text) { - efl_text_markup_set(efl_part(obj, part), text); + efl_text_set(efl_part(obj, part), text); return EINA_TRUE; } --
[EGIT] [core/efl] master 03/05: Canvas text: use EINA_UNUSED for unused variables
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e34efbed9663cd6eceb7e31bee04c35b2863b1fe commit e34efbed9663cd6eceb7e31bee04c35b2863b1fe Author: Daniel Hirt Date: Thu Sep 28 19:29:35 2017 +0300 Canvas text: use EINA_UNUSED for unused variables Nothing special here. No need to for the "(void) eo_obj". --- src/lib/evas/canvas/evas_object_textblock.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index f4e63c897c..44006d2860 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -7986,13 +7986,12 @@ evas_textblock_text_markup_to_utf8(const Evas_Object *eo_obj, const char *text) } EAPI char * -evas_textblock_text_utf8_to_markup(const Evas_Object *eo_obj, const char *text) +evas_textblock_text_utf8_to_markup(const Evas_Object *eo_obj EINA_UNUSED, + const char *text) { Eina_Strbuf *sbuf; char *str = NULL; - (void) eo_obj; - if (!text) return NULL; sbuf = eina_strbuf_new(); @@ -8002,7 +8001,6 @@ evas_textblock_text_utf8_to_markup(const Evas_Object *eo_obj, const char *text) str = eina_strbuf_string_steal(sbuf); eina_strbuf_free(sbuf); return str; - } static void --
[EGIT] [core/efl] master 05/05: Ui layout: support markup for efl_part()
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=deca3c947ff1a2bed3f4baadce576105055af266 commit deca3c947ff1a2bed3f4baadce576105055af266 Author: Daniel Hirt Date: Thu Sep 28 10:27:32 2017 +0300 Ui layout: support markup for efl_part() Also implement markup_set/get for: - Efl.Ui.Frame - Efl.Ui.Slider Users may choose between text_set/get and markup_set/get, depending on whether they want to escape their text or not. --- src/lib/elementary/efl_ui_button.eo | 3 +- src/lib/elementary/efl_ui_frame.c | 1 + src/lib/elementary/efl_ui_frame.eo | 3 +- src/lib/elementary/efl_ui_layout.c | 41 ++--- src/lib/elementary/efl_ui_layout_part_legacy.eo | 2 ++ src/lib/elementary/efl_ui_layout_part_text.eo | 3 +- src/lib/elementary/efl_ui_slider.c | 1 + src/lib/elementary/efl_ui_slider.eo | 5 +-- src/lib/elementary/elm_entry_part.eo| 2 +- src/lib/elementary/elm_label.c | 2 +- src/lib/elementary/elm_part_helper.h| 37 ++ 11 files changed, 89 insertions(+), 11 deletions(-) diff --git a/src/lib/elementary/efl_ui_button.eo b/src/lib/elementary/efl_ui_button.eo index 021c8229b2..d349b7a97a 100644 --- a/src/lib/elementary/efl_ui_button.eo +++ b/src/lib/elementary/efl_ui_button.eo @@ -1,4 +1,5 @@ -class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat, Efl.Text, +class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat, + Efl.Text, Efl.Text.Markup, Elm.Interface.Atspi_Widget_Action, Efl.Ui.Translatable) { [[Push-button widget diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c index 5f07ba8e23..e023999fe1 100644 --- a/src/lib/elementary/efl_ui_frame.c +++ b/src/lib/elementary/efl_ui_frame.c @@ -257,6 +257,7 @@ _efl_ui_frame_class_constructor(Efl_Class *klass) } ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_frame, Efl_Ui_Frame_Data) +ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_frame, Efl_Ui_Frame_Data) /* Internal EO APIs and hidden overrides */ diff --git a/src/lib/elementary/efl_ui_frame.eo b/src/lib/elementary/efl_ui_frame.eo index 21e305c458..9282901be4 100644 --- a/src/lib/elementary/efl_ui_frame.eo +++ b/src/lib/elementary/efl_ui_frame.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text, +class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text, Efl.Text.Markup, Efl.Ui.Translatable) { [[Frame widget @@ -62,6 +62,7 @@ class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text, Elm.Widget.focus_next; Elm.Widget.focus_direction_manager_is; Efl.Text.text { get; set; } + Efl.Text.Markup.markup { get; set; } Efl.Ui.Translatable.translatable_text { get; set; } } } diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 6ba041d75d..37fe34d29f 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -1225,7 +1225,7 @@ _efl_ui_layout_efl_container_content_count(Eo *eo_obj EINA_UNUSED, Efl_Ui_Layout } static Eina_Bool -_efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const char *text) +_efl_ui_layout_text_generic_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const char *text, Eina_Bool is_markup) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); @@ -1255,9 +1255,18 @@ _efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const if (!text) return EINA_TRUE; - if (!edje_object_part_text_escaped_set + if (is_markup) + { +if (!edje_object_part_text_escaped_set (wd->resize_obj, part, text)) - return EINA_FALSE; + return EINA_FALSE; + } + else + { +if (!edje_object_part_text_unescaped_set + (wd->resize_obj, part, text)) + return EINA_FALSE; + } if (!sub_d) { @@ -1296,12 +1305,32 @@ _efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const return EINA_TRUE; } +static Eina_Bool +_efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const char *text) +{ + return _efl_ui_layout_text_generic_set(obj, sd, part, text, EINA_FALSE); +} + static const char* _efl_ui_layout_text_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); - return edje_object_part_text_get(wd->resize_obj, part); + return efl_text_get(efl_part(wd->resize_obj, part)); +} + +static const char* +_efl_ui_layout_text_markup_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); + + return efl_text_markup_get(efl_part(wd->resize_obj, part)); +} + +s
[EGIT] [core/efl] master 01/05: Efl text: add Efl.Text.Markup interface
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=69d0646b33f932194a59f1f3499c45591b92be96 commit 69d0646b33f932194a59f1f3499c45591b92be96 Author: Daniel Hirt Date: Mon Sep 25 19:21:21 2017 +0300 Efl text: add Efl.Text.Markup interface Adds basic markup operations for text objects, and implements it in Efl.Canvas.Text. Also, this adds the Efl.Text.Markup_Util class. This utility class allows basic text-markup conversions. @feature --- src/Makefile_Efl.am| 3 + src/lib/efl/Efl.h | 2 + src/lib/efl/interfaces/efl_interfaces_main.c | 1 + src/lib/efl/interfaces/efl_text_markup.eo | 21 ++ src/lib/efl/interfaces/efl_text_markup_util.c | 500 + src/lib/efl/interfaces/efl_text_markup_util.eo | 30 ++ src/lib/evas/canvas/efl_canvas_text.eo | 7 +- src/lib/evas/canvas/evas_object_textblock.c| 59 ++- 8 files changed, 613 insertions(+), 10 deletions(-) diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 25dde93a7c..83e861fb88 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -26,6 +26,8 @@ efl_eolian_files = \ lib/efl/interfaces/efl_text_format.eo \ lib/efl/interfaces/efl_text_cursor.eo \ lib/efl/interfaces/efl_text_annotate.eo \ + lib/efl/interfaces/efl_text_markup.eo \ + lib/efl/interfaces/efl_text_markup_util.eo \ lib/efl/interfaces/efl_text_properties.eo \ lib/efl/interfaces/efl_gfx_stack.eo \ lib/efl/interfaces/efl_gfx_view.eo \ @@ -125,6 +127,7 @@ lib/efl/interfaces/efl_io_writer.c \ lib/efl/interfaces/efl_io_buffer.c \ lib/efl/interfaces/efl_io_queue.c \ lib/efl/interfaces/efl_observer.c \ +lib/efl/interfaces/efl_text_markup_util.c \ $(NULL) lib_efl_libefl_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_srcdir)/src/lib/efl @EFL_CFLAGS@ -DEFL_GFX_FILTER_BETA diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 82a1e3d460..1b5a9bcfe7 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -163,6 +163,8 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_text_format.eo.h" #include "interfaces/efl_text_cursor.eo.h" #include "interfaces/efl_text_annotate.eo.h" +#include "interfaces/efl_text_markup.eo.h" +#include "interfaces/efl_text_markup_util.eo.h" #else diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index ded13b6ece..fc80036fb4 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -19,6 +19,7 @@ #include "interfaces/efl_text_format.eo.c" #include "interfaces/efl_text_cursor.eo.c" #include "interfaces/efl_text_annotate.eo.c" +#include "interfaces/efl_text_markup.eo.c" #include "interfaces/efl_gfx.eo.c" #include "interfaces/efl_gfx_buffer.eo.c" diff --git a/src/lib/efl/interfaces/efl_text_markup.eo b/src/lib/efl/interfaces/efl_text_markup.eo new file mode 100644 index 00..99ea34b4ba --- /dev/null +++ b/src/lib/efl/interfaces/efl_text_markup.eo @@ -0,0 +1,21 @@ +interface Efl.Text.Markup(Efl.Text.Cursor) { + [[Markup data that populates the text object's style and format + + @since 1.21 + ]] + methods { + @property markup { + values { +markup: string; [[The markup-text representation set to this text.]] + } + } + cursor_markup_insert { + [[Inserts a markup text to the text object in a given cursor position]] + params { +cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor position to insert markup]] +@in markup: string; [[The markup text to insert]] + } + } + } +} + diff --git a/src/lib/efl/interfaces/efl_text_markup_util.c b/src/lib/efl/interfaces/efl_text_markup_util.c new file mode 100644 index 00..9c8a9cf55d --- /dev/null +++ b/src/lib/efl/interfaces/efl_text_markup_util.c @@ -0,0 +1,500 @@ +#include "config.h" +#include "Efl.h" + +#define MY_CLASS EFL_TEXT_MARKUP_UTIL_CLASS + +#define ERR(...) EINA_LOG_DOM_ERR(EINA_LOG_DOMAIN_DEFAULT, __VA_ARGS__) + +#define _REPLACEMENT_CHAR 0xFFFC +#define _PARAGRAPH_SEPARATOR 0x2029 +#define _NEWLINE '\n' +#define _TAB '\t' + +#define _REPLACEMENT_CHAR_UTF8 "\xEF\xBF\xBC" +#define _PARAGRAPH_SEPARATOR_UTF8 "\xE2\x80\xA9" +#define _NEWLINE_UTF8 "\n" +#define _TAB_UTF8 "\t" +#define EVAS_TEXTBLOCK_IS_VISIBLE_FORMAT_CHAR(ch) \ + (((ch) == _REPLACEMENT_CHAR) || \ +((ch) == _NEWLINE) || \ +((ch) == _TAB) || \ +((ch) == _PARAGRAPH_SEPARATOR)) + +#define _IS_TAB(item) \ + (!strcmp(item, "tab") || !strcmp(item, "\t") || !strcmp(
[EGIT] [core/efl] master 02/05: Ui text: add test for Efl.Text.Markup
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7915cc3e1d2f0b416ebb6f7d81c17d3fa08eaa55 commit 7915cc3e1d2f0b416ebb6f7d81c17d3fa08eaa55 Author: Daniel Hirt Date: Thu Sep 28 19:26:41 2017 +0300 Ui text: add test for Efl.Text.Markup --- src/bin/elementary/test_efl_ui_text.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 3934af4b0e..a8629a8e09 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -39,6 +39,7 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi { Evas_Object *win, *bx; Eo *en; + char *markup; win = elm_win_util_standard_add("label", "Label"); elm_win_autodel_set(win, EINA_TRUE); @@ -85,7 +86,34 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi efl_ui_text_scrollable_set(en, EINA_TRUE); evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.5); - evas_object_resize(win, 480, 320); + en = _create_label(win, bx); + efl_text_markup_set(en, "You can also ENTER markup!"); + efl_text_font_set(en, "Sans", 14); + efl_text_wrap_set(en, EFL_TEXT_FORMAT_WRAP_WORD); + efl_text_multiline_set(en, EINA_TRUE); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.5); + + en = _create_label(win, bx); + markup = efl_text_markup_util_text_to_markup(EFL_TEXT_MARKUP_UTIL_CLASS, + "You can use the text -> markup helper\nto make coding easier."); + efl_text_markup_set(en, markup); + free(markup); + efl_text_font_set(en, "Sans", 14); + efl_text_wrap_set(en, EFL_TEXT_FORMAT_WRAP_WORD); + efl_text_multiline_set(en, EINA_TRUE); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.5); + + en = _create_label(win, bx); + markup = efl_text_markup_util_markup_to_text(EFL_TEXT_MARKUP_UTIL_CLASS, + "You can use markup -> text helpersto make coding easier."); + efl_text_set(en, markup); + free(markup); + efl_text_font_set(en, "Sans", 14); + efl_text_wrap_set(en, EFL_TEXT_FORMAT_WRAP_WORD); + efl_text_multiline_set(en, EINA_TRUE); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.5); + + evas_object_resize(win, 480, 480); evas_object_show(win); } --
[EGIT] [core/efl] master 04/05: Canvas layout: support markup for efl_part
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3642b3ae679e3bedba4155fb9e54b44483b3b9e1 commit 3642b3ae679e3bedba4155fb9e54b44483b3b9e1 Author: Daniel Hirt Date: Thu Sep 28 09:46:42 2017 +0300 Canvas layout: support markup for efl_part Users can now do either: efl_text_set(efl_part(obj, "part"), "text"); efl_text_markup_set(efl_part(obj, "part"), "text"); Also have efl_text_get/markup_get. Using markup_set will allow to choose whether to set a markup or a text to the text part. --- src/lib/edje/edje_part_text.c | 27 +--- src/lib/edje/edje_private.h | 6 ++- src/lib/edje/edje_util.c| 68 + src/lib/edje/efl_canvas_layout_part_text.eo | 5 ++- 4 files changed, 89 insertions(+), 17 deletions(-) diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c index dc5a944743..0e5e4aa4ae 100644 --- a/src/lib/edje/edje_part_text.c +++ b/src/lib/edje/edje_part_text.c @@ -11,7 +11,7 @@ _efl_canvas_layout_part_text_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text) { PROXY_DATA_GET(obj, pd); - _edje_efl_text_set(obj, pd->ed, pd->part, text); + _edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_FALSE); RETURN_VOID; } @@ -20,9 +20,27 @@ _efl_canvas_layout_part_text_efl_text_text_get(Eo *obj, void *_pd EINA_UNUSED) { PROXY_DATA_GET(obj, pd); - RETURN_VAL(_edje_efl_text_get(obj, pd->ed, pd->part)); + RETURN_VAL(_edje_efl_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_FALSE)); } +EOLIAN static const char * +_efl_canvas_layout_part_text_efl_text_markup_markup_get(Eo *obj, + void *_pd EINA_UNUSED) +{ + PROXY_DATA_GET(obj, pd); + RETURN_VAL(_edje_efl_text_get(obj, pd->ed, pd->part, EINA_FALSE, EINA_TRUE)); +} + +EOLIAN static void +_efl_canvas_layout_part_text_efl_text_markup_markup_set(Eo *obj, + void *_pd EINA_UNUSED, const char *text) +{ + PROXY_DATA_GET(obj, pd); + _edje_efl_text_set(obj, pd->ed, pd->part, text, EINA_TRUE); + RETURN_VOID; +} + + EOLIAN static Efl_Text_Cursor_Cursor * _efl_canvas_layout_part_text_efl_text_cursor_cursor_get(Eo *obj, void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor_Get_Type get_type) @@ -180,8 +198,8 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_geometry_get(Eo *obj, RETURN_VAL(EINA_FALSE); } -EOLIAN static int -_efl_canvas_layout_part_text_efl_text_cursor_cursor_text_insert(Eo *obj, +EOLIAN static void +_efl_canvas_layout_part_text_efl_text_markup_cursor_markup_insert(Eo *obj, void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED, const char *text) { @@ -189,7 +207,6 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_text_insert(Eo *obj, // Ignoring cursor type and always inserting with main cursor _edje_object_part_text_insert(pd->ed, pd->rp, text); // FIXME: entry should report the length of inserted text (after filtering) - RETURN_VAL(0); } #include "efl_canvas_layout_part_text.eo.c" diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 19421c03ed..c65f560071 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -3160,8 +3160,10 @@ Evas_Object *_edje_object_part_external_content_get(Edje *ed, const char *part, /* part text */ Eo *_edje_text_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp); -Eina_Bool _edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text); -const char *_edje_efl_text_get(Eo *obj, Edje *ed, const char *part); +Eina_Bool _edje_efl_text_set(Eo *obj, Edje *ed, const char *part, const char *text, Eina_Bool set_markup); +const char *_edje_efl_text_get(Eo *obj, Edje *ed, const char *part, Eina_Bool legacy, Eina_Bool get_markup); +Eina_Bool _edje_efl_text_markup_set(Eo *obj, Edje *ed, const char *part, const char *markup); +const char *_edje_efl_text_markup_get(Eo *obj, Edje *ed, const char *part); Evas_Textblock_Cursor *_edje_text_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur); void _edje_text_cursor_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); void _edje_text_cursor_end(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 36f7ce3eda..8ed6cc3d0a 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1842,7 +1842,7 @@ _edje_object_text_change_cb_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Text_Change_ } Eina_Bool -_edje_object_part_text_raw_set(Edje *ed, Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text) +_edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Part *rp, const char *part, const char *text, Eina_Bool set_markup) { if ((rp->type != EDJE_RP_TYPE_TEXT) || (!r
[EGIT] [core/efl] master 01/01: Evas textblock: fix ascent/descent calc
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bfa7d2a3b2d6dbd20d6232e950d538611fdb7a9e commit bfa7d2a3b2d6dbd20d6232e950d538611fdb7a9e Author: Daniel Hirt Date: Tue Sep 26 10:38:46 2017 +0300 Evas textblock: fix ascent/descent calc This is a follow-up to 4d4401f3a60024a0762393c3984065b73927eb86. The format line adjustment (e.g. linegap) should calculate the current item's ascent/descent, and then update c->ascent/c->descent. Otherwise we accumulate calculations like linegap values ref D5217 --- src/lib/evas/canvas/evas_object_textblock.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index d371ab00a9..60d2ff0545 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3032,25 +3032,22 @@ _layout_item_ascent_descent_adjust(Evas_Object_Protected_Data *obj, } } - if (fmt) - { -asc = ENFN->font_ascent_get(ENC, fmt->font.font); -desc = ENFN->font_descent_get(ENC, fmt->font.font); - -if (asc > *ascent) *ascent = asc; -if (desc > *descent) *descent = desc; - } - if (fi) { asc = evas_common_font_instance_ascent_get(fi); desc = evas_common_font_instance_descent_get(fi); + } -if (asc > *ascent) *ascent = asc; -if (desc > *descent) *descent = desc; + else if (fmt) + { +asc = ENFN->font_ascent_get(ENC, fmt->font.font); +desc = ENFN->font_descent_get(ENC, fmt->font.font); } - if (fmt) _layout_format_ascent_descent_adjust(obj, ascent, descent, fmt); + if (fmt) _layout_format_ascent_descent_adjust(obj, &asc, &desc, fmt); + + if (asc > *ascent) *ascent = asc; + if (desc > *descent) *descent = desc; } /** --
[EGIT] [core/efl] master 01/04: Canvas text: use eina_value_set and not eina_value_pset
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b7b5d089296839b4851fb7f87f1ee7cb71fdcd8d commit b7b5d089296839b4851fb7f87f1ee7cb71fdcd8d Author: Daniel Hirt Date: Mon Sep 25 12:36:14 2017 +0300 Canvas text: use eina_value_set and not eina_value_pset CID 1381327 --- src/lib/evas/canvas/evas_object_textblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 42e0ac14e2..ac39ea65d6 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -15912,7 +15912,7 @@ _resolve_async(Text_Promise_Ctx *td, Evas_Coord w, Evas_Coord h) Eina_Value v; Eina_Rectangle r = { 0, 0, w, h }; eina_value_setup(&v, EINA_VALUE_TYPE_RECTANGLE); - eina_value_pset(&v, &r); + eina_value_set(&v, r); eina_promise_resolve(td->p, v); free(td); } --
[EGIT] [core/efl] master 03/04: Canvas text: don't generate legacy for new api
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4f77eca4e175b660ad4fd841c5e27fa74725fb53 commit 4f77eca4e175b660ad4fd841c5e27fa74725fb53 Author: Daniel Hirt Date: Mon Sep 25 12:45:12 2017 +0300 Canvas text: don't generate legacy for new api This is part of the new Canvas.Text. --- src/lib/evas/canvas/efl_canvas_text.eo | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo index b0f075f1bf..d18c9bf93f 100644 --- a/src/lib/evas/canvas/efl_canvas_text.eo +++ b/src/lib/evas/canvas/efl_canvas_text.eo @@ -260,6 +260,7 @@ Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor, Efl.Text.Annota @since 1.21 ]] + legacy: null; return: ptr(Eina.Future) @owned; [[Future for layout result]] } } --
[EGIT] [core/efl] master 04/04: Ui text: use proper Efl.Text API to set text
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ad3199ffc875fd0afc5989ff3994aa27aaf5ecf1 commit ad3199ffc875fd0afc5989ff3994aa27aaf5ecf1 Author: Daniel Hirt Date: Mon Sep 25 12:49:11 2017 +0300 Ui text: use proper Efl.Text API to set text Fixes error message during initialization. --- src/lib/elementary/efl_ui_text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index eca73c3f45..8e94762da8 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -3142,7 +3142,7 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv) (priv->entry_edje, "entry,redo,request", "elm.text", _entry_redo_request_signal_cb, obj); - elm_layout_text_set(obj, "elm.text", ""); + efl_text_set(priv->text_obj, ""); elm_object_sub_cursor_set (wd->resize_obj, obj, ELM_CURSOR_XTERM); --
[EGIT] [core/efl] master 02/04: Ui text: use eina_value_get and not eina_value_pget
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f5560cb5118ee7ffceb3cceb9c7690713aae5687 commit f5560cb5118ee7ffceb3cceb9c7690713aae5687 Author: Daniel Hirt Date: Mon Sep 25 12:39:42 2017 +0300 Ui text: use eina_value_get and not eina_value_pget CID 1381328 --- src/lib/elementary/efl_ui_text.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 2f1232a9b4..eca73c3f45 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -1117,8 +1117,10 @@ _on_layout_complete(void *data, const Eina_Value v) { Layout_Ctx *c = data; Eina_Rectangle r; - eina_value_pget(&v, &r); - _layout_text_sizing_eval(c->obj, 1, 1); + if (eina_value_get(&v, &r)) + { +_layout_text_sizing_eval(c->obj, r.w, r.h); + } free(c); return v; } --
[EGIT] [core/efl] master 01/02: Canvas text async: add async layout functionality
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b63c3620dff8930f4ad029351c6d455414062c02 commit b63c3620dff8930f4ad029351c6d455414062c02 Author: Daniel Hirt Date: Mon Sep 4 19:16:27 2017 +0300 Canvas text async: add async layout functionality This adds the 'async_layout' method. The 'async layout' method is similar to 'size_formatted_get', but done outside of the mainloop. When a call is made to this method, a thread is created (after some preparation like updating the logical text items), and the visual layout is offloaded to that thread. The result is returned as Eina.Future. The mainloop is blocked for operations that manipulate the object, if a thread has already been created but hasn't complete its work. Consecutive calls for async layout for the same object are not handled simultaneously. Each time the threads has complete its work, the next (if exists) layout will be dispatched. @feature --- src/lib/evas/canvas/efl_canvas_text.eo | 10 + src/lib/evas/canvas/evas_object_textblock.c | 559 2 files changed, 419 insertions(+), 150 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo index 0cbe8e1031..7d7b0f9b33 100644 --- a/src/lib/evas/canvas/efl_canvas_text.eo +++ b/src/lib/evas/canvas/efl_canvas_text.eo @@ -252,6 +252,16 @@ Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor, Efl.Text.Annota @since 1.18 ]] } + async_layout { + [[Requests to layout the text off the mainloop. + + Once layout is complete, the result is returned as @Eina.Rect, + with w, h fields set. + + @since 1.21 + ]] + return: ptr(Eina.Future) @owned; [[Future for layout result]] + } } implements { Efl.Object.constructor; diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 20b0a7913a..b63362a185 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -579,8 +579,19 @@ struct _Efl_Text_Annotate_Annotation /* Size of the index array */ #define TEXTBLOCK_PAR_INDEX_SIZE 10 + +#define ASYNC_BLOCK do { \ + if (o->layout_th) \ + { \ +ecore_thread_wait(o->layout_th, 1); \ + }} while(0) + +#include "Ecore.h" + struct _Evas_Object_Textblock { + Ecore_Thread *layout_th; + int layout_jobs; Evas_Textblock_Style *style; Eina_List *styles; Efl_Text_Cursor_Cursor*cursor; @@ -2876,6 +2887,9 @@ struct _Ctxt int underline_extend; int have_underline, have_underline2; double align, valign; + struct { +int l, r, t, b; + } style_pad; Textblock_Position position; Evas_Textblock_Align_Auto align_auto : 2; Eina_Bool width_changed : 1; @@ -6118,12 +6132,17 @@ _layout_split_text_because_format(const Evas_Object_Textblock_Format *fmt, /** FIXME: Document */ static void -_layout_pre(Ctxt *c, int *style_pad_l, int *style_pad_r, int *style_pad_t, - int *style_pad_b) +_layout_pre(Ctxt *c) { + int *style_pad_l, *style_pad_r, *style_pad_t, *style_pad_b; Evas_Object *eo_obj = c->obj; Efl_Canvas_Text_Data *o = c->o; + style_pad_l = &c->style_pad.l; + style_pad_r = &c->style_pad.r; + style_pad_b = &c->style_pad.b; + style_pad_t = &c->style_pad.t; + /* Mark text nodes as dirty if format have changed. */ if (o->format_changed) _format_changes_invalidate_text_nodes(c); @@ -6306,105 +6325,6 @@ _layout_pre(Ctxt *c, int *style_pad_l, int *style_pad_r, int *style_pad_t, if (o->style_pad.t > *style_pad_t) *style_pad_t = o->style_pad.t; if (o->style_pad.b > *style_pad_b) *style_pad_b = o->style_pad.b; } -} - -/** - * @internal - * Create the layout from the nodes. - * - * @param obj the evas object - NOT NULL. - * @param calc_only true if should only calc sizes false if should also create the layout.. It assumes native size is being calculated, doesn't support formatted size atm. - * @param w the object's w, -1 means no wrapping (i.e infinite size) - * @param h the object's h, -1 means inifinte size. - * @param w_ret the object's calculated w. - * @param h_ret the object's calculated h. - */ -static void -_layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret) -{ - Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); - Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); - Ctxt ctxt, *c; - Evas *eo_e; - int style_pad_l = 0, style_pad_r = 0, style_pad_t = 0, styl
[EGIT] [core/efl] master 02/02: Ui text: add Efl.Ui.Text_Async object
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1a854d892f83b6933d3523cf7d188215600df04d commit 1a854d892f83b6933d3523cf7d188215600df04d Author: Daniel Hirt Date: Tue Sep 12 08:38:51 2017 +0300 Ui text: add Efl.Ui.Text_Async object Adds "Efl.Ui.Text_Async" object. This new widget uses the "async_layout" functionality of the underlying Efl.Canvas.Text object. Currently, if "editable" mode is enabled, there is no asynchronous layout, as interactive operations (e.g. typing) should get processed immediately. Thus, only "non-editable" instructs the text object to do asynchronous layout. @feature --- src/Makefile_Elementary.am | 1 + src/bin/elementary/test.c | 2 + src/bin/elementary/test_efl_ui_text.c | 49 src/lib/elementary/Elementary.h | 1 + src/lib/elementary/efl_ui_text.c| 207 ++-- src/lib/elementary/efl_ui_text_async.eo | 11 ++ 6 files changed, 206 insertions(+), 65 deletions(-) diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 119668dcd6..a7f28742dd 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -124,6 +124,7 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_text_interactive.eo \ lib/elementary/efl_ui_text.eo \ lib/elementary/efl_ui_text_editable.eo \ + lib/elementary/efl_ui_text_async.eo \ lib/elementary/efl_config_global.eo \ lib/elementary/efl_ui_clock.eo \ lib/elementary/efl_ui_cursor.eo \ diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 87bd979330..8220261035 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -313,6 +313,7 @@ void test_code_diff_inline(void *data, Evas_Object *obj, void *event_info); void test_efl_ui_text(void *data, Evas_Object *obj, void *event_info); void test_efl_ui_text_label(void *data, Evas_Object *obj, void *event_info); +void test_efl_ui_text_async(void *data, Evas_Object *obj, void *event_info); void test_evas_mask(void *data, Edje_Object *obj, void *event_info); void test_gfx_filters(void *data, Evas_Object *obj, void *event_info); void test_evas_snapshot(void *data, Evas_Object *obj, void *event_info); @@ -749,6 +750,7 @@ add_tests: ADD_TEST(NULL, "Entries", "Entry Password", test_entry_password); ADD_TEST(NULL, "Entries", "Efl UI Text", test_efl_ui_text); ADD_TEST(NULL, "Entries", "Efl UI Text Label", test_efl_ui_text_label); + ADD_TEST(NULL, "Entries", "Efl UI Text Async", test_efl_ui_text_async); //--// ADD_TEST(NULL, "Advanced Entries", "Code Entry Markup", test_code_welcome); diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index e7e70ed22d..3934af4b0e 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -255,3 +255,52 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve evas_object_resize(win, 480, 320); evas_object_show(win); } + +void +test_efl_ui_text_async(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Evas_Object *win, *bx, *bx2, *bx3, *en; + + win = elm_win_util_standard_add("entry", "Entry"); + elm_win_autodel_set(win, EINA_TRUE); + + bx = elm_box_add(win); + evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, bx); + evas_object_show(bx); + + en = efl_add(EFL_UI_TEXT_ASYNC_CLASS, win, + efl_text_wrap_set(efl_added, EFL_TEXT_FORMAT_WRAP_WORD), + efl_text_multiline_set(efl_added, EINA_TRUE) + ); + + printf("Added Efl.Ui.Text object\n"); + efl_key_data_set(en, "wrap_idx", 0); + efl_text_set(en, "Hello world! Goodbye world! This is a test text for the" + " new UI Text widget.\xE2\x80\xA9This is the next paragraph.\nThis" + " is the next line.\nThis is Yet another line! Line and paragraph" + " separators are actually different!"); + efl_text_font_set(en, "Sans", 10); + efl_text_normal_color_set(en, 255, 255, 255, 255); + + elm_box_pack_end(bx, en); + elm_object_focus_set(en, EINA_TRUE); + + bx2 = elm_box_add(win); + elm_box_horizontal_set(bx2, EINA_TRUE); + evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL); + + bx3 = elm_box_add(win); + elm_box_horizontal_set(bx3, EINA_TRUE); + evas_object_size_hint_weight_set(bx3, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(bx3, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_box
[EGIT] [core/efl] master 02/03: Edje: move selection-related part_text API to legacy
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d44131a3aa220b6482b3eb62e207c8c05c10e02e commit d44131a3aa220b6482b3eb62e207c8c05c10e02e Author: Daniel Hirt Date: Tue Sep 19 19:36:43 2017 +0300 Edje: move selection-related part_text API to legacy --- src/lib/edje/Edje_Legacy.h | 65 src/lib/edje/edje_object.eo | 64 --- src/lib/edje/edje_util.c | 54 - src/lib/elementary/efl_ui_text.c | 7 - src/lib/elementary/elm_entry.c | 6 ++-- 5 files changed, 102 insertions(+), 94 deletions(-) diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index 2e1efc8ed4..7086acb4bc 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -2549,6 +2549,71 @@ EAPI Eina_Bool edje_object_part_text_input_panel_show_on_demand_get(const Edje_O EAPI void edje_object_part_text_prediction_hint_set(Edje_Object *obj, const char *part, const char *prediction_hint); /** + * @brief Starts selecting at current cursor position + * + * @param[in] part The part name + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_select_begin(const Edje_Object *obj, const char *part); + +/** + * @brief Aborts any selection action on a part. + * + * @param[in] part The part name + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_select_abort(const Edje_Object *obj, const char *part); + +/** + * @brief Extends the current selection to the current cursor position + * + * @param[in] part The part name + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_select_extend(const Edje_Object *obj, const char *part); + +/** + * @brief Sets the selection to be everything. + * + * This function selects all text of the object of the part. + * + * @param[in] part The part name + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_select_all(const Edje_Object *obj, const char *part); + +/** + * @brief Sets the selection to be none. + * + * This function sets the selection text to be none. + * + * @param[in] part The part name + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_select_none(const Edje_Object *obj, const char *part); + +/** + * @brief Returns the selection text of the object part. + * + * This function returns selection text of the object part. + * + * See also @ref edje_object_part_text_select_all() and + * @ref edje_object_part_text_select_none() + * + * @param[in] part The part name + * + * @return The text string + * + * @ingroup Edje_Object + */ +EAPI const char *edje_object_part_text_selection_get(const Edje_Object *obj, const char *part); + +/** * @brief Whether this object is playing or not. * * This property indicates whether the object is running or not. If stopped (or diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo index 2463b8408e..9c4a84bf56 100644 --- a/src/lib/edje/edje_object.eo +++ b/src/lib/edje/edje_object.eo @@ -365,70 +365,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part, data: void_ptr; [[The data pointer to pass to the func callback]] } } - @property part_text_select_allow { - set { -[[Enables selection if the entry is an EXPLICIT selection mode - type. - - The default is to not allow selection. This function only affects user - selection, functions such as edje_object_part_text_select_all() and - edje_object_part_text_select_none() are not affected.]] -legacy: null; - } - keys { -part: string; [[The part name]] - } - values { -allow: bool; [[$true to enable, $false otherwise]] - } - } - part_text_select_begin @const { - [[Starts selecting at current cursor position]] - params { -@in part: string; [[The part name]] - } - } - part_text_select_abort @const { - [[Aborts any selection action on a part.]] - params { -@in part: string; [[The part name]] - } - } - part_text_select_extend @const { - [[Extends the current selection to the current cursor position]] - params { -@in part: string; [[The part name]] - } - } - part_text_select_all @const { - [[Sets the selection to be everything. - - This function selects all text of the object of the part.]] - params { -@in part: string; [[The part name]] - } - } - part_text_select_none @const { - [[Sets the selection to be none. - - This function sets the selection text to be none.]] - params { -@in part: string; [[The part name]] - } - } - @property part_text_selection { - get
[EGIT] [core/efl] master 03/03: Ui text: add null checks for anchor update
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=acd1c409a02026f550ac61d37573692dc6da680f commit acd1c409a02026f550ac61d37573692dc6da680f Author: Daniel Hirt Date: Tue Sep 19 20:16:59 2017 +0300 Ui text: add null checks for anchor update Add null checks in case item was not found. Also use one more emoticon to test the provider. --- src/bin/elementary/test_efl_ui_text.c | 2 +- src/lib/elementary/efl_ui_text.c | 16 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 862c832e16..e7e70ed22d 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -117,7 +117,7 @@ my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E { Evas_Object *en = data; efl_text_cursor_object_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN), - "size=32x32 href=emoticon"); + "size=32x32 href=emoticon/evil-laugh"); } static void diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 1875e722a6..da1442e835 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -4805,6 +4805,8 @@ _item_obj_get(Anchor *an, Evas_Object *o, Evas_Object *smart, Evas_Object *clip) Eo *obj = an->obj; Evas_Object *item_obj; + if (!an->name) return NULL; + EFL_UI_TEXT_DATA_GET(obj, sd); EINA_INLIST_FOREACH(sd->item_objs, io) @@ -5089,12 +5091,16 @@ _anchors_update(Eo *o, Efl_Ui_Text_Data *sd) an->sel = eina_list_append(an->sel, rect); ob = _item_obj_get(an, o, smart, clip); - rect->obj = ob; - efl_text_object_item_geometry_get(an->obj, - an->annotation, &cx, &cy, &cw, &ch); - evas_object_move(rect->obj, x + cx, y + cy); - evas_object_resize(rect->obj, cw, ch); + if (ob) +{ + rect->obj = ob; + + efl_text_object_item_geometry_get(an->obj, + an->annotation, &cx, &cy, &cw, &ch); + evas_object_move(rect->obj, x + cx, y + cy); + evas_object_resize(rect->obj, cw, ch); +} } } // for link anchors --
[EGIT] [core/efl] master 01/03: Edje: move IMF-related part_text API to legacy
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=380b3eb09a785bab5d3bbd4921712c103b3cddd4 commit 380b3eb09a785bab5d3bbd4921712c103b3cddd4 Author: Daniel Hirt Date: Tue Sep 19 19:17:26 2017 +0300 Edje: move IMF-related part_text API to legacy --- src/lib/edje/Edje_Legacy.h | 392 src/lib/edje/edje_object.eo | 292 - src/lib/edje/edje_util.c| 216 3 files changed, 540 insertions(+), 360 deletions(-) diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index 28c69b6d77..2e1efc8ed4 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -2157,6 +2157,398 @@ EAPI char *edje_object_part_text_unescaped_get(const Edje_Object *obj, const cha EAPI void edje_object_part_text_insert(Edje_Object *obj, const char *part, const char *text); /** + * @brief Sets the autocapitalization type on the immodule. + * + * @param[in] part The part name + * @param[in] autocapital_type The type of autocapitalization + * + * @since 1.1.0 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_autocapital_type_set(Edje_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type); + +/** + * @brief Retrieves the autocapitalization type + * + * @param[in] part The part name + * + * @return The type of autocapitalization + * + * @since 1.1.0 + * + * @ingroup Edje_Object + */ +EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get(const Edje_Object *obj, const char *part); + +/** + * @brief Sets whether the prediction is allowed or not. + * + * @param[in] part The part name + * @param[in] prediction If @c true, the prediction feature is allowed. + * + * @since 1.2.0 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_prediction_allow_set(Edje_Object *obj, const char *part, Eina_Bool prediction); + +/** + * @brief Gets whether the prediction is allowed or not. + * + * @param[in] part The part name + * + * @return If @c true, the prediction feature is allowed. + * + * @since 1.2.0 + * + * @ingroup Edje_Object + */ +EAPI Eina_Bool edje_object_part_text_prediction_allow_get(const Edje_Object *obj, const char *part); + +/** + * @brief Gets the input method context in entry. + * + * If ecore_imf was not available when edje was compiled, this function returns + * @c null otherwise, the returned pointer is an Ecore_IMF + * + * @param[in] part The part name + * + * @return The input method context (Ecore_IMF_Context *) in entry + * + * @since 1.2.0 + * + * @ingroup Edje_Object + */ +EAPI void *edje_object_part_text_imf_context_get(const Edje_Object *obj, const char *part); + +/** + * @brief Resets the input method context if needed. + * + * This can be necessary in the case where modifying the buffer would confuse + * on-going input method behavior + * + * @param[in] part The part name + * + * @since 1.2.0 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_imf_context_reset(const Edje_Object *obj, const char *part); + +/** + * @brief Sets the input hint which allows input methods to fine-tune their + * behavior. + * + * @param[in] part The part name + * @param[in] input_hints Input hints + * + * @since 1.12.0 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_input_hint_set(Edje_Object *obj, const char *part, Edje_Input_Hints input_hints); + +/** + * @brief Gets the value of input hint + * + * @param[in] part The part name + * + * @return Input hints + * + * @since 1.12.0 + * + * @ingroup Edje_Object + */ +EAPI Edje_Input_Hints edje_object_part_text_input_hint_get(const Edje_Object *obj, const char *part); + +/** + * @brief Shows the input panel (virtual keyboard) based on the input panel + * property such as layout, autocapital types, and so on. + * + * Note that input panel is shown or hidden automatically according to the + * focus state. This API can be used in the case of manually controlling by + * using edje_object_part_text_input_panel_enabled_set. + * + * @param[in] part The part name + * + * @since 1.2.0 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_input_panel_show(const Edje_Object *obj, const char *part); + +/** + * @brief Hides the input panel (virtual keyboard). See also + * @ref edje_object_part_text_input_panel_show + * + * Note that input panel is shown or hidden automatically according to the + * focus state. This API can be used in the case of manually controlling by + * using edje_object_part_text_input_panel_enabled_set. + * + * @param[in] part The part name + * + * @since 1.2.0 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_input_panel_hide(const Edje_Object *obj, const char *part); + +/** + * @brief Sets the input panel-specific data to deliver to the input panel. + * + * This API is used by applications to deliver specific data to the input + * panel. The data format MUST be
[EGIT] [core/efl] master 01/02: Edje load: reset seats counter on file_del
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=61db4947f479a22230e5d5d739f21c0d7f910c5f commit 61db4947f479a22230e5d5d739f21c0d7f910c5f Author: Daniel Hirt Date: Mon Sep 18 19:33:42 2017 +0300 Edje load: reset seats counter on file_del The seats list got emptied, but the counter progression was kept, causing needless different seat names for the same device across different edje objects. --- src/lib/edje/edje_load.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index f1e5fc1d53..00f7b7a614 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -2105,6 +2105,7 @@ _edje_file_del(Edje *ed) eina_stringshare_del(seat->name); free(seat); } +ed->seats_count = 0; } if (ed->L) _edje_lua2_script_shutdown(ed); --
[EGIT] [core/efl] master 02/02: Entry: use _edje_seat_name_get to get the seat
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=128130285ad31b338a3ce25c2ccc23fe3e04d5fe commit 128130285ad31b338a3ce25c2ccc23fe3e04d5fe Author: Daniel Hirt Date: Mon Sep 18 19:37:06 2017 +0300 Entry: use _edje_seat_name_get to get the seat The "default" name doesn't mean a lot to edje. Use the helper function to get the proper seat name. This fixes IMF for the Entry widget, that did not get triggered on the hotkey combination. @fix --- src/lib/edje/edje_entry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index c58883667e..36a713262d 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -172,7 +172,7 @@ _edje_focus_in(Edje *ed, Efl_Input_Device *seat) _edje_seat_emit(ed, seat, "focus,in", ""); #ifdef HAVE_ECORE_IMF - rp = _edje_focused_part_get(ed, efl_name_get(seat)); + rp = _edje_focused_part_get(ed, _edje_seat_name_get(ed, seat)); if (!rp) return; if ((rp->type != EDJE_RP_TYPE_TEXT) || (!rp->typedata.text)) return; @@ -207,7 +207,7 @@ _edje_focus_out(Edje *ed, Efl_Input_Device *seat) _edje_seat_emit(ed, seat, "focus,out", ""); #ifdef HAVE_ECORE_IMF - rp = _edje_focused_part_get(ed, efl_name_get(seat)); + rp = _edje_focused_part_get(ed, _edje_seat_name_get(ed, seat)); if (!rp) return; if ((rp->type != EDJE_RP_TYPE_TEXT) || (!rp->typedata.text)) return; --
[EGIT] [core/efl] master 01/01: Ui text: reduce calls to update functions
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4dc2001dac617a8cd9a7381b4de83bcc68578859 commit 4dc2001dac617a8cd9a7381b4de83bcc68578859 Author: Daniel Hirt Date: Sat Sep 9 13:21:06 2017 +0300 Ui text: reduce calls to update functions Reduces calls to update functions when entering text. Also, remaining calls to update the cursors were moved to the decoration jobs. --- .../elementary/efl_ui_internal_text_interactive.c | 14 +++-- src/lib/elementary/efl_ui_text.c | 34 +- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index ee4c3c2c48..fd38f8dd5c 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -711,6 +711,9 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void int old_cur_pos; char *string = (char *)ev->string; Eina_Bool free_string = EINA_FALSE; + Eina_Bool changed_user = EINA_FALSE; + Efl_Ui_Text_Interactive_Change_Info info = { NULL, 0, 0, 0, 0 }; + if (!ev->key) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; @@ -1031,7 +1034,6 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void } if (string) { - Efl_Ui_Text_Interactive_Change_Info info = { NULL, 0, 0, 0, 0 }; if (en->have_selection) { _sel_range_del_emit(obj, en); @@ -1042,9 +1044,10 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void info.position = efl_text_cursor_position_get(obj, cur); info.length = eina_unicode_utf8_get_len(string); + efl_event_freeze(obj); efl_text_cursor_text_insert(obj, cur, string); - efl_event_callback_legacy_call(obj, - EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, &info); + efl_event_thaw(obj); + changed_user = EINA_TRUE; ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; @@ -1052,6 +1055,11 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void } } end: + if (changed_user) + { +efl_event_callback_legacy_call(obj, + EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, &info); + } (void) 0; } diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 914d0a57f7..fccb5c877c 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -1124,7 +1124,11 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd) evas_event_thaw(evas_object_evas_get(obj)); evas_event_thaw_eval(evas_object_evas_get(obj)); - _cursor_geometry_recalc(obj); + if (!sd->deferred_decoration_cursor) + { +sd->deferred_decoration_cursor = EINA_TRUE; +_decoration_defer(obj); + } } static void @@ -2208,7 +2212,13 @@ _entry_cursor_changed_signal_cb(void *data, { edje_object_signal_emit(sd->entry_edje, "elm,action,hide,cursor", "elm"); } - _cursor_geometry_recalc(data); + + if (!sd->deferred_decoration_cursor) + { +sd->deferred_decoration_cursor = EINA_TRUE; +_decoration_defer(obj); + } + if (_elm_config->atspi_mode) elm_interface_atspi_accessible_event_emit(ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, data, ELM_INTERFACE_ATSPI_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL); } @@ -4657,12 +4667,14 @@ _update_text_cursors(Eo *obj) Evas_Coord x, y, w, h, xx, yy, ww, hh; Evas_Coord xx2, yy2; Eina_Bool bidi_cursor; + Eo *text_obj; + EFL_UI_TEXT_DATA_GET(obj, sd); if (!sd->deferred_decoration_cursor) return; sd->deferred_decoration_cursor = EINA_FALSE; - Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); + text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); x = y = w = h = -1; xx = yy = ww = hh = -1; @@ -5055,17 +5067,21 @@ _anchors_update(Eo *o, Efl_Ui_Text_Data *sd) Efl_Ui_Text_Rectangle *rect; Anchor *an; const char *file; + Eo *sw; + + sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); efl_file_get(sd->entry_edje, &file, NULL); if (!sd->deferred_decoration_anchor) return; sd->deferred_decoration_anchor = EINA_FALSE; - _anchors_create(o, sd); - /* Better not to update anchors outside the view port. */ if (sd->anchors_updated) return; + efl_event_freeze(sw); + _anchors_create(o, sd); + smart = evas_object_smart_parent_get(o); clip = evas_object_clip_get(
[EGIT] [core/efl] master 01/01: Canvas text: emit missing events during text changes
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=de3062da8977efdba632fec73ded2480f197fb99 commit de3062da8977efdba632fec73ded2480f197fb99 Author: Daniel Hirt Date: Thu Sep 7 16:53:01 2017 +0300 Canvas text: emit missing events during text changes Some text changes were not picked up by the Ui.Text widget, so no size evaluation was triggered. --- src/lib/evas/canvas/evas_object_textblock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index b649ad7230..79048e848e 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -10216,7 +10216,7 @@ _efl_canvas_text_efl_text_cursor_cursor_text_insert(Eo *eo_obj, { int len = _efl_canvas_text_cursor_text_append(cur, _text); _evas_textblock_changed(o, eo_obj); - efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); + efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); return len; } @@ -10641,7 +10641,7 @@ EOLIAN static void _efl_canvas_text_efl_text_cursor_cursor_char_delete(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) { evas_textblock_cursor_char_delete(cur); - efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); + efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); } EAPI void @@ -10755,6 +10755,7 @@ _efl_canvas_text_range_delete(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *pd E evas_textblock_cursor_copy(cur1, o->cursor); _evas_textblock_changed(o, cur1->obj); + efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); } EOLIAN static Eina_Unicode --
[EGIT] [core/efl] efl-1.20 02/04: Canvas text: fix uninitialized value
raster pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=02115a35e47df8c01823e6b59876f30bd90e19bb commit 02115a35e47df8c01823e6b59876f30bd90e19bb Author: Daniel Hirt Date: Thu Aug 24 19:26:36 2017 +0300 Canvas text: fix uninitialized value Bug was introduced in f696cc88933bfa1ac6e5d6da26bc9ba7b2c3e2fa. --- src/lib/evas/canvas/evas_object_textblock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index a7a7a78f90..badea08d1e 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -6349,6 +6349,7 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret) c->width_changed = (obj->cur->geometry.w != o->last_w); c->obs_infos = NULL; c->hyphen_ti = NULL; + c->handle_obstacles = EINA_FALSE; /* Start of logical layout creation */ /* setup default base style */ --
[EGIT] [core/efl] efl-1.20 01/01: Canvas text: fix non-dirty paragraph width calculation
herdsman pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=9685eca01640e51d403d031b05242ac2cb3ff0bb commit 9685eca01640e51d403d031b05242ac2cb3ff0bb Author: Daniel Hirt Date: Tue Aug 29 13:05:01 2017 +0300 Canvas text: fix non-dirty paragraph width calculation Follow-up fix for 1624417d9137b87826962e431d08dc591f83d5e5. Changed for a max comparison, rather than just assigning the line's width. Also, added a test case. Fixes T5939 @fix --- src/lib/evas/canvas/evas_object_textblock.c | 3 ++- src/tests/evas/evas_test_textblock.c| 10 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 91e464990e..a7a7a78f90 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3925,7 +3925,8 @@ loop_advance: { Evas_Coord new_wmax = c->ln->w + c->marginl + c->marginr - (c->o->style_pad.l + c->o->style_pad.r); -c->par->last_fw = new_wmax; +if (new_wmax > c->par->last_fw) + c->par->last_fw = new_wmax; if (new_wmax > c->wmax) c->wmax = new_wmax; } diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index b3c60c9279..57cc36efbb 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -3865,6 +3865,16 @@ START_TEST(evas_textblock_size) evas_textblock_cursor_text_append(cur, "Y"); evas_object_textblock_size_formatted_get(tb, &w, &h); ck_assert_int_eq(bw, w); + +evas_object_textblock_text_markup_set(tb, + "" + "X" + "YYY"); +evas_object_textblock_size_formatted_get(tb, &bw, &bh); +evas_textblock_cursor_paragraph_last(cur); +evas_textblock_cursor_text_append(cur, "Y"); +evas_object_textblock_size_formatted_get(tb, &w, &h); +ck_assert_int_eq(bw, w); } /* FIXME: There is a lot more to be done. */ --
[EGIT] [core/efl] master 01/01: Canvas text: fix non-dirty paragraph width calculation
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=048dcc32633f47a2bc8eaab856e3288b2c72abe6 commit 048dcc32633f47a2bc8eaab856e3288b2c72abe6 Author: Daniel Hirt Date: Tue Aug 29 13:05:01 2017 +0300 Canvas text: fix non-dirty paragraph width calculation Follow-up fix for 1624417d9137b87826962e431d08dc591f83d5e5. Changed for a max comparison, rather than just assigning the line's width. Also, added a test case. Fixes T5939 @fix --- src/lib/evas/canvas/evas_object_textblock.c | 3 ++- src/tests/evas/evas_test_textblock.c| 10 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index ae0ab261af..57d54bc2ea 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3920,7 +3920,8 @@ loop_advance: { Evas_Coord new_wmax = c->ln->w + c->marginl + c->marginr - (c->o->style_pad.l + c->o->style_pad.r); -c->par->last_fw = new_wmax; +if (new_wmax > c->par->last_fw) + c->par->last_fw = new_wmax; if (new_wmax > c->wmax) c->wmax = new_wmax; } diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index b3c60c9279..57cc36efbb 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -3865,6 +3865,16 @@ START_TEST(evas_textblock_size) evas_textblock_cursor_text_append(cur, "Y"); evas_object_textblock_size_formatted_get(tb, &w, &h); ck_assert_int_eq(bw, w); + +evas_object_textblock_text_markup_set(tb, + "" + "X" + "YYY"); +evas_object_textblock_size_formatted_get(tb, &bw, &bh); +evas_textblock_cursor_paragraph_last(cur); +evas_textblock_cursor_text_append(cur, "Y"); +evas_object_textblock_size_formatted_get(tb, &w, &h); +ck_assert_int_eq(bw, w); } /* FIXME: There is a lot more to be done. */ --
[EGIT] [core/efl] master 01/01: Canvas text: fix uninitialized value
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=af1f4157f244f84169dc9c18785041278476f116 commit af1f4157f244f84169dc9c18785041278476f116 Author: Daniel Hirt Date: Thu Aug 24 19:26:36 2017 +0300 Canvas text: fix uninitialized value Bug was introduced in f696cc88933bfa1ac6e5d6da26bc9ba7b2c3e2fa. --- src/lib/evas/canvas/evas_object_textblock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 01cefea7ca..32c78ef4b0 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -6344,6 +6344,7 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret) c->width_changed = (obj->cur->geometry.w != o->last_w); c->obs_infos = NULL; c->hyphen_ti = NULL; + c->handle_obstacles = EINA_FALSE; /* Update all obstacles */ if (c->o->obstacle_changed || c->width_changed) --
[EGIT] [core/efl] master 02/03: Canvas text: reduce usage of data_scope_get()
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e20a44b7e7284cd81db34c7c09d797155c391f04 commit e20a44b7e7284cd81db34c7c09d797155c391f04 Author: Daniel Hirt Date: Fri Aug 18 14:50:36 2017 +0300 Canvas text: reduce usage of data_scope_get() During layout, this data is unchanged and there is no need to keep asking for it. --- src/lib/evas/canvas/evas_object_textblock.c | 176 +++- 1 file changed, 96 insertions(+), 80 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 7002387f47..11e023432b 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -977,9 +977,9 @@ _nodes_clear(const Evas_Object *eo_obj) * @param fmt the format to be cleaned, must not be NULL. */ static void -_format_unref_free(const Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt) +_format_unref_free(Evas_Object_Protected_Data *evas_o, Evas_Object_Textblock_Format *fmt) { - Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); + Evas_Object_Protected_Data *obj = evas_o; fmt->ref--; if (fmt->ref > 0) return; if (fmt->font.fdesc) evas_font_desc_unref(fmt->font.fdesc); @@ -1015,7 +1015,10 @@ _image_safe_unref(Evas_Public_Data *e, void *image, Eina_Bool async) * @param it the layout item to be freed */ static void -_item_free(const Evas_Object *eo_obj, Evas_Object_Textblock_Line *ln, Evas_Object_Textblock_Item *it) +_item_free(Evas_Public_Data *evas, + Efl_Canvas_Text_Data *o, + Evas_Object_Protected_Data *evas_o, + Evas_Object_Textblock_Line *ln, Evas_Object_Textblock_Item *it) { if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT) { @@ -1024,12 +1027,10 @@ _item_free(const Evas_Object *eo_obj, Evas_Object_Textblock_Line *ln, Evas_Objec evas_common_text_props_content_unref(&ti->text_props); if (EINA_UNLIKELY(ti->gfx_filter != NULL)) { - Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); - if (ti->gfx_filter->output) { - Evas *eo_evas = evas_object_evas_get(eo_obj); - Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS); + //Evas *eo_evas = evas_object_evas_get(eo_obj); + //Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS); Eina_Bool async = ti->gfx_filter->do_async; _image_safe_unref(evas, ti->gfx_filter->output, async); @@ -1051,7 +1052,7 @@ _item_free(const Evas_Object *eo_obj, Evas_Object_Textblock_Line *ln, Evas_Objec if (fi->item) eina_stringshare_del(fi->item); } - _format_unref_free(eo_obj, it->format); + _format_unref_free(evas_o, it->format); if (ln) { ln->items = (Evas_Object_Textblock_Item *) eina_inlist_remove( @@ -2843,6 +2844,8 @@ struct _Ctxt { Evas_Object *obj; Efl_Canvas_Text_Data *o; + Evas_Object_Protected_Data *evas_o; + Evas_Public_Data *evas; Evas_Object_Textblock_Paragraph *paragraphs; Evas_Object_Textblock_Paragraph *par; @@ -2884,12 +2887,11 @@ static Evas_Object_Textblock_Format_Item *_layout_do_format(const Evas_Object *o * @param fmt The format to adjust - NOT NULL. */ static void -_layout_format_ascent_descent_adjust(const Evas_Object *eo_obj, +_layout_format_ascent_descent_adjust(Evas_Object_Protected_Data *obj, Evas_Coord *maxascent, Evas_Coord *maxdescent, Evas_Object_Textblock_Format *fmt) { int ascent, descent; - Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); if (fmt->font.font) { @@ -2928,7 +2930,7 @@ _layout_format_ascent_descent_adjust(const Evas_Object *eo_obj, } static void -_layout_item_max_ascent_descent_calc(const Evas_Object *eo_obj, +_layout_item_max_ascent_descent_calc(Evas_Object_Protected_Data *obj, Evas_Coord *maxascent, Evas_Coord *maxdescent, Evas_Object_Textblock_Item *it, Textblock_Position position) { @@ -2954,8 +2956,6 @@ _layout_item_max_ascent_descent_calc(const Evas_Object *eo_obj, } else { - Evas_Object_Protected_Data *obj = -efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); asc = ENFN->font_max_ascent_get(ENDT, it->format->font.font); } @@ -2976,8 +2976,6 @@ _layout_item_max_ascent_descent_calc(const Evas_Object *eo_obj, } else { - Evas_Object_Protected_Data *obj = -efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); desc = ENFN->font_max_descent_get(ENDT, it->format->font.font); } @@ -2997,7 +299
[EGIT] [core/efl] master 03/03: Canvas text: prevent change of context width field
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e63be982d904a01ade5aced9ef9924a78d155b8a commit e63be982d904a01ade5aced9ef9924a78d155b8a Author: Daniel Hirt Date: Wed Aug 23 21:43:51 2017 +0300 Canvas text: prevent change of context width field The 'c->w' field gets manipulated for querying cutoffs of text with its boundaries. Better to keep it a read-only field, to reduce confusion. Also updated querying internal functions for better readability. --- src/lib/evas/canvas/evas_object_textblock.c | 86 - 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 11e023432b..01cefea7ca 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3993,16 +3993,18 @@ _layout_text_item_new(Ctxt *c EINA_UNUSED, Evas_Object_Textblock_Format *fmt) */ static int _layout_text_cutoff_get(Ctxt *c, Evas_Object_Textblock_Format *fmt, - const Evas_Object_Textblock_Text_Item *ti, int width_offset) + const Evas_Object_Textblock_Text_Item *ti, + Evas_Coord w, Evas_Coord from_x, int width_offset) { if (fmt->font.font) { Evas_Coord x; -x = c->w - c->o->style_pad.l - c->o->style_pad.r - c->marginl - - c->marginr - c->x - ti->x_adjustment; +Evas_Object_Protected_Data *obj = c->evas_o; + +x = w - c->o->style_pad.l - c->o->style_pad.r - c->marginl - + c->marginr - from_x - ti->x_adjustment; if (x < 0) x = 0; -Evas_Object_Protected_Data *obj = efl_data_scope_get(c->obj, EFL_CANVAS_OBJECT_CLASS); return ENFN->font_last_up_to_pos(ENDT, fmt->font.font, &ti->text_props, x, 0, width_offset); } @@ -4764,7 +4766,8 @@ _layout_update_par(Ctxt *c) static int _layout_get_charwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, const Evas_Object_Textblock_Item *it, size_t line_start, - const char *breaks) + const char *breaks, + Evas_Coord w, Evas_Coord from_x) { int wrap; size_t uwrap; @@ -4777,7 +4780,8 @@ _layout_get_charwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) wrap = 0; else - wrap = _layout_text_cutoff_get(c, fmt, _ITEM_TEXT(it), 0); + wrap = _layout_text_cutoff_get(c, fmt, _ITEM_TEXT(it), +w, from_x, 0); if (wrap < 0) return -1; @@ -4817,7 +4821,8 @@ _layout_word_end(const char *breaks, size_t pos, size_t len) static int _layout_get_hyphenationwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, const Evas_Object_Textblock_Item *it, size_t line_start, - const char *breaks, const char *wordbreaks) + const char *breaks, const char *wordbreaks, + Evas_Coord w, Evas_Coord from_x) { size_t wrap; size_t orig_wrap; @@ -4835,17 +4840,14 @@ _layout_get_hyphenationwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, swrap = 0; else { - Evas_Coord cw; - /* Get cutoff */ - swrap = _layout_text_cutoff_get(c, fmt, _ITEM_TEXT(it), 0); + swrap = _layout_text_cutoff_get(c, fmt, _ITEM_TEXT(it), 0, + w, from_x); /* Get cutoff considering an additional hyphen item */ - cw = c->w; c->hyphen_ti = _layout_hyphen_item_new(c, _ITEM_TEXT(it)); - c->w -= c->hyphen_ti->parent.w; - hyphen_swrap = _layout_text_cutoff_get(c, fmt, _ITEM_TEXT(it), c->hyphen_ti->parent.w); - c->w = cw; + hyphen_swrap = _layout_text_cutoff_get(c, fmt, _ITEM_TEXT(it), + w - c->hyphen_ti->parent.w, from_x, c->hyphen_ti->parent.w); /* Stronger condition than '< 0' for hyphenations */ if (hyphen_swrap >= 2) @@ -4974,13 +4976,15 @@ _layout_get_hyphenationwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, /* Hyphenation falls-back to char wrapping at start of line */ return _layout_get_charwrap(c, fmt, it, - line_start, breaks); + line_start, breaks, w, from_x); } static int _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, const Evas_Object_Textblock_Item *it, Eina_Bool mixed_wrap, - size_t line_start, const char *breaks, Eina_Bool scan_fwd) + size_t line_start, const char *breaks, + Evas_Coord w, Evas_Coord from_x, + Eina_Bool scan_fwd) { Eina_Bool wrap_after = EINA_FALSE; size_t wrap; @@ -4995,7 +4999,7 @@ _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, if (it->type == EVAS_TE
[EGIT] [core/efl] master 01/03: Canvas text: move obstacles logic to proper place
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f696cc88933bfa1ac6e5d6da26bc9ba7b2c3e2fa commit f696cc88933bfa1ac6e5d6da26bc9ba7b2c3e2fa Author: Daniel Hirt Date: Mon Aug 21 12:43:19 2017 +0300 Canvas text: move obstacles logic to proper place Will likely reduce number of update requests. --- src/lib/evas/canvas/evas_object_textblock.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 37f8230140..7002387f47 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -2868,6 +2868,7 @@ struct _Ctxt Textblock_Position position; Evas_Textblock_Align_Auto align_auto : 2; Eina_Bool width_changed : 1; + Eina_Bool handle_obstacles : 1; }; static void _layout_text_add_logical_item(Ctxt *c, Evas_Object_Textblock_Text_Item *ti, Eina_List *rel); @@ -5461,9 +5462,6 @@ _layout_par(Ctxt *c) char *line_breaks = NULL; char *word_breaks = NULL; - /* Obstacles logic */ - Eina_Bool handle_obstacles = EINA_FALSE; - if (!c->par->logical_items) return 2; @@ -5507,13 +5505,6 @@ _layout_par(Ctxt *c) return 0; } -/* Update all obstacles */ -if (c->o->obstacle_changed || c->width_changed) - { - _layout_obstacles_update(c); - handle_obstacles = EINA_TRUE; - } - c->par->text_node->dirty = EINA_FALSE; c->par->text_node->is_new = EINA_FALSE; c->par->rendered = EINA_FALSE; @@ -5618,7 +5609,7 @@ _layout_par(Ctxt *c) } } -if (handle_obstacles && !obs) +if (c->handle_obstacles && !obs) { obs = _layout_item_obstacle_get(c, it); } @@ -6349,6 +6340,12 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret) c->obs_infos = NULL; c->hyphen_ti = NULL; + /* Update all obstacles */ + if (c->o->obstacle_changed || c->width_changed) + { +_layout_obstacles_update(c); +c->handle_obstacles = EINA_TRUE; + } /* Start of logical layout creation */ /* setup default base style */ { --
[EGIT] [core/efl] master 01/01: Elm entry: fix call to set text via entry_set
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2efa25511f04dc2cb278471aa041e0e24ffa13f0 commit 2efa25511f04dc2cb278471aa041e0e24ffa13f0 Author: Daniel Hirt Date: Fri Jul 28 12:33:55 2017 +0300 Elm entry: fix call to set text via entry_set Accidentally called the super here, so did not get routed to '_elm_entry_text_set'. Fixes T5803. --- src/lib/elementary/elm_entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 8c8b2b82c5..446d781d30 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -4177,7 +4177,7 @@ elm_entry_entry_set(Evas_Object *obj, const char *entry) { ELM_ENTRY_CHECK(obj); - efl_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text"), entry); + efl_text_set(efl_part(obj, "elm.text"), entry); } EAPI const char * --
[EGIT] [core/efl] master 01/01: Evas textblock: add definition to 'cursor_equal'
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=01a693412fa0209307e0a3f69031f25bb115168c commit 01a693412fa0209307e0a3f69031f25bb115168c Author: Daniel Hirt Date: Thu Jul 20 19:18:20 2017 +0300 Evas textblock: add definition to 'cursor_equal' This is a follow-up to c4ea25cbdbfb027d5119880ddcf0bf5ba6a5720b to fix legacy API. The definition was missing, so adding it. --- src/lib/evas/canvas/evas_object_textblock.c | 8 1 file changed, 8 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index d2a7147be5..245a075376 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -9784,6 +9784,14 @@ _efl_canvas_text_efl_text_cursor_cursor_compare(Eo *eo_obj EINA_UNUSED, Efl_Canv return evas_textblock_cursor_compare(cur1, cur2); } +EAPI Eina_Bool +evas_textblock_cursor_equal(const Evas_Textblock_Cursor *cur1, + const Evas_Textblock_Cursor *cur2) +{ + if (!cur1->obj) return EINA_FALSE; + return efl_text_cursor_equal(cur1->obj, cur1, cur2); +} + EOLIAN static Eina_Bool _efl_canvas_text_efl_text_cursor_cursor_equal(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Text_Cursor_Cursor *cur, const Efl_Text_Cursor_Cursor *cur2) { --
Re: [E-devel] Work items towards 1.20
Hi, On 07/20/2017 06:18 PM, Stefan Schmidt wrote: [snipped] o From my review we have still open: o evas_textblock_cursor_equal was removed but seems to be part of our legacy API. That's odd, I added it back to 'evas_textblock_legacy.h' with c4ea25cbdbfb027d5119880ddcf0bf5ba6a5720b What could've gone wrong? regards Stefan Schmidt -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 08/09: Efl text: replace all usages of cursor handle to same type
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d5f781da2b93085d51fd09803e27579fb7f8c2da commit d5f781da2b93085d51fd09803e27579fb7f8c2da Author: Daniel Hirt Date: Mon Jul 17 12:45:36 2017 +0300 Efl text: replace all usages of cursor handle to same type Changes cursor handle name from 'Efl.Text.Cursor.Cursor_Data' to 'Efl.Text.Cursor.Cursor'. Also, replace all usages of Efl_Canvas_Text_Cursor with Efl_Text_Cursor_Cursor as the handle for the cursor. --- src/bin/elementary/test_efl_ui_text.c | 6 +- src/lib/edje/edje_entry.c | 26 +- src/lib/edje/edje_part_text.c | 36 +-- src/lib/edje/edje_private.h| 26 +- src/lib/efl/Efl.h | 2 +- src/lib/efl/interfaces/efl_text_annotate.eo| 16 +- src/lib/efl/interfaces/efl_text_cursor.eo | 56 ++-- src/lib/efl/interfaces/efl_text_types.eot | 2 +- .../elementary/efl_ui_internal_text_interactive.c | 30 +- src/lib/elementary/efl_ui_text.c | 42 +-- src/lib/elementary/efl_ui_text.eo | 2 +- src/lib/elementary/efl_ui_text_interactive.eo | 4 +- src/lib/evas/canvas/efl_canvas_text.eo | 20 +- src/lib/evas/canvas/evas_object_textblock.c| 306 ++--- src/lib/evas/canvas/evas_textblock_legacy.h| 11 +- src/tests/evas/evas_test_textblock.c | 4 +- 16 files changed, 291 insertions(+), 298 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 4ce782e661..27ff8799c6 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -9,7 +9,7 @@ static void _apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style) { - Efl_Canvas_Text_Cursor *start, *end; + Efl_Text_Cursor_Cursor *start, *end; start = efl_text_cursor_new(obj); end = efl_text_cursor_new(obj); @@ -104,7 +104,7 @@ typedef struct static void my_efl_ui_text_bt_3(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - Efl_Canvas_Text_Cursor *sel_start, *sel_end; + Efl_Text_Cursor_Cursor *sel_start, *sel_end; efl_ui_text_interactive_selection_cursors_get(data, &sel_start, &sel_end); const char *s = efl_canvas_text_range_text_get(data, sel_start, sel_end); @@ -162,7 +162,7 @@ void test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *win, *bx, *bx2, *bx3, *bt, *en; - Efl_Canvas_Text_Cursor *main_cur, *cur; + Efl_Text_Cursor_Cursor *main_cur, *cur; win = elm_win_util_standard_add("entry", "Entry"); elm_win_autodel_set(win, EINA_TRUE); diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 2b3d6449fb..15053795b6 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -4017,7 +4017,7 @@ _cursor_get(Edje_Real_Part *rp, Edje_Cursor cur) } Eina_Bool -_edje_text_cursor_next(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor_Data *c) +_edje_text_cursor_next(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) { Entry *en; @@ -4051,7 +4051,7 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur) Eina_Bool -_edje_text_cursor_prev(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor_Data *c) +_edje_text_cursor_prev(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) { Entry *en; @@ -4086,7 +4086,7 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) } Eina_Bool -_edje_text_cursor_up(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor_Data *c) +_edje_text_cursor_up(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) { Entry *en; Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; @@ -4126,7 +4126,7 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) } Eina_Bool -_edje_text_cursor_down(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor_Data *c) +_edje_text_cursor_down(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) { Entry *en; Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; @@ -4165,7 +4165,7 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur) } void -_edje_text_cursor_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor_Data *c) +_edje_text_cursor_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) { Entry *en; int old_cur_pos; @@ -4200,7 +4200,7 @@ _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur) } void -_edje_text_cursor_end(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor_Data *c) +_edje_text_cursor_end(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) { Entry *en; int old_cur_pos; @@ -4234,7 +4234,7 @@ _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur) } void -_edje_text_cursor_copy(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor_Data *d, Efl_Text_Cursor_Cursor_Data *c) +_edje_text_cursor_co
[EGIT] [core/efl] master 01/09: Ui text: use new api instead of 'style' property in the test
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ba9a1b97c5eac0af93374c9bc4830427ee73a42f commit ba9a1b97c5eac0af93374c9bc4830427ee73a42f Author: Daniel Hirt Date: Thu Jun 22 17:17:17 2017 +0300 Ui text: use new api instead of 'style' property in the test --- src/bin/elementary/test_efl_ui_text.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 32a14955d4..bfcbe2b4ee 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -27,10 +27,11 @@ static Eo * _create_label(Eo *win, Eo *bx) { Eo *en; - en = efl_add(EFL_UI_TEXT_CLASS, win); + en = efl_add(EFL_UI_TEXT_CLASS, win, + efl_text_halign_set(efl_added, EFL_TEXT_HORIZONTAL_ALIGNMENT_CENTER) + ); printf("Added Efl.Ui.Text object\n"); efl_ui_text_interactive_editable_set(en, EINA_FALSE); - efl_canvas_text_style_set(en, NULL, "DEFAULT='align=center font=Sans font_size=10 color=#fff wrap=word'"); evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); --
[EGIT] [core/efl] master 07/09: Evas textblock: fix legacy header
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c4ea25cbdbfb027d5119880ddcf0bf5ba6a5720b commit c4ea25cbdbfb027d5119880ddcf0bf5ba6a5720b Author: Daniel Hirt Date: Mon Jul 17 09:25:32 2017 +0300 Evas textblock: fix legacy header Fix ABI changes with const qualifiers, as well as some missing docs. --- src/lib/evas/canvas/evas_object_textblock.c | 7 +- src/lib/evas/canvas/evas_textblock_legacy.h | 129 2 files changed, 117 insertions(+), 19 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index cee5a5720c..e897607e41 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -769,7 +769,6 @@ static Eina_Bool _evas_textblock_cursor_format_is_visible_get(const Efl_Text_Cur static void _find_layout_item_line_match(Evas_Object *eo_obj, Evas_Object_Textblock_Node_Text *n, size_t pos, Evas_Object_Textblock_Line **lnr, Evas_Object_Textblock_Item **itr); static Evas_Object_Textblock_Node_Format *_evas_textblock_cursor_node_format_at_pos_get(const Efl_Text_Cursor_Cursor_Data *cur); static int _evas_textblock_cursor_text_prepend(Efl_Text_Cursor_Cursor_Data *cur, const char *_text); -EAPI int evas_textblock_cursor_compare(const Efl_Text_Cursor_Cursor_Data *cur1, const Efl_Canvas_Text_Cursor *cur2); static void _evas_textblock_cursor_copy(Efl_Text_Cursor_Cursor_Data *dst, const Efl_Canvas_Text_Cursor *src); /** selection iterator */ @@ -8395,10 +8394,10 @@ _evas_textblock_cursor_init(Efl_Text_Cursor_Cursor_Data *cur, const Evas_Object } EAPI Efl_Text_Cursor_Cursor_Data * -evas_object_textblock_cursor_new(Eo *eo_obj) +evas_object_textblock_cursor_new(const Evas_Object *eo_obj) { EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL); - return efl_text_cursor_new(eo_obj); + return efl_text_cursor_new((Eo *) eo_obj); } EAPI void @@ -15687,7 +15686,7 @@ _efl_canvas_text_efl_text_cursor_cursor_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_T } EAPI Efl_Text_Cursor_Cursor_Data * -evas_object_textblock_cursor_get(Eo *eo_obj EINA_UNUSED) +evas_object_textblock_cursor_get(const Evas_Object *eo_obj EINA_UNUSED) { return efl_text_cursor_get(eo_obj, EFL_TEXT_CURSOR_GET_MAIN); } diff --git a/src/lib/evas/canvas/evas_textblock_legacy.h b/src/lib/evas/canvas/evas_textblock_legacy.h index 770b317146..664a2a7a74 100644 --- a/src/lib/evas/canvas/evas_textblock_legacy.h +++ b/src/lib/evas/canvas/evas_textblock_legacy.h @@ -842,7 +842,7 @@ EAPI void evas_textblock_cursor_copy(const E * @param obj The textblock to which the new cursor will associate. * @return Returns a new cursor associated with the given textblock object. */ -EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_new(Evas_Object *obj); +EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_new(const Evas_Object *obj); /** * @brief Sets the position of the cursor according to the X and Y coordinates. @@ -855,11 +855,36 @@ EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_new(Evas_Object *obj); */ EAPI Eina_Bool evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *obj, Evas_Coord x, Evas_Coord y); -EAPI int evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *_text); - +/** + * Free the cursor and unassociate it from the object. + * @note do not use it to free unassociated cursors. + * + * @param cur the cursor to free. + * @return Returns no value. + */ EAPI void evas_textblock_cursor_free(Evas_Textblock_Cursor *cur); -EAPI int evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *_text); +/** + * Adds text to the current cursor position and set the cursor to *before* + * the start of the text just added. + * + * @param cur the cursor to where to add text at. + * @param text the text to add. + * @return Returns the len of the text added. + * @see evas_textblock_cursor_text_prepend() + */ +EAPI int evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2); + +/** + * Adds text to the current cursor position and set the cursor to *after* + * the start of the text just added. + * + * @param cur the cursor to where to add text at. + * @param text the text to add. + * @return Returns the len of the text added. + * @see evas_textblock_cursor_text_append() + */ +EAPI int evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2); /** * @brief The "replacement character" to use for the given textblock object. @@ -909,26 +934,100 @@ EAPI void evas_object_textblock_valign_set(Evas_Object *obj, double align); */ EAPI double evas_object_textblock_valign_get(const Evas_Object *obj); -EAPI void evas_textblock_cursor_paragraph_first(Efl_Canvas_Text_Cursor *cur); +/** + * Sets the cursor to the start of the first
[EGIT] [core/efl] master 05/09: Ui text: don't send focus action to cursor on init
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e7f7636ac10e89bcb3719850e4c41c6718ef5aa7 commit e7f7636ac10e89bcb3719850e4c41c6718ef5aa7 Author: Daniel Hirt Date: Mon Jul 3 20:37:39 2017 +0300 Ui text: don't send focus action to cursor on init It made the cursor animation start on init, even if widget wasn't focused. --- src/lib/elementary/efl_ui_text.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 91e5a0b248..d1c7e61f90 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -4670,8 +4670,6 @@ _create_text_cursors(Eo *obj, Efl_Ui_Text_Data *sd) efl_file_get(sd->entry_edje, &file, NULL); sd->cursor = _decoration_create(sd, file, "elm/entry/cursor/default", EINA_TRUE); sd->cursor_bidi = _decoration_create(sd, file, "elm/entry/cursor/default", EINA_TRUE); - edje_object_signal_emit(sd->cursor, "elm,action,focus", "elm"); - edje_object_signal_emit(sd->cursor_bidi, "elm,action,focus", "elm"); if (!efl_ui_text_interactive_editable_get(obj)) { --
[EGIT] [core/efl] master 04/09: Ui text: add more examples to test
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2bb0a1123e104ece64744ba5889950f3eeb3a3d5 commit 2bb0a1123e104ece64744ba5889950f3eeb3a3d5 Author: Daniel Hirt Date: Thu Jun 22 18:03:45 2017 +0300 Ui text: add more examples to test --- src/bin/elementary/test_efl_ui_text.c | 62 +++ 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index bfcbe2b4ee..4ce782e661 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -27,9 +27,7 @@ static Eo * _create_label(Eo *win, Eo *bx) { Eo *en; - en = efl_add(EFL_UI_TEXT_CLASS, win, - efl_text_halign_set(efl_added, EFL_TEXT_HORIZONTAL_ALIGNMENT_CENTER) - ); + en = efl_add(EFL_UI_TEXT_CLASS, win); printf("Added Efl.Ui.Text object\n"); efl_ui_text_interactive_editable_set(en, EINA_FALSE); @@ -55,18 +53,41 @@ test_efl_ui_text_label(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi evas_object_show(bx); en = _create_label(win, bx); - efl_text_set(en, "This is a small label"); + efl_text_set(en, "This is a\t small label"); //012345678901234567890 _apply_style(en, 0, 21, "font_size=12 font_weight=bold"); + efl_text_halign_set(en, EFL_TEXT_HORIZONTAL_ALIGNMENT_CENTER); + efl_text_font_weight_set(en, EFL_TEXT_FONT_WEIGHT_BOLD); en = _create_label(win, bx); + efl_text_halign_set(en, EFL_TEXT_HORIZONTAL_ALIGNMENT_CENTER); efl_text_set(en, "This is a text. Is also has\n" "newlines. There are several styles applied."); _apply_style(en, 40, 45, "font_weight=bold color=#ff0"); _apply_style(en, 52, 58, "font_weight=italic color=#f00"); - efl_canvas_text_style_set(en, NULL, "DEFAULT='align=center font=Sans font_size=12 color=#fff wrap=word'"); + efl_text_multiline_set(en, EINA_TRUE); + + en = _create_label(win, bx); + efl_text_halign_set(en, EFL_TEXT_HORIZONTAL_ALIGNMENT_CENTER); + efl_text_set(en, "By default 'multiline' is disabled.\n" + "So, \\n would only work if you enable it."); -// elm_object_focus_set(en, EINA_TRUE); + en = _create_label(win, bx); + efl_text_set(en, "You can input text here."); + efl_text_font_set(en, "Sans", 14); + efl_ui_text_interactive_editable_set(en, EINA_TRUE); + efl_text_wrap_set(en, EFL_TEXT_FORMAT_WRAP_WORD); + efl_ui_text_scrollable_set(en, EINA_TRUE); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.5); + + en = _create_label(win, bx); + efl_text_set(en, "Input multiline here."); + efl_text_font_set(en, "Sans", 14); + efl_ui_text_interactive_editable_set(en, EINA_TRUE); + efl_text_wrap_set(en, EFL_TEXT_FORMAT_WRAP_WORD); + efl_text_multiline_set(en, EINA_TRUE); + efl_ui_text_scrollable_set(en, EINA_TRUE); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.5); evas_object_resize(win, 480, 320); evas_object_show(win); @@ -81,22 +102,6 @@ typedef struct } Test_Data; static void -my_efl_ui_text_anchor_hover_opened(void *data EINA_UNUSED, const Efl_Event *event) -{ - Eo *bt; - Eo *en = data; - - Efl_Ui_Text_Anchor_Hover_Info *ei = event->info; - - bt = efl_add(EFL_UI_BUTTON_CLASS, en); - elm_object_text_set(bt, ei->anchor_info->name); - evas_object_show(bt); - elm_object_part_content_set(ei->hover, "middle", bt); - - printf("anchor hover\n"); -} - -static void my_efl_ui_text_bt_3(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Efl_Canvas_Text_Cursor *sel_start, *sel_end; @@ -244,17 +249,6 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve elm_object_focus_allow_set(bt, EINA_FALSE); evas_object_show(bt); -#if 0 - bt = elm_button_add(win); - elm_object_text_set(bt, "Edit"); - evas_object_smart_callback_add(bt, "clicked", my_entry_bt_7, en); - evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); - elm_box_pack_end(bx2, bt); - elm_object_focus_allow_set(bt, EINA_FALSE); - evas_object_show(bt); -#endif - bx3 = elm_box_add(win); elm_box_horizontal_set(bx3, EINA_TRUE); evas_object_size_hint_weight_set(bx3, EVAS_HINT_EXPAND, 0.0); @@ -265,8 +259,6 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve evas_object_show(bx3); evas_object_show(bx2); - efl_event_callback_add(en, EFL_UI_TEXT_EVENT_ANCHOR_HOVER_OPENED, my_efl_ui_text_anchor_hover_opened, en); - evas_object_resize(win, 480, 320); evas_object_show(win); } --
[EGIT] [core/efl] master 06/09: Ui internal text interactive: handle signed cursor position
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=22c39d4ee51a7efc3888acaf2f52841dd1d4f8a3 commit 22c39d4ee51a7efc3888acaf2f52841dd1d4f8a3 Author: Daniel Hirt Date: Wed Jul 12 09:52:59 2017 +0300 Ui internal text interactive: handle signed cursor position CID 1377551. --- src/lib/elementary/efl_ui_internal_text_interactive.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index 8e94314d7f..d9c1ad68ec 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -721,6 +721,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); old_cur_pos = evas_textblock_cursor_pos_get(cur); + if (old_cur_pos < 0) return; control = evas_key_modifier_is_set(ev->modifiers, "Control"); alt = evas_key_modifier_is_set(ev->modifiers, "Alt"); --
[EGIT] [core/efl] master 03/09: Ui text: set default color (white)
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=02a607f360516a31a6d69e0b15372a5fcfd97574 commit 02a607f360516a31a6d69e0b15372a5fcfd97574 Author: Daniel Hirt Date: Thu Jun 22 18:03:41 2017 +0300 Ui text: set default color (white) --- src/lib/elementary/efl_ui_text.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 0b32ff90fd..91e5a0b248 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -2986,6 +2986,7 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv) // (possibly, text_classes). // For now, set this for easier setup efl_text_font_set(text_obj, "Sans", 12); + efl_text_normal_color_set(text_obj, 255, 255, 255, 255); efl_canvas_group_add(efl_super(obj, MY_CLASS)); elm_widget_sub_object_parent_add(obj); --
[EGIT] [core/efl] master 09/09: Text: move Annotation type to Efl.Text.Annotate namespace
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4923945f817c3b834e970187e1431db55d022d47 commit 4923945f817c3b834e970187e1431db55d022d47 Author: Daniel Hirt Date: Mon Jul 17 17:38:28 2017 +0300 Text: move Annotation type to Efl.Text.Annotate namespace --- src/lib/efl/Efl.h | 2 +- src/lib/efl/interfaces/efl_text_annotate.eo | 16 src/lib/efl/interfaces/efl_text_types.eot | 2 +- src/lib/elementary/efl_ui_text.c| 12 +++--- src/lib/evas/canvas/evas_object_textblock.c | 62 ++--- src/tests/evas/evas_test_textblock.c| 4 +- 6 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 0b9c481532..c1cc00e16c 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -53,7 +53,7 @@ extern "C" { typedef struct tm Efl_Time; typedef struct _Efl_Text_Cursor_Cursor Efl_Text_Cursor_Cursor; -typedef struct _Efl_Canvas_Text_Annotation Efl_Canvas_Text_Annotation; +typedef struct _Efl_Text_Annotate_Annotation Efl_Text_Annotate_Annotation; #ifdef EFL_BETA_API_SUPPORT diff --git a/src/lib/efl/interfaces/efl_text_annotate.eo b/src/lib/efl/interfaces/efl_text_annotate.eo index 82921b8e72..4349805973 100644 --- a/src/lib/efl/interfaces/efl_text_annotate.eo +++ b/src/lib/efl/interfaces/efl_text_annotate.eo @@ -27,7 +27,7 @@ interface Efl.Text.Annotate { legacy: null; } keys { -annotation: ptr(Efl.Canvas.Text.Annotation); [[Given annotation]] +annotation: ptr(Efl.Text.Annotate.Annotation); [[Given annotation]] } values { format: string; [[The new format for the given annotation]] @@ -43,7 +43,7 @@ interface Efl.Text.Annotate { @in start: ptr(const(Efl.Text.Cursor.Cursor)); [[Start of range]] @in end: ptr(const(Efl.Text.Cursor.Cursor)); [[End of range]] } - return: free(own(iterator), + return: free(own(iterator), eina_iterator_free); [[Handle of the Annotation]] } annotation_insert { @@ -60,7 +60,7 @@ interface Efl.Text.Annotate { @in end: ptr(Efl.Text.Cursor.Cursor); [[End of range]] @in format: string; [[Annotation format]] } - return: ptr(Efl.Canvas.Text.Annotation); [[Handle of inserted annotation]] + return: ptr(Efl.Text.Annotate.Annotation); [[Handle of inserted annotation]] } annotation_del { [[Deletes given annotation. @@ -72,7 +72,7 @@ interface Efl.Text.Annotate { ]] legacy: null; params { -@in annotation: ptr(Efl.Canvas.Text.Annotation); [[Annotation to be +@in annotation: ptr(Efl.Text.Annotate.Annotation); [[Annotation to be removed]] } return: bool; [[$true on success, $false otherwise.]] @@ -86,7 +86,7 @@ interface Efl.Text.Annotate { ]] legacy: null; params { -@in an: ptr(const(Efl.Canvas.Text.Annotation)); [[Given annotation to query]] +@in an: ptr(const(Efl.Text.Annotate.Annotation)); [[Given annotation to query]] @out x: int; [[X coordinate of the annotation]] @out y: int; [[Y coordinate of the annotation]] @out w: int; [[Width of the annotation]] @@ -104,7 +104,7 @@ interface Efl.Text.Annotate { ]] legacy: null; params { - @in annotation: ptr(const(Efl.Canvas.Text.Annotation)); [[Annotation + @in annotation: ptr(const(Efl.Text.Annotate.Annotation)); [[Annotation handle to query]] @in start: ptr(Efl.Text.Cursor.Cursor); [[Cursor to be set to the start position of the annotation in the text]] @@ -119,7 +119,7 @@ interface Efl.Text.Annotate { legacy: null; } values { -annotation: ptr(Efl.Canvas.Text.Annotation); [[Annotation]] +annotation: ptr(Efl.Text.Annotate.Annotation); [[Annotation]] } keys { cur: ptr(Efl.Text.Cursor.Cursor); @@ -138,7 +138,7 @@ interface Efl.Text.Annotate { @in format: string; [[Format of the inserted item. See Format styles.]] } - return: ptr(Efl.Canvas.Text.Annotation); [[The annotation handle of the + return: ptr(Efl.Text.Annotate.Annotation); [[The annotation handle of the inserted item.]] } } diff --git a/src/lib/efl/interfaces/efl_text_types.eot b/src/lib/efl/interfaces/efl_text_types.eot index d83ee1fc72..d6f764023e 100644 --- a/src/lib/efl/interfaces/efl_text_types.eot +++ b/src/lib/efl/interfaces/efl_text_types.eot @@ -7,7 +7,7 @@ enum Efl.Text.Bidirectional_Type { inherit [[Inherit text type]] } -type @extern Efl.Canvas.Text.Annotation: __undefined_type;
[EGIT] [core/efl] master 02/09: Canvas text: re-add support for tabs
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bb2678d403f43b6ba4cda08ff44b51163280deb8 commit bb2678d403f43b6ba4cda08ff44b51163280deb8 Author: Daniel Hirt Date: Thu Jun 22 17:59:14 2017 +0300 Canvas text: re-add support for tabs Somehow this was left out. Fixes tabs, so you can now use "\t" and press the "tab" key. --- src/lib/evas/canvas/evas_object_textblock.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index c12d514f3c..cee5a5720c 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -14405,6 +14405,11 @@ _efl_canvas_text_cursor_text_append(Efl_Text_Cursor_Cursor_Data *cur, format = "br"; n = strlen(_NEWLINE_UTF8); } +else if (!strncmp(_TAB_UTF8, off, strlen(_TAB_UTF8))) + { + format = "tab"; + n = strlen(_TAB_UTF8); + } if (format) { --
[EGIT] [core/efl] master 02/05: Elm layout: only allow legacy for using NULL text parts
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=544fedaeba445609ca285e939db0742730137199 commit 544fedaeba445609ca285e939db0742730137199 Author: Daniel Hirt Date: Tue Jul 4 12:54:44 2017 +0300 Elm layout: only allow legacy for using NULL text parts This is a follow-up to a4b79fdbe16e1495c187dc4f9da99924cf51e539. efl_part no longer supports NULL parts. NULL text parts are now aliased in legacy code beforehand. Signed-off-by: Jean-Philippe Andre --- src/lib/elementary/elc_popup.c| 12 +--- src/lib/elementary/elm_actionslider.c | 8 ++-- src/lib/elementary/elm_bubble.c | 7 +++ src/lib/elementary/elm_label.c| 13 - src/lib/elementary/elm_label.eo | 1 - src/lib/elementary/elm_layout.c | 21 ++--- src/lib/elementary/elm_part_helper.h | 6 ++ src/lib/elementary/elm_widget.c | 3 +++ src/lib/elementary/elm_widget.h | 1 + 9 files changed, 46 insertions(+), 26 deletions(-) diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c index f693de90bd..2369edf6be 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -1057,12 +1057,15 @@ end: return EINA_TRUE; } -EOLIAN static Eina_Bool +static Eina_Bool _elm_popup_text_set(Eo *obj, Elm_Popup_Data *_pd, const char *part, const char *label) { Eina_Bool int_ret = EINA_FALSE; - if (!part || !strcmp(part, "default") || !strcmp(part, "elm.text")) + if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + return EINA_FALSE; + + if (!strcmp(part, "elm.text")) int_ret = _content_text_set(obj, label); else if (!strcmp(part, "title,text")) int_ret = _title_text_set(obj, label); @@ -1096,7 +1099,10 @@ _elm_popup_text_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *_pd, const char *part) { const char *text = NULL; - if (!part || !strcmp(part, "default")) + if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + return NULL; + + if (!strcmp(part, "elm.text")) text = _content_text_get(_pd); else if (!strcmp(part, "title,text")) text = _title_text_get(_pd); diff --git a/src/lib/elementary/elm_actionslider.c b/src/lib/elementary/elm_actionslider.c index 80888bbcc0..77396840d1 100644 --- a/src/lib/elementary/elm_actionslider.c +++ b/src/lib/elementary/elm_actionslider.c @@ -456,9 +456,11 @@ _elm_actionslider_text_set(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, cons { Eina_Bool int_ret = EINA_TRUE; + if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + return EINA_FALSE; + _mirrored_part_fix(obj, &part); - if (!part || !strcmp(part, "elm.text")) part = _text_aliases[0].real_part; efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), text); return int_ret; @@ -469,9 +471,11 @@ _elm_actionslider_text_get(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, cons { const char *text = NULL; + if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + return NULL; + _mirrored_part_fix(obj, &part); - if (!part) part = _text_aliases[0].real_part; text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part)); return text; diff --git a/src/lib/elementary/elm_bubble.c b/src/lib/elementary/elm_bubble.c index 51f2de1d59..084fcd72b6 100644 --- a/src/lib/elementary/elm_bubble.c +++ b/src/lib/elementary/elm_bubble.c @@ -119,13 +119,12 @@ _elm_bubble_elm_widget_focus_direction(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED EOLIAN static Eina_Bool _elm_bubble_text_set(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED, const char *part, const char *label) { - Eina_Bool int_ret = EINA_TRUE; + if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) + return EINA_FALSE; - if (!part) part = _text_aliases[0].real_part; efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label); - if (!int_ret) return EINA_FALSE; - if (part && (!strcmp(part, "info") || !strcmp(part, "elm.info"))) + if (!strcmp(part, "elm.info")) { if (label) elm_layout_signal_emit(obj, "elm,state,info,visible", "elm"); diff --git a/src/lib/elementary/elm_label.c b/src/lib/elementary/elm_label.c index 7a5f65e2a9..2d8f07a39b 100644 --- a/src/lib/elementary/elm_label.c +++ b/src/lib/elementary/elm_label.c @@ -27,12 +27,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {NULL, NULL} }; -static const Elm_Layout_Part_Alias_Description _text_aliases[] = -{ - {"default", "elm.text"}, - {NULL, NULL} -}; - static void _recalc(void *data) { @@ -348,7 +342,6 @@ _elm_label_text_set(Eo *obj, Elm_Label_Data *sd, const char *part, const char *l if (!label) label = ""; _label
Re: [E-devel] Elm_Entry assuming markup input???
m api size/complexity duplicating is generally a bad path to go down. and ALL of this discussion at the technical api level hasn't even got the info on what people prefer to be the default. to get a good feel for this... you NEED to give them some options on what to choose and thus design api's to handle all cases and propose something and see that it actually can handle them... then find out what people think then about it - the kinds of users who use the api regularly... THEN make a decision on what should be done. well if you are planning on changing something AND the change is controversial (which it seemingly is). Encoding of text is not something that a widget should have to deal with and decoding is not something that a cost char* text_get api implies. the documentation clearly says otherwise. if it makes you feel better we could: typedef Elm_Markup char; Elm_Markup *elm_object_text_get(Evas_object *obj); though it'd be a lie because some widgets dont do markup... but entry and label do ... (and some parts in a layout do do markup if TEXTBLOCK and some don't if TEXT). we ALL agree that inconsistency is bad and this should be fixed. Andy On Tue, 4 Jul 2017 at 13:23, Davide Andreoli wrote: 2017-07-04 14:22 GMT+02:00 Andrew Williams : Hi, I jumped back to this email I sent a week ago and realised that we have just spent a bunch of time revisiting a discussion that had clearly wrapped up at the EDD in Malta. One reason I wanted to post our conclusion to the list was for visibility and a chance to comment for anyone who was not able to attend. Unfortunately instead we have had a lot of the same points brought forward that were already discussed at the event which has led to confusion and time wasting. There is a question in here about general API design that I will start in a new thread but i want to wrap up this discussion. Is there anyone on this list (except raster as Tizen developer proxy) who disagrees with the approach as was laid out in my email of the 29th? you still did not reply to the first raster's question: do we will have a markup variant for every text operation? (text_set, text_append, text_insert...etc). To be honest I never had any issue with the current always-markup model, so for now I vote for keeping the legacy behavior also on the new EO api. I understand that this could be conceived as a massive change but my understanding was that the Eo API was a chance to fix things up to be better going forward and not to be shackled by our choices of the past. If that is not true then we will really struggle to make quality bindings to higher level languages (in this context the difference between plain text and markedup/parameterised text and also the tight coupling of text handling and the rendering). Thanks Andy On Thu, 29 Jun 2017 at 07:13, Andrew Williams wrote: Hi, Just to wrap this thread up following EDD: * no-one is proposing that we remove the ability to mark up text through the markup format mechanism, it is a great feature * we cannot make changes to this legacy API as apps depend on it or have adapted to it * the new textblock API, which is currently plain text only is being extended with a solid markup API * The existing markup format will be supported through _markup_text_set or similar API leaving text_set/get to be plain text only It was beileved that this would satisfy all requirements whilst removing any confusion about the nature of text encoding when using plain text. This allows us to take a path-of-least-surprise approach for the new Eo based text APIs Thanks everyone for the discussion :) Andy On Sat, 24 Jun 2017 at 05:39 Carsten Haitzler < ras...@rasterman.com> wrote: On Fri, 23 Jun 2017 21:55:14 +0200 Davide Andreoli < d...@gurumeditation.it> said: 2017-06-19 13:36 GMT+02:00 Daniel Hirt : Hi, On Mon, Jun 19, 2017 at 12:01 PM, Andrew Williams < a...@andywilliams.me> wrote: Hi, Looking at the tests you point me at - selection (and the past) is a plain text copy with the markup stripped - exactly what I would expect for text_get - but the current content transformed with the helper will not get you there - there is no built in interpretation of formatting - just rendered understands it. "elm_entry_selection_get" returns the text in markup format. The test prints both types one after another (markup followed by plaintext) using "elm_entry_markup_to_utf8". It is essential for copy & paste of markup text between two entry clients, so the pasted formatting is kept. Overall the implementation feels wrong - supporting markup is great but returning it inline in text_get feels like we are imposing internal choices on other devs. I note that the code considers format but only when interacting with files - so I can have plain text files but not plain text input. Right, it's a fea
[EGIT] [core/efl] master 01/01: Elm layout: fix broken text part name resolving
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c0e4a218dd06ecf790a5338c4fcc09a4073dba0c commit c0e4a218dd06ecf790a5338c4fcc09a4073dba0c Author: Daniel Hirt Date: Thu Jun 29 21:33:12 2017 +0300 Elm layout: fix broken text part name resolving This adds a few workaround to overcome the efl_part port. Quite a few layouts got broken in some specific cases. --- src/lib/elementary/elc_multibuttonentry.c | 2 +- src/lib/elementary/elc_popup.c| 2 +- src/lib/elementary/elm_actionslider.c | 3 +++ src/lib/elementary/elm_bubble.c | 1 + src/lib/elementary/elm_label.c| 1 + src/lib/elementary/elm_layout.c | 5 + 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c index c982803062..ea4c23ff59 100644 --- a/src/lib/elementary/elc_multibuttonentry.c +++ b/src/lib/elementary/elc_multibuttonentry.c @@ -1523,7 +1523,7 @@ _elm_multibuttonentry_text_set(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSE { Eina_Bool int_ret = EINA_TRUE; - if (!part || !strcmp(part, "default")) + if (!part || !strcmp(part, "default") || !strcmp(part, "elm.text")) { if (label) _label_set(obj, label); int_ret = EINA_TRUE; diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c index 45862b0901..e3ef8425af 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -1062,7 +1062,7 @@ _elm_popup_text_set(Eo *obj, Elm_Popup_Data *_pd, const char *part, const char * { Eina_Bool int_ret = EINA_FALSE; - if (!part || !strcmp(part, "default")) + if (!part || !strcmp(part, "default") || !strcmp(part, "elm.text")) int_ret = _content_text_set(obj, label); else if (!strcmp(part, "title,text")) int_ret = _title_text_set(obj, label); diff --git a/src/lib/elementary/elm_actionslider.c b/src/lib/elementary/elm_actionslider.c index 95f4cd6b42..80888bbcc0 100644 --- a/src/lib/elementary/elm_actionslider.c +++ b/src/lib/elementary/elm_actionslider.c @@ -457,6 +457,8 @@ _elm_actionslider_text_set(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, cons Eina_Bool int_ret = EINA_TRUE; _mirrored_part_fix(obj, &part); + + if (!part || !strcmp(part, "elm.text")) part = _text_aliases[0].real_part; efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), text); return int_ret; @@ -469,6 +471,7 @@ _elm_actionslider_text_get(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, cons _mirrored_part_fix(obj, &part); + if (!part) part = _text_aliases[0].real_part; text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part)); return text; diff --git a/src/lib/elementary/elm_bubble.c b/src/lib/elementary/elm_bubble.c index 520a16198d..51f2de1d59 100644 --- a/src/lib/elementary/elm_bubble.c +++ b/src/lib/elementary/elm_bubble.c @@ -121,6 +121,7 @@ _elm_bubble_text_set(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED, const char *part { Eina_Bool int_ret = EINA_TRUE; + if (!part) part = _text_aliases[0].real_part; efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label); if (!int_ret) return EINA_FALSE; diff --git a/src/lib/elementary/elm_label.c b/src/lib/elementary/elm_label.c index 10a009cda1..7a5f65e2a9 100644 --- a/src/lib/elementary/elm_label.c +++ b/src/lib/elementary/elm_label.c @@ -348,6 +348,7 @@ _elm_label_text_set(Eo *obj, Elm_Label_Data *sd, const char *part, const char *l if (!label) label = ""; _label_format_set(wd->resize_obj, sd->format); + if (!part) part = _text_aliases[0].real_part; efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label); if (int_ret) diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c index b15c99c241..5aa13a942b 100644 --- a/src/lib/elementary/elm_layout.c +++ b/src/lib/elementary/elm_layout.c @@ -2325,10 +2325,7 @@ elm_layout_table_clear(Elm_Layout *obj, const char *part, Eina_Bool clear) EAPI Eina_Bool elm_layout_text_set(Elm_Layout *obj, const char *part, const char *text) { - if (!part || (*part == '\0')) - { -part = "elm.text"; - } + if (!part) part = "elm.text"; efl_text_set(efl_part(obj, part), text); return EINA_TRUE; } --
[EGIT] [core/efl] master 01/01: Evas textblock: fix legacy_newline in legacy API
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4024857bf6098b91ed3859fac9bfc149b4db3b81 commit 4024857bf6098b91ed3859fac9bfc149b4db3b81 Author: Daniel Hirt Date: Sun Jun 25 13:21:52 2017 +0300 Evas textblock: fix legacy_newline in legacy API Fixes 4fda417bc9e0c59f3a3645057279a29cc0057cd2 that disabled legacy_newline for both legacy (textblock) and new (canvas text) api. It should enable legacy_newline for legacy. --- src/lib/evas/canvas/evas_object_textblock.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index a85cef5646..7806cce028 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -6650,11 +6650,14 @@ _find_layout_line_num(const Evas_Object *eo_obj, int line) EAPI Evas_Object * evas_object_textblock_add(Evas *e) { + Efl_Canvas_Text_Data *o; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); Evas_Object *eo_obj = efl_add(MY_CLASS, e, efl_text_multiline_set(efl_added, EINA_TRUE)); + o = efl_data_scope_get(eo_obj, MY_CLASS); + o->legacy_newline = EINA_TRUE; return eo_obj; } @@ -6677,9 +6680,6 @@ _efl_canvas_text_efl_object_constructor(Eo *eo_obj, Efl_Canvas_Text_Data *class_ o->cursors = eina_list_remove_list(o->cursors, o->cursors); _format_command_init(); evas_object_textblock_init(eo_obj); - // Override legacy newline (enabled in legacy textblock through - // textblock_init. - o->legacy_newline = EINA_FALSE; _FMT(ref) = 1; _FMT(halign) = 0.0; @@ -12907,7 +12907,6 @@ evas_object_textblock_init(Evas_Object *eo_obj) co->obj = eo_obj; evas_object_textblock_text_markup_set(eo_obj, ""); - o->legacy_newline = EINA_TRUE; o->multiline = EINA_FALSE; #ifdef BIDI_SUPPORT o->inherit_paragraph_direction = EINA_TRUE; --
[EGIT] [core/efl] master 01/01: Evas textblock: re-apply paragraph position inference
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a10f726fc5540196e9ac64fe5e1aa2951904910a commit a10f726fc5540196e9ac64fe5e1aa2951904910a Author: Daniel Hirt Date: Thu Jun 29 13:57:54 2017 +0300 Evas textblock: re-apply paragraph position inference For some reason, c39855a8ac6f86c2dd8b1856ed70f85e0e521f3e also seems to address an issue with height calculations (although not mentioned in the commit message). It already went in v1.19, so by applying b8beb6834b01f9688cb5e7aa177bacbc713318b9 I also reverted that behavior. Seems like a correct one, so re-applying. Fixes T5594 --- src/lib/evas/canvas/evas_object_textblock.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index c64f3007f6..a85cef5646 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -5493,8 +5493,16 @@ _layout_par(Ctxt *c) /* After this par we are no longer at the beginning, as there * must be some text in the par. */ - if (c->position == TEXTBLOCK_POSITION_START) -c->position = TEXTBLOCK_POSITION_ELSE; + if (!EINA_INLIST_GET(c->par)->next) + { + c->position = (c->position == TEXTBLOCK_POSITION_START) ? + TEXTBLOCK_POSITION_SINGLE : TEXTBLOCK_POSITION_END; + } + else + { + if (c->position == TEXTBLOCK_POSITION_START) + c->position = TEXTBLOCK_POSITION_ELSE; + } if (c->par->last_fw > c->wmax) c->wmax = c->par->last_fw; return 0; --
[EGIT] [core/efl] master 01/03: Ui text: fix cursor api call
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ec02b5f3fb2b35f03315ab10230ff2e95a1b2401 commit ec02b5f3fb2b35f03315ab10230ff2e95a1b2401 Author: Daniel Hirt Date: Tue Jun 20 15:31:08 2017 +0300 Ui text: fix cursor api call This widget doesn't have a text part. --- src/lib/elementary/efl_ui_text.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 60bfe93b4f..dd2fcadedd 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -1208,8 +1208,11 @@ _efl_ui_text_elm_widget_on_focus_region(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *s { Evas_Coord edje_x, edje_y, elm_x, elm_y; - edje_object_part_text_cursor_geometry_get - (sd->entry_edje, "elm.text", x, y, w, h); + efl_text_cursor_geometry_get(obj, + efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN), + EFL_TEXT_CURSOR_TYPE_BEFORE, + x, y, w, h, + NULL, NULL, NULL, NULL); if (sd->single_line) { --
[EGIT] [core/efl] master 03/03: Canvas text: set 'changed' on the object when text is inserted
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=070171c7bb2ed4de1c790250f975c4979e829414 commit 070171c7bb2ed4de1c790250f975c4979e829414 Author: Daniel Hirt Date: Tue Jun 20 15:34:14 2017 +0300 Canvas text: set 'changed' on the object when text is inserted This fixes missed updates with the "Ui.Text" when text was inserted. --- src/lib/evas/canvas/evas_object_textblock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index c248efa024..c64f3007f6 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -10183,10 +10183,11 @@ evas_textblock_cursor_text_prepend(Efl_Text_Cursor_Cursor_Data *cur, const char EOLIAN static int _efl_canvas_text_efl_text_cursor_cursor_text_insert(Eo *eo_obj, - Efl_Canvas_Text_Data *o EINA_UNUSED, + Efl_Canvas_Text_Data *o, Efl_Text_Cursor_Cursor_Data *cur, const char *_text) { int len = _efl_canvas_text_cursor_text_append(cur, _text); + _evas_textblock_changed(o, eo_obj); efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); return len; } --
[EGIT] [core/efl] master 02/03: Ui text: defer region show to job
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f3fff0c6871002721ebb675c0f68f9a5b28209c7 commit f3fff0c6871002721ebb675c0f68f9a5b28209c7 Author: Daniel Hirt Date: Tue Jun 20 15:33:09 2017 +0300 Ui text: defer region show to job This moves the region-show logic to the proper update job where cursors are also updated. --- src/lib/elementary/efl_ui_text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index dd2fcadedd..0b32ff90fd 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -4732,6 +4732,7 @@ _update_text_cursors(Eo *obj) evas_object_hide(sd->cursor_bidi); } } + _cursor_geometry_recalc(obj); } static void @@ -5319,7 +5320,6 @@ _efl_ui_text_cursor_changed_cb(void *data, const Efl_Event *event EINA_UNUSED) EFL_UI_TEXT_DATA_GET(data, sd); sd->cur_changed = EINA_TRUE; sd->deferred_decoration_cursor = EINA_TRUE; - _cursor_geometry_recalc(data); _decoration_defer(data); } --
[EGIT] [core/efl] master 01/01: Canvas layout: fix part text cursor geometry port
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=40e97c65896d2ebcbaaf0b6a0a6d279a5e4a commit 40e97c65896d2ebcbaaf0b6a0a6d279a5e4a Author: Daniel Hirt Date: Wed Jun 21 10:47:08 2017 +0300 Canvas layout: fix part text cursor geometry port Forgot to consider the edje object's offset when porting the code to efl_part (see 98dad1a52b0c75c18191b069c87ebb6f493e74ca). This fixes a few bugs, one of which is region_show for the scrollable mode. --- src/lib/edje/edje_part_text.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c index e7f8abdb56..027863acfe 100644 --- a/src/lib/edje/edje_part_text.c +++ b/src/lib/edje/edje_part_text.c @@ -171,7 +171,12 @@ _efl_canvas_layout_internal_text_efl_text_cursor_cursor_geometry_get(Eo *obj, Evas_Coord *cw2 EINA_UNUSED, Evas_Coord *ch2 EINA_UNUSED) { PROXY_DATA_GET(obj, pd); - _edje_entry_cursor_geometry_get(pd->rp, cx, cy, cw, ch, NULL); + if (pd->rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) + { +_edje_entry_cursor_geometry_get(pd->rp, cx, cy, cw, ch, NULL); +if (cx) *cx -= pd->ed->x; +if (cy) *cy -= pd->ed->y; + } RETURN_VAL(EINA_FALSE); } --
Re: [E-devel] Elm_Entry assuming markup input???
Hi, On Mon, Jun 19, 2017 at 12:01 PM, Andrew Williams wrote: > Hi, > > Looking at the tests you point me at - selection (and the past) is a plain > text copy with the markup stripped - exactly what I would expect for > text_get - but the current content transformed with the helper will not get > you there - there is no built in interpretation of formatting - just > rendered understands it. > > "elm_entry_selection_get" returns the text in markup format. The test prints both types one after another (markup followed by plaintext) using "elm_entry_markup_to_utf8". It is essential for copy & paste of markup text between two entry clients, so the pasted formatting is kept. > Overall the implementation feels wrong - supporting markup is great but > returning it inline in text_get feels like we are imposing internal choices > on other devs. > > I note that the code considers format but only when interacting with files > - so I can have plain text files but not plain text input. > > Right, it's a feature so you can load plain files. You specify the format you want to load (plaintext or markup). But, after the file is loaded, it's discarded. It's important to point out that because there's an actual representation (markup), it's costly to store both plaintext and markup content in the object. Asking you to convert using "markup_to_utf8" is understandable, as it what we would actually do internally if we were to add API to get the text in plaintext. It's only one function call away, and it's easier than just add more API to the widget. No need for a new function if there's a way to do this already. > Lastly the documentation clearly discussed markup capability but it *never* > discusses encoding and there is no explicit mention that your text will be > transformed after text_set. If it were then it should be symmetrically > transformed back on text_get - path of least surprise. > > Actually, it is not transformed on "text_set". You are expected to enter a markup-compatible text. Otherwise you will have the mentioned special characters (like "<") misinterpreted as markup. You can try with "elm_object_text_set" on an entry widget. > I don't quite understand why we would build formatting in as mandatory, > functionality is great but it should be possible to turn it off. > > I agree that people complain when markup is not supported in a widget but > that is the expectation we have set - consistency is very important indeed > and I think we don't have it in this regard. > > Additionally I think the markup_to_utf8 methods are peculiarly named - they > do no character encoding so the usage of utf8 is probably incorrect... > They're correct. UTF-8 is the standard plaintext encoding. We support UTF-8, and provide converters for your convenience. You probably won't need those most of the time. Your plaintext is always "encoded", but you probably won't notice that because it's backward-compatible with US ASCII (1-byte per character). > > Andrew > > Lastly, I would like to mention "Efl.Ui.Text" - this new widget is a part of a rework of the Textblock object. It's in BETA stage. It does what you require: all text input is expected to be plaintext. There's no "markup" logic in it. Instead, you format your text by setting ranges and calling functions to apply formatting. Again, markup does not exist in this object, and can be re-added as a module in later stages. You can check its current state in "efl ui text" test in elementary_test. Feedback will be very much appreciated. Hope this answers a few of your questions. Best, -- Danny (herdsman) Hirt -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 02/04: Efl text format: change "halign" and "valign" to use enums
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d0da405620613c83e94e89a192f7982954cf5e90 commit d0da405620613c83e94e89a192f7982954cf5e90 Author: Daniel Hirt Date: Thu Jun 15 12:30:55 2017 +0300 Efl text format: change "halign" and "valign" to use enums Value-based alignment (e.g. 0.5, 0.3 etc) isn't very practical. Horizontal and vertical alignments will be assigned with enums "left", "center", "right", "auto", "locale", for horizontal alignment, and "top", "center" and "bottom" for vertical alignment. This changes the previously added "halign" and "valign" properties. --- src/lib/efl/interfaces/efl_text_format.eo | 32 ++ src/lib/efl/interfaces/efl_text_types.eot | 1 - src/lib/evas/canvas/evas_object_textblock.c | 67 - 3 files changed, 81 insertions(+), 19 deletions(-) diff --git a/src/lib/efl/interfaces/efl_text_format.eo b/src/lib/efl/interfaces/efl_text_format.eo index d904ec246a..52c8e27911 100644 --- a/src/lib/efl/interfaces/efl_text_format.eo +++ b/src/lib/efl/interfaces/efl_text_format.eo @@ -7,6 +7,24 @@ enum Efl.Text.Format.Wrap { hyphenation [[Wrap mode hyphenation]] } +enum Efl.Text.Format.Horizontal_Alignment_Type { + [[Horizontal alignment of the text]] + legacy: efl_text_horizontal_alignment; + auto,[[Respects LTR/RTL (bidirectional) settings]] + locale, [[Respects locale's langauge settings]] + left,[[Text is placed at the left end of the line]] + right, [[Text is placed at the right end of the line]] + center [[Text is places at the center of the line]] +} + +enum Efl.Text.Format.Vertical_Alignment_Type { + [[Horizontal alignment of the text]] + legacy: efl_text_vertical_alignment; + top,[[Text is placed at the top]] + center, [[Text is placed at the center]] + bottom [[Text is placed at the bottom]] +} + interface Efl.Text.Format { [[The look and layout of the text @@ -40,18 +58,16 @@ interface Efl.Text.Format { } @property halign { - [[Horizontal alignment of text (number from 0.0 to 1.0)]] - values - { -value: double; + [[Horizontal alignment of text]] + values { +value: Efl.Text.Format.Horizontal_Alignment_Type; } } @property valign { - [[Vertical alignment of text (number from -1.0 to 1.0)]] - values - { -value: double; + [[Vertical alignment of text]] + values { +value: Efl.Text.Format.Vertical_Alignment_Type; } } diff --git a/src/lib/efl/interfaces/efl_text_types.eot b/src/lib/efl/interfaces/efl_text_types.eot index 3fe14a2021..bb7362d270 100644 --- a/src/lib/efl/interfaces/efl_text_types.eot +++ b/src/lib/efl/interfaces/efl_text_types.eot @@ -31,4 +31,3 @@ enum Efl.Text.Cursor.Cursor_Type before, [[Cursor type before]] under [[Cursor type under]] } - diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 2d8f7887f3..61b76a4b4e 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -15379,35 +15379,82 @@ _efl_canvas_text_efl_text_format_multiline_get(Eo *obj EINA_UNUSED, Efl_Canvas_T } static void -_efl_canvas_text_efl_text_format_halign_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double value EINA_UNUSED) +_efl_canvas_text_efl_text_format_halign_set(Eo *obj, Efl_Canvas_Text_Data *o, Efl_Text_Format_Horizontal_Alignment_Type type) { - if (value < 0.0) + if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO) { -_FMT_SET(halign_auto, EINA_TRUE); +_FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL); + } + else if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_LOCALE) + { +_FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE); } else { +double value = 0.0; // EFL_TEXT_HORIZONTAL_ALIGNMENT_LEFT _FMT(halign_auto) = EINA_FALSE; + +if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_CENTER) + { + value = 0.5; + } +else if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_RIGHT) + { + value = 1.0; + } _FMT_SET(halign, value); } } -static double -_efl_canvas_text_efl_text_format_halign_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED) +static Efl_Text_Format_Horizontal_Alignment_Type +_efl_canvas_text_efl_text_format_halign_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o) { - return (_FMT(halign_auto) ? -1.0 : _FMT(halign)); + Efl_Text_Format_Horizontal_Alignment_Type ret = + EFL_TEXT_HORIZONTAL_ALIGNMENT_LEFT; + + if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL)
[EGIT] [core/efl] master 04/04: Evas text: fix test with Oriya script
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a5e980fbbc24d11daec25436a5bff32ce61911bd commit a5e980fbbc24d11daec25436a5bff32ce61911bd Author: Daniel Hirt Date: Mon Jun 19 09:49:19 2017 +0300 Evas text: fix test with Oriya script We are not providing a font to test that specific script. Commenting-out this test until we can find one with proper license. This fixes the test suite fail case. @fix --- src/tests/evas/evas_test_text.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tests/evas/evas_test_text.c b/src/tests/evas/evas_test_text.c index a7c32420d7..951e4c2039 100644 --- a/src/tests/evas/evas_test_text.c +++ b/src/tests/evas/evas_test_text.c @@ -150,11 +150,12 @@ START_TEST(evas_text_geometries) ck_assert_int_lt(w, adv); #ifdef HAVE_HARFBUZZ - /* Obviously, adv < width case */ - evas_object_text_text_set(to, "ନୂଁ"); - adv = evas_object_text_horiz_advance_get(to); - evas_object_geometry_get(to, NULL, NULL, &w, NULL); - ck_assert_int_lt(adv, w); + // FIXME: missing a font for Oriya script in our test suite + ///* Obviously, adv < width case */ + //evas_object_text_text_set(to, "ନୂଁ"); + //adv = evas_object_text_horiz_advance_get(to); + //evas_object_geometry_get(to, NULL, NULL, &w, NULL); + //ck_assert_int_lt(adv, w); #endif END_TEXT_TEST(); --
[EGIT] [core/efl] master 01/04: Canvas text: fix default format feature
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6033323e5cd0a248bd9830c970b546f2ac8dfebb commit 6033323e5cd0a248bd9830c970b546f2ac8dfebb Author: Daniel Hirt Date: Sun Jun 18 10:13:05 2017 +0300 Canvas text: fix default format feature Now that we can set the default parameters, there's no need to push another one when having a style tag. This fixes T5585. --- src/lib/evas/canvas/evas_object_textblock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 268f9e33a9..2d8f7887f3 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3437,7 +3437,7 @@ _layout_format_pop(Ctxt *c, const char *format) * I.e whole of the ending tag matches the start of the * starting tag, and the starting tag's next char is either * NULL or white. Skip the starting '+'. */ - if (fmt->fnode && _FORMAT_IS_CLOSER_OF( + if (_FORMAT_IS_CLOSER_OF( fmt->fnode->orig_format, format + 1, len - 1)) { _format_unref_free(c->obj, fmt); @@ -3445,7 +3445,7 @@ _layout_format_pop(Ctxt *c, const char *format) } else { - if (fmt->fnode) redo_nodes = eina_list_prepend(redo_nodes, fmt->fnode); + redo_nodes = eina_list_prepend(redo_nodes, fmt->fnode); _format_unref_free(c->obj, fmt); } } @@ -6359,7 +6359,6 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret) } if ((c->o->style) && (c->o->style->default_tag)) { - c->fmt = _layout_format_push(c, NULL, NULL); _format_fill(c->obj, c->fmt, c->o->style->default_tag); finalize = EINA_TRUE; } --
[EGIT] [core/efl] master 03/04: Efl text cursor: move around a few definitions
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=108bf9956437ed07fe7364ce5632e0b651851663 commit 108bf9956437ed07fe7364ce5632e0b651851663 Author: Daniel Hirt Date: Thu Jun 15 13:37:17 2017 +0300 Efl text cursor: move around a few definitions Need to handle this with special care as Efl.Text.Cursor is used in some functions that are specific to Efl.Canvas.Text, was well as functions in Efl.Text.Cursor interface. --- src/lib/efl/interfaces/efl_text_cursor.eo | 21 ++ src/lib/efl/interfaces/efl_text_types.eot | 20 -- src/lib/evas/canvas/evas_object_textblock.c | 310 ++-- 3 files changed, 174 insertions(+), 177 deletions(-) diff --git a/src/lib/efl/interfaces/efl_text_cursor.eo b/src/lib/efl/interfaces/efl_text_cursor.eo index 4255cc1d93..ad9db0d100 100644 --- a/src/lib/efl/interfaces/efl_text_cursor.eo +++ b/src/lib/efl/interfaces/efl_text_cursor.eo @@ -1,6 +1,27 @@ import eina_types; import efl_text_types; +enum Efl.Text.Cursor.Cursor_Get_Type { + [[All available cursor states]] + legacy: efl_text_cursor_get; + default = 0, [[Main cursor state (alias to "main")]] + main,[[Main cursor state]] + selection_begin, [[Selection begin cursor state]] + selection_end, [[Selection end cursor state]] + preedit_start, [[Pre-edit start cursor state]] + preedit_end, [[Pre-edit end cursor starge]] + user,[[User cursor state]] + user_extra [[User extra cursor state]] +} + +enum Efl.Text.Cursor.Cursor_Type +{ + [[Text cursor types]] + legacy: efl_text_cursor_type; + before, [[Cursor type before]] + under [[Cursor type under]] +} + interface Efl.Text.Cursor { [[Cursor API diff --git a/src/lib/efl/interfaces/efl_text_types.eot b/src/lib/efl/interfaces/efl_text_types.eot index bb7362d270..23686cbf1e 100644 --- a/src/lib/efl/interfaces/efl_text_types.eot +++ b/src/lib/efl/interfaces/efl_text_types.eot @@ -7,27 +7,7 @@ enum Efl.Text.Bidirectional_Type { inherit [[Inherit text type]] } -enum Efl.Text.Cursor.Cursor_Get_Type { - [[All available cursor states]] - legacy: efl_text_cursor_get; - default = 0, [[Main cursor state (alias to "main")]] - main,[[Main cursor state]] - selection_begin, [[Selection begin cursor state]] - selection_end, [[Selection end cursor state]] - preedit_start, [[Pre-edit start cursor state]] - preedit_end, [[Pre-edit end cursor starge]] - user,[[User cursor state]] - user_extra [[User extra cursor state]] -} - type @extern Efl.Canvas.Text.Annotation: __undefined_type; [[EFL text annotations data structure]] type @extern Efl.Text.Cursor.Cursor_Data: __undefined_type; [[Text cursor data structure]] -enum Efl.Text.Cursor.Cursor_Type -{ - [[Text cursor types]] - legacy: efl_text_cursor_type; - before, [[Cursor type before]] - under [[Cursor type under]] -} diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 61b76a4b4e..c248efa024 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -566,10 +566,6 @@ struct _Efl_Text_Cursor_Cursor_Data Eina_Boolchanged : 1; }; -typedef struct _Efl_Text_Cursor_Cursor_Data Efl_Canvas_Text_Cursor; -typedef struct _Efl_Text_Cursor_Cursor_Data Efl_Canvas_Text_Cursor_Data; -typedef struct _Efl_Text_Cursor_Cursor_Data Efl_Text_Cursor_Data; - struct _Efl_Canvas_Text_Annotation { EINA_INLIST; @@ -587,7 +583,7 @@ struct _Evas_Object_Textblock { Evas_Textblock_Style *style; Eina_List *styles; - Efl_Canvas_Text_Cursor *cursor; + Efl_Text_Cursor_Cursor_Data*cursor; Eina_List *cursors; Evas_Object_Textblock_Node_Text*text_nodes; Evas_Object_Textblock_Node_Format *format_nodes; @@ -742,39 +738,39 @@ static const Evas_Object_Func object_func = MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); \ return (x); \ MAGIC_CHECK_END(); -static Eina_Bool _evas_textblock_cursor_is_at_the_end(const Efl_Canvas_Text_Cursor_Data *cur); +static Eina_Bool _evas_textblock_cursor_is_at_the_end(const Efl_Text_Cursor_Cursor_Data *cur); static void _evas_textblock_node_text_remove(Efl_Canvas_Text_Data *o, Evas_Object_Textblock_Node_Text *n); -static Evas_Object_Textblock_Node_Format *_evas_textblock_cursor_node_format_before_or_at_pos_get(const Efl_Canvas_Text_Cursor_Data *cur); +static Evas_Object_Textblock_Node_Format *_evas_textblock_cursor_node_format_before_or_at_pos_get(const Efl_Text_Cursor_Cursor_Data *cur); static size_t _evas_textblock_node_format_pos_get(const Evas_Object_Textblock_Node_Format *fmt); static void _evas_textblock_node_format_remove(Efl_Canvas_Text_Data *o, Evas_Object_Textblock_Node_Format *n, int visual_adjus
Re: [E-devel] Handle types in Eolian
Hi, On Sat, Jun 17, 2017 at 5:17 AM, Felipe Magno de Almeida < felipe.m.alme...@gmail.com> wrote: > On Jun 16, 2017 11:10 PM, "Carsten Haitzler" wrote: > > On Fri, 16 Jun 2017 19:48:51 -0300 Felipe Magno de Almeida > said: > > > Hello, > > > > Should handle types (opaque types always used by pointer) should be > > supported for bindings or should we find an alternative for them in > > Eolian interfaces? > > i'm not sure we need to look for alternatives. to me it's a very clean > concept. > it's a handle to something... which you can't dig around inside of and have > a > clear type... > > > Maybe we should have a way to tag as a handle? Right now the equivalent is > using __undefined_type, but I'm not sure if it is always the same thing. We > might use __undefined_type for types that must be defined by the binding > itself. Handles, OTH, have an unbounded limit and must assume the type is > never defined. > > Regards, > > Honestly, the current solution could use a bit of improvement: type @extern Efl.Text.Foo: __undefined_type; This is not very self-explanatory IMHO. I am wondering what bindings should do with the above info? Also, why do we need the extra "@extern" AND the "__undefined_type". And, how is that different from the following: struct Efl.Text.Foo; So many options... -- Danny (herdsman) Hirt > > > -- > - Codito, ergo sum - "I code, therefore I am" -- > The Rasterman (Carsten Haitzler)ras...@rasterman.com > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Elm_Entry assuming markup input???
Hi Andrew, Markup uses tags like " hello ". It is clear why it's essential to do "character escaping" like ">" instead of "<". Otherwise, if you feed "<" back to the entry widget, it will be misinterpreted as a tag element. As a side note, you can use "elm_entry_markup_to_utf8" helper to strip-down the formatting and "un-escape" the characters so all becomes a valid utf8 text. Hope that clears things up a bit. -- Danny (herdsman) Hirt On Sun, Jun 18, 2017 at 11:18 PM, Andrew Williams wrote: > Hi team, > > Netstar pointed out something to me today that I had completely missed for > ages - elm_entry assumes you are typing markup. Type "a>b" and text_get > will return "a>b" - what is the reason for this? It seems completely > crazy default behaviour. > Is there any reason we can't turn this off by default but provide the > markup filter in a way where it can be switched on as needed? > > Thanks, > Andy > -- > http://andywilliams.me > http://ajwillia.ms > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [tools/expedite] master 01/01: Textblock: fix textblock_basic test
herdsman pushed a commit to branch master. http://git.enlightenment.org/tools/expedite.git/commit/?id=9cdc8c68a71a4326880ff72e411de97f5efa1f1c commit 9cdc8c68a71a4326880ff72e411de97f5efa1f1c Author: Daniel Hirt Date: Wed Jun 14 08:10:55 2017 +0300 Textblock: fix textblock_basic test Test's text was changed some time ago, changing the escaped strings e.g. ">" to ">" (i.e. without ";"). Thus, only the starting portion of the text got shown. Now it's fixed. --- src/bin/textblock_basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/textblock_basic.c b/src/bin/textblock_basic.c index 38d6b49..6a4b8ad 100644 --- a/src/bin/textblock_basic.c +++ b/src/bin/textblock_basic.c @@ -43,8 +43,8 @@ static void _setup(void) evas_object_textblock_clear(o); evas_object_textblock_text_markup_set(o, "Title" "A pragraph here red text and stuff." - "And escaping <, and >, as well as &, as normal." - "If you want a newline use <, br>, woo a new line!" + "And escaping <, and >, as well as &, as normal." + "If you want a newline use <, br>, woo a new line!" "Right " "aligned " "text " --
[EGIT] [core/efl] master 01/01: Canvas text cursor: add NULL checks for some functions
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=867980520819a7c4bbc0fc70835d1e6823834941 commit 867980520819a7c4bbc0fc70835d1e6823834941 Author: Daniel Hirt Date: Tue Jun 13 14:48:50 2017 +0300 Canvas text cursor: add NULL checks for some functions Passing a NULL cursor is permitted. Forgot to add to two functions during port from EO. Fixes some crashes. --- src/lib/evas/canvas/evas_object_textblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 99b0343d99..6476c48b02 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -8550,10 +8550,10 @@ found: _evas_textblock_changed(o, eo_obj); } -//FIXME: add to legacy header EAPI void evas_textblock_cursor_paragraph_first(Efl_Canvas_Text_Cursor *cur) { + if (!cur) return; Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); Efl_Canvas_Text_Data *o = efl_data_scope_get(cur->obj, MY_CLASS); @@ -8568,12 +8568,12 @@ _efl_canvas_text_efl_text_cursor_cursor_paragraph_first(Eo *eo_obj, Efl_Canvas_T efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); } -//FIXME: add to legacy header EAPI void evas_textblock_cursor_paragraph_last(Efl_Canvas_Text_Cursor *cur) { Evas_Object_Textblock_Node_Text *node; + if (!cur) return; Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); Efl_Canvas_Text_Data *o = efl_data_scope_get(cur->obj, MY_CLASS); --
[EGIT] [core/efl] master 14/21: Elementary: bring back disabled tests
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6f48fcc03b9ae911dc19fc8ec013a1d260f408d1 commit 6f48fcc03b9ae911dc19fc8ec013a1d260f408d1 Author: Daniel Hirt Date: Sun Jun 11 23:25:39 2017 +0300 Elementary: bring back disabled tests --- src/Makefile_Elementary.am | 2 ++ src/bin/elementary/test.c | 8 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index d2064c8f47..764fba46e4 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -797,6 +797,7 @@ bin/elementary/test_genlist.c \ bin/elementary/test_gesture_layer.c \ bin/elementary/test_gesture_layer2.c \ bin/elementary/test_gesture_layer3.c \ +bin/elementary/test_gfx_filters.c \ bin/elementary/test_glview_simple.c \ bin/elementary/test_glview.c \ bin/elementary/test_glview_manygears.c \ @@ -859,6 +860,7 @@ bin/elementary/test_win_socket.c \ bin/elementary/test_win_plug.c \ bin/elementary/test_win_state.c \ bin/elementary/test_win_wm_rotation.c \ +bin/elementary/test_win_dialog.c \ bin/elementary/test_win_modal.c \ bin/elementary/test_efl_ui_text.c \ bin/elementary/test_win_stack.c \ diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 82888d2ab6..5ce8de7f29 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -292,7 +292,7 @@ void test_dnd_genlist_gengrid(void *data, Evas_Object *obj, void *event_info); void test_dnd_multi_features(void *data, Evas_Object *obj, void *event_info); void test_dnd_types(void *data, Evas_Object *obj, void *event_info); void test_task_switcher(void *data, Evas_Object *obj, void *event_info); -//void test_win_dialog(void *data, Evas_Object *obj, void *event_info); +void test_win_dialog(void *data, Evas_Object *obj, void *event_info); void test_win_modal(void *data, Evas_Object *obj, void *event_info); void test_box_disable(void *data, Evas_Object *obj, void *event_info); void test_layout_disable(void *data, Evas_Object *obj, void *event_info); @@ -310,7 +310,7 @@ void test_code_diff_inline(void *data, Evas_Object *obj, void *event_info); void test_efl_ui_text(void *data, Evas_Object *obj, void *event_info); void test_efl_ui_text_label(void *data, Evas_Object *obj, void *event_info); void test_evas_mask(void *data, Edje_Object *obj, void *event_info); -//void test_gfx_filters(void *data, Evas_Object *obj, void *event_info); +void test_gfx_filters(void *data, Evas_Object *obj, void *event_info); void test_evas_snapshot(void *data, Evas_Object *obj, void *event_info); void test_evas_map(void *data, Edje_Object *obj, void *event_info); void test_efl_gfx_map(void *data, Edje_Object *obj, void *event_info); @@ -667,7 +667,7 @@ add_tests: ADD_TEST(NULL, "Window / Background", "Window Socket", test_win_socket); ADD_TEST(NULL, "Window / Background", "Window Plug", test_win_plug); ADD_TEST(NULL, "Window / Background", "Window WM Rotation", test_win_wm_rotation); -// ADD_TEST(NULL, "Window / Background", "Window Standard/Dialog", test_win_dialog); + ADD_TEST(NULL, "Window / Background", "Window Standard/Dialog", test_win_dialog); ADD_TEST(NULL, "Window / Background", "Window Keygrab Set", test_win_keygrab); ADD_TEST(NULL, "Window / Background", "Window Modal", test_win_modal); ADD_TEST(NULL, "Window / Background", "Window Stack", test_win_stack); @@ -1032,7 +1032,7 @@ add_tests: //--// ADD_TEST(NULL, "Evas", "Masking", test_evas_mask); -// ADD_TEST(NULL, "Evas", "Gfx Filters", test_gfx_filters); + ADD_TEST(NULL, "Evas", "Gfx Filters", test_gfx_filters); ADD_TEST(NULL, "Evas", "Snapshot", test_evas_snapshot); ADD_TEST(NULL, "Evas", "Map", test_evas_map); ADD_TEST(NULL, "Evas", "Gfx Map", test_efl_gfx_map); --
[EGIT] [core/efl] master 06/21: Text cursor: add interface and implement in Canvas.Text
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=30f74a759d3cd40f1114be4cc7141305f2d987f0 commit 30f74a759d3cd40f1114be4cc7141305f2d987f0 Author: Daniel Hirt Date: Thu Jun 8 13:07:12 2017 +0300 Text cursor: add interface and implement in Canvas.Text --- src/Makefile_Efl.am| 1 + src/bin/elementary/test_efl_ui_text.c | 26 +- src/lib/efl/Efl.h | 1 + src/lib/efl/interfaces/efl_interfaces_main.c | 1 + src/lib/efl/interfaces/efl_text_cursor.eo | 212 src/lib/efl/interfaces/efl_text_types.eot | 12 +- .../elementary/efl_ui_internal_text_interactive.c | 78 +++--- src/lib/elementary/efl_ui_text.c | 107 src/lib/elementary/efl_ui_text.eo | 2 +- src/lib/elementary/efl_ui_text_interactive.eo | 4 +- src/lib/evas/canvas/efl_canvas_text.eo | 271 - src/lib/evas/canvas/evas_object_textblock.c| 86 --- src/lib/evas/canvas/evas_textblock_legacy.h| 5 +- 13 files changed, 432 insertions(+), 374 deletions(-) diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 6fda23e101..4c65a7920e 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -19,6 +19,7 @@ efl_eolian_files = \ lib/efl/interfaces/efl_text_font.eo \ lib/efl/interfaces/efl_text_style.eo \ lib/efl/interfaces/efl_text_format.eo \ + lib/efl/interfaces/efl_text_cursor.eo \ lib/efl/interfaces/efl_text_properties.eo \ lib/efl/interfaces/efl_gfx_stack.eo \ lib/efl/interfaces/efl_gfx_view.eo \ diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 2a438d5640..bfcb4cd108 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -11,11 +11,11 @@ _apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style) { Efl_Canvas_Text_Cursor *start, *end; - start = efl_canvas_text_cursor_get(obj); - end = efl_canvas_text_cursor_get(obj); + start = efl_text_cursor_get(obj); + end = efl_text_cursor_get(obj); - efl_canvas_text_cursor_position_set(obj, start, start_pos); - efl_canvas_text_cursor_position_set(obj, end, end_pos); + efl_text_cursor_position_set(obj, start, start_pos); + efl_text_cursor_position_set(obj, end, end_pos); efl_canvas_text_annotation_insert(obj, start, end, style); } @@ -101,8 +101,8 @@ my_efl_ui_text_bt_3(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E const char *s = efl_canvas_text_range_text_get(data, sel_start, sel_end); printf("SELECTION REGION: %d - %d\n", - efl_canvas_text_cursor_position_get(obj, sel_start), - efl_canvas_text_cursor_position_get(obj, sel_end)); + efl_text_cursor_position_get(obj, sel_start), + efl_text_cursor_position_get(obj, sel_end)); printf("SELECTION:\n"); if (s) printf("%s\n", s); } @@ -111,7 +111,7 @@ static void my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *en = data; - efl_canvas_text_cursor_object_item_insert(obj, efl_canvas_text_cursor_get(en), + efl_canvas_text_cursor_object_item_insert(obj, efl_text_cursor_get(en), "size=32x32 href=emoticon"); } @@ -178,16 +178,16 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_text_font_width_set(en, EFL_TEXT_FONT_WIDTH_ULTRACONDENSED); efl_text_style_normal_color_set(en, 255, 255, 255, 255); - main_cur = efl_canvas_text_cursor_get(en); - cur = efl_canvas_text_cursor_new(en); + main_cur = efl_text_cursor_get(en); + cur = efl_text_cursor_new(en); - efl_canvas_text_cursor_position_set(en, cur, 2); + efl_text_cursor_position_set(en, cur, 2); efl_canvas_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon"); - efl_canvas_text_cursor_position_set(en, cur, 50); + efl_text_cursor_position_set(en, cur, 50); efl_canvas_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon"); - efl_canvas_text_cursor_position_set(en, main_cur, 5); - efl_canvas_text_cursor_position_set(en, cur, 20); + efl_text_cursor_position_set(en, main_cur, 5); + efl_text_cursor_position_set(en, cur, 20); efl_canvas_text_annotation_insert(en, main_cur, cur, "a href=#hello"); diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 01f72df8ed..eb06539b41 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -151,6 +151,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_text_font.eo.h" #include "interfaces/efl_text_style.eo.h" #include "interfaces/efl_text_format.eo.h" +#include "interfaces/efl_text_cursor.eo.h" #else diff --git a
[EGIT] [core/efl] master 16/21: gfx_filter: null-out freed pointer
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8f6415143cafec55e278ce6fc2442ed46e4e0dc0 commit 8f6415143cafec55e278ce6fc2442ed46e4e0dc0 Author: Daniel Hirt Date: Tue May 30 13:47:48 2017 +0300 gfx_filter: null-out freed pointer --- src/lib/evas/canvas/evas_object_textblock.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 4a7d5d23dc..4b814ce78b 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -987,6 +987,7 @@ _format_unref_free(const Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt) if (fmt->gfx_filter->dc) ENFN->context_free(ENC, fmt->gfx_filter->dc); free(fmt->gfx_filter); +fmt->gfx_filter = NULL; } if ((obj->layer) && (obj->layer->evas)) evas_font_free(obj->layer->evas->evas, fmt->font.font); @@ -1033,7 +1034,10 @@ _item_free(const Evas_Object *eo_obj, Evas_Object_Textblock_Line *ln, Evas_Objec } EINA_INLIST_REMOVE(o->gfx_filter.text_items, ti->gfx_filter); if (!ti->gfx_filter->ctx) - free(ti->gfx_filter); + { + free(ti->gfx_filter); + ti->gfx_filter = NULL; + } else ti->gfx_filter->ti = NULL; } --
[EGIT] [core/efl] master 11/21: Canvas layout: port part_text to efl_part
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6e1b5fdd1065d0a0f3b04cd07ea069f05ec4077e commit 6e1b5fdd1065d0a0f3b04cd07ea069f05ec4077e Author: Daniel Hirt Date: Tue May 30 10:31:19 2017 +0300 Canvas layout: port part_text to efl_part You now use the following: efl_text_set(efl_part(edje_obj, "part"), "text"); const char *text = efl_text_get(efl_part(edje_obj, "part")); The former method of edje_object_part_text_set/get is now legacy. Also, adjusted 'tests/emotion/emotion_test_main-eo.c' with this change. --- src/Makefile_Edje.am| 4 +++- src/lib/edje/Edje_Eo.h | 1 + src/lib/edje/Edje_Legacy.h | 23 +- src/lib/edje/edje_object.eo | 19 -- src/lib/edje/edje_part.c| 2 ++ src/lib/edje/edje_part_text.c | 26 + src/lib/edje/edje_private.h | 5 + src/lib/edje/edje_util.c| 25 src/lib/edje/efl_canvas_layout_internal_text.eo | 12 src/tests/emotion/emotion_test_main-eo.c| 10 +- 10 files changed, 97 insertions(+), 30 deletions(-) diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index ff8c41ac69..b982d1a739 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -8,6 +8,7 @@ edje_eolian_files = \ lib/edje/efl_canvas_layout_internal_table.eo \ lib/edje/efl_canvas_layout_internal_swallow.eo \ lib/edje/efl_canvas_layout_external.eo \ + lib/edje/efl_canvas_layout_internal_text.eo \ lib/edje/edje_edit.eo edje_eolian_type_files = \ @@ -101,7 +102,8 @@ lib/edje/edje_part_helper.h \ lib/edje/edje_part_external.c \ lib/edje/edje_part_swallow.c \ lib/edje/edje_part_table.c \ -lib/edje/edje_part_box.c +lib/edje/edje_part_box.c \ +lib/edje/edje_part_text.c lib_edje_libedje_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EDJE_COMMON_CPPFLAGS) lib_edje_libedje_la_LIBADD = @EDJE_LIBS@ @EDJE_LUA_LIBS@ diff --git a/src/lib/edje/Edje_Eo.h b/src/lib/edje/Edje_Eo.h index 05982fd786..23d836646c 100644 --- a/src/lib/edje/Edje_Eo.h +++ b/src/lib/edje/Edje_Eo.h @@ -7,4 +7,5 @@ #include "efl_canvas_layout_internal_box.eo.h" #include "efl_canvas_layout_internal_table.eo.h" #include "efl_canvas_layout_internal_swallow.eo.h" +#include "efl_canvas_layout_internal_text.eo.h" #include "efl_canvas_layout_external.eo.h" diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index 9bf6a2c273..5bdcef4db6 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -1354,8 +1354,29 @@ EAPI Eina_Bool edje_object_part_drag_page_get(const Edje_Object *obj, const char EAPI Eina_Bool edje_object_part_drag_page(Edje_Object *obj, const char *part, double dx, double dy); /** - * @} + * @brief Sets a given text to an Edje object @c TEXT or TEXTBLOCK + * parts. + * + * @param[in] part The part name + * @param[in] text The text to set on that part + * + * @ingroup Edje_Object + */ +EAPI Eina_Bool edje_object_part_text_set(const Edje_Object *obj, const char *part, const char *text); + +/** + * @brief Gets the text currntly set to the given part + * + * @param[in] part The part name + * + * @return The text set on the part, @c null otherwise. + * + * @ingroup Edje_Object */ +EAPI const char * edje_object_part_text_get(const Edje_Object *obj, const char *part); +/** + * @} + */ #include "edje_object.eo.legacy.h" #include "edje_edit.eo.legacy.h" diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo index 2b5851b8e6..6a0860b371 100644 --- a/src/lib/edje/edje_object.eo +++ b/src/lib/edje/edje_object.eo @@ -780,25 +780,6 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part, data: void_ptr; [[The data associated to the callback function.]] } } - @property part_text { - set { -[[Sets the text for an object part]] -return: bool; [[$true on success, $false otherwise]] - } - get { -[[Returns the text of the object part. - - This function returns the text associated to the object part. - - See also @.part_text.set().]] - } - keys { -part: string; [[The part name]] - } - values { -text: string; [[The text string]] - } - } @property part_text_escaped { set { [[Sets the text for an object part, but converts HTML escapes to UTF8 diff --git a/src/lib/edje/edje_part.c b/src/lib/edje/edje_part.c index deeb0d1b0a..cbfd71e243 100644 --- a/src/lib/edje/edje_part.c +++ b/src/lib/edje/edje_part.c
[EGIT] [core/efl] master 18/21: Ui text: set some default font and size
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ba45b93b1eaa9f1709d1c94f03762363aad81692 commit ba45b93b1eaa9f1709d1c94f03762363aad81692 Author: Daniel Hirt Date: Wed May 31 10:50:55 2017 +0300 Ui text: set some default font and size This should later be setup through the theme. One option will be to use global text classes. Until the above is finalized, at least set this font and size to make setup of the widget a bit easier. --- src/lib/elementary/efl_ui_text.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 0d015c2aec..b3c80fdd75 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -2979,6 +2979,11 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv) text_obj = efl_add(EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS, obj); efl_composite_attach(obj, text_obj); + // FIXME: use the theme, when a proper theming option is available + // (possibly, text_classes). + // For now, set this for easier setup + efl_text_font_set(text_obj, "Sans", 12); + efl_canvas_group_add(efl_super(obj, MY_CLASS)); elm_widget_sub_object_parent_add(obj); --
[EGIT] [core/efl] master 07/21: Ui text: fix text initialization
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bdf64946a90258a86d79e6115ba48ede81a306f8 commit bdf64946a90258a86d79e6115ba48ede81a306f8 Author: Daniel Hirt Date: Thu Jun 8 13:24:31 2017 +0300 Ui text: fix text initialization It uses elm_layout's, where it shouldn't (it's legacy). Also, it's not needed to to that there. --- src/lib/elementary/efl_ui_text.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 7d1bc9a58f..314b1e4c3f 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -910,7 +910,6 @@ EOLIAN static Elm_Theme_Apply _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd) { const char *str; - const char *t; const char *style = elm_widget_style_get(obj); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); @@ -930,8 +929,6 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd) _mirrored_set(obj, elm_widget_mirrored_get(obj)); - t = eina_stringshare_add(elm_object_text_get(obj)); - elm_widget_theme_object_set (obj, sd->entry_edje, "efl_ui_text", _efl_ui_text_theme_group_get(obj), style); @@ -942,10 +939,6 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd) edje_obj_part_text_select_allow_set (sd->entry_edje, "elm.text", EINA_FALSE); - elm_object_text_set(obj, t); - efl_text_set(obj, t); - eina_stringshare_del(t); - if (elm_widget_disabled_get(obj)) edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm"); --
[EGIT] [core/efl] master 02/21: Ui text: fix leak in decorations
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=303d2e79cc94f38571389f41e28b71bc26d03dc3 commit 303d2e79cc94f38571389f41e28b71bc26d03dc3 Author: Daniel Hirt Date: Thu Jun 8 08:08:56 2017 +0300 Ui text: fix leak in decorations --- src/lib/elementary/efl_ui_text.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index e5a41de276..4ec8836fe1 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -268,6 +268,8 @@ static void _edje_signal_emit(Efl_Ui_Text_Data *obj, const char *sig, const char static void _decoration_defer_all(Eo *obj); static inline Eo * _decoration_create(Efl_Ui_Text_Data *sd, const char *file, const char *source, Eina_Bool above); static void _decoration_defer(Eo *obj); +static void _anchors_clear_all(Evas_Object *o EINA_UNUSED, Efl_Ui_Text_Data *sd); +static void _unused_item_objs_free(Efl_Ui_Text_Data *sd); static Mod_Api * _module_find(Evas_Object *obj EINA_UNUSED) @@ -3249,6 +3251,9 @@ _efl_ui_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Text_Data *sd) evas_object_del(sd->end_handler); } + _anchors_clear_all(obj, sd); + _unused_item_objs_free(sd); + text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); efl_event_callback_del(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, _efl_ui_text_changed_cb, obj); --
[EGIT] [core/efl] master 21/21: Efl text: shorten naming of methods
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=616a60f0417557a8ab7a79618e2eed0f3cfaf939 commit 616a60f0417557a8ab7a79618e2eed0f3cfaf939 Author: Daniel Hirt Date: Mon Jun 12 00:16:40 2017 +0300 Efl text: shorten naming of methods eo_prefix are set to "efl_text". Also, "Efl.Text.Format" is shortened to now include the "_format" prefix. "Efl.Text.Font" keeps the "_font" prefix, for better readability. --- src/bin/elementary/test_efl_ui_text.c | 8 ++--- src/bin/elementary/test_gfx_filters.c | 4 +-- src/lib/efl/interfaces/efl_text_font.eo| 1 + src/lib/efl/interfaces/efl_text_format.eo | 23 ++-- src/lib/efl/interfaces/efl_text_style.eo | 1 + .../elementary/efl_ui_internal_text_interactive.c | 6 ++-- src/lib/elementary/efl_ui_text.c | 8 ++--- src/lib/evas/canvas/efl_canvas_text.eo | 20 +-- src/lib/evas/canvas/evas_object_textblock.c| 42 +++--- 9 files changed, 58 insertions(+), 55 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 28bcb7f117..32a14955d4 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -123,7 +123,7 @@ my_efl_ui_text_bt_6(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E { Eo *text_obj = data; - Efl_Text_Format_Wrap wrap = efl_text_format_wrap_get(text_obj); + Efl_Text_Format_Wrap wrap = efl_text_wrap_get(text_obj); switch(wrap) { @@ -142,7 +142,7 @@ my_efl_ui_text_bt_6(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E default: break; } - efl_text_format_wrap_set(text_obj, wrap); + efl_text_wrap_set(text_obj, wrap); } static void @@ -167,7 +167,7 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve evas_object_show(bx); en = efl_add(EFL_UI_TEXT_CLASS, win, - efl_text_format_multiline_set(efl_added, EINA_TRUE)); + efl_text_multiline_set(efl_added, EINA_TRUE)); printf("Added Efl.Ui.Text object\n"); efl_key_data_set(en, "wrap_idx", 0); @@ -179,7 +179,7 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_text_font_weight_set(en, EFL_TEXT_FONT_WEIGHT_BOLD); efl_text_font_slant_set(en, EFL_TEXT_FONT_SLANT_ITALIC); efl_text_font_width_set(en, EFL_TEXT_FONT_WIDTH_ULTRACONDENSED); - efl_text_style_normal_color_set(en, 255, 255, 255, 255); + efl_text_normal_color_set(en, 255, 255, 255, 255); main_cur = efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN); cur = efl_text_cursor_new(en); diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c index 48e7255467..6aa0729d03 100644 --- a/src/bin/elementary/test_gfx_filters.c +++ b/src/bin/elementary/test_gfx_filters.c @@ -522,12 +522,12 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0), efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), efl_ui_text_scrollable_set(efl_added, 1), - efl_text_format_multiline_set(efl_added, 1)); + efl_text_multiline_set(efl_added, 1)); efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed, win); // Insert filter code inside style string: DEFAULT='blah blah ' efl_gfx_filter_program_set(o, code_filter, "code"); - efl_text_style_gfx_filter_set(o, "code"); + efl_text_gfx_filter_set(o, "code"); // FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME // Efl.Ui.Text doesn't seem to trigger the proper events during edit diff --git a/src/lib/efl/interfaces/efl_text_font.eo b/src/lib/efl/interfaces/efl_text_font.eo index 21bc5e64a1..e96e2596f2 100644 --- a/src/lib/efl/interfaces/efl_text_font.eo +++ b/src/lib/efl/interfaces/efl_text_font.eo @@ -42,6 +42,7 @@ interface Efl.Text.Font { @since 1.20 ]] + eo_prefix: efl_text; methods { @property font { [[The font name and size that is used for the displayed text]] diff --git a/src/lib/efl/interfaces/efl_text_format.eo b/src/lib/efl/interfaces/efl_text_format.eo index 77a69860cd..d904ec246a 100644 --- a/src/lib/efl/interfaces/efl_text_format.eo +++ b/src/lib/efl/interfaces/efl_text_format.eo @@ -15,8 +15,9 @@ interface Efl.Text.Format { @since 1.20 ]] + eo_prefix: efl_text; methods { - @property format_ellipsis { + @property ellipsis { [[Ellipsis value (number from -1.0 to 1.0)]] values { @@ -24,21 +25,21 @@ interface Efl.Text.Format {
[EGIT] [core/efl] master 15/21: Text: remove leftover printfs
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6c76d799da32f1456ced5bd0db516b5d569c3649 commit 6c76d799da32f1456ced5bd0db516b5d569c3649 Author: Daniel Hirt Date: Sun Jun 11 23:26:00 2017 +0300 Text: remove leftover printfs --- src/lib/elementary/efl_ui_text.c| 1 - src/lib/evas/canvas/evas_object_textblock.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 620f43272b..0d015c2aec 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -3013,7 +3013,6 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv) _efl_ui_text_changed_cb, obj); efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, _efl_ui_text_changed_cb, obj); - printf("ui: text_obj = %p\n", text_obj); efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, _efl_ui_text_selection_changed_cb, obj); efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 299c10339a..4a7d5d23dc 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -14378,7 +14378,6 @@ _efl_canvas_text_efl_text_text_set(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUS { evas_object_textblock_text_markup_set(eo_obj, ""); efl_text_cursor_text_insert(eo_obj, o->cursor, text); - printf("canvas_text: eo_obj=%p\n", eo_obj); efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); } --
[EGIT] [core/efl] master 09/21: Ui text: fix test style applying after cursor port
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b3ec2d20609cf5d796ffe8e59f2d89fe5422edab commit b3ec2d20609cf5d796ffe8e59f2d89fe5422edab Author: Daniel Hirt Date: Thu Jun 8 14:31:42 2017 +0300 Ui text: fix test style applying after cursor port --- src/bin/elementary/test_efl_ui_text.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 79527a34d7..ba8870e25d 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -11,13 +11,16 @@ _apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style) { Efl_Canvas_Text_Cursor *start, *end; - start = efl_text_cursor_get(obj); - end = efl_text_cursor_get(obj); + start = efl_text_cursor_new(obj); + end = efl_text_cursor_new(obj); efl_text_cursor_position_set(obj, start, start_pos); efl_text_cursor_position_set(obj, end, end_pos); efl_canvas_text_annotation_insert(obj, start, end, style); + + efl_text_cursor_free(obj, start); + efl_text_cursor_free(obj, end); } static Eo * --
[EGIT] [core/efl] master 12/21: Text: enhance cursor_get to ask for a "get type"
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=869da955ec66f0b7f40035b0d001bb64ff5547db commit 869da955ec66f0b7f40035b0d001bb64ff5547db Author: Daniel Hirt Date: Thu Jun 8 16:46:42 2017 +0300 Text: enhance cursor_get to ask for a "get type" --- src/bin/elementary/test_efl_ui_text.c | 4 ++-- src/lib/efl/interfaces/efl_text_cursor.eo | 3 +++ src/lib/efl/interfaces/efl_text_types.eot | 13 +++ .../elementary/efl_ui_internal_text_interactive.c | 18 +++ src/lib/elementary/efl_ui_text.c | 26 +++--- src/lib/evas/canvas/evas_object_textblock.c| 8 +-- 6 files changed, 46 insertions(+), 26 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 99c23a5c34..28bcb7f117 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -114,7 +114,7 @@ static void my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *en = data; - efl_text_cursor_object_item_insert(en, efl_text_cursor_get(en), + efl_text_cursor_object_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN), "size=32x32 href=emoticon"); } @@ -181,7 +181,7 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_text_font_width_set(en, EFL_TEXT_FONT_WIDTH_ULTRACONDENSED); efl_text_style_normal_color_set(en, 255, 255, 255, 255); - main_cur = efl_text_cursor_get(en); + main_cur = efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN); cur = efl_text_cursor_new(en); efl_text_cursor_position_set(en, cur, 2); diff --git a/src/lib/efl/interfaces/efl_text_cursor.eo b/src/lib/efl/interfaces/efl_text_cursor.eo index c2aeb3b022..4255cc1d93 100644 --- a/src/lib/efl/interfaces/efl_text_cursor.eo +++ b/src/lib/efl/interfaces/efl_text_cursor.eo @@ -17,6 +17,9 @@ interface Efl.Text.Cursor { legacy: null; return: ptr(Efl.Text.Cursor.Cursor_Data); [[Text cursor object]] } + keys { +get_type: Efl.Text.Cursor.Cursor_Get_Type; + } } @property cursor_position { set { legacy: null; } diff --git a/src/lib/efl/interfaces/efl_text_types.eot b/src/lib/efl/interfaces/efl_text_types.eot index 739e42c5ce..08bdb3a8f9 100644 --- a/src/lib/efl/interfaces/efl_text_types.eot +++ b/src/lib/efl/interfaces/efl_text_types.eot @@ -7,6 +7,19 @@ enum Efl.Text.Bidirectional_Type { inherit [[Inherit text type]] } +enum Efl.Text.Cursor.Cursor_Get_Type { + [[All available cursor states]] + legacy: efl_text_cursor_get; + default = 0, [[Main cursor state (alias to "main")]] + main,[[Main cursor state]] + selection_begin, [[Selection begin cursor state]] + selection_end, [[Selection end cursor state]] + preedit_start, [[Pre-edit start cursor state]] + preedit_end, [[Pre-edit end cursor starge]] + user,[[User cursor state]] + user_extra [[User extra cursor state]] +} + struct Efl.Canvas.Text.Annotation; [[EFL text annotations data structure]] struct Efl.Text.Cursor.Cursor_Data; [[Text cursor data structure]] diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index 8353a82039..b6f7ddaee6 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -75,7 +75,7 @@ static Eina_Bool _entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, char **text, int *cursor_pos) { Efl_Canvas_Text *obj = data; - Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj); + Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); const char *str; if (text) @@ -177,7 +177,7 @@ static void _entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info EINA_UNUSED) { Efl_Canvas_Text *obj = data; - Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj); + Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); int cursor_pos; int preedit_start_pos, preedit_end_pos; @@ -330,7 +330,7 @@ static void _entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info) { Efl_Canvas_Text *obj = data; - Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj); + Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN); Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); Ecore_IMF_Event_Delete_Surrounding *ev = event_info; Evas_Textblock_Cursor *del_start, *del_end; @
[EGIT] [core/efl] master 13/21: Canvas layout: port 'part_text' to Efl.Text.*
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=98dad1a52b0c75c18191b069c87ebb6f493e74ca commit 98dad1a52b0c75c18191b069c87ebb6f493e74ca Author: Daniel Hirt Date: Fri Jun 9 17:55:40 2017 +0300 Canvas layout: port 'part_text' to Efl.Text.* The following API is now supported with efl_part: - Efl.Text.text { set; get; } - Efl.Text.Cursor.cursor { get; } - Efl.Text.Cursor.cursor_paragraph_first; - Efl.Text.Cursor.cursor_paragraph_last; - Efl.Text.Cursor.cursor_position { set; get; } - Efl.Text.Cursor.cursor_coord_set; - Efl.Text.Cursor.cursor_line_char_first; - Efl.Text.Cursor.cursor_line_char_last; - Efl.Text.Cursor.cursor_char_next; - Efl.Text.Cursor.cursor_char_prev; - Efl.Text.Cursor.cursor_line_jump_by; - Efl.Text.Cursor.cursor_copy; - Efl.Text.Cursor.cursor_content { get; } - Efl.Text.Cursor.cursor_geometry { get; } - Efl.Text.Cursor.cursor_text_insert; Many of the 'part_text' functionality was moved to legacy, too. See the edje_object.eo to see which ones are still supported. --- src/lib/edje/Edje_Legacy.h | 560 src/lib/edje/edje_entry.c | 155 - src/lib/edje/edje_legacy.c | 818 src/lib/edje/edje_object.eo | 482 -- src/lib/edje/edje_part_text.c | 164 + src/lib/edje/edje_private.h | 16 + src/lib/edje/edje_util.c| 644 +-- src/lib/edje/efl_canvas_layout_internal_text.eo | 17 +- src/lib/elementary/elm_entry.c | 6 +- 9 files changed, 1698 insertions(+), 1164 deletions(-) diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index 5bdcef4db6..6022363e83 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -1376,6 +1376,566 @@ EAPI Eina_Bool edje_object_part_text_set(const Edje_Object *obj, const char *par EAPI const char * edje_object_part_text_get(const Edje_Object *obj, const char *part); /** + * @brief Moves the cursor to the beginning of the text part @ref + * evas_textblock_cursor_paragraph_first + * + * @param[in] part The part name + * @param[in] cur The edje cursor to work on + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_cursor_begin_set(Edje_Object *obj, const char *part, Edje_Cursor cur); + +/** + * @brief Moves the cursor to the end of the text part. @ref + * evas_textblock_cursor_paragraph_last + * + * @param[in] part The part name + * @param[in] cur The edje cursor to work on + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_cursor_end_set(Edje_Object *obj, const char *part, Edje_Cursor cur); + +/** + * @brief Sets the cursor position to the given value + * + * @param[in] part The part name + * @param[in] cur The cursor to move + * @param[in] pos The position of the cursor + * + * @since 1.1.0 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_cursor_pos_set(Edje_Object *obj, const char * part, Edje_Cursor cur, int pos); + +/** + * @brief Retrieves the current position of the cursor + * + * @param[in] part The part name + * @param[in] cur The cursor to move + * + * @return The position of the cursor + * + * @since 1.1.0 + * + * @ingroup Edje_Object + */ +EAPI int edje_object_part_text_cursor_pos_get(const Edje_Object *obj, const char * part, Edje_Cursor cur); + +/** + * @brief Position the given cursor to a X,Y position. + * + * This is frequently used with the user cursor. + * + * @param[in] part The part containing the object. + * @param[in] cur The cursor to adjust. + * @param[in] x X Coordinate. + * @param[in] y Y Coordinate. + * + * @return @c true on success, @c false otherwise + * + * @ingroup Edje_Object + */ +EAPI Eina_Bool edje_object_part_text_cursor_coord_set(Edje_Object *obj, const char *part, Edje_Cursor cur, int x, int y); + +/** + * @brief Moves the cursor to the beginning of the line. @ref + * evas_textblock_cursor_line_char_first + * + * @param[in] part The part name + * @param[in] cur The edje cursor to work on + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_cursor_line_begin_set(Edje_Object *obj, const char *part, Edje_Cursor cur); + +/** + * @brief Moves the cursor to the end of the line. @ref + * evas_textblock_cursor_line_char_last + * + * @param[in] part The part name + * @param[in] cur The edje cursor to work on + * + * @ingroup Edje_Object + */ +EAPI void edje_object_part_text_cursor_line_end_set(Edje_Object *obj, const char *part, Edje_Cursor cur); + +/** + * @brief Moves the cursor to the previous char @ref + * evas_textblock_cursor_char_prev + * + * @param[in] part The part name + * @param[in] cur The edje cursor to work on + * + * @return @c true on success, @c false otherwise + * + * @ingroup Ed
[EGIT] [core/efl] master 17/21: gfx_filter: add efl_style_gfx_filter
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3edf4985a485bece00da6b189294c761dd5d49ef commit 3edf4985a485bece00da6b189294c761dd5d49ef Author: Daniel Hirt Date: Tue May 30 13:48:05 2017 +0300 gfx_filter: add efl_style_gfx_filter Also, rename the format string to 'gfx_filterstr' to match the other strings. Update the filter test to use this property. --- src/bin/elementary/test_gfx_filters.c | 7 + src/lib/efl/interfaces/efl_text_style.eo| 12 src/lib/evas/canvas/efl_canvas_text.eo | 1 + src/lib/evas/canvas/evas_object_textblock.c | 47 ++--- 4 files changed, 57 insertions(+), 10 deletions(-) diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c index c7e19f9f8b..7a045692ce 100644 --- a/src/bin/elementary/test_gfx_filters.c +++ b/src/bin/elementary/test_gfx_filters.c @@ -517,7 +517,6 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve "blur { 6, ox = 1, oy = 1, src = a, color = '#004' }" "blur { 3, ox = 1, oy = 1, color = 'black' }" "blend { color = 'lime' }"; - Eina_Strbuf *buf; o = code = efl_add(EFL_UI_TEXT_EDITABLE_CLASS, win, efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0), @@ -526,12 +525,8 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed, win); // Insert filter code inside style string: DEFAULT='blah blah ' - buf = eina_strbuf_new(); - eina_strbuf_append(buf, efl_canvas_text_style_get(o, NULL)); - eina_strbuf_insert(buf, " gfx_filter=code", eina_strbuf_length_get(buf) - 1); efl_gfx_filter_program_set(o, code_filter, "code"); - efl_canvas_text_style_set(o, NULL, eina_strbuf_string_get(buf)); - eina_strbuf_free(buf); + efl_text_style_gfx_filter_set(o, "code"); // FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME // Efl.Ui.Text doesn't seem to trigger the proper events during edit diff --git a/src/lib/efl/interfaces/efl_text_style.eo b/src/lib/efl/interfaces/efl_text_style.eo index ef7514710d..75a7595256 100644 --- a/src/lib/efl/interfaces/efl_text_style.eo +++ b/src/lib/efl/interfaces/efl_text_style.eo @@ -253,5 +253,17 @@ interface Efl.Text.Style { a: ubyte; } } + + @property gfx_filter + { + [[Program that applies a special filter + + See @Efl.Gfx.Filter. + ]] + values + { +code: string; + } + } } } diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo index e8b883c4e7..652df65bef 100644 --- a/src/lib/evas/canvas/efl_canvas_text.eo +++ b/src/lib/evas/canvas/efl_canvas_text.eo @@ -290,6 +290,7 @@ Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor, Efl.Text.Annota Efl.Text.Style.shadow_color { get; set; } Efl.Text.Style.glow_color { get; set; } Efl.Text.Style.glow2_color { get; set; } + Efl.Text.Style.gfx_filter { get; set; } Efl.Text.Format.format_ellipsis { get; set; } Efl.Text.Format.format_wrap { get; set; } Efl.Text.Format.format_multiline { get; set; } diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 4b814ce78b..0e80eaa44c 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -608,6 +608,7 @@ struct _Evas_Object_Textblock Eina_Stringshare *font_source; Eina_Stringshare *font_fallbacks; Eina_Stringshare *font_lang; + Eina_Stringshare *gfx_filter_name; unsigned intfont_weight; unsigned intfont_slant; unsigned intfont_width; @@ -1345,7 +1346,7 @@ static const char *replacement_charstr = NULL; static const char *underline_dash_widthstr = NULL; static const char *underline_dash_gapstr = NULL; static const char *underline_heightstr = NULL; -static const char *gfx_filter = NULL; +static const char *gfx_filterstr = NULL; /** * @page evas_textblock_style_page Evas Textblock Style Options @@ -1451,7 +1452,7 @@ _format_command_init(void) underline_dash_widthstr = eina_stringshare_add("underline_dash_width"); underline_dash_gapstr = eina_stringshare_add("underline_dash_gap"); underline_heightstr = eina_stringshare_add("underline_height"); -gfx_filter = eina_stringshare_add("gfx_filter"); // FIXME: bg, fg filters +gfx_filt
[EGIT] [core/efl] master 20/21: Canvas text: disable legacy_newline by default
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4fda417bc9e0c59f3a3645057279a29cc0057cd2 commit 4fda417bc9e0c59f3a3645057279a29cc0057cd2 Author: Daniel Hirt Date: Wed May 31 10:04:18 2017 +0300 Canvas text: disable legacy_newline by default --- src/lib/evas/canvas/evas_object_textblock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 0e80eaa44c..ac79ae1ac7 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -6648,6 +6648,9 @@ _efl_canvas_text_efl_object_constructor(Eo *eo_obj, Efl_Canvas_Text_Data *class_ o->cursors = eina_list_remove_list(o->cursors, o->cursors); _format_command_init(); evas_object_textblock_init(eo_obj); + // Override legacy newline (enabled in legacy textblock through + // textblock_init. + o->legacy_newline = EINA_FALSE; _FMT(ref) = 1; _FMT(halign) = 0.0; --
[EGIT] [core/efl] master 03/21: Ui text: free iterator once done
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f23d08c56c50e5da93c2f0dca1ae762d66430d57 commit f23d08c56c50e5da93c2f0dca1ae762d66430d57 Author: Daniel Hirt Date: Thu Jun 8 08:09:41 2017 +0300 Ui text: free iterator once done --- src/lib/elementary/efl_ui_text.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 4ec8836fe1..e3419a820b 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -5240,6 +5240,7 @@ _anchors_update(Eo *o, Efl_Ui_Text_Data *sd) ll = ll->next; } + eina_iterator_free(range); } } --
[EGIT] [core/efl] master 04/21: Ui text: initialize potentially unset variables
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c45e9570791c46cc7a3ee28228e2259c406490e9 commit c45e9570791c46cc7a3ee28228e2259c406490e9 Author: Daniel Hirt Date: Thu Jun 8 08:10:19 2017 +0300 Ui text: initialize potentially unset variables --- src/lib/elementary/efl_ui_text.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index e3419a820b..49319f12e3 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -1049,6 +1049,10 @@ _cursor_geometry_recalc(Evas_Object *obj) Evas_Coord x2, y2, w2, h2; Evas_Coord cx, cy, cw, ch; + cx = cy = cw = ch = 0; + x2 = y2 = w2 = h2 = 0; + x = y = w = h = 0; + Efl_Canvas_Text_Cursor *main_cur = efl_canvas_text_cursor_get(obj); --
[EGIT] [core/efl] master 08/21: Ui text: fix test inserting object
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=573be7b71a551a30774e9923f64a68212d7dafaf commit 573be7b71a551a30774e9923f64a68212d7dafaf Author: Daniel Hirt Date: Thu Jun 8 14:19:58 2017 +0300 Ui text: fix test inserting object --- src/bin/elementary/test_efl_ui_text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index bfcb4cd108..79527a34d7 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -111,7 +111,7 @@ static void my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *en = data; - efl_canvas_text_cursor_object_item_insert(obj, efl_text_cursor_get(en), + efl_canvas_text_cursor_object_item_insert(en, efl_text_cursor_get(en), "size=32x32 href=emoticon"); } --
[EGIT] [core/efl] master 19/21: Gfx filters: set multiline to Ui.Text widget
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bf66daf6571bc14ad003848398ced8d22a095d43 commit bf66daf6571bc14ad003848398ced8d22a095d43 Author: Daniel Hirt Date: Wed May 31 10:36:54 2017 +0300 Gfx filters: set multiline to Ui.Text widget By default, multiline is disabled, so needs to enable this. --- src/bin/elementary/test_gfx_filters.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c index 7a045692ce..48e7255467 100644 --- a/src/bin/elementary/test_gfx_filters.c +++ b/src/bin/elementary/test_gfx_filters.c @@ -521,7 +521,8 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve o = code = efl_add(EFL_UI_TEXT_EDITABLE_CLASS, win, efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0), efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), - efl_ui_text_scrollable_set(efl_added, 1)); + efl_ui_text_scrollable_set(efl_added, 1), + efl_text_format_multiline_set(efl_added, 1)); efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed, win); // Insert filter code inside style string: DEFAULT='blah blah ' --
[EGIT] [core/efl] master 10/21: Text: add annotate interface
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4a1b42aee86b505b511ac7326176a4e7aa190c80 commit 4a1b42aee86b505b511ac7326176a4e7aa190c80 Author: Daniel Hirt Date: Thu Jun 8 16:08:28 2017 +0300 Text: add annotate interface --- src/Makefile_Efl.am | 1 + src/bin/elementary/test_efl_ui_text.c| 10 +- src/lib/efl/Efl.h| 1 + src/lib/efl/interfaces/efl_interfaces_main.c | 1 + src/lib/efl/interfaces/efl_text_annotate.eo | 146 +++ src/lib/elementary/efl_ui_text.c | 20 ++-- src/lib/evas/canvas/efl_canvas_text.eo | 143 ++ src/lib/evas/canvas/evas_object_textblock.c | 20 ++-- 8 files changed, 183 insertions(+), 159 deletions(-) diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 4c65a7920e..b584ca3892 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -20,6 +20,7 @@ efl_eolian_files = \ lib/efl/interfaces/efl_text_style.eo \ lib/efl/interfaces/efl_text_format.eo \ lib/efl/interfaces/efl_text_cursor.eo \ + lib/efl/interfaces/efl_text_annotate.eo \ lib/efl/interfaces/efl_text_properties.eo \ lib/efl/interfaces/efl_gfx_stack.eo \ lib/efl/interfaces/efl_gfx_view.eo \ diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index ba8870e25d..99c23a5c34 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -17,7 +17,7 @@ _apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style) efl_text_cursor_position_set(obj, start, start_pos); efl_text_cursor_position_set(obj, end, end_pos); - efl_canvas_text_annotation_insert(obj, start, end, style); + efl_text_annotation_insert(obj, start, end, style); efl_text_cursor_free(obj, start); efl_text_cursor_free(obj, end); @@ -114,7 +114,7 @@ static void my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *en = data; - efl_canvas_text_cursor_object_item_insert(en, efl_text_cursor_get(en), + efl_text_cursor_object_item_insert(en, efl_text_cursor_get(en), "size=32x32 href=emoticon"); } @@ -185,14 +185,14 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve cur = efl_text_cursor_new(en); efl_text_cursor_position_set(en, cur, 2); - efl_canvas_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon"); + efl_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon"); efl_text_cursor_position_set(en, cur, 50); - efl_canvas_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon"); + efl_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon"); efl_text_cursor_position_set(en, main_cur, 5); efl_text_cursor_position_set(en, cur, 20); - efl_canvas_text_annotation_insert(en, main_cur, cur, "a href=#hello"); + efl_text_annotation_insert(en, main_cur, cur, "a href=#hello"); efl_ui_text_interactive_editable_set(en, EINA_TRUE); efl_ui_text_scrollable_set(en, EINA_TRUE); diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index eb06539b41..8730bd643a 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -152,6 +152,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_text_style.eo.h" #include "interfaces/efl_text_format.eo.h" #include "interfaces/efl_text_cursor.eo.h" +#include "interfaces/efl_text_annotate.eo.h" #else diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index 0b977a589f..9ea0cd2dd5 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -18,6 +18,7 @@ #include "interfaces/efl_text_style.eo.c" #include "interfaces/efl_text_format.eo.c" #include "interfaces/efl_text_cursor.eo.c" +#include "interfaces/efl_text_annotate.eo.c" #include "interfaces/efl_gfx.eo.c" #include "interfaces/efl_gfx_buffer.eo.c" diff --git a/src/lib/efl/interfaces/efl_text_annotate.eo b/src/lib/efl/interfaces/efl_text_annotate.eo new file mode 100644 index 00..dec3dbae76 --- /dev/null +++ b/src/lib/efl/interfaces/efl_text_annotate.eo @@ -0,0 +1,146 @@ +import eina_types; +import efl_text_types; + +interface Efl.Text.Annotate { + [[Cursor API + + @since 1.20 + ]] + eo_prefix: efl_text; + methods { + // Annotation + @property annotation { + [[A new format for $annotation. + + This will replace the format applied by $annotation with $format. + Assumes that $annotation is a handle for an existing annotation, + i.e. one that was added using @.a
[EGIT] [core/efl] master 05/21: Ui text: fix leak of selection on destruction
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=97eda67737856c062018c8deb88961b602fa89ba commit 97eda67737856c062018c8deb88961b602fa89ba Author: Daniel Hirt Date: Thu Jun 8 08:50:14 2017 +0300 Ui text: fix leak of selection on destruction --- src/lib/elementary/efl_ui_text.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 49319f12e3..235f6f99e7 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -270,6 +270,7 @@ static inline Eo * _decoration_create(Efl_Ui_Text_Data *sd, const char *file, co static void _decoration_defer(Eo *obj); static void _anchors_clear_all(Evas_Object *o EINA_UNUSED, Efl_Ui_Text_Data *sd); static void _unused_item_objs_free(Efl_Ui_Text_Data *sd); +static void _clear_text_selection(Efl_Ui_Text_Data *sd); static Mod_Api * _module_find(Evas_Object *obj EINA_UNUSED) @@ -3257,6 +3258,7 @@ _efl_ui_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Text_Data *sd) _anchors_clear_all(obj, sd); _unused_item_objs_free(sd); + _clear_text_selection(sd); text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); efl_event_callback_del(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, @@ -4732,6 +4734,18 @@ _update_text_cursors(Eo *obj) } static void +_clear_text_selection(Efl_Ui_Text_Data *sd) +{ + Efl_Ui_Text_Rectangle *r; + + EINA_LIST_FREE(sd->sel, r) + { +free(r); + } + +} + +static void _update_text_selection(Eo *obj, Eo *text_obj) { Evas_Coord x, y; --
Re: [E-devel] [EGIT] [core/efl] master 01/04: Efl text: add Font, Format and Style interfaces
Hello, Gave it some thought. Sorry for the late reply. Please see below. On Tue, May 30, 2017 at 10:29 PM, Davide Andreoli wrote: > 2017-05-29 7:07 GMT+02:00 Daniel Hirt : > > Hello, > > > > On Mon, May 29, 2017 at 7:16 AM, Jean-Philippe André > > wrote: > > > >> On 29 May 2017 at 05:18, Davide Andreoli > wrote: > >> > >> > 2017-05-28 15:00 GMT+02:00 Daniel Hirt : > >> > > herdsman pushed a commit to branch master. > >> > > > >> > > http://git.enlightenment.org/core/efl.git/commit/?id= > >> > da2ef30f2b4d53aa3c1658b83c8c8381743469a0 > >> > > > >> > > commit da2ef30f2b4d53aa3c1658b83c8c8381743469a0 > >> > > Author: Daniel Hirt > >> > > Date: Mon May 22 17:36:41 2017 +0300 > >> > > > >> > > Efl text: add Font, Format and Style interfaces > >> > > > >> > > The following text interfaces are added: > >> > > - Efl.Text.Font: font settings that decide which font to > display > >> in > >> > > the text > >> > > - Efl.Text.Format: formatting that affects the looks and > layout > >> of > >> > > the text > >> > > - Efl.Text.Style: decorations and overlays that shouldn't > affect > >> > the > >> > > font choice or the layout > >> > > > >> > > @feature > >> > > >> > I think we have another namespacing issue here: > >> > Efl.Text.Style do not use any namespace, while Efl.Text.Font and > Format > >> do, > >> > > >> > We discussed this already in chat today and we did not find a > successfull > >> > deal, > >> > what I think at this point is that we really should find a rule to > >> > apply to every Iface, > >> > ...the problem is that we did not find any always-correct rule :( > >> > > >> > >> In short, as I didn't follow that conversation, what were the arguments > >> against namespacing "style"? > >> > >> > > As I understand, it's not only about preventing clashes. Widgets are > complex > > objects, and having your widget doing: > > widget.style_normal_color_set(...) > > isn't really better for the user. A better choice might be: > > widget.text_style_normal_color_set(...) > > In real a more better name is "widget.text_normal_color_set(...)" > the "style" prefix seems to me unneeded. > > This let me rise another question: do we really need this 3 interfaces > to be splitted as they are? Isn't better to just provide a single > "Efl.Text" iface ?? > Or I miss a use case where an object would need just 1 or 2 of them? > If they can be merged we will simplify the problem and shortening > function names. > > Agree regarding the "style_" prefix. I will omit that. The split is required so that if you want to add your own "Efl.Text" object, you could just implement the basic functionality (text_set, get). If you want a more enhanced object (like "Efl.Canvas.Text"), then you can go ahead and use your own interfaces, or utilize the existing interfaces. Note that interfaces are requires for documentation as well, and I wouldn't want that, for example, "Elm.Layout" parts suggest they implement anything other than "text_set/get". This is why the split is a requirement, as I see it. For bindings, there shouldn't be an issue: foo.text_normal_color_set(r, g, b, a); foo.text_set("hello"); (the interface's namespace isn't reflected in the usage for bindings) As for EO, I will reduce the notation using eolian's "eo_prefix", so we do: efl_text_normal_color_set(foo_obj, r, g, b, a); (note that, again, this resides in the "Efl.Text.Style" interface) This seems like a proper solution to make the text interface future-proof. [snip] -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/01: Elm layout: fix a few objects after move to efl_part
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ca8a8b712c8f6693700d516e5695561b11df7540 commit ca8a8b712c8f6693700d516e5695561b11df7540 Author: Daniel Hirt Date: Sun Jun 4 17:25:36 2017 +0300 Elm layout: fix a few objects after move to efl_part Fixes elm_layout_text_set/get bugs that were introduced in 3eb649b180eb98f7be829de5aed7e8c7f1ceb35a. --- src/lib/elementary/elm_entry.c | 6 +++--- src/lib/elementary/elm_layout.c | 8 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 16db1db585..e5f9eec798 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -3192,7 +3192,7 @@ _elm_entry_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, const char *e int len = 0; if (!entry) entry = ""; - if (part) + if (part && strcmp(part, "elm.text")) { if (!strcmp(part, "guide")) edje_object_part_text_set(sd->entry_edje, "elm.guide", entry); @@ -3244,7 +3244,7 @@ _elm_entry_text_get(Eo *obj, Elm_Entry_Data *sd, const char *item) if (item) { -if (!strcmp(item, "default")) goto proceed; +if (!strcmp(item, "default") || strcmp(item, "elm.text")) goto proceed; else if (!strcmp(item, "guide")) { return edje_object_part_text_get(sd->entry_edje, "elm.guide"); @@ -4147,7 +4147,7 @@ elm_entry_entry_get(const Evas_Object *obj) { ELM_ENTRY_CHECK(obj) NULL; const char *text = NULL; - text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text")); + text = efl_text_get(efl_part(obj, "elm.text")); return text; } diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c index 18e6f5a03a..79b88ac842 100644 --- a/src/lib/elementary/elm_layout.c +++ b/src/lib/elementary/elm_layout.c @@ -2318,6 +2318,10 @@ elm_layout_table_clear(Elm_Layout *obj, const char *part, Eina_Bool clear) EAPI Eina_Bool elm_layout_text_set(Elm_Layout *obj, const char *part, const char *text) { + if (!part || (*part == '\0')) + { +part = "elm.text"; + } efl_text_set(efl_part(obj, part), text); return EINA_TRUE; } @@ -2325,6 +2329,10 @@ elm_layout_text_set(Elm_Layout *obj, const char *part, const char *text) EAPI const char * elm_layout_text_get(const Elm_Layout *obj, const char *part) { + if (!part || (*part == '\0')) + { +part = "elm.text"; + } return efl_text_get(efl_part(obj, part)); } --
[EGIT] [core/efl] master 01/01: Elm layout: replace 'text' property with 'efl_part' interface
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3eb649b180eb98f7be829de5aed7e8c7f1ceb35a commit 3eb649b180eb98f7be829de5aed7e8c7f1ceb35a Author: Daniel Hirt Date: Sun Jun 4 17:25:36 2017 +0300 Elm layout: replace 'text' property with 'efl_part' interface The expected usage is efl_text_set(efl_part(layout, part), text); Same for text_get. Also, added an example how to make API easier with providing efl_text_set/get for the widget itself, in efl_ui_button. Please see this example. --- src/Makefile_Elementary.am | 5 + src/lib/elementary/efl_ui_button.c | 2 +- src/lib/elementary/efl_ui_text.c | 258 - src/lib/elementary/efl_ui_text.eo | 1 - src/lib/elementary/elc_fileselector.c | 17 +- src/lib/elementary/elc_fileselector_entry.c| 10 +- src/lib/elementary/elc_multibuttonentry.c | 21 +- src/lib/elementary/elc_naviframe.c | 6 +- src/lib/elementary/elc_popup.c | 6 +- src/lib/elementary/elm_actionslider.c | 21 +- src/lib/elementary/elm_actionslider.eo | 2 +- .../elementary/elm_actionslider_internal_part.eo | 8 + src/lib/elementary/elm_bubble.c| 15 +- src/lib/elementary/elm_bubble.eo | 2 +- src/lib/elementary/elm_bubble_internal_part.eo | 8 + src/lib/elementary/elm_entry.c | 10 +- src/lib/elementary/elm_entry.eo| 1 - src/lib/elementary/elm_entry_internal_part.eo | 3 +- src/lib/elementary/elm_fileselector.eo | 2 +- src/lib/elementary/elm_fileselector_entry.eo | 1 - .../elm_fileselector_entry_internal_part.eo| 3 +- .../elementary/elm_fileselector_internal_part.eo | 9 + src/lib/elementary/elm_label.c | 16 +- src/lib/elementary/elm_label.eo| 2 +- src/lib/elementary/elm_label_internal_part.eo | 8 + src/lib/elementary/elm_layout.c| 15 ++ src/lib/elementary/elm_layout.eo | 15 -- src/lib/elementary/elm_layout_internal_part.eo | 3 +- src/lib/elementary/elm_layout_legacy.h | 23 ++ src/lib/elementary/elm_multibuttonentry.eo | 2 +- .../elm_multibuttonentry_internal_part.eo | 9 + src/lib/elementary/elm_naviframe.eo| 1 - src/lib/elementary/elm_naviframe_internal_part.eo | 1 + src/lib/elementary/elm_part_helper.h | 42 +++- src/lib/elementary/elm_popup.eo| 1 - src/lib/elementary/elm_popup_internal_part.eo | 3 +- 36 files changed, 228 insertions(+), 324 deletions(-) diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 234a02cb08..d4a17ea8ad 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -110,6 +110,11 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_progressbar_internal_part.eo \ lib/elementary/elm_popup_internal_part.eo \ lib/elementary/elm_scroller_internal_part.eo \ + lib/elementary/elm_label_internal_part.eo \ + lib/elementary/elm_actionslider_internal_part.eo \ + lib/elementary/elm_bubble_internal_part.eo \ + lib/elementary/elm_fileselector_internal_part.eo \ + lib/elementary/elm_multibuttonentry_internal_part.eo \ lib/elementary/elm_code_widget.eo \ lib/elementary/efl_ui_text_interactive.eo \ lib/elementary/efl_ui_text.eo \ diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c index 5303386313..f8b68d51d6 100644 --- a/src/lib/elementary/efl_ui_button.c +++ b/src/lib/elementary/efl_ui_button.c @@ -445,7 +445,7 @@ _efl_ui_button_class_constructor(Efl_Class *klass) evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } -EFL_TEXT_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data) +EFL_TEXT_PART_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data) /* Efl.Part begin */ diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index fbb882fae0..7440427b1c 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -2565,99 +2565,6 @@ _markup_filter_cb(void *data, } } -/* This function is used to insert text by chunks in jobs */ -static Eina_Bool -_text_append_idler(void *data) -{ - int start; - char backup; - Evas_Object *obj = (Evas_Object *)data; - - EFL_UI_TEXT_DATA_GET(obj, sd); - - evas_event_freeze(evas_object_evas_get(obj)); - ELM_SAFE_FREE(sd->text, eina_stringshare_del); - sd->changed = EINA_TRUE; - - start = sd->append_text_position; - if ((start + EFL_UI_TEXT_CHUNK_SIZE) < sd->append_text_len) - { -int pos = start; -int tag_start, esc_start; -
Re: [E-devel] [EGIT] [core/efl] master 01/04: Efl text: add Font, Format and Style interfaces
Hello, On Mon, May 29, 2017 at 7:16 AM, Jean-Philippe André wrote: > On 29 May 2017 at 05:18, Davide Andreoli wrote: > > > 2017-05-28 15:00 GMT+02:00 Daniel Hirt : > > > herdsman pushed a commit to branch master. > > > > > > http://git.enlightenment.org/core/efl.git/commit/?id= > > da2ef30f2b4d53aa3c1658b83c8c8381743469a0 > > > > > > commit da2ef30f2b4d53aa3c1658b83c8c8381743469a0 > > > Author: Daniel Hirt > > > Date: Mon May 22 17:36:41 2017 +0300 > > > > > > Efl text: add Font, Format and Style interfaces > > > > > > The following text interfaces are added: > > > - Efl.Text.Font: font settings that decide which font to display > in > > > the text > > > - Efl.Text.Format: formatting that affects the looks and layout > of > > > the text > > > - Efl.Text.Style: decorations and overlays that shouldn't affect > > the > > > font choice or the layout > > > > > > @feature > > > > I think we have another namespacing issue here: > > Efl.Text.Style do not use any namespace, while Efl.Text.Font and Format > do, > > > > We discussed this already in chat today and we did not find a successfull > > deal, > > what I think at this point is that we really should find a rule to > > apply to every Iface, > > ...the problem is that we did not find any always-correct rule :( > > > > In short, as I didn't follow that conversation, what were the arguments > against namespacing "style"? > > As I understand, it's not only about preventing clashes. Widgets are complex objects, and having your widget doing: widget.style_normal_color_set(...) isn't really better for the user. A better choice might be: widget.text_style_normal_color_set(...) A pretty good example from Davide was a combobox with the text widget in it. There's no guarantee how your object is going to be used in the future and how fine the naming of your methods should be, due to unique styles of inheritance like "composition", which is gaining popularity it seems. For common inheritance this is less likely to be a problem. > I also wonder if having 9 color functions is really better than a single > color function and an enum: color1, color2, color3, shadow, underline, > etc...? > > I wanted to avoid the enum mess. There's not a single pro I could think of other than saving ME writing a few extra functions. > Also, what objects will implement the below interfaces? I expect > Efl.Canvas.Text for the default style, and some kind of text item object? > > Efl.Ui.Text is a composite object, with Efl.Canvas.Text. We still needed the text API to be exposed this in the documentation of Efl.Ui.Text, so users know that they can manipulate the text object in this widget. > ideas? > > > > > > PS: I stripped down the commit below to only show the new eo interfaces, > > so that > > the issue is more evident > > > > > > > > > +interface Efl.Text.Font { > > > + [[Font settings of the text > > > + > > > + @since 1.20 > > > + ]] > > > + methods { > > > + @property font { > > > + [[The font name and size that is used for the displayed > text]] > > > + values { > > > +font: string; > > > +size: int; > > > + } > > > + } > > > + @property font_source { > > > + [[The source that will be used to lookup the font of the text > > > + > > > + The source can be either a path to a font file e.g. > > > + "/path/to/font.ttf", or an eet file e.g. > "/path/to/font.eet". > > > + ]] > > > + values { > > > +font_source: string; > > > + } > > > + } > > > + > > > + @property font_fallbacks { > > > + [[Comma-separated list of font fallbacks > > > + > > > + Will be used in case the primary font isn't available. > > > + ]] > > > + values { > > > +font_fallbacks: string; > > > + } > > > + } > > > + > > > + @property font_weight { > > > + [[Type of weight of the displayed font > > > + > > > + Default is $Efl.Text.Font.Weight.normal\. > > > + ]] > > > + values { > > > +font_weight: Efl.Text.Font.Weight
[EGIT] [core/efl] master 02/04: Canvas text: implement Font, Format and Style interfaces
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9289e082d86d841f329f72b4074a674961ad7ca4 commit 9289e082d86d841f329f72b4074a674961ad7ca4 Author: Daniel Hirt Date: Mon May 22 18:02:43 2017 +0300 Canvas text: implement Font, Format and Style interfaces This replaces the 'style' API with actual properties. @feature --- src/lib/evas/canvas/efl_canvas_text.eo | 39 +- src/lib/evas/canvas/evas_object_textblock.c | 757 +++- 2 files changed, 772 insertions(+), 24 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo index 34d28a2c37..3822d52a1c 100644 --- a/src/lib/evas/canvas/efl_canvas_text.eo +++ b/src/lib/evas/canvas/efl_canvas_text.eo @@ -1,6 +1,7 @@ struct Efl.Canvas.Text.Style; [[EFL text style data structure]] -class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Canvas.Filter.Internal) +class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Canvas.Filter.Internal, +Efl.Text.Font, Efl.Text.Style, Efl.Text.Format) { [[Efl canvas text class]] legacy_prefix: evas_object_textblock; @@ -372,6 +373,42 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Canvas.Filter.Internal) Efl.Canvas.Filter.Internal.filter_dirty; Efl.Canvas.Filter.Internal.filter_input_render; Efl.Canvas.Filter.Internal.filter_state_prepare; + Efl.Text.Font.font { get; set; } + Efl.Text.Font.font_source { get; set; } + Efl.Text.Font.font_fallbacks { get; set; } + Efl.Text.Font.font_lang { get; set; } + Efl.Text.Font.font_weight { get; set; } + Efl.Text.Font.font_slant { get; set; } + Efl.Text.Font.font_width { get; set; } + Efl.Text.Style.normal_color { get; set; } + Efl.Text.Style.backing_type { get; set; } + Efl.Text.Style.backing_color { get; set; } + Efl.Text.Style.underline_type { get; set; } + Efl.Text.Style.underline_color { get; set; } + Efl.Text.Style.underline_height { get; set; } + Efl.Text.Style.underline_dashed_color { get; set; } + Efl.Text.Style.underline_dashed_width { get; set; } + Efl.Text.Style.underline_dashed_gap { get; set; } + Efl.Text.Style.underline2_type { get; set; } + Efl.Text.Style.underline2_color { get; set; } + Efl.Text.Style.strikethrough_type { get; set; } + Efl.Text.Style.strikethrough_color { get; set; } + Efl.Text.Style.effect_type { get; set; } + Efl.Text.Style.outline_color { get; set; } + Efl.Text.Style.shadow_direction { get; set; } + Efl.Text.Style.shadow_color { get; set; } + Efl.Text.Style.glow_color { get; set; } + Efl.Text.Style.glow2_color { get; set; } + Efl.Text.Format.format_ellipsis { get; set; } + Efl.Text.Format.format_wrap { get; set; } + Efl.Text.Format.format_multiline { get; set; } + Efl.Text.Format.format_halign { get; set; } + Efl.Text.Format.format_valign { get; set; } + Efl.Text.Format.format_linegap { get; set; } + Efl.Text.Format.format_linerelgap { get; set; } + Efl.Text.Format.format_tabstops { get; set; } + Efl.Text.Format.format_password { get; set; } + Efl.Text.Format.format_replacement_char { get; set; } } events { changed; [[Called when the content (text or annotations) changed.]] diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 183d0439de..43369148bd 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -569,6 +569,9 @@ struct _Efl_Canvas_Text_Annotation Eina_Bool is_item : 1; /**< indicates it is an item/object placeholder */ }; +#define _FMT(x) (o->default_format.format.x) +#define _FMT_INFO(x) (o->default_format.info.x) + /* Size of the index array */ #define TEXTBLOCK_PAR_INDEX_SIZE 10 struct _Evas_Object_Textblock @@ -595,6 +598,22 @@ struct _Evas_Object_Textblock struct { int l, r, t, b; } style_pad; + struct { + Evas_Object_Textblock_Format format; + struct { + Eina_Stringshare *font; + Evas_Font_Size size; + Eina_Stringshare *font_source; + Eina_Stringshare *font_fallbacks; + Eina_Stringshare *font_lang; + unsigned intfont_weight; + unsigned intfont_slant; + unsigned intfont_width; + Efl_Text_Style_Effect_Type effect; + Efl_Text_Style_Shadow_Direction shadow_direction; + Efl_Text_Format_Wrapwrap; + } info; + } default_format; double valign; Eina_Stringshare *markup_text; char *utf8; @@ -622
[EGIT] [core/efl] master 03/04: Ui text: use 'wrap' and 'multiline' properties
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e55b91aa910cd79ba08579b2e64ea2820d70c12b commit e55b91aa910cd79ba08579b2e64ea2820d70c12b Author: Daniel Hirt Date: Tue May 23 16:04:04 2017 +0300 Ui text: use 'wrap' and 'multiline' properties --- src/bin/elementary/test_efl_ui_text.c | 38 --- .../elementary/efl_ui_internal_text_interactive.c | 23 ++-- .../elementary/efl_ui_internal_text_interactive.eo | 1 - src/lib/elementary/efl_ui_text.c | 116 + src/lib/elementary/efl_ui_text_interactive.eo | 11 +- 5 files changed, 79 insertions(+), 110 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index a8e05b9680..15c4a2b077 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -115,22 +115,31 @@ my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E "size=32x32 href=emoticon"); } -const char *_wrap_modes[4] = { "none", "char", "word", "mixed" }; - static void my_efl_ui_text_bt_6(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - char style[128]; - Evas_Object *en = data; - size_t idx = (size_t) efl_key_data_get(en, "wrap_idx"); - idx = (idx + 1) % 4; - efl_key_data_set(en, "wrap_idx", (void *)idx); - - sprintf(style, "DEFAULT='font=Sans font_size=12 color=#fff wrap=%s'", - _wrap_modes[idx]); - efl_canvas_text_style_set(en, NULL, style); - printf("wrap mode changed to '%s'\n", _wrap_modes[idx]); - + Eo *text_obj = data; + + Efl_Text_Format_Wrap wrap = efl_text_format_wrap_get(text_obj); + + switch(wrap) + { + case EFL_TEXT_FORMAT_WRAP_NONE: + wrap = EFL_TEXT_FORMAT_WRAP_CHAR; + break; + case EFL_TEXT_FORMAT_WRAP_CHAR: + wrap = EFL_TEXT_FORMAT_WRAP_WORD; + break; + case EFL_TEXT_FORMAT_WRAP_WORD: + wrap = EFL_TEXT_FORMAT_WRAP_MIXED; + break; + case EFL_TEXT_FORMAT_WRAP_MIXED: + wrap = EFL_TEXT_FORMAT_WRAP_NONE; + break; + default: + break; + } + efl_text_format_wrap_set(text_obj, wrap); } static void @@ -154,7 +163,8 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve elm_win_resize_object_add(win, bx); evas_object_show(bx); - en = efl_add(EFL_UI_TEXT_CLASS, win); + en = efl_add(EFL_UI_TEXT_CLASS, win, + efl_text_format_multiline_set(efl_added, EINA_TRUE)); printf("Added Efl.Ui.Text object\n"); efl_key_data_set(en, "wrap_idx", 0); diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index b5ef29b734..028135353e 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -16,7 +16,6 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data Evas_Textblock_Cursor *preedit_start, *preedit_end; Eina_List *seq; char *selection; - Eina_Bool multiline : 1; Eina_Bool composing : 1; Eina_Bool selecting : 1; Eina_Bool have_selection : 1; @@ -730,7 +729,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void super = evas_key_modifier_is_set(ev->modifiers, "Super"); altgr = evas_key_modifier_is_set(ev->modifiers, "AltGr"); #endif - multiline = en->multiline; + multiline = efl_text_format_multiline_get(obj); /* Translate some keys to strings. */ if (!strcmp(ev->key, "Tab")) @@ -1253,6 +1252,9 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo Evas_Event_Mouse_Move *ev = event_info; Evas_Coord x, y, w, h; Evas_Textblock_Cursor *tc; + Eina_Bool multiline; + + multiline = efl_text_format_multiline_get(obj); #ifdef HAVE_ECORE_IMF if (en->imf_context) @@ -1274,7 +1276,7 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo cx = ev->cur.canvas.x - x; cy = ev->cur.canvas.y - y; -if (en->multiline) +if (multiline) { efl_canvas_text_cursor_coord_set(cur, cx, cy); } @@ -1301,7 +1303,6 @@ EOLIAN static Efl_Object * _efl_ui_internal_text_interactive_efl_object_constructor(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en) { en->select_allow = EINA_TRUE; - en->multiline = EINA_TRUE; en->editable = EINA_TRUE; return efl_constructor(efl_super(obj, MY_CLASS)); } @@ -1381,7 +1382,7 @@ _efl_ui_internal_text_interactive_efl_object_finalize(Eo *obj,
[EGIT] [core/efl] master 01/04: Efl text: add Font, Format and Style interfaces
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=da2ef30f2b4d53aa3c1658b83c8c8381743469a0 commit da2ef30f2b4d53aa3c1658b83c8c8381743469a0 Author: Daniel Hirt Date: Mon May 22 17:36:41 2017 +0300 Efl text: add Font, Format and Style interfaces The following text interfaces are added: - Efl.Text.Font: font settings that decide which font to display in the text - Efl.Text.Format: formatting that affects the looks and layout of the text - Efl.Text.Style: decorations and overlays that shouldn't affect the font choice or the layout @feature --- src/Makefile_Efl.am | 3 + src/lib/efl/Efl.h| 5 + src/lib/efl/interfaces/efl_interfaces_main.c | 3 + src/lib/efl/interfaces/efl_text_font.eo | 117 src/lib/efl/interfaces/efl_text_format.eo| 106 +++ src/lib/efl/interfaces/efl_text_style.eo | 257 +++ 6 files changed, 491 insertions(+) diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 5cde197bd2..60041edd6f 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -16,6 +16,9 @@ efl_eolian_files = \ lib/efl/interfaces/efl_part.eo \ lib/efl/interfaces/efl_player.eo \ lib/efl/interfaces/efl_text.eo \ + lib/efl/interfaces/efl_text_font.eo \ + lib/efl/interfaces/efl_text_style.eo \ + lib/efl/interfaces/efl_text_format.eo \ lib/efl/interfaces/efl_text_properties.eo \ lib/efl/interfaces/efl_gfx_stack.eo \ lib/efl/interfaces/efl_gfx_view.eo \ diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 4a3f858d11..c428a2dd2f 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -143,6 +143,11 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_io_buffer.eo.h" #include "interfaces/efl_io_queue.eo.h" +/* Text interfaces */ +#include "interfaces/efl_text_font.eo.h" +#include "interfaces/efl_text_style.eo.h" +#include "interfaces/efl_text_format.eo.h" + #else #ifndef EFL_NOLEGACY_API_SUPPORT diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index 1b052e4d94..209f9e4eec 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -14,6 +14,9 @@ #include "interfaces/efl_player.eo.c" #include "interfaces/efl_text.eo.c" #include "interfaces/efl_text_properties.eo.c" +#include "interfaces/efl_text_font.eo.c" +#include "interfaces/efl_text_style.eo.c" +#include "interfaces/efl_text_format.eo.c" #include "interfaces/efl_gfx.eo.c" #include "interfaces/efl_gfx_buffer.eo.c" diff --git a/src/lib/efl/interfaces/efl_text_font.eo b/src/lib/efl/interfaces/efl_text_font.eo new file mode 100644 index 00..3f4a1ac511 --- /dev/null +++ b/src/lib/efl/interfaces/efl_text_font.eo @@ -0,0 +1,117 @@ +// src/lib/efl/interfaces/efl_text_font.eo + +enum Efl.Text.Font.Weight { + [[Type of font weight]] + normal, + thin, + ultralight, + extralight, + light, + book, + medium, + semibold, + bold, + ultrabold, + extrabold, + black, + extrablack, +} + +enum Efl.Text.Font.Width { + [[Type of font width]] + normal, + ultracondensed, + extracondensed, + condensed, + semicondensed, + semiexpanded, + expanded, + extraexpanded, + ultraexpanded, +} + +enum Efl.Text.Font.Slant { +[[Type of font slant]] +normal, +oblique, +italic, +} + +interface Efl.Text.Font { + [[Font settings of the text + + @since 1.20 + ]] + methods { + @property font { + [[The font name and size that is used for the displayed text]] + values { +font: string; +size: int; + } + } + @property font_source { + [[The source that will be used to lookup the font of the text + + The source can be either a path to a font file e.g. + "/path/to/font.ttf", or an eet file e.g. "/path/to/font.eet". + ]] + values { +font_source: string; + } + } + + @property font_fallbacks { + [[Comma-separated list of font fallbacks + + Will be used in case the primary font isn't available. + ]] + values { +font_fallbacks: string; + } + } + + @property font_weight { + [[Type of weight of the displayed font + + Default is $Efl.Text.Font.Weight.normal\. + ]] + values { +font_weight: Efl.Text.Font.Weight; + } + } + + @property font_slant { + [[Type of slant of the displayed font + + Default is $Efl.Text.Font.Slant.normal\. + ]] + values { +
[EGIT] [core/efl] master 04/04: Ui text: use new text api instead of 'style'
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0d836045993c7ef347e9e9bdd400e4617031b4c9 commit 0d836045993c7ef347e9e9bdd400e4617031b4c9 Author: Daniel Hirt Date: Tue May 23 16:04:53 2017 +0300 Ui text: use new text api instead of 'style' --- src/bin/elementary/test_efl_ui_text.c | 5 + src/lib/elementary/efl_ui_text.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 15c4a2b077..49ad15d46d 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -172,6 +172,11 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve " new UI Text widget.\xE2\x80\xA9This is the next paragraph.\nThis" " is the next line.\nThis is Yet another line! Line and paragraph" " separators are actually different!"); + efl_text_font_set(en, "Sans", 14); + efl_text_font_weight_set(en, EFL_TEXT_FONT_WEIGHT_BOLD); + efl_text_font_slant_set(en, EFL_TEXT_FONT_SLANT_ITALIC); + efl_text_font_width_set(en, EFL_TEXT_FONT_WIDTH_ULTRACONDENSED); + efl_text_style_normal_color_set(en, 255, 255, 255, 255); main_cur = efl_canvas_text_cursor_get(en); cur = efl_ui_text_cursor_new(en); diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 4c2274ef20..fbb882fae0 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -3266,7 +3266,6 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv) (priv->entry_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (priv->entry_edje, EVAS_HINT_FILL, EVAS_HINT_FILL); - efl_canvas_text_style_set(text_obj, NULL, "DEFAULT='font=Sans font_size=14 color=#fff wrap=word'"); efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, _efl_ui_text_changed_cb, obj); efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, --
[EGIT] [core/efl] master 01/01: Evas textblock: fix width calculation of non-dirty paragraphs
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1624417d9137b87826962e431d08dc591f83d5e5 commit 1624417d9137b87826962e431d08dc591f83d5e5 Author: Daniel Hirt Date: Tue May 23 12:14:57 2017 +0300 Evas textblock: fix width calculation of non-dirty paragraphs This reverts commit 0a28cb97af928623127644e37a522af36035a845, as the addressed issue was still occurring. Non-dirty paragraphs were not considered when recalculating the formatted width of the text. This could easily be reproduced with two paragraphs, getting the width, and then updating only the second paragraph. Added a test case. @fix --- src/lib/evas/canvas/evas_object_textblock.c | 34 - src/tests/evas/evas_test_textblock.c| 14 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 6448387..183d043 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -398,6 +398,7 @@ struct _Evas_Object_Textblock_Paragraph Evas_BiDi_Paragraph_Props *bidi_props; /**< Only valid during layout. */ Evas_BiDi_Directiondirection; /**< Bidi direction enum value. The display direction like right to left.*/ Evas_Coord y, w, h; /**< Text block co-ordinates. y co-ord, width and height. */ + Evas_Coord last_fw; /**< Last calculated formatted width */ intline_no; /**< Line no of the text block. */ Eina_Bool is_bidi : 1; /**< EINA_TRUE if this is BiDi Paragraph, else EINA_FALSE. */ Eina_Bool visible : 1; /**< EINA_TRUE if paragraph visible, else EINA_FALSE. */ @@ -3844,6 +3845,7 @@ loop_advance: { Evas_Coord new_wmax = c->ln->w + c->marginl + c->marginr - (c->o->style_pad.l + c->o->style_pad.r); +c->par->last_fw = new_wmax; if (new_wmax > c->wmax) c->wmax = new_wmax; } @@ -5409,17 +5411,10 @@ _layout_par(Ctxt *c) /* After this par we are no longer at the beginning, as there * must be some text in the par. */ - if (!EINA_INLIST_GET(c->par)->next) - { - c->position = (c->position == TEXTBLOCK_POSITION_START) ? - TEXTBLOCK_POSITION_SINGLE : TEXTBLOCK_POSITION_END; - } - else - { - if (c->position == TEXTBLOCK_POSITION_START) - c->position = TEXTBLOCK_POSITION_ELSE; - } + if (c->position == TEXTBLOCK_POSITION_START) +c->position = TEXTBLOCK_POSITION_ELSE; + if (c->par->last_fw > c->wmax) c->wmax = c->par->last_fw; return 0; } @@ -5488,12 +5483,7 @@ _layout_par(Ctxt *c) Eina_Bool item_preadv = EINA_FALSE; Evas_Textblock_Obstacle *obs = NULL; - - /* Initialize wmax by 0. - It means the width calculation will be processed. - So, it does not need to use previous calculated width. */ - if (c->wmax == -1) c->wmax = 0; - + c->par->last_fw = 0; for (i = c->par->logical_items ; i ; ) { Evas_Coord prevdescent = 0, prevascent = 0; @@ -6252,7 +6242,7 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret) c->x = c->y = 0; c->w = w; c->h = h; - c->wmax = c->hmax = -1; + c->wmax = c->hmax = 0; c->ascent = c->descent = 0; c->maxascent = c->maxdescent = 0; c->marginl = c->marginr = 0; @@ -6434,14 +6424,8 @@ _relayout(const Evas_Object *eo_obj) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); - Evas_Coord fw, fh; - - _layout(eo_obj, obj->cur->geometry.w, obj->cur->geometry.h, &fw, &fh); - - /* If formatted width/height from _layout() is -1, - It means the size calculation was skipped. */ - if (fw >= 0) o->formatted.w = fw; - if (fh >= 0) o->formatted.h = fh; + _layout(eo_obj, obj->cur->geometry.w, obj->cur->geometry.h, + &o->formatted.w, &o->formatted.h); o->formatted.valid = 1; o->formatted.oneline_h = 0; o->last_w = obj->cur->geometry.w; diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index b92c61a..b3b78df 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -3853,6 +3853,20 @@ START_TEST(evas_textblo
Re: [E-devel] Getting default/theme/system font name
Hello, Off the top of my head: upon creating the elm_code widget, store the result of 'elm_code_widget_font_get' as your "default font". Then, reverting is just doing 'elm_code_widget_font_set' with the stored "default font". As a side note: I am not sure elm_code_widget utilizes the theme for fonts. -herdsman On Tue, May 2, 2017 at 7:43 PM, William L. Thomson Jr. wrote: > In working with Ecrire, there is a setting; standard in most editors, > to set a custom font. That works fine, for the most part. I am having > problems reverting back to the default font. Which is where I am stuck. > I have been looking all over and trying various things that do not work. > > It seems the font name is at least in the theme. Themes seem to set a > font. I am not sure if that font name can be fetched. Some font is being > used by default for text in any objects/widgets. > > I am looking for any way to get the font name used by default. That > way I can pass that back to elm code to reset the font back to > default/system/theme in ecrire. If/when a user decides they no longer > want the custom font. > > Essentially checking use default font, should revert back and stop > using their custom font. This works if you close ecrire. I just need > it working with it running. > > You can see the settings dialog here, check box for Use Default Font. > https://phab.enlightenment.org/T5411 > > I am open to any ideas, after chasing my tail and pulling hair! Thanks! > > -- > William L. Thomson Jr. > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] Phabricator is somewhat broken
Some pages work, but for me revision pages ( https://phab.enlightenment.org/D) show the following: >>> UNRECOVERABLE FATAL ERROR <<< Call to undefined method PhabricatorPolicyFilter::canInteract() /srv/web/phab.enlightenment.org/src/applications/transactions/editengine/PhabricatorEditEngine.php:1574 ┻━┻ ︵ ¯\_(ツ)_/¯ ︵ ┻━┻ Can someone look into this? -- herdsman. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[EGIT] [core/efl] master 01/01: Canvas text: fix clearing existing style
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=66dd98ed6b75fdfcbd24fa6e5fad78ab0a8d587b commit 66dd98ed6b75fdfcbd24fa6e5fad78ab0a8d587b Author: Daniel Hirt Date: Sun Feb 19 18:10:24 2017 +0200 Canvas text: fix clearing existing style Fixes T5187. This fixes a leak in evas_textblock_style_user_pop, that made use of the new key-based efl_canvas_text_style_set api. @fix --- src/lib/evas/canvas/evas_object_textblock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 449c701..306b66a 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -6928,6 +6928,7 @@ _efl_canvas_text_style_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, const char *key, else { o->styles = eina_list_remove(o->styles, ts); + ts->objects = eina_list_remove(ts->objects, eo_obj); evas_textblock_style_free(ts); } --
[EGIT] [core/efl] master 22/23: Ui text: fix size evaluation for default setup
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=099c1f2d839f2a343a665e6f1d281d2eac4ffec0 commit 099c1f2d839f2a343a665e6f1d281d2eac4ffec0 Author: Daniel Hirt Date: Thu Dec 15 10:57:59 2016 +0200 Ui text: fix size evaluation for default setup Now the size evaluation will query for the native size of the canvas.text object, and continue with calculations to set the min size of itself. This fixes a bug in containers where the widget's size wasn't picked up. Also, the canvas.text object wasn't reporting 'changed' on text changes. Signed-off-by: Jean-Philippe Andre --- src/lib/elementary/efl_ui_text.c| 9 + src/lib/evas/canvas/evas_object_textblock.c | 1 + 2 files changed, 10 insertions(+) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index d241436..0b7860c 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -1142,6 +1142,15 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd) else evas_object_size_hint_max_set(obj, -1, -1); } + else + { +Evas_Coord ominw, ominh; +Eo *sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); +efl_canvas_text_size_native_get(sw, &resw, &resh); +evas_object_size_hint_min_set(sw, resw, resh); +edje_object_size_min_calc(sd->entry_edje, &ominw, &ominh); +evas_object_size_hint_min_set(obj, ominw, ominh); + } _cursor_geometry_recalc(obj); evas_event_thaw(evas_object_evas_get(obj)); diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index de3b812..7bd7239 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -14403,6 +14403,7 @@ _efl_canvas_text_efl_text_text_set(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUS { evas_object_textblock_text_markup_set(eo_obj, ""); efl_canvas_text_cursor_text_insert(o->cursor, text); + efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); } static char * --
[EGIT] [core/efl] master 01/01: Ui text: fix deletion of the swallowed text object
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=50c9d1aeaa9172e4b6492eabd0da49aafd3523bb commit 50c9d1aeaa9172e4b6492eabd0da49aafd3523bb Author: Daniel Hirt Date: Thu Jan 12 18:01:52 2017 +0200 Ui text: fix deletion of the swallowed text object The Efl.Canvas.Text object loses its parent due to a specific behavior of Edje when swallowing objects. The mentioned object then loses sync with the Ui.Text object, thus not getting deleted upon destruction - that's actually because Edje reparents to the canvas upon its own deletion. Adding this fix until we figure out if there is a better alternative. --- src/lib/elementary/efl_ui_text.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 5a27de9..d241436 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -37,6 +37,7 @@ struct _Efl_Ui_Text_Data Evas_Object *mgf_bg; Evas_Object *mgf_clip; Evas_Object *mgf_proxy; + Eo *text_obj; Eo *cursor; Eo *cursor_bidi; Evas_Object *start_handler; @@ -1072,22 +1073,24 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd) evas_object_geometry_get(obj, NULL, NULL, &resw, &resh); - if (!sd->changed && (sd->last_w == resw)) { if (sd->scroll) { - Evas_Coord vw = 0, vh = 0, h = 0; + if (sd->text_obj) + { + Evas_Coord vw = 0, vh = 0, h = 0; - // Called for line wrapping + scrolling; use the viewport - // width and the formatted height as proper constraints. - elm_interface_scrollable_content_viewport_geometry_get -(obj, NULL, NULL, &vw, &vh); + // Called for line wrapping + scrolling; use the viewport + // width and the formatted height as proper constraints. + elm_interface_scrollable_content_viewport_geometry_get + (obj, NULL, NULL, &vw, &vh); - efl_canvas_text_size_formatted_get(obj, NULL, &h); - if (vh > h) h = vh; + efl_canvas_text_size_formatted_get(sd->text_obj, NULL, &h); + if (vh > h) h = vh; - evas_object_resize(sd->entry_edje, vw, h); + evas_object_resize(sd->entry_edje, vw, h); + } } return; } @@ -2880,6 +2883,7 @@ _efl_ui_text_elm_layout_text_get(Eo *obj, Efl_Ui_Text_Data *sd, const char *item { const char *text; Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); + sd->text_obj = text_obj; if (item) { @@ -3527,6 +3531,10 @@ _efl_ui_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Text_Data *sd) evas_object_event_callback_del_full(sd->entry_edje, EVAS_CALLBACK_MOVE, _efl_ui_text_move_cb, obj); + // XXX: explicitly delete the object, as it's been reparented to the canvas, due to + // a specific behavior of SWALLOW parts. + efl_del(sd->text_obj); + sd->text_obj = NULL; efl_canvas_group_del(efl_super(obj, MY_CLASS)); } --
Re: [E-devel] RFC: New modes for eina_freeq & short-lived strings
Hi, On Thu, Jan 12, 2017 at 10:27 AM, Jean-Philippe André wrote: > Hello, > > > As mentioned in an earlier email I would like to introduce an auto-deleted > temporary strings API. For now it is called eina_slstr for short-live > strings[1]. The strings will be collected by the main loop after each > iteration, or whenever the thread exits, or on a manual call to the clear > function (eg. from a looping thread). > > Firstly, I can not reuse eina_tmpstr for this as it is used from multiple > threads. I tried. It made make check (eio_monitor) fail. So this requires a > whole new set of APIs. > > > // The goal is to be able to do something like: > ERR("This object %s is going crazy", object_string_get(obj)); > > // With something like: > const char *object_string_get(Eo *obj) > { > return eina_slstr_printf("%s@%p (%s)", >efl_class_name_get(obj), obj, efl_name_get(obj)); > } > > And not care about freeing the string. In an EO file we would just return a > "string" and the caller would need to then strdup() it to keep it alive. > > A del() function is optional (there is none in my patch). > > > A working implementation is in my devs/jpeg/work branch. > > > For this, I could reuse the Eina_FreeQ introduced by raster but add a new > behaviour. For now it's purely used for debugging as a "safe" call to free > (although it is arguable whether it will not in fact make debugging harder > in some cases). > > I'd like to introduce a POSTPONED mode where the freeq is not equivalent to > free() but rather queues up an item that will be collected at the next call > to the clear() function. Ecore main loop would clear automatically for the > main thread. Other threads would clear on exit automatically. > > This kind of queue would need to be thread local. Failure to clear the > queue from a looping thread would lead to massive memory leaks. > > > (optional) Another idea would be to have a MAIN_LOOP mode where the item to > be deleted will be pushed to a thread-safe queue flushed from the main > loop. (note: this is just an idea, my patches don't include this). > > > Alternatively eina_slstr can be implemented without a freeq, and keep the > freeq exclusively for a "safe" replacement to free(). > > > Thoughts? > > I'd prefer to not piggyback on freeq. Won't a single loop iteration take A LOT longer to free the temporary string than what you would normally have if you'd just "strdup + use it + free" it? Just thinking of the amount of temporary memory piling up. Anyway the solution feels a bit artificial, unless I'm not getting the purpose of freeq. > > > [1] tmpstr would have been better... synonyms to short-lived include > temporary, ephemeral, transient, fleeting, volatile... > > -- > Jean-Philippe André > > -- > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > ___ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel