32 [[nodiscard]]
bool isAvailable(
const DISPLAYCONFIG_PATH_INFO &path);
44 [[nodiscard]]
bool isActive(
const DISPLAYCONFIG_PATH_INFO &path);
57 void setActive(DISPLAYCONFIG_PATH_INFO &path);
69 bool isPrimary(
const DISPLAYCONFIG_SOURCE_MODE &mode);
87 [[nodiscard]] std::optional<UINT32>
getSourceIndex(
const DISPLAYCONFIG_PATH_INFO &path,
const std::vector<DISPLAYCONFIG_MODE_INFO> &modes);
100 void setSourceIndex(DISPLAYCONFIG_PATH_INFO &path,
const std::optional<UINT32> &index);
113 void setTargetIndex(DISPLAYCONFIG_PATH_INFO &path,
const std::optional<UINT32> &index);
126 void setDesktopIndex(DISPLAYCONFIG_PATH_INFO &path,
const std::optional<UINT32> &index);
139 void setCloneGroupId(DISPLAYCONFIG_PATH_INFO &path,
const std::optional<UINT32> &
id);
159 [[nodiscard]]
const DISPLAYCONFIG_SOURCE_MODE *
getSourceMode(
const std::optional<UINT32> &index,
const std::vector<DISPLAYCONFIG_MODE_INFO> &modes);
164 [[nodiscard]] DISPLAYCONFIG_SOURCE_MODE *
getSourceMode(
const std::optional<UINT32> &index, std::vector<DISPLAYCONFIG_MODE_INFO> &modes);
190 [[nodiscard]] std::optional<ValidatedDeviceInfo>
getDeviceInfoForValidPath(
const WinApiLayerInterface &w_api,
const DISPLAYCONFIG_PATH_INFO &path, ValidatedPathType type);
205 [[nodiscard]]
const DISPLAYCONFIG_PATH_INFO *
getActivePath(
const WinApiLayerInterface &w_api,
const std::string &device_id,
const std::vector<DISPLAYCONFIG_PATH_INFO> &paths);
210 [[nodiscard]] DISPLAYCONFIG_PATH_INFO *
getActivePath(
const WinApiLayerInterface &w_api,
const std::string &device_id, std::vector<DISPLAYCONFIG_PATH_INFO> &paths);
249 [[nodiscard]] std::vector<DISPLAYCONFIG_PATH_INFO>
makePathsForNewTopology(
const ActiveTopology &new_topology,
const PathSourceIndexDataMap &path_source_data,
const std::vector<DISPLAYCONFIG_PATH_INFO> &paths);
288 [[nodiscard]]
bool fuzzyCompareModes(
const DisplayMode &lhs,
const DisplayMode &rhs);
Shared "utility-level" code for Settings.
Definition settings_utils.h:18
void setDesktopIndex(DISPLAYCONFIG_PATH_INFO &path, const std::optional< UINT32 > &index)
Set the desktop mode index in the path.
Definition win_api_utils.cpp:126
void setSourceIndex(DISPLAYCONFIG_PATH_INFO &path, const std::optional< UINT32 > &index)
Set the source mode index in the path.
Definition win_api_utils.cpp:96
std::vector< DISPLAYCONFIG_PATH_INFO > makePathsForNewTopology(const ActiveTopology &new_topology, const PathSourceIndexDataMap &path_source_data, const std::vector< DISPLAYCONFIG_PATH_INFO > &paths)
Select the best possible paths to be used for the requested topology based on the data that is availa...
Definition win_api_utils.cpp:293
bool isActive(const DISPLAYCONFIG_PATH_INFO &path)
Check if the display device path is marked as active.
Definition win_api_utils.cpp:63
bool fuzzyCompareModes(const DisplayMode &lhs, const DisplayMode &rhs)
Check if the display modes are almost equal.
Definition win_api_utils.cpp:465
std::set< std::string > getAllDeviceIdsAndMatchingDuplicates(const WinApiLayerInterface &w_api, const std::set< std::string > &device_ids)
Get all the missing duplicate device ids for the provided device ids.
Definition win_api_utils.cpp:399
bool fuzzyCompareRefreshRates(const Rational &lhs, const Rational &rhs)
Check if the refresh rates are almost equal.
Definition win_api_utils.cpp:455
PathSourceIndexDataMap collectSourceDataForMatchingPaths(const WinApiLayerInterface &w_api, const std::vector< DISPLAYCONFIG_PATH_INFO > &paths)
Collect arbitrary source data from provided paths.
Definition win_api_utils.cpp:228
void setCloneGroupId(DISPLAYCONFIG_PATH_INFO &path, const std::optional< UINT32 > &id)
Set the clone group id in the path.
Definition win_api_utils.cpp:141
const DISPLAYCONFIG_SOURCE_MODE * getSourceMode(const std::optional< UINT32 > &index, const std::vector< DISPLAYCONFIG_MODE_INFO > &modes)
Get the source mode from the list at the specified index.
Definition win_api_utils.cpp:156
void setTargetIndex(DISPLAYCONFIG_PATH_INFO &path, const std::optional< UINT32 > &index)
Set the target mode index in the path.
Definition win_api_utils.cpp:111
std::optional< UINT32 > getSourceIndex(const DISPLAYCONFIG_PATH_INFO &path, const std::vector< DISPLAYCONFIG_MODE_INFO > &modes)
Get the source mode index from the path.
Definition win_api_utils.cpp:75
std::optional< ValidatedDeviceInfo > getDeviceInfoForValidPath(const WinApiLayerInterface &w_api, const DISPLAYCONFIG_PATH_INFO &path, ValidatedPathType type)
Validate the path and get the commonly used information from it.
Definition win_api_utils.cpp:179
const DISPLAYCONFIG_PATH_INFO * getActivePath(const WinApiLayerInterface &w_api, const std::string &device_id, const std::vector< DISPLAYCONFIG_PATH_INFO > &paths)
Get the active path matching the device id.
Definition win_api_utils.cpp:209
void setActive(DISPLAYCONFIG_PATH_INFO &path)
Mark the display device path as active.
Definition win_api_utils.cpp:67
bool isAvailable(const DISPLAYCONFIG_PATH_INFO &path)
Check if the display device path's target is available.
Definition win_api_utils.cpp:59
bool isPrimary(const DISPLAYCONFIG_SOURCE_MODE &mode)
Check if the display's source mode is primary - if the associated device is a primary display device.
Definition win_api_utils.cpp:71
Declarations for the WinApiLayerInterface.
std::map< std::string, PathSourceIndexData > PathSourceIndexDataMap
Ordered map of [DEVICE_ID -> PathSourceIndexData].
Definition types.h:70