GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Proxy sever client (application) helpers. More...
Go to the source code of this file.
Data Structures | |
struct | gp_proxy_cli |
A proxy client (application). More... | |
Typedefs | |
typedef struct gp_proxy_cli | gp_proxy_cli |
A proxy client (application). | |
Functions | |
static int | gp_proxy_cli_send (gp_proxy_cli *self, enum gp_proxy_msg_types type, void *payload) |
Sends a message to a client (application). | |
static void | gp_proxy_cli_show (gp_proxy_cli *self, gp_proxy_shm *shm, gp_proxy_coord *cur_pos) |
Starts an application rendering into a SHM buffer. | |
static void | gp_proxy_cli_hide (gp_proxy_cli *self) |
Stops an application rendering and unmaps SHM buffer. | |
static void | gp_proxy_cli_event (gp_proxy_cli *self, gp_event *ev) |
Sends an input event message to the application. | |
int | gp_proxy_cli_read (gp_proxy_cli *self) |
A function to fill the proxy client buffer. | |
int | gp_proxy_cli_msg (gp_proxy_cli *self, gp_proxy_msg **msg) |
A function to parse messages from the client buffer. | |
Proxy sever client (application) helpers.
This header implements helpers for server to communicate with the clients (applications).
Definition in file gp_proxy_cli.h.
|
inlinestatic |
Sends an input event message to the application.
self | A client (application). |
ev | An input event. |
Definition at line 112 of file gp_proxy_cli.h.
References gp_proxy_cli::fd, gp_fd::fd, GP_PROXY_EVENT, gp_proxy_send(), and GP_WARN.
|
inlinestatic |
Stops an application rendering and unmaps SHM buffer.
This is an shorthand to:
self | A client (application). |
Definition at line 97 of file gp_proxy_cli.h.
References gp_proxy_cli_send(), GP_PROXY_HIDE, and GP_PROXY_UNMAP.
int gp_proxy_cli_msg | ( | gp_proxy_cli * | self, |
gp_proxy_msg ** | msg | ||
) |
A function to parse messages from the client buffer.
This function must be called in a loop until there are no more messages to be parsed.
self | Pointer to a client. |
msg | A pointer to store the start of the message to. It's set to NULL if there are no more messages. |
int gp_proxy_cli_read | ( | gp_proxy_cli * | self | ) |
A function to fill the proxy client buffer.
Has to be called when there are data ready at client fd. The buffer then has to be parsed by gp_proxy_cli_msg() function.
self | Pointer to a client. |
|
inlinestatic |
Sends a message to a client (application).
self | A client. |
type | A message type. |
payload | An optional payload. See enum gp_proxy_msg_types. |
Definition at line 52 of file gp_proxy_cli.h.
References gp_proxy_cli::fd, gp_fd::fd, and gp_proxy_send().
Referenced by gp_proxy_cli_hide(), and gp_proxy_cli_show().
|
inlinestatic |
Starts an application rendering into a SHM buffer.
This is a shorthand to:
self | A client (application). |
shm | A SHM pixmap to start rendering into. |
cur_pos | An initial cursor position. |
Definition at line 73 of file gp_proxy_cli.h.
References gp_proxy_cli_send(), GP_PROXY_CURSOR_POS, GP_PROXY_MAP, GP_PROXY_PIXMAP, GP_PROXY_SHOW, gp_proxy_shm::path, and gp_proxy_shm::pixmap.