#pragma once #include #include #include #include "WaylandProtocol.hpp" #include "keyboard-shortcuts-inhibit-unstable-v1.hpp" class CWLSurfaceResource; class CKeyboardShortcutsInhibitor { public: CKeyboardShortcutsInhibitor(SP resource_, SP surf); // read-only pointer, may be invalid SP surface(); bool good(); private: SP resource; WP pSurface; }; class CKeyboardShortcutsInhibitProtocol : public IWaylandProtocol { public: CKeyboardShortcutsInhibitProtocol(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); bool isInhibited(); private: void onManagerResourceDestroy(wl_resource* res); void destroyInhibitor(CKeyboardShortcutsInhibitor* pointer); void onInhibit(CZwpKeyboardShortcutsInhibitManagerV1* pMgr, uint32_t id, wl_resource* surface, wl_resource* seat); // std::vector> m_vManagers; std::vector> m_vInhibitors; friend class CKeyboardShortcutsInhibitor; }; namespace PROTO { inline UP shortcutsInhibit; };