From 418611feeee834673bbf004ad87bfcf09bf75f2b Mon Sep 17 00:00:00 2001 From: enikey Date: Fri, 19 Dec 2008 04:37:09 +0000 Subject: [PATCH] [Developement] VncCanvas class implements RecordInterface interface. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3410 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- .../src/com/tightvnc/vncviewer/VncCanvas.java | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/java/src/com/tightvnc/vncviewer/VncCanvas.java b/java/src/com/tightvnc/vncviewer/VncCanvas.java index d3a40700..ed8d979b 100644 --- a/java/src/com/tightvnc/vncviewer/VncCanvas.java +++ b/java/src/com/tightvnc/vncviewer/VncCanvas.java @@ -36,7 +36,7 @@ import java.util.zip.*; // class VncCanvas extends Canvas - implements KeyListener, MouseListener, MouseMotionListener { + implements KeyListener, MouseListener, MouseMotionListener, RecordInterface { VncViewer viewer; RfbProto rfb; @@ -2137,4 +2137,44 @@ class VncCanvas extends Canvas } } + // + // Override RecordInterface methods + // + + public boolean isRecordFromBeginning() { + return rfb.recordFromBeginning; + } + + public boolean canWrite() { + // We can record if rec is not null + return rfb.rec != null; + } + + public void write(byte b[]) throws IOException { + rfb.rec.write(b); + } + + public void write(byte b[], int off, int len) throws IOException { + rfb.rec.write(b, off, len); + } + + public void writeByte(byte b) throws IOException { + rfb.rec.writeByte(b); + } + + public void writeByte(int i) throws IOException { + rfb.rec.writeByte(i); + } + + public void writeIntBE(int v) throws IOException { + rfb.rec.writeIntBE(v); + } + + public void recordCompactLen(int len) throws IOException { + rfb.recordCompactLen(len); + } + + public void recordCompressedData(byte[] data) throws IOException { + rfb.recordCompressedData(data); + } } -- 2.39.5