|
|
|
|
Etk_Textblock
Detailed Description
TODO: Etk_Textblock: brief description.
|
Data Structures |
struct | Etk_Textblock_Format |
struct | Etk_Textblock_Node |
struct | Etk_Textblock_Iter |
| The structure of a textblock iterator. More...
|
struct | Etk_Textblock |
| [Object] The structure of a textblock More...
|
Defines |
#define | ETK_TEXTBLOCK_TYPE (etk_textblock_type_get()) |
#define | ETK_TEXTBLOCK(obj) (ETK_OBJECT_CAST((obj), ETK_TEXTBLOCK_TYPE, Etk_Textblock)) |
#define | ETK_IS_TEXTBLOCK(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_TEXTBLOCK_TYPE)) |
Enumerations |
enum | Etk_Textblock_Wrap {
ETK_TEXTBLOCK_WRAP_NONE,
ETK_TEXTBLOCK_WRAP_DEFAULT,
ETK_TEXTBLOCK_WRAP_WORD,
ETK_TEXTBLOCK_WRAP_CHAR
} |
| The different types of wrapping to apply on a textblock object. More...
|
enum | Etk_Textblock_Node_Type {
ETK_TEXTBLOCK_NODE_ROOT,
ETK_TEXTBLOCK_NODE_PARAGRAPH,
ETK_TEXTBLOCK_NODE_LINE,
ETK_TEXTBLOCK_NODE_NORMAL
} |
| The different types of node. More...
|
enum | Etk_Textblock_Tag_Type {
ETK_TEXTBLOCK_TAG_DEFAULT,
ETK_TEXTBLOCK_TAG_BOLD,
ETK_TEXTBLOCK_TAG_ITALIC,
ETK_TEXTBLOCK_TAG_UNDERLINE,
ETK_TEXTBLOCK_TAG_STRIKETHROUGH,
ETK_TEXTBLOCK_TAG_P,
ETK_TEXTBLOCK_TAG_STYLE,
ETK_TEXTBLOCK_TAG_FONT
} |
| The different types of tag for a node. More...
|
enum | Etk_Textblock_Style_Type {
ETK_TEXTBLOCK_STYLE_NONE,
ETK_TEXTBLOCK_STYLE_OUTLINE,
ETK_TEXTBLOCK_STYLE_SHADOW,
ETK_TEXTBLOCK_STYLE_SOFT_OUTLINE,
ETK_TEXTBLOCK_STYLE_GLOW,
ETK_TEXTBLOCK_STYLE_OUTLINE_SHADOW,
ETK_TEXTBLOCK_STYLE_FAR_SHADOW,
ETK_TEXTBLOCK_STYLE_OUTLINE_SOFT_SHADOW,
ETK_TEXTBLOCK_STYLE_SOFT_SHADOW,
ETK_TEXTBLOCK_STYLE_FAR_SOFT_SHADOW
} |
| The different types of style that can be applied on a text. More...
|
enum | Etk_Textblock_Underline_Type {
ETK_TEXTBLOCK_UNDERLINE_NONE,
ETK_TEXTBLOCK_UNDERLINE_SINGLE,
ETK_TEXTBLOCK_UNDERLINE_DOUBLE
} |
| The different type of underlining for a text. More...
|
enum | Etk_Textblock_Gravity |
Functions |
Etk_Textblock * | etk_textblock_new () |
| Creates a new textblock.
|
void | etk_textblock_text_set (Etk_Textblock *tb, const char *text, Etk_Bool markup) |
| Sets the text of the textblock. The current text will be replaced by text.
|
Etk_String * | etk_textblock_text_get (Etk_Textblock *tb, Etk_Bool markup) |
| Gets the text of the textblock.
|
Etk_String * | etk_textblock_range_text_get (Etk_Textblock *tb, Etk_Textblock_Iter *iter1, Etk_Textblock_Iter *iter2, Etk_Bool markup) |
| Gets the text of the textblock, between iter1 and iter2.
|
void | etk_textblock_insert (Etk_Textblock *tb, Etk_Textblock_Iter *iter, const char *text, int length) |
| Inserts length bytes of text at iter in the textblock. If you want to use tags to format the text to insert, use etk_textblock_insert_markup() instead.
|
void | etk_textblock_insert_markup (Etk_Textblock *tb, Etk_Textblock_Iter *iter, const char *markup_text, int length) |
| Inserts length bytes of text at iter in the textblock. You can use tags to format the text to insert.
|
void | etk_textblock_clear (Etk_Textblock *tb) |
| Clears the textblock: removes all the text and all the tags.
|
void | etk_textblock_delete_before (Etk_Textblock *tb, Etk_Textblock_Iter *iter) |
| Deletes the char before the iterator.
|
void | etk_textblock_delete_after (Etk_Textblock *tb, Etk_Textblock_Iter *iter) |
| Deletes the char after the iterator.
|
void | etk_textblock_delete_range (Etk_Textblock *tb, Etk_Textblock_Iter *iter1, Etk_Textblock_Iter *iter2) |
| Deletes the text between iter1 and iter2.
|
Etk_Textblock_Iter * | etk_textblock_iter_new (Etk_Textblock *tb) |
| Creates a new iterator for the textblock.
|
void | etk_textblock_iter_free (Etk_Textblock_Iter *iter) |
| Destroys an iterator of the textblock.
|
void | etk_textblock_iter_gravity_set (Etk_Textblock_Iter *iter, Etk_Textblock_Gravity gravity) |
| Sets the gravity of the iterator. The gravity describes how the iterator should be placed when text is inserted at the iterator's position.
|
Etk_Textblock_Gravity | etk_textblock_iter_gravity_get (Etk_Textblock_Iter *iter) |
| Gets the gravity of the iterator.
|
void | etk_textblock_iter_backward_start (Etk_Textblock_Iter *iter) |
| Moves the iterator to the start of the textblock.
|
void | etk_textblock_iter_forward_end (Etk_Textblock_Iter *iter) |
| Moves the iterator to the end of the textblock.
|
Etk_Bool | etk_textblock_iter_backward_char (Etk_Textblock_Iter *iter) |
| Moves the iterator backward by one character offset.
|
Etk_Bool | etk_textblock_iter_forward_char (Etk_Textblock_Iter *iter) |
| Moves the iterator forward by one character offset.
|
void | etk_textblock_iter_copy (Etk_Textblock_Iter *dest, const Etk_Textblock_Iter *src) |
| Copies the iterator src to the iterator dest.
|
int | etk_textblock_iter_compare (Etk_Textblock_Iter *iter1, Etk_Textblock_Iter *iter2) |
| Compares two iterators.
|
Evas_Object * | etk_textblock_object_add (Etk_Textblock *tb, Evas *evas) |
| Creates a new evas object that will display the content of the textblock.
A textblock can have several evas objects which display its content. All the evas objects are automatically updated when the textblock's content is changed.
|
void | etk_textblock_object_wrap_set (Evas_Object *tbo, Etk_Textblock_Wrap wrap) |
| Sets how the text of the textblock object should be wrapped by default (a paragraph can override this setting).
|
Etk_Textblock_Wrap | etk_textblock_object_wrap_get (Evas_Object *tbo) |
| Gets the default wrap mode of the textblock object.
|
Etk_Textblock_Iter * | etk_textblock_object_cursor_get (Evas_Object *tbo) |
| Gets the cursor's iterator of the textblock object.
|
Etk_Textblock_Iter * | etk_textblock_object_selection_bound_get (Evas_Object *tbo) |
| Gets the selection bound's iterator of the textblock object.
|
void | etk_textblock_object_cursor_visible_set (Evas_Object *tbo, Etk_Bool visible) |
| Sets whether the cursor of the textblock object is visible or not.
|
Etk_Bool | etk_textblock_object_cursor_visible_get (Evas_Object *tbo) |
| Gets whether the cursor of the textblock object is visible or not.
|
int | etk_textblock_unicode_length_get (const char *unicode_string) |
| Gets the length of a unicode-encoded string. It's not always the number of bytes of the string since a character can be encoded with several bytes in unicode.
|
Etk_Bool | etk_textblock_is_white_char (int c) |
| Gets whether or not the unicode char is a white char.
|
void | etk_textblock_char_size_get (Evas *evas, const char *font_face, int font_size, int *w, int *h) |
| Gets the average size of a character written with font font_name.
|
void | etk_textblock_printf (Etk_Textblock *tb) |
| Prints the textblock hierarchy for debug TODO: etk_textblock_printf(): Remove this function.
|
Define Documentation
#define ETK_TEXTBLOCK_TYPE (etk_textblock_type_get()) |
Gets the type of a textblock
#define ETK_TEXTBLOCK |
( |
obj |
|
) |
(ETK_OBJECT_CAST((obj), ETK_TEXTBLOCK_TYPE, Etk_Textblock)) |
#define ETK_IS_TEXTBLOCK |
( |
obj |
|
) |
(ETK_OBJECT_CHECK_TYPE((obj), ETK_TEXTBLOCK_TYPE)) |
Enumeration Type Documentation
The different types of wrapping to apply on a textblock object.
- Enumerator:
-
ETK_TEXTBLOCK_WRAP_NONE |
The text is not wrapped |
ETK_TEXTBLOCK_WRAP_DEFAULT |
TODOC |
ETK_TEXTBLOCK_WRAP_WORD |
The text is wrapped between the words (or between the chars if it's not sufficient) |
ETK_TEXTBLOCK_WRAP_CHAR |
The text is wrapped between the chars |
The different types of node.
- Enumerator:
-
ETK_TEXTBLOCK_NODE_ROOT |
The node is the root node |
ETK_TEXTBLOCK_NODE_PARAGRAPH |
The node is a paragraph node |
ETK_TEXTBLOCK_NODE_LINE |
The node is a line node |
ETK_TEXTBLOCK_NODE_NORMAL |
The node is a normal node (containing some text or a format) |
The different types of tag for a node.
- Enumerator:
-
ETK_TEXTBLOCK_TAG_DEFAULT |
The default tag: no formatting |
ETK_TEXTBLOCK_TAG_BOLD |
The text is bold |
ETK_TEXTBLOCK_TAG_ITALIC |
The text is italic |
ETK_TEXTBLOCK_TAG_UNDERLINE |
The text is underlined |
ETK_TEXTBLOCK_TAG_STRIKETHROUGH |
The text is strikethrough |
ETK_TEXTBLOCK_TAG_P |
The tag describes a paragraph |
ETK_TEXTBLOCK_TAG_STYLE |
The tag describes the style of the text (normal, glow, ...) |
ETK_TEXTBLOCK_TAG_FONT |
The tag describes the font used by the text (face, size, ...) |
The different types of style that can be applied on a text.
- Enumerator:
-
ETK_TEXTBLOCK_STYLE_NONE |
No style is applied |
ETK_TEXTBLOCK_STYLE_OUTLINE |
The text is outlined |
ETK_TEXTBLOCK_STYLE_SHADOW |
The text has a sharp shadow |
ETK_TEXTBLOCK_STYLE_SOFT_OUTLINE |
The text has a soft outline |
ETK_TEXTBLOCK_STYLE_GLOW |
The text has a glow |
ETK_TEXTBLOCK_STYLE_OUTLINE_SHADOW |
The text is outlined and has a sharp shadow |
ETK_TEXTBLOCK_STYLE_FAR_SHADOW |
The text has a sharp far shadow |
ETK_TEXTBLOCK_STYLE_OUTLINE_SOFT_SHADOW |
The text is outlined and has a soft shadow |
ETK_TEXTBLOCK_STYLE_SOFT_SHADOW |
The text has a soft shadow |
ETK_TEXTBLOCK_STYLE_FAR_SOFT_SHADOW |
The text has a far soft shadow |
The different type of underlining for a text.
- Enumerator:
-
ETK_TEXTBLOCK_UNDERLINE_NONE |
The text is not underlined |
ETK_TEXTBLOCK_UNDERLINE_SINGLE |
The text is underlined by a single line |
ETK_TEXTBLOCK_UNDERLINE_DOUBLE |
The text is underlined by two lines |
Function Documentation
Creates a new textblock.
- Returns:
- Returns the new textblock
void etk_textblock_text_set |
( |
Etk_Textblock * |
tb, |
|
|
const char * |
text, |
|
|
Etk_Bool |
markup | |
|
) |
| | |
Sets the text of the textblock. The current text will be replaced by text.
- Parameters:
-
| tb | a textblock |
| text | the text to set |
| markup | whether or not you want to apply markup and styling on the text. If markup is ETK_TRUE, you can use tags to format the text. |
- Note:
- After that, the iterators with right gravity will be at the end of the textblock, and iterators with left gravity will be at the start of the textblock
Gets the text of the textblock.
- Parameters:
-
| tb | a textblock |
| markup | whether or not you want to have tags in the returned text |
- Returns:
- Returns a string containing the text of the textblock
- Note:
- Once you no longer need the returned string, you should destroy it with etk_object_destroy()
Gets the text of the textblock, between iter1 and iter2.
- Parameters:
-
| tb | a textblock |
| iter1 | the first iterator |
| iter2 | the second_iterator |
| markup | whether or not you want to have tags in the returned text |
- Returns:
- Returns a string containing the text of the textblock, between iter1 and iter2
- Note:
- Once you no longer need the returned string, you should destroy it with etk_object_destroy()
iter1 is not necessarily before iter2
Inserts length bytes of text at iter in the textblock. If you want to use tags to format the text to insert, use etk_textblock_insert_markup() instead.
- Parameters:
-
| tb | a textblock |
| iter | the iterator where to insert the text.
If the gravity of iter is left, the iter will be placed before the inserted text. Otherwise, the iterator will placed after the inserted text. |
| text | the unicode-encoded text to insert |
| length | the number of bytes to insert. If length is negative, the text will be entirely inserted |
Inserts length bytes of text at iter in the textblock. You can use tags to format the text to insert.
- Parameters:
-
| tb | a textblock |
| iter | the iterator where to insert the text.
If the gravity of iter is left, the iter will be placed before the inserted text. Otherwise, the iterator will placed after the inserted text. |
| text | the unicode-encoded markup text to insert |
| length | the number of bytes to insert. If length is negative, the text will be entirely inserted |
Clears the textblock: removes all the text and all the tags.
- Parameters:
-
| tb | the textblock to clear |
Deletes the char before the iterator.
- Parameters:
-
| tb | a textblock |
| iter | the iterator where to delete the char |
Deletes the char after the iterator.
- Parameters:
-
| tb | a textblock |
| iter | the iterator where to delete the char |
Deletes the text between iter1 and iter2.
- Parameters:
-
| tb | a textblock |
| iter1 | the first iterator |
| iter2 | the second iterator |
- Note:
- iter1 is not necessarily before iter2
Creates a new iterator for the textblock.
- Parameters:
-
- Returns:
- Returns the new iterator, placed at the start of the first node of the textblock
Destroys an iterator of the textblock.
- Parameters:
-
| iter | the iterator to destroy |
Sets the gravity of the iterator. The gravity describes how the iterator should be placed when text is inserted at the iterator's position.
- Parameters:
-
| iter | an iterator |
| gravity | the gravity to set to the iterator |
Gets the gravity of the iterator.
- Parameters:
-
- Returns:
- Returns the gravity of the iterator (ETK_TEXTBLOCK_GRAVITY_RIGHT by default)
Moves the iterator to the start of the textblock.
- Parameters:
-
Moves the iterator to the end of the textblock.
- Parameters:
-
Moves the iterator backward by one character offset.
- Parameters:
-
- Returns:
- Returns ETK_FALSE if the movement was not possible (i.e. the iterator is already before the first character of the textblock)
Moves the iterator forward by one character offset.
- Parameters:
-
- Returns:
- Returns ETK_FALSE if the movement was not possible (i.e. the iterator is already after the last character of the textblock)
Copies the iterator src to the iterator dest.
- Parameters:
-
| dest | the destination iterator |
| src | the source iterator |
Compares two iterators.
- Parameters:
-
| iter1 | the first iterator |
| iter2 | the second iterator |
- Returns:
- Returns -1 if iter1 is before iter2, 1 if iter1 is after iter2 and 0 if iter1 is equal to iter2
Evas_Object * etk_textblock_object_add |
( |
Etk_Textblock * |
tb, |
|
|
Evas * |
evas | |
|
) |
| | |
Creates a new evas object that will display the content of the textblock.
A textblock can have several evas objects which display its content. All the evas objects are automatically updated when the textblock's content is changed.
- Parameters:
-
| tb | the textblock whose content will be displayed by the evas object |
| evas | the evas to which the object will be added |
- Returns:
- Returns a new evas object that display the content of the textblock
Sets how the text of the textblock object should be wrapped by default (a paragraph can override this setting).
- Parameters:
-
| tbo | a textblock object |
| wrap | the wrap mode. Here, ETK_TEXTBLOCK_WRAP_DEFAULT is equivalent to ETK_TEXTBLOCK_WRAP_WORD |
Gets the default wrap mode of the textblock object.
- Parameters:
-
- Returns:
- Returns the wrap mode of the textblock object
Gets the cursor's iterator of the textblock object.
- Parameters:
-
- Returns:
- Returns the cursor's iterator of the textblock object
- Warning:
- You should not free the returned iterator
Gets the selection bound's iterator of the textblock object.
- Parameters:
-
- Returns:
- Returns the selection bound's iterator of the textblock object
- Warning:
- You should not free the returned iterator
void etk_textblock_object_cursor_visible_set |
( |
Evas_Object * |
tbo, |
|
|
Etk_Bool |
visible | |
|
) |
| | |
Sets whether the cursor of the textblock object is visible or not.
- Parameters:
-
| tbo | a textblock object |
| visible | ETK_TRUE to show the cursor, ETK_FALSE to hide it |
Etk_Bool etk_textblock_object_cursor_visible_get |
( |
Evas_Object * |
tbo |
) |
|
Gets whether the cursor of the textblock object is visible or not.
- Parameters:
-
- Returns:
- Returns ETK_TRUE if the cursor is visible, ETK_FALSE otherwise
int etk_textblock_unicode_length_get |
( |
const char * |
unicode_string |
) |
|
Gets the length of a unicode-encoded string. It's not always the number of bytes of the string since a character can be encoded with several bytes in unicode.
- Parameters:
-
| unicode_string | a unicode-encoded string |
- Returns:
- Returns the unicode length of unicode_string
Etk_Bool etk_textblock_is_white_char |
( |
int |
c |
) |
|
Gets whether or not the unicode char is a white char.
- Parameters:
-
- Returns:
- Returns ETK_TRUE if c is a white char, ETK_FALSE otherwise
void etk_textblock_char_size_get |
( |
Evas * |
evas, |
|
|
const char * |
font_face, |
|
|
int |
font_size, |
|
|
int * |
w, |
|
|
int * |
h | |
|
) |
| | |
Gets the average size of a character written with font font_name.
- Parameters:
-
| evas | an evas |
| font_face | the face of the font to use |
| font_size | the size of the font to use |
| w | the location where to store the average width of a character |
| h | the location where to store the average height of a character |
|
|
|
|
|
|