History

Update Window JSDoc

David Rowe committed 8 years ago

Commit 673bc7d1 parent 5463f1a1 file · +34 −25Browse files

Showing the changes to interface/src/scripting/WindowScriptingInterface.h (1 of 1 file). Show all

Unified · Split

interface/src/scripting/WindowScriptingInterface.h+34−25
@@ -34,7 +34,9 @@ void CustomPromptResultFromScriptValue(const QScriptValue& object, CustomPromptR · 33 unmodified lines
3434
3535
3636 /**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.
3840 *
3941 * @namespace Window
4042 * @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
187189 * <code>"Images (*.png *.jpg *.svg)"</code>. All files are displayed if a filter isn't specified.
188190 * @returns {string} The path and name of the file if one is chosen, otherwise <code>null</code>.
189191 * @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);
192194 */
193195 QScriptValue browse(const QString& title = "", const QString& directory = "", const QString& nameFilter = "");
194196
@@ -202,8 +204,8 @@ public slots: · 7 unmodified lines
202204 * @param {string} nameFilter="" - The types of files to display. Examples: <code>"*.json"</code> and
203205 * <code>"Images (*.png *.jpg *.svg)"</code>. All files are displayed if a filter isn't specified.
204206 * @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);
207209 * }
208210 * Window.openFileChanged.connect(onOpenFileChanged);
209211 *
@@ -220,11 +222,11 @@ public slots: · 10 unmodified lines
220222 * @param {string} directory="" - The initial directory to start browsing at.
221223 * @param {string} nameFilter="" - The types of files to display. Examples: <code>"*.json"</code> and
222224 * <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
224226 * is specified in the nameFilter, that file type extension is automatically appended to the result when appropriate.
225227 * @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);
228230 */
229231 QScriptValue save(const QString& title = "", const QString& directory = "", const QString& nameFilter = "");
230232
@@ -238,8 +240,8 @@ public slots: · 7 unmodified lines
238240 * @param {string} nameFilter="" - The types of files to display. Examples: <code>"*.json"</code> and
239241 * <code>"Images (*.png *.jpg *.svg)"</code>. All files are displayed if a filter isn't specified.
240242 * @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);
243245 * }
244246 * Window.saveFileChanged.connect(onSaveFileChanged);
245247 *
@@ -289,9 +291,9 @@ public slots: · 43 unmodified lines
289291 * @function Window.showAssetServer
290292 * @param {string} uploadFile="" - The path and name of a file to upload to the asset server.
291293 * @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);
295297 */
296298 void showAssetServer(const QString& upload = "");
297299
@@ -321,8 +323,8 @@ public slots: · 23 unmodified lines
321323 * @param {boolean} includeAnimated=false - If <code>true</code>, a moving image is captured as an animated GIF in addition
322324 * to a still image.
323325 * @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.
326328 * @example <caption>Using the snapshot function and signals.</caption>
327329 * function onStillSnapshottaken(path, notify) {
328330 * print("Still snapshot taken: " + path);
@@ -356,7 +358,7 @@ public slots: · 27 unmodified lines
356358
357359 /**jsdoc
358360 * 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.
360362 * @function Window.makeConnection
361363 * @param {boolean} success - If <code>true</code> then {@link Window.connectionAdded|connectionAdded} is emitted, otherwise
362364 * {@link Window.connectionError|connectionError} is emitted.
@@ -416,7 +418,7 @@ public slots: · 53 unmodified lines
416418 * Set what to show on the PC display: normal view or entity camera view. The entity camera is configured using
417419 * {@link Camera.setCameraEntity} and {@link Camera|Camera.mode}.
418420 * @function Window.setDisplayTexture
419− * @param {Window.DisplayTexture} name - The view to display.
421+ * @param {Window.DisplayTexture} texture - The view to display.
420422 * @returns {boolean} <code>true</code> if the display texture was successfully set, otherwise <code>false</code>.
421423 */
422424 // See spectatorCamera.js for Valid parameter values.
@@ -445,17 +447,18 @@ public slots: · 22 unmodified lines
445447 bool setDisplayTexture(const QString& name);
446448
447449 /**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.
449452 * @function Window.isPointOnDesktopWindow
450− * @param {Vec2} point - The point to check in HMD display coordinates.
453+ * @param {Vec2} point - The point to check.
451454 * @returns {boolean} <code>true</code> if the point is within the window or HUD, otherwise <code>false</code>.
452455 */
453456 bool isPointOnDesktopWindow(QVariant point);
454457
455458 /**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.
457460 * @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.
459462 */
460463 glm::vec2 getDeviceSize() const;
461464
@@ -521,13 +524,19 @@ signals: · 59 unmodified lines
521524 * @function Window.domainChanged
522525 * @param {string} domain - The domain's IP address.
523526 * @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);
524533 */
525534 void domainChanged(const QString& domain);
526535
527536 /**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.
529538 * @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.
531540 * @returns {Signal}
532541 */
533542 void svoImportRequested(const QString& url);
@@ -543,7 +552,7 @@ signals: · 9 unmodified lines
543552 void domainConnectionRefused(const QString& reasonMessage, int reasonCode, const QString& extraInfo);
544553
545554 /**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
547556 * <code>includeAnimated = false</code>.
548557 * @function Window.stillSnapshotTaken
549558 * @param {string} pathStillSnapshot - The path and name of the snapshot image file.
@@ -611,7 +620,7 @@ signals: · 61 unmodified lines
611620 * Triggered when the user closes a message box that was opened with {@link Window.openMessageBox|openMessageBox}.
612621 * @function Window.messageBoxClosed
613622 * @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,
615624 * whether or not the Cancel button is displayed in the message box.
616625 * @returns {Signal}
617626 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t