mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-11 04:38:24 -06:00
For some reason, we went real hard on an architecture where the settings object contained the key bindings handler for the terminal. To make this work, we had to wind it through tons of layers: `TermControl`, `ControlInteractivity`, `ControlCore` (which saved it on `ControlSettings`), `ControlSettings`. Of course, because we have no clear delineation of concerns at the App layer this required us to put the bindings into the Settings Cache[^1]. Well, `TermControl` used `ControlCore` to get the Settings, to get the Bindings, to dispatch keys. Yes, `TermControl` stored `IKeyBindings` down three layers _only to fish it back out and use it itself._ There is one place in the application where `TermControl`s are hooked up to their owners. Instead of passing the key bindings dispatcher in through nine hundred layers, we can just set it once--definitively!-- there. [^1]: This was the last thing that made the settings cache page-specific...
82 lines
3.3 KiB
Plaintext
82 lines
3.3 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
import "ICoreState.idl";
|
|
import "IControlSettings.idl";
|
|
import "ControlCore.idl";
|
|
import "EventArgs.idl";
|
|
import "InteractivityAutomationPeer.idl";
|
|
|
|
|
|
namespace Microsoft.Terminal.Control
|
|
{
|
|
|
|
[default_interface] runtimeclass ControlInteractivity
|
|
{
|
|
ControlInteractivity(IControlSettings settings,
|
|
IControlAppearance unfocusedAppearance,
|
|
Microsoft.Terminal.TerminalConnection.ITerminalConnection connection);
|
|
|
|
ControlCore Core { get; };
|
|
void UpdateSettings();
|
|
void Initialize();
|
|
void GotFocus();
|
|
void LostFocus();
|
|
|
|
UInt64 Id { get; };
|
|
|
|
void AttachToNewControl();
|
|
void Detach();
|
|
|
|
void Close();
|
|
|
|
InteractivityAutomationPeer OnCreateAutomationPeer();
|
|
|
|
Boolean CopySelectionToClipboard(Boolean singleLine, Boolean withControlSequences, CopyFormat formats);
|
|
void RequestPasteTextFromClipboard();
|
|
void SetEndSelectionPoint(Microsoft.Terminal.Core.Point point);
|
|
|
|
void PointerPressed(MouseButtonState buttonState,
|
|
UInt32 pointerUpdateKind,
|
|
UInt64 timestamp,
|
|
Microsoft.Terminal.Core.ControlKeyStates modifiers,
|
|
Microsoft.Terminal.Core.Point pixelPosition);
|
|
void TouchPressed(Windows.Foundation.Point contactPoint);
|
|
|
|
Boolean PointerMoved(MouseButtonState buttonState,
|
|
UInt32 pointerUpdateKind,
|
|
Microsoft.Terminal.Core.ControlKeyStates modifiers,
|
|
Boolean focused,
|
|
Microsoft.Terminal.Core.Point pixelPosition,
|
|
Boolean pointerPressedInBounds);
|
|
|
|
void TouchMoved(Windows.Foundation.Point newTouchPoint,
|
|
Boolean focused);
|
|
|
|
void PointerReleased(MouseButtonState buttonState,
|
|
UInt32 pointerUpdateKind,
|
|
Microsoft.Terminal.Core.ControlKeyStates modifiers,
|
|
Microsoft.Terminal.Core.Point pixelPosition);
|
|
void TouchReleased();
|
|
|
|
Boolean MouseWheel(Microsoft.Terminal.Core.ControlKeyStates modifiers,
|
|
Int32 delta,
|
|
Microsoft.Terminal.Core.Point pixelPosition,
|
|
MouseButtonState state);
|
|
|
|
void UpdateScrollbar(Single newValue);
|
|
|
|
event Windows.Foundation.TypedEventHandler<Object, OpenHyperlinkEventArgs> OpenHyperlink;
|
|
event Windows.Foundation.TypedEventHandler<Object, ScrollPositionChangedArgs> ScrollPositionChanged;
|
|
event Windows.Foundation.TypedEventHandler<Object, PasteFromClipboardEventArgs> PasteFromClipboard;
|
|
|
|
event Windows.Foundation.TypedEventHandler<Object, Object> Closed;
|
|
|
|
event Windows.Foundation.TypedEventHandler<Object, Object> Attached;
|
|
|
|
// Used to communicate to the TermControl, but not necessarily higher up in the stack
|
|
event Windows.Foundation.TypedEventHandler<Object, ContextMenuRequestedEventArgs> ContextMenuRequested;
|
|
|
|
};
|
|
}
|