QtiPlot
0.9.8.2
|
An interpreter for evaluating scripting code. Abstract. More...
#include <ScriptingEnv.h>
Public Slots | |
virtual void | clear () |
Clear the global environment. What exactly happens depends on the implementation. More... | |
void | decref () |
Decrease the reference count. This should only be called by scripted and Script to avoid segfaults. More... | |
void | incref () |
Increase the reference count. This should only be called by scripted and Script to avoid memory leaks. More... | |
virtual bool | setDouble (double, const char *) |
virtual bool | setInt (int, const char *) |
virtual bool | setQObject (QObject *, const char *) |
virtual void | startExecution () |
If the implementation supports asynchronuos execution, activate it. More... | |
virtual void | stopExecution () |
If the implementation supports asynchronuos execution, deactivate it. More... | |
Signals | |
void | error (const QString &message, const QString &scriptName, int lineNumber) |
signal an error condition / exception More... | |
void | print (const QString &output) |
output that is not handled by a Script More... | |
Public Member Functions | |
ApplicationWindow * | application () |
virtual const QStringList | fileExtensions () const |
Return a list of file extensions commonly used for this language. More... | |
const QString | fileFilter () const |
Construct a filter expression from fileExtension(), suitable for QFileDialog. More... | |
virtual bool | initialize () |
Part of the initialization is deferred from the constructor until after the signals have been connected. More... | |
bool | initialized () const |
initialization of the interpreter may fail; or there could be other errors setting up the environment More... | |
virtual bool | isRunning () const |
whether asynchronuous execution is enabled (if supported by the implementation) More... | |
virtual const QString | mathFunctionDoc (const QString &) const |
Return a documentation string for the given mathematical function. More... | |
virtual const QStringList | mathFunctions () const |
Return a list of supported mathematical functions. These should be imported into the global namespace. More... | |
virtual Script * | newScript (const QString &, QObject *, const QString &) |
Instantiate the Script subclass matching the ScriptEnv subclass. More... | |
ScriptingEnv (ApplicationWindow *parent, const char *langName) | |
virtual QString | stackTraceString () |
If an exception / error occured, return a nicely formated stack backtrace. More... | |
Protected Attributes | |
bool | d_initialized |
whether the interpreter has been successfully initialized More... | |
ApplicationWindow * | d_parent |
the context in which we are running More... | |
Private Attributes | |
int | d_refcount |
the reference counter More... | |
An interpreter for evaluating scripting code. Abstract.
ScriptingEnv objects represent a running interpreter, possibly with global variables, and are responsible for generating Script objects (which do the actual evaluation of code).
ScriptingEnv::ScriptingEnv | ( | ApplicationWindow * | parent, |
const char * | langName | ||
) |
References d_initialized, and d_refcount.
|
inline |
|
inlinevirtualslot |
Clear the global environment. What exactly happens depends on the implementation.
|
slot |
Decrease the reference count. This should only be called by scripted and Script to avoid segfaults.
References d_refcount.
Referenced by startExecution(), PythonScripting::write(), and Script::~Script().
|
signal |
signal an error condition / exception
Referenced by startExecution().
|
inlinevirtual |
Return a list of file extensions commonly used for this language.
Reimplemented in PythonScripting.
References fileFilter().
Referenced by fileFilter().
const QString ScriptingEnv::fileFilter | ( | ) | const |
Construct a filter expression from fileExtension(), suitable for QFileDialog.
References fileExtensions().
Referenced by ScriptEdit::exportASCII(), fileExtensions(), and ScriptEdit::importASCII().
|
slot |
Increase the reference count. This should only be called by scripted and Script to avoid memory leaks.
References d_refcount.
Referenced by Script::Script(), scripted::scripted(), scripted::scriptingChangeEvent(), and startExecution().
|
inlinevirtual |
Part of the initialization is deferred from the constructor until after the signals have been connected.
Reimplemented in PythonScripting.
Referenced by ApplicationWindow::init(), and ApplicationWindow::setScriptingLanguage().
|
inline |
initialization of the interpreter may fail; or there could be other errors setting up the environment
References d_initialized.
Referenced by PythonScripting::initialize().
|
inlinevirtual |
whether asynchronuous execution is enabled (if supported by the implementation)
Reimplemented in PythonScripting, and muParserScripting.
|
inlinevirtual |
Return a documentation string for the given mathematical function.
Reimplemented in PythonScripting, and muParserScripting.
Referenced by ScriptEdit::contextMenuEvent(), MatrixValuesDialog::insertExplain(), and SetColValuesDialog::insertExplain().
|
inlinevirtual |
Return a list of supported mathematical functions. These should be imported into the global namespace.
Reimplemented in PythonScripting, and muParserScripting.
Referenced by ScriptEdit::contextMenuEvent(), ApplicationWindow::initCompleter(), ScriptEdit::insertFunction(), and MatrixValuesDialog::MatrixValuesDialog().
|
inlinevirtual |
Instantiate the Script subclass matching the ScriptEnv subclass.
Reimplemented in PythonScripting, and muParserScripting.
Referenced by MatrixModel::calculate(), Table::calculate(), Matrix::canCalculate(), Table::cellEdited(), ScriptEdit::customEvent(), and ScriptEdit::ScriptEdit().
|
signal |
output that is not handled by a Script
Referenced by startExecution(), and PythonScripting::write().
|
inlinevirtualslot |
Reimplemented in muParserScripting.
|
inlinevirtualslot |
Reimplemented in muParserScripting.
|
inlinevirtualslot |
Reimplemented in PythonScripting, and muParserScripting.
|
inlinevirtual |
If an exception / error occured, return a nicely formated stack backtrace.
|
inlinevirtualslot |
|
inlinevirtualslot |
If the implementation supports asynchronuos execution, deactivate it.
|
protected |
whether the interpreter has been successfully initialized
Referenced by PythonScripting::initialize(), initialized(), muParserScripting::muParserScripting(), PythonScripting::PythonScripting(), and ScriptingEnv().
|
protected |
the context in which we are running
Referenced by application(), PythonScripting::initialize(), and PythonScripting::PythonScripting().
|
private |
the reference counter
Referenced by decref(), incref(), and ScriptingEnv().