master branch unification: cross-platform python interpreter

This commit is contained in:
tmj-fstate
2018-03-01 16:07:52 +01:00
parent a1e2ad60d4
commit 710f7e3fbc
4 changed files with 41 additions and 75 deletions

23
PyInt.h
View File

@@ -1,9 +1,13 @@
#ifndef PyIntH
#define PyIntH
#include <vector>
#include <set>
#include <string>
#ifdef _POSIX_C_SOURCE
#undef _POSIX_C_SOURCE
#endif
#ifdef _XOPEN_SOURCE
#undef _XOPEN_SOURCE
#endif
#ifdef _DEBUG
#undef _DEBUG // bez tego macra Py_DECREF powoduja problemy przy linkowaniu
@@ -12,7 +16,7 @@
#else
#include "Python.h"
#endif
#include "classes.h"
#include "Classes.h"
#define PyGetFloat(param) PyFloat_FromDouble(param >= 0 ? param : -param)
#define PyGetFloatS(param) PyFloat_FromDouble(param)
@@ -35,7 +39,6 @@ class TPythonInterpreter
TPythonInterpreter();
~TPythonInterpreter() {}
static TPythonInterpreter *_instance;
int _screenRendererPriority = 0;
// std::set<const char *, ltstr> _classes;
std::set<std::string> _classes;
PyObject *_main;
@@ -52,11 +55,6 @@ class TPythonInterpreter
*/ bool loadClassFile( std::string const &lookupPath, std::string const &className );
PyObject *newClass( std::string const &className );
PyObject *newClass( std::string const &className, PyObject *argsTuple );
int getScreenRendererPriotity()
{
return _screenRendererPriority;
};
void setScreenRendererPriority(const char *priority);
void handleError();
};
@@ -83,8 +81,7 @@ class TPythonScreens
bool _cleanupReadyFlag;
bool _renderReadyFlag;
bool _terminationFlag;
void *_thread;
unsigned int _threadId;
std::thread *_thread;
std::vector<TPythonScreenRenderer *> _screens;
std::string _lookupPath;
void *_train;
@@ -104,4 +101,4 @@ class TPythonScreens
void finish();
};
#endif // PyIntH
#endif // PyIntH