Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
swigpython.h
Go to the documentation of this file.
1 
8 #ifdef USE_PYTHON
9 #ifndef SWIGPYTHON_H_
10 #define SWIGPYTHON_H_
11 
12 #include <Python.h>
13 
14 #include <QString>
15 #include <QList>
16 
17 
18 
19 class CASwigPython {
20  public:
21  enum CAClassType {
22  // Qt objects
23  String,
24 
25  // Canorus objects
26  Document,
27  Sheet,
28  Context,
29  Voice,
30  MusElement,
31  PlayableLength,
32 
33  // Console
34  PyConsoleInterface,
35 
36  // Plugins
37  Plugin
38  };
39 
40  static void init();
41  static PyObject *callFunction(QString fileName, QString function, QList<PyObject*> args, bool autoReload = false);
42  static void *callPycli(void*);
43  static PyObject *toPythonObject(void *object, CAClassType type); // defined in scripting/canoruspython.i
44 
45  static PyThreadState *mainThreadState, *pycliThreadState;
46 };
47 
48 #endif /*SWIGPYTHON_H_*/
49 #endif