Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-04-19 21:29:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-19 21:29:07 +0400
commit6bc162e679d8b52b28e205de76985a1735abbf0a (patch)
tree675375b547c1ba593f02fa9394273d95cfe57ae7 /source/gameengine/Expressions/PyObjectPlus.h
parentfe08da3b4c4097c87c4ee1ee02e9218aaaffde4b (diff)
BGE Python API
removed redundant (PyObject *self) argument from python functions that are not exposed to python directly.
Diffstat (limited to 'source/gameengine/Expressions/PyObjectPlus.h')
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h50
1 files changed, 20 insertions, 30 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 9f30e6570ee..370717a919b 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -180,62 +180,54 @@ typedef struct {
* macro is one that also requires a documentation string
*/
#define KX_PYMETHOD(class_name, method_name) \
- PyObject* Py##method_name(PyObject* self, PyObject* args, PyObject* kwds); \
+ PyObject* Py##method_name(PyObject* args, PyObject* kwds); \
static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, args, kwds); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \
}; \
#define KX_PYMETHOD_VARARGS(class_name, method_name) \
- PyObject* Py##method_name(PyObject* self, PyObject* args); \
+ PyObject* Py##method_name(PyObject* args); \
static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, args); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \
}; \
#define KX_PYMETHOD_NOARGS(class_name, method_name) \
- PyObject* Py##method_name(PyObject* self); \
+ PyObject* Py##method_name(); \
static PyObject* sPy##method_name( PyObject* self) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \
}; \
#define KX_PYMETHOD_O(class_name, method_name) \
- PyObject* Py##method_name(PyObject* self, PyObject* value); \
+ PyObject* Py##method_name(PyObject* value); \
static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \
- PyObjectPlus *self_plus= ((PyObjectPlus_Proxy *)self)->ref; \
- return ((class_name*) self_plus)->Py##method_name(self, value); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \
}; \
#define KX_PYMETHOD_DOC(class_name, method_name) \
- PyObject* Py##method_name(PyObject* self, PyObject* args, PyObject* kwds); \
+ PyObject* Py##method_name(PyObject* args, PyObject* kwds); \
static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, args, kwds); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \
}; \
static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \
- PyObject* Py##method_name(PyObject* self, PyObject* args); \
+ PyObject* Py##method_name(PyObject* args); \
static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, args); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \
}; \
static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_O(class_name, method_name) \
- PyObject* Py##method_name(PyObject* self, PyObject* value); \
+ PyObject* Py##method_name(PyObject* value); \
static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self, value); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \
}; \
static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \
- PyObject* Py##method_name(PyObject* self); \
+ PyObject* Py##method_name(); \
static PyObject* sPy##method_name( PyObject* self) { \
- PyObjectPlus *self_plus= BGE_PROXY_REF(self); \
- return ((class_name*)self_plus)->Py##method_name(self); \
+ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \
}; \
static const char method_name##_doc[]; \
@@ -258,19 +250,19 @@ typedef struct {
*/
#define KX_PYMETHODDEF_DOC(class_name, method_name, doc_string) \
const char class_name::method_name##_doc[] = doc_string; \
-PyObject* class_name::Py##method_name(PyObject* self, PyObject* args, PyObject*)
+PyObject* class_name::Py##method_name(PyObject* args, PyObject*)
#define KX_PYMETHODDEF_DOC_VARARGS(class_name, method_name, doc_string) \
const char class_name::method_name##_doc[] = doc_string; \
-PyObject* class_name::Py##method_name(PyObject* self, PyObject* args)
+PyObject* class_name::Py##method_name(PyObject* args)
#define KX_PYMETHODDEF_DOC_O(class_name, method_name, doc_string) \
const char class_name::method_name##_doc[] = doc_string; \
-PyObject* class_name::Py##method_name(PyObject* self, PyObject* value)
+PyObject* class_name::Py##method_name(PyObject* value)
#define KX_PYMETHODDEF_DOC_NOARGS(class_name, method_name, doc_string) \
const char class_name::method_name##_doc[] = doc_string; \
-PyObject* class_name::Py##method_name(PyObject* self)
+PyObject* class_name::Py##method_name()
/**
* Attribute management
@@ -453,8 +445,6 @@ public:
* which we cant use because we have our own subclass system */
bool isA(PyTypeObject *T);
bool isA(const char *mytypename);
- PyObject *PyisA(PyObject *value);
- //static PyObject *sPy_isA(PyObject *self, PyObject *value);
KX_PYMETHOD_O(PyObjectPlus,isA);