GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A stock image widget. More...
#include <widgets/gp_widget_size_units.h>
Go to the source code of this file.
Macros | |
#define | GP_WIDGET_STOCK_TYPE(type) ((type) & GP_WIDGET_STOCK_TYPE_MASK) |
Masks out the stock type. | |
Typedefs | |
typedef enum gp_widget_stock_type | gp_widget_stock_type |
Stock image type. | |
Functions | |
void | gp_widget_stock_render (gp_pixmap *pix, enum gp_widget_stock_type type, gp_coord x, gp_coord y, gp_size w, gp_size h, gp_pixel bg_col, const gp_widget_render_ctx *ctx) |
Renders a stock image into a pixmap. | |
gp_widget * | gp_widget_stock_new (enum gp_widget_stock_type type, gp_widget_size min_size) |
Create a stock widget. | |
void | gp_widget_stock_type_set (gp_widget *self, enum gp_widget_stock_type type) |
Changes stock image type. | |
enum gp_widget_stock_type | gp_widget_stock_type_get (gp_widget *self) |
Gets stock image type. | |
bool | gp_widget_stock_type_valid (gp_widget_stock_type type) |
Checks for stock type validity. | |
gp_widget_stock_type | gp_widget_stock_type_by_name (const char *name) |
Parses stock type from a name. | |
A stock image widget.
Stock can either be used as widget to render a stock image in the application layout. Or stock image can be embedded into other widgets, e.g. button with a stock image.
Attribute | Type | Default | Description |
---|---|---|---|
stock | string | Stock type, gp_widget_stock_type. | |
min_size | string | 2*pad + asc | Minimal stock size parsed by gp_widget_size_units_parse(). |
Definition in file gp_widget_stock.h.
#define GP_WIDGET_STOCK_TYPE | ( | type | ) | ((type) & GP_WIDGET_STOCK_TYPE_MASK) |
Masks out the stock type.
type | A type possibly combined with flags. |
Definition at line 152 of file gp_widget_stock.h.
enum gp_widget_stock_type |
Stock image type.
Definition at line 34 of file gp_widget_stock.h.
gp_widget * gp_widget_stock_new | ( | enum gp_widget_stock_type | type, |
gp_widget_size | min_size | ||
) |
Create a stock widget.
type | A stock image type. |
min_size | A minimal image size. |
void gp_widget_stock_render | ( | gp_pixmap * | pix, |
enum gp_widget_stock_type | type, | ||
gp_coord | x, | ||
gp_coord | y, | ||
gp_size | w, | ||
gp_size | h, | ||
gp_pixel | bg_col, | ||
const gp_widget_render_ctx * | ctx | ||
) |
Renders a stock image into a pixmap.
pix | A pixmap to render the image into. |
type | A stock image type. |
x | A x offset into the pixmap. |
y | A y offset into the pixmap. |
w | A stock image width. |
h | A stock image height. |
bg_col | A background color. |
ctx | A render context. |
gp_widget_stock_type gp_widget_stock_type_by_name | ( | const char * | name | ) |
Parses stock type from a name.
name | A stock type name. |
enum gp_widget_stock_type gp_widget_stock_type_get | ( | gp_widget * | self | ) |
Gets stock image type.
self | A stock widget. |
void gp_widget_stock_type_set | ( | gp_widget * | self, |
enum gp_widget_stock_type | type | ||
) |
Changes stock image type.
self | A stock widget. |
type | A new stock image type. |
bool gp_widget_stock_type_valid | ( | gp_widget_stock_type | type | ) |
Checks for stock type validity.
type | A stock type. |