Commit Graph

260 Commits

Author SHA1 Message Date
Yeongjong Lee 721f1776db evas_events: prevent double event_freeze in evas_object_freeze_events_set
Summary:
This patch prevent that event_freeze_count is greater than 1 in
`evas_object_freeze_events_set`

Test Plan: make check

Reviewers: bu5hm4n, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8325
2019-03-15 11:23:09 -04:00
Mike Blumenkrantz 91b84fa2a8 evas: restore legacy types which were defined to eo types
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8245
2019-03-08 12:06:24 -08:00
Mike Blumenkrantz a5e183ad5d efl.canvas.object: clip -> clipper && clipees -> clipped_objects
Summary:
also clipees_has -> clipped_objects_count

ref T7555

Depends on D8039

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7555

Differential Revision: https://phab.enlightenment.org/D8040
2019-02-27 13:17:37 -05:00
Mike Blumenkrantz 6326e18b3f efl.file: improve api a bit
Summary:
the previous implementation/api had a number of issues:
* "file" property contained both "file" and "key" values
  - also performed file loading operation
* "load_error" property which was specific to image objects
* no methods for controlling file loading/unloading

this patch attempts the following changes:
* split "file" property into "file" and "key" properties
  - also remove "key" from existing "mmap" property
* remove "load_error"
* directly return error codes from operations
* add "load" and "unload" methods for directly controlling load state
* add implicit file loading if file/mmap is set during construction
* rewrite all efl.file implementations to move file loading into load() method
* rewrite all usage of efl.file api based on these changes
* add C extension functions to mimic previous behavior

ref T7577

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: vitor.sousa, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7577

Differential Revision: https://phab.enlightenment.org/D8018
2019-02-27 13:17:10 -05:00
Mike Blumenkrantz 9aca866fd1 efl.text_markup: move cursor-related methods to efl.text_markup_interactive
many users of the markup property are not interactive text cases, so splitting
off the interactive methods resolves a number of unimplemented method issues

ref T5719

Differential Revision: https://phab.enlightenment.org/D7787
2019-01-30 13:32:04 +01:00
Chris Michael 26caf1641f evas_test_textblock: Fix unused variable warning
In evas_textblock_cursor test, the variable 'dir' is only used if
HAVE_FRIBIDI is defined. If that is not defined, then we get an unused
variable warning when compiling. This patch wraps the variable around
an #ifdef so that it does not get declared without FRIBIDI support.
2019-01-29 11:03:09 -05:00
Mike Blumenkrantz 956a66c748 evas_canvas3d_mesh: implement get methods for efl.file file and mmap props
also add unit tests for new methods

ref T5719

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7785
2019-01-26 11:42:14 +01:00
Shinwoo Kim 3a89ea15b9 evas cache image: compare with cached image file
As cache2 knows cached image could be not matched even though
hash key is not different.

Please refer to the following comment of evas_cache2_image_open.

   /* image we found doesn't match what's on disk (stat info wise)
    * so dirty the active cache entry so we never find it again. this
    * also implicitly guarantees that we only have 1 active copy
    * of an image at a given key. we wither find it and keep re-reffing
    * it or we dirty it and get it out */

The hash key is created base on the image file address.
If the image file address to find does not equal cached image file address
then it means that the cached image is no longer valid.

This case could happen with the following step.

(1) Call evas_object_image_memfile_set with content data A
(2) Call evas_object_image_memfile_set with content data B
(3) Add timer with short time (ex: 0.01 sec)
(4) Delete A image, and add A image in timer callback
(5) Delete B image, and add B image in timer callback

Sometimes you could see image of A from the B image, because newly created
image at step 5 has same address of setp 1.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D6870
2018-11-29 16:01:48 -08:00
Daniel Hirt de72dd5730 Evas textblock: fix test to use provided hyphen dictionary
This fixes the test suite so it does not rely on the system's dictionary
files.

Fixes T7466
2018-11-16 11:21:53 +02:00
Youngbok Shin 09da85807a evas textblock: remove white space after line-break by a next item
Summary:
In some cases, white space at end of line is remained after line-break.
This issue is happened when Textblock do word wrap at the next item. Without
spliting a previous text item. Then, Textblock just skipped calling
_layout_item_text_split_strip_white() function.

This patch also fixed a wrong test case based on wrong logic.
The range rectangles shouldn't be overlapped. Because of remained white space,
a meaningless rectangle was added. And it overlapped by next rectangle.
@fix

Test Plan:
Fixed an exising test case for range renctangles.
Run test case.

Reviewers: herdsman, woohyun, raster, cedric, subodh, subodh6129

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7204
2018-11-14 10:48:54 +02:00
Carsten Haitzler 11b9f9a4dd evas test - actually use result of add of rect obj for test 2018-11-09 11:43:59 +00:00
Daniel Hirt 9903e7d556 Text: add markup_range_get
This allows to retrieve the markup representation of the current text.

@feature
2018-11-05 17:31:06 +02:00
Daniel Hirt 2caa38f166 Canvas text: fix line_jump_by logic
Some cases of line_jump_by did not emit "cursor,changed" when it should
have.

@fix
2018-11-05 17:31:06 +02:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Yeongjong Lee 02d83ebcd4 docs: Fix typos in API reference doc and comments.
Reviewers: Hermet, segfaultxavi

Reviewed By: Hermet, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6948
2018-08-31 17:45:31 +09:00
Youngbok Shin 517018e008 evas textblock: add/apply cursor cluster APIs based on grapheme cluster
Summary:
Add a feature for moving cursor over a grapheme cluster.
It is applied to edje_entry.c and elm_entry.c for improving
cursor handling just like other modern text editors. ex) gedit
The patch on Evas needs to update libunibreak library.
So, the patch will update libunibreak, too.
@feature

Test Plan:
1. Put "ഹലോ" in your entry.
2. Your cursor can reach at the end of text from the beginning
   only in 2 right key event with this feature.

Reviewers: raster, cedric, jpeg, herdsman, zmike, devilhorns

Reviewed By: herdsman, zmike

Subscribers: #reviewers, #committers, zmike, bowonryu, woohyun

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5490
2018-08-20 10:29:32 -04:00
Shinwoo Kim 355effed5f test/evas: add to check smart class overriding
Summary:
If Evas_Smart_Class.move is overridden,
then user defined move function should be used.
Check if "https://phab.enlightenment.org/D6468" works or not.

Reviewers: zmike

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6740
2018-08-06 16:21:55 +09:00
Youngbok Shin f6acd6f9e4 Evas Textblock: Don't convert <br/> to <ps/> after changing text
Summary:
It was only happened when legacy newline is enabled. By default,
legacy newline is enabled. As I know, legacy newline option has
to change textblock's internal behavior. But, it shouldn't change
the given original text. It fixes T3399.

Test Plan: A Test case is included in Evas test suite.

Reviewers: Jaehyun_Cho, z-wony, tasn, woohyun, herdsman, Blackmole, devilhorns

Subscribers: #committers, zmike, raster, cedric, jpeg

Tags: #efl

Maniphest Tasks: T3399

Differential Revision: https://phab.enlightenment.org/D3874
2018-07-02 18:33:45 +03:00
Hosang Kim df652673fe evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().

Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`

#include <Evas.h>
#include <Ecore.h>

Eina_Bool
_timer_cb (void *data)
{
    ecore_main_loop_quit();
    return 0;
}
int
main(int argc, char *argv[])
{

   evas_init();
   Evas *evas = evas_new();
   Evas_Object *obj = evas_object_box_add(evas);
   Evas_Object *rect = evas_object_rectangle_add(evas);
   evas_object_color_set(rect, 255, 255, 255, 255);
   evas_object_resize(rect, 300, 400);
   evas_object_show(rect);

   evas_object_box_append(obj, rect);

   evas_object_show(obj);
   ecore_timer_add(2.0, _timer_cb, NULL);
   ecore_main_loop_begin();

   evas_shutdown();
   return 0;
}

Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 07:50:31 -04:00
Cedric Bail 4a3b0e7f25 evas: improve test to actually test something meaningful. 2018-05-24 16:02:20 -07:00
Youngbok Shin f17cae08e6 evas textblock: manage default style properly for new interfaces
Summary:
Calling efl_canvas_text_style_set() with empty key means
setting a default style to object. But, it counldn't store style
as default properly. It caused a crash issue from elementary_test.
@fix

Test Plan:
New test case is included. Run test suite. Or,
1. Run elementary_test
2. Find and launch "Image Zoomable animation" test.
3. Close the image test window.
4. See the crash issue.

Reviewers: raster, herdsman, jpeg, cedric, zmike

Subscribers: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5692

Committer's note: rebased and removed unrelated test.
2018-05-16 22:24:11 +03:00
Youngbok Shin f437a3075a evas textblock: update format nodes when a Evas Textblock Style is updated
Summary:
A style tag among a text has to be replcaed by its matched tag when
a format node is created. If the matched tag is changed, format nodes
should be updated.
But, if a style text for Evas Textblock Style is changed,
related format nodes are not updated without setting new text.
The patch changes to update format nodes when new style text is set.
@fix

Test Plan: Included in Evas Test Suite.

Reviewers: raster, tasn, herdsman, subodh6129, zmike

Subscribers: zmike, cedric, z-wony, Blackmole

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D4697

Committer's note: rebased.
2018-05-16 22:24:11 +03:00
Youngbok Shin 73c39bcf12 Evas textblock: fix wrong hyphenation issues with non UTF8 encoded dictionary
Summary:
hnj_hyphen_hyphenate2() needs properly encoded text based on the given
dictionary. Each dictionary contains its encoding information at the head
of file. So, text will be converted to proper encoding before calling
the function. It fixes T3221.
@fix

Test Plan: Included in Evas test suite.

Reviewers: z-wony, tasn, woohyun, herdsman, Blackmole, minudf

Subscribers: zmike, stefan_schmidt, raster, cedric, jpeg

Tags: #efl

Maniphest Tasks: T3221

Differential Revision: https://phab.enlightenment.org/D3863
2018-05-06 12:01:41 +03:00
Youngbok Shin c33ef15d5d evas textblock: fix double free issue from user style push/pop and free
Summary: The Textblock Style which is created for user style was managed
application side.  It is created and free'd from application - outside
of Evas Textblock.  Recently, evas_object_textblock_style_user_push/pop
start to call efl_canvas_text_style_set() instead of legacy code. The
problem is efl_canvas_text_style_set() is always going to call free()
when a style is going to be deleted.  It makes conflicts(double free
issue) with application which is used to call
evas_textblock_style_free().  So, the issue will be fixed by this patch.

The patch also revise push/pop/peek code to make clean and avoid
meaningless calculation/events.

@fix

Test Plan:
A test case is Included in this patch.
The test case try to trigger double free.

Reviewers: herdsman, raster, cedric

Subscribers: zmike, woohyun

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5812

Committer's note: formatted commit summary (80 width).
2018-05-06 12:01:41 +03:00
Mike Blumenkrantz 35a600c2d0 tests: parallelize evas mesh tests
Summary:
ref T6857
Depends on D5912

Reviewers: stefan_schmidt

Subscribers: cedric

Maniphest Tasks: T6857

Differential Revision: https://phab.enlightenment.org/D5913
2018-05-03 15:04:57 +02:00
Xavi Artigas 55bd097a3d Efl.Gfx.Entity (from Efl.Gfx)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:32 -07:00
Mike Blumenkrantz 22cb35c9a4 tests: use loop test to split jpeg tests from evas_object_image_all_loader_data
Summary:
jpeg loader tests take 4+ seconds due to manual value comparisons, so ensure
that they run separately

ref T6856

Reviewers: stefan_schmidt

Subscribers: cedric

Maniphest Tasks: T6856

Differential Revision: https://phab.enlightenment.org/D5911
2018-04-17 15:14:52 +02:00
Mike Blumenkrantz 224ff7c86a tests: fix iterator leak in evas mesh tests
Summary: Depends on D5911

Reviewers: stefan_schmidt

Reviewed By: stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5912
2018-04-13 13:53:39 +02:00
Mike Blumenkrantz 624925fe6e tests: move to using checked fixtures for all test suites
individual tests should not need to explicitly call init/shutdown functions
in most cases, and many did not properly do this anyway

see followup commit which resolves some issues with eina tests

ref T6813
ref T6811

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:26 +02:00
Mike Blumenkrantz adc601aca2 tests: add instrumentation to existing tests to find slow tests
efl_check.h must be included and the EFL_START/END_TEST macros must be
used in place of normal START/END_TEST macros

timing is enabled when TIMING_ENABLED is set
https://phab.enlightenment.org/w/improve_tests/

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:25 +02:00
Cedric BAIL de667f889e tests: fix misuse of eina_file in evas mesh tests
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Daniel Hirt 4a905a22a4 Canvas image: add Efl.Canvas.Text.Factory + use in Ui.Text
This interface has a simple 'create' method to create Efl.Canvas.Object
given a key.
This is used higher-up in Ui.Text in the next commit.

Ui text: add ability to set item factories

Added API to set an item factory object.
This is similar to the previous item providers (that worked with
callbacks).

You instantiate a factory object and set it on the Ui.Text object.
Each factory implements the "create" method from
Efl.Canvas.Text.Item_Factory.

This also includes 3 public factories (Image, Emoticon and Fallback):
  - Image factory: creates images from added entries (key strings)
  - Emoticon factory: creates emoticons by querying the theme
  - Fallback: creates image, then falls back to emoticon

If no factory is set, then the fallback (internal) factory is used.

See the added "Ui.text Item Factory" test in elementary_test for an
example of usage.

@feature
2018-01-18 10:20:28 -08:00
Carsten Haitzler e30fb6945e fix evas test suite to now init both ecore and evas.... correctly.
see c8dcc4327b803e9b8ad2a0985e756c924946c442 - basicall evas depends
on ecore these days... thus requires ecore be initted THEN evas. ...
which in theory is an abi break for those using evas and ONLY evas
long ago from when efl was separate... but it''s how we're building
these days.

@fix
2018-01-05 02:34:16 +09:00
Daniel Hirt 45d3614345 Canvas text: fix width calculation with style effects
There are multiple places in the code where both the padded item's
width and the maximum style padding (at the edges) are accounted for.
For the sake of making calculations for wrapping/ellipsis we should
only use the maximum style padding.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-11-10 10:29:49 -08:00
Daniel Hirt 0725ff620b Canvas text: update style pad when no format nodes are present
This updates the style pad even if there are no format nodes.
An example of this is having a default style set to the object.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-11-10 10:29:44 -08:00
Youngbok Shin a386597ad9 evas textblock: handle ellipsis when text's height exceed its area by "br"
Summary:
Textblock's ellipsis feature only worked when text's width exceeds its area.
So, it didn't work when text's height exceeds its area by "br" tags.
This patch will do ellipsis when only ellipsis=1.0 is set.
@fix

Test Plan: make check

Reviewers: herdsman, raster, cedric, jpeg, sohyun

Reviewed By: raster

Subscribers: woohyun

Differential Revision: https://phab.enlightenment.org/D5412
2017-11-06 11:29:43 +09:00
Jean-Philippe Andre b19ee757e5 efl: Use Eina.Size2D in Gfx.View 2017-09-19 10:51:48 +09:00
Jean-Philippe Andre 2df8ad36b4 evas: Use Eina.Slice on the stack (gfx.buffer) 2017-09-19 10:51:48 +09:00
Jean-Philippe Andre 4c634ed78e efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I
got it right... fingers crossed.
2017-09-18 13:34:50 +09:00
Daniel Hirt 048dcc3263 Canvas text: fix non-dirty paragraph width calculation
Follow-up fix for 1624417d91.
Changed for a max comparison, rather than just assigning the line's
width.
Also, added a test case.

Fixes T5939

@fix
2017-08-29 17:07:15 +03:00
Cedric BAIL d179a5c2a9 efl: remove PS3 backend.
This backend has received no patch and maintenance from anyone who could
actually test it over the last few years. After talking with KaKaRoTo it
is best to remove it. If anyone want to take over its maintenance, you
are welcome to revert this patch.
2017-08-25 10:48:42 -07:00
Vincent Torri c358ac0222 evas tests - add Jpeg2000 tests
add tests for loading jp2k files correctly and the images
2017-08-11 17:53:28 +09:00
Daniel Hirt 4923945f81 Text: move Annotation type to Efl.Text.Annotate namespace 2017-07-17 17:38:28 +03:00
Daniel Hirt d5f781da2b Efl text: replace all usages of cursor handle to same type
Changes cursor handle name from 'Efl.Text.Cursor.Cursor_Data' to
'Efl.Text.Cursor.Cursor'.
Also, replace all usages of Efl_Canvas_Text_Cursor
with Efl_Text_Cursor_Cursor as the handle for the cursor.
2017-07-17 16:51:45 +03:00
Jean-Philippe Andre e8b35c779e evas: Add a test case with a custom font
The font is **ugly** and was created with birdfont. Its license
shall be anything EFL requires (public domain in the ttf file).
2017-07-11 16:21:29 +09:00
Uma Devika d4ab6ff90a Evas and Eolian : Freed string buffer
Summary:
Summary : String buffer returned by eina_strbuf_new() is not freed in some cases

@Fix

Signed-off-by: Uma Devika <u.bodapati@samsung.com>

Reviewers: cedric, tasn, jpeg, raster, singh.amitesh

Subscribers: tanwar.umesh07, yashu21985, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5000
2017-07-07 13:22:53 +09:00
Daniel Hirt a5e980fbbc Evas text: fix test with Oriya script
We are not providing a font to test that specific script.
Commenting-out this test until we can find one with proper license.
This fixes the test suite fail case.

@fix
2017-06-19 10:15:05 +03:00
Carsten Haitzler e71e8bd30b test suite - evas - fix xpm ref image - it was badly broken...
since rgb.txt has seemingly disappeared from systems we didnt parse
colornames (missing the colorname db entirely) and the test image was
generated using a broken missing rgb.txt thus colors were wrong. a
recent fix made evas find colornames again...
2017-06-14 17:04:43 +09:00
Youngbok Shin f29dfe2789 evas textblock: fix evas test suite build errors
Summary:
Fix build errors caused by recent patches for Text cursor.
@fix

Test Plan: run "make check"

Reviewers: herdsman, jpeg, raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4957
2017-06-12 16:31:04 +03:00
Daniel Hirt 49b838c448 Canvas text cursor: move to Efl.Canvas.Text namespace
Originally it was its own object.
There are some valid claims that there is no justification for it to
remain an object.
Furthermore, it's apparent that it added little benefit: changes of
each cursors, in practice, triggered a query for all objects of the
same textblock. There wasn't real advantage to have a finer resolution
of controlling the cursors with their own events.

This ports back a lot of code, and changes a lot of other code in the
higher-up widgets, such as Efl.Ui.Text and co.

The usage was replaces from:
  efl_canvas_text_cursor_char_next(cur_obj)
to
  efl_canvas_text_cursor_char_next(text_obj, cur_obj)
that is, it is an operations on the TEXT OBJECT, rather than on the
(now removed) cursor object.

So, one less efl object to worry about now.
Hopefully, the port went smooth.
2017-06-11 23:58:52 +03:00