1
// Permission is hereby granted, free of charge, to any person obtaining
2
// a copy of this software and associated documentation files (the
3
// "Software"), to deal in the Software without restriction, including
4
// without limitation the rights to use, copy, modify, merge, publish,
5
// distribute, sublicense, and/or sell copies of the Software, and to
6
// permit persons to whom the Software is furnished to do so, subject to
7
// the following conditions:
9
// The above copyright notice and this permission notice shall be
10
// included in all copies or substantial portions of the Software.
12
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
// Copyright (c) 2006 Novell, Inc. (http://www.novell.com)
26
namespace Do.Interface.Xlib {
28
public class X11Atoms {
30
static X11Atoms instance;
31
public static X11Atoms Instance {
34
instance = new X11Atoms (Gdk.Screen.Default.Display);
40
public readonly IntPtr AnyPropertyType = (IntPtr)0;
41
public readonly IntPtr XA_PRIMARY = (IntPtr)1;
42
public readonly IntPtr XA_SECONDARY = (IntPtr)2;
43
public readonly IntPtr XA_ARC = (IntPtr)3;
44
public readonly IntPtr XA_ATOM = (IntPtr)4;
45
public readonly IntPtr XA_BITMAP = (IntPtr)5;
46
public readonly IntPtr XA_CARDINAL = (IntPtr)6;
47
public readonly IntPtr XA_COLORMAP = (IntPtr)7;
48
public readonly IntPtr XA_CURSOR = (IntPtr)8;
49
public readonly IntPtr XA_CUT_BUFFER0 = (IntPtr)9;
50
public readonly IntPtr XA_CUT_BUFFER1 = (IntPtr)10;
51
public readonly IntPtr XA_CUT_BUFFER2 = (IntPtr)11;
52
public readonly IntPtr XA_CUT_BUFFER3 = (IntPtr)12;
53
public readonly IntPtr XA_CUT_BUFFER4 = (IntPtr)13;
54
public readonly IntPtr XA_CUT_BUFFER5 = (IntPtr)14;
55
public readonly IntPtr XA_CUT_BUFFER6 = (IntPtr)15;
56
public readonly IntPtr XA_CUT_BUFFER7 = (IntPtr)16;
57
public readonly IntPtr XA_DRAWABLE = (IntPtr)17;
58
public readonly IntPtr XA_FONT = (IntPtr)18;
59
public readonly IntPtr XA_INTEGER = (IntPtr)19;
60
public readonly IntPtr XA_PIXMAP = (IntPtr)20;
61
public readonly IntPtr XA_POINT = (IntPtr)21;
62
public readonly IntPtr XA_RECTANGLE = (IntPtr)22;
63
public readonly IntPtr XA_RESOURCE_MANAGER = (IntPtr)23;
64
public readonly IntPtr XA_RGB_COLOR_MAP = (IntPtr)24;
65
public readonly IntPtr XA_RGB_BEST_MAP = (IntPtr)25;
66
public readonly IntPtr XA_RGB_BLUE_MAP = (IntPtr)26;
67
public readonly IntPtr XA_RGB_DEFAULT_MAP = (IntPtr)27;
68
public readonly IntPtr XA_RGB_GRAY_MAP = (IntPtr)28;
69
public readonly IntPtr XA_RGB_GREEN_MAP = (IntPtr)29;
70
public readonly IntPtr XA_RGB_RED_MAP = (IntPtr)30;
71
public readonly IntPtr XA_STRING = (IntPtr)31;
72
public readonly IntPtr XA_VISUALID = (IntPtr)32;
73
public readonly IntPtr XA_WINDOW = (IntPtr)33;
74
public readonly IntPtr XA_WM_COMMAND = (IntPtr)34;
75
public readonly IntPtr XA_WM_HINTS = (IntPtr)35;
76
public readonly IntPtr XA_WM_CLIENT_MACHINE = (IntPtr)36;
77
public readonly IntPtr XA_WM_ICON_NAME = (IntPtr)37;
78
public readonly IntPtr XA_WM_ICON_SIZE = (IntPtr)38;
79
public readonly IntPtr XA_WM_NAME = (IntPtr)39;
80
public readonly IntPtr XA_WM_NORMAL_HINTS = (IntPtr)40;
81
public readonly IntPtr XA_WM_SIZE_HINTS = (IntPtr)41;
82
public readonly IntPtr XA_WM_ZOOM_HINTS = (IntPtr)42;
83
public readonly IntPtr XA_MIN_SPACE = (IntPtr)43;
84
public readonly IntPtr XA_NORM_SPACE = (IntPtr)44;
85
public readonly IntPtr XA_MAX_SPACE = (IntPtr)45;
86
public readonly IntPtr XA_END_SPACE = (IntPtr)46;
87
public readonly IntPtr XA_SUPERSCRIPT_X = (IntPtr)47;
88
public readonly IntPtr XA_SUPERSCRIPT_Y = (IntPtr)48;
89
public readonly IntPtr XA_SUBSCRIPT_X = (IntPtr)49;
90
public readonly IntPtr XA_SUBSCRIPT_Y = (IntPtr)50;
91
public readonly IntPtr XA_UNDERLINE_POSITION = (IntPtr)51;
92
public readonly IntPtr XA_UNDERLINE_THICKNESS = (IntPtr)52;
93
public readonly IntPtr XA_STRIKEOUT_ASCENT = (IntPtr)53;
94
public readonly IntPtr XA_STRIKEOUT_DESCENT = (IntPtr)54;
95
public readonly IntPtr XA_ITALIC_ANGLE = (IntPtr)55;
96
public readonly IntPtr XA_X_HEIGHT = (IntPtr)56;
97
public readonly IntPtr XA_QUAD_WIDTH = (IntPtr)57;
98
public readonly IntPtr XA_WEIGHT = (IntPtr)58;
99
public readonly IntPtr XA_POINT_SIZE = (IntPtr)59;
100
public readonly IntPtr XA_RESOLUTION = (IntPtr)60;
101
public readonly IntPtr XA_COPYRIGHT = (IntPtr)61;
102
public readonly IntPtr XA_NOTICE = (IntPtr)62;
103
public readonly IntPtr XA_FONT_NAME = (IntPtr)63;
104
public readonly IntPtr XA_FAMILY_NAME = (IntPtr)64;
105
public readonly IntPtr XA_FULL_NAME = (IntPtr)65;
106
public readonly IntPtr XA_CAP_HEIGHT = (IntPtr)66;
107
public readonly IntPtr XA_WM_CLASS = (IntPtr)67;
108
public readonly IntPtr XA_WM_TRANSIENT_FOR = (IntPtr)68;
110
public readonly IntPtr WM_PROTOCOLS;
111
public readonly IntPtr WM_DELETE_WINDOW;
112
public readonly IntPtr WM_TAKE_FOCUS;
113
public readonly IntPtr _NET_SUPPORTED;
114
public readonly IntPtr _NET_CLIENT_LIST;
115
public readonly IntPtr _NET_NUMBER_OF_DESKTOPS;
116
public readonly IntPtr _NET_DESKTOP_GEOMETRY;
117
public readonly IntPtr _NET_DESKTOP_VIEWPORT;
118
public readonly IntPtr _NET_CURRENT_DESKTOP;
119
public readonly IntPtr _NET_DESKTOP_NAMES;
120
public readonly IntPtr _NET_ACTIVE_WINDOW;
121
public readonly IntPtr _NET_WORKAREA;
122
public readonly IntPtr _NET_SUPPORTING_WM_CHECK;
123
public readonly IntPtr _NET_VIRTUAL_ROOTS;
124
public readonly IntPtr _NET_DESKTOP_LAYOUT;
125
public readonly IntPtr _NET_SHOWING_DESKTOP;
126
public readonly IntPtr _NET_CLOSE_WINDOW;
127
public readonly IntPtr _NET_MOVERESIZE_WINDOW;
128
public readonly IntPtr _NET_WM_MOVERESIZE;
129
public readonly IntPtr _NET_RESTACK_WINDOW;
130
public readonly IntPtr _NET_REQUEST_FRAME_EXTENTS;
131
public readonly IntPtr _NET_WM_NAME;
132
public readonly IntPtr _NET_WM_VISIBLE_NAME;
133
public readonly IntPtr _NET_WM_ICON_NAME;
134
public readonly IntPtr _NET_WM_VISIBLE_ICON_NAME;
135
public readonly IntPtr _NET_WM_DESKTOP;
136
public readonly IntPtr _NET_WM_WINDOW_TYPE;
137
public readonly IntPtr _NET_WM_STATE;
138
public readonly IntPtr _NET_WM_ALLOWED_ACTIONS;
139
public readonly IntPtr _NET_WM_STRUT;
140
public readonly IntPtr _NET_WM_STRUT_PARTIAL;
141
public readonly IntPtr _NET_WM_ICON_GEOMETRY;
142
public readonly IntPtr _NET_WM_ICON;
143
public readonly IntPtr _NET_WM_PID;
144
public readonly IntPtr _NET_WM_HANDLED_ICONS;
145
public readonly IntPtr _NET_WM_USER_TIME;
146
public readonly IntPtr _NET_FRAME_EXTENTS;
147
public readonly IntPtr _NET_WM_PING;
148
public readonly IntPtr _NET_WM_SYNC_REQUEST;
149
public readonly IntPtr _NET_SYSTEM_TRAY_ORIENTATION;
150
public readonly IntPtr _NET_SYSTEM_TRAY_OPCODE;
151
public readonly IntPtr _NET_WM_STATE_MAXIMIZED_HORZ;
152
public readonly IntPtr _NET_WM_STATE_MAXIMIZED_VERT;
153
public readonly IntPtr _XEMBED;
154
public readonly IntPtr _XEMBED_INFO;
155
public readonly IntPtr _MOTIF_WM_HINTS;
156
public readonly IntPtr _NET_WM_STATE_SKIP_TASKBAR;
157
public readonly IntPtr _NET_WM_STATE_ABOVE;
158
public readonly IntPtr _NET_WM_STATE_MODAL;
159
public readonly IntPtr _NET_WM_STATE_HIDDEN;
160
public readonly IntPtr _NET_WM_CONTEXT_HELP;
161
public readonly IntPtr _NET_WM_WINDOW_OPACITY;
162
public readonly IntPtr _NET_WM_WINDOW_TYPE_DESKTOP;
163
public readonly IntPtr _NET_WM_WINDOW_TYPE_DOCK;
164
public readonly IntPtr _NET_WM_WINDOW_TYPE_TOOLBAR;
165
public readonly IntPtr _NET_WM_WINDOW_TYPE_MENU;
166
public readonly IntPtr _NET_WM_WINDOW_TYPE_UTILITY;
167
public readonly IntPtr _NET_WM_WINDOW_TYPE_SPLASH;
168
public readonly IntPtr _NET_WM_WINDOW_TYPE_DIALOG;
169
public readonly IntPtr _NET_WM_WINDOW_TYPE_NORMAL;
170
public readonly IntPtr _COMPIZ_WM_WINDOW_BLUR;
171
public readonly IntPtr CLIPBOARD;
172
public readonly IntPtr PRIMARY;
173
public readonly IntPtr DIB;
174
public readonly IntPtr OEMTEXT;
175
public readonly IntPtr UNICODETEXT;
176
public readonly IntPtr TARGETS;
177
public readonly IntPtr PostAtom;
178
public readonly IntPtr AsyncAtom;
181
X11Atoms (Gdk.Display dsp) {
182
IntPtr display = Xlib.GdkDisplayXDisplay (dsp);
183
// make sure this array stays in sync with the statements below
184
string [] atom_names = new string[] {
190
"_NET_NUMBER_OF_DESKTOPS",
191
"_NET_DESKTOP_GEOMETRY",
192
"_NET_DESKTOP_VIEWPORT",
193
"_NET_CURRENT_DESKTOP",
194
"_NET_DESKTOP_NAMES",
195
"_NET_ACTIVE_WINDOW",
197
"_NET_SUPPORTING_WM_CHECK",
198
"_NET_VIRTUAL_ROOTS",
199
"_NET_DESKTOP_LAYOUT",
200
"_NET_SHOWING_DESKTOP",
202
"_NET_MOVERESIZE_WINDOW",
203
"_NET_WM_MOVERESIZE",
204
"_NET_RESTACK_WINDOW",
205
"_NET_REQUEST_FRAME_EXTENTS",
207
"_NET_WM_VISIBLE_NAME",
209
"_NET_WM_VISIBLE_ICON_NAME",
211
"_NET_WM_WINDOW_TYPE",
213
"_NET_WM_ALLOWED_ACTIONS",
215
"_NET_WM_STRUT_PARTIAL",
216
"_NET_WM_ICON_GEOMETRY",
219
"_NET_WM_HANDLED_ICONS",
221
"_NET_FRAME_EXTENTS",
223
"_NET_WM_SYNC_REQUEST",
224
"_NET_SYSTEM_TRAY_OPCODE",
225
"_NET_SYSTEM_TRAY_ORIENTATION",
226
"_NET_WM_STATE_MAXIMIZED_HORZ",
227
"_NET_WM_STATE_MAXIMIZED_VERT",
228
"_NET_WM_STATE_HIDDEN",
232
"_NET_WM_STATE_SKIP_TASKBAR",
233
"_NET_WM_STATE_ABOVE",
234
"_NET_WM_STATE_MODAL",
235
"_NET_WM_CONTEXT_HELP",
236
"_NET_WM_WINDOW_OPACITY",
237
"_NET_WM_WINDOW_TYPE_DESKTOP",
238
"_NET_WM_WINDOW_TYPE_DOCK",
239
"_NET_WM_WINDOW_TYPE_TOOLBAR",
240
"_NET_WM_WINDOW_TYPE_MENU",
241
"_NET_WM_WINDOW_TYPE_UTILITY",
242
"_NET_WM_WINDOW_TYPE_DIALOG",
243
"_NET_WM_WINDOW_TYPE_SPLASH",
244
"_NET_WM_WINDOW_TYPE_NORMAL",
245
"_COMPIZ_WM_WINDOW_BLUR",
252
"_SWF_PostMessageAtom",
256
IntPtr[] atoms = new IntPtr [atom_names.Length];;
258
Xlib.XInternAtoms (display, atom_names, atom_names.Length, false, atoms);
261
WM_PROTOCOLS = atoms [off++];
262
WM_DELETE_WINDOW = atoms [off++];
263
WM_TAKE_FOCUS = atoms [off++];
264
_NET_SUPPORTED = atoms [off++];
265
_NET_CLIENT_LIST = atoms [off++];
266
_NET_NUMBER_OF_DESKTOPS = atoms [off++];
267
_NET_DESKTOP_GEOMETRY = atoms [off++];
268
_NET_DESKTOP_VIEWPORT = atoms [off++];
269
_NET_CURRENT_DESKTOP = atoms [off++];
270
_NET_DESKTOP_NAMES = atoms [off++];
271
_NET_ACTIVE_WINDOW = atoms [off++];
272
_NET_WORKAREA = atoms [off++];
273
_NET_SUPPORTING_WM_CHECK = atoms [off++];
274
_NET_VIRTUAL_ROOTS = atoms [off++];
275
_NET_DESKTOP_LAYOUT = atoms [off++];
276
_NET_SHOWING_DESKTOP = atoms [off++];
277
_NET_CLOSE_WINDOW = atoms [off++];
278
_NET_MOVERESIZE_WINDOW = atoms [off++];
279
_NET_WM_MOVERESIZE = atoms [off++];
280
_NET_RESTACK_WINDOW = atoms [off++];
281
_NET_REQUEST_FRAME_EXTENTS = atoms [off++];
282
_NET_WM_NAME = atoms [off++];
283
_NET_WM_VISIBLE_NAME = atoms [off++];
284
_NET_WM_ICON_NAME = atoms [off++];
285
_NET_WM_VISIBLE_ICON_NAME = atoms [off++];
286
_NET_WM_DESKTOP = atoms [off++];
287
_NET_WM_WINDOW_TYPE = atoms [off++];
288
_NET_WM_STATE = atoms [off++];
289
_NET_WM_ALLOWED_ACTIONS = atoms [off++];
290
_NET_WM_STRUT = atoms [off++];
291
_NET_WM_STRUT_PARTIAL = atoms [off++];
292
_NET_WM_ICON_GEOMETRY = atoms [off++];
293
_NET_WM_ICON = atoms [off++];
294
_NET_WM_PID = atoms [off++];
295
_NET_WM_HANDLED_ICONS = atoms [off++];
296
_NET_WM_USER_TIME = atoms [off++];
297
_NET_FRAME_EXTENTS = atoms [off++];
298
_NET_WM_PING = atoms [off++];
299
_NET_WM_SYNC_REQUEST = atoms [off++];
300
_NET_SYSTEM_TRAY_OPCODE = atoms [off++];
301
_NET_SYSTEM_TRAY_ORIENTATION = atoms [off++];
302
_NET_WM_STATE_MAXIMIZED_HORZ = atoms [off++];
303
_NET_WM_STATE_MAXIMIZED_VERT = atoms [off++];
304
_NET_WM_STATE_HIDDEN = atoms [off++];
305
_XEMBED = atoms [off++];
306
_XEMBED_INFO = atoms [off++];
307
_MOTIF_WM_HINTS = atoms [off++];
308
_NET_WM_STATE_SKIP_TASKBAR = atoms [off++];
309
_NET_WM_STATE_ABOVE = atoms [off++];
310
_NET_WM_STATE_MODAL = atoms [off++];
311
_NET_WM_CONTEXT_HELP = atoms [off++];
312
_NET_WM_WINDOW_OPACITY = atoms [off++];
313
_NET_WM_WINDOW_TYPE_DESKTOP = atoms [off++];
314
_NET_WM_WINDOW_TYPE_DOCK = atoms [off++];
315
_NET_WM_WINDOW_TYPE_TOOLBAR = atoms [off++];
316
_NET_WM_WINDOW_TYPE_MENU = atoms [off++];
317
_NET_WM_WINDOW_TYPE_UTILITY = atoms [off++];
318
_NET_WM_WINDOW_TYPE_DIALOG = atoms [off++];
319
_NET_WM_WINDOW_TYPE_SPLASH = atoms [off++];
320
_NET_WM_WINDOW_TYPE_NORMAL = atoms [off++];
321
_COMPIZ_WM_WINDOW_BLUR = atoms [off++];
322
CLIPBOARD = atoms [off++];
323
PRIMARY = atoms [off++];
324
OEMTEXT = atoms [off++];
325
UNICODETEXT = atoms [off++];
326
TARGETS = atoms [off++];
327
AsyncAtom = atoms [off++];
328
PostAtom = atoms [off++];