summaryrefslogtreecommitdiff
path: root/src/xcb_resources.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@opera.com>2026-01-12 23:06:20 +0100
committerJoel Klinghed <the_jk@opera.com>2026-01-12 23:06:20 +0100
commitdfeb19b0a83b8ce57d28bf94a4f8d129993d1064 (patch)
treed352908df286058059e306c350d89a07c67049eb /src/xcb_resources.hh
Initial commit
Diffstat (limited to 'src/xcb_resources.hh')
-rw-r--r--src/xcb_resources.hh35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/xcb_resources.hh b/src/xcb_resources.hh
new file mode 100644
index 0000000..f0482c3
--- /dev/null
+++ b/src/xcb_resources.hh
@@ -0,0 +1,35 @@
+#ifndef XCB_RESOURCES_HH
+#define XCB_RESOURCES_HH
+
+#include "xcb_connection.hh"
+
+#include <memory>
+#include <optional>
+#include <string>
+
+namespace xcb {
+
+class Resources {
+ public:
+ virtual ~Resources() = default;
+
+ virtual std::optional<std::string> get_string(std::string const& name,
+ std::string const& clazz) = 0;
+
+ virtual std::optional<long> get_long(std::string const& name,
+ std::string const& clazz) = 0;
+
+ virtual std::optional<bool> get_bool(std::string const& name,
+ std::string const& clazz) = 0;
+
+ static std::unique_ptr<Resources> create(shared_conn conn);
+
+ protected:
+ Resources() = default;
+ Resources(Resources const&) = delete;
+ Resources& operator=(Resources const&) = delete;
+};
+
+} // namespace xcb
+
+#endif // XCB_RESOURCES_HH