Render API JSDoc stubs

This commit is contained in:
David Rowe 2018-05-13 11:53:57 +12:00
parent 176dbb5557
commit 7cef329939
2 changed files with 49 additions and 2 deletions

View file

@ -104,8 +104,17 @@ public:
virtual void setPresetList(const QJsonObject& object);
/**jsdoc
* @function Render.toJSON
* @returns {string}
*/
// This must be named toJSON to integrate with the global scripting JSON object
Q_INVOKABLE QString toJSON() { return QJsonDocument(toJsonValue(*this).toObject()).toJson(QJsonDocument::Compact); }
/**jsdoc
* @function Render.load
* @param {object} map
*/
Q_INVOKABLE void load(const QVariantMap& map) { qObjectFromJsonValue(QJsonObject::fromVariantMap(map), *this); emit loaded(); }
// Running Time measurement
@ -114,11 +123,31 @@ public:
double getCPURunTime() const { return _msCPURunTime; }
public slots:
/**jsdoc
* @function Render.load
* @param {object} map
*/
void load(const QJsonObject& val) { qObjectFromJsonValue(val, *this); emit loaded(); }
signals:
/**jsdoc
* @function Render.loaded
* @returns {Signal}
*/
void loaded();
/**jsdoc
* @function Render.newStats
* @returns {Signal}
*/
void newStats();
/**jsdoc
* @function Render.dirtyEnabled
* @returns {Signal}
*/
void dirtyEnabled();
};
@ -127,6 +156,16 @@ public:
using Config = JobConfig;
};
/**jsdoc
* @namespace Render
*
* @hifi-interface
* @hifi-client-entity
*
* @property {number} cpuRunTime - <em>Read-only.</em>
* @property {boolean} enabled
*/
class TaskConfig : public JobConfig {
Q_OBJECT
public:
@ -137,8 +176,11 @@ public:
TaskConfig() = default ;
TaskConfig(bool enabled) : JobConfig(enabled) {}
/**jsdoc
* @function Render.getConfig
* @param {string} name
* @returns {object}
*/
// Get a sub job config through task.getConfig(path)
// where path can be:
// - <job_name> search for the first job named job_name traversing the the sub graph of task and jobs (from this task as root)
@ -176,6 +218,10 @@ public:
JobConcept* _task;
public slots:
/**jsdoc
* @function Render.refresh
*/
void refresh();
};

View file

@ -57,6 +57,7 @@ exports.handlers = {
'../../libraries/script-engine/src',
'../../libraries/shared/src',
'../../libraries/shared/src/shared',
'../../libraries/task/src/task',
'../../libraries/trackers/src/trackers',
'../../libraries/ui/src',
'../../libraries/ui/src/ui',