-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Microsoft.Terminal.Remoting.dll
(#8607)
Adds a `Microsoft.Terminal.Remoting.dll` to our solution. This DLL will be responsible for all the Monarch/Peasant work that's been described in #7240 & #8135. This PR does _not_ implement the Monarch/Peasant architecture in any significant way. The goal of this PR is to just to establish the project layout, and the most basic connections. This should make reviewing the actual meat of the implementation (in a later PR) easier. It will also give us the opportunity to include some of the basic weird things we're doing (with `CoRegisterClass`) in the Terminal _now_, and get them selfhosted, before building on them too much. This PR does have windows registering the `Monarch` class with COM. When windows are created, they'll as the Monarch if they should create a new window or not. In this PR, the Monarch will always reply "yes, please make a new window". Similar to other projects in our solution, we're adding 3 projects here: * `Microsoft.Terminal.Remoting.lib`: the actual implementation, as a static lib. * `Microsoft.Terminal.Remoting.dll`: The implementation linked as a DLL, for use in `WindowsTerminal.exe`. * `Remoting.UnitTests.dll`: A unit test dll that links with the static lib. There are plenty of TODOs scattered about the code. Clearly, most of this isn't implemented yet, but I do have more WIP branches. I'm using [`projects/5`](https://github.com/microsoft/terminal/projects/5) as my notation for TODOs that are too small for an issue, but are part of the whole Process Model 2.0 work. ## References * #5000 - this is the process model megathread * #7240 - The process model 2.0 spec. * #8135 - the window management spec. (please review me, I have 0/3 signoffs even after the discussion we had 😢) * #8171 - the Monarch/peasant sample. (please review me, I have 1/2) ## PR Checklist * [x] Closes nothing, this is just infrastructure * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated
- Loading branch information
1 parent
cceb0ea
commit 7d503a4
Showing
42 changed files
with
1,457 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "pch.h" | ||
|
||
#include "CommandlineArgs.h" | ||
#include "CommandlineArgs.g.cpp" | ||
using namespace winrt; | ||
using namespace winrt::Microsoft::Terminal; | ||
using namespace winrt::Windows::Foundation; | ||
|
||
namespace winrt::Microsoft::Terminal::Remoting::implementation | ||
{ | ||
// LOAD BEARING CODE | ||
// If you try to move this into the header, you will experience P A I N | ||
// It must be defined after CommandlineArgs.g.cpp, otherwise the compiler | ||
// will give you just the most impossible template errors to try and | ||
// decipher. | ||
void CommandlineArgs::Args(winrt::array_view<const winrt::hstring> const& value) | ||
{ | ||
_args = { value.begin(), value.end() }; | ||
} | ||
|
||
winrt::com_array<winrt::hstring> CommandlineArgs::Args() | ||
{ | ||
return winrt::com_array<winrt::hstring>{ _args.begin(), _args.end() }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include "CommandlineArgs.g.h" | ||
#include "../cascadia/inc/cppwinrt_utils.h" | ||
|
||
namespace winrt::Microsoft::Terminal::Remoting::implementation | ||
{ | ||
struct CommandlineArgs : public CommandlineArgsT<CommandlineArgs> | ||
{ | ||
public: | ||
CommandlineArgs() : | ||
_args{}, | ||
_cwd{ L"" } | ||
{ | ||
} | ||
|
||
CommandlineArgs(const winrt::array_view<const winrt::hstring>& args, | ||
winrt::hstring currentDirectory) : | ||
_args{ args.begin(), args.end() }, | ||
_cwd{ currentDirectory } | ||
{ | ||
} | ||
|
||
winrt::hstring CurrentDirectory() { return _cwd; }; | ||
|
||
void Args(winrt::array_view<const winrt::hstring> const& value); | ||
winrt::com_array<winrt::hstring> Args(); | ||
|
||
private: | ||
winrt::com_array<winrt::hstring> _args; | ||
winrt::hstring _cwd; | ||
}; | ||
|
||
} | ||
|
||
namespace winrt::Microsoft::Terminal::Remoting::factory_implementation | ||
{ | ||
BASIC_FACTORY(CommandlineArgs); | ||
} |
Oops, something went wrong.