Data Structures | Functions
Textgrid Object Functions

Textgrid objects manage chunks of text as a 2D grid of cells, each of which contains a single unicode character with color and style formatting information. More...

Data Structures

struct  _Evas_Textgrid_Cell
 A cell contains a single unicode character, with associated formatting data including style, color, and color palette. More...
 

Functions

EVAS_API void evas_object_textgrid_supported_font_styles_set (Evas_Textgrid *obj, Evas_Textgrid_Font_Style styles)
 This function is not implemented yet, do not use. More...
 
EVAS_API Evas_Textgrid_Font_Style evas_object_textgrid_supported_font_styles_get (const Evas_Textgrid *obj)
 This function is not implemented yet, do not use. More...
 
EVAS_API void evas_object_textgrid_size_set (Evas_Textgrid *obj, int w, int h)
 Set the size of the textgrid object. More...
 
EVAS_API void evas_object_textgrid_size_get (const Evas_Textgrid *obj, int *w, int *h)
 Get the size of the textgrid object. More...
 
EVAS_API void evas_object_textgrid_cell_size_get (const Evas_Textgrid *obj, int *width, int *height)
 Retrieve the size of a cell of the given textgrid object in pixels. More...
 
EVAS_API void evas_object_textgrid_update_add (Evas_Textgrid *obj, int x, int y, int w, int h)
 Indicate for evas that part of a textgrid region (cells) has been updated. More...
 
EVAS_API void evas_object_textgrid_cellrow_set (Evas_Textgrid *obj, int y, const Evas_Textgrid_Cell *row)
 Set the string at the given row of the given textgrid object. More...
 
EVAS_API Evas_Textgrid_Cellevas_object_textgrid_cellrow_get (const Evas_Textgrid *obj, int y)
 Get the string at the given row of the given textgrid object. More...
 
EVAS_API void evas_object_textgrid_palette_set (Evas_Textgrid *obj, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a)
 The set color to the given palette at the given index of the given textgrid object. More...
 
EVAS_API void evas_object_textgrid_palette_get (const Evas_Textgrid *obj, Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a)
 The retrieve color to the given palette at the given index of the given textgrid object. More...
 

Detailed Description

Textgrid objects manage chunks of text as a 2D grid of cells, each of which contains a single unicode character with color and style formatting information.

The object's text can be interacted with character-by-character or by row.

Since
1.7

Function Documentation

◆ evas_object_textgrid_supported_font_styles_set()

EVAS_API void evas_object_textgrid_supported_font_styles_set ( Evas_Textgrid *  obj,
Evas_Textgrid_Font_Style  styles 
)

This function is not implemented yet, do not use.

Parameters
[in]objThe object.
[in]stylesEVAS_TEXTGRID_FONT_STYLE_NORMAL

◆ evas_object_textgrid_supported_font_styles_get()

EVAS_API Evas_Textgrid_Font_Style evas_object_textgrid_supported_font_styles_get ( const Evas_Textgrid *  obj)

This function is not implemented yet, do not use.

Parameters
[in]objThe object.
Returns
EVAS_TEXTGRID_FONT_STYLE_NORMAL

◆ evas_object_textgrid_size_set()

EVAS_API void evas_object_textgrid_size_set ( Evas_Textgrid *  obj,
int  w,
int  h 
)

Set the size of the textgrid object.

This function sets the number of lines h and the number of columns w for the textgrid object obj. If w or h are less than or equal to 0, this function does nothing.

Parameters
[in]objThe object.
[in]wThe number of columns (width in cells) of the grid.
[in]hThe number of rows (height in cells) of the grid.
Since
1.7

◆ evas_object_textgrid_size_get()

EVAS_API void evas_object_textgrid_size_get ( const Evas_Textgrid *  obj,
int *  w,
int *  h 
)

Get the size of the textgrid object.

This function retrieves the number of lines in the buffer h and the number of columns in the buffer w of the textgrid object obj. w or h can be null. On error, they are set to 0.

Parameters
[in]objThe object.
[out]wThe number of columns (width in cells) of the grid.
[out]hThe number of rows (height in cells) of the grid.
Since
1.7

◆ evas_object_textgrid_cell_size_get()

EVAS_API void evas_object_textgrid_cell_size_get ( const Evas_Textgrid *  obj,
int *  width,
int *  height 
)

Retrieve the size of a cell of the given textgrid object in pixels.

This functions retrieves the width and height, in pixels, of a cell of the textgrid object obj and stores them respectively in the buffers width and height. Their values depend on the monospace font and style used for the textgrid object. width and height can be null. On error, they are set to 0.

See also efl_text_font_size_set, efl_text_font_family_set and evas_object_textgrid_supported_font_styles_set

Parameters
[in]objThe object.
[out]widthA pointer to the location to store the cell's width in pixels.
[out]heightA pointer to the location to store the cell's height in pixels.
Since
1.7

◆ evas_object_textgrid_update_add()

EVAS_API void evas_object_textgrid_update_add ( Evas_Textgrid *  obj,
int  x,
int  y,
int  w,
int  h 
)

Indicate for evas that part of a textgrid region (cells) has been updated.

This function declares to evas that a region of cells was updated by code and needs refreshing.

See also evas_object_textgrid_cellrow_set, evas_object_textgrid_cellrow_get and evas_object_textgrid_size_set.

Parameters
[in]objThe object.
[in]xThe rect region of cells top-left x (column).
[in]yThe rect region of cells top-left y (row).
[in]wThe rect region size in number of cells (columns).
[in]hThe rect region size in number of cells (rows).
Since
1.7

◆ evas_object_textgrid_cellrow_set()

EVAS_API void evas_object_textgrid_cellrow_set ( Evas_Textgrid *  obj,
int  y,
const Evas_Textgrid_Cell row 
)

Set the string at the given row of the given textgrid object.

This function returns cells to the textgrid taken by evas_object_textgrid_cellrow_get. The row pointer row should be the same row pointer returned by evas_object_textgrid_cellrow_get for the same row y.

See also evas_object_textgrid_cellrow_get, evas_object_textgrid_size_set and evas_object_textgrid_update_add.

Parameters
[in]objThe object.
[in]yThe row index of the grid.
[in]rowThe string as a sequence of #Evas_Textgrid_Cell.
Since
1.7

◆ evas_object_textgrid_cellrow_get()

EVAS_API Evas_Textgrid_Cell * evas_object_textgrid_cellrow_get ( const Evas_Textgrid *  obj,
int  y 
)

Get the string at the given row of the given textgrid object.

This function returns a pointer to the first cell of the line y of the textgrid object obj. If y is not between 0 and the number of lines of the grid - 1, or on error, this function return null.

See also evas_object_textgrid_cellrow_set, evas_object_textgrid_size_set and evas_object_textgrid_update_add.

Parameters
[in]objThe object.
[in]yThe row index of the grid.
Returns
A pointer to the first cell of the given row.
Since
1.7

◆ evas_object_textgrid_palette_set()

EVAS_API void evas_object_textgrid_palette_set ( Evas_Textgrid *  obj,
Evas_Textgrid_Palette  pal,
int  idx,
int  r,
int  g,
int  b,
int  a 
)

The set color to the given palette at the given index of the given textgrid object.

This function sets the color for the palette of type pal at the index idx of the textgrid object obj. The ARGB components are given by r, g, b and a. This color can be used when setting the #Evas_Textgrid_Cell structure. The components must set a pre-multiplied color. If pal is #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST, or if idx is not between 0 and 255, or on error, this function does nothing. The color components are clamped between 0 and 255. If idx is greater than the latest set color, the colors between this last index and idx - 1 are set to black (0, 0, 0, 0).

See also evas_object_textgrid_palette_get.

Parameters
[in]objThe object.
[in]palThe type of the palette to set the color.
[in]idxThe index of the palette to which the color is stored.
[in]rThe red component of the color.
[in]gThe green component of the color.
[in]bThe blue component of the color.
[in]aThe alpha component of the color.
Since
1.7

◆ evas_object_textgrid_palette_get()

EVAS_API void evas_object_textgrid_palette_get ( const Evas_Textgrid *  obj,
Evas_Textgrid_Palette  pal,
int  idx,
int *  r,
int *  g,
int *  b,
int *  a 
)

The retrieve color to the given palette at the given index of the given textgrid object.

This function retrieves the color for the palette of type pal at the index idx of the textgrid object obj. The ARGB components are stored in the buffers r, g, b and a. If idx is not between 0 and the index of the latest set color, or if pal is #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST, the values of the components are 0. r, g, b and a can be null.

See also evas_object_textgrid_palette_set.

Parameters
[in]objThe object.
[in]palThe type of the palette to set the color.
[in]idxThe index of the palette to which the color is stored.
[out]rA pointer to the red component of the color.
[out]gA pointer to the green component of the color.
[out]bA pointer to the blue component of the color.
[out]aA pointer to the alpha component of the color.
Since
1.7