Accessibility: TermControl Automation Peer (#2083)

Builds on the work of #1691 and #1915 

Let's start with the easy change:
- `TermControl`'s `controlRoot` was removed. `TermControl` is a `UserControl`
  now.

Ok. Now we've got a story to tell here....

### TermControlAP - the Automation Peer
Here's an in-depth guide on custom automation peers:
https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers

We have a custom XAML element (TermControl). So XAML can't really hold our
hands and determine an accessible behavior for us. So this automation peer is
responsible for enabling that interaction.

We made it a FrameworkElementAutomationPeer to get as much accessibility as
possible from it just being a XAML element (i.e.: where are we on the screen?
what are my dimensions?). This is recommended. Any functions with "Core" at the
end, are overwritten here to tweak this automation peer into what we really
need.

But what kind of interactions can a user expect from this XAML element?
Introducing ControlPatterns! There's a ton of interfaces that just define "what
can I do". Thankfully, we already know that we're supposed to be
`ScreenInfoUiaProvider` and that was an `ITextProvider`, so let's just make the
TermControlAP an `ITextProvider` too.

So now we have a way to define what accessible actions can be performed on us,
but what should those actions do? Well let's just use the automation providers
from ConHost that are now in a shared space! (Note: this is a great place to
stop and get some coffee. We're about to hop into the .cpp file in the next
section)


### Wrapping our shared Automation Providers

Unfortunately, we can't just use the automation providers from ConHost. Or, at
least not just hook them up as easily as we wish. ConHost's UIA Providers were
written using UIAutomationCore and ITextRangeProiuder. XAML's interfaces
ITextProvider and ITextRangeProvider are lined up to be exactly the same.

So we need to wrap our ConHost UIA Providers (UIAutomationCore) with the XAML
ones. We had two providers, so that means we have two wrappers.

#### TermControlAP (XAML) <----> ScreenInfoUiaProvider (UIAutomationCore)
Each of the functions in the pragma region `ITextProvider` for
TermControlAP.cpp is just wrapping what we do in `ScreenInfoUiaProvider`, and
returning an acceptable version of it.

Most of `ScreenInfoUiaProvider`'s functions return `UiaTextRange`s. So we need
to wrap that too. That's this next section...

#### XamlUiaTextRange (XAML) <----> UiaTextRange (UIAutomationCore)
Same idea.  We're wrapping everything that we could do with `UiaTextRange` and
putting it inside of `XamlUiaTextRange`.


### Additional changes to `UiaTextRange` and `ScreenInfoUiaProvider`
If you don't know what I just said, please read this background:
- #1691: how accessibility works and the general responsibility of these two
  classes
- #1915: how we pulled these Accessibility Providers into a shared area

TL;DR: `ScreenInfoUiaProvider` lets you interact with the displayed text.
`UiaTextRange` is specific ranges of text in the display and navigate the text.

Thankfully, we didn't do many changes here. I feel like some of it is hacked
together but now that we have a somewhat working system, making changes
shouldn't be too hard...I hope.

#### UiaTextRange
We don't have access to the window handle. We really only need it to draw the
bounding rects using WinUser's `ScreenToClient()` and `ClientToScreen()`. I
need to figure out how to get around this.

In the meantime, I made the window handle optional. And if we don't have
one....well, we need to figure that out. But other than that, we have a
`UiaTextRange`.

#### ScreenInfoUiaProvider
At some point, we need to hook up this automation provider to the
WindowUiaProvider. This should help with navigation of the UIA Tree and make
everything just look waaaay better. For now, let's just do the same approach
and make the pUiaParent optional.

This one's the one I'm not that proud of, but it works. We need the parent to
get a bounding rect of the terminal. While we figure out how to attach the
WindowUiaProvider, we should at the very least be able to get a bunch of info
from our xaml automation peer. So, I've added a _getBoundingRect optional
function. This is what's called when we don't have a WindowUiaProvider as our
parent.


## Validation Steps Performed
I've been using inspect.exe to see the UIA tree.
I was able to interact with the terminal mostly fine. A few known issues below.

Unfortunately, I tried running Narrator on this and it didn't seem to like it
(by that I mean WT crashed). Then again, I don't really know how to use
narrator other than "click on object" --> "listen voice". I feel like there's a
way to get the other interactions with narrator, but I'll be looking into more
of that soon. I bet if I fix the two issues below, Narrator will be happy.

## Miscellaneous Known Issues
- `GetSelection()` and `GetVisibleRanges()` crashes. I need to debug through
  these. I want to include them in this PR.

Fixes #1353.
This commit is contained in:
Carlos Zamora 2019-07-30 16:43:10 -07:00 committed by Dustin L. Howett (MSFT)
parent 1afab788ab
commit a08666b58e
20 changed files with 814 additions and 89 deletions

View file

@ -881,7 +881,7 @@ namespace winrt::TerminalApp::implementation
_UpdateTitle(tab);
});
term.GetControl().GotFocus([this, weakTabPtr](auto&&, auto&&) {
term.GotFocus([this, weakTabPtr](auto&&, auto&&) {
auto tab = weakTabPtr.lock();
if (!tab)
{

View file

@ -19,7 +19,7 @@ Pane::Pane(const GUID& profile, const TermControl& control, const bool lastFocus
_lastFocused{ lastFocused },
_profile{ profile }
{
_root.Children().Append(_control.GetControl());
_root.Children().Append(_control);
_connectionClosedToken = _control.ConnectionClosed({ this, &Pane::_ControlClosedHandler });
// Set the background of the pane to match that of the theme's default grid
@ -426,7 +426,7 @@ bool Pane::_HasFocusedChild() const noexcept
// We're intentionally making this one giant expression, so the compiler
// will skip the following lookups if one of the lookups before it returns
// true
return (_control && _control.GetControl().FocusState() != FocusState::Unfocused) ||
return (_control && _control.FocusState() != FocusState::Unfocused) ||
(_firstChild && _firstChild->_HasFocusedChild()) ||
(_secondChild && _secondChild->_HasFocusedChild());
}
@ -445,7 +445,7 @@ void Pane::UpdateFocus()
if (_IsLeaf())
{
const auto controlFocused = _control &&
_control.GetControl().FocusState() != FocusState::Unfocused;
_control.FocusState() != FocusState::Unfocused;
_lastFocused = controlFocused;
}
@ -468,7 +468,7 @@ void Pane::_FocusFirstChild()
{
if (_IsLeaf())
{
_control.GetControl().Focus(FocusState::Programmatic);
_control.Focus(FocusState::Programmatic);
}
else
{
@ -564,11 +564,11 @@ void Pane::_CloseChild(const bool closeFirst)
_separatorRoot = { nullptr };
// Reattach the TermControl to our grid.
_root.Children().Append(_control.GetControl());
_root.Children().Append(_control);
if (_lastFocused)
{
_control.GetControl().Focus(FocusState::Programmatic);
_control.Focus(FocusState::Programmatic);
}
_splitState = SplitState::None;

View file

@ -124,7 +124,7 @@ void Tab::_Focus()
auto lastFocusedControl = _rootPane->GetFocusedTerminalControl();
if (lastFocusedControl)
{
lastFocusedControl.GetControl().Focus(FocusState::Programmatic);
lastFocusedControl.Focus(FocusState::Programmatic);
}
}
@ -181,7 +181,7 @@ void Tab::SetTabText(const winrt::hstring& text)
void Tab::Scroll(const int delta)
{
auto control = GetFocusedTerminalControl();
control.GetControl().Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [control, delta]() {
control.Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [control, delta]() {
const auto currentOffset = control.GetScrollOffset();
control.KeyboardScrollViewport(currentOffset + delta);
});

View file

@ -11,6 +11,7 @@
#include "..\..\types\inc\GlyphWidth.hpp"
#include "TermControl.g.cpp"
#include "TermControlAutomationPeer.h"
using namespace ::Microsoft::Console::Types;
using namespace ::Microsoft::Terminal::Core;
@ -30,7 +31,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
_connection{ connection },
_initializedTerminal{ false },
_root{ nullptr },
_controlRoot{ nullptr },
_swapChainPanel{ nullptr },
_settings{ settings },
_closing{ false },
@ -52,11 +52,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
void TermControl::_Create()
{
// Create a dummy UserControl to use as the "root" of our control we'll
// build manually.
Controls::UserControl myControl;
_controlRoot = myControl;
Controls::Grid container;
Controls::ColumnDefinition contentColumn{};
@ -108,20 +103,20 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
_bgImageLayer = bgImageLayer;
_swapChainPanel = swapChainPanel;
_controlRoot.Content(_root);
this->Content(_root);
_ApplyUISettings();
// These are important:
// 1. When we get tapped, focus us
_controlRoot.Tapped([this](auto&, auto& e) {
_controlRoot.Focus(FocusState::Pointer);
this->Tapped([this](auto&, auto& e) {
this->Focus(FocusState::Pointer);
e.Handled(true);
});
// 2. Make sure we can be focused (why this isn't `Focusable` I'll never know)
_controlRoot.IsTabStop(true);
this->IsTabStop(true);
// 3. Actually not sure about this one. Maybe it isn't necessary either.
_controlRoot.AllowFocusOnInteraction(true);
this->AllowFocusOnInteraction(true);
// DON'T CALL _InitializeTerminal here - wait until the swap chain is loaded to do that.
@ -345,14 +340,16 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
Close();
}
UIElement TermControl::GetRoot()
Windows::UI::Xaml::Automation::Peers::AutomationPeer TermControl::OnCreateAutomationPeer()
{
return _root;
// create a custom automation peer with this code pattern:
// (https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
return winrt::make<winrt::Microsoft::Terminal::TerminalControl::implementation::TermControlAutomationPeer>(*this);
}
Controls::UserControl TermControl::GetControl()
::Microsoft::Console::Render::IRenderData* TermControl::GetRenderData() const
{
return _controlRoot;
return _terminal.get();
}
void TermControl::SwapChainChanged()
@ -506,9 +503,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
// through CharacterRecieved.
// I don't believe there's a difference between KeyDown and
// PreviewKeyDown for our purposes
// These two handlers _must_ be on _controlRoot, not _root.
_controlRoot.PreviewKeyDown({ this, &TermControl::_KeyDownHandler });
_controlRoot.CharacterReceived({ this, &TermControl::_CharacterHandler });
// These two handlers _must_ be on this, not _root.
this->PreviewKeyDown({ this, &TermControl::_KeyDownHandler });
this->CharacterReceived({ this, &TermControl::_CharacterHandler });
auto pfnTitleChanged = std::bind(&TermControl::_TerminalTitleChanged, this, std::placeholders::_1);
_terminal->SetTitleChangedCallback(pfnTitleChanged);
@ -542,14 +539,14 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
// import value from WinUser (convert from milli-seconds to micro-seconds)
_multiClickTimer = GetDoubleClickTime() * 1000;
_gotFocusRevoker = _controlRoot.GotFocus(winrt::auto_revoke, { this, &TermControl::_GotFocusHandler });
_lostFocusRevoker = _controlRoot.LostFocus(winrt::auto_revoke, { this, &TermControl::_LostFocusHandler });
_gotFocusRevoker = this->GotFocus(winrt::auto_revoke, { this, &TermControl::_GotFocusHandler });
_lostFocusRevoker = this->LostFocus(winrt::auto_revoke, { this, &TermControl::_LostFocusHandler });
// Focus the control here. If we do it up above (in _Create_), then the
// focus won't actually get passed to us. I believe this is because
// we're not technically a part of the UI tree yet, so focusing us
// becomes a no-op.
_controlRoot.Focus(FocusState::Programmatic);
this->Focus(FocusState::Programmatic);
_connection.Start();
_initializedTerminal = true;

View file

@ -35,8 +35,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
TermControl();
TermControl(Settings::IControlSettings settings, TerminalConnection::ITerminalConnection connection);
Windows::UI::Xaml::UIElement GetRoot();
Windows::UI::Xaml::Controls::UserControl GetControl();
void UpdateSettings(Settings::IControlSettings newSettings);
hstring Title();
@ -55,6 +53,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
void SwapChainChanged();
~TermControl();
Windows::UI::Xaml::Automation::Peers::AutomationPeer OnCreateAutomationPeer();
::Microsoft::Console::Render::IRenderData* GetRenderData() const;
static Windows::Foundation::Point GetProposedDimensions(Microsoft::Terminal::Settings::IControlSettings const& settings, const uint32_t dpi);
// clang-format off
@ -71,7 +72,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
TerminalConnection::ITerminalConnection _connection;
bool _initializedTerminal;
Windows::UI::Xaml::Controls::UserControl _controlRoot;
Windows::UI::Xaml::Controls::Grid _root;
Windows::UI::Xaml::Controls::Image _bgImageLayer;
Windows::UI::Xaml::Controls::SwapChainPanel _swapChainPanel;

View file

@ -14,15 +14,13 @@ namespace Microsoft.Terminal.TerminalControl
}
[default_interface]
runtimeclass TermControl
runtimeclass TermControl : Windows.UI.Xaml.Controls.UserControl
{
TermControl();
TermControl(Microsoft.Terminal.Settings.IControlSettings settings, Microsoft.Terminal.TerminalConnection.ITerminalConnection connection);
static Windows.Foundation.Point GetProposedDimensions(Microsoft.Terminal.Settings.IControlSettings settings, UInt32 dpi);
Windows.UI.Xaml.UIElement GetRoot();
Windows.UI.Xaml.Controls.UserControl GetControl();
void UpdateSettings(Microsoft.Terminal.Settings.IControlSettings newSettings);
event TitleChangedEventArgs TitleChanged;

View file

@ -0,0 +1,154 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include <UIAutomationCore.h>
#include "TermControlAutomationPeer.h"
#include "TermControl.h"
#include "TermControlAutomationPeer.g.cpp"
#include "XamlUiaTextRange.h"
using namespace Microsoft::Console::Types;
using namespace winrt::Windows::UI::Xaml::Automation::Peers;
namespace UIA
{
using ::ITextRangeProvider;
using ::SupportedTextSelection;
}
namespace XamlAutomation
{
using winrt::Windows::UI::Xaml::Automation::SupportedTextSelection;
using winrt::Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple;
using winrt::Windows::UI::Xaml::Automation::Provider::ITextRangeProvider;
}
namespace winrt::Microsoft::Terminal::TerminalControl::implementation
{
TermControlAutomationPeer::TermControlAutomationPeer(winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl const& owner) :
TermControlAutomationPeerT<TermControlAutomationPeer>(owner), // pass owner to FrameworkElementAutomationPeer
_uiaProvider{ owner.GetRenderData(), nullptr, std::bind(&TermControlAutomationPeer::GetBoundingRectWrapped, this) } {};
winrt::hstring TermControlAutomationPeer::GetClassNameCore() const
{
return L"TermControl";
}
AutomationControlType TermControlAutomationPeer::GetAutomationControlTypeCore() const
{
return AutomationControlType::Text;
}
winrt::hstring TermControlAutomationPeer::GetLocalizedControlTypeCore() const
{
// TODO GitHub #2142: Localize string
return L"TerminalControl";
}
winrt::Windows::Foundation::IInspectable TermControlAutomationPeer::GetPatternCore(PatternInterface patternInterface) const
{
switch (patternInterface)
{
case PatternInterface::Text:
return *this;
break;
default:
return nullptr;
}
}
#pragma region ITextProvider
winrt::com_array<XamlAutomation::ITextRangeProvider> TermControlAutomationPeer::GetSelection()
{
SAFEARRAY* pReturnVal;
THROW_IF_FAILED(_uiaProvider.GetSelection(&pReturnVal));
return WrapArrayOfTextRangeProviders(pReturnVal);
}
winrt::com_array<XamlAutomation::ITextRangeProvider> TermControlAutomationPeer::GetVisibleRanges()
{
SAFEARRAY* pReturnVal;
THROW_IF_FAILED(_uiaProvider.GetVisibleRanges(&pReturnVal));
return WrapArrayOfTextRangeProviders(pReturnVal);
}
XamlAutomation::ITextRangeProvider TermControlAutomationPeer::RangeFromChild(XamlAutomation::IRawElementProviderSimple childElement)
{
UIA::ITextRangeProvider* returnVal;
// ScreenInfoUiaProvider doesn't actually use parameter, so just pass in nullptr
THROW_IF_FAILED(_uiaProvider.RangeFromChild(/* IRawElementProviderSimple */ nullptr,
&returnVal));
auto parentProvider = this->ProviderFromPeer(*this);
auto xutr = winrt::make_self<XamlUiaTextRange>(returnVal, parentProvider);
return xutr.as<XamlAutomation::ITextRangeProvider>();
}
XamlAutomation::ITextRangeProvider TermControlAutomationPeer::RangeFromPoint(Windows::Foundation::Point screenLocation)
{
UIA::ITextRangeProvider* returnVal;
THROW_IF_FAILED(_uiaProvider.RangeFromPoint({ screenLocation.X, screenLocation.Y }, &returnVal));
auto parentProvider = this->ProviderFromPeer(*this);
auto xutr = winrt::make_self<XamlUiaTextRange>(returnVal, parentProvider);
return xutr.as<XamlAutomation::ITextRangeProvider>();
}
XamlAutomation::ITextRangeProvider TermControlAutomationPeer::DocumentRange()
{
UIA::ITextRangeProvider* returnVal;
THROW_IF_FAILED(_uiaProvider.get_DocumentRange(&returnVal));
auto parentProvider = this->ProviderFromPeer(*this);
auto xutr = winrt::make_self<XamlUiaTextRange>(returnVal, parentProvider);
return xutr.as<XamlAutomation::ITextRangeProvider>();
}
Windows::UI::Xaml::Automation::SupportedTextSelection TermControlAutomationPeer::SupportedTextSelection()
{
UIA::SupportedTextSelection returnVal;
THROW_IF_FAILED(_uiaProvider.get_SupportedTextSelection(&returnVal));
return static_cast<XamlAutomation::SupportedTextSelection>(returnVal);
}
#pragma endregion
RECT TermControlAutomationPeer::GetBoundingRectWrapped()
{
auto rect = GetBoundingRectangle();
return {
gsl::narrow<LONG>(rect.X),
gsl::narrow<LONG>(rect.Y),
gsl::narrow<LONG>(rect.X + rect.Width),
gsl::narrow<LONG>(rect.Y + rect.Height)
};
}
// Method Description:
// - extracts the UiaTextRanges from the SAFEARRAY and converts them to Xaml ITextRangeProviders
// Arguments:
// - SAFEARRAY of UIA::UiaTextRange (ITextRangeProviders)
// Return Value:
// - com_array of Xaml Wrapped UiaTextRange (ITextRangeProviders)
winrt::com_array<XamlAutomation::ITextRangeProvider> TermControlAutomationPeer::WrapArrayOfTextRangeProviders(SAFEARRAY* textRanges)
{
// transfer ownership of UiaTextRanges to this new vector
auto providers = SafeArrayToOwningVector<::Microsoft::Console::Types::UiaTextRange>(textRanges);
int count = providers.size();
std::vector<XamlAutomation::ITextRangeProvider> vec;
vec.reserve(count);
auto parentProvider = this->ProviderFromPeer(*this);
for (int i = 0; i < count; i++)
{
auto xutr = winrt::make_self<XamlUiaTextRange>(providers[i].detach(), parentProvider);
vec.emplace_back(xutr.as<XamlAutomation::ITextRangeProvider>());
}
winrt::com_array<XamlAutomation::ITextRangeProvider> result{ vec };
return result;
}
}

View file

@ -0,0 +1,63 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- TermControlAutomationPeer.h
Abstract:
- This module provides UI Automation access to the TermControl
to support both automation tests and accessibility (screen
reading) applications. This mainly interacts with ScreenInfoUiaProvider
to allow for shared code between ConHost and Windows Terminal
accessibility providers.
- Based on the Custom Automation Peers guide on msdn
(https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
- Wraps the UIAutomationCore ITextProvider
(https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/nn-uiautomationcore-itextprovider)
with a XAML ITextProvider
(https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.automation.provider.itextprovider)
Author(s):
- Carlos Zamora (CaZamor) 2019
--*/
#pragma once
#include "TermControl.h"
#include "TermControlAutomationPeer.g.h"
#include <winrt/Microsoft.Terminal.TerminalControl.h>
#include "../../renderer/inc/IRenderData.hpp"
#include "../types/ScreenInfoUiaProvider.h"
#include "../types/WindowUiaProviderBase.hpp"
namespace winrt::Microsoft::Terminal::TerminalControl::implementation
{
struct TermControlAutomationPeer :
public TermControlAutomationPeerT<TermControlAutomationPeer>
{
public:
TermControlAutomationPeer(winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl const& owner);
winrt::hstring GetClassNameCore() const;
winrt::Windows::UI::Xaml::Automation::Peers::AutomationControlType GetAutomationControlTypeCore() const;
winrt::hstring GetLocalizedControlTypeCore() const;
winrt::Windows::Foundation::IInspectable GetPatternCore(winrt::Windows::UI::Xaml::Automation::Peers::PatternInterface patternInterface) const;
#pragma region ITextProvider Pattern
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider RangeFromPoint(Windows::Foundation::Point screenLocation);
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider RangeFromChild(Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple childElement);
winrt::com_array<Windows::UI::Xaml::Automation::Provider::ITextRangeProvider> GetVisibleRanges();
winrt::com_array<Windows::UI::Xaml::Automation::Provider::ITextRangeProvider> GetSelection();
Windows::UI::Xaml::Automation::SupportedTextSelection SupportedTextSelection();
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider DocumentRange();
#pragma endregion
RECT GetBoundingRectWrapped();
private:
::Microsoft::Console::Types::ScreenInfoUiaProvider _uiaProvider;
winrt::com_array<Windows::UI::Xaml::Automation::Provider::ITextRangeProvider> WrapArrayOfTextRangeProviders(SAFEARRAY* textRanges);
};
}

View file

@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "TermControl.idl";
namespace Microsoft.Terminal.TerminalControl
{
[default_interface]
runtimeclass TermControlAutomationPeer :
Windows.UI.Xaml.Automation.Peers.FrameworkElementAutomationPeer,
Windows.UI.Xaml.Automation.Provider.ITextProvider
{
}
}

View file

@ -20,6 +20,10 @@
<ClInclude Include="TermControl.h">
<DependentUpon>TermControl.idl</DependentUpon>
</ClInclude>
<ClInclude Include="TermControlAutomationPeer.h">
<DependentUpon>TermControlAutomationPeer.idl</DependentUpon>
</ClInclude>
<ClInclude Include="XamlUiaTextRange.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
@ -30,9 +34,14 @@
<DependentUpon>TermControl.idl</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="TermControlAutomationPeer.cpp">
<DependentUpon>TermControlAutomationPeer.idl</DependentUpon>
</ClCompile>
<ClCompile Include="XamlUiaTextRange.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="TermControl.idl" />
<Midl Include="TermControlAutomationPeer.idl" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@ -50,7 +59,7 @@
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalCore\lib\TerminalCore-lib.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" >
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</ProjectReference>

View file

@ -11,20 +11,20 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="KeyChord.cpp" />
<ClCompile Include="TermControl.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="TermControlAutomationPeer.cpp" />
<ClCompile Include="XamlUiaTextRange.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="KeyChord.h" />
<ClInclude Include="TermControl.h" />
<ClInclude Include="TermControlAP.h" />
<ClInclude Include="XamlUiaTextRange.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="TermControl.idl" />
<Midl Include="KeyChord.idl" />
<Midl Include="IKeyBindings.idl" />
<Midl Include="IControlSettings.idl" />
<Midl Include="TermControlAutomationPeer.idl" />
</ItemGroup>
<ItemGroup>
<None Include="TerminalControl.def" />
@ -33,4 +33,4 @@
<ItemGroup>
<Natvis Include="$(SolutionDir)tools\ConsoleTypes.natvis" />
</ItemGroup>
</Project>
</Project>

View file

@ -0,0 +1,199 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "XamlUiaTextRange.h"
#include "../types/UiaTextRange.hpp"
namespace UIA
{
using ::ITextRangeProvider;
using ::SupportedTextSelection;
using ::TextPatternRangeEndpoint;
using ::TextUnit;
}
namespace XamlAutomation
{
using winrt::Windows::UI::Xaml::Automation::SupportedTextSelection;
using winrt::Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple;
using winrt::Windows::UI::Xaml::Automation::Provider::ITextRangeProvider;
using winrt::Windows::UI::Xaml::Automation::Text::TextPatternRangeEndpoint;
using winrt::Windows::UI::Xaml::Automation::Text::TextUnit;
}
namespace winrt::Microsoft::Terminal::TerminalControl::implementation
{
XamlAutomation::ITextRangeProvider XamlUiaTextRange::Clone() const
{
UIA::ITextRangeProvider* pReturn;
THROW_IF_FAILED(_uiaProvider->Clone(&pReturn));
auto xutr = winrt::make_self<XamlUiaTextRange>(pReturn, _parentProvider);
return xutr.as<XamlAutomation::ITextRangeProvider>();
}
bool XamlUiaTextRange::Compare(XamlAutomation::ITextRangeProvider pRange) const
{
auto self = winrt::get_self<XamlUiaTextRange>(pRange);
BOOL returnVal;
THROW_IF_FAILED(_uiaProvider->Compare(self->_uiaProvider.get(), &returnVal));
return returnVal;
}
int32_t XamlUiaTextRange::CompareEndpoints(XamlAutomation::TextPatternRangeEndpoint endpoint,
XamlAutomation::ITextRangeProvider pTargetRange,
XamlAutomation::TextPatternRangeEndpoint targetEndpoint)
{
auto self = winrt::get_self<XamlUiaTextRange>(pTargetRange);
int32_t returnVal;
THROW_IF_FAILED(_uiaProvider->CompareEndpoints(static_cast<UIA::TextPatternRangeEndpoint>(endpoint),
self->_uiaProvider.get(),
static_cast<UIA::TextPatternRangeEndpoint>(targetEndpoint),
&returnVal));
return returnVal;
}
void XamlUiaTextRange::ExpandToEnclosingUnit(XamlAutomation::TextUnit unit) const
{
THROW_IF_FAILED(_uiaProvider->ExpandToEnclosingUnit(static_cast<UIA::TextUnit>(unit)));
}
XamlAutomation::ITextRangeProvider XamlUiaTextRange::FindAttribute(int32_t textAttributeId,
winrt::Windows::Foundation::IInspectable val,
bool searchBackward)
{
// TODO GitHub #2161: potential accessibility improvement
// we don't support this currently
throw winrt::hresult_not_implemented();
}
XamlAutomation::ITextRangeProvider XamlUiaTextRange::FindText(winrt::hstring text,
bool searchBackward,
bool ignoreCase)
{
// TODO GitHub #605: Search functionality
// we need to wrap this around the UiaTextRange FindText() function
// but right now it returns E_NOTIMPL, so let's just return nullptr for now.
throw winrt::hresult_not_implemented();
}
winrt::Windows::Foundation::IInspectable XamlUiaTextRange::GetAttributeValue(int32_t textAttributeId) const
{
// Copied functionality from Types::UiaTextRange.cpp
if (textAttributeId == UIA_IsReadOnlyAttributeId)
{
return winrt::box_value(false);
}
else
{
return nullptr;
}
}
void XamlUiaTextRange::GetBoundingRectangles(com_array<double>& returnValue) const
{
returnValue = {};
try
{
SAFEARRAY* pReturnVal;
THROW_IF_FAILED(_uiaProvider->GetBoundingRectangles(&pReturnVal));
double* pVals;
THROW_IF_FAILED(SafeArrayAccessData(pReturnVal, (void**)&pVals));
long lBound, uBound;
THROW_IF_FAILED(SafeArrayGetLBound(pReturnVal, 1, &lBound));
THROW_IF_FAILED(SafeArrayGetUBound(pReturnVal, 1, &uBound));
long count = uBound - lBound + 1;
std::vector<double> vec;
vec.reserve(count);
for (int i = 0; i < count; i++)
{
double element = pVals[i];
vec.push_back(element);
}
winrt::com_array<double> result{ vec };
returnValue = std::move(result);
}
catch (...)
{
}
}
XamlAutomation::IRawElementProviderSimple XamlUiaTextRange::GetEnclosingElement()
{
return _parentProvider;
}
winrt::hstring XamlUiaTextRange::GetText(int32_t maxLength) const
{
BSTR returnVal;
THROW_IF_FAILED(_uiaProvider->GetText(maxLength, &returnVal));
return winrt::to_hstring(returnVal);
}
int32_t XamlUiaTextRange::Move(XamlAutomation::TextUnit unit,
int32_t count)
{
int returnVal;
THROW_IF_FAILED(_uiaProvider->Move(static_cast<UIA::TextUnit>(unit),
count,
&returnVal));
return returnVal;
}
int32_t XamlUiaTextRange::MoveEndpointByUnit(XamlAutomation::TextPatternRangeEndpoint endpoint,
XamlAutomation::TextUnit unit,
int32_t count) const
{
int returnVal;
THROW_IF_FAILED(_uiaProvider->MoveEndpointByUnit(static_cast<UIA::TextPatternRangeEndpoint>(endpoint),
static_cast<UIA::TextUnit>(unit),
count,
&returnVal));
return returnVal;
}
void XamlUiaTextRange::MoveEndpointByRange(XamlAutomation::TextPatternRangeEndpoint endpoint,
XamlAutomation::ITextRangeProvider pTargetRange,
XamlAutomation::TextPatternRangeEndpoint targetEndpoint) const
{
auto self = winrt::get_self<XamlUiaTextRange>(pTargetRange);
THROW_IF_FAILED(_uiaProvider->MoveEndpointByRange(static_cast<UIA::TextPatternRangeEndpoint>(endpoint),
/*pTargetRange*/ self->_uiaProvider.get(),
static_cast<UIA::TextPatternRangeEndpoint>(targetEndpoint)));
}
void XamlUiaTextRange::Select() const
{
THROW_IF_FAILED(_uiaProvider->Select());
}
void XamlUiaTextRange::AddToSelection() const
{
// we don't support this
throw winrt::hresult_not_implemented();
}
void XamlUiaTextRange::RemoveFromSelection() const
{
// we don't support this
throw winrt::hresult_not_implemented();
}
void XamlUiaTextRange::ScrollIntoView(bool alignToTop) const
{
THROW_IF_FAILED(_uiaProvider->ScrollIntoView(alignToTop));
}
winrt::com_array<XamlAutomation::IRawElementProviderSimple> XamlUiaTextRange::GetChildren() const
{
// we don't have any children
return {};
}
}

View file

@ -0,0 +1,75 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- XamlUiaTextRange.h
Abstract:
- This module is a wrapper for the UiaTextRange
(a text range accessibility provider). It allows
for UiaTextRange to be used in Windows Terminal.
- Wraps the UIAutomationCore ITextRangeProvider
(https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/nn-uiautomationcore-itextrangeprovider)
with a XAML ITextRangeProvider
(https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.automation.provider.itextrangeprovider)
Author(s):
- Carlos Zamora (CaZamor) 2019
--*/
#pragma once
#include "TermControlAutomationPeer.h"
#include <UIAutomationCore.h>
#include "../types/UiaTextRange.hpp"
namespace winrt::Microsoft::Terminal::TerminalControl::implementation
{
class XamlUiaTextRange :
public winrt::implements<XamlUiaTextRange, Windows::UI::Xaml::Automation::Provider::ITextRangeProvider>
{
public:
XamlUiaTextRange(::ITextRangeProvider* uiaProvider, Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple parentProvider) :
_parentProvider{ parentProvider }
{
_uiaProvider.attach(uiaProvider);
}
#pragma region ITextRangeProvider
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider Clone() const;
bool Compare(Windows::UI::Xaml::Automation::Provider::ITextRangeProvider pRange) const;
int32_t CompareEndpoints(Windows::UI::Xaml::Automation::Text::TextPatternRangeEndpoint endpoint,
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider pTargetRange,
Windows::UI::Xaml::Automation::Text::TextPatternRangeEndpoint targetEndpoint);
void ExpandToEnclosingUnit(Windows::UI::Xaml::Automation::Text::TextUnit unit) const;
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider FindAttribute(int32_t textAttributeId,
winrt::Windows::Foundation::IInspectable val,
bool searchBackward);
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider FindText(winrt::hstring text,
bool searchBackward,
bool ignoreCase);
winrt::Windows::Foundation::IInspectable GetAttributeValue(int32_t textAttributeId) const;
void GetBoundingRectangles(winrt::com_array<double>& returnValue) const;
Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple GetEnclosingElement();
winrt::hstring GetText(int32_t maxLength) const;
int32_t Move(Windows::UI::Xaml::Automation::Text::TextUnit unit,
int32_t count);
int32_t MoveEndpointByUnit(Windows::UI::Xaml::Automation::Text::TextPatternRangeEndpoint endpoint,
Windows::UI::Xaml::Automation::Text::TextUnit unit,
int32_t count) const;
void MoveEndpointByRange(Windows::UI::Xaml::Automation::Text::TextPatternRangeEndpoint endpoint,
Windows::UI::Xaml::Automation::Provider::ITextRangeProvider pTargetRange,
Windows::UI::Xaml::Automation::Text::TextPatternRangeEndpoint targetEndpoint) const;
void Select() const;
void AddToSelection() const;
void RemoveFromSelection() const;
void ScrollIntoView(bool alignToTop) const;
winrt::com_array<Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple> GetChildren() const;
#pragma endregion ITextRangeProvider
private:
wil::com_ptr<::ITextRangeProvider> _uiaProvider;
Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple _parentProvider;
};
}

View file

@ -23,6 +23,8 @@
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/windows.ui.core.h>
#include <winrt/Windows.ui.input.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.ui.xaml.media.h>

View file

@ -55,4 +55,34 @@ private:
// Use this if you have a Windows.Foundation.TypedEventHandler
#define DEFINE_EVENT_WITH_TYPED_EVENT_HANDLER(className, name, eventHandler, sender, args) \
winrt::event_token className::name(Windows::Foundation::TypedEventHandler<sender, args> const& handler) { return eventHandler.add(handler); } \
void className::name(winrt::event_token const& token) noexcept { eventHandler.remove(token); }
void className::name(winrt::event_token const& token) noexcept { eventHandler.remove(token); }
// This is a helper method for deserializing a SAFEARRAY of
// COM objects and converting it to a vector that
// owns the extracted COM objects
template<typename T>
std::vector<wil::com_ptr<T>> SafeArrayToOwningVector(SAFEARRAY* safeArray)
{
T** pVals;
THROW_IF_FAILED(SafeArrayAccessData(safeArray, (void**)&pVals));
THROW_HR_IF(E_UNEXPECTED, SafeArrayGetDim(safeArray) != 1);
long lBound, uBound;
THROW_IF_FAILED(SafeArrayGetLBound(safeArray, 1, &lBound));
THROW_IF_FAILED(SafeArrayGetUBound(safeArray, 1, &uBound));
long count = uBound - lBound + 1;
// If any of the above fail, we cannot destruct/release
// any of the elements in the SAFEARRAY because we
// cannot identify how many elements there are.
std::vector<wil::com_ptr<T>> result{ gsl::narrow<std::size_t>(count) };
for (int i = 0; i < count; i++)
{
result[i].attach(pVals[i]);
}
return result;
}

View file

@ -314,16 +314,16 @@ void Window::_UpdateSystemMetrics() const
if (useDx)
{
status = NTSTATUS_FROM_HRESULT(pDxEngine->SetHwnd(hWnd));
status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pDxEngine->SetHwnd(hWnd))));
if (NT_SUCCESS(status))
{
status = NTSTATUS_FROM_HRESULT(pDxEngine->Enable());
status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pDxEngine->Enable())));
}
}
else
{
status = NTSTATUS_FROM_HRESULT(pGdiEngine->SetHwnd(hWnd));
status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pGdiEngine->SetHwnd(hWnd))));
}
if (NT_SUCCESS(status))

View file

@ -31,9 +31,22 @@ SAFEARRAY* BuildIntSafeArray(_In_reads_(length) const int* const data, const int
return psa;
}
ScreenInfoUiaProvider::ScreenInfoUiaProvider(_In_ Microsoft::Console::Render::IRenderData* pData,
_In_ WindowUiaProviderBase* const pUiaParent,
_In_ std::function<RECT(void)> GetBoundingRect) :
_pUiaParent(pUiaParent),
_signalFiringMapping{},
_cRefs(1),
_pData(THROW_HR_IF_NULL(E_INVALIDARG, pData)),
_getBoundingRect(GetBoundingRect)
{
// TODO GitHub #1914: Re-attach Tracing to UIA Tree
//Tracing::s_TraceUia(nullptr, ApiCall::Constructor, nullptr);
}
ScreenInfoUiaProvider::ScreenInfoUiaProvider(_In_ Microsoft::Console::Render::IRenderData* pData,
_In_ WindowUiaProviderBase* const pUiaParent) :
_pUiaParent(THROW_HR_IF_NULL(E_INVALIDARG, pUiaParent)),
_pUiaParent(pUiaParent),
_signalFiringMapping{},
_cRefs(1),
_pData(THROW_HR_IF_NULL(E_INVALIDARG, pData))
@ -253,6 +266,9 @@ IFACEMETHODIMP ScreenInfoUiaProvider::get_HostRawElementProvider(_COM_Outptr_res
IFACEMETHODIMP ScreenInfoUiaProvider::Navigate(_In_ NavigateDirection direction,
_COM_Outptr_result_maybenull_ IRawElementProviderFragment** ppProvider)
{
// TODO GitHub 2120: _pUiaParent should not be allowed to be null
RETURN_HR_IF(E_NOTIMPL, _pUiaParent == nullptr);
// TODO GitHub #1914: Re-attach Tracing to UIA Tree
/*ApiMsgNavigate apiMsg;
apiMsg.Direction = direction;
@ -299,7 +315,16 @@ IFACEMETHODIMP ScreenInfoUiaProvider::get_BoundingRectangle(_Out_ UiaRect* pRect
// TODO GitHub #1914: Re-attach Tracing to UIA Tree
//Tracing::s_TraceUia(this, ApiCall::GetBoundingRectangle, nullptr);
RECT rc = _pUiaParent->GetWindowRect();
RECT rc;
// TODO GitHub 2120: _pUiaParent should not be allowed to be null
if (_pUiaParent == nullptr)
{
rc = _getBoundingRect();
}
else
{
rc = _pUiaParent->GetWindowRect();
}
pRect->left = rc.left;
pRect->top = rc.top;
@ -328,6 +353,9 @@ IFACEMETHODIMP ScreenInfoUiaProvider::SetFocus()
IFACEMETHODIMP ScreenInfoUiaProvider::get_FragmentRoot(_COM_Outptr_result_maybenull_ IRawElementProviderFragmentRoot** ppProvider)
{
// TODO GitHub 2120: _pUiaParent should not be allowed to be null
RETURN_HR_IF(E_NOTIMPL, _pUiaParent == nullptr);
//Tracing::s_TraceUia(this, ApiCall::GetFragmentRoot, nullptr);
try
{
@ -657,10 +685,20 @@ void ScreenInfoUiaProvider::_UnlockConsole() noexcept
HWND ScreenInfoUiaProvider::GetWindowHandle() const
{
// TODO GitHub 2120: _pUiaParent should not be allowed to be null
if (_pUiaParent == nullptr)
{
return nullptr;
}
return _pUiaParent->GetWindowHandle();
}
void ScreenInfoUiaProvider::ChangeViewport(const SMALL_RECT NewWindow)
{
// TODO GitHub 2120: _pUiaParent should not be allowed to be null
if (_pUiaParent == nullptr)
{
return;
}
_pUiaParent->ChangeViewport(NewWindow);
}

View file

@ -36,6 +36,11 @@ namespace Microsoft::Console::Types
public ITextProvider
{
public:
ScreenInfoUiaProvider(_In_ Microsoft::Console::Render::IRenderData* pData,
_In_ WindowUiaProviderBase* const pUiaParent,
_In_ std::function<RECT()> GetBoundingRect);
// TODO GitHub 2120: pUiaParent should not be allowed to be null
ScreenInfoUiaProvider(_In_ Microsoft::Console::Render::IRenderData* pData,
_In_ WindowUiaProviderBase* const pUiaParent);
virtual ~ScreenInfoUiaProvider();
@ -108,6 +113,9 @@ namespace Microsoft::Console::Types
const Viewport _getViewport() const;
void _LockConsole() noexcept;
void _UnlockConsole() noexcept;
// these functions are reserved for Windows Terminal
std::function<RECT(void)> _getBoundingRect;
};
namespace ScreenInfoUiaProviderTracing

View file

@ -307,7 +307,14 @@ UiaTextRange::UiaTextRange(_In_ Microsoft::Console::Render::IRenderData* pData,
{
// change point coords to pixels relative to window
HWND hwnd = _getWindowHandle();
ScreenToClient(hwnd, &clientPoint);
if (hwnd == nullptr)
{
// TODO GitHub #2103: NON-HWND IMPLEMENTATION OF SCREENTOCLIENT()
}
else
{
ScreenToClient(hwnd, &clientPoint);
}
const COORD currentFontSize = _getScreenFontSize();
row = (clientPoint.y / currentFontSize.Y) + viewport.Top;
@ -1495,8 +1502,16 @@ void UiaTextRange::_addScreenInfoRowBoundaries(Microsoft::Console::Render::IRend
// convert the coords to be relative to the screen instead of
// the client window
HWND hwnd = _getWindowHandle();
ClientToScreen(hwnd, &topLeft);
ClientToScreen(hwnd, &bottomRight);
if (hwnd == nullptr)
{
// TODO GitHub #2103: NON-HWND IMPLEMENTATION OF CLIENTTOSCREEN()
}
else
{
ClientToScreen(hwnd, &topLeft);
ClientToScreen(hwnd, &bottomRight);
}
const LONG width = bottomRight.x - topLeft.x;
const LONG height = bottomRight.y - topLeft.y;

View file

@ -1,42 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A3FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52ECFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{77DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\convert.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\MouseEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\FocusEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\IInputEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\KeyEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\MenuEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\ModifierKeyState.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Viewport.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\WindowBufferSizeEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\precomp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CodepointWidthDetector.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\GlyphWidth.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Utf16Parser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\UTF8OutPipeReader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\WindowUiaProvider.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\ScreenInfoUiaProvider.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\UiaTextRange.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\WindowUiaProviderBase.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\inc\IInputEvent.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\Viewport.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\convert.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\precomp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\CodepointWidthDetector.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\Utf16Parser.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\GlyphWidth.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\utils.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\UTF8OutPipeReader.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\WindowUiaProvider.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\IConsoleWindow.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\ScreenInfoUiaProvider.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\UiaTextRange.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\WindowUiaProviderBase.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\IConsoleWindow.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\CodepointWidthDetector.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\convert.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\GlyphWidth.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\IInputEvent.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\UTF8OutPipeReader.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\Viewport.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\Utf16Parser.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\precomp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\ScreenInfoUiaProvider.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\UiaTextRange.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\utils.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\WindowUiaProviderBase.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\IUiaWindow.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Natvis Include="$(SolutionDir)tools\ConsoleTypes.natvis" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\CodepointWidthDetector.cpp" />
<ClCompile Include="..\convert.cpp" />
<ClCompile Include="..\GlyphWidth.cpp" />
<ClCompile Include="..\MouseEvent.cpp" />
<ClCompile Include="..\FocusEvent.cpp" />
<ClCompile Include="..\IInputEvent.cpp" />
<ClCompile Include="..\KeyEvent.cpp" />
<ClCompile Include="..\MenuEvent.cpp" />
<ClCompile Include="..\ModifierKeyState.cpp" />
<ClCompile Include="..\ScreenInfoUiaProvider.cpp" />
<ClCompile Include="..\UiaTextRange.cpp" />
<ClCompile Include="..\Utf16Parser.cpp" />
<ClCompile Include="..\UTF8OutPipeReader.cpp" />
<ClCompile Include="..\Viewport.cpp" />
<ClCompile Include="..\WindowBufferSizeEvent.cpp" />
<ClCompile Include="..\precomp.cpp" />
<ClCompile Include="..\utils.cpp" />
<ClCompile Include="..\WindowUiaProviderBase.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\IConsoleWindow.hpp" />
<ClInclude Include="..\inc\CodepointWidthDetector.hpp" />
<ClInclude Include="..\inc\convert.hpp" />
<ClInclude Include="..\inc\GlyphWidth.hpp" />
<ClInclude Include="..\inc\IInputEvent.hpp" />
<ClInclude Include="..\inc\UTF8OutPipeReader.hpp" />
<ClInclude Include="..\inc\Viewport.hpp" />
<ClInclude Include="..\inc\Utf16Parser.hpp" />
<ClInclude Include="..\precomp.h" />
<ClInclude Include="..\ScreenInfoUiaProvider.h" />
<ClInclude Include="..\UiaTextRange.hpp" />
<ClInclude Include="..\utils.hpp" />
<ClInclude Include="..\WindowUiaProviderBase.hpp" />
<ClInclude Include="..\IUiaWindow.h" />
</ItemGroup>
</Project>
</Project>