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 ConnectionClosedEventArgs();
|
|
|
|
delegate void ScrollPositionChangedEventArgs(Int32 viewTop, Int32 viewHeight, Int32 bufferLength);
|
|
|
|
delegate void CopyToClipboardEventArgs(String copiedData);
|
|
|
|
|
|
|
|
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;
|
|
|
|
event ConnectionClosedEventArgs ConnectionClosed;
|
|
|
|
event CopyToClipboardEventArgs CopyToClipboard;
|
|
|
|
event Windows.Foundation.TypedEventHandler<TermControl, PasteFromClipboardEventArgs> PasteFromClipboard;
|
|
|
|
|
|
|
|
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();
|
2019-06-07 23:56:44 +02:00
|
|
|
Boolean ShouldCloseOnExit { get; };
|
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;
|
|
|
|
}
|
|
|
|
}
|