|
|
@@ -35,11 +35,11 @@
|
|
|
#include "pandabase.h"
|
|
|
#include "typedObject.h"
|
|
|
#include "typeRegistry.h"
|
|
|
-
|
|
|
+
|
|
|
#ifdef HAVE_LONG_LONG
|
|
|
#undef HAVE_LONG_LONG
|
|
|
#endif
|
|
|
-#include "python.h"
|
|
|
+#include "Python.h"
|
|
|
#include "structmember.h"
|
|
|
#ifdef HAVE_LONG_LONG
|
|
|
#undef HAVE_LONG_LONG
|
|
|
@@ -51,7 +51,7 @@ using namespace std;
|
|
|
// this is tempory .. untill this is glued better into the panda build system
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
#ifdef __cplusplus
|
|
|
-#define DTOOL_C_LINKAGE extern "C"
|
|
|
+#define DTOOL_C_LINKAGE
|
|
|
#else
|
|
|
#define DTOOL_C_LINKAGE
|
|
|
#endif
|
|
|
@@ -431,9 +431,9 @@ DTOOL_C_LINKAGE inline PyObject * DTool_CreatePyInstance(void * local_this, Dto
|
|
|
// Macro(s) class definition .. Used to allocate storage and
|
|
|
// init some values for a Dtool Py Type object.
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
+//IMPORT_THIS struct Dtool_PyTypedObject Dtool_##CLASS_NAME; \
|
|
|
#define Define_Module_Class_Forward(MODULE_NAME,CLASS_NAME,CNAME,PUBLIC_NAME)\
|
|
|
-IMPORT_THIS struct Dtool_PyTypedObject Dtool_##CLASS_NAME; \
|
|
|
-DTOOL_C_LINKAGE PyMethodDef Dtool_Methods_##CLASS_NAME[];\
|
|
|
+DTOOL_C_LINKAGE PyMethodDef * Dtool_Methods_##CLASS_NAME;\
|
|
|
DTOOL_C_LINKAGE int Dtool_Init_##CLASS_NAME(PyObject *self, PyObject *args, PyObject *kwds);\
|
|
|
DTOOL_C_LINKAGE PyObject *Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds);\
|
|
|
DTOOL_C_LINKAGE void * Dtool_UpcastInterface_##CLASS_NAME(PyObject *self, Dtool_PyTypedObject *requested_type);\
|
|
|
@@ -442,9 +442,9 @@ DTOOL_C_LINKAGE void Dtool_FreeInstance_##CLASS_NAME(PyObject *self);\
|
|
|
DTOOL_C_LINKAGEvoid Dtool_PyModuleClassInit_##CLASS_NAME(PyObject *module);\
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
+//EXPORT_THIS struct Dtool_PyTypedObject Dtool_##CLASS_NAME; \
|
|
|
#define Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)\
|
|
|
-EXPORT_THIS struct Dtool_PyTypedObject Dtool_##CLASS_NAME; \
|
|
|
-DTOOL_C_LINKAGE PyMethodDef Dtool_Methods_##CLASS_NAME[];\
|
|
|
+DTOOL_C_LINKAGE PyMethodDef * Dtool_Methods_##CLASS_NAME;\
|
|
|
DTOOL_C_LINKAGE int Dtool_Init_##CLASS_NAME(PyObject *self, PyObject *args, PyObject *kwds);\
|
|
|
DTOOL_C_LINKAGE PyObject *Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds);\
|
|
|
DTOOL_C_LINKAGE void * Dtool_UpcastInterface_##CLASS_NAME(PyObject *self, Dtool_PyTypedObject *requested_type);\
|
|
|
@@ -454,31 +454,31 @@ DTOOL_C_LINKAGE void Dtool_PyModuleClassInit_##CLASS_NAME(PyObject *module);\
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
#define Define_Module_Class(MODULE_NAME,CLASS_NAME,CNAME,PUBLIC_NAME)\
|
|
|
-Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)\
|
|
|
Define_Dtool_new(CLASS_NAME,CNAME)\
|
|
|
Define_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME)\
|
|
|
-Define_Dtool_FreeInstance(CLASS_NAME,CNAME)
|
|
|
+Define_Dtool_FreeInstance(CLASS_NAME,CNAME)\
|
|
|
+Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
#define Define_Module_Class_Private(MODULE_NAME,CLASS_NAME,CNAME,PUBLIC_NAME)\
|
|
|
-Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)\
|
|
|
Define_Dtool_new(CLASS_NAME,CNAME)\
|
|
|
Define_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME)\
|
|
|
-Define_Dtool_FreeInstance_Private(CLASS_NAME,CNAME)
|
|
|
+Define_Dtool_FreeInstance_Private(CLASS_NAME,CNAME)\
|
|
|
+Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
#define Define_Module_ClassRef_Private(MODULE_NAME,CLASS_NAME,CNAME,PUBLIC_NAME)\
|
|
|
-Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)\
|
|
|
Define_Dtool_new(CLASS_NAME,CNAME)\
|
|
|
Define_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME)\
|
|
|
-Define_Dtool_FreeInstance_Private(CLASS_NAME,CNAME)
|
|
|
+Define_Dtool_FreeInstance_Private(CLASS_NAME,CNAME)\
|
|
|
+Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
#define Define_Module_ClassRef(MODULE_NAME,CLASS_NAME,CNAME,PUBLIC_NAME)\
|
|
|
-Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)\
|
|
|
Define_Dtool_new(CLASS_NAME,CNAME)\
|
|
|
Define_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME)\
|
|
|
-Define_Dtool_FreeInstanceRef(CLASS_NAME,CNAME)
|
|
|
+Define_Dtool_FreeInstanceRef(CLASS_NAME,CNAME)\
|
|
|
+Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
@@ -533,6 +533,9 @@ DTOOL_C_LINKAGE inline void RegisterRuntimeClass(Dtool_PyTypedObject * otype, in
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
+//
|
|
|
+EXPCL_PANDAEXPRESS int get_best_parent_from_Set(int id, const std::set<int> &set);
|
|
|
+//
|
|
|
DTOOL_C_LINKAGE inline Dtool_PyTypedObject * Dtool_RuntimeTypeDtoolType(int type)
|
|
|
{
|
|
|
RunTimeTypeDictionary::iterator di = GetRunTimeDictionary().find(type);
|