diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2003-05-21 23:58:31 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2003-05-21 23:58:31 +0400 |
commit | 89e9090c861839e7f4289c13f26ab12d4b503610 (patch) | |
tree | d9127dc65337136f6f2fc39da0ad44dc046e99dc /source/blender/python/api2_2x/Text.c | |
parent | 000f92e204b54d117789209b00fee88f279be6e1 (diff) |
Implemented the compare callback for Camera, Image, Lamp and Text types:
Following a suggestion made by Jordi Rovira i Bonet, the comparison
now is made via the pointers to the Blender objects, not their py wrappers.
Diffstat (limited to 'source/blender/python/api2_2x/Text.c')
-rw-r--r-- | source/blender/python/api2_2x/Text.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c index a447a4ff6ce..49f871cdef0 100644 --- a/source/blender/python/api2_2x/Text.c +++ b/source/blender/python/api2_2x/Text.c @@ -443,6 +443,20 @@ static int TextSetAttr (C_Text *self, char *name, PyObject *value) } /*****************************************************************************/ +/* Function: TextCompare */ +/* Description: This is a callback function for the C_Text type. It */ +/* compares two Text_Type objects. Only the "==" and "!=" */ +/* comparisons are meaninful. Returns 0 for equality and -1 if */ +/* they don't point to the same Blender Text struct. */ +/* In Python it becomes 1 if they are equal, 0 otherwise. */ +/*****************************************************************************/ +static int TextCompare (C_Text *a, C_Text *b) +{ + Text *pa = a->text, *pb = b->text; + return (pa == pb) ? 0:-1; +} + +/*****************************************************************************/ /* Function: TextPrint */ /* Description: This is a callback function for the C_Text type. It */ /* builds a meaninful string to 'print' text objects. */ |