GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
gp_widget_stock.h File Reference

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.
 

Enumerations

enum  gp_widget_stock_type {
  GP_WIDGET_STOCK_ERR , GP_WIDGET_STOCK_WARN , GP_WIDGET_STOCK_INFO , GP_WIDGET_STOCK_QUESTION ,
  GP_WIDGET_STOCK_SPEAKER_MUTE , GP_WIDGET_STOCK_SPEAKER_MIN , GP_WIDGET_STOCK_SPEAKER_MID , GP_WIDGET_STOCK_SPEAKER_MAX ,
  GP_WIDGET_STOCK_SPEAKER_INC , GP_WIDGET_STOCK_SPEAKER_DEC , GP_WIDGET_STOCK_HARDWARE , GP_WIDGET_STOCK_SOFTWARE ,
  GP_WIDGET_STOCK_SETTINGS , GP_WIDGET_STOCK_HOME , GP_WIDGET_STOCK_SAVE , GP_WIDGET_STOCK_FILE ,
  GP_WIDGET_STOCK_DIR , GP_WIDGET_STOCK_NEW_DIR , GP_WIDGET_STOCK_CLOSE , GP_WIDGET_STOCK_REFRESH ,
  GP_WIDGET_STOCK_SHUFFLE_ON , GP_WIDGET_STOCK_SHUFFLE_OFF , GP_WIDGET_STOCK_ARROW_UP , GP_WIDGET_STOCK_ARROW_DOWN ,
  GP_WIDGET_STOCK_ARROW_LEFT , GP_WIDGET_STOCK_ARROW_RIGHT , GP_WIDGET_STOCK_ROTATE_CW , GP_WIDGET_STOCK_ROTATE_CCW ,
  GP_WIDGET_STOCK_DAY , GP_WIDGET_STOCK_NIGHT , GP_WIDGET_STOCK_STAR , GP_WIDGET_STOCK_ZOOM ,
  GP_WIDGET_STOCK_ZOOM_IN , GP_WIDGET_STOCK_ZOOM_OUT , GP_WIDGET_STOCK_ZOOM_FIT , GP_WIDGET_STOCK_FOCUSED = 0x8000 ,
  GP_WIDGET_STOCK_TYPE_MASK = (~(GP_WIDGET_STOCK_FOCUSED))
}
 Stock image type. More...
 

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_widgetgp_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.
 

Detailed Description

A stock image widget.

Stock widget JSON attributes

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.

Macro Definition Documentation

◆ GP_WIDGET_STOCK_TYPE

#define GP_WIDGET_STOCK_TYPE (   type)    ((type) & GP_WIDGET_STOCK_TYPE_MASK)

Masks out the stock type.

Parameters
typeA type possibly combined with flags.

Definition at line 118 of file gp_widget_stock.h.

Enumeration Type Documentation

◆ gp_widget_stock_type

Stock image type.

Enumerator
GP_WIDGET_STOCK_ERR 

Error message.

GP_WIDGET_STOCK_WARN 

Warning message.

GP_WIDGET_STOCK_INFO 

Info message.

GP_WIDGET_STOCK_QUESTION 

Warning message.

GP_WIDGET_STOCK_SPEAKER_MUTE 

Muted speaker.

GP_WIDGET_STOCK_SPEAKER_MIN 

Speaker at minimal volume.

GP_WIDGET_STOCK_SPEAKER_MID 

Speaker at middle volume.

GP_WIDGET_STOCK_SPEAKER_MAX 

Speaker at maximal volume.

GP_WIDGET_STOCK_SPEAKER_INC 

Increase speaker volume.

GP_WIDGET_STOCK_SPEAKER_DEC 

Decrease speaker volume.

GP_WIDGET_STOCK_HARDWARE 

A hardware icon.

GP_WIDGET_STOCK_SOFTWARE 

A software icon.

GP_WIDGET_STOCK_SETTINGS 

A settings icon.

GP_WIDGET_STOCK_HOME 

A home icon.

GP_WIDGET_STOCK_SAVE 

A save icon.

GP_WIDGET_STOCK_FILE 

A file icon.

GP_WIDGET_STOCK_DIR 

A directory icon.

GP_WIDGET_STOCK_NEW_DIR 

A new directory icon.

GP_WIDGET_STOCK_CLOSE 

A close icon.

GP_WIDGET_STOCK_REFRESH 

A refresh icon.

GP_WIDGET_STOCK_SHUFFLE_ON 

A shuffle on icon.

GP_WIDGET_STOCK_SHUFFLE_OFF 

A shuffle off icon.

GP_WIDGET_STOCK_ARROW_UP 

Arrow up.

GP_WIDGET_STOCK_ARROW_DOWN 

Arrow down.

GP_WIDGET_STOCK_ARROW_LEFT 

Arrow left.

GP_WIDGET_STOCK_ARROW_RIGHT 

Arrow right.

GP_WIDGET_STOCK_ROTATE_CW 

Arrow rotate clock wise.

GP_WIDGET_STOCK_ROTATE_CCW 

Arrow rotate counter clock wise.

GP_WIDGET_STOCK_DAY 

A day icon, a sun.

GP_WIDGET_STOCK_NIGHT 

A night icon, a moon.

GP_WIDGET_STOCK_STAR 

A star icon.

GP_WIDGET_STOCK_ZOOM 

A zoom icon.

GP_WIDGET_STOCK_ZOOM_IN 

A zoom in icon.

GP_WIDGET_STOCK_ZOOM_OUT 

A zoom out icon.

GP_WIDGET_STOCK_ZOOM_FIT 

A zoom fit icon.

GP_WIDGET_STOCK_FOCUSED 

A stock focused flag, combined bitwise with type.

GP_WIDGET_STOCK_TYPE_MASK 

A type mask.

Definition at line 30 of file gp_widget_stock.h.

Function Documentation

◆ gp_widget_stock_new()

gp_widget * gp_widget_stock_new ( enum gp_widget_stock_type  type,
gp_widget_size  min_size 
)

Create a stock widget.

Parameters
typeA stock image type.
min_sizeA minimal image size.
Returns
A newly allocated and initialized stock widget.

◆ gp_widget_stock_render()

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.

Parameters
pixA pixmap to render the image into.
typeA stock image type.
xA x offset into the pixmap.
yA y offset into the pixmap.
wA stock image width.
hA stock image height.
bg_colA background color.
ctxA render context.

◆ gp_widget_stock_type_set()

void gp_widget_stock_type_set ( gp_widget self,
enum gp_widget_stock_type  type 
)

Changes stock image type.

Parameters
selfA stock widget.
typeA new stock image type.