summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_text.eo
blob: 520db772860306f3861883af9fb214c36f8eb34e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
class Evas.Text (Evas.Object, Efl.Text, Efl.Text_Properties)
{
   legacy_prefix: evas_object_text;
   eo_prefix: evas_obj_text;
   properties {
      shadow_color {
         set {
            /*@
            Sets the shadow color for the given text object.

            Shadow effects, which are fading colors decorating the text
            underneath it, will just be shown if the object is set to one of
            the following styles:

            - #EVAS_TEXT_STYLE_SHADOW
            - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
            - #EVAS_TEXT_STYLE_FAR_SHADOW
            - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
            - #EVAS_TEXT_STYLE_SOFT_SHADOW
            - #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW

            One can also change the direction where the shadow grows to, with
            evas_object_text_style_set().

            @see evas_object_text_shadow_color_get() */
         }
         get {
            /*@
            Retrieves the shadow color for the given text object.

            @note Use @c NULL pointers on the color components you're not
            interested in: they'll be ignored by the function.

            @see evas_object_text_shadow_color_set() for more details. */
         }
         values {
            int r; /*@ The red component of the given color. */
            int g; /*@ The green component of the given color. */
            int b; /*@ The blue component of the given color. */
            int a; /*@ The alpha component of the given color. */
         }
      }
      ellipsis {
         set {
            /*@
            @brief Sets the ellipsis that should be used for the text object.

            This is a value between 0.0 and 1.0 indicating the position of the text
            to be shown. 0.0 means the start will be shown and the end trimmed, 1.0
            means the beginning will be trimmed and the end will be shown, and any value
            in between will cause ellipsis to be added in both end of the text and the
            requested part to be shown.
            -1.0 means ellipsis is turned off.

            @since 1.8 */
         }
         get {
            /*@
            @brief Gets the ellipsis currently set on the text object.

            @return The ellipsis set on the text object. The ellipsis is -1.0.
            @see evas_object_text_ellipsis_set.
            @since 1.8 */
         }
         values {
            double ellipsis(-1); /*@ the ellipsis. */
         }
      }
      bidi_delimiters {
         set {
            /*@
            @brief Sets the BiDi delimiters used in the textblock.

            BiDi delimiters are use 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.

            @since 1.1 */
         }
         get {
            /*@
            @brief Gets the BiDi delimiters used in the textblock.

            BiDi delimiters are use 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.

            @return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
            @since 1.1 */
         }
         values {
            const(char)* delim; /*@ A null terminated string of delimiters, e.g ",|". */
         }
      }
      outline_color {
         set {
            /*@
            Sets the outline color for the given text object.

            Outline effects (colored lines around text glyphs) will just be
            shown if the object is set to one of the following styles:
            - #EVAS_TEXT_STYLE_OUTLINE
            - #EVAS_TEXT_STYLE_SOFT_OUTLINE
            - #EVAS_TEXT_STYLE_OUTLINE_SHADOW
            - #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW

            @see evas_object_text_outline_color_get() */
         }
         get {
            /*@
            Retrieves the outline color for the given text object.

            @note Use @c NULL pointers on the color components you're not
            interested in: they'll be ignored by the function.

            @see evas_object_text_outline_color_set() for more details. */
         }
         values {
            int r; /*@ The red component of the given color. */
            int g; /*@ The green component of the given color. */
            int b; /*@ The blue component of the given color. */
            int a; /*@ The alpha component of the given color. */
         }
      }
      glow2_color {
         set {
            /*@
            Sets the 'glow 2' color for the given text object.

            'Glow 2' effects, which are glowing colors decorating the text's
            (immediate) surroundings, will just be shown if the object is set
            to the #EVAS_TEXT_STYLE_GLOW style. See also
            evas_object_text_glow_color_set().

            @see evas_object_text_glow2_color_get() */
         }
         get {
            /*@
            Retrieves the 'glow 2' color for the given text object.

            @note Use @c NULL pointers on the color components you're not
            interested in: they'll be ignored by the function.

            @see evas_object_text_glow2_color_set() for more details. */
         }
         values {
            int r; /*@ The red component of the given color. */
            int g; /*@ The green component of the given color. */
            int b; /*@ The blue component of the given color. */
            int a; /*@ The alpha component of the given color. */
         }
      }
      style {
         set {
            /*@
            Sets the style to apply on the given text object.

            Text object styles are one of the values in
            #Evas_Text_Style_Type. Some of those values are combinations of
            more than one style, and some account for the direction of the
            rendering of shadow effects.

            @note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
            #EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.

            The following figure illustrates the text styles:

            @image html text-styles.png
            @image rtf text-styles.png
            @image latex text-styles.eps

            @see evas_object_text_style_get()
            @see evas_object_text_shadow_color_set()
            @see evas_object_text_outline_color_set()
            @see evas_object_text_glow_color_set()
            @see evas_object_text_glow2_color_set() */
         }
         get {
            /*@
            Retrieves the style on use on the given text object.

            @return the style type in use.

            @see evas_object_text_style_set() for more details. */
         }
         values {
            Evas_Text_Style_Type style; /*@ a style type. */
         }
      }
      glow_color {
         set {
            /*@
            Sets the glow color for the given text object.

            Glow effects, which are glowing colors decorating the text's
            surroundings, will just be shown if the object is set to the
            #EVAS_TEXT_STYLE_GLOW style.

            @note Glow effects are placed from a short distance of the text
            itself, but no touching it. For glowing effects right on the
            borders of the glyphs, see 'glow 2' effects
            (evas_object_text_glow2_color_set()).

            @see evas_object_text_glow_color_get() */
         }
         get {
            /*@
            Retrieves the glow color for the given text object.

            @note Use @c NULL pointers on the color components you're not
            interested in: they'll be ignored by the function.

            @see evas_object_text_glow_color_set() for more details. */
         }
         values {
            int r; /*@ The red component of the given color. */
            int g; /*@ The green component of the given color. */
            int b; /*@ The blue component of the given color. */
            int a; /*@ The alpha component of the given color. */
         }
      }
      filter_program {
         set {
            /*@ Set an Evas filter program on this Text Object.

            If the program fails to compile (syntax error, invalid
            buffer name, etc...), the standard text effects will be
            applied instead (SHADOW, etc...). switch back to the
            standard text effects.

            @since 1.9
            @note EXPERIMENTAL FEATURE. This is an unstable API,
            please use only for testing purposes.
            @see @ref evasfiltersref "Evas filters reference"
            */
            legacy: null;
         }
         values {
            const(char)* program; /*@ The program code, as defined
              by the @ref evasfiltersref "Evas filters script language".
              Pass NULL to remove the former program and switch back
              to the standard text effect */
         }
      }
      filter_source {
         set {
            /*@ Bind an object to use as a mask or texture with Evas Filters.

            This will create automatically a new RGBA buffer containing
            the source object's pixels (as it is rendered).

            @since 1.9
            @note EXPERIMENTAL FEATURE. This is an unstable API,
            please use only for testing purposes.
            @see @ref evasfiltersref "Evas filters reference" */
            legacy: null;
         }
         values {
            const(char)* name; /*@ Object name as used in the program code */
            Eo* eobj; /*@ Eo object to use through proxy rendering */
         }
      }
      max_descent {
         get {
            return: Evas_Coord;
         }
      }
      style_pad {
         get {
            /*@
            Gets the text style pad of a text object. */
         }
         values {
            int l; /*@ The left pad (or @c NULL). */
            int r; /*@ The right pad (or @c NULL). */
            int t; /*@ The top pad (or @c NULL). */
            int b; /*@ The bottom pad (or @c NULL). */
         }
      }
      direction {
         get {
            /*@
            Retrieves the direction of the text currently being displayed in the
            text object.
            @return the direction of the text */
            return: Evas_BiDi_Direction;
         }
      }
      ascent {
         get {
            return: Evas_Coord;
         }
      }
      horiz_advance {
         get {
            return: Evas_Coord;
         }
      }
      inset {
         get {
            return: Evas_Coord;
         }
      }
      max_ascent {
         get {
            return: Evas_Coord;
         }
      }
      vert_advance {
         get {
            return: Evas_Coord;
         }
      }
      descent {
         get {
            return: Evas_Coord;
         }
      }
   }
   methods {
      last_up_to_pos @const {
         /*@ Returns the logical position of the last char in the text up to the pos given. this is NOT the position of the last char because of the possibility of RTL in the text. */
         return: int(-1);
         params {
            @in Evas_Coord x; /*@ in */
            @in Evas_Coord y; /*@ in */
         }
      }
      char_coords_get @const {
         return: int;
         params {
            @in Evas_Coord x; /*@ in */
            @in Evas_Coord y; /*@ in */
            @out Evas_Coord cx; /*@ out */
            @out Evas_Coord cy; /*@ out */
            @out Evas_Coord cw; /*@ out */
            @out Evas_Coord ch; /*@ out */
         }
      }
      char_pos_get @const {
         /*@
         Retrieve position and dimension information of a character within a text @c Evas_Object.

         This function is used to obtain the X, Y, width and height of the character
         located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
         as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
         @p cy, @p cw, @p ch) may be @c NULL in which case no value will be assigned to that
         parameter.

         @return @c EINA_FALSE on success, @c EINA_TRUE on error. */
         return: bool;
         params {
            @in int pos; /*@ The character position to request co-ordinates for. */
            @out Evas_Coord cx; /*@ A pointer to an @c Evas_Coord to store the X value in (can be NULL). */
            @out Evas_Coord cy; /*@ A pointer to an @c Evas_Coord to store the Y value in (can be NULL). */
            @out Evas_Coord cw; /*@ A pointer to an @c Evas_Coord to store the Width value in (can be NULL). */
            @out Evas_Coord ch; /*@ A pointer to an @c Evas_Coord to store the Height value in (can be NULL). */
         }
      }
   }
   implements {
      Eo.Base.constructor;
      Eo.Base.destructor;
      Eo.Base.dbg_info_get;
      Efl.Gfx.Base.size.set;
      Efl.Text.text.set;
      Efl.Text.text.get;
      Efl.Text_Properties.font.get;
      Efl.Text_Properties.font.set;
      Efl.Text_Properties.font_source.get;
      Efl.Text_Properties.font_source.set;
   }
}