# HG changeset patch # User Carl Byington # Date 1402505658 25200 # Node ID 80dcebe51af29ecabfbc17ff63a91b19d0fa3caa # Parent 959ebe0247b58ce85733acc96027b17ce84ec29c start tn5250 integration diff -r 959ebe0247b5 -r 80dcebe51af2 src/com/five_ten_sg/connectbot/service/TerminalBridge.java --- a/src/com/five_ten_sg/connectbot/service/TerminalBridge.java Wed Jun 11 09:30:50 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/service/TerminalBridge.java Wed Jun 11 09:54:18 2014 -0700 @@ -258,7 +258,7 @@ */ public Charset getCharset() { if (relay != null) return relay.getCharset(); - + return keyListener.getCharset(); } /** @@ -268,7 +268,6 @@ */ public void setCharset(String encoding) { if (relay != null) relay.setCharset(encoding); - keyListener.setCharset(encoding); } diff -r 959ebe0247b5 -r 80dcebe51af2 src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java --- a/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java Wed Jun 11 09:30:50 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java Wed Jun 11 09:54:18 2014 -0700 @@ -902,7 +902,9 @@ this.encoding = encoding; } - + public String getCharset() { + return encoding; + } private void ctrlKeySpecial() { if (selectingForCopy) { diff -r 959ebe0247b5 -r 80dcebe51af2 src/com/five_ten_sg/connectbot/transport/AbsTransport.java --- a/src/com/five_ten_sg/connectbot/transport/AbsTransport.java Wed Jun 11 09:30:50 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/transport/AbsTransport.java Wed Jun 11 09:54:18 2014 -0700 @@ -40,7 +40,7 @@ protected TerminalManager manager; protected TerminalBridge bridge; protected HostBean host; - protected vt320 buffer; + protected vt320 buffer = null; protected String emulation; class vt320Default extends vt320 { @@ -238,7 +238,7 @@ } public vt320 getTransportBuffer() { - buffer = vt320Default(); + if (buffer == null) buffer = new vt320Default(); int scrollback = (host.getWantSession()) ? manager.getScrollback() : 0; buffer.setBufferSize(scrollback); buffer.setDisplay(bridge); diff -r 959ebe0247b5 -r 80dcebe51af2 src/com/five_ten_sg/connectbot/transport/TN5250.java --- a/src/com/five_ten_sg/connectbot/transport/TN5250.java Wed Jun 11 09:30:50 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java Wed Jun 11 09:54:18 2014 -0700 @@ -63,8 +63,39 @@ hostmask = Pattern.compile("^([0-9a-z.-]+)(:(\\d+))?$", Pattern.CASE_INSENSITIVE); } + + class vt320x5250 extends vt320 { + @Override + public void debug(String s) { + Log.d(TAG, s); + } + @Override + public void write(byte[] b) { + } + @Override + public void write(int b) { + } + // bridge.monitor placement of new characters + @Override + public void putChar(int c, int l, char ch, int attributes) { + if (bridge.monitor != null) bridge.monitor.screenChanged(l, c); + super.putChar(c, l, ch, attributes); + } + @Override + public void setCursorPosition(int c, int l) { + if (bridge.monitor != null) bridge.monitor.cursorMove(l, c); + super.setCursorPosition(c, l); + } + }; + + class Terminal5250KeyListener extends TerminalKeyListener { - + public TerminalKeyListener(TerminalManager manager, + TerminalBridge bridge, + vt320 buffer, + String encoding) { + super(manager, bridge, buffer, encoding); + } }; public TN5250() { @@ -219,6 +250,13 @@ @Override + public vt320 getTransportBuffer() { + buffer = new vt320x5250(); + return super(); + } + + + @Override public int getDefaultPort() { return DEFAULT_PORT; } diff -r 959ebe0247b5 -r 80dcebe51af2 src/de/mud/terminal/vt320.java --- a/src/de/mud/terminal/vt320.java Wed Jun 11 09:30:50 2014 -0700 +++ b/src/de/mud/terminal/vt320.java Wed Jun 11 09:54:18 2014 -0700 @@ -39,12 +39,6 @@ */ public abstract class vt320 extends VDUBuffer implements VDUInput { - /** The current version id tag.

- * $Id: vt320.java 507 2005-10-25 10:14:52Z marcus $ - * - */ - public final static String ID = "$Id: vt320.java 507 2005-10-25 10:14:52Z marcus $"; - /** the debug level */ private final static int debug = 0; private StringBuilder debugStr;