diff options
author | Daniel Hirt <hirt.danny@gmail.com> | 2017-11-09 17:53:20 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2018-01-18 10:20:28 -0800 |
commit | 4a905a22a485388a5e4ba9fb25ff5ca381420ba7 (patch) | |
tree | 213dc03c164320ebd8edd7e5959fc31a9706c629 /src/lib/efl | |
parent | 2eac0dd89d01544902d029604fe7328aca765c25 (diff) | |
download | efl-4a905a22a485388a5e4ba9fb25ff5ca381420ba7.tar.gz |
Canvas image: add Efl.Canvas.Text.Factory + use in Ui.Text
This interface has a simple 'create' method to create Efl.Canvas.Object
given a key.
This is used higher-up in Ui.Text in the next commit.
Ui text: add ability to set item factories
Added API to set an item factory object.
This is similar to the previous item providers (that worked with
callbacks).
You instantiate a factory object and set it on the Ui.Text object.
Each factory implements the "create" method from
Efl.Canvas.Text.Item_Factory.
This also includes 3 public factories (Image, Emoticon and Fallback):
- Image factory: creates images from added entries (key strings)
- Emoticon factory: creates emoticons by querying the theme
- Fallback: creates image, then falls back to emoticon
If no factory is set, then the fallback (internal) factory is used.
See the added "Ui.text Item Factory" test in elementary_test for an
example of usage.
@feature
Diffstat (limited to 'src/lib/efl')
-rw-r--r-- | src/lib/efl/interfaces/efl_text_annotate.eo | 61 |
1 files changed, 40 insertions, 21 deletions
diff --git a/src/lib/efl/interfaces/efl_text_annotate.eo b/src/lib/efl/interfaces/efl_text_annotate.eo index 002505356c..7826d07991 100644 --- a/src/lib/efl/interfaces/efl_text_annotate.eo +++ b/src/lib/efl/interfaces/efl_text_annotate.eo @@ -76,23 +76,6 @@ interface Efl.Text.Annotate { } return: bool; [[$true on success, $false otherwise.]] } - object_item_geometry_get { - [[Queries a given object item for its geometry. - - Note that the provided annotation should be an object item type. - - @since 1.18 - ]] - legacy: null; - params { - @in an: ptr(const(Efl.Text.Annotate.Annotation)); [[Given annotation to query]] - @out x: int; [[X coordinate of the annotation]] - @out y: int; [[Y coordinate of the annotation]] - @out w: int; [[Width of the annotation]] - @out h: int; [[Height of the annotation]] - } - return: bool; [[$true if given annotation is an object item, $false otherwise]] - } annotation_positions_get { [[Sets given cursors to the start and end positions of the annotation. @@ -111,8 +94,41 @@ interface Efl.Text.Annotate { position of the annotation in the text]] } } + annotation_is_item { + [[Whether this is an "item" type of annotation. Should be used before + querying the annotation's geometry, as only "item" annotations have + a geometry. + + see @.cursor_item_insert + see @.item_geometry_get + + @since 1.21 + ]] + legacy: null; + params { + annotation: ptr(Efl.Text.Annotate.Annotation); [[Given annotation]] + } + return: bool; [[$true if given annotation is an object item, $false otherwise]] + } + item_geometry_get { + [[Queries a given object item for its geometry. + + Note that the provided annotation should be an object item type. + + @since 1.18 + ]] + legacy: null; + params { + @in an: ptr(const(Efl.Text.Annotate.Annotation)); [[Given annotation to query]] + @out x: int; [[X coordinate of the annotation]] + @out y: int; [[Y coordinate of the annotation]] + @out w: int; [[Width of the annotation]] + @out h: int; [[Height of the annotation]] + } + return: bool; [[$true if given annotation is an object item, $false otherwise]] + } // Cursor - @property cursor_object_item_annotation { + @property cursor_item_annotation { [[The object-item annotation at the cursor's position.]] get { legacy: null; @@ -124,7 +140,7 @@ interface Efl.Text.Annotate { cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] } } - cursor_object_item_insert { + cursor_item_insert { [[Inserts a object item at specified position. This adds a placeholder to be queried by higher-level code, @@ -134,8 +150,11 @@ interface Efl.Text.Annotate { legacy: null; params { cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]] - @in format: string; [[Format of the inserted item. - See Format styles.]] + @in item: string; [[Item key to be used in higher-up + code to query and decided what image, emoticon + etc. to embed.]] + @in format: string; [[Size format of the inserted item. + This hints how to size the item in the text.]] } return: ptr(Efl.Text.Annotate.Annotation); [[The annotation handle of the inserted item.]] |