StelScriptMgr.hpp   StelScriptMgr.hpp 
skipping to change at line 29 skipping to change at line 29
#ifndef _STELSCRIPTMGR_HPP_ #ifndef _STELSCRIPTMGR_HPP_
#define _STELSCRIPTMGR_HPP_ #define _STELSCRIPTMGR_HPP_
#include <QObject> #include <QObject>
#include <QtScript> #include <QtScript>
#include <QStringList> #include <QStringList>
#include <QFile> #include <QFile>
#include <QTime> #include <QTime>
#include <QTimer> #include <QTimer>
#include <QScriptEngineAgent>
class StelMainScriptAPI; class StelMainScriptAPI;
class StelScriptEngineAgent;
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
class ScriptConsole; class ScriptConsole;
#endif #endif
//! Manage scripting in Stellarium //! Manage scripting in Stellarium
class StelScriptMgr : public QObject class StelScriptMgr : public QObject
{ {
Q_OBJECT Q_OBJECT
skipping to change at line 122 skipping to change at line 124
void setScriptRate(float r); void setScriptRate(float r);
//! Get the rate at which the script is running as a multiple of the normal //! Get the rate at which the script is running as a multiple of the normal
//! execution rate. //! execution rate.
double getScriptRate(); double getScriptRate();
//! cause the emission of the scriptDebug signal. This is so that f unctions in //! cause the emission of the scriptDebug signal. This is so that f unctions in
//! StelMainScriptAPI can explicitly send information to the ScriptC onsole //! StelMainScriptAPI can explicitly send information to the ScriptC onsole
void debug(const QString& msg); void debug(const QString& msg);
//! Pause a running script.
void pauseScript();
//! Resume a paused script.
void resumeScript();
private slots: private slots:
//! Called at the end of the running threa //! Called at the end of the running threa
void scriptEnded(); void scriptEnded();
signals: signals:
//! Notification when a script starts running //! Notification when a script starts running
void scriptRunning(); void scriptRunning();
//! Notification when a script has stopped running //! Notification when a script has stopped running
void scriptStopped(); void scriptStopped();
//! Notification of a script event - warnings, current execution lin e etc. //! Notification of a script event - warnings, current execution lin e etc.
void scriptDebug(const QString&); void scriptDebug(const QString&);
private: private:
// Utility functions for preprocessor // Utility functions for preprocessor
skipping to change at line 159 skipping to change at line 166
//! @return the text following the id and : on a comment line near t he top of //! @return the text following the id and : on a comment line near t he top of
//! the script file (i.e. before there is a non-comment line). //! the script file (i.e. before there is a non-comment line).
const QString getHeaderSingleLineCommentText(const QString& s, const QString& id, const QString& notFoundText=""); const QString getHeaderSingleLineCommentText(const QString& s, const QString& id, const QString& notFoundText="");
QScriptEngine engine; QScriptEngine engine;
//! The thread in which scripts are run //! The thread in which scripts are run
StelMainScriptAPI *mainAPI; StelMainScriptAPI *mainAPI;
QString scriptFileName; QString scriptFileName;
//Script engine agent
StelScriptEngineAgent *agent;
};
class StelScriptEngineAgent : public QScriptEngineAgent
{
public:
explicit StelScriptEngineAgent(QScriptEngine *engine);
virtual ~StelScriptEngineAgent() {}
void setPauseScript(bool pause) { isPaused=pause; }
bool getPauseScript() { return isPaused; }
void positionChange(qint64 scriptId, int lineNumber, int columnNumbe
r);
private:
bool isPaused;
}; };
#endif // _STELSCRIPTMGR_HPP_ #endif // _STELSCRIPTMGR_HPP_
 End of changes. 5 change blocks. 
1 lines changed or deleted 28 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/