mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
master branch unification: cross-platform python interpreter
This commit is contained in:
23
PyInt.h
23
PyInt.h
@@ -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
|
||||
Reference in New Issue
Block a user