Class Guacamole.Client
Defined in: guacamole.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Guacamole.Client(tunnel)
Guacamole protocol client.
|
Method Attributes | Method Name and Description |
---|---|
connect(data)
Connects the underlying tunnel of this Guacamole.Client, passing the
given arbitrary data to the tunnel during the connection process.
|
|
Sends a disconnect instruction to the server and closes the tunnel.
|
|
flatten()
Returns a canvas element containing the entire display, with all child
layers composited within.
|
|
Returns an element containing the display of this Guacamole.Client.
|
|
Returns the height of the display.
|
|
getScale()
Returns the scale of the display.
|
|
getWidth()
Returns the width of the display.
|
|
scale(scale)
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.
|
|
sendKeyEvent(pressed, keysym)
Sends a key event having the given properties as if the user
pressed or released a key.
|
|
sendMouseState(mouseState)
Sends a mouse event having the properties provided by the given mouse
state.
|
|
sendSize(width, height)
Sends the current size of the screen.
|
|
setClipboard(data)
Sets the clipboard of the remote client to the given text data.
|
Event Attributes | Event Name and Description |
---|---|
onblob(blob)
Fired when a blob is created.
|
|
onclipboard(data)
Fired when the clipboard of the remote client is changing.
|
|
onerror(error)
Fired when an error is reported by the remote client, and the connection
is being closed.
|
|
onname(name)
Fired when the remote client sends a name update.
|
|
onresize(width, height)
Fired when the default layer (and thus the entire Guacamole display)
is resized.
|
|
onstatechange(state)
Fired whenever the state of this Guacamole.Client changes.
|
Class Detail
Guacamole.Client(tunnel)
Guacamole protocol client. Given a display element and Guacamole.Tunnel,
automatically handles incoming and outgoing Guacamole instructions via the
provided tunnel, updating the display using one or more canvas elements.
- Parameters:
- {Guacamole.Tunnel} tunnel
- The tunnel to use to send and receive Guacamole instructions.
Method Detail
connect(data)
Connects the underlying tunnel of this Guacamole.Client, passing the
given arbitrary data to the tunnel during the connection process.
- Parameters:
- data
- Arbitrary connection data to be sent to the underlying tunnel during the connection process.
disconnect()
Sends a disconnect instruction to the server and closes the tunnel.
{HTMLCanvasElement}
flatten()
Returns a canvas element containing the entire display, with all child
layers composited within.
- Returns:
- {HTMLCanvasElement} A new canvas element containing a copy of the display.
{Element}
getDisplay()
Returns an element containing the display of this Guacamole.Client.
Adding the element returned by this function to an element in the body
of a document will cause the client's display to be visible.
- Returns:
- {Element} An element containing ths display of this Guacamole.Client.
{Number}
getHeight()
Returns the height of the display.
- Returns:
- {Number} The height of the display.
{Number}
getScale()
Returns the scale of the display.
- Returns:
- {Number} The scale of the display.
{Number}
getWidth()
Returns the width of the display.
- Returns:
- {Number} The width of the display.
scale(scale)
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.
- Parameters:
- {Number} scale
- The scale to resize to, where 1.0 is normal size (1:1 scale).
sendKeyEvent(pressed, keysym)
Sends a key event having the given properties as if the user
pressed or released a key.
- Parameters:
- {Boolean} pressed
- Whether the key is pressed (true) or released (false).
- {Number} keysym
- The keysym of the key being pressed or released.
sendMouseState(mouseState)
Sends a mouse event having the properties provided by the given mouse
state.
- Parameters:
- {Guacamole.Mouse.State} mouseState
- The state of the mouse to send in the mouse event.
sendSize(width, height)
Sends the current size of the screen.
- Parameters:
- {Number} width
- The width of the screen.
- {Number} height
- The height of the screen.
setClipboard(data)
Sets the clipboard of the remote client to the given text data.
- Parameters:
- {String} data
- The data to send as the clipboard contents.
Event Detail
onblob(blob)
Fired when a blob is created. The blob provided to this event handler
will contain its own event handlers for received data and the close
event.
- Parameters:
- {Guacamole.Blob} blob
- A container for blob data that will receive data from the server.
onclipboard(data)
Fired when the clipboard of the remote client is changing.
- Parameters:
- {String} data
- The new text data of the remote clipboard.
onerror(error)
Fired when an error is reported by the remote client, and the connection
is being closed.
- Parameters:
- {String} error
- A human-readable description of the error.
onname(name)
Fired when the remote client sends a name update.
- Parameters:
- {String} name
- The new name of this client.
onresize(width, height)
Fired when the default layer (and thus the entire Guacamole display)
is resized.
- Parameters:
- {Number} width
- The new width of the Guacamole display.
- {Number} height
- The new height of the Guacamole display.
onstatechange(state)
Fired whenever the state of this Guacamole.Client changes.
- Parameters:
- {Number} state
- The new state of the client.