SciDAVis
1.D4
|
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. | |
void | decref () |
Decrease the reference count. This should only be called by scripted and Script to avoid segfaults. | |
void | incref () |
Increase the reference count. This should only be called by scripted and Script to avoid memory leaks. | |
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. | |
virtual void | stopExecution () |
If the implementation supports asynchronuos execution, deactivate it. |
Signals | |
void | error (const QString &message, const QString &scriptName, int lineNumber) |
signal an error condition / exception | |
void | print (const QString &output) |
output that is not handled by a Script |
Public Member Functions | |
virtual const QStringList | fileExtensions () const |
Return a list of file extensions commonly used for this language. | |
const QString | fileFilter () const |
Construct a filter expression from fileExtension(), suitable for QFileDialog. | |
virtual bool | initialize () |
Part of the initialization is deferred from the constructor until after the signals have been connected. | |
bool | initialized () const |
initialization of the interpreter may fail; or there could be other errors setting up the environment | |
virtual bool | isRunning () const |
whether asynchronuous execution is enabled (if supported by the implementation) | |
virtual const QString | mathFunctionDoc (const QString &) const |
Return a documentation string for the given mathematical function. | |
virtual const QStringList | mathFunctions () const |
Return a list of supported mathematical functions. These should be imported into the global namespace. | |
virtual Script * | newScript (const QString &, QObject *, const QString &) |
Instantiate the Script subclass matching the ScriptEnv subclass. | |
ScriptingEnv (ApplicationWindow *parent, const char *langName) | |
virtual QString | stackTraceString () |
If an exception / error occured, return a nicely formated stack backtrace. |
Protected Attributes | |
bool | d_initialized |
whether the interpreter has been successfully initialized | |
ApplicationWindow * | d_parent |
the context in which we are running |
Private Attributes | |
int | d_refcount |
the reference counter |
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.
|
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 scripted::scriptingChangeEvent(), Script::~Script(), and scripted::~scripted().
|
signal |
signal an error condition / exception
|
inlinevirtual |
Return a list of file extensions commonly used for this language.
Reimplemented in PythonScripting.
Referenced by fileFilter().
const QString ScriptingEnv::fileFilter | ( | ) | const |
Construct a filter expression from fileExtension(), suitable for QFileDialog.
References fileExtensions().
Referenced by ScriptEdit::exportASCII(), 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(), and scripted::scriptingChangeEvent().
|
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::setScriptingLang().
|
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(), Table::updateFunctionDoc(), and Matrix::updateFunctionDoc().
|
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(), Table::init(), Matrix::init(), and ScriptEdit::insertFunction().
|
inlinevirtual |
Instantiate the Script subclass matching the ScriptEnv subclass.
Reimplemented in PythonScripting, and MuParserScripting.
Referenced by ScriptEdit::customEvent(), Fit::fit(), FunctionCurve::loadData(), Matrix::recalculate(), Table::recalculate(), ScriptEdit::ScriptEdit(), and Matrix::setText().
|
signal |
output that is not handled by a Script
Referenced by 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 |
If the implementation supports asynchronuos execution, activate it.
|
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 PythonScripting::PythonScripting().
|
private |
the reference counter
Referenced by decref(), incref(), and ScriptingEnv().