rename and negate DISABLE_PYTHON --> WITH_PYTHON
[blender.git] / source / gameengine / Expressions / ListValue.h
index 337d59e96acfd0c1482a50ed7a5e526bb0f1d8e5..ff675dd0e68b81094f8d0d932640dbf0acdcfcb8 100644 (file)
@@ -16,7 +16,6 @@
 #if !defined _LISTVALUE_H
 #define _LISTVALUE_H
 
-
 #include "Value.h"
 
 class CListValue : public CPropValue  
@@ -25,7 +24,7 @@ class CListValue : public CPropValue
        //PLUGIN_DECLARE_SERIAL (CListValue,CValue)
 
 public:
-       CListValue(PyTypeObject *T = &Type);
+       CListValue();
        virtual ~CListValue();
 
        void AddConfigurationData(CValue* menuvalue);
@@ -37,7 +36,7 @@ public:
        virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype,
                                                          VALUE_OPERATOR op,
                                                          CValue* val);
-       virtual float GetNumber();
+       virtual double GetNumber();
        virtual CValue* GetReplica();
 
 public:
@@ -47,6 +46,7 @@ public:
        bool SearchValue(CValue* val);
        
        CValue* FindValue(const STR_String & name);
+       CValue* FindValue(const char *name);
 
        void ReleaseAndRemoveAll();
        virtual void SetModified(bool bModified);
@@ -60,13 +60,23 @@ public:
 
        bool CheckEqual(CValue* first,CValue* second);
 
-       virtual PyObject*  _getattr(char *attr);
-
-       KX_PYMETHOD(CListValue,append);
-       KX_PYMETHOD(CListValue,reverse);
-       KX_PYMETHOD(CListValue,index);
-       KX_PYMETHOD(CListValue,count);
-
+#ifdef WITH_PYTHON
+       virtual PyObject* py_repr(void) {
+               PyObject *py_proxy= this->GetProxy();
+               PyObject *py_list= PySequence_List(py_proxy);
+               PyObject *py_string= PyObject_Repr(py_list);
+               Py_DECREF(py_list);
+               Py_DECREF(py_proxy);
+               return py_string;
+       }
+
+       KX_PYMETHOD_O(CListValue,append);
+       KX_PYMETHOD_NOARGS(CListValue,reverse);
+       KX_PYMETHOD_O(CListValue,index);
+       KX_PYMETHOD_O(CListValue,count);
+       KX_PYMETHOD_VARARGS(CListValue,get);
+       KX_PYMETHOD_O(CListValue,from_id);
+#endif
        
 private: