From eba962c3e353b3fd3f11e30a7d6f48585e3a153c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 16 Nov 2021 10:56:52 +0100 Subject: Window: add set/get clipboard --- include/mgl/window/window.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h index 812a5b2..95e3273 100644 --- a/include/mgl/window/window.h +++ b/include/mgl/window/window.h @@ -7,6 +7,7 @@ #include "key.h" #include "mouse_button.h" #include +#include /* Vsync is automatically set for created windows, if supported by the system */ @@ -32,6 +33,8 @@ struct mgl_window { bool focused; double frame_time_limit; mgl_clock frame_timer; + char *clipboard_string; + size_t clipboard_size; }; typedef struct { @@ -75,4 +78,8 @@ void mgl_window_set_size(mgl_window *self, mgl_vec2i size); /* if |minimum| is (0, 0) then there is no minimum limit, if |maximum| is (0, 0) then there is no maximum limit */ void mgl_window_set_size_limits(mgl_window *self, mgl_vec2i minimum, mgl_vec2i maximum); +void mgl_window_set_clipboard(mgl_window *self, const char *str, size_t size); +/* A malloc'ed and null terminated string is returned in |str|, it should be deallocated with free */ +bool mgl_window_get_clipboard(mgl_window *self, char **str, size_t *size); + #endif /* MGL_WINDOW_H */ -- cgit v1.2.3