mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
24 lines
448 B
C
24 lines
448 B
C
|
#include "clip.h"
|
||
|
|
||
|
#include <libclipboard.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
clipboard_c *CLIPBOARD = NULL;
|
||
|
|
||
|
clipboard_c *getClipboard(void) {
|
||
|
if (CLIPBOARD == NULL) {
|
||
|
CLIPBOARD = clipboard_new(NULL);
|
||
|
}
|
||
|
return CLIPBOARD;
|
||
|
}
|
||
|
|
||
|
void set_clipboard(char *src) {
|
||
|
clipboard_c *cb = getClipboard();
|
||
|
clipboard_set_text_ex(cb, src, strlen(src), 0);
|
||
|
}
|
||
|
|
||
|
char * get_clipboard() {
|
||
|
clipboard_c *cb = getClipboard();
|
||
|
return clipboard_text_ex(cb, NULL, 0);
|
||
|
}
|