From 4ce2c39d0a550d27f4418543b57e7eab2429453c Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 17 May 2019 21:34:36 +1200 Subject: [PATCH 1/2] Revise display plugin JSDoc in the Window API --- .../src/scripting/WindowScriptingInterface.h | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index dd3f01dd17..de2441ae62 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -559,39 +559,47 @@ public slots: float domainLoadingProgress(); /**jsdoc - * Return the number of display plugins currently available + * Gets the number of display plugins currently available. * @function Window.getDisplayPluginCount - * @returns {int} The number of currently available display plugins + * @returns {number} The number of display plugins currently available. */ int getDisplayPluginCount(); /**jsdoc - * Return the human readable name of a display plugin + * Gets the name of a display plugin. * @function Window.getDisplayPluginName - * @param {int} index - The index of the display plugin. Must be less than the value returned by {@link Window.getDisplayPluginCount|getDisplayPluginCount}. - * @returns {string} The name of the specified display plugin + * @param {number} index - The index of the display plugin. Must be less than the value returned by + * {@link Window.getDisplayPluginCount|getDisplayPluginCount}. The first display plugin has an index of 0. + * @returns {string} The name of the display plugin. + * @example Print the names of all available display plugins. + * for (var i = 0, length = Window.getDisplayPluginCount(); i < length; i++) { + * print(Window.getDisplayPluginName(i)); + * } */ QString getDisplayPluginName(int index); /**jsdoc - * Return whether a given display plugin is an HMD + * Checks whether a display plugin is an HMD. * @function Window.isDisplayPluginHmd - * @param {int} index - The index of the display plugin. Must be less than the value returned by {@link Window.getDisplayPluginCount|getDisplayPluginCount}. - * @returns {bool} True if the specified display plugin is a HMD + * @param {number} index - The index of the display plugin. Must be less than the value returned by + * {@link Window.getDisplayPluginCount|getDisplayPluginCount}. The first display plugin has an index of 0. + * @returns {boolean} true if the display plugin is a HMD, false if it isn't. */ bool isDisplayPluginHmd(int index); /**jsdoc - * Return the currently active display plugin + * Gets the index of the currently active display plugin. * @function Window.getActiveDisplayPlugin - * @returns {int} The index of the currently active display plugin + * @returns {number} The index of the currently active display plugin. The first display plugin has an index of + * 0. */ int getActiveDisplayPlugin(); /**jsdoc - * Return the currently active display plugin + * Sets the currently active display plugin. * @function Window.setActiveDisplayPlugin - * @param {int} index - The index of the display plugin. Must be less than the value returned by {@link Window.getDisplayPluginCount|getDisplayPluginCount}. + * @param {number} index - The index of the display plugin. Must be less than the value returned by + * {@link Window.getDisplayPluginCount|getDisplayPluginCount}. The first display plugin has an index of 0. */ void setActiveDisplayPlugin(int index); From 82fb99053db041169e37801faf4a0be4c3af4e17 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 17 May 2019 21:35:50 +1200 Subject: [PATCH 2/2] Fix JSDoc typo noticed in passing --- libraries/networking/src/MessagesClient.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/networking/src/MessagesClient.h b/libraries/networking/src/MessagesClient.h index f3f9387566..b97c6d8360 100644 --- a/libraries/networking/src/MessagesClient.h +++ b/libraries/networking/src/MessagesClient.h @@ -147,7 +147,7 @@ public: /**jsdoc * Subscribes the scripting environment — Interface, the entity script server, or assignment client instance — - * to receive messages on a specific channel.This means, for example, that if there are two Interface scripts that + * to receive messages on a specific channel. This means, for example, that if there are two Interface scripts that * subscribe to different channels, both scripts will receive messages on both channels. * @function Messages.subscribe * @param {string} channel - The channel to subscribe to.