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 WinDisplayPower(std::shared_ptr<WinApiLayerInterface> w_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:
37 std::shared_ptr<WinApiLayerInterface> m_w_api;
38 };
39} // namespace display_device
Cross-platform API for display wake and display-sleep prevention.
Definition display_power_interface.h:36
Windows implementation of DisplayPowerInterface.
Definition display_power.h:18
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:50
WinDisplayPower(std::shared_ptr< WinApiLayerInterface > w_api)
Default constructor for the class.
Definition display_power.cpp:43
std::unique_ptr< DisplayPowerGuardInterface > keepDisplayAwake(const std::string &reason) override
Keep displays awake until the returned guard is destroyed.
Definition display_power.cpp:55
Declarations for display power management interfaces.
Declarations for the WinApiLayerInterface.