GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A clipboard support for backends. More...
#include <backends/gp_types.h>
Go to the source code of this file.
Functions | |
int | gp_backend_clipboard (gp_backend *self, gp_clipboard *op) |
An internal handler that implements clipboard operations. | |
static int | gp_backend_clipboard_set (gp_backend *self, const char *str, size_t len) |
Sets the clipboard data. | |
static int | gp_backend_clipboard_request (gp_backend *self) |
Requests clipboard data to be retrieved. | |
static char * | gp_backend_clipboard_get (gp_backend *self) |
Returns clipboard data. | |
static void | gp_backend_clipboard_ready (gp_backend *self) |
Pushes clipboard data ready event into a backend input queue. | |
A clipboard support for backends.
Clipboard is, by definition, asynchronous. Setting or getting a clipboard data in most cases requires roundtrip to a server.
Getting the clipboard data starts by sending a clipboard request. Once clipboard data are ready the application will get an GP_EV_SYS_CLIPBOARD event and the data can be retrieved by calling the clipboard get function.
Definition in file gp_clipboard.h.
int gp_backend_clipboard | ( | gp_backend * | self, |
gp_clipboard * | op | ||
) |
An internal handler that implements clipboard operations.
Use the static inline functions instead!
self | A backend. |
op | Properly filled gp_clipboard structure. |
Referenced by gp_backend_clipboard_get(), gp_backend_clipboard_request(), and gp_backend_clipboard_set().
|
inlinestatic |
Returns clipboard data.
The data has to be request by the gp_backend_clipboard_request() first and are ready only after clipboard event arrives to the backend event queue.
self | A backend. |
Definition at line 95 of file gp_clipboard.h.
References gp_backend_clipboard().
|
inlinestatic |
Pushes clipboard data ready event into a backend input queue.
This is used by the backend to inform the application that clipboard data have been retrieved from the server.
self | A backend. |
Definition at line 112 of file gp_clipboard.h.
References gp_ev_queue_push(), GP_EV_SYS, and GP_EV_SYS_CLIPBOARD.
|
inlinestatic |
Requests clipboard data to be retrieved.
self | A backend. |
Definition at line 77 of file gp_clipboard.h.
References gp_backend_clipboard().
|
inlinestatic |
Sets the clipboard data.
self | A backend. |
str | An string buffer to copy the clipboard data from. |
len | Optional lenght to limit the string lenght. If set to zero whole string is used. |
Definition at line 59 of file gp_clipboard.h.
References gp_backend_clipboard().