Screen
Receive information about system’s monitor or screen.
Header | #include "nativeui/screen.h" |
Namespace | namespace nu |
Type | class |
This class can not be created by user, you must create State
first and
then receive an instance of Screen
via Screen::GetCurrent
.
nu::State state;
nu::Screen* screen = nu::Screen::GetCurrent();
Class methods
Screen* GetCurrent()
Return the screen instance.
Return
Screen*
Methods
Display GetPrimaryDisplay()
Return the primary display.
Return
Display
const std::vector<Display>& GetAllDisplays()
Return the list of displays that are currently available.
Return
const std::vector<Display>&
Display GetDisplayNearestWindow(Window* window)
Return the display nearest the specified window
.
Parameters
Window*
window
Return
Display
Display GetDisplayNearestPoint(const PointF& point)
Return the display nearest the specified DIP point
.
Parameters
const PointF&
point
Return
Display
PointF GetCursorScreenPoint()
Return the current absolute position of the mouse pointer.
Return
PointF
Events
void on_add_display(const Display& display)
Emitted when a new display
is available.
Parameters
const Display&
display
Preventable
No.void on_remove_display(const Display& display)
Emitted when the display
has been removed.
Parameters
const Display&
display
Preventable
No.void on_update_display(const Display& display)
Emitted when there are changes happened to display
.
Parameters
const Display&
display