From 819eae4211554940bcfcb37b1349724748ae1679 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Tue, 1 Oct 2019 14:42:47 -0700 Subject: [PATCH 1/2] Griese PR changes --- src/renderer/uia/UiaRenderer.cpp | 4 +++- src/renderer/uia/lib/sources | 8 -------- 2 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 src/renderer/uia/lib/sources diff --git a/src/renderer/uia/UiaRenderer.cpp b/src/renderer/uia/UiaRenderer.cpp index 85bdf43d2ea..82e9d5ff45b 100644 --- a/src/renderer/uia/UiaRenderer.cpp +++ b/src/renderer/uia/UiaRenderer.cpp @@ -158,6 +158,8 @@ UiaEngine::~UiaEngine() // - S_OK if we started to paint. S_FALSE if we didn't need to paint. [[nodiscard]] HRESULT UiaEngine::StartPaint() noexcept { + RETURN_HR_IF(S_FALSE, !_isEnabled); + // If there's nothing to do, quick return bool somethingToDo = false; @@ -172,7 +174,7 @@ UiaEngine::~UiaEngine() } } - return somethingToDo ? S_OK : S_FALSE; + return S_OK; } // Routine Description: diff --git a/src/renderer/uia/lib/sources b/src/renderer/uia/lib/sources deleted file mode 100644 index 98434b2cc9f..00000000000 --- a/src/renderer/uia/lib/sources +++ /dev/null @@ -1,8 +0,0 @@ -!include ..\sources.inc - -# ------------------------------------- -# Program Information -# ------------------------------------- - -TARGETNAME = ConRenderUia -TARGETTYPE = LIBRARY From c70b7ddad1a14aa6a3f8e0713e1f905d924d3129 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Mon, 14 Oct 2019 20:39:56 -0700 Subject: [PATCH 2/2] Niksa PR Changes --- src/renderer/uia/UiaRenderer.cpp | 22 ++++++---------------- src/renderer/uia/UiaRenderer.hpp | 7 ++----- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/renderer/uia/UiaRenderer.cpp b/src/renderer/uia/UiaRenderer.cpp index 82e9d5ff45b..d37de337a73 100644 --- a/src/renderer/uia/UiaRenderer.cpp +++ b/src/renderer/uia/UiaRenderer.cpp @@ -16,11 +16,7 @@ using namespace Microsoft::Console::Types; UiaEngine::UiaEngine() noexcept : _isPainting{ false }, _isEnabled{ false }, - RenderEngineBase() {} - -// Routine Description: -// - Destroys an instance of the UIA engine -UiaEngine::~UiaEngine() + RenderEngineBase() { } @@ -165,7 +161,6 @@ UiaEngine::~UiaEngine() if (_isEnabled) { - // TODO CARLOS: change value if necessary somethingToDo = false; if (somethingToDo) @@ -191,7 +186,7 @@ UiaEngine::~UiaEngine() { _isPainting = false; - // TODO CARLOS: fire UIA events + // fire UIA events here } return S_OK; @@ -240,7 +235,7 @@ UiaEngine::~UiaEngine() // - coord - Character coordinate position in the cell grid // - fTrimLeft - Whether or not to trim off the left half of a double wide character // Return Value: -// - S_OK or relevant DirectX error +// - E_NOTIMPL [[nodiscard]] HRESULT UiaEngine::PaintBufferLine(std::basic_string_view const /*clusters*/, COORD const /*coord*/, const bool /*trimLeft*/) noexcept @@ -285,7 +280,7 @@ UiaEngine::~UiaEngine() // Arguments: // - options - Packed options relevant to how to draw the cursor // Return Value: -// - S_OK or relevant DirectX error. +// - S_FALSE [[nodiscard]] HRESULT UiaEngine::PaintCursor(const IRenderEngine::CursorOptions& /*options*/) noexcept { return S_FALSE; @@ -320,7 +315,6 @@ UiaEngine::~UiaEngine() // - S_FALSE since we do nothing [[nodiscard]] HRESULT UiaEngine::UpdateFont(const FontInfoDesired& /*pfiFontInfoDesired*/, FontInfo& /*fiFontInfo*/) noexcept { - // TODO CARLOS: changing the size may be useful return E_NOTIMPL; } @@ -333,20 +327,17 @@ UiaEngine::~UiaEngine() // - S_OK [[nodiscard]] HRESULT UiaEngine::UpdateDpi(int const /*iDpi*/) noexcept { - // TODO CARLOS: changing the size may be useful return E_NOTIMPL; } // Method Description: // - This method will update our internal reference for how big the viewport is. -// Does nothing for DX. // Arguments: // - srNewViewport - The bounds of the new viewport. // Return Value: // - HRESULT S_OK [[nodiscard]] HRESULT UiaEngine::UpdateViewport(const SMALL_RECT /*srNewViewport*/) noexcept { - // TODO CARLOS: not sure how to handle resizing just yet return E_NOTIMPL; } @@ -362,7 +353,6 @@ UiaEngine::~UiaEngine() FontInfo& /*pfiFontInfo*/, int const /*iDpi*/) noexcept { - // TODO CARLOS: changing the size may be useful return S_FALSE; } @@ -375,7 +365,7 @@ UiaEngine::~UiaEngine() // - Rectangle describing dirty area in characters. [[nodiscard]] SMALL_RECT UiaEngine::GetDirtyRectInChars() noexcept { - return {}; + return Viewport::Empty().ToInclusive(); } // Routine Description: @@ -395,7 +385,7 @@ UiaEngine::~UiaEngine() // - glyph - The glyph run to process for column width. // - pResult - True if it should take two columns. False if it should take one. // Return Value: -// - S_OK or relevant DirectWrite error. +// - E_NOTIMPL [[nodiscard]] HRESULT UiaEngine::IsGlyphWideByFont(const std::wstring_view /*glyph*/, _Out_ bool* const /*pResult*/) noexcept { return E_NOTIMPL; diff --git a/src/renderer/uia/UiaRenderer.hpp b/src/renderer/uia/UiaRenderer.hpp index 24ef1192aa6..9d625d8c9eb 100644 --- a/src/renderer/uia/UiaRenderer.hpp +++ b/src/renderer/uia/UiaRenderer.hpp @@ -25,13 +25,10 @@ namespace Microsoft::Console::Render { public: UiaEngine() noexcept; - ~UiaEngine(); - UiaEngine(const UiaEngine&) = default; - UiaEngine(UiaEngine&&) = default; - UiaEngine& operator=(const UiaEngine&) = default; - UiaEngine& operator=(UiaEngine&&) = default; // Only one UiaEngine may present information at a time. + // This ensures that an automation client isn't overwhelmed + // by events when there are multiple TermControls [[nodiscard]] HRESULT Enable() noexcept; [[nodiscard]] HRESULT Disable() noexcept;