Data Structures

struct  _Evas_Textgrid_Cell
 The values that describes each cell. More...
 

Typedefs

typedef struct _Evas_Textgrid_Cell Evas_Textgrid_Cell
 The values that describes each cell. More...
 

Enumerations

enum  Evas_Textgrid_Palette {
  EVAS_TEXTGRID_PALETTE_NONE,
  EVAS_TEXTGRID_PALETTE_STANDARD,
  EVAS_TEXTGRID_PALETTE_EXTENDED,
  EVAS_TEXTGRID_PALETTE_LAST
}
 The palette to use for the forgraound and background colors. More...
 
enum  Evas_Textgrid_Font_Style {
  EVAS_TEXTGRID_FONT_STYLE_NORMAL = (1 << 0),
  EVAS_TEXTGRID_FONT_STYLE_BOLD = (1 << 1),
  EVAS_TEXTGRID_FONT_STYLE_ITALIC = (1 << 2)
}
 The style to give to each character of the grid. More...
 

Functions

Evas_Objectevas_object_textgrid_add (Evas *e)
 Add a textgrid to the given Evas. More...
 
void evas_object_textgrid_size_set (Evas_Object *obj, int w, int h)
 Set the size of the textgrid object. More...
 
void evas_object_textgrid_size_get (const Evas_Object *obj, int *w, int *h)
 Get the size of the textgrid object. More...
 
void evas_object_textgrid_font_source_set (Evas_Object *obj, const char *font_source)
 Set the font (source) file to be used on a given textgrid object. More...
 
const char * evas_object_textgrid_font_source_get (const Evas_Object *obj)
 Get the font file's path which is being used on a given textgrid object. More...
 
void evas_object_textgrid_font_set (Evas_Object *obj, const char *font_name, Evas_Font_Size font_size)
 Set the font family and size on a given textgrid object. More...
 
void evas_object_textgrid_font_get (const Evas_Object *obj, const char **font_name, Evas_Font_Size *font_size)
 Retrieve the font family and size in use on a given textgrid object. More...
 
void evas_object_textgrid_cell_size_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
 Retrieve the size of a cell of the given textgrid object in pixels. More...
 
void evas_object_textgrid_palette_set (Evas_Object *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...
 
void evas_object_textgrid_palette_get (const Evas_Object *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...
 
void evas_object_textgrid_cellrow_set (Evas_Object *obj, int y, const Evas_Textgrid_Cell *row)
 Set the string at the given row of the given textgrid object. More...
 
Evas_Textgrid_Cellevas_object_textgrid_cellrow_get (const Evas_Object *obj, int y)
 Get the string at the given row of the given textgrid object. More...
 
void evas_object_textgrid_update_add (Evas_Object *obj, int x, int y, int w, int h)
 Indicate for evas that part of a textgrid region (cells) has been updated. More...
 

Detailed Description

Todo:
put here some usage examples
Since
1.7

Typedef Documentation

The values that describes each cell.

Since
1.7

Enumeration Type Documentation

The style to give to each character of the grid.

Since
1.7
Enumerator
EVAS_TEXTGRID_FONT_STYLE_NORMAL 

Normal style.

EVAS_TEXTGRID_FONT_STYLE_BOLD 

Bold style.

EVAS_TEXTGRID_FONT_STYLE_ITALIC 

Oblique style.

The palette to use for the forgraound and background colors.

Since
1.7
Enumerator
EVAS_TEXTGRID_PALETTE_NONE 

No palette is used.

EVAS_TEXTGRID_PALETTE_STANDARD 

standard palette (around 16 colors)

EVAS_TEXTGRID_PALETTE_EXTENDED 

extended palette (at max 256 colors)

EVAS_TEXTGRID_PALETTE_LAST 

ignore it

Function Documentation

Evas_Object* evas_object_textgrid_add ( Evas e)

Add a textgrid to the given Evas.

Parameters
eThe given evas.
Returns
The new textgrid object.

This function adds a new textgrid object to the Evas e and returns the object.

Since
1.7
void evas_object_textgrid_cell_size_get ( const Evas_Object obj,
Evas_Coord *  w,
Evas_Coord *  h 
)

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

Parameters
objThe textgrid object to query for font information.
widthA pointer to the location to store the width in pixels of a cell.
heightA pointer to the location to store the height in pixels of a cell.

This functions retrieves the width and height, in pixels, of a cell of the textgrid object obj and store them respectively in the buffers width and height. Their value depends on the monospace font used for the textgrid object, as well as the style. width and height can be NULL. On error, they are set to 0.

See Also
evas_object_textgrid_font_set()
evas_object_textgrid_supported_font_styles_set()
Since
1.7
Evas_Textgrid_Cell* evas_object_textgrid_cellrow_get ( const Evas_Object obj,
int  y 
)

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

Parameters
objThe textgrid object to query for font information.
yThe row index of the grid.
Returns
A pointer to the first cell of the given row.

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()
evas_object_textgrid_update_add()
Since
1.7
void evas_object_textgrid_cellrow_set ( Evas_Object obj,
int  y,
const Evas_Textgrid_Cell row 
)

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

Parameters
objThe textgrid object to query for font information.
yThe row index of the grid.
Thestring as a sequence of Evas_Textgrid_Cell.

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()
evas_object_textgrid_update_add()
Since
1.7
void evas_object_textgrid_font_get ( const Evas_Object obj,
const char **  font_name,
Evas_Font_Size *  font_size 
)

Retrieve the font family and size in use on a given textgrid object.

Parameters
objThe textgrid object to query for font information.
font_nameA pointer to the location to store the font name in.
font_sizeA pointer to the location to store the font size in.

This function allows the font name and size of a textgrid object obj to be queried and stored respectively in the buffers font_name and font_size. Be aware that the font name string is still owned by Evas and should not have free() called on it by the caller of the function. On error, the font name is the empty string and the font size is 0. font_name and font_source can be NULL.

See Also
evas_object_textgrid_font_set()
evas_object_textgrid_font_source_set()
evas_object_textgrid_font_source_get()
Since
1.7
void evas_object_textgrid_font_set ( Evas_Object obj,
const char *  font_name,
Evas_Font_Size  font_size 
)

Set the font family and size on a given textgrid object.

Parameters
objThe textgrid object to set font for.
font_nameThe font (family) name.
font_sizeThe font size, in points.

This function allows the font name font_name and size font_size of the textgrid object obj to be set. The font_name string has to follow fontconfig's convention on naming fonts, as it's the underlying library used to query system fonts by Evas (see the fc-list command's output, on your system, to get an idea). It also has to be a monospace font. If font_name is NULL, or if it is an empty string, or if font_size is less or equal than 0, or on error, this function does nothing.

See Also
evas_object_textgrid_font_get()
evas_object_textgrid_font_source_set()
evas_object_textgrid_font_source_get()
Since
1.7

References evas_event_feed_mouse_move().

const char* evas_object_textgrid_font_source_get ( const Evas_Object obj)

Get the font file's path which is being used on a given textgrid object.

Parameters
objThe textgrid object to set font for.
Returns
The font file's path.

This function returns the font source path of the textgrid object obj. If the font source path has not been set, or on error, NULL is returned.

See Also
evas_object_textgrid_font_get()
evas_object_textgrid_font_set()
evas_object_textgrid_font_source_set()
Since
1.7
void evas_object_textgrid_font_source_set ( Evas_Object obj,
const char *  font_source 
)

Set the font (source) file to be used on a given textgrid object.

Parameters
objThe textgrid object to set font for.
font_sourceThe font file's path.

This function allows the font file font_source to be explicitly set for the textgrid object obj, overriding system lookup, which will first occur in the given file's contents. If is NULL or is an empty string, or the same font_source has already been set, or on error, this function does nothing.

See Also
evas_object_textgrid_font_get()
evas_object_textgrid_font_set()
evas_object_textgrid_font_source_get()
Since
1.7
void evas_object_textgrid_palette_get ( const Evas_Object 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.

Parameters
objThe textgrid object to query for font information.
palThe type of the palette to set the color.
idxThe index of the paletter to wich the color is stored.
rA pointer to the red component of the color.
gA pointer to the green component of the color.
bA pointer to the blue component of the color.
aA pointer to the alpha component of the color.

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, and a can be NULL.

See Also
evas_object_textgrid_palette_set()
Since
1.7

References EVAS_TEXTGRID_PALETTE_EXTENDED, and EVAS_TEXTGRID_PALETTE_STANDARD.

void evas_object_textgrid_palette_set ( Evas_Object 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.

Parameters
objThe textgrid object to query for font information.
palThe type of the palette to set the color.
idxThe index of the paletter to wich the color is stored.
rThe red component of the color.
gThe green component of the color.
bThe blue component of the color.
aThe alpha component of the color.

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()
Since
1.7

References EVAS_TEXTGRID_PALETTE_EXTENDED, and EVAS_TEXTGRID_PALETTE_STANDARD.

void evas_object_textgrid_size_get ( const Evas_Object obj,
int *  w,
int *  h 
)

Get the size of the textgrid object.

Parameters
objThe textgrid object.
wThe number of columns of the grid.
hThe number of rows of the grid.

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, their value is 0.

Since
1.7
void evas_object_textgrid_size_set ( Evas_Object obj,
int  w,
int  h 
)

Set the size of the textgrid object.

Parameters
objThe textgrid object.
wThe number of columns (width in cells) of the grid.
hThe number of rows (height in cells) of the grid.

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

Since
1.7
void evas_object_textgrid_update_add ( Evas_Object obj,
int  x,
int  y,
int  w,
int  h 
)

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

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

This function declares to evas that a region of cells was updated by code and needs refreshing. An application should modify cells like this as an example:

int i;
for (i = 0; i < width; i++) cells[i].codepoint = 'E';
evas_object_textgrid_update_add(obj, 0, row, width, 1);
See Also
evas_object_textgrid_cellrow_set()
evas_object_textgrid_cellrow_get()
evas_object_textgrid_size_set()
Since
1.7