mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
Fix JSDoc.
This commit is contained in:
@@ -55,6 +55,7 @@ Guacamole.AudioChannel = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When the next packet should play.
|
* When the next packet should play.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
var next_packet_time = 0;
|
var next_packet_time = 0;
|
||||||
|
|
||||||
@@ -92,6 +93,14 @@ if (window.webkitAudioContext) {
|
|||||||
Guacamole.AudioChannel.context = new webkitAudioContext();
|
Guacamole.AudioChannel.context = new webkitAudioContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a base timestamp which can be used for scheduling future audio
|
||||||
|
* playback. Scheduling playback for the value returned by this function plus
|
||||||
|
* N will cause the associated audio to be played back N milliseconds after
|
||||||
|
* the function is called.
|
||||||
|
*
|
||||||
|
* @return {Number} An arbitrary channel-relative timestamp, in milliseconds.
|
||||||
|
*/
|
||||||
Guacamole.AudioChannel.getTimestamp = function() {
|
Guacamole.AudioChannel.getTimestamp = function() {
|
||||||
|
|
||||||
// If we have an audio context, use its timestamp
|
// If we have an audio context, use its timestamp
|
||||||
@@ -124,6 +133,15 @@ Guacamole.AudioChannel.getTimestamp = function() {
|
|||||||
*/
|
*/
|
||||||
Guacamole.AudioChannel.Packet = function(mimetype, data) {
|
Guacamole.AudioChannel.Packet = function(mimetype, data) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schedules this packet for playback at the given time.
|
||||||
|
*
|
||||||
|
* @function
|
||||||
|
* @param {Number} when The time this packet should be played, in
|
||||||
|
* milliseconds.
|
||||||
|
*/
|
||||||
|
this.play = undefined; // Defined conditionally depending on support
|
||||||
|
|
||||||
// If audio API available, use it.
|
// If audio API available, use it.
|
||||||
if (Guacamole.AudioChannel.context) {
|
if (Guacamole.AudioChannel.context) {
|
||||||
|
|
||||||
@@ -160,6 +178,7 @@ Guacamole.AudioChannel.Packet = function(mimetype, data) {
|
|||||||
source.noteOn(play_when / 1000);
|
source.noteOn(play_when / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @ignore */
|
||||||
this.play = function(when) {
|
this.play = function(when) {
|
||||||
|
|
||||||
play_when = when;
|
play_when = when;
|
||||||
@@ -185,9 +204,7 @@ Guacamole.AudioChannel.Packet = function(mimetype, data) {
|
|||||||
var audio = new Audio();
|
var audio = new Audio();
|
||||||
audio.src = data_uri;
|
audio.src = data_uri;
|
||||||
|
|
||||||
/**
|
/** @ignore */
|
||||||
* Plays the sound data contained by this packet immediately.
|
|
||||||
*/
|
|
||||||
this.play = function(when) {
|
this.play = function(when) {
|
||||||
|
|
||||||
// Calculate time until play
|
// Calculate time until play
|
||||||
|
@@ -61,7 +61,7 @@ Guacamole.Parser = function() {
|
|||||||
* element is available. After a full element is available, that element
|
* element is available. After a full element is available, that element
|
||||||
* is flushed into the element buffer.
|
* is flushed into the element buffer.
|
||||||
*
|
*
|
||||||
* @priate
|
* @private
|
||||||
*/
|
*/
|
||||||
var buffer = "";
|
var buffer = "";
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ Guacamole.Parser = function() {
|
|||||||
* Buffer of all received, complete elements. After an entire instruction
|
* Buffer of all received, complete elements. After an entire instruction
|
||||||
* is read, this buffer is flushed, and a new instruction begins.
|
* is read, this buffer is flushed, and a new instruction begins.
|
||||||
*
|
*
|
||||||
* @priate
|
* @private
|
||||||
*/
|
*/
|
||||||
var element_buffer = [];
|
var element_buffer = [];
|
||||||
|
|
||||||
@@ -79,6 +79,13 @@ Guacamole.Parser = function() {
|
|||||||
// Where to start the next length search or the next element
|
// Where to start the next length search or the next element
|
||||||
var start_index = 0;
|
var start_index = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Appends the given instruction data packet to the internal buffer of
|
||||||
|
* this Guacamole.Parser, executing all completed instructions at
|
||||||
|
* the beginning of this buffer, if any.
|
||||||
|
*
|
||||||
|
* @param {String} packet The instruction data to append.
|
||||||
|
*/
|
||||||
this.receive = function(packet) {
|
this.receive = function(packet) {
|
||||||
|
|
||||||
// Truncate buffer as necessary
|
// Truncate buffer as necessary
|
||||||
@@ -1096,6 +1103,9 @@ Guacamole.Client = function(tunnel) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a disconnect instruction to the server and closes the tunnel.
|
||||||
|
*/
|
||||||
this.disconnect = function() {
|
this.disconnect = function() {
|
||||||
|
|
||||||
// Only attempt disconnection not disconnected.
|
// Only attempt disconnection not disconnected.
|
||||||
@@ -1117,6 +1127,13 @@ Guacamole.Client = function(tunnel) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connects the underlying tunnel of this Guacamole.Client, passing the
|
||||||
|
* given arbitrary data to the tunnel during the connection process.
|
||||||
|
*
|
||||||
|
* @param data Arbitrary connection data to be sent to the underlying
|
||||||
|
* tunnel during the connection process.
|
||||||
|
*/
|
||||||
this.connect = function(data) {
|
this.connect = function(data) {
|
||||||
|
|
||||||
setState(STATE_CONNECTING);
|
setState(STATE_CONNECTING);
|
||||||
@@ -1137,6 +1154,14 @@ Guacamole.Client = function(tunnel) {
|
|||||||
setState(STATE_WAITING);
|
setState(STATE_WAITING);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the scale of the client display element such that it renders at
|
||||||
|
* a relatively smaller or larger size, without affecting the true
|
||||||
|
* resolution of the display.
|
||||||
|
*
|
||||||
|
* @param {Number} scale The scale to resize to, where 1.0 is normal
|
||||||
|
* size (1:1 scale).
|
||||||
|
*/
|
||||||
this.scale = function(scale) {
|
this.scale = function(scale) {
|
||||||
|
|
||||||
display.style.transform =
|
display.style.transform =
|
||||||
@@ -1155,14 +1180,29 @@ Guacamole.Client = function(tunnel) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the width of the display.
|
||||||
|
*
|
||||||
|
* @return {Number} The width of the display.
|
||||||
|
*/
|
||||||
this.getWidth = function() {
|
this.getWidth = function() {
|
||||||
return displayWidth;
|
return displayWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the height of the display.
|
||||||
|
*
|
||||||
|
* @return {Number} The height of the display.
|
||||||
|
*/
|
||||||
this.getHeight = function() {
|
this.getHeight = function() {
|
||||||
return displayHeight;
|
return displayHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the scale of the display.
|
||||||
|
*
|
||||||
|
* @return {Number} The scale of the display.
|
||||||
|
*/
|
||||||
this.getScale = function() {
|
this.getScale = function() {
|
||||||
return displayScale;
|
return displayScale;
|
||||||
};
|
};
|
||||||
@@ -1170,6 +1210,9 @@ Guacamole.Client = function(tunnel) {
|
|||||||
/**
|
/**
|
||||||
* Returns a canvas element containing the entire display, with all child
|
* Returns a canvas element containing the entire display, with all child
|
||||||
* layers composited within.
|
* layers composited within.
|
||||||
|
*
|
||||||
|
* @return {HTMLCanvasElement} A new canvas element containing a copy of
|
||||||
|
* the display.
|
||||||
*/
|
*/
|
||||||
this.flatten = function() {
|
this.flatten = function() {
|
||||||
|
|
||||||
@@ -1248,7 +1291,8 @@ Guacamole.Client.LayerContainer = function(width, height) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Layer contained within this LayerContainer.
|
* Returns the Layer contained within this LayerContainer.
|
||||||
* @returns {Guacamole.Layer} The Layer contained within this LayerContainer.
|
* @returns {Guacamole.Layer} The Layer contained within this
|
||||||
|
* LayerContainer.
|
||||||
*/
|
*/
|
||||||
this.getLayer = function() {
|
this.getLayer = function() {
|
||||||
return layer;
|
return layer;
|
||||||
@@ -1256,7 +1300,8 @@ Guacamole.Client.LayerContainer = function(width, height) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the element containing the Layer within this LayerContainer.
|
* Returns the element containing the Layer within this LayerContainer.
|
||||||
* @returns {Element} The element containing the Layer within this LayerContainer.
|
* @returns {Element} The element containing the Layer within this
|
||||||
|
* LayerContainer.
|
||||||
*/
|
*/
|
||||||
this.getElement = function() {
|
this.getElement = function() {
|
||||||
return div;
|
return div;
|
||||||
|
@@ -215,6 +215,7 @@ Guacamole.Keyboard = function(element) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* All keysyms which should not repeat when held down.
|
* All keysyms which should not repeat when held down.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
var no_repeat = {
|
var no_repeat = {
|
||||||
0xFFE1: true,
|
0xFFE1: true,
|
||||||
@@ -253,17 +254,20 @@ Guacamole.Keyboard = function(element) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The keysym associated with a given keycode when keydown fired.
|
* The keysym associated with a given keycode when keydown fired.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
var keydownChar = [];
|
var keydownChar = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timeout before key repeat starts.
|
* Timeout before key repeat starts.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
var key_repeat_timeout = null;
|
var key_repeat_timeout = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interval which presses and releases the last key pressed while that
|
* Interval which presses and releases the last key pressed while that
|
||||||
* key is still being held down.
|
* key is still being held down.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
var key_repeat_interval = null;
|
var key_repeat_interval = null;
|
||||||
|
|
||||||
@@ -332,6 +336,7 @@ Guacamole.Keyboard = function(element) {
|
|||||||
* Marks a key as pressed, firing the keydown event if registered. Key
|
* Marks a key as pressed, firing the keydown event if registered. Key
|
||||||
* repeat for the pressed key will start after a delay if that key is
|
* repeat for the pressed key will start after a delay if that key is
|
||||||
* not a modifier.
|
* not a modifier.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function press_key(keysym) {
|
function press_key(keysym) {
|
||||||
|
|
||||||
@@ -369,6 +374,7 @@ Guacamole.Keyboard = function(element) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks a key as released, firing the keyup event if registered.
|
* Marks a key as released, firing the keyup event if registered.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
function release_key(keysym) {
|
function release_key(keysym) {
|
||||||
|
|
||||||
|
@@ -436,6 +436,7 @@ Guacamole.HTTPTunnel = function(tunnelURL) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Arbitrary integer, unique for each tunnel read request.
|
* Arbitrary integer, unique for each tunnel read request.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
var request_id = 0;
|
var request_id = 0;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user