Tizen Native API
|
This group provides functions that operate on single line, single style text objects.
For multiline and multiple style text, see Textblock Object Functions.
- Remarks:
- We do not guarantee any proper results if you create a Text object without setting the evas engine.
Functions | |
Evas_Object * | evas_object_text_add (Evas *e) |
Creates a new text object on the provided canvas. | |
void | evas_object_text_font_source_set (Evas_Object *obj, const char *font) |
Sets the font (source) file to be used on a given text object. | |
const char * | evas_object_text_font_source_get (const Evas_Object *obj) |
Gets the font file's path which is being used on a given text object. | |
void | evas_object_text_font_set (Evas_Object *obj, const char *font, Evas_Font_Size size) |
Sets the font family and size on a given text object. | |
void | evas_object_text_font_get (const Evas_Object *obj, const char **font, Evas_Font_Size *size) |
Gets the font family and size in use on a given text object. | |
void | evas_object_text_text_set (Evas_Object *obj, const char *text) |
Sets the text string to be displayed by the given text object. | |
const char * | evas_object_text_text_get (const Evas_Object *obj) |
Gets the text string currently being displayed by the given text object. | |
void | evas_object_text_bidi_delimiters_set (Evas_Object *obj, const char *delim) |
Sets the BiDi delimiters used in the textblock. | |
const char * | evas_object_text_bidi_delimiters_get (const Evas_Object *obj) |
Gets the BiDi delimiters used in the textblock. | |
void | evas_object_text_ellipsis_set (Evas_Object *obj, double ellipsis) |
Sets the ellipsis that should be used for the text object. | |
double | evas_object_text_ellipsis_get (const Evas_Object *obj) |
Gets the ellipsis currently set on the text object. | |
Eina_Bool | evas_object_text_char_pos_get (const Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) |
Gets the position and dimension information of a character within a text Evas_Object . | |
int | evas_object_text_last_up_to_pos (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) |
Gets the logical position of the last char in the text up to the given position. This is NOT the position of the last char because of the possibility of RTL in the text. | |
Evas_Text_Style_Type | evas_object_text_style_get (const Evas_Object *obj) |
Gets the style on use on the given text object. | |
void | evas_object_text_style_set (Evas_Object *obj, Evas_Text_Style_Type type) |
Sets the style to apply on the given text object. | |
void | evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a) |
Sets the shadow color for the given text object. | |
void | evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Gets the shadow color for the given text object. | |
void | evas_object_text_glow_color_set (Evas_Object *obj, int r, int g, int b, int a) |
Sets the glow color for the given text object. | |
void | evas_object_text_glow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Gets the glow color for the given text object. | |
void | evas_object_text_glow2_color_set (Evas_Object *obj, int r, int g, int b, int a) |
Sets the 'glow 2' color for the given text object. | |
void | evas_object_text_glow2_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Gets the 'glow 2' color for the given text object. | |
void | evas_object_text_outline_color_set (Evas_Object *obj, int r, int g, int b, int a) |
Sets the outline color for the given text object. | |
void | evas_object_text_outline_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Gets the outline color for the given text object. | |
void | evas_object_text_style_pad_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) |
Gets the text style pad of a text object. | |
Evas_BiDi_Direction | evas_object_text_direction_get (const Evas_Object *obj) |
Gets the direction of the text currently being displayed in the text object. | |
void | evas_object_text_filter_program_set (Evas_Object *obj, const char *arg) |
Sets an Evas filter program on this Text Object. | |
void | evas_object_text_filter_source_set (Evas_Object *obj, const char *name, Evas_Object *source) |
Binds an object to use as a mask or texture with Evas Filters. This automatically creates a new RGBA buffer containing the source object's pixels (as it is rendered). | |
Typedefs | |
typedef enum _Evas_Text_Style_Type | Evas_Text_Style_Type |
Defines | |
#define | EVAS_TEXT_STYLE_BASIC_SET(x, s) do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0) |
Definition for text style type creation macro. Use style types on the 's' arguments, being 'x' your style variable. | |
#define | EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0) |
Definition for text style type creation macro. This one imposes shadow directions on the style type variable -- use the EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incrementally. |
Typedef Documentation
typedef enum _Evas_Text_Style_Type Evas_Text_Style_Type |
Types of styles to be applied on text objects. The EVAS_TEXT_STYLE_SHADOW_DIRECTION_*
ones are to be ORed together with others imposing shadow, to change shadow's direction
Enumeration Type Documentation
Types of styles to be applied on text objects. The EVAS_TEXT_STYLE_SHADOW_DIRECTION_*
ones are to be ORed together with others imposing shadow, to change shadow's direction
- Enumerator:
Function Documentation
Evas_Object* evas_object_text_add | ( | Evas * | e | ) |
Creates a new text object on the provided canvas.
- Since :
- 2.3.1
- Remarks:
- Text objects are for simple, single line text elements. If you want more elaborated text blocks, see Textblock Object Functions.
- Parameters:
-
[in] e The canvas to create the text object on
- Returns:
- A pointer to a new text object on success,
otherwiseNULL
on error
const char* evas_object_text_bidi_delimiters_get | ( | const Evas_Object * | obj | ) |
Gets the BiDi delimiters used in the textblock.
- Since (EFL) :
- 1.1
- Since :
- 2.3.1
- Remarks:
- 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.
- Parameters:
-
[in] obj The given text object
- Returns:
- A null terminated string of delimiters, for example, ",|",
otherwiseNULL
if empty
void evas_object_text_bidi_delimiters_set | ( | Evas_Object * | obj, |
const char * | delim | ||
) |
Sets the BiDi delimiters used in the textblock.
- Since (EFL) :
- 1.1
- Since :
- 2.3.1
- Remarks:
- 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.
- Parameters:
-
[in] obj The given text object [in] delim A null terminated string of delimiters, for example ",|"
Eina_Bool evas_object_text_char_pos_get | ( | const Evas_Object * | obj, |
int | pos, | ||
Evas_Coord * | cx, | ||
Evas_Coord * | cy, | ||
Evas_Coord * | cw, | ||
Evas_Coord * | ch | ||
) |
Gets the position and dimension information of a character within a text Evas_Object
.
This function is used to obtain the X, Y, width and height of a the character located at pos within the Evas_Object
obj. obj must be a text object as created with evas_object_text_add(). Any of the Evas_Coord
parameters (cx
, cy, cw, ch) may be NULL
in which case no value is assigned to that parameter.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The text object to retrieve position information for [in] pos The character position to request co-ordinates for [out] cx A pointer to an Evas_Coord
to store the X value in (can beNULL
)[out] cy A pointer to an Evas_Coord
to store the Y value in (can beNULL
)[out] cw A pointer to an Evas_Coord
to store the Width value in (can beNULL
)[out] ch A pointer to an Evas_Coord
to store the Height value in (can beNULL
)
- Returns:
- EINA_FALSE if the information is obtained successfully, otherwise EINA_TRUE on error
Evas_BiDi_Direction evas_object_text_direction_get | ( | const Evas_Object * | obj | ) |
Gets the direction of the text currently being displayed in the text object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The given evas text object
- Returns:
- The direction of the text
double evas_object_text_ellipsis_get | ( | const Evas_Object * | obj | ) |
Gets the ellipsis currently set on the text object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The given text object
- Returns:
- The ellipsis set on the text object
- See also:
- evas_object_text_ellipsis_set()
void evas_object_text_ellipsis_set | ( | Evas_Object * | obj, |
double | ellipsis | ||
) |
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 is shown and the end trimmed, 1.0
means the beginning is trimmed and the end is shown, and any value in between causes ellipsis to be added in both the end of the text and the requested part to be shown.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Remarks:
-1.0
means ellipsis is turned off.
- Parameters:
-
[in] obj The given text object [in] ellipsis The ellipsis
void evas_object_text_filter_program_set | ( | Evas_Object * | obj, |
const char * | arg | ||
) |
Sets an Evas filter program on this Text Object.
- Since (EFL) :
- 1.9. Backported for Tizen (1.7.99).
- Since :
- 2.3.1
- Remarks:
- If the program fails to compile (syntax error, invalid buffer name, etc...), the standard text effects are applied instead (SHADOW, etc...).
- EXPERIMENTAL FEATURE. This is an unstable API, please use this only for testing purposes.
- Parameters:
-
[in] obj The given evas text object [in] arg The program code, as defined by the "Evas filters script language". Pass NULL
to remove the former program and switch back to the standard text effects.
void evas_object_text_filter_source_set | ( | Evas_Object * | obj, |
const char * | name, | ||
Evas_Object * | source | ||
) |
Binds an object to use as a mask or texture with Evas Filters. This automatically creates a new RGBA buffer containing the source object's pixels (as it is rendered).
- Since (EFL) :
- 1.9. Backported for Tizen (1.7.99).
- Since :
- 2.3.1
- Remarks:
- EXPERIMENTAL FEATURE. This is an unstable API, please use this only for testing purposes.
- Parameters:
-
[in] obj The given evas object [in] name The object name as used in the program code [in] source The evas object to use through proxy rendering
- See also:
- evas_obj_text_filter_program_set
void evas_object_text_font_get | ( | const Evas_Object * | obj, |
const char ** | font, | ||
Evas_Font_Size * | size | ||
) |
Gets the font family and size in use on a given text object.
This function allows the font name and size of a text object to be queried. Be aware that the font name string is still owned by Evas and should not have free() called on it by the caller of the function.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The evas text object to query for font information [out] font A pointer to the location to store the font name in [out] size A pointer to the location to store the font size in
- See also:
- evas_object_text_font_set()
void evas_object_text_font_set | ( | Evas_Object * | obj, |
const char * | font, | ||
Evas_Font_Size | size | ||
) |
Sets the font family and size on a given text object.
This function allows the font name and size of a text object to be set. The font string has to follow fontconfig's convention on naming fonts, as it is the underlying library used to query system fonts by Evas (see the fc-list
command's output, on your system, to get an idea).
- Since :
- 2.3.1
- Parameters:
-
[in] obj The text object to set font for [in] font The font (family) name [in] size The font size, in points
const char* evas_object_text_font_source_get | ( | const Evas_Object * | obj | ) |
Gets the font file's path which is being used on a given text object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The text object to set the font for
- Returns:
- The font file's path
- See also:
- evas_object_text_font_get() for more details
void evas_object_text_font_source_set | ( | Evas_Object * | obj, |
const char * | font | ||
) |
Sets the font (source) file to be used on a given text object.
This function allows the font file to be explicitly set for a given text object, overriding system lookup, which first occurs in the given file's contents.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The text object to set font for [in] font The font file's path
- See also:
- evas_object_text_font_get()
void evas_object_text_glow2_color_get | ( | const Evas_Object * | obj, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Gets the 'glow 2' color for the given text object.
- Since :
- 2.3.1
- Remarks:
- Use
NULL
pointers on the color components that you are not interested in: they are ignored by the function.
- Parameters:
-
[in] obj The given Evas text object [out] r The pointer to variable to hold the red component of the given color [out] g The pointer to variable to hold the green component of the given color [out] b The pointer to variable to hold the blue component of the given color [out] a The pointer to variable to hold the alpha component of the given color
- See also:
- evas_object_text_glow2_color_set() for more details.
void evas_object_text_glow2_color_set | ( | Evas_Object * | obj, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Sets the 'glow 2' color for the given text object.
- Since :
- 2.3.1
- Remarks:
- 'Glow 2' effects, which are glowing colors decorating the text's (immediate) surroundings, are shown if the object is set to the EVAS_TEXT_STYLE_GLOW style. See also evas_object_text_glow_color_set().
- Parameters:
-
[in] obj The given Evas text object [in] r The red component of the given color [in] g The green component of the given color [in] b The blue component of the given color [in] a The alpha component of the given color
- See also:
- evas_object_text_glow2_color_get()
void evas_object_text_glow_color_get | ( | const Evas_Object * | obj, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Gets the glow color for the given text object.
- Since :
- 2.3.1
- Remarks:
- Use
NULL
pointers on the color components that you are not interested in: they are ignored by the function.
- Parameters:
-
[in] obj The given Evas text object. [out] r The pointer to variable to hold the red component of the given color [out] g The pointer to variable to hold the green component of the given color [out] b The pointer to variable to hold the blue component of the given color [out] a The pointer to variable to hold the alpha component of the given color
- See also:
- evas_object_text_glow_color_set() for more details.
void evas_object_text_glow_color_set | ( | Evas_Object * | obj, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Sets the glow color for the given text object.
- Since :
- 2.3.1
- Remarks:
- Glow effects, which are glowing colors decorating the text's surroundings, are shown if the object is set to the EVAS_TEXT_STYLE_GLOW style.
- 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()).
- Parameters:
-
[in] obj The given Evas text object [in] r The red component of the given color [in] g The green component of the given color [in] b The blue component of the given color [in] a The alpha component of the given color
- See also:
- evas_object_text_glow_color_get()
int evas_object_text_last_up_to_pos | ( | const Evas_Object * | obj, |
Evas_Coord | x, | ||
Evas_Coord | y | ||
) |
Gets the logical position of the last char in the text up to the given position.
This is NOT the position of the last char because of the possibility of RTL in the text.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The text object [in] x The X co-ordinate [in] y The Y co-ordinate
- Returns:
- The logical The positoin of the last char in the text up to the given position
void evas_object_text_outline_color_get | ( | const Evas_Object * | obj, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Gets the outline color for the given text object.
- Since :
- 2.3.1
- Remarks:
- Use
NULL
pointers on the color components that you are not interested in: they are ignored by the function.
- Parameters:
-
[in] obj The given Evas text object [out] r The pointer to the variable to hold the red component of the given color [out] g The pointer to the variable to hold the green component of the given color [out] b The pointer to the variable to hold the blue component of the given color [out] a The pointer to the variable to hold the alpha component of the given color
- See also:
- evas_object_text_outline_color_set() for more details.
void evas_object_text_outline_color_set | ( | Evas_Object * | obj, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Sets the outline color for the given text object.
- Since :
- 2.3.1
- Remarks:
- Outline effects (colored lines around text glyphs) are just shown if the object is set to one of the following styles:
- Parameters:
-
[in] obj The given Evas text object [in] r The red component of the given color [in] g The green component of the given color [in] b The blue component of the given color [in] a The alpha component of the given color
- See also:
- evas_object_text_outline_color_get()
void evas_object_text_shadow_color_get | ( | const Evas_Object * | obj, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Gets the shadow color for the given text object.
- Since :
- 2.3.1
- Remarks:
- Use
NULL
pointers on the color components that you are not interested in: they are ignored by the function.
- Parameters:
-
[in] obj The given Evas text object [out] r The pointer to variable to hold the red component of the given color [out] g The pointer to variable to hold the green component of the given color [out] b The pointer to variable to hold the blue component of the given color [out] a The pointer to variable to hold the alpha component of the given color
- See also:
- evas_object_text_shadow_color_set() for more details.
void evas_object_text_shadow_color_set | ( | Evas_Object * | obj, |
int | r, | ||
int | g, | ||
int | b, | ||
int | a | ||
) |
Sets the shadow color for the given text object.
- Since :
- 2.3.1
- Remarks:
- Shadow effects, which are fading colors decorating the text underneath it, are just shown if the object is set to one of the following styles:
- You can also change the direction where the shadow grows to, with evas_object_text_style_set().
- Parameters:
-
[in] obj The given Evas text object [in] r The red component of the given color [in] g The green component of the given color [in] b The blue component of the given color [in] a The alpha component of the given color
- See also:
- evas_object_text_shadow_color_get()
Evas_Text_Style_Type evas_object_text_style_get | ( | const Evas_Object * | obj | ) |
Gets the style on use on the given text object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The given text object to set style on
- Returns:
- The style type in use
- See also:
- evas_object_text_style_set() for more details.
void evas_object_text_style_pad_get | ( | const Evas_Object * | obj, |
int * | l, | ||
int * | r, | ||
int * | t, | ||
int * | b | ||
) |
Gets the text style pad of a text object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The given text object [out] l The left pad (or NULL
)[out] r The right pad (or NULL
)[out] t The top pad (or NULL
)[out] b The bottom pad (or NULL
)
void evas_object_text_style_set | ( | Evas_Object * | obj, |
Evas_Text_Style_Type | type | ||
) |
Sets the style to apply on the given text object.
- Since :
- 2.3.1
- Remarks:
- Valid text object styles are defined 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.
- You can 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:
- Parameters:
-
[in] obj The given text object to set style on [in] type The style type
const char* evas_object_text_text_get | ( | const Evas_Object * | obj | ) |
Gets the text string currently being displayed by the given text object.
- Since :
- 2.3.1
- Remarks:
- Do not free() the return value.
- Parameters:
-
[in] obj The given text object
- Returns:
- The text string currently being displayed on it
- See also:
- evas_object_text_text_set()
void evas_object_text_text_set | ( | Evas_Object * | obj, |
const char * | text | ||
) |
Sets the text string to be displayed by the given text object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The text object to set text string on [in] text The text string to display on it
- See also:
- evas_object_text_text_get()