Switch Connections to use ValueSets to initialize them#10184
Conversation
Now we have an InteractivityAutomationPeer, which acts like the implementation for TermControlAutomationPeer. TermControlAutomationPeer is still needed though, because it implements FrameworkElementAutomationPeer, which is needed to hook up the AP to the actual UIA tree. So we split up the work into two halves, the bit that should be done by the core (the ITextProvider, the IControlAccessibilityInfo), vs the stuff that needs to be in the control (FrameworkElementAutomationPeer). IUiaEventDispatcher should probably be in the control as well, but that's a problem for future us.
…ractivity-projection-000
…ractivity-projection-000
…ity-projection-000 # Conflicts: # src/cascadia/TerminalControl/ControlInteractivity.cpp # src/cascadia/TerminalControl/ControlInteractivity.h # src/cascadia/TerminalControl/TermControl.cpp # src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp
…s are still wrong
…ractivity-projection-000
…e/oop/sample-project
…ity-projection-000
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentAAAAABBBBBBBCCC AAAAABCCCCCCCCC AAAAADCCCCCCCCC cang hpcon memcopy rgch Scrolldown Scrolldownpage Scrollup Scrolluppage serializer serializers TlgTo accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the [email protected]:microsoft/terminal.git repository ✏️ Contributor please read thisBy default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
If the listed items are:
See the 🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉 🗜️ If you see a bunch of garbageIf it relates to a ... well-formed patternSee if there's a pattern that would match it. If not, try writing one and adding it to a Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines. Note that patterns can't match multiline strings. binary-ish stringPlease add a file path to the File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
|
04b751f to
248f91c
Compare
…ity-projection-000
commit 04b751f Author: Mike Griese <[email protected]> Date: Tue May 25 16:30:51 2021 -0500 I really shouldn't be doing the throttledfunc thing in this PR commit d615ece Author: Mike Griese <[email protected]> Date: Tue May 25 16:12:52 2021 -0500 this doesn't belong here commit 59dc2ab Author: Mike Griese <[email protected]> Date: Tue May 25 15:41:50 2021 -0500 doc comments commit 3950869 Author: Mike Griese <[email protected]> Date: Tue May 25 15:16:58 2021 -0500 fix both slns to work commit 1f51a26 Author: Mike Griese <[email protected]> Date: Tue May 25 11:37:46 2021 -0500 Remove all IConnectionSettings from WT. Use ValueSet instead commit 7e4ec26 Merge: 36042a3 d4c4492 Author: Mike Griese <[email protected]> Date: Tue May 25 07:38:20 2021 -0500 Merge branch 'dev/migrie/oop/sample-project' into dev/migrie/oop/connection-factory-rebase commit 36042a3 Merge: 5411d8a 76a2dd5 Author: Mike Griese <[email protected]> Date: Mon May 24 12:47:25 2021 -0500 Merge branch 'dev/migrie/oop/sample-project' into dev/migrie/oop/connection-factory-rebase commit 5411d8a Author: Mike Griese <[email protected]> Date: Thu May 20 11:36:00 2021 -0500 Fix the azure connection, and build breaks in general This totally works, so that's cool commit 6104728 Author: Mike Griese <[email protected]> Date: Fri May 14 11:51:48 2021 -0500 cleanup commit d65f897 Author: Mike Griese <[email protected]> Date: Fri May 14 11:22:24 2021 -0500 looks like scrolling is back on the menu boys. 16.243s vs 16.035s in-proc vs out, so I'm gonna say there's not a substantial regression here, whoop whoop commit c850dcf Author: Mike Griese <[email protected]> Date: Fri May 14 10:14:33 2021 -0500 This gets rid of the output one, which I was the MOST worried about. Still worried about the scrollbar one though. In release, we're getting 16.849s vs 16.378s for in-proc vs oop commit 0b53563 Author: Mike Griese <[email protected]> Date: Fri May 14 09:10:27 2021 -0500 found a way to have dispatchers inside ControlCore, in the content process commit 72ccb5d Author: Mike Griese <[email protected]> Date: Tue May 11 16:48:12 2021 -0500 Comment out these events, becasue they're hella slow. We'll have to replace them commit aeb4317 Author: Mike Griese <[email protected]> Date: Tue May 11 14:38:55 2021 -0500 Well, the connection is out of proc, but the callbacks to the UI process are **P A I N** commit 89e0ad5 Author: Mike Griese <[email protected]> Date: Tue May 11 12:38:31 2021 -0500 I really hate this whole 'you can't have two methods with the same number of args' crap. Makes this way harder. Clearly, what I did here is still in-proc commit 206aee3 Author: Mike Griese <[email protected]> Date: Tue May 11 11:59:39 2021 -0500 Change TermControl to beable to do the in-proc connection creation, probably? commit 1d6b1d1 Author: Mike Griese <[email protected]> Date: Tue May 11 09:30:43 2021 -0500 Add IConnectionSettings, so connections can get their settings from another object, not necessarily the ctor commit 7fa5ccd Author: Mike Griese <[email protected]> Date: Mon May 10 16:45:54 2021 -0500 proof of concept using RoActivateClass to create a connection by string (cherry picked from commit 248f91c)
248f91c to
c15a93a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ity-projection-000
…hub.com/microsoft/terminal into dev/migrie/interactivity-projection-000
…thub.com/microsoft/terminal into dev/migrie/oop/connection-factory-rebase
…ity-projection-000
…ion-000' into dev/migrie/oop/connection-factory-rebase
carlos-zamora
left a comment
There was a problem hiding this comment.
Just the nit about adding a bunch of const there.
| auto pointer = winrt::put_abi(inspectable); | ||
| ::IInspectable** raw = reinterpret_cast<::IInspectable**>(pointer); |
There was a problem hiding this comment.
this seems scary. is there not a way to just get an abi-compatible IInspectable** directly?
There was a problem hiding this comment.
Right right, but I meant something closer to, "in the intervening time, did we find something that is less ~ ~ weird ~ ~ than that?" 😄
(reinterpret_casting a pointer is scary, and it didn't seem necessary from the original example 😄)
| // auto bad = unbox_value_or<hstring>(settings.TryLookup(L"foo").try_as<IPropertyValue>(), nullptr); | ||
| // It'll just return null | ||
|
|
||
| _commandline = winrt::unbox_value_or<winrt::hstring>(settings.TryLookup(L"commandline").try_as<Windows::Foundation::IPropertyValue>(), _commandline); |
There was a problem hiding this comment.
This could use some helpers in the future... and could use type deduction like JsonUtils
template <typename T>
TryGetSetting(ValueSet v, std::wstring_view key, T& storage) {
storage = winrt::unbox_value_or<typename std::decay<T>::type>(s.TryLookup(key).try_as...., storage);
}
|
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…tion-factory-rebase

Summary of the Pull Request
This PR does one big, primary thing. It removes all the constructors from any TerminalConnections, and changes them to use an
Initializemethod that accepts aValueSetof properties.Why?
For the upcoming window/content process work, we'll need the content process to be able to initialize the connection in the content process. However, the window process will be the one that knows what type of connection to make. Enter
ConnectionInformation. This class will let us specify the class name of the type we want to create, and a set of settings to use when initializing that connection.IMPORTANT: As a part of this, the constructor for a connection must have 0 arguments.
RoActivateInstancelets you just conjure a WinRT type just by class name, but that class must have a 0 arg ctor. Hence the need forInitialize, to actually pass the settings.We're using a
ValueSethere because it's basically a json blob, with more steps. In the future, when extension authors want to have custom connections, we can always deserialize the json into aValueSet, pass it to their connection'sInitialize, and let then get what they need out of it.References
PR Checklist
Detailed Description of the Pull Request / Additional comments
ConnectionInformationwas included as a part of this PR, to demonstrate how this will eventually be used.ConnectionInformationis not currently used.Validation Steps Performed
It still builds and runs.