summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-11-28 11:03:55 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-11-28 11:04:09 +0100
commitdfe0c7b110fa038611ae38a8a1fba78e14550d76 (patch)
tree82143bd410e20b71808f32929ab02846cee185f5
parent3ae44245e8d0668b503291da9dce838e662d0a3b (diff)
Efl.Canvas.Text: Update docs
-rw-r--r--src/lib/evas/canvas/efl_canvas_text.eo113
1 files changed, 60 insertions, 53 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo
index 6cdfaff..2367f51 100644
--- a/src/lib/evas/canvas/efl_canvas_text.eo
+++ b/src/lib/evas/canvas/efl_canvas_text.eo
@@ -5,40 +5,42 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
5 Efl.Text_Style, Efl.Text_Format, 5 Efl.Text_Style, Efl.Text_Format,
6 Efl.Text_Markup, Efl.Ui.I18n 6 Efl.Text_Markup, Efl.Ui.I18n
7{ 7{
8 [[Efl canvas text class]] 8 [[This is the Canvas-level text class. This class only takes care of rendering text,
9 if you need user interaction consider the classes in $Efl.Ui.]]
9 methods { 10 methods {
10 @property is_empty { 11 @property is_empty {
11 [[Whether the object is empty (no text) or not 12 [[Whether the object is empty (no text) or not.
12 ]] 13 ]]
13 get { 14 get {
14 } 15 }
15 values { 16 values {
16 is_empty: bool; [[$true if empty, $false otherwise]] 17 is_empty: bool; [[$true if empty.]]
17 } 18 }
18 } 19 }
19 cursor_add { 20 cursor_add {
20 [[Add cursor that will manipulate and iterate content of the text object 21 [[Adds an existing cursor to the text object.
21 It is typically more convenient to obtain a cursor directly from the text object using @.cursor_create.]] 22 It is typically more convenient to obtain a cursor directly from the text object using @.cursor_create.]]
22 params { 23 params {
23 cursor: Efl.Text.Cursor; [[Text cursor.]] 24 cursor: Efl.Text.Cursor; [[The text cursor to use.]]
24 } 25 }
25 } 26 }
26 cursor_create { 27 cursor_create {
27 [[ Create new cursor and add it to text object 28 [[Creates a new cursor and adds it to the text object.
29 This cursor can be used to manipulate and iterate the content of the text object.
28 ]] 30 ]]
29 return: Efl.Text.Cursor @move; [[Text cursor.]] 31 return: Efl.Text.Cursor @move; [[The created text cursor.]]
30 } 32 }
31 visible_range_get { 33 visible_range_get {
32 [[Returns the currently visible range. 34 [[Returns the currently visible range.
33 35
34 The given $start and $end cursor act like out-variables here, 36 The given $start and $end cursors are output variables:
35 as they are set to the positions of the start and the end of the 37 they are set to the positions of the start and the end of the
36 visible range in the text, respectively. 38 visible range in the text, respectively.
37 ]] 39 ]]
38 return: bool; [[$true on success, $false otherwise]] 40 return: bool; [[$true on success.]]
39 params { 41 params {
40 @in start: Efl.Text.Cursor; [[Range start position]] 42 @in start: Efl.Text.Cursor; [[Range start position.]]
41 @in end: Efl.Text.Cursor; [[Range end position]] 43 @in end: Efl.Text.Cursor; [[Range end position.]]
42 } 44 }
43 } 45 }
44 @property style_insets { 46 @property style_insets {
@@ -48,92 +50,97 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
48 ]] 50 ]]
49 get {} 51 get {}
50 values { 52 values {
51 l: int; [[Left padding]] 53 l: int; [[Left padding.]]
52 r: int; [[Right padding]] 54 r: int; [[Right padding.]]
53 t: int; [[Top padding]] 55 t: int; [[Top padding.]]
54 b: int; [[Bottom padding]] 56 b: int; [[Bottom padding.]]
55 } 57 }
56 } 58 }
57 @property bidi_delimiters { 59 @property bidi_delimiters {
58 [[BiDi delimiters are used for in-paragraph separation of bidi 60 [[BiDi delimiters are used for in-paragraph separation of bidirectional
59 segments. This is useful, for example, in the recipient fields of 61 segments. This is useful, for example, in the recipient fields of
60 e-mail clients where bidi oddities can occur when mixing RTL 62 e-mail clients where bidi oddities can occur when mixing RTL (right-to-left)
61 and LTR. 63 and LTR (left-to-right) text.
62 ]] 64 ]]
63 set {} 65 set {}
64 get {} 66 get {}
65 values { 67 values {
66 delim: string; [[A null terminated string of delimiters, e.g ",|" or $null if empty]] 68 delim: string; [[A null terminated string of delimiters, e.g ",|" or $null if empty.]]
67 } 69 }
68 } 70 }
69 @property newline_as_paragraph_separator { 71 @property newline_as_paragraph_separator {
70 [[When $true, newline character will behave as a paragraph separator. 72 [[When $true, the newline character will behave as a paragraph separator.
71 ]] 73 ]]
72 set {} 74 set {}
73 get {} 75 get {}
74 values { 76 values {
75 mode: bool; [[$true for legacy mode, $false otherwise]] 77 mode: bool; [[$true for legacy mode, $false otherwise.]]
76 } 78 }
77 } 79 }
78 style_apply { 80 style_apply {
79 [[apply the style for this object, sent style member will override old ones, other styles will not be affected. 81 [[Applies a style to the text object. Applied style attributes override old ones, leaving other attributes
80 similar to setting style using functions (for example font_slant_set, wrap_set).]] 82 unaffected.
83 This is similar to setting individual style attributes using properties like @Efl.Text_Font.font_slant or
84 @Efl.Text_Format.wrap.]]
81 params { 85 params {
82 @in style: string; [[A whitespace-separated list of $[property=value] pairs, for example, $[font=sans size=30].]] 86 @in style: string; [[A whitespace-separated list of $[property=value] pairs, for example,
87 $[font=sans size=30].]]
83 } 88 }
84 } 89 }
85 @property all_styles { 90 @property all_styles {
86 [[Get all styles belong to this object as string (default styles plus styles 91 [[A string representing the complete set of styles applied to this text object.
87 from style_apply or style functions (for example font_slant_set, wrap_set).]] 92 This includes the default attributes plus any additional style applied with @.style_apply
93 or individual style properties like @Efl.Text_Font.font_slant or @Efl.Text_Format.wrap.]]
88 get {} 94 get {}
89 values { 95 values {
90 style: string; [[All styles, should not be freed.]] 96 style: string; [[A whitespace-separated list of $[property=value] pairs, for example,
97 $[font=sans size=30]. Do not free.]]
91 } 98 }
92 } 99 }
93 @property size_formatted { 100 @property size_formatted {
94 [[The formatted width and height. 101 [[The formatted width and height of this text block.
95 102
96 This calculates the actual size after restricting the 103 This calculates the actual size after restricting the
97 textblock to the current size of the object. 104 text block to the current size of the object.
98 105
99 The main difference between this and @.size_native.get 106 The main difference between this and @.size_native
100 is that the "native" function does not wrapping into account 107 is that the "native" function does not take wrapping into account:
101 it just calculates the real width of the object if it was 108 it just calculates the real width of the object as if it was
102 placed on an infinite canvas, while this function gives the 109 placed on an infinite canvas, while @.size_formatted gives the
103 size after wrapping according to the size restrictions of the 110 size after wrapping text according to the size restrictions of the
104 object. 111 object.
105 112
106 For example for a textblock containing the text: 113 For example a text block containing the text:
107 "You shall not pass!" with no margins or padding and assuming 114 "You shall not pass!" with no margins or padding and assuming
108 a monospace font and a size of 7x10 char widths (for simplicity) 115 a monospace font and a size of 7x10 char widths (for simplicity)
109 has a native size of 19x1 and a formatted size of 5x4. 116 has a native size of 19x1 and a formatted size of 5x4.
110 ]] 117 ]]
111 get {} 118 get {}
112 values { 119 values {
113 size: Eina.Size2D; [[The size of the object]] 120 size: Eina.Size2D; [[The formatted size of the object (after wrapping).]]
114 } 121 }
115 } 122 }
116 @property size_native { 123 @property size_native {
117 [[The native width and height. 124 [[The native width and height of this text block.
118 125
119 This calculates the actual size without taking account the 126 This calculates the actual size without taking account the
120 current size of the object. 127 current size of the object.
121 128
122 The main difference between this and @.size_formatted.get 129 The main difference between this and @.size_formatted
123 is that the "native" function does not take wrapping into 130 is that the "native" function does not take wrapping into account:
124 account it just calculates the real width of the object if 131 it just calculates the real width of the object as if it was
125 it was placed on an infinite canvas, while the "formatted" 132 placed on an infinite canvas, while @.size_formatted gives the
126 function gives the size after wrapping text according to 133 size after wrapping text according to the size restrictions of the
127 the size restrictions of the object. 134 object.
128 135
129 For example for a textblock containing the text: 136 For example a text block containing the text:
130 "You shall not pass!" with no margins or padding and assuming 137 "You shall not pass!" with no margins or padding and assuming
131 a monospace font and a size of 7x10 char widths (for simplicity) 138 a monospace font and a size of 7x10 char widths (for simplicity)
132 has a native size of 19x1 and a formatted size of 5x4. 139 has a native size of 19x1 and a formatted size of 5x4.
133 ]] 140 ]]
134 get {} 141 get {}
135 values { 142 values {
136 size: Eina.Size2D; [[The size of the object]] 143 size: Eina.Size2D; [[The native size of the object (without wrapping).]]
137 } 144 }
138 } 145 }
139 // Obstacles 146 // Obstacles
@@ -145,17 +152,17 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
145 position of the obstacle. 152 position of the obstacle.
146 ]] 153 ]]
147 params { 154 params {
148 @in eo_obs: Efl.Canvas.Object; [[Obstacle object]] 155 @in eo_obs: Efl.Canvas.Object; [[Obstacle object.]]
149 } 156 }
150 return: bool; [[$true on success, $false otherwise.]] 157 return: bool; [[$true on success.]]
151 } 158 }
152 obstacle_del { 159 obstacle_del {
153 [[Removes $eo_obs from observation during text layout. 160 [[Removes $eo_obs from observation during text layout.
154 ]] 161 ]]
155 params { 162 params {
156 @in eo_obs: Efl.Canvas.Object; [[Obstacle object]] 163 @in eo_obs: Efl.Canvas.Object; [[Obstacle object.]]
157 } 164 }
158 return: bool; [[$true on success, $false otherwise.]] 165 return: bool; [[$true on success.]]
159 } 166 }
160 obstacles_update { 167 obstacles_update {
161 [[Triggers for relayout due to obstacles' state change. 168 [[Triggers for relayout due to obstacles' state change.
@@ -166,7 +173,7 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
166 layout. 173 layout.
167 174
168 For example: if you have just repositioned the obstacles to 175 For example: if you have just repositioned the obstacles to
169 differrent coordinates relative to the textblock, you need to 176 different coordinates relative to the text block, you need to
170 call this so it will consider this new state and will relayout 177 call this so it will consider this new state and will relayout
171 the text. 178 the text.
172 ]] 179 ]]
@@ -175,9 +182,9 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
175 [[Requests to layout the text off the mainloop. 182 [[Requests to layout the text off the mainloop.
176 183
177 Once layout is complete, the result is returned as @Eina.Rect, 184 Once layout is complete, the result is returned as @Eina.Rect,
178 with w, h fields set. 185 with the $w and $h fields set.
179 ]] 186 ]]
180 return: future<Eina.Rect>; [[Future for layout result]] 187 return: future<Eina.Rect>; [[Future for layout result.]]
181 } 188 }
182 } 189 }
183 implements { 190 implements {