summaryrefslogtreecommitdiff
path: root/src/managers/input/InputMethodPopup.hpp
blob: 53c11cffa0cd3130a7f98003c025352e6d1405fd (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
40
41
42
43
#pragma once

#include "../../desktop/WLSurface.hpp"
#include "../../macros.hpp"
#include "../../helpers/math/Math.hpp"
#include "../../helpers/signal/Signal.hpp"

class CInputMethodPopupV2;

class CInputPopup {
  public:
    CInputPopup(SP<CInputMethodPopupV2> popup);

    void                   damageEntire();
    void                   damageSurface();

    bool                   isVecInPopup(const Vector2D& point);

    CBox                   globalBox();
    SP<CWLSurfaceResource> getSurface();

    void                   onCommit();

  private:
    SP<CWLSurface>          queryOwner();
    void                    updateBox();

    void                    onDestroy();
    void                    onMap();
    void                    onUnmap();

    WP<CInputMethodPopupV2> popup;
    SP<CWLSurface>          surface;
    CBox                    lastBoxLocal;
    MONITORID               lastMonitor = MONITOR_INVALID;

    struct {
        CHyprSignalListener map;
        CHyprSignalListener unmap;
        CHyprSignalListener destroy;
        CHyprSignalListener commit;
    } listeners;
};