Changeset View
Changeset View
Standalone View
Standalone View
src/server/keystate_interface.h
Show All 31 Lines | |||||
32 | 32 | | |||
33 | class Display; | 33 | class Display; | ||
34 | 34 | | |||
35 | /** | 35 | /** | ||
36 | * @brief Exposes key states to wayland clients | 36 | * @brief Exposes key states to wayland clients | ||
37 | * | 37 | * | ||
38 | * @since 5.58 | 38 | * @since 5.58 | ||
39 | **/ | 39 | **/ | ||
40 | class KWAYLANDSERVER_EXPORT KeyStateInterface : public Global | 40 | class KWAYLANDSERVER_EXPORT KeyStateInterface : public QObject | ||
41 | { | 41 | { | ||
42 | Q_OBJECT | 42 | Q_OBJECT | ||
43 | public: | 43 | public: | ||
44 | virtual ~KeyStateInterface(); | 44 | virtual ~KeyStateInterface(); | ||
45 | 45 | | |||
46 | enum class Key { | 46 | enum class Key { | ||
47 | CapsLock = 0, | 47 | CapsLock = 0, | ||
48 | NumLock = 1, | 48 | NumLock = 1, | ||
49 | ScrollLock = 2, | 49 | ScrollLock = 2, | ||
50 | }; | 50 | }; | ||
51 | Q_ENUM(Key); | 51 | Q_ENUM(Key); | ||
52 | enum State { | 52 | enum State { | ||
53 | Unlocked = 0, | 53 | Unlocked = 0, | ||
54 | Latched = 1, | 54 | Latched = 1, | ||
55 | Locked = 2, | 55 | Locked = 2, | ||
56 | }; | 56 | }; | ||
57 | Q_ENUM(State) | 57 | Q_ENUM(State) | ||
58 | 58 | | |||
59 | void create(); | ||||
59 | void setState(Key k, State s); | 60 | void setState(Key k, State s); | ||
60 | 61 | | |||
61 | private: | 62 | private: | ||
62 | explicit KeyStateInterface(Display *display, QObject *parent = nullptr); | 63 | explicit KeyStateInterface(Display *display, QObject *parent = nullptr); | ||
63 | friend class Display; | 64 | friend class Display; | ||
64 | 65 | | |||
65 | class Private; | 66 | class Private; | ||
67 | QScopedPointer<Private> d; | ||||
66 | }; | 68 | }; | ||
67 | 69 | | |||
68 | } | 70 | } | ||
69 | } | 71 | } | ||
70 | 72 | | |||
71 | #endif | 73 | #endif |