2019-05-03 00:29:04 +02:00
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
|
|
// Licensed under the MIT license.
|
|
|
|
|
|
|
|
namespace Microsoft.Terminal.TerminalControl
|
|
|
|
{
|
|
|
|
delegate void TitleChangedEventArgs(String newTitle);
|
|
|
|
delegate void ScrollPositionChangedEventArgs(Int32 viewTop, Int32 viewHeight, Int32 bufferLength);
|
2019-08-20 00:59:01 +02:00
|
|
|
|
|
|
|
runtimeclass CopyToClipboardEventArgs
|
|
|
|
{
|
|
|
|
String Text { get; };
|
|
|
|
String Html { get; };
|
2019-11-13 21:13:22 +01:00
|
|
|
String Rtf { get; };
|
2019-08-20 00:59:01 +02:00
|
|
|
}
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
runtimeclass PasteFromClipboardEventArgs
|
|
|
|
{
|
|
|
|
void HandleClipboardData(String data);
|
|
|
|
}
|
|
|
|
|
2019-08-17 00:43:51 +02:00
|
|
|
[default_interface] runtimeclass TermControl : Windows.UI.Xaml.Controls.UserControl
|
2019-05-03 00:29:04 +02:00
|
|
|
{
|
|
|
|
TermControl();
|
2019-06-28 19:55:46 +02:00
|
|
|
TermControl(Microsoft.Terminal.Settings.IControlSettings settings, Microsoft.Terminal.TerminalConnection.ITerminalConnection connection);
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
static Windows.Foundation.Point GetProposedDimensions(Microsoft.Terminal.Settings.IControlSettings settings, UInt32 dpi);
|
|
|
|
|
|
|
|
void UpdateSettings(Microsoft.Terminal.Settings.IControlSettings newSettings);
|
|
|
|
|
|
|
|
event TitleChangedEventArgs TitleChanged;
|
2019-08-20 00:59:01 +02:00
|
|
|
event Windows.Foundation.TypedEventHandler<TermControl, CopyToClipboardEventArgs> CopyToClipboard;
|
2019-05-03 00:29:04 +02:00
|
|
|
event Windows.Foundation.TypedEventHandler<TermControl, PasteFromClipboardEventArgs> PasteFromClipboard;
|
|
|
|
|
2019-11-25 23:22:29 +01:00
|
|
|
// 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; };
|
|
|
|
|
2019-05-03 00:29:04 +02:00
|
|
|
String Title { get; };
|
2019-08-17 00:43:51 +02:00
|
|
|
|
|
|
|
Boolean CopySelectionToClipboard(Boolean trimTrailingWhitespace);
|
2019-06-25 21:17:02 +02:00
|
|
|
void PasteTextFromClipboard();
|
2019-05-03 00:29:04 +02:00
|
|
|
void Close();
|
Enable resizing the panes with the keyboard. (#1207)
Adds the ability to resize panes with the keyboard.
This is accomplished by making the Column/RowDefinitions for a Pane use `GridLengthHelper::FromPixels` to set their size. We store a pair of floats that represents the relative amount that each pane takes out of the parent pane. When the window is resized, we use that percentage to figure out the new size of each child in pixels, and manually size each column.
Then, when the user presses the keybindings for resizePane{Left/Right/Up/Down}, we'll adjust those percentages, and resize the rows/cols as appropriate.
Currently, each pane adjusts the width/height by 5% of the total size at a time. I am not in love with this, but it works for now. I think when we get support for keybindings with arbitrary arg blobs, then we could do either a percent movement, or a number of characters at a time. The number of characters one would be trickier, because we'd have to get the focused control, and get the number of pixels per character, as adjacent panes might not have the same font sizes.
2019-07-10 15:27:12 +02:00
|
|
|
Windows.Foundation.Size CharacterDimensions { get; };
|
|
|
|
Windows.Foundation.Size MinimumSize { get; };
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
void ScrollViewport(Int32 viewTop);
|
2019-05-23 22:39:29 +02:00
|
|
|
void KeyboardScrollViewport(Int32 viewTop);
|
2019-05-03 00:29:04 +02:00
|
|
|
Int32 GetScrollOffset();
|
2019-05-15 15:21:14 +02:00
|
|
|
Int32 GetViewHeight();
|
2019-05-03 00:29:04 +02:00
|
|
|
event ScrollPositionChangedEventArgs ScrollPositionChanged;
|
2019-09-30 15:18:05 +02:00
|
|
|
|
|
|
|
void AdjustFontSize(Int32 fontSizeDelta);
|
2019-11-25 18:35:10 +01:00
|
|
|
void ResetFontSize();
|
2019-05-03 00:29:04 +02:00
|
|
|
}
|
|
|
|
}
|