1 | /* |
2 | SPDX-FileCopyrightText: 2015 Thomas Lübking <thomas.luebking@gmail.com> |
3 | |
4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
5 | */ |
6 | |
7 | #if (!defined ATOMS_H) || (defined ENUM_CREATE_CHAR_ARRAY) |
8 | |
9 | #undef ENUM_BEGIN |
10 | #undef ENUM |
11 | #undef ENUM_END |
12 | #undef ENUM_COUNT |
13 | |
14 | // the following macros are set in a way so that |
15 | // the code below will either construct an enum for "<typ>" |
16 | // or a const *char array "<typ>Strings" containing all enum |
17 | // symbols as strings, depending on whether ENUM_CREATE_CHAR_ARRAY is |
18 | // defined |
19 | // The enum gets one extra item "<typ>Count", describing also the |
20 | // length of the array |
21 | |
22 | // The header is safe for re-inclusion unless you define ENUM_CREATE_CHAR_ARRAY |
23 | // which is therefore undefined after usage |
24 | |
25 | // => You *must* "#define ENUM_CREATE_CHAR_ARRAY 1" *every* time you want to create |
26 | // a string array! |
27 | |
28 | // clang-format off |
29 | |
30 | #ifndef ENUM_CREATE_CHAR_ARRAY |
31 | #define ATOMS_H |
32 | #define ENUM_BEGIN(typ) enum typ { |
33 | #define ENUM(nam) nam |
34 | #define ENUM_COUNT(typ) , typ##Count |
35 | #else |
36 | #define ENUM_BEGIN(typ) const char * typ##Strings [] = { |
37 | #define ENUM(nam) #nam |
38 | #define ENUM_COUNT(typ) |
39 | #undef ENUM_CREATE_CHAR_ARRAY |
40 | #endif |
41 | |
42 | #define ENUM_END(typ) }; |
43 | |
44 | ENUM_BEGIN(KwsAtom) |
45 | ENUM(UTF8_STRING), |
46 | |
47 | // root window properties |
48 | ENUM(_NET_SUPPORTED), |
49 | ENUM(_NET_SUPPORTING_WM_CHECK), |
50 | ENUM(_NET_CLIENT_LIST), |
51 | ENUM(_NET_CLIENT_LIST_STACKING), |
52 | ENUM(_NET_NUMBER_OF_DESKTOPS), |
53 | ENUM(_NET_DESKTOP_GEOMETRY), |
54 | ENUM(_NET_DESKTOP_VIEWPORT), |
55 | ENUM(_NET_CURRENT_DESKTOP), |
56 | ENUM(_NET_DESKTOP_NAMES), |
57 | ENUM(_NET_ACTIVE_WINDOW), |
58 | ENUM(_NET_WORKAREA), |
59 | ENUM(_NET_VIRTUAL_ROOTS), |
60 | ENUM(_NET_DESKTOP_LAYOUT), |
61 | ENUM(_NET_SHOWING_DESKTOP), |
62 | |
63 | // root window messages |
64 | ENUM(_NET_CLOSE_WINDOW), |
65 | ENUM(_NET_RESTACK_WINDOW), |
66 | ENUM(_NET_WM_MOVERESIZE), |
67 | ENUM(_NET_MOVERESIZE_WINDOW), |
68 | |
69 | // application window properties |
70 | ENUM(_NET_WM_NAME), |
71 | ENUM(_NET_WM_VISIBLE_NAME), |
72 | ENUM(_NET_WM_ICON_NAME), |
73 | ENUM(_NET_WM_VISIBLE_ICON_NAME), |
74 | ENUM(_NET_WM_DESKTOP), |
75 | ENUM(_NET_WM_WINDOW_TYPE), |
76 | ENUM(_NET_WM_STATE), |
77 | ENUM(_NET_WM_STRUT), |
78 | ENUM(_NET_WM_STRUT_PARTIAL), |
79 | ENUM(_NET_WM_ICON_GEOMETRY), |
80 | ENUM(_NET_WM_ICON), |
81 | ENUM(_NET_WM_PID), |
82 | ENUM(_NET_WM_USER_TIME), |
83 | ENUM(_NET_WM_HANDLED_ICONS), |
84 | ENUM(_NET_STARTUP_ID), |
85 | ENUM(_NET_WM_ALLOWED_ACTIONS), |
86 | ENUM(WM_WINDOW_ROLE), |
87 | ENUM(_NET_FRAME_EXTENTS), |
88 | ENUM(_NET_WM_WINDOW_OPACITY), |
89 | ENUM(_NET_WM_FULLSCREEN_MONITORS), |
90 | ENUM(_NET_WM_OPAQUE_REGION), |
91 | ENUM(_KDE_NET_WM_DESKTOP_FILE), |
92 | // used to determine whether application window is managed or not |
93 | ENUM(WM_STATE), |
94 | |
95 | // application window types |
96 | ENUM(_NET_WM_WINDOW_TYPE_NORMAL), |
97 | ENUM(_NET_WM_WINDOW_TYPE_DESKTOP), |
98 | ENUM(_NET_WM_WINDOW_TYPE_DOCK), |
99 | ENUM(_NET_WM_WINDOW_TYPE_TOOLBAR), |
100 | ENUM(), |
101 | ENUM(_NET_WM_WINDOW_TYPE_DIALOG), |
102 | ENUM(_NET_WM_WINDOW_TYPE_UTILITY), |
103 | ENUM(_NET_WM_WINDOW_TYPE_SPLASH), |
104 | ENUM(), |
105 | ENUM(), |
106 | ENUM(_NET_WM_WINDOW_TYPE_TOOLTIP), |
107 | ENUM(_NET_WM_WINDOW_TYPE_NOTIFICATION), |
108 | ENUM(_NET_WM_WINDOW_TYPE_COMBO), |
109 | ENUM(_NET_WM_WINDOW_TYPE_DND), |
110 | |
111 | // application window state |
112 | ENUM(_NET_WM_STATE_MODAL), |
113 | ENUM(_NET_WM_STATE_STICKY), |
114 | ENUM(_NET_WM_STATE_MAXIMIZED_VERT), |
115 | ENUM(_NET_WM_STATE_MAXIMIZED_HORZ), |
116 | ENUM(_NET_WM_STATE_SHADED), |
117 | ENUM(_NET_WM_STATE_SKIP_TASKBAR), |
118 | ENUM(), |
119 | ENUM(_NET_WM_STATE_HIDDEN), |
120 | ENUM(_NET_WM_STATE_FULLSCREEN), |
121 | ENUM(_NET_WM_STATE_ABOVE), |
122 | ENUM(_NET_WM_STATE_BELOW), |
123 | ENUM(_NET_WM_STATE_DEMANDS_ATTENTION), |
124 | ENUM(_NET_WM_STATE_FOCUSED), |
125 | // KDE-specific atom |
126 | ENUM(_KDE_NET_WM_STATE_SKIP_SWITCHER), |
127 | |
128 | // allowed actions |
129 | ENUM(_NET_WM_ACTION_MOVE), |
130 | ENUM(_NET_WM_ACTION_RESIZE), |
131 | ENUM(_NET_WM_ACTION_MINIMIZE), |
132 | ENUM(_NET_WM_ACTION_SHADE), |
133 | ENUM(_NET_WM_ACTION_STICK), |
134 | ENUM(_NET_WM_ACTION_MAXIMIZE_VERT), |
135 | ENUM(_NET_WM_ACTION_MAXIMIZE_HORZ), |
136 | ENUM(_NET_WM_ACTION_FULLSCREEN), |
137 | ENUM(_NET_WM_ACTION_CHANGE_DESKTOP), |
138 | ENUM(_NET_WM_ACTION_CLOSE), |
139 | |
140 | // KDE extensions |
141 | ENUM(_KDE_NET_WM_FRAME_STRUT), |
142 | ENUM(_KDE_NET_WM_WINDOW_TYPE_OVERRIDE), |
143 | ENUM(), |
144 | ENUM(_KDE_NET_WM_WINDOW_TYPE_ON_SCREEN_DISPLAY), |
145 | ENUM(_KDE_NET_WM_WINDOW_TYPE_CRITICAL_NOTIFICATION), |
146 | ENUM(), |
147 | ENUM(_KDE_NET_WM_TEMPORARY_RULES), |
148 | ENUM(_NET_WM_FRAME_OVERLAP), |
149 | ENUM(), |
150 | ENUM(), |
151 | |
152 | // deprecated and naming convention violation |
153 | ENUM(_NET_WM_STATE_STAYS_ON_TOP), |
154 | |
155 | // GTK extensions |
156 | ENUM(_GTK_FRAME_EXTENTS), |
157 | ENUM(_GTK_APPLICATION_ID), |
158 | ENUM(), |
159 | |
160 | // application protocols |
161 | ENUM(WM_PROTOCOLS), |
162 | ENUM(WM_TAKE_FOCUS), |
163 | ENUM(WM_DELETE_WINDOW), |
164 | ENUM(_NET_WM_PING), |
165 | ENUM(_NET_WM_SYNC_REQUEST), |
166 | ENUM(_NET_WM_CONTEXT_HELP), |
167 | |
168 | // ability flags |
169 | ENUM(_NET_WM_FULL_PLACEMENT), |
170 | ENUM(_NET_WM_BYPASS_COMPOSITOR), |
171 | ENUM(_KDE_NET_WM_ACTIVITIES), |
172 | ENUM(_KDE_NET_WM_BLOCK_COMPOSITING), |
173 | ENUM(_KDE_NET_WM_SHADOW) |
174 | ENUM_COUNT(KwsAtom) |
175 | ENUM_END(KwsAtom) |
176 | |
177 | #endif // ATOMS_H |
178 | |