text-input-v3: move to new impl

This commit is contained in:
Vaxry
2024-04-25 23:27:25 +01:00
parent e87227e00a
commit 1d40af64d3
14 changed files with 316 additions and 72 deletions

View File

@@ -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;
};