mirror of
https://github.com/microsoft/terminal.git
synced 2026-05-17 15:36:35 +00:00
Compare commits
3 Commits
v1.25.1241
...
dev/duhowe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
238d848ecc | ||
|
|
24297f99d9 | ||
|
|
3564c6cb54 |
@@ -18,9 +18,7 @@
|
||||
// Legacy DLLs with old names
|
||||
"TerminalApp.dll",
|
||||
"TerminalApp.winmd",
|
||||
"TerminalConnection.dll",
|
||||
"TerminalThemeHelpers.dll",
|
||||
"WindowsTerminalShellExt.dll",
|
||||
|
||||
// The rest
|
||||
"TerminalAzBridge.exe",
|
||||
|
||||
@@ -58,7 +58,7 @@ Try {
|
||||
|
||||
### Check the activatable class entries for a few DLLs we need.
|
||||
$inProcServers = $Manifest.Package.Extensions.Extension.InProcessServer.Path
|
||||
$RequiredInProcServers = ("TerminalApp.dll", "Microsoft.Terminal.Control.dll", "Microsoft.Terminal.Remoting.dll", "Microsoft.Terminal.Settings.Editor.dll", "Microsoft.Terminal.Settings.Model.dll", "TerminalConnection.dll")
|
||||
$RequiredInProcServers = ("TerminalApp.dll", "Microsoft.Terminal.Control.dll", "Microsoft.Terminal.Remoting.dll", "Microsoft.Terminal.Settings.Editor.dll", "Microsoft.Terminal.Settings.Model.dll", "Microsoft.Terminal.Connection.dll")
|
||||
|
||||
Write-Verbose "InProc Servers: $inProcServers"
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ this:
|
||||
echo OutDir=$(OutDir)
|
||||
(xcopy /Y "$(SolutionDir)src\cascadia\ut_app\TerminalApp.Unit.Tests.manifest" "$(OutDir)\TerminalApp.Unit.Tests.manifest*" )
|
||||
|
||||
(xcopy /Y "$(OpenConsoleCommonOutDir)\TerminalConnection\TerminalConnection.dll" "$(OutDir)\TerminalConnection.dll*" )
|
||||
(xcopy /Y "$(OpenConsoleCommonOutDir)\TerminalConnection\Microsoft.Terminal.Connection.dll" "$(OutDir)\Microsoft.Terminal.Connection.dll*" )
|
||||
(xcopy /Y "$(OpenConsoleCommonOutDir)\TerminalSettings\TerminalSettings.dll" "$(OutDir)\TerminalSettings.dll*" )
|
||||
(xcopy /Y "$(OpenConsoleCommonOutDir)\TerminalControl\TerminalControl.dll" "$(OutDir)\TerminalControl.dll*" )
|
||||
</Command>
|
||||
@@ -446,7 +446,7 @@ before. The complete `PostBuildEvent` now looks like this:
|
||||
|
||||
(xcopy /Y "$(SolutionDir)src\cascadia\ut_app\TerminalApp.Unit.Tests.AppxManifest.xml" "$(OutDir)\TerminalApp.Unit.Tests.AppxManifest.xml*" )
|
||||
|
||||
(xcopy /Y "$(OpenConsoleCommonOutDir)\TerminalConnection\TerminalConnection.dll" "$(OutDir)\TerminalConnection.dll*" )
|
||||
(xcopy /Y "$(OpenConsoleCommonOutDir)\TerminalConnection\Microsoft.Terminal.Connection.dll" "$(OutDir)\Microsoft.Terminal.Connection.dll*" )
|
||||
(xcopy /Y "$(OpenConsoleCommonOutDir)\TerminalSettings\TerminalSettings.dll" "$(OutDir)\TerminalSettings.dll*" )
|
||||
(xcopy /Y "$(OpenConsoleCommonOutDir)\TerminalControl\TerminalControl.dll" "$(OutDir)\TerminalControl.dll*" )
|
||||
</Command>
|
||||
|
||||
@@ -49,9 +49,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Terminal.TerminalConnection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
|
||||
<Implementation>$(OpenConsoleCommonOutDir)TerminalConnection\TerminalConnection.dll</Implementation>
|
||||
<Reference Include="Microsoft.Terminal.Connection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.winmd</HintPath>
|
||||
<Implementation>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.dll</Implementation>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace winrt::SampleApp::implementation
|
||||
{
|
||||
auto settings = winrt::make_self<implementation::MySettings>();
|
||||
|
||||
auto connectionSettings{ TerminalConnection::ConptyConnection::CreateSettings(L"cmd.exe /k echo This TermControl is hosted in-proc...",
|
||||
auto connectionSettings{ Connection::ConptyConnection::CreateSettings(L"cmd.exe /k echo This TermControl is hosted in-proc...",
|
||||
winrt::hstring{},
|
||||
L"",
|
||||
nullptr,
|
||||
@@ -36,11 +36,11 @@ namespace winrt::SampleApp::implementation
|
||||
80,
|
||||
winrt::guid()) };
|
||||
|
||||
// "Microsoft.Terminal.TerminalConnection.ConptyConnection"
|
||||
winrt::hstring myClass{ winrt::name_of<TerminalConnection::ConptyConnection>() };
|
||||
TerminalConnection::ConnectionInformation connectInfo{ myClass, connectionSettings };
|
||||
// "Microsoft.Terminal.Connection.ConptyConnection"
|
||||
winrt::hstring myClass{ winrt::name_of<Connection::ConptyConnection>() };
|
||||
Connection::ConnectionInformation connectInfo{ myClass, connectionSettings };
|
||||
|
||||
TerminalConnection::ITerminalConnection conn{ TerminalConnection::ConnectionInformation::CreateConnection(connectInfo) };
|
||||
Connection::ITerminalConnection conn{ Connection::ConnectionInformation::CreateConnection(connectInfo) };
|
||||
Control::TermControl control{ *settings, *settings, conn };
|
||||
|
||||
InProcContent().Children().Append(control);
|
||||
|
||||
@@ -115,8 +115,8 @@
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.TerminalConnection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
|
||||
<Reference Include="Microsoft.Terminal.Connection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.TerminalConnection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
|
||||
<Reference Include="Microsoft.Terminal.Connection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
|
||||
@@ -64,7 +64,7 @@ TRACELOGGING_DECLARE_PROVIDER(g_hSampleAppProvider);
|
||||
|
||||
#include <winrt/Microsoft.Terminal.Core.h>
|
||||
#include <winrt/Microsoft.Terminal.Control.h>
|
||||
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
||||
#include <winrt/Microsoft.Terminal.Connection.h>
|
||||
|
||||
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
||||
#include "til.h"
|
||||
|
||||
@@ -98,9 +98,9 @@
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.TerminalConnection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
|
||||
<Implementation>$(OpenConsoleCommonOutDir)TerminalConnection\TerminalConnection.dll</Implementation>
|
||||
<Reference Include="Microsoft.Terminal.Connection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.winmd</HintPath>
|
||||
<Implementation>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Connection\Microsoft.Terminal.Connection.dll</Implementation>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>true</Private>
|
||||
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
|
||||
@@ -201,13 +201,13 @@
|
||||
<!-- This is the same as the above VC libs hack, but for TerminalConnection.
|
||||
TerminalConnection depends on cpprest*.dll, and if we don't include it in
|
||||
the packaging output, we'll crash as soon as we try to load
|
||||
TerminalConnection.dll.
|
||||
Microsoft.Terminal.Connection.dll.
|
||||
|
||||
The Sample sln needs to do this manually - the real exe has a
|
||||
ProjectReference to TerminalConnection.vcxproj and can figure this out on
|
||||
its own. -->
|
||||
<ItemGroup>
|
||||
<_TerminalConnectionDlls Include="$(OpenConsoleCommonOutDir)\TerminalConnection\*.dll" />
|
||||
<_TerminalConnectionDlls Include="$(OpenConsoleCommonOutDir)\Microsoft.Terminal.Connection\*.dll" />
|
||||
|
||||
<PackagingOutputs Include="@(_TerminalConnectionDlls)">
|
||||
<ProjectName>$(ProjectName)</ProjectName>
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
<com:Class Id="051F34EE-C1FD-4B19-AF75-9BA54648434C"/>
|
||||
</com:ExeServer>
|
||||
<com:SurrogateServer DisplayName="WindowsTerminalShellExt">
|
||||
<com:Class Id="52065414-e077-47ec-a3ac-1cc5455e1b54" Path="WindowsTerminalShellExt.dll" ThreadingModel="STA"/>
|
||||
<com:Class Id="52065414-e077-47ec-a3ac-1cc5455e1b54" Path="Microsoft.Terminal.ShellExtension.dll" ThreadingModel="STA"/>
|
||||
</com:SurrogateServer>
|
||||
</com:ComServer>
|
||||
</com:Extension>
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
<com:Class Id="86633F1F-6454-40EC-89CE-DA4EBA977EE2"/>
|
||||
</com:ExeServer>
|
||||
<com:SurrogateServer DisplayName="WindowsTerminalShellExt">
|
||||
<com:Class Id="02db545a-3e20-46de-83a5-1329b1e88b6b" Path="WindowsTerminalShellExt.dll" ThreadingModel="STA"/>
|
||||
<com:Class Id="02db545a-3e20-46de-83a5-1329b1e88b6b" Path="Microsoft.Terminal.ShellExtension.dll" ThreadingModel="STA"/>
|
||||
</com:SurrogateServer>
|
||||
</com:ComServer>
|
||||
</com:Extension>
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
<com:Class Id="E12CFF52-A866-4C77-9A90-F570A7AA2C6B"/>
|
||||
</com:ExeServer>
|
||||
<com:SurrogateServer DisplayName="WindowsTerminalShellExt">
|
||||
<com:Class Id="9f156763-7844-4dc4-b2b1-901f640f5155" Path="WindowsTerminalShellExt.dll" ThreadingModel="STA"/>
|
||||
<com:Class Id="9f156763-7844-4dc4-b2b1-901f640f5155" Path="Microsoft.Terminal.ShellExtension.dll" ThreadingModel="STA"/>
|
||||
</com:SurrogateServer>
|
||||
</com:ComServer>
|
||||
</com:Extension>
|
||||
|
||||
@@ -16,12 +16,12 @@ using namespace WEX::TestExecution;
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace ::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace ::Microsoft::Terminal::App;
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
namespace appImpl = TerminalApp::implementation;
|
||||
namespace appImpl = Microsoft::Terminal::App::implementation;
|
||||
}
|
||||
|
||||
namespace TerminalAppLocalTests
|
||||
@@ -1571,7 +1571,7 @@ namespace TerminalAppLocalTests
|
||||
void CommandlineTest::TestSimpleExecuteCommandlineAction()
|
||||
{
|
||||
ExecuteCommandlineArgs args{ L"new-tab" };
|
||||
auto actions = winrt::TerminalApp::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
|
||||
auto actions = winrt::Microsoft::Terminal::App::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
|
||||
VERIFY_ARE_EQUAL(1u, actions.size());
|
||||
auto actionAndArgs = actions.at(0);
|
||||
VERIFY_ARE_EQUAL(ShortcutAction::NewTab, actionAndArgs.Action());
|
||||
@@ -1590,7 +1590,7 @@ namespace TerminalAppLocalTests
|
||||
void CommandlineTest::TestMultipleCommandExecuteCommandlineAction()
|
||||
{
|
||||
ExecuteCommandlineArgs args{ L"new-tab ; split-pane" };
|
||||
auto actions = winrt::TerminalApp::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
|
||||
auto actions = winrt::Microsoft::Terminal::App::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
|
||||
VERIFY_ARE_EQUAL(2u, actions.size());
|
||||
{
|
||||
auto actionAndArgs = actions.at(0);
|
||||
@@ -1626,7 +1626,7 @@ namespace TerminalAppLocalTests
|
||||
{
|
||||
// -H and -V cannot be combined.
|
||||
ExecuteCommandlineArgs args{ L"split-pane -H -V" };
|
||||
auto actions = winrt::TerminalApp::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
|
||||
auto actions = winrt::Microsoft::Terminal::App::implementation::TerminalPage::ConvertExecuteCommandlineToActions(args);
|
||||
VERIFY_ARE_EQUAL(0u, actions.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace TerminalAppLocalTests
|
||||
void FilteredCommandTests::VerifyHighlighting()
|
||||
{
|
||||
auto result = RunOnUIThread([]() {
|
||||
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
|
||||
const auto paletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
|
||||
{
|
||||
Log::Comment(L"Testing command name segmentation with no filter");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
auto segments = filteredCommand->_computeHighlightedName().Segments();
|
||||
VERIFY_ARE_EQUAL(segments.Size(), 1u);
|
||||
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"AAAAAABBBBBBCCC");
|
||||
@@ -42,7 +42,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing command name segmentation with empty filter");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"";
|
||||
auto segments = filteredCommand->_computeHighlightedName().Segments();
|
||||
VERIFY_ARE_EQUAL(segments.Size(), 1u);
|
||||
@@ -51,7 +51,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing command name segmentation with filter equals to the string");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"AAAAAABBBBBBCCC";
|
||||
auto segments = filteredCommand->_computeHighlightedName().Segments();
|
||||
VERIFY_ARE_EQUAL(segments.Size(), 1u);
|
||||
@@ -60,7 +60,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing command name segmentation with filter with first character matching");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"A";
|
||||
auto segments = filteredCommand->_computeHighlightedName().Segments();
|
||||
VERIFY_ARE_EQUAL(segments.Size(), 2u);
|
||||
@@ -71,7 +71,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing command name segmentation with filter with other case");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"a";
|
||||
auto segments = filteredCommand->_computeHighlightedName().Segments();
|
||||
VERIFY_ARE_EQUAL(segments.Size(), 2u);
|
||||
@@ -82,7 +82,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing command name segmentation with filter matching several characters");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"ab";
|
||||
auto segments = filteredCommand->_computeHighlightedName().Segments();
|
||||
VERIFY_ARE_EQUAL(segments.Size(), 4u);
|
||||
@@ -97,7 +97,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing command name segmentation with non matching filter");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"abcd";
|
||||
auto segments = filteredCommand->_computeHighlightedName().Segments();
|
||||
VERIFY_ARE_EQUAL(segments.Size(), 1u);
|
||||
@@ -112,17 +112,17 @@ namespace TerminalAppLocalTests
|
||||
void FilteredCommandTests::VerifyWeight()
|
||||
{
|
||||
auto result = RunOnUIThread([]() {
|
||||
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
|
||||
const auto paletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
|
||||
{
|
||||
Log::Comment(L"Testing weight of command with no filter");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
|
||||
auto weight = filteredCommand->_computeWeight();
|
||||
VERIFY_ARE_EQUAL(weight, 0);
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing weight of command with empty filter");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"";
|
||||
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
|
||||
auto weight = filteredCommand->_computeWeight();
|
||||
@@ -130,7 +130,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing weight of command with filter equals to the string");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"AAAAAABBBBBBCCC";
|
||||
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
|
||||
auto weight = filteredCommand->_computeWeight();
|
||||
@@ -138,7 +138,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing weight of command with filter with first character matching");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"A";
|
||||
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
|
||||
auto weight = filteredCommand->_computeWeight();
|
||||
@@ -146,7 +146,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing weight of command with filter with other case");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"a";
|
||||
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
|
||||
auto weight = filteredCommand->_computeWeight();
|
||||
@@ -154,7 +154,7 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing weight of command with filter matching several characters");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"ab";
|
||||
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
|
||||
auto weight = filteredCommand->_computeWeight();
|
||||
@@ -168,45 +168,45 @@ namespace TerminalAppLocalTests
|
||||
void FilteredCommandTests::VerifyCompare()
|
||||
{
|
||||
auto result = RunOnUIThread([]() {
|
||||
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
|
||||
const auto paletteItem2{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"BBBBBCCC") };
|
||||
const auto paletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
|
||||
const auto paletteItem2{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"BBBBBCCC") };
|
||||
{
|
||||
Log::Comment(L"Testing comparison of commands with no filter");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand2 = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem2);
|
||||
|
||||
VERIFY_ARE_EQUAL(filteredCommand->Weight(), filteredCommand2->Weight());
|
||||
VERIFY_IS_TRUE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
|
||||
VERIFY_IS_TRUE(winrt::Microsoft::Terminal::App::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing comparison of commands with empty filter");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"";
|
||||
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
|
||||
filteredCommand->_Weight = filteredCommand->_computeWeight();
|
||||
|
||||
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
|
||||
const auto filteredCommand2 = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem2);
|
||||
filteredCommand2->_Filter = L"";
|
||||
filteredCommand2->_HighlightedName = filteredCommand2->_computeHighlightedName();
|
||||
filteredCommand2->_Weight = filteredCommand2->_computeWeight();
|
||||
|
||||
VERIFY_ARE_EQUAL(filteredCommand->Weight(), filteredCommand2->Weight());
|
||||
VERIFY_IS_TRUE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
|
||||
VERIFY_IS_TRUE(winrt::Microsoft::Terminal::App::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
|
||||
}
|
||||
{
|
||||
Log::Comment(L"Testing comparison of commands with different weights");
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
filteredCommand->_Filter = L"B";
|
||||
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
|
||||
filteredCommand->_Weight = filteredCommand->_computeWeight();
|
||||
|
||||
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
|
||||
const auto filteredCommand2 = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem2);
|
||||
filteredCommand2->_Filter = L"B";
|
||||
filteredCommand2->_HighlightedName = filteredCommand2->_computeHighlightedName();
|
||||
filteredCommand2->_Weight = filteredCommand2->_computeWeight();
|
||||
|
||||
VERIFY_IS_TRUE(filteredCommand->Weight() < filteredCommand2->Weight()); // Second command gets more points due to the beginning of the word
|
||||
VERIFY_IS_FALSE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
|
||||
VERIFY_IS_FALSE(winrt::Microsoft::Terminal::App::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -216,14 +216,14 @@ namespace TerminalAppLocalTests
|
||||
void FilteredCommandTests::VerifyCompareIgnoreCase()
|
||||
{
|
||||
auto result = RunOnUIThread([]() {
|
||||
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"a") };
|
||||
const auto paletteItem2{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"B") };
|
||||
const auto paletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"a") };
|
||||
const auto paletteItem2{ winrt::make<winrt::Microsoft::Terminal::App::implementation::CommandLinePaletteItem>(L"B") };
|
||||
{
|
||||
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
|
||||
const auto filteredCommand = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem);
|
||||
const auto filteredCommand2 = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::FilteredCommand>(paletteItem2);
|
||||
|
||||
VERIFY_ARE_EQUAL(filteredCommand->Weight(), filteredCommand2->Weight());
|
||||
VERIFY_IS_TRUE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
|
||||
VERIFY_IS_TRUE(winrt::Microsoft::Terminal::App::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using namespace Microsoft::Console;
|
||||
using namespace WEX::Logging;
|
||||
using namespace WEX::TestExecution;
|
||||
using namespace WEX::Common;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
|
||||
}
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
@@ -287,7 +287,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
|
||||
}
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
@@ -412,7 +412,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
|
||||
}
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
@@ -527,7 +527,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
@@ -621,7 +621,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
@@ -744,7 +744,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
@@ -880,7 +880,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
@@ -982,7 +982,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
|
||||
@@ -1205,7 +1205,7 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(L"${scheme.name}", realArgs.TerminalArgs().Profile());
|
||||
}
|
||||
|
||||
auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
auto expandedCommands = winrt::Microsoft::Terminal::App::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
|
||||
_logCommandNames(expandedCommands.GetView());
|
||||
|
||||
VERIFY_ARE_EQUAL(3u, expandedCommands.Size());
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#include "CppWinrtTailored.h"
|
||||
|
||||
using namespace Microsoft::Console;
|
||||
using namespace TerminalApp;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace Microsoft::Terminal::App;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
using namespace WEX::Logging;
|
||||
@@ -107,9 +107,9 @@ namespace TerminalAppLocalTests
|
||||
}
|
||||
|
||||
private:
|
||||
void _initializeTerminalPage(winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage>& page,
|
||||
void _initializeTerminalPage(winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage>& page,
|
||||
CascadiaSettings initialSettings);
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> _commonSetup();
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> _commonSetup();
|
||||
};
|
||||
|
||||
template<typename TFunction>
|
||||
@@ -139,7 +139,7 @@ namespace TerminalAppLocalTests
|
||||
{
|
||||
// Verify we can create a WinRT type we authored
|
||||
// Just creating it is enough to know that everything is working.
|
||||
winrt::Microsoft::Terminal::TerminalConnection::EchoConnection conn{};
|
||||
winrt::Microsoft::Terminal::Connection::EchoConnection conn{};
|
||||
VERIFY_IS_NOT_NULL(conn);
|
||||
// We're doing this test separately from the TryCreateSettingsType test,
|
||||
// to ensure both dependent binaries (TerminalSettings and
|
||||
@@ -170,10 +170,10 @@ namespace TerminalAppLocalTests
|
||||
|
||||
void TabTests::CreateSimpleTerminalXamlType()
|
||||
{
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::MinMaxCloseControl> mmcc{ nullptr };
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::MinMaxCloseControl> mmcc{ nullptr };
|
||||
|
||||
auto result = RunOnUIThread([&mmcc]() {
|
||||
mmcc = winrt::make_self<winrt::TerminalApp::implementation::MinMaxCloseControl>();
|
||||
mmcc = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::MinMaxCloseControl>();
|
||||
VERIFY_IS_NOT_NULL(mmcc);
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -181,10 +181,10 @@ namespace TerminalAppLocalTests
|
||||
|
||||
void TabTests::CreateTerminalMuxXamlType()
|
||||
{
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TabRowControl> tabRowControl{ nullptr };
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TabRowControl> tabRowControl{ nullptr };
|
||||
|
||||
auto result = RunOnUIThread([&tabRowControl]() {
|
||||
tabRowControl = winrt::make_self<winrt::TerminalApp::implementation::TabRowControl>();
|
||||
tabRowControl = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::TabRowControl>();
|
||||
VERIFY_IS_NOT_NULL(tabRowControl);
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -192,10 +192,10 @@ namespace TerminalAppLocalTests
|
||||
|
||||
void TabTests::CreateTerminalPage()
|
||||
{
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
|
||||
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
page = winrt::make_self<winrt::TerminalApp::implementation::TerminalPage>();
|
||||
page = winrt::make_self<winrt::Microsoft::Terminal::App::implementation::TerminalPage>();
|
||||
VERIFY_IS_NOT_NULL(page);
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -226,7 +226,7 @@ namespace TerminalAppLocalTests
|
||||
// - initialSettings: a CascadiaSettings to initialize the TerminalPage with.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TabTests::_initializeTerminalPage(winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage>& page,
|
||||
void TabTests::_initializeTerminalPage(winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage>& page,
|
||||
CascadiaSettings initialSettings)
|
||||
{
|
||||
// This is super wacky, but we can't just initialize the
|
||||
@@ -237,12 +237,12 @@ namespace TerminalAppLocalTests
|
||||
// Instead, create the winrt object, then get a com_ptr to the
|
||||
// implementation _from_ the winrt object. This seems to work, even if
|
||||
// it's weird.
|
||||
winrt::TerminalApp::TerminalPage projectedPage{ nullptr };
|
||||
winrt::Microsoft::Terminal::App::TerminalPage projectedPage{ nullptr };
|
||||
|
||||
Log::Comment(NoThrowString().Format(L"Construct the TerminalPage"));
|
||||
auto result = RunOnUIThread([&projectedPage, &page, initialSettings]() {
|
||||
projectedPage = winrt::TerminalApp::TerminalPage();
|
||||
page.copy_from(winrt::get_self<winrt::TerminalApp::implementation::TerminalPage>(projectedPage));
|
||||
projectedPage = winrt::Microsoft::Terminal::App::TerminalPage();
|
||||
page.copy_from(winrt::get_self<winrt::Microsoft::Terminal::App::implementation::TerminalPage>(projectedPage));
|
||||
page->_settings = initialSettings;
|
||||
});
|
||||
VERIFY_SUCCEEDED(result);
|
||||
@@ -278,7 +278,7 @@ namespace TerminalAppLocalTests
|
||||
|
||||
auto app = ::winrt::Windows::UI::Xaml::Application::Current();
|
||||
|
||||
winrt::TerminalApp::TerminalPage pp = *page;
|
||||
winrt::Microsoft::Terminal::App::TerminalPage pp = *page;
|
||||
winrt::Windows::UI::Xaml::Window::Current().Content(pp);
|
||||
winrt::Windows::UI::Xaml::Window::Current().Activate();
|
||||
});
|
||||
@@ -334,7 +334,7 @@ namespace TerminalAppLocalTests
|
||||
// Instead, create the winrt object, then get a com_ptr to the
|
||||
// implementation _from_ the winrt object. This seems to work, even if
|
||||
// it's weird.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
|
||||
_initializeTerminalPage(page, settings0);
|
||||
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
@@ -399,7 +399,7 @@ namespace TerminalAppLocalTests
|
||||
// Instead, create the winrt object, then get a com_ptr to the
|
||||
// implementation _from_ the winrt object. This seems to work, even if
|
||||
// it's weird.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
|
||||
_initializeTerminalPage(page, settings0);
|
||||
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
@@ -486,7 +486,7 @@ namespace TerminalAppLocalTests
|
||||
// Instead, create the winrt object, then get a com_ptr to the
|
||||
// implementation _from_ the winrt object. This seems to work, even if
|
||||
// it's weird.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
|
||||
_initializeTerminalPage(page, settings0);
|
||||
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
@@ -551,7 +551,7 @@ namespace TerminalAppLocalTests
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - The initialized TerminalPage, ready to use.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> TabTests::_commonSetup()
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> TabTests::_commonSetup()
|
||||
{
|
||||
static constexpr std::wstring_view settingsJson0{ LR"(
|
||||
{
|
||||
@@ -668,7 +668,7 @@ namespace TerminalAppLocalTests
|
||||
// Instead, create the winrt object, then get a com_ptr to the
|
||||
// implementation _from_ the winrt object. This seems to work, even if
|
||||
// it's weird.
|
||||
winrt::com_ptr<winrt::TerminalApp::implementation::TerminalPage> page{ nullptr };
|
||||
winrt::com_ptr<winrt::Microsoft::Terminal::App::implementation::TerminalPage> page{ nullptr };
|
||||
_initializeTerminalPage(page, settings0);
|
||||
|
||||
auto result = RunOnUIThread([&page]() {
|
||||
@@ -1225,9 +1225,9 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(L"a", page->_mruTabs.GetAt(3).Title());
|
||||
});
|
||||
|
||||
const auto palette = winrt::get_self<winrt::TerminalApp::implementation::CommandPalette>(page->CommandPalette());
|
||||
const auto palette = winrt::get_self<winrt::Microsoft::Terminal::App::implementation::CommandPalette>(page->CommandPalette());
|
||||
|
||||
VERIFY_ARE_EQUAL(winrt::TerminalApp::implementation::CommandPaletteMode::TabSwitchMode, palette->_currentMode, L"Verify we are in the tab switcher mode");
|
||||
VERIFY_ARE_EQUAL(winrt::Microsoft::Terminal::App::implementation::CommandPaletteMode::TabSwitchMode, palette->_currentMode, L"Verify we are in the tab switcher mode");
|
||||
// At this point, the contents of the command palette's _mruTabs list is
|
||||
// still the _old_ ordering (d, c, b, a). The ordering is only updated
|
||||
// in TerminalPage::_SelectNextTab, but as we saw before, the palette
|
||||
@@ -1242,7 +1242,7 @@ namespace TerminalAppLocalTests
|
||||
END_TEST_METHOD_PROPERTIES()
|
||||
|
||||
auto page = _commonSetup();
|
||||
page->RenameWindowRequested([&page](auto&&, const winrt::TerminalApp::RenameWindowRequestedArgs args) {
|
||||
page->RenameWindowRequested([&page](auto&&, const winrt::Microsoft::Terminal::App::RenameWindowRequestedArgs args) {
|
||||
// In the real terminal, this would bounce up to the monarch and
|
||||
// come back down. Instead, immediately call back and set the name.
|
||||
page->WindowName(args.ProposedName());
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
rules instead.
|
||||
-->
|
||||
<ItemGroup>
|
||||
<TerminalConnectionDlls Include="$(OpenConsoleCommonOutDir)\TerminalConnection\*.dll"/>
|
||||
<TerminalConnectionDlls Include="$(OpenConsoleCommonOutDir)\Microsoft.Terminal.Connection\*.dll"/>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Copy the AppxManifest.xml to another file, because when TAEF is
|
||||
|
||||
@@ -55,7 +55,7 @@ Author(s):
|
||||
|
||||
#include <winrt/windows.applicationmodel.core.h>
|
||||
|
||||
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
||||
#include <winrt/Microsoft.Terminal.Connection.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Model.h>
|
||||
|
||||
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||
|
||||
// You can emulate the monarch dying by: starting a terminal, sticking a
|
||||
// breakpoint in
|
||||
// TerminalApp!winrt::TerminalApp::implementation::AppLogic::_doFindTargetWindow,
|
||||
// Microsoft.Terminal.App!winrt::Microsoft::Terminal::App::implementation::AppLogic::_doFindTargetWindow,
|
||||
// starting a defterm, and when that BP gets hit, kill the original
|
||||
// monarch, and see what happens here.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{f2ed628a-db22-446f-a081-4cc845b51a2b}</ProjectGuid>
|
||||
<ProjectName>WindowsTerminalShellExt</ProjectName>
|
||||
<ProjectName>Microsoft.Terminal.ShellExtension</ProjectName>
|
||||
<RootNamespace>Microsoft.Terminal.ShellExtension</RootNamespace>
|
||||
<!-- cppwinrt.build.pre.props depends on these settings: -->
|
||||
<!-- build a dll, not exe (Application) -->
|
||||
|
||||
@@ -34,4 +34,4 @@ DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*)
|
||||
}
|
||||
|
||||
// Usurp the TerminalApp's Context Menu specific resource group.
|
||||
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"TerminalApp/ContextMenu")
|
||||
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"Microsoft.Terminal.App/ContextMenu")
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "ActionPaletteItem.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::System;
|
||||
@@ -16,7 +16,7 @@ using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
ActionPaletteItem::ActionPaletteItem(const Microsoft::Terminal::Settings::Model::Command& command) :
|
||||
_Command(command)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "PaletteItem.h"
|
||||
#include "ActionPaletteItem.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct ActionPaletteItem : ActionPaletteItemT<ActionPaletteItem, PaletteItem>
|
||||
{
|
||||
@@ -20,7 +20,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(ActionPaletteItem);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import "PaletteItem.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass ActionPaletteItem : PaletteItem
|
||||
{
|
||||
|
||||
@@ -18,9 +18,9 @@ using namespace winrt::Windows::ApplicationModel::DataTransfer;
|
||||
using namespace winrt::Windows::UI::Text;
|
||||
using namespace winrt::Microsoft::Terminal;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
using namespace winrt::Microsoft::Terminal::TerminalConnection;
|
||||
using namespace winrt::Microsoft::Terminal::Connection;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace ::TerminalApp;
|
||||
using namespace ::Microsoft::Terminal::App;
|
||||
using namespace ::Microsoft::Console;
|
||||
using namespace std::chrono_literals;
|
||||
namespace winrt
|
||||
@@ -30,7 +30,7 @@ namespace winrt
|
||||
using IInspectable = Windows::Foundation::IInspectable;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// Method Description:
|
||||
// - Stop previewing the currently previewed action. We can use this to
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
template<typename D, typename... I>
|
||||
struct App_baseWithProvider : public App_base<D, ::winrt::Windows::UI::Xaml::Markup::IXamlMetadataProvider>
|
||||
@@ -24,7 +24,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
private:
|
||||
bool _contentLoaded{ false };
|
||||
winrt::TerminalApp::XamlMetaDataProvider _appProvider;
|
||||
winrt::Microsoft::Terminal::App::XamlMetaDataProvider _appProvider;
|
||||
};
|
||||
|
||||
template<typename D, typename... I>
|
||||
|
||||
@@ -14,7 +14,7 @@ using namespace winrt::Windows::UI::Xaml::Navigation;
|
||||
|
||||
namespace xaml = ::winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
App::App()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "App.base.h"
|
||||
#include <winrt/Windows.UI.Xaml.Hosting.h>
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct App : AppT2<App>
|
||||
{
|
||||
@@ -16,7 +16,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void OnLaunched(const Windows::ApplicationModel::Activation::LaunchActivatedEventArgs&);
|
||||
void Initialize();
|
||||
|
||||
TerminalApp::AppLogic Logic();
|
||||
Microsoft::Terminal::App::AppLogic Logic();
|
||||
|
||||
void Close();
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
struct App : AppT<App, implementation::App>
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import "AppLogic.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
// ADD ARBITRARY APP LOGIC TO AppLogic.idl, NOT HERE.
|
||||
// This is for XAML platform setup only.
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information.
|
||||
-->
|
||||
<Application x:Class="TerminalApp.App"
|
||||
<Application x:Class="Microsoft.Terminal.App.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:TA="using:TerminalApp"
|
||||
xmlns:TA="using:Microsoft.Terminal.App"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:local="using:Microsoft.Terminal.App"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
<!--
|
||||
|
||||
@@ -18,8 +18,8 @@ using namespace winrt::Windows::System;
|
||||
using namespace winrt::Microsoft::Terminal;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
using namespace winrt::Microsoft::Terminal::TerminalConnection;
|
||||
using namespace ::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::Connection;
|
||||
using namespace ::Microsoft::Terminal::App;
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
@@ -27,7 +27,7 @@ namespace winrt
|
||||
using IInspectable = Windows::Foundation::IInspectable;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
void TerminalPage::_HandleOpenNewTabDropdown(const IInspectable& /*sender*/,
|
||||
const ActionEventArgs& args)
|
||||
@@ -721,7 +721,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
// Since _RemoveTabs is asynchronous, create a snapshot of the tabs we want to remove
|
||||
std::vector<winrt::TerminalApp::TabBase> tabsToRemove;
|
||||
std::vector<winrt::Microsoft::Terminal::App::TabBase> tabsToRemove;
|
||||
if (index > 0)
|
||||
{
|
||||
std::copy(begin(_tabs), begin(_tabs) + index, std::back_inserter(tabsToRemove));
|
||||
@@ -760,7 +760,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
// Since _RemoveTabs is asynchronous, create a snapshot of the tabs we want to remove
|
||||
std::vector<winrt::TerminalApp::TabBase> tabsToRemove;
|
||||
std::vector<winrt::Microsoft::Terminal::App::TabBase> tabsToRemove;
|
||||
std::copy(begin(_tabs) + index + 1, end(_tabs), std::back_inserter(tabsToRemove));
|
||||
_RemoveTabs(tabsToRemove);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <LibraryResources.h>
|
||||
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace TerminalApp;
|
||||
using namespace Microsoft::Terminal::App;
|
||||
|
||||
// Either a ; at the start of a line, or a ; preceded by any non-\ char.
|
||||
const std::wregex AppCommandlineArgs::_commandDelimiterRegex{ LR"(^;|[^\\];)" };
|
||||
@@ -980,7 +980,7 @@ int AppCommandlineArgs::ParseArgs(winrt::array_view<const winrt::hstring>& args)
|
||||
}
|
||||
}
|
||||
|
||||
auto commands = ::TerminalApp::AppCommandlineArgs::BuildCommands(args);
|
||||
auto commands = ::Microsoft::Terminal::App::AppCommandlineArgs::BuildCommands(args);
|
||||
|
||||
for (auto& cmdBlob : commands)
|
||||
{
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace TerminalAppLocalTests
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft::Terminal::App
|
||||
{
|
||||
class AppCommandlineArgs;
|
||||
};
|
||||
|
||||
class TerminalApp::AppCommandlineArgs final
|
||||
class Microsoft::Terminal::App::AppCommandlineArgs final
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view NixHelpFlag{ "-?" };
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#include "AppKeyBindings.g.cpp"
|
||||
|
||||
using namespace winrt::Microsoft::Terminal;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
bool AppKeyBindings::TryKeyChord(const KeyChord& kc)
|
||||
{
|
||||
@@ -26,7 +26,7 @@ namespace winrt::TerminalApp::implementation
|
||||
return _actionMap.IsKeyChordExplicitlyUnbound(kc);
|
||||
}
|
||||
|
||||
void AppKeyBindings::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
|
||||
void AppKeyBindings::SetDispatch(const winrt::Microsoft::Terminal::App::ShortcutActionDispatch& dispatch)
|
||||
{
|
||||
_dispatch = dispatch;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TerminalAppLocalTests
|
||||
class SettingsTests;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct AppKeyBindings : AppKeyBindingsT<AppKeyBindings>
|
||||
{
|
||||
@@ -21,19 +21,19 @@ namespace winrt::TerminalApp::implementation
|
||||
bool TryKeyChord(const winrt::Microsoft::Terminal::Control::KeyChord& kc);
|
||||
bool IsKeyChordExplicitlyUnbound(const winrt::Microsoft::Terminal::Control::KeyChord& kc);
|
||||
|
||||
void SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch);
|
||||
void SetDispatch(const winrt::Microsoft::Terminal::App::ShortcutActionDispatch& dispatch);
|
||||
void SetActionMap(const Microsoft::Terminal::Settings::Model::IActionMapView& actionMap);
|
||||
|
||||
private:
|
||||
winrt::Microsoft::Terminal::Settings::Model::IActionMapView _actionMap{ nullptr };
|
||||
|
||||
winrt::TerminalApp::ShortcutActionDispatch _dispatch{ nullptr };
|
||||
winrt::Microsoft::Terminal::App::ShortcutActionDispatch _dispatch{ nullptr };
|
||||
|
||||
friend class TerminalAppLocalTests::SettingsTests;
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(AppKeyBindings);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
import "ShortcutActionDispatch.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass AppKeyBindings : Microsoft.Terminal.Control.IKeyBindings
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ using namespace winrt::Windows::System;
|
||||
using namespace winrt::Microsoft::Terminal;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace ::TerminalApp;
|
||||
using namespace ::Microsoft::Terminal::App;
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
@@ -135,7 +135,7 @@ static Documents::Run _BuildErrorRun(const winrt::hstring& text, const ResourceD
|
||||
return textRun;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// Function Description:
|
||||
// - Get the AppLogic for the current active Xaml application, or null if there isn't one.
|
||||
@@ -145,7 +145,7 @@ namespace winrt::TerminalApp::implementation
|
||||
AppLogic* AppLogic::Current() noexcept
|
||||
try
|
||||
{
|
||||
if (auto currentXamlApp{ winrt::Windows::UI::Xaml::Application::Current().try_as<winrt::TerminalApp::App>() })
|
||||
if (auto currentXamlApp{ winrt::Windows::UI::Xaml::Application::Current().try_as<winrt::Microsoft::Terminal::App::App>() })
|
||||
{
|
||||
if (auto appLogicPointer{ winrt::get_self<AppLogic>(currentXamlApp.Logic()) })
|
||||
{
|
||||
@@ -169,7 +169,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - HR E_INVALIDARG if the app isn't up and running.
|
||||
const CascadiaSettings AppLogic::CurrentAppSettings()
|
||||
{
|
||||
auto appLogic{ ::winrt::TerminalApp::implementation::AppLogic::Current() };
|
||||
auto appLogic{ ::winrt::Microsoft::Terminal::App::implementation::AppLogic::Current() };
|
||||
THROW_HR_IF_NULL(E_INVALIDARG, appLogic);
|
||||
return appLogic->GetSettings();
|
||||
}
|
||||
@@ -463,7 +463,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (!_settingsLoadExceptionText.empty())
|
||||
{
|
||||
warningsTextBlock.Inlines().Append(_BuildErrorRun(_settingsLoadExceptionText, ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::TerminalApp::App>().Resources()));
|
||||
warningsTextBlock.Inlines().Append(_BuildErrorRun(_settingsLoadExceptionText, ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::Microsoft::Terminal::App::App>().Resources()));
|
||||
warningsTextBlock.Inlines().Append(Documents::LineBreak{});
|
||||
}
|
||||
}
|
||||
@@ -507,7 +507,7 @@ namespace winrt::TerminalApp::implementation
|
||||
const auto warningText = _GetWarningText(warning);
|
||||
if (!warningText.empty())
|
||||
{
|
||||
warningsTextBlock.Inlines().Append(_BuildErrorRun(warningText, ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::TerminalApp::App>().Resources()));
|
||||
warningsTextBlock.Inlines().Append(_BuildErrorRun(warningText, ::winrt::Windows::UI::Xaml::Application::Current().as<::winrt::Microsoft::Terminal::App::App>().Resources()));
|
||||
warningsTextBlock.Inlines().Append(Documents::LineBreak{});
|
||||
}
|
||||
}
|
||||
@@ -726,7 +726,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - defaultInitialY: the system default y coordinate value
|
||||
// Return Value:
|
||||
// - a point containing the requested initial position in pixels.
|
||||
TerminalApp::InitialPosition AppLogic::GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY)
|
||||
Microsoft::Terminal::App::InitialPosition AppLogic::GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY)
|
||||
{
|
||||
if (!_loadedInitialSettings)
|
||||
{
|
||||
@@ -1223,7 +1223,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
winrt::TerminalApp::TaskbarState AppLogic::TaskbarState()
|
||||
winrt::Microsoft::Terminal::App::TaskbarState AppLogic::TaskbarState()
|
||||
{
|
||||
if (_root)
|
||||
{
|
||||
@@ -1330,7 +1330,7 @@ namespace winrt::TerminalApp::implementation
|
||||
int32_t AppLogic::ExecuteCommandline(array_view<const winrt::hstring> args,
|
||||
const winrt::hstring& cwd)
|
||||
{
|
||||
::TerminalApp::AppCommandlineArgs appArgs;
|
||||
::Microsoft::Terminal::App::AppCommandlineArgs appArgs;
|
||||
auto result = appArgs.ParseArgs(args);
|
||||
if (result == 0)
|
||||
{
|
||||
@@ -1365,7 +1365,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - WindowingBehaviorUseAnyExisting: We should handle the args "in the current
|
||||
// window ON ANY DESKTOP"
|
||||
// - anything else: We should handle the commandline in the window with the given ID.
|
||||
TerminalApp::FindTargetWindowResult AppLogic::FindTargetWindow(array_view<const winrt::hstring> args)
|
||||
Microsoft::Terminal::App::FindTargetWindowResult AppLogic::FindTargetWindow(array_view<const winrt::hstring> args)
|
||||
{
|
||||
if (!_loadedInitialSettings)
|
||||
{
|
||||
@@ -1377,10 +1377,10 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
// The main body of this function is a static helper, to facilitate unit-testing
|
||||
TerminalApp::FindTargetWindowResult AppLogic::_doFindTargetWindow(array_view<const winrt::hstring> args,
|
||||
Microsoft::Terminal::App::FindTargetWindowResult AppLogic::_doFindTargetWindow(array_view<const winrt::hstring> args,
|
||||
const Microsoft::Terminal::Settings::Model::WindowingMode& windowingBehavior)
|
||||
{
|
||||
::TerminalApp::AppCommandlineArgs appArgs;
|
||||
::Microsoft::Terminal::App::AppCommandlineArgs appArgs;
|
||||
const auto result = appArgs.ParseArgs(args);
|
||||
if (result == 0)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace TerminalAppLocalTests
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct FindTargetWindowResult : FindTargetWindowResultT<FindTargetWindowResult>
|
||||
{
|
||||
@@ -72,7 +72,7 @@ namespace winrt::TerminalApp::implementation
|
||||
bool HasSettingsStartupActions() const noexcept;
|
||||
int32_t SetStartupCommandline(array_view<const winrt::hstring> actions);
|
||||
int32_t ExecuteCommandline(array_view<const winrt::hstring> actions, const winrt::hstring& cwd);
|
||||
TerminalApp::FindTargetWindowResult FindTargetWindow(array_view<const winrt::hstring> actions);
|
||||
Microsoft::Terminal::App::FindTargetWindowResult FindTargetWindow(array_view<const winrt::hstring> actions);
|
||||
winrt::hstring ParseCommandlineMessage();
|
||||
bool ShouldExitEarly();
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
Windows::Foundation::Size GetLaunchDimensions(uint32_t dpi);
|
||||
bool CenterOnLaunch();
|
||||
TerminalApp::InitialPosition GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY);
|
||||
Microsoft::Terminal::App::InitialPosition GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY);
|
||||
winrt::Windows::UI::Xaml::ElementTheme GetRequestedTheme();
|
||||
Microsoft::Terminal::Settings::Model::LaunchMode GetLaunchMode();
|
||||
bool GetShowTabsInTitlebar();
|
||||
@@ -118,7 +118,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void CloseWindow(Microsoft::Terminal::Settings::Model::LaunchPosition position);
|
||||
void WindowVisibilityChanged(const bool showOrHide);
|
||||
|
||||
winrt::TerminalApp::TaskbarState TaskbarState();
|
||||
winrt::Microsoft::Terminal::App::TaskbarState TaskbarState();
|
||||
winrt::Windows::UI::Xaml::Media::Brush TitlebarBrush();
|
||||
void WindowActivated(const bool activated);
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
TYPED_EVENT(RequestedThemeChanged, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Settings::Model::Theme);
|
||||
TYPED_EVENT(SettingsChanged, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
|
||||
TYPED_EVENT(SystemMenuChangeRequested, winrt::Windows::Foundation::IInspectable, winrt::TerminalApp::SystemMenuChangeArgs);
|
||||
TYPED_EVENT(SystemMenuChangeRequested, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::App::SystemMenuChangeArgs);
|
||||
|
||||
private:
|
||||
bool _isUwp{ false };
|
||||
@@ -168,8 +168,8 @@ namespace winrt::TerminalApp::implementation
|
||||
std::shared_mutex _dialogLock;
|
||||
winrt::Windows::UI::Xaml::Controls::ContentDialog _dialog;
|
||||
|
||||
::TerminalApp::AppCommandlineArgs _appArgs;
|
||||
::TerminalApp::AppCommandlineArgs _settingsAppArgs;
|
||||
::Microsoft::Terminal::App::AppCommandlineArgs _appArgs;
|
||||
::Microsoft::Terminal::App::AppCommandlineArgs _settingsAppArgs;
|
||||
|
||||
std::shared_ptr<ThrottledFuncTrailing<>> _reloadSettings;
|
||||
til::throttled_func_trailing<> _reloadState;
|
||||
@@ -179,7 +179,7 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::com_ptr<LanguageProfileNotifier> _languageProfileNotifier;
|
||||
wil::unique_folder_change_reader_nothrow _reader;
|
||||
|
||||
static TerminalApp::FindTargetWindowResult _doFindTargetWindow(winrt::array_view<const hstring> args,
|
||||
static Microsoft::Terminal::App::FindTargetWindowResult _doFindTargetWindow(winrt::array_view<const hstring> args,
|
||||
const Microsoft::Terminal::Settings::Model::WindowingMode& windowingBehavior);
|
||||
|
||||
void _ShowLoadErrorsDialog(const winrt::hstring& titleKey, const winrt::hstring& contentKey, HRESULT settingsLoadedResult);
|
||||
@@ -207,7 +207,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// directly to them.
|
||||
FORWARDED_TYPED_EVENT(SetTitleBarContent, winrt::Windows::Foundation::IInspectable, winrt::Windows::UI::Xaml::UIElement, _root, SetTitleBarContent);
|
||||
FORWARDED_TYPED_EVENT(TitleChanged, winrt::Windows::Foundation::IInspectable, winrt::hstring, _root, TitleChanged);
|
||||
FORWARDED_TYPED_EVENT(LastTabClosed, winrt::Windows::Foundation::IInspectable, winrt::TerminalApp::LastTabClosedEventArgs, _root, LastTabClosed);
|
||||
FORWARDED_TYPED_EVENT(LastTabClosed, winrt::Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::App::LastTabClosedEventArgs, _root, LastTabClosed);
|
||||
FORWARDED_TYPED_EVENT(FocusModeChanged, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, FocusModeChanged);
|
||||
FORWARDED_TYPED_EVENT(FullscreenChanged, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, FullscreenChanged);
|
||||
FORWARDED_TYPED_EVENT(ChangeMaximizeRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, ChangeMaximizeRequested);
|
||||
@@ -215,7 +215,7 @@ namespace winrt::TerminalApp::implementation
|
||||
FORWARDED_TYPED_EVENT(RaiseVisualBell, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, RaiseVisualBell);
|
||||
FORWARDED_TYPED_EVENT(SetTaskbarProgress, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, SetTaskbarProgress);
|
||||
FORWARDED_TYPED_EVENT(IdentifyWindowsRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, IdentifyWindowsRequested);
|
||||
FORWARDED_TYPED_EVENT(RenameWindowRequested, Windows::Foundation::IInspectable, winrt::TerminalApp::RenameWindowRequestedArgs, _root, RenameWindowRequested);
|
||||
FORWARDED_TYPED_EVENT(RenameWindowRequested, Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::App::RenameWindowRequestedArgs, _root, RenameWindowRequested);
|
||||
FORWARDED_TYPED_EVENT(IsQuakeWindowChanged, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, IsQuakeWindowChanged);
|
||||
FORWARDED_TYPED_EVENT(SummonWindowRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, SummonWindowRequested);
|
||||
FORWARDED_TYPED_EVENT(CloseRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, CloseRequested);
|
||||
@@ -229,7 +229,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(AppLogic);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import "TerminalPage.idl";
|
||||
import "ShortcutActionDispatch.idl";
|
||||
import "IDirectKeyListener.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
struct InitialPosition
|
||||
{
|
||||
@@ -137,7 +137,7 @@ namespace TerminalApp
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> CloseRequested;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> OpenSystemMenu;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Object> QuitRequested;
|
||||
event Windows.Foundation.TypedEventHandler<Object, TerminalApp.SystemMenuChangeArgs> SystemMenuChangeRequested;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.App.SystemMenuChangeArgs> SystemMenuChangeRequested;
|
||||
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.Control.ShowWindowArgs> ShowWindowChanged;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "ColorHelper.h"
|
||||
#include <limits>
|
||||
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
|
||||
// Method Description:
|
||||
// Determines whether or not a given color is light
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <winrt/windows.ui.core.h>
|
||||
|
||||
namespace winrt::TerminalApp
|
||||
namespace winrt::Microsoft::Terminal::App
|
||||
{
|
||||
class HSL
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "winrt/Windows.UI.Xaml.Interop.h"
|
||||
#include <LibraryResources.h>
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// Method Description:
|
||||
// - Default constructor, localizes the buttons and hooks
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "ColorPickupFlyout.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct ColorPickupFlyout : ColorPickupFlyoutT<ColorPickupFlyout>
|
||||
{
|
||||
@@ -13,12 +13,12 @@ namespace winrt::TerminalApp::implementation
|
||||
void ClearColorButton_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& args);
|
||||
void ColorPicker_ColorChanged(const Microsoft::UI::Xaml::Controls::ColorPicker&, const Microsoft::UI::Xaml::Controls::ColorChangedEventArgs& args);
|
||||
|
||||
WINRT_CALLBACK(ColorCleared, TerminalApp::ColorClearedArgs);
|
||||
WINRT_CALLBACK(ColorSelected, TerminalApp::ColorSelectedArgs);
|
||||
WINRT_CALLBACK(ColorCleared, Microsoft::Terminal::App::ColorClearedArgs);
|
||||
WINRT_CALLBACK(ColorSelected, Microsoft::Terminal::App::ColorSelectedArgs);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(ColorPickupFlyout);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
delegate void ColorSelectedArgs(Windows.UI.Color color);
|
||||
delegate void ColorClearedArgs();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Flyout x:Class="TerminalApp.ColorPickupFlyout"
|
||||
<Flyout x:Class="Microsoft.Terminal.App.ColorPickupFlyout"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:local="using:Microsoft.Terminal.App"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
Placement="Bottom"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "CommandLinePaletteItem.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::System;
|
||||
@@ -16,7 +16,7 @@ using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
CommandLinePaletteItem::CommandLinePaletteItem(const winrt::hstring& commandLine) :
|
||||
_CommandLine(commandLine)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "PaletteItem.h"
|
||||
#include "CommandLinePaletteItem.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct CommandLinePaletteItem : CommandLinePaletteItemT<CommandLinePaletteItem, PaletteItem>
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(CommandLinePaletteItem);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import "PaletteItem.idl";
|
||||
import "TabBase.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass CommandLinePaletteItem : PaletteItem
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "CommandPalette.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Xaml::Controls;
|
||||
@@ -20,7 +20,7 @@ using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
CommandPalette::CommandPalette() :
|
||||
_switcherStartIdx{ 0 }
|
||||
@@ -30,12 +30,12 @@ namespace winrt::TerminalApp::implementation
|
||||
_itemTemplateSelector = Resources().Lookup(winrt::box_value(L"PaletteItemTemplateSelector")).try_as<PaletteItemTemplateSelector>();
|
||||
_listItemTemplate = Resources().Lookup(winrt::box_value(L"ListItemTemplate")).try_as<DataTemplate>();
|
||||
|
||||
_filteredActions = winrt::single_threaded_observable_vector<winrt::TerminalApp::FilteredCommand>();
|
||||
_nestedActionStack = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
|
||||
_currentNestedCommands = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
|
||||
_allCommands = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
|
||||
_tabActions = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
|
||||
_mruTabActions = winrt::single_threaded_vector<winrt::TerminalApp::FilteredCommand>();
|
||||
_filteredActions = winrt::single_threaded_observable_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
|
||||
_nestedActionStack = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
|
||||
_currentNestedCommands = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
|
||||
_allCommands = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
|
||||
_tabActions = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
|
||||
_mruTabActions = winrt::single_threaded_vector<winrt::Microsoft::Terminal::App::FilteredCommand>();
|
||||
|
||||
_switchToMode(CommandPaletteMode::ActionMode);
|
||||
|
||||
@@ -226,14 +226,14 @@ namespace winrt::TerminalApp::implementation
|
||||
const Windows::UI::Xaml::RoutedEventArgs& /*args*/)
|
||||
{
|
||||
const auto selectedCommand = _filteredActionsView().SelectedItem();
|
||||
const auto filteredCommand{ selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>() };
|
||||
const auto filteredCommand{ selectedCommand.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>() };
|
||||
if (_currentMode == CommandPaletteMode::TabSwitchMode)
|
||||
{
|
||||
_switchToTab(filteredCommand);
|
||||
}
|
||||
else if (_currentMode == CommandPaletteMode::ActionMode && filteredCommand != nullptr)
|
||||
{
|
||||
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() })
|
||||
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::ActionPaletteItem>() })
|
||||
{
|
||||
_PreviewActionHandlers(*this, actionPaletteItem.Command());
|
||||
}
|
||||
@@ -332,7 +332,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
const auto selectedCommand = _filteredActionsView().SelectedItem();
|
||||
const auto filteredCommand = selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>();
|
||||
const auto filteredCommand = selectedCommand.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>();
|
||||
_dispatchCommand(filteredCommand);
|
||||
e.Handled(true);
|
||||
}
|
||||
@@ -371,7 +371,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
else if (key == VirtualKey::Right && _currentMode == CommandPaletteMode::CommandlineMode)
|
||||
{
|
||||
if (const auto command{ _filteredActionsView().SelectedItem().try_as<winrt::TerminalApp::FilteredCommand>() })
|
||||
if (const auto command{ _filteredActionsView().SelectedItem().try_as<winrt::Microsoft::Terminal::App::FilteredCommand>() })
|
||||
{
|
||||
_searchBox().Text(command.Item().Name());
|
||||
_searchBox().Select(_searchBox().Text().size(), 0);
|
||||
@@ -427,7 +427,7 @@ namespace winrt::TerminalApp::implementation
|
||||
if (!ctrlDown && !altDown && !shiftDown)
|
||||
{
|
||||
const auto selectedCommand = _filteredActionsView().SelectedItem();
|
||||
if (const auto filteredCommand = selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>())
|
||||
if (const auto filteredCommand = selectedCommand.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>())
|
||||
{
|
||||
_dispatchCommand(filteredCommand);
|
||||
}
|
||||
@@ -524,7 +524,7 @@ namespace winrt::TerminalApp::implementation
|
||||
const Windows::UI::Xaml::Controls::ItemClickEventArgs& e)
|
||||
{
|
||||
const auto selectedCommand = e.ClickedItem();
|
||||
if (const auto filteredCommand = selectedCommand.try_as<winrt::TerminalApp::FilteredCommand>())
|
||||
if (const auto filteredCommand = selectedCommand.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>())
|
||||
{
|
||||
_dispatchCommand(filteredCommand);
|
||||
}
|
||||
@@ -542,9 +542,9 @@ namespace winrt::TerminalApp::implementation
|
||||
if (const auto selectedList = e.AddedItems(); selectedList.Size() > 0)
|
||||
{
|
||||
const auto selectedCommand = selectedList.GetAt(0);
|
||||
if (const auto filteredCmd = selectedCommand.try_as<TerminalApp::FilteredCommand>())
|
||||
if (const auto filteredCmd = selectedCommand.try_as<Microsoft::Terminal::App::FilteredCommand>())
|
||||
{
|
||||
if (const auto paletteItem = filteredCmd.Item().try_as<TerminalApp::PaletteItem>())
|
||||
if (const auto paletteItem = filteredCmd.Item().try_as<Microsoft::Terminal::App::PaletteItem>())
|
||||
{
|
||||
automationPeer.RaiseNotificationEvent(
|
||||
Automation::Peers::AutomationNotificationKind::ItemAdded,
|
||||
@@ -579,7 +579,7 @@ namespace winrt::TerminalApp::implementation
|
||||
if (_nestedActionStack.Size() > 0)
|
||||
{
|
||||
const auto newPreviousAction{ _nestedActionStack.GetAt(_nestedActionStack.Size() - 1) };
|
||||
const auto actionPaletteItem{ newPreviousAction.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() };
|
||||
const auto actionPaletteItem{ newPreviousAction.Item().try_as<winrt::Microsoft::Terminal::App::ActionPaletteItem>() };
|
||||
|
||||
ParentCommandName(actionPaletteItem.Command().Name());
|
||||
_updateCurrentNestedCommands(actionPaletteItem.Command());
|
||||
@@ -640,7 +640,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - A list of Commands to filter.
|
||||
Collections::IVector<winrt::TerminalApp::FilteredCommand> CommandPalette::_commandsToFilter()
|
||||
Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> CommandPalette::_commandsToFilter()
|
||||
{
|
||||
switch (_currentMode)
|
||||
{
|
||||
@@ -671,7 +671,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - command: the Command to dispatch. This might be null.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void CommandPalette::_dispatchCommand(const winrt::TerminalApp::FilteredCommand& filteredCommand)
|
||||
void CommandPalette::_dispatchCommand(const winrt::Microsoft::Terminal::App::FilteredCommand& filteredCommand)
|
||||
{
|
||||
if (_currentMode == CommandPaletteMode::CommandlineMode)
|
||||
{
|
||||
@@ -684,7 +684,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
else if (filteredCommand)
|
||||
{
|
||||
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() })
|
||||
if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::ActionPaletteItem>() })
|
||||
{
|
||||
if (actionPaletteItem.Command().HasNestedCommands())
|
||||
{
|
||||
@@ -760,11 +760,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// - filteredCommand - Selected filtered command - might be null
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void CommandPalette::_switchToTab(const winrt::TerminalApp::FilteredCommand& filteredCommand)
|
||||
void CommandPalette::_switchToTab(const winrt::Microsoft::Terminal::App::FilteredCommand& filteredCommand)
|
||||
{
|
||||
if (filteredCommand)
|
||||
{
|
||||
if (const auto tabPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::TabPaletteItem>() })
|
||||
if (const auto tabPaletteItem{ filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::TabPaletteItem>() })
|
||||
{
|
||||
if (const auto tab{ tabPaletteItem.Tab() })
|
||||
{
|
||||
@@ -780,7 +780,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - filteredCommand - Selected filtered command - might be null
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void CommandPalette::_dispatchCommandline(const winrt::TerminalApp::FilteredCommand& command)
|
||||
void CommandPalette::_dispatchCommandline(const winrt::Microsoft::Terminal::App::FilteredCommand& command)
|
||||
{
|
||||
const auto filteredCommand = command ? command : _buildCommandLineCommand(winrt::hstring(_getTrimmedInput()));
|
||||
if (filteredCommand.has_value())
|
||||
@@ -794,7 +794,7 @@ namespace winrt::TerminalApp::implementation
|
||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
||||
|
||||
if (const auto commandLinePaletteItem{ filteredCommand.value().Item().try_as<winrt::TerminalApp::CommandLinePaletteItem>() })
|
||||
if (const auto commandLinePaletteItem{ filteredCommand.value().Item().try_as<winrt::Microsoft::Terminal::App::CommandLinePaletteItem>() })
|
||||
{
|
||||
_CommandLineExecutionRequestedHandlers(*this, commandLinePaletteItem.CommandLine());
|
||||
_close();
|
||||
@@ -802,7 +802,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<TerminalApp::FilteredCommand> CommandPalette::_buildCommandLineCommand(const hstring& commandLine)
|
||||
std::optional<Microsoft::Terminal::App::FilteredCommand> CommandPalette::_buildCommandLineCommand(const hstring& commandLine)
|
||||
{
|
||||
if (commandLine.empty())
|
||||
{
|
||||
@@ -932,7 +932,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
Collections::IObservableVector<winrt::TerminalApp::FilteredCommand> CommandPalette::FilteredActions()
|
||||
Collections::IObservableVector<winrt::Microsoft::Terminal::App::FilteredCommand> CommandPalette::FilteredActions()
|
||||
{
|
||||
return _filteredActions;
|
||||
}
|
||||
@@ -947,7 +947,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_allCommands.Clear();
|
||||
for (const auto& action : actions)
|
||||
{
|
||||
auto actionPaletteItem{ winrt::make<winrt::TerminalApp::implementation::ActionPaletteItem>(action) };
|
||||
auto actionPaletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::ActionPaletteItem>(action) };
|
||||
auto filteredCommand{ winrt::make<FilteredCommand>(actionPaletteItem) };
|
||||
_allCommands.Append(filteredCommand);
|
||||
}
|
||||
@@ -970,13 +970,13 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void CommandPalette::_bindTabs(
|
||||
const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::TabBase>& source,
|
||||
const Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand>& target)
|
||||
const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::TabBase>& source,
|
||||
const Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand>& target)
|
||||
{
|
||||
target.Clear();
|
||||
for (const auto& tab : source)
|
||||
{
|
||||
auto tabPaletteItem{ winrt::make<winrt::TerminalApp::implementation::TabPaletteItem>(tab) };
|
||||
auto tabPaletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::TabPaletteItem>(tab) };
|
||||
auto filteredCommand{ winrt::make<FilteredCommand>(tabPaletteItem) };
|
||||
target.Append(filteredCommand);
|
||||
}
|
||||
@@ -1071,9 +1071,9 @@ namespace winrt::TerminalApp::implementation
|
||||
// - A collection that will receive the filtered actions
|
||||
// Return Value:
|
||||
// - <none>
|
||||
std::vector<winrt::TerminalApp::FilteredCommand> CommandPalette::_collectFilteredActions()
|
||||
std::vector<winrt::Microsoft::Terminal::App::FilteredCommand> CommandPalette::_collectFilteredActions()
|
||||
{
|
||||
std::vector<winrt::TerminalApp::FilteredCommand> actions;
|
||||
std::vector<winrt::Microsoft::Terminal::App::FilteredCommand> actions;
|
||||
|
||||
winrt::hstring searchText{ _getTrimmedInput() };
|
||||
|
||||
@@ -1168,7 +1168,7 @@ namespace winrt::TerminalApp::implementation
|
||||
for (const auto& nameAndCommand : parentCommand.NestedCommands())
|
||||
{
|
||||
const auto action = nameAndCommand.Value();
|
||||
auto nestedActionPaletteItem{ winrt::make<winrt::TerminalApp::implementation::ActionPaletteItem>(action) };
|
||||
auto nestedActionPaletteItem{ winrt::make<winrt::Microsoft::Terminal::App::implementation::ActionPaletteItem>(action) };
|
||||
auto nestedFilteredCommand{ winrt::make<FilteredCommand>(nestedActionPaletteItem) };
|
||||
_currentNestedCommands.Append(nestedFilteredCommand);
|
||||
}
|
||||
@@ -1297,17 +1297,17 @@ namespace winrt::TerminalApp::implementation
|
||||
// - Reads the list of recent commands from the persistent application state
|
||||
// Return Value:
|
||||
// - The list of FilteredCommand representing the ones stored in the state
|
||||
IVector<TerminalApp::FilteredCommand> CommandPalette::_loadRecentCommands()
|
||||
IVector<Microsoft::Terminal::App::FilteredCommand> CommandPalette::_loadRecentCommands()
|
||||
{
|
||||
const auto recentCommands = ApplicationState::SharedInstance().RecentCommands();
|
||||
// If this is the first time we've opened the commandline mode and
|
||||
// there aren't any recent commands, then just return an empty vector.
|
||||
if (!recentCommands)
|
||||
{
|
||||
return single_threaded_vector<TerminalApp::FilteredCommand>();
|
||||
return single_threaded_vector<Microsoft::Terminal::App::FilteredCommand>();
|
||||
}
|
||||
|
||||
std::vector<TerminalApp::FilteredCommand> parsedCommands;
|
||||
std::vector<Microsoft::Terminal::App::FilteredCommand> parsedCommands;
|
||||
parsedCommands.reserve(std::min(recentCommands.Size(), CommandLineHistoryLength));
|
||||
|
||||
for (const auto& c : recentCommands)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TerminalAppLocalTests
|
||||
class TabTests;
|
||||
};
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
enum class CommandPaletteMode
|
||||
{
|
||||
@@ -27,10 +27,10 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
CommandPalette();
|
||||
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::FilteredCommand> FilteredActions();
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::FilteredCommand> FilteredActions();
|
||||
|
||||
void SetCommands(const Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::Command>& actions);
|
||||
void SetTabs(const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::TabBase>& tabs, const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::TabBase>& mruTabs);
|
||||
void SetTabs(const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::TabBase>& tabs, const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::TabBase>& mruTabs);
|
||||
void SetActionMap(const Microsoft::Terminal::Settings::Model::IActionMapView& actionMap);
|
||||
|
||||
bool OnDirectKeyEvent(const uint32_t vkey, const uint8_t scanCode, const bool down);
|
||||
@@ -54,20 +54,20 @@ namespace winrt::TerminalApp::implementation
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParentCommandName, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, ParsedCommandLineText, _PropertyChangedHandlers);
|
||||
|
||||
TYPED_EVENT(SwitchToTabRequested, winrt::TerminalApp::CommandPalette, winrt::TerminalApp::TabBase);
|
||||
TYPED_EVENT(CommandLineExecutionRequested, winrt::TerminalApp::CommandPalette, winrt::hstring);
|
||||
TYPED_EVENT(DispatchCommandRequested, winrt::TerminalApp::CommandPalette, Microsoft::Terminal::Settings::Model::Command);
|
||||
TYPED_EVENT(SwitchToTabRequested, winrt::Microsoft::Terminal::App::CommandPalette, winrt::Microsoft::Terminal::App::TabBase);
|
||||
TYPED_EVENT(CommandLineExecutionRequested, winrt::Microsoft::Terminal::App::CommandPalette, winrt::hstring);
|
||||
TYPED_EVENT(DispatchCommandRequested, winrt::Microsoft::Terminal::App::CommandPalette, Microsoft::Terminal::Settings::Model::Command);
|
||||
TYPED_EVENT(PreviewAction, Windows::Foundation::IInspectable, Microsoft::Terminal::Settings::Model::Command);
|
||||
|
||||
private:
|
||||
friend struct CommandPaletteT<CommandPalette>; // for Xaml to bind events
|
||||
|
||||
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _allCommands{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _currentNestedCommands{ nullptr };
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::FilteredCommand> _filteredActions{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _nestedActionStack{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _allCommands{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _currentNestedCommands{ nullptr };
|
||||
Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::FilteredCommand> _filteredActions{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _nestedActionStack{ nullptr };
|
||||
|
||||
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _commandsToFilter();
|
||||
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _commandsToFilter();
|
||||
|
||||
bool _lastFilterTextWasEmpty{ true };
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _updateCurrentNestedCommands(const winrt::Microsoft::Terminal::Settings::Model::Command& parentCommand);
|
||||
|
||||
std::vector<winrt::TerminalApp::FilteredCommand> _collectFilteredActions();
|
||||
std::vector<winrt::Microsoft::Terminal::App::FilteredCommand> _collectFilteredActions();
|
||||
|
||||
void _close();
|
||||
|
||||
@@ -113,20 +113,20 @@ namespace winrt::TerminalApp::implementation
|
||||
Microsoft::Terminal::Settings::Model::IActionMapView _actionMap{ nullptr };
|
||||
|
||||
// Tab Switcher
|
||||
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _tabActions{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _mruTabActions{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _tabActions{ nullptr };
|
||||
Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _mruTabActions{ nullptr };
|
||||
Microsoft::Terminal::Settings::Model::TabSwitcherMode _tabSwitcherMode;
|
||||
uint32_t _switcherStartIdx;
|
||||
|
||||
void _bindTabs(const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::TabBase>& source, const Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand>& target);
|
||||
void _bindTabs(const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::TabBase>& source, const Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand>& target);
|
||||
void _anchorKeyUpHandler();
|
||||
|
||||
winrt::Windows::UI::Xaml::Controls::ListView::SizeChanged_revoker _sizeChangedRevoker;
|
||||
|
||||
void _dispatchCommand(const winrt::TerminalApp::FilteredCommand& command);
|
||||
void _dispatchCommandline(const winrt::TerminalApp::FilteredCommand& command);
|
||||
void _switchToTab(const winrt::TerminalApp::FilteredCommand& command);
|
||||
static std::optional<winrt::TerminalApp::FilteredCommand> _buildCommandLineCommand(const winrt::hstring& commandLine);
|
||||
void _dispatchCommand(const winrt::Microsoft::Terminal::App::FilteredCommand& command);
|
||||
void _dispatchCommandline(const winrt::Microsoft::Terminal::App::FilteredCommand& command);
|
||||
void _switchToTab(const winrt::Microsoft::Terminal::App::FilteredCommand& command);
|
||||
static std::optional<winrt::Microsoft::Terminal::App::FilteredCommand> _buildCommandLineCommand(const winrt::hstring& commandLine);
|
||||
|
||||
void _dismissPalette();
|
||||
|
||||
@@ -134,13 +134,13 @@ namespace winrt::TerminalApp::implementation
|
||||
uint32_t _getNumVisibleItems();
|
||||
|
||||
static constexpr uint32_t CommandLineHistoryLength = 20;
|
||||
static Windows::Foundation::Collections::IVector<winrt::TerminalApp::FilteredCommand> _loadRecentCommands();
|
||||
static Windows::Foundation::Collections::IVector<winrt::Microsoft::Terminal::App::FilteredCommand> _loadRecentCommands();
|
||||
static void _updateRecentCommands(const winrt::hstring& command);
|
||||
::TerminalApp::AppCommandlineArgs _appArgs;
|
||||
::Microsoft::Terminal::App::AppCommandlineArgs _appArgs;
|
||||
|
||||
void _choosingItemContainer(const Windows::UI::Xaml::Controls::ListViewBase& sender, const Windows::UI::Xaml::Controls::ChoosingItemContainerEventArgs& args);
|
||||
void _containerContentChanging(const Windows::UI::Xaml::Controls::ListViewBase& sender, const Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs& args);
|
||||
winrt::TerminalApp::PaletteItemTemplateSelector _itemTemplateSelector{ nullptr };
|
||||
winrt::Microsoft::Terminal::App::PaletteItemTemplateSelector _itemTemplateSelector{ nullptr };
|
||||
std::unordered_map<Windows::UI::Xaml::DataTemplate, std::unordered_set<Windows::UI::Xaml::Controls::Primitives::SelectorItem>> _listViewItemsCache;
|
||||
Windows::UI::Xaml::DataTemplate _listItemTemplate;
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(CommandPalette);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import "IDirectKeyListener.idl";
|
||||
import "HighlightedTextControl.idl";
|
||||
import "FilteredCommand.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass CommandPalette : Windows.UI.Xaml.Controls.UserControl, Windows.UI.Xaml.Data.INotifyPropertyChanged, IDirectKeyListener
|
||||
{
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information.
|
||||
-->
|
||||
<UserControl x:Class="TerminalApp.CommandPalette"
|
||||
<UserControl x:Class="Microsoft.Terminal.App.CommandPalette"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:SettingsModel="using:Microsoft.Terminal.Settings.Model"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:local="using:Microsoft.Terminal.App"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:model="using:Microsoft.Terminal.Settings.Model"
|
||||
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "pch.h"
|
||||
#include "Commandline.h"
|
||||
|
||||
using namespace TerminalApp;
|
||||
using namespace Microsoft::Terminal::App;
|
||||
|
||||
size_t Commandline::Argc() const
|
||||
{
|
||||
|
||||
@@ -23,12 +23,12 @@ namespace TerminalAppLocalTests
|
||||
{
|
||||
class CommandlineTest;
|
||||
};
|
||||
namespace TerminalApp
|
||||
namespace Microsoft::Terminal::App
|
||||
{
|
||||
class Commandline;
|
||||
};
|
||||
|
||||
class TerminalApp::Commandline
|
||||
class Microsoft::Terminal::App::Commandline
|
||||
{
|
||||
public:
|
||||
static constexpr std::wstring_view Delimiter{ L";" };
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include "pch.h"
|
||||
#include "DebugTapConnection.h"
|
||||
|
||||
using namespace ::winrt::Microsoft::Terminal::TerminalConnection;
|
||||
using namespace ::winrt::Microsoft::Terminal::Connection;
|
||||
using namespace ::winrt::Windows::Foundation;
|
||||
namespace winrt::Microsoft::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// DebugInputTapConnection is an implementation detail of DebugTapConnection.
|
||||
// It wraps the _actual_ connection so it can hook WriteInput and forward it
|
||||
@@ -129,7 +129,7 @@ namespace winrt::Microsoft::TerminalApp::implementation
|
||||
}
|
||||
|
||||
// Wire us up so that we can forward input through
|
||||
void DebugTapConnection::SetInputTap(const Microsoft::Terminal::TerminalConnection::ITerminalConnection& inputTap)
|
||||
void DebugTapConnection::SetInputTap(const Microsoft::Terminal::Connection::ITerminalConnection& inputTap)
|
||||
{
|
||||
_inputSide = inputTap;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ namespace winrt::Microsoft::TerminalApp::implementation
|
||||
// 2. One that will print raw VT sequences sent into and received _from_ the original connection.
|
||||
std::tuple<ITerminalConnection, ITerminalConnection> OpenDebugTapConnection(ITerminalConnection baseConnection)
|
||||
{
|
||||
using namespace winrt::Microsoft::TerminalApp::implementation;
|
||||
using namespace winrt::Microsoft::Microsoft::Terminal::App::implementation;
|
||||
auto debugSide{ winrt::make_self<DebugTapConnection>(baseConnection) };
|
||||
auto inputSide{ winrt::make_self<DebugInputTapConnection>(debugSide, baseConnection) };
|
||||
debugSide->SetInputTap(*inputSide);
|
||||
|
||||
@@ -3,38 +3,38 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
||||
#include <winrt/Microsoft.Terminal.Connection.h>
|
||||
#include <til/latch.h>
|
||||
|
||||
namespace winrt::Microsoft::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
class DebugInputTapConnection;
|
||||
class DebugTapConnection : public winrt::implements<DebugTapConnection, winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection>
|
||||
class DebugTapConnection : public winrt::implements<DebugTapConnection, winrt::Microsoft::Terminal::Connection::ITerminalConnection>
|
||||
{
|
||||
public:
|
||||
explicit DebugTapConnection(Microsoft::Terminal::TerminalConnection::ITerminalConnection wrappedConnection);
|
||||
explicit DebugTapConnection(winrt::Microsoft::Terminal::Connection::ITerminalConnection wrappedConnection);
|
||||
void Initialize(const Windows::Foundation::Collections::ValueSet& /*settings*/){};
|
||||
~DebugTapConnection();
|
||||
void Start();
|
||||
void WriteInput(const hstring& data);
|
||||
void Resize(uint32_t rows, uint32_t columns);
|
||||
void Close();
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ConnectionState State() const noexcept;
|
||||
winrt::Microsoft::Terminal::Connection::ConnectionState State() const noexcept;
|
||||
|
||||
void SetInputTap(const Microsoft::Terminal::TerminalConnection::ITerminalConnection& inputTap);
|
||||
void SetInputTap(const winrt::Microsoft::Terminal::Connection::ITerminalConnection& inputTap);
|
||||
|
||||
WINRT_CALLBACK(TerminalOutput, winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler);
|
||||
WINRT_CALLBACK(TerminalOutput, winrt::Microsoft::Terminal::Connection::TerminalOutputHandler);
|
||||
|
||||
TYPED_EVENT(StateChanged, winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection, winrt::Windows::Foundation::IInspectable);
|
||||
TYPED_EVENT(StateChanged, winrt::Microsoft::Terminal::Connection::ITerminalConnection, winrt::Windows::Foundation::IInspectable);
|
||||
|
||||
private:
|
||||
void _PrintInput(const hstring& data);
|
||||
void _OutputHandler(const hstring str);
|
||||
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection::TerminalOutput_revoker _outputRevoker;
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection::StateChanged_revoker _stateChangedRevoker;
|
||||
winrt::weak_ref<Microsoft::Terminal::TerminalConnection::ITerminalConnection> _wrappedConnection;
|
||||
winrt::weak_ref<Microsoft::Terminal::TerminalConnection::ITerminalConnection> _inputSide;
|
||||
winrt::Microsoft::Terminal::Connection::ITerminalConnection::TerminalOutput_revoker _outputRevoker;
|
||||
winrt::Microsoft::Terminal::Connection::ITerminalConnection::StateChanged_revoker _stateChangedRevoker;
|
||||
winrt::weak_ref<winrt::Microsoft::Terminal::Connection::ITerminalConnection> _wrappedConnection;
|
||||
winrt::weak_ref<winrt::Microsoft::Terminal::Connection::ITerminalConnection> _inputSide;
|
||||
|
||||
til::latch _start{ 1 };
|
||||
|
||||
@@ -42,4 +42,4 @@ namespace winrt::Microsoft::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
std::tuple<winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection, winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection> OpenDebugTapConnection(winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection baseConnection);
|
||||
std::tuple<winrt::Microsoft::Terminal::Connection::ITerminalConnection, winrt::Microsoft::Terminal::Connection::ITerminalConnection> OpenDebugTapConnection(winrt::Microsoft::Terminal::Connection::ITerminalConnection baseConnection);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
using namespace winrt::Windows;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// Method Description:
|
||||
// - Attempt to convert something into another type. For the
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "EmptyStringVisibilityConverter.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct EmptyStringVisibilityConverter : EmptyStringVisibilityConverterT<EmptyStringVisibilityConverter>
|
||||
{
|
||||
@@ -20,7 +20,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(EmptyStringVisibilityConverter);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
// See https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-quickstart
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "FilteredCommand.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::System;
|
||||
@@ -17,11 +17,11 @@ using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// This class is a wrapper of PaletteItem, that is used as an item of a filterable list in CommandPalette.
|
||||
// It manages a highlighted text that is computed by matching search filter characters to item name
|
||||
FilteredCommand::FilteredCommand(const winrt::TerminalApp::PaletteItem& item) :
|
||||
FilteredCommand::FilteredCommand(const winrt::Microsoft::Terminal::App::PaletteItem& item) :
|
||||
_Item(item),
|
||||
_Filter(L""),
|
||||
_Weight(0)
|
||||
@@ -70,9 +70,9 @@ namespace winrt::TerminalApp::implementation
|
||||
//
|
||||
// Return Value:
|
||||
// - The HighlightedText object initialized with the segments computed according to the algorithm above.
|
||||
winrt::TerminalApp::HighlightedText FilteredCommand::_computeHighlightedName()
|
||||
winrt::Microsoft::Terminal::App::HighlightedText FilteredCommand::_computeHighlightedName()
|
||||
{
|
||||
const auto segments = winrt::single_threaded_observable_vector<winrt::TerminalApp::HighlightedTextSegment>();
|
||||
const auto segments = winrt::single_threaded_observable_vector<winrt::Microsoft::Terminal::App::HighlightedTextSegment>();
|
||||
auto commandName = _Item.Name();
|
||||
auto isProcessingMatchedSegment = false;
|
||||
uint32_t nextOffsetToReport = 0;
|
||||
@@ -225,7 +225,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - other: another instance of FilteredCommand interface
|
||||
// Return Value:
|
||||
// - Returns true if the first is "bigger" (aka should appear first)
|
||||
int FilteredCommand::Compare(const winrt::TerminalApp::FilteredCommand& first, const winrt::TerminalApp::FilteredCommand& second)
|
||||
int FilteredCommand::Compare(const winrt::Microsoft::Terminal::App::FilteredCommand& first, const winrt::Microsoft::Terminal::App::FilteredCommand& second)
|
||||
{
|
||||
auto firstWeight{ first.Weight() };
|
||||
auto secondWeight{ second.Weight() };
|
||||
|
||||
@@ -12,25 +12,25 @@ namespace TerminalAppLocalTests
|
||||
class FilteredCommandTests;
|
||||
};
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct FilteredCommand : FilteredCommandT<FilteredCommand>
|
||||
{
|
||||
FilteredCommand() = default;
|
||||
FilteredCommand(const winrt::TerminalApp::PaletteItem& item);
|
||||
FilteredCommand(const winrt::Microsoft::Terminal::App::PaletteItem& item);
|
||||
|
||||
void UpdateFilter(const winrt::hstring& filter);
|
||||
|
||||
static int Compare(const winrt::TerminalApp::FilteredCommand& first, const winrt::TerminalApp::FilteredCommand& second);
|
||||
static int Compare(const winrt::Microsoft::Terminal::App::FilteredCommand& first, const winrt::Microsoft::Terminal::App::FilteredCommand& second);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::PaletteItem, Item, _PropertyChangedHandlers, nullptr);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::Microsoft::Terminal::App::PaletteItem, Item, _PropertyChangedHandlers, nullptr);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Filter, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::HighlightedText, HighlightedName, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::Microsoft::Terminal::App::HighlightedText, HighlightedName, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(int, Weight, _PropertyChangedHandlers);
|
||||
|
||||
private:
|
||||
winrt::TerminalApp::HighlightedText _computeHighlightedName();
|
||||
winrt::Microsoft::Terminal::App::HighlightedText _computeHighlightedName();
|
||||
int _computeWeight();
|
||||
Windows::UI::Xaml::Data::INotifyPropertyChanged::PropertyChanged_revoker _itemChangedRevoker;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(FilteredCommand);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import "PaletteItem.idl";
|
||||
import "HighlightedTextControl.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass FilteredCommand : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "HighlightedText.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::System;
|
||||
@@ -16,7 +16,7 @@ using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
HighlightedTextSegment::HighlightedTextSegment(const winrt::hstring& textSegment, bool isHighlighted) :
|
||||
_TextSegment(textSegment),
|
||||
@@ -24,7 +24,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
}
|
||||
|
||||
HighlightedText::HighlightedText(const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment>& segments) :
|
||||
HighlightedText::HighlightedText(const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::HighlightedTextSegment>& segments) :
|
||||
_Segments(segments)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "HighlightedTextSegment.g.h"
|
||||
#include "HighlightedText.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct HighlightedTextSegment : HighlightedTextSegmentT<HighlightedTextSegment>
|
||||
{
|
||||
@@ -21,14 +21,14 @@ namespace winrt::TerminalApp::implementation
|
||||
struct HighlightedText : HighlightedTextT<HighlightedText>
|
||||
{
|
||||
HighlightedText() = default;
|
||||
HighlightedText(const Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment>& segments);
|
||||
HighlightedText(const Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::HighlightedTextSegment>& segments);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
WINRT_OBSERVABLE_PROPERTY(Windows::Foundation::Collections::IObservableVector<winrt::TerminalApp::HighlightedTextSegment>, Segments, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::App::HighlightedTextSegment>, Segments, _PropertyChangedHandlers);
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(HighlightedTextSegment);
|
||||
BASIC_FACTORY(HighlightedText);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass HighlightedTextSegment : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "HighlightedTextControl.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::System;
|
||||
@@ -17,15 +17,15 @@ using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// Our control exposes a "Text" property to be used with Data Binding
|
||||
// To allow this we need to register a Dependency Property Identifier to be used by the property system
|
||||
// (https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/custom-dependency-properties)
|
||||
DependencyProperty HighlightedTextControl::_textProperty = DependencyProperty::Register(
|
||||
L"Text",
|
||||
xaml_typename<winrt::TerminalApp::HighlightedText>(),
|
||||
xaml_typename<winrt::TerminalApp::HighlightedTextControl>(),
|
||||
xaml_typename<winrt::Microsoft::Terminal::App::HighlightedText>(),
|
||||
xaml_typename<winrt::Microsoft::Terminal::App::HighlightedTextControl>(),
|
||||
PropertyMetadata(nullptr, HighlightedTextControl::_onTextChanged));
|
||||
|
||||
HighlightedTextControl::HighlightedTextControl()
|
||||
@@ -49,12 +49,12 @@ namespace winrt::TerminalApp::implementation
|
||||
return _textView();
|
||||
}
|
||||
|
||||
winrt::TerminalApp::HighlightedText HighlightedTextControl::Text()
|
||||
winrt::Microsoft::Terminal::App::HighlightedText HighlightedTextControl::Text()
|
||||
{
|
||||
return winrt::unbox_value<winrt::TerminalApp::HighlightedText>(GetValue(_textProperty));
|
||||
return winrt::unbox_value<winrt::Microsoft::Terminal::App::HighlightedText>(GetValue(_textProperty));
|
||||
}
|
||||
|
||||
void HighlightedTextControl::Text(const winrt::TerminalApp::HighlightedText& value)
|
||||
void HighlightedTextControl::Text(const winrt::Microsoft::Terminal::App::HighlightedText& value)
|
||||
{
|
||||
SetValue(_textProperty, winrt::box_value(value));
|
||||
}
|
||||
@@ -67,8 +67,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// The new value is expected to be an instance of HighlightedText
|
||||
void HighlightedTextControl::_onTextChanged(const DependencyObject& o, const DependencyPropertyChangedEventArgs& e)
|
||||
{
|
||||
const auto control = o.try_as<winrt::TerminalApp::HighlightedTextControl>();
|
||||
const auto highlightedText = e.NewValue().try_as<winrt::TerminalApp::HighlightedText>();
|
||||
const auto control = o.try_as<winrt::Microsoft::Terminal::App::HighlightedTextControl>();
|
||||
const auto highlightedText = e.NewValue().try_as<winrt::Microsoft::Terminal::App::HighlightedText>();
|
||||
|
||||
if (control && highlightedText)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "HighlightedTextControl.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct HighlightedTextControl : HighlightedTextControlT<HighlightedTextControl>
|
||||
{
|
||||
@@ -15,8 +15,8 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
static Windows::UI::Xaml::DependencyProperty TextProperty();
|
||||
|
||||
winrt::TerminalApp::HighlightedText Text();
|
||||
void Text(const winrt::TerminalApp::HighlightedText& value);
|
||||
winrt::Microsoft::Terminal::App::HighlightedText Text();
|
||||
void Text(const winrt::Microsoft::Terminal::App::HighlightedText& value);
|
||||
|
||||
Windows::UI::Xaml::Controls::TextBlock TextView();
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(HighlightedTextControl);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import "HighlightedText.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass HighlightedTextControl : Windows.UI.Xaml.Controls.Control
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<UserControl x:Class="TerminalApp.HighlightedTextControl"
|
||||
<UserControl x:Class="Microsoft.Terminal.App.HighlightedTextControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:local="using:Microsoft.Terminal.App"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Background="Transparent"
|
||||
mc:Ignorable="d">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
// C++/winrt makes it difficult to share this idl between two projects,
|
||||
// Instead, we just pin the uuid and include it in both TermControl and App
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "pch.h"
|
||||
#include "LanguageProfileNotifier.h"
|
||||
|
||||
using namespace winrt::TerminalApp::implementation;
|
||||
using namespace winrt::Microsoft::Terminal::App::implementation;
|
||||
|
||||
LanguageProfileNotifier::LanguageProfileNotifier(std::function<void()>&& callback) :
|
||||
_callback{ std::move(callback) },
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
class LanguageProfileNotifier : public winrt::implements<LanguageProfileNotifier, ITfInputProcessorProfileActivationSink>
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
static void closeToolTipForButton(const Controls::Button& button)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "MinMaxCloseControl.g.h"
|
||||
#include <ThrottledFunc.h>
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct MinMaxCloseControl : MinMaxCloseControlT<MinMaxCloseControl>
|
||||
{
|
||||
@@ -28,16 +28,16 @@ namespace winrt::TerminalApp::implementation
|
||||
void _CloseClick(const winrt::Windows::Foundation::IInspectable& sender,
|
||||
const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
|
||||
|
||||
TYPED_EVENT(MinimizeClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
TYPED_EVENT(MaximizeClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
TYPED_EVENT(CloseClick, TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
TYPED_EVENT(MinimizeClick, Microsoft::Terminal::App::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
TYPED_EVENT(MaximizeClick, Microsoft::Terminal::App::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
TYPED_EVENT(CloseClick, Microsoft::Terminal::App::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs);
|
||||
|
||||
std::shared_ptr<ThrottledFuncTrailing<winrt::Windows::UI::Xaml::Controls::Button>> _displayToolTip{ nullptr };
|
||||
std::optional<CaptionButton> _lastPressedButton{ std::nullopt };
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(MinMaxCloseControl);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import "TitlebarControl.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass MinMaxCloseControl : Windows.UI.Xaml.Controls.StackPanel
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
||||
the MIT License. See LICENSE in the project root for license information.
|
||||
-->
|
||||
<StackPanel x:Class="TerminalApp.MinMaxCloseControl"
|
||||
<StackPanel x:Class="Microsoft.Terminal.App.MinMaxCloseControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
|
||||
@@ -13,7 +13,7 @@ using namespace winrt::Microsoft::Terminal::Control;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Windows::System;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
Controls::IconElement PaletteItem::ResolvedIcon()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
#include "PaletteItem.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct PaletteItem : PaletteItemT<PaletteItem>
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
unsealed runtimeclass PaletteItem : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "PaletteItemTemplateSelector.h"
|
||||
#include "PaletteItemTemplateSelector.g.cpp"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
Windows::UI::Xaml::DataTemplate PaletteItemTemplateSelector::SelectTemplateCore(const winrt::Windows::Foundation::IInspectable& item, const winrt::Windows::UI::Xaml::DependencyObject& /*container*/)
|
||||
{
|
||||
@@ -24,13 +24,13 @@ namespace winrt::TerminalApp::implementation
|
||||
// - data template to use for rendering
|
||||
Windows::UI::Xaml::DataTemplate PaletteItemTemplateSelector::SelectTemplateCore(const winrt::Windows::Foundation::IInspectable& item)
|
||||
{
|
||||
if (const auto filteredCommand{ item.try_as<winrt::TerminalApp::FilteredCommand>() })
|
||||
if (const auto filteredCommand{ item.try_as<winrt::Microsoft::Terminal::App::FilteredCommand>() })
|
||||
{
|
||||
if (filteredCommand.Item().try_as<winrt::TerminalApp::TabPaletteItem>())
|
||||
if (filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::TabPaletteItem>())
|
||||
{
|
||||
return TabItemTemplate();
|
||||
}
|
||||
else if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::TerminalApp::ActionPaletteItem>() })
|
||||
else if (const auto actionPaletteItem{ filteredCommand.Item().try_as<winrt::Microsoft::Terminal::App::ActionPaletteItem>() })
|
||||
{
|
||||
if (actionPaletteItem.Command().HasNestedCommands())
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "PaletteItemTemplateSelector.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct PaletteItemTemplateSelector : PaletteItemTemplateSelectorT<PaletteItemTemplateSelector>
|
||||
{
|
||||
@@ -20,7 +20,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(PaletteItemTemplateSelector);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass PaletteItemTemplateSelector : Windows.UI.Xaml.Controls.DataTemplateSelector
|
||||
{
|
||||
|
||||
@@ -17,9 +17,9 @@ using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml::Media;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
using namespace winrt::Microsoft::Terminal::TerminalConnection;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::Connection;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace Microsoft::Terminal::App;
|
||||
|
||||
static const int PaneBorderSize = 2;
|
||||
static const int CombinedPaneBorderSize = 2 * PaneBorderSize;
|
||||
@@ -3169,11 +3169,11 @@ bool Pane::ContainsReadOnly() const
|
||||
// - states: a vector that will receive all the states of all leaves in the tree
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void Pane::CollectTaskbarStates(std::vector<winrt::TerminalApp::TaskbarState>& states)
|
||||
void Pane::CollectTaskbarStates(std::vector<winrt::Microsoft::Terminal::App::TaskbarState>& states)
|
||||
{
|
||||
if (_IsLeaf())
|
||||
{
|
||||
auto tbState{ winrt::make<winrt::TerminalApp::implementation::TaskbarState>(_control.TaskbarState(),
|
||||
auto tbState{ winrt::make<winrt::Microsoft::Terminal::App::implementation::TaskbarState>(_control.TaskbarState(),
|
||||
_control.TaskbarProgress()) };
|
||||
states.push_back(tbState);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace TerminalAppLocalTests
|
||||
class TabTests;
|
||||
};
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct TerminalTab;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
void CollectTaskbarStates(std::vector<winrt::TerminalApp::TaskbarState>& states);
|
||||
void CollectTaskbarStates(std::vector<winrt::Microsoft::Terminal::App::TaskbarState>& states);
|
||||
|
||||
WINRT_CALLBACK(ClosedByParent, winrt::delegate<>);
|
||||
WINRT_CALLBACK(Closed, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>);
|
||||
@@ -226,7 +226,7 @@ private:
|
||||
SplitState _splitState{ SplitState::None };
|
||||
float _desiredSplitPosition;
|
||||
winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected };
|
||||
winrt::Microsoft::Terminal::Connection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::Connection::ConnectionState::NotConnected };
|
||||
winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr };
|
||||
bool _isDefTermSession{ false };
|
||||
#pragma endregion
|
||||
@@ -393,6 +393,6 @@ private:
|
||||
void _AssignChildNode(std::unique_ptr<LayoutSizeNode>& nodeField, const LayoutSizeNode* const newNode);
|
||||
};
|
||||
|
||||
friend struct winrt::TerminalApp::implementation::TerminalTab;
|
||||
friend struct winrt::Microsoft::Terminal::App::implementation::TerminalTab;
|
||||
friend class ::TerminalAppLocalTests::TabTests;
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace winrt
|
||||
namespace WUX = Windows::UI::Xaml;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
SettingsTab::SettingsTab(MainPage settingsUI,
|
||||
winrt::Windows::UI::Xaml::ElementTheme requestedTheme)
|
||||
|
||||
@@ -19,7 +19,7 @@ Author(s):
|
||||
#include "TabBase.h"
|
||||
#include "SettingsTab.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct SettingsTab : SettingsTabT<SettingsTab, TabBase>
|
||||
{
|
||||
@@ -27,10 +27,10 @@ namespace winrt::TerminalApp::implementation
|
||||
SettingsTab(winrt::Microsoft::Terminal::Settings::Editor::MainPage settingsUI,
|
||||
winrt::Windows::UI::Xaml::ElementTheme requestedTheme);
|
||||
|
||||
void UpdateSettings(Microsoft::Terminal::Settings::Model::CascadiaSettings settings);
|
||||
void UpdateSettings(winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings settings);
|
||||
void Focus(winrt::Windows::UI::Xaml::FocusState focusState) override;
|
||||
|
||||
std::vector<Microsoft::Terminal::Settings::Model::ActionAndArgs> BuildStartupActions() const override;
|
||||
std::vector<winrt::Microsoft::Terminal::Settings::Model::ActionAndArgs> BuildStartupActions() const override;
|
||||
|
||||
private:
|
||||
winrt::Windows::UI::Xaml::ElementTheme _requestedTheme;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import "TabBase.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass SettingsTab : TabBase
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace winrt::Microsoft::Terminal;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
|
||||
#define ACTION_CASE(action) \
|
||||
case ShortcutAction::action: \
|
||||
@@ -17,7 +17,7 @@ using namespace winrt::TerminalApp;
|
||||
break; \
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// Method Description:
|
||||
// - Dispatch the appropriate event for the given ActionAndArgs. Constructs
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace TerminalAppLocalTests
|
||||
class KeyBindingsTests;
|
||||
}
|
||||
|
||||
#define DECLARE_ACTION(action) TYPED_EVENT(action, TerminalApp::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs);
|
||||
#define DECLARE_ACTION(action) TYPED_EVENT(action, Microsoft::Terminal::App::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs);
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct ShortcutActionDispatch : ShortcutActionDispatchT<ShortcutActionDispatch>
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(ShortcutActionDispatch);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#define ACTION_EVENT(name) event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, Microsoft.Terminal.Settings.Model.ActionEventArgs> name
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
[default_interface] runtimeclass ShortcutActionDispatch {
|
||||
ShortcutActionDispatch();
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace winrt
|
||||
namespace WUX = Windows::UI::Xaml;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
WUX::FocusState TabBase::FocusState() const noexcept
|
||||
{
|
||||
@@ -165,7 +165,7 @@ namespace winrt::TerminalApp::implementation
|
||||
_UpdateSwitchToTabKeyChord();
|
||||
}
|
||||
|
||||
void TabBase::SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch)
|
||||
void TabBase::SetDispatch(const winrt::Microsoft::Terminal::App::ShortcutActionDispatch& dispatch)
|
||||
{
|
||||
_dispatch = dispatch;
|
||||
}
|
||||
@@ -360,7 +360,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// calculate the luminance of the current color and select a font
|
||||
// color based on that
|
||||
// see https://www.w3.org/TR/WCAG20/#relativeluminancedef
|
||||
if (TerminalApp::ColorHelper::IsBrightColor(color))
|
||||
if (Microsoft::Terminal::App::ColorHelper::IsBrightColor(color))
|
||||
{
|
||||
auto subtleFillColorSecondary = winrt::Windows::UI::Colors::Black();
|
||||
subtleFillColorSecondary.A = 0x09;
|
||||
@@ -381,7 +381,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// The tab font should be based on the evaluated appearance of the tab color layered on tab row.
|
||||
const auto layeredTabColor = til::color{ color }.layer_over(_tabRowColor);
|
||||
if (TerminalApp::ColorHelper::IsBrightColor(layeredTabColor))
|
||||
if (Microsoft::Terminal::App::ColorHelper::IsBrightColor(layeredTabColor))
|
||||
{
|
||||
fontBrush.Color(winrt::Windows::UI::Colors::Black());
|
||||
auto secondaryFontColor = winrt::Windows::UI::Colors::Black();
|
||||
@@ -444,7 +444,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// We don't want that to result in white text on a white tab row for
|
||||
// inactive tabs.
|
||||
const auto deselectedActualColor = deselectedTabColor.layer_over(_tabRowColor);
|
||||
if (TerminalApp::ColorHelper::IsBrightColor(deselectedActualColor))
|
||||
if (Microsoft::Terminal::App::ColorHelper::IsBrightColor(deselectedActualColor))
|
||||
{
|
||||
deselectedFontBrush.Color(winrt::Windows::UI::Colors::Black());
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace TerminalAppLocalTests
|
||||
class TabTests;
|
||||
};
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct TabBase : TabBaseT<TabBase>
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::Windows::UI::Xaml::FocusState FocusState() const noexcept;
|
||||
|
||||
virtual void Shutdown();
|
||||
void SetDispatch(const winrt::TerminalApp::ShortcutActionDispatch& dispatch);
|
||||
void SetDispatch(const winrt::Microsoft::Terminal::App::ShortcutActionDispatch& dispatch);
|
||||
|
||||
void UpdateTabViewIndex(const uint32_t idx, const uint32_t numTabs);
|
||||
void SetActionMap(const Microsoft::Terminal::Settings::Model::IActionMapView& actionMap);
|
||||
@@ -52,7 +52,7 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::Windows::UI::Xaml::FocusState _focusState{ winrt::Windows::UI::Xaml::FocusState::Unfocused };
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeOtherTabsMenuItem{};
|
||||
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeTabsAfterMenuItem{};
|
||||
winrt::TerminalApp::ShortcutActionDispatch _dispatch;
|
||||
winrt::Microsoft::Terminal::App::ShortcutActionDispatch _dispatch;
|
||||
Microsoft::Terminal::Settings::Model::IActionMapView _actionMap{ nullptr };
|
||||
winrt::hstring _keyChord{};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
import "ShortcutActionDispatch.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
unsealed runtimeclass TabBase : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
using namespace winrt;
|
||||
using namespace winrt::Microsoft::UI::Xaml;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
TabHeaderControl::TabHeaderControl()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "TabHeaderControl.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct TabHeaderControl : TabHeaderControlT<TabHeaderControl>
|
||||
{
|
||||
@@ -19,12 +19,12 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
bool InRename();
|
||||
|
||||
WINRT_CALLBACK(TitleChangeRequested, TerminalApp::TitleChangeRequestedArgs);
|
||||
WINRT_CALLBACK(TitleChangeRequested, Microsoft::Terminal::App::TitleChangeRequestedArgs);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(double, RenamerMaxWidth, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::Microsoft::Terminal::App::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);
|
||||
|
||||
TYPED_EVENT(RenameEnded, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace winrt::TerminalApp::implementation
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(TabHeaderControl);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
import "TerminalTabStatus.idl";
|
||||
|
||||
namespace TerminalApp
|
||||
namespace Microsoft.Terminal.App
|
||||
{
|
||||
delegate void TitleChangeRequestedArgs(String title);
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
the MIT License. See LICENSE in the project root for license information.
|
||||
-->
|
||||
|
||||
<UserControl x:Class="TerminalApp.TabHeaderControl"
|
||||
<UserControl x:Class="Microsoft.Terminal.App.TabHeaderControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:TerminalApp"
|
||||
xmlns:local="using:Microsoft.Terminal.Microsoft.Terminal.App"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
||||
MinHeight="16"
|
||||
|
||||
@@ -37,9 +37,9 @@ using namespace winrt::Windows::Storage::Pickers;
|
||||
using namespace winrt::Windows::Storage::Provider;
|
||||
using namespace winrt::Microsoft::Terminal;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
using namespace winrt::Microsoft::Terminal::TerminalConnection;
|
||||
using namespace winrt::Microsoft::Terminal::Connection;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace ::TerminalApp;
|
||||
using namespace ::Microsoft::Terminal::App;
|
||||
using namespace ::Microsoft::Console;
|
||||
|
||||
namespace winrt
|
||||
@@ -49,7 +49,7 @@ namespace winrt
|
||||
using IInspectable = Windows::Foundation::IInspectable;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
// Method Description:
|
||||
// - Open a new tab. This will create the TerminalControl hosting the
|
||||
@@ -63,7 +63,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - existingConnection: An optional connection that is already established to a PTY
|
||||
// for this tab to host instead of creating one.
|
||||
// If not defined, the tab will create the connection.
|
||||
HRESULT TerminalPage::_OpenNewTab(const NewTerminalArgs& newTerminalArgs, winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection existingConnection)
|
||||
HRESULT TerminalPage::_OpenNewTab(const NewTerminalArgs& newTerminalArgs, winrt::Microsoft::Terminal::Connection::ITerminalConnection existingConnection)
|
||||
try
|
||||
{
|
||||
const auto profile{ _settings.GetProfileForArgs(newTerminalArgs) };
|
||||
@@ -462,7 +462,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - Removes the tab (both TerminalControl and XAML) after prompting for approval
|
||||
// Arguments:
|
||||
// - tab: the tab to remove
|
||||
winrt::Windows::Foundation::IAsyncAction TerminalPage::_HandleCloseTabRequested(winrt::TerminalApp::TabBase tab)
|
||||
winrt::Windows::Foundation::IAsyncAction TerminalPage::_HandleCloseTabRequested(winrt::Microsoft::Terminal::App::TabBase tab)
|
||||
{
|
||||
if (tab.ReadOnly())
|
||||
{
|
||||
@@ -486,7 +486,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - Removes the tab (both TerminalControl and XAML)
|
||||
// Arguments:
|
||||
// - tab: the tab to remove
|
||||
void TerminalPage::_RemoveTab(const winrt::TerminalApp::TabBase& tab)
|
||||
void TerminalPage::_RemoveTab(const winrt::Microsoft::Terminal::App::TabBase& tab)
|
||||
{
|
||||
uint32_t tabIndex{};
|
||||
if (!_tabs.IndexOf(tab, tabIndex))
|
||||
@@ -653,7 +653,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - tab - tab to select
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_OnSwitchToTabRequested(const IInspectable& /*sender*/, const winrt::TerminalApp::TabBase& tab)
|
||||
void TerminalPage::_OnSwitchToTabRequested(const IInspectable& /*sender*/, const winrt::Microsoft::Terminal::App::TabBase& tab)
|
||||
{
|
||||
uint32_t index{};
|
||||
if (_tabs.IndexOf(tab, index))
|
||||
@@ -682,7 +682,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Method Description:
|
||||
// - returns the currently focused tab. This might return null,
|
||||
// so make sure to check the result!
|
||||
winrt::TerminalApp::TabBase TerminalPage::_GetFocusedTab() const noexcept
|
||||
winrt::Microsoft::Terminal::App::TabBase TerminalPage::_GetFocusedTab() const noexcept
|
||||
{
|
||||
if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
@@ -706,7 +706,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Method Description:
|
||||
// - returns a tab corresponding to a view item. This might return null,
|
||||
// so make sure to check the result!
|
||||
winrt::TerminalApp::TabBase TerminalPage::_GetTabByTabViewItem(const Microsoft::UI::Xaml::Controls::TabViewItem& tabViewItem) const noexcept
|
||||
winrt::Microsoft::Terminal::App::TabBase TerminalPage::_GetTabByTabViewItem(const Microsoft::UI::Xaml::Controls::TabViewItem& tabViewItem) const noexcept
|
||||
{
|
||||
uint32_t tabIndexFromControl{};
|
||||
if (_tabView.TabItems().IndexOf(tabViewItem, tabIndexFromControl))
|
||||
@@ -727,7 +727,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - tab: tab to focus.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
winrt::fire_and_forget TerminalPage::_SetFocusedTab(const winrt::TerminalApp::TabBase tab)
|
||||
winrt::fire_and_forget TerminalPage::_SetFocusedTab(const winrt::Microsoft::Terminal::App::TabBase tab)
|
||||
{
|
||||
// GH#1117: This is a workaround because _tabView.SelectedIndex(tabIndex)
|
||||
// sometimes set focus to an incorrect tab after removing some tabs
|
||||
@@ -826,7 +826,7 @@ namespace winrt::TerminalApp::implementation
|
||||
else if (auto index{ _GetFocusedTabIndex() })
|
||||
{
|
||||
const auto tab{ _tabs.GetAt(*index) };
|
||||
if (tab.try_as<TerminalApp::SettingsTab>())
|
||||
if (tab.try_as<Microsoft::Terminal::App::SettingsTab>())
|
||||
{
|
||||
_HandleCloseTabRequested(tab);
|
||||
}
|
||||
@@ -883,7 +883,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - Closes provided tabs one by one
|
||||
// Arguments:
|
||||
// - tabs - tabs to remove
|
||||
winrt::fire_and_forget TerminalPage::_RemoveTabs(const std::vector<winrt::TerminalApp::TabBase> tabs)
|
||||
winrt::fire_and_forget TerminalPage::_RemoveTabs(const std::vector<winrt::Microsoft::Terminal::App::TabBase> tabs)
|
||||
{
|
||||
for (auto& tab : tabs)
|
||||
{
|
||||
@@ -941,7 +941,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
void TerminalPage::_UpdatedSelectedTab(const winrt::TerminalApp::TabBase& tab)
|
||||
void TerminalPage::_UpdatedSelectedTab(const winrt::Microsoft::Terminal::App::TabBase& tab)
|
||||
{
|
||||
// Unfocus all the tabs.
|
||||
for (auto tab : _tabs)
|
||||
@@ -1041,7 +1041,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - tab: tab to bump.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalPage::_UpdateMRUTab(const winrt::TerminalApp::TabBase& tab)
|
||||
void TerminalPage::_UpdateMRUTab(const winrt::Microsoft::Terminal::App::TabBase& tab)
|
||||
{
|
||||
uint32_t mruIndex;
|
||||
if (_mruTabs.IndexOf(tab, mruIndex))
|
||||
@@ -1141,7 +1141,7 @@ namespace winrt::TerminalApp::implementation
|
||||
void TerminalPage::_RemoveAllTabs()
|
||||
{
|
||||
// Since _RemoveTabs is asynchronous, create a snapshot of the tabs we want to remove
|
||||
std::vector<winrt::TerminalApp::TabBase> tabsToRemove;
|
||||
std::vector<winrt::Microsoft::Terminal::App::TabBase> tabsToRemove;
|
||||
std::copy(begin(_tabs), end(_tabs), std::back_inserter(tabsToRemove));
|
||||
_RemoveTabs(tabsToRemove);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "TabPaletteItem.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::App;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::System;
|
||||
@@ -17,9 +17,9 @@ using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
TabPaletteItem::TabPaletteItem(const winrt::TerminalApp::TabBase& tab) :
|
||||
TabPaletteItem::TabPaletteItem(const winrt::Microsoft::Terminal::App::TabBase& tab) :
|
||||
_tab(tab)
|
||||
{
|
||||
Name(tab.Title());
|
||||
@@ -27,7 +27,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
_tabChangedRevoker = tab.PropertyChanged(winrt::auto_revoke, [weakThis{ get_weak() }](auto& sender, auto& e) {
|
||||
auto item{ weakThis.get() };
|
||||
auto senderTab{ sender.try_as<winrt::TerminalApp::TabBase>() };
|
||||
auto senderTab{ sender.try_as<winrt::Microsoft::Terminal::App::TabBase>() };
|
||||
|
||||
if (item && senderTab)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
});
|
||||
|
||||
if (const auto terminalTab{ tab.try_as<winrt::TerminalApp::TerminalTab>() })
|
||||
if (const auto terminalTab{ tab.try_as<winrt::Microsoft::Terminal::App::TerminalTab>() })
|
||||
{
|
||||
const auto status = terminalTab.TabStatus();
|
||||
TabStatus(status);
|
||||
|
||||
@@ -6,28 +6,28 @@
|
||||
#include "PaletteItem.h"
|
||||
#include "TabPaletteItem.g.h"
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
namespace winrt::Microsoft::Terminal::App::implementation
|
||||
{
|
||||
struct TabPaletteItem : TabPaletteItemT<TabPaletteItem, PaletteItem>
|
||||
{
|
||||
TabPaletteItem() = default;
|
||||
TabPaletteItem(const winrt::TerminalApp::TabBase& tab);
|
||||
TabPaletteItem(const winrt::Microsoft::Terminal::App::TabBase& tab);
|
||||
|
||||
winrt::TerminalApp::TabBase Tab() const noexcept
|
||||
winrt::Microsoft::Terminal::App::TabBase Tab() const noexcept
|
||||
{
|
||||
return _tab.get();
|
||||
}
|
||||
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);
|
||||
WINRT_OBSERVABLE_PROPERTY(winrt::Microsoft::Terminal::App::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);
|
||||
|
||||
private:
|
||||
winrt::weak_ref<winrt::TerminalApp::TabBase> _tab;
|
||||
winrt::weak_ref<winrt::Microsoft::Terminal::App::TabBase> _tab;
|
||||
Windows::UI::Xaml::Data::INotifyPropertyChanged::PropertyChanged_revoker _tabChangedRevoker;
|
||||
Windows::UI::Xaml::Data::INotifyPropertyChanged::PropertyChanged_revoker _tabStatusChangedRevoker;
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::factory_implementation
|
||||
namespace winrt::Microsoft::Terminal::App::factory_implementation
|
||||
{
|
||||
BASIC_FACTORY(TabPaletteItem);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user