![]() |
libdisplaydevice master
C++ library to modify display devices.
|
Lowest level macOS API wrapper for easy mocking. More...
#include <src/macos/include/display_device/macos/mac_api_layer_interface.h>
Public Member Functions | |
| virtual std::optional< MacPowerAssertionId > | createDisplaySleepAssertion (const std::string &reason)=0 |
| Create a power assertion that prevents user-idle display sleep. | |
| virtual std::optional< MacPowerAssertionId > | declareUserActivity (const std::string &reason)=0 |
| Tell macOS that the user is active and displays should wake. | |
| virtual std::optional< MacDisplayMode > | getCurrentDisplayMode (MacDisplayId display_id) const =0 |
| Get the current display mode. | |
| virtual std::string | getDeviceId (MacDisplayId display_id) const =0 |
| Get the library device id for a display. | |
| virtual MacDisplayIdList | getDisplayIds (MacQueryType type) const =0 |
| Query macOS for display identifiers. | |
| virtual MacDisplayModeList | getDisplayModes (MacDisplayId display_id) const =0 |
| Get available display modes for a display. | |
| virtual std::string | getDisplayName (MacDisplayId display_id) const =0 |
| Get the macOS capture selector for a display. | |
| virtual std::optional< Rational > | getDisplayScale (MacDisplayId display_id) const =0 |
| Get the display scale value. | |
| virtual std::vector< std::byte > | getEdid (MacDisplayId display_id) const =0 |
| Get EDID byte array for a display. | |
| virtual std::string | getErrorString (MacApiError error_code) const =0 |
| Stringify a macOS display API error code. | |
| virtual std::string | getFriendlyName (MacDisplayId display_id) const =0 |
| Get a human-readable display name. | |
| virtual MacDisplayId | getMirrorMaster (MacDisplayId display_id) const =0 |
| Get the display mirrored by the specified display. | |
| virtual std::optional< Point > | getOriginPoint (MacDisplayId display_id) const =0 |
| Get the display origin point. | |
| virtual bool | isActive (MacDisplayId display_id) const =0 |
| Check whether a display is active. | |
| virtual bool | isApiAccessAvailable () const =0 |
| Check if display configuration APIs are accessible. | |
| virtual bool | isMainDisplay (MacDisplayId display_id) const =0 |
| Check whether a display is the main display. | |
| virtual bool | isOnline (MacDisplayId display_id) const =0 |
| Check whether a display is online. | |
| virtual bool | releasePowerAssertion (MacPowerAssertionId assertion_id)=0 |
| Release a macOS power assertion. | |
| virtual bool | setDisplayMode (MacDisplayId display_id, const MacDisplayMode &mode)=0 |
| Set the display mode for a display. | |
| virtual bool | setMirror (MacDisplayId display_id, MacDisplayId master_display_id)=0 |
| Set a display as a mirror of another display. | |
| virtual bool | setOriginPoint (MacDisplayId display_id, const Point &origin)=0 |
| Set the origin point for a display. | |
| virtual | ~MacApiLayerInterface ()=default |
| Default virtual destructor. | |
Lowest level macOS API wrapper for easy mocking.
|
nodiscardpure virtual |
Create a power assertion that prevents user-idle display sleep.
| reason | Short human-readable reason for the assertion. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Tell macOS that the user is active and displays should wake.
| reason | Short human-readable reason for the wake assertion. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get the current display mode.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get the library device id for a display.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Query macOS for display identifiers.
| type | Display list type to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get available display modes for a display.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get the macOS capture selector for a display.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get the display scale value.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get EDID byte array for a display.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Stringify a macOS display API error code.
| error_code | Error code to stringify. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get a human-readable display name.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get the display mirrored by the specified display.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Get the display origin point.
| display_id | Display to query. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Check whether a display is active.
| display_id | Display to check. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Check if display configuration APIs are accessible.
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Check whether a display is the main display.
| display_id | Display to check. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Check whether a display is online.
| display_id | Display to check. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Release a macOS power assertion.
| assertion_id | Assertion id returned by declareUserActivity or createDisplaySleepAssertion. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Set the display mode for a display.
| display_id | Display to modify. |
| mode | Mode to apply. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Set a display as a mirror of another display.
| display_id | Display to modify. |
| master_display_id | Master display to mirror. |
Implemented in display_device::MacApiLayer.
|
nodiscardpure virtual |
Set the origin point for a display.
| display_id | Display to modify. |
| origin | Origin point to apply. |
Implemented in display_device::MacApiLayer.