libdisplaydevice master
C++ library to modify display devices.
display_power.h
Go to the documentation of this file.
1
5#pragma once
6
7// system includes
8#include <memory>
9
10// local includes
13
14namespace display_device {
19 public:
24 explicit MacDisplayPower(std::shared_ptr<MacApiLayerInterface> m_api);
25
29 [[nodiscard]] bool wakeDisplay(const std::string &display_name, std::chrono::milliseconds timeout) override;
30
34 [[nodiscard]] std::unique_ptr<DisplayPowerGuardInterface> keepDisplayAwake(const std::string &reason) override;
35
36 private:
42 [[nodiscard]] bool hasRequiredActiveDisplay(const std::string &display_name) const;
43
44 std::shared_ptr<MacApiLayerInterface> m_m_api;
45 };
46} // namespace display_device
Cross-platform API for display wake and display-sleep prevention.
Definition display_power_interface.h:36
macOS implementation of DisplayPowerInterface.
Definition display_power.h:18
std::unique_ptr< DisplayPowerGuardInterface > keepDisplayAwake(const std::string &reason) override
Keep displays awake until the returned guard is destroyed.
Definition display_power.cpp:120
MacDisplayPower(std::shared_ptr< MacApiLayerInterface > m_api)
Default constructor for the class.
Definition display_power.cpp:84
bool wakeDisplay(const std::string &display_name, std::chrono::milliseconds timeout) override
Ask the platform to wake a display before detection or capture.
Definition display_power.cpp:91
Declarations for display power management interfaces.
Declarations for the MacApiLayerInterface.