1 /** 2 * @class display 3 * @description 4 * Abstracts the system's means of displaying rendered data. Instantiates with {@link sandboxe.display.create()} </br></br> 5 * 6 * An interface for displaying rendered data 7 * 8 * 9 */ 10 function display() { 11 12 /** 13 * 14 * Resizes the display. If the display does not support resizing, no action is taken. 15 * @param {Number} width The new width 16 * @param {Number} height The new height 17 */ 18 this.resize = function(width, height){}; 19 20 /** 21 * Sets the position of the display. 22 * 23 * Usually, this is relative to whatever environment 24 * the display exists in. For example, in a desktop environment, this could be 25 * an offset from the DE's origin. If the display does not support moving, 26 * no action is taken. 27 * @param {Number} x The new x position of the display 28 * @param {Number} y The new y position of the display 29 */ 30 this.setPosition = function(x, y){}; 31 32 /** 33 * Set the display into a fullscreen context. If fullscreen is not supported, 34 * no action is taken. 35 * @param {Boolean} fs Whether to enable or disable fullscreen 36 */ 37 this.fullscreen = function(fs){}; 38 39 /** 40 * Attempts to hide the display. If hiding is not supported, no action is taken. 41 * @param {Boolean} hide Whether to hide the display 42 */ 43 this.hide = function(){}; 44 45 /** 46 * Returns whether the display has user input focus. On display implementations 47 * where this doesnt apply, i.e. where there is only one logical display available,, 48 * this will always return true. 49 * @returns {Boolean} Returns whether the display has input focus 50 */ 51 this.hasInputFocus = function(){}; 52 53 54 /** 55 * Attempts to prevent resizing on the user's side. 56 * 57 * For example, 58 * in a desktop environment, this would disable the feature of resizing 59 * the window. 60 * @param {Boolean} lock Whether to lock client resize. 61 */ 62 this.lockClientResize = function(){}; 63 64 65 /** 66 * Attempts to prevent moving on the user's side. 67 * @param {Boolean} lock Whether to lock client display position. 68 */ 69 this.lockPosition = function(){}; 70 71 /** 72 * Controls how the Renderer's information is displayed. The default policy is "MatchSize" 73 * See ViewPolicy for more information. 74 * @param {Number} viewPolicy The viewing policy. See {@link sandboxe.display.viewPolicy}. 75 */ 76 this.setViewPolicy = function(){}; 77 78 /** 79 * Sets the name of the display. On some systems, this can, for example, 80 * set the title bar of the application to the specified name. 81 * @param {String} name The new name. 82 */ 83 this.setName = function(){}; 84 85 /** 86 * Returns whether or not the display is able to 87 * perform the requested capability. 88 * @param {Number} capability The viewing policy. See {@link sandboxe.display.capability}. 89 */ 90 this.isCapable = function(){}; 91 92 93 94 /** 95 * Width of the display 96 * @type {Number} 97 */ 98 this.width = 0; 99 100 /** 101 * Height of the display 102 * @type {Number} 103 */ 104 this.height = 0; 105 106 107 /** 108 * The X position of the display 109 * @type {Number} 110 */ 111 this.x = 0; 112 113 /** 114 * The Y position of the display 115 * @type {Number} 116 */ 117 this.y = 0; 118 119 /** 120 * Function called when a resize event is detected for the display. 121 * The function is called after the event is applied. 122 * @type {Function} 123 */ 124 this.onResize = undefined; 125 126 /** 127 * Function called when a close event for the display is detected. 128 * @type {Function} 129 */ 130 this.onClose = undefined; 131 132 133 134 return this; 135 }