lxgui
src
input_window.cpp
1
#include "lxgui/input_window.hpp"
2
3
#include "lxgui/input_source.hpp"
4
5
namespace
lxgui::input
{
6
7
window::window
(
source
& src) : source_(src) {
8
connection_ = src.
on_window_resized
.connect([&](
const
gui::vector2ui
& dimensions) {
9
// Forward
10
on_window_resized
(dimensions);
11
});
12
}
13
14
utils::ustring
window::get_clipboard_content
() {
15
return
source_.
get_clipboard_content
();
16
}
17
18
void
window::set_clipboard_content
(
const
utils::ustring& content) {
19
return
source_.
set_clipboard_content
(content);
20
}
21
22
void
window::set_mouse_cursor
(
const
std::string& file_name,
const
gui::vector2i
& hot_spot) {
23
return
source_.
set_mouse_cursor
(file_name, hot_spot);
24
}
25
26
void
window::reset_mouse_cursor
() {
27
return
source_.
reset_mouse_cursor
();
28
}
29
30
const
gui::vector2ui
&
window::get_dimensions
()
const
{
31
return
source_.
get_window_dimensions
();
32
}
33
34
float
window::get_interface_scaling_factor_hint
()
const
{
35
return
source_.
get_interface_scaling_factor_hint
();
36
}
37
38
const
source
&
window::get_source
()
const
{
39
return
source_;
40
}
41
42
source
&
window::get_source
() {
43
return
source_;
44
}
45
46
}
// namespace lxgui::input
lxgui::input::source
The base class for input source implementation.
Definition:
input_source.hpp:39
lxgui::input::source::reset_mouse_cursor
virtual void reset_mouse_cursor()=0
Sets the mouse cursor back to the default (arrow).
lxgui::input::source::set_clipboard_content
virtual void set_clipboard_content(const utils::ustring &content)=0
Replace the content of the clipboard.
lxgui::input::source::get_clipboard_content
virtual utils::ustring get_clipboard_content()=0
Retrieve a copy of the clipboard content.
lxgui::input::source::get_window_dimensions
const gui::vector2ui & get_window_dimensions() const
Get the window size (in pixels)
Definition:
input_source.cpp:13
lxgui::input::source::get_interface_scaling_factor_hint
virtual float get_interface_scaling_factor_hint() const
Return the interface scaling factor suggested by the operating system.
Definition:
input_source.cpp:17
lxgui::input::source::on_window_resized
utils::signal< void(const gui::vector2ui &)> on_window_resized
Signal triggered whenever the window is resized or changes resolution.
Definition:
input_source.hpp:175
lxgui::input::source::set_mouse_cursor
virtual void set_mouse_cursor(const std::string &file_name, const gui::vector2i &hot_spot)=0
Sets the mouse cursor to a given image on disk.
lxgui::input::window::get_clipboard_content
utils::ustring get_clipboard_content()
Retrieve a copy of the clipboard content.
Definition:
input_window.cpp:14
lxgui::input::window::get_interface_scaling_factor_hint
float get_interface_scaling_factor_hint() const
Return the interface scaling factor suggested by the operating system.
Definition:
input_window.cpp:34
lxgui::input::window::on_window_resized
utils::signal< void(const gui::vector2ui &)> on_window_resized
Signal triggered whenever the window is resized or changes resolution.
Definition:
input_window.hpp:84
lxgui::input::window::get_source
const source & get_source() const
Returns the input source.
Definition:
input_window.cpp:38
lxgui::input::window::get_dimensions
const gui::vector2ui & get_dimensions() const
Get the window size (in pixels)
Definition:
input_window.cpp:30
lxgui::input::window::window
window(source &src)
Initializes this window with a chosen input source.
Definition:
input_window.cpp:7
lxgui::input::window::reset_mouse_cursor
void reset_mouse_cursor()
Sets the mouse cursor back to the default (arrow).
Definition:
input_window.cpp:26
lxgui::input::window::set_clipboard_content
void set_clipboard_content(const utils::ustring &content)
Replace the content of the clipboard.
Definition:
input_window.cpp:18
lxgui::input::window::set_mouse_cursor
void set_mouse_cursor(const std::string &file_name, const gui::vector2i &hot_spot)
Sets the mouse cursor to a given image on disk.
Definition:
input_window.cpp:22
lxgui::input
Definition:
input_dispatcher.cpp:13
lxgui::gui::vector2< std::size_t >
Generated on Sun Oct 8 2023 09:07:52 for lxgui by
1.9.1