Mercurial > minori
comparison include/sys/x11/settings.h @ 351:c844f8bb87ce
gui/theme: add xsettings backend
this also adds newly-necessary endianness methods in core/endian.h
which just so happen to be constexpr as well
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sun, 14 Jul 2024 23:23:56 -0400 |
parents | |
children | 99c961c91809 |
comparison
equal
deleted
inserted
replaced
350:daa03aa2262d | 351:c844f8bb87ce |
---|---|
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_ */ |