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.
 
int(* set_cursor )(gp_backend *self, enum gp_backend_cursors cursor)
 Sets cursor shape and/or hides and shows cursor.
 
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 72 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 94 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 183 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 81 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 145 of file gp_backend.h.

◆ set_cursor

int(* gp_backend::set_cursor) (gp_backend *self, enum gp_backend_cursors cursor)

Sets cursor shape and/or hides and shows cursor.

If non NULL backend can enable/disable/change cursor.

Definition at line 125 of file gp_backend.h.

◆ 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 104 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 162 of file gp_backend.h.


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