From d6eeb6f0a8e4ae5f03a757cc39a5e65bfe2db46e Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 12 Mar 2024 18:13:45 -0500 Subject: [PATCH 1/5] How much faster is the build if we don't have 100 idl files? --- .../Microsoft.Terminal.Settings.Editor.idl | 591 +++++++++ ...Microsoft.Terminal.Settings.Editor.vcxproj | 85 +- .../TerminalSettingsModel/EnumMappings.h | 2 +- .../Microsoft.Terminal.Settings.Model.idl | 1155 +++++++++++++++++ ...crosoft.Terminal.Settings.ModelLib.vcxproj | 69 +- 5 files changed, 1749 insertions(+), 153 deletions(-) create mode 100644 src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.idl create mode 100644 src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl diff --git a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.idl b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.idl new file mode 100644 index 00000000000..9fd302f8611 --- /dev/null +++ b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.idl @@ -0,0 +1,591 @@ +#include "ViewModelHelpers.idl.h" + +#define OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Type, Name) \ + OBSERVABLE_PROJECTED_SETTING(Type, Name); \ + Object Name##OverrideSource { get; } + +#define OBSERVABLE_PROJECTED_PROFILE_SETTING(Type, Name) \ + OBSERVABLE_PROJECTED_SETTING(Type, Name); \ + Object Name##OverrideSource { get; } + +#define COMMA , + +namespace Microsoft.Terminal.Settings.Editor +{ + [default_interface] runtimeclass Actions : Windows.UI.Xaml.Controls.Page + { + Actions(); + ActionsViewModel ViewModel { get; }; + } + + runtimeclass ModifyKeyBindingEventArgs + { + Microsoft.Terminal.Control.KeyChord OldKeys { get; }; + Microsoft.Terminal.Control.KeyChord NewKeys { get; }; + String OldActionName { get; }; + String NewActionName { get; }; + } + + runtimeclass KeyBindingViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + // Settings Model side + String Name { get; }; + String KeyChordText { get; }; + + // UI side + Boolean ShowEditButton { get; }; + Boolean IsInEditMode { get; }; + Boolean IsNewlyAdded { get; }; + Microsoft.Terminal.Control.KeyChord ProposedKeys; + Object ProposedAction; + Windows.UI.Xaml.Controls.Flyout AcceptChangesFlyout; + String EditButtonName { get; }; + String CancelButtonName { get; }; + String AcceptButtonName { get; }; + String DeleteButtonName { get; }; + Windows.UI.Xaml.Media.Brush ContainerBackground { get; }; + + void EnterHoverMode(); + void ExitHoverMode(); + void ActionGotFocus(); + void ActionLostFocus(); + void EditButtonGettingFocus(); + void EditButtonLosingFocus(); + IObservableVector AvailableActions { get; }; + void ToggleEditMode(); + void AttemptAcceptChanges(); + void CancelChanges(); + void DeleteKeyBinding(); + + event Windows.Foundation.TypedEventHandler ModifyKeyBindingRequested; + event Windows.Foundation.TypedEventHandler DeleteKeyBindingRequested; + } + + runtimeclass ActionsViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + ActionsViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); + + void OnAutomationPeerAttached(); + void AddNewKeybinding(); + + IObservableVector KeyBindingList { get; }; + event Windows.Foundation.TypedEventHandler FocusContainer; + event Windows.Foundation.TypedEventHandler UpdateBackground; + } + + delegate void AddNewArgs(Guid profile); + + runtimeclass AddProfilePageNavigationState + { + Microsoft.Terminal.Settings.Model.CascadiaSettings Settings; + void RequestAddNew(); + void RequestDuplicate(Guid profile); + event AddNewArgs AddNew; + }; + + [default_interface] runtimeclass AddProfile : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged + { + AddProfile(); + AddProfilePageNavigationState State { get; }; + Boolean IsProfileSelected { get; }; + } + + runtimeclass Font : Windows.Foundation.IStringable + { + String Name { get; }; + String LocalizedName { get; }; + Boolean HasPowerlineCharacters { get; }; + Windows.Foundation.Collections.IMap FontAxesTagsAndNames { get; }; + Windows.Foundation.Collections.IMap FontFeaturesTagsAndNames { get; }; + } + + // We have to make this because we cannot bind an IObservableMap to a ListView in XAML (in c++) + // So instead we make an IObservableVector of these AxisKeyValuePair objects + runtimeclass AxisKeyValuePair : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + AxisKeyValuePair(String axisKey, Single axisValue, Windows.Foundation.Collections.IMap baseMap, Windows.Foundation.Collections.IMap tagToNameMap); + String AxisKey; + Single AxisValue; + Int32 AxisIndex; + } + + runtimeclass FeatureKeyValuePair : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + FeatureKeyValuePair(String featureKey, UInt32 featureValue, Windows.Foundation.Collections.IMap baseMap, Windows.Foundation.Collections.IMap tagToNameMap); + String FeatureKey; + UInt32 FeatureValue; + Int32 FeatureIndex; + } + + runtimeclass AppearanceViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + Boolean IsDefault; + + void SetFontWeightFromDouble(Double fontWeight); + void SetBackgroundImageOpacityFromPercentageValue(Double percentageValue); + void SetBackgroundImagePath(String path); + + Boolean UseDesktopBGImage; + Boolean BackgroundImageSettingsVisible { get; }; + + void ClearColorScheme(); + ColorSchemeViewModel CurrentColorScheme; + Windows.Foundation.Collections.IObservableVector SchemesList; + + void AddNewAxisKeyValuePair(); + void DeleteAxisKeyValuePair(String key); + void InitializeFontAxesVector(); + Boolean AreFontAxesAvailable { get; }; + Boolean CanFontAxesBeAdded { get; }; + Windows.Foundation.Collections.IObservableVector FontAxesVector; + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.Foundation.Collections.IMap, FontAxes); + + void AddNewFeatureKeyValuePair(); + void DeleteFeatureKeyValuePair(String key); + void InitializeFontFeaturesVector(); + Boolean AreFontFeaturesAvailable { get; }; + Boolean CanFontFeaturesBeAdded { get; }; + Windows.Foundation.Collections.IObservableVector FontFeaturesVector; + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.Foundation.Collections.IMap, FontFeatures); + + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, FontFace); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Single, FontSize); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Double, LineHeight); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.UI.Text.FontWeight, FontWeight); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Boolean, EnableBuiltinGlyphs); + + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, DarkColorSchemeName); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, LightColorSchemeName); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Boolean, RetroTerminalEffect); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Core.CursorStyle, CursorShape); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(UInt32, CursorHeight); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, BackgroundImagePath); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Double, BackgroundImageOpacity); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.UI.Xaml.Media.Stretch, BackgroundImageStretchMode); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Settings.Model.ConvergedAlignment, BackgroundImageAlignment); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Settings.Model.IntenseStyle, IntenseTextStyle); + OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Core.AdjustTextMode, AdjustIndistinguishableColors); + } + + [default_interface] runtimeclass Appearances : Windows.UI.Xaml.Controls.UserControl, Windows.UI.Xaml.Data.INotifyPropertyChanged + { + Appearances(); + AppearanceViewModel Appearance; + ProfileViewModel SourceProfile; + IHostedInWindow WindowRoot; + static Windows.UI.Xaml.DependencyProperty AppearanceProperty { get; }; + + Boolean UsingMonospaceFont { get; }; + Boolean ShowAllFonts; + Boolean ShowProportionalFontWarning; + + IInspectable CurrentCursorShape; + Boolean IsVintageCursor { get; }; + Windows.Foundation.Collections.IObservableVector CursorShapeList { get; }; + + IInspectable CurrentAdjustIndistinguishableColors; + Windows.Foundation.Collections.IObservableVector AdjustIndistinguishableColorsList { get; }; + + IInspectable CurrentBackgroundImageStretchMode; + Windows.Foundation.Collections.IObservableVector BackgroundImageStretchModeList { get; }; + + IInspectable CurrentFontWeight; + Boolean IsCustomFontWeight { get; }; + Windows.Foundation.Collections.IObservableVector FontWeightList { get; }; + + IInspectable CurrentFontFace { get; }; + Windows.UI.Xaml.Controls.Slider BIOpacitySlider { get; }; + + IInspectable CurrentIntenseTextStyle; + Windows.Foundation.Collections.IObservableVector IntenseTextStyleList { get; }; + } + + [default_interface] runtimeclass ColorSchemes : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged + { + ColorSchemes(); + + ColorSchemesPageViewModel ViewModel { get; }; + } + + enum ColorSchemesSubPage + { + Base = 0, + EditColorScheme = 1 + }; + + runtimeclass ColorSchemesPageViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + ColorSchemesPageViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); + void UpdateSettings(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); + + ColorSchemeViewModel RequestAddNew(); + Boolean RequestRenameCurrentScheme(String newName); + void RequestDeleteCurrentScheme(); + void RequestDuplicateCurrentScheme(); + void RequestEditSelectedScheme(); + void RequestSetSelectedSchemeAsDefault(); + + ColorSchemeViewModel CurrentScheme; + Boolean HasCurrentScheme { get; }; + Boolean CanDeleteCurrentScheme { get; }; + ColorSchemesSubPage CurrentPage; + Windows.Foundation.Collections.IObservableVector AllColorSchemes { get; }; + + void SchemeListItemClicked(IInspectable sender, Windows.UI.Xaml.Controls.ItemClickEventArgs args); + } + + runtimeclass ColorSchemeViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged, Windows.Foundation.IStringable + { + String Name; + Boolean IsEditable { get; }; + Boolean IsDefaultScheme { get; }; + + Boolean RequestRename(String newName); + + // Terminal Colors + Windows.Foundation.Collections.IVector NonBrightColorTable; + Windows.Foundation.Collections.IVector BrightColorTable; + + ColorTableEntry ColorEntryAt(UInt32 Index); + + // System Colors + ColorTableEntry ForegroundColor; + ColorTableEntry BackgroundColor; + ColorTableEntry CursorColor; + ColorTableEntry SelectionBackgroundColor; + + void DeleteConfirmation_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); + void SetAsDefault_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); + void Duplicate_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); + } + + [default_interface] runtimeclass ColorTableEntry : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + String Name { get; }; + IInspectable Tag; + Windows.UI.Color Color; + String AccessibleName { get; }; + } + + [default_interface] runtimeclass EditColorScheme : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged + { + EditColorScheme(); + + ColorSchemeViewModel ViewModel { get; }; + } + + [default_interface] runtimeclass EnumEntry : Windows.UI.Xaml.Data.INotifyPropertyChanged, Windows.Foundation.IStringable + { + String EnumName { get; }; + IInspectable EnumValue { get; }; + } + + [default_interface] runtimeclass GlobalAppearance : Windows.UI.Xaml.Controls.Page + { + GlobalAppearance(); + GlobalAppearanceViewModel ViewModel { get; }; + } + + runtimeclass GlobalAppearanceViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + GlobalAppearanceViewModel(Microsoft.Terminal.Settings.Model.GlobalAppSettings globalSettings); + + static String LanguageDisplayConverter(String tag); + Boolean LanguageSelectorAvailable { get; }; + Windows.Foundation.Collections.IObservableVector LanguageList { get; }; + IInspectable CurrentLanguage; + + IInspectable CurrentTheme; + static String ThemeNameConverter(Microsoft.Terminal.Settings.Model.Theme theme); + Windows.Foundation.Collections.IObservableVector ThemeList { get; }; + + IInspectable CurrentNewTabPosition; + Windows.Foundation.Collections.IObservableVector NewTabPositionList { get; }; + + IInspectable CurrentTabWidthMode; + Windows.Foundation.Collections.IObservableVector TabWidthModeList { get; }; + + Boolean InvertedDisableAnimations; + + void ShowTitlebarToggled(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); + + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AlwaysShowTabs); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowTabsInTitlebar); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, UseAcrylicInTabRow); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowTitleInTitlebar); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AlwaysOnTop); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AutoHideWindow); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AlwaysShowNotificationIcon); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, MinimizeToNotificationArea); + } + + [default_interface] runtimeclass Interaction : Windows.UI.Xaml.Controls.Page + { + Interaction(); + InteractionViewModel ViewModel { get; }; + } + + runtimeclass InteractionViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + InteractionViewModel(Microsoft.Terminal.Settings.Model.GlobalAppSettings globalSettings); + + IInspectable CurrentTabSwitcherMode; + Windows.Foundation.Collections.IObservableVector TabSwitcherModeList { get; }; + + IInspectable CurrentCopyFormat; + Windows.Foundation.Collections.IObservableVector CopyFormatList { get; }; + + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, CopyOnSelect); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, TrimBlockSelection); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, TrimPaste); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, SnapToGridOnResize); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, FocusFollowMouse); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, DetectURLs); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(String, WordDelimiters); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ConfirmCloseAllTabs); + } + + [default_interface] runtimeclass KeyChordListener : Windows.UI.Xaml.Controls.UserControl + { + KeyChordListener(); + + Microsoft.Terminal.Control.KeyChord Keys; + static Windows.UI.Xaml.DependencyProperty KeysProperty { get; }; + } + + [default_interface] runtimeclass Launch : Windows.UI.Xaml.Controls.Page + { + Launch(); + LaunchViewModel ViewModel { get; }; + } + + runtimeclass LaunchViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + LaunchViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); + + String LaunchParametersCurrentValue { get; }; + Double InitialPosX; + Double InitialPosY; + Boolean UseDefaultLaunchPosition; + + IInspectable CurrentDefaultProfile; + IObservableVector DefaultProfiles { get; }; + + IInspectable CurrentDefaultTerminal; + IObservableVector DefaultTerminals { get; }; + + IInspectable CurrentFirstWindowPreference; + IObservableVector FirstWindowPreferenceList { get; }; + + IInspectable CurrentLaunchMode; + IObservableVector LaunchModeList { get; }; + + IInspectable CurrentWindowingBehavior; + IObservableVector WindowingBehaviorList { get; }; + + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, CenterOnLaunch); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, StartOnUserLogin); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Int32, InitialRows); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Int32, InitialCols); + } + + // Due to a XAML Compiler bug, it is hard for us to propagate an HWND into a XAML-using runtimeclass. + // To work around that, we'll only propagate the HWND (when we need to) into the settings' toplevel page + // and use IHostedInWindow to hide the implementation detail where we use IInitializeWithWindow (shobjidl_core) + // https://github.com/microsoft/microsoft-ui-xaml/issues/3331 + interface IHostedInWindow + { + Boolean TryPropagateHostingWindow(IInspectable i); + UInt64 GetHostingWindow(); + } + + enum BreadcrumbSubPage + { + None = 0, + Profile_Appearance, + Profile_Advanced, + ColorSchemes_Edit + }; + + runtimeclass Breadcrumb : Windows.Foundation.IStringable + { + IInspectable Tag; + String Label; + BreadcrumbSubPage SubPage; + } + + [default_interface] runtimeclass MainPage : Windows.UI.Xaml.Controls.Page, IHostedInWindow + { + MainPage(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); + + void UpdateSettings(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); + event Windows.Foundation.TypedEventHandler OpenJson; + + // Due to the aforementioned bug, we can't use IInitializeWithWindow _here_ either. + // Let's just smuggle the HWND in as a UInt64 :| + void SetHostingWindow(UInt64 window); + + Windows.Foundation.Collections.IObservableVector Breadcrumbs { get; }; + + Windows.UI.Xaml.Media.Brush BackgroundBrush { get; }; + } + + [default_interface] runtimeclass Profiles_Advanced : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged + { + Profiles_Advanced(); + ProfileViewModel Profile { get; }; + } + + [default_interface] runtimeclass Profiles_Appearance : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged + { + Profiles_Appearance(); + ProfileViewModel Profile { get; }; + IHostedInWindow WindowRoot { get; }; + + Windows.UI.Xaml.Controls.Slider OpacitySlider { get; }; + } + + [default_interface] runtimeclass Profiles_Base : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged + { + Profiles_Base(); + ProfileViewModel Profile { get; }; + } + + runtimeclass NavigateToProfileArgs + { + ProfileViewModel Profile { get; }; + IHostedInWindow WindowRoot { get; }; + } + + runtimeclass DeleteProfileEventArgs + { + Guid ProfileGuid { get; }; + } + + enum ProfileSubPage + { + Base = 0, + Appearance = 1, + Advanced = 2 + }; + + runtimeclass ProfileViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + static Windows.Foundation.Collections.IObservableVector CompleteFontList { get; }; + static Windows.Foundation.Collections.IObservableVector MonospaceFontList { get; }; + static Font FindFontWithLocalizedName(String name); + + Microsoft.Terminal.Settings.Model.TerminalSettings TermSettings { get; }; + + event Windows.Foundation.TypedEventHandler DeleteProfile; + + void SetupAppearances(Windows.Foundation.Collections.IObservableVector schemesList); + + void SetAcrylicOpacityPercentageValue(Double value); + void SetPadding(Double value); + + Boolean IsBellStyleFlagSet(UInt32 flag); + void SetBellStyleAudible(Windows.Foundation.IReference on); + void SetBellStyleWindow(Windows.Foundation.IReference on); + void SetBellStyleTaskbar(Windows.Foundation.IReference on); + + IInspectable CurrentAntiAliasingMode; + Windows.Foundation.Collections.IObservableVector AntiAliasingModeList { get; }; + + IInspectable CurrentCloseOnExitMode; + Windows.Foundation.Collections.IObservableVector CloseOnExitModeList { get; }; + + IInspectable CurrentScrollState; + Windows.Foundation.Collections.IObservableVector ScrollStateList { get; }; + + Boolean CanDeleteProfile { get; }; + Boolean FocusDeleteButton; + Boolean IsBaseLayer; + ProfileSubPage CurrentPage; + Boolean UseParentProcessDirectory; + Boolean UseCustomStartingDirectory { get; }; + Boolean HideIcon; + AppearanceViewModel DefaultAppearance { get; }; + Guid OriginalProfileGuid { get; }; + Boolean HasUnfocusedAppearance { get; }; + Boolean EditableUnfocusedAppearance { get; }; + Boolean ShowUnfocusedAppearance { get; }; + AppearanceViewModel UnfocusedAppearance { get; }; + Boolean VtPassthroughAvailable { get; }; + + String EvaluatedIcon { get; }; + + void CreateUnfocusedAppearance(); + void DeleteUnfocusedAppearance(); + + OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Name); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, Guid); + OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Source); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, ConnectionType); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, Hidden); + OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Icon); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.CloseOnExitMode, CloseOnExit); + OBSERVABLE_PROJECTED_PROFILE_SETTING(String, TabTitle); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, TabColor); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SuppressApplicationTitle); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, UseAcrylic); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Double, Opacity); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState); + OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Padding); + OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Commandline); + OBSERVABLE_PROJECTED_PROFILE_SETTING(String, StartingDirectory); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Control.TextAntialiasingMode, AntialiasingMode); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, Foreground); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, Background); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, SelectionBackground); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, CursorColor); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Int32, HistorySize); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SnapOnInput); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, AltGrAliasing); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.BellStyle, BellStyle); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, Elevate); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, VtPassthrough); + OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, ReloadEnvironmentVariables); + } + + [default_interface] runtimeclass Rendering : Windows.UI.Xaml.Controls.Page + { + Rendering(); + RenderingViewModel ViewModel { get; }; + } + + runtimeclass RenderingViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + RenderingViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); + + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ForceFullRepaintRendering); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, SoftwareRendering); + } + + [default_interface] runtimeclass SettingContainer : Windows.UI.Xaml.Controls.ContentControl + { + SettingContainer(); + + void SetExpanded(Boolean expanded); + + IInspectable Header; + static Windows.UI.Xaml.DependencyProperty HeaderProperty { get; }; + + String HelpText; + static Windows.UI.Xaml.DependencyProperty HelpTextProperty { get; }; + + String CurrentValue; + static Windows.UI.Xaml.DependencyProperty CurrentValueProperty { get; }; + + Boolean HasSettingValue; + static Windows.UI.Xaml.DependencyProperty HasSettingValueProperty { get; }; + + IInspectable SettingOverrideSource; + static Windows.UI.Xaml.DependencyProperty SettingOverrideSourceProperty { get; }; + + Boolean StartExpanded; + static Windows.UI.Xaml.DependencyProperty StartExpandedProperty { get; }; + + event Windows.Foundation.TypedEventHandler ClearSettingValue; + }; +} diff --git a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj index 836ec79a904..4b10476f8fa 100644 --- a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj +++ b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.vcxproj @@ -48,7 +48,6 @@ AddProfile.xaml - EnumEntry.idl GlobalAppearance.xaml @@ -75,35 +74,27 @@ MainPage.xaml - ProfileViewModel.idl Code - ActionsViewModel.idl Code - ColorSchemeViewModel.idl Code - ColorSchemesPageViewModel.idl Code - RenderingViewModel.idl Code - InteractionViewModel.idl Code - GlobalAppearanceViewModel.idl Code - LaunchViewModel.idl Code @@ -126,7 +117,6 @@ Rendering.xaml - SettingContainer.idl @@ -218,35 +208,27 @@ - ProfileViewModel.idl Code - ActionsViewModel.idl Code - ColorSchemeViewModel.idl Code - ColorSchemesPageViewModel.idl Code - RenderingViewModel.idl Code - InteractionViewModel.idl Code - GlobalAppearanceViewModel.idl Code - LaunchViewModel.idl Code @@ -269,7 +251,6 @@ Rendering.xaml - SettingContainer.idl @@ -278,71 +259,7 @@ - - Actions.xaml - Code - - - AddProfile.xaml - Code - - - - GlobalAppearance.xaml - Code - - - ColorSchemes.xaml - Code - - - EditColorScheme.xaml - Code - - - KeyChordListener.xaml - Code - - - Launch.xaml - Code - - - Interaction.xaml - Code - - - Rendering.xaml - Code - - - MainPage.xaml - - - - - - - - - - - Profiles_Base.xaml - Code - - - Profiles_Advanced.xaml - Code - - - Profiles_Appearance.xaml - Code - - - Appearances.xaml - Code - - + Code diff --git a/src/cascadia/TerminalSettingsModel/EnumMappings.h b/src/cascadia/TerminalSettingsModel/EnumMappings.h index dfdd6c46502..4d25fe434a3 100644 --- a/src/cascadia/TerminalSettingsModel/EnumMappings.h +++ b/src/cascadia/TerminalSettingsModel/EnumMappings.h @@ -20,7 +20,7 @@ Author(s): namespace winrt::Microsoft::Terminal::Settings::Model::implementation { - struct EnumMappings : EnumMappingsT + struct EnumMappings { public: EnumMappings() = default; diff --git a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl new file mode 100644 index 00000000000..5b71a8e2f54 --- /dev/null +++ b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl @@ -0,0 +1,1155 @@ +#include "AllShortcutActions.h" +#include "IInheritable.idl.h" + +#define INHERITABLE_FONT_SETTING(Type, Name) \ + _BASE_INHERITABLE_SETTING(Type, Name); \ + Microsoft.Terminal.Settings.Model.FontConfig Name##OverrideSource { get; } + +#define INHERITABLE_APPEARANCE_SETTING(Type, Name) \ + _BASE_INHERITABLE_SETTING(Type, Name); \ + Microsoft.Terminal.Settings.Model.IAppearanceConfig Name##OverrideSource { get; } + +#define INHERITABLE_PROFILE_SETTING(Type, Name) \ + _BASE_INHERITABLE_SETTING(Type, Name); \ + Microsoft.Terminal.Settings.Model.Profile Name##OverrideSource { get; } + +#define COMMA , + +namespace Microsoft.Terminal.Settings.Model +{ + runtimeclass Command; + + // MIDL 3 allows for structs to hold nullable types + // Though IReference is a WinRT object, MIDL 3 + // handles all of the ownership logic for us. + // Docs: https://docs.microsoft.com/en-us/uwp/midl-3/intro#types + struct LaunchPosition + { + Windows.Foundation.IReference X; + Windows.Foundation.IReference Y; + }; + + [flags] + enum LaunchMode + { + DefaultMode = 0, + MaximizedMode = 1, + FullscreenMode = 2, + FocusMode = 4, + MaximizedFocusMode = 5 + }; + + enum WindowingMode + { + UseNew, + UseAnyExisting, + UseExisting, + }; + + enum FirstWindowPreference + { + DefaultProfile, + PersistedWindowLayout, + }; + + enum NewTabPosition + { + AfterLastTab, + AfterCurrentTab, + }; + + + interface IActionArgs + { + Boolean Equals(IActionArgs other); + String GenerateName(); + IActionArgs Copy(); + UInt64 Hash(); + }; + + interface IActionEventArgs + { + Boolean Handled; + IActionArgs ActionArgs { get; }; + }; + + enum ResizeDirection + { + None = 0, + Left, + Right, + Up, + Down + }; + + enum FocusDirection + { + None = 0, + Left, + Right, + Up, + Down, + Previous, + PreviousInOrder, + NextInOrder, + First, + Parent, + Child + }; + + enum SplitDirection + { + Automatic = 0, + Up, + Right, + Down, + Left + }; + + enum SplitType + { + Manual = 0, + Duplicate = 1 + }; + + enum SettingsTarget + { + SettingsFile = 0, + DefaultsFile, + AllFiles, + SettingsUI + }; + + enum MoveTabDirection + { + None = 0, + Forward, + Backward + }; + + enum FindMatchDirection + { + None = 0, + Next, + Previous + }; + + enum SelectOutputDirection + { + Previous = 0, + Next, + }; + + enum CommandPaletteLaunchMode + { + Action = 0, + CommandLine + }; + + enum TabSwitcherMode + { + MostRecentlyUsed, + InOrder, + Disabled, + }; + + enum DesktopBehavior + { + Any, + ToCurrent, + OnCurrent, + }; + + enum MonitorBehavior + { + Any, + ToCurrent, + ToMouse, + }; + + [flags] + enum SuggestionsSource + { + Tasks = 0x1, + CommandHistory = 0x2, + DirectoryHistory = 0x4, + All = 0xffffffff, + }; + + runtimeclass NewTerminalArgs { + NewTerminalArgs(); + NewTerminalArgs(Int32 profileIndex); + NewTerminalArgs Copy(); + + String Commandline; + String StartingDirectory; + String TabTitle; + Windows.Foundation.IReference TabColor; + String Profile; // Either a GUID or a profile's name if the GUID isn't a match + Boolean AppendCommandLine; + + // We use IReference<> to treat some args as nullable where null means + // "use the inherited value". See ProfileIndex, + // SuppressApplicationTitle, Elevate. Strings that behave this way just + // use `null` as "use the inherited value". + + // ProfileIndex can be null (for "use the default"), so this needs to be + // a IReference, so it's nullable + Windows.Foundation.IReference ProfileIndex { get; }; + Windows.Foundation.IReference SuppressApplicationTitle; + String ColorScheme; + // This needs to be an optional so that the default value (null) does + // not modify whatever the profile's value is (either true or false) + Windows.Foundation.IReference Elevate; + // Similarly with ReloadEnvironmentVariables + Windows.Foundation.IReference ReloadEnvironmentVariables; + + UInt64 ContentId{ get; set; }; + + Boolean Equals(NewTerminalArgs other); + String GenerateName(); + String ToCommandline(); + UInt64 Hash(); + }; + + [default_interface] runtimeclass ActionEventArgs : IActionEventArgs + { + ActionEventArgs(); + ActionEventArgs(IActionArgs args); + }; + + [default_interface] runtimeclass CopyTextArgs : IActionArgs + { + CopyTextArgs(); + Boolean DismissSelection { get; }; + Boolean SingleLine { get; }; + Windows.Foundation.IReference CopyFormatting { get; }; + }; + + [default_interface] runtimeclass NewTabArgs : IActionArgs + { + NewTabArgs(NewTerminalArgs terminalArgs); + NewTerminalArgs TerminalArgs { get; }; + }; + + [default_interface] runtimeclass MovePaneArgs : IActionArgs + { + MovePaneArgs(UInt32 tabIndex, String Window); + UInt32 TabIndex; + String Window; + }; + + [default_interface] runtimeclass SwitchToTabArgs : IActionArgs + { + SwitchToTabArgs(UInt32 tabIndex); + UInt32 TabIndex; + }; + + [default_interface] runtimeclass ResizePaneArgs : IActionArgs + { + ResizeDirection ResizeDirection { get; }; + }; + + [default_interface] runtimeclass MoveFocusArgs : IActionArgs + { + MoveFocusArgs(FocusDirection direction); + FocusDirection FocusDirection { get; }; + }; + + [default_interface] runtimeclass SwapPaneArgs : IActionArgs + { + SwapPaneArgs(FocusDirection direction); + FocusDirection Direction { get; }; + }; + + [default_interface] runtimeclass AdjustFontSizeArgs : IActionArgs + { + Single Delta { get; }; + }; + + [default_interface] runtimeclass SendInputArgs : IActionArgs + { + String Input { get; }; + }; + + [default_interface] runtimeclass SplitPaneArgs : IActionArgs + { + SplitPaneArgs(SplitType splitMode, SplitDirection split, Double size, NewTerminalArgs terminalArgs); + SplitPaneArgs(SplitDirection split, Double size, NewTerminalArgs terminalArgs); + SplitPaneArgs(SplitDirection split, NewTerminalArgs terminalArgs); + SplitPaneArgs(SplitType splitMode); + + SplitDirection SplitDirection { get; }; + NewTerminalArgs TerminalArgs { get; }; + SplitType SplitMode { get; }; + Double SplitSize { get; }; + }; + + [default_interface] runtimeclass OpenSettingsArgs : IActionArgs + { + OpenSettingsArgs(SettingsTarget target); + SettingsTarget Target { get; }; + }; + + [default_interface] runtimeclass SetFocusModeArgs : IActionArgs + { + SetFocusModeArgs(Boolean isFocusMode); + Boolean IsFocusMode { get; }; + }; + + [default_interface] runtimeclass SetFullScreenArgs : IActionArgs + { + SetFullScreenArgs(Boolean isFullScreen); + Boolean IsFullScreen { get; }; + }; + + [default_interface] runtimeclass SetMaximizedArgs : IActionArgs + { + SetMaximizedArgs(Boolean isMaximized); + Boolean IsMaximized { get; }; + }; + + [default_interface] runtimeclass SetColorSchemeArgs : IActionArgs + { + SetColorSchemeArgs(String name); + String SchemeName { get; }; + }; + + [default_interface] runtimeclass SetTabColorArgs : IActionArgs + { + SetTabColorArgs(Windows.UI.Color tabColor); + Windows.Foundation.IReference TabColor { get; }; + }; + + [default_interface] runtimeclass RenameTabArgs : IActionArgs + { + RenameTabArgs(String title); + String Title { get; }; + }; + + [default_interface] runtimeclass ExecuteCommandlineArgs : IActionArgs + { + ExecuteCommandlineArgs(String commandline); + String Commandline; + }; + + [default_interface] runtimeclass CloseOtherTabsArgs : IActionArgs + { + CloseOtherTabsArgs(UInt32 tabIndex); + Windows.Foundation.IReference Index { get; }; + }; + + [default_interface] runtimeclass CloseTabsAfterArgs : IActionArgs + { + CloseTabsAfterArgs(UInt32 tabIndex); + Windows.Foundation.IReference Index { get; }; + }; + + [default_interface] runtimeclass CloseTabArgs : IActionArgs + { + CloseTabArgs(UInt32 tabIndex); + Windows.Foundation.IReference Index { get; }; + }; + + [default_interface] runtimeclass MoveTabArgs : IActionArgs + { + MoveTabArgs(String window, MoveTabDirection direction); + MoveTabDirection Direction { get; }; + String Window { get; }; + }; + + [default_interface] runtimeclass ScrollUpArgs : IActionArgs + { + Windows.Foundation.IReference RowsToScroll { get; }; + }; + + [default_interface] runtimeclass ScrollDownArgs : IActionArgs + { + Windows.Foundation.IReference RowsToScroll { get; }; + }; + + + [default_interface] runtimeclass ScrollToMarkArgs : IActionArgs + { + Microsoft.Terminal.Control.ScrollToMarkDirection Direction { get; }; + }; + + [default_interface] runtimeclass AddMarkArgs : IActionArgs + { + Windows.Foundation.IReference Color { get; }; + }; + + [default_interface] runtimeclass ToggleCommandPaletteArgs : IActionArgs + { + CommandPaletteLaunchMode LaunchMode { get; }; + }; + + [default_interface] runtimeclass SuggestionsArgs : IActionArgs + { + SuggestionsArgs(); + SuggestionsArgs(SuggestionsSource source, Boolean useCommandline); + SuggestionsSource Source { get; }; + Boolean UseCommandline { get; }; + }; + + [default_interface] runtimeclass FindMatchArgs : IActionArgs + { + FindMatchArgs(FindMatchDirection direction); + FindMatchDirection Direction { get; }; + }; + + [default_interface] runtimeclass NewWindowArgs : IActionArgs + { + NewWindowArgs(NewTerminalArgs terminalArgs); + NewTerminalArgs TerminalArgs { get; }; + }; + + [default_interface] runtimeclass PrevTabArgs : IActionArgs + { + PrevTabArgs(); + PrevTabArgs(TabSwitcherMode SwitcherMode); + Windows.Foundation.IReference SwitcherMode; + }; + + [default_interface] runtimeclass NextTabArgs : IActionArgs + { + NextTabArgs(); + NextTabArgs(TabSwitcherMode SwitcherMode); + Windows.Foundation.IReference SwitcherMode; + }; + + [default_interface] runtimeclass RenameWindowArgs : IActionArgs + { + RenameWindowArgs(String name); + String Name { get; }; + }; + + [default_interface] runtimeclass SearchForTextArgs : IActionArgs + { + String QueryUrl { get; }; + }; + + [default_interface] runtimeclass GlobalSummonArgs : IActionArgs + { + String Name { get; }; + DesktopBehavior Desktop { get; }; + MonitorBehavior Monitor { get; }; + Boolean ToggleVisibility { get; }; + UInt32 DropdownDuration { get; }; + }; + + [default_interface] runtimeclass FocusPaneArgs : IActionArgs + { + FocusPaneArgs(UInt32 Id); + UInt32 Id { get; }; + }; + + [default_interface] runtimeclass ExportBufferArgs : IActionArgs + { + ExportBufferArgs(String path); + String Path { get; }; + }; + + [default_interface] runtimeclass ClearBufferArgs : IActionArgs + { + ClearBufferArgs(Microsoft.Terminal.Control.ClearBufferType clear); + Microsoft.Terminal.Control.ClearBufferType Clear { get; }; + }; + + [default_interface] runtimeclass MultipleActionsArgs : IActionArgs + { + MultipleActionsArgs(); + Windows.Foundation.Collections.IVector Actions; + }; + + [default_interface] runtimeclass AdjustOpacityArgs : IActionArgs + { + AdjustOpacityArgs(); + Int32 Opacity { get; }; + Boolean Relative { get; }; + }; + + [default_interface] runtimeclass ColorSelectionArgs : IActionArgs + { + Microsoft.Terminal.Control.SelectionColor Foreground; + Microsoft.Terminal.Control.SelectionColor Background; + Microsoft.Terminal.Core.MatchMode MatchMode { get; }; + }; + + [default_interface] runtimeclass SelectCommandArgs : IActionArgs + { + SelectCommandArgs(SelectOutputDirection direction); + SelectOutputDirection Direction { get; }; + } + [default_interface] runtimeclass SelectOutputArgs : IActionArgs + { + SelectOutputArgs(SelectOutputDirection direction); + SelectOutputDirection Direction { get; }; + } + + // This interface ensures that no changes are made to ActionMap + interface IActionMapView + { + Boolean IsKeyChordExplicitlyUnbound(Microsoft.Terminal.Control.KeyChord keys); + + Command GetActionByKeyChord(Microsoft.Terminal.Control.KeyChord keys); + + Microsoft.Terminal.Control.KeyChord GetKeyBindingForAction(ShortcutAction action); + [method_name("GetKeyBindingForActionWithArgs")] Microsoft.Terminal.Control.KeyChord GetKeyBindingForAction(ShortcutAction action, IActionArgs actionArgs); + + Windows.Foundation.Collections.IMapView AvailableActions { get; }; + + Windows.Foundation.Collections.IMapView NameMap { get; }; + Windows.Foundation.Collections.IMapView KeyBindings { get; }; + Windows.Foundation.Collections.IMapView GlobalHotkeys { get; }; + + IVector ExpandedCommands { get; }; + + IVector FilterToSendInput(String CurrentCommandline); + }; + + [default_interface] runtimeclass ActionMap : IActionMapView + { + void RebindKeys(Microsoft.Terminal.Control.KeyChord oldKeys, Microsoft.Terminal.Control.KeyChord newKeys); + void DeleteKeyBinding(Microsoft.Terminal.Control.KeyChord keys); + + void RegisterKeyBinding(Microsoft.Terminal.Control.KeyChord keys, ActionAndArgs action); + } + + runtimeclass AppearanceConfig : [default] IAppearanceConfig { + } + + enum InfoBarMessage + { + CloseOnExitInfo = 0, + KeyboardServiceWarning, + SetAsDefault, + }; + + runtimeclass WindowLayout + { + WindowLayout(); + + static String ToJson(WindowLayout layout); + static WindowLayout FromJson(String json); + + Windows.Foundation.Collections.IVector TabLayout; + Windows.Foundation.IReference InitialPosition; + Windows.Foundation.IReference InitialSize; + Windows.Foundation.IReference LaunchMode; + }; + + runtimeclass ApplicationState { + static ApplicationState SharedInstance(); + + void Flush(); + void Reset(); + + String SettingsHash; + Windows.Foundation.Collections.IVector PersistedWindowLayouts; + Windows.Foundation.Collections.IVector RecentCommands; + Windows.Foundation.Collections.IVector DismissedMessages; + Windows.Foundation.Collections.IVector AllowedCommandlines; + } + + runtimeclass CascadiaSettings { + static CascadiaSettings LoadDefaults(); + static CascadiaSettings LoadAll(); + + static String SettingsPath { get; }; + static String DefaultSettingsPath { get; }; + static Boolean IsPortableMode { get; }; + + static String ApplicationDisplayName { get; }; + static String ApplicationVersion { get; }; + + static void ExportFile(String path, String content); + + CascadiaSettings(String userJSON, String inboxJSON); + + CascadiaSettings Copy(); + void WriteSettingsToDisk(); + + String Hash { get; }; + + GlobalAppSettings GlobalSettings { get; }; + + Profile ProfileDefaults { get; }; + + IObservableVector AllProfiles { get; }; + IObservableVector ActiveProfiles { get; }; + + Profile DuplicateProfile(Profile sourceProfile); + + ActionMap ActionMap { get; }; + + IVectorView Warnings { get; }; + Windows.Foundation.IReference GetLoadingError { get; }; + String GetSerializationErrorMessage { get; }; + + Profile CreateNewProfile(); + Profile FindProfile(Guid profileGuid); + void UpdateColorSchemeReferences(String oldName, String newName); + + Profile GetProfileForArgs(NewTerminalArgs newTerminalArgs); + + static Boolean IsDefaultTerminalAvailable { get; }; + static Boolean IsDefaultTerminalSet { get; }; + IObservableVector DefaultTerminals { get; }; + DefaultTerminal CurrentDefaultTerminal; + + void ExpandCommands(); + } + + runtimeclass ColorScheme : Windows.Foundation.IStringable, ISettingsModelObject { + ColorScheme(); + ColorScheme(String name); + + String Name; + + Microsoft.Terminal.Core.Color Foreground; + Microsoft.Terminal.Core.Color Background; + Microsoft.Terminal.Core.Color SelectionBackground; + Microsoft.Terminal.Core.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.Core.Scheme ToCoreScheme(); + } + + enum ShortcutAction + { + Invalid = 0, // treat Invalid as unbound actions + + // When adding a new action, add them to AllShortcutActions.h! + #define ON_ALL_ACTIONS(action) action, + ALL_SHORTCUT_ACTIONS + #undef ON_ALL_ACTIONS + }; + + runtimeclass ActionAndArgs { + ActionAndArgs(); + ActionAndArgs(ShortcutAction action, IActionArgs args); + + static String Serialize(IVector args); + static IVector Deserialize(String content); + + IActionArgs Args; + ShortcutAction Action; + }; + + runtimeclass Command + { + Command(); + + String Name { get; }; + ActionAndArgs ActionAndArgs { get; }; + Microsoft.Terminal.Control.KeyChord Keys { get; }; + void RegisterKey(Microsoft.Terminal.Control.KeyChord keys); + String KeyChordText { get; }; + + String IconPath; + + Boolean HasNestedCommands { get; }; + Windows.Foundation.Collections.IMapView NestedCommands { get; }; + + static IVector ParsePowerShellMenuComplete(String json, Int32 replaceLength); + static IVector HistoryToCommands(IVector commandHistory, String commandline, Boolean directories); + + } + + runtimeclass DefaultTerminal : Windows.Foundation.IStringable + { + String Name { get; }; + String Author { get; }; + String Version { get; }; + String Icon { get; }; + } + + runtimeclass EnumMappings { + // Global Settings + static Windows.Foundation.Collections.IMap ElementTheme { get; }; + static Windows.Foundation.Collections.IMap NewTabPosition { get; }; + static Windows.Foundation.Collections.IMap TabViewWidthMode { get; }; + static Windows.Foundation.Collections.IMap FirstWindowPreference { get; }; + static Windows.Foundation.Collections.IMap LaunchMode { get; }; + static Windows.Foundation.Collections.IMap TabSwitcherMode { get; }; + static Windows.Foundation.Collections.IMap CopyFormat { get; }; + static Windows.Foundation.Collections.IMap WindowingMode { get; }; + static Windows.Foundation.Collections.IMap MatchMode { get; }; + + // Profile Settings + static Windows.Foundation.Collections.IMap CloseOnExitMode { get; }; + static Windows.Foundation.Collections.IMap ScrollbarState { get; }; + static Windows.Foundation.Collections.IMap BackgroundImageStretchMode { get; }; + static Windows.Foundation.Collections.IMap TextAntialiasingMode { get; }; + static Windows.Foundation.Collections.IMap CursorStyle { get; }; + static Windows.Foundation.Collections.IMap AdjustIndistinguishableColors { get; }; + static Windows.Foundation.Collections.IMap FontWeight { get; }; + static Windows.Foundation.Collections.IMap IntenseTextStyle { get; }; + } + + runtimeclass FontConfig { + Microsoft.Terminal.Settings.Model.Profile SourceProfile { get; }; + + INHERITABLE_FONT_SETTING(String, FontFace); + INHERITABLE_FONT_SETTING(Single, FontSize); + INHERITABLE_FONT_SETTING(Windows.UI.Text.FontWeight, FontWeight); + INHERITABLE_FONT_SETTING(Windows.Foundation.Collections.IMap, FontFeatures); + INHERITABLE_FONT_SETTING(Windows.Foundation.Collections.IMap, FontAxes); + INHERITABLE_FONT_SETTING(Boolean, EnableBuiltinGlyphs); + INHERITABLE_FONT_SETTING(String, CellWidth); + INHERITABLE_FONT_SETTING(String, CellHeight); + } + + runtimeclass GlobalAppSettings { + Guid DefaultProfile; + + INHERITABLE_SETTING(String, UnparsedDefaultProfile); + + INHERITABLE_SETTING(Int32, InitialRows); + INHERITABLE_SETTING(Int32, InitialCols); + INHERITABLE_SETTING(Boolean, AlwaysShowTabs); + INHERITABLE_SETTING(NewTabPosition, NewTabPosition); + INHERITABLE_SETTING(Boolean, ShowTitleInTitlebar); + INHERITABLE_SETTING(Boolean, ConfirmCloseAllTabs); + INHERITABLE_SETTING(String, Language); + INHERITABLE_SETTING(Microsoft.UI.Xaml.Controls.TabViewWidthMode, TabWidthMode); + INHERITABLE_SETTING(Boolean, UseAcrylicInTabRow); + INHERITABLE_SETTING(Boolean, ShowTabsInTitlebar); + INHERITABLE_SETTING(String, WordDelimiters); + INHERITABLE_SETTING(Boolean, CopyOnSelect); + INHERITABLE_SETTING(Boolean, InputServiceWarning); + INHERITABLE_SETTING(Microsoft.Terminal.Control.CopyFormat, CopyFormatting); + INHERITABLE_SETTING(Boolean, WarnAboutLargePaste); + INHERITABLE_SETTING(Boolean, WarnAboutMultiLinePaste); + INHERITABLE_SETTING(Boolean, TrimPaste); + INHERITABLE_SETTING(LaunchPosition, InitialPosition); + INHERITABLE_SETTING(Boolean, CenterOnLaunch); + INHERITABLE_SETTING(FirstWindowPreference, FirstWindowPreference); + INHERITABLE_SETTING(LaunchMode, LaunchMode); + INHERITABLE_SETTING(Boolean, SnapToGridOnResize); + INHERITABLE_SETTING(Boolean, ForceFullRepaintRendering); + INHERITABLE_SETTING(Boolean, SoftwareRendering); + INHERITABLE_SETTING(Boolean, UseBackgroundImageForWindow); + INHERITABLE_SETTING(Boolean, ForceVTInput); + INHERITABLE_SETTING(Boolean, DebugFeaturesEnabled); + INHERITABLE_SETTING(Boolean, StartOnUserLogin); + INHERITABLE_SETTING(Boolean, AlwaysOnTop); + INHERITABLE_SETTING(Boolean, AutoHideWindow); + INHERITABLE_SETTING(TabSwitcherMode, TabSwitcherMode); + INHERITABLE_SETTING(Boolean, DisableAnimations); + INHERITABLE_SETTING(String, StartupActions); + INHERITABLE_SETTING(Boolean, FocusFollowMouse); + INHERITABLE_SETTING(WindowingMode, WindowingBehavior); + INHERITABLE_SETTING(Boolean, TrimBlockSelection); + INHERITABLE_SETTING(Boolean, DetectURLs); + INHERITABLE_SETTING(Boolean, MinimizeToNotificationArea); + INHERITABLE_SETTING(Boolean, AlwaysShowNotificationIcon); + INHERITABLE_SETTING(IVector, DisabledProfileSources); + INHERITABLE_SETTING(Boolean, ShowAdminShield); + INHERITABLE_SETTING(IVector, NewTabMenu); + INHERITABLE_SETTING(Boolean, EnableColorSelection); + INHERITABLE_SETTING(Boolean, EnableShellCompletionMenu); + INHERITABLE_SETTING(Boolean, EnableUnfocusedAcrylic); + INHERITABLE_SETTING(Boolean, IsolatedMode); + INHERITABLE_SETTING(Boolean, AllowHeadless); + INHERITABLE_SETTING(String, SearchWebDefaultQueryUrl); + + Windows.Foundation.Collections.IMapView ColorSchemes(); + void AddColorScheme(ColorScheme scheme); + void RemoveColorScheme(String schemeName); + ColorScheme DuplicateColorScheme(ColorScheme scheme); + + ActionMap ActionMap { get; }; + + Windows.Foundation.Collections.IMapView Themes(); + void AddTheme(Theme theme); + INHERITABLE_SETTING(ThemePair, Theme); + Theme CurrentTheme { get; }; + + Boolean ShouldUsePersistedLayout(); + } + + [flags] enum ConvergedAlignment { + // low 4 bits are the horizontal + Horizontal_Center = 0x00, + Horizontal_Left = 0x01, + Horizontal_Right = 0x02, + + // high 4 bits are the vertical + Vertical_Center = 0x00, + Vertical_Top = 0x10, + Vertical_Bottom = 0x20 + }; + + [flags] enum IntenseStyle { + Bold = 0x1, + Bright = 0x2, + All = 0xffffffff + }; + + interface IAppearanceConfig + { + Microsoft.Terminal.Settings.Model.Profile SourceProfile { get; }; + + INHERITABLE_APPEARANCE_SETTING(String, DarkColorSchemeName); + INHERITABLE_APPEARANCE_SETTING(String, LightColorSchemeName); + + INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference, Foreground); + INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference, Background); + INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference, SelectionBackground); + INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference, CursorColor); + INHERITABLE_APPEARANCE_SETTING(Microsoft.Terminal.Core.CursorStyle, CursorShape); + INHERITABLE_APPEARANCE_SETTING(UInt32, CursorHeight); + + INHERITABLE_APPEARANCE_SETTING(String, BackgroundImagePath); + String ExpandedBackgroundImagePath { get; }; + + INHERITABLE_APPEARANCE_SETTING(Double, BackgroundImageOpacity); + INHERITABLE_APPEARANCE_SETTING(Windows.UI.Xaml.Media.Stretch, BackgroundImageStretchMode); + INHERITABLE_APPEARANCE_SETTING(ConvergedAlignment, BackgroundImageAlignment); + + INHERITABLE_APPEARANCE_SETTING(Boolean, RetroTerminalEffect); + 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(Double, Opacity); + INHERITABLE_APPEARANCE_SETTING(Boolean, UseAcrylic); + }; + + // This tag is used to identify the context in which this object was created + enum OriginTag + { + None = 0, + User, + InBox, + Generated, + Fragment, + ProfilesDefaults + }; + + interface ISettingsModelObject { + OriginTag Origin { get; }; + } + + static runtimeclass KeyChordSerialization + { + static Microsoft.Terminal.Control.KeyChord FromString(String str); + static String ToString(Microsoft.Terminal.Control.KeyChord chord); + } + + enum NewTabMenuEntryType + { + Invalid = 0, + Profile, + Separator, + Folder, + RemainingProfiles, + MatchProfiles + }; + + unsealed runtimeclass NewTabMenuEntry + { + NewTabMenuEntryType Type; + } + + [default_interface] runtimeclass SeparatorEntry : NewTabMenuEntry + { + SeparatorEntry(); + } + + runtimeclass ProfileEntry : NewTabMenuEntry + { + ProfileEntry(); + ProfileEntry(String profile); + + Profile Profile; + Int32 ProfileIndex; + } + + enum FolderEntryInlining + { + Never = 0, + Auto + }; + + runtimeclass FolderEntry : NewTabMenuEntry + { + FolderEntry(); + FolderEntry(String name); + + String Name; + String Icon; + FolderEntryInlining Inlining; + Boolean AllowEmpty; + + IVector Entries(); + } + + unsealed runtimeclass ProfileCollectionEntry : NewTabMenuEntry + { + IMap Profiles; + } + + [default_interface] runtimeclass RemainingProfilesEntry : ProfileCollectionEntry + { + RemainingProfilesEntry(); + } + + runtimeclass MatchProfilesEntry : ProfileCollectionEntry + { + MatchProfilesEntry(); + + String Name; + String Commandline; + String Source; + } + + enum CloseOnExitMode + { + Never = 0, + Graceful, + Always, + Automatic + }; + + [flags] + enum BellStyle + { + // !! If you update this, you must update the values in TerminalSettingsEditor/Profiles.xaml + Audible = 0x1, + Window = 0x2, + Taskbar = 0x4, + All = 0xffffffff + }; + + runtimeclass Profile : Windows.Foundation.IStringable, ISettingsModelObject { + Profile(); + Profile(Guid guid); + + void CreateUnfocusedAppearance(); + void DeleteUnfocusedAppearance(); + + // True if the user explicitly removed this Profile from settings.json. + Boolean Deleted { get; }; + + // Helper for magically using a commandline for an icon for a profile + // without an explicit icon. + String EvaluatedIcon { get; }; + + INHERITABLE_PROFILE_SETTING(Guid, Guid); + INHERITABLE_PROFILE_SETTING(String, Name); + INHERITABLE_PROFILE_SETTING(String, Source); + INHERITABLE_PROFILE_SETTING(Boolean, Hidden); + INHERITABLE_PROFILE_SETTING(Guid, ConnectionType); + INHERITABLE_PROFILE_SETTING(String, Icon); + INHERITABLE_PROFILE_SETTING(CloseOnExitMode, CloseOnExit); + INHERITABLE_PROFILE_SETTING(String, TabTitle); + INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference, TabColor); + INHERITABLE_PROFILE_SETTING(Boolean, SuppressApplicationTitle); + INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState); + INHERITABLE_PROFILE_SETTING(String, Padding); + INHERITABLE_PROFILE_SETTING(String, Commandline); + INHERITABLE_PROFILE_SETTING(Boolean, VtPassthrough); + + INHERITABLE_PROFILE_SETTING(String, StartingDirectory); + String EvaluatedStartingDirectory { get; }; + + FontConfig FontInfo { get; }; + + IAppearanceConfig DefaultAppearance { get; }; + INHERITABLE_PROFILE_SETTING(IAppearanceConfig, UnfocusedAppearance); + + INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.TextAntialiasingMode, AntialiasingMode); + + INHERITABLE_PROFILE_SETTING(Int32, HistorySize); + INHERITABLE_PROFILE_SETTING(Boolean, SnapOnInput); + INHERITABLE_PROFILE_SETTING(Boolean, AltGrAliasing); + INHERITABLE_PROFILE_SETTING(BellStyle, BellStyle); + + INHERITABLE_PROFILE_SETTING(Windows.Foundation.Collections.IMap, EnvironmentVariables); + + INHERITABLE_PROFILE_SETTING(Windows.Foundation.Collections.IVector, BellSound); + + INHERITABLE_PROFILE_SETTING(Boolean, Elevate); + INHERITABLE_PROFILE_SETTING(Boolean, AutoMarkPrompts); + INHERITABLE_PROFILE_SETTING(Boolean, ShowMarks); + + INHERITABLE_PROFILE_SETTING(Boolean, RightClickContextMenu); + INHERITABLE_PROFILE_SETTING(Boolean, RepositionCursorWithMouse); + + INHERITABLE_PROFILE_SETTING(Boolean, ReloadEnvironmentVariables); + + } + + runtimeclass TerminalSettingsCreateResult + { + TerminalSettingsCreateResult(TerminalSettings defaultSettings); + TerminalSettings DefaultSettings { get; }; + TerminalSettings UnfocusedSettings { get; }; + } + + // Class Description: + // TerminalSettings encapsulates all settings that control the + // TermControl's behavior. In these settings there is both the entirety + // of the Core ICoreSettings properties and the IControlSettings + // properties. It's the Profile's responsibility to build this from + // settings it contains, in combination with the global settings. + // The TerminalControl will pull settings it requires from this object, + // and pass along the Core properties to the terminal core. + [default_interface] + runtimeclass TerminalSettings : Microsoft.Terminal.Core.ICoreSettings, + Microsoft.Terminal.Control.IControlSettings + { + TerminalSettings(); + + Windows.Foundation.Collections.IMap EnvironmentVariables; + + static TerminalSettings CreateForPreview(CascadiaSettings appSettings, Profile profile); + static TerminalSettingsCreateResult CreateWithProfile(CascadiaSettings appSettings, Profile profile, Microsoft.Terminal.Control.IKeyBindings keybindings); + static TerminalSettingsCreateResult CreateWithNewTerminalArgs(CascadiaSettings appSettings, NewTerminalArgs newTerminalArgs, Microsoft.Terminal.Control.IKeyBindings keybindings); + + void ApplyColorScheme(ColorScheme scheme); + + ColorScheme AppliedColorScheme; + + // The getters for these are already defined in IControlSettings. So + // we're just adding the setters here, because TerminalApp likes to be + // able to change these at runtime (e.g. when duplicating a pane). + String Commandline { set; }; + String StartingDirectory { set; }; + + Boolean Elevate; + Boolean ReloadEnvironmentVariables; + }; + + // SettingsLoadWarnings are scenarios where the settings contained + // information we knew was invalid, but we could recover from. + enum SettingsLoadWarnings + { + MissingDefaultProfile = 0, + DuplicateProfile, + UnknownColorScheme, + InvalidBackgroundImage, + InvalidIcon, + AtLeastOneKeybindingWarning, + TooManyKeysForChord, + MissingRequiredParameter, + FailedToParseCommandJson, + FailedToWriteToSettings, + InvalidColorSchemeInCmd, + InvalidSplitSize, + FailedToParseStartupActions, + InvalidProfileEnvironmentVariables, + FailedToParseSubCommands, + UnknownTheme, + DuplicateRemainingProfilesEntry, + InvalidUseOfContent, + WARNINGS_SIZE // IMPORTANT: This MUST be the last value in this enum. It's an unused placeholder. + }; + + // SettingsLoadWarnings are scenarios where the settings had invalid state + // that we could not recover from. + enum SettingsLoadErrors + { + NoProfiles = 0, + AllProfilesHidden = 1, + ERRORS_SIZE // IMPORTANT: This MUST be the last value in this enum. It's an unused placeholder. + }; + + enum IconStyle + { + Default, + Hidden, + Monochrome + }; + + enum ThemeColorType + { + Accent, + Color, + TerminalBackground + }; + + enum TabCloseButtonVisibility + { + Always, + Hover, + Never, + ActiveOnly + }; + + runtimeclass ThemePair + { + ThemePair(); + ThemePair(String name); + ThemePair(String darkName, String lightName); + + String DarkName; + String LightName; + }; + + runtimeclass ThemeColor + { + ThemeColor(); + static ThemeColor FromColor(Microsoft.Terminal.Core.Color color); + static ThemeColor FromAccent(); + static ThemeColor FromTerminalBackground(); + + Microsoft.Terminal.Core.Color Color { get; }; + ThemeColorType ColorType; + + static Microsoft.Terminal.Core.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); + UInt8 UnfocusedTabOpacity { get; }; + } + + runtimeclass WindowTheme { + Windows.UI.Xaml.ElementTheme RequestedTheme { get; }; + Boolean UseMica { get; }; + Boolean RainbowFrame { get; }; + ThemeColor Frame { get; }; + ThemeColor UnfocusedFrame { get; }; + } + + runtimeclass TabRowTheme { + ThemeColor Background { get; }; + ThemeColor UnfocusedBackground { get; }; + } + + runtimeclass TabTheme { + ThemeColor Background { get; }; + ThemeColor UnfocusedBackground { get; }; + TabCloseButtonVisibility ShowCloseButton { get; }; + IconStyle IconStyle { get; }; + } + + runtimeclass Theme : Windows.Foundation.IStringable { + Theme(); + Theme(Windows.UI.Xaml.ElementTheme requestedTheme); + + String Name; + + // window.* Namespace + WindowTheme Window { get; }; + + // tabRow.* Namespace + TabRowTheme TabRow { get; }; + + // tab.* Namespace + TabTheme Tab { get; }; + + // A helper for retrieving the RequestedTheme out of the window property + Windows.UI.Xaml.ElementTheme RequestedTheme { get; }; + static Boolean IsSystemInDarkTheme(); + + } +} diff --git a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj index 7175aa6e675..cf5f37e9c88 100644 --- a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj +++ b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj @@ -22,60 +22,43 @@ - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - DefaultTerminal.idl - ActionArgs.idl - ActionArgs.idl - ActionMap.idl - ApplicationState.idl - CascadiaSettings.idl - ColorScheme.idl - Theme.idl - Command.idl - GlobalAppSettings.idl @@ -83,28 +66,21 @@ - KeyChordSerialization.idl - Profile.idl - AppearanceConfig.idl - FontConfig.idl - EnumMappings.idl - TerminalSettings.idl - TerminalWarnings.idl @@ -117,87 +93,62 @@ - DefaultTerminal.idl Create - ActionArgs.idl - ActionArgs.idl - ActionMap.idl - ActionMap.idl - ApplicationState.idl - CascadiaSettings.idl - CascadiaSettings.idl - ColorScheme.idl - Theme.idl - Command.idl - GlobalAppSettings.idl - KeyChordSerialization.idl - Profile.idl - AppearanceConfig.idl - FontConfig.idl - TerminalSettings.idl - EnumMappings.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl - NewTabMenuEntry.idl @@ -213,25 +164,7 @@ - - - - - - - - - - - - - - - - - - - + From bca2bad4d2cbc9b649379c6150df1c8747ca9c01 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Mon, 25 Mar 2024 12:34:04 -0500 Subject: [PATCH 2/5] Remove the old idls too --- .../TerminalSettingsEditor/Actions.idl | 13 - .../ActionsViewModel.idl | 60 --- .../TerminalSettingsEditor/AddProfile.idl | 22 - .../TerminalSettingsEditor/Appearances.idl | 129 ------ .../ColorSchemeViewModel.idl | 40 -- .../TerminalSettingsEditor/ColorSchemes.idl | 15 - .../ColorSchemesPageViewModel.idl | 34 -- .../EditColorScheme.idl | 14 - .../TerminalSettingsEditor/EnumEntry.idl | 11 - .../GlobalAppearance.idl | 13 - .../GlobalAppearanceViewModel.idl | 42 -- .../TerminalSettingsEditor/Interaction.idl | 13 - .../InteractionViewModel.idl | 29 -- .../KeyChordListener.idl | 13 - .../TerminalSettingsEditor/Launch.idl | 14 - .../LaunchViewModel.idl | 39 -- .../TerminalSettingsEditor/MainPage.idl | 46 -- .../ProfileViewModel.idl | 113 ----- .../Profiles_Advanced.idl | 13 - .../Profiles_Appearance.idl | 16 - .../TerminalSettingsEditor/Profiles_Base.idl | 13 - .../TerminalSettingsEditor/Rendering.idl | 13 - .../RenderingViewModel.idl | 17 - .../SettingContainer.idl | 32 -- .../TerminalSettingsModel/ActionArgs.idl | 437 ------------------ .../TerminalSettingsModel/ActionMap.idl | 36 -- .../AppearanceConfig.idl | 10 - .../ApplicationState.idl | 40 -- .../CascadiaSettings.idl | 59 --- .../TerminalSettingsModel/ColorScheme.idl | 27 -- .../TerminalSettingsModel/Command.idl | 53 --- .../TerminalSettingsModel/DefaultTerminal.idl | 13 - .../TerminalSettingsModel/EnumMappings.idl | 31 -- .../TerminalSettingsModel/FontConfig.idl | 27 -- .../GlobalAppSettings.idl | 120 ----- .../IAppearanceConfig.idl | 60 --- .../ISettingsModelObject.idl | 20 - .../KeyChordSerialization.idl | 11 - .../TerminalSettingsModel/NewTabMenuEntry.idl | 74 --- .../TerminalSettingsModel/Profile.idl | 93 ---- .../TerminalSettings.idl | 50 -- .../TerminalWarnings.idl | 39 -- src/cascadia/TerminalSettingsModel/Theme.idl | 96 ---- 43 files changed, 2060 deletions(-) delete mode 100644 src/cascadia/TerminalSettingsEditor/Actions.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/ActionsViewModel.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/AddProfile.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/Appearances.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/ColorSchemes.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/EditColorScheme.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/EnumEntry.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/Interaction.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/InteractionViewModel.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/KeyChordListener.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/Launch.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/LaunchViewModel.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/MainPage.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/Profiles_Advanced.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/Profiles_Appearance.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/Profiles_Base.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/Rendering.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/RenderingViewModel.idl delete mode 100644 src/cascadia/TerminalSettingsEditor/SettingContainer.idl delete mode 100644 src/cascadia/TerminalSettingsModel/ActionArgs.idl delete mode 100644 src/cascadia/TerminalSettingsModel/ActionMap.idl delete mode 100644 src/cascadia/TerminalSettingsModel/AppearanceConfig.idl delete mode 100644 src/cascadia/TerminalSettingsModel/ApplicationState.idl delete mode 100644 src/cascadia/TerminalSettingsModel/CascadiaSettings.idl delete mode 100644 src/cascadia/TerminalSettingsModel/ColorScheme.idl delete mode 100644 src/cascadia/TerminalSettingsModel/Command.idl delete mode 100644 src/cascadia/TerminalSettingsModel/DefaultTerminal.idl delete mode 100644 src/cascadia/TerminalSettingsModel/EnumMappings.idl delete mode 100644 src/cascadia/TerminalSettingsModel/FontConfig.idl delete mode 100644 src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl delete mode 100644 src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl delete mode 100644 src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl delete mode 100644 src/cascadia/TerminalSettingsModel/KeyChordSerialization.idl delete mode 100644 src/cascadia/TerminalSettingsModel/NewTabMenuEntry.idl delete mode 100644 src/cascadia/TerminalSettingsModel/Profile.idl delete mode 100644 src/cascadia/TerminalSettingsModel/TerminalSettings.idl delete mode 100644 src/cascadia/TerminalSettingsModel/TerminalWarnings.idl delete mode 100644 src/cascadia/TerminalSettingsModel/Theme.idl diff --git a/src/cascadia/TerminalSettingsEditor/Actions.idl b/src/cascadia/TerminalSettingsEditor/Actions.idl deleted file mode 100644 index ec7444d2410..00000000000 --- a/src/cascadia/TerminalSettingsEditor/Actions.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ActionsViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass Actions : Windows.UI.Xaml.Controls.Page - { - Actions(); - ActionsViewModel ViewModel { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/ActionsViewModel.idl b/src/cascadia/TerminalSettingsEditor/ActionsViewModel.idl deleted file mode 100644 index f091149d778..00000000000 --- a/src/cascadia/TerminalSettingsEditor/ActionsViewModel.idl +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Editor -{ - runtimeclass ModifyKeyBindingEventArgs - { - Microsoft.Terminal.Control.KeyChord OldKeys { get; }; - Microsoft.Terminal.Control.KeyChord NewKeys { get; }; - String OldActionName { get; }; - String NewActionName { get; }; - } - - runtimeclass KeyBindingViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - // Settings Model side - String Name { get; }; - String KeyChordText { get; }; - - // UI side - Boolean ShowEditButton { get; }; - Boolean IsInEditMode { get; }; - Boolean IsNewlyAdded { get; }; - Microsoft.Terminal.Control.KeyChord ProposedKeys; - Object ProposedAction; - Windows.UI.Xaml.Controls.Flyout AcceptChangesFlyout; - String EditButtonName { get; }; - String CancelButtonName { get; }; - String AcceptButtonName { get; }; - String DeleteButtonName { get; }; - Windows.UI.Xaml.Media.Brush ContainerBackground { get; }; - - void EnterHoverMode(); - void ExitHoverMode(); - void ActionGotFocus(); - void ActionLostFocus(); - void EditButtonGettingFocus(); - void EditButtonLosingFocus(); - IObservableVector AvailableActions { get; }; - void ToggleEditMode(); - void AttemptAcceptChanges(); - void CancelChanges(); - void DeleteKeyBinding(); - - event Windows.Foundation.TypedEventHandler ModifyKeyBindingRequested; - event Windows.Foundation.TypedEventHandler DeleteKeyBindingRequested; - } - - runtimeclass ActionsViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - ActionsViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); - - void OnAutomationPeerAttached(); - void AddNewKeybinding(); - - IObservableVector KeyBindingList { get; }; - event Windows.Foundation.TypedEventHandler FocusContainer; - event Windows.Foundation.TypedEventHandler UpdateBackground; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/AddProfile.idl b/src/cascadia/TerminalSettingsEditor/AddProfile.idl deleted file mode 100644 index 480c69bcbe1..00000000000 --- a/src/cascadia/TerminalSettingsEditor/AddProfile.idl +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Editor -{ - delegate void AddNewArgs(Guid profile); - - runtimeclass AddProfilePageNavigationState - { - Microsoft.Terminal.Settings.Model.CascadiaSettings Settings; - void RequestAddNew(); - void RequestDuplicate(Guid profile); - event AddNewArgs AddNew; - }; - - [default_interface] runtimeclass AddProfile : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged - { - AddProfile(); - AddProfilePageNavigationState State { get; }; - Boolean IsProfileSelected { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/Appearances.idl b/src/cascadia/TerminalSettingsEditor/Appearances.idl deleted file mode 100644 index 17ef8a1867a..00000000000 --- a/src/cascadia/TerminalSettingsEditor/Appearances.idl +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "EnumEntry.idl"; -import "MainPage.idl"; -import "ProfileViewModel.idl"; -import "ColorSchemeViewModel.idl"; -import "ColorSchemesPageViewModel.idl"; - -#include "ViewModelHelpers.idl.h" - -#define OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Type, Name) \ - OBSERVABLE_PROJECTED_SETTING(Type, Name); \ - Object Name##OverrideSource { get; } - -#define COMMA , - -namespace Microsoft.Terminal.Settings.Editor -{ - runtimeclass Font : Windows.Foundation.IStringable - { - String Name { get; }; - String LocalizedName { get; }; - Boolean HasPowerlineCharacters { get; }; - Windows.Foundation.Collections.IMap FontAxesTagsAndNames { get; }; - Windows.Foundation.Collections.IMap FontFeaturesTagsAndNames { get; }; - } - - // We have to make this because we cannot bind an IObservableMap to a ListView in XAML (in c++) - // So instead we make an IObservableVector of these AxisKeyValuePair objects - runtimeclass AxisKeyValuePair : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - AxisKeyValuePair(String axisKey, Single axisValue, Windows.Foundation.Collections.IMap baseMap, Windows.Foundation.Collections.IMap tagToNameMap); - String AxisKey; - Single AxisValue; - Int32 AxisIndex; - } - - runtimeclass FeatureKeyValuePair : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - FeatureKeyValuePair(String featureKey, UInt32 featureValue, Windows.Foundation.Collections.IMap baseMap, Windows.Foundation.Collections.IMap tagToNameMap); - String FeatureKey; - UInt32 FeatureValue; - Int32 FeatureIndex; - } - - runtimeclass AppearanceViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - Boolean IsDefault; - - void SetFontWeightFromDouble(Double fontWeight); - void SetBackgroundImageOpacityFromPercentageValue(Double percentageValue); - void SetBackgroundImagePath(String path); - - Boolean UseDesktopBGImage; - Boolean BackgroundImageSettingsVisible { get; }; - - void ClearColorScheme(); - ColorSchemeViewModel CurrentColorScheme; - Windows.Foundation.Collections.IObservableVector SchemesList; - - void AddNewAxisKeyValuePair(); - void DeleteAxisKeyValuePair(String key); - void InitializeFontAxesVector(); - Boolean AreFontAxesAvailable { get; }; - Boolean CanFontAxesBeAdded { get; }; - Windows.Foundation.Collections.IObservableVector FontAxesVector; - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.Foundation.Collections.IMap, FontAxes); - - void AddNewFeatureKeyValuePair(); - void DeleteFeatureKeyValuePair(String key); - void InitializeFontFeaturesVector(); - Boolean AreFontFeaturesAvailable { get; }; - Boolean CanFontFeaturesBeAdded { get; }; - Windows.Foundation.Collections.IObservableVector FontFeaturesVector; - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.Foundation.Collections.IMap, FontFeatures); - - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, FontFace); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Single, FontSize); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Double, LineHeight); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.UI.Text.FontWeight, FontWeight); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Boolean, EnableBuiltinGlyphs); - - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, DarkColorSchemeName); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, LightColorSchemeName); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Boolean, RetroTerminalEffect); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Core.CursorStyle, CursorShape); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(UInt32, CursorHeight); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, BackgroundImagePath); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Double, BackgroundImageOpacity); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.UI.Xaml.Media.Stretch, BackgroundImageStretchMode); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Settings.Model.ConvergedAlignment, BackgroundImageAlignment); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Settings.Model.IntenseStyle, IntenseTextStyle); - OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Microsoft.Terminal.Core.AdjustTextMode, AdjustIndistinguishableColors); - } - - [default_interface] runtimeclass Appearances : Windows.UI.Xaml.Controls.UserControl, Windows.UI.Xaml.Data.INotifyPropertyChanged - { - Appearances(); - AppearanceViewModel Appearance; - ProfileViewModel SourceProfile; - IHostedInWindow WindowRoot; - static Windows.UI.Xaml.DependencyProperty AppearanceProperty { get; }; - - Boolean UsingMonospaceFont { get; }; - Boolean ShowAllFonts; - Boolean ShowProportionalFontWarning; - - IInspectable CurrentCursorShape; - Boolean IsVintageCursor { get; }; - Windows.Foundation.Collections.IObservableVector CursorShapeList { get; }; - - IInspectable CurrentAdjustIndistinguishableColors; - Windows.Foundation.Collections.IObservableVector AdjustIndistinguishableColorsList { get; }; - - IInspectable CurrentBackgroundImageStretchMode; - Windows.Foundation.Collections.IObservableVector BackgroundImageStretchModeList { get; }; - - IInspectable CurrentFontWeight; - Boolean IsCustomFontWeight { get; }; - Windows.Foundation.Collections.IObservableVector FontWeightList { get; }; - - IInspectable CurrentFontFace { get; }; - Windows.UI.Xaml.Controls.Slider BIOpacitySlider { get; }; - - IInspectable CurrentIntenseTextStyle; - Windows.Foundation.Collections.IObservableVector IntenseTextStyleList { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl b/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl deleted file mode 100644 index bf36ef4146b..00000000000 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.idl +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ColorSchemes.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - runtimeclass ColorSchemeViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged, Windows.Foundation.IStringable - { - String Name; - Boolean IsEditable { get; }; - Boolean IsDefaultScheme { get; }; - - Boolean RequestRename(String newName); - - // Terminal Colors - Windows.Foundation.Collections.IVector NonBrightColorTable; - Windows.Foundation.Collections.IVector BrightColorTable; - - ColorTableEntry ColorEntryAt(UInt32 Index); - - // System Colors - ColorTableEntry ForegroundColor; - ColorTableEntry BackgroundColor; - ColorTableEntry CursorColor; - ColorTableEntry SelectionBackgroundColor; - - void DeleteConfirmation_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); - void SetAsDefault_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); - void Duplicate_Click(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); - } - - [default_interface] runtimeclass ColorTableEntry : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - String Name { get; }; - IInspectable Tag; - Windows.UI.Color Color; - String AccessibleName { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemes.idl b/src/cascadia/TerminalSettingsEditor/ColorSchemes.idl deleted file mode 100644 index e92408dd56e..00000000000 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemes.idl +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ColorSchemeViewModel.idl"; -import "ColorSchemesPageViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass ColorSchemes : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged - { - ColorSchemes(); - - ColorSchemesPageViewModel ViewModel { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl b/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl deleted file mode 100644 index 524cc9dd271..00000000000 --- a/src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.idl +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ColorSchemeViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - enum ColorSchemesSubPage - { - Base = 0, - EditColorScheme = 1 - }; - - runtimeclass ColorSchemesPageViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - ColorSchemesPageViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); - void UpdateSettings(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); - - ColorSchemeViewModel RequestAddNew(); - Boolean RequestRenameCurrentScheme(String newName); - void RequestDeleteCurrentScheme(); - void RequestDuplicateCurrentScheme(); - void RequestEditSelectedScheme(); - void RequestSetSelectedSchemeAsDefault(); - - ColorSchemeViewModel CurrentScheme; - Boolean HasCurrentScheme { get; }; - Boolean CanDeleteCurrentScheme { get; }; - ColorSchemesSubPage CurrentPage; - Windows.Foundation.Collections.IObservableVector AllColorSchemes { get; }; - - void SchemeListItemClicked(IInspectable sender, Windows.UI.Xaml.Controls.ItemClickEventArgs args); - } -} diff --git a/src/cascadia/TerminalSettingsEditor/EditColorScheme.idl b/src/cascadia/TerminalSettingsEditor/EditColorScheme.idl deleted file mode 100644 index 33c8ee46589..00000000000 --- a/src/cascadia/TerminalSettingsEditor/EditColorScheme.idl +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ColorSchemeViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass EditColorScheme : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged - { - EditColorScheme(); - - ColorSchemeViewModel ViewModel { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/EnumEntry.idl b/src/cascadia/TerminalSettingsEditor/EnumEntry.idl deleted file mode 100644 index ce92d75762a..00000000000 --- a/src/cascadia/TerminalSettingsEditor/EnumEntry.idl +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass EnumEntry : Windows.UI.Xaml.Data.INotifyPropertyChanged, Windows.Foundation.IStringable - { - String EnumName { get; }; - IInspectable EnumValue { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl deleted file mode 100644 index 08c0aa49a5b..00000000000 --- a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "GlobalAppearanceViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass GlobalAppearance : Windows.UI.Xaml.Controls.Page - { - GlobalAppearance(); - GlobalAppearanceViewModel ViewModel { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.idl b/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.idl deleted file mode 100644 index 8dd700edc3d..00000000000 --- a/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.idl +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "EnumEntry.idl"; - -#include "ViewModelHelpers.idl.h" - -namespace Microsoft.Terminal.Settings.Editor -{ - runtimeclass GlobalAppearanceViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - GlobalAppearanceViewModel(Microsoft.Terminal.Settings.Model.GlobalAppSettings globalSettings); - - static String LanguageDisplayConverter(String tag); - Boolean LanguageSelectorAvailable { get; }; - Windows.Foundation.Collections.IObservableVector LanguageList { get; }; - IInspectable CurrentLanguage; - - IInspectable CurrentTheme; - static String ThemeNameConverter(Microsoft.Terminal.Settings.Model.Theme theme); - Windows.Foundation.Collections.IObservableVector ThemeList { get; }; - - IInspectable CurrentNewTabPosition; - Windows.Foundation.Collections.IObservableVector NewTabPositionList { get; }; - - IInspectable CurrentTabWidthMode; - Windows.Foundation.Collections.IObservableVector TabWidthModeList { get; }; - - Boolean InvertedDisableAnimations; - - void ShowTitlebarToggled(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args); - - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AlwaysShowTabs); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowTabsInTitlebar); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, UseAcrylicInTabRow); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowTitleInTitlebar); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AlwaysOnTop); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AutoHideWindow); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AlwaysShowNotificationIcon); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, MinimizeToNotificationArea); - } -} diff --git a/src/cascadia/TerminalSettingsEditor/Interaction.idl b/src/cascadia/TerminalSettingsEditor/Interaction.idl deleted file mode 100644 index 840fca4a750..00000000000 --- a/src/cascadia/TerminalSettingsEditor/Interaction.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "InteractionViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass Interaction : Windows.UI.Xaml.Controls.Page - { - Interaction(); - InteractionViewModel ViewModel { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/InteractionViewModel.idl b/src/cascadia/TerminalSettingsEditor/InteractionViewModel.idl deleted file mode 100644 index ddd87501850..00000000000 --- a/src/cascadia/TerminalSettingsEditor/InteractionViewModel.idl +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "EnumEntry.idl"; - -#include "ViewModelHelpers.idl.h" - -namespace Microsoft.Terminal.Settings.Editor -{ - runtimeclass InteractionViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - InteractionViewModel(Microsoft.Terminal.Settings.Model.GlobalAppSettings globalSettings); - - IInspectable CurrentTabSwitcherMode; - Windows.Foundation.Collections.IObservableVector TabSwitcherModeList { get; }; - - IInspectable CurrentCopyFormat; - Windows.Foundation.Collections.IObservableVector CopyFormatList { get; }; - - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, CopyOnSelect); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, TrimBlockSelection); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, TrimPaste); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, SnapToGridOnResize); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, FocusFollowMouse); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, DetectURLs); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(String, WordDelimiters); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ConfirmCloseAllTabs); - } -} diff --git a/src/cascadia/TerminalSettingsEditor/KeyChordListener.idl b/src/cascadia/TerminalSettingsEditor/KeyChordListener.idl deleted file mode 100644 index 122efe08f24..00000000000 --- a/src/cascadia/TerminalSettingsEditor/KeyChordListener.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass KeyChordListener : Windows.UI.Xaml.Controls.UserControl - { - KeyChordListener(); - - Microsoft.Terminal.Control.KeyChord Keys; - static Windows.UI.Xaml.DependencyProperty KeysProperty { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/Launch.idl b/src/cascadia/TerminalSettingsEditor/Launch.idl deleted file mode 100644 index 537650cb780..00000000000 --- a/src/cascadia/TerminalSettingsEditor/Launch.idl +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "EnumEntry.idl"; -import "LaunchViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass Launch : Windows.UI.Xaml.Controls.Page - { - Launch(); - LaunchViewModel ViewModel { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/LaunchViewModel.idl b/src/cascadia/TerminalSettingsEditor/LaunchViewModel.idl deleted file mode 100644 index c5534636f40..00000000000 --- a/src/cascadia/TerminalSettingsEditor/LaunchViewModel.idl +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "EnumEntry.idl"; - -#include "ViewModelHelpers.idl.h" - -namespace Microsoft.Terminal.Settings.Editor -{ - runtimeclass LaunchViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - LaunchViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); - - String LaunchParametersCurrentValue { get; }; - Double InitialPosX; - Double InitialPosY; - Boolean UseDefaultLaunchPosition; - - IInspectable CurrentDefaultProfile; - IObservableVector DefaultProfiles { get; }; - - IInspectable CurrentDefaultTerminal; - IObservableVector DefaultTerminals { get; }; - - IInspectable CurrentFirstWindowPreference; - IObservableVector FirstWindowPreferenceList { get; }; - - IInspectable CurrentLaunchMode; - IObservableVector LaunchModeList { get; }; - - IInspectable CurrentWindowingBehavior; - IObservableVector WindowingBehaviorList { get; }; - - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, CenterOnLaunch); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, StartOnUserLogin); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Int32, InitialRows); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Int32, InitialCols); - } -} diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.idl b/src/cascadia/TerminalSettingsEditor/MainPage.idl deleted file mode 100644 index 419981d94de..00000000000 --- a/src/cascadia/TerminalSettingsEditor/MainPage.idl +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Editor -{ - // Due to a XAML Compiler bug, it is hard for us to propagate an HWND into a XAML-using runtimeclass. - // To work around that, we'll only propagate the HWND (when we need to) into the settings' toplevel page - // and use IHostedInWindow to hide the implementation detail where we use IInitializeWithWindow (shobjidl_core) - // https://github.com/microsoft/microsoft-ui-xaml/issues/3331 - interface IHostedInWindow - { - Boolean TryPropagateHostingWindow(IInspectable i); - UInt64 GetHostingWindow(); - } - - enum BreadcrumbSubPage - { - None = 0, - Profile_Appearance, - Profile_Advanced, - ColorSchemes_Edit - }; - - runtimeclass Breadcrumb : Windows.Foundation.IStringable - { - IInspectable Tag; - String Label; - BreadcrumbSubPage SubPage; - } - - [default_interface] runtimeclass MainPage : Windows.UI.Xaml.Controls.Page, IHostedInWindow - { - MainPage(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); - - void UpdateSettings(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); - event Windows.Foundation.TypedEventHandler OpenJson; - - // Due to the aforementioned bug, we can't use IInitializeWithWindow _here_ either. - // Let's just smuggle the HWND in as a UInt64 :| - void SetHostingWindow(UInt64 window); - - Windows.Foundation.Collections.IObservableVector Breadcrumbs { get; }; - - Windows.UI.Xaml.Media.Brush BackgroundBrush { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl deleted file mode 100644 index f9f618c8b80..00000000000 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "EnumEntry.idl"; -import "MainPage.idl"; -import "Appearances.idl"; -import "ColorSchemesPageViewModel.idl"; - -#include "ViewModelHelpers.idl.h" - -#define OBSERVABLE_PROJECTED_PROFILE_SETTING(Type, Name) \ - OBSERVABLE_PROJECTED_SETTING(Type, Name); \ - Object Name##OverrideSource { get; } - -namespace Microsoft.Terminal.Settings.Editor -{ - runtimeclass NavigateToProfileArgs - { - ProfileViewModel Profile { get; }; - IHostedInWindow WindowRoot { get; }; - } - - runtimeclass DeleteProfileEventArgs - { - Guid ProfileGuid { get; }; - } - - enum ProfileSubPage - { - Base = 0, - Appearance = 1, - Advanced = 2 - }; - - runtimeclass ProfileViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - static Windows.Foundation.Collections.IObservableVector CompleteFontList { get; }; - static Windows.Foundation.Collections.IObservableVector MonospaceFontList { get; }; - static Font FindFontWithLocalizedName(String name); - - Microsoft.Terminal.Settings.Model.TerminalSettings TermSettings { get; }; - - event Windows.Foundation.TypedEventHandler DeleteProfile; - - void SetupAppearances(Windows.Foundation.Collections.IObservableVector schemesList); - - void SetAcrylicOpacityPercentageValue(Double value); - void SetPadding(Double value); - - Boolean IsBellStyleFlagSet(UInt32 flag); - void SetBellStyleAudible(Windows.Foundation.IReference on); - void SetBellStyleWindow(Windows.Foundation.IReference on); - void SetBellStyleTaskbar(Windows.Foundation.IReference on); - - IInspectable CurrentAntiAliasingMode; - Windows.Foundation.Collections.IObservableVector AntiAliasingModeList { get; }; - - IInspectable CurrentCloseOnExitMode; - Windows.Foundation.Collections.IObservableVector CloseOnExitModeList { get; }; - - IInspectable CurrentScrollState; - Windows.Foundation.Collections.IObservableVector ScrollStateList { get; }; - - Boolean CanDeleteProfile { get; }; - Boolean FocusDeleteButton; - Boolean IsBaseLayer; - ProfileSubPage CurrentPage; - Boolean UseParentProcessDirectory; - Boolean UseCustomStartingDirectory { get; }; - Boolean HideIcon; - AppearanceViewModel DefaultAppearance { get; }; - Guid OriginalProfileGuid { get; }; - Boolean HasUnfocusedAppearance { get; }; - Boolean EditableUnfocusedAppearance { get; }; - Boolean ShowUnfocusedAppearance { get; }; - AppearanceViewModel UnfocusedAppearance { get; }; - Boolean VtPassthroughAvailable { get; }; - - String EvaluatedIcon { get; }; - - void CreateUnfocusedAppearance(); - void DeleteUnfocusedAppearance(); - - OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Name); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, Guid); - OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Source); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, ConnectionType); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, Hidden); - OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Icon); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.CloseOnExitMode, CloseOnExit); - OBSERVABLE_PROJECTED_PROFILE_SETTING(String, TabTitle); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, TabColor); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SuppressApplicationTitle); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, UseAcrylic); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Double, Opacity); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState); - OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Padding); - OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Commandline); - OBSERVABLE_PROJECTED_PROFILE_SETTING(String, StartingDirectory); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Control.TextAntialiasingMode, AntialiasingMode); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, Foreground); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, Background); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, SelectionBackground); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference, CursorColor); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Int32, HistorySize); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SnapOnInput); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, AltGrAliasing); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.BellStyle, BellStyle); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, Elevate); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, VtPassthrough); - OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, ReloadEnvironmentVariables); - } -} diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.idl b/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.idl deleted file mode 100644 index befaf556aab..00000000000 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Advanced.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ProfileViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass Profiles_Advanced : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged - { - Profiles_Advanced(); - ProfileViewModel Profile { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.idl b/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.idl deleted file mode 100644 index 931edbe5197..00000000000 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Appearance.idl +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ProfileViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass Profiles_Appearance : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged - { - Profiles_Appearance(); - ProfileViewModel Profile { get; }; - IHostedInWindow WindowRoot { get; }; - - Windows.UI.Xaml.Controls.Slider OpacitySlider { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base.idl b/src/cascadia/TerminalSettingsEditor/Profiles_Base.idl deleted file mode 100644 index b076fe75a3c..00000000000 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ProfileViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass Profiles_Base : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged - { - Profiles_Base(); - ProfileViewModel Profile { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/Rendering.idl b/src/cascadia/TerminalSettingsEditor/Rendering.idl deleted file mode 100644 index 21dc7d8023f..00000000000 --- a/src/cascadia/TerminalSettingsEditor/Rendering.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "RenderingViewModel.idl"; - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass Rendering : Windows.UI.Xaml.Controls.Page - { - Rendering(); - RenderingViewModel ViewModel { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsEditor/RenderingViewModel.idl b/src/cascadia/TerminalSettingsEditor/RenderingViewModel.idl deleted file mode 100644 index aa728bfad03..00000000000 --- a/src/cascadia/TerminalSettingsEditor/RenderingViewModel.idl +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "EnumEntry.idl"; - -#include "ViewModelHelpers.idl.h" - -namespace Microsoft.Terminal.Settings.Editor -{ - runtimeclass RenderingViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - RenderingViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings); - - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ForceFullRepaintRendering); - PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, SoftwareRendering); - } -} diff --git a/src/cascadia/TerminalSettingsEditor/SettingContainer.idl b/src/cascadia/TerminalSettingsEditor/SettingContainer.idl deleted file mode 100644 index 8b5fd0eba95..00000000000 --- a/src/cascadia/TerminalSettingsEditor/SettingContainer.idl +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Editor -{ - [default_interface] runtimeclass SettingContainer : Windows.UI.Xaml.Controls.ContentControl - { - SettingContainer(); - - void SetExpanded(Boolean expanded); - - IInspectable Header; - static Windows.UI.Xaml.DependencyProperty HeaderProperty { get; }; - - String HelpText; - static Windows.UI.Xaml.DependencyProperty HelpTextProperty { get; }; - - String CurrentValue; - static Windows.UI.Xaml.DependencyProperty CurrentValueProperty { get; }; - - Boolean HasSettingValue; - static Windows.UI.Xaml.DependencyProperty HasSettingValueProperty { get; }; - - IInspectable SettingOverrideSource; - static Windows.UI.Xaml.DependencyProperty SettingOverrideSourceProperty { get; }; - - Boolean StartExpanded; - static Windows.UI.Xaml.DependencyProperty StartExpandedProperty { get; }; - - event Windows.Foundation.TypedEventHandler ClearSettingValue; - }; -} diff --git a/src/cascadia/TerminalSettingsModel/ActionArgs.idl b/src/cascadia/TerminalSettingsModel/ActionArgs.idl deleted file mode 100644 index 32f9005fdee..00000000000 --- a/src/cascadia/TerminalSettingsModel/ActionArgs.idl +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "Command.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - interface IActionArgs - { - Boolean Equals(IActionArgs other); - String GenerateName(); - IActionArgs Copy(); - UInt64 Hash(); - }; - - interface IActionEventArgs - { - Boolean Handled; - IActionArgs ActionArgs { get; }; - }; - - enum ResizeDirection - { - None = 0, - Left, - Right, - Up, - Down - }; - - enum FocusDirection - { - None = 0, - Left, - Right, - Up, - Down, - Previous, - PreviousInOrder, - NextInOrder, - First, - Parent, - Child - }; - - enum SplitDirection - { - Automatic = 0, - Up, - Right, - Down, - Left - }; - - enum SplitType - { - Manual = 0, - Duplicate = 1 - }; - - enum SettingsTarget - { - SettingsFile = 0, - DefaultsFile, - AllFiles, - SettingsUI - }; - - enum MoveTabDirection - { - None = 0, - Forward, - Backward - }; - - enum FindMatchDirection - { - None = 0, - Next, - Previous - }; - - enum SelectOutputDirection - { - Previous = 0, - Next, - }; - - enum CommandPaletteLaunchMode - { - Action = 0, - CommandLine - }; - - enum TabSwitcherMode - { - MostRecentlyUsed, - InOrder, - Disabled, - }; - - enum DesktopBehavior - { - Any, - ToCurrent, - OnCurrent, - }; - - enum MonitorBehavior - { - Any, - ToCurrent, - ToMouse, - }; - - [flags] - enum SuggestionsSource - { - Tasks = 0x1, - CommandHistory = 0x2, - DirectoryHistory = 0x4, - All = 0xffffffff, - }; - - [default_interface] runtimeclass NewTerminalArgs { - NewTerminalArgs(); - NewTerminalArgs(Int32 profileIndex); - NewTerminalArgs Copy(); - - String Commandline; - String StartingDirectory; - String TabTitle; - Windows.Foundation.IReference TabColor; - String Profile; // Either a GUID or a profile's name if the GUID isn't a match - Boolean AppendCommandLine; - - // We use IReference<> to treat some args as nullable where null means - // "use the inherited value". See ProfileIndex, - // SuppressApplicationTitle, Elevate. Strings that behave this way just - // use `null` as "use the inherited value". - - // ProfileIndex can be null (for "use the default"), so this needs to be - // a IReference, so it's nullable - Windows.Foundation.IReference ProfileIndex { get; }; - Windows.Foundation.IReference SuppressApplicationTitle; - String ColorScheme; - // This needs to be an optional so that the default value (null) does - // not modify whatever the profile's value is (either true or false) - Windows.Foundation.IReference Elevate; - // Similarly with ReloadEnvironmentVariables - Windows.Foundation.IReference ReloadEnvironmentVariables; - - UInt64 ContentId{ get; set; }; - - Boolean Equals(NewTerminalArgs other); - String GenerateName(); - String ToCommandline(); - UInt64 Hash(); - }; - - [default_interface] runtimeclass ActionEventArgs : IActionEventArgs - { - ActionEventArgs(); - ActionEventArgs(IActionArgs args); - }; - - [default_interface] runtimeclass CopyTextArgs : IActionArgs - { - CopyTextArgs(); - Boolean DismissSelection { get; }; - Boolean SingleLine { get; }; - Windows.Foundation.IReference CopyFormatting { get; }; - }; - - [default_interface] runtimeclass NewTabArgs : IActionArgs - { - NewTabArgs(NewTerminalArgs terminalArgs); - NewTerminalArgs TerminalArgs { get; }; - }; - - [default_interface] runtimeclass MovePaneArgs : IActionArgs - { - MovePaneArgs(UInt32 tabIndex, String Window); - UInt32 TabIndex; - String Window; - }; - - [default_interface] runtimeclass SwitchToTabArgs : IActionArgs - { - SwitchToTabArgs(UInt32 tabIndex); - UInt32 TabIndex; - }; - - [default_interface] runtimeclass ResizePaneArgs : IActionArgs - { - ResizeDirection ResizeDirection { get; }; - }; - - [default_interface] runtimeclass MoveFocusArgs : IActionArgs - { - MoveFocusArgs(FocusDirection direction); - FocusDirection FocusDirection { get; }; - }; - - [default_interface] runtimeclass SwapPaneArgs : IActionArgs - { - SwapPaneArgs(FocusDirection direction); - FocusDirection Direction { get; }; - }; - - [default_interface] runtimeclass AdjustFontSizeArgs : IActionArgs - { - Single Delta { get; }; - }; - - [default_interface] runtimeclass SendInputArgs : IActionArgs - { - String Input { get; }; - }; - - [default_interface] runtimeclass SplitPaneArgs : IActionArgs - { - SplitPaneArgs(SplitType splitMode, SplitDirection split, Double size, NewTerminalArgs terminalArgs); - SplitPaneArgs(SplitDirection split, Double size, NewTerminalArgs terminalArgs); - SplitPaneArgs(SplitDirection split, NewTerminalArgs terminalArgs); - SplitPaneArgs(SplitType splitMode); - - SplitDirection SplitDirection { get; }; - NewTerminalArgs TerminalArgs { get; }; - SplitType SplitMode { get; }; - Double SplitSize { get; }; - }; - - [default_interface] runtimeclass OpenSettingsArgs : IActionArgs - { - OpenSettingsArgs(SettingsTarget target); - SettingsTarget Target { get; }; - }; - - [default_interface] runtimeclass SetFocusModeArgs : IActionArgs - { - SetFocusModeArgs(Boolean isFocusMode); - Boolean IsFocusMode { get; }; - }; - - [default_interface] runtimeclass SetFullScreenArgs : IActionArgs - { - SetFullScreenArgs(Boolean isFullScreen); - Boolean IsFullScreen { get; }; - }; - - [default_interface] runtimeclass SetMaximizedArgs : IActionArgs - { - SetMaximizedArgs(Boolean isMaximized); - Boolean IsMaximized { get; }; - }; - - [default_interface] runtimeclass SetColorSchemeArgs : IActionArgs - { - SetColorSchemeArgs(String name); - String SchemeName { get; }; - }; - - [default_interface] runtimeclass SetTabColorArgs : IActionArgs - { - SetTabColorArgs(Windows.UI.Color tabColor); - Windows.Foundation.IReference TabColor { get; }; - }; - - [default_interface] runtimeclass RenameTabArgs : IActionArgs - { - RenameTabArgs(String title); - String Title { get; }; - }; - - [default_interface] runtimeclass ExecuteCommandlineArgs : IActionArgs - { - ExecuteCommandlineArgs(String commandline); - String Commandline; - }; - - [default_interface] runtimeclass CloseOtherTabsArgs : IActionArgs - { - CloseOtherTabsArgs(UInt32 tabIndex); - Windows.Foundation.IReference Index { get; }; - }; - - [default_interface] runtimeclass CloseTabsAfterArgs : IActionArgs - { - CloseTabsAfterArgs(UInt32 tabIndex); - Windows.Foundation.IReference Index { get; }; - }; - - [default_interface] runtimeclass CloseTabArgs : IActionArgs - { - CloseTabArgs(UInt32 tabIndex); - Windows.Foundation.IReference Index { get; }; - }; - - [default_interface] runtimeclass MoveTabArgs : IActionArgs - { - MoveTabArgs(String window, MoveTabDirection direction); - MoveTabDirection Direction { get; }; - String Window { get; }; - }; - - [default_interface] runtimeclass ScrollUpArgs : IActionArgs - { - Windows.Foundation.IReference RowsToScroll { get; }; - }; - - [default_interface] runtimeclass ScrollDownArgs : IActionArgs - { - Windows.Foundation.IReference RowsToScroll { get; }; - }; - - - [default_interface] runtimeclass ScrollToMarkArgs : IActionArgs - { - Microsoft.Terminal.Control.ScrollToMarkDirection Direction { get; }; - }; - - [default_interface] runtimeclass AddMarkArgs : IActionArgs - { - Windows.Foundation.IReference Color { get; }; - }; - - [default_interface] runtimeclass ToggleCommandPaletteArgs : IActionArgs - { - CommandPaletteLaunchMode LaunchMode { get; }; - }; - - [default_interface] runtimeclass SuggestionsArgs : IActionArgs - { - SuggestionsArgs(); - SuggestionsArgs(SuggestionsSource source, Boolean useCommandline); - SuggestionsSource Source { get; }; - Boolean UseCommandline { get; }; - }; - - [default_interface] runtimeclass FindMatchArgs : IActionArgs - { - FindMatchArgs(FindMatchDirection direction); - FindMatchDirection Direction { get; }; - }; - - [default_interface] runtimeclass NewWindowArgs : IActionArgs - { - NewWindowArgs(NewTerminalArgs terminalArgs); - NewTerminalArgs TerminalArgs { get; }; - }; - - [default_interface] runtimeclass PrevTabArgs : IActionArgs - { - PrevTabArgs(); - PrevTabArgs(TabSwitcherMode SwitcherMode); - Windows.Foundation.IReference SwitcherMode; - }; - - [default_interface] runtimeclass NextTabArgs : IActionArgs - { - NextTabArgs(); - NextTabArgs(TabSwitcherMode SwitcherMode); - Windows.Foundation.IReference SwitcherMode; - }; - - [default_interface] runtimeclass RenameWindowArgs : IActionArgs - { - RenameWindowArgs(String name); - String Name { get; }; - }; - - [default_interface] runtimeclass SearchForTextArgs : IActionArgs - { - String QueryUrl { get; }; - }; - - [default_interface] runtimeclass GlobalSummonArgs : IActionArgs - { - String Name { get; }; - DesktopBehavior Desktop { get; }; - MonitorBehavior Monitor { get; }; - Boolean ToggleVisibility { get; }; - UInt32 DropdownDuration { get; }; - }; - - [default_interface] runtimeclass FocusPaneArgs : IActionArgs - { - FocusPaneArgs(UInt32 Id); - UInt32 Id { get; }; - }; - - [default_interface] runtimeclass ExportBufferArgs : IActionArgs - { - ExportBufferArgs(String path); - String Path { get; }; - }; - - [default_interface] runtimeclass ClearBufferArgs : IActionArgs - { - ClearBufferArgs(Microsoft.Terminal.Control.ClearBufferType clear); - Microsoft.Terminal.Control.ClearBufferType Clear { get; }; - }; - - [default_interface] runtimeclass MultipleActionsArgs : IActionArgs - { - MultipleActionsArgs(); - Windows.Foundation.Collections.IVector Actions; - }; - - [default_interface] runtimeclass AdjustOpacityArgs : IActionArgs - { - AdjustOpacityArgs(); - Int32 Opacity { get; }; - Boolean Relative { get; }; - }; - - [default_interface] runtimeclass ColorSelectionArgs : IActionArgs - { - Microsoft.Terminal.Control.SelectionColor Foreground; - Microsoft.Terminal.Control.SelectionColor Background; - Microsoft.Terminal.Core.MatchMode MatchMode { get; }; - }; - - [default_interface] runtimeclass SelectCommandArgs : IActionArgs - { - SelectCommandArgs(SelectOutputDirection direction); - SelectOutputDirection Direction { get; }; - } - [default_interface] runtimeclass SelectOutputArgs : IActionArgs - { - SelectOutputArgs(SelectOutputDirection direction); - SelectOutputDirection Direction { get; }; - } - - -} diff --git a/src/cascadia/TerminalSettingsModel/ActionMap.idl b/src/cascadia/TerminalSettingsModel/ActionMap.idl deleted file mode 100644 index b84305b9d0e..00000000000 --- a/src/cascadia/TerminalSettingsModel/ActionMap.idl +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "Command.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - // This interface ensures that no changes are made to ActionMap - interface IActionMapView - { - Boolean IsKeyChordExplicitlyUnbound(Microsoft.Terminal.Control.KeyChord keys); - - Command GetActionByKeyChord(Microsoft.Terminal.Control.KeyChord keys); - - Microsoft.Terminal.Control.KeyChord GetKeyBindingForAction(ShortcutAction action); - [method_name("GetKeyBindingForActionWithArgs")] Microsoft.Terminal.Control.KeyChord GetKeyBindingForAction(ShortcutAction action, IActionArgs actionArgs); - - Windows.Foundation.Collections.IMapView AvailableActions { get; }; - - Windows.Foundation.Collections.IMapView NameMap { get; }; - Windows.Foundation.Collections.IMapView KeyBindings { get; }; - Windows.Foundation.Collections.IMapView GlobalHotkeys { get; }; - - IVector ExpandedCommands { get; }; - - IVector FilterToSendInput(String CurrentCommandline); - }; - - [default_interface] runtimeclass ActionMap : IActionMapView - { - void RebindKeys(Microsoft.Terminal.Control.KeyChord oldKeys, Microsoft.Terminal.Control.KeyChord newKeys); - void DeleteKeyBinding(Microsoft.Terminal.Control.KeyChord keys); - - void RegisterKeyBinding(Microsoft.Terminal.Control.KeyChord keys, ActionAndArgs action); - } -} diff --git a/src/cascadia/TerminalSettingsModel/AppearanceConfig.idl b/src/cascadia/TerminalSettingsModel/AppearanceConfig.idl deleted file mode 100644 index 8434c13f8aa..00000000000 --- a/src/cascadia/TerminalSettingsModel/AppearanceConfig.idl +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "IAppearanceConfig.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - [default_interface] runtimeclass AppearanceConfig : IAppearanceConfig { - } -} diff --git a/src/cascadia/TerminalSettingsModel/ApplicationState.idl b/src/cascadia/TerminalSettingsModel/ApplicationState.idl deleted file mode 100644 index 02856a4d2d7..00000000000 --- a/src/cascadia/TerminalSettingsModel/ApplicationState.idl +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -import "Command.idl"; -import "GlobalAppSettings.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - enum InfoBarMessage - { - CloseOnExitInfo = 0, - KeyboardServiceWarning, - SetAsDefault, - }; - - runtimeclass WindowLayout - { - WindowLayout(); - - static String ToJson(WindowLayout layout); - static WindowLayout FromJson(String json); - - Windows.Foundation.Collections.IVector TabLayout; - Windows.Foundation.IReference InitialPosition; - Windows.Foundation.IReference InitialSize; - Windows.Foundation.IReference LaunchMode; - }; - - [default_interface] runtimeclass ApplicationState { - static ApplicationState SharedInstance(); - - void Flush(); - void Reset(); - - String SettingsHash; - Windows.Foundation.Collections.IVector PersistedWindowLayouts; - Windows.Foundation.Collections.IVector RecentCommands; - Windows.Foundation.Collections.IVector DismissedMessages; - Windows.Foundation.Collections.IVector AllowedCommandlines; - } -} diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettings.idl b/src/cascadia/TerminalSettingsModel/CascadiaSettings.idl deleted file mode 100644 index 1889871bb3e..00000000000 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettings.idl +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "GlobalAppSettings.idl"; -import "Profile.idl"; -import "TerminalWarnings.idl"; -import "DefaultTerminal.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - [default_interface] runtimeclass CascadiaSettings { - static CascadiaSettings LoadDefaults(); - static CascadiaSettings LoadAll(); - - static String SettingsPath { get; }; - static String DefaultSettingsPath { get; }; - static Boolean IsPortableMode { get; }; - - static String ApplicationDisplayName { get; }; - static String ApplicationVersion { get; }; - - static void ExportFile(String path, String content); - - CascadiaSettings(String userJSON, String inboxJSON); - - CascadiaSettings Copy(); - void WriteSettingsToDisk(); - - String Hash { get; }; - - GlobalAppSettings GlobalSettings { get; }; - - Profile ProfileDefaults { get; }; - - IObservableVector AllProfiles { get; }; - IObservableVector ActiveProfiles { get; }; - - Profile DuplicateProfile(Profile sourceProfile); - - ActionMap ActionMap { get; }; - - IVectorView Warnings { get; }; - Windows.Foundation.IReference GetLoadingError { get; }; - String GetSerializationErrorMessage { get; }; - - Profile CreateNewProfile(); - Profile FindProfile(Guid profileGuid); - void UpdateColorSchemeReferences(String oldName, String newName); - - Profile GetProfileForArgs(NewTerminalArgs newTerminalArgs); - - static Boolean IsDefaultTerminalAvailable { get; }; - static Boolean IsDefaultTerminalSet { get; }; - IObservableVector DefaultTerminals { get; }; - DefaultTerminal CurrentDefaultTerminal; - - void ExpandCommands(); - } -} diff --git a/src/cascadia/TerminalSettingsModel/ColorScheme.idl b/src/cascadia/TerminalSettingsModel/ColorScheme.idl deleted file mode 100644 index dd55624a530..00000000000 --- a/src/cascadia/TerminalSettingsModel/ColorScheme.idl +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "ISettingsModelObject.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - [default_interface] runtimeclass ColorScheme : Windows.Foundation.IStringable, ISettingsModelObject { - ColorScheme(); - ColorScheme(String name); - - String Name; - - Microsoft.Terminal.Core.Color Foreground; - Microsoft.Terminal.Core.Color Background; - Microsoft.Terminal.Core.Color SelectionBackground; - Microsoft.Terminal.Core.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.Core.Scheme ToCoreScheme(); - } -} diff --git a/src/cascadia/TerminalSettingsModel/Command.idl b/src/cascadia/TerminalSettingsModel/Command.idl deleted file mode 100644 index e92f459e69d..00000000000 --- a/src/cascadia/TerminalSettingsModel/Command.idl +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -#include "AllShortcutActions.h" - -import "ActionArgs.idl"; -import "Profile.idl"; -import "ColorScheme.idl"; -import "TerminalWarnings.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - enum ShortcutAction - { - Invalid = 0, // treat Invalid as unbound actions - - // When adding a new action, add them to AllShortcutActions.h! - #define ON_ALL_ACTIONS(action) action, - ALL_SHORTCUT_ACTIONS - #undef ON_ALL_ACTIONS - }; - - [default_interface] runtimeclass ActionAndArgs { - ActionAndArgs(); - ActionAndArgs(ShortcutAction action, IActionArgs args); - - static String Serialize(IVector args); - static IVector Deserialize(String content); - - IActionArgs Args; - ShortcutAction Action; - }; - - [default_interface] runtimeclass Command - { - Command(); - - String Name { get; }; - ActionAndArgs ActionAndArgs { get; }; - Microsoft.Terminal.Control.KeyChord Keys { get; }; - void RegisterKey(Microsoft.Terminal.Control.KeyChord keys); - String KeyChordText { get; }; - - String IconPath; - - Boolean HasNestedCommands { get; }; - Windows.Foundation.Collections.IMapView NestedCommands { get; }; - - static IVector ParsePowerShellMenuComplete(String json, Int32 replaceLength); - static IVector HistoryToCommands(IVector commandHistory, String commandline, Boolean directories); - - } -} diff --git a/src/cascadia/TerminalSettingsModel/DefaultTerminal.idl b/src/cascadia/TerminalSettingsModel/DefaultTerminal.idl deleted file mode 100644 index 7fdac2b2aa8..00000000000 --- a/src/cascadia/TerminalSettingsModel/DefaultTerminal.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Model -{ - runtimeclass DefaultTerminal : Windows.Foundation.IStringable - { - String Name { get; }; - String Author { get; }; - String Version { get; }; - String Icon { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsModel/EnumMappings.idl b/src/cascadia/TerminalSettingsModel/EnumMappings.idl deleted file mode 100644 index a74dc96b483..00000000000 --- a/src/cascadia/TerminalSettingsModel/EnumMappings.idl +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation -// Licensed under the MIT license. - -import "GlobalAppSettings.idl"; -import "Profile.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - [default_interface] runtimeclass EnumMappings { - // Global Settings - static Windows.Foundation.Collections.IMap ElementTheme { get; }; - static Windows.Foundation.Collections.IMap NewTabPosition { get; }; - static Windows.Foundation.Collections.IMap TabViewWidthMode { get; }; - static Windows.Foundation.Collections.IMap FirstWindowPreference { get; }; - static Windows.Foundation.Collections.IMap LaunchMode { get; }; - static Windows.Foundation.Collections.IMap TabSwitcherMode { get; }; - static Windows.Foundation.Collections.IMap CopyFormat { get; }; - static Windows.Foundation.Collections.IMap WindowingMode { get; }; - static Windows.Foundation.Collections.IMap MatchMode { get; }; - - // Profile Settings - static Windows.Foundation.Collections.IMap CloseOnExitMode { get; }; - static Windows.Foundation.Collections.IMap ScrollbarState { get; }; - static Windows.Foundation.Collections.IMap BackgroundImageStretchMode { get; }; - static Windows.Foundation.Collections.IMap TextAntialiasingMode { get; }; - static Windows.Foundation.Collections.IMap CursorStyle { get; }; - static Windows.Foundation.Collections.IMap AdjustIndistinguishableColors { get; }; - static Windows.Foundation.Collections.IMap FontWeight { get; }; - static Windows.Foundation.Collections.IMap IntenseTextStyle { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsModel/FontConfig.idl b/src/cascadia/TerminalSettingsModel/FontConfig.idl deleted file mode 100644 index 995e7c6a651..00000000000 --- a/src/cascadia/TerminalSettingsModel/FontConfig.idl +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "Profile.idl"; -#include "IInheritable.idl.h" - -#define INHERITABLE_FONT_SETTING(Type, Name) \ - _BASE_INHERITABLE_SETTING(Type, Name); \ - Microsoft.Terminal.Settings.Model.FontConfig Name##OverrideSource { get; } - -#define COMMA , - -namespace Microsoft.Terminal.Settings.Model -{ - [default_interface] runtimeclass FontConfig { - Microsoft.Terminal.Settings.Model.Profile SourceProfile { get; }; - - INHERITABLE_FONT_SETTING(String, FontFace); - INHERITABLE_FONT_SETTING(Single, FontSize); - INHERITABLE_FONT_SETTING(Windows.UI.Text.FontWeight, FontWeight); - INHERITABLE_FONT_SETTING(Windows.Foundation.Collections.IMap, FontFeatures); - INHERITABLE_FONT_SETTING(Windows.Foundation.Collections.IMap, FontAxes); - INHERITABLE_FONT_SETTING(Boolean, EnableBuiltinGlyphs); - INHERITABLE_FONT_SETTING(String, CellWidth); - INHERITABLE_FONT_SETTING(String, CellHeight); - } -} diff --git a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl deleted file mode 100644 index 612262d4b11..00000000000 --- a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -#include "IInheritable.idl.h" - -import "Theme.idl"; -import "ColorScheme.idl"; -import "ActionMap.idl"; -import "NewTabMenuEntry.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - // MIDL 3 allows for structs to hold nullable types - // Though IReference is a WinRT object, MIDL 3 - // handles all of the ownership logic for us. - // Docs: https://docs.microsoft.com/en-us/uwp/midl-3/intro#types - struct LaunchPosition - { - Windows.Foundation.IReference X; - Windows.Foundation.IReference Y; - }; - - [flags] - enum LaunchMode - { - DefaultMode = 0, - MaximizedMode = 1, - FullscreenMode = 2, - FocusMode = 4, - MaximizedFocusMode = 5 - }; - - enum WindowingMode - { - UseNew, - UseAnyExisting, - UseExisting, - }; - - enum FirstWindowPreference - { - DefaultProfile, - PersistedWindowLayout, - }; - - enum NewTabPosition - { - AfterLastTab, - AfterCurrentTab, - }; - - [default_interface] runtimeclass GlobalAppSettings { - Guid DefaultProfile; - - INHERITABLE_SETTING(String, UnparsedDefaultProfile); - - INHERITABLE_SETTING(Int32, InitialRows); - INHERITABLE_SETTING(Int32, InitialCols); - INHERITABLE_SETTING(Boolean, AlwaysShowTabs); - INHERITABLE_SETTING(NewTabPosition, NewTabPosition); - INHERITABLE_SETTING(Boolean, ShowTitleInTitlebar); - INHERITABLE_SETTING(Boolean, ConfirmCloseAllTabs); - INHERITABLE_SETTING(String, Language); - INHERITABLE_SETTING(Microsoft.UI.Xaml.Controls.TabViewWidthMode, TabWidthMode); - INHERITABLE_SETTING(Boolean, UseAcrylicInTabRow); - INHERITABLE_SETTING(Boolean, ShowTabsInTitlebar); - INHERITABLE_SETTING(String, WordDelimiters); - INHERITABLE_SETTING(Boolean, CopyOnSelect); - INHERITABLE_SETTING(Boolean, InputServiceWarning); - INHERITABLE_SETTING(Microsoft.Terminal.Control.CopyFormat, CopyFormatting); - INHERITABLE_SETTING(Boolean, WarnAboutLargePaste); - INHERITABLE_SETTING(Boolean, WarnAboutMultiLinePaste); - INHERITABLE_SETTING(Boolean, TrimPaste); - INHERITABLE_SETTING(LaunchPosition, InitialPosition); - INHERITABLE_SETTING(Boolean, CenterOnLaunch); - INHERITABLE_SETTING(FirstWindowPreference, FirstWindowPreference); - INHERITABLE_SETTING(LaunchMode, LaunchMode); - INHERITABLE_SETTING(Boolean, SnapToGridOnResize); - INHERITABLE_SETTING(Boolean, ForceFullRepaintRendering); - INHERITABLE_SETTING(Boolean, SoftwareRendering); - INHERITABLE_SETTING(Boolean, UseBackgroundImageForWindow); - INHERITABLE_SETTING(Boolean, ForceVTInput); - INHERITABLE_SETTING(Boolean, DebugFeaturesEnabled); - INHERITABLE_SETTING(Boolean, StartOnUserLogin); - INHERITABLE_SETTING(Boolean, AlwaysOnTop); - INHERITABLE_SETTING(Boolean, AutoHideWindow); - INHERITABLE_SETTING(TabSwitcherMode, TabSwitcherMode); - INHERITABLE_SETTING(Boolean, DisableAnimations); - INHERITABLE_SETTING(String, StartupActions); - INHERITABLE_SETTING(Boolean, FocusFollowMouse); - INHERITABLE_SETTING(WindowingMode, WindowingBehavior); - INHERITABLE_SETTING(Boolean, TrimBlockSelection); - INHERITABLE_SETTING(Boolean, DetectURLs); - INHERITABLE_SETTING(Boolean, MinimizeToNotificationArea); - INHERITABLE_SETTING(Boolean, AlwaysShowNotificationIcon); - INHERITABLE_SETTING(IVector, DisabledProfileSources); - INHERITABLE_SETTING(Boolean, ShowAdminShield); - INHERITABLE_SETTING(IVector, NewTabMenu); - INHERITABLE_SETTING(Boolean, EnableColorSelection); - INHERITABLE_SETTING(Boolean, EnableShellCompletionMenu); - INHERITABLE_SETTING(Boolean, EnableUnfocusedAcrylic); - INHERITABLE_SETTING(Boolean, IsolatedMode); - INHERITABLE_SETTING(Boolean, AllowHeadless); - INHERITABLE_SETTING(String, SearchWebDefaultQueryUrl); - - Windows.Foundation.Collections.IMapView ColorSchemes(); - void AddColorScheme(ColorScheme scheme); - void RemoveColorScheme(String schemeName); - ColorScheme DuplicateColorScheme(ColorScheme scheme); - - ActionMap ActionMap { get; }; - - Windows.Foundation.Collections.IMapView Themes(); - void AddTheme(Theme theme); - INHERITABLE_SETTING(ThemePair, Theme); - Theme CurrentTheme { get; }; - - Boolean ShouldUsePersistedLayout(); - } -} diff --git a/src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl b/src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl deleted file mode 100644 index bf8d8c5ed95..00000000000 --- a/src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "Profile.idl"; -#include "IInheritable.idl.h" - -#define INHERITABLE_APPEARANCE_SETTING(Type, Name) \ - _BASE_INHERITABLE_SETTING(Type, Name); \ - Microsoft.Terminal.Settings.Model.IAppearanceConfig Name##OverrideSource { get; } - -namespace Microsoft.Terminal.Settings.Model -{ - [flags] enum ConvergedAlignment { - // low 4 bits are the horizontal - Horizontal_Center = 0x00, - Horizontal_Left = 0x01, - Horizontal_Right = 0x02, - - // high 4 bits are the vertical - Vertical_Center = 0x00, - Vertical_Top = 0x10, - Vertical_Bottom = 0x20 - }; - - [flags] enum IntenseStyle { - Bold = 0x1, - Bright = 0x2, - All = 0xffffffff - }; - - interface IAppearanceConfig - { - Microsoft.Terminal.Settings.Model.Profile SourceProfile { get; }; - - INHERITABLE_APPEARANCE_SETTING(String, DarkColorSchemeName); - INHERITABLE_APPEARANCE_SETTING(String, LightColorSchemeName); - - INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference, Foreground); - INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference, Background); - INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference, SelectionBackground); - INHERITABLE_APPEARANCE_SETTING(Windows.Foundation.IReference, CursorColor); - INHERITABLE_APPEARANCE_SETTING(Microsoft.Terminal.Core.CursorStyle, CursorShape); - INHERITABLE_APPEARANCE_SETTING(UInt32, CursorHeight); - - INHERITABLE_APPEARANCE_SETTING(String, BackgroundImagePath); - String ExpandedBackgroundImagePath { get; }; - - INHERITABLE_APPEARANCE_SETTING(Double, BackgroundImageOpacity); - INHERITABLE_APPEARANCE_SETTING(Windows.UI.Xaml.Media.Stretch, BackgroundImageStretchMode); - INHERITABLE_APPEARANCE_SETTING(ConvergedAlignment, BackgroundImageAlignment); - - INHERITABLE_APPEARANCE_SETTING(Boolean, RetroTerminalEffect); - 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(Double, Opacity); - INHERITABLE_APPEARANCE_SETTING(Boolean, UseAcrylic); - }; -} diff --git a/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl b/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl deleted file mode 100644 index 21bc4b9c326..00000000000 --- a/src/cascadia/TerminalSettingsModel/ISettingsModelObject.idl +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Model -{ - // This tag is used to identify the context in which this object was created - enum OriginTag - { - None = 0, - User, - InBox, - Generated, - Fragment, - ProfilesDefaults - }; - - interface ISettingsModelObject { - OriginTag Origin { get; }; - } -} diff --git a/src/cascadia/TerminalSettingsModel/KeyChordSerialization.idl b/src/cascadia/TerminalSettingsModel/KeyChordSerialization.idl deleted file mode 100644 index 6cb37fca7b1..00000000000 --- a/src/cascadia/TerminalSettingsModel/KeyChordSerialization.idl +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Model -{ - static runtimeclass KeyChordSerialization - { - static Microsoft.Terminal.Control.KeyChord FromString(String str); - static String ToString(Microsoft.Terminal.Control.KeyChord chord); - } -} diff --git a/src/cascadia/TerminalSettingsModel/NewTabMenuEntry.idl b/src/cascadia/TerminalSettingsModel/NewTabMenuEntry.idl deleted file mode 100644 index 64a3b1fdd94..00000000000 --- a/src/cascadia/TerminalSettingsModel/NewTabMenuEntry.idl +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "Profile.idl"; - -namespace Microsoft.Terminal.Settings.Model -{ - enum NewTabMenuEntryType - { - Invalid = 0, - Profile, - Separator, - Folder, - RemainingProfiles, - MatchProfiles - }; - - [default_interface] unsealed runtimeclass NewTabMenuEntry - { - NewTabMenuEntryType Type; - } - - [default_interface] runtimeclass SeparatorEntry : NewTabMenuEntry - { - SeparatorEntry(); - } - - [default_interface] runtimeclass ProfileEntry : NewTabMenuEntry - { - ProfileEntry(); - ProfileEntry(String profile); - - Profile Profile; - Int32 ProfileIndex; - } - - enum FolderEntryInlining - { - Never = 0, - Auto - }; - - [default_interface] runtimeclass FolderEntry : NewTabMenuEntry - { - FolderEntry(); - FolderEntry(String name); - - String Name; - String Icon; - FolderEntryInlining Inlining; - Boolean AllowEmpty; - - IVector Entries(); - } - - [default_interface] unsealed runtimeclass ProfileCollectionEntry : NewTabMenuEntry - { - IMap Profiles; - } - - [default_interface] runtimeclass RemainingProfilesEntry : ProfileCollectionEntry - { - RemainingProfilesEntry(); - } - - [default_interface] runtimeclass MatchProfilesEntry : ProfileCollectionEntry - { - MatchProfilesEntry(); - - String Name; - String Commandline; - String Source; - } -} diff --git a/src/cascadia/TerminalSettingsModel/Profile.idl b/src/cascadia/TerminalSettingsModel/Profile.idl deleted file mode 100644 index 9023fd16edb..00000000000 --- a/src/cascadia/TerminalSettingsModel/Profile.idl +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "IAppearanceConfig.idl"; -import "ISettingsModelObject.idl"; -import "FontConfig.idl"; -#include "IInheritable.idl.h" - -#define INHERITABLE_PROFILE_SETTING(Type, Name) \ - _BASE_INHERITABLE_SETTING(Type, Name); \ - Microsoft.Terminal.Settings.Model.Profile Name##OverrideSource { get; } - -#define COMMA , - -namespace Microsoft.Terminal.Settings.Model -{ - enum CloseOnExitMode - { - Never = 0, - Graceful, - Always, - Automatic - }; - - [flags] - enum BellStyle - { - // !! If you update this, you must update the values in TerminalSettingsEditor/Profiles.xaml - Audible = 0x1, - Window = 0x2, - Taskbar = 0x4, - All = 0xffffffff - }; - - [default_interface] runtimeclass Profile : Windows.Foundation.IStringable, ISettingsModelObject { - Profile(); - Profile(Guid guid); - - void CreateUnfocusedAppearance(); - void DeleteUnfocusedAppearance(); - - // True if the user explicitly removed this Profile from settings.json. - Boolean Deleted { get; }; - - // Helper for magically using a commandline for an icon for a profile - // without an explicit icon. - String EvaluatedIcon { get; }; - - INHERITABLE_PROFILE_SETTING(Guid, Guid); - INHERITABLE_PROFILE_SETTING(String, Name); - INHERITABLE_PROFILE_SETTING(String, Source); - INHERITABLE_PROFILE_SETTING(Boolean, Hidden); - INHERITABLE_PROFILE_SETTING(Guid, ConnectionType); - INHERITABLE_PROFILE_SETTING(String, Icon); - INHERITABLE_PROFILE_SETTING(CloseOnExitMode, CloseOnExit); - INHERITABLE_PROFILE_SETTING(String, TabTitle); - INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference, TabColor); - INHERITABLE_PROFILE_SETTING(Boolean, SuppressApplicationTitle); - INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState); - INHERITABLE_PROFILE_SETTING(String, Padding); - INHERITABLE_PROFILE_SETTING(String, Commandline); - INHERITABLE_PROFILE_SETTING(Boolean, VtPassthrough); - - INHERITABLE_PROFILE_SETTING(String, StartingDirectory); - String EvaluatedStartingDirectory { get; }; - - FontConfig FontInfo { get; }; - - IAppearanceConfig DefaultAppearance { get; }; - INHERITABLE_PROFILE_SETTING(IAppearanceConfig, UnfocusedAppearance); - - INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.TextAntialiasingMode, AntialiasingMode); - - INHERITABLE_PROFILE_SETTING(Int32, HistorySize); - INHERITABLE_PROFILE_SETTING(Boolean, SnapOnInput); - INHERITABLE_PROFILE_SETTING(Boolean, AltGrAliasing); - INHERITABLE_PROFILE_SETTING(BellStyle, BellStyle); - - INHERITABLE_PROFILE_SETTING(Windows.Foundation.Collections.IMap, EnvironmentVariables); - - INHERITABLE_PROFILE_SETTING(Windows.Foundation.Collections.IVector, BellSound); - - INHERITABLE_PROFILE_SETTING(Boolean, Elevate); - INHERITABLE_PROFILE_SETTING(Boolean, AutoMarkPrompts); - INHERITABLE_PROFILE_SETTING(Boolean, ShowMarks); - - INHERITABLE_PROFILE_SETTING(Boolean, RightClickContextMenu); - INHERITABLE_PROFILE_SETTING(Boolean, RepositionCursorWithMouse); - - INHERITABLE_PROFILE_SETTING(Boolean, ReloadEnvironmentVariables); - - } -} diff --git a/src/cascadia/TerminalSettingsModel/TerminalSettings.idl b/src/cascadia/TerminalSettingsModel/TerminalSettings.idl deleted file mode 100644 index 23c305ee4e0..00000000000 --- a/src/cascadia/TerminalSettingsModel/TerminalSettings.idl +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import "CascadiaSettings.idl"; - -#define COMMA , - -namespace Microsoft.Terminal.Settings.Model -{ - runtimeclass TerminalSettingsCreateResult - { - TerminalSettingsCreateResult(TerminalSettings defaultSettings); - TerminalSettings DefaultSettings { get; }; - TerminalSettings UnfocusedSettings { get; }; - } - - // Class Description: - // TerminalSettings encapsulates all settings that control the - // TermControl's behavior. In these settings there is both the entirety - // of the Core ICoreSettings properties and the IControlSettings - // properties. It's the Profile's responsibility to build this from - // settings it contains, in combination with the global settings. - // The TerminalControl will pull settings it requires from this object, - // and pass along the Core properties to the terminal core. - [default_interface] - runtimeclass TerminalSettings : Microsoft.Terminal.Core.ICoreSettings, - Microsoft.Terminal.Control.IControlSettings - { - TerminalSettings(); - - Windows.Foundation.Collections.IMap EnvironmentVariables; - - static TerminalSettings CreateForPreview(CascadiaSettings appSettings, Profile profile); - static TerminalSettingsCreateResult CreateWithProfile(CascadiaSettings appSettings, Profile profile, Microsoft.Terminal.Control.IKeyBindings keybindings); - static TerminalSettingsCreateResult CreateWithNewTerminalArgs(CascadiaSettings appSettings, NewTerminalArgs newTerminalArgs, Microsoft.Terminal.Control.IKeyBindings keybindings); - - void ApplyColorScheme(ColorScheme scheme); - - ColorScheme AppliedColorScheme; - - // The getters for these are already defined in IControlSettings. So - // we're just adding the setters here, because TerminalApp likes to be - // able to change these at runtime (e.g. when duplicating a pane). - String Commandline { set; }; - String StartingDirectory { set; }; - - Boolean Elevate; - Boolean ReloadEnvironmentVariables; - }; -} diff --git a/src/cascadia/TerminalSettingsModel/TerminalWarnings.idl b/src/cascadia/TerminalSettingsModel/TerminalWarnings.idl deleted file mode 100644 index aa02d18ff46..00000000000 --- a/src/cascadia/TerminalSettingsModel/TerminalWarnings.idl +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Model -{ - // SettingsLoadWarnings are scenarios where the settings contained - // information we knew was invalid, but we could recover from. - enum SettingsLoadWarnings - { - MissingDefaultProfile = 0, - DuplicateProfile, - UnknownColorScheme, - InvalidBackgroundImage, - InvalidIcon, - AtLeastOneKeybindingWarning, - TooManyKeysForChord, - MissingRequiredParameter, - FailedToParseCommandJson, - FailedToWriteToSettings, - InvalidColorSchemeInCmd, - InvalidSplitSize, - FailedToParseStartupActions, - InvalidProfileEnvironmentVariables, - FailedToParseSubCommands, - UnknownTheme, - DuplicateRemainingProfilesEntry, - InvalidUseOfContent, - WARNINGS_SIZE // IMPORTANT: This MUST be the last value in this enum. It's an unused placeholder. - }; - - // SettingsLoadWarnings are scenarios where the settings had invalid state - // that we could not recover from. - enum SettingsLoadErrors - { - NoProfiles = 0, - AllProfilesHidden = 1, - ERRORS_SIZE // IMPORTANT: This MUST be the last value in this enum. It's an unused placeholder. - }; -} diff --git a/src/cascadia/TerminalSettingsModel/Theme.idl b/src/cascadia/TerminalSettingsModel/Theme.idl deleted file mode 100644 index 830bafef2a2..00000000000 --- a/src/cascadia/TerminalSettingsModel/Theme.idl +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -namespace Microsoft.Terminal.Settings.Model -{ - - enum IconStyle - { - Default, - Hidden, - Monochrome - }; - - enum ThemeColorType - { - Accent, - Color, - TerminalBackground - }; - - enum TabCloseButtonVisibility - { - Always, - Hover, - Never, - ActiveOnly - }; - - [default_interface] runtimeclass ThemePair - { - ThemePair(); - ThemePair(String name); - ThemePair(String darkName, String lightName); - - String DarkName; - String LightName; - }; - - runtimeclass ThemeColor - { - ThemeColor(); - static ThemeColor FromColor(Microsoft.Terminal.Core.Color color); - static ThemeColor FromAccent(); - static ThemeColor FromTerminalBackground(); - - Microsoft.Terminal.Core.Color Color { get; }; - ThemeColorType ColorType; - - static Microsoft.Terminal.Core.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); - UInt8 UnfocusedTabOpacity { get; }; - } - - runtimeclass WindowTheme { - Windows.UI.Xaml.ElementTheme RequestedTheme { get; }; - Boolean UseMica { get; }; - Boolean RainbowFrame { get; }; - ThemeColor Frame { get; }; - ThemeColor UnfocusedFrame { get; }; - } - - runtimeclass TabRowTheme { - ThemeColor Background { get; }; - ThemeColor UnfocusedBackground { get; }; - } - - runtimeclass TabTheme { - ThemeColor Background { get; }; - ThemeColor UnfocusedBackground { get; }; - TabCloseButtonVisibility ShowCloseButton { get; }; - IconStyle IconStyle { get; }; - } - - [default_interface] runtimeclass Theme : Windows.Foundation.IStringable { - Theme(); - Theme(Windows.UI.Xaml.ElementTheme requestedTheme); - - String Name; - - // window.* Namespace - WindowTheme Window { get; }; - - // tabRow.* Namespace - TabRowTheme TabRow { get; }; - - // tab.* Namespace - TabTheme Tab { get; }; - - // A helper for retrieving the RequestedTheme out of the window property - Windows.UI.Xaml.ElementTheme RequestedTheme { get; }; - static Boolean IsSystemInDarkTheme(); - - } -} From c8f49803f6d105fe437cec45daaab145f07e0d4b Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Mon, 25 Mar 2024 12:50:46 -0500 Subject: [PATCH 3/5] zebra --- .../TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl index 79fb9c6c84d..f2bbea07b7a 100644 --- a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl +++ b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.Model.idl @@ -524,6 +524,7 @@ namespace Microsoft.Terminal.Settings.Model // We need a sentinel value to map deleted keys to, as we can't actually delete them (GH#16874) IgnoredDeprecatedEntry = 0, CloseOnExitInfo, + KeyboardServiceWarning, }; runtimeclass WindowLayout From e710928c406ef64e49ec5645a69c898ccc09f882 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 30 Jul 2024 11:45:52 -0500 Subject: [PATCH 4/5] Clean up one DependentUpon --- .../Microsoft.Terminal.Settings.ModelLib.vcxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj index 38a3d50960b..0ba6d8ce4a1 100644 --- a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj +++ b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj @@ -27,7 +27,6 @@ - NewTabMenuEntry.idl @@ -145,7 +144,6 @@ - NewTabMenuEntry.idl From 36c711d59eea90447a7bd105905a80ebc473781e Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 30 Jul 2024 12:21:24 -0500 Subject: [PATCH 5/5] Ah, this class died in a fire --- .../Microsoft.Terminal.Settings.Editor.idl | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.idl b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.idl index d0aca621e80..299b6ac9cf5 100644 --- a/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.idl +++ b/src/cascadia/TerminalSettingsEditor/Microsoft.Terminal.Settings.Editor.idl @@ -103,14 +103,6 @@ namespace Microsoft.Terminal.Settings.Editor Single Value; } - runtimeclass FeatureKeyValuePair : Windows.UI.Xaml.Data.INotifyPropertyChanged - { - FeatureKeyValuePair(String featureKey, UInt32 featureValue, Windows.Foundation.Collections.IMap baseMap, Windows.Foundation.Collections.IMap tagToNameMap); - String FeatureKey; - UInt32 FeatureValue; - Int32 FeatureIndex; - } - runtimeclass AppearanceViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged { Boolean IsDefault;