lxgui
Public Member Functions | Public Attributes | List of all members
lxgui::input::window Class Reference

Represents the window in which the UI is displayed. More...

#include <input_window.hpp>

Public Member Functions

 window (source &src)
 Initializes this window with a chosen input source. More...
 
 window (const window &)=delete
 
 window (window &&)=delete
 
windowoperator= (const window &)=delete
 
windowoperator= (window &&)=delete
 
utils::ustring get_clipboard_content ()
 Retrieve a copy of the clipboard content. More...
 
void set_clipboard_content (const utils::ustring &content)
 Replace the content of the clipboard. More...
 
void set_mouse_cursor (const std::string &file_name, const gui::vector2i &hot_spot)
 Sets the mouse cursor to a given image on disk. More...
 
void reset_mouse_cursor ()
 Sets the mouse cursor back to the default (arrow). More...
 
float get_interface_scaling_factor_hint () const
 Return the interface scaling factor suggested by the operating system. More...
 
const gui::vector2uiget_dimensions () const
 Get the window size (in pixels) More...
 
const sourceget_source () const
 Returns the input source. More...
 
sourceget_source ()
 Returns the input source. More...
 

Public Attributes

utils::signal< void(const gui::vector2ui &)> on_window_resized
 Signal triggered whenever the window is resized or changes resolution. More...
 

Detailed Description

Represents the window in which the UI is displayed.

Definition at line 14 of file input_window.hpp.

Constructor & Destructor Documentation

◆ window() [1/3]

lxgui::input::window::window ( source src)
explicit

Initializes this window with a chosen input source.

Parameters
srcThe input source

Definition at line 7 of file input_window.cpp.

◆ window() [2/3]

lxgui::input::window::window ( const window )
delete

◆ window() [3/3]

lxgui::input::window::window ( window &&  )
delete

Member Function Documentation

◆ get_clipboard_content()

utils::ustring lxgui::input::window::get_clipboard_content ( )

Retrieve a copy of the clipboard content.

Returns
A copy of the clipboard content (empty string is clipboard is empty).

Definition at line 14 of file input_window.cpp.

◆ get_dimensions()

const gui::vector2ui & lxgui::input::window::get_dimensions ( ) const

Get the window size (in pixels)

Returns
The window size

Definition at line 30 of file input_window.cpp.

◆ get_interface_scaling_factor_hint()

float lxgui::input::window::get_interface_scaling_factor_hint ( ) const

Return the interface scaling factor suggested by the operating system.

Returns
The interface scaling factor suggested by the operating system
Note
This is implementation-dependent; not all input implementations are able to produce this hint, in which case the function always returns 1. Consequently, it is recommended to not rely blindly on this hint, and to offer a way for the user to change the scaling factor.

Definition at line 34 of file input_window.cpp.

◆ get_source() [1/2]

source & lxgui::input::window::get_source ( )

Returns the input source.

Returns
The input source

Definition at line 42 of file input_window.cpp.

◆ get_source() [2/2]

const source & lxgui::input::window::get_source ( ) const

Returns the input source.

Returns
The input source

Definition at line 38 of file input_window.cpp.

◆ operator=() [1/2]

window& lxgui::input::window::operator= ( const window )
delete

◆ operator=() [2/2]

window& lxgui::input::window::operator= ( window &&  )
delete

◆ reset_mouse_cursor()

void lxgui::input::window::reset_mouse_cursor ( )

Sets the mouse cursor back to the default (arrow).

Definition at line 26 of file input_window.cpp.

◆ set_clipboard_content()

void lxgui::input::window::set_clipboard_content ( const utils::ustring &  content)

Replace the content of the clipboard.

Parameters
contentThe new clipboard content

Definition at line 18 of file input_window.cpp.

◆ set_mouse_cursor()

void lxgui::input::window::set_mouse_cursor ( const std::string &  file_name,
const gui::vector2i hot_spot 
)

Sets the mouse cursor to a given image on disk.

Parameters
file_nameThe cursor image
hot_spotThe pixel position of the tip of the pointer in the image
Note
Use reset_mouse_cursor() to set the cursor back to the default.

Definition at line 22 of file input_window.cpp.

Member Data Documentation

◆ on_window_resized

utils::signal<void(const gui::vector2ui&)> lxgui::input::window::on_window_resized

Signal triggered whenever the window is resized or changes resolution.

Arguments:

  • New size of the window, in pixels

Definition at line 84 of file input_window.hpp.


The documentation for this class was generated from the following files: