libvisual  0.5.0
lv_param_validators.h
1 #ifndef _LV_PARAM_VALIDATORS_H
2 #define _LV_PARAM_VALIDATORS_H
3 
4 #include <libvisual/lvconfig.h>
5 #include <libvisual/lv_defines.h>
6 #include <libvisual/lv_param_value.h>
7 
8 #ifdef __cplusplus
9 
10 namespace LV {
11 
12  class Closure;
13 
14 } // LV namespace
15 
16 typedef LV::Closure VisClosure;
17 
18 #else
19 
20 typedef struct _VisClosure VisClosure;
21 
22 #endif
23 
24 LV_BEGIN_DECLS
25 
26 LV_API VisClosure *visual_param_in_range (VisParamType type, void *lower, void *upper);
27 
28 #define _LV_DEFINE_PARAM_IN_RANGE(func,ctype,type,marshal) \
29  static inline VisClosure *visual_param_in_range_##func (ctype lower, ctype upper) { \
30  return visual_param_in_range (VISUAL_PARAM_TYPE_##type, \
31  _LV_PARAM_MARSHAL_##marshal (lower), \
32  _LV_PARAM_MARSHAL_##marshal (upper)); \
33  }
34 
35 _LV_DEFINE_PARAM_IN_RANGE (integer, int , INTEGER, INTEGER)
36 _LV_DEFINE_PARAM_IN_RANGE (float , float , FLOAT, FLOAT)
37 _LV_DEFINE_PARAM_IN_RANGE (double , double, DOUBLE, DOUBLE)
38 
39 LV_END_DECLS
40 
41 #endif /* _LV_PARAM_VALIDATORS_H */