10namespace display_device {
46 [[nodiscard]]
virtual std::optional<MacPowerAssertionId>
declareUserActivity(
const std::string &reason) = 0;
Lowest level macOS API wrapper for easy mocking.
Definition mac_api_layer_interface.h:14
virtual bool setDisplayMode(MacDisplayId display_id, const MacDisplayMode &mode)=0
Set the display mode for a display.
virtual ~MacApiLayerInterface()=default
Default virtual destructor.
virtual std::optional< MacPowerAssertionId > declareUserActivity(const std::string &reason)=0
Tell macOS that the user is active and displays should wake.
virtual bool isApiAccessAvailable() const =0
Check if display configuration APIs are accessible.
virtual std::optional< Rational > getDisplayScale(MacDisplayId display_id) const =0
Get the display scale value.
virtual std::optional< MacPowerAssertionId > createDisplaySleepAssertion(const std::string &reason)=0
Create a power assertion that prevents user-idle display sleep.
virtual bool isOnline(MacDisplayId display_id) const =0
Check whether a display is online.
virtual std::optional< MacDisplayMode > getCurrentDisplayMode(MacDisplayId display_id) const =0
Get the current display mode.
virtual bool isActive(MacDisplayId display_id) const =0
Check whether a display is active.
virtual std::optional< Point > getOriginPoint(MacDisplayId display_id) const =0
Get the display origin point.
virtual std::string getDeviceId(MacDisplayId display_id) const =0
Get the library device id for a display.
virtual bool isMainDisplay(MacDisplayId display_id) const =0
Check whether a display is the main display.
virtual bool setMirror(MacDisplayId display_id, MacDisplayId master_display_id)=0
Set a display as a mirror of another display.
virtual std::vector< std::byte > getEdid(MacDisplayId display_id) const =0
Get EDID byte array for a display.
virtual bool releasePowerAssertion(MacPowerAssertionId assertion_id)=0
Release a macOS power assertion.
virtual MacDisplayModeList getDisplayModes(MacDisplayId display_id) const =0
Get available display modes for a display.
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::string getErrorString(MacApiError error_code) const =0
Stringify a macOS display API error code.
virtual MacDisplayIdList getDisplayIds(MacQueryType type) const =0
Query macOS for display identifiers.
virtual std::string getDisplayName(MacDisplayId display_id) const =0
Get the macOS capture selector for a display.
virtual bool setOriginPoint(MacDisplayId display_id, const Point &origin)=0
Set the origin point for a display.
Declarations for macOS specific display device types.
std::uint32_t MacPowerAssertionId
macOS power assertion identifier.
Definition types.h:38
std::vector< MacDisplayId > MacDisplayIdList
A list of CoreGraphics display identifiers.
Definition types.h:43
MacQueryType
Type of display list to query from macOS.
Definition types.h:48
std::uint32_t MacDisplayId
CoreGraphics display identifier.
Definition types.h:29
int MacApiError
Error code returned by macOS display APIs.
Definition types.h:20
std::vector< MacDisplayMode > MacDisplayModeList
A list of macOS display modes.
Definition types.h:77
Display mode data used by the macOS backend.
Definition types.h:64
An arbitrary point object.
Definition types.h:91