*** empty log message ***
This commit is contained in:
parent
d8d6ee4593
commit
f2e3a52f31
|
|
@ -469,8 +469,8 @@ void InterfaceMakerPythonNative::write_prototypes(ostream &out_code,ostream *out
|
|||
{
|
||||
|
||||
Function *func = (*fi);
|
||||
if(!func->_itype.is_global() && isFunctionLegal(func))
|
||||
write_prototype_for(out_code, func);
|
||||
// if(!func->_itype.is_global() && isFunctionLegal(func))
|
||||
// write_prototype_for(out_code, func);
|
||||
}
|
||||
|
||||
Objects::iterator oi;
|
||||
|
|
@ -538,14 +538,14 @@ void InterfaceMakerPythonNative::write_prototypes_class(ostream &out_code,ostrea
|
|||
for (fi = obj->_methods.begin(); fi != obj->_methods.end(); ++fi)
|
||||
{
|
||||
Function *func = (*fi);
|
||||
write_prototype_for(out_code, func);
|
||||
// write_prototype_for(out_code, func);
|
||||
}
|
||||
|
||||
for (fi = obj->_constructors.begin(); fi != obj->_constructors.end(); ++fi)
|
||||
{
|
||||
Function *func = (*fi);
|
||||
std::string fname = "int Dtool_Init_"+ClassName+"(PyObject *self, PyObject *args, PyObject *kwds)";
|
||||
write_prototype_for_name(out_code, func,fname);
|
||||
//write_prototype_for_name(out_code, func,fname);
|
||||
|
||||
}
|
||||
write_ClasseDeclarations(out_code,out_h,obj);
|
||||
|
|
@ -858,7 +858,7 @@ void InterfaceMakerPythonNative::write_module_support(ostream &out,ostream *out_
|
|||
|
||||
bool force_base_functions = true;
|
||||
|
||||
out << "static PyMethodDef python_simple_funcs[] = {\n";
|
||||
out << "PyMethodDef python_simple_funcs[] = {\n";
|
||||
Functions::iterator fi;
|
||||
for (fi = _functions.begin(); fi != _functions.end(); ++fi)
|
||||
{
|
||||
|
|
@ -1105,7 +1105,7 @@ void InterfaceMakerPythonNative::write_module_class(ostream &out, Object *obj)
|
|||
out << "//********************************************************************\n";
|
||||
out << "//*** Py Init Code For .. "<< ClassName <<" | " << export_calss_name <<"\n" ;
|
||||
out << "//********************************************************************\n";
|
||||
out << "static PyMethodDef Dtool_Methods_"<< ClassName << "[]= {\n";
|
||||
out << "PyMethodDef Dtool_Methods_"<< ClassName << "[]= {\n";
|
||||
|
||||
|
||||
|
||||
|
|
@ -1562,7 +1562,7 @@ void InterfaceMakerPythonNative::write_function_for_name(
|
|||
|
||||
|
||||
Function::Remaps::const_iterator ri;
|
||||
out1 << "/************************************\n" << " * Python type method wrapper for\n";
|
||||
out1 << "/******************************************************************\n" << " * Python type method wrapper for\n";
|
||||
for (ri = func->_remaps.begin(); ri != func->_remaps.end(); ++ri)
|
||||
{
|
||||
FunctionRemap *remap = (*ri);
|
||||
|
|
@ -1585,7 +1585,7 @@ void InterfaceMakerPythonNative::write_function_for_name(
|
|||
}
|
||||
|
||||
}
|
||||
out1 << " *************************************/\n";
|
||||
out1 << " *******************************************************************/\n";
|
||||
out << function_name << " {\n";
|
||||
if(isFunctionWithThis(func))
|
||||
out << PreProcess;
|
||||
|
|
|
|||
|
|
@ -32,9 +32,13 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#ifndef NO_RUNTIME_TYPES
|
||||
|
||||
#include "pandabase.h"
|
||||
#include "typedObject.h"
|
||||
#include "typeRegistry.h"
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LONG_LONG
|
||||
#undef HAVE_LONG_LONG
|
||||
|
|
@ -51,14 +55,15 @@ using namespace std;
|
|||
// this is tempory .. untill this is glued better into the panda build system
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef __cplusplus
|
||||
#define DTOOL_C_LINKAGE
|
||||
#define DTOOL_C_LINKAGE extern
|
||||
#define DTOOL_FORWARD_STATIC extern
|
||||
#else
|
||||
#define DTOOL_C_LINKAGE
|
||||
#define DTOOL_C_LINKAGE extern
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define EXPORT_THIS DTOOL_C_LINKAGE __declspec(dllexport)
|
||||
#define IMPORT_THIS DTOOL_C_LINKAGE __declspec(dllimport)
|
||||
#define EXPORT_THIS __declspec(dllexport)
|
||||
#define IMPORT_THIS __declspec(dllimport)
|
||||
#define IMPORT_FROM_SHARED_LIB __declspec(dllimport)
|
||||
#else
|
||||
#define EXPORT_THIS DTOOL_C_LINKAGE
|
||||
|
|
@ -79,14 +84,13 @@ DTOOL_C_LINKAGE RunTimeTypeList & GetRunTimeTypeList();
|
|||
// used to stamp dtool instance..
|
||||
#define PY_PANDA_SIGNITURE 0xdeadbeaf
|
||||
|
||||
DTOOL_C_LINKAGE struct Dtool_PyTypedObject;
|
||||
DTOOL_C_LINKAGE typedef void * ( * ConvertFunctionType )(PyObject *,Dtool_PyTypedObject * );
|
||||
DTOOL_C_LINKAGE typedef void * ( * ConvertFunctionType1 )(void *, Dtool_PyTypedObject *);
|
||||
DTOOL_C_LINKAGE typedef void ( *FreeFunction )(PyObject *);
|
||||
DTOOL_C_LINKAGE typedef void ( *PyModuleClassInit)(PyObject *module);
|
||||
typedef void * ( * ConvertFunctionType )(PyObject *,Dtool_PyTypedObject * );
|
||||
typedef void * ( * ConvertFunctionType1 )(void *, Dtool_PyTypedObject *);
|
||||
typedef void ( *FreeFunction )(PyObject *);
|
||||
typedef void ( *PyModuleClassInit)(PyObject *module);
|
||||
//DTOOL_C_LINKAGE inline long DTool_HashKey(PyObject * inst);
|
||||
DTOOL_C_LINKAGE inline Dtool_PyTypedObject * Dtool_RuntimeTypeDtoolType(int type);
|
||||
DTOOL_C_LINKAGE inline void Dtool_Deallocate_General(PyObject * self);
|
||||
inline Dtool_PyTypedObject * Dtool_RuntimeTypeDtoolType(int type);
|
||||
inline void Dtool_Deallocate_General(PyObject * self);
|
||||
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -129,8 +133,6 @@ struct Dtool_PyTypedObject
|
|||
// some convience functions..
|
||||
inline PyTypeObject & As_PyTypeObject(void) { return _PyType; };
|
||||
inline PyObject & As_PyObject(void) { return (PyObject &)_PyType; };
|
||||
|
||||
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -197,7 +199,7 @@ static PyMappingMethods Dtool_PyMappingMethods_##CLASS_NAME ={\
|
|||
0,/*binaryfunc mp_subscript */\
|
||||
0,/*objobjargproc mp_ass_subscript */\
|
||||
};\
|
||||
struct Dtool_PyTypedObject Dtool_##CLASS_NAME = {\
|
||||
EXPORT_THIS Dtool_PyTypedObject Dtool_##CLASS_NAME = {\
|
||||
{\
|
||||
PyObject_HEAD_INIT(NULL)\
|
||||
0,\
|
||||
|
|
@ -274,13 +276,13 @@ DTOOL_C_LINKAGE PyObject *Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *a
|
|||
/// Delete functions..
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
#define Define_Dtool_FreeInstance_Private(CLASS_NAME,CNAME)\
|
||||
DTOOL_C_LINKAGE void Dtool_FreeInstance_##CLASS_NAME(PyObject *self)\
|
||||
static void Dtool_FreeInstance_##CLASS_NAME(PyObject *self)\
|
||||
{\
|
||||
}\
|
||||
|
||||
|
||||
#define Define_Dtool_FreeInstance(CLASS_NAME,CNAME)\
|
||||
DTOOL_C_LINKAGE void Dtool_FreeInstance_##CLASS_NAME(PyObject *self)\
|
||||
static void Dtool_FreeInstance_##CLASS_NAME(PyObject *self)\
|
||||
{\
|
||||
if(((Dtool_PyInstDef *)self)->_ptr_to_object != NULL)\
|
||||
if(((Dtool_PyInstDef *)self)->_memory_rules)\
|
||||
|
|
@ -290,7 +292,7 @@ DTOOL_C_LINKAGE void Dtool_FreeInstance_##CLASS_NAME(PyObject *self)\
|
|||
}\
|
||||
|
||||
#define Define_Dtool_FreeInstanceRef(CLASS_NAME,CNAME)\
|
||||
DTOOL_C_LINKAGE void Dtool_FreeInstance_##CLASS_NAME(PyObject *self)\
|
||||
static void Dtool_FreeInstance_##CLASS_NAME(PyObject *self)\
|
||||
{\
|
||||
if(((Dtool_PyInstDef *)self)->_ptr_to_object != NULL)\
|
||||
if(((Dtool_PyInstDef *)self)->_memory_rules)\
|
||||
|
|
@ -433,8 +435,9 @@ DTOOL_C_LINKAGE inline PyObject * DTool_CreatePyInstance(void * local_this, Dto
|
|||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//struct PyMethodDef Dtool_Methods_##CLASS_NAME[];
|
||||
|
||||
/*
|
||||
#define Define_Module_Class_Forward(MODULE_NAME,CLASS_NAME,CNAME,PUBLIC_NAME)\
|
||||
IMPORT_THIS Dtool_PyTypedObject Dtool_##CLASS_NAME; \
|
||||
EXPORT_THIS Dtool_PyTypedObject Dtool_##CLASS_NAME; \
|
||||
struct 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);\
|
||||
|
|
@ -442,45 +445,46 @@ DTOOL_C_LINKAGE void * Dtool_UpcastInterface_##CLASS_NAME(PyObject *self, Dtool
|
|||
DTOOL_C_LINKAGE void * Dtool_DowncastInterface_##CLASS_NAME(void *self,Dtool_PyTypedObject *requested_type);\
|
||||
DTOOL_C_LINKAGE void Dtool_FreeInstance_##CLASS_NAME(PyObject *self);\
|
||||
DTOOL_C_LINKAGEvoid Dtool_PyModuleClassInit_##CLASS_NAME(PyObject *module);\
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define Define_Module_Class_Internal(MODULE_NAME,CLASS_NAME,CNAME)\
|
||||
extern "C" Dtool_PyTypedObject Dtool_##CLASS_NAME; \
|
||||
struct 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);\
|
||||
DTOOL_C_LINKAGE void * Dtool_DowncastInterface_##CLASS_NAME(void *self, Dtool_PyTypedObject *requested_type);\
|
||||
DTOOL_C_LINKAGE void Dtool_FreeInstance_##CLASS_NAME(PyObject *self);\
|
||||
DTOOL_C_LINKAGE void Dtool_PyModuleClassInit_##CLASS_NAME(PyObject *module);\
|
||||
extern EXPORT_THIS Dtool_PyTypedObject Dtool_##CLASS_NAME; \
|
||||
extern struct PyMethodDef Dtool_Methods_##CLASS_NAME[];\
|
||||
extern int Dtool_Init_##CLASS_NAME(PyObject *self, PyObject *args, PyObject *kwds);\
|
||||
extern PyObject * Dtool_new_##CLASS_NAME(PyTypeObject *type, PyObject *args, PyObject *kwds);\
|
||||
extern void * Dtool_UpcastInterface_##CLASS_NAME(PyObject *self, Dtool_PyTypedObject *requested_type);\
|
||||
extern void * Dtool_DowncastInterface_##CLASS_NAME(void *self, Dtool_PyTypedObject *requested_type);\
|
||||
extern void Dtool_FreeInstance_##CLASS_NAME(PyObject *self);\
|
||||
extern 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_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#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_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#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_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#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_Dtool_Class(MODULE_NAME,CLASS_NAME,PUBLIC_NAME)
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -535,6 +539,7 @@ DTOOL_C_LINKAGE inline void RegisterRuntimeClass(Dtool_PyTypedObject * otype, in
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef NO_RUNTIME_TYPES
|
||||
DTOOL_C_LINKAGE inline Dtool_PyTypedObject * Dtool_RuntimeTypeDtoolType(int type)
|
||||
{
|
||||
RunTimeTypeDictionary::iterator di = GetRunTimeDictionary().find(type);
|
||||
|
|
@ -552,13 +557,15 @@ DTOOL_C_LINKAGE inline Dtool_PyTypedObject * Dtool_RuntimeTypeDtoolType(int typ
|
|||
|
||||
return NULL;
|
||||
};
|
||||
#endif
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// We need a way to runtime merge compile units into a python "Module" .. this is done with the
|
||||
/// fallowing structors and code.. along with the support of interigate_module
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
DTOOL_C_LINKAGE typedef void ( *ConstantFunction )(PyObject *);
|
||||
struct LibrayDef
|
||||
{
|
||||
typedef void ( *ConstantFunction )(PyObject *);
|
||||
|
||||
PyMethodDef * _methods;
|
||||
ConstantFunction _constants;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue