Fixed trailing whitespaces in several files

This commit is contained in:
Oliver Gutierrez 2016-09-27 17:29:40 +02:00 committed by Jeremy White
parent 411cdc5dfd
commit 1f4959e3c2
19 changed files with 71 additions and 72 deletions

4
README
View File

@ -5,7 +5,7 @@ Instructions and status as of August, 2016.
Requirements:
1. Modern Firefox or Chrome (IE will work, but badly)
2. A WebSocket proxy
websockify:
@ -24,7 +24,7 @@ Optional:
With firefox, you can just open file:///your-path-to-spice.html-here
With Chrome, you have to set a secret config flag to do that, or
With Chrome, you have to set a secret config flag to do that, or
serve the files from a web server.

2
TODO
View File

@ -6,7 +6,7 @@ Medium Tasks:
*only* about messages)
. Change the message processing to be able to handle
an array of ArrayBuffers so we don't have to
an array of ArrayBuffers so we don't have to
use the combine function, which is presumed slow.
. Use the 'real' DataView if we have it

View File

@ -118,7 +118,7 @@ SpiceCursorConn.prototype.process_channel_message = function(msg)
SpiceCursorConn.prototype.set_cursor = function(cursor)
{
var pngstr = create_rgba_png(cursor.header.height, cursor.header.width, cursor.data);
var curstr = 'url(data:image/png,' + pngstr + ') ' +
var curstr = 'url(data:image/png,' + pngstr + ') ' +
cursor.header.hot_spot_x + ' ' + cursor.header.hot_spot_y + ", default";
var screen = document.getElementById(this.parent.screen_id);
screen.style.cursor = 'auto';

View File

@ -142,7 +142,7 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
{ base: draw_copy.base,
src_area: draw_copy.data.src_area,
image_data: this.cache[draw_copy.data.src_bitmap.descriptor.id],
tag: "copycache." + draw_copy.data.src_bitmap.descriptor.id,
tag: "copycache." + draw_copy.data.src_bitmap.descriptor.id,
has_alpha: true, /* FIXME - may want this to be false... */
descriptor : draw_copy.data.src_bitmap.descriptor
});
@ -200,7 +200,7 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
tmpstr += qdv[i].toString(16);
}
img.o =
img.o =
{ base: draw_copy.base,
tag: "jpeg." + draw_copy.data.src_bitmap.surface_id,
descriptor : draw_copy.data.src_bitmap.descriptor,
@ -233,7 +233,7 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
tmpstr += qdv[i].toString(16);
}
img.o =
img.o =
{ base: draw_copy.base,
tag: "jpeg." + draw_copy.data.src_bitmap.surface_id,
descriptor : draw_copy.data.src_bitmap.descriptor,
@ -265,7 +265,7 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
draw_copy.data.src_bitmap.bitmap);
if (! source_img)
{
this.log_warn("FIXME: Unable to interpret bitmap of format: " +
this.log_warn("FIXME: Unable to interpret bitmap of format: " +
draw_copy.data.src_bitmap.bitmap.format);
return false;
}
@ -295,7 +295,7 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
draw_copy.data.src_bitmap.lz_rgb);
if (! source_img)
{
this.log_warn("FIXME: Unable to interpret bitmap of type: " +
this.log_warn("FIXME: Unable to interpret bitmap of type: " +
draw_copy.data.src_bitmap.lz_rgb.type);
return false;
}
@ -359,7 +359,7 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
draw_fill.base.box.bottom - draw_fill.base.box.top);
document.getElementById(this.parent.dump_id).appendChild(debug_canvas);
}
this.surfaces[draw_fill.base.surface_id].draw_count++;
}
@ -484,9 +484,9 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
this.surfaces = [];
var m = new SpiceMsgSurfaceCreate(msg.data);
DEBUG > 1 && console.log(this.type + ": MsgSurfaceCreate id " + m.surface.surface_id
DEBUG > 1 && console.log(this.type + ": MsgSurfaceCreate id " + m.surface.surface_id
+ "; " + m.surface.width + "x" + m.surface.height
+ "; format " + m.surface.format
+ "; format " + m.surface.format
+ "; flags " + m.surface.flags);
if (m.surface.format != SPICE_SURFACE_FMT_32_xRGB &&
m.surface.format != SPICE_SURFACE_FMT_32_ARGB)
@ -745,7 +745,7 @@ SpiceDisplayConn.prototype.draw_copy_helper = function(o)
SpiceDisplayConn.prototype.log_draw = function(prefix, draw)
{
var str = prefix + "." + draw.base.surface_id + "." + this.surfaces[draw.base.surface_id].draw_count + ": ";
str += "base.box " + draw.base.box.left + ", " + draw.base.box.top + " to " +
str += "base.box " + draw.base.box.left + ", " + draw.base.box.top + " to " +
draw.base.box.right + ", " + draw.base.box.bottom;
str += "; clip.type " + draw.base.clip.type;
@ -763,12 +763,12 @@ SpiceDisplayConn.prototype.log_draw = function(prefix, draw)
if (draw.data.src_bitmap.surface_id !== undefined)
str += "; src_bitmap surface_id " + draw.data.src_bitmap.surface_id;
if (draw.data.src_bitmap.quic)
str += "; QUIC type " + draw.data.src_bitmap.quic.type +
"; width " + draw.data.src_bitmap.quic.width +
str += "; QUIC type " + draw.data.src_bitmap.quic.type +
"; width " + draw.data.src_bitmap.quic.width +
"; height " + draw.data.src_bitmap.quic.height ;
if (draw.data.src_bitmap.lz_rgb)
str += "; LZ_RGB length " + draw.data.src_bitmap.lz_rgb.length +
"; magic " + draw.data.src_bitmap.lz_rgb.magic +
"; magic " + draw.data.src_bitmap.lz_rgb.magic +
"; version 0x" + draw.data.src_bitmap.lz_rgb.version.toString(16) +
"; type " + draw.data.src_bitmap.lz_rgb.type +
"; width " + draw.data.src_bitmap.lz_rgb.width +
@ -885,7 +885,7 @@ function handle_draw_jpeg_onload()
{
// This can happen; if the jpeg image loads after our surface
// has been destroyed (e.g. open a menu, close it quickly),
// we'll find we have no surface.
// we'll find we have no surface.
DEBUG > 2 && this.o.sc.log_info("Discarding jpeg; presumed lost surface " + this.o.base.surface_id);
temp_canvas = document.createElement("canvas");
temp_canvas.setAttribute('width', this.o.base.box.right);
@ -904,16 +904,16 @@ function handle_draw_jpeg_onload()
t.putImageData(this.alpha_img, 0, 0);
t.globalCompositeOperation = 'source-in';
t.drawImage(this, 0, 0);
context.drawImage(c, this.o.base.box.left, this.o.base.box.top);
if (this.o.descriptor &&
if (this.o.descriptor &&
(this.o.descriptor.flags & SPICE_IMAGE_FLAGS_CACHE_ME))
{
if (! ("cache" in this.o.sc))
this.o.sc.cache = {};
this.o.sc.cache[this.o.descriptor.id] =
this.o.sc.cache[this.o.descriptor.id] =
t.getImageData(0, 0,
this.alpha_img.width,
this.alpha_img.height);
@ -927,13 +927,13 @@ function handle_draw_jpeg_onload()
// fairly massive memory leaks during video playback
this.src = null;
if (this.o.descriptor &&
if (this.o.descriptor &&
(this.o.descriptor.flags & SPICE_IMAGE_FLAGS_CACHE_ME))
{
if (! ("cache" in this.o.sc))
this.o.sc.cache = {};
this.o.sc.cache[this.o.descriptor.id] =
this.o.sc.cache[this.o.descriptor.id] =
context.getImageData(this.o.base.box.left, this.o.base.box.top,
this.o.base.box.right - this.o.base.box.left,
this.o.base.box.bottom - this.o.base.box.top);

View File

@ -264,7 +264,7 @@ var SPICE_MOUSE_BUTTON_MASK_LEFT = (1 << 0),
SPICE_MOUSE_BUTTON_MASK_MIDDLE = (1 << 1),
SPICE_MOUSE_BUTTON_MASK_RIGHT = (1 << 2),
SPICE_MOUSE_BUTTON_MASK_MASK = 0x7;
var SPICE_MOUSE_BUTTON_INVALID = 0;
var SPICE_MOUSE_BUTTON_LEFT = 1;
var SPICE_MOUSE_BUTTON_MIDDLE = 2;

View File

@ -22,7 +22,7 @@
** SpiceMainConn
** This is the master Javascript class for establishing and
** managing a connection to a Spice Server.
**
**
** Invocation: You must pass an object with properties as follows:
** uri (required) Uri of a WebSocket listener that is
** connected to a spice server.

View File

@ -114,7 +114,7 @@ SpicePlaybackConn.prototype.process_channel_message = function(msg)
if (this.last_data_time && data.time >= (this.last_data_time + GAP_DETECTION_THRESHOLD))
{
this.skip_until = data.time;
this.gap_time = (data.time - this.start_time) -
this.gap_time = (data.time - this.start_time) -
(this.source_buffer.buffered.end(this.source_buffer.buffered.end.length - 1) * 1000.0).toFixed(0);
}

View File

@ -71,7 +71,7 @@ simulate_cursor: function (spicecursor, cursor, screen, pngstr)
if (window.getComputedStyle(screen, null).cursor == 'auto')
{
SpiceSimulateCursor.unknown_cursor(cursor_sha,
SpiceSimulateCursor.unknown_cursor(cursor_sha,
SpiceSimulateCursor.create_icondir(cursor.header.width, cursor.header.height,
cursor.data.byteLength, cursor.header.hot_spot_x, cursor.header.hot_spot_y) + pngstr);
@ -99,7 +99,7 @@ simulate_cursor: function (spicecursor, cursor, screen, pngstr)
spicecursor.spice_simulated_cursor.style.pointerEvents = "none";
}
else
{
{
if (spicecursor.spice_simulated_cursor)
{
spicecursor.spice_simulated_cursor.spice_screen.removeChild(spicecursor.spice_simulated_cursor);
@ -162,7 +162,7 @@ create_icondir: function (width, height, bytes, hot_x, hot_y)
};
SpiceSimulateCursor.ICONDIR.prototype =
SpiceSimulateCursor.ICONDIR.prototype =
{
to_buffer: function(a, at)
{

View File

@ -115,4 +115,3 @@ body
.spice-message-error {
color: red;
}

View File

@ -28,26 +28,26 @@
<head>
<title>Spice Javascript client</title>
<script src="spicearraybuffer.js"></script>
<script src="enums.js"></script>
<script src="atKeynames.js"></script>
<script src="utils.js"></script>
<script src="png.js"></script>
<script src="lz.js"></script>
<script src="quic.js"></script>
<script src="bitmap.js"></script>
<script src="spicedataview.js"></script>
<script src="spicetype.js"></script>
<script src="spicemsg.js"></script>
<script src="wire.js"></script>
<script src="spiceconn.js"></script>
<script src="display.js"></script>
<script src="main.js"></script>
<script src="inputs.js"></script>
<script src="spicearraybuffer.js"></script>
<script src="enums.js"></script>
<script src="atKeynames.js"></script>
<script src="utils.js"></script>
<script src="png.js"></script>
<script src="lz.js"></script>
<script src="quic.js"></script>
<script src="bitmap.js"></script>
<script src="spicedataview.js"></script>
<script src="spicetype.js"></script>
<script src="spicemsg.js"></script>
<script src="wire.js"></script>
<script src="spiceconn.js"></script>
<script src="display.js"></script>
<script src="main.js"></script>
<script src="inputs.js"></script>
<script src="webm.js"></script>
<script src="playback.js"></script>
<script src="simulatecursor.js"></script>
<script src="cursor.js"></script>
<script src="cursor.js"></script>
<script src="thirdparty/jsbn.js"></script>
<script src="thirdparty/rsa.js"></script>
<script src="thirdparty/prng4.js"></script>
@ -71,8 +71,8 @@
{
var host, port, password, scheme = "ws://", uri;
host = document.getElementById("host").value;
port = document.getElementById("port").value;
host = document.getElementById("host").value;
port = document.getElementById("port").value;
password = document.getElementById("password").value;
@ -92,7 +92,7 @@
try
{
sc = new SpiceMainConn({uri: uri, screen_id: "spice-screen", dump_id: "debug-div",
sc = new SpiceMainConn({uri: uri, screen_id: "spice-screen", dump_id: "debug-div",
message_id: "message-div", password: password, onerror: spice_error, onagent: agent_connected });
}
catch (e)

View File

@ -28,7 +28,7 @@
<head>
<title>Spice Javascript client</title>
<script src="spicearraybuffer.js"></script>
<script src="spicearraybuffer.js"></script>
<script src="enums.js"></script>
<script src="atKeynames.js"></script>
<script src="utils.js"></script>

View File

@ -20,10 +20,10 @@
/*----------------------------------------------------------------------------
** SpiceDataView
** FIXME FIXME
** FIXME FIXME
** This is used because Firefox does not have DataView yet.
** We should use DataView if we have it, because it *has* to
** be faster than this code
** We should use DataView if we have it, because it *has* to
** be faster than this code
**--------------------------------------------------------------------------*/
function SpiceDataView(buffer, byteOffset, byteLength)
{
@ -63,7 +63,7 @@ SpiceDataView.prototype = {
high = 2;
}
return (this.getUint16(byteOffset + high, littleEndian) << 16) |
return (this.getUint16(byteOffset + high, littleEndian) << 16) |
this.getUint16(byteOffset + low, littleEndian);
},
getUint64: function (byteOffset, littleEndian)

View File

@ -21,7 +21,7 @@
/*----------------------------------------------------------------------------
** Spice messages
** This file contains classes for passing messages to and from
** a spice server. This file should arguably be generated from
** a spice server. This file should arguably be generated from
** spice.proto, but it was instead put together by hand.
**--------------------------------------------------------------------------*/
function SpiceLinkHeader(a, at)
@ -63,7 +63,7 @@ SpiceLinkHeader.prototype =
dv.setUint32(at, this.size, true); at += 4;
},
buffer_size: function()
{
{
return 16;
},
}
@ -938,7 +938,7 @@ function SpiceMsgcMousePosition(sc, e)
this.x = e.clientX - sc.display.surfaces[sc.display.primary_surface].canvas.offsetLeft + scrollLeft;
this.y = e.clientY - sc.display.surfaces[sc.display.primary_surface].canvas.offsetTop + scrollTop;
sc.mousex = this.x;
sc.mousey = this.y;
sc.mousey = this.y;
}
else
{

View File

@ -469,5 +469,5 @@ SpiceSurface.prototype =
},
}
/* FIXME - SpiceImage types lz_plt, jpeg, zlib_glz, and jpeg_alpha are
/* FIXME - SpiceImage types lz_plt, jpeg, zlib_glz, and jpeg_alpha are
completely unimplemented */

6
thirdparty/jsbn.js vendored
View File

@ -15,9 +15,9 @@
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER

6
thirdparty/prng4.js vendored
View File

@ -15,9 +15,9 @@
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER

8
thirdparty/rng.js vendored
View File

@ -15,9 +15,9 @@
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
@ -66,7 +66,7 @@ if(rng_pool == null) {
var z = window.crypto.random(32);
for(t = 0; t < z.length; ++t)
rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
}
}
while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
t = Math.floor(65536 * Math.random());
rng_pool[rng_pptr++] = t >>> 8;

6
thirdparty/rsa.js vendored
View File

@ -15,9 +15,9 @@
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER

View File

@ -96,7 +96,7 @@ SpiceWireReader.prototype =
this.callback.call(this.sc, mb,
this.saved_msg_header || undefined);
}
},
request: function(n)