Mercurial > minori
annotate include/sys/x11/settings.h @ 378:5912dafc6e28
anime: add poster cache
:)
| author | Paper <paper@tflc.us> |
|---|---|
| date | Wed, 05 Nov 2025 12:50:35 -0500 |
| parents | 99c961c91809 |
| children |
| rev | line source |
|---|---|
| 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 { | |
|
364
99c961c91809
core: refactor out byte stream into its own file
Paper <paper@paper.us.eu.org>
parents:
351
diff
changeset
|
20 std::int32_t integer; |
| 351 | 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_ */ |
