spice-html5-rails 0.0.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6961686e30da1a855c67fe8b897e7251f81eaec7
4
+ data.tar.gz: 0ad1b8313ec98c90f5d05f6bdbf8e3fab1586d59
5
+ SHA512:
6
+ metadata.gz: b87855bbfe4896e778f4ef5305d9fbb179059a7f09626df9c7c2ec448e09367bc36f0e8cb4a77e2ec4e0b24c4fc0e4b146ad8b75b354ca3716629edb85959438
7
+ data.tar.gz: 25b5e538f5941e1b5ab5c1b9a34f8cf43ae1e0ed0f9e2c1289202095321fb6c2267caa798e353e2ea6ea6a78de290b031a9039d2241432beb17ab8eb0dca36cd
data/README.md CHANGED
@@ -19,11 +19,13 @@ Or install it yourself as:
19
19
  ## Usage
20
20
 
21
21
  Add in application.js or some per-controller .js.
22
+
22
23
  //= require spice-html5
23
24
 
24
25
  ## Source
25
26
 
26
27
  Spice home page: [http://www.spice-space.org](http://www.spice-space.org)
28
+
27
29
  Spice-html5 code is available here: git://anongit.freedesktop.org/spice/spice-html5
28
30
 
29
31
  ## Contributing
@@ -1,7 +1,7 @@
1
1
  module Spice
2
2
  module Html5
3
3
  module Rails
4
- VERSION = "0.0.1"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
@@ -88,5 +88,9 @@ SpiceCursorConn.prototype.set_cursor = function(cursor)
88
88
  var pngstr = create_rgba_png(cursor.header.height, cursor.header.width, cursor.data);
89
89
  var curstr = 'url(data:image/png,' + pngstr + ') ' +
90
90
  cursor.header.hot_spot_x + ' ' + cursor.header.hot_spot_y + ", default";
91
- document.getElementById(this.parent.screen_id).style.cursor = curstr;
91
+ var screen = document.getElementById(this.parent.screen_id);
92
+ screen.style.cursor = 'auto';
93
+ screen.style.cursor = curstr;
94
+ if (window.getComputedStyle(screen, null).cursor == 'auto')
95
+ SpiceSimulateCursor.simulate_cursor(this, cursor, screen, pngstr);
92
96
  }
@@ -527,6 +527,16 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
527
527
  this.streams[m.id] = undefined;
528
528
  return true;
529
529
  }
530
+ if (msg.type == SPICE_MSG_DISPLAY_INVAL_LIST)
531
+ {
532
+ var m = new SpiceMsgDisplayInvalList(msg.data);
533
+ var i;
534
+ DEBUG > 1 && console.log(this.type + ": MsgInvalList " + m.count + " items");
535
+ for (i = 0; i < m.count; i++)
536
+ if (this.cache[m.resources[i].id] != undefined)
537
+ delete this.cache[m.resources[i].id];
538
+ return true;
539
+ }
530
540
 
531
541
  return false;
532
542
  }
@@ -575,7 +585,7 @@ SpiceDisplayConn.prototype.draw_copy_helper = function(o)
575
585
  if (o.descriptor && (o.descriptor.flags & SPICE_IMAGE_FLAGS_CACHE_ME))
576
586
  {
577
587
  if (! ("cache" in this))
578
- this.cache = [];
588
+ this.cache = {};
579
589
  this.cache[o.descriptor.id] = o.image_data;
580
590
  }
581
591
 
@@ -721,6 +731,8 @@ function handle_mouseover(e)
721
731
 
722
732
  function handle_mouseout(e)
723
733
  {
734
+ if (this.sc && this.sc.cursor && this.sc.cursor.spice_simulated_cursor)
735
+ this.sc.cursor.spice_simulated_cursor.style.display = 'none';
724
736
  this.blur();
725
737
  }
726
738
 
@@ -764,7 +776,7 @@ function handle_draw_jpeg_onload()
764
776
  (this.o.descriptor.flags & SPICE_IMAGE_FLAGS_CACHE_ME))
765
777
  {
766
778
  if (! ("cache" in this.o.sc))
767
- this.o.sc.cache = [];
779
+ this.o.sc.cache = {};
768
780
 
769
781
  this.o.sc.cache[this.o.descriptor.id] =
770
782
  t.getImageData(0, 0,
@@ -776,11 +788,15 @@ function handle_draw_jpeg_onload()
776
788
  {
777
789
  context.drawImage(this, this.o.base.box.left, this.o.base.box.top);
778
790
 
791
+ // Give the Garbage collector a clue to recycle this; avoids
792
+ // fairly massive memory leaks during video playback
793
+ this.src = null;
794
+
779
795
  if (this.o.descriptor &&
780
796
  (this.o.descriptor.flags & SPICE_IMAGE_FLAGS_CACHE_ME))
781
797
  {
782
798
  if (! ("cache" in this.o.sc))
783
- this.o.sc.cache = [];
799
+ this.o.sc.cache = {};
784
800
 
785
801
  this.o.sc.cache[this.o.descriptor.id] =
786
802
  context.getImageData(this.o.base.box.left, this.o.base.box.top,
@@ -98,6 +98,15 @@ function handle_mousemove(e)
98
98
  DEBUG > 0 && this.sc.log_info("Discarding mouse motion");
99
99
  }
100
100
  }
101
+
102
+ if (this.sc && this.sc.cursor && this.sc.cursor.spice_simulated_cursor)
103
+ {
104
+ this.sc.cursor.spice_simulated_cursor.style.display = 'block';
105
+ this.sc.cursor.spice_simulated_cursor.style.left = e.pageX - this.sc.cursor.spice_simulated_cursor.spice_hot_x + 'px';
106
+ this.sc.cursor.spice_simulated_cursor.style.top = e.pageY - this.sc.cursor.spice_simulated_cursor.spice_hot_y + 'px';
107
+ e.preventDefault();
108
+ }
109
+
101
110
  }
102
111
 
103
112
  function handle_mousedown(e)
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (C) 2013 by Jeremy P. White <jwhite@codeweavers.com>
4
+
5
+ This file is part of spice-html5.
6
+
7
+ spice-html5 is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU Lesser General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ spice-html5 is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU Lesser General Public License for more details.
16
+
17
+ You should have received a copy of the GNU Lesser General Public License
18
+ along with spice-html5. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+
21
+ /*----------------------------------------------------------------------------
22
+ ** SpiceSimulateCursor
23
+ ** Internet Explorer 10 does not support data uri's in cursor assignment.
24
+ ** This file provides a number of gimmicks to compensate. First, if there
25
+ ** is a preloaded cursor available, we will use that. Failing that, we will
26
+ ** simulate a cursor using an image that is moved around the screen.
27
+ **--------------------------------------------------------------------------*/
28
+ var SpiceSimulateCursor = {
29
+
30
+ cursors : new Array(),
31
+ unknown_cursors : new Array(),
32
+ warned: false,
33
+
34
+ add_cursor: function(sha1, value)
35
+ {
36
+ SpiceSimulateCursor.cursors[sha1] = value;
37
+ },
38
+
39
+ unknown_cursor: function(sha1, curdata)
40
+ {
41
+ if (! SpiceSimulateCursor.warned)
42
+ {
43
+ SpiceSimulateCursor.warned = true;
44
+ alert("Internet Explorer does not support dynamic cursors. " +
45
+ "This page will now simulate cursors with images, " +
46
+ "which will be imperfect. We recommend using Chrome or Firefox instead. " +
47
+ "\n\nIf you need to use Internet Explorer, you can create a static cursor " +
48
+ "file for each cursor your application uses. " +
49
+ "View the console log for more information on creating static cursors for your environment.");
50
+ }
51
+
52
+ if (! SpiceSimulateCursor.unknown_cursors[sha1])
53
+ {
54
+ SpiceSimulateCursor.unknown_cursors[sha1] = curdata;
55
+ console.log('Unknown cursor. Simulation required. To avoid simulation for this cursor, create and include a custom javascript file, and add the following line:');
56
+ console.log('SpiceCursorSimulator.add_cursor("' + sha1 + '"), "<your filename here>.cur");');
57
+ console.log('And then run following command, redirecting output into <your filename here>.cur:');
58
+ console.log('php -r "echo urldecode(\'' + curdata + '\');"');
59
+ }
60
+ },
61
+
62
+ simulate_cursor: function (spicecursor, cursor, screen, pngstr)
63
+ {
64
+ var cursor_sha = hex_sha1(pngstr + ' ' + cursor.header.hot_spot_x + ' ' + cursor.header.hot_spot_y);
65
+ if (typeof SpiceSimulateCursor.cursors != 'undefined')
66
+ if (typeof SpiceSimulateCursor.cursors[cursor_sha] != 'undefined')
67
+ {
68
+ var curstr = 'url(' + SpiceSimulateCursor.cursors[cursor_sha] + '), default';
69
+ screen.style.cursor = curstr;
70
+ }
71
+
72
+ if (window.getComputedStyle(screen, null).cursor == 'auto')
73
+ {
74
+ SpiceSimulateCursor.unknown_cursor(cursor_sha,
75
+ SpiceSimulateCursor.create_icondir(cursor.header.width, cursor.header.height,
76
+ cursor.data.byteLength, cursor.header.hot_spot_x, cursor.header.hot_spot_y) + pngstr);
77
+
78
+ document.getElementById(spicecursor.parent.screen_id).style.cursor = 'none';
79
+ if (! spicecursor.spice_simulated_cursor)
80
+ {
81
+ spicecursor.spice_simulated_cursor = document.createElement('img');
82
+
83
+ spicecursor.spice_simulated_cursor.style.position = 'absolute';
84
+ spicecursor.spice_simulated_cursor.style.display = 'none';
85
+ spicecursor.spice_simulated_cursor.style.overflow = 'hidden';
86
+
87
+ spicecursor.spice_simulated_cursor.spice_screen = document.getElementById(spicecursor.parent.screen_id);
88
+
89
+ spicecursor.spice_simulated_cursor.addEventListener('mousemove', SpiceSimulateCursor.handle_sim_mousemove);
90
+
91
+ spicecursor.spice_simulated_cursor.spice_screen.appendChild(spicecursor.spice_simulated_cursor);
92
+ }
93
+
94
+ spicecursor.spice_simulated_cursor.src = 'data:image/png,' + pngstr;
95
+
96
+ spicecursor.spice_simulated_cursor.spice_hot_x = cursor.header.hot_spot_x;
97
+ spicecursor.spice_simulated_cursor.spice_hot_y = cursor.header.hot_spot_y;
98
+
99
+ spicecursor.spice_simulated_cursor.style.pointerEvents = "none";
100
+ }
101
+ else
102
+ {
103
+ if (spicecursor.spice_simulated_cursor)
104
+ {
105
+ spicecursor.spice_simulated_cursor.spice_screen.removeChild(spicecursor.spice_simulated_cursor);
106
+ delete spicecursor.spice_simulated_cursor;
107
+ }
108
+ }
109
+ },
110
+
111
+ handle_sim_mousemove: function(e)
112
+ {
113
+ var retval;
114
+ var f = SpiceSimulateCursor.duplicate_mouse_event(e, this.spice_screen);
115
+ return this.spice_screen.dispatchEvent(f);
116
+ },
117
+
118
+ duplicate_mouse_event: function(e, target)
119
+ {
120
+ var evt = document.createEvent("mouseevent");
121
+ evt.initMouseEvent(e.type, true, true, e.view, e.detail,
122
+ e.screenX, e.screenY, e.clientX, e.clientY,
123
+ e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);
124
+ return evt;
125
+ },
126
+
127
+ ICONDIR: function ()
128
+ {
129
+ },
130
+
131
+ ICONDIRENTRY: function(width, height, bytes, hot_x, hot_y)
132
+ {
133
+ this.width = width;
134
+ this.height = height;
135
+ this.bytes = bytes;
136
+ this.hot_x = hot_x;
137
+ this.hot_y = hot_y;
138
+ },
139
+
140
+
141
+ create_icondir: function (width, height, bytes, hot_x, hot_y)
142
+ {
143
+ var i;
144
+ var header = new SpiceSimulateCursor.ICONDIR();
145
+ var entry = new SpiceSimulateCursor.ICONDIRENTRY(width, height, bytes, hot_x, hot_y);
146
+
147
+ var mb = new ArrayBuffer(header.buffer_size() + entry.buffer_size());
148
+ var at = header.to_buffer(mb);
149
+ at = entry.to_buffer(mb, at);
150
+
151
+ var u8 = new Uint8Array(mb);
152
+ var str = "";
153
+ for (i = 0; i < at; i++)
154
+ {
155
+ str += "%";
156
+ if (u8[i] < 16)
157
+ str += "0";
158
+ str += u8[i].toString(16);
159
+ }
160
+ return str;
161
+ },
162
+
163
+ };
164
+
165
+ SpiceSimulateCursor.ICONDIR.prototype =
166
+ {
167
+ to_buffer: function(a, at)
168
+ {
169
+ at = at || 0;
170
+ var dv = new SpiceDataView(a);
171
+ dv.setUint16(at, 0, true); at += 2;
172
+ dv.setUint16(at, 2, true); at += 2;
173
+ dv.setUint16(at, 1, true); at += 2;
174
+ return at;
175
+ },
176
+ buffer_size: function()
177
+ {
178
+ return 6;
179
+ }
180
+ };
181
+
182
+ SpiceSimulateCursor.ICONDIRENTRY.prototype =
183
+ {
184
+ to_buffer: function(a, at)
185
+ {
186
+ at = at || 0;
187
+ var dv = new SpiceDataView(a);
188
+ dv.setUint8(at, this.width); at++;
189
+ dv.setUint8(at, this.height); at++;
190
+ dv.setUint8(at, 0); at++; /* color palette count, unused */
191
+ dv.setUint8(at, 0); at++; /* reserved */
192
+ dv.setUint16(at, this.hot_x, true); at += 2;
193
+ dv.setUint16(at, this.hot_y, true); at += 2;
194
+ dv.setUint32(at, this.bytes, true); at += 4;
195
+ dv.setUint32(at, at + 4, true); at += 4; /* Offset to bytes */
196
+ return at;
197
+ },
198
+ buffer_size: function()
199
+ {
200
+ return 16;
201
+ }
202
+ };
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (C) 2012 by Jeremy P. White <jwhite@codeweavers.com>
4
+
5
+ This file is part of spice-html5.
6
+
7
+ spice-html5 is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU Lesser General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ spice-html5 is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU Lesser General Public License for more details.
16
+
17
+ You should have received a copy of the GNU Lesser General Public License
18
+ along with spice-html5. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+
21
+ /*----------------------------------------------------------------------------
22
+ ** SpiceArrayBufferSlice
23
+ ** This function is a work around for IE 10, which has no slice()
24
+ ** method in it's subclass.
25
+ **--------------------------------------------------------------------------*/
26
+ function SpiceArrayBufferSlice(start, end)
27
+ {
28
+ start = start || 0;
29
+ end = end || this.byteLength;
30
+ if (end < 0)
31
+ end = this.byteLength + end;
32
+ if (start < 0)
33
+ start = this.byteLength + start;
34
+ if (start < 0)
35
+ start = 0;
36
+ if (end < 0)
37
+ end = 0;
38
+ if (end > this.byteLength)
39
+ end = this.byteLength;
40
+ if (start > end)
41
+ start = end;
42
+
43
+ var ret = new ArrayBuffer(end - start);
44
+ var in1 = new Uint8Array(this, start, end - start);
45
+ var out = new Uint8Array(ret);
46
+ var i;
47
+
48
+ for (i = 0; i < end - start; i++)
49
+ out[i] = in1[i];
50
+
51
+ return ret;
52
+ }
53
+
54
+ if (! ArrayBuffer.prototype.slice)
55
+ {
56
+ ArrayBuffer.prototype.slice = SpiceArrayBufferSlice;
57
+ console.log("WARNING: ArrayBuffer.slice() is missing; we are extending ArrayBuffer to compensate");
58
+ }
@@ -318,20 +318,18 @@ SpiceConn.prototype =
318
318
  var rc;
319
319
  DEBUG > 0 && console.log("<< hdr " + this.channel_type() + " type " + msg.type + " size " + (msg.data && msg.data.byteLength));
320
320
  rc = this.process_common_messages(msg);
321
- if (rc)
322
- return rc;
323
-
324
- if (this.process_channel_message)
325
- rc = this.process_channel_message(msg);
326
- else
321
+ if (! rc)
327
322
  {
328
- this.log_err(this.type + ": No message handlers for this channel; message " + msg.type);
329
- return false;
323
+ if (this.process_channel_message)
324
+ {
325
+ rc = this.process_channel_message(msg);
326
+ if (! rc)
327
+ this.log_warn(this.type + ": Unknown message type " + msg.type + "!");
328
+ }
329
+ else
330
+ this.log_err(this.type + ": No message handlers for this channel; message " + msg.type);
330
331
  }
331
332
 
332
- if (! rc)
333
- this.log_warn(this.type + ": Unknown message type " + msg.type + "!");
334
-
335
333
  if (this.msgs_until_ack !== undefined && this.ack_window)
336
334
  {
337
335
  this.msgs_until_ack--;
@@ -66,6 +66,18 @@ SpiceDataView.prototype = {
66
66
  return (this.getUint16(byteOffset + high, littleEndian) << 16) |
67
67
  this.getUint16(byteOffset + low, littleEndian);
68
68
  },
69
+ getUint64: function (byteOffset, littleEndian)
70
+ {
71
+ var low = 4, high = 0;
72
+ if (littleEndian)
73
+ {
74
+ low = 0;
75
+ high = 4;
76
+ }
77
+
78
+ return (this.getUint32(byteOffset + high, littleEndian) << 32) |
79
+ this.getUint32(byteOffset + low, littleEndian);
80
+ },
69
81
  setUint8: function(byteOffset, b)
70
82
  {
71
83
  this.u8[byteOffset] = (b & 0xff);
@@ -93,4 +105,16 @@ SpiceDataView.prototype = {
93
105
  this.setUint16(byteOffset + high, (w & 0xffffffff) >> 16, littleEndian);
94
106
  this.setUint16(byteOffset + low, (w & 0x0000ffff), littleEndian);
95
107
  },
108
+ setUint64: function(byteOffset, w, littleEndian)
109
+ {
110
+ var low = 4, high = 0;
111
+ if (littleEndian)
112
+ {
113
+ low = 0;
114
+ high = 4;
115
+ }
116
+
117
+ this.setUint32(byteOffset + high, (w & 0xffffffffffffffff) >> 32, littleEndian);
118
+ this.setUint32(byteOffset + low, (w & 0x00000000ffffffff), littleEndian);
119
+ },
96
120
  }
@@ -414,9 +414,7 @@ SpiceMsgNotify.prototype =
414
414
  at = at || 0;
415
415
  var i;
416
416
  var dv = new SpiceDataView(a);
417
- this.time_stamp = [];
418
- this.time_stamp[0] = dv.getUint32(at, true); at += 4;
419
- this.time_stamp[1] = dv.getUint32(at, true); at += 4;
417
+ this.time_stamp = dv.getUint64(at, true); at += 8;
420
418
  this.severity = dv.getUint32(at, true); at += 4;
421
419
  this.visibility = dv.getUint32(at, true); at += 4;
422
420
  this.what = dv.getUint32(at, true); at += 4;
@@ -445,8 +443,7 @@ SpiceMsgcDisplayInit.prototype =
445
443
  at = at || 0;
446
444
  var dv = new SpiceDataView(a);
447
445
  dv.setUint8(at, this.pixmap_cache_id, true); at++;
448
- dv.setUint32(at, 0, true); at += 4;
449
- dv.setUint32(at, this.pixmap_cache_size, true); at += 4;
446
+ dv.setUint64(at, this.pixmap_cache_size, true); at += 8;
450
447
  dv.setUint8(at, this.glz_dictionary_id, true); at++;
451
448
  dv.setUint32(at, this.glz_dictionary_window_size, true); at += 4;
452
449
  },
@@ -639,8 +636,11 @@ function SpiceMsgcMousePosition(sc, e)
639
636
  this.buttons_state = sc.buttons_state;
640
637
  if (e)
641
638
  {
642
- this.x = e.clientX - sc.display.surfaces[sc.display.primary_surface].canvas.offsetLeft + document.body.scrollLeft;
643
- this.y = e.clientY - sc.display.surfaces[sc.display.primary_surface].canvas.offsetTop + document.body.scrollTop;
639
+ var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
640
+ var scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
641
+
642
+ this.x = e.clientX - sc.display.surfaces[sc.display.primary_surface].canvas.offsetLeft + scrollLeft;
643
+ this.y = e.clientY - sc.display.surfaces[sc.display.primary_surface].canvas.offsetTop + scrollTop;
644
644
  sc.mousex = this.x;
645
645
  sc.mousey = this.y;
646
646
  }
@@ -805,7 +805,7 @@ SpiceMsgDisplayStreamCreate.prototype =
805
805
  this.id = dv.getUint32(at, true); at += 4;
806
806
  this.flags = dv.getUint8(at, true); at += 1;
807
807
  this.codec_type = dv.getUint8(at, true); at += 1;
808
- /*stamp */ at += 8;
808
+ this.stamp = dv.getUint64(at, true); at += 8;
809
809
  this.stream_width = dv.getUint32(at, true); at += 4;
810
810
  this.stream_height = dv.getUint32(at, true); at += 4;
811
811
  this.src_width = dv.getUint32(at, true); at += 4;
@@ -881,3 +881,27 @@ SpiceMsgDisplayStreamDestroy.prototype =
881
881
  this.id = dv.getUint32(at, true); at += 4;
882
882
  },
883
883
  }
884
+
885
+ function SpiceMsgDisplayInvalList(a, at)
886
+ {
887
+ this.count = 0;
888
+ this.resources = [];
889
+ this.from_buffer(a,at);
890
+ }
891
+
892
+ SpiceMsgDisplayInvalList.prototype =
893
+ {
894
+ from_buffer: function (a, at)
895
+ {
896
+ var i;
897
+ at = at || 0;
898
+ var dv = new SpiceDataView(a);
899
+ this.count = dv.getUint16(at, true); at += 2;
900
+ for (i = 0; i < this.count; i++)
901
+ {
902
+ this.resources[i] = {};
903
+ this.resources[i].type = dv.getUint8(at, true); at++;
904
+ this.resources[i].id = dv.getUint64(at, true); at += 8;
905
+ }
906
+ },
907
+ }
@@ -109,8 +109,7 @@ SpiceImageDescriptor.prototype =
109
109
  {
110
110
  from_dv: function(dv, at, mb)
111
111
  {
112
- this.id = dv.getUint32(at, true); at += 4;
113
- this.id += (dv.getUint32(at, true) << 32); at += 4;
112
+ this.id = dv.getUint64(at, true); at += 8;
114
113
  this.type = dv.getUint8(at, true); at ++;
115
114
  this.flags = dv.getUint8(at, true); at ++;
116
115
  this.width = dv.getUint32(at, true); at += 4;
@@ -128,9 +127,7 @@ SpicePalette.prototype =
128
127
  from_dv: function(dv, at, mb)
129
128
  {
130
129
  var i;
131
- this.unique = [];
132
- this.unique[0] = dv.getUint32(at, true); at += 4;
133
- this.unique[1] = dv.getUint32(at, true); at += 4;
130
+ this.unique = dv.getUint64(at, true); at += 8;
134
131
  this.num_ents = dv.getUint16(at, true); at += 2;
135
132
  this.ents = [];
136
133
  for (i = 0; i < this.num_ents; i++)
@@ -156,9 +153,7 @@ SpiceBitmap.prototype =
156
153
  this.stride = dv.getUint32(at, true); at += 4;
157
154
  if (this.flags & SPICE_BITMAP_FLAGS_PAL_FROM_CACHE)
158
155
  {
159
- this.palette_id = [];
160
- this.palette_id[0] = dv.getUint32(at, true); at += 4;
161
- this.palette_id[1] = dv.getUint32(at, true); at += 4;
156
+ this.palette_id = dv.getUint64(at, true); at += 8;
162
157
  }
163
158
  else
164
159
  {
@@ -425,9 +420,7 @@ SpiceCursorHeader.prototype =
425
420
  {
426
421
  from_dv: function(dv, at, mb)
427
422
  {
428
- this.unique = [];
429
- this.unique[0] = dv.getUint32(at, true); at += 4;
430
- this.unique[1] = dv.getUint32(at, true); at += 4;
423
+ this.unique = dv.getUint64(at, true); at += 8;
431
424
  this.type = dv.getUint8(at, true); at ++;
432
425
  this.width = dv.getUint16(at, true); at += 2;
433
426
  this.height = dv.getUint16(at, true); at += 2;
@@ -208,6 +208,7 @@ common_scanmap[93] = 0xE05D; //KEY_Menu
208
208
 
209
209
  /* Firefox/Mozilla codes */
210
210
  var firefox_scanmap = [];
211
+ firefox_scanmap[173] = KEY_Minus;
211
212
  firefox_scanmap[109] = KEY_Minus;
212
213
  firefox_scanmap[61] = KEY_Equal;
213
214
  firefox_scanmap[59] = KEY_SemiColon;
metadata CHANGED
@@ -1,108 +1,89 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: spice-html5-rails
3
- version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 1
10
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.4
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Amos Benari
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-03-28 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: railties
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
26
17
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 3
31
- - 1
32
- version: "3.1"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
33
20
  type: :runtime
34
- version_requirements: *id001
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
35
27
  description: Spice HTML5 client packed for Rails application
36
- email:
28
+ email:
37
29
  - abenari@redhat.com
38
30
  executables: []
39
-
40
31
  extensions: []
41
-
42
32
  extra_rdoc_files: []
43
-
44
- files:
45
- - lib/spice-html5-rails.rb
33
+ files:
46
34
  - lib/spice-html5-rails/version.rb
47
- - vendor/assets/javascripts/spice-html5.js
48
- - vendor/assets/javascripts/spiceHTML5/spiceconn.js
49
- - vendor/assets/javascripts/spiceHTML5/ticket.js
35
+ - lib/spice-html5-rails.rb
36
+ - vendor/assets/javascripts/spiceHTML5/inputs.js
37
+ - vendor/assets/javascripts/spiceHTML5/png.js
38
+ - vendor/assets/javascripts/spiceHTML5/quic.js
39
+ - vendor/assets/javascripts/spiceHTML5/cursor.js
40
+ - vendor/assets/javascripts/spiceHTML5/display.js
50
41
  - vendor/assets/javascripts/spiceHTML5/spicetype.js
51
42
  - vendor/assets/javascripts/spiceHTML5/main.js
52
- - vendor/assets/javascripts/spiceHTML5/utils.js
43
+ - vendor/assets/javascripts/spiceHTML5/bitmap.js
53
44
  - vendor/assets/javascripts/spiceHTML5/lz.js
45
+ - vendor/assets/javascripts/spiceHTML5/ticket.js
46
+ - vendor/assets/javascripts/spiceHTML5/simulatecursor.js
47
+ - vendor/assets/javascripts/spiceHTML5/spicearraybuffer.js
48
+ - vendor/assets/javascripts/spiceHTML5/thirdparty/rsa.js
49
+ - vendor/assets/javascripts/spiceHTML5/thirdparty/prng4.js
50
+ - vendor/assets/javascripts/spiceHTML5/thirdparty/sha1.js
51
+ - vendor/assets/javascripts/spiceHTML5/thirdparty/rng.js
52
+ - vendor/assets/javascripts/spiceHTML5/thirdparty/jsbn.js
53
+ - vendor/assets/javascripts/spiceHTML5/spicedataview.js
54
54
  - vendor/assets/javascripts/spiceHTML5/enums.js
55
- - vendor/assets/javascripts/spiceHTML5/inputs.js
55
+ - vendor/assets/javascripts/spiceHTML5/wire.js
56
56
  - vendor/assets/javascripts/spiceHTML5/atKeynames.js
57
+ - vendor/assets/javascripts/spiceHTML5/utils.js
58
+ - vendor/assets/javascripts/spiceHTML5/spiceconn.js
57
59
  - vendor/assets/javascripts/spiceHTML5/spicemsg.js
58
- - vendor/assets/javascripts/spiceHTML5/bitmap.js
59
- - vendor/assets/javascripts/spiceHTML5/quic.js
60
- - vendor/assets/javascripts/spiceHTML5/wire.js
61
- - vendor/assets/javascripts/spiceHTML5/display.js
62
- - vendor/assets/javascripts/spiceHTML5/png.js
63
- - vendor/assets/javascripts/spiceHTML5/thirdparty/jsbn.js
64
- - vendor/assets/javascripts/spiceHTML5/thirdparty/rng.js
65
- - vendor/assets/javascripts/spiceHTML5/thirdparty/sha1.js
66
- - vendor/assets/javascripts/spiceHTML5/thirdparty/prng4.js
67
- - vendor/assets/javascripts/spiceHTML5/thirdparty/rsa.js
68
- - vendor/assets/javascripts/spiceHTML5/spicedataview.js
69
- - vendor/assets/javascripts/spiceHTML5/cursor.js
60
+ - vendor/assets/javascripts/spice-html5.js
70
61
  - LICENSE.txt
71
62
  - COPYING
72
63
  - COPYING.LESSER
73
64
  - README.md
74
65
  homepage: http://www.spice-space.org
75
66
  licenses: []
76
-
67
+ metadata: {}
77
68
  post_install_message:
78
69
  rdoc_options: []
79
-
80
- require_paths:
70
+ require_paths:
81
71
  - lib
82
- required_ruby_version: !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
91
- required_rubygems_version: !ruby/object:Gem::Requirement
92
- none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- hash: 3
97
- segments:
98
- - 0
99
- version: "0"
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
100
82
  requirements: []
101
-
102
83
  rubyforge_project:
103
- rubygems_version: 1.8.24
84
+ rubygems_version: 2.0.14
104
85
  signing_key:
105
- specification_version: 3
86
+ specification_version: 4
106
87
  summary: Spice client using HTML5 (WebSockets, Canvas).
107
88
  test_files: []
108
-
89
+ has_rdoc: