1/****************************************************************************
2**
3** Copyright (C) 2018 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtCore module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39#ifndef QXCBATOM_H
40#define QXCBATOM_H
41
42#include <xcb/xcb.h>
43
44class QXcbAtom
45{
46public:
47 enum Atom {
48 // window-manager <-> client protocols
49 WM_PROTOCOLS,
50 WM_DELETE_WINDOW,
51 WM_TAKE_FOCUS,
52 _NET_WM_PING,
53 _NET_WM_CONTEXT_HELP,
54 _NET_WM_SYNC_REQUEST,
55 _NET_WM_SYNC_REQUEST_COUNTER,
56 MANAGER, // System tray notification
57 _NET_SYSTEM_TRAY_OPCODE, // System tray operation
58
59 // ICCCM window state
60 WM_STATE,
61 WM_CHANGE_STATE,
62 WM_CLASS,
63 WM_NAME,
64
65 // Session management
66 WM_CLIENT_LEADER,
67 WM_WINDOW_ROLE,
68 SM_CLIENT_ID,
69 WM_CLIENT_MACHINE,
70
71 // Clipboard
72 CLIPBOARD,
73 INCR,
74 TARGETS,
75 MULTIPLE,
76 TIMESTAMP,
77 SAVE_TARGETS,
78 CLIP_TEMPORARY,
79 _QT_SELECTION,
80 _QT_CLIPBOARD_SENTINEL,
81 _QT_SELECTION_SENTINEL,
82 CLIPBOARD_MANAGER,
83
84 RESOURCE_MANAGER,
85
86 _XSETROOT_ID,
87
88 _QT_SCROLL_DONE,
89 _QT_INPUT_ENCODING,
90
91 // Qt/XCB specific
92 _QT_CLOSE_CONNECTION,
93
94 _MOTIF_WM_HINTS,
95
96 DTWM_IS_RUNNING,
97 ENLIGHTENMENT_DESKTOP,
98 _DT_SAVE_MODE,
99 _SGI_DESKS_MANAGER,
100
101 // EWMH (aka NETWM)
102 _NET_SUPPORTED,
103 _NET_VIRTUAL_ROOTS,
104 _NET_WORKAREA,
105
106 _NET_MOVERESIZE_WINDOW,
107 _NET_WM_MOVERESIZE,
108
109 _NET_WM_NAME,
110 _NET_WM_ICON_NAME,
111 _NET_WM_ICON,
112
113 _NET_WM_PID,
114
115 _NET_WM_WINDOW_OPACITY,
116
117 _NET_WM_STATE,
118 _NET_WM_STATE_ABOVE,
119 _NET_WM_STATE_BELOW,
120 _NET_WM_STATE_FULLSCREEN,
121 _NET_WM_STATE_MAXIMIZED_HORZ,
122 _NET_WM_STATE_MAXIMIZED_VERT,
123 _NET_WM_STATE_MODAL,
124 _NET_WM_STATE_STAYS_ON_TOP,
125 _NET_WM_STATE_DEMANDS_ATTENTION,
126
127 _NET_WM_USER_TIME,
128 _NET_WM_USER_TIME_WINDOW,
129 _NET_WM_FULL_PLACEMENT,
130
131 _NET_WM_WINDOW_TYPE,
132 _NET_WM_WINDOW_TYPE_DESKTOP,
133 _NET_WM_WINDOW_TYPE_DOCK,
134 _NET_WM_WINDOW_TYPE_TOOLBAR,
135 _NET_WM_WINDOW_TYPE_MENU,
136 _NET_WM_WINDOW_TYPE_UTILITY,
137 _NET_WM_WINDOW_TYPE_SPLASH,
138 _NET_WM_WINDOW_TYPE_DIALOG,
139 _NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
140 _NET_WM_WINDOW_TYPE_POPUP_MENU,
141 _NET_WM_WINDOW_TYPE_TOOLTIP,
142 _NET_WM_WINDOW_TYPE_NOTIFICATION,
143 _NET_WM_WINDOW_TYPE_COMBO,
144 _NET_WM_WINDOW_TYPE_DND,
145 _NET_WM_WINDOW_TYPE_NORMAL,
146 _KDE_NET_WM_WINDOW_TYPE_OVERRIDE,
147
148 _KDE_NET_WM_FRAME_STRUT,
149 _NET_FRAME_EXTENTS,
150
151 _NET_STARTUP_INFO,
152 _NET_STARTUP_INFO_BEGIN,
153
154 _NET_SUPPORTING_WM_CHECK,
155
156 _NET_WM_CM_S0,
157
158 _NET_SYSTEM_TRAY_VISUAL,
159
160 _NET_ACTIVE_WINDOW,
161
162 // Property formats
163 TEXT,
164 UTF8_STRING,
165 CARDINAL,
166
167 // Xdnd
168 XdndEnter,
169 XdndPosition,
170 XdndStatus,
171 XdndLeave,
172 XdndDrop,
173 XdndFinished,
174 XdndTypelist,
175 XdndActionList,
176
177 XdndSelection,
178
179 XdndAware,
180 XdndProxy,
181
182 XdndActionCopy,
183 XdndActionLink,
184 XdndActionMove,
185 XdndActionPrivate,
186
187 // Xkb
188 _XKB_RULES_NAMES,
189
190 // XEMBED
191 _XEMBED,
192 _XEMBED_INFO,
193
194 // XInput2
195 ButtonLeft,
196 ButtonMiddle,
197 ButtonRight,
198 ButtonWheelUp,
199 ButtonWheelDown,
200 ButtonHorizWheelLeft,
201 ButtonHorizWheelRight,
202 AbsMTPositionX,
203 AbsMTPositionY,
204 AbsMTTouchMajor,
205 AbsMTTouchMinor,
206 AbsMTOrientation,
207 AbsMTPressure,
208 AbsMTTrackingID,
209 MaxContacts,
210 RelX,
211 RelY,
212 // XInput2 tablet
213 AbsX,
214 AbsY,
215 AbsPressure,
216 AbsTiltX,
217 AbsTiltY,
218 AbsWheel,
219 AbsDistance,
220 WacomSerialIDs,
221 INTEGER,
222 RelHorizWheel,
223 RelVertWheel,
224 RelHorizScroll,
225 RelVertScroll,
226
227 _XSETTINGS_SETTINGS,
228
229 _COMPIZ_DECOR_PENDING,
230 _COMPIZ_DECOR_REQUEST,
231 _COMPIZ_DECOR_DELETE_PIXMAP,
232 _COMPIZ_TOOLKIT_ACTION,
233 _GTK_LOAD_ICONTHEMES,
234
235 AT_SPI_BUS,
236
237 EDID,
238 EDID_DATA,
239 XFree86_DDC_EDID1_RAWDATA,
240
241 NAtoms
242 };
243
244 QXcbAtom();
245 void initialize(xcb_connection_t *connection);
246
247 inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; }
248 QXcbAtom::Atom qatom(xcb_atom_t atom) const;
249
250protected:
251 void initializeAllAtoms(xcb_connection_t *connection);
252
253private:
254 xcb_atom_t m_allAtoms[QXcbAtom::NAtoms];
255};
256
257#endif // QXCBATOM_H
258