mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-09 19:12:36 +02:00
Update InteractiveWindow JSDoc per changes in master
This commit is contained in:
parent
414f27208d
commit
302e876857
3 changed files with 56 additions and 6 deletions
|
@ -22,6 +22,29 @@
|
|||
#include <DependencyManager.h>
|
||||
#include <OffscreenUi.h>
|
||||
|
||||
/**jsdoc
|
||||
* The possible docking locations of an <code>InteractiveWindow</code>.
|
||||
* @typedef {object} InteractiveWindow.DockAreas
|
||||
* @property {InteractiveWindow.DockArea} TOP - Dock to the top edge of the Interface window.
|
||||
* @property {InteractiveWindow.DockArea} BOTTOM - Dock to the bottom edge of the Interface window.
|
||||
* @property {InteractiveWindow.DockArea} LEFT - Dock to the left edge of the Interface window.
|
||||
* @property {InteractiveWindow.DockArea} RIGHT - Dock to the right edge of the Interface window.
|
||||
*/
|
||||
/**jsdoc
|
||||
* A docking location of an <code>InteractiveWindow</code>.
|
||||
* <table>
|
||||
* <thead>
|
||||
* <tr><th>Value</th><th>Name</p><th>Description</th>
|
||||
* </thead>
|
||||
* <tbody>
|
||||
* <tr><td><code>0</code></td><td>TOP</td><td>Dock to the top edge of the Interface window.</td></tr>
|
||||
* <tr><td><code>1</code></td><td>BOTTOM</td><td>Dock to the bottom edge of the Interface window.</td></tr>
|
||||
* <tr><td><code>2</code></td><td>LEFT</td><td>Dock to the left edge of the Interface window.</td></tr>
|
||||
* <tr><td><code>3</code></td><td>RIGHT</td><td>Dock to the right edge of the Interface window.</td></tr>
|
||||
* <tbody>
|
||||
* </table>
|
||||
* @typedef {number} InteractiveWindow.DockArea
|
||||
*/
|
||||
static const QVariantMap DOCK_AREA {
|
||||
{ "TOP", DockArea::TOP },
|
||||
{ "BOTTOM", DockArea::BOTTOM },
|
||||
|
@ -39,11 +62,27 @@ int DesktopScriptingInterface::getHeight() {
|
|||
}
|
||||
|
||||
/**jsdoc
|
||||
* The presentation mode specifies how an {@link InteractiveWindow} is displayed.
|
||||
* @typedef {object} InteractiveWindow.PresentationMode
|
||||
* @property {number} VIRTUAL - The window is displayed inside Interface: in the desktop window in desktop mode or on the HUD
|
||||
* surface in HMD mode.
|
||||
* @property {number} NATIVE - The window is displayed separately from the Interface window, as its own separate window.
|
||||
* The possible display modes for an <code>InteractiveWindow</code>.
|
||||
* @typedef {object} InteractiveWindow.PresentationModes
|
||||
* @property {InteractiveWindow.PresentationMode} VIRTUAL - The window is displayed inside Interface: in the desktop window in
|
||||
* desktop mode or on the HUD surface in HMD mode.
|
||||
* @property {InteractiveWindow.PresentationMode} NATIVE - The window is displayed separately from the Interface window, as its
|
||||
* own separate window.
|
||||
*/
|
||||
/**jsdoc
|
||||
* A display mode for an <code>InteractiveWindow</code>.
|
||||
* <table>
|
||||
* <thead>
|
||||
* <tr><th>Value</th><th>Name</p><th>Description</th>
|
||||
* </thead>
|
||||
* <tbody>
|
||||
* <tr><td><code>0</code></td><td>VIRTUAL</td><td>The window is displayed inside Interface: in the desktop window in
|
||||
* desktop mode or on the HUD surface in HMD mode.</td></tr>
|
||||
* <tr><td><code>1</code></td><td>NATIVE</td><td>The window is displayed separately from the Interface window, as its
|
||||
* own separate window.</td></tr>
|
||||
* <tbody>
|
||||
* </table>
|
||||
* @typedef {number} InteractiveWindow.PresentationMode
|
||||
*/
|
||||
QVariantMap DesktopScriptingInterface::getPresentationMode() {
|
||||
static QVariantMap presentationModes {
|
||||
|
|
|
@ -37,8 +37,11 @@
|
|||
* top. <em>Read-only.</em>
|
||||
* @property {InteractiveWindow.Flags} CLOSE_BUTTON_HIDES - A flag value that makes an {@link InteractiveWindow} hide instead
|
||||
* of closing when the user clicks the "close" button.<em> Read-only.</em>
|
||||
* @property {InteractiveWindow.PresentationMode} PresentationMode - The different display options for an
|
||||
* @property {InteractiveWindow.PresentationModes} PresentationMode - The possible display options for an
|
||||
* {@link InteractiveWindow}: display inside Interface or in a separate desktop window. <em>Read-only.</em>
|
||||
* @property {InteractiveWindow.DockAreas} DockArea - The possible docking locations of an {@link InteractiveWindow}: top,
|
||||
* bottom, left, or right of the Interface window.
|
||||
* <em>Read-only.</em>
|
||||
*/
|
||||
class DesktopScriptingInterface : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
|
|
|
@ -79,6 +79,9 @@ void interactiveWindowPointerFromScriptValue(const QScriptValue& object, Interac
|
|||
* @property {InteractiveWindow.PresentationMode} [presentationMode=Desktop.PresentationMode.VIRTUAL] -
|
||||
* <code>Desktop.PresentationMode.VIRTUAL</code> to display the window inside Interface, <code>.NATIVE</code> to display it
|
||||
* as its own separate window.
|
||||
* @property {InteractiveWindow.PresentationWindowInfo} [presentationWindowInfo] - Controls how a <code>NATIVE</code> window is
|
||||
* displayed. If used, the window is docked to the specified edge of the Interface window, otherwise the window is
|
||||
* displayed as its own separate window.
|
||||
* @property {InteractiveWindow.Flags} [flags=0] - Window behavior flags, set at window creation. Possible flag values are
|
||||
* provided as {@link Desktop|Desktop.ALWAYS_ON_TOP} and {@link Desktop|Desktop.CLOSE_BUTTON_HIDES}.
|
||||
*/
|
||||
|
@ -107,6 +110,11 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
|||
auto mainWindow = qApp->getWindow();
|
||||
_dockWidget = std::shared_ptr<DockWidget>(new DockWidget(title, mainWindow), dockWidgetDeleter);
|
||||
|
||||
/**jsdoc
|
||||
* Configures how a <code>NATIVE</code> window is displayed.
|
||||
* @typedef {object} InteractiveWindow.PresentationWindowInfo
|
||||
* @property {InteractiveWindow.DockArea} dockArea - The edge of the Interface window to dock to.
|
||||
*/
|
||||
if (nativeWindowInfo.contains(DOCK_AREA_PROPERTY)) {
|
||||
DockArea dockedArea = (DockArea) nativeWindowInfo[DOCK_AREA_PROPERTY].toInt();
|
||||
switch (dockedArea) {
|
||||
|
|
Loading…
Reference in a new issue