Showing the changes to interface/src/scripting/WindowScriptingInterface.h (1 of 1 file). Show all
Unified · Split
| @@ -34,7 +34,9 @@ void CustomPromptResultFromScriptValue(const QScriptValue& object, CustomPromptR · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | /**jsdoc |
| 37 | − * The Window API provides various facilities not covered elsewhere. | |
| 37 | + * The Window API provides various facilities not covered elsewhere: window dimensions, window focus, normal or entity camera | |
| 38 | + * view, clipboard, announcements, user connections, common dialog boxes, snapshots, file import, domain changes, domain | |
| 39 | + * physics. | |
| 38 | 40 | * |
| 39 | 41 | * @namespace Window |
| 40 | 42 | * @property {number} innerWidth - The width of the drawable area of the Interface window (i.e., without borders or other |
| @@ -187,8 +189,8 @@ public slots: · 146 unmodified lines | ||
| 187 | 189 | * <code>"Images (*.png *.jpg *.svg)"</code>. All files are displayed if a filter isn't specified. |
| 188 | 190 | * @returns {string} The path and name of the file if one is chosen, otherwise <code>null</code>. |
| 189 | 191 | * @example <caption>Ask the user to choose an image file.</caption> |
| 190 | − * var file = Window.browse("Select Image File", Paths.resources, "Images (*.png *.jpg *.svg)"); | |
| 191 | − * print("File: " + file); | |
| 192 | + * var filename = Window.browse("Select Image File", Paths.resources, "Images (*.png *.jpg *.svg)"); | |
| 193 | + * print("File: " + filename); | |
| 192 | 194 | */ |
| 193 | 195 | QScriptValue browse(const QString& title = "", const QString& directory = "", const QString& nameFilter = ""); |
| 194 | 196 | |
| @@ -202,8 +204,8 @@ public slots: · 7 unmodified lines | ||
| 202 | 204 | * @param {string} nameFilter="" - The types of files to display. Examples: <code>"*.json"</code> and |
| 203 | 205 | * <code>"Images (*.png *.jpg *.svg)"</code>. All files are displayed if a filter isn't specified. |
| 204 | 206 | * @example <caption>Ask the user to choose an image file without waiting for the answer.</caption> |
| 205 | − * function onOpenFileChanged(file) { | |
| 206 | − * print("File: " + file); | |
| 207 | + * function onOpenFileChanged(filename) { | |
| 208 | + * print("File: " + filename); | |
| 207 | 209 | * } |
| 208 | 210 | * Window.openFileChanged.connect(onOpenFileChanged); |
| 209 | 211 | * |
| @@ -220,11 +222,11 @@ public slots: · 10 unmodified lines | ||
| 220 | 222 | * @param {string} directory="" - The initial directory to start browsing at. |
| 221 | 223 | * @param {string} nameFilter="" - The types of files to display. Examples: <code>"*.json"</code> and |
| 222 | 224 | * <code>"Images (*.png *.jpg *.svg)"</code>. All files are displayed if a filter isn't specified. |
| 223 | − * @returns {string} The path and name of the file is one is specified, otherwise <code>null</code>. If a single file type | |
| 225 | + * @returns {string} The path and name of the file if one is specified, otherwise <code>null</code>. If a single file type | |
| 224 | 226 | * is specified in the nameFilter, that file type extension is automatically appended to the result when appropriate. |
| 225 | 227 | * @example <caption>Ask the user to specify a file to save to.</caption> |
| 226 | − * var file = Window.save("Save to JSON file", Paths.resources, "*.json"); | |
| 227 | − * print("File: " + file); | |
| 228 | + * var filename = Window.save("Save to JSON file", Paths.resources, "*.json"); | |
| 229 | + * print("File: " + filename); | |
| 228 | 230 | */ |
| 229 | 231 | QScriptValue save(const QString& title = "", const QString& directory = "", const QString& nameFilter = ""); |
| 230 | 232 | |
| @@ -238,8 +240,8 @@ public slots: · 7 unmodified lines | ||
| 238 | 240 | * @param {string} nameFilter="" - The types of files to display. Examples: <code>"*.json"</code> and |
| 239 | 241 | * <code>"Images (*.png *.jpg *.svg)"</code>. All files are displayed if a filter isn't specified. |
| 240 | 242 | * @example <caption>Ask the user to specify a file to save to without waiting for an answer.</caption> |
| 241 | − * function onSaveFileChanged(file) { | |
| 242 | − * print("File: " + file); | |
| 243 | + * function onSaveFileChanged(filename) { | |
| 244 | + * print("File: " + filename); | |
| 243 | 245 | * } |
| 244 | 246 | * Window.saveFileChanged.connect(onSaveFileChanged); |
| 245 | 247 | * |
| @@ -289,9 +291,9 @@ public slots: · 43 unmodified lines | ||
| 289 | 291 | * @function Window.showAssetServer |
| 290 | 292 | * @param {string} uploadFile="" - The path and name of a file to upload to the asset server. |
| 291 | 293 | * @example <caption>Upload a file to the asset server.</caption> |
| 292 | − * var file = Window.browse("Select File to Add to Asset Server", Paths.resources); | |
| 293 | − * print("File: " + file); | |
| 294 | − * Window.showAssetServer(file); | |
| 294 | + * var filename = Window.browse("Select File to Add to Asset Server", Paths.resources); | |
| 295 | + * print("File: " + filename); | |
| 296 | + * Window.showAssetServer(filename); | |
| 295 | 297 | */ |
| 296 | 298 | void showAssetServer(const QString& upload = ""); |
| 297 | 299 | |
| @@ -321,8 +323,8 @@ public slots: · 23 unmodified lines | ||
| 321 | 323 | * @param {boolean} includeAnimated=false - If <code>true</code>, a moving image is captured as an animated GIF in addition |
| 322 | 324 | * to a still image. |
| 323 | 325 | * @param {number} aspectRatio=0 - The width/height ratio of the snapshot required. If the value is <code>0</code> the |
| 324 | − * full resolution is used (window dimensions in desktop mode; HMD display dimensions in HMD mode), otherwise one or | |
| 325 | − * other dimension is adjusted in order to match the aspect ratio. | |
| 326 | + * full resolution is used (window dimensions in desktop mode; HMD display dimensions in HMD mode), otherwise one of the | |
| 327 | + * dimensions is adjusted in order to match the aspect ratio. | |
| 326 | 328 | * @example <caption>Using the snapshot function and signals.</caption> |
| 327 | 329 | * function onStillSnapshottaken(path, notify) { |
| 328 | 330 | * print("Still snapshot taken: " + path); |
| @@ -356,7 +358,7 @@ public slots: · 27 unmodified lines | ||
| 356 | 358 | |
| 357 | 359 | /**jsdoc |
| 358 | 360 | * Emit a {@link Window.connectionAdded|connectionAdded} or a {@link Window.connectionError|connectionError} signal that |
| 359 | − * indicates whether or not you successfully made a user connection. | |
| 361 | + * indicates whether or a user connection was successfully made using the Web API. | |
| 360 | 362 | * @function Window.makeConnection |
| 361 | 363 | * @param {boolean} success - If <code>true</code> then {@link Window.connectionAdded|connectionAdded} is emitted, otherwise |
| 362 | 364 | * {@link Window.connectionError|connectionError} is emitted. |
| @@ -416,7 +418,7 @@ public slots: · 53 unmodified lines | ||
| 416 | 418 | * Set what to show on the PC display: normal view or entity camera view. The entity camera is configured using |
| 417 | 419 | * {@link Camera.setCameraEntity} and {@link Camera|Camera.mode}. |
| 418 | 420 | * @function Window.setDisplayTexture |
| 419 | − * @param {Window.DisplayTexture} name - The view to display. | |
| 421 | + * @param {Window.DisplayTexture} texture - The view to display. | |
| 420 | 422 | * @returns {boolean} <code>true</code> if the display texture was successfully set, otherwise <code>false</code>. |
| 421 | 423 | */ |
| 422 | 424 | // See spectatorCamera.js for Valid parameter values. |
| @@ -445,17 +447,18 @@ public slots: · 22 unmodified lines | ||
| 445 | 447 | bool setDisplayTexture(const QString& name); |
| 446 | 448 | |
| 447 | 449 | /**jsdoc |
| 448 | − * Check if a 2D point is within the drawable area of the HUD overlay. | |
| 450 | + * Check if a 2D point is within the desktop window if in desktop mode, or the drawable area of the HUD overlay if in HMD | |
| 451 | + * mode. | |
| 449 | 452 | * @function Window.isPointOnDesktopWindow |
| 450 | − * @param {Vec2} point - The point to check in HMD display coordinates. | |
| 453 | + * @param {Vec2} point - The point to check. | |
| 451 | 454 | * @returns {boolean} <code>true</code> if the point is within the window or HUD, otherwise <code>false</code>. |
| 452 | 455 | */ |
| 453 | 456 | bool isPointOnDesktopWindow(QVariant point); |
| 454 | 457 | |
| 455 | 458 | /**jsdoc |
| 456 | − * Get the size of the drawable area of the Interface window if in desktop mode or the HMD display if in HMD mode. | |
| 459 | + * Get the size of the drawable area of the Interface window if in desktop mode or the HMD rendering surface if in HMD mode. | |
| 457 | 460 | * @function Window.getDeviceSize |
| 458 | − * @returns {Vec2} The width and height of the Interface window or HMD display, in pixels. | |
| 461 | + * @returns {Vec2} The width and height of the Interface window or HMD rendering surface, in pixels. | |
| 459 | 462 | */ |
| 460 | 463 | glm::vec2 getDeviceSize() const; |
| 461 | 464 | |
| @@ -521,13 +524,19 @@ signals: · 59 unmodified lines | ||
| 521 | 524 | * @function Window.domainChanged |
| 522 | 525 | * @param {string} domain - The domain's IP address. |
| 523 | 526 | * @returns {Signal} |
| 527 | + * @example <caption>Report when you change domains.</caption> | |
| 528 | + * function onDomainChanged(domain) { | |
| 529 | + * print("Domain changed: " + domain); | |
| 530 | + * } | |
| 531 | + * | |
| 532 | + * Window.domainChanged.connect(onDomainChanged); | |
| 524 | 533 | */ |
| 525 | 534 | void domainChanged(const QString& domain); |
| 526 | 535 | |
| 527 | 536 | /**jsdoc |
| 528 | − * Triggered when you try to navigate to a *.svo or *.svo.json URL in a Web browser within Interface. | |
| 537 | + * Triggered when you try to navigate to a *.json, *.svo, or *.svo.json URL in a Web browser within Interface. | |
| 529 | 538 | * @function Window.svoImportRequested |
| 530 | − * @param {string} url - The URL of the SVO file to import/ | |
| 539 | + * @param {string} url - The URL of the file to import. | |
| 531 | 540 | * @returns {Signal} |
| 532 | 541 | */ |
| 533 | 542 | void svoImportRequested(const QString& url); |
| @@ -543,7 +552,7 @@ signals: · 9 unmodified lines | ||
| 543 | 552 | void domainConnectionRefused(const QString& reasonMessage, int reasonCode, const QString& extraInfo); |
| 544 | 553 | |
| 545 | 554 | /**jsdoc |
| 546 | − * Triggered when a still snapshot has been taken by calling {@link Window.takeSnapshot|takeSnapshot}} with | |
| 555 | + * Triggered when a still snapshot has been taken by calling {@link Window.takeSnapshot|takeSnapshot} with | |
| 547 | 556 | * <code>includeAnimated = false</code>. |
| 548 | 557 | * @function Window.stillSnapshotTaken |
| 549 | 558 | * @param {string} pathStillSnapshot - The path and name of the snapshot image file. |
| @@ -611,7 +620,7 @@ signals: · 61 unmodified lines | ||
| 611 | 620 | * Triggered when the user closes a message box that was opened with {@link Window.openMessageBox|openMessageBox}. |
| 612 | 621 | * @function Window.messageBoxClosed |
| 613 | 622 | * @param {number} id - The ID of the message box that was closed. |
| 614 | − * @param {number} button - The button that the user clicked. If the user presses Esc the Cancel button value is returned, | |
| 623 | + * @param {number} button - The button that the user clicked. If the user presses Esc, the Cancel button value is returned, | |
| 615 | 624 | * whether or not the Cancel button is displayed in the message box. |
| 616 | 625 | * @returns {Signal} |
| 617 | 626 | */ |