351
|
1 #ifndef MINORI_SYS_X11_SETTINGS_H_
|
|
2 #define MINORI_SYS_X11_SETTINGS_H_
|
|
3
|
|
4 #include <cstdint>
|
|
5 #include <string>
|
|
6 #include <vector>
|
|
7
|
|
8 namespace x11 {
|
|
9
|
|
10 /* stores the item, type, etc */
|
|
11 struct SettingsItem {
|
|
12 enum Type {
|
|
13 TypeInt = 0,
|
|
14 TypeStr = 1,
|
|
15 TypeRgba = 2,
|
|
16 };
|
|
17
|
|
18 /* could technically be a union */
|
|
19 struct Data {
|
|
20 std::uint32_t integer;
|
|
21 std::string string;
|
|
22 struct {
|
|
23 std::uint16_t red, green, blue, alpha;
|
|
24 } rgba;
|
|
25 };
|
|
26
|
|
27 bool VerifyType();
|
|
28
|
|
29 std::uint8_t type; /* one of Type */
|
|
30 std::string name; /* name of the item */
|
|
31 std::uint32_t serial; /* last-changed serial */
|
|
32 Data data; /* type-specific data */
|
|
33 };
|
|
34
|
|
35 bool GetSettings(std::vector<SettingsItem>& settings);
|
|
36 bool FindSetting(const std::string& name, SettingsItem& setting);
|
|
37
|
|
38 }
|
|
39
|
|
40 #endif /* MINORI_SYS_X11_SETTINGS_H_ */ |