295fa38295
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!
69 lines
2.1 KiB
C
69 lines
2.1 KiB
C
/*++
|
|
Copyright (c) Microsoft Corporation
|
|
Licensed under the MIT license.
|
|
|
|
Module Name:
|
|
- precomp.h
|
|
|
|
Abstract:
|
|
- Contains external headers to include in the precompile phase of console build process.
|
|
- Avoid including internal project headers. Instead include them only in the classes that need them (helps with test project building).
|
|
|
|
Author(s):
|
|
- Carlos Zamora (cazamor) April 2019
|
|
--*/
|
|
|
|
#pragma once
|
|
|
|
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
|
#define BLOCK_TIL
|
|
// This includes support libraries from the CRT, STL, WIL, and GSL
|
|
#include "LibraryIncludes.h"
|
|
// This is inexplicable, but for whatever reason, cppwinrt conflicts with the
|
|
// SDK definition of this function, so the only fix is to undef it.
|
|
// from WinBase.h
|
|
// Windows::UI::Xaml::Media::Animation::IStoryboard::GetCurrentTime
|
|
#ifdef GetCurrentTime
|
|
#undef GetCurrentTime
|
|
#endif
|
|
|
|
#include <wil/cppwinrt.h>
|
|
#include <unknwn.h>
|
|
#include <hstring.h>
|
|
|
|
#include <WexTestClass.h>
|
|
#include <json.h>
|
|
#include "consoletaeftemplates.hpp"
|
|
#include "winrtTaefTemplates.hpp"
|
|
|
|
#include <winrt/Windows.ApplicationModel.Resources.Core.h>
|
|
#include "winrt/Windows.UI.Xaml.Markup.h"
|
|
#include <winrt/Windows.system.h>
|
|
#include <winrt/Windows.Foundation.h>
|
|
#include <winrt/Windows.Foundation.Collections.h>
|
|
#include <winrt/windows.ui.core.h>
|
|
#include <winrt/Windows.ui.input.h>
|
|
#include <winrt/Windows.UI.Xaml.Controls.h>
|
|
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
|
|
#include <winrt/Windows.ui.xaml.media.h>
|
|
#include <winrt/Windows.ui.xaml.input.h>
|
|
#include <winrt/Windows.UI.Xaml.Markup.h>
|
|
#include <winrt/Windows.UI.Xaml.Documents.h>
|
|
|
|
#include <windows.ui.xaml.media.dxinterop.h>
|
|
|
|
#include <winrt/windows.applicationmodel.core.h>
|
|
|
|
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
|
|
|
#include <winrt/Microsoft.Terminal.Core.h>
|
|
|
|
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
|
#include "til.h"
|
|
|
|
// Common includes for most tests:
|
|
#include "../../inc/argb.h"
|
|
#include "../../inc/conattrs.hpp"
|
|
#include "../../types/inc/utils.hpp"
|
|
#include "../../inc/DefaultSettings.h"
|