lxgui
input_window.hpp
1 #ifndef LXGUI_INPUT_WINDOW_HPP
2 #define LXGUI_INPUT_WINDOW_HPP
3 
4 #include "lxgui/gui_vector2.hpp"
5 #include "lxgui/lxgui.hpp"
6 #include "lxgui/utils_signal.hpp"
7 #include "lxgui/utils_string.hpp"
8 
9 namespace lxgui::input {
10 
11 class source;
12 
14 class window {
15 public:
20  explicit window(source& src);
21 
22  // Non-copiable, non-movable
23  window(const window&) = delete;
24  window(window&&) = delete;
25  window& operator=(const window&) = delete;
26  window& operator=(window&&) = delete;
27 
32  utils::ustring get_clipboard_content();
33 
38  void set_clipboard_content(const utils::ustring& content);
39 
46  void set_mouse_cursor(const std::string& file_name, const gui::vector2i& hot_spot);
47 
49  void reset_mouse_cursor();
50 
60 
65  const gui::vector2ui& get_dimensions() const;
66 
71  const source& get_source() const;
72 
77  source& get_source();
78 
85 
86 private:
87  source& source_;
88  utils::scoped_connection connection_;
89 };
90 
91 } // namespace lxgui::input
92 
93 #endif
The base class for input source implementation.
Represents the window in which the UI is displayed.
utils::ustring get_clipboard_content()
Retrieve a copy of the clipboard content.
float get_interface_scaling_factor_hint() const
Return the interface scaling factor suggested by the operating system.
window(const window &)=delete
utils::signal< void(const gui::vector2ui &)> on_window_resized
Signal triggered whenever the window is resized or changes resolution.
window(window &&)=delete
const source & get_source() const
Returns the input source.
const gui::vector2ui & get_dimensions() const
Get the window size (in pixels)
window(source &src)
Initializes this window with a chosen input source.
Definition: input_window.cpp:7
window & operator=(const window &)=delete
window & operator=(window &&)=delete
void reset_mouse_cursor()
Sets the mouse cursor back to the default (arrow).
void set_clipboard_content(const utils::ustring &content)
Replace the content of the clipboard.
void set_mouse_cursor(const std::string &file_name, const gui::vector2i &hot_spot)
Sets the mouse cursor to a given image on disk.
A connection that automatically disconnects when going out of scope.
Generic class for observing and triggering events.
Holds 2D coordinates.
Definition: gui_vector2.hpp:14