lib/efl/interfaces/efl_text_style.eo \
lib/efl/interfaces/efl_text_format.eo \
lib/efl/interfaces/efl_text_cursor.eo \
+ lib/efl/interfaces/efl_text_annotate.eo \
lib/efl/interfaces/efl_text_properties.eo \
lib/efl/interfaces/efl_gfx_stack.eo \
lib/efl/interfaces/efl_gfx_view.eo \
efl_text_cursor_position_set(obj, start, start_pos);
efl_text_cursor_position_set(obj, end, end_pos);
- efl_canvas_text_annotation_insert(obj, start, end, style);
+ efl_text_annotation_insert(obj, start, end, style);
efl_text_cursor_free(obj, start);
efl_text_cursor_free(obj, end);
my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *en = data;
- efl_canvas_text_cursor_object_item_insert(en, efl_text_cursor_get(en),
+ efl_text_cursor_object_item_insert(en, efl_text_cursor_get(en),
"size=32x32 href=emoticon");
}
cur = efl_text_cursor_new(en);
efl_text_cursor_position_set(en, cur, 2);
- efl_canvas_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon");
+ efl_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon");
efl_text_cursor_position_set(en, cur, 50);
- efl_canvas_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon");
+ efl_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon");
efl_text_cursor_position_set(en, main_cur, 5);
efl_text_cursor_position_set(en, cur, 20);
- efl_canvas_text_annotation_insert(en, main_cur, cur, "a href=#hello");
+ efl_text_annotation_insert(en, main_cur, cur, "a href=#hello");
efl_ui_text_interactive_editable_set(en, EINA_TRUE);
efl_ui_text_scrollable_set(en, EINA_TRUE);
#include "interfaces/efl_text_style.eo.h"
#include "interfaces/efl_text_format.eo.h"
#include "interfaces/efl_text_cursor.eo.h"
+#include "interfaces/efl_text_annotate.eo.h"
#else
#include "interfaces/efl_text_style.eo.c"
#include "interfaces/efl_text_format.eo.c"
#include "interfaces/efl_text_cursor.eo.c"
+#include "interfaces/efl_text_annotate.eo.c"
#include "interfaces/efl_gfx.eo.c"
#include "interfaces/efl_gfx_buffer.eo.c"
--- /dev/null
+import eina_types;
+import efl_text_types;
+
+interface Efl.Text.Annotate {
+ [[Cursor API
+
+ @since 1.20
+ ]]
+ eo_prefix: efl_text;
+ methods {
+ // Annotation
+ @property annotation {
+ [[A new format for $annotation.
+
+ This will replace the format applied by $annotation with $format.
+ Assumes that $annotation is a handle for an existing annotation,
+ i.e. one that was added using @.annotation_insert to this object.
+ Otherwise, this will fail and return $false.
+
+ @since 1.18
+ ]]
+ set {
+ legacy: null;
+ return: bool; [[$true on success, $false otherwise.]]
+ }
+ get {
+ legacy: null;
+ }
+ keys {
+ annotation: ptr(Efl.Canvas.Text.Annotation); [[Given annotation]]
+ }
+ values {
+ format: string; [[The new format for the given annotation]]
+ }
+ }
+ range_annotations_get {
+ [[Returns an iterator of all the handles in a range.
+
+ @since 1.18
+ ]]
+ legacy: null;
+ params {
+ @in start: ptr(const(Efl.Text.Cursor.Cursor_Data)); [[Start of range]]
+ @in end: ptr(const(Efl.Text.Cursor.Cursor_Data)); [[End of range]]
+ }
+ return: free(own(iterator<ptr(Efl.Canvas.Text.Annotation)>),
+ eina_iterator_free); [[Handle of the Annotation]]
+ }
+ annotation_insert {
+ [[Inserts an annotation format in a specified range [$start, $end - 1].
+
+ The $format will be applied to the given range, and the $annotation
+ handle will be returned for further handling.
+
+ @since 1.18
+ ]]
+ legacy: null;
+ params {
+ @in start: ptr(Efl.Text.Cursor.Cursor_Data); [[Start of range]]
+ @in end: ptr(Efl.Text.Cursor.Cursor_Data); [[End of range]]
+ @in format: string; [[Annotation format]]
+ }
+ return: ptr(Efl.Canvas.Text.Annotation); [[Handle of inserted annotation]]
+ }
+ annotation_del {
+ [[Deletes given annotation.
+
+ All formats applied by $annotation will be removed and it will be
+ deleted.
+
+ @since 1.18
+ ]]
+ legacy: null;
+ params {
+ @in annotation: ptr(Efl.Canvas.Text.Annotation); [[Annotation to be
+ removed]]
+ }
+ 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.Canvas.Text.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.
+
+ The cursors $start and $end will be set to the start and end
+ positions of the given annotation $annotation.
+
+ @since 1.18
+ ]]
+ legacy: null;
+ params {
+ @in annotation: ptr(const(Efl.Canvas.Text.Annotation)); [[Annotation
+ handle to query]]
+ @in start: ptr(Efl.Text.Cursor.Cursor_Data); [[Cursor to be set to the start
+ position of the annotation in the text]]
+ @in end: ptr(Efl.Text.Cursor.Cursor_Data); [[Cursor to be set to the end
+ position of the annotation in the text]]
+ }
+ }
+ // Cursor
+ @property cursor_object_item_annotation {
+ [[The object-item annotation at the cursor's position.]]
+ get {
+ legacy: null;
+ }
+ values {
+ annotation: ptr(Efl.Canvas.Text.Annotation); [[Annotation]]
+ }
+ keys {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_object_item_insert {
+ [[Inserts a object item at specified position.
+
+ This adds a placeholder to be queried by higher-level code,
+ which in turn place graphics on top of it. It essentially places an
+ OBJECT REPLACEMENT CHARACTER and set a special annotation to it.
+ ]]
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ @in format: string; [[Format of the inserted item.
+ See Format styles.]]
+ }
+ return: ptr(Efl.Canvas.Text.Annotation); [[The annotation handle of the
+ inserted item.]]
+ }
+ }
+}
+
Elm_Atspi_Text_Attribute *ret;
const char *txt;
- txt = efl_canvas_text_annotation_get(obj, annotation);
+ txt = efl_text_annotation_get(obj, annotation);
if (!txt) return NULL;
ret = calloc(1, sizeof(Elm_Atspi_Text_Attribute));
evas_textblock_cursor_pos_set(cur1, *start_offset);
evas_textblock_cursor_pos_set(cur2, *end_offset);
- annotations = efl_canvas_text_range_annotations_get(obj, cur1, cur2);
+ annotations = efl_text_range_annotations_get(obj, cur1, cur2);
evas_textblock_cursor_free(cur1);
evas_textblock_cursor_free(cur2);
evas_textblock_cursor_pos_set(cur1, *start_offset);
evas_textblock_cursor_pos_set(cur2, *end_offset);
- annotations = efl_canvas_text_range_annotations_get(obj, cur1, cur2);
+ annotations = efl_text_range_annotations_get(obj, cur1, cur2);
evas_textblock_cursor_free(cur1);
evas_textblock_cursor_free(cur2);
efl_text_cursor_paragraph_first(obj, start);
efl_text_cursor_paragraph_last(obj, end);
- annotations = efl_canvas_text_range_annotations_get(obj, start, end);
+ annotations = efl_text_range_annotations_get(obj, start, end);
EINA_ITERATOR_FOREACH(annotations, an)
{
efl_text_cursor_paragraph_first(obj, start);
efl_text_cursor_paragraph_last(obj, end);
- it = efl_canvas_text_range_annotations_get(obj, start, end);
+ it = efl_text_range_annotations_get(obj, start, end);
efl_text_cursor_free(text_obj, start);
efl_text_cursor_free(text_obj, end);
Eina_Bool is_anchor = EINA_FALSE;
Eina_Bool is_item = EINA_FALSE;
- if (efl_canvas_text_object_item_geometry_get(obj, anchor,
+ if (efl_text_object_item_geometry_get(obj, anchor,
NULL, NULL, NULL, NULL))
{
is_anchor = EINA_TRUE;
is_item = EINA_TRUE;
}
- else if (!strncmp(efl_canvas_text_annotation_get(obj, anchor), "a ", 2))
+ else if (!strncmp(efl_text_annotation_get(obj, anchor), "a ", 2))
{
is_anchor = EINA_TRUE;
}
if (is_anchor)
{
const char *p;
- const char *item_str = efl_canvas_text_annotation_get(obj, anchor);
+ const char *item_str = efl_text_annotation_get(obj, anchor);
an = calloc(1, sizeof(Anchor));
if (!an)
ob = _item_obj_get(an, o, smart, clip);
rect->obj = ob;
- efl_canvas_text_object_item_geometry_get(an->obj,
+ efl_text_object_item_geometry_get(an->obj,
an->annotation, &cx, &cy, &cw, &ch);
evas_object_move(rect->obj, x + cx, y + cy);
evas_object_resize(rect->obj, cw, ch);
start = efl_text_cursor_new(o);
end = efl_text_cursor_new(o);
- efl_canvas_text_annotation_positions_get(o, an->annotation,
+ efl_text_annotation_positions_get(o, an->annotation,
start, end);
range = efl_canvas_text_range_geometry_get(o, start, end);
struct Efl.Canvas.Text.Style; [[EFL text style data structure]]
class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Canvas.Filter.Internal,
-Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor)
+Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor, Efl.Text.Annotate)
{
[[Efl canvas text class]]
legacy_prefix: evas_object_textblock;
@since 1.18
]]
}
- // Annotation
- @property annotation {
- [[A new format for $annotation.
-
- This will replace the format applied by $annotation with $format.
- Assumes that $annotation is a handle for an existing annotation,
- i.e. one that was added using @.annotation_insert to this object.
- Otherwise, this will fail and return $false.
-
- @since 1.18
- ]]
- set {
- legacy: null;
- return: bool; [[$true on success, $false otherwise.]]
- }
- get {
- legacy: null;
- }
- keys {
- annotation: ptr(Efl.Canvas.Text.Annotation); [[Given annotation]]
- }
- values {
- format: string; [[The new format for the given annotation]]
- }
- }
- range_annotations_get {
- [[Returns an iterator of all the handles in a range.
-
- @since 1.18
- ]]
- legacy: null;
- params {
- @in start: ptr(const(Efl.Text.Cursor.Cursor_Data)); [[Start of range]]
- @in end: ptr(const(Efl.Text.Cursor.Cursor_Data)); [[End of range]]
- }
- return: free(own(iterator<ptr(Efl.Canvas.Text.Annotation)>),
- eina_iterator_free); [[Handle of the Annotation]]
- }
- annotation_insert {
- [[Inserts an annotation format in a specified range [$start, $end - 1].
-
- The $format will be applied to the given range, and the $annotation
- handle will be returned for further handling.
-
- @since 1.18
- ]]
- legacy: null;
- params {
- @in start: ptr(Efl.Text.Cursor.Cursor_Data); [[Start of range]]
- @in end: ptr(Efl.Text.Cursor.Cursor_Data); [[End of range]]
- @in format: string; [[Annotation format]]
- }
- return: ptr(Efl.Canvas.Text.Annotation); [[Handle of inserted annotation]]
- }
- annotation_del {
- [[Deletes given annotation.
-
- All formats applied by $annotation will be removed and it will be
- deleted.
-
- @since 1.18
- ]]
- legacy: null;
- params {
- @in annotation: ptr(Efl.Canvas.Text.Annotation); [[Annotation to be
- removed]]
- }
- 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.Canvas.Text.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.
-
- The cursors $start and $end will be set to the start and end
- positions of the given annotation $annotation.
-
- @since 1.18
- ]]
- legacy: null;
- params {
- @in annotation: ptr(const(Efl.Canvas.Text.Annotation)); [[Annotation
- handle to query]]
- @in start: ptr(Efl.Text.Cursor.Cursor_Data); [[Cursor to be set to the start
- position of the annotation in the text]]
- @in end: ptr(Efl.Text.Cursor.Cursor_Data); [[Cursor to be set to the end
- position of the annotation in the text]]
- }
- }
- // Cursor
- @property cursor_object_item_annotation {
- [[The object-item annotation at the cursor's position.]]
- get {
- legacy: null;
- }
- values {
- annotation: ptr(Efl.Canvas.Text.Annotation); [[Annotation]]
- }
- keys {
- cur: ptr(Efl.Text.Cursor.Cursor_Data);
- }
- }
- cursor_object_item_insert {
- [[Inserts a object item at specified position.
-
- This adds a placeholder to be queried by higher-level code,
- which in turn place graphics on top of it. It essentially places an
- OBJECT REPLACEMENT CHARACTER and set a special annotation to it.
- ]]
- legacy: null;
- params {
- cur: ptr(Efl.Text.Cursor.Cursor_Data);
- @in format: string; [[Format of the inserted item.
- See Format styles.]]
- }
- return: ptr(Efl.Canvas.Text.Annotation); [[The annotation handle of the
- inserted item.]]
- }
}
implements {
Efl.Object.constructor;
Efl.Text.Cursor.cursor_coord_set;
Efl.Text.Cursor.cursor_text_insert;
Efl.Text.Cursor.cursor_char_delete;
+ Efl.Text.Annotate.annotation { set; get; }
+ Efl.Text.Annotate.range_annotations_get;
+ Efl.Text.Annotate.annotation_insert;
+ Efl.Text.Annotate.annotation_del;
+ Efl.Text.Annotate.object_item_geometry_get;
+ Efl.Text.Annotate.annotation_positions_get;
+ Efl.Text.Annotate.cursor_object_item_annotation { get; }
+ Efl.Text.Annotate.cursor_object_item_insert;
}
events {
cursor,changed;
}
EOLIAN static const char *
-_efl_canvas_text_annotation_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_annotation_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
Efl_Canvas_Text_Annotation *annotation)
{
if (!annotation || (annotation->obj != eo_obj))
}
EOLIAN static Eina_Bool
-_efl_canvas_text_annotation_set(Eo *eo_obj,
+_efl_canvas_text_efl_text_annotate_annotation_set(Eo *eo_obj,
Efl_Canvas_Text_Data *o, Efl_Canvas_Text_Annotation *annotation,
const char *format)
{
}
EOLIAN static Eina_Bool
-_efl_canvas_text_annotation_del(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_annotation_del(Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Text_Data *o, Efl_Canvas_Text_Annotation *annotation)
{
if (!annotation || (annotation->obj != eo_obj))
}
EOLIAN static Efl_Canvas_Text_Annotation *
-_efl_canvas_text_annotation_insert(Eo *eo_obj, Efl_Canvas_Text_Data *o,
+_efl_canvas_text_efl_text_annotate_annotation_insert(Eo *eo_obj, Efl_Canvas_Text_Data *o,
Efl_Canvas_Text_Cursor *start, Efl_Canvas_Text_Cursor *end,
const char *format)
{
}
EOLIAN static Eina_Iterator *
-_efl_canvas_text_range_annotations_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_range_annotations_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
const Evas_Textblock_Cursor *start, const Evas_Textblock_Cursor *end)
{
Eina_List *lst = NULL;
}
EOLIAN static Efl_Canvas_Text_Annotation *
-_efl_canvas_text_cursor_object_item_insert(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur, const char *format)
+_efl_canvas_text_efl_text_annotate_cursor_object_item_insert(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur, const char *format)
{
Efl_Canvas_Text_Annotation *ret =
_textblock_annotation_insert(cur->obj, o, cur, cur, format, EINA_TRUE);
}
EOLIAN static Efl_Canvas_Text_Annotation *
-_efl_canvas_text_cursor_object_item_annotation_get(Eo *eo_obj EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_cursor_object_item_annotation_get(Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
Eina_Iterator *it;
Efl_Canvas_Text_Annotation *data, *ret = NULL;
- it = efl_canvas_text_range_annotations_get(cur->obj,
+ it = efl_text_range_annotations_get(cur->obj,
cur, cur);
EINA_ITERATOR_FOREACH(it, data)
{
}
EOLIAN static Eina_Bool
-_efl_canvas_text_object_item_geometry_get(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_annotate_object_item_geometry_get(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED,
const Efl_Canvas_Text_Annotation *an, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
{
Efl_Canvas_Text_Cursor_Data cur;
}
EOLIAN static void
-_efl_canvas_text_annotation_positions_get(Eo *eo_obj,
+_efl_canvas_text_efl_text_annotate_annotation_positions_get(Eo *eo_obj,
Efl_Canvas_Text_Data *o EINA_UNUSED,
const Efl_Canvas_Text_Annotation *annotation,
Efl_Canvas_Text_Cursor *start, Efl_Canvas_Text_Cursor *end)