[PR #15029] [MERGED] Add til::property and other winrt helpers #30361

Open
opened 2026-01-31 09:40:19 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15029
Author: @zadjii-msft
Created: 3/21/2023
Status: Merged
Merged: 5/3/2023
Merged by: @zadjii-msft

Base: mainHead: dev/migrie/til-I-was-quicker-than-raymond-chen


📝 Commits (10+)

  • eaf1a92 okay maybe I have silly free time ideas too
  • 7001e93 forwarded_event, string tests
  • eb88cd3 practical use, look
  • b535a5f I suppose this is what happens when I have four uninterrupted hours away from the kid
  • 520c89f sad beeps
  • 3792caf Merge branch 'main' into dev/migrie/til-I-was-quicker-than-raymond-chen
  • 54e9e49 a more practical use
  • c763d55 It's all about truthiness
  • 4810fed more explicit testing of nested objects
  • bd4b515 footguns

📊 Changes

9 files changed (+372 additions, -9 deletions)

View changed files

📝 .github/actions/spelling/allow/allow.txt (+1 -0)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+3 -3)
📝 src/cascadia/TerminalControl/ControlCore.h (+2 -2)
📝 src/cascadia/TerminalControl/pch.h (+1 -0)
📝 src/cascadia/UnitTests_Control/pch.h (+1 -0)
📝 src/cascadia/UnitTests_TerminalCore/MockTermSettings.h (+6 -4)
src/cascadia/UnitTests_TerminalCore/TilWinRtHelpersTests.cpp (+246 -0)
📝 src/cascadia/UnitTests_TerminalCore/UnitTests.vcxproj (+1 -0)
src/inc/til/winrt.h (+111 -0)

📄 Description

Summary of the Pull Request

This was a fever dream I had last July. What if, instead of WINRT_PROPERTY magic macros everywhere, we had actual templated versions you could debug into.

So instead of

WINRT_PROPERTY(bool, Deleted, false);
WINRT_PROPERTY(OriginTag, Origin, OriginTag::None);
WINRT_PROPERTY(guid, Updates);

you'd do

til::property<bool> Deleted{ false };
til::property<OriginTag> Origin{ OriginTag::None };
til::property<guid> Updates;

.... and then I just kinda kept doing that. So I did that for til::event and til::forwarded_event too.

AND THEN LAST WEEK

Raymond Chen was like: "this is a good idea"

So here it is.

Validation Steps Performed

Added some simple tests.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/15029 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 3/21/2023 **Status:** ✅ Merged **Merged:** 5/3/2023 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `main` ← **Head:** `dev/migrie/til-I-was-quicker-than-raymond-chen` --- ### 📝 Commits (10+) - [`eaf1a92`](https://github.com/microsoft/terminal/commit/eaf1a920e1a4d5a4ea349ed0036f3fa520709212) okay maybe I have silly free time ideas too - [`7001e93`](https://github.com/microsoft/terminal/commit/7001e93550ef6ac182b7bb6aaaf3a0acbdbe2b82) forwarded_event, string tests - [`eb88cd3`](https://github.com/microsoft/terminal/commit/eb88cd3a2d15fbf30af64a70f2ef859173388a40) practical use, look - [`b535a5f`](https://github.com/microsoft/terminal/commit/b535a5f3f359b95156119679a144e0f7ada9ce4e) I suppose this is what happens when I have four uninterrupted hours away from the kid - [`520c89f`](https://github.com/microsoft/terminal/commit/520c89f1fe236c2684f7f2a8434d7e8157e3b597) sad beeps - [`3792caf`](https://github.com/microsoft/terminal/commit/3792cafac0669c2ef0005916fd0ce4ab55a03c41) Merge branch 'main' into dev/migrie/til-I-was-quicker-than-raymond-chen - [`54e9e49`](https://github.com/microsoft/terminal/commit/54e9e4932b0f10104491a3fdd1c276ec457c5600) a more practical use - [`c763d55`](https://github.com/microsoft/terminal/commit/c763d55ac5a7dc4079ee587d4deee49c8bf13f4a) It's all about truthiness - [`4810fed`](https://github.com/microsoft/terminal/commit/4810fed7236743808c8796a7c7fff8946361f9b5) more explicit testing of nested objects - [`bd4b515`](https://github.com/microsoft/terminal/commit/bd4b5155a8778cd4d7e9bab1cc7fbc9af18c1e96) footguns ### 📊 Changes **9 files changed** (+372 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/allow.txt` (+1 -0) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+3 -3) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+2 -2) 📝 `src/cascadia/TerminalControl/pch.h` (+1 -0) 📝 `src/cascadia/UnitTests_Control/pch.h` (+1 -0) 📝 `src/cascadia/UnitTests_TerminalCore/MockTermSettings.h` (+6 -4) ➕ `src/cascadia/UnitTests_TerminalCore/TilWinRtHelpersTests.cpp` (+246 -0) 📝 `src/cascadia/UnitTests_TerminalCore/UnitTests.vcxproj` (+1 -0) ➕ `src/inc/til/winrt.h` (+111 -0) </details> ### 📄 Description ## Summary of the Pull Request This was a fever dream I had last July. What if, instead of `WINRT_PROPERTY` magic macros everywhere, we had actual templated versions you could debug into. So instead of ```c++ WINRT_PROPERTY(bool, Deleted, false); WINRT_PROPERTY(OriginTag, Origin, OriginTag::None); WINRT_PROPERTY(guid, Updates); ``` you'd do ```c++ til::property<bool> Deleted{ false }; til::property<OriginTag> Origin{ OriginTag::None }; til::property<guid> Updates; ``` .... and then I just kinda kept doing that. So I did that for `til::event` and `til::forwarded_event` too. **AND THEN LAST WEEK** Raymond Chen was like: ["this is a good idea"](https://devblogs.microsoft.com/oldnewthing/20230317-00/?p=107946) So here it is. ## Validation Steps Performed Added some simple tests. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:40:19 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30361