Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.
void hideScriptWidget ()
 Hide the script editor widget.
void showScriptInEditor (QString _code)
 Show the given Code in the script editor.
void slotLoadScript (QString _filename)
 Load Script into gui from file.
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 immediatly)

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 setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer.
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer.
virtual void updateView ()
 Update current view in Main Application.
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin.
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin.
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden.
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot.
- 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.
virtual void addMenubarAction (QAction *_action, QString _name)
 Adds an action to the menubar.
- Signals inherited from ScriptInterface
virtual void executeScript (QString _script)
virtual void executeFileScript (QString _filename)
virtual void getAvailableFunctions (QStringList &_functions)
virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
virtual void scriptInfo (QString _functionWithParameters)
 Emit this signal if a scriptable function is executed.
virtual void getScriptingEngine (QScriptEngine *&_engine)
- Signals inherited from RPCInterface
virtual void pluginExists (QString _pluginName, bool &_exists)
virtual void functionExists (QString _pluginName, QString _functionName, 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 ()
QString description ()

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.
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 Member Functions

QString mangleScript (QString _input)
- Private Member Functions inherited from BaseInterface
virtual ~BaseInterface ()
 Destructor.
virtual QString name ()=0
 Return a name for the plugin.
virtual QString description ()=0
 Return a description of what the plugin is doing.
- Private Member Functions inherited from MenuInterface
virtual ~MenuInterface ()
 Destructor.
- Private Member Functions inherited from ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
- Private Member Functions inherited from RPCInterface
virtual ~RPCInterface ()
 Destructor.
- 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_
QTime frameTime_
 Counts mseconds since a frame start has occured.
ScriptWidgetscriptWidget_
QStatusBar * statusBar_
HighlighterhighlighterCurrent_
HighlighterhighlighterLive_
HighlighterhighlighterList_
QString lastFile_
QAction * debuggerButton_

Detailed Description

Definition at line 66 of file ScriptingPlugin.hh.

Member Function Documentation

void ScriptingPlugin::hideScriptWidget ( )
slot

Hide the script editor widget.

Definition at line 321 of file ScriptingPlugin.cc.

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

Definition at line 82 of file ScriptingPlugin.cc.

void ScriptingPlugin::showScriptInEditor ( QString  _code)
slot

Show the given Code in the script editor.

Parameters
_codeCode to show

Definition at line 684 of file ScriptingPlugin.cc.

void ScriptingPlugin::showScriptWidget ( )
slot

Show the script editor widget.

Definition at line 263 of file ScriptingPlugin.cc.

void ScriptingPlugin::slotExecuteScript ( QString  _script)
privateslot

Switch scripting mode on

Switch scripting mode off

Definition at line 339 of file ScriptingPlugin.cc.

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 545 of file ScriptingPlugin.cc.

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 235 of file ScriptingPlugin.cc.

void ScriptingPlugin::waitContinue ( )
slot

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

Definition at line 493 of file ScriptingPlugin.cc.

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 512 of file ScriptingPlugin.cc.


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