GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A grid to position widgets. More...
#include <stdint.h>
Go to the source code of this file.
Enumerations | |
enum | gp_widget_grid_flags { GP_WIDGET_GRID_FRAME = 0x01 , GP_WIDGET_GRID_UNIFORM = 0x02 } |
A widget grid flags. More... | |
Functions | |
gp_widget * | gp_widget_grid_new (unsigned int cols, unsigned int rows, int flags) |
Allocates and initializes a widget grid. | |
gp_widget * | gp_widget_grid_put (gp_widget *self, unsigned int col, unsigned int row, gp_widget *child) |
Puts a child widget into a frame widget. | |
gp_widget * | gp_widget_grid_rem (gp_widget *self, unsigned int col, unsigned int row) |
Removes child widget at col, row from a grid. | |
gp_widget * | gp_widget_grid_get (gp_widget *self, unsigned int col, unsigned int row) |
Returns a pointer to a widget at col, row. | |
static void | gp_widget_grid_del (gp_widget *self, unsigned col, unsigned int row) |
Deletes a child widget at col, row from a grid. | |
void | gp_widget_grid_rows_ins (gp_widget *self, unsigned int row, unsigned int rows) |
Inserts new (empty) rows to the grid. | |
static void | gp_widget_grid_row_ins (gp_widget *self, unsigned int row) |
Inserts new (empty) row to the grid. | |
unsigned int | gp_widget_grid_rows_append (gp_widget *self, unsigned int rows) |
Appends a new (empty) rows at the bottom of the grid. | |
static unsigned int | gp_widget_grid_row_append (gp_widget *self) |
Appends a new (empty) row at the bottom of the grid. | |
void | gp_widget_grid_rows_prepend (gp_widget *self, unsigned int rows) |
Prepends a new (empty) rows at the top of the grid. | |
static void | gp_widget_grid_row_prepend (gp_widget *self) |
Prepends a new (empty) row at the top of the grid. | |
void | gp_widget_grid_rows_del (gp_widget *self, unsigned int row, unsigned int rows) |
Delete rows from the grid. | |
static void | gp_widget_grid_row_del (gp_widget *self, unsigned int row) |
Removes row from the grid. | |
void | gp_widget_grid_cols_ins (gp_widget *self, unsigned int col, unsigned int cols) |
Inserts new (empty) columns to the grid. | |
static void | gp_widget_grid_col_ins (gp_widget *self, unsigned int col) |
Inserts new (empty) column to the grid. | |
unsigned int | gp_widget_grid_cols_append (gp_widget *self, unsigned int cols) |
Appends a new (empty) colums at the right side of the grid. | |
static unsigned int | gp_widget_grid_col_append (gp_widget *self) |
Appends a new (empty) colum at the right side of the grid. | |
void | gp_widget_grid_cols_prepend (gp_widget *self, unsigned int cols) |
Prepends a new (empty) columns at the left side of the grid. | |
static void | gp_widget_grid_col_prepend (gp_widget *self) |
Prepends a new (empty) column at the left side of the grid. | |
void | gp_widget_grid_cols_del (gp_widget *self, unsigned int col, unsigned int cols) |
Delete columns from the grid. | |
static void | gp_widget_grid_col_del (gp_widget *self, unsigned int col) |
Delete column from the grid. | |
void | gp_widget_grid_border_set (gp_widget *self, enum gp_widget_border border, int padd, int fill) |
Sets border padd or fill coeficients. | |
static void | gp_widget_grid_no_border (gp_widget *self) |
Disables grid padd and fill. | |
void | gp_widget_grid_col_fill_set (gp_widget *self, unsigned int col, uint8_t fill) |
Sets grid cell column fill coeficient. | |
void | gp_widget_grid_row_fill_set (gp_widget *self, unsigned int row, uint8_t fill) |
Sets grid cell row fill coeficient. | |
A grid to position widgets.
Definition in file gp_widget_grid.h.
enum gp_widget_grid_flags |
A widget grid flags.
Enumerator | |
---|---|
GP_WIDGET_GRID_FRAME | Draw a frame around the grid |
GP_WIDGET_GRID_UNIFORM | Make the cells uniform i.e. all cells have the same size |
Definition at line 25 of file gp_widget_grid.h.
void gp_widget_grid_border_set | ( | gp_widget * | self, |
enum gp_widget_border | border, | ||
int | padd, | ||
int | fill | ||
) |
Sets border padd or fill coeficients.
self | A grid widget. |
border | Which border(s) are set. |
padd | Padding coeficient no change on -1 clamped to 255. |
fill | A filling coeficient no change on -1 clamped to 255. |
Referenced by gp_widget_grid_no_border().
|
inlinestatic |
Appends a new (empty) colum at the right side of the grid.
self | A grid widget. |
Definition at line 254 of file gp_widget_grid.h.
References gp_widget_grid_cols_append().
|
inlinestatic |
Delete column from the grid.
If there are any widgets in the deleted rows they are freed with gp_widget_free().
self | A grid widget. |
col | Where to delete column. |
Definition at line 298 of file gp_widget_grid.h.
References gp_widget_grid_cols_del().
void gp_widget_grid_col_fill_set | ( | gp_widget * | self, |
unsigned int | col, | ||
uint8_t | fill | ||
) |
Sets grid cell column fill coeficient.
self | A grid widget. |
col | A column. |
fill | A fill coeficient. |
|
inlinestatic |
Inserts new (empty) column to the grid.
self | A grid widget. |
col | Where to insert column. |
Definition at line 232 of file gp_widget_grid.h.
References gp_widget_grid_cols_ins().
|
inlinestatic |
Prepends a new (empty) column at the left side of the grid.
self | A grid widget. |
Definition at line 272 of file gp_widget_grid.h.
References gp_widget_grid_cols_prepend().
unsigned int gp_widget_grid_cols_append | ( | gp_widget * | self, |
unsigned int | cols | ||
) |
Appends a new (empty) colums at the right side of the grid.
self | A grid widget. |
cols | How many columns to append. |
Referenced by gp_widget_grid_col_append().
void gp_widget_grid_cols_del | ( | gp_widget * | self, |
unsigned int | col, | ||
unsigned int | cols | ||
) |
Delete columns from the grid.
If there are any widgets in the deleted columns they are freed with gp_widget_free().
self | A grid widget. |
col | Where to delete columns. |
cols | How may columns to delete. |
Referenced by gp_widget_grid_col_del().
void gp_widget_grid_cols_ins | ( | gp_widget * | self, |
unsigned int | col, | ||
unsigned int | cols | ||
) |
Inserts new (empty) columns to the grid.
self | A grid widget. |
col | Where to insert columns. |
cols | How many columns to insert. |
Referenced by gp_widget_grid_col_ins().
void gp_widget_grid_cols_prepend | ( | gp_widget * | self, |
unsigned int | cols | ||
) |
Prepends a new (empty) columns at the left side of the grid.
self | A grid widget. |
cols | How many columns to append. |
Referenced by gp_widget_grid_col_prepend().
|
inlinestatic |
Deletes a child widget at col, row from a grid.
self | A grid widget. |
col | Grid column. |
row | Grid row. |
Definition at line 124 of file gp_widget_grid.h.
References gp_widget_grid_rem().
gp_widget * gp_widget_grid_get | ( | gp_widget * | self, |
unsigned int | col, | ||
unsigned int | row | ||
) |
Returns a pointer to a widget at col, row.
self | A grid widget. |
col | Grid column. |
row | Grid row. |
gp_widget * gp_widget_grid_new | ( | unsigned int | cols, |
unsigned int | rows, | ||
int | flags | ||
) |
Allocates and initializes a widget grid.
cols | Number of grid columns. |
rows | Number of grid rows. |
flags | Bitwise or of the enum gp_widget_grid_flags. |
|
inlinestatic |
Disables grid padd and fill.
Shortcut for gp_widget_grid_border_set(self, GP_WIDGET_BORDER_ALL, 0, 0)
self | A grid widget. |
Definition at line 322 of file gp_widget_grid.h.
References gp_widget_grid_border_set().
gp_widget * gp_widget_grid_put | ( | gp_widget * | self, |
unsigned int | col, | ||
unsigned int | row, | ||
gp_widget * | child | ||
) |
Puts a child widget into a frame widget.
self | A grid widget. |
col | Grid column. |
row | Grid row. |
child | A child widget. |
gp_widget * gp_widget_grid_rem | ( | gp_widget * | self, |
unsigned int | col, | ||
unsigned int | row | ||
) |
Removes child widget at col, row from a grid.
self | A grid widget. |
col | Grid column. |
row | Grid row. |
Referenced by gp_widget_grid_del().
|
inlinestatic |
Appends a new (empty) row at the bottom of the grid.
self | A grid widget. |
Definition at line 168 of file gp_widget_grid.h.
References gp_widget_grid_rows_append().
|
inlinestatic |
Removes row from the grid.
If there are any widgets in the deleted rows they are freed with gp_widget_free().
self | A grid widget. |
row | Where to delete row. |
Definition at line 212 of file gp_widget_grid.h.
References gp_widget_grid_rows_del().
void gp_widget_grid_row_fill_set | ( | gp_widget * | self, |
unsigned int | row, | ||
uint8_t | fill | ||
) |
Sets grid cell row fill coeficient.
self | A grid widget. |
row | A row. |
fill | A fill coeficient. |
|
inlinestatic |
Inserts new (empty) row to the grid.
self | A grid widget. |
row | Where to insert row. |
Definition at line 146 of file gp_widget_grid.h.
References gp_widget_grid_rows_ins().
|
inlinestatic |
Prepends a new (empty) row at the top of the grid.
self | A grid widget. |
Definition at line 186 of file gp_widget_grid.h.
References gp_widget_grid_rows_prepend().
unsigned int gp_widget_grid_rows_append | ( | gp_widget * | self, |
unsigned int | rows | ||
) |
Appends a new (empty) rows at the bottom of the grid.
self | A grid widget. |
rows | How many rows to append. |
Referenced by gp_widget_grid_row_append().
void gp_widget_grid_rows_del | ( | gp_widget * | self, |
unsigned int | row, | ||
unsigned int | rows | ||
) |
Delete rows from the grid.
If there are any widgets in the deleted rows they are freed with gp_widget_free().
self | A grid widget. |
row | Where to delete rows. |
rows | How may rows to delete. |
Referenced by gp_widget_grid_row_del().
void gp_widget_grid_rows_ins | ( | gp_widget * | self, |
unsigned int | row, | ||
unsigned int | rows | ||
) |
Inserts new (empty) rows to the grid.
self | A grid widget. |
row | Where to insert rows. |
rows | How many rows to insert. |
Referenced by gp_widget_grid_row_ins().
void gp_widget_grid_rows_prepend | ( | gp_widget * | self, |
unsigned int | rows | ||
) |
Prepends a new (empty) rows at the top of the grid.
self | A grid widget. |
rows | How many rows to append. |
Referenced by gp_widget_grid_row_prepend().