libdisplaydevice master
C++ library to modify display devices.
display_device::MacDisplayDeviceInterface Class Referenceabstract

Higher level abstracted API for interacting with macOS display devices. More...

#include <src/macos/include/display_device/macos/mac_display_device_interface.h>

Inheritance diagram for display_device::MacDisplayDeviceInterface:
[legend]

Public Member Functions

virtual EnumeratedDeviceList enumAvailableDevices () const =0
 Enumerate the available display devices.
 
virtual MacDeviceDisplayModeMap getCurrentDisplayModes (const StringSet &device_ids) const =0
 Get current display modes for the devices.
 
virtual MacHdrStateMap getCurrentHdrStates (const StringSet &device_ids) const =0
 Get HDR state for the devices.
 
virtual MacActiveTopology getCurrentTopology () const =0
 Get the active topology.
 
virtual std::string getDisplayName (const std::string &device_id) const =0
 Get the macOS capture selector associated with the device.
 
virtual bool isApiAccessAvailable () const =0
 Check if the API for changing display settings is accessible.
 
virtual bool isPrimary (const std::string &device_id) const =0
 Check whether the specified device is primary.
 
virtual bool isTopologyTheSame (const MacActiveTopology &lhs, const MacActiveTopology &rhs) const =0
 Check if the topologies are close enough to be considered the same by macOS.
 
virtual bool isTopologyValid (const MacActiveTopology &topology) const =0
 Verify if the active topology is valid.
 
virtual bool setAsPrimary (const std::string &device_id)=0
 Set the device as a primary display.
 
virtual bool setDisplayModes (const MacDeviceDisplayModeMap &modes)=0
 Set new display modes for the devices.
 
virtual bool setHdrStates (const MacHdrStateMap &states)=0
 Set HDR states for the devices.
 
virtual bool setTopology (const MacActiveTopology &new_topology)=0
 Set a new active topology.
 
virtual ~MacDisplayDeviceInterface ()=default
 Default virtual destructor.
 

Detailed Description

Higher level abstracted API for interacting with macOS display devices.

Member Function Documentation

◆ enumAvailableDevices()

virtual EnumeratedDeviceList display_device::MacDisplayDeviceInterface::enumAvailableDevices ( ) const
nodiscardpure virtual

Enumerate the available display devices.

Returns
A list of available devices. Empty list can also indicate an error.

Implemented in display_device::MacDisplayDevice.

◆ getCurrentDisplayModes()

virtual MacDeviceDisplayModeMap display_device::MacDisplayDeviceInterface::getCurrentDisplayModes ( const StringSet & device_ids) const
nodiscardpure virtual

Get current display modes for the devices.

Parameters
device_idsDevices to get modes for.
Returns
Display mode map, or an empty map if unavailable.

Implemented in display_device::MacDisplayDevice.

◆ getCurrentHdrStates()

virtual MacHdrStateMap display_device::MacDisplayDeviceInterface::getCurrentHdrStates ( const StringSet & device_ids) const
nodiscardpure virtual

Get HDR state for the devices.

Parameters
device_idsDevices to get HDR states for.
Returns
HDR states per device, or an empty map if unavailable.

Implemented in display_device::MacDisplayDevice.

◆ getCurrentTopology()

virtual MacActiveTopology display_device::MacDisplayDeviceInterface::getCurrentTopology ( ) const
nodiscardpure virtual

Get the active topology.

Returns
Active topology, or an empty topology if unavailable.

Implemented in display_device::MacDisplayDevice.

◆ getDisplayName()

virtual std::string display_device::MacDisplayDeviceInterface::getDisplayName ( const std::string & device_id) const
nodiscardpure virtual

Get the macOS capture selector associated with the device.

Parameters
device_idA device to get display name for.
Returns
Decimal CoreGraphics display id string, or an empty string if not found.

Implemented in display_device::MacDisplayDevice.

◆ isApiAccessAvailable()

virtual bool display_device::MacDisplayDeviceInterface::isApiAccessAvailable ( ) const
nodiscardpure virtual

Check if the API for changing display settings is accessible.

Returns
True if display settings can be changed, false otherwise.

Implemented in display_device::MacDisplayDevice.

◆ isPrimary()

virtual bool display_device::MacDisplayDeviceInterface::isPrimary ( const std::string & device_id) const
nodiscardpure virtual

Check whether the specified device is primary.

Parameters
device_idDevice to perform the check for.
Returns
True if the device is primary, false otherwise.

Implemented in display_device::MacDisplayDevice.

◆ isTopologyTheSame()

virtual bool display_device::MacDisplayDeviceInterface::isTopologyTheSame ( const MacActiveTopology & lhs,
const MacActiveTopology & rhs ) const
nodiscardpure virtual

Check if the topologies are close enough to be considered the same by macOS.

Parameters
lhsFirst topology to compare.
rhsSecond topology to compare.
Returns
True if topologies are the same, false otherwise.

Implemented in display_device::MacDisplayDevice.

◆ isTopologyValid()

virtual bool display_device::MacDisplayDeviceInterface::isTopologyValid ( const MacActiveTopology & topology) const
nodiscardpure virtual

Verify if the active topology is valid.

Parameters
topologyTopology to validate.
Returns
True if valid, false otherwise.

Implemented in display_device::MacDisplayDevice.

◆ setAsPrimary()

virtual bool display_device::MacDisplayDeviceInterface::setAsPrimary ( const std::string & device_id)
nodiscardpure virtual

Set the device as a primary display.

Parameters
device_idDevice to set as primary.
Returns
True if the device is or was set as primary, false otherwise.

Implemented in display_device::MacDisplayDevice.

◆ setDisplayModes()

virtual bool display_device::MacDisplayDeviceInterface::setDisplayModes ( const MacDeviceDisplayModeMap & modes)
nodiscardpure virtual

Set new display modes for the devices.

Parameters
modesModes to set.
Returns
True if modes were set, false otherwise.

Implemented in display_device::MacDisplayDevice.

◆ setHdrStates()

virtual bool display_device::MacDisplayDeviceInterface::setHdrStates ( const MacHdrStateMap & states)
nodiscardpure virtual

Set HDR states for the devices.

Parameters
statesHDR states to set.
Returns
True if HDR states were set or no changes were needed, false otherwise.

Implemented in display_device::MacDisplayDevice.

◆ setTopology()

virtual bool display_device::MacDisplayDeviceInterface::setTopology ( const MacActiveTopology & new_topology)
nodiscardpure virtual

Set a new active topology.

Parameters
new_topologyNew topology to set.
Returns
True if the new topology has been set, false otherwise.

Implemented in display_device::MacDisplayDevice.


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