From 1d40af64d352bd5a87c7d53a52707fc5cfc6940e Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 25 Apr 2024 23:27:25 +0100 Subject: text-input-v3: move to new impl --- src/managers/input/TextInput.hpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/managers/input/TextInput.hpp') 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 -struct wlr_text_input_v3; struct wlr_surface; struct wl_client; struct STextInputV1; +class CTextInputV3; class CTextInput { public: + CTextInput(std::weak_ptr 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 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 -- cgit v1.2.3