They are internal mechanisms that callers should be isolated from.
'onCredentialsRequired': function () { }, // onCredentialsRequired(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
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 " +
this._display.flip();
- this._onFBUComplete(this);
-
return true; // We finished this FBU
},
['onCredentialsRequired', 'rw', 'func'], // onCredentialsRequired(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
| onCredentialsRequired | (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
| 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
- }
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 };
});
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;
});
});
});