From 01b9943e9cd886bcfd22ba58783137e554ef2a3c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 9 Sep 2022 23:28:29 +0200 Subject: Support png,jpg and gif clipboard. Use callback for clipboard --- include/mglpp/window/Window.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') 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 #include +#include extern "C" { #include @@ -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; + 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: -- cgit v1.2.3