2021-09-24 19:57:15 +02:00
|
|
|
#include <wups.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct ConfigItemIntegerRange {
|
2022-09-24 17:41:20 +02:00
|
|
|
char *configId;
|
2021-09-24 19:57:15 +02:00
|
|
|
WUPSConfigItemHandle handle;
|
|
|
|
int defaultValue;
|
|
|
|
int value;
|
|
|
|
int minValue;
|
|
|
|
int maxValue;
|
|
|
|
void *callback;
|
|
|
|
} ConfigItemIntegerRange;
|
|
|
|
|
|
|
|
typedef void (*IntegerRangeValueChangedCallback)(ConfigItemIntegerRange *, int32_t);
|
|
|
|
|
2022-09-24 17:41:20 +02:00
|
|
|
bool WUPSConfigItemIntegerRange_AddToCategory(WUPSConfigCategoryHandle cat, const char *configId, const char *displayName,
|
2022-02-03 16:24:36 +01:00
|
|
|
int32_t defaultValue, int32_t minValue, int32_t maxValue,
|
|
|
|
IntegerRangeValueChangedCallback callback);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2022-09-24 17:41:20 +02:00
|
|
|
#define WUPSConfigItemIntegerRange_AddToCategoryHandled(__config__, __cat__, __configId__, __displayName__, __defaultValue__, __minValue__, __maxValue__, __callback__) \
|
2022-02-03 16:24:36 +01:00
|
|
|
do { \
|
2022-09-24 17:41:20 +02:00
|
|
|
if (!WUPSConfigItemIntegerRange_AddToCategory(__cat__, __configId__, __displayName__, __defaultValue__, __minValue__, __maxValue__, __callback__)) { \
|
2022-02-03 16:24:36 +01:00
|
|
|
WUPSConfig_Destroy(__config__); \
|
|
|
|
return 0; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2021-09-24 19:57:15 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|