diff options
author | Stephen Swaney <sswaney@centurytel.net> | 2005-08-27 22:44:56 +0400 |
---|---|---|
committer | Stephen Swaney <sswaney@centurytel.net> | 2005-08-27 22:44:56 +0400 |
commit | adc1d7137a986f89f1ea1a43ad0ebacff89ffca8 (patch) | |
tree | ae53056cc05720de610635a5d121ee272b5027f9 /source/blender/python/api2_2x/gen_utils.h | |
parent | eb1f65768a742fce55dd755e9c51d4be2f73b5bc (diff) |
patch #2911 - tp_getset for Lamp module.
A nice juicy chunk of new style attribute handling from Ken Hughes.
Thanks, Ken.
Diffstat (limited to 'source/blender/python/api2_2x/gen_utils.h')
-rw-r--r-- | source/blender/python/api2_2x/gen_utils.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/gen_utils.h b/source/blender/python/api2_2x/gen_utils.h index d565d02720d..32c5e314ecf 100644 --- a/source/blender/python/api2_2x/gen_utils.h +++ b/source/blender/python/api2_2x/gen_utils.h @@ -97,6 +97,26 @@ int EXPP_map_getShortVal( const EXPP_map_pair * map, int EXPP_map_getStrVal( const EXPP_map_pair * map, int ival, const char **sval ); +/* 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_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_setFloatRange ( PyObject *value, float *param, + float min, float max); + /* scriplinks-related: */ PyObject *EXPP_getScriptLinks(ScriptLink *slink, PyObject *args, int is_scene); PyObject *EXPP_addScriptLink(ScriptLink *slink, PyObject *args, int is_scene); @@ -106,3 +126,4 @@ PyObject *EXPP_clearScriptLinks(ScriptLink *slink, PyObject *args); void EXPP_allqueue(unsigned short event, short val); #endif /* EXPP_gen_utils_h */ + |