mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
Hax Move a huge bunch of the 'settings' types from Control to SettingsModel
This commit is contained in:
parent
34c85c386c
commit
74c71726fe
@ -647,13 +647,13 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
{
|
||||
switch (Direction())
|
||||
{
|
||||
case Microsoft::Terminal::Control::ScrollToMarkDirection::Last:
|
||||
case Microsoft::Terminal::Settings::Model::ScrollToMarkDirection::Last:
|
||||
return winrt::hstring{ RS_(L"ScrollToLastMarkCommandKey") };
|
||||
case Microsoft::Terminal::Control::ScrollToMarkDirection::First:
|
||||
case Microsoft::Terminal::Settings::Model::ScrollToMarkDirection::First:
|
||||
return winrt::hstring{ RS_(L"ScrollToFirstMarkCommandKey") };
|
||||
case Microsoft::Terminal::Control::ScrollToMarkDirection::Next:
|
||||
case Microsoft::Terminal::Settings::Model::ScrollToMarkDirection::Next:
|
||||
return winrt::hstring{ RS_(L"ScrollToNextMarkCommandKey") };
|
||||
case Microsoft::Terminal::Control::ScrollToMarkDirection::Previous:
|
||||
case Microsoft::Terminal::Settings::Model::ScrollToMarkDirection::Previous:
|
||||
default:
|
||||
return winrt::hstring{ RS_(L"ScrollToPreviousMarkCommandKey") };
|
||||
}
|
||||
|
||||
@ -204,11 +204,11 @@ private: \
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define SCROLL_TO_MARK_ARGS(X) \
|
||||
X(Microsoft::Terminal::Control::ScrollToMarkDirection, Direction, "direction", false, Microsoft::Terminal::Control::ScrollToMarkDirection::Previous)
|
||||
X(Microsoft::Terminal::Settings::Model::ScrollToMarkDirection, Direction, "direction", false, Microsoft::Terminal::Settings::Model::ScrollToMarkDirection::Previous)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define ADD_MARK_ARGS(X) \
|
||||
X(Windows::Foundation::IReference<Microsoft::Terminal::Core::Color>, Color, "color", false, nullptr)
|
||||
X(Windows::Foundation::IReference<Microsoft::Terminal::Settings::Model::Color>, Color, "color", false, nullptr)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define TOGGLE_COMMAND_PALETTE_ARGS(X) \
|
||||
@ -257,7 +257,7 @@ private: \
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define CLEAR_BUFFER_ARGS(X) \
|
||||
X(winrt::Microsoft::Terminal::Control::ClearBufferType, Clear, "clear", false, winrt::Microsoft::Terminal::Control::ClearBufferType::All)
|
||||
X(winrt::Microsoft::Terminal::Settings::Model::ClearBufferType, Clear, "clear", false, winrt::Microsoft::Terminal::Settings::Model::ClearBufferType::All)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define ADJUST_OPACITY_ARGS(X) \
|
||||
@ -273,10 +273,10 @@ private: \
|
||||
X(SelectOutputDirection, Direction, "direction", false, SelectOutputDirection::Previous)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define COLOR_SELECTION_ARGS(X) \
|
||||
X(winrt::Microsoft::Terminal::Control::SelectionColor, Foreground, "foreground", false, nullptr) \
|
||||
X(winrt::Microsoft::Terminal::Control::SelectionColor, Background, "background", false, nullptr) \
|
||||
X(winrt::Microsoft::Terminal::Core::MatchMode, MatchMode, "matchMode", false, winrt::Microsoft::Terminal::Core::MatchMode::None)
|
||||
#define COLOR_SELECTION_ARGS(X) \
|
||||
X(winrt::Microsoft::Terminal::Settings::Model::SelectionColor, Foreground, "foreground", false, nullptr) \
|
||||
X(winrt::Microsoft::Terminal::Settings::Model::SelectionColor, Background, "background", false, nullptr) \
|
||||
X(winrt::Microsoft::Terminal::Settings::Model::MatchMode, MatchMode, "matchMode", false, winrt::Microsoft::Terminal::Settings::Model::MatchMode::None)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -449,10 +449,11 @@ struct til::hash_trait<winrt::Microsoft::Terminal::Settings::Model::NewTerminalA
|
||||
}
|
||||
}
|
||||
};
|
||||
#if 0
|
||||
template<>
|
||||
struct til::hash_trait<winrt::Microsoft::Terminal::Control::SelectionColor>
|
||||
struct til::hash_trait<winrt::Microsoft::Terminal::Settings::Model::SelectionColor>
|
||||
{
|
||||
using M = winrt::Microsoft::Terminal::Control::SelectionColor;
|
||||
using M = winrt::Microsoft::Terminal::Settings::Model::SelectionColor;
|
||||
|
||||
void operator()(hasher& h, const M& value) const noexcept
|
||||
{
|
||||
@ -463,6 +464,7 @@ struct til::hash_trait<winrt::Microsoft::Terminal::Control::SelectionColor>
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "Command.idl";
|
||||
import "Types.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Model
|
||||
{
|
||||
@ -170,7 +171,7 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
CopyTextArgs();
|
||||
Boolean DismissSelection { get; };
|
||||
Boolean SingleLine { get; };
|
||||
Windows.Foundation.IReference<Microsoft.Terminal.Control.CopyFormat> CopyFormatting { get; };
|
||||
Windows.Foundation.IReference<Microsoft.Terminal.Settings.Model.CopyFormat> CopyFormatting { get; };
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass NewTabArgs : IActionArgs
|
||||
@ -318,12 +319,12 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
|
||||
[default_interface] runtimeclass ScrollToMarkArgs : IActionArgs
|
||||
{
|
||||
Microsoft.Terminal.Control.ScrollToMarkDirection Direction { get; };
|
||||
Microsoft.Terminal.Settings.Model.ScrollToMarkDirection Direction { get; };
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass AddMarkArgs : IActionArgs
|
||||
{
|
||||
Windows.Foundation.IReference<Microsoft.Terminal.Core.Color> Color { get; };
|
||||
Windows.Foundation.IReference<Microsoft.Terminal.Settings.Model.Color> Color { get; };
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass ToggleCommandPaletteArgs : IActionArgs
|
||||
@ -399,8 +400,8 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
|
||||
[default_interface] runtimeclass ClearBufferArgs : IActionArgs
|
||||
{
|
||||
ClearBufferArgs(Microsoft.Terminal.Control.ClearBufferType clear);
|
||||
Microsoft.Terminal.Control.ClearBufferType Clear { get; };
|
||||
ClearBufferArgs(Microsoft.Terminal.Settings.Model.ClearBufferType clear);
|
||||
Microsoft.Terminal.Settings.Model.ClearBufferType Clear { get; };
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass MultipleActionsArgs : IActionArgs
|
||||
@ -418,9 +419,9 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
|
||||
[default_interface] runtimeclass ColorSelectionArgs : IActionArgs
|
||||
{
|
||||
Microsoft.Terminal.Control.SelectionColor Foreground;
|
||||
Microsoft.Terminal.Control.SelectionColor Background;
|
||||
Microsoft.Terminal.Core.MatchMode MatchMode { get; };
|
||||
//Microsoft.Terminal.Settings.Model.SelectionColor Foreground;
|
||||
//Microsoft.Terminal.Settings.Model.SelectionColor Background;
|
||||
Microsoft.Terminal.Settings.Model.MatchMode MatchMode { get; };
|
||||
};
|
||||
|
||||
[default_interface] runtimeclass SelectCommandArgs : IActionArgs
|
||||
|
||||
@ -36,10 +36,10 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
|
||||
winrt::hstring ExpandedBackgroundImagePath();
|
||||
|
||||
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Core::Color, Foreground, nullptr);
|
||||
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Core::Color, Background, nullptr);
|
||||
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Core::Color, SelectionBackground, nullptr);
|
||||
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Core::Color, CursorColor, nullptr);
|
||||
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Settings::Model::Color, Foreground, nullptr);
|
||||
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Settings::Model::Color, Background, nullptr);
|
||||
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Settings::Model::Color, SelectionBackground, nullptr);
|
||||
INHERITABLE_NULLABLE_SETTING(Model::IAppearanceConfig, Microsoft::Terminal::Settings::Model::Color, CursorColor, nullptr);
|
||||
INHERITABLE_SETTING(Model::IAppearanceConfig, double, Opacity, 1.0);
|
||||
|
||||
INHERITABLE_SETTING(Model::IAppearanceConfig, hstring, DarkColorSchemeName, L"Campbell");
|
||||
|
||||
@ -46,22 +46,22 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
static com_ptr<ColorScheme> FromJson(const Json::Value& json);
|
||||
Json::Value ToJson() const;
|
||||
|
||||
com_array<Core::Color> Table() const noexcept;
|
||||
void SetColorTableEntry(uint8_t index, const Core::Color& value) noexcept;
|
||||
com_array<Model::Color> Table() const noexcept;
|
||||
void SetColorTableEntry(uint8_t index, const Model::Color& value) noexcept;
|
||||
|
||||
bool IsEquivalentForSettingsMergePurposes(const winrt::com_ptr<ColorScheme>& other) noexcept;
|
||||
|
||||
WINRT_PROPERTY(winrt::hstring, Name);
|
||||
WINRT_PROPERTY(OriginTag, Origin, OriginTag::None);
|
||||
WINRT_PROPERTY(Core::Color, Foreground, static_cast<Core::Color>(DEFAULT_FOREGROUND));
|
||||
WINRT_PROPERTY(Core::Color, Background, static_cast<Core::Color>(DEFAULT_BACKGROUND));
|
||||
WINRT_PROPERTY(Core::Color, SelectionBackground, static_cast<Core::Color>(DEFAULT_FOREGROUND));
|
||||
WINRT_PROPERTY(Core::Color, CursorColor, static_cast<Core::Color>(DEFAULT_CURSOR_COLOR));
|
||||
WINRT_PROPERTY(Model::Color, Foreground, static_cast<Model::Color>(DEFAULT_FOREGROUND));
|
||||
WINRT_PROPERTY(Model::Color, Background, static_cast<Model::Color>(DEFAULT_BACKGROUND));
|
||||
WINRT_PROPERTY(Model::Color, SelectionBackground, static_cast<Model::Color>(DEFAULT_FOREGROUND));
|
||||
WINRT_PROPERTY(Model::Color, CursorColor, static_cast<Model::Color>(DEFAULT_CURSOR_COLOR));
|
||||
|
||||
private:
|
||||
bool _layerJson(const Json::Value& json);
|
||||
|
||||
std::array<Core::Color, COLOR_TABLE_SIZE> _table;
|
||||
std::array<Model::Color, COLOR_TABLE_SIZE> _table;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "ISettingsModelObject.idl";
|
||||
import "Types.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Model
|
||||
{
|
||||
@ -11,15 +12,15 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
|
||||
String Name;
|
||||
|
||||
Microsoft.Terminal.Core.Color Foreground;
|
||||
Microsoft.Terminal.Core.Color Background;
|
||||
Microsoft.Terminal.Core.Color SelectionBackground;
|
||||
Microsoft.Terminal.Core.Color CursorColor;
|
||||
Microsoft.Terminal.Settings.Model.Color Foreground;
|
||||
Microsoft.Terminal.Settings.Model.Color Background;
|
||||
Microsoft.Terminal.Settings.Model.Color SelectionBackground;
|
||||
Microsoft.Terminal.Settings.Model.Color CursorColor;
|
||||
|
||||
// winrt::com_arrays prevent data binding.
|
||||
// Instead of representing Table as a property,
|
||||
// we expose the getter as a function.
|
||||
Microsoft.Terminal.Core.Color[] Table();
|
||||
void SetColorTableEntry(UInt8 index, Microsoft.Terminal.Core.Color value);
|
||||
Microsoft.Terminal.Settings.Model.Color[] Table();
|
||||
void SetColorTableEntry(UInt8 index, Microsoft.Terminal.Settings.Model.Color value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import "ActionArgs.idl";
|
||||
import "Profile.idl";
|
||||
import "ColorScheme.idl";
|
||||
import "TerminalWarnings.idl";
|
||||
import "Types.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Model
|
||||
{
|
||||
|
||||
@ -36,19 +36,19 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
DEFINE_ENUM_MAP(Model::FirstWindowPreference, FirstWindowPreference);
|
||||
DEFINE_ENUM_MAP(Model::LaunchMode, LaunchMode);
|
||||
DEFINE_ENUM_MAP(Model::TabSwitcherMode, TabSwitcherMode);
|
||||
DEFINE_ENUM_MAP(Microsoft::Terminal::Control::CopyFormat, CopyFormat);
|
||||
DEFINE_ENUM_MAP(Model::CopyFormat, CopyFormat);
|
||||
DEFINE_ENUM_MAP(Model::WindowingMode, WindowingMode);
|
||||
DEFINE_ENUM_MAP(Microsoft::Terminal::Core::MatchMode, MatchMode);
|
||||
DEFINE_ENUM_MAP(Microsoft::Terminal::Control::GraphicsAPI, GraphicsAPI);
|
||||
DEFINE_ENUM_MAP(Model::MatchMode, MatchMode);
|
||||
DEFINE_ENUM_MAP(Model::GraphicsAPI, GraphicsAPI);
|
||||
|
||||
// Profile Settings
|
||||
DEFINE_ENUM_MAP(Model::CloseOnExitMode, CloseOnExitMode);
|
||||
DEFINE_ENUM_MAP(Microsoft::Terminal::Control::ScrollbarState, ScrollbarState);
|
||||
DEFINE_ENUM_MAP(Model::ScrollbarState, ScrollbarState);
|
||||
DEFINE_ENUM_MAP(Windows::UI::Xaml::Media::Stretch, BackgroundImageStretchMode);
|
||||
DEFINE_ENUM_MAP(Microsoft::Terminal::Control::TextAntialiasingMode, TextAntialiasingMode);
|
||||
DEFINE_ENUM_MAP(Microsoft::Terminal::Core::CursorStyle, CursorStyle);
|
||||
DEFINE_ENUM_MAP(Microsoft::Terminal::Settings::Model::IntenseStyle, IntenseTextStyle);
|
||||
DEFINE_ENUM_MAP(Microsoft::Terminal::Core::AdjustTextMode, AdjustIndistinguishableColors);
|
||||
DEFINE_ENUM_MAP(Model::TextAntialiasingMode, TextAntialiasingMode);
|
||||
DEFINE_ENUM_MAP(Model::CursorStyle, CursorStyle);
|
||||
DEFINE_ENUM_MAP(Model::IntenseStyle, IntenseTextStyle);
|
||||
DEFINE_ENUM_MAP(Model::AdjustTextMode, AdjustIndistinguishableColors);
|
||||
|
||||
// FontWeight is special because the JsonUtils::ConversionTrait for it
|
||||
// creates a FontWeight object, but we need to use the uint16_t value.
|
||||
|
||||
@ -32,20 +32,20 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, FirstWindowPreference> FirstWindowPreference();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, LaunchMode> LaunchMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, TabSwitcherMode> TabSwitcherMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::Terminal::Control::CopyFormat> CopyFormat();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, CopyFormat> CopyFormat();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, WindowingMode> WindowingMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::Terminal::Core::MatchMode> MatchMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::Terminal::Control::GraphicsAPI> GraphicsAPI();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, MatchMode> MatchMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, GraphicsAPI> GraphicsAPI();
|
||||
|
||||
// Profile Settings
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, CloseOnExitMode> CloseOnExitMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, Microsoft::Terminal::Control::ScrollbarState> ScrollbarState();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ScrollbarState> ScrollbarState();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Windows::UI::Xaml::Media::Stretch> BackgroundImageStretchMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::Terminal::Control::TextAntialiasingMode> TextAntialiasingMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::Terminal::Core::CursorStyle> CursorStyle();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, TextAntialiasingMode> TextAntialiasingMode();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, CursorStyle> CursorStyle();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, uint16_t> FontWeight();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::Terminal::Settings::Model::IntenseStyle> IntenseTextStyle();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::Terminal::Core::AdjustTextMode> AdjustIndistinguishableColors();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, IntenseStyle> IntenseTextStyle();
|
||||
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, AdjustTextMode> AdjustIndistinguishableColors();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
|
||||
import "GlobalAppSettings.idl";
|
||||
import "Profile.idl";
|
||||
import "Types.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Model
|
||||
{
|
||||
@ -14,18 +15,18 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.FirstWindowPreference> FirstWindowPreference { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.LaunchMode> LaunchMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.TabSwitcherMode> TabSwitcherMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Control.CopyFormat> CopyFormat { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.CopyFormat> CopyFormat { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.WindowingMode> WindowingMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Core.MatchMode> MatchMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Control.GraphicsAPI> GraphicsAPI { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.MatchMode> MatchMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.GraphicsAPI> GraphicsAPI { get; };
|
||||
|
||||
// Profile Settings
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.CloseOnExitMode> CloseOnExitMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Control.ScrollbarState> ScrollbarState { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.ScrollbarState> ScrollbarState { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Windows.UI.Xaml.Media.Stretch> BackgroundImageStretchMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Control.TextAntialiasingMode> TextAntialiasingMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Core.CursorStyle> CursorStyle { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Core.AdjustTextMode> AdjustIndistinguishableColors { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.TextAntialiasingMode> TextAntialiasingMode { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.CursorStyle> CursorStyle { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.AdjustTextMode> AdjustIndistinguishableColors { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, UInt16> FontWeight { get; };
|
||||
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.IntenseStyle> IntenseTextStyle { get; };
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import "Theme.idl";
|
||||
import "ColorScheme.idl";
|
||||
import "ActionMap.idl";
|
||||
import "NewTabMenuEntry.idl";
|
||||
import "Types.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Model
|
||||
{
|
||||
@ -67,7 +68,7 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
INHERITABLE_SETTING(String, WordDelimiters);
|
||||
INHERITABLE_SETTING(Boolean, CopyOnSelect);
|
||||
INHERITABLE_SETTING(Boolean, InputServiceWarning);
|
||||
INHERITABLE_SETTING(Microsoft.Terminal.Control.CopyFormat, CopyFormatting);
|
||||
INHERITABLE_SETTING(Microsoft.Terminal.Settings.Model.CopyFormat, CopyFormatting);
|
||||
INHERITABLE_SETTING(Boolean, WarnAboutLargePaste);
|
||||
INHERITABLE_SETTING(Boolean, WarnAboutMultiLinePaste);
|
||||
INHERITABLE_SETTING(Boolean, TrimPaste);
|
||||
@ -76,7 +77,7 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
INHERITABLE_SETTING(FirstWindowPreference, FirstWindowPreference);
|
||||
INHERITABLE_SETTING(LaunchMode, LaunchMode);
|
||||
INHERITABLE_SETTING(Boolean, SnapToGridOnResize);
|
||||
INHERITABLE_SETTING(Microsoft.Terminal.Control.GraphicsAPI, GraphicsAPI);
|
||||
INHERITABLE_SETTING(Microsoft.Terminal.Settings.Model.GraphicsAPI, GraphicsAPI);
|
||||
INHERITABLE_SETTING(Boolean, DisablePartialInvalidation);
|
||||
INHERITABLE_SETTING(Boolean, SoftwareRendering);
|
||||
INHERITABLE_SETTING(Boolean, UseBackgroundImageForWindow);
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "Profile.idl";
|
||||
import "Types.idl";
|
||||
#include "IInheritable.idl.h"
|
||||
|
||||
#define INHERITABLE_APPEARANCE_SETTING(Type, Name) \
|
||||
@ -35,11 +36,11 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
INHERITABLE_APPEARANCE_SETTING(String, DarkColorSchemeName);
|
||||
INHERITABLE_APPEARANCE_SETTING(String, LightColorSchemeName);
|
||||
|
||||
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, Foreground);
|
||||
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, Background);
|
||||
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, SelectionBackground);
|
||||
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, CursorColor);
|
||||
INHERITABLE_APPEARANCE_SETTING(Microsoft.Terminal.Core.CursorStyle, CursorShape);
|
||||
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Settings.Model.Color>, Foreground);
|
||||
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Settings.Model.Color>, Background);
|
||||
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Settings.Model.Color>, SelectionBackground);
|
||||
INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Settings.Model.Color>, CursorColor);
|
||||
INHERITABLE_APPEARANCE_SETTING(Microsoft.Terminal.Settings.Model.CursorStyle, CursorShape);
|
||||
INHERITABLE_APPEARANCE_SETTING(UInt32, CursorHeight);
|
||||
|
||||
INHERITABLE_APPEARANCE_SETTING(String, BackgroundImagePath);
|
||||
@ -53,7 +54,7 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
INHERITABLE_APPEARANCE_SETTING(String, PixelShaderPath);
|
||||
INHERITABLE_APPEARANCE_SETTING(String, PixelShaderImagePath);
|
||||
INHERITABLE_APPEARANCE_SETTING(IntenseStyle, IntenseTextStyle);
|
||||
INHERITABLE_APPEARANCE_SETTING(Microsoft.Terminal.Core.AdjustTextMode, AdjustIndistinguishableColors);
|
||||
INHERITABLE_APPEARANCE_SETTING(Microsoft.Terminal.Settings.Model.AdjustTextMode, AdjustIndistinguishableColors);
|
||||
INHERITABLE_APPEARANCE_SETTING(Double, Opacity);
|
||||
INHERITABLE_APPEARANCE_SETTING(Boolean, UseAcrylic);
|
||||
};
|
||||
|
||||
@ -886,6 +886,32 @@ namespace Microsoft::Terminal::Settings::Model::JsonUtils
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef WINRT_Microsoft_Terminal_Settings_Model_H
|
||||
template<>
|
||||
struct ConversionTrait<winrt::Microsoft::Terminal::Settings::Model::Color>
|
||||
{
|
||||
winrt::Microsoft::Terminal::Settings::Model::Color FromJson(const Json::Value& json) const
|
||||
{
|
||||
return static_cast<winrt::Microsoft::Terminal::Settings::Model::Color>(ConversionTrait<til::color>{}.FromJson(json));
|
||||
}
|
||||
|
||||
bool CanConvert(const Json::Value& json) const
|
||||
{
|
||||
return ConversionTrait<til::color>{}.CanConvert(json);
|
||||
}
|
||||
|
||||
Json::Value ToJson(const winrt::Microsoft::Terminal::Settings::Model::Color& val)
|
||||
{
|
||||
return ConversionTrait<til::color>{}.ToJson(val);
|
||||
}
|
||||
|
||||
std::string TypeDescription() const
|
||||
{
|
||||
return ConversionTrait<til::color>{}.TypeDescription();
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template<typename T, typename TDelegatedConverter = ConversionTrait<std::decay_t<T>>, typename TOpt = std::optional<std::decay_t<T>>>
|
||||
struct OptionalConverter
|
||||
{
|
||||
|
||||
@ -24,7 +24,7 @@ Author(s):
|
||||
X(hstring, WordDelimiters, "wordDelimiters", DEFAULT_WORD_DELIMITERS) \
|
||||
X(bool, CopyOnSelect, "copyOnSelect", false) \
|
||||
X(bool, FocusFollowMouse, "focusFollowMouse", false) \
|
||||
X(winrt::Microsoft::Terminal::Control::GraphicsAPI, GraphicsAPI, "rendering.graphicsAPI") \
|
||||
X(winrt::Microsoft::Terminal::Settings::Model::GraphicsAPI, GraphicsAPI, "rendering.graphicsAPI") \
|
||||
X(bool, DisablePartialInvalidation, "rendering.disablePartialInvalidation", false) \
|
||||
X(bool, SoftwareRendering, "rendering.software", false) \
|
||||
X(bool, UseBackgroundImageForWindow, "experimental.useBackgroundImageForWindow", false) \
|
||||
@ -41,7 +41,7 @@ Author(s):
|
||||
X(bool, UseAcrylicInTabRow, "useAcrylicInTabRow", false) \
|
||||
X(bool, ShowTabsInTitlebar, "showTabsInTitlebar", true) \
|
||||
X(bool, InputServiceWarning, "inputServiceWarning", true) \
|
||||
X(winrt::Microsoft::Terminal::Control::CopyFormat, CopyFormatting, "copyFormatting", 0) \
|
||||
X(winrt::Microsoft::Terminal::Settings::Model::CopyFormat, CopyFormatting, "copyFormatting", 0) \
|
||||
X(bool, WarnAboutLargePaste, "largePasteWarning", true) \
|
||||
X(bool, WarnAboutMultiLinePaste, "multiLinePasteWarning", true) \
|
||||
X(Model::LaunchPosition, InitialPosition, "initialPosition", nullptr, nullptr) \
|
||||
@ -76,26 +76,26 @@ Author(s):
|
||||
// * TerminalSettings.cpp: TerminalSettings::_ApplyProfileSettings
|
||||
// * IControlSettings.idl or ICoreSettings.idl
|
||||
// * ControlProperties.h
|
||||
#define MTSM_PROFILE_SETTINGS(X) \
|
||||
X(int32_t, HistorySize, "historySize", DEFAULT_HISTORY_SIZE) \
|
||||
X(bool, SnapOnInput, "snapOnInput", true) \
|
||||
X(bool, AltGrAliasing, "altGrAliasing", true) \
|
||||
X(hstring, Commandline, "commandline", L"%SystemRoot%\\System32\\cmd.exe") \
|
||||
X(Microsoft::Terminal::Control::ScrollbarState, ScrollState, "scrollbarState", Microsoft::Terminal::Control::ScrollbarState::Visible) \
|
||||
X(Microsoft::Terminal::Control::TextAntialiasingMode, AntialiasingMode, "antialiasingMode", Microsoft::Terminal::Control::TextAntialiasingMode::Grayscale) \
|
||||
X(hstring, StartingDirectory, "startingDirectory") \
|
||||
X(bool, SuppressApplicationTitle, "suppressApplicationTitle", false) \
|
||||
X(guid, ConnectionType, "connectionType") \
|
||||
X(CloseOnExitMode, CloseOnExit, "closeOnExit", CloseOnExitMode::Automatic) \
|
||||
X(hstring, TabTitle, "tabTitle") \
|
||||
X(Model::BellStyle, BellStyle, "bellStyle", BellStyle::Audible) \
|
||||
X(IEnvironmentVariableMap, EnvironmentVariables, "environment", nullptr) \
|
||||
X(bool, RightClickContextMenu, "experimental.rightClickContextMenu", false) \
|
||||
X(Windows::Foundation::Collections::IVector<winrt::hstring>, BellSound, "bellSound", nullptr) \
|
||||
X(bool, Elevate, "elevate", false) \
|
||||
X(bool, AutoMarkPrompts, "experimental.autoMarkPrompts", false) \
|
||||
X(bool, ShowMarks, "experimental.showMarksOnScrollbar", false) \
|
||||
X(bool, RepositionCursorWithMouse, "experimental.repositionCursorWithMouse", false) \
|
||||
#define MTSM_PROFILE_SETTINGS(X) \
|
||||
X(int32_t, HistorySize, "historySize", DEFAULT_HISTORY_SIZE) \
|
||||
X(bool, SnapOnInput, "snapOnInput", true) \
|
||||
X(bool, AltGrAliasing, "altGrAliasing", true) \
|
||||
X(hstring, Commandline, "commandline", L"%SystemRoot%\\System32\\cmd.exe") \
|
||||
X(Microsoft::Terminal::Settings::Model::ScrollbarState, ScrollState, "scrollbarState", Microsoft::Terminal::Settings::Model::ScrollbarState::Visible) \
|
||||
X(Microsoft::Terminal::Settings::Model::TextAntialiasingMode, AntialiasingMode, "antialiasingMode", Microsoft::Terminal::Settings::Model::TextAntialiasingMode::Grayscale) \
|
||||
X(hstring, StartingDirectory, "startingDirectory") \
|
||||
X(bool, SuppressApplicationTitle, "suppressApplicationTitle", false) \
|
||||
X(guid, ConnectionType, "connectionType") \
|
||||
X(CloseOnExitMode, CloseOnExit, "closeOnExit", CloseOnExitMode::Automatic) \
|
||||
X(hstring, TabTitle, "tabTitle") \
|
||||
X(Model::BellStyle, BellStyle, "bellStyle", BellStyle::Audible) \
|
||||
X(IEnvironmentVariableMap, EnvironmentVariables, "environment", nullptr) \
|
||||
X(bool, RightClickContextMenu, "experimental.rightClickContextMenu", false) \
|
||||
X(Windows::Foundation::Collections::IVector<winrt::hstring>, BellSound, "bellSound", nullptr) \
|
||||
X(bool, Elevate, "elevate", false) \
|
||||
X(bool, AutoMarkPrompts, "experimental.autoMarkPrompts", false) \
|
||||
X(bool, ShowMarks, "experimental.showMarksOnScrollbar", false) \
|
||||
X(bool, RepositionCursorWithMouse, "experimental.repositionCursorWithMouse", false) \
|
||||
X(bool, ReloadEnvironmentVariables, "compatibility.reloadEnvironmentVariables", true)
|
||||
|
||||
// Intentionally omitted Profile settings:
|
||||
|
||||
@ -226,6 +226,7 @@
|
||||
<Midl Include="IAppearanceConfig.idl" />
|
||||
<Midl Include="ISettingsModelObject.idl" />
|
||||
<Midl Include="FontConfig.idl" />
|
||||
<Midl Include="Types.idl" />
|
||||
</ItemGroup>
|
||||
<!-- ========================= Misc Files ======================== -->
|
||||
<ItemGroup>
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
|
||||
using namespace Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model::implementation;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
using namespace winrt::Windows::UI;
|
||||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
|
||||
@ -117,7 +117,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
WINRT_PROPERTY(guid, Updates);
|
||||
|
||||
// Nullable/optional settings
|
||||
INHERITABLE_NULLABLE_SETTING(Model::Profile, Microsoft::Terminal::Core::Color, TabColor, nullptr);
|
||||
INHERITABLE_NULLABLE_SETTING(Model::Profile, Microsoft::Terminal::Settings::Model::Color, TabColor, nullptr);
|
||||
INHERITABLE_SETTING(Model::Profile, Model::IAppearanceConfig, UnfocusedAppearance, nullptr);
|
||||
|
||||
// Settings that cannot be put in the macro because of how they are handled in ToJson/LayerJson
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
import "IAppearanceConfig.idl";
|
||||
import "ISettingsModelObject.idl";
|
||||
import "FontConfig.idl";
|
||||
import "Types.idl";
|
||||
#include "IInheritable.idl.h"
|
||||
|
||||
#define INHERITABLE_PROFILE_SETTING(Type, Name) \
|
||||
@ -54,9 +55,9 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
INHERITABLE_PROFILE_SETTING(String, Icon);
|
||||
INHERITABLE_PROFILE_SETTING(CloseOnExitMode, CloseOnExit);
|
||||
INHERITABLE_PROFILE_SETTING(String, TabTitle);
|
||||
INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, TabColor);
|
||||
INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Settings.Model.Color>, TabColor);
|
||||
INHERITABLE_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
|
||||
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
|
||||
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.ScrollbarState, ScrollState);
|
||||
INHERITABLE_PROFILE_SETTING(String, Padding);
|
||||
INHERITABLE_PROFILE_SETTING(String, Commandline);
|
||||
|
||||
@ -68,7 +69,7 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
IAppearanceConfig DefaultAppearance { get; };
|
||||
INHERITABLE_PROFILE_SETTING(IAppearanceConfig, UnfocusedAppearance);
|
||||
|
||||
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.TextAntialiasingMode, AntialiasingMode);
|
||||
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.TextAntialiasingMode, AntialiasingMode);
|
||||
|
||||
INHERITABLE_PROFILE_SETTING(Int32, HistorySize);
|
||||
INHERITABLE_PROFILE_SETTING(Boolean, SnapOnInput);
|
||||
|
||||
@ -19,7 +19,7 @@ Abstract:
|
||||
#include "SettingsTypes.h"
|
||||
#include "ModelSerializationHelpers.h"
|
||||
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Core::CursorStyle)
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::CursorStyle)
|
||||
{
|
||||
static constexpr std::array<pair_type, 6> mappings = {
|
||||
pair_type{ "bar", ValueType::Bar },
|
||||
@ -33,7 +33,7 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Core::CursorStyle)
|
||||
|
||||
// Type Description:
|
||||
// - Helper for converting a user-specified adjustTextMode value to its corresponding enum
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Core::AdjustTextMode)
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::AdjustTextMode)
|
||||
{
|
||||
JSON_MAPPINGS(3) = {
|
||||
pair_type{ "never", ValueType::Never },
|
||||
@ -42,7 +42,7 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Core::AdjustTextMode)
|
||||
};
|
||||
|
||||
// Override mapping parser to add boolean parsing
|
||||
::winrt::Microsoft::Terminal::Core::AdjustTextMode FromJson(const Json::Value& json)
|
||||
::winrt::Microsoft::Terminal::Settings::Model::AdjustTextMode FromJson(const Json::Value& json)
|
||||
{
|
||||
if (json.isBool())
|
||||
{
|
||||
@ -69,7 +69,7 @@ JSON_ENUM_MAPPER(::winrt::Windows::UI::Xaml::Media::Stretch)
|
||||
};
|
||||
};
|
||||
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::ScrollbarState)
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::ScrollbarState)
|
||||
{
|
||||
static constexpr std::array<pair_type, 3> mappings = {
|
||||
pair_type{ "visible", ValueType::Visible },
|
||||
@ -78,7 +78,7 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::ScrollbarState)
|
||||
};
|
||||
};
|
||||
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Core::MatchMode)
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::MatchMode)
|
||||
{
|
||||
static constexpr std::array<pair_type, 2> mappings = {
|
||||
pair_type{ "none", ValueType::None },
|
||||
@ -133,7 +133,7 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::ConvergedAlignme
|
||||
};
|
||||
};
|
||||
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::TextAntialiasingMode)
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::TextAntialiasingMode)
|
||||
{
|
||||
static constexpr std::array<pair_type, 3> mappings = {
|
||||
pair_type{ "grayscale", ValueType::Grayscale },
|
||||
@ -295,7 +295,7 @@ JSON_ENUM_MAPPER(winrt::Microsoft::Terminal::Settings::Model::ExpandCommandType)
|
||||
};
|
||||
};
|
||||
|
||||
JSON_FLAG_MAPPER(::winrt::Microsoft::Terminal::Control::CopyFormat)
|
||||
JSON_FLAG_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::CopyFormat)
|
||||
{
|
||||
JSON_MAPPINGS(4) = {
|
||||
pair_type{ "none", AllClear },
|
||||
@ -537,7 +537,7 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::MonitorBehavior)
|
||||
};
|
||||
};
|
||||
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::ClearBufferType)
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::ClearBufferType)
|
||||
{
|
||||
JSON_MAPPINGS(3) = {
|
||||
pair_type{ "all", ValueType::All },
|
||||
@ -665,7 +665,7 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::IconStyle)
|
||||
};
|
||||
|
||||
// Possible ScrollToMarkDirection values
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::ScrollToMarkDirection)
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::ScrollToMarkDirection)
|
||||
{
|
||||
JSON_MAPPINGS(4) = {
|
||||
pair_type{ "previous", ValueType::Previous },
|
||||
@ -704,10 +704,11 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::SelectOutputDire
|
||||
};
|
||||
};
|
||||
|
||||
#if 0
|
||||
template<>
|
||||
struct ::Microsoft::Terminal::Settings::Model::JsonUtils::ConversionTrait<::winrt::Microsoft::Terminal::Control::SelectionColor>
|
||||
struct ::Microsoft::Terminal::Settings::Model::JsonUtils::ConversionTrait<::winrt::Microsoft::Terminal::Settings::Model::SelectionColor>
|
||||
{
|
||||
::winrt::Microsoft::Terminal::Control::SelectionColor FromJson(const Json::Value& json)
|
||||
::winrt::Microsoft::Terminal::Settings::Model::SelectionColor FromJson(const Json::Value& json)
|
||||
{
|
||||
const auto string = Detail::GetStringView(json);
|
||||
const auto isIndexed16 = string.size() == 3 && string.front() == 'i';
|
||||
@ -724,7 +725,7 @@ struct ::Microsoft::Terminal::Settings::Model::JsonUtils::ConversionTrait<::winr
|
||||
color = ::Microsoft::Console::Utils::ColorFromHexString(string);
|
||||
}
|
||||
|
||||
winrt::Microsoft::Terminal::Control::SelectionColor selection;
|
||||
winrt::Microsoft::Terminal::Settings::Model::SelectionColor selection;
|
||||
selection.Color(color);
|
||||
selection.IsIndex16(isIndexed16);
|
||||
return selection;
|
||||
@ -743,7 +744,7 @@ struct ::Microsoft::Terminal::Settings::Model::JsonUtils::ConversionTrait<::winr
|
||||
return isColorSpec || isIndexedColor;
|
||||
}
|
||||
|
||||
Json::Value ToJson(const ::winrt::Microsoft::Terminal::Control::SelectionColor& val)
|
||||
Json::Value ToJson(const ::winrt::Microsoft::Terminal::Settings::Model::SelectionColor& val)
|
||||
{
|
||||
const auto color = val.Color();
|
||||
if (val.IsIndex16())
|
||||
@ -761,8 +762,9 @@ struct ::Microsoft::Terminal::Settings::Model::JsonUtils::ConversionTrait<::winr
|
||||
return "SelectionColor (#rrggbb, #rgb, #rrggbbaa, iNN)";
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::GraphicsAPI)
|
||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::GraphicsAPI)
|
||||
{
|
||||
JSON_MAPPINGS(3) = {
|
||||
pair_type{ "automatic", ValueType::Automatic },
|
||||
|
||||
@ -63,7 +63,7 @@ THEME_OBJECT(TabTheme, MTSM_THEME_TAB_SETTINGS);
|
||||
#undef THEME_SETTINGS_TO_JSON
|
||||
#undef THEME_OBJECT
|
||||
|
||||
winrt::Microsoft::Terminal::Settings::Model::ThemeColor ThemeColor::FromColor(const winrt::Microsoft::Terminal::Core::Color& coreColor) noexcept
|
||||
winrt::Microsoft::Terminal::Settings::Model::ThemeColor ThemeColor::FromColor(const winrt::Microsoft::Terminal::Settings::Model::Color& coreColor) noexcept
|
||||
{
|
||||
auto result = winrt::make_self<implementation::ThemeColor>();
|
||||
result->_Color = coreColor;
|
||||
|
||||
@ -53,7 +53,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
{
|
||||
public:
|
||||
ThemeColor() noexcept = default;
|
||||
static winrt::Microsoft::Terminal::Settings::Model::ThemeColor FromColor(const winrt::Microsoft::Terminal::Core::Color& coreColor) noexcept;
|
||||
static winrt::Microsoft::Terminal::Settings::Model::ThemeColor FromColor(const winrt::Microsoft::Terminal::Settings::Model::Color& coreColor) noexcept;
|
||||
static winrt::Microsoft::Terminal::Settings::Model::ThemeColor FromAccent() noexcept;
|
||||
static winrt::Microsoft::Terminal::Settings::Model::ThemeColor FromTerminalBackground() noexcept;
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "Types.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Model
|
||||
{
|
||||
|
||||
@ -39,14 +41,14 @@ namespace Microsoft.Terminal.Settings.Model
|
||||
runtimeclass ThemeColor
|
||||
{
|
||||
ThemeColor();
|
||||
static ThemeColor FromColor(Microsoft.Terminal.Core.Color color);
|
||||
static ThemeColor FromColor(Microsoft.Terminal.Settings.Model.Color color);
|
||||
static ThemeColor FromAccent();
|
||||
static ThemeColor FromTerminalBackground();
|
||||
|
||||
Microsoft.Terminal.Core.Color Color { get; };
|
||||
Microsoft.Terminal.Settings.Model.Color Color { get; };
|
||||
ThemeColorType ColorType;
|
||||
|
||||
static Microsoft.Terminal.Core.Color ColorFromBrush(Windows.UI.Xaml.Media.Brush brush);
|
||||
static Microsoft.Terminal.Settings.Model.Color ColorFromBrush(Windows.UI.Xaml.Media.Brush brush);
|
||||
Windows.UI.Xaml.Media.Brush Evaluate(Windows.UI.Xaml.ResourceDictionary res,
|
||||
Windows.UI.Xaml.Media.Brush terminalBackground,
|
||||
Boolean forTitlebar);
|
||||
|
||||
84
src/cascadia/TerminalSettingsModel/Types.idl
Normal file
84
src/cascadia/TerminalSettingsModel/Types.idl
Normal file
@ -0,0 +1,84 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Settings.Model
|
||||
{
|
||||
enum MatchMode
|
||||
{
|
||||
None,
|
||||
All
|
||||
};
|
||||
|
||||
enum CursorStyle
|
||||
{
|
||||
Vintage,
|
||||
Bar,
|
||||
Underscore,
|
||||
DoubleUnderscore,
|
||||
FilledBox,
|
||||
EmptyBox
|
||||
};
|
||||
|
||||
enum AdjustTextMode
|
||||
{
|
||||
Never,
|
||||
Indexed,
|
||||
Always
|
||||
};
|
||||
|
||||
// TerminalCore declares its own Color struct to avoid depending
|
||||
// on Windows.UI.Color and to avoid passing around unclothed uint32s.
|
||||
// It is supported by til::color for conversions in and out of WinRT land.
|
||||
struct Color
|
||||
{
|
||||
UInt8 R;
|
||||
UInt8 G;
|
||||
UInt8 B;
|
||||
UInt8 A;
|
||||
};
|
||||
|
||||
[flags]
|
||||
enum CopyFormat
|
||||
{
|
||||
HTML = 0x1,
|
||||
RTF = 0x2,
|
||||
All = 0xffffffff
|
||||
};
|
||||
|
||||
enum GraphicsAPI
|
||||
{
|
||||
Automatic,
|
||||
Direct2D,
|
||||
Direct3D11,
|
||||
};
|
||||
|
||||
enum ClearBufferType
|
||||
{
|
||||
Screen,
|
||||
Scrollback,
|
||||
All
|
||||
};
|
||||
|
||||
enum ScrollToMarkDirection
|
||||
{
|
||||
Previous,
|
||||
Next,
|
||||
First,
|
||||
Last
|
||||
};
|
||||
|
||||
enum ScrollbarState
|
||||
{
|
||||
Visible = 0,
|
||||
Hidden,
|
||||
Always
|
||||
};
|
||||
|
||||
enum TextAntialiasingMode
|
||||
{
|
||||
Grayscale = 0,
|
||||
Cleartype,
|
||||
Aliased
|
||||
};
|
||||
|
||||
}
|
||||
@ -42,6 +42,7 @@
|
||||
#include <winrt/Microsoft.Terminal.Core.h>
|
||||
#include <winrt/Microsoft.Terminal.Control.h>
|
||||
#include <winrt/Microsoft.Terminal.TerminalConnection.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Model.h>
|
||||
|
||||
// Including TraceLogging essentials for the binary
|
||||
#include <TraceLoggingProvider.h>
|
||||
|
||||
@ -186,6 +186,18 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WINRT_Microsoft_Terminal_Settings_Model_H
|
||||
constexpr color(const winrt::Microsoft::Terminal::Settings::Model::Color& coreColor) :
|
||||
color(coreColor.R, coreColor.G, coreColor.B, coreColor.A)
|
||||
{
|
||||
}
|
||||
|
||||
constexpr operator winrt::Microsoft::Terminal::Settings::Model::Color() const noexcept
|
||||
{
|
||||
return { r, g, b, a };
|
||||
}
|
||||
#endif
|
||||
|
||||
constexpr bool operator==(const til::color& other) const
|
||||
{
|
||||
return abgr == other.abgr;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user