Hyprland/src/managers/input/InputMethodRelay.hpp

51 lines
1.2 KiB
C++
Raw Normal View History

2022-08-05 13:03:37 +02:00
#pragma once
#include "../../defines.hpp"
#include "../../helpers/WLClasses.hpp"
2022-11-07 23:22:13 +01:00
class CInputManager;
2022-08-05 13:03:37 +02:00
class CInputMethodRelay {
public:
CInputMethodRelay();
void onNewIME(wlr_input_method_v2*);
void onNewTextInput(wlr_text_input_v3*);
wlr_input_method_v2* m_pWLRIME = nullptr;
void commitIMEState(wlr_text_input_v3*);
void removeTextInput(wlr_text_input_v3*);
void onKeyboardFocus(wlr_surface*);
STextInput* getFocusedTextInput();
STextInput* getFocusableTextInput();
2022-08-05 13:19:16 +02:00
void setPendingSurface(STextInput*, wlr_surface*);
2022-08-05 16:21:08 +02:00
SIMEKbGrab* getIMEKeyboardGrab(SKeyboard*);
2022-08-05 17:07:01 +02:00
void setIMEPopupFocus(SIMEPopup*, wlr_surface*);
void updateInputPopup(SIMEPopup*);
void damagePopup(SIMEPopup*);
void removePopup(SIMEPopup*);
2022-08-05 13:03:37 +02:00
private:
2022-08-05 16:21:08 +02:00
std::unique_ptr<SIMEKbGrab> m_pKeyboardGrab;
2022-08-05 13:03:37 +02:00
std::list<STextInput> m_lTextInputs;
2022-08-05 17:07:01 +02:00
std::list<SIMEPopup> m_lIMEPopups;
2022-08-05 13:03:37 +02:00
DYNLISTENER(textInputNew);
DYNLISTENER(IMECommit);
DYNLISTENER(IMEDestroy);
2022-08-05 16:21:08 +02:00
DYNLISTENER(IMEGrab);
2022-08-05 17:07:01 +02:00
DYNLISTENER(IMENewPopup);
2022-08-05 13:03:37 +02:00
void createNewTextInput(wlr_text_input_v3*);
2022-08-05 17:07:01 +02:00
friend class CHyprRenderer;
2022-11-07 23:22:13 +01:00
friend class CInputManager;
2022-08-05 13:03:37 +02:00
};