libdisplaydevice latest
C++ library to modify display devices.
settings_utils.cpp File Reference

Definitions for settings related utility functions. More...

#include "display_device/windows/settings_utils.h"
#include <algorithm>
#include <cmath>
#include <thread>
#include "display_device/logging.h"
#include "display_device/windows/json.h"
Include dependency graph for settings_utils.cpp:

Namespaces

namespace  display_device::win_utils
 Shared "utility-level" code for Settings.
 

Functions

void display_device::win_utils::blankHdrStates (WinDisplayDeviceInterface &win_dd, const std::optional< std::chrono::milliseconds > &delay)
 Toggle enabled HDR states off and on again if quick succession.
 
std::optional< SingleDisplayConfigState::Initialdisplay_device::win_utils::computeInitialState (const std::optional< SingleDisplayConfigState::Initial > &prev_state, const ActiveTopology &topology_before_changes, const EnumeratedDeviceList &devices)
 Compute the new intial state from arbitrary data.
 
DeviceDisplayModeMap display_device::win_utils::computeNewDisplayModes (const std::optional< Resolution > &resolution, const std::optional< FloatingPoint > &refresh_rate, bool configuring_primary_devices, const std::string &device_to_configure, const std::set< std::string > &additional_devices_to_configure, const DeviceDisplayModeMap &original_modes)
 Compute new display modes from arbitrary data.
 
HdrStateMap display_device::win_utils::computeNewHdrStates (const std::optional< HdrState > &hdr_state, bool configuring_primary_devices, const std::string &device_to_configure, const std::set< std::string > &additional_devices_to_configure, const HdrStateMap &original_states)
 Compute new HDR states from arbitrary data.
 
ActiveTopology display_device::win_utils::computeNewTopology (SingleDisplayConfiguration::DevicePreparation device_prep, bool configuring_primary_devices, const std::string &device_to_configure, const std::set< std::string > &additional_devices_to_configure, const ActiveTopology &initial_topology)
 Compute new topology from arbitrary data.
 
std::tuple< ActiveTopology, std::string, std::set< std::string > > display_device::win_utils::computeNewTopologyAndMetadata (SingleDisplayConfiguration::DevicePreparation device_prep, const std::string &device_id, const SingleDisplayConfigState::Initial &initial_state)
 Compute new topology + metadata from config settings and initial state.
 
ActiveTopology display_device::win_utils::createFullExtendedTopology (WinDisplayDeviceInterface &win_dd)
 Create extended topology from all the available devices.
 
std::set< std::string > display_device::win_utils::flattenTopology (const ActiveTopology &topology)
 Get all the device ids in the topology.
 
std::string display_device::win_utils::getPrimaryDevice (WinDisplayDeviceInterface &win_dd, const ActiveTopology &topology)
 Get one primary device from the provided topology.
 
DdGuardFn display_device::win_utils::hdrStateGuardFn (WinDisplayDeviceInterface &win_dd, const ActiveTopology &topology)
 Make guard function for the HDR states.
 
DdGuardFn display_device::win_utils::hdrStateGuardFn (WinDisplayDeviceInterface &win_dd, const HdrStateMap &states)
 Make guard function for the HDR states.
 
DdGuardFn display_device::win_utils::modeGuardFn (WinDisplayDeviceInterface &win_dd, const ActiveTopology &topology)
 Make guard function for the display modes.
 
DdGuardFn display_device::win_utils::modeGuardFn (WinDisplayDeviceInterface &win_dd, const DeviceDisplayModeMap &modes)
 Make guard function for the display modes.
 
DdGuardFn display_device::win_utils::primaryGuardFn (WinDisplayDeviceInterface &win_dd, const ActiveTopology &topology)
 Make guard function for the primary display.
 
DdGuardFn display_device::win_utils::primaryGuardFn (WinDisplayDeviceInterface &win_dd, const std::string &primary_device)
 Make guard function for the primary display.
 
std::optional< SingleDisplayConfigState::Initialdisplay_device::win_utils::stripInitialState (const SingleDisplayConfigState::Initial &initial_state, const EnumeratedDeviceList &devices)
 Strip the initial state of non-existing devices.
 
DdGuardFn display_device::win_utils::topologyGuardFn (WinDisplayDeviceInterface &win_dd, const ActiveTopology &topology)
 Make guard function for the topology.
 

Detailed Description

Definitions for settings related utility functions.