Files
FluentTerminal/FluentTerminal.RuntimeComponent/WebAllowedObjects/TerminalBridge.cs
T

47 lines
1.4 KiB
C#

using FluentTerminal.RuntimeComponent.Enums;
using FluentTerminal.RuntimeComponent.Interfaces;
using Windows.Foundation.Metadata;
namespace FluentTerminal.RuntimeComponent.WebAllowedObjects
{
[AllowForWeb]
public sealed class TerminalBridge
{
private readonly ITerminalEventListener _terminalEventListener;
public TerminalBridge(ITerminalEventListener terminalEventListener)
{
_terminalEventListener = terminalEventListener;
}
public void NotifySizeChanged(int columns, int rows)
{
_terminalEventListener.OnTerminalResized(columns, rows);
}
public void NotifyTitleChanged(string title)
{
_terminalEventListener.OnTitleChanged(title);
}
public void InvokeCommand(string command)
{
_terminalEventListener.OnKeyboardCommand(command);
}
public void NotifyRightClick(int x, int y, bool hasSelection)
{
_terminalEventListener.OnMouseClick(MouseButton.Right, x, y, hasSelection);
}
public void NotifyMiddleClick(int x, int y, bool hasSelection)
{
_terminalEventListener.OnMouseClick(MouseButton.Middle, x, y, hasSelection);
}
public void NotifySelectionChanged(string selection)
{
_terminalEventListener.OnSelectionChanged(selection);
}
}
}