1 | /******************************************************************** |
---|---|
2 | KWin - the KDE window manager |
3 | This file is part of the KDE project. |
4 | |
5 | Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org> |
6 | Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org> |
7 | |
8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 2 of the License, or |
11 | (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | *********************************************************************/ |
21 | |
22 | #include "atoms.h" |
23 | #include "utils.h" |
24 | #include <assert.h> |
25 | |
26 | namespace KWin |
27 | { |
28 | |
29 | Atoms::Atoms() |
30 | { |
31 | |
32 | const int max = 50; |
33 | Atom* atoms[max]; |
34 | char* names[max]; |
35 | Atom atoms_return[max]; |
36 | int n = 0; |
37 | |
38 | atoms[n] = &kwin_running; |
39 | names[n++] = (char *) "KWIN_RUNNING"; |
40 | |
41 | atoms[n] = &activities; |
42 | names[n++] = (char *) "_KDE_NET_WM_ACTIVITIES"; |
43 | |
44 | atoms[n] = &wm_protocols; |
45 | names[n++] = (char *) "WM_PROTOCOLS"; |
46 | |
47 | atoms[n] = &wm_delete_window; |
48 | names[n++] = (char *) "WM_DELETE_WINDOW"; |
49 | |
50 | atoms[n] = &wm_take_focus; |
51 | names[n++] = (char *) "WM_TAKE_FOCUS"; |
52 | |
53 | atoms[n] = &wm_change_state; |
54 | names[n++] = (char *) "WM_CHANGE_STATE"; |
55 | |
56 | atoms[n] = &wm_client_leader; |
57 | names[n++] = (char *) "WM_CLIENT_LEADER"; |
58 | |
59 | atoms[n] = &wm_window_role; |
60 | names[n++] = (char *) "WM_WINDOW_ROLE"; |
61 | |
62 | atoms[n] = &wm_state; |
63 | names[n++] = (char *) "WM_STATE"; |
64 | |
65 | atoms[n] = &sm_client_id; |
66 | names[n++] = (char *) "SM_CLIENT_ID"; |
67 | |
68 | atoms[n] = &motif_wm_hints; |
69 | names[n++] = (char *) "_MOTIF_WM_HINTS"; |
70 | |
71 | atoms[n] = &net_wm_context_help; |
72 | names[n++] = (char *) "_NET_WM_CONTEXT_HELP"; |
73 | |
74 | atoms[n] = &net_wm_ping; |
75 | names[n++] = (char *) "_NET_WM_PING"; |
76 | |
77 | atoms[n] = &kde_wm_change_state; |
78 | names[n++] = (char *) "_KDE_WM_CHANGE_STATE"; |
79 | |
80 | atoms[n] = &net_wm_user_time; |
81 | names[n++] = (char *) "_NET_WM_USER_TIME"; |
82 | atoms[n] = &kde_net_wm_user_creation_time; |
83 | names[n++] = (char *) "_KDE_NET_WM_USER_CREATION_TIME"; |
84 | |
85 | atoms[n] = &kde_system_tray_embedding; |
86 | names[n++] = (char*) "_KDE_SYSTEM_TRAY_EMBEDDING"; |
87 | |
88 | atoms[n] = &net_wm_take_activity; |
89 | names[n++] = (char*) "_NET_WM_TAKE_ACTIVITY"; |
90 | |
91 | atoms[n] = &net_wm_window_opacity; |
92 | names[n++] = (char*) "_NET_WM_WINDOW_OPACITY"; |
93 | |
94 | Atom fake; |
95 | atoms[n] = &fake; |
96 | names[n++] = (char *) "_DT_SM_WINDOW_INFO"; |
97 | |
98 | atoms[n] = &fake; |
99 | names[n++] = (char *) "_MOTIF_WM_INFO"; // #172028 |
100 | |
101 | atoms[n] = &xdnd_aware; |
102 | names[n++] = (char*) "XdndAware"; |
103 | atoms[n] = &xdnd_position; |
104 | names[n++] = (char*) "XdndPosition"; |
105 | |
106 | atoms[n] = &net_frame_extents; |
107 | names[n++] = (char*) "_NET_FRAME_EXTENTS"; |
108 | atoms[n] = &kde_net_wm_frame_strut; |
109 | names[n++] = (char*) "_KDE_NET_WM_FRAME_STRUT"; |
110 | |
111 | atoms[n] = &net_wm_sync_request_counter; |
112 | names[n++] = (char*) "_NET_WM_SYNC_REQUEST_COUNTER"; |
113 | |
114 | atoms[n] = &net_wm_sync_request; |
115 | names[n++] = (char*) "_NET_WM_SYNC_REQUEST"; |
116 | |
117 | atoms[n] = &kde_net_wm_block_compositing; |
118 | names[n++] = (char*) "_KDE_NET_WM_BLOCK_COMPOSITING"; |
119 | |
120 | atoms[n] = &kde_net_wm_shadow; |
121 | names[n++] = (char*) "_KDE_NET_WM_SHADOW"; |
122 | |
123 | atoms[n] = &net_wm_opaque_region; |
124 | names[n++] = (char*) "_NET_WM_OPAQUE_REGION"; |
125 | |
126 | atoms[n] = &kde_net_wm_tab_group; |
127 | names[n++] = (char*) "_KDE_NET_WM_TAB_GROUP"; |
128 | |
129 | atoms[n] = &kde_first_in_window_list; |
130 | names[n++] = (char*) "_KDE_FIRST_IN_WINDOWLIST"; |
131 | |
132 | atoms[n] = &kde_skip_close_animation; |
133 | names[n++] = (char*) "_KDE_NET_WM_SKIP_CLOSE_ANIMATION"; |
134 | |
135 | assert(n <= max); |
136 | |
137 | XInternAtoms(display(), names, n, false, atoms_return); |
138 | for (int i = 0; i < n; i++) |
139 | *atoms[i] = atoms_return[i]; |
140 | } |
141 | |
142 | } // namespace |
143 |