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

A backend. More...

#include <gp_backend.h>

Collaboration diagram for gp_backend:

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_ev_queueevent_queue
 Queue to store input events.
 
gp_timertimers
 Priority queue for timers.
 
gp_task_queuetask_queue
 Task queue.
 
gp_dlist input_drivers
 List of input drivers feeding the ev_queue.
 
void * clipboard_data
 Clipboard data.
 
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 175 of file gp_backend.h.

Field Documentation

◆ clipboard_data

void* gp_backend::clipboard_data

Clipboard data.

Pointer to be used by the backend clipboard implementation.

Definition at line 291 of file gp_backend.h.

◆ 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 197 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 284 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 184 of file gp_backend.h.

Referenced by gp_backend_h(), gp_backend_pixel_type(), and gp_backend_w().

◆ 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 246 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 207 of file gp_backend.h.

Referenced by gp_backend_backlight_dec(), gp_backend_backlight_get(), gp_backend_backlight_inc(), 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 207 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 263 of file gp_backend.h.


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