Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogTheFrog committed Feb 8, 2024
1 parent ffef0a3 commit 8d53c9b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 71 deletions.
56 changes: 0 additions & 56 deletions src/platform/windows/display_device/windows_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) };
Expand Down Expand Up @@ -420,30 +408,6 @@ namespace display_device {
return index;
}

boost::optional<UINT32>
get_target_index(const DISPLAYCONFIG_PATH_INFO &path, const std::vector<DISPLAYCONFIG_MODE_INFO> &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<UINT32> &index) {
if (path.flags & DISPLAYCONFIG_PATH_SUPPORT_VIRTUAL_MODE) {
Expand Down Expand Up @@ -528,26 +492,6 @@ namespace display_device {
return const_cast<DISPLAYCONFIG_SOURCE_MODE *>(get_source_mode(index, const_cast<const std::vector<DISPLAYCONFIG_MODE_INFO> &>(modes)));
}

const DISPLAYCONFIG_TARGET_MODE *
get_target_mode(const boost::optional<UINT32> &index, const std::vector<DISPLAYCONFIG_MODE_INFO> &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<UINT32> &index, std::vector<DISPLAYCONFIG_MODE_INFO> &modes) {
return const_cast<DISPLAYCONFIG_TARGET_MODE *>(get_target_mode(index, const_cast<const std::vector<DISPLAYCONFIG_MODE_INFO> &>(modes)));
}

boost::optional<device_info_t>
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,
Expand Down
15 changes: 0 additions & 15 deletions src/platform/windows/display_device/windows_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -70,9 +64,6 @@ namespace display_device {
boost::optional<UINT32>
get_source_index(const DISPLAYCONFIG_PATH_INFO &path, const std::vector<DISPLAYCONFIG_MODE_INFO> &modes);

boost::optional<UINT32>
get_target_index(const DISPLAYCONFIG_PATH_INFO &path, const std::vector<DISPLAYCONFIG_MODE_INFO> &modes);

void
set_source_index(DISPLAYCONFIG_PATH_INFO &path, const boost::optional<UINT32> &index);

Expand All @@ -91,12 +82,6 @@ namespace display_device {
DISPLAYCONFIG_SOURCE_MODE *
get_source_mode(const boost::optional<UINT32> &index, std::vector<DISPLAYCONFIG_MODE_INFO> &modes);

const DISPLAYCONFIG_TARGET_MODE *
get_target_mode(const boost::optional<UINT32> &index, const std::vector<DISPLAYCONFIG_MODE_INFO> &modes);

DISPLAYCONFIG_TARGET_MODE *
get_target_mode(const boost::optional<UINT32> &index, std::vector<DISPLAYCONFIG_MODE_INFO> &modes);

boost::optional<device_info_t>
get_device_info_for_valid_path(const DISPLAYCONFIG_PATH_INFO &path, bool must_be_active);

Expand Down

0 comments on commit 8d53c9b

Please sign in to comment.