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)
25 using System.Windows.Forms;
27 namespace System.Windows.Forms.X11Internal {
29 internal class X11Atoms {
32 public readonly IntPtr AnyPropertyType = (IntPtr)0;
33 public readonly IntPtr XA_PRIMARY = (IntPtr)1;
34 public readonly IntPtr XA_SECONDARY = (IntPtr)2;
35 public readonly IntPtr XA_ARC = (IntPtr)3;
36 public readonly IntPtr XA_ATOM = (IntPtr)4;
37 public readonly IntPtr XA_BITMAP = (IntPtr)5;
38 public readonly IntPtr XA_CARDINAL = (IntPtr)6;
39 public readonly IntPtr XA_COLORMAP = (IntPtr)7;
40 public readonly IntPtr XA_CURSOR = (IntPtr)8;
41 public readonly IntPtr XA_CUT_BUFFER0 = (IntPtr)9;
42 public readonly IntPtr XA_CUT_BUFFER1 = (IntPtr)10;
43 public readonly IntPtr XA_CUT_BUFFER2 = (IntPtr)11;
44 public readonly IntPtr XA_CUT_BUFFER3 = (IntPtr)12;
45 public readonly IntPtr XA_CUT_BUFFER4 = (IntPtr)13;
46 public readonly IntPtr XA_CUT_BUFFER5 = (IntPtr)14;
47 public readonly IntPtr XA_CUT_BUFFER6 = (IntPtr)15;
48 public readonly IntPtr XA_CUT_BUFFER7 = (IntPtr)16;
49 public readonly IntPtr XA_DRAWABLE = (IntPtr)17;
50 public readonly IntPtr XA_FONT = (IntPtr)18;
51 public readonly IntPtr XA_INTEGER = (IntPtr)19;
52 public readonly IntPtr XA_PIXMAP = (IntPtr)20;
53 public readonly IntPtr XA_POINT = (IntPtr)21;
54 public readonly IntPtr XA_RECTANGLE = (IntPtr)22;
55 public readonly IntPtr XA_RESOURCE_MANAGER = (IntPtr)23;
56 public readonly IntPtr XA_RGB_COLOR_MAP = (IntPtr)24;
57 public readonly IntPtr XA_RGB_BEST_MAP = (IntPtr)25;
58 public readonly IntPtr XA_RGB_BLUE_MAP = (IntPtr)26;
59 public readonly IntPtr XA_RGB_DEFAULT_MAP = (IntPtr)27;
60 public readonly IntPtr XA_RGB_GRAY_MAP = (IntPtr)28;
61 public readonly IntPtr XA_RGB_GREEN_MAP = (IntPtr)29;
62 public readonly IntPtr XA_RGB_RED_MAP = (IntPtr)30;
63 public readonly IntPtr XA_STRING = (IntPtr)31;
64 public readonly IntPtr XA_VISUALID = (IntPtr)32;
65 public readonly IntPtr XA_WINDOW = (IntPtr)33;
66 public readonly IntPtr XA_WM_COMMAND = (IntPtr)34;
67 public readonly IntPtr XA_WM_HINTS = (IntPtr)35;
68 public readonly IntPtr XA_WM_CLIENT_MACHINE = (IntPtr)36;
69 public readonly IntPtr XA_WM_ICON_NAME = (IntPtr)37;
70 public readonly IntPtr XA_WM_ICON_SIZE = (IntPtr)38;
71 public readonly IntPtr XA_WM_NAME = (IntPtr)39;
72 public readonly IntPtr XA_WM_NORMAL_HINTS = (IntPtr)40;
73 public readonly IntPtr XA_WM_SIZE_HINTS = (IntPtr)41;
74 public readonly IntPtr XA_WM_ZOOM_HINTS = (IntPtr)42;
75 public readonly IntPtr XA_MIN_SPACE = (IntPtr)43;
76 public readonly IntPtr XA_NORM_SPACE = (IntPtr)44;
77 public readonly IntPtr XA_MAX_SPACE = (IntPtr)45;
78 public readonly IntPtr XA_END_SPACE = (IntPtr)46;
79 public readonly IntPtr XA_SUPERSCRIPT_X = (IntPtr)47;
80 public readonly IntPtr XA_SUPERSCRIPT_Y = (IntPtr)48;
81 public readonly IntPtr XA_SUBSCRIPT_X = (IntPtr)49;
82 public readonly IntPtr XA_SUBSCRIPT_Y = (IntPtr)50;
83 public readonly IntPtr XA_UNDERLINE_POSITION = (IntPtr)51;
84 public readonly IntPtr XA_UNDERLINE_THICKNESS = (IntPtr)52;
85 public readonly IntPtr XA_STRIKEOUT_ASCENT = (IntPtr)53;
86 public readonly IntPtr XA_STRIKEOUT_DESCENT = (IntPtr)54;
87 public readonly IntPtr XA_ITALIC_ANGLE = (IntPtr)55;
88 public readonly IntPtr XA_X_HEIGHT = (IntPtr)56;
89 public readonly IntPtr XA_QUAD_WIDTH = (IntPtr)57;
90 public readonly IntPtr XA_WEIGHT = (IntPtr)58;
91 public readonly IntPtr XA_POINT_SIZE = (IntPtr)59;
92 public readonly IntPtr XA_RESOLUTION = (IntPtr)60;
93 public readonly IntPtr XA_COPYRIGHT = (IntPtr)61;
94 public readonly IntPtr XA_NOTICE = (IntPtr)62;
95 public readonly IntPtr XA_FONT_NAME = (IntPtr)63;
96 public readonly IntPtr XA_FAMILY_NAME = (IntPtr)64;
97 public readonly IntPtr XA_FULL_NAME = (IntPtr)65;
98 public readonly IntPtr XA_CAP_HEIGHT = (IntPtr)66;
99 public readonly IntPtr XA_WM_CLASS = (IntPtr)67;
100 public readonly IntPtr XA_WM_TRANSIENT_FOR = (IntPtr)68;
102 public readonly IntPtr WM_PROTOCOLS;
103 public readonly IntPtr WM_DELETE_WINDOW;
104 public readonly IntPtr WM_TAKE_FOCUS;
105 public readonly IntPtr _NET_SUPPORTED;
106 public readonly IntPtr _NET_CLIENT_LIST;
107 public readonly IntPtr _NET_NUMBER_OF_DESKTOPS;
108 public readonly IntPtr _NET_DESKTOP_GEOMETRY;
109 public readonly IntPtr _NET_DESKTOP_VIEWPORT;
110 public readonly IntPtr _NET_CURRENT_DESKTOP;
111 public readonly IntPtr _NET_DESKTOP_NAMES;
112 public readonly IntPtr _NET_ACTIVE_WINDOW;
113 public readonly IntPtr _NET_WORKAREA;
114 public readonly IntPtr _NET_SUPPORTING_WM_CHECK;
115 public readonly IntPtr _NET_VIRTUAL_ROOTS;
116 public readonly IntPtr _NET_DESKTOP_LAYOUT;
117 public readonly IntPtr _NET_SHOWING_DESKTOP;
118 public readonly IntPtr _NET_CLOSE_WINDOW;
119 public readonly IntPtr _NET_MOVERESIZE_WINDOW;
120 public readonly IntPtr _NET_WM_MOVERESIZE;
121 public readonly IntPtr _NET_RESTACK_WINDOW;
122 public readonly IntPtr _NET_REQUEST_FRAME_EXTENTS;
123 public readonly IntPtr _NET_WM_NAME;
124 public readonly IntPtr _NET_WM_VISIBLE_NAME;
125 public readonly IntPtr _NET_WM_ICON_NAME;
126 public readonly IntPtr _NET_WM_VISIBLE_ICON_NAME;
127 public readonly IntPtr _NET_WM_DESKTOP;
128 public readonly IntPtr _NET_WM_WINDOW_TYPE;
129 public readonly IntPtr _NET_WM_STATE;
130 public readonly IntPtr _NET_WM_ALLOWED_ACTIONS;
131 public readonly IntPtr _NET_WM_STRUT;
132 public readonly IntPtr _NET_WM_STRUT_PARTIAL;
133 public readonly IntPtr _NET_WM_ICON_GEOMETRY;
134 public readonly IntPtr _NET_WM_ICON;
135 public readonly IntPtr _NET_WM_PID;
136 public readonly IntPtr _NET_WM_HANDLED_ICONS;
137 public readonly IntPtr _NET_WM_USER_TIME;
138 public readonly IntPtr _NET_FRAME_EXTENTS;
139 public readonly IntPtr _NET_WM_PING;
140 public readonly IntPtr _NET_WM_SYNC_REQUEST;
141 public readonly IntPtr _NET_SYSTEM_TRAY_S;
142 public readonly IntPtr _NET_SYSTEM_TRAY_ORIENTATION;
143 public readonly IntPtr _NET_SYSTEM_TRAY_OPCODE;
144 public readonly IntPtr _NET_WM_STATE_MAXIMIZED_HORZ;
145 public readonly IntPtr _NET_WM_STATE_MAXIMIZED_VERT;
146 public readonly IntPtr _XEMBED;
147 public readonly IntPtr _XEMBED_INFO;
148 public readonly IntPtr _MOTIF_WM_HINTS;
149 public readonly IntPtr _NET_WM_STATE_SKIP_TASKBAR;
150 public readonly IntPtr _NET_WM_STATE_ABOVE;
151 public readonly IntPtr _NET_WM_STATE_MODAL;
152 public readonly IntPtr _NET_WM_STATE_HIDDEN;
153 public readonly IntPtr _NET_WM_CONTEXT_HELP;
154 public readonly IntPtr _NET_WM_WINDOW_OPACITY;
155 public readonly IntPtr _NET_WM_WINDOW_TYPE_DESKTOP;
156 public readonly IntPtr _NET_WM_WINDOW_TYPE_DOCK;
157 public readonly IntPtr _NET_WM_WINDOW_TYPE_TOOLBAR;
158 public readonly IntPtr _NET_WM_WINDOW_TYPE_MENU;
159 public readonly IntPtr _NET_WM_WINDOW_TYPE_UTILITY;
160 public readonly IntPtr _NET_WM_WINDOW_TYPE_SPLASH;
161 public readonly IntPtr _NET_WM_WINDOW_TYPE_DIALOG;
162 public readonly IntPtr _NET_WM_WINDOW_TYPE_NORMAL;
163 public readonly IntPtr CLIPBOARD;
164 public readonly IntPtr PRIMARY;
165 public readonly IntPtr DIB;
166 public readonly IntPtr OEMTEXT;
167 public readonly IntPtr UNICODETEXT;
168 public readonly IntPtr TARGETS;
169 public readonly IntPtr PostAtom;
170 public readonly IntPtr AsyncAtom;
173 public X11Atoms (X11Display display) {
175 // make sure this array stays in sync with the statements below
176 string [] atom_names = new string[] {
182 "_NET_NUMBER_OF_DESKTOPS",
183 "_NET_DESKTOP_GEOMETRY",
184 "_NET_DESKTOP_VIEWPORT",
185 "_NET_CURRENT_DESKTOP",
186 "_NET_DESKTOP_NAMES",
187 "_NET_ACTIVE_WINDOW",
189 "_NET_SUPPORTING_WM_CHECK",
190 "_NET_VIRTUAL_ROOTS",
191 "_NET_DESKTOP_LAYOUT",
192 "_NET_SHOWING_DESKTOP",
194 "_NET_MOVERESIZE_WINDOW",
195 "_NET_WM_MOVERESIZE",
196 "_NET_RESTACK_WINDOW",
197 "_NET_REQUEST_FRAME_EXTENTS",
199 "_NET_WM_VISIBLE_NAME",
201 "_NET_WM_VISIBLE_ICON_NAME",
203 "_NET_WM_WINDOW_TYPE",
205 "_NET_WM_ALLOWED_ACTIONS",
207 "_NET_WM_STRUT_PARTIAL",
208 "_NET_WM_ICON_GEOMETRY",
211 "_NET_WM_HANDLED_ICONS",
213 "_NET_FRAME_EXTENTS",
215 "_NET_WM_SYNC_REQUEST",
216 "_NET_SYSTEM_TRAY_OPCODE",
217 "_NET_SYSTEM_TRAY_ORIENTATION",
218 "_NET_WM_STATE_MAXIMIZED_HORZ",
219 "_NET_WM_STATE_MAXIMIZED_VERT",
220 "_NET_WM_STATE_HIDDEN",
224 "_NET_WM_STATE_SKIP_TASKBAR",
225 "_NET_WM_STATE_ABOVE",
226 "_NET_WM_STATE_MODAL",
227 "_NET_WM_CONTEXT_HELP",
228 "_NET_WM_WINDOW_OPACITY",
229 "_NET_WM_WINDOW_TYPE_DESKTOP",
230 "_NET_WM_WINDOW_TYPE_DOCK",
231 "_NET_WM_WINDOW_TYPE_TOOLBAR",
232 "_NET_WM_WINDOW_TYPE_MENU",
233 "_NET_WM_WINDOW_TYPE_UTILITY",
234 "_NET_WM_WINDOW_TYPE_DIALOG",
235 "_NET_WM_WINDOW_TYPE_SPLASH",
236 "_NET_WM_WINDOW_TYPE_NORMAL",
243 "_SWF_PostMessageAtom",
246 IntPtr[] atoms = new IntPtr [atom_names.Length];;
248 Xlib.XInternAtoms (display.Handle, atom_names, atom_names.Length, false, atoms);
251 WM_PROTOCOLS = atoms [off++];
252 WM_DELETE_WINDOW = atoms [off++];
253 WM_TAKE_FOCUS = atoms [off++];
254 _NET_SUPPORTED = atoms [off++];
255 _NET_CLIENT_LIST = atoms [off++];
256 _NET_NUMBER_OF_DESKTOPS = atoms [off++];
257 _NET_DESKTOP_GEOMETRY = atoms [off++];
258 _NET_DESKTOP_VIEWPORT = atoms [off++];
259 _NET_CURRENT_DESKTOP = atoms [off++];
260 _NET_DESKTOP_NAMES = atoms [off++];
261 _NET_ACTIVE_WINDOW = atoms [off++];
262 _NET_WORKAREA = atoms [off++];
263 _NET_SUPPORTING_WM_CHECK = atoms [off++];
264 _NET_VIRTUAL_ROOTS = atoms [off++];
265 _NET_DESKTOP_LAYOUT = atoms [off++];
266 _NET_SHOWING_DESKTOP = atoms [off++];
267 _NET_CLOSE_WINDOW = atoms [off++];
268 _NET_MOVERESIZE_WINDOW = atoms [off++];
269 _NET_WM_MOVERESIZE = atoms [off++];
270 _NET_RESTACK_WINDOW = atoms [off++];
271 _NET_REQUEST_FRAME_EXTENTS = atoms [off++];
272 _NET_WM_NAME = atoms [off++];
273 _NET_WM_VISIBLE_NAME = atoms [off++];
274 _NET_WM_ICON_NAME = atoms [off++];
275 _NET_WM_VISIBLE_ICON_NAME = atoms [off++];
276 _NET_WM_DESKTOP = atoms [off++];
277 _NET_WM_WINDOW_TYPE = atoms [off++];
278 _NET_WM_STATE = atoms [off++];
279 _NET_WM_ALLOWED_ACTIONS = atoms [off++];
280 _NET_WM_STRUT = atoms [off++];
281 _NET_WM_STRUT_PARTIAL = atoms [off++];
282 _NET_WM_ICON_GEOMETRY = atoms [off++];
283 _NET_WM_ICON = atoms [off++];
284 _NET_WM_PID = atoms [off++];
285 _NET_WM_HANDLED_ICONS = atoms [off++];
286 _NET_WM_USER_TIME = atoms [off++];
287 _NET_FRAME_EXTENTS = atoms [off++];
288 _NET_WM_PING = atoms [off++];
289 _NET_WM_SYNC_REQUEST = atoms [off++];
290 _NET_SYSTEM_TRAY_OPCODE = atoms [off++];
291 _NET_SYSTEM_TRAY_ORIENTATION = atoms [off++];
292 _NET_WM_STATE_MAXIMIZED_HORZ = atoms [off++];
293 _NET_WM_STATE_MAXIMIZED_VERT = atoms [off++];
294 _NET_WM_STATE_HIDDEN = atoms [off++];
295 _XEMBED = atoms [off++];
296 _XEMBED_INFO = atoms [off++];
297 _MOTIF_WM_HINTS = atoms [off++];
298 _NET_WM_STATE_SKIP_TASKBAR = atoms [off++];
299 _NET_WM_STATE_ABOVE = atoms [off++];
300 _NET_WM_STATE_MODAL = atoms [off++];
301 _NET_WM_CONTEXT_HELP = atoms [off++];
302 _NET_WM_WINDOW_OPACITY = atoms [off++];
303 _NET_WM_WINDOW_TYPE_DESKTOP = atoms [off++];
304 _NET_WM_WINDOW_TYPE_DOCK = atoms [off++];
305 _NET_WM_WINDOW_TYPE_TOOLBAR = atoms [off++];
306 _NET_WM_WINDOW_TYPE_MENU = atoms [off++];
307 _NET_WM_WINDOW_TYPE_UTILITY = atoms [off++];
308 _NET_WM_WINDOW_TYPE_DIALOG = atoms [off++];
309 _NET_WM_WINDOW_TYPE_SPLASH = atoms [off++];
310 _NET_WM_WINDOW_TYPE_NORMAL = atoms [off++];
311 CLIPBOARD = atoms [off++];
312 PRIMARY = atoms [off++];
313 OEMTEXT = atoms [off++];
314 UNICODETEXT = atoms [off++];
315 TARGETS = atoms [off++];
316 AsyncAtom = atoms [off++];
317 PostAtom = atoms [off++];
318 display.HoverState.Atom = atoms [off++];
322 // XXX multi screen stuff here
323 _NET_SYSTEM_TRAY_S = Xlib.XInternAtom (display.Handle, "_NET_SYSTEM_TRAY_S" + display.DefaultScreen.ToString(), false);