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 org.eclipse.swt.SWT;
14 
15 
16 import org.eclipse.swt.internal.Compatibility;
17 import org.eclipse.swt.internal.Library;
18 import org.eclipse.swt.internal.Platform;
19 import org.eclipse.swt.SWTError;
20 import org.eclipse.swt.SWTException;
21 
22 import java.lang.all;
23 
24 version(Tango){
25 } else { // Phobos
26 }
27 
28 //version=CARBON;
29 
30 
31 /**
32  * This class provides access to a small number of SWT system-wide
33  * methods, and in addition defines the public constants provided
34  * by SWT.
35  * <p>
36  * By defining constants like UP and DOWN in a single class, SWT
37  * can share common names and concepts at the same time minimizing
38  * the number of classes, names and constants for the application
39  * programmer.
40  * </p><p>
41  * Note that some of the constants provided by this class represent
42  * optional, appearance related aspects of widgets which are available
43  * either only on some window systems, or for a differing set of
44  * widgets on each window system. These constants are marked
45  * as <em>HINT</em>s. The set of widgets which support a particular
46  * <em>HINT</em> may change from release to release, although we typically
47  * will not withdraw support for a <em>HINT</em> once it is made available.
48  * </p>
49  *
50  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
51  */
52 
53 /* NOTE:
54  *   Good javadoc coding style is to put the values of static const
55  *   constants in the comments. This reinforces the fact that
56  *   consumers are allowed to rely on the value (and they must
57  *   since the values are compiled inline in their code). We
58  *   can <em>not</em> change the values of these constants between
59  *   releases.
60  */
61 public class SWT {
62 
63     /* Widget Event Constants */
64 
65     /**
66      * The null event type (value is 0).
67      *
68      * @since 3.0
69      */
70     public static const int None = 0;
71 
72     /**
73      * The key down event type (value is 1).
74      *
75      * @see org.eclipse.swt.widgets.Widget#addListener
76      * @see org.eclipse.swt.widgets.Display#addFilter
77      * @see org.eclipse.swt.widgets.Event
78      *
79      * @see org.eclipse.swt.widgets.Control#addKeyListener
80      * @see org.eclipse.swt.widgets.Tracker#addKeyListener
81      * @see org.eclipse.swt.events.KeyListener#keyPressed
82      * @see org.eclipse.swt.events.KeyEvent
83      */
84     public static const int KeyDown = 1;
85 
86     /**
87      * The key up event type (value is 2).
88      *
89      * @see org.eclipse.swt.widgets.Widget#addListener
90      * @see org.eclipse.swt.widgets.Display#addFilter
91      * @see org.eclipse.swt.widgets.Event
92      *
93      * @see org.eclipse.swt.widgets.Control#addKeyListener
94      * @see org.eclipse.swt.widgets.Tracker#addKeyListener
95      * @see org.eclipse.swt.events.KeyListener#keyReleased
96      * @see org.eclipse.swt.events.KeyEvent
97      */
98     public static const int KeyUp = 2;
99 
100     /**
101      * The mouse down event type (value is 3).
102      *
103      * @see org.eclipse.swt.widgets.Widget#addListener
104      * @see org.eclipse.swt.widgets.Display#addFilter
105      * @see org.eclipse.swt.widgets.Event
106      *
107      * @see org.eclipse.swt.widgets.Control#addMouseListener
108      * @see org.eclipse.swt.events.MouseListener#mouseDown
109      * @see org.eclipse.swt.events.MouseEvent
110      */
111     public static const int MouseDown = 3;
112 
113     /**
114      * The mouse up event type (value is 4).
115      *
116      * @see org.eclipse.swt.widgets.Widget#addListener
117      * @see org.eclipse.swt.widgets.Display#addFilter
118      * @see org.eclipse.swt.widgets.Event
119      *
120      * @see org.eclipse.swt.widgets.Control#addMouseListener
121      * @see org.eclipse.swt.events.MouseListener#mouseUp
122      * @see org.eclipse.swt.events.MouseEvent
123      */
124     public static const int MouseUp = 4;
125 
126     /**
127      * The mouse move event type (value is 5).
128      *
129      * @see org.eclipse.swt.widgets.Widget#addListener
130      * @see org.eclipse.swt.widgets.Display#addFilter
131      * @see org.eclipse.swt.widgets.Event
132      *
133      * @see org.eclipse.swt.widgets.Control#addMouseMoveListener
134      * @see org.eclipse.swt.events.MouseMoveListener#mouseMove
135      * @see org.eclipse.swt.events.MouseEvent
136      */
137     public static const int MouseMove = 5;
138 
139     /**
140      * The mouse enter event type (value is 6).
141      *
142      * @see org.eclipse.swt.widgets.Widget#addListener
143      * @see org.eclipse.swt.widgets.Display#addFilter
144      * @see org.eclipse.swt.widgets.Event
145      *
146      * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
147      * @see org.eclipse.swt.events.MouseTrackListener#mouseEnter
148      * @see org.eclipse.swt.events.MouseEvent
149      */
150     public static const int MouseEnter = 6;
151 
152     /**
153      * The mouse exit event type (value is 7).
154      *
155      * @see org.eclipse.swt.widgets.Widget#addListener
156      * @see org.eclipse.swt.widgets.Display#addFilter
157      * @see org.eclipse.swt.widgets.Event
158      *
159      * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
160      * @see org.eclipse.swt.events.MouseTrackListener#mouseExit
161      * @see org.eclipse.swt.events.MouseEvent
162      */
163     public static const int MouseExit = 7;
164 
165     /**
166      * The mouse double click event type (value is 8).
167      *
168      * @see org.eclipse.swt.widgets.Widget#addListener
169      * @see org.eclipse.swt.widgets.Display#addFilter
170      * @see org.eclipse.swt.widgets.Event
171      *
172      * @see org.eclipse.swt.widgets.Control#addMouseListener
173      * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick
174      * @see org.eclipse.swt.events.MouseEvent
175      */
176     public static const int MouseDoubleClick = 8;
177 
178     /**
179      * The paint event type (value is 9).
180      *
181      * @see org.eclipse.swt.widgets.Widget#addListener
182      * @see org.eclipse.swt.widgets.Display#addFilter
183      * @see org.eclipse.swt.widgets.Event
184      *
185      * @see org.eclipse.swt.widgets.Control#addPaintListener
186      * @see org.eclipse.swt.events.PaintListener#paintControl
187      * @see org.eclipse.swt.events.PaintEvent
188      */
189     public static const int Paint = 9;
190 
191     /**
192      * The move event type (value is 10).
193      *
194      * @see org.eclipse.swt.widgets.Widget#addListener
195      * @see org.eclipse.swt.widgets.Display#addFilter
196      * @see org.eclipse.swt.widgets.Event
197      *
198      * @see org.eclipse.swt.widgets.Control#addControlListener
199      * @see org.eclipse.swt.widgets.TableColumn#addControlListener
200      * @see org.eclipse.swt.widgets.Tracker#addControlListener
201      * @see org.eclipse.swt.widgets.TreeColumn#addControlListener
202      * @see org.eclipse.swt.events.ControlListener#controlMoved
203      * @see org.eclipse.swt.events.ControlEvent
204      */
205     public static const int Move = 10;
206 
207     /**
208      * The resize event type (value is 11).
209      *
210      * @see org.eclipse.swt.widgets.Widget#addListener
211      * @see org.eclipse.swt.widgets.Display#addFilter
212      * @see org.eclipse.swt.widgets.Event
213      *
214      * @see org.eclipse.swt.widgets.Control#addControlListener
215      * @see org.eclipse.swt.widgets.TableColumn#addControlListener
216      * @see org.eclipse.swt.widgets.Tracker#addControlListener
217      * @see org.eclipse.swt.widgets.TreeColumn#addControlListener
218      * @see org.eclipse.swt.events.ControlListener#controlResized
219      * @see org.eclipse.swt.events.ControlEvent
220      */
221     public static const int Resize = 11;
222 
223     /**
224      * The dispose event type (value is 12).
225      *
226      * @see org.eclipse.swt.widgets.Widget#addListener
227      * @see org.eclipse.swt.widgets.Display#addListener
228      * @see org.eclipse.swt.widgets.Display#addFilter
229      * @see org.eclipse.swt.widgets.Event
230      *
231      * @see org.eclipse.swt.widgets.Widget#addDisposeListener
232      * @see org.eclipse.swt.events.DisposeListener#widgetDisposed
233      * @see org.eclipse.swt.events.DisposeEvent
234      */
235     public static const int Dispose = 12;
236 
237     /**
238      * The selection event type (value is 13).
239      *
240      * @see org.eclipse.swt.widgets.Widget#addListener
241      * @see org.eclipse.swt.widgets.Display#addFilter
242      * @see org.eclipse.swt.widgets.Event
243      *
244      * @see org.eclipse.swt.widgets.Button#addSelectionListener
245      * @see org.eclipse.swt.widgets.Combo#addSelectionListener
246      * @see org.eclipse.swt.widgets.CoolItem#addSelectionListener
247      * @see org.eclipse.swt.widgets.Link#addSelectionListener
248      * @see org.eclipse.swt.widgets.List#addSelectionListener
249      * @see org.eclipse.swt.widgets.MenuItem#addSelectionListener
250      * @see org.eclipse.swt.widgets.Sash#addSelectionListener
251      * @see org.eclipse.swt.widgets.Scale#addSelectionListener
252      * @see org.eclipse.swt.widgets.ScrollBar#addSelectionListener
253      * @see org.eclipse.swt.widgets.Slider#addSelectionListener
254      * @see org.eclipse.swt.widgets.TabFolder#addSelectionListener
255      * @see org.eclipse.swt.widgets.Table#addSelectionListener
256      * @see org.eclipse.swt.widgets.TableColumn#addSelectionListener
257      * @see org.eclipse.swt.widgets.ToolItem#addSelectionListener
258      * @see org.eclipse.swt.widgets.TrayItem#addSelectionListener
259      * @see org.eclipse.swt.widgets.Tree#addSelectionListener
260      * @see org.eclipse.swt.widgets.TreeColumn#addSelectionListener
261      * @see org.eclipse.swt.events.SelectionListener#widgetSelected
262      * @see org.eclipse.swt.events.SelectionEvent
263      */
264     public static const int Selection = 13;
265 
266     /**
267      * The default selection event type (value is 14).
268      *
269      * @see org.eclipse.swt.widgets.Widget#addListener
270      * @see org.eclipse.swt.widgets.Display#addFilter
271      * @see org.eclipse.swt.widgets.Event
272      *
273      * @see org.eclipse.swt.widgets.Combo#addSelectionListener
274      * @see org.eclipse.swt.widgets.List#addSelectionListener
275      * @see org.eclipse.swt.widgets.Spinner#addSelectionListener
276      * @see org.eclipse.swt.widgets.Table#addSelectionListener
277      * @see org.eclipse.swt.widgets.Text#addSelectionListener
278      * @see org.eclipse.swt.widgets.TrayItem#addSelectionListener
279      * @see org.eclipse.swt.widgets.Tree#addSelectionListener
280      * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected
281      * @see org.eclipse.swt.events.SelectionEvent
282      */
283     public static const int DefaultSelection = 14;
284 
285     /**
286      * The focus in event type (value is 15).
287      *
288      * @see org.eclipse.swt.widgets.Widget#addListener
289      * @see org.eclipse.swt.widgets.Display#addFilter
290      * @see org.eclipse.swt.widgets.Event
291      *
292      * @see org.eclipse.swt.widgets.Control#addFocusListener
293      * @see org.eclipse.swt.events.FocusListener#focusGained
294      * @see org.eclipse.swt.events.FocusEvent
295      */
296     public static const int FocusIn = 15;
297 
298     /**
299      * The focus out event type (value is 16).
300      *
301      * @see org.eclipse.swt.widgets.Widget#addListener
302      * @see org.eclipse.swt.widgets.Display#addFilter
303      * @see org.eclipse.swt.widgets.Event
304      *
305      * @see org.eclipse.swt.widgets.Control#addFocusListener
306      * @see org.eclipse.swt.events.FocusListener#focusLost
307      * @see org.eclipse.swt.events.FocusEvent
308      */
309     public static const int FocusOut = 16;
310 
311     /**
312      * The expand event type (value is 17).
313      *
314      * @see org.eclipse.swt.widgets.Widget#addListener
315      * @see org.eclipse.swt.widgets.Display#addFilter
316      * @see org.eclipse.swt.widgets.Event
317      *
318      * @see org.eclipse.swt.widgets.Tree#addTreeListener
319      * @see org.eclipse.swt.events.TreeListener#treeExpanded
320      * @see org.eclipse.swt.events.TreeEvent
321      */
322     public static const int Expand = 17;
323 
324     /**
325      * The collapse event type (value is 18).
326      *
327      * @see org.eclipse.swt.widgets.Widget#addListener
328      * @see org.eclipse.swt.widgets.Display#addFilter
329      * @see org.eclipse.swt.widgets.Event
330      *
331      * @see org.eclipse.swt.widgets.Tree#addTreeListener
332      * @see org.eclipse.swt.events.TreeListener#treeCollapsed
333      * @see org.eclipse.swt.events.TreeEvent
334      */
335     public static const int Collapse = 18;
336 
337     /**
338      * The iconify event type (value is 19).
339      *
340      * @see org.eclipse.swt.widgets.Widget#addListener
341      * @see org.eclipse.swt.widgets.Display#addFilter
342      * @see org.eclipse.swt.widgets.Event
343      *
344      * @see org.eclipse.swt.widgets.Shell#addShellListener
345      * @see org.eclipse.swt.events.ShellListener#shellIconified
346      * @see org.eclipse.swt.events.ShellEvent
347      */
348     public static const int Iconify = 19;
349 
350     /**
351      * The de-iconify event type (value is 20).
352      *
353      * @see org.eclipse.swt.widgets.Widget#addListener
354      * @see org.eclipse.swt.widgets.Display#addFilter
355      * @see org.eclipse.swt.widgets.Event
356      *
357      * @see org.eclipse.swt.widgets.Shell#addShellListener
358      * @see org.eclipse.swt.events.ShellListener#shellDeiconified
359      * @see org.eclipse.swt.events.ShellEvent
360      */
361     public static const int Deiconify = 20;
362 
363     /**
364      * The close event type (value is 21).
365      *
366      * @see org.eclipse.swt.widgets.Widget#addListener
367      * @see org.eclipse.swt.widgets.Display#addListener
368      * @see org.eclipse.swt.widgets.Display#addFilter
369      * @see org.eclipse.swt.widgets.Event
370      *
371      * @see org.eclipse.swt.widgets.Shell#addShellListener
372      * @see org.eclipse.swt.events.ShellListener#shellClosed
373      * @see org.eclipse.swt.events.ShellEvent
374      */
375     public static const int Close = 21;
376 
377     /**
378      * The show event type (value is 22).
379      *
380      * @see org.eclipse.swt.widgets.Widget#addListener
381      * @see org.eclipse.swt.widgets.Display#addFilter
382      * @see org.eclipse.swt.widgets.Event
383      *
384      * @see org.eclipse.swt.widgets.Menu#addMenuListener
385      * @see org.eclipse.swt.events.MenuListener#menuShown
386      * @see org.eclipse.swt.events.MenuEvent
387      */
388     public static const int Show = 22;
389 
390     /**
391      * The hide event type (value is 23).
392      *
393      * @see org.eclipse.swt.widgets.Widget#addListener
394      * @see org.eclipse.swt.widgets.Display#addFilter
395      * @see org.eclipse.swt.widgets.Event
396      *
397      * @see org.eclipse.swt.widgets.Menu#addMenuListener
398      * @see org.eclipse.swt.events.MenuListener#menuHidden
399      * @see org.eclipse.swt.events.MenuEvent
400      */
401     public static const int Hide = 23;
402 
403     /**
404      * The modify event type (value is 24).
405      *
406      * @see org.eclipse.swt.widgets.Widget#addListener
407      * @see org.eclipse.swt.widgets.Display#addFilter
408      * @see org.eclipse.swt.widgets.Event
409      *
410      * @see org.eclipse.swt.widgets.Combo#addModifyListener
411      * @see org.eclipse.swt.widgets.Spinner#addModifyListener
412      * @see org.eclipse.swt.widgets.Text#addModifyListener
413      * @see org.eclipse.swt.events.ModifyListener#modifyText
414      * @see org.eclipse.swt.events.ModifyEvent
415      */
416     public static const int Modify = 24;
417 
418     /**
419      * The verify event type (value is 25).
420      *
421      * @see org.eclipse.swt.widgets.Widget#addListener
422      * @see org.eclipse.swt.widgets.Display#addFilter
423      * @see org.eclipse.swt.widgets.Event
424      *
425      * @see org.eclipse.swt.custom.CCombo#addVerifyListener
426      * @see org.eclipse.swt.widgets.Combo#addVerifyListener
427      * @see org.eclipse.swt.custom.StyledText#addVerifyListener
428      * @see org.eclipse.swt.widgets.Text#addVerifyListener
429      * @see org.eclipse.swt.events.VerifyListener#verifyText
430      * @see org.eclipse.swt.events.VerifyEvent
431      */
432     public static const int Verify = 25;
433 
434     /**
435      * The activate event type (value is 26).
436      *
437      * @see org.eclipse.swt.widgets.Widget#addListener
438      * @see org.eclipse.swt.widgets.Display#addFilter
439      * @see org.eclipse.swt.widgets.Event
440      *
441      * @see org.eclipse.swt.widgets.Shell#addShellListener
442      * @see org.eclipse.swt.events.ShellListener#shellActivated
443      * @see org.eclipse.swt.events.ShellEvent
444      */
445     public static const int Activate = 26;
446 
447     /**
448      * The deactivate event type (value is 27).
449      *
450      * @see org.eclipse.swt.widgets.Widget#addListener
451      * @see org.eclipse.swt.widgets.Display#addFilter
452      * @see org.eclipse.swt.widgets.Event
453      *
454      * @see org.eclipse.swt.widgets.Shell#addShellListener
455      * @see org.eclipse.swt.events.ShellListener#shellDeactivated
456      * @see org.eclipse.swt.events.ShellEvent
457      */
458     public static const int Deactivate = 27;
459 
460     /**
461      * The help event type (value is 28).
462      *
463      * @see org.eclipse.swt.widgets.Widget#addListener
464      * @see org.eclipse.swt.widgets.Display#addFilter
465      * @see org.eclipse.swt.widgets.Event
466      *
467      * @see org.eclipse.swt.widgets.Control#addHelpListener
468      * @see org.eclipse.swt.widgets.Menu#addHelpListener
469      * @see org.eclipse.swt.widgets.MenuItem#addHelpListener
470      * @see org.eclipse.swt.events.HelpListener#helpRequested
471      * @see org.eclipse.swt.events.HelpEvent
472      */
473     public static const int Help = 28;
474 
475     /**
476      * The drag detect event type (value is 29).
477      *
478      * @see org.eclipse.swt.widgets.Widget#addListener
479      * @see org.eclipse.swt.widgets.Display#addFilter
480      * @see org.eclipse.swt.widgets.Event
481      *
482      * @see org.eclipse.swt.dnd.DragSource
483      */
484     public static const int DragDetect = 29;
485 
486     /**
487      * The arm event type (value is 30).
488      *
489      * @see org.eclipse.swt.widgets.Widget#addListener
490      * @see org.eclipse.swt.widgets.Display#addFilter
491      * @see org.eclipse.swt.widgets.Event
492      *
493      * @see org.eclipse.swt.widgets.MenuItem#addArmListener
494      * @see org.eclipse.swt.events.ArmListener#widgetArmed
495      * @see org.eclipse.swt.events.ArmEvent
496      */
497     public static const int Arm = 30;
498 
499     /**
500      * The traverse event type (value is 31).
501      *
502      * @see org.eclipse.swt.widgets.Widget#addListener
503      * @see org.eclipse.swt.widgets.Display#addFilter
504      * @see org.eclipse.swt.widgets.Event
505      *
506      * @see org.eclipse.swt.widgets.Control#addTraverseListener
507      * @see org.eclipse.swt.events.TraverseListener#keyTraversed
508      * @see org.eclipse.swt.events.TraverseEvent
509      */
510     public static const int Traverse = 31;
511 
512     /**
513      * The mouse hover event type (value is 32).
514      *
515      * @see org.eclipse.swt.widgets.Widget#addListener
516      * @see org.eclipse.swt.widgets.Display#addFilter
517      * @see org.eclipse.swt.widgets.Event
518      *
519      * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
520      * @see org.eclipse.swt.events.MouseTrackListener#mouseHover
521      * @see org.eclipse.swt.events.MouseEvent
522      */
523     public static const int MouseHover = 32;
524 
525     /**
526      * The hardware key down event type (value is 33).
527      *
528      * @see org.eclipse.swt.widgets.Widget#addListener
529      * @see org.eclipse.swt.widgets.Display#addFilter
530      * @see org.eclipse.swt.widgets.Event
531      */
532     public static const int HardKeyDown = 33;
533 
534     /**
535      * The hardware key up event type (value is 34).
536      *
537      * @see org.eclipse.swt.widgets.Widget#addListener
538      * @see org.eclipse.swt.widgets.Display#addFilter
539      * @see org.eclipse.swt.widgets.Event
540      */
541     public static const int HardKeyUp = 34;
542 
543     /**
544      * The menu detect event type (value is 35).
545      *
546      * @see org.eclipse.swt.widgets.Widget#addListener
547      * @see org.eclipse.swt.widgets.Display#addFilter
548      * @see org.eclipse.swt.widgets.Event
549      *
550      * @since 3.0
551      */
552     public static const int MenuDetect = 35;
553 
554     /**
555      * The set data event type (value is 36).
556      *
557      * @see org.eclipse.swt.widgets.Widget#addListener
558      * @see org.eclipse.swt.widgets.Display#addFilter
559      * @see org.eclipse.swt.widgets.Event
560      *
561      * @see org.eclipse.swt.widgets.Table
562      * @see org.eclipse.swt.widgets.Tree
563      *
564      * @since 3.0
565      */
566     public static const int SetData = 36;
567 
568     /**
569      * The mouse wheel event type (value is 37).
570      *
571      * @see org.eclipse.swt.widgets.Widget#addListener
572      * @see org.eclipse.swt.widgets.Display#addFilter
573      * @see org.eclipse.swt.widgets.Event
574      *
575      * @since 3.1
576      */
577     public static const int MouseWheel = 37;
578 
579     /**
580      * The settings changed event type (value is 39).
581      * <p>
582      * The settings changed event is sent when an operating system
583      * property, such as a system font or color, has been changed.
584      * The event occurs after the property has been changed, but
585      * before any widget is redrawn.  Applications that cache operating
586      * system properties can use this event to update their caches.
587      * A specific property change can be detected by querying the
588      * new value of a property and comparing it with the equivalent
589      * cached value.  The operating system automatically redraws and
590      * lays out all widgets after this event is sent.
591      * </p>
592      *
593      * @see org.eclipse.swt.widgets.Display#addListener
594      * @see org.eclipse.swt.widgets.Event
595      *
596      * @since 3.2
597      */
598     public static const int Settings = 39;
599 
600     /**
601      * The erase item event type (value is 40).
602      *
603      * @see org.eclipse.swt.widgets.Widget#addListener
604      * @see org.eclipse.swt.widgets.Display#addFilter
605      * @see org.eclipse.swt.widgets.Event
606      *
607      * @since 3.2
608      */
609     public static const int EraseItem = 40;
610 
611     /**
612      * The measure item event type (value is 41).
613      *
614      * @see org.eclipse.swt.widgets.Widget#addListener
615      * @see org.eclipse.swt.widgets.Display#addFilter
616      * @see org.eclipse.swt.widgets.Event
617      *
618      * @since 3.2
619      */
620     public static const int MeasureItem = 41;
621 
622     /**
623      * The paint item event type (value is 42).
624      *
625      * @see org.eclipse.swt.widgets.Widget#addListener
626      * @see org.eclipse.swt.widgets.Display#addFilter
627      * @see org.eclipse.swt.widgets.Event
628      *
629      * @since 3.2
630      */
631     public static const int PaintItem = 42;
632 
633     /**
634      * The IME composition event type (value is 43).
635      * <p>
636      * The IME composition event is sent to allow
637      * custom text editors to implement in-line
638      * editing of international text.
639      * </p>
640      *
641      * The detail field indicates the action to be taken:
642      * <p><ul>
643      * <li>{@link SWT#COMPOSITION_CHANGED}</li>
644      * <li>{@link SWT#COMPOSITION_OFFSET}</li>
645      * <li>{@link SWT#COMPOSITION_SELECTION}</li>
646      * </ul></p>
647      *
648      * @see org.eclipse.swt.widgets.Widget#addListener
649      * @see org.eclipse.swt.widgets.Display#addFilter
650      * @see org.eclipse.swt.widgets.Event
651      *
652      * @since 3.4
653      */
654     public static const int ImeComposition = 43;
655 
656     /* Event Details */
657 
658     /**
659      * The IME composition event detail that indicates
660      * a change in the IME composition. The text field
661      * of the event is the new composition text.
662      * The start and end indicate the offsets where the
663      * composition text should be inserted.
664      * The styles and ranges are stored in the IME
665      * object (value is 1).
666      *
667      * @see SWT#ImeComposition
668      *
669      * @since 3.4
670      */
671     public static const int COMPOSITION_CHANGED = 1;
672 
673     /**
674      * The IME composition event detail that indicates
675      * that the IME needs the offset for a given location.
676      * The x and y fields of the event are used by the
677      * application to determine the offset.
678      *
679      * The index field of the event should be set to the
680      * text offset at that location. The count field should
681      * be set to indicate whether the location is closer to
682      * the leading edge (0) or the trailing edge (1) (value is 2).
683      *
684      * @see SWT#ImeComposition
685      * @see org.eclipse.swt.graphics.TextLayout#getOffset(int, int, int[])
686      *
687      * @since 3.4
688      */
689     public static const int COMPOSITION_OFFSET = 2;
690 
691     /**
692      * The IME composition event detail that indicates
693      * that IME needs the selected text and its start
694      * and end offsets (value is 3).
695      *
696      * @see SWT#ImeComposition
697      *
698      * @since 3.4
699      */
700     public static const int COMPOSITION_SELECTION = 3;
701 
702     /**
703      * Indicates that a user-interface component is being dragged,
704      * for example dragging the thumb of a scroll bar (value is 1).
705      */
706     public static const int DRAG = 1;
707 
708     /**
709      * Event detail field that indicates a user-interface component
710      * state is selected (value is 1&lt;&lt;1).
711      *
712      * @since 3.2
713      */
714     public static const int SELECTED = 1 << 1;
715 
716     /**
717      * Event detail field that indicates a user-interface component
718      * state is focused (value is 1&lt;&lt;2).
719      *
720      * @since 3.2
721      */
722     public static const int FOCUSED = 1 << 2;
723 
724     /**
725      * Event detail field that indicates a user-interface component
726      * draws the background (value is 1&lt;&lt;3).
727      *
728      * @since 3.2
729      */
730     public static const int BACKGROUND = 1 << 3;
731 
732     /**
733      * Event detail field that indicates a user-interface component
734      * draws the foreground (value is 1&lt;&lt;4).
735      *
736      * @since 3.2
737      */
738     public static const int FOREGROUND = 1 << 4;
739 
740     /**
741      * Event detail field that indicates a user-interface component
742      * state is hot (value is 1&lt;&lt;5).
743      *
744      * @since 3.3
745      */
746     public static const int HOT = 1 << 5;
747 
748     /* This code is intentionally commented */
749     //public static const int PRESSED = 1 << 3;
750     //public static const int ACTIVE = 1 << 4;
751     //public static const int DISABLED = 1 << 5;
752     //public static const int HOT = 1 << 6;
753     //public static const int DEFAULTED = 1 << 7;
754 
755     /**
756      * Traversal event detail field value indicating that no
757      * traversal action should be taken
758      * (value is 0).
759      */
760     public static const int TRAVERSE_NONE = 0;
761 
762     /**
763      * Traversal event detail field value indicating that the
764      * key which designates that a dialog should be cancelled was
765      * pressed; typically, this is the ESC key
766      * (value is 1&lt;&lt;1).
767      */
768     public static const int TRAVERSE_ESCAPE = 1 << 1;
769 
770     /**
771      * Traversal event detail field value indicating that the
772      * key which activates the default button in a dialog was
773      * pressed; typically, this is the ENTER key
774      * (value is 1&lt;&lt;2).
775      */
776     public static const int TRAVERSE_RETURN = 1 << 2;
777 
778     /**
779      * Traversal event detail field value indicating that the
780      * key which designates that focus should be given to the
781      * previous tab group was pressed; typically, this is the
782      * SHIFT-TAB key sequence
783      * (value is 1&lt;&lt;3).
784      */
785     public static const int TRAVERSE_TAB_PREVIOUS = 1 << 3;
786 
787     /**
788      * Traversal event detail field value indicating that the
789      * key which designates that focus should be given to the
790      * next tab group was pressed; typically, this is the
791      * TAB key
792      * (value is 1&lt;&lt;4).
793      */
794     public static const int TRAVERSE_TAB_NEXT = 1 << 4;
795 
796     /**
797      * Traversal event detail field value indicating that the
798      * key which designates that focus should be given to the
799      * previous tab item was pressed; typically, this is either
800      * the LEFT-ARROW or UP-ARROW keys
801      * (value is 1&lt;&lt;5).
802      */
803     public static const int TRAVERSE_ARROW_PREVIOUS = 1 << 5;
804 
805     /**
806      * Traversal event detail field value indicating that the
807      * key which designates that focus should be given to the
808      * previous tab item was pressed; typically, this is either
809      * the RIGHT-ARROW or DOWN-ARROW keys
810      * (value is 1&lt;&lt;6).
811      */
812     public static const int TRAVERSE_ARROW_NEXT = 1 << 6;
813 
814     /**
815      * Traversal event detail field value indicating that a
816      * mnemonic key sequence was pressed
817      * (value is 1&lt;&lt;7).
818      */
819     public static const int TRAVERSE_MNEMONIC = 1 << 7;
820 
821     /**
822      * Traversal event detail field value indicating that the
823      * key which designates that the previous page of a multi-page
824      * window should be shown was pressed; typically, this
825      * is the CTRL-PAGEUP key sequence
826      * (value is 1&lt;&lt;8).
827      */
828     public static const int TRAVERSE_PAGE_PREVIOUS = 1 << 8;
829 
830     /**
831      * Traversal event detail field value indicating that the
832      * key which designates that the next page of a multi-page
833      * window should be shown was pressed; typically, this
834      * is the CTRL-PAGEDOWN key sequence
835      * (value is 1&lt;&lt;9).
836      */
837     public static const int TRAVERSE_PAGE_NEXT = 1 << 9;
838 
839     /**
840      * A constant known to be zero (0), typically used in operations
841      * which take bit flags to indicate that "no bits are set".
842      */
843     public static const int NONE = 0;
844 
845     /**
846      * A constant known to be zero (0), used in operations which
847      * take pointers to indicate a null argument.
848      */
849     public static const int NULL = 0;
850 
851     /**
852      * Indicates that a default should be used (value is -1).
853      */
854     public static const int DEFAULT = -1;
855 
856     /**
857      * Indicates that a property is off (value is 0).
858      *
859      * @since 3.1
860      */
861     public static const int OFF = 0;
862 
863     /**
864      * Indicates that a property is on (value is 1).
865      *
866      * @since 3.1
867      */
868     public static const int ON = 1;
869 
870     /**
871      * Indicates low quality (value is 1).
872      *
873      * @since 3.1
874      */
875     public static const int LOW = 1;
876 
877     /**
878      * Indicates high quality (value is 2).
879      *
880      * @since 3.1
881      */
882     public static const int HIGH = 2;
883 
884     /**
885      * Style constant for menu bar behavior (value is 1&lt;&lt;1).
886      * <p><b>Used By:</b><ul>
887      * <li><code>Menu</code></li>
888      * </ul></p>
889      */
890     public static const int BAR = 1 << 1;
891 
892     /**
893      * Style constant for drop down menu/list behavior (value is 1&lt;&lt;2).
894      * <p><b>Used By:</b><ul>
895      * <li><code>Menu</code></li>
896      * <li><code>ToolItem</code></li>
897      * <li><code>CoolItem</code></li>
898      * <li><code>Combo</code></li>
899      * </ul></p>
900      */
901     public static const int DROP_DOWN = 1 << 2;
902 
903     /**
904      * Style constant for pop up menu behavior (value is 1&lt;&lt;3).
905      * <p><b>Used By:</b><ul>
906      * <li><code>Menu</code></li>
907      * </ul></p>
908      */
909     public static const int POP_UP = 1 << 3;
910 
911     /**
912      * Style constant for line separator behavior (value is 1&lt;&lt;1).
913      * <p><b>Used By:</b><ul>
914      * <li><code>Label</code></li>
915      * <li><code>MenuItem</code></li>
916      * <li><code>ToolItem</code></li>
917      * </ul></p>
918      */
919     public static const int SEPARATOR = 1 << 1;
920 
921     /**
922      * Style constant for toggle button behavior (value is 1&lt;&lt;1).
923      * <p><b>Used By:</b><ul>
924      * <li><code>Button</code></li>
925      * </ul></p>
926      */
927     public static const int TOGGLE = 1 << 1;
928 
929     /**
930      * Style constant for arrow button behavior (value is 1&lt;&lt;2).
931      * <p><b>Used By:</b><ul>
932      * <li><code>Button</code></li>
933      * </ul></p>
934      */
935     public static const int ARROW = 1 << 2;
936 
937     /**
938      * Style constant for push button behavior (value is 1&lt;&lt;3).
939      * <p><b>Used By:</b><ul>
940      * <li><code>Button</code></li>
941      * <li><code>MenuItem</code></li>
942      * <li><code>ToolItem</code></li>
943      * </ul></p>
944      */
945     public static const int PUSH = 1 << 3;
946 
947     /**
948      * Style constant for radio button behavior (value is 1&lt;&lt;4).
949      * <p><b>Used By:</b><ul>
950      * <li><code>Button</code></li>
951      * <li><code>MenuItem</code></li>
952      * <li><code>ToolItem</code></li>
953      * </ul></p>
954      */
955     public static const int RADIO = 1 << 4;
956 
957     /**
958      * Style constant for check box behavior (value is 1&lt;&lt;5).
959      * <p><b>Used By:</b><ul>
960      * <li><code>Button</code></li>
961      * <li><code>MenuItem</code></li>
962      * <li><code>ToolItem</code></li>
963      * <li><code>Table</code></li>
964      * <li><code>Tree</code></li>
965      * </ul></p>
966      */
967     public static const int CHECK = 1 << 5;
968 
969     /**
970      * Style constant for cascade behavior (value is 1&lt;&lt;6).
971      * <p><b>Used By:</b><ul>
972      * <li><code>MenuItem</code></li>
973      * </ul></p>
974      */
975     public static const int CASCADE = 1 << 6;
976 
977     /**
978      * Style constant for multi-selection behavior in lists
979      * and multiple line support on text fields (value is 1&lt;&lt;1).
980      * <p><b>Used By:</b><ul>
981      * <li><code>Text</code></li>
982      * <li><code>List</code></li>
983      * <li><code>FileDialog</code></li>
984      * </ul></p>
985      */
986     public static const int MULTI = 1 << 1;
987 
988     /**
989      * Style constant for single selection behavior in lists
990      * and single line support on text fields (value is 1&lt;&lt;2).
991      * <p><b>Used By:</b><ul>
992      * <li><code>Text</code></li>
993      * <li><code>List</code></li>
994      * <li><code>Table</code></li>
995      * <li><code>Tree</code></li>
996      * </ul></p>
997      */
998     public static const int SINGLE = 1 << 2;
999 
1000     /**
1001      * Style constant for read-only behavior (value is 1&lt;&lt;3).
1002      * <p><b>Used By:</b><ul>
1003      * <li><code>Combo</code></li>
1004      * <li><code>Text</code></li>
1005      * </ul></p>
1006      */
1007     public static const int READ_ONLY = 1 << 3;
1008 
1009     /**
1010      * Style constant for automatic line wrap behavior (value is 1&lt;&lt;6).
1011      * <p><b>Used By:</b><ul>
1012      * <li><code>Label</code></li>
1013      * <li><code>Text</code></li>
1014      * <li><code>ToolBar</code></li>
1015      * <li><code>Spinner</code></li>
1016      * </ul></p>
1017      */
1018     public static const int WRAP = 1 << 6;
1019 
1020     /**
1021      * Style constant for search behavior (value is 1&lt;&lt;7).
1022      * <p><b>Used By:</b><ul>
1023      * <li><code>Text</code></li>
1024      * </ul></p>
1025      *
1026      * @since 3.3
1027      */
1028     public static const int SEARCH = 1 << 7;
1029 
1030     /**
1031      * Style constant for simple (not drop down) behavior (value is 1&lt;&lt;6).
1032      * <p><b>Used By:</b><ul>
1033      * <li><code>Combo</code></li>
1034      * </ul></p>
1035      */
1036     public static const int SIMPLE = 1 << 6;
1037 
1038     /**
1039      * Style constant for password behavior (value is 1&lt;&lt;22).
1040      * <p><b>Used By:</b><ul>
1041      * <li><code>Text</code></li>
1042      * </ul></p>
1043      *
1044      * @since 3.0
1045      */
1046     public static const int PASSWORD = 1 << 22;
1047 
1048     /**
1049      * Style constant for shadow in behavior (value is 1&lt;&lt;2).
1050      * <br>Note that this is a <em>HINT</em>.
1051      * <p><b>Used By:</b><ul>
1052      * <li><code>Label</code></li>
1053      * <li><code>Group</code></li>
1054      * </ul></p>
1055      */
1056     public static const int SHADOW_IN = 1 << 2;
1057 
1058     /**
1059      * Style constant for shadow out behavior (value is 1&lt;&lt;3).
1060      * <br>Note that this is a <em>HINT</em>.
1061      * <p><b>Used By:</b><ul>
1062      * <li><code>Label</code></li>
1063      * <li><code>Group</code></li>
1064      * <li><code>ToolBar</code></li>
1065      * </ul></p>
1066      */
1067     public static const int SHADOW_OUT = 1 << 3;
1068 
1069     /**
1070      * Style constant for shadow etched in behavior (value is 1&lt;&lt;4).
1071      * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif.
1072      * <p><b>Used By:</b><ul>
1073      * <li><code>Group</code></li>
1074      * </ul></p>
1075      */
1076     public static const int SHADOW_ETCHED_IN = 1 << 4;
1077 
1078     /**
1079      * Style constant for shadow etched out behavior (value is 1&lt;&lt;6).
1080      * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif.
1081      * <p><b>Used By:</b><ul>
1082      * <li><code>Group</code></li>
1083      * </ul></p>
1084      */
1085     public static const int SHADOW_ETCHED_OUT = 1 << 6;
1086 
1087     /**
1088      * Style constant for no shadow behavior (value is 1&lt;&lt;5).
1089      * <br>Note that this is a <em>HINT</em>.
1090      * <p><b>Used By:</b><ul>
1091      * <li><code>Label</code></li>
1092      * <li><code>Group</code></li>
1093      * </ul></p>
1094      */
1095     public static const int SHADOW_NONE = 1 << 5;
1096 
1097     /**
1098      * Style constant for progress bar behavior (value is 1&lt;&lt;1).
1099      * <p><b>Used By:</b><ul>
1100      * <li><code>ProgressBar</code></li>
1101      * </ul></p>
1102      */
1103     public static const int INDETERMINATE = 1 << 1;
1104 
1105     /**
1106      * Style constant for tool window behavior (value is 1&lt;&lt;2).
1107      * <p>
1108      * A tool window is a window intended to be used as a floating toolbar.
1109      * It typically has a title bar that is shorter than a normal title bar,
1110      * and the window title is typically drawn using a smaller font.
1111      * <br>Note that this is a <em>HINT</em>.
1112      * </p><p><b>Used By:</b><ul>
1113      * <li><code>Decorations</code> and subclasses</li>
1114      * </ul></p>
1115      */
1116     public static const int TOOL = 1 << 2;
1117 
1118     /**
1119      * Style constant to ensure no trimmings are used (value is 1&lt;&lt;3).
1120      * <br>Note that this overrides all other trim styles.
1121      * <p><b>Used By:</b><ul>
1122      * <li><code>Decorations</code> and subclasses</li>
1123      * </ul></p>
1124      */
1125     public static const int NO_TRIM = 1 << 3;
1126 
1127     /**
1128      * Style constant for resize box trim (value is 1&lt;&lt;4).
1129      * <p><b>Used By:</b><ul>
1130      * <li><code>Decorations</code> and subclasses</li>
1131      * <li><code>Tracker</code></li>
1132      * </ul></p>
1133      */
1134     public static const int RESIZE = 1 << 4;
1135 
1136     /**
1137      * Style constant for title area trim (value is 1&lt;&lt;5).
1138      * <p><b>Used By:</b><ul>
1139      * <li><code>Decorations</code> and subclasses</li>
1140      * </ul></p>
1141      */
1142     public static const int TITLE = 1 << 5;
1143 
1144     /**
1145      * Style constant for close box trim (value is 1&lt;&lt;6,
1146      * since we do not distinguish between CLOSE style and MENU style).
1147      * <p><b>Used By:</b><ul>
1148      * <li><code>Decorations</code> and subclasses</li>
1149      * </ul></p>
1150      */
1151     public static const int CLOSE = 1 << 6;
1152 
1153     /**
1154      * Style constant for shell menu trim (value is 1&lt;&lt;6,
1155      * since we do not distinguish between CLOSE style and MENU style).
1156      * <p><b>Used By:</b><ul>
1157      * <li><code>Decorations</code> and subclasses</li>
1158      * </ul></p>
1159      */
1160     public static const int MENU = CLOSE;
1161 
1162     /**
1163      * Style constant for minimize box trim (value is 1&lt;&lt;7).
1164      * <p><b>Used By:</b><ul>
1165      * <li><code>Decorations</code> and subclasses</li>
1166      * </ul></p>
1167      */
1168     public static const int MIN = 1 << 7;
1169 
1170     /**
1171      * Style constant for maximize box trim (value is 1&lt;&lt;10).
1172      * <p><b>Used By:</b><ul>
1173      * <li><code>Decorations</code> and subclasses</li>
1174      * </ul></p>
1175      */
1176     public static const int MAX = 1 << 10;
1177 
1178     /**
1179      * Style constant for horizontal scrollbar behavior (value is 1&lt;&lt;8).
1180      * <p><b>Used By:</b><ul>
1181      * <li><code>Scrollable</code> and subclasses</li>
1182      * </ul></p>
1183      */
1184     public static const int H_SCROLL = 1 << 8;
1185 
1186     /**
1187      * Style constant for vertical scrollbar behavior (value is 1&lt;&lt;9).
1188      * <p><b>Used By:</b><ul>
1189      * <li><code>Scrollable</code> and subclasses</li>
1190      * </ul></p>
1191      */
1192     public static const int V_SCROLL = 1 << 9;
1193 
1194     /**
1195      * Style constant for no scrollbar behavior (value is 1&lt;&lt;4).
1196      * <p>
1197      * When neither H_SCROLL or V_SCROLL are specified, controls
1198      * are free to create the default scroll bars for the control.
1199      * Using NO_SCROLL overrides the default and forces the control
1200      * to have no scroll bars.
1201      *
1202      * <b>Used By:</b><ul>
1203      * <li><code>Tree</code></li>
1204      * <li><code>Table</code></li>
1205      * </ul></p>
1206      *
1207      * @since 3.4
1208      */
1209     public static const int NO_SCROLL = 1 << 4;
1210 
1211     /**
1212      * Style constant for bordered behavior (value is 1&lt;&lt;11).
1213      * <br>Note that this is a <em>HINT</em>.
1214      * <p><b>Used By:</b><ul>
1215      * <li><code>Control</code> and subclasses</li>
1216      * </ul></p>
1217      */
1218     public static const int BORDER = 1 << 11;
1219 
1220     /**
1221      * Style constant indicating that the window manager should clip
1222      * a widget's children with respect to its viewable area. (value is 1&lt;&lt;12).
1223      * <br>Note that this is a <em>HINT</em>.
1224      * <p><b>Used By:</b><ul>
1225      * <li><code>Control</code> and subclasses</li>
1226      * </ul></p>
1227      */
1228     public static const int CLIP_CHILDREN = 1 << 12;
1229 
1230     /**
1231      * Style constant indicating that the window manager should clip
1232      * a widget's siblings with respect to its viewable area. (value is 1&lt;&lt;13).
1233      * <br>Note that this is a <em>HINT</em>.
1234      * <p><b>Used By:</b><ul>
1235      * <li><code>Control</code> and subclasses</li>
1236      * </ul></p>
1237      */
1238     public static const int CLIP_SIBLINGS = 1 << 13;
1239 
1240     /**
1241      * Style constant for always on top behavior (value is 1&lt;&lt;14).
1242      * <br>Note that this is a <em>HINT</em>.
1243      * <p><b>Used By:</b><ul>
1244      * <li><code>Shell</code> and subclasses</li>
1245      * </ul></p>
1246      */
1247     public static const int ON_TOP = 1 << 14;
1248 
1249     /**
1250      * Trim style convenience constant for the most common top level shell appearance
1251      * (value is CLOSE|TITLE|MIN|MAX|RESIZE).
1252      * <p><b>Used By:</b><ul>
1253      * <li><code>Shell</code></li>
1254      * </ul></p>
1255      */
1256     public static const int SHELL_TRIM = CLOSE | TITLE | MIN | MAX | RESIZE;
1257 
1258     /**
1259      * Trim style convenience constant for the most common dialog shell appearance
1260      * (value is CLOSE|TITLE|BORDER).
1261      * <p><b>Used By:</b><ul>
1262      * <li><code>Shell</code></li>
1263      * </ul></p>
1264      */
1265     public static const int DIALOG_TRIM = TITLE | CLOSE | BORDER;
1266 
1267     /**
1268      * Style constant for modeless behavior (value is 0).
1269      * <br>Note that this is a <em>HINT</em>.
1270      * <p><b>Used By:</b><ul>
1271      * <li><code>Dialog</code></li>
1272      * <li><code>Shell</code></li>
1273      * </ul></p>
1274      */
1275     public static const int MODELESS = 0;
1276 
1277     /**
1278      * Style constant for primary modal behavior (value is 1&lt;&lt;15).
1279      * <br>Note that this is a <em>HINT</em>.
1280      * <p><b>Used By:</b><ul>
1281      * <li><code>Dialog</code></li>
1282      * <li><code>Shell</code></li>
1283      * </ul></p>
1284      */
1285     public static const int PRIMARY_MODAL = 1 << 15;
1286 
1287     /**
1288      * Style constant for application modal behavior (value is 1&lt;&lt;16).
1289      * <br>Note that this is a <em>HINT</em>.
1290      * <p><b>Used By:</b><ul>
1291      * <li><code>Dialog</code></li>
1292      * <li><code>Shell</code></li>
1293      * </ul></p>
1294      */
1295     public static const int APPLICATION_MODAL = 1 << 16;
1296 
1297     /**
1298      * Style constant for system modal behavior (value is 1&lt;&lt;17).
1299      * <br>Note that this is a <em>HINT</em>.
1300      * <p><b>Used By:</b><ul>
1301      * <li><code>Dialog</code></li>
1302      * <li><code>Shell</code></li>
1303      * </ul></p>
1304      */
1305     public static const int SYSTEM_MODAL = 1 << 17;
1306 
1307     /**
1308      * Style constant for selection hiding behavior when the widget loses focus (value is 1&lt;&lt;15).
1309      * <br>Note that this is a <em>HINT</em>.
1310      * <p><b>Used By:</b><ul>
1311      * <li><code>Table</code></li>
1312      * </ul></p>
1313      */
1314     public static const int HIDE_SELECTION = 1 << 15;
1315 
1316     /**
1317      * Style constant for full row selection behavior and
1318      * selection constant indicating that a full line should be
1319      * drawn. (value is 1&lt;&lt;16).
1320      * <br>Note that for some widgets this is a <em>HINT</em>.
1321      * <p><b>Used By:</b><ul>
1322      * <li><code>Table</code></li>
1323      * <li><code>Tree</code></li>
1324      * <li><code>StyledText</code></li>
1325      * <li><code>TextLayout</code></li>
1326      * </ul></p>
1327      */
1328     public static const int FULL_SELECTION = 1 << 16;
1329 
1330     /**
1331      * Style constant for flat appearance. (value is 1&lt;&lt;23).
1332      * <br>Note that this is a <em>HINT</em>.
1333      * <p><b>Used By:</b><ul>
1334      * <li><code>Button</code></li>
1335      * <li><code>ToolBar</code></li>
1336      * </ul></p>
1337      */
1338     public static const int FLAT = 1 << 23;
1339 
1340     /**
1341      * Style constant for smooth appearance. (value is 1&lt;&lt;16).
1342      * <br>Note that this is a <em>HINT</em>.
1343      * <p><b>Used By:</b><ul>
1344      * <li><code>ProgressBar</code></li>
1345      * <li><code>Sash</code></li>
1346      * </ul></p>
1347      */
1348     public static const int SMOOTH = 1 << 16;
1349 
1350     /**
1351      * Style constant for no background behavior (value is 1&lt;&lt;18).
1352      * <p>
1353      * By default, before a widget paints, the client area is filled with the current background.
1354      * When this style is specified, the background is not filled, and the application is responsible
1355      * for filling every pixel of the client area.
1356      * This style might be used as an alternative to "double-buffering" in order to reduce flicker.
1357      * This style does not mean "transparent" - widgets that are obscured will not draw through.
1358      * </p><p><b>Used By:</b><ul>
1359      * <li><code>Composite</code></li>
1360      * </ul></p>
1361      */
1362     public static const int NO_BACKGROUND = 1 << 18;
1363 
1364     /**
1365      * Style constant for no focus from the mouse behavior (value is 1&lt;&lt;19).
1366      * <p>
1367      * Normally, when the user clicks on a control, focus is assigned to that
1368      * control, providing the control has no children.  Some controls, such as
1369      * tool bars and sashes, don't normally take focus when the mouse is clicked
1370      * or accept focus when assigned from within the program.  This style allows
1371      * Composites to implement "no focus" mouse behavior.
1372      *
1373      * <br>Note that this is a <em>HINT</em>.
1374      * </p>
1375      * <p><b>Used By:</b><ul>
1376      * <li><code>Composite</code></li>
1377      * </ul></p>
1378      */
1379     public static const int NO_FOCUS = 1 << 19;
1380 
1381     /**
1382      * Style constant for no redraw on resize behavior (value is 1&lt;&lt;20).
1383      * <p>
1384      * This style stops the entire client area from being invalidated when the size
1385      * of the Canvas changes. Specifically, when the size of the Canvas gets smaller,
1386      * the SWT.Paint event is not sent. When it gets bigger, an SWT.Paint event is
1387      * sent with a GC clipped to only the new areas to be painted. Without this
1388      * style, the entire client area will be repainted.
1389      *
1390      * <br>Note that this is a <em>HINT</em>.
1391      * </p><p><b>Used By:</b><ul>
1392      * <li><code>Composite</code></li>
1393      * </ul></p>
1394      */
1395     public static const int NO_REDRAW_RESIZE = 1 << 20;
1396 
1397     /**
1398      * Style constant for no paint event merging behavior (value is 1&lt;&lt;21).
1399      *
1400      * <br>Note that this is a <em>HINT</em>.
1401      * <p><b>Used By:</b><ul>
1402      * <li><code>Composite</code></li>
1403      * </ul></p>
1404      */
1405     public static const int NO_MERGE_PAINTS = 1 << 21;
1406 
1407     /**
1408      * Style constant for preventing child radio group behavior (value is 1&lt;&lt;22).
1409      * <p><b>Used By:</b><ul>
1410      * <li><code>Composite</code></li>
1411      * </ul></p>
1412      */
1413     public static const int NO_RADIO_GROUP = 1 << 22;
1414 
1415     /**
1416      * Style constant for left to right orientation (value is 1&lt;&lt;25).
1417      * <p>
1418      * When orientation is not explicitly specified, orientation is
1419      * inherited.  This means that children will be assigned the
1420      * orientation of their parent.  To override this behavior and
1421      * force an orientation for a child, explicitly set the orientation
1422      * of the child when that child is created.
1423      * <br>Note that this is a <em>HINT</em>.
1424      * </p>
1425      * <p><b>Used By:</b><ul>
1426      * <li><code>Control</code></li>
1427      * <li><code>Menu</code></li>
1428      * <li><code>GC</code></li>
1429      * </ul></p>
1430      *
1431      * @since 2.1.2
1432      */
1433     public static const int LEFT_TO_RIGHT = 1 << 25;
1434 
1435     /**
1436      * Style constant for right to left orientation (value is 1&lt;&lt;26).
1437      * <p>
1438      * When orientation is not explicitly specified, orientation is
1439      * inherited.  This means that children will be assigned the
1440      * orientation of their parent.  To override this behavior and
1441      * force an orientation for a child, explicitly set the orientation
1442      * of the child when that child is created.
1443      * <br>Note that this is a <em>HINT</em>.
1444      * </p>
1445      * <p><b>Used By:</b><ul>
1446      * <li><code>Control</code></li>
1447      * <li><code>Menu</code></li>
1448      * <li><code>GC</code></li>
1449      * </ul></p>
1450      *
1451      * @since 2.1.2
1452      */
1453     public static const int RIGHT_TO_LEFT = 1 << 26;
1454 
1455     /**
1456      * Style constant to indicate coordinate mirroring (value is 1&lt;&lt;27).
1457      * <p><b>Used By:</b><ul>
1458      * <li><code>Control</code></li>
1459      * <li><code>Menu</code></li>
1460      * </ul></p>
1461      *
1462      * @since 2.1.2
1463      */
1464     public static const int MIRRORED = 1 << 27;
1465 
1466     /**
1467      * Style constant to allow embedding (value is 1&lt;&lt;24).
1468      * <p><b>Used By:</b><ul>
1469      * <li><code>Composite</code></li>
1470      * </ul></p>
1471      *
1472      * @since 3.0
1473      */
1474     public static const int EMBEDDED = 1 << 24;
1475 
1476     /**
1477      * Style constant to allow virtual data (value is 1&lt;&lt;28).
1478      * <p><b>Used By:</b><ul>
1479      * <li><code>Table</code></li>
1480      * <li><code>Tree</code></li>
1481      * </ul></p>
1482      *
1483      * @since 3.0
1484      */
1485     public static const int VIRTUAL = 1 << 28;
1486 
1487     /**
1488      * Style constant to indicate double buffering (value is 1&lt;&lt;29).
1489      * <p><b>Used By:</b><ul>
1490      * <li><code>Control</code></li>
1491      * </ul></p>
1492      *
1493      * @since 3.1
1494      */
1495     public static const int DOUBLE_BUFFERED = 1 << 29;
1496 
1497     /**
1498      * Style constant for transparent behavior (value is 1&lt;&lt;30).
1499      * <p>
1500      * By default, before a widget paints, the client area is filled with the current background.
1501      * When this style is specified, the background is not filled and widgets that are obscured
1502      * will draw through.
1503      * </p><p><b>Used By:</b><ul>
1504      * <li><code>Composite</code></li>
1505      * </ul></p>
1506      *
1507      * @since 3.4
1508      *
1509      * WARNING: THIS API IS UNDER CONSTRUCTION AND SHOULD NOT BE USED
1510      */
1511     public static const int TRANSPARENT = 1 << 30;
1512 
1513     /**
1514      * Style constant for align up behavior (value is 1&lt;&lt;7,
1515      * since align UP and align TOP are considered the same).
1516      * <p><b>Used By:</b><ul>
1517      * <li><code>Button</code> with <code>ARROW</code> style</li>
1518      * <li><code>Tracker</code></li>
1519      * <li><code>Table</code></li>
1520      * <li><code>Tree</code></li>
1521      * </ul></p>
1522      */
1523     public static const int UP = 1 << 7;
1524 
1525     /**
1526      * Style constant to indicate single underline (value is 0).
1527      * <p><b>Used By:</b><ul>
1528      * <li><code>TextStyle</code></li>
1529      * </ul></p>
1530      *
1531      * @since 3.4
1532      */
1533     public static const int UNDERLINE_SINGLE = 0;
1534 
1535     /**
1536      * Style constant to indicate double underline (value is 1).
1537      * <p><b>Used By:</b><ul>
1538      * <li><code>TextStyle</code></li>
1539      * </ul></p>
1540      *
1541      * @since 3.4
1542      */
1543     public static const int UNDERLINE_DOUBLE = 1;
1544 
1545     /**
1546      * Style constant to indicate error underline (value is 2).
1547      * <p><b>Used By:</b><ul>
1548      * <li><code>TextStyle</code></li>
1549      * </ul></p>
1550      *
1551      * @since 3.4
1552      */
1553     public static const int UNDERLINE_ERROR = 2;
1554 
1555     /**
1556      * Style constant to indicate squiggle underline (value is 3).
1557      * <p><b>Used By:</b><ul>
1558      * <li><code>TextStyle</code></li>
1559      * </ul></p>
1560      *
1561      * @since 3.4
1562      */
1563     public static const int UNDERLINE_SQUIGGLE = 3;
1564 
1565     /**
1566      * Style constant to indicate solid border (value is 1).
1567      * <p><b>Used By:</b><ul>
1568      * <li><code>TextStyle</code></li>
1569      * </ul></p>
1570      *
1571      * @since 3.4
1572      */
1573     public static const int BORDER_SOLID = 1;
1574 
1575     /**
1576      * Style constant to indicate dashed border (value is 2).
1577      * <p><b>Used By:</b><ul>
1578      * <li><code>TextStyle</code></li>
1579      * </ul></p>
1580      *
1581      * @since 3.4
1582      */
1583     public static const int BORDER_DASH = 2;
1584 
1585     /**
1586      * Style constant to indicate dotted border (value is 4).
1587      * <p><b>Used By:</b><ul>
1588      * <li><code>TextStyle</code></li>
1589      * </ul></p>
1590      *
1591      * @since 3.4
1592      */
1593     public static const int BORDER_DOT = 4;
1594 
1595     /**
1596      * Style constant for align top behavior (value is 1&lt;&lt;7,
1597      * since align UP and align TOP are considered the same).
1598      * <p><b>Used By:</b><ul>
1599      * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1600      * </ul></p>
1601      */
1602     public static const int TOP = UP;
1603 
1604     /**
1605      * Style constant for align down behavior (value is 1&lt;&lt;10,
1606      * since align DOWN and align BOTTOM are considered the same).
1607      * <p><b>Used By:</b><ul>
1608      * <li><code>Button</code> with <code>ARROW</code> style</li>
1609      * <li><code>Tracker</code></li>
1610      * <li><code>Table</code></li>
1611      * <li><code>Tree</code></li>
1612      * </ul></p>
1613      */
1614     public static const int DOWN               = 1 << 10;
1615 
1616     /**
1617      * Style constant for align bottom behavior (value is 1&lt;&lt;10,
1618      * since align DOWN and align BOTTOM are considered the same).
1619      * <p><b>Used By:</b><ul>
1620      * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1621      * </ul></p>
1622      */
1623     public static const int BOTTOM             = DOWN;
1624 
1625     /**
1626      * Style constant for leading alignment (value is 1&lt;&lt;14).
1627      * <p><b>Used By:</b><ul>
1628      * <li><code>Button</code></li>
1629      * <li><code>Label</code></li>
1630      * <li><code>TableColumn</code></li>
1631      * <li><code>Tracker</code></li>
1632      * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1633      * </ul></p>
1634      *
1635      * @since 2.1.2
1636      */
1637     public static const int LEAD               = 1 << 14;
1638 
1639     /**
1640      * Style constant for align left behavior (value is 1&lt;&lt;14).
1641      * This is a synonym for LEAD (value is 1&lt;&lt;14).  Newer
1642      * applications should use LEAD instead of LEFT to make code more
1643      * understandable on right-to-left platforms.
1644      */
1645     public static const int LEFT               = LEAD;
1646 
1647     /**
1648      * Style constant for trailing alignment (value is 1&lt;&lt;17).
1649      * <p><b>Used By:</b><ul>
1650      * <li><code>Button</code></li>
1651      * <li><code>Label</code></li>
1652      * <li><code>TableColumn</code></li>
1653      * <li><code>Tracker</code></li>
1654      * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1655      * </ul></p>
1656      *
1657      * @since 2.1.2
1658      */
1659     public static const int TRAIL              = 1 << 17;
1660 
1661     /**
1662      * Style constant for align right behavior (value is 1&lt;&lt;17).
1663      * This is a synonym for TRAIL (value is 1&lt;&lt;17).  Newer
1664      * applications should use TRAIL instead of RIGHT to make code more
1665      * understandable on right-to-left platforms.
1666      */
1667     public static const int RIGHT              = TRAIL;
1668 
1669     /**
1670      * Style constant for align center behavior (value is 1&lt;&lt;24).
1671      * <p><b>Used By:</b><ul>
1672      * <li><code>Button</code></li>
1673      * <li><code>Label</code></li>
1674      * <li><code>TableColumn</code></li>
1675      * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1676      * </ul></p>
1677      */
1678     public static const int CENTER = 1 << 24;
1679 
1680     /**
1681      * Style constant for horizontal alignment or orientation behavior (value is 1&lt;&lt;8).
1682      * <p><b>Used By:</b><ul>
1683      * <li><code>Label</code></li>
1684      * <li><code>ProgressBar</code></li>
1685      * <li><code>Sash</code></li>
1686      * <li><code>Scale</code></li>
1687      * <li><code>ScrollBar</code></li>
1688      * <li><code>Slider</code></li>
1689      * <li><code>ToolBar</code></li>
1690      * <li><code>FillLayout</code> type</li>
1691      * <li><code>RowLayout</code> type</li>
1692      * </ul></p>
1693      */
1694     public static const int HORIZONTAL = 1 << 8;
1695 
1696     /**
1697      * Style constant for vertical alignment or orientation behavior (value is 1&lt;&lt;9).
1698      * <p><b>Used By:</b><ul>
1699      * <li><code>Label</code></li>
1700      * <li><code>ProgressBar</code></li>
1701      * <li><code>Sash</code></li>
1702      * <li><code>Scale</code></li>
1703      * <li><code>ScrollBar</code></li>
1704      * <li><code>Slider</code></li>
1705      * <li><code>ToolBar</code></li>
1706      * <li><code>CoolBar</code></li>
1707      * <li><code>FillLayout</code> type</li>
1708      * <li><code>RowLayout</code> type</li>
1709      * </ul></p>
1710      */
1711     public static const int VERTICAL = 1 << 9;
1712 
1713     /**
1714      * Style constant for date display (value is 1&lt;&lt;5).
1715      * <p><b>Used By:</b><ul>
1716      * <li><code>DateTime</code></li>
1717      * </ul></p>
1718      *
1719      * @since 3.3
1720      */
1721     public static const int DATE = 1 << 5;
1722 
1723     /**
1724      * Style constant for time display (value is 1&lt;&lt;7).
1725      * <p><b>Used By:</b><ul>
1726      * <li><code>DateTime</code></li>
1727      * </ul></p>
1728      *
1729      * @since 3.3
1730      */
1731     public static const int TIME = 1 << 7;
1732 
1733     /**
1734      * Style constant for calendar display (value is 1&lt;&lt;10).
1735      * <p><b>Used By:</b><ul>
1736      * <li><code>DateTime</code></li>
1737      * </ul></p>
1738      *
1739      * @since 3.3
1740      */
1741     public static const int CALENDAR = 1 << 10;
1742 
1743     /**
1744      * Style constant for short date/time format (value is 1&lt;&lt;15).
1745      * <p>
1746      * A short date displays the month and year.
1747      * A short time displays hours and minutes.
1748      * <br>Note that this is a <em>HINT</em>.
1749      * </p>
1750      * <p><b>Used By:</b><ul>
1751      * <li><code>DateTime</code></li>
1752      * </ul></p>
1753      *
1754      * @since 3.3
1755      */
1756     public static const int SHORT = 1 << 15;
1757 
1758     /**
1759      * Style constant for medium date/time format (value is 1&lt;&lt;16).
1760      * <p>
1761      * A medium date displays the day, month and year.
1762      * A medium time displays hours, minutes, and seconds.
1763      * <br>Note that this is a <em>HINT</em>.
1764      * </p>
1765      * <p><b>Used By:</b><ul>
1766      * <li><code>DateTime</code></li>
1767      * </ul></p>
1768      *
1769      * @since 3.3
1770      */
1771     public static const int MEDIUM = 1 << 16;
1772 
1773     /**
1774      * Style constant for long date/time format (value is 1&lt;&lt;28).
1775      * <p>
1776      * A long date displays the day, month and year.
1777      * A long time displays hours, minutes, and seconds.
1778      * The day and month names may be displayed.
1779      * <br>Note that this is a <em>HINT</em>.
1780      * </p>
1781      * <p><b>Used By:</b><ul>
1782      * <li><code>DateTime</code></li>
1783      * </ul></p>
1784      *
1785      * @since 3.3
1786      */
1787     public static const int LONG = 1 << 28;
1788 
1789     /**
1790      * Style constant specifying that a Browser should use a Mozilla GRE
1791      * for rendering its content (value is 1&lt;&lt;15).
1792      * <p>
1793      * <p><b>Used By:</b><ul>
1794      * <li><code>Browser</code></li>
1795      * </ul></p>
1796      *
1797      * @since 3.3
1798      */
1799     public static const int MOZILLA = 1 << 15;
1800 
1801     /**
1802      * Style constant for balloon behavior (value is 1&lt;&lt;12).
1803      * <p><b>Used By:</b><ul>
1804      * <li><code>ToolTip</code></li>
1805      * </ul></p>
1806      *
1807      * @since 3.2
1808      */
1809     public static const int BALLOON = 1 << 12;
1810 
1811     /**
1812      * Style constant for vertical alignment or orientation behavior (value is 1).
1813      * <p><b>Used By:</b><ul>
1814      * <li><code>GridLayout</code> type</li>
1815      * </ul></p>
1816      */
1817     public static const int BEGINNING = 1;
1818 
1819     /**
1820      * Style constant for vertical alignment or orientation behavior (value is 4).
1821      * <p><b>Used By:</b><ul>
1822      * <li><code>GridLayout</code> type</li>
1823      * </ul></p>
1824      */
1825     public static const int FILL = 4;
1826 
1827     /**
1828      * Input Method Editor style constant for double byte
1829      * input behavior (value is 1&lt;&lt;1).
1830      */
1831     public static const int DBCS = 1 << 1;
1832 
1833     /**
1834      * Input Method Editor style constant for alpha
1835      * input behavior (value is 1&lt;&lt;2).
1836      */
1837     public static const int ALPHA = 1 << 2;
1838 
1839     /**
1840      * Input Method Editor style constant for native
1841      * input behavior (value is 1&lt;&lt;3).
1842      */
1843     public static const int NATIVE = 1 << 3;
1844 
1845     /**
1846      * Input Method Editor style constant for phonetic
1847      * input behavior (value is 1&lt;&lt;4).
1848      */
1849     public static const int PHONETIC = 1 << 4;
1850 
1851     /**
1852      * Input Method Editor style constant for romanicized
1853      * input behavior (value is 1&lt;&lt;5).
1854      */
1855     public static const int ROMAN = 1 << 5;
1856 
1857     /**
1858      * ASCII character convenience constant for the backspace character
1859      * (value is the <code>char</code> '\b').
1860      */
1861     public static const char BS = '\b';
1862 
1863     /**
1864      * ASCII character convenience constant for the carriage return character
1865      * (value is the <code>char</code> '\r').
1866      */
1867     public static const char CR = '\r';
1868 
1869     /**
1870      * ASCII character convenience constant for the delete character
1871      * (value is the <code>char</code> with value 127).
1872      */
1873     public static const char DEL = 0x7F;
1874 
1875     /**
1876      * ASCII character convenience constant for the escape character
1877      * (value is the <code>char</code> with value 27).
1878      */
1879     public static const char ESC = 0x1B;
1880 
1881     /**
1882      * ASCII character convenience constant for the line feed character
1883      * (value is the <code>char</code> '\n').
1884      */
1885     public static const char LF = '\n';
1886 
1887     /**
1888      * ASCII character convenience constant for the tab character
1889      * (value is the <code>char</code> '\t').
1890      *
1891      * @since 2.1
1892      */
1893     public static const char TAB = '\t';
1894 
1895     /**
1896      * keyboard and/or mouse event mask indicating that the ALT key
1897      * was pushed on the keyboard when the event was generated
1898      * (value is 1&lt;&lt;16).
1899      */
1900     public static const int ALT = 1 << 16;
1901 
1902     /**
1903      * Keyboard and/or mouse event mask indicating that the SHIFT key
1904      * was pushed on the keyboard when the event was generated
1905      * (value is 1&lt;&lt;17).
1906      */
1907     public static const int SHIFT = 1 << 17;
1908 
1909     /**
1910      * Keyboard and/or mouse event mask indicating that the CTRL key
1911      * was pushed on the keyboard when the event was generated
1912      * (value is 1&lt;&lt;18).
1913      */
1914     public static const int CTRL = 1 << 18;
1915 
1916     /**
1917      * Keyboard and/or mouse event mask indicating that the CTRL key
1918      * was pushed on the keyboard when the event was generated. This
1919      * is a synonym for CTRL (value is 1&lt;&lt;18).
1920      */
1921     public static const int CONTROL = CTRL;
1922 
1923     /**
1924      * Keyboard and/or mouse event mask indicating that the COMMAND key
1925      * was pushed on the keyboard when the event was generated
1926      * (value is 1&lt;&lt;22).
1927      *
1928      * @since 2.1
1929      */
1930     public static const int COMMAND = 1 << 22;
1931 
1932     /**
1933      * Keyboard and/or mouse event mask indicating all possible
1934      * keyboard modifiers.
1935      *
1936      * To allow for the future, this mask  is intended to be used in
1937      * place of code that references  each individual keyboard mask.
1938      *  For example, the following expression will determine whether
1939      * any modifier is pressed and will continue to work as new modifier
1940      * masks are added.
1941      *
1942      * <code>(stateMask & SWT.MODIFIER_MASK) != 0</code>.
1943      *
1944      * @since 2.1
1945      */
1946     public static const int MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND;
1947 
1948     /**
1949      * Keyboard and/or mouse event mask indicating that mouse button one
1950      * was pushed when the event was generated. (value is 1&lt;&lt;19).
1951      */
1952     public static const int BUTTON1 = 1 << 19;
1953 
1954     /**
1955      * Keyboard and/or mouse event mask indicating that mouse button two
1956      * was pushed when the event was generated. (value is 1&lt;&lt;20).
1957      */
1958     public static const int BUTTON2 = 1 << 20;
1959 
1960     /**
1961      * Keyboard and/or mouse event mask indicating that mouse button three
1962      * was pushed when the event was generated. (value is 1&lt;&lt;21).
1963      */
1964     public static const int BUTTON3 = 1 << 21;
1965 
1966     /**
1967      * Keyboard and/or mouse event mask indicating that mouse button four
1968      * was pushed when the event was generated. (value is 1&lt;&lt;23).
1969      *
1970      * @since 3.1
1971      */
1972     public static const int BUTTON4 = 1 << 23;
1973 
1974     /**
1975      * Keyboard and/or mouse event mask indicating that mouse button five
1976      * was pushed when the event was generated. (value is 1&lt;&lt;25).
1977      *
1978      * @since 3.1
1979      */
1980     public static const int BUTTON5 = 1 << 25;
1981 
1982     /**
1983      * Keyboard and/or mouse event mask indicating all possible
1984      * mouse buttons.
1985      *
1986      * To allow for the future, this mask  is intended to be used
1987      * in place of code that references each individual button mask.
1988      * For example, the following expression will determine whether
1989      * any button is pressed and will continue to work as new button
1990      * masks are added.
1991      *
1992      * <code>(stateMask & SWT.BUTTON_MASK) != 0</code>.
1993      *
1994      * @since 2.1
1995      */
1996     public static const int BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5;
1997 
1998     /**
1999      * Keyboard and/or mouse event mask indicating that the MOD1 key
2000      * was pushed on the keyboard when the event was generated.
2001      *
2002      * This is the primary keyboard modifier for the platform.
2003      *
2004      * @since 2.1
2005      */
2006     version(CARBON){
2007         public static const int MOD1 = COMMAND;
2008     }
2009     else{
2010         public static const int MOD1 = CONTROL;
2011     }
2012 
2013     /**
2014      * Keyboard and/or mouse event mask indicating that the MOD2 key
2015      * was pushed on the keyboard when the event was generated.
2016      *
2017      * This is the secondary keyboard modifier for the platform.
2018      *
2019      * @since 2.1
2020      */
2021     version(CARBON){
2022         public static const int MOD2 = SHIFT;
2023     }
2024     else{
2025         public static const int MOD2 = SHIFT;
2026     }
2027 
2028     /**
2029      * Keyboard and/or mouse event mask indicating that the MOD3 key
2030      * was pushed on the keyboard when the event was generated.
2031      *
2032      * @since 2.1
2033      */
2034     version(CARBON){
2035         public static const int MOD3 = ALT;
2036     }
2037     else{
2038         public static const int MOD3 = ALT;
2039     }
2040 
2041     /**
2042      * Keyboard and/or mouse event mask indicating that the MOD4 key
2043      * was pushed on the keyboard when the event was generated.
2044      *
2045      * @since 2.1
2046      */
2047     version(CARBON){
2048         public static const int MOD4 = CONTROL;
2049     }
2050     else{
2051         public static const int MOD4 = 0;
2052     }
2053 
2054     /**
2055      * Constants to indicate line scrolling (value is 1).
2056      * <p><b>Used By:</b><ul>
2057      * <li><code>Control</code></li>
2058      * </ul></p>
2059      *
2060      * @since 3.1
2061      */
2062     public static const int SCROLL_LINE = 1;
2063 
2064     /**
2065      * Constants to indicate page scrolling (value is 2).
2066      * <p><b>Used By:</b><ul>
2067      * <li><code>Control</code></li>
2068      * </ul></p>
2069      *
2070      * @since 3.1
2071      */
2072     public static const int SCROLL_PAGE = 2;
2073 
2074     /**
2075      * Accelerator constant used to differentiate a key code from a
2076      * unicode character.
2077      *
2078      * If this bit is set, then the key stroke
2079      * portion of an accelerator represents a key code.  If this bit
2080      * is not set, then the key stroke portion of an accelerator is
2081      * a unicode character.
2082      *
2083      * The following expression is false:
2084      *
2085      * <code>((SWT.MOD1 | SWT.MOD2 | 'T') & SWT.KEYCODE_BIT) != 0</code>.
2086      *
2087      * The following expression is true:
2088      *
2089      * <code>((SWT.MOD3 | SWT.F2) & SWT.KEYCODE_BIT) != 0</code>.
2090      *
2091      * (value is (1&lt;&lt;24))
2092      *
2093      * @since 2.1
2094      */
2095     public static const int KEYCODE_BIT = (1 << 24);
2096 
2097     /**
2098      * Accelerator constant used to extract the key stroke portion of
2099      * an accelerator.
2100      *
2101      * The key stroke may be a key code or a unicode
2102      * value.  If the key stroke is a key code <code>KEYCODE_BIT</code>
2103      * will be set.
2104      *
2105      * @since 2.1
2106      */
2107     public static const int KEY_MASK = KEYCODE_BIT + 0xFFFF;
2108 
2109     /**
2110      * Keyboard event constant representing the UP ARROW key
2111      * (value is (1&lt;&lt;24)+1).
2112      */
2113     public static const int ARROW_UP = KEYCODE_BIT + 1;
2114 
2115     /**
2116      * Keyboard event constant representing the DOWN ARROW key
2117      * (value is (1&lt;&lt;24)+2).
2118      */
2119     public static const int ARROW_DOWN = KEYCODE_BIT + 2;
2120 
2121     /**
2122      * Keyboard event constant representing the LEFT ARROW key
2123      * (value is (1&lt;&lt;24)+3).
2124      */
2125     public static const int ARROW_LEFT = KEYCODE_BIT + 3;
2126 
2127     /**
2128      * Keyboard event constant representing the RIGHT ARROW key
2129      * (value is (1&lt;&lt;24)+4).
2130      */
2131     public static const int ARROW_RIGHT = KEYCODE_BIT + 4;
2132 
2133     /**
2134      * Keyboard event constant representing the PAGE UP key
2135      * (value is (1&lt;&lt;24)+5).
2136      */
2137     public static const int PAGE_UP = KEYCODE_BIT + 5;
2138 
2139     /**
2140      * Keyboard event constant representing the PAGE DOWN key
2141      * (value is (1&lt;&lt;24)+6).
2142      */
2143     public static const int PAGE_DOWN = KEYCODE_BIT + 6;
2144 
2145     /**
2146      * Keyboard event constant representing the HOME key
2147      * (value is (1&lt;&lt;24)+7).
2148      */
2149     public static const int HOME = KEYCODE_BIT + 7;
2150 
2151     /**
2152      * Keyboard event constant representing the END key
2153      * (value is (1&lt;&lt;24)+8).
2154      */
2155     public static const int END = KEYCODE_BIT + 8;
2156 
2157     /**
2158      * Keyboard event constant representing the INSERT key
2159      * (value is (1&lt;&lt;24)+9).
2160      */
2161     public static const int INSERT = KEYCODE_BIT + 9;
2162 
2163     /**
2164      * Keyboard event constant representing the F1 key
2165      * (value is (1&lt;&lt;24)+10).
2166      */
2167     public static const int F1 = KEYCODE_BIT + 10;
2168 
2169     /**
2170      * Keyboard event constant representing the F2 key
2171      * (value is (1&lt;&lt;24)+11).
2172      */
2173     public static const int F2 = KEYCODE_BIT + 11;
2174 
2175     /**
2176      * Keyboard event constant representing the F3 key
2177      * (value is (1&lt;&lt;24)+12).
2178      */
2179     public static const int F3 = KEYCODE_BIT + 12;
2180 
2181     /**
2182      * Keyboard event constant representing the F4 key
2183      * (value is (1&lt;&lt;24)+13).
2184      */
2185     public static const int F4 = KEYCODE_BIT + 13;
2186 
2187     /**
2188      * Keyboard event constant representing the F5 key
2189      * (value is (1&lt;&lt;24)+14).
2190      */
2191     public static const int F5 = KEYCODE_BIT + 14;
2192 
2193     /**
2194      * Keyboard event constant representing the F6 key
2195      * (value is (1&lt;&lt;24)+15).
2196      */
2197     public static const int F6 = KEYCODE_BIT + 15;
2198 
2199     /**
2200      * Keyboard event constant representing the F7 key
2201      * (value is (1&lt;&lt;24)+16).
2202      */
2203     public static const int F7 = KEYCODE_BIT + 16;
2204 
2205     /**
2206      * Keyboard event constant representing the F8 key
2207      * (value is (1&lt;&lt;24)+17).
2208      */
2209     public static const int F8 = KEYCODE_BIT + 17;
2210 
2211     /**
2212      * Keyboard event constant representing the F9 key
2213      * (value is (1&lt;&lt;24)+18).
2214      */
2215     public static const int F9 = KEYCODE_BIT + 18;
2216 
2217     /**
2218      * Keyboard event constant representing the F10 key
2219      * (value is (1&lt;&lt;24)+19).
2220      */
2221     public static const int F10 = KEYCODE_BIT + 19;
2222 
2223     /**
2224      * Keyboard event constant representing the F11 key
2225      * (value is (1&lt;&lt;24)+20).
2226      */
2227     public static const int F11 = KEYCODE_BIT + 20;
2228 
2229     /**
2230      * Keyboard event constant representing the F12 key
2231      * (value is (1&lt;&lt;24)+21).
2232      */
2233     public static const int F12 = KEYCODE_BIT + 21;
2234 
2235     /**
2236      * Keyboard event constant representing the F13 key
2237      * (value is (1&lt;&lt;24)+22).
2238      *
2239      * @since 3.0
2240      */
2241     public static const int F13 = KEYCODE_BIT + 22;
2242 
2243     /**
2244      * Keyboard event constant representing the F14 key
2245      * (value is (1&lt;&lt;24)+23).
2246      *
2247      * @since 3.0
2248      */
2249     public static const int F14 = KEYCODE_BIT + 23;
2250 
2251     /**
2252      * Keyboard event constant representing the F15 key
2253      * (value is (1&lt;&lt;24)+24).
2254      *
2255      * @since 3.0
2256      */
2257     public static const int F15 = KEYCODE_BIT + 24;
2258 
2259     /**
2260      * Keyboard event constant representing the numeric key
2261      * pad multiply key (value is (1&lt;&lt;24)+42).
2262      *
2263      * @since 3.0
2264      */
2265     public static const int KEYPAD_MULTIPLY = KEYCODE_BIT + 42;
2266 
2267     /**
2268      * Keyboard event constant representing the numeric key
2269      * pad add key (value is (1&lt;&lt;24)+43).
2270      *
2271      * @since 3.0
2272      */
2273     public static const int KEYPAD_ADD = KEYCODE_BIT + 43;
2274 
2275     /**
2276      * Keyboard event constant representing the numeric key
2277      * pad subtract key (value is (1&lt;&lt;24)+45).
2278      *
2279      * @since 3.0
2280      */
2281     public static const int KEYPAD_SUBTRACT = KEYCODE_BIT + 45;
2282 
2283     /**
2284      * Keyboard event constant representing the numeric key
2285      * pad decimal key (value is (1&lt;&lt;24)+46).
2286      *
2287      * @since 3.0
2288      */
2289     public static const int KEYPAD_DECIMAL = KEYCODE_BIT + 46;
2290 
2291     /**
2292      * Keyboard event constant representing the numeric key
2293      * pad divide key (value is (1&lt;&lt;24)+47).
2294      *
2295      * @since 3.0
2296      */
2297     public static const int KEYPAD_DIVIDE = KEYCODE_BIT + 47;
2298 
2299     /**
2300      * Keyboard event constant representing the numeric key
2301      * pad zero key (value is (1&lt;&lt;24)+48).
2302      *
2303      * @since 3.0
2304      */
2305     public static const int KEYPAD_0 = KEYCODE_BIT + 48;
2306 
2307     /**
2308      * Keyboard event constant representing the numeric key
2309      * pad one key (value is (1&lt;&lt;24)+49).
2310      *
2311      * @since 3.0
2312      */
2313     public static const int KEYPAD_1 = KEYCODE_BIT + 49;
2314 
2315     /**
2316      * Keyboard event constant representing the numeric key
2317      * pad two key (value is (1&lt;&lt;24)+50).
2318      *
2319      * @since 3.0
2320      */
2321     public static const int KEYPAD_2 = KEYCODE_BIT + 50;
2322 
2323     /**
2324      * Keyboard event constant representing the numeric key
2325      * pad three key (value is (1&lt;&lt;24)+51).
2326      *
2327      * @since 3.0
2328      */
2329     public static const int KEYPAD_3 = KEYCODE_BIT + 51;
2330 
2331     /**
2332      * Keyboard event constant representing the numeric key
2333      * pad four key (value is (1&lt;&lt;24)+52).
2334      *
2335      * @since 3.0
2336      */
2337     public static const int KEYPAD_4 = KEYCODE_BIT + 52;
2338 
2339     /**
2340      * Keyboard event constant representing the numeric key
2341      * pad five key (value is (1&lt;&lt;24)+53).
2342      *
2343      * @since 3.0
2344      */
2345     public static const int KEYPAD_5 = KEYCODE_BIT + 53;
2346 
2347     /**
2348      * Keyboard event constant representing the numeric key
2349      * pad six key (value is (1&lt;&lt;24)+54).
2350      *
2351      * @since 3.0
2352      */
2353     public static const int KEYPAD_6 = KEYCODE_BIT + 54;
2354 
2355     /**
2356      * Keyboard event constant representing the numeric key
2357      * pad seven key (value is (1&lt;&lt;24)+55).
2358      *
2359      * @since 3.0
2360      */
2361     public static const int KEYPAD_7 = KEYCODE_BIT + 55;
2362 
2363     /**
2364      * Keyboard event constant representing the numeric key
2365      * pad eight key (value is (1&lt;&lt;24)+56).
2366      *
2367      * @since 3.0
2368      */
2369     public static const int KEYPAD_8 = KEYCODE_BIT + 56;
2370 
2371     /**
2372      * Keyboard event constant representing the numeric key
2373      * pad nine key (value is (1&lt;&lt;24)+57).
2374      *
2375      * @since 3.0
2376      */
2377     public static const int KEYPAD_9 = KEYCODE_BIT + 57;
2378 
2379     /**
2380      * Keyboard event constant representing the numeric key
2381      * pad equal key (value is (1&lt;&lt;24)+61).
2382      *
2383      * @since 3.0
2384      */
2385     public static const int KEYPAD_EQUAL = KEYCODE_BIT + 61;
2386 
2387     /**
2388      * Keyboard event constant representing the numeric key
2389      * pad enter key (value is (1&lt;&lt;24)+80).
2390      *
2391      * @since 3.0
2392      */
2393     public static const int KEYPAD_CR = KEYCODE_BIT + 80;
2394 
2395     /**
2396      * Keyboard event constant representing the help
2397      * key (value is (1&lt;&lt;24)+81).
2398      *
2399      * NOTE: The HELP key maps to the key labeled "help",
2400      * not "F1". If your keyboard does not have a HELP key,
2401      * you will never see this key press.  To listen for
2402      * help on a control, use SWT.Help.
2403      *
2404      * @since 3.0
2405      *
2406      * @see SWT#Help
2407      */
2408     public static const int HELP = KEYCODE_BIT + 81;
2409 
2410     /**
2411      * Keyboard event constant representing the caps
2412      * lock key (value is (1&lt;&lt;24)+82).
2413      *
2414      * @since 3.0
2415      */
2416     public static const int CAPS_LOCK = KEYCODE_BIT + 82;
2417 
2418     /**
2419      * Keyboard event constant representing the num
2420      * lock key (value is (1&lt;&lt;24)+83).
2421      *
2422      * @since 3.0
2423      */
2424     public static const int NUM_LOCK = KEYCODE_BIT + 83;
2425 
2426     /**
2427      * Keyboard event constant representing the scroll
2428      * lock key (value is (1&lt;&lt;24)+84).
2429      *
2430      * @since 3.0
2431      */
2432     public static const int SCROLL_LOCK = KEYCODE_BIT + 84;
2433 
2434     /**
2435      * Keyboard event constant representing the pause
2436      * key (value is (1&lt;&lt;24)+85).
2437      *
2438      * @since 3.0
2439      */
2440     public static const int PAUSE = KEYCODE_BIT + 85;
2441 
2442     /**
2443      * Keyboard event constant representing the break
2444      * key (value is (1&lt;&lt;24)+86).
2445      *
2446      * @since 3.0
2447      */
2448     public static const int BREAK = KEYCODE_BIT + 86;
2449 
2450     /**
2451      * Keyboard event constant representing the print screen
2452      * key (value is (1&lt;&lt;24)+87).
2453      *
2454      * @since 3.0
2455      */
2456     public static const int PRINT_SCREEN = KEYCODE_BIT + 87;
2457 
2458     /**
2459      * The <code>MessageBox</code> style constant for error icon
2460      * behavior (value is 1).
2461      */
2462     public static const int ICON_ERROR = 1;
2463 
2464     /**
2465      * The <code>MessageBox</code> style constant for information icon
2466      * behavior (value is 1&lt;&lt;1).
2467      */
2468     public static const int ICON_INFORMATION = 1 << 1;
2469 
2470     /**
2471      * The <code>MessageBox</code> style constant for question icon
2472      * behavior (value is 1&lt;&lt;2).
2473      */
2474     public static const int ICON_QUESTION = 1 << 2;
2475 
2476     /**
2477      * The <code>MessageBox</code> style constant for warning icon
2478      * behavior (value is 1&lt;&lt;3).
2479      */
2480     public static const int ICON_WARNING = 1 << 3;
2481 
2482     /**
2483      * The <code>MessageBox</code> style constant for "working" icon
2484      * behavior (value is 1&lt;&lt;4).
2485      */
2486     public static const int ICON_WORKING = 1 << 4;
2487 
2488     /**
2489      * The <code>MessageBox</code> style constant for an OK button;
2490      * valid combinations are OK, OK|CANCEL
2491      * (value is 1&lt;&lt;5).
2492      */
2493     public static const int OK = 1 << 5;
2494 
2495     /**
2496      * The <code>MessageBox</code> style constant for YES button;
2497      * valid combinations are YES|NO, YES|NO|CANCEL
2498      * (value is 1&lt;&lt;6).
2499      */
2500     public static const int YES = 1 << 6;
2501 
2502     /**
2503      * The <code>MessageBox</code> style constant for NO button;
2504      * valid combinations are YES|NO, YES|NO|CANCEL
2505      * (value is 1&lt;&lt;7).
2506      */
2507     public static const int NO = 1 << 7;
2508 
2509     /**
2510      * The <code>MessageBox</code> style constant for a CANCEL button;
2511      * valid combinations are OK|CANCEL, YES|NO|CANCEL, RETRY|CANCEL
2512      * (value is 1&lt;&lt;8).  This style constant is also used with
2513      * <code>Text</code> in combination with SEARCH.
2514      *
2515      * <p><b>Used By:</b><ul>
2516      * <li><code>MessageBox</code></li>
2517      * <li><code>Text</code></li>
2518      * </ul></p>
2519      */
2520     public static const int CANCEL = 1 << 8;
2521 
2522     /**
2523      * The <code>MessageBox</code> style constant for an ABORT button;
2524      * the only valid combination is ABORT|RETRY|IGNORE
2525      * (value is 1&lt;&lt;9).
2526      */
2527     public static const int ABORT = 1 << 9;
2528 
2529     /**
2530      * The <code>MessageBox</code> style constant for a RETRY button;
2531      *  valid combinations are ABORT|RETRY|IGNORE, RETRY|CANCEL
2532      * (value is 1&lt;&lt;10).
2533      */
2534     public static const int RETRY = 1 << 10;
2535 
2536     /**
2537      * The <code>MessageBox</code> style constant for an IGNORE button;
2538      * the only valid combination is ABORT|RETRY|IGNORE
2539      * (value is 1&lt;&lt;11).
2540      */
2541     public static const int IGNORE = 1 << 11;
2542 
2543     /**
2544      * The <code>FileDialog</code> style constant for open file dialog behavior
2545      * (value is 1&lt;&lt;12).
2546      */
2547     public static const int OPEN = 1 << 12;
2548 
2549     /**
2550      * The <code>FileDialog</code> style constant for save file dialog behavior
2551      * (value is 1&lt;&lt;13).
2552      */
2553     public static const int SAVE = 1 << 13;
2554 
2555     /**
2556      * The <code>Composite</code> constant to indicate that
2557      * an attribute (such as background) is not inherited
2558      * by the children (value is 0).
2559      *
2560      * @since 3.2
2561      */
2562     public static const int INHERIT_NONE = 0;
2563 
2564     /**
2565      * The <code>Composite</code> constant to indicate that
2566      * an attribute (such as background) is inherited by
2567      * children who choose this value as their "default"
2568      * (value is 1).  For example, a label child will
2569      * typically choose to inherit the background color
2570      * of a composite while a list or table will not.
2571      *
2572      * @since 3.2
2573      */
2574     public static const int INHERIT_DEFAULT = 1;
2575 
2576     /**
2577      * The <code>Composite</code> constant to indicate that
2578      * an attribute (such as background) is inherited by
2579      * all children.
2580      *
2581      * @since 3.2
2582      */
2583     public static const int INHERIT_FORCE = 2;
2584 
2585     /**
2586      * Default color white (value is 1).
2587      */
2588     public static const int COLOR_WHITE = 1;
2589 
2590     /**
2591      * Default color black (value is 2).
2592      */
2593     public static const int COLOR_BLACK = 2;
2594 
2595     /**
2596      * Default color red (value is 3).
2597      */
2598     public static const int COLOR_RED = 3;
2599 
2600     /**
2601      * Default color dark red (value is 4).
2602      */
2603     public static const int COLOR_DARK_RED = 4;
2604 
2605     /**
2606      * Default color green (value is 5).
2607      */
2608     public static const int COLOR_GREEN = 5;
2609 
2610     /**
2611      * Default color dark green (value is 6).
2612      */
2613     public static const int COLOR_DARK_GREEN = 6;
2614 
2615     /**
2616      * Default color yellow (value is 7).
2617      */
2618     public static const int COLOR_YELLOW = 7;
2619 
2620     /**
2621      * Default color dark yellow (value is 8).
2622      */
2623     public static const int COLOR_DARK_YELLOW = 8;
2624 
2625     /**
2626      * Default color blue (value is 9).
2627      */
2628     public static const int COLOR_BLUE = 9;
2629 
2630     /**
2631      * Default color dark blue (value is 10).
2632      */
2633     public static const int COLOR_DARK_BLUE = 10;
2634 
2635     /**
2636      * Default color magenta (value is 11).
2637      */
2638     public static const int COLOR_MAGENTA = 11;
2639 
2640     /**
2641      * Default color dark magenta (value is 12).
2642      */
2643     public static const int COLOR_DARK_MAGENTA = 12;
2644 
2645     /**
2646      * Default color cyan (value is 13).
2647      */
2648     public static const int COLOR_CYAN = 13;
2649 
2650     /**
2651      * Default color dark cyan (value is 14).
2652      */
2653     public static const int COLOR_DARK_CYAN = 14;
2654 
2655     /**
2656      * Default color gray (value is 15).
2657      */
2658     public static const int COLOR_GRAY = 15;
2659 
2660     /**
2661      * Default color dark gray (value is 16).
2662      */
2663     public static const int COLOR_DARK_GRAY = 16;
2664 
2665     /*
2666      * System Colors
2667      *
2668      * Dealing with system colors is an area where there are
2669      * many platform differences.  On some platforms, system
2670      * colors can change dynamically while the program is
2671      * running.  On other platforms, system colors can be
2672      * changed for all instances of a particular widget.
2673      * Therefore, the only truly portable method to obtain
2674      * a widget color query is to query the color from an
2675      * instance of the widget.
2676      *
2677      *  It is expected that the list of supported colors
2678      * will grow over time.
2679      */
2680 
2681     /**
2682      * System color used to paint dark shadow areas (value is 17).
2683      */
2684     public static const int COLOR_WIDGET_DARK_SHADOW = 17;
2685 
2686     /**
2687      * System color used to paint normal shadow areas (value is 18).
2688      */
2689     public static const int COLOR_WIDGET_NORMAL_SHADOW = 18;
2690 
2691     /**
2692      * System color used to paint light shadow areas (value is 19).
2693      */
2694     public static const int COLOR_WIDGET_LIGHT_SHADOW = 19;
2695 
2696     /**
2697      * System color used to paint highlight shadow areas (value is 20).
2698      */
2699     public static const int COLOR_WIDGET_HIGHLIGHT_SHADOW = 20;
2700 
2701     /**
2702      * System color used to paint foreground areas (value is 21).
2703      */
2704     public static const int COLOR_WIDGET_FOREGROUND = 21;
2705 
2706     /**
2707      * System color used to paint background areas (value is 22).
2708      */
2709     public static const int COLOR_WIDGET_BACKGROUND = 22;
2710 
2711     /**
2712      * System color used to paint border areas (value is 23).
2713      */
2714     public static const int COLOR_WIDGET_BORDER = 23;
2715 
2716     /**
2717      * System color used to paint list foreground areas (value is 24).
2718      */
2719     public static const int COLOR_LIST_FOREGROUND = 24;
2720 
2721     /**
2722      * System color used to paint list background areas (value is 25).
2723      */
2724     public static const int COLOR_LIST_BACKGROUND = 25;
2725 
2726     /**
2727      * System color used to paint list selection background areas (value is 26).
2728      */
2729     public static const int COLOR_LIST_SELECTION = 26;
2730 
2731     /**
2732      * System color used to paint list selected text (value is 27).
2733      */
2734     public static const int COLOR_LIST_SELECTION_TEXT = 27;
2735 
2736     /**
2737      * System color used to paint tooltip text (value is 28).
2738      */
2739     public static const int COLOR_INFO_FOREGROUND = 28;
2740 
2741     /**
2742      * System color used to paint tooltip background areas (value is 29).
2743      */
2744     public static const int COLOR_INFO_BACKGROUND = 29;
2745 
2746     /**
2747      * System color used to paint title text (value is 30).
2748      */
2749     public static const int COLOR_TITLE_FOREGROUND = 30;
2750 
2751     /**
2752      * System color used to paint title background areas (value is 31).
2753      */
2754     public static const int COLOR_TITLE_BACKGROUND = 31;
2755 
2756     /**
2757      * System color used to paint title background gradient (value is 32).
2758      */
2759     public static const int COLOR_TITLE_BACKGROUND_GRADIENT = 32;
2760 
2761     /**
2762      * System color used to paint inactive title text (value is 33).
2763      */
2764     public static const int COLOR_TITLE_INACTIVE_FOREGROUND = 33;
2765 
2766     /**
2767      * System color used to paint inactive title background areas (value is 34).
2768      */
2769     public static const int COLOR_TITLE_INACTIVE_BACKGROUND = 34;
2770 
2771     /**
2772      * System color used to paint inactive title background gradient (value is 35).
2773      */
2774     public static const int COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = 35;
2775 
2776     /**
2777      * Draw constant indicating whether the drawing operation
2778      * should fill the background (value is 1&lt;&lt;0).
2779      */
2780     public static const int DRAW_TRANSPARENT = 1 << 0;
2781 
2782     /**
2783      * Draw constant indicating whether the string drawing operation
2784      * should handle line-delimiters (value is 1&lt;&lt;1).
2785      */
2786     public static const int DRAW_DELIMITER = 1 << 1;
2787 
2788     /**
2789      * Draw constant indicating whether the string drawing operation
2790      * should expand TAB characters (value is 1&lt;&lt;2).
2791      */
2792     public static const int DRAW_TAB = 1 << 2;
2793 
2794     /**
2795      * Draw constant indicating whether the string drawing operation
2796      * should handle mnemonics (value is 1&lt;&lt;3).
2797      */
2798     public static const int DRAW_MNEMONIC = 1 << 3;
2799 
2800 
2801     /**
2802      * Selection constant indicating that a line delimiter should be
2803      * drawn (value is 1&lt;&lt;17).
2804      *
2805      * <p><b>Used By:</b><ul>
2806      * <li><code>TextLayout</code></li>
2807      * </ul></p>
2808      *
2809      * @see #FULL_SELECTION
2810      * @see #LAST_LINE_SELECTION
2811      *
2812      * @since 3.3
2813      */
2814     public static const int DELIMITER_SELECTION = 1 << 17;
2815 
2816     /**
2817      * Selection constant indicating that the last line is selected
2818      * to the end and should be drawn using either a line delimiter
2819      * or full line selection (value is 1&lt;&lt;20).
2820      *
2821      * <p><b>Used By:</b><ul>
2822      * <li><code>TextLayout</code></li>
2823      * </ul></p>
2824      *
2825      * @see #DELIMITER_SELECTION
2826      * @see #FULL_SELECTION
2827      *
2828      * @since 3.3
2829      */
2830     public static const int LAST_LINE_SELECTION = 1 << 20;
2831 
2832     /**
2833      * SWT error constant indicating that no error number was specified
2834      * (value is 1).
2835      */
2836     public static const int ERROR_UNSPECIFIED = 1;
2837 
2838     /**
2839      * SWT error constant indicating that no more handles for an
2840      * operating system resource are available
2841      * (value is 2).
2842      */
2843     public static const int ERROR_NO_HANDLES = 2;
2844 
2845     /**
2846      * SWT error constant indicating that no more callback resources are available
2847      * (value is 3).
2848      */
2849     public static const int ERROR_NO_MORE_CALLBACKS = 3;
2850 
2851     /**
2852      * SWT error constant indicating that a null argument was passed in
2853      * (value is 4).
2854      */
2855     public static const int ERROR_NULL_ARGUMENT = 4;
2856 
2857     /**
2858      * SWT error constant indicating that an invalid argument was passed in
2859      * (value is 5).
2860      */
2861     public static const int ERROR_INVALID_ARGUMENT = 5;
2862 
2863     /**
2864      * SWT error constant indicating that a value was found to be
2865      * outside the allowable range
2866      * (value is 6).
2867      */
2868     public static const int ERROR_INVALID_RANGE = 6;
2869 
2870     /**
2871      * SWT error constant indicating that a value which can not be
2872      * zero was found to be
2873      * (value is 7).
2874      */
2875     public static const int ERROR_CANNOT_BE_ZERO = 7;
2876 
2877     /**
2878      * SWT error constant indicating that the underlying operating
2879      * system was unable to provide the value of an item
2880      * (value is 8).
2881      */
2882     public static const int ERROR_CANNOT_GET_ITEM = 8;
2883 
2884     /**
2885      * SWT error constant indicating that the underlying operating
2886      * system was unable to provide the selection
2887      * (value is 9).
2888      */
2889     public static const int ERROR_CANNOT_GET_SELECTION = 9;
2890 
2891     /**
2892      * SWT error constant indicating that the matrix is not invertible
2893      * (value is 10).
2894      *
2895      * @since 3.1
2896      */
2897     public static const int ERROR_CANNOT_INVERT_MATRIX = 10;
2898 
2899     /**
2900      * SWT error constant indicating that the underlying operating
2901      * system was unable to provide the height of an item
2902      * (value is 11).
2903      */
2904     public static const int ERROR_CANNOT_GET_ITEM_HEIGHT = 11;
2905 
2906     /**
2907      * SWT error constant indicating that the underlying operating
2908      * system was unable to provide the text of a widget
2909      * (value is 12).
2910      */
2911     public static const int ERROR_CANNOT_GET_TEXT = 12;
2912 
2913     /**
2914      * SWT error constant indicating that the underlying operating
2915      * system was unable to set the text of a widget
2916      * (value is 13).
2917      */
2918     public static const int ERROR_CANNOT_SET_TEXT = 13;
2919 
2920     /**
2921      * SWT error constant indicating that the underlying operating
2922      * system was unable to add an item
2923      * (value is 14).
2924      */
2925     public static const int ERROR_ITEM_NOT_ADDED = 14;
2926 
2927     /**
2928      * SWT error constant indicating that the underlying operating
2929      * system was unable to remove an item
2930      * (value is 15).
2931      */
2932     public static const int ERROR_ITEM_NOT_REMOVED = 15;
2933 
2934     /**
2935      * SWT error constant indicating that the graphics library
2936      * is not available
2937      * (value is 16).
2938      */
2939     public static const int ERROR_NO_GRAPHICS_LIBRARY = 16;
2940 
2941     /**
2942      * SWT error constant indicating that a particular feature has
2943      * not been implemented on this platform
2944      * (value is 20).
2945      */
2946     public static const int ERROR_NOT_IMPLEMENTED = 20;
2947 
2948     /**
2949      * SWT error constant indicating that a menu which needed
2950      * to have the drop down style had some other style instead
2951      * (value is 21).
2952      */
2953     public static const int ERROR_MENU_NOT_DROP_DOWN = 21;
2954 
2955     /**
2956      * SWT error constant indicating that an attempt was made to
2957      * invoke an SWT operation which can only be executed by the
2958      * user-interface thread from some other thread
2959      * (value is 22).
2960      */
2961     public static const int ERROR_THREAD_INVALID_ACCESS = 22;
2962 
2963     /**
2964      * SWT error constant indicating that an attempt was made to
2965      * invoke an SWT operation using a widget which had already
2966      * been disposed
2967      * (value is 24).
2968      */
2969     public static const int ERROR_WIDGET_DISPOSED = 24;
2970 
2971     /**
2972      * SWT error constant indicating that a menu item which needed
2973      * to have the cascade style had some other style instead
2974      * (value is 27).
2975      */
2976     public static const int ERROR_MENUITEM_NOT_CASCADE = 27;
2977 
2978     /**
2979      * SWT error constant indicating that the underlying operating
2980      * system was unable to set the selection of a widget
2981      * (value is 28).
2982      */
2983     public static const int ERROR_CANNOT_SET_SELECTION = 28;
2984 
2985     /**
2986      * SWT error constant indicating that the underlying operating
2987      * system was unable to set the menu
2988      * (value is 29).
2989      */
2990     public static const int ERROR_CANNOT_SET_MENU = 29;
2991 
2992     /**
2993      * SWT error constant indicating that the underlying operating
2994      * system was unable to set the enabled state
2995      * (value is 30).
2996      */
2997     public static const int ERROR_CANNOT_SET_ENABLED = 30;
2998 
2999     /**
3000      * SWT error constant indicating that the underlying operating
3001      * system was unable to provide enabled/disabled state information
3002      * (value is 31).
3003      */
3004     public static const int ERROR_CANNOT_GET_ENABLED = 31;
3005 
3006     /**
3007      * SWT error constant indicating that a provided widget can
3008      * not be used as a parent in the current operation
3009      * (value is 32).
3010      */
3011     public static const int ERROR_INVALID_PARENT = 32;
3012 
3013     /**
3014      * SWT error constant indicating that a menu which needed
3015      * to have the menu bar style had some other style instead
3016      * (value is 33).
3017      */
3018     public static const int ERROR_MENU_NOT_BAR = 33;
3019 
3020     /**
3021      * SWT error constant indicating that the underlying operating
3022      * system was unable to provide count information
3023      * (value is 36).
3024      */
3025     public static const int ERROR_CANNOT_GET_COUNT = 36;
3026 
3027     /**
3028      * SWT error constant indicating that a menu which needed
3029      * to have the pop up menu style had some other style instead
3030      * (value is 37).
3031      */
3032     public static const int ERROR_MENU_NOT_POP_UP = 37;
3033 
3034     /**
3035      * SWT error constant indicating that a graphics operation
3036      * was attempted with an image of an unsupported depth
3037      * (value is 38).
3038      */
3039     public static const int ERROR_UNSUPPORTED_DEPTH = 38;
3040 
3041     /**
3042      * SWT error constant indicating that an input/output operation
3043      * failed during the execution of an SWT operation
3044      * (value is 39).
3045      */
3046     public static const int ERROR_IO = 39;
3047 
3048     /**
3049      * SWT error constant indicating that a graphics operation
3050      * was attempted with an image having an invalid format
3051      * (value is 40).
3052      */
3053     public static const int ERROR_INVALID_IMAGE = 40;
3054 
3055     /**
3056      * SWT error constant indicating that a graphics operation
3057      * was attempted with an image having a valid but unsupported
3058      * format
3059      * (value is 42).
3060      */
3061     public static const int ERROR_UNSUPPORTED_FORMAT = 42;
3062 
3063     /**
3064      * SWT error constant indicating that an attempt was made
3065      * to subclass an SWT widget class without implementing the
3066      * <code>checkSubclass()</code> method
3067      * (value is 43).
3068      *
3069      * For additional information see the comment in
3070      * <code>Widget.checkSubclass()</code>.
3071      *
3072      * @see org.eclipse.swt.widgets.Widget#checkSubclass
3073      */
3074     public static const int ERROR_INVALID_SUBCLASS = 43;
3075 
3076     /**
3077      * SWT error constant indicating that an attempt was made to
3078      * invoke an SWT operation using a graphics object which had
3079      * already been disposed
3080      * (value is 44).
3081      */
3082     public static const int ERROR_GRAPHIC_DISPOSED = 44;
3083 
3084     /**
3085      * SWT error constant indicating that an attempt was made to
3086      * invoke an SWT operation using a device which had already
3087      * been disposed
3088      * (value is 45).
3089      */
3090     public static const int ERROR_DEVICE_DISPOSED = 45;
3091 
3092     /**
3093      * SWT error constant indicating that an exception happened
3094      * when executing a runnable
3095      * (value is 46).
3096      */
3097     public static const int ERROR_FAILED_EXEC = 46;
3098 
3099     /**
3100      * SWT error constant indicating that an unsatisfied link
3101      * error occurred while attempting to load a library
3102      * (value is 47).
3103      *
3104      * @since 3.1
3105      */
3106     public static const int ERROR_FAILED_LOAD_LIBRARY = 47;
3107 
3108     /**
3109      * SWT error constant indicating that a font is not valid
3110      * (value is 48).
3111      *
3112      * @since 3.1
3113      */
3114     public static const int ERROR_INVALID_FONT = 48;
3115 
3116     /**
3117      * Constant indicating that an image or operation is of type bitmap  (value is 0).
3118      */
3119     public static const int BITMAP = 0;
3120 
3121     /**
3122      * Constant indicating that an image or operation is of type icon  (value is 1).
3123      */
3124     public static const int ICON = 1;
3125 
3126     /**
3127      * The <code>Image</code> constructor argument indicating that
3128      * the new image should be a copy of the image provided as
3129      * an argument  (value is 0).
3130      */
3131     public static const int IMAGE_COPY = 0;
3132 
3133     /**
3134      * The <code>Image</code> constructor argument indicating that
3135      * the new image should have the appearance of a "disabled"
3136      * (using the platform's rules for how this should look)
3137      * copy of the image provided as an argument  (value is 1).
3138      */
3139     public static const int IMAGE_DISABLE = 1;
3140 
3141     /**
3142      * The <code>Image</code> constructor argument indicating that
3143      * the new image should have the appearance of a "gray scaled"
3144      * copy of the image provided as an argument  (value is 2).
3145      */
3146     public static const int IMAGE_GRAY = 2;
3147 
3148     /**
3149      * Constant to indicate an error state (value is 1).
3150      * <p><b>Used By:</b><ul>
3151      * <li><code>ProgressBar</code></li>
3152      * </ul></p>
3153      *
3154      * @since 3.4
3155      */
3156     public static const int ERROR = 1;
3157 
3158     /**
3159      * Constant to a indicate a paused state (value is 4).
3160      * <p><b>Used By:</b><ul>
3161      * <li><code>ProgressBar</code></li>
3162      * </ul></p>
3163      *
3164      * @since 3.4
3165      */
3166     public static const int PAUSED = 1 << 2;
3167 
3168     /**
3169      * The font style constant indicating a normal weight, non-italic font
3170      * (value is 0). This constant is also used with <code>ProgressBar</code>
3171      * to indicate a normal state.
3172      * <p><b>Used By:</b><ul>
3173      * <li><code>ProgressBar</code></li>
3174      * </ul></p>
3175      */
3176     public static const int NORMAL = 0;
3177 
3178     /**
3179      * The font style constant indicating a bold weight font
3180      * (value is 1&lt;&lt;0).
3181      */
3182     public static const int BOLD = 1 << 0;
3183 
3184     /**
3185      * The font style constant indicating an italic font
3186      * (value is 1&lt;&lt;1).
3187      */
3188     public static const int ITALIC = 1 << 1;
3189 
3190     /**
3191      * System arrow cursor  (value is 0).
3192      */
3193     public static const int CURSOR_ARROW = 0;
3194 
3195     /**
3196      * System wait cursor  (value is 1).
3197      */
3198     public static const int CURSOR_WAIT = 1;
3199 
3200     /**
3201      * System cross hair cursor  (value is 2).
3202      */
3203     public static const int CURSOR_CROSS = 2;
3204 
3205     /**
3206      * System app startup cursor  (value is 3).
3207      */
3208     public static const int CURSOR_APPSTARTING = 3;
3209 
3210     /**
3211      * System help cursor  (value is 4).
3212      */
3213     public static const int CURSOR_HELP = 4;
3214 
3215     /**
3216      * System resize all directions cursor (value is 5).
3217      */
3218     public static const int CURSOR_SIZEALL = 5;
3219 
3220     /**
3221      * System resize north-east-south-west cursor  (value is 6).
3222      */
3223     public static const int CURSOR_SIZENESW = 6;
3224 
3225     /**
3226      * System resize north-south cursor  (value is 7).
3227      */
3228     public static const int CURSOR_SIZENS = 7;
3229 
3230     /**
3231      * System resize north-west-south-east cursor  (value is 8).
3232      */
3233     public static const int CURSOR_SIZENWSE = 8;
3234 
3235     /**
3236      * System resize west-east cursor  (value is 9).
3237      */
3238     public static const int CURSOR_SIZEWE = 9;
3239 
3240     /**
3241      * System resize north cursor  (value is 10).
3242      */
3243     public static const int CURSOR_SIZEN = 10;
3244 
3245     /**
3246      * System resize south cursor  (value is 11).
3247      */
3248     public static const int CURSOR_SIZES = 11;
3249 
3250     /**
3251      * System resize east cursor  (value is 12).
3252      */
3253     public static const int CURSOR_SIZEE = 12;
3254 
3255     /**
3256      * System resize west cursor  (value is 13).
3257      */
3258     public static const int CURSOR_SIZEW = 13;
3259 
3260     /**
3261      * System resize north-east cursor (value is 14).
3262      */
3263     public static const int CURSOR_SIZENE = 14;
3264 
3265     /**
3266      * System resize south-east cursor (value is 15).
3267      */
3268     public static const int CURSOR_SIZESE = 15;
3269 
3270     /**
3271      * System resize south-west cursor (value is 16).
3272      */
3273     public static const int CURSOR_SIZESW = 16;
3274 
3275     /**
3276      * System resize north-west cursor (value is 17).
3277      */
3278     public static const int CURSOR_SIZENW = 17;
3279 
3280     /**
3281      * System up arrow cursor  (value is 18).
3282      */
3283     public static const int CURSOR_UPARROW = 18;
3284 
3285     /**
3286      * System i-beam cursor (value is 19).
3287      */
3288     public static const int CURSOR_IBEAM = 19;
3289 
3290     /**
3291      * System "not allowed" cursor (value is 20).
3292      */
3293     public static const int CURSOR_NO = 20;
3294 
3295     /**
3296      * System hand cursor (value is 21).
3297      */
3298     public static const int CURSOR_HAND = 21;
3299 
3300     /**
3301      * Line drawing style for flat end caps (value is 1).
3302      *
3303      * @see org.eclipse.swt.graphics.GC#setLineCap(int)
3304      * @see org.eclipse.swt.graphics.GC#getLineCap()
3305      *
3306      * @since 3.1
3307      */
3308     public static const int CAP_FLAT = 1;
3309 
3310     /**
3311      * Line drawing style for rounded end caps (value is 2).
3312      *
3313      * @see org.eclipse.swt.graphics.GC#setLineCap(int)
3314      * @see org.eclipse.swt.graphics.GC#getLineCap()
3315      *
3316      * @since 3.1
3317      */
3318     public static const int CAP_ROUND = 2;
3319 
3320     /**
3321      * Line drawing style for square end caps (value is 3).
3322      *
3323      * @see org.eclipse.swt.graphics.GC#setLineCap(int)
3324      * @see org.eclipse.swt.graphics.GC#getLineCap()
3325      *
3326      * @since 3.1
3327      */
3328     public static const int CAP_SQUARE = 3;
3329 
3330     /**
3331      * Line drawing style for miter joins (value is 1).
3332      *
3333      * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
3334      * @see org.eclipse.swt.graphics.GC#getLineJoin()
3335      *
3336      * @since 3.1
3337      */
3338     public static const int JOIN_MITER = 1;
3339 
3340     /**
3341      * Line drawing  style for rounded joins (value is 2).
3342      *
3343      * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
3344      * @see org.eclipse.swt.graphics.GC#getLineJoin()
3345      *
3346      * @since 3.1
3347      */
3348     public static const int JOIN_ROUND = 2;
3349 
3350     /**
3351      * Line drawing style for bevel joins (value is 3).
3352      *
3353      * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
3354      * @see org.eclipse.swt.graphics.GC#getLineJoin()
3355      *
3356      * @since 3.1
3357      */
3358     public static const int JOIN_BEVEL = 3;
3359 
3360     /**
3361      * Line drawing style for solid lines  (value is 1).
3362      */
3363     public static const int LINE_SOLID = 1;
3364 
3365     /**
3366      * Line drawing style for dashed lines (value is 2).
3367      */
3368     public static const int LINE_DASH = 2;
3369 
3370     /**
3371      * Line drawing style for dotted lines (value is 3).
3372      */
3373     public static const int LINE_DOT = 3;
3374 
3375     /**
3376      * Line drawing style for alternating dash-dot lines (value is 4).
3377      */
3378     public static const int LINE_DASHDOT = 4;
3379 
3380     /**
3381      * Line drawing style for dash-dot-dot lines (value is 5).
3382      */
3383     public static const int LINE_DASHDOTDOT = 5;
3384 
3385     /**
3386      * Line drawing style for custom dashed lines (value is 6).
3387      *
3388      * @see org.eclipse.swt.graphics.GC#setLineDash(int[])
3389      * @see org.eclipse.swt.graphics.GC#getLineDash()
3390      *
3391      * @since 3.1
3392      */
3393     public static const int LINE_CUSTOM = 6;
3394 
3395     /**
3396      * Path constant that represents a "move to" operation (value is 1).
3397      *
3398      * @since 3.1
3399      */
3400     public static const int PATH_MOVE_TO = 1;
3401 
3402     /**
3403      * Path constant that represents a "line to" operation (value is 2).
3404      *
3405      * @since 3.1
3406      */
3407     public static const int PATH_LINE_TO = 2;
3408 
3409     /**
3410      * Path constant that represents a "quadratic curve to" operation (value is 3).
3411      *
3412      * @since 3.1
3413      */
3414     public static const int PATH_QUAD_TO = 3;
3415 
3416     /**
3417      * Path constant that represents a "cubic curve to" operation (value is 4).
3418      *
3419      * @since 3.1
3420      */
3421     public static const int PATH_CUBIC_TO = 4;
3422 
3423     /**
3424      * Path constant that represents a "close" operation (value is 5).
3425      *
3426      * @since 3.1
3427      */
3428     public static const int PATH_CLOSE = 5;
3429 
3430     /**
3431      * Even odd rule for filling operations (value is 1).
3432      *
3433      * @since 3.1
3434      */
3435     public static const int FILL_EVEN_ODD = 1;
3436 
3437     /**
3438      * Winding rule for filling operations (value is 2).
3439      *
3440      * @since 3.1
3441      */
3442     public static const int FILL_WINDING = 2;
3443 
3444     /**
3445      * Image format constant indicating an unknown image type (value is -1).
3446      */
3447     public static const int IMAGE_UNDEFINED = -1;
3448 
3449     /**
3450      * Image format constant indicating a Windows BMP format image (value is 0).
3451      */
3452     public static const int IMAGE_BMP = 0;
3453 
3454     /**
3455      * Image format constant indicating a run-length encoded
3456      * Windows BMP format image (value is 1).
3457      */
3458     public static const int IMAGE_BMP_RLE = 1;
3459 
3460     /**
3461      * Image format constant indicating a GIF format image (value is 2).
3462      */
3463     public static const int IMAGE_GIF = 2;
3464 
3465     /**
3466      * Image format constant indicating a ICO format image (value is 3).
3467      */
3468     public static const int IMAGE_ICO = 3;
3469 
3470     /**
3471      * Image format constant indicating a JPEG format image (value is 4).
3472      */
3473     public static const int IMAGE_JPEG = 4;
3474 
3475     /**
3476      * Image format constant indicating a PNG format image (value is 5).
3477      */
3478     public static const int IMAGE_PNG = 5;
3479 
3480     /**
3481      * Image format constant indicating a TIFF format image (value is 6).
3482      */
3483     public static const int IMAGE_TIFF = 6;
3484 
3485     /**
3486      * Image format constant indicating an OS/2 BMP format image (value is 7).
3487      */
3488     public static const int IMAGE_OS2_BMP = 7;
3489 
3490     /**
3491      * GIF image disposal method constants indicating that the
3492      * disposal method is unspecified (value is 0).
3493      */
3494     public static const int DM_UNSPECIFIED = 0x0;
3495 
3496     /**
3497      * GIF image disposal method constants indicating that the
3498      * disposal method is to do nothing; that is, to leave the
3499      * previous image in place (value is 1).
3500      */
3501     public static const int DM_FILL_NONE = 0x1;
3502 
3503     /**
3504      * GIF image disposal method constants indicating that the
3505      * the previous images should be covered with the background
3506      * color before displaying the next image (value is 2).
3507      */
3508     public static const int DM_FILL_BACKGROUND = 0x2;
3509 
3510     /**
3511      * GIF image disposal method constants indicating that the
3512      * disposal method is to restore the previous picture
3513      * (value is 3).
3514      */
3515     public static const int DM_FILL_PREVIOUS = 0x3;
3516 
3517     /**
3518      * Image transparency constant indicating that the image
3519      * contains no transparency information (value is 0).
3520      */
3521     public static const int TRANSPARENCY_NONE = 0x0;
3522 
3523     /**
3524      * Image transparency constant indicating that the image
3525      * contains alpha transparency information (value is 1&lt;&lt;0).
3526      */
3527     public static const int TRANSPARENCY_ALPHA = 1 << 0;
3528 
3529     /**
3530      * Image transparency constant indicating that the image
3531      * contains a transparency mask (value is 1&lt;&lt;1).
3532      */
3533     public static const int TRANSPARENCY_MASK = 1 << 1;
3534 
3535     /**
3536      * Image transparency constant indicating that the image
3537      * contains a transparent pixel (value is 1&lt;&lt;2).
3538      */
3539     public static const int TRANSPARENCY_PIXEL = 1 << 2;
3540 
3541     /**
3542      * The character movement type (value is 1&lt;&lt;0).
3543      * This constant is used to move a text offset over a character.
3544      *
3545      * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3546      * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3547      *
3548      * @since 3.0
3549      */
3550     public static const int MOVEMENT_CHAR = 1 << 0;
3551 
3552     /**
3553      * The cluster movement type (value is 1&lt;&lt;1).
3554      * This constant is used to move a text offset over a cluster.
3555      * A cluster groups one or more characters. A cluster is
3556      * undivisible, this means that a caret offset can not be placed in the
3557      * middle of a cluster.
3558      *
3559      * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3560      * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3561      *
3562      * @since 3.0
3563      */
3564     public static const int MOVEMENT_CLUSTER = 1 << 1;
3565 
3566     /**
3567      * The word movement type (value is 1&lt;&lt;2).
3568      * This constant is used to move a text offset over a word.
3569      * The behavior of this constant depends on the platform and on the
3570      * direction of the movement. For example, on Windows the stop is
3571      * always at the start of the word. On GTK and Mac the stop is at the end
3572      * of the word if the direction is next and at the start of the word if the
3573      * direction is previous.
3574      *
3575      * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3576      * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3577      *
3578      * @since 3.0
3579      */
3580     public static const int MOVEMENT_WORD = 1 << 2;
3581 
3582     /**
3583      * The word end movement type (value is 1&lt;&lt;3).
3584      * This constant is used to move a text offset to the next or previous
3585      * word end. The behavior of this constant does not depend on the platform.
3586      *
3587      *
3588      * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3589      * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3590      *
3591      * @since 3.3
3592      */
3593     public static const int MOVEMENT_WORD_END = 1 << 3;
3594 
3595     /**
3596      * The word start movement type (value is 1&lt;&lt;4).
3597      * This constant is used to move a text offset to the next or previous
3598      * word start. The behavior of this constant does not depend on the platform.
3599      *
3600      * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3601      * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3602      *
3603      * @since 3.3
3604      */
3605     public static const int MOVEMENT_WORD_START = 1 << 4;
3606 
3607 
3608 /**
3609  * Answers a concise, human readable description of the error code.
3610  *
3611  * @param code the SWT error code.
3612  * @return a description of the error code.
3613  *
3614  * @see SWT
3615  */
3616 static String findErrorText (int code) {
3617     switch (code) {
3618         case ERROR_UNSPECIFIED:            return "Unspecified error"; //$NON-NLS-1$
3619         case ERROR_NO_HANDLES:             return "No more handles"; //$NON-NLS-1$
3620         case ERROR_NO_MORE_CALLBACKS:      return "No more callbacks"; //$NON-NLS-1$
3621         case ERROR_NULL_ARGUMENT:          return "Argument cannot be null"; //$NON-NLS-1$
3622         case ERROR_INVALID_ARGUMENT:       return "Argument not valid"; //$NON-NLS-1$
3623         case ERROR_INVALID_RANGE:          return "Index out of bounds"; //$NON-NLS-1$
3624         case ERROR_CANNOT_BE_ZERO:         return "Argument cannot be zero"; //$NON-NLS-1$
3625         case ERROR_CANNOT_GET_ITEM:        return "Cannot get item"; //$NON-NLS-1$
3626         case ERROR_CANNOT_GET_SELECTION:   return "Cannot get selection"; //$NON-NLS-1$
3627         case ERROR_CANNOT_GET_ITEM_HEIGHT: return "Cannot get item height"; //$NON-NLS-1$
3628         case ERROR_CANNOT_GET_TEXT:        return "Cannot get text"; //$NON-NLS-1$
3629         case ERROR_CANNOT_SET_TEXT:        return "Cannot set text"; //$NON-NLS-1$
3630         case ERROR_ITEM_NOT_ADDED:         return "Item not added"; //$NON-NLS-1$
3631         case ERROR_ITEM_NOT_REMOVED:       return "Item not removed"; //$NON-NLS-1$
3632         case ERROR_NOT_IMPLEMENTED:        return "Not implemented"; //$NON-NLS-1$
3633         case ERROR_MENU_NOT_DROP_DOWN:     return "Menu must be a drop down"; //$NON-NLS-1$
3634         case ERROR_THREAD_INVALID_ACCESS:  return "Invalid thread access"; //$NON-NLS-1$
3635         case ERROR_WIDGET_DISPOSED:        return "Widget is disposed"; //$NON-NLS-1$
3636         case ERROR_MENUITEM_NOT_CASCADE:   return "Menu item is not a CASCADE"; //$NON-NLS-1$
3637         case ERROR_CANNOT_SET_SELECTION:   return "Cannot set selection";  //$NON-NLS-1$
3638         case ERROR_CANNOT_SET_MENU:        return "Cannot set menu";  //$NON-NLS-1$
3639         case ERROR_CANNOT_SET_ENABLED:     return "Cannot set the enabled state";  //$NON-NLS-1$
3640         case ERROR_CANNOT_GET_ENABLED:     return "Cannot get the enabled state";  //$NON-NLS-1$
3641         case ERROR_INVALID_PARENT:         return "Widget has the wrong parent";  //$NON-NLS-1$
3642         case ERROR_MENU_NOT_BAR:           return "Menu is not a BAR";  //$NON-NLS-1$
3643         case ERROR_CANNOT_GET_COUNT:       return "Cannot get count"; //$NON-NLS-1$
3644         case ERROR_MENU_NOT_POP_UP:        return "Menu is not a POP_UP"; //$NON-NLS-1$
3645         case ERROR_UNSUPPORTED_DEPTH:      return "Unsupported color depth"; //$NON-NLS-1$
3646         case ERROR_IO:                     return "i/o error"; //$NON-NLS-1$
3647         case ERROR_INVALID_IMAGE:          return "Invalid image"; //$NON-NLS-1$
3648         case ERROR_UNSUPPORTED_FORMAT:     return "Unsupported or unrecognized format"; //$NON-NLS-1$
3649         case ERROR_INVALID_SUBCLASS:       return "Subclassing not allowed"; //$NON-NLS-1$
3650         case ERROR_GRAPHIC_DISPOSED:       return "Graphic is disposed"; //$NON-NLS-1$
3651         case ERROR_DEVICE_DISPOSED:        return "Device is disposed"; //$NON-NLS-1$
3652         case ERROR_FAILED_EXEC:            return "Failed to execute runnable"; //$NON-NLS-1$
3653         case ERROR_FAILED_LOAD_LIBRARY:    return "Unable to load library"; //$NON-NLS-1$
3654         case ERROR_CANNOT_INVERT_MATRIX:    return "Cannot invert matrix"; //$NON-NLS-1$
3655         case ERROR_NO_GRAPHICS_LIBRARY:    return "Unable to load graphics library"; //$NON-NLS-1$
3656         case ERROR_INVALID_FONT:            return "Font not valid"; //$NON-NLS-1$
3657         default:
3658     }
3659     return "Unknown error"; //$NON-NLS-1$
3660 }
3661 
3662 
3663 /**
3664  * Returns the NLS'ed message for the given argument.
3665  *
3666  * @param key the key to look up
3667  * @return the message for the given key
3668  *
3669  * @exception IllegalArgumentException <ul>
3670  *    <li>ERROR_NULL_ARGUMENT - if the key is null</li>
3671  * </ul>
3672  */
3673 public static String getMessage(String key) {
3674     return Compatibility.getMessage(key);
3675 }
3676 
3677 /**
3678  * Returns the SWT platform name.
3679  * Examples: "win32", "motif", "gtk", "photon", "carbon"
3680  *
3681  * @return the SWT platform name
3682  */
3683 public static String getPlatform () {
3684     return Platform.PLATFORM;
3685 }
3686 
3687 /**
3688  * Returns the SWT version number as an integer.
3689  * Example: "SWT051" == 51
3690  *
3691  * @return the SWT version number
3692  */
3693 public static int getVersion () {
3694     return Library.SWT_VERSION;
3695 }
3696 
3697 /**
3698  * Throws an appropriate exception based on the passed in error code.
3699  *
3700  * @param code the SWT error code
3701  */
3702 public static void error (String file, long line, int code) {
3703     error (code, null);
3704 }
3705 public static void error (int code) {
3706     error (code, null);
3707 }
3708 
3709 /**
3710  * Throws an appropriate exception based on the passed in error code.
3711  * The <code>throwable</code> argument should be either null, or the
3712  * throwable which caused SWT to throw an exception.
3713  * <p>
3714  * In SWT, errors are reported by throwing one of three exceptions:
3715  * <dl>
3716  * <dd>java.lang.IllegalArgumentException</dd>
3717  * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
3718  * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
3719  * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
3720  * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
3721  * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
3722  * </dl>
3723  * This method provides the logic which maps between error codes
3724  * and one of the above exceptions.
3725  * </p>
3726  *
3727  * @param code the SWT error code.
3728  * @param throwable the exception which caused the error to occur.
3729  *
3730  * @see SWTError
3731  * @see SWTException
3732  * @see IllegalArgumentException
3733  */
3734 public static void error (int code, Exception throwable) {
3735     error (code, throwable, null);
3736 }
3737 
3738 /**
3739  * Throws an appropriate exception based on the passed in error code.
3740  * The <code>throwable</code> argument should be either null, or the
3741  * throwable which caused SWT to throw an exception.
3742  * <p>
3743  * In SWT, errors are reported by throwing one of three exceptions:
3744  * <dl>
3745  * <dd>java.lang.IllegalArgumentException</dd>
3746  * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
3747  * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
3748  * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
3749  * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
3750  * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
3751  * </dl>
3752  * This method provides the logic which maps between error codes
3753  * and one of the above exceptions.
3754  * </p>
3755  *
3756  * @param code the SWT error code.
3757  * @param throwable the exception which caused the error to occur.
3758  * @param detail more information about error.
3759  *
3760  * @see SWTError
3761  * @see SWTException
3762  * @see IllegalArgumentException
3763  *
3764  * @since 3.0
3765  */
3766 public static void error (int code, Exception throwable, String detail) {
3767 
3768     /*
3769     * This code prevents the creation of "chains" of SWTErrors and
3770     * SWTExceptions which in turn contain other SWTErrors and
3771     * SWTExceptions as their throwable. This can occur when low level
3772     * code throws an exception past a point where a higher layer is
3773     * being "safe" and catching all exceptions. (Note that, this is
3774     * _a_bad_thing_ which we always try to avoid.)
3775     *
3776     * On the theory that the low level code is closest to the
3777     * original problem, we simply re-throw the original exception here.
3778     *
3779     * NOTE: Exceptions thrown in syncExec and asyncExec must be
3780     * wrapped.
3781     */
3782     if (code != SWT.ERROR_FAILED_EXEC) {
3783         if (auto t = cast(SWTError)throwable) throw t;
3784         if (auto t = cast(SWTException)throwable) throw t;
3785     }
3786 
3787     String message = findErrorText (code);
3788     if (detail != null) message ~= detail;
3789     switch (code) {
3790 
3791         /* Illegal Arguments (non-fatal) */
3792         case ERROR_NULL_ARGUMENT:
3793         case ERROR_CANNOT_BE_ZERO:
3794         case ERROR_INVALID_ARGUMENT:
3795         case ERROR_MENU_NOT_BAR:
3796         case ERROR_MENU_NOT_DROP_DOWN:
3797         case ERROR_MENU_NOT_POP_UP:
3798         case ERROR_MENUITEM_NOT_CASCADE:
3799         case ERROR_INVALID_PARENT:
3800         case ERROR_INVALID_RANGE: {
3801             throw new IllegalArgumentException (message);
3802         }
3803 
3804         /* SWT Exceptions (non-fatal) */
3805         case ERROR_INVALID_SUBCLASS:
3806         case ERROR_THREAD_INVALID_ACCESS:
3807         case ERROR_WIDGET_DISPOSED:
3808         case ERROR_GRAPHIC_DISPOSED:
3809         case ERROR_DEVICE_DISPOSED:
3810         case ERROR_INVALID_IMAGE:
3811         case ERROR_UNSUPPORTED_DEPTH:
3812         case ERROR_UNSUPPORTED_FORMAT:
3813         case ERROR_FAILED_EXEC:
3814         case ERROR_CANNOT_INVERT_MATRIX:
3815         case ERROR_NO_GRAPHICS_LIBRARY:
3816         case ERROR_IO: {
3817             SWTException exception = new SWTException (code, message);
3818             exception.throwable = throwable;
3819             throw exception;
3820         }
3821 
3822         /* Operation System Errors (fatal, may occur only on some platforms) */
3823         case ERROR_CANNOT_GET_COUNT:
3824         case ERROR_CANNOT_GET_ENABLED:
3825         case ERROR_CANNOT_GET_ITEM:
3826         case ERROR_CANNOT_GET_ITEM_HEIGHT:
3827         case ERROR_CANNOT_GET_SELECTION:
3828         case ERROR_CANNOT_GET_TEXT:
3829         case ERROR_CANNOT_SET_ENABLED:
3830         case ERROR_CANNOT_SET_MENU:
3831         case ERROR_CANNOT_SET_SELECTION:
3832         case ERROR_CANNOT_SET_TEXT:
3833         case ERROR_ITEM_NOT_ADDED:
3834         case ERROR_ITEM_NOT_REMOVED:
3835         case ERROR_NO_HANDLES:
3836         //FALL THROUGH
3837 
3838         /* SWT Errors (fatal, may occur only on some platforms) */
3839         case ERROR_FAILED_LOAD_LIBRARY:
3840         case ERROR_NO_MORE_CALLBACKS:
3841         case ERROR_NOT_IMPLEMENTED:
3842         case ERROR_UNSPECIFIED: {
3843             SWTError error = new SWTError (code, message);
3844             error.throwable = throwable;
3845             throw error;
3846         }
3847         default:
3848     }
3849 
3850     /* Unknown/Undefined Error */
3851     SWTError error = new SWTError (code, message);
3852     error.throwable = throwable;
3853     throw error;
3854 }
3855 
3856 }