]> Shamusworld >> Repos - architektonas/blob - src/base/rs_simplepython.h
Final round of dialogs/forms needing to be converted from Qt3 to 4
[architektonas] / src / base / rs_simplepython.h
1 #ifndef RS_SIMPLEPYTHON_H
2 #define RS_SIMPLEPYTHON_H
3
4 #ifdef RS_OPT_SIMPLEPYTHON
5
6 #include "Python.h"
7
8 #include "drawing.h"
9
10 #define RS_SIMPLEPYTHON RS_SimplePython::instance()
11
12 /**
13  * Python scripting support.
14  *
15  * OBSOLETE
16  *
17  * @author Andrew Mustun
18  */
19 class RS_SimplePython
20 {
21         private:
22                 RS_SimplePython()
23                 {
24                         graphic = NULL;
25                 }
26
27         public:
28                 static RS_SimplePython * instance();
29
30                 void setGraphic(Drawing* g)
31                 {
32                         graphic = g;
33                 }
34
35                 Drawing * getGraphic()
36                 {
37                         return graphic;
38                 }
39
40                 int launch(const QString& script);
41
42         private:
43                 static RS_SimplePython * uniqueInstance;
44
45                 Drawing * graphic;
46 };
47
48 /**
49  * Global method needed by the python lib for initialisation.
50  */
51 void init_pyextension();
52
53 /**
54  * Test method.
55  */
56 long inc(long i);
57
58 /**
59  * Adds a line to the current graphic document.
60  */
61 void rsPyAddLine(double x1, double y1, double x2, double y2);
62
63 #endif
64
65 #endif