summaryrefslogtreecommitdiff
path: root/src/managers/input/TextInput.hpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-04-25 23:27:25 +0100
committerVaxry <vaxry@vaxry.net>2024-04-25 23:27:44 +0100
commit1d40af64d352bd5a87c7d53a52707fc5cfc6940e (patch)
tree7ad6d1f0dbe3f4d972faf487ffa0cbc9420ee82d /src/managers/input/TextInput.hpp
parente87227e00ae350adebafd2adde95a47e1f68cb3a (diff)
text-input-v3: move to new impl
Diffstat (limited to 'src/managers/input/TextInput.hpp')
-rw-r--r--src/managers/input/TextInput.hpp25
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