Commit Graph

30761 Commits

Author SHA1 Message Date
Wander Lairson Costa b767e28625 Protect EINA_(UN)LIKELY with parenthesis around the expr
Without it an expression like !EINA_LIKELY(a && b) expands
!a && b

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Differential Revision: https://phab.enlightenment.org/D12041
2020-07-03 18:17:29 +02:00
Marcel Hollerbach d55b7939d6 evas_common_privat: improve tiler merge flag
when this is a int and you assign 0, the whole "0" for the entire int is
moved. When this is a bit flag like this, it is a simple | operation,
which makes the whole thing somehow faster.

Reviewed-by: Christopher Michael <devilhorns@comcast.net>
Differential Revision: https://phab.enlightenment.org/D11998
2020-07-01 10:13:08 +02:00
Jaehyun Cho 1e06c01f82 elc_naviframe: fix to show pushed item if top item is deleted
If top item is deleted in "transition,finished" smart callback by user
before _on_item_push_finished is not finished, then pushed item is
hidden in _on_item_push_finished and no item is visible.

To resolve the above issue, _on_item_push_finished does not hide
pushed item if pushed item becomes top item.
2020-07-01 16:19:16 +09:00
Christopher Michael 682e9a6b55 ecore-evas-wayland: Fix minor typo in error message 2020-06-29 09:01:54 -04:00
SangHyeon Jade Lee 2ead5df728 elementary : fix key unselect unhighlighting issue
Summary:
  in multiselect mode,
  selected item is not unhighlighted by key unselect.

Test Plan: tested in elementary_test gengrid

Reviewers: eagleeye

Reviewed By: eagleeye

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12035
2020-06-29 16:38:44 +09:00
Carsten Haitzler 9932ceeec3 ecore evas wl - cnp - dont segv is data is null
this is probably wrong but crashing is not nice... bettr to NOP than
crash right now.
2020-06-28 22:52:17 +01:00
Lucas Cavalcante de Sousa a733f9c233 Native Windows: Eina: Resolve bad comparison while using windows strerror_s
`strerror_s` is the windows alternative of `strerror_r` used by EFL.

`strerror_s` never return the error code with the message as
`strerror_r` does, because of that, while comparing the first 14
characters of `Unknown error ` to the message from unknown code 4096
(`Unknown error`) they were accusing being different - in UNIX this
works because the message returned is `Unknown error 4096`.
This error was noticeable at `eina_error_test_failures` test case.

This Diff adds the error code to the message in case of an `Unknown
error`, making the windows implementation compliant with UNIX.

Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Reviewed-by: Wander Lairson Costa <wander.lairson@gmail.com>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12033
2020-06-26 17:17:13 +02:00
Vincent Torri cdaac43d3a Windows: fix eina_file_map_new()
the offset passed to MapViewOfFile() must be a multiple of the granularity.

https://docs.microsoft.com/en-us/windows/win32/memory/creating-a-view-within-a-file is taken as basis for this patch

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: Wander Lairson Costa <wander.lairson@gmail.com>
Differential Revision: https://phab.enlightenment.org/D12031
2020-06-26 15:40:57 +02:00
Wander Lairson Costa 0e61c08c2b Fix eina file thread test on Windows
On windows, we try to open the "cmd.exe" file, but without the full path
the test fails unless it runs from the system directory.

We now use the full path to test the eina_file_open function.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D12021
2020-06-26 15:37:44 +02:00
Subhransu Mohanty 6ab86d5052 gengrid: Fix memory leak
Reviewers: SanghyeonLee

Reviewed By: SanghyeonLee

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11930
2020-06-25 17:02:49 +09:00
Myoungwoon Roy, Kim 1b1f59a0fc docs: Fix typo in elm_config API reference
I had found a typo in elm_config_scroll_animation_disabled_set() and fixed it

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12029
2020-06-25 09:14:45 +02:00
Marcel Hollerbach 2dcb18acac eina_array: micro optimize eina_array_push
This commit does two things:
- Tell the compiler that it is unlikely that we need to grow, and that
  it is unlikely that data is NULL. Sometimes the if check for data
  would get dropped out by the compiler when it can be ensured that it is
  != NULL. However, if we for example efl_add something and eina_push
  the result, the condition would not be removed, as there is no assertion
  efl_add would be != NULL.

- Do not hide the array assignment in a branch, but make it the default
  branch, this way instruction cache caches the correct instruction, as
  branch prediction will now hopefully, due to the hinting, take the
  correct branch.

While benchmarking this here (simply in elementary_perf), this reduced
pipeline faults in eina_array_push quite a bit. (Btw. it is hard to track
*which* exact calls to eina_array_push do cause that, as mostly this API
gets inlined, so it was easier optimizing that, instead of the method
arround)

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11997
2020-06-25 09:03:09 +02:00
Elyes HAOUAS dc4fd17a9c Fix typos - (Part #5)
Fix some typos

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12019
2020-06-25 09:03:07 +02:00
Elyes HAOUAS 3e7f317313 Fix typos
Fix some typos

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12015
2020-06-25 09:03:05 +02:00
junsu choi fd4f4c4364 Revert "Efl.Gfx.Path: Change draw of a rounded rect from arc to quadratic"
Summary:
This reverts commit 4f15bde706.
It is the correct way to draw with arc_to.
And breaking compatibility for current_get.

Test Plan: N/A

Reviewers: Hermet, kimcinoo, herb

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12030
2020-06-25 13:13:31 +09:00
Joao Antonio Cardoso 3cf052af33 efl_check.h: Replace stack allocated array by heap allocated
clang-cl doesn't support the syntax of dynamic stack allocated arrays.

ref: windows-native-port

Co-authored-by: Lucas <Coquinho@users.noreply.github.com>

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11970
2020-06-23 17:21:22 +02:00
Carsten Haitzler 7308011cff ecore-x vysnc - env var - fix typo 2020-06-23 14:01:11 +01:00
Carsten Haitzler 3c307c4b25 ecore wl - make comment note about allocating buffers 2020-06-23 14:01:10 +01:00
Wander Lairson Costa be5b6b2476 eina_test_file.c: Do not test errno if the function doesn't fail
errno only holds a valid value if the function returns an error.

ref: windows-native-port

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11971
2020-06-23 14:03:28 +02:00
Elyes HAOUAS e137478dc5 Get rid of trailing whitespaces (14 / 14)
Remove  trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12006
2020-06-23 10:31:48 +02:00
Elyes HAOUAS 47b71d898e Get rid of trailing whitespaces (13 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12012
2020-06-23 10:31:36 +02:00
Elyes HAOUAS c7da405ae7 Get rid of trailing whitespaces (12 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12011
2020-06-23 10:31:22 +02:00
Elyes HAOUAS 727167ced6 Get rid of trailing whitespaces (11 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12010
2020-06-23 10:31:05 +02:00
Elyes HAOUAS 17151e2eb8 Get rid of trailing whitespaces (10 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12009
2020-06-23 10:30:36 +02:00
Elyes HAOUAS 1f61788c86 Get rid of trailing whitespaces (9 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12008
2020-06-23 10:30:26 +02:00
Elyes HAOUAS 032894a489 Get rid of trailing whitespaces (8 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12007
2020-06-23 10:30:16 +02:00
Elyes HAOUAS 1a9b5fcf70 Get rid of trailing whitespaces (7 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12005
2020-06-23 10:30:05 +02:00
Elyes HAOUAS 0a0bba64c7 Get rid of trailing whitespaces (6 / 14)
Remove whitespaces
Differential Revision: https://phab.enlightenment.org/D12004
2020-06-23 10:29:37 +02:00
Elyes HAOUAS 1d91d61514 Get rid of trailing whitespaces (5 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12003
2020-06-23 10:29:25 +02:00
Elyes HAOUAS 1fd0435f21 Get rid of trailing whitespaces (4 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12002
2020-06-23 10:29:14 +02:00
Elyes HAOUAS c2be0d0dba Get rid of trailing whitespaces (3 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12001
2020-06-23 10:28:13 +02:00
Elyes HAOUAS 108ee1d485 Get rid of trailing whitespaces (2 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12000
2020-06-23 10:27:35 +02:00
Elyes HAOUAS 09a7dadbac Get rid of trailing whitespace (1 / 14)
Remove trailing whitespace
Differential Revision: https://phab.enlightenment.org/D11999
2020-06-23 10:25:57 +02:00
junsu choi 4f15bde706 Efl.Gfx.Path: Change draw of a rounded rect from arc to quadratic
Summary:
The rounded rect is a very slightly different shape compared
to chrome's svg output. To solve this, modify to use a quadratic bezier
instead of arc when drawing a round.

Test Plan:
{F3904500}
(Drawing rect with arc or quadratic)

Compare Image
{F3904501}

{F3904502}

Reviewers: Hermet, kimcinoo, herb

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12020
2020-06-23 13:46:43 +09:00
Ali Alzyod c501d09c3a 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
2020-06-22 17:31:54 +09:00
Ali Alzyod fd24fb568e 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
2020-06-22 17:27:42 +09:00
Ali Alzyod 8f3be603c2 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
2020-06-22 17:16:34 +09:00
Ali Alzyod 1a2811bae4 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
2020-06-22 17:16:02 +09: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
Ali Alzyod 1bbd03b768 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
2020-06-22 16:54:51 +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
Boris Faure abc146f37f eina_unicode: have explicit type conversions
Summary:
Found by running terminology's tests with UBSAN:
include/eina-1/eina/eina_inline_unicode.x:
runtime error: implicit conversion from type 'char' of value
-62 (8-bit, signed) to type 'unsigned char' changed the value to 194
(8-bit, unsigned)

Reviewers: #reviewers, vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11972
2020-06-20 11:37:56 +01:00
Shinwoo Kim b61f755e88 elm_scroller: use region of proxy soruce for loop
Summary:
If size of elm_sclloer content is too big, then the proxy of
elm_scroller to show loop effect does not work. Because
evas_gl_common_image_surface_new does not allow
bigger size surface than max_texture_size.

Reviewers: Hermet, jsuya, herb

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11996
2020-06-19 16:07:07 +09:00
Carsten Haitzler 5e4f81bb6f efreet caceh - fix coverity report
fix CID 1429935
2020-06-19 00:56:08 +01:00
Vincent Torri f04316e3f0 meson: add Solaris support
Summary: Add Solaris support for meson

Test Plan: test on OpenIndiana

Reviewers: raster, bu5hm4n, stefan_schmidt

Reviewed By: raster, stefan_schmidt

Subscribers: alarcher, stefan_schmidt, bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11973
2020-06-18 14:36:48 +01:00
Vincent Torri fbd3bc6262 tests: eina: fix ENOMEM message on Windows and solaris
On Windows and solaris the string associated to ENOMEM is "Not enough space"

Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11983
2020-06-18 13:45:09 +02:00
Carsten Haitzler 047872e7cc efreet - mtime 0 fix build on windows 2020-06-18 11:35:44 +01:00
Carsten Haitzler a5b84c6c6e efreetd - cache - add more statinfo work around 0 mtime distros
some distros 9notably in this case nixos) want to do reproducible
builds. to them this means going around setting mtime for all files to
0. this means efreetd not only thinks mtime is invalid/stupid (0 is
generally just that as midnight on jan 1 1970 is not exactly a
sensible dare for a modified timestamp of a file as no filesystem with
any sanity will have not been modified since that time), but it keeps
mtime at 0 even when things update. this totally breaks efreetd that
expects to find mtime increases over time as things change. it's
necessary because it has to perform a "are mu caches up to date" scan
of all file data it caches and it needs to know if it should rebuild
something based on this.

so this does a few things:

1. it makes mtime have to be an exact match to the cache, not cache
mtime >= file mtime. so any change forward or back is an inavlidation.
2. it now also uses ctime, mode, size, uid, gid, block count and if a
symlink, the sha1 of the symlink path in addition and any change to
these == invalid.

this adds a lot of code and changes how dirs get scanned a bit but it
means it can pick up changes on these 0 mtime distros.

interestingly the policy of mtime being 0 is to have a reprodcible fs
... but ctime still changes and is > 0, as does inode info, so it's
not actually possible to have it totally work... but they try still,
so this is a fix for that problem.

whilst i was doing thisi also noticed efreetd re-red dirs many times
due to icon theme inhritance. i also fixed that to do a LOT less
syscalls by only scanning a dir once as i was rejigging the scanning
code at the time anyway. this should optimize thr scan costs at
efreetd startup too.

@fix
@opt
2020-06-18 11:13:52 +01:00
Taehyub Kim cd9059d13e elm_image: remove the spaces and keep the indentation for elm_image_file_set()
Summary: there are wrong indentation in the elm_image_file_set, so removed the tabs

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11988
2020-06-17 21:17:23 +09:00
Stefan Schmidt 9c773ed5cf benchmarks: eina: make sure we do not divide by zero
Make sure we do not divide by i if it is zero here.

CID: 1400768

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11956
2020-06-17 14:06:17 +02:00