Commit Graph

5 Commits

Author SHA1 Message Date
Yu Leng
2083fcd143 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)
2025-12-12 11:26:14 +08:00
Yu Leng
4c93fe01d0 PowerDisplay: overhaul design docs, remove obsolete IPC code
Expanded and clarified PowerDisplay design documentation:
- Added detailed section on monitor identification (handles, IDs, MST, clone mode, etc.) with diagrams and tables.
- Updated architecture, flowcharts, and class diagrams to reflect new helpers, services, and improved data flows.
- Expanded internal structure details for PowerDisplay.Lib and app, listing new helpers, models, and utilities.
- Updated sequence diagrams for LightSwitch integration and Settings UI interaction.
- Revised future considerations, marking hot-plug and rotation as implemented, and adding new feature ideas.

Removed all obsolete PowerDisplay IPC forwarding code from settings_window.cpp/h, including the send_powerdisplay_message_to_settings_ui function and related JSON dispatch logic. This reflects a refactor or deprecation of the previous custom IPC mechanism.
2025-12-12 09:44:28 +08:00
Yu Leng
393b0af104 Fix typo: "relys" to "relies" in documentation
Corrected a grammatical error in the documentation by changing "PowerDisplay relys on" to "PowerDisplay relies on" for improved clarity and accuracy.
2025-12-09 11:24:23 +08:00
Yu Leng
47638c5c6d Add DisplayChangeWatcher for monitor hot-plug detection
Introduced the `DisplayChangeWatcher` component to detect monitor
connect/disconnect events using the WinRT `DeviceWatcher` API.
Implemented 1-second debouncing to coalesce rapid changes and
trigger a `DisplayChanged` event for refreshing the monitor list.

Integrated `DisplayChangeWatcher` into `MainViewModel`, adding
lifecycle management methods (`StartDisplayWatching`,
`StopDisplayWatching`) and handling the `DisplayChanged` event
to refresh monitors dynamically.

Updated `Dispose` in `MainViewModel` to ensure proper cleanup
of the `DisplayChangeWatcher`. Enhanced logging and added
detailed comments for better traceability.

Modified `design.md` to document the new component, updated
flowcharts, and marked "Monitor Hot-Plug" as implemented.
Reflected changes in the `PowerDisplay` directory structure.
2025-12-05 00:10:26 +08:00
Yu Leng
f32ee3ea02 Add WindowParser and refactor theme and brightness logic
Introduced `WindowParser` to parse `windowN` segments for PIP/PBP
capabilities in MCCS strings. Added new data models (`WindowCapability`,
`WindowArea`, `WindowSize`) to represent parsed window data. Updated
`MccsCapabilitiesParser` to handle `windowN` segments and added unit
tests for various configurations.

Refactored brightness control in `DdcCiController` to exclusively use
VCP code `0x10`, removing high-level API methods. Updated `DdcCiNative`
to streamline brightness operations.

Revised `LightSwitchListener` and `LightSwitchStateManager` to use
separate light/dark theme events, eliminating race conditions. Removed
registry-based theme detection logic.

Enhanced `VcpCodeNames` with additional VCP codes and improved
categorization. Updated documentation and architecture diagrams to
reflect these changes. Removed unused legacy methods and improved
logging and error handling.
2025-12-04 05:44:59 +08:00