libdisplaydevice v2026.322.2407
C++ library to modify display devices.
win_display_device_interface.h
Go to the documentation of this file.
1
5#pragma once
6
7// system includes
8#include <set>
9
10// local includes
12
13namespace display_device {
18 public:
22 virtual ~WinDisplayDeviceInterface() = default;
23
32 [[nodiscard]] virtual bool isApiAccessAvailable() const = 0;
33
42 [[nodiscard]] virtual EnumeratedDeviceList enumAvailableDevices() const = 0;
43
55 [[nodiscard]] virtual std::string getDisplayName(const std::string &device_id) const = 0;
56
66 [[nodiscard]] virtual ActiveTopology getCurrentTopology() const = 0;
67
83 [[nodiscard]] virtual bool isTopologyValid(const ActiveTopology &topology) const = 0;
84
98 [[nodiscard]] virtual bool isTopologyTheSame(const ActiveTopology &lhs, const ActiveTopology &rhs) const = 0;
99
111 [[nodiscard]] virtual bool setTopology(const ActiveTopology &new_topology) = 0;
112
124 [[nodiscard]] virtual DeviceDisplayModeMap getCurrentDisplayModes(const std::set<std::string> &device_ids) const = 0;
125
140 [[nodiscard]] virtual bool setDisplayModes(const DeviceDisplayModeMap &modes) = 0;
141
152 [[nodiscard]] virtual bool isPrimary(const std::string &device_id) const = 0;
153
165 [[nodiscard]] virtual bool setAsPrimary(const std::string &device_id) = 0;
166
178 [[nodiscard]] virtual HdrStateMap getCurrentHdrStates(const std::set<std::string> &device_ids) const = 0;
179
194 [[nodiscard]] virtual bool setHdrStates(const HdrStateMap &states) = 0;
195 };
196} // namespace display_device
Higher level abstracted API for interacting Windows' display device(s).
Definition win_display_device_interface.h:17
virtual EnumeratedDeviceList enumAvailableDevices() const =0
Enumerate the available (active and inactive) devices.
virtual bool isApiAccessAvailable() const =0
Check if the API for changing display settings is accessible.
virtual bool setHdrStates(const HdrStateMap &states)=0
Set HDR states for the devices.
virtual ~WinDisplayDeviceInterface()=default
Default virtual destructor.
virtual bool setTopology(const ActiveTopology &new_topology)=0
Set a new active topology for the OS.
virtual bool isPrimary(const std::string &device_id) const =0
Check whether the specified device is primary.
virtual bool setAsPrimary(const std::string &device_id)=0
Set the device as a primary display.
virtual HdrStateMap getCurrentHdrStates(const std::set< std::string > &device_ids) const =0
Get HDR state for the devices.
virtual ActiveTopology getCurrentTopology() const =0
Get the active (current) topology.
virtual bool isTopologyTheSame(const ActiveTopology &lhs, const ActiveTopology &rhs) const =0
Check if the topologies are close enough to be considered the same by the OS.
virtual std::string getDisplayName(const std::string &device_id) const =0
Get display name associated with the device.
virtual DeviceDisplayModeMap getCurrentDisplayModes(const std::set< std::string > &device_ids) const =0
Get current display modes for the devices.
virtual bool setDisplayModes(const DeviceDisplayModeMap &modes)=0
Set new display modes for the devices.
virtual bool isTopologyValid(const ActiveTopology &topology) const =0
Verify if the active topology is valid.
std::vector< EnumeratedDevice > EnumeratedDeviceList
A list of EnumeratedDevice objects.
Definition types.h:124
Declarations for Windows specific types.
std::map< std::string, std::optional< HdrState > > HdrStateMap
Ordered map of [DEVICE_ID -> std::optional<HdrState>].
Definition types.h:109
std::vector< std::vector< std::string > > ActiveTopology
A LIST[LIST[DEVICE_ID]] structure which represents an active topology.
Definition types.h:86
std::map< std::string, DisplayMode > DeviceDisplayModeMap
Ordered map of [DEVICE_ID -> DisplayMode].
Definition types.h:104