summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2017-10-13 14:45:44 +0200
committerPierre Ossman <ossman@cendio.se>2017-10-31 15:23:59 +0100
commit3fde04b9e5ecd9cc76c8f2b8630a7123d9054164 (patch)
treebdcdbc5a5d4806f3b6af20bc3a65f7acfdd9e1e2
parentaf9e53608c154ba11722b6eb380d64236ebe17a9 (diff)
downloadnovnc-3fde04b9e5ecd9cc76c8f2b8630a7123d9054164.tar.gz
Remove onFBU* callbacks
They are internal mechanisms that callers should be isolated from.
-rw-r--r--core/rfb.js12
-rw-r--r--docs/API.md22
-rw-r--r--tests/test.rfb.js28
3 files changed, 0 insertions, 62 deletions
diff --git a/core/rfb.js b/core/rfb.js
index f9f1777..f03ae28 100644
--- a/core/rfb.js
+++ b/core/rfb.js
@@ -138,8 +138,6 @@ export default function RFB(defaults) {
'onCredentials': function () { }, // onCredentials(rfb, types): VNC credentials are required
'onClipboard': function () { }, // onClipboard(rfb, text): RFB clipboard contents received
'onBell': function () { }, // onBell(rfb): RFB Bell message received
- 'onFBUReceive': function () { }, // onFBUReceive(rfb, rect): RFB FBU rect received but not yet processed
- 'onFBUComplete': function () { }, // onFBUComplete(rfb): RFB FBU received and processed
'onFBResize': function () { }, // onFBResize(rfb, width, height): frame buffer resized
'onDesktopName': function () { }, // onDesktopName(rfb, name): desktop name received
'onCapabilities': function () { } // onCapabilities(rfb, caps): the supported capabilities has changed
@@ -1397,12 +1395,6 @@ RFB.prototype = {
this._FBU.encoding = parseInt((hdr[8] << 24) + (hdr[9] << 16) +
(hdr[10] << 8) + hdr[11], 10);
- this._onFBUReceive(this,
- {'x': this._FBU.x, 'y': this._FBU.y,
- 'width': this._FBU.width, 'height': this._FBU.height,
- 'encoding': this._FBU.encoding,
- 'encodingName': encodingName(this._FBU.encoding)});
-
if (!this._encHandlers[this._FBU.encoding]) {
this._fail("Unexpected server message",
"Unsupported encoding " +
@@ -1457,8 +1449,6 @@ RFB.prototype = {
this._display.flip();
- this._onFBUComplete(this);
-
return true; // We finished this FBU
},
@@ -1511,8 +1501,6 @@ make_properties(RFB, [
['onCredentials', 'rw', 'func'], // onCredentials(rfb, types): VNC credentials are required
['onClipboard', 'rw', 'func'], // onClipboard(rfb, text): RFB clipboard contents received
['onBell', 'rw', 'func'], // onBell(rfb): RFB Bell message received
- ['onFBUReceive', 'rw', 'func'], // onFBUReceive(rfb, fbu): RFB FBU received but not yet processed
- ['onFBUComplete', 'rw', 'func'], // onFBUComplete(rfb, fbu): RFB FBU received and processed
['onFBResize', 'rw', 'func'], // onFBResize(rfb, width, height): frame buffer resized
['onDesktopName', 'rw', 'func'], // onDesktopName(rfb, name): desktop name received
['onCapabilities', 'rw', 'func'] // onCapabilities(rfb, caps): the supported capabilities has changed
diff --git a/docs/API.md b/docs/API.md
index fa059fd..9a954c3 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -80,8 +80,6 @@ functions.
| onCredentials | (rfb, types) | VNC credentials are required (use sendCredentials)
| onClipboard | (rfb, text) | RFB clipboard contents received
| onBell | (rfb) | RFB Bell message received
-| onFBUReceive | (rfb, fbu) | RFB FBU received but not yet processed (see details below)
-| onFBUComplete | (rfb, fbu) | RFB FBU received and processed (see details below)
| onFBResize | (rfb, width, height) | Frame buffer (remote desktop) size changed
| onDesktopName | (rfb, name) | VNC desktop name recieved
| onCapabilities | (rfb, capabilities) | The supported capabilities has changed
@@ -114,23 +112,3 @@ defined:
| username | User that authenticates
| password | Password for user
| target | String specifying target machine or session
-
-
-__RFB onFBUReceive and on FBUComplete callback details__
-
-The onFBUReceive callback is invoked when a frame buffer update
-message has been received from the server but before the RFB class has
-done any additional handling. The onFBUComplete callback is invoked
-with the same information but after the RFB class has handled the
-message.
-
-The 'fbu' parameter is an object with the following structure:
-
- {
- x: FBU_x_position,
- y: FBU_y_position,
- width: FBU_width,
- height: FBU_height,
- encoding: FBU_encoding_number,
- encodingName: FBU_encoding_string
- }
diff --git a/tests/test.rfb.js b/tests/test.rfb.js
index 7863200..3e590e6 100644
--- a/tests/test.rfb.js
+++ b/tests/test.rfb.js
@@ -1340,32 +1340,6 @@ describe('Remote Frame Buffer Protocol Client', function() {
expect(client._sock._websocket._get_sent_data()).to.have.length(0);
});
- it('should parse out information from a header before any actual data comes in', function () {
- client.set_onFBUReceive(sinon.spy());
- var rect_info = { x: 8, y: 11, width: 27, height: 32, encoding: 0x02, encodingName: 'RRE' };
- send_fbu_msg([rect_info], [[]], client);
-
- var spy = client.get_onFBUReceive();
- expect(spy).to.have.been.calledOnce;
- expect(spy).to.have.been.calledWith(sinon.match.any, rect_info);
- });
-
- it('should fire onFBUComplete when the update is complete', function () {
- client.set_onFBUComplete(sinon.spy());
- var rect_info = { x: 8, y: 11, width: 27, height: 32, encoding: -224, encodingName: 'last_rect' };
- send_fbu_msg([rect_info], [[]], client); // last_rect
-
- var spy = client.get_onFBUComplete();
- expect(spy).to.have.been.calledOnce;
- });
-
- it('should not fire onFBUComplete if we have not finished processing the update', function () {
- client.set_onFBUComplete(sinon.spy());
- var rect_info = { x: 8, y: 11, width: 27, height: 32, encoding: 0x00, encodingName: 'RAW' };
- send_fbu_msg([rect_info], [[]], client);
- expect(client.get_onFBUComplete()).to.not.have.been.called;
- });
-
it('should fail on an unsupported encoding', function () {
sinon.spy(client, "_fail");
var rect_info = { x: 8, y: 11, width: 27, height: 32, encoding: 234 };
@@ -1780,10 +1754,8 @@ describe('Remote Frame Buffer Protocol Client', function() {
});
it('should handle the last_rect pseudo-encoding', function () {
- client.set_onFBUReceive(sinon.spy());
send_fbu_msg([{ x: 0, y: 0, width: 0, height: 0, encoding: -224}], [[]], client, 100);
expect(client._FBU.rects).to.equal(0);
- expect(client.get_onFBUReceive()).to.have.been.calledOnce;
});
});
});