Files
Felix 58e3ab9115 Use AppService for Commnunication instead of WebSocket (#55)
* Use AppService for Commnunication instead of WebSocket

* Code cleanup

* Some polishing

* Added some tests
2018-07-19 12:05:02 +02:00

36 lines
1.0 KiB
C#

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.OnRightClick(x, y, hasSelection);
}
}
}