Commit Graph

34 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 4f77eca4e1 Canvas text: don't generate legacy for new api
This is part of the new Canvas.Text.
2017-09-25 12:51:49 +03:00
Daniel Kolesa f36e5bd543 eolian: add mstring
This is a new type representing a mutable string (no const).
Regular strings cannot be made mutable with @owned because
they might be hidden behind typedefs.
2017-09-22 17:10:42 +02: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 f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Daniel Kolesa a8b8b7efde eo files: first batch of @owned conversions 2017-09-15 16:44:26 +02:00
Stefan Schmidt 9c3ace8c6d docs: evas_canvas_text: document missing events 2017-08-31 11:25:13 +02: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 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 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 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
Jean-Philippe Andre af3cb10185 evas: Remove Evas.Coord from EO
This may be a bit more controversial...
But Evas_Coord really is just an int and all the internals
of EFL assume that the base coordinate type is a 32-bit int.
So this type is a bit redondant and can't easily be changed
to, say, a float or int64.

Ref T5312
2017-05-15 17:26:42 +09:00
Daniel Kolesa 3fb4bc336e eo: hide dbg_info from eo files
Continues b780cf2af2.
2017-04-21 17:59:32 +02:00
Jean-Philippe Andre 13c62c10e1 evas: Introduce event style_insets,changed for tb
This will be triggered in the rare case when a textblock's
insets are changed (ie. the padding due to filters or style).

This fixes invalid sizing in the test case in elm (due to a
lack of event after program_set).

@feature
2017-01-17 14:35:29 +09:00
Jean-Philippe Andre 93965db815 evas: Implement filter sources support for textblock 2017-01-17 14:35:29 +09:00
Jean-Philippe Andre 1512741b48 evas: Implement filter_data_set for textblock
This is a function that allows passing variables from C or EDC
to the filter's Lua code. Useful in particular for color classes
from EDC.

This data would be the global data but we could eventually add
a markup tag to specify a data value per filter instance. For now
a single data value per tb object should be more than enough though.
2017-01-17 14:35:29 +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
Daniel Kolesa 18a0183c37 evas: use new property impl syntax 2016-12-27 16:37:41 +01:00
Stefan Schmidt 16143b62b4 docs: evas_canvas: fill gaps in evas canvas eo file documentation 2016-11-15 17:45:32 +01:00
Daniel Kolesa cbe42ac34d efl_canvas_text: remove pointers 2016-11-03 17:05:00 +01:00
Stefan Schmidt 21f935c39c docs: evas: document missing structs 2016-10-27 18:22:42 +02: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 876b5e5c62 Efl canvas text: fix api doc a bit 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
Carsten Haitzler d7c5c5f91b efl api release - fix @since for textblock added legacy api 2016-08-13 12:14:52 +09:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01: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
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
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