screen & display - qPCR4vir/nana-docs GitHub Wiki

nana::screen

<nana/gui/screen.hpp> The class screen provides some functions to get the metrics of installed monitors.

Two static functions return the resolution (size) in pixels of the primary_monitor_size() or of the whole virtual desktop_size(). If there is only one monitor installed in the system borh return the same.

reload() has no preconditions, it's safe to call on moved-from
count() gets the number of display monitors installed in the system

A reference to a monitor can be returned from_point(const point &in_virtual_desktop) (gets a reference to the display monitor that contains the specified point in_virtual_desktop), from_window(window w) gets a reference to the display monitor that contains the specified window w, from get_primary() which gets a reference to the primary display monitor or from an index: get_display(index). If the specified index does not exist, it throw std::logic_error("no primary monitor found").

To apply some action or function to all disply monitors use: for_each(std::function< void(display &)>)

nana::display

<nana/gui/screen.hpp>

The class display is an interface to manipulate a display monitor. It can't be instantiated manually, please use class screen to get a display monitor.
The member function get_index() return the index of the display monitor.
The member function area() returns the positional coordinates and size of the display device in reference to the desktop virtual area while workarea() return ...
The other function is: is_primary_monitor()