scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ScriptingEnv.cpp
Go to the documentation of this file.
1 
11 
29 #include "ScriptingEnv.h"
30 #include "Script.h"
31 
32 #include <string.h>
33 
34 #ifdef SCRIPTING_MUPARSER
35 #include "MuParserScript.h"
36 #include "MuParserScripting.h"
37 #endif
38 #ifdef SCRIPTING_PYTHON
39 #include "PythonScript.h"
40 #include "PythonScripting.h"
41 #endif
42 
43  ScriptingEnv::ScriptingEnv(ApplicationWindow *parent, const char *langName)
44 : QObject(0), d_parent(parent)
45 {
46  setObjectName(langName);
47  d_initialized=false;
48  d_refcount=0;
49 }
50 
51 const QString ScriptingEnv::fileFilter() const
52 {
53  QStringList extensions = fileExtensions();
54  if (extensions.isEmpty())
55  return "";
56  else
57  return tr("%1 Source (*.%2);;").arg(objectName()).arg(extensions.join(" *."));
58 }
59 
61 {
62  d_refcount++;
63 }
64 
66 {
67  d_refcount--;
68  if (d_refcount==0)
69  delete this;
70 }
71 
ScriptingEnv.h
ScriptingEnv::incref
void incref()
Increase the reference count. This should only be called by scripted and Script to avoid memory leaks...
Definition: ScriptingEnv.cpp:60
ScriptingEnv::fileExtensions
virtual const QStringList fileExtensions() const
Return a list of file extensions commonly used for this language.
Definition: ScriptingEnv.h:76
MuParserScript.h
ScriptingEnv::decref
void decref()
Decrease the reference count. This should only be called by scripted and Script to avoid segfaults.
Definition: ScriptingEnv.cpp:65
ScriptingEnv::fileFilter
const QString fileFilter() const
Construct a filter expression from fileExtension(), suitable for QFileDialog.
Definition: ScriptingEnv.cpp:51
PythonScripting.h
ScriptingEnv::d_initialized
bool d_initialized
whether the interpreter has been successfully initialized
Definition: ScriptingEnv.h:110
Script.h
MuParserScripting.h
PythonScript.h
ScriptingEnv::d_refcount
int d_refcount
the reference counter
Definition: ScriptingEnv.h:116
ApplicationWindow
SciDAVis's main window.
Definition: ApplicationWindow.h:122
ScriptingEnv::ScriptingEnv
ScriptingEnv(ApplicationWindow *parent, const char *langName)
Definition: ScriptingEnv.cpp:43