From ea6764743f5df51a95e291811947afa381eedc1d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 24 Oct 2012 10:52:53 -0700 Subject: [PATCH] Add width/height getters, add onresize event. --- .../src/main/resources/guacamole.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js index 5ffaee0a9..e2384c52e 100644 --- a/guacamole-common-js/src/main/resources/guacamole.js +++ b/guacamole-common-js/src/main/resources/guacamole.js @@ -463,6 +463,16 @@ Guacamole.Client = function(tunnel) { */ this.onclipboard = null; + /** + * Fired when the default layer (and thus the entire Guacamole display) + * is resized. + * + * @event + * @param {Number} width The new width of the Guacamole display. + * @param {Number} height The new height of the Guacamole display. + */ + this.onresize = null; + // Layers function getBufferLayer(index) { @@ -954,6 +964,10 @@ Guacamole.Client = function(tunnel) { bounds.style.width = (displayWidth*displayScale) + "px"; bounds.style.height = (displayHeight*displayScale) + "px"; + // Call resize event handler if defined + if (guac_client.onresize) + guac_client.onresize(width, height); + } } @@ -1134,6 +1148,14 @@ Guacamole.Client = function(tunnel) { }; + this.getWidth = function() { + return displayWidth; + }; + + this.getHeight = function() { + return displayHeight; + }; + this.getScale = function() { return displayScale; };