efl/src/lib/evas/canvas/efl_canvas_text.eo

380 lines
13 KiB
Plaintext
Raw Normal View History

2016-10-27 07:48:36 -07:00
struct Efl.Canvas.Text.Style; [[EFL text style data structure]]
class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Canvas.Filter.Internal)
{
[[Efl canvas text class]]
legacy_prefix: evas_object_textblock;
methods {
@property bidi_delimiters {
[[BiDi delimiters are used for in-paragraph separation of bidi
segments. This is useful for example in recipients fields of
e-mail clients where bidi oddities can occur when mixing RTL
and LTR.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
set {}
get {}
values {
2016-10-05 07:10:06 -07:00
delim: string; [[A null terminated string of delimiters, e.g ",|" or $null if empty]]
}
}
@property legacy_newline {
[[When $true, newline character will behave as a paragraph separator.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
set {}
get {}
values {
2016-10-05 07:10:06 -07:00
mode: bool; [[$true for legacy mode, $false otherwise]]
}
}
@property style {
[[The text style of the object.
$key is how you reference the style (for deletion or fetching). $NULL
as key indicates the style has the highest priority (default style).
The style priority is the order of creation, styles created first
are applied first with the exception of $NULL which is implicitly
first.
Set $style to $NULL to delete it.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
set {
legacy: null;
}
get {
legacy: null;
}
keys {
key: string; [[The name to the style. $NULL is the default style]]
}
values {
2016-10-05 07:10:06 -07:00
style: string; [[The style]]
}
}
@property size_formatted {
[[The formatted width and height.
This calculates the actual size after restricting the
textblock to the current size of the object.
The main difference between this and @.size_native.get
is that the "native" function does not wrapping into account
it just calculates the real width of the object if it was
placed on an infinite canvas, while this function gives the
size after wrapping according to the size restrictions of the
object.
For example for a textblock containing the text:
"You shall not pass!" with no margins or padding and assuming
a monospace font and a size of 7x10 char widths (for simplicity)
has a native size of 19x1 and a formatted size of 5x4.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
get {}
values {
w: Evas.Coord; [[The width of the object.]]
h: Evas.Coord; [[The height of the object.]]
}
}
@property cursor {
2016-10-05 07:10:06 -07:00
[[The object's main cursor.
@since 1.18
]]
get {
return: Efl.Canvas.Text.Cursor; [[Text cursor object]]
}
}
@property size_native {
[[The native width and height.
This calculates the actual size without taking account the
current size of the object.
The main difference between this and @.size_formatted.get
is that the "native" function does not take wrapping into
account it just calculates the real width of the object if
it was placed on an infinite canvas, while the "formatted"
function gives the size after wrapping text according to
the size restrictions of the object.
For example for a textblock containing the text:
"You shall not pass!" with no margins or padding and assuming
a monospace font and a size of 7x10 char widths (for simplicity)
has a native size of 19x1 and a formatted size of 5x4.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
get {}
values {
w: Evas.Coord; [[The width returned.]]
h: Evas.Coord; [[The height returned.]]
}
}
@property style_insets {
2016-10-05 07:10:06 -07:00
[[Gets the left, right, top and bottom insets of the text.
The inset is any applied padding on the text.
@since 1.18
]]
get {}
values {
2016-10-05 07:10:06 -07:00
l: Evas.Coord; [[Left padding]]
r: Evas.Coord; [[Right padding]]
t: Evas.Coord; [[Top padding]]
b: Evas.Coord; [[Bottom padding]]
}
}
@property is_empty {
2016-10-05 07:10:06 -07:00
[[Whether the object is empty (no text) or not
@since 1.18
]]
get {
legacy: null;
}
values {
is_empty: bool; [[$true if empty, $false otherwise]]
}
}
obstacle_add {
[[Add obstacle evas object $eo_obs to be observed during layout
of text.
The textblock does the layout of the text according to the
position of the obstacle.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
params {
@in eo_obs: Efl.Canvas.Object; [[Obstacle object]]
}
return: bool; [[$true on success, $false otherwise.]]
}
obstacle_del {
[[Removes $eo_obs from observation during text layout.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
params {
@in eo_obs: Efl.Canvas.Object; [[Obstacle object]]
}
return: bool; [[$true on success, $false otherwise.]]
}
obstacles_update {
[[Triggers for relayout due to obstacles' state change.
The obstacles alone don't affect the layout, until this is
called. Use this after doing changes (moving, positioning etc.)
in the obstacles that you would like to be considered in the
layout.
For example: if you have just repositioned the obstacles to
differrent coordinates relative to the textblock, you need to
call this so it will consider this new state and will relayout
the text.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
}
@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 {
2016-11-03 09:05:00 -07:00
annotation: ptr(Efl.Canvas.Text.Annotation); [[Given annotation]]
}
values {
2016-10-05 07:10:06 -07:00
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 {
2016-10-05 07:10:06 -07:00
@in start: const(Efl.Canvas.Text.Cursor); [[Start of range]]
@in end: const(Efl.Canvas.Text.Cursor); [[End of range]]
}
2016-11-03 09:05:00 -07:00
return: free(own(iterator<ptr(Efl.Canvas.Text.Annotation)>),
eina_iterator_free); [[Handle of the Annotation]]
}
2016-10-05 07:10:06 -07:00
annotation_insert {
[[Inserts an annotation format in a specified range [$start, $end - 1].
2016-10-05 07:10:06 -07:00
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 {
2016-10-05 07:10:06 -07:00
@in start: Efl.Canvas.Text.Cursor; [[Start of range]]
@in end: Efl.Canvas.Text.Cursor; [[End of range]]
@in format: string; [[Annotation format]]
}
2016-11-03 09:05:00 -07:00
return: ptr(Efl.Canvas.Text.Annotation); [[Handle of inserted annotation]]
}
2016-10-05 07:10:06 -07:00
annotation_del {
[[Deletes given annotation.
2016-10-05 07:10:06 -07:00
All formats applied by $annotation will be removed and it will be
deleted.
@since 1.18
]]
legacy: null;
params {
2016-11-03 09:05:00 -07:00
@in annotation: ptr(Efl.Canvas.Text.Annotation); [[Annotation to be
2016-10-05 07:10:06 -07:00
removed]]
}
2016-10-05 07:10:06 -07:00
return: bool; [[$true on success, $false otherwise.]]
}
range_geometry_get {
[[Get the geometry of a range in the text.
The geometry is represented as rectangles for each of the line
segments in the given range [$cur1, $cur2].
@since 1.19
]]
legacy: null;
params {
2016-10-05 07:10:06 -07:00
@in cur1: const(Efl.Canvas.Text.Cursor); [[Start of range]]
@in cur2: const(Efl.Canvas.Text.Cursor); [[End of range]]
}
return: free(own(iterator<Eina.Rectangle>),
2016-10-05 07:10:06 -07:00
eina_iterator_free); [[Iterator on all geoemtries of
the given range]]
}
range_simple_geometry_get {
[[Get the "simple" geometry of a range.
The geometry is the geometry in which rectangles in middle lines of
range are merged into one big rectangle. This is an optimized
version of @.range_geometry_get.
2016-10-05 07:10:06 -07:00
@since 1.19
]]
legacy: null;
params {
2016-10-05 07:10:06 -07:00
@in cur1: const(Efl.Canvas.Text.Cursor); [[Start of range]]
@in cur2: const(Efl.Canvas.Text.Cursor); [[End of range]]
}
return: free(own(iterator<Eina.Rectangle>),
2016-10-05 07:10:06 -07:00
eina_iterator_free); [[Iterator on all simple
geometries of the given range]]
}
range_delete {
2016-10-05 07:10:06 -07:00
[[Deletes the range between given cursors.
This removes all the text in given range [$start,$end].
]]
legacy: null;
params {
2016-10-05 07:10:06 -07:00
@in cur1: Efl.Canvas.Text.Cursor; [[Range start position]]
@in cur2: Efl.Canvas.Text.Cursor; [[Range end position]]
}
}
visible_range_get {
[[Returns the currently visible range.
The given $start and $end cursor act like an out-variables here,
as these are set to the positions of the start and the end of the
visible range in the text, respectively.
@since 1.18
]]
2016-10-05 07:10:06 -07:00
return: bool; [[$true on success, $false otherwise]]
params {
2016-10-05 07:10:06 -07:00
@in start: Efl.Canvas.Text.Cursor; [[Range start position]]
@in end: Efl.Canvas.Text.Cursor; [[Range end position]]
}
}
range_text_get {
2016-10-05 07:10:06 -07:00
[[Returns the text in the range between $cur1 and $cur2.
@since 1.18
]]
legacy: null;
2016-11-03 09:05:00 -07:00
return: own(ptr(char)); [[The text in the given range]]
params {
2016-10-05 07:10:06 -07:00
@in cur1: const(Efl.Canvas.Text.Cursor); [[Start of range]]
@in cur2: const(Efl.Canvas.Text.Cursor); [[End of range]]
}
}
object_item_geometry_get {
2016-10-05 07:10:06 -07:00
[[Queries a given object item for its geometry.
Note that the provided annotation should be an object item type.
2016-10-05 07:10:06 -07:00
@since 1.18
]]
legacy: null;
params {
2016-11-03 09:05:00 -07:00
@in an: ptr(const(Efl.Canvas.Text.Annotation)); [[Given annotation to query]]
@out x: Evas.Coord; [[X coordinate of the annotation]]
@out y: Evas.Coord; [[Y coordinate of the annotation]]
@out w: Evas.Coord; [[Width of the annotation]]
@out h: Evas.Coord; [[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 {
2016-11-03 09:05:00 -07:00
@in annotation: ptr(const(Efl.Canvas.Text.Annotation)); [[Annotation
handle to query]]
@in start: Efl.Canvas.Text.Cursor; [[Cursor to be set to the start
position of the annotation in the text]]
@in end: Efl.Canvas.Text.Cursor; [[Cursor to be set to the end
position of the annotation in the text]]
}
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Object.dbg_info_get;
2016-12-27 07:37:41 -08:00
Efl.Canvas.Object.paragraph_direction { get; set; }
Efl.Text.text { get; set; }
Efl.Gfx.Filter.filter_program { get; set; }
Efl.Gfx.Filter.filter_data { get; set; }
Efl.Canvas.Filter.Internal.filter_dirty;
Efl.Canvas.Filter.Internal.filter_input_render;
Efl.Canvas.Filter.Internal.filter_state_prepare;
}
events {
changed; [[Called when the content (text or annotations) changed.]]
}
}