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-05 04:52:10 -07:00
|
|
|
import efl_text_types;
|
|
|
|
|
2017-05-23 06:04:04 -07:00
|
|
|
interface Efl.Ui.Text.Interactive (Efl.Text, Efl.Text.Font,
|
|
|
|
Efl.Text.Format, Efl.Text.Style)
|
2016-06-08 03:45:40 -07:00
|
|
|
{
|
|
|
|
[[This is an interface interactive text inputs should implement]]
|
|
|
|
methods {
|
|
|
|
@property selection_allowed {
|
|
|
|
[[Whether or not selection is allowed on this object]]
|
|
|
|
set {}
|
|
|
|
get {}
|
|
|
|
values {
|
2016-11-17 03:52:44 -08:00
|
|
|
allowed: bool; [[$true if enabled, $false otherwise]]
|
2016-06-08 03:45:40 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property selection_cursors {
|
|
|
|
[[The cursors used for selection handling.
|
|
|
|
|
2018-01-04 04:16:23 -08:00
|
|
|
If the cursors are equal there's
|
2016-06-08 03:45:40 -07:00
|
|
|
no selection.
|
|
|
|
|
|
|
|
You are allowed to retain and modify them. Modifying them modifies
|
|
|
|
the selection of the object.
|
|
|
|
]]
|
|
|
|
get {}
|
|
|
|
values {
|
2017-07-17 02:45:36 -07:00
|
|
|
start: ptr(Efl.Text.Cursor.Cursor); [[The start of the selection]]
|
|
|
|
end: ptr(Efl.Text.Cursor.Cursor); [[The end of the selection]]
|
2016-06-08 03:45:40 -07:00
|
|
|
}
|
|
|
|
}
|
2016-06-22 06:22:27 -07:00
|
|
|
@property editable {
|
|
|
|
[[Whether the entry is editable.
|
|
|
|
|
2018-01-04 04:16:23 -08:00
|
|
|
By default text interactives are editable. However setting this
|
|
|
|
property to $false will make it so that key input will be disregarded.
|
2016-06-22 06:22:27 -07:00
|
|
|
]]
|
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
|
|
|
editable: bool; [[If $true, user input will be inserted in the entry,
|
|
|
|
if not, the entry is read-only and no user input is allowed.]]
|
|
|
|
}
|
|
|
|
}
|
2016-06-08 03:45:40 -07:00
|
|
|
}
|
|
|
|
events {
|
|
|
|
selection,changed; [[The selection on the object has changed. Query using @.selection_cursors]]
|
|
|
|
}
|
|
|
|
}
|