diff dwt/widgets/Display.d @ 71:295b29fc7d13

Renamed SWT to DWT
author Frank Benoit <benoit@tionex.de>
date Tue, 15 Jan 2008 06:44:34 +0100
parents 7cf1deebc8d4
children 5899e0b43e5d
line wrap: on
line diff
--- a/dwt/widgets/Display.d	Tue Jan 15 06:38:45 2008 +0100
+++ b/dwt/widgets/Display.d	Tue Jan 15 06:44:34 2008 +0100
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*******************************************************************************
  * Copyright (c) 2000, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -10,7 +10,7 @@
  *******************************************************************************/
 module dwt.widgets.Display;
 
-import dwt.SWT;
+import dwt.DWT;
 import dwt.graphics.Color;
 import dwt.graphics.Cursor;
 import dwt.graphics.Device;
@@ -50,21 +50,21 @@
 
 /**
  * Instances of this class are responsible for managing the
- * connection between SWT and the underlying operating
+ * connection between DWT and the underlying operating
  * system. Their most important function is to implement
- * the SWT event loop in terms of the platform event model.
+ * the DWT event loop in terms of the platform event model.
  * They also provide various methods for accessing information
  * about the operating system, and have overall control over
- * the operating system resources which SWT allocates.
+ * the operating system resources which DWT allocates.
  * <p>
- * Applications which are built with SWT will <em>almost always</em>
+ * Applications which are built with DWT will <em>almost always</em>
  * require only a single display. In particular, some platforms
- * which SWT supports will not allow more than one <em>active</em>
+ * which DWT supports will not allow more than one <em>active</em>
  * display. In other words, some platforms do not support
  * creating a new display if one already exists that has not been
  * sent the <code>dispose()</code> message.
  * <p>
- * In SWT, the thread which creates a <code>Display</code>
+ * In DWT, the thread which creates a <code>Display</code>
  * instance is distinguished as the <em>user-interface thread</em>
  * for that display.
  * </p>
@@ -75,7 +75,7 @@
  * The event loop for that display must be run from the thread.
  * </li>
  * <li>
- * Some SWT API methods (notably, most of the public methods in
+ * Some DWT API methods (notably, most of the public methods in
  * <code>Widget</code> and its subclasses), may only be called
  * from the thread. (To support multi-threaded user-interface
  * applications, class <code>Display</code> provides inter-thread
@@ -92,7 +92,7 @@
  * even on platforms which support it, is to have multiple threads.)
  * </li>
  * </ul>
- * Enforcing these attributes allows SWT to be implemented directly
+ * Enforcing these attributes allows DWT to be implemented directly
  * on the underlying operating system's event model. This has
  * numerous benefits including smaller footprint, better use of
  * resources, safer memory management, clearer program logic,
@@ -102,10 +102,10 @@
  * inter-thread communication mechanisms which this class provides
  * when required.
  * </p><p>
- * All SWT API methods which may only be called from the user-interface
+ * All DWT API methods which may only be called from the user-interface
  * thread are distinguished in their documentation by indicating that
  * they throw the "<code>ERROR_THREAD_INVALID_ACCESS</code>"
- * SWT exception.
+ * DWT exception.
  * </p>
  * <dl>
  * <dt><b>Styles:</b></dt>
@@ -141,7 +141,7 @@
 
     CallbackData  filterProcCallbackData;
     EventTable eventTable, filterTable;
-    static char[] APP_NAME = "SWT";
+    static char[] APP_NAME = "DWT";
     static const char[] DISPATCH_EVENT_KEY = "dwt.internal.gtk.dispatchEvent";
     static const char[] ADD_WIDGET_KEY = "dwt.internal.addWidget";
     GClosure*[] closures;
@@ -252,7 +252,7 @@
     Image errorImage, infoImage, questionImage, warningImage;
     Cursor [] cursors;
     Resource [] resources;
-    static const int RESOURCE_SIZE = 1 + 4 + SWT.CURSOR_HAND + 1;
+    static const int RESOURCE_SIZE = 1 + 4 + DWT.CURSOR_HAND + 1;
 
     /* Colors */
     GdkColor* COLOR_WIDGET_DARK_SHADOW, COLOR_WIDGET_NORMAL_SHADOW, COLOR_WIDGET_LIGHT_SHADOW;
@@ -283,91 +283,91 @@
     static const int [] [] KeyTable = [
 
         /* Keyboard and Mouse Masks */
-        [OS.GDK_Alt_L,      SWT.ALT],
-        [OS.GDK_Alt_R,      SWT.ALT],
-        [OS.GDK_Meta_L, SWT.ALT],
-        [OS.GDK_Meta_R, SWT.ALT],
-        [OS.GDK_Shift_L,        SWT.SHIFT],
-        [OS.GDK_Shift_R,        SWT.SHIFT],
-        [OS.GDK_Control_L,  SWT.CONTROL],
-        [OS.GDK_Control_R,  SWT.CONTROL],
-//      [OS.GDK_????,       SWT.COMMAND],
-//      [OS.GDK_????,       SWT.COMMAND],
+        [OS.GDK_Alt_L,      DWT.ALT],
+        [OS.GDK_Alt_R,      DWT.ALT],
+        [OS.GDK_Meta_L, DWT.ALT],
+        [OS.GDK_Meta_R, DWT.ALT],
+        [OS.GDK_Shift_L,        DWT.SHIFT],
+        [OS.GDK_Shift_R,        DWT.SHIFT],
+        [OS.GDK_Control_L,  DWT.CONTROL],
+        [OS.GDK_Control_R,  DWT.CONTROL],
+//      [OS.GDK_????,       DWT.COMMAND],
+//      [OS.GDK_????,       DWT.COMMAND],
 
         /* Non-Numeric Keypad Keys */
-        [OS.GDK_Up,                     SWT.ARROW_UP],
-        [OS.GDK_KP_Up,                  SWT.ARROW_UP],
-        [OS.GDK_Down,                   SWT.ARROW_DOWN],
-        [OS.GDK_KP_Down,            SWT.ARROW_DOWN],
-        [OS.GDK_Left,                       SWT.ARROW_LEFT],
-        [OS.GDK_KP_Left,                SWT.ARROW_LEFT],
-        [OS.GDK_Right,                  SWT.ARROW_RIGHT],
-        [OS.GDK_KP_Right,               SWT.ARROW_RIGHT],
-        [OS.GDK_Page_Up,                SWT.PAGE_UP],
-        [OS.GDK_KP_Page_Up,     SWT.PAGE_UP],
-        [OS.GDK_Page_Down,          SWT.PAGE_DOWN],
-        [OS.GDK_KP_Page_Down,   SWT.PAGE_DOWN],
-        [OS.GDK_Home,                   SWT.HOME],
-        [OS.GDK_KP_Home,            SWT.HOME],
-        [OS.GDK_End,                        SWT.END],
-        [OS.GDK_KP_End,             SWT.END],
-        [OS.GDK_Insert,                 SWT.INSERT],
-        [OS.GDK_KP_Insert,          SWT.INSERT],
+        [OS.GDK_Up,                     DWT.ARROW_UP],
+        [OS.GDK_KP_Up,                  DWT.ARROW_UP],
+        [OS.GDK_Down,                   DWT.ARROW_DOWN],
+        [OS.GDK_KP_Down,            DWT.ARROW_DOWN],
+        [OS.GDK_Left,                       DWT.ARROW_LEFT],
+        [OS.GDK_KP_Left,                DWT.ARROW_LEFT],
+        [OS.GDK_Right,                  DWT.ARROW_RIGHT],
+        [OS.GDK_KP_Right,               DWT.ARROW_RIGHT],
+        [OS.GDK_Page_Up,                DWT.PAGE_UP],
+        [OS.GDK_KP_Page_Up,     DWT.PAGE_UP],
+        [OS.GDK_Page_Down,          DWT.PAGE_DOWN],
+        [OS.GDK_KP_Page_Down,   DWT.PAGE_DOWN],
+        [OS.GDK_Home,                   DWT.HOME],
+        [OS.GDK_KP_Home,            DWT.HOME],
+        [OS.GDK_End,                        DWT.END],
+        [OS.GDK_KP_End,             DWT.END],
+        [OS.GDK_Insert,                 DWT.INSERT],
+        [OS.GDK_KP_Insert,          DWT.INSERT],
 
         /* Virtual and Ascii Keys */
-        [OS.GDK_BackSpace,      SWT.BS],
-        [OS.GDK_Return,             SWT.CR],
-        [OS.GDK_Delete,             SWT.DEL],
-        [OS.GDK_KP_Delete,      SWT.DEL],
-        [OS.GDK_Escape,         SWT.ESC],
-        [OS.GDK_Linefeed,           SWT.LF],
-        [OS.GDK_Tab,                    SWT.TAB],
-        [OS.GDK_ISO_Left_Tab,   SWT.TAB],
+        [OS.GDK_BackSpace,      DWT.BS],
+        [OS.GDK_Return,             DWT.CR],
+        [OS.GDK_Delete,             DWT.DEL],
+        [OS.GDK_KP_Delete,      DWT.DEL],
+        [OS.GDK_Escape,         DWT.ESC],
+        [OS.GDK_Linefeed,           DWT.LF],
+        [OS.GDK_Tab,                    DWT.TAB],
+        [OS.GDK_ISO_Left_Tab,   DWT.TAB],
 
         /* Functions Keys */
-        [OS.GDK_F1,     SWT.F1],
-        [OS.GDK_F2,     SWT.F2],
-        [OS.GDK_F3,     SWT.F3],
-        [OS.GDK_F4,     SWT.F4],
-        [OS.GDK_F5,     SWT.F5],
-        [OS.GDK_F6,     SWT.F6],
-        [OS.GDK_F7,     SWT.F7],
-        [OS.GDK_F8,     SWT.F8],
-        [OS.GDK_F9,     SWT.F9],
-        [OS.GDK_F10,        SWT.F10],
-        [OS.GDK_F11,        SWT.F11],
-        [OS.GDK_F12,        SWT.F12],
-        [OS.GDK_F13,        SWT.F13],
-        [OS.GDK_F14,        SWT.F14],
-        [OS.GDK_F15,        SWT.F15],
+        [OS.GDK_F1,     DWT.F1],
+        [OS.GDK_F2,     DWT.F2],
+        [OS.GDK_F3,     DWT.F3],
+        [OS.GDK_F4,     DWT.F4],
+        [OS.GDK_F5,     DWT.F5],
+        [OS.GDK_F6,     DWT.F6],
+        [OS.GDK_F7,     DWT.F7],
+        [OS.GDK_F8,     DWT.F8],
+        [OS.GDK_F9,     DWT.F9],
+        [OS.GDK_F10,        DWT.F10],
+        [OS.GDK_F11,        DWT.F11],
+        [OS.GDK_F12,        DWT.F12],
+        [OS.GDK_F13,        DWT.F13],
+        [OS.GDK_F14,        DWT.F14],
+        [OS.GDK_F15,        DWT.F15],
 
         /* Numeric Keypad Keys */
-        [OS.GDK_KP_Multiply,        SWT.KEYPAD_MULTIPLY],
-        [OS.GDK_KP_Add,         SWT.KEYPAD_ADD],
-        [OS.GDK_KP_Enter,           SWT.KEYPAD_CR],
-        [OS.GDK_KP_Subtract,    SWT.KEYPAD_SUBTRACT],
-        [OS.GDK_KP_Decimal, SWT.KEYPAD_DECIMAL],
-        [OS.GDK_KP_Divide,      SWT.KEYPAD_DIVIDE],
-        [OS.GDK_KP_0,           SWT.KEYPAD_0],
-        [OS.GDK_KP_1,           SWT.KEYPAD_1],
-        [OS.GDK_KP_2,           SWT.KEYPAD_2],
-        [OS.GDK_KP_3,           SWT.KEYPAD_3],
-        [OS.GDK_KP_4,           SWT.KEYPAD_4],
-        [OS.GDK_KP_5,           SWT.KEYPAD_5],
-        [OS.GDK_KP_6,           SWT.KEYPAD_6],
-        [OS.GDK_KP_7,           SWT.KEYPAD_7],
-        [OS.GDK_KP_8,           SWT.KEYPAD_8],
-        [OS.GDK_KP_9,           SWT.KEYPAD_9],
-        [OS.GDK_KP_Equal,   SWT.KEYPAD_EQUAL],
+        [OS.GDK_KP_Multiply,        DWT.KEYPAD_MULTIPLY],
+        [OS.GDK_KP_Add,         DWT.KEYPAD_ADD],
+        [OS.GDK_KP_Enter,           DWT.KEYPAD_CR],
+        [OS.GDK_KP_Subtract,    DWT.KEYPAD_SUBTRACT],
+        [OS.GDK_KP_Decimal, DWT.KEYPAD_DECIMAL],
+        [OS.GDK_KP_Divide,      DWT.KEYPAD_DIVIDE],
+        [OS.GDK_KP_0,           DWT.KEYPAD_0],
+        [OS.GDK_KP_1,           DWT.KEYPAD_1],
+        [OS.GDK_KP_2,           DWT.KEYPAD_2],
+        [OS.GDK_KP_3,           DWT.KEYPAD_3],
+        [OS.GDK_KP_4,           DWT.KEYPAD_4],
+        [OS.GDK_KP_5,           DWT.KEYPAD_5],
+        [OS.GDK_KP_6,           DWT.KEYPAD_6],
+        [OS.GDK_KP_7,           DWT.KEYPAD_7],
+        [OS.GDK_KP_8,           DWT.KEYPAD_8],
+        [OS.GDK_KP_9,           DWT.KEYPAD_9],
+        [OS.GDK_KP_Equal,   DWT.KEYPAD_EQUAL],
 
         /* Other keys */
-        [OS.GDK_Caps_Lock,      SWT.CAPS_LOCK],
-        [OS.GDK_Num_Lock,       SWT.NUM_LOCK],
-        [OS.GDK_Scroll_Lock,        SWT.SCROLL_LOCK],
-        [OS.GDK_Pause,              SWT.PAUSE],
-        [OS.GDK_Break,              SWT.BREAK],
-        [OS.GDK_Print,                  SWT.PRINT_SCREEN],
-        [OS.GDK_Help,                   SWT.HELP],
+        [OS.GDK_Caps_Lock,      DWT.CAPS_LOCK],
+        [OS.GDK_Num_Lock,       DWT.NUM_LOCK],
+        [OS.GDK_Scroll_Lock,        DWT.SCROLL_LOCK],
+        [OS.GDK_Pause,              DWT.PAUSE],
+        [OS.GDK_Break,              DWT.BREAK],
+        [OS.GDK_Print,                  DWT.PRINT_SCREEN],
+        [OS.GDK_Help,                   DWT.HELP],
 
     ];
 
@@ -453,7 +453,7 @@
  * marked as the <em>default</em> display.
  * </p>
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if called from a thread that already created an existing display</li>
  *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
  * </ul>
@@ -479,18 +479,18 @@
     flushRect = new GdkRectangle ();
     exposeEvent = new XExposeEvent ();
     visibilityEvent = new XVisibilityEvent ();
-    cursors = new Cursor [SWT.CURSOR_HAND + 1];
+    cursors = new Cursor [DWT.CURSOR_HAND + 1];
 }
 
 /**
  * Adds the listener to the collection of listeners who will
  * be notified when an event of the given type occurs anywhere
  * in a widget. The event type is one of the event constants
- * defined in class <code>SWT</code>. When the event does occur,
+ * defined in class <code>DWT</code>. When the event does occur,
  * the listener is notified by sending it the <code>handleEvent()</code>
  * message.
  * <p>
- * Setting the type of an event to <code>SWT.None</code> from
+ * Setting the type of an event to <code>DWT.None</code> from
  * within the <code>handleEvent()</code> method can be used to
  * change the event type and stop subsequent Java listeners
  * from running. Because event filters run before other listeners,
@@ -506,13 +506,13 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
  * @see Listener
- * @see SWT
+ * @see DWT
  * @see #removeFilter
  * @see #removeListener
  *
@@ -520,7 +520,7 @@
  */
 public void addFilter (int eventType, Listener listener) {
     checkDevice ();
-    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (listener is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (filterTable is null) filterTable = new EventTable ();
     filterTable.hook (eventType, listener);
 }
@@ -567,7 +567,7 @@
 /**
  * Adds the listener to the collection of listeners who will
  * be notified when an event of the given type occurs. The event
- * type is one of the event constants defined in class <code>SWT</code>.
+ * type is one of the event constants defined in class <code>DWT</code>.
  * When the event does occur in the display, the listener is notified by
  * sending it the <code>handleEvent()</code> message.
  *
@@ -577,20 +577,20 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
  * @see Listener
- * @see SWT
+ * @see DWT
  * @see #removeListener
  *
  * @since 2.0
  */
 public void addListener (int eventType, Listener listener) {
     checkDevice ();
-    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (listener is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (eventTable is null) eventTable = new EventTable ();
     eventTable.hook (eventType, listener);
 }
@@ -681,14 +681,14 @@
  *
  * @param runnable code to run on the user-interface thread or <code>null</code>
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
  * @see #syncExec
  */
 public void asyncExec (Runnable runnable) {
-    if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+    if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED);
     synchronized (idleLock) {
         if (idleNeeded && idleHandle is 0) {
             //NOTE: calling unlocked function in OS
@@ -702,13 +702,13 @@
  * Causes the system hardware to emit a short sound
  * (if it supports this capability).
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
 public void beep () {
-    if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    if (!isValidThread ()) error (DWT.ERROR_THREAD_INVALID_ACCESS);
     OS.gdk_beep();
     if (!OS.GDK_WINDOWING_X11 ()) {
         OS.gdk_flush ();
@@ -725,16 +725,16 @@
 }
 
 protected void checkDevice () {
-    if (thread is null) error (SWT.ERROR_WIDGET_DISPOSED);
-    if (thread !is Thread.getThis ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
-    if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+    if (thread is null) error (DWT.ERROR_WIDGET_DISPOSED);
+    if (thread !is Thread.getThis ()) error (DWT.ERROR_THREAD_INVALID_ACCESS);
+    if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED);
 }
 
 static synchronized void checkDisplay (Thread thread, bool multiple) {
     for (int i=0; i<Displays.length; i++) {
         if (Displays [i] !is null) {
-            if (!multiple) SWT.error (SWT.ERROR_NOT_IMPLEMENTED, null, " [multiple displays]");
-            if (Displays [i].thread is thread) SWT.error (SWT.ERROR_THREAD_INVALID_ACCESS);
+            if (!multiple) DWT.error (DWT.ERROR_NOT_IMPLEMENTED, null, " [multiple displays]");
+            if (Displays [i].thread is thread) DWT.error (DWT.ERROR_THREAD_INVALID_ACCESS);
         }
     }
 }
@@ -808,21 +808,21 @@
  * IMPORTANT: See the comment in <code>Widget.checkSubclass()</code>.
  * </p>
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
  * </ul>
  *
  * @see Widget#checkSubclass
  */
 protected void checkSubclass () {
-//PORTING_TODO  if (!isValidClass (getClass ())) error (SWT.ERROR_INVALID_SUBCLASS);
+//PORTING_TODO  if (!isValidClass (getClass ())) error (DWT.ERROR_INVALID_SUBCLASS);
 }
 
 /**
- * Requests that the connection between SWT and the underlying
+ * Requests that the connection between DWT and the underlying
  * operating system be closed.
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -834,7 +834,7 @@
 public void close () {
     checkDevice ();
     Event event = new Event ();
-    sendEvent (SWT.Close, event);
+    sendEvent (DWT.Close, event);
     if (event.doit) dispose ();
 }
 
@@ -866,14 +866,14 @@
     OS.gtk_set_locale();
     int cnt = 0;
     if (!OS.gtk_init_check (&cnt, null)) {
-        SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
+        DWT.error (DWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
     }
     if (OS.GDK_WINDOWING_X11 ()) xDisplay = cast(void*) OS.GDK_DISPLAY ();
     char* ptr = OS.gtk_check_version (MAJOR, MINOR, MICRO);
     if (ptr !is null) {
         char [] buffer = fromUtf8z(ptr);
         Stdout.formatln ("***WARNING: {}", buffer );
-        Stdout.formatln ("***WARNING: SWT requires GTK {}.{}.{}", MAJOR, MINOR, MICRO );
+        Stdout.formatln ("***WARNING: DWT requires GTK {}.{}.{}", MAJOR, MINOR, MICRO );
         int major = OS.gtk_major_version (), minor = OS.gtk_minor_version (), micro = OS.gtk_micro_version ();
         Stdout.formatln ("***WARNING: Detected: {}.{}.{}", major, minor, micro);
     }
@@ -915,7 +915,7 @@
 
     /* Initialize the hidden shell */
     shellHandle = OS.gtk_window_new (OS.GTK_WINDOW_TOPLEVEL);
-    if (shellHandle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    if (shellHandle is null) DWT.error (DWT.ERROR_NO_HANDLES);
     OS.gtk_widget_realize (shellHandle);
 
     /* Initialize the filter and event callback */
@@ -987,10 +987,10 @@
     bool hasMask = image.mask !is null && OS.gdk_drawable_get_depth (image.mask) is 1;
     if (hasMask) {
         pixbuf = OS.gdk_pixbuf_new (OS.GDK_COLORSPACE_RGB, true, 8, w, h );
-        if (pixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        if (pixbuf is null) DWT.error (DWT.ERROR_NO_HANDLES);
         OS.gdk_pixbuf_get_from_drawable (pixbuf, image.pixmap, colormap, 0, 0, 0, 0, w, h);
         auto maskPixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, w, h);
-        if (maskPixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        if (maskPixbuf is null) DWT.error (DWT.ERROR_NO_HANDLES);
         OS.gdk_pixbuf_get_from_drawable(maskPixbuf, image.mask, null, 0, 0, 0, 0, w, h);
         int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
         auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
@@ -1013,9 +1013,9 @@
         OS.g_object_unref(maskPixbuf);
     } else {
         ImageData data = image.getImageData ();
-        bool hasAlpha = data.getTransparencyType () is SWT.TRANSPARENCY_ALPHA;
+        bool hasAlpha = data.getTransparencyType () is DWT.TRANSPARENCY_ALPHA;
         pixbuf = OS.gdk_pixbuf_new (OS.GDK_COLORSPACE_RGB, hasAlpha, 8, w, h);
-        if (pixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        if (pixbuf is null) DWT.error (DWT.ERROR_NO_HANDLES);
         OS.gdk_pixbuf_get_from_drawable (pixbuf, image.pixmap, colormap, 0, 0, 0, 0, w, h);
         if (hasAlpha) {
             byte [] alpha = data.alphaData;
@@ -1088,7 +1088,7 @@
  *
  * @param runnable code to run at dispose time.
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1110,14 +1110,14 @@
 
 /**
  * Does whatever display specific cleanup is required, and then
- * uses the code in <code>SWTError.error</code> to handle the error.
+ * uses the code in <code>DWTError.error</code> to handle the error.
  *
  * @param code the descriptive error code
  *
- * @see SWTError#error
+ * @see DWTError#error
  */
 void error (int code) {
-    SWT.error (code);
+    DWT.error (code);
 }
 
 private static extern(C) void eventProcFunc (GdkEvent* event, void* data) {
@@ -1201,7 +1201,7 @@
         }
         if (control !is null) {
             shell = control.getShell ();
-            if ((shell.style & SWT.ON_TOP) !is 0) {
+            if ((shell.style & DWT.ON_TOP) !is 0) {
                 OS.gtk_grab_add (shell.shellHandle);
             }
         }
@@ -1209,7 +1209,7 @@
     OS.gtk_main_do_event (event);
     if (dispatchEvents is null) putGdkEvents ();
     if (control !is null) {
-        if (shell !is null && !shell.isDisposed () && (shell.style & SWT.ON_TOP) !is 0) {
+        if (shell !is null && !shell.isDisposed () && (shell.style & DWT.ON_TOP) !is 0) {
             OS.gtk_grab_remove (shell.shellHandle);
         }
     }
@@ -1227,9 +1227,9 @@
  * </p>
  *
  * @param handle the handle for the widget
- * @return the SWT widget that the handle represents
+ * @return the DWT widget that the handle represents
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1252,9 +1252,9 @@
  *
  * @param handle the handle for the widget
  * @param id the id for the subwidget (usually an item)
- * @return the SWT widget that the handle/id pair represents
+ * @return the DWT widget that the handle/id pair represents
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1274,9 +1274,9 @@
  *
  * @param widget the widget
  * @param id the id for the subwidget (usually an item)
- * @return the SWT subwidget (usually an item) that the widget/id pair represents
+ * @return the DWT subwidget (usually an item) that the widget/id pair represents
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1341,7 +1341,7 @@
  *
  * @return the active shell or null
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1356,7 +1356,7 @@
  *
  * @return the bounding rectangle
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1406,7 +1406,7 @@
  *
  * @return the control under the cursor
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1453,9 +1453,9 @@
         /*
          * Feature in GTK.  When button 4, 5, 6, or 7 is released, GTK
          * does not deliver a corresponding GTK event.  Button 6 and 7
-         * are mapped to buttons 4 and 5 in SWT.  The fix is to change
+         * are mapped to buttons 4 and 5 in DWT.  The fix is to change
          * the button number of the event to a negative number so that
-         * it gets dispatched by GTK.  SWT has been modified to look
+         * it gets dispatched by GTK.  DWT has been modified to look
          * for negative button numbers.
          */
         XButtonEvent* mouseEvent = cast(XButtonEvent*) xEvent;
@@ -1480,7 +1480,7 @@
  *
  * @return the cursor location
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1497,7 +1497,7 @@
  *
  * @return the array of cursor sizes
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1526,7 +1526,7 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the key is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1536,7 +1536,7 @@
  */
 public Object getData (char[] key) {
     checkDevice ();
-    if (key is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (key is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (key ==/*eq*/ DISPATCH_EVENT_KEY) {
         return new ArrayWrapperInt(dispatchEvents);
     }
@@ -1562,7 +1562,7 @@
  *
  * @return the display specific data
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1582,7 +1582,7 @@
  *
  * @return the horizontal and vertical DPI
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
@@ -1639,7 +1639,7 @@
  *
  * @return the button dismissal order
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1648,7 +1648,7 @@
  */
 public int getDismissalAlignment () {
     checkDevice ();
-    return SWT.RIGHT;
+    return DWT.RIGHT;
 }
 
 /**
@@ -1658,7 +1658,7 @@
  *
  * @return the double click time
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1679,7 +1679,7 @@
  *
  * @return the control under the cursor
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1713,7 +1713,7 @@
  *
  * @return the high contrast mode
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1737,7 +1737,7 @@
  *
  * @return the maximum icon depth
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1754,7 +1754,7 @@
  *
  * @return the array of icon sizes
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1888,7 +1888,7 @@
  *
  * @return the receiver's shells
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -1932,20 +1932,20 @@
  *
  * @return the receiver's sync-interface thread
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
 public Thread getSyncThread () {
-    if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+    if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED);
     return synchronizer.syncThread;
 }
 
 /**
  * Returns the matching standard color for the given
  * constant, which should be one of the color constants
- * specified in class <code>SWT</code>. Any value other
- * than one of the SWT color constants which is passed
+ * specified in class <code>DWT</code>. Any value other
+ * than one of the DWT color constants which is passed
  * in will result in the color black. This color should
  * not be free'd because it was allocated by the system,
  * not the application.
@@ -1953,82 +1953,82 @@
  * @param id the color constant
  * @return the matching color
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
- * @see SWT
+ * @see DWT
  */
 public Color getSystemColor (int id) {
     checkDevice ();
     GdkColor* gdkColor = null;
     switch (id) {
-        case SWT.COLOR_INFO_FOREGROUND:                     gdkColor = COLOR_INFO_FOREGROUND; break;
-        case SWT.COLOR_INFO_BACKGROUND:                     gdkColor = COLOR_INFO_BACKGROUND; break;
-        case SWT.COLOR_TITLE_FOREGROUND:                    gdkColor = COLOR_TITLE_FOREGROUND; break;
-        case SWT.COLOR_TITLE_BACKGROUND:                    gdkColor = COLOR_TITLE_BACKGROUND; break;
-        case SWT.COLOR_TITLE_BACKGROUND_GRADIENT:           gdkColor = COLOR_TITLE_BACKGROUND_GRADIENT; break;
-        case SWT.COLOR_TITLE_INACTIVE_FOREGROUND:           gdkColor = COLOR_TITLE_INACTIVE_FOREGROUND; break;
-        case SWT.COLOR_TITLE_INACTIVE_BACKGROUND:           gdkColor = COLOR_TITLE_INACTIVE_BACKGROUND; break;
-        case SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT:  gdkColor = COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT; break;
-        case SWT.COLOR_WIDGET_DARK_SHADOW:                  gdkColor = COLOR_WIDGET_DARK_SHADOW; break;
-        case SWT.COLOR_WIDGET_NORMAL_SHADOW:                gdkColor = COLOR_WIDGET_NORMAL_SHADOW; break;
-        case SWT.COLOR_WIDGET_LIGHT_SHADOW:                 gdkColor = COLOR_WIDGET_LIGHT_SHADOW; break;
-        case SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW:             gdkColor = COLOR_WIDGET_HIGHLIGHT_SHADOW; break;
-        case SWT.COLOR_WIDGET_BACKGROUND:                   gdkColor = COLOR_WIDGET_BACKGROUND; break;
-        case SWT.COLOR_WIDGET_FOREGROUND:                   gdkColor = COLOR_WIDGET_FOREGROUND; break;
-        case SWT.COLOR_WIDGET_BORDER:                       gdkColor = COLOR_WIDGET_BORDER; break;
-        case SWT.COLOR_LIST_FOREGROUND:                     gdkColor = COLOR_LIST_FOREGROUND; break;
-        case SWT.COLOR_LIST_BACKGROUND:                     gdkColor = COLOR_LIST_BACKGROUND; break;
-        case SWT.COLOR_LIST_SELECTION:                      gdkColor = COLOR_LIST_SELECTION; break;
-        case SWT.COLOR_LIST_SELECTION_TEXT:                 gdkColor = COLOR_LIST_SELECTION_TEXT; break;
+        case DWT.COLOR_INFO_FOREGROUND:                     gdkColor = COLOR_INFO_FOREGROUND; break;
+        case DWT.COLOR_INFO_BACKGROUND:                     gdkColor = COLOR_INFO_BACKGROUND; break;
+        case DWT.COLOR_TITLE_FOREGROUND:                    gdkColor = COLOR_TITLE_FOREGROUND; break;
+        case DWT.COLOR_TITLE_BACKGROUND:                    gdkColor = COLOR_TITLE_BACKGROUND; break;
+        case DWT.COLOR_TITLE_BACKGROUND_GRADIENT:           gdkColor = COLOR_TITLE_BACKGROUND_GRADIENT; break;
+        case DWT.COLOR_TITLE_INACTIVE_FOREGROUND:           gdkColor = COLOR_TITLE_INACTIVE_FOREGROUND; break;
+        case DWT.COLOR_TITLE_INACTIVE_BACKGROUND:           gdkColor = COLOR_TITLE_INACTIVE_BACKGROUND; break;
+        case DWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT:  gdkColor = COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT; break;
+        case DWT.COLOR_WIDGET_DARK_SHADOW:                  gdkColor = COLOR_WIDGET_DARK_SHADOW; break;
+        case DWT.COLOR_WIDGET_NORMAL_SHADOW:                gdkColor = COLOR_WIDGET_NORMAL_SHADOW; break;
+        case DWT.COLOR_WIDGET_LIGHT_SHADOW:                 gdkColor = COLOR_WIDGET_LIGHT_SHADOW; break;
+        case DWT.COLOR_WIDGET_HIGHLIGHT_SHADOW:             gdkColor = COLOR_WIDGET_HIGHLIGHT_SHADOW; break;
+        case DWT.COLOR_WIDGET_BACKGROUND:                   gdkColor = COLOR_WIDGET_BACKGROUND; break;
+        case DWT.COLOR_WIDGET_FOREGROUND:                   gdkColor = COLOR_WIDGET_FOREGROUND; break;
+        case DWT.COLOR_WIDGET_BORDER:                       gdkColor = COLOR_WIDGET_BORDER; break;
+        case DWT.COLOR_LIST_FOREGROUND:                     gdkColor = COLOR_LIST_FOREGROUND; break;
+        case DWT.COLOR_LIST_BACKGROUND:                     gdkColor = COLOR_LIST_BACKGROUND; break;
+        case DWT.COLOR_LIST_SELECTION:                      gdkColor = COLOR_LIST_SELECTION; break;
+        case DWT.COLOR_LIST_SELECTION_TEXT:                 gdkColor = COLOR_LIST_SELECTION_TEXT; break;
         default:
             return super.getSystemColor (id);
     }
-    if (gdkColor is null) return super.getSystemColor (SWT.COLOR_BLACK);
+    if (gdkColor is null) return super.getSystemColor (DWT.COLOR_BLACK);
     return Color.gtk_new (this, gdkColor);
 }
 
 /**
  * Returns the matching standard platform cursor for the given
  * constant, which should be one of the cursor constants
- * specified in class <code>SWT</code>. This cursor should
+ * specified in class <code>DWT</code>. This cursor should
  * not be free'd because it was allocated by the system,
  * not the application.  A value of <code>null</code> will
- * be returned if the supplied constant is not an SWT cursor
+ * be returned if the supplied constant is not an DWT cursor
  * constant.
  *
- * @param id the SWT cursor constant
+ * @param id the DWT cursor constant
  * @return the corresponding cursor or <code>null</code>
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
- * @see SWT#CURSOR_ARROW
- * @see SWT#CURSOR_WAIT
- * @see SWT#CURSOR_CROSS
- * @see SWT#CURSOR_APPSTARTING
- * @see SWT#CURSOR_HELP
- * @see SWT#CURSOR_SIZEALL
- * @see SWT#CURSOR_SIZENESW
- * @see SWT#CURSOR_SIZENS
- * @see SWT#CURSOR_SIZENWSE
- * @see SWT#CURSOR_SIZEWE
- * @see SWT#CURSOR_SIZEN
- * @see SWT#CURSOR_SIZES
- * @see SWT#CURSOR_SIZEE
- * @see SWT#CURSOR_SIZEW
- * @see SWT#CURSOR_SIZENE
- * @see SWT#CURSOR_SIZESE
- * @see SWT#CURSOR_SIZESW
- * @see SWT#CURSOR_SIZENW
- * @see SWT#CURSOR_UPARROW
- * @see SWT#CURSOR_IBEAM
- * @see SWT#CURSOR_NO
- * @see SWT#CURSOR_HAND
+ * @see DWT#CURSOR_ARROW
+ * @see DWT#CURSOR_WAIT
+ * @see DWT#CURSOR_CROSS
+ * @see DWT#CURSOR_APPSTARTING
+ * @see DWT#CURSOR_HELP
+ * @see DWT#CURSOR_SIZEALL
+ * @see DWT#CURSOR_SIZENESW
+ * @see DWT#CURSOR_SIZENS
+ * @see DWT#CURSOR_SIZENWSE
+ * @see DWT#CURSOR_SIZEWE
+ * @see DWT#CURSOR_SIZEN
+ * @see DWT#CURSOR_SIZES
+ * @see DWT#CURSOR_SIZEE
+ * @see DWT#CURSOR_SIZEW
+ * @see DWT#CURSOR_SIZENE
+ * @see DWT#CURSOR_SIZESE
+ * @see DWT#CURSOR_SIZESW
+ * @see DWT#CURSOR_SIZENW
+ * @see DWT#CURSOR_UPARROW
+ * @see DWT#CURSOR_IBEAM
+ * @see DWT#CURSOR_NO
+ * @see DWT#CURSOR_HAND
  *
  * @since 3.0
  */
@@ -2044,49 +2044,49 @@
 /**
  * Returns the matching standard platform image for the given
  * constant, which should be one of the icon constants
- * specified in class <code>SWT</code>. This image should
+ * specified in class <code>DWT</code>. This image should
  * not be free'd because it was allocated by the system,
  * not the application.  A value of <code>null</code> will
  * be returned either if the supplied constant is not an
- * SWT icon constant or if the platform does not define an
+ * DWT icon constant or if the platform does not define an
  * image that corresponds to the constant.
  *
- * @param id the SWT icon constant
+ * @param id the DWT icon constant
  * @return the corresponding image or <code>null</code>
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
- * @see SWT#ICON_ERROR
- * @see SWT#ICON_INFORMATION
- * @see SWT#ICON_QUESTION
- * @see SWT#ICON_WARNING
- * @see SWT#ICON_WORKING
+ * @see DWT#ICON_ERROR
+ * @see DWT#ICON_INFORMATION
+ * @see DWT#ICON_QUESTION
+ * @see DWT#ICON_WARNING
+ * @see DWT#ICON_WORKING
  *
  * @since 3.0
  */
 public Image getSystemImage (int id) {
     checkDevice ();
     switch (id) {
-        case SWT.ICON_ERROR:
+        case DWT.ICON_ERROR:
             if (errorImage is null) {
                 errorImage = createImage ("gtk-dialog-error");
             }
             return errorImage;
-        case SWT.ICON_INFORMATION:
-        case SWT.ICON_WORKING:
+        case DWT.ICON_INFORMATION:
+        case DWT.ICON_WORKING:
             if (infoImage is null) {
                 infoImage = createImage ("gtk-dialog-info");
             }
             return infoImage;
-        case SWT.ICON_QUESTION:
+        case DWT.ICON_QUESTION:
             if (questionImage is null) {
                 questionImage = createImage ("gtk-dialog-question");
             }
             return questionImage;
-        case SWT.ICON_WARNING:
+        case DWT.ICON_WARNING:
             if (warningImage is null) {
                 warningImage = createImage ("gtk-dialog-warning");
             }
@@ -2101,7 +2101,7 @@
 
     /* Get Tooltip resources */
     auto tooltipShellHandle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
-    if (tooltipShellHandle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    if (tooltipShellHandle is null) DWT.error (DWT.ERROR_NO_HANDLES);
 //  byte[] gtk_tooltips = Converter.wcsToMbcs (null, "gtk-tooltips", true);
     OS.gtk_widget_set_name (tooltipShellHandle, "gtk-tooltips".ptr );
     OS.gtk_widget_realize (tooltipShellHandle);
@@ -2188,7 +2188,7 @@
  *
  * @return a font
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -2207,7 +2207,7 @@
  *
  * @return the system tray or <code>null</code>
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
@@ -2216,7 +2216,7 @@
 public Tray getSystemTray () {
     checkDevice ();
     if (tray !is null) return tray;
-    return tray = new Tray (this, SWT.NONE);
+    return tray = new Tray (this, DWT.NONE);
 }
 
 /**
@@ -2224,12 +2224,12 @@
  *
  * @return the receiver's user-interface thread
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
 public Thread getThread () {
-    if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+    if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED);
     return thread;
 }
 
@@ -2452,7 +2452,7 @@
  * <p>
  * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
  * API for <code>Display</code>. It is marked public only so that it
- * can be shared within the packages provided by SWT. It is not
+ * can be shared within the packages provided by DWT. It is not
  * available on all platforms, and should never be called from
  * application code.
  * </p>
@@ -2469,7 +2469,7 @@
  * <p>
  * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
  * API for <code>Display</code>. It is marked public only so that it
- * can be shared within the packages provided by SWT. It is not
+ * can be shared within the packages provided by DWT. It is not
  * available on all platforms, and should never be called from
  * application code.
  * </p>
@@ -2477,28 +2477,28 @@
  * @param data the platform specific GC data
  * @return the platform specific GC handle
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
- * @exception SWTError <ul>
+ * @exception DWTError <ul>
  *    <li>ERROR_NO_HANDLES if a handle could not be obtained for gc creation</li>
  * </ul>
  */
 public GdkGC* internal_new_GC (GCData data) {
-    if (isDisposed()) SWT.error(SWT.ERROR_DEVICE_DISPOSED);
+    if (isDisposed()) DWT.error(DWT.ERROR_DEVICE_DISPOSED);
     auto root = cast(GdkDrawable *) OS.GDK_ROOT_PARENT ();
     auto gdkGC = OS.gdk_gc_new (root);
-    if (gdkGC is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    if (gdkGC is null) DWT.error (DWT.ERROR_NO_HANDLES);
     OS.gdk_gc_set_subwindow (gdkGC, OS.GDK_INCLUDE_INFERIORS);
     if (data !is null) {
-        int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+        int mask = DWT.LEFT_TO_RIGHT | DWT.RIGHT_TO_LEFT;
         if ((data.style & mask) is 0) {
-            data.style |= SWT.LEFT_TO_RIGHT;
+            data.style |= DWT.LEFT_TO_RIGHT;
         }
         data.device = this;
         data.drawable = root;
-        data.background = getSystemColor (SWT.COLOR_WHITE).handle;
-        data.foreground = getSystemColor (SWT.COLOR_BLACK).handle;
+        data.background = getSystemColor (DWT.COLOR_WHITE).handle;
+        data.foreground = getSystemColor (DWT.COLOR_BLACK).handle;
         data.font = getSystemFont ().handle;
     }
     return gdkGC;
@@ -2538,7 +2538,7 @@
  *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
  *    <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -2547,7 +2547,7 @@
  */
 public Point map (Control from, Control to, Point point) {
     checkDevice ();
-    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (point is null) error (DWT.ERROR_NULL_ARGUMENT);
     return map (from, to, point.x, point.y);
 }
 
@@ -2580,7 +2580,7 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -2589,8 +2589,8 @@
  */
 public Point map (Control from, Control to, int x, int y) {
     checkDevice ();
-    if (from !is null && from.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
-    if (to !is null && to.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    if (from !is null && from.isDisposed()) error (DWT.ERROR_INVALID_ARGUMENT);
+    if (to !is null && to.isDisposed()) error (DWT.ERROR_INVALID_ARGUMENT);
     Point point = new Point (x, y);
     if (from is to) return point;
     if (from !is null) {
@@ -2639,7 +2639,7 @@
  *    <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li>
  *    <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -2648,7 +2648,7 @@
  */
 public Rectangle map (Control from, Control to, Rectangle rectangle) {
     checkDevice();
-    if (rectangle is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (rectangle is null) error (DWT.ERROR_NULL_ARGUMENT);
     return map (from, to, rectangle.x, rectangle.y, rectangle.width, rectangle.height);
 }
 
@@ -2725,7 +2725,7 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -2734,8 +2734,8 @@
  */
 public Rectangle map (Control from, Control to, int x, int y, int width, int height) {
     checkDevice();
-    if (from !is null && from.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
-    if (to !is null && to.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    if (from !is null && from.isDisposed()) error (DWT.ERROR_INVALID_ARGUMENT);
+    if (to !is null && to.isDisposed()) error (DWT.ERROR_INVALID_ARGUMENT);
     Rectangle rect = new Rectangle (x, y, width, height);
     if (from is to) return rect;
     if (from !is null) {
@@ -2772,7 +2772,7 @@
  * <code>post</code> is used to generate low level keyboard
  * and mouse events. The intent is to enable automated UI
  * testing by simulating the input from the user.  Most
- * SWT applications should never need to call this method.
+ * DWT applications should never need to call this method.
  * <p>
  * Note that this operation can fail when the operating system
  * fails to generate the event for any reason.  For example,
@@ -2788,7 +2788,7 @@
  * <p> Either one of:
  * <li>(in) character a character that corresponds to a keyboard key</li>
  * <li>(in) keyCode the key code of the key that was typed,
- *          as defined by the key code constants in class <code>SWT</code></li>
+ *          as defined by the key code constants in class <code>DWT</code></li>
  * </ul>
  * <p>MouseDown, MouseUp</p>
  * <p>The following fields in the <code>Event</code> apply:
@@ -2812,7 +2812,7 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the event is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
@@ -2820,39 +2820,39 @@
  *
  */
 public bool post (Event event) {
-    if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
-    if (event is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED);
+    if (event is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (!OS.GDK_WINDOWING_X11()) return false;
     auto xDisplay = OS.GDK_DISPLAY ();
     int type = event.type;
     switch (type) {
-        case SWT.KeyDown:
-        case SWT.KeyUp: {
+        case DWT.KeyDown:
+        case DWT.KeyUp: {
             int keyCode = 0;
             auto keysym = untranslateKey (event.keyCode);
             if (keysym !is 0) keyCode = OS.XKeysymToKeycode (xDisplay, keysym);
             if (keyCode is 0) {
                 char key = event.character;
                 switch (key) {
-                    case SWT.BS: keysym = OS.GDK_BackSpace; break;
-                    case SWT.CR: keysym = OS.GDK_Return; break;
-                    case SWT.DEL: keysym = OS.GDK_Delete; break;
-                    case SWT.ESC: keysym = OS.GDK_Escape; break;
-                    case SWT.TAB: keysym = OS.GDK_Tab; break;
-                    case SWT.LF: keysym = OS.GDK_Linefeed; break;
+                    case DWT.BS: keysym = OS.GDK_BackSpace; break;
+                    case DWT.CR: keysym = OS.GDK_Return; break;
+                    case DWT.DEL: keysym = OS.GDK_Delete; break;
+                    case DWT.ESC: keysym = OS.GDK_Escape; break;
+                    case DWT.TAB: keysym = OS.GDK_Tab; break;
+                    case DWT.LF: keysym = OS.GDK_Linefeed; break;
                     default:
                         keysym = wcsToMbcs (key);
                 }
                 keyCode = OS.XKeysymToKeycode (xDisplay, keysym);
                 if (keyCode is 0) return false;
             }
-            OS.XTestFakeKeyEvent (xDisplay, keyCode, type is SWT.KeyDown, 0);
+            OS.XTestFakeKeyEvent (xDisplay, keyCode, type is DWT.KeyDown, 0);
             return true;
         }
-        case SWT.MouseDown:
-        case SWT.MouseMove:
-        case SWT.MouseUp: {
-            if (type is SWT.MouseMove) {
+        case DWT.MouseDown:
+        case DWT.MouseMove:
+        case DWT.MouseUp: {
+            if (type is DWT.MouseMove) {
                 OS.XTestFakeMotionEvent (xDisplay, -1, event.x, event.y, 0);
             } else {
                 int button = event.button;
@@ -2864,7 +2864,7 @@
                     case 5: button = 7; break;
                     default: return false;
                 }
-                OS.XTestFakeButtonEvent (xDisplay, button, type is SWT.MouseDown, 0);
+                OS.XTestFakeButtonEvent (xDisplay, button, type is DWT.MouseDown, 0);
             }
             return true;
         default:
@@ -2874,10 +2874,10 @@
         * mouse wheel event the system may respond unpredictably
         * to subsequent mouse actions.
         */
-//      case SWT.MouseWheel: {
+//      case DWT.MouseWheel: {
 //          if (event.count is 0) return false;
 //          int button = event.count < 0 ? 5 : 4;
-//          OS.XTestFakeButtonEvent (xDisplay, button, type is SWT.MouseWheel, 0);
+//          OS.XTestFakeButtonEvent (xDisplay, button, type is DWT.MouseWheel, 0);
 //      }
     }
     return false;
@@ -2936,7 +2936,7 @@
  *
  * @return <code>false</code> if the caller can sleep upon return from this method
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message</li>
@@ -2996,7 +2996,7 @@
  * @see #destroy
  */
 protected void release () {
-    sendEvent (SWT.Dispose, new Event ());
+    sendEvent (DWT.Dispose, new Event ());
     Shell [] shells = getShells ();
     for (int i=0; i<shells.length; i++) {
         Shell shell = shells [i];
@@ -3126,7 +3126,7 @@
  * Removes the listener from the collection of listeners who will
  * be notified when an event of the given type occurs anywhere in
  * a widget. The event type is one of the event constants defined
- * in class <code>SWT</code>.
+ * in class <code>DWT</code>.
  *
  * @param eventType the type of event to listen for
  * @param listener the listener which should no longer be notified when the event occurs
@@ -3134,12 +3134,12 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  *
  * @see Listener
- * @see SWT
+ * @see DWT
  * @see #addFilter
  * @see #addListener
  *
@@ -3147,7 +3147,7 @@
  */
 public void removeFilter (int eventType, Listener listener) {
     checkDevice ();
-    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (listener is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (filterTable is null) return;
     filterTable.unhook (eventType, listener);
     if (filterTable.size () is 0) filterTable = null;
@@ -3178,7 +3178,7 @@
 /**
  * Removes the listener from the collection of listeners who will
  * be notified when an event of the given type occurs. The event type
- * is one of the event constants defined in class <code>SWT</code>.
+ * is one of the event constants defined in class <code>DWT</code>.
  *
  * @param eventType the type of event to listen for
  * @param listener the listener which should no longer be notified when the event occurs
@@ -3186,20 +3186,20 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
  * @see Listener
- * @see SWT
+ * @see DWT
  * @see #addListener
  *
  * @since 2.0
  */
 public void removeListener (int eventType, Listener listener) {
     checkDevice ();
-    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (listener is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (eventTable is null) return;
     eventTable.unhook (eventType, listener);
 }
@@ -3298,7 +3298,7 @@
     runSettingsFld = false;
     saveResources ();
     initializeSystemColors ();
-    sendEvent (SWT.Settings, null);
+    sendEvent (DWT.Settings, null);
     Shell [] shells = getShells ();
     for (int i=0; i<shells.length; i++) {
         Shell shell = shells [i];
@@ -3331,7 +3331,7 @@
  * @param x the new x coordinate for the cursor
  * @param y the new y coordinate for the cursor
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -3354,7 +3354,7 @@
  *
  * @param point new position
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_NULL_ARGUMENT - if the point is null
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
@@ -3364,7 +3364,7 @@
  */
 public void setCursorLocation (Point point) {
     checkDevice ();
-    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (point is null) error (DWT.ERROR_NULL_ARGUMENT);
     setCursorLocation (point.x, point.y);
 }
 
@@ -3385,7 +3385,7 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the key is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -3395,7 +3395,7 @@
  */
 public void setData (char[] key, Object value) {
     checkDevice ();
-    if (key is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (key is null) error (DWT.ERROR_NULL_ARGUMENT);
 
     if (key==/*eq*/ DISPATCH_EVENT_KEY) {
         ArrayWrapperInt wrappedValue;
@@ -3408,7 +3408,7 @@
 
     if (key==/*eq*/ ADD_WIDGET_KEY) {
         auto wrap = cast(ArrayWrapperObject) value;
-        if( wrap is null ) SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, " []");
+        if( wrap is null ) DWT.error(DWT.ERROR_INVALID_ARGUMENT, null, " []");
         Object [] data = wrap.array;
         auto handle = (cast(LONG) data [0]).value;
         Widget widget = cast(Widget) data [1];
@@ -3487,7 +3487,7 @@
  *
  * @param data the new display specific data
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -3521,7 +3521,7 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the synchronizer is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  *    <li>ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message</li>
@@ -3529,7 +3529,7 @@
  */
 public void setSynchronizer (Synchronizer synchronizer) {
     checkDevice ();
-    if (synchronizer is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (synchronizer is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (this.synchronizer !is null) {
         this.synchronizer.runAsyncMessages(true);
     }
@@ -3540,9 +3540,9 @@
     imControl = control;
     if (preeditWindow is null) {
         preeditWindow = cast(GtkWindow*)OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
-        if (preeditWindow is null) error (SWT.ERROR_NO_HANDLES);
+        if (preeditWindow is null) error (DWT.ERROR_NO_HANDLES);
         preeditLabel = cast(GtkLabel*) OS.gtk_label_new (null);
-        if (preeditLabel is null) error (SWT.ERROR_NO_HANDLES);
+        if (preeditLabel is null) error (DWT.ERROR_NO_HANDLES);
         OS.gtk_container_add (cast(GtkContainer*)preeditWindow, cast(GtkWidget*) preeditLabel);
         OS.gtk_widget_show (cast(GtkWidget*)preeditLabel);
     }
@@ -3578,7 +3578,7 @@
  *
  * @return <code>true</code> if an event requiring dispatching was placed on the queue.
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -3662,7 +3662,7 @@
  * @exception IllegalArgumentException <ul>
  *    <li>ERROR_NULL_ARGUMENT - if the runnable is null</li>
  * </ul>
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -3671,7 +3671,7 @@
  */
 public void timerExec (int milliseconds, Runnable runnable) {
     checkDevice ();
-    if (runnable is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (runnable is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (timerList is null) timerList = new Runnable [4];
     if (timerIds is null) timerIds = new int [4];
     int index = 0;
@@ -3897,7 +3897,7 @@
  *
  * @param runnable code to run on the user-interface thread or <code>null</code>
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_FAILED_EXEC - if an exception occurred when executing the runnable</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -3905,7 +3905,7 @@
  * @see #asyncExec
  */
 public void syncExec (Runnable runnable) {
-    if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+    if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED);
     synchronized (idleLock) {
         if (idleNeeded && idleHandle is 0) {
             //NOTE: calling unlocked function in OS
@@ -3936,7 +3936,7 @@
  * Forces all outstanding paint requests for the display
  * to be processed before this method returns.
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
@@ -3954,14 +3954,14 @@
  * causes it to be awakened and start running again. Note that this
  * method may be called from any thread.
  *
- * @exception SWTException <ul>
+ * @exception DWTException <ul>
  *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  *
  * @see #sleep
  */
 public void wake () {
-    if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+    if (isDisposed ()) error (DWT.ERROR_DEVICE_DISPOSED);
     if (thread is Thread.getThis ()) return;
     wakeThread ();
 }