Commit Graph

182 Commits

Author SHA1 Message Date
Youngbok Shin f4f9753c20 Evas: Add API to reinit the language and use it in elementary.
Summary:
evas_common_language_from_locale_* functions kept static pointers
inside of its functions. Once these function was called, it was never reset.
It made big problems for harfbuzz and hyphenation. Also, Elementary
provides elm_language_set() API. Then we need to support it fully.
@fix

Test Plan: Test case for hyphenation is included in Evas test suite.

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

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3864
2016-04-08 11:24:32 +01:00
Jean-Philippe Andre ba4ffba8c1 Evas: Add a test case for image buffer_map.
This:
1. opens a file
2. maps its data and vaguely verifies it
3. writes data to it
4. writes data to it with a GRY8 map
5. verifies that the final image has all the proper pixels
2016-03-28 16:40:02 +09:00
Jean-Philippe Andre 015554e57e Evas 3d: Hide warning with clang
An otherwise good looking macro triggers a warning with clang,
because of self comparison of constants (always true or always
false). Let's just silence the warning in this specific spot
with a pragma.
2016-03-28 15:53:15 +09:00
Jiwon Kim c23283944b Evas textblock: fix null-derefernce in _style_match_tag()
Summary:
add null check in _style_match_tag()
if evas_object_textblock_text_markup_set() is called with markup text before setting style,
segmentation fault is occurred in _style_match_tag()
@fix

Test Plan:
Insert this situation to test suite
 -> test id : evas_textblock_simple

Test for without this patch:
 1. apply patch just "src/tests/evas/evas_test_textblock.c" partially.
 2. $make check

Test for with this patch:
 1. apply this patch completely (2 files)
 2. $make check

Reviewers: id213sin, herdsman

Subscribers: Blackmole, cedric, jpeg

Projects: #efl

Differential Revision: https://phab.enlightenment.org/D3818
2016-03-24 10:17:57 +02:00
Daniel Hirt 4013dccda6 Evas font: fix width calc in last_up_to_pos
Width calculations should consider the x_bear. This has been leading to
inconsistent results between wrapping calculation during layout and the
final formatted size.

Also, we should stop our walk only when exceeding 'x', so changed "<="
to "<".

@fix
2016-03-23 15:31:20 +02:00
Jean-Philippe Andre 72363b4777 tests: Remove unused variables (evas_image) 2016-03-18 13:53:39 +09:00
Jean-Philippe Andre b8f682b842 Efl.Gfx.Fill: Rename filled to fill_auto
fill_filled is a strange name for the property.
fill_auto seems to make more sense. If you disagree, scream at
me or revert this commit.
2016-03-18 13:28:45 +09:00
Tom Hacohen 8706d03b43 Change the EFL according to the renaming of the eo_add() current object. 2016-03-15 15:25:54 +00:00
Jean-Philippe Andre 2d10127524 Evas image: Move filled property to Efl.Gfx.Fill and set as default
The filled property should be set to true by default since it
makes more sense. Legacy APIs behaviour is preserved by setting
the default to false.
2016-03-15 11:11:59 +09:00
Tom Hacohen f24210caac Revert "Automatic migration to the new eo_add syntax."
This reverts commit 4f949a2757.
2016-03-11 12:29:03 +00:00
Tom Hacohen 4f949a2757 Automatic migration to the new eo_add syntax. 2016-03-09 16:09:14 +00:00
Stefan Schmidt 2d0d2802bf tests evas: enable xpm image loader in tests
Added in 2014 and not enabled since then. This seems to be fixed now so we can
finally enable it.
2016-03-09 15:25:35 +01:00
Stefan Schmidt 312dd58889 tests evas: remove commented out function which have not been used since 2014
It was already unused when it was disabled almost two years ago.
dbe02d593e
Its about time to remove it.
2016-03-09 15:25:35 +01:00
Tom Hacohen f1b1c5354b Manually fix extra eo_do calls that were added after I migrated 2016-03-03 10:03:55 +00:00
Tom Hacohen f21ade6123 Automatic migration to Eo4.
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
2016-03-03 09:58:08 +00:00
Jean-Philippe Andre 2d9dc68d09 Evas filter: Add new test case for state and data set 2016-03-02 12:57:23 +09:00
Jean-Philippe Andre 77db872754 Evas filters: Use fail_if instead of fail in test case
This will give more accurate information in case of failure.
2016-03-02 12:57:23 +09:00
Tom Hacohen 84fd52921e Evas textblock tests: Fix wrong test suite tests.
The tests were assuming that textblock returns a sanitised utf8 string.
This is not always correct, because textblock may cache and return the
set utf8 markup if the text hasn't changed since the last set.
2016-02-26 09:36:44 +00:00
Jean-Philippe Andre f649dac12f tests: Fix evas 3d tests after previous commit 2016-02-17 16:12:35 +09:00
Youngbok Shin 471c7635ee Evas Text: Update text layout when ellipsis is changed without resize
Summary:
When only ellipsis is changed from 0.0~1.0 to -1.0 without resize,
the text is never updated. Because, previous state for ellipsis is never kept
and used properly to check when Evas Text needs to be updated.

It does not have any effect when ellipsis is changed from -1.0 to 0.0~1.0.
Because, Evas text always resize itself according to its text size.
So, necessarily, Evas text object has to be resized to the smaller size.
Commonly, Edje will handle its size if Evas text needs to be ellipsized.
@fix

Test Plan: Test case is included.

Reviewers: tasn, woohyun, herdsman

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3448
2016-02-16 17:42:11 +02:00
Vincent Torri 71f0fb98f0 Test rework #20: Evas 2016-02-16 12:41:06 +00:00
Tom Hacohen bcbf5df8b3 Evas textblock: Disable hyphenation tests when hyphenation is disabled. 2016-02-12 12:21:06 +00:00
Jean-Philippe ANDRE 1385afc387 Evas filters: Change FIXME comment in test case 2016-01-23 18:19:52 +09:00
Jean-Philippe Andre 7336b7ed9f Evas filters: Re-enable transform test case, remove dead code
Now that transform is fixed, this should be reenabled.
2016-01-22 15:54:27 +09:00
Youngbok Shin 3252e3bf78 Evas Textblock: Fix ellipsis when textblock is resized to formatted h.
Summary:
it->h is sum of max ascent and max descent. It shouldn't be used
when handle ellipsis. Because, Evas Textblock uses these values for
each lines differently according to its location.
(start, end, else, single)
So, for handling ellipsis exactly, it has to be fixed.

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

Reviewers: woohyun, tasn, herdsman

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3475
2016-01-04 15:12:10 +00:00
Vincent Torri 47ed848a87 Evil: integrate the dlfcn code into Evil
This will remove some incompatibilities with other packages,
especially for win-builds
2015-12-29 22:13:58 +09:00
Jean-Philippe Andre 60e6030f36 Evas 3d: Fix some issues in model test case
Fix some errors, check that file_set and file_save actually work
(rather than have them both fail and pass the test since 0 == 0),
fix temp paths and cleanup unused file.
2015-12-29 16:14:41 +09:00
perepelits.m e6bba4d91c [Evas] Refactor model's savers and loaders.
Summary:
Move common part to a separated document.
Make code more readable using smaller functions. (from Task T2713)

Everything is OK with make check.

Reviewers: cedric, raster, Hermet, stefan_schmidt

Reviewed By: stefan_schmidt

Subscribers: jpeg, artem.popov

Differential Revision: https://phab.enlightenment.org/D3430
2015-12-29 13:28:56 +09:00
Subodh Kumar 43f50dc7db Evas textblock: Use width of item format to position cursor.
Summary:
Use width of item format to position cursor.

Sometimes it becomes very difficult to
position cursor over item and selection
becomes very difficult as we position the
cursor once the input X coord reached end of the item,
like one attached in the test plan. So this patch
decides over 50% of item width for X coord reaches
to position it at start or end.

@ix

Test Plan:
Attached setup shows how difficult to position cursor at the end when clicked
over item and selection is also very difficult. Consider such case in mobile
device, its becomes impossible to position cursor at the end and selection is
too much difficult.

{F27036}

Also added test cases in evas test suite

Reviewers: herdsman, tasn

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3390
2015-12-17 12:00:23 +00:00
Jean-Philippe Andre ddd783ec88 Evas filters: Temporarily disable failing tests
Apparently a special font makes the vflip tests crash. vflip
definitely needs to be fixed.

I'm currently working on the filters, so I'll get back to these.
This is a temporary patch.
2015-12-14 20:29:37 +09:00
Youngbok Shin fcba96384f Evas Textblock: Fix NULL dereferencing issue
Summary:
Even if the given two cursor is NULL, it shouldn't be crashed.
@fix

Test Plan:
Test case included in Evas test suite.
Run "make check".

Reviewers: herdsman, tasn

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3422
2015-12-13 17:15:10 +02:00
Daniel Hirt 58bfa4b328 Evas textblock: add missing test fonts
evas_suite was failing for people that didn't have malayalam fonts
installed in their system. Obviously, we should provide it in the test
suite.

Added malayalam font (from http://www.indlinux.org/) to the
TestFont.eet, along with the license README.

Fixes T2908.

@fix
2015-12-10 09:57:39 +02:00
Youngbok Shin 20ef85e307 Evas text: Fix Evas Text truncated text case.
Summary:
Evas Text only concerns about a advance of each text item.
When a width of last character is bigger than its advance, the last character can be truncated.
And the different line size calculation caused different aligning between Evas Text and Evas Textblock.
So, the width of last character will be considered in Evas Text just like Evas Textblock.
@fix

Test Plan:
The following text shows how the size calculation is different between Evas Textblock and Text.
Get native size from Evas Textblock and get width(geometry) of Evas Text.
You can see the width of Evas Text is bigger than native size of Evas Textblock.
(adv > width)
こんにちは。

The following text will be truncated without this patch.
(adv < width)
ନୂଁ

Reviewers: woohyun, tasn, herdsman

Subscribers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D3004
2015-12-09 11:10:46 +02:00
Daniel Hirt 7e8e392db6 Evas textblock: improve and fix line range rectangles
The line range rectangles geometries needed a bit of adjusting. I
started out with fixing T2648. In order to fill the gap between the end
of the line and the margins, the geometry of the last line's character
was used. I am not really sure why. Anyway, we have the line geometry,
so I replaced it with that.

Then, it led me to do some alignment checks, and indeed alignment cases
were not treated. For instance, an LTR paragraph could have a line
aligned with a value greater than 0.0. That means that we should fill
the gap from the left of the line, if it was the last line in a
multi-line selection. The inverse case is for RTL.

I think it now works as it should. Will see if the selection logic is
missing some more stuff once I come up with more example cases.

Fixes T2648.

@fix
2015-12-08 17:19:18 +02:00
Tom Hacohen 51d8e58832 Evas test matrix: Silence warning.
This happens because this test doesn't really depend on anything evas,
so it doesn't set evas up. We want to be warned when tests forget to set
evas up, just not in this case.
2015-12-08 11:15:25 +00:00
se.osadchy 82504d9d77 evas: recognize duplicated data structure with eina_quternion and ector.
Summary:
Move data structure and functionality to eina_quaternion from evas_vec4.

Reviewers: raster, Hermet, cedric

Subscribers: jpeg, Oleksander

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-07 16:36:16 -08:00
Daniel Hirt 1d48dd90b2 Evas textblock: fix evas_textblock_cursor_line_set
The line_set function should set the cursor to the first logical
position in the line. We can't use the first text position of the
first item in the line, due to BiDi considerations (the line may be
reordered). I've split evas_textblock_cursor_line_char_first to avoid
code duplication, as it already handles these cases.

@fix
2015-12-07 18:21:00 +02:00
se.osadchy ce4146ec63 evas: fix bug with logic with eina_matrix in evas_3d_utils
Summary: Also need to fix logically dead code in coverity.

Reviewers: raster, Hermet, cedric

Subscribers: jpeg

Maniphest Tasks: T2832

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-02 14:15:01 -08:00
Cedric BAIL 11ac6b145d evas: fix double free.
The ownership of this list and its content belong to the iterator. This code
was actively double freeing and our test suite doesn't crash or have any issue...
Well actually it was complaining that the list had error, but due to our other
false positive test that do trigger eina log, we continuously ignored this error.

NOTE: The fact that the test rely also on the container of the iterator instead
of the iterator itself is not that great to. I kind of feel bad now for having
allowed access to the container. We should have been able to allow changing the
logic to generate those rectangle step after step instead of in one go. Now this
seems difficult.
2015-12-02 12:30:34 -08:00
Daniel Hirt 59e9e2ddc8 Evas textblock: fix height on line wrapping
Line advance should finalize the line with its last item, and not the
item we're currently wrapping. This fixes T1583, where some line
wrapping cases would look different than their equivalent <ps>
versions.

@fix
2015-12-02 15:06:32 +02:00
Youngbok Shin 809d8fdafe Evas Textblock: Fix text disappear issue when text is made up with multiple items.
Summary:
Text is disappearing when we resize a singleline Evas Textblock with ellipsis.
It is happened by putting a Text item at logical_items list without considering about logical position.
It is only happended the text is made up with multiple items.
@fix

Test Plan:
1. Run elementary_test
2. Click Label Ellipsis
3. Resize the window dynamically and see the result.

Reviewers: woohyun, tasn, herdsman

Subscribers: jpeg, subodh6129, shilpasingh, cedric

Maniphest Tasks: T2709

Differential Revision: https://phab.enlightenment.org/D3022
2015-12-02 09:52:01 +02:00
Daniel Hirt a7b0b13c43 Evas textblock: add hyphenation tests 2015-11-24 14:31:29 +02:00
Youngbok Shin a9b4be11e1 Evas object: Add paragraph_direciton APIs
Summary:
It adds evas_object_paragraph_direction_set, get APIs.
The APIs set or get paragraph direction to/from the given object.
It changes BiDi calculations and affect the direction and aligning of text.
It doesn't have any effect to text without Fribidi library.

The default paragraph direction is EVAS_BIDI_DIRECTION_INHERIT.
If dir is EVAS_BIDI_DIRECTION_INHERIT, paragraph direction is changed
according to smart parent object. If there is no smart parent object,
paragraph direction works as EVAS_BIDI_DIRECTION_NEUTRAL.

@feature

Test Plan:
Test cases included to the following files.
- evas_test_textblock.c
- evas_test_text.c
- evas_test_object_smart.c

Run "make check".

Reviewers: woohyun, raster, herdsman, tasn

Subscribers: c, raster, cedric

Differential Revision: https://phab.enlightenment.org/D1690
2015-11-19 11:43:39 +00:00
Daniel Hirt d6e0d902cf Evas textblock: fix bad deletion in test case
No need to delete this object. It is already being deleted when the
textblock is freed at the end of the test.
2015-11-17 16:22:02 +02:00
Minwoo, Lee c196422e63 evas textblock: fixed ascent/descent calculation
Summary:
If textblock has linegap and multi language, ascent/descent calculation is
incorrect.
In _layout_format_ascent_descent_adjust(), descent is accumulated.
(for example, for a line gap of 50, the first line gap is more than 100)

Test Plan:
Textblock has "linegap=50" and multi language (ex.
        "This is a test suite for line gap -
        ഈ ലൈൻ വിടവ് ടെസ്റ്റ് ടെസ്റ്റ് ടെസ്റ്റ് ടെസ്റ്റ് ഒരു പരീക്ഷണ വെയര് ")
Added test suite in evas_test_textblock.c file.

Reviewers: tasn

Subscribers: subodh6129, cedric

Differential Revision: https://phab.enlightenment.org/D3311
2015-11-13 12:27:59 +00:00
Jean-Philippe Andre 0a5b28eba8 tests: Fix build warning 2015-11-02 15:08:05 +09:00
Jean-Philippe Andre 83b91dfd09 Evas GL: Try to fix automated tests
I forgot the #ifdef in the shaders. This might be it. @stefan,
try again please.
2015-10-19 19:36:22 +09:00
Jean-Philippe Andre 7b401f34da Evas GL: Add more tests
- glReadPixels
- FBO test
- PBuffer test (only GL engine)
- surface formats test (up to depth=24, stencil=8)
2015-10-15 16:20:53 +09:00
Jean-Philippe Andre f6fd05ff74 Evas GL: Add test case for surfaceless contexts 2015-10-15 16:20:53 +09:00
Jean-Philippe Andre 93298d6dc2 Evas GL: Add a test case for Evas GL (make check)
For now this only covers SOME of Evas GL's functions.

It will try to run with opengl_x11 and buffer (OSMesa). It'll also
try to fail silently if the engine initialization failed, or if
OSMesa could not be found. If the engines work, then Evas GL must
work properly.
2015-10-14 20:14:51 +09:00