terminal/src/cascadia/TerminalControl
Dustin L. Howett 295fa38295
Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658)
This pull request introduces Microsoft.Terminal.Core.Color as an
alternative to both Windows.UI.Color and uint32_t/COLORREF in the
TerminalCore, ...Control, ...SettingsModel and ...SettingsEditor layers.

M.T.C.Color is trivially convertible to/from til::color and therefore
to/from COLORREF, W.U.Color, and any other color representation we might
need².

I've replaced almost every use of W.U.Color and uint32_t-as-color in the
above layers, with minor exception¹.

The need for this work is twofold.

First: We cannot bear a dependency from TerminalCore (which should,
on paper, be Windows 7 compatible) on Windows.UI or any other WinRT
namespace.

This work removes one big dependency on Windows.UI, but it does not go
all the way.

Second: TerminalCore chose to communicate mostly in packed uint32s
(COLORREF), which was inherently lossy and dangerous.

¹ The UI layers (TerminalControl, TerminalApp) still use
Windows.UI.Color as they are intimately connected to the UWP XAML UI.

² In the future, we might even be able to *use* the alpha channel...

## PR Checklist
* [x] I ran into the need for this when I introduced cursor inversion
* [X] Fixes a longstanding itch

## Validation Steps Performed
Built and ran all tests for the impacted layers, even the local ones!
2021-03-30 20:15:49 +00:00
..
dll Fix build break where Microsoft.Terminal.Control.dll is empty (#9537) 2021-03-18 16:14:21 +00:00
Resources/en-US Introduce read-only panes (#8867) 2021-02-08 18:03:55 +00:00
EventArgs.cpp Move events out of TermControl.h ; Use TYPED_EVENT in more places (#9526) 2021-03-18 22:02:39 +00:00
EventArgs.h Move events out of TermControl.h ; Use TYPED_EVENT in more places (#9526) 2021-03-18 22:02:39 +00:00
EventArgs.idl Move events out of TermControl.h ; Use TYPED_EVENT in more places (#9526) 2021-03-18 22:02:39 +00:00
IControlSettings.idl Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
IDirectKeyListener.idl Move events out of TermControl.h ; Use TYPED_EVENT in more places (#9526) 2021-03-18 22:02:39 +00:00
IKeyBindings.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
IMouseWheelListener.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
init.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
KeyChord.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
KeyChord.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
KeyChord.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
packages.config Update C++/WinRT to 2.0.210309.3 (#9437) 2021-03-10 16:04:59 -06:00
pch.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
pch.h Move events out of TermControl.h ; Use TYPED_EVENT in more places (#9526) 2021-03-18 22:02:39 +00:00
SearchBoxControl.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
SearchBoxControl.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
SearchBoxControl.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
SearchBoxControl.xaml Auto-format our XAML files and enforce in CI (#9589) 2021-03-29 17:09:38 -05:00
TermControl.cpp Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
TermControl.h Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
TermControl.idl Move events out of TermControl.h ; Use TYPED_EVENT in more places (#9526) 2021-03-18 22:02:39 +00:00
TermControl.xaml Auto-format our XAML files and enforce in CI (#9589) 2021-03-29 17:09:38 -05:00
TermControlAutomationPeer.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
TermControlAutomationPeer.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
TermControlAutomationPeer.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
TerminalControlLib.vcxproj Move events out of TermControl.h ; Use TYPED_EVENT in more places (#9526) 2021-03-18 22:02:39 +00:00
ThrottledFunc.cpp Set memory order on slow atomics (#6920) 2020-07-17 17:11:45 +00:00
ThrottledFunc.h Update _TerminalCursorPositionChanged to use ThrottledFunc (#6492) 2020-06-23 14:05:40 -07:00
TSFInputControl.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
TSFInputControl.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
TSFInputControl.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
TSFInputControl.xaml Auto-format our XAML files and enforce in CI (#9589) 2021-03-29 17:09:38 -05:00
XamlUiaTextRange.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
XamlUiaTextRange.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00