Replace everything in TerminalSettings
with GETSET_PROPERTY
(#6110)
This is mostly a codehealth thing - we made these handy macros for just defining basic `{ get; set; }` properties, but we never used them in TerminalSettings, because that file was written before the macros were. This cleans up that class. * [x] I work here.
This commit is contained in:
parent
1ea08892f8
commit
e7c22fbadb
|
@ -3,81 +3,11 @@
|
|||
|
||||
#include "pch.h"
|
||||
#include "TerminalSettings.h"
|
||||
#include <DefaultSettings.h>
|
||||
|
||||
#include "TerminalSettings.g.cpp"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::implementation
|
||||
{
|
||||
// Disable "default constructor may not throw."
|
||||
// We put default values into the hstrings here, which allocates and could throw.
|
||||
// Working around that situation is more headache than it's worth at the moment.
|
||||
#pragma warning(suppress : 26455)
|
||||
TerminalSettings::TerminalSettings() :
|
||||
_defaultForeground{ DEFAULT_FOREGROUND_WITH_ALPHA },
|
||||
_defaultBackground{ DEFAULT_BACKGROUND_WITH_ALPHA },
|
||||
_selectionBackground{ DEFAULT_FOREGROUND },
|
||||
_colorTable{},
|
||||
_historySize{ DEFAULT_HISTORY_SIZE },
|
||||
_initialRows{ 30 },
|
||||
_initialCols{ 80 },
|
||||
_rowsToScroll{ 0 },
|
||||
_snapOnInput{ true },
|
||||
_cursorColor{ DEFAULT_CURSOR_COLOR },
|
||||
_cursorShape{ CursorStyle::Vintage },
|
||||
_cursorHeight{ DEFAULT_CURSOR_HEIGHT },
|
||||
_wordDelimiters{ DEFAULT_WORD_DELIMITERS },
|
||||
_copyOnSelect{ false },
|
||||
_profileName{},
|
||||
_useAcrylic{ false },
|
||||
_tintOpacity{ 0.5 },
|
||||
_padding{ DEFAULT_PADDING },
|
||||
_fontFace{ DEFAULT_FONT_FACE },
|
||||
_fontSize{ DEFAULT_FONT_SIZE },
|
||||
_fontWeight{ DEFAULT_FONT_WEIGHT },
|
||||
_backgroundImage{},
|
||||
_backgroundImageOpacity{ 1.0 },
|
||||
_backgroundImageStretchMode{ winrt::Windows::UI::Xaml::Media::Stretch::UniformToFill },
|
||||
_backgroundImageHorizontalAlignment{ winrt::Windows::UI::Xaml::HorizontalAlignment::Center },
|
||||
_backgroundImageVerticalAlignment{ winrt::Windows::UI::Xaml::VerticalAlignment::Center },
|
||||
_keyBindings{ nullptr },
|
||||
_scrollbarState{ ScrollbarState::Visible },
|
||||
_antialiasingMode{ TextAntialiasingMode::Grayscale },
|
||||
_forceFullRepaintRendering{ false },
|
||||
_softwareRendering{ false }
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t TerminalSettings::DefaultForeground() noexcept
|
||||
{
|
||||
return _defaultForeground;
|
||||
}
|
||||
|
||||
void TerminalSettings::DefaultForeground(uint32_t value) noexcept
|
||||
{
|
||||
_defaultForeground = value;
|
||||
}
|
||||
|
||||
uint32_t TerminalSettings::DefaultBackground() noexcept
|
||||
{
|
||||
return _defaultBackground;
|
||||
}
|
||||
|
||||
void TerminalSettings::DefaultBackground(uint32_t value) noexcept
|
||||
{
|
||||
_defaultBackground = value;
|
||||
}
|
||||
|
||||
uint32_t TerminalSettings::SelectionBackground() noexcept
|
||||
{
|
||||
return _selectionBackground;
|
||||
}
|
||||
|
||||
void TerminalSettings::SelectionBackground(uint32_t value) noexcept
|
||||
{
|
||||
_selectionBackground = value;
|
||||
}
|
||||
|
||||
uint32_t TerminalSettings::GetColorTableEntry(int32_t index) const noexcept
|
||||
{
|
||||
return _colorTable.at(index);
|
||||
|
@ -90,36 +20,6 @@ namespace winrt::Microsoft::Terminal::Settings::implementation
|
|||
_colorTable.at(index) = value;
|
||||
}
|
||||
|
||||
int32_t TerminalSettings::HistorySize() noexcept
|
||||
{
|
||||
return _historySize;
|
||||
}
|
||||
|
||||
void TerminalSettings::HistorySize(int32_t value) noexcept
|
||||
{
|
||||
_historySize = value;
|
||||
}
|
||||
|
||||
int32_t TerminalSettings::InitialRows() noexcept
|
||||
{
|
||||
return _initialRows;
|
||||
}
|
||||
|
||||
void TerminalSettings::InitialRows(int32_t value) noexcept
|
||||
{
|
||||
_initialRows = value;
|
||||
}
|
||||
|
||||
int32_t TerminalSettings::InitialCols() noexcept
|
||||
{
|
||||
return _initialCols;
|
||||
}
|
||||
|
||||
void TerminalSettings::InitialCols(int32_t value) noexcept
|
||||
{
|
||||
_initialCols = value;
|
||||
}
|
||||
|
||||
int32_t TerminalSettings::RowsToScroll() noexcept
|
||||
{
|
||||
if (_rowsToScroll != 0)
|
||||
|
@ -139,294 +39,4 @@ namespace winrt::Microsoft::Terminal::Settings::implementation
|
|||
_rowsToScroll = value;
|
||||
}
|
||||
|
||||
bool TerminalSettings::SnapOnInput() noexcept
|
||||
{
|
||||
return _snapOnInput;
|
||||
}
|
||||
|
||||
void TerminalSettings::SnapOnInput(bool value) noexcept
|
||||
{
|
||||
_snapOnInput = value;
|
||||
}
|
||||
|
||||
uint32_t TerminalSettings::CursorColor() noexcept
|
||||
{
|
||||
return _cursorColor;
|
||||
}
|
||||
|
||||
void TerminalSettings::CursorColor(uint32_t value) noexcept
|
||||
{
|
||||
_cursorColor = value;
|
||||
}
|
||||
|
||||
Settings::CursorStyle TerminalSettings::CursorShape() const noexcept
|
||||
{
|
||||
return _cursorShape;
|
||||
}
|
||||
|
||||
void TerminalSettings::CursorShape(Settings::CursorStyle const& value) noexcept
|
||||
{
|
||||
_cursorShape = value;
|
||||
}
|
||||
|
||||
uint32_t TerminalSettings::CursorHeight() noexcept
|
||||
{
|
||||
return _cursorHeight;
|
||||
}
|
||||
|
||||
void TerminalSettings::CursorHeight(uint32_t value) noexcept
|
||||
{
|
||||
_cursorHeight = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::WordDelimiters()
|
||||
{
|
||||
return _wordDelimiters;
|
||||
}
|
||||
|
||||
void TerminalSettings::WordDelimiters(hstring const& value)
|
||||
{
|
||||
_wordDelimiters = value;
|
||||
}
|
||||
|
||||
bool TerminalSettings::CopyOnSelect() noexcept
|
||||
{
|
||||
return _copyOnSelect;
|
||||
}
|
||||
|
||||
void TerminalSettings::CopyOnSelect(bool value) noexcept
|
||||
{
|
||||
_copyOnSelect = value;
|
||||
}
|
||||
|
||||
void TerminalSettings::ProfileName(hstring const& value)
|
||||
{
|
||||
_profileName = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::ProfileName()
|
||||
{
|
||||
return _profileName;
|
||||
}
|
||||
|
||||
bool TerminalSettings::UseAcrylic() noexcept
|
||||
{
|
||||
return _useAcrylic;
|
||||
}
|
||||
|
||||
void TerminalSettings::UseAcrylic(bool value) noexcept
|
||||
{
|
||||
_useAcrylic = value;
|
||||
}
|
||||
|
||||
double TerminalSettings::TintOpacity() noexcept
|
||||
{
|
||||
return _tintOpacity;
|
||||
}
|
||||
|
||||
void TerminalSettings::TintOpacity(double value) noexcept
|
||||
{
|
||||
_tintOpacity = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::Padding()
|
||||
{
|
||||
return _padding;
|
||||
}
|
||||
|
||||
void TerminalSettings::Padding(hstring value)
|
||||
{
|
||||
_padding = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::FontFace()
|
||||
{
|
||||
return _fontFace;
|
||||
}
|
||||
|
||||
void TerminalSettings::FontFace(hstring const& value)
|
||||
{
|
||||
_fontFace = value;
|
||||
}
|
||||
|
||||
int32_t TerminalSettings::FontSize() noexcept
|
||||
{
|
||||
return _fontSize;
|
||||
}
|
||||
|
||||
void TerminalSettings::FontSize(int32_t value) noexcept
|
||||
{
|
||||
_fontSize = value;
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Text::FontWeight TerminalSettings::FontWeight() noexcept
|
||||
{
|
||||
return _fontWeight;
|
||||
}
|
||||
|
||||
void TerminalSettings::FontWeight(winrt::Windows::UI::Text::FontWeight value) noexcept
|
||||
{
|
||||
_fontWeight = value;
|
||||
}
|
||||
|
||||
void TerminalSettings::BackgroundImage(hstring const& value)
|
||||
{
|
||||
_backgroundImage = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::BackgroundImage()
|
||||
{
|
||||
return _backgroundImage;
|
||||
}
|
||||
|
||||
void TerminalSettings::BackgroundImageOpacity(double value) noexcept
|
||||
{
|
||||
_backgroundImageOpacity = value;
|
||||
}
|
||||
|
||||
double TerminalSettings::BackgroundImageOpacity() noexcept
|
||||
{
|
||||
return _backgroundImageOpacity;
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Xaml::Media::Stretch TerminalSettings::BackgroundImageStretchMode() noexcept
|
||||
{
|
||||
return _backgroundImageStretchMode;
|
||||
}
|
||||
|
||||
void TerminalSettings::BackgroundImageStretchMode(winrt::Windows::UI::Xaml::Media::Stretch value) noexcept
|
||||
{
|
||||
_backgroundImageStretchMode = value;
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Xaml::HorizontalAlignment TerminalSettings::BackgroundImageHorizontalAlignment() noexcept
|
||||
{
|
||||
return _backgroundImageHorizontalAlignment;
|
||||
}
|
||||
|
||||
void TerminalSettings::BackgroundImageHorizontalAlignment(winrt::Windows::UI::Xaml::HorizontalAlignment value) noexcept
|
||||
{
|
||||
_backgroundImageHorizontalAlignment = value;
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Xaml::VerticalAlignment TerminalSettings::BackgroundImageVerticalAlignment() noexcept
|
||||
{
|
||||
return _backgroundImageVerticalAlignment;
|
||||
}
|
||||
|
||||
void TerminalSettings::BackgroundImageVerticalAlignment(winrt::Windows::UI::Xaml::VerticalAlignment value) noexcept
|
||||
{
|
||||
_backgroundImageVerticalAlignment = value;
|
||||
}
|
||||
|
||||
Settings::IKeyBindings TerminalSettings::KeyBindings() noexcept
|
||||
{
|
||||
return _keyBindings;
|
||||
}
|
||||
|
||||
void TerminalSettings::KeyBindings(Settings::IKeyBindings const& value) noexcept
|
||||
{
|
||||
_keyBindings = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::Commandline()
|
||||
{
|
||||
return _commandline;
|
||||
}
|
||||
|
||||
void TerminalSettings::Commandline(hstring const& value)
|
||||
{
|
||||
_commandline = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::StartingDirectory()
|
||||
{
|
||||
return _startingDir;
|
||||
}
|
||||
|
||||
void TerminalSettings::StartingDirectory(hstring const& value)
|
||||
{
|
||||
_startingDir = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::StartingTitle()
|
||||
{
|
||||
return _startingTitle;
|
||||
}
|
||||
|
||||
void TerminalSettings::StartingTitle(hstring const& value)
|
||||
{
|
||||
_startingTitle = value;
|
||||
}
|
||||
|
||||
bool TerminalSettings::SuppressApplicationTitle() noexcept
|
||||
{
|
||||
return _suppressApplicationTitle;
|
||||
}
|
||||
|
||||
void TerminalSettings::SuppressApplicationTitle(bool value) noexcept
|
||||
{
|
||||
_suppressApplicationTitle = value;
|
||||
}
|
||||
|
||||
hstring TerminalSettings::EnvironmentVariables()
|
||||
{
|
||||
return _envVars;
|
||||
}
|
||||
|
||||
void TerminalSettings::EnvironmentVariables(hstring const& value)
|
||||
{
|
||||
_envVars = value;
|
||||
}
|
||||
|
||||
Settings::ScrollbarState TerminalSettings::ScrollState() const noexcept
|
||||
{
|
||||
return _scrollbarState;
|
||||
}
|
||||
|
||||
void TerminalSettings::ScrollState(Settings::ScrollbarState const& value) noexcept
|
||||
{
|
||||
_scrollbarState = value;
|
||||
}
|
||||
|
||||
bool TerminalSettings::RetroTerminalEffect() noexcept
|
||||
{
|
||||
return _retroTerminalEffect;
|
||||
}
|
||||
|
||||
void TerminalSettings::RetroTerminalEffect(bool value) noexcept
|
||||
{
|
||||
_retroTerminalEffect = value;
|
||||
}
|
||||
|
||||
bool TerminalSettings::ForceFullRepaintRendering() noexcept
|
||||
{
|
||||
return _forceFullRepaintRendering;
|
||||
}
|
||||
|
||||
void TerminalSettings::ForceFullRepaintRendering(bool value) noexcept
|
||||
{
|
||||
_forceFullRepaintRendering = value;
|
||||
}
|
||||
|
||||
bool TerminalSettings::SoftwareRendering() noexcept
|
||||
{
|
||||
return _softwareRendering;
|
||||
}
|
||||
|
||||
void TerminalSettings::SoftwareRendering(bool value) noexcept
|
||||
{
|
||||
_softwareRendering = value;
|
||||
}
|
||||
|
||||
Settings::TextAntialiasingMode TerminalSettings::AntialiasingMode() const noexcept
|
||||
{
|
||||
return _antialiasingMode;
|
||||
}
|
||||
|
||||
void TerminalSettings::AntialiasingMode(const Settings::TextAntialiasingMode& value) noexcept
|
||||
{
|
||||
_antialiasingMode = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,154 +14,99 @@ Author(s):
|
|||
--*/
|
||||
#pragma once
|
||||
|
||||
#include <conattrs.hpp>
|
||||
#include "TerminalSettings.g.h"
|
||||
#include "../inc/cppwinrt_utils.h"
|
||||
#include <DefaultSettings.h>
|
||||
#include <conattrs.hpp>
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::implementation
|
||||
{
|
||||
struct TerminalSettings : TerminalSettingsT<TerminalSettings>
|
||||
{
|
||||
TerminalSettings();
|
||||
TerminalSettings() = default;
|
||||
|
||||
// TECHNICALLY, the hstring copy assignment can throw, but the GETSET_PROPERTY
|
||||
// macro defines the operator as `noexcept`. We're not really worried about it,
|
||||
// because the only time it will throw is when we're out of memory, and then
|
||||
// we've got much worse problems. So just suppress that warning for now.
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 26447)
|
||||
// --------------------------- Core Settings ---------------------------
|
||||
// All of these settings are defined in ICoreSettings.
|
||||
uint32_t DefaultForeground() noexcept;
|
||||
void DefaultForeground(uint32_t value) noexcept;
|
||||
uint32_t DefaultBackground() noexcept;
|
||||
void DefaultBackground(uint32_t value) noexcept;
|
||||
uint32_t SelectionBackground() noexcept;
|
||||
void SelectionBackground(uint32_t value) noexcept;
|
||||
|
||||
// Get/Set ColorTableEntry needs to be implemented manually, to get a
|
||||
// particular value from the array.
|
||||
uint32_t GetColorTableEntry(int32_t index) const noexcept;
|
||||
void SetColorTableEntry(int32_t index, uint32_t value);
|
||||
int32_t HistorySize() noexcept;
|
||||
void HistorySize(int32_t value) noexcept;
|
||||
int32_t InitialRows() noexcept;
|
||||
void InitialRows(int32_t value) noexcept;
|
||||
int32_t InitialCols() noexcept;
|
||||
void InitialCols(int32_t value) noexcept;
|
||||
|
||||
// the RowsToScroll getter needs to be implemented manually, so it can
|
||||
// default to SPI_GETWHEELSCROLLLINES
|
||||
int32_t RowsToScroll() noexcept;
|
||||
void RowsToScroll(int32_t value) noexcept;
|
||||
bool SnapOnInput() noexcept;
|
||||
void SnapOnInput(bool value) noexcept;
|
||||
uint32_t CursorColor() noexcept;
|
||||
void CursorColor(uint32_t value) noexcept;
|
||||
CursorStyle CursorShape() const noexcept;
|
||||
void CursorShape(winrt::Microsoft::Terminal::Settings::CursorStyle const& value) noexcept;
|
||||
uint32_t CursorHeight() noexcept;
|
||||
void CursorHeight(uint32_t value) noexcept;
|
||||
hstring WordDelimiters();
|
||||
void WordDelimiters(hstring const& value);
|
||||
bool CopyOnSelect() noexcept;
|
||||
void CopyOnSelect(bool value) noexcept;
|
||||
|
||||
GETSET_PROPERTY(uint32_t, DefaultForeground, DEFAULT_FOREGROUND_WITH_ALPHA);
|
||||
GETSET_PROPERTY(uint32_t, DefaultBackground, DEFAULT_BACKGROUND_WITH_ALPHA);
|
||||
GETSET_PROPERTY(uint32_t, SelectionBackground, DEFAULT_FOREGROUND);
|
||||
GETSET_PROPERTY(int32_t, HistorySize, DEFAULT_HISTORY_SIZE);
|
||||
GETSET_PROPERTY(int32_t, InitialRows, 30);
|
||||
GETSET_PROPERTY(int32_t, InitialCols, 80);
|
||||
|
||||
GETSET_PROPERTY(bool, SnapOnInput, true);
|
||||
GETSET_PROPERTY(uint32_t, CursorColor, DEFAULT_CURSOR_COLOR);
|
||||
GETSET_PROPERTY(CursorStyle, CursorShape, CursorStyle::Vintage);
|
||||
GETSET_PROPERTY(uint32_t, CursorHeight, DEFAULT_CURSOR_HEIGHT);
|
||||
GETSET_PROPERTY(hstring, WordDelimiters, DEFAULT_WORD_DELIMITERS);
|
||||
GETSET_PROPERTY(bool, CopyOnSelect, false);
|
||||
|
||||
// ------------------------ End of Core Settings -----------------------
|
||||
|
||||
hstring ProfileName();
|
||||
void ProfileName(hstring const& value);
|
||||
bool UseAcrylic() noexcept;
|
||||
void UseAcrylic(bool value) noexcept;
|
||||
double TintOpacity() noexcept;
|
||||
void TintOpacity(double value) noexcept;
|
||||
hstring Padding();
|
||||
void Padding(hstring value);
|
||||
GETSET_PROPERTY(hstring, ProfileName);
|
||||
GETSET_PROPERTY(bool, UseAcrylic, false);
|
||||
GETSET_PROPERTY(double, TintOpacity, 0.5);
|
||||
GETSET_PROPERTY(hstring, Padding, DEFAULT_PADDING);
|
||||
GETSET_PROPERTY(hstring, FontFace, DEFAULT_FONT_FACE);
|
||||
GETSET_PROPERTY(int32_t, FontSize, DEFAULT_FONT_SIZE);
|
||||
|
||||
hstring FontFace();
|
||||
void FontFace(hstring const& value);
|
||||
int32_t FontSize() noexcept;
|
||||
void FontSize(int32_t value) noexcept;
|
||||
winrt::Windows::UI::Text::FontWeight FontWeight() noexcept;
|
||||
void FontWeight(winrt::Windows::UI::Text::FontWeight value) noexcept;
|
||||
GETSET_PROPERTY(winrt::Windows::UI::Text::FontWeight, FontWeight);
|
||||
|
||||
hstring BackgroundImage();
|
||||
void BackgroundImage(hstring const& value);
|
||||
double BackgroundImageOpacity() noexcept;
|
||||
void BackgroundImageOpacity(double value) noexcept;
|
||||
winrt::Windows::UI::Xaml::Media::Stretch BackgroundImageStretchMode() noexcept;
|
||||
void BackgroundImageStretchMode(winrt::Windows::UI::Xaml::Media::Stretch value) noexcept;
|
||||
winrt::Windows::UI::Xaml::HorizontalAlignment BackgroundImageHorizontalAlignment() noexcept;
|
||||
void BackgroundImageHorizontalAlignment(winrt::Windows::UI::Xaml::HorizontalAlignment value) noexcept;
|
||||
winrt::Windows::UI::Xaml::VerticalAlignment BackgroundImageVerticalAlignment() noexcept;
|
||||
void BackgroundImageVerticalAlignment(winrt::Windows::UI::Xaml::VerticalAlignment value) noexcept;
|
||||
GETSET_PROPERTY(hstring, BackgroundImage);
|
||||
GETSET_PROPERTY(double, BackgroundImageOpacity, 1.0);
|
||||
|
||||
winrt::Microsoft::Terminal::Settings::IKeyBindings KeyBindings() noexcept;
|
||||
void KeyBindings(winrt::Microsoft::Terminal::Settings::IKeyBindings const& value) noexcept;
|
||||
GETSET_PROPERTY(winrt::Windows::UI::Xaml::Media::Stretch,
|
||||
BackgroundImageStretchMode,
|
||||
winrt::Windows::UI::Xaml::Media::Stretch::UniformToFill);
|
||||
GETSET_PROPERTY(winrt::Windows::UI::Xaml::HorizontalAlignment,
|
||||
BackgroundImageHorizontalAlignment,
|
||||
winrt::Windows::UI::Xaml::HorizontalAlignment::Center);
|
||||
GETSET_PROPERTY(winrt::Windows::UI::Xaml::VerticalAlignment,
|
||||
BackgroundImageVerticalAlignment,
|
||||
winrt::Windows::UI::Xaml::VerticalAlignment::Center);
|
||||
|
||||
hstring Commandline();
|
||||
void Commandline(hstring const& value);
|
||||
GETSET_PROPERTY(IKeyBindings, KeyBindings, nullptr);
|
||||
|
||||
hstring StartingDirectory();
|
||||
void StartingDirectory(hstring const& value);
|
||||
GETSET_PROPERTY(hstring, Commandline);
|
||||
GETSET_PROPERTY(hstring, StartingDirectory);
|
||||
GETSET_PROPERTY(hstring, StartingTitle);
|
||||
GETSET_PROPERTY(bool, SuppressApplicationTitle);
|
||||
GETSET_PROPERTY(hstring, EnvironmentVariables);
|
||||
|
||||
hstring StartingTitle();
|
||||
void StartingTitle(hstring const& value);
|
||||
GETSET_PROPERTY(ScrollbarState, ScrollState, ScrollbarState::Visible);
|
||||
|
||||
bool SuppressApplicationTitle() noexcept;
|
||||
void SuppressApplicationTitle(bool value) noexcept;
|
||||
GETSET_PROPERTY(bool, RetroTerminalEffect, false);
|
||||
GETSET_PROPERTY(bool, ForceFullRepaintRendering, false);
|
||||
GETSET_PROPERTY(bool, SoftwareRendering, false);
|
||||
|
||||
hstring EnvironmentVariables();
|
||||
void EnvironmentVariables(hstring const& value);
|
||||
GETSET_PROPERTY(TextAntialiasingMode, AntialiasingMode, TextAntialiasingMode::Grayscale);
|
||||
|
||||
ScrollbarState ScrollState() const noexcept;
|
||||
void ScrollState(winrt::Microsoft::Terminal::Settings::ScrollbarState const& value) noexcept;
|
||||
|
||||
bool RetroTerminalEffect() noexcept;
|
||||
void RetroTerminalEffect(bool value) noexcept;
|
||||
|
||||
bool ForceFullRepaintRendering() noexcept;
|
||||
void ForceFullRepaintRendering(bool value) noexcept;
|
||||
|
||||
bool SoftwareRendering() noexcept;
|
||||
void SoftwareRendering(bool value) noexcept;
|
||||
|
||||
TextAntialiasingMode AntialiasingMode() const noexcept;
|
||||
void AntialiasingMode(winrt::Microsoft::Terminal::Settings::TextAntialiasingMode const& value) noexcept;
|
||||
#pragma warning(pop)
|
||||
|
||||
private:
|
||||
uint32_t _defaultForeground;
|
||||
uint32_t _defaultBackground;
|
||||
uint32_t _selectionBackground;
|
||||
std::array<uint32_t, COLOR_TABLE_SIZE> _colorTable;
|
||||
int32_t _historySize;
|
||||
int32_t _initialRows;
|
||||
int32_t _initialCols;
|
||||
int32_t _rowsToScroll;
|
||||
bool _snapOnInput;
|
||||
uint32_t _cursorColor;
|
||||
Settings::CursorStyle _cursorShape;
|
||||
uint32_t _cursorHeight;
|
||||
hstring _wordDelimiters;
|
||||
|
||||
hstring _profileName;
|
||||
bool _useAcrylic;
|
||||
double _tintOpacity;
|
||||
hstring _fontFace;
|
||||
int32_t _fontSize;
|
||||
winrt::Windows::UI::Text::FontWeight _fontWeight;
|
||||
hstring _padding;
|
||||
hstring _backgroundImage;
|
||||
double _backgroundImageOpacity;
|
||||
winrt::Windows::UI::Xaml::Media::Stretch _backgroundImageStretchMode;
|
||||
winrt::Windows::UI::Xaml::HorizontalAlignment _backgroundImageHorizontalAlignment;
|
||||
winrt::Windows::UI::Xaml::VerticalAlignment _backgroundImageVerticalAlignment;
|
||||
bool _copyOnSelect;
|
||||
hstring _commandline;
|
||||
hstring _startingDir;
|
||||
hstring _startingTitle;
|
||||
bool _suppressApplicationTitle;
|
||||
hstring _envVars;
|
||||
Settings::IKeyBindings _keyBindings;
|
||||
Settings::ScrollbarState _scrollbarState;
|
||||
|
||||
bool _retroTerminalEffect;
|
||||
bool _forceFullRepaintRendering;
|
||||
bool _softwareRendering;
|
||||
|
||||
Settings::TextAntialiasingMode _antialiasingMode;
|
||||
std::array<uint32_t, COLOR_TABLE_SIZE> _colorTable{};
|
||||
int32_t _rowsToScroll{ 0 };
|
||||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::factory_implementation
|
||||
{
|
||||
struct TerminalSettings : TerminalSettingsT<TerminalSettings, implementation::TerminalSettings>
|
||||
{
|
||||
};
|
||||
BASIC_FACTORY(TerminalSettings);
|
||||
}
|
||||
|
|
|
@ -99,12 +99,12 @@ public:
|
|||
// Use this macro to quick implement both the getter and setter for a property.
|
||||
// This should only be used for simple types where there's no logic in the
|
||||
// getter/setter beyond just accessing/updating the value.
|
||||
#define GETSET_PROPERTY(type, name, ...) \
|
||||
public: \
|
||||
type name() const { return _##name; } \
|
||||
void name(const type& value) { _##name = value; } \
|
||||
\
|
||||
private: \
|
||||
#define GETSET_PROPERTY(type, name, ...) \
|
||||
public: \
|
||||
type name() const noexcept { return _##name; } \
|
||||
void name(const type& value) noexcept { _##name = value; } \
|
||||
\
|
||||
private: \
|
||||
type _##name{ __VA_ARGS__ };
|
||||
|
||||
// Use this macro to quickly implement both the getter and setter for an observable property.
|
||||
|
|
Loading…
Reference in a new issue