Commit Graph

460 Commits

Author SHA1 Message Date
Jean-Philippe Andre de47187dde evas: Fix tb filters spanning over multiple items
If a gfx filter was applied to a block of text spanning over
multiple text items, then it would improperly render as the
filter context was stored in the format, rather than the text
item. This is fixed by using a list of contexts in the format
node rather than a single context.
2017-01-17 14:35:28 +09:00
Jean-Philippe Andre 5f1c993d17 evas: Set gfx filters by name on textblock
This allows for much simpler markup, and easier tracking of
which filters are in use, etc... Next: data and sources.
2017-01-17 14:35:28 +09:00
Jean-Philippe Andre cb294320dc evas: Experimental textblock support for gfx filters
This is only for testing purposes for now. Eventually we need
to fix the following things:
- terrible performance (cache buffers)
- force redraws based on filter padding
- expand textblock padding based on max filter padding
- add sources, data and a filter name/code hash
- test! :)
2017-01-17 14:35:28 +09:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Carsten Haitzler b0530aba4f evas cutouts - quickly avoid huge per issues with large nos of cutouts
i found evas_common_draw_context_apply_cutouts() was procsessing 300+
cutouts and as it's O(n^2)/2 to try and merge adjacent rects for
cutouts this really performs like complete junk. we apply cutout rects
a LOT. this is not the best solution, but it's quick and much faster
than doing the clipouts which drop framerate to like 1-2fps or so in the
nasty case i say (tyls -m of photos in a dir with a 2160 high
terminal).

this figures out the target area to limit the count of rects
significantly so O(n^2) is far far better when n is now < 10 most of
the time. and for the few operations where it's a high value this now
uses qsort to speed up merges etc. etc.

@optimize
2017-01-02 18:53:56 +09:00
Chris Michael 879041a329 evas: remove float comparison warnings for evas_object_textblock
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-20 10:25:50 -05:00
Daniel Hirt 6accf13b34 Canvas text: call "changed" on style_set
Needs to be picked up by widgets e.g. Ui.Text to update the positions of
decorations.
2016-12-12 10:48:28 +02:00
Daniel Hirt 7abd3f8637 Canvas text: call "changed" on annotation_insert
This was missing from non-item type of annotations.
2016-12-12 10:48:28 +02:00
Hermet Park 1e6246df24 evas textblock: fix a rendering issue.
It's a rare case but a possible scenario that textblock is not updated
 properly in case of textblock rendering via proxy/map.

If the textblock state turned out with an invisible state,
its relayouting won't be up to date. But actually, it could be rendered
by map/proxy. In that case textblock text layouting would be incorrect.

Additionally, removed evas event freeze state there because map/proxy won't
be drawn under the event freeze state always.

@fix
2016-12-05 18:07:39 +09:00
Carsten Haitzler a479745e4f evas - add a prepare stage for objects before render
preparing an object is a good idea. especially with gl. you want to do
texture uploads BEFORE using textures all in one batch. otherwise this
may mean the gl implementation has to make a copy of your data in a
tmp location then copy it in later when texture becomes "unused" as it
may be in use at the moment, or it may have to stall and wait.

i have seen somewhere around 7-10% speedups on nvidia and intel
drivers with this on given a very special test case i brewed up (1000
32x32 images where i change 1 pixel every frame). this should have
impact really when we are modifying textures a lot. this is all i've
implemented for now, but this should/would/could do much more like
re-order map, proxy renders to render FIRST in a pre-render list
instead of inline and to pre-render fbo/buffer content for complex
objects like text or textblock etc.
2016-11-17 18:41:31 +09:00
Chris Michael fa5e4c252f evas: Fix directly dereferencing pointer which may be NULL
Coverity reports this as a dereference before null check which implies
that 'cur' May be null here, so let's not use it before we check it.

Fixes CID1363765

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-13 12:50:12 -04:00
Daniel Hirt ed2b4e97c1 Canvas text: add annotation_positions_get method
We need a method that allows us to place the cursors at the start and end of an
annotation. This is required for things like getting the geometry of a range.

@feature
2016-10-05 17:12:22 +03:00
Daniel Hirt c0701a1051 Canvas text cursor: add simple_geometry_get method
The ported geometry_get was actually the legacy simple_geometry_get.
For getting simple geometries like selection this was enough, but I forgot that
we also need to query more complex geometries e.g. links.
This is required to implement link anchors in Ui Text.

Now geometry_get and simple_geometry_get are the same as their legacy
counterparts.

@feature
2016-10-05 17:12:22 +03:00
Tom Hacohen 9c779dca90 Rename efl_self to efl_added
It has been discussed on the ML (thread: "[RFC] rename efl_self") and
IRC, and has been decided we should rename it to this in order to avoid
confusion with the already established meaning of self which is very
similar to what we were using it for, but didn't have complete overlap.

Kudos to Marcel Hollerbach for initiating the discussion and
fighting for it until he convinced a significant mass. :)

This commit breaks API, and depending on compiler potentially ABI.

@feature
2016-09-05 16:59:56 +01:00
Daniel Hirt 2d44738fae Canvas text: fix ellipsis RTL handling
First, fixing ellipsis text positions: ellipsis items should be assigned the
text positions of the omitted text (while maintaining the formatting of the
last visual item). In the case where an entire item was rejected, it
will be assigned that item's text position. If an item was split, it will be
assigned the text position of the split portion.
The BiDi reorder code relies on properly-assigned text positions.

Second, fixing ellipsis handling: the width calc was only considering the
ellipsis item's width. However, if the ellipsis is placed as e.g. the first
visual item (such as in RTL cases), its advance value should've be considered,
instead.

Thanks Youngbok Shin for the test case and information.

@fix
2016-08-31 16:23:32 +03:00
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Jean-Philippe Andre b325097e71 elm,evas: Remove use of EFL_CANVAS_OBJECT_EVENT_DEL
This event should not be exposed at all, it's not necessary
anymore, EFL_EVENT_DEL already exists and should be good enough.

This does move the callback call a little bit ealier in the del
process, but at first glance, this shouldn't have any impact.
2016-08-26 10:18:01 +09:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Daniel Hirt be461b8f1b Canvas.text: fix segfault with ellipsis cases
The specific handling for (0.0 <= ellip < 1) doesn't support multi-line cases.
One of the main reasons is that we haven't had the chance to define the wanted
behavior for multi-line.
This is a temporary hack to fix a segfault. The behavior is still undefined,
though.

Fixes T3885.
2016-08-08 15:18:30 +03:00
Daniel Hirt 0d9ddc4514 Canvas text: fix range geometry calculation for RTL
Fixes T3627.

@fix
2016-07-31 10:33:30 +03:00
Jean-Philippe Andre 2c7f9481ed textblock: Prevent crash in evas_object_textblock_cursor_new(NULL)
This happened in expedite
2016-07-19 18:32:32 +09:00
Daniel Hirt f9deaa9be9 Canvas text: add "changed" event
We need to keep track on changes of content.
2016-07-12 11:01:45 +00:00
Daniel Hirt 0c38846e33 Canvas text: fix annotation set
The cursor position was not set correctly to the respective fnode, causing
annotation to not be applied correctly with text that has more than one
paragraph.
2016-07-12 11:01:45 +00:00
Daniel Hirt 7ff05af885 Ui text: don't null-check for free() 2016-07-12 11:01:45 +00:00
Daniel Hirt 0c23985626 Canvas text: fix corner case in range geometry calc
The trivial case of [pos,pos] (i.e. range of length 0) didn't work if there is a
format item in 'pos'.
The condition was fixed to not include such items. The reason it was not
apparent for text items is that these have further handling in the rest of the
code and would've been disposed of.

@fix
2016-07-11 16:39:51 +00:00
Youngbok Shin 64e0dc341d Evas textblock: Apply scale factor to <linesize>, <linegap> formats
Summary:
Font size is scaled according to scale factor.
The linesize, linegap formats also have to be scaled properly.
@fix

Test Plan:
Test cases are included.
Run "make check"

Reviewers: woohyun, Jieun, tasn, herdsman

Reviewed By: tasn

Subscribers: raster, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3688
2016-07-11 17:57:40 +09:00
Carsten Haitzler 3990032330 evas textblock - fix deref before null check shown by coverity
fixes CID 1356927
2016-07-09 12:07:10 +09:00
Daniel Juyung Seo bc7f223754 evas/textblock: Mark unused variable. 2016-07-04 07:31:15 +09:00
Daniel Hirt fed2b75780 Canvas text: simplify efl_text_get 2016-07-03 17:10:57 +00:00
Daniel Hirt 2be6c6b817 Canvas text: fix leak in annotation_insert 2016-07-03 17:10:56 +00:00
Daniel Hirt f7509bbb52 Canvas text: fix leak in efl_text_set 2016-07-03 17:10:56 +00:00
Daniel Hirt 06fd1566ea Canvas text cursor: fix bug after code port
Fixes T4005.
Also, unified repeated code and added a test for multiple cursors.
2016-07-03 14:39:45 +00:00
Daniel Hirt 2b3bba1f7e Canvas text: fix format annotations deletion 2016-06-27 15:18:08 +00:00
Jean-Philippe Andre b48726989d evas object: Hide "del" event
In EO world, we should stick to EO_EVENT_DEL.
2016-06-27 14:08:55 +09:00
Tom Hacohen 56562b1643 Canvas text: Add missing cursor changed callbacks.
In some cases we were changing the cursors but not emitting callbacks.
This should fix that.
2016-06-22 14:03:06 +01:00
Tom Hacohen 3dc4490a99 Canvas text: Don't call callbacks while cursors are in inconsistent states.
The issue is that in some cases we were calling user code (callbacks)
when some of the nodes were referencing already deleted text nodes. This
caused invalid memory access. This commit delays the callback calling
until after all of the cursors got into a consistent legal state.
2016-06-22 14:03:06 +01:00
Daniel Hirt dbbb4bf8ad Canvas text: revert new behavior on text append
This was discussed and still wasn't decided whether this is required to be
supported internally.
The reason for this revert is that the behavior still needs tweaking to work
just right along with the legacy behavior.
2016-06-21 10:40:48 +00:00
Daniel Hirt 2651ab54a3 Canvas text cursor: fix text insertion
The cursor update hasn't considered when the pararaph is broken. The reason the
code path is different from legacy is because that it was originally intended to
support append and prepend operations in the new API. Since we don't anymore
(only supporting append operations in the new cursor with 'text_insert'), we can
simplify the insertion implementation and fix this.
2016-06-21 10:34:19 +00:00
Daniel Hirt e920b47d2b Canvas text cursor: remove redefinition, already in legacy. 2016-06-21 10:34:19 +00:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Tom Hacohen 132e89bb46 Canvas text: Fix idiotic memory leak.
Thanks to vtorri for reporting.
2016-06-17 09:02:43 +01:00
Daniel Hirt ed512ea49e Canvas Text: continue porting api and fixup bugs
Also: This merges style user and normal style into a list with precedence. This
allows for more flexibility while keeping the API clean.

@feature
2016-06-16 19:15:20 +01:00
Tom Hacohen c297ff4115 Canvas text cursor: introduce this new object
The text cursor is now an eo object. Consult the efl_canvas_text_cursor.eo file
for the API.

@feature
2016-06-16 19:15:20 +01:00
Daniel Hirt 3a6c648d28 Canvas text: introduce new text object
The implementation depends on creating different code paths from the now-legacy
behavior of text appending.

The annotation system introduced in this commit replaces the current way of
applying formats on text.
Up until now it has been quite a hassle for the user to control the formats, as
it required keeping track of the format positions with an opener and closer
formats almost every time (with the exception of own-closing formats).

The combination of Efl.Text API along with the Efl.Canvas.Text annotation API
essentially replaces the capabilities of the old format.

There is additional annotation API to allow more control, so be sure to check
the documentation/.eo files and the wiki page of Efl.Canvas.Text.

The style API now accepts actual strings of format style. There is not longer
need to instantiate as style with style_new() followed later by style_free().

@feature
2016-06-16 19:15:20 +01:00
Cedric Bail 75a53ece10 eo: for consistency use object like all our API. 2016-05-18 08:18:04 -07:00
Mike Blumenkrantz 46d214293e textblock: support escaped &apos; tag
while not in the official html4 spec, this was supported by all browsers
except IE during the html4 era and is now included in html5.

@fix
2016-03-29 15:40:12 -04: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
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
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
Tom Hacohen e71e6561ee Eo callbacks: Migrate all of the EFL to the new event cb signatures. 2016-02-29 11:33:27 +00:00
Daniel Hirt 409f45478b Evas textblock: add a stringshare fastpath to markup_set
This optimization makes use of already stringshare'd text and avoids
unnecessary stringshare_add calls in markup_set. It improves the
performance of edje_calc when reapplying text to the textblock part.
2016-02-29 08:59:24 +00:00
Daniel Hirt c7d45032dd Evas textblock: fix cached markup's stringshare refs
The last fix 34020ed131 was missing a
stringshare_del for the NOP case of markup_set. It led to a
constantly increasing ref count of the cached markup.

@fix
2016-02-28 18:00:08 +02:00
Tom Hacohen 34020ed131 Evas textblock: Fix markup cache, was completely broken.
The markup cache was completely broken. It was not compared correctly,
so it wasn't even used, but regardless it was cleared just after being
set in some of the cases.

This is the first part of a performance regression fix in elm label.

@fix
2016-02-26 09:13:38 +00:00
Daniel Hirt d79a1ade6c Evas textblock: ifdef unused 'hyphens' code
The usage of the 'hyphens' array is only relevant when
"--enable-hyphen" is used.
This fixes the dead code addressed in
5b083ace84.
2016-02-14 15:46:23 +02:00
Daniel Hirt 196029316d Revert "Evas textblock: Properly ifdef hyphenation out."
This reverts commit 5b083ace84.

The "--enable-hyphen" option refers to using the optional hyphenation
dictionaries. We support hyphenation via SHY-HYPHEN hints regardless of
this option.
The following commit will provide finer handling to address the issue in
the reverted one.
2016-02-14 15:46:10 +02:00
Tom Hacohen 5b083ace84 Evas textblock: Properly ifdef hyphenation out.
I found this thanks to coverity. There was some code that we were running
although hyphenation was actually off.

CID 1341062.
2016-02-12 12:21:06 +00:00
Youngbok Shin 931b225895 Evas textblock: Save memory space reducing unused hyphen dictionary loads
Summary:
Commonly, only few hyphenation dictionaries are used at a application.
So, loading all of dictionary files could cause waste of memory.
Evas textblock has to load hyphenation dictionaries only when it is
really needed.

Test Plan: N/A

Reviewers: woohyun, tasn, herdsman

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3626
2016-02-04 17:30:58 +02:00
Youngbok Shin 33ea565347 Evas: Use proper language for harfbuzz shaping
Summary:
Evas Text, Textblock, Textgrid keeps own language information.
This language information could be vary from the result of setlocale().
Especially, Evas Textblock supports <lang> tag. The language could be
changed in the middle of text. All of these language has to be used
for harfbuzz shaping.
@fix

Test Plan: N/A

Reviewers: herdsman, raster, woohyun, tasn

Reviewed By: tasn

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3628
2016-02-04 10:07:08 +00:00
Youngbok Shin cd01636d76 Evas textblock: Use a common thickness and position at a underline.
Summary:
If a underline is drawn with seperated thickness and position, it doesn't look good.
It will take the thickest and the lowest underline.

@feature

Test Plan:
Set the following markup text in Evas Textblock.
<underline=on underline_color=#fff><font_size=20>Markup text <font_size=50>with</font_size> underline tag</font_size></underline>

It shows the underline is split to 3 underlines with different thickness and positions.
Commonly, underline has to be drawn with same thickness ans position per each line.

Reviewers: woohyun, herdsman, tasn

Reviewed By: tasn

Subscribers: jpeg, raster, subodh6129, cedric

Differential Revision: https://phab.enlightenment.org/D2971
2016-02-02 10:22:09 +00:00
Youngbok Shin d15d91e0da Evas Text/Textblock: Use locale for lang as default.
Summary:
The configuration files for Fontconfig can describe
how font list is made according to language information.
EFL also set the language for each Evas textblock styles
and used for loading font list.

But, this is inconvenient to use if we want to apply language
for loading font list according to system-wide locale information.
This patch will apply locale information for font list if there is
no specific language in description.

And it also add [lang=auto] for Evas Textblock.
auto - It loads locale for language.
none - It disables language.

@feature

Test Plan: N/A

Reviewers: woohyun, herdsman, tasn

Subscribers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D3344
2016-02-02 10:22:09 +00:00
Tom Hacohen 987fde58a7 Evas textblock: Remove redundant NULL check.
Detected by smatch.
2016-01-12 11:00:01 +00:00
Tom Hacohen e64192f446 Evas textblock: slight style fixes. 2016-01-12 10:55:49 +00:00
Tom Hacohen ebe09c4854 Evas textblock: Clean up ellipsis handling code.
This cleans up the previous commit a bit by isolating the calculation
code and using a temporary descriptively named variable for the calculation.
2016-01-04 15:12:10 +00: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
Subodh Kumar 105960b24f Evas textblock: Fix some indentation and formatting.
Summary: Fix some indentation and formatting.

Reviewers: herdsman, cedric, tasn

Reviewed By: cedric

Subscribers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D3174
2015-12-18 15:14:05 +00:00
Tom Hacohen 3d91e5eae8 Revert "evas: fix some indentation and formatting in textblock."
This patch was *REJECTED*. I don't understand why it was snuck in among
a batch of 24 other unrelated patches. That made me miss it originally,
  but found it now. This is wrong and shouldn't be in.

This reverts commit 3f0d0daf0d.
2015-12-17 12:51:37 +00: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
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 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
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
Youngbok Shin 76fa1159c5 Evas textblock: Skip layout logic for an text item which doesn't have font.
Summary:
Evas textblock could cause infinite loop if there is no fonts to use.
If there is no fonts, text_props.text_len is never set.
When text_props.text_len is 0, the for loop in _layout_par runs forever.
It is ridiculous to use Textblock without fonts. But, it shouldn't runs
infinite loop in any situation.

@fix

Test Plan:
1. Remove all of fonts in your EFL or Tizen device.
   (Or you can test it modifying some codes in Textblock by skipping load fonts.)
2. Run elementary_test -to entry3 or see any multiline textblocks.

Reviewers: tasn, herdsman, woohyun

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3402
2015-12-04 14:46:35 +00:00
Cedric BAIL d577366acb evas: properly clean up all memory. 2015-12-02 12:31:59 -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
Youngbok Shin 507baf4891 evas: Add ExtraLight, ExtraBold for font weight.
Summary:
Evas supports UltraLight, UltraBold as font weight.
These terms have same weight value as ExtraLight, ExtraBold.
Some applications, for example, fontforge, use ExtraLight, ExtraBold terms for these weight values.
So, it would be better to support these terms, too.
@feature

Test Plan: None

Reviewers: tasn, woohyun, herdsman

Reviewed By: herdsman

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3126
2015-11-26 10:16:14 +02:00
Daniel Hirt 40dfc4a45d Evas textblock: add support for hyphenation wrap style
We now support hyphenation in style. Use "wrap=hyphenation" to use this
wrap option. It will hyphenate based on explicit SOFT HYPHEN (&shy;)
placement in the text, and with the (optional) assistance of dictionaries
compatible with Hunspell's "hyphen" library.

This wrap mode favors breaking at hyphen positions in a word, over moving
the whole word to the next line. It will put an additional "-" at the
break position if it was hyphened.

Enabling the hyphen dictionaries is done by adding these configure
options:
  --enable-hyphen (requires Hunspell's "hyphen" library installed)
  --with-dictionaries-hyphen-dir=DIR (specifies the install location of
          the actual .dic dictionary files e.g. /usr/share/hyphen)

Note that dictionary files are expected to be in the form of "en_US.dic"
or anything that ends with it e.g. "hyph_en_US.dic" (this how they are
        named in Arch Linux).

@feature
2015-11-24 14:31:05 +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
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
Subodh Kumar 3f0d0daf0d evas: fix some indentation and formatting in textblock.
Summary: Fix some indentation and formatting.

Reviewers: herdsman, tasn

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 15:39:13 -08:00
Carsten Haitzler 483cec924b evas - patch in one more if check for obj layer to avoid shutdown crash
this should fix T2715
2015-11-05 09:41:35 +09:00
Subodh Kumar 69c2b13474 evas textblock: fix memory leak
Summary:
Fix memory leak

Delimiter string is being saved using
eina_stringshare_replace without any del or free
when object is deleted.

@fix

Test Plan: N/A

Reviewers: tasn, herdsman

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-19 11:34:41 -07:00
Jean-Philippe Andre b031bbee9b Evas textblock: Force relayout during proxy render
If the textblock object was not visible in the main canvas, but
still needs to be rendered in a proxy surface, then _relayout may
not have been called. This forces generation of paragraphs based on
the current geometry.

This patch is ugly. I know. This is evas render :)
2015-10-07 10:48:18 +09:00
Daniel Hirt d6b6a73358 Evas textblock: fix case of own_closer in style_set
Looks like it was assumed that an fnode->orig_format always ends with a
'/' character if the fnode is an own_closer.
The problem is that a paragraph separator ("ps" and "br" - the latter in
legacy newline mode) is also an own_closer, but might not have '/' at the
end, so decrementing the length is wrong.

This fixes T2654. The example markup had "br" read as "b", which led to
a mismatch with the "font_weight=Bold" tag. Coincidentally, "ps" was not
affected as there was no matching "p" in the style.

@fix
2015-08-27 22:59:19 +03:00
Daniel Kolesa c4d666805d evas: fix missing render2_walk initializers
This caused annoying compiler warnings that are gone now.

@fix
2015-07-21 13:54:23 +01:00
Daniel Hirt 74ad947ded Evas textblock: Clear unused paragraphs
This fixes a scenario in which paragraphs in the current layout still
store visual lines from the previous layout. This is possible if the
text uses an ellipsis format, allowing the layout work to stop at a
certain paragraph. This inconsistency affects some query functions that
consider lines which may be irrelevant in the current layout.

Test Case: see added test case to evas_suite.

@fix
2015-07-14 16:04:40 +03:00
Daniel Hirt e8afd5241c Evas Textblock: Add obstacle objects feature
Summary:
Introducing a new feature for Evas Textblock. This allows the layout to
wrap around other evas objects.
The following API is added:
 - obstacle_add
 - obstacle_del
 - obstacle_update
Evas objects can now serve as textblock obstacles, if positioned and
visible on the text area. The text will wrap around the obstacles
according to the wrapping mode set to it.

This also modifies the current wrapping code to handle obstacle wrap
points as well. The wrap index query function is modified so that
forward-scanning (specific cases) may be disabled when treating
obstacle wrap point.

RTL text is currently unsupported by this feature.
Consult added docs and example for usage.

@feature

Test Plan: Evas example and test in evas_suite are provided with this.

Reviewers: tasn

Subscribers: raster, JackDanielZ, cedric

Differential Revision: https://phab.enlightenment.org/D2405
2015-07-01 16:24:31 +01:00
Daniel Hirt 8202044890 Evas textblock: Fix it->x value during layout
This updates it->x when visiting each item in the line layout code,
as it was always 0, even when it was used during item rollback.
Fortunately, in the above case a 0 value was actually expected, so
this does not actually affect current behavior.

This fix is mainly for consistency and future development.
2015-06-29 16:50:32 +03:00
Daniel Hirt 0de8ebbb3a Evas textblock: Fix infinite loop case
This fixes a case with wrapping, where the text has a mixture of 'none'
and 'word' wrapping modes, and the layout function decides to
roll-back a few items.
The test case is added to the evas_suite.
This might not be a common case, or even a case we had defined a proper
behavior to, but since it causes an infinite loop, it needs to be fixed.

@fix
2015-06-29 16:43:49 +03:00
Tom Hacohen b360084d0d Evas textblock: Fix issue with line_coord_set and y before the first line.
Let's assume we have a textblock with one paragraph at y = 3 and h = 50
At the moment, passing 60 (after the paragraph) to line_coord_set picks
the last line, however passing 0, just fails. This fixes that.

Thanks to Vladyslav Shevchenko for reporting it in D2574.

@fix
2015-06-26 15:21:59 +01:00
Daniel Kolesa c709f1dca2 eolian/generator: constify all prototypes for @const functions
Otherwise there would be conflicts in certain circumstances.

This also requires adding const on many existing functions,
and similar work is necessary in Elementary.

@fix
2015-06-25 12:18:43 +01:00
Daniel Hirt ed01a32c13 evas: move evas_object_inject to super's ctor
Summary:
As we always call evas_object_inject in every Evas Object's ctcor,
it seems sensible to move this repeated bit of code to the super
(Evas.Object).

Test Plan: Expedite, Elementary_Test and pretty much everything

Reviewers: cedric, raster

Subscribers: JackDanielZ, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-11 09:58:13 +02:00
Tom Hacohen 5a64c11bde Evas textblock: Migrate types to .eo. 2015-06-01 11:04:10 +01:00
Subodh Kumar 77e3ac7f82 Evas textblock: Add underline height support
Summary:
For showing text error like spell error thick underline is used hence added the underline height support.

@feature

Test Plan: test case added in evas textblock test.

Reviewers: raster, shilpasingh, tasn

Subscribers: govi, rajeshps, cedric

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

TAsn comment: I wonder if the format should be renamed to
underline_relheight instead of height. If you have any thoughts, please
let me know.
2015-05-27 11:18:19 +01:00
MinJeong Kim 344f17a03d evas_object_textblock: fix dereference before null check
Summary:
Fix coverity CID 1270031 Dereference before null check
@fix

Reviewers: devilhorns, zmike, raster, tasn

Reviewed By: tasn

Subscribers: tasn, cedric

Differential Revision: https://phab.enlightenment.org/D2522
2015-05-21 08:48:56 +01:00
Tom Hacohen 6efbfe227a Eo: Add a return value to eo_constructor().
From now on, constructors should return a value, usually the object
being worked on, or NULL (if the constructor failed). This can also
be used for implementing singletons, by just always returning the same
object from the constructor.

This is one of the final steps towards stabilizing Eo.

@feature
2015-05-20 13:03:24 +01:00
Sohyun Kim e48792a81e Evas textblock: remove freed item from the line list
@fix
2015-04-17 16:10:20 +09:00
Youngbok Shin b8b6c1e1a8 evas: Add safety check for NULL pointer of clipper.
Summary: It caused crash when clipper is NULL and it makes evas test-suite fail.

Test Plan: Run evas test-suite. (make check)

Reviewers: woohyun, tasn, herdsman, Hermet

Reviewed By: Hermet

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2215
2015-03-24 12:53:34 +09:00
Youngbok Shin e197f8804f evas: Support bitmap embedded color font.
Summary:
Add the code for getting bitmap buffers from embedded color font,
And draw the bitmap buffers as images.
For drawing the bitmap buffers as images,
evas_common_draw_context_font_ext_set internal API is changed to
pass additional gl engine functions.
T2139
@feature

Test Plan:
1. Set a bitmap embedded color font to textblock.
2. Set a unicode emoticon text.
3. See the result.

Please check the sample unicode in the following link.
http://www.fileformat.info/info/unicode/char/1f3af/index.htm
http://www.fileformat.info/info/unicode/char/1f555/index.htm
http://www.fileformat.info/info/unicode/char/2600/index.htm
http://www.fileformat.info/info/unicode/char/263a/index.htm

Reviewers: tasn, woohyun, jpeg, raster

Reviewed By: raster

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D2084
2015-03-19 19:02:03 +09:00
Jean-Philippe Andre 681573c555 Evas: Fix compilation warning (-Wshadow) 2015-02-13 14:00:23 +09:00
Carsten Haitzler 7c5f92d702 evas - render - have lock point to allow for async obj walk + update add
this adds a lock for when walking all the objects to generate render
commands for an async render. this allows even the object tree walk
plus update area caluclation to be moved off into async if every oject
that can change canvas state actually does so correctly. this change
adds all those lock block calls to synchronise with an async object
tree walk.
2015-02-12 11:06:40 +09:00
Jae Yong Hwang e561570507 evas:fix markup text length issue
Summary:
There was no conversion to the double quotation mark in the evas_textblock_text_utf8_to_markup function.
The price of the text coming out to API and text coming out to Textblock was different as a result.
As a result, Two text lengths came out differently.
So, I added the exceptional treatment part in the evas_textblock_text_utf8_to_markup function.

@fix

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1853
2015-01-08 19:38:49 +09:00
Tom Hacohen c970e787d6 Evas textblock: Remove redundant magic member.
We don't use magic since moving to Eo.
2014-12-15 14:58:32 +00:00
Tom Hacohen 95f89f6e2e Evas textblock: Fix possibly null dereference.
Thanks to kimcinoo for reporting.

@fix
2014-12-01 11:55:08 +00:00
Thiep Ha c30303d7e8 edje entry: improve selection performance
Summary:
The selection performance is slow if we select large chunk of text.
This is caused by many rectangles created and deleted.
This patch provides a way to improve it by combine selection rectangles
of line in middle into one rectangles (i.e, if we have N lines,
the selection rectangle for lines 2 to N-1 will be combined into one.)

@feature

Reviewers: raster, cedric, tasn

Subscribers: herdsman, woohyun, cedric

Differential Revision: https://phab.enlightenment.org/D1508
2014-11-26 11:29:09 +00:00
Thiep Ha e9a40835f2 textblock: correct text position for RTL text with margins
Summary:
If a RTL textblock has right margin, text is wrongly placed
(right margin is moved to left).
This patch fixes this issue.
Test cases are also added to test text position with margins.

@fix

Reviewers: tasn, herdsman

Subscribers: woohyun, cedric

Differential Revision: https://phab.enlightenment.org/D1691
2014-11-26 10:18:49 +02:00
kabeer khan c3ee589b8f evas_object_textblock: Resolved FIXME replaced int with size_t
Summary:
Since Evas_Textblock_Cursor has pos  of type size_t so changed
pos argument in _find_layout_item_line_match from int to size_t
Also Evas_Object_Textblock_Item has text_pos of size_t so defined
variable p of type size_t

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

Reviewers: tasn

Subscribers: devilhorns, cedric

Differential Revision: https://phab.enlightenment.org/D1692
2014-11-25 09:55:36 +00:00
Thiep Ha dee98ea248 evas textblock: return text direction for under cursor in cursor geometry get
Summary:
Currently, in cursor geometry get function, the text direction is not
returned if cursor is under cursor.
This patch fixs it by returning text direction for under cursor.

@fix

Reviewers: tasn

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D1505
2014-10-02 08:36:35 +01:00
Daniel Hirt fae337469e Evas Textblock: Fix native width of BiDi text
Summary:
This fixes an issue that causes BiDi text to get wrapped even when
resizing the textblock to its native size.
The way we find the last visual item in the native line is wrong. The
'visual_pos' describes the visual position in the formatted layout, in
which wrapping may occur. So, this is really bad to use it for native
width calculations as well.
Also, there's no need to actually reorder the line - we just need the
last visual item.
This adds and uses a function very similar to _layout_line_reorder, in
which we retrieve the last visual item in the native line. This
function does not do any actual reordering, as the native layout is
disposed of after calculation is done.

Also, added GET_ITEM_LEN macro for convenience.

Fixes T1532

@fix

Test Plan: Added to evas textblock test suite in this patch

Reviewers: tasn

Subscribers: id213sin, JackDanielZ, cedric

Maniphest Tasks: T1532

Differential Revision: https://phab.enlightenment.org/D1353
2014-10-01 16:45:58 +01:00
Daniel Hirt a4d716d1c0 Evas Textblock: Fix bad empty line add on wrapping
Summary:
In some cases of char or word wrapping, an empty line might be
accidentally added at the end of the paragraph. That line contains
no items. Of course, this line should not exist.
One outcome of this is that it causes wrong height values of the
paragraph, when the finalizing code uses the
_layout_last_line_max_descent_adjust_calc, which in turn
looks at that empty line to calculate the descent values.

@fix

Test Plan: Char-wrap and word-wrap tests to test suite included in this revision.

Reviewers: tasn

Subscribers: JackDanielZ, cedric

Projects: #efl

Differential Revision: https://phab.enlightenment.org/D1444
2014-09-26 13:20:14 +01:00
Tom Hacohen a7560dbc61 Eo: Change eo_add/del/unref behaviour.
Before this change eo_add() used to create an object with 1 ref, and if
the object had a parent, a second ref.
Now, eo_add() always returns an object with 1 ref, and eo_add_ref()
    preserves the old behaviour (for bindings).

eo_unref now un-parents if refcount is 0, and eo_del() is an alias for
eo_unref (will change to be a way to ensure an object is dead and goes
        to zombie-land even if still refed).
2014-09-25 17:38:45 +01:00
Srivardhan Hebbar 65ad94bac4 Documentation: Adding documentation for evas_object_textblock structures.
Summary:
This is a fix to one of the FIXME in the code, evas_object_textblock.c

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: herdsman, tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1383
2014-09-08 12:18:54 +01:00
Youngbok Shin 15281561e5 evas textblock: fixed ellipsis character cut off issue with complex markup text.
Summary:
Evas Textblock ellipsis is handled in a item.
When the ellipsis item is added in the text, some characters are cut off
considering width of ellipsis character.
But, it is handled in only one text item.
If there are many short text item, the ellipsis item can be cut off visually.
And there was a bug in the patch when text is displayed in two lines or more.
The bug is also fixed.

Fixes Phab ticket T1213

@fix

Test Plan: This commit includes test case.

Reviewers: woohyun, seoz, sohyun, tasn, raster

Subscribers: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D1360
2014-09-02 11:47:36 +01:00
Carsten Haitzler 27ae94596f evas textblock - fix inconsistent ascent/descent return ptr checks
ascent/descent are always non-null in usage of
_layout_item_ascent_descent_adjust() so don't check for them.

fix CID 1099704
2014-08-27 17:37:01 +09:00
Carsten Haitzler 2a580c1665 evas textblock - remove unused pointer
fixes CID 1039479
2014-08-25 13:17:02 +09:00
Tom Hacohen 1fcbd88e6d Evas textblock: Remove unused function. 2014-08-20 17:08:28 +01:00
Tom Hacohen 841191d907 Evas textblock: Fix BiDi text cut-off at the edges.
This patch fixes an issue causing text to be cut off in some cases.
The problem was that we were calculating line width and alignment before
we did any bidi calculations, which in turn caused us to use the wrong
text items for those calculations.

Many thanks to Daniel Hirt for investigating this deeply, finding all
the nitty-gritty and generally pointing me to where the problem is.
Daniel also provided the test case.
His patch (D1291) was close, but not enough.

Fixes T1496

@Fix
2014-08-20 15:10:23 +01:00
Carsten Haitzler 9a91261a4e Revert "evas textblock: fixed ellipsis character cut off issue with complex markup text."
This reverts commit d408408283.

this breaks mult-line "long" filenames in efm. 2nd line is just ...
for almost all of them (ones that are actually in need of 3 or more
lines). break break! REVERT!
2014-08-20 12:03:14 +09:00
Youngbok Shin d408408283 evas textblock: fixed ellipsis character cut off issue with complex markup text.
Summary:
Evas Textblock ellipsis is handled in a item.
When the ellipsis item is added in the text, some characters are cut off
considering width of ellipsis character.
But, it is handled in only one text item.
If there are many short text item, the ellipsis item can be cut off visually.

Fixes Phab ticket T1213

@fix

Test Plan: This commit includes test case.

Reviewers: woohyun, seoz, sohyun, tasn

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D1311
2014-08-19 15:20:35 +01:00
Carsten Haitzler 4b431d3638 evas font - fix null access of font format possibility
this fixes NULL access in CID 1099705, 1099703, 1099704
2014-08-14 18:14:08 +09:00
Carsten Haitzler d539152156 address non nul terminated string due to strncpy
this addresses CID 1230994. as such  eina_unicode_unicode_to_utf8()
always returns a nul terminated string. so it's guaranteed. but yes -
if string is 7 bytes or longer it will not put a nul byte on the
destination. as such for a single unicode char this can never happen
as in utf8 it's 6 bytes. but since eina_unicode_unicode_to_utf8()
safely returns a nul terminated string at all times - we can just use
strcpy safely. no need for strncpy. also handle null return from
eina_unicode_unicode_to_utf8()
2014-08-13 09:03:02 +09:00
Tom Hacohen 90c0eb15a4 Evas textblock: strcpy->strncpy (although the buffer is always big enough).
Many tools will complain about the use of strcpy, and it's not that hard to use
strncpy anyway.

CID1039581.
2014-08-12 10:11:41 +01:00
Tom Hacohen 1d6960867d Evas textblock: remove checks for impossible null derefs.
This improves code clarity based on input from coverity.

CID1190401
CID1190402
2014-08-12 09:52:18 +01:00
Youngbok Shin 7a87f322f4 textblock: Update visual_pos before calling _size_native_calc_line_finalize.
Summary:
In items loop of _size_native_calc_line_finalize,
last_it should be replaced with new item according to position.
But, visual_pos is not prepared and it is always zero in the function.
So, we need to update visual_pos.
And when textblock only has LTR text,
we can replace last_it according to item list sequence.
@fix

Test Plan:
It includes test cases using the following test case.
 1. "i<b>。</b>"
 2. "。<b>i</b>"

Reviewers: seoz, woohyun, sohyun, tasn

Subscribers: raster, herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D859
2014-08-06 10:40:02 +01:00
Youngbok Shin 1984961ba6 evas/textblock: fix to keep original format when a markup tag is matched to a style tag.
Summary:
We can define a style tag as opener, closer and own closer.
If there is a markup tag that is matched to style tag,
it is reprocessed to format node inside of textblock.
But, when the format node will be converted to markup text,
'/' character can be appended to text at closer and own closer style tag.
Even if original markup tag does not has '/' character,
it will be appended according to format node information.

It makes some issue when compare input text with output text.
@fix

Test Plan: This commit includes test case.

Reviewers: woohyun, raster, sohyun, tasn

Subscribers: herdsman, cedric

Differential Revision: https://phab.enlightenment.org/D1037
2014-08-05 10:26:05 +01:00
Thiep Ha 104f04eda1 Evas textblock: Correct word start/end moving at new line or line begins with spaces
Summary:
Word start/end works incorrectly when it goes to new line or line begins with spaces.
Ex: In elementary_test/Entry, place cursor at the end of line, press ctrl + right arrow keys: cursor moves to begin of next line. In this case, cursor should move to end of 1st word in next line.
Ex2: In elementary_test/Entry, add some spaces to begin of 2nd line ("   uses markup"), place cursor at the first word ("uses"), press ctrl + left arrow keys twice, cursor moves to begin of 2nd line. In this case, cursor should move to begin of last word in 1st line.

This patch provides a fix by considerring next/previous text node to move cursor to correct place.

@fix

Reviewers: woohyun, raster, tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1140
2014-08-04 11:01:51 +01:00
Thiep Ha 808202e6af Evas textblock: Fix memory leak
Summary:
In evas_textblock_cursor_word_end function, the breaks' memory is allocated but not freed when cursor position is equal to text length.
Fix: Remove memory allocating.

@fix

Reviewers: raster, tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1225
2014-07-25 16:06:37 +01:00
Tom Hacohen 7f3a44894b Evas canvas eolian: Fix namespace and class name for the evas canvas. 2014-06-30 17:47:06 +01:00
Daniel Hirt 2b40860f78 Evas/Textblock: Introduce PS deletion bug test and fix
Summary:
This test should make the test suite fail. It sets "a<ps>b" and
"a<ps/>b" markups, and deletes the PS format. Essentially, these two
different markups should have the same result by this deletion. Instead,
only the <ps/> format gets deleted properly.
A follow-up commit is added with this as a fix.

Evas/Textblock: fix deletion of PS bug

Fixes an issue with deletion of "<ps>". Format deletion was only
performed for formats that are own-closers. This sets the paragraph
separator to be an own-closer format.

@fix

Reviewers: tasn

Reviewed By: tasn

CC: JackDanielZ, id213sin

Differential Revision: https://phab.enlightenment.org/D1046
2014-06-17 11:11:33 +01:00
Youngbok Shin f7cf96d4d9 evas/textblock: check item's type before returning result.
Summary:
When format item is cut off by ellipsis, result of "_find_layout_item_line_match"
can be TEXT type item. And it keeps ellipsis item's information.
@fix

Test Plan: D974

Reviewers: woohyun, tasn

CC: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D975
2014-06-10 15:08:09 +01:00
Tom Hacohen 0fc3279db9 Efl: Update code to use the new class names generated by eolian. 2014-06-03 11:28:01 +01:00
Daniel Hirt 177135ff0d Evas/Textblock: add support for ellipsis values
Summary:
This enables textblock to support more values other than 1.0.
For 0 <= ellipsis < 1.0, it splits the text such that it fits the
textblock's width. The ellipsis is relatively position according to the
ellipsis value, and characters are removed also relatively.
For example, a value of 0.5 will position the ellipsis right in the
center of the textblock's width, while removing characters equally right
and left from the center.

Basic approach to this feature was to do some work before the layout
process. We calculate the expected total width of the items, and by how
much we exceed from the textblock's width. Afterwards is it just some
careful work to set the boundaries of the width we want to cut, and
deciding which characters we need to removed to fulfill this requirement.
The rest is splitting the text and visually-removing the part we
need to cut.
This is all handled before any logical lines are created, so the
_layout_par function remains almost intact. A designated _ellip_prev_it
field in the Paragraph struct instructs after which item we place the
ellipsis item, if at all.

Note that we keep the fast path for ellipsis 1.0, as heavier work needs
to be done for the other values.

Added tests to evas_suite for a range of ellipsis values.

Also, multiline is unsupported at the moment.
@feature

Test Plan: Anything that uses Evas Textblock (single-line, please)

Reviewers: tasn, id213sin, raster

CC: cedric, JackDanielZ, raster

Differential Revision: https://phab.enlightenment.org/D905
2014-05-29 15:52:01 +01:00
ChunEon Park b61b1c9412 evas/textblock - apply efl coding style. 2014-05-28 14:19:46 +09:00
ChunEon Park fbb4d092cb evas/textblock - removed unnecessary null check.
It should be definitely valid.
It's meaningless checking the value there.
2014-05-28 14:14:35 +09:00
ChunEon Park e973390f64 evas/textblock - null check format.
logically it's insane that it doesn't check the null there but it checks right next line.
2014-05-28 14:09:34 +09:00
Tom Hacohen cf4ad9328a Evas textblock: Fix wrong advance calculation when bidi is disabled.
The last_it was not updated correctly with bidi disabled.

Thanks to Daniel Hirt for spotting this.

@fix
2014-05-27 14:20:18 +01:00
ChunEon Park a5b89f17b3 evas - removed stdlib.h math.h header include in each source files.
It's included in the evas_common_private.h.
2014-05-07 16:33:23 +09:00
ChunEon Park c399017cef evas - removed unncessary header include
it's already done in evas_common_private.h. no need it in each file.
2014-04-29 15:44:29 +09:00
Yossi Kantor 1563181922 Eolian: Legacy integration of Evas Rectangle, Polygon, Line, Textgrid and Textblock 2014-04-11 09:26:15 +03:00
Tom Hacohen 35525a53e0 Adjust eo_do calls to work with the eo2 api. 2014-04-10 04:20:21 +01:00
Tom Hacohen 8e5234cf75 Evas textblock: Minor code cleanup.
Moved a global variable into a local scope, as it's no longer needed globally.
2014-04-02 10:06:57 +01:00
Tom Hacohen 2e7565b7c3 Evas textblock: Fixed compilation with FriBiDi disabled.
This issue was introduced in d175b8aa69
during the previous merge window.

Thanks a lot to vtorri for reporting.
2014-03-31 11:41:51 +01:00
Daniel Hirt 5778896735 Evas Textblock: increase ref of format before work
We need to increase ref count for the format prior to calling of
functions that handle the layout.
This resolves valgrind error of accessing already freed memory.
Please note that a scenerio to trigger this exists in test suite, and
for some reason is not being detected by jenkins.
@fix
2014-03-26 12:32:25 +00:00
Cedric BAIL fe2948be08 evas: let's be to safe than sorry.
Fix CID 1193214.
2014-03-20 16:50:48 +09:00
Daniel Zaoui 6fd341a449 Eolian: Fix ctor/dtor generation 2014-03-19 07:04:28 +02:00
Tom Hacohen 2eaf9049b9 Evas textblock: Don't include right margin/padding twice when aligning lines.
This should fix enventor issues.

@fix
2014-03-14 12:54:09 +00:00
Tom Hacohen d175b8aa69 Evas textblock: Fix clipping issues with some texts with width > advance.
This happens with many texts. The issue occurs when the width of the
last char is larger than it's advance. Before this patch, we didn't the
width into account when calculating width, thus causing clipping issues
in some cases.
2014-03-10 14:58:18 +00:00
Daniel Zaoui ee7541e202 Eolian: Integration of Evas Text Block 2014-03-10 13:28:03 +02:00
Tom Hacohen 46361148b2 Evas textblock: Implemented mid-contextualization formatting.
There are many situations (e.g all the time with Arabic text) in which
characters change their appearance depending on the context they lie
within. Before this patch, we didn't support changing font appearance
mid-context. So for example one couldn't do "a<color=#f00>b" without
messing up 'a' and 'b's change to their contextual forms.

Although Arabic is a very good example, this also applies to Latin text
in many cases, and should fix some wrong spacing that might have
appeared when changing styles.

@feature
2014-02-28 10:47:56 +00:00
Tom Hacohen 0378e41958 Evas textblock: removed unused internal function. 2014-02-26 12:25:08 +00:00
Tom Hacohen 0e5d3f9b98 Evas textblock: Fixed a few word start/end issues.
Fixed issues with valgrind complaints at the end of the textblock, and
Fixed wrong jumping with some special cases like "a a a a "."

This fixes T995.
2014-02-19 14:38:06 +00:00
Tom Hacohen 650b0b6c64 Evas textblock: Fixed colour setting for textblock formats.
Of course Cedric introduced a bug. The bug was that the current colour context
is set to the previously selected colour, instead of the current one, which
made all colours wrong.

Fixes T926.
2014-02-10 16:49:53 +00:00
Tom Hacohen 80033e022d Evas textblock: Fix rendering of spaces in some cases.
The issue was with a textblock that's being resized and a space between formats.
The problem is, that the text would get trimmed when wrapping, and then not
restored, because it had nothing to merge to.

This fixes T924.
2014-02-10 14:17:03 +00:00
Carsten Haitzler acbcc7da6a in case font_instance is null in text_props... avoid using it 2014-02-09 19:39:30 +09:00
Carsten Haitzler 229ee74f6c evas - textblock ... fix valign handling to actually work as documented
valign handling was really broken. this fixes it to pretty much work
again. ie 0.0 == top, 0.5 == centered, 1.0 == bottom align and -1.0
== baseline. only baseline worked before.
2014-02-08 22:54:56 +09:00
Tom Hacohen 354691e03e Evas textblock: Fixed *_cursor_char_coord_set with some y values.
Specifically y values that are between par->y and the first ln->y.

This should fix some selection issues with elm.
2014-02-07 13:14:21 +00:00
Jean-Philippe Andre 2928a2d2da Evas: Move _format_color_parse to common file
This (simple) code should be shared between Textblock and Filters.
2014-02-07 15:38:42 +09:00
Tom Hacohen 9cc7e69338 Evas textblock: Improved error messages when detecting errors in markup. 2014-02-05 13:51:22 +00:00
Youngbok Shin c48c9827ff evas: textblock - Added Null checking in evas_textblock_text_markup_to_utf8 before calling eina_strbuf_append_length API.
Summary:
When input string has non-finished markup tags or escaped tags,
eina_strbuf_append_length is called with Null string.
There is a Null checking in eina_strbuf_* API, but it will print error message when input string is Null.
Strictly speaking, *_markup_to_utf8 API could be used with any kind of input string.
So, we need to add Null checking for removing the useless error message.

Test Plan:
Call the API like the following code.
evas_textblock_text_markup_to_utf8(NULL, "test_text&&&&");

ERR message will be printed.

Reviewers: woohyun, tasn, seoz, Hermet, hbr4570

CC: cedric

Differential Revision: https://phab.enlightenment.org/D493
2014-02-05 13:23:55 +00:00
Tom Hacohen 22813f5b52 Evas textblock: Fix selection with bidi text.
This is a regression introduced in
548e548632.

This is really bad, and essentially broke selection geometry for bidi
text. Very serious.

The problematic code assumed that the range comparison for the items
assumed the item marked with 1 is always logically before the item marked
with 2, which is just not true.
2014-01-29 13:27:45 +00:00
Youngbok Shin a2c4c40474 evas: Fixed to compare current render_op with previous render_op for textblock. If the render_op is changed, call evas_object_render_pre_prev_cur_add.
Summary: This change is related to the commit: cdb86e34bb

Reviewers: woohyun, tasn, Hermet, seoz

CC: cedric

Differential Revision: https://phab.enlightenment.org/D450
2014-01-18 19:06:16 +09:00
Jean-Philippe Andre 908785b60d Textblock: Relayout if needed in line geometry get
evas_object_textblock_line_number_geometry_get() did not trigger
a relayout, so it could end up returning FALSE and invalid values.
2014-01-15 17:55:27 +09:00
Jean-Philippe Andre 9860af0b35 Textblock: Fix padding with styles (part 2)
Summary:
If ONE single item in the whole textblock has a padding of k,
then ALL the lines of the textblock will be padded by k pixels.

Here's a solution to add the padding only to the first line.

Test Plan:
Write any multiline text, without styles, in an entry.
Add some glow to one element. All lines should be spaced by
an extra 2 pixels.

Reviewers: tasn

CC: cedric

Differential Revision: https://phab.enlightenment.org/D442
2014-01-15 17:55:27 +09:00
Jean-Philippe Andre 6970a020c1 Textblock: Fix padding computation (part 1)
Track padding per paragraph, since this is how it is computed.

Problem before this patch:
- If markup text is changed, padding may grow, and the layout is updated (good)
- If the UI itself needs a relayout, the old padding value is NOT reused,
so style paddings will reset the padding to 0.

Test protocol:
- Set some text with style=glow. The whole object should have padding 2,2,2,2
- Relayout the UI, the whole object will have padding 0,0,0,0 (should be 2,2,2,2)
2014-01-15 17:55:27 +09:00
Ryuan Choi b25df71d57 textblock: Simple refactoring for _markup_get_text_utf8_append to call eina_unicode_utf8_next_get directly
Summary:
evas_string_char_next_get is simple wrapper of eina_unicode_utf8_next_get with
some check routines.
But in _markup_get_text_utf8_append, these check routines look unnecessary.

Reviewers: cedric, seoz, raster

Reviewed By: raster

CC: cedric

Differential Revision: https://phab.enlightenment.org/D420
2013-12-29 13:33:20 +09:00
Youngbok Shin 4270ddb0b7 Evas textblock: Fixed range_text_get bug with multiple text nodes.
Summary:
When there is multi text nodes for range text get,
it gets wrong format node of last text node.
It makes broken result.

Test Plan: https://phab.enlightenment.org/D398

Reviewers: woohyun, tasn, seoz

Reviewed By: tasn

CC: cedric

Differential Revision: https://phab.enlightenment.org/D399
2013-12-27 11:36:10 +00:00
Cedric BAIL 922fe6c109 evas: improve textblock rendering by walking even less in all case.
We now build a list of item to walk on for each step to just avoid all necessary walking.
It is a slightly more elegant idea than my previous patch even if it only give a speed
improvement of 5% in the best case. Now that render code and the callee only take 1.6%
of the time I am looking at in the benchmark, meaning nothing else to improve here.

This fix the bug spotted in Enlightenment dialog box.
2013-12-27 09:54:46 +09:00
Carsten Haitzler 3367bf0aba Revert "evas: improve textblock rendering by walking even less in all case."
This reverts commit a69c5ba0ae.

yes - this broke text rendering. revert it. several dialogs/uses in e
broke with shadow and glow text being heavily offset up/to the right
of the proper text.
2013-12-27 00:06:37 +09:00
Cedric BAIL a69c5ba0ae evas: improve textblock rendering by walking even less in all case.
We now build a list of item to walk on for each step to just avoid all necessary walking.
It is a slightly more elegant idea than my previous patch even if it only give a speed
improvement of 5% in the best case. Now that render code and the callee only take 1.6%
of the time I am looking at in the benchmark, meaning nothing else to improve here.
2013-12-26 19:20:12 +09:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
Cedric BAIL 766bd42639 evas: limit how many times we walk over items.
This does help for some textblock benchmark with a speed increase of 12% and
the one that don't get better don't get slower either, so let's put that in.
2013-12-26 11:27:09 +09:00
Tom Hacohen 7aae5d0804 Evas textblock: Fixed range_deletion bug with multiple visible formats.
This makes the tests added in 8bee8853ae
pass.

Thanks to Youngbok Shin for reporting.
2013-12-16 15:45:10 +00:00
Tom Hacohen 7141c1dbb2 Evas textblock: Fixed deletion of ranges ending with visual formats.
This is a regression introduced in:
3f3ad67616
2013-12-13 14:44:16 +00:00
Carsten Haitzler 5a9184b323 evas - textblock - fix dbg_info_get to avoid leak if root is NULL
fixes CID 1040007
2013-12-11 19:00:15 +09:00
Jean-Philippe Andre 0cb048f9b6 Evas textblock: Fix crash with empty markups values
Markup parsing will segv if a value string is empty,
as in "<style=>". Sure, this is invalid, but hey, it could
definitely be used from an app or even by a user writing
his own markups :)

The internal doc says this function expects an item to be
of the form "key=val" but there are no checks beyond the
presence of "=" in the string before calling it.
2013-12-10 12:05:04 +09:00
Tom Hacohen b5262de237 Evas textblock: Slightly improve paragraph items freeing.
Use the EINA_LIST_FREE macro instead of a safe loop and a list free.
This is faster and cleaner.
2013-12-09 13:33:46 +00:00
Tom Hacohen f0d3cb91b3 Evas textblock: Fixed wrapping of lines ending with whites.
Whites at the end of lines ending with whites should not be cut, but
should be wrapped (there's no legal line break there).

Thanks to Shilpa Singh for reporting.
2013-11-25 14:41:24 +00:00
Tom Hacohen c23ef6de3d Evas textblock: Improved debug helper functions. 2013-11-21 14:22:02 +00:00
Tom Hacohen 7bba64d7ee Evas textblock: Fixed order of tags inserted with markup_app/prepend.
The order was messed up when inserting a few formats in the
markup_append/prepend functions without any characters between them.
For example, inserting "<b><i>" would result in "<i><b>" being inserted.

Thanks to YoungBok Shin for reporting this.
2013-11-19 16:05:34 +00:00
Yakov Goldberg c101d85541 evas/textblock: add const for param in evas_object_textblock_style_set for consistency 2013-11-11 13:17:03 +02:00
Tom Hacohen c7addf4083 Changed Eo class names to be consistent.
All the class names are now of the format: Lib_Type_Subtype_Extra.
2013-11-07 11:17:52 +00:00
Youngbok Shin cdb86e34bb Evas: Fixed textblock rendering to properly set render operation on context.
Render operation are not well tested. It appears that it was never properly setted
on a textblock, this would lead to see it rendered with the render operation of another
object.

Test Plan:
Add some rectangle object with textblock object.
The textblock style should be set to "backing=on backing_color=#ffffffff".
Set render operation to some rectangle with "evas_object_render_op_set(rect, EVAS_RENDER_COPY)".
Check the textblock.

Reviewers: woohyun, cedric, raster

Reviewed By: cedric

CC: cedric

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

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-11-01 11:12:01 +09:00
Youngbok Shin d17e0d3936 evas: Fixed the textblock format to be drawn according to the glyph's horizontal advance width.
Summary:
Some characters have different two value on glyph's width and horizontal advance width.
If the glyph's width is smaller than advance width, format can be drawn weird.

Test Plan:
Set underline:on to the entry style and just insert the following characters.
。
、
)
(

Reviewers: tasn, woohyun

CC: cedric

Differential Revision: https://phab.enlightenment.org/D270
2013-10-18 11:25:59 +01:00
Cedric Bail 6be9cc74de evas: simplify logic for textblock style parameter parsing. 2013-10-16 18:56:32 +09:00
Carsten Haitzler aba7e9892e evas - fix textblock handling of effects for shadows and so on in some cases 2013-10-15 16:05:11 +09:00
Tom Hacohen 82f5f78dac Revert "evas/textblock - null check."
I'm sorry, but those kind of commit messages are unacceptable for code
I'm the only maintainer of. It's bad enough that to have them in the
project in general, but this I won't accept.

I wanted to review this commit, but the lack of explanation about what
you are trying to fix and why you think this is the good fix prevents me
from doing my job. However, without really looking too much into it,
this commit looks wrong. evas_textblock_cursor_format_is_visible_get
should verify there's a format node...

Please come up with a better commit message and re-commit.

This reverts commit fe33aa7408.
2013-10-03 18:45:07 +01:00
ChunEon Park fe33aa7408 evas/textblock - null check. 2013-10-04 02:43:20 +09:00
Tom Hacohen 04b28686af Evas Textblock: Use font underline properties.
This change causes textblock to use the font properties when drawing
underline.
2013-10-02 11:46:25 +01:00
Tom Hacohen bb84a01f7c Evas textblock: Moved relayout checks to a function.
This cleans up the code a bit and makes it a bit simpler.
2013-09-30 16:15:16 +01:00
Carsten Haitzler a4a285089f evas - improve textblock logic to reduce num of layouts when used - faster
when using genlist and the edje item objects, there seem to be a lot
of excess textblock layouts happening. i was seeing about 12 layouts per tb
part in the edje before this patch. with this it's down to about 3.
2013-09-30 23:31:48 +09:00
Stefan Schmidt 642e4293ff evas/textblock: Remove null statement. 2013-09-30 09:48:34 +01:00
Cedric BAIL 5d37215d26 evas: let's micro optimize the parsing of format.
Only the key is worth being a stringshare as it is used to do an efficient
binary comparison instead of iterating over all possibility. Also reused
some already known value and a few other speedup.
2013-09-29 13:43:46 +02:00
Tom Hacohen 682c69764d Revert "eo: libs,test,benchmarks Eo_Class -> Eo"
This reverts commit 1714fe93f4.

We actually want this type, it makes things clearer.

Conflicts:
	src/tests/eo/function_overrides/function_overrides_inherit2.c
	src/tests/eo/function_overrides/function_overrides_simple.c
	src/tests/eo/suite/eo_test_class_simple.c
2013-09-27 16:40:32 +01:00
Jérémy Zurcher 1714fe93f4 eo: libs,test,benchmarks Eo_Class -> Eo
Conflicts:
	src/tests/eo/suite/eo_test_general.c
2013-09-27 14:01:46 +01:00
Cedric Bail b37494503f evas: update to new eo_parent_get/set API. 2013-09-25 13:34:18 +09:00
Tom Hacohen 2ab088aeea Evas textblock: Fixed native size calculation. 2013-09-23 14:37:18 +01:00
Tom Hacohen 2173652b4d Evas textblock: Fix format based line size calculation.
Format based line size modifiers were not applied.
2013-09-23 14:37:18 +01:00
Tom Hacohen cbde2bef69 Evas textblock: Fixed max descent adjustment and a related bug.
The bug caused wrong line sizing in some situations (appending new
paragraphs to a textblock).
2013-09-23 14:37:18 +01:00
Tom Hacohen 72167b9cc3 Evas textblock: Fixed ascent/descent calculation a bit more.
Separated maxascent/descent from ascent/descent even further.
Fix calculation to be based on font instance and not the font group.
2013-09-23 14:37:18 +01:00
Tom Hacohen 5adffd54e5 Evas textblock: rename maxascent/descent->ascent/descent.
Although we kinda use them as max in some situations, they are actually
just the regular ascent and descent. Following commits will make this
separation even stronger.
2013-09-23 14:37:18 +01:00
Tom Hacohen 94e6f6a5bc Evas textblock: Fix wrong line spacing when appending lines.
This fixes T397 which was introduced by commit: 4bcf4991eb.
This also fixes the issues with enventor.
2013-09-20 13:52:48 +01:00
Tom Hacohen bda3ceb632 Evas textblock: fixed *_markup_get issue with escaped chars.
Markup_get was misbehaving and returning wrong results with some escaped
chars. markup_to_utf8 was working correctly. Merged the code together
and now both are consistent and correct.

Thanks to WooHyun for reporting.
2013-09-03 11:50:34 +01:00
Tom Hacohen 4bcf4991eb Evas textblock: Fixed calculation of maxdescent.
Thanks to YoungBok Shin for reporting.
2013-08-20 11:13:06 +01:00
Tom Hacohen 76eceda2ee Evas textblock: make an if look nicer (no logic change).
This makes things simpler and less confusing and might have prevented
the issue Stefan fixed in 4f484b81d4
from happenning in the first place.
2013-08-09 15:46:40 +01:00
Stefan Schmidt 4f484b81d4 evas/textblock: Do not write out of bounds.
The length is len so last array index must be len - 1. Better not
corrupt memory. :)

CID 1039302
2013-08-09 11:54:42 +01:00
Tom Hacohen 1d75dcaf56 Evas textblock: Make the ellipsis format the same as the surrounding.
This fix is based on a solution by WooHyun Jung.
2013-08-08 13:10:39 +01:00
Tom Hacohen 6583b83c73 Evas textblock: Use max ascent/descent at the edges of the textblock.
Thanks to Youngbok Shin for reporting the difference in behaviour between
textblock and text object.
2013-08-06 09:29:03 +01:00
Cedric Bail 9104fe7322 evas: let's not leak temporary list left over. 2013-08-01 19:39:58 +09:00
Yakov Goldberg ae561346e4 evas/textblock: fix my own boolean expression to be more obvious 2013-07-21 11:57:11 +03:00
Carsten Haitzler 76229f7a2f fix clang nonnull warning. 2013-07-16 16:47:35 +09:00
Cedric Bail 48b40640b5 evas: no need to call eo_data_scope_get in many case after this change.
Reduce CPU usage by 5% in some case (especially when the CPU is not the
limiting factor like with the GL backend).
2013-07-09 09:48:09 +09:00
Tom Hacohen 5d4ff97e20 Evas textblock: Fixed issue with *textblock_cursor_range_formats_get.
In some cases we could return extra formats that are outside of the
range. It's actually not completely fixed yet.

Thanks to clang-analyzer for detecting this.
2013-07-04 10:07:52 +01:00
Tom Hacohen 827885d794 Evas textblock: Fixed format parsing to not be confused by single-quotes.
Before this commit, having a single quote anywhere in the format would mess
up all of the format parsing.

Thanks to MinSu Seo for reporting.
2013-07-01 14:18:52 +01:00
Tom Hacohen fdbc477f79 Evas textblock: Fixed issue with textblocks without fonts segfaulting.
Fixes T184 (which is a regression).
2013-06-25 16:37:48 +01:00
Sebastian Dransfeld 51023d2d4f evas: Keep sane name for public header
Evas_Common.h should be used for the public header, and rather rename
evas_common.h internal header to another name.

Sa:
Evas_Common_Header.h -> Evas_Common.h
evas_common.h -> evas_common_private.h

Shouldn't have both Evas_Common.h and evas_common.h because of case
insensitive filesystems.
2013-06-20 12:53:29 +02:00
ChunEon Park 1f558c6cde evas/textblock - revert the textblock pre_render_done.
Fundamentally, this is not a point of the problem.

somewhere pre_render caller is inccorrect without releasing the flag.
2013-05-30 14:43:41 +09:00
ChunEon Park b7ff5a737f evas/textblock - fix the textblock to render pre again if it needs to be relayouting 2013-05-28 23:07:24 +09:00
ChunEon Park 7003b7fd0b evas/textblock - fix indent 2013-05-28 23:00:31 +09:00
Daniel Juyung Seo b2dd73e841 evas_object_textblock.c: fixed a typo in the documentation. 2013-05-21 19:21:47 +09:00
Tom Hacohen 97acb71175 Evas textblock: Removed double ;. 2013-05-16 10:38:56 +01:00
Carsten Haitzler f8c9a8d167 revert the revert... damn you git!
Revert "Revert "Efl: replace eo_data_get for objects data referencing.""

This reverts commit b64a2994b3.
2013-05-02 16:47:16 +09:00
Carsten Haitzler b64a2994b3 Revert "Efl: replace eo_data_get for objects data referencing."
This reverts commit 654a3f5f94.
2013-05-02 14:17:19 +09:00
Daniel Zaoui 654a3f5f94 Efl: replace eo_data_get for objects data referencing. 2013-05-01 10:37:08 +03:00
Tom Hacohen 455d8790b9 Evas textblock: Fixed line size calculation when using multiple fonts.
Thanks to MinSu Seo for reporting.
2013-04-25 15:16:20 +01:00
Tom Hacohen 3f3ad67616 Evas textblock: Fixed a bug with deletion of ranges.
Fixed a bug with deletion of ranges that end just before a visual format.
Thanks to WooHyun Jung for reporting.
2013-04-15 17:15:22 +01:00
Cedric Bail d1c502fe26 evas: remove warning, no need for double (). 2013-04-12 11:24:14 +09:00
Yakov Goldberg 7016872619 Efl textblock/entry: additions to split BiDi cursor
- handling multiple runs, multiple lines, last char of line/par
   - tests added

Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
2013-04-10 14:59:48 +03:00
Tom 'TAsn' Hacohen a70abbb381 Efl textblock/entry: Added support for split BiDi cursor.
If logical cursor is between LTR/RTL text two cursors will be shown.
  Upper cursor is shown for the text of the same direction as
  paragraph, lower cursor - for opposite.

  NOT DONE YET

Signed-off-by: Tom 'TAsn' Hacohen <tom@stosb.com>
2013-04-10 14:58:32 +03:00
Cedric Bail f1dfbc4e0e evas: remove one useless pointer (-30KB). 2013-04-07 14:00:10 +09:00
Daniel Willmann 1cb5a8f63a evas_textblock: Avoid dereferencing out-of-bounds element
Address sanitizer found this. Not really a serious error as text[i] will
be 0 in that case (I believe) and the loop is aborted in any case.

Still, better safe than sorry.

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
2013-04-02 18:57:43 +01:00
Carsten Haitzler 4f4681ebd8 warn-- 2013-03-28 20:13:40 +09:00
Carsten Haitzler 1f1704924d fix word start/end logic to be consistent with other toolkits. 2013-03-28 18:51:18 +09:00
Tom Hacohen a170683334 Change usage of eo_do_super to the new prototype. 2013-03-18 16:14:18 +00:00
Cedric BAIL d79a2efa39 evas: use Eina_Cow a lot more and we are closer to the memory size of 1.7. 2013-03-13 14:35:25 +09:00
Tom Hacohen 5dc2d7c126 Evas textblock: Fixed "high" text size adjustments for multiple paragraphs. 2013-02-28 16:48:09 +00:00
Tom Hacohen 5a55e5e56c Evas textblock: Added proper size adjustments for "high" shaped texts.
This adjusts the starting coords of the textblock to fit the shaped char of
the first line.
2013-02-28 16:26:09 +00:00
Tom Hacohen 2e001a25bf textblock: Added native and formatted sizes to clouseau. 2013-02-15 17:19:29 +00:00
Tom Hacohen 3974cb3dc1 Evas textblock: Fixed a selection bug introduced in my previous commit.
I matched against the wrong values so it never included items in the middle
even when needed.

SVN revision: 83869
2013-02-13 12:42:44 +00:00
Tom Hacohen 548e548632 Evas textblock: Fixed a selection issue.
The issue happens when selecting in strings that have both bidi and different
scripts in the same bidi run. E.g: "עבריתenglishрусскийעברית".

SVN revision: 83786
2013-02-08 15:31:25 +00:00
Tom Hacohen 70156285b0 Eo dbg: Use eina_value as the debug info type.
SVN revision: 83443
2013-01-29 16:36:01 +00:00
Aharon Hillel 028f059d32 Clouseau-Eo integration: Added debug info functions.
From now, classes implementing the Eo function with id
EO_BASE_SUB_ID_DBG_INFO_GET will be able to show in Clouseau their own
specific information.
Information contents is controlled by the class itself and no more
by Clouseau. Basic types and lists are supported..

Signed-off-by: Aharon Hillel <a.hillel@samsung.com>

SVN revision: 83410
2013-01-29 06:36:23 +00:00
Cedric BAIL c0e62fb818 efl: remove a forgotten deprecated call.
SVN revision: 83069
2013-01-22 10:47:47 +00:00
Tom Hacohen ac0ff4c997 Evas textblock: Added EAPI to the ifdefed debugging funcs.
SVN revision: 82815
2013-01-15 14:49:38 +00:00
Tom Hacohen d925820fa9 Evas textblock: simplified and fixed bugs in _cursor_geometry_get
SVN revision: 82798
2013-01-15 10:57:34 +00:00
Stefan Schmidt b4b7c9239d Evas textblock: Fixed issue with line height when breakingon format.
All kudos to Tom for this one.

SVN revision: 82763
2013-01-14 14:18:10 +00:00
Carsten Haitzler 440bb7c23c cut down textprop size a bit... 72 -> 64bytes. if we can wrap
tp->start/len/text_offset/text_len read/wrtie in access funcs. so we
can special case where:

1. start == text_offset == 0 && len == text_len == 1
2. start == text_offset == 0 && len == text_len < 65536
3. start == text_offset == 0 && len == text_len < 256
 


SVN revision: 82692
2013-01-12 08:40:46 +00:00
Leandro Pereira d5f91fd5c2 evas/async_render: do not use async event to unref glyphs
Patch by: Leandro Pereira <leandro@profusion.mobi>



SVN revision: 82662
2013-01-11 19:55:40 +00:00