Macros | Typedefs | Enumerations | Functions
Textblock Object Functions

Functions used to create and manipulate textblock objects. More...

Macros

#define TEXTBLOCK_FIT_MODE_NONE   0x0000
 
#define TEXTBLOCK_FIT_MODE_WIDTH   0x0001
 
#define TEXTBLOCK_FIT_MODE_HEIGHT   0x0002
 
#define TEXTBLOCK_FIT_MODE_ALL   0x0003
 
#define EVAS_ERROR_SUCCESS   0x0000
 
#define EVAS_ERROR_INVALID_PARAM   0x0001
 
#define EVAS_ERROR_NO_MEMORY   0x0002
 
#define EVAS_ERROR_INVALID_OPERATION   0x0003
 

Typedefs

typedef Eo Evas_Textblock
 
typedef struct _Efl_Canvas_Textblock_Style Evas_Textblock_Style
 A textblock style object. More...
 
typedef struct _Efl_Text_Cursor_Handle Evas_Textblock_Cursor
 A textblock cursor object, used to maipulate the cursor of an evas textblock. More...
 
typedef struct _Evas_Textblock_Node_Format Evas_Object_Textblock_Node_Format
 A format node. More...
 
typedef struct _Evas_Textblock_Node_Format Evas_Textblock_Node_Format
 
typedef Eina_Rectangle Evas_Textblock_Rectangle
 General-purpose rectangle that represents some geometry in this object.
 
typedef enum _Evas_Textblock_Text_Type Evas_Textblock_Text_Type
 Text type for evas textblock.
 
typedef enum _Evas_Textblock_Cursor_Type Evas_Textblock_Cursor_Type
 Cursor type for evas textblock.
 
typedef struct _Evas_Textblock_Node_Format Evas_Textblock_Node_Format
 A format node. More...
 

Enumerations

enum  _Evas_Textblock_Text_Type {
  EVAS_TEXTBLOCK_TEXT_RAW ,
  EVAS_TEXTBLOCK_TEXT_PLAIN ,
  EVAS_TEXTBLOCK_TEXT_MARKUP
}
 Text type for evas textblock. More...
 
enum  _Evas_Textblock_Cursor_Type {
  EVAS_TEXTBLOCK_CURSOR_UNDER ,
  EVAS_TEXTBLOCK_CURSOR_BEFORE
}
 Cursor type for evas textblock. More...
 

Functions

EVAS_API Eina_Bool evas_object_textblock_visible_range_get (Efl_Canvas_Textblock *obj, Efl_Text_Cursor_Handle *start, Efl_Text_Cursor_Handle *end)
 Returns the currently visible range. More...
 
EVAS_API void evas_object_textblock_style_insets_get (const Efl_Canvas_Textblock *obj, int *left, int *right, int *top, int *bottom)
 Gets the left, right, top and bottom insets of the text. More...
 
EVAS_API void evas_object_textblock_bidi_delimiters_set (Efl_Canvas_Textblock *obj, const char *delim)
 BiDi delimiters are used for in-paragraph separation of bidi segments. More...
 
EVAS_API const char * evas_object_textblock_bidi_delimiters_get (const Efl_Canvas_Textblock *obj)
 BiDi delimiters are used for in-paragraph separation of bidi segments. More...
 
EVAS_API void evas_object_textblock_legacy_newline_set (Efl_Canvas_Textblock *obj, Eina_Bool mode)
 When true, newline character will behave as a paragraph separator. More...
 
EVAS_API Eina_Bool evas_object_textblock_legacy_newline_get (const Efl_Canvas_Textblock *obj)
 When true, newline character will behave as a paragraph separator. More...
 
EVAS_API void evas_object_textblock_size_formatted_get (const Efl_Canvas_Textblock *obj, int *width, int *height)
 The formatted width and height. More...
 
EVAS_API void evas_object_textblock_size_native_get (const Efl_Canvas_Textblock *obj, int *width, int *height)
 The native width and height. More...
 
EVAS_API Eina_Bool evas_object_textblock_obstacle_add (Efl_Canvas_Textblock *obj, Efl_Canvas_Object *eo_obs)
 Add obstacle evas object eo_obs to be observed during layout of text. More...
 
EVAS_API Eina_Bool evas_object_textblock_obstacle_del (Efl_Canvas_Textblock *obj, Efl_Canvas_Object *eo_obs)
 Removes eo_obs from observation during text layout. More...
 
EVAS_API void evas_object_textblock_obstacles_update (Efl_Canvas_Textblock *obj)
 Triggers for relayout due to obstacles' state change. More...
 
EVAS_API const char * evas_textblock_escape_string_get (const char *escape)
 Returns the unescaped version of escape. More...
 
EVAS_API const char * evas_textblock_string_escape_get (const char *string, int *len_ret)
 Returns the escaped version of the string. More...
 
EVAS_API const char * evas_textblock_escape_string_range_get (const char *escape_start, const char *escape_end)
 Return the unescaped version of the string between start and end. More...
 
EVAS_API Evas_Textblock_Styleevas_textblock_style_new (void)
 Creates a new textblock style. More...
 
EVAS_API void evas_textblock_style_free (Evas_Textblock_Style *ts)
 Destroys a textblock style. More...
 
EVAS_API void evas_textblock_style_set (Evas_Textblock_Style *ts, const char *text)
 Sets the style ts to the style passed as text by text. More...
 
EVAS_API const char * evas_textblock_style_get (const Evas_Textblock_Style *ts)
 Return the text of the style ts. More...
 
EVAS_API const Evas_Object_Textblock_Node_Formatevas_textblock_node_format_next_get (const Evas_Object_Textblock_Node_Format *n)
 Returns the next format node (after n) More...
 
EVAS_API const Evas_Object_Textblock_Node_Formatevas_textblock_node_format_prev_get (const Evas_Object_Textblock_Node_Format *n)
 Returns the prev format node (after n) More...
 
EVAS_API 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. More...
 
EVAS_API const Evas_Object_Textblock_Node_Formatevas_textblock_cursor_format_get (const Evas_Textblock_Cursor *cur)
 Return the format node at the position pointed by cur. More...
 
EVAS_API const char * evas_textblock_node_format_text_get (const Evas_Object_Textblock_Node_Format *fnode)
 Get the text format representation of the format node. More...
 
EVAS_API void evas_textblock_cursor_at_format_set (Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt)
 Set the cursor to point to the position of fmt. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_format_is_visible_get (const Evas_Textblock_Cursor *cur)
 Check if the current cursor position is a visible format. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_format_next (Evas_Textblock_Cursor *cur)
 Advances to the next format node. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_format_prev (Evas_Textblock_Cursor *cur)
 Advances to the previous format node. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_is_format (const Evas_Textblock_Cursor *cur)
 Returns true if the cursor points to a format. More...
 
EVAS_API int evas_textblock_cursor_pos_get (const Evas_Textblock_Cursor *cur)
 Return the current cursor pos. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_line_set (Evas_Textblock_Cursor *cur, int line)
 Go to the start of the line passed. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_format_append (Evas_Textblock_Cursor *cur, const char *format)
 Adds format to the current cursor position. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_format_prepend (Evas_Textblock_Cursor *cur, const char *format)
 Adds format to the current cursor position. More...
 
EVAS_API void evas_textblock_cursor_range_delete (Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2)
 Delete the range between cur1 and cur2. More...
 
EVAS_API const char * evas_textblock_cursor_paragraph_text_get (const Evas_Textblock_Cursor *cur)
 Return the text of the paragraph cur points to - returns the text in markup. More...
 
EVAS_API int evas_textblock_cursor_paragraph_text_length_get (const Evas_Textblock_Cursor *cur)
 Return the length of the paragraph, cheaper the eina_unicode_strlen() More...
 
EVAS_API Eina_Bool evas_textblock_cursor_visible_range_get (Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end)
 Return the currently visible range. More...
 
EVAS_API Eina_Listevas_textblock_cursor_range_formats_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
 Return the format nodes in the range between cur1 and cur2. More...
 
EVAS_API char * evas_textblock_cursor_range_text_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format)
 Return the text in the range between cur1 and cur2. More...
 
EVAS_API char * evas_textblock_cursor_content_get (const Evas_Textblock_Cursor *cur)
 Return the content of the cursor. More...
 
EVAS_API 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)
 Returns the geometry of two cursors ("split cursor"), if logical cursor is between LTR/RTL text, also considering paragraph direction. More...
 
EVAS_API 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)
 Returns the geometry of the cursor. More...
 
EVAS_API int evas_textblock_cursor_char_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
 Returns the geometry of the char at cur. More...
 
EVAS_API 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)
 Returns the geometry of the pen at cur. More...
 
EVAS_API int evas_textblock_cursor_line_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
 Returns the geometry of the line at cur. More...
 
EVAS_API int evas_textblock_cursor_line_coord_set (Evas_Textblock_Cursor *cur, Evas_Coord y)
 Set the cursor position according to the y coord. More...
 
EVAS_API Eina_Listevas_textblock_cursor_range_geometry_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
 Get the geometry of a range. More...
 
EVAS_API Eina_Iteratorevas_textblock_cursor_range_simple_geometry_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
 Get the simple geometry of a range. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_format_item_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
 
EVAS_API Eina_Bool evas_textblock_cursor_eol_get (const Evas_Textblock_Cursor *cur)
 Checks if the cursor points to the end of the line. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_char_prev (Evas_Textblock_Cursor *obj)
 Advances the cursor one char backwards. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_char_next (Evas_Textblock_Cursor *obj)
 Advances the cursor one char forward. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_cluster_prev (Evas_Textblock_Cursor *obj)
 Advances the cursor one grapheme cluster backwards. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_cluster_next (Evas_Textblock_Cursor *obj)
 Advances the cursor one grapheme cluster forward. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_paragraph_next (Evas_Textblock_Cursor *obj)
 Advances to the start of the next text node. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_paragraph_prev (Evas_Textblock_Cursor *obj)
 Advances to the end of the previous text node. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_word_start (Evas_Textblock_Cursor *obj)
 Moves the cursor to the start of the word under the cursor. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_word_end (Evas_Textblock_Cursor *obj)
 Moves the cursor to the end of the word under the cursor. More...
 
EVAS_API Evas_Objectevas_object_textblock_add (Evas *e)
 Adds a textblock to the given evas. More...
 
EVAS_API char * evas_textblock_text_markup_to_utf8 (const Evas_Object *obj, const char *text)
 Return the plain version of the markup. More...
 
EVAS_API char * evas_textblock_text_utf8_to_markup (const Evas_Object *obj, const char *text)
 Return the markup version of the plain text. More...
 
EVAS_API void evas_object_textblock_clear (Evas_Object *obj)
 Clear the textblock object. More...
 
EVAS_API void evas_object_textblock_text_markup_set (Evas_Object *obj, const char *text)
 Sets given text as markup for the textblock object. More...
 
EVAS_API const char * evas_object_textblock_text_markup_get (Evas_Object *obj)
 Gets the current markup text of the textblock object. More...
 
EVAS_API void evas_object_textblock_text_markup_prepend (Evas_Textblock_Cursor *cur, const char *text)
 Prepends markup to the cursor cur. More...
 
EVAS_API void evas_object_textblock_style_set (Evas_Object *obj, const Evas_Textblock_Style *ts)
 Sets object's style to given style. More...
 
EVAS_API Evas_Textblock_Styleevas_object_textblock_style_get (const Evas_Object *obj)
 Gets the object's current style. More...
 
EVAS_API void evas_object_textblock_style_user_push (Evas_Object *obj, Evas_Textblock_Style *ts)
 Pushes ts to the top of the user style stack. More...
 
EVAS_API const Evas_Textblock_Styleevas_object_textblock_style_user_peek (const Evas_Object *obj)
 Peeks at the user-styles stack. More...
 
EVAS_API void evas_object_textblock_style_user_pop (Evas_Object *obj)
 Removes the style at the top of the user-style stack. More...
 
EVAS_API const Evas_Object_Textblock_Node_Formatevas_textblock_node_format_first_get (Evas_Object *obj)
 Gets the first format node. More...
 
EVAS_API const Evas_Object_Textblock_Node_Formatevas_textblock_node_format_last_get (Evas_Object *obj)
 Gets the last format node. More...
 
EVAS_API const Eina_Listevas_textblock_node_format_list_get (const Evas_Object *obj, const char *anchor)
 Gets a list of format nodes that match given format. More...
 
EVAS_API void evas_textblock_node_format_remove_pair (Evas_Object *obj, Evas_Object_Textblock_Node_Format *n)
 Removes format node and its matching format node. More...
 
EVAS_API 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 the line specified by its number. More...
 
EVAS_API void evas_textblock_cursor_copy (const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest)
 Make cur_dest point to the same place as cur. More...
 
EVAS_API Evas_Textblock_Cursorevas_object_textblock_cursor_new (const Evas_Object *obj)
 Create a new cursor, associate it to the obj and init it to point to the start of the textblock. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_char_coord_set (Evas_Textblock_Cursor *obj, Evas_Coord x, Evas_Coord y)
 Sets the position of the cursor according to the X and Y coordinates. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_cluster_coord_set (Evas_Textblock_Cursor *obj, Evas_Coord x, Evas_Coord y)
 Sets the position of the cursor according to the X and Y coordinates and grapheme clusters of text. More...
 
EVAS_API void evas_textblock_cursor_free (Evas_Textblock_Cursor *cur)
 Free the cursor and unassociate it from the object. More...
 
EVAS_API int evas_textblock_cursor_text_append (Evas_Textblock_Cursor *cur, const char *text)
 Adds text to the current cursor position and set the cursor to before the start of the text just added. More...
 
EVAS_API int evas_textblock_cursor_text_prepend (Evas_Textblock_Cursor *cur, const char *text)
 Adds text to the current cursor position and set the cursor to after the start of the text just added. More...
 
EVAS_API void evas_object_textblock_replace_char_set (Evas_Object *obj, const char *ch)
 The "replacement character" to use for the given textblock object. More...
 
EVAS_API const char * evas_object_textblock_replace_char_get (const Evas_Object *obj)
 The "replacement character" to use for the given textblock object. More...
 
EVAS_API void evas_object_textblock_valign_set (Evas_Object *obj, double align)
 The vertical alignment of text within the textblock object as a whole. More...
 
EVAS_API double evas_object_textblock_valign_get (const Evas_Object *obj)
 The vertical alignment of text within the textblock object as a whole. More...
 
EVAS_API void evas_textblock_cursor_paragraph_first (Evas_Textblock_Cursor *cur)
 Sets the cursor to the start of the first text node. More...
 
EVAS_API void evas_textblock_cursor_paragraph_last (Evas_Textblock_Cursor *cur)
 sets the cursor to the end of the last text node. More...
 
EVAS_API int evas_textblock_cursor_compare (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
 Compare two cursors. More...
 
EVAS_API Eina_Bool evas_textblock_cursor_equal (const Evas_Textblock_Cursor *obj, const Evas_Textblock_Cursor *cur)
 Checks if two cursors are equal. More...
 
EVAS_API void evas_textblock_cursor_line_char_first (Evas_Textblock_Cursor *cur)
 Go to the start of the current line. More...
 
EVAS_API void evas_textblock_cursor_line_char_last (Evas_Textblock_Cursor *cur)
 Go to the end of the current line. More...
 
EVAS_API void evas_textblock_cursor_pos_set (Evas_Textblock_Cursor *cur, int _pos)
 Set the cursor pos. More...
 
EVAS_API void evas_textblock_cursor_paragraph_char_first (Evas_Textblock_Cursor *cur)
 Go to the first char in the node the cursor is pointing on. More...
 
EVAS_API void evas_textblock_cursor_paragraph_char_last (Evas_Textblock_Cursor *cur)
 Go to the last char in a text node. More...
 
EVAS_API void evas_textblock_cursor_char_delete (Evas_Textblock_Cursor *cur)
 Deletes a single character from position pointed by given cursor. More...
 
EVAS_API Evas_Textblock_Cursorevas_object_textblock_cursor_get (const Evas_Object *obj)
 Get the object's main cursor.
 
EVAS_API int evas_textblock_fit_options_get (const Evas_Object *obj, unsigned int *p_options)
 Get the object's content fit options. More...
 
EVAS_API int evas_textblock_fit_options_set (Evas_Object *obj, unsigned int options)
 Set the object's content fit options. More...
 
EVAS_API int evas_textblock_fit_size_range_get (const Evas_Object *obj, unsigned int *p_min_font_size, unsigned int *p_max_font_size)
 Get the object's max and min font sizes used for fitting content. More...
 
EVAS_API int evas_textblock_fit_size_range_set (Evas_Object *obj, unsigned int min_font_size, unsigned int max_font_size)
 Set the object's max and min font sizes used for fitting content. More...
 
EVAS_API int evas_textblock_fit_step_size_get (const Evas_Object *obj, unsigned int *p_step_size)
 Get the object's fitting step size when trying fonts between min font size and max font size. More...
 
EVAS_API int evas_textblock_fit_step_size_set (Evas_Object *obj, unsigned int step_size)
 Set the object's fitting step size when trying fonts between min font size and max font size. More...
 
EVAS_API int evas_textblock_fit_size_array_get (const Evas_Object *obj, unsigned int *p_size_array, size_t *p_size_array_len, size_t request_size_array)
 Get copy of the object's fitting font size array used internally. More...
 
EVAS_API int evas_textblock_fit_size_array_set (Evas_Object *obj, const unsigned int *p_size_array, size_t size_array_len)
 Set the object's fitting font size array that will be used internally Changing fitting step_size,min_font_size,max_font size will generate new array Setting array will make content fit algorithm ignore step_size,min_font_size,max_font size, and use passed array only. More...
 
EVAS_API int evas_textblock_fit_font_size_get (Evas_Object *obj)
 Get the object fitting font size that is currently used. More...
 

Detailed Description

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 will be 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's a good place to learn from, but I think this document is more than enough, if it's not, please contact me and I'll update it.

Introduction

The textblock objects 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's advised to use the named alternatives instead.

Textblock Object Cursors

A textblock Cursor is 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 obj and you can't 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'll still point to it even after you change the whole object completely (as long as the char was not deleted), this is not possible without updating, because as mentioned, each cursor holds a character position. There are many functions that handle cursors, just check out the evas_textblock_cursor* functions. For creation and deletion of cursors check out:

See also
evas_object_textblock_cursor_new()
evas_textblock_cursor_free()
Note
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 splitted 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, i.e formats that occupy space, for example: newlines, tabs, items and etc. 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 don't 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, take a look at 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 .

For more details see Evas Textblock Style Options

Textblock supports the following formats:

Warning
We don't guarantee any proper results if you create a Textblock object without setting the evas engine.

Typedef Documentation

◆ Evas_Textblock_Style

◆ Evas_Textblock_Cursor

A textblock cursor object, used to maipulate the cursor of an evas textblock.

See also
evas_object_textblock_cursor_new

◆ Evas_Object_Textblock_Node_Format

A format node.

XXX: Adapter for legacy.

◆ Evas_Textblock_Node_Format

A format node.

XXX: Adapter for legacy.

Enumeration Type Documentation

◆ _Evas_Textblock_Text_Type

Text type for evas textblock.

Enumerator
EVAS_TEXTBLOCK_TEXT_RAW 

textblock text of type raw

EVAS_TEXTBLOCK_TEXT_PLAIN 

textblock text of type plain

EVAS_TEXTBLOCK_TEXT_MARKUP 

textblock text of type markup

◆ _Evas_Textblock_Cursor_Type

Cursor type for evas textblock.

Enumerator
EVAS_TEXTBLOCK_CURSOR_UNDER 

cursor type is under

EVAS_TEXTBLOCK_CURSOR_BEFORE 

cursor type is before

Function Documentation

◆ evas_object_textblock_visible_range_get()

EVAS_API Eina_Bool evas_object_textblock_visible_range_get ( Efl_Canvas_Textblock *  obj,
Efl_Text_Cursor_Handle start,
Efl_Text_Cursor_Handle end 
)

Returns the currently visible range.

The given start and end cursor act like out-variables here, as they are set to the positions of the start and the end of the visible range in the text, respectively.

Parameters
[in]objThe object.
[in]startRange start position
[in]endRange end position
Returns
true on success, false otherwise
Since
1.18

References evas_textblock_cursor_visible_range_get().

◆ evas_object_textblock_style_insets_get()

EVAS_API void evas_object_textblock_style_insets_get ( const Efl_Canvas_Textblock *  obj,
int *  left,
int *  right,
int *  top,
int *  bottom 
)

Gets the left, right, top and bottom insets of the text.

The inset is any applied padding on the text.

Parameters
[in]objThe object.
[out]leftThe left padding
[out]rightThe right padding
[out]topThe top padding
[out]bottomThe bottom padding
Since
1.18

◆ evas_object_textblock_bidi_delimiters_set()

EVAS_API void evas_object_textblock_bidi_delimiters_set ( Efl_Canvas_Textblock *  obj,
const char *  delim 
)

BiDi delimiters are used for in-paragraph separation of bidi segments.

This is useful, for example, in the recipient fields of e-mail clients where bidi oddities can occur when mixing RTL and LTR.

Parameters
[in]objThe object.
[in]delimA null terminated string of delimiters, e.g ",|" or null if empty
Since
1.18

◆ evas_object_textblock_bidi_delimiters_get()

EVAS_API const char * evas_object_textblock_bidi_delimiters_get ( const Efl_Canvas_Textblock *  obj)

BiDi delimiters are used for in-paragraph separation of bidi segments.

This is useful, for example, in the recipient fields of e-mail clients where bidi oddities can occur when mixing RTL and LTR.

Parameters
[in]objThe object.
Returns
A null terminated string of delimiters, e.g ",|" or null if empty
Since
1.18

◆ evas_object_textblock_legacy_newline_set()

EVAS_API void evas_object_textblock_legacy_newline_set ( Efl_Canvas_Textblock *  obj,
Eina_Bool  mode 
)

When true, newline character will behave as a paragraph separator.

Parameters
[in]objThe object.
[in]modetrue for legacy mode, false otherwise
Since
1.18

◆ evas_object_textblock_legacy_newline_get()

EVAS_API Eina_Bool evas_object_textblock_legacy_newline_get ( const Efl_Canvas_Textblock *  obj)

When true, newline character will behave as a paragraph separator.

Parameters
[in]objThe object.
Returns
true for legacy mode, false otherwise
Since
1.18

◆ evas_object_textblock_size_formatted_get()

EVAS_API void evas_object_textblock_size_formatted_get ( const Efl_Canvas_Textblock *  obj,
int *  width,
int *  height 
)

The formatted width and height.

This calculates the actual size after restricting the textblock to the current size of the object.

The main difference between this and evas_object_textblock_size_native_get is that the "native" function does not wrapping into account it just calculates the real width of the object if it was placed on an infinite canvas, while this function gives the size after wrapping according to the size restrictions of the object.

For example for a textblock containing the text: "You shall not pass!" with no margins or padding and assuming a monospace font and a size of 7x10 char widths (for simplicity) has a native size of 19x1 and a formatted size of 5x4.

Parameters
[in]objThe object.
[out]widthThe width of the object.
[out]heightThe height of the object.
Since
1.18

◆ evas_object_textblock_size_native_get()

EVAS_API void evas_object_textblock_size_native_get ( const Efl_Canvas_Textblock *  obj,
int *  width,
int *  height 
)

The native width and height.

This calculates the actual size without taking account the current size of the object.

The main difference between this and 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 was placed on an infinite canvas, while the "formatted" function gives the size after wrapping text according to the size restrictions of the object.

For example for a textblock containing the text: "You shall not pass!" with no margins or padding and assuming a monospace font and a size of 7x10 char widths (for simplicity) has a native size of 19x1 and a formatted size of 5x4.

Parameters
[in]objThe object.
[out]widthThe width returned.
[out]heightThe height returned.
Since
1.18

◆ evas_object_textblock_obstacle_add()

EVAS_API Eina_Bool evas_object_textblock_obstacle_add ( Efl_Canvas_Textblock *  obj,
Efl_Canvas_Object eo_obs 
)

Add obstacle evas object eo_obs to be observed during layout of text.

The textblock does the layout of the text according to the position of the obstacle.

Parameters
[in]objThe object.
[in]eo_obsObstacle object
Returns
true on success, false otherwise.
Since
1.18

◆ evas_object_textblock_obstacle_del()

EVAS_API Eina_Bool evas_object_textblock_obstacle_del ( Efl_Canvas_Textblock *  obj,
Efl_Canvas_Object eo_obs 
)

Removes eo_obs from observation during text layout.

Parameters
[in]objThe object.
[in]eo_obsObstacle object
Returns
true on success, false otherwise.
Since
1.18

◆ evas_object_textblock_obstacles_update()

EVAS_API void evas_object_textblock_obstacles_update ( Efl_Canvas_Textblock *  obj)

Triggers for relayout due to obstacles' state change.

The obstacles alone don't affect the layout, until this is called. Use this after doing changes (moving, positioning etc.) in the obstacles that you would like to be considered in the layout.

For example: if you have just repositioned the obstacles to differrent coordinates relative to the textblock, you need to call this so it will consider this new state and will relayout the text.

Parameters
[in]objThe object.
Since
1.18

◆ evas_textblock_escape_string_get()

EVAS_API const char * evas_textblock_escape_string_get ( const char *  escape)

Returns the unescaped version of escape.

Parameters
escapethe string to be escaped
Returns
the unescaped version of escape

◆ evas_textblock_string_escape_get()

EVAS_API const char * evas_textblock_string_escape_get ( const char *  string,
int *  len_ret 
)

Returns the escaped version of the string.

Parameters
stringto escape
len_retthe len of the part of the string that was used.
Returns
the escaped string.

◆ evas_textblock_escape_string_range_get()

EVAS_API const char * evas_textblock_escape_string_range_get ( const char *  escape_start,
const char *  escape_end 
)

Return the unescaped version of the string between start and end.

Parameters
escape_startthe start of the string.
escape_endthe end of the string.
Returns
the unescaped version of the range

Referenced by edje_object_part_text_escaped_set().

◆ evas_textblock_style_new()

EVAS_API Evas_Textblock_Style * evas_textblock_style_new ( void  )

Creates a new textblock style.

Returns
The new textblock style.

References EINA_TRUE.

Referenced by edje_object_part_text_style_user_push().

◆ evas_textblock_style_free()

EVAS_API void evas_textblock_style_free ( Evas_Textblock_Style ts)

Destroys a textblock style.

Parameters
tsThe textblock style to free.

Referenced by edje_edit_style_del(), and edje_object_part_text_style_user_push().

◆ evas_textblock_style_set()

EVAS_API void evas_textblock_style_set ( Evas_Textblock_Style ts,
const char *  text 
)

Sets the style ts to the style passed as text by text.

Expected a string consisting of many (or none) tag='format' pairs.

Parameters
tsthe style to set.
textthe text to parse - NOT NULL.
Returns
Returns no value.

References eina_inlist_append(), EINA_INLIST_GET, EINA_LIST_FOREACH, eina_strbuf_append_char(), eina_strbuf_append_length(), eina_strbuf_free(), eina_strbuf_new(), eina_strbuf_reset(), eina_strbuf_string_get(), eina_stringshare_add(), eina_stringshare_add_length(), _Evas_Object_Style_Tag_Base::replace, _Evas_Object_Style_Tag_Base::tag, _Evas_Object_Style_Tag::tag, and _Evas_Object_Style_Tag_Base::tag_len.

Referenced by edje_object_part_text_style_user_push().

◆ evas_textblock_style_get()

EVAS_API const char * evas_textblock_style_get ( const Evas_Textblock_Style ts)

Return the text of the style ts.

Parameters
tsthe style to get it's text.
Returns
the text of the style or null on error.

Referenced by edje_object_part_text_style_user_peek().

◆ evas_textblock_node_format_next_get()

EVAS_API const Evas_Object_Textblock_Node_Format * evas_textblock_node_format_next_get ( const Evas_Object_Textblock_Node_Format n)

Returns the next format node (after n)

Parameters
nthe current format node - not null.
Returns
Returns the next format node, may be null.

References EINA_INLIST_GET.

◆ evas_textblock_node_format_prev_get()

EVAS_API const Evas_Object_Textblock_Node_Format * evas_textblock_node_format_prev_get ( const Evas_Object_Textblock_Node_Format n)

Returns the prev format node (after n)

Parameters
nthe current format node - not null.
Returns
Returns the prev format node, may be null.

References EINA_INLIST_GET.

◆ evas_textblock_cursor_set_at_format()

EVAS_API 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.

Parameters
curthe cursor to update.
nthe format node to update according.
Deprecated:
duplicate of evas_textblock_cursor_at_format_set

References evas_textblock_cursor_at_format_set().

◆ evas_textblock_cursor_format_get()

EVAS_API const Evas_Object_Textblock_Node_Format * evas_textblock_cursor_format_get ( const Evas_Textblock_Cursor cur)

Return the format node at the position pointed by cur.

Parameters
curthe position to look at.
Returns
the format node if found, NULL otherwise.
See also
evas_textblock_cursor_format_is_visible_get()

Referenced by evas_textblock_cursor_content_get(), and evas_textblock_cursor_format_prev().

◆ evas_textblock_node_format_text_get()

EVAS_API const char * evas_textblock_node_format_text_get ( const Evas_Object_Textblock_Node_Format fnode)

Get the text format representation of the format node.

Parameters
fnodethe format node.
Returns
the textual format of the format node.

References _Evas_Textblock_Node_Format::opener, _Evas_Textblock_Node_Format::orig_format, and _Evas_Textblock_Node_Format::own_closer.

◆ evas_textblock_cursor_at_format_set()

EVAS_API void evas_textblock_cursor_at_format_set ( Evas_Textblock_Cursor cur,
const Evas_Object_Textblock_Node_Format fmt 
)

Set the cursor to point to the position of fmt.

Parameters
curthe cursor to update
fmtthe format to update according to.

Referenced by evas_textblock_cursor_set_at_format().

◆ evas_textblock_cursor_format_is_visible_get()

EVAS_API Eina_Bool evas_textblock_cursor_format_is_visible_get ( const Evas_Textblock_Cursor cur)

Check if the current cursor position is a visible format.

This way is more efficient than evas_textblock_cursor_format_get() to check for the existence of a visible format.

Parameters
curthe cursor to look at.
Returns
EINA_TRUE if the cursor points to a visible format, EINA_FALSE otherwise.
See also
evas_textblock_cursor_format_get()

Referenced by evas_textblock_cursor_content_get().

◆ evas_textblock_cursor_format_next()

EVAS_API Eina_Bool evas_textblock_cursor_format_next ( Evas_Textblock_Cursor cur)

Advances to the next format node.

Parameters
curthe cursor to be updated.
Returns
EINA_TRUE on success EINA_FALSE otherwise.

References EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, _Evas_Object_Textblock_Node_Text::format_node, and _Evas_Textblock_Node_Format::text_node.

◆ evas_textblock_cursor_format_prev()

EVAS_API Eina_Bool evas_textblock_cursor_format_prev ( Evas_Textblock_Cursor cur)

Advances to the previous format node.

Parameters
curthe cursor to update.
Returns
EINA_TRUE on success EINA_FALSE otherwise.

References EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, evas_textblock_cursor_format_get(), and _Evas_Textblock_Node_Format::text_node.

◆ evas_textblock_cursor_is_format()

EVAS_API Eina_Bool evas_textblock_cursor_is_format ( const Evas_Textblock_Cursor cur)

Returns true if the cursor points to a format.

Parameters
curthe cursor to check.
Returns
EINA_TRUE if a cursor points to a format EINA_FALSE otherwise.

◆ evas_textblock_cursor_pos_get()

EVAS_API int evas_textblock_cursor_pos_get ( const Evas_Textblock_Cursor cur)

Return the current cursor pos.

Parameters
curthe cursor to take the position from.
Returns
the position or -1 on error

References EINA_INLIST_GET, and eina_ustrbuf_length_get().

◆ evas_textblock_cursor_line_set()

EVAS_API Eina_Bool evas_textblock_cursor_line_set ( Evas_Textblock_Cursor cur,
int  line 
)

Go to the start of the line passed.

Parameters
curcursor to update.
linenumber to set.
Returns
EINA_TRUE on success, EINA_FALSE on error.

References EINA_FALSE, and EINA_TRUE.

Referenced by evas_textblock_cursor_line_coord_set().

◆ evas_textblock_cursor_format_append()

EVAS_API 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.

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
curthe cursor to where to add format at.
formatthe format to add.
Returns
Returns true if a visible format was added, false otherwise.
See also
evas_textblock_cursor_format_prepend() Check if the current cursor position points to the terminating null of the last paragraph. (shouldn't be allowed to point to the terminating null of any previous paragraph anyway.
Parameters
curthe cursor to look at.
Returns
EINA_TRUE if the cursor points to the terminating null, EINA_FALSE otherwise.

References EINA_FALSE.

◆ evas_textblock_cursor_format_prepend()

EVAS_API Eina_Bool evas_textblock_cursor_format_prepend ( 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. If the format is visible the cursor is advanced after it.

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
curthe cursor to where to add format at.
formatthe format to add.
Returns
Returns true if a visible format was added, false otherwise.
See also
evas_textblock_cursor_format_prepend()

◆ evas_textblock_cursor_range_delete()

EVAS_API void evas_textblock_cursor_range_delete ( Evas_Textblock_Cursor cur1,
Evas_Textblock_Cursor cur2 
)

Delete the range between cur1 and cur2.

Parameters
cur1one side of the range.
cur2the second side of the range
Returns
Returns no value.

References _Evas_Object_Textblock_Node_Text::dirty, EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, eina_ustrbuf_length_get(), eina_ustrbuf_remove(), evas_textblock_cursor_compare(), evas_textblock_cursor_copy(), and _Evas_Object_Textblock_Node_Text::unicode.

◆ evas_textblock_cursor_paragraph_text_get()

EVAS_API const char * evas_textblock_cursor_paragraph_text_get ( const Evas_Textblock_Cursor cur)

Return the text of the paragraph cur points to - returns the text in markup.

Parameters
curthe cursor pointing to the paragraph.
Returns
the text on success, NULL otherwise.

References evas_textblock_cursor_paragraph_char_first(), evas_textblock_cursor_paragraph_char_last(), EVAS_TEXTBLOCK_TEXT_MARKUP, and _Evas_Object_Textblock_Node_Text::utf8.

◆ evas_textblock_cursor_paragraph_text_length_get()

EVAS_API int evas_textblock_cursor_paragraph_text_length_get ( const Evas_Textblock_Cursor cur)

Return the length of the paragraph, cheaper the eina_unicode_strlen()

Parameters
curthe position of the paragraph.
Returns
the length of the paragraph on success, -1 otehrwise.

References EINA_INLIST_GET, eina_ustrbuf_length_get(), and _Evas_Object_Textblock_Node_Text::unicode.

◆ evas_textblock_cursor_visible_range_get()

EVAS_API Eina_Bool evas_textblock_cursor_visible_range_get ( Evas_Textblock_Cursor start,
Evas_Textblock_Cursor end 
)

Return the currently visible range.

Parameters
startthe start of the range.
endthe end of the range.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
Since
1.1

References EINA_FALSE, EINA_TRUE, EVAS_CANVAS_CLASS, evas_object_evas_get(), evas_textblock_cursor_line_char_last(), and evas_textblock_cursor_line_coord_set().

Referenced by evas_object_textblock_visible_range_get().

◆ evas_textblock_cursor_range_formats_get()

EVAS_API Eina_List * evas_textblock_cursor_range_formats_get ( const Evas_Textblock_Cursor cur1,
const Evas_Textblock_Cursor cur2 
)

Return the format nodes in the range between cur1 and cur2.

Parameters
cur1one side of the range.
cur2the other side of the range
Returns
the foramt nodes in the range. You have to free it.
Since
1.1

References EINA_INLIST_GET, eina_list_append(), evas_textblock_cursor_compare(), _Evas_Object_Textblock_Node_Text::format_node, and _Evas_Textblock_Node_Format::text_node.

◆ evas_textblock_cursor_range_text_get()

EVAS_API char * evas_textblock_cursor_range_text_get ( const Evas_Textblock_Cursor cur1,
const Evas_Textblock_Cursor cur2,
Evas_Textblock_Text_Type  format 
)

Return the text in the range between cur1 and cur2.

Parameters
cur1one side of the range.
cur2the other side of the range
formatThe form on which to return the text. Markup - in textblock markup. Plain - UTF8.
Returns
the text in the range
See also
elm_entry_markup_to_utf8()

◆ evas_textblock_cursor_content_get()

EVAS_API char * evas_textblock_cursor_content_get ( const Evas_Textblock_Cursor cur)

Return the content of the cursor.

Free the returned string pointer when done (if it is not NULL).

Parameters
curthe cursor
Returns
the text in the range, terminated by a nul byte (may be utf8).

References eina_strbuf_free(), eina_strbuf_new(), eina_strbuf_string_steal(), eina_unicode_unicode_to_utf8(), eina_ustrbuf_string_get(), evas_textblock_cursor_format_get(), evas_textblock_cursor_format_is_visible_get(), and _Evas_Object_Textblock_Node_Text::unicode.

◆ evas_textblock_cursor_geometry_bidi_get()

EVAS_API 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 
)

Returns the geometry of two cursors ("split cursor"), if logical cursor is between LTR/RTL text, also considering paragraph direction.

Upper cursor is shown for the text of the same direction as paragraph, lower cursor - for opposite.

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]curthe cursor.
[out]cxthe x of the cursor (or upper cursor)
[out]cythe y of the cursor (or upper cursor)
[out]cwthe width of the cursor (or upper cursor)
[out]chthe height of the cursor (or upper cursor)
[out]cx2the x of the lower cursor
[out]cy2the y of the lower cursor
[out]cw2the width of the lower cursor
[out]ch2the height of the lower cursor
[in]ctypethe type of the cursor.
Returns
EINA_TRUE for split cursor, EINA_FALSE otherwise
Since
1.8

References _EINA_INLIST_CONTAINER, EINA_FALSE, EINA_INLIST_GET, EINA_LIST_FOREACH, EINA_TRUE, evas_textblock_cursor_eol_get(), evas_textblock_cursor_geometry_get(), evas_textblock_cursor_pen_geometry_get(), and EVAS_TEXTBLOCK_CURSOR_UNDER.

◆ evas_textblock_cursor_geometry_get()

EVAS_API 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 
)

Returns the geometry of the cursor.

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's 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
curthe cursor.
cxthe x of the cursor
cythe y of the cursor
cwthe width of the cursor
chthe height of the cursor
dirthe direction of the cursor, can be NULL.
ctypethe type of the cursor.
Returns
line number of the char on success, -1 on error.

References EVAS_TEXTBLOCK_CURSOR_BEFORE, evas_textblock_cursor_pen_geometry_get(), and EVAS_TEXTBLOCK_CURSOR_UNDER.

Referenced by evas_textblock_cursor_geometry_bidi_get().

◆ evas_textblock_cursor_char_geometry_get()

EVAS_API int evas_textblock_cursor_char_geometry_get ( const Evas_Textblock_Cursor cur,
Evas_Coord cx,
Evas_Coord cy,
Evas_Coord cw,
Evas_Coord ch 
)

Returns the geometry of the char at cur.

Parameters
curthe position of the char.
cxthe x of the char.
cythe y of the char.
cwthe w of the char.
chthe h of the char.
Returns
line number of the char on success, -1 on error.

◆ evas_textblock_cursor_pen_geometry_get()

EVAS_API 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 
)

Returns the geometry of the pen at cur.

Parameters
curthe position of the char.
cpen_xthe pen_x of the char.
cythe y of the char.
cadvthe adv of the char.
chthe h of the char.
Returns
line number of the char on success, -1 on error.

Referenced by evas_textblock_cursor_geometry_bidi_get(), and evas_textblock_cursor_geometry_get().

◆ evas_textblock_cursor_line_geometry_get()

EVAS_API int evas_textblock_cursor_line_geometry_get ( const Evas_Textblock_Cursor cur,
Evas_Coord cx,
Evas_Coord cy,
Evas_Coord cw,
Evas_Coord ch 
)

Returns the geometry of the line at cur.

Parameters
curthe position of the line.
cxthe x of the line.
cythe y of the line.
cwthe width of the line.
chthe height of the line.
Returns
line number of the line on success, -1 on error.

◆ evas_textblock_cursor_line_coord_set()

EVAS_API int evas_textblock_cursor_line_coord_set ( Evas_Textblock_Cursor cur,
Evas_Coord  y 
)

Set the cursor position according to the y coord.

Parameters
curthe cur to be set.
ythe coord to set by.
Returns
the line number found, -1 on error.

References EINA_INLIST_FOREACH, EINA_INLIST_GET, evas_textblock_cursor_line_set(), evas_textblock_cursor_paragraph_first(), evas_textblock_cursor_paragraph_last(), and _Evas_Object_Textblock_Node_Text::par.

Referenced by evas_textblock_cursor_visible_range_get().

◆ evas_textblock_cursor_range_geometry_get()

EVAS_API Eina_List * evas_textblock_cursor_range_geometry_get ( const Evas_Textblock_Cursor cur1,
const Evas_Textblock_Cursor cur2 
)

Get the geometry of a range.

Parameters
cur1one side of the range.
cur2other side of the range.
Returns
a list of Rectangles representing the geometry of the range.

◆ evas_textblock_cursor_range_simple_geometry_get()

EVAS_API Eina_Iterator * evas_textblock_cursor_range_simple_geometry_get ( const Evas_Textblock_Cursor cur1,
const Evas_Textblock_Cursor cur2 
)

Get the simple geometry of a range.

The simple geometry is the geometry in which rectangles in middle lines of range are merged into one big rectangle.

Since
1.13
Parameters
cur1one side of the range.
cur2other side of the range.
Returns
an iterator of rectangles representing the geometry of the range.

References EINA_FALSE, eina_list_append(), eina_list_merge(), EINA_TRUE, evas_object_geometry_get(), evas_textblock_cursor_compare(), _Eina_Rectangle::h, _Eina_Rectangle::w, _Eina_Rectangle::x, and _Eina_Rectangle::y.

◆ evas_textblock_cursor_eol_get()

EVAS_API Eina_Bool evas_textblock_cursor_eol_get ( const Evas_Textblock_Cursor cur)

Checks if the cursor points to the end of the line.

Parameters
curthe cursor to check.
Returns
EINA_TRUE if true, EINA_FALSE otherwise.

References EINA_FALSE, EINA_TRUE, and evas_textblock_cursor_line_char_last().

Referenced by evas_textblock_cursor_geometry_bidi_get().

◆ evas_textblock_cursor_char_prev()

EVAS_API Eina_Bool evas_textblock_cursor_char_prev ( Evas_Textblock_Cursor obj)

Advances the cursor one char backwards.

Returns
true on success, false otherwise.

References EINA_FALSE.

◆ evas_textblock_cursor_char_next()

EVAS_API Eina_Bool evas_textblock_cursor_char_next ( Evas_Textblock_Cursor obj)

Advances the cursor one char forward.

Returns
true on success, false otherwise.

References EINA_FALSE.

◆ evas_textblock_cursor_cluster_prev()

EVAS_API Eina_Bool evas_textblock_cursor_cluster_prev ( Evas_Textblock_Cursor obj)

Advances the cursor one grapheme cluster backwards.

Returns
true on success, false otherwise.

References EINA_TRUE.

◆ evas_textblock_cursor_cluster_next()

EVAS_API Eina_Bool evas_textblock_cursor_cluster_next ( Evas_Textblock_Cursor obj)

Advances the cursor one grapheme cluster forward.

Returns
true on success, false otherwise.

References EINA_TRUE.

◆ evas_textblock_cursor_paragraph_next()

EVAS_API Eina_Bool evas_textblock_cursor_paragraph_next ( Evas_Textblock_Cursor obj)

Advances to the start of the next text node.

Returns
true if managed to advance, false otherwise

References EINA_FALSE.

◆ evas_textblock_cursor_paragraph_prev()

EVAS_API Eina_Bool evas_textblock_cursor_paragraph_prev ( Evas_Textblock_Cursor obj)

Advances to the end of the previous text node.

Returns
true if managed to advance, false otherwise

References EINA_FALSE.

◆ evas_textblock_cursor_word_start()

EVAS_API Eina_Bool evas_textblock_cursor_word_start ( Evas_Textblock_Cursor obj)

Moves the cursor to the start of the word under the cursor.

Returns
true on success, false otherwise

References EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, eina_ustrbuf_length_get(), eina_ustrbuf_string_get(), evas_textblock_cursor_word_start(), and _Evas_Object_Textblock_Node_Text::unicode.

Referenced by evas_textblock_cursor_word_start().

◆ evas_textblock_cursor_word_end()

EVAS_API Eina_Bool evas_textblock_cursor_word_end ( Evas_Textblock_Cursor obj)

Moves the cursor to the end of the word under the cursor.

Returns
true on success, false otherwise

References EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, eina_ustrbuf_length_get(), eina_ustrbuf_string_get(), evas_textblock_cursor_word_end(), and _Evas_Object_Textblock_Node_Text::unicode.

Referenced by evas_textblock_cursor_word_end().

◆ evas_object_textblock_add()

EVAS_API Evas_Object * evas_object_textblock_add ( Evas e)

Adds a textblock to the given evas.

Parameters
eThe given evas.
Returns
The new textblock object.

References EINA_FALSE, and EINA_TRUE.

◆ evas_textblock_text_markup_to_utf8()

EVAS_API char * evas_textblock_text_markup_to_utf8 ( const Evas_Object obj,
const char *  text 
)

Return the plain version of the markup.

Works as if you set the markup to a textblock and then retrieve the plain version of the text. i.e:
and <
> will be replaced with
, &...; with the actual char and etc.

Parameters
objThe textblock object to work with. (if NULL, tries the default).
textThe markup text (if NULL, return NULL).
Returns
An allocated plain text version of the markup.
Since
1.2

References eina_strbuf_append(), eina_strbuf_append_length(), eina_strbuf_free(), eina_strbuf_new(), eina_strbuf_string_steal(), ERR, and evas_object_textblock_style_get().

◆ evas_textblock_text_utf8_to_markup()

EVAS_API char * evas_textblock_text_utf8_to_markup ( const Evas_Object obj,
const char *  text 
)

Return the markup version of the plain text.

Replaces \n -> <br/> \t -> <tab/> and etc. Generally needed before you pass plain text to be set in a textblock.

Parameters
objthe textblock object to work with (if NULL, it just does the default behaviour, i.e with no extra object information).
textThe plain text (if NULL, return NULL).
Returns
An allocated markup version of the plain text.
Since
1.2

References eina_strbuf_free(), eina_strbuf_new(), and eina_strbuf_string_steal().

◆ evas_object_textblock_clear()

EVAS_API void evas_object_textblock_clear ( Evas_Object obj)

Clear the textblock object.

Note
Does NOT free the Evas object itself.
Parameters
objthe object to clear.
Returns
nothing.

References evas_textblock_cursor_paragraph_first(), and evas_textblock_cursor_text_append().

◆ evas_object_textblock_text_markup_set()

EVAS_API void evas_object_textblock_text_markup_set ( Evas_Object obj,
const char *  text 
)

Sets given text as markup for the textblock object.

Note
assumes text does not include the unicode object replacement char (0xFFFC)
Parameters
objthe textblock object.
textthe markup text to set.
Returns
Returns no value.

References EINA_SAFETY_ON_NULL_RETURN.

◆ evas_object_textblock_text_markup_get()

EVAS_API const char * evas_object_textblock_text_markup_get ( Evas_Object obj)

Gets the current markup text of the textblock object.

Parameters
objthe textblock object.
Returns
Returns the current markup text.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by edje_object_part_text_unescaped_get().

◆ evas_object_textblock_text_markup_prepend()

EVAS_API void evas_object_textblock_text_markup_prepend ( Evas_Textblock_Cursor cur,
const char *  text 
)

Prepends markup to the cursor cur.

Note
assumes text does not include the unicode object replacement char (0xFFFC)
Parameters
curthe cursor to prepend to.
textthe markup text to prepend.
Returns
Return no value.

References EINA_SAFETY_ON_NULL_RETURN.

◆ evas_object_textblock_style_set()

EVAS_API void evas_object_textblock_style_set ( Evas_Object obj,
const Evas_Textblock_Style ts 
)

Sets object's style to given style.

Parameters
objthe object we set the style on
tsthe style to set.
Returns
Returns no value.
See also
evas_textblock_style_user_push()

References EINA_SAFETY_ON_NULL_RETURN.

◆ evas_object_textblock_style_get()

EVAS_API Evas_Textblock_Style * evas_object_textblock_style_get ( const Evas_Object obj)

Gets the object's current style.

Parameters
objthe object to get the style from.
Returns
Returns the current active style.
See also
evas_textblock_style_user_peek()

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by evas_textblock_text_markup_to_utf8().

◆ evas_object_textblock_style_user_push()

EVAS_API 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.

The user style overrides the corresponding elements of the regular style. This is the proper way to do theme overrides in code.

Parameters
objthe object to push the style.
See also
also evas_textblock_style_set().
Since
1.2

References EINA_SAFETY_ON_NULL_RETURN.

Referenced by edje_object_part_text_style_user_push().

◆ evas_object_textblock_style_user_peek()

EVAS_API const Evas_Textblock_Style * evas_object_textblock_style_user_peek ( const Evas_Object obj)

Peeks at the user-styles stack.

Parameters
objthe object to get the style from.
Returns
Returns the user style at the top of the user style stack.
See also
evas_textblock_style_user_pop()

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by edje_object_part_text_style_user_peek().

◆ evas_object_textblock_style_user_pop()

EVAS_API void evas_object_textblock_style_user_pop ( Evas_Object obj)

Removes the style at the top of the user-style stack.

Parameters
objthe object to remove the style from.
Returns
Returns no value.
See also
evas_textblock_style_user_peek()

References EINA_SAFETY_ON_NULL_RETURN.

Referenced by edje_object_part_text_style_user_pop().

◆ evas_textblock_node_format_first_get()

EVAS_API const Evas_Object_Textblock_Node_Format * evas_textblock_node_format_first_get ( Evas_Object obj)

Gets the first format node.

Parameters
objThe textblock object.
Returns
Returns the first format node.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_node_format_last_get()

EVAS_API const Evas_Object_Textblock_Node_Format * evas_textblock_node_format_last_get ( Evas_Object obj)

Gets the last format node.

Parameters
objThe textblock object.
Returns
Returns the first format node.

References EINA_INLIST_GET, and EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_node_format_list_get()

EVAS_API const Eina_List * evas_textblock_node_format_list_get ( const Evas_Object obj,
const char *  anchor 
)

Gets a list of format nodes that match given format.

Parameters
objThe textblock object to query.
anchorThe format to find in the textblock.
Returns
Returns a list of format nodes that match the given format.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_node_format_remove_pair()

EVAS_API void evas_textblock_node_format_remove_pair ( Evas_Object obj,
Evas_Object_Textblock_Node_Format n 
)

◆ evas_object_textblock_line_number_geometry_get()

EVAS_API 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 the line specified by its number.

Parameters
objThe textblock object to query.
linethe line number of the queried line.
Returns
Returns no value.

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.

◆ evas_textblock_cursor_copy()

EVAS_API void evas_textblock_cursor_copy ( const Evas_Textblock_Cursor cur,
Evas_Textblock_Cursor cur_dest 
)

Make cur_dest point to the same place as cur.

Does not work if they don't point to the same object.

Parameters
curthe source cursor.
cur_destdestination cursor.
Returns
Returns no value.

References evas_textblock_cursor_equal().

Referenced by evas_textblock_cursor_range_delete().

◆ evas_object_textblock_cursor_new()

EVAS_API Evas_Textblock_Cursor * evas_object_textblock_cursor_new ( const Evas_Object obj)

Create a new cursor, associate it to the obj and init it to point to the start of the textblock.

Association to the object means the cursor will be updated when the object will change.

Note: if you need speed and you know what you are doing, it's slightly faster to just allocate the cursor yourself and not associate it. (only people developing the actual object, and not users of the object).

Parameters
objThe textblock to which the new cursor will associate.
Returns
Returns a new cursor associated with the given textblock object.

References eina_list_append(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_cursor_char_coord_set()

EVAS_API Eina_Bool evas_textblock_cursor_char_coord_set ( Evas_Textblock_Cursor obj,
Evas_Coord  x,
Evas_Coord  y 
)

Sets the position of the cursor according to the X and Y coordinates.

Parameters
[in]yy coord to set by.
Returns
true on success, false otherwise.

References EINA_FALSE.

◆ evas_textblock_cursor_cluster_coord_set()

EVAS_API Eina_Bool evas_textblock_cursor_cluster_coord_set ( Evas_Textblock_Cursor obj,
Evas_Coord  x,
Evas_Coord  y 
)

Sets the position of the cursor according to the X and Y coordinates and grapheme clusters of text.

Parameters
[in]yy coord to set by.
Returns
true on success, false otherwise.

References EINA_TRUE.

◆ evas_textblock_cursor_free()

EVAS_API void evas_textblock_cursor_free ( Evas_Textblock_Cursor cur)

Free the cursor and unassociate it from the object.

Note
do not use it to free unassociated cursors.
Parameters
curthe cursor to free.
Returns
Returns no value.

References eina_list_remove().

◆ evas_textblock_cursor_text_append()

EVAS_API int evas_textblock_cursor_text_append ( Evas_Textblock_Cursor cur,
const char *  text 
)

Adds text to the current cursor position and set the cursor to before the start of the text just added.

Parameters
curthe cursor to where to add text at.
textthe text to add.
Returns
Returns the len of the text added.
See also
evas_textblock_cursor_text_prepend()

Referenced by evas_object_textblock_clear().

◆ evas_textblock_cursor_text_prepend()

EVAS_API int evas_textblock_cursor_text_prepend ( Evas_Textblock_Cursor cur,
const char *  text 
)

Adds text to the current cursor position and set the cursor to after the start of the text just added.

Parameters
curthe cursor to where to add text at.
textthe text to add.
Returns
Returns the len of the text added.
See also
evas_textblock_cursor_text_append()

◆ evas_object_textblock_replace_char_set()

EVAS_API void evas_object_textblock_replace_char_set ( Evas_Object obj,
const char *  ch 
)

The "replacement character" to use for the given textblock object.

Parameters
[in]chThe charset name.

References EINA_SAFETY_ON_NULL_RETURN, eina_stringshare_add(), and eina_stringshare_del().

◆ evas_object_textblock_replace_char_get()

EVAS_API const char * evas_object_textblock_replace_char_get ( const Evas_Object obj)

The "replacement character" to use for the given textblock object.

Returns
The charset name.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_object_textblock_valign_set()

EVAS_API void evas_object_textblock_valign_set ( Evas_Object obj,
double  align 
)

The vertical alignment of text within the textblock object as a whole.

Normally alignment is 0.0 (top of object). Values given should be between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered etc.).

Parameters
[in]alignThe alignment set for the object.
Since
1.1

References EINA_DBL_EQ, and EINA_SAFETY_ON_NULL_RETURN.

◆ evas_object_textblock_valign_get()

EVAS_API double evas_object_textblock_valign_get ( const Evas_Object obj)

The vertical alignment of text within the textblock object as a whole.

Normally alignment is 0.0 (top of object). Values given should be between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered etc.).

Returns
The alignment set for the object.
Since
1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_cursor_paragraph_first()

EVAS_API void evas_textblock_cursor_paragraph_first ( Evas_Textblock_Cursor cur)

Sets the cursor to the start of the first text node.

Parameters
curthe cursor to update.
Returns
Returns no value.

Referenced by evas_object_textblock_clear(), and evas_textblock_cursor_line_coord_set().

◆ evas_textblock_cursor_paragraph_last()

EVAS_API void evas_textblock_cursor_paragraph_last ( Evas_Textblock_Cursor cur)

sets the cursor to the end of the last text node.

Parameters
curthe cursor to set.
Returns
Returns no value.

References EINA_INLIST_GET, and evas_textblock_cursor_paragraph_char_last().

Referenced by evas_textblock_cursor_line_coord_set().

◆ evas_textblock_cursor_compare()

EVAS_API int evas_textblock_cursor_compare ( const Evas_Textblock_Cursor cur1,
const Evas_Textblock_Cursor cur2 
)

Compare two cursors.

Parameters
cur1the first cursor.
cur2the second cursor.
Returns
-1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.

References EINA_INLIST_GET, _Eina_Inlist::next, and _Eina_Inlist::prev.

Referenced by evas_textblock_cursor_range_delete(), evas_textblock_cursor_range_formats_get(), and evas_textblock_cursor_range_simple_geometry_get().

◆ evas_textblock_cursor_equal()

EVAS_API Eina_Bool evas_textblock_cursor_equal ( const Evas_Textblock_Cursor obj,
const Evas_Textblock_Cursor cur 
)

Checks if two cursors are equal.

This is faster than evas_textblock_cursor_compare so it should be used if all we care about is equality.

Parameters
[in]curThe second cursor.
Returns
true if equal
Since
1.18

Referenced by evas_textblock_cursor_copy().

◆ evas_textblock_cursor_line_char_first()

EVAS_API void evas_textblock_cursor_line_char_first ( Evas_Textblock_Cursor cur)

Go to the start of the current line.

Parameters
curthe cursor to update.
Returns
Returns no value.

◆ evas_textblock_cursor_line_char_last()

EVAS_API void evas_textblock_cursor_line_char_last ( Evas_Textblock_Cursor cur)

Go to the end of the current line.

Parameters
curthe cursor to update.
Returns
Returns no value.

References EINA_INLIST_FOREACH, and EINA_INLIST_GET.

Referenced by evas_textblock_cursor_eol_get(), and evas_textblock_cursor_visible_range_get().

◆ evas_textblock_cursor_pos_set()

EVAS_API void evas_textblock_cursor_pos_set ( Evas_Textblock_Cursor cur,
int  _pos 
)

Set the cursor pos.

Parameters
curthe cursor to be set.
_posthe pos to set.

References EINA_INLIST_GET, eina_ustrbuf_length_get(), and _Evas_Object_Textblock_Node_Text::unicode.

◆ evas_textblock_cursor_paragraph_char_first()

EVAS_API void evas_textblock_cursor_paragraph_char_first ( Evas_Textblock_Cursor cur)

Go to the first char in the node the cursor is pointing on.

Parameters
curthe cursor to update.
Returns
Returns no value.

Referenced by evas_textblock_cursor_paragraph_text_get().

◆ evas_textblock_cursor_paragraph_char_last()

EVAS_API void evas_textblock_cursor_paragraph_char_last ( Evas_Textblock_Cursor cur)

Go to the last char in a text node.

Parameters
curthe cursor to update.
Returns
Returns no value.

References EINA_INLIST_GET, eina_ustrbuf_length_get(), and _Evas_Object_Textblock_Node_Text::unicode.

Referenced by evas_textblock_cursor_paragraph_last(), and evas_textblock_cursor_paragraph_text_get().

◆ evas_textblock_cursor_char_delete()

EVAS_API void evas_textblock_cursor_char_delete ( Evas_Textblock_Cursor cur)

◆ evas_textblock_fit_options_get()

EVAS_API int evas_textblock_fit_options_get ( const Evas_Object obj,
unsigned int *  p_options 
)

Get the object's content fit options.

Parameters
objThe textblock object.
[out]p_optionscontent fitting options.
Returns
Returns error code.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_fit_options_set()

EVAS_API int evas_textblock_fit_options_set ( Evas_Object obj,
unsigned int  options 
)

Set the object's content fit options.

Parameters
objThe textblock object.
[in]optionscontent fitting options.
Returns
Returns error code.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_fit_size_range_get()

EVAS_API int evas_textblock_fit_size_range_get ( const Evas_Object obj,
unsigned int *  p_min_font_size,
unsigned int *  p_max_font_size 
)

Get the object's max and min font sizes used for fitting content.

Parameters
objThe textblock object.
[out]p_min_font_sizemin font size used when fitting content.
[out]p_max_font_sizemax font size used when fitting content.
Returns
Returns error code.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_fit_size_range_set()

EVAS_API int evas_textblock_fit_size_range_set ( Evas_Object obj,
unsigned int  min_font_size,
unsigned int  max_font_size 
)

Set the object's max and min font sizes used for fitting content.

Parameters
objThe textblock object.
[in]min_font_sizemin font size used when fitting content.
[in]max_font_sizemax font size used when fitting content.
Returns
Returns error code.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_fit_step_size_get()

EVAS_API int evas_textblock_fit_step_size_get ( const Evas_Object obj,
unsigned int *  p_step_size 
)

Get the object's fitting step size when trying fonts between min font size and max font size.

Parameters
objThe textblock object.
[out]p_step_sizestep jumps between min and max font size.
Returns
Returns error code.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_fit_step_size_set()

EVAS_API int evas_textblock_fit_step_size_set ( Evas_Object obj,
unsigned int  step_size 
)

Set the object's fitting step size when trying fonts between min font size and max font size.

Parameters
objThe textblock object.
[out]step_sizestep jumps between min and max font size.
Returns
Returns error code.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_fit_size_array_get()

EVAS_API int evas_textblock_fit_size_array_get ( const Evas_Object obj,
unsigned int *  p_size_array,
size_t *  p_size_array_len,
size_t  request_size_array 
)

Get copy of the object's fitting font size array used internally.

Parameters
objThe textblock object.
[out]p_size_arraypointer to size array (passing NULL will ignore filling array).
[out]p_size_array_lenthe length of internall font sizes array.
[out]request_size_arrayrequest to fill specific amount in p_size_array.
Returns
Returns error code.

References EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ evas_textblock_fit_size_array_set()

EVAS_API int evas_textblock_fit_size_array_set ( Evas_Object obj,
const unsigned int *  p_size_array,
size_t  size_array_len 
)

Set the object's fitting font size array that will be used internally Changing fitting step_size,min_font_size,max_font size will generate new array Setting array will make content fit algorithm ignore step_size,min_font_size,max_font size, and use passed array only.

Parameters
objThe textblock object.
[in]p_size_arraypointer to font sizes array.
[in]size_array_lenthe length passed font sizes array.
Returns
Returns error code.

◆ evas_textblock_fit_font_size_get()

EVAS_API int evas_textblock_fit_font_size_get ( Evas_Object obj)

Get the object fitting font size that is currently used.

Parameters
objThe textblock object.
Returns
Returns current used font size for fitting, or -1 if there is no fitting.
Since
1.26

References EINA_SAFETY_ON_NULL_RETURN_VAL.