diff options
Diffstat (limited to 'include/mglpp/window/Window.hpp')
-rw-r--r-- | include/mglpp/window/Window.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/mglpp/window/Window.hpp b/include/mglpp/window/Window.hpp index bdf9c05..f284aa0 100644 --- a/include/mglpp/window/Window.hpp +++ b/include/mglpp/window/Window.hpp @@ -8,6 +8,7 @@ #include "Mouse.hpp" #include <stddef.h> #include <string> +#include <functional> extern "C" { #include <mgl/window/window.h> @@ -26,6 +27,12 @@ namespace mgl { vec2i size; }; + /* + Return true to continue. |get_clipboard| returns false if this returns false. + Note: |size| is the size of the current data, not the total data (if the callback only contains a part of the data). + */ + using ClipboardCallback = std::function<bool(const unsigned char *data, size_t size, mgl_clipboard_type clipboard_type)>; + class Window { public: /* Has to match mgl_window_create_params */ @@ -84,7 +91,8 @@ namespace mgl { bool is_mouse_button_pressed(Mouse::Button button) const; void set_clipboard(const std::string &str); - std::string get_clipboard(); + bool get_clipboard(ClipboardCallback callback); + std::string get_clipboard_string(); WindowHandle get_system_handle() const; private: |