Showing the changes to libraries/script-engine/src/qtscript/ScriptEngineQtScript.h (1 of 170 files). Show all
Unified · Split
| @@ -47,51 +47,51 @@ class ScriptEngineQtScript : public QScriptEngine, public ScriptEngine, public Q · 46 unmodified lines | |||
| 47 | public: // ScriptEngine implementation | 47 | public: // ScriptEngine implementation |
| 48 | virtual void abortEvaluation(); | 48 | virtual void abortEvaluation(); |
| 49 | virtual void clearExceptions(); | 49 | virtual void clearExceptions(); |
| 50 | virtual ScriptValuePointer cloneUncaughtException(const QString& detail = QString()); | 50 | virtual ScriptValue cloneUncaughtException(const QString& detail = QString()); |
| 51 | virtual ScriptContext* currentContext() const; | 51 | virtual ScriptContext* currentContext() const; |
| 52 | //virtual ScriptValuePointer evaluate(const QString& program, const QString& fileName = QString()); | 52 | //virtual ScriptValue evaluate(const QString& program, const QString& fileName = QString()); |
| 53 | //virtual ScriptValuePointer evaluate(const ScriptProgramPointer &program); | 53 | //virtual ScriptValue evaluate(const ScriptProgramPointer &program); |
| 54 | //virtual ScriptValuePointer evaluateInClosure(const ScriptValuePointer& locals, const ScriptProgramPointer& program); | 54 | //virtual ScriptValue evaluateInClosure(const ScriptValue& locals, const ScriptProgramPointer& program); |
| 55 | virtual ScriptValuePointer globalObject() const; | 55 | virtual ScriptValue globalObject() const; |
| 56 | virtual bool hasUncaughtException() const; | 56 | virtual bool hasUncaughtException() const; |
| 57 | virtual bool isEvaluating() const; | 57 | virtual bool isEvaluating() const; |
| 58 | virtual ScriptValuePointer lintScript(const QString& sourceCode, const QString& fileName, const int lineNumber = 1); | 58 | virtual ScriptValue lintScript(const QString& sourceCode, const QString& fileName, const int lineNumber = 1); |
| 59 | virtual ScriptValuePointer makeError(const ScriptValuePointer& other, const QString& type = "Error"); | 59 | virtual ScriptValue makeError(const ScriptValue& other, const QString& type = "Error"); |
| 60 | virtual ScriptManager* manager() const; | 60 | virtual ScriptManager* manager() const; |
| 61 | 61 | ||
| 62 | // if there is a pending exception and we are at the top level (non-recursive) stack frame, this emits and resets it | 62 | // if there is a pending exception and we are at the top level (non-recursive) stack frame, this emits and resets it |
| 63 | virtual bool maybeEmitUncaughtException(const QString& debugHint = QString()); | 63 | virtual bool maybeEmitUncaughtException(const QString& debugHint = QString()); |
| 64 | 64 | ||
| 65 | virtual ScriptValuePointer newArray(uint length = 0); | 65 | virtual ScriptValue newArray(uint length = 0); |
| 66 | virtual ScriptValuePointer newArrayBuffer(const QByteArray& message); | 66 | virtual ScriptValue newArrayBuffer(const QByteArray& message); |
| 67 | virtual ScriptValuePointer newFunction(ScriptEngine::FunctionSignature fun, int length = 0); | 67 | virtual ScriptValue newFunction(ScriptEngine::FunctionSignature fun, int length = 0); |
| 68 | virtual ScriptValuePointer newObject(); | 68 | virtual ScriptValue newObject(); |
| 69 | virtual ScriptProgramPointer newProgram(const QString& sourceCode, const QString& fileName); | 69 | virtual ScriptProgramPointer newProgram(const QString& sourceCode, const QString& fileName); |
| 70 | virtual ScriptValuePointer newQObject(QObject *object, ScriptEngine::ValueOwnership ownership = ScriptEngine::QtOwnership, | 70 | virtual ScriptValue newQObject(QObject *object, ScriptEngine::ValueOwnership ownership = ScriptEngine::QtOwnership, |
| 71 | const ScriptEngine::QObjectWrapOptions &options = ScriptEngine::QObjectWrapOptions()); | 71 | const ScriptEngine::QObjectWrapOptions &options = ScriptEngine::QObjectWrapOptions()); |
| 72 | virtual ScriptValuePointer newValue(bool value); | 72 | virtual ScriptValue newValue(bool value); |
| 73 | virtual ScriptValuePointer newValue(int value); | 73 | virtual ScriptValue newValue(int value); |
| 74 | virtual ScriptValuePointer newValue(uint value); | 74 | virtual ScriptValue newValue(uint value); |
| 75 | virtual ScriptValuePointer newValue(double value); | 75 | virtual ScriptValue newValue(double value); |
| 76 | virtual ScriptValuePointer newValue(const QString& value); | 76 | virtual ScriptValue newValue(const QString& value); |
| 77 | virtual ScriptValuePointer newValue(const QLatin1String& value); | 77 | virtual ScriptValue newValue(const QLatin1String& value); |
| 78 | virtual ScriptValuePointer newValue(const char* value); | 78 | virtual ScriptValue newValue(const char* value); |
| 79 | virtual ScriptValuePointer newVariant(const QVariant& value); | 79 | virtual ScriptValue newVariant(const QVariant& value); |
| 80 | virtual ScriptValuePointer nullValue(); | 80 | virtual ScriptValue nullValue(); |
| 81 | virtual bool raiseException(const ScriptValuePointer& exception); | 81 | virtual bool raiseException(const ScriptValue& exception); |
| 82 | //virtual void registerEnum(const QString& enumName, QMetaEnum newEnum); | 82 | //virtual void registerEnum(const QString& enumName, QMetaEnum newEnum); |
| 83 | //Q_INVOKABLE virtual void registerFunction(const QString& name, ScriptEngine::FunctionSignature fun, int numArguments = -1); | 83 | //Q_INVOKABLE virtual void registerFunction(const QString& name, ScriptEngine::FunctionSignature fun, int numArguments = -1); |
| 84 | //Q_INVOKABLE virtual void registerFunction(const QString& parent, const QString& name, ScriptEngine::FunctionSignature fun, int numArguments = -1); | 84 | //Q_INVOKABLE virtual void registerFunction(const QString& parent, const QString& name, ScriptEngine::FunctionSignature fun, int numArguments = -1); |
| 85 | //Q_INVOKABLE virtual void registerGetterSetter(const QString& name, ScriptEngine::FunctionSignature getter, ScriptEngine::FunctionSignature setter, const QString& parent = QString("")); | 85 | //Q_INVOKABLE virtual void registerGetterSetter(const QString& name, ScriptEngine::FunctionSignature getter, ScriptEngine::FunctionSignature setter, const QString& parent = QString("")); |
| 86 | //virtual void registerGlobalObject(const QString& name, QObject* object); | 86 | //virtual void registerGlobalObject(const QString& name, QObject* object); |
| 87 | virtual void setDefaultPrototype(int metaTypeId, const ScriptValuePointer& prototype); | 87 | virtual void setDefaultPrototype(int metaTypeId, const ScriptValue& prototype); |
| 88 | virtual void setObjectName(const QString& name); | 88 | virtual void setObjectName(const QString& name); |
| 89 | virtual bool setProperty(const char* name, const QVariant& value); | 89 | virtual bool setProperty(const char* name, const QVariant& value); |
| 90 | virtual void setProcessEventsInterval(int interval); | 90 | virtual void setProcessEventsInterval(int interval); |
| 91 | virtual QThread* thread() const; | 91 | virtual QThread* thread() const; |
| 92 | virtual void setThread(QThread* thread); | 92 | virtual void setThread(QThread* thread); |
| 93 | virtual ScriptValuePointer undefinedValue(); | 93 | virtual ScriptValue undefinedValue(); |
| 94 | virtual ScriptValuePointer uncaughtException() const; | 94 | virtual ScriptValue uncaughtException() const; |
| 95 | virtual QStringList uncaughtExceptionBacktrace() const; | 95 | virtual QStringList uncaughtExceptionBacktrace() const; |
| 96 | virtual int uncaughtExceptionLineNumber() const; | 96 | virtual int uncaughtExceptionLineNumber() const; |
| 97 | 97 | ||
| @@ -203,10 +203,10 @@ public: · 105 unmodified lines | |||
| 203 | * @deprecated This function is deprecated and will be removed. | 203 | * @deprecated This function is deprecated and will be removed. |
| 204 | */ | 204 | */ |
| 205 | /// evaluate some code in the context of the ScriptEngineQtScript and return the result | 205 | /// evaluate some code in the context of the ScriptEngineQtScript and return the result |
| 206 | Q_INVOKABLE virtual ScriptValuePointer evaluate(const QString& program, const QString& fileName); // this is also used by the script tool widget | 206 | Q_INVOKABLE virtual ScriptValue evaluate(const QString& program, const QString& fileName); // this is also used by the script tool widget |
| 207 | 207 | ||
| 208 | 208 | ||
| 209 | Q_INVOKABLE virtual ScriptValuePointer evaluate(const ScriptProgramPointer& program); | 209 | Q_INVOKABLE virtual ScriptValue evaluate(const ScriptProgramPointer& program); |
| 210 | 210 | ||
| 211 | /**jsdoc | 211 | /**jsdoc |
| 212 | * @function Script.evaluateInClosure | 212 | * @function Script.evaluateInClosure |
| @@ -215,7 +215,7 @@ public: · 2 unmodified lines | |||
| 215 | * @returns {object} Object. | 215 | * @returns {object} Object. |
| 216 | * @deprecated This function is deprecated and will be removed. | 216 | * @deprecated This function is deprecated and will be removed. |
| 217 | */ | 217 | */ |
| 218 | Q_INVOKABLE virtual ScriptValuePointer evaluateInClosure(const ScriptValuePointer& locals, const ScriptProgramPointer& program); | 218 | Q_INVOKABLE virtual ScriptValue evaluateInClosure(const ScriptValue& locals, const ScriptProgramPointer& program); |
| 219 | 219 | ||
| 220 | /**jsdoc | 220 | /**jsdoc |
| 221 | * Checks whether the application was compiled as a debug build. | 221 | * Checks whether the application was compiled as a debug build. |
| @@ -381,10 +381,10 @@ signals: · 159 unmodified lines | |||
| 381 | void entityScriptDetailsUpdated(); | 381 | void entityScriptDetailsUpdated(); |
| 382 | 382 | ||
| 383 | public: // not for public use, but I don't like how Qt strings this along with private friend functions | 383 | public: // not for public use, but I don't like how Qt strings this along with private friend functions |
| 384 | virtual ScriptValuePointer create(int type, const void* ptr); | 384 | virtual ScriptValue create(int type, const void* ptr); |
| 385 | virtual bool convert(const ScriptValuePointer& value, int type, void* ptr); | 385 | virtual bool convert(const ScriptValue& value, int type, void* ptr); |
| 386 | virtual void registerCustomType(int type, ScriptEngine::MarshalFunction marshalFunc, | 386 | virtual void registerCustomType(int type, ScriptEngine::MarshalFunction marshalFunc, |
| 387 | ScriptEngine::DemarshalFunction demarshalFunc, const ScriptValuePointer& prototype); | 387 | ScriptEngine::DemarshalFunction demarshalFunc, const ScriptValue& prototype); |
| 388 | 388 | ||
| 389 | protected: | 389 | protected: |
| 390 | // like `newFunction`, but allows mapping inline C++ lambdas with captures as callable QScriptValues | 390 | // like `newFunction`, but allows mapping inline C++ lambdas with captures as callable QScriptValues |
| @@ -408,8 +408,8 @@ protected: · 17 unmodified lines | |||
| 408 | QPointer<ScriptManager> _manager; | 408 | QPointer<ScriptManager> _manager; |
| 409 | 409 | ||
| 410 | int _nextCustomType = 0; | 410 | int _nextCustomType = 0; |
| 411 | ScriptValuePointer _nullValue; | 411 | ScriptValue _nullValue; |
| 412 | ScriptValuePointer _undefinedValue; | 412 | ScriptValue _undefinedValue; |
| 413 | mutable ScriptContextQtPointer _currContext; | 413 | mutable ScriptContextQtPointer _currContext; |
| 414 | 414 | ||
| 415 | std::atomic<bool> _isRunning { false }; | 415 | std::atomic<bool> _isRunning { false }; |