diff options
Diffstat (limited to 'framebuffer/clipboard.c')
-rw-r--r-- | framebuffer/clipboard.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/framebuffer/clipboard.c b/framebuffer/clipboard.c index 46a1bb018..3729cd49b 100644 --- a/framebuffer/clipboard.c +++ b/framebuffer/clipboard.c @@ -23,10 +23,14 @@ #include <assert.h> #include <stdint.h> #include <string.h> +#include <stdlib.h> + +#include "utils/log.h" #include "desktop/browser.h" #include "desktop/gui.h" + #include "framebuffer/gui.h" -#include "utils/log.h" +#include "framebuffer/clipboard.h" static struct gui_clipboard { @@ -36,15 +40,13 @@ static struct gui_clipboard { } gui_clipboard; - - /** * Core asks front end for clipboard contents. * * \param buffer UTF-8 text, allocated by front end, ownership yeilded to core * \param length Byte length of UTF-8 text in buffer */ -void gui_get_clipboard(char **buffer, size_t *length) +static void gui_get_clipboard(char **buffer, size_t *length) { *buffer = NULL; *length = 0; @@ -73,7 +75,7 @@ void gui_get_clipboard(char **buffer, size_t *length) * \param styles Array of styles given to text runs, owned by core, or NULL * \param n_styles Number of text run styles in array */ -void gui_set_clipboard(const char *buffer, size_t length, +static void gui_set_clipboard(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles) { if (gui_clipboard.buffer_len < length + 1) { @@ -95,3 +97,9 @@ void gui_set_clipboard(const char *buffer, size_t length, gui_clipboard.buffer[gui_clipboard.length] = '\0'; } +static struct gui_clipboard_table clipboard_table = { + .get = gui_get_clipboard, + .set = gui_set_clipboard, +}; + +struct gui_clipboard_table *framebuffer_clipboard_table = &clipboard_table; |