[EGIT] [core/efl] master 01/01: update documentation for content fit

2021-05-24 Thread ali-alzyod
ali-alzyod pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a083a3fa7d1e50e32d477dbee25850c39cf50e3b

commit a083a3fa7d1e50e32d477dbee25850c39cf50e3b
Author: ali-alzyod 
Date:   Tue May 25 03:13:30 2021 +0300

update documentation for content fit
---
 src/lib/evas/canvas/evas_textblock_legacy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_textblock_legacy.h 
b/src/lib/evas/canvas/evas_textblock_legacy.h
index b7905eec0d..ae1aaf72b6 100644
--- a/src/lib/evas/canvas/evas_textblock_legacy.h
+++ b/src/lib/evas/canvas/evas_textblock_legacy.h
@@ -1134,7 +1134,7 @@ EVAS_API int evas_textblock_fit_size_array_get(const 
Evas_Object *obj,  unsigned
 
 /** Set the object's fitting font size array that will be used internally
  *  Changing fitting step_size,min_font_size,max_font size will generate new 
array
- *  Internall array will be sorted
+ *  Setting array will make content fit algorithm ignore 
step_size,min_font_size,max_font size, and use passed array only
  *
  * @param obj The textblock object.
  * @param[in] p_size_array pointer to font sizes array.

-- 




[EGIT] [core/efl] master 02/08: TextBlock: Fix content Fit with Markup-font-size

2021-05-23 Thread ali-alzyod
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a129ea3bc0e9e2c39c3282ac5d2183827bdb6a07

commit a129ea3bc0e9e2c39c3282ac5d2183827bdb6a07
Author: ali-alzyod 
Date:   Sun May 23 19:54:20 2021 +0100

TextBlock: Fix content Fit with Markup-font-size

Summary:
This patch fixes wrong behavior for text block content fit when markup 
contains a part with specified font sizes (these parts will not be fitted by 
content fit algorithm).

+ THIS STILL NEED TEST TO BE ADDED

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12275
---
 src/lib/evas/canvas/evas_object_textblock.c | 95 ++---
 src/tests/evas/evas_test_textblock.c| 17 ++
 2 files changed, 90 insertions(+), 22 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index ff87db7be0..8f339fe5d2 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -17723,6 +17723,45 @@ Eina_Bool fit_is_fitting(const Evas_Object *eo_obj)
return o->fit_in_progress;
 }
 
+// Calculate text size for specific font size
+// by appending styles at end of textblock style
+void
+get_text_size_for_font( Evas_Object *eo_obj,
+size_t font_size,
+TEXT_FIT_CONTENT_CONFIG * fc,
+Evas_Coord *wf_new, //output
+Evas_Coord *hf_new  //output
+  )
+{
+   Eina_Bool bwrap = EINA_FALSE;
+   if (fc->options == TEXTBLOCK_FIT_MODE_WIDTH)
+ {
+bwrap = EINA_TRUE;
+ }
+   // We cache upto 255 font sizes, for fast text fit calculation
+   if (font_size <= 0xFF && (fc->size_cache[font_size].w != 0 && 
fc->size_cache[font_size].h != 0))
+  {
+*wf_new = fc->size_cache[font_size].w;
+*hf_new = fc->size_cache[font_size].h;
+  }
+   else
+  {
+ int pad_l, pad_r, pad_t, pad_b;
+
+ fit_style_update(eo_obj, font_size, EINA_TRUE, bwrap);
+ Eina_Size2D size = efl_canvas_textblock_size_formatted_get(eo_obj);
+ efl_canvas_textblock_style_insets_get(eo_obj, _l, _r, _t, 
_b);
+ *wf_new = size.w + pad_l + pad_r;
+ *hf_new = size.h + pad_t + pad_b;
+ if (font_size < 255)
+{
+   // cache these values
+   fc->size_cache[font_size].w = *wf_new;
+   fc->size_cache[font_size].h = *hf_new;
+}
+  }
+}
+
 int fit_text_block(Evas_Object *eo_obj)
 {
EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, EVAS_ERROR_INVALID_PARAM);
@@ -17783,38 +17822,47 @@ int fit_text_block(Evas_Object *eo_obj)
  int r = fc->size_list_length;
  int l = 0;
 
- Eina_Bool bwrap = EINA_FALSE;
- if (fc->options == TEXTBLOCK_FIT_MODE_WIDTH)
-   {
-  bwrap = EINA_TRUE;
-   }
+ // These values used to test if size is not changing
+ // due markup specified fonts
+ int prev_height = 0;
+ int prev_font_index = 0;
+ Eina_Bool finished = EINA_FALSE;
+
 
  while(r > l)
{
   int mid = (r + l) / 2;
-  /*cache font sizes vaules from 0-255 in size_cache array*/
+  /*get fontsize from p_size_array array*/
   size_t font_size = fc->p_size_array[mid];
-  if (font_size <= 0xFF && (fc->size_cache[font_size].w != 0 
&& fc->size_cache[font_size].h != 0))
-{
-wf_new = fc->size_cache[font_size].w;
-hf_new = fc->size_cache[font_size].h;
-}
-  else
+  get_text_size_for_font(eo_obj, font_size, fc, _new, 
_new);
+
+  //Special handle for height does not change(markup has fixed 
sizes)
+  if((hf_new == prev_height) & ((fc->options & 
TEXTBLOCK_FIT_MODE_HEIGHT) == TEXTBLOCK_FIT_MODE_HEIGHT))
 {
-   int pad_l, pad_r, pad_t, pad_b;
-
-   
fit_style_update(eo_obj,fc->p_size_array[mid],EINA_TRUE,bwrap);
-   Eina_Size2D size = 
efl_canvas_textblock_size_formatted_get(eo_obj);
-   efl_canvas_textblock_style_insets_get(eo_obj, _l, 
_r, _t, _b);
-   wf_new = size.w + pad_l + pad_r;
-   hf_new = size.h + pad_t + pad_b;
-   if (fc->p_size_array[mid]<255)
+   unsigned int start_index = prev_font_index;
+   size_t font_size = (start_index < fc->size_list_length 
- 1) ? fc->p_size_array[star

[EGIT] [apps/ecrire] master 01/01: Update HOWTO Build section

2021-04-09 Thread ali-alzyod
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/ecrire.git/commit/?id=ca78be3d59cab8e1116ac5538daa1e4b45f8a555

commit ca78be3d59cab8e1116ac5538daa1e4b45f8a555
Author: ali-alzyod 
Date:   Fri Apr 9 19:56:32 2021 +0100

Update HOWTO Build section

Reviewers: raster, netstar

Reviewed By: raster

Differential Revision: https://phab.enlightenment.org/D12256
---
 README | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/README b/README
index a4cced7..d02edd2 100644
--- a/README
+++ b/README
@@ -3,10 +3,10 @@ This is intended to be a text editor.
 It's currently mostly just a PoC, but I hope it'll grow to be more than that.
 
 HOWTO Build
-$ mkdir build
+$ meson build
 $ cd build
-$ cmake ..
-$ make && sudo make install
+$ ninja
+$ sudo ninja install
 
 If you're trying to build in a machine where you have efl 1.7.5 libraries 
installed, 
 you must run cmake like this:

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: update color text parsingUpdate text color parsing for rgba(r, g, b, a) for alpha to be value between 0.0 - 1.0 same as CSS.

2021-04-07 Thread ali-alzyod
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b2f61deb37accb065480b591622415b9b9ff286e

commit b2f61deb37accb065480b591622415b9b9ff286e
Author: ali-alzyod 
Date:   Thu Apr 8 02:02:08 2021 +0100

evas_textblock: update color text parsingUpdate text color parsing for 
rgba(r, g, b, a) for alpha to be value between 0.0 - 1.0 same as CSS.

Summary: ... spam removed ...

Reviewers: woohyun, bowonryu, id213sin, AbdullehGhujeh, devilhorns

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12248
---
 src/lib/evas/canvas/evas_object_textblock.c | 40 ++---
 src/lib/evas/common/evas_text_utils.c   | 15 ++-
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index f44dfaab5c..ff87db7be0 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -1785,8 +1785,8 @@ _format_command_legacy_only(Evas_Object_Textblock_Format 
*fmt, const char *cmd,
   * @li "#RRGGBBAA"
   * @li "#RGB"
   * @li "#RGBA"
-  * @li "rgb(r,g,b)"
-  * @li "rgba(r,g,b,a)"
+  * @li "rgb(0-255,0-255,0-255)"
+  * @li "rgba(0-255,0-255,0-255,0.0-1.0)"
   * @li "color_name"  like "red"
   * @code
   * backing_color=
@@ -1827,8 +1827,8 @@ _format_command_legacy_only(Evas_Object_Textblock_Format 
*fmt, const char *cmd,
   * @li "#RRGGBBAA"
   * @li "#RGB"
   * @li "#RGBA"
-  * @li "rgb(r,g,b)"
-  * @li "rgba(r,g,b,a)"
+  * @li "rgb(0-255,0-255,0-255)"
+  * @li "rgba(0-255,0-255,0-255,0.0-1.0)"
   * @li "color_name"  like "red"
   * @code
   * underline2_color=
@@ -1849,8 +1849,8 @@ _format_command_legacy_only(Evas_Object_Textblock_Format 
*fmt, const char *cmd,
   * @li "#RRGGBBAA"
   * @li "#RGB"
   * @li "#RGBA"
-  * @li "rgb(r,g,b)"
-  * @li "rgba(r,g,b,a)"
+  * @li "rgb(0-255,0-255,0-255)"
+  * @li "rgba(0-255,0-255,0-255,0.0-1.0)"
   * @li "color_name"  like "red"
   * @code
   * glow2_color=
@@ -2001,8 +2001,8 @@ _format_command_legacy_only(Evas_Object_Textblock_Format 
*fmt, const char *cmd,
   * @li "#RRGGBBAA"
   * @li "#RGB"
   * @li "#RGBA"
-  * @li "rgb(r,g,b)"
-  * @li "rgba(r,g,b,a)"
+  * @li "rgb(0-255,0-255,0-255)"
+  * @li "rgba(0-255,0-255,0-255,0.0-1.0)"
   * @li "color_name"  like "red"
   * @code
   * underline_dash_color=
@@ -2516,8 +2516,8 @@ _format_command(Evas_Object *eo_obj, 
Evas_Object_Textblock_Format *fmt, const ch
   * @li "#RRGGBBAA"
   * @li "#RGB"
   * @li "#RGBA"
-  * @li "rgb(r,g,b)"
-  * @li "rgba(r,g,b,a)"
+  * @li "rgb(0-255,0-255,0-255)"
+  * @li "rgba(0-255,0-255,0-255,0.0-1.0)"
   * @li "color_name"  like "red"
   * @code
   * color=
@@ -2537,8 +2537,8 @@ _format_command(Evas_Object *eo_obj, 
Evas_Object_Textblock_Format *fmt, const ch
   * @li "#RRGGBBAA"
   * @li "#RGB"
   * @li "#RGBA"
-  * @li "rgb(r,g,b)"
-  * @li "rgba(r,g,b,a)"
+  * @li "rgb(0-255,0-255,0-255)"
+  * @li "rgba(0-255,0-255,0-255,0.0-1.0)"
   * @li "color_name"  like "red"
   * @code
   * underline_color=
@@ -2559,8 +2559,8 @@ _format_command(Evas_Object *eo_obj, 
Evas_Object_Textblock_Format *fmt, const ch
   * @li "#RRGGBBAA"
   * @li "#RGB"
   * @li "#RGBA"
-  * @li "rgb(r,g,b)"
-  * @li "rgba(r,g,b,a)"
+  * @li "rgb(0-255,0-255,0-255)"
+  * @li "rgba(0-255,0-255,0-255,0.0-1.0)"
   * @li "color_name"  like "red"
   * @code
   * outline_color=
@@ -2581,8 +2581,8 @@ _format_command(Evas_Object *eo_obj, 
Evas_Object_Textblock_Format *fmt, const ch
   * @li "#RRGGBBAA"
   * @li "#RGB"
   * @li "#RGBA"
-  * @li "rgb(r,g,b)"
-  * @li "rgba(r,g,b,a)"
+  * @li "rgb(0-255,0-255,0-255)"
+  * @li "rgba(0-255,0-255,0-255,0.0-1.0)"
   * @li "color_name"  like "red"
   * @code
   * shadow_color=
@@ -2603,8 +2603,8 @@ _format_command(Evas_Object *eo_obj, 
Evas_Object_Textblock_Format 

[EGIT] [core/efl] master 01/01: efl_ui_textpath: mathmatical calculations

2021-01-29 Thread Ali Alzyod
ali-alzyod pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=39c305cf866ca65658f270a11d7fc76cabcc613f

commit 39c305cf866ca65658f270a11d7fc76cabcc613f
Author: Ali Alzyod 
Date:   Fri Jan 29 11:53:15 2021 +0200

efl_ui_textpath: mathmatical calculations

Summary: Reduce number of sqrt calls.

Reviewers: cedric, raster, bu5hm4n, vtorri, woohyun, Hermet

Subscribers: vtorri, bu5hm4n, raster, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8747

Differential Revision: https://phab.enlightenment.org/D11949
---
 src/lib/elementary/efl_ui_textpath.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textpath.c 
b/src/lib/elementary/efl_ui_textpath.c
index 321cd20568..6638de5456 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -264,7 +264,7 @@ static void
 _text_on_line_draw(Efl_Ui_Textpath_Data *pd, int w1, int w2, int cmp, Evas_Map 
*map, Efl_Ui_Textpath_Line line)
 {
double x1, x2, y1, y2;
-   double line_len, len, sina, cosa;
+   double line_len_2, line_len, len, sina, cosa;
Eina_Rect r;
 
x1 = line.start.x;
@@ -272,15 +272,17 @@ _text_on_line_draw(Efl_Ui_Textpath_Data *pd, int w1, int 
w2, int cmp, Evas_Map *
x2 = line.end.x;
y2 = line.end.y;
 
-   line_len = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
+   line_len_2 = (x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1);
len = w2 - w1;
-   if (line_len > len)
+   if (line_len_2 > (len * len))
  {
+line_len = sqrt(line_len_2);
 x2 = x1 + len * (x2 - x1) / line_len;
 y2 = y1 + len * (y2 - y1) / line_len;
+line_len_2 = (x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1);
  }
 
-   len = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
+   len = sqrt(line_len_2);
sina = (y2 - y1) / len;
cosa = (x2 - x1) / len;
 

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: allow default font size to be set without fontname

2021-01-28 Thread ali-alzyod
ali-alzyod pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e138962dd75ca15ce4599edbb5d7b2a0946b2c1c

commit e138962dd75ca15ce4599edbb5d7b2a0946b2c1c
Author: ali-alzyod 
Date:   Fri Jan 29 09:05:50 2021 +0200

evas_textblock: allow default font size to be set without fontname

Reviewers: woohyun, bowonryu, id213sin

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12211
---
 src/lib/evas/canvas/evas_object_textblock.c |  4 
 src/tests/evas/evas_test_textblock.c| 22 ++
 2 files changed, 26 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index b206d09bb1..f44dfaab5c 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -4372,6 +4372,10 @@ _layout_format_push(Ctxt *c, 
Evas_Object_Textblock_Format *fmt,
  (int)(((double) _FMT_INFO(size)) 
* evas_obj->cur->scale),
  fmt->font.bitmap_scalable);
   }
+else if (_FMT_INFO(size)) // if font size specified alone, without font
+  {
+ fmt->font.size = _FMT_INFO(size);
+  }
 if (_FMT_INFO(gfx_filter_name))
   {
  if (!fmt->gfx_filter)
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index f78c2888d1..40dbb70967 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -5203,6 +5203,27 @@ EFL_START_TEST(efl_text_font_source)
 }
 EFL_END_TEST
 
+EFL_START_TEST(efl_text_default_format)
+{
+   Evas *evas;
+   Eo *txt;
+   evas = EVAS_TEST_INIT_EVAS();
+   txt = efl_add(EFL_CANVAS_TEXTBLOCK_CLASS, evas);
+
+   Eina_Size2D size;
+
+   efl_text_markup_set(txt, "Hello");
+
+   efl_text_font_size_set(txt, 80);
+   efl_text_color_set(txt, 255, 255, 255, 255);
+   size = efl_canvas_textblock_size_native_get(txt);
+
+   ck_assert_int_gt(size.h, 20);
+   efl_del(txt);
+   evas_free(evas);
+}
+EFL_END_TEST
+
 void evas_test_textblock(TCase *tc)
 {
tcase_add_test(tc, evas_textblock_simple);
@@ -5246,5 +5267,6 @@ void evas_test_textblock(TCase *tc)
tcase_add_test(tc, efl_text_style);
tcase_add_test(tc, efl_text_markup);
tcase_add_test(tc, efl_text_font_source);
+   tcase_add_test(tc, efl_text_default_format);
 }
 

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: reduce content fit calculations

2020-11-19 Thread ali-alzyod
ali-alzyod pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f56004db6ead55df47ac7355651ed911c88114c0

commit f56004db6ead55df47ac7355651ed911c88114c0
Author: ali-alzyod 
Date:   Thu Nov 19 10:29:48 2020 +0200

evas_textblock: reduce content fit calculations

Reviewers: woohyun, id213sin

Reviewed By: woohyun, id213sin

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12187
---
 src/lib/evas/canvas/evas_object_textblock.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index c8fd924b78..fcf16b7f95 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -17728,6 +17728,10 @@ int fit_text_block(Evas_Object *eo_obj)
 
TEXT_FIT_CONTENT_CONFIG * fc = >fit_content_config;
 
+   // If there are no text or Paragraphs, then do nothing
+   if (efl_canvas_textblock_is_empty_get(eo_obj))
+ return EVAS_ERROR_SUCCESS;
+
if (fc->options == TEXTBLOCK_FIT_MODE_NONE && !fc->force_refit)
  return EVAS_ERROR_SUCCESS;
 

-- 




[EGIT] [core/efl] master 01/01: elm_entry: legacy smart selection[start, cleared] callback fix

2020-11-18 Thread Ali Alzyod
ali-alzyod pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ac2987b3638e01866b4ff67c3a3bf95d6e373619

commit ac2987b3638e01866b4ff67c3a3bf95d6e373619
Author: Ali Alzyod 
Date:   Wed Nov 18 15:54:56 2020 +0200

elm_entry: legacy smart selection[start,cleared] callback fix

Summary:
due to changes in latest text apis in unified, legacy selection call back 
[start,clear] does not work anymore,
Now add the support for legacy callback [selection,start   
selection,cleared]

Reviewers: woohyun, bowonryu, stefan_schmidt

Reviewed By: bowonryu

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12126
---
 src/lib/elementary/elm_entry.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index 307976976c..6a82bff2e1 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -2341,9 +2341,7 @@ _entry_selection_start_signal_cb(void *data,
 if (entry != data) elm_entry_select_none(entry);
  }
 
-   Eina_Bool b_value = EINA_TRUE;
-   efl_event_callback_legacy_call
- (data, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, _value);
+   evas_object_smart_callback_call(data, "selection,start", NULL);
 
elm_object_focus_set(data, EINA_TRUE);
 }
@@ -2411,9 +2409,7 @@ _entry_selection_cleared_signal_cb(void *data,
if (!sd->have_selection) return;
 
sd->have_selection = EINA_FALSE;
-   Eina_Bool b_value = sd->have_selection;
-   efl_event_callback_legacy_call
- (data, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, _value);
+   evas_object_smart_callback_call(data, "selection,cleared", NULL);
// XXX: still try primary selection even if on wl in case it's
// supported
 //   if (!_entry_win_is_wl(data))
@@ -4450,9 +4446,7 @@ _elm_entry_select_none(Eo *obj EINA_UNUSED, 
Elm_Entry_Data *sd)
  }
if (sd->have_selection)
  {
-Eina_Bool b_value = sd->have_selection;
-efl_event_callback_legacy_call
-   (obj, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, _value);
+   evas_object_smart_callback_call(obj, "selection,cleared", NULL);
  }
 
sd->have_selection = EINA_FALSE;

-- 




[EGIT] [admin/devs] master 01/01: test ssh keys

2020-11-17 Thread ali-alzyod
ali-alzyod pushed a commit to branch master.

http://git.enlightenment.org/admin/devs.git/commit/?id=439a0177b8f5855c15fa91de4108060467bd62fd

commit 439a0177b8f5855c15fa91de4108060467bd62fd
Author: ali-alzyod 
Date:   Wed Nov 18 09:56:49 2020 +0200

test ssh keys
---
 developers/ali-alzyod/info.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/developers/ali-alzyod/info.txt b/developers/ali-alzyod/info.txt
index b17d959..0637fee 100644
--- a/developers/ali-alzyod/info.txt
+++ b/developers/ali-alzyod/info.txt
@@ -6,4 +6,4 @@ E-Mail:   ali198...@gmail.com
 WWW:  None
 Contributing: evas, elementary
 Platform: Ubuntu (Linux), Mac OS X, Windows XP/7
-GeoData:  31.9685349 35.829812
+GeoData:  31.9685349 35.829811

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: prevent textnodes with / without format node

2020-09-16 Thread Ali Alzyod
stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3bd066c7dbffc2655501dea0b8d44d567ac1113b

commit 3bd066c7dbffc2655501dea0b8d44d567ac1113b
Author: Ali Alzyod 
Date:   Mon Sep 14 16:30:06 2020 +

evas_textblock: prevent textnodes with / without format node

this will prevent textnodes content with  or  without format node

Reviewed-by: Stefan Schmidt 
Differential Revision: https://phab.enlightenment.org/D12145
---
 src/lib/evas/canvas/evas_object_textblock.c |  3 +++
 src/tests/elementary/elm_test_entry.c   | 23 +++
 2 files changed, 26 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 5d1c476466..501e12ba78 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -11055,6 +11055,9 @@ 
_evas_textblock_node_text_adjust_offsets_to_start(Efl_Canvas_Textblock_Data *o,
size_t pos = 0;
int orig_end;
 
+   if ((start == 0) && (end == 0))
+ return EINA_FALSE;
+
itr = n->format_node;
if (!itr || (itr->text_node != n)) return EINA_FALSE;
 
diff --git a/src/tests/elementary/elm_test_entry.c 
b/src/tests/elementary/elm_test_entry.c
index 5df40b19ec..85ada68a49 100644
--- a/src/tests/elementary/elm_test_entry.c
+++ b/src/tests/elementary/elm_test_entry.c
@@ -653,6 +653,28 @@ EFL_START_TEST(elm_entry_keycode)
 }
 EFL_END_TEST
 
+EFL_START_TEST(elm_entry_textnodes_with_no_format)
+{
+   Evas_Object *win, *entry;
+
+   win = win_add(NULL, "entry", ELM_WIN_BASIC);
+   entry = elm_entry_add(win);
+   evas_object_show(entry);
+
+   elm_entry_entry_set(entry, "");
+   Evas_Object *tb = elm_entry_textblock_get(entry);
+   Evas_Textblock_Cursor *c1 = evas_object_textblock_cursor_new(tb);
+   Evas_Textblock_Cursor *c2 = evas_object_textblock_cursor_new(tb);
+   evas_textblock_cursor_char_next(c2);
+   evas_textblock_cursor_range_delete(c1, c2);
+   elm_entry_cursor_pos_set(entry, 0);
+   ck_assert(elm_entry_cursor_down(entry));
+
+   evas_object_del(entry);
+   evas_object_del(win);
+}
+EFL_END_TEST
+
 void elm_test_entry(TCase *tc)
 {
tcase_add_test(tc, elm_entry_legacy_type_check);
@@ -674,4 +696,5 @@ void elm_test_entry(TCase *tc)
tcase_add_test(tc, elm_entry_test_text_class);
tcase_add_test(tc, elm_entry_test_burmese);
tcase_add_test(tc, elm_entry_keycode);
+   tcase_add_test(tc, elm_entry_textnodes_with_no_format);
 }

-- 




[EGIT] [core/efl] master 01/01: evas_font_query: add Use parentheses within macros

2020-08-25 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=805545ab68e420168277251a76faf0e4399c2d10

commit 805545ab68e420168277251a76faf0e4399c2d10
Author: Ali Alzyod 
Date:   Tue Aug 25 10:15:08 2020 +

evas_font_query: add Use parentheses within macros

Differential Revision: https://phab.enlightenment.org/D12116
---
 src/lib/evas/common/evas_font.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/evas/common/evas_font.h b/src/lib/evas/common/evas_font.h
index fbed8e64bf..5a582c0632 100644
--- a/src/lib/evas/common/evas_font.h
+++ b/src/lib/evas/common/evas_font.h
@@ -63,10 +63,10 @@ typedef unsigned long longDATA64;
  * https://unicode.org/ivd/
  * https://www.freetype.org/freetype2/docs/reference/ft2-glyph_variants.html
 */
-#define VAR_SEQ(x) GENERIC_VARIATION_SEQUENCES(x) | 
IDEOGRAPHICS_VARIATION_SEQUENCES(x) | MANGOLIAN_VARIATION_SEQUENCES(x)
-#define GENERIC_VARIATION_SEQUENCES(x) (x>=0xFE00 && x<=0xFE0F) ? x : 0
-#define IDEOGRAPHICS_VARIATION_SEQUENCES(x) (x>=0xE0100 && x<=0xE01EF) ? x : 0
-#define MANGOLIAN_VARIATION_SEQUENCES(x) (x>=0x180B && x<=0x180D) ? x : 0
+#define VAR_SEQ(x) (GENERIC_VARIATION_SEQUENCES(x) | 
IDEOGRAPHICS_VARIATION_SEQUENCES(x) | MANGOLIAN_VARIATION_SEQUENCES(x))
+#define GENERIC_VARIATION_SEQUENCES(x) ((x>=0xFE00 && x<=0xFE0F) ? x : 0)
+#define IDEOGRAPHICS_VARIATION_SEQUENCES(x) ((x>=0xE0100 && x<=0xE01EF) ? x : 
0)
+#define MANGOLIAN_VARIATION_SEQUENCES(x) ((x>=0x180B && x<=0x180D) ? x : 0)
 /**
  * http://unicode.org/emoji/charts/emoji-variants.html
 */

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: myanmar script rendering with e vowel.

2020-08-18 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=eed4068fa2a24693514a7713b779b7a84e803b85

commit eed4068fa2a24693514a7713b779b7a84e803b85
Author: Ali Alzyod 
Date:   Tue Aug 18 19:15:12 2020 +0900

evas_textblock: myanmar script rendering with e vowel.

Summary: Resolve rendering e vowel (0x1031) with Myanmar(Burmese) with zero 
width non joiner (0x200C)

Test Plan: ninja test

Reviewers: woohyun, bowonryu

Reviewed By: bowonryu

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12102
---
 src/lib/evas/canvas/evas_object_textblock.c | 21 +
 src/tests/elementary/elm_test_entry.c   | 22 ++
 2 files changed, 43 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 7a4a37134c..d50592cc5d 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -5436,6 +5436,27 @@ skip:
 
 script = evas_common_language_script_type_get(str, script_len);
 
+/* FIXME Workaround for Burmese Vowel E Rendering, caused by bug in 
Harfbuzz
+   breaking text run will fix the visual issue.
+*/
+if (script == EVAS_SCRIPT_MYANMAR && script_len > 1)
+  {
+ int i;
+ for (i = 0 ; i < script_len - 1; i++)
+   {
+  if (str[i] == 0x200C)
+{
+   if (str[i+1] == 0x1031)
+ {
+cur_len += script_len;
+script_len = i + 1;
+cur_len -= script_len;
+break;
+ }
+}
+   }
+  }
+
 Evas_Object_Protected_Data *obj = efl_data_scope_get(c->obj, 
EFL_CANVAS_OBJECT_CLASS);
 while (script_len > 0)
   {
diff --git a/src/tests/elementary/elm_test_entry.c 
b/src/tests/elementary/elm_test_entry.c
index f3e5c1225c..5df40b19ec 100644
--- a/src/tests/elementary/elm_test_entry.c
+++ b/src/tests/elementary/elm_test_entry.c
@@ -610,6 +610,27 @@ EFL_START_TEST(elm_entry_test_text_class)
 }
 EFL_END_TEST
 
+EFL_START_TEST(elm_entry_test_burmese)
+{
+   Evas_Object *win, *textblock;
+   Evas_Textblock_Style *style;
+   int w;
+
+   win = win_add(NULL, "entry", ELM_WIN_BASIC);
+   textblock = evas_object_textblock_add(win);
+
+   style = evas_textblock_style_new();
+   evas_textblock_style_set(style, "DEFAULT='font=arial font_size=20 
color=red'");
+   evas_object_textblock_style_set(textblock, style);
+   evas_textblock_style_free(style);
+   style = NULL;
+
+   evas_object_textblock_text_markup_set(textblock, 
"\u1006\u200C\u1031\u200C\u1031\u200C\u1031");
+   evas_object_textblock_size_native_get(textblock, , NULL);
+   ck_assert_int_ne(w, 0);
+}
+EFL_END_TEST
+
 EFL_START_TEST(elm_entry_keycode)
 {
Evas_Object *win, *entry;
@@ -651,5 +672,6 @@ void elm_test_entry(TCase *tc)
tcase_add_test(tc, elm_entry_magnifier);
tcase_add_test(tc, elm_entry_file_get_set);
tcase_add_test(tc, elm_entry_test_text_class);
+   tcase_add_test(tc, elm_entry_test_burmese);
tcase_add_test(tc, elm_entry_keycode);
 }

-- 




[EGIT] [core/efl] master 01/01: evas_object_textblock: utf8_to_markup support all escapse chars

2020-08-18 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4ad272a8c3183790a65b7f2c0ccfb57b4688219a

commit 4ad272a8c3183790a65b7f2c0ccfb57b4688219a
Author: Ali Alzyod 
Date:   Tue Aug 18 17:34:02 2020 +0900

evas_object_textblock: utf8_to_markup support all escapse chars

Summary: update evas_textblock_text_utf8_to_markup to support all escape 
characters

Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include
#include
#include 

EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win,*textblock;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("Main", "App");
   elm_win_autodel_set(win, EINA_TRUE);

  textblock = evas_object_textblock_add(win);
  char * aaa = 
evas_textblock_text_utf8_to_markup(textblock,"A<<>>\"A\'\tA");
  // aaa ==  "AAA";
   
evas_object_size_hint_weight_set(textblock,EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(textblock,EVAS_HINT_FILL,EVAS_HINT_FILL);
   evas_object_show(textblock);

   evas_object_move(textblock,0,0);
   evas_object_resize(textblock,320,480);
   evas_object_resize(win,320,480);

   evas_object_show(win);
   elm_run();

   return 0;
}
ELM_MAIN()

```

Reviewers: lauromoura, CHAN, woohyun, bu5hm4n, bowonryu, tasn, herdsman

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8843
---
 src/lib/evas/canvas/evas_object_textblock.c | 33 -
 src/tests/evas/evas_test_textblock.c| 55 +++--
 2 files changed, 70 insertions(+), 18 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index e9b89dec98..f8ddf1cee6 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -8570,7 +8570,8 @@ _escaped_char_match(const char *s, int *adv)
int n_ret = _escaped_value_search(s, list, len);
if (n_ret != -1)
  {
-*adv = (int) list[n_ret]->value_len;
+if (adv)
+  *adv = (int) list[n_ret]->value_len;
 return list[n_ret]->escape;
  }
else
@@ -8579,7 +8580,8 @@ _escaped_char_match(const char *s, int *adv)
 n_ret = _escaped_value_search(s, list, len);
 if (n_ret != -1)
   {
- *adv = (int)list[n_ret]->value_len;
+ if (adv)
+   *adv = (int)list[n_ret]->value_len;
  return list[n_ret]->escape;
   }
  }
@@ -8996,6 +8998,7 @@ static void
 _markup_get_text_utf8_append(Eina_Strbuf *sbuf, const char *text)
 {
int ch, pos = 0, pos2 = 0;
+   const char * replacement;
 
for (;;)
  {
@@ -9007,23 +9010,21 @@ _markup_get_text_utf8_append(Eina_Strbuf *sbuf, const 
char *text)
eina_strbuf_append(sbuf, "");
 else if (ch == _TAB)
eina_strbuf_append(sbuf, "");
-else if (ch == '<')
-   eina_strbuf_append(sbuf, "");
-else if (ch == '>')
-   eina_strbuf_append(sbuf, "");
-else if (ch == '&')
-   eina_strbuf_append(sbuf, "");
-else if (ch == '"')
-   eina_strbuf_append(sbuf, "");
-else if (ch == '\'')
-   eina_strbuf_append(sbuf, "");
-else if (ch == _PARAGRAPH_SEPARATOR)
-   eina_strbuf_append(sbuf, "");
 else if (ch == _REPLACEMENT_CHAR)
eina_strbuf_append(sbuf, "");
-else if (ch != '\r')
+else if (ch == _PARAGRAPH_SEPARATOR)
+   eina_strbuf_append(sbuf, "");
+else
   {
- eina_strbuf_append_length(sbuf, text + pos, pos2 - pos);
+ replacement = _escaped_char_match(text + pos, NULL);
+ if (replacement)
+   {
+  eina_strbuf_append(sbuf, replacement);
+   }
+ else if (ch != '\r')
+   {
+  eina_strbuf_append_length(sbuf, text + pos, pos2 - pos);
+   }
   }
  }
 }
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index 6bdf25a19d..2b44e3fdff 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -70,6 +70,43 @@ do \
 } \
 while (0)
 
+
+typedef struct _Escape_Value Escape_Value;
+
+struct _Escape_Value
+{
+   char *escape;
+   char *value;
+};
+
+#define ESCAPE_VALUE(e,v) {e,v}
+
+static const Escape_Value escape_strings[] = {
+   ESCAPE_VALUE("", "\xc3\x81"),
+   ESCAPE_VALUE("&

[EGIT] [core/efl] master 01/01: efl_ui_textbox: preserve changing user color set

2020-08-04 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f126c7f06c63405424fb71c0cb37bd503427a9ba

commit f126c7f06c63405424fb71c0cb37bd503427a9ba
Author: Ali Alzyod 
Date:   Wed Aug 5 13:33:03 2020 +0900

efl_ui_textbox: preserve changing user color set

Summary:
setting color inside the constructor call will be override in theme apply 
because it happen later.
txt = efl_add(EFL_UI_TEXTBOX_CLASS, win,
   efl_text_color_set(efl_added, 0, 255, 0, 255));

Now we will preserve user choice, to not change it during theme apply.

Test Plan: ninja test

Reviewers: woohyun, bu5hm4n, zmike, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11942
---
 src/lib/elementary/efl_ui_textbox.c | 26 +++---
 src/lib/elementary/efl_ui_textbox.eo|  1 +
 src/tests/elementary/efl_ui_test_text.c | 24 
 3 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index bd97b47db7..22c731f94b 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -99,6 +99,7 @@ struct _Efl_Ui_Textbox_Data
Eina_Bool text_changed : 1;
Eina_Bool calc_force : 1;
Eina_Bool cursor_update : 1;
+   Eina_Bool color_is_set : 1;
 };
 
 struct _Anchor
@@ -1607,13 +1608,18 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
  }
 
// color
-   if (disabled)
- colorcode = efl_layout_group_data_get(wd->resize_obj, 
"style.color_disabled");
-   if (!colorcode)
- colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color");
-   if (colorcode && _format_color_parse(colorcode, strlen(colorcode), , , 
, ))
- {
-efl_text_color_set(sd->text_obj, r, g, b, a);
+   if (!sd->color_is_set)
+ {
+// If user set color by him self, we will not change it back even if
+// control become disabled.
+if (disabled)
+  colorcode = efl_layout_group_data_get(wd->resize_obj, 
"style.color_disabled");
+if (!colorcode)
+  colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color");
+if (colorcode && _format_color_parse(colorcode, strlen(colorcode), , 
, , ))
+  {
+ efl_text_color_set(sd->text_obj, r, g, b, a);
+  }
  }
 
// Guide Text
@@ -1811,6 +1817,12 @@ _efl_ui_textbox_efl_text_format_password_set(Eo *obj, 
Efl_Ui_Textbox_Data *sd, E
  }
 }
 
+EOLIAN static void
+_efl_ui_textbox_efl_text_style_text_color_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *pd, unsigned char r, unsigned char g, unsigned char b, 
unsigned char a)
+{
+   pd->color_is_set = EINA_TRUE;
+   efl_text_color_set(pd->text_obj, r, g, b, a);
+}
 static void
 _efl_ui_textbox_calc_force(Eo *obj, Efl_Ui_Textbox_Data *sd)
 {
diff --git a/src/lib/elementary/efl_ui_textbox.eo 
b/src/lib/elementary/efl_ui_textbox.eo
index 9cd5c520b5..1c63b602a1 100644
--- a/src/lib/elementary/efl_ui_textbox.eo
+++ b/src/lib/elementary/efl_ui_textbox.eo
@@ -112,6 +112,7 @@ class Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements 
Efl.Input.Clickable,
   Efl.Ui.Widget.disabled {set;}
   Efl.Text_Format.password {set;}
   Efl.Text_Format.multiline {set;}
+  Efl.Text_Style.text_color { set; }
   Efl.Access.Object.state_set { get; }
   Efl.Access.Object.i18n_name { get; }
   Efl.Access.Text.access_text { get; }
diff --git a/src/tests/elementary/efl_ui_test_text.c 
b/src/tests/elementary/efl_ui_test_text.c
index 3eb9909d53..ad876c6bcd 100644
--- a/src/tests/elementary/efl_ui_test_text.c
+++ b/src/tests/elementary/efl_ui_test_text.c
@@ -300,6 +300,29 @@ EFL_START_TEST(text_editable)
 }
 EFL_END_TEST
 
+EFL_START_TEST(text_on_startup)
+{
+   Eo *txt, *win;
+   win = win_add();
+   unsigned char r,g,b,a;
+   txt = efl_add(EFL_UI_TEXTBOX_CLASS, win,
+   efl_text_color_set(efl_added, 0, 255, 0, 255),
+   efl_text_font_size_set(efl_added, 50),
+   efl_text_font_family_set(efl_added, "Arial"));
+
+   ck_assert_int_eq(efl_text_font_size_get(txt), 50);
+   ck_assert_str_eq(efl_text_font_family_get(txt), "Arial");
+   efl_text_color_get(txt, , , , );
+   ck_assert_int_eq(r, 0);
+   ck_assert_int_eq(g, 255);
+   ck_assert_int_eq(b, 0);
+   ck_assert_int_eq(a, 255);
+
+   efl_del(txt);
+   efl_del(win);
+}
+EFL_END_TEST
+
 EFL_START_TEST(text_multiline_selection)
 {
Eo *txt, *win;
@@ -473,4 +496,5 @@ void efl_ui_test_text(TCase *tc)
tcase_add_test(tc, text_multiline_selection);
tcase_add_test(tc, text_singleline_cursor_movement);
tcase_add_test(tc, text_multiline_singleline_cursor_pos);
+   tcase_add_test(tc, text_on_startup);
 }

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: enhance cursor event submitting during markup_set/text_set

2020-08-04 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ed18471ba955be316abb2117ebdde3f3df418751

commit ed18471ba955be316abb2117ebdde3f3df418751
Author: Ali Alzyod 
Date:   Wed Aug 5 13:09:00 2020 +0900

evas_textblock: enhance cursor event submitting during markup_set/text_set

Summary:
Enhance text cursor events submitting:
1- Submit events only for changed cursors.
2- Reduce code complexity for cursor change.
3- Add test case for cursor event change

Reviewers: woohyun, zmike, bu5hm4n

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11775
---
 src/lib/evas/canvas/evas_object_textblock.c | 65 +
 src/tests/evas/evas_test_textblock.c| 21 ++
 2 files changed, 49 insertions(+), 37 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 6ed1593e15..e9b89dec98 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -578,8 +578,6 @@ static void evas_object_textblock_coords_recalc(Evas_Object 
*eo_obj,
 void *type_private_data);
 static void _canvas_text_format_changed(Eo *eo_obj, Efl_Canvas_Textblock_Data 
*o);
 
-static void _evas_textblock_cursor_paragraph_first(Efl_Text_Cursor_Handle *cur,
-   Eina_Bool emit_change);
 static const Evas_Object_Func object_func =
 {
/* methods (compulsory) */
@@ -8754,16 +8752,36 @@ _evas_object_textblock_text_markup_set(Eo *eo_obj, 
Efl_Canvas_Textblock_Data *o,
  }
_nodes_clear(eo_obj);
 
-   Efl_Text_Cursor_Handle *co = o->cursor;
-   co->node = _evas_textblock_node_text_new();
+   if (o->cursor->pos != 0)
+   {
+  o->cursor->changed = EINA_TRUE;
+  o->cursor->pos = 0;
+   }
+
o->text_nodes = _NODE_TEXT(eina_inlist_append(
 EINA_INLIST_GET(o->text_nodes),
-EINA_INLIST_GET(co->node)));
-
-   evas_textblock_cursor_paragraph_first(o->cursor);
+EINA_INLIST_GET(_evas_textblock_node_text_new(;
+   o->cursor->node = o->text_nodes;
 
evas_object_textblock_text_markup_prepend(o->cursor, text);
 
+   Eina_List *l;
+   Efl_Text_Cursor_Handle *cur;
+   EINA_LIST_FOREACH(o->cursors, l, cur)
+ {
+cur->node = o->text_nodes;
+if (cur->pos != 0)
+  {
+ cur->pos = 0;
+ cur->changed = EINA_TRUE;
+  }
+ }
+   _cursor_emit_if_changed(o->cursor);
+   EINA_LIST_FOREACH(o->cursors, l, cur)
+ {
+_cursor_emit_if_changed(cur);
+ }
+
/*If there was no text markup_prepend will not call change function
  So we will call it inside markup_set*/
if (!text || !*text)
@@ -8772,26 +8790,6 @@ _evas_object_textblock_text_markup_set(Eo *eo_obj, 
Efl_Canvas_Textblock_Data *o,
 _evas_textblock_changed(o, eo_obj);
  }
 
-   efl_event_freeze(eo_obj);
-   /* Point all the cursors to the starrt */
- {
-Eina_List *l;
-Efl_Text_Cursor_Handle *cur;
-
-/*update all cursors positions first, without emitting change*/
-EINA_LIST_FOREACH(o->cursors, l, cur)
-  {
- _evas_textblock_cursor_paragraph_first(cur, EINA_FALSE);
-  }
-/*emitting change event for all cursors, after all of them are ready*/
-EINA_LIST_FOREACH(o->cursors, l, cur)
-  {
- _evas_textblock_cursor_object_changed(cur);
-  }
-
- }
-   efl_event_thaw(eo_obj);
-
 o->markup_text = text;
 }
 
@@ -10039,8 +10037,8 @@ found:
_evas_textblock_changed(o, eo_obj);
 }
 
-static void
-_evas_textblock_cursor_paragraph_first(Efl_Text_Cursor_Handle *cur, Eina_Bool 
emit_change)
+EAPI void
+evas_textblock_cursor_paragraph_first(Efl_Text_Cursor_Handle *cur)
 {
if (!cur) return;
Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, 
EFL_CANVAS_OBJECT_CLASS);
@@ -10048,14 +10046,7 @@ 
_evas_textblock_cursor_paragraph_first(Efl_Text_Cursor_Handle *cur, Eina_Bool em
Efl_Canvas_Textblock_Data *o = efl_data_scope_get(cur->obj, MY_CLASS);
cur->node = o->text_nodes;
cur->pos = 0;
-   if (emit_change)
- _evas_textblock_cursor_object_changed(cur);
-}
-
-EAPI void
-evas_textblock_cursor_paragraph_first(Efl_Text_Cursor_Handle *cur)
-{
-   _evas_textblock_cursor_paragraph_first(cur, EINA_TRUE);
+   _evas_textblock_cursor_object_changed(cur);
 }
 
 EAPI void
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index 707c72f22c..6bdf25a19d 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4847,6 +4847,26 @@ EFL_START_TEST(ef

[EGIT] [core/efl] master 01/01: evas_textblock: enhance escape character handling

2020-08-04 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=86c274ea3395a02ee9ee2a252113982e4f60077e

commit 86c274ea3395a02ee9ee2a252113982e4f60077e
Author: Ali Alzyod 
Date:   Wed Aug 5 11:27:03 2020 +0900

evas_textblock: enhance escape character handling

Summary:
-Lazy initialization for html escapes lists
-Lower memory consumtion for escapes lists
-Simplify code maintenance by sorting lists on runtime, new items donot 
need to respect sort order(run time will handle it)

Reviewers: woohyun, bowonryu, cedric, tasn

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9370
---
 src/lib/evas/canvas/evas_object_textblock.c | 433 +++-
 1 file changed, 226 insertions(+), 207 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 4c6fc865d8..6ed1593e15 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -968,12 +968,6 @@ _line_free(Evas_Object_Textblock_Line *ln)
  */
 
 
-/**
- * @internal
- * @var escape_values_e_sorted[]
- * This array consists of Escape_Value structure sorted by escape string
- * And new added value must be placed sorted position, and reflected on 
escape_values_v_sorted
- */
 typedef struct _Escape_Value Escape_Value;
 
 struct _Escape_Value
@@ -986,7 +980,27 @@ struct _Escape_Value
 
 #define ESCAPE_VALUE(e,v) {e,v,strlen(e),strlen(v)}
 
-static const Escape_Value escape_values_e_sorted[] = {
+/**
+ * @internal
+ * @var html_common_escapes[]
+ * This array consists of most common html escapes values as _Escape_Value 
structure
+ */
+static const Escape_Value html_common_escapes[] = {
+   ESCAPE_VALUE("", "\x26"),
+   ESCAPE_VALUE("", "\x27"),
+   ESCAPE_VALUE("", "\x3e"),
+   ESCAPE_VALUE("", "\x3c"),
+   ESCAPE_VALUE("", "\x22"),
+};
+
+
+/**
+ * @internal
+ * @var escape_values_e_common_sorted[]
+ * This array consists of rest html escapes values as _Escape_Value structure
+ */
+
+static const Escape_Value html_escapes[] = {
ESCAPE_VALUE("", "\xc3\x81"),
ESCAPE_VALUE("", "\xc3\x82"),
ESCAPE_VALUE("", "\xc3\x86"),
@@ -1104,7 +1118,7 @@ static const Escape_Value escape_values_e_sorted[] = {
ESCAPE_VALUE("", "\xce\xa8"),
ESCAPE_VALUE("", "\xc2\xbb"),
ESCAPE_VALUE("", "\xe2\x86\x92"),
-   ESCAPE_VALUE("", "\xe2\x87\x92"),
+   ESCAPE_VALUE("", "\xe2\x87\x92"),
ESCAPE_VALUE("", "\xc2\xae"),
ESCAPE_VALUE("", "\xce\xa1"),
ESCAPE_VALUE("", "\xe2\x80\x8f"),
@@ -1136,188 +1150,182 @@ static const Escape_Value escape_values_e_sorted[] = {
ESCAPE_VALUE("", "\xe2\x80\x8c"),
 };
 
+static int
+_escape_key_sort(const void *a, const void *b)
+{
+   const char *k_a = (*(const Escape_Value **) a)->escape;
+   const char *k_b = (*(const Escape_Value **) b)->escape;
+   return strcmp(k_a, k_b);
+}
 
-/**
- * @internal
- * @var escape_values_e_common_sorted[]
- * same as escape_values_e_sorted with small subset of common escapes
- */
-static const Escape_Value escape_values_e_common_sorted[] = {
-   ESCAPE_VALUE("", "\x26"),
-   ESCAPE_VALUE("", "\x27"),
-   ESCAPE_VALUE("", "\x3e"),
-   ESCAPE_VALUE("", "\x3c"),
-   ESCAPE_VALUE("", "\x22"),
-};
+static int
+_escape_value_sort(const void *a, const void *b)
+{
+   const char *v_a = (*(const Escape_Value **) a)->value;
+   const char *v_b = (*(const Escape_Value **) b)->value;
+   return strcmp(v_a, v_b);
+}
 
-/**
- * @internal
- * @var escape_values_v_sorted[]
- * This array consists of Escape_Value structure sorted by escape value
- * And new added value must be placed sorted position, and reflected on 
escape_values_e_sorted
- */
-static const Escape_Value escape_values_v_sorted[] = {
-   ESCAPE_VALUE("", "\xc2\xa0"),
-   ESCAPE_VALUE("", "\xc2\xa1"),
-   ESCAPE_VALUE("", "\xc2\xa2"),
-   ESCAPE_VALUE("", "\xc2\xa3"),
-   ESCAPE_VALUE("", "\xc2\xa4"),
-   ESCAPE_VALUE("", "\xc2\xa5"),
-   ESCAPE_VALUE("", "\xc2\xa6"),
-   ESCAPE_VALUE("", "\xc2\xa7"),
-   ESCAPE_VALUE("", "\xc2\xa8"),
-   ESCAPE_VALUE("", "\xc2\xa9"),
-   ESCAPE_VALUE("", "\xc2\xaa"),
-   ESCAPE_VALUE("", "\xc2\xab"),
-   ESCAPE_VALUE(&

[EGIT] [core/efl] master 01/01: evas: remove unused define

2020-07-27 Thread Ali Alzyod
stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=239cc32dbf91ca55b8fa8118989dc425983cf7d0

commit 239cc32dbf91ca55b8fa8118989dc425983cf7d0
Author: Ali Alzyod 
Date:   Mon Jul 27 07:40:51 2020 +

evas: remove unused define

Reviewed-by: Stefan Schmidt 
Differential Revision: https://phab.enlightenment.org/D12066
---
 src/lib/evas/Evas_Common.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index e365eb9f0d..8468fee15c 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -3380,8 +3380,6 @@ EAPI voidevas_font_reinit(void);
  * @}
  */
 
-#define EVAS_FONT_DATA_CACHE_TEXTURE 0x01
-
 /**
  * Set the limit in bytes for memory allocated by font glyphs in evas.
  * @param[in] options for caching.

-- 




[EGIT] [core/efl] master 01/01: elementry_test: fix allocation size

2020-07-27 Thread Ali Alzyod
stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7a1d6375ead9d6da148581e1473fbb1bb2e372e3

commit 7a1d6375ead9d6da148581e1473fbb1bb2e372e3
Author: Ali Alzyod 
Date:   Sun Jul 26 08:51:09 2020 +

elementry_test: fix allocation size

This fix Coverty Issue CID: 1430579

Reviewed-by: Vincent Torri 
Reviewed-by: Stefan Schmidt 
Differential Revision: https://phab.enlightenment.org/D12065
---
 src/bin/elementary/test_label.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c
index d8d1a80698..de7c2bcf32 100644
--- a/src/bin/elementary/test_label.c
+++ b/src/bin/elementary/test_label.c
@@ -603,7 +603,7 @@ static void _btn_clicked_mem(void *data EINA_UNUSED, Eo 
*obj, void *eventInfo EI
 void
 test_text_memory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
 {
-  app_mem = calloc(sizeof(APP), 1);
+   app_mem = calloc(sizeof(APP_MEM), 1);
 
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
 

-- 




[EGIT] [core/efl] master 01/01: evas: font glyphs texture garbage collector

2020-07-24 Thread Ali Alzyod
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=54850ccd2f630b1397a4268088ba53b3305ffcb7

commit 54850ccd2f630b1397a4268088ba53b3305ffcb7
Author: Ali Alzyod 
Date:   Fri Jul 24 10:36:27 2020 +0100

evas: font glyphs texture garbage collector

Summary:
Introduce two public APIS
```
#define EVAS_FONT_DATA_CACHE_TEXTURE 0x01

/**
 * Set the limit in bytes for memory allocated by font glyphs in evas.
 * @param[in] bytes cache size in bytes, pass negative value to ignore the 
limit.
 * @param[in] options for caching, pass 0x1 to set the texture cache (in 
case of accelerated rendering).
 *
 * @since 1.24
 */
EAPI voidevas_font_data_cache_set(signed long long int 
byte, int options);

/**
 * @}
 */

/**
 * Get the limit in bytes for memory allocated by font glyphs in evas.
 * @param[in] options for caching, pass 0x1 to get the texture cache (in 
case of accelerated rendering).
 * @return Returns font allocated memory cache limit, if value is negative 
this means no limit.
 * @since 1.24
 */
EAPI signed long long intevas_font_data_cache_get(int options);
```

Test Plan:
elementary_test => Text Memory
You need a tool to observe Video memory allocation.
1- If you have detected Graphics card then use **radiontop** or  
**nvidia-smi** ).
2- If you have Integrated Graphics card, then you can detect memory 
allocation on RAM use.

--

this example allows only 50 MByte Video memory texture allocated by font 
glyphs
```
#include 

typedef struct _APP
{
  Evas_Object *tb1;
  Evas_Object *btnLoad;
} APP;

char *text = "1234567890藍☺珞樂蘿邏襤螺☹鸞嵐拉裸洛濫蠟☻☠烙‍⚕️‍⚕️‍‍‍‍‍⚖‍⚖‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍✈️‍✈️‍‍‍‍‍♂️‍♀️️‍♂️️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️虜老蘆擄‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️臘‍♂️臘‍♀️路‍♂️路‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍
 [...]
int font_size = 200;

int counter = 0;
void _button_clicked(void *data, Evas_Object *obj, void *event_info)
{
   APP *app = data;

  font_size -= 5;
  Evas_Textblock_Style *style = evas_textblock_style_new();
  char buffer[100] = {0};
  sprintf(buffer, "DEFAULT='font=NotoColorEmoji font_size=%i color=red 
ellipsis=-1.0 wrap=mixed'", font_size);
  evas_textblock_style_set(style, buffer);
  evas_object_textblock_style_set(app->tb1, style);
  evas_textblock_style_free(style);
  style = NULL;
}

EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
  APP *app = calloc(1, sizeof(APP));
  Evas_Object *win, *scroller1, *scroller2, *box;

  elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

  win = elm_win_util_standard_add("", "");
  elm_win_autodel_set(win, EINA_TRUE);

  box = elm_box_add(win);
  evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
  evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
  scroller1 = elm_scroller_add(win);
  evas_object_size_hint_weight_set(scroller1, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
  evas_object_size_hint_align_set(scroller1, EVAS_HINT_FILL, 
EVAS_HINT_FILL);

  evas_font_data_cache_set(50 * 1024* 1024, EVAS_FONT_DATA_CACHE_TEXTURE );

  app->tb1 = evas_object_textblock_add(win);
  Evas_Textblock_Style *style = evas_textblock_style_new();
  char buffer[100] = {0};
  sprintf(buffer, "DEFAULT='font=NotoColorEmoji font_size=%i color=red 
ellipsis=-1.0 wrap=mixed'", font_size);
  evas_textblock_style_set(style, buffer);
  evas_object_textblock_style_set(app->tb1, style);
  evas_textblock_style_free(style);
  style = NULL;

  evas_font_cache_set(evas_object_evas_get(app->tb1), 0);

  int w,h;
  evas_object_textblock_text_markup_set(app->tb1, "");
  evas_object_size_hint_min_set(app->tb1, 400, 400);
  elm_object_content_set(scroller1, app->tb1);
  elm_box_pack_end(box, scroller1);
  elm_object_content_set(win, box);

  app->btnLoad = elm_button_add(win);
  elm_object_text_set(app->btnLoad, "Scale Font");
  evas_object_smart_callback_add(app->btnLoad, "clicked", _button_clicked, 
app);
  evas_object_show(app->btnLoad);
  evas_object_move(app->btnLoad, 0, 20);
  evas_object_resize(app->btnLoad, 150, 20);

  evas_object_textblock_text_markup_set(app->tb1, text);
  evas_object_textblock_size_formatted_get(app->tb1, , );
  evas_object_size_hint_min_set(app->

[EGIT] [core/efl] master 01/01: edje_cc : resolve build warning

2020-07-16 Thread Ali Alzyod
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8504f213d68ffeba830ff8a1bec8ec93bfa85e3c

commit 8504f213d68ffeba830ff8a1bec8ec93bfa85e3c
Author: Ali Alzyod 
Date:   Thu Jul 16 09:58:45 2020 +0100

edje_cc : resolve build warning

Reviewers: raster

Reviewed By: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12054
---
 src/bin/edje/edje_cc_out.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index dc00b37b0a..d5060bbf5c 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -4014,7 +4014,7 @@ free_group:
if (edje_file->image_dir && !is_lua)
  {
 Edje_Image_Directory_Entry *de, *de_last, *img;
-Edje_Image_Directory_Set *set, *set_last, *set_realloc;
+Edje_Image_Directory_Set *set;
 Edje_Image_Directory_Set_Entry *set_e;
 Eina_List *images_unused_list = NULL;
 unsigned int i;

-- 




[EGIT] [core/efl] master 01/01: evas_text: lazy loading color glyph images in RAM

2020-07-06 Thread Ali Alzyod
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=972cd7f62bbfaa03d3b25ea1e8ba643de24cf7b9

commit 972cd7f62bbfaa03d3b25ea1e8ba643de24cf7b9
Author: Ali Alzyod 
Date:   Mon Jul 6 12:43:40 2020 +0100

evas_text: lazy loading color glyph images in RAM

Summary:
Lazy loading for glyph images into RAM, instead of caching at layout level 
we will cache only when rendering.

This may affect speed a bit since color glyphs will be loaded twice before 
caching (with FT_Load_Glyph)

Try to run test application, and hit `scale font`

** RAM consumption (Accelerated Rendering) **

| Before | After |
|---:|---|
|  111.9 | 21.8  |
|  204.8 | 24.4  |
|  298.0 | 26.3  |
|  391.5 | 28.4  |
|  484.8 | 29.9  |
|  578.1 | 31.4  |
|  671.4 | 32.5  |

** RAM consumption (SW Rendering) **

| Before | After |
|---:|---|
|  104   | 14.6  |
|  197   | 17|
|  290   | 19.1  |
|  384   | 21.2  |
|  477   | 22.8  |
|  571   | 24.3  |
|  664   | 25.6  |

Test Plan:
```
#include 

typedef struct _APP
{
  Evas_Object *tb1;
  Evas_Object *btnLoad;
} APP;

char *text = "1234567890藍☺珞樂蘿邏襤螺☹鸞嵐拉裸洛濫蠟☻☠烙‍⚕️‍⚕️‍‍‍‍‍⚖‍⚖‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍✈️‍✈️‍‍‍‍‍♂️‍♀️️‍♂️️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️虜老蘆擄‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️臘‍♂️臘‍♀️路‍♂️路‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍
 [...]
int font_size = 50;

int counter = 0;
void _button_clicked(void *data, Evas_Object *obj, void *event_info)
{
   APP *app = data;

  font_size += 10;
  Evas_Textblock_Style *style = evas_textblock_style_new();
  char buffer[100] = {0};
  sprintf(buffer, "DEFAULT='font=NotoColorEmoji font_size=%i color=red 
ellipsis=-1.0 wrap=mixed'", font_size);
  evas_textblock_style_set(style, buffer);
  evas_object_textblock_style_set(app->tb1, style);
  evas_textblock_style_free(style);
  style = NULL;
}

EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
  APP *app = calloc(1, sizeof(APP));
  Evas_Object *win, *scroller1, *scroller2, *box;

  elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

  win = elm_win_util_standard_add("", "");
  elm_win_autodel_set(win, EINA_TRUE);

  box = elm_box_add(win);
  evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
  evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
  scroller1 = elm_scroller_add(win);
  evas_object_size_hint_weight_set(scroller1, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
  evas_object_size_hint_align_set(scroller1, EVAS_HINT_FILL, 
EVAS_HINT_FILL);

  app->tb1 = evas_object_textblock_add(win);
  Evas_Textblock_Style *style = evas_textblock_style_new();
  char buffer[100] = {0};
  sprintf(buffer, "DEFAULT='font=NotoColorEmoji font_size=%i color=red 
ellipsis=-1.0 wrap=mixed'", font_size);
  evas_textblock_style_set(style, buffer);
  evas_object_textblock_style_set(app->tb1, style);
  evas_textblock_style_free(style);
  style = NULL;

  evas_font_cache_set(evas_object_evas_get(app->tb1), 0);

  int w,h;
  evas_object_textblock_text_markup_set(app->tb1, "");
  evas_object_size_hint_min_set(app->tb1, 400, 400);
  elm_object_content_set(scroller1, app->tb1);
  elm_box_pack_end(box, scroller1);
  elm_object_content_set(win, box);

  app->btnLoad = elm_button_add(win);
  elm_object_text_set(app->btnLoad, "Scale Font");
  evas_object_smart_callback_add(app->btnLoad, "clicked", _button_clicked, 
app);
  evas_object_show(app->btnLoad);
  evas_object_move(app->btnLoad, 0, 20);
  evas_object_resize(app->btnLoad, 150, 20);

  evas_object_textblock_text_markup_set(app->tb1, text);
  evas_object_textblock_size_formatted_get(app->tb1, , );
  evas_object_size_hint_min_set(app->tb1, 400, w/400 + h + 150);

  evas_object_resize(win, 400, 400);
  evas_object_show(box);
  evas_object_show(scroller1);
  evas_object_show(scroller2);
  evas_object_show(win);
  elm_run();

  return 0;
}
ELM_MAIN()

```

Reviewers: raster, woohyun, bowonryu, bu5hm4n, zmike, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8727

Differential Revision: https://phab.enlightenment.org/D11861
---
 src/lib/evas/common/evas_font.h   |   1 +
 src/lib/evas/common/evas_font_main.c  | 102 ++

[EGIT] [core/efl] master 01/01: eina_strbuf: introduce change last occurrence function

2020-06-22 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c501d09c3aa4c3e7f1ab5a27171b897c3cb4a11c

commit c501d09c3aa4c3e7f1ab5a27171b897c3cb4a11c
Author: Ali Alzyod 
Date:   Mon Jun 22 17:31:54 2020 +0900

eina_strbuf: introduce change last occurrence function

Reviewers: cedric, woohyun, bowonryu

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8757

Differential Revision: https://phab.enlightenment.org/D11990
---
 src/lib/eina/eina_strbuf.h| 13 +
 src/lib/eina/eina_strbuf_common.c | 55 +++
 src/tests/eina/eina_test_strbuf.c |  6 -
 3 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_strbuf.h b/src/lib/eina/eina_strbuf.h
index da94435c2d..15d6294349 100644
--- a/src/lib/eina/eina_strbuf.h
+++ b/src/lib/eina/eina_strbuf.h
@@ -608,6 +608,19 @@ EAPI Eina_Bool eina_strbuf_replace(Eina_Strbuf *buf, const 
char *str, const char
  */
 #define eina_strbuf_replace_first(buf, str, with) eina_strbuf_replace(buf, 
str, with, 1)
 
+/**
+ * @brief Replaces the last occurrence of a substring with another string.
+ *
+ * @param[in,out] buf The string buffer.
+ * @param[in] str The text to match.
+ * @param[in] with The replacement string.
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ *
+ * This function replaces the last occurrence of @p str in @p buf with
+ * @p with.
+ */
+EAPI Eina_Bool eina_strbuf_replace_last(Eina_Strbuf *buf, const char *str, 
const char *with) EINA_ARG_NONNULL(1, 2, 3);
+
 /**
  * @brief Replaces all matching substrings with another string.
  *
diff --git a/src/lib/eina/eina_strbuf_common.c 
b/src/lib/eina/eina_strbuf_common.c
index b4d3427a39..9a1d27d8ce 100644
--- a/src/lib/eina/eina_strbuf_common.c
+++ b/src/lib/eina/eina_strbuf_common.c
@@ -980,6 +980,61 @@ eina_strbuf_replace(Eina_Strbuf *buf,
return EINA_TRUE;
 }
 
+EAPI Eina_Bool
+eina_strbuf_replace_last(Eina_Strbuf *buf,
+const char *str,
+const char *with)
+{
+   size_t len1, len2;
+   char *spos, *spos_next;
+   size_t pos;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL( str, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(with, EINA_FALSE);
+   EINA_MAGIC_CHECK_STRBUF(buf, 0);
+
+   spos = NULL;
+   spos_next = strstr(buf->buf, str);
+   while (spos_next && *spos_next)
+ {
+spos = spos_next;
+spos_next = strstr(spos + 1, str);
+ }
+
+   if (!spos) return EINA_FALSE;
+
+   pos = spos - (const char *)buf->buf;
+   len1 = strlen(str);
+   len2 = strlen(with);
+
+   /* This is a read only buffer which need change to be made */
+   if (buf->ro)
+ {
+char *dest;
+
+dest = malloc(buf->size);
+if (!dest) return 0;
+memcpy(dest, buf->buf, buf->len);
+buf->buf = dest;
+ }
+
+   if (len1 != len2)
+ {
+/* resize the buffer if necessary */
+if (EINA_UNLIKELY(!_eina_strbuf_common_grow(_STRBUF_CSIZE, buf,
+buf->len - len1 + len2)))
+   return EINA_FALSE; /* move the existing text */
+memmove(((unsigned char *)(buf->buf)) + pos + len2,
+((unsigned char *)(buf->buf)) + pos + len1,
+buf->len - pos - len1);
+ }
+   /* and now insert the given string */
+   memcpy(((unsigned char *)(buf->buf)) + pos, with, len2);
+   buf->len += len2 - len1;
+   memset(((unsigned char *)(buf->buf)) + buf->len, 0, 1);
+   return EINA_TRUE;
+}
+
 EAPI int
 eina_strbuf_replace_all(Eina_Strbuf *buf, const char *str, const char *with)
 {
diff --git a/src/tests/eina/eina_test_strbuf.c 
b/src/tests/eina/eina_test_strbuf.c
index 1d9f52c0d2..ac2a31 100644
--- a/src/tests/eina/eina_test_strbuf.c
+++ b/src/tests/eina/eina_test_strbuf.c
@@ -303,8 +303,12 @@ EFL_START_TEST(eina_test_strbuf_replace)
fail_if(strlen(eina_strbuf_string_get(buf)) != eina_strbuf_length_get(buf));
fail_if(strcmp(eina_strbuf_string_get(buf), "bb"));
 
+   fail_if(eina_strbuf_replace_last(buf, "a", "x") == 0);
+   fail_if(strlen(eina_strbuf_string_get(buf)) != eina_strbuf_length_get(buf));
+   fail_if(strcmp(eina_strbuf_string_get(buf), "baaaxb"));
+
fail_if(eina_strbuf_replace_first(buf, "a", "b") == 0);
-   fail_if(strcmp(eina_strbuf_string_get(buf), "bbaaab"));
+   fail_if(strcmp(eina_strbuf_string_get(buf), "bbaaxb"));
 
eina_strbuf_free(buf);
 

-- 




[EGIT] [core/efl] master 01/01: elementary_test: remove leaked style

2020-06-22 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fd24fb568eb600357c4a84b6fc4aa2ba8e36c86d

commit fd24fb568eb600357c4a84b6fc4aa2ba8e36c86d
Author: Ali Alzyod 
Date:   Mon Jun 22 17:27:42 2020 +0900

elementary_test: remove leaked style

Summary: remove created style after being set in textblock

Reviewers: woohyun, smohanty

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8742

Differential Revision: https://phab.enlightenment.org/D11944
---
 src/bin/elementary/test_label.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c
index 5b3e5e8265..414058d9ad 100644
--- a/src/bin/elementary/test_label.c
+++ b/src/bin/elementary/test_label.c
@@ -492,6 +492,8 @@ test_textblock_fit(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *e
evas_textblock_style_set(style,styles[0]);
evas_object_textblock_style_set(app->txtblock,style);
evas_object_textblock_text_markup_set(app->txtblock,contents[0]);
+   evas_textblock_style_free(style);
+   style = NULL;
 
elm_box_horizontal_set(app->boxHor, EINA_TRUE);
elm_box_horizontal_set(app->boxHor2, EINA_TRUE);

-- 




[EGIT] [core/efl] master 01/01: eina_strbuf: if readonly strbuf is malloc, then it will stop being readonly

2020-06-22 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8f3be603c201c0785e234f9836cd98bad1b2279e

commit 8f3be603c201c0785e234f9836cd98bad1b2279e
Author: Ali Alzyod 
Date:   Mon Jun 22 17:16:34 2020 +0900

eina_strbuf: if readonly strbuf is malloc, then it will stop being readonly

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8757

Differential Revision: https://phab.enlightenment.org/D11992
---
 src/lib/eina/eina_strbuf_common.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/lib/eina/eina_strbuf_common.c 
b/src/lib/eina/eina_strbuf_common.c
index ebec119c2a..b4d3427a39 100644
--- a/src/lib/eina/eina_strbuf_common.c
+++ b/src/lib/eina/eina_strbuf_common.c
@@ -757,6 +757,7 @@ eina_strbuf_common_remove(size_t csize,
 if (!dest) return 0;
 memcpy(dest, buf->buf, buf->len);
 buf->buf = dest;
+buf->ro = EINA_FALSE;
  }
 
remove_len = end - start;
@@ -825,6 +826,7 @@ eina_strbuf_common_string_steal(size_t csize, Eina_Strbuf 
*buf)
 if (!dest) return 0;
 memcpy(dest, buf->buf, buf->len);
 buf->buf = dest;
+buf->ro = EINA_FALSE;
  }
 
ret = buf->buf;
@@ -958,6 +960,7 @@ eina_strbuf_replace(Eina_Strbuf *buf,
 if (!dest) return 0;
 memcpy(dest, buf->buf, buf->len);
 buf->buf = dest;
+buf->ro = EINA_FALSE;
  }
 
if (len1 != len2)
@@ -1003,6 +1006,7 @@ eina_strbuf_replace_all(Eina_Strbuf *buf, const char 
*str, const char *with)
 if (!dest) return 0;
 memcpy(dest, buf->buf, buf->len);
 buf->buf = dest;
+buf->ro = EINA_FALSE;
  }
 
len1 = strlen(str);

-- 




[EGIT] [core/efl] master 01/01: eina_strbuf_manage_new: update documentation

2020-06-22 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1a2811bae4087a1d6078c93c45043c597f256114

commit 1a2811bae4087a1d6078c93c45043c597f256114
Author: Ali Alzyod 
Date:   Mon Jun 22 17:16:02 2020 +0900

eina_strbuf_manage_new: update documentation

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8757

Differential Revision: https://phab.enlightenment.org/D11991
---
 src/lib/eina/eina_strbuf.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_strbuf.h b/src/lib/eina/eina_strbuf.h
index 73d166433d..da94435c2d 100644
--- a/src/lib/eina/eina_strbuf.h
+++ b/src/lib/eina/eina_strbuf.h
@@ -89,7 +89,8 @@ EAPI Eina_Strbuf *eina_strbuf_new(void) EINA_MALLOC 
EINA_WARN_UNUSED_RESULT;
  *
  * This function creates a new string buffer.  The passed string is used
  * directly as the buffer, it's effectively the inverse of
- * eina_strbuf_string_steal().  The passed string must be malloc'd.
+ * eina_strbuf_string_steal().
+ * The passed string must be malloc'd, and its ownership will transfer to 
Eina_Strbuf(do not free it with free()).
  * To free the resources, use eina_strbuf_free().
  *
  * @see eina_strbuf_free()

-- 




[EGIT] [core/efl] master 01/01: eina_strbuf: resolve segfault when replace used with read_only buffer

2020-06-22 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1bbd03b7683dc6f163fff94130d017367178d0f1

commit 1bbd03b7683dc6f163fff94130d017367178d0f1
Author: Ali Alzyod 
Date:   Mon Jun 22 16:54:51 2020 +0900

eina_strbuf: resolve segfault when replace used with read_only buffer

Summary: when eina_strbuf_replace is used by read_only buffer, this will 
cause segfault (access invalid memory)

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8757

Differential Revision: https://phab.enlightenment.org/D11989
---
 src/lib/eina/eina_strbuf_common.c |  7 ---
 src/tests/eina/eina_test_strbuf.c | 10 ++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/lib/eina/eina_strbuf_common.c 
b/src/lib/eina/eina_strbuf_common.c
index e08d4b79fe..ebec119c2a 100644
--- a/src/lib/eina/eina_strbuf_common.c
+++ b/src/lib/eina/eina_strbuf_common.c
@@ -945,6 +945,10 @@ eina_strbuf_replace(Eina_Strbuf *buf,
 if (n) spos++;
  }
 
+   pos = spos - (const char *)buf->buf;
+   len1 = strlen(str);
+   len2 = strlen(with);
+
/* This is a read only buffer which need change to be made */
if (buf->ro)
  {
@@ -956,9 +960,6 @@ eina_strbuf_replace(Eina_Strbuf *buf,
 buf->buf = dest;
  }
 
-   pos = spos - (const char *)buf->buf;
-   len1 = strlen(str);
-   len2 = strlen(with);
if (len1 != len2)
  {
 /* resize the buffer if necessary */
diff --git a/src/tests/eina/eina_test_strbuf.c 
b/src/tests/eina/eina_test_strbuf.c
index add3ce0963..1d9f52c0d2 100644
--- a/src/tests/eina/eina_test_strbuf.c
+++ b/src/tests/eina/eina_test_strbuf.c
@@ -303,6 +303,16 @@ EFL_START_TEST(eina_test_strbuf_replace)
fail_if(strlen(eina_strbuf_string_get(buf)) != eina_strbuf_length_get(buf));
fail_if(strcmp(eina_strbuf_string_get(buf), "bb"));
 
+   fail_if(eina_strbuf_replace_first(buf, "a", "b") == 0);
+   fail_if(strcmp(eina_strbuf_string_get(buf), "bbaaab"));
+
+   eina_strbuf_free(buf);
+
+   buf = eina_strbuf_manage_read_only_new_length("bb",6);
+   fail_if(!buf);
+   fail_if(eina_strbuf_replace_first(buf, "a", "b") == 0);
+   fail_if(strcmp(eina_strbuf_string_get(buf), "bbaaab"));
+
eina_strbuf_free(buf);
 }
 EFL_END_TEST

-- 




[EGIT] [core/efl] efl-1.24 06/31: evas_textblock: fix doc typo

2020-06-15 Thread Ali Alzyod
stefan pushed a commit to branch efl-1.24.

http://git.enlightenment.org/core/efl.git/commit/?id=00cfe685dc4c830b83f5ec33106c9ee784fab20a

commit 00cfe685dc4c830b83f5ec33106c9ee784fab20a
Author: Ali Alzyod 
Date:   Mon May 18 07:47:58 2020 +

evas_textblock: fix doc typo

Reviewed-by: Xavi Artigas 
Reviewed-by: Stefan Schmidt 
Differential Revision: https://phab.enlightenment.org/D11845
---
 src/lib/evas/canvas/evas_textblock_legacy.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/evas_textblock_legacy.h 
b/src/lib/evas/canvas/evas_textblock_legacy.h
index eb638e32a4..13752081f4 100644
--- a/src/lib/evas/canvas/evas_textblock_legacy.h
+++ b/src/lib/evas/canvas/evas_textblock_legacy.h
@@ -1068,7 +1068,7 @@ EAPI Evas_Textblock_Cursor 
*evas_object_textblock_cursor_get(const Evas_Object *
 #define EVAS_ERROR_INVALID_OPERATION0x0003
 
 
-/** Get the object's content it options.
+/** Get the object's content fit options.
  *
  * @param obj The textblock object.
  * @param[out] p_options content fitting options.
@@ -1076,7 +1076,7 @@ EAPI Evas_Textblock_Cursor 
*evas_object_textblock_cursor_get(const Evas_Object *
  */
 EAPI int evas_textblock_fit_options_get(const Evas_Object *obj,  unsigned int 
* p_options);
 
-/** Set the object's content it options.
+/** Set the object's content fit options.
  *
  * @param obj The textblock object.
  * @param[in] options content fitting options.

-- 




[EGIT] [core/efl] master 01/01: evas_common_font: release reallocated glyphs bitmaps data

2020-06-08 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=18218f50729fac5d27c004a504ef96d146d6f9e7

commit 18218f50729fac5d27c004a504ef96d146d6f9e7
Author: Ali Alzyod 
Date:   Tue Jun 9 10:25:10 2020 +0900

evas_common_font: release reallocated glyphs bitmaps data

Reviewers: woohyun, smohanty

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8743

Differential Revision: https://phab.enlightenment.org/D11945
---
 src/lib/evas/common/evas_font_main.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/lib/evas/common/evas_font_main.c 
b/src/lib/evas/common/evas_font_main.c
index 799f8a89d0..dfd7ef991b 100644
--- a/src/lib/evas/common/evas_font_main.c
+++ b/src/lib/evas/common/evas_font_main.c
@@ -597,6 +597,11 @@ _glyph_free(RGBA_Font_Glyph *fg)
 
 if ((fg->glyph_out->rle) && (fg->glyph_out->bitmap.rle_alloc))
   free(fg->glyph_out->rle);
+else if ((fg->glyph_out->bitmap.buffer) && 
(fg->glyph_out->bitmap.rle_alloc))
+  {
+ free(fg->glyph_out->bitmap.buffer);
+ fg->glyph_out->bitmap.buffer = NULL;
+  }
 fg->glyph_out->rle = NULL;
 if (!fg->glyph_out->bitmap.no_free_glout) free(fg->glyph_out);
 fg->glyph_out = NULL;

-- 




[EGIT] [core/efl] master 03/04: efl_access_text: remove ptr usage in eo files

2020-06-02 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ff3d3b19447c2eaa5378ea2e303f7a696d5370ef

commit ff3d3b19447c2eaa5378ea2e303f7a696d5370ef
Author: Ali Alzyod 
Date:   Sun May 31 06:16:46 2020 +

efl_access_text: remove ptr usage in eo files

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11907
---
 src/lib/elementary/efl_access_text.eo | 18 +++
 src/lib/elementary/efl_ui_textbox.c   | 39 ++---
 src/lib/elementary/elm_atspi_bridge.c |  7 +++---
 src/lib/elementary/elm_entry.c| 41 +++
 src/lib/elementary/elm_entry_eo.c |  4 ++--
 src/tests/elementary/elm_test_entry.c | 28 
 6 files changed, 71 insertions(+), 66 deletions(-)

diff --git a/src/lib/elementary/efl_access_text.eo 
b/src/lib/elementary/efl_access_text.eo
index 95cc367c3c..b40dc1a4eb 100644
--- a/src/lib/elementary/efl_access_text.eo
+++ b/src/lib/elementary/efl_access_text.eo
@@ -66,12 +66,12 @@ interface @beta Efl.Access.Text
  }
  keys {
 granularity: Efl.Access.Text_Granularity; [[Text granularity]]
-start_offset: ptr(int); [[Offset indicating start of string 
according to given granularity.
-  -1 in case of error.]]
-end_offset: ptr(int); [[Offset indicating end of string according 
to given granularity.
--1 in case of error.]]
  }
  values {
+start_offset: int; [[Offset indicating start of string according 
to given granularity.
+  -1 in case of error.]]
+end_offset: int; [[Offset indicating end of string according to 
given granularity.
+-1 in case of error.]]
 string: mstring @move; [[Newly allocated UTF-8 encoded string. 
Must be free by a user.]]
  }
   }
@@ -105,10 +105,10 @@ interface @beta Efl.Access.Text
  }
  keys {
 name: string; [[Text attribute name]]
-start_offset: ptr(int); [[Position in text from which given 
attribute is set.]]
-end_offset: ptr(int); [[Position in text to which given attribute 
is set.]]
  }
  values {
+start_offset: int; [[Position in text from which given attribute 
is set.]]
+end_offset: int; [[Position in text to which given attribute is 
set.]]
 value: mstring @move; [[Value of text attribute. Should be free()]]
  }
   }
@@ -116,11 +116,9 @@ interface @beta Efl.Access.Text
  [[Gets list of all text attributes.]]
  get {
  }
- keys {
-start_offset: ptr(int); [[Start offset]]
-end_offset: ptr(int); [[End offset]]
- }
  values {
+start_offset: int; [[Start offset]]
+end_offset: int; [[End offset]]
 attributes: list @move; [[List of text 
attributes]]
  }
   }
diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 64f1034638..bd97b47db7 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -2099,11 +2099,13 @@ 
_efl_ui_textbox_efl_access_text_character_count_get(const Eo *obj, Efl_Ui_Textbo
return eina_unicode_utf8_get_len(txt);
 }
 
-EOLIAN static char*
-_efl_ui_textbox_efl_access_text_string_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *pd, Efl_Access_Text_Granularity granularity, int 
*start_offset, int *end_offset)
+EOLIAN static void
+_efl_ui_textbox_efl_access_text_string_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *pd, Efl_Access_Text_Granularity granularity, int 
*start_offset, int *end_offset, char **ret EFL_TRANSFER_OWNERSHIP)
 {
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
-   char *ret = NULL;
+
+   EINA_SAFETY_ON_NULL_RETURN(ret);
+   *ret = NULL;
 
cur = evas_object_textblock_cursor_new(pd->text_obj);
cur2 = evas_object_textblock_cursor_new(pd->text_obj);
@@ -2158,26 +2160,26 @@ _efl_ui_textbox_efl_access_text_string_get(const Eo 
*obj EINA_UNUSED, Efl_Ui_Tex
 
if (end_offset) *end_offset = evas_textblock_cursor_pos_get(cur2);
 
-   ret = evas_textblock_cursor_range_text_get(cur, cur2, 
EVAS_TEXTBLOCK_TEXT_PLAIN);
+   *ret = evas_textblock_cursor_range_text_get(cur, cur2, 
EVAS_TEXTBLOCK_TEXT_PLAIN);
 
evas_textblock_cursor_free(cur);
evas_textblock_cursor_free(cur2);
 
-   if (ret && efl_text_password_get(obj))
+   if (*ret && efl_text_password_get(obj))
  {
 int i = 0;
-while (ret[i] != '\0')
- ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER;
+while (*ret[i] != '\0')
+ *ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER;
  }
 
-   return ret;
+   return;
 
 fail:
if (start_offset) *start_offset = -1;
if (end_of

[EGIT] [core/efl] master 01/01: evas_text: reduce Video Memory & RAM needed for text textures (Color Glyphs)

2020-05-29 Thread Ali Alzyod
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=23e8715070bb9d75a02123c2ab5ba200699f63af

commit 23e8715070bb9d75a02123c2ab5ba200699f63af
Author: Ali Alzyod 
Date:   Fri May 29 10:10:28 2020 +0100

evas_text: reduce Video Memory & RAM needed for text textures (Color Glyphs)

Summary:
Texture created for bitmap font glyph, with a fixed size in the font, this 
size could be much bigger than the needed size in application.
Then a scale factor is applied to these textures when drawn.

Now, instead, we will create smaller bitmaps and create texture from them 
with reduced texture size (that is not needed).

** This will affect both Video Memory and Ram needed to store glyphs**

Open this file {F3883874} in terminology before and after applying the 
patch and notice the difference.

Test Plan:
**Notes**
- You need to scroll down to make all glyphs visible, then notice Video/Ram 
memory

|  | Video | Ram
|--|---|-
| Before (Font_size=50) |  360   |  300
| After (Font_size=50) |  40   | 100
| Ration After/before   |  11%  |  33%

**I notice speed up in text rendering for small font size**

```
#include 

typedef struct _APP
{
  Evas_Object *tb1;
  Evas_Object *btnLoad;
} APP;

char *text = "1234567890藍☺珞樂蘿邏襤螺☹鸞嵐拉裸洛濫蠟☻☠烙‍⚕️‍⚕️‍‍‍‍‍⚖‍⚖‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍✈️‍✈️‍‍‍‍‍♂️‍♀️️‍♂️️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️虜老蘆擄‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍♀️臘‍♂️臘‍♀️路‍♂️路‍♀️‍♂️‍♀️‍♂️‍♀️‍♂️‍
 [...]

int font_size = 100;
void _button_clicked(void *data, Evas_Object *obj, void *event_info)
{
   APP *app = data;
   font_size = font_size - font_size/5;
   char buffer[100] = {0};
   sprintf(buffer, "DEFAULT='font=NotoColorEmoji font_size=%i color=red 
ellipsis=-1.0 wrap=mixed'", font_size);

   Evas_Textblock_Style *style = evas_textblock_style_new();
   evas_textblock_style_set(style, buffer);
   evas_object_textblock_style_set(app->tb1, style);
   evas_textblock_style_free(style);

   sprintf(buffer, "font_size = %i",font_size);
   elm_object_text_set(app->btnLoad, buffer);

   style = NULL;
}

EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
  APP *app = calloc(1, sizeof(APP));
  Evas_Object *win, *scroller1, *scroller2, *box;

  elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

  win = elm_win_util_standard_add("", "");
  elm_win_autodel_set(win, EINA_TRUE);

  box = elm_box_add(win);
  evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
  evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
  scroller1 = elm_scroller_add(win);
  evas_object_size_hint_weight_set(scroller1, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
  evas_object_size_hint_align_set(scroller1, EVAS_HINT_FILL, 
EVAS_HINT_FILL);

  //evas_text_cache_policy_set(EVAS_TEXT_CACHE_POLICY_TEXTURE 
,EVAS_TEXT_CACHE_NONE);

  app->tb1 = evas_object_textblock_add(win);
  Evas_Textblock_Style *style = evas_textblock_style_new();
  char buffer[100] = {0};
  sprintf(buffer, "DEFAULT='font=NotoColorEmoji font_size=%i color=red 
ellipsis=-1.0 wrap=mixed'", font_size);
  evas_textblock_style_set(style, buffer);
  evas_object_textblock_style_set(app->tb1, style);
  evas_textblock_style_free(style);
  style = NULL;

  int w,h;
  evas_object_textblock_text_markup_set(app->tb1, "");
  evas_object_size_hint_min_set(app->tb1, 360, 720);
  elm_object_content_set(scroller1, app->tb1);
  elm_box_pack_end(box, scroller1);
  elm_object_content_set(win, box);

  app->btnLoad = elm_button_add(win);
  sprintf(buffer, "font_size = %i",font_size);
  elm_object_text_set(app->btnLoad, buffer);
  evas_object_smart_callback_add(app->btnLoad, "clicked", _button_clicked, 
app);
  evas_object_show(app->btnLoad);
  evas_object_move(app->btnLoad, 0, 20);
  evas_object_resize(app->btnLoad, 150, 20);

  evas_object_textblock_text_markup_set(app->tb1, text);
  evas_object_textblock_size_formatted_get(app->tb1, , );
  evas_object_size_hint_min_set(app->tb1, 800, w/800 + h + 150);

  evas_object_resize(win, 800, 800);
  evas_object_show(box);
  evas_object_show(scroller1);
  evas_object_show(scroller2);
  evas_object_show(win);
  elm_run();

  return 0;
}
ELM_MAIN()
```

R

[EGIT] [core/efl] master 01/01: evas_textblock: fix doc typo

2020-05-26 Thread Ali Alzyod
stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b1a94e45a7035dfa4b7958149f26524221ef9dca

commit b1a94e45a7035dfa4b7958149f26524221ef9dca
Author: Ali Alzyod 
Date:   Mon May 18 07:47:58 2020 +

evas_textblock: fix doc typo

Reviewed-by: Xavi Artigas 
Reviewed-by: Stefan Schmidt 
Differential Revision: https://phab.enlightenment.org/D11845
---
 src/lib/evas/canvas/evas_textblock_legacy.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/evas_textblock_legacy.h 
b/src/lib/evas/canvas/evas_textblock_legacy.h
index eb638e32a4..13752081f4 100644
--- a/src/lib/evas/canvas/evas_textblock_legacy.h
+++ b/src/lib/evas/canvas/evas_textblock_legacy.h
@@ -1068,7 +1068,7 @@ EAPI Evas_Textblock_Cursor 
*evas_object_textblock_cursor_get(const Evas_Object *
 #define EVAS_ERROR_INVALID_OPERATION0x0003
 
 
-/** Get the object's content it options.
+/** Get the object's content fit options.
  *
  * @param obj The textblock object.
  * @param[out] p_options content fitting options.
@@ -1076,7 +1076,7 @@ EAPI Evas_Textblock_Cursor 
*evas_object_textblock_cursor_get(const Evas_Object *
  */
 EAPI int evas_textblock_fit_options_get(const Evas_Object *obj,  unsigned int 
* p_options);
 
-/** Set the object's content it options.
+/** Set the object's content fit options.
  *
  * @param obj The textblock object.
  * @param[in] options content fitting options.

-- 




[EGIT] [core/efl] master 01/01: evas_object_textblock: reduce layout calculations

2020-05-12 Thread Ali Alzyod
zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=789900d49adb6d3c0b29b831514b621431108b0b

commit 789900d49adb6d3c0b29b831514b621431108b0b
Author: Ali Alzyod 
Date:   Tue May 12 10:00:15 2020 -0400

evas_object_textblock: reduce layout calculations

Summary:
This patch reduces calculations for layouting textblock when it is not 
needed.
Exactly in **evas_object_textblock_render_pre**, layouting was done (if 
needed) regardless of object visibility.

evas_object_render_pre will async called if object status is changed, for 
example show->hide

In short words: **We do not layout textblock content if textblock t is 
hidden.**

```
// suppose textblock is shown
// and user want to hide it and set content in it
// to be visible later on if needed
evas_object_hide(textblock);
evas_object_textblock_text_markup_set(textblock, "Hello World");
//Layouting will be done on textblock regardless of its visiblity, becase 
render_pre
//will be called and will make it relayout
```

Reviewers: woohyun, zmike, tasn, raster, bu5hm4n

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11508
---
 src/lib/evas/canvas/evas_object_textblock.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 937cc60263..e92b55ba68 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -15830,13 +15830,13 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
  }
 
//evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data);
-   if (!_relayout_if_needed(eo_obj, o))
+   is_v = evas_object_is_visible(obj);
+   was_v = evas_object_was_visible(obj);
+   if (is_v && !_relayout_if_needed(eo_obj, o))
  {
 o->redraw = 0;
 evas_object_render_pre_prev_cur_add(>layer->evas->clip_changes,
 eo_obj, obj);
-is_v = evas_object_is_visible(obj);
-was_v = evas_object_was_visible(obj);
 goto done;
  }
if (o->changed)
@@ -15845,8 +15845,6 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
 o->redraw = 0;
 evas_object_render_pre_prev_cur_add(>layer->evas->clip_changes,
 eo_obj, obj);
-is_v = evas_object_is_visible(obj);
-was_v = evas_object_was_visible(obj);
 goto done;
  }
 
@@ -15855,14 +15853,10 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
 o->redraw = 0;
 evas_object_render_pre_prev_cur_add(>layer->evas->clip_changes,
 eo_obj, obj);
-is_v = evas_object_is_visible(obj);
-was_v = evas_object_was_visible(obj);
 goto done;
  }
/* now figure what changed and add draw rects */
/* if it just became visible or invisible */
-   is_v = evas_object_is_visible(obj);
-   was_v = evas_object_was_visible(obj);
if (is_v != was_v)
  {
 evas_object_render_pre_visible_change(>layer->evas->clip_changes,

-- 




[EGIT] [core/efl] master 01/01: edje_textblock: content_fit size_range update

2020-05-06 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=287ec502032d499085229b820cab053e7df28a01

commit 287ec502032d499085229b820cab053e7df28a01
Author: Ali Alzyod 
Date:   Wed May 6 20:33:42 2020 +0900

edje_textblock: content_fit size_range update

Summary: update size range will skip empty font_sizes

Reviewers: woohyun, bowonryu

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11507
---
 src/lib/edje/edje_textblock.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/lib/edje/edje_textblock.c b/src/lib/edje/edje_textblock.c
index 5711c7040f..38b737a508 100644
--- a/src/lib/edje/edje_textblock.c
+++ b/src/lib/edje/edje_textblock.c
@@ -539,12 +539,15 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
   Evas_Textblock_Style *st = _edje_textblock_style_get(ed, 
chosen_desc->text.style.str);
   const char *text_style = evas_textblock_style_get(st);
   char *s_font_size = (text_style) ? 
strrstr(text_style,"font_size=") : NULL;
-  if (s_font_size)
+  if (s_font_size && s_font_size[10])
 {
-  int font_size = strtol(_font_size[10], NULL, 10);
-  chosen_desc->text.size_range_max = font_size;
-  if (chosen_desc->text.size_range_min > 
chosen_desc->text.size_range_max)
-chosen_desc->text.size_range_min = 
chosen_desc->text.size_range_max;
+  int font_size = (int) strtol(_font_size[10], NULL, 10);
+  if (font_size > 0)
+{
+  chosen_desc->text.size_range_max = font_size;
+  if (chosen_desc->text.size_range_min > 
chosen_desc->text.size_range_max)
+chosen_desc->text.size_range_min = 
chosen_desc->text.size_range_max;
+}
 }
   EINA_LIST_FOREACH(chosen_desc->text.fit_size_array, l, value)
 {

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: clear paragraphs during markup_set

2020-05-06 Thread Ali Alzyod
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4976097bd427c09b493e428ce476b83d6427199e

commit 4976097bd427c09b493e428ce476b83d6427199e
Author: Ali Alzyod 
Date:   Wed May 6 10:40:37 2020 +0100

evas_textblock: clear paragraphs during markup_set

Summary: Clear paragraph during markup set, instead of waiting until next 
text layout to happen, this will release unused memory right away

Reviewers: woohyun, zmike, bu5hm4n, raster

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11773
---
 src/lib/evas/canvas/evas_object_textblock.c | 64 ++---
 1 file changed, 30 insertions(+), 34 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 932e4dd41a..ea48a10fe7 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -899,8 +899,7 @@ _image_safe_unref(Evas_Public_Data *e, void *image, 
Eina_Bool async)
  * @param it the layout item to be freed
  */
 static void
-_item_free(Evas_Public_Data *evas,
-  Efl_Canvas_Textblock_Data *o,
+_item_free(Efl_Canvas_Textblock_Data *o,
   Evas_Object_Protected_Data *evas_o,
   Evas_Object_Textblock_Line *ln, Evas_Object_Textblock_Item *it)
 {
@@ -917,7 +916,7 @@ _item_free(Evas_Public_Data *evas,
   //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);
+  _image_safe_unref(evas_o->layer->evas, 
ti->gfx_filter->output, async);
   ti->gfx_filter->output = NULL;
}
  EINA_INLIST_REMOVE(o->gfx_filter.text_items, ti->gfx_filter);
@@ -4190,8 +4189,8 @@ _layout_update_bidi_props(const Efl_Canvas_Textblock_Data 
*o,
  * Free the visual lines in the paragraph (logical items are kept)
  */
 static void
-_paragraph_clear(Evas_Public_Data *evas,
-  Efl_Canvas_Textblock_Data *o, Evas_Object_Protected_Data *obj,
+_paragraph_clear(Efl_Canvas_Textblock_Data *o,
+  Evas_Object_Protected_Data *obj,
   Evas_Object_Textblock_Paragraph *par)
 {
while (par->lines)
@@ -4213,7 +4212,7 @@ _paragraph_clear(Evas_Public_Data *evas,
   if (ti->parent.ln == ln)
 {
o->hyphen_items = 
eina_list_remove_list(o->hyphen_items, i);
-   _item_free(evas, o, obj, NULL, _ITEM(ti));
+   _item_free(o, obj, NULL, _ITEM(ti));
 }
}
   }
@@ -4227,17 +4226,17 @@ _paragraph_clear(Evas_Public_Data *evas,
  * Free the layout paragraph and all of it's lines and logical items.
  */
 static void
-_paragraph_free(Evas_Public_Data *evas,
-  Efl_Canvas_Textblock_Data *o, Evas_Object_Protected_Data *obj,
+_paragraph_free(Efl_Canvas_Textblock_Data *o,
+  Evas_Object_Protected_Data *obj,
   Evas_Object_Textblock_Paragraph *par)
 {
-   _paragraph_clear(evas, o, obj, par);
+   _paragraph_clear(o, obj, par);
 
  {
 Evas_Object_Textblock_Item *it;
 EINA_LIST_FREE(par->logical_items, it)
   {
- _item_free(evas, o, obj, NULL, it);
+ _item_free(o, obj, NULL, it);
   }
  }
 #ifdef BIDI_SUPPORT
@@ -4267,7 +4266,7 @@ _paragraphs_clear(Ctxt *c)
 
EINA_INLIST_FOREACH(EINA_INLIST_GET(c->paragraphs), par)
  {
-_paragraph_clear(c->evas, c->o, c->evas_o, par);
+_paragraph_clear(c->o, c->evas_o, par);
  }
 }
 
@@ -4280,8 +4279,8 @@ _paragraphs_clear(Ctxt *c)
  * @param c the context - Not NULL.
  */
 static void
-_paragraphs_free(Evas_Public_Data *evas,
-  Efl_Canvas_Textblock_Data *o, Evas_Object_Protected_Data *obj,
+_paragraphs_free(Efl_Canvas_Textblock_Data *o,
+  Evas_Object_Protected_Data *obj,
   Evas_Object_Textblock_Paragraph *pars)
 {
o->num_paragraphs = 0;
@@ -4292,7 +4291,7 @@ _paragraphs_free(Evas_Public_Data *evas,
 
 par = (Evas_Object_Textblock_Paragraph *) pars;
 pars = (Evas_Object_Textblock_Paragraph 
*)eina_inlist_remove(EINA_INLIST_GET(pars), EINA_INLIST_GET(par));
-_paragraph_free(evas, o, obj, par);
+_paragraph_free(o, obj, par);
  }
 }
 
@@ -5139,7 +5138,7 @@ _layout_item_merge_and_free(Ctxt *c,
item1->parent.merge = EINA_FALSE;
item1->parent.visually_deleted = EINA_FALSE;
 
-   _item_free(c->evas, c->o, c->evas_o, NULL, _ITEM(item2));
+   _item_free(c->o, c->evas_o, NULL, _ITEM(item2));
 }
 
 /**
@@ -5916,7 +5915,7 @@ _layout_get_hyphenationwrap(Ctxt *c, 
Evas_Object_Textblock_Format *fmt,
}
  else
{
-  _item_f

[EGIT] [core/efl] efl-1.24 02/02: tests: edje: Fedora32 system fail resolve

2020-05-05 Thread Ali Alzyod
stefan pushed a commit to branch efl-1.24.

http://git.enlightenment.org/core/efl.git/commit/?id=0b7d945a0d1f2852e712f49c62d7a111b1fe6919

commit 0b7d945a0d1f2852e712f49c62d7a111b1fe6919
Author: Ali Alzyod 
Date:   Tue May 5 12:15:55 2020 +

tests: edje: Fedora32 system fail resolve

This test seems to fail on Fedora32, we increase font size margin to
prevent it from happening

Reviewed-by: Stefan Schmidt 
Differential Revision: https://phab.enlightenment.org/D11776
---
 src/tests/edje/edje_test_text.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tests/edje/edje_test_text.c b/src/tests/edje/edje_test_text.c
index 20162c5c5c..5b48de63a0 100644
--- a/src/tests/edje/edje_test_text.c
+++ b/src/tests/edje/edje_test_text.c
@@ -123,7 +123,7 @@ EFL_START_TEST(edje_test_textblock)
ck_assert_int_ne(w, 0);
ck_assert_int_ne(h, 0);
 
-   edje_object_text_class_set(obj2, "tc1", "Sans", 15);
+   edje_object_text_class_set(obj2, "tc1", "Sans", 8);
edje_object_calc_force(obj2);
int w2 = 0, h2 = 0;
evas_object_textblock_size_formatted_get(tb, , );

-- 




[EGIT] [core/efl] master 01/01: tests: edje: Fedora32 system fail resolve

2020-05-05 Thread Ali Alzyod
stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d7ed1721b83313a9350ff7ccc1bb99752ef8d207

commit d7ed1721b83313a9350ff7ccc1bb99752ef8d207
Author: Ali Alzyod 
Date:   Tue May 5 12:15:55 2020 +

tests: edje: Fedora32 system fail resolve

This test seems to fail on Fedora32, we increase font size margin to
prevent it from happening

Reviewed-by: Stefan Schmidt 
Differential Revision: https://phab.enlightenment.org/D11776
---
 src/tests/edje/edje_test_text.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tests/edje/edje_test_text.c b/src/tests/edje/edje_test_text.c
index 20162c5c5c..5b48de63a0 100644
--- a/src/tests/edje/edje_test_text.c
+++ b/src/tests/edje/edje_test_text.c
@@ -123,7 +123,7 @@ EFL_START_TEST(edje_test_textblock)
ck_assert_int_ne(w, 0);
ck_assert_int_ne(h, 0);
 
-   edje_object_text_class_set(obj2, "tc1", "Sans", 15);
+   edje_object_text_class_set(obj2, "tc1", "Sans", 8);
edje_object_calc_force(obj2);
int w2 = 0, h2 = 0;
evas_object_textblock_size_formatted_get(tb, , );

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: optimize calculate main format once in layout setup stage

2020-05-04 Thread Ali Alzyod
zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3dff471826e815429c2cdc9b22df848bfad26e6c

commit 3dff471826e815429c2cdc9b22df848bfad26e6c
Author: Ali Alzyod 
Date:   Mon May 4 15:25:07 2020 -0400

evas_textblock: optimize calculate main format once in layout setup stage

Summary:
This change based on discussion on D9533 , where @smohanty example shows 
that unnecessary calculation happened on textblock related to lay-outing

Where now _layout_setup will not calculate main format using (_format_fill) 
unless style has been changed.

expedite commit:

https://git.enlightenment.org/tools/expedite.git/commit/?id=dc6c931dc2e6c240d3e240f24578980c689ab7fc
src/bin/textblock_text_fill_format.c

Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include 
#include 
#include 

EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *textblock;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("Main", "App");
   elm_win_autodel_set(win, EINA_TRUE);

   int l, r, t, b;
   textblock = evas_object_textblock_add(evas_object_evas_get(win));

   Evas_Textblock_Style *st = evas_textblock_style_new();
   evas_textblock_style_set (st, "DEFAULT='font=Sans font_size=10 
color=#00 wrap=word align=left outline_color=#000 shadow_color=#fff8 
shadow_color=#0002 glow2_color=#fe87 glow_color=#f214 underline_color=#00f 
linesize=40'");
   evas_object_textblock_style_set(textblock, st);
   int sizes[] = {600, 700};
   evas_object_textblock_text_markup_set(textblock, "This test resize text 
block and keep style (style parsed only once)");
   clock_t start, end;
   start = clock();
   for (int i = 0; i < 1; i++)
   {
  evas_object_resize(textblock, sizes[i % 2], sizes[i % 2]);
  evas_object_textblock_style_insets_get(textblock, , , , );
   }
   end = clock();
   double total_Time1 = ((double)(end - start)) / CLOCKS_PER_SEC;
   printf("total time = %f\n", total_Time1);

   evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, 
EVAS_HINT_FILL);
   evas_object_show(textblock);

   evas_object_move(textblock, 0, 0);
   evas_object_resize(textblock, 640, 800);
   evas_object_resize(win, 640, 800);

   evas_object_show(win);
   elm_run();

   return 0;
}
ELM_MAIN()

```

**Old  Code output : total time = 0.096900
New Code output : total time = 0.045580**

Reviewers: smohanty, woohyun, Hermet, bowonryu, cedric, bu5hm4n, zmike

Reviewed By: zmike

Subscribers: zmike, segfaultxavi, bu5hm4n, smohanty, cedric, #reviewers, 
#committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9536
---
 src/lib/evas/canvas/evas_object_textblock.c | 35 ++---
 src/tests/evas/evas_test_textblock.c| 10 +
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 78ccec4d41..932e4dd41a 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -500,6 +500,7 @@ struct _Evas_Object_Textblock
} default_format;
double  valign;
Eina_Stringshare   *markup_text;
+   Evas_Object_Textblock_Format   *main_fmt;
char   *utf8;
void   *engine_data;
const char *repch;
@@ -7631,6 +7632,7 @@ _layout_setup(Ctxt *c, const Eo *eo_obj, Evas_Coord w, 
Evas_Coord h)
 
/* Start of logical layout creation */
/* setup default base style */
+   if (!o->main_fmt)  /* no main format */
  {
 Eina_List *itr;
 User_Style_Entry *use;
@@ -7662,6 +7664,11 @@ _layout_setup(Ctxt *c, const Eo *eo_obj, Evas_Coord w, 
Evas_Coord h)
 
 if (finalize)
_format_finalize(c->obj, c->fmt);
+o->main_fmt = _format_dup(c->obj, c->fmt);
+ }
+   else
+ {
+c->fmt = _layout_format_push(c, o->main_fmt, NULL);
  }
if (!c->fmt)
  {
@@ -7948,7 +7955,17 @@ evas_textblock_style_free(Evas_Textblock_Style *ts)
 }
 
 static void
-_evas_textblock_update_format_nodes_from_style_tag(Efl_Canvas_Textblock_Data 
*o)
+_evas_clear_main_format(Evas_Object *eo_obj, Efl_Canvas_Textblock_Data *o)
+{
+if (o->main_fmt)
+  {
+ _format_unref_free(efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS), o->main_fmt);
+ o->main_fmt = NULL;
+  }

[EGIT] [core/efl] master 01/01: evas_textblock: pick textrun fonts

2020-04-16 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9b987c67e1e38602ba2e4c9c990798e99d938bbe

commit 9b987c67e1e38602ba2e4c9c990798e99d938bbe
Author: Ali Alzyod 
Date:   Fri Apr 17 12:28:41 2020 +0900

evas_textblock: pick textrun fonts

Summary:
Picking font on textrun, will now give priority into font picked by the 
user, regardless of script type.
picking font due script can cause many inconvenient results

Example of wrong results:  (User font is **NotoColorEmoji**)
{F3847118} -> add 'a' at the end (notice how text render is wrong) 
{F3847119} -> add tab before 'a' (text rendering now is right) {F3847120}

After Change results: (User font is **NotoColorEmoji**)
{F3847118}  -> add 'a' at the end -> {F3847122}-> add tab before 'a' -> 
{F3847123}

Also now the following lines will be shown exactly the same, regardless of 
characters order
```
"가123A321"
"A321가123"
"123가A321"
"A가123321"
```

Test Plan:
```
#include 
/*
gcc -o example test.c `pkg-config --cflags --libs elementary`
*/

EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
   Evas_Object *win, *en;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("", "");
   elm_win_autodel_set(win, EINA_TRUE);

   en = elm_entry_add(win);
   elm_entry_scrollable_set(en, EINA_TRUE);
   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);

   elm_entry_text_style_user_push(en,"DEFAULT='font=NotoColorEmoji 
font_size=30 color=red'");
   elm_object_text_set(en, "123456a");

   evas_object_show(en);

   elm_object_content_set(win, en);
   evas_object_resize(win, 400, 200);
   evas_object_show(win);

   elm_run();

   return 0;
}
ELM_MAIN()
```

Reviewers: woohyun, bowonryu, tasn, raster, cedric

Reviewed By: tasn

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8556

Differential Revision: https://phab.enlightenment.org/D11302
---
 src/lib/evas/common/evas_font_query.c | 35 ++-
 src/tests/evas/evas_test_textblock.c  | 22 ++
 2 files changed, 24 insertions(+), 33 deletions(-)

diff --git a/src/lib/evas/common/evas_font_query.c 
b/src/lib/evas/common/evas_font_query.c
index 640fc65b4c..1464d7f9db 100644
--- a/src/lib/evas/common/evas_font_query.c
+++ b/src/lib/evas/common/evas_font_query.c
@@ -17,7 +17,7 @@
  * @return length of the run found.
  */
 EAPI int
-evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int 
**script_fi, RGBA_Font_Int **cur_fi, Evas_Script_Type script, const 
Eina_Unicode *text, int run_len)
+evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int 
**script_fi, RGBA_Font_Int **cur_fi, Evas_Script_Type script EINA_UNUSED, const 
Eina_Unicode *text, int run_len)
 {
RGBA_Font_Int *fi = NULL;
const Eina_Unicode *run_end = text + run_len;
@@ -26,38 +26,7 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, 
RGBA_Font_Int **script_fi
/* If there's no current script_fi, find it first */
if (!*script_fi)
  {
-const Eina_Unicode *base_char = NULL;
-/* Skip common chars */
-for (base_char = text ;
- (base_char < run_end) &&
- (evas_common_language_char_script_get(*base_char) != script) ;
- base_char++)
-   ;
-/* If counter reach variation sequence it is safe to pick default font 
*/
-if(VAR_SEQ_SAFE(base_char) || (base_char != run_end && 
VAR_SEQ_SAFE((base_char+1 goto get_top_font;
-
-if (base_char == run_end) base_char = text;
-
-/* Find the first renderable char */
-while (base_char < run_end)
-  {
- /* 0x1F is the last ASCII contral char, just a hack in
-  * the meanwhile. */
- if ((*base_char > 0x1F) &&
-   evas_common_font_glyph_search(fn, , *base_char, 0, 
EVAS_FONT_SEARCH_OPTION_NONE))
-break;
- base_char++;
-  }
-
-
-/* If everything else fails, at least try to find a font for the
- * replacement char */
-if (base_char == run_end)
-   evas_common_font_glyph_search(fn, , REPLACEMENT_CHAR, 0, 
EVAS_FONT_SEARCH_OPTION_NONE);
-get_top_font:
-
-if (!fi)
-   fi = fn->fonts->data;
+fi = fn->fonts->data;
 
 *script_fi = fi;
  }
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.

[EGIT] [core/efl] master 09/09: efl.ui.textbox: load default font properties once

2020-03-20 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8e7a01b16f64227143101a517daec7333ed430e8

commit 8e7a01b16f64227143101a517daec7333ed430e8
Author: Ali Alzyod 
Date:   Tue Feb 25 11:30:23 2020 +

efl.ui.textbox: load default font properties once

As described in task T8617
when toggle editable mode for textbox, we will reserve user changes 
(instead of reload them again).

this issue is affected by D9502, I do not fully understand why do we need 
it, so I leave color loading as it is.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11404
---
 src/lib/elementary/efl_ui_textbox.c | 38 +
 src/tests/elementary/efl_ui_test_text.c | 21 ++
 2 files changed, 45 insertions(+), 14 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 17cd36fd4a..a5d5852fe9 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -631,7 +631,8 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
 efl_content_set(efl_part(sd->entry_edje, "efl.text"), sd->text_table);
  }
 
-   _create_text_cursors(obj, sd);
+   if (!sd->cursor && !sd->cursor_bidi)
+ _create_text_cursors(obj, sd);
 
return theme_apply;
 }
@@ -1593,11 +1594,17 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
 
// Main Text
// font_set
-   font_name = efl_layout_group_data_get(wd->resize_obj, "font.name");
-   font_size = efl_layout_group_data_get(wd->resize_obj, "font.size");
-   font_size_n = font_size ? atoi(font_size) : 0;
-   efl_text_font_family_set(sd->text_obj, font_name);
-   efl_text_font_size_set(sd->text_obj, font_size_n);
+   if (!efl_text_font_family_get(sd->text_obj))
+ {
+font_name = efl_layout_group_data_get(wd->resize_obj, "font.name");
+efl_text_font_family_set(sd->text_obj, font_name);
+ }
+   if (!efl_text_font_size_get(sd->text_obj))
+ {
+font_size = efl_layout_group_data_get(wd->resize_obj, "font.size");
+font_size_n = font_size ? atoi(font_size) : 0;
+efl_text_font_size_set(sd->text_obj, font_size_n);
+ }
 
// color
if (disabled)
@@ -1610,11 +1617,17 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
  }
 
// Guide Text
-   font_name = efl_layout_group_data_get(wd->resize_obj, "guide.font.name");
-   font_size = efl_layout_group_data_get(wd->resize_obj, "guide.font.size");
-   font_size_n = font_size ? atoi(font_size) : 0;
-   efl_text_font_family_set(sd->text_guide_obj, font_name);
-   efl_text_font_size_set(sd->text_guide_obj, font_size_n);
+   if (!efl_text_font_family_get(sd->text_guide_obj))
+ {
+font_name = efl_layout_group_data_get(wd->resize_obj, 
"guide.font.name");
+efl_text_font_family_set(sd->text_guide_obj, font_name);
+ }
+   if (!efl_text_font_size_get(sd->text_guide_obj))
+ {
+font_size = efl_layout_group_data_get(wd->resize_obj, 
"guide.font.size");
+font_size_n = font_size ? atoi(font_size) : 0;
+efl_text_font_size_set(sd->text_guide_obj, font_size_n);
+ }
 
colorcode = NULL;
// color
@@ -1796,8 +1809,6 @@ _efl_ui_textbox_efl_text_format_password_set(Eo *obj, 
Efl_Ui_Textbox_Data *sd, E
 efl_input_text_input_content_type_set(obj, 
((efl_input_text_input_content_type_get(obj) | 
EFL_INPUT_TEXT_CONTENT_TYPE_AUTO_COMPLETE) & 
~EFL_INPUT_TEXT_CONTENT_TYPE_SENSITIVE_DATA));
 efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
  }
-
-   efl_ui_widget_theme_apply(obj);
 }
 
 static void
@@ -1856,7 +1867,6 @@ _efl_ui_textbox_efl_text_interactive_editable_set(Eo 
*obj, Efl_Ui_Textbox_Data *
 
efl_text_interactive_editable_set(efl_super(obj, MY_CLASS), editable);
 
-   efl_ui_widget_theme_apply(obj);
efl_ui_widget_focus_allow_set(obj, editable);
 
if (editable)
diff --git a/src/tests/elementary/efl_ui_test_text.c 
b/src/tests/elementary/efl_ui_test_text.c
index 0944afa0ef..63df67919c 100644
--- a/src/tests/elementary/efl_ui_test_text.c
+++ b/src/tests/elementary/efl_ui_test_text.c
@@ -264,6 +264,26 @@ EFL_START_TEST(text_keys_handler)
 }
 EFL_END_TEST
 
+EFL_START_TEST(text_editable)
+{
+   Eo *txt, *win;
+   win = win_add();
+   txt = efl_add(EFL_UI_TEXTBOX_CLASS, win);
+   efl_text_font_size_set(txt, 100);
+   efl_text_font_family_set(txt, "Arial");
+   efl_text_interactive_editable_set(txt, 
!efl_text_interactive_editable_get(txt));
+   ck_assert_int_eq(efl_text_font_size_get(txt), 100);
+   ck_assert_str_eq(efl_text_font_family_get(txt), "Arial");
+
+   efl_ui_widget_disabled_set(txt, EINA_TRUE);
+   ck_assert_int_eq(efl_text_font_size_get(txt),

[EGIT] [core/efl] master 06/06: move stabelized items out of @beta

2020-03-17 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=69d6ca28ab34695e5c28bba5e20ee693f4ee54dd

commit 69d6ca28ab34695e5c28bba5e20ee693f4ee54dd
Author: Ali Alzyod 
Date:   Wed Feb 12 13:07:17 2020 +

move stabelized items out of @beta

ref T8541
ref T8522

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11328
---
 src/lib/efl/interfaces/efl_input_text.eo | 35 +++-
 src/lib/elementary/efl_ui_textbox.eo |  5 +++--
 2 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_input_text.eo 
b/src/lib/efl/interfaces/efl_input_text.eo
index ce4a42eefb..4abcdf7c34 100644
--- a/src/lib/efl/interfaces/efl_input_text.eo
+++ b/src/lib/efl/interfaces/efl_input_text.eo
@@ -1,7 +1,8 @@
-enum @beta Efl.Input_Text.Panel_Layout_Type
+enum Efl.Input_Text.Panel_Layout_Type
 {
[[Input panel (virtual keyboard) layout types.
  Type of input panel (virtual keyboard) to use - this is a hint and may 
not provide exactly what is desired.
+ @since 1.24
]]
normal,  [[Default layout.]]
number,  [[Number layout.]]
@@ -20,18 +21,20 @@ enum @beta Efl.Input_Text.Panel_Layout_Type
voice[[Voice layout, but if the IME does not support voice layout, 
then normal layout will be shown.]]
 }
 
-enum @beta Efl.Input_Text.Panel_Language_Type
+enum Efl.Input_Text.Panel_Language_Type
 {
[[Input panel (virtual keyboard) language modes.
+ @since 1.24
]]
automatic,[[Automatic]]
alphabet  [[Alphabet]]
 }
 
-enum @beta Efl.Input_Text.Capitalize_Type
+enum Efl.Input_Text.Capitalize_Type
 {
[[Autocapitalization Types.
  Choose method of auto-capitalization.
+ @since 1.24
]]
none, [[No auto-capitalization when typing.]]
word, [[Autocapitalize each word typed.]]
@@ -39,9 +42,10 @@ enum @beta Efl.Input_Text.Capitalize_Type
all   [[Autocapitalize all letters.]]
 }
 
-enum @beta Efl.Input_Text.Panel_Return_Key_Type
+enum Efl.Input_Text.Panel_Return_Key_Type
 {
[["Return" Key types on the input panel (virtual keyboard).
+ @since 1.24
]]
default, [[Default.]]
done,[[Done.]]
@@ -54,9 +58,10 @@ enum @beta Efl.Input_Text.Panel_Return_Key_Type
signin   [[Sign-in.]]
 }
 
-enum @beta Efl.Input_Text.Panel_Return_Key_State
+enum Efl.Input_Text.Panel_Return_Key_State
 {
[["Return" Key state on the input panel (virtual keyboard).
+ @since 1.24
]]
auto, [[The return key on input panel is disabled when the entry has no 
text,
if entry has text, return key is enabled.
@@ -65,9 +70,10 @@ enum @beta Efl.Input_Text.Panel_Return_Key_State
disabled, [[The return key on input panel is disabled.]]
 }
 
-enum @beta Efl.Input_Text.Content_Type
+enum Efl.Input_Text.Content_Type
 {
-   [[Enumeration that defines the types of Input Hints.]]
+   [[Enumeration that defines the types of Input Hints.
+ @since 1.24]]
none= 0,[[No active hints.]]
auto_complete   = 1 << 0,   [[Suggest word auto completion.]]
sensitive_data  = 1 << 1,   [[Typed text should not be stored.]]
@@ -110,8 +116,9 @@ enum @beta 
Efl.Input_Text.Panel_Layout_Password_Variation_Type
 
 
 
-interface @beta Efl.Input_Text {
-   [[All the functionality relating to input hints
+interface Efl.Input_Text {
+   [[All the functionality relating to input hints/
+ @since 1.24
]]
methods {
   @property input_panel_show_on_demand {
@@ -128,7 +135,7 @@ interface @beta Efl.Input_Text {
  }
   }
 
-  // FIXME: I don't understand why this is needed in addition to Layout
+
   @property input_panel_language {
  [[The language mode of the input panel.
This API can be used if you want to show the alphabet keyboard 
mode.]]
@@ -154,7 +161,6 @@ interface @beta Efl.Input_Text {
  }
   }
 
-  // FIXME: input_capitalize/capitalization ?
   @property autocapitalization {
  [[The autocapitalization type on the immodule.]]
  set {
@@ -166,7 +172,6 @@ interface @beta Efl.Input_Text {
  }
   }
 
-  // FIXME: rename
   @property predictable {
  [[Whether the entry should allow predictive text.]]
  set {
@@ -177,7 +182,7 @@ interface @beta Efl.Input_Text {
 prediction: bool; [[Whether the entry should allow predictive 
text.]]
  }
   }
-  // FIXME: I agree with Mike, looks bad
+
   @property input_content_type @beta {
  [[The input hint which allows input methods to fine-tune their 
behavior.]]
  set {
@@ -188,6 +193,7 @@ interface @beta Efl.Input_Text {
 hints: Efl.Input_Text.Content_Type; [[Input hint.]]
  }
   }
+
   @property input_panel_layout {
  [[The input panel layout of the entry.]]

[EGIT] [core/efl] master 02/03: efl.ui.textbox: proxy for efl.ui.scrollable interface

2020-03-12 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=765c5c2a0b2c28c4b8497b28ffbd64f159a446d6

commit 765c5c2a0b2c28c4b8497b28ffbd64f159a446d6
Author: Ali Alzyod 
Date:   Tue Mar 10 08:46:18 2020 +

efl.ui.textbox: proxy for efl.ui.scrollable interface

Allow users to use scroller functinality with efl.ui.textbox

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11479
---
 src/lib/elementary/efl_ui_textbox.c  | 142 +++
 src/lib/elementary/efl_ui_textbox.eo |  14 +++-
 2 files changed, 155 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 11f79b23fd..17cd36fd4a 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -3233,6 +3233,148 @@ _efl_ui_textbox_item_factory_get(const Eo *obj 
EINA_UNUSED, Efl_Ui_Textbox_Data
return pd->item_factory;
 }
 
+/*Efl.Ui.Scrollable*/
+EOLIAN static Eina_Size2D
+_efl_ui_textbox_efl_ui_scrollable_content_size_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_SIZE2D(0, 0));
+   return efl_ui_scrollable_content_size_get(sd->scroller);
+}
+
+EOLIAN static Eina_Rect
+_efl_ui_textbox_efl_ui_scrollable_viewport_geometry_get(const Eo *obj 
EINA_UNUSED,
+   
Efl_Ui_Textbox_Data *sd)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_RECT_EMPTY());
+   return efl_ui_scrollable_viewport_geometry_get(sd->scroller);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollable_match_content_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Bool w, Eina_Bool h)
+{
+   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+   return efl_ui_scrollable_match_content_set(sd->scroller, !!w, !!h);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollable_step_size_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Position2D step)
+{
+   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+   efl_ui_scrollable_step_size_set(sd->scroller, step);
+}
+
+EOLIAN static Eina_Position2D
+_efl_ui_textbox_efl_ui_scrollable_step_size_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_POSITION2D(0, 0));
+   return efl_ui_scrollable_step_size_get(sd->scroller);
+}
+
+EOLIAN static Eina_Position2D
+_efl_ui_textbox_efl_ui_scrollable_content_pos_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_POSITION2D(0, 0));
+   return efl_ui_scrollable_content_pos_get(sd->scroller);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollable_content_pos_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Position2D pos)
+{
+   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+   efl_ui_scrollable_content_pos_set(sd->scroller, pos);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_textbox_efl_ui_scrollable_scroll_hold_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_FALSE);
+   return efl_ui_scrollable_scroll_hold_get(sd->scroller);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollable_scroll_hold_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Bool hold)
+{
+   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+   efl_ui_scrollable_scroll_hold_set(sd->scroller, !!hold);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_textbox_efl_ui_scrollable_scroll_freeze_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_FALSE);
+   return efl_ui_scrollable_scroll_freeze_get(sd->scroller);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollable_scroll_freeze_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Bool freeze)
+{
+   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+   efl_ui_scrollable_scroll_freeze_set(sd->scroller, !!freeze);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollable_bounce_enabled_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Bool horiz, Eina_Bool vert)
+{
+   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+   efl_ui_scrollable_bounce_enabled_set(sd->scroller, !!horiz, !!vert);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollable_bounce_enabled_get(const Eo *obj 
EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool *horiz, Eina_Bool *vert)
+{
+   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+   efl_ui_scrollable_bounce_enabled_get(sd->scroller, horiz, vert);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollable_scroll(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Rect rect, Eina_Bool animation)
+{
+   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+   efl_ui_scrollable_scroll(sd->scroller, rect, animation);
+}
+
+EOLIAN static void
+_efl_ui_textbox_efl_ui_scrollabl

[EGIT] [core/efl] master 01/01: edje_textblock: style font size override size_range max

2020-03-12 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=06e9af1b0cee7194bf6dc848b195caed1295847e

commit 06e9af1b0cee7194bf6dc848b195caed1295847e
Author: Ali Alzyod 
Date:   Thu Mar 12 20:07:12 2020 +0900

edje_textblock: style font size override size_range max

Summary: style font size (also text_class) will change size_range max 
value, regardless of what user specifed in textblock description

Reviewers: woohyun

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11493
---
 src/lib/edje/edje_textblock.c | 26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/src/lib/edje/edje_textblock.c b/src/lib/edje/edje_textblock.c
index d0c5c6d30d..fe3ec439fb 100644
--- a/src/lib/edje/edje_textblock.c
+++ b/src/lib/edje/edje_textblock.c
@@ -493,6 +493,20 @@ _edje_part_textblock_style_text_set(Edje *ed,
return EINA_FALSE;
 }
 
+static char*
+strrstr(const char* haystack, const char* violate)
+{
+   char *s_ret = NULL;
+   char *tmp = NULL;
+   const char *_haystack = haystack;
+   size_t len = strlen(violate);
+   while((tmp = strstr(_haystack, violate))){
+ s_ret = tmp;
+ _haystack = tmp + len;
+   }
+   return s_ret;
+}
+
 void
 _edje_part_recalc_single_textblock(FLOAT_T sc,
Edje *ed,
@@ -522,11 +536,21 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
   size_t size_array_len = 0;
   Eina_List *l;
   unsigned int *value;
+  Evas_Textblock_Style *st = _edje_textblock_style_get(ed, 
chosen_desc->text.style.str);
+  const char *text_style = evas_textblock_style_get(st);
+  char *s_font_size = (text_style) ? 
strrstr(text_style,"font_size=") : NULL;
+  if (s_font_size)
+{
+  int font_size = strtol(_font_size[10], NULL, 10);
+  chosen_desc->text.size_range_max = font_size;
+  if (chosen_desc->text.size_range_min > 
chosen_desc->text.size_range_max)
+chosen_desc->text.size_range_min = 
chosen_desc->text.size_range_max;
+}
   EINA_LIST_FOREACH(chosen_desc->text.fit_size_array, l, value)
 {
size_array[size_array_len++] = *value;
 }
- unsigned int mode = TEXTBLOCK_FIT_MODE_NONE;
+  unsigned int mode = TEXTBLOCK_FIT_MODE_NONE;
 
   if (chosen_desc->text.fit_x)
 mode |= TEXTBLOCK_FIT_MODE_WIDTH;

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: replace evil tabs with spaces

2020-03-11 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=149042a3baa0c6df7c5ea8b0f549d465a5fb6975

commit 149042a3baa0c6df7c5ea8b0f549d465a5fb6975
Author: Ali Alzyod 
Date:   Wed Mar 11 12:37:47 2020 +0100

evas_textblock: replace evil tabs with spaces

Reviewers: devilhorns, ali.alzyod

Reviewed By: devilhorns

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11482
---
 src/lib/evas/canvas/evas_object_textblock.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index c8c7e12f92..b52f97cf01 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -557,24 +557,24 @@ static void evas_object_textblock_render(Evas_Object 
*eo_obj,
  int x, int y, Eina_Bool do_async);
 static void evas_object_textblock_free(Evas_Object *eo_obj);
 static void evas_object_textblock_render_pre(Evas_Object *eo_obj,
-Evas_Object_Protected_Data *obj,
-void *type_private_data);
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data);
 static void evas_object_textblock_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj,
- void *type_private_data);
+  Evas_Object_Protected_Data *obj,
+  void *type_private_data);
 static Evas_Object_Textblock_Node_Text *_evas_textblock_node_text_new(void);
 
 static void *evas_object_textblock_engine_data_get(Evas_Object *eo_obj);
 
 static int evas_object_textblock_is_opaque(Evas_Object *eo_obj,
-  Evas_Object_Protected_Data *obj,
-  void *type_private_data);
+   Evas_Object_Protected_Data *obj,
+   void *type_private_data);
 static int evas_object_textblock_was_opaque(Evas_Object *eo_obj,
-   Evas_Object_Protected_Data *obj,
-   void *type_private_data);
+Evas_Object_Protected_Data *obj,
+void *type_private_data);
 static void evas_object_textblock_coords_recalc(Evas_Object *eo_obj,
-   Evas_Object_Protected_Data *obj,
-   void *type_private_data);
+Evas_Object_Protected_Data 
*obj,
+void *type_private_data);
 static void _canvas_text_format_changed(Eo *eo_obj, Efl_Canvas_Textblock_Data 
*o);
 
 static const Evas_Object_Func object_func =
@@ -6350,7 +6350,7 @@ _layout_handle_ellipsis(Ctxt *c, 
Evas_Object_Textblock_Item *it, Eina_List *i)
 /* Don't do much for the meanwhile. */
 static inline void
 _layout_paragraph_render(Efl_Canvas_Textblock_Data *o,
-Evas_Object_Textblock_Paragraph *par)
+ Evas_Object_Textblock_Paragraph *par)
 {
if (par->rendered)
   return;
@@ -14504,7 +14504,7 @@ evas_object_textblock_init(Evas_Object *eo_obj)
 linebreak_init = EINA_TRUE;
 init_linebreak();
 init_wordbreak();
-   init_graphemebreak();
+init_graphemebreak();
  }
 
o = obj->private_data;
@@ -15762,8 +15762,8 @@ evas_object_textblock_coords_recalc(Evas_Object *eo_obj,
 
 static void
 evas_object_textblock_render_pre(Evas_Object *eo_obj,
-Evas_Object_Protected_Data *obj,
-void *type_private_data)
+ Evas_Object_Protected_Data *obj,
+ void *type_private_data)
 {
Efl_Canvas_Textblock_Data *o = type_private_data;
ASYNC_BLOCK;

-- 




[EGIT] [core/efl] master 01/01: evas_gl_font: free data paths if alloca fails

2020-03-09 Thread Ali Alzyod
hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=794792aacbbf0f693ef9178cb71db16547214ff8

commit 794792aacbbf0f693ef9178cb71db16547214ff8
Author: Ali Alzyod 
Date:   Tue Mar 10 11:41:57 2020 +0900

evas_gl_font: free data paths if alloca fails

Reviewers: Hermet, woohyun, bu5hm4n, zmike

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11473
---
 src/modules/evas/engines/gl_common/evas_gl_font.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_font.c 
b/src/modules/evas/engines/gl_common/evas_gl_font.c
index b7bd643756..52e4d4e4a9 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_font.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_font.c
@@ -4,7 +4,7 @@ void *
 evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg)
 {
Evas_Engine_GL_Context *gc = context;
-   Evas_GL_Texture *tex;
+   Evas_GL_Texture *tex = NULL;
int w, h, nw, fh, y;
DATA8 *ndata, *data, *p1, *p2;
 
@@ -25,7 +25,7 @@ evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg)
   ndata = data;
} else {
   ndata = alloca(nw *h);
-  if (!ndata) return NULL;
+  if (!ndata) goto done;
   // else copy row by row
   for (y = 0; y < h; y++)
   {

-- 




[EGIT] [core/efl] master 01/01: efl.canvas.textblock: allow all white spaces in style string not just space

2020-02-11 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4f99a37aee19e743df40e04b7e13574216f8d619

commit 4f99a37aee19e743df40e04b7e13574216f8d619
Author: Ali Alzyod 
Date:   Tue Feb 11 12:03:00 2020 +0100

efl.canvas.textblock: allow all white spaces in style string not just space

Summary:
style string can contain any kind of white spaces and it will be fine

For example
```
"font=sans font_size=30 color=red "
```
Is the same as
```
"font=sans\tfont_size=30\n  color=red "
```

Reviewers: woohyun, segfaultxavi, tasn, zmike

Reviewed By: segfaultxavi

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8532

Differential Revision: https://phab.enlightenment.org/D11303
---
 src/lib/evas/canvas/evas_object_textblock.c | 52 +
 src/tests/evas/evas_test_textblock.c| 10 ++
 2 files changed, 49 insertions(+), 13 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 22924df7f9..dc0b1124fe 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -1317,8 +1317,6 @@ static const Escape_Value escape_values_v_common_sorted[] 
= {
ESCAPE_VALUE("", "\x3e"),
 };
 
-
-
 /**
  * @internal
  * Checks if a char is a whitespace.
@@ -3283,6 +3281,22 @@ _format_is_param(const char *item)
return EINA_FALSE;
 }
 
+/**
+ * @internal
+ * Returns first occurrence of whitespace character
+ * otherwise return NULL.
+ *
+ * @param[in] string to search.
+ */
+static const char*
+_strchr_whitespace(const char* str)
+{
+   if (!str) return NULL;
+   while (*str && !isspace(*str)) str++;
+   if(*str) return str;
+   return NULL;
+}
+
 /**
  * @internal
  * Parse the format item and populate key and val with the stringshares that
@@ -3307,7 +3321,7 @@ _format_param_parse(const char *item, const char **key, 
char **val, Allocator *a
start++; /* Advance after the '=' */
/* If we can find a quote as the first non-space char,
 * our new delimiter is a quote, not a space. */
-   while (*start == ' ')
+   while (isspace(*start))
   start++;
 
if (*start == '\'')
@@ -3319,9 +,9 @@ _format_param_parse(const char *item, const char **key, 
char **val, Allocator *a
  }
else
  {
-end = strchr(start, ' ');
+end = _strchr_whitespace(start);
 while ((end) && (end > start) && (end[-1] == '\\'))
-  end = strchr(end + 1, ' ');
+  end = _strchr_whitespace(end + 1);
  }
 
/* Null terminate before the spaces */
@@ -3355,7 +3369,7 @@ end:
  * @return the current item parsed from the string.
  */
 static const char *
-_format_parse(const char **s)
+_format_parse(const char **s, Eina_Bool all_whitespaces)
 {
const char *p;
const char *s1 = NULL, *s2 = NULL;
@@ -3367,7 +3381,13 @@ _format_parse(const char **s)
  {
 if (!s1)
   {
- if (*p != ' ') s1 = p;
+ if (all_whitespaces)
+   {
+  if (!isspace(*p))
+s1 = p;
+   }
+ else if(*p != ' ')
+   s1 = p;
  if (*p == 0) break;
   }
 else if (!s2)
@@ -3379,7 +3399,13 @@ _format_parse(const char **s)
 
  if ((p > *s) && (p[-1] != '\\') && (!quote))
{
-  if (*p == ' ') s2 = p;
+  if (all_whitespaces)
+  {
+ if (isspace(*p))
+   s2 = p;
+  }
+  else if(*p == ' ')
+s2 = p;
}
  if (*p == 0) s2 = p;
   }
@@ -3415,12 +3441,12 @@ _format_fill(Evas_Object *eo_obj, 
Evas_Object_Textblock_Format *fmt, const char
s = str;
 
/* get rid of any spaces at the start of the string */
-   while (*s == ' ') s++;
+   while (isspace(*s)) s++;
 
Allocator allocator;
_allocator_init();
 
-   while ((item = _format_parse()))
+   while ((item = _format_parse(, EINA_TRUE)))
  {
 const char *key = NULL;
 char *val = NULL;
@@ -5719,7 +5745,7 @@ _layout_do_format(const Evas_Object *obj, Ctxt *c,
   {
  fmt = _layout_format_pop(c, n->orig_format);
   }
-while ((item = _format_parse()))
+while ((item = _format_parse(, EINA_FALSE)))
   {
  if (_format_is_param(item))
{
@@ -10731,7 +10757,7 @@ 
_evas_textblock_format_is_visible(Evas_Object_Textblock_Node_Format *fnode,
 fnode->format_change = EINA_TRUE;
  }
 
-   while ((item = _format_parse()))
+   while ((item = _format_parse(, EINA_FALSE)))
  {
 int itlen = s - item;

[EGIT] [core/efl] master 01/01: efl.ui.textbox: prevent longpress + right click from working on scrollbars

2020-02-07 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6ce2698bb5b9051bc72adf776125a414c4908bea

commit 6ce2698bb5b9051bc72adf776125a414c4908bea
Author: Ali Alzyod 
Date:   Fri Feb 7 14:15:20 2020 +0100

efl.ui.textbox: prevent longpress + right click from working on scrollbars

summary_: Longpress and right click one textbox scrollbars will not show up 
the menu.

Reviewers: woohyun, bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8604

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11295
---
 src/lib/elementary/efl_ui_textbox.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 936471c643..a53c265d38 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -1049,11 +1049,31 @@ _menu_call(Evas_Object *obj)
  }
 }
 
+static Eina_Bool
+_is_pointer_inside_viewport(Eo *textbox,Efl_Ui_Textbox_Data *sd)
+{
+   if (sd->scroller)
+ {
+Eo *top = efl_provider_find(textbox, EFL_UI_WIN_CLASS);
+Eina_Position2D pos = {0};
+if (efl_canvas_scene_pointer_position_get(top, NULL, ))
+  {
+ Eina_Rect rc = 
efl_ui_scrollable_viewport_geometry_get(sd->scroller);
+ if (!eina_rectangle_coords_inside(, pos.x, pos.y))
+   return EINA_FALSE;
+  }
+ }
+   return EINA_TRUE;
+}
+
 static void
 _long_press_cb(void *data, const Efl_Event *ev EINA_UNUSED)
 {
EFL_UI_TEXT_DATA_GET(data, sd);
 
+   if (!_is_pointer_inside_viewport(data, sd))
+ return;
+
/* Context menu will not appear if context menu disabled is set
 * as false on a long press callback */
if (!_elm_config->context_menu_disabled &&
@@ -1122,6 +1142,8 @@ _mouse_down_cb(void *data, const Efl_Event *event)
  {
 if (_elm_config->desktop_entry)
   {
+ if (!_is_pointer_inside_viewport(data, sd))
+   return;
  sd->use_down = 1;
  _menu_call(data);
   }

-- 




[EGIT] [core/efl] master 01/01: efl.canvas.textblock: update style strings

2020-02-04 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ba99891710a558412f0962f79993a5b9651eae59

commit ba99891710a558412f0962f79993a5b9651eae59
Author: Ali Alzyod 
Date:   Tue Feb 4 17:45:32 2020 +0100

efl.canvas.textblock: update style strings

Summary:
Update

backing -> background_type
backing_color -> background_color
underline_dash_color -> underline_dashed_color
underline - > underline_type
strikethrough - > strikethrough_type
style -> (effect_type + shadow_direction)
underline_dash_width -> underline_dashed_width
underline_dashed_gap -> underline_dashed_gap

**+prevent unified APIs from supporting legacy style tags, and prevent 
legacy APIs from the ability to use new unified tags**

Reviewers: zmike, woohyun, segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi, bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8523

Differential Revision: https://phab.enlightenment.org/D11188
---
 src/lib/evas/canvas/efl_canvas_textblock.eo |   65 +-
 src/lib/evas/canvas/evas_object_textblock.c | 1729 +++
 src/tests/evas/evas_test_textblock.c|   26 +-
 3 files changed, 1009 insertions(+), 811 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo 
b/src/lib/evas/canvas/efl_canvas_textblock.eo
index 2ecfd7bd8d..7d20786c5f 100644
--- a/src/lib/evas/canvas/efl_canvas_textblock.eo
+++ b/src/lib/evas/canvas/efl_canvas_textblock.eo
@@ -137,47 +137,47 @@ class @beta Efl.Canvas.Textblock extends 
Efl.Canvas.Object implements Efl.Text,
 
- $underline_color: Color code for the text underline (See bottom 
for the complete list of supported codes).
  Default value is $[rgba(0,0,0,0)] meaning that no underline will 
be rendered.
- Requires $underline.
+ Requires $underline_type.
  See @Efl.Text_Style.text_underline_color.
 
- $secondary_underline_color: Color code for the secondary text 
underline (See bottom for the complete list
- of supported codes). Only valid when $[underline=double].
+ of supported codes). Only valid when $[underline_type=double].
  Default value is $[rgba(0,0,0,0)] meaning that secondary 
underline will not be rendered.
  See @Efl.Text_Style.text_secondary_underline_color.
 
-   - $underline_dash_color: Color code for the dashed underline (See 
bottom for the complete list of supported
- codes). Only valid when $[underline=dashed].
+   - $underline_dashed_color: Color code for the dashed underline (See 
bottom for the complete list of supported
+ codes). Only valid when $[underline_type=dashed].
  Default value is $[rgba(0,0,0,0)] meaning that dashed underline 
will not be rendered.
  See @Efl.Text_Style.text_underline_dashed_color.
 
- $outline_color: Color code for the text outline (See bottom for 
the complete list of supported codes).
- Only valid when the $style attribute includes an outline.
+ Only valid when the $effect_type attribute includes an outline.
  Default value is $[rgba(0,0,0,0)] meaning that no outline will be 
rendered.
  See @Efl.Text_Style.text_outline_color.
 
- $shadow_color: Color code for the text shadow (See bottom for the 
complete list of supported codes).
- Only valid when the $style attribute includes a shadow.
+ Only valid when the $effect_type attribute includes a shadow.
  Default value is $[rgba(0,0,0,0)] meaning that no shadow will be 
rendered.
  See @Efl.Text_Style.text_shadow_color.
 
- $glow_color: Color code for the glow component of the text (See 
bottom for the complete list of supported
- codes). Only valid when the $style attribute includes a glow.
+ codes). Only valid when the $effect_type attribute includes a 
glow.
  Default value is $[rgba(0,0,0,0)] meaning that no glow will be 
rendered.
  See @Efl.Text_Style.text_glow_color.
 
- $secondary_glow_color: Color code for the secondary (inner) glow 
component of the text (See bottom for
- the complete list of supported codes). Only valid when the $style 
attribute includes a glow.
+ the complete list of supported codes). Only valid when the 
$effect_type attribute includes a glow.
  Default value is $[rgba(0,0,0,0)] meaning that only the primary 
$glow_color will be used.
  See @Efl.Text_Style.text_secondary_glow_color.
 
-   - $backing_color: Color code for the background of the text (See 
bottom for the complete list of supported
+   - $background_color: Color code for the background of the text (See 
bott

[EGIT] [core/efl] master 03/03: efl.ui.textbox: add and use keyboard bindings

2020-02-04 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a92f8c210bb6d224300a069fce5d7f65f0a8e059

commit a92f8c210bb6d224300a069fce5d7f65f0a8e059
Author: Ali Alzyod 
Date:   Sun Feb 2 14:07:45 2020 +

efl.ui.textbox: add and use keyboard bindings

As other widgets, efl.ui.textbox will use keyboard bindings instead of 
listen to keyboard events

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11236
---
 data/elementary/config/default/base.src.in  | 53 +-
 data/elementary/config/mobile/base.src.in   | 53 +-
 data/elementary/config/standard/base.src.in | 53 +-
 src/lib/elementary/efl_ui_textbox.c | 86 +++--
 src/lib/elementary/efl_ui_textbox.eo|  1 +
 src/lib/elementary/elm_config.c |  6 ++
 src/lib/elementary/elm_priv.h   |  2 +-
 7 files changed, 203 insertions(+), 51 deletions(-)

diff --git a/data/elementary/config/default/base.src.in 
b/data/elementary/config/default/base.src.in
index 2b8828967b..d45a704b5a 100644
--- a/data/elementary/config/default/base.src.in
+++ b/data/elementary/config/default/base.src.in
@@ -1,5 +1,5 @@
 group "Elm_Config" struct {
-  value "config_version" int: 131094;
+  value "config_version" int: 131095;
   value "entry_select_allow" uchar: 1;
   value "engine" string: "";
   value "vsync" uchar: 0;
@@ -3275,7 +3275,54 @@ group "Elm_Config" struct {
   value "action" string: "move";
   value "params" string: "next";
}
-  }
-}
+   }
+ }
+ group "Elm_Config_Bindings_Widget" struct {
+value "name" string: "Efl.Ui.Textbox";
+group "key_bindings" list {
+   group "Elm_Config_Binding_Key" struct {
+  value "context" int: 0;
+  value "key" string: "c";
+  value "action" string: "copy";
+  value "params" string: "";
+  group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+value "mod" string: "Control";
+value "flag" uchar: 1;
+ }
+  }
+   }
+   group "Elm_Config_Binding_Key" struct {
+  value "context" int: 0;
+  value "key" string: "x";
+  value "action" string: "cut";
+  value "params" string: "";
+  group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+value "mod" string: "Control";
+value "flag" uchar: 1;
+ }
+  }
+   }
+   group "Elm_Config_Binding_Key" struct {
+  value "context" int: 0;
+  value "key" string: "v";
+  value "action" string: "paste";
+  value "params" string: "";
+  group "modifiers" list {
+ group "Elm_Config_Binding_Modifier" struct {
+value "mod" string: "Control";
+value "flag" uchar: 1;
+ }
+  }
+   }
+   group "Elm_Config_Binding_Key" struct {
+  value "context" int: 0;
+  value "key" string: "menu";
+  value "action" string: "menu";
+  value "params" string: "";
+   }
+}
+ }
   }
 }
diff --git a/data/elementary/config/mobile/base.src.in 
b/data/elementary/config/mobile/base.src.in
index 9077d3bf8d..0883545e21 100644
--- a/data/elementary/config/mobile/base.src.in
+++ b/data/elementary/config/mobile/base.src.in
@@ -1,5 +1,5 @@
 group "Elm_Config" struct {
-  value "config_version" int: 131094;
+  value "config_version" int: 131095;
   value "entry_select_allow" uchar: 1;
   value "engine" string: "";
   value "vsync" uchar: 0;
@@ -3261,7 +3261,54 @@ group "Elm_Config" struct {
   value "action" string: "move";
   value "params" string: "next";
}
-  }
-}
+   }
+ }
+ group "Elm_Config_Bindings_Widget" struct {
+value "name" string: "Efl.Ui.Textbox";
+  

[EGIT] [core/efl] master 01/01: efll.ui.internal_text_interactive: remove useless condition

2020-01-29 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fc0c60ca8ca588624060d3298be53fa5bdf917b7

commit fc0c60ca8ca588624060d3298be53fa5bdf917b7
Author: Ali Alzyod 
Date:   Wed Jan 29 19:30:39 2020 +0100

efll.ui.internal_text_interactive: remove useless condition

Summary: Remove useless condition and unreachable return value

Reviewers: woohyun, segfaultxavi, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11231
---
 .../elementary/efl_ui_internal_text_interactive.c  | 22 +-
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 146deb7de5..fc43e6fbe9 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -349,6 +349,9 @@ _text_filter_text_prepend(Efl_Canvas_Textblock *obj, 
Efl_Ui_Internal_Text_Intera
   const char *fmtpre, const char *fmtpost,
   Eina_Bool clearsel, Eina_Bool changeinfo)
 {
+   char *markup_text;
+   Efl_Text_Change_Info *info = NULL;
+
EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL);
 
if ((clearsel) && (en->have_selection))
@@ -356,19 +359,12 @@ _text_filter_text_prepend(Efl_Canvas_Textblock *obj, 
Efl_Ui_Internal_Text_Intera
 _sel_range_del_emit(obj, en);
  }
 
-   if (text)
- {
-char *markup_text;
-Efl_Text_Change_Info *info = NULL;
-
-markup_text = evas_textblock_text_utf8_to_markup(NULL, text);
-if (markup_text)
-  info = _text_filter_markup_prepend_internal(obj, en, c, markup_text,
-  fmtpre, fmtpost,
-  clearsel, changeinfo);
-return info;
- }
-   return NULL;
+   markup_text = evas_textblock_text_utf8_to_markup(NULL, text);
+   if (markup_text)
+ info = _text_filter_markup_prepend_internal(obj, en, c, markup_text,
+ fmtpre, fmtpost,
+ clearsel, changeinfo);
+   return info;
 }
 
 static void

-- 




[EGIT] [core/efl] master 01/01: config: replace evil tabs with spaces

2020-01-29 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fab12448a40da71dc9fe01f5c32a472da45b9632

commit fab12448a40da71dc9fe01f5c32a472da45b9632
Author: Ali Alzyod 
Date:   Wed Jan 29 16:34:27 2020 +0100

config: replace evil tabs with spaces

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11232
---
 data/elementary/config/default/base.src.in  | 4 ++--
 data/elementary/config/mobile/base.src.in   | 4 ++--
 data/elementary/config/standard/base.src.in | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/data/elementary/config/default/base.src.in 
b/data/elementary/config/default/base.src.in
index c39aeeed70..2b8828967b 100644
--- a/data/elementary/config/default/base.src.in
+++ b/data/elementary/config/default/base.src.in
@@ -3275,7 +3275,7 @@ group "Elm_Config" struct {
   value "action" string: "move";
   value "params" string: "next";
}
-   }
-}
+  }
+}
   }
 }
diff --git a/data/elementary/config/mobile/base.src.in 
b/data/elementary/config/mobile/base.src.in
index 520ba90d73..9077d3bf8d 100644
--- a/data/elementary/config/mobile/base.src.in
+++ b/data/elementary/config/mobile/base.src.in
@@ -3261,7 +3261,7 @@ group "Elm_Config" struct {
   value "action" string: "move";
   value "params" string: "next";
}
-   }
-}
+  }
+}
   }
 }
diff --git a/data/elementary/config/standard/base.src.in 
b/data/elementary/config/standard/base.src.in
index 0aa4e8f017..a64711b376 100644
--- a/data/elementary/config/standard/base.src.in
+++ b/data/elementary/config/standard/base.src.in
@@ -3258,7 +3258,7 @@ group "Elm_Config" struct {
   value "action" string: "move";
   value "params" string: "next";
}
-   }
-}
+  }
+}
   }
 }

-- 




[EGIT] [core/efl] master 01/03: efl.ui.textbox: clean up all evas_object related functions from stable methods/interfaces

2020-01-29 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d53f83571a6f817343140b6e6fc6c18e1e111aaa

commit d53f83571a6f817343140b6e6fc6c18e1e111aaa
Author: Ali Alzyod 
Date:   Tue Jan 28 16:54:32 2020 +

efl.ui.textbox: clean up all evas_object related functions from stable 
methods/interfaces

This patch will:
- Replace all Evas callbacks with unified ones.
- Replace evas_object* methods with unified ones (For **stabilized** 
methods and interfaces)

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11217
---
 src/lib/elementary/efl_ui_textbox.c | 304 
 1 file changed, 135 insertions(+), 169 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 0976e81616..aa39ff5b16 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -125,7 +125,7 @@ struct _Anchor
   if (EINA_UNLIKELY(!ptr))   \
 {\
ERR("No widget data for object %p (%s)",  \
-   o, evas_object_type_get(o));  \
+   o, efl_class_name_get(o));  \
return;   \
 }
 
@@ -134,7 +134,7 @@ struct _Anchor
   if (EINA_UNLIKELY(!ptr))\
 { \
ERR("No widget data for object %p (%s)",   \
-   o, evas_object_type_get(o));   \
+   o, efl_class_name_get(o));   \
return val;\
 }
 
@@ -197,7 +197,7 @@ static void _efl_ui_textbox_cursor_changed_cb(void *data, 
const Efl_Event *event
 static void _text_size_changed_cb(void *data, const Efl_Event *event 
EINA_UNUSED);
 static void _scroller_size_changed_cb(void *data, const Efl_Event *event 
EINA_UNUSED);
 static void _text_position_changed_cb(void *data, const Efl_Event *event 
EINA_UNUSED);
-static void _efl_ui_textbox_move_cb(void *data, Evas *e, Evas_Object *obj, 
void *event_info);
+static void _efl_ui_textbox_move_cb(void *data, const Efl_Event *event 
EINA_UNUSED);
 static const char* _efl_ui_textbox_selection_get(const Eo *obj, 
Efl_Ui_Textbox_Data *sd);
 static void _edje_signal_emit(Efl_Ui_Textbox_Data *obj, const char *sig, const 
char *src);
 static void _decoration_defer_all(Eo *obj);
@@ -276,10 +276,8 @@ _viewport_region_get(Evas_Object *obj)
  {
 if (efl_isa(parent, EFL_UI_SCROLLABLE_INTERFACE))
   {
- Eina_Rectangle r;
- EINA_RECTANGLE_SET(, 0, 0, 0, 0);
- evas_object_geometry_get(parent, , , , );
- if (!eina_rectangle_intersection(, ))
+ Eina_Rect r = efl_gfx_entity_geometry_get(parent);
+ if (!eina_rectangle_intersection(, ))
{
   rect = EINA_RECT_EMPTY();
   break;
@@ -329,7 +327,7 @@ _update_selection_handler(Eo *obj)
 off = _decoration_calc_offset(sd);
 hx = off.x + sx;
 hy = off.y + sy + sh;
-evas_object_move(sd->start_handler, hx, hy);
+efl_gfx_entity_position_set(sd->start_handler, EINA_POSITION2D(hx, 
hy));
 
 rect = _viewport_region_get(obj);
 
@@ -359,7 +357,7 @@ _update_selection_handler(Eo *obj)
 
 hx = off.x + ex;
 hy = off.y + ey + eh;
-evas_object_move(sd->end_handler, hx, hy);
+efl_gfx_entity_position_set(sd->end_handler, EINA_POSITION2D(hx, hy));
 
 if (!eina_rectangle_xcoord_inside(, hx) ||
 !eina_rectangle_ycoord_inside(, hy))
@@ -450,14 +448,14 @@ _dnd_pos_cb(void *data EINA_UNUSED,
 Elm_Xdnd_Action action EINA_UNUSED)
 {
int pos;
-   Evas_Coord ox, oy, ex, ey;
+   Eina_Rect o, e;
 
EFL_UI_TEXT_DATA_GET(obj, sd);
 
-   evas_object_geometry_get(obj, , , NULL, NULL);
-   evas_object_geometry_get(sd->entry_edje, , , NULL, NULL);
-   x = x + ox - ex;
-   y = y + oy - ey;
+   o = efl_gfx_entity_geometry_get(obj);
+   e = efl_gfx_entity_geometry_get(sd->entry_edje);
+   x = x + o.x - e.x;
+   y = y + o.y - e.y;
 
edje_object_part_text_cursor_coord_set
   (sd->entry_edje, "efl.text", EDJE_CURSOR_USER, x, y);
@@ -570,7 +568,7 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
 
efl_layout_signal_process(sd->entry_edje, EINA_FALSE);
 
-   Evas_Object* clip = evas_object_clip_get(sd->entry_edje);
+   Evas_Object* clip = efl_canvas_object_clipper_get(sd->entry_edje);
efl_canvas_object_clipper_set(sd->hit_rect, clip);
 
if (sd->start_handler)
@@ -604,16 +602,12 @@ _cursor_geometry_recalc(Evas_Object *obj)
 {
EFL_UI_TEXT_DATA_GET(obj, sd);
 
-   Evas_Coord x, y, w, h;
-   Evas_Coord x2, y2, w2, h2;
Evas_Coord cx, cy, cw, ch;
Eina_

[EGIT] [core/efl] master 03/03: efl.ui.textbox: replace strncmp with strcmp for Part

2020-01-29 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d6094b799584aa0d321c28f9115eddc3515c329a

commit d6094b799584aa0d321c28f9115eddc3515c329a
Author: Ali Alzyod 
Date:   Tue Jan 28 17:04:51 2020 +

efl.ui.textbox: replace strncmp with strcmp for Part

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11218
---
 src/lib/elementary/efl_ui_textbox.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 420056d990..705ac1bef4 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -3283,18 +3283,18 @@ _efl_ui_textbox_item_factory_get(const Eo *obj 
EINA_UNUSED, Efl_Ui_Textbox_Data
 
 /* Efl.Part begin */
 
-#define STRCMP(X, Y) strncmp((X), (Y), strlen(X))
-
 static Eina_Bool
 _efl_ui_textbox_text_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd,
   const char *part, const char *text)
 {
-   if (!STRCMP("efl.text_guide", part))
+   if (!part) return EINA_FALSE;
+
+   if (!strcmp("efl.text_guide", part))
  {
 efl_text_set(pd->text_guide_obj, text);
 return EINA_TRUE;
  }
-   else if (!STRCMP("efl.text", part))
+   else if (!strcmp("efl.text", part))
  {
 efl_text_set(pd->text_obj, text);
 return EINA_TRUE;
@@ -3307,11 +3307,13 @@ static const char *
 _efl_ui_textbox_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd,
   const char *part)
 {
-   if (!STRCMP("efl.text_guide", part))
+   if (!part) return EINA_FALSE;
+
+   if (!strcmp("efl.text_guide", part))
  {
 return efl_text_get(pd->text_guide_obj);
  }
-   else if (!STRCMP("efl.text", part))
+   else if (!strcmp("efl.text", part))
  {
 return efl_text_get(pd->text_obj);
  }
@@ -3319,8 +3321,6 @@ _efl_ui_textbox_text_get(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *pd,
return NULL;
 }
 
-#undef STRCMP
-
 static Eina_Bool
 _part_is_efl_ui_textbox_part(const Eo *obj EINA_UNUSED, const char *part)
 {

-- 




[EGIT] [core/efl] master 02/03: efl.ui.textbox: replace ecore_job with Efl_Future

2020-01-29 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=64232138ef9eb928e1c9c1285c1bcf591ad536af

commit 64232138ef9eb928e1c9c1285c1bcf591ad536af
Author: Ali Alzyod 
Date:   Tue Jan 28 16:36:52 2020 +

efl.ui.textbox: replace ecore_job with Efl_Future

This patch will replace the use of ecore_job with Efl_Future

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11216
---
 src/lib/elementary/efl_ui_textbox.c | 25 +++--
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index aa39ff5b16..420056d990 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -43,7 +43,7 @@ struct _Efl_Ui_Textbox_Data
Eo   *cursor_bidi;
Evas_Object  *start_handler;
Evas_Object  *end_handler;
-   Ecore_Job*deferred_decoration_job;
+   Eina_Future  *deferred_decoration_job;
/* for deferred appending */
int   append_text_position;
int   append_text_len;
@@ -1735,7 +1735,6 @@ _efl_ui_textbox_efl_object_destructor(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
 
entries = eina_list_remove(entries, obj);
eina_stringshare_del(sd->text);
-   ecore_job_del(sd->deferred_decoration_job);
eina_stringshare_del(sd->anchor_hover.hover_style);
 
efl_event_thaw(obj);
@@ -1749,9 +1748,6 @@ _efl_ui_textbox_efl_object_destructor(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
_anchors_free(sd);
_clear_text_selection(sd);
 
-   ecore_job_del(sd->deferred_decoration_job);
-   sd->deferred_decoration_job = NULL;
-
if (sd->item_factory) efl_unref(sd->item_factory);
 
efl_destructor(efl_super(obj, MY_CLASS));
@@ -3136,23 +3132,24 @@ _update_decorations(Eo *obj)
efl_event_thaw(sd->text_obj);
 }
 
-static void
-_deferred_decoration_job(void *data)
+static Eina_Value
+_deferred_decoration_job(Eo *o, void *data EINA_UNUSED, const Eina_Value value 
EINA_UNUSED)
 {
-   EFL_UI_TEXT_DATA_GET(data, sd);
-   _update_decorations(data);
+   EFL_UI_TEXT_DATA_GET(o, sd);
+   _update_decorations(o);
sd->deferred_decoration_job = NULL;
+
+   return EINA_VALUE_EMPTY;
 }
 
 static void
 _decoration_defer(Eo *obj)
 {
EFL_UI_TEXT_DATA_GET(obj, sd);
-   if (!sd->deferred_decoration_job)
- {
-sd->deferred_decoration_job = 
-   ecore_job_add(_deferred_decoration_job, obj);
- }
+   if (sd->deferred_decoration_job) return;
+
+   Eina_Future *f = efl_loop_job(efl_main_loop_get());
+   sd->deferred_decoration_job = efl_future_then(obj, f, 
_deferred_decoration_job);
 }
 
 static void

-- 




[EGIT] [core/efl] master 01/01: efl.canvas.textblock: annotate obstacle methods as beta

2020-01-23 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=932ea7a70e41035273e75077142ba2b706d59a16

commit 932ea7a70e41035273e75077142ba2b706d59a16
Author: Ali Alzyod 
Date:   Thu Jan 23 12:31:57 2020 +0100

efl.canvas.textblock: annotate obstacle methods as beta

Summary:
We decided to annotate these methods as beta

**obstacle_add**
**obstacle_del**
**obstacles_update**

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8460

Differential Revision: https://phab.enlightenment.org/D11136
---
 src/lib/evas/canvas/efl_canvas_textblock.eo | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo 
b/src/lib/evas/canvas/efl_canvas_textblock.eo
index 8e9bee7dba..2ecfd7bd8d 100644
--- a/src/lib/evas/canvas/efl_canvas_textblock.eo
+++ b/src/lib/evas/canvas/efl_canvas_textblock.eo
@@ -388,7 +388,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
  }
   }
   // Obstacles
-  obstacle_add {
+  obstacle_add @beta {
  [[Add obstacle object $eo_obs to be avoided during layout
of text.
 
@@ -400,7 +400,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
  }
  return: bool; [[$true on success.]]
   }
-  obstacle_del {
+  obstacle_del @beta {
  [[Removes $eo_obs from observation during text layout.
  ]]
  params {
@@ -408,7 +408,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
  }
  return: bool; [[$true on success.]]
   }
-  obstacles_update {
+  obstacles_update @beta {
  [[Triggers for relayout due to obstacles' state change.
 
The obstacles alone don't affect the layout, until this is

-- 




[EGIT] [core/efl] master 01/01: efl.ui.textbox: move file implementation in to internal class

2020-01-23 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=279f2eca06f79b3e752bbd2c82687873ea7151b5

commit 279f2eca06f79b3e752bbd2c82687873ea7151b5
Author: Ali Alzyod 
Date:   Thu Jan 23 08:54:11 2020 +

efl.ui.textbox: move file implementation in to internal class

We want to keep implementation for file interface in a safe place and 
remove it from our side world (eo).

This is a simple copy-paste, from efl.ui.textbox into 
efl_ui_internal_text_interactive

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11153
---
 .../elementary/efl_ui_internal_text_interactive.c  | 160 +
 .../elementary/efl_ui_internal_text_interactive.eo |   7 +-
 src/lib/elementary/efl_ui_textbox.c| 152 
 src/lib/elementary/efl_ui_textbox.eo   |   8 +-
 4 files changed, 167 insertions(+), 160 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 63b722cfea..146deb7de5 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -20,12 +20,15 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data
Ecore_Timer   *pw_timer;
Eina_List *seq;
char  *selection;
+   const char*file;
+   Elm_Text_Formatformat;
Eina_Bool  composing : 1;
Eina_Bool  selecting : 1;
Eina_Bool  have_selection : 1;
Eina_Bool  select_allow : 1;
Eina_Bool  editable : 1;
Eina_Bool  had_sel : 1;
+   Eina_Bool  auto_save : 1;
Eina_Bool  prediction_allow : 1;
Eina_Bool  anchors_updated : 1;
Eina_Bool  auto_return_key : 1;
@@ -1812,6 +1815,14 @@ 
_efl_ui_internal_text_interactive_efl_object_constructor(Eo *obj, Efl_Ui_Interna
return obj;
 }
 
+EOLIAN static void
+_efl_ui_internal_text_interactive_efl_object_destructor(Eo *obj, 
Efl_Ui_Internal_Text_Interactive_Data *sd)
+{
+   eina_stringshare_del(sd->file);
+   sd->file = NULL;
+   efl_destructor(efl_super(obj, MY_CLASS));
+}
+
 EOLIAN static Efl_Object *
 _efl_ui_internal_text_interactive_efl_object_finalize(Eo *obj, 
Efl_Ui_Internal_Text_Interactive_Data *en)
 {
@@ -2315,5 +2326,154 @@ 
_efl_ui_internal_text_interactive_efl_input_text_autocapitalization_get(const Eo
 #endif
 }
 
+
+static char *
+_file_load(Eo *obj)
+{
+   Eina_File *f;
+   char *text = NULL;
+   void *tmp = NULL;
+
+   f = eina_file_dup(efl_file_mmap_get(obj));
+
+   tmp = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
+   if (!tmp) goto on_error;
+
+   text = malloc(eina_file_size_get(f) + 1);
+   if (!text) goto on_error;
+
+   memcpy(text, tmp, eina_file_size_get(f));
+   text[eina_file_size_get(f)] = 0;
+
+   if (eina_file_map_faulted(f, tmp))
+ {
+ELM_SAFE_FREE(text, free);
+ }
+
+ on_error:
+   if (tmp) eina_file_map_free(f, tmp);
+   eina_file_close(f);
+
+   return text;
+}
+
+static char *
+_plain_load(Eo *obj)
+{
+   return _file_load(obj);
+}
+
+static Eina_Error
+_load_do(Evas_Object *obj)
+{
+   char *text;
+   Eina_Error err = 0;
+
+   Efl_Ui_Internal_Text_Interactive_Data * sd = efl_data_scope_get(obj, 
MY_CLASS);
+
+   if (!sd->file)
+ {
+efl_text_set(obj, "");
+return 0;
+ }
+
+   switch (sd->format)
+ {
+  /* Only available format */
+  case ELM_TEXT_FORMAT_PLAIN_UTF8:
+ text = _plain_load(obj);
+ if (!text)
+   {
+  err = errno;
+  if (!err) err = ENOENT;
+   }
+ break;
+
+  default:
+ text = NULL;
+ break;
+ }
+
+   if (text)
+ {
+efl_text_set(obj, text);
+free(text);
+return 0;
+ }
+   efl_text_set(obj, "");
+   return err;
+}
+
+static void
+_text_save(const char *file,
+   const char *text)
+{
+   FILE *f;
+
+   if (!text)
+ {
+ecore_file_unlink(file);
+return;
+ }
+
+   f = fopen(file, "wb");
+   if (!f)
+ {
+ERR("Failed to open %s for writing", file);
+return;
+ }
+
+   if (fputs(text, f) == EOF)
+ ERR("Failed to write text to file %s", file);
+   fclose(f);
+}
+
+static void
+_save_do(Evas_Object *obj)
+{
+   Efl_Ui_Internal_Text_Interactive_Data * sd = efl_data_scope_get(obj, 
MY_CLASS);
+
+   if (!sd->file) return;
+   switch (sd->format)
+ {
+  /* Only supported format */
+  case ELM_TEXT_FORMAT_PLAIN_UTF8:
+_t

[EGIT] [core/efl] master 01/01: efl_text_interactive: selection enhancment

2020-01-23 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4cdd5505e957c6cdf6ac0f6f99cda3295ab23bc1

commit 4cdd5505e957c6cdf6ac0f6f99cda3295ab23bc1
Author: Ali Alzyod 
Date:   Wed Jan 22 07:33:58 2020 +

efl_text_interactive: selection enhancment

1- Implement setting selection range programmatically by modifying 
selection cursors from **efl_text_interactive_selection_cursors_get**
2- Add setter with **efl_text_interactive_selection_cursors_set** to set 
the range at once (modify start and end)

Reviewed-by: Marcel Hollerbach 
Reviewed-by: WooHyun Jung 
Differential Revision: https://phab.enlightenment.org/D10968
---
 src/lib/elementary/efl_text_interactive.eo |  14 +-
 .../elementary/efl_ui_internal_text_interactive.c  | 154 +
 .../elementary/efl_ui_internal_text_interactive.eo |   2 +-
 src/tests/elementary/efl_ui_test_text.c|  39 ++
 4 files changed, 176 insertions(+), 33 deletions(-)

diff --git a/src/lib/elementary/efl_text_interactive.eo 
b/src/lib/elementary/efl_text_interactive.eo
index f090648bf3..cc15cdc15b 100644
--- a/src/lib/elementary/efl_text_interactive.eo
+++ b/src/lib/elementary/efl_text_interactive.eo
@@ -25,13 +25,17 @@ interface @beta Efl.Text_Interactive extends Efl.Text, 
Efl.Text_Font_Properties,
   }
   @property selection_cursors {
  [[The cursors used for selection handling.
-
If the cursors are equal there's no selection.
-
-   You are allowed to retain and modify them. Modifying them modifies
-   the selection of the object.
  ]]
- get {}
+ get {
+[[You are allowed to retain and modify them. Modifying them 
modifies
+  the selection of the object (recommended to extend selection 
range).]]
+ }
+ set {
+   [[The positions of passed cursors will be used to set selection 
cursors positions.
+ Further modification for passed @Efl.Text.Cursor objects, will 
not affect selection.
+ Setter is recommended to set new range for selection.]]
+ }
  values {
 start: Efl.Text.Cursor; [[The start of the selection.]]
 end: Efl.Text.Cursor; [[The end of the selection.]]
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index dd9f8a41f8..63b722cfea 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -14,6 +14,7 @@
 typedef struct _Efl_Ui_Internal_Text_Interactive_Data
 {
Efl_Text_Cursor   *sel_start, *sel_end;
+   Eina_Bool  watch_selection;
Efl_Text_Cursor   *main_cursor;
Efl_Text_Cursor   *preedit_start, *preedit_end;
Ecore_Timer   *pw_timer;
@@ -44,13 +45,17 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data
 } Efl_Ui_Internal_Text_Interactive_Data;
 
 static void _sel_range_del_emit(Evas_Object *obj, 
Efl_Ui_Internal_Text_Interactive_Data *en);
-static void _sel_init(Efl_Text_Cursor *c, Evas_Object *o, 
Efl_Ui_Internal_Text_Interactive_Data *en);
-static void _sel_enable(Efl_Text_Cursor *c EINA_UNUSED, Evas_Object *o 
EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en);
+static void _sel_init(Efl_Text_Cursor *c, 
Efl_Ui_Internal_Text_Interactive_Data *en);
+static void _sel_enable(Evas_Object *o,Efl_Ui_Internal_Text_Interactive_Data 
*en);
 static void _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, 
Efl_Ui_Internal_Text_Interactive_Data *en);
 static void _sel_clear(Evas_Object *o EINA_UNUSED, 
Efl_Ui_Internal_Text_Interactive_Data *en);
+static void _emit_sel_state( Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en);
 static const char *_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, 
Efl_Ui_Internal_Text_Interactive_Data *en);
 static void _entry_imf_cursor_info_set(Efl_Ui_Internal_Text_Interactive_Data 
*en);
 
+static void _sel_watch_freeze(Efl_Ui_Internal_Text_Interactive_Data *en);
+static void _sel_watch_thaw(Efl_Ui_Internal_Text_Interactive_Data *en);
+
 static void
 _text_filter_format_prepend(Efl_Canvas_Textblock *obj, 
Efl_Ui_Internal_Text_Interactive_Data *en,
 Efl_Text_Cursor *c, const char *text);
@@ -82,6 +87,18 @@ _cur_pos_copy(Efl_Text_Cursor *src, Efl_Text_Cursor *dest)
efl_text_cursor_position_set(dest, efl_text_cursor_position_get(src));
 }
 
+static void
+_sel_watch_freeze(Efl_Ui_Internal_Text_Interactive_Data *en)
+{
+   en->watch_selection = EINA_FALSE;
+}
+
+static void
+_sel_watch_thaw(Efl_Ui_Internal_Text_Interactive_Data *en)
+{
+   en->watch_selection = EINA_TRUE;
+}
+
 #ifdef HAVE_ECORE_IMF
 static void
 _preedit_clear(Efl_Ui_Internal_Text_Interactive_Data *en)
@@ -628,8 +645,8 @@ _entry_imf_event_selection_set_cb(void

[EGIT] [core/efl] master 01/01: evas_object_textblock: treat variation sequence as single run

2020-01-22 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8143b81dd6b4e72a9018c9d900d69870dc898c6a

commit 8143b81dd6b4e72a9018c9d900d69870dc898c6a
Author: Ali Alzyod 
Date:   Thu Jan 23 16:21:22 2020 +0900

evas_object_textblock: treat variation sequence as single run

Summary:
Variation sequence treated as a single run, if we found one, we keep 
looking adding to the same  run, but if it is not, then we need to start a new 
one.

Before:
{F3826735}

After:
{F3826736}

Test Plan:
```
#include 
#include 
/*
gcc -o example test.c `pkg-config --cflags --libs elementary`
*/

EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
   Evas_Object *win, *en;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("emoji-example", "emoji-example");
   elm_win_autodel_set(win, EINA_TRUE);

   en = elm_entry_add(win);
   elm_entry_scrollable_set(en, EINA_TRUE);
   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);

   elm_object_text_set(en, 
"가");

   evas_object_show(en);

   elm_object_content_set(win, en);
   evas_object_resize(win, 400, 200);
   evas_object_show(win);

   elm_run();

   return 0;
}
ELM_MAIN()
```

Reviewers: woohyun, bowonryu

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8542

Differential Revision: https://phab.enlightenment.org/D11096
---
 src/lib/evas/common/evas_font_query.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/common/evas_font_query.c 
b/src/lib/evas/common/evas_font_query.c
index bab7376621..640fc65b4c 100644
--- a/src/lib/evas/common/evas_font_query.c
+++ b/src/lib/evas/common/evas_font_query.c
@@ -68,6 +68,7 @@ get_top_font:
 
/* Find the longest run of the same font starting from the start position
 * and update cur_fi accordingly. */
+   Eina_Unicode variation_sequence = 0;
itr = text;
while (itr < run_end)
  {
@@ -85,7 +86,17 @@ get_top_font:
  if (evas_common_language_char_script_get(*itr) == 
EVAS_SCRIPT_INHERITED)
 continue;
 
- Eina_Unicode variation_sequence =  VAR_SEQ_SAFE(itr+1);
+ if (!variation_sequence)
+   {
+  variation_sequence =  VAR_SEQ_SAFE(itr+1);
+   }
+ else
+   {
+  /* Variation sequence treated as single run, if we found 
one, we keep looking adding to same
+   * run, but if it is not, then we need to start a new one */
+  if (variation_sequence != VAR_SEQ_SAFE(itr+1))
+break;
+   }
 
  /* Break if either it's not in the font, or if it is in the
   * script's font. */

-- 




[EGIT] [core/efl] master 01/01: efl.text.interactive: use Eina_Int_Range for selection range event

2020-01-22 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3d2f99af9eca265e0b166a2b9f2686e6ba3e9f83

commit 3d2f99af9eca265e0b166a2b9f2686e6ba3e9f83
Author: Ali Alzyod 
Date:   Thu Jan 23 16:07:42 2020 +0900

efl.text.interactive: use Eina_Int_Range for selection range event

Summary:
1- add new Eina type  (Eina_Int_Range). which represents int range (start, 
Len).
2- Use this type instead of  Efl.Text_Range  with selection events.

Reviewers: cedric, woohyun, bu5hm4n, segfaultxavi, zmike

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8570

Differential Revision: https://phab.enlightenment.org/D11128
---
 src/lib/efl/interfaces/efl_text_types.eot | 7 ---
 src/lib/elementary/efl_text_interactive.eo| 2 +-
 src/lib/elementary/efl_ui_internal_text_interactive.c | 5 ++---
 src/lib/elementary/elm_entry.c| 4 +---
 4 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_text_types.eot 
b/src/lib/efl/interfaces/efl_text_types.eot
index d32ab8d2d3..956a8085c1 100644
--- a/src/lib/efl/interfaces/efl_text_types.eot
+++ b/src/lib/efl/interfaces/efl_text_types.eot
@@ -21,10 +21,3 @@ struct @beta Efl.Text_Change_Info {
insertion: bool; [[$true if the content was inserted, $false if removed]]
mergeable: bool; [[$true if can be merged with the previous one. Used for 
example with insertion when something is already selected]]
 }
-
-struct @beta Efl.Text_Range {
-   [[This structure includes text position range (from/to).
-   ]]
-   start: int; [[The start postion.]]
-   end: int; [[The end position.]]
-}
diff --git a/src/lib/elementary/efl_text_interactive.eo 
b/src/lib/elementary/efl_text_interactive.eo
index 933aad0cb1..f090648bf3 100644
--- a/src/lib/elementary/efl_text_interactive.eo
+++ b/src/lib/elementary/efl_text_interactive.eo
@@ -75,7 +75,7 @@ interface @beta Efl.Text_Interactive extends Efl.Text, 
Efl.Text_Font_Properties,
event but only the last one will emit a 
@[.changed,user] event.
  ]]
   have_selection,changed: bool; [[Emitted when the @.have_selection 
property value changes.]]
-  selection,changed: Efl.Text_Range; [[Emitted when selection has changed. 
Query using @.selection_cursors.]]
+  selection,changed: Eina.Range; [[Emitted when selection has changed. 
Query using @.selection_cursors.]]
   redo,request: void; [[Emitted when a redo operation is requested.]]
   undo,request: void; [[Emitted when a undo operation is requested.]]
   changed,user: Efl.Text_Change_Info; [[Emitted when the text content has 
changed due to user interaction.]]
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 8c39ed6287..dd9f8a41f8 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -796,9 +796,8 @@ _emit_sel_state( Eo *o, 
Efl_Ui_Internal_Text_Interactive_Data *en)
  }
else
  {
-Efl_Text_Range range = {0};
-range.start = efl_text_cursor_position_get(en->sel_start);
-range.end = efl_text_cursor_position_get(en->sel_end);
+Eina_Range range = 
eina_range_from_to(efl_text_cursor_position_get(en->sel_start),
+  
efl_text_cursor_position_get(en->sel_end));
 efl_event_callback_call(o, 
EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, );
  }
 }
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index 826e2e0c91..ab1f11544b 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -2384,10 +2384,8 @@ _entry_selection_changed_signal_cb(void *data,
 
if (!sd) return;
sd->have_selection = EINA_TRUE;
-   Efl_Text_Range range = {0};
//FIXME how to get selection range in legacy !?
-   range.start = 0;
-   range.end = 0;
+   Eina_Range range = EINA_RANGE_EMPTY();
efl_event_callback_legacy_call
  (data, EFL_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, );
// XXX: still try primary selection even if on wl in case it's

-- 




[EGIT] [core/efl] master 01/01: efl_text_interactive: selection enhancment

2020-01-20 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=09f0d66d90e4db5f879f4c998e8a07b26fa749fc

commit 09f0d66d90e4db5f879f4c998e8a07b26fa749fc
Author: Ali Alzyod 
Date:   Tue Jan 21 07:39:14 2020 +0900

efl_text_interactive: selection enhancment

Summary:
1- Implement setting selection range programmatically by modifying 
selection cursors from **efl_text_interactive_selection_cursors_get**
2- Add setter with **efl_text_interactive_selection_cursors_set** to set 
the range at once (modify start and end)

Reviewers: woohyun, segfaultxavi, zmike, bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8521, T8522

Differential Revision: https://phab.enlightenment.org/D10968
---
 src/lib/elementary/efl_text_interactive.eo |  14 +-
 .../elementary/efl_ui_internal_text_interactive.c  | 172 ++---
 .../elementary/efl_ui_internal_text_interactive.eo |   2 +-
 src/tests/elementary/efl_ui_test_text.c|  39 +
 4 files changed, 167 insertions(+), 60 deletions(-)

diff --git a/src/lib/elementary/efl_text_interactive.eo 
b/src/lib/elementary/efl_text_interactive.eo
index 933aad0cb1..2f16ce89d8 100644
--- a/src/lib/elementary/efl_text_interactive.eo
+++ b/src/lib/elementary/efl_text_interactive.eo
@@ -25,13 +25,17 @@ interface @beta Efl.Text_Interactive extends Efl.Text, 
Efl.Text_Font_Properties,
   }
   @property selection_cursors {
  [[The cursors used for selection handling.
-
If the cursors are equal there's no selection.
-
-   You are allowed to retain and modify them. Modifying them modifies
-   the selection of the object.
  ]]
- get {}
+ get {
+[[You are allowed to retain and modify them. Modifying them 
modifies
+  the selection of the object (recommended to extend selection 
range).]]
+ }
+ set {
+   [[The positions of passed cursors will be used to set selection 
cursors positions.
+ Further modification for passed @Efl.Text.Cursor objects, will 
not affect selection.
+ Setter is recommended to set new range for selection.]]
+ }
  values {
 start: Efl.Text.Cursor; [[The start of the selection.]]
 end: Efl.Text.Cursor; [[The end of the selection.]]
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 8c39ed6287..42d3bdb8bb 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -14,6 +14,7 @@
 typedef struct _Efl_Ui_Internal_Text_Interactive_Data
 {
Efl_Text_Cursor   *sel_start, *sel_end;
+   int   sel_start_pos, sel_end_pos;
Efl_Text_Cursor   *main_cursor;
Efl_Text_Cursor   *preedit_start, *preedit_end;
Ecore_Timer   *pw_timer;
@@ -44,10 +45,11 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data
 } Efl_Ui_Internal_Text_Interactive_Data;
 
 static void _sel_range_del_emit(Evas_Object *obj, 
Efl_Ui_Internal_Text_Interactive_Data *en);
-static void _sel_init(Efl_Text_Cursor *c, Evas_Object *o, 
Efl_Ui_Internal_Text_Interactive_Data *en);
-static void _sel_enable(Efl_Text_Cursor *c EINA_UNUSED, Evas_Object *o 
EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en);
-static void _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, 
Efl_Ui_Internal_Text_Interactive_Data *en);
-static void _sel_clear(Evas_Object *o EINA_UNUSED, 
Efl_Ui_Internal_Text_Interactive_Data *en);
+static void _sel_init(Efl_Text_Cursor *c, 
Efl_Ui_Internal_Text_Interactive_Data *en);
+static void _sel_enable(Evas_Object *o,Efl_Ui_Internal_Text_Interactive_Data 
*en, Eina_Bool emit_event);
+static void _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, 
Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_event);
+static void _sel_clear(Evas_Object *o EINA_UNUSED, 
Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_event);
+static void _emit_sel_state( Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en);
 static const char *_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, 
Efl_Ui_Internal_Text_Interactive_Data *en);
 static void _entry_imf_cursor_info_set(Efl_Ui_Internal_Text_Interactive_Data 
*en);
 
@@ -201,7 +203,7 @@ _entry_imf_event_commit_cb(void *data, Ecore_IMF_Context 
*ctx EINA_UNUSED, void
   {
  /* delete selected characters */
  _sel_range_del_emit(obj, en);
- _sel_clear(obj, en);
+ _sel_clear(obj, en, EINA_TRUE);
   }
  }
 
@@ -626,12 +628,12 @@ _entry_imf_event_selection_set_cb(void *data, 
Ecore_IMF_Context *ctx EINA_UNUSED
  }
else
  {
-_sel_clear(obj, en);
+_sel_clear(obj, en, EINA_TRUE

[EGIT] [core/efl] master 01/01: efl.input.text.hints_type: rename into content_type

2020-01-20 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=085bfb7eafc8a2ffcf52f9fec56e82f327f3e07f

commit 085bfb7eafc8a2ffcf52f9fec56e82f327f3e07f
Author: Ali Alzyod 
Date:   Mon Jan 20 21:25:43 2020 +0900

efl.input.text.hints_type: rename into content_type

Reviewers: woohyun, segfaultxavi

Reviewed By: woohyun, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8541

Differential Revision: https://phab.enlightenment.org/D11130
---
 src/lib/efl/interfaces/efl_input_text.eo   |  6 +++---
 src/lib/elementary/efl_ui_internal_text_interactive.c  | 14 +++---
 src/lib/elementary/efl_ui_internal_text_interactive.eo |  2 +-
 src/lib/elementary/efl_ui_textbox.c|  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_input_text.eo 
b/src/lib/efl/interfaces/efl_input_text.eo
index f563b6dc4f..d967bbeb1a 100644
--- a/src/lib/efl/interfaces/efl_input_text.eo
+++ b/src/lib/efl/interfaces/efl_input_text.eo
@@ -65,7 +65,7 @@ enum @beta Efl.Input_Text.Panel_Return_Key_State
disabled, [[The return key on input panel is disabled.]]
 }
 
-enum @beta Efl.Input_Text.Hints_Type
+enum @beta Efl.Input_Text.Content_Type
 {
[[Enumeration that defines the types of Input Hints.]]
none= 0,[[No active hints.]]
@@ -178,14 +178,14 @@ interface @beta Efl.Input_Text {
  }
   }
   // FIXME: I agree with Mike, looks bad
-  @property input_hint {
+  @property input_content_type @beta {
  [[The input hint which allows input methods to fine-tune their 
behavior.]]
  set {
  }
  get {
  }
  values {
-hints: Efl.Input_Text.Hints_Type; [[Input hint.]]
+hints: Efl.Input_Text.Content_Type; [[Input hint.]]
  }
   }
   @property input_panel_layout {
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 829c952a65..8c39ed6287 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -33,7 +33,7 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data
Efl_Input_Text_Capitalize_Type autocapital_type;
Efl_Input_Text_Panel_Language_Type input_panel_lang;
Efl_Input_Text_Panel_Return_Key_Type   input_panel_return_key_type;
-   Efl_Input_Text_Hints_Type  input_hints;
+   Efl_Input_Text_Content_Typeinput_hints;
Efl_Input_Text_Panel_Return_Key_State  input_panel_return_key_state;
 
 #ifdef HAVE_ECORE_IMF
@@ -2044,9 +2044,9 @@ 
_efl_ui_internal_text_interactive_efl_input_text_input_panel_layout_set(Eo *obj
 #endif
 
if (layout == EFL_INPUT_TEXT_PANEL_LAYOUT_TYPE_PASSWORD)
- efl_input_text_input_hint_set(obj, ((sd->input_hints & 
~EFL_INPUT_TEXT_HINTS_TYPE_AUTO_COMPLETE) | 
EFL_INPUT_TEXT_HINTS_TYPE_SENSITIVE_DATA));
+ efl_input_text_input_content_type_set(obj, ((sd->input_hints & 
~EFL_INPUT_TEXT_CONTENT_TYPE_AUTO_COMPLETE) | 
EFL_INPUT_TEXT_CONTENT_TYPE_SENSITIVE_DATA));
else if (layout == EFL_INPUT_TEXT_PANEL_LAYOUT_TYPE_TERMINAL)
- efl_input_text_input_hint_set(obj, (sd->input_hints & 
~EFL_INPUT_TEXT_HINTS_TYPE_AUTO_COMPLETE));
+ efl_input_text_input_content_type_set(obj, (sd->input_hints & 
~EFL_INPUT_TEXT_CONTENT_TYPE_AUTO_COMPLETE));
 }
 
 EOLIAN static Efl_Input_Text_Panel_Layout_Type
@@ -2152,7 +2152,7 @@ 
_efl_ui_internal_text_interactive_efl_input_text_predictable_get(const Eo *obj,
 
 
 EOLIAN static void
-_efl_ui_internal_text_interactive_efl_input_text_input_hint_set(Eo *obj, 
Efl_Ui_Internal_Text_Interactive_Data *en, Efl_Input_Text_Hints_Type 
input_hints)
+_efl_ui_internal_text_interactive_efl_input_text_input_content_type_set(Eo 
*obj, Efl_Ui_Internal_Text_Interactive_Data *en, Efl_Input_Text_Content_Type 
input_hints)
 {
 #ifdef HAVE_ECORE_IMF
if (en->imf_context)
@@ -2166,12 +2166,12 @@ 
_efl_ui_internal_text_interactive_efl_input_text_input_hint_set(Eo *obj, Efl_Ui_
 }
 
 
-EOLIAN static Efl_Input_Text_Hints_Type
-_efl_ui_internal_text_interactive_efl_input_text_input_hint_get(const Eo *obj, 
Efl_Ui_Internal_Text_Interactive_Data *en)
+EOLIAN static Efl_Input_Text_Content_Type
+_efl_ui_internal_text_interactive_efl_input_text_input_content_type_get(const 
Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en)
 {
 #ifdef HAVE_ECORE_IMF
if (en->imf_context)
- return 
(Efl_Input_Text_Hints_Type)ecore_imf_context_input_hint_get(en->imf_context);
+ return 
(Efl_Input_Text_Content_Type)ecore_imf_context_input_hint_get(en->imf_context);
(void)obj;
 #else
(void)obj;
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.eo 
b/src/lib/elementary/efl_ui_internal_text_interactive.eo
index 44e

[EGIT] [core/efl] master 01/01: efl.ui.textbox: using efl_provider_find

2020-01-20 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=28675d2705e8b9fe89235e3d893855ea1af6dbb8

commit 28675d2705e8b9fe89235e3d893855ea1af6dbb8
Author: Ali Alzyod 
Date:   Mon Jan 20 16:55:31 2020 +0900

efl.ui.textbox: using efl_provider_find

Summary: > Code structures like top = elm_widget_top_get(data); and if 
(efl_isa(top, EFL_UI_WIN_CLASS)) can be replaced with top = 
efl_provider_find(widget, EFL_UI_WIN_CLASS) No type check needed. (That should 
enhance the performance)

Reviewers: woohyun, bu5hm4n, cedric

Reviewed By: bu5hm4n, cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8522

Differential Revision: https://phab.enlightenment.org/D11127
---
 src/lib/elementary/efl_ui_textbox.c | 22 +++---
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index b72521b8f3..5aac159959 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -821,8 +821,7 @@ _efl_ui_textbox_efl_canvas_group_group_calculate(Eo *obj, 
Efl_Ui_Textbox_Data *s
 EOLIAN static Eina_Bool
 _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
 {
-   Evas_Object *top;
-   Eina_Bool top_is_win = EINA_FALSE;
+   Efl_Object *top;
 
if (!efl_text_interactive_editable_get(obj)) return EINA_FALSE;
 
@@ -834,7 +833,7 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo 
*obj, Efl_Ui_Textbox_Data
 
 _edje_signal_emit(sd, "efl,action,focus", "efl");
 
-if (top && efl_input_text_input_panel_autoshow_get(obj) && 
!efl_input_text_input_panel_show_on_demand_get(obj))
+if (efl_input_text_input_panel_autoshow_get(obj) && 
!efl_input_text_input_panel_show_on_demand_get(obj))
   elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
 if (_elm_config->atspi_mode)
   efl_access_state_changed_signal_emit(obj, 
EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE);
@@ -846,7 +845,7 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo 
*obj, Efl_Ui_Textbox_Data
 _edje_signal_emit(sd, "efl,action,unfocus", "efl");
 efl_canvas_object_key_focus_set(sw, EINA_FALSE);
 
-if (top && top_is_win && efl_input_text_input_panel_autoshow_get(obj))
+if (efl_input_text_input_panel_autoshow_get(obj))
   elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
 if (_elm_config->atspi_mode)
   efl_access_state_changed_signal_emit(obj, 
EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_FALSE);
@@ -1270,8 +1269,7 @@ _mouse_up_cb(void *data,
  void *event_info)
 {
Evas_Event_Mouse_Up *ev = event_info;
-   Eina_Bool top_is_win = EINA_FALSE;
-   Evas_Object *top;
+   Efl_Object *top;
 
EFL_UI_TEXT_DATA_GET(data, sd);
 
@@ -1292,15 +1290,9 @@ _mouse_up_cb(void *data,
   }
 else
   {
- top = elm_widget_top_get(data);
- if (top)
-   {
-  if (efl_isa(top, EFL_UI_WIN_CLASS))
-top_is_win = EINA_TRUE;
-
-  if (top_is_win && 
efl_input_text_input_panel_autoshow_get(data) && 
efl_input_text_input_panel_show_on_demand_get(data))
-elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
-   }
+ top = efl_provider_find(data, EFL_UI_WIN_CLASS);
+ if (efl_input_text_input_panel_autoshow_get(data) && 
efl_input_text_input_panel_show_on_demand_get(data))
+   elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
   }
  }
   /* Since context menu disabled flag was checked at mouse right key down,

-- 




[EGIT] [core/efl] master 01/03: efl.ui.textbox: theme code cleanup

2020-01-16 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=250c7bd30dc8aab54047e4d1fac480c17565b922

commit 250c7bd30dc8aab54047e4d1fac480c17565b922
Author: Ali Alzyod 
Date:   Thu Jan 16 11:55:59 2020 +

efl.ui.textbox: theme code cleanup

>You should not theme in _efl_ui_textbox_efl_object_finalize, but rather in 
theme_apply
>All part swallow things should be done in theme_apply.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11103
---
 src/lib/elementary/efl_ui_textbox.c | 57 +++--
 1 file changed, 23 insertions(+), 34 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 7d34929e89..79796977a3 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -623,6 +623,9 @@ _efl_ui_textbox_efl_ui_widget_disabled_set(Eo *obj, 
Efl_Ui_Textbox_Data *sd, Ein
 {
const char *emission;
 
+   if (efl_ui_widget_disabled_get(obj) == disabled)
+ return;
+
efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled);
 
elm_drop_target_del(obj, sd->drop_format,
@@ -659,11 +662,11 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
 
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
 
-   // Note: We are skipping elm_layout here! This is by design.
-   // This assumes the following inheritance: my_class -> layout -> widget ...
-   theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS));
+   theme_apply = efl_ui_widget_theme_apply(efl_super(obj,MY_CLASS));
if (theme_apply == EFL_UI_THEME_APPLY_ERROR_GENERIC) return 
EFL_UI_THEME_APPLY_ERROR_GENERIC;
 
+   _update_text_theme(obj, sd);
+
efl_event_freeze(obj);
 
edje_object_mirrored_set
@@ -707,6 +710,15 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
 
efl_unref(obj);
 
+   if (efl_content_get(efl_part(sd->entry_edje, "efl.text")) == NULL && 
!sd->scroller)
+ {
+efl_pack_table(sd->text_table, sd->text_obj, 0, 0, 1, 1);
+efl_pack_table(sd->text_table, sd->text_guide_obj, 0, 0, 1, 1);
+efl_content_set(efl_part(sd->entry_edje, "efl.text"), sd->text_table);
+ }
+
+   _create_text_cursors(obj, sd);
+
return theme_apply;
 }
 
@@ -1772,25 +1784,25 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
 
// Main Text
// font_set
-   font_name = edje_object_data_get(wd->resize_obj, "font.name");
-   font_size = edje_object_data_get(wd->resize_obj, "font.size");
+   font_name = efl_layout_group_data_get(wd->resize_obj, "font.name");
+   font_size = efl_layout_group_data_get(wd->resize_obj, "font.size");
font_size_n = font_size ? atoi(font_size) : 0;
efl_text_font_family_set(sd->text_obj, font_name);
efl_text_font_size_set(sd->text_obj, font_size_n);
 
// color
if (disabled)
- colorcode = edje_object_data_get(wd->resize_obj, "style.color_disabled");
+ colorcode = efl_layout_group_data_get(wd->resize_obj, 
"style.color_disabled");
if (!colorcode)
- colorcode = edje_object_data_get(wd->resize_obj, "style.color");
+ colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color");
if (colorcode && _format_color_parse(colorcode, strlen(colorcode), , , 
, ))
  {
 efl_text_color_set(sd->text_obj, r, g, b, a);
  }
 
// Guide Text
-   font_name = edje_object_data_get(wd->resize_obj, "guide.font.name");
-   font_size = edje_object_data_get(wd->resize_obj, "guide.font.size");
+   font_name = efl_layout_group_data_get(wd->resize_obj, "guide.font.name");
+   font_size = efl_layout_group_data_get(wd->resize_obj, "guide.font.size");
font_size_n = font_size ? atoi(font_size) : 0;
efl_text_font_family_set(sd->text_guide_obj, font_name);
efl_text_font_size_set(sd->text_guide_obj, font_size_n);
@@ -1798,9 +1810,9 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
colorcode = NULL;
// color
if (disabled)
- colorcode = edje_object_data_get(wd->resize_obj, 
"guide.style.color_disabled");
+ colorcode = efl_layout_group_data_get(wd->resize_obj, 
"guide.style.color_disabled");
if (!colorcode)
- colorcode = edje_object_data_get(wd->resize_obj, "guide.style.color");
+ colorcode = efl_layout_group_data_get(wd->resize_obj, 
"guide.style.color");
if (colorcode && _format_color_parse(colorcode, strlen(colorcode), , , 
, ))
  {
 efl_text_color_set(sd->text_guide_obj, r, g, b, a);
@@ -1850,33 +1862,14 @@ _efl_ui_textbox_efl_object_finalize(Eo *obj,
 {
obj = efl_fi

[EGIT] [core/efl] master 02/03: efl.ui.textbox: update _part_is_efl_ui_textbox_part

2020-01-16 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e92ee40b2f73b5860efd20b31bc1501273e7cf8a

commit e92ee40b2f73b5860efd20b31bc1501273e7cf8a
Author: Ali Alzyod 
Date:   Thu Jan 16 10:19:08 2020 +

efl.ui.textbox: update _part_is_efl_ui_textbox_part

efl.ui.textbox: update _part_is_efl_ui_textbox_part

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11109
---
 src/lib/elementary/efl_ui_textbox.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 79796977a3..b72521b8f3 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -3551,11 +3551,10 @@ _efl_ui_textbox_text_get(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *pd,
 static Eina_Bool
 _part_is_efl_ui_textbox_part(const Eo *obj EINA_UNUSED, const char *part)
 {
-   //Use Efl.Ui.Widget's "background" and "shadow" parts
-   if (eina_streq(part, "background") || eina_streq(part, "shadow"))
- return EINA_FALSE;
+   if (eina_streq(part, "efl.text_guide") || eina_streq(part, "efl.text"))
+ return EINA_TRUE;
 
-   return EINA_TRUE;
+   return EINA_FALSE;
 }
 
 ELM_PART_OVERRIDE_PARTIAL(efl_ui_textbox, EFL_UI_TEXTBOX, Efl_Ui_Textbox_Data, 
_part_is_efl_ui_textbox_part)

-- 




[EGIT] [core/efl] master 01/01: efl.ui.textbox: part implementation comments clean up!

2020-01-15 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bbecc6662d3add69d15f6b91bc8c014220382073

commit bbecc6662d3add69d15f6b91bc8c014220382073
Author: Ali Alzyod 
Date:   Thu Jan 16 09:12:01 2020 +0900

efl.ui.textbox: part implementation comments clean up!

Summary:
We did not use the **ELM_PART_OVERRIDE_** because it produces compilation 
error

```
../src/lib/elementary/efl_ui_textbox.c:3603:40: error: 
‘EFL_UI_TEXTBOX_PART_CLASS’ undeclared (first use in this function)
 ELM_PART_OVERRIDE_PARTIAL(efl_ui_text, EFL_UI_TEXTBOX, 
Efl_Ui_Textbox_Data, _part_is_efl_ui_text_part)
```

Reviewers: woohyun, bu5hm4n

Reviewed By: woohyun

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8522

Differential Revision: https://phab.enlightenment.org/D11102
---
 src/lib/elementary/efl_ui_textbox.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 053979c82f..95c2f6f44b 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -3569,8 +3569,6 @@ _part_is_efl_ui_text_part(const Eo *obj EINA_UNUSED, 
const char *part)
return EINA_TRUE;
 }
 
-//FIXME
-//ELM_PART_OVERRIDE_PARTIAL(efl_ui_text, EFL_UI_TEXTBOX, Efl_Ui_Textbox_Data, 
_part_is_efl_ui_text_part)
 EOLIAN static Efl_Object *
 _efl_ui_textbox_efl_part_part_get(const Eo *obj, Efl_Ui_Textbox_Data *priv 
EINA_UNUSED, const char *part)
 {
@@ -3579,8 +3577,6 @@ _efl_ui_textbox_efl_part_part_get(const Eo *obj, 
Efl_Ui_Textbox_Data *priv EINA_
return efl_part_get(efl_super(obj, EFL_UI_TEXTBOX_CLASS), part);
 }
 
-//FIXME
-//ELM_PART_OVERRIDE_TEXT_SET(efl_ui_text, EFL_UI_TEXTBOX, Efl_Ui_Textbox_Data)
 EOLIAN static void
 _efl_ui_text_part_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char 
*text)
 {
@@ -3589,8 +3585,6 @@ _efl_ui_text_part_efl_text_text_set(Eo *obj, void *_pd 
EINA_UNUSED, const char *
_efl_ui_textbox_text_set(pd->obj, sd, pd->part, text);
 }
 
-//FIXME
-//ELM_PART_OVERRIDE_TEXT_GET(efl_ui_text, EFL_UI_TEXTBOX, Efl_Ui_Textbox_Data)
 EOLIAN static const char *
 _efl_ui_text_part_efl_text_text_get(const Eo *obj, void *_pd EINA_UNUSED)
 {

-- 




[EGIT] [core/efl] master 01/01: efl.ui.textbox: paste in mouse button 2

2020-01-15 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4386a70177f1516a8da96e522bd105d6e6dc2481

commit 4386a70177f1516a8da96e522bd105d6e6dc2481
Author: Ali Alzyod 
Date:   Mon Jan 13 11:50:37 2020 +

efl.ui.textbox: paste in mouse button 2

efl.ui.textbox: paste in mouse button 2 work on primary instead of clipboard

Differential Revision: https://phab.enlightenment.org/D11068
---
 src/lib/elementary/efl_ui_textbox.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index c64c1baf03..053979c82f 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -211,6 +211,7 @@ static void _anchors_free(Efl_Ui_Textbox_Data *sd);
 static void _selection_defer(Eo *obj, Efl_Ui_Textbox_Data *sd);
 static Eina_Position2D _decoration_calc_offset(Efl_Ui_Textbox_Data *sd);
 static void _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd);
+static void _efl_ui_textbox_selection_paste_type(Eo *obj, 
Efl_Ui_Selection_Type type);
 
 static char *
 _file_load(Eo *obj)
@@ -1235,7 +1236,7 @@ _mouse_down_cb(void *data,
 
if (ev->button == 2)
  {
-efl_ui_textbox_selection_paste(data);
+_efl_ui_textbox_selection_paste_type(data, 
EFL_UI_SELECTION_TYPE_PRIMARY);
  }
 
 /* If right button is pressed and context menu disabled is true,
@@ -2186,17 +2187,23 @@ _efl_ui_textbox_selection_copy(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
efl_event_callback_call(obj, EFL_UI_TEXTBOX_EVENT_SELECTION_COPY, NULL);
 }
 
-EOLIAN static void
-_efl_ui_textbox_selection_paste(Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED)
+static void
+_efl_ui_textbox_selection_paste_type(Eo *obj, Efl_Ui_Selection_Type type)
 {
Efl_Ui_Selection_Format formats = EFL_UI_SELECTION_FORMAT_TEXT | 
EFL_UI_SELECTION_FORMAT_MARKUP;
 
-   efl_ui_selection_get(obj, EFL_UI_SELECTION_TYPE_CLIPBOARD, formats,
+   efl_ui_selection_get(obj, type, formats,
  NULL, _selection_data_cb, NULL, 1);
 
efl_event_callback_call(obj, EFL_UI_TEXTBOX_EVENT_SELECTION_PASTE, NULL);
 }
 
+EOLIAN static void
+_efl_ui_textbox_selection_paste(Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED)
+{
+   _efl_ui_textbox_selection_paste_type(obj, EFL_UI_SELECTION_TYPE_CLIPBOARD);
+}
+
 EOLIAN static void
 _efl_ui_textbox_context_menu_enabled_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Bool enabled)
 {

-- 




[EGIT] [core/efl] master 01/01: efl.ui.textbox: replace hoversel with popup

2020-01-15 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1a1868ce57a3c0e45735bb3afa5aa5243ef78018

commit 1a1868ce57a3c0e45735bb3afa5aa5243ef78018
Author: Ali Alzyod 
Date:   Tue Jan 14 16:29:50 2020 +

efl.ui.textbox: replace hoversel with popup

efl.ui.textbox: replace hoversel with popup
**I think this may need some changes, please let me know what you think**

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11072
---
 src/lib/elementary/efl_ui_textbox.c | 245 +++-
 1 file changed, 104 insertions(+), 141 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index d88f6a432c..c64c1baf03 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -15,7 +15,6 @@
 
 #include "elm_entry_common.h"
 #include "elm_widget_entry.h"
-#include "elm_hoversel_eo.h"
 #include "efl_ui_text_part.eo.h"
 #include "elm_part_helper.h"
 #include "efl_canvas_textblock_internal.h"
@@ -32,7 +31,8 @@ struct _Efl_Ui_Textbox_Data
 {
Evas_Object  *hit_rect, *entry_edje;
 
-   Evas_Object  *hoversel;
+   Eo   *popup;
+   Eo   *popup_list;
Eo   *text_obj;
Eo   *text_guide_obj;
Eo   *text_table;
@@ -59,7 +59,6 @@ struct _Efl_Ui_Textbox_Data
Eina_List*sel;
Efl_Canvas_Textblock_Factory  *item_factory;
Efl_Canvas_Textblock_Factory  *item_fallback_factory;
-   Ecore_Job*hov_deljob;
Mod_Api  *api; // module api if supplied
int   cursor_pos;
Elm_Scroller_Policy   policy_h, policy_v;
@@ -841,7 +840,7 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo 
*obj, Efl_Ui_Textbox_Data
 
 if (_elm_config->selection_clear_enable)
   {
- if ((efl_text_interactive_have_selection_get(obj)) && 
(!sd->hoversel))
+ if ((efl_text_interactive_have_selection_get(obj)) && 
(!sd->popup))
{
   sd->sel_mode = EINA_FALSE;
   efl_ui_widget_scroll_hold_pop(obj);
@@ -882,7 +881,7 @@ _efl_ui_textbox_efl_ui_widget_interest_region_get(const Eo 
*obj EINA_UNUSED, Efl
 }
 
 static void
-_hoversel_position(Evas_Object *obj)
+_popup_position(Evas_Object *obj)
 {
Evas_Coord cx, cy, cw, ch, x, y, mw, mh, w, h;
 
@@ -902,74 +901,12 @@ _hoversel_position(Evas_Object *obj)
  edje_object_part_text_cursor_geometry_get
(sd->entry_edje, "efl.text", , , , );
 
-   evas_object_size_hint_min_get(sd->hoversel, , );
+   evas_object_size_hint_min_get(sd->popup, , );
if (cx + mw > w)
  cx = w - mw;
if (cy + mh > h)
  cy = h - mh;
-   evas_object_geometry_set(sd->hoversel, x + cx, y + cy, mw, mh);
-}
-
-static void
-_hover_del_job(void *data)
-{
-   EFL_UI_TEXT_DATA_GET(data, sd);
-
-   ELM_SAFE_FREE(sd->hoversel, evas_object_del);
-   sd->hov_deljob = NULL;
-}
-
-static void
-_hover_dismissed_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
-   EFL_UI_TEXT_DATA_GET(data, sd);
-
-   sd->use_down = 0;
-   if (sd->hoversel) evas_object_hide(sd->hoversel);
-   if (sd->sel_mode)
- {
-if (!_elm_config->desktop_entry)
-  {
- if (!efl_text_password_get(data))
-   edje_object_part_text_select_allow_set
- (sd->entry_edje, "efl.text", EINA_TRUE);
-  }
- }
-   efl_ui_widget_scroll_freeze_pop(data);
-   ecore_job_del(sd->hov_deljob);
-   sd->hov_deljob = ecore_job_add(_hover_del_job, data);
-}
-
-static void
-_hover_selected_cb(void *data,
-   Evas_Object *obj EINA_UNUSED,
-   void *event_info EINA_UNUSED)
-{
-   EFL_UI_TEXT_DATA_GET(data, sd);
-
-   if (!efl_text_interactive_selection_allowed_get(obj)) return;
-
-   sd->sel_mode = EINA_TRUE;
-   edje_object_part_text_select_none(sd->entry_edje, "efl.text");
-
-   if (!_elm_config->desktop_entry)
- {
-if (!efl_text_password_get(data))
-  edje_object_part_text_select_allow_set
-(sd->entry_edje, "efl.text", EINA_TRUE);
- }
-   efl_layout_signal_emit(sd->entry_edje, "efl,state,select,on", "efl");
-
-   if (!_elm_config->desktop_entry)
- efl_ui_widget_scroll_hold_push(data);
-}
-
-static void
-_hoversel_item_paste_cb(void *data,
-  Evas_Object *obj EINA_UNUSED,
-  void *event_info EINA_UNUSED)
-{
-   efl_ui_textbox_selection_paste(

[EGIT] [core/efl] master 01/01: efl.ui.textbox: add efl.input text as composite interface

2020-01-14 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a53ef37c5411218091101445e6c1db2035498d7a

commit a53ef37c5411218091101445e6c1db2035498d7a
Author: Ali Alzyod 
Date:   Wed Jan 15 09:19:14 2020 +0900

efl.ui.textbox: add efl.input text as composite interface

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8522

Differential Revision: https://phab.enlightenment.org/D11092
---
 src/lib/elementary/efl_ui_textbox.eo | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.eo 
b/src/lib/elementary/efl_ui_textbox.eo
index e286cfc0e6..e3c86e18ad 100644
--- a/src/lib/elementary/efl_ui_textbox.eo
+++ b/src/lib/elementary/efl_ui_textbox.eo
@@ -1,7 +1,7 @@
 class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements 
Efl.Input.Clickable,
- Efl.Access.Text, Efl.Access.Editable.Text, Efl.File, 
Efl.Input_Text
+ Efl.Access.Text, Efl.Access.Editable.Text, Efl.File
composites
- Efl.Text_Interactive, Efl.Text_Markup
+ Efl.Text_Interactive, Efl.Text_Markup, Efl.Input_Text
 {
[[A flexible text widget which can be static (as a label) or editable by
  the user (as a text entry). It provides all sorts of editing facilities

-- 




[EGIT] [core/efl] master 01/01: efl.input.text: add variation enums + remove @since word

2020-01-13 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e894c9bff8b1a0a7c2e6b18a9e0b0f707400eee4

commit e894c9bff8b1a0a7c2e6b18a9e0b0f707400eee4
Author: Ali Alzyod 
Date:   Tue Jan 14 10:42:06 2020 +0900

efl.input.text: add variation enums + remove @since word

Summary: efl.input.text: add variation enums + remove @since word

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8541

Differential Revision: https://phab.enlightenment.org/D11066
---
 src/lib/efl/interfaces/efl_input_text.eo   | 100 +
 .../elementary/efl_ui_internal_text_interactive.c  |   4 +
 2 files changed, 48 insertions(+), 56 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_input_text.eo 
b/src/lib/efl/interfaces/efl_input_text.eo
index 37d3acb978..f563b6dc4f 100644
--- a/src/lib/efl/interfaces/efl_input_text.eo
+++ b/src/lib/efl/interfaces/efl_input_text.eo
@@ -15,15 +15,9 @@ enum @beta Efl.Input_Text.Panel_Layout_Type
hex, [[Hexadecimal layout.]]
terminal,[[Command-line terminal layout including esc, alt, ctrl key, 
so on (no auto-correct, no auto-capitalization).]]
password,[[Like normal, but no auto-correct, no auto-capitalization 
etc.]]
-   datetime,[[Date and time layout
-
-  @since 1.8]]
-   emoticon,[[Emoticon layout
-
-  @since 1.10]]
-   voice[[Voice layout, but if the IME does not support voice layout, 
then normal layout will be shown.
-
-  @since 1.19]]
+   datetime,[[Date and time layout.]]
+   emoticon,[[Emoticon layout.]]
+   voice[[Voice layout, but if the IME does not support voice layout, 
then normal layout will be shown.]]
 }
 
 enum @beta Efl.Input_Text.Panel_Language_Type
@@ -57,9 +51,7 @@ enum @beta Efl.Input_Text.Panel_Return_Key_Type
next,[[Next.]]
search,  [[Search string or magnifier icon.]]
send,[[Send.]]
-   signin   [[Sign-in
-
-  @since 1.8]]
+   signin   [[Sign-in.]]
 }
 
 enum @beta Efl.Input_Text.Panel_Return_Key_State
@@ -75,53 +67,48 @@ enum @beta Efl.Input_Text.Panel_Return_Key_State
 
 enum @beta Efl.Input_Text.Hints_Type
 {
-   [[Enumeration that defines the types of Input Hints.
-
- @since 1.12
-   ]]
-   none= 0,[[No active hints
-
- @since 1.12]]
-   auto_complete   = 1 << 0,   [[Suggest word auto completion
-
- @since 1.12]]
-   sensitive_data  = 1 << 1,   [[Typed text should not be stored.
-
- @since 1.12]]
-   autofill_credit_card_expiration_date   = 0x100, [[ Autofill hint for a 
credit card expiration date
-
-  @since 1.21]]
-   autofill_credit_card_expiration_day= 0x200, [[Autofill hint for a 
credit card expiration day
-
- @since 1.21]]
-   autofill_credit_card_expiration_month  = 0x300, [[ Autofill hint for a 
credit card expiration month
-
-  @since 1.21]]
-   autofill_credit_card_expiration_year   = 0x400, [[ Autofill hint for a 
credit card expiration year
-
-  @since 1.21]]
-   autofill_credit_card_number= 0x500, [[ Autofill hint for a 
credit card number
-
-  @since 1.21]]
-   autofill_email_address = 0x600, [[ Autofill hint for an 
email address
-
-  @since 1.21]]
-   autofill_name  = 0x700, [[ Autofill hint for a 
user's real name
+   [[Enumeration that defines the types of Input Hints.]]
+   none= 0,[[No active hints.]]
+   auto_complete   = 1 << 0,   [[Suggest word auto completion.]]
+   sensitive_data  = 1 << 1,   [[Typed text should not be stored.]]
+   autofill_credit_card_expiration_date   = 0x100, [[ Autofill hint for a 
credit card expiration date.]]
+   autofill_credit_card_expiration_day= 0x200, [[Autofill hint for a 
credit card expiration day.]]
+   autofill_credit_card_expiration_month  = 0x300, [[ Autofill hint for a 
credit card expiration month.]]
+   autofill_credit_card_expiration_year   = 0x400, [[ Autofill hint for a 
credit card expiration year.]]
+   autofill_credit_card_number= 0x500, [[ Autofill hint for a 
credit card number.]]
+   autofill_email_address = 0x600, [[ Autofill hint for an 
email address.]]
+   autofill_name  = 0x700, [[ Autofill hint for a 
user's real name.]]
+   autofill_phone = 0x800, [[ Autofill hint for a 
phone number.]]
+  

[EGIT] [core/efl] master 01/01: efl.ui.textbox: use efl_del with efl_duplicate

2020-01-13 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b2829634fcca60b39c63d7b620cb1ae331b5f602

commit b2829634fcca60b39c63d7b620cb1ae331b5f602
Author: Ali Alzyod 
Date:   Sun Jan 12 17:04:12 2020 +

efl.ui.textbox: use efl_del with efl_duplicate

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11069
---
 src/lib/elementary/efl_ui_internal_text_interactive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 35c6ad2eef..a5768cc74b 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -927,7 +927,7 @@ _delete_emit(Eo *obj, Efl_Text_Cursor *c, 
Efl_Ui_Internal_Text_Interactive_Data
   }
 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV);
  }
-   efl_unref(cur);
+   efl_del(cur);
cur = NULL;
 
Efl_Text_Change_Info info = { NULL, 0, 0, 0, 0 };

-- 




[EGIT] [core/efl] master 01/01: efl.ui.textbox: legacy cleanup

2020-01-13 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2201b562d019f021c93ca5fb408fcfca203d262d

commit 2201b562d019f021c93ca5fb408fcfca203d262d
Author: Ali Alzyod 
Date:   Sun Jan 12 16:31:05 2020 +

efl.ui.textbox: legacy cleanup

efl.ui.textbox: legacy cleanup

Differential Revision: https://phab.enlightenment.org/D11067
---
 src/lib/elementary/efl_ui_textbox.c | 15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 728c060adb..d88f6a432c 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -635,7 +635,7 @@ _efl_ui_textbox_efl_ui_widget_disabled_set(Eo *obj, 
Efl_Ui_Textbox_Data *sd, Ein
efl_layout_signal_emit(sd->entry_edje, emission, "efl");
if (sd->scroll)
  {
-elm_interface_scrollable_freeze_set(obj, 
efl_ui_widget_disabled_get(obj));
+efl_ui_scrollable_scroll_freeze_set(obj, 
efl_ui_widget_disabled_get(obj));
  }
 
if (!efl_ui_widget_disabled_get(obj))
@@ -681,7 +681,7 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
// elm_entry_cursor_pos_set -> cursor,changed -> widget_show_region_set
// -> smart_objects_calculate will call all smart calculate functions,
// and one of them can delete elm_entry.
-   evas_object_ref(obj);
+   efl_ref(obj);
 
if (efl_ui_focus_object_focus_get(obj))
  {
@@ -705,7 +705,7 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
 
efl_event_callback_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL);
 
-   evas_object_unref(obj);
+   efl_unref(obj);
 
return theme_apply;
 }
@@ -1669,9 +1669,6 @@ _create_selection_handlers(Evas_Object *obj, 
Efl_Ui_Textbox_Data *sd)
 EOLIAN static void
 _efl_ui_textbox_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Textbox_Data *sd, 
Eina_Position2D pos)
 {
-   if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, 
pos.x, pos.y))
- return;
-
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
efl_gfx_entity_position_set(sd->hit_rect, pos);
 
@@ -1681,9 +1678,6 @@ _efl_ui_textbox_efl_gfx_entity_position_set(Eo *obj, 
Efl_Ui_Textbox_Data *sd, Ei
 EOLIAN static void
 _efl_ui_textbox_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Textbox_Data *sd, 
Eina_Size2D sz)
 {
-   if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, 
sz.w, sz.h))
- return;
-
efl_gfx_entity_size_set(sd->hit_rect, sz);
_update_selection_handler(obj);
 
@@ -1693,9 +1687,6 @@ _efl_ui_textbox_efl_gfx_entity_size_set(Eo *obj, 
Efl_Ui_Textbox_Data *sd, Eina_S
 EOLIAN static void
 _efl_ui_textbox_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Textbox_Data *sd 
EINA_UNUSED, Eina_Bool vis)
 {
-   if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, 
vis))
- return;
-
efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
if (vis) _update_selection_handler(obj);
 }

-- 




[EGIT] [core/efl] master 01/01: evas_textblock: emit change event on markup_set

2020-01-13 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d6649ad80a70a8d9e9d73c0cdd48ef4a459072a1

commit d6649ad80a70a8d9e9d73c0cdd48ef4a459072a1
Author: Ali Alzyod 
Date:   Tue Jan 7 08:32:19 2020 +

evas_textblock: emit change event on markup_set

Markup_set will emit change events, if user set empty string.
This Change is related to D10985, where markup_prepend will not emit events 
if empty string was added

Reviewed-by: Al Poole 
Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11020
---
 src/lib/evas/canvas/evas_object_textblock.c |  9 +
 src/tests/evas/evas_test_textblock.c| 26 ++
 2 files changed, 35 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index f4d6cfb88f..9010558887 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -8503,6 +8503,15 @@ _evas_object_textblock_text_markup_set(Eo *eo_obj, 
Efl_Canvas_Textblock_Data *o,
evas_textblock_cursor_paragraph_first(o->cursor);
 
evas_object_textblock_text_markup_prepend(o->cursor, text);
+
+   /*If there was no text markup_prepend will not call change function
+ So we will call it inside markup_set*/
+   if (!text || !*text)
+ {
+efl_event_callback_call(eo_obj, EFL_CANVAS_TEXTBLOCK_EVENT_CHANGED, 
NULL);
+_evas_textblock_changed(o, eo_obj);
+ }
+
efl_event_freeze(eo_obj);
/* Point all the cursors to the starrt */
  {
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index b51f149174..8560e36e7c 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4942,6 +4942,31 @@ EFL_START_TEST(efl_text_style)
 {
START_EFL_CANVAS_TEXTBLOCK_TEST();
 
+   int changed_emit = 0;
+   efl_event_callback_add(txt, EFL_CANVAS_TEXTBLOCK_EVENT_CHANGED, 
_increment_int_changed, _emit);
+   efl_text_set(txt, "Hello");
+   ck_assert_int_eq(changed_emit, 1);
+   efl_text_set(txt, "");
+   ck_assert_int_eq(changed_emit, 2);
+   efl_text_set(txt, "");
+   ck_assert_int_eq(changed_emit, 2);
+
+   changed_emit  = 0;
+   efl_text_markup_set(txt, "Hello");
+   ck_assert_int_eq(changed_emit, 1);
+   efl_text_markup_set(txt, "");
+   ck_assert_int_eq(changed_emit, 2);
+   efl_text_markup_set(txt, "");
+   ck_assert_int_eq(changed_emit, 2);
+
+   END_EFL_CANVAS_TEXTBLOCK_TEST();
+}
+EFL_END_TEST
+
+EFL_START_TEST(efl_text_markup)
+{
+   START_EFL_CANVAS_TEXTBLOCK_TEST();
+
efl_text_underline_type_set(txt, EFL_TEXT_STYLE_UNDERLINE_TYPE_NONE);
ck_assert_int_eq(efl_text_underline_type_get(txt), 
EFL_TEXT_STYLE_UNDERLINE_TYPE_NONE);
efl_text_underline_type_set(txt, EFL_TEXT_STYLE_UNDERLINE_TYPE_SINGLE);
@@ -4992,5 +5017,6 @@ void evas_test_textblock(TCase *tc)
tcase_add_test(tc, efl_text_font);
tcase_add_test(tc, efl_canvas_textblock_style);
tcase_add_test(tc, efl_text_style);
+   tcase_add_test(tc, efl_text_markup);
 }
 

-- 




[EGIT] [core/efl] master 01/01: efl.ui.textbox: Enter on keyboard will add \n instead of paragraph separator

2020-01-12 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3249b53d1cc9f9e82f33e84151d9b6775ad9c184

commit 3249b53d1cc9f9e82f33e84151d9b6775ad9c184
Author: Ali Alzyod 
Date:   Mon Jan 13 12:46:57 2020 +0900

efl.ui.textbox: Enter on keyboard will add \n instead of paragraph separator

Summary: Becuase multiline_set(false) does not work with paragraphs, if 
user insert text by keyboard with multible line, then set multiline into false, 
multilines will still shown to user.

Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include 
#include 

static void
_multiline_click_callback(void *data, const Efl_Event *event EINA_UNUSED)
{
   Eo *tb = (Eo*) data;
   efl_text_multiline_set(tb, !efl_text_multiline_get(tb));
}

static void
_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
   efl_exit(0);
}

EAPI_MAIN void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
   Eo *win, *box;

   win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
  efl_text_set(efl_added, "Hello world"),
  efl_ui_win_autodel_set(efl_added, EINA_TRUE));
   efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _quit_cb, 
NULL);
   efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 240));

   box = efl_add(EFL_UI_BOX_CLASS, win,
 efl_content_set(win, efl_added),
 efl_ui_layout_orientation_set(efl_added, 
EFL_UI_LAYOUT_ORIENTATION_VERTICAL));

   Eo *tb = efl_add(EFL_UI_TEXTBOX_CLASS, box,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.9),
efl_pack(box, efl_added));

   Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, box,
 efl_text_set(efl_added, "multiline switch"),
 efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
 efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, 
_multiline_click_callback, tb),
 efl_pack(box, efl_added));
}
EFL_MAIN()
```

Reviewers: woohyun, segfaultxavi

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11070
---
 src/lib/elementary/efl_ui_internal_text_interactive.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 54b29f2712..35c6ad2eef 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -1116,14 +1116,16 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *obj, void
  {
 if (multiline)
   {
- if (shift || 
efl_canvas_textblock_newline_as_paragraph_separator_get(obj))
+ //FIXME this should be Fixed when multiline set works fine with 
PARAGRAPH_SEPARATOR
+ //Now only \n can work with multiline set
+ //if (shift || 
efl_canvas_textblock_newline_as_paragraph_separator_get(obj))
{
   string = "\n";
}
- else
+ /*else
{
   string = _PARAGRAPH_SEPARATOR_UTF8;
-   }
+   }*/
   }
  }
 

-- 




[EGIT] [core/efl] master 01/01: efl.text.cursor: change to abstract class

2020-01-09 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1a02745a88eb863cad307f0ba9fd386594ce4e82

commit 1a02745a88eb863cad307f0ba9fd386594ce4e82
Author: Ali Alzyod 
Date:   Thu Jan 9 22:33:07 2020 +0900

efl.text.cursor: change to abstract class

Summary:
1- Change cursor to abstract class
2- Remove copy method from cursor
3- remove cursor_Add method from efl.canvas.textblock and efl.ui.textbox

Reviewers: woohyun, segfaultxavi, bu5hm4n

Reviewed By: bu5hm4n

Subscribers: lauromoura, YOhoho, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8299, T8454

Differential Revision: https://phab.enlightenment.org/D11034
---
 .../elementary/efl_ui_internal_text_interactive.c  | 40 +-
 src/lib/elementary/efl_ui_textbox.c|  8 +
 src/lib/elementary/efl_ui_textbox.eo   |  7 
 src/lib/evas/canvas/efl_canvas_textblock.eo|  9 -
 .../evas/canvas/efl_canvas_textblock_internal.h|  8 +
 src/lib/evas/canvas/efl_text_cursor.c  | 20 ---
 src/lib/evas/canvas/efl_text_cursor.eo |  9 +
 src/lib/evas/canvas/evas_object_textblock.c|  8 +
 src/tests/evas/evas_test_textblock.c   | 21 +---
 9 files changed, 59 insertions(+), 71 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 3212632532..54b29f2712 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -76,6 +76,12 @@ _text_filter_markup_prepend(Efl_Canvas_Textblock *obj, 
Efl_Ui_Internal_Text_Inte
 const char *fmtpre, const char *fmtpost,
 Eina_Bool clearsel, Eina_Bool changeinfo);
 
+static void
+_cur_pos_copy(Efl_Text_Cursor *src, Efl_Text_Cursor *dest)
+{
+   efl_text_cursor_position_set(dest, efl_text_cursor_position_get(src));
+}
+
 #ifdef HAVE_ECORE_IMF
 static void
 _preedit_clear(Efl_Ui_Internal_Text_Interactive_Data *en)
@@ -523,12 +529,12 @@ _entry_imf_event_preedit_changed_cb(void *data, 
Ecore_IMF_Context *ctx EINA_UNUS
 /* set preedit start cursor */
 if (!en->preedit_start)
   en->preedit_start = efl_canvas_textblock_cursor_create(obj);
-efl_text_cursor_copy(cur, en->preedit_start);
+_cur_pos_copy(cur, en->preedit_start);
 
 /* set preedit end cursor */
 if (!en->preedit_end)
   en->preedit_end = efl_canvas_textblock_cursor_create(obj);
-efl_text_cursor_copy(cur, en->preedit_end);
+_cur_pos_copy(cur, en->preedit_end);
 
 preedit_end_pos = efl_text_cursor_position_get(cur);
 
@@ -752,8 +758,8 @@ _sel_init(Efl_Text_Cursor *c, Evas_Object *o EINA_UNUSED, 
Efl_Ui_Internal_Text_I
if (en->have_selection)
   return;
 
-   efl_text_cursor_copy(c, en->sel_start);
-   efl_text_cursor_copy(c, en->sel_end);
+   _cur_pos_copy(c, en->sel_start);
+   _cur_pos_copy(c, en->sel_end);
 
en->have_selection = EINA_FALSE;
if (en->selection)
@@ -804,7 +810,7 @@ _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, 
Efl_Ui_Internal_Text_Interactive
_sel_enable(c, o, en);
if (efl_text_cursor_equal(c, en->sel_end)) return;
 
-   efl_text_cursor_copy(c, en->sel_end);
+   _cur_pos_copy(c, en->sel_end);
 
_entry_imf_cursor_info_set(en);
 
@@ -830,7 +836,7 @@ _sel_clear(Evas_Object *o EINA_UNUSED, 
Efl_Ui_Internal_Text_Interactive_Data *en
  {
 en->have_selection = EINA_FALSE;
 Eina_Bool b_value = en->have_selection;
-efl_text_cursor_copy(en->sel_start, en->sel_end);
+_cur_pos_copy(en->sel_start, en->sel_end);
 efl_event_callback_call(o, 
EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, _value);
  }
 }
@@ -1024,9 +1030,9 @@ _key_down_sel_pre(Efl_Ui_Internal_Text_Interactive *obj, 
Efl_Text_Cursor *cur, E
   {
  Eina_Bool sel_forward = efl_text_cursor_compare(en->sel_start, 
en->sel_end);
  if ((sel_forward && movement_forward) || (!sel_forward && 
!movement_forward))
-efl_text_cursor_copy(en->sel_end, cur);
+_cur_pos_copy(en->sel_end, cur);
  else
-efl_text_cursor_copy(en->sel_start, cur);
+_cur_pos_copy(en->sel_start, cur);
  _sel_clear(obj, en);
   }
  }
@@ -1207,7 +1213,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, 
Evas_Object *obj, void
  // del to start of previous word
  Efl_Text_Cursor *tc = efl_canvas_textblock_cursor_create(obj);
 
- efl_text_cursor_copy(tc, cur);
+ _cur_pos_copy(tc, cur);
  efl_text_cursor_move(cur, EFL_TEXT

[EGIT] [core/efl] master 01/01: efl.canvas.textblock: rename style strings to have underscore between words

2020-01-09 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7b0a44dd3316d32e8150d9c800e00d923fc3a684

commit 7b0a44dd3316d32e8150d9c800e00d923fc3a684
Author: Ali Alzyod 
Date:   Thu Jan 9 12:14:22 2020 +0100

efl.canvas.textblock: rename style strings to have underscore between words

Summary:
rename following styling strings:
tabstops -> tab_stops
linesize -> line_size
linerelsize -> line_rel_size
linegap -> line_gap
linerelgap -> line_rel_gap
linefill -> line_fill

This will affect Style_Apply, all_style_get,  and any method expect styling 
string

Reviewers: segfaultxavi, woohyun

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8523

Differential Revision: https://phab.enlightenment.org/D11043
---
 src/lib/evas/canvas/efl_canvas_textblock.eo | 22 +++---
 src/lib/evas/canvas/evas_object_textblock.c | 46 -
 src/tests/evas/evas_test_textblock.c|  2 +-
 3 files changed, 44 insertions(+), 26 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo 
b/src/lib/evas/canvas/efl_canvas_textblock.eo
index 72cd8a693e..c9ed381e95 100644
--- a/src/lib/evas/canvas/efl_canvas_textblock.eo
+++ b/src/lib/evas/canvas/efl_canvas_textblock.eo
@@ -257,37 +257,37 @@ class @beta Efl.Canvas.Textblock extends 
Efl.Canvas.Object implements Efl.Text,
  Examples: $[style=outline], $[style=shadow,bottom_right], 
$[style=outline_shadow,bottom].
  See @Efl.Text_Style.text_effect_type and 
@Efl.Text_Style.text_shadow_direction.
 
-   - $tabstops: Size (in pixels) of the tab character. The value must 
be a number greater than one.
+   - $tab_stops: Size (in pixels) of the tab character. The value must 
be a number greater than one.
  Default value is $[32].
  See @Efl.Text_Format.tab_stops.
 
-   - $linesize: Distance (in pixels) from the baseline of one line of 
text to the next. This is, a value of
+   - $line_size: Distance (in pixels) from the baseline of one line of 
text to the next. This is, a value of
  $[0] would render all lines on top of each other (However, this 
value will be ignored if it results in
  overlapping lines of text).
- Setting this value sets $linerelsize to $[0%] (disables it).
+ Setting this value sets $line_rel_size to $[0%] (disables it).
  Default value is $[0].
 
-   - $linerelsize: Distance (in percentage over the natural line 
height) from the baseline of one line of
+   - $line_rel_size: Distance (in percentage over the natural line 
height) from the baseline of one line of
  text to the next. A value of $[100%] does not have any impact, 
smaller values render lines closer together
  and bigger values render them further apart.
- Setting this value sets $linesize to $[0] (disables it).
+ Setting this value sets $line_size to $[0] (disables it).
  Default value is $[0%].
 
-   - $linegap: Additional empty space (in pixels) between the bottom 
of one line of text and the top of the
- next. Setting this value sets $linerelgap to $[0%] (disables it).
+   - $line_gap: Additional empty space (in pixels) between the bottom 
of one line of text and the top of the
+ next. Setting this value sets $line_rel_gap to $[0%] (disables 
it).
  Default value is $[0].
  See @Efl.Text_Format.line_gap.
 
-   - $linerelgap: Additional empty space (in percentage over the 
natural line height) between the bottom of
+   - $line_rel_gap: Additional empty space (in percentage over the 
natural line height) between the bottom of
  one line of text and the top of the next.
- Setting this value sets $linegap to $[0] (disables it).
+ Setting this value sets $line_gap to $[0] (disables it).
  Default value is $[0%].
  See @Efl.Text_Format.line_rel_gap.
 
-   - $linefill: An alternate way to specify the $linesize as a 
percentage of the canvas height.
+   - $line_fill: An alternate way to specify the $line_size as a 
percentage of the canvas height.
  A value of $[100%] means that a single line fills the canvas, 
whereas $[25%] means that 4 lines
  fit in the same height.
- When both $linefill and $linesize are specified the one resulting 
in the smallest line size is used.
+ When both $line_fill and $line_size are specified the one 
resulting in the smallest line size is used.
  Default value is $[0].
 
- $ellipsis: Controls automatic addition of ellipsis "..." to 
replace text which cannot be shown.
diff --git a/src/lib/evas/ca

[EGIT] [core/efl] master 01/01: TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE: rename end enum into opposite

2020-01-09 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=dcc7813caf4a8e686b2f25064c312366d94c8bbb

commit dcc7813caf4a8e686b2f25064c312366d94c8bbb
Author: Ali Alzyod 
Date:   Thu Jan 9 10:59:12 2020 +0100

TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE: rename end enum into opposite

Summary: TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE: rename end enum into 
opposite

Reviewers: segfaultxavi, woohyun

Reviewed By: segfaultxavi, woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7939

Differential Revision: https://phab.enlightenment.org/D11058
---
 src/lib/efl/interfaces/efl_text_format.eo   | 2 +-
 src/lib/evas/canvas/evas_object_textblock.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_text_format.eo 
b/src/lib/efl/interfaces/efl_text_format.eo
index 03a44295a5..96b724c84b 100644
--- a/src/lib/efl/interfaces/efl_text_format.eo
+++ b/src/lib/efl/interfaces/efl_text_format.eo
@@ -13,7 +13,7 @@ enum @beta Efl.Text_Format_Horizontal_Alignment_Auto_Type {
none,   [[No auto-alignment rule: Horizontal Alignment is decided by 
@Efl.Text_Format.text_horizontal_align]]
auto,   [[Respects LTR/RTL (bidirectional) characters found inside the text 
content.]]
locale, [[Respects the system's language settings.]]
-   end [[Text is placed at opposite side of LTR/RTL (bidirectional) 
settings.]]
+   opposite  [[Text is placed at opposite side of LTR/RTL (bidirectional) 
settings.]]
 }
 
 interface @beta Efl.Text_Format {
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 93c7a4b5d5..edef5e88f1 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -16781,7 +16781,7 @@ 
_efl_canvas_textblock_efl_text_format_text_horizontal_align_auto_type_set(Eo *ob
  {
 _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE);
  }
-   else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_END)
+   else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_OPPOSITE)
  {
 _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_END);
  }
@@ -16799,7 +16799,7 @@ 
_efl_canvas_textblock_efl_text_format_text_horizontal_align_auto_type_get(const
  }
else if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_END)
  {
-ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_END;
+ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_OPPOSITE;
  }
else if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE)
  {

-- 




[EGIT] [core/efl] master 01/01: efl_ui_textbox: replace elm_obj stuff and focuse stuff

2020-01-08 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b03f06ca8d9ff95a11b2d9be7b522c2d591adf66

commit b03f06ca8d9ff95a11b2d9be7b522c2d591adf66
Author: Ali Alzyod 
Date:   Thu Jan 9 13:57:04 2020 +0900

efl_ui_textbox: replace elm_obj stuff and focuse stuff

Summary: efl_ui_textbox: replace elm_obj stuff and focuse stuff

Reviewers: woohyun, bu5hm4n

Reviewed By: woohyun, bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8522

Differential Revision: https://phab.enlightenment.org/D11025
---
 src/lib/elementary/efl_ui_textbox.c | 25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 507d7866a8..0f545e319f 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -259,7 +259,7 @@ _load_do(Evas_Object *obj)
 
if (!sd->file)
  {
-elm_object_text_set(obj, "");
+efl_text_set(obj, "");
 return 0;
  }
 
@@ -556,15 +556,13 @@ static void
 _dnd_enter_cb(void *data EINA_UNUSED,
   Evas_Object *obj)
 {
-   elm_object_focus_set(obj, EINA_TRUE);
+   efl_ui_focus_util_focus(obj);
 }
 
 static void
 _dnd_leave_cb(void *data EINA_UNUSED,
   Evas_Object *obj)
 {
-   if (_elm_config->desktop_entry)
- elm_object_focus_set(obj, EINA_FALSE);
 }
 
 static void
@@ -820,7 +818,7 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo 
*obj, Efl_Ui_Textbox_Data
 
if (efl_ui_focus_object_focus_get(obj))
  {
-evas_object_focus_set(sd->text_obj, EINA_TRUE);
+efl_canvas_object_key_focus_set(sd->text_obj, EINA_TRUE);
 
 _edje_signal_emit(sd, "efl,action,focus", "efl");
 
@@ -834,7 +832,7 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo 
*obj, Efl_Ui_Textbox_Data
 Eo *sw = sd->text_obj;
 
 _edje_signal_emit(sd, "efl,action,unfocus", "efl");
-evas_object_focus_set(sw, EINA_FALSE);
+efl_canvas_object_key_focus_set(sw, EINA_FALSE);
 
 if (top && top_is_win && efl_input_text_input_panel_autoshow_get(obj))
   elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
@@ -2173,6 +2171,17 @@ _efl_ui_textbox_select_region_set(Eo *obj, 
Efl_Ui_Textbox_Data *sd EINA_UNUSED,
efl_text_cursor_position_set(sel_end, end);
 }
 
+static void
+_efl_ui_textbox_select_region_get(Eo *obj, int *start, int *end)
+{
+   Efl_Text_Cursor *sel_start, *sel_end;
+
+   efl_text_interactive_selection_cursors_get(obj, _start, _end);
+
+   if(start) *start = efl_text_cursor_position_get(sel_start);
+   if(end) *end = efl_text_cursor_position_get(sel_end);
+}
+
 EOLIAN static void
 _efl_ui_textbox_selection_cut(Eo *obj, Efl_Ui_Textbox_Data *sd)
 {
@@ -2264,7 +2273,7 @@ EOLIAN static void
 _efl_ui_textbox_efl_file_unload(Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED)
 {
efl_file_unload(efl_super(obj, MY_CLASS));
-   elm_object_text_set(obj, "");
+   efl_text_set(obj, "");
 }
 
 EOLIAN static Eina_Error
@@ -2553,7 +2562,7 @@ 
_efl_ui_textbox_efl_access_text_access_selection_get(const Eo *obj, Efl_Ui_Textb
 {
if (selection_number != 0) return;
 
-   elm_obj_entry_select_region_get(obj, start_offset, end_offset);
+   _efl_ui_textbox_select_region_get((Eo *)obj, start_offset, end_offset);
 }
 
 EOLIAN static Eina_Bool

-- 




[EGIT] [core/efl] master 01/01: efl.ui.textbox: rename selection_handler to selection_handles

2020-01-08 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=622f0b188f165e5b561eb3acae9721a62e731333

commit 622f0b188f165e5b561eb3acae9721a62e731333
Author: Ali Alzyod 
Date:   Thu Jan 9 13:44:50 2020 +0900

efl.ui.textbox: rename selection_handler to selection_handles

Summary: efl.ui.textbox: rename selection_handler to selection_handles

Reviewers: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8522

Differential Revision: https://phab.enlightenment.org/D11042
---
 src/lib/elementary/efl_ui_textbox.c  | 16 
 src/lib/elementary/efl_ui_textbox.eo |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index dd25e39419..507d7866a8 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -89,7 +89,7 @@ struct _Efl_Ui_Textbox_Data
 Eina_Future  *primary;
 Eina_Future  *clipboard;
  } sel_future;
-   Eina_Bool sel_handler_enabled : 1;
+   Eina_Bool sel_handles_enabled : 1;
Eina_Bool start_handler_down : 1;
Eina_Bool start_handler_shown : 1;
Eina_Bool end_handler_down : 1;
@@ -428,7 +428,7 @@ _update_selection_handler(Eo *obj)
 return;
  }
 
-   if (sd->sel_handler_enabled)
+   if (sd->sel_handles_enabled)
  {
 Eina_Rect rect;
 Eina_Position2D off;
@@ -1886,7 +1886,7 @@ _efl_ui_textbox_efl_object_constructor(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
efl_text_interactive_selection_allowed_set(obj, EINA_TRUE);
sd->drop_format = EFL_UI_SELECTION_FORMAT_MARKUP | 
EFL_UI_SELECTION_FORMAT_IMAGE;
sd->last.scroll = EINA_SIZE2D(0, 0);
-   sd->sel_handler_enabled = EINA_FALSE;
+   sd->sel_handles_enabled = EINA_FALSE;
 
return obj;
 }
@@ -2089,16 +2089,16 @@ _efl_ui_textbox_selection_get(const Eo *obj, 
Efl_Ui_Textbox_Data *sd EINA_UNUSED
 }
 
 EOLIAN static void
-_efl_ui_textbox_selection_handler_enabled_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Bool enabled)
+_efl_ui_textbox_selection_handles_enabled_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Eina_Bool enabled)
 {
-   if (sd->sel_handler_enabled == enabled) return;
-   sd->sel_handler_enabled = enabled;
+   if (sd->sel_handles_enabled == enabled) return;
+   sd->sel_handles_enabled = enabled;
 }
 
 EOLIAN static Eina_Bool
-_efl_ui_textbox_selection_handler_enabled_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd)
+_efl_ui_textbox_selection_handles_enabled_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd)
 {
-   return sd->sel_handler_enabled;
+   return sd->sel_handles_enabled;
 }
 
 static void
diff --git a/src/lib/elementary/efl_ui_textbox.eo 
b/src/lib/elementary/efl_ui_textbox.eo
index b723c59e44..3f8097a90a 100644
--- a/src/lib/elementary/efl_ui_textbox.eo
+++ b/src/lib/elementary/efl_ui_textbox.eo
@@ -45,7 +45,7 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base 
implements Efl.Input.Click
 format: Efl.Ui.Selection_Format; [[Format for copy & paste.]]
  }
   }
-  @property selection_handler_enabled {
+  @property selection_handles_enabled {
  [[This enables or disables the entry's selection handlers.]]
  set {
  }

-- 




[EGIT] [core/efl] master 01/01: Text_Format_Horizontal_Alignment_Auto_Type: rename enums, and Doc details

2020-01-08 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=43ad91ee406cbcc5715486813324a2eecbd5ece4

commit 43ad91ee406cbcc5715486813324a2eecbd5ece4
Author: Ali Alzyod 
Date:   Fri Jan 3 12:06:25 2020 +0100

Text_Format_Horizontal_Alignment_Auto_Type: rename enums, and Doc details

Summary: Text_Format_Horizontal_Alignment_Auto_Type: rename enums, and Doc 
details

Reviewers: woohyun, ali.alzyod

Reviewed By: ali.alzyod

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7939

Differential Revision: https://phab.enlightenment.org/D10993
---
 src/lib/efl/interfaces/efl_text_format.eo   | 17 +++--
 src/lib/evas/canvas/evas_object_textblock.c |  4 ++--
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_text_format.eo 
b/src/lib/efl/interfaces/efl_text_format.eo
index 5c974a675e..03a44295a5 100644
--- a/src/lib/efl/interfaces/efl_text_format.eo
+++ b/src/lib/efl/interfaces/efl_text_format.eo
@@ -9,10 +9,10 @@ enum @beta Efl.Text_Format_Wrap {
 }
 
 enum @beta Efl.Text_Format_Horizontal_Alignment_Auto_Type {
-   [[Auto-horizontal alignment of the text.]]
-   none,   [[No auto-alignment rule.]]
-   normal, [[Respects LTR/RTL (bidirectional) settings.]]
-   locale, [[Respects locale's language settings.]]
+   [[Auto-horizontal alignment setting for the text (Left-To-Right or 
Right-To-Left).]]
+   none,   [[No auto-alignment rule: Horizontal Alignment is decided by 
@Efl.Text_Format.text_horizontal_align]]
+   auto,   [[Respects LTR/RTL (bidirectional) characters found inside the text 
content.]]
+   locale, [[Respects the system's language settings.]]
end [[Text is placed at opposite side of LTR/RTL (bidirectional) 
settings.]]
 }
 
@@ -55,7 +55,7 @@ interface @beta Efl.Text_Format {
   }
 
   @property text_horizontal_align_auto_type {
- [[Horizontal alignment of text.]]
+ [[Specifies when the text's horizontal alignment should be set 
automatically.]]
  values {
 value: Efl.Text_Format_Horizontal_Alignment_Auto_Type; [[Alignment 
type.]]
  }
@@ -63,7 +63,12 @@ interface @beta Efl.Text_Format {
 
   @property text_horizontal_align {
  [[Horizontal alignment of text. $[0.0] means "left"
-   and $[1.0] means "right".]]
+   and $[1.0] means "right".
+   Setting this value also sets @.text_horizontal_align_auto_type to
+   @Efl.Text_Format_Horizontal_Alignment_Auto_Type.none.
+   This value is ignored when @.text_horizontal_align_auto_type is set 
to anything other than
+   @Efl.Text_Format_Horizontal_Alignment_Auto_Type.none.
+ ]]
  values {
 value: double; [[Alignment value between $[0.0] and $[1.0].]]
  }
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 1dcad334c6..93c7a4b5d5 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -16773,7 +16773,7 @@ 
_efl_canvas_textblock_efl_text_format_text_horizontal_align_auto_type_set(Eo *ob
  {
 _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NONE);
  }
-   else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NORMAL)
+   else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_AUTO)
  {
 _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL);
  }
@@ -16795,7 +16795,7 @@ 
_efl_canvas_textblock_efl_text_format_text_horizontal_align_auto_type_get(const
 
if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL)
  {
-ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NORMAL;
+ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_AUTO;
  }
else if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_END)
  {

-- 




[EGIT] [core/efl] master 01/01: efl_text_types: remove unused type

2020-01-07 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=303baf754a69503f5f00067efb7d753615eb548e

commit 303baf754a69503f5f00067efb7d753615eb548e
Author: Ali Alzyod 
Date:   Tue Jan 7 17:42:53 2020 +0900

efl_text_types: remove unused type

Summary:
efl_text_types: remove unused type **Efl.Text_Attribute_Handle**

Reviewers: woohyun, segfaultxavi

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11031
---
 src/lib/efl/interfaces/efl_text_types.eot | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_text_types.eot 
b/src/lib/efl/interfaces/efl_text_types.eot
index c0451e03aa..8c9e7583db 100644
--- a/src/lib/efl/interfaces/efl_text_types.eot
+++ b/src/lib/efl/interfaces/efl_text_types.eot
@@ -27,6 +27,4 @@ struct @beta Efl.Text_Range {
]]
start: int; [[The start postion.]]
end: int; [[The end position.]]
-}
-
-struct @extern @beta Efl.Text_Attribute_Handle; [[EFL text annotations data 
structure]]
\ No newline at end of file
+}
\ No newline at end of file

-- 




[EGIT] [core/efl] master 01/01: efl.text_style: remame underline2 and glow2

2020-01-07 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=36a50f4d82e9865af7534753e9ca914020f23b07

commit 36a50f4d82e9865af7534753e9ca914020f23b07
Author: Ali Alzyod 
Date:   Tue Jan 7 09:20:29 2020 +0100

efl.text_style: remame underline2 and glow2

Summary: rename underline2 into secondary_underline and glow2 into 
secondary_glow

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7857

Differential Revision: https://phab.enlightenment.org/D11024
---
 src/lib/edje/edje_part_text.c   | 12 ++--
 src/lib/edje/efl_canvas_layout_part_text.eo |  4 ++--
 src/lib/efl/interfaces/efl_text_style.eo|  4 ++--
 src/lib/evas/canvas/efl_canvas_textblock.eo | 14 +++---
 src/lib/evas/canvas/evas_object_textblock.c | 18 --
 src/tests/edje/edje_test_text.c |  8 
 6 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c
index 5b61a54aa3..edfe3cec2c 100644
--- a/src/lib/edje/edje_part_text.c
+++ b/src/lib/edje/edje_part_text.c
@@ -98,13 +98,13 @@ _efl_canvas_layout_part_text_efl_text_style_ ##x 
##_color_get(const Eo *obj, \
 
 TEXT_COLOR_IMPL(text_background, BACKING)
 TEXT_COLOR_IMPL(text_glow, GLOW)
-TEXT_COLOR_IMPL(text_glow2, GLOW2)
+TEXT_COLOR_IMPL(text_secondary_glow, GLOW2)
 TEXT_COLOR_IMPL(text, NORMAL)
 TEXT_COLOR_IMPL(text_outline, OUTLINE)
 TEXT_COLOR_IMPL(text_shadow, SHADOW)
 TEXT_COLOR_IMPL(text_strikethrough, STRIKETHROUGH)
 TEXT_COLOR_IMPL(text_underline, UNDERLINE)
-TEXT_COLOR_IMPL(text_underline2, UNDERLINE2)
+TEXT_COLOR_IMPL(text_secondary_underline, UNDERLINE2)
 TEXT_COLOR_IMPL(text_underline_dashed, UNDERLINE_DASHED)
 
 EOLIAN static void
@@ -367,13 +367,13 @@ _canvas_layout_user_text_collect(Edje *ed, 
Edje_User_Defined *eud)
 
   STYLE_COLOR_COLLECT(text_background, BACKING)
   STYLE_COLOR_COLLECT(text_glow, GLOW)
-  STYLE_COLOR_COLLECT(text_glow2, GLOW2)
+  STYLE_COLOR_COLLECT(text_secondary_glow, GLOW2)
   STYLE_COLOR_COLLECT(text, NORMAL)
   STYLE_COLOR_COLLECT(text_outline, OUTLINE)
   STYLE_COLOR_COLLECT(text_shadow, SHADOW)
   STYLE_COLOR_COLLECT(text_strikethrough, STRIKETHROUGH)
   STYLE_COLOR_COLLECT(text_underline, UNDERLINE)
-  STYLE_COLOR_COLLECT(text_underline2, UNDERLINE2)
+  STYLE_COLOR_COLLECT(text_secondary_underline, UNDERLINE2)
   STYLE_COLOR_COLLECT(text_underline_dashed, UNDERLINE_DASHED)
 #undef STYLE_COLOR_COLLECT
 
@@ -486,13 +486,13 @@ _canvas_layout_user_text_apply(Edje_User_Defined *eud, Eo 
*obj,
 
   STYLE_COLOR_CASE(text_background, BACKING)
   STYLE_COLOR_CASE(text_glow, GLOW)
-  STYLE_COLOR_CASE(text_glow2, GLOW2)
+  STYLE_COLOR_CASE(text_secondary_glow, GLOW2)
   STYLE_COLOR_CASE(text, NORMAL)
   STYLE_COLOR_CASE(text_outline, OUTLINE)
   STYLE_COLOR_CASE(text_shadow, SHADOW)
   STYLE_COLOR_CASE(text_strikethrough, STRIKETHROUGH)
   STYLE_COLOR_CASE(text_underline, UNDERLINE)
-  STYLE_COLOR_CASE(text_underline2, UNDERLINE2)
+  STYLE_COLOR_CASE(text_secondary_underline, UNDERLINE2)
   STYLE_COLOR_CASE(text_underline_dashed, UNDERLINE_DASHED)
 #undef STYLE_COLOR_CASE
 
diff --git a/src/lib/edje/efl_canvas_layout_part_text.eo 
b/src/lib/edje/efl_canvas_layout_part_text.eo
index 6c9c4cb06e..a0314f1906 100644
--- a/src/lib/edje/efl_canvas_layout_part_text.eo
+++ b/src/lib/edje/efl_canvas_layout_part_text.eo
@@ -45,7 +45,7 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font_Properties, 
Efl.Text_Style
   Efl.Text_Style.text_background_color { set; get;}
   Efl.Text_Style.text_underline_type { set; }
   Efl.Text_Style.text_underline_color { set; get; }
-  Efl.Text_Style.text_underline2_color { set; get; }
+  Efl.Text_Style.text_secondary_underline_color { set; get; }
   Efl.Text_Style.text_underline_dashed_color { set; get; }
   Efl.Text_Style.text_underline_height { set; }
   Efl.Text_Style.text_underline_dashed_width { set; }
@@ -57,6 +57,6 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font_Properties, 
Efl.Text_Style
   Efl.Text_Style.text_outline_color { set; get; }
   Efl.Text_Style.text_shadow_color { set; get; }
   Efl.Text_Style.text_glow_color { set; get; }
-  Efl.Text_Style.text_glow2_color { set; get; }
+  Efl.Text_Style.text_secondary_glow_color { set; get; }
}
 }
diff --git a/src/lib/efl/interfaces/efl_text_style.eo 
b/src/lib/efl/interfaces/efl_text_style.eo
index 8807e047ac..a975ebdc96 100644
--- a/src/lib/efl/interfaces/efl_text_style.eo
+++ b/src/lib/efl/interfaces/efl_text_style.eo
@@ -156,7 +156,7 @@ interface @beta Efl.Text_Style {
  }
   }
 
-  @property text_underline2_color
+  @property text_secondary_underline_color
   {
  [[Color of the secondary

[EGIT] [core/efl] master 02/02: efl.ui.textbox: clean up (remove unused vars and methods)

2020-01-06 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cdaecf2dfb6d10cd1376623a5377b195e777dd57

commit cdaecf2dfb6d10cd1376623a5377b195e777dd57
Author: Ali Alzyod 
Date:   Mon Jan 6 10:09:04 2020 +

efl.ui.textbox: clean up (remove unused vars and methods)

efl.ui.textbox: clean up (remove unused vars and methods)

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11023
---
 src/lib/elementary/efl_ui_textbox.c | 126 ++--
 1 file changed, 6 insertions(+), 120 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index a36faf29b8..aeff628640 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -30,12 +30,9 @@ typedef struct _Selection_Loss_Data Selection_Loss_Data;
  */
 struct _Efl_Ui_Textbox_Data
 {
-   Evas_Object  *hit_rect, *entry_edje, *scr_edje;
+   Evas_Object  *hit_rect, *entry_edje;
 
Evas_Object  *hoversel;
-   Evas_Object  *mgf_bg;
-   Evas_Object  *mgf_clip;
-   Evas_Object  *mgf_proxy;
Eo   *text_obj;
Eo   *text_guide_obj;
Eo   *text_table;
@@ -47,14 +44,10 @@ struct _Efl_Ui_Textbox_Data
Evas_Object  *start_handler;
Evas_Object  *end_handler;
Ecore_Job*deferred_decoration_job;
-   Ecore_Timer  *delay_write;
/* for deferred appending */
-   Ecore_Idler  *append_text_idler;
-   char *append_text_left;
int   append_text_position;
int   append_text_len;
/* Only for clipboard */
-   const char   *cut_sel;
const char   *text;
const char   *file;
Elm_Text_Format   format;
@@ -64,19 +57,13 @@ struct _Efl_Ui_Textbox_Data
Eina_List*anchors;
int  gen;
Eina_List*sel;
-   Eina_List*items; /** context menu item list */
Efl_Canvas_Textblock_Factory  *item_factory;
Efl_Canvas_Textblock_Factory  *item_fallback_factory;
-   Eina_List*markup_filters;
Ecore_Job*hov_deljob;
Mod_Api  *api; // module api if supplied
int   cursor_pos;
Elm_Scroller_Policy   policy_h, policy_v;
-   Elm_Wrap_Type line_wrap;
Efl_Text_Cursor  *sel_handler_cursor;
-   void *input_panel_imdata;
-   int   input_panel_imdata_len;
-   int   validators;
struct
  {
 Evas_Object *hover_parent; /**< hover parent object. entry is a hover 
parent object by default */
@@ -360,30 +347,6 @@ _efl_ui_textbox_guide_update(Evas_Object *obj,
sd->has_text = has_text;
 }
 
-static void
-_filter_free(Elm_Entry_Markup_Filter *tf)
-{
-   if (tf->func == elm_entry_filter_limit_size)
- {
-Elm_Entry_Filter_Limit_Size *lim = tf->data;
-
-free(lim);
- }
-   else if (tf->func == elm_entry_filter_accept_set)
- {
-Elm_Entry_Filter_Accept_Set *as = tf->data;
-
-if (as)
-  {
- eina_stringshare_del(as->accepted);
- eina_stringshare_del(as->rejected);
-
- free(as);
-  }
- }
-   free(tf);
-}
-
 static void
 _mirrored_set(Evas_Object *obj,
   Eina_Bool rtl)
@@ -674,7 +637,6 @@ _efl_ui_textbox_efl_ui_widget_disabled_set(Eo *obj, 
Efl_Ui_Textbox_Data *sd, Ein
efl_layout_signal_emit(sd->entry_edje, emission, "efl");
if (sd->scroll)
  {
-efl_layout_signal_emit(sd->scr_edje, emission, "efl");
 elm_interface_scrollable_freeze_set(obj, 
efl_ui_widget_disabled_get(obj));
  }
 
@@ -726,8 +688,6 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
if (efl_ui_focus_object_focus_get(obj))
  {
 efl_layout_signal_emit(sd->entry_edje, "efl,action,focus", "efl");
-if (sd->scroll)
-  efl_layout_signal_emit(sd->scr_edje, "efl,action,focus", "efl");
  }
 
efl_layout_signal_process(sd->entry_edje, EINA_FALSE);
@@ -863,8 +823,6 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo 
*obj, Efl

[EGIT] [core/efl] master 01/02: efl.ui.textbox: replace legacy scroller type check

2020-01-06 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=31a96be9a28fc8086d6e617a66b5d786b2ecb8ce

commit 31a96be9a28fc8086d6e617a66b5d786b2ecb8ce
Author: Ali Alzyod 
Date:   Thu Jan 2 10:00:35 2020 +

efl.ui.textbox: replace legacy scroller type check

replace legacy scroller type check ELM_INTERFACE_SCROLLABLE_MIXIN with 
EFL_UI_SCROLLABLE_INTERFACE

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D11003
---
 src/lib/elementary/efl_ui_textbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index c3bbf688b7..a36faf29b8 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -434,7 +434,7 @@ _viewport_region_get(Evas_Object *obj)
parent = efl_ui_widget_parent_get(obj);
while (parent)
  {
-if (efl_isa(parent, ELM_INTERFACE_SCROLLABLE_MIXIN))
+if (efl_isa(parent, EFL_UI_SCROLLABLE_INTERFACE))
   {
  Eina_Rectangle r;
  EINA_RECTANGLE_SET(, 0, 0, 0, 0);

-- 




[EGIT] [core/efl] master 01/01: Efl.Text.Font.Properties: rename Efl.Text_Font_Properties

2020-01-02 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3c54f6458f80e2221962b01f2d4e4067a6978402

commit 3c54f6458f80e2221962b01f2d4e4067a6978402
Author: Ali Alzyod 
Date:   Tue Dec 31 07:15:29 2019 +

Efl.Text.Font.Properties: rename Efl.Text_Font_Properties

Efl.Text.Font.Properties: rename Efl.Text_Font_Properties

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10990
---
 src/lib/edje/efl_canvas_layout_part_text.eo|  6 ++--
 src/lib/efl/interfaces/efl_text_font_properties.eo |  2 +-
 src/lib/elementary/efl_text_interactive.eo |  2 +-
 src/lib/evas/canvas/efl_canvas_textblock.eo| 42 +++---
 4 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/src/lib/edje/efl_canvas_layout_part_text.eo 
b/src/lib/edje/efl_canvas_layout_part_text.eo
index a593424062..6c9c4cb06e 100644
--- a/src/lib/edje/efl_canvas_layout_part_text.eo
+++ b/src/lib/edje/efl_canvas_layout_part_text.eo
@@ -11,7 +11,7 @@ enum @beta Efl.Canvas.Layout_Part_Text_Expand
 }
 
 class @beta Efl.Canvas.Layout_Part_Text extends Efl.Canvas.Layout_Part 
implements Efl.Text,
-Efl.Text_Markup, Efl.Text_Format, Efl.Text.Font.Properties, Efl.Text_Style
+Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font_Properties, Efl.Text_Style
 {
[[Represents a TEXT part of a layout
 
@@ -38,8 +38,8 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text.Font.Properties, 
Efl.Text_Style
   Efl.Text_Markup.markup { get; set; }
   Efl.Text_Format.ellipsis { set; get; }
   Efl.Text_Format.wrap { set; get; }
-  Efl.Text.Font.Properties.font_family { set; get; }
-  Efl.Text.Font.Properties.font_size { set; get; }
+  Efl.Text_Font_Properties.font_family { set; get; }
+  Efl.Text_Font_Properties.font_size { set; get; }
   Efl.Text_Style.text_color { set; get; }
   Efl.Text_Style.text_background_type { set; get; }
   Efl.Text_Style.text_background_color { set; get;}
diff --git a/src/lib/efl/interfaces/efl_text_font_properties.eo 
b/src/lib/efl/interfaces/efl_text_font_properties.eo
index b7957a8ac9..160b182803 100644
--- a/src/lib/efl/interfaces/efl_text_font_properties.eo
+++ b/src/lib/efl/interfaces/efl_text_font_properties.eo
@@ -43,7 +43,7 @@ enum @beta Efl.Text_Font_Bitmap_Scalable {
color = (1 << 0), [[Enable scalable feature for color bitmap fonts.]]
 }
 
-interface @beta Efl.Text.Font.Properties {
+interface @beta Efl.Text_Font_Properties {
[[Font settings for text.
]]
c_prefix: efl_text;
diff --git a/src/lib/elementary/efl_text_interactive.eo 
b/src/lib/elementary/efl_text_interactive.eo
index 85b5a811d7..933aad0cb1 100644
--- a/src/lib/elementary/efl_text_interactive.eo
+++ b/src/lib/elementary/efl_text_interactive.eo
@@ -1,6 +1,6 @@
 import efl_text_types;
 
-interface @beta Efl.Text_Interactive extends Efl.Text, 
Efl.Text.Font.Properties,
+interface @beta Efl.Text_Interactive extends Efl.Text, 
Efl.Text_Font_Properties,
Efl.Text_Format, Efl.Text_Style
 {
[[Interface for interactive (editable) text inputs (text entries).
diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo 
b/src/lib/evas/canvas/efl_canvas_textblock.eo
index 724103040a..031f74a13e 100644
--- a/src/lib/evas/canvas/efl_canvas_textblock.eo
+++ b/src/lib/evas/canvas/efl_canvas_textblock.eo
@@ -1,7 +1,7 @@
 import efl_text_types;
 
 class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
-   Efl.Canvas.Filter.Internal, Efl.Text.Font.Properties,
+   Efl.Canvas.Filter.Internal, Efl.Text_Font_Properties,
Efl.Text_Style, Efl.Text_Format,
Efl.Text_Markup, Efl.Ui.I18n
 {
@@ -9,7 +9,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
  if you need user interaction consider the classes in $[Efl.Ui].
 
  Note: No text will be rendered until a font, a font size and a font color 
are specified.
- This can be accomplished using @Efl.Text.Font.Properties.font_family, 
@Efl.Text.Font.Properties.font_size and
+ This can be accomplished using @Efl.Text_Font_Properties.font_family, 
@Efl.Text_Font_Properties.font_size and
  @Efl.Text_Style.text_color.
  Alternatively, @.style_apply can be used providing the attributes $font, 
$font_size and $color.
]]
@@ -92,7 +92,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
  [[Applies several style attributes at once using a formatting string.
Given style attributes override previous values, leaving other 
attributes unaffected.
This is akin to setting individual style attributes using 
properties like
-   @Efl.Text.Font.Properties.font_slant or @Efl.Text_Format.wrap, for 
example.
+   @Efl.Text_Font_Properties.font_slant or @Efl.Text_Format.wrap, for 
example.
 
The formatting string is a whit

[EGIT] [core/efl] master 02/03: efl_ui_text: scroller mode clean up

2020-01-02 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3cc8ea77fa5ca6e5c5819ff7c6caecf819d4bc3e

commit 3cc8ea77fa5ca6e5c5819ff7c6caecf819d4bc3e
Author: Ali Alzyod 
Date:   Thu Jan 2 08:19:24 2020 +

efl_ui_text: scroller mode clean up

simplify code, and reduce calls:

It is only required to set scroll mode in two cases:
- When creating scroller
- When changing multiline property

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10981
---
 src/lib/elementary/efl_ui_internal_text_scroller.c |  7 +---
 src/lib/elementary/efl_ui_textbox.c| 47 +-
 src/lib/elementary/efl_ui_textbox.eo   |  1 +
 3 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.c 
b/src/lib/elementary/efl_ui_internal_text_scroller.c
index 3387759e38..7f10c2989a 100644
--- a/src/lib/elementary/efl_ui_internal_text_scroller.c
+++ b/src/lib/elementary/efl_ui_internal_text_scroller.c
@@ -63,7 +63,6 @@ _efl_ui_internal_text_scroller_efl_object_constructor(Eo *obj,
 Efl_Ui_Internal_Text_Scroller_Data *sd 
EINA_UNUSED)
 {
obj = efl_constructor(efl_super(obj, MY_CLASS));
-   //EFL_UI_SCROLLER_DATA_GET_OR_RETURN(obj, psd, NULL);
efl_ui_scrollbar_bar_mode_set(obj,
  EFL_UI_SCROLLBAR_MODE_OFF, EFL_UI_SCROLLBAR_MODE_OFF);
 
@@ -138,7 +137,6 @@ _efl_ui_internal_text_scroller_efl_object_finalize(Eo *obj,
efl_ui_scrollbar_bar_mode_set(obj,
  EFL_UI_SCROLLBAR_MODE_OFF, EFL_UI_SCROLLBAR_MODE_OFF);
efl_content_set(obj, sd->text_table);
-
return obj;
 }
 
@@ -170,16 +168,15 @@ _efl_ui_internal_text_scroller_scroller_mode_set(Eo *obj,
Efl_Ui_Internal_Text_Scroller_Data *sd,
Efl_Ui_Text_Scroller_Mode mode)
 {
-   EFL_UI_SCROLLER_DATA_GET_OR_RETURN(obj, psd);
sd->mode = mode;
if (mode == EFL_UI_TEXT_SCROLLER_MODE_MULTILINE)
  {
-efl_ui_scrollbar_bar_mode_set(psd->smanager,
+efl_ui_scrollbar_bar_mode_set(obj,
   EFL_UI_SCROLLBAR_MODE_AUTO, EFL_UI_SCROLLBAR_MODE_AUTO);
  }
else // default (single-line)
  {
-efl_ui_scrollbar_bar_mode_set(psd->smanager,
+efl_ui_scrollbar_bar_mode_set(obj,
   EFL_UI_SCROLLBAR_MODE_OFF, EFL_UI_SCROLLBAR_MODE_OFF);
  }
 }
diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index da63751e53..c3bbf688b7 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -816,24 +816,10 @@ _efl_ui_textbox_efl_canvas_group_group_calculate(Eo *obj, 
Efl_Ui_Textbox_Data *s
 
if (sd->scroll)
  {
-if (!efl_text_multiline_get(obj))
-  {
- efl_ui_internal_text_scroller_mode_set(sd->scroller,
-   EFL_UI_TEXT_SCROLLER_MODE_SINGLELINE);
-  }
-else
-  {
- efl_ui_internal_text_scroller_mode_set(sd->scroller,
-   EFL_UI_TEXT_SCROLLER_MODE_MULTILINE);
-
-  }
-
 efl_canvas_group_calculate(sd->scroller);
 min = efl_gfx_hint_size_min_get(sd->scroller);
 if (!efl_text_multiline_get(obj))
   {
- efl_ui_internal_text_scroller_mode_set(sd->scroller,
-   EFL_UI_TEXT_SCROLLER_MODE_SINGLELINE);
  edje_object_size_min_calc(wd->resize_obj, , );
  min.w = edmin.w;
  min.h = edmin.h;
@@ -2137,6 +2123,26 @@ _efl_ui_textbox_efl_object_destructor(Eo *obj, 
Efl_Ui_Textbox_Data *sd)
efl_destructor(efl_super(obj, MY_CLASS));
 }
 
+EOLIAN static void
+_efl_ui_textbox_efl_text_format_multiline_set(Eo *obj, Efl_Ui_Textbox_Data 
*sd, Eina_Bool enabled)
+{
+   enabled = !!enabled;
+   if (efl_text_multiline_get(obj) == enabled) return;
+   efl_text_multiline_set(sd->text_obj, enabled);
+
+   if (sd->scroller)
+ {
+if (enabled)
+  {
+ efl_ui_internal_text_scroller_mode_set(sd->scroller, 
EFL_UI_TEXT_SCROLLER_MODE_MULTILINE);
+  }
+else
+  {
+ efl_ui_internal_text_scroller_mode_set(sd->scroller, 
EFL_UI_TEXT_SCROLLER_MODE_SINGLELINE);
+  }
+ }
+}
+
 EOLIAN static void
 _efl_ui_textbox_efl_text_format_password_set(Eo *obj, Efl_Ui_Textbox_Data *sd, 
Eina_Bool password)
 {
@@ -2429,7 +2435,7 @@ _efl_ui_textbox_cnp_mode_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd)
 }
 
 EOLIAN static void
-_efl_ui_textbox_scrollable_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, 
Eina_Bool scroll)
+_efl_ui_textbox_scrollable_set(Eo *obj, Efl_Ui_Textbox_Data *sd, Eina_Bool 
scroll)
 {
if (sd->scroll == scroll) return;
sd->scroll = scroll;
@@ -2440,7 +2446,12 @@ _efl_ui_textbox_scrollable_set(Eo *obj EINA_UNUSED, 

[EGIT] [core/efl] master 01/02: efl.text.cursor: emit events CANVAS_TEXTBLOCK_CHANGED when insert text using efl_text_cursor_markup_insert

2020-01-02 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=41c7e1c908772bd8f4ec266c661faabeea357ec6

commit 41c7e1c908772bd8f4ec266c661faabeea357ec6
Author: Ali Alzyod 
Date:   Thu Jan 2 07:25:35 2020 +

efl.text.cursor: emit events CANVAS_TEXTBLOCK_CHANGED when insert text 
using efl_text_cursor_markup_insert

efl.text.cursor: emit events CANVAS_TEXTBLOCK_CHANGED when insert text 
using efl_text_cursor_markup_insert

Differential Revision: https://phab.enlightenment.org/D10985
---
 src/lib/evas/canvas/evas_object_textblock.c | 226 ++--
 src/tests/evas/evas_test_textblock.c|   9 +-
 2 files changed, 119 insertions(+), 116 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 2347961759..817008c889 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -8524,7 +8524,7 @@ static void
 _evas_object_textblock_text_markup_prepend(Eo *eo_obj,
   Efl_Text_Cursor_Handle *cur, const char *text)
 {
-   if (!cur) return;
+   if (!cur || !text || !*text) return;
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
TB_HEAD();
@@ -8533,140 +8533,138 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj,
 * this should be done once, when markup_prepend finished */
o->pause_change = EINA_TRUE;
 
-   if (text)
- {
-char *s, *p;
-char *tag_start, *tag_end, *esc_start, *esc_end;
-
-tag_start = tag_end = esc_start = esc_end = NULL;
-p = (char *)text;
-s = p;
-/* This loop goes through all of the mark up text until it finds format
- * tags, escape sequences or the terminating NULL. When it finds either
- * of those, it appends the text found up until that point to the 
textblock
- * proccesses whatever found. It repeats itself until the terminating
- * NULL is reached. */
-for (;;)
-  {
- size_t text_len;
- /* If we got to the end of string or just finished/started tag
-  * or escape sequence handling. */
- if ((*p == 0) ||
-   (tag_end) || (esc_end) ||
-   (tag_start) || (esc_start))
+   char *s, *p;
+   char *tag_start, *tag_end, *esc_start, *esc_end;
+
+   tag_start = tag_end = esc_start = esc_end = NULL;
+   p = (char *)text;
+   s = p;
+   /* This loop goes through all of the mark up text until it finds format
+* tags, escape sequences or the terminating NULL. When it finds either
+* of those, it appends the text found up until that point to the textblock
+* proccesses whatever found. It repeats itself until the terminating
+* NULL is reached. */
+   for (;;)
+ {
+size_t text_len;
+/* If we got to the end of string or just finished/started tag
+ * or escape sequence handling. */
+if ((*p == 0) ||
+  (tag_end) || (esc_end) ||
+  (tag_start) || (esc_start))
+  {
+ if (tag_end)
{
-  if (tag_end)
-{
-   /* If we reached to a tag ending, analyze the tag */
-   char *ttag;
-   size_t ttag_len = tag_end - tag_start;
+  /* If we reached to a tag ending, analyze the tag */
+  char *ttag;
+  size_t ttag_len = tag_end - tag_start;
 
 
-   ttag = malloc(ttag_len + 1);
-   if (ttag)
- {
-memcpy(ttag, tag_start, ttag_len);
-ttag[ttag_len] = 0;
-evas_textblock_cursor_format_prepend(cur, ttag);
-free(ttag);
- }
-   tag_start = tag_end = NULL;
-}
-  else if (esc_end)
-{
-   _prepend_escaped_char(cur, esc_start, esc_end + 1);
-   esc_start = esc_end = NULL;
-}
-  else if (*p == 0 && esc_start) /* escape start with no end, 
append it as text */
-{
-   _prepend_text_run(cur, esc_start, p);
-   esc_start = esc_end = NULL;
-   s = NULL;
-}
-  else if (*p == 0)
+  ttag = malloc(ttag_len + 1);
+  if (ttag)
 {
-   _prepend_text_run(cur, s, p);
-   s = NULL;
+   memcpy(ttag, tag_start, ttag_len);
+   ttag[ttag_len] = 0;
+   evas_textblock_cursor_format_prepend(cur, ttag);
+ 

[EGIT] [core/efl] master 01/01: efl.text.interactive: remove event freeze when keyboard button is pressed

2020-01-02 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a95a509cfd9dbccefe360efa3ff4b717b24adb3e

commit a95a509cfd9dbccefe360efa3ff4b717b24adb3e
Author: Ali Alzyod 
Date:   Sun Dec 29 09:49:04 2019 +

efl.text.interactive: remove event freeze when keyboard button is pressed

this event freeze will prevent submission of EFL_UI_TEXTBOX_EVENT_CHANGED 
on efl.ui.textbox object, when inserting text using the keyboard.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10979
---
 .../elementary/efl_ui_internal_text_interactive.c  |  2 --
 src/tests/elementary/efl_ui_test_text.c| 26 ++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 2bb112f265..4958a83582 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -1459,9 +1459,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, 
Evas_Object *obj, void
  info.position = efl_text_cursor_position_get(cur);
  info.length = eina_unicode_utf8_get_len(string);
 
- efl_event_freeze(obj);
  efl_text_cursor_text_insert(cur, string);
- efl_event_thaw(obj);
  changed_user = EINA_TRUE;
 
  ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
diff --git a/src/tests/elementary/efl_ui_test_text.c 
b/src/tests/elementary/efl_ui_test_text.c
index 5c26e6f528..49ba50d91d 100644
--- a/src/tests/elementary/efl_ui_test_text.c
+++ b/src/tests/elementary/efl_ui_test_text.c
@@ -5,6 +5,7 @@
 #define EFL_LAYOUT_CALC_PROTECTED
 #include 
 #include "efl_ui_suite.h"
+#include "Evas_Legacy.h"
 
 static void
 increment_int_changed(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
@@ -153,6 +154,30 @@ EFL_START_TEST(text_scroll_mode)
 }
 EFL_END_TEST
 
+EFL_START_TEST(text_change_event)
+{
+   Eo *txt;
+   Eo *win = win_add();
+
+   txt = efl_add(EFL_UI_TEXTBOX_CLASS, win);
+   efl_gfx_entity_size_set(txt, EINA_SIZE2D(300, 300));
+   efl_text_set(txt, "Hello");
+   int i_changed = 0;
+   efl_event_callback_add(txt, EFL_UI_TEXTBOX_EVENT_CHANGED, 
increment_int_changed, _changed);
+   efl_gfx_entity_visible_set(txt, EINA_TRUE);
+   Evas *e = evas_object_evas_get(txt);
+   efl_ui_focus_util_focus(txt);
+   evas_event_feed_key_down(e, "s", "s", "s", "s", time(NULL), NULL);
+   ecore_main_loop_iterate();
+   ck_assert_str_eq(efl_text_get(txt),"Hellos");
+   ck_assert_int_eq(i_changed,1);
+   ecore_main_loop_iterate();
+
+   efl_del(txt);
+   efl_del(win);
+}
+EFL_END_TEST
+
 void efl_ui_test_text(TCase *tc)
 {
tcase_add_test(tc, text_cnp);
@@ -160,4 +185,5 @@ void efl_ui_test_text(TCase *tc)
tcase_add_test(tc, text_selection);
tcase_add_test(tc, text_user_change);
tcase_add_test(tc, text_scroll_mode);
+   tcase_add_test(tc, text_change_event);
 }

-- 




[EGIT] [core/efl] master 01/01: efl_ui_text: support focus navigation

2019-12-31 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5154b5a8fca093fadeec5278e465385b5dcdb63a

commit 5154b5a8fca093fadeec5278e465385b5dcdb63a
Author: Ali Alzyod 
Date:   Mon Dec 30 15:36:02 2019 +

efl_ui_text: support focus navigation

With this commit you can move the focus from the textbox widget to the 
surrounding widgets, (as it is done in legacy).

ref T8538
ref T8522

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10987
---
 .../elementary/efl_ui_internal_text_interactive.c  | 24 ++
 src/lib/elementary/efl_ui_textbox.c|  6 ++
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c 
b/src/lib/elementary/efl_ui_internal_text_interactive.c
index a0bbba6469..2bb112f265 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -1137,8 +1137,10 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *obj, void
   {
  _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
 
- efl_text_cursor_line_jump_by(cur, -1);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ if (efl_text_interactive_have_selection_get(obj))
+   ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ if (efl_text_cursor_line_jump_by(cur, -1))
+   ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
 
  _key_down_sel_post(obj, cur, en, shift);
   }
@@ -1151,8 +1153,10 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *obj, void
   {
  _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
 
- efl_text_cursor_line_jump_by(cur, 1);
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ if (efl_text_interactive_have_selection_get(obj))
+   ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ if (efl_text_cursor_line_jump_by(cur, 1))
+   ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
 
  _key_down_sel_post(obj, cur, en, shift);
   }
@@ -1163,14 +1167,16 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *obj, void
 _compose_seq_reset(en);
 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
 
-efl_text_cursor_move(cur,EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV);
 #if defined(__APPLE__) && defined(__MACH__)
 if (altgr) efl_text_cursor_move(cur, 
EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
 #else
 /* If control is pressed, go to the start of the word */
 if (control) efl_text_cursor_move(cur, 
EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
 #endif
-ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+if (efl_text_interactive_have_selection_get(obj))
+  ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+if (efl_text_cursor_move(cur,EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV))
+  ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
 
 _key_down_sel_post(obj, cur, en, shift);
  }
@@ -1186,8 +1192,10 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *obj, void
 /* If control is pressed, go to the end of the word */
 if (control) efl_text_cursor_move(cur, 
EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END);
 #endif
-efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT);
-ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+if (efl_text_interactive_have_selection_get(obj))
+  ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+if (efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT))
+  ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
 
 _key_down_sel_post(obj, cur, en, shift);
  }
diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 6d91f21519..da63751e53 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -870,9 +870,7 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo 
*obj, Efl_Ui_Textbox_Data
 
if (!efl_text_interactive_editable_get(obj)) return EINA_FALSE;
 
-   top = elm_widget_top_get(obj);
-   if (top && efl_isa(top, EFL_UI_WIN_CLASS))
- top_is_win = EINA_TRUE;
+   top = efl_provider_find(obj, EFL_UI_WIN_CLASS);
 
if (efl_ui_focus_object_focus_get(obj))
  {
@@ -882,7 +880,7 @@ _efl_ui_textbox_efl_ui_focus_object_on_focus_update(Eo 
*obj, Efl_Ui_Textbox_Data
 if (sd->scroll)
   efl_layout_signal_emit(sd->scr_edje, "efl,action,focus", "efl");
 
-if (top && top_is_win && efl_input_text_input_panel_autoshow_get(obj) 
&& !efl_input_text_input_panel_show_on_demand_get(obj))
+if (top && efl_input_text_input_panel_autos

[EGIT] [core/efl] master 01/01: elementary_text: Efl.Ui.Textbox Input Field

2019-12-31 Thread Ali Alzyod
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2ec10f18d33c77c5103e16f85874e8b527e73ef8

commit 2ec10f18d33c77c5103e16f85874e8b527e73ef8
Author: Ali Alzyod 
Date:   Mon Dec 30 14:15:58 2019 +

elementary_text: Efl.Ui.Textbox Input Field

Entry was added to the same box. This commit fixes this.
You could observe this problem when starting the "Textbox Input Field" demo 
in elm_test

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10986
---
 src/bin/elementary/test_efl_ui_text.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/bin/elementary/test_efl_ui_text.c 
b/src/bin/elementary/test_efl_ui_text.c
index dc1748bd07..53914831e7 100644
--- a/src/bin/elementary/test_efl_ui_text.c
+++ b/src/bin/elementary/test_efl_ui_text.c
@@ -234,7 +234,6 @@ test_efl_ui_text_inputfield(void *data EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED
efl_text_multiline_set(en, EINA_TRUE);
efl_ui_textbox_scrollable_set(en, EINA_TRUE);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.5);
-   efl_pack(bx, en);
 
efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 200));
 

-- 




[EGIT] [core/efl] master 01/01: efl_ui_textbox: replace legacy calls with new ones

2019-12-29 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=895f64f33c2156ae3ff687bcb1621b5bef2bb194

commit 895f64f33c2156ae3ff687bcb1621b5bef2bb194
Author: Ali Alzyod 
Date:   Mon Dec 30 10:31:32 2019 +0900

efl_ui_textbox: replace legacy calls with new ones

Summary: This patch only changes some of legacy calls, with new ones

Reviewers: woohyun, zmike, bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8522

Differential Revision: https://phab.enlightenment.org/D10982
---
 src/lib/elementary/efl_ui_textbox.c | 94 ++---
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index e96842dba7..6d91f21519 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -353,9 +353,9 @@ _efl_ui_textbox_guide_update(Evas_Object *obj,
EFL_UI_TEXT_DATA_GET(obj, sd);
 
if ((has_text) && (!sd->has_text))
- edje_object_signal_emit(sd->entry_edje, "efl,guide,disabled", "efl");
+ efl_layout_signal_emit(sd->entry_edje, "efl,guide,disabled", "efl");
else if ((!has_text) && (sd->has_text))
- edje_object_signal_emit(sd->entry_edje, "efl,guide,enabled", "efl");
+ efl_layout_signal_emit(sd->entry_edje, "efl,guide,enabled", "efl");
 
sd->has_text = has_text;
 }
@@ -390,7 +390,7 @@ _mirrored_set(Evas_Object *obj,
 {
EFL_UI_TEXT_DATA_GET(obj, sd);
 
-   edje_object_mirrored_set(sd->entry_edje, rtl);
+   efl_ui_mirrored_set(sd->entry_edje, rtl);
 
if (sd->anchor_hover.hover)
  efl_ui_mirrored_set(sd->anchor_hover.hover, rtl);
@@ -405,12 +405,12 @@ _hide_selection_handler(Evas_Object *obj)
 
if (sd->start_handler_shown)
  {
-edje_object_signal_emit(sd->start_handler, "efl,handler,hide", "efl");
+efl_layout_signal_emit(sd->start_handler, "efl,handler,hide", "efl");
 sd->start_handler_shown = EINA_FALSE;
  }
if (sd->end_handler_shown)
  {
-edje_object_signal_emit(sd->end_handler, "efl,handler,hide", "efl");
+efl_layout_signal_emit(sd->end_handler, "efl,handler,hide", "efl");
 sd->end_handler_shown = EINA_FALSE;
  }
 }
@@ -431,7 +431,7 @@ _viewport_region_get(Evas_Object *obj)
 rect = efl_gfx_entity_geometry_get(sd->text_obj);
  }
 
-   parent = elm_widget_parent_get(obj);
+   parent = efl_ui_widget_parent_get(obj);
while (parent)
  {
 if (efl_isa(parent, ELM_INTERFACE_SCROLLABLE_MIXIN))
@@ -445,7 +445,7 @@ _viewport_region_get(Evas_Object *obj)
   break;
}
   }
-parent = elm_widget_parent_get(parent);
+parent = efl_ui_widget_parent_get(parent);
  }
 
return rect;
@@ -500,13 +500,13 @@ _update_selection_handler(Eo *obj)
   }
 if (!sd->start_handler_shown && !hidden)
   {
- edje_object_signal_emit(sd->start_handler,
+ efl_layout_signal_emit(sd->start_handler,
  "efl,handler,show", "efl");
  sd->start_handler_shown = EINA_TRUE;
   }
 else if (sd->start_handler_shown && hidden)
   {
- edje_object_signal_emit(sd->start_handler,
+ efl_layout_signal_emit(sd->start_handler,
  "efl,handler,hide", "efl");
  sd->start_handler_shown = EINA_FALSE;
   }
@@ -528,13 +528,13 @@ _update_selection_handler(Eo *obj)
   }
 if (!sd->end_handler_shown && !hidden)
   {
- edje_object_signal_emit(sd->end_handler,
+ efl_layout_signal_emit(sd->end_handler,
  "efl,handler,show", "efl");
  sd->end_handler_shown = EINA_TRUE;
   }
 else if (sd->end_handler_shown && hidden)
   {
- edje_object_signal_emit(sd->end_handler,
+ efl_layout_signal_emit(sd->end_handler,
  "efl,handler,hide", "efl");
  sd->end_handler_shown = EINA_FALSE;
   }
@@ -543,13 +543,13 @@ _update_selection_handler(Eo *obj)
  {
 if (sd->start_handler_shown)
   {
- edje_object_signal_emit(sd->start_handler,
+ efl_layout_signal_emit(sd->start_handler,
  "efl,handler,hide", "efl");
  sd->start_han

[EGIT] [core/efl] master 01/01: efl_style: rename enums (background, strikthrough) from enabled to solid_color

2019-12-26 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e583b9159e9d9b0bbb5e1bf14be81e5acdc9a98b

commit e583b9159e9d9b0bbb5e1bf14be81e5acdc9a98b
Author: Ali Alzyod 
Date:   Fri Dec 27 16:10:24 2019 +0900

efl_style: rename enums (background,strikthrough) from enabled to 
solid_color

Reviewers: woohyun, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7942

Differential Revision: https://phab.enlightenment.org/D10967
---
 src/lib/efl/interfaces/efl_text_style.eo | 4 ++--
 src/tests/evas/evas_test_textblock.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_text_style.eo 
b/src/lib/efl/interfaces/efl_text_style.eo
index 17c209e01d..9fdd1e05f2 100644
--- a/src/lib/efl/interfaces/efl_text_style.eo
+++ b/src/lib/efl/interfaces/efl_text_style.eo
@@ -2,7 +2,7 @@ enum @beta Efl.Text_Style_Background_Type
 {
[[Whether to add a background colored rectangle (background) to each line 
of text or not.]]
disabled = 0, [[Do not use background.]]
-   enabled,  [[Use background.]]
+   solid_color,  [[Use solid color background.]]
 
 }
 
@@ -10,7 +10,7 @@ enum @beta Efl.Text_Style_Strikethrough_Type
 {
[[Whether to add a strike-through decoration to the displayed text or not.]]
disabled = 0, [[Do not use strike-through.]]
-   enabled,  [[Use strike-through.]]
+   solid_color,  [[Use solid color strike-through.]]
 
 }
 
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index 9e9c43f259..6ade455ddc 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4908,7 +4908,7 @@ EFL_START_TEST(efl_canvas_textblock_style)
ck_assert_int_eq(efl_text_wrap_get(txt), EFL_TEXT_FORMAT_WRAP_NONE);
 
efl_canvas_textblock_style_apply(txt, "backing=on");
-   ck_assert_int_eq(efl_text_background_type_get(txt), 
EFL_TEXT_STYLE_BACKGROUND_TYPE_ENABLED);
+   ck_assert_int_eq(efl_text_background_type_get(txt), 
EFL_TEXT_STYLE_BACKGROUND_TYPE_SOLID_COLOR);
 
efl_canvas_textblock_style_apply(txt, "style=far_soft_shadow");
ck_assert_int_eq(efl_text_effect_type_get(txt), 
EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SOFT_SHADOW);

-- 




[EGIT] [core/efl] master 01/01: efl.ui.textbox: fix crash when toggle scroll mode

2019-12-26 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7c71dc4e2df2ac74f121598da44ea872c0a6eaa2

commit 7c71dc4e2df2ac74f121598da44ea872c0a6eaa2
Author: Ali Alzyod 
Date:   Fri Dec 27 10:17:17 2019 +0900

efl.ui.textbox: fix crash when toggle scroll mode

Reviewers: eagleeye, bu5hm4n, cedric, woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10924
---
 src/lib/elementary/efl_ui_textbox.c |  5 -
 src/tests/elementary/efl_ui_test_text.c | 22 ++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index ed9c4b365f..e96842dba7 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -2451,7 +2451,10 @@ _efl_ui_textbox_scrollable_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textbox_Data *sd, Ein
  }
else
  {
-efl_content_set(sd->scroller, NULL);
+/* sd->text_table should not be deleted, so we need to use 
content_unset
+ * instead of efl_content_set(sd->scroller, NULL)
+*/
+efl_content_unset(sd->scroller);
 edje_object_part_swallow(sd->entry_edje, "efl.text", sd->text_table);
 efl_del(sd->scroller);
 sd->scroller = NULL;
diff --git a/src/tests/elementary/efl_ui_test_text.c 
b/src/tests/elementary/efl_ui_test_text.c
index b0eecd14ae..5c26e6f528 100644
--- a/src/tests/elementary/efl_ui_test_text.c
+++ b/src/tests/elementary/efl_ui_test_text.c
@@ -132,10 +132,32 @@ EFL_START_TEST(text_user_change)
 }
 EFL_END_TEST
 
+EFL_START_TEST(text_scroll_mode)
+{
+   Eo *txt, *win, *cur;
+   win = win_add();
+   txt = efl_add(EFL_UI_TEXTBOX_CLASS, win);
+   cur = efl_text_interactive_main_cursor_get(txt);
+   efl_text_set(txt, "Hello");
+   /*scroll mode is false by default*/
+   fail_if(efl_ui_textbox_scrollable_get(txt));
+   efl_ui_textbox_scrollable_set(txt, !efl_ui_textbox_scrollable_get(txt));
+   efl_text_cursor_text_insert(cur, "World");
+   fail_if(!efl_ui_textbox_scrollable_get(txt));
+   efl_ui_textbox_scrollable_set(txt, !efl_ui_textbox_scrollable_get(txt));
+   efl_text_cursor_text_insert(cur, "!!!");
+
+   ck_assert_str_eq(efl_text_get(txt),"HelloWorld!!!");
+   efl_del(txt);
+   efl_del(win);
+}
+EFL_END_TEST
+
 void efl_ui_test_text(TCase *tc)
 {
tcase_add_test(tc, text_cnp);
tcase_add_test(tc, text_all_select_all_unselect);
tcase_add_test(tc, text_selection);
tcase_add_test(tc, text_user_change);
+   tcase_add_test(tc, text_scroll_mode);
 }

-- 




[EGIT] [core/efl] master 01/01: efl_text_format: rename tabstops, lingap, linerelgap

2019-12-26 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3bd4f04ec7392c7e4b745082303ac28fbfc2b2d6

commit 3bd4f04ec7392c7e4b745082303ac28fbfc2b2d6
Author: Ali Alzyod 
Date:   Thu Dec 26 18:01:32 2019 +0900

efl_text_format: rename tabstops,lingap,linerelgap

Summary: rename tabstops,lingap,linerelgap to have underscore between words

Reviewers: segfaultxavi, woohyun

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7856

Differential Revision: https://phab.enlightenment.org/D10963
---
 src/lib/efl/interfaces/efl_text_format.eo   |  6 +++---
 src/lib/evas/canvas/efl_canvas_textblock.eo | 12 ++--
 src/lib/evas/canvas/evas_object_textblock.c | 12 ++--
 src/tests/evas/evas_test_textblock.c|  2 +-
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_text_format.eo 
b/src/lib/efl/interfaces/efl_text_format.eo
index 79e62883da..5c974a675e 100644
--- a/src/lib/efl/interfaces/efl_text_format.eo
+++ b/src/lib/efl/interfaces/efl_text_format.eo
@@ -77,7 +77,7 @@ interface @beta Efl.Text_Format {
  }
   }
 
-  @property linegap {
+  @property line_gap {
  [[Minimal line gap (top and bottom) for each line in the text.
 
$value is absolute size.
@@ -88,7 +88,7 @@ interface @beta Efl.Text_Format {
  }
   }
 
-  @property linerelgap {
+  @property line_rel_gap {
  [[Relative line gap (top and bottom) for each line in the text.
 
The original line gap value is multiplied by $value.
@@ -99,7 +99,7 @@ interface @beta Efl.Text_Format {
  }
   }
 
-  @property tabstops {
+  @property tab_stops {
  [[Size of the tab character.]]
  values
  {
diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo 
b/src/lib/evas/canvas/efl_canvas_textblock.eo
index 442c418fcd..7ea9609836 100644
--- a/src/lib/evas/canvas/efl_canvas_textblock.eo
+++ b/src/lib/evas/canvas/efl_canvas_textblock.eo
@@ -259,7 +259,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
 
- $tabstops: Size (in pixels) of the tab character. The value must 
be a number greater than one.
  Default value is $[32].
- See @Efl.Text_Format.tabstops.
+ See @Efl.Text_Format.tab_stops.
 
- $linesize: Distance (in pixels) from the baseline of one line of 
text to the next. This is, a value of
  $[0] would render all lines on top of each other (However, this 
value will be ignored if it results in
@@ -276,13 +276,13 @@ class @beta Efl.Canvas.Textblock extends 
Efl.Canvas.Object implements Efl.Text,
- $linegap: Additional empty space (in pixels) between the bottom 
of one line of text and the top of the
  next. Setting this value sets $linerelgap to $[0%] (disables it).
  Default value is $[0].
- See @Efl.Text_Format.linegap.
+ See @Efl.Text_Format.line_gap.
 
- $linerelgap: Additional empty space (in percentage over the 
natural line height) between the bottom of
  one line of text and the top of the next.
  Setting this value sets $linegap to $[0] (disables it).
  Default value is $[0%].
- See @Efl.Text_Format.linerelgap.
+ See @Efl.Text_Format.line_rel_gap.
 
- $linefill: An alternate way to specify the $linesize as a 
percentage of the canvas height.
  A value of $[100%] means that a single line fills the canvas, 
whereas $[25%] means that 4 lines
@@ -489,9 +489,9 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
   Efl.Text_Format.text_horizontal_align { get; set; }
   Efl.Text_Format.text_horizontal_align_auto_type { get; set; }
   Efl.Text_Format.text_vertical_align { get; set; }
-  Efl.Text_Format.linegap { get; set; }
-  Efl.Text_Format.linerelgap { get; set; }
-  Efl.Text_Format.tabstops { get; set; }
+  Efl.Text_Format.line_gap { get; set; }
+  Efl.Text_Format.line_rel_gap { get; set; }
+  Efl.Text_Format.tab_stops { get; set; }
   Efl.Text_Format.password { get; set; }
   Efl.Text_Format.replacement_char { get; set; }
   Efl.Text_Markup.markup { set; get; }
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index bdbe9b18c8..03d4a4bdc7 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -16833,7 +16833,7 @@ 
_efl_canvas_textblock_efl_text_format_text_vertical_align_get(const Eo *obj EINA
 }
 
 static void
-_efl_canvas_textblock_efl_text_format_linegap_set(Eo *obj EINA_UNUSED, 
Efl_Canvas_Textblock_Data *o EINA_UNUSED, double value EINA_UNUSED)
+_efl_canvas_textblock_efl_text_format_line_gap_set(Eo

[EGIT] [core/efl] master 01/01: efl_text_cursor: line jump by fix movement

2019-12-25 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=84685df233b2e499227a6c4e990c6216117a9a21

commit 84685df233b2e499227a6c4e990c6216117a9a21
Author: Ali Alzyod 
Date:   Thu Dec 26 09:55:28 2019 +0900

efl_text_cursor: line jump by fix movement

Summary:
When the cursor is at line beginning of line, and user click "Up" then 
"Down" on keyboard cursor will position at second character.
If text is:  **occaecat \n mollit**

Reviewers: woohyun, zmike, cedric, segfaultxavi

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8454

Differential Revision: https://phab.enlightenment.org/D10947
---
 src/lib/evas/canvas/evas_object_textblock.c | 2 +-
 src/tests/evas/evas_test_textblock.c| 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index c47175fcc2..5516e712bd 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -11033,7 +11033,7 @@ 
evas_textblock_cursor_line_jump_by(Efl_Text_Cursor_Handle *cur, int by)
pnode = cur->node;
ppos = cur->pos;
 
-   evas_textblock_cursor_geometry_get(cur, , NULL, , NULL, NULL, 
EVAS_TEXTBLOCK_CURSOR_UNDER);
+   evas_textblock_cursor_geometry_get(cur, , NULL, , NULL, NULL, 
EVAS_TEXTBLOCK_CURSOR_BEFORE);
cx += (cw / 2);
evas_textblock_cursor_paragraph_last(cur);
last = evas_textblock_cursor_line_geometry_get(cur, NULL, NULL, NULL, NULL);
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index f4806cb459..3a112a0048 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4522,6 +4522,13 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
   efl_text_cursor_text_object_get(cursor1),
   efl_text_cursor_text_object_get(cursor_temp));
 
+   efl_text_set(txt, "occaecat \n mollit");
+   efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
+   efl_text_cursor_line_jump_by(cur_obj, 1);
+   efl_text_cursor_line_jump_by(cur_obj, -1);
+   ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
+
+
END_EFL_CANVAS_TEXTBLOCK_TEST();
 }
 EFL_END_TEST

-- 




[EGIT] [core/efl] master 01/01: elm_entry: remove variation sequences as part of glyph when delete clusters

2019-12-25 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c008309f78c285d39f3a25986a5238a89f91cff6

commit c008309f78c285d39f3a25986a5238a89f91cff6
Author: Ali Alzyod 
Date:   Thu Dec 26 06:53:13 2019 +0900

elm_entry: remove variation sequences as part of glyph when delete clusters

Summary:
This will fix the task:
T8542

Remove variation sequences as part of glyph when deleting clusters, 
variation sequence is meaningless alone, so they should be removed when deleting

Reviewers: woohyun, bowonryu

Reviewed By: bowonryu

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10956
---
 src/lib/evas/canvas/evas_object_textblock.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index c25b9dcc7a..c47175fcc2 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -10153,11 +10153,11 @@ 
_evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc
Evas_Object_Textblock_Text_Item *ti = 
_ITEM_TEXT(last_it);
Evas_Text_Props_Info *info = ti->text_props.info;
int it_index = ((inc) ? cur->pos : ret) - 
last_it->text_pos;
-
+   *is_single_glyph = EINA_FALSE;
Evas_Font_OT_Info ot = {0};
+   Evas_BiDi_Direction itdir = ti->text_props.bidi_dir;
if (ti->text_props.len != ti->text_props.text_len)/*if 
code point count same as glyph count skip it*/
  {
-Evas_BiDi_Direction itdir = 
ti->text_props.bidi_dir;
 int i = 0;
 if (itdir == EFL_TEXT_BIDIRECTIONAL_TYPE_RTL)
   {
@@ -10200,9 +10200,14 @@ 
_evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc
}
   }
  }
-   else
+   if (*is_single_glyph == EINA_FALSE)
  {
-is_single_glyph = EINA_FALSE;
+   Eina_Unicode content = 0;
+   if (!inc && cur->pos > 0)
+  content = 
eina_ustrbuf_string_get(cur->node->unicode)[cur->pos - 1];
+   else if (inc && cur->pos >= 0 && 
eina_ustrbuf_length_get(cur->node->unicode) > (cur->pos + 1))
+  content = 
eina_ustrbuf_string_get(cur->node->unicode)[cur->pos + 1];
+   if (VAR_SEQ(content)) *is_single_glyph = EINA_TRUE;
  }
 }
 #else//#ifdef OT_SUPPORT

-- 




[EGIT] [core/efl] master 01/01: efl_text_cursor: assign source textobject to destination on cursor_copy

2019-12-24 Thread Ali Alzyod
woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=79d95a289ad571d666c93c9f47f8557621175fe9

commit 79d95a289ad571d666c93c9f47f8557621175fe9
Author: Ali Alzyod 
Date:   Tue Dec 24 17:17:31 2019 +0900

efl_text_cursor: assign source textobject to destination  on cursor_copy

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8454

Differential Revision: https://phab.enlightenment.org/D10951
---
 src/lib/evas/canvas/efl_text_cursor.c | 6 +-
 src/tests/evas/evas_test_textblock.c  | 6 ++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/efl_text_cursor.c 
b/src/lib/evas/canvas/efl_text_cursor.c
index 54c9ad5f85..b52298c1c0 100644
--- a/src/lib/evas/canvas/efl_text_cursor.c
+++ b/src/lib/evas/canvas/efl_text_cursor.c
@@ -105,10 +105,13 @@ _efl_text_cursor_compare(const Eo *obj EINA_UNUSED, 
Efl_Text_Cursor_Data *pd, co
 EOLIAN static void
 _efl_text_cursor_copy(const Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, 
Efl_Text_Cursor *dst)
 {
+   Efl_Text_Cursor_Data *pd_dest = efl_data_scope_safe_get(dst, MY_CLASS);
+   EINA_SAFETY_ON_NULL_RETURN(pd_dest);
if (!pd->handle) return;
 
Efl_Text_Cursor_Handle *handle = 
evas_object_textblock_cursor_new(pd->handle->obj);
evas_textblock_cursor_copy(pd->handle, handle);
+   pd_dest->text_obj = pd->text_obj;
efl_text_cursor_handle_set(dst, handle);
evas_textblock_cursor_unref(handle, NULL);
 }
@@ -432,7 +435,8 @@ efl_text_cursor_handle_get(const Eo *obj)
 
 void efl_text_cursor_text_object_set(Eo *cursor, Eo *canvas_text_obj, Eo 
*text_obj)
 {
-   Efl_Text_Cursor_Data *pd = efl_data_scope_get(cursor, MY_CLASS);
+   Efl_Text_Cursor_Data *pd = efl_data_scope_safe_get(cursor, MY_CLASS);
+   EINA_SAFETY_ON_NULL_RETURN(pd);
Efl_Text_Cursor_Handle *handle = NULL;
if (efl_isa(canvas_text_obj, EFL_CANVAS_TEXTBLOCK_CLASS))
  {
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index 43be1fcd53..f4806cb459 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4516,6 +4516,12 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
 
ck_assert_int_eq(changed_emit, 3);
 
+   Eo *cursor_temp = efl_add(EFL_TEXT_CURSOR_CLASS, txt);
+   efl_text_cursor_copy(cursor1 ,cursor_temp);
+   ck_assert_ptr_eq(
+  efl_text_cursor_text_object_get(cursor1),
+  efl_text_cursor_text_object_get(cursor_temp));
+
END_EFL_CANVAS_TEXTBLOCK_TEST();
 }
 EFL_END_TEST

-- 




[EGIT] [core/efl] master 01/01: efl_text_attribute_factory: rename to efl_text_formatter

2019-12-20 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8dbc75fdce3a88bbb7cd29ab9ee2383b4d76417d

commit 8dbc75fdce3a88bbb7cd29ab9ee2383b4d76417d
Author: Ali Alzyod 
Date:   Fri Dec 20 12:35:13 2019 +0100

efl_text_attribute_factory: rename to efl_text_formatter

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8455

Differential Revision: https://phab.enlightenment.org/D10925
---
 src/bin/elementary/test_efl_ui_text.c  |  2 +-
 src/lib/elementary/efl_ui_textbox.c| 20 -
 src/lib/evas/Efl_Canvas.h  |  2 +-
 src/lib/evas/Evas_Eo.h |  2 +-
 src/lib/evas/Evas_Internal.h   | 12 +-
 ...xt_attribute_factory.c => efl_text_formatter.c} | 26 +++---
 ..._attribute_factory.eo => efl_text_formatter.eo} |  4 ++--
 src/lib/evas/canvas/meson.build|  4 ++--
 src/tests/evas/evas_test_textblock.c   |  8 +++
 9 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/src/bin/elementary/test_efl_ui_text.c 
b/src/bin/elementary/test_efl_ui_text.c
index 1d098c1052..dc1748bd07 100644
--- a/src/bin/elementary/test_efl_ui_text.c
+++ b/src/bin/elementary/test_efl_ui_text.c
@@ -16,7 +16,7 @@ _apply_style(Eo *obj, size_t start_pos, size_t end_pos, const 
char *style)
efl_text_cursor_position_set(start, start_pos);
efl_text_cursor_position_set(end, end_pos);
 
-   efl_text_attribute_factory_attribute_insert(start, end, style);
+   efl_text_formatter_attribute_insert(start, end, style);
 
efl_del(start);
efl_del(end);
diff --git a/src/lib/elementary/efl_ui_textbox.c 
b/src/lib/elementary/efl_ui_textbox.c
index 26e09f0f72..31531d9ef6 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -2808,7 +2808,7 @@ 
_textblock_node_format_to_atspi_text_attr(Efl_Text_Attribute_Handle *annotation)
Efl_Access_Text_Attribute *ret;
const char *txt;
 
-   txt = efl_text_attribute_factory_attribute_get(annotation);
+   txt = efl_text_formatter_attribute_get(annotation);
if (!txt) return NULL;
 
ret = calloc(1, sizeof(Efl_Access_Text_Attribute));
@@ -2843,7 +2843,7 @@ _efl_ui_textbox_efl_access_text_attribute_get(const Eo 
*obj, Efl_Ui_Textbox_Data
efl_text_cursor_position_set(cur1, *start_offset);
efl_text_cursor_position_set(cur2, *end_offset);
 
-   annotations = efl_text_attribute_factory_range_attributes_get(cur1, cur2);
+   annotations = efl_text_formatter_range_attributes_get(cur1, cur2);
 
efl_del(cur1);
efl_del(cur2);
@@ -2889,7 +2889,7 @@ _efl_ui_textbox_efl_access_text_text_attributes_get(const 
Eo *obj, Efl_Ui_Textbo
efl_text_cursor_position_set(cur1, *start_offset);
efl_text_cursor_position_set(cur2, *end_offset);
 
-   annotations = efl_text_attribute_factory_range_attributes_get(cur1, cur2);
+   annotations = efl_text_formatter_range_attributes_get(cur1, cur2);
 
efl_del(cur1);
efl_del(cur2);
@@ -2924,7 +2924,7 @@ 
_efl_ui_textbox_efl_access_text_default_attributes_get(const Eo *obj, Efl_Ui_Tex
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
 
-   annotations = efl_text_attribute_factory_range_attributes_get(start, end);
+   annotations = efl_text_formatter_range_attributes_get(start, end);
 
EINA_ITERATOR_FOREACH(annotations, an)
  {
@@ -3288,14 +3288,14 @@ _anchor_get(Eo *obj, Efl_Ui_Textbox_Data *sd, 
Efl_Text_Attribute_Handle *an)
Eina_List *i;
const char *str;
 
-   str = efl_text_attribute_factory_attribute_get(an);
+   str = efl_text_formatter_attribute_get(an);
 
EINA_LIST_FOREACH(sd->anchors, i, anc)
  {
 if (anc->annotation == an) break;
  }
 
-   if (!anc && (efl_text_attribute_factory_attribute_is_item(an) || 
!strncmp(str, "a ", 2)))
+   if (!anc && (efl_text_formatter_attribute_is_item(an) || !strncmp(str, "a 
", 2)))
  {
 const char *p;
 
@@ -3304,7 +3304,7 @@ _anchor_get(Eo *obj, Efl_Ui_Textbox_Data *sd, 
Efl_Text_Attribute_Handle *an)
   {
  anc->obj = obj;
  anc->annotation = an;
- anc->item = efl_text_attribute_factory_attribute_is_item(an);
+ anc->item = efl_text_formatter_attribute_is_item(an);
  p = strstr(str, "href=");
  if (p)
{
@@ -3344,7 +3344,7 @@ _anchors_update(Eo *obj, Efl_Ui_Textbox_Data *sd)
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
 
-   it = efl_text_attribute_factory_range_attributes_get(start, end);
+   it = efl_text_formatter_range_attributes_get(s

[EGIT] [tools/examples] master 01/01: EXAMPLES efl.text.style: reflect updates

2019-12-20 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/tools/examples.git/commit/?id=870cda67308f28a1b7cc1fdf00560872fc9f358e

commit 870cda67308f28a1b7cc1fdf00560872fc9f358e
Author: Ali Alzyod 
Date:   Fri Dec 20 10:00:30 2019 +0100

EXAMPLES efl.text.style: reflect updates

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Differential Revision: https://phab.enlightenment.org/D10898
---
 apps/csharp/calculator/src/calculator.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/csharp/calculator/src/calculator.cs 
b/apps/csharp/calculator/src/calculator.cs
index f60f9bdc..933f3dc5 100644
--- a/apps/csharp/calculator/src/calculator.cs
+++ b/apps/csharp/calculator/src/calculator.cs
@@ -178,8 +178,8 @@ public class Calculator : Efl.Csharp.Application
table.PackTable(screen, 0, 0, 4, 1);
screen.TextHorizontalAlign = 0.9;
screen.TextVerticalAlign = 0.5;
-   screen.EffectType = Efl.TextStyleEffectType.Glow;
-   screen.GlowColor = (128, 128, 128, 128);
+   screen.TextEffectType = Efl.TextStyleEffectType.Glow;
+   screen.TextGlowColor = (128, 128, 128, 128);
screen.ChangedEvent += ScreenChangedCb;
 }
 }

-- 




[EGIT] [core/efl] master 01/01: efl.text.cursor: clean eo files from comments

2019-12-19 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=46fef6901d29336d52a482d95cecc95ba22d35f9

commit 46fef6901d29336d52a482d95cecc95ba22d35f9
Author: Ali Alzyod 
Date:   Thu Dec 19 16:07:12 2019 +0100

efl.text.cursor: clean eo files from comments

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8454

Differential Revision: https://phab.enlightenment.org/D10926
---
 src/lib/evas/canvas/efl_text_cursor.eo | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/lib/evas/canvas/efl_text_cursor.eo 
b/src/lib/evas/canvas/efl_text_cursor.eo
index 7d957e1fe6..70cfdfad21 100644
--- a/src/lib/evas/canvas/efl_text_cursor.eo
+++ b/src/lib/evas/canvas/efl_text_cursor.eo
@@ -26,13 +26,11 @@ enum @beta Efl.Text.Cursor_Move_Type
paragraph_prev   [[Advances to the end of the previous paragraph.]]
 }
 
-// Missing pen_geometry get? - probably not, that's the cursor geometry with 
under.
-// Should we always do split cursor and "under" should just be content 
geometry? -- probably!
-//  Problem with this is that it doesn't necessarily work correctly vertically.
 class @beta Efl.Text.Cursor extends Efl.Object implements Efl.Duplicate{
[[Cursor API.]]
c_prefix: efl_text_cursor;
methods {
+
   @property position {
  [[Cursor position.]]
  set {  }
@@ -41,6 +39,7 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
 position: int; [[Cursor position.]]
  }
   }
+
   @property content {
  [[The content of the cursor (the character under the cursor).]]
  get {
@@ -49,6 +48,7 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
 content: Eina.Unicode; [[The unicode codepoint of the character.]]
  }
   }
+
   @property content_geometry {
  [[The geometry of the item/char pointed by the cursor.]]
  get { }
@@ -56,6 +56,7 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
 geometry: Eina.Rect; [[The geometry in pixels.]]
  }
   }
+
   @property line_number {
  [[The line the cursor is on.]]
  set {  }
@@ -101,6 +102,7 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
  }
  return: bool; [[$true if cursors are equal, $false otherwise.]]
   }
+
   compare @const {
  [[Compare two cursors
Return <0 if cursor position less than dst, 0 if cursor == dest and 
>0 otherwise.]]
@@ -109,12 +111,14 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
  }
  return: int; [[Difference between cursors.]]
   }
+
   copy @const {
  [[Copy existing cursor to destination cursor, like position and 
cursor text object.]]
  params {
 dst: Efl.Text.Cursor; [[Destination Cursor.]]
  }
   }
+
   move {
  [[Move the cursor.]]
  params {
@@ -122,14 +126,11 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
  }
  return: bool; [[True if actually moved.]]
   }
+
   char_delete {
  [[Deletes a single character from position pointed by given cursor.]]
   }
 
-  // FIXME: It's just implemented as range delete with cluster start + end.
-  // Should we have convenience wrappers for those though? This and 
cluster prev/next?
-  // cluster_delete {
-
   line_jump_by {
  [[Jump the cursor by the given number of lines.]]
  params {
@@ -153,7 +154,6 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
  }
   }
 
-  // FIXME: Add a way to add with a length parameter (always have it?) so 
we just copy n characters, or all if -1. Useful for saving copies when 
inserting from another source.
   text_insert {
  [[Adds text to the current cursor position and set the cursor to
*after* the start of the text just added.]]
@@ -184,7 +184,7 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
 cur2: Efl.Text.Cursor; [[End of range.]]
  }
   }
-  // FIXME: returning an iterator here feels a bit stupid
+
   range_geometry_get {
  [[Get the simple geometry in pixels of a range in the text.
 
@@ -197,6 +197,7 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
  return: iterator @move; [[
 Iterator on all geoemtries of the given range.]]
   }
+
   range_precise_geometry_get {
  [[Get the "precise" geometry in pixels of a range.
 
@@ -208,6 +209,7 @@ class @beta Efl.Text.Cursor extends Efl.Object implements 
Efl.Duplicate{
  return: iterator @move

[EGIT] [core/efl] master 01/01: efl.text.format: rename methods and properties

2019-12-17 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=365159c5ea83812fe0e5b05cd744db363ce8b28d

commit 365159c5ea83812fe0e5b05cd744db363ce8b28d
Author: Ali Alzyod 
Date:   Tue Dec 17 15:54:49 2019 +0100

efl.text.format: rename methods and properties

Summary:
efl.text.format: rename methods and properties

this change will avoid conflict in the future with other interfaces or 
class methods.

T8533

Reviewers: woohyun, segfaultxavi, zmike, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: cedric, #committers, #reviewers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10895
---
 src/lib/efl/interfaces/efl_text_format.eo   |  6 +++---
 src/lib/evas/canvas/efl_canvas_textblock.eo | 10 +-
 src/lib/evas/canvas/evas_object_textblock.c | 12 ++--
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_text_format.eo 
b/src/lib/efl/interfaces/efl_text_format.eo
index 05d5226407..79e62883da 100644
--- a/src/lib/efl/interfaces/efl_text_format.eo
+++ b/src/lib/efl/interfaces/efl_text_format.eo
@@ -54,14 +54,14 @@ interface @beta Efl.Text_Format {
  }
   }
 
-  @property horizontal_align_auto_type {
+  @property text_horizontal_align_auto_type {
  [[Horizontal alignment of text.]]
  values {
 value: Efl.Text_Format_Horizontal_Alignment_Auto_Type; [[Alignment 
type.]]
  }
   }
 
-  @property horizontal_align {
+  @property text_horizontal_align {
  [[Horizontal alignment of text. $[0.0] means "left"
and $[1.0] means "right".]]
  values {
@@ -69,7 +69,7 @@ interface @beta Efl.Text_Format {
  }
   }
 
-  @property vertical_align {
+  @property text_vertical_align {
  [[Vertical alignment of text.$[0.0] means "top"
and $[1.0] means "bottom"]]
  values {
diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo 
b/src/lib/evas/canvas/efl_canvas_textblock.eo
index 3b686918ee..d183574817 100644
--- a/src/lib/evas/canvas/efl_canvas_textblock.eo
+++ b/src/lib/evas/canvas/efl_canvas_textblock.eo
@@ -194,7 +194,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
  $right (Puts the text at the right of the line), $start (Alias 
for $auto), $end (Puts the text at the
  opposite side of LTR/RTL settings).
  Default value is $auto.
- See @Efl.Text_Format.horizontal_align.
+ See @Efl.Text_Format.text_horizontal_align.
 
- $valign: Vertical alignment of the text. The value can either be 
a decimal number ($[0.0] means "top"
  and $[1.0] means "bottom"), a percentage ($[0%] means "top" and 
$[100%] means "bottom") or one of:
@@ -202,7 +202,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
  $middle (Alias for $center), $bottom (Puts the text at the bottom 
of the text box),
  $baseline (Puts the text's baseline at the middle of the text 
box), $base (Alias for $baseline).
  Default value is $baseline.
- See @Efl.Text_Format.vertical_align.
+ See @Efl.Text_Format.text_vertical_align.
 
- $wrap: Wrapping policy of the text. The value must be one of the 
following: $word (Only wraps lines at
  word boundaries), $char (Wraps at any character), $mixed (Wraps 
at word boundaries if possible,
@@ -479,9 +479,9 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
   Efl.Text_Format.ellipsis { get; set; }
   Efl.Text_Format.wrap { get; set; }
   Efl.Text_Format.multiline { get; set; }
-  Efl.Text_Format.horizontal_align { get; set; }
-  Efl.Text_Format.horizontal_align_auto_type { get; set; }
-  Efl.Text_Format.vertical_align { get; set; }
+  Efl.Text_Format.text_horizontal_align { get; set; }
+  Efl.Text_Format.text_horizontal_align_auto_type { get; set; }
+  Efl.Text_Format.text_vertical_align { get; set; }
   Efl.Text_Format.linegap { get; set; }
   Efl.Text_Format.linerelgap { get; set; }
   Efl.Text_Format.tabstops { get; set; }
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 63f725f00c..3af3fb2897 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -16750,7 +16750,7 @@ 
_efl_canvas_textblock_efl_text_format_multiline_get(const Eo *obj EINA_UNUSED, E
 }
 
 static void
-_efl_canvas_textblock_efl_text_format_horizontal_align_auto_type_set(Eo *obj, 
Efl_Canvas_Textblock_Data *o, Efl_Text_Format_Horizontal_Alignment_Auto_Type 
type)
+_efl_canvas_textblock_efl_text_f

[EGIT] [core/efl] master 01/01: efl_canvas_textblock: allow style_apply with wrap=none

2019-12-16 Thread Ali Alzyod
xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=68e9bf9c14b58c682d5151f73b21f920905bd320

commit 68e9bf9c14b58c682d5151f73b21f920905bd320
Author: Ali Alzyod 
Date:   Mon Dec 16 19:10:36 2019 +0100

efl_canvas_textblock: allow style_apply with wrap=none

Summary:
1- passing style_apply("wrap=none") had no effect previously, and now 
disable wraping
2- style_all_get() by default return "wrap=word", but now return  
"wrap=none"

refer to T8523

Reviewers: segfaultxavi, woohyun, cedric

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10888
---
 src/lib/evas/canvas/efl_canvas_textblock.eo | 2 +-
 src/lib/evas/canvas/evas_object_textblock.c | 7 ++-
 src/tests/evas/evas_test_textblock.c| 4 
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo 
b/src/lib/evas/canvas/efl_canvas_textblock.eo
index 2c00967374..7c6cf8e0e6 100644
--- a/src/lib/evas/canvas/efl_canvas_textblock.eo
+++ b/src/lib/evas/canvas/efl_canvas_textblock.eo
@@ -274,7 +274,7 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object 
implements Efl.Text,
  "char" - Wraps at any character
  "mixed" - Wrap at words if possible, if not at any character
  "hyphenation" - Hyphenate if possible, if not wrap at words if 
possible, if not at any character
- "" - Don't wrap
+ "none" - Don't wrap, this is the default value
  wrap=
 
  Left margin
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index e68f70351a..63f725f00c 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -2921,6 +2921,8 @@ _default_format_command(Evas_Object *eo_obj, 
Evas_Object_Textblock_Format *fmt,
   wrap = EFL_TEXT_FORMAT_WRAP_MIXED;
 else if (!strcmp("hyphenation", param))
   wrap = EFL_TEXT_FORMAT_WRAP_HYPHENATION;
+else if (!strcmp("none", param))
+  wrap = EFL_TEXT_FORMAT_WRAP_NONE;
 
 if (_FMT_INFO(wrap) != wrap)
   {
@@ -3304,9 +3306,12 @@ _format_string_get(const Eo *eo_obj, 
Evas_Object_Textblock_Format *fmt)
 case EFL_TEXT_FORMAT_WRAP_HYPHENATION:
   wrap_value_str = "hyphenation";
   break;
-default:
+case EFL_TEXT_FORMAT_WRAP_WORD:
   wrap_value_str = "word";
   break;
+default:
+  wrap_value_str = "none";
+  break;
  }
 
PRINTF_APPEND_STR(wrapstr, wrap_value_str);
diff --git a/src/tests/evas/evas_test_textblock.c 
b/src/tests/evas/evas_test_textblock.c
index 16fd38f437..94849a57e1 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4628,6 +4628,7 @@ EFL_START_TEST(efl_canvas_textblock_style)
fail_if(!strstr(style, "font=DejaVuSans,UnDotum,malayalam"));
// default value
fail_if(!strstr(style, "font_width=normal"));
+   fail_if(!strstr(style, "wrap=none"));
 
// from functions
fail_if(!strstr(style, "font_weight=extrabold"));
@@ -4641,6 +4642,9 @@ EFL_START_TEST(efl_canvas_textblock_style)
efl_canvas_textblock_style_apply(txt, "font_width=ultracondensed");
ck_assert_int_eq(efl_text_font_width_get(txt), 
EFL_TEXT_FONT_WIDTH_ULTRACONDENSED);
 
+   efl_canvas_textblock_style_apply(txt, "wrap=word");
+   ck_assert_int_eq(efl_text_wrap_get(txt), EFL_TEXT_FORMAT_WRAP_WORD);
+
efl_canvas_textblock_style_apply(txt, "wrap=none");
ck_assert_int_eq(efl_text_wrap_get(txt), EFL_TEXT_FORMAT_WRAP_NONE);
 

-- 




  1   2   >