Tizen Native API
|
This group provides functions used to create and manipulate textblock objects.
Unlike Text Object Functions, these handle complex text, doing multiple styles and multiline text based on HTML-like tags. Of these extra features are heavier on memory and processing cost.
Textblock Object Tutorial
This part explains about the textblock object's API and proper usage. The main user of the textblock object is the edje entry object in Edje. So that is a good place to learn from, but this document is more than enough. If it is not, please contact the developer to update it.
Introduction
The textblock object is, as implied, an object that can show big chunks of text. Textblock supports many features including: Text formatting, automatic and manual text alignment, embedding items (for example icons) and more. Textblock has three important parts: the text paragraphs, the format nodes, and the cursors.
You can use markup to format text, for example: "<font_size=50>Big!</font_size>". You can also put more than one style directive in one tag: "<font_size=50 color=#F00>Big and Red!</font_size>". Please notice that we used "</font_size>" although the format also included color. This is because the first format determines the matching closing tag's name. You can also use anonymous tags, like: "<font_size=30>Big</>" which just pop any type of format, but it is advised to use the named alternatives instead.
Textblock Object Cursors
A textblock cursor is the data type that represents a position in a textblock. Each cursor contains information about the paragraph it points to, the position in that paragraph, and the object itself. Cursors register to textblock objects upon creation. This means that once you created a cursor, it belongs to a specific object and you cannot, for example, copy a cursor "into" a cursor of a different object. Registered cursors also have the added benefit of updating automatically upon textblock changes, this means that if you have a cursor pointing to a specific character, it still points to it even after you change the whole object completely (as long as the char is not deleted). This is not possible without updating, because as mentioned, each cursor holds a character position. There are many functions that handle cursors. See the evas_textblock_cursor* functions. For creation and deletion of cursors, see:
- Remarks:
- Cursors are generally the correct way to handle text in the textblock object, and there are enough functions to do everything you need with them (no need to get big chunks of text and processing them yourself).
Textblock Object Paragraphs
The textblock object is made out of text split to paragraphs (delimited by the paragraph separation character). Each paragraph has many (or none) format nodes associated with it which are responsible for the formatting of that paragraph.
Textblock Object Format Nodes
As explained in Textblock Object Paragraphs each one of the format nodes is associated with a paragraph. There are two types of format nodes: visible and invisible. Visible: Formats that a cursor can point to, that is, the formats that occupy space. For example: newlines, tabs, items and so on. Some visible items are made of two parts. In this case, only the opening tag is visible. A closing tag (i.e a </tag> tag) should NEVER be visible. Invisible: Formats that do not occupy space. For example: bold and underline. Being able to access format nodes is very important for some uses. For example, edje uses the "<a>" format to create links in the text (and pop popups above them when clicked). For the textblock object a is just a formatting instruction (how to color the text), but edje utilizes the access to the format nodes to make it do more. For more information, see all the evas_textblock_node_format_* functions. The translation of "<tag>" tags to actual format is done according to the tags defined in the style, see evas_textblock_style_set
Special Formats
Textblock supports various format directives that can be used in markup. In addition to the mentioned format directives, textblock allows creating additional format directives using "tags" that can be set in the style. See evas_textblock_style_set .
Textblock supports the following formats:
- font - Font description in fontconfig like format. Example: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
- font_weight - Overrides the weight defined in "font". Example: "font_weight=Bold" is the same as "font=:style=Bold". Supported weights: "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack".
- font_style - Overrides the style defined in "font". Example: "font_style=Italic" is the same as "font=:style=Italic". Supported styles: "normal", "oblique", and "italic".
- font_width - Overrides the width defined in "font". E.g: "font_width=Condensed" is the same as "font=:style=Condensed". Supported widths: "normal", "ultracondensed", "extracondensed", "condensed", "semicondensed", "semiexpanded", "expanded", "extraexpanded", and "ultraexpanded".
- lang - Overrides the language defined in "font". Example: "lang=he" is the same as "font=:lang=he".
- font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
- font_size - The font size in points.
- font_source - The source of the font. Example: An eet file.
- color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- underline_color - Color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- underline2_color - Color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- outline_color - Color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- shadow_color - Color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- glow_color - Color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- glow2_color - Color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- strikethrough_color - Color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- align - Either "auto" (meaning according to text direction), "left", "right", "center", "middle", a value between
0.0
and1.0
, or a value between 0% to 100%. - valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between
0.0
and1.0
, or a value between 0% to 100%. - wrap - "word", "char", "mixed", or "none".
- left_margin - Either "reset", or a pixel value indicating the margin.
- right_margin - Either "reset", or a pixel value indicating the margin.
- underline - "on", "off", "single", or "double".
- strikethrough - "on" or "off"
- backing_color - Background color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
- backing - Enable or disable background color. Example: "on" or "off"
- style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow".
- tabstops - Pixel value for tab width.
- linesize - Force a line size in pixels.
- linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
- linegap - Force a line gap in pixels.
- linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
- item - Creates an empty space that should be filled by an upper layer. Use "size", "abssize", or "relsize". To define the items size, and an optional: vsize=full/ascent to define the item's position in the line.
- linefill - Either a float value or percentage indicating how much to fill the line.
- ellipsis - Value between
0.0-
indicate the type of ellipsis, or1.0
to-1.0
to indicate that ellipsis is not wanted. - password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
- Remarks:
- There is no guarantee of any proper results if you create a Textblock object without setting the evas engine.
Functions | |
Evas_Object * | evas_object_textblock_add (Evas *e) |
Adds a textblock to the given evas. | |
const char * | evas_textblock_escape_string_get (const char *escape) |
Gets the unescaped version of escape. | |
const char * | evas_textblock_string_escape_get (const char *string, int *len_ret) |
Gets the escaped version of the string. | |
const char * | evas_textblock_escape_string_range_get (const char *escape_start, const char *escape_end) |
Gets the unescaped version of the string between start and end. | |
char * | evas_textblock_text_markup_to_utf8 (const Evas_Object *obj, const char *text) |
Gets the plain version of the markup. | |
char * | evas_textblock_text_utf8_to_markup (const Evas_Object *obj, const char *text) |
Gets the markup version of the plain text. | |
Evas_Textblock_Style * | evas_textblock_style_new (void) |
Creates a new textblock style. | |
void | evas_textblock_style_free (Evas_Textblock_Style *ts) |
Destroys a textblock style. | |
void | evas_textblock_style_set (Evas_Textblock_Style *ts, const char *text) |
Sets the style ts to the style passed as text by text. | |
const char * | evas_textblock_style_get (const Evas_Textblock_Style *ts) |
Gets the text of the style ts. | |
void | evas_object_textblock_style_set (Evas_Object *obj, Evas_Textblock_Style *ts) |
Sets the object style to ts. | |
const Evas_Textblock_Style * | evas_object_textblock_style_get (const Evas_Object *obj) |
Gets the style of an object. | |
void | evas_object_textblock_style_user_push (Evas_Object *obj, Evas_Textblock_Style *ts) |
Pushes ts to the top of the user style stack. | |
void | evas_object_textblock_style_user_pop (Evas_Object *obj) |
Deletes the style from the top of the user style stack. | |
const Evas_Textblock_Style * | evas_object_textblock_style_user_peek (const Evas_Object *obj) |
Gets (does not remove) the style at the top of the user style stack. | |
void | evas_object_textblock_replace_char_set (Evas_Object *obj, const char *ch) |
Sets the "replacement character" to use for the given textblock object. | |
const char * | evas_object_textblock_replace_char_get (Evas_Object *obj) |
Gets the "replacement character" for given textblock object. | |
void | evas_object_textblock_valign_set (Evas_Object *obj, double align) |
Sets the vertical alignment of text within the textblock object as a whole. | |
double | evas_object_textblock_valign_get (const Evas_Object *obj) |
Gets the vertical alignment of a textblock. | |
void | evas_object_textblock_bidi_delimiters_set (Evas_Object *obj, const char *delim) |
Sets the BiDi delimiters used in the textblock. | |
const char * | evas_object_textblock_bidi_delimiters_get (const Evas_Object *obj) |
Gets the BiDi delimiters used in the textblock. | |
void | evas_object_textblock_legacy_newline_set (Evas_Object *obj, Eina_Bool mode) |
Sets the newline mode. | |
Eina_Bool | evas_object_textblock_legacy_newline_get (const Evas_Object *obj) |
Gets the newline mode. | |
void | evas_object_textblock_text_markup_set (Evas_Object *obj, const char *text) |
Sets the textblock's text to the markup text. | |
void | evas_object_textblock_text_markup_prepend (Evas_Textblock_Cursor *cur, const char *text) |
Prepends markup to the cursor cur. | |
const char * | evas_object_textblock_text_markup_get (const Evas_Object *obj) |
Gets the markup of the object. | |
Evas_Textblock_Cursor * | evas_object_textblock_cursor_get (const Evas_Object *obj) |
Gets the object's main cursor. | |
Evas_Textblock_Cursor * | evas_object_textblock_cursor_new (const Evas_Object *obj) |
Creates a new cursor, associates it to the obj and inits it to point to the start of the textblock. | |
void | evas_textblock_cursor_free (Evas_Textblock_Cursor *cur) |
Frees the cursor and unassociates it from the object. | |
void | evas_textblock_cursor_paragraph_first (Evas_Textblock_Cursor *cur) |
Sets the cursor to the start of the first text node. | |
void | evas_textblock_cursor_paragraph_last (Evas_Textblock_Cursor *cur) |
Sets the cursor to the end of the last text node. | |
Eina_Bool | evas_textblock_cursor_paragraph_next (Evas_Textblock_Cursor *cur) |
Advances to the start of the next text node. | |
Eina_Bool | evas_textblock_cursor_paragraph_prev (Evas_Textblock_Cursor *cur) |
Goes to the end of the previous text node. | |
const Eina_List * | evas_textblock_node_format_list_get (const Evas_Object *obj, const char *anchor) |
Gets the the list format node corresponding to anchor. | |
const Evas_Object_Textblock_Node_Format * | evas_textblock_node_format_first_get (const Evas_Object *obj) |
Gets the first format node. | |
const Evas_Object_Textblock_Node_Format * | evas_textblock_node_format_last_get (const Evas_Object *obj) |
Gets the last format node. | |
const Evas_Object_Textblock_Node_Format * | evas_textblock_node_format_next_get (const Evas_Object_Textblock_Node_Format *n) |
Gets the next format node (after n). | |
const Evas_Object_Textblock_Node_Format * | evas_textblock_node_format_prev_get (const Evas_Object_Textblock_Node_Format *n) |
Gets the previous format node (after n). | |
void | evas_textblock_node_format_remove_pair (Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) |
Removes a format node and its match. That is it removes a <tag> </tag> pair. | |
void | evas_textblock_cursor_set_at_format (Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) |
Sets the cursor to point to the place where format points to. | |
const Evas_Object_Textblock_Node_Format * | evas_textblock_cursor_format_get (const Evas_Textblock_Cursor *cur) |
Gets the format node at the position pointed by cur. | |
const char * | evas_textblock_node_format_text_get (const Evas_Object_Textblock_Node_Format *fnode) |
Gets the text format representation of the format node. | |
void | evas_textblock_cursor_at_format_set (Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) |
Sets the cursor to point to the position of fmt. | |
Eina_Bool | evas_textblock_cursor_format_is_visible_get (const Evas_Textblock_Cursor *cur) |
Checks whether the current cursor position is a visible format. | |
Eina_Bool | evas_textblock_cursor_format_next (Evas_Textblock_Cursor *cur) |
Advances the cursor to the next format node. | |
Eina_Bool | evas_textblock_cursor_format_prev (Evas_Textblock_Cursor *cur) |
Advances the cursor to the previous format node. | |
Eina_Bool | evas_textblock_cursor_is_format (const Evas_Textblock_Cursor *cur) |
Checks whether the cursor points to a format. | |
Eina_Bool | evas_textblock_cursor_char_next (Evas_Textblock_Cursor *cur) |
Advances the cursor 1 char forward. | |
Eina_Bool | evas_textblock_cursor_char_prev (Evas_Textblock_Cursor *cur) |
Advances the cursor 1 char backward. | |
Eina_Bool | evas_textblock_cursor_word_start (Evas_Textblock_Cursor *cur) |
Moves the cursor to the start of the word under the cursor. | |
Eina_Bool | evas_textblock_cursor_word_end (Evas_Textblock_Cursor *cur) |
Moves the cursor to the end of the word under the cursor. | |
void | evas_textblock_cursor_paragraph_char_first (Evas_Textblock_Cursor *cur) |
Moves the cursor to the first char in the node the cursor is pointing on. | |
void | evas_textblock_cursor_paragraph_char_last (Evas_Textblock_Cursor *cur) |
Moves the cursor to the last char in a text node. | |
void | evas_textblock_cursor_line_char_first (Evas_Textblock_Cursor *cur) |
Moves the cursor to the start of the current line. | |
void | evas_textblock_cursor_line_char_last (Evas_Textblock_Cursor *cur) |
Moves the cursor to the end of the current line. | |
int | evas_textblock_cursor_pos_get (const Evas_Textblock_Cursor *cur) |
Gets the current cursor position. | |
void | evas_textblock_cursor_pos_set (Evas_Textblock_Cursor *cur, int pos) |
Sets the cursor position. | |
Eina_Bool | evas_textblock_cursor_line_set (Evas_Textblock_Cursor *cur, int line) |
Moves the cursor to the start of the line passed. | |
int | evas_textblock_cursor_compare (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) |
Compares two cursors. | |
void | evas_textblock_cursor_copy (const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest) |
Makes cur_dest point to the same point as cur. | |
int | evas_textblock_cursor_text_append (Evas_Textblock_Cursor *cur, const char *text) |
Adds text to the current cursor position and sets the cursor to *before* the start of the text just added. | |
int | evas_textblock_cursor_text_prepend (Evas_Textblock_Cursor *cur, const char *text) |
Adds text to the current cursor position and sets the cursor to *after* the start of the text just added. | |
Eina_Bool | evas_textblock_cursor_format_append (Evas_Textblock_Cursor *cur, const char *format) |
Adds format to the current cursor position. | |
Eina_Bool | evas_textblock_cursor_format_prepend (Evas_Textblock_Cursor *cur, const char *format) |
Adds the format to the current cursor position. | |
void | evas_textblock_cursor_char_delete (Evas_Textblock_Cursor *cur) |
Deletes the character at the location of the cursor. | |
void | evas_textblock_cursor_range_delete (Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) |
Deletes the range between cur1 and cur2. | |
const char * | evas_textblock_cursor_paragraph_text_get (const Evas_Textblock_Cursor *cur) |
Gets the text of the paragraph cur points to. | |
int | evas_textblock_cursor_paragraph_text_length_get (const Evas_Textblock_Cursor *cur) |
Gets the length of the paragraph. | |
Eina_Bool | evas_textblock_cursor_visible_range_get (Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) |
Gets the currently visible range. | |
Eina_List * | evas_textblock_cursor_range_formats_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) |
Gets the format nodes in the range between cur1 and cur2. | |
char * | evas_textblock_cursor_range_text_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) |
Gets the text in the range between cur1 and cur2. | |
char * | evas_textblock_cursor_content_get (const Evas_Textblock_Cursor *cur) |
Gets the content of the cursor. | |
Eina_Bool | evas_textblock_cursor_geometry_bidi_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2, Evas_Textblock_Cursor_Type ctype) |
Gets the geometry of two cursors ("split cursor"), if logical cursor is between LTR/RTL text, also considering paragraph direction. | |
int | evas_textblock_cursor_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype) |
Gets the geometry of the cursor. | |
int | evas_textblock_cursor_char_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) |
Gets the geometry of the char at cur. | |
int | evas_textblock_cursor_pen_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cpen_x, Evas_Coord *cy, Evas_Coord *cadv, Evas_Coord *ch) |
Gets the geometry of the pen at cur. | |
int | evas_textblock_cursor_line_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) |
Gets the geometry of the line at cur. | |
Eina_Bool | evas_textblock_cursor_char_coord_set (Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) |
Sets the position of the cursor according to the X and Y coordinates. | |
int | evas_textblock_cursor_line_coord_set (Evas_Textblock_Cursor *cur, Evas_Coord y) |
Sets the cursor position according to the y coordinate. | |
Eina_List * | evas_textblock_cursor_range_geometry_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) |
Gets the geometry of a range. | |
Eina_Bool | evas_textblock_cursor_eol_get (const Evas_Textblock_Cursor *cur) |
Checks whether the cursor points to the end of the line. | |
Eina_Bool | evas_object_textblock_line_number_geometry_get (const Evas_Object *obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) |
Gets the geometry of a line number. | |
void | evas_object_textblock_clear (Evas_Object *obj) |
Clears the textblock object. | |
void | evas_object_textblock_size_formatted_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) |
Gets the formatted width and height. | |
void | evas_object_textblock_size_native_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) |
Gets the native width and height. | |
Typedefs | |
typedef struct _Evas_Textblock_Style | Evas_Textblock_Style |
handle for Evas Textblock Style | |
typedef struct _Evas_Textblock_Cursor | Evas_Textblock_Cursor |
handle for Evas Textblock Cursor | |
typedef struct _Evas_Object_Textblock_Node_Format | Evas_Object_Textblock_Node_Format |
The structure type containing a format node. |
Function Documentation
Evas_Object* evas_object_textblock_add | ( | Evas * | e | ) |
Adds a textblock to the given evas.
- Since :
- 2.3.1
- Parameters:
-
[in] e The given evas
- Returns:
- The new textblock object
const char* evas_object_textblock_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 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.
- Parameters:
-
[in] obj The given textblock object
- Returns:
- A null terminated string of delimiters, for example ",|",
otherwiseNULL
if it is empty
void evas_object_textblock_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 uses 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 textblock object [in] delim A null terminated string of delimiters, for example ",|"
void evas_object_textblock_clear | ( | Evas_Object * | obj | ) |
Clears the textblock object.
- Since :
- 2.3.1
- Remarks:
- Does *NOT* free the Evas object itself.
- Parameters:
-
[in] obj The object to clear
Evas_Textblock_Cursor* evas_object_textblock_cursor_get | ( | const Evas_Object * | obj | ) |
Gets the object's main cursor.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The object
- Returns:
- obj's main cursor
Evas_Textblock_Cursor* evas_object_textblock_cursor_new | ( | const Evas_Object * | obj | ) |
Creates a new cursor, associates it to the obj and inits it to point to the start of the textblock.
- Since :
- 2.3.1
- Remarks:
- Association to the object means the cursor is updated when the object changes.
- If you need speed and you know what you are doing, it is slightly faster to just allocate the cursor yourself and not associate it.
- Parameters:
-
[in] obj The object to associate to
- Returns:
- The new cursor
Eina_Bool evas_object_textblock_legacy_newline_get | ( | const Evas_Object * | obj | ) |
Gets the newline mode.
- Since (EFL) :
- 1.1
- Since :
- 2.3.1
- Remarks:
- When true, newline character behaves as a paragraph separator.
- Parameters:
-
[in] obj The given textblock object
- Returns:
- EINA_TRUE if it is in legacy mode,
otherwise EINA_FALSE
void evas_object_textblock_legacy_newline_set | ( | Evas_Object * | obj, |
Eina_Bool | mode | ||
) |
Sets the newline mode.
- Since (EFL) :
- 1.1
- Since :
- 2.3.1
- Remarks:
- When
true
, newline character behaves as a paragraph separator.
- Parameters:
-
[in] obj The given textblock object [in] mode Set EINA_TRUE for legacy mode,
otherwise set EINA_FALSE
Eina_Bool evas_object_textblock_line_number_geometry_get | ( | const Evas_Object * | obj, |
int | line, | ||
Evas_Coord * | cx, | ||
Evas_Coord * | cy, | ||
Evas_Coord * | cw, | ||
Evas_Coord * | ch | ||
) |
Gets the geometry of a line number.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The object [in] line The line number [out] cx The x coordinate of the line [out] cy The y coordinate of the line [out] cw The w coordinate of the line [out] ch The h coordinate of the line
- Returns:
- EINA_TRUE if the geometry of the line is obtained successfully, otherwise EINA_FALSE on failure
const char* evas_object_textblock_replace_char_get | ( | Evas_Object * | obj | ) |
Gets the "replacement character" for given textblock object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The given textblock object
- Returns:
- The replacement character,
otherwiseNULL
if no replacement character is in use
void evas_object_textblock_replace_char_set | ( | Evas_Object * | obj, |
const char * | ch | ||
) |
Sets the "replacement character" to use for the given textblock object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The given textblock object [in] ch The charset name
void evas_object_textblock_size_formatted_get | ( | const Evas_Object * | obj, |
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Gets the formatted width and height.
- Since :
- 2.3.1
- Remarks:
- This calculates the actual size after restricting the textblock to the current size of the object. The main difference between this and evas_object_textblock_size_native_get is that the "native" function does not take wrapping into account. It just calculates the real width of the object if it is placed on an infinite canvas, while this function gives the size after wrapping according to the size restrictions of the object.
- For example, 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.
- Parameters:
-
[in] obj The Evas object [out] w The width of the object [out] h The height of the object
void evas_object_textblock_size_native_get | ( | const Evas_Object * | obj, |
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Gets the native width and height.
- Since :
- 2.3.1
- Remarks:
- This calculates the actual size without taking into account the current size of the object. The main difference between this and evas_object_textblock_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 is 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, 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.
- Parameters:
-
[in] obj The Evas object of the textblock [out] w The width returned [out] h The height returned
const Evas_Textblock_Style* evas_object_textblock_style_get | ( | const Evas_Object * | obj | ) |
Gets the style of an object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The object to get the style from
- Returns:
- The style of the object
void evas_object_textblock_style_set | ( | Evas_Object * | obj, |
Evas_Textblock_Style * | ts | ||
) |
Sets the object style to ts.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The Evas object to set the style to [in] ts The style to set
const Evas_Textblock_Style* evas_object_textblock_style_user_peek | ( | const Evas_Object * | obj | ) |
Gets (does not remove) the style at the top of the user style stack.
- Since (EFL) :
- 1.2
- Since :
- 2.3.1
- Parameters:
-
[in] obj The object to get the style from
- Returns:
- The style of the object
- See also:
- evas_object_textblock_style_get
void evas_object_textblock_style_user_pop | ( | Evas_Object * | obj | ) |
Deletes the style from the top of the user style stack.
- Since (EFL) :
- 1.2
- Since :
- 2.3.1
- Parameters:
-
[in] obj The object to get the style from
- See also:
- evas_object_textblock_style_get
void evas_object_textblock_style_user_push | ( | Evas_Object * | obj, |
Evas_Textblock_Style * | ts | ||
) |
Pushes ts to the top of the user style stack.
FIXME: API is solid but currently only supports 1 style in the stack.
- Since (EFL) :
- 1.2
- Since :
- 2.3.1
- Remarks:
- The user style overrides the corresponding elements of the regular style. This is the proper way to do theme overrides in code.
- Parameters:
-
[in] obj The Evas object to set the style to [in] ts The style to set
- See also:
- evas_object_textblock_style_set
const char* evas_object_textblock_text_markup_get | ( | const Evas_Object * | obj | ) |
Gets the markup of the object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The Evas object
- Returns:
- The markup text of the object
void evas_object_textblock_text_markup_prepend | ( | Evas_Textblock_Cursor * | cur, |
const char * | text | ||
) |
Prepends markup to the cursor cur.
- Since :
- 2.3.1
- Remarks:
- This assumes that the text does not include the unicode object replacement char (0xFFFC).
- Parameters:
-
[in] cur The cursor to prepend to [in] text The markup text to prepend
void evas_object_textblock_text_markup_set | ( | Evas_Object * | obj, |
const char * | text | ||
) |
Sets the textblock's text to the markup text.
- Since :
- 2.3.1
- Remarks:
- This assumes that the text does not include the unicode object replacement char (0xFFFC).
- Parameters:
-
[in] obj The textblock object [in] text The markup text to use
double evas_object_textblock_valign_get | ( | const Evas_Object * | obj | ) |
Gets the vertical alignment of a textblock.
- Since (EFL) :
- 1.1
- Since :
- 2.3.1
- Parameters:
-
[in] obj The given textblock object
- Returns:
- The alignment set for the object
void evas_object_textblock_valign_set | ( | Evas_Object * | obj, |
double | align | ||
) |
Sets the vertical alignment of text within the textblock object as a whole.
- Since (EFL) :
- 1.1
- Since :
- 2.3.1
- Remarks:
- Normally alignment is
0.0
(top of object). Values given should be between0.0
and1.0
, where1.0
is bottom of object,0.5
is vertically centered, and so on.
- Parameters:
-
[in] obj The given textblock object [in] align A value between 0.0
and1.0
void evas_textblock_cursor_at_format_set | ( | Evas_Textblock_Cursor * | cur, |
const Evas_Object_Textblock_Node_Format * | fmt | ||
) |
Sets the cursor to point to the position of fmt.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to update [in] fmt The format to update according to
Eina_Bool evas_textblock_cursor_char_coord_set | ( | Evas_Textblock_Cursor * | cur, |
Evas_Coord | x, | ||
Evas_Coord | y | ||
) |
Sets the position of the cursor according to the X and Y coordinates.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to set [in] x The x coordinate to set [in] y The y coordinate to set
- Returns:
- EINA_TRUE if the position of the cursor is set successfully,
otherwise EINA_FALSE on failure
void evas_textblock_cursor_char_delete | ( | Evas_Textblock_Cursor * | cur | ) |
Deletes the character at the location of the cursor.
If there is a format pointing to this position, delete it as well.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor pointing to the current location
int evas_textblock_cursor_char_geometry_get | ( | const Evas_Textblock_Cursor * | cur, |
Evas_Coord * | cx, | ||
Evas_Coord * | cy, | ||
Evas_Coord * | cw, | ||
Evas_Coord * | ch | ||
) |
Gets the geometry of the char at cur.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The position of the char [out] cx The x coordinate of the char [out] cy The y coordinate of the char [out] cw The width of the char [out] ch The height of the char
- Returns:
- The line number of the char,
otherwise-1
on error
Advances the cursor 1 char forward.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to advance
- Returns:
- EINA_TRUE if the cursor is advanced successfully,
otherwise EINA_FALSE on failure
Advances the cursor 1 char backward.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to advance
- Returns:
- EINA_TRUE if the cursor is advanced successfully,
otherwise EINA_FALSE on failure
int evas_textblock_cursor_compare | ( | const Evas_Textblock_Cursor * | cur1, |
const Evas_Textblock_Cursor * | cur2 | ||
) |
Compares two cursors.
- Since :
- 2.3.1
- Parameters:
-
[in] cur1 The first cursor [in] cur2 The second cursor
- Returns:
-1
if cur1 < cur2,0
if cur1 == cur2,
otherwise1
char* evas_textblock_cursor_content_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Gets the content of the cursor.
- Since :
- 2.3.1
- Remarks:
- Frees the returned string pointer when done if it is not
NULL
.
- Parameters:
-
[in] cur The cursor
- Returns:
- The text in the range, terminated by a null byte (may be utf8)
void evas_textblock_cursor_copy | ( | const Evas_Textblock_Cursor * | cur, |
Evas_Textblock_Cursor * | cur_dest | ||
) |
Makes cur_dest point to the same point as cur.
- Since :
- 2.3.1
- Remarks:
- This does not work if they do not point to the same object.
- Parameters:
-
[in] cur The source cursor [in] cur_dest The destination cursor
Eina_Bool evas_textblock_cursor_eol_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Checks whether the cursor points to the end of the line.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to check
- Returns:
- EINA_TRUE if the cursor points to the end of the line,
otherwise EINA_FALSE
Eina_Bool evas_textblock_cursor_format_append | ( | Evas_Textblock_Cursor * | cur, |
const char * | format | ||
) |
Adds format to the current cursor position.
If the format being added is a visible format, add it *before* the cursor position, otherwise, add it after. This behavior is because visible formats are like characters and invisible should be stacked in a way that the last one is added last.
- Since :
- 2.3.1
- Remarks:
- This function works with native formats, that means that style defined tags like
won't work here. For those kind of things use markup prepend.
- Parameters:
-
[in] cur the cursor to where to add format at. [in] format the format to add.
- Returns:
- Returns true if a visible format was added, false otherwise.
const Evas_Object_Textblock_Node_Format* evas_textblock_cursor_format_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Gets the format node at the position pointed by cur.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The position to look at
- Returns:
- The format node,
otherwiseNULL
if it is not found
Checks whether the current cursor position is a visible format.
- Since :
- 2.3.1
- Remarks:
- This way is more efficient than evas_textblock_cursor_format_get() to check for the existence of a visible format.
- Parameters:
-
[in] cur The cursor to look at
- Returns:
- EINA_TRUE if the cursor points to a visible format,
otherwise EINA_FALSE if the cursor does not point to a visible format
- See also:
- evas_textblock_cursor_format_get()
Advances the cursor to the next format node.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to be updated
- Returns:
- EINA_TRUE if the cursor is advanced successfully,
otherwise EINA_FALSE on failure
Eina_Bool evas_textblock_cursor_format_prepend | ( | Evas_Textblock_Cursor * | cur, |
const char * | format | ||
) |
Adds the format to the current cursor position.
If the format being added is a visible format, add it *before* the cursor position, otherwise, add it after. This behavior is because visible formats are like characters and invisible should be stacked in a way that the last one is added last. If the format is visible the cursor is advanced after it.
- Since :
- 2.3.1
- Remarks:
- This function works with native formats, that means that style defined tags like
does not work here. For those, use markup prepend.
- Parameters:
-
[in] cur The cursor to where to add format at [in] format The format to add
- Returns:
- EINA_TRUE if the visible format is added,
otherwise EINA_FALSE if the visible format is not added
Advances the cursor to the previous format node.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to update
- Returns:
- EINA_TRUE if the cursor is advanced successfully,
otherwise EINA_FALSE on failure
void evas_textblock_cursor_free | ( | Evas_Textblock_Cursor * | cur | ) |
Frees the cursor and unassociates it from the object.
- Since :
- 2.3.1
- Remarks:
- Do not use it to free the unassociated cursors.
- Parameters:
-
[in] cur The cursor to free
Eina_Bool evas_textblock_cursor_geometry_bidi_get | ( | const Evas_Textblock_Cursor * | cur, |
Evas_Coord * | cx, | ||
Evas_Coord * | cy, | ||
Evas_Coord * | cw, | ||
Evas_Coord * | ch, | ||
Evas_Coord * | cx2, | ||
Evas_Coord * | cy2, | ||
Evas_Coord * | cw2, | ||
Evas_Coord * | ch2, | ||
Evas_Textblock_Cursor_Type | ctype | ||
) |
Gets the geometry of two cursors ("split cursor"), if logical cursor is between LTR/RTL text, also considering paragraph direction.
- Since :
- 2.3.1
- Remarks:
- The upper cursor is shown for the text of the same direction as paragraph, lower cursor - for the opposite.
- The split cursor geometry is valid only in '|' cursor mode. In this case EINA_TRUE is returned and cx2, cy2, cw2, ch2 are set, otherwise it behaves like cursor_geometry_get.
- Parameters:
-
[in] cur The cursor [out] cx The x coordinate of the cursor (or upper cursor) [out] cy The y coordinate of the cursor (or upper cursor) [out] cw The width of the cursor (or upper cursor) [out] ch The height of the cursor (or upper cursor) [out] cx2 The x coordinate of the lower cursor [out] cy2 The y coordinate of the lower cursor [out] cw2 The width of the lower cursor [out] ch2 The height of the lower cursor [in] ctype The type of the cursor
- Returns:
- EINA_TRUE if split cursor, otherwise EINA_FALSE
int evas_textblock_cursor_geometry_get | ( | const Evas_Textblock_Cursor * | cur, |
Evas_Coord * | cx, | ||
Evas_Coord * | cy, | ||
Evas_Coord * | cw, | ||
Evas_Coord * | ch, | ||
Evas_BiDi_Direction * | dir, | ||
Evas_Textblock_Cursor_Type | ctype | ||
) |
Gets the geometry of the cursor.
- Since :
- 2.3.1
- Remarks:
- It depends on the type of cursor requested. This should be used instead of char_geometry_get because there are weird special cases with BiDi text.
- In '_' cursor mode (i.e a line below the char) it is the same as char_geometry_get, except for the case of the last char of a line which depends on the paragraph direction.
- In '|' cursor mode (i.e a line between two chars) it is very variable. For example, consider the following visual string: "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw a '|' between the c and the C.
- Parameters:
-
[in] cur The cursor [out] cx The x coordinate of the cursor [out] cy The y coordinate of the cursor [out] cw The width of the cursor [out] ch The height of the cursor [in] dir The direction of the cursor
This can beNULL
.[in] ctype The type of the cursor
- Returns:
- The line number of the char on success,
otherwise-1
on error
Eina_Bool evas_textblock_cursor_is_format | ( | const Evas_Textblock_Cursor * | cur | ) |
Checks whether the cursor points to a format.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to check
- Returns:
- EINA_TRUE if the cursor points to a format,
otherwise EINA_FALSE if the cursor does not point to a format
void evas_textblock_cursor_line_char_first | ( | Evas_Textblock_Cursor * | cur | ) |
Moves the cursor to the start of the current line.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to move
void evas_textblock_cursor_line_char_last | ( | Evas_Textblock_Cursor * | cur | ) |
Moves the cursor to the end of the current line.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to move
int evas_textblock_cursor_line_coord_set | ( | Evas_Textblock_Cursor * | cur, |
Evas_Coord | y | ||
) |
Sets the cursor position according to the y coordinate.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cur to be set [in] y The y coordinate to set
- Returns:
- The line number found,
otherwise-1
on error
int evas_textblock_cursor_line_geometry_get | ( | const Evas_Textblock_Cursor * | cur, |
Evas_Coord * | cx, | ||
Evas_Coord * | cy, | ||
Evas_Coord * | cw, | ||
Evas_Coord * | ch | ||
) |
Gets the geometry of the line at cur.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The position of the line [out] cx The x coordinate of the line [out] cy The y coordinate of the line [out] cw The width of the line [out] ch The height of the line
- Returns:
- The line number of the line,
otherwise-1
on error
Eina_Bool evas_textblock_cursor_line_set | ( | Evas_Textblock_Cursor * | cur, |
int | line | ||
) |
Moves the cursor to the start of the line passed.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor [in] line The line number
- Returns:
- EINA_TRUE if the cursor is moved successfully,
otherwise EINA_FALSE on error
Moves the cursor to the first char in the node the cursor is pointing on.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to move
Moves the cursor to the last char in a text node.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to move
void evas_textblock_cursor_paragraph_first | ( | Evas_Textblock_Cursor * | cur | ) |
Sets the cursor to the start of the first text node.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to update
void evas_textblock_cursor_paragraph_last | ( | Evas_Textblock_Cursor * | cur | ) |
Sets the cursor to the end of the last text node.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to set
Advances to the start of the next text node.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to update
- Returns:
- EINA_TRUE if the cursor advances a paragraph,
otherwise EINA_FALSE
Goes to the end of the previous text node.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to update
- Returns:
- EINA_TRUE if the cursor goes to the end of the previous paragraph,
otherwise EINA_FALSE
const char* evas_textblock_cursor_paragraph_text_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Gets the text of the paragraph cur points to.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor pointing to the paragraph
- Returns:
- The text in markup,
otherwiseNULL
on error
int evas_textblock_cursor_paragraph_text_length_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Gets the length of the paragraph.
- Since :
- 2.3.1
- Remarks:
- This is cheaper that the eina_unicode_strlen().
- Parameters:
-
[in] cur The position of the paragraph
- Returns:
- The length of the paragraph on success,
otherwise-1
on error
int evas_textblock_cursor_pen_geometry_get | ( | const Evas_Textblock_Cursor * | cur, |
Evas_Coord * | cpen_x, | ||
Evas_Coord * | cy, | ||
Evas_Coord * | cadv, | ||
Evas_Coord * | ch | ||
) |
Gets the geometry of the pen at cur.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The position of the char [out] cpen_x The pen_x of the char [out] cy The y of the char [out] cadv The adv of the char [out] ch The h of the char
- Returns:
- The line number of the char,
otherwise-1
on error
int evas_textblock_cursor_pos_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Gets the current cursor position.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor
- Returns:
- The cursor position,
otherwise-1
on error
void evas_textblock_cursor_pos_set | ( | Evas_Textblock_Cursor * | cur, |
int | pos | ||
) |
Sets the cursor position.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to be set [in] pos The position to set
void evas_textblock_cursor_range_delete | ( | Evas_Textblock_Cursor * | cur1, |
Evas_Textblock_Cursor * | cur2 | ||
) |
Deletes the range between cur1 and cur2.
- Since :
- 2.3.1
- Parameters:
-
[in] cur1 Starting point of the range [in] cur2 Ending point of the range
Eina_List* evas_textblock_cursor_range_formats_get | ( | const Evas_Textblock_Cursor * | cur1, |
const Evas_Textblock_Cursor * | cur2 | ||
) |
Gets the format nodes in the range between cur1 and cur2.
- Since (EFL) :
- 1.1
- Since :
- 2.3.1
- Parameters:
-
[in] cur1 The start of the range [in] cur2 The end of the range
- Returns:
- The format nodes in the range
You have to free it.
Eina_List* evas_textblock_cursor_range_geometry_get | ( | const Evas_Textblock_Cursor * | cur1, |
const Evas_Textblock_Cursor * | cur2 | ||
) |
Gets the geometry of a range.
- Since :
- 2.3.1
- Parameters:
-
[in] cur1 The start of the range [in] cur2 The end of the range
- Returns:
- A list of rectangles representing the geometry of the range
char* evas_textblock_cursor_range_text_get | ( | const Evas_Textblock_Cursor * | cur1, |
const Evas_Textblock_Cursor * | cur2, | ||
Evas_Textblock_Text_Type | format | ||
) |
Gets the text in the range between cur1 and cur2.
- Since :
- 2.3.1
- Parameters:
-
[in] cur1 The start of the range [in] cur2 The end of the range [in] format The format in which to return the text
Markup - in textblock markup. Plain - UTF8.
- Returns:
- The text in the range
- See also:
- elm_entry_markup_to_utf8()
void evas_textblock_cursor_set_at_format | ( | Evas_Textblock_Cursor * | cur, |
const Evas_Object_Textblock_Node_Format * | n | ||
) |
Sets the cursor to point to the place where format points to.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to update [in] n The format node to update according
- Deprecated:
- Duplicate of evas_textblock_cursor_at_format_set
int evas_textblock_cursor_text_append | ( | Evas_Textblock_Cursor * | cur, |
const char * | text | ||
) |
Adds text to the current cursor position and sets the cursor to *before* the start of the text just added.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to the position to add text at [in] text The text to add
- Returns:
- The length of the text added
- See also:
- evas_textblock_cursor_text_prepend()
int evas_textblock_cursor_text_prepend | ( | Evas_Textblock_Cursor * | cur, |
const char * | text | ||
) |
Adds text to the current cursor position and sets the cursor to *after* the start of the text just added.
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to the position to add text at [in] text The text to add
- Returns:
- The length of the text added
- See also:
- evas_textblock_cursor_text_append()
Eina_Bool evas_textblock_cursor_visible_range_get | ( | Evas_Textblock_Cursor * | start, |
Evas_Textblock_Cursor * | end | ||
) |
Gets the currently visible range.
- Since (EFL) :
- 1.1
- Since :
- 2.3.1
- Parameters:
-
[in] start The start of the range [in] end The end of the range
- Returns:
- EINA_TRUE if the range is obtained successfully,
otherwise EINA_FALSE on failure
Moves the cursor to the end of the word under the cursor.
- Since (EFL) :
- 1.2
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to move
- Returns:
- EINA_TRUE if the cursor is moved successfully,
otherwise EINA_FALSE on failure
Moves the cursor to the start of the word under the cursor.
- Since (EFL) :
- 1.2
- Since :
- 2.3.1
- Parameters:
-
[in] cur The cursor to move
- Returns:
- EINA_TRUE if the cursor is moved successfully,
otherwise EINA_FALSE on failure
const char* evas_textblock_escape_string_get | ( | const char * | escape | ) |
Gets the unescaped version of escape.
- Since :
- 2.3.1
- Parameters:
-
[in] escape The string to be escaped
- Returns:
- The unescaped version of escape
const char* evas_textblock_escape_string_range_get | ( | const char * | escape_start, |
const char * | escape_end | ||
) |
Gets the unescaped version of the string between start and end.
- Since :
- 2.3.1
- Parameters:
-
[in] escape_start The start of the string [in] escape_end The end of the string
- Returns:
- The unescaped version of the range
const Evas_Object_Textblock_Node_Format* evas_textblock_node_format_first_get | ( | const Evas_Object * | obj | ) |
Gets the first format node.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The evas object
This must not beNULL
.
- Returns:
- The first format node,
otherwiseNULL
if there is no first format node
const Evas_Object_Textblock_Node_Format* evas_textblock_node_format_last_get | ( | const Evas_Object * | obj | ) |
Gets the last format node.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The evas textblock
This must not beNULL
.
- Returns:
- The last format node,
otherwiseNULL
if there is no last format node
const Eina_List* evas_textblock_node_format_list_get | ( | const Evas_Object * | obj, |
const char * | anchor | ||
) |
Gets the the list format node corresponding to anchor.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The evas object
This must not beNULL
.[in] anchor The anchor name to get
- Returns:
- The list format node corresponding to the anchor,
otherwiseNULL
if there is no list format node
const Evas_Object_Textblock_Node_Format* evas_textblock_node_format_next_get | ( | const Evas_Object_Textblock_Node_Format * | n | ) |
Gets the next format node (after n).
- Since :
- 2.3.1
- Parameters:
-
[in] n The current format node
This must not beNULL
.
- Returns:
- The next format node,
otherwiseNULL
if there is no next format node
const Evas_Object_Textblock_Node_Format* evas_textblock_node_format_prev_get | ( | const Evas_Object_Textblock_Node_Format * | n | ) |
Gets the previous format node (after n).
- Since :
- 2.3.1
- Parameters:
-
[in] n The current format node
This is must not beNULL
.
- Returns:
- The previous format node,
otherwiseNULL
if there is no previous format node
void evas_textblock_node_format_remove_pair | ( | Evas_Object * | obj, |
Evas_Object_Textblock_Node_Format * | n | ||
) |
Removes a format node and its match.
That is it removes a <tag> </tag> pair.
- Since :
- 2.3.1
- Remarks:
- Assumes that the node is the first part of <tag>. This does not work if n is a closing tag.
- Parameters:
-
[in] obj The Evas object of the textblock
This must not beNULL
.[in] n The current format node
This must not beNULL
.
const char* evas_textblock_node_format_text_get | ( | const Evas_Object_Textblock_Node_Format * | fnode | ) |
Gets the text format representation of the format node.
- Since :
- 2.3.1
- Parameters:
-
[in] fnode The format node
- Returns:
- The textual format of the format node
const char* evas_textblock_string_escape_get | ( | const char * | string, |
int * | len_ret | ||
) |
Gets the escaped version of the string.
- Since :
- 2.3.1
- Parameters:
-
[in] string The string to escape [out] len_ret The len of the part of the string that is used
- Returns:
- The escaped string
void evas_textblock_style_free | ( | Evas_Textblock_Style * | ts | ) |
Destroys a textblock style.
- Since :
- 2.3.1
- Parameters:
-
[in] ts The textblock style to free
const char* evas_textblock_style_get | ( | const Evas_Textblock_Style * | ts | ) |
Gets the text of the style ts.
- Since :
- 2.3.1
- Parameters:
-
[in] ts The style to get the text
- Returns:
- The text of the style,
otherwiseNULL
on error
Evas_Textblock_Style* evas_textblock_style_new | ( | void | ) |
Creates a new textblock style.
- Since :
- 2.3.1
- Returns:
- The new textblock style
void evas_textblock_style_set | ( | Evas_Textblock_Style * | ts, |
const char * | text | ||
) |
Sets the style ts to the style passed as text by text.
This function expects a string consisting of many (or none) tag='format' pairs.
- Since :
- 2.3.1
- Parameters:
-
[in] ts The style to set [in] text The text to parse
This should be NOT NULL.
char* evas_textblock_text_markup_to_utf8 | ( | const Evas_Object * | obj, |
const char * | text | ||
) |
Gets the plain version of the markup.
This function works as if you set the markup to a textblock and then retrieve the plain version of the text. That is:
and <
> is replaced with
, &...; with the actual char and so on.
- Since (EFL) :
- 1.2
- Since :
- 2.3.1
- Parameters:
-
[in] obj The textblock object to work with
IfNULL
, it tries the default.[in] text The markup text
IfNULL
, it returnsNULL
.
- Returns:
- An allocated plain text version of the markup
char* evas_textblock_text_utf8_to_markup | ( | const Evas_Object * | obj, |
const char * | text | ||
) |
Gets the markup version of the plain text.
This function replaces \n -> <br/> \t -> <tab/> and so on. This is generally needed before you pass plain text to be set in a textblock.
- Since (EFL) :
- 1.2
- Since :
- 2.3.1
- Parameters:
-
[in] obj The textblock object to work with
IfNULL
, it just does the default behaviour, i.e with no extra object information.[in] text The markup text
IfNULL
, it returnsNULL
.
- Returns:
- An allocated plain text version of the markup