Showing the changes to libraries/script-engine/src/ScriptEngine.h (1 of 4 files). Show all
Unified · Split
| @@ -70,6 +70,9 @@ public: · 69 unmodified lines | ||
| 70 | 70 | |
| 71 | 71 | ~ScriptEngine(); |
| 72 | 72 | |
| 73 | + // Useful for QSharePointer<ScriptEngine> | |
| 74 | + static void doDeleteLater(ScriptEngine* obj) { obj->deleteLater(); } | |
| 75 | + | |
| 73 | 76 | /// run the script in a dedicated thread. This will have the side effect of evalulating |
| 74 | 77 | /// the current script contents and calling run(). Callers will likely want to register the script with external |
| 75 | 78 | /// services before calling this. |
| @@ -124,7 +127,10 @@ public: · 48 unmodified lines | ||
| 124 | 127 | Q_INVOKABLE QUrl resolvePath(const QString& path) const; |
| 125 | 128 | |
| 126 | 129 | // Entity Script Related methods |
| 127 | − Q_INVOKABLE void loadEntityScript(const EntityItemID& entityID, const QString& entityScript, bool forceRedownload = false); // will call the preload method once loaded | |
| 130 | + //Q_INVOKABLE void loadEntityScript(const EntityItemID& entityID, const QString& entityScript, bool forceRedownload = false); // will call the preload method once loaded | |
| 131 | + | |
| 132 | + static void loadEntityScript(QWeakPointer<ScriptEngine> theEngine, const EntityItemID& entityID, const QString& entityScript, bool forceRedownload); | |
| 133 | + | |
| 128 | 134 | Q_INVOKABLE void unloadEntityScript(const EntityItemID& entityID); // will call unload method |
| 129 | 135 | Q_INVOKABLE void unloadAllEntityScripts(); |
| 130 | 136 | Q_INVOKABLE void callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const QStringList& params = QStringList()); |
| @@ -224,4 +230,11 @@ protected: · 93 unmodified lines | ||
| 224 | 230 | static std::atomic<bool> _stoppingAllScripts; |
| 225 | 231 | }; |
| 226 | 232 | |
| 233 | +/* | |
| 234 | +class ScriptEngine : public QObject { | |
| 235 | + Q_OBJECT | |
| 236 | +}; | |
| 237 | +*/ | |
| 238 | + | |
| 239 | + | |
| 227 | 240 | #endif // hifi_ScriptEngine_h |