Functions used to create and manipulate textblock objects. More...
Data Structures | |
struct | _Evas_Textblock_Rectangle |
Typedefs | |
typedef struct _Evas_Textblock_Style | Evas_Textblock_Style |
typedef struct _Evas_Textblock_Cursor | Evas_Textblock_Cursor |
typedef struct _Evas_Object_Textblock_Node_Format | Evas_Object_Textblock_Node_Format |
A format node. | |
typedef struct _Evas_Textblock_Rectangle | Evas_Textblock_Rectangle |
typedef enum _Evas_Textblock_Text_Type | Evas_Textblock_Text_Type |
typedef enum _Evas_Textblock_Cursor_Type | Evas_Textblock_Cursor_Type |
Functions | |
const char * | evas_textblock_escape_string_get (const char *escape) |
Returns the unescaped version of escape. More... | |
const char * | evas_textblock_string_escape_get (const char *string, int *len_ret) |
Returns the escaped version of the string. More... | |
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_Textblock_Style * | evas_textblock_style_new (void) |
Creates a new textblock style. More... | |
void | evas_textblock_style_free (Evas_Textblock_Style *ts) |
Destroys a textblock style. More... | |
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... | |
const char * | evas_textblock_style_get (const Evas_Textblock_Style *ts) |
Return the text of the style ts. More... | |
void | evas_object_textblock_text_markup_prepend (Evas_Textblock_Cursor *cur, const char *text) |
Prepends markup to the cursor cur. More... | |
void | evas_textblock_cursor_free (Evas_Textblock_Cursor *cur) |
Free the cursor and unassociate it from the object. More... | |
void | evas_textblock_cursor_paragraph_first (Evas_Textblock_Cursor *cur) |
Sets the cursor to the start of the first text node. More... | |
void | evas_textblock_cursor_paragraph_last (Evas_Textblock_Cursor *cur) |
sets the cursor to the end of the last text node. More... | |
Eina_Bool | evas_textblock_cursor_paragraph_next (Evas_Textblock_Cursor *cur) |
Advances to the start of the next text node. More... | |
Eina_Bool | evas_textblock_cursor_paragraph_prev (Evas_Textblock_Cursor *cur) |
Advances to the end of the previous text node. More... | |
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) More... | |
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) More... | |
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... | |
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. More... | |
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... | |
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... | |
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... | |
Eina_Bool | evas_textblock_cursor_format_next (Evas_Textblock_Cursor *cur) |
Advances to the next format node. More... | |
Eina_Bool | evas_textblock_cursor_format_prev (Evas_Textblock_Cursor *cur) |
Advances to the previous format node. More... | |
Eina_Bool | evas_textblock_cursor_is_format (const Evas_Textblock_Cursor *cur) |
Returns true if the cursor points to a format. More... | |
Eina_Bool | evas_textblock_cursor_char_next (Evas_Textblock_Cursor *cur) |
Advances 1 char forward. More... | |
Eina_Bool | evas_textblock_cursor_char_prev (Evas_Textblock_Cursor *cur) |
Advances 1 char backward. More... | |
Eina_Bool | evas_textblock_cursor_word_start (Evas_Textblock_Cursor *cur) |
Moves the cursor to the start of the word under the cursor. More... | |
Eina_Bool | evas_textblock_cursor_word_end (Evas_Textblock_Cursor *cur) |
Moves the cursor to the end of the word under the cursor. More... | |
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... | |
void | evas_textblock_cursor_paragraph_char_last (Evas_Textblock_Cursor *cur) |
Go to the last char in a text node. More... | |
void | evas_textblock_cursor_line_char_first (Evas_Textblock_Cursor *cur) |
Go to the start of the current line. More... | |
void | evas_textblock_cursor_line_char_last (Evas_Textblock_Cursor *cur) |
Go to the end of the current line. More... | |
int | evas_textblock_cursor_pos_get (const Evas_Textblock_Cursor *cur) |
Return the current cursor pos. More... | |
void | evas_textblock_cursor_pos_set (Evas_Textblock_Cursor *cur, int pos) |
Set the cursor pos. More... | |
Eina_Bool | evas_textblock_cursor_line_set (Evas_Textblock_Cursor *cur, int line) |
Go to the start of the line passed. More... | |
int | evas_textblock_cursor_compare (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) |
Compare two cursors. More... | |
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... | |
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... | |
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... | |
Eina_Bool | evas_textblock_cursor_format_append (Evas_Textblock_Cursor *cur, const char *format) |
Adds format to the current cursor position. More... | |
Eina_Bool | evas_textblock_cursor_format_prepend (Evas_Textblock_Cursor *cur, const char *format) |
Adds format to the current cursor position. More... | |
void | evas_textblock_cursor_char_delete (Evas_Textblock_Cursor *cur) |
Delete the character at the location of the cursor. More... | |
void | evas_textblock_cursor_range_delete (Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) |
Delete the range between cur1 and cur2. More... | |
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... | |
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... | |
Eina_Bool | evas_textblock_cursor_visible_range_get (Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) |
Return the currently visible range. More... | |
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. More... | |
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... | |
char * | evas_textblock_cursor_content_get (const Evas_Textblock_Cursor *cur) |
Return the content of the cursor. More... | |
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... | |
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... | |
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... | |
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... | |
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... | |
Eina_Bool | evas_textblock_cursor_char_coord_set (Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) |
Set the position of the cursor according to the X and Y coordinates. More... | |
int | evas_textblock_cursor_line_coord_set (Evas_Textblock_Cursor *cur, Evas_Coord y) |
Set the cursor position according to the y coord. More... | |
Eina_List * | evas_textblock_cursor_range_geometry_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) |
Get the geometry of a range. More... | |
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) |
Eina_Bool | evas_textblock_cursor_eol_get (const Evas_Textblock_Cursor *cur) |
Checks if the cursor points to the end of the line. More... | |
enum | { EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_SET, EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_PUSH, EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_PEEK, EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_POP, EVAS_OBJ_TEXTBLOCK_SUB_ID_REPLACE_CHAR_SET, EVAS_OBJ_TEXTBLOCK_SUB_ID_LEGACY_NEWLINE_SET, EVAS_OBJ_TEXTBLOCK_SUB_ID_LEGACY_NEWLINE_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_VALIGN_SET, EVAS_OBJ_TEXTBLOCK_SUB_ID_VALIGN_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_BIDI_DELIMITERS_SET, EVAS_OBJ_TEXTBLOCK_SUB_ID_BIDI_DELIMITERS_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_REPLACE_CHAR_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_TEXT_MARKUP_SET, EVAS_OBJ_TEXTBLOCK_SUB_ID_TEXT_MARKUP_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_CURSOR_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_CURSOR_NEW, EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_LIST_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_FIRST_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_LAST_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_REMOVE_PAIR, EVAS_OBJ_TEXTBLOCK_SUB_ID_LINE_NUMBER_GEOMETRY_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_CLEAR, EVAS_OBJ_TEXTBLOCK_SUB_ID_SIZE_FORMATTED_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_SIZE_NATIVE_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_INSETS_GET, EVAS_OBJ_TEXTBLOCK_SUB_ID_LAST } |
const Eo_Class * | evas_object_textblock_class_get (void) |
#define | EVAS_OBJ_TEXTBLOCK_CLASS evas_object_textblock_class_get() |
#define | EVAS_OBJ_TEXTBLOCK_ID(sub_id) (EVAS_OBJ_TEXTBLOCK_BASE_ID + sub_id) |
#define | evas_obj_textblock_style_set(ts) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_SET), EO_TYPECHECK(const Evas_Textblock_Style *, ts) |
#define | evas_obj_textblock_style_get(ts) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_GET), EO_TYPECHECK(const Evas_Textblock_Style **, ts) |
#define | evas_obj_textblock_style_user_push(ts) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_PUSH), EO_TYPECHECK(Evas_Textblock_Style *, ts) |
#define | evas_obj_textblock_style_user_peek(ts) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_PEEK), EO_TYPECHECK(const Evas_Textblock_Style **, ts) |
#define | evas_obj_textblock_style_user_pop() EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_POP) |
#define | evas_obj_textblock_replace_char_set(ch) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_REPLACE_CHAR_SET), EO_TYPECHECK(const char *, ch) |
#define | evas_obj_textblock_legacy_newline_set(mode) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_LEGACY_NEWLINE_SET), EO_TYPECHECK(Eina_Bool, mode) |
#define | evas_obj_textblock_legacy_newline_get(newline) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_LEGACY_NEWLINE_GET), EO_TYPECHECK(Eina_Bool *, newline) |
#define | evas_obj_textblock_valign_set(align) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_VALIGN_SET), EO_TYPECHECK(double, align) |
#define | evas_obj_textblock_valign_get(valign) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_VALIGN_GET), EO_TYPECHECK(double *, valign) |
#define | evas_obj_textblock_bidi_delimiters_set(delim) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_BIDI_DELIMITERS_SET), EO_TYPECHECK(const char *, delim) |
#define | evas_obj_textblock_bidi_delimiters_get(delim) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_BIDI_DELIMITERS_GET), EO_TYPECHECK(const char **, delim) |
#define | evas_obj_textblock_replace_char_get(repch) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_REPLACE_CHAR_GET), EO_TYPECHECK(const char **, repch) |
#define | evas_obj_textblock_text_markup_set(text) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_TEXT_MARKUP_SET), EO_TYPECHECK(const char *, text) |
#define | evas_obj_textblock_text_markup_get(markup) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_TEXT_MARKUP_GET), EO_TYPECHECK(const char **, markup) |
#define | evas_obj_textblock_cursor_get(cursor) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_CURSOR_GET), EO_TYPECHECK(Evas_Textblock_Cursor **, cursor) |
#define | evas_obj_textblock_cursor_new(cur) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_CURSOR_NEW), EO_TYPECHECK(Evas_Textblock_Cursor **, cur) |
#define | evas_obj_textblock_node_format_list_get(anchor, list) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_LIST_GET), EO_TYPECHECK(const char *, anchor), EO_TYPECHECK(const Eina_List **, list) |
#define | evas_obj_textblock_node_format_first_get(format) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_FIRST_GET), EO_TYPECHECK(const Evas_Object_Textblock_Node_Format **, format) |
#define | evas_obj_textblock_node_format_last_get(format) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_LAST_GET), EO_TYPECHECK(const Evas_Object_Textblock_Node_Format **, format) |
#define | evas_obj_textblock_node_format_remove_pair(n) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_REMOVE_PAIR), EO_TYPECHECK(Evas_Object_Textblock_Node_Format *, n) |
#define | evas_obj_textblock_line_number_geometry_get(line, cx, cy, cw, ch, result) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_LINE_NUMBER_GEOMETRY_GET), EO_TYPECHECK(int, line), EO_TYPECHECK(Evas_Coord *, cx), EO_TYPECHECK(Evas_Coord *, cy), EO_TYPECHECK(Evas_Coord *, cw), EO_TYPECHECK(Evas_Coord *, ch), EO_TYPECHECK(Eina_Bool *, result) |
#define | evas_obj_textblock_clear() EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_CLEAR) |
#define | evas_obj_textblock_size_formatted_get(w, h) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_SIZE_FORMATTED_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) |
#define | evas_obj_textblock_size_native_get(w, h) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_SIZE_NATIVE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) |
#define | evas_obj_textblock_style_insets_get(l, r, t, b) EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_INSETS_GET), EO_TYPECHECK(Evas_Coord *, l), EO_TYPECHECK(Evas_Coord *, r), EO_TYPECHECK(Evas_Coord *, t), EO_TYPECHECK(Evas_Coord *, b) |
Eo_Op | EVAS_OBJ_TEXTBLOCK_BASE_ID |
Evas_Object * | evas_object_textblock_add (Evas *e) |
Adds a textblock to the given evas. More... | |
char * | evas_textblock_text_markup_to_utf8 (const Evas_Object *obj, const char *text) |
Return the plain version of the markup. More... | |
char * | evas_textblock_text_utf8_to_markup (const Evas_Object *obj, const char *text) |
Return the markup version of the plain text. More... | |
void | evas_object_textblock_style_set (Evas_Object *obj, const Evas_Textblock_Style *ts) |
Set the objects style to ts. More... | |
const Evas_Textblock_Style * | evas_object_textblock_style_get (const Evas_Object *obj) |
Return the style of an object. More... | |
void | evas_object_textblock_style_user_push (Evas_Object *obj, Evas_Textblock_Style *ts) |
Push ts to the top of the user style stack. More... | |
void | evas_object_textblock_style_user_pop (Evas_Object *obj) |
Del the from the top of the user style stack. More... | |
const Evas_Textblock_Style * | evas_object_textblock_style_user_peek (const Evas_Object *obj) |
Get (don't remove) the style at the top of the user style stack. More... | |
void | evas_object_textblock_replace_char_set (Evas_Object *obj, const char *ch) |
Set the "replacement character" to use for the given textblock object. More... | |
const char * | evas_object_textblock_replace_char_get (Evas_Object *obj) |
Get the "replacement character" for given textblock object. More... | |
void | evas_object_textblock_valign_set (Evas_Object *obj, double align) |
Sets the vertical alignment of text within the textblock object as a whole. More... | |
double | evas_object_textblock_valign_get (const Evas_Object *obj) |
Gets the vertical alignment of a textblock. More... | |
void | evas_object_textblock_bidi_delimiters_set (Evas_Object *obj, const char *delim) |
Sets the BiDi delimiters used in the textblock. More... | |
const char * | evas_object_textblock_bidi_delimiters_get (const Evas_Object *obj) |
Gets the BiDi delimiters used in the textblock. More... | |
void | evas_object_textblock_legacy_newline_set (Evas_Object *obj, Eina_Bool mode) |
Sets newline mode. More... | |
Eina_Bool | evas_object_textblock_legacy_newline_get (const Evas_Object *obj) |
Gets newline mode. More... | |
void | evas_object_textblock_text_markup_set (Evas_Object *obj, const char *text) |
Sets the tetxblock's text to the markup text. More... | |
const char * | evas_object_textblock_text_markup_get (const Evas_Object *obj) |
Return the markup of the object. More... | |
Evas_Textblock_Cursor * | evas_object_textblock_cursor_get (const Evas_Object *obj) |
Return the object's main cursor. More... | |
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. More... | |
const Eina_List * | evas_textblock_node_format_list_get (const Evas_Object *obj, const char *anchor) |
Returns the. More... | |
const Evas_Object_Textblock_Node_Format * | evas_textblock_node_format_first_get (const Evas_Object *obj) |
Returns the first format node. More... | |
const Evas_Object_Textblock_Node_Format * | evas_textblock_node_format_last_get (const Evas_Object *obj) |
Returns the last format node. More... | |
void | evas_textblock_node_format_remove_pair (Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) |
Remove a format node and it's match. More... | |
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) |
Get the geometry of a line number. More... | |
void | evas_object_textblock_clear (Evas_Object *obj) |
Clear the textblock object. More... | |
void | evas_object_textblock_size_formatted_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) |
Get the formatted width and height. More... | |
void | evas_object_textblock_size_native_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) |
Get the native width and height. More... | |
void | evas_object_textblock_style_insets_get (const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) |
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.
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.
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.
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:
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.
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
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:
#define evas_obj_textblock_style_set | ( | ts | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_SET), EO_TYPECHECK(const Evas_Textblock_Style *, ts) |
Set the objects style to ts.
[in] | ts |
Referenced by evas_object_textblock_style_set().
#define evas_obj_textblock_style_get | ( | ts | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_GET), EO_TYPECHECK(const Evas_Textblock_Style **, ts) |
Return the style of an object.
[out] | ts |
Referenced by evas_object_textblock_style_get().
#define evas_obj_textblock_style_user_push | ( | ts | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_PUSH), EO_TYPECHECK(Evas_Textblock_Style *, ts) |
Push ts to the top of the user style stack.
[in] | ts |
Referenced by evas_object_textblock_style_user_push().
#define evas_obj_textblock_style_user_peek | ( | ts | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_PEEK), EO_TYPECHECK(const Evas_Textblock_Style **, ts) |
Get (don't remove) the style at the top of the user style stack.
[out] | ts |
Referenced by evas_object_textblock_style_user_peek().
#define evas_obj_textblock_style_user_pop | ( | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_USER_POP) |
Del the from the top of the user style stack.
Referenced by evas_object_textblock_style_user_pop().
#define evas_obj_textblock_replace_char_set | ( | ch | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_REPLACE_CHAR_SET), EO_TYPECHECK(const char *, ch) |
Set the "replacement character" to use for the given textblock object.
[in] | ch |
Referenced by evas_object_textblock_replace_char_set().
#define evas_obj_textblock_legacy_newline_set | ( | mode | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_LEGACY_NEWLINE_SET), EO_TYPECHECK(Eina_Bool, mode) |
Sets newline mode. When true, newline character will behave as a paragraph separator.
[in] | mode |
Referenced by evas_object_textblock_legacy_newline_set().
#define evas_obj_textblock_legacy_newline_get | ( | newline | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_LEGACY_NEWLINE_GET), EO_TYPECHECK(Eina_Bool *, newline) |
Gets newline mode. When true, newline character behaves as a paragraph separator.
[out] | newline |
Referenced by evas_object_textblock_legacy_newline_get().
#define evas_obj_textblock_valign_set | ( | align | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_VALIGN_SET), EO_TYPECHECK(double, align) |
Sets the vertical alignment of text within the textblock object
[in] | align |
Referenced by evas_object_textblock_valign_set().
#define evas_obj_textblock_valign_get | ( | valign | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_VALIGN_GET), EO_TYPECHECK(double *, valign) |
Gets the vertical alignment of a textblock
[out] | valign |
Referenced by evas_object_textblock_valign_get().
#define evas_obj_textblock_bidi_delimiters_set | ( | delim | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_BIDI_DELIMITERS_SET), EO_TYPECHECK(const char *, delim) |
Sets the BiDi delimiters used in the textblock.
[in] | delim |
Referenced by evas_object_textblock_bidi_delimiters_set().
#define evas_obj_textblock_bidi_delimiters_get | ( | delim | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_BIDI_DELIMITERS_GET), EO_TYPECHECK(const char **, delim) |
Gets the BiDi delimiters used in the textblock.
[out] | delim |
Referenced by evas_object_textblock_bidi_delimiters_get().
#define evas_obj_textblock_replace_char_get | ( | repch | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_REPLACE_CHAR_GET), EO_TYPECHECK(const char **, repch) |
Get the "replacement character" for given textblock object.
[out] | repch |
Referenced by evas_object_textblock_replace_char_get().
#define evas_obj_textblock_text_markup_set | ( | text | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_TEXT_MARKUP_SET), EO_TYPECHECK(const char *, text) |
Sets the tetxblock's text to the markup text.
[in] | text |
Referenced by evas_object_textblock_text_markup_set().
#define evas_obj_textblock_text_markup_get | ( | markup | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_TEXT_MARKUP_GET), EO_TYPECHECK(const char **, markup) |
Return the markup of the object.
[out] | markup |
Referenced by evas_object_textblock_text_markup_get().
#define evas_obj_textblock_cursor_get | ( | cursor | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_CURSOR_GET), EO_TYPECHECK(Evas_Textblock_Cursor **, cursor) |
Return the object's main cursor.
[out] | cursor |
Referenced by evas_object_textblock_cursor_get().
#define evas_obj_textblock_cursor_new | ( | cur | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_CURSOR_NEW), EO_TYPECHECK(Evas_Textblock_Cursor **, cur) |
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.
[in] | cur |
Referenced by evas_object_textblock_cursor_new().
#define evas_obj_textblock_node_format_list_get | ( | anchor, | |
list | |||
) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_LIST_GET), EO_TYPECHECK(const char *, anchor), EO_TYPECHECK(const Eina_List **, list) |
No description supplied by the EAPI.
[in] | anchor | |
[out] | list |
Referenced by evas_textblock_node_format_list_get().
#define evas_obj_textblock_node_format_first_get | ( | format | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_FIRST_GET), EO_TYPECHECK(const Evas_Object_Textblock_Node_Format **, format) |
Returns the first format node.
[out] | format |
Referenced by evas_textblock_node_format_first_get().
#define evas_obj_textblock_node_format_last_get | ( | format | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_LAST_GET), EO_TYPECHECK(const Evas_Object_Textblock_Node_Format **, format) |
Returns the last format node.
[out] | format |
Referenced by evas_textblock_node_format_last_get().
#define evas_obj_textblock_node_format_remove_pair | ( | n | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_NODE_FORMAT_REMOVE_PAIR), EO_TYPECHECK(Evas_Object_Textblock_Node_Format *, n) |
Remove a format node and its match.
[in] | n |
Referenced by evas_textblock_node_format_remove_pair().
#define evas_obj_textblock_line_number_geometry_get | ( | line, | |
cx, | |||
cy, | |||
cw, | |||
ch, | |||
result | |||
) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_LINE_NUMBER_GEOMETRY_GET), EO_TYPECHECK(int, line), EO_TYPECHECK(Evas_Coord *, cx), EO_TYPECHECK(Evas_Coord *, cy), EO_TYPECHECK(Evas_Coord *, cw), EO_TYPECHECK(Evas_Coord *, ch), EO_TYPECHECK(Eina_Bool *, result) |
Get the geometry of a line number.
[in] | line | |
[out] | cx | |
[out] | cy | |
[out] | cw | |
[out] | ch | |
[out] | result |
Referenced by evas_object_textblock_line_number_geometry_get().
#define evas_obj_textblock_clear | ( | ) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_CLEAR) |
#define evas_obj_textblock_size_formatted_get | ( | w, | |
h | |||
) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_SIZE_FORMATTED_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) |
Get the formatted width and height. This calculates the actual size after restricting the textblock to the current size of the object.
[out] | w | |
[out] | h |
Referenced by evas_object_textblock_size_formatted_get().
#define evas_obj_textblock_size_native_get | ( | w, | |
h | |||
) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_SIZE_NATIVE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) |
Get the native width and height. This calculates the actual size without taking account the current size of the object.
[out] | w | |
[out] | h |
Referenced by evas_object_textblock_size_native_get().
#define evas_obj_textblock_style_insets_get | ( | l, | |
r, | |||
t, | |||
b | |||
) | EVAS_OBJ_TEXTBLOCK_ID(EVAS_OBJ_TEXTBLOCK_SUB_ID_STYLE_INSETS_GET), EO_TYPECHECK(Evas_Coord *, l), EO_TYPECHECK(Evas_Coord *, r), EO_TYPECHECK(Evas_Coord *, t), EO_TYPECHECK(Evas_Coord *, b) |
No description supplied by the EAPI.
[out] | l | |
[out] | r | |
[out] | t | |
[out] | b |
const char* evas_textblock_escape_string_get | ( | const char * | escape | ) |
Returns the unescaped version of escape.
escape | the string to be escaped |
const char* evas_textblock_string_escape_get | ( | const char * | string, |
int * | len_ret | ||
) |
Returns the escaped version of the string.
string | to escape |
len_ret | the len of the part of the string that was used. |
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.
escape_start | the start of the string. |
escape_end | the end of the string. |
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.
ts | The textblock style to free. |
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.
ts | the style to set. |
text | the text to parse - NOT NULL. |
References eina_inlist_append(), EINA_INLIST_GET, EINA_LIST_FOREACH, eina_strbuf_append_char(), eina_strbuf_append_length(), eina_strbuf_free(), eina_strbuf_new(), and eina_strbuf_string_steal().
const char* evas_textblock_style_get | ( | const Evas_Textblock_Style * | ts | ) |
Return the text of the style ts.
ts | the style to get it's text. |
void evas_object_textblock_text_markup_prepend | ( | Evas_Textblock_Cursor * | cur, |
const char * | text | ||
) |
Prepends markup to the cursor cur.
cur | the cursor to prepend to. |
text | the markup text to prepend. |
References evas_textblock_cursor_format_prepend().
void evas_textblock_cursor_free | ( | Evas_Textblock_Cursor * | cur | ) |
Free the cursor and unassociate it from the object.
cur | the cursor to free. |
References eina_list_remove().
void evas_textblock_cursor_paragraph_first | ( | Evas_Textblock_Cursor * | cur | ) |
Sets the cursor to the start of the first text node.
cur | the cursor to update. |
Referenced by evas_object_textblock_clear(), evas_textblock_cursor_char_coord_set(), and evas_textblock_cursor_line_coord_set().
void evas_textblock_cursor_paragraph_last | ( | Evas_Textblock_Cursor * | cur | ) |
sets the cursor to the end of the last text node.
cur | the cursor to set. |
References EINA_INLIST_GET, and evas_textblock_cursor_paragraph_char_last().
Referenced by evas_textblock_cursor_char_coord_set(), and evas_textblock_cursor_line_coord_set().
Eina_Bool evas_textblock_cursor_paragraph_next | ( | Evas_Textblock_Cursor * | cur | ) |
Advances to the start of the next text node.
cur | the cursor to update |
EINA_TRUE
if it managed to advance a paragraph, EINA_FALSE
otherwise. References EINA_FALSE, EINA_INLIST_GET, and EINA_TRUE.
Referenced by evas_textblock_cursor_char_next().
Eina_Bool evas_textblock_cursor_paragraph_prev | ( | Evas_Textblock_Cursor * | cur | ) |
Advances to the end of the previous text node.
cur | the cursor to update |
EINA_TRUE
if it managed to advance a paragraph, EINA_FALSE
otherwise. References EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, and evas_textblock_cursor_paragraph_char_last().
Referenced by evas_textblock_cursor_char_prev().
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)
n | the current format node - not null. |
References EINA_INLIST_GET.
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)
n | the current format node - not null. |
References EINA_INLIST_GET.
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.
cur | the cursor to update. |
n | the format node to update according. |
References evas_textblock_cursor_at_format_set().
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.
cur | the position to look at. |
NULL
otherwise. Referenced by evas_textblock_cursor_content_get(), and evas_textblock_cursor_format_prev().
const char* evas_textblock_node_format_text_get | ( | const Evas_Object_Textblock_Node_Format * | fnode | ) |
Get the text format representation of the format node.
fnode | the format node. |
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.
cur | the cursor to update |
fmt | the format to update according to. |
Referenced by evas_textblock_cursor_set_at_format().
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.
cur | the cursor to look at. |
EINA_TRUE
if the cursor points to a visible format, EINA_FALSE
otherwise. References EINA_FALSE, eina_ustrbuf_string_get(), and evas_textblock_cursor_is_format().
Referenced by evas_textblock_cursor_content_get(), evas_textblock_cursor_format_append(), and evas_textblock_cursor_text_append().
Eina_Bool evas_textblock_cursor_format_next | ( | Evas_Textblock_Cursor * | cur | ) |
Advances to the next format node.
cur | the cursor to be updated. |
EINA_TRUE
on success EINA_FALSE
otherwise. References EINA_FALSE, EINA_INLIST_GET, and EINA_TRUE.
Eina_Bool evas_textblock_cursor_format_prev | ( | Evas_Textblock_Cursor * | cur | ) |
Advances to the previous format node.
cur | the cursor to update. |
EINA_TRUE
on success EINA_FALSE
otherwise. References EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, and evas_textblock_cursor_format_get().
Eina_Bool evas_textblock_cursor_is_format | ( | const Evas_Textblock_Cursor * | cur | ) |
Returns true if the cursor points to a format.
cur | the cursor to check. |
EINA_TRUE
if a cursor points to a format EINA_FALSE
otherwise. References EINA_FALSE, and EINA_TRUE.
Referenced by evas_textblock_cursor_format_is_visible_get().
Eina_Bool evas_textblock_cursor_char_next | ( | Evas_Textblock_Cursor * | cur | ) |
Advances 1 char forward.
cur | the cursor to advance. |
EINA_TRUE
on success EINA_FALSE
otherwise. References EINA_FALSE, EINA_TRUE, eina_ustrbuf_string_get(), and evas_textblock_cursor_paragraph_next().
Referenced by evas_textblock_cursor_format_prepend().
Eina_Bool evas_textblock_cursor_char_prev | ( | Evas_Textblock_Cursor * | cur | ) |
Advances 1 char backward.
cur | the cursor to advance. |
EINA_TRUE
on success EINA_FALSE
otherwise. References EINA_FALSE, EINA_TRUE, and evas_textblock_cursor_paragraph_prev().
Eina_Bool evas_textblock_cursor_word_start | ( | Evas_Textblock_Cursor * | cur | ) |
Moves the cursor to the start of the word under the cursor.
cur | the cursor to move. |
EINA_TRUE
on success EINA_FALSE
otherwise. References EINA_FALSE, EINA_TRUE, eina_ustrbuf_length_get(), and eina_ustrbuf_string_get().
Eina_Bool evas_textblock_cursor_word_end | ( | Evas_Textblock_Cursor * | cur | ) |
Moves the cursor to the end of the word under the cursor.
cur | the cursor to move. |
EINA_TRUE
on success EINA_FALSE
otherwise. References EINA_FALSE, EINA_TRUE, eina_ustrbuf_length_get(), and eina_ustrbuf_string_get().
void evas_textblock_cursor_paragraph_char_first | ( | Evas_Textblock_Cursor * | cur | ) |
Go to the first char in the node the cursor is pointing on.
cur | the cursor to update. |
Referenced by evas_textblock_cursor_paragraph_text_get().
void evas_textblock_cursor_paragraph_char_last | ( | Evas_Textblock_Cursor * | cur | ) |
Go to the last char in a text node.
cur | the cursor to update. |
References EINA_INLIST_GET, and eina_ustrbuf_length_get().
Referenced by evas_textblock_cursor_paragraph_last(), evas_textblock_cursor_paragraph_prev(), and evas_textblock_cursor_paragraph_text_get().
void evas_textblock_cursor_line_char_first | ( | Evas_Textblock_Cursor * | cur | ) |
Go to the start of the current line.
cur | the cursor to update. |
References EINA_INLIST_FOREACH.
Referenced by evas_textblock_cursor_char_coord_set().
void evas_textblock_cursor_line_char_last | ( | Evas_Textblock_Cursor * | cur | ) |
Go to the end of the current line.
cur | the cursor to update. |
References EINA_INLIST_FOREACH, and EINA_INLIST_GET.
Referenced by evas_textblock_cursor_char_coord_set(), evas_textblock_cursor_eol_get(), and evas_textblock_cursor_visible_range_get().
int evas_textblock_cursor_pos_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Return the current cursor pos.
cur | the cursor to take the position from. |
References EINA_INLIST_GET, and eina_ustrbuf_length_get().
void evas_textblock_cursor_pos_set | ( | Evas_Textblock_Cursor * | cur, |
int | pos | ||
) |
Set the cursor pos.
cur | the cursor to be set. |
pos | the pos to set. |
References EINA_INLIST_GET, and eina_ustrbuf_length_get().
Eina_Bool evas_textblock_cursor_line_set | ( | Evas_Textblock_Cursor * | cur, |
int | line | ||
) |
Go to the start of the line passed.
cur | cursor to update. |
line | numer to set. |
EINA_TRUE
on success, EINA_FALSE
on error. References EINA_FALSE, and EINA_TRUE.
Referenced by evas_textblock_cursor_line_coord_set().
int evas_textblock_cursor_compare | ( | const Evas_Textblock_Cursor * | cur1, |
const Evas_Textblock_Cursor * | cur2 | ||
) |
Compare two cursors.
cur1 | the first cursor. |
cur2 | the second cursor. |
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_geometry_get().
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.
cur | the source cursor. |
cur_dest | destination cursor. |
Referenced by evas_textblock_cursor_eol_get(), and evas_textblock_cursor_range_delete().
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.
cur | the cursor to where to add text at. |
text | the text to add. |
References eina_inlist_append(), EINA_INLIST_GET, EINA_TRUE, eina_unicode_utf8_to_unicode(), eina_ustrbuf_insert_length(), and evas_textblock_cursor_format_is_visible_get().
Referenced by evas_object_textblock_clear(), and 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 set the cursor to after the start of the text just added.
cur | the cursor to where to add text at. |
text | the text to add. |
References evas_textblock_cursor_text_append().
Referenced by evas_textblock_cursor_format_append().
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.
cur | the cursor to where to add format at. |
format | the format to add. |
cur | the cursor to look at. |
EINA_TRUE
if the cursor points to the terminating null, EINA_FALSE
otherwise. References EINA_FALSE, eina_inlist_append(), eina_inlist_append_relative(), EINA_INLIST_GET, eina_inlist_prepend(), eina_inlist_prepend_relative(), EINA_TRUE, eina_ustrbuf_insert_char(), evas_textblock_cursor_format_is_visible_get(), and evas_textblock_cursor_text_prepend().
Referenced by evas_textblock_cursor_format_prepend().
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.
cur | the cursor to where to add format at. |
format | the format to add. |
References evas_textblock_cursor_char_next(), and evas_textblock_cursor_format_append().
Referenced by evas_object_textblock_text_markup_prepend().
void evas_textblock_cursor_char_delete | ( | Evas_Textblock_Cursor * | cur | ) |
Delete the character at the location of the cursor.
If there's a format pointing to this position, delete it as well.
cur | the cursor pointing to the current location. |
References EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, eina_ustrbuf_length_get(), eina_ustrbuf_remove(), and eina_ustrbuf_string_get().
void evas_textblock_cursor_range_delete | ( | Evas_Textblock_Cursor * | cur1, |
Evas_Textblock_Cursor * | cur2 | ||
) |
Delete the range between cur1 and cur2.
cur1 | one side of the range. |
cur2 | the second side of the range |
References EINA_FALSE, EINA_INLIST_GET, EINA_TRUE, eina_ustrbuf_length_get(), eina_ustrbuf_remove(), evas_textblock_cursor_compare(), and evas_textblock_cursor_copy().
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.
cur | the cursor pointing to the paragraph. |
NULL
otherwise. References evas_textblock_cursor_paragraph_char_first(), evas_textblock_cursor_paragraph_char_last(), and evas_textblock_cursor_range_text_get().
int evas_textblock_cursor_paragraph_text_length_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Return the length of the paragraph, cheaper the eina_unicode_strlen()
cur | the position of the paragraph. |
References EINA_INLIST_GET, and eina_ustrbuf_length_get().
Eina_Bool evas_textblock_cursor_visible_range_get | ( | Evas_Textblock_Cursor * | start, |
Evas_Textblock_Cursor * | end | ||
) |
Return the currently visible range.
start | the start of the range. |
end | the end of the range. |
EINA_TRUE
on success, EINA_FALSE
otherwise. References EINA_FALSE, EINA_TRUE, evas_object_evas_get(), evas_textblock_cursor_line_char_last(), and evas_textblock_cursor_line_coord_set().
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.
cur1 | one side of the range. |
cur2 | the other side of the range |
References EINA_INLIST_GET, eina_list_append(), and evas_textblock_cursor_compare().
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.
cur1 | one side of the range. |
cur2 | the other side of the range |
format | The form on which to return the text. Markup - in textblock markup. Plain - UTF8. |
Referenced by evas_textblock_cursor_paragraph_text_get().
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).
cur | the cursor |
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(), and evas_textblock_cursor_format_is_visible_get().
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.
[in] | cur | the cursor. |
[out] | cx | the x of the cursor (or upper cursor) |
[out] | cy | the y 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 of the lower cursor |
[out] | cy2 | the y 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. |
EINA_TRUE
for split cursor, EINA_FALSE
otherwise References _EINA_INLIST_CONTAINER, EINA_FALSE, EINA_INLIST_GET, EINA_LIST_FOREACH, EINA_TRUE, evas_textblock_cursor_eol_get(), evas_textblock_cursor_geometry_get(), and evas_textblock_cursor_pen_geometry_get().
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.
cur | the cursor. |
cx | the x of the cursor |
cy | the y of the cursor |
cw | the width of the cursor |
ch | the height of the cursor |
dir | the direction of the cursor, can be NULL. |
ctype | the type of the cursor. |
References evas_textblock_cursor_pen_geometry_get().
Referenced by evas_textblock_cursor_geometry_bidi_get().
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.
cur | the position of the char. |
cx | the x of the char. |
cy | the y of the char. |
cw | the w of the char. |
ch | the h of the char. |
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.
cur | the position of the char. |
cpen_x | the pen_x of the char. |
cy | the y of the char. |
cadv | the adv of the char. |
ch | the h of the char. |
Referenced by evas_textblock_cursor_geometry_bidi_get(), and evas_textblock_cursor_geometry_get().
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.
cur | the position of the line. |
cx | the x of the line. |
cy | the y of the line. |
cw | the width of the line. |
ch | the height of the line. |
Eina_Bool evas_textblock_cursor_char_coord_set | ( | Evas_Textblock_Cursor * | cur, |
Evas_Coord | x, | ||
Evas_Coord | y | ||
) |
Set the position of the cursor according to the X and Y coordinates.
cur | the cursor to set. |
x | coord to set by. |
y | coord to set by. |
EINA_TRUE
on success, EINA_FALSE
otherwise. References EINA_FALSE, EINA_INLIST_FOREACH, EINA_TRUE, evas_textblock_cursor_line_char_first(), evas_textblock_cursor_line_char_last(), evas_textblock_cursor_paragraph_first(), and evas_textblock_cursor_paragraph_last().
int evas_textblock_cursor_line_coord_set | ( | Evas_Textblock_Cursor * | cur, |
Evas_Coord | y | ||
) |
Set the cursor position according to the y coord.
cur | the cur to be set. |
y | the coord to set by. |
References EINA_INLIST_FOREACH, EINA_INLIST_GET, evas_textblock_cursor_line_set(), evas_textblock_cursor_paragraph_first(), and evas_textblock_cursor_paragraph_last().
Referenced by evas_textblock_cursor_visible_range_get().
Eina_List* evas_textblock_cursor_range_geometry_get | ( | const Evas_Textblock_Cursor * | cur1, |
const Evas_Textblock_Cursor * | cur2 | ||
) |
Get the geometry of a range.
cur1 | one side of the range. |
cur2 | other side of the range. |
References EINA_INLIST_GET, eina_list_append(), eina_list_merge(), and evas_textblock_cursor_compare().
Eina_Bool evas_textblock_cursor_eol_get | ( | const Evas_Textblock_Cursor * | cur | ) |
Checks if the cursor points to the end of the line.
cur | the cursor to check. |
EINA_TRUE
if true, EINA_FALSE
otherwise. References EINA_FALSE, EINA_TRUE, evas_textblock_cursor_copy(), and evas_textblock_cursor_line_char_last().
Referenced by evas_textblock_cursor_geometry_bidi_get().
Evas_Object* evas_object_textblock_add | ( | Evas * | e | ) |
Adds a textblock to the given evas.
e | The given evas. |
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.
obj | The textblock object to work with. (if NULL , tries the default). |
text | The markup text (if NULL , return NULL ). |
References eina_strbuf_append(), eina_strbuf_append_length(), eina_strbuf_free(), eina_strbuf_new(), eina_strbuf_string_steal(), and evas_object_textblock_style_get().
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.
obj | the textblock object to work with (if NULL , it just does the default behaviour, i.e with no extra object information). |
text | The markup text (if NULL , return NULL ). |
References eina_strbuf_free(), eina_strbuf_new(), and eina_strbuf_string_steal().
void evas_object_textblock_style_set | ( | Evas_Object * | obj, |
const Evas_Textblock_Style * | ts | ||
) |
Set the objects style to ts.
obj | the Evas object to set the style to. |
ts | the style to set. |
References evas_obj_textblock_style_set.
const Evas_Textblock_Style* evas_object_textblock_style_get | ( | const Evas_Object * | obj | ) |
Return the style of an object.
obj | the object to get the style from. |
References evas_obj_textblock_style_get.
Referenced by evas_textblock_text_markup_to_utf8().
void evas_object_textblock_style_user_push | ( | Evas_Object * | obj, |
Evas_Textblock_Style * | ts | ||
) |
Push 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.
obj | the Evas object to set the style to. |
ts | the style to set. |
References evas_obj_textblock_style_user_push.
void evas_object_textblock_style_user_pop | ( | Evas_Object * | obj | ) |
Del the from the top of the user style stack.
obj | the object to get the style from. |
References evas_obj_textblock_style_user_pop.
const Evas_Textblock_Style* evas_object_textblock_style_user_peek | ( | const Evas_Object * | obj | ) |
Get (don't remove) the style at the top of the user style stack.
obj | the object to get the style from. |
References evas_obj_textblock_style_user_peek.
void evas_object_textblock_replace_char_set | ( | Evas_Object * | obj, |
const char * | ch | ||
) |
Set the "replacement character" to use for the given textblock object.
obj | The given textblock object. |
ch | The charset name. |
References evas_obj_textblock_replace_char_set.
const char* evas_object_textblock_replace_char_get | ( | Evas_Object * | obj | ) |
Get the "replacement character" for given textblock object.
Returns NULL
if no replacement character is in use.
obj | The given textblock object |
NULL
. References evas_obj_textblock_replace_char_get.
void evas_object_textblock_valign_set | ( | Evas_Object * | obj, |
double | align | ||
) |
Sets 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.).
obj | The given textblock object. |
align | A value between 0.0 and 1.0 . |
References evas_obj_textblock_valign_set.
double evas_object_textblock_valign_get | ( | const Evas_Object * | obj | ) |
Gets the vertical alignment of a textblock.
obj | The given textblock object. |
References evas_obj_textblock_valign_get.
void evas_object_textblock_bidi_delimiters_set | ( | Evas_Object * | obj, |
const char * | delim | ||
) |
Sets the BiDi delimiters used in the textblock.
BiDi delimiters are use for in-paragraph separation of bidi segments. This is useful for example in recipients fields of e-mail clients where bidi oddities can occur when mixing RTL and LTR.
obj | The given textblock object. |
delim | A null terminated string of delimiters, e.g ",|". |
References evas_obj_textblock_bidi_delimiters_set.
const char* evas_object_textblock_bidi_delimiters_get | ( | const Evas_Object * | obj | ) |
Gets the BiDi delimiters used in the textblock.
BiDi delimiters are use for in-paragraph separation of bidi segments. This is useful for example in recipients fields of e-mail clients where bidi oddities can occur when mixing RTL and LTR.
obj | The given textblock object. |
NULL
. References evas_obj_textblock_bidi_delimiters_get.
void evas_object_textblock_legacy_newline_set | ( | Evas_Object * | obj, |
Eina_Bool | mode | ||
) |
Sets newline mode.
When true, newline character will behave as a paragraph separator.
obj | The given textblock object. |
mode | EINA_TRUE for legacy mode, EINA_FALSE otherwise. |
References evas_obj_textblock_legacy_newline_set.
Eina_Bool evas_object_textblock_legacy_newline_get | ( | const Evas_Object * | obj | ) |
Gets newline mode.
When true, newline character behaves as a paragraph separator.
obj | The given textblock object. |
EINA_TRUE
if in legacy mode, EINA_FALSE
otherwise. References EINA_FALSE, and evas_obj_textblock_legacy_newline_get.
void evas_object_textblock_text_markup_set | ( | Evas_Object * | obj, |
const char * | text | ||
) |
Sets the tetxblock's text to the markup text.
obj | the textblock object. |
text | the markup text to use. |
References evas_obj_textblock_text_markup_set.
const char* evas_object_textblock_text_markup_get | ( | const Evas_Object * | obj | ) |
Return the markup of the object.
obj | the Evas object. |
References evas_obj_textblock_text_markup_get.
Evas_Textblock_Cursor* evas_object_textblock_cursor_get | ( | const Evas_Object * | obj | ) |
Return the object's main cursor.
obj | the object. |
obj's
main cursor. References evas_obj_textblock_cursor_get.
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.
obj | the object to associate to. |
References evas_obj_textblock_cursor_new.
const Eina_List* evas_textblock_node_format_list_get | ( | const Evas_Object * | obj, |
const char * | anchor | ||
) |
Returns the.
obj | The evas, must not be NULL . |
anchor | the anchor name to get |
References evas_obj_textblock_node_format_list_get.
const Evas_Object_Textblock_Node_Format* evas_textblock_node_format_first_get | ( | const Evas_Object * | obj | ) |
Returns the first format node.
obj | The evas, must not be NULL . |
References evas_obj_textblock_node_format_first_get.
const Evas_Object_Textblock_Node_Format* evas_textblock_node_format_last_get | ( | const Evas_Object * | obj | ) |
Returns the last format node.
obj | The evas textblock, must not be NULL. |
References evas_obj_textblock_node_format_last_get.
void evas_textblock_node_format_remove_pair | ( | Evas_Object * | obj, |
Evas_Object_Textblock_Node_Format * | n | ||
) |
Remove a format node and it's match.
i.e, removes a <tag> </tag> pair. Assumes the node is the first part of <tag> i.e, this won't work if n is a closing tag.
obj | the Evas object of the textblock - not null. |
n | the current format node - not null. |
References evas_obj_textblock_node_format_remove_pair.
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 | ||
) |
Get the geometry of a line number.
obj | the object. |
line | the line number. |
cx | x coord of the line. |
cy | y coord of the line. |
cw | w coord of the line. |
ch | h coord of the line. |
EINA_TRUE
on success, EINA_FALSE
otherwise. References EINA_FALSE, and evas_obj_textblock_line_number_geometry_get.
void evas_object_textblock_clear | ( | Evas_Object * | obj | ) |
Clear the textblock object.
obj | the object to clear. |
References evas_textblock_cursor_paragraph_first(), and evas_textblock_cursor_text_append().
void evas_object_textblock_size_formatted_get | ( | const Evas_Object * | obj, |
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Get 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.
obj | the Evas object. |
w | the width of the object. |
h | the height of the object |
References evas_obj_textblock_size_formatted_get.
void evas_object_textblock_size_native_get | ( | const Evas_Object * | obj, |
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Get 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.
obj | the Evas object of the textblock |
w | the width returned |
h | the height returned |
References evas_obj_textblock_size_native_get.