Merge of itasc branch. Project files, scons and cmake should be working. Makefile...
[blender.git] / source / gameengine / GameLogic / SCA_PropertyActuator.cpp
index 4faa4b5..2a3e600 100644 (file)
@@ -42,8 +42,8 @@
 /* Native functions                                                          */
 /* ------------------------------------------------------------------------- */
 
-SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,SCA_IObject* sourceObj,const STR_String& propname,const STR_String& expr,int acttype,PyTypeObject* T )
-   :   SCA_IActuator(gameobj,T),
+SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,SCA_IObject* sourceObj,const STR_String& propname,const STR_String& expr,int acttype)
+   :   SCA_IActuator(gameobj, KX_ACT_PROPERTY),
        m_type(acttype),
        m_propname(propname),
        m_exprtxt(expr),
@@ -228,13 +228,7 @@ void SCA_PropertyActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map)
 
 /* Integration hooks ------------------------------------------------------- */
 PyTypeObject SCA_PropertyActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
        PyVarObject_HEAD_INIT(NULL, 0)
-#else
-       /* python 2.5 and below */
-       PyObject_HEAD_INIT( NULL )  /* required py macro */
-       0,                          /* ob_size */
-#endif
        "SCA_PropertyActuator",
        sizeof(PyObjectPlus_Proxy),
        0,
@@ -244,28 +238,18 @@ PyTypeObject SCA_PropertyActuator::Type = {
        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_PropertyActuator::Parents[] = {
-       &SCA_PropertyActuator::Type,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
        &SCA_IActuator::Type,
-       &SCA_ILogicBrick::Type,
-       &CValue::Type,
-       NULL
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 PyMethodDef SCA_PropertyActuator::Methods[] = {
-       //Deprecated functions ------>
-       {"setProperty", (PyCFunction) SCA_PropertyActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"getProperty", (PyCFunction) SCA_PropertyActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"setValue", (PyCFunction) SCA_PropertyActuator::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc},
-       {"getValue", (PyCFunction) SCA_PropertyActuator::sPyGetValue, METH_VARARGS, (PY_METHODCHAR)GetValue_doc},
-       //<----- Deprecated
        {NULL,NULL} //Sentinel
 };
 
@@ -276,83 +260,4 @@ PyAttributeDef SCA_PropertyActuator::Attributes[] = {
        { NULL }        //Sentinel
 };
 
-PyObject* SCA_PropertyActuator::py_getattro(PyObject *attr) {
-       py_getattro_up(SCA_IActuator);
-}
-
-PyObject* SCA_PropertyActuator::py_getattro_dict() {
-       py_getattro_dict_up(SCA_IActuator);
-}
-
-int SCA_PropertyActuator::py_setattro(PyObject *attr, PyObject *value) {
-       py_setattro_up(SCA_IActuator);
-}
-
-/* 1. setProperty                                                        */
-const char SCA_PropertyActuator::SetProperty_doc[] = 
-"setProperty(name)\n"
-"\t- name: string\n"
-"\tSet the property on which to operate. If there is no property\n"
-"\tof this name, the call is ignored.\n";
-PyObject* SCA_PropertyActuator::PySetProperty(PyObject* args, PyObject* kwds)
-{
-       ShowDeprecationWarning("setProperty()", "the 'propName' property");
-       /* Check whether the name exists first ! */
-       char *nameArg;
-       if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) {
-               return NULL;
-       }
-
-       CValue* prop = GetParent()->FindIdentifier(nameArg);
-
-       if (!prop->IsError()) {
-               m_propname = nameArg;
-       } else {
-               ; /* not found ... */
-       }
-       prop->Release();
-       
-       Py_RETURN_NONE;
-}
-
-/* 2. getProperty                                                        */
-const char SCA_PropertyActuator::GetProperty_doc[] = 
-"getProperty(name)\n"
-"\tReturn the property on which the actuator operates.\n";
-PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* args, PyObject* kwds)
-{
-       ShowDeprecationWarning("getProperty()", "the 'propName' property");
-       return PyString_FromString(m_propname);
-}
-
-/* 3. setValue                                                        */
-const char SCA_PropertyActuator::SetValue_doc[] = 
-"setValue(value)\n"
-"\t- value: string\n"
-"\tSet the value with which the actuator operates. If the value\n"
-"\tis not compatible with the type of the property, the subsequent\n"
-"\t action is ignored.\n";
-PyObject* SCA_PropertyActuator::PySetValue(PyObject* args, PyObject* kwds)
-{
-       ShowDeprecationWarning("setValue()", "the value property");
-       char *valArg;
-       if(!PyArg_ParseTuple(args, "s:setValue", &valArg)) {
-               return NULL;            
-       }
-       
-       if (valArg)     m_exprtxt = valArg;
-
-       Py_RETURN_NONE;
-}
-
-/* 4. getValue                                                        */
-const char SCA_PropertyActuator::GetValue_doc[] = 
-"getValue()\n"
-"\tReturns the value with which the actuator operates.\n";
-PyObject* SCA_PropertyActuator::PyGetValue(PyObject* args, PyObject* kwds)
-{
-       ShowDeprecationWarning("getValue()", "the value property");
-       return PyString_FromString(m_exprtxt);
-}
-
 /* eof */