- Util.make_properties(RFB, [
- ['target', 'wo', 'dom'], // VNC display rendering Canvas object
- ['focusContainer', 'wo', 'dom'], // DOM element that captures keyboard input
- ['encrypt', 'rw', 'bool'], // Use TLS/SSL/wss encryption
- ['true_color', 'rw', 'bool'], // Request true color pixel data
- ['local_cursor', 'rw', 'bool'], // Request locally rendered cursor
- ['shared', 'rw', 'bool'], // Request shared mode
- ['view_only', 'rw', 'bool'], // Disable client mouse/keyboard
- ['xvp_password_sep', 'rw', 'str'], // Separator for XVP password fields
- ['disconnectTimeout', 'rw', 'int'], // Time (s) to wait for disconnection
- ['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
-
- // Callback functions
- ['onUpdateState', 'rw', 'func'], // onUpdateState(rfb, state, oldstate): connection state change
- ['onNotification', 'rw', 'func'], // onNotification(rfb, msg, level, options): notification for the UI
- ['onDisconnected', 'rw', 'func'], // onDisconnected(rfb, reason): disconnection finished
- ['onPasswordRequired', 'rw', 'func'], // onPasswordRequired(rfb, msg): VNC password is 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
- ['onXvpInit', 'rw', 'func'] // onXvpInit(version): XVP extensions active for this connection
- ]);
-
- RFB.prototype.set_local_cursor = function (cursor) {
- if (!cursor || (cursor in {'0': 1, 'no': 1, 'false': 1})) {
- this._local_cursor = false;
- this._display.disableLocalCursor(); //Only show server-side cursor
- } else {
- if (this._display.get_cursor_uri()) {
- this._local_cursor = true;
- } else {
- Util.Warn("Browser does not support local cursor");
- this._display.disableLocalCursor();
- }
- }