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/Expressions/Value.h
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/Expressions/Value.h')
-rw-r--r--source/gameengine/Expressions/Value.h38
1 files changed, 11 insertions, 27 deletions
diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h
index caf1064dc32..a687e1a493c 100644
--- a/source/gameengine/Expressions/Value.h
+++ b/source/gameengine/Expressions/Value.h
@@ -217,33 +217,14 @@ public:
CValue(PyTypeObject *T = &Type);
//static PyObject* PyMake(PyObject*,PyObject*);
- virtual PyObject *_repr(void)
+ virtual PyObject *py_repr(void)
{
- return Py_BuildValue("s",(const char*)GetText());
+ return PyString_FromString((const char*)GetText());
}
- virtual PyObject* _getattr(const char *attr);
-
- void SpecialRelease()
- {
- int i=0;
- if (ob_refcnt == 0)
- {
- _Py_NewReference(this);
-
- } else
- {
- i++;
- }
- Release();
- }
- static void PyDestructor(PyObject *P) // python wrapper
- {
- ((CValue*)P)->SpecialRelease();
- };
-
+ virtual PyObject* py_getattro(PyObject *attr);
virtual PyObject* ConvertValueToPython() {
return NULL;
}
@@ -251,8 +232,8 @@ public:
virtual CValue* ConvertPythonToValue(PyObject* pyobj);
- virtual int _delattr(const char *attr);
- virtual int _setattr(const char *attr, PyObject* value);
+ virtual int py_delattro(PyObject *attr);
+ virtual int py_setattro(PyObject *attr, PyObject* value);
virtual PyObject* ConvertKeysToPython( void );
@@ -280,13 +261,16 @@ public:
int GetRefCount() { return m_refcount; }
virtual CValue* AddRef(); // Add a reference to this value
virtual int Release(); // Release a reference to this value (when reference count reaches 0, the value is removed from the heap)
+
/// Property Management
virtual void SetProperty(const STR_String& name,CValue* ioProperty); // Set property <ioProperty>, overwrites and releases a previous property with the same name if needed
- virtual CValue* GetProperty(const STR_String & inName); // Get pointer to a property with name <inName>, returns NULL if there is no property named <inName>
+ virtual void SetProperty(const char* name,CValue* ioProperty);
+ virtual CValue* GetProperty(const char* inName); // Get pointer to a property with name <inName>, returns NULL if there is no property named <inName>
+ virtual CValue* GetProperty(const STR_String & inName);
STR_String GetPropertyText(const STR_String & inName,const STR_String& deftext=""); // Get text description of property with name <inName>, returns an empty string if there is no property named <inName>
float GetPropertyNumber(const STR_String& inName,float defnumber);
- virtual bool RemoveProperty(const STR_String & inName); // Remove the property named <inName>, returns true if the property was succesfully removed, false if property was not found or could not be removed
+ virtual bool RemoveProperty(const char *inName); // Remove the property named <inName>, returns true if the property was succesfully removed, false if property was not found or could not be removed
virtual vector<STR_String> GetPropertyNames();
virtual void ClearProperties(); // Clear all properties
@@ -304,7 +288,7 @@ public:
virtual void SetColorOperator(VALUE_OPERATOR op);
virtual const STR_String & GetText() = 0;
- virtual float GetNumber() = 0;
+ virtual double GetNumber() = 0;
double* ZeroVector() { return m_sZeroVec; };
virtual double* GetVector3(bool bGetTransformedVec = false);