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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-20 19:06:46 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-20 19:06:46 +0400
commit874c29cea8e6f9bc411fccf2d6f4cb07e94328d0 (patch)
tree5971e577cf7c02e05a1e37b5ad058c71a6744877 /source/gameengine/GameLogic/SCA_PropertySensor.cpp
parent7555bfa793a2b0fc187c6211c56986f35b2d7b09 (diff)
parentc5bc4e4fb1a33eda8c31f2ea02e91f32f74c8fa5 (diff)
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes: * blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
Diffstat (limited to 'source/gameengine/GameLogic/SCA_PropertySensor.cpp')
-rw-r--r--source/gameengine/GameLogic/SCA_PropertySensor.cpp58
1 files changed, 26 insertions, 32 deletions
diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
index d683c8bb3e7..de8a9fcf03e 100644
--- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
@@ -306,22 +306,22 @@ int SCA_PropertySensor::validValueForProperty(void *self, const PyAttributeDef*)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_PropertySensor::Type = {
- PyObject_HEAD_INIT(&PyType_Type)
+ PyObject_HEAD_INIT(NULL)
0,
"SCA_PropertySensor",
- sizeof(SCA_PropertySensor),
+ sizeof(PyObjectPlus_Proxy),
0,
- PyDestructor,
+ py_base_dealloc,
0,
- __getattr,
- __setattr,
- 0, //&MyPyCompare,
- __repr,
- 0, //&cvalue_as_number,
0,
0,
0,
- 0
+ py_base_repr,
+ 0,0,0,0,0,0,
+ py_base_getattro,
+ py_base_setattro,
+ 0,0,0,0,0,0,0,0,0,
+ Methods
};
PyParentObject SCA_PropertySensor::Parents[] = {
@@ -334,11 +334,11 @@ PyParentObject SCA_PropertySensor::Parents[] = {
PyMethodDef SCA_PropertySensor::Methods[] = {
//Deprecated functions ------>
- {"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_VARARGS, (PY_METHODCHAR)GetType_doc},
+ {"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc},
{"setType", (PyCFunction) SCA_PropertySensor::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc},
- {"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc},
+ {"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
{"setProperty", (PyCFunction) SCA_PropertySensor::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
- {"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_VARARGS, (PY_METHODCHAR)GetValue_doc},
+ {"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_NOARGS, (PY_METHODCHAR)GetValue_doc},
{"setValue", (PyCFunction) SCA_PropertySensor::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc},
//<----- Deprecated
{NULL,NULL} //Sentinel
@@ -352,25 +352,19 @@ PyAttributeDef SCA_PropertySensor::Attributes[] = {
};
-PyObject* SCA_PropertySensor::_getattr(const char *attr) {
- PyObject* object = _getattr_self(Attributes, this, attr);
- if (object != NULL)
- return object;
- _getattr_up(SCA_ISensor); /* implicit return! */
+PyObject* SCA_PropertySensor::py_getattro(PyObject *attr) {
+ py_getattro_up(SCA_ISensor);
}
-int SCA_PropertySensor::_setattr(const char *attr, PyObject *value) {
- int ret = _setattr_self(Attributes, this, attr, value);
- if (ret >= 0)
- return ret;
- return SCA_ISensor::_setattr(attr, value);
+int SCA_PropertySensor::py_setattro(PyObject *attr, PyObject *value) {
+ py_setattro_up(SCA_ISensor);
}
/* 1. getType */
const char SCA_PropertySensor::GetType_doc[] =
"getType()\n"
"\tReturns the type of check this sensor performs.\n";
-PyObject* SCA_PropertySensor::PyGetType(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_PropertySensor::PyGetType()
{
ShowDeprecationWarning("getType()", "the type property");
return PyInt_FromLong(m_checktype);
@@ -383,12 +377,12 @@ const char SCA_PropertySensor::SetType_doc[] =
"\t KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED,\n"
"\t or KX_PROPSENSOR_EXPRESSION.\n"
"\tSet the type of check to perform.\n";
-PyObject* SCA_PropertySensor::PySetType(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_PropertySensor::PySetType(PyObject* args)
{
ShowDeprecationWarning("setType()", "the type property");
int typeArg;
- if (!PyArg_ParseTuple(args, "i", &typeArg)) {
+ if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) {
return NULL;
}
@@ -404,7 +398,7 @@ PyObject* SCA_PropertySensor::PySetType(PyObject* self, PyObject* args, PyObject
const char SCA_PropertySensor::GetProperty_doc[] =
"getProperty()\n"
"\tReturn the property with which the sensor operates.\n";
-PyObject* SCA_PropertySensor::PyGetProperty(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_PropertySensor::PyGetProperty()
{
ShowDeprecationWarning("getProperty()", "the 'property' property");
return PyString_FromString(m_checkpropname);
@@ -416,14 +410,14 @@ const char SCA_PropertySensor::SetProperty_doc[] =
"\t- name: string\n"
"\tSets the property with which to operate. If there is no property\n"
"\tof this name, the call is ignored.\n";
-PyObject* SCA_PropertySensor::PySetProperty(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_PropertySensor::PySetProperty(PyObject* args)
{
ShowDeprecationWarning("setProperty()", "the 'property' property");
/* We should query whether the name exists. Or should we create a prop */
/* on the fly? */
char *propNameArg = NULL;
- if (!PyArg_ParseTuple(args, "s", &propNameArg)) {
+ if (!PyArg_ParseTuple(args, "s:setProperty", &propNameArg)) {
return NULL;
}
@@ -441,7 +435,7 @@ PyObject* SCA_PropertySensor::PySetProperty(PyObject* self, PyObject* args, PyOb
const char SCA_PropertySensor::GetValue_doc[] =
"getValue()\n"
"\tReturns the value with which the sensor operates.\n";
-PyObject* SCA_PropertySensor::PyGetValue(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_PropertySensor::PyGetValue()
{
ShowDeprecationWarning("getValue()", "the value property");
return PyString_FromString(m_checkpropval);
@@ -454,19 +448,19 @@ const char SCA_PropertySensor::SetValue_doc[] =
"\tSet the value with which the sensor operates. If the value\n"
"\tis not compatible with the type of the property, the subsequent\n"
"\t action is ignored.\n";
-PyObject* SCA_PropertySensor::PySetValue(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_PropertySensor::PySetValue(PyObject* args)
{
ShowDeprecationWarning("setValue()", "the value property");
/* Here, we need to check whether the value is 'valid' for this property.*/
/* We know that the property exists, or is NULL. */
char *propValArg = NULL;
- if(!PyArg_ParseTuple(args, "s", &propValArg)) {
+ if(!PyArg_ParseTuple(args, "s:setValue", &propValArg)) {
return NULL;
}
STR_String oldval = m_checkpropval;
m_checkpropval = propValArg;
- if (validValueForProperty(self, NULL)) {
+ if (validValueForProperty(m_proxy, NULL)) {
m_checkpropval = oldval;
return NULL;
}