libdisplaydevice v2026.322.2407
C++ library to modify display devices.
win_api_layer.h
Go to the documentation of this file.
1
5#pragma once
6
7// local includes
9
10namespace display_device {
15 public:
17 [[nodiscard]] std::string getErrorString(LONG error_code) const override;
18
20 [[nodiscard]] std::optional<PathAndModeData> queryDisplayConfig(QueryType type) const override;
21
23 [[nodiscard]] std::string getDeviceId(const DISPLAYCONFIG_PATH_INFO &path) const override;
24
26 [[nodiscard]] std::vector<std::byte> getEdid(const DISPLAYCONFIG_PATH_INFO &path) const override;
27
29 [[nodiscard]] std::string getMonitorDevicePath(const DISPLAYCONFIG_PATH_INFO &path) const override;
30
32 [[nodiscard]] std::string getFriendlyName(const DISPLAYCONFIG_PATH_INFO &path) const override;
33
35 [[nodiscard]] std::string getDisplayName(const DISPLAYCONFIG_PATH_INFO &path) const override;
36
38 [[nodiscard]] LONG setDisplayConfig(std::vector<DISPLAYCONFIG_PATH_INFO> paths, std::vector<DISPLAYCONFIG_MODE_INFO> modes, UINT32 flags) override;
39
41 [[nodiscard]] std::optional<HdrState> getHdrState(const DISPLAYCONFIG_PATH_INFO &path) const override;
42
44 [[nodiscard]] bool setHdrState(const DISPLAYCONFIG_PATH_INFO &path, HdrState state) override;
45
47 [[nodiscard]] std::optional<Rational> getDisplayScale(const std::string &display_name, const DISPLAYCONFIG_SOURCE_MODE &source_mode) const override;
48 };
49} // namespace display_device
Lowest level Windows API wrapper for easy mocking.
Definition win_api_layer_interface.h:14
Default implementation for the WinApiLayerInterface.
Definition win_api_layer.h:14
bool setHdrState(const DISPLAYCONFIG_PATH_INFO &path, HdrState state) override
Definition win_api_layer.cpp:611
std::optional< Rational > getDisplayScale(const std::string &display_name, const DISPLAYCONFIG_SOURCE_MODE &source_mode) const override
Definition win_api_layer.cpp:645
std::string getDisplayName(const DISPLAYCONFIG_PATH_INFO &path) const override
Definition win_api_layer.cpp:552
std::optional< PathAndModeData > queryDisplayConfig(QueryType type) const override
Definition win_api_layer.cpp:397
std::vector< std::byte > getEdid(const DISPLAYCONFIG_PATH_INFO &path) const override
Definition win_api_layer.cpp:521
std::string getFriendlyName(const DISPLAYCONFIG_PATH_INFO &path) const override
Definition win_api_layer.cpp:536
std::string getErrorString(LONG error_code) const override
Definition win_api_layer.cpp:367
LONG setDisplayConfig(std::vector< DISPLAYCONFIG_PATH_INFO > paths, std::vector< DISPLAYCONFIG_MODE_INFO > modes, UINT32 flags) override
Definition win_api_layer.cpp:568
std::string getDeviceId(const DISPLAYCONFIG_PATH_INFO &path) const override
Definition win_api_layer.cpp:439
std::string getMonitorDevicePath(const DISPLAYCONFIG_PATH_INFO &path) const override
Definition win_api_layer.cpp:532
std::optional< HdrState > getHdrState(const DISPLAYCONFIG_PATH_INFO &path) const override
Definition win_api_layer.cpp:579
HdrState
The device's HDR state in the operating system.
Definition types.h:18
Declarations for the WinApiLayerInterface.
QueryType
Type of query the OS should perform while searching for display devices.
Definition types.h:26