[wpdev-commits] wolfpack pythonscript.cpp,1.42,1.43 pythonscript.h,1.33,1.34
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-07-21 12:43:09
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15641 Modified Files: pythonscript.cpp pythonscript.h Log Message: Oh mann....... We missed sending the mapdif enable packet. Index: pythonscript.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** pythonscript.h 20 Jul 2004 11:35:37 -0000 1.33 --- pythonscript.h 21 Jul 2004 12:42:55 -0000 1.34 *************** *** 239,242 **** --- 239,243 ---- */ virtual PyObject *getProperty(const QString &name); + virtual bool setPropety(const QString &name, PyObject *value); // Functions for creating python representations of objects *************** *** 302,305 **** --- 303,316 ---- } + // Method for converting python objects into normal objects + // Functions for creating python representations of objects + bool convertPyObject(PyObject *object, P_CHAR &pChar); + bool convertPyObject(PyObject *object, P_ITEM &pItem); + bool convertPyObject(PyObject *object, Coord_cl &pos); + bool convertPyObject(PyObject *object, QString &string); + bool convertPyObject(PyObject *object, QCString &string); + bool convertPyObject(PyObject *object, unsigned int &data); + bool convertPyObject(PyObject *object, int &data); + #define PY_PROPERTY(namestr, getter) if ((namestr == name)) { \ return createPyObject((getter)); \ Index: pythonscript.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** pythonscript.cpp 20 Jul 2004 11:35:37 -0000 1.42 --- pythonscript.cpp 21 Jul 2004 12:42:55 -0000 1.43 *************** *** 802,803 **** --- 802,846 ---- return "pythonscriptable"; } + + // Conversion Routines + bool cPythonScriptable::convertPyObject(PyObject *object, P_CHAR &pChar) { + if (checkWpChar(object)) { + pChar = getWpChar(object); + return true; + } else if (object == Py_None) { + pChar = 0; + return true; + } else if (PyInt_Check(object)) { + pChar = World::instance()->findChar(PyInt_AsLong(object)); + return true; + } + return false; + } + + bool cPythonScriptable::convertPyObject(PyObject *object, P_ITEM &pItem) { + return false; + } + + bool cPythonScriptable::convertPyObject(PyObject *object, Coord_cl &pos) { + return false; + } + + bool cPythonScriptable::convertPyObject(PyObject *object, QString &string) { + return false; + } + + bool cPythonScriptable::convertPyObject(PyObject *object, QCString &string) { + return false; + } + + bool cPythonScriptable::convertPyObject(PyObject *object, unsigned int &data) { + return false; + } + + bool cPythonScriptable::convertPyObject(PyObject *object, int &data) { + return false; + } + + bool cPythonScriptable::setPropety(const QString &name, PyObject *value) { + return true; + } |