GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_pixmap.h
1//SPDX-License-Identifier: LGPL-2.0-or-later
2
3/*
4
5 Copyright (c) 2014-2020 Cyril Hrubis <metan@ucw.cz>
6
7 */
8
9#ifndef GP_WIDGET_PIXMAP_H
10#define GP_WIDGET_PIXMAP_H
11
12#include <widgets/gp_widget_size_units.h>
13
14struct gp_widget_pixmap {
15 gp_widget_size min_w;
16 gp_widget_size min_h;
17 gp_pixmap *pixmap;
18 int bbox_set:1;
19 int redraw_all:1;
21 gp_bbox bbox;
22};
23
44gp_widget *gp_widget_pixmap_new(gp_widget_size min_w, gp_widget_size min_h,
45 int (*on_event)(gp_widget_event *ev),
46 void *priv);
47
62void gp_widget_pixmap_redraw(gp_widget *self,
63 gp_coord x, gp_coord y,
64 gp_size w, gp_size h);
65
72static inline gp_size gp_widget_pixmap_w(gp_widget *self)
73{
74 return self->w;
75}
76
83static inline gp_size gp_widget_pixmap_h(gp_widget *self)
84{
85 return self->h;
86}
87
93void gp_widget_pixmap_redraw_all(gp_widget *self);
94
95#endif /* GP_WIDGET_PIXMAP_H */
int gp_coord
Integer type for coordinates i.e. x, y, ...
Definition gp_types.h:19
unsigned int gp_size
Integer type for sizes i.e. w, h, ...
Definition gp_types.h:24
A bounding box.
Definition gp_bbox.h:23
A pixmap buffer.
Definition gp_pixmap.h:33
Event structure passed to widget event handler.