diff options
Diffstat (limited to 'src/managers/input/TextInput.hpp')
| -rw-r--r-- | src/managers/input/TextInput.hpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/managers/input/TextInput.hpp b/src/managers/input/TextInput.hpp index 4acfb960..6d7e9c59 100644 --- a/src/managers/input/TextInput.hpp +++ b/src/managers/input/TextInput.hpp @@ -3,17 +3,19 @@ #include "../../helpers/WLListener.hpp" #include "../../macros.hpp" #include "../../helpers/Box.hpp" +#include "../../helpers/signal/Listener.hpp" +#include <memory> -struct wlr_text_input_v3; struct wlr_surface; struct wl_client; struct STextInputV1; +class CTextInputV3; class CTextInput { public: + CTextInput(std::weak_ptr<CTextInputV3> ti); CTextInput(STextInputV1* ti); - CTextInput(wlr_text_input_v3* ti); ~CTextInput(); bool isV3(); @@ -34,13 +36,13 @@ class CTextInput { wlr_surface* focusedSurface(); private: - void setFocusedSurface(wlr_surface* pSurface); - void initCallbacks(); + void setFocusedSurface(wlr_surface* pSurface); + void initCallbacks(); - wlr_surface* pFocusedSurface = nullptr; - int enterLocks = 0; - wlr_text_input_v3* pWlrInput = nullptr; - STextInputV1* pV1Input = nullptr; + wlr_surface* pFocusedSurface = nullptr; + int enterLocks = 0; + std::weak_ptr<CTextInputV3> pV3Input; + STextInputV1* pV1Input = nullptr; DYNLISTENER(textInputEnable); DYNLISTENER(textInputDisable); @@ -48,4 +50,11 @@ class CTextInput { DYNLISTENER(textInputDestroy); DYNLISTENER(surfaceUnmapped); DYNLISTENER(surfaceDestroyed); + + struct { + CHyprSignalListener enable; + CHyprSignalListener disable; + CHyprSignalListener commit; + CHyprSignalListener destroy; + } listeners; };
\ No newline at end of file |
