Commit Graph

356 Commits

Author SHA1 Message Date
thierry1970 97f95e7362 Added the heif loader
Summary: that supports images : *.heif, *hiec and *.avif I have disabled *.avif images, there is already a loader.

Reviewers: stefan_schmidt, raster

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

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12135
2021-02-06 18:58:04 +00:00
Ali Alzyod e138962dd7 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
2021-01-29 09:05:51 +02:00
Felipe Magno de Almeida 0363fd8238 evas: Rename EAPI macro to EVAS_API in Evas library
Summary:
Patch from a series of patches to rename EAPI symbols to specific
library DSOs.

=  The Rationale =

This patch is from a series of patches to rename EAPI symbols to
specific library DSOs.

EAPI was designed to be able to pass
`__attribute__ ((visibility ("default")))` for symbols with
GCC, which would mean that even if -fvisibility=hidden was used
when compiling the library, the needed symbols would get exported.

MSVC __almost__ works like GCC (or mingw) in which you can
declare everything as export and it will just work (slower, but
it will work). But there's a caveat: global variables will not
work the same way for MSVC, but works for mingw and GCC.

For global variables (as opposed to functions), MSVC requires
correct DSO visibility for MSVC: instead of declaring a symbol as
export for everything, you need to declare it as import when
importing from another DSO and export when defining it locally.

With current EAPI definitions, we get the following example
working in mingw and MSVC (observe it doesn't define any global
variables as exported symbols).

Example 1:
dll1:
```
EAPI void foo(void);

EAPI void bar()
{
  foo();
}
```
dll2:
```
EAPI void foo()
{
  printf ("foo\n");
}
```

This works fine with API defined as __declspec(dllexport) in both
cases and for gcc defining as
`__atttribute__((visibility("default")))`.

However, the following:
Example 2:

dll1:

```
EAPI extern int foo;
EAPI void foobar(void);

EAPI void bar()
{
  foo = 5;
  foobar();
}
```

dll2:

```
EAPI int foo = 0;
EAPI void foobar()
{
  printf ("foo %d\n", foo);
}
```

This will work on mingw but will not work for MSVC. And that's why
LIBAPI is the only solution that works for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>

Reviewers: vtorri, woohyun, jptiz, lucas

Reviewed By: vtorri, lucas

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12214
2020-12-15 23:06:12 -03:00
Carsten Haitzler 6b47edd998 evas test - fix evas suite image data compare
the test was wrong and waiting to fail. it worked by luck before, but
it was comparing a deleted image's data vs a new one that replaced it.

this fixes that. makes the test suite now reliable. asan pointed this
out.

@fix
2020-11-13 09:51:13 +00:00
WooHyun Jung 509e3fcc7a Revert "Revert "evas_textblock: rainbow flag emoji treated as two clusters(update unibreak to version 4.2)""
This reverts commit 173b3a108e.
This was reverted because of freezing codes for release.
Now, release work was over. So, I think it's ok to restore this.
2020-10-08 12:32:53 +09:00
Carsten Haitzler 82de87dfc5 evas test - check return of ftell and malloc and handle properly
fix CID 1400871
2020-09-20 00:20:36 +01:00
Stefan Schmidt 173b3a108e Revert "evas_textblock: rainbow flag emoji treated as two clusters(update unibreak to version 4.2)"
This reverts commit 1ab71284db.

We are in freeze.
2020-09-01 13:00:33 +02:00
Youngbok Shin 6e02557535 evas_textblock: remove style padding from native width and formatted height
Summary:
The style padding was included in native width(not in native height)
and formatted height(not in formatted width).
This is so weired. In addition, there is no enough document about
the relation between formatted size, native size and the style padding.
This issue is caused by a confusing code which is about how to handle
the style padding on item's width and height.("x_adjustment"!)

When Evas calculates "c->wmax" in line finalization stage, it explicitly subtract
style padding from line width. So, I assumed the formatted size has not to include
style padding. It is same for the native size.

The style padding will not be included in formatted size and native size by this commit.
@fix

Test Plan:
A test case is included in this commit.

Evas_Object *tb = evas_object_textblock_add(evas);

newst = evas_textblock_style_new();
evas_textblock_style_set(newst, "DEFAULT='font=Sans font_size=50 color=#000 text_class=entry'");
evas_object_textblock_style_set(tb, newst);

evas_object_textblock_text_markup_set(tb, "<style=far_soft_shadow>Test</>");
evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b);
fail_if((l != 0) || (r != 4) || (t != 0) || (b != 4));

/* Size with style padding */
evas_object_textblock_size_formatted_get(tb, &w, &h);
evas_object_textblock_size_native_get(tb, &nw, &nh);

/* It is non-sense if the following condition is true. */
fail_if((w + l + r == nw) && (h == nh + t + b));

Reviewers: raster, ali.alzyod, woohyun, bowonryu

Reviewed By: ali.alzyod

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12110
2020-09-01 19:39:13 +09:00
AbdullehGhujeh 1ab71284db evas_textblock: rainbow flag emoji treated as two clusters(update unibreak to version 4.2)
Summary:
if we have rainbow flag emoji (&#x1f3f3;&#xfe0f;&#x200d;&#x1f308;)
we can use mouse/keyboard to move cursor inside it because we break it into two clusters, we break on 1F308,

This is wrong as we should treat emoji as a single cluster (based on rules mentioned in Unicode segmentation standard “Do not break within emoji modifier sequences or emoji ZWJ sequences” (https://unicode.org/reports/tr29/#GB11 )).

this issue happens because we don’t give 1F308 its correct grapheme break property value, I think this is a bug in the unibreak library as this Unicode 1F308 should have word break class value equals to Glue_After_ZWJ (based on https://www.unicode.org/reports/tr29/tr29-31.html#Glue_After_Zwj_WB and http://unicode.org/Public/emoji/5.0/emoji-zwj-sequences.txt) which will not make it break and we will get a single cluster.

I noticed that the current unibreak lib used in EFL  seems to implement Unicode 9  (latest is Unicode 13) which uses obsolete and unused grapheme break property, such as E_Modifier & Glue_After_ZWJ, so if a new emoji introduced (rainbow flag was introduced after Unicode 9)  and based on Unicode 9 it should use property  E_Modifier or Glue_After_ZWJ we will have issue with it.

So I have updated unibreak lib using latest released version of unibreak (4.2) which implement Unicode 12.

I needed to remove **BREAK_AFTER(i)** to pass the tests in D1140 as spaces do not break on latest update (also related to T995).

{F3868712}

this should fix T8665 & T8688

Reviewers: ali.alzyod, woohyun, bowonryu, zmike, segfaultxavi, bu5hm4n

Reviewed By: ali.alzyod

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8665

Differential Revision: https://phab.enlightenment.org/D11743
2020-09-01 19:33:52 +09:00
AbdullehGhujeh eb0f7183dd Efl Canvas Text : canvas textblock changed not fired for shadow format (style_apply)
Summary:
If shadow format changed using style_apply , the event EFL_CANVAS_TEXTBLOCK_EVENT_CHANGED will not be fired.
also added tests for it.

Reviewers: ali.alzyod, woohyun

Reviewed By: ali.alzyod

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11078
2020-08-18 18:10:04 +09:00
Ali Alzyod 4ad272a8c3 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<Eina.h>
#include<Efl.h>
#include <Elementary.h>

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 ==  "A&lt;&lt;&gt;&gt;&quot;A&apos;<tab/>A";
   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
2020-08-18 17:34:02 +09:00
Ali Alzyod ed18471ba9 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
2020-08-05 13:09:00 +09:00
AbdullehGhujeh ea6a6afef5 evas_textblock : return correct value for gfx_filter_get
return the same variable set with gfx_filter_set.
added test for it.

Reviewed-by: Ali Alzyod <ali198724@gmail.com>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12071
2020-07-29 09:50:59 +02:00
AbdullehGhujeh c43630c22a evas textblock : update font source when it set using font_source_set
Summary:
when we set font source, for example with efl_text_font_source_set, the font source will not be updated in the textblock.

this is have same results that has been done in D9548

Test Plan:
   #define EFL_EO_API_SUPPORT 1
   #define EFL_BETA_API_SUPPORT 1

   #include <Efl_Ui.h>

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

   static Eo *
   _create_label(Eo *win, Eo *bx)
   {
      Eo *en;
      en = efl_add(EFL_UI_TEXTBOX_CLASS, win);
      printf("Added Efl.Ui.Text object\n");
      efl_text_interactive_editable_set(en, EINA_FALSE);
      efl_pack(bx, en);
      return en;
   }

   static void
   _gui_setup()
   {
      char buf[512], f_buf[512];
      Eo *win, *bx;

      win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
                  efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
                  efl_text_set(efl_added, "Hello World"),
                  efl_ui_win_autodel_set(efl_added, EINA_TRUE));

      // when the user clicks "close" on a window there is a request to delete
      efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL);

      bx = efl_add(EFL_UI_BOX_CLASS, win,
                  efl_content_set(win, efl_added),
                  efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240)));

      snprintf(buf, sizeof(buf), "./TestFontSource.eet");

      Eo *en = _create_label(win, bx);
      efl_text_set(en, "Hello, This Text Use The Font : Does_Not_Exists_Font_1 : Source + Font Name");
      efl_text_font_source_set(en, buf);
      efl_text_font_family_set(en, "Does_Not_Exists_Font_1");
      efl_text_font_size_set(en, 35);

      en = _create_label(win, bx);
      efl_text_set(en, "Hello, This Text Use The Font : Does_Not_Exists_Font_1 : Font Name");
      efl_text_font_family_set(en, "Does_Not_Exists_Font_1");
      efl_text_font_size_set(en, 35);

      en = _create_label(win, bx);
      efl_text_set(en, "Hello, This Text Use The Font : Does_Not_Exists_Font_2 : Source + Font Name");
      efl_text_font_source_set(en, buf);
      efl_text_font_family_set(en, "Does_Not_Exists_Font_2");
      efl_text_font_size_set(en, 35);

      en = _create_label(win, bx);
      efl_text_set(en, "Hello, This Text Use The Font : Does_Not_Exists_Font_2 : Font Name");
      efl_text_font_family_set(en, "Does_Not_Exists_Font_2");
      efl_text_font_size_set(en, 35);
   }

   EAPI_MAIN void
   efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
   {
      _gui_setup();
   }
   EFL_MAIN()

Reviewers: ali.alzyod, woohyun, bowonryu, cedric

Reviewed By: ali.alzyod

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11757
2020-06-22 17:02:05 +09:00
AbdullehGhujeh e3e3d0cfe4 Textblock : Fix cursor cluster movement when emoji at the line start
Summary:
if we have emoji only or emoji at line start we can move cursor using mouse click to be inside the emoji.

{F3868502}

this should fix T8664

Test Plan:
  #include <Elementary.h>

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

     elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
     win = elm_win_util_standard_add("emoji-test", "emoji-test");
     elm_win_autodel_set(win, EINA_TRUE);

     /* and now just resize the window to a size you want. normally widgets
      * will determine the initial size though */
     evas_object_resize(win, 320, 320);

     Evas_Object *box;
     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);
     elm_win_resize_object_add(win, box);

     Evas_Object *entry;
     entry = elm_entry_add(box);

     elm_entry_entry_set(entry, "&#x262a;&#xfe0f;");

     evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
     evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);

     elm_box_pack_end(box, entry);

     evas_object_show(entry);
     evas_object_show(box);

     /* and show the window */
     evas_object_show(win);

     elm_run(); /* and run the program now, starting to handle all
                 * events, etc. */

     /* exit code */
     return 0;
  }
  ELM_MAIN()

Reviewers: ali.alzyod, woohyun, bowonryu, zmike, bu5hm4n

Reviewed By: ali.alzyod

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8664

Differential Revision: https://phab.enlightenment.org/D11732
2020-06-22 16:31:54 +09:00
Stefan Schmidt b209bb051b tests: evas: check fd being non -1 before using close()
eina_file_mkstemp would return -1 in an error case. Make sure we check
the return when clsoing here.

CID: 1400790

Reviewed-by: Christopher Michael <devilhorns@comcast.net>
Differential Revision: https://phab.enlightenment.org/D11957
2020-06-10 10:07:59 +02:00
Marcel Hollerbach 41c90a9ae3 build: add eet to evas suite
evas suite seems to use internal headers, which includes eet.
2020-06-02 08:54:19 +02:00
Marcel Hollerbach 6184bf670f build: do not link test suite again against static libs
this might result in duplicated symbols.
2020-06-02 08:07:48 +02:00
Marcel Hollerbach 8e3606698e refactor build
libraries are split into deps, external deps, and pub deps.
Evas engines are refactored to use the predefined engine deps.

this is preparation work for efl-one.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11806
2020-05-27 11:06:46 +02:00
Stefan Schmidt 7e2ae1e7e3 build: disable leak detection in address sanitizer build for tests as well
Summary:
The same principle we use for the build stage we use here for running
our tests. Leak detection has just to many problems for us on the
shutdown path that it makes no sense to use here.

I am also bumping the evas timeout form the default 30s to 60 as I have
been running into timeouts with asan enabled on my machine. This would
not change anything on a default build.
Depends on D11137

Reviewers: smohanty, bu5hm4n, raster, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11862
2020-05-26 09:54:57 -04:00
Mike Blumenkrantz e0cf299ae5 tests: resolve float comparison warnings
Summary: Depends on D11788

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11789
2020-05-09 09:25:14 +01:00
Ali Alzyod 3dff471826 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 <Eina.h>
#include <Efl.h>
#include <Elementary.h>

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=#000000 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 < 10000; i++)
   {
      evas_object_resize(textblock, sizes[i % 2], sizes[i % 2]);
      evas_object_textblock_style_insets_get(textblock, &l, &r, &t, &b);
   }
   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
2020-05-04 15:25:07 -04:00
Carsten Haitzler 3283a11a88 evas_textblock/evas_text/evas_textgrid: 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 <Elementary.h>
/*
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, "&#x262a;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
2020-04-18 17:36:25 +01:00
Carsten Haitzler d9b9647a15 Revert "evas_textblock: pick textrun fonts"
This reverts commit 9b987c67e1.

this breaks color emoji in terminology (evas textgrid).
2020-04-17 19:20:26 +01:00
Ali Alzyod 7ac765c71b evas_textblock: prevent segfault if there are no style
```
#include <Elementary.h>

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

   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);

   textblock = evas_object_textblock_add(win);
   evas_object_resize(textblock, 360, 360);
   evas_object_show(textblock);
   evas_object_textblock_text_markup_set(textblock, "<b>b</b>");
   evas_object_resize(win, 360, 360);
   evas_object_show(win);
   elm_run();

   return 0;
}
ELM_MAIN()
```

this application will crash.

Any font format specified in text, if there are now style will cause the crash.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11686
2020-04-17 11:14:57 +02:00
Ali Alzyod 9b987c67e1 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 <Elementary.h>
/*
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, "&#x262a;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
2020-04-17 12:28:42 +09:00
Ali Alzyod 208c1938bc evas_test: change START_TEST to EFL_START_TEST
Summary: evas_test: change START_TEST to EFL_START_TEST

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11716
2020-04-16 12:03:23 -04:00
Xavi Artigas f526ad8c26 Fix namespace clashes for Efl.Text.Cursor
Three renames are applied here:
Efl.Text.Cursor -> Efl.Text_Cursor.Object (class)
Efl.Text.Cursor_Type -> Efl.Text_Cursor.Type (enum)
Efl.Text.Cursor_Move_Type -> Efl.Text_Cursor.Move_Type (enum)

Nothing changes for the enums on the C side. For the class... Well,
the method names are a bit more verbose now.

These renames are required to avoid clashing with the Efl.Text interface.
This did not cause trouble to C# because interfaces are prefixed with "I",
but it did cause trouble to Eolian when the EO files were installed and
somebody tried to use them.
Ref T8648

Differential Revision: https://phab.enlightenment.org/D11663
2020-04-14 12:25:55 +02:00
Marcel Hollerbach a4d7698492 evas_textblock_tests: do not free a text cursor here
the cur_obj would have been always dead at this point, as the textblock
was freed. This now moved the textcursor object to a previous point.
However, we could also remove the explicit cursor deletion...

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11596
2020-03-25 22:13:25 +01:00
Hermet Park 476e2b0521 canvas 3d: remove all canvas3d features across efl.
Reviewers: jsuya, kimcinoo, bu5hm4n, raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11552
2020-03-25 19:14:02 +09:00
Mike Blumenkrantz 565fa76a11 tests/evas: verify loading and mmap values for efl.file are correct with skip_head
ensure that these functions are still usable with async load

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11424
2020-03-06 13:30:52 +01:00
Mike Blumenkrantz 7768b54043 tests/evas: add simple test for skip_head property
Summary:
when using this property, there should be no mmap loaded after a call
to evas_object_image_file_set, and we want to make sure the image is
eventually loaded

ref T8378

Depends on D11340

Reviewers: raster

Reviewed By: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8378

Differential Revision: https://phab.enlightenment.org/D11341
2020-02-14 08:33:49 -05:00
Ali Alzyod 4f99a37aee 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
2020-02-11 12:10:00 +01:00
abdulleh Ghujeh f5e13284d7 Evas Textblock: update obstacle test
Summary:
Update the test to check that the first character is rendered after the obstacle.
To ensure that the obstacle feature keeps working correctly.

Reviewers: ali.alzyod, woohyun

Reviewed By: ali.alzyod

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11033
2020-02-06 15:36:30 +09:00
Ali Alzyod 3560b0f62f evas_object_textbox: deal with <br> <tab> without closing '/'
This causes many issues because textbox functions deals with <br> <tab> differently depending that user write them with or without '/' at the end (for example <br> vs <br/>)
while most functionaliity are the same (like viewing <br> and <br/> are the same).
cursor dealing with these tags can be differently.
now we will assume <br> <tab> are already have there own closing tag, even if it is missing

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11293
2020-02-05 17:41:24 +01:00
Ali Alzyod ba99891710 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
2020-02-04 17:54:34 +01:00
Shinwoo Kim 50f3648391 evas proxy: make it work for File_Save.save
Summary:
File_Save.save does not work for proxy object from following commit.

   c53f152 evas: Make save() work on snapshots

Test Plan:
1. Add an image object and set source object.
evas_object_image_source_set(obj, source);

2. Save the object as a file when you need.
evas_object_image_save(obj, "./file_name.png", NULL, NULL);

Reviewers: cedric, Hermet, jsuya

Reviewed By: Hermet

Subscribers: zmike, subodh6129, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10629
2020-02-04 12:06:38 +09:00
Ali Alzyod ad63375199 efl.text.cursor: movement types rename
Summary: replace prev with previous, replace char with character

Reviewers: woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8567

Differential Revision: https://phab.enlightenment.org/D11095
2020-01-20 10:07:40 +09:00
Ali Alzyod d6649ad80a 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 <netstar@gmail.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11020
2020-01-13 11:33:14 +01:00
Ali Alzyod 1a02745a88 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
2020-01-09 22:33:07 +09:00
Ali Alzyod 7b0a44dd33 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
2020-01-09 12:16:55 +01:00
Ali Alzyod 41c7e1c908 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
2020-01-02 12:16:11 +01:00
Ali Alzyod 64d160da0a efl.text.style: underline enum rename + underline method fix
Summary: underline methods was not working + fix enums names

Reviewers: woohyun, segfaultxavi, bu5hm4n, zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7945

Differential Revision: https://phab.enlightenment.org/D10975
2019-12-30 13:27:13 +09:00
Ali Alzyod e583b9159e 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
2019-12-27 16:10:24 +09:00
Ali Alzyod 3bd4f04ec7 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
2019-12-26 18:01:32 +09:00
a.srour 43bd6ab7ea Efl.Text.Cursor: Add tests for evas_suite
Summary: This patch add tests for almost all `Efl.Text.Cursor` exposed methods.

Test Plan: Using `ninja test`

Reviewers: ali.alzyod, segfaultxavi, woohyun

Subscribers: #committers, cedric, #reviewers

Tags: #efl

Maniphest Tasks: T8454

Differential Revision: https://phab.enlightenment.org/D10950
2019-12-26 17:45:30 +09:00
Ali Alzyod a239fc4a1a efl_text_cursor: movement word start/end
Summary:
This patch will make **efl_text_cursor_move** method, when it is working with **WORD_START** or **WORD_END** If no actual movement happened then return false, and do not fire CHANGE event

for example if cursor at word start, and we call efl_text_cursor_move(cursor, word_start);
1- this call should return false because no actual movement happened. If no actual movement happened then return false
2- this call should not fire CHANGE event for cursor.and do not fire CHANGE event

Reviewers: woohyun, segfaultxavi, cedric, zmike

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8454

Differential Revision: https://phab.enlightenment.org/D10949
2019-12-26 16:05:37 +09:00
Ali Alzyod 84685df233 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
2019-12-26 09:55:28 +09:00
Ali Alzyod 79d95a289a 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
2019-12-24 17:17:31 +09:00
a.srour ce28963654 Efl.Text.Cursor: Fix line_jump_by return logic
Summary:
From documentation `line_jump_by` should return `EINA_TRUE` if cursor moved, and `EINA_FALSE` if not moved.
But the current behaviour is reversed, so this should fix it.

Reviewers: ali.alzyod, segfaultxavi, woohyun

Subscribers: AbdullehGhujeh, #committers, cedric, #reviewers

Tags: #efl

Maniphest Tasks: T8454

Differential Revision: https://phab.enlightenment.org/D10946
2019-12-24 16:34:14 +09:00