GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_pixmap.h
Go to the documentation of this file.
1//SPDX-License-Identifier: LGPL-2.0-or-later
2
3/*
4
5 Copyright (c) 2014-2024 Cyril Hrubis <metan@ucw.cz>
6
7 */
8
75#ifndef GP_WIDGET_PIXMAP_H
76#define GP_WIDGET_PIXMAP_H
77
79
80struct gp_widget_pixmap {
81 gp_widget_size min_w;
82 gp_widget_size min_h;
83 gp_pixmap *pixmap;
84 int bbox_set:1;
85 int redraw_all:1;
87 gp_bbox bbox;
88};
89
113 int (*on_event)(gp_widget_event *ev),
114 void *priv);
115
131 gp_coord x, gp_coord y,
132 gp_size w, gp_size h);
133
142{
143 return self->w;
144}
145
154{
155 return self->h;
156}
157
164
165#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
void gp_widget_pixmap_redraw_all(gp_widget *self)
Marks the whole pixmap to be repainted.
static gp_size gp_widget_pixmap_w(gp_widget *self)
Returns pixmap width in pixels.
static gp_size gp_widget_pixmap_h(gp_widget *self)
Returns pixmap height in pixels.
gp_widget * gp_widget_pixmap_new(gp_widget_size min_w, gp_widget_size min_h, int(*on_event)(gp_widget_event *ev), void *priv)
Create pixmap widget.
void gp_widget_pixmap_redraw(gp_widget *self, gp_coord x, gp_coord y, gp_size w, gp_size h)
Requests partial update of the image.
A widget size units.
A bounding box.
Definition gp_bbox.h:23
A pixmap buffer.
Definition gp_pixmap.h:33
Event structure passed to widget event handler.
A compound size.
A widget base.
Definition gp_widget.h:28
unsigned int w
Current widget size in pixels.
Definition gp_widget.h:79