#pragma once #include #include #include #include "WaylandProtocol.hpp" #include "virtual-keyboard-unstable-v1.hpp" #include "../helpers/signal/Signal.hpp" class CVirtualKeyboardV1Resource { public: CVirtualKeyboardV1Resource(SP resource_); ~CVirtualKeyboardV1Resource(); struct { CSignal destroy; } events; bool good(); wlr_keyboard* wlr(); wl_client* client(); private: SP resource; wlr_keyboard keyboard; void releasePressed(); bool hasKeymap = false; }; class CVirtualKeyboardProtocol : public IWaylandProtocol { public: CVirtualKeyboardProtocol(const wl_interface* iface, const int& ver, const std::string& name); virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id); struct { CSignal newKeyboard; // SP } events; private: void onManagerResourceDestroy(wl_resource* res); void destroyResource(CVirtualKeyboardV1Resource* keeb); void onCreateKeeb(CZwpVirtualKeyboardManagerV1* pMgr, wl_resource* seat, uint32_t id); // std::vector> m_vManagers; std::vector> m_vKeyboards; friend class CVirtualKeyboardV1Resource; }; namespace PROTO { inline UP virtualKeyboard; };