From: enikey Date: Fri, 19 Dec 2008 04:37:09 +0000 (+0000) Subject: [Developement] VncCanvas class implements RecordInterface interface. X-Git-Tag: v0.0.90~274 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=418611feeee834673bbf004ad87bfcf09bf75f2b;p=tigervnc.git [Developement] VncCanvas class implements RecordInterface interface. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3410 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- 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); + } }