mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
More JSDoc and cleanup.
This commit is contained in:
@@ -19,6 +19,16 @@
|
|||||||
// Guacamole namespace
|
// Guacamole namespace
|
||||||
var Guacamole = Guacamole || {};
|
var Guacamole = Guacamole || {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Guacamole protocol client. Given a display element and {@link Guacamole.Tunnel},
|
||||||
|
* automatically handles incoming and outgoing Guacamole instructions via the
|
||||||
|
* provided tunnel, updating the display using one or more canvas elements.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @param {Element} display The display element to add canvas elements to.
|
||||||
|
* @param {Guacamole.Tunnel} tunnel The tunnel to use to send and receive
|
||||||
|
* Guacamole instructions.
|
||||||
|
*/
|
||||||
Guacamole.Client = function(display, tunnel) {
|
Guacamole.Client = function(display, tunnel) {
|
||||||
|
|
||||||
var guac_client = this;
|
var guac_client = this;
|
||||||
|
@@ -226,14 +226,66 @@ Guacamole.Mouse = function(element) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple container for properties describing the state of a mouse.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @param {Number} x The X position of the mouse pointer in pixels.
|
||||||
|
* @param {Number} y The Y position of the mouse pointer in pixels.
|
||||||
|
* @param {Boolean} left Whether the left mouse button is pressed.
|
||||||
|
* @param {Boolean} middle Whether the middle mouse button is pressed.
|
||||||
|
* @param {Boolean} right Whether the right mouse button is pressed.
|
||||||
|
* @param {Boolean} up Whether the up mouse button is pressed (the fourth
|
||||||
|
* button, usually part of a scroll wheel).
|
||||||
|
* @param {Boolean} down Whether the down mouse button is pressed (the fifth
|
||||||
|
* button, usually part of a scroll wheel).
|
||||||
|
*/
|
||||||
Guacamole.Mouse.State = function(x, y, left, middle, right, up, down) {
|
Guacamole.Mouse.State = function(x, y, left, middle, right, up, down) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current X position of the mouse pointer.
|
||||||
|
* @type Number
|
||||||
|
*/
|
||||||
this.x = x;
|
this.x = x;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current Y position of the mouse pointer.
|
||||||
|
* @type Number
|
||||||
|
*/
|
||||||
this.y = y;
|
this.y = y;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the left mouse button is currently pressed.
|
||||||
|
* @type Boolean
|
||||||
|
*/
|
||||||
this.left = left;
|
this.left = left;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the middle mouse button is currently pressed.
|
||||||
|
* @type Boolean
|
||||||
|
*/
|
||||||
this.middle = middle
|
this.middle = middle
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the right mouse button is currently pressed.
|
||||||
|
* @type Boolean
|
||||||
|
*/
|
||||||
this.right = right;
|
this.right = right;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the up mouse button is currently pressed. This is the fourth
|
||||||
|
* mouse button, associated with upward scrolling of the mouse scroll
|
||||||
|
* wheel.
|
||||||
|
* @type Boolean
|
||||||
|
*/
|
||||||
this.up = up;
|
this.up = up;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the down mouse button is currently pressed. This is the fifth
|
||||||
|
* mouse button, associated with downward scrolling of the mouse scroll
|
||||||
|
* wheel.
|
||||||
|
* @type Boolean
|
||||||
|
*/
|
||||||
this.down = down;
|
this.down = down;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -20,6 +20,14 @@
|
|||||||
// Guacamole namespace
|
// Guacamole namespace
|
||||||
var Guacamole = Guacamole || {};
|
var Guacamole = Guacamole || {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dynamic on-screen keyboard. Given the URL to an XML keyboard layout file,
|
||||||
|
* this object will download and use the XML to construct a clickable on-screen
|
||||||
|
* keyboard with its own key events.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @param {String} url The URL of an XML keyboard layout file.
|
||||||
|
*/
|
||||||
Guacamole.OnScreenKeyboard = function(url) {
|
Guacamole.OnScreenKeyboard = function(url) {
|
||||||
|
|
||||||
var allKeys = new Array();
|
var allKeys = new Array();
|
||||||
|
@@ -19,6 +19,35 @@
|
|||||||
// Guacamole namespace
|
// Guacamole namespace
|
||||||
var Guacamole = Guacamole || {};
|
var Guacamole = Guacamole || {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Core object providing abstract communication for Guacamole. This object
|
||||||
|
* is a null implementation whose functions do nothing. Guacamole applications
|
||||||
|
* should use {@link Guacamole.HTTPTunnel} instead, or implement their own tunnel based
|
||||||
|
* on this one.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @see Guacamole.HTTPTunnel
|
||||||
|
*/
|
||||||
|
Guacamole.Tunnel = function() {
|
||||||
|
|
||||||
|
this.connect = function(data) {};
|
||||||
|
|
||||||
|
this.disconnect = function() {};
|
||||||
|
|
||||||
|
this.sendMessage = function(message) {};
|
||||||
|
|
||||||
|
this.onerror = null;
|
||||||
|
this.oninstruction = null;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Guacamole Tunnel implemented over HTTP via XMLHttpRequest.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @augments Guacamole.Tunnel
|
||||||
|
* @param {String} tunnelURL The URL of the HTTP tunneling service.
|
||||||
|
*/
|
||||||
Guacamole.HTTPTunnel = function(tunnelURL) {
|
Guacamole.HTTPTunnel = function(tunnelURL) {
|
||||||
|
|
||||||
var tunnel = this;
|
var tunnel = this;
|
||||||
@@ -44,10 +73,6 @@ Guacamole.HTTPTunnel = function(tunnelURL) {
|
|||||||
var sendingMessages = 0;
|
var sendingMessages = 0;
|
||||||
var outputMessageBuffer = "";
|
var outputMessageBuffer = "";
|
||||||
|
|
||||||
// Handlers
|
|
||||||
tunnel.onerror = null;
|
|
||||||
tunnel.oninstruction = null;
|
|
||||||
|
|
||||||
function sendMessage(message) {
|
function sendMessage(message) {
|
||||||
|
|
||||||
// Do not attempt to send messages if not connected
|
// Do not attempt to send messages if not connected
|
||||||
@@ -267,4 +292,6 @@ Guacamole.HTTPTunnel = function(tunnelURL) {
|
|||||||
tunnel.disconnect = disconnect;
|
tunnel.disconnect = disconnect;
|
||||||
tunnel.sendMessage = sendMessage;
|
tunnel.sendMessage = sendMessage;
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
|
Guacamole.HTTPTunnel.prototype = new Guacamole.Tunnel();
|
||||||
|
Reference in New Issue
Block a user