this._rfb_tightvnc = false;
this._rfb_xvp_ver = 0;
+ this._capabilities = { power: false };
+
this._encHandlers = {};
this._encStats = {};
'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
- 'onXvpInit': function () { } // onXvpInit(version): XVP extensions active for this connection
+ 'onCapabilities': function () { } // onCapabilities(rfb, caps): the supported capabilities has changed
});
// main setup
return true;
},
- xvpOp: function (ver, op) {
- if (this._rfb_xvp_ver < ver) { return false; }
- Log.Info("Sending XVP operation " + op + " (version " + ver + ")");
- RFB.messages.xvpOp(this._sock, ver, op);
- return true;
- },
-
- xvpShutdown: function () {
- return this.xvpOp(1, 2);
+ machineShutdown: function () {
+ this._xvpOp(1, 2);
},
- xvpReboot: function () {
- return this.xvpOp(1, 3);
+ machineReboot: function () {
+ this._xvpOp(1, 3);
},
- xvpReset: function () {
- return this.xvpOp(1, 4);
+ machineReset: function () {
+ this._xvpOp(1, 4);
},
// Send a key press. If 'down' is not specified then send a down key
case 1: // XVP_INIT
this._rfb_xvp_ver = xvp_ver;
Log.Info("XVP extensions enabled (version " + this._rfb_xvp_ver + ")");
- this._onXvpInit(this._rfb_xvp_ver);
+ this._capabilities.power = true;
+ this._onCapabilities(this, this._capabilities)
break;
default:
this._fail("Unexpected server message",
this._timing.fbu_rt_start = (new Date()).getTime();
this._updateContinuousUpdates();
- }
+ },
+
+ _xvpOp: function (ver, op) {
+ if (this._rfb_xvp_ver < ver) { return; }
+ Log.Info("Sending XVP operation " + op + " (version " + ver + ")");
+ RFB.messages.xvpOp(this._sock, ver, op);
+ },
};
make_properties(RFB, [
['wsProtocols', 'rw', 'arr'], // Protocols to use in the WebSocket connection
['repeaterID', 'rw', 'str'], // [UltraVNC] RepeaterID to connect to
['viewportDrag', 'rw', 'bool'], // Move the viewport on mouse drags
+ ['capabilities', 'ro', 'arr'], // Supported capabilities
// Callback functions
['onUpdateState', 'rw', 'func'], // onUpdateState(rfb, state, oldstate): connection state change
['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
- ['onXvpInit', 'rw', 'func'] // onXvpInit(version): XVP extensions active for this connection
+ ['onCapabilities', 'rw', 'func'] // onCapabilities(rfb, caps): the supported capabilities has changed
]);
RFB.prototype.set_local_cursor = function (cursor) {