summaryrefslogtreecommitdiff
path: root/src/managers/input/InputMethodPopup.hpp
blob: 8bcf11018887ed7aff2006df5231c4d9dda5b3e2 (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
#pragma once

#include "../../helpers/WLListener.hpp"
#include "../../desktop/WLSurface.hpp"
#include "../../macros.hpp"
#include "../../helpers/Box.hpp"

struct wlr_input_popup_surface_v2;

class CInputPopup {
  public:
    CInputPopup(wlr_input_popup_surface_v2* surf);

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

    void         damageEntire();
    void         damageSurface();

    bool         isVecInPopup(const Vector2D& point);

    CBox         globalBox();
    wlr_surface* getWlrSurface();

  private:
    void                        initCallbacks();
    CWLSurface*                 queryOwner();
    void                        updateBox();

    wlr_input_popup_surface_v2* pWlr = nullptr;
    CWLSurface                  surface;
    CBox                        lastBoxLocal;
    uint64_t                    lastMonitor = -1;

    DYNLISTENER(mapPopup);
    DYNLISTENER(unmapPopup);
    DYNLISTENER(destroyPopup);
    DYNLISTENER(commitPopup);
};