2021-09-24 19:57:15 +02:00
|
|
|
#include <wups.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct ConfigItemMultipleValuesPair {
|
|
|
|
uint32_t value;
|
|
|
|
char *valueName;
|
|
|
|
} ConfigItemMultipleValuesPair;
|
|
|
|
|
|
|
|
typedef struct ConfigItemMultipleValues {
|
2022-09-24 17:43:02 +02:00
|
|
|
char *configId;
|
2021-09-24 19:57:15 +02:00
|
|
|
WUPSConfigItemHandle handle;
|
|
|
|
int32_t defaultValueIndex;
|
|
|
|
int32_t valueIndex;
|
|
|
|
void *callback;
|
|
|
|
ConfigItemMultipleValuesPair *values;
|
|
|
|
int valueCount;
|
|
|
|
} ConfigItemMultipleValues;
|
|
|
|
|
|
|
|
typedef void (*MultipleValuesChangedCallback)(ConfigItemMultipleValues *, uint32_t);
|
|
|
|
|
2022-09-24 17:43:02 +02:00
|
|
|
bool WUPSConfigItemMultipleValues_AddToCategory(WUPSConfigCategoryHandle cat, const char *configId, const char *displayName, int defaultValueIndex, ConfigItemMultipleValuesPair *possibleValues,
|
2021-09-24 19:57:15 +02:00
|
|
|
int pairCount, MultipleValuesChangedCallback callback);
|
|
|
|
|
|
|
|
#define WUPSConfigItemMultipleValues_AddToCategoryHandled(__config__, __cat__, __configID__, __displayName__, __defaultValueIndex__, __possibleValues__, __pairCount__, __callback__) \
|
2022-02-03 16:24:36 +01:00
|
|
|
do { \
|
|
|
|
if (!WUPSConfigItemMultipleValues_AddToCategory(__cat__, __configID__, __displayName__, __defaultValueIndex__, __possibleValues__, __pairCount__, __callback__)) { \
|
|
|
|
WUPSConfig_Destroy(__config__); \
|
|
|
|
return 0; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2021-09-24 19:57:15 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|