GUAC-791: Add missing private tags to inner variables/functions.

This commit is contained in:
Michael Jumper
2015-12-14 14:26:19 -08:00
parent 4554c64bb7
commit 7cdfd146ef
8 changed files with 89 additions and 33 deletions

View File

@@ -361,6 +361,7 @@ Guacamole.RawAudioPlayer = function RawAudioPlayer(stream, mimetype) {
* dynamically according to the click-reduction algorithm implemented by * dynamically according to the click-reduction algorithm implemented by
* splitAudioPacket(). * splitAudioPacket().
* *
* @private
* @returns {SampleArray} * @returns {SampleArray}
* A packet of audio data pulled from the beginning of the playback * A packet of audio data pulled from the beginning of the playback
* queue. * queue.

View File

@@ -69,11 +69,17 @@ Guacamole.Client = function(tunnel) {
/** /**
* The underlying Guacamole display. * The underlying Guacamole display.
*
* @private
* @type {Guacamole.Display}
*/ */
var display = new Guacamole.Display(); var display = new Guacamole.Display();
/** /**
* All available layers and buffers * All available layers and buffers
*
* @private
* @type {Object.<Number, (Guacamole.Display.VisibleLayer|Guacamole.Layer)>}
*/ */
var layers = {}; var layers = {};
@@ -81,6 +87,7 @@ Guacamole.Client = function(tunnel) {
* All audio players currently in use by the client. Initially, this will * All audio players currently in use by the client. Initially, this will
* be empty, but audio players may be allocated by the server upon request. * be empty, but audio players may be allocated by the server upon request.
* *
* @private
* @type {Object.<Number, Guacamole.AudioPlayer>} * @type {Object.<Number, Guacamole.AudioPlayer>}
*/ */
var audioPlayers = {}; var audioPlayers = {};
@@ -89,6 +96,7 @@ Guacamole.Client = function(tunnel) {
* All video players currently in use by the client. Initially, this will * All video players currently in use by the client. Initially, this will
* be empty, but video players may be allocated by the server upon request. * be empty, but video players may be allocated by the server upon request.
* *
* @private
* @type {Object.<Number, Guacamole.VideoPlayer>} * @type {Object.<Number, Guacamole.VideoPlayer>}
*/ */
var videoPlayers = {}; var videoPlayers = {};
@@ -103,6 +111,7 @@ Guacamole.Client = function(tunnel) {
* All current objects. The index of each object is dictated by the * All current objects. The index of each object is dictated by the
* Guacamole server. * Guacamole server.
* *
* @private
* @type {Guacamole.Object[]} * @type {Guacamole.Object[]}
*/ */
var objects = []; var objects = [];
@@ -554,11 +563,15 @@ Guacamole.Client = function(tunnel) {
* Returns the layer with the given index, creating it if necessary. * Returns the layer with the given index, creating it if necessary.
* Positive indices refer to visible layers, an index of zero refers to * Positive indices refer to visible layers, an index of zero refers to
* the default layer, and negative indices refer to buffers. * the default layer, and negative indices refer to buffers.
* *
* @param {Number} index The index of the layer to retrieve. * @private
* @return {Guacamole.Display.VisibleLayer|Guacamole.Layer} The layer having the given index. * @param {Number} index
* The index of the layer to retrieve.
*
* @return {Guacamole.Display.VisibleLayer|Guacamole.Layer}
* The layer having the given index.
*/ */
function getLayer(index) { var getLayer = function getLayer(index) {
// Get layer, create if necessary // Get layer, create if necessary
var layer = layers[index]; var layer = layers[index];
@@ -579,7 +592,7 @@ Guacamole.Client = function(tunnel) {
return layer; return layer;
} };
function getParser(index) { function getParser(index) {

View File

@@ -43,6 +43,7 @@ Guacamole.DataURIReader = function(stream, mimetype) {
/** /**
* Current data URI. * Current data URI.
* *
* @private
* @type {String} * @type {String}
*/ */
var uri = 'data:' + mimetype + ';base64,'; var uri = 'data:' + mimetype + ';base64,';

View File

@@ -31,11 +31,15 @@ Guacamole.IntegerPool = function() {
/** /**
* Reference to this integer pool. * Reference to this integer pool.
*
* @private
*/ */
var guac_pool = this; var guac_pool = this;
/** /**
* Array of available integers. * Array of available integers.
*
* @private
* @type {Number[]} * @type {Number[]}
*/ */
var pool = []; var pool = [];

View File

@@ -313,6 +313,7 @@ Guacamole.Keyboard = function(element) {
* An array of recorded events, which can be instances of the private * An array of recorded events, which can be instances of the private
* KeydownEvent, KeypressEvent, and KeyupEvent classes. * KeydownEvent, KeypressEvent, and KeyupEvent classes.
* *
* @private
* @type {KeyEvent[]} * @type {KeyEvent[]}
*/ */
var eventLog = []; var eventLog = [];
@@ -541,6 +542,8 @@ Guacamole.Keyboard = function(element) {
* by keysym. This is used to prevent/allow default actions for key events, * by keysym. This is used to prevent/allow default actions for key events,
* even when the onkeydown handler cannot be called again because the key * even when the onkeydown handler cannot be called again because the key
* is (theoretically) still pressed. * is (theoretically) still pressed.
*
* @private
*/ */
var last_keydown_result = {}; var last_keydown_result = {};
@@ -571,19 +574,22 @@ Guacamole.Keyboard = function(element) {
* for the given location, or the keysym for the standard location if * for the given location, or the keysym for the standard location if
* undefined. * undefined.
* *
* @param {Array} keysyms An array of keysyms, where the index of the * @private
* keysym in the array is the location value. * @param {Number[]} keysyms
* @param {Number} location The location on the keyboard corresponding to * An array of keysyms, where the index of the keysym in the array is
* the key pressed, as defined at: * the location value.
* http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent *
* @param {Number} location
* The location on the keyboard corresponding to the key pressed, as
* defined at: http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
*/ */
function get_keysym(keysyms, location) { var get_keysym = function get_keysym(keysyms, location) {
if (!keysyms) if (!keysyms)
return null; return null;
return keysyms[location] || keysyms[0]; return keysyms[location] || keysyms[0];
} };
function keysym_from_key_identifier(identifier, location, shifted) { function keysym_from_key_identifier(identifier, location, shifted) {
@@ -651,15 +657,18 @@ Guacamole.Keyboard = function(element) {
* the keyCode is the Unicode codepoint for that key. This is not * the keyCode is the Unicode codepoint for that key. This is not
* correct in all cases. * correct in all cases.
* *
* @param {Number} keyCode The keyCode from a browser keydown/keyup * @private
* event. * @param {Number} keyCode
* @param {String} keyIdentifier The legacy keyIdentifier from a * The keyCode from a browser keydown/keyup event.
* browser keydown/keyup event. *
* @returns {Boolean} true if the keyIdentifier looks sane, false if * @param {String} keyIdentifier
* the keyIdentifier appears incorrectly derived or * The legacy keyIdentifier from a browser keydown/keyup event.
* is missing entirely. *
* @returns {Boolean}
* true if the keyIdentifier looks sane, false if the keyIdentifier
* appears incorrectly derived or is missing entirely.
*/ */
function key_identifier_sane(keyCode, keyIdentifier) { var key_identifier_sane = function key_identifier_sane(keyCode, keyIdentifier) {
// Missing identifier is not sane // Missing identifier is not sane
if (!keyIdentifier) if (!keyIdentifier)
@@ -684,7 +693,7 @@ Guacamole.Keyboard = function(element) {
// The keyIdentifier does NOT appear sane // The keyIdentifier does NOT appear sane
return false; return false;
} };
/** /**
* Marks a key as pressed, firing the keydown event if registered. Key * Marks a key as pressed, firing the keydown event if registered. Key
@@ -777,10 +786,12 @@ Guacamole.Keyboard = function(element) {
* Given a keyboard event, updates the local modifier state and remote * Given a keyboard event, updates the local modifier state and remote
* key state based on the modifier flags within the event. This function * key state based on the modifier flags within the event. This function
* pays no attention to keycodes. * pays no attention to keycodes.
* *
* @param {KeyboardEvent} e The keyboard event containing the flags to update. * @private
* @param {KeyboardEvent} e
* The keyboard event containing the flags to update.
*/ */
function update_modifier_state(e) { var update_modifier_state = function update_modifier_state(e) {
// Get state // Get state
var state = Guacamole.Keyboard.ModifierState.fromKeyboardEvent(e); var state = Guacamole.Keyboard.ModifierState.fromKeyboardEvent(e);
@@ -819,13 +830,14 @@ Guacamole.Keyboard = function(element) {
// Update state // Update state
guac_keyboard.modifiers = state; guac_keyboard.modifiers = state;
} };
/** /**
* Reads through the event log, removing events from the head of the log * Reads through the event log, removing events from the head of the log
* when the corresponding true key presses are known (or as known as they * when the corresponding true key presses are known (or as known as they
* can be). * can be).
* *
* @private
* @return {Boolean} Whether the default action of the latest event should * @return {Boolean} Whether the default action of the latest event should
* be prevented. * be prevented.
*/ */
@@ -850,10 +862,11 @@ Guacamole.Keyboard = function(element) {
/** /**
* Releases Ctrl+Alt, if both are currently pressed and the given keysym * Releases Ctrl+Alt, if both are currently pressed and the given keysym
* looks like a key that may require AltGr. * looks like a key that may require AltGr.
* *
* @private
* @param {Number} keysym The key that was just pressed. * @param {Number} keysym The key that was just pressed.
*/ */
function release_simulated_altgr(keysym) { var release_simulated_altgr = function release_simulated_altgr(keysym) {
// Both Ctrl+Alt must be pressed if simulated AltGr is in use // Both Ctrl+Alt must be pressed if simulated AltGr is in use
if (!guac_keyboard.modifiers.ctrl || !guac_keyboard.modifiers.alt) if (!guac_keyboard.modifiers.ctrl || !guac_keyboard.modifiers.alt)
@@ -875,7 +888,7 @@ Guacamole.Keyboard = function(element) {
guac_keyboard.release(0xFFEA); // Right alt guac_keyboard.release(0xFFEA); // Right alt
} }
} };
/** /**
* Reads through the event log, interpreting the first event, if possible, * Reads through the event log, interpreting the first event, if possible,
@@ -883,10 +896,12 @@ Guacamole.Keyboard = function(element) {
* total lack of events or the need for more events, null is returned. Any * total lack of events or the need for more events, null is returned. Any
* interpreted events are automatically removed from the log. * interpreted events are automatically removed from the log.
* *
* @return {KeyEvent} The first key event in the log, if it can be * @private
* interpreted, or null otherwise. * @return {KeyEvent}
* The first key event in the log, if it can be interpreted, or null
* otherwise.
*/ */
function interpret_event() { var interpret_event = function interpret_event() {
// Peek at first event in log // Peek at first event in log
var first = eventLog[0]; var first = eventLog[0];
@@ -973,13 +988,14 @@ Guacamole.Keyboard = function(element) {
// No event interpreted // No event interpreted
return null; return null;
} };
/** /**
* Returns the keyboard location of the key associated with the given * Returns the keyboard location of the key associated with the given
* keyboard event. The location differentiates key events which otherwise * keyboard event. The location differentiates key events which otherwise
* have the same keycode, such as left shift vs. right shift. * have the same keycode, such as left shift vs. right shift.
* *
* @private
* @param {KeyboardEvent} e * @param {KeyboardEvent} e
* A JavaScript keyboard event, as received through the DOM via a * A JavaScript keyboard event, as received through the DOM via a
* "keydown", "keyup", or "keypress" handler. * "keydown", "keyup", or "keypress" handler.

View File

@@ -119,6 +119,8 @@ Guacamole.Mouse = function(element) {
* Cumulative scroll delta amount. This value is accumulated through scroll * Cumulative scroll delta amount. This value is accumulated through scroll
* events and results in scroll button clicks if it exceeds a certain * events and results in scroll button clicks if it exceeds a certain
* threshold. * threshold.
*
* @private
*/ */
var scroll_delta = 0; var scroll_delta = 0;
@@ -789,6 +791,8 @@ Guacamole.Mouse.Touchscreen = function(element) {
/** /**
* Whether a gesture is known to be in progress. If false, touch events * Whether a gesture is known to be in progress. If false, touch events
* will be ignored. * will be ignored.
*
* @private
*/ */
var gesture_in_progress = false; var gesture_in_progress = false;
@@ -806,11 +810,15 @@ Guacamole.Mouse.Touchscreen = function(element) {
/** /**
* The timeout associated with the delayed, cancellable click release. * The timeout associated with the delayed, cancellable click release.
*
* @private
*/ */
var click_release_timeout = null; var click_release_timeout = null;
/** /**
* The timeout associated with long-press for right click. * The timeout associated with long-press for right click.
*
* @private
*/ */
var long_press_timeout = null; var long_press_timeout = null;

View File

@@ -36,6 +36,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
/** /**
* Reference to this Guacamole.OnScreenKeyboard. * Reference to this Guacamole.OnScreenKeyboard.
* *
* @private
* @type {Guacamole.OnScreenKeyboard} * @type {Guacamole.OnScreenKeyboard}
*/ */
var osk = this; var osk = this;
@@ -55,6 +56,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* pressed, it may not be in this map at all, but all pressed keys will * pressed, it may not be in this map at all, but all pressed keys will
* have a corresponding mapping to true. * have a corresponding mapping to true.
* *
* @private
* @type {Object.<String, Boolean>} * @type {Object.<String, Boolean>}
*/ */
var pressed = {}; var pressed = {};
@@ -214,6 +216,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* Returns whether all modifiers having the given names are currently * Returns whether all modifiers having the given names are currently
* active. * active.
* *
* @private
* @param {String[]} names * @param {String[]} names
* The names of all modifiers to test. * The names of all modifiers to test.
* *
@@ -242,6 +245,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* given name, where that Key object's requirements (such as pressed * given name, where that Key object's requirements (such as pressed
* modifiers) are all currently satisfied. * modifiers) are all currently satisfied.
* *
* @private
* @param {String} keyName * @param {String} keyName
* The name of the key to retrieve. * The name of the key to retrieve.
* *
@@ -279,6 +283,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* element with the "guac-keyboard-pressed" CSS class. If the key is * element with the "guac-keyboard-pressed" CSS class. If the key is
* already pressed, this function has no effect. * already pressed, this function has no effect.
* *
* @private
* @param {String} keyName * @param {String} keyName
* The name of the key to press. * The name of the key to press.
* *
@@ -346,6 +351,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* "guac-keyboard-pressed" CSS class from the associated element. If the * "guac-keyboard-pressed" CSS class from the associated element. If the
* key is already released, this function has no effect. * key is already released, this function has no effect.
* *
* @private
* @param {String} keyName * @param {String} keyName
* The name of the key to release. * The name of the key to release.
* *
@@ -705,6 +711,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* key. Touch events will result in mouse events being ignored for * key. Touch events will result in mouse events being ignored for
* touchMouseThreshold events. * touchMouseThreshold events.
* *
* @private
* @param {TouchEvent} e * @param {TouchEvent} e
* The touch event being handled. * The touch event being handled.
*/ */
@@ -719,6 +726,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* key. Touch events will result in mouse events being ignored for * key. Touch events will result in mouse events being ignored for
* touchMouseThreshold events. * touchMouseThreshold events.
* *
* @private
* @param {TouchEvent} e * @param {TouchEvent} e
* The touch event being handled. * The touch event being handled.
*/ */
@@ -733,6 +741,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* key. If mouse events are currently being ignored, this handler * key. If mouse events are currently being ignored, this handler
* does nothing. * does nothing.
* *
* @private
* @param {MouseEvent} e * @param {MouseEvent} e
* The touch event being handled. * The touch event being handled.
*/ */
@@ -747,6 +756,7 @@ Guacamole.OnScreenKeyboard = function(layout) {
* key. If mouse events are currently being ignored, this handler * key. If mouse events are currently being ignored, this handler
* does nothing. * does nothing.
* *
* @private
* @param {MouseEvent} e * @param {MouseEvent} e
* The touch event being handled. * The touch event being handled.
*/ */

View File

@@ -48,13 +48,16 @@ Guacamole.StringReader = function(stream) {
/** /**
* The number of bytes remaining for the current codepoint. * The number of bytes remaining for the current codepoint.
* *
* @private
* @type {Number} * @type {Number}
*/ */
var bytes_remaining = 0; var bytes_remaining = 0;
/** /**
* The current codepoint value, as calculated from bytes read so far. * The current codepoint value, as calculated from bytes read so far.
*
* @private
* @type {Number} * @type {Number}
*/ */
var codepoint = 0; var codepoint = 0;