Gorgon Game Engine
Monitor Class Reference

Public Member Functions

 ~Monitor ()
 
Geometry::Rectangle GetArea () const
 Returns the area of the entire monitor including shift for multihead displays. More...
 
Geometry::Point GetLocation () const
 Returns the location of this monitor relative to the other monitors in pixels. More...
 
std::string GetName () const
 Returns the name of the monitor. More...
 
Geometry::Size GetSize () const
 Returns the size of this monitor in pixels. More...
 
Geometry::Bounds GetUsable () const
 Returns the area usable rectangle of the monitor. This region excludes any panels on the screen. More...
 
bool IsPrimary () const
 Whether this display is primary. More...
 

Static Public Member Functions

static const MonitorFromLocation (Geometry::Point location)
 Returns the monitor from the given location. If none found, will return nullptr. More...
 
static bool IsChangeEventSupported ()
 In some cases, Changed event is not supported. More...
 
static const Containers::Collection< Monitor > & Monitors ()
 Returns all monitors connected to this device. More...
 
static MonitorPrimary ()
 Returns the default monitor. More...
 
static void Refresh (bool force=false)
 Asks WindowManager to refresh the list of monitors. More...
 

Static Public Attributes

static Event ChangedEvent
 Fires when window manager raises an event about a change in the monitor or screen layout. More...
 

Constructor & Destructor Documentation

◆ ~Monitor()

~Monitor ( )

Member Function Documentation

◆ FromLocation()

static const Monitor* FromLocation ( Geometry::Point  location)
static

Returns the monitor from the given location. If none found, will return nullptr.

References Gorgon::Geometry::IsInside().

◆ GetArea()

Geometry::Rectangle GetArea ( ) const

Returns the area of the entire monitor including shift for multihead displays.

◆ GetLocation()

Geometry::Point GetLocation ( ) const

Returns the location of this monitor relative to the other monitors in pixels.

This function is expected to return (0, 0) if there are no other monitors in the system.

References basic_Rectangle< T_ >::TopLeft().

◆ GetName()

std::string GetName ( ) const

Returns the name of the monitor.

◆ GetSize()

Geometry::Size GetSize ( ) const

Returns the size of this monitor in pixels.

References basic_Rectangle< T_ >::GetSize().

◆ GetUsable()

Geometry::Bounds GetUsable ( ) const

Returns the area usable rectangle of the monitor. This region excludes any panels on the screen.

◆ IsChangeEventSupported()

bool IsChangeEventSupported ( )
static

In some cases, Changed event is not supported.

This function might be used to query if it works or not. Even this event is not supported, RefreshMonitors function causes it to be raised after gathering information.

◆ IsPrimary()

bool IsPrimary ( ) const

Whether this display is primary.

◆ Monitors()

static const Containers::Collection<Monitor>& Monitors ( )
static

Returns all monitors connected to this device.

◆ Primary()

static Monitor& Primary ( )
static

Returns the default monitor.

References ASSERT.

◆ Refresh()

void Refresh ( bool  force = false)
static

Asks WindowManager to refresh the list of monitors.

This may deallocate monitors and cause problems. Calling this method raises DisplayChanged to mitigate this problem partially. This function will not re-create monitor list if window manager determines that there are no changes in the monitors. You may set force parameter to true to ensure monitors list is re-created.

References basic_Rectangle< T_ >::Height, basic_Rectangle< T_ >::Width, basic_Rectangle< T_ >::X, and basic_Rectangle< T_ >::Y.

Member Data Documentation

◆ ChangedEvent

Event ChangedEvent
static

Fires when window manager raises an event about a change in the monitor or screen layout.

Additionally, this event will be fired when RefreshMonitors causes monitor list to be re-created. If monitor pointers are stored, this event should be listened as a call to RefreshMonitors may invalidate these pointers.


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