GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Data Fields
gp_backend Struct Reference

A backend. More...

#include <gp_backend.h>

Collaboration diagram for gp_backend:
Collaboration graph
[legend]

Data Fields

gp_pixmappixmap
 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_timertimers
 Priority queue for timers.
 
gp_task_queuetask_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.
 

Detailed Description

A backend.

This is the main structure that describes a backend API.

Definition at line 145 of file gp_backend.h.

Field Documentation

◆ flip

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().

◆ input_drivers

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.

◆ pixmap

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.

◆ poll

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.

◆ set_attr

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().

Parameters
selfA backend.
attrWhich attribute to set.
valsAn attribute value, the type depends on attribute.
Returns
Returns if attribute was succesfully set or a value in case of a attribute query.

Definition at line 177 of file gp_backend.h.

Referenced by gp_backend_cursor_set(), gp_backend_fullscreen(), and gp_backend_set_caption().

◆ update_rect

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.

◆ wait

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.


The documentation for this struct was generated from the following file: