Screen

Receive information about system’s monitor or screen.

Header#include "nativeui/screen.h"
Namespacenamespace nu
Typeclass

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

Return

Display

Display GetDisplayNearestPoint(const PointF& point)

Return the display nearest the specified DIP point.

Parameters

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

Preventable

No.

void on_remove_display(const Display& display)

Emitted when the display has been removed.

Parameters

Preventable

No.

void on_update_display(const Display& display)

Emitted when there are changes happened to display.

Parameters

Preventable

No.