Changeset View
Changeset View
Standalone View
Standalone View
scripting/scripting.h
Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Line(s) | |||||
224 | public: | 224 | public: | ||
225 | 225 | | |||
226 | Script(int id, QString scriptName, QString pluginName, QObject *parent = nullptr); | 226 | Script(int id, QString scriptName, QString pluginName, QObject *parent = nullptr); | ||
227 | virtual ~Script(); | 227 | virtual ~Script(); | ||
228 | QScriptEngine *engine() { | 228 | QScriptEngine *engine() { | ||
229 | return m_engine; | 229 | return m_engine; | ||
230 | } | 230 | } | ||
231 | 231 | | |||
232 | bool registerTouchScreenCallback(int edge, QScriptValue callback); | ||||
233 | bool unregisterTouchScreenCallback(int edge); | ||||
234 | | ||||
232 | public Q_SLOTS: | 235 | public Q_SLOTS: | ||
233 | Q_SCRIPTABLE void run(); | 236 | Q_SCRIPTABLE void run(); | ||
234 | 237 | | |||
235 | Q_SIGNALS: | 238 | Q_SIGNALS: | ||
236 | Q_SCRIPTABLE void printError(const QString &text); | 239 | Q_SCRIPTABLE void printError(const QString &text); | ||
237 | 240 | | |||
238 | private Q_SLOTS: | 241 | private Q_SLOTS: | ||
239 | /** | 242 | /** | ||
Show All 11 Lines | 252 | private: | |||
251 | /** | 254 | /** | ||
252 | * Read the script from file into a byte array. | 255 | * Read the script from file into a byte array. | ||
253 | * If file cannot be read an empty byte array is returned. | 256 | * If file cannot be read an empty byte array is returned. | ||
254 | **/ | 257 | **/ | ||
255 | QByteArray loadScriptFromFile(); | 258 | QByteArray loadScriptFromFile(); | ||
256 | QScriptEngine *m_engine; | 259 | QScriptEngine *m_engine; | ||
257 | bool m_starting; | 260 | bool m_starting; | ||
258 | QScopedPointer<ScriptUnloaderAgent> m_agent; | 261 | QScopedPointer<ScriptUnloaderAgent> m_agent; | ||
262 | QHash<int, QAction*> m_touchScreenEdgeCallbacks; | ||||
259 | }; | 263 | }; | ||
260 | 264 | | |||
261 | class ScriptUnloaderAgent : public QScriptEngineAgent | 265 | class ScriptUnloaderAgent : public QScriptEngineAgent | ||
262 | { | 266 | { | ||
263 | public: | 267 | public: | ||
264 | explicit ScriptUnloaderAgent(Script *script); | 268 | explicit ScriptUnloaderAgent(Script *script); | ||
265 | virtual void scriptUnload(qint64 id); | 269 | virtual void scriptUnload(qint64 id); | ||
266 | 270 | | |||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |