summaryrefslogtreecommitdiff
path: root/src/managers/input/InputMethodRelay.hpp
blob: ff6fb1285bc2efb2aabbd485d772a68d771bbf83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include "../../defines.hpp"
#include "../../helpers/WLClasses.hpp"

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();

    void        setPendingSurface(STextInput*, wlr_surface*);

    SIMEKbGrab* getIMEKeyboardGrab(SKeyboard*);

private:

    std::unique_ptr<SIMEKbGrab> m_pKeyboardGrab;

    std::list<STextInput>   m_lTextInputs;

    DYNLISTENER(textInputNew);
    DYNLISTENER(IMECommit);
    DYNLISTENER(IMEDestroy);
    DYNLISTENER(IMEGrab);

    void        createNewTextInput(wlr_text_input_v3*);
};