Cosmetics
[opentx.git] / radio / src / gui / 480x272 / zone.h
blob2f3243d4031b90cec8a98cc217ac2005d19be0c9
2 #ifndef _ZONE_H_
3 #define _ZONE_H_
5 #include <inttypes.h>
7 #define LEN_ZONE_OPTION_STRING 8
9 #if defined(_MSC_VER)
10 #define OPTION_VALUE_UNSIGNED(x) uint32_t(x)
11 #define OPTION_VALUE_SIGNED(x) uint32_t(x)
12 #define OPTION_VALUE_BOOL(x) bool(x)
13 #define OPTION_VALUE_STRING(...) *(ZoneOptionValue *)(const char *) #__VA_ARGS__
14 #else
15 #define OPTION_VALUE_UNSIGNED(x) { .unsignedValue = (x) }
16 #define OPTION_VALUE_SIGNED(x) { .signedValue = (x) }
17 #define OPTION_VALUE_BOOL(x) { .boolValue = (x) }
18 #define OPTION_VALUE_STRING(...) { .stringValue = {__VA_ARGS__} }
19 #endif
21 struct Zone
23 uint16_t x, y, w, h;
26 union ZoneOptionValue
28 uint32_t unsignedValue;
29 int32_t signedValue;
30 uint32_t boolValue;
31 char stringValue[LEN_ZONE_OPTION_STRING];
34 struct ZoneOption
36 enum Type {
37 Integer,
38 Source,
39 Bool,
40 String,
41 File,
42 TextSize,
43 Timer,
44 Switch,
45 Color
48 const char * name;
49 Type type;
50 ZoneOptionValue deflt;
51 ZoneOptionValue min;
52 ZoneOptionValue max;
55 #endif