Developer Documentation
ScriptingPlugin Class Reference
Inheritance diagram for ScriptingPlugin:
BaseInterface MenuInterface ScriptInterface RPCInterface LoggingInterface

Public Slots

QString version ()
 
Gui control from script
void showScriptWidget ()
 Show the script editor widget. More...
 
void hideScriptWidget ()
 Hide the script editor widget. More...
 
void showScriptInEditor (QString _code)
 Show the given Code in the script editor. More...
 
void slotLoadScript (QString _filename)
 Load Script into gui from file. More...
 
void clearEditor ()
 Clear the editor window Clears the script editor window.
 
Interrupt script execution
void waitContinue ()
 
void waitContinue (QString _msg, int _x=-1, int _y=-1)
 
void sleep (int _seconds)
 Sleeps for some seconds in script execution ( Gui will remain functional)
 
void sleepmsecs (int _mseconds)
 Sleeps for some mseconds in script execution ( Gui will remain functional)
 
void frameStart ()
 Marks the current time as the frame start ( Use wait sleepFrameLength to wait until _mseconds have passed since frameStart )
 
void waitFrameEnd (int _mseconds)
 wait until _mseconds have passed since frameStart (if more time has passed, it will return immediately)
 

Signals

void updateView ()
 
void getScriptingEngine (QScriptEngine *&_engine)
 
void getAvailableFunctions (QStringList &_functions)
 
void log (Logtype _type, QString _message)
 
void log (QString _message)
 
void getMenubarMenu (QString _name, QMenu *&_menu, bool _create)
 
void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 
- Signals inherited from BaseInterface
virtual void updateView ()
 Update current view in Main Application. More...
 
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot. More...
 
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer. More...
 
- Signals inherited from MenuInterface
virtual void getMenubarMenu (QString _name, QMenu *&_menu, bool _create)
 Get a existing top level menu pointer or create a new one. More...
 
- Signals inherited from ScriptInterface
virtual void scriptInfo (QString _functionWithParameters)
 Emit this signal if a scriptable function is executed. More...
 
virtual void getScriptingEngine (QScriptEngine *&_engine)
 
virtual void executeScript (QString _script)
 
virtual void getAvailableFunctions (QStringList &_functions)
 
- Signals inherited from RPCInterface
virtual void pluginExists (QString _pluginName, bool &_exists)
 
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 

Public Member Functions

QString name ()
 Return a name for the plugin. More...
 
QString description ()
 Return a description of what the plugin is doing. More...
 

Private Slots

void slotScriptInfo (QString _pluginName, QString _functionName)
 
void slotExecuteScript (QString _script)
 
void slotExecuteFileScript (QString _filename)
 
void slotLoadScript ()
 
void slotSaveScript ()
 
void slotSaveScriptAs ()
 
void pluginsInitialized ()
 
void noguiSupported ()
 
void slotExecuteScriptButton ()
 
void slotScriptChanged ()
 Called everytime the text in the scriptingwidget is changed by the user. More...
 
void slotFunctionClicked (QListWidgetItem *_item)
 
void slotFunctionDoubleClicked (QListWidgetItem *_item)
 
void slotApplyFilter ()
 
void slotHighlightError ()
 Called when an error is detected when checking the syntax.
 
void slotDebuggerButton ()
 Triggered by the debugger button.
 
- Private Slots inherited from BaseInterface
virtual void exit ()
 
virtual QString version ()
 Return a version string for your plugin. More...
 

Private Member Functions

QString mangleScript (QString _input)
 
- Private Member Functions inherited from BaseInterface
virtual void noguiSupported ()
 
virtual ~BaseInterface ()
 Destructor.
 
virtual void blockScenegraphUpdates (bool _block)
 Tell the core to prevent scenegraph updates. More...
 
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin. More...
 
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin. More...
 
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden. More...
 
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer. More...
 
- Private Member Functions inherited from MenuInterface
virtual ~MenuInterface ()
 Destructor.
 
virtual void addMenubarAction (QAction *_action, QString _name)
 Adds an action to the menubar. More...
 
virtual void addMenubarActions (std::vector< QAction *> &_actions, QString _name)
 Add multiple actions to the menu bar. More...
 
- Private Member Functions inherited from ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
 
virtual void executeFileScript (QString _filename)
 
virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 
- Private Member Functions inherited from RPCInterface
virtual ~RPCInterface ()
 Destructor.
 
virtual void functionExists (QString _pluginName, QString _functionName, bool &_exists)
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 

Private Attributes

int lastProblemLine_
 Store the last line that contained an error.
 
QString lastError_
 Store the last error message.
 
QTimer * errorTimer_
 Timer to wait until the user stopped typing before showing an error.
 
QList< QLabel *> descriptionLabels_
 
QVBoxLayout * descrLayout_
 
QElapsedTimer frameTime_
 Counts mseconds since a frame start has occured.
 
ScriptWidgetscriptWidget_
 
QStatusBar * statusBar_
 
HighlighterhighlighterCurrent_
 
HighlighterhighlighterLive_
 
HighlighterhighlighterList_
 
QString lastFile_
 
QString scriptPath_
 
QAction * debuggerButton_
 

Detailed Description

Definition at line 65 of file ScriptingPlugin.hh.

Member Function Documentation

◆ description()

QString ScriptingPlugin::description ( )
inlinevirtual

Return a description of what the plugin is doing.

This function has to return a basic description of the plugin

Implements BaseInterface.

Definition at line 108 of file ScriptingPlugin.hh.

◆ hideScriptWidget

void ScriptingPlugin::hideScriptWidget ( )
slot

Hide the script editor widget.

Definition at line 317 of file ScriptingPlugin.cc.

◆ name()

QString ScriptingPlugin::name ( )
inlinevirtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 107 of file ScriptingPlugin.hh.

◆ pluginsInitialized

void ScriptingPlugin::pluginsInitialized ( )
privateslot
Todo:
register objectid variable

Definition at line 72 of file ScriptingPlugin.cc.

◆ showScriptInEditor

void ScriptingPlugin::showScriptInEditor ( QString  _code)
slot

Show the given Code in the script editor.

Parameters
_codeCode to show

Definition at line 750 of file ScriptingPlugin.cc.

◆ showScriptWidget

void ScriptingPlugin::showScriptWidget ( )
slot

Show the script editor widget.

Definition at line 259 of file ScriptingPlugin.cc.

◆ slotExecuteScript

void ScriptingPlugin::slotExecuteScript ( QString  _script)
privateslot

Switch scripting mode on

Switch scripting mode off

Definition at line 335 of file ScriptingPlugin.cc.

◆ slotLoadScript

void ScriptingPlugin::slotLoadScript ( QString  _filename)
slot

Load Script into gui from file.

Loads a script from the given file and loads it into the widget.

Parameters
_filenameFilename of script to load, including full path.

Definition at line 602 of file ScriptingPlugin.cc.

◆ slotScriptChanged

void ScriptingPlugin::slotScriptChanged ( )
privateslot

Called everytime the text in the scriptingwidget is changed by the user.

This slot also handles syntax checking!

Definition at line 231 of file ScriptingPlugin.cc.

◆ waitContinue [1/2]

void ScriptingPlugin::waitContinue ( )
slot

Stops script execution and opens a message windows. Execution continues, when the user clicks on a button

Definition at line 544 of file ScriptingPlugin.cc.

◆ waitContinue [2/2]

void ScriptingPlugin::waitContinue ( QString  _msg,
int  _x = -1,
int  _y = -1 
)
slot

Stops script execution and opens a message windows. Execution continues, when the user clicks on a button Also allowing the user to set a message

Definition at line 563 of file ScriptingPlugin.cc.

Member Data Documentation

◆ scriptPath_

QString ScriptingPlugin::scriptPath_
private

Path to the directory where the current script is executed. This might be empty, if a script is not saved!

Definition at line 237 of file ScriptingPlugin.hh.


The documentation for this class was generated from the following files: