diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-09-09 23:28:29 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-09-09 23:28:29 +0200 |
commit | 01b9943e9cd886bcfd22ba58783137e554ef2a3c (patch) | |
tree | 8c49afa4cc4b9c8515813c89bf790ddba613248e /include | |
parent | b9892cbbeb217b45a593fe05d3f42245b70820db (diff) |
Support png,jpg and gif clipboard. Use callback for clipboard
Diffstat (limited to 'include')
-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: |