GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
include
widgets
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
78
#include <
widgets/gp_widget_size_units.h
>
79
80
struct
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
112
gp_widget
*
gp_widget_pixmap_new
(
gp_widget_size
min_w,
gp_widget_size
min_h,
113
int
(*on_event)(
gp_widget_event
*ev),
114
void
*priv);
115
130
void
gp_widget_pixmap_redraw
(
gp_widget
*self,
131
gp_coord
x,
gp_coord
y,
132
gp_size
w,
gp_size
h);
133
141
static
inline
gp_size
gp_widget_pixmap_w
(
gp_widget
*self)
142
{
143
return
self->
w
;
144
}
145
153
static
inline
gp_size
gp_widget_pixmap_h
(
gp_widget
*self)
154
{
155
return
self->h;
156
}
157
163
void
gp_widget_pixmap_redraw_all
(
gp_widget
*self);
164
165
#endif
/* GP_WIDGET_PIXMAP_H */
gp_coord
int gp_coord
Integer type for coordinates i.e. x, y, ...
Definition
gp_types.h:19
gp_size
unsigned int gp_size
Integer type for sizes i.e. w, h, ...
Definition
gp_types.h:24
gp_widget_pixmap_redraw_all
void gp_widget_pixmap_redraw_all(gp_widget *self)
Marks the whole pixmap to be repainted.
gp_widget_pixmap_w
static gp_size gp_widget_pixmap_w(gp_widget *self)
Returns pixmap width in pixels.
Definition
gp_widget_pixmap.h:141
gp_widget_pixmap_h
static gp_size gp_widget_pixmap_h(gp_widget *self)
Returns pixmap height in pixels.
Definition
gp_widget_pixmap.h:153
gp_widget_pixmap_new
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.
gp_widget_pixmap_redraw
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.
gp_widget_size_units.h
A widget size units.
gp_bbox
A bounding box.
Definition
gp_bbox.h:23
gp_pixmap
A pixmap buffer.
Definition
gp_pixmap.h:33
gp_widget_event
Event structure passed to widget event handler.
Definition
gp_widget_event.h:137
gp_widget_size
A compound size.
Definition
gp_widget_size_units.h:31
gp_widget
A widget base.
Definition
gp_widget.h:28
gp_widget::w
unsigned int w
Current widget size in pixels.
Definition
gp_widget.h:79
Generated by
1.9.8