|
Dunst
Lightweight notification daemon
|
Layout and render notifications. More...
Include dependency graph for draw.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | color |
| struct | gradient |
Macros | |
| #define | COLOR_UNINIT { -1, -1, -1, -1 } |
| #define | COLOR_VALID(c) |
| #define | COLOR_SAME(c1, c2) |
| #define | GRADIENT_VALID(g) |
Enumerations | |
| enum | corner_pos { C_NONE = 0 , C_TOP_LEFT = 1 << 0 , C_TOP_RIGHT = 1 << 1 , C_BOT_LEFT = 1 << 2 , C_BOT_RIGHT = 1 << 3 , C_TOP = C_TOP_LEFT | C_TOP_RIGHT , C_BOT = C_BOT_LEFT | C_BOT_RIGHT , C_LEFT = C_TOP_LEFT | C_BOT_LEFT , C_RIGHT = C_TOP_RIGHT | C_BOT_RIGHT , C_ALL = C_TOP | C_BOT , _C_FIRST = 1 << 4 , _C_LAST = 1 << 5 } |
| Specify which corner to draw in draw_rouned_rect. More... | |
Functions | |
| char * | color_to_string (struct color c, char buf[10]) |
| Stringify a color struct to a RRGGBBAA string. | |
| struct gradient * | gradient_alloc (size_t length) |
| struct gradient * | gradient_acquire (struct gradient *grad) |
| void | gradient_release (struct gradient *grad) |
| void | gradient_pattern (struct gradient *grad) |
| char * | gradient_to_string (const struct gradient *grad) |
| void | draw_setup (void) |
| void | draw (void) |
| void | draw_rounded_rect (cairo_t *c, float x, float y, int width, int height, int corner_radius, double scale, enum corner_pos corners) |
| Create a path on the given cairo context to draw the background of a notification. | |
| double | draw_get_scale (void) |
| void | draw_deinit (void) |
| void | calc_window_pos (const struct screen_info *scr, int width, int height, int *ret_x, int *ret_y) |
Calculates the position the window should be placed at given its width and height and stores them in ret_x and ret_y. | |
Variables | |
| window | win |
| const struct output * | output |
Layout and render notifications.
Definition in file draw.h.
| #define COLOR_SAME | ( | c1, | |
| c2 ) |
| #define COLOR_VALID | ( | c | ) |
| #define GRADIENT_VALID | ( | g | ) |
| enum corner_pos |
| void calc_window_pos | ( | const struct screen_info * | scr, |
| int | width, | ||
| int | height, | ||
| int * | ret_x, | ||
| int * | ret_y ) |
| char * color_to_string | ( | struct color | c, |
| char | buf[10] ) |
| void draw_rounded_rect | ( | cairo_t * | c, |
| float | x, | ||
| float | y, | ||
| int | width, | ||
| int | height, | ||
| int | corner_radius, | ||
| double | scale, | ||
| enum corner_pos | corners ) |
Create a path on the given cairo context to draw the background of a notification.
The top corners will get rounded by corner_radius, if first is set. Respectably the same for last with the bottom corners.
TODO: Pass additional frame width information to fix blurry lines due to fractional scaling X and Y can then be calculated as: x = round(x*scale) + half_frame_width