Skip to content

File include/brisk/window/Display.hpp


Display class

Display

DisplayA class that provides information about a monitor (display) device, including content scale and coordinate conversion.

The Display class is an abstract base class that represents a monitor. It provides methods to retrieve various attributes of the display such as position, size, resolution, DPI, and name. It also offers methods for coordinate conversion between desktop and monitor coordinates.
Details All methods are thread-safe.

position function (Display::position)

virtual Point position() const = 0

Get the position of the display in desktop coordinates.
Returns The top-left position of the display.

size function (Display::size)

virtual Size size() const = 0

Get the size of the display in desktop coordinates.
Returns The size of the display in pixels.

workarea function (Display::workarea)

virtual Rectangle workarea() const = 0

Get the work area of the display.
Returns The work area of the display excluding taskbars, docks, and other furniture.

resolution function (Display::resolution)

virtual Size resolution() const = 0

Get the current resolution of the display.
Returns The current resolution of the display in pixels.
Details On macOS this returns virtual resolution before scaling down to the display's native resolution. Same as resolution of screenshots.

nativeResolution function (Display::nativeResolution)

virtual Size nativeResolution() const = 0

Get the native resolution of the display.
Returns The native resolution of the display in pixels.
Details On macOS this returns actual resolution selected for the display.

physicalSize function (Display::physicalSize)

virtual SizeF physicalSize() const = 0

Get the physical size of the display.
Returns The physical size of the display in millimeters.

dpi function (Display::dpi)

virtual int dpi() const = 0

Get the DPI (dots per inch) of the display.
Returns The DPI of the display.

name function (Display::name)

virtual const std::string &name() const = 0

Get the name of the display.
Returns The name of the display as a string.

id function (Display::id)

virtual const std::string &id() const = 0

Get the unique identifier of the display.
Returns The unique identifier of the display as a string.

adapterName function (Display::adapterName)

virtual const std::string &adapterName() const = 0

Get the name of the adapter associated with the display.
Returns The adapter name as a string.
Details May return an empty string if the adapter name is not available

adapterId function (Display::adapterId)

virtual const std::string &adapterId() const = 0

Get the unique identifier of the adapter associated with the display.
Returns The adapter identifier as a string.
Details May return an empty string if the adapter identifier is not available

flags function (Display::flags)

virtual DisplayFlags flags() const = 0

Get the display flags.
Returns The flags associated with the display.

contentScale function (Display::contentScale)

virtual float contentScale() const = 0

Get the content scale factor of the display.
Returns The content scale factor of the display.

refreshRate function (Display::refreshRate)

virtual double refreshRate() const = 0

Get the refresh rate of the display.
Returns The refresh rate of the display in hertz.

desktopToMonitor function (Display::desktopToMonitor)

virtual Point desktopToMonitor(Point pt) const = 0

Convert a point from desktop coordinates to monitor coordinates.
Param pt The point in desktop coordinates.
Returns The point in monitor coordinates.

monitorToDesktop function (Display::monitorToDesktop)

virtual Point monitorToDesktop(Point pt) const = 0

Convert a point from monitor coordinates to desktop coordinates.
Param pt The point in monitor coordinates.
Returns The point in desktop coordinates.

backingScaleFactor function (Display::backingScaleFactor)

virtual int backingScaleFactor() const = 0

Get the backing scale factor of the display.
Returns The backing scale factor of the display.
Details macOS specific

all function (Display::all)

static std::vector<RC<Display>> all()

Get all connected displays.
Returns A vector of RC-pointers to all connected displays.

primary function (Display::primary)

static RC<Display> primary()

Get the primary display.
Returns An RC-pointer to the primary display.


Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/