From 8d53c9bd0f32e494a4f685640ca25aaae165e64e Mon Sep 17 00:00:00 2001 From: FrogTheFrog Date: Thu, 8 Feb 2024 23:36:59 +0200 Subject: [PATCH] Remove unused functions --- .../windows/display_device/windows_utils.cpp | 56 ------------------- .../windows/display_device/windows_utils.h | 15 ----- 2 files changed, 71 deletions(-) diff --git a/src/platform/windows/display_device/windows_utils.cpp b/src/platform/windows/display_device/windows_utils.cpp index 16b6428bc91..2926da4c9a4 100644 --- a/src/platform/windows/display_device/windows_utils.cpp +++ b/src/platform/windows/display_device/windows_utils.cpp @@ -201,18 +201,6 @@ namespace display_device { path.flags |= DISPLAYCONFIG_PATH_ACTIVE; } - void - set_inactive(DISPLAYCONFIG_PATH_INFO &path) { - path.flags &= ~DISPLAYCONFIG_PATH_ACTIVE; - } - - void - clear_path_refresh_rate(DISPLAYCONFIG_PATH_INFO &path) { - path.targetInfo.refreshRate.Denominator = 0; - path.targetInfo.refreshRate.Numerator = 0; - path.targetInfo.scanLineOrdering = DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED; - } - std::string get_device_id(const DISPLAYCONFIG_PATH_INFO &path) { const auto device_path { get_monitor_device_path_wstr(path) }; @@ -420,30 +408,6 @@ namespace display_device { return index; } - boost::optional - get_target_index(const DISPLAYCONFIG_PATH_INFO &path, const std::vector &modes) { - UINT32 index {}; - if (path.flags & DISPLAYCONFIG_PATH_SUPPORT_VIRTUAL_MODE) { - index = path.targetInfo.targetModeInfoIdx; - if (index == DISPLAYCONFIG_PATH_TARGET_MODE_IDX_INVALID) { - return boost::none; - } - } - else { - index = path.targetInfo.modeInfoIdx; - if (index == DISPLAYCONFIG_PATH_MODE_IDX_INVALID) { - return boost::none; - } - } - - if (index >= modes.size()) { - BOOST_LOG(error) << "target index " << index << " is out of range " << modes.size(); - return boost::none; - } - - return index; - } - void set_source_index(DISPLAYCONFIG_PATH_INFO &path, const boost::optional &index) { if (path.flags & DISPLAYCONFIG_PATH_SUPPORT_VIRTUAL_MODE) { @@ -528,26 +492,6 @@ namespace display_device { return const_cast(get_source_mode(index, const_cast &>(modes))); } - const DISPLAYCONFIG_TARGET_MODE * - get_target_mode(const boost::optional &index, const std::vector &modes) { - if (!index) { - return nullptr; - } - - const auto &mode { modes[*index] }; - if (mode.infoType != DISPLAYCONFIG_MODE_INFO_TYPE_TARGET) { - BOOST_LOG(error) << "mode at index " << *index << " is not target mode!"; - return nullptr; - } - - return &mode.targetMode; - } - - DISPLAYCONFIG_TARGET_MODE * - get_target_mode(const boost::optional &index, std::vector &modes) { - return const_cast(get_target_mode(index, const_cast &>(modes))); - } - boost::optional get_device_info_for_valid_path(const DISPLAYCONFIG_PATH_INFO &path, bool must_be_active) { // As far as we are concerned, for us the path is valid as long as it is available, diff --git a/src/platform/windows/display_device/windows_utils.h b/src/platform/windows/display_device/windows_utils.h index b13135da8b3..15ed73632a9 100644 --- a/src/platform/windows/display_device/windows_utils.h +++ b/src/platform/windows/display_device/windows_utils.h @@ -43,12 +43,6 @@ namespace display_device { void set_active(DISPLAYCONFIG_PATH_INFO &path); - void - set_inactive(DISPLAYCONFIG_PATH_INFO &path); - - void - clear_path_refresh_rate(DISPLAYCONFIG_PATH_INFO &path); - std::string get_device_id(const DISPLAYCONFIG_PATH_INFO &path); @@ -70,9 +64,6 @@ namespace display_device { boost::optional get_source_index(const DISPLAYCONFIG_PATH_INFO &path, const std::vector &modes); - boost::optional - get_target_index(const DISPLAYCONFIG_PATH_INFO &path, const std::vector &modes); - void set_source_index(DISPLAYCONFIG_PATH_INFO &path, const boost::optional &index); @@ -91,12 +82,6 @@ namespace display_device { DISPLAYCONFIG_SOURCE_MODE * get_source_mode(const boost::optional &index, std::vector &modes); - const DISPLAYCONFIG_TARGET_MODE * - get_target_mode(const boost::optional &index, const std::vector &modes); - - DISPLAYCONFIG_TARGET_MODE * - get_target_mode(const boost::optional &index, std::vector &modes); - boost::optional get_device_info_for_valid_path(const DISPLAYCONFIG_PATH_INFO &path, bool must_be_active);