]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Remove onFBU* callbacks
authorPierre Ossman <ossman@cendio.se>
Fri, 13 Oct 2017 12:45:44 +0000 (14:45 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 9 Nov 2017 11:52:03 +0000 (12:52 +0100)
They are internal mechanisms that callers should be isolated from.

core/rfb.js
docs/API.md
tests/test.rfb.js

index fb2f4302d4c438e65875ce5697a2598034ff920b..7eb1c417aac3e24057141d41a1bb0c6fa1cbcc03 100644 (file)
@@ -138,8 +138,6 @@ export default function RFB(defaults) {
         '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
@@ -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, [
     ['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
index 18d92397d955ed261345ca8e87a43d0ae76fb767..bec9b173d6ff94c120154d3c73dac983fa4bc681 100644 (file)
@@ -80,8 +80,6 @@ functions.
 | 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
@@ -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
-    }
index 4c4b12f6afdb4c7f7a07c1cfeb0be8ac7a614d16..dae9e720b65cf6a190c91bc1e95616934cf0f2a9 100644 (file)
@@ -1343,32 +1343,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 };
@@ -1783,10 +1757,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;
                 });
             });
         });