Commit Graph

342 Commits

Author SHA1 Message Date
Youngbok Shin 1750410650 evas: Add scale feature for embedded bitmap fonts.
Summary:
When evas selects a strike of embedded bitmap font,
calculate ratio and use it for scaling embedded bitmap.
@feature

Reviewers: jpeg, tasn, woohyun, raster, herdsman

Reviewed By: raster

Subscribers: charlesmilette, Francesco149, cedric

Differential Revision: https://phab.enlightenment.org/D2713
2017-09-26 11:31:31 +09:00
Daniel Hirt b7b5d08929 Canvas text: use eina_value_set and not eina_value_pset
CID 1381327
2017-09-25 12:51:49 +03:00
Jean-Philippe Andre 28b387821d elm: Split off text and content for efl_part
This is VERY tricky.
For legacy, just create an internal class that has both. It's easier
this way. For parts that are handled by Layout directly, we know from
Edje which type to return.

For EO objects we should know from the part name which kind of part we
are dealing with:
 - text (overridden by the widget)
 - content (overridden by the widget)
 - special (new efl_part based functions)
 - generic (handled by Layout)

Note: Efl.Ui.Slider was handling "span size" on ALL parts. That's bad...
This is now limited to "span" only.
2017-09-21 12:27:34 +09:00
Daniel Hirt b63c3620df Canvas text async: add async layout functionality
This adds the 'async_layout' method.
The 'async layout' method is similar to 'size_formatted_get', but done
outside of the mainloop. When a call is made to this method, a thread
is created (after some preparation like updating the logical text
items), and the visual layout is offloaded to that thread. The result
is returned as Eina.Future.

The mainloop is blocked for operations that manipulate the object, if a
thread has already been created but hasn't complete its work.
Consecutive calls for async layout for the same object are not handled
simultaneously. Each time the threads has complete its work, the next
(if exists) layout will be dispatched.

@feature
2017-09-20 14:50:09 +03:00
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Youngbok Shin 8dbbf5c8b7 evas textblock: support ZWJ, ZWNJ, LRM, RLM in escaped form
Summary:
The patch supports the following escaped string from Evas Textblock.
These unicodes are frequently used.
ZWNJ U+200C - ‌
ZWJ  U+200D - ‍
LRM  U+200E - ‎
RLM  U+200F - ‏
@feature

Test Plan: N/A

Reviewers: raster, cedric, herdsman, jpeg, woohyun

Differential Revision: https://phab.enlightenment.org/D5173
2017-09-11 08:53:04 +03:00
Daniel Hirt de3062da89 Canvas text: emit missing events during text changes
Some text changes were not picked up by the Ui.Text widget, so no size
evaluation was triggered.
2017-09-07 16:54:38 +03:00
Jean-Philippe Andre c0514d948a filters: Safety++
This is an attempt at fixing crashes in empc.
Test scenario:
  ELM_ACCEL="" elementary_test -to "Gfx Filters"
  And mouse scroll like crazy in the spinner.

@fix
2017-09-06 09:12:28 +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 a5b4defdd5 evas: use output instead of default one during rendering of proxy. 2017-08-25 10:52:29 -07:00
Cedric BAIL fc1b7f7835 evas: make filter handle multi output. 2017-08-25 10:51:53 -07:00
Cedric BAIL ef55155e0e evas: switch font backend function to rely on engine instead of output. 2017-08-25 10:51:24 -07:00
Daniel Hirt af1f4157f2 Canvas text: fix uninitialized value
Bug was introduced in f696cc8893.
2017-08-24 19:32:17 +03:00
Daniel Hirt e63be982d9 Canvas text: prevent change of context width field
The 'c->w' field gets manipulated for querying cutoffs of text with its
boundaries. Better to keep it a read-only field, to reduce confusion.
Also updated querying internal functions for better readability.
2017-08-24 12:38:13 +03:00
Daniel Hirt e20a44b7e7 Canvas text: reduce usage of data_scope_get()
During layout, this data is unchanged and there is no need to keep
asking for it.
2017-08-24 12:17:21 +03:00
Daniel Hirt f696cc8893 Canvas text: move obstacles logic to proper place
Will likely reduce number of update requests.
2017-08-24 12:17:21 +03:00
Cedric BAIL a21f25b0eb evas: do not double include interface.
This lead to unproperly defined symbol (as they should be build in libefl) on
windows with actually no need for it.
2017-08-17 15:02:11 -07:00
Daniel Hirt 36a2e29624 Canvas text: fix re-add of existing style to list
Styles were appended regardless their key already existing.
Now it's fixed.
Also, improved readability of 'style_set'.
2017-08-07 19:36:23 +03:00
Carsten Haitzler 26e93caec7 evas textblock - remove redundant check
found by PVS studio
2017-07-31 11:34:41 +09:00
Carsten Haitzler 3c27869c93 evas object textblock - fix append if cur node is null
then it will appeand totally as it should be. small buglet found. fixed

found by PVS studio

@fix
2017-07-29 12:20:12 +09:00
Daniel Hirt 01a693412f Evas textblock: add definition to 'cursor_equal'
This is a follow-up to c4ea25cbdb to fix
legacy API.
The definition was missing, so adding it.
2017-07-20 19:20:36 +03: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
Daniel Hirt c4ea25cbdb Evas textblock: fix legacy header
Fix ABI changes with const qualifiers, as well as some missing docs.
2017-07-17 16:50:31 +03:00
Daniel Hirt bb2678d403 Canvas text: re-add support for tabs
Somehow this was left out. Fixes tabs, so you can now use "\t" and
press the "tab" key.
2017-07-17 16:50:31 +03:00
Jaehyun Cho 078f83f4bc Evas textblock: add null check in evas_textblock_cursor_free 2017-07-10 21:02:13 +09:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +09:00
Jean-Philippe Andre 722725dfc5 evas: Fix a crash in textblock
I could not reproduce it but the case should not happen,
so I'm adding a safety check rather than a silent return.

The private data should be NULL only after evas_object_free()
or before construction...

Fixes T5656
2017-07-05 17:43:59 +09:00
Daniel Zaoui 8906867500 Filter: check nullity before accessing structure member
@fix
2017-07-02 15:53:20 +03:00
Daniel Hirt 4024857bf6 Evas textblock: fix legacy_newline in legacy API
Fixes 4fda417bc9 that disabled
legacy_newline for both legacy (textblock) and new (canvas text) api.
It should enable legacy_newline for legacy.
2017-06-29 16:37:20 +03:00
Daniel Hirt a10f726fc5 Evas textblock: re-apply paragraph position inference
For some reason, c39855a8ac also seems to
address an issue with height calculations (although not mentioned in
the commit message).

It already went in v1.19, so by applying
b8beb6834b I also reverted that behavior.
Seems like a correct one, so re-applying.

Fixes T5594
2017-06-29 15:26:48 +03:00
Daniel Hirt 070171c7bb Canvas text: set 'changed' on the object when text is inserted
This fixes missed updates with the "Ui.Text" when text was inserted.
2017-06-21 11:29:34 +03:00
Daniel Hirt 108bf99564 Efl text cursor: move around a few definitions
Need to handle this with special care as Efl.Text.Cursor is used in
some functions that are specific to Efl.Canvas.Text, was well as
functions in Efl.Text.Cursor interface.
2017-06-19 10:15:05 +03:00
Daniel Hirt d0da405620 Efl text format: change "halign" and "valign" to use enums
Value-based alignment (e.g. 0.5, 0.3 etc) isn't very practical.
Horizontal and vertical alignments will be assigned with enums
"left", "center", "right", "auto", "locale", for horizontal alignment,
and "top", "center" and "bottom" for vertical alignment.

This changes the previously added "halign" and "valign" properties.
2017-06-19 10:15:05 +03:00
Daniel Hirt 6033323e5c Canvas text: fix default format feature
Now that we can set the default parameters, there's no need to push
another one when having a style tag.

This fixes T5585.
2017-06-19 10:15:05 +03:00
Mike Blumenkrantz 4bf13c5c0c evas: add null checks for textblock stuff
this prevents a crash when starting verne but should be reverted when
a more appropriate fix can be put in place

ref T5585
2017-06-16 15:01:42 -04:00
Youngbok Shin cbea6e4386 evas textblock: add align=locale option to respect locale's direction
Summary:
There are many requests to add a new feature for handling horizontal align
according to current locale. For example, in RTL locale setting,
users want to see right aligned text for every list's item.
Even if some of list's items only contain LTR characters!
It is useful for the needs.
@feature

Test Plan: N/A

Reviewers: herdsman, tasn, woohyun, raster, cedric

Reviewed By: herdsman, raster

Subscribers: z-wony, jpeg

Differential Revision: https://phab.enlightenment.org/D4664
2017-06-15 08:59:17 +03:00
Daniel Hirt 8679805208 Canvas text cursor: add NULL checks for some functions
Passing a NULL cursor is permitted. Forgot to add to two functions
during port from EO.
Fixes some crashes.
2017-06-13 16:11:54 +03:00
Daniel Hirt 616a60f041 Efl text: shorten naming of methods
eo_prefix are set to "efl_text".
Also, "Efl.Text.Format" is shortened to now include the "_format"
prefix.
"Efl.Text.Font" keeps the "_font" prefix, for better readability.
2017-06-12 00:32:34 +03:00
Daniel Hirt 4fda417bc9 Canvas text: disable legacy_newline by default 2017-06-12 00:10:05 +03:00
Daniel Hirt 3edf4985a4 gfx_filter: add efl_style_gfx_filter
Also, rename the format string to 'gfx_filterstr' to match the other
strings.

Update the filter test to use this property.
2017-06-12 00:10:05 +03:00
Daniel Hirt 8f6415143c gfx_filter: null-out freed pointer 2017-06-12 00:10:05 +03:00
Daniel Hirt 6c76d799da Text: remove leftover printfs 2017-06-12 00:10:05 +03:00
Daniel Hirt 869da955ec Text: enhance cursor_get to ask for a "get type" 2017-06-12 00:10:05 +03:00
Daniel Hirt 4a1b42aee8 Text: add annotate interface 2017-06-12 00:10:04 +03:00
Daniel Hirt 30f74a759d Text cursor: add interface and implement in Canvas.Text 2017-06-11 23:58:52 +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
Daniel Hirt 9289e082d8 Canvas text: implement Font, Format and Style interfaces
This replaces the 'style' API with actual properties.

@feature
2017-05-28 15:34:26 +03:00
Daniel Hirt 1624417d91 Evas textblock: fix width calculation of non-dirty paragraphs
This reverts commit 0a28cb97af, as the
addressed issue was still occurring.
Non-dirty paragraphs were not considered when recalculating the
formatted width of the text.
This could easily be reproduced with two paragraphs, getting the width,
and then updating only the second paragraph.

Added a test case.

@fix
2017-05-23 13:26:32 +03:00
Cedric BAIL 35e54acc46 evas: stat introducing a concept of engine and output in the backend. 2017-05-12 15:24:45 -07:00