2608e94822
Introduces a new TerminalSettingsModel (TSM) project. This project is responsible for (de)serializing and exposing Windows Terminal's settings as WinRT objects. ## References #885: TSM epic #1564: Settings UI is dependent on this for data binding and settings access #6904: TSM Spec In the process of ripping out TSM from TerminalApp, a few other changes were made to make this possible: 1. AppLogic's `ApplicationDisplayName` and `ApplicationVersion` was moved to `CascadiaSettings` - These are defined as static functions. They also no longer check if `AppLogic::Current()` is nullptr. 2. `enum LaunchMode` was moved from TerminalApp to TSM 3. `AzureConnectionType` and `TelnetConnectionType` were moved from the profile generators to their respective TerminalConnections 4. CascadiaSettings' `SettingsPath` and `DefaultSettingsPath` are exposed as `hstring` instead of `std::filesystem::path` 5. `Command::ExpandCommands()` was exposed via the IDL - This required some of the warnings to be saved to an `IVector` instead of `std::vector`, among some other small changes. 6. The localization resources had to be split into two halves. - Resource file linked in init.cpp. Verified at runtime thanks to the StaticResourceLoader. 7. Added constructors to some `ActionArgs` 8. Utils.h/cpp were moved to `cascadia/inc`. `JsonKey()` was moved to `JsonUtils`. Both TermApp and TSM need access to Utils.h/cpp. A large amount of work includes moving to the new namespace (`TerminalApp` --> `Microsoft::Terminal::Settings::Model`). Fixing the tests had its own complications. Testing required us to split up TSM into a DLL and LIB, similar to TermApp. Discussion on creating a non-local test variant can be found in #7743. Closes #885
152 lines
3.8 KiB
Plaintext
152 lines
3.8 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
namespace Microsoft.Terminal.Settings.Model
|
|
{
|
|
interface IActionArgs
|
|
{
|
|
Boolean Equals(IActionArgs other);
|
|
String GenerateName();
|
|
};
|
|
|
|
interface IActionEventArgs
|
|
{
|
|
Boolean Handled;
|
|
IActionArgs ActionArgs { get; };
|
|
};
|
|
|
|
enum Direction
|
|
{
|
|
None = 0,
|
|
Left,
|
|
Right,
|
|
Up,
|
|
Down
|
|
};
|
|
|
|
enum SplitState
|
|
{
|
|
Automatic = -1,
|
|
None = 0,
|
|
Vertical = 1,
|
|
Horizontal = 2
|
|
};
|
|
|
|
enum SplitType
|
|
{
|
|
Manual = 0,
|
|
Duplicate = 1
|
|
};
|
|
|
|
enum SettingsTarget
|
|
{
|
|
SettingsFile = 0,
|
|
DefaultsFile,
|
|
AllFiles
|
|
};
|
|
|
|
[default_interface] runtimeclass NewTerminalArgs {
|
|
NewTerminalArgs();
|
|
NewTerminalArgs(Int32 profileIndex);
|
|
|
|
String Commandline;
|
|
String StartingDirectory;
|
|
String TabTitle;
|
|
String Profile; // Either a GUID or a profile's name if the GUID isn't a match
|
|
// ProfileIndex can be null (for "use the default"), so this needs to be
|
|
// a IReference, so it's nullable
|
|
Windows.Foundation.IReference<Int32> ProfileIndex { get; };
|
|
|
|
Boolean Equals(NewTerminalArgs other);
|
|
String GenerateName();
|
|
};
|
|
|
|
[default_interface] runtimeclass ActionEventArgs : IActionEventArgs
|
|
{
|
|
ActionEventArgs();
|
|
ActionEventArgs(IActionArgs args);
|
|
};
|
|
|
|
[default_interface] runtimeclass CopyTextArgs : IActionArgs
|
|
{
|
|
Boolean SingleLine { get; };
|
|
Windows.Foundation.IReference<Microsoft.Terminal.TerminalControl.CopyFormat> CopyFormatting { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass NewTabArgs : IActionArgs
|
|
{
|
|
NewTabArgs(NewTerminalArgs terminalArgs);
|
|
NewTerminalArgs TerminalArgs { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SwitchToTabArgs : IActionArgs
|
|
{
|
|
SwitchToTabArgs(UInt32 tabIndex);
|
|
UInt32 TabIndex;
|
|
};
|
|
|
|
[default_interface] runtimeclass ResizePaneArgs : IActionArgs
|
|
{
|
|
Direction Direction { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass MoveFocusArgs : IActionArgs
|
|
{
|
|
Direction Direction { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass AdjustFontSizeArgs : IActionArgs
|
|
{
|
|
Int32 Delta { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SendInputArgs : IActionArgs
|
|
{
|
|
String Input { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SplitPaneArgs : IActionArgs
|
|
{
|
|
SplitPaneArgs(SplitState style, NewTerminalArgs terminalArgs);
|
|
SplitState SplitStyle { get; };
|
|
NewTerminalArgs TerminalArgs { get; };
|
|
SplitType SplitMode { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass OpenSettingsArgs : IActionArgs
|
|
{
|
|
SettingsTarget Target { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SetColorSchemeArgs : IActionArgs
|
|
{
|
|
String SchemeName { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SetTabColorArgs : IActionArgs
|
|
{
|
|
Windows.Foundation.IReference<UInt32> TabColor { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass RenameTabArgs : IActionArgs
|
|
{
|
|
String Title { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass ExecuteCommandlineArgs : IActionArgs
|
|
{
|
|
ExecuteCommandlineArgs(String commandline);
|
|
String Commandline;
|
|
};
|
|
|
|
[default_interface] runtimeclass CloseOtherTabsArgs : IActionArgs
|
|
{
|
|
Windows.Foundation.IReference<UInt32> Index { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass CloseTabsAfterArgs : IActionArgs
|
|
{
|
|
Windows.Foundation.IReference<UInt32> Index { get; };
|
|
};
|
|
}
|