1 | // Copyright (C) 2018 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | #ifndef QXCBATOM_H |
4 | #define QXCBATOM_H |
5 | |
6 | #include <xcb/xcb.h> |
7 | |
8 | class QXcbAtom |
9 | { |
10 | public: |
11 | enum Atom { |
12 | // window-manager <-> client protocols |
13 | AtomWM_PROTOCOLS, |
14 | AtomWM_DELETE_WINDOW, |
15 | AtomWM_TAKE_FOCUS, |
16 | Atom_NET_WM_PING, |
17 | Atom_NET_WM_CONTEXT_HELP, |
18 | Atom_NET_WM_SYNC_REQUEST, |
19 | Atom_NET_WM_SYNC_REQUEST_COUNTER, |
20 | AtomMANAGER, // System tray notification |
21 | Atom_NET_SYSTEM_TRAY_OPCODE, // System tray operation |
22 | |
23 | // ICCCM window state |
24 | AtomWM_STATE, |
25 | AtomWM_CHANGE_STATE, |
26 | AtomWM_CLASS, |
27 | AtomWM_NAME, |
28 | |
29 | // Session management |
30 | AtomWM_CLIENT_LEADER, |
31 | AtomWM_WINDOW_ROLE, |
32 | AtomSM_CLIENT_ID, |
33 | AtomWM_CLIENT_MACHINE, |
34 | |
35 | // Clipboard |
36 | AtomCLIPBOARD, |
37 | AtomINCR, |
38 | AtomTARGETS, |
39 | AtomMULTIPLE, |
40 | AtomTIMESTAMP, |
41 | AtomSAVE_TARGETS, |
42 | AtomCLIP_TEMPORARY, |
43 | Atom_QT_SELECTION, |
44 | Atom_QT_CLIPBOARD_SENTINEL, |
45 | Atom_QT_SELECTION_SENTINEL, |
46 | AtomCLIPBOARD_MANAGER, |
47 | |
48 | AtomRESOURCE_MANAGER, |
49 | |
50 | Atom_XSETROOT_ID, |
51 | |
52 | Atom_QT_SCROLL_DONE, |
53 | Atom_QT_INPUT_ENCODING, |
54 | |
55 | // Qt/XCB specific |
56 | Atom_QT_CLOSE_CONNECTION, |
57 | |
58 | Atom_QT_GET_TIMESTAMP, |
59 | |
60 | Atom_MOTIF_WM_HINTS, |
61 | |
62 | AtomDTWM_IS_RUNNING, |
63 | AtomENLIGHTENMENT_DESKTOP, |
64 | Atom_DT_SAVE_MODE, |
65 | Atom_SGI_DESKS_MANAGER, |
66 | |
67 | // EWMH (aka NETWM) |
68 | Atom_NET_SUPPORTED, |
69 | Atom_NET_VIRTUAL_ROOTS, |
70 | Atom_NET_WORKAREA, |
71 | |
72 | Atom_NET_MOVERESIZE_WINDOW, |
73 | Atom_NET_WM_MOVERESIZE, |
74 | |
75 | Atom_NET_WM_NAME, |
76 | Atom_NET_WM_ICON_NAME, |
77 | Atom_NET_WM_ICON, |
78 | |
79 | Atom_NET_WM_PID, |
80 | |
81 | Atom_NET_WM_WINDOW_OPACITY, |
82 | |
83 | Atom_NET_WM_STATE, |
84 | Atom_NET_WM_STATE_ABOVE, |
85 | Atom_NET_WM_STATE_BELOW, |
86 | Atom_NET_WM_STATE_FULLSCREEN, |
87 | Atom_NET_WM_STATE_MAXIMIZED_HORZ, |
88 | Atom_NET_WM_STATE_MAXIMIZED_VERT, |
89 | Atom_NET_WM_STATE_MODAL, |
90 | Atom_NET_WM_STATE_STAYS_ON_TOP, |
91 | Atom_NET_WM_STATE_DEMANDS_ATTENTION, |
92 | Atom_NET_WM_STATE_HIDDEN, |
93 | |
94 | Atom_NET_WM_USER_TIME, |
95 | Atom_NET_WM_USER_TIME_WINDOW, |
96 | Atom_NET_WM_FULL_PLACEMENT, |
97 | |
98 | Atom_NET_WM_WINDOW_TYPE, |
99 | Atom_NET_WM_WINDOW_TYPE_DESKTOP, |
100 | Atom_NET_WM_WINDOW_TYPE_DOCK, |
101 | Atom_NET_WM_WINDOW_TYPE_TOOLBAR, |
102 | , |
103 | Atom_NET_WM_WINDOW_TYPE_UTILITY, |
104 | Atom_NET_WM_WINDOW_TYPE_SPLASH, |
105 | Atom_NET_WM_WINDOW_TYPE_DIALOG, |
106 | , |
107 | , |
108 | Atom_NET_WM_WINDOW_TYPE_TOOLTIP, |
109 | Atom_NET_WM_WINDOW_TYPE_NOTIFICATION, |
110 | Atom_NET_WM_WINDOW_TYPE_COMBO, |
111 | Atom_NET_WM_WINDOW_TYPE_DND, |
112 | Atom_NET_WM_WINDOW_TYPE_NORMAL, |
113 | Atom_KDE_NET_WM_WINDOW_TYPE_OVERRIDE, |
114 | |
115 | Atom_KDE_NET_WM_FRAME_STRUT, |
116 | Atom_NET_FRAME_EXTENTS, |
117 | |
118 | Atom_NET_STARTUP_INFO, |
119 | Atom_NET_STARTUP_INFO_BEGIN, |
120 | Atom_NET_STARTUP_ID, |
121 | |
122 | Atom_NET_SUPPORTING_WM_CHECK, |
123 | |
124 | Atom_NET_WM_CM_S0, |
125 | |
126 | Atom_NET_SYSTEM_TRAY_VISUAL, |
127 | |
128 | Atom_NET_ACTIVE_WINDOW, |
129 | |
130 | // Property formats |
131 | AtomTEXT, |
132 | AtomUTF8_STRING, |
133 | AtomCARDINAL, |
134 | |
135 | // Xdnd |
136 | AtomXdndEnter, |
137 | AtomXdndPosition, |
138 | AtomXdndStatus, |
139 | AtomXdndLeave, |
140 | AtomXdndDrop, |
141 | AtomXdndFinished, |
142 | AtomXdndTypelist, |
143 | AtomXdndActionList, |
144 | |
145 | AtomXdndSelection, |
146 | |
147 | AtomXdndAware, |
148 | AtomXdndProxy, |
149 | |
150 | AtomXdndActionCopy, |
151 | AtomXdndActionLink, |
152 | AtomXdndActionMove, |
153 | AtomXdndActionAsk, |
154 | AtomXdndActionPrivate, |
155 | |
156 | // Xkb |
157 | Atom_XKB_RULES_NAMES, |
158 | |
159 | // XEMBED |
160 | Atom_XEMBED, |
161 | Atom_XEMBED_INFO, |
162 | |
163 | // XInput2 |
164 | AtomButtonLeft, |
165 | AtomButtonMiddle, |
166 | AtomButtonRight, |
167 | AtomButtonWheelUp, |
168 | AtomButtonWheelDown, |
169 | AtomButtonHorizWheelLeft, |
170 | AtomButtonHorizWheelRight, |
171 | AtomAbsMTPositionX, |
172 | AtomAbsMTPositionY, |
173 | AtomAbsMTTouchMajor, |
174 | AtomAbsMTTouchMinor, |
175 | AtomAbsMTOrientation, |
176 | AtomAbsMTPressure, |
177 | AtomAbsMTTrackingID, |
178 | AtomMaxContacts, |
179 | AtomRelX, |
180 | AtomRelY, |
181 | // XInput2 tablet |
182 | AtomAbsX, |
183 | AtomAbsY, |
184 | AtomAbsPressure, |
185 | AtomAbsTiltX, |
186 | AtomAbsTiltY, |
187 | AtomAbsWheel, |
188 | AtomAbsDistance, |
189 | AtomWacomSerialIDs, |
190 | AtomINTEGER, |
191 | AtomRelHorizWheel, |
192 | AtomRelVertWheel, |
193 | AtomRelHorizScroll, |
194 | AtomRelVertScroll, |
195 | |
196 | Atom_XSETTINGS_SETTINGS, |
197 | |
198 | Atom_COMPIZ_DECOR_PENDING, |
199 | Atom_COMPIZ_DECOR_REQUEST, |
200 | Atom_COMPIZ_DECOR_DELETE_PIXMAP, |
201 | Atom_COMPIZ_TOOLKIT_ACTION, |
202 | Atom_GTK_LOAD_ICONTHEMES, |
203 | |
204 | AtomAT_SPI_BUS, |
205 | |
206 | AtomEDID, |
207 | AtomEDID_DATA, |
208 | AtomXFree86_DDC_EDID1_RAWDATA, |
209 | |
210 | Atom_ICC_PROFILE, |
211 | |
212 | NAtoms |
213 | }; |
214 | |
215 | QXcbAtom(); |
216 | void initialize(xcb_connection_t *connection); |
217 | |
218 | inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } |
219 | QXcbAtom::Atom qatom(xcb_atom_t atom) const; |
220 | |
221 | protected: |
222 | void initializeAllAtoms(xcb_connection_t *connection); |
223 | |
224 | private: |
225 | xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; |
226 | }; |
227 | |
228 | #endif // QXCBATOM_H |
229 | |