From 06950aab233de6a2f47293d59575bb42f6131660 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 27 Jan 2021 22:06:49 +0100 Subject: Complete rewrite using C++ and with shared state support --- src/xcb_resources.hh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/xcb_resources.hh (limited to 'src/xcb_resources.hh') diff --git a/src/xcb_resources.hh b/src/xcb_resources.hh new file mode 100644 index 0000000..5e04e26 --- /dev/null +++ b/src/xcb_resources.hh @@ -0,0 +1,35 @@ +#ifndef XCB_RESOURCES_HH +#define XCB_RESOURCES_HH + +#include "xcb_connection.hh" + +#include +#include +#include + +namespace xcb { + +class Resources { +public: + virtual ~Resources() = default; + + virtual std::optional get_string(std::string const& name, + std::string const& clazz) = 0; + + virtual std::optional get_long(std::string const& name, + std::string const& clazz) = 0; + + virtual std::optional get_bool(std::string const& name, + std::string const& clazz) = 0; + + static std::unique_ptr create(shared_conn conn); + +protected: + Resources() = default; + Resources(Resources const&) = delete; + Resources& operator=(Resources const&) = delete; +}; + +} // namespace xcb + +#endif // XCB_RESOURCES_HH -- cgit v1.2.3-70-g09d2