2020-10-06 18:56:59 +02:00
|
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
|
|
|
// Licensed under the MIT license.
|
|
|
|
|
//
|
|
|
|
|
// pch.h
|
|
|
|
|
// Header for platform projection include files
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
2020-12-11 20:35:23 +01:00
|
|
|
|
#define NOMCX
|
|
|
|
|
#define NOHELP
|
|
|
|
|
#define NOCOMM
|
2020-10-06 18:56:59 +02:00
|
|
|
|
|
|
|
|
|
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
|
|
|
|
#define BLOCK_TIL
|
|
|
|
|
#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 <winrt/Windows.ApplicationModel.h>
|
2021-02-19 03:12:16 +01:00
|
|
|
|
#include <winrt/Windows.ApplicationModel.AppExtensions.h>
|
2020-10-06 18:56:59 +02:00
|
|
|
|
#include <winrt/Windows.Foundation.h>
|
|
|
|
|
#include <winrt/Windows.Foundation.Collections.h>
|
|
|
|
|
#include <winrt/Windows.UI.Core.h>
|
|
|
|
|
#include <winrt/Windows.UI.Xaml.Controls.h>
|
|
|
|
|
#include <winrt/Windows.UI.Xaml.Media.h>
|
2021-02-19 03:12:16 +01:00
|
|
|
|
#include <winrt/Windows.Storage.h>
|
2020-10-06 18:56:59 +02:00
|
|
|
|
|
|
|
|
|
#include <winrt/Windows.System.h>
|
|
|
|
|
|
2020-11-05 01:55:16 +01:00
|
|
|
|
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
|
|
|
|
|
2020-10-06 18:56:59 +02:00
|
|
|
|
// Including TraceLogging essentials for the binary
|
|
|
|
|
#include <TraceLoggingProvider.h>
|
|
|
|
|
#include <winmeta.h>
|
|
|
|
|
TRACELOGGING_DECLARE_PROVIDER(g_hSettingsModelProvider);
|
2020-11-25 22:02:10 +01:00
|
|
|
|
#include <telemetry/ProjectTelemetry.h>
|
2020-10-06 18:56:59 +02:00
|
|
|
|
#include <TraceLoggingActivity.h>
|
|
|
|
|
|
|
|
|
|
// JsonCpp
|
|
|
|
|
#include <json.h>
|
|
|
|
|
|
|
|
|
|
#include <shellapi.h>
|
|
|
|
|
|
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 22:15:49 +02:00
|
|
|
|
#include <winrt/Microsoft.Terminal.Core.h>
|
2021-03-17 21:47:24 +01:00
|
|
|
|
#include <winrt/Microsoft.Terminal.Control.h>
|
2020-10-06 18:56:59 +02:00
|
|
|
|
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
|
|
|
|
|
|
|
|
|
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
|
|
|
|
#include "til.h"
|