mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 03:07:56 +01:00
Refactor PowerDisplay design: VCP, windowing, class updates
Update design docs to reflect major refactoring and enhancements: - Merge VcpCodeNames.cs and VcpValueNames.cs into VcpNames.cs - Add GlobalUsings.cs for global using directives - Expand DdcCiController/WmiController diagrams with high-level methods - Extend VcpCapabilities with windowing support and new APIs - Add WindowCapability, WindowArea, WindowSize structs - Extend MonitorInfo with new properties and VCP formatting - Add VcpCodeDisplayInfo and VcpValueInfo for richer VCP display - Update class relationships and remove obsolete files (e.g., Styles)
This commit is contained in:
@@ -211,15 +211,13 @@ src/modules/powerdisplay/
|
|||||||
│ │ ├── MonitorValueConverter.cs # Value conversion utilities
|
│ │ ├── MonitorValueConverter.cs # Value conversion utilities
|
||||||
│ │ ├── ProfileHelper.cs # Profile helper utilities
|
│ │ ├── ProfileHelper.cs # Profile helper utilities
|
||||||
│ │ ├── SimpleDebouncer.cs # Generic debouncer
|
│ │ ├── SimpleDebouncer.cs # Generic debouncer
|
||||||
│ │ ├── VcpCodeNames.cs # VCP code name lookup
|
│ │ └── VcpNames.cs # VCP code and value name lookup
|
||||||
│ │ └── VcpValueNames.cs # VCP value name lookup
|
|
||||||
│ └── PathConstants.cs # File path constants
|
│ └── PathConstants.cs # File path constants
|
||||||
│
|
│
|
||||||
├── PowerDisplay/ # WinUI 3 application
|
├── PowerDisplay/ # WinUI 3 application
|
||||||
│ ├── Assets/ # App icons and images
|
│ ├── Assets/ # App icons and images
|
||||||
│ ├── Configuration/
|
│ ├── Configuration/
|
||||||
│ │ └── AppConstants.cs # Application constants
|
│ │ └── AppConstants.cs # Application constants
|
||||||
│ ├── Converters/ # XAML value converters
|
|
||||||
│ ├── Helpers/
|
│ ├── Helpers/
|
||||||
│ │ ├── DisplayChangeWatcher.cs # Monitor hot-plug detection (WinRT DeviceWatcher)
|
│ │ ├── DisplayChangeWatcher.cs # Monitor hot-plug detection (WinRT DeviceWatcher)
|
||||||
│ │ ├── MonitorManager.cs # Discovery orchestrator
|
│ │ ├── MonitorManager.cs # Discovery orchestrator
|
||||||
@@ -239,7 +237,6 @@ src/modules/powerdisplay/
|
|||||||
│ ├── Services/
|
│ ├── Services/
|
||||||
│ │ └── LightSwitchService.cs # LightSwitch theme change handling
|
│ │ └── LightSwitchService.cs # LightSwitch theme change handling
|
||||||
│ ├── Strings/ # Localization resources (en-us)
|
│ ├── Strings/ # Localization resources (en-us)
|
||||||
│ ├── Styles/ # Custom control styles
|
|
||||||
│ ├── Telemetry/
|
│ ├── Telemetry/
|
||||||
│ │ └── Events/
|
│ │ └── Events/
|
||||||
│ │ └── PowerDisplayStartEvent.cs # Telemetry event
|
│ │ └── PowerDisplayStartEvent.cs # Telemetry event
|
||||||
@@ -249,6 +246,7 @@ src/modules/powerdisplay/
|
|||||||
│ │ ├── MainViewModel.Monitors.cs # Monitor discovery methods
|
│ │ ├── MainViewModel.Monitors.cs # Monitor discovery methods
|
||||||
│ │ ├── MainViewModel.Settings.cs # Settings persistence methods
|
│ │ ├── MainViewModel.Settings.cs # Settings persistence methods
|
||||||
│ │ └── MonitorViewModel.cs # Per-monitor VM
|
│ │ └── MonitorViewModel.cs # Per-monitor VM
|
||||||
|
│ ├── GlobalUsings.cs # Global using directives
|
||||||
│ └── Program.cs # Application entry point
|
│ └── Program.cs # Application entry point
|
||||||
│
|
│
|
||||||
├── PowerDisplay.Lib.UnitTests/ # Unit tests
|
├── PowerDisplay.Lib.UnitTests/ # Unit tests
|
||||||
@@ -491,21 +489,34 @@ classDiagram
|
|||||||
-_discoveryHelper: MonitorDiscoveryHelper
|
-_discoveryHelper: MonitorDiscoveryHelper
|
||||||
+Name: "DDC/CI Monitor Controller"
|
+Name: "DDC/CI Monitor Controller"
|
||||||
+DiscoverMonitorsAsync()
|
+DiscoverMonitorsAsync()
|
||||||
|
+GetBrightnessAsync(monitor)
|
||||||
|
+SetBrightnessAsync(monitor, brightness)
|
||||||
|
+SetContrastAsync(monitor, contrast)
|
||||||
|
+SetVolumeAsync(monitor, volume)
|
||||||
|
+GetColorTemperatureAsync(monitor)
|
||||||
|
+SetColorTemperatureAsync(monitor, colorTemperature)
|
||||||
|
+GetInputSourceAsync(monitor)
|
||||||
|
+SetInputSourceAsync(monitor, inputSource)
|
||||||
+GetCapabilitiesStringAsync(monitor) string
|
+GetCapabilitiesStringAsync(monitor) string
|
||||||
-GetVcpFeatureAsync(monitor, vcpCode, featureName)
|
-GetVcpFeatureAsync(monitor, vcpCode, featureName)
|
||||||
-SetVcpFeatureAsync(monitor, vcpCode, value)
|
|
||||||
-CollectCandidateMonitorsAsync()
|
-CollectCandidateMonitorsAsync()
|
||||||
-FetchCapabilitiesInParallelAsync()
|
-FetchCapabilitiesInParallelAsync()
|
||||||
-CreateValidMonitors()
|
-GetPhysicalMonitorsWithRetryAsync()
|
||||||
}
|
}
|
||||||
|
|
||||||
class WmiController {
|
class WmiController {
|
||||||
+Name: "WMI Monitor Controller"
|
+Name: "WMI Monitor Controller"
|
||||||
+DiscoverMonitorsAsync()
|
+DiscoverMonitorsAsync()
|
||||||
-BuildInstanceNameQuery()
|
+GetBrightnessAsync(monitor)
|
||||||
|
+SetBrightnessAsync(monitor, brightness)
|
||||||
|
+SetContrastAsync(monitor, contrast)
|
||||||
|
+SetVolumeAsync(monitor, volume)
|
||||||
|
+GetColorTemperatureAsync(monitor)
|
||||||
|
+SetColorTemperatureAsync(monitor, colorTemperature)
|
||||||
|
+GetInputSourceAsync(monitor)
|
||||||
|
+SetInputSourceAsync(monitor, inputSource)
|
||||||
-ExtractHardwareIdFromInstanceName()
|
-ExtractHardwareIdFromInstanceName()
|
||||||
-GetMonitorDisplayInfoByHardwareId()
|
-GetMonitorDisplayInfoByHardwareId()
|
||||||
-ClassifyWmiError()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IMonitorController <|.. DdcCiController
|
IMonitorController <|.. DdcCiController
|
||||||
@@ -1362,9 +1373,16 @@ classDiagram
|
|||||||
+int MinBrightness
|
+int MinBrightness
|
||||||
+int MaxBrightness
|
+int MaxBrightness
|
||||||
+int CurrentContrast
|
+int CurrentContrast
|
||||||
|
+int MinContrast
|
||||||
|
+int MaxContrast
|
||||||
+int CurrentVolume
|
+int CurrentVolume
|
||||||
|
+int MinVolume
|
||||||
|
+int MaxVolume
|
||||||
+int CurrentColorTemperature
|
+int CurrentColorTemperature
|
||||||
|
+string ColorTemperaturePresetName
|
||||||
+int CurrentInputSource
|
+int CurrentInputSource
|
||||||
|
+string InputSourceName
|
||||||
|
+IReadOnlyList~int~ SupportedInputSources
|
||||||
+int Orientation
|
+int Orientation
|
||||||
+bool IsAvailable
|
+bool IsAvailable
|
||||||
+bool SupportsContrast
|
+bool SupportsContrast
|
||||||
@@ -1389,10 +1407,13 @@ classDiagram
|
|||||||
+Dictionary~byte, VcpCodeInfo~ SupportedVcpCodes
|
+Dictionary~byte, VcpCodeInfo~ SupportedVcpCodes
|
||||||
+List~WindowCapability~ Windows
|
+List~WindowCapability~ Windows
|
||||||
+bool HasWindowSupport
|
+bool HasWindowSupport
|
||||||
|
+static VcpCapabilities Empty$
|
||||||
+SupportsVcpCode(code) bool
|
+SupportsVcpCode(code) bool
|
||||||
+GetVcpCodeInfo(code) VcpCodeInfo
|
+GetVcpCodeInfo(code) VcpCodeInfo
|
||||||
|
+HasDiscreteValues(code) bool
|
||||||
+GetSupportedValues(code) IReadOnlyList~int~
|
+GetSupportedValues(code) IReadOnlyList~int~
|
||||||
+GetVcpCodesAsHexStrings() List~string~
|
+GetVcpCodesAsHexStrings() List~string~
|
||||||
|
+GetSortedVcpCodes() IEnumerable~VcpCodeInfo~
|
||||||
}
|
}
|
||||||
|
|
||||||
class VcpCodeInfo {
|
class VcpCodeInfo {
|
||||||
@@ -1405,6 +1426,32 @@ classDiagram
|
|||||||
+string FormattedTitle
|
+string FormattedTitle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class WindowCapability {
|
||||||
|
<<struct>>
|
||||||
|
+int WindowNumber
|
||||||
|
+string Type
|
||||||
|
+WindowArea Area
|
||||||
|
+WindowSize MaxSize
|
||||||
|
+WindowSize MinSize
|
||||||
|
+int WindowId
|
||||||
|
}
|
||||||
|
|
||||||
|
class WindowSize {
|
||||||
|
<<struct>>
|
||||||
|
+int Width
|
||||||
|
+int Height
|
||||||
|
}
|
||||||
|
|
||||||
|
class WindowArea {
|
||||||
|
<<struct>>
|
||||||
|
+int X1
|
||||||
|
+int Y1
|
||||||
|
+int X2
|
||||||
|
+int Y2
|
||||||
|
+int Width
|
||||||
|
+int Height
|
||||||
|
}
|
||||||
|
|
||||||
class VcpFeatureValue {
|
class VcpFeatureValue {
|
||||||
+int Current
|
+int Current
|
||||||
+int Minimum
|
+int Minimum
|
||||||
@@ -1452,6 +1499,10 @@ classDiagram
|
|||||||
Monitor "1" --> "0..1" VcpCapabilities
|
Monitor "1" --> "0..1" VcpCapabilities
|
||||||
Monitor "1" --> "1" MonitorCapabilities
|
Monitor "1" --> "1" MonitorCapabilities
|
||||||
VcpCapabilities "1" --> "*" VcpCodeInfo
|
VcpCapabilities "1" --> "*" VcpCodeInfo
|
||||||
|
VcpCapabilities "1" --> "*" WindowCapability
|
||||||
|
WindowCapability "1" --> "1" WindowArea
|
||||||
|
WindowCapability "1" --> "1" WindowSize : MaxSize
|
||||||
|
WindowCapability "1" --> "1" WindowSize : MinSize
|
||||||
PowerDisplayProfiles "1" --> "*" PowerDisplayProfile
|
PowerDisplayProfiles "1" --> "*" PowerDisplayProfile
|
||||||
PowerDisplayProfile "1" --> "*" ProfileMonitorSetting
|
PowerDisplayProfile "1" --> "*" ProfileMonitorSetting
|
||||||
```
|
```
|
||||||
@@ -1484,10 +1535,15 @@ classDiagram
|
|||||||
+string InternalName
|
+string InternalName
|
||||||
+string HardwareId
|
+string HardwareId
|
||||||
+string CommunicationMethod
|
+string CommunicationMethod
|
||||||
|
+int MonitorNumber
|
||||||
|
+int TotalMonitorCount
|
||||||
|
+string DisplayName
|
||||||
|
+string MonitorIconGlyph
|
||||||
+int CurrentBrightness
|
+int CurrentBrightness
|
||||||
+int Contrast
|
+int Contrast
|
||||||
+int Volume
|
+int Volume
|
||||||
+int ColorTemperatureVcp
|
+int ColorTemperatureVcp
|
||||||
|
+int Orientation
|
||||||
+bool SupportsBrightness
|
+bool SupportsBrightness
|
||||||
+bool SupportsContrast
|
+bool SupportsContrast
|
||||||
+bool SupportsColorTemperature
|
+bool SupportsColorTemperature
|
||||||
@@ -1496,9 +1552,30 @@ classDiagram
|
|||||||
+bool EnableContrast
|
+bool EnableContrast
|
||||||
+bool EnableVolume
|
+bool EnableVolume
|
||||||
+bool EnableInputSource
|
+bool EnableInputSource
|
||||||
|
+bool EnableRotation
|
||||||
+bool IsHidden
|
+bool IsHidden
|
||||||
+string CapabilitiesRaw
|
+string CapabilitiesRaw
|
||||||
+List~string~ VcpCodes
|
+List~string~ VcpCodes
|
||||||
|
+List~VcpCodeDisplayInfo~ VcpCodesFormatted
|
||||||
|
+ObservableCollection~ColorPresetItem~ AvailableColorPresets
|
||||||
|
+ObservableCollection~ColorPresetItem~ ColorPresetsForDisplay
|
||||||
|
+bool HasCapabilities
|
||||||
|
+bool ShowCapabilitiesWarning
|
||||||
|
+GetVcpCodesAsText() string
|
||||||
|
+UpdateFrom(other)
|
||||||
|
}
|
||||||
|
|
||||||
|
class VcpCodeDisplayInfo {
|
||||||
|
+string Code
|
||||||
|
+string Title
|
||||||
|
+string Values
|
||||||
|
+bool HasValues
|
||||||
|
+List~VcpValueInfo~ ValueList
|
||||||
|
}
|
||||||
|
|
||||||
|
class VcpValueInfo {
|
||||||
|
+string Value
|
||||||
|
+string Name
|
||||||
}
|
}
|
||||||
|
|
||||||
class ColorTemperatureOperation {
|
class ColorTemperatureOperation {
|
||||||
@@ -1511,6 +1588,8 @@ classDiagram
|
|||||||
+List~ProfileMonitorSetting~ MonitorSettings
|
+List~ProfileMonitorSetting~ MonitorSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MonitorInfo "1" --> "*" VcpCodeDisplayInfo
|
||||||
|
VcpCodeDisplayInfo "1" --> "*" VcpValueInfo
|
||||||
PowerDisplaySettings "1" --> "1" PowerDisplayProperties
|
PowerDisplaySettings "1" --> "1" PowerDisplayProperties
|
||||||
PowerDisplayProperties "1" --> "*" MonitorInfo
|
PowerDisplayProperties "1" --> "*" MonitorInfo
|
||||||
PowerDisplayProperties "1" --> "0..1" ColorTemperatureOperation
|
PowerDisplayProperties "1" --> "0..1" ColorTemperatureOperation
|
||||||
|
|||||||
Reference in New Issue
Block a user