General description
This is the first part of the proposal. It currently doesn't address anything about Evas (so no entry or elementary stuff), those will follow shortly and this task description will be live-updated as I go.
Efl.Canvas.Text
Efl.Canvas.Text is the main "textblock" object. Its role is just drawing text, formatting it, and manipulating it (only from code, no user input).
It's essentially what textblock is at the moment, but with a few important changes:
- The concept of formatting has changed. You no longer have standalone format items, but rather annotate a text range (Efl.Text.Annotation.Factory). This is much faster and more robust.
- You manipulate this object using functions rather than free text.
- Markup is no longer a core part of the textblock object, but is rather implemented by external "utilitiy" functions that translate markup to annotations and vice versa.
Efl.Text.Cursor
This is the main object you use to manipulate textblock text. They are properly Eo objects when exposed, but just lightweight structures internally.
Having them as objects means can also emit events when they e.g. change - This feels like a good idea but could also keep the lightweight implementation that's currently there and just implement utility functions.
You just use it like we currently use cursors.
Efl.Text.Annotation.Factory
This is the main object used to manipulate the annotations. The way it works is a similar concept to a transaction.
You create an object of this type when you want to annotate a textblock and you can keep it alive until the textblock is deleted.
You then set all the wanted formats on the object (with potentially clearing it first) and then insert it to the textblock once ready.
For example (in psuedo code):
an_factory = Efl.Text.Annotation.Factory() an_factory.clear() // Only needed if the object is already dirty an_factory.color_set("red") an_factory.insert(red_cursor_start, red_cursor_end) // makes the text in range red an_factory.weight_set(BOLD) an_factory.insert(cursor_start, cursor_end) // makes the text in range red + bold because we haven't cleared the object.
Efl.Text.Item.Factory
Almost identical to Annotation but used to insert items rather than annotations.
Efl.Text.Raw_Editable
Needs a better name, but is essentially what edje_entry was, but not tied to an edje object
It accepts user input, handles selection, IMF, and what not.
Need to decide, but it's probably NOT theme aware. So has no theme. Need to figure out how this comes to play with selection, cursor and etc, though I think it can work. At worst it can have hooks for objects for that.
XXX: Instead of an object it could probably be *internal* utility functions that just set the correct callbacks and handling.
Efl.Ui.Text
Previous elm_entry. Will have a theme with a place to swallow the raw_edit object it's composited of. Can also be made scrollable.
Theme will have all of the components that are currently there (cursor, selection, scroller, label, non scroller) but instead of a textblock part you'd have a textblock swallow object. The style for the textblock would have to be in variables and parsed the same way markup is parsed.
Open questions (I'm not sure what to do)
- ATSPI stuff - what should be done with them
Implementation
The implementation has now moved to the actual .eo files in my devs/tasn/ifaces. All the eo files which name starts with efl2_ are the new one I created so please review them. They are constantly being updated and my notes are marked with FIXME.
You can also now comment about naming, but please don't comment about missing docs or stuff that are obviously in progress. Thanks!