lib/ewl_text.c File Reference
#include "ewl_base.h"
#include "ewl_text.h"
#include "ewl_text_context.h"
#include "ewl_text_fmt.h"
#include "ewl_text_trigger.h"
#include "ewl_private.h"
#include "ewl_macros.h"
#include "ewl_debug.h"
#include <Evas.h>
Include dependency graph for ewl_text.c:

Defines | |
#define | EWL_TEXT_CHAR_BYTE_LEN(s) (ewl_text_trailing_bytes[((unsigned char)((s)[0])) >> 3]) |
#define | EWL_TEXT_EXTEND_VAL 4096 |
Functions | |
void | ewl_text_align_apply (Ewl_Text *t, unsigned int align, unsigned int char_len) |
This will set the given alignment from the current cursor position for the given length of text. | |
unsigned int | ewl_text_align_get (Ewl_Text *t, unsigned int char_idx) |
Retrieves the alignment value from the given index. | |
void | ewl_text_align_set (Ewl_Text *t, unsigned int align) |
Set the current alignment value of the text. | |
void | ewl_text_all_select (Ewl_Text *t) |
Select the whole text. | |
void | ewl_text_bg_color_apply (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int char_len) |
This will set the bg colour of the text from the current cursor position to the given length. | |
void | ewl_text_bg_color_get (Ewl_Text *t, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a, unsigned int char_idx) |
Get the text background colour at the given index. | |
void | ewl_text_bg_color_set (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Set the background colour at the cursor. | |
void | ewl_text_cb_child_add (Ewl_Container *c, Ewl_Widget *w) |
void | ewl_text_cb_child_remove (Ewl_Container *c, Ewl_Widget *w, int idx) |
void | ewl_text_cb_configure (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_cb_destroy (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_cb_hide (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_cb_mouse_down (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_cb_mouse_move (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_cb_mouse_up (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_cb_obscure (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_cb_reveal (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_cb_show (Ewl_Widget *w, void *ev, void *data) |
void | ewl_text_clear (Ewl_Text *t) |
Clear the text widget. | |
void | ewl_text_color_apply (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int char_len) |
This will set the given colour from the current cursor position for the specified length. | |
void | ewl_text_color_get (Ewl_Text *t, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a, unsigned int char_idx) |
Retrives the text colour at the given index. | |
void | ewl_text_color_set (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Set the text colour at the cursor. | |
unsigned int | ewl_text_coord_index_map (Ewl_Text *t, int x, int y) |
Map the given coordinate into an index into the text widget. | |
unsigned int | ewl_text_cursor_position_get (Ewl_Text *t) |
Retrieve the cursor position from the text widget. | |
unsigned int | ewl_text_cursor_position_line_down_get (Ewl_Text *t) |
Get the index if we were to move the cursor down one line. | |
unsigned int | ewl_text_cursor_position_line_up_get (Ewl_Text *t) |
Get the index if we were to move the cursor up one line. | |
void | ewl_text_cursor_position_set (Ewl_Text *t, unsigned int char_pos) |
Set the cursor position in the text widget. | |
void | ewl_text_double_underline_color_apply (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int char_len) |
This will set the double_underline colour of the text from the current cursor position to the given length. | |
void | ewl_text_double_underline_color_get (Ewl_Text *t, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a, unsigned int char_idx) |
Retrieve the double underline colour at the given index. | |
void | ewl_text_double_underline_color_set (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Set the double underline colour at the cursor. | |
void | ewl_text_font_apply (Ewl_Text *t, const char *font, unsigned int char_len) |
This will apply the specfied font from the current cursor position to the length specified. | |
char * | ewl_text_font_get (Ewl_Text *t, unsigned int char_idx) |
This will retrive the font used at the specified index in the text. | |
void | ewl_text_font_set (Ewl_Text *t, const char *font) |
This will set the current font to be used when we insert more text. | |
void | ewl_text_font_size_apply (Ewl_Text *t, unsigned int size, unsigned int char_len) |
This will apply the font size to the text from the current cursor position for the given length. | |
unsigned int | ewl_text_font_size_get (Ewl_Text *t, unsigned int char_idx) |
Retrieve the font size at the given index. | |
void | ewl_text_font_size_set (Ewl_Text *t, unsigned int size) |
Set the font size to use when inserting new text. | |
void | ewl_text_font_source_apply (Ewl_Text *t, const char *source, const char *font, unsigned int char_len) |
This will apply the specfied font from the current cursor position to the length specified. | |
char * | ewl_text_font_source_get (Ewl_Text *t, unsigned int char_idx) |
This will retrive the font source used at the specified index in the text. | |
void | ewl_text_font_source_set (Ewl_Text *t, const char *source, const char *font) |
This will set the current font to be used when we insert more text. | |
void | ewl_text_glow_color_apply (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int char_len) |
This will set the glow colour of the text from the current cursor position to the given length. | |
void | ewl_text_glow_color_get (Ewl_Text *t, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a, unsigned int char_idx) |
Get the glow colour at the given index. | |
void | ewl_text_glow_color_set (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Set the glow colour at the cursor. | |
unsigned int | ewl_text_has_selection (Ewl_Text *t) |
Check if anything is selected in the text widget. | |
void | ewl_text_index_geometry_map (Ewl_Text *t, unsigned int char_idx, int *x, int *y, int *w, int *h) |
Map the given character index into a position in the text widget. | |
int | ewl_text_init (Ewl_Text *t) |
Initializes an Ewl_Text widget to default values. | |
unsigned int | ewl_text_length_get (Ewl_Text *t) |
Retrieve the character length of the text. | |
unsigned int | ewl_text_length_maximum_get (Ewl_Text *t) |
Retrieve if maximum number of characters. | |
void | ewl_text_length_maximum_set (Ewl_Text *t, unsigned int char_num) |
Set the maximum number of characters. | |
Ewl_Widget * | ewl_text_new (void) |
Creates a new Ewl_Text widget. | |
const char * | ewl_text_obscure_get (Ewl_Text *t) |
Retrieves the character used to obscure the text for a password. | |
void | ewl_text_obscure_set (Ewl_Text *t, const char *o) |
Sets the character used to obscure the text for a password. Every character will be replaced by this character on the output. | |
void | ewl_text_offsets_get (Ewl_Text *t, int *x, int *y) |
Retrieve the current layout offsets of the text. | |
void | ewl_text_offsets_set (Ewl_Text *t, int x, int y) |
Set the current layout offsets of the text. | |
void | ewl_text_outline_color_apply (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int char_len) |
This will set the outline colour of the text from the current cursor position to the given length. | |
void | ewl_text_outline_color_get (Ewl_Text *t, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a, unsigned int char_idx) |
Get the outline colour at the given index. | |
void | ewl_text_outline_color_set (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Set the outline colour at the cursor. | |
void | ewl_text_select (Ewl_Text *t, unsigned int char_idx, unsigned int char_len) |
Select the text. | |
unsigned int | ewl_text_selectable_get (Ewl_Text *t) |
Get the selectable state of the text. | |
void | ewl_text_selectable_set (Ewl_Text *t, unsigned int selectable) |
Set if the text is selectable. | |
Ewl_Widget * | ewl_text_selection_get (Ewl_Text *t) |
Get the current text selection. | |
char * | ewl_text_selection_text_get (Ewl_Text *t) |
Gets the current text of the selection. | |
void | ewl_text_shadow_color_apply (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int char_len) |
This will set the shadow colour of the text from the current cursor position to the given length. | |
void | ewl_text_shadow_color_get (Ewl_Text *t, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a, unsigned int char_idx) |
Retrieve the shadow colour at the given index. | |
void | ewl_text_shadow_color_set (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Set the shadow colour at the cursor. | |
void | ewl_text_strikethrough_color_apply (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int char_len) |
This will set the strikethrough colour of the text from the current cursor position to the given length. | |
void | ewl_text_strikethrough_color_get (Ewl_Text *t, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a, unsigned int char_idx) |
Retrieve the strikethrough colour at the given index. | |
void | ewl_text_strikethrough_color_set (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Set the strikethrough colour at the cursor. | |
void | ewl_text_style_add (Ewl_Text *t, Ewl_Text_Style style, unsigned int char_len) |
This will add the given style to the text from the cursor up to length characters. | |
void | ewl_text_style_del (Ewl_Text *t, Ewl_Text_Style style, unsigned int char_len) |
This will delete the given style from the text starting at the cursor up to length characters. | |
unsigned int | ewl_text_style_has (Ewl_Text *t, Ewl_Text_Style style, unsigned int char_idx) |
Check if the given style is set at the given index in the text. | |
void | ewl_text_style_invert (Ewl_Text *t, Ewl_Text_Style style, unsigned int char_len) |
This will invert the given style in the text starting at the cursor up to length characters. | |
void | ewl_text_styles_apply (Ewl_Text *t, unsigned int styles, unsigned int char_len) |
This will set the given style from the current cursor position for the given length of text. | |
unsigned int | ewl_text_styles_get (Ewl_Text *t, unsigned int char_idx) |
Retrives the styles in use at the given index. | |
void | ewl_text_styles_set (Ewl_Text *t, unsigned int styles) |
Sets the given styles into the text at the cursor. | |
void | ewl_text_text_append (Ewl_Text *t, const char *text) |
Append the text into the text widget. | |
void | ewl_text_text_delete (Ewl_Text *t, unsigned int char_len) |
This will delete the specified length of text from the current cursor position. | |
char * | ewl_text_text_get (Ewl_Text *t) |
Retrieve the text from the text widget. | |
void | ewl_text_text_insert (Ewl_Text *t, const char *text, unsigned int char_idx) |
Insert the given text into the text widget. | |
char * | ewl_text_text_next_char (const char *text, unsigned int *idx) |
void | ewl_text_text_prepend (Ewl_Text *t, const char *text) |
Prepend the given text into the text widget. | |
void | ewl_text_text_set (Ewl_Text *t, const char *text) |
Set the text in the text widget. | |
void | ewl_text_underline_color_apply (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int char_len) |
This will set the underline colour of the text from the current cursor position to the given length. | |
void | ewl_text_underline_color_get (Ewl_Text *t, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a, unsigned int char_idx) |
Retrieve the underline colour at the given index. | |
void | ewl_text_underline_color_set (Ewl_Text *t, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Set the underline colour at the cursor. | |
void | ewl_text_wrap_apply (Ewl_Text *t, Ewl_Text_Wrap wrap, unsigned int char_len) |
This will apply the given wrap value from the current cursor position for the given length of text. | |
Ewl_Text_Wrap | ewl_text_wrap_get (Ewl_Text *t, unsigned int char_idx) |
Retrives the text wrap value at the given index. | |
void | ewl_text_wrap_set (Ewl_Text *t, Ewl_Text_Wrap wrap) |
Sets the wrap value of the text at the given index. |
Define Documentation
#define EWL_TEXT_CHAR_BYTE_LEN | ( | s | ) | (ewl_text_trailing_bytes[((unsigned char)((s)[0])) >> 3]) |
Referenced by ewl_text_obscure_set(), and ewl_text_text_next_char().
#define EWL_TEXT_EXTEND_VAL 4096 |
Function Documentation
const char* ewl_text_obscure_get | ( | Ewl_Text * | t | ) |
Retrieves the character used to obscure the text for a password.
- Parameters:
-
t,: the text to retrieve the obscuring character
- Returns:
- Returns the character value of the obscuring character. This is a null-terminated string containing an UTF-8 character or NULL if the text isn't set to obscure the text.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_TEXT_TYPE, and Ewl_Text::obscure.