Mercurial > minori
view include/sys/x11/settings.h @ 364:99c961c91809
core: refactor out byte stream into its own file
easy dubs
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 16 Jul 2024 21:15:59 -0400 |
parents | c844f8bb87ce |
children |
line wrap: on
line source
#ifndef MINORI_SYS_X11_SETTINGS_H_ #define MINORI_SYS_X11_SETTINGS_H_ #include <cstdint> #include <string> #include <vector> namespace x11 { /* stores the item, type, etc */ struct SettingsItem { enum Type { TypeInt = 0, TypeStr = 1, TypeRgba = 2, }; /* could technically be a union */ struct Data { std::int32_t integer; std::string string; struct { std::uint16_t red, green, blue, alpha; } rgba; }; bool VerifyType(); std::uint8_t type; /* one of Type */ std::string name; /* name of the item */ std::uint32_t serial; /* last-changed serial */ Data data; /* type-specific data */ }; bool GetSettings(std::vector<SettingsItem>& settings); bool FindSetting(const std::string& name, SettingsItem& setting); } #endif /* MINORI_SYS_X11_SETTINGS_H_ */