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_xkb.hh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/xcb_xkb.hh (limited to 'src/xcb_xkb.hh') diff --git a/src/xcb_xkb.hh b/src/xcb_xkb.hh new file mode 100644 index 0000000..7bb3681 --- /dev/null +++ b/src/xcb_xkb.hh @@ -0,0 +1,30 @@ +#ifndef XCB_XKB_HH +#define XCB_XKB_HH + +#include +#include +#include +#include + +namespace xcb { + +class Keyboard { +public: + virtual ~Keyboard() = default; + + virtual bool handle_event(xcb_connection_t* conn, + xcb_generic_event_t* event) = 0; + + virtual std::string get_utf8(xcb_key_press_event_t* event) = 0; + + static std::unique_ptr create(xcb_connection_t* conn); + +protected: + Keyboard() = default; + Keyboard(Keyboard const&) = delete; + Keyboard& operator=(Keyboard const&) = delete; +}; + +} // namespace xcb + +#endif // XCB_XKB_HH -- cgit v1.2.3-70-g09d2