diff options
author | Stephen Swaney <sswaney@centurytel.net> | 2005-09-21 23:48:40 +0400 |
---|---|---|
committer | Stephen Swaney <sswaney@centurytel.net> | 2005-09-21 23:48:40 +0400 |
commit | 5bac916e83cadce7ff5eec4fee9e905347a97b8c (patch) | |
tree | 5d123ad89521eef9802245020d7f5afeb4561a71 /source/blender/python/api2_2x/gen_utils.h | |
parent | e1fe7c88eca7a2aef1050c606ee622724e92d09a (diff) |
Part of Bpy Cleanup: change attribute access to use tp_getset.
for these modules. Adds some new convenience funcs to gen_utils.
This is internal change only and presents little change to the
BPy API except for cleanup of some inconsistencies.
A big contribution from Ken Hughes. Thanks!
Diffstat (limited to 'source/blender/python/api2_2x/gen_utils.h')
-rw-r--r-- | source/blender/python/api2_2x/gen_utils.h | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/source/blender/python/api2_2x/gen_utils.h b/source/blender/python/api2_2x/gen_utils.h index 32c5e314ecf..c69790075d1 100644 --- a/source/blender/python/api2_2x/gen_utils.h +++ b/source/blender/python/api2_2x/gen_utils.h @@ -38,6 +38,8 @@ #include "DNA_scriptlink_types.h" #include "DNA_listBase.h" +#include "constant.h" + #define Py_PI 3.14159265358979323846 #define Py_WRAP 1024 #define Py_NEW 2048 @@ -99,24 +101,36 @@ int EXPP_map_getStrVal( const EXPP_map_pair * map, /* clamping and range-checking utilities */ -int EXPP_setCharClamped ( PyObject *value, char *param, - short min, short max); -int EXPP_setShortClamped ( PyObject *value, short *param, - short min, short max); -int EXPP_setIntClamped ( PyObject *value, int *param, - int min, int max); +int EXPP_setIValueClamped( PyObject *value, void *param, + int min, int max, char type ); int EXPP_setFloatClamped ( PyObject *value, float *param, float min, float max); - -int EXPP_setChrRange ( PyObject *value, char *param, - short min, short max); -int EXPP_setShortRange ( PyObject *value, short *param, - short min, short max); -int EXPP_setIntRange ( PyObject *value, int *param, - int min, int max); +int EXPP_setIValueRange( PyObject *value, void *param, + int min, int max, char type ); int EXPP_setFloatRange ( PyObject *value, float *param, float min, float max); +/* utility routine for PyType attributes setters with module constant */ + +int EXPP_setModuleConstant ( BPy_constant *constant, void *param, + char type ); + +/* utilities to get/set bits in bitfields */ + +PyObject *EXPP_getBitfield( void *param, int setting, char type ); +int EXPP_setBitfield( PyObject * value, void *param, int setting, char type ); + +/* + * Procedures to handle older setStuff() methods, which now access + * a PyType's setter attributes using the tp_getset mechanism. + */ + +PyObject *EXPP_setterWrapper ( PyObject * self, PyObject * args, + setter func); + +PyObject *EXPP_setterWrapperTuple ( PyObject * self, PyObject * args, + setter func); + /* scriplinks-related: */ PyObject *EXPP_getScriptLinks(ScriptLink *slink, PyObject *args, int is_scene); PyObject *EXPP_addScriptLink(ScriptLink *slink, PyObject *args, int is_scene); |