root/dwt/DWT.d

Revision 246:fd9c62a2998e, 113.0 kB (checked in by Frank Benoit <benoit@tionex.de>, 3 months ago)

Updater SWT 3.4M7 to 3.4

Line 
1 /*******************************************************************************
2  * Copyright (c) 2000, 2008 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  * Port to the D Programming language:
11  *      Frank Benoit <benoit@tionex.de>
12  *******************************************************************************/
13 module dwt.DWT;
14
15
16 import dwt.internal.Compatibility;
17 import dwt.internal.Library;
18 import dwt.internal.Platform;
19 import dwt.DWTError;
20 import dwt.DWTException;
21
22 import tango.core.Exception;
23 import dwt.dwthelper.utils;
24
25 version(build){
26     pragma(link, "advapi32");
27     pragma(link, "comctl32");
28     pragma(link, "comdlg32");
29     pragma(link, "gdi32");
30     pragma(link, "kernel32");
31     pragma(link, "shell32");
32     pragma(link, "ole32");
33     pragma(link, "oleaut32");
34     pragma(link, "olepro32");
35     pragma(link, "oleacc");
36     pragma(link, "user32");
37     pragma(link, "usp10");
38     pragma(link, "msimg32");
39     pragma(link, "opengl32");
40     pragma(link, "shlwapi");
41     //pragma(link, "gdiplus"); // load dynamic
42     //pragma(link, "uxtheme"); // load dynamic
43 }
44
45 /**
46  * This class provides access to a small number of DWT system-wide
47  * methods, and in addition defines the public constants provided
48  * by DWT.
49  * <p>
50  * By defining constants like UP and DOWN in a single class, DWT
51  * can share common names and concepts at the same time minimizing
52  * the number of classes, names and constants for the application
53  * programmer.
54  * </p><p>
55  * Note that some of the constants provided by this class represent
56  * optional, appearance related aspects of widgets which are available
57  * either only on some window systems, or for a differing set of
58  * widgets on each window system. These constants are marked
59  * as <em>HINT</em>s. The set of widgets which support a particular
60  * <em>HINT</em> may change from release to release, although we typically
61  * will not withdraw support for a <em>HINT</em> once it is made available.
62  * </p>
63  *
64  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
65  */
66
67 /* NOTE:
68  *   Good javadoc coding style is to put the values of static const
69  *   constants in the comments. This reinforces the fact that
70  *   consumers are allowed to rely on the value (and they must
71  *   since the values are compiled inline in their code). We
72  *   can <em>not</em> change the values of these constants between
73  *   releases.
74  */
75 public class DWT {
76
77     /* Widget Event Constants */
78
79     /**
80      * The null event type (value is 0).
81      *
82      * @since 3.0
83      */
84     public static const int None = 0;
85
86     /**
87      * The key down event type (value is 1).
88      *
89      * @see dwt.widgets.Widget#addListener
90      * @see dwt.widgets.Display#addFilter
91      * @see dwt.widgets.Event
92      *
93      * @see dwt.widgets.Control#addKeyListener
94      * @see dwt.widgets.Tracker#addKeyListener
95      * @see dwt.events.KeyListener#keyPressed
96      * @see dwt.events.KeyEvent
97      */
98     public static const int KeyDown = 1;
99
100     /**
101      * The key up event type (value is 2).
102      *
103      * @see dwt.widgets.Widget#addListener
104      * @see dwt.widgets.Display#addFilter
105      * @see dwt.widgets.Event
106      *
107      * @see dwt.widgets.Control#addKeyListener
108      * @see dwt.widgets.Tracker#addKeyListener
109      * @see dwt.events.KeyListener#keyReleased
110      * @see dwt.events.KeyEvent
111      */
112     public static const int KeyUp = 2;
113
114     /**
115      * The mouse down event type (value is 3).
116      *
117      * @see dwt.widgets.Widget#addListener
118      * @see dwt.widgets.Display#addFilter
119      * @see dwt.widgets.Event
120      *
121      * @see dwt.widgets.Control#addMouseListener
122      * @see dwt.events.MouseListener#mouseDown
123      * @see dwt.events.MouseEvent
124      */
125     public static const int MouseDown = 3;
126
127     /**
128      * The mouse up event type (value is 4).
129      *
130      * @see dwt.widgets.Widget#addListener
131      * @see dwt.widgets.Display#addFilter
132      * @see dwt.widgets.Event
133      *
134      * @see dwt.widgets.Control#addMouseListener
135      * @see dwt.events.MouseListener#mouseUp
136      * @see dwt.events.MouseEvent
137      */
138     public static const int MouseUp = 4;
139
140     /**
141      * The mouse move event type (value is 5).
142      *
143      * @see dwt.widgets.Widget#addListener
144      * @see dwt.widgets.Display#addFilter
145      * @see dwt.widgets.Event
146      *
147      * @see dwt.widgets.Control#addMouseMoveListener
148      * @see dwt.events.MouseMoveListener#mouseMove
149      * @see dwt.events.MouseEvent
150      */
151     public static const int MouseMove = 5;
152
153     /**
154      * The mouse enter event type (value is 6).
155      *
156      * @see dwt.widgets.Widget#addListener
157      * @see dwt.widgets.Display#addFilter
158      * @see dwt.widgets.Event
159      *
160      * @see dwt.widgets.Control#addMouseTrackListener
161      * @see dwt.events.MouseTrackListener#mouseEnter
162      * @see dwt.events.MouseEvent
163      */
164     public static const int MouseEnter = 6;
165
166     /**
167      * The mouse exit event type (value is 7).
168      *
169      * @see dwt.widgets.Widget#addListener
170      * @see dwt.widgets.Display#addFilter
171      * @see dwt.widgets.Event
172      *
173      * @see dwt.widgets.Control#addMouseTrackListener
174      * @see dwt.events.MouseTrackListener#mouseExit
175      * @see dwt.events.MouseEvent
176      */
177     public static const int MouseExit = 7;
178
179     /**
180      * The mouse double click event type (value is 8).
181      *
182      * @see dwt.widgets.Widget#addListener
183      * @see dwt.widgets.Display#addFilter
184      * @see dwt.widgets.Event
185      *
186      * @see dwt.widgets.Control#addMouseListener
187      * @see dwt.events.MouseListener#mouseDoubleClick
188      * @see dwt.events.MouseEvent
189      */
190     public static const int MouseDoubleClick = 8;
191
192     /**
193      * The paint event type (value is 9).
194      *
195      * @see dwt.widgets.Widget#addListener
196      * @see dwt.widgets.Display#addFilter
197      * @see dwt.widgets.Event
198      *
199      * @see dwt.widgets.Control#addPaintListener
200      * @see dwt.events.PaintListener#paintControl
201      * @see dwt.events.PaintEvent
202      */
203     public static const int Paint = 9;
204
205     /**
206      * The move event type (value is 10).
207      *
208      * @see dwt.widgets.Widget#addListener
209      * @see dwt.widgets.Display#addFilter
210      * @see dwt.widgets.Event
211      *
212      * @see dwt.widgets.Control#addControlListener
213      * @see dwt.widgets.TableColumn#addControlListener
214      * @see dwt.widgets.Tracker#addControlListener
215      * @see dwt.widgets.TreeColumn#addControlListener
216      * @see dwt.events.ControlListener#controlMoved
217      * @see dwt.events.ControlEvent
218      */
219     public static const int Move = 10;
220
221     /**
222      * The resize event type (value is 11).
223      *
224      * @see dwt.widgets.Widget#addListener
225      * @see dwt.widgets.Display#addFilter
226      * @see dwt.widgets.Event
227      *
228      * @see dwt.widgets.Control#addControlListener
229      * @see dwt.widgets.TableColumn#addControlListener
230      * @see dwt.widgets.Tracker#addControlListener
231      * @see dwt.widgets.TreeColumn#addControlListener
232      * @see dwt.events.ControlListener#controlResized
233      * @see dwt.events.ControlEvent
234      */
235     public static const int Resize = 11;
236
237     /**
238      * The dispose event type (value is 12).
239      *
240      * @see dwt.widgets.Widget#addListener
241      * @see dwt.widgets.Display#addListener
242      * @see dwt.widgets.Display#addFilter
243      * @see dwt.widgets.Event
244      *
245      * @see dwt.widgets.Widget#addDisposeListener
246      * @see dwt.events.DisposeListener#widgetDisposed
247      * @see dwt.events.DisposeEvent
248      */
249     public static const int Dispose = 12;
250
251     /**
252      * The selection event type (value is 13).
253      *
254      * @see dwt.widgets.Widget#addListener
255      * @see dwt.widgets.Display#addFilter
256      * @see dwt.widgets.Event
257      *
258      * @see dwt.widgets.Button#addSelectionListener
259      * @see dwt.widgets.Combo#addSelectionListener
260      * @see dwt.widgets.CoolItem#addSelectionListener
261      * @see dwt.widgets.Link#addSelectionListener
262      * @see dwt.widgets.List#addSelectionListener
263      * @see dwt.widgets.MenuItem#addSelectionListener
264      * @see dwt.widgets.Sash#addSelectionListener
265      * @see dwt.widgets.Scale#addSelectionListener
266      * @see dwt.widgets.ScrollBar#addSelectionListener
267      * @see dwt.widgets.Slider#addSelectionListener
268      * @see dwt.widgets.TabFolder#addSelectionListener
269      * @see dwt.widgets.Table#addSelectionListener
270      * @see dwt.widgets.TableColumn#addSelectionListener
271      * @see dwt.widgets.ToolItem#addSelectionListener
272      * @see dwt.widgets.TrayItem#addSelectionListener
273      * @see dwt.widgets.Tree#addSelectionListener
274      * @see dwt.widgets.TreeColumn#addSelectionListener
275      * @see dwt.events.SelectionListener#widgetSelected
276      * @see dwt.events.SelectionEvent
277      */
278     public static const int Selection = 13;
279
280     /**
281      * The default selection event type (value is 14).
282      *
283      * @see dwt.widgets.Widget#addListener
284      * @see dwt.widgets.Display#addFilter
285      * @see dwt.widgets.Event
286      *
287      * @see dwt.widgets.Combo#addSelectionListener
288      * @see dwt.widgets.List#addSelectionListener
289      * @see dwt.widgets.Spinner#addSelectionListener
290      * @see dwt.widgets.Table#addSelectionListener
291      * @see dwt.widgets.Text#addSelectionListener
292      * @see dwt.widgets.TrayItem#addSelectionListener
293      * @see dwt.widgets.Tree#addSelectionListener
294      * @see dwt.events.SelectionListener#widgetDefaultSelected
295      * @see dwt.events.SelectionEvent
296      */
297     public static const int DefaultSelection = 14;
298
299     /**
300      * The focus in event type (value is 15).
301      *
302      * @see dwt.widgets.Widget#addListener
303      * @see dwt.widgets.Display#addFilter
304      * @see dwt.widgets.Event
305      *
306      * @see dwt.widgets.Control#addFocusListener
307      * @see dwt.events.FocusListener#focusGained
308      * @see dwt.events.FocusEvent
309      */
310     public static const int FocusIn = 15;
311
312     /**
313      * The focus out event type (value is 16).
314      *
315      * @see dwt.widgets.Widget#addListener
316      * @see dwt.widgets.Display#addFilter
317      * @see dwt.widgets.Event
318      *
319      * @see dwt.widgets.Control#addFocusListener
320      * @see dwt.events.FocusListener#focusLost
321      * @see dwt.events.FocusEvent
322      */
323     public static const int FocusOut = 16;
324
325     /**
326      * The expand event type (value is 17).
327      *
328      * @see dwt.widgets.Widget#addListener
329      * @see dwt.widgets.Display#addFilter
330      * @see dwt.widgets.Event
331      *
332      * @see dwt.widgets.Tree#addTreeListener
333      * @see dwt.events.TreeListener#treeExpanded
334      * @see dwt.events.TreeEvent
335      */
336     public static const int Expand = 17;
337
338     /**
339      * The collapse event type (value is 18).
340      *
341      * @see dwt.widgets.Widget#addListener
342      * @see dwt.widgets.Display#addFilter
343      * @see dwt.widgets.Event
344      *
345      * @see dwt.widgets.Tree#addTreeListener
346      * @see dwt.events.TreeListener#treeCollapsed
347      * @see dwt.events.TreeEvent
348      */
349     public static const int Collapse = 18;
350
351     /**
352      * The iconify event type (value is 19).
353      *
354      * @see dwt.widgets.Widget#addListener
355      * @see dwt.widgets.Display#addFilter
356      * @see dwt.widgets.Event
357      *
358      * @see dwt.widgets.Shell#addShellListener
359      * @see dwt.events.ShellListener#shellIconified
360      * @see dwt.events.ShellEvent
361      */
362     public static const int Iconify = 19;
363
364     /**
365      * The de-iconify event type (value is 20).
366      *
367      * @see dwt.widgets.Widget#addListener
368      * @see dwt.widgets.Display#addFilter
369      * @see dwt.widgets.Event
370      *
371      * @see dwt.widgets.Shell#addShellListener
372      * @see dwt.events.ShellListener#shellDeiconified
373      * @see dwt.events.ShellEvent
374      */
375     public static const int Deiconify = 20;
376
377     /**
378      * The close event type (value is 21).
379      *
380      * @see dwt.widgets.Widget#addListener
381      * @see dwt.widgets.Display#addListener
382      * @see dwt.widgets.Display#addFilter
383      * @see dwt.widgets.Event
384      *
385      * @see dwt.widgets.Shell#addShellListener
386      * @see dwt.events.ShellListener#shellClosed
387      * @see dwt.events.ShellEvent
388      */
389     public static const int Close = 21;
390
391     /**
392      * The show event type (value is 22).
393      *
394      * @see dwt.widgets.Widget#addListener
395      * @see dwt.widgets.Display#addFilter
396      * @see dwt.widgets.Event
397      *
398      * @see dwt.widgets.Menu#addMenuListener
399      * @see dwt.events.MenuListener#menuShown
400      * @see dwt.events.MenuEvent
401      */
402     public static const int Show = 22;
403
404     /**
405      * The hide event type (value is 23).
406      *
407      * @see dwt.widgets.Widget#addListener
408      * @see dwt.widgets.Display#addFilter
409      * @see dwt.widgets.Event
410      *
411      * @see dwt.widgets.Menu#addMenuListener
412      * @see dwt.events.MenuListener#menuHidden
413      * @see dwt.events.MenuEvent
414      */
415     public static const int Hide = 23;
416
417     /**
418      * The modify event type (value is 24).
419      *
420      * @see dwt.widgets.Widget#addListener
421      * @see dwt.widgets.Display#addFilter
422      * @see dwt.widgets.Event
423      *
424      * @see dwt.widgets.Combo#addModifyListener
425      * @see dwt.widgets.Spinner#addModifyListener
426      * @see dwt.widgets.Text#addModifyListener
427      * @see dwt.events.ModifyListener#modifyText
428      * @see dwt.events.ModifyEvent
429      */
430     public static const int Modify = 24;
431
432     /**
433      * The verify event type (value is 25).
434      *
435      * @see dwt.widgets.Widget#addListener
436      * @see dwt.widgets.Display#addFilter
437      * @see dwt.widgets.Event
438      *
439      * @see dwt.custom.CCombo#addVerifyListener
440      * @see dwt.widgets.Combo#addVerifyListener
441      * @see dwt.custom.StyledText#addVerifyListener
442      * @see dwt.widgets.Text#addVerifyListener
443      * @see dwt.events.VerifyListener#verifyText
444      * @see dwt.events.VerifyEvent
445      */
446     public static const int Verify = 25;
447
448     /**
449      * The activate event type (value is 26).
450      *
451      * @see dwt.widgets.Widget#addListener
452      * @see dwt.widgets.Display#addFilter
453      * @see dwt.widgets.Event
454      *
455      * @see dwt.widgets.Shell#addShellListener
456      * @see dwt.events.ShellListener#shellActivated
457      * @see dwt.events.ShellEvent
458      */
459     public static const int Activate = 26;
460
461     /**
462      * The deactivate event type (value is 27).
463      *
464      * @see dwt.widgets.Widget#addListener
465      * @see dwt.widgets.Display#addFilter
466      * @see dwt.widgets.Event
467      *
468      * @see dwt.widgets.Shell#addShellListener
469      * @see dwt.events.ShellListener#shellDeactivated
470      * @see dwt.events.ShellEvent
471      */
472     public static const int Deactivate = 27;
473
474     /**
475      * The help event type (value is 28).
476      *
477      * @see dwt.widgets.Widget#addListener
478      * @see dwt.widgets.Display#addFilter
479      * @see dwt.widgets.Event
480      *
481      * @see dwt.widgets.Control#addHelpListener
482      * @see dwt.widgets.Menu#addHelpListener
483      * @see dwt.widgets.MenuItem#addHelpListener
484      * @see dwt.events.HelpListener#helpRequested
485      * @see dwt.events.HelpEvent
486      */
487     public static const int Help = 28;
488
489     /**
490      * The drag detect event type (value is 29).
491      *
492      * @see dwt.widgets.Widget#addListener
493      * @see dwt.widgets.Display#addFilter
494      * @see dwt.widgets.Event
495      *
496      * @see dwt.dnd.DragSource
497      */
498     public static const int DragDetect = 29;
499
500     /**
501      * The arm event type (value is 30).
502      *
503      * @see dwt.widgets.Widget#addListener
504      * @see dwt.widgets.Display#addFilter
505      * @see dwt.widgets.Event
506      *
507      * @see dwt.widgets.MenuItem#addArmListener
508      * @see dwt.events.ArmListener#widgetArmed
509      * @see dwt.events.ArmEvent
510      */
511     public static const int Arm = 30;
512
513     /**
514      * The traverse event type (value is 31).
515      *
516      * @see dwt.widgets.Widget#addListener
517      * @see dwt.widgets.Display#addFilter
518      * @see dwt.widgets.Event
519      *
520      * @see dwt.widgets.Control#addTraverseListener
521      * @see dwt.events.TraverseListener#keyTraversed
522      * @see dwt.events.TraverseEvent
523      */
524     public static const int Traverse = 31;
525
526     /**
527      * The mouse hover event type (value is 32).
528      *
529      * @see dwt.widgets.Widget#addListener
530      * @see dwt.widgets.Display#addFilter
531      * @see dwt.widgets.Event
532      *
533      * @see dwt.widgets.Control#addMouseTrackListener
534      * @see dwt.events.MouseTrackListener#mouseHover
535      * @see dwt.events.MouseEvent
536      */
537     public static const int MouseHover = 32;
538
539     /**
540      * The hardware key down event type (value is 33).
541      *
542      * @see dwt.widgets.Widget#addListener
543      * @see dwt.widgets.Display#addFilter
544      * @see dwt.widgets.Event
545      */
546     public static const int HardKeyDown = 33;
547
548     /**
549      * The hardware key up event type (value is 34).
550      *
551      * @see dwt.widgets.Widget#addListener
552      * @see dwt.widgets.Display#addFilter
553      * @see dwt.widgets.Event
554      */
555     public static const int HardKeyUp = 34;
556
557     /**
558      * The menu detect event type (value is 35).
559      *
560      * @see dwt.widgets.Widget#addListener
561      * @see dwt.widgets.Display#addFilter
562      * @see dwt.widgets.Event
563      *
564      * @since 3.0
565      */
566     public static const int MenuDetect = 35;
567
568     /**
569      * The set data event type (value is 36).
570      *
571      * @see dwt.widgets.Widget#addListener
572      * @see dwt.widgets.Display#addFilter
573      * @see dwt.widgets.Event
574      *
575      * @see dwt.widgets.Table
576      * @see dwt.widgets.Tree
577      *
578      * @since 3.0
579      */
580     public static const int SetData = 36;
581
582     /**
583      * The mouse wheel event type (value is 37).
584      *
585      * @see dwt.widgets.Widget#addListener
586      * @see dwt.widgets.Display#addFilter
587      * @see dwt.widgets.Event
588      *
589      * @since 3.1
590      */
591     public static const int MouseWheel = 37;
592
593     /**
594      * The settings changed event type (value is 39).
595      * <p>
596      * The settings changed event is sent when an operating system
597      * property, such as a system font or color, has been changed.
598      * The event occurs after the property has been changed, but
599      * before any widget is redrawn.  Applications that cache operating
600      * system properties can use this event to update their caches.
601      * A specific property change can be detected by querying the
602      * new value of a property and comparing it with the equivalent
603      * cached value.  The operating system automatically redraws and
604      * lays out all widgets after this event is sent.
605      * </p>
606      *
607      * @see dwt.widgets.Display#addListener
608      * @see dwt.widgets.Event
609      *
610      * @since 3.2
611      */
612     public static const int Settings = 39;
613
614     /**
615      * The erase item event type (value is 40).
616      *
617      * @see dwt.widgets.Widget#addListener
618      * @see dwt.widgets.Display#addFilter
619      * @see dwt.widgets.Event
620      *
621      * @since 3.2
622      */
623     public static const int EraseItem = 40;
624
625     /**
626      * The measure item event type (value is 41).
627      *
628      * @see dwt.widgets.Widget#addListener
629      * @see dwt.widgets.Display#addFilter
630      * @see dwt.widgets.Event
631      *
632      * @since 3.2
633      */
634     public static const int MeasureItem = 41;
635
636     /**
637      * The paint item event type (value is 42).
638      *
639      * @see dwt.widgets.Widget#addListener
640      * @see dwt.widgets.Display#addFilter
641      * @see dwt.widgets.Event
642      *
643      * @since 3.2
644      */
645     public static const int PaintItem = 42;
646
647     /**
648      * The IME composition event type (value is 43).
649      * <p>
650      * The IME composition event is sent to allow
651      * custom text editors to implement in-line
652      * editing of international text.
653      * </p>
654      *
655      * The detail field indicates the action to be taken:
656      * <p><ul>
657      * <li>{@link DWT#COMPOSITION_CHANGED}</li>
658      * <li>{@link DWT#COMPOSITION_OFFSET}</li>
659      * <li>{@link DWT#COMPOSITION_SELECTION}</li>
660      * </ul></p>
661      *
662      * @see dwt.widgets.Widget#addListener
663      * @see dwt.widgets.Display#addFilter
664      * @see dwt.widgets.Event
665      *
666      * @since 3.4
667      */
668     public static const int ImeComposition = 43;
669
670     /* Event Details */
671
672     /**
673      * The IME composition event detail that indicates
674      * a change in the IME composition. The text field
675      * of the event is the new composition text.
676      * The start and end indicate the offsets where the
677      * composition text should be inserted.
678      * The styles and ranges are stored in the IME
679      * object (value is 1).
680      *
681      * @see DWT#ImeComposition
682      *
683      * @since 3.4
684      */
685     public static const int COMPOSITION_CHANGED = 1;
686
687     /**
688      * The IME composition event detail that indicates
689      * that the IME needs the offset for a given location.
690      * The x and y fields of the event are used by the
691      * application to determine the offset.
692      *
693      * The index field of the event should be set to the
694      * text offset at that location. The count field should
695      * be set to indicate whether the location is closer to
696      * the leading edge (0) or the trailing edge (1) (value is 2).
697      *
698      * @see DWT#ImeComposition
699      * @see dwt.graphics.TextLayout#getOffset(int, int, int[])
700      *
701      * @since 3.4
702      */
703     public static const int COMPOSITION_OFFSET = 2;
704
705     /**
706      * The IME composition event detail that indicates
707      * that IME needs the selected text and its start
708      * and end offsets (value is 3).
709      *
710      * @see DWT#ImeComposition
711      *
712      * @since 3.4
713      */
714     public static const int COMPOSITION_SELECTION = 3;
715
716     /**
717      * Indicates that a user-interface component is being dragged,
718      * for example dragging the thumb of a scroll bar (value is 1).
719      */
720     public static const int DRAG = 1;
721
722     /**
723      * Event detail field that indicates a user-interface component
724      * state is selected (value is 1&lt;&lt;1).
725      *
726      * @since 3.2
727      */
728     public static const int SELECTED = 1 << 1;
729
730     /**
731      * Event detail field that indicates a user-interface component
732      * state is focused (value is 1&lt;&lt;2).
733      *
734      * @since 3.2
735      */
736     public static const int FOCUSED = 1 << 2;
737
738     /**
739      * Event detail field that indicates a user-interface component
740      * draws the background (value is 1&lt;&lt;3).
741      *
742      * @since 3.2
743      */
744     public static const int BACKGROUND = 1 << 3;
745
746     /**
747      * Event detail field that indicates a user-interface component
748      * draws the foreground (value is 1&lt;&lt;4).
749      *
750      * @since 3.2
751      */
752     public static const int FOREGROUND = 1 << 4;
753
754     /**
755      * Event detail field that indicates a user-interface component
756      * state is hot (value is 1&lt;&lt;5).
757      *
758      * @since 3.3
759      */
760     public static const int HOT = 1 << 5;
761
762     /* This code is intentionally commented */
763     //public static const int PRESSED = 1 << 3;
764     //public static const int ACTIVE = 1 << 4;
765     //public static const int DISABLED = 1 << 5;
766     //public static const int HOT = 1 << 6;
767     //public static const int DEFAULTED = 1 << 7;
768
769     /**
770      * Traversal event detail field value indicating that no
771      * traversal action should be taken
772      * (value is 0).
773      */
774     public static const int TRAVERSE_NONE = 0;
775
776     /**
777      * Traversal event detail field value indicating that the
778      * key which designates that a dialog should be cancelled was
779      * pressed; typically, this is the ESC key
780      * (value is 1&lt;&lt;1).
781      */
782     public static const int TRAVERSE_ESCAPE = 1 << 1;
783
784     /**
785      * Traversal event detail field value indicating that the
786      * key which activates the default button in a dialog was
787      * pressed; typically, this is the ENTER key
788      * (value is 1&lt;&lt;2).
789      */
790     public static const int TRAVERSE_RETURN = 1 << 2;
791
792     /**
793      * Traversal event detail field value indicating that the
794      * key which designates that focus should be given to the
795      * previous tab group was pressed; typically, this is the
796      * SHIFT-TAB key sequence
797      * (value is 1&lt;&lt;3).
798      */
799     public static const int TRAVERSE_TAB_PREVIOUS = 1 << 3;
800
801     /**
802      * Traversal event detail field value indicating that the
803      * key which designates that focus should be given to the
804      * next tab group was pressed; typically, this is the
805      * TAB key
806      * (value is 1&lt;&lt;4).
807      */
808     public static const int TRAVERSE_TAB_NEXT = 1 << 4;
809
810     /**
811      * Traversal event detail field value indicating that the
812      * key which designates that focus should be given to the
813      * previous tab item was pressed; typically, this is either
814      * the LEFT-ARROW or UP-ARROW keys
815      * (value is 1&lt;&lt;5).
816      */
817     public static const int TRAVERSE_ARROW_PREVIOUS = 1 << 5;
818
819     /**
820      * Traversal event detail field value indicating that the
821      * key which designates that focus should be given to the
822      * previous tab item was pressed; typically, this is either
823      * the RIGHT-ARROW or DOWN-ARROW keys
824      * (value is 1&lt;&lt;6).
825      */
826     public static const int TRAVERSE_ARROW_NEXT = 1 << 6;
827
828     /**
829      * Traversal event detail field value indicating that a
830      * mnemonic key sequence was pressed
831      * (value is 1&lt;&lt;7).
832      */
833     public static const int TRAVERSE_MNEMONIC = 1 << 7;
834
835     /**
836      * Traversal event detail field value indicating that the
837      * key which designates that the previous page of a multi-page
838      * window should be shown was pressed; typically, this
839      * is the CTRL-PAGEUP key sequence
840      * (value is 1&lt;&lt;8).
841      */
842     public static const int TRAVERSE_PAGE_PREVIOUS = 1 << 8;
843
844     /**
845      * Traversal event detail field value indicating that the
846      * key which designates that the next page of a multi-page
847      * window should be shown was pressed; typically, this
848      * is the CTRL-PAGEDOWN key sequence
849      * (value is 1&lt;&lt;9).
850      */
851     public static const int TRAVERSE_PAGE_NEXT = 1 << 9;
852
853     /**
854      * A constant known to be zero (0), typically used in operations
855      * which take bit flags to indicate that "no bits are set".
856      */
857     public static const int NONE = 0;
858
859     /**
860      * A constant known to be zero (0), used in operations which
861      * take pointers to indicate a null argument.
862      */
863     public static const int NULL = 0;
864
865     /**
866      * Indicates that a default should be used (value is -1).
867      */
868     public static const int DEFAULT = -1;
869
870     /**
871      * Indicates that a property is off (value is 0).
872      *
873      * @since 3.1
874      */
875     public static const int OFF = 0;
876
877     /**
878      * Indicates that a property is on (value is 1).
879      *
880      * @since 3.1
881      */
882     public static const int ON = 1;
883
884     /**
885      * Indicates low quality (value is 1).
886      *
887      * @since 3.1
888      */
889     public static const int LOW =