9047bbbafb
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request The TerminalSettings object we create from profiles no longer gets passed into the control, instead, a child of that object gets passed into the control. Any overrides the control makes to the settings then live in the child. So, when we do a settings reload, we simply update the child's parent and the overrides will remain. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [ ] Closes #xxx * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [x] I work here <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Manual testing
125 lines
4.9 KiB
Plaintext
125 lines
4.9 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
import "IMouseWheelListener.idl";
|
|
import "IControlSettings.idl";
|
|
|
|
namespace Microsoft.Terminal.TerminalControl
|
|
{
|
|
delegate void TitleChangedEventArgs(String newTitle);
|
|
delegate void FontSizeChangedEventArgs(Int32 width, Int32 height, Boolean isInitialChange);
|
|
delegate void ScrollPositionChangedEventArgs(Int32 viewTop, Int32 viewHeight, Int32 bufferLength);
|
|
|
|
// C++/winrt makes it difficult to share this idl between two projects,
|
|
// Instead, we just pin the uuid and include it in both TermControl and App
|
|
// If you update this one, please update TerminalApp\IDirectKeyListener.idl.
|
|
// If you change this interface, please update the guid.
|
|
// If you press F7 or Alt and get a runtime error, go make sure both copies are the same.
|
|
[uuid("0ddf4edc-3fda-4dee-97ca-a417ee3dd510")] interface IDirectKeyListener {
|
|
Boolean OnDirectKeyEvent(UInt32 vkey, UInt8 scanCode, Boolean down);
|
|
};
|
|
|
|
[flags]
|
|
enum CopyFormat
|
|
{
|
|
HTML = 0x1,
|
|
RTF = 0x2,
|
|
All = 0xffffffff
|
|
};
|
|
|
|
runtimeclass CopyToClipboardEventArgs
|
|
{
|
|
String Text { get; };
|
|
String Html { get; };
|
|
String Rtf { get; };
|
|
Windows.Foundation.IReference<CopyFormat> Formats { get; };
|
|
}
|
|
|
|
runtimeclass PasteFromClipboardEventArgs
|
|
{
|
|
void HandleClipboardData(String data);
|
|
}
|
|
|
|
runtimeclass OpenHyperlinkEventArgs
|
|
{
|
|
String Uri { get; };
|
|
}
|
|
|
|
enum NoticeLevel
|
|
{
|
|
Debug = 10,
|
|
Info = 20,
|
|
Warning = 30,
|
|
Error = 40,
|
|
};
|
|
|
|
runtimeclass NoticeEventArgs
|
|
{
|
|
NoticeLevel Level { get; };
|
|
String Message { get; };
|
|
}
|
|
|
|
[default_interface] runtimeclass TermControl : Windows.UI.Xaml.Controls.UserControl, IDirectKeyListener, IMouseWheelListener
|
|
{
|
|
TermControl(Microsoft.Terminal.TerminalControl.IControlSettings settings, Microsoft.Terminal.TerminalConnection.ITerminalConnection connection);
|
|
|
|
static Windows.Foundation.Size GetProposedDimensions(Microsoft.Terminal.TerminalControl.IControlSettings settings, UInt32 dpi);
|
|
|
|
void UpdateSettings();
|
|
|
|
Microsoft.Terminal.TerminalControl.IControlSettings Settings { get; };
|
|
|
|
event TitleChangedEventArgs TitleChanged;
|
|
event FontSizeChangedEventArgs FontSizeChanged;
|
|
event Windows.Foundation.TypedEventHandler<TermControl, CopyToClipboardEventArgs> CopyToClipboard;
|
|
event Windows.Foundation.TypedEventHandler<TermControl, PasteFromClipboardEventArgs> PasteFromClipboard;
|
|
event Windows.Foundation.TypedEventHandler<TermControl, OpenHyperlinkEventArgs> OpenHyperlink;
|
|
event Windows.Foundation.TypedEventHandler<TermControl, Object> SetTaskbarProgress;
|
|
event Windows.Foundation.TypedEventHandler<TermControl, NoticeEventArgs> RaiseNotice;
|
|
event Windows.Foundation.TypedEventHandler<Object, Object> WarningBell;
|
|
event Windows.Foundation.TypedEventHandler<Object, Object> HidePointerCursor;
|
|
event Windows.Foundation.TypedEventHandler<Object, Object> RestorePointerCursor;
|
|
|
|
event Windows.Foundation.TypedEventHandler<TermControl, Windows.UI.Xaml.RoutedEventArgs> Initialized;
|
|
// This is an event handler forwarder for the underlying connection.
|
|
// We expose this and ConnectionState here so that it might eventually be data bound.
|
|
event Windows.Foundation.TypedEventHandler<TermControl, IInspectable> ConnectionStateChanged;
|
|
Microsoft.Terminal.TerminalConnection.ConnectionState ConnectionState { get; };
|
|
|
|
String Title { get; };
|
|
|
|
Boolean CopySelectionToClipboard(Boolean singleLine, Windows.Foundation.IReference<CopyFormat> formats);
|
|
void PasteTextFromClipboard();
|
|
void Close();
|
|
Windows.Foundation.Size CharacterDimensions { get; };
|
|
Windows.Foundation.Size MinimumSize { get; };
|
|
Single SnapDimensionToGrid(Boolean widthOrHeight, Single dimension);
|
|
|
|
void ScrollViewport(Int32 viewTop);
|
|
Int32 GetScrollOffset();
|
|
Int32 GetViewHeight();
|
|
event ScrollPositionChangedEventArgs ScrollPositionChanged;
|
|
|
|
void CreateSearchBoxControl();
|
|
|
|
void AdjustFontSize(Int32 fontSizeDelta);
|
|
void ResetFontSize();
|
|
|
|
void ToggleShaderEffects();
|
|
void SendInput(String input);
|
|
|
|
void TaskbarProgressChanged();
|
|
UInt64 TaskbarState { get; };
|
|
UInt64 TaskbarProgress { get; };
|
|
|
|
String WorkingDirectory { get; };
|
|
|
|
Windows.Foundation.IReference<Windows.UI.Color> TabColor { get; };
|
|
event Windows.Foundation.TypedEventHandler<Object, Object> TabColorChanged;
|
|
|
|
Boolean ReadOnly { get; };
|
|
void ToggleReadOnly();
|
|
event Windows.Foundation.TypedEventHandler<Object, Object> ReadOnlyChanged;
|
|
}
|
|
}
|