GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A backend. More...
#include <gp_backend.h>
Data Fields | |
gp_pixmap * | pixmap |
Pointer to pixmap app should draw to. | |
const char * | name |
Backend name, e.g. "X11". | |
void(* | flip )(gp_backend *self) |
Updates display. | |
void(* | update_rect )(gp_backend *self, gp_coord x0, gp_coord y0, gp_coord x1, gp_coord y1) |
Updates display rectangle. | |
enum gp_backend_ret(* | set_attr )(gp_backend *self, enum gp_backend_attr attr, const void *vals) |
Attribute change callback. | |
void(* | exit )(gp_backend *self) |
Exits the backend. | |
void(* | poll )(gp_backend *self) |
Non-blocking event loop. | |
void(* | wait )(gp_backend *self) |
Blocking event loop. Blocks until events are ready. | |
gp_poll | fds |
File descriptors to poll for. | |
gp_timer * | timers |
Priority queue for timers. | |
gp_task_queue * | task_queue |
Task queue. | |
gp_dlist | input_drivers |
List of input drivers feeding the ev_queue. | |
unsigned int | dpi |
A backend DPI if unknown it's set to 0. | |
A backend.
This is the main structure that describes a backend API.
Definition at line 145 of file gp_backend.h.
void(* gp_backend::flip) (gp_backend *self) |
Updates display.
If display is buffered, this copies content of pixmap into display.
If display is not buffered, this is no-op (set to NULL).
Definition at line 167 of file gp_backend.h.
Referenced by gp_backend_flip().
gp_dlist gp_backend::input_drivers |
List of input drivers feeding the ev_queue.
A double linked list gp_backend_input structures.
The file descriptor has to be registered separatelly to the gp_fds.
Definition at line 254 of file gp_backend.h.
gp_pixmap* gp_backend::pixmap |
Pointer to pixmap app should draw to.
In most cases changes are not propagaged into display until gp_backend_flip() or gp_backend_update_rect() is called.
This MAY change upon a flip operation.
Definition at line 154 of file gp_backend.h.
void(* gp_backend::poll) (gp_backend *self) |
Non-blocking event loop.
Backends that have a file descriptor does not set this function and rather insert a file descriptor into the fds array.
Definition at line 216 of file gp_backend.h.
enum gp_backend_ret(* gp_backend::set_attr) (gp_backend *self, enum gp_backend_attr attr, const void *vals) |
Attribute change callback.
This callback is not supposed to be used directly. Use the nice helpers such as gp_backend_resize() or gp_backend_fullscreen().
self | A backend. |
attr | Which attribute to set. |
vals | An attribute value, the type depends on attribute. |
Definition at line 177 of file gp_backend.h.
Referenced by gp_backend_cursor_set(), gp_backend_fullscreen(), and gp_backend_set_caption().
void(* gp_backend::update_rect) (gp_backend *self, gp_coord x0, gp_coord y0, gp_coord x1, gp_coord y1) |
Updates display rectangle.
In contrast to flip operation, the pixmap must not change (this is intended for updating very small areas).
If display is not buffered, this is no-op (set to NULL).
Definition at line 177 of file gp_backend.h.
void(* gp_backend::wait) (gp_backend *self) |
Blocking event loop. Blocks until events are ready.
Note that events received by a backend are not necessarily translated to input events. So input queue may be empty after Wait has returned.
Backends that have a file descriptor does not set this function and rather insert a file descriptor into the fds array.
Definition at line 233 of file gp_backend.h.