changeset 7:e831403a80a9

Add 'cast' to casts
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:30:35 +0200
parents b903c16b6f48
children a9ab4c738ed8
files dwt/browser/AppFileLocProvider.d dwt/browser/Download.d dwt/browser/DownloadFactory.d dwt/browser/DownloadFactory_1_8.d dwt/browser/Download_1_8.d dwt/browser/FilePicker.d dwt/browser/FilePickerFactory.d dwt/browser/FilePickerFactory_1_8.d dwt/browser/FilePicker_1_8.d dwt/browser/HelperAppLauncherDialog.d dwt/browser/HelperAppLauncherDialogFactory.d dwt/browser/InputStream.d dwt/browser/Mozilla.d dwt/browser/MozillaDelegate.d dwt/browser/PromptService2.d dwt/browser/PromptService2Factory.d dwt/browser/WindowCreator2.d dwt/browser/WindowEvent.d dwt/custom/CBanner.d dwt/custom/CTabItem.d dwt/custom/DefaultContent.d dwt/custom/SashForm.d dwt/custom/SashFormLayout.d dwt/custom/ScrolledComposite.d dwt/custom/ScrolledCompositeLayout.d dwt/custom/StyleRange.d dwt/custom/StyledText.d dwt/custom/StyledTextDropTargetEffect.d dwt/custom/StyledTextListener.d dwt/custom/StyledTextRenderer.d dwt/custom/TableEditor.d dwt/custom/TableTree.d dwt/custom/TableTreeEditor.d dwt/custom/TreeEditor.d dwt/custom/ViewForm.d dwt/custom/ViewFormLayout.d dwt/dnd/Clipboard.d dwt/dnd/DNDListener.d dwt/dnd/DragSource.d dwt/dnd/DropTarget.d dwt/dnd/DropTargetEffect.d dwt/dnd/DropTargetListener.d dwt/dnd/HTMLTransfer.d dwt/dnd/ImageTransfer.d dwt/dnd/RTFTransfer.d dwt/dnd/TableDropTargetEffect.d dwt/dnd/TextTransfer.d dwt/dnd/TreeDropTargetEffect.d dwt/dnd/URLTransfer.d dwt/dwthelper/Runnable.d dwt/dwthelper/System.d dwt/dwthelper/WeakRef.d dwt/dwthelper/utils.d dwt/graphics/Color.d dwt/graphics/Cursor.d dwt/graphics/Device.d dwt/graphics/Drawable.d dwt/graphics/Font.d dwt/graphics/FontData.d dwt/graphics/FontMetrics.d dwt/graphics/GC.d dwt/graphics/GlyphMetrics.d dwt/graphics/Image.d dwt/graphics/ImageData.d dwt/graphics/ImageLoader.d dwt/graphics/Path.d dwt/graphics/Pattern.d dwt/graphics/Point.d dwt/graphics/RGB.d dwt/graphics/Rectangle.d dwt/graphics/Region.d dwt/graphics/TextLayout.d dwt/graphics/TextStyle.d dwt/internal/Library.d dwt/internal/c/callback.d dwt/internal/c/qd/bindings.d dwt/internal/cocoa/CGBase.d dwt/internal/cocoa/CGFloat.d dwt/internal/cocoa/MacGenerator.d dwt/internal/cocoa/NSInteger.d dwt/internal/cocoa/OS.d dwt/internal/cocoa/WebView.d dwt/internal/image/FileFormat.d dwt/internal/image/GIFFileFormat.d dwt/internal/image/JPEGDecoder.d dwt/internal/image/JPEGFileFormat.d dwt/internal/image/JPEGFrameHeader.d dwt/internal/image/JPEGHuffmanTable.d dwt/internal/image/JPEGQuantizationTable.d dwt/internal/image/JPEGScanHeader.d dwt/internal/image/JPEGSegment.d dwt/internal/image/LEDataInputStream.d dwt/internal/image/LZWCodec.d dwt/internal/image/OS2BMPFileFormat.d dwt/internal/image/PNGFileFormat.d dwt/internal/image/PngChunk.d dwt/internal/image/PngChunkReader.d dwt/internal/image/PngDecodingDataStream.d dwt/internal/image/PngDeflater.d dwt/internal/image/PngEncoder.d dwt/internal/image/PngLzBlockReader.d dwt/internal/image/PngPlteChunk.d dwt/internal/image/PngTrnsChunk.d dwt/internal/image/TIFFModifiedHuffmanCodec.d dwt/internal/image/WinBMPFileFormat.d dwt/internal/image/WinICOFileFormat.d dwt/internal/objc/appkit/NSAttributedString.d dwt/internal/objc/appkit/bindings.d dwt/internal/objc/bindings.d dwt/internal/objc/foundation/bindings.d dwt/internal/objc/runtime.d dwt/layout/FillLayout.d dwt/layout/FormData.d dwt/layout/FormLayout.d dwt/layout/GridLayout.d dwt/layout/RowLayout.d dwt/opengl/GLCanvas.d dwt/printing/PrintDialog.d dwt/printing/Printer.d dwt/program/Program.d dwt/widgets/Button.d dwt/widgets/Caret.d dwt/widgets/ColorDialog.d dwt/widgets/Combo.d dwt/widgets/Composite.d dwt/widgets/Control.d dwt/widgets/DateTime.d dwt/widgets/Display.d dwt/widgets/EventTable.d dwt/widgets/FileDialog.d dwt/widgets/FontDialog.d dwt/widgets/Group.d dwt/widgets/Label.d dwt/widgets/Link.d dwt/widgets/List.d dwt/widgets/Menu.d dwt/widgets/MenuItem.d dwt/widgets/Monitor.d dwt/widgets/ProgressBar.d dwt/widgets/Sash.d dwt/widgets/Scale.d dwt/widgets/ScrollBar.d dwt/widgets/Scrollable.d dwt/widgets/Shell.d dwt/widgets/Slider.d dwt/widgets/Spinner.d dwt/widgets/TabFolder.d dwt/widgets/TabItem.d dwt/widgets/Table.d dwt/widgets/TableColumn.d dwt/widgets/TableItem.d dwt/widgets/Text.d dwt/widgets/ToolBar.d dwt/widgets/ToolItem.d dwt/widgets/Tracker.d dwt/widgets/TrayItem.d dwt/widgets/Tree.d dwt/widgets/TreeColumn.d dwt/widgets/TreeItem.d dwt/widgets/TypedListener.d dwt/widgets/Widget.d
diffstat 161 files changed, 1682 insertions(+), 1682 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/browser/AppFileLocProvider.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/AppFileLocProvider.d	Wed Aug 27 14:30:35 2008 +0200
@@ -183,7 +183,7 @@
                     int segmentsSize = segments.size ();
                     pluginDirs = new String [segmentsSize + 2];
                     for (index = 0; index < segmentsSize; index++) {
-                        pluginDirs[index] = (String)segments.elementAt (index);
+                        pluginDirs[index] = cast(String)segments.elementAt (index);
                     }
                 }
             }
--- a/dwt/browser/Download.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/Download.d	Wed Aug 27 14:30:35 2008 +0200
@@ -100,7 +100,7 @@
         public int /*long*/ method15 (int /*long*/[] args) {return SetObserver (args[0]);}
         public int /*long*/ method16 (int /*long*/[] args) {return Open (args[0]);}
         public int /*long*/ method17 (int /*long*/[] args) {return GetCancelDownloadOnClose (args[0]);}
-        public int /*long*/ method18 (int /*long*/[] args) {return SetCancelDownloadOnClose ((int)/*64*/args[0]);}
+        public int /*long*/ method18 (int /*long*/[] args) {return SetCancelDownloadOnClose (cast(int)/*64*/args[0]);}
         public int /*long*/ method19 (int /*long*/[] args) {return GetDialog (args[0]);}
         public int /*long*/ method20 (int /*long*/[] args) {return SetDialog (args[0]);}
     };
@@ -109,11 +109,11 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3], (int)/*64*/args[4], (int)/*64*/args[5]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3], cast(int)/*64*/args[4], cast(int)/*64*/args[5]);}
         public int /*long*/ method5 (int /*long*/[] args) {return OnLocationChange (args[0], args[1], args[2]);}
-        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], (int)/*64*/args[2], args[3]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], (int)/*64*/args[2]);}
+        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], cast(int)/*64*/args[2], args[3]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], cast(int)/*64*/args[2]);}
     };
 }
 
--- a/dwt/browser/DownloadFactory.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/DownloadFactory.d	Wed Aug 27 14:30:35 2008 +0200
@@ -46,7 +46,7 @@
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
         public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory (cast(int)/*64*/args[0]);}
     };
 }
 
--- a/dwt/browser/DownloadFactory_1_8.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/DownloadFactory_1_8.d	Wed Aug 27 14:30:35 2008 +0200
@@ -46,7 +46,7 @@
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
         public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory (cast(int)/*64*/args[0]);}
     };
 }
 
--- a/dwt/browser/Download_1_8.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/Download_1_8.d	Wed Aug 27 14:30:35 2008 +0200
@@ -67,11 +67,11 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3], (int)/*64*/args[4], (int)/*64*/args[5]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3], cast(int)/*64*/args[4], cast(int)/*64*/args[5]);}
         public int /*long*/ method5 (int /*long*/[] args) {return OnLocationChange (args[0], args[1], args[2]);}
-        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], (int)/*64*/args[2], args[3]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], (int)/*64*/args[2]);}
+        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], cast(int)/*64*/args[2], args[3]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], cast(int)/*64*/args[2]);}
         public int /*long*/ method8 (int /*long*/[] args) {
             if (args.length is 10) {
                 return OnProgressChange64_32 (args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
@@ -102,11 +102,11 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3], (int)/*64*/args[4], (int)/*64*/args[5]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3], cast(int)/*64*/args[4], cast(int)/*64*/args[5]);}
         public int /*long*/ method5 (int /*long*/[] args) {return OnLocationChange (args[0], args[1], args[2]);}
-        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], (int)/*64*/args[2], args[3]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], (int)/*64*/args[2]);}
+        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], cast(int)/*64*/args[2], args[3]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], cast(int)/*64*/args[2]);}
         public int /*long*/ method8 (int /*long*/[] args) {
             if (args.length is 10) {
                 return OnProgressChange64_32 (args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
@@ -133,7 +133,7 @@
         public int /*long*/ method19 (int /*long*/[] args) {return GetMIMEInfo (args[0]);}
         public int /*long*/ method20 (int /*long*/[] args) {return Open (args[0]);}
         public int /*long*/ method21 (int /*long*/[] args) {return GetCancelDownloadOnClose (args[0]);}
-        public int /*long*/ method22 (int /*long*/[] args) {return SetCancelDownloadOnClose ((int)/*64*/args[0]);}
+        public int /*long*/ method22 (int /*long*/[] args) {return SetCancelDownloadOnClose (cast(int)/*64*/args[0]);}
         public int /*long*/ method23 (int /*long*/[] args) {return GetObserver (args[0]);}
         public int /*long*/ method24 (int /*long*/[] args) {return SetObserver (args[0]);}
         public int /*long*/ method25 (int /*long*/[] args) {return GetDialog (args[0]);}
@@ -144,11 +144,11 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3], (int)/*64*/args[4], (int)/*64*/args[5]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3], cast(int)/*64*/args[4], cast(int)/*64*/args[5]);}
         public int /*long*/ method5 (int /*long*/[] args) {return OnLocationChange (args[0], args[1], args[2]);}
-        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], (int)/*64*/args[2], args[3]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], (int)/*64*/args[2]);}
+        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], cast(int)/*64*/args[2], args[3]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], cast(int)/*64*/args[2]);}
     };
 }
 
--- a/dwt/browser/FilePicker.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/FilePicker.d	Wed Aug 27 14:30:35 2008 +0200
@@ -60,15 +60,15 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return Init (args[0], args[1], (short)args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return AppendFilters ((int)/*64*/args[0]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return Init (args[0], args[1], cast(short)args[2]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return AppendFilters (cast(int)/*64*/args[0]);}
         public int /*long*/ method5 (int /*long*/[] args) {return AppendFilter (args[0], args[1]);}
         public int /*long*/ method6 (int /*long*/[] args) {return GetDefaultString (args[0]);}
         public int /*long*/ method7 (int /*long*/[] args) {return SetDefaultString (args[0]);}
         public int /*long*/ method8 (int /*long*/[] args) {return GetDefaultExtension (args[0]);}
         public int /*long*/ method9 (int /*long*/[] args) {return SetDefaultExtension (args[0]);}
         public int /*long*/ method10 (int /*long*/[] args) {return GetFilterIndex (args[0]);}
-        public int /*long*/ method11 (int /*long*/[] args) {return SetFilterIndex ((int)/*64*/args[0]);}
+        public int /*long*/ method11 (int /*long*/[] args) {return SetFilterIndex (cast(int)/*64*/args[0]);}
         public int /*long*/ method12 (int /*long*/[] args) {return GetDisplayDirectory (args[0]);}
         public int /*long*/ method13 (int /*long*/[] args) {return SetDisplayDirectory (args[0]);}
         public int /*long*/ method14 (int /*long*/[] args) {return GetFile (args[0]);}
@@ -146,7 +146,7 @@
     if (mode is nsIFilePicker.modeGetFolder) {
         /* picking a directory */
         int result = showDirectoryPicker ();
-        XPCOM.memmove (_retval, new short[] {(short)result}, 2); /* PRInt16 */
+        XPCOM.memmove (_retval, new short[] {cast(short)result}, 2); /* PRInt16 */
         return XPCOM.NS_OK;
     }
 
@@ -169,7 +169,7 @@
     title = defaultFilename = null;
     masks = null;
     int result = filename is null ? nsIFilePicker.returnCancel : nsIFilePicker.returnOK; 
-    XPCOM.memmove (_retval, new short[] {(short)result}, 2); /* PRInt16 */
+    XPCOM.memmove (_retval, new short[] {cast(short)result}, 2); /* PRInt16 */
     return XPCOM.NS_OK;
 }
 
--- a/dwt/browser/FilePickerFactory.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/FilePickerFactory.d	Wed Aug 27 14:30:35 2008 +0200
@@ -46,7 +46,7 @@
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
         public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory (cast(int)/*64*/args[0]);}
     };
 }
 
--- a/dwt/browser/FilePickerFactory_1_8.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/FilePickerFactory_1_8.d	Wed Aug 27 14:30:35 2008 +0200
@@ -31,7 +31,7 @@
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
         public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory (cast(int)/*64*/args[0]);}
     };
 }
 
--- a/dwt/browser/FilePicker_1_8.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/FilePicker_1_8.d	Wed Aug 27 14:30:35 2008 +0200
@@ -29,15 +29,15 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return Init (args[0], args[1], (short)args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return AppendFilters ((int)/*64*/args[0]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return Init (args[0], args[1], cast(short)args[2]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return AppendFilters (cast(int)/*64*/args[0]);}
         public int /*long*/ method5 (int /*long*/[] args) {return AppendFilter (args[0], args[1]);}
         public int /*long*/ method6 (int /*long*/[] args) {return GetDefaultString (args[0]);}
         public int /*long*/ method7 (int /*long*/[] args) {return SetDefaultString (args[0]);}
         public int /*long*/ method8 (int /*long*/[] args) {return GetDefaultExtension (args[0]);}
         public int /*long*/ method9 (int /*long*/[] args) {return SetDefaultExtension (args[0]);}
         public int /*long*/ method10 (int /*long*/[] args) {return GetFilterIndex (args[0]);}
-        public int /*long*/ method11 (int /*long*/[] args) {return SetFilterIndex ((int)/*64*/args[0]);}
+        public int /*long*/ method11 (int /*long*/[] args) {return SetFilterIndex (cast(int)/*64*/args[0]);}
         public int /*long*/ method12 (int /*long*/[] args) {return GetDisplayDirectory (args[0]);}
         public int /*long*/ method13 (int /*long*/[] args) {return SetDisplayDirectory (args[0]);}
         public int /*long*/ method14 (int /*long*/[] args) {return GetFile (args[0]);}
--- a/dwt/browser/HelperAppLauncherDialog.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/HelperAppLauncherDialog.d	Wed Aug 27 14:30:35 2008 +0200
@@ -52,7 +52,7 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return Show (args[0], args[1], (int)/*64*/args[2]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return Show (args[0], args[1], cast(int)/*64*/args[2]);}
         public int /*long*/ method4 (int /*long*/[] args) {return PromptForSaveToFile (args[0], args[1], args[2], args[3], args[4]);}
     };      
 }
--- a/dwt/browser/HelperAppLauncherDialogFactory.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/HelperAppLauncherDialogFactory.d	Wed Aug 27 14:30:35 2008 +0200
@@ -46,7 +46,7 @@
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
         public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory (cast(int)/*64*/args[0]);}
     };
 }
 
--- a/dwt/browser/InputStream.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/InputStream.d	Wed Aug 27 14:30:35 2008 +0200
@@ -45,8 +45,8 @@
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
         public int /*long*/ method3 (int /*long*/[] args) {return Close ();}
         public int /*long*/ method4 (int /*long*/[] args) {return Available (args[0]);}
-        public int /*long*/ method5 (int /*long*/[] args) {return Read (args[0], (int)/*64*/args[1], args[2]);}
-        public int /*long*/ method6 (int /*long*/[] args) {return ReadSegments (args[0], args[1], (int)/*64*/args[2], args[3]);}
+        public int /*long*/ method5 (int /*long*/[] args) {return Read (args[0], cast(int)/*64*/args[1], args[2]);}
+        public int /*long*/ method6 (int /*long*/[] args) {return ReadSegments (args[0], args[1], cast(int)/*64*/args[2], args[3]);}
         public int /*long*/ method7 (int /*long*/[] args) {return IsNonBlocking (args[0]);}
     };
 }
--- a/dwt/browser/Mozilla.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/Mozilla.d	Wed Aug 27 14:30:35 2008 +0200
@@ -230,7 +230,7 @@
         bool initLoaded = false;
         bool IsXULRunner = false;
 
-        String greInitialized = System.getProperty (GRE_INITIALIZED); 
+        String greInitialized = System.getProperty cast(GRE_INITIALIZED); 
         if ("true".equals (greInitialized)) { //$NON-NLS-1$
             /* 
              * Another browser has already initialized xulrunner in this process,
@@ -239,7 +239,7 @@
             Initialized = true;
         }
 
-        String mozillaPath = System.getProperty (XULRUNNER_PATH);
+        String mozillaPath = System.getProperty cast(XULRUNNER_PATH);
         /*
         * Browser clients that ship XULRunner in a plug-in must have an opportunity 
         * to set the dwt.browser.XULRunnerPath system property to point
@@ -253,7 +253,7 @@
         if (mozillaPath is null) {
             try {
                 Class.forName ("dwt.browser.XULRunnerInitializer"); //$NON-NLS-1$
-                mozillaPath = System.getProperty (XULRUNNER_PATH);
+                mozillaPath = System.getProperty cast(XULRUNNER_PATH);
             } catch (ClassNotFoundException e) {
                 /* no fragment is providing this class, which is the typical case */
             }
@@ -333,7 +333,7 @@
                     rc = XPCOMInit.XPCOMGlueStartup (path);
                     if (rc !is XPCOM.NS_OK) {
                         IsXULRunner = false;    /* failed */
-                        mozillaPath = mozillaPath.substring (0, mozillaPath.lastIndexOf (SEPARATOR_OS));
+                        mozillaPath = mozillaPath.substring (0, mozillaPath.lastIndexOf cast(SEPARATOR_OS));
                         if (Device.DEBUG) System.out.println ("cannot use detected XULRunner: " + mozillaPath); //$NON-NLS-1$
                     } else {
                         XPCOMInitWasGlued = true;
@@ -362,7 +362,7 @@
              * Remove the trailing xpcom lib name from mozillaPath because the
              * Mozilla.initialize and NS_InitXPCOM2 invocations require a directory name only.
              */ 
-            mozillaPath = mozillaPath.substring (0, mozillaPath.lastIndexOf (SEPARATOR_OS));
+            mozillaPath = mozillaPath.substring (0, mozillaPath.lastIndexOf cast(SEPARATOR_OS));
         } else {
             if ((style & DWT.MOZILLA) !is 0) {
                 browser.dispose ();
@@ -718,11 +718,11 @@
         String language = locale.getLanguage ();
         String country = locale.getCountry ();
         StringBuffer stringBuffer = new StringBuffer (language);
-        stringBuffer.append (SEPARATOR_LOCALE);
+        stringBuffer.append cast(SEPARATOR_LOCALE);
         stringBuffer.append (country.toLowerCase ());
-        stringBuffer.append (TOKENIZER_LOCALE);
+        stringBuffer.append cast(TOKENIZER_LOCALE);
         stringBuffer.append (language);
-        stringBuffer.append (TOKENIZER_LOCALE);
+        stringBuffer.append cast(TOKENIZER_LOCALE);
         String newLocales = stringBuffer.toString ();
 
         int start, end = -1;
@@ -836,8 +836,8 @@
         * Check for proxy values set as documented java properties and update mozilla's
         * preferences with these values if needed.
         */
-        String proxyHost = System.getProperty (PROPERTY_PROXYHOST);
-        String proxyPortString = System.getProperty (PROPERTY_PROXYPORT);
+        String proxyHost = System.getProperty cast(PROPERTY_PROXYHOST);
+        String proxyPortString = System.getProperty cast(PROPERTY_PROXYPORT);
 
         int port = -1;
         if (proxyPortString !is null) {
@@ -986,7 +986,7 @@
         Initialized = true;
     }
 
-    if (display.getData (DISPOSE_LISTENER_HOOKED) is null) {
+    if (display.getData cast(DISPOSE_LISTENER_HOOKED) is null) {
         display.setData (DISPOSE_LISTENER_HOOKED, DISPOSE_LISTENER_HOOKED);
         display.addListener (DWT.Dispose, new Listener () {
             public void handleEvent (Event event) {
@@ -1327,27 +1327,27 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3], (int)/*64*/args[4], (int)/*64*/args[5]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return OnStateChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return OnProgressChange (args[0], args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3], cast(int)/*64*/args[4], cast(int)/*64*/args[5]);}
         public int /*long*/ method5 (int /*long*/[] args) {return OnLocationChange (args[0], args[1], args[2]);}
-        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], (int)/*64*/args[2], args[3]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], (int)/*64*/args[2]);}
+        public int /*long*/ method6 (int /*long*/[] args) {return OnStatusChange (args[0], args[1], cast(int)/*64*/args[2], args[3]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return OnSecurityChange (args[0], args[1], cast(int)/*64*/args[2]);}
     };
     
     webBrowserChrome = new XPCOMObject (new int[] {2, 0, 0, 2, 1, 1, 1, 1, 0, 2, 0, 1, 1}) {
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return SetStatus ((int)/*64*/args[0], args[1]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return SetStatus (cast(int)/*64*/args[0], args[1]);}
         public int /*long*/ method4 (int /*long*/[] args) {return GetWebBrowser (args[0]);}
         public int /*long*/ method5 (int /*long*/[] args) {return SetWebBrowser (args[0]);}
         public int /*long*/ method6 (int /*long*/[] args) {return GetChromeFlags (args[0]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return SetChromeFlags ((int)/*64*/args[0]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return SetChromeFlags (cast(int)/*64*/args[0]);}
         public int /*long*/ method8 (int /*long*/[] args) {return DestroyBrowserWindow ();}
-        public int /*long*/ method9 (int /*long*/[] args) {return SizeBrowserTo ((int)/*64*/args[0], (int)/*64*/args[1]);}
+        public int /*long*/ method9 (int /*long*/[] args) {return SizeBrowserTo (cast(int)/*64*/args[0], cast(int)/*64*/args[1]);}
         public int /*long*/ method10 (int /*long*/[] args) {return ShowAsModal ();}
         public int /*long*/ method11 (int /*long*/[] args) {return IsWindowModal (args[0]);}
-        public int /*long*/ method12 (int /*long*/[] args) {return ExitModalEventLoop ((int)/*64*/args[0]);}
+        public int /*long*/ method12 (int /*long*/[] args) {return ExitModalEventLoop (cast(int)/*64*/args[0]);}
     };
     
     webBrowserChromeFocus = new XPCOMObject (new int[] {2, 0, 0, 0, 0}) {
@@ -1362,11 +1362,11 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return SetDimensions ((int)/*64*/args[0], (int)/*64*/args[1], (int)/*64*/args[2], (int)/*64*/args[3], (int)/*64*/args[4]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return GetDimensions ((int)/*64*/args[0], args[1], args[2], args[3], args[4]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return SetDimensions (cast(int)/*64*/args[0], cast(int)/*64*/args[1], cast(int)/*64*/args[2], cast(int)/*64*/args[3], cast(int)/*64*/args[4]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return GetDimensions (cast(int)/*64*/args[0], args[1], args[2], args[3], args[4]);}
         public int /*long*/ method5 (int /*long*/[] args) {return SetFocus ();}
         public int /*long*/ method6 (int /*long*/[] args) {return GetVisibility (args[0]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return SetVisibility ((int)/*64*/args[0]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return SetVisibility (cast(int)/*64*/args[0]);}
         public int /*long*/ method8 (int /*long*/[] args) {return GetTitle (args[0]);}
         public int /*long*/ method9 (int /*long*/[] args) {return SetTitle (args[0]);}
         public int /*long*/ method10 (int /*long*/[] args) {return GetSiteWindow (args[0]);}
@@ -1390,7 +1390,7 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return OnShowContextMenu ((int)/*64*/args[0], args[1], args[2]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return OnShowContextMenu (cast(int)/*64*/args[0], args[1], args[2]);}
     };
     
     uriContentListener = new XPCOMObject (new int[] {2, 0, 0, 2, 5, 3, 4, 1, 1, 1, 1}) {
@@ -1398,9 +1398,9 @@
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
         public int /*long*/ method3 (int /*long*/[] args) {return OnStartURIOpen (args[0], args[1]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return DoContent (args[0], (int)/*64*/args[1], args[2], args[3], args[4]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return DoContent (args[0], cast(int)/*64*/args[1], args[2], args[3], args[4]);}
         public int /*long*/ method5 (int /*long*/[] args) {return IsPreferred (args[0], args[1], args[2]);}
-        public int /*long*/ method6 (int /*long*/[] args) {return CanHandleContent (args[0], (int)/*64*/args[1], args[2], args[3]);}
+        public int /*long*/ method6 (int /*long*/[] args) {return CanHandleContent (args[0], cast(int)/*64*/args[1], args[2], args[3]);}
         public int /*long*/ method7 (int /*long*/[] args) {return GetLoadCookie (args[0]);}
         public int /*long*/ method8 (int /*long*/[] args) {return SetLoadCookie (args[0]);}
         public int /*long*/ method9 (int /*long*/[] args) {return GetParentContentListener (args[0]);}
@@ -1411,7 +1411,7 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return OnShowTooltip ((int)/*64*/args[0], (int)/*64*/args[1], args[2]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return OnShowTooltip (cast(int)/*64*/args[0], cast(int)/*64*/args[1], args[2]);}
         public int /*long*/ method4 (int /*long*/[] args) {return OnHideTooltip ();}        
     };
 
@@ -1606,7 +1606,7 @@
      * If the URI indicates that the page is being rendered from memory
      * (via setText()) then set it to about:blank to be consistent with IE.
      */
-    if (location.equals (URI_FROMMEMORY)) location = ABOUT_BLANK;
+    if (location.equals cast(URI_FROMMEMORY)) location = ABOUT_BLANK;
     return location;
 }
 
@@ -1714,7 +1714,7 @@
 
     Enumeration elements = unhookedDOMWindows.elements ();
     while (elements.hasMoreElements ()) {
-        LONG ptrObject = (LONG)elements.nextElement ();
+        LONG ptrObject = cast(LONG)elements.nextElement ();
         new nsISupports (ptrObject.value).Release ();
     }
     unhookedDOMWindows = null;
@@ -2249,7 +2249,7 @@
         domWindow.Release ();
 
         /*
-        * Feature in Mozilla.  When a request is redirected (STATE_REDIRECTING),
+        * Feature in Mozilla.  When a request is redirected cast(STATE_REDIRECTING),
         * it never reaches the state STATE_STOP and it is replaced with a new request.
         * The new request is received when it is in the state STATE_STOP.
         * To handle this case,  the variable request is set to 0 when the corresponding
@@ -2378,7 +2378,7 @@
      * to about:blank and fires the corresponding navigation events.  Do not send
      * this event on to the user since it is not expected.
      */
-    if (!IsPre_1_8 && aRequest is 0 && url.startsWith (ABOUT_BLANK)) return XPCOM.NS_OK;
+    if (!IsPre_1_8 && aRequest is 0 && url.startsWith cast(ABOUT_BLANK)) return XPCOM.NS_OK;
 
     LocationEvent event = new LocationEvent (browser);
     event.display = browser.getDisplay ();
@@ -2388,7 +2388,7 @@
      * If the URI indicates that the page is being rendered from memory
      * (via setText()) then set it to about:blank to be consistent with IE.
      */
-    if (event.location.equals (URI_FROMMEMORY)) event.location = ABOUT_BLANK;
+    if (event.location.equals cast(URI_FROMMEMORY)) event.location = ABOUT_BLANK;
     event.top = aTop[0] is aDOMWindow[0];
     for (int i = 0; i < locationListeners.length; i++) {
         locationListeners[i].changed (event);
@@ -2757,7 +2757,7 @@
          * listeners should not be notified of internal transitions like "javascipt:..."
          * because this is an implementation side-effect, not a true navigate
          */
-        if (!value.startsWith (PREFIX_JAVASCRIPT)) {
+        if (!value.startsWith cast(PREFIX_JAVASCRIPT)) {
             LocationEvent event = new LocationEvent (browser);
             event.display = browser.getDisplay();
             event.widget = browser;
@@ -2766,7 +2766,7 @@
              * If the URI indicates that the page is being rendered from memory
              * (via setText()) then set it to about:blank to be consistent with IE.
              */
-            if (event.location.equals (URI_FROMMEMORY)) event.location = ABOUT_BLANK;
+            if (event.location.equals cast(URI_FROMMEMORY)) event.location = ABOUT_BLANK;
             event.doit = doit;
             for (int i = 0; i < locationListeners.length; i++) {
                 locationListeners[i].changing (event);
@@ -3081,7 +3081,7 @@
         keyEvent.widget = browser;
         keyEvent.type = DWT.KeyDown;
         keyEvent.keyCode = lastKeyCode;
-        keyEvent.character = (char)lastCharCode;
+        keyEvent.character = cast(wchar)lastCharCode;
         keyEvent.stateMask = (aAltKey[0] !is 0 ? DWT.ALT : 0) | (aCtrlKey[0] !is 0 ? DWT.CTRL : 0) | (aShiftKey[0] !is 0 ? DWT.SHIFT : 0) | (aMetaKey[0] !is 0 ? DWT.COMMAND : 0);
         browser.notifyListeners (keyEvent.type, keyEvent);
         if (!keyEvent.doit || browser.isDisposed ()) {
@@ -3128,7 +3128,7 @@
         keyEvent.widget = browser;
         keyEvent.type = DWT.KeyUp;
         keyEvent.keyCode = lastKeyCode;
-        keyEvent.character = (char)lastCharCode;
+        keyEvent.character = cast(wchar)lastCharCode;
         keyEvent.stateMask = (aAltKey[0] !is 0 ? DWT.ALT : 0) | (aCtrlKey[0] !is 0 ? DWT.CTRL : 0) | (aShiftKey[0] !is 0 ? DWT.SHIFT : 0) | (aMetaKey[0] !is 0 ? DWT.COMMAND : 0);
         switch (lastKeyCode) {
             case DWT.SHIFT:
--- a/dwt/browser/MozillaDelegate.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/MozillaDelegate.d	Wed Aug 27 14:30:35 2008 +0200
@@ -66,10 +66,10 @@
         //      range.length = chars.length;
         //      int encoding = OS.CFStringGetSystemEncoding ();
         //      int[] size = new int[1];
-        //      int numChars = OS.CFStringGetBytes (cfString, range, encoding, (byte)'?', true, null, 0, size);
+        //      int numChars = OS.CFStringGetBytes (cfString, range, encoding, cast(byte)'?', true, null, 0, size);
         //      buffer = new byte [size[0] + (terminate ? 1 : 0)];
         //      if (numChars !is 0) {
-        //          numChars = OS.CFStringGetBytes (cfString, range, encoding, (byte)'?', true, buffer, size[0], size);
+        //          numChars = OS.CFStringGetBytes (cfString, range, encoding, cast(byte)'?', true, buffer, size[0], size);
         //      }
         //      OS.CFRelease (cfString);
         //  }
--- a/dwt/browser/PromptService2.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/PromptService2.d	Wed Aug 27 14:30:35 2008 +0200
@@ -65,11 +65,11 @@
         public int /*long*/ method4 (int /*long*/[] args) {return AlertCheck (args[0], args[1], args[2], args[3], args[4]);}
         public int /*long*/ method5 (int /*long*/[] args) {return Confirm (args[0], args[1], args[2], args[3]);}
         public int /*long*/ method6 (int /*long*/[] args) {return ConfirmCheck (args[0], args[1], args[2], args[3], args[4], args[5]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return ConfirmEx (args[0], args[1], args[2], (int)/*64*/args[3], args[4], args[5], args[6], args[7], args[8], args[9]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return ConfirmEx (args[0], args[1], args[2], cast(int)/*64*/args[3], args[4], args[5], args[6], args[7], args[8], args[9]);}
         public int /*long*/ method8 (int /*long*/[] args) {return Prompt (args[0], args[1], args[2], args[3], args[4], args[5], args[6]);}
         public int /*long*/ method9 (int /*long*/[] args) {return PromptUsernameAndPassword (args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);}
         public int /*long*/ method10 (int /*long*/[] args) {return PromptPassword (args[0], args[1], args[2], args[3], args[4], args[5], args[6]);}
-        public int /*long*/ method11 (int /*long*/[] args) {return Select (args[0], args[1], args[2], (int)/*64*/args[3], args[4], args[5], args[6]);}
+        public int /*long*/ method11 (int /*long*/[] args) {return Select (args[0], args[1], args[2], cast(int)/*64*/args[3], args[4], args[5], args[6]);}
     };
     
     promptService2 = new XPCOMObject (new int[] {2, 0, 0, 3, 5, 4, 6, 10, 7, 8, 7, 7, 7, 9}) {
@@ -80,13 +80,13 @@
         public int /*long*/ method4 (int /*long*/[] args) {return AlertCheck (args[0], args[1], args[2], args[3], args[4]);}
         public int /*long*/ method5 (int /*long*/[] args) {return Confirm (args[0], args[1], args[2], args[3]);}
         public int /*long*/ method6 (int /*long*/[] args) {return ConfirmCheck (args[0], args[1], args[2], args[3], args[4], args[5]);}
-        public int /*long*/ method7 (int /*long*/[] args) {return ConfirmEx (args[0], args[1], args[2], (int)/*64*/args[3], args[4], args[5], args[6], args[7], args[8], args[9]);}
+        public int /*long*/ method7 (int /*long*/[] args) {return ConfirmEx (args[0], args[1], args[2], cast(int)/*64*/args[3], args[4], args[5], args[6], args[7], args[8], args[9]);}
         public int /*long*/ method8 (int /*long*/[] args) {return Prompt (args[0], args[1], args[2], args[3], args[4], args[5], args[6]);}
         public int /*long*/ method9 (int /*long*/[] args) {return PromptUsernameAndPassword (args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);}
         public int /*long*/ method10 (int /*long*/[] args) {return PromptPassword (args[0], args[1], args[2], args[3], args[4], args[5], args[6]);}
-        public int /*long*/ method11 (int /*long*/[] args) {return Select (args[0], args[1], args[2], (int)/*64*/args[3], args[4], args[5], args[6]);}
-        public int /*long*/ method12 (int /*long*/[] args) {return PromptAuth (args[0], args[1], (int)/*64*/args[2], args[3], args[4], args[5], args[6]);}
-        public int /*long*/ method13 (int /*long*/[] args) {return AsyncPromptAuth (args[0], args[1], args[2], args[3], (int)/*64*/args[4], args[5], args[6], args[7], args[8]);}
+        public int /*long*/ method11 (int /*long*/[] args) {return Select (args[0], args[1], args[2], cast(int)/*64*/args[3], args[4], args[5], args[6]);}
+        public int /*long*/ method12 (int /*long*/[] args) {return PromptAuth (args[0], args[1], cast(int)/*64*/args[2], args[3], args[4], args[5], args[6]);}
+        public int /*long*/ method13 (int /*long*/[] args) {return AsyncPromptAuth (args[0], args[1], args[2], args[3], cast(int)/*64*/args[4], args[5], args[6], args[7], args[8]);}
     };
 }
 
--- a/dwt/browser/PromptService2Factory.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/PromptService2Factory.d	Wed Aug 27 14:30:35 2008 +0200
@@ -46,7 +46,7 @@
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
         public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory (cast(int)/*64*/args[0]);}
     };
 }
 
--- a/dwt/browser/WindowCreator2.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/WindowCreator2.d	Wed Aug 27 14:30:35 2008 +0200
@@ -56,15 +56,15 @@
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return CreateChromeWindow (args[0], (int)/*64*/args[1], args[2]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return CreateChromeWindow (args[0], cast(int)/*64*/args[1], args[2]);}
     };
 
     windowCreator2 = new XPCOMObject (new int[] {2, 0, 0, 3, 6}) {
         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
-        public int /*long*/ method3 (int /*long*/[] args) {return CreateChromeWindow (args[0], (int)/*64*/args[1], args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return CreateChromeWindow2 (args[0], (int)/*64*/args[1], (int)/*64*/args[2], args[3], args[4], args[5]);}
+        public int /*long*/ method3 (int /*long*/[] args) {return CreateChromeWindow (args[0], cast(int)/*64*/args[1], args[2]);}
+        public int /*long*/ method4 (int /*long*/[] args) {return CreateChromeWindow2 (args[0], cast(int)/*64*/args[1], cast(int)/*64*/args[2], args[3], args[4], args[5]);}
     };
 }
 
@@ -221,7 +221,7 @@
         }
     }
     if (doit) {
-        Mozilla mozilla = (Mozilla)browser.webBrowser;
+        Mozilla mozilla = cast(Mozilla)browser.webBrowser;
         mozilla.isChild = true;
         int /*long*/ chromePtr = mozilla.webBrowserChrome.getAddress ();
         nsIWebBrowserChrome webBrowserChrome = new nsIWebBrowserChrome (chromePtr);
--- a/dwt/browser/WindowEvent.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/browser/WindowEvent.d	Wed Aug 27 14:30:35 2008 +0200
@@ -66,12 +66,12 @@
  *      });
  *      browser.addVisibilityWindowListener(new VisibilityWindowListener() {
  *          public void hide(WindowEvent event) {
- *              Browser browser = (Browser)event.widget;
+ *              Browser browser = cast(Browser)event.widget;
  *              Shell shell = browser.getShell();
  *              shell.setVisible(false);
  *          }
  *          public void show(WindowEvent event) {
- *              Browser browser = (Browser)event.widget;
+ *              Browser browser = cast(Browser)event.widget;
  *              Shell shell = browser.getShell();
  *              if (event.location !is null) shell.setLocation(event.location);
  *              if (event.size !is null) {
@@ -88,7 +88,7 @@
  *      });
  *      browser.addCloseWindowListener(new CloseWindowListener() {
  *          public void close(WindowEvent event) {
- *              Browser browser = (Browser)event.widget;
+ *              Browser browser = cast(Browser)event.widget;
  *              Shell shell = browser.getShell();
  *              shell.close();
  *          }
--- a/dwt/custom/CBanner.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/CBanner.d	Wed Aug 27 14:30:35 2008 +0200
@@ -42,7 +42,7 @@
  * <dt><b>Styles:</b></dt>
  * <dd>NONE</dd>
  * <dt><b>Events:</b></dt>
- * <dd>(None)</dd>
+ * <dd>cast(None)</dd>
  * </dl>
  * <p>
  * IMPORTANT: This class is <em>not</em> intended to be subclassed.
--- a/dwt/custom/CTabItem.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/CTabItem.d	Wed Aug 27 14:30:35 2008 +0200
@@ -1077,7 +1077,7 @@
 
     /**
      * Sets to <code>true</code> to indicate that the receiver's close button should be shown.
-     * If the parent (CTabFolder) was created with DWT.CLOSE style, changing this value has
+     * If the parent cast(CTabFolder) was created with DWT.CLOSE style, changing this value has
      * no effect.
      * 
      * @param close the new state of the close button
--- a/dwt/custom/DefaultContent.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/DefaultContent.d	Wed Aug 27 14:30:35 2008 +0200
@@ -728,7 +728,7 @@
 public void removeTextChangeListener(TextChangeListener listener){
     if (listener is null) error(DWT.ERROR_NULL_ARGUMENT);
     for (int i = 0; i < textListeners.size(); i++) {
-        TypedListener typedListener = (TypedListener) textListeners.elementAt(i);
+        TypedListener typedListener = cast(TypedListener) textListeners.elementAt(i);
         if (typedListener.getEventListener () is listener) {
             textListeners.removeElementAt(i);
             break;
@@ -791,7 +791,7 @@
  */
 void sendTextEvent(StyledTextEvent event) {
     for (int i = 0; i < textListeners.size(); i++) {
-        ((StyledTextListener)textListeners.elementAt(i)).handleEvent(event);
+        (cast(StyledTextListener)textListeners.elementAt(i)).handleEvent(event);
     }
 }       
 /**
--- a/dwt/custom/SashForm.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/SashForm.d	Wed Aug 27 14:30:35 2008 +0200
@@ -153,7 +153,7 @@
     for (int i = 0; i < cArray.length; i++) {
         Object data = cArray[i].getLayoutData();
         if (data !is null && data instanceof SashFormData) {
-            ratios[i] = (int)(((SashFormData)data).weight * 1000 >> 16);
+            ratios[i] = cast(int)((cast(SashFormData)data).weight * 1000 >> 16);
         } else {
             ratios[i] = 200;
         }
@@ -175,7 +175,7 @@
     return result;
 }
 void onDragSash(Event event) {
-    Sash sash = (Sash)event.widget;
+    Sash sash = cast(Sash)event.widget;
     int sashIndex = -1;
     for (int i= 0; i < sashes.length; i++) {
         if (sashes[i] is sash) {
@@ -224,8 +224,8 @@
             data2 = new SashFormData();
             c2.setLayoutData(data2);
         }
-        ((SashFormData)data1).weight = (((long)b1.width << 16) + area.width - 1) / area.width;
-        ((SashFormData)data2).weight = (((long)b2.width << 16) + area.width - 1) / area.width;
+        (cast(SashFormData)data1).weight = ((cast(long)b1.width << 16) + area.width - 1) / area.width;
+        (cast(SashFormData)data2).weight = ((cast(long)b2.width << 16) + area.width - 1) / area.width;
     } else {
         correction = b1.height < DRAG_MINIMUM || b2.height < DRAG_MINIMUM;
         int totalHeight = b2.y + b2.height - b1.y;
@@ -257,8 +257,8 @@
             data2 = new SashFormData();
             c2.setLayoutData(data2);
         }
-        ((SashFormData)data1).weight = (((long)b1.height << 16) + area.height - 1) / area.height;
-        ((SashFormData)data2).weight = (((long)b2.height << 16) + area.height - 1) / area.height;
+        (cast(SashFormData)data1).weight = ((cast(long)b1.height << 16) + area.height - 1) / area.height;
+        (cast(SashFormData)data2).weight = ((cast(long)b2.height << 16) + area.height - 1) / area.height;
     }
     if (correction || (event.doit && event.detail !is DWT.DRAG)) {
         c1.setBounds(b1);
@@ -420,7 +420,7 @@
             data = new SashFormData();
             cArray[i].setLayoutData(data);
         }
-        ((SashFormData)data).weight = (((long)weights[i] << 16) + total - 1) / total;
+        (cast(SashFormData)data).weight = ((cast(long)weights[i] << 16) + total - 1) / total;
     }
 
     layout(false);
--- a/dwt/custom/SashFormLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/SashFormLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -21,7 +21,7 @@
  */
 class SashFormLayout : Layout {
 protected Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
-    SashForm sashForm = (SashForm)composite;
+    SashForm sashForm = cast(SashForm)composite;
     Control[] cArray = sashForm.getControls(true);
     int width = 0;
     int height = 0;
@@ -57,11 +57,11 @@
     for (int i = 0; i < cArray.length; i++) {
         Object data = cArray[i].getLayoutData();
         if (data !is null && data instanceof SashFormData) {
-            ratios[i] = ((SashFormData)data).weight;
+            ratios[i] = (cast(SashFormData)data).weight;
         } else {
             data = new SashFormData();
             cArray[i].setLayoutData(data);
-            ((SashFormData)data).weight = ratios[i] = ((200 << 16) + 999) / 1000;
+            (cast(SashFormData)data).weight = ratios[i] = ((200 << 16) + 999) / 1000;
             
         }
         total += ratios[i];
@@ -69,9 +69,9 @@
     if (ratios[maxIndex] > 0) {
         int sashwidth = sashForm.sashes.length > 0 ? sashForm.SASH_WIDTH + sashForm.sashes [0].getBorderWidth() * 2 : sashForm.SASH_WIDTH;
         if (vertical) {
-            height += (int)(total * maxValue / ratios[maxIndex]) + (cArray.length - 1) * sashwidth;
+            height += cast(int)(total * maxValue / ratios[maxIndex]) + (cArray.length - 1) * sashwidth;
         } else {
-            width += (int)(total * maxValue / ratios[maxIndex]) + (cArray.length - 1) * sashwidth;
+            width += cast(int)(total * maxValue / ratios[maxIndex]) + (cArray.length - 1) * sashwidth;
         }
     }
     width += sashForm.getBorderWidth()*2;
@@ -86,7 +86,7 @@
 }
 
 protected void layout(Composite composite, bool flushCache) {
-    SashForm sashForm = (SashForm)composite;
+    SashForm sashForm = cast(SashForm)composite;
     Rectangle area = sashForm.getClientArea();
     if (area.width <= 1 || area.height <= 1) return;
     
@@ -142,11 +142,11 @@
     for (int i = 0; i < controls.length; i++) {
         Object data = controls[i].getLayoutData();
         if (data !is null && data instanceof SashFormData) {
-            ratios[i] = ((SashFormData)data).weight;
+            ratios[i] = (cast(SashFormData)data).weight;
         } else {
             data = new SashFormData();
             controls[i].setLayoutData(data);
-            ((SashFormData)data).weight = ratios[i] = ((200 << 16) + 999) / 1000;
+            (cast(SashFormData)data).weight = ratios[i] = ((200 << 16) + 999) / 1000;
             
         }
         total += ratios[i];
@@ -154,14 +154,14 @@
     
     int sashwidth = sashes.length > 0 ? sashForm.SASH_WIDTH + sashes [0].getBorderWidth() * 2 : sashForm.SASH_WIDTH;
     if (sashForm.getOrientation() is DWT.HORIZONTAL) {
-        int width = (int)(ratios[0] * (area.width - sashes.length * sashwidth) / total);
+        int width = cast(int)(ratios[0] * (area.width - sashes.length * sashwidth) / total);
         int x = area.x;
         controls[0].setBounds(x, area.y, width, area.height);
         x += width;
         for (int i = 1; i < controls.length - 1; i++) {
             sashes[i - 1].setBounds(x, area.y, sashwidth, area.height);
             x += sashwidth;
-            width = (int)(ratios[i] * (area.width - sashes.length * sashwidth) / total);
+            width = cast(int)(ratios[i] * (area.width - sashes.length * sashwidth) / total);
             controls[i].setBounds(x, area.y, width, area.height);
             x += width;
         }
@@ -172,14 +172,14 @@
             controls[controls.length - 1].setBounds(x, area.y, width, area.height);
         }
     } else {
-        int height = (int)(ratios[0] * (area.height - sashes.length * sashwidth) / total);
+        int height = cast(int)(ratios[0] * (area.height - sashes.length * sashwidth) / total);
         int y = area.y;
         controls[0].setBounds(area.x, y, area.width, height);
         y += height;
         for (int i = 1; i < controls.length - 1; i++) {
             sashes[i - 1].setBounds(area.x, y, area.width, sashwidth);
             y += sashwidth;
-            height = (int)(ratios[i] * (area.height - sashes.length * sashwidth) / total);
+            height = cast(int)(ratios[i] * (area.height - sashes.length * sashwidth) / total);
             controls[i].setBounds(area.x, y, area.width, height);
             y += height;
         }
--- a/dwt/custom/ScrolledComposite.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/ScrolledComposite.d	Wed Aug 27 14:30:35 2008 +0200
@@ -171,7 +171,7 @@
     filter = new Listener() {
         public void handleEvent(Event event) {
             if (event.widget instanceof Control) {
-                Control control = (Control) event.widget;
+                Control control = cast(Control) event.widget;
                 if (contains(control)) showControl(control);
             }
         }
--- a/dwt/custom/ScrolledCompositeLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/ScrolledCompositeLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -26,7 +26,7 @@
     static final int DEFAULT_HEIGHT = 64;
     
 protected Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
-    ScrolledComposite sc = (ScrolledComposite)composite;
+    ScrolledComposite sc = cast(ScrolledComposite)composite;
     Point size = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
     if (sc.content !is null) {
         Point preferredSize = sc.content.computeSize(wHint, hHint, flushCache);
@@ -47,7 +47,7 @@
 
 protected void layout(Composite composite, bool flushCache) {
     if (inLayout) return;
-    ScrolledComposite sc = (ScrolledComposite)composite;
+    ScrolledComposite sc = cast(ScrolledComposite)composite;
     if (sc.content is null) return;
     ScrollBar hBar = sc.getHorizontalBar();
     ScrollBar vBar = sc.getVerticalBar();
--- a/dwt/custom/StyleRange.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/StyleRange.d	Wed Aug 27 14:30:35 2008 +0200
@@ -95,7 +95,7 @@
 public bool opEquals(Object object) {
     if (object is this) return true;
     if (object instanceof StyleRange) {
-        StyleRange style = (StyleRange)object;
+        StyleRange style = cast(StyleRange)object;
         if (start !is style.start) return false;
         if (length !is style.length) return false;
         return similarTo(style);
--- a/dwt/custom/StyledText.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/StyledText.d	Wed Aug 27 14:30:35 2008 +0200
@@ -273,7 +273,7 @@
             Color color = printerRenderer.getLineBackground(i, null);
             if (color !is null) {
                 if (printOptions.printLineBackground) {
-                    Color printerColor = (Color)resources.get(color);
+                    Color printerColor = cast(Color)resources.get(color);
                     if (printerColor is null) {
                         printerColor = new Color (printer, color.getRGB());
                         resources.put(color, printerColor); 
@@ -293,7 +293,7 @@
             StyleRange style = styles[i];
             Font font = style.font;
             if (style.font !is null) {
-                Font printerFont = (Font)resources.get(font);
+                Font printerFont = cast(Font)resources.get(font);
                 if (printerFont is null) {
                     printerFont = new Font (printer, font.getFontData());
                     resources.put(font, printerFont);                   
@@ -302,7 +302,7 @@
             }
             Color color = style.foreground;
             if (color !is null) {
-                Color printerColor = (Color)resources.get(color);
+                Color printerColor = cast(Color)resources.get(color);
                 if (printOptions.printTextForeground) {
                     if (printerColor is null) {
                         printerColor = new Color (printer, color.getRGB());
@@ -315,7 +315,7 @@
             }
             color = style.background;
             if (color !is null) {
-                Color printerColor = (Color)resources.get(color);
+                Color printerColor = cast(Color)resources.get(color);
                 if (printOptions.printTextBackground) {
                     if (printerColor is null) {
                         printerColor = new Color (printer, color.getRGB());
@@ -373,7 +373,7 @@
         if (resources !is null) {
             Enumeration enumeration = resources.elements();         
             while (enumeration.hasMoreElements()) {
-                Resource resource = (Resource) enumeration.nextElement();
+                Resource resource = cast(Resource) enumeration.nextElement();
                 resource.dispose();
             }
             resources = null;
@@ -505,7 +505,7 @@
                     int height = paragraphBottom - paintY;
                     gc.setClipping(clientArea.x, paintY, clientArea.width, height);
                     printLine(paintX, paintY, gc, foreground, lineBackground, layout, printLayout, i);
-                    gc.setClipping((Rectangle)null);
+                    gc.setClipping(cast(Rectangle)null);
                     printDecoration(page, false, printLayout);
                     printer.endPage();                  
                     page++;
@@ -516,7 +516,7 @@
                         int layoutHeight = layout.getBounds().height;
                         gc.setClipping(clientArea.x, clientArea.y, clientArea.width, layoutHeight - height);
                         printLine(paintX, paintY, gc, foreground, lineBackground, layout, printLayout, i);
-                        gc.setClipping((Rectangle)null);
+                        gc.setClipping(cast(Rectangle)null);
                         paintY += layoutHeight;
                     }
                 }
@@ -779,7 +779,7 @@
                     write(String.substring(start, index));
                 }
                 write("\\u");
-                write(Integer.toString((short) ch));
+                write(Integer.toString(cast(short) ch));
                 write(' ');                     // control word delimiter
                 start = index + 1;
             } else if (ch is '}' || ch is '{' || ch is '\\') {
@@ -821,13 +821,13 @@
             header.append("\\f");
             header.append(i);
             header.append(" ");
-            FontData fd = ((Font)fontTable.elementAt(i)).getFontData()[0];
+            FontData fd = (cast(Font)fontTable.elementAt(i)).getFontData()[0];
             header.append(fd.getName());
             header.append(";");         
         }
         header.append("}}\n{\\colortbl");
         for (int i = 0; i < colorTable.size(); i++) {
-            Color color = (Color) colorTable.elementAt(i);
+            Color color = cast(Color) colorTable.elementAt(i);
             header.append("\\red");
             header.append(color.getRed());
             header.append("\\green");
@@ -3367,7 +3367,7 @@
  */
 public int getKeyBinding(int key) {
     checkWidget();
-    Integer action = (Integer) keyActionMap.get(new Integer(key));  
+    Integer action = cast(Integer) keyActionMap.get(new Integer(key));  
     return action is null ? DWT.NULL : action.intValue();
 }
 /**
@@ -4069,8 +4069,8 @@
  * @return start and end of the selection, x is the offset of the first 
  *  selected character, y is the offset after the last selected character.
  *  The selection values returned are visual (i.e., x will always always be   
- *  <= y).  To determine if a selection is right-to-left (RtoL) vs. left-to-right 
- *  (LtoR), compare the caretOffset to the start and end of the selection 
+ *  <= y).  To determine if a selection is right-to-left cast(RtoL) vs. left-to-right 
+ *  cast(LtoR), compare the caretOffset to the start and end of the selection 
  *  (e.g., caretOffset is start of selection implies that the selection is RtoL).
  * @see #getSelectionRange
  * @exception DWTException <ul>
@@ -4089,8 +4089,8 @@
  *  first selected character, relative to the first character of the 
  *  widget content. y is the length of the selection. 
  *  The selection values returned are visual (i.e., length will always always be   
- *  positive).  To determine if a selection is right-to-left (RtoL) vs. left-to-right 
- *  (LtoR), compare the caretOffset to the start and end of the selection 
+ *  positive).  To determine if a selection is right-to-left cast(RtoL) vs. left-to-right 
+ *  cast(LtoR), compare the caretOffset to the start and end of the selection 
  *  (e.g., caretOffset is start of selection implies that the selection is RtoL).
  * @exception DWTException <ul>
  *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -5197,7 +5197,7 @@
         
     //paste clipboard selection
     if (event.button is 2) {
-        String text = (String)getClipboardContent(DND.SELECTION_CLIPBOARD);
+        String text = cast(String)getClipboardContent(DND.SELECTION_CLIPBOARD);
         if (text !is null && text.length() > 0) {
             // position cursor
             doMouseLocationChange(event.x, event.y, false);
@@ -5578,7 +5578,7 @@
     for (int i = 0; i < siblings.length; i++) {
         if (siblings [i] is StyledText.this) {
             if (i > 0 && siblings [i-1] instanceof Label) {
-                return (Label) siblings [i-1];
+                return cast(Label) siblings [i-1];
             }
         }
     }
@@ -5901,7 +5901,7 @@
  */
 public void paste(){
     checkWidget();  
-    String text = (String) getClipboardContent(DND.CLIPBOARD);
+    String text = cast(String) getClipboardContent(DND.CLIPBOARD);
     if (text !is null && text.length() > 0) {
         Event event = new Event();
         event.start = selection.x;
@@ -7139,7 +7139,7 @@
 public void setKeyBinding(int key, int action) {
     checkWidget();
     int modifierValue = key & DWT.MODIFIER_MASK;
-    char keyChar = (char)(key & DWT.KEY_MASK);
+    char keyChar = cast(wchar)(key & DWT.KEY_MASK);
     if (Compatibility.isLetter(keyChar)) {
         // make the keybinding case insensitive by adding it
         // in its upper and lower case form
--- a/dwt/custom/StyledTextDropTargetEffect.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/StyledTextDropTargetEffect.d	Wed Aug 27 14:30:35 2008 +0200
@@ -66,7 +66,7 @@
         paintListener = new Listener () {
             public void handleEvent (Event event) {
                 if (currentOffset !is -1) {
-                    StyledText text = (StyledText) getControl();
+                    StyledText text = cast(StyledText) getControl();
                     Point position = text.getLocationAtOffset(currentOffset);
                     int height = text.getLineHeight(currentOffset);
                     event.gc.setBackground(event.display.getSystemColor (DWT.COLOR_BLACK));
@@ -114,7 +114,7 @@
      * @see DropTargetEvent
      */
     public void dragLeave(DropTargetEvent event) {
-        StyledText text = (StyledText) getControl();
+        StyledText text = cast(StyledText) getControl();
         if (currentOffset !is -1) {
             refreshCaret(text, currentOffset, -1);
         }
@@ -142,7 +142,7 @@
      */
     public void dragOver(DropTargetEvent event) {
         int effect = event.feedback;
-        StyledText text = (StyledText) getControl();
+        StyledText text = cast(StyledText) getControl();
         
         Point pt = text.getDisplay().map(null, text, event.x, event.y);
         if ((effect & DND.FEEDBACK_SCROLL) is 0) {
@@ -233,7 +233,7 @@
      */
     public void dropAccept(DropTargetEvent event) {
         if (currentOffset !is -1) {
-            StyledText text = (StyledText) getControl();
+            StyledText text = cast(StyledText) getControl();
             text.setSelection(currentOffset);
             currentOffset = -1;
         }
--- a/dwt/custom/StyledTextListener.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/StyledTextListener.d	Wed Aug 27 14:30:35 2008 +0200
@@ -27,63 +27,63 @@
     
     switch (e.type) {
         case StyledText.ExtendedModify:
-            ExtendedModifyEvent extendedModifyEvent = new ExtendedModifyEvent((StyledTextEvent) e);
-            ((ExtendedModifyListener) eventListener).modifyText(extendedModifyEvent);
+            ExtendedModifyEvent extendedModifyEvent = new ExtendedModifyEvent(cast(StyledTextEvent) e);
+            (cast(ExtendedModifyListener) eventListener).modifyText(extendedModifyEvent);
             break;      
         case StyledText.LineGetBackground:
-            LineBackgroundEvent lineBgEvent = new LineBackgroundEvent((StyledTextEvent) e);
-            ((LineBackgroundListener) eventListener).lineGetBackground(lineBgEvent);
-            ((StyledTextEvent) e).lineBackground = lineBgEvent.lineBackground;
+            LineBackgroundEvent lineBgEvent = new LineBackgroundEvent(cast(StyledTextEvent) e);
+            (cast(LineBackgroundListener) eventListener).lineGetBackground(lineBgEvent);
+            (cast(StyledTextEvent) e).lineBackground = lineBgEvent.lineBackground;
             break;      
         case StyledText.LineGetSegments:
-            BidiSegmentEvent segmentEvent = new BidiSegmentEvent((StyledTextEvent) e);
-            ((BidiSegmentListener) eventListener).lineGetSegments(segmentEvent);
-            ((StyledTextEvent) e).segments = segmentEvent.segments;
+            BidiSegmentEvent segmentEvent = new BidiSegmentEvent(cast(StyledTextEvent) e);
+            (cast(BidiSegmentListener) eventListener).lineGetSegments(segmentEvent);
+            (cast(StyledTextEvent) e).segments = segmentEvent.segments;
             break;      
         case StyledText.LineGetStyle:
-            LineStyleEvent lineStyleEvent = new LineStyleEvent((StyledTextEvent) e);
-            ((LineStyleListener) eventListener).lineGetStyle(lineStyleEvent);
-            ((StyledTextEvent) e).ranges = lineStyleEvent.ranges;
-            ((StyledTextEvent) e).styles = lineStyleEvent.styles;
-            ((StyledTextEvent) e).alignment = lineStyleEvent.alignment;
-            ((StyledTextEvent) e).indent = lineStyleEvent.indent;
-            ((StyledTextEvent) e).justify = lineStyleEvent.justify;
-            ((StyledTextEvent) e).bullet = lineStyleEvent.bullet;
-            ((StyledTextEvent) e).bulletIndex = lineStyleEvent.bulletIndex;
+            LineStyleEvent lineStyleEvent = new LineStyleEvent(cast(StyledTextEvent) e);
+            (cast(LineStyleListener) eventListener).lineGetStyle(lineStyleEvent);
+            (cast(StyledTextEvent) e).ranges = lineStyleEvent.ranges;
+            (cast(StyledTextEvent) e).styles = lineStyleEvent.styles;
+            (cast(StyledTextEvent) e).alignment = lineStyleEvent.alignment;
+            (cast(StyledTextEvent) e).indent = lineStyleEvent.indent;
+            (cast(StyledTextEvent) e).justify = lineStyleEvent.justify;
+            (cast(StyledTextEvent) e).bullet = lineStyleEvent.bullet;
+            (cast(StyledTextEvent) e).bulletIndex = lineStyleEvent.bulletIndex;
             break;
         case StyledText.PaintObject:
-            PaintObjectEvent paintObjectEvent = new PaintObjectEvent((StyledTextEvent) e);
-            ((PaintObjectListener) eventListener).paintObject(paintObjectEvent);
+            PaintObjectEvent paintObjectEvent = new PaintObjectEvent(cast(StyledTextEvent) e);
+            (cast(PaintObjectListener) eventListener).paintObject(paintObjectEvent);
             break;          
         case StyledText.VerifyKey:
             VerifyEvent verifyEvent = new VerifyEvent(e);
-            ((VerifyKeyListener) eventListener).verifyKey(verifyEvent);
+            (cast(VerifyKeyListener) eventListener).verifyKey(verifyEvent);
             e.doit = verifyEvent.doit;
             break;
         case StyledText.TextChanged: {
-            TextChangedEvent textChangedEvent = new TextChangedEvent((StyledTextContent) e.data);
-            ((TextChangeListener) eventListener).textChanged(textChangedEvent);
+            TextChangedEvent textChangedEvent = new TextChangedEvent(cast(StyledTextContent) e.data);
+            (cast(TextChangeListener) eventListener).textChanged(textChangedEvent);
             break;
         }
         case StyledText.TextChanging:
-            TextChangingEvent textChangingEvent = new TextChangingEvent((StyledTextContent) e.data, (StyledTextEvent) e);
-            ((TextChangeListener) eventListener).textChanging(textChangingEvent);
+            TextChangingEvent textChangingEvent = new TextChangingEvent(cast(StyledTextContent) e.data, cast(StyledTextEvent) e);
+            (cast(TextChangeListener) eventListener).textChanging(textChangingEvent);
             break;
         case StyledText.TextSet: {
-            TextChangedEvent textChangedEvent = new TextChangedEvent((StyledTextContent) e.data);
-            ((TextChangeListener) eventListener).textSet(textChangedEvent);
+            TextChangedEvent textChangedEvent = new TextChangedEvent(cast(StyledTextContent) e.data);
+            (cast(TextChangeListener) eventListener).textSet(textChangedEvent);
             break;
         }
         case StyledText.WordNext: {
-            MovementEvent wordBoundaryEvent = new MovementEvent((StyledTextEvent) e);
-            ((MovementListener) eventListener).getNextOffset(wordBoundaryEvent);
-            ((StyledTextEvent) e).end = wordBoundaryEvent.newOffset;
+            MovementEvent wordBoundaryEvent = new MovementEvent(cast(StyledTextEvent) e);
+            (cast(MovementListener) eventListener).getNextOffset(wordBoundaryEvent);
+            (cast(StyledTextEvent) e).end = wordBoundaryEvent.newOffset;
             break;
         }
         case StyledText.WordPrevious: {
-            MovementEvent wordBoundaryEvent = new MovementEvent((StyledTextEvent) e);
-            ((MovementListener) eventListener).getPreviousOffset(wordBoundaryEvent);
-            ((StyledTextEvent) e).end = wordBoundaryEvent.newOffset;
+            MovementEvent wordBoundaryEvent = new MovementEvent(cast(StyledTextEvent) e);
+            (cast(MovementListener) eventListener).getPreviousOffset(wordBoundaryEvent);
+            (cast(StyledTextEvent) e).end = wordBoundaryEvent.newOffset;
             break;
         }
     }
--- a/dwt/custom/StyledTextRenderer.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/StyledTextRenderer.d	Wed Aug 27 14:30:35 2008 +0200
@@ -279,7 +279,7 @@
     if (styles !is null) {
         StyleRange[] newStyles = renderer.styles = new StyleRange[styleCount];
         for (int i = 0; i < newStyles.length; i++) {
-            newStyles[i] = (StyleRange)styles[i].clone();
+            newStyles[i] = cast(StyleRange)styles[i].clone();
         }
         renderer.styleCount = styleCount;
     }
@@ -333,8 +333,8 @@
     switch (type) {
         case ST.BULLET_DOT: String = "\u2022"; break;
         case ST.BULLET_NUMBER: String = String.valueOf(index); break;
-        case ST.BULLET_LETTER_LOWER: String = String.valueOf((char) (index % 26 + 97)); break;
-        case ST.BULLET_LETTER_UPPER: String = String.valueOf((char) (index % 26 + 65)); break;
+        case ST.BULLET_LETTER_LOWER: String = String.valueOf(cast(wchar) (index % 26 + 97)); break;
+        case ST.BULLET_LETTER_UPPER: String = String.valueOf(cast(wchar) (index % 26 + 65)); break;
     }
     if ((bullet.type & ST.BULLET_TEXT) !is 0) String += bullet.text;
     Display display = styledText.getDisplay();
@@ -342,7 +342,7 @@
     layout.setText(String);
     layout.setAscent(lineAscent);
     layout.setDescent(lineDescent);
-    style = (StyleRange)style.clone();
+    style = cast(StyleRange)style.clone();
     style.metrics = null;
     if (style.font is null) style.font = getFont(style.fontStyle);
     layout.setStyle(style, 0, String.length()); 
@@ -427,7 +427,7 @@
             int length = ranges[(i << 1) + 1] - start;
             Point point = layout.getLocation(start, false);
             FontMetrics metrics = layout.getLineMetrics(layout.getLineIndex(start));
-            StyleRange style = (StyleRange)((StyleRange)styles[i]).clone();
+            StyleRange style = cast(StyleRange)(cast(StyleRange)styles[i]).clone();
             style.start = start + lineOffset;
             style.length = length;
             int lineAscent = metrics.getAscent() + metrics.getLeading();
@@ -610,7 +610,7 @@
         newStyles = new StyleRange[((rangeEnd - rangeStart) >> 1) + 1];
         if (includeRanges) {
             for (int i = rangeStart, j = 0; i <= rangeEnd; i += 2, j++) {
-                newStyles[j] = (StyleRange)styles[i >> 1].clone();
+                newStyles[j] = cast(StyleRange)styles[i >> 1].clone();
                 newStyles[j].start = ranges[i];
                 newStyles[j].length = ranges[i + 1];
             }
@@ -627,7 +627,7 @@
     }
     StyleRange style = newStyles[0];
     if (start > style.start) {
-        if (!includeRanges || ranges is null) newStyles[0] = style = (StyleRange)style.clone();
+        if (!includeRanges || ranges is null) newStyles[0] = style = cast(StyleRange)style.clone();
         style.length = style.start + style.length - start;
         style.start = start;
     }
@@ -638,7 +638,7 @@
             System.arraycopy(newStyles, 0, tmp, 0, newStyles.length - 1);
             newStyles = tmp;
         } else {
-            if (!includeRanges || ranges is null) newStyles[newStyles.length - 1] = style = (StyleRange)style.clone();
+            if (!includeRanges || ranges is null) newStyles[newStyles.length - 1] = style = cast(StyleRange)style.clone();
             style.length = end - style.start + 1;
         }
     }
@@ -646,7 +646,7 @@
 }
 StyleRange getStyleRange(StyleRange style) {
     if (style.start is 0 && style.length is 0 && style.fontStyle is DWT.NORMAL) return style;
-    StyleRange clone = (StyleRange)style.clone();
+    StyleRange clone = cast(StyleRange)style.clone();
     clone.start = clone.length = 0;
     clone.fontStyle = DWT.NORMAL;
     if (clone.font is null) clone.font = getFont(style.fontStyle);
@@ -1241,14 +1241,14 @@
             }
             style = styles[modifyStart];
             if (style.start < newStart && newStart < style.start + style.length) {
-                style = mergeStyles[mergeCount++] = (StyleRange)style.clone();
+                style = mergeStyles[mergeCount++] = cast(StyleRange)style.clone();
                 style.length = newStart - style.start;
             }
             mergeStyles[mergeCount++] = newStyle;
             if (modifyEnd < styleCount) {
                 style = styles[modifyEnd];
                 if (style.start < newEnd && newEnd < style.start + style.length) {
-                    style = mergeStyles[mergeCount++] = (StyleRange)style.clone();
+                    style = mergeStyles[mergeCount++] = cast(StyleRange)style.clone();
                     style.length += style.start - newEnd;
                     style.start = newEnd;
                     modifyLast = 1;
@@ -1485,7 +1485,7 @@
                     styles = newStyles;
                 }
                 System.arraycopy(styles, modifyStart + 1, styles, modifyStart + 2, styleCount - (modifyStart + 1));
-                styles[modifyStart + 1] = (StyleRange)styles[modifyStart].clone();
+                styles[modifyStart + 1] = cast(StyleRange)styles[modifyStart].clone();
                 styles[modifyStart + 1].length = styles[modifyStart].start + styles[modifyStart].length - end;
                 styles[modifyStart + 1].start = start + newCharCount;
                 styles[modifyStart].length = start - styles[modifyStart].start;
--- a/dwt/custom/TableEditor.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/TableEditor.d	Wed Aug 27 14:30:35 2008 +0200
@@ -51,7 +51,7 @@
 *           if (oldEditor !is null) oldEditor.dispose();
 *   
 *           // Identify the selected row
-*           TableItem item = (TableItem)e.item;
+*           TableItem item = cast(TableItem)e.item;
 *           if (item is null) return;
 *   
 *           // The control that will be the editor must be a child of the Table
@@ -59,7 +59,7 @@
 *           newEditor.setText(item.getText(EDITABLECOLUMN));
 *           newEditor.addModifyListener(new ModifyListener() {
 *               public void modifyText(ModifyEvent e) {
-*                   Text text = (Text)editor.getEditor();
+*                   Text text = cast(Text)editor.getEditor();
 *                   editor.getItem().setText(EDITABLECOLUMN, text.getText());
 *               }
 *           });
--- a/dwt/custom/TableTree.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/TableTree.d	Wed Aug 27 14:30:35 2008 +0200
@@ -324,7 +324,7 @@
     TableItem[] selection = table.getSelection();
     TableTreeItem [] result = new TableTreeItem[selection.length];
     for (int i = 0; i < selection.length; i++){
-        result[i] = (TableTreeItem) selection[i].getData(ITEMID);
+        result[i] = cast(TableTreeItem) selection[i].getData(ITEMID);
     }
     return result;
 }
@@ -462,7 +462,7 @@
 
 void onSelection(Event e) {
     Event event = new Event();
-    TableItem tableItem = (TableItem)e.item;
+    TableItem tableItem = cast(TableItem)e.item;
     TableTreeItem item = getItem(tableItem);
     event.item = item;
 
@@ -590,7 +590,7 @@
     for (int i = 0; i < items.length; i++) {
         Rectangle rect = items[i].getImageBounds(0);
         if (rect.contains(event.x, event.y)) {
-            TableTreeItem item = (TableTreeItem) items[i].getData(ITEMID);
+            TableTreeItem item = cast(TableTreeItem) items[i].getData(ITEMID);
             event = new Event();
             event.item = item;
             item.setExpanded(!item.getExpanded());
--- a/dwt/custom/TableTreeEditor.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/TableTreeEditor.d	Wed Aug 27 14:30:35 2008 +0200
@@ -58,7 +58,7 @@
 *           if (oldEditor !is null) oldEditor.dispose();
 *   
 *           // Identify the selected row
-*           TableTreeItem item = (TableTreeItem)e.item;
+*           TableTreeItem item = cast(TableTreeItem)e.item;
 *           if (item is null) return;
 *   
 *           // The control that will be the editor must be a child of the Table
@@ -66,7 +66,7 @@
 *           newEditor.setText(item.getText(EDITABLECOLUMN));
 *           newEditor.addModifyListener(new ModifyListener() {
 *               public void modifyText(ModifyEvent e) {
-*                   Text text = (Text)editor.getEditor();
+*                   Text text = cast(Text)editor.getEditor();
 *                   editor.getItem().setText(EDITABLECOLUMN, text.getText());
 *               }
 *           });
--- a/dwt/custom/TreeEditor.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/TreeEditor.d	Wed Aug 27 14:30:35 2008 +0200
@@ -49,7 +49,7 @@
 *           if (oldEditor !is null) oldEditor.dispose();
 *   
 *           // Identify the selected row
-*           TreeItem item = (TreeItem)e.item;
+*           TreeItem item = cast(TreeItem)e.item;
 *           if (item is null) return;
 *   
 *           // The control that will be the editor must be a child of the Tree
@@ -57,7 +57,7 @@
 *           newEditor.setText(item.getText());
 *           newEditor.addModifyListener(new ModifyListener() {
 *               public void modifyText(ModifyEvent e) {
-*                   Text text = (Text)editor.getEditor();
+*                   Text text = cast(Text)editor.getEditor();
 *                   editor.getItem().setText(text.getText());
 *               }
 *           });
--- a/dwt/custom/ViewForm.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/ViewForm.d	Wed Aug 27 14:30:35 2008 +0200
@@ -28,7 +28,7 @@
  * <dt><b>Styles:</b></dt>
  * <dd>BORDER, FLAT</dd>
  * <dt><b>Events:</b></dt>
- * <dd>(None)</dd>
+ * <dd>cast(None)</dd>
  * </dl>
  * <p>
  * IMPORTANT: This class is <em>not</em> intended to be subclassed.
--- a/dwt/custom/ViewFormLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/custom/ViewFormLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -22,7 +22,7 @@
 class ViewFormLayout : Layout {
 
 protected Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
-    ViewForm form = (ViewForm)composite;
+    ViewForm form = cast(ViewForm)composite;
     Control left = form.topLeft;
     Control center = form.topCenter;
     Control right = form.topRight;
@@ -86,12 +86,12 @@
         data = new CLayoutData();
         control.setLayoutData(data);
     }
-    return ((CLayoutData)data).computeSize(control, wHint, hHint, flushCache);
+    return (cast(CLayoutData)data).computeSize(control, wHint, hHint, flushCache);
 }
 
 int computeTrim(Control c) {
     if (c instanceof Scrollable) {
-        Rectangle rect = ((Scrollable) c).computeTrim (0, 0, 0, 0);
+        Rectangle rect = (cast(Scrollable) c).computeTrim (0, 0, 0, 0);
         return rect.width;
     }
     return c.getBorderWidth () * 2;
@@ -99,12 +99,12 @@
 
 protected bool flushCache(Control control) {
     Object data = control.getLayoutData();
-    if (data !is null && data instanceof CLayoutData) ((CLayoutData)data).flushCache();
+    if (data !is null && data instanceof CLayoutData) (cast(CLayoutData)data).flushCache();
     return true;
 }
 
 protected void layout(Composite composite, bool flushCache) {
-    ViewForm form = (ViewForm)composite;
+    ViewForm form = cast(ViewForm)composite;
     Control left = form.topLeft;
     Control center = form.topCenter;
     Control right = form.topRight;
@@ -176,7 +176,7 @@
         }
         if (left !is null && !left.isDisposed()) {
             top = true;
-            Rectangle trim = left instanceof Composite ? ((Composite)left).computeTrim(0, 0, 0, 0) : new Rectangle(0, 0, 0, 0);
+            Rectangle trim = left instanceof Composite ? (cast(Composite)left).computeTrim(0, 0, 0, 0) : new Rectangle(0, 0, 0, 0);
             int w = x - rect.x - form.marginWidth - form.highlight - trim.width;
             int h = topHeight - trim.height;
             leftSize = computeChildSize(left, w, h, false);
--- a/dwt/dnd/Clipboard.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/Clipboard.d	Wed Aug 27 14:30:35 2008 +0200
@@ -203,10 +203,10 @@
  *    <code><pre>
  *    Clipboard clipboard = new Clipboard(display);
  *    TextTransfer textTransfer = TextTransfer.getInstance();
- *    String textData = (String)clipboard.getContents(textTransfer);
+ *    String textData = cast(String)clipboard.getContents(textTransfer);
  *    if (textData !is null) System.out.println("Text is "+textData);
  *    RTFTransfer rtfTransfer = RTFTransfer.getInstance();
- *    String rtfData = (String)clipboard.getContents(rtfTransfer);
+ *    String rtfData = cast(String)clipboard.getContents(rtfTransfer);
  *    if (rtfData !is null) System.out.println("RTF Text is "+rtfData);
  *    clipboard.dispose();
  *    </code></pre>
@@ -239,10 +239,10 @@
  *    <code><pre>
  *    Clipboard clipboard = new Clipboard(display);
  *    TextTransfer textTransfer = TextTransfer.getInstance();
- *    String textData = (String)clipboard.getContents(textTransfer);
+ *    String textData = cast(String)clipboard.getContents(textTransfer);
  *    if (textData !is null) System.out.println("Text is "+textData);
  *    RTFTransfer rtfTransfer = RTFTransfer.getInstance();
- *    String rtfData = (String)clipboard.getContents(rtfTransfer, DND.CLIPBOARD);
+ *    String rtfData = cast(String)clipboard.getContents(rtfTransfer, DND.CLIPBOARD);
  *    if (rtfData !is null) System.out.println("RTF Text is "+rtfData);
  *    clipboard.dispose();
  *    </code></pre>
@@ -541,10 +541,10 @@
     for (int i = 0; i < types.length; i++) {
         int type = types[i];
         StringBuffer sb = new StringBuffer();
-        sb.append((char)((type & 0xff000000) >> 24));
-        sb.append((char)((type & 0x00ff0000) >> 16));
-        sb.append((char)((type & 0x0000ff00) >> 8));
-        sb.append((char)((type & 0x000000ff) >> 0));
+        sb.append(cast(wchar)((type & 0xff000000) >> 24));
+        sb.append(cast(wchar)((type & 0x00ff0000) >> 16));
+        sb.append(cast(wchar)((type & 0x0000ff00) >> 8));
+        sb.append(cast(wchar)((type & 0x000000ff) >> 0));
         names[i] = sb.toString();
     }
     return names;
--- a/dwt/dnd/DNDListener.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/DNDListener.d	Wed Aug 27 14:30:35 2008 +0200
@@ -26,93 +26,93 @@
 public void handleEvent (Event e) {
     switch (e.type) {
         case DND.DragStart: {
-            DragSourceEvent event = new DragSourceEvent((DNDEvent)e);
-            DragSourceEffect sourceEffect = ((DragSource) dndWidget).getDragSourceEffect();
+            DragSourceEvent event = new DragSourceEvent(cast(DNDEvent)e);
+            DragSourceEffect sourceEffect = (cast(DragSource) dndWidget).getDragSourceEffect();
             if (sourceEffect !is null) {
                 sourceEffect.dragStart (event);
             }
-            ((DragSourceListener) eventListener).dragStart (event);
-            event.updateEvent((DNDEvent)e);
+            (cast(DragSourceListener) eventListener).dragStart (event);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         case DND.DragEnd: {
-            DragSourceEvent event = new DragSourceEvent((DNDEvent)e);
-            DragSourceEffect sourceEffect = ((DragSource) dndWidget).getDragSourceEffect();
+            DragSourceEvent event = new DragSourceEvent(cast(DNDEvent)e);
+            DragSourceEffect sourceEffect = (cast(DragSource) dndWidget).getDragSourceEffect();
             if (sourceEffect !is null) {
                 sourceEffect.dragFinished (event);
             }
-            ((DragSourceListener) eventListener).dragFinished (event);
-            event.updateEvent((DNDEvent)e);
+            (cast(DragSourceListener) eventListener).dragFinished (event);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         case DND.DragSetData: {
-            DragSourceEvent event = new DragSourceEvent((DNDEvent)e);
-            DragSourceEffect sourceEffect = ((DragSource) dndWidget).getDragSourceEffect();
+            DragSourceEvent event = new DragSourceEvent(cast(DNDEvent)e);
+            DragSourceEffect sourceEffect = (cast(DragSource) dndWidget).getDragSourceEffect();
             if (sourceEffect !is null) {
                 sourceEffect.dragSetData (event);
             }
-            ((DragSourceListener) eventListener).dragSetData (event);
-            event.updateEvent((DNDEvent)e);
+            (cast(DragSourceListener) eventListener).dragSetData (event);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         case DND.DragEnter: {
-            DropTargetEvent event = new DropTargetEvent((DNDEvent)e);
-            ((DropTargetListener) eventListener).dragEnter (event);
-            DropTargetEffect dropEffect = ((DropTarget) dndWidget).getDropTargetEffect();
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dragEnter (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
             if (dropEffect !is null) {
                 dropEffect.dragEnter (event);
             }
-            event.updateEvent((DNDEvent)e);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         case DND.DragLeave: {
-            DropTargetEvent event = new DropTargetEvent((DNDEvent)e);
-            ((DropTargetListener) eventListener).dragLeave (event);
-            DropTargetEffect dropEffect = ((DropTarget) dndWidget).getDropTargetEffect();
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dragLeave (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
             if (dropEffect !is null) {
                 dropEffect.dragLeave (event);
             }
-            event.updateEvent((DNDEvent)e);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         case DND.DragOver: {
-            DropTargetEvent event = new DropTargetEvent((DNDEvent)e);
-            ((DropTargetListener) eventListener).dragOver (event);
-            DropTargetEffect dropEffect = ((DropTarget) dndWidget).getDropTargetEffect();
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dragOver (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
             if (dropEffect !is null) {
                 dropEffect.dragOver (event);
             }
-            event.updateEvent((DNDEvent)e);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         case DND.Drop: {
-            DropTargetEvent event = new DropTargetEvent((DNDEvent)e);
-            ((DropTargetListener) eventListener).drop (event);
-            DropTargetEffect dropEffect = ((DropTarget) dndWidget).getDropTargetEffect();
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).drop (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
             if (dropEffect !is null) {
                 dropEffect.drop (event);
             }
-            event.updateEvent((DNDEvent)e);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         case DND.DropAccept: {
-            DropTargetEvent event = new DropTargetEvent((DNDEvent)e);
-            ((DropTargetListener) eventListener).dropAccept (event);
-            DropTargetEffect dropEffect = ((DropTarget) dndWidget).getDropTargetEffect();
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dropAccept (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
             if (dropEffect !is null) {
                 dropEffect.dropAccept (event);
             }
-            event.updateEvent((DNDEvent)e);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         case DND.DragOperationChanged: {
-            DropTargetEvent event = new DropTargetEvent((DNDEvent)e);
-            ((DropTargetListener) eventListener).dragOperationChanged (event);
-            DropTargetEffect dropEffect = ((DropTarget) dndWidget).getDropTargetEffect();
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dragOperationChanged (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
             if (dropEffect !is null) {
                 dropEffect.dragOperationChanged (event);
             }
-            event.updateEvent((DNDEvent)e);
+            event.updateEvent(cast(DNDEvent)e);
             break;
         }
         
--- a/dwt/dnd/DragSource.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/DragSource.d	Wed Aug 27 14:30:35 2008 +0200
@@ -175,11 +175,11 @@
     
     Object effect = control.getData(DEFAULT_DRAG_SOURCE_EFFECT);
     if (effect instanceof DragSourceEffect) {
-        dragEffect = (DragSourceEffect) effect;
+        dragEffect = cast(DragSourceEffect) effect;
     } else if (control instanceof Tree) {
-        dragEffect = new TreeDragSourceEffect((Tree) control);
+        dragEffect = new TreeDragSourceEffect(cast(Tree) control);
     } else if (control instanceof Table) {
-        dragEffect = new TableDragSourceEffect((Table) control);
+        dragEffect = new TableDragSourceEffect(cast(Table) control);
     }
 }
 
@@ -200,7 +200,7 @@
     if (display is null || display.isDisposed()) return null;
     Widget widget = display.findWidget(dragSendRefCon);
     if (widget is null) return null;
-    return (DragSource)widget.getData(DND.DRAG_SOURCE_KEY); 
+    return cast(DragSource)widget.getData(DND.DRAG_SOURCE_KEY); 
 }
 
 /**
@@ -263,7 +263,7 @@
     if (OS.NewDrag(theDrag) !is OS.noErr) {
         event = new DNDEvent();
         event.widget = this;
-        event.time = (int)System.currentTimeMillis();
+        event.time = cast(int)System.currentTimeMillis();
         event.doit = false;
         event.detail = DND.DROP_NONE; 
         notifyListeners(DND.DragEnd, event);
@@ -282,7 +282,7 @@
                 transferData.type = types[0];
                 DNDEvent event2 = new DNDEvent();
                 event2.widget = this;
-                event2.time = (int)System.currentTimeMillis(); 
+                event2.time = cast(int)System.currentTimeMillis(); 
                 event2.dataType = transferData; 
                 notifyListeners(DND.DragSetData, event2);
                 if (event2.data !is null) {
@@ -311,7 +311,7 @@
     Image newImage = null;
     try {   
         theRegion = OS.NewRgn();
-        OS.SetRectRgn(theRegion, (short)(pt.h), (short)(pt.v), (short)(pt.h+20), (short)(pt.v+20));
+        OS.SetRectRgn(theRegion, cast(short)(pt.h), cast(short)(pt.v), cast(short)(pt.h+20), cast(short)(pt.v+20));
         
         int operations = opToOsOp(getStyle());
         //set operations twice - local and not local
@@ -339,8 +339,8 @@
         }
         EventRecord theEvent = new EventRecord();
         theEvent.message = OS.kEventMouseMoved;
-        theEvent.modifiers = (short)OS.GetCurrentEventKeyModifiers();
-        theEvent.what = (short)OS.osEvt;
+        theEvent.modifiers = cast(short)OS.GetCurrentEventKeyModifiers();
+        theEvent.what = cast(short)OS.osEvt;
         theEvent.where_h = pt.h;
         theEvent.where_v = pt.v;    
         int result = OS.TrackDrag(theDrag[0], theEvent, theRegion);
@@ -352,7 +352,7 @@
         }   
         event = new DNDEvent();
         event.widget = this;
-        event.time = (int)System.currentTimeMillis();
+        event.time = cast(int)System.currentTimeMillis();
         event.doit = result is OS.noErr;
         event.detail = operation; 
         notifyListeners(DND.DragEnd, event);
@@ -369,7 +369,7 @@
     transferData.type = theType;
     DNDEvent event = new DNDEvent();
     event.widget = this;
-    event.time = (int)System.currentTimeMillis(); 
+    event.time = cast(int)System.currentTimeMillis(); 
     event.dataType = transferData; 
     notifyListeners(DND.DragSetData, event);
     Transfer transfer = null;
@@ -425,7 +425,7 @@
     for (int i = 0; i < length; i++) {
         Listener listener = listeners[i];
         if (listener instanceof DNDListener) {
-            dragListeners[count] = (DragSourceListener) ((DNDListener) listener).getEventListener();
+            dragListeners[count] = cast(DragSourceListener) (cast(DNDListener) listener).getEventListener();
             count++;
         }
     }
--- a/dwt/dnd/DropTarget.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/DropTarget.d	Wed Aug 27 14:30:35 2008 +0200
@@ -56,7 +56,7 @@
  *              event.detail = DND.DROP_NONE;
  *              return;
  *          }
- *          label.setText ((String) event.data); // data copied to label text
+ *          label.setText (cast(String) event.data); // data copied to label text
  *      }
  *  });
  * </pre></code>
@@ -168,11 +168,11 @@
 
     Object effect = control.getData(DEFAULT_DROP_TARGET_EFFECT);
     if (effect instanceof DropTargetEffect) {
-        dropEffect = (DropTargetEffect) effect;
+        dropEffect = cast(DropTargetEffect) effect;
     } else if (control instanceof Table) {
-        dropEffect = new TableDropTargetEffect((Table) control);
+        dropEffect = new TableDropTargetEffect(cast(Table) control);
     } else if (control instanceof Tree) {
-        dropEffect = new TreeDropTargetEffect((Tree) control);
+        dropEffect = new TreeDropTargetEffect(cast(Tree) control);
     }
 
     dragOverHeartbeat = new Runnable() {
@@ -182,7 +182,7 @@
             long time = System.currentTimeMillis();
             int delay = DRAGOVER_HYSTERESIS;
             if (time < dragOverStart) {
-                delay = (int)(dragOverStart - time);
+                delay = cast(int)(dragOverStart - time);
             } else {    
                 int allowedOperations = dragOverEvent.operations;
                 TransferData[] allowedTypes = dragOverEvent.dataTypes;
@@ -194,7 +194,7 @@
                 event.widget = dragOverEvent.widget;
                 event.x = dragOverEvent.x;
                 event.y = dragOverEvent.y;
-                event.time = (int)time;
+                event.time = cast(int)time;
                 event.feedback = DND.FEEDBACK_SELECT;
                 event.dataTypes = dataTypes;
                 event.dataType = selectedDataType;
@@ -265,7 +265,7 @@
     OS.GetRootControl(theWindow, theRoot);
     int[] theControl = new int[1];
     Rect rect = new Rect();
-    OS.GetWindowBounds (theWindow, (short) OS.kWindowContentRgn, rect);
+    OS.GetWindowBounds (theWindow, cast(short) OS.kWindowContentRgn, rect);
     CGPoint inPoint = new CGPoint();
     inPoint.x = mouse.h - rect.left;
     inPoint.y = mouse.v - rect.top;
@@ -273,7 +273,7 @@
     if (!OS.IsControlEnabled(theControl[0])) return null;               
     Widget widget = display.findWidget(theControl[0]);
     if (widget is null) return null;
-    return (DropTarget)widget.getData(DND.DROP_TARGET_KEY);
+    return cast(DropTarget)widget.getData(DND.DROP_TARGET_KEY);
 }
 /**
  * Adds the listener to the collection of listeners who will
@@ -333,7 +333,7 @@
 
     DNDEvent event = new DNDEvent();
     event.widget = this;
-    event.time = (int)System.currentTimeMillis();
+    event.time = cast(int)System.currentTimeMillis();
     event.detail = DND.DROP_NONE;
     notifyListeners(DND.DragLeave, event);
     
@@ -374,7 +374,7 @@
     OS.CountDragItems(theDrag, numItems);
     for (short i = 0; i < numItems[0]; i++) {
         int[] theItemRef = new int[1];
-        OS.GetDragItemReferenceNumber(theDrag, (short) (i+1), theItemRef);
+        OS.GetDragItemReferenceNumber(theDrag, cast(short) (i+1), theItemRef);
         int[] size = new int[1];
         OS.GetFlavorDataSize(theDrag, theItemRef[0], selectedDataType.type, size);
         if (size[0] > 0) {
@@ -425,7 +425,7 @@
         
         DNDEvent event = new DNDEvent();
         event.widget = this;
-        event.time = (int)System.currentTimeMillis();
+        event.time = cast(int)System.currentTimeMillis();
         event.detail = DND.DROP_NONE;
         notifyListeners(DND.DragLeave, event);
         return OS.noErr;
@@ -544,7 +544,7 @@
     for (int i = 0; i < length; i++) {
         Listener listener = listeners[i];
         if (listener instanceof DNDListener) {
-            dropListeners[count] = (DropTargetListener) ((DNDListener) listener).getEventListener();
+            dropListeners[count] = cast(DropTargetListener) (cast(DNDListener) listener).getEventListener();
             count++;
         }
     }
@@ -698,13 +698,13 @@
     //Get a unique list of flavors
     for (short i = 0; i < numItems[0]; i++) {
         int[] theItemRef = new int[1];
-        OS.GetDragItemReferenceNumber(theDrag, (short) (i+1), theItemRef);
+        OS.GetDragItemReferenceNumber(theDrag, cast(short) (i+1), theItemRef);
         short[] numFlavors = new short[1];
         OS.CountDragItemFlavors(theDrag, theItemRef[0], numFlavors);
         int[] theType = new int[1];
         for (int j = 0; j < numFlavors[0]; j++) {
             theType[0] = 0;
-            if (OS.GetFlavorType(theDrag, theItemRef[0], (short) (j+1), theType) is OS.noErr) {
+            if (OS.GetFlavorType(theDrag, theItemRef[0], cast(short) (j+1), theType) is OS.noErr) {
                 bool unique = true;
                 for (int k = 0; k < flavors.length; k++) {
                     if (flavors[k] is theType[0]) {
@@ -754,7 +754,7 @@
     event.widget = this;
     event.x = mouse.h;
     event.y = mouse.v;
-    event.time = (int)System.currentTimeMillis();
+    event.time = cast(int)System.currentTimeMillis();
     event.feedback = DND.FEEDBACK_SELECT;
     event.dataTypes = dataTypes;
     event.dataType = dataTypes[0];
--- a/dwt/dnd/DropTargetEffect.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/DropTargetEffect.d	Wed Aug 27 14:30:35 2008 +0200
@@ -86,10 +86,10 @@
      */
     public Widget getItem(int x, int y) {
         if (control instanceof Table) {
-            return getItem((Table) control, x, y);
+            return getItem(cast(Table) control, x, y);
         }
         if (control instanceof Tree) {
-            return getItem((Tree) control, x, y);
+            return getItem(cast(Tree) control, x, y);
         }           
         return null;
     }
--- a/dwt/dnd/DropTargetListener.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/DropTargetListener.d	Wed Aug 27 14:30:35 2008 +0200
@@ -176,9 +176,9 @@
  * <pre><code>
  * public void dragOver(DropTargetEvent event) {
  *       TextTransfer textTransfer = TextTransfer.getInstance();
- *       String data = (String)textTransfer.nativeToJava(event.currentDataType);
+ *       String data = cast(String)textTransfer.nativeToJava(event.currentDataType);
  *       if (data !is null) {
- *           System.out.println("Data to be dropped is (Text)"+data);
+ *           System.out.println("Data to be dropped is cast(Text)"+data);
  *       }
  * };
  * </code></pre>
--- a/dwt/dnd/HTMLTransfer.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/HTMLTransfer.d	Wed Aug 27 14:30:35 2008 +0200
@@ -55,7 +55,7 @@
     if (!checkHTML(object) || !isSupportedType(transferData)) {
         DND.error(DND.ERROR_INVALID_DATA);
     }
-    String String = (String)object;
+    String String = cast(String)object;
     int count = String.length();
     char[] chars = new char[count];
     String.getChars(0, count, chars, 0);
@@ -94,7 +94,7 @@
 }
 
 bool checkHTML(Object object) {
-    return (object !is null && object instanceof String && ((String)object).length() > 0);
+    return (object !is null && object instanceof String && (cast(String)object).length() > 0);
 }
 
 protected bool validate(Object object) {
--- a/dwt/dnd/ImageTransfer.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/ImageTransfer.d	Wed Aug 27 14:30:35 2008 +0200
@@ -72,7 +72,7 @@
     }
     transferData.result = -1;
 
-    ImageData imgData = (ImageData) object;
+    ImageData imgData = cast(ImageData) object;
     Image image = new Image(Display.getCurrent(), imgData);
     int handle = image.handle;
     int width = OS.CGImageGetWidth(handle);
@@ -83,8 +83,8 @@
     Rect rect = new Rect();
     rect.left = 0;
     rect.top = 0;
-    rect.right = (short) width;
-    rect.bottom = (short) height;
+    rect.right = cast(short) width;
+    rect.bottom = cast(short) height;
 
     int[] gWorld = new int[1];
     int format = OS.k24RGBPixelFormat;
@@ -98,7 +98,7 @@
     OS.SetGWorld(gWorld[0], curGWorld[0]);
     int pictHandle = OS.OpenPicture(rect);
     int portBitMap = OS.GetPortBitMapForCopyBits(gWorld[0]);
-    OS.CopyBits(portBitMap, portBitMap, rect, rect, (short) OS.srcCopy, 0);
+    OS.CopyBits(portBitMap, portBitMap, rect, rect, cast(short) OS.srcCopy, 0);
     OS.ClosePicture();
     OS.SetGWorld(curPort[0], curGWorld[0]);
     OS.DisposeGWorld(gWorld[0]);
@@ -142,8 +142,8 @@
         // get bounds for the image
         CGRect rect = new CGRect();
         OS.QDPictGetBounds(pictDataRef, rect);
-        int width = (int) rect.width;
-        int height = (int) rect.height;
+        int width = cast(int) rect.width;
+        int height = cast(int) rect.height;
 
         /* Create the image */
         int bpr = width * 4;
--- a/dwt/dnd/RTFTransfer.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/RTFTransfer.d	Wed Aug 27 14:30:35 2008 +0200
@@ -57,7 +57,7 @@
         DND.error(DND.ERROR_INVALID_DATA);
     }
     transferData.result = -1;
-    String String = (String)object;
+    String String = cast(String)object;
     int count = String.length();
     char[] chars = new char[count];
     String.getChars(0, count, chars, 0);
@@ -68,10 +68,10 @@
         range.length = chars.length;
         int encoding = OS.CFStringGetSystemEncoding();
         int[] size = new int[1];
-        int numChars = OS.CFStringGetBytes(cfString, range, encoding, (byte)'?', true, null, 0, size);
+        int numChars = OS.CFStringGetBytes(cfString, range, encoding, cast(byte)'?', true, null, 0, size);
         if (numChars is 0 || size[0] is 0) return;
         byte[] buffer = new byte[size[0]];
-        numChars = OS.CFStringGetBytes(cfString, range, encoding, (byte)'?', true, buffer, size [0], size);
+        numChars = OS.CFStringGetBytes(cfString, range, encoding, cast(byte)'?', true, buffer, size [0], size);
         if (numChars is 0) return;
         transferData.data = new byte[1][];
         transferData.data[0] = buffer;
@@ -120,7 +120,7 @@
 }
 
 bool checkRTF(Object object) {
-    return (object !is null && object instanceof String && ((String)object).length() > 0);
+    return (object !is null && object instanceof String && (cast(String)object).length() > 0);
 }
 
 protected bool validate(Object object) {
--- a/dwt/dnd/TableDropTargetEffect.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/TableDropTargetEffect.d	Wed Aug 27 14:30:35 2008 +0200
@@ -72,7 +72,7 @@
         if (display is null || display.isDisposed()) return null;
         Widget widget = display.findWidget(theControl);
         if (widget is null) return null;
-        return (DropTarget)widget.getData(DND.DROP_TARGET_KEY); 
+        return cast(DropTarget)widget.getData(DND.DROP_TARGET_KEY); 
     }
     
     /**
@@ -108,7 +108,7 @@
      */
     public void dragEnter(DropTargetEvent event) {
         if (callbacks is null) {
-            Table table = (Table) control;
+            Table table = cast(Table) control;
             DataBrowserCallbacks callbacks = new DataBrowserCallbacks ();
             OS.GetDataBrowserCallbacks (table.handle, callbacks);
             callbacks.v1_acceptDragCallback = AcceptDragProc.getAddress();
@@ -155,10 +155,10 @@
      * @see DND#FEEDBACK_SCROLL
      */
     public void dragOver(DropTargetEvent event) {
-        Table table = (Table) control;
+        Table table = cast(Table) control;
         int effect = checkEffect(event.feedback);
 
-        TableItem item = (TableItem)getItem(table, event.x, event.y);
+        TableItem item = cast(TableItem)getItem(table, event.x, event.y);
 
         if ((effect & DND.FEEDBACK_SCROLL) is 0) {
             scrollBeginTime = 0;
@@ -191,6 +191,6 @@
         }
         
         // store current effect for selection feedback
-        ((DropTarget)event.widget).feedback = effect;
+        (cast(DropTarget)event.widget).feedback = effect;
     }
 }
--- a/dwt/dnd/TextTransfer.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/TextTransfer.d	Wed Aug 27 14:30:35 2008 +0200
@@ -60,7 +60,7 @@
     if (!checkText(object) || !isSupportedType(transferData)) {
         DND.error(DND.ERROR_INVALID_DATA);
     }
-    String String = (String)object;
+    String String = cast(String)object;
     char[] chars = new char[String.length()];
     String.getChars (0, chars.length, chars, 0);
     transferData.result = -1;
@@ -74,10 +74,10 @@
                 range.length = chars.length;
                 int encoding = OS.CFStringGetSystemEncoding();
                 int[] size = new int[1];
-                int numChars = OS.CFStringGetBytes(cfString, range, encoding, (byte)'?', true, null, 0, size);
+                int numChars = OS.CFStringGetBytes(cfString, range, encoding, cast(byte)'?', true, null, 0, size);
                 if (numChars is 0) return;
                 buffer = new byte[size[0]];
-                numChars = OS.CFStringGetBytes(cfString, range, encoding, (byte)'?', true, buffer, size [0], size);
+                numChars = OS.CFStringGetBytes(cfString, range, encoding, cast(byte)'?', true, buffer, size [0], size);
                 if (numChars is 0) return;
             } finally {
                 OS.CFRelease(cfString);
@@ -146,7 +146,7 @@
 }
 
 bool checkText(Object object) {
-    return (object !is null && object instanceof String && ((String)object).length() > 0);
+    return (object !is null && object instanceof String && (cast(String)object).length() > 0);
 }
 protected bool validate(Object object) {
     return checkText(object);
--- a/dwt/dnd/TreeDropTargetEffect.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/TreeDropTargetEffect.d	Wed Aug 27 14:30:35 2008 +0200
@@ -90,7 +90,7 @@
         if (display is null || display.isDisposed()) return null;
         Widget widget = display.findWidget(theControl);
         if (widget is null) return null;
-        return (DropTarget)widget.getData(DND.DROP_TARGET_KEY); 
+        return cast(DropTarget)widget.getData(DND.DROP_TARGET_KEY); 
     }
 
     /**
@@ -126,7 +126,7 @@
      */
     public void dragEnter(DropTargetEvent event) {
         if (callbacks is null) {
-            Tree table = (Tree) control;
+            Tree table = cast(Tree) control;
             DataBrowserCallbacks callbacks = new DataBrowserCallbacks ();
             OS.GetDataBrowserCallbacks (table.handle, callbacks);
             callbacks.v1_acceptDragCallback = AcceptDragProc.getAddress();
@@ -154,7 +154,7 @@
      * @see DropTargetEvent
      */
     public void dragLeave(DropTargetEvent event) {
-        Tree tree = (Tree) control;
+        Tree tree = cast(Tree) control;
         if (insertItem !is null) {
             setInsertMark(tree, null, false);
             insertItem = null;
@@ -184,8 +184,8 @@
      * @see DND#FEEDBACK_SCROLL
      */
     public void dragOver(DropTargetEvent event) {
-        Tree tree = (Tree) control;
-        TreeItem item = (TreeItem)getItem(tree, event.x, event.y);
+        Tree tree = cast(Tree) control;
+        TreeItem item = cast(TreeItem)getItem(tree, event.x, event.y);
         int effect = checkEffect(event.feedback);       
         if ((effect & DND.FEEDBACK_EXPAND) is 0) {
             expandBeginTime = 0;
@@ -198,7 +198,7 @@
                         e.x = event.x;
                         e.y = event.y;
                         e.item = item;
-                        e.time = (int) System.currentTimeMillis();
+                        e.time = cast(int) System.currentTimeMillis();
                         tree.notifyListeners(DWT.Expand, e);
                         if (item.isDisposed()) return;
                         item.setExpanded(true);
@@ -253,7 +253,7 @@
             setInsertMark(tree, null, false);
         }
         // save current effect for selection feedback
-        ((DropTarget)event.widget).feedback = effect;
+        (cast(DropTarget)event.widget).feedback = effect;
     }
 
     void setInsertMark(Tree tree, TreeItem item, bool before) {
--- a/dwt/dnd/URLTransfer.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/URLTransfer.d	Wed Aug 27 14:30:35 2008 +0200
@@ -1,1 +1,1 @@
-/*******************************************************************************
 * Copyright (c) 20007 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
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
module dwt.dnd;

import dwt.internal.carbon.*;

/**
 * The class <code>URLTransfer</code> provides a platform specific mechanism 
 * for converting text in URL format represented as a java <code>String</code> 
 * to a platform specific representation of the data and vice versa.  See 
 * <code>Transfer</code> for additional information. The String  
 * must contain the fully specified url.
 * 
 * <p>An example of a java <code>String[]</code> containing a URL is shown 
 * below:</p>
 * 
 * <code><pre>
 *     String url = "http://www.eclipse.org";
 * </code></pre>
 */
public class URLTransfer : ByteArrayTransfer {

  static URLTransfer _instance = new URLTransfer();
 static final String URL = "url "; //$NON-NLS-1$
   static final int URL_ID = registerType(URL);
  static final String URLN = "urln"; //$NON-NLS-1$
  static final int URLN_ID = registerType(URLN);

private URLTransfer() {}

/**
 * Returns the singleton instance of the URLTransfer class.
 *
 * @return the singleton instance of the URLTransfer class
 */
public static URLTransfer getInstance () {
   return _instance;
}

/**
 * This implementation of <code>javaToNative</code> converts a URL
 * represented by a java <code>String</code> to a platform specific representation.
 * For additional information see <code>Transfer#javaToNative</code>.
 * 
 * @param object a java <code>String[]</code> containing a URL
 * @param transferData an empty <code>TransferData</code> object; this
 *  object will be filled in on return with the platform specific format of the data
 */
public void javaToNative (Object object, TransferData transferData){
 if (!checkURL(object) || !isSupportedType(transferData)) {
        DND.error(DND.ERROR_INVALID_DATA);
    }
 transferData.result = -1;
 String url = (String)object;
  int count = url.length();
 char[] chars = new char[count];
   url.getChars(0, count, chars, 0);
 int cfString = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, chars, count);
 if (cfString is 0) return;
    try {
     CFRange range = new CFRange();
        range.length = chars.length;
      int encoding = OS.CFStringGetSystemEncoding();
        int[] size = new int[1];
      int numChars = OS.CFStringGetBytes(cfString, range, encoding, (byte)'?', true, null, 0, size);
        if (numChars is 0 || size[0] is 0) return;
        byte[] buffer = new byte[size[0]];
        numChars = OS.CFStringGetBytes(cfString, range, encoding, (byte)'?', true, buffer, size [0], size);
       if (numChars is 0) return;
        transferData.data = new byte[][] {buffer};
        transferData.result = 0;
  } finally {
       OS.CFRelease(cfString);
   }
}

/**
 * This implementation of <code>nativeToJava</code> converts a platform specific 
 * representation of a URL to a java <code>String</code>.
 * For additional information see <code>Transfer#nativeToJava</code>.
 * 
 * @param transferData the platform specific representation of the data to be 
 * converted
 * @return a java <code>String[]</code> containing a URL if the 
 * conversion was successful; otherwise null
 */
public Object nativeToJava(TransferData transferData){
  if (!isSupportedType(transferData) || transferData.data is null) return null;
 if (transferData.data.length is 0) return null;
   byte[] buffer = transferData.data[0];
 int encoding = OS.CFStringGetSystemEncoding();
    int cfString = OS.CFStringCreateWithBytes(OS.kCFAllocatorDefault, buffer, buffer.length, encoding, true);
 if (cfString is 0) return null;
   try {
     int length = OS.CFStringGetLength(cfString);
      if (length is 0) return null;
     char[] chars = new char[length];
      CFRange range = new CFRange();
        range.length = length;
        OS.CFStringGetCharacters(cfString, range, chars);
     return new String(chars);
 } finally {
       OS.CFRelease(cfString);
   }
}

protected int[] getTypeIds(){
 return new int[] {URL_ID, URLN_ID};
}

protected String[] getTypeNames(){
  return new String[] {URL, URLN}; 
}

bool checkURL(Object object) {
    return object !is null && (object instanceof String) && ((String)object).length() > 0;
}

protected bool validate(Object object) {
 return checkURL(object);
}
}
+/*******************************************************************************
 * Copyright (c) 20007 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
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
module dwt.dnd;

import dwt.internal.carbon.*;

/**
 * The class <code>URLTransfer</code> provides a platform specific mechanism 
 * for converting text in URL format represented as a java <code>String</code> 
 * to a platform specific representation of the data and vice versa.  See 
 * <code>Transfer</code> for additional information. The String  
 * must contain the fully specified url.
 * 
 * <p>An example of a java <code>String[]</code> containing a URL is shown 
 * below:</p>
 * 
 * <code><pre>
 *     String url = "http://www.eclipse.org";
 * </code></pre>
 */
public class URLTransfer : ByteArrayTransfer {

  static URLTransfer _instance = new URLTransfer();
 static final String URL = "url "; //$NON-NLS-1$
   static final int URL_ID = registerType(URL);
  static final String URLN = "urln"; //$NON-NLS-1$
  static final int URLN_ID = registerType(URLN);

private URLTransfer() {}

/**
 * Returns the singleton instance of the URLTransfer class.
 *
 * @return the singleton instance of the URLTransfer class
 */
public static URLTransfer getInstance () {
   return _instance;
}

/**
 * This implementation of <code>javaToNative</code> converts a URL
 * represented by a java <code>String</code> to a platform specific representation.
 * For additional information see <code>Transfer#javaToNative</code>.
 * 
 * @param object a java <code>String[]</code> containing a URL
 * @param transferData an empty <code>TransferData</code> object; this
 *  object will be filled in on return with the platform specific format of the data
 */
public void javaToNative (Object object, TransferData transferData){
 if (!checkURL(object) || !isSupportedType(transferData)) {
        DND.error(DND.ERROR_INVALID_DATA);
    }
 transferData.result = -1;
 String url = cast(String)object;
  int count = url.length();
 char[] chars = new char[count];
   url.getChars(0, count, chars, 0);
 int cfString = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, chars, count);
 if (cfString is 0) return;
    try {
     CFRange range = new CFRange();
        range.length = chars.length;
      int encoding = OS.CFStringGetSystemEncoding();
        int[] size = new int[1];
      int numChars = OS.CFStringGetBytes(cfString, range, encoding, cast(byte)'?', true, null, 0, size);
        if (numChars is 0 || size[0] is 0) return;
        byte[] buffer = new byte[size[0]];
        numChars = OS.CFStringGetBytes(cfString, range, encoding, cast(byte)'?', true, buffer, size [0], size);
       if (numChars is 0) return;
        transferData.data = new byte[][] {buffer};
        transferData.result = 0;
  } finally {
       OS.CFRelease(cfString);
   }
}

/**
 * This implementation of <code>nativeToJava</code> converts a platform specific 
 * representation of a URL to a java <code>String</code>.
 * For additional information see <code>Transfer#nativeToJava</code>.
 * 
 * @param transferData the platform specific representation of the data to be 
 * converted
 * @return a java <code>String[]</code> containing a URL if the 
 * conversion was successful; otherwise null
 */
public Object nativeToJava(TransferData transferData){
  if (!isSupportedType(transferData) || transferData.data is null) return null;
 if (transferData.data.length is 0) return null;
   byte[] buffer = transferData.data[0];
 int encoding = OS.CFStringGetSystemEncoding();
    int cfString = OS.CFStringCreateWithBytes(OS.kCFAllocatorDefault, buffer, buffer.length, encoding, true);
 if (cfString is 0) return null;
   try {
     int length = OS.CFStringGetLength(cfString);
      if (length is 0) return null;
     char[] chars = new char[length];
      CFRange range = new CFRange();
        range.length = length;
        OS.CFStringGetCharacters(cfString, range, chars);
     return new String(chars);
 } finally {
       OS.CFRelease(cfString);
   }
}

protected int[] getTypeIds(){
 return new int[] {URL_ID, URLN_ID};
}

protected String[] getTypeNames(){
  return new String[] {URL, URLN}; 
}

bool checkURL(Object object) {
    return object !is null && (object instanceof String) && (cast(String)object).length() > 0;
}

protected bool validate(Object object) {
 return checkURL(object);
}
}
--- a/dwt/dwthelper/Runnable.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dwthelper/Runnable.d	Wed Aug 27 14:30:35 2008 +0200
@@ -15,8 +15,8 @@
 
 class _DgRunnableT(Dg,T...) : Runnable {
 
-    alias ParameterTupleOf!(Dg) DgArgs;
-    static assert( is(DgArgs == Tuple!(T)),
+    alias ParameterTupleOf!cast(Dg) DgArgs;
+    static assert( is(DgArgs == Tuple!cast(T)),
                 "Delegate args not correct" );
 
     Dg dg;
@@ -36,4 +36,4 @@
 
 _DgRunnableT!(Dg,T) dgRunnable(Dg,T...)( Dg dg, T args ){
     return new _DgRunnableT!(Dg,T)(dg,args);
-}
\ No newline at end of file
+}
--- a/dwt/dwthelper/System.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dwthelper/System.d	Wed Aug 27 14:30:35 2008 +0200
@@ -90,19 +90,19 @@
 
 class System {
 
-    alias SimpleType!(int).arraycopy arraycopy;
-    alias SimpleType!(byte).arraycopy arraycopy;
-    alias SimpleType!(double).arraycopy arraycopy;
-    alias SimpleType!(float).arraycopy arraycopy;
-    alias SimpleType!(short).arraycopy arraycopy;
-    alias SimpleType!(long).arraycopy arraycopy;
+    alias SimpleType!cast(int).arraycopy arraycopy;
+    alias SimpleType!cast(byte).arraycopy arraycopy;
+    alias SimpleType!cast(double).arraycopy arraycopy;
+    alias SimpleType!cast(float).arraycopy arraycopy;
+    alias SimpleType!cast(short).arraycopy arraycopy;
+    alias SimpleType!cast(long).arraycopy arraycopy;
     alias SimpleType!(uint).arraycopy arraycopy;
     alias SimpleType!(ushort).arraycopy arraycopy;
     alias SimpleType!(ubyte).arraycopy arraycopy;
     alias SimpleType!(ulong).arraycopy arraycopy;
-    alias SimpleType!(char).arraycopy arraycopy;
+    alias SimpleType!cast(wchar).arraycopy arraycopy;
     alias SimpleType!(wchar).arraycopy arraycopy;
-    alias SimpleType!(Object).arraycopy arraycopy;
+    alias SimpleType!cast(Object).arraycopy arraycopy;
     alias SimpleType!(void*).arraycopy arraycopy;
 
     alias SimpleType!(int[]).arraycopy arraycopy;
--- a/dwt/dwthelper/WeakRef.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dwthelper/WeakRef.d	Wed Aug 27 14:30:35 2008 +0200
@@ -20,7 +20,7 @@
  class Something {}
 
  auto a = new Something();
- auto wa = new WeakRef!(Something)(a);
+ auto wa = new WeakRef!cast(Something)(a);
  std.gc.fullCollect();
 
  // Reference 'a' prevents collection so wa.ptr is non-null
@@ -36,7 +36,7 @@
  * Author:  William V. Baxter III
  * Contributors:
  * Date: 21 Jan 2008
- * Copyright: (C) 2008  William Baxter
+ * Copyright: cast(C) 2008  William Baxter
  * License: Public Domain where allowed by law, ZLIB/PNG otherwise.
  */
 //===========================================================================
@@ -45,8 +45,8 @@
 
 private {
     alias void delegate(Object) DisposeEvt;
-    extern (C) void  rt_attachDisposeEvent( Object obj, DisposeEvt evt );
-    extern (C) void  rt_detachDisposeEvent( Object obj, DisposeEvt evt );
+    extern cast(C) void  rt_attachDisposeEvent( Object obj, DisposeEvt evt );
+    extern cast(C) void  rt_detachDisposeEvent( Object obj, DisposeEvt evt );
 }
 
 class WeakRef(T : Object) {
@@ -77,7 +77,7 @@
         return new WeakRef(ptr());
     }
     int opEquals( Object o ){
-        if( auto other = cast( WeakRef!(T) )o ){
+        if( auto other = cast( WeakRef!cast(T) )o ){
             return other.cast_ptr_ is cast_ptr_;
         }
         return false;
--- a/dwt/dwthelper/utils.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dwthelper/utils.d	Wed Aug 27 14:30:35 2008 +0200
@@ -25,7 +25,7 @@
 alias bool boolean;
 alias char[] String;
 alias char[] string;
-alias tango.text.Text.Text!(char) StringBuffer;
+alias tango.text.Text.Text!cast(wchar) StringBuffer;
 alias opEquals equals;
 
 alias PlatformException Error;
@@ -59,7 +59,7 @@
         return value == other;
     }
     public int opEquals( Object other ){
-        if( auto o = cast(ValueWrapperT!(T))other ){
+        if( auto o = cast(ValueWrapperT!cast(T))other ){
             return value == o.value;
         }
         return false;
@@ -105,7 +105,7 @@
 alias Boolean    ValueWrapperBool;
 
 
-class Byte : ValueWrapperT!(byte) {
+class Byte : ValueWrapperT!cast(byte) {
     public static byte parseByte( String s ){
         try{
             int res = tango.text.convert.Integer.parse( s );
@@ -125,7 +125,7 @@
 alias Byte ValueWrapperByte;
 
 
-class Integer : ValueWrapperT!(int) {
+class Integer : ValueWrapperT!cast(int) {
 
     public static const int MIN_VALUE = 0x80000000;
     public static const int MAX_VALUE = 0x7fffffff;
@@ -236,7 +236,7 @@
 }
 alias Integer ValueWrapperInt;
 
-class Double : ValueWrapperT!(double) {
+class Double : ValueWrapperT!cast(double) {
     this( double value ){
         super(value);
     }
@@ -253,7 +253,7 @@
     }
 }
 
-class Float : ValueWrapperT!(float) {
+class Float : ValueWrapperT!cast(float) {
 
     public static float POSITIVE_INFINITY = (1.0f / 0.0f);
     public static float NEGATIVE_INFINITY = ((-1.0f) / 0.0f);
@@ -286,7 +286,7 @@
     }
 
 }
-class Long : ValueWrapperT!(long) {
+class Long : ValueWrapperT!cast(long) {
     this( long value ){
         super(value);
     }
@@ -309,13 +309,13 @@
 alias Long ValueWrapperLong;
 
 
-// alias ValueWrapperT!(int)     ValueWrapperInt;
+// alias ValueWrapperT!cast(int)     ValueWrapperInt;
 
-alias ArrayWrapperT!(byte)    ArrayWrapperByte;
-alias ArrayWrapperT!(int)     ArrayWrapperInt;
-alias ArrayWrapperT!(Object)  ArrayWrapperObject;
-alias ArrayWrapperT!(char)    ArrayWrapperString;
-alias ArrayWrapperT!(String)  ArrayWrapperString2;
+alias ArrayWrapperT!cast(byte)    ArrayWrapperByte;
+alias ArrayWrapperT!cast(int)     ArrayWrapperInt;
+alias ArrayWrapperT!cast(Object)  ArrayWrapperObject;
+alias ArrayWrapperT!cast(wchar)    ArrayWrapperString;
+alias ArrayWrapperT!cast(String)  ArrayWrapperString2;
 
 Object[] StringArrayToObjectArray( String[] strs ){
     Object[] res = new Object[strs.length];
@@ -788,7 +788,7 @@
 void ExceptionPrintStackTrace( Exception e ){
     this( e, Stderr );
 }
-void ExceptionPrintStackTrace( Exception e, Print!(char) print ){
+void ExceptionPrintStackTrace( Exception e, Print!cast(wchar) print ){
     Exception exception = e;
     while( exception !is null ){
         print.formatln( "Exception in {}({}): {}", exception.file, exception.line, exception.msg );
@@ -914,7 +914,7 @@
     }
 }
 
-int SeqIndexOf(T)( tango.util.collection.model.Seq.Seq!(T) s, T src ){
+int SeqIndexOf(T)( tango.util.collection.model.Seq.Seq!cast(T) s, T src ){
     int idx;
     foreach( e; s ){
         if( e == src ){
@@ -937,7 +937,7 @@
     return res;
 }
 
-int seqIndexOf( tango.util.collection.model.Seq.Seq!(Object) seq, Object v ){
+int seqIndexOf( tango.util.collection.model.Seq.Seq!cast(Object) seq, Object v ){
     int res = -1;
     int idx = 0;
     foreach( p; seq ){
--- a/dwt/graphics/Color.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Color.d	Wed Aug 27 14:30:35 2008 +0200
@@ -123,13 +123,13 @@
 public bool equals(Object object) {
     if (object is this) return true;
     if (!(object instanceof Color)) return false;
-    Color color = (Color)object;
+    Color color = cast(Color)object;
     float[] rgbColor = color.handle;
     if (handle is rgbColor) return true;
     return device is color.device &&
-        (int)(handle[0] * 255) is (int)(rgbColor[0] * 255) &&
-        (int)(handle[1] * 255) is (int)(rgbColor[1] * 255) &&
-        (int)(handle[2] * 255) is (int)(rgbColor[2] * 255);
+        cast(int)(handle[0] * 255) is cast(int)(rgbColor[0] * 255) &&
+        cast(int)(handle[1] * 255) is cast(int)(rgbColor[1] * 255) &&
+        cast(int)(handle[2] * 255) is cast(int)(rgbColor[2] * 255);
 }
 
 /**
@@ -143,7 +143,7 @@
  */
 public int getBlue() {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    return (int)(handle[2] * 255);
+    return cast(int)(handle[2] * 255);
 }
 
 /**
@@ -157,7 +157,7 @@
  */
 public int getGreen() {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    return (int)(handle[1] * 255);
+    return cast(int)(handle[1] * 255);
 }
 
 /**
@@ -171,7 +171,7 @@
  */
 public int getRed() {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    return (int)(handle[0] * 255);
+    return cast(int)(handle[0] * 255);
 }
 
 /**
@@ -186,7 +186,7 @@
  */
 public int hashCode() {
     if (isDisposed()) return 0;
-    return (int)(handle[0] * 255) ^ (int)(handle[1] * 255) ^ (int)(handle[2] * 255);
+    return cast(int)(handle[0] * 255) ^ cast(int)(handle[1] * 255) ^ cast(int)(handle[2] * 255);
 }
 
 /**
--- a/dwt/graphics/Cursor.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Cursor.d	Wed Aug 27 14:30:35 2008 +0200
@@ -200,10 +200,10 @@
             int maskPixel = mask.getPixel(x, y);
             if (pixel is 0 && maskPixel is 0) {
                 // BLACK
-                data[offset] = (byte)0xFF;
+                data[offset] = cast(byte)0xFF;
             } else if (pixel is 0 && maskPixel is 1) {
                 // WHITE - cursor color
-                data[offset] = data[offset + 1] = data[offset + 2] = data[offset + 3] = (byte)0xFF;
+                data[offset] = data[offset + 1] = data[offset + 2] = data[offset + 3] = cast(byte)0xFF;
             } else if (pixel is 1 && maskPixel is 0) {
                 // SCREEN
             } else {
@@ -222,9 +222,9 @@
 }
 
 void createNSCursor(int hotspotX, int hotspotY, byte[] buffer, int width, int height) {
-    NSImage nsImage = (NSImage)new NSImage().alloc();
-    NSBitmapImageRep nsImageRep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
-    handle = (NSCursor)new NSCursor().alloc();
+    NSImage nsImage = cast(NSImage)new NSImage().alloc();
+    NSBitmapImageRep nsImageRep = cast(NSBitmapImageRep)new NSBitmapImageRep().alloc();
+    handle = cast(NSCursor)new NSCursor().alloc();
     NSSize size = new NSSize();
     size.width = width;
     size.height =  height;
@@ -293,9 +293,9 @@
         for (int i = 0; i < rgbs.length; i++) {
             RGB rgb = rgbs[i];
             if (rgb is null) continue;
-            srcReds[i] = (byte)rgb.red;
-            srcGreens[i] = (byte)rgb.green;
-            srcBlues[i] = (byte)rgb.blue;
+            srcReds[i] = cast(byte)rgb.red;
+            srcGreens[i] = cast(byte)rgb.green;
+            srcBlues[i] = cast(byte)rgb.blue;
         }
         ImageData.blit(ImageData.BLIT_SRC,
             source.data, source.depth, source.bytesPerLine, source.getByteOrder(), 0, 0, source.width, source.height, srcReds, srcGreens, srcBlues,
@@ -310,13 +310,13 @@
         int offset = 0, maskOffset = 0;
         for (int y = 0; y<source.height; y++) {
             for (int x = 0; x<source.width; x++) {
-                data[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) !is 0 ? (byte)0xff : 0;
+                data[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) !is 0 ? cast(byte)0xff : 0;
                 offset += 4;
             }
             maskOffset += maskBpl;
         }
     } else if (source.alpha !is -1) {
-        byte alpha = (byte)source.alpha;
+        byte alpha = cast(byte)source.alpha;
         for (int i=0; i<data.length; i+=4) {
             data[i] = alpha;                
         }
@@ -348,7 +348,7 @@
 public bool equals (Object object) {
     if (object is this) return true;
     if (!(object instanceof Cursor)) return false;
-    Cursor cursor = (Cursor) object;
+    Cursor cursor = cast(Cursor) object;
     return device is cursor.device && handle is cursor.handle;
 }
 
--- a/dwt/graphics/Device.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Device.d	Wed Aug 27 14:30:35 2008 +0200
@@ -30,7 +30,7 @@
 /**
  * This class is the abstract superclass of all device objects,
  * such as the Display device and the Printer device. Devices
- * can have a graphics context (GC) created for them, and they
+ * can have a graphics context cast(GC) created for them, and they
  * can be drawn on by sending messages to the associated GC.
  */
 public abstract class Device : Drawable {
@@ -236,7 +236,7 @@
     checkDevice ();
     NSScreen screen = NSScreen.mainScreen();
     NSRect rect = screen.frame();
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
@@ -297,7 +297,7 @@
     checkDevice ();
     NSScreen screen = NSScreen.mainScreen();
     NSRect rect = screen.visibleFrame();
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
@@ -333,7 +333,7 @@
     NSDictionary dictionary = NSScreen.mainScreen().deviceDescription();
     NSValue value = new NSValue(dictionary.objectForKey(new id(OS.NSDeviceResolution())).id);
     NSSize size = value.sizeValue();
-    return new Point((int)size.width, (int)size.height);
+    return new Point(cast(int)size.width, cast(int)size.height);
 }
 
 /**
--- a/dwt/graphics/Drawable.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Drawable.d	Wed Aug 27 14:30:35 2008 +0200
@@ -14,7 +14,7 @@
 
 
 /**
- * Implementers of <code>Drawable</code> can have a graphics context (GC)
+ * Implementers of <code>Drawable</code> can have a graphics context cast(GC)
  * created for them, and then they can be drawn on by sending messages to
  * their associated GC. DWT images, and device objects such as the Display
  * device and the Printer device, are drawables.
--- a/dwt/graphics/Font.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Font.d	Wed Aug 27 14:30:35 2008 +0200
@@ -162,7 +162,7 @@
 public bool equals(Object object) {
     if (object is this) return true;
     if (!(object instanceof Font)) return false;
-    Font font = (Font)object;
+    Font font = cast(Font)object;
     return handle is font.handle;
 }
 
--- a/dwt/graphics/FontData.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/FontData.d	Wed Aug 27 14:30:35 2008 +0200
@@ -215,7 +215,7 @@
 public bool equals (Object object) {
     if (object is this) return true;
     if (!(object instanceof FontData)) return false;
-    FontData data = (FontData)object;
+    FontData data = cast(FontData)object;
     return name.equals(data.name) && height is data.height && style is data.style;
 }
 
@@ -227,7 +227,7 @@
  * @see #setHeight(int)
  */
 public int getHeight() {
-    return (int)height;
+    return cast(int)height;
 }
 
 /*public*/ float getHeightF() {
--- a/dwt/graphics/FontMetrics.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/FontMetrics.d	Wed Aug 27 14:30:35 2008 +0200
@@ -51,7 +51,7 @@
 public bool equals (Object object) {
     if (object is this) return true;
     if (!(object instanceof FontMetrics)) return false;
-    FontMetrics metrics = (FontMetrics)object;
+    FontMetrics metrics = cast(FontMetrics)object;
     return ascent is metrics.ascent && descent is metrics.descent &&
         averageCharWidth is metrics.averageCharWidth && leading is metrics.leading &&
         height is metrics.height;
--- a/dwt/graphics/GC.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/GC.d	Wed Aug 27 14:30:35 2008 +0200
@@ -331,13 +331,13 @@
         float scaling = size.width;
         if (scaling < 0) scaling = -scaling;
         float strokeWidth = data.lineWidth * scaling;
-        if (strokeWidth is 0 || ((int)strokeWidth % 2) is 1) {
+        if (strokeWidth is 0 || (cast(int)strokeWidth % 2) is 1) {
             data.drawXOffset = 0.5f / scaling;
         }
         scaling = size.height;
         if (scaling < 0) scaling = -scaling;
         strokeWidth = data.lineWidth * scaling;
-        if (strokeWidth is 0 || ((int)strokeWidth % 2) is 1) {
+        if (strokeWidth is 0 || (cast(int)strokeWidth % 2) is 1) {
             data.drawYOffset = 0.5f / scaling;
         }
     }
@@ -375,23 +375,23 @@
 //      int[] contentView = new int[1];
 //      OS.HIViewFindByID(OS.HIViewGetRoot(window), OS.kHIViewWindowContentID(), contentView);
 //      OS.HIViewConvertPoint (pt, data.control, contentView[0]);
-//      x += (int) pt.x;
-//      y += (int) pt.y;
+//      x += cast(int) pt.x;
+//      y += cast(int) pt.y;
 //      Rect inset = data.insetRect;
 //      x -= inset.left;
 //      y -= inset.top;
-//      srcRect.left = (short)x;
-//      srcRect.top = (short)y;
-//      srcRect.right = (short)(x + width);
-//      srcRect.bottom = (short)(y + height);
+//      srcRect.left = cast(short)x;
+//      srcRect.top = cast(short)y;
+//      srcRect.right = cast(short)(x + width);
+//      srcRect.bottom = cast(short)(y + height);
 //      Rect destRect = new Rect();
-//      destRect.right = (short)width;
-//      destRect.bottom = (short)height;
+//      destRect.right = cast(short)width;
+//      destRect.bottom = cast(short)height;
 //      int bpl = width * 4;
 //      int[] gWorld = new int[1];
 //      int port = OS.GetWindowPort(window);        
 //      OS.NewGWorldFromPtr(gWorld, OS.k32ARGBPixelFormat, destRect, 0, 0, 0, image.data, bpl);
-//      OS.CopyBits(OS.GetPortBitMapForCopyBits(port), OS.GetPortBitMapForCopyBits(gWorld[0]), srcRect, destRect, (short)OS.srcCopy, 0);            
+//      OS.CopyBits(OS.GetPortBitMapForCopyBits(port), OS.GetPortBitMapForCopyBits(gWorld[0]), srcRect, destRect, cast(short)OS.srcCopy, 0);            
 //      OS.DisposeGWorld(gWorld [0]);
 //  } else if (data.window !is 0) {
 //      int imageHandle = image.handle;
@@ -532,22 +532,22 @@
 //      int[] contentView = new int[1];
 //      OS.HIViewFindByID(OS.HIViewGetRoot(window), OS.kHIViewWindowContentID(), contentView);
 //      OS.HIViewConvertPoint(pt, OS.HIViewGetSuperview(data.control), contentView[0]);
-//      convertX = rect.left + (int) pt.x;
-//      convertY = rect.top + (int) pt.y;
-//      rect.left += (int) pt.x;
-//      rect.top += (int) pt.y;
-//      rect.right += (int) pt.x;
-//      rect.bottom += (int) pt.y;
+//      convertX = rect.left + cast(int) pt.x;
+//      convertY = rect.top + cast(int) pt.y;
+//      rect.left += cast(int) pt.x;
+//      rect.top += cast(int) pt.y;
+//      rect.right += cast(int) pt.x;
+//      rect.bottom += cast(int) pt.y;
 //      Rect srcRect = new Rect();
 //      int left = rect.left + srcX;
 //      int top = rect.top + srcY;
-//      OS.SetRect(srcRect, (short)left, (short)top, (short)(left + width), (short)(top + height));
+//      OS.SetRect(srcRect, cast(short)left, cast(short)top, cast(short)(left + width), cast(short)(top + height));
 //      int srcRgn = OS.NewRgn();
 //      OS.RectRgn(srcRgn, srcRect);
 //      OS.SectRect(rect, srcRect, srcRect);
 //      Rect destRect = new Rect ();
 //      OS.SetRect(destRect, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom);
-//      OS.OffsetRect(destRect, (short)deltaX, (short)deltaY);
+//      OS.OffsetRect(destRect, cast(short)deltaX, cast(short)deltaY);
 //      int destRgn = OS.NewRgn();
 //      OS.RectRgn(destRgn, destRect);
 //      
@@ -579,13 +579,13 @@
 //                      OS.GetClip(oldClip);
 //                      OS.SetClip(clipRgn);
 //                      OS.UnionRect(srcRect, destRect, rect);
-//                      OS.ScrollRect(rect, (short)deltaX, (short)deltaY, 0);
+//                      OS.ScrollRect(rect, cast(short)deltaX, cast(short)deltaY, 0);
 //                      OS.SetClip(oldClip);
 //                      OS.DisposeRgn(oldClip);
 //                      OS.SetPort(currentPort[0]);
 //                  } else {
 //                      int portBitMap = OS.GetPortBitMapForCopyBits (port);
-//                      OS.CopyBits(portBitMap, portBitMap, srcRect, destRect, (short)OS.srcCopy, clipRgn);
+//                      OS.CopyBits(portBitMap, portBitMap, srcRect, destRect, cast(short)OS.srcCopy, clipRgn);
 //                      OS.QDFlushPortBuffer(port, destRgn);
 //                  }
 //              }
@@ -598,11 +598,11 @@
 //      if (paint) {
 //          int invalRgn = OS.NewRgn();
 //          OS.DiffRgn(srcRgn, data.visibleRgn, invalRgn);
-//          OS.OffsetRgn(invalRgn, (short)deltaX, (short)deltaY);
+//          OS.OffsetRgn(invalRgn, cast(short)deltaX, cast(short)deltaY);
 //          OS.DiffRgn(srcRgn, destRgn, srcRgn);
 //          OS.UnionRgn(srcRgn, invalRgn, invalRgn);
 //          OS.SectRgn(data.visibleRgn, invalRgn, invalRgn);
-//          OS.OffsetRgn(invalRgn, (short)-convertX, (short)-convertY);
+//          OS.OffsetRgn(invalRgn, cast(short)-convertX, cast(short)-convertY);
 //          OS.HIViewSetNeedsDisplayInRegion(data.control, invalRgn, true);
 //          OS.DisposeRgn(invalRgn);
 //      }
@@ -663,7 +663,7 @@
 //      length = j;
 //  }
     NSString str = NSString.stringWithCharacters(chars, length);
-    return ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+    return (cast(NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
 }
 
 void destroy() {
@@ -859,8 +859,8 @@
     checkGC(CLIPPING | TRANSFORM);
     NSImage imageHandle = srcImage.handle;
     NSSize size = imageHandle.size();
-    int imgWidth = (int)size.width;
-    int imgHeight = (int)size.height;
+    int imgWidth = cast(int)size.width;
+    int imgHeight = cast(int)size.height;
     if (simple) {
         srcWidth = destWidth = imgWidth;
         srcHeight = destHeight = imgHeight;
@@ -1401,7 +1401,7 @@
 public bool equals(Object object) {
     if (object is this) return true;
     if (!(object instanceof GC)) return false;
-    return handle is ((GC)object).handle;
+    return handle is (cast(GC)object).handle;
 }
 
 /**
@@ -1521,7 +1521,7 @@
     } else {
         NSColor startingColor = NSColor.colorWithDeviceRed(fromRGB.red / 255f, fromRGB.green / 255f, fromRGB.blue / 255f, data.alpha / 255f);
         NSColor endingColor = NSColor.colorWithDeviceRed(toRGB.red / 255f, toRGB.green / 255f, toRGB.blue / 255f, data.alpha / 255f);
-        NSGradient gradient = ((NSGradient)new NSGradient().alloc()).initWithStartingColor(startingColor, endingColor);
+        NSGradient gradient = (cast(NSGradient)new NSGradient().alloc()).initWithStartingColor(startingColor, endingColor);
         NSRect rect = new NSRect();
         rect.x = x;
         rect.y = y;
@@ -1983,7 +1983,7 @@
             rect.height = size.height;
         }
     }
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 /** 
@@ -2019,10 +2019,10 @@
             rect.height = data.size.height;
         }
     }
-    region.add((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    region.add(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
     NSRect paintRect = data.paintRect;
     if (paintRect !is null) {
-        region.intersect((int)paintRect.x, (int)paintRect.y, (int)paintRect.width, (int)paintRect.height);
+        region.intersect(cast(int)paintRect.x, cast(int)paintRect.y, cast(int)paintRect.width, cast(int)paintRect.height);
     }
     if (data.clipPath !is null) {
         NSBezierPath clip = data.clipPath.bezierPathByFlatteningPath();
@@ -2040,13 +2040,13 @@
                     if (pointCount !is 0) clipRgn.add(pointArray, pointCount);
                     pointCount = 0;
                     OS.memmove(pt, points, NSPoint.sizeof);
-                    pointArray[pointCount++] = (int)pt.x;
-                    pointArray[pointCount++] = (int)pt.y;
+                    pointArray[pointCount++] = cast(int)pt.x;
+                    pointArray[pointCount++] = cast(int)pt.y;
                     break;
                 case OS.NSLineToBezierPathElement:
                     OS.memmove(pt, points, NSPoint.sizeof);
-                    pointArray[pointCount++] = (int)pt.x;
-                    pointArray[pointCount++] = (int)pt.y;
+                    pointArray[pointCount++] = cast(int)pt.x;
+                    pointArray[pointCount++] = cast(int)pt.y;
                     break;
                 case OS.NSClosePathBezierPathElement:
                     if (pointCount !is 0) clipRgn.add(pointArray, pointCount);
@@ -2111,8 +2111,8 @@
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
     checkGC(FONT);
     NSFont font = data.font.handle;
-    int ascent = (int)(0.5f + font.ascender());
-    int descent = (int)(0.5f + (-font.descender() + font.leading()));   
+    int ascent = cast(int)(0.5f + font.ascender());
+    int descent = cast(int)(0.5f + (-font.descender() + font.leading()));   
     String s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 
     int averageCharWidth = stringExtent(s).x / s.length();
     return FontMetrics.cocoa_new(ascent, descent, averageCharWidth, 0, ascent + descent);
@@ -2257,7 +2257,7 @@
     if (data.lineDashes is null) return null;
     int[] lineDashes = new int[data.lineDashes.length];
     for (int i = 0; i < lineDashes.length; i++) {
-        lineDashes[i] = (int)data.lineDashes[i];
+        lineDashes[i] = cast(int)data.lineDashes[i];
     }
     return lineDashes;  
 }
@@ -2311,7 +2311,7 @@
  */
 public int getLineWidth() {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    return (int)data.lineWidth;
+    return cast(int)data.lineWidth;
 }
 
 /**
@@ -2530,7 +2530,7 @@
         setAlpha(0xFF);
         setAntialias(DWT.DEFAULT);
         setBackgroundPattern(null);
-        setClipping((Rectangle)null);
+        setClipping(cast(Rectangle)null);
         setForegroundPattern(null);
         setInterpolation(DWT.DEFAULT);
         setTextAntialias(DWT.DEFAULT);
@@ -2748,7 +2748,7 @@
 public void setClipping(Rectangle rect) {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
     if (rect is null) {
-        setClipping((NSBezierPath)null);
+        setClipping(cast(NSBezierPath)null);
     } else {
         setClipping(rect.x, rect.y, rect.width, rect.height);
     }
@@ -3312,8 +3312,8 @@
     if (transform !is null) {
         if (data.transform !is null) data.transform.release();
         if (data.inverseTransform !is null) data.inverseTransform.release();
-        data.transform = ((NSAffineTransform)new NSAffineTransform().alloc()).initWithTransform(transform.handle);
-        data.inverseTransform = ((NSAffineTransform)new NSAffineTransform().alloc()).initWithTransform(transform.handle);
+        data.transform = (cast(NSAffineTransform)new NSAffineTransform().alloc()).initWithTransform(transform.handle);
+        data.inverseTransform = (cast(NSAffineTransform)new NSAffineTransform().alloc()).initWithTransform(transform.handle);
         NSAffineTransformStruct struct = data.inverseTransform.transformStruct();
         if ((struct.m11 * struct.m22 - struct.m12 * struct.m21) !is 0) {
             data.inverseTransform.invert();
@@ -3407,7 +3407,7 @@
     checkGC(FONT);
     NSAttributedString str = createString(string, flags);
     NSSize size = str.size();
-    return new Point((int)size.width, (int)size.height);
+    return new Point(cast(int)size.width, cast(int)size.height);
 }
 
 /**
--- a/dwt/graphics/GlyphMetrics.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/GlyphMetrics.d	Wed Aug 27 14:30:35 2008 +0200
@@ -80,7 +80,7 @@
 public bool equals (Object object) {
     if (object is this) return true;
     if (!(object instanceof GlyphMetrics)) return false;
-    GlyphMetrics metrics = (GlyphMetrics)object;
+    GlyphMetrics metrics = cast(GlyphMetrics)object;
     return metrics.ascent is ascent && metrics.descent is descent && metrics.width is width;
 }
 
--- a/dwt/graphics/Image.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Image.d	Wed Aug 27 14:30:35 2008 +0200
@@ -224,8 +224,8 @@
 
     /* Get source image size */
     NSSize size = srcImage.handle.size();
-    int width = (int)size.width;
-    int height = (int)size.height;
+    int width = cast(int)size.width;
+    int height = cast(int)size.height;
     NSBitmapImageRep srcRep = srcImage.imageRep;
     int bpr = srcRep.bytesPerRow();
 
@@ -238,9 +238,9 @@
     }
 
     /* Create the image */
-    handle = (NSImage)new NSImage().alloc();
+    handle = cast(NSImage)new NSImage().alloc();
     handle = handle.initWithSize(size);
-    NSBitmapImageRep rep = imageRep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
+    NSBitmapImageRep rep = imageRep = cast(NSBitmapImageRep)new NSBitmapImageRep().alloc();
     rep = rep.initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(0, width, height, srcRep.bitsPerSample(), srcRep.samplesPerPixel(), srcRep.samplesPerPixel() is 4, srcRep.isPlanar(), new NSString(OS.NSDeviceRGBColorSpace()), OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, srcRep.bytesPerRow(), srcRep.bitsPerPixel());
     handle.addRepresentation(rep);
     
@@ -253,14 +253,14 @@
             case DWT.IMAGE_DISABLE: {
                 Color zeroColor = device.getSystemColor(DWT.COLOR_WIDGET_NORMAL_SHADOW);
                 RGB zeroRGB = zeroColor.getRGB();
-                byte zeroRed = (byte)zeroRGB.red;
-                byte zeroGreen = (byte)zeroRGB.green;
-                byte zeroBlue = (byte)zeroRGB.blue;
+                byte zeroRed = cast(byte)zeroRGB.red;
+                byte zeroGreen = cast(byte)zeroRGB.green;
+                byte zeroBlue = cast(byte)zeroRGB.blue;
                 Color oneColor = device.getSystemColor(DWT.COLOR_WIDGET_BACKGROUND);
                 RGB oneRGB = oneColor.getRGB();
-                byte oneRed = (byte)oneRGB.red;
-                byte oneGreen = (byte)oneRGB.green;
-                byte oneBlue = (byte)oneRGB.blue;
+                byte oneRed = cast(byte)oneRGB.red;
+                byte oneGreen = cast(byte)oneRGB.green;
+                byte oneBlue = cast(byte)oneRGB.blue;
                 byte[] line = new byte[bpr];
                 for (int y=0; y<height; y++) {
                     OS.memmove(line, data + (y * bpr), bpr);
@@ -294,7 +294,7 @@
                         int red = line[offset+1] & 0xFF;
                         int green = line[offset+2] & 0xFF;
                         int blue = line[offset+3] & 0xFF;
-                        byte intensity = (byte)((red+red+green+green+green+green+green+blue) >> 3);
+                        byte intensity = cast(byte)((red+red+green+green+green+green+green+blue) >> 3);
                         line[offset+1] = line[offset+2] = line[offset+3] = intensity;
                         offset += 4;
                     }
@@ -497,7 +497,7 @@
 void createAlpha () {
     if (transparentPixel is -1 && alpha is -1 && alphaData is null) return;
     NSSize size = handle.size();
-    int height = (int)size.height;
+    int height = cast(int)size.height;
     int bpr = imageRep.bytesPerRow();
     int dataSize = height * bpr;
     byte[] srcData = new byte[dataSize];
@@ -505,15 +505,15 @@
     if (transparentPixel !is -1) {
         for (int i=0; i<dataSize; i+=4) {
             int pixel = ((srcData[i+1] & 0xFF) << 16) | ((srcData[i+2] & 0xFF) << 8) | (srcData[i+3] & 0xFF);
-            srcData[i] = (byte)(pixel is transparentPixel ? 0 : 0xFF); 
+            srcData[i] = cast(byte)(pixel is transparentPixel ? 0 : 0xFF); 
         }
     } else if (alpha !is -1) {
-        byte a = (byte)this.alpha;
+        byte a = cast(byte)this.alpha;
         for (int i=0; i<dataSize; i+=4) {
             srcData[i] = a;             
         }
     } else {
-        int width = (int)size.width;
+        int width = cast(int)size.width;
         int offset = 0, alphaOffset = 0;
         for (int y = 0; y<height; y++) {
             for (int x = 0; x<width; x++) {
@@ -548,7 +548,7 @@
 public bool equals (Object object) {
     if (object is this) return true;
     if (!(object instanceof Image)) return false;
-    Image image = (Image)object;
+    Image image = cast(Image)object;
     return device is image.device && handle is image.handle &&
         transparentPixel is image.transparentPixel;
 }
@@ -598,7 +598,7 @@
         return new Rectangle(0, 0, width, height);
     }
     NSSize size = handle.size();
-    return new Rectangle(0, 0, width = (int)size.width, height = (int)size.height);
+    return new Rectangle(0, 0, width = cast(int)size.width, height = cast(int)size.height);
 }
 
 /**
@@ -619,8 +619,8 @@
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
 
     NSSize size = handle.size();
-    int width = (int)size.width;
-    int height = (int)size.height;
+    int width = cast(int)size.width;
+    int height = cast(int)size.height;
     NSBitmapImageRep imageRep = this.imageRep;
     int bpr = imageRep.bytesPerRow();
     int bpp = imageRep.bitsPerPixel();
@@ -715,12 +715,12 @@
     this.width = width;
     this.height = height;
 
-    handle = (NSImage)new NSImage().alloc();
+    handle = cast(NSImage)new NSImage().alloc();
     NSSize size = new NSSize();
     size.width = width;
     size.height = height;
     handle = handle.initWithSize(size);
-    NSBitmapImageRep rep = imageRep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
+    NSBitmapImageRep rep = imageRep = cast(NSBitmapImageRep)new NSBitmapImageRep().alloc();
     rep = rep.initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(0, width, height, 8, 3, false, false, new NSString(OS.NSDeviceRGBColorSpace()), OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32);
     OS.memset(rep.bitmapData(), 0xFF, width * height * 4);
     handle.addRepresentation(rep);
@@ -757,9 +757,9 @@
         for (int i = 0; i < rgbs.length; i++) {
             RGB rgb = rgbs[i];
             if (rgb is null) continue;
-            srcReds[i] = (byte)rgb.red;
-            srcGreens[i] = (byte)rgb.green;
-            srcBlues[i] = (byte)rgb.blue;
+            srcReds[i] = cast(byte)rgb.red;
+            srcGreens[i] = cast(byte)rgb.green;
+            srcBlues[i] = cast(byte)rgb.blue;
         }
         ImageData.blit(ImageData.BLIT_SRC,
             image.data, image.depth, image.bytesPerLine, image.getByteOrder(), 0, 0, width, height, srcReds, srcGreens, srcBlues,
@@ -797,7 +797,7 @@
         int offset = 0, maskOffset = 0;
         for (int y = 0; y<height; y++) {
             for (int x = 0; x<width; x++) {
-                buffer[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) !is 0 ? (byte)0xff : 0;
+                buffer[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) !is 0 ? cast(byte)0xff : 0;
                 offset += 4;
             }
             maskOffset += maskBpl;
@@ -807,7 +807,7 @@
         if (image.alpha !is -1) {
             hasAlpha = true;
             this.alpha = image.alpha;
-            byte a = (byte)this.alpha;
+            byte a = cast(byte)this.alpha;
             for (int dataIndex=0; dataIndex<buffer.length; dataIndex+=4) {
                 buffer[dataIndex] = a;              
             }
@@ -824,12 +824,12 @@
             }
         }
     }
-    handle = (NSImage)new NSImage().alloc();
+    handle = cast(NSImage)new NSImage().alloc();
     NSSize size = new NSSize();
     size.width = width;
     size.height = height;
     handle = handle.initWithSize(size);
-    NSBitmapImageRep rep = imageRep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
+    NSBitmapImageRep rep = imageRep = cast(NSBitmapImageRep)new NSBitmapImageRep().alloc();
     rep = rep.initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(
             0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, new NSString(OS.NSDeviceRGBColorSpace()), OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32);
     OS.memmove(rep.bitmapData(), buffer, dataSize); 
@@ -859,7 +859,7 @@
     NSBitmapImageRep rep = imageRep;
     if (imageRep.hasAlpha()) {
         int bpr = width * 4;
-        rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
+        rep = cast(NSBitmapImageRep)new NSBitmapImageRep().alloc();
         int bitmapData = imageRep.bitmapData();
         if (data.bitmapDataAddress !is 0) OS.free(data.bitmapDataAddress);
         data.bitmapDataAddress = OS.malloc(4);
@@ -961,12 +961,12 @@
     if (color is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
     if (color.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT);
     if (transparentPixel is -1) return;
-//  byte red = (byte)((transparentPixel >> 16) & 0xFF);
-//  byte green = (byte)((transparentPixel >> 8) & 0xFF);
-//  byte blue = (byte)((transparentPixel >> 0) & 0xFF);
-//  byte newRed = (byte)((int)(color.handle[0] * 255) & 0xFF);
-//  byte newGreen = (byte)((int)(color.handle[1] * 255) & 0xFF);
-//  byte newBlue = (byte)((int)(color.handle[2] * 255) & 0xFF);
+//  byte red = cast(byte)((transparentPixel >> 16) & 0xFF);
+//  byte green = cast(byte)((transparentPixel >> 8) & 0xFF);
+//  byte blue = cast(byte)((transparentPixel >> 0) & 0xFF);
+//  byte newRed = cast(byte)(cast(int)(color.handle[0] * 255) & 0xFF);
+//  byte newGreen = cast(byte)(cast(int)(color.handle[1] * 255) & 0xFF);
+//  byte newBlue = cast(byte)(cast(int)(color.handle[2] * 255) & 0xFF);
 //  int height = OS.CGImageGetHeight(handle);
 //  int bpl = OS.CGImageGetBytesPerRow(handle);
 //  byte[] line = new byte[bpl];
--- a/dwt/graphics/ImageData.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/ImageData.d	Wed Aug 27 14:30:35 2008 +0200
@@ -218,7 +218,7 @@
             if (b is 0) continue;
             int inc = 0;
             for (int bit = 0x10000; (bit >>= b) !is 0;) inc |= bit;
-            for (int v = 0, p = 0; v < 0x10000; v+= inc) data[p++] = (byte)(v >> 8);
+            for (int v = 0, p = 0; v < 0x10000; v+= inc) data[p++] = cast(byte)(v >> 8);
         }
     }
     static final byte[] ONE_TO_ONE_MAPPING = ANY_TO_EIGHT[8];
@@ -627,7 +627,7 @@
     if (alphaData is null) {
         int endIndex = startIndex + getWidth;
         for (int i = startIndex; i < endIndex; i++) {
-            alphas[i] = (byte)255;
+            alphas[i] = cast(byte)255;
         }
         return;
     }
@@ -750,7 +750,7 @@
             index = (y * bytesPerLine) + (x >> 1);
             if ((x & 0x1) is 1) {
                 theByte = data[index] & 0xFF;
-                pixels[i] = (byte)(theByte & 0x0F);
+                pixels[i] = cast(byte)(theByte & 0x0F);
                 i++;
                 n--;
                 srcX++;
@@ -764,7 +764,7 @@
             }
             while (n > 1) {
                 theByte = data[index] & 0xFF;
-                pixels[i] = (byte)(theByte >> 4);
+                pixels[i] = cast(byte)(theByte >> 4);
                 i++;
                 n--;
                 srcX++;
@@ -773,7 +773,7 @@
                     index = srcY * bytesPerLine;
                     srcX = 0;
                 } else {
-                    pixels[i] = (byte)(theByte & 0x0F);
+                    pixels[i] = cast(byte)(theByte & 0x0F);
                     i++;
                     n--;
                     srcX++;
@@ -788,7 +788,7 @@
             }
             if (n > 0) {
                 theByte = data[index] & 0xFF;
-                pixels[i] = (byte)(theByte >> 4);
+                pixels[i] = cast(byte)(theByte >> 4);
             }
             return;
         case 2:
@@ -798,7 +798,7 @@
             while (n > 0) {
                 offset = 3 - (srcX % 4);
                 mask = 3 << (offset * 2);
-                pixels[i] = (byte)((theByte & mask) >> (offset * 2));
+                pixels[i] = cast(byte)((theByte & mask) >> (offset * 2));
                 i++;
                 n--;
                 srcX++;
@@ -992,7 +992,7 @@
             while (n > 0) {
                 offset = 3 - (srcX % 4);
                 mask = 3 << (offset * 2);
-                pixels[i] = (byte)((theByte & mask) >> (offset * 2));
+                pixels[i] = cast(byte)((theByte & mask) >> (offset * 2));
                 i++;
                 n--;
                 srcX++;
@@ -1169,7 +1169,7 @@
         DWT.error(DWT.ERROR_INVALID_ARGUMENT);
     
     if (alphaData is null) alphaData = new byte[width * height];
-    alphaData[y * width + x] = (byte)alpha; 
+    alphaData[y * width + x] = cast(byte)alpha; 
 }
 
 /**
@@ -1224,32 +1224,32 @@
     switch (depth) {
         case 32:
             index = (y * bytesPerLine) + (x * 4);
-            data[index]  = (byte)((pixelValue >> 24) & 0xFF);
-            data[index + 1] = (byte)((pixelValue >> 16) & 0xFF);
-            data[index + 2] = (byte)((pixelValue >> 8) & 0xFF);
-            data[index + 3] = (byte)(pixelValue & 0xFF);
+            data[index]  = cast(byte)((pixelValue >> 24) & 0xFF);
+            data[index + 1] = cast(byte)((pixelValue >> 16) & 0xFF);
+            data[index + 2] = cast(byte)((pixelValue >> 8) & 0xFF);
+            data[index + 3] = cast(byte)(pixelValue & 0xFF);
             return;
         case 24:
             index = (y * bytesPerLine) + (x * 3);
-            data[index] = (byte)((pixelValue >> 16) & 0xFF);
-            data[index + 1] = (byte)((pixelValue >> 8) & 0xFF);
-            data[index + 2] = (byte)(pixelValue & 0xFF);
+            data[index] = cast(byte)((pixelValue >> 16) & 0xFF);
+            data[index + 1] = cast(byte)((pixelValue >> 8) & 0xFF);
+            data[index + 2] = cast(byte)(pixelValue & 0xFF);
             return;
         case 16:
             index = (y * bytesPerLine) + (x * 2);
-            data[index + 1] = (byte)((pixelValue >> 8) & 0xFF);
-            data[index] = (byte)(pixelValue & 0xFF);
+            data[index + 1] = cast(byte)((pixelValue >> 8) & 0xFF);
+            data[index] = cast(byte)(pixelValue & 0xFF);
             return;
         case 8:
             index = (y * bytesPerLine) + x ;
-            data[index] = (byte)(pixelValue & 0xFF);
+            data[index] = cast(byte)(pixelValue & 0xFF);
             return;
         case 4:
             index = (y * bytesPerLine) + (x >> 1);
             if ((x & 0x1) is 0) {
-                data[index] = (byte)((data[index] & 0x0F) | ((pixelValue & 0x0F) << 4));
+                data[index] = cast(byte)((data[index] & 0x0F) | ((pixelValue & 0x0F) << 4));
             } else {
-                data[index] = (byte)((data[index] & 0xF0) | (pixelValue & 0x0F));
+                data[index] = cast(byte)((data[index] & 0xF0) | (pixelValue & 0x0F));
             }
             return;
         case 2:
@@ -1257,16 +1257,16 @@
             theByte = data[index];
             int offset = 3 - (x % 4);
             mask = 0xFF ^ (3 << (offset * 2));
-            data[index] = (byte)((data[index] & mask) | (pixelValue << (offset * 2)));
+            data[index] = cast(byte)((data[index] & mask) | (pixelValue << (offset * 2)));
             return;
         case 1:
             index = (y * bytesPerLine) + (x >> 3);
             theByte = data[index];
             mask = 1 << (7 - (x & 0x7));
             if ((pixelValue & 0x1) is 1) {
-                data[index] = (byte)(theByte | mask);
+                data[index] = cast(byte)(theByte | mask);
             } else {
-                data[index] = (byte)(theByte & (mask ^ -1));
+                data[index] = cast(byte)(theByte & (mask ^ -1));
             }
             return;
     }
@@ -1310,7 +1310,7 @@
         case 8:
             index = (y * bytesPerLine) + x;
             for (int j = 0; j < putWidth; j++) {
-                data[index] = (byte)(pixels[i] & 0xFF);
+                data[index] = cast(byte)(pixels[i] & 0xFF);
                 i++;
                 srcX++;
                 if (srcX >= width) {
@@ -1328,9 +1328,9 @@
             while (n > 0) {
                 theByte = pixels[i] & 0x0F;
                 if (high) {
-                    data[index] = (byte)((data[index] & 0x0F) | (theByte << 4));
+                    data[index] = cast(byte)((data[index] & 0x0F) | (theByte << 4));
                 } else {
-                    data[index] = (byte)((data[index] & 0xF0) | theByte);
+                    data[index] = cast(byte)((data[index] & 0xF0) | theByte);
                 }
                 i++;
                 n--;
@@ -1347,12 +1347,12 @@
             }
             return;
         case 2:
-            byte [] masks = { (byte)0xFC, (byte)0xF3, (byte)0xCF, (byte)0x3F };
+            byte [] masks = { cast(byte)0xFC, cast(byte)0xF3, cast(byte)0xCF, cast(byte)0x3F };
             index = (y * bytesPerLine) + (x >> 2);
             int offset = 3 - (x % 4);
             while (n > 0) {
                 theByte = pixels[i] & 0x3;
-                data[index] = (byte)((data[index] & masks[offset]) | (theByte << (offset * 2)));
+                data[index] = cast(byte)((data[index] & masks[offset]) | (theByte << (offset * 2)));
                 i++;
                 n--;
                 srcX++;
@@ -1376,9 +1376,9 @@
             while (n > 0) {
                 mask = 1 << (7 - (srcX & 0x7));
                 if ((pixels[i] & 0x1) is 1) {
-                    data[index] = (byte)((data[index] & 0xFF) | mask);
+                    data[index] = cast(byte)((data[index] & 0xFF) | mask);
                 } else {
-                    data[index] = (byte)((data[index] & 0xFF) & (mask ^ -1));
+                    data[index] = cast(byte)((data[index] & 0xFF) & (mask ^ -1));
                 }
                 i++;
                 n--;
@@ -1436,10 +1436,10 @@
             index = (y * bytesPerLine) + (x * 4);
             for (int j = 0; j < putWidth; j++) {
                 pixel = pixels[i];
-                data[index] = (byte)((pixel >> 24) & 0xFF);
-                data[index + 1] = (byte)((pixel >> 16) & 0xFF);
-                data[index + 2] = (byte)((pixel >> 8) & 0xFF);
-                data[index + 3] = (byte)(pixel & 0xFF);
+                data[index] = cast(byte)((pixel >> 24) & 0xFF);
+                data[index + 1] = cast(byte)((pixel >> 16) & 0xFF);
+                data[index + 2] = cast(byte)((pixel >> 8) & 0xFF);
+                data[index + 3] = cast(byte)(pixel & 0xFF);
                 i++;
                 srcX++;
                 if (srcX >= width) {
@@ -1455,9 +1455,9 @@
             index = (y * bytesPerLine) + (x * 3);
             for (int j = 0; j < putWidth; j++) {
                 pixel = pixels[i];
-                data[index] = (byte)((pixel >> 16) & 0xFF);
-                data[index + 1] = (byte)((pixel >> 8) & 0xFF);
-                data[index + 2] = (byte)(pixel & 0xFF);
+                data[index] = cast(byte)((pixel >> 16) & 0xFF);
+                data[index + 1] = cast(byte)((pixel >> 8) & 0xFF);
+                data[index + 2] = cast(byte)(pixel & 0xFF);
                 i++;
                 srcX++;
                 if (srcX >= width) {
@@ -1473,8 +1473,8 @@
             index = (y * bytesPerLine) + (x * 2);
             for (int j = 0; j < putWidth; j++) {
                 pixel = pixels[i];
-                data[index] = (byte)(pixel & 0xFF);
-                data[index + 1] = (byte)((pixel >> 8) & 0xFF);
+                data[index] = cast(byte)(pixel & 0xFF);
+                data[index + 1] = cast(byte)((pixel >> 8) & 0xFF);
                 i++;
                 srcX++;
                 if (srcX >= width) {
@@ -1489,7 +1489,7 @@
         case 8:
             index = (y * bytesPerLine) + x;
             for (int j = 0; j < putWidth; j++) {
-                data[index] = (byte)(pixels[i] & 0xFF);
+                data[index] = cast(byte)(pixels[i] & 0xFF);
                 i++;
                 srcX++;
                 if (srcX >= width) {
@@ -1507,9 +1507,9 @@
             while (n > 0) {
                 theByte = pixels[i] & 0x0F;
                 if (high) {
-                    data[index] = (byte)((data[index] & 0x0F) | (theByte << 4));
+                    data[index] = cast(byte)((data[index] & 0x0F) | (theByte << 4));
                 } else {
-                    data[index] = (byte)((data[index] & 0xF0) | theByte);
+                    data[index] = cast(byte)((data[index] & 0xF0) | theByte);
                 }
                 i++;
                 n--;
@@ -1526,12 +1526,12 @@
             }
             return;
         case 2:
-            byte [] masks = { (byte)0xFC, (byte)0xF3, (byte)0xCF, (byte)0x3F };
+            byte [] masks = { cast(byte)0xFC, cast(byte)0xF3, cast(byte)0xCF, cast(byte)0x3F };
             index = (y * bytesPerLine) + (x >> 2);
             int offset = 3 - (x % 4);
             while (n > 0) {
                 theByte = pixels[i] & 0x3;
-                data[index] = (byte)((data[index] & masks[offset]) | (theByte << (offset * 2)));
+                data[index] = cast(byte)((data[index] & masks[offset]) | (theByte << (offset * 2)));
                 i++;
                 n--;
                 srcX++;
@@ -1555,9 +1555,9 @@
             while (n > 0) {
                 mask = 1 << (7 - (srcX & 0x7));
                 if ((pixels[i] & 0x1) is 1) {
-                    data[index] = (byte)((data[index] & 0xFF) | mask);
+                    data[index] = cast(byte)((data[index] & 0xFF) | mask);
                 } else {
-                    data[index] = (byte)((data[index] & 0xFF) & (mask ^ -1));
+                    data[index] = cast(byte)((data[index] & 0xFF) & (mask ^ -1));
                 }
                 i++;
                 n--;
@@ -1776,9 +1776,9 @@
 
     /*** Prepare scaling data ***/
     final int dwm1 = destWidth - 1;
-    final int sfxi = (dwm1 !is 0) ? (int)((((long)srcWidth << 16) - 1) / dwm1) : 0;
+    final int sfxi = (dwm1 !is 0) ? cast(int)(((cast(long)srcWidth << 16) - 1) / dwm1) : 0;
     final int dhm1 = destHeight - 1;
-    final int sfyi = (dhm1 !is 0) ? (int)((((long)srcHeight << 16) - 1) / dhm1) : 0;
+    final int sfyi = (dhm1 !is 0) ? cast(int)(((cast(long)srcHeight << 16) - 1) / dhm1) : 0;
 
     /*** Prepare source-related data ***/
     final int sbpp, stype;
@@ -2107,32 +2107,32 @@
                 (a >>> destAlphaPreShift << destAlphaShift);
             switch (dtype) {
                 case TYPE_GENERIC_8: {
-                    destData[dp] = (byte) data;
+                    destData[dp] = cast(byte) data;
                 } break;
                 case TYPE_GENERIC_16_MSB: {
-                    destData[dp] = (byte) (data >>> 8);
-                    destData[dp + 1] = (byte) (data & 0xff);
+                    destData[dp] = cast(byte) (data >>> 8);
+                    destData[dp + 1] = cast(byte) (data & 0xff);
                 } break;
                 case TYPE_GENERIC_16_LSB: {
-                    destData[dp] = (byte) (data & 0xff);
-                    destData[dp + 1] = (byte) (data >>> 8);
+                    destData[dp] = cast(byte) (data & 0xff);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
                 } break;
                 case TYPE_GENERIC_24: {
-                    destData[dp] = (byte) (data >>> 16);
-                    destData[dp + 1] = (byte) (data >>> 8);
-                    destData[dp + 2] = (byte) (data & 0xff);
+                    destData[dp] = cast(byte) (data >>> 16);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                    destData[dp + 2] = cast(byte) (data & 0xff);
                 } break;
                 case TYPE_GENERIC_32_MSB: {
-                    destData[dp] = (byte) (data >>> 24);
-                    destData[dp + 1] = (byte) (data >>> 16);
-                    destData[dp + 2] = (byte) (data >>> 8);
-                    destData[dp + 3] = (byte) (data & 0xff);
+                    destData[dp] = cast(byte) (data >>> 24);
+                    destData[dp + 1] = cast(byte) (data >>> 16);
+                    destData[dp + 2] = cast(byte) (data >>> 8);
+                    destData[dp + 3] = cast(byte) (data & 0xff);
                 } break;
                 case TYPE_GENERIC_32_LSB: {
-                    destData[dp] = (byte) (data & 0xff);
-                    destData[dp + 1] = (byte) (data >>> 8);
-                    destData[dp + 2] = (byte) (data >>> 16);
-                    destData[dp + 3] = (byte) (data >>> 24);
+                    destData[dp] = cast(byte) (data & 0xff);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                    destData[dp + 2] = cast(byte) (data >>> 16);
+                    destData[dp + 3] = cast(byte) (data >>> 24);
                 } break;
             }
         }
@@ -2198,9 +2198,9 @@
 
     /*** Prepare scaling data ***/
     final int dwm1 = destWidth - 1;
-    final int sfxi = (dwm1 !is 0) ? (int)((((long)srcWidth << 16) - 1) / dwm1) : 0;
+    final int sfxi = (dwm1 !is 0) ? cast(int)(((cast(long)srcWidth << 16) - 1) / dwm1) : 0;
     final int dhm1 = destHeight - 1;
-    final int sfyi = (dhm1 !is 0) ? (int)((((long)srcHeight << 16) - 1) / dhm1) : 0;
+    final int sfyi = (dhm1 !is 0) ? cast(int)(((cast(long)srcHeight << 16) - 1) / dhm1) : 0;
 
     /*** Prepare source-related data ***/
     final int stype;
@@ -2305,7 +2305,7 @@
                 } else {
                     paletteMapping = new byte[1 << srcDepth];
                     int mask = (0xff << destDepth) >>> 8;
-                    for (int i = 0; i < paletteMapping.length; ++i) paletteMapping[i] = (byte)(i & mask);
+                    for (int i = 0; i < paletteMapping.length; ++i) paletteMapping[i] = cast(byte)(i & mask);
                 }
                 break;
             }
@@ -2334,7 +2334,7 @@
                         minDistance = distance;
                     }
                 }
-                paletteMapping[i] = (byte)index;
+                paletteMapping[i] = cast(byte)index;
                 if (minDistance !is 0) isExactPaletteMapping = false;
             }
             break;
@@ -2358,8 +2358,8 @@
                             if ((sp & 1) !is 0) v = paletteMapping[srcData[sp >> 1] & 0x0f];
                             else v = (srcData[sp >> 1] >>> 4) & 0x0f;
                             sp += (sfx >>> 16);
-                            if ((dp & 1) !is 0) destData[dp >> 1] = (byte)((destData[dp >> 1] & 0xf0) | v);
-                            else destData[dp >> 1] = (byte)((destData[dp >> 1] & 0x0f) | (v << 4));
+                            if ((dp & 1) !is 0) destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0xf0) | v);
+                            else destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0x0f) | (v << 4));
                         }
                     }
                     break;
@@ -2369,7 +2369,7 @@
                             final int index = paletteMapping[(srcData[sp >> 2] >>> (6 - (sp & 3) * 2)) & 0x03];
                             sp += (sfx >>> 16);
                             final int shift = 6 - (dp & 3) * 2;
-                            destData[dp >> 2] = (byte)(destData[dp >> 2] & ~(0x03 << shift) | (index << shift));
+                            destData[dp >> 2] = cast(byte)(destData[dp >> 2] & ~(0x03 << shift) | (index << shift));
                         }
                     }
                     break;                  
@@ -2379,7 +2379,7 @@
                             final int index = paletteMapping[(srcData[sp >> 3] >>> (7 - (sp & 7))) & 0x01];
                             sp += (sfx >>> 16);
                             final int shift = 7 - (dp & 7);
-                            destData[dp >> 3] = (byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
+                            destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
                         }
                     }
                     break;                  
@@ -2389,7 +2389,7 @@
                             final int index = paletteMapping[(srcData[sp >> 3] >>> (sp & 7)) & 0x01];
                             sp += (sfx >>> 16);
                             final int shift = dp & 7;
-                            destData[dp >> 3] = (byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
+                            destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
                         }
                     }
                     break;
@@ -2464,23 +2464,23 @@
                     /*** WRITE NEXT PIXEL ***/
                     switch (dtype) {
                         case TYPE_INDEX_8:
-                            destData[dp] = (byte) index;
+                            destData[dp] = cast(byte) index;
                             break;
                         case TYPE_INDEX_4:
-                            if ((dp & 1) !is 0) destData[dp >> 1] = (byte)((destData[dp >> 1] & 0xf0) | index);
-                            else destData[dp >> 1] = (byte)((destData[dp >> 1] & 0x0f) | (index << 4));
+                            if ((dp & 1) !is 0) destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0xf0) | index);
+                            else destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0x0f) | (index << 4));
                             break;                  
                         case TYPE_INDEX_2: {
                             final int shift = 6 - (dp & 3) * 2;
-                            destData[dp >> 2] = (byte)(destData[dp >> 2] & ~(0x03 << shift) | (index << shift));
+                            destData[dp >> 2] = cast(byte)(destData[dp >> 2] & ~(0x03 << shift) | (index << shift));
                         } break;                    
                         case TYPE_INDEX_1_MSB: {
                             final int shift = 7 - (dp & 7);
-                            destData[dp >> 3] = (byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
+                            destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
                         } break;
                         case TYPE_INDEX_1_LSB: {
                             final int shift = dp & 7;
-                            destData[dp >> 3] = (byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
+                            destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
                         } break;                    
                     }
                 }
@@ -2644,23 +2644,23 @@
             /*** WRITE NEXT PIXEL ***/
             switch (dtype) {
                 case TYPE_INDEX_8:
-                    destData[dp] = (byte) lastindex;
+                    destData[dp] = cast(byte) lastindex;
                     break;
                 case TYPE_INDEX_4:
-                    if ((dp & 1) !is 0) destData[dp >> 1] = (byte)((destData[dp >> 1] & 0xf0) | lastindex);
-                    else destData[dp >> 1] = (byte)((destData[dp >> 1] & 0x0f) | (lastindex << 4));
+                    if ((dp & 1) !is 0) destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0xf0) | lastindex);
+                    else destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0x0f) | (lastindex << 4));
                     break;
                 case TYPE_INDEX_2: {
                     final int shift = 6 - (dp & 3) * 2;
-                    destData[dp >> 2] = (byte)(destData[dp >> 2] & ~(0x03 << shift) | (lastindex << shift));
+                    destData[dp >> 2] = cast(byte)(destData[dp >> 2] & ~(0x03 << shift) | (lastindex << shift));
                 } break;                    
                 case TYPE_INDEX_1_MSB: {
                     final int shift = 7 - (dp & 7);
-                    destData[dp >> 3] = (byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
+                    destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
                 } break;
                 case TYPE_INDEX_1_LSB: {
                     final int shift = dp & 7;
-                    destData[dp >> 3] = (byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
+                    destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
                 } break;                    
             }
         }
@@ -2728,9 +2728,9 @@
 
     /*** Prepare scaling data ***/
     final int dwm1 = destWidth - 1;
-    final int sfxi = (dwm1 !is 0) ? (int)((((long)srcWidth << 16) - 1) / dwm1) : 0;
+    final int sfxi = (dwm1 !is 0) ? cast(int)(((cast(long)srcWidth << 16) - 1) / dwm1) : 0;
     final int dhm1 = destHeight - 1;
-    final int sfyi = (dhm1 !is 0) ? (int)((((long)srcHeight << 16) - 1) / dhm1) : 0;
+    final int sfyi = (dhm1 !is 0) ? cast(int)(((cast(long)srcHeight << 16) - 1) / dhm1) : 0;
 
     /*** Prepare source-related data ***/
     final int stype;
@@ -2973,32 +2973,32 @@
                 (a >>> destAlphaPreShift << destAlphaShift);
             switch (dtype) {
                 case TYPE_GENERIC_8: {
-                    destData[dp] = (byte) data;
+                    destData[dp] = cast(byte) data;
                 } break;
                 case TYPE_GENERIC_16_MSB: {
-                    destData[dp] = (byte) (data >>> 8);
-                    destData[dp + 1] = (byte) (data & 0xff);
+                    destData[dp] = cast(byte) (data >>> 8);
+                    destData[dp + 1] = cast(byte) (data & 0xff);
                 } break;
                 case TYPE_GENERIC_16_LSB: {
-                    destData[dp] = (byte) (data & 0xff);
-                    destData[dp + 1] = (byte) (data >>> 8);
+                    destData[dp] = cast(byte) (data & 0xff);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
                 } break;
                 case TYPE_GENERIC_24: {
-                    destData[dp] = (byte) (data >>> 16);
-                    destData[dp + 1] = (byte) (data >>> 8);
-                    destData[dp + 2] = (byte) (data & 0xff);
+                    destData[dp] = cast(byte) (data >>> 16);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                    destData[dp + 2] = cast(byte) (data & 0xff);
                 } break;
                 case TYPE_GENERIC_32_MSB: {
-                    destData[dp] = (byte) (data >>> 24);
-                    destData[dp + 1] = (byte) (data >>> 16);
-                    destData[dp + 2] = (byte) (data >>> 8);
-                    destData[dp + 3] = (byte) (data & 0xff);
+                    destData[dp] = cast(byte) (data >>> 24);
+                    destData[dp + 1] = cast(byte) (data >>> 16);
+                    destData[dp + 2] = cast(byte) (data >>> 8);
+                    destData[dp + 3] = cast(byte) (data & 0xff);
                 } break;
                 case TYPE_GENERIC_32_LSB: {
-                    destData[dp] = (byte) (data & 0xff);
-                    destData[dp + 1] = (byte) (data >>> 8);
-                    destData[dp + 2] = (byte) (data >>> 16);
-                    destData[dp + 3] = (byte) (data >>> 24);
+                    destData[dp] = cast(byte) (data & 0xff);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                    destData[dp + 2] = cast(byte) (data >>> 16);
+                    destData[dp + 3] = cast(byte) (data >>> 24);
                 } break;
             }
         }
@@ -3066,9 +3066,9 @@
 
     /*** Prepare scaling data ***/
     final int dwm1 = destWidth - 1;
-    final int sfxi = (dwm1 !is 0) ? (int)((((long)srcWidth << 16) - 1) / dwm1) : 0;
+    final int sfxi = (dwm1 !is 0) ? cast(int)(((cast(long)srcWidth << 16) - 1) / dwm1) : 0;
     final int dhm1 = destHeight - 1;
-    final int sfyi = (dhm1 !is 0) ? (int)((((long)srcHeight << 16) - 1) / dhm1) : 0;
+    final int sfyi = (dhm1 !is 0) ? cast(int)(((cast(long)srcHeight << 16) - 1) / dhm1) : 0;
 
     /*** Prepare source-related data ***/
     final int sbpp, stype;
@@ -3351,23 +3351,23 @@
             /*** WRITE NEXT PIXEL ***/
             switch (dtype) {
                 case TYPE_INDEX_8:
-                    destData[dp] = (byte) lastindex;
+                    destData[dp] = cast(byte) lastindex;
                     break;
                 case TYPE_INDEX_4:
-                    if ((dp & 1) !is 0) destData[dp >> 1] = (byte)((destData[dp >> 1] & 0xf0) | lastindex);
-                    else destData[dp >> 1] = (byte)((destData[dp >> 1] & 0x0f) | (lastindex << 4));
+                    if ((dp & 1) !is 0) destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0xf0) | lastindex);
+                    else destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0x0f) | (lastindex << 4));
                     break;
                 case TYPE_INDEX_2: {
                     final int shift = 6 - (dp & 3) * 2;
-                    destData[dp >> 2] = (byte)(destData[dp >> 2] & ~(0x03 << shift) | (lastindex << shift));
+                    destData[dp >> 2] = cast(byte)(destData[dp >> 2] & ~(0x03 << shift) | (lastindex << shift));
                 } break;                    
                 case TYPE_INDEX_1_MSB: {
                     final int shift = 7 - (dp & 7);
-                    destData[dp >> 3] = (byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
+                    destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
                 } break;
                 case TYPE_INDEX_1_LSB: {
                     final int shift = dp & 7;
-                    destData[dp >> 3] = (byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
+                    destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
                 } break;                    
             }
         }
@@ -3491,14 +3491,14 @@
                 ++dy, blend += blendi, dp += bytesPerLine) {
                 for (int dx = 0; dx < bandWidth; ++dx) {
                     bitmapData[dp + dx] = (blend + DITHER_MATRIX[dy & 7][dx]) <
-                        0x1000000 ? (byte)0 : (byte)1;
+                        0x1000000 ? cast(byte)0 : cast(byte)1;
                 }
             }       
         } else {
             for (int dx = 0, blend = 0; dx < bandWidth; ++dx, blend += blendi) {
                 for (int dy = 0, dptr = dx; dy < bandHeight; ++dy, dptr += bytesPerLine) {
                     bitmapData[dptr] = (blend + DITHER_MATRIX[dy][dx & 7]) <
-                        0x1000000 ? (byte)0 : (byte)1;
+                        0x1000000 ? cast(byte)0 : cast(byte)1;
                 }
             }
         }
@@ -3516,12 +3516,12 @@
     final int inc = ((to << 16) - val) / steps + 1;
     if (vertical) {
         for (int dy = 0; dy < bandHeight; ++dy, dp += bytesPerLine) {
-            bitmapData[dp] = (byte)(val >>> 16);
+            bitmapData[dp] = cast(byte)(val >>> 16);
             val += inc;
         }
     } else {
         for (int dx = 0; dx < bandWidth; ++dx, dp += 4) {
-            bitmapData[dp] = (byte)(val >>> 16);
+            bitmapData[dp] = cast(byte)(val >>> 16);
             val += inc;
         }
     }       
@@ -3542,7 +3542,7 @@
                 final int thresh = DITHER_MATRIX[dy & 7][dx] >>> bits;
                 int temp = val + thresh;
                 if (temp > 0xffffff) bitmapData[dptr] = -1;
-                else bitmapData[dptr] = (byte)((temp >>> 16) & mask);
+                else bitmapData[dptr] = cast(byte)((temp >>> 16) & mask);
             }
             val += inc;
         }
@@ -3552,7 +3552,7 @@
                 final int thresh = DITHER_MATRIX[dy][dx & 7] >>> bits;
                 int temp = val + thresh;
                 if (temp > 0xffffff) bitmapData[dptr] = -1;
-                else bitmapData[dptr] = (byte)((temp >>> 16) & mask);
+                else bitmapData[dptr] = cast(byte)((temp >>> 16) & mask);
             }
             val += inc;
         }
--- a/dwt/graphics/ImageLoader.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/ImageLoader.d	Wed Aug 27 14:30:35 2008 +0200
@@ -318,7 +318,7 @@
     if (!hasListeners()) return;
     int size = imageLoaderListeners.size();
     for (int i = 0; i < size; i++) {
-        ImageLoaderListener listener = (ImageLoaderListener) imageLoaderListeners.elementAt(i);
+        ImageLoaderListener listener = cast(ImageLoaderListener) imageLoaderListeners.elementAt(i);
         listener.imageDataLoaded(event);
     }
 }
--- a/dwt/graphics/Path.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Path.d	Wed Aug 27 14:30:35 2008 +0200
@@ -219,10 +219,10 @@
     if (font is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
     if (font.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT);
     NSString str = NSString.stringWith(string);
-    NSTextStorage textStorage = ((NSTextStorage)new NSTextStorage().alloc());
+    NSTextStorage textStorage = (cast(NSTextStorage)new NSTextStorage().alloc());
     textStorage.initWithString_(str);
-    NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
-    NSTextContainer textContainer = (NSTextContainer)new NSTextContainer().alloc();
+    NSLayoutManager layoutManager = cast(NSLayoutManager)new NSLayoutManager().alloc().init();
+    NSTextContainer textContainer = cast(NSTextContainer)new NSTextContainer().alloc();
     NSSize size = new NSSize();
     size.width = Float.MAX_VALUE;
     size.height = Float.MAX_VALUE;
@@ -413,26 +413,26 @@
             case OS.NSMoveToBezierPathElement:
                 types[typeCount++] = DWT.PATH_MOVE_TO;
                 OS.memmove(pt, points, NSPoint.sizeof);
-                pointArray[pointCount++] = (int)pt.x;
-                pointArray[pointCount++] = (int)pt.y;
+                pointArray[pointCount++] = cast(int)pt.x;
+                pointArray[pointCount++] = cast(int)pt.y;
                 break;
             case OS.NSLineToBezierPathElement:
                 types[typeCount++] = DWT.PATH_LINE_TO;
                 OS.memmove(pt, points, NSPoint.sizeof);
-                pointArray[pointCount++] = (int)pt.x;
-                pointArray[pointCount++] = (int)pt.y;
+                pointArray[pointCount++] = cast(int)pt.x;
+                pointArray[pointCount++] = cast(int)pt.y;
                 break;
             case OS.NSCurveToBezierPathElement:
                 types[typeCount++] = DWT.PATH_CUBIC_TO;
                 OS.memmove(pt, points, NSPoint.sizeof);
-                pointArray[pointCount++] = (int)pt.x;
-                pointArray[pointCount++] = (int)pt.y;
+                pointArray[pointCount++] = cast(int)pt.x;
+                pointArray[pointCount++] = cast(int)pt.y;
                 OS.memmove(pt, points + NSPoint.sizeof, NSPoint.sizeof);
-                pointArray[pointCount++] = (int)pt.x;
-                pointArray[pointCount++] = (int)pt.y;
+                pointArray[pointCount++] = cast(int)pt.x;
+                pointArray[pointCount++] = cast(int)pt.y;
                 OS.memmove(pt, points + NSPoint.sizeof + NSPoint.sizeof, NSPoint.sizeof);
-                pointArray[pointCount++] = (int)pt.x;
-                pointArray[pointCount++] = (int)pt.y;
+                pointArray[pointCount++] = cast(int)pt.x;
+                pointArray[pointCount++] = cast(int)pt.y;
                 break;
             case OS.NSClosePathBezierPathElement:
                 types[typeCount++] = DWT.PATH_CLOSE;
--- a/dwt/graphics/Pattern.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Pattern.d	Wed Aug 27 14:30:35 2008 +0200
@@ -166,7 +166,7 @@
     this.alpha2 = alpha2;
     NSColor start = NSColor.colorWithDeviceRed(color1.handle[0], color1.handle[1], color1.handle[2], alpha1 / 255f);
     NSColor end = NSColor.colorWithDeviceRed(color2.handle[0], color2.handle[1], color2.handle[2], alpha2 / 255f);
-    gradient = ((NSGradient)new NSGradient().alloc()).initWithStartingColor(start, end);
+    gradient = (cast(NSGradient)new NSGradient().alloc()).initWithStartingColor(start, end);
     init();
 }
 
--- a/dwt/graphics/Point.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Point.d	Wed Aug 27 14:30:35 2008 +0200
@@ -76,7 +76,7 @@
 public bool equals (Object object) {
     if (object is this) return true;
     if (!(object instanceof Point)) return false;
-    Point p = (Point)object;
+    Point p = cast(Point)object;
     return (p.x is this.x) && (p.y is this.y);
 }
 
--- a/dwt/graphics/RGB.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/RGB.d	Wed Aug 27 14:30:35 2008 +0200
@@ -105,7 +105,7 @@
     } else {
         if (hue is 360) hue = 0;
         hue /= 60;  
-        int i = (int)hue;
+        int i = cast(int)hue;
         float f = hue - i;
         float p = brightness * (1 - saturation);
         float q = brightness * (1 - saturation * f);
@@ -144,9 +144,9 @@
                 break;
         }
     }
-    red = (int)(r * 255 + 0.5);
-    green = (int)(g * 255 + 0.5);
-    blue = (int)(b * 255 + 0.5);    
+    red = cast(int)(r * 255 + 0.5);
+    green = cast(int)(g * 255 + 0.5);
+    blue = cast(int)(b * 255 + 0.5);    
 }
 
 /**
@@ -195,7 +195,7 @@
 public bool equals(Object object) {
     if (object is this) return true;
     if (!(object instanceof RGB)) return false;
-    RGB rgb = (RGB)object;
+    RGB rgb = cast(RGB)object;
     return (rgb.red is this.red) && (rgb.green is this.green) && (rgb.blue is this.blue);
 }
 
--- a/dwt/graphics/Rectangle.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Rectangle.d	Wed Aug 27 14:30:35 2008 +0200
@@ -153,7 +153,7 @@
 public bool equals (Object object) {
     if (object is this) return true;
     if (!(object instanceof Rectangle)) return false;
-    Rectangle r = (Rectangle)object;
+    Rectangle r = cast(Rectangle)object;
     return (r.x is this.x) && (r.y is this.y) && (r.width is this.width) && (r.height is this.height);
 }
 
--- a/dwt/graphics/Region.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Region.d	Wed Aug 27 14:30:35 2008 +0200
@@ -114,11 +114,11 @@
     if (count <= 2) return;
     int polyRgn = OS.NewRgn();
     OS.OpenRgn();
-    OS.MoveTo((short)pointArray[0], (short)pointArray[1]);
+    OS.MoveTo(cast(short)pointArray[0], cast(short)pointArray[1]);
     for (int i = 1; i < count / 2; i++) {
-        OS.LineTo((short)pointArray[2 * i], (short)pointArray[2 * i + 1]);
+        OS.LineTo(cast(short)pointArray[2 * i], cast(short)pointArray[2 * i + 1]);
     }
-    OS.LineTo((short)pointArray[0], (short)pointArray[1]);
+    OS.LineTo(cast(short)pointArray[0], cast(short)pointArray[1]);
     OS.CloseRgn(polyRgn);
     OS.UnionRgn(handle, polyRgn, handle);
     OS.DisposeRgn(polyRgn);
@@ -168,7 +168,7 @@
     if (width < 0 || height < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT);
     int rectRgn = OS.NewRgn();
     short[] r = new short[4];
-    OS.SetRect(r, (short)x, (short)y, (short)(x + width),(short)(y + height));
+    OS.SetRect(r, cast(short)x, cast(short)y, cast(short)(x + width),cast(short)(y + height));
     OS.RectRgn(rectRgn, r);
     OS.UnionRgn(handle, rectRgn, handle);
     OS.DisposeRgn(rectRgn);
@@ -211,7 +211,7 @@
  */
 public bool contains(int x, int y) {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    short[] point = new short[]{(short)x, (short)y};
+    short[] point = new short[]{cast(short)x, cast(short)y};
     return OS.PtInRgn(point, handle);
 }
 
@@ -260,19 +260,19 @@
         point.y = rect[0];
         point = transform.transformPoint(point);
         short startX, startY;
-        OS.MoveTo(startX = (short)point.x, startY = (short)point.y);
+        OS.MoveTo(startX = cast(short)point.x, startY = cast(short)point.y);
         point.x = rect[3];
         point.y = rect[0];
         point = transform.transformPoint(point);
-        OS.LineTo((short)Math.round(point.x), (short)point.y);
+        OS.LineTo(cast(short)Math.round(point.x), cast(short)point.y);
         point.x = rect[3];
         point.y = rect[2];
         point = transform.transformPoint(point);
-        OS.LineTo((short)Math.round(point.x), (short)Math.round(point.y));
+        OS.LineTo(cast(short)Math.round(point.x), cast(short)Math.round(point.y));
         point.x = rect[1];
         point.y = rect[2];
         point = transform.transformPoint(point);
-        OS.LineTo((short)point.x, (short)Math.round(point.y));
+        OS.LineTo(cast(short)point.x, cast(short)Math.round(point.y));
         OS.LineTo(startX, startY);
         OS.CloseRgn(polyRgn);
         OS.UnionRgn(newRgn, polyRgn, newRgn);
@@ -299,7 +299,7 @@
 public bool equals(Object object) {
     if (this is object) return true;
     if (!(object instanceof Region)) return false;
-    Region region = (Region)object;
+    Region region = cast(Region)object;
     return handle is region.handle;
 }
 
@@ -419,7 +419,7 @@
     if (width < 0 || height < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT);
     int rectRgn = OS.NewRgn();
     short[] r = new short[4];
-    OS.SetRect(r, (short)x, (short)y, (short)(x + width),(short)(y + height));
+    OS.SetRect(r, cast(short)x, cast(short)y, cast(short)(x + width),cast(short)(y + height));
     OS.RectRgn(rectRgn, r);
     OS.SectRgn(handle, rectRgn, handle);
     OS.DisposeRgn(rectRgn);
@@ -469,7 +469,7 @@
 public bool intersects (int x, int y, int width, int height) {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
     short[] r = new short[4];
-    OS.SetRect(r, (short)x, (short)y, (short)(x + width),(short)(y + height));
+    OS.SetRect(r, cast(short)x, cast(short)y, cast(short)(x + width),cast(short)(y + height));
     return OS.RectInRgn(rect, handle);
 }
 
@@ -546,11 +546,11 @@
     if (pointArray.length < 2) return;
     int polyRgn = OS.NewRgn();
     OS.OpenRgn();
-    OS.MoveTo((short)pointArray[0], (short)pointArray[1]);
+    OS.MoveTo(cast(short)pointArray[0], cast(short)pointArray[1]);
     for (int i = 1; i < pointArray.length / 2; i++) {
-        OS.LineTo((short)pointArray[2 * i], (short)pointArray[2 * i + 1]);
+        OS.LineTo(cast(short)pointArray[2 * i], cast(short)pointArray[2 * i + 1]);
     }
-    OS.LineTo((short)pointArray[0], (short)pointArray[1]);
+    OS.LineTo(cast(short)pointArray[0], cast(short)pointArray[1]);
     OS.CloseRgn(polyRgn);
     OS.DiffRgn(handle, polyRgn, handle);
     OS.DisposeRgn(polyRgn);
@@ -601,7 +601,7 @@
     if (width < 0 || height < 0) DWT.error(DWT.ERROR_INVALID_ARGUMENT);
     int rectRgn = OS.NewRgn();
     short[] r = new short[4];
-    OS.SetRect(r, (short)x, (short)y, (short)(x + width),(short)(y + height));
+    OS.SetRect(r, cast(short)x, cast(short)y, cast(short)(x + width),cast(short)(y + height));
     OS.RectRgn(rectRgn, r);
     OS.DiffRgn(handle, rectRgn, handle);
     OS.DisposeRgn(rectRgn);
@@ -646,7 +646,7 @@
  */
 public void translate (int x, int y) {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    OS.OffsetRgn (handle, (short)x, (short)y);
+    OS.OffsetRgn (handle, cast(short)x, cast(short)y);
 }
 
 /**
--- a/dwt/graphics/TextLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/TextLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -111,10 +111,10 @@
 void computeRuns() {
     if (textStorage !is null) return;
     NSString str = NSString.stringWith(text);
-    textStorage = ((NSTextStorage)new NSTextStorage().alloc());
+    textStorage = (cast(NSTextStorage)new NSTextStorage().alloc());
     textStorage.initWithString_(str);
-    layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
-    textContainer = (NSTextContainer)new NSTextContainer().alloc();
+    layoutManager = cast(NSLayoutManager)new NSLayoutManager().alloc().init();
+    textContainer = cast(NSTextContainer)new NSTextContainer().alloc();
     NSSize size = new NSSize();
     size.width = wrapWidth !is -1 ? wrapWidth : Float.MAX_VALUE;
     size.height = Float.MAX_VALUE;
@@ -128,7 +128,7 @@
     range.length = str.length();
     textStorage.addAttribute(OS.NSFontAttributeName(), defaultFont.handle, range);
     
-    NSMutableParagraphStyle paragraph = (NSMutableParagraphStyle)new NSMutableParagraphStyle().alloc().init();
+    NSMutableParagraphStyle paragraph = cast(NSMutableParagraphStyle)new NSMutableParagraphStyle().alloc().init();
     int align = OS.NSLeftTextAlignment;
     if (justify) {
         align = OS.NSJustifiedTextAlignment;
@@ -423,7 +423,7 @@
         rect.height = Math.max(rect.height, layoutManager.defaultLineHeightForFont(nsFont));
     }
     rect.height = Math.max(rect.height, ascent + descent);
-    return new Rectangle(0, 0, (int)rect.width, (int)rect.height);
+    return new Rectangle(0, 0, cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
@@ -454,7 +454,7 @@
     range.location = layoutManager.glyphIndexForCharacterAtIndex(start);
     range.length = layoutManager.glyphIndexForCharacterAtIndex(end + 1) - range.location;
     NSRect rect = layoutManager.boundingRectForGlyphRange(range, textContainer);
-    return new Rectangle((int)rect.x, (int)rect.y, (int)Math.ceil(rect.width), (int)Math.ceil(rect.height));
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)Math.ceil(rect.width), cast(int)Math.ceil(rect.height));
 }
 
 /**
@@ -615,7 +615,7 @@
     computeRuns();
     if (!(0 <= lineIndex && lineIndex < lineBounds.length)) DWT.error(DWT.ERROR_INVALID_RANGE);
     NSRect rect = lineBounds[lineIndex];
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
@@ -656,14 +656,14 @@
     if (length is 0) {
         Font font = this.font !is null ? this.font : device.systemFont;
         NSFont nsFont = font.handle;
-        int ascent = (int)(0.5f + nsFont.ascender());
-        int descent = (int)(0.5f + (-nsFont.descender() + nsFont.leading()));   
+        int ascent = cast(int)(0.5f + nsFont.ascender());
+        int descent = cast(int)(0.5f + (-nsFont.descender() + nsFont.leading()));   
         ascent = Math.max(ascent, this.ascent);
         descent = Math.max(descent, this.descent);
         return FontMetrics.cocoa_new(ascent, descent, 0, 0, ascent + descent);
     }
     Rectangle rect = getLineBounds(lineIndex);
-    int baseline = (int)layoutManager.typesetter().baselineOffsetInLayoutManager(layoutManager, getLineOffsets()[lineIndex]);
+    int baseline = cast(int)layoutManager.typesetter().baselineOffsetInLayoutManager(layoutManager, getLineOffsets()[lineIndex]);
     return FontMetrics.cocoa_new(rect.height - baseline, baseline, 0, 0, rect.height);
 }
 
@@ -700,7 +700,7 @@
         NSRect bounds = layoutManager.boundingRectForGlyphRange(range, textContainer);
         point.x += bounds.width;
     }
-    return new Point((int)point.x, (int)rect.y);
+    return new Point(cast(int)point.x, cast(int)rect.y);
 }
 
 /**
--- a/dwt/graphics/TextStyle.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/TextStyle.d	Wed Aug 27 14:30:35 2008 +0200
@@ -201,7 +201,7 @@
     if (object is this) return true;
     if (object is null) return false;
     if (!(object instanceof TextStyle)) return false;
-    TextStyle style = (TextStyle)object;    
+    TextStyle style = cast(TextStyle)object;    
     if (foreground !is null) {
         if (!foreground.equals(style.foreground)) return false;
     } else if (style.foreground !is null) return false;
--- a/dwt/internal/Library.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/Library.d	Wed Aug 27 14:30:35 2008 +0200
@@ -73,7 +73,7 @@
         try
         {
             if (start < length)
-                major = to!(int)(aVersion[start .. index]);
+                major = to!cast(int)(aVersion[start .. index]);
         }
         catch (ConversionException e)
         {
@@ -84,7 +84,7 @@
         try
         {
             if (start < length)
-                minor = to!(int)(aVersion[start .. index]);
+                minor = to!cast(int)(aVersion[start .. index]);
         }
         catch (ConversionException e)
         {
@@ -95,7 +95,7 @@
         try
         {
             if (start < length)
-                micro = to!(int)(aVersion[start .. index]);
+                micro = to!cast(int)(aVersion[start .. index]);
         }
         catch (ConversionException e)
         {
@@ -166,7 +166,7 @@
 
  static bool load (String libName) {
  try {
- if (libName.indexOf (SEPARATOR) !is -1) {
+ if (libName.indexOf cast(SEPARATOR) !is -1) {
  System.load (libName);
  } else {
  System.loadLibrary (libName);
--- a/dwt/internal/c/callback.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/c/callback.d	Wed Aug 27 14:30:35 2008 +0200
@@ -21,13 +21,13 @@
 
 /* Header */
 
-version (Win32)
+version cast(Win32)
 {
     import tango.sys.win32.UserGdi;
     import tango.sys.win32.Types;
 }
 
-else version (Win32_WCE)
+else version cast(Win32_WCE)
 {
     import tango.sys.win32.UserGdi;
     import tango.sys.win32.Types;
@@ -53,7 +53,7 @@
 
 bool USE_ASSEMBLER = false;
 
-version (X86)
+version cast(X86)
     bool USE_ASSEMBLER = true;
 
 private
@@ -68,8 +68,8 @@
 
 static if (USE_ASSEMBLER)
 {
-    version (Win32){}
-    else version (Win32_WCE){}
+    version cast(Win32){}
+    else version cast(Win32_WCE){}
     else
         import tango.stdc.posix.sys.mman;
 
@@ -147,14 +147,14 @@
                 
                 if (callbackCode == null)
                 {
-                    version (Win32)
+                    version cast(Win32)
                     {
                         callbackCode = VirtualAlloc(null, CALLBACK_THUNK_SIZE * MAX_CALLBACKS, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
                         if (callbackCode == null)
                             return 0;
                     }
 
-                    else version (Win32_WCE)
+                    else version cast(Win32_WCE)
                     {
                         callbackCode = VirtualAlloc(null, CALLBACK_THUNK_SIZE * MAX_CALLBACKS, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
                         if (callbackCode == null)
@@ -237,7 +237,7 @@
                 //POP EBP - 1 byte
                 code[j++] = 0x5d;
 
-                version (Win32)
+                version cast(Win32)
                 {
                     // RETN argCount * SWT_PTR.sizeof - 3 bytes
                     code[j++] = 0xc2;
@@ -245,7 +245,7 @@
                     code[j++] = 0x00;
                 }
 
-                else version (Win32_WCE)
+                else version cast(Win32_WCE)
                 {
                     // RETN argCount * SWT_PTR.sizeof - 3 bytes
                     code[j++] = 0xc2;
--- a/dwt/internal/c/qd/bindings.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/c/qd/bindings.d	Wed Aug 27 14:30:35 2008 +0200
@@ -12,10 +12,10 @@
 import dwt.internal.objc.runtime;
 
 
-alias extern (C) OSStatus* delegate (UInt16 message, RgnHandle rgn, /*const*/Rect* rect, void* refCon) RegionToRectsProcPtr;
+alias extern cast(C) OSStatus* delegate (UInt16 message, RgnHandle rgn, /*const*/Rect* rect, void* refCon) RegionToRectsProcPtr;
 alias RegionToRectsProcPtr RegionToRectsUPP;
 
-extern (C):
+extern cast(C):
 
 RgnHandle NewRgn ();
 void RectRgn (RgnHandle rgn, /*const*/Rect* r);
@@ -34,4 +34,4 @@
 Boolean RectInRgn (/*const*/Rect* r, RgnHandle rgn);
 OSStatus QDRegionToRects (RgnHandle rgn, QDRegionParseDirection dir, RegionToRectsUPP proc, void* userData);
 void CopyRgn (RgnHandle srcRgn, RgnHandle dstRgn);
-void SetRect (Rect* r, short left, short top, short right, short bottom);
\ No newline at end of file
+void SetRect (Rect* r, short left, short top, short right, short bottom);
--- a/dwt/internal/cocoa/CGBase.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/cocoa/CGBase.d	Wed Aug 27 14:30:35 2008 +0200
@@ -7,17 +7,17 @@
  */
 module dwt.internal.cocoa.CGBase;
 
-version (X86_64)
+version cast(X86_64)
     alias double CGFloat;
 
-else version (PPC64)
+else version cast(PPC64)
     alias double CGFloat;
 
-else version (X86)
+else version cast(X86)
     alias float CGFloat;
 
-else version (PPC)
+else version cast(PPC)
     alias float CGFloat;
 
 else
-    pragma(msg, "CGFloat is Unimplemented");
\ No newline at end of file
+    pragma(msg, "CGFloat is Unimplemented");
--- a/dwt/internal/cocoa/CGFloat.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/cocoa/CGFloat.d	Wed Aug 27 14:30:35 2008 +0200
@@ -7,17 +7,17 @@
  */
 module dwt.internal.cocoa.CGFloat;
 
-version (X86_64)
+version cast(X86_64)
     alias double CGFloat;
 
-else version (PPC64)
+else version cast(PPC64)
     alias double CGFloat;
 
-else version (X86)
+else version cast(X86)
     alias float CGFloat;
 
-else version (PPC)
+else version cast(PPC)
     alias float CGFloat;
 
 else
-    pragma(msg, "CGFloat is unimplemented");
\ No newline at end of file
+    pragma(msg, "CGFloat is unimplemented");
--- a/dwt/internal/cocoa/MacGenerator.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/cocoa/MacGenerator.d	Wed Aug 27 14:30:35 2008 +0200
@@ -55,7 +55,7 @@
 {
     foreach (str ; xml)
     {
-        Document document = new Document!(char);
+        Document document = new Document!cast(wchar);
         document.parse(str);
         
         foreach (node ; document.root.children)
@@ -85,7 +85,7 @@
 {
     foreach (str ; xml)
     {
-        Document document = new Document!(char);
+        Document document = new Document!cast(wchar);
         document.parse(str);
         
         foreach (node ; document.root.children)
@@ -115,7 +115,7 @@
 {
     foreach (str ; xml)
     {
-        Document document = new Document!(char);
+        Document document = new Document!cast(wchar);
         document.parse(str);
         
         foreach (node ; document.root.children)
@@ -326,7 +326,7 @@
                             } else if (returnNode !is null && isFloatingPoint(returnNode)) {
                                 String type = getJavaType(returnNode);
                                 out("\treturn ");
-                                if (type.opEquals("float")) out("(float)");
+                                if (type.opEquals("float")) out("cast(float)");
                                 out("OS.objc_msgSend_fpret(");
                             } else if (returnNode !is null && isObject(returnNode)) {
                                 out("\tint result = OS.objc_msgSend(");
@@ -435,7 +435,7 @@
         }
     }
     for (Iterator iterator = set.iterator(); iterator.hasNext();) {
-        String sel = (String) iterator.next();
+        String sel = cast(String) iterator.next();
         String selConst = getSelConst(sel);
         out("public static final int ");
         out(selConst);
@@ -574,17 +574,17 @@
             out("_1=cast=(id)");
             outln();
             out(key);
-            out("_2=cast=(SEL)");
+            out("_2=cast=cast(SEL)");
             outln();
         } else {
             out(key);
             out("_0=cast=(id)");
             outln();
             out(key);
-            out("_1=cast=(SEL)");
+            out("_1=cast=cast(SEL)");
             outln();
         }
-        Node method = (Node)set.get(key);
+        Node method = cast(Node)set.get(key);
         NodeList params = method.getChildNodes();
         for (int k = 0; k < params.getLength(); k++) {
             Node param = params.item(k);
@@ -628,7 +628,7 @@
         }
     }
     for (Iterator iterator = set.iterator(); iterator.hasNext();) {
-        String cls = (String) iterator.next();
+        String cls = cast(String) iterator.next();
         String clsConst = "class_" + cls;
         out("public static final int ");
         out(clsConst);
--- a/dwt/internal/cocoa/NSInteger.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/cocoa/NSInteger.d	Wed Aug 27 14:30:35 2008 +0200
@@ -7,26 +7,26 @@
  */
 module dwt.internal.cocoa.NSInteger;
 
-version (X86_64) {
+version cast(X86_64) {
     alias ulong NSUInteger;
     alias long NSInteger;
 }
 
-else version (PPC64) {
+else version cast(PPC64) {
     alias ulong NSUInteger;
     alias long NSInteger;
 }
 
-else version (X86) {
+else version cast(X86) {
     alias uint NSUInteger;
     alias int NSInteger;
 }
 
-else version (PPC) {
+else version cast(PPC) {
     alias uint NSUInteger;
     alias int NSInteger;
 }
 
 else {
     pragma(error, "Unsupported architecture");
-}
\ No newline at end of file
+}
--- a/dwt/internal/cocoa/OS.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/cocoa/OS.d	Wed Aug 27 14:30:35 2008 +0200
@@ -137,7 +137,7 @@
     alias dwt.internal.objc.runtime.objc_msgSend_stret objc_msgSend_stret;
     alias dwt.internal.objc.runtime.objc_msgSendSuper objc_msgSendSuper;
     
-    version (X86)
+    version cast(X86)
         alias dwt.internal.objc.runtime.objc_msgSend_fpret objc_msgSend_fpret;     
 
     /** Classes */
--- a/dwt/internal/cocoa/WebView.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/cocoa/WebView.d	Wed Aug 27 14:30:35 2008 +0200
@@ -554,7 +554,7 @@
 }
 
 public float textSizeMultiplier() {
-    return (float)OS.objc_msgSend_fpret(this.id, OS.sel_textSizeMultiplier);
+    return cast(float)OS.objc_msgSend_fpret(this.id, OS.sel_textSizeMultiplier);
 }
 
 public void toggleContinuousSpellChecking(id sender) {
--- a/dwt/internal/image/FileFormat.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/FileFormat.d	Wed Aug 27 14:30:35 2008 +0200
@@ -72,7 +72,7 @@
         if (FORMATS[i] !is null) {
             try {
                 Class clazz = Class.forName(FORMAT_PACKAGE + '.' + FORMATS[i] + FORMAT_SUFFIX);
-                fileFormat = (FileFormat) clazz.newInstance();
+                fileFormat = cast(FileFormat) clazz.newInstance();
                 if (fileFormat.isFileFormat(stream)) {
                     isSupported = true;
                     break;
@@ -101,7 +101,7 @@
     FileFormat fileFormat = null;
     try {
         Class clazz = Class.forName(FORMAT_PACKAGE + '.' + FORMATS[format] + FORMAT_SUFFIX);
-        fileFormat = (FileFormat) clazz.newInstance();
+        fileFormat = cast(FileFormat) clazz.newInstance();
     } catch (Exception e) {
         DWT.error(DWT.ERROR_UNSUPPORTED_FORMAT);
     }
--- a/dwt/internal/image/GIFFileFormat.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/GIFFileFormat.d	Wed Aug 27 14:30:35 2008 +0200
@@ -35,8 +35,8 @@
     static final int GIF_EXTENSION_BLOCK_ID = 0x21;
     static final int GIF_IMAGE_BLOCK_ID = 0x2C;
     static final int GIF_TRAILER_ID = 0x3B;
-    static final byte [] GIF89a = new byte[] { (byte)'G', (byte)'I', (byte)'F', (byte)'8', (byte)'9', (byte)'a' };
-    static final byte [] NETSCAPE2_0 = new byte[] { (byte)'N', (byte)'E', (byte)'T', (byte)'S', (byte)'C', (byte)'A', (byte)'P', (byte)'E', (byte)'2', (byte)'.', (byte)'0' };
+    static final byte [] GIF89a = new byte[] { cast(byte)'G', cast(byte)'I', cast(byte)'F', cast(byte)'8', cast(byte)'9', cast(byte)'a' };
+    static final byte [] NETSCAPE2_0 = new byte[] { cast(byte)'N', cast(byte)'E', cast(byte)'T', cast(byte)'S', cast(byte)'C', cast(byte)'A', cast(byte)'P', cast(byte)'E', cast(byte)'2', cast(byte)'.', cast(byte)'0' };
     
     /**
      * Answer a palette containing numGrays
@@ -46,7 +46,7 @@
         int n = numGrays - 1;
         RGB[] colors = new RGB[numGrays];
         for (int i = 0; i < numGrays; i++) {
-            int intensity = (byte)((i * 3) * 256 / n);
+            int intensity = cast(byte)((i * 3) * 256 / n);
             colors[i] = new RGB(intensity, intensity, intensity);
         }
         return new PaletteData(colors);
@@ -121,7 +121,7 @@
                 id = inputStream.read();
                 if (id > 0) {
                     /* We read the terminator earlier. */
-                    inputStream.unread(new byte[] {(byte)id});
+                    inputStream.unread(new byte[] {cast(byte)id});
                 }
             } catch (IOException e) {
                 DWT.error(DWT.ERROR_IO, e);
@@ -164,7 +164,7 @@
         }
         if (id is GIF_IMAGE_BLOCK_ID || id is GIF_TRAILER_ID) {
             try {
-                inputStream.unread(new byte[] {(byte)id});
+                inputStream.unread(new byte[] {cast(byte)id});
             } catch (IOException e) {
                 DWT.error(DWT.ERROR_IO, e);
             }
@@ -483,8 +483,8 @@
             /* Step 3: Write the GIF89a Header and Logical Screen Descriptor. */
             outputStream.write(GIF89a);
             int bitField = globalTable*128 + (depth-1)*16 + depth-1;
-            outputStream.writeShort((short)logicalScreenWidth);
-            outputStream.writeShort((short)logicalScreenHeight);
+            outputStream.writeShort(cast(short)logicalScreenWidth);
+            outputStream.writeShort(cast(short)logicalScreenHeight);
             outputStream.write(bitField);
             outputStream.write(backgroundPixel);
             outputStream.write(0); // Aspect ratio is 1:1
@@ -507,7 +507,7 @@
                 outputStream.write(NETSCAPE2_0);
                 outputStream.write(3); // Three bytes follow
                 outputStream.write(1); // Extension type
-                outputStream.writeShort((short) repeatCount);
+                outputStream.writeShort(cast(short) repeatCount);
                 outputStream.write(0); // Block terminator
             } catch (IOException e) {
                 DWT.error(DWT.ERROR_IO, e);
@@ -529,15 +529,15 @@
             try {
                 outputStream.write(GIF_IMAGE_BLOCK_ID);
                 byte[] block = new byte[9];
-                block[0] = (byte)(x & 0xFF);
-                block[1] = (byte)((x >> 8) & 0xFF);
-                block[2] = (byte)(y & 0xFF);
-                block[3] = (byte)((y >> 8) & 0xFF);
-                block[4] = (byte)(width & 0xFF);
-                block[5] = (byte)((width >> 8) & 0xFF);
-                block[6] = (byte)(height & 0xFF);
-                block[7] = (byte)((height >> 8) & 0xFF); 
-                block[8] = (byte)(globalTable is 0 ? (depth-1) | 0x80 : 0x00);
+                block[0] = cast(byte)(x & 0xFF);
+                block[1] = cast(byte)((x >> 8) & 0xFF);
+                block[2] = cast(byte)(y & 0xFF);
+                block[3] = cast(byte)((y >> 8) & 0xFF);
+                block[4] = cast(byte)(width & 0xFF);
+                block[5] = cast(byte)((width >> 8) & 0xFF);
+                block[6] = cast(byte)(height & 0xFF);
+                block[7] = cast(byte)((height >> 8) & 0xFF); 
+                block[8] = cast(byte)(globalTable is 0 ? (depth-1) | 0x80 : 0x00);
                 outputStream.write(block);
             } catch (IOException e) {
                 DWT.error(DWT.ERROR_IO, e);
@@ -579,17 +579,17 @@
             gcBlock[2] = 0;
             gcBlock[3] = 0;
             if (image.transparentPixel !is -1) {
-                gcBlock[0] = (byte)0x01;
-                gcBlock[3] = (byte)image.transparentPixel;
+                gcBlock[0] = cast(byte)0x01;
+                gcBlock[3] = cast(byte)image.transparentPixel;
             }
             if (image.disposalMethod !is 0) {
-                gcBlock[0] |= (byte)((image.disposalMethod & 0x07) << 2);
+                gcBlock[0] |= cast(byte)((image.disposalMethod & 0x07) << 2);
             }
             if (image.delayTime !is 0) {
-                gcBlock[1] = (byte)(image.delayTime & 0xFF);
-                gcBlock[2] = (byte)((image.delayTime >> 8) & 0xFF);
+                gcBlock[1] = cast(byte)(image.delayTime & 0xFF);
+                gcBlock[2] = cast(byte)((image.delayTime >> 8) & 0xFF);
             }
-            outputStream.write((byte)gcBlock.length);
+            outputStream.write(cast(byte)gcBlock.length);
             outputStream.write(gcBlock);
             outputStream.write(0); // Block terminator
         } catch (IOException e) {
@@ -605,9 +605,9 @@
         int offset = 0;
         for (int i = 0; i < palette.colors.length; i++) {
             RGB color = palette.colors[i];
-            bytes[offset] = (byte)color.red;
-            bytes[offset + 1] = (byte)color.green;
-            bytes[offset + 2] = (byte)color.blue;
+            bytes[offset] = cast(byte)color.red;
+            bytes[offset + 1] = cast(byte)color.green;
+            bytes[offset + 2] = cast(byte)color.blue;
             offset += 3;
         }
         try {
--- a/dwt/internal/image/JPEGDecoder.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/JPEGDecoder.d	Wed Aug 27 14:30:35 2008 +0200
@@ -466,7 +466,7 @@
                     }
 //                  look = PEEK_BITS(HUFF_LOOKAHEAD);
                     if (nb !is 1) {
-                        look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                        look = (( (get_buffer >> (bits_left -   cast(HUFF_LOOKAHEAD)))) & ((1<<cast(HUFF_LOOKAHEAD))-1));
                         if ((nb = dctbl.look_nbits[look]) !is 0) {
 //                          DROP_BITS(nb);
                             bits_left -= nb;
@@ -504,7 +504,7 @@
                         s += state.last_dc_val[ci];
                         state.last_dc_val[ci] = s;
                         /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
-                        block[0] = (short) s;
+                        block[0] = cast(short) s;
                     }
 
                     if (entropy.ac_needed[blkn]) {
@@ -531,7 +531,7 @@
                             }
                             if (nb !is 1) {
 //                              look = PEEK_BITS(HUFF_LOOKAHEAD);
-                                look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                                look = (( (get_buffer >> (bits_left -   cast(HUFF_LOOKAHEAD)))) & ((1<<cast(HUFF_LOOKAHEAD))-1));
                                 if ((nb = actbl.look_nbits[look]) !is 0) {
 //                                  DROP_BITS(nb);
                                     bits_left -= (nb);
@@ -572,7 +572,7 @@
                                  * DCTSIZE2, which could happen if the data is
                                  * corrupted.
                                  */
-                                block[jpeg_natural_order[k]] = (short) s;
+                                block[jpeg_natural_order[k]] = cast(short) s;
                             } else {
                                 if (r !is 15)
                                     break;
@@ -604,7 +604,7 @@
                             }
                             if (nb !is 1) {
 //                              look = PEEK_BITS(HUFF_LOOKAHEAD);
-                                look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                                look = (( (get_buffer >> (bits_left -   cast(HUFF_LOOKAHEAD)))) & ((1<<cast(HUFF_LOOKAHEAD))-1));
                                 if ((nb = actbl.look_nbits[look]) !is 0) {
 //                                  DROP_BITS(nb);
                                     bits_left -= (nb);
@@ -937,7 +937,7 @@
                         }
                         if (nb !is 1) {
 //                          look = PEEK_BITS(HUFF_LOOKAHEAD);
-                            look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                            look = (( (get_buffer >> (bits_left -   cast(HUFF_LOOKAHEAD)))) & ((1<<cast(HUFF_LOOKAHEAD))-1));
                             if ((nb = tbl.look_nbits[look]) !is 0) {
 //                              DROP_BITS(nb);
                                 bits_left -= nb;
@@ -1044,7 +1044,7 @@
                         if (s !is 0) {
                             int pos = jpeg_natural_order[k];
                             /* Output newly nonzero coefficient */
-                            block[pos] = (short) s;
+                            block[pos] = cast(short) s;
                             /* Remember its position in case we have to suspend */
                             newnz_pos[num_newnz++] = pos;
                         }
@@ -1182,7 +1182,7 @@
                         }
                         if (nb !is 1) {
 //                          look = PEEK_BITS(HUFF_LOOKAHEAD);
-                            look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                            look = (( (get_buffer >> (bits_left -   cast(HUFF_LOOKAHEAD)))) & ((1<<cast(HUFF_LOOKAHEAD))-1));
 
                             if ((nb = tbl.look_nbits[look]) !is 0) {
 //                              DROP_BITS(nb);
@@ -1216,7 +1216,7 @@
 //                          s = HUFF_EXTEND(r, s);
                             s = ((r) < extend_test[s] ? (r) + extend_offset[s] : (r));
                             /* Scale and output coefficient in natural (dezigzagged) order */
-                            block[jpeg_natural_order[k]] = (short) (s << Al);
+                            block[jpeg_natural_order[k]] = cast(short) (s << Al);
                         } else {
                             if (r is 15) {  /* ZRL */
                                 k += 15;        /* skip 15 zeroes in band */
@@ -1335,7 +1335,7 @@
                     }
                     if (nb !is 1) {
 //                      look = PEEK_BITS(HUFF_LOOKAHEAD);
-                        look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                        look = (( (get_buffer >> (bits_left -   cast(HUFF_LOOKAHEAD)))) & ((1<<cast(HUFF_LOOKAHEAD))-1));
 
                         if ((nb = tbl.look_nbits[look]) !is 0) {
 //                          DROP_BITS(nb);
@@ -1371,7 +1371,7 @@
                     s += state.last_dc_val[ci];
                     state.last_dc_val[ci] = s;
                     /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
-                    block[0] = (short) (s << Al);
+                    block[0] = cast(short) (s << Al);
                 }
 
                 /* Completed MCU, so update state */
@@ -1918,8 +1918,8 @@
 //                          i = 0;
 //                          for (row = 0; row < DCTSIZE; row++) {
 //                              for (col = 0; col < DCTSIZE; col++) {
-//                                  fmtbl[i] = (FLOAT_MULT_TYPE)
-//                                      ((double) qtbl.quantval[i] *
+//                                  fmtbl[i] = cast(FLOAT_MULT_TYPE)
+//                                      (cast(double) qtbl.quantval[i] *
 //                                   aanscalefactor[row] * aanscalefactor[col]);
 //                                  i++;
 //                              }
@@ -1992,7 +1992,7 @@
 //                      if (post.buffer is null) {
 //                          post.buffer = (*cinfo.mem.access_virt_sarray)
 //                              ((j_common_ptr) cinfo, post.whole_image,
-//                              (JDIMENSION) 0, post.strip_height, TRUE);
+//                              cast(JDIMENSION) 0, post.strip_height, TRUE);
 //                      }
                     } else {
                         /* For single-pass processing without color quantization,
@@ -2318,8 +2318,8 @@
 //#endif
             coef.whole_image[ci] = 
                 new short
-                    [(int)jround_up( compptr.height_in_blocks, compptr.v_samp_factor)]
-                    [(int)jround_up( compptr.width_in_blocks, compptr.h_samp_factor)]
+                    [cast(int)jround_up( compptr.height_in_blocks, compptr.v_samp_factor)]
+                    [cast(int)jround_up( compptr.width_in_blocks, compptr.h_samp_factor)]
                     [DCTSIZE2];
         }
 //      coef.consume_data = consume_data;
@@ -2387,23 +2387,23 @@
 //  /* Compute actual output image dimensions and DCT scaling choices. */
 //  if (cinfo.scale_num * 8 <= cinfo.scale_denom) {
 //      /* Provide 1/8 scaling */
-//      cinfo.output_width = (int)
+//      cinfo.output_width = cast(int)
 //          jdiv_round_up(cinfo.image_width, 8L);
-//      cinfo.output_height = (int)
+//      cinfo.output_height = cast(int)
 //          jdiv_round_up(cinfo.image_height, 8L);
 //      cinfo.min_DCT_scaled_size = 1;
 //  } else if (cinfo.scale_num * 4 <= cinfo.scale_denom) {
 //      /* Provide 1/4 scaling */
-//      cinfo.output_width = (int)
+//      cinfo.output_width = cast(int)
 //          jdiv_round_up(cinfo.image_width, 4L);
-//      cinfo.output_height = (int)
+//      cinfo.output_height = cast(int)
 //          jdiv_round_up(cinfo.image_height, 4L);
 //      cinfo.min_DCT_scaled_size = 2;
 //  } else if (cinfo.scale_num * 2 <= cinfo.scale_denom) {
 //      /* Provide 1/2 scaling */
-//      cinfo.output_width = (int)
+//      cinfo.output_width = cast(int)
 //          jdiv_round_up(cinfo.image_width, 2L);
-//      cinfo.output_height = (int)
+//      cinfo.output_height = cast(int)
 //          jdiv_round_up(cinfo.image_height, 2L);
 //      cinfo.min_DCT_scaled_size = 4;
 //  } else {
@@ -2435,11 +2435,11 @@
 //  for (ci = 0; ci < cinfo.num_components; ci++) {
 //      compptr = cinfo.comp_info[ci];
 //      /* Size in samples, after IDCT scaling */
-//      compptr.downsampled_width = (int)
-//          jdiv_round_up((long) cinfo.image_width * (long) (compptr.h_samp_factor * compptr.DCT_scaled_size),
+//      compptr.downsampled_width = cast(int)
+//          jdiv_round_up(cast(long) cinfo.image_width * cast(long) (compptr.h_samp_factor * compptr.DCT_scaled_size),
 //              (cinfo.max_h_samp_factor * DCTSIZE));
-//      compptr.downsampled_height = (int)
-//          jdiv_round_up((long) cinfo.image_height * (long) (compptr.v_samp_factor * compptr.DCT_scaled_size),
+//      compptr.downsampled_height = cast(int)
+//          jdiv_round_up(cast(long) cinfo.image_height * cast(long) (compptr.v_samp_factor * compptr.DCT_scaled_size),
 //              (cinfo.max_v_samp_factor * DCTSIZE));
 //  }
 //
@@ -2529,11 +2529,11 @@
     /* First segment of "simple" table: limit[x] = 0 for x < 0 */
     /* Main part of "simple" table: limit[x] = x */
     for (i = 0; i <= MAXJSAMPLE; i++)
-        table[i + offset] = (byte)i;
+        table[i + offset] = cast(byte)i;
     offset += CENTERJSAMPLE;    /* Point to where post-IDCT table starts */
     /* End of simple table, rest of first half of post-IDCT table */
     for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
-        table[i+offset] = (byte)MAXJSAMPLE;
+        table[i+offset] = cast(byte)MAXJSAMPLE;
     /* Second half of post-IDCT table */
     System.arraycopy(cinfo.sample_range_limit, cinfo.sample_range_limit_offset, table, offset + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), CENTERJSAMPLE);
 }
@@ -2553,14 +2553,14 @@
         /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
         /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
         /* Cr=>R value is nearest int to 1.40200 * x */
-        cconvert.Cr_r_tab[i] = ((int)(1.40200f * (1<<SCALEBITS) + 0.5f) * x + ONE_HALF) >> SCALEBITS;
+        cconvert.Cr_r_tab[i] = (cast(int)(1.40200f * (1<<SCALEBITS) + 0.5f) * x + ONE_HALF) >> SCALEBITS;
         /* Cb=>B value is nearest int to 1.77200 * x */
-        cconvert.Cb_b_tab[i] = ((int)(1.77200f * (1<<SCALEBITS) + 0.5f) * x + ONE_HALF) >> SCALEBITS;
+        cconvert.Cb_b_tab[i] = (cast(int)(1.77200f * (1<<SCALEBITS) + 0.5f) * x + ONE_HALF) >> SCALEBITS;
         /* Cr=>G value is scaled-up -0.71414 * x */
-        cconvert.Cr_g_tab[i] = ((int)(- (0.71414f * (1<<SCALEBITS) + 0.5f)) * x);
+        cconvert.Cr_g_tab[i] = (cast(int)(- (0.71414f * (1<<SCALEBITS) + 0.5f)) * x);
         /* Cb=>G value is scaled-up -0.34414 * x */
         /* We also add in ONE_HALF so that need not do it in inner loop */
-        cconvert.Cb_g_tab[i] = ((int)(- (0.34414f* (1<<SCALEBITS) + 0.5f)) * x + ONE_HALF);
+        cconvert.Cb_g_tab[i] = (cast(int)(- (0.34414f* (1<<SCALEBITS) + 0.5f)) * x + ONE_HALF);
     }
 }
 
@@ -2680,8 +2680,8 @@
 //          post.whole_image = (*cinfo.mem.request_virt_sarray)
 //              ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
 //              cinfo.output_width * cinfo.out_color_components,
-//              (JDIMENSION) jround_up((long) cinfo.output_height,
-//              (long) post.strip_height),
+//              cast(JDIMENSION) jround_up(cast(long) cinfo.output_height,
+//              cast(long) post.strip_height),
 //   post.strip_height);
 //#else
 //          ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
@@ -2875,14 +2875,14 @@
         } else if ((h_out_group % h_in_group) is 0 && (v_out_group % v_in_group) is 0) {
             /* Generic integral-factors upsampling method */
             upsample.methods[ci] = INT_UPSAMPLE;
-            upsample.h_expand[ci] = (byte) (h_out_group / h_in_group);
-            upsample.v_expand[ci] = (byte) (v_out_group / v_in_group);
+            upsample.h_expand[ci] = cast(byte) (h_out_group / h_in_group);
+            upsample.v_expand[ci] = cast(byte) (v_out_group / v_in_group);
         } else
             error();
 //          ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
         if (need_buffer) {
             upsample.color_buf[ci] = new byte[cinfo.max_v_samp_factor]
-                         [(int) jround_up(cinfo.output_width, cinfo.max_h_samp_factor)];
+                         [cast(int) jround_up(cinfo.output_width, cinfo.max_h_samp_factor)];
         }
     }
 }
@@ -3250,8 +3250,8 @@
     prepare_range_limit_table(cinfo);
 
     /* Width of an output scanline must be representable as JDIMENSION. */
-    samplesperrow = (long) cinfo.output_width * (long) cinfo.out_color_components;
-    jd_samplesperrow = (int) samplesperrow;
+    samplesperrow = cast(long) cinfo.output_width * cast(long) cinfo.out_color_components;
+    jd_samplesperrow = cast(int) samplesperrow;
     if ( jd_samplesperrow !is samplesperrow)
         error();
 //      ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
@@ -3369,7 +3369,7 @@
 //          nscans = cinfo.num_components;
 //      }
 //      cinfo.progress.pass_counter = 0L;
-//      cinfo.progress.pass_limit = (long) cinfo.total_iMCU_rows * nscans;
+//      cinfo.progress.pass_limit = cast(long) cinfo.total_iMCU_rows * nscans;
 //      cinfo.progress.completed_passes = 0;
 //      cinfo.progress.total_passes = (cinfo.enable_2pass_quant ? 3 : 2);
 //      /* Count the input pass as done */
@@ -3443,7 +3443,7 @@
 //              if (cinfo.progress !is null && (retcode is JPEG_ROW_COMPLETED || retcode is JPEG_REACHED_SOS)) {
 //                  if (++cinfo.progress.pass_counter >= cinfo.progress.pass_limit) {
 //                      /* jdmaster underestimated number of scans; ratchet up one scan */
-//                      cinfo.progress.pass_limit += (long) cinfo.total_iMCU_rows;
+//                      cinfo.progress.pass_limit += cast(long) cinfo.total_iMCU_rows;
 //                  }
 //              }
             }
@@ -3960,7 +3960,7 @@
                             pred = (1<<Al)-1;
                         pred = -pred;
                     }
-                    workspace[1] = (short) pred;
+                    workspace[1] = cast(short) pred;
                 }
                 /* AC10 */
                 if ((Al=coef_bits[2+coef_offset]) !is 0 && workspace[8] is 0) {
@@ -3975,7 +3975,7 @@
                             pred = (1<<Al)-1;
                         pred = -pred;
                     }
-                    workspace[8] = (short) pred;
+                    workspace[8] = cast(short) pred;
                 }
                 /* AC20 */
                 if ((Al=coef_bits[3+coef_offset]) !is 0 && workspace[16] is 0) {
@@ -3990,7 +3990,7 @@
                             pred = (1<<Al)-1;
                         pred = -pred;
                     }
-                    workspace[16] = (short) pred;
+                    workspace[16] = cast(short) pred;
                 }
                 /* AC11 */
                 if ((Al=coef_bits[4+coef_offset]) !is 0 && workspace[9] is 0) {
@@ -4005,7 +4005,7 @@
                             pred = (1<<Al)-1;
                         pred = -pred;
                     }
-                    workspace[9] = (short) pred;
+                    workspace[9] = cast(short) pred;
                 }
                 /* AC02 */
                 if ((Al=coef_bits[5+coef_offset]) !is 0 && workspace[2] is 0) {
@@ -4020,7 +4020,7 @@
                             pred = (1<<Al)-1;
                         pred = -pred;
                     }
-                    workspace[2] = (short) pred;
+                    workspace[2] = cast(short) pred;
                 }
                 /* OK, do the IDCT */
                 jpeg_idct_islow(cinfo, compptr, workspace, output_ptr, output_ptr_offset, output_col);
@@ -4305,8 +4305,8 @@
 
     /* Call progress monitor hook if present */
 //  if (cinfo.progress !is NULL) {
-//      cinfo.progress.pass_counter = (long) cinfo.output_scanline;
-//      cinfo.progress.pass_limit = (long) cinfo.output_height;
+//      cinfo.progress.pass_counter = cast(long) cinfo.output_scanline;
+//      cinfo.progress.pass_limit = cast(long) cinfo.output_height;
 //      (*cinfo.progress.progress_monitor) ((j_common_ptr) cinfo);
 //  }
 
@@ -4345,14 +4345,14 @@
 //          JDIMENSION last_scanline;
 //          /* Call progress monitor hook if present */
 //          if (cinfo.progress !is NULL) {
-//  cinfo.progress.pass_counter = (long) cinfo.output_scanline;
-//  cinfo.progress.pass_limit = (long) cinfo.output_height;
+//  cinfo.progress.pass_counter = cast(long) cinfo.output_scanline;
+//  cinfo.progress.pass_limit = cast(long) cinfo.output_height;
 //  (*cinfo.progress.progress_monitor) ((j_common_ptr) cinfo);
 //          }
 //          /* Process some data */
 //          last_scanline = cinfo.output_scanline;
-//          (*cinfo.main.process_data) (cinfo, (JSAMPARRAY) NULL,
-//                      &cinfo.output_scanline, (JDIMENSION) 0);
+//          (*cinfo.main.process_data) (cinfo, cast(JSAMPARRAY) NULL,
+//                      &cinfo.output_scanline, cast(JDIMENSION) 0);
 //          if (cinfo.output_scanline is last_scanline)
 //  return FALSE;       /* No progress made, must suspend */
 //      }
@@ -4487,7 +4487,7 @@
                 tmp = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
             }
             /* We convert the zigzag-order table to natural array order. */
-            quant_ptr.quantval[jpeg_natural_order[i]] = (short) tmp;
+            quant_ptr.quantval[jpeg_natural_order[i]] = cast(short) tmp;
         }
 
 //      if (cinfo.err.trace_level >= 2) {
@@ -4564,10 +4564,10 @@
 //          ERREXIT1(cinfo, JERR_DAC_INDEX, index);
 
         if (index >= NUM_ARITH_TBLS) { /* define AC table */
-            cinfo.arith_ac_K[index-NUM_ARITH_TBLS] = (byte) val;
+            cinfo.arith_ac_K[index-NUM_ARITH_TBLS] = cast(byte) val;
         } else {            /* define DC table */
-            cinfo.arith_dc_L[index] = (byte) (val & 0x0F);
-            cinfo.arith_dc_U[index] = (byte) (val >> 4);
+            cinfo.arith_dc_L[index] = cast(byte) (val & 0x0F);
+            cinfo.arith_dc_U[index] = cast(byte) (val >> 4);
             if (cinfo.arith_dc_L[index] > cinfo.arith_dc_U[index])
                 error();
 //  ERREXIT1(cinfo, JERR_DAC_VALUE, val);
@@ -4688,7 +4688,7 @@
     length -= 8;
 
 //  TRACEMS4(cinfo, 1, JTRC_SOF, cinfo.unread_marker,
-//       (int) cinfo.image_width, (int) cinfo.image_height,
+//       cast(int) cinfo.image_width, cast(int) cinfo.image_height,
 //       cinfo.num_components);
 
     if (cinfo.marker.saw_SOF)
@@ -4872,20 +4872,20 @@
         int inptr_offset = 0, outptr_offset = 0;
         /* Special case for first column */
         invalue = inptr[inptr_offset++] & 0xFF;
-        outptr[outptr_offset++] = (byte) invalue;
-        outptr[outptr_offset++] = (byte) ((invalue * 3 + (inptr[inptr_offset] & 0xFF) + 2) >> 2);
+        outptr[outptr_offset++] = cast(byte) invalue;
+        outptr[outptr_offset++] = cast(byte) ((invalue * 3 + (inptr[inptr_offset] & 0xFF) + 2) >> 2);
 
         for (colctr = compptr.downsampled_width - 2; colctr > 0; colctr--) {
             /* General case: 3/4 * nearer pixel + 1/4 * further pixel */
             invalue = (inptr[inptr_offset++] & 0xFF) * 3;
-            outptr[outptr_offset++] = (byte) ((invalue + (inptr[inptr_offset-2] & 0xFF) + 1) >> 2);
-            outptr[outptr_offset++] = (byte) ((invalue + (inptr[inptr_offset] & 0xFF) + 2) >> 2);
+            outptr[outptr_offset++] = cast(byte) ((invalue + (inptr[inptr_offset-2] & 0xFF) + 1) >> 2);
+            outptr[outptr_offset++] = cast(byte) ((invalue + (inptr[inptr_offset] & 0xFF) + 2) >> 2);
         }
 
         /* Special case for last column */
         invalue = (inptr[inptr_offset] & 0xFF);
-        outptr[outptr_offset++] = (byte) ((invalue * 3 + (inptr[inptr_offset-1] & 0xFF) + 1) >> 2);
-        outptr[outptr_offset++] = (byte) invalue;
+        outptr[outptr_offset++] = cast(byte) ((invalue * 3 + (inptr[inptr_offset-1] & 0xFF) + 1) >> 2);
+        outptr[outptr_offset++] = cast(byte) invalue;
     }
 }
     
@@ -4915,22 +4915,22 @@
             /* Special case for first column */
             thiscolsum = (inptr0[inptr0_offset++] & 0xFF) * 3 + (inptr1[inptr1_offset++] & 0xFF);
             nextcolsum = (inptr0[inptr0_offset++] & 0xFF) * 3 + (inptr1[inptr1_offset++] & 0xFF);
-            outptr[outptr_offset++] = (byte) ((thiscolsum * 4 + 8) >> 4);
-            outptr[outptr_offset++] = (byte) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
+            outptr[outptr_offset++] = cast(byte) ((thiscolsum * 4 + 8) >> 4);
+            outptr[outptr_offset++] = cast(byte) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
             lastcolsum = thiscolsum; thiscolsum = nextcolsum;
 
             for (colctr = compptr.downsampled_width - 2; colctr > 0; colctr--) {
                 /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */
                 /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */
                 nextcolsum = (inptr0[inptr0_offset++] & 0xFF) * 3 + (inptr1[inptr1_offset++] & 0xFF);
-                outptr[outptr_offset++] = (byte) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
-                outptr[outptr_offset++] = (byte) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
+                outptr[outptr_offset++] = cast(byte) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
+                outptr[outptr_offset++] = cast(byte) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
                 lastcolsum = thiscolsum; thiscolsum = nextcolsum;
             }
 
             /* Special case for last column */
-            outptr[outptr_offset++] = (byte) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
-            outptr[outptr_offset++] = (byte) ((thiscolsum * 4 + 7) >> 4);
+            outptr[outptr_offset++] = cast(byte) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
+            outptr[outptr_offset++] = cast(byte) ((thiscolsum * 4 + 7) >> 4);
         }
         inrow++;
     }
@@ -5110,7 +5110,7 @@
 
     length -= 2;
     
-//  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo.unread_marker, (int) length);
+//  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo.unread_marker, cast(int) length);
 
     if (length > 0) {
         skip_input_data (cinfo, length);
@@ -5185,10 +5185,10 @@
         /* Found JFIF APP0 marker: save info */
         cinfo.saw_JFIF_marker = true;
         cinfo.JFIF_major_version = (data[5]);
-        cinfo.JFIF_minor_version = (byte)(data[6] & 0xFF);
-        cinfo.density_unit = (byte)(data[7] & 0xFF);
-        cinfo.X_density = (short)(((data[8] & 0xFF) << 8) + (data[9] & 0xFF));
-        cinfo.Y_density = (short)(((data[10] & 0xFF) << 8) + (data[11] & 0xFF));
+        cinfo.JFIF_minor_version = cast(byte)(data[6] & 0xFF);
+        cinfo.density_unit = cast(byte)(data[7] & 0xFF);
+        cinfo.X_density = cast(short)(((data[8] & 0xFF) << 8) + (data[9] & 0xFF));
+        cinfo.Y_density = cast(short)(((data[10] & 0xFF) << 8) + (data[11] & 0xFF));
         /* Check version.
          * Major version must be 1, anything else signals an incompatible change.
          * (We used to treat this as an error, but now it's a nonfatal warning,
@@ -5210,7 +5210,7 @@
         }
         totallen -= APP0_DATA_LEN;
         if (totallen != ((data[12] & 0xFF) * (data[13] & 0xFF) * 3)) {
-//          TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);
+//          TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, cast(int) totallen);
         }
     } else if (datalen >= 6 &&
             (data[0] & 0xFF) is 0x4A &&
@@ -5225,21 +5225,21 @@
          */
         switch ((data[5]) & 0xFF) {
             case 0x10:
-//              TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);
+//              TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, cast(int) totallen);
                 break;
             case 0x11:
-//              TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);
+//              TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, cast(int) totallen);
                 break;
             case 0x13:
-//              TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);
+//              TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, cast(int) totallen);
                 break;
             default:
-//              TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, GETJOCTET(data[5]), (int) totallen);
+//              TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, GETJOCTET(data[5]), cast(int) totallen);
             break;
         }
     } else {
         /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
-//      TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);
+//      TRACEMS1(cinfo, 1, JTRC_APP0, cast(int) totallen);
     }
 }
 
@@ -5265,10 +5265,10 @@
         transform = (data[11] & 0xFF);
 //      TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
         cinfo.saw_Adobe_marker = true;
-        cinfo.Adobe_transform = (byte) transform;
+        cinfo.Adobe_transform = cast(byte) transform;
     } else {
         /* Start of APP14 does not match "Adobe", or too short */
-//      TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
+//      TRACEMS1(cinfo, 1, JTRC_APP14, cast(int) (datalen + remaining));
     }
 }
 
@@ -5558,8 +5558,8 @@
 //              ERREXIT(cinfo, JERR_INPUT_EMPTY);
 //          WARNMS(cinfo, JWRN_JPEG_EOF);
             /* Insert a fake EOI marker */
-            cinfo.buffer[0] = (byte)0xFF;
-            cinfo.buffer[1] = (byte)M_EOI;
+            cinfo.buffer[0] = cast(byte)0xFF;
+            cinfo.buffer[1] = cast(byte)M_EOI;
             nbytes = 2;
         }
         cinfo.bytes_in_buffer = nbytes;
@@ -5835,15 +5835,15 @@
         compptr = cinfo.comp_info[ci];
         compptr.DCT_scaled_size = DCTSIZE;
         /* Size in DCT blocks */
-        compptr.width_in_blocks = (int)jdiv_round_up((long) cinfo.image_width * (long) compptr.h_samp_factor, (cinfo.max_h_samp_factor * DCTSIZE));
-        compptr.height_in_blocks = (int)jdiv_round_up((long) cinfo.image_height * (long) compptr.v_samp_factor, (cinfo.max_v_samp_factor * DCTSIZE));
+        compptr.width_in_blocks = cast(int)jdiv_round_up(cast(long) cinfo.image_width * cast(long) compptr.h_samp_factor, (cinfo.max_h_samp_factor * DCTSIZE));
+        compptr.height_in_blocks = cast(int)jdiv_round_up(cast(long) cinfo.image_height * cast(long) compptr.v_samp_factor, (cinfo.max_v_samp_factor * DCTSIZE));
         /* downsampled_width and downsampled_height will also be overridden by
          * jdmaster.c if we are doing full decompression.   The transcoder library
          * doesn't use these values, but the calling application might.
          */
         /* Size in samples */
-        compptr.downsampled_width = (int)jdiv_round_up((long) cinfo.image_width * (long) compptr.h_samp_factor, cinfo.max_h_samp_factor);
-        compptr.downsampled_height = (int)jdiv_round_up((long) cinfo.image_height * (long) compptr.v_samp_factor, cinfo.max_v_samp_factor);
+        compptr.downsampled_width = cast(int)jdiv_round_up(cast(long) cinfo.image_width * cast(long) compptr.h_samp_factor, cinfo.max_h_samp_factor);
+        compptr.downsampled_height = cast(int)jdiv_round_up(cast(long) cinfo.image_height * cast(long) compptr.v_samp_factor, cinfo.max_v_samp_factor);
         /* Mark component needed, until color conversion says otherwise */
         compptr.component_needed = true;
         /* Mark no quantization table yet saved for component */
@@ -5851,7 +5851,7 @@
     }
 
     /* Compute number of fully interleaved MCU rows. */
-    cinfo.total_iMCU_rows = (int)jdiv_round_up( cinfo.image_height, (cinfo.max_v_samp_factor*DCTSIZE));
+    cinfo.total_iMCU_rows = cast(int)jdiv_round_up( cinfo.image_height, (cinfo.max_v_samp_factor*DCTSIZE));
 
     /* Decide whether file contains multiple scans */
     if (cinfo.comps_in_scan < cinfo.num_components || cinfo.progressive_mode)
@@ -5902,8 +5902,8 @@
 //          ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo.comps_in_scan, MAX_COMPS_IN_SCAN);
         
         /* Overall image size in MCUs */
-        cinfo.MCUs_per_row = (int)jdiv_round_up( cinfo.image_width, (cinfo.max_h_samp_factor*DCTSIZE));
-        cinfo.MCU_rows_in_scan = (int)jdiv_round_up( cinfo.image_height, (cinfo.max_v_samp_factor*DCTSIZE));
+        cinfo.MCUs_per_row = cast(int)jdiv_round_up( cinfo.image_width, (cinfo.max_h_samp_factor*DCTSIZE));
+        cinfo.MCU_rows_in_scan = cast(int)jdiv_round_up( cinfo.image_height, (cinfo.max_v_samp_factor*DCTSIZE));
         
         cinfo.blocks_in_MCU = 0;
         
@@ -5990,7 +5990,7 @@
             error();
 //          ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
         while (i-- !is 0)
-            huffsize[p++] = (byte) l;
+            huffsize[p++] = cast(byte) l;
     }
     huffsize[p] = 0;
     numsymbols = p;
@@ -6348,7 +6348,7 @@
                 System.arraycopy(buffer[0], 0, data, offset, row_stride);
             }
             jpeg_finish_output(cinfo);
-            loader.notifyListeners(new ImageLoaderEvent(loader, (ImageData)imageData.clone(), incrementCount, done = jpeg_input_complete(cinfo)));
+            loader.notifyListeners(new ImageLoaderEvent(loader, cast(ImageData)imageData.clone(), incrementCount, done = jpeg_input_complete(cinfo)));
         } while (!done);
     } else {
         while (cinfo.output_scanline < cinfo.output_height) {
--- a/dwt/internal/image/JPEGFileFormat.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/JPEGFileFormat.d	Wed Aug 27 14:30:35 2008 +0200
@@ -242,7 +242,7 @@
                     sum += dataCbComp[srcIndex + ih] & 0xFF;
                 }
             }
-            imageComponents[ID_CB][destRowIndex + xPos] = (byte)(sum / vhFactor);
+            imageComponents[ID_CB][destRowIndex + xPos] = cast(byte)(sum / vhFactor);
         }
     }
     frameComponent = frameComponents[componentIds[ID_CR]];
@@ -256,7 +256,7 @@
                     sum += dataCrComp[srcIndex + ih] & 0xFF;
                 }
             }
-            imageComponents[ID_CR][destRowIndex + xPos] = (byte)(sum / vhFactor);
+            imageComponents[ID_CR][destRowIndex + xPos] = cast(byte)(sum / vhFactor);
         }
     }
     for (int iComp = 0; iComp < nComponents; iComp++) {
@@ -274,7 +274,7 @@
                 int dstOfs = ((yPos + 1) * componentWidth - delta);
                 int dataValue = imageComponent[(dstOfs > 0) ? dstOfs - 1 : 0] & 0xFF;
                 for (int i = 0; i < delta; i++) {
-                    imageComponent[dstOfs + i] = (byte)dataValue;
+                    imageComponent[dstOfs + i] = cast(byte)dataValue;
                 }
             }
         }
@@ -301,13 +301,13 @@
         int g = color.green;
         int b = color.blue;
         int n = RYTable[r] + GYTable[g] + BYTable[b];
-        yComp[i] = (byte)(n >> 16);
+        yComp[i] = cast(byte)(n >> 16);
         if ((n < 0) && ((n & 0xFFFF) !is 0)) yComp[i]--;
         n = RCbTable[r] + GCbTable[g] + BCbTable[b];
-        cbComp[i] = (byte)(n >> 16);
+        cbComp[i] = cast(byte)(n >> 16);
         if ((n < 0) && ((n & 0xFFFF) !is 0)) cbComp[i]--;
         n = RCrTable[r] + GCrTable[g] + BCrTable[b];
-        crComp[i] = (byte)(n >> 16);
+        crComp[i] = cast(byte)(n >> 16);
         if ((n < 0) && ((n & 0xFFFF) !is 0)) crComp[i]--;
     }
     int bSize = srcWidth * srcHeight;
@@ -348,13 +348,13 @@
         int g = color.green;
         int b = color.blue;
         int n = RYTable[r] + GYTable[g] + BYTable[b];
-        yComp[i] = (byte)(n >> 16);
+        yComp[i] = cast(byte)(n >> 16);
         if ((n < 0) && ((n & 0xFFFF) !is 0)) yComp[i]--;
         n = RCbTable[r] + GCbTable[g] + BCbTable[b];
-        cbComp[i] = (byte)(n >> 16);
+        cbComp[i] = cast(byte)(n >> 16);
         if ((n < 0) && ((n & 0xFFFF) !is 0)) cbComp[i]--;
         n = RCrTable[r] + GCrTable[g] + BCrTable[b];
-        crComp[i] = (byte)(n >> 16);
+        crComp[i] = cast(byte)(n >> 16);
         if ((n < 0) && ((n & 0xFFFF) !is 0)) crComp[i]--;
     }
     int dstWidth = image.width;
@@ -428,9 +428,9 @@
                 g = (greenShift < 0) ? g >>> -greenShift : g << greenShift;
                 int b = pixel & blueMask;
                 b = (blueShift < 0) ? b >>> -blueShift : b << blueShift;                
-                dataYComp[dstDataIndex] = (byte)((RYTable[r] + GYTable[g] + BYTable[b]) >> 16);
-                dataCbComp[dstDataIndex] = (byte)((RCbTable[r] + GCbTable[g] + BCbTable[b]) >> 16);
-                dataCrComp[dstDataIndex] = (byte)((RCrTable[r] + GCrTable[g] + BCrTable[b]) >> 16);
+                dataYComp[dstDataIndex] = cast(byte)((RYTable[r] + GYTable[g] + BYTable[b]) >> 16);
+                dataCbComp[dstDataIndex] = cast(byte)((RCbTable[r] + GCbTable[g] + BCbTable[b]) >> 16);
+                dataCrComp[dstDataIndex] = cast(byte)((RCrTable[r] + GCrTable[g] + BCrTable[b]) >> 16);
             }
         }
     } else {
@@ -444,9 +444,9 @@
                 int r = rgb.red;
                 int g = rgb.green;
                 int b = rgb.blue;
-                dataYComp[dstDataIndex] = (byte)((RYTable[r] + GYTable[g] + BYTable[b]) >> 16);
-                dataCbComp[dstDataIndex] = (byte)((RCbTable[r] + GCbTable[g] + BCbTable[b]) >> 16);
-                dataCrComp[dstDataIndex] = (byte)((RCrTable[r] + GCrTable[g] + BCrTable[b]) >> 16);
+                dataYComp[dstDataIndex] = cast(byte)((RYTable[r] + GYTable[g] + BYTable[b]) >> 16);
+                dataCbComp[dstDataIndex] = cast(byte)((RCbTable[r] + GCbTable[g] + BCbTable[b]) >> 16);
+                dataCrComp[dstDataIndex] = cast(byte)((RCrTable[r] + GCrTable[g] + BCrTable[b]) >> 16);
             }
         }
     }
@@ -470,7 +470,7 @@
             if (j >= imageWidth) {
                 y = 0;
             }
-            data[destIndex] = (byte)y;
+            data[destIndex] = cast(byte)y;
             srcIndex++;
             destIndex++;
         }
@@ -537,9 +537,9 @@
             } else {
                 if (b > 255) b = 255;
             }
-            rgbData[destIndex] = (byte)b;
-            rgbData[destIndex + 1] = (byte)g;
-            rgbData[destIndex + 2] = (byte)r;
+            rgbData[destIndex] = cast(byte)b;
+            rgbData[destIndex + 1] = cast(byte)g;
+            rgbData[destIndex + 2] = cast(byte)r;
             destIndex += 3;
             srcIndex++;
         }
@@ -830,15 +830,15 @@
     };
     int code = (huffCode & power2m1[nBits - 1]) << (24 - nBits - currentBitCount);
     byte[] codeBuffer = new byte[4];
-    codeBuffer[0] = (byte)(code & 0xFF);
-    codeBuffer[1] = (byte)((code >> 8) & 0xFF);
-    codeBuffer[2] = (byte)((code >> 16) & 0xFF);
-    codeBuffer[3] = (byte)((code >> 24) & 0xFF);
+    codeBuffer[0] = cast(byte)(code & 0xFF);
+    codeBuffer[1] = cast(byte)((code >> 8) & 0xFF);
+    codeBuffer[2] = cast(byte)((code >> 16) & 0xFF);
+    codeBuffer[3] = cast(byte)((code >> 24) & 0xFF);
     int abs = nBits - (8 - currentBitCount);
     if (abs < 0) abs = -abs;
     if ((abs >> 3) > 0) {
         currentByte += codeBuffer[2];
-        emitByte((byte)currentByte);
+        emitByte(cast(byte)currentByte);
         emitByte(codeBuffer[1]);
         currentByte = codeBuffer[0];
         currentBitCount += nBits - 16;
@@ -846,7 +846,7 @@
         currentBitCount += nBits;
         if (currentBitCount >= 8) {
             currentByte += codeBuffer[2];
-            emitByte((byte)currentByte);
+            emitByte(cast(byte)currentByte);
             currentByte = codeBuffer[1];
             currentBitCount -= 8;
         } else {
@@ -861,7 +861,7 @@
     dataBuffer[bufferCurrentPosition] = byteValue;
     bufferCurrentPosition++;
     if (byteValue is -1) {
-        emitByte((byte)0);
+        emitByte(cast(byte)0);
     }
 }
 void encodeACCoefficients(int[] dataUnit, int iComp) {
@@ -947,7 +947,7 @@
         }
     }
     if (currentBitCount !is 0) {
-        emitByte((byte)currentByte);
+        emitByte(cast(byte)currentByte);
     }
     resetOutputBuffer();
 }
@@ -1702,9 +1702,9 @@
     try {
         while (true) {
             if (byteStream.read(byteArray, 0, 1) !is 1) return null;
-            if (byteArray[0] is (byte) 0xFF) {
+            if (byteArray[0] is cast(byte) 0xFF) {
                 if (byteStream.read(byteArray, 1, 1) !is 1) return null;
-                if (byteArray[1] !is (byte) 0xFF && byteArray[1] !is 0) {
+                if (byteArray[1] !is cast(byte) 0xFF && byteArray[1] !is 0) {
                     byteStream.unread(byteArray);
                     return new JPEGSegment(byteArray);
                 }
@@ -1756,7 +1756,7 @@
             } else {
                 if (x > 255) x = 255;
             }
-            compImage[destIndex + col] = (byte)x;
+            compImage[destIndex + col] = cast(byte)x;
             srcIndex++;
         }
         destIndex += compWidth;
@@ -1767,7 +1767,7 @@
     if (!new JPEGStartOfImage().writeToStream(outputStream)) {
         DWT.error(DWT.ERROR_IO);
     }
-    JPEGAppn appn = new JPEGAppn(new byte[] {(byte)0xFF, (byte)0xE0, 0, 0x10, 0x4A, 0x46, 0x49, 0x46, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0});
+    JPEGAppn appn = new JPEGAppn(new byte[] {cast(byte)0xFF, cast(byte)0xE0, 0, 0x10, 0x4A, 0x46, 0x49, 0x46, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0});
     if (!appn.writeToStream(outputStream)) {
         DWT.error(DWT.ERROR_IO);
     }
--- a/dwt/internal/image/JPEGFrameHeader.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/JPEGFrameHeader.d	Wed Aug 27 14:30:35 2008 +0200
@@ -45,21 +45,21 @@
     }
     
     public void setSamplePrecision(int precision) {
-        reference[4] = (byte)(precision & 0xFF);
+        reference[4] = cast(byte)(precision & 0xFF);
     }
     
     public void setNumberOfLines(int anInteger) {
-        reference[5] = (byte)((anInteger & 0xFF00) >> 8);
-        reference[6] = (byte)(anInteger & 0xFF);
+        reference[5] = cast(byte)((anInteger & 0xFF00) >> 8);
+        reference[6] = cast(byte)(anInteger & 0xFF);
     }
     
     public void setSamplesPerLine(int samples) {
-        reference[7] = (byte)((samples & 0xFF00) >> 8);
-        reference[8] = (byte)(samples & 0xFF);
+        reference[7] = cast(byte)((samples & 0xFF00) >> 8);
+        reference[8] = cast(byte)(samples & 0xFF);
     }
     
     public void setNumberOfImageComponents(int anInteger) {
-        reference[9] = (byte)(anInteger & 0xFF);
+        reference[9] = cast(byte)(anInteger & 0xFF);
     }
     
     public int getMaxHFactor() {
@@ -145,9 +145,9 @@
             if (hi * vi > 4) {
                 DWT.error(DWT.ERROR_INVALID_IMAGE);
             }
-            reference[ofs] = (byte)(i + 1);
-            reference[ofs + 1] = (byte)(hi * 16 + vi);
-            reference[ofs + 2] = (byte)(compParam[0]);
+            reference[ofs] = cast(byte)(i + 1);
+            reference[ofs + 1] = cast(byte)(hi * 16 + vi);
+            reference[ofs + 2] = cast(byte)(compParam[0]);
             if (hi > hmax) hmax = hi;
             if (vi > vmax) vmax = vi;
         }
--- a/dwt/internal/image/JPEGHuffmanTable.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/JPEGHuffmanTable.d	Wed Aug 27 14:30:35 2008 +0200
@@ -32,46 +32,46 @@
     int[] ehCodes;
     byte[] ehCodeLengths;
     static byte[] DCLuminanceTable = {
-        (byte)255, (byte)196, 0, 31, 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
+        cast(byte)255, cast(byte)196, 0, 31, 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
         0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
     };
     static byte[] DCChrominanceTable = {
-        (byte)255, (byte)196, 0, 31, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+        cast(byte)255, cast(byte)196, 0, 31, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
         0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
     };
     static byte[] ACLuminanceTable = {
-        (byte)255, (byte)196, 0, (byte)181, 16, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125, 
+        cast(byte)255, cast(byte)196, 0, cast(byte)181, 16, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125, 
         1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 
-        50, (byte)129, (byte)145, (byte)161, 8, 35, 66, (byte)177, (byte)193, 21, 82, (byte)209, (byte)240, 36, 51, 98, 
-        114, (byte)130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 
+        50, cast(byte)129, cast(byte)145, cast(byte)161, 8, 35, 66, cast(byte)177, cast(byte)193, 21, 82, cast(byte)209, cast(byte)240, 36, 51, 98, 
+        114, cast(byte)130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 
         54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 
         88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 
-        119, 120, 121, 122, (byte)131, (byte)132, (byte)133, (byte)134, (byte)135, (byte)136, (byte)137, (byte)138, (byte)146, (byte)147, (byte)148, 
-        (byte)149, (byte)150, (byte)151, (byte)152, (byte)153, (byte)154, (byte)162, (byte)163, (byte)164, (byte)165, (byte)166, (byte)167, (byte)168, (byte)169, (byte)170, 
-        (byte)178, (byte)179, (byte)180, (byte)181, (byte)182, (byte)183, (byte)184, (byte)185, (byte)186, (byte)194, (byte)195, (byte)196, (byte)197, (byte)198, (byte)199, 
-        (byte)200, (byte)201, (byte)202, (byte)210, (byte)211, (byte)212, (byte)213, (byte)214, (byte)215, (byte)216, (byte)217, (byte)218, (byte)225, (byte)226, (byte)227, 
-        (byte)228, (byte)229, (byte)230, (byte)231, (byte)232, (byte)233, (byte)234, (byte)241, (byte)242, (byte)243, (byte)244, (byte)245, (byte)246, (byte)247, (byte)248, 
-        (byte)249, (byte)250
+        119, 120, 121, 122, cast(byte)131, cast(byte)132, cast(byte)133, cast(byte)134, cast(byte)135, cast(byte)136, cast(byte)137, cast(byte)138, cast(byte)146, cast(byte)147, cast(byte)148, 
+        cast(byte)149, cast(byte)150, cast(byte)151, cast(byte)152, cast(byte)153, cast(byte)154, cast(byte)162, cast(byte)163, cast(byte)164, cast(byte)165, cast(byte)166, cast(byte)167, cast(byte)168, cast(byte)169, cast(byte)170, 
+        cast(byte)178, cast(byte)179, cast(byte)180, cast(byte)181, cast(byte)182, cast(byte)183, cast(byte)184, cast(byte)185, cast(byte)186, cast(byte)194, cast(byte)195, cast(byte)196, cast(byte)197, cast(byte)198, cast(byte)199, 
+        cast(byte)200, cast(byte)201, cast(byte)202, cast(byte)210, cast(byte)211, cast(byte)212, cast(byte)213, cast(byte)214, cast(byte)215, cast(byte)216, cast(byte)217, cast(byte)218, cast(byte)225, cast(byte)226, cast(byte)227, 
+        cast(byte)228, cast(byte)229, cast(byte)230, cast(byte)231, cast(byte)232, cast(byte)233, cast(byte)234, cast(byte)241, cast(byte)242, cast(byte)243, cast(byte)244, cast(byte)245, cast(byte)246, cast(byte)247, cast(byte)248, 
+        cast(byte)249, cast(byte)250
     };
     static byte[] ACChrominanceTable = {
-        (byte)255, (byte)196, 0, (byte)181, 17, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 
+        cast(byte)255, cast(byte)196, 0, cast(byte)181, 17, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 
         1, 2, 119, 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 
-        50, (byte)129, 8, 20, 66, (byte)145, (byte)161, (byte)177, (byte)193, 9, 35, 
-        51, 82, (byte)240, 21, 98, 114, (byte)209, 10, 22, 36, 52, (byte)225, 37, 
-        (byte)241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 
+        50, cast(byte)129, 8, 20, 66, cast(byte)145, cast(byte)161, cast(byte)177, cast(byte)193, 9, 35, 
+        51, 82, cast(byte)240, 21, 98, 114, cast(byte)209, 10, 22, 36, 52, cast(byte)225, 37, 
+        cast(byte)241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 
         68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 
-        103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, (byte)130, 
-        (byte)131, (byte)132, (byte)133, (byte)134, (byte)135, (byte)136, (byte)137, 
-        (byte)138, (byte)146, (byte)147, (byte)148, (byte)149, (byte)150, (byte)151, 
-        (byte)152, (byte)153, (byte)154, (byte)162, (byte)163, (byte)164, (byte)165, 
-        (byte)166, (byte)167, (byte)168, (byte)169, (byte)170, (byte)178, (byte)179, 
-        (byte)180, (byte)181, (byte)182, (byte)183, (byte)184, (byte)185, (byte)186, 
-        (byte)194, (byte)195, (byte)196, (byte)197, (byte)198, (byte)199, (byte)200, 
-        (byte)201, (byte)202, (byte)210, (byte)211, (byte)212, (byte)213, (byte)214, 
-        (byte)215, (byte)216, (byte)217, (byte)218, (byte)226, (byte)227, (byte)228, 
-        (byte)229, (byte)230, (byte)231, (byte)232, (byte)233, (byte)234, (byte)242, 
-        (byte)243, (byte)244, (byte)245, (byte)246, (byte)247, (byte)248, (byte)249, 
-        (byte)250
+        103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, cast(byte)130, 
+        cast(byte)131, cast(byte)132, cast(byte)133, cast(byte)134, cast(byte)135, cast(byte)136, cast(byte)137, 
+        cast(byte)138, cast(byte)146, cast(byte)147, cast(byte)148, cast(byte)149, cast(byte)150, cast(byte)151, 
+        cast(byte)152, cast(byte)153, cast(byte)154, cast(byte)162, cast(byte)163, cast(byte)164, cast(byte)165, 
+        cast(byte)166, cast(byte)167, cast(byte)168, cast(byte)169, cast(byte)170, cast(byte)178, cast(byte)179, 
+        cast(byte)180, cast(byte)181, cast(byte)182, cast(byte)183, cast(byte)184, cast(byte)185, cast(byte)186, 
+        cast(byte)194, cast(byte)195, cast(byte)196, cast(byte)197, cast(byte)198, cast(byte)199, cast(byte)200, 
+        cast(byte)201, cast(byte)202, cast(byte)210, cast(byte)211, cast(byte)212, cast(byte)213, cast(byte)214, 
+        cast(byte)215, cast(byte)216, cast(byte)217, cast(byte)218, cast(byte)226, cast(byte)227, cast(byte)228, 
+        cast(byte)229, cast(byte)230, cast(byte)231, cast(byte)232, cast(byte)233, cast(byte)234, cast(byte)242, 
+        cast(byte)243, cast(byte)244, cast(byte)245, cast(byte)246, cast(byte)247, cast(byte)248, cast(byte)249, 
+        cast(byte)250
     };
     
 public this(byte[] reference) {
@@ -238,7 +238,7 @@
         byte[] eHuffSize = new byte[256];
         for (int i = 0; i < huffCodesIndex; i++) {
             eHuffCodes[huffVals[i]] = huffCodes[i];
-            eHuffSize[huffVals[i]] = (byte)huffCodeLengths[i];
+            eHuffSize[huffVals[i]] = cast(byte)huffCodeLengths[i];
         }
         
         /* Create the new JPEGHuffmanTable and add it to the allTables array. */
--- a/dwt/internal/image/JPEGQuantizationTable.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/JPEGQuantizationTable.d	Wed Aug 27 14:30:35 2008 +0200
@@ -13,7 +13,7 @@
 
 final class JPEGQuantizationTable : JPEGVariableSizeSegment {
     public static byte[] DefaultLuminanceQTable = {
-        (byte)255, (byte)219, 0, 67, 0,
+        cast(byte)255, cast(byte)219, 0, 67, 0,
         16, 11, 10, 16, 24, 40, 51, 61,
         12, 12, 14, 19, 26, 58, 60, 55,
         14, 13, 16, 24, 40, 57, 69, 56,
@@ -24,7 +24,7 @@
         72, 92, 95, 98, 112, 100, 103, 99
     };
     public static byte[] DefaultChrominanceQTable = {
-        (byte)255, (byte)219, 0, 67, 1,
+        cast(byte)255, cast(byte)219, 0, 67, 1,
         17, 18, 24, 47, 99, 99, 99, 99,
         18, 21, 26, 66, 99, 99, 99, 99,
         24, 26, 56, 99, 99, 99, 99, 99,
@@ -141,7 +141,7 @@
                 int temp = ((reference[i] & 0xFF) * qFactor + 50) / 100;
                 if (temp <= 0) temp = 1;
                 if (temp > 255) temp = 255;
-                reference[i] = (byte)temp;
+                reference[i] = cast(byte)temp;
             }
             ofs += 65;
             totalLength -= 65;
@@ -150,8 +150,8 @@
                 int temp = (((reference[i] & 0xFF) * 256 + (reference[i + 1] & 0xFF)) * qFactor + 50) / 100;
                 if (temp <= 0) temp = 1;
                 if (temp > 32767) temp = 32767;
-                reference[i] = (byte)(temp >> 8);
-                reference[i + 1] = (byte)(temp & 0xFF);
+                reference[i] = cast(byte)(temp >> 8);
+                reference[i + 1] = cast(byte)(temp & 0xFF);
             }
             ofs += 129;
             totalLength -= 129;
--- a/dwt/internal/image/JPEGScanHeader.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/JPEGScanHeader.d	Wed Aug 27 14:30:35 2008 +0200
@@ -73,21 +73,21 @@
     for (int i = 0; i < compCount; i++) {
         int ofs = i * 2 + 5;
         int[] compParams = compSpecParams[i];
-        reference[ofs] = (byte)(i + 1);
-        reference[ofs + 1] = (byte)(compParams[0] * 16 + compParams[1]);
+        reference[ofs] = cast(byte)(i + 1);
+        reference[ofs + 1] = cast(byte)(compParams[0] * 16 + compParams[1]);
     }
 }
 
 public void setEndOfSpectralSelection(int anInteger) {
-    reference[(2 * getNumberOfImageComponents()) + 6] = (byte)anInteger;
+    reference[(2 * getNumberOfImageComponents()) + 6] = cast(byte)anInteger;
 }
 
 public void setNumberOfImageComponents(int anInteger) {
-    reference[4] = (byte)(anInteger & 0xFF);
+    reference[4] = cast(byte)(anInteger & 0xFF);
 }
 
 public void setStartOfSpectralSelection(int anInteger) {
-    reference[(2 * getNumberOfImageComponents()) + 5] = (byte)anInteger;
+    reference[(2 * getNumberOfImageComponents()) + 5] = cast(byte)anInteger;
 }
 
 public int signature() {
--- a/dwt/internal/image/JPEGSegment.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/JPEGSegment.d	Wed Aug 27 14:30:35 2008 +0200
@@ -34,8 +34,8 @@
     }
     
     public void setSegmentMarker(int marker) {
-        reference[0] = (byte)((marker & 0xFF00) >> 8);
-        reference[1] = (byte)(marker & 0xFF);
+        reference[0] = cast(byte)((marker & 0xFF00) >> 8);
+        reference[1] = cast(byte)(marker & 0xFF);
     }
     
     public int getSegmentLength() {
@@ -43,8 +43,8 @@
     }
     
     public void setSegmentLength(int length) {
-        reference[2] = (byte)((length & 0xFF00) >> 8);
-        reference[3] = (byte)(length & 0xFF);
+        reference[2] = cast(byte)((length & 0xFF00) >> 8);
+        reference[3] = cast(byte)(length & 0xFF);
     }
     
     public bool writeToStream(LEDataOutputStream byteStream) {
--- a/dwt/internal/image/LEDataInputStream.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/LEDataInputStream.d	Wed Aug 27 14:30:35 2008 +0200
@@ -162,7 +162,7 @@
     public short readShort() {
         byte[] buf = new byte[2];
         read(buf);
-        return (short)(((buf[1] & 0xFF) << 8) | (buf[0] & 0xFF));
+        return cast(short)(((buf[1] & 0xFF) << 8) | (buf[0] & 0xFF));
     }
     
     /**
--- a/dwt/internal/image/LZWCodec.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/LZWCodec.d	Wed Aug 27 14:30:35 2008 +0200
@@ -53,7 +53,7 @@
             while ((c = nextCode()) is clearCode) {}
             if (c !is endCode) {
                 oc = fc = c;
-                buf[bufIndex] = (byte)c;
+                buf[bufIndex] = cast(byte)c;
                 bufIndex++;
                 if (bufIndex is imageWidth) {
                     nextPutPixels(buf);
@@ -90,7 +90,7 @@
             }
             while (stackIndex > 0) {
                 stackIndex--;
-                buf[bufIndex] = (byte)stack[stackIndex];
+                buf[bufIndex] = cast(byte)stack[stackIndex];
                 bufIndex++;
                 if (bufIndex is imageWidth) {
                     nextPutPixels(buf);
@@ -127,9 +127,9 @@
 
     // Write out last partial block
     if (bitsLeft is 8) {
-        block[0] = (byte)(blockIndex - 1); // Nothing in last byte
+        block[0] = cast(byte)(blockIndex - 1); // Nothing in last byte
     } else {
-        block[0] = (byte)(blockIndex); // Last byte has data
+        block[0] = cast(byte)(blockIndex); // Last byte has data
     }
     writeBlock();
 
@@ -257,7 +257,7 @@
     blockIndex = 1;
     blockSize = 255;
     block = new byte[blockSize];
-    block[0] = (byte)(blockSize - 1);
+    block[0] = cast(byte)(blockSize - 1);
     nodeStack = new LZWNode[1 << bitsPerPixel];
     for (int i = 0; i < nodeStack.length; i++) {
         LZWNode node = new LZWNode();
@@ -344,7 +344,7 @@
     // *high-order* bits of the code.
     int c = codeToDo & MASK_TABLE[bitsLeft - 1];
     currentByte = currentByte | (c << (8 - bitsLeft));
-    block[blockIndex] = (byte)currentByte;
+    block[blockIndex] = cast(byte)currentByte;
     codeBitsToDo -= bitsLeft;
     if (codeBitsToDo < 1) {
         // The whole code fit in the first byte, so we are done.
@@ -372,7 +372,7 @@
     }
     while (codeBitsToDo >= 8) {
         currentByte = codeToDo & 0xFF;
-        block[blockIndex] = (byte)currentByte;
+        block[blockIndex] = cast(byte)currentByte;
         codeToDo = codeToDo >> 8;
         codeBitsToDo -= 8;
         blockIndex++;
@@ -384,7 +384,7 @@
     // Fill the *low-order* bits of the last byte with the remainder
     bitsLeft = 8 - codeBitsToDo;
     currentByte = codeToDo;
-    block[blockIndex] = (byte)currentByte;
+    block[blockIndex] = cast(byte)currentByte;
 }
 /**
  * Copy a row of pixel values to the image.
@@ -421,7 +421,7 @@
             else if (pass is 5) line = 0;
             if (pass < 5) {
                 if (loader.hasListeners()) {
-                    ImageData imageCopy = (ImageData) image.clone();
+                    ImageData imageCopy = cast(ImageData) image.clone();
                     loader.notifyListeners(
                         new ImageLoaderEvent(loader, imageCopy, pass - 2, false));
                 }
@@ -455,7 +455,7 @@
         if (size is -1) {
             DWT.error(DWT.ERROR_INVALID_IMAGE);
         }
-        block[0] = (byte)size;
+        block[0] = cast(byte)size;
         size = inputStream.read(block, 1, size);
         if (size is -1) {
             DWT.error(DWT.ERROR_INVALID_IMAGE);
--- a/dwt/internal/image/OS2BMPFileFormat.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/OS2BMPFileFormat.d	Wed Aug 27 14:30:35 2008 +0200
@@ -149,9 +149,9 @@
     int offset = 0;
     for (int i = 0; i < n; i++) {
         RGB col = pal.colors[i];
-        bytes[offset] = (byte)col.blue;
-        bytes[offset + 1] = (byte)col.green;
-        bytes[offset + 2] = (byte)col.red;
+        bytes[offset] = cast(byte)col.blue;
+        bytes[offset + 1] = cast(byte)col.green;
+        bytes[offset + 2] = cast(byte)col.red;
         offset += 3;
     }
     return bytes;
@@ -262,7 +262,7 @@
         outputStream.writeShort(image.width);
         outputStream.writeShort(image.height);
         outputStream.writeShort(1);
-        outputStream.writeShort((short)image.depth);
+        outputStream.writeShort(cast(short)image.depth);
     } catch (IOException e) {
         DWT.error(DWT.ERROR_IO, e);
     }
--- a/dwt/internal/image/PNGFileFormat.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PNGFileFormat.d	Wed Aug 27 14:30:35 2008 +0200
@@ -97,12 +97,12 @@
             break;
         case PngChunk.CHUNK_PLTE:
             if (!headerChunk.usesDirectColor()) {
-                paletteChunk = (PngPlteChunk) chunk;
+                paletteChunk = cast(PngPlteChunk) chunk;
                 imageData.palette = paletteChunk.getPaletteData();                      
             }           
             break;
         case PngChunk.CHUNK_tRNS:
-            PngTrnsChunk trnsChunk = (PngTrnsChunk) chunk;
+            PngTrnsChunk trnsChunk = cast(PngTrnsChunk) chunk;
             if (trnsChunk.getTransparencyType(headerChunk) is 
                 PngTrnsChunk.TRANSPARENCY_TYPE_PIXEL) 
             {
@@ -135,7 +135,7 @@
             } else {
                 // Read in the pixel data for the image. This should
                 // go through all the image's IDAT chunks.  
-                PngIdatChunk dataChunk = (PngIdatChunk) chunk;
+                PngIdatChunk dataChunk = cast(PngIdatChunk) chunk;
                 readPixelData(dataChunk, chunkReader);              
             }
             break;
@@ -380,7 +380,7 @@
     byte[] currentRow = row1;   
     byte[] lastRow = row2;  
     for (int row = startRow; row < height; row += rowInterval) {
-        byte filterType = (byte)inputStream.read();
+        byte filterType = cast(byte)inputStream.read();
         int read = 0;
         while (read !is bytesPerRow) {
             read += inputStream.read(currentRow, read, bytesPerRow - read);
@@ -445,7 +445,7 @@
  */
 void fireInterlacedFrameEvent(int frameCount) {
     if (loader.hasListeners()) {
-        ImageData image = (ImageData) imageData.clone();
+        ImageData image = cast(ImageData) imageData.clone();
         bool finalFrame = frameCount is 6;
         loader.notifyListeners(new ImageLoaderEvent(loader, image, frameCount, finalFrame));
     }
@@ -465,7 +465,7 @@
     byte[] lastRow = row2;
     int height = headerChunk.getHeight();
     for (int row = 0; row < height; row++) {
-        byte filterType = (byte)inputStream.read();
+        byte filterType = cast(byte)inputStream.read();
         int read = 0;
         while (read !is bytesPerRow) {
             read += inputStream.read(currentRow, read, bytesPerRow - read);
@@ -499,7 +499,7 @@
         int sourceIndex = sourceOffset + (2 * i);
         int destinationIndex = destinationOffset + i;
         //int value = (source[sourceIndex] << 8) | source[sourceIndex + 1];
-        //byte compressedValue = (byte)(value * multiplier);
+        //byte compressedValue = cast(byte)(value * multiplier);
         byte compressedValue = source[sourceIndex];
         destination[destinationIndex] = compressedValue;
     }
@@ -515,7 +515,7 @@
  */
 static int compress16BitDepthTo8BitDepth(int value) {
     //double multiplier = (Compatibility.pow2(8) - 1) / (Compatibility.pow2(16) - 1);
-    //byte compressedValue = (byte)(value * multiplier);
+    //byte compressedValue = cast(byte)(value * multiplier);
     return value >> 8;
 }
 /**
@@ -532,14 +532,14 @@
             for (int i = byteOffset; i < row.length; i++) {
                 int current = row[i] & 0xFF;
                 int left = row[i - byteOffset] & 0xFF;
-                row[i] = (byte)((current + left) & 0xFF);
+                row[i] = cast(byte)((current + left) & 0xFF);
             }
             break;
         case PngIhdrChunk.FILTER_UP:
             for (int i = 0; i < row.length; i++) {
                 int current = row[i] & 0xFF;
                 int above = previousRow[i] & 0xFF;              
-                row[i] = (byte)((current + above) & 0xFF);
+                row[i] = cast(byte)((current + above) & 0xFF);
             }
             break;
         case PngIhdrChunk.FILTER_AVERAGE:
@@ -547,7 +547,7 @@
                 int left = (i < byteOffset) ? 0 : row[i - byteOffset] & 0xFF;
                 int above = previousRow[i] & 0xFF;
                 int current = row[i] & 0xFF;
-                row[i] = (byte)((current + ((left + above) / 2)) & 0xFF);
+                row[i] = cast(byte)((current + ((left + above) / 2)) & 0xFF);
             }
             break;
         case PngIhdrChunk.FILTER_PAETH:
@@ -570,7 +570,7 @@
                 }
                 
                 int currentValue = row[i] & 0xFF;
-                row[i] = (byte) ((currentValue + preductor) & 0xFF);
+                row[i] = cast(byte) ((currentValue + preductor) & 0xFF);
             }
             break;
     }
--- a/dwt/internal/image/PngChunk.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PngChunk.d	Wed Aug 27 14:30:35 2008 +0200
@@ -35,11 +35,11 @@
     // Non-critical chunks.
     static final int CHUNK_tRNS = 5;
     
-    static final byte[] TYPE_IHDR = {(byte) 'I', (byte) 'H', (byte) 'D', (byte) 'R'};
-    static final byte[] TYPE_PLTE = {(byte) 'P', (byte) 'L', (byte) 'T', (byte) 'E'};
-    static final byte[] TYPE_IDAT = {(byte) 'I', (byte) 'D', (byte) 'A', (byte) 'T'};
-    static final byte[] TYPE_IEND = {(byte) 'I', (byte) 'E', (byte) 'N', (byte) 'D'};
-    static final byte[] TYPE_tRNS = {(byte) 't', (byte) 'R', (byte) 'N', (byte) 'S'};
+    static final byte[] TYPE_IHDR = {cast(byte) 'I', cast(byte) 'H', cast(byte) 'D', cast(byte) 'R'};
+    static final byte[] TYPE_PLTE = {cast(byte) 'P', cast(byte) 'L', cast(byte) 'T', cast(byte) 'E'};
+    static final byte[] TYPE_IDAT = {cast(byte) 'I', cast(byte) 'D', cast(byte) 'A', cast(byte) 'T'};
+    static final byte[] TYPE_IEND = {cast(byte) 'I', cast(byte) 'E', cast(byte) 'N', cast(byte) 'D'};
+    static final byte[] TYPE_tRNS = {cast(byte) 't', cast(byte) 'R', cast(byte) 'N', cast(byte) 'S'};
     
     static final int[] CRC_TABLE;
     static {
@@ -108,8 +108,8 @@
  * array at the given offset.
  */ 
 void setInt16(int offset, int value) {
-    reference[offset] = (byte) ((value >> 8) & 0xFF);
-    reference[offset + 1] = (byte) (value & 0xFF);
+    reference[offset] = cast(byte) ((value >> 8) & 0xFF);
+    reference[offset + 1] = cast(byte) (value & 0xFF);
 }
 
 /**
@@ -130,10 +130,10 @@
  * array at the given offset.
  */ 
 void setInt32(int offset, int value) {
-    reference[offset] = (byte) ((value >> 24) & 0xFF);
-    reference[offset + 1] = (byte) ((value >> 16) & 0xFF);
-    reference[offset + 2] = (byte) ((value >> 8) & 0xFF);
-    reference[offset + 3] = (byte) (value & 0xFF);
+    reference[offset] = cast(byte) ((value >> 24) & 0xFF);
+    reference[offset + 1] = cast(byte) ((value >> 16) & 0xFF);
+    reference[offset + 2] = cast(byte) ((value >> 8) & 0xFF);
+    reference[offset + 3] = cast(byte) (value & 0xFF);
 }
 
 /**
@@ -273,7 +273,7 @@
 }
 
 bool isCritical() {
-    char c = (char) getTypeBytes()[0]; 
+    char c = cast(wchar) getTypeBytes()[0]; 
     return 'A' <= c && c <= 'Z';
 }
 
@@ -333,12 +333,12 @@
     byte[] type = getTypeBytes();
     
     // The third character MUST be upper case.
-    char c = (char) type[2];
+    char c = cast(wchar) type[2];
     if (!('A' <= c && c <= 'Z')) DWT.error(DWT.ERROR_INVALID_IMAGE);
     
     // All characters must be letters.
     for (int i = 0; i < TYPE_FIELD_LENGTH; i++) {
-        c = (char) type[i];
+        c = cast(wchar) type[i];
         if (!(('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'))) {
             DWT.error(DWT.ERROR_INVALID_IMAGE);
         }
@@ -368,7 +368,7 @@
     buffer.append("\n\tType: ");
     byte[] type = getTypeBytes();
     for(int i = 0; i < type.length; i++) {
-        buffer.append((char) type[i]);
+        buffer.append(cast(wchar) type[i]);
     }
     
     contributeToString(buffer);
--- a/dwt/internal/image/PngChunkReader.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PngChunkReader.d	Wed Aug 27 14:30:35 2008 +0200
@@ -30,7 +30,7 @@
         try { 
             PngChunk chunk = PngChunk.readNextFromStream(inputStream);
             if (chunk is null) DWT.error(DWT.ERROR_INVALID_IMAGE);
-            headerChunk = (PngIhdrChunk) chunk;
+            headerChunk = cast(PngIhdrChunk) chunk;
             headerChunk.validate(readState, null);
         } catch (ClassCastException e) {
             DWT.error(DWT.ERROR_INVALID_IMAGE);
@@ -46,11 +46,11 @@
     if (chunk is null) DWT.error(DWT.ERROR_INVALID_IMAGE);
     switch (chunk.getChunkType()) {
         case PngChunk.CHUNK_tRNS:
-            ((PngTrnsChunk) chunk).validate(readState, headerChunk, paletteChunk);
+            (cast(PngTrnsChunk) chunk).validate(readState, headerChunk, paletteChunk);
             break;
         case PngChunk.CHUNK_PLTE:
             chunk.validate(readState, headerChunk);
-            paletteChunk = (PngPlteChunk) chunk;
+            paletteChunk = cast(PngPlteChunk) chunk;
             break;
         default:
             chunk.validate(readState, headerChunk);
--- a/dwt/internal/image/PngDecodingDataStream.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PngDecodingDataStream.d	Wed Aug 27 14:30:35 2008 +0200
@@ -70,7 +70,7 @@
 }
 
 byte getNextIdatByte() { 
-    byte nextByte = (byte)stream.read();
+    byte nextByte = cast(byte)stream.read();
     nextBitIndex = MAX_BIT + 1;
     return nextByte;
 }
@@ -94,7 +94,7 @@
     for (int i = 0; i < len; i++) {
         int b = read();
         if (b is -1) return i;
-        buffer[off + i] = (byte)b;
+        buffer[off + i] = cast(byte)b;
     }
     return len;
 }
--- a/dwt/internal/image/PngDeflater.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PngDeflater.d	Wed Aug 27 14:30:35 2008 +0200
@@ -185,8 +185,8 @@
 
 void writeShortLSB(ByteArrayOutputStream baos, int theShort) {
 
-    byte byte1 = (byte) (theShort & 0xff);
-    byte byte2 = (byte) ((theShort >> 8) & 0xff);
+    byte byte1 = cast(byte) (theShort & 0xff);
+    byte byte2 = cast(byte) ((theShort >> 8) & 0xff);
     byte[] temp = {byte1, byte2};
     baos.write(temp, 0, 2);
 
@@ -194,10 +194,10 @@
 
 void writeInt(ByteArrayOutputStream baos, int theInt) {
 
-    byte byte1 = (byte) ((theInt >> 24) & 0xff);
-    byte byte2 = (byte) ((theInt >> 16) & 0xff);
-    byte byte3 = (byte) ((theInt >> 8) & 0xff);
-    byte byte4 = (byte) (theInt & 0xff);
+    byte byte1 = cast(byte) ((theInt >> 24) & 0xff);
+    byte byte2 = cast(byte) ((theInt >> 16) & 0xff);
+    byte byte3 = cast(byte) ((theInt >> 8) & 0xff);
+    byte byte4 = cast(byte) (theInt & 0xff);
     byte[] temp = {byte1, byte2, byte3, byte4};
     baos.write(temp, 0, 4);
 
@@ -229,8 +229,8 @@
     buffer |= value << bitCount;
     bitCount += count;
     if (bitCount >= 16) {
-        bytes.write((byte) buffer);
-        bytes.write((byte) (buffer >>> 8));
+        bytes.write(cast(byte) buffer);
+        bytes.write(cast(byte) (buffer >>> 8));
         buffer >>>= 16;
         bitCount -= 16;
     }
@@ -240,8 +240,8 @@
 void alignToByte() {
 
     if (bitCount > 0) {
-        bytes.write((byte) buffer);
-        if (bitCount > 8) bytes.write((byte) (buffer >>> 8));
+        bytes.write(cast(byte) buffer);
+        if (bitCount > 8) bytes.write(cast(byte) (buffer >>> 8));
     }
     buffer = 0;
     bitCount = 0;
@@ -574,7 +574,7 @@
         }
         
         // write data header
-        bytes.write((byte) BFINAL);
+        bytes.write(cast(byte) BFINAL);
         writeShortLSB(bytes, blockLength); // LEN
         writeShortLSB(bytes, blockLength ^ 0xffff); // NLEN (one's complement of LEN)
     
@@ -594,8 +594,8 @@
     inLength = input.length;
     
     // write zlib header
-    bytes.write((byte) 0x78); // window size = 0x70 (32768), compression method = 0x08
-    bytes.write((byte) 0x9C); // compression level = 0x80 (default), check bits = 0x1C
+    bytes.write(cast(byte) 0x78); // window size = 0x70 (32768), compression method = 0x08
+    bytes.write(cast(byte) 0x9C); // compression level = 0x80 (default), check bits = 0x1C
     
     // compute checksum
     for (int i = 0; i < inLength; i++) {
--- a/dwt/internal/image/PngEncoder.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PngEncoder.d	Wed Aug 27 14:30:35 2008 +0200
@@ -22,12 +22,12 @@
 
 final class PngEncoder : Object {
 
-    static final byte SIGNATURE[] = {(byte) '\211', (byte) 'P', (byte) 'N', (byte) 'G', (byte) '\r', (byte) '\n', (byte) '\032', (byte) '\n'};
-    static final byte TAG_IHDR[] = {(byte) 'I', (byte) 'H', (byte) 'D', (byte) 'R'};
-    static final byte TAG_PLTE[] = {(byte) 'P', (byte) 'L', (byte) 'T', (byte) 'E'};
-    static final byte TAG_TRNS[] = {(byte) 't', (byte) 'R', (byte) 'N', (byte) 'S'};
-    static final byte TAG_IDAT[] = {(byte) 'I', (byte) 'D', (byte) 'A', (byte) 'T'};
-    static final byte TAG_IEND[] = {(byte) 'I', (byte) 'E', (byte) 'N', (byte) 'D'};
+    static final byte SIGNATURE[] = {cast(byte) '\211', cast(byte) 'P', cast(byte) 'N', cast(byte) 'G', cast(byte) '\r', cast(byte) '\n', cast(byte) '\032', cast(byte) '\n'};
+    static final byte TAG_IHDR[] = {cast(byte) 'I', cast(byte) 'H', cast(byte) 'D', cast(byte) 'R'};
+    static final byte TAG_PLTE[] = {cast(byte) 'P', cast(byte) 'L', cast(byte) 'T', cast(byte) 'E'};
+    static final byte TAG_TRNS[] = {cast(byte) 't', cast(byte) 'R', cast(byte) 'N', cast(byte) 'S'};
+    static final byte TAG_IDAT[] = {cast(byte) 'I', cast(byte) 'D', cast(byte) 'A', cast(byte) 'T'};
+    static final byte TAG_IEND[] = {cast(byte) 'I', cast(byte) 'E', cast(byte) 'N', cast(byte) 'D'};
     
     ByteArrayOutputStream bytes = new ByteArrayOutputStream(1024);
     PngChunk chunk;
@@ -70,8 +70,8 @@
 
 void writeShort(ByteArrayOutputStream baos, int theShort) {
 
-    byte byte1 = (byte) ((theShort >> 8) & 0xff);
-    byte byte2 = (byte) (theShort & 0xff);
+    byte byte1 = cast(byte) ((theShort >> 8) & 0xff);
+    byte byte2 = cast(byte) (theShort & 0xff);
     byte[] temp = {byte1, byte2};
     baos.write(temp, 0, 2);
 
@@ -79,10 +79,10 @@
 
 void writeInt(ByteArrayOutputStream baos, int theInt) {
 
-    byte byte1 = (byte) ((theInt >> 24) & 0xff);
-    byte byte2 = (byte) ((theInt >> 16) & 0xff);
-    byte byte3 = (byte) ((theInt >> 8) & 0xff);
-    byte byte4 = (byte) (theInt & 0xff);
+    byte byte1 = cast(byte) ((theInt >> 24) & 0xff);
+    byte byte2 = cast(byte) ((theInt >> 16) & 0xff);
+    byte byte3 = cast(byte) ((theInt >> 8) & 0xff);
+    byte byte4 = cast(byte) (theInt & 0xff);
     byte[] temp = {byte1, byte2, byte3, byte4};
     baos.write(temp, 0, 4);
 
@@ -140,9 +140,9 @@
     
     for (int i = 0; i < RGBs.length; i++) {
     
-        baos.write((byte) RGBs[i].red);
-        baos.write((byte) RGBs[i].green);
-        baos.write((byte) RGBs[i].blue);
+        baos.write(cast(byte) RGBs[i].red);
+        baos.write(cast(byte) RGBs[i].green);
+        baos.write(cast(byte) RGBs[i].blue);
     
     }
     
@@ -169,7 +169,7 @@
                     pixelValue = data.getPixel(x, y);
                     alphaValue = data.getAlpha(x, y);
                     
-                    alphas[pixelValue] = (byte) alphaValue;
+                    alphas[pixelValue] = cast(byte) alphaValue;
                 
                 }
             
@@ -211,11 +211,11 @@
                 
                 for (int i = 0; i < pixel; i++) {
                 
-                    padding[i] = (byte) 255;
+                    padding[i] = cast(byte) 255;
                 
                 }
                 
-                padding[pixel] = (byte) 0;
+                padding[pixel] = cast(byte) 0;
                 
                 baos.write(padding, 0, padding.length);
             
--- a/dwt/internal/image/PngLzBlockReader.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PngLzBlockReader.d	Wed Aug 27 14:30:35 2008 +0200
@@ -66,7 +66,7 @@
 
 void readNextBlockHeader() {
     isLastBlock = stream.getNextIdatBit() !is 0;
-    compressionType = (byte)(stream.getNextIdatBits(2) & 0xFF);
+    compressionType = cast(byte)(stream.getNextIdatBits(2) & 0xFF);
     if (compressionType > 2) stream.error();    
     
     if (compressionType is UNCOMPRESSED) {
@@ -136,10 +136,10 @@
     
     int value = huffmanTables.getNextLiteralValue(stream);
     if (value < END_OF_COMPRESSED_BLOCK) {
-        window[windowIndex] = (byte) (value & 0xFF);
+        window[windowIndex] = cast(byte) (value & 0xFF);
         windowIndex++;
         if (windowIndex >= window.length) windowIndex = 0;
-        return (byte) (value & 0xFF);       
+        return cast(byte) (value & 0xFF);       
     } else if (value is END_OF_COMPRESSED_BLOCK) {
         readNextBlockHeader();
         return getNextByte();
--- a/dwt/internal/image/PngPlteChunk.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PngPlteChunk.d	Wed Aug 27 14:30:35 2008 +0200
@@ -71,9 +71,9 @@
     RGB[] rgbs = palette.getRGBs();
     for (int i = 0; i < rgbs.length; i++) {
         int offset = DATA_OFFSET + (i * 3);
-        reference[offset] = (byte) rgbs[i].red;
-        reference[offset + 1] = (byte) rgbs[i].green;
-        reference[offset + 2] = (byte) rgbs[i].blue;
+        reference[offset] = cast(byte) rgbs[i].red;
+        reference[offset + 1] = cast(byte) rgbs[i].green;
+        reference[offset + 2] = cast(byte) rgbs[i].blue;
     }
 }
 
--- a/dwt/internal/image/PngTrnsChunk.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/PngTrnsChunk.d	Wed Aug 27 14:30:35 2008 +0200
@@ -40,11 +40,11 @@
     bool valid;
     switch (header.getColorType()) {
         case PngIhdrChunk.COLOR_TYPE_RGB:
-            // Three 2-byte values (RGB)
+            // Three 2-byte values cast(RGB)
             valid = getLength() is 6;
             break;
         case PngIhdrChunk.COLOR_TYPE_PALETTE:
-            // Three 2-byte values (RGB)
+            // Three 2-byte values cast(RGB)
             valid = getLength() <= paletteChunk.getLength();
             break;
         case PngIhdrChunk.COLOR_TYPE_GRAYSCALE:
@@ -147,7 +147,7 @@
      * alpha of 255.
      */
     for (int j = i; j < alphas.length; j++) {
-        alphas[j] = (byte) 255;
+        alphas[j] = cast(byte) 255;
     }
     return alphas;
 }
--- a/dwt/internal/image/TIFFModifiedHuffmanCodec.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/TIFFModifiedHuffmanCodec.d	Wed Aug 27 14:30:35 2008 +0200
@@ -192,8 +192,8 @@
     int n = cnt;
     while (bitOffsetDest > 0 && bitOffsetDest <= 7 && n > 0) {
         dest[byteOffsetDest] = value is 1 ?
-            (byte)(dest[byteOffsetDest] | (1 << (7 - bitOffsetDest))) :
-            (byte)(dest[byteOffsetDest] & ~(1 << (7 - bitOffsetDest)));
+            cast(byte)(dest[byteOffsetDest] | (1 << (7 - bitOffsetDest))) :
+            cast(byte)(dest[byteOffsetDest] & ~(1 << (7 - bitOffsetDest)));
         n--;
         bitOffsetDest++; 
     }
@@ -202,13 +202,13 @@
         bitOffsetDest = 0;
     }
     while (n >= 8) {
-        dest[byteOffsetDest++] = (byte) (value is 1 ? 0xFF : 0);
+        dest[byteOffsetDest++] = cast(byte) (value is 1 ? 0xFF : 0);
         n -= 8;
     }
     while (n > 0) {
         dest[byteOffsetDest] = value is 1 ?
-            (byte)(dest[byteOffsetDest] | (1 << (7 - bitOffsetDest))) :
-            (byte)(dest[byteOffsetDest] & ~(1 << (7 - bitOffsetDest)));
+            cast(byte)(dest[byteOffsetDest] | (1 << (7 - bitOffsetDest))) :
+            cast(byte)(dest[byteOffsetDest] & ~(1 << (7 - bitOffsetDest)));
         n--;
         bitOffsetDest++;        
     }   
--- a/dwt/internal/image/WinBMPFileFormat.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/WinBMPFileFormat.d	Wed Aug 27 14:30:35 2008 +0200
@@ -72,7 +72,7 @@
                 break;
             default:
                 dest[dp] = 0; dp++;
-                dest[dp] = (byte)(n + n); dp++; /* n bytes = n*2 pixels */
+                dest[dp] = cast(byte)(n + n); dp++; /* n bytes = n*2 pixels */
                 for (i = n; i > 0; i--) {
                     dest[dp] = src[sp];
                     dp++; sp++;
@@ -95,7 +95,7 @@
                 if (src[sp + n] !is theByte)
                     break;
             }
-            dest[dp] = (byte)(n + n); dp++; /* n bytes = n*2 pixels */
+            dest[dp] = cast(byte)(n + n); dp++; /* n bytes = n*2 pixels */
             dest[dp] = theByte; dp++;
             sp += n;
             size += 2;
@@ -147,7 +147,7 @@
                 break;
             default:
                 dest[dp] = 0; dp++;
-                dest[dp] = (byte)n; dp++;
+                dest[dp] = cast(byte)n; dp++;
                 for (i = n; i > 0; i--) {
                     dest[dp] = src[sp];
                     dp++; sp++;
@@ -170,7 +170,7 @@
                 if (src[sp + n] !is theByte)
                     break;
             }
-            dest[dp] = (byte)n; dp++;
+            dest[dp] = cast(byte)n; dp++;
             dest[dp] = theByte; dp++;
             sp += n;
             size += 2;
@@ -497,9 +497,9 @@
     int offset = 0;
     for (int i = 0; i < n; i++) {
         RGB col = pal.colors[i];
-        bytes[offset] = (byte)col.blue;
-        bytes[offset + 1] = (byte)col.green;
-        bytes[offset + 2] = (byte)col.red;
+        bytes[offset] = cast(byte)col.blue;
+        bytes[offset + 1] = cast(byte)col.green;
+        bytes[offset + 2] = cast(byte)col.red;
         offset += 4;
     }
     return bytes;
@@ -653,7 +653,7 @@
         outputStream.writeInt(image.width);
         outputStream.writeInt(image.height);
         outputStream.writeShort(1);
-        outputStream.writeShort((short)image.depth);
+        outputStream.writeShort(cast(short)image.depth);
         outputStream.writeInt(comp);
         outputStream.writeInt(data.length);
         outputStream.writeInt(pelsPerMeter.x);
--- a/dwt/internal/image/WinICOFileFormat.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/image/WinICOFileFormat.d	Wed Aug 27 14:30:35 2008 +0200
@@ -23,7 +23,7 @@
 byte[] bitInvertData(byte[] data, int startIndex, int endIndex) {
     // Destructively bit invert data in the given byte array.
     for (int i = startIndex; i < endIndex; i++) {
-        data[i] = (byte)(255 - data[i - startIndex]);
+        data[i] = cast(byte)(255 - data[i - startIndex]);
     }
     return data;
 }
@@ -208,10 +208,10 @@
     if (!((width is infoWidth) && (height * 2 is infoHeight) &&
         (bitCount is 1 || bitCount is 4 || bitCount is 8 || bitCount is 24 || bitCount is 32)))
             DWT.error(DWT.ERROR_INVALID_IMAGE);
-    infoHeader[8] = (byte)(height & 0xFF);
-    infoHeader[9] = (byte)((height >> 8) & 0xFF);
-    infoHeader[10] = (byte)((height >> 16) & 0xFF);
-    infoHeader[11] = (byte)((height >> 24) & 0xFF);
+    infoHeader[8] = cast(byte)(height & 0xFF);
+    infoHeader[9] = cast(byte)((height >> 8) & 0xFF);
+    infoHeader[10] = cast(byte)((height >> 16) & 0xFF);
+    infoHeader[11] = cast(byte)((height >> 24) & 0xFF);
     return infoHeader;
 }
 /**
@@ -225,7 +225,7 @@
         outputStream.writeInt(icon.width);
         outputStream.writeInt(icon.height * 2);
         outputStream.writeShort(1);
-        outputStream.writeShort((short)icon.depth);
+        outputStream.writeShort(cast(short)icon.depth);
         outputStream.writeInt(0);
         outputStream.writeInt(sizeImage);
         outputStream.writeInt(0);
--- a/dwt/internal/objc/appkit/NSAttributedString.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/objc/appkit/NSAttributedString.d	Wed Aug 27 14:30:35 2008 +0200
@@ -11,7 +11,7 @@
 
 template NSAttributedString ()
 {
-    extern (C):
+    extern cast(C):
         
     id* NSBackgroundColorAttributeName;
     id* NSBaselineOffsetAttributeName;
--- a/dwt/internal/objc/appkit/bindings.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/objc/appkit/bindings.d	Wed Aug 27 14:30:35 2008 +0200
@@ -7,7 +7,7 @@
  */
 module dwt.internal.objc.appkit.bindings;
 
-extern (C):
+extern cast(C):
     
 /*void *NSDeviceRGBColorSpace();
 void *NSAccessibilityPositionAttribute ();
--- a/dwt/internal/objc/bindings.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/objc/bindings.d	Wed Aug 27 14:30:35 2008 +0200
@@ -10,7 +10,7 @@
 import dwt.internal.c.qd.QuickdrawTypes : BOOL;
 import dwt.internal.objc.runtime;
 
-extern (C):
+extern cast(C):
 
 BOOL class_addIvar (Class cls, /*const*/char* name, size_t size, byte alignment, /*const*/char* types);
 BOOL class_addMethod (Class cls, SEL name, IMP imp, /*const*/char* types);
@@ -26,7 +26,7 @@
 void objc_msgSend_stret(void* stretAddr, id theReceiver, SEL theSelector, ...);
 id objc_msgSendSuper (objc_super* superr, SEL op, ...);
 
-version (X86)
+version cast(X86)
     double objc_msgSend_fpret(id self, SEL op, ...);
 
 version (build)
--- a/dwt/internal/objc/foundation/bindings.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/objc/foundation/bindings.d	Wed Aug 27 14:30:35 2008 +0200
@@ -7,7 +7,7 @@
  */
 module dwt.internal.objc.foundation.bindings;
 
-extern (C):
+extern cast(C):
     
 //void* NSDefaultRunLoopMode ();
 void* NSFileTypeForHFSTypeCode (int hfsFileTypeCode);
--- a/dwt/internal/objc/runtime.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/internal/objc/runtime.d	Wed Aug 27 14:30:35 2008 +0200
@@ -25,7 +25,7 @@
 alias objc_class* Class;
 alias objc_object* id;
 
-alias extern (C) id function(id, SEL, ...) IMP;
+alias extern cast(C) id function(id, SEL, ...) IMP;
 
 struct objc_object
 {
@@ -58,7 +58,7 @@
     char* ivar_type;
     int ivar_offset;
 
-    version (X86_64)
+    version cast(X86_64)
         int space;
 }
 
@@ -66,7 +66,7 @@
 {
     int ivar_count;
 
-    version (X86_64)
+    version cast(X86_64)
         int space;
 
     /* variable length structure */
@@ -86,7 +86,7 @@
 
     int method_count;
 
-    version (X86_64)
+    version cast(X86_64)
         int space;
 
     /* variable length structure */
@@ -178,10 +178,10 @@
     return dwt.internal.objc.bindings.objc_msgSendSuper(superr, op.ptr, args);
 }
 
-version (X86)
+version cast(X86)
 {
     double objc_msgSend_fpret(ARGS...)(id self, string op, ARGS args)
     {
         return dwt.internal.objc.bindings.objc_msgSend_fpret(self, op.ptr, args);
     }
-}
\ No newline at end of file
+}
--- a/dwt/layout/FillLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/layout/FillLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -144,7 +144,7 @@
 }
 
 Point computeChildSize (Control control, int wHint, int hHint, bool flushCache) {
-    FillData data = (FillData)control.getLayoutData ();
+    FillData data = cast(FillData)control.getLayoutData ();
     if (data is null) {
         data = new FillData ();
         control.setLayoutData (data);
@@ -156,7 +156,7 @@
         // TEMPORARY CODE
         int trimX, trimY;
         if (control instanceof Scrollable) {
-            Rectangle rect = ((Scrollable) control).computeTrim (0, 0, 0, 0);
+            Rectangle rect = (cast(Scrollable) control).computeTrim (0, 0, 0, 0);
             trimX = rect.width;
             trimY = rect.height;
         } else {
@@ -171,7 +171,7 @@
 
 protected bool flushCache (Control control) {
     Object data = control.getLayoutData();
-    if (data !is null) ((FillData)data).flushCache();
+    if (data !is null) (cast(FillData)data).flushCache();
     return true;
 }
 
--- a/dwt/layout/FormData.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/layout/FormData.d	Wed Aug 27 14:30:35 2008 +0200
@@ -172,7 +172,7 @@
     }
     if (bottomControl is null) return cacheBottom = bottom;
     isVisited = true;
-    FormData bottomData = (FormData) bottomControl.getLayoutData ();
+    FormData bottomData = cast(FormData) bottomControl.getLayoutData ();
     FormAttachment bottomAttachment = bottomData.getBottomAttachment (bottomControl, spacing, flushCache);
     switch (bottom.alignment) {
         case DWT.BOTTOM: 
@@ -213,7 +213,7 @@
     }
     if (leftControl is null) return cacheLeft = left;
     isVisited = true;
-    FormData leftData = (FormData) leftControl.getLayoutData ();
+    FormData leftData = cast(FormData) leftControl.getLayoutData ();
     FormAttachment leftAttachment = leftData.getLeftAttachment (leftControl, spacing, flushCache);
     switch (left.alignment) {
         case DWT.LEFT:
@@ -260,7 +260,7 @@
     }
     if (rightControl is null) return cacheRight = right;
     isVisited = true;
-    FormData rightData = (FormData) rightControl.getLayoutData ();
+    FormData rightData = cast(FormData) rightControl.getLayoutData ();
     FormAttachment rightAttachment = rightData.getRightAttachment (rightControl, spacing, flushCache);
     switch (right.alignment) {
         case DWT.RIGHT: 
@@ -301,7 +301,7 @@
     }
     if (topControl is null) return cacheTop = top;
     isVisited = true;
-    FormData topData = (FormData) topControl.getLayoutData ();
+    FormData topData = cast(FormData) topControl.getLayoutData ();
     FormAttachment topAttachment = topData.getTopAttachment (topControl, spacing, flushCache);
     switch (top.alignment) {
         case DWT.TOP:
--- a/dwt/layout/FormLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/layout/FormLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -169,18 +169,18 @@
  * Computes the preferred height of the form with
  * respect to the preferred height of the control.
  * 
- * Given that the equations for top (T) and bottom (B)
- * of the control in terms of the height of the form (X)
+ * Given that the equations for top cast(T) and bottom cast(B)
+ * of the control in terms of the height of the form cast(X)
  * are:
  *      T = AX + B
  *      B = CX + D
  * 
- * The equation for the height of the control (H)
- * is bottom (B) minus top (T) or (H = B - T) or:
+ * The equation for the height of the control cast(H)
+ * is bottom cast(B) minus top cast(T) or (H = B - T) or:
  * 
  *      H = (CX + D) - (AX + B)
  * 
- * Solving for (X), the height of the form, we get:
+ * Solving for cast(X), the height of the form, we get:
  * 
  *      X = (H + B - D) / (C - A)
  * 
@@ -188,7 +188,7 @@
  * solution for X.  This is a special case meaning that
  * the control does not constrain the height of the
  * form.  In this case, we need to arbitrarily define
- * the height of the form (X):
+ * the height of the form cast(X):
  * 
  * Case 1: A = C, A = 0, C = 0
  *
@@ -250,7 +250,7 @@
 
 protected bool flushCache (Control control) {
     Object data = control.getLayoutData ();
-    if (data !is null) ((FormData) data).flushCache ();
+    if (data !is null) (cast(FormData) data).flushCache ();
     return true;
 }
 
@@ -294,7 +294,7 @@
     Control [] children = composite.getChildren ();
     for (int i=0; i<children.length; i++) {
         Control child = children [i];
-        FormData data = (FormData) child.getLayoutData ();
+        FormData data = cast(FormData) child.getLayoutData ();
         if (data is null) child.setLayoutData (data = new FormData ());
         if (flushCache) data.flushCache ();
         data.cacheLeft = data.cacheRight = data.cacheTop = data.cacheBottom = null;
@@ -304,7 +304,7 @@
     int w = 0, h = 0;
     for (int i=0; i<children.length; i++) {
         Control child = children [i];
-        FormData data = (FormData) child.getLayoutData ();
+        FormData data = cast(FormData) child.getLayoutData ();
         if (width !is DWT.DEFAULT) {
             data.needed = false;
             FormAttachment left = data.getLeftAttachment (child, spacing, flushCache);
@@ -314,7 +314,7 @@
                 int trim = 0;
                 //TEMPORARY CODE
                 if (child instanceof Scrollable) {
-                    Rectangle rect = ((Scrollable) child).computeTrim (0, 0, 0, 0);
+                    Rectangle rect = (cast(Scrollable) child).computeTrim (0, 0, 0, 0);
                     trim = rect.width;
                 } else {
                     trim = child.getBorderWidth () * 2;
@@ -338,7 +338,7 @@
     }
     for (int i=0; i<children.length; i++) {
         Control child = children [i];
-        FormData data = (FormData) child.getLayoutData ();
+        FormData data = cast(FormData) child.getLayoutData ();
         if (height !is DWT.DEFAULT) {
             int y1 = data.getTopAttachment (child, spacing, flushCache).solveX (height);
             int y2 = data.getBottomAttachment (child, spacing, flushCache).solveX (height);
@@ -353,7 +353,7 @@
     }
     for (int i=0; i<children.length; i++) {
         Control child = children [i];
-        FormData data = (FormData) child.getLayoutData ();
+        FormData data = cast(FormData) child.getLayoutData ();
         if (flush !is null && flush [i]) data.cacheWidth = data.cacheHeight = -1;
         data.cacheLeft = data.cacheRight = data.cacheTop = data.cacheBottom = null;
     }
--- a/dwt/layout/GridLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/layout/GridLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -170,14 +170,14 @@
 
 protected bool flushCache (Control control) {
     Object data = control.getLayoutData ();
-    if (data !is null) ((GridData) data).flushCache ();
+    if (data !is null) (cast(GridData) data).flushCache ();
     return true;
 }
 
 GridData getData (Control [][] grid, int row, int column, int rowCount, int columnCount, bool first) {
     Control control = grid [row] [column];
     if (control !is null) {
-        GridData data = (GridData) control.getLayoutData ();
+        GridData data = cast(GridData) control.getLayoutData ();
         int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
         int vSpan = Math.max (1, data.verticalSpan);
         int i = first ? row + vSpan - 1 : row - vSpan + 1;
@@ -204,7 +204,7 @@
     int count = 0;
     for (int i=0; i<children.length; i++) {
         Control control = children [i];
-        GridData data = (GridData) control.getLayoutData ();
+        GridData data = cast(GridData) control.getLayoutData ();
         if (data is null || !data.exclude) {
             children [count++] = children [i];
         } 
@@ -214,7 +214,7 @@
     }
     for (int i=0; i<count; i++) {
         Control child = children [i];
-        GridData data = (GridData) child.getLayoutData ();
+        GridData data = cast(GridData) child.getLayoutData ();
         if (data is null) child.setLayoutData (data = new GridData ());
         if (flushCache) data.flushCache ();
         data.computeSize (child, data.widthHint, data.heightHint, flushCache);
@@ -223,7 +223,7 @@
                 int trim = 0;
                 //TEMPORARY CODE
                 if (child instanceof Scrollable) {
-                    Rectangle rect = ((Scrollable) child).computeTrim (0, 0, 0, 0);
+                    Rectangle rect = (cast(Scrollable) child).computeTrim (0, 0, 0, 0);
                     trim = rect.width;
                 } else {
                     trim = child.getBorderWidth () * 2;
@@ -242,7 +242,7 @@
     Control [][] grid = new Control [4] [columnCount];
     for (int i=0; i<count; i++) {   
         Control child = children [i];
-        GridData data = (GridData) child.getLayoutData ();
+        GridData data = cast(GridData) child.getLayoutData ();
         int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
         int vSpan = Math.max (1, data.verticalSpan);
         while (true) {
@@ -472,7 +472,7 @@
                         if ((currentWidth !is data.cacheWidth && data.horizontalAlignment is DWT.FILL) || (data.cacheWidth > currentWidth)) {
                             int trim = 0;
                             if (child instanceof Scrollable) {
-                                Rectangle rect = ((Scrollable) child).computeTrim (0, 0, 0, 0);
+                                Rectangle rect = (cast(Scrollable) child).computeTrim (0, 0, 0, 0);
                                 trim = rect.width;
                             } else {
                                 trim = child.getBorderWidth () * 2;
--- a/dwt/layout/RowLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/layout/RowLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -214,7 +214,7 @@
 
 Point computeSize (Control control, bool flushCache) {
     int wHint = DWT.DEFAULT, hHint = DWT.DEFAULT;
-    RowData data = (RowData) control.getLayoutData ();
+    RowData data = cast(RowData) control.getLayoutData ();
     if (data !is null) {
         wHint = data.width;
         hHint = data.height;
@@ -247,7 +247,7 @@
     int count = 0;
     for (int i=0; i<children.length; i++) {
         Control control = children [i];
-        RowData data = (RowData) control.getLayoutData ();
+        RowData data = cast(RowData) control.getLayoutData ();
         if (data is null || !data.exclude) {
             children [count++] = children [i];
         } 
@@ -366,7 +366,7 @@
     int count = 0;
     for (int i=0; i<children.length; i++) {
         Control control = children [i];
-        RowData data = (RowData) control.getLayoutData ();
+        RowData data = cast(RowData) control.getLayoutData ();
         if (data is null || !data.exclude) {
             children [count++] = children [i];
         } 
--- a/dwt/opengl/GLCanvas.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/opengl/GLCanvas.d	Wed Aug 27 14:30:35 2008 +0200
@@ -105,14 +105,14 @@
         attrib [pos++] = data.samples;
     }
     attrib [pos++] = 0;
-    pixelFormat = (NSOpenGLPixelFormat)new NSOpenGLPixelFormat().alloc();
+    pixelFormat = cast(NSOpenGLPixelFormat)new NSOpenGLPixelFormat().alloc();
     if (pixelFormat is null) {      
         dispose ();
         DWT.error (DWT.ERROR_UNSUPPORTED_DEPTH);
     }
     pixelFormat.initWithAttributes(attrib);
     
-    glView = (NSOpenGLView)new NSOpenGLView().alloc();
+    glView = cast(NSOpenGLView)new NSOpenGLView().alloc();
     if (glView is null) {       
         dispose ();
         DWT.error (DWT.ERROR_UNSUPPORTED_DEPTH);
--- a/dwt/printing/PrintDialog.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/printing/PrintDialog.d	Wed Aug 27 14:30:35 2008 +0200
@@ -126,7 +126,7 @@
  */
 public PrinterData open() {
     NSPrintPanel panel = NSPrintPanel.printPanel();
-    NSPrintInfo printInfo =(NSPrintInfo)new NSPrintInfo().alloc();
+    NSPrintInfo printInfo =cast(NSPrintInfo)new NSPrintInfo().alloc();
     printInfo.initWithDictionary(null);
     panel.runModalWithPrintInfo(printInfo);
     printInfo.release();
@@ -139,7 +139,7 @@
 //          if (OS.PMCreatePageFormat(buffer) is OS.noErr) {
 //              int pageFormat = buffer[0];
 //              OS.PMSessionDefaultPageFormat(printSession, pageFormat);
-//              OS.PMSessionSetDestination(printSession, printSettings, (short) (printToFile ? OS.kPMDestinationFile : OS.kPMDestinationPrinter), 0, 0);
+//              OS.PMSessionSetDestination(printSession, printSettings, cast(short) (printToFile ? OS.kPMDestinationFile : OS.kPMDestinationPrinter), 0, 0);
 //              if (scope is PrinterData.PAGE_RANGE) {
 //                  OS.PMSetFirstPage(printSettings, startPage, false);
 //                  OS.PMSetLastPage(printSettings, endPage, false);
--- a/dwt/printing/Printer.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/printing/Printer.d	Wed Aug 27 14:30:35 2008 +0200
@@ -91,10 +91,10 @@
 }
 //static int packData(int handle, byte[] buffer, int offset) {
 //  int length = OS.GetHandleSize (handle);
-//  buffer[offset++] = (byte)((length & 0xFF) >> 0);
-//  buffer[offset++] = (byte)((length & 0xFF00) >> 8);
-//  buffer[offset++] = (byte)((length & 0xFF0000) >> 16);
-//  buffer[offset++] = (byte)((length & 0xFF000000) >> 24);
+//  buffer[offset++] = cast(byte)((length & 0xFF) >> 0);
+//  buffer[offset++] = cast(byte)((length & 0xFF00) >> 8);
+//  buffer[offset++] = cast(byte)((length & 0xFF0000) >> 16);
+//  buffer[offset++] = cast(byte)((length & 0xFF000000) >> 24);
 //  int [] ptr = new int [1];
 //  OS.HLock(handle);
 //  OS.memmove(ptr, handle, 4);
@@ -197,7 +197,7 @@
 //  PMRect paperRect = new PMRect();
 //  OS.PMGetAdjustedPageRect(pageFormat, pageRect);
 //  OS.PMGetAdjustedPaperRect(pageFormat, paperRect);
-//  return new Rectangle(x+(int)paperRect.left, y+(int)paperRect.top, width+(int)(paperRect.right-pageRect.right), height+(int)(paperRect.bottom-pageRect.bottom));
+//  return new Rectangle(x+cast(int)paperRect.left, y+cast(int)paperRect.top, width+cast(int)(paperRect.right-pageRect.right), height+cast(int)(paperRect.bottom-pageRect.bottom));
     return null;
 }
 
@@ -208,7 +208,7 @@
  * @param deviceData the device data
  */
 protected void create(DeviceData deviceData) {
-    data = (PrinterData)deviceData;
+    data = cast(PrinterData)deviceData;
     
     printer = NSPrinter.static_printerWithName_(NSString.stringWith(data.name));
     printer.retain();
@@ -247,7 +247,7 @@
 //  }
 //  
 //  if (PREVIEW_DRIVER.equals(data.driver)) {
-//      OS.PMSessionSetDestination(printSession, printSettings, (short) OS.kPMDestinationPreview, 0, 0);
+//      OS.PMSessionSetDestination(printSession, printSettings, cast(short) OS.kPMDestinationPreview, 0, 0);
 //  }
 //  String name = data.name;
 //  char[] buffer1 = new char[name.length ()];
@@ -304,10 +304,10 @@
 //      PMRect paperRect= new PMRect();
 //      OS.PMGetAdjustedPaperRect(pageFormat, paperRect);
 //      Rect portRect = new Rect();
-//      portRect.left = (short)paperRect.left;
-//      portRect.right = (short)paperRect.right;
-//      portRect.top = (short)paperRect.top;
-//      portRect.bottom = (short)paperRect.bottom;
+//      portRect.left = cast(short)paperRect.left;
+//      portRect.right = cast(short)paperRect.right;
+//      portRect.top = cast(short)paperRect.top;
+//      portRect.bottom = cast(short)paperRect.bottom;
 //      data.portRect = portRect;
 //      isGCCreated = true;
 //  }
@@ -491,7 +491,7 @@
     checkDevice();
 //  PMResolution resolution = new PMResolution();
 //  OS.PMGetResolution(pageFormat, resolution);
-//  return new Point((int)resolution.hRes, (int)resolution.vRes);
+//  return new Point(cast(int)resolution.hRes, cast(int)resolution.vRes);
     return null;
 }
 
@@ -512,7 +512,7 @@
     checkDevice();
 //  PMRect paperRect = new PMRect();
 //  OS.PMGetAdjustedPaperRect(pageFormat, paperRect);
-//  return new Rectangle(0, 0, (int)(paperRect.right-paperRect.left), (int)(paperRect.bottom-paperRect.top));
+//  return new Rectangle(0, 0, cast(int)(paperRect.right-paperRect.left), cast(int)(paperRect.bottom-paperRect.top));
     return null;
 }
 
@@ -535,7 +535,7 @@
     checkDevice();
 //  PMRect pageRect = new PMRect();
 //  OS.PMGetAdjustedPageRect(pageFormat, pageRect);
-//  return new Rectangle(0, 0, (int)(pageRect.right-pageRect.left), (int)(pageRect.bottom-pageRect.top));
+//  return new Rectangle(0, 0, cast(int)(pageRect.right-pageRect.left), cast(int)(pageRect.bottom-pageRect.top));
     return null;
 }
 
@@ -600,7 +600,7 @@
 //      PMRect paperRect= new PMRect();
 //      OS.PMGetAdjustedPaperRect(pageFormat, paperRect);
 //      OS.CGContextScaleCTM(context, 1, -1);
-//      OS.CGContextTranslateCTM(context, 0, -(float)(paperRect.bottom-paperRect.top));
+//      OS.CGContextTranslateCTM(context, 0, -cast(float)(paperRect.bottom-paperRect.top));
 //      OS.CGContextSetStrokeColorSpace(context, colorspace);
 //      OS.CGContextSetFillColorSpace(context, colorspace);
 //  }
--- a/dwt/program/Program.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/program/Program.d	Wed Aug 27 14:30:35 2008 +0200
@@ -335,7 +335,7 @@
 //  Program[] programs = new Program[bundles.size()];
 //  Enumeration values = bundles.elements();
 //  while (values.hasMoreElements()) {
-//      programs[count++] = (Program)values.nextElement();
+//      programs[count++] = cast(Program)values.nextElement();
 //  }
 //  return programs;
 }
@@ -518,7 +518,7 @@
 public bool equals(Object other) {
     if (this is other) return true;
     if (other instanceof Program) {
-        final Program program = (Program) other;
+        final Program program = cast(Program) other;
         return name.equals(program.name);
     }
     return false;
--- a/dwt/widgets/Button.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Button.d	Wed Aug 27 14:30:35 2008 +0200
@@ -166,7 +166,7 @@
     } else {
         alignment = OS.NSRightTextAlignment;
     }
-    NSMutableParagraphStyle pStyle = (NSMutableParagraphStyle)new NSMutableParagraphStyle().alloc().init();
+    NSMutableParagraphStyle pStyle = cast(NSMutableParagraphStyle)new NSMutableParagraphStyle().alloc().init();
     pStyle.autorelease();
     pStyle.setAlignment(alignment);
     dict.setObject(pStyle, OS.NSParagraphStyleAttributeName());
@@ -174,13 +174,13 @@
     text.getChars (0, chars.length, chars, 0);
     int length = fixMnemonic (chars);
     NSString str = NSString.stringWithCharacters(chars, length);
-    NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+    NSAttributedString attribStr = (cast(NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
     attribStr.autorelease();
     return attribStr;
 }
 
 void createHandle () {
-    NSButton widget = (NSButton)new SWTButton().alloc();
+    NSButton widget = cast(NSButton)new SWTButton().alloc();
     widget.initWithFrame(new NSRect());
     int type = OS.NSMomentaryPushButton;
     if ((style & DWT.PUSH) !is 0) {
@@ -283,8 +283,8 @@
 public bool getSelection () {
     checkWidget ();
     if ((style & (DWT.CHECK | DWT.RADIO | DWT.TOGGLE)) is 0) return false;
-    if ((style & DWT.CHECK) !is 0 && grayed) return ((NSButton)view).state() is OS.NSMixedState;
-    return ((NSButton)view).state() is OS.NSOnState;
+    if ((style & DWT.CHECK) !is 0 && grayed) return (cast(NSButton)view).state() is OS.NSMixedState;
+    return (cast(NSButton)view).state() is OS.NSOnState;
 }
 
 /**
@@ -367,11 +367,11 @@
         }
     }
     if ((style & DWT.CHECK) !is 0) {
-        if (grayed && ((NSButton)view).state() is OS.NSOnState) {
-            ((NSButton)view).setState(OS.NSOffState);
+        if (grayed && (cast(NSButton)view).state() is OS.NSOnState) {
+            (cast(NSButton)view).setState(OS.NSOffState);
         }
-        if (!grayed && ((NSButton)view).state() is OS.NSMixedState) {
-            ((NSButton)view).setState(OS.NSOnState);
+        if (!grayed && (cast(NSButton)view).state() is OS.NSMixedState) {
+            (cast(NSButton)view).setState(OS.NSOnState);
         }
     }
     postEvent (DWT.Selection);
@@ -417,7 +417,7 @@
     style |= alignment & (DWT.LEFT | DWT.RIGHT | DWT.CENTER);
     /* text is still null when this is called from createHandle() */
     if (text !is null) {
-        ((NSButton)view).setAttributedTitle(createString());
+        (cast(NSButton)view).setAttributedTitle(createString());
     }
 //  /* Alignment not honoured when image and text is visible */
 //  bool bothVisible = text !is null && text.length () > 0 && image !is null;
@@ -439,10 +439,10 @@
 //      textAlignment = OS.kControlBevelButtonAlignTextFlushRight;
 //      graphicAlignment = OS.kControlBevelButtonAlignRight;
 //  }
-//  OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonTextAlignTag, 2, new short [] {(short)textAlignment});
-//  OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonGraphicAlignTag, 2, new short [] {(short)graphicAlignment});
+//  OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonTextAlignTag, 2, new short [] {cast(short)textAlignment});
+//  OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonGraphicAlignTag, 2, new short [] {cast(short)graphicAlignment});
 //  if (bothVisible) {
-//      OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonTextPlaceTag, 2, new short [] {(short)OS.kControlBevelButtonPlaceToRightOfGraphic});
+//      OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonTextPlaceTag, 2, new short [] {cast(short)OS.kControlBevelButtonPlaceToRightOfGraphic});
 //  }
 }
 
@@ -453,7 +453,7 @@
     } else {
         nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1);
     }
-    NSButtonCell cell = new NSButtonCell(((NSButton)view).cell());
+    NSButtonCell cell = new NSButtonCell((cast(NSButton)view).cell());
     cell.setBackgroundColor(nsColor);
 }
 
@@ -464,7 +464,7 @@
 }
 
 void setForeground (float [] color) {
-    ((NSButton)view).setAttributedTitle(createString());
+    (cast(NSButton)view).setAttributedTitle(createString());
 }
 
 public void setGrayed(bool grayed) {
@@ -474,9 +474,9 @@
     this.grayed = grayed;
     if (checked) {
         if (grayed) {
-            ((NSButton) view).setState (OS.NSMixedState);
+            (cast(NSButton) view).setState (OS.NSMixedState);
         } else {
-            ((NSButton) view).setState (OS.NSOnState);
+            (cast(NSButton) view).setState (OS.NSOnState);
         }
     }
 }
@@ -507,7 +507,7 @@
         error (DWT.ERROR_INVALID_ARGUMENT);
     }
     this.image = image;
-    ((NSButton)view).setImage(image.handle);
+    (cast(NSButton)view).setImage(image.handle);
 }
 
 bool setRadioSelection (bool value){
@@ -539,9 +539,9 @@
     checkWidget();
     if ((style & (DWT.CHECK | DWT.RADIO | DWT.TOGGLE)) is 0) return;
     if (grayed) {
-        ((NSButton)view).setState (selected ? OS.NSMixedState : OS.NSOffState);
+        (cast(NSButton)view).setState (selected ? OS.NSMixedState : OS.NSOffState);
     } else {
-        ((NSButton)view).setState (selected ? OS.NSOnState : OS.NSOffState);
+        (cast(NSButton)view).setState (selected ? OS.NSOnState : OS.NSOffState);
     }
 }
 
@@ -581,7 +581,7 @@
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     if ((style & DWT.ARROW) !is 0) return;
     text = string;
-    ((NSButton)view).setAttributedTitle(createString());
+    (cast(NSButton)view).setAttributedTitle(createString());
 }
 
 int traversalCode (int key, NSEvent theEvent) {
--- a/dwt/widgets/Caret.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Caret.d	Wed Aug 27 14:30:35 2008 +0200
@@ -103,8 +103,8 @@
     if (nWidth <= 0) nWidth = DEFAULT_WIDTH;
     if (image !is null) {
         NSSize size = image.handle.size();
-        nWidth = (int)size.width;
-        nHeight = (int)size.height;
+        nWidth = cast(int)size.width;
+        nHeight = cast(int)size.height;
     }
     NSRect rect = new NSRect();
     rect.x = x;
--- a/dwt/widgets/ColorDialog.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/ColorDialog.d	Wed Aug 27 14:30:35 2008 +0200
@@ -129,7 +129,7 @@
         NSColor color = NSColor.colorWithDeviceRed(rgb.red / 255f, rgb.green / 255f, rgb.blue / 255f, 1);
         panel.setColor(color);
     }
-    SWTPanelDelegate delegate = (SWTPanelDelegate)new SWTPanelDelegate().alloc().init();
+    SWTPanelDelegate delegate = cast(SWTPanelDelegate)new SWTPanelDelegate().alloc().init();
     int jniRef = OS.NewGlobalRef(this);
     if (jniRef is 0) DWT.error(DWT.ERROR_NO_HANDLES);
     delegate.setTag(jniRef);
@@ -143,7 +143,7 @@
     NSColor color = panel.color();
     if (color !is null) {
         color = color.colorUsingColorSpaceName_(NSString.stringWith("NSCalibratedRGBColorSpace"));
-        rgb = new RGB((int)(color.redComponent() * 255), (int)(color.greenComponent() * 255), (int)(color.blueComponent() * 255));
+        rgb = new RGB(cast(int)(color.redComponent() * 255), cast(int)(color.greenComponent() * 255), cast(int)(color.blueComponent() * 255));
     }
     return rgb;
 }
--- a/dwt/widgets/Combo.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Combo.d	Wed Aug 27 14:30:35 2008 +0200
@@ -143,13 +143,13 @@
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     NSString str = NSString.stringWith(string);
     if ((style & DWT.READ_ONLY) !is 0) {
-        NSMenu nsMenu = ((NSPopUpButton)view).menu();
-        NSMenuItem nsItem = (NSMenuItem)new NSMenuItem().alloc();
+        NSMenu nsMenu = (cast(NSPopUpButton)view).menu();
+        NSMenuItem nsItem = cast(NSMenuItem)new NSMenuItem().alloc();
         nsItem.initWithTitle(str, 0, NSString.stringWith(""));
         nsMenu.addItem(nsItem);
         nsItem.release();
     } else {
-        ((NSComboBox)view).addItemWithObjectValue(str);
+        (cast(NSComboBox)view).addItemWithObjectValue(str);
     }
 }
 
@@ -183,13 +183,13 @@
     if (0 > index || index > count) error (DWT.ERROR_INVALID_RANGE);
     NSString str = NSString.stringWith(string);
     if ((style & DWT.READ_ONLY) !is 0) {
-        NSMenu nsMenu = ((NSPopUpButton)view).menu();
-        NSMenuItem nsItem = (NSMenuItem)new NSMenuItem().alloc();
+        NSMenu nsMenu = (cast(NSPopUpButton)view).menu();
+        NSMenuItem nsItem = cast(NSMenuItem)new NSMenuItem().alloc();
         nsItem.initWithTitle(str, 0, NSString.stringWith(""));
         nsMenu.insertItem(nsItem, index);
         nsItem.release();
     } else {
-        ((NSComboBox)view).insertItemWithObjectValue(str, index);
+        (cast(NSComboBox)view).insertItemWithObjectValue(str, index);
     }
 }
 
@@ -344,13 +344,13 @@
 public Point computeSize (int wHint, int hHint, bool changed) {
     checkWidget ();
     int width = 0, height = 0;
-    NSControl widget = (NSControl)view;
+    NSControl widget = cast(NSControl)view;
     NSRect oldRect = widget.frame();
     widget.sizeToFit();
     NSRect newRect = widget.frame();
     widget.setFrame (oldRect);
-    width = (int)newRect.width;
-    height = (int)newRect.height;
+    width = cast(int)newRect.width;
+    height = cast(int)newRect.height;
     if (wHint !is DWT.DEFAULT) width = wHint;
     if (hHint !is DWT.DEFAULT) height = hHint;
     return new Point (width, height);
@@ -378,7 +378,7 @@
 
 void createHandle () {
     if ((style & DWT.READ_ONLY) !is 0) {
-        NSPopUpButton widget = (NSPopUpButton)new SWTPopUpButton().alloc();
+        NSPopUpButton widget = cast(NSPopUpButton)new SWTPopUpButton().alloc();
         widget.initWithFrame(new NSRect(), false);
         widget.menu().setAutoenablesItems(false);
         widget.setTarget(widget);
@@ -387,7 +387,7 @@
         view = widget;
         parent.view.addSubview_(widget);
     } else {
-        NSComboBox widget = (NSComboBox)new SWTComboBox().alloc();
+        NSComboBox widget = cast(NSComboBox)new SWTComboBox().alloc();
         widget.initWithFrame(new NSRect());
         widget.setTag(jniRef);
         widget.setDelegate(widget);
@@ -459,10 +459,10 @@
     if (index is -1) return;
     if (index is getSelectionIndex ()) {
         if ((style & DWT.READ_ONLY) !is 0) {
-            ((NSPopUpButton)view).selectItem(null);
+            (cast(NSPopUpButton)view).selectItem(null);
             sendEvent (DWT.Modify);
         } else {
-            ((NSComboBox)view).deselectItemAtIndex(index);
+            (cast(NSComboBox)view).deselectItemAtIndex(index);
         }
     }
 }
@@ -484,7 +484,7 @@
 public void deselectAll () {
     checkWidget ();
     if ((style & DWT.READ_ONLY) !is 0) {
-        ((NSPopUpButton)view).selectItem(null);
+        (cast(NSPopUpButton)view).selectItem(null);
         sendEvent (DWT.Modify);
     } else {
         setText ("");
@@ -494,9 +494,9 @@
 int getCharCount() {
     NSString str;
     if ((style & DWT.READ_ONLY) !is 0) {
-        str = ((NSPopUpButton)view).titleOfSelectedItem();
+        str = (cast(NSPopUpButton)view).titleOfSelectedItem();
     } else {
-        str = new NSCell(((NSComboBox)view).cell()).title();
+        str = new NSCell((cast(NSComboBox)view).cell()).title();
     }
     return str.length();
 }
@@ -523,9 +523,9 @@
     if (0 > index || index >= count) error (DWT.ERROR_INVALID_RANGE);
     NSString str;
     if ((style & DWT.READ_ONLY) !is 0) {
-        str = ((NSPopUpButton)view).itemTitleAtIndex(index);
+        str = (cast(NSPopUpButton)view).itemTitleAtIndex(index);
     } else {
-        str = new NSString(((NSComboBox)view).itemObjectValueAtIndex(index));
+        str = new NSString((cast(NSComboBox)view).itemObjectValueAtIndex(index));
     }
     if (str is null) error(DWT.ERROR_CANNOT_GET_ITEM);
     char[] buffer = new char[str.length()];
@@ -546,9 +546,9 @@
 public int getItemCount () {
     checkWidget ();
     if ((style & DWT.READ_ONLY) !is 0) {
-        return ((NSPopUpButton)view).numberOfItems();
+        return (cast(NSPopUpButton)view).numberOfItems();
     } else {
-        return ((NSComboBox)view).numberOfItems();
+        return (cast(NSComboBox)view).numberOfItems();
     }
 }
 
@@ -643,7 +643,7 @@
 //          selection = this.selection;
 //      } else {
 //          selection = new ControlEditTextSelectionRec ();
-//          OS.GetControlData (handle, (short) OS.kHIComboBoxEditTextPart, OS.kControlEditTextSelectionTag, 4, selection, null);
+//          OS.GetControlData (handle, cast(short) OS.kHIComboBoxEditTextPart, OS.kControlEditTextSelectionTag, 4, selection, null);
 //      }
 //      return new Point (selection.selStart, selection.selEnd);
         return null;
@@ -664,9 +664,9 @@
 public int getSelectionIndex () {
     checkWidget ();
     if ((style & DWT.READ_ONLY) !is 0) {
-        return ((NSPopUpButton)view).indexOfSelectedItem();
+        return (cast(NSPopUpButton)view).indexOfSelectedItem();
     } else {
-        return ((NSComboBox)view).indexOfSelectedItem();
+        return (cast(NSComboBox)view).indexOfSelectedItem();
     }
 }
 
@@ -690,9 +690,9 @@
 String getText (int start, int end) {
     NSString str;
     if ((style & DWT.READ_ONLY) !is 0) {
-        str = ((NSPopUpButton)view).titleOfSelectedItem();
+        str = (cast(NSPopUpButton)view).titleOfSelectedItem();
     } else {
-        str = new NSCell(((NSComboBox)view).cell()).title();
+        str = new NSCell((cast(NSComboBox)view).cell()).title();
     }
     if (str is null) return "";
     int length = str.length();
@@ -763,7 +763,7 @@
     if ((style & DWT.READ_ONLY) !is 0) {
         return getItemCount ();
     } else {
-        return ((NSComboBox)view).numberOfVisibleItems();
+        return (cast(NSComboBox)view).numberOfVisibleItems();
     }
 }
     
@@ -879,9 +879,9 @@
     int count = getItemCount ();
     if (0 > index || index >= count) error (DWT.ERROR_INVALID_RANGE);
     if ((style & DWT.READ_ONLY) !is 0) {
-        ((NSPopUpButton)view).removeItemAtIndex(index);
+        (cast(NSPopUpButton)view).removeItemAtIndex(index);
     } else {
-        ((NSComboBox)view).removeItemAtIndex(index);
+        (cast(NSComboBox)view).removeItemAtIndex(index);
     }
 }
 
@@ -950,10 +950,10 @@
 public void removeAll () {
     checkWidget ();
     if ((style & DWT.READ_ONLY) !is 0) {
-        ((NSPopUpButton)view).removeAllItems();
+        (cast(NSPopUpButton)view).removeAllItems();
     } else {
         setText ("", true);
-        ((NSComboBox)view).removeAllItems();
+        (cast(NSComboBox)view).removeAllItems();
     }
 }
 
@@ -1049,10 +1049,10 @@
     int count = getItemCount ();
     if (0 <= index && index < count) {
         if ((style & DWT.READ_ONLY) !is 0) {
-            ((NSPopUpButton)view).selectItemAtIndex(index);
+            (cast(NSPopUpButton)view).selectItemAtIndex(index);
             sendEvent (DWT.Modify);
         } else {
-            ((NSComboBox)view).selectItemAtIndex(index);
+            (cast(NSComboBox)view).selectItemAtIndex(index);
         }
     }   
 }
@@ -1124,7 +1124,7 @@
     } else {
         nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1);
     }
-    ((NSTextField)view).setBackgroundColor(nsColor);
+    (cast(NSTextField)view).setBackgroundColor(nsColor);
 }
 
 void setForeground (float [] color) {
@@ -1134,7 +1134,7 @@
     } else {
         nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1);
     }
-    ((NSTextField)view).setTextColor(nsColor);
+    (cast(NSTextField)view).setTextColor(nsColor);
 }
 
 /**
@@ -1160,10 +1160,10 @@
     if (0 > index || index >= count) error (DWT.ERROR_INVALID_RANGE);
     NSString str = NSString.stringWith(string);
     if ((style & DWT.READ_ONLY) !is 0) {
-        NSMenuItem nsItem = ((NSPopUpButton)view).itemAtIndex(index);
+        NSMenuItem nsItem = (cast(NSPopUpButton)view).itemAtIndex(index);
         nsItem.setTitle(str);
     } else {
-        NSComboBox widget = (NSComboBox)view;
+        NSComboBox widget = cast(NSComboBox)view;
         widget.insertItemWithObjectValue(str, index);
         widget.removeItemAtIndex(index + 1);
     }
@@ -1194,13 +1194,13 @@
     for (int i= 0; i < items.length; i++) {
         NSString str = NSString.stringWith(items[i]);
         if ((style & DWT.READ_ONLY) !is 0) {
-            NSMenu nsMenu = ((NSPopUpButton)view).menu();
-            NSMenuItem nsItem = (NSMenuItem)new NSMenuItem().alloc();
+            NSMenu nsMenu = (cast(NSPopUpButton)view).menu();
+            NSMenuItem nsItem = cast(NSMenuItem)new NSMenuItem().alloc();
             nsItem.initWithTitle(str, 0, NSString.stringWith(""));
             nsMenu.addItem(nsItem);
             nsItem.release();
         } else {
-            ((NSComboBox)view).addItemWithObjectValue(str);
+            (cast(NSComboBox)view).addItemWithObjectValue(str);
         }
     }
 }
@@ -1208,7 +1208,7 @@
 /*public*/ void setListVisible (bool visible) {
     checkWidget ();
     if ((style & DWT.READ_ONLY) !is 0) {
-        ((NSPopUpButton)view).setPullsDown(visible);
+        (cast(NSPopUpButton)view).setPullsDown(visible);
     } else {
     }
 }
@@ -1254,8 +1254,8 @@
 //      int length = getCharCount ();
 //      int start = selection.x, end = selection.y;
 //      ControlEditTextSelectionRec sel = new ControlEditTextSelectionRec ();
-//      sel.selStart = (short) Math.min (Math.max (Math.min (start, end), 0), length);
-//      sel.selEnd = (short) Math.min (Math.max (Math.max (start, end), 0), length);
+//      sel.selStart = cast(short) Math.min (Math.max (Math.min (start, end), 0), length);
+//      sel.selEnd = cast(short) Math.min (Math.max (Math.max (start, end), 0), length);
 //      if (hasFocus ()) {
 //          OS.SetControlData (handle, OS.kHIComboBoxEditTextPart, OS.kControlEditTextSelectionTag, 4, sel);
 //      } else {
@@ -1305,7 +1305,7 @@
             if (notify) sendEvent (DWT.Modify);
         }
     } else {
-        new NSCell(((NSComboBox)view).cell()).setTitle(NSString.stringWith(string));
+        new NSCell((cast(NSComboBox)view).cell()).setTitle(NSString.stringWith(string));
         if (notify) sendEvent (DWT.Modify);
     }
 }
@@ -1359,7 +1359,7 @@
     if ((style & DWT.READ_ONLY) !is 0) {
         //TODO 
     } else {
-        ((NSComboBox)view).setNumberOfVisibleItems(count);
+        (cast(NSComboBox)view).setNumberOfVisibleItems(count);
     }
 }
 
--- a/dwt/widgets/Composite.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Composite.d	Wed Aug 27 14:30:35 2008 +0200
@@ -109,7 +109,7 @@
             Object widget = OS.JNIGetObject(tag);
             if (widget !is null && widget !is this) {
                 if (widget instanceof Control) {
-                    children [j++] = (Control) widget;
+                    children [j++] = cast(Control) widget;
                 }
             }
         }
@@ -248,7 +248,7 @@
     state |= CANVAS;
     NSRect rect = new NSRect();
     if ((style & (DWT.V_SCROLL | DWT.H_SCROLL)) !is 0 || hasBorder ()) {
-        SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+        SWTScrollView scrollWidget = cast(SWTScrollView)new SWTScrollView().alloc();
         scrollWidget.initWithFrame (rect);
         scrollWidget.setDrawsBackground(false);
         if ((style & DWT.H_SCROLL) !is 0) scrollWidget.setHasHorizontalScroller(true);
@@ -258,7 +258,7 @@
         scrollView = scrollWidget;
         rect.width = rect.height = 100000;
     }
-    SWTView widget = (SWTView)new SWTView().alloc();
+    SWTView widget = cast(SWTView)new SWTView().alloc();
     widget.initWithFrame (rect);
 //  widget.setFocusRingType(OS.NSFocusRingTypeExterior);
     widget.setTag(jniRef);
--- a/dwt/widgets/Control.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Control.d	Wed Aug 27 14:30:35 2008 +0200
@@ -602,10 +602,10 @@
 //  return new Point (width, height);
     if (topView() instanceof NSControl) {
         NSRect oldRect = topView().frame();
-        ((NSControl)topView()).sizeToFit();
+        (cast(NSControl)topView()).sizeToFit();
         NSRect newRect = topView().frame();
         topView().setFrame (oldRect);
-        return new Point ((int)newRect.width, (int)newRect.height);
+        return new Point (cast(int)newRect.width, cast(int)newRect.height);
     }
     return new Point (width, height);
 }
@@ -656,7 +656,7 @@
 Font defaultFont () {
     //TODO - Controls only, does this leak?
     if (view instanceof NSControl) {
-        NSFont nsFont = ((NSControl)view).font ();
+        NSFont nsFont = (cast(NSControl)view).font ();
         if (nsFont !is null) {
             return Font.cocoa_new (display, nsFont);
         }
@@ -769,14 +769,14 @@
 //  int window = OS.GetControlOwner (handle);
 //  CGPoint pt = new CGPoint ();
 //  OS.HIViewConvertPoint (pt, handle, 0);
-//  x += (int) pt.x;
-//  y += (int) pt.y;
-//  OS.GetWindowBounds (window, (short) OS.kWindowStructureRgn, rect);
+//  x += cast(int) pt.x;
+//  y += cast(int) pt.y;
+//  OS.GetWindowBounds (window, cast(short) OS.kWindowStructureRgn, rect);
 //  x += rect.left;
 //  y += rect.top;
 //  dwt.internal.carbon.Point pt1 = new dwt.internal.carbon.Point ();
-//  pt1.h = (short) x;
-//  pt1.v = (short) y;
+//  pt1.h = cast(short) x;
+//  pt1.v = cast(short) y;
 //  return OS.WaitMouseMoved (pt1);
     return false;
 }
@@ -795,10 +795,10 @@
     GC gc = GC.cocoa_new (this, data);
     Event event = new Event ();
     event.gc = gc;
-    event.x = (int)rect.x;
-    event.y = (int)rect.y;
-    event.width = (int)rect.width;
-    event.height = (int)rect.height;
+    event.x = cast(int)rect.x;
+    event.y = cast(int)rect.y;
+    event.width = cast(int)rect.width;
+    event.height = cast(int)rect.height;
     sendEvent (DWT.Paint, event);
     event.gc = null;
     gc.dispose ();
@@ -807,7 +807,7 @@
 void enableWidget (bool enabled) {
     //TODO - other views
     if (view instanceof NSControl) {
-        ((NSControl)view).setEnabled(enabled);
+        (cast(NSControl)view).setEnabled(enabled);
     }
 }
 
@@ -965,7 +965,7 @@
 public Rectangle getBounds () {
     checkWidget();
     NSRect rect = topView().frame();
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
@@ -1090,7 +1090,7 @@
 public Point getLocation () {
     checkWidget();
     NSRect rect = topView().frame();
-    return new Point((int)rect.x, (int)rect.y);
+    return new Point(cast(int)rect.x, cast(int)rect.y);
 }
 
 /**
@@ -1231,7 +1231,7 @@
 public Point getSize () {
     checkWidget();
     NSRect rect = topView().frame();
-    return new Point((int)rect.width, (int)rect.height);
+    return new Point(cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
@@ -1464,9 +1464,9 @@
 int menuForEvent (int nsEvent) {
     NSPoint pt = NSEvent.mouseLocation();   
     NSWindow window = view.window();
-    pt.y = (int) (window.screen().frame().height - pt.y);
-    int x = (int) pt.x;
-    int y = (int) pt.y;
+    pt.y = cast(int) (window.screen().frame().height - pt.y);
+    int x = cast(int) pt.x;
+    int y = cast(int) pt.y;
     Event event = new Event ();
     event.x = x;
     event.y = y;
@@ -1547,8 +1547,8 @@
     event.count = nsEvent.clickCount();
     NSPoint location = nsEvent.locationInWindow();
     NSPoint point = view.convertPoint_fromView_(location, null);
-    event.x = (int) point.x;
-    event.y = (int) point.y;
+    event.x = cast(int) point.x;
+    event.y = cast(int) point.y;
     setInputState (event, nsEvent, type);
     sendEvent (type, event);
 }
@@ -1587,7 +1587,7 @@
         if (keyCode !is 0) {
             event.keyCode = keyCode;
         } else {
-            event.character = (char) keys.characterAtIndex (i);
+            event.character = cast(wchar) keys.characterAtIndex (i);
             //TODO - get unshifted values for Shift+1
             event.keyCode = keyCodes.characterAtIndex (i);
         }
@@ -2201,15 +2201,15 @@
 //  CGPoint pt = new CGPoint ();
 //  OS.GetEventParameter (theEvent, OS.kEventParamWindowMouseLocation, OS.typeHIPoint, null, CGPoint.sizeof, null, pt);
 //  OS.HIViewConvertPoint (pt, 0, handle);
-//  int x = (int) pt.x;
-//  int y = (int) pt.y;
+//  int x = cast(int) pt.x;
+//  int y = cast(int) pt.y;
 //  display.lastX = x;
 //  display.lastY = y;
 //  int [] chord = new int [1];
 //  OS.GetEventParameter (theEvent, OS.kEventParamMouseChord, OS.typeUInt32, null, 4, null, chord);
 //  int [] modifiers = new int [1];
 //  OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
-//  return sendMouseEvent (type, button, count, detail, send, chord [0], (short) x, (short) y, modifiers [0]);
+//  return sendMouseEvent (type, button, count, detail, send, chord [0], cast(short) x, cast(short) y, modifiers [0]);
     return false;
 }
 
@@ -2313,11 +2313,11 @@
 
 void setBackground (int control, float [] color) {
 //  ControlFontStyleRec fontStyle = new ControlFontStyleRec ();
-//  OS.GetControlData (control, (short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
+//  OS.GetControlData (control, cast(short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
 //  if (color !is null) {
-//      fontStyle.backColor_red = (short) (color [0] * 0xffff);
-//      fontStyle.backColor_green = (short) (color [1] * 0xffff);
-//      fontStyle.backColor_blue = (short) (color [2] * 0xffff);
+//      fontStyle.backColor_red = cast(short) (color [0] * 0xffff);
+//      fontStyle.backColor_green = cast(short) (color [1] * 0xffff);
+//      fontStyle.backColor_blue = cast(short) (color [2] * 0xffff);
 //      fontStyle.flags |= OS.kControlUseBackColorMask;
 //  } else {
 //      fontStyle.flags &= ~OS.kControlUseBackColorMask;
@@ -2567,7 +2567,7 @@
 void setFont (NSFont font) {
     //TODO - bad cast
     if (view instanceof NSControl) {
-        ((NSControl)view).setFont(font);
+        (cast(NSControl)view).setFont(font);
     }
 }
 
@@ -2604,11 +2604,11 @@
 
 void setForeground (int control, float [] color) {
 //  ControlFontStyleRec fontStyle = new ControlFontStyleRec ();
-//  OS.GetControlData (control, (short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
+//  OS.GetControlData (control, cast(short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
 //  if (color !is null) {
-//      fontStyle.foreColor_red = (short) (color [0] * 0xffff);
-//      fontStyle.foreColor_green = (short) (color [1] * 0xffff);
-//      fontStyle.foreColor_blue = (short) (color [2] * 0xffff);
+//      fontStyle.foreColor_red = cast(short) (color [0] * 0xffff);
+//      fontStyle.foreColor_green = cast(short) (color [1] * 0xffff);
+//      fontStyle.foreColor_blue = cast(short) (color [2] * 0xffff);
 //      fontStyle.flags |= OS.kControlUseForeColorMask;
 //  } else {
 //      fontStyle.flags &= ~OS.kControlUseForeColorMask;
--- a/dwt/widgets/DateTime.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/DateTime.d	Wed Aug 27 14:30:35 2008 +0200
@@ -137,13 +137,13 @@
 public Point computeSize (int wHint, int hHint, bool changed) {
     checkWidget ();
     int width = 0, height = 0;
-    NSControl widget = (NSControl)view;
+    NSControl widget = cast(NSControl)view;
     NSRect oldRect = widget.frame();
     widget.sizeToFit();
     NSRect newRect = widget.frame();
     widget.setFrame (oldRect);
-    width = (int)newRect.width;
-    height = (int)newRect.height;
+    width = cast(int)newRect.width;
+    height = cast(int)newRect.height;
     if (width is 0) width = DEFAULT_WIDTH;
     if (height is 0) height = DEFAULT_HEIGHT;
     if (wHint !is DWT.DEFAULT) width = wHint;
@@ -154,7 +154,7 @@
 }
 
 void createHandle () {
-    NSDatePicker widget = (NSDatePicker)new SWTDatePicker().alloc();
+    NSDatePicker widget = cast(NSDatePicker)new SWTDatePicker().alloc();
     widget.initWithFrame(new NSRect());
     int pickerStyle = OS.NSTextFieldAndStepperDatePickerStyle;
     int elementFlags = 0;
@@ -196,7 +196,7 @@
  */
 public int getDay () {
     checkWidget ();
-    NSDate date = ((NSDatePicker)view).dateValue();
+    NSDate date = (cast(NSDatePicker)view).dateValue();
     NSCalendarDate calendarDate = date.dateWithCalendarFormat(null, null);
     return calendarDate.dayOfMonth();
 }
@@ -216,7 +216,7 @@
  */
 public int getHours () {
     checkWidget ();
-    return new NSCalendarDate(((NSDatePicker)view).dateValue().id).hourOfDay();
+    return new NSCalendarDate((cast(NSDatePicker)view).dateValue().id).hourOfDay();
 }
 
 /**
@@ -234,7 +234,7 @@
  */
 public int getMinutes () {
     checkWidget ();
-    return new NSCalendarDate(((NSDatePicker)view).dateValue().id).minuteOfHour();
+    return new NSCalendarDate((cast(NSDatePicker)view).dateValue().id).minuteOfHour();
 }
 
 /**
@@ -252,7 +252,7 @@
  */
 public int getMonth () {
     checkWidget ();
-    return new NSCalendarDate(((NSDatePicker)view).dateValue().id).monthOfYear() - 1;
+    return new NSCalendarDate((cast(NSDatePicker)view).dateValue().id).monthOfYear() - 1;
 }
 
 String getNameText() {
@@ -275,7 +275,7 @@
  */
 public int getSeconds () {
     checkWidget ();
-    return new NSCalendarDate(((NSDatePicker)view).dateValue().id).secondOfMinute();
+    return new NSCalendarDate((cast(NSDatePicker)view).dateValue().id).secondOfMinute();
 }
 
 /**
@@ -293,7 +293,7 @@
  */
 public int getYear () {
     checkWidget ();
-    return new NSCalendarDate(((NSDatePicker)view).dateValue().id).yearOfCommonEra();
+    return new NSCalendarDate((cast(NSDatePicker)view).dateValue().id).yearOfCommonEra();
 }
 
 /**
@@ -332,7 +332,7 @@
     } else {
         nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1);
     }
-    ((NSDatePicker)view).setBackgroundColor(nsColor);
+    (cast(NSDatePicker)view).setBackgroundColor(nsColor);
 }
 
 /**
@@ -355,11 +355,11 @@
  */
 public void setDate (int year, int month, int day) {
     checkWidget ();
-    NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+    NSCalendarDate date = new NSCalendarDate((cast(NSDatePicker)view).dateValue().id);
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(year, month + 1, day,
             date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     if (newDate.yearOfCommonEra() is year && newDate.monthOfYear() is month + 1 && newDate.dayOfMonth() is day) {
-        ((NSDatePicker)view).setDateValue(newDate);
+        (cast(NSDatePicker)view).setDateValue(newDate);
     }
 }
 
@@ -378,11 +378,11 @@
  */
 public void setDay (int day) {
     checkWidget ();
-    NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+    NSCalendarDate date = new NSCalendarDate((cast(NSDatePicker)view).dateValue().id);
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), day,
             date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     if (newDate.yearOfCommonEra() is date.yearOfCommonEra() && newDate.monthOfYear() is date.monthOfYear() && newDate.dayOfMonth() is day) {
-        ((NSDatePicker)view).setDateValue(newDate);
+        (cast(NSDatePicker)view).setDateValue(newDate);
     }
 }
 
@@ -393,7 +393,7 @@
     } else {
         nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1);
     }
-    ((NSDatePicker)view).setTextColor(nsColor);
+    (cast(NSDatePicker)view).setTextColor(nsColor);
 }
 
 /**
@@ -412,10 +412,10 @@
 public void setHours (int hours) {
     checkWidget ();
     if (hours < 0 || hours > 23) return;
-    NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+    NSCalendarDate date = new NSCalendarDate((cast(NSDatePicker)view).dateValue().id);
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
             hours, date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
-    ((NSDatePicker)view).setDateValue(newDate);
+    (cast(NSDatePicker)view).setDateValue(newDate);
 }
 
 /**
@@ -434,10 +434,10 @@
 public void setMinutes (int minutes) {
     checkWidget ();
     if (minutes < 0 || minutes > 59) return;
-    NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+    NSCalendarDate date = new NSCalendarDate((cast(NSDatePicker)view).dateValue().id);
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
             date.hourOfDay(), minutes, date.secondOfMinute(), date.timeZone());
-    ((NSDatePicker)view).setDateValue(newDate);
+    (cast(NSDatePicker)view).setDateValue(newDate);
 }
 
 /**
@@ -455,11 +455,11 @@
  */
 public void setMonth (int month) {
     checkWidget ();
-    NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+    NSCalendarDate date = new NSCalendarDate((cast(NSDatePicker)view).dateValue().id);
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), month + 1, date.dayOfMonth(),
             date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     if (newDate.yearOfCommonEra() is date.yearOfCommonEra() && newDate.monthOfYear() is month + 1 && newDate.dayOfMonth() is date.dayOfMonth()) {
-        ((NSDatePicker)view).setDateValue(newDate);
+        (cast(NSDatePicker)view).setDateValue(newDate);
     }
 }
 
@@ -479,10 +479,10 @@
 public void setSeconds (int seconds) {
     checkWidget ();
     if (seconds < 0 || seconds > 59) return;
-    NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+    NSCalendarDate date = new NSCalendarDate((cast(NSDatePicker)view).dateValue().id);
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
             date.hourOfDay(), date.minuteOfHour(), seconds, date.timeZone());
-    ((NSDatePicker)view).setDateValue(newDate);
+    (cast(NSDatePicker)view).setDateValue(newDate);
 }
 
 /**
@@ -502,10 +502,10 @@
 public void setTime (int hours, int minutes, int seconds) {
     checkWidget ();
     if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || seconds > 59) return;
-    NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+    NSCalendarDate date = new NSCalendarDate((cast(NSDatePicker)view).dateValue().id);
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
             hours, minutes, seconds, date.timeZone());
-    ((NSDatePicker)view).setDateValue(newDate);
+    (cast(NSDatePicker)view).setDateValue(newDate);
 }
 
 /**
@@ -523,11 +523,11 @@
  */
 public void setYear (int year) {
     checkWidget ();
-    NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+    NSCalendarDate date = new NSCalendarDate((cast(NSDatePicker)view).dateValue().id);
     NSCalendarDate newDate = NSCalendarDate.dateWithYear(year, date.monthOfYear(), date.dayOfMonth(),
             date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
     if (newDate.yearOfCommonEra() is year && newDate.monthOfYear() is date.monthOfYear() && newDate.dayOfMonth() is date.dayOfMonth()) {
-        ((NSDatePicker)view).setDateValue(newDate);
+        (cast(NSDatePicker)view).setDateValue(newDate);
     }
 }
 }
--- a/dwt/widgets/Display.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Display.d	Wed Aug 27 14:30:35 2008 +0200
@@ -267,7 +267,7 @@
     /* Timer */
     Runnable timerList [];
     NSTimer nsTimers [];
-    SWTWindowDelegate timerDelegate = (SWTWindowDelegate)new SWTWindowDelegate().alloc().init();
+    SWTWindowDelegate timerDelegate = cast(SWTWindowDelegate)new SWTWindowDelegate().alloc().init();
     SWTApplicationDelegate applicationDelegate;
     
     /* Display Data */
@@ -305,7 +305,7 @@
     name.getChars (0, length, chars, 0);
     byte [] buffer = new byte [length + 1];
     for (int i=0; i<length; i++) {
-        buffer [i] = (byte) chars [i];
+        buffer [i] = cast(byte) chars [i];
     }
     return buffer;
 }
@@ -402,13 +402,13 @@
 //  if (menus is null) menus = new Menu [12];
 //  for (int i=0; i<menus.length; i++) {
 //      if (menus [i] is null) {
-//          menu.id = (short)(ID_START + i);
+//          menu.id = cast(short)(ID_START + i);
 //          menus [i] = menu;
 //          return;
 //      }
 //  }
 //  Menu [] newMenus = new Menu [menus.length + 12];
-//  menu.id = (short)(ID_START + menus.length);
+//  menu.id = cast(short)(ID_START + menus.length);
 //  newMenus [menus.length] = menu;
 //  System.arraycopy (menus, 0, newMenus, 0, menus.length);
 //  menus = newMenus;
@@ -563,7 +563,7 @@
         String s = text.substring (i, j);
         result.append (s);
         i = j + 2;
-        result.append (Lf);
+        result.append cast(Lf);
     }
     return result.toString ();
 }
@@ -647,10 +647,10 @@
 //                  range.length = chars.length;
 //                  int encoding = OS.CFStringGetSystemEncoding ();
 //                  int [] size = new int [1];
-//                  int numChars = OS.CFStringGetBytes (cfstring, range, encoding, (byte) '?', true, null, 0, size);
+//                  int numChars = OS.CFStringGetBytes (cfstring, range, encoding, cast(byte) '?', true, null, 0, size);
 //                  if (numChars !is 0) {
 //                      buffer = new byte [size [0] + 1];
-//                      numChars = OS.CFStringGetBytes (cfstring, range, encoding, (byte) '?', true, buffer, size [0], size);
+//                      numChars = OS.CFStringGetBytes (cfstring, range, encoding, cast(byte) '?', true, buffer, size [0], size);
 //                  }
 //                  OS.CFRelease (cfstring);
 //              }
@@ -669,7 +669,7 @@
 //      }
     }
     
-    pool = (NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
+    pool = cast(NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
     application = NSApplication.sharedApplication();
 }
 
@@ -770,7 +770,7 @@
         if (tag !is -1) {
             Object object = OS.JNIGetObject(tag);
             if (object instanceof Widget) {
-                return (Widget)object;
+                return cast(Widget)object;
             }
         }
     }
@@ -870,7 +870,7 @@
             if (tag !is -1) {
                 Object object = OS.JNIGetObject(tag);
                 if (object instanceof Shell) {
-                    return (Shell)object;
+                    return cast(Shell)object;
                 }
             }
         }
@@ -960,7 +960,7 @@
     NSPoint location = NSEvent.mouseLocation();
     //TODO bad for other screens
     NSRect rect = NSScreen.mainScreen().frame();
-    return new Point ((int) location.x, (int) (rect.height - location.y));
+    return new Point (cast(int) location.x, cast(int) (rect.height - location.y));
 }
 
 /**
@@ -1121,7 +1121,7 @@
                 Object object = OS.JNIGetObject(tag);
                 if (object instanceof Control) {
                     //TODO go up hierarchy
-                    return (Control)object;
+                    return cast(Control)object;
                 }
             } else {
                 /*
@@ -1139,7 +1139,7 @@
                                 if (tag !is 0 && tag !is -1) {
                                     Object object = OS.JNIGetObject(tag);
                                     if (object instanceof Control) {
-                                        return (Control)object;
+                                        return cast(Control)object;
                                     }
                                 }
                             }
@@ -1218,8 +1218,8 @@
     * This code is intentionally commented.  Event time is
     * in seconds and we need an accurate time in milliseconds.
     */
-//  return (int) (OS.GetLastUserEventTime () * 1000.0);
-    return (int) System.currentTimeMillis ();
+//  return cast(int) (OS.GetLastUserEventTime () * 1000.0);
+    return cast(int) System.currentTimeMillis ();
 }
 
 //Menu [] getMenus (Decorations shell) {
@@ -1271,15 +1271,15 @@
         Monitor monitor = new Monitor ();
         NSScreen screen = new NSScreen(screens.objectAtIndex(i));
         NSRect frame = screen.frame();
-        monitor.x = (int)frame.x;
-        monitor.y = (int)frame.y;
-        monitor.width = (int)frame.width;
-        monitor.height = (int)frame.height;
+        monitor.x = cast(int)frame.x;
+        monitor.y = cast(int)frame.y;
+        monitor.width = cast(int)frame.width;
+        monitor.height = cast(int)frame.height;
         NSRect visibleFrame = screen.visibleFrame();
-        monitor.clientX = (int)visibleFrame.x;
-        monitor.clientY = (int)visibleFrame.y;
-        monitor.clientWidth = (int)visibleFrame.width;
-        monitor.clientHeight = (int)visibleFrame.height;
+        monitor.clientX = cast(int)visibleFrame.x;
+        monitor.clientY = cast(int)visibleFrame.y;
+        monitor.clientWidth = cast(int)visibleFrame.width;
+        monitor.clientHeight = cast(int)visibleFrame.height;
         monitors [i] = monitor;
     }
     return monitors;
@@ -1297,15 +1297,15 @@
     Monitor monitor = new Monitor ();
     NSScreen screen = NSScreen.mainScreen();
     NSRect frame = screen.frame();
-    monitor.x = (int)frame.x;
-    monitor.y = (int)frame.y;
-    monitor.width = (int)frame.width;
-    monitor.height = (int)frame.height;
+    monitor.x = cast(int)frame.x;
+    monitor.y = cast(int)frame.y;
+    monitor.width = cast(int)frame.width;
+    monitor.height = cast(int)frame.height;
     NSRect visibleFrame = screen.visibleFrame();
-    monitor.clientX = (int)visibleFrame.x;
-    monitor.clientY = (int)visibleFrame.y;
-    monitor.clientWidth = (int)visibleFrame.width;
-    monitor.clientHeight = (int)visibleFrame.height;
+    monitor.clientX = cast(int)visibleFrame.x;
+    monitor.clientY = cast(int)visibleFrame.y;
+    monitor.clientWidth = cast(int)visibleFrame.width;
+    monitor.clientHeight = cast(int)visibleFrame.height;
     return monitor;
 }
 
@@ -1333,7 +1333,7 @@
             if (jniRef !is 0 && jniRef !is -1) {
                 Object object = OS.JNIGetObject(jniRef);
                 if (object instanceof Shell) {
-                    result[index++] = (Shell)object;
+                    result[index++] = cast(Shell)object;
                 }
             }
         }
@@ -1603,7 +1603,7 @@
     OS.class_addMethod(cls, OS.sel_applicationWillTerminate_1, appProc3, "@:@");
     OS.objc_registerClassPair(cls);
     
-    applicationDelegate = (SWTApplicationDelegate)new SWTApplicationDelegate().alloc().init();
+    applicationDelegate = cast(SWTApplicationDelegate)new SWTApplicationDelegate().alloc().init();
     application.setDelegate(applicationDelegate);
 }
 
@@ -1632,7 +1632,7 @@
 
     String className = "SWTWindowDelegate";
     int cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0);
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_windowDidResize_1, proc3, "@:@");
     OS.class_addMethod(cls, OS.sel_windowShouldClose_1, proc3, "@:@");
     OS.class_addMethod(cls, OS.sel_windowWillClose_1, proc3, "@:@");
@@ -1646,7 +1646,7 @@
     
     className = "SWTPanelDelegate";
     cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0);
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_windowWillClose_1, dialogProc3, "@:@");
     OS.class_addMethod(cls, OS.sel_changeColor_1, dialogProc3, "@:@");
     OS.class_addMethod(cls, OS.sel_changeFont_1, dialogProc3, "@:@");
@@ -1656,7 +1656,7 @@
     
     className = "SWTMenu";
     cls = OS.objc_allocateClassPair(OS.class_NSMenu, className, 0);
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
 //  OS.class_addMethod(cls, OS.sel_menuWillOpen_1, proc3, "@:@");
@@ -1668,7 +1668,7 @@
 
     className = "SWTView";
     cls = OS.objc_allocateClassPair(OS.class_NSView, className, 0);
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
     OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
@@ -1685,7 +1685,7 @@
     
     className = "SWTScrollView";
     cls = OS.objc_allocateClassPair(OS.class_NSScrollView, className, 0);
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
     OS.class_addMethod(cls, OS.sel_sendVerticalSelection, proc2, "@:");
@@ -1734,7 +1734,7 @@
     className = "SWTTreeItem";
     cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0);
 //  OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
     OS.objc_registerClassPair(cls);
@@ -1742,7 +1742,7 @@
     className = "SWTTabView";
     cls = OS.objc_allocateClassPair(OS.class_NSTabView, className, 0);
 //  OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tabView_1willSelectTabViewItem_1, proc4, "@:@@");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
@@ -1752,7 +1752,7 @@
     className = "SWTBox";
     cls = OS.objc_allocateClassPair(OS.class_NSBox, className, 0);
 //  OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
     OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
@@ -1761,7 +1761,7 @@
     className = "SWTProgressIndicator";
     cls = OS.objc_allocateClassPair(OS.class_NSProgressIndicator, className, 0);
 //  OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
     OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
@@ -1829,7 +1829,7 @@
     cls = OS.objc_allocateClassPair(OS.class_NSTextView, className, 0);
 //  OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
 //  OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
     OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
@@ -1843,7 +1843,7 @@
 
     className = "SWTWindow";
     cls = OS.objc_allocateClassPair(OS.class_NSWindow, className, 0);
-    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+    OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, cast(byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
     OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
     OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
     OS.class_addMethod(cls, OS.sel_sendEvent_1, proc3, "@:@");
@@ -1914,7 +1914,7 @@
 static bool isValidClass (Class clazz) {
     String name = clazz.getName ();
     int index = name.lastIndexOf ('.');
-    return name.substring (0, index + 1).equals (PACKAGE_PREFIX);
+    return name.substring (0, index + 1).equals cast(PACKAGE_PREFIX);
 }
 
 bool isValidThread () {
@@ -1987,14 +1987,14 @@
 //                  return OS.CGPostKeyboardEvent (0, vKey, type is DWT.KeyDown) is 0;
 //              } else {
 //                  vKey = -1;
-//                  int kchrPtr = OS.GetScriptManagerVariable ((short) OS.smKCHRCache);
+//                  int kchrPtr = OS.GetScriptManagerVariable (cast(short) OS.smKCHRCache);
 //                  int key = -1;
 //                  int [] state = new int [1];
 //                  int [] encoding = new int [1];
-//                  short keyScript = (short) OS.GetScriptManagerVariable ((short) OS.smKeyScript);
-//                  short regionCode = (short) OS.GetScriptManagerVariable ((short) OS.smRegionCode);
-//                  if (OS.UpgradeScriptInfoToTextEncoding (keyScript, (short) OS.kTextLanguageDontCare, regionCode, null, encoding) is OS.paramErr) {
-//                      if (OS.UpgradeScriptInfoToTextEncoding (keyScript, (short) OS.kTextLanguageDontCare, (short) OS.kTextRegionDontCare, null, encoding) is OS.paramErr) {
+//                  short keyScript = cast(short) OS.GetScriptManagerVariable (cast(short) OS.smKeyScript);
+//                  short regionCode = cast(short) OS.GetScriptManagerVariable (cast(short) OS.smRegionCode);
+//                  if (OS.UpgradeScriptInfoToTextEncoding (keyScript, cast(short) OS.kTextLanguageDontCare, regionCode, null, encoding) is OS.paramErr) {
+//                      if (OS.UpgradeScriptInfoToTextEncoding (keyScript, cast(short) OS.kTextLanguageDontCare, cast(short) OS.kTextRegionDontCare, null, encoding) is OS.paramErr) {
 //                          encoding [0] = OS.kTextEncodingMacRoman;
 //                      }
 //                  }
@@ -2009,8 +2009,8 @@
 //                  }
 //                  if (key is -1) return false;                
 //                  for (int i = 0 ; i <= 0x7F ; i++) {
-//                      int result1 = OS.KeyTranslate (kchrPtr, (short) (i | 512), state);
-//                      int result2 = OS.KeyTranslate (kchrPtr, (short) i, state);
+//                      int result1 = OS.KeyTranslate (kchrPtr, cast(short) (i | 512), state);
+//                      int result2 = OS.KeyTranslate (kchrPtr, cast(short) i, state);
 //                      if ((result1 & 0x7f) is key || (result2 & 0x7f) is key) {
 //                          vKey = i;
 //                          break;
@@ -2215,8 +2215,8 @@
             pt = to.view.convertPoint_fromView_(pt, null);
         }
     }
-    point.x = (int)pt.x;
-    point.y = (int)pt.y;
+    point.x = cast(int)pt.x;
+    point.y = cast(int)pt.y;
     return point;
 }
 
@@ -2325,8 +2325,8 @@
             pt = to.view.convertPoint_fromView_(pt, null);
         }
     }
-    rectangle.x = (int)pt.x;
-    rectangle.y = (int)pt.y;
+    rectangle.x = cast(int)pt.x;
+    rectangle.y = cast(int)pt.y;
     return rectangle;
 }
 
@@ -2356,7 +2356,7 @@
  */
 public bool readAndDispatch () {
     checkDevice ();
-    NSAutoreleasePool pool = (NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
+    NSAutoreleasePool pool = cast(NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
     try {
         bool events = false;
         events |= runTimers ();
@@ -2873,7 +2873,7 @@
 public bool sleep () {
     checkDevice ();
     if (getMessageCount () !is 0) return true;
-    NSAutoreleasePool pool = (NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
+    NSAutoreleasePool pool = cast(NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
     try {
         allowTimers = runAsyncMessages = false;
         NSRunLoop.currentRunLoop().runMode(OS.NSDefaultRunLoopMode, NSDate.distantFuture());
@@ -3105,19 +3105,19 @@
     int jniRef = OS.objc_msgSend(id, OS.sel_tag);
     if (jniRef is 0 || jniRef is -1) return 0;
     if (sel is OS.sel_changeColor_1) {
-        ColorDialog dialog = (ColorDialog)OS.JNIGetObject(jniRef);
+        ColorDialog dialog = cast(ColorDialog)OS.JNIGetObject(jniRef);
         if (dialog is null) return 0;
         dialog.changeColor(arg0);
     } else if (sel is OS.sel_changeFont_1) {
-        FontDialog dialog = (FontDialog)OS.JNIGetObject(jniRef);
+        FontDialog dialog = cast(FontDialog)OS.JNIGetObject(jniRef);
         if (dialog is null) return 0;
         dialog.changeFont(arg0);
     } else if (sel is OS.sel_windowWillClose_1) {
         Object object = OS.JNIGetObject(jniRef);
         if (object instanceof FontDialog) {
-            ((FontDialog)object).windowWillClose(arg0);
+            (cast(FontDialog)object).windowWillClose(arg0);
         } else if (object instanceof ColorDialog) {
-            ((ColorDialog)object).windowWillClose(arg0);
+            (cast(ColorDialog)object).windowWillClose(arg0);
         }
     }
     return 0;
@@ -3131,7 +3131,7 @@
     }
     int jniRef = OS.objc_msgSend(delegate, OS.sel_tag);
     if (jniRef is 0 || jniRef is -1) return 0;
-    Widget widget = (Widget)OS.JNIGetObject(jniRef);
+    Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
     if (widget is null) return 0;
     if (sel is OS.sel_isFlipped) {
         return widget.isFlipped() ? 1 : 0;
@@ -3178,7 +3178,7 @@
     }
     int jniRef = OS.objc_msgSend(id, OS.sel_tag);
     if (jniRef is 0 || jniRef is -1) return 0;
-    Widget widget = (Widget)OS.JNIGetObject(jniRef);
+    Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
     if (widget is null) return 0;
     if (sel is OS.sel_windowWillClose_1) {
         widget.windowWillClose(arg0);
@@ -3236,7 +3236,7 @@
 int windowDelegateProc(int delegate, int sel, int arg0, int arg1) {
     int jniRef = OS.objc_msgSend(delegate, OS.sel_tag);
     if (jniRef is 0 || jniRef is -1) return 0;
-    Widget widget = (Widget)OS.JNIGetObject(jniRef);
+    Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
     if (widget is null) return 0;
     if (sel is OS.sel_tabView_1willSelectTabViewItem_1) {
         widget.willSelectTabViewItem(arg0, arg1);
@@ -3257,7 +3257,7 @@
 int windowDelegateProc(int delegate, int sel, int arg0, int arg1, int arg2) {
     int jniRef = OS.objc_msgSend(delegate, OS.sel_tag);
     if (jniRef is 0 || jniRef is -1) return 0;
-    Widget widget = (Widget)OS.JNIGetObject(jniRef);
+    Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
     if (widget is null) return 0;
     if (sel is OS.sel_tableView_1objectValueForTableColumn_1row_1) {
         return widget.tableView_objectValueForTableColumn_row(arg0, arg1, arg2);
@@ -3277,7 +3277,7 @@
 int windowDelegateProc(int delegate, int sel, int arg0, int arg1, int arg2, int arg3) {
     int jniRef = OS.objc_msgSend(delegate, OS.sel_tag);
     if (jniRef is 0 || jniRef is -1) return 0;
-    Widget widget = (Widget)OS.JNIGetObject(jniRef);
+    Widget widget = cast(Widget)OS.JNIGetObject(jniRef);
     if (widget is null) return 0;
     if (sel is OS.sel_tableView_1willDisplayCell_1forTableColumn_1row_1) {
         widget.tableView_willDisplayCell_forTableColumn_row(arg0, arg1, arg2, arg3);
--- a/dwt/widgets/EventTable.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/EventTable.d	Wed Aug 27 14:30:35 2008 +0200
@@ -142,7 +142,7 @@
     for (int i=0; i<types.length; i++) {
         if (types [i] is eventType) {
             if (listeners [i] instanceof TypedListener) {
-                TypedListener typedListener = (TypedListener) listeners [i];
+                TypedListener typedListener = cast(TypedListener) listeners [i];
                 if (typedListener.getEventListener () is listener) {
                     remove (i);
                     return;
--- a/dwt/widgets/FileDialog.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/FileDialog.d	Wed Aug 27 14:30:35 2008 +0200
@@ -212,7 +212,7 @@
         filename.getCharacters_(buffer);
         fullPath = new String(buffer);
         if ((style & DWT.SAVE) is 0) {
-            NSArray filenames = ((NSOpenPanel)panel).filenames();
+            NSArray filenames = (cast(NSOpenPanel)panel).filenames();
             int count = filenames.count();
             fileNames = new String[count];
             for (int i = 0; i < count; i++) {
@@ -327,7 +327,7 @@
  * @since 3.4
  */
 public void setOverwrite (bool overwrite) {
-    //TODO: May be able to implement this with private NSSavePanel method (BOOL)_overwriteExistingFileCheck:(NSString *)filename
+    //TODO: May be able to implement this with private NSSavePanel method cast(BOOL)_overwriteExistingFileCheck:(NSString *)filename
     /* See bug 223703 */
     //this.overwrite = overwrite;
 }
--- a/dwt/widgets/FontDialog.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/FontDialog.d	Wed Aug 27 14:30:35 2008 +0200
@@ -220,7 +220,7 @@
         NSFontManager.sharedFontManager().setSelectedFont(font.handle, false);
         font.dispose();
     }
-    SWTPanelDelegate delegate = (SWTPanelDelegate)new SWTPanelDelegate().alloc().init();
+    SWTPanelDelegate delegate = cast(SWTPanelDelegate)new SWTPanelDelegate().alloc().init();
     int jniRef = OS.NewGlobalRef(this);
     if (jniRef is 0) DWT.error(DWT.ERROR_NO_HANDLES);
     delegate.setTag(jniRef);
--- a/dwt/widgets/Group.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Group.d	Wed Aug 27 14:30:35 2008 +0200
@@ -102,7 +102,7 @@
 
 public Rectangle computeTrim (int x, int y, int width, int height) {
     checkWidget ();
-    NSBox widget = (NSBox)view;
+    NSBox widget = cast(NSBox)view;
     NSSize margins = widget.contentViewMargins();
     NSRect frame = contentView.frame();
     width += margins.width * 2;
@@ -115,11 +115,11 @@
 }
 
 void createHandle () {
-    SWTBox widget = (SWTBox)new SWTBox().alloc();
+    SWTBox widget = cast(SWTBox)new SWTBox().alloc();
     widget.initWithFrame(new NSRect());
     widget.setTitle(NSString.stringWith(""));
     widget.setTag(jniRef);
-    SWTView contentWidget = (SWTView)new SWTView().alloc();
+    SWTView contentWidget = cast(SWTView)new SWTView().alloc();
     contentWidget.initWithFrame(new NSRect());
     contentWidget.setTag(jniRef);
 //  contentWidget.setDrawsBackground(false);
@@ -132,7 +132,7 @@
 public Rectangle getClientArea () {
     checkWidget();
     NSRect rect = contentView.bounds();
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 String getNameText () {
@@ -196,7 +196,7 @@
     char [] buffer = new char [text.length ()];
     text.getChars (0, buffer.length, buffer, 0);
     int length = fixMnemonic (buffer);
-    ((NSBox)view).setTitle(NSString.stringWithCharacters(buffer, length));
+    (cast(NSBox)view).setTitle(NSString.stringWithCharacters(buffer, length));
 }
 
 }
--- a/dwt/widgets/Label.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Label.d	Wed Aug 27 14:30:35 2008 +0200
@@ -133,8 +133,8 @@
             textView.sizeToFit();
             NSRect newRect = textView.frame();
             textView.setFrame (oldRect);
-            width = (int)newRect.width;
-            height = (int)newRect.height;
+            width = cast(int)newRect.width;
+            height = cast(int)newRect.height;
         }
     }
     if (wHint !is DWT.DEFAULT) width = wHint;
@@ -143,7 +143,7 @@
 }
 
 void createHandle () {
-    SWTBox widget = (SWTBox)new SWTBox().alloc();
+    SWTBox widget = cast(SWTBox)new SWTBox().alloc();
     widget.initWithFrame(new NSRect());
     widget.setTag(jniRef);
     widget.setTitle(NSString.stringWith(""));
@@ -152,11 +152,11 @@
     } else {
         widget.setBorderType(OS.NSNoBorder);
 
-        NSImageView imageWidget = (NSImageView)new SWTImageView().alloc();
+        NSImageView imageWidget = cast(NSImageView)new SWTImageView().alloc();
         imageWidget.initWithFrame(new NSRect());
         imageWidget.setTag(jniRef);
         
-        SWTTextField textWidget = (SWTTextField)new SWTTextField().alloc();
+        SWTTextField textWidget = cast(SWTTextField)new SWTTextField().alloc();
         textWidget.initWithFrame(new NSRect());
         textWidget.setBordered(false);
         textWidget.setEditable(false);
@@ -193,7 +193,7 @@
     int length = fixMnemonic (chars);
 
     NSString str = NSString.stringWithCharacters(chars, length);
-    NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+    NSAttributedString attribStr = (cast(NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
     attribStr.autorelease();
     return attribStr;
 }
@@ -349,7 +349,7 @@
     this.image = image;
     isImage = true;
     imageView.setImage(image !is null ? image.handle : null);
-    ((NSBox)view).setContentView(imageView);
+    (cast(NSBox)view).setContentView(imageView);
 }
 
 /**
@@ -387,7 +387,7 @@
     text = string;
     NSCell cell = new NSCell(textView.cell());
     cell.setAttributedStringValue(createString());
-    ((NSBox)view).setContentView(textView);
+    (cast(NSBox)view).setContentView(textView);
 }
 
 }
--- a/dwt/widgets/Link.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Link.d	Wed Aug 27 14:30:35 2008 +0200
@@ -135,10 +135,10 @@
     //TODO wrapping, wHint
     int borderStyle = hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder;
     NSSize borderSize = NSScrollView.frameSizeForContentSize(new NSSize(), false, false, borderStyle);
-    NSTextView widget = (NSTextView)view;
+    NSTextView widget = cast(NSTextView)view;
     NSSize size = widget.textStorage().size();
-    width = (int)(size.width + borderSize.width);
-    height = (int)(size.height + borderSize.height);
+    width = cast(int)(size.width + borderSize.width);
+    height = cast(int)(size.height + borderSize.height);
     if (wHint !is DWT.DEFAULT) width = wHint;
     if (hHint !is DWT.DEFAULT) height = hHint;
     int border = getBorderWidth ();
@@ -148,13 +148,13 @@
 }
 
 void createHandle () {
-    SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+    SWTScrollView scrollWidget = cast(SWTScrollView)new SWTScrollView().alloc();
     scrollWidget.initWithFrame(new NSRect ());
     scrollWidget.setDrawsBackground(false);
     scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder);
     scrollWidget.setTag(jniRef);
 
-    SWTTextView widget = (SWTTextView)new SWTTextView().alloc();
+    SWTTextView widget = cast(SWTTextView)new SWTTextView().alloc();
     widget.initWithFrame(new NSRect());
     widget.setEditable(false);
     widget.setDrawsBackground(false);
@@ -406,7 +406,7 @@
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (string.equals (text)) return;
     text = string;
-    NSTextView widget = (NSTextView)view;
+    NSTextView widget = cast(NSTextView)view;
     widget.setString(NSString.stringWith(parse(string)));
     NSTextStorage textStorage = widget.textStorage();
     NSRange range = new NSRange();
--- a/dwt/widgets/List.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/List.d	Wed Aug 27 14:30:35 2008 +0200
@@ -116,7 +116,7 @@
         items = newItems;
     }
     items [itemCount++] = string;
-    ((NSTableView)view).reloadData();
+    (cast(NSTableView)view).reloadData();
     //TODO adjust horizontal scrollbar
 }
 
@@ -155,7 +155,7 @@
     }
     System.arraycopy (items, index, items, index + 1, itemCount++ - index);
     items [index] = string;
-    ((NSTableView)view).reloadData();
+    (cast(NSTableView)view).reloadData();
 }
 
 /**
@@ -221,7 +221,7 @@
 }
 
 void createHandle () {
-    SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+    SWTScrollView scrollWidget = cast(SWTScrollView)new SWTScrollView().alloc();
     scrollWidget.initWithFrame(new NSRect ());
     if ((style & DWT.H_SCROLL) !is 0) scrollWidget.setHasHorizontalScroller(true);
     if ((style & DWT.V_SCROLL) !is 0) scrollWidget.setHasVerticalScroller(true);
@@ -229,7 +229,7 @@
     scrollWidget.setBorderType((style & DWT.BORDER) !is 0 ? OS.NSBezelBorder : OS.NSNoBorder);
     scrollWidget.setTag(jniRef);
     
-    NSTableView widget = (NSTableView)new SWTTableView().alloc();
+    NSTableView widget = cast(NSTableView)new SWTTableView().alloc();
     widget.initWithFrame(new NSRect());
     widget.setAllowsMultipleSelection((style & DWT.MULTI) !is 0);
     widget.setDataSource(widget);
@@ -239,7 +239,7 @@
     if (!hasBorder()) widget.setFocusRingType(OS.NSFocusRingTypeNone);
     widget.setTag(jniRef);
     
-    column = (NSTableColumn)new NSTableColumn().alloc();
+    column = cast(NSTableColumn)new NSTableColumn().alloc();
     column.initWithIdentifier(NSString.stringWith(""));
     widget.addTableColumn (column);
     
@@ -277,7 +277,7 @@
 public void deselect (int index) {
     checkWidget();
     if (0 <= index && index < itemCount) {
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
         widget.deselectRow (index);
         ignoreSelect = false;
@@ -310,7 +310,7 @@
     if (start is 0 && end is itemCount - 1) {
         deselectAll ();
     } else {
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
         for (int i=0; i<length; i++) {
             widget.deselectRow (i);
@@ -339,7 +339,7 @@
 public void deselect (int [] indices) {
     checkWidget();
     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     for (int i=0; i<indices.length; i++) {
         widget.deselectRow (indices [i]);
@@ -357,7 +357,7 @@
  */
 public void deselectAll () {
     checkWidget ();
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     widget.deselectAll(null);
     ignoreSelect = false;
@@ -451,7 +451,7 @@
  */
 public int getItemHeight () {
     checkWidget ();
-    return (int)((NSTableView)view).rowHeight();
+    return cast(int)(cast(NSTableView)view).rowHeight();
 }
 
 /**
@@ -495,7 +495,7 @@
  */
 public String [] getSelection () {
     checkWidget ();
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     if (widget.numberOfSelectedRows() is 0) {
         return new String [0];
     }
@@ -522,7 +522,7 @@
  */
 public int getSelectionCount () {
     checkWidget ();
-    return ((NSTableView)view).numberOfSelectedRows();
+    return (cast(NSTableView)view).numberOfSelectedRows();
 }
 
 /**
@@ -539,7 +539,7 @@
 public int getSelectionIndex () {
     checkWidget();
     //TODO - check empty selection case
-    return ((NSTableView)view).selectedRow();
+    return (cast(NSTableView)view).selectedRow();
 }
 
 /**
@@ -560,7 +560,7 @@
  */
 public int [] getSelectionIndices () {
     checkWidget ();
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     if (widget.numberOfSelectedRows() is 0) {
         return new int [0];
     }
@@ -590,7 +590,7 @@
     NSPoint point = new NSPoint();
     point.x = rect.x;
     point.y = rect.y;
-    return ((NSTableView)view).rowAtPoint(point);
+    return (cast(NSTableView)view).rowAtPoint(point);
 }
 
 /**
@@ -665,7 +665,7 @@
 public bool isSelected (int index) {
     checkWidget();
     //TODO - range check
-    return ((NSTableView)view).isRowSelected(index);
+    return (cast(NSTableView)view).isRowSelected(index);
 }
 
 int numberOfRowsInTableView(int aTableView) {
@@ -703,7 +703,7 @@
     if (index !is itemCount - 1) fixSelection (index, false);
     System.arraycopy (items, index + 1, items, index, --itemCount - index);
     items [itemCount] = null;
-    ((NSTableView)view).noteNumberOfRowsChanged();
+    (cast(NSTableView)view).noteNumberOfRowsChanged();
 }
 
 /**
@@ -805,7 +805,7 @@
     checkWidget();
     items = new String [4];
     itemCount = 0;
-    ((NSTableView)view).noteNumberOfRowsChanged();
+    (cast(NSTableView)view).noteNumberOfRowsChanged();
 }
 
 /**
@@ -848,11 +848,11 @@
 public void select (int index) {
     checkWidget();
     if (0 <= index && index < itemCount) {
-        NSIndexSet indexes = (NSIndexSet)new NSIndexSet().alloc();
+        NSIndexSet indexes = cast(NSIndexSet)new NSIndexSet().alloc();
         indexes.initWithIndex(index);
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
-        ((NSTableView)view).selectRowIndexes(indexes, true);
+        (cast(NSTableView)view).selectRowIndexes(indexes, true);
         ignoreSelect = false;
     }
 }
@@ -889,12 +889,12 @@
         start = Math.max (0, start);
         end = Math.min (end, itemCount - 1);
         int length = end - start + 1;
-        NSIndexSet indexes = (NSIndexSet)new NSIndexSet().alloc();
+        NSIndexSet indexes = cast(NSIndexSet)new NSIndexSet().alloc();
         NSRange range = new NSRange();
         range.location = start;
         range.length = length;
         indexes.initWithIndexesInRange(range);
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
         widget.selectRowIndexes(indexes, true);
         ignoreSelect = false;
@@ -929,7 +929,7 @@
     int length = indices.length;
     if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return;
     int count = 0;
-    NSMutableIndexSet indexes = (NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
+    NSMutableIndexSet indexes = cast(NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
     for (int i=0; i<length; i++) {
         int index = indices [length - i - 1];
         if (index >= 0 && index < itemCount) {
@@ -938,7 +938,7 @@
         }
     }
     if (count > 0) {
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
         widget.selectRowIndexes(indexes, true);
         ignoreSelect = false;
@@ -946,9 +946,9 @@
 }
 
 void select (int [] ids, int count, bool clear) {
-    NSMutableIndexSet indexes = (NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
+    NSMutableIndexSet indexes = cast(NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
     for (int i=0; i<count; i++) indexes.addIndex (ids [i] - 1); //WRONG -1
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     widget.selectRowIndexes(indexes, !clear);
     ignoreSelect = false;
@@ -967,7 +967,7 @@
 public void selectAll () {
     checkWidget ();
     if ((style & DWT.SINGLE) !is 0) return;
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     widget.selectAll(null);
     ignoreSelect = false;
@@ -998,7 +998,7 @@
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (!(0 <= index && index < itemCount)) error (DWT.ERROR_INVALID_RANGE);
     items [index] = string;
-    ((NSTableView)view).reloadData();
+    (cast(NSTableView)view).reloadData();
 }
 
 /**
@@ -1024,7 +1024,7 @@
     this.items = new String [items.length];
     System.arraycopy (items, 0, this.items, 0, items.length);
     itemCount = items.length;
-    ((NSTableView)view).reloadData();
+    (cast(NSTableView)view).reloadData();
 }
 
 /**
@@ -1205,13 +1205,13 @@
  */
 public void setTopIndex (int index) {
     checkWidget();
-    NSRect rect = ((NSTableView)view).rectOfRow(index);
-    ((NSTableView)view).scrollRectToVisible(rect);
+    NSRect rect = (cast(NSTableView)view).rectOfRow(index);
+    (cast(NSTableView)view).scrollRectToVisible(rect);
 }
 
 void showIndex (int index) {
     if (0 <= index && index < itemCount) {
-        ((NSTableView)view).scrollRowToVisible(index);
+        (cast(NSTableView)view).scrollRowToVisible(index);
     }
 }
 
@@ -1258,7 +1258,7 @@
     char[] chars = new char[length];
     text.getChars(0, length, chars, 0);
     NSString str = NSString.stringWithCharacters(chars, length);
-    NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+    NSAttributedString attribStr = (cast(NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
     attribStr.autorelease();
     return attribStr.id;
 }
--- a/dwt/widgets/Menu.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Menu.d	Wed Aug 27 14:30:35 2008 +0200
@@ -208,7 +208,7 @@
         } else {
             location = window.mouseLocationOutsideOfEventStream();
         }
-        NSEvent nsEvent = NSEvent.otherEventWithType(OS.NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), (short)0, 0, 0);
+        NSEvent nsEvent = NSEvent.otherEventWithType(OS.NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), cast(short)0, 0, 0);
         NSMenu.static_popUpContextMenu_withEvent_forView_ (nsMenu, nsEvent, shell.view);
     } else {
         nsMenu.cancelTracking ();
@@ -270,7 +270,7 @@
 
 void createHandle () {
 //  display.addMenu (this);
-    SWTMenu widget = (SWTMenu)new SWTMenu().alloc();
+    SWTMenu widget = cast(SWTMenu)new SWTMenu().alloc();
     widget.initWithTitle(NSString.stringWith(""));
     widget.setAutoenablesItems(false);
     widget.setTag(jniRef);
@@ -286,7 +286,7 @@
         nsItem = NSMenuItem.separatorItem();
         nsItem.retain();
     } else {
-        nsItem = (NSMenuItem)new SWTMenuItem().alloc();
+        nsItem = cast(NSMenuItem)new SWTMenuItem().alloc();
         nsItem.initWithTitle(NSString.stringWith(""), 0, NSString.stringWith(""));
         nsItem.setTarget(nsItem);
         nsItem.setAction(OS.sel_sendSelection);
@@ -641,7 +641,7 @@
     if (jniRef !is -1 && jniRef !is 0) {
         Object object = OS.JNIGetObject(jniRef);
         if (object instanceof MenuItem) {
-            MenuItem item = (MenuItem)object;
+            MenuItem item = cast(MenuItem)object;
             item.sendEvent (DWT.Arm);
         }
     }
@@ -802,10 +802,10 @@
     checkWidget();
     if (enabled) {
         state &= ~DISABLED;
-        //OS.EnableMenuItem (handle, (short)0);
+        //OS.EnableMenuItem (handle, cast(short)0);
     } else {
         state |= DISABLED;
-        //OS.DisableMenuItem (handle, (short)0);
+        //OS.DisableMenuItem (handle, cast(short)0);
     }
 }
 
--- a/dwt/widgets/MenuItem.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/MenuItem.d	Wed Aug 27 14:30:35 2008 +0200
@@ -224,7 +224,7 @@
 
 NSMenu createEmptyMenu () {
     if ((parent.style & DWT.BAR) !is 0) {
-        return (NSMenu) new SWTMenu ().alloc ().init ();
+        return cast(NSMenu) new SWTMenu ().alloc ().init ();
     }
     return null;
 }
@@ -330,7 +330,7 @@
 public bool getSelection () {
     checkWidget ();
     if ((style & (DWT.CHECK | DWT.RADIO)) is 0) return false;
-    return ((NSMenuItem)nsItem).state() is OS.NSOnState;
+    return (cast(NSMenuItem)nsItem).state() is OS.NSOnState;
 }
 
 //int kEventProcessCommand (int nextHandler, int theEvent, int userData) {
@@ -351,7 +351,7 @@
 //  int [] modifiers = new int [1];
 //  OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
 //  Event event = new Event ();
-//  setInputState (event, (short) 0, OS.GetCurrentEventButtonState (), modifiers [0]);
+//  setInputState (event, cast(short) 0, OS.GetCurrentEventButtonState (), modifiers [0]);
 //  postEvent (DWT.Selection, event);
 //  return OS.noErr;
 //}
@@ -530,7 +530,7 @@
     }
     Event event = new Event ();
     //TODO state mask
-//  setInputState (event, (short) 0, OS.GetCurrentEventButtonState (), modifiers [0]);
+//  setInputState (event, cast(short) 0, OS.GetCurrentEventButtonState (), modifiers [0]);
     postEvent (DWT.Selection, event);
 }
 
@@ -557,9 +557,9 @@
     int virtualKey = Display.untranslateKey (key);
     NSString string =  null;
     if (virtualKey !is 0) {
-        string = NSString.stringWith ((char)virtualKey + "");
+        string = NSString.stringWith (cast(wchar)virtualKey + "");
     } else {
-        string = NSString.stringWith ((char)key + "").lowercaseString();
+        string = NSString.stringWith (cast(wchar)key + "").lowercaseString();
     }
     nsItem.setKeyEquivalent (string);
     int mask = 0;
@@ -589,7 +589,7 @@
  */
 public void setEnabled (bool enabled) {
     checkWidget ();
-    ((NSMenuItem)nsItem).setEnabled(enabled);
+    (cast(NSMenuItem)nsItem).setEnabled(enabled);
 }
 
 /**
@@ -610,7 +610,7 @@
     checkWidget ();
     if ((style & DWT.SEPARATOR) !is 0) return;
     super.setImage (image);
-    ((NSMenuItem)nsItem).setImage(image !is null? image.handle : null);
+    (cast(NSMenuItem)nsItem).setImage(image !is null? image.handle : null);
 }
 
 /**
@@ -699,7 +699,7 @@
 public void setSelection (bool selected) {
     checkWidget ();
     if ((style & (DWT.CHECK | DWT.RADIO)) is 0) return;
-    ((NSMenuItem)nsItem).setState(selected ? OS.NSOnState : OS.NSOffState);
+    (cast(NSMenuItem)nsItem).setState(selected ? OS.NSOnState : OS.NSOffState);
 }
 
 /**
--- a/dwt/widgets/Monitor.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Monitor.d	Wed Aug 27 14:30:35 2008 +0200
@@ -45,7 +45,7 @@
 public bool equals (Object object) {
     if (object is this) return true;
     if (!(object instanceof Monitor)) return false;
-    Monitor monitor = (Monitor) object;
+    Monitor monitor = cast(Monitor) object;
     return handle is monitor.handle;
 }
 
@@ -81,7 +81,7 @@
  * @see #equals(Object)
  */
 public int hashCode () {
-    return (int)/*64*/handle;
+    return cast(int)/*64*/handle;
 }
 
 }
--- a/dwt/widgets/ProgressBar.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/ProgressBar.d	Wed Aug 27 14:30:35 2008 +0200
@@ -80,12 +80,12 @@
 
 public Point computeSize (int wHint, int hHint, bool changed) {
     checkWidget();
-    NSProgressIndicator widget = (NSProgressIndicator)view;
+    NSProgressIndicator widget = cast(NSProgressIndicator)view;
     NSRect oldRect = widget.frame();
     widget.sizeToFit();
     NSRect newRect = widget.frame();
     widget.setFrame (oldRect);
-    int size = (int)newRect.height;
+    int size = cast(int)newRect.height;
     int width = 0, height = 0;
     if ((style & DWT.HORIZONTAL) !is 0) {
         height = size;
@@ -100,7 +100,7 @@
 }
 
 void createHandle () {
-    SWTProgressIndicator widget = (SWTProgressIndicator)new SWTProgressIndicator().alloc();
+    SWTProgressIndicator widget = cast(SWTProgressIndicator)new SWTProgressIndicator().alloc();
     widget.initWithFrame(new NSRect());
     widget.setUsesThreadedAnimation(false);
     widget.setIndeterminate((style & DWT.INDETERMINATE) !is 0);
@@ -122,7 +122,7 @@
  */
 public int getMaximum () {
     checkWidget();
-    return (int)((NSProgressIndicator)view).maxValue();
+    return cast(int)(cast(NSProgressIndicator)view).maxValue();
 }
 
 /**
@@ -137,7 +137,7 @@
  */
 public int getMinimum () {
     checkWidget();
-    return (int)((NSProgressIndicator)view).minValue();
+    return cast(int)(cast(NSProgressIndicator)view).minValue();
 }
 
 /**
@@ -152,7 +152,7 @@
  */
 public int getSelection () {
     checkWidget();
-    return (int)((NSProgressIndicator)view).doubleValue();
+    return cast(int)(cast(NSProgressIndicator)view).doubleValue();
 }
 
 public int getState () {
@@ -176,7 +176,7 @@
 public void setMaximum (int value) {
     checkWidget();
     if (value < 0) return;
-    ((NSProgressIndicator)view).setMaxValue(value);
+    (cast(NSProgressIndicator)view).setMaxValue(value);
 }
 
 /**
@@ -195,7 +195,7 @@
 public void setMinimum (int value) {
     checkWidget();
     if (value < 0) return;
-    ((NSProgressIndicator)view).setMinValue(value);
+    (cast(NSProgressIndicator)view).setMinValue(value);
 }
 
 /**
@@ -212,7 +212,7 @@
  */
 public void setSelection (int value) {
     checkWidget();
-   ((NSProgressIndicator)view).setDoubleValue(value);
+   (cast(NSProgressIndicator)view).setDoubleValue(value);
 }
 
 public void setState (int state) {
--- a/dwt/widgets/Sash.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Sash.d	Wed Aug 27 14:30:35 2008 +0200
@@ -128,8 +128,8 @@
 bool becomeFirstResponder () {
     bool result = super.becomeFirstResponder();
     NSRect frame = view.frame();
-    lastX = (int)frame.x;
-    lastY = (int)frame.y;
+    lastX = cast(int)frame.x;
+    lastY = cast(int)frame.y;
     return result;
 }
 
@@ -147,7 +147,7 @@
 }
 
 void createHandle () {
-    SWTView widget = (SWTView)new SWTView().alloc();
+    SWTView widget = cast(SWTView)new SWTView().alloc();
     widget.initWithFrame (new NSRect());
     widget.setTag(jniRef);
     view = widget;
@@ -219,14 +219,14 @@
     if (nsEvent.clickCount() !is 1) return;
     NSPoint location = nsEvent.locationInWindow();
     NSPoint point = view.convertPoint_fromView_(location, null);
-    startX = (int)point.x;
-    startY = (int)point.y;
+    startX = cast(int)point.x;
+    startY = cast(int)point.y;
     NSRect frame = view.frame();
     Event event = new Event ();
-    event.x = (int)frame.x;
-    event.y = (int)frame.y;
-    event.width = (int)frame.width;
-    event.height = (int)frame.height;
+    event.x = cast(int)frame.x;
+    event.y = cast(int)frame.y;
+    event.width = cast(int)frame.width;
+    event.height = cast(int)frame.height;
     sendEvent (DWT.Selection, event);
     if (isDisposed ()) return;
     if (event.doit) {
@@ -247,22 +247,22 @@
     NSRect parentFrame = parent.topView().frame();
     int newX = lastX, newY = lastY;
     if ((style & DWT.VERTICAL) !is 0) {
-        newX = Math.min (Math.max (0, (int)(point.x + frame.x - startX)), (int)(parentFrame.width - frame.width));
+        newX = Math.min (Math.max (0, cast(int)(point.x + frame.x - startX)), cast(int)(parentFrame.width - frame.width));
     } else {
-        newY = Math.min (Math.max (0, (int)(point.y + frame.y - startY)), (int)(parentFrame.height - frame.height));
+        newY = Math.min (Math.max (0, cast(int)(point.y + frame.y - startY)), cast(int)(parentFrame.height - frame.height));
     }
     if (newX is lastX && newY is lastY) return;
     Event event = new Event ();
     event.x = newX;
     event.y = newY;
-    event.width = (int)frame.width;
-    event.height = (int)frame.height;
+    event.width = cast(int)frame.width;
+    event.height = cast(int)frame.height;
     sendEvent (DWT.Selection, event);
     if (isDisposed ()) return;
     if (event.doit) {
         lastX = event.x;
         lastY = event.y;
-        setBounds (event.x, event.y, (int)frame.width, (int)frame.height);
+        setBounds (event.x, event.y, cast(int)frame.width, cast(int)frame.height);
     }
 }
 
@@ -280,12 +280,12 @@
     Event event = new Event ();
     event.x = lastX;
     event.y = lastY;
-    event.width = (int)frame.width;
-    event.height = (int)frame.height;
+    event.width = cast(int)frame.width;
+    event.height = cast(int)frame.height;
     sendEvent (DWT.Selection, event);
     if (isDisposed ()) return;
     if (event.doit) {
-        setBounds (event.x, event.y, (int)frame.width, (int)frame.height);
+        setBounds (event.x, event.y, cast(int)frame.width, cast(int)frame.height);
     }
 }
 
--- a/dwt/widgets/Scale.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Scale.d	Wed Aug 27 14:30:35 2008 +0200
@@ -113,17 +113,17 @@
 
 public Point computeSize (int wHint, int hHint, bool changed) {
     checkWidget();
-    NSSlider widget = (NSSlider)view;
+    NSSlider widget = cast(NSSlider)view;
     NSRect oldRect = widget.frame();
     widget.sizeToFit();
     NSRect newRect = widget.frame();
     widget.setFrame (oldRect);
     int width = 0, height = 0;
     if ((style & DWT.HORIZONTAL) !is 0) {        
-        height = (int)newRect.width;
+        height = cast(int)newRect.width;
         width = height * 10;
     } else {
-        width = (int)newRect.width;
+        width = cast(int)newRect.width;
         height = width * 10;
     }
     if (wHint !is DWT.DEFAULT) width = wHint;
@@ -132,7 +132,7 @@
 }
 
 void createHandle () {
-    NSSlider widget = (NSSlider)new SWTSlider().alloc();
+    NSSlider widget = cast(NSSlider)new SWTSlider().alloc();
     NSRect rect = new NSRect();
     if ((style & DWT.HORIZONTAL) !is 0) {
         rect.width = 1;
@@ -175,7 +175,7 @@
  */
 public int getMaximum () {
     checkWidget();
-    return (int)((NSSlider)view).maxValue();
+    return cast(int)(cast(NSSlider)view).maxValue();
 }
 
 /**
@@ -190,7 +190,7 @@
  */
 public int getMinimum () {
     checkWidget();
-    return (int)((NSSlider)view).minValue();
+    return cast(int)(cast(NSSlider)view).minValue();
 }
 
 /**
@@ -228,7 +228,7 @@
 //      int maximum = OS.GetControl32BitMaximum (handle);
 //      value = maximum - value + minimum;
 //  }
-    return (int)((NSSlider)view).doubleValue();
+    return cast(int)(cast(NSSlider)view).doubleValue();
 }
 
 /**
@@ -291,7 +291,7 @@
 public void setMaximum (int value) {
     checkWidget();
     if (value < 0) return;
-    ((NSSlider)view).setMaxValue(value);
+    (cast(NSSlider)view).setMaxValue(value);
 }
 
 /**
@@ -310,7 +310,7 @@
 public void setMinimum (int value) {
     checkWidget();
     if (value < 0) return;
-    ((NSSlider)view).setMinValue(value);
+    (cast(NSSlider)view).setMinValue(value);
 }
 
 /**
@@ -345,7 +345,7 @@
  */
 public void setSelection (int value) {
     checkWidget();
-    ((NSSlider)view).setDoubleValue(value);
+    (cast(NSSlider)view).setDoubleValue(value);
 }
 
 }
--- a/dwt/widgets/ScrollBar.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/ScrollBar.d	Wed Aug 27 14:30:35 2008 +0200
@@ -259,9 +259,9 @@
  */
 public int getSelection () {
     checkWidget();
-    NSScroller widget = (NSScroller)view;
+    NSScroller widget = cast(NSScroller)view;
     float value = widget.floatValue();
-    return (int)((maximum - thumb - minimum) * value + minimum);
+    return cast(int)((maximum - thumb - minimum) * value + minimum);
 }
 
 /**
@@ -412,7 +412,7 @@
         value = getSelection ();
     }
     Event event = new Event();
-    int hitPart = ((NSScroller)view).hitPart();
+    int hitPart = (cast(NSScroller)view).hitPart();
     switch (hitPart) {
         case OS.NSScrollerDecrementLine:
             value -= increment;
@@ -652,11 +652,11 @@
 }
 
 void updateBar(int selection, int minimum, int maximum, int thumb) {
-    NSScroller widget = (NSScroller)view;
+    NSScroller widget = cast(NSScroller)view;
     selection = Math.max(minimum, Math.min(maximum - thumb, selection));
     int range = maximum - thumb - minimum;
-    float fraction = range < 0 ? 1 : (float)(selection - minimum) / range;
-    float knob = minimum is maximum ? 1 : (float)(thumb - minimum) / maximum - minimum;
+    float fraction = range < 0 ? 1 : cast(float)(selection - minimum) / range;
+    float knob = minimum is maximum ? 1 : cast(float)(thumb - minimum) / maximum - minimum;
     widget.setFloatValue(fraction, knob);
     widget.setEnabled(range > 0); 
 }
--- a/dwt/widgets/Scrollable.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Scrollable.d	Wed Aug 27 14:30:35 2008 +0200
@@ -114,8 +114,8 @@
         size.height = height;
         int border = hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder;
         size = NSScrollView.frameSizeForContentSize(size, (style & DWT.H_SCROLL) !is 0, (style & DWT.V_SCROLL) !is 0, border);
-        width = (int)size.width;
-        height = (int)size.height;
+        width = cast(int)size.width;
+        height = cast(int)size.height;
         NSRect frame = scrollView.contentView().frame();
         x -= frame.x;
         y -= frame.y;
@@ -174,10 +174,10 @@
     checkWidget();
     if (scrollView !is null) {
         NSSize size = scrollView.contentSize();
-        return new Rectangle(0, 0, (int)size.width, (int)size.height);
+        return new Rectangle(0, 0, cast(int)size.width, cast(int)size.height);
     } else {
         NSRect rect = view.bounds();
-        return new Rectangle(0, 0, (int)rect.width, (int)rect.height);
+        return new Rectangle(0, 0, cast(int)rect.width, cast(int)rect.height);
     }
 }
 
@@ -252,8 +252,8 @@
 //  int width, height;
 //  CGRect rect = new CGRect (); 
 //  OS.HIViewGetBounds (scrolledHandle, rect);
-//  width = (int) rect.width;
-//  height = (int) rect.height;
+//  width = cast(int) rect.width;
+//  height = cast(int) rect.height;
 //  Rect inset = inset ();
 //  width = Math.max (0, width - vWidth - inset.left - inset.right);
 //  height = Math.max (0, height - hHeight - inset.top - inset.bottom);
--- a/dwt/widgets/Shell.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Shell.d	Wed Aug 27 14:30:35 2008 +0200
@@ -142,7 +142,7 @@
 
 /**
  * Constructs a new instance of this class. This is equivalent
- * to calling <code>Shell((Display) null)</code>.
+ * to calling <code>Shell(cast(Display) null)</code>.
  *
  * @exception DWTException <ul>
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
@@ -150,13 +150,13 @@
  * </ul>
  */
 public this () {
-    this ((Display) null);
+    this (cast(Display) null);
 }
 
 /**
  * Constructs a new instance of this class given only the style
  * value describing its behavior and appearance. This is equivalent
- * to calling <code>Shell((Display) null, style)</code>.
+ * to calling <code>Shell(cast(Display) null, style)</code>.
  * <p>
  * The style value is either one of the style constants defined in
  * class <code>DWT</code> which is applicable to instances of this
@@ -189,7 +189,7 @@
  * @see DWT#SYSTEM_MODAL
  */
 public this (int style) {
-    this ((Display) null, style);
+    this (cast(Display) null, style);
 }
 
 /**
@@ -457,7 +457,7 @@
     rect.width = trim.width;
     rect.height = trim.height;
     rect = NSWindow.static_frameRectForContentRect_styleMask_(rect, window.styleMask());
-    return new Rectangle ((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle (cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 void createHandle () {
@@ -466,9 +466,9 @@
         view = window.contentView();
         return;
     } else {
-        SWTWindow swtWindow = (SWTWindow) new SWTWindow ().alloc ();
+        SWTWindow swtWindow = cast(SWTWindow) new SWTWindow ().alloc ();
         swtWindow.setTag(jniRef);
-        window = (NSWindow)swtWindow;
+        window = cast(NSWindow)swtWindow;
         NSRect rect = new NSRect();
         Monitor monitor = getMonitor ();
         Rectangle clientArea = monitor.getClientArea ();
@@ -492,7 +492,7 @@
     createHandle (null);
     
     window.setContentView (topView());
-    windowDelegate = (SWTWindowDelegate)new SWTWindowDelegate().alloc().init();
+    windowDelegate = cast(SWTWindowDelegate)new SWTWindowDelegate().alloc().init();
     windowDelegate.setTag(jniRef);
     window.setDelegate(windowDelegate);
 }
@@ -586,27 +586,27 @@
 
 public int getAlpha () {
     checkWidget ();
-    return (int)(window.alphaValue() * 255);
+    return cast(int)(window.alphaValue() * 255);
 }
 
 public Rectangle getBounds () {
     checkWidget();
     NSRect frame = window.frame ();
-    return new Rectangle ((int)frame.x, (int) frame.y, (int) frame.width, (int) frame.height);
+    return new Rectangle (cast(int)frame.x, cast(int) frame.y, cast(int) frame.width, cast(int) frame.height);
 }
 
 public Rectangle getClientArea () {
     checkWidget();
     //TODO why super implementation fails
     NSRect rect = window.contentRectForFrameRect_(window.frame());
-    int width = (int)rect.width, height = (int)rect.height;
+    int width = cast(int)rect.width, height = cast(int)rect.height;
     if (scrollView !is null) {
         NSSize size = new NSSize();
         size.width = width;
         size.height = height;
         size = NSScrollView.contentSizeForFrameSize(size, (style & DWT.H_SCROLL) !is 0, (style & DWT.V_SCROLL) !is 0, OS.NSNoBorder);
-        width = (int)size.width;
-        height = (int)size.height;
+        width = cast(int)size.width;
+        height = cast(int)size.height;
     }
     return new Rectangle (0, 0, width, height);
 }
@@ -646,7 +646,7 @@
 public Point getLocation () {
     checkWidget();
     NSRect frame = window.frame ();
-    return new Point ((int) frame.x, (int) frame.y);
+    return new Point (cast(int) frame.x, cast(int) frame.y);
 }
 
 public bool getMaximized () {
@@ -683,8 +683,8 @@
 //  OS.GetWindowStructureWidths (shellHandle, rect);
 //  CGPoint inMinLimits = new CGPoint (), inMaxLimits = new CGPoint ();
 //  OS.GetWindowResizeLimits (shellHandle, inMinLimits, inMaxLimits);
-//  int width = Math.max (1, (int) inMinLimits.x + (rect.left + rect.right));
-//  int height = Math.max (1, (int) inMinLimits.y + (rect.top + rect.bottom));
+//  int width = Math.max (1, cast(int) inMinLimits.x + (rect.left + rect.right));
+//  int height = Math.max (1, cast(int) inMinLimits.y + (rect.top + rect.bottom));
 //  return new Point (width, height);
     return null;
 }
@@ -757,7 +757,7 @@
 public Point getSize () {
     checkWidget();
     NSRect frame = window.frame ();
-    return new Point ((int) frame.width, (int) frame.height);
+    return new Point (cast(int) frame.width, cast(int) frame.height);
 }
 
 bool hasBorder () {
@@ -972,7 +972,7 @@
         NSRect rect = new NSRect ();
         rect.x = x;
         //TODO - get the screen for the point
-        int screenHeight = (int) window.screen().frame().height;
+        int screenHeight = cast(int) window.screen().frame().height;
         rect.y = screenHeight - y;
         rect.width = width;
         rect.height = height;
@@ -982,7 +982,7 @@
             NSPoint point = new NSPoint();
             point.x = x;
             //TODO - get the screen for the point
-            int screenHeight = (int) window.screen().frame().height;
+            int screenHeight = cast(int) window.screen().frame().height;
             point.y = screenHeight - y;
             window.setFrameTopLeftPoint (point);
         } else {
@@ -1022,8 +1022,8 @@
 //          screen.y += rect.top;
 //      }
 //      Rect rect = new Rect ();
-//      OS.SetRect (rect, (short) screen.x, (short) screen.y, (short) (screen.x + screen.width), (short) (screen.y + screen.height));
-//      OS.SetWindowBounds (shellHandle, (short) OS.kWindowStructureRgn, rect);
+//      OS.SetRect (rect, cast(short) screen.x, cast(short) screen.y, cast(short) (screen.x + screen.width), cast(short) (screen.y + screen.height));
+//      OS.SetWindowBounds (shellHandle, cast(short) OS.kWindowStructureRgn, rect);
 //  } else {
 //      int attributes = 0;
 //      if ((style & DWT.RESIZE) !is 0) {
@@ -1044,8 +1044,8 @@
 //          setMaximized (true);
 //      } else {
 //          Rect rect = new Rect ();
-//          if (normalBounds !is null) OS.SetRect (rect, (short) normalBounds.x, (short) normalBounds.y, (short) (normalBounds.x + normalBounds.width), (short) (normalBounds.y + normalBounds.height));
-//          OS.SetWindowBounds (shellHandle, (short) OS.kWindowStructureRgn, rect);
+//          if (normalBounds !is null) OS.SetRect (rect, cast(short) normalBounds.x, cast(short) normalBounds.y, cast(short) (normalBounds.x + normalBounds.width), cast(short) (normalBounds.y + normalBounds.height));
+//          OS.SetWindowBounds (shellHandle, cast(short) OS.kWindowStructureRgn, rect);
 //      }
 //      normalBounds = null;
 //  }
@@ -1087,10 +1087,10 @@
 //      Rect rect = new Rect ();
 //      int gdevice = OS.GetMainDevice ();
 //      OS.GetAvailableWindowPositioningBounds (gdevice, rect);
-//      pt.h = (short) (rect.right - rect.left);
-//      pt.v = (short) (rect.bottom - rect.top);
+//      pt.h = cast(short) (rect.right - rect.left);
+//      pt.v = cast(short) (rect.bottom - rect.top);
 //  }
-//  short inPartCode = (short) (maximized ? OS.inZoomOut : OS.inZoomIn);
+//  short inPartCode = cast(short) (maximized ? OS.inZoomOut : OS.inZoomIn);
 //  OS.ZoomWindowIdeal (shellHandle, inPartCode, pt);
 }
 
@@ -1193,8 +1193,8 @@
 //  } else {
 //      if (rgnRect is null) {
 //          rgnRect = new Rect ();
-//          OS.GetWindowBounds (shellHandle, (short) OS.kWindowStructureRgn, rgnRect);
-//          OS.SetRect (rgnRect, (short) 0, (short) 0, (short) (rgnRect.right - rgnRect.left), (short) (rgnRect.bottom - rgnRect.top)); 
+//          OS.GetWindowBounds (shellHandle, cast(short) OS.kWindowStructureRgn, rgnRect);
+//          OS.SetRect (rgnRect, cast(short) 0, cast(short) 0, cast(short) (rgnRect.right - rgnRect.left), cast(short) (rgnRect.bottom - rgnRect.top)); 
 //      }
 //  }
 //  this.region = region;
@@ -1288,7 +1288,7 @@
             isActive = true;
             break;
         }
-        current = (Shell) current.parent;
+        current = cast(Shell) current.parent;
     }
     if (!isActive) return;
 //  if (fullScreen) {
--- a/dwt/widgets/Slider.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Slider.d	Wed Aug 27 14:30:35 2008 +0200
@@ -158,10 +158,10 @@
     checkWidget();
     int width = 0, height = 0;
     if ((style & DWT.HORIZONTAL) !is 0) {
-        height = (int)NSScroller.scrollerWidth();
+        height = cast(int)NSScroller.scrollerWidth();
         width = height * 10;
     } else {
-        width = (int)NSScroller.scrollerWidth();
+        width = cast(int)NSScroller.scrollerWidth();
         height = width * 10;
     }
     if (wHint !is DWT.DEFAULT) width = wHint;
@@ -170,7 +170,7 @@
 }
 
 void createHandle () {
-    NSScroller widget = (NSScroller)new SWTScroller().alloc();
+    NSScroller widget = cast(NSScroller)new SWTScroller().alloc();
     NSRect rect = new NSRect();
     if ((style & DWT.HORIZONTAL) !is 0) {
         rect.width = 1;
@@ -269,9 +269,9 @@
  */
 public int getSelection () {
     checkWidget();
-    NSScroller widget = (NSScroller)view;
+    NSScroller widget = cast(NSScroller)view;
     float value = widget.floatValue();
-    return (int)((maximum - thumb - minimum) * value + minimum);
+    return cast(int)((maximum - thumb - minimum) * value + minimum);
 }
 
 /**
@@ -317,7 +317,7 @@
 
 void sendSelection () {
     Event event = new Event();
-    int hitPart = ((NSScroller)view).hitPart();
+    int hitPart = (cast(NSScroller)view).hitPart();
     int value = getSelection ();
     switch (hitPart) {
         case OS.NSScrollerDecrementLine:
@@ -452,10 +452,10 @@
 }
 
 void updateBar(int selection, int minimum, int maximum, int thumb) {
-    NSScroller widget = (NSScroller)view;
+    NSScroller widget = cast(NSScroller)view;
     selection = Math.max(minimum, Math.min(maximum - thumb, selection));
-    float fraction = minimum is maximum ? 1 : (float)(selection - minimum) / (maximum - thumb - minimum);
-    float knob = minimum is maximum ? 1 : (float)(thumb - minimum) / (maximum - minimum);
+    float fraction = minimum is maximum ? 1 : cast(float)(selection - minimum) / (maximum - thumb - minimum);
+    float knob = minimum is maximum ? 1 : cast(float)(thumb - minimum) / (maximum - minimum);
     widget.setFloatValue(fraction, knob);
 }
 
--- a/dwt/widgets/Spinner.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Spinner.d	Wed Aug 27 14:30:35 2008 +0200
@@ -203,7 +203,7 @@
     char [] chars = new char [length];
     string.getChars (0, length, chars, 0);
     NSString nsString = NSString.stringWithCharacters (chars, length);
-    NSAttributedString str = ((NSAttributedString) new NSAttributedString ().alloc ()).initWithString_attributes_ (nsString, dict);
+    NSAttributedString str = (cast(NSAttributedString) new NSAttributedString ().alloc ()).initWithString_attributes_ (nsString, dict);
     NSSize size = str.size ();
     str.release ();
     width = size.width;
@@ -222,7 +222,7 @@
     height = Math.max (height, newRect.height);
     if (wHint !is DWT.DEFAULT) width = wHint;
     if (hHint !is DWT.DEFAULT) height = hHint;
-    Rectangle trim = computeTrim (0, 0, (int) width, (int) height);
+    Rectangle trim = computeTrim (0, 0, cast(int) width, cast(int) height);
     return new Point (trim.width, trim.height);
 }
 
@@ -240,11 +240,11 @@
 public void copy () {
     checkWidget ();
 //  short [] selection = new short [2];
-//  if (OS.GetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
+//  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
 //  if (selection [0] is selection [1]) return;
 //  int [] actualSize = new int [1];
 //  int [] ptr = new int [1];
-//  if (OS.GetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextCFStringTag, 4, ptr, actualSize) !is OS.noErr) return;
+//  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextCFStringTag, 4, ptr, actualSize) !is OS.noErr) return;
 //  CFRange range = new CFRange ();
 //  range.location = selection [0];
 //  range.length = selection [1] - selection [0];
@@ -255,17 +255,17 @@
 }
 
 void createHandle () {
-    SWTView widget = (SWTView)new SWTView().alloc();
+    SWTView widget = cast(SWTView)new SWTView().alloc();
     widget.initWithFrame(new NSRect());
 //  widget.setDrawsBackground(false);
     widget.setTag(jniRef);
-    NSStepper buttonWidget = (NSStepper)new SWTStepper().alloc();
+    NSStepper buttonWidget = cast(NSStepper)new SWTStepper().alloc();
     buttonWidget.initWithFrame(new NSRect());
     buttonWidget.setValueWraps((style & DWT.WRAP) !is 0);
     buttonWidget.setTarget(buttonWidget);
     buttonWidget.setAction(OS.sel_sendSelection);
     buttonWidget.setTag(jniRef);
-    NSTextField textWidget = (NSTextField)new SWTTextField().alloc();
+    NSTextField textWidget = cast(NSTextField)new SWTTextField().alloc();
     textWidget.initWithFrame(new NSRect());
 //  textWidget.setTarget(widget);
     textWidget.setTag(jniRef);
@@ -295,7 +295,7 @@
     checkWidget ();
     if ((style & DWT.READ_ONLY) !is 0) return;
 //  short [] selection = new short [2];
-//  if (OS.GetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
+//  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
 //  if (selection [0] is selection [1]) return;
 //  char [] buffer = setText ("", selection [0], selection [1], true);
 //  if (buffer !is null) {
@@ -336,7 +336,7 @@
  */
 public int getIncrement () {
     checkWidget ();
-    return (int)buttonView.increment();
+    return cast(int)buttonView.increment();
 }
 
 /**
@@ -351,7 +351,7 @@
  */
 public int getMaximum () {
     checkWidget ();
-    return (int)buttonView.maxValue();
+    return cast(int)buttonView.maxValue();
 }
 
 /**
@@ -366,7 +366,7 @@
  */
 public int getMinimum () {
     checkWidget ();
-    return (int)buttonView.minValue();
+    return cast(int)buttonView.minValue();
 }
 
 /**
@@ -397,7 +397,7 @@
  */
 public int getSelection () {
     checkWidget ();
-    return (int)((NSStepper)buttonView).doubleValue();
+    return cast(int)(cast(NSStepper)buttonView).doubleValue();
 }
 
 int getSelectionText () {
@@ -421,7 +421,7 @@
     if ((style & DWT.READ_ONLY) !is 0) return;
 //  String text = getClipboardText ();
 //  short [] selection = new short [2];
-//  if (OS.GetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
+//  if (OS.GetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) !is OS.noErr) return;
 //  setText (text, selection [0], selection [1], true);
 }
 
@@ -667,7 +667,7 @@
 
 void setSelection (int value, bool setPos, bool setText, bool notify) {
     if (setPos) {
-        ((NSStepper)buttonView).setDoubleValue(value);
+        (cast(NSStepper)buttonView).setDoubleValue(value);
     }
     if (setText) {
         String string = String.valueOf (value);
@@ -694,8 +694,8 @@
             if (string is null) return;
         }
         cell.setTitle(NSString.stringWith(string));
-//      short [] selection = new short [] {0, (short)string.length ()};
-//      OS.SetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection);
+//      short [] selection = new short [] {0, cast(short)string.length ()};
+//      OS.SetControlData (textHandle, cast(short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection);
         sendEvent (DWT.Modify);
     }
     if (notify) postEvent (DWT.Selection);
--- a/dwt/widgets/TabFolder.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TabFolder.d	Wed Aug 27 14:30:35 2008 +0200
@@ -140,8 +140,8 @@
 public Point computeSize (int wHint, int hHint, bool changed) {
     Point size = super.computeSize (wHint, hHint, changed);
     if (wHint is DWT.DEFAULT && items.length > 0) {
-        NSSize mimSize = ((NSTabView)view).minimumSize();
-        Rectangle trim = computeTrim (0, 0, (int)mimSize.width, 0);
+        NSSize mimSize = (cast(NSTabView)view).minimumSize();
+        Rectangle trim = computeTrim (0, 0, cast(int)mimSize.width, 0);
         size.x = Math.max (trim.width, size.x);
     }
     return size;
@@ -166,8 +166,8 @@
 //  }
 //  x -= client.left;
 //  y -= client.top;
-//  width += (int) bounds.width - (client.right - client.left);
-//  height += (int) bounds.height - (client.bottom - client.top);
+//  width += cast(int) bounds.width - (client.right - client.left);
+//  height += cast(int) bounds.height - (client.bottom - client.top);
 //  Rect inset = getInset ();
 //  x -= inset.left;
 //  y -= inset.top;
@@ -178,7 +178,7 @@
 }
 
 void createHandle () {
-    SWTTabView widget = (SWTTabView)new SWTTabView().alloc();
+    SWTTabView widget = cast(SWTTabView)new SWTTabView().alloc();
     widget.initWithFrame (new NSRect());
     widget.setTag(jniRef);
     widget.setDelegate(widget);
@@ -200,9 +200,9 @@
     System.arraycopy (items, index, items, index + 1, count - index);
     items [index] = item;
     itemCount++;
-    NSTabViewItem nsItem = (NSTabViewItem)new NSTabViewItem().alloc().init();
+    NSTabViewItem nsItem = cast(NSTabViewItem)new NSTabViewItem().alloc().init();
     item.nsItem = nsItem;
-    ((NSTabView)view).insertTabViewItem(nsItem, index);
+    (cast(NSTabView)view).insertTabViewItem(nsItem, index);
 }
 
 void createWidget () {
@@ -225,16 +225,16 @@
         items = new TabItem [4];
     }
     itemCount = count;
-    ((NSTabView)view).removeTabViewItem(item.nsItem);
+    (cast(NSTabView)view).removeTabViewItem(item.nsItem);
 }
 
 public Rectangle getClientArea () {
     checkWidget ();
-    NSRect rect = ((NSTabView)view).contentRect();
-    int x = Math.max (0, (int)rect.x);
-    int y = Math.max (0, (int)rect.y);
-    int width = Math.max (0, (int)rect.width);
-    int height = Math.max (0, (int)rect.height);
+    NSRect rect = (cast(NSTabView)view).contentRect();
+    int x = Math.max (0, cast(int)rect.x);
+    int y = Math.max (0, cast(int)rect.y);
+    int width = Math.max (0, cast(int)rect.width);
+    int height = Math.max (0, cast(int)rect.height);
     return new Rectangle (x, y, width, height);
 }
 
@@ -266,7 +266,7 @@
     NSPoint nsPoint = new NSPoint ();
     nsPoint.x = point.x;
     nsPoint.y = point.y;
-    NSTabView tabView = (NSTabView) view;
+    NSTabView tabView = cast(NSTabView) view;
     NSTabViewItem tabViewItem = tabView.tabViewItemAtPoint (nsPoint);
     for (int i = 0; i < itemCount; i++) {
         NSTabViewItem item = items[i].nsItem;
@@ -352,7 +352,7 @@
  */
 public int getSelectionIndex () {
     checkWidget ();
-    NSTabViewItem selected =  ((NSTabView)view).selectedTabViewItem();
+    NSTabViewItem selected =  (cast(NSTabView)view).selectedTabViewItem();
     if (selected is null) return -1;
     for (int i = 0; i < itemCount; i++) {
         if (items[i].nsItem.id is selected.id) return i;
@@ -474,7 +474,7 @@
 }
 
 void setFont (NSFont font) {
-    ((NSTabView)view).setFont(font);
+    (cast(NSTabView)view).setFont(font);
 }
 
 /**
@@ -561,7 +561,7 @@
             }
         }
     }
-    ((NSTabView)view).selectTabViewItemAtIndex(index);
+    (cast(NSTabView)view).selectTabViewItemAtIndex(index);
     index = getSelectionIndex();
     if (index !is -1) {
         TabItem item = items [index];
--- a/dwt/widgets/TabItem.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TabItem.d	Wed Aug 27 14:30:35 2008 +0200
@@ -152,12 +152,12 @@
         pt.y = window.screen ().frame ().height - pt.y;
         pt = parent.view.convertPoint_fromView_ (pt, null);
         pt = window.convertScreenToBase (pt);
-        result.x = (int) pt.x;
-        result.y = (int) pt.y;
+        result.x = cast(int) pt.x;
+        result.y = cast(int) pt.y;
         val = new NSValue (sizeValue);
         NSSize size = val.sizeValue ();
-        result.width = (int) size.width;
-        result.height = (int) size.height;
+        result.width = cast(int) size.width;
+        result.height = cast(int) size.height;
     }
     return result;
 }
--- a/dwt/widgets/Table.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Table.d	Wed Aug 27 14:30:35 2008 +0200
@@ -60,7 +60,7 @@
  *  table.setItemCount (1000000);
  *  table.addListener (DWT.SetData, new Listener () {
  *      public void handleEvent (Event event) {
- *          TableItem item = (TableItem) event.item;
+ *          TableItem item = cast(TableItem) event.item;
  *          int index = table.indexOf (item);
  *          item.setText ("Item " + index);
  *          System.out.println (item.getText ());
@@ -386,7 +386,7 @@
 
 void createHandle () {
     //TODO - DWT.CHECK  
-    SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+    SWTScrollView scrollWidget = cast(SWTScrollView)new SWTScrollView().alloc();
     scrollWidget.initWithFrame(new NSRect ());
     scrollWidget.setHasHorizontalScroller(true);
     scrollWidget.setHasVerticalScroller(true);
@@ -394,7 +394,7 @@
     scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder);
     scrollWidget.setTag(jniRef);
     
-    NSTableView widget = (NSTableView)new SWTTableView().alloc();
+    NSTableView widget = cast(NSTableView)new SWTTableView().alloc();
     widget.initWithFrame(new NSRect());
     widget.setAllowsMultipleSelection((style & DWT.MULTI) !is 0);
     widget.setDataSource(widget);
@@ -409,11 +409,11 @@
     
     NSString str = NSString.stringWith("");
     if ((style & DWT.CHECK) !is 0) {
-        checkColumn = (NSTableColumn)new NSTableColumn().alloc();
+        checkColumn = cast(NSTableColumn)new NSTableColumn().alloc();
         checkColumn.initWithIdentifier(str);
         checkColumn.headerCell().setTitle(str);
         widget.addTableColumn (checkColumn);
-        NSButtonCell cell = (NSButtonCell)new NSButtonCell().alloc().init();
+        NSButtonCell cell = cast(NSButtonCell)new NSButtonCell().alloc().init();
         checkColumn.setDataCell(cell);
         cell.setButtonType(OS.NSSwitchButton);
         cell.setImagePosition(OS.NSImageOnly);
@@ -424,10 +424,10 @@
         checkColumn.setEditable(false);
     }
 
-    firstColumn = (NSTableColumn)new NSTableColumn().alloc();
+    firstColumn = cast(NSTableColumn)new NSTableColumn().alloc();
     firstColumn.initWithIdentifier(str);
     //column.setResizingMask(OS.NSTableColumnAutoresizingMask);
-    NSCell cell = (NSBrowserCell)new NSBrowserCell().alloc().init();
+    NSCell cell = cast(NSBrowserCell)new NSBrowserCell().alloc().init();
     firstColumn.setDataCell(cell);
     cell.release();
     widget.addTableColumn (firstColumn);
@@ -452,12 +452,12 @@
         firstColumn = null;
     } else {
         //TODO - set attributes, alignment etc.
-        nsColumn = (NSTableColumn)new NSTableColumn().alloc();
+        nsColumn = cast(NSTableColumn)new NSTableColumn().alloc();
         nsColumn.initWithIdentifier(NSString.stringWith(""));
-        ((NSTableView)view).addTableColumn (nsColumn);
+        (cast(NSTableView)view).addTableColumn (nsColumn);
         int checkColumn = (style & DWT.CHECK) !is 0 ? 1 : 0;
-        ((NSTableView)view).moveColumn (columnCount + checkColumn, index + checkColumn);
-        NSCell cell = (NSBrowserCell)new NSBrowserCell().alloc().init();
+        (cast(NSTableView)view).moveColumn (columnCount + checkColumn, index + checkColumn);
+        NSCell cell = cast(NSBrowserCell)new NSBrowserCell().alloc().init();
         nsColumn.setDataCell(cell);
         cell.release();
     }
@@ -525,7 +525,7 @@
     System.arraycopy (items, index, items, index + 1, itemCount++ - index);
     items [index] = item;
     //TODO - use noteNumberOfRowsChanged?
-    ((NSTableView)view).reloadData();
+    (cast(NSTableView)view).reloadData();
 }
 
 void createWidget () {
@@ -557,7 +557,7 @@
 public void deselect (int index) {
     checkWidget();
     if (0 <= index && index < itemCount) {
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
         widget.deselectRow (index);
         ignoreSelect = false;
@@ -586,7 +586,7 @@
         deselectAll ();
     } else {
         int length = end - start + 1;
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
         for (int i=0; i<length; i++) {
             widget.deselectRow (i);
@@ -615,7 +615,7 @@
 public void deselect (int [] indices) {
     checkWidget();
     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     for (int i=0; i<indices.length; i++) {
         widget.deselectRow (indices [i]);
@@ -633,7 +633,7 @@
  */
 public void deselectAll () {
     checkWidget ();
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     widget.deselectAll(null);
     ignoreSelect = false;
@@ -706,7 +706,7 @@
         firstColumn = column.nsColumn;
         firstColumn.setWidth (0);
     } else {
-        ((NSTableView)view).removeTableColumn(column.nsColumn);
+        (cast(NSTableView)view).removeTableColumn(column.nsColumn);
     }
     System.arraycopy (columns, index + 1, columns, index, --columnCount - index);
     columns [columnCount] = null;
@@ -724,7 +724,7 @@
     if (index !is itemCount - 1) fixSelection (index, false); 
     System.arraycopy (items, index + 1, items, index, --itemCount - index);
     items [itemCount] = null;
-    ((NSTableView)view).noteNumberOfRowsChanged();
+    (cast(NSTableView)view).noteNumberOfRowsChanged();
     if (itemCount is 0) {
         setTableEmpty ();
     } else {
@@ -912,9 +912,9 @@
  */
 public int getHeaderHeight () {
     checkWidget ();
-    NSTableHeaderView headerView = ((NSTableView)view).headerView();
+    NSTableHeaderView headerView = (cast(NSTableView)view).headerView();
     if (headerView is null) return 0;
-    return (int)headerView.bounds().height;
+    return cast(int)headerView.bounds().height;
 }
 
 /**
@@ -936,7 +936,7 @@
  */
 public bool getHeaderVisible () {
     checkWidget ();
-    return ((NSTableView)view).headerView() !is null;
+    return (cast(NSTableView)view).headerView() !is null;
 }
 
 int getInsetWidth () {
@@ -994,7 +994,7 @@
 //  if (point is null) error (DWT.ERROR_NULL_ARGUMENT);
 //  Rect rect = new Rect ();
 //  dwt.internal.carbon.Point pt = new dwt.internal.carbon.Point ();
-//  OS.SetPt (pt, (short) point.x, (short) point.y);
+//  OS.SetPt (pt, cast(short) point.x, cast(short) point.y);
 //  if (0 < lastHittest && lastHittest <= itemCount && lastHittestColumn !is 0) {
 //      if (OS.GetDataBrowserItemPartBounds (handle, lastHittest, lastHittestColumn, OS.kDataBrowserPropertyEnclosingPart, rect) is OS.noErr) {
 //          if (rect.top <= pt.v && pt.v <= rect.bottom) {
@@ -1099,7 +1099,7 @@
  */
 public int getItemHeight () {
     checkWidget ();
-    return (int)((NSTableView)view).rowHeight();
+    return cast(int)(cast(NSTableView)view).rowHeight();
 }
 
 /**
@@ -1176,7 +1176,7 @@
  */
 public TableItem [] getSelection () {
     checkWidget ();
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     if (widget.numberOfSelectedRows() is 0) {
         return new TableItem [0];
     }
@@ -1203,7 +1203,7 @@
  */
 public int getSelectionCount () {
     checkWidget ();
-    return ((NSTableView)view).numberOfSelectedRows();
+    return (cast(NSTableView)view).numberOfSelectedRows();
 }
 
 /**
@@ -1220,7 +1220,7 @@
 public int getSelectionIndex () {
     checkWidget();
     //TODO - check empty selection case
-    return ((NSTableView)view).selectedRow();
+    return (cast(NSTableView)view).selectedRow();
 }
 
 /**
@@ -1241,7 +1241,7 @@
  */
 public int [] getSelectionIndices () {
     checkWidget ();
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     if (widget.numberOfSelectedRows() is 0) {
         return new int [0];
     }
@@ -1313,7 +1313,7 @@
     NSPoint point = new NSPoint();
     point.x = rect.x;
     point.y = rect.y;
-    return ((NSTableView)view).rowAtPoint(point);
+    return (cast(NSTableView)view).rowAtPoint(point);
 }
 
 
@@ -1396,7 +1396,7 @@
 public bool isSelected (int index) {
     checkWidget();
     //TODO - range check
-    return ((NSTableView)view).isRowSelected(index);
+    return (cast(NSTableView)view).isRowSelected(index);
 }
 
 int numberOfRowsInTableView(int aTableView) {
@@ -1463,7 +1463,7 @@
     if (index !is itemCount - 1) fixSelection (index, false);
     System.arraycopy (items, index + 1, items, index, --itemCount - index);
     items [itemCount] = null;
-    ((NSTableView)view).noteNumberOfRowsChanged();
+    (cast(NSTableView)view).noteNumberOfRowsChanged();
     if (itemCount is 0) {
         setTableEmpty ();
     } else {
@@ -1552,7 +1552,7 @@
         if (item !is null && !item.isDisposed ()) item.release (false);
     }
     setTableEmpty ();
-    ((NSTableView)view).noteNumberOfRowsChanged();
+    (cast(NSTableView)view).noteNumberOfRowsChanged();
 }
 
 /**
@@ -1595,11 +1595,11 @@
 public void select (int index) {
     checkWidget();
     if (0 <= index && index < itemCount) {
-        NSIndexSet indexes = (NSIndexSet)new NSIndexSet().alloc();
+        NSIndexSet indexes = cast(NSIndexSet)new NSIndexSet().alloc();
         indexes.initWithIndex(index);
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
-        ((NSTableView)view).selectRowIndexes(indexes, true);
+        (cast(NSTableView)view).selectRowIndexes(indexes, true);
         ignoreSelect = false;
     }
 }
@@ -1637,12 +1637,12 @@
         start = Math.max (0, start);
         end = Math.min (end, itemCount - 1);
         int length = end - start + 1;
-        NSIndexSet indexes = (NSIndexSet)new NSIndexSet().alloc();
+        NSIndexSet indexes = cast(NSIndexSet)new NSIndexSet().alloc();
         NSRange range = new NSRange();
         range.location = start;
         range.length = length;
         indexes.initWithIndexesInRange(range);
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
         widget.selectRowIndexes(indexes, true);
         ignoreSelect = false;
@@ -1678,7 +1678,7 @@
     int length = indices.length;
     if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return;
     int count = 0;
-    NSMutableIndexSet indexes = (NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
+    NSMutableIndexSet indexes = cast(NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
     for (int i=0; i<length; i++) {
         int index = indices [length - i - 1];
         if (index >= 0 && index < itemCount) {
@@ -1687,7 +1687,7 @@
         }
     }
     if (count > 0) {
-        NSTableView widget = (NSTableView)view;
+        NSTableView widget = cast(NSTableView)view;
         ignoreSelect = true;
         widget.selectRowIndexes(indexes, true);
         ignoreSelect = false;
@@ -1695,9 +1695,9 @@
 }
 
 void select (int [] ids, int count, bool clear) {
-    NSMutableIndexSet indexes = (NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
+    NSMutableIndexSet indexes = cast(NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
     for (int i=0; i<count; i++) indexes.addIndex (ids [i] - 1); //WRONG -1
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     widget.selectRowIndexes(indexes, !clear);
     ignoreSelect = false;
@@ -1717,7 +1717,7 @@
 public void selectAll () {
     checkWidget ();
     if ((style & DWT.SINGLE) !is 0) return;
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     widget.selectAll(null);
     ignoreSelect = false;
@@ -1819,7 +1819,7 @@
  */
 public void setHeaderVisible (bool show) {
     checkWidget ();
-    ((NSTableView)view).setHeaderView (show ? headerView : null);
+    (cast(NSTableView)view).setHeaderView (show ? headerView : null);
 }
 
 /**
@@ -1887,7 +1887,7 @@
     if (itemHeight is -1) {
         //TODO - reset item height, ensure other API's such as setFont don't do this
     } else {
-//      OS.SetDataBrowserTableViewRowHeight (handle, (short) itemHeight);
+//      OS.SetDataBrowserTableViewRowHeight (handle, cast(short) itemHeight);
     }
 }
 
@@ -1909,7 +1909,7 @@
  */
 public void setLinesVisible (bool show) {
     checkWidget ();
-    ((NSTableView)view).setUsesAlternatingRowBackgroundColors(show);
+    (cast(NSTableView)view).setUsesAlternatingRowBackgroundColors(show);
 }
 
 bool setScrollWidth (TableItem item) {
@@ -1926,7 +1926,7 @@
 //  short [] width = new short [1];
 //  OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
 //  if (width [0] < newWidth) {
-//      OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, (short) newWidth);
+//      OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, cast(short) newWidth);
 //      return true;
 //  }
     if (firstColumn.width() < newWidth) {
@@ -1957,7 +1957,7 @@
 //      OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
 //      if (width [0] >= newWidth) return false;
 //  }
-//  OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, (short) newWidth);
+//  OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, cast(short) newWidth);
     if (!set) {
         if (firstColumn.width() > newWidth) return false;
     }
@@ -2164,7 +2164,7 @@
 //  OS.SetDataBrowserCallbacks (handle, callbacks);
 //  if (column is null) {
 //      if (sortColumn !is null  && !sortColumn.isDisposed ()  && sortDirection !is DWT.NONE) {
-//          OS.SetDataBrowserSortOrder (handle, (short) OS.kDataBrowserOrderIncreasing);
+//          OS.SetDataBrowserSortOrder (handle, cast(short) OS.kDataBrowserOrderIncreasing);
 //          sortColumn = null; 
 //          OS.SetDataBrowserSortProperty (handle, 0);
 //      }
@@ -2173,7 +2173,7 @@
 //  if (sortColumn !is null  && !sortColumn.isDisposed () && sortDirection !is DWT.NONE) {
 //      OS.SetDataBrowserSortProperty (handle, sortColumn.id);
 //      int order = sortDirection is DWT.DOWN ? OS.kDataBrowserOrderDecreasing : OS.kDataBrowserOrderIncreasing;
-//      OS.SetDataBrowserSortOrder (handle, (short) order);
+//      OS.SetDataBrowserSortOrder (handle, cast(short) order);
 //  }
 //  callbacks.v1_itemCompareCallback = itemCompareProc ();
 //  OS.SetDataBrowserCallbacks (handle, callbacks);
@@ -2203,7 +2203,7 @@
 //  OS.SetDataBrowserCallbacks (handle, callbacks);
 //  if (sortColumn !is null && !sortColumn.isDisposed ()) {
 //      if (sortDirection is DWT.NONE) {
-//          OS.SetDataBrowserSortOrder (handle, (short) OS.kDataBrowserOrderIncreasing);
+//          OS.SetDataBrowserSortOrder (handle, cast(short) OS.kDataBrowserOrderIncreasing);
 //          TableColumn column = sortColumn;
 //          sortColumn = null; 
 //          OS.SetDataBrowserSortProperty (handle, 0);
@@ -2212,7 +2212,7 @@
 //          OS.SetDataBrowserSortProperty (handle, 0);
 //          OS.SetDataBrowserSortProperty (handle, sortColumn.id);
 //          int order = sortDirection is DWT.DOWN ? OS.kDataBrowserOrderDecreasing : OS.kDataBrowserOrderIncreasing;
-//          OS.SetDataBrowserSortOrder (handle, (short) order);
+//          OS.SetDataBrowserSortOrder (handle, cast(short) order);
 //      }
 //  }
 //  callbacks.v1_itemCompareCallback = itemCompareProc ();
@@ -2238,8 +2238,8 @@
  */
 public void setTopIndex (int index) {
     checkWidget();
-    NSRect rect = ((NSTableView)view).rectOfRow(index);
-    ((NSTableView)view).scrollRectToVisible(rect);
+    NSRect rect = (cast(NSTableView)view).rectOfRow(index);
+    (cast(NSTableView)view).scrollRectToVisible(rect);
 }
 
 /**
@@ -2267,12 +2267,12 @@
     if (column.parent !is this) return;
     int index = indexOf (column);
     if (columnCount <= 1 || !(0 <= index && index < columnCount)) return;
-    ((NSTableView)view).scrollColumnToVisible(index + ((style & DWT.CHECK) !is 0 ? 1 : 0));
+    (cast(NSTableView)view).scrollColumnToVisible(index + ((style & DWT.CHECK) !is 0 ? 1 : 0));
 }
 
 void showIndex (int index) {
     if (0 <= index && index < itemCount) {
-        ((NSTableView)view).scrollRowToVisible(index);
+        (cast(NSTableView)view).scrollRowToVisible(index);
     }
 }
 
@@ -2326,7 +2326,7 @@
 
 void tableViewSelectionDidChange (int aNotification) {
     if (ignoreSelect) return;
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     int row = widget.selectedRow();
     if(row is -1)
         postEvent(DWT.Selection);
--- a/dwt/widgets/TableColumn.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TableColumn.d	Wed Aug 27 14:30:35 2008 +0200
@@ -307,7 +307,7 @@
  */
 public int getWidth () {
     checkWidget ();
-    return (int)nsColumn.width();
+    return cast(int)nsColumn.width();
 }
 
 /**
--- a/dwt/widgets/TableItem.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TableItem.d	Wed Aug 27 14:30:35 2008 +0200
@@ -153,7 +153,7 @@
 //      parent.sendEvent (DWT.MeasureItem, event);
 //      if (parent.itemHeight < event.height) {
 //          parent.itemHeight = event.height;
-//          OS.SetDataBrowserTableViewRowHeight (parent.handle, (short) event.height);
+//          OS.SetDataBrowserTableViewRowHeight (parent.handle, cast(short) event.height);
 //      }
 //      width = event.width;
 //  }
@@ -204,7 +204,7 @@
     char[] chars = new char[length];
     text.getChars(0, length, chars, 0);
     NSString str = NSString.stringWithCharacters(chars, length);
-    NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+    NSAttributedString attribStr = (cast(NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
     attribStr.autorelease();
     return attribStr;
 }
@@ -270,10 +270,10 @@
 public Rectangle getBounds () {
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
-    NSTableView tableView = (NSTableView) parent.view;
+    NSTableView tableView = cast(NSTableView) parent.view;
     NSRect rect = tableView.rectOfRow (parent.indexOf (this));
     rect = tableView.convertRect_toView_ (rect, parent.scrollView);
-    Rectangle result = new Rectangle((int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height);
+    Rectangle result = new Rectangle(cast(int) rect.x, cast(int) rect.y, cast(int) rect.width, cast(int) rect.height);
     return result;
 }
 
@@ -292,11 +292,11 @@
 public Rectangle getBounds (int index) {
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
-    NSTableView tableView = (NSTableView) parent.view;
+    NSTableView tableView = cast(NSTableView) parent.view;
     if ((parent.style & DWT.CHECK) !is 0) index ++;
     NSRect rect = tableView.frameOfCellAtColumn (index, parent.indexOf (this));
     rect = tableView.convertRect_toView_ (rect, parent.scrollView);
-    Rectangle result = new Rectangle((int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height);
+    Rectangle result = new Rectangle(cast(int) rect.x, cast(int) rect.y, cast(int) rect.width, cast(int) rect.height);
     return result;
 }
 
@@ -619,8 +619,8 @@
 
 void redraw () {
 //  0[aTableView setNeedsDisplayInRect:[aTableView rectOfRow:row]];
-    ((NSTableView)parent.view).reloadData();
-    ((NSTableView)parent.view).tile();
+    (cast(NSTableView)parent.view).reloadData();
+    (cast(NSTableView)parent.view).tile();
 }
 
 void releaseHandle () {
@@ -670,7 +670,7 @@
     background = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -709,7 +709,7 @@
     cellBackground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -731,7 +731,7 @@
     if (this.checked is checked) return;
     this.checked = checked;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -763,7 +763,7 @@
     this.font = font;
     if (oldFont !is null && oldFont.equals (font)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -803,7 +803,7 @@
     cellFont [index] = font;
     if (oldFont !is null && oldFont.equals (font)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -835,7 +835,7 @@
     foreground = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -874,7 +874,7 @@
     cellForeground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -896,7 +896,7 @@
     if (this.grayed is grayed) return;
     this.grayed = grayed;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -964,7 +964,7 @@
     }
 //  cached = true;
 //  if (index is 0) parent.setScrollWidth (this);
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -1046,7 +1046,7 @@
     }
     cached = true;
     if (index is 0) parent.setScrollWidth (this);
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
--- a/dwt/widgets/Text.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Text.d	Wed Aug 27 14:30:35 2008 +0200
@@ -251,9 +251,9 @@
     }
     NSString str = NSString.stringWith(string);
     if ((style & DWT.SINGLE) !is 0) {
-//      new NSTextFieldCell(((NSTextField)view).cell()).title().
+//      new NSTextFieldCell((cast(NSTextField)view).cell()).title().
     } else {
-        NSTextView widget = (NSTextView)view;
+        NSTextView widget = cast(NSTextView)view;
         NSMutableString mutableString = widget.textStorage().mutableString();
         mutableString.appendString(str);
         NSRange range = new NSRange();
@@ -301,21 +301,21 @@
     checkWidget();
     int width = 0, height = 0;
     if ((style & DWT.SINGLE) !is 0) {
-        NSTextField widget = (NSTextField)view;
+        NSTextField widget = cast(NSTextField)view;
         NSRect oldRect = widget.frame();
         widget.sizeToFit();
         NSRect newRect = widget.frame();
         widget.setFrame (oldRect);
-        width = (int)newRect.width;
-        height = (int)newRect.height;
+        width = cast(int)newRect.width;
+        height = cast(int)newRect.height;
     } else {
-        NSTextView widget = (NSTextView)view;
+        NSTextView widget = cast(NSTextView)view;
         NSRect oldRect = widget.frame();
         widget.sizeToFit();
         NSRect newRect = widget.frame();
         widget.setFrame (oldRect);
-        width = (int)newRect.width;
-        height = (int)newRect.height;
+        width = cast(int)newRect.width;
+        height = cast(int)newRect.height;
     }
     if (width <= 0) width = DEFAULT_WIDTH;
     if (height <= 0) height = DEFAULT_HEIGHT;
@@ -343,7 +343,7 @@
     if ((style & DWT.SINGLE) !is 0) {
         
     } else {
-        ((NSTextView)view).copy();
+        (cast(NSTextView)view).copy();
     }
 }
 
@@ -351,11 +351,11 @@
     if ((style & DWT.SINGLE) !is 0) {
         NSTextField widget;
         if ((style & DWT.PASSWORD) !is 0) {
-            widget = (NSTextField)new NSSecureTextField().alloc();
+            widget = cast(NSTextField)new NSSecureTextField().alloc();
         } else if ((style & DWT.SEARCH) !is 0) {
-            widget = (NSTextField)new NSSearchField().alloc();
+            widget = cast(NSTextField)new NSSearchField().alloc();
         } else {
-            widget = (NSTextField)new SWTTextField().alloc();
+            widget = cast(NSTextField)new SWTTextField().alloc();
         }
         widget.initWithFrame(new NSRect());
         widget.setSelectable(true);
@@ -371,14 +371,14 @@
         view = widget;
         parent.contentView().addSubview_(widget);
     } else {
-        SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+        SWTScrollView scrollWidget = cast(SWTScrollView)new SWTScrollView().alloc();
         scrollWidget.initWithFrame(new NSRect());
         scrollWidget.setHasVerticalScroller((style & DWT.VERTICAL) !is 0);
         scrollWidget.setHasHorizontalScroller((style & DWT.HORIZONTAL) !is 0);
         scrollWidget.setAutoresizesSubviews(true);
         scrollWidget.setTag(jniRef);
         
-        SWTTextView widget = (SWTTextView)new SWTTextView().alloc();
+        SWTTextView widget = cast(SWTTextView)new SWTTextView().alloc();
         widget.initWithFrame(new NSRect());
         widget.setEditable((style & DWT.READ_ONLY) is 0);
         if ((style & DWT.BORDER) is 0) widget.setFocusRingType(OS.NSFocusRingTypeNone);
@@ -437,7 +437,7 @@
     if ((style & DWT.SINGLE) !is 0) {
         
     } else {
-        ((NSTextView)view).cut(null);
+        (cast(NSTextView)view).cut(null);
     }
 //  bool cut = true;
 //  char [] oldText = null;
@@ -543,7 +543,7 @@
         return new Point (0, 0);
     }
 //  NSText
-    NSRange range = ((NSTextView)view).selectedRange();
+    NSRange range = (cast(NSTextView)view).selectedRange();
     System.out.println(range.location + " " + range.length);
     return null;
 }
@@ -567,7 +567,7 @@
         //TODO
         return 0;
     } else {
-        NSRange range = ((NSTextView)view).selectedRange();
+        NSRange range = (cast(NSTextView)view).selectedRange();
         return range.location;
     }
 }
@@ -585,7 +585,7 @@
 public int getCharCount () {
     checkWidget ();
     if ((style & DWT.SINGLE) !is 0) {
-        return new NSCell(((NSControl)view).cell()).title().length();
+        return new NSCell((cast(NSControl)view).cell()).title().length();
     } else {
         //TODO
         return 0;
@@ -662,7 +662,7 @@
 public int getLineCount () {
     checkWidget();
     if ((style & DWT.SINGLE) !is 0) return 1;
-    return ((NSTextView)view).textStorage().paragraphs().count();
+    return (cast(NSTextView)view).textStorage().paragraphs().count();
 }
 
 /**
@@ -773,10 +773,10 @@
 public Point getSelection () {
     checkWidget();
     if ((style & DWT.SINGLE) !is 0) {
-//      new NSTextFieldCell(((NSTextField)view).cell()).title().
+//      new NSTextFieldCell((cast(NSTextField)view).cell()).title().
         return new Point(0, 0);
     } else {
-        NSTextView widget = (NSTextView)view;
+        NSTextView widget = cast(NSTextView)view;
         NSRange range = widget.selectedRange();
         return new Point(range.location, range.location + range.length);
     }
@@ -795,10 +795,10 @@
 public int getSelectionCount () {
     checkWidget();
     if ((style & DWT.SINGLE) !is 0) {
-//      new NSTextFieldCell(((NSTextField)view).cell()).title().
+//      new NSTextFieldCell((cast(NSTextField)view).cell()).title().
         return -1;
     } else {
-        NSTextView widget = (NSTextView)view;
+        NSTextView widget = cast(NSTextView)view;
         NSRange range = widget.selectedRange();
         return range.length;
     }
@@ -820,7 +820,7 @@
         //TODO
         return "";
     } else {
-        NSTextView widget = (NSTextView)view;
+        NSTextView widget = cast(NSTextView)view;
         NSRange range = widget.selectedRange();
         NSString str = widget.textStorage().string();
         char[] buffer = new char[range.length];
@@ -867,9 +867,9 @@
     checkWidget();
     NSString str;
     if ((style & DWT.SINGLE) !is 0) {
-        str = new NSTextFieldCell(((NSTextField)view).cell()).title();
+        str = new NSTextFieldCell((cast(NSTextField)view).cell()).title();
     } else {
-        str = ((NSTextView)view).textStorage().string();
+        str = (cast(NSTextView)view).textStorage().string();
     }
     if (str is null) return "";
     char[] buffer = new char[str.length()];
@@ -899,7 +899,7 @@
     checkWidget ();
     NSString str;
     if ((style & DWT.SINGLE) !is 0) {
-        str = new NSTextFieldCell(((NSTextField)view).cell()).title();
+        str = new NSTextFieldCell((cast(NSTextField)view).cell()).title();
          
     } else {
         str = null;
@@ -1004,11 +1004,11 @@
         if (string is null) return;
     }
     if ((style & DWT.SINGLE) !is 0) {
-//      new NSTextFieldCell(((NSTextField)view).cell()).title().
+//      new NSTextFieldCell((cast(NSTextField)view).cell()).title().
     } else {
         //
         NSString str = NSString.stringWith(string);
-        NSTextView widget = (NSTextView)view;
+        NSTextView widget = cast(NSTextView)view;
         NSRange range = widget.selectedRange();
         widget.textStorage().replaceCharactersInRange_withString_(range, str);
     }
@@ -1157,7 +1157,7 @@
     if ((style & DWT.SINGLE) !is 0) {
         setSelection (0, getCharCount ());
     } else {
-        ((NSTextView)view).selectAll(null);
+        (cast(NSTextView)view).selectAll(null);
     }
 }
 
@@ -1231,9 +1231,9 @@
         nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1);
     }
     if ((style & DWT.SINGLE) !is 0) {
-        ((NSTextField)view).setBackgroundColor(nsColor);
+        (cast(NSTextField)view).setBackgroundColor(nsColor);
     } else {
-        ((NSTextView)view).setBackgroundColor(nsColor);
+        (cast(NSTextView)view).setBackgroundColor(nsColor);
     }
 }
 
@@ -1316,9 +1316,9 @@
         style |= DWT.READ_ONLY;
     }
     if ((style & DWT.SINGLE) !is 0) {
-        ((NSTextField)view).setEditable(editable);
+        (cast(NSTextField)view).setEditable(editable);
     } else {
-        ((NSTextView)view).setEditable(editable);
+        (cast(NSTextView)view).setEditable(editable);
     }
 }
 
@@ -1330,9 +1330,9 @@
         nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1);
     }
     if ((style & DWT.SINGLE) !is 0) {
-        ((NSTextField)view).setTextColor(nsColor);
+        (cast(NSTextField)view).setTextColor(nsColor);
     } else {
-        ((NSTextView)view).setTextColor_(nsColor);
+        (cast(NSTextView)view).setTextColor_(nsColor);
     }
 }
 
@@ -1451,8 +1451,8 @@
     if ((style & DWT.SINGLE) !is 0) {
 //      int length = getCharCount ();
 //      ControlEditTextSelectionRec selection = new ControlEditTextSelectionRec ();
-//      selection.selStart = (short) Math.min (Math.max (Math.min (start, end), 0), length);
-//      selection.selEnd = (short) Math.min (Math.max (Math.max (start, end), 0), length);
+//      selection.selStart = cast(short) Math.min (Math.max (Math.min (start, end), 0), length);
+//      selection.selEnd = cast(short) Math.min (Math.max (Math.max (start, end), 0), length);
 //      if (hasFocus ()) {
 //          OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection);
 //      } else {
@@ -1463,7 +1463,7 @@
         NSRange range = new NSRange ();
         range.location = start;
         range.length = end - start + 1;
-        ((NSTextView)view).setSelectedRange (range);
+        (cast(NSTextView)view).setSelectedRange (range);
     }
 }
 
@@ -1524,7 +1524,7 @@
 //  if (txnObject is 0) return;
 //  this.tabs = tabs;
 //  TXNTab tab = new TXNTab ();
-//  tab.value = (short) (textExtent (new char[]{' '}, 0).x * tabs);
+//  tab.value = cast(short) (textExtent (new char[]{' '}, 0).x * tabs);
 //  int [] tags = new int [] {OS.kTXNTabSettingsTag};
 //  int [] datas = new int [1];
 //  OS.memmove (datas, tab, TXNTab.sizeof);
@@ -1555,9 +1555,9 @@
     }
     NSString str = NSString.stringWith(string);
     if ((style & DWT.SINGLE) !is 0) {
-        new NSCell(((NSTextField)view).cell()).setTitle(str);
+        new NSCell((cast(NSTextField)view).cell()).setTitle(str);
     } else {
-        ((NSTextView)view).setString(str);
+        (cast(NSTextView)view).setString(str);
     }
     sendEvent (DWT.Modify);
 }
@@ -1608,7 +1608,7 @@
     checkWidget();
     if ((style & DWT.SINGLE) !is 0) return;
     //TODO no working
-    NSTextView widget = (NSTextView)view;
+    NSTextView widget = cast(NSTextView)view;
     NSRange range = new NSRange();
     NSRect rect = widget.firstRectForCharacterRange(range);
     view.scrollRectToVisible(rect);
@@ -1632,7 +1632,7 @@
     if ((style & DWT.SINGLE) !is 0)  {
         setSelection (getSelection());
     } else {
-        NSTextView widget = (NSTextView)view;
+        NSTextView widget = cast(NSTextView)view;
         widget.scrollRangeToVisible(widget.selectedRange());
     }
 }
--- a/dwt/widgets/ToolBar.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/ToolBar.d	Wed Aug 27 14:30:35 2008 +0200
@@ -127,7 +127,7 @@
 }
 
 void createHandle () {
-    SWTView widget = (SWTView)new SWTView().alloc();
+    SWTView widget = cast(SWTView)new SWTView().alloc();
     widget.initWithFrame(new NSRect());
 //  widget.setDrawsBackground(false);
     widget.setTag(jniRef);
@@ -183,7 +183,7 @@
 public Rectangle getClientArea () {
     checkWidget();
     NSRect rect = view.bounds();
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
--- a/dwt/widgets/ToolItem.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/ToolItem.d	Wed Aug 27 14:30:35 2008 +0200
@@ -204,10 +204,10 @@
             height = Math.max (height, control.getMininumHeight ());
         }
     } else {
-        ((NSButton)button).sizeToFit ();
+        (cast(NSButton)button).sizeToFit ();
         NSRect frame = button.frame();
-        width = (int)frame.width + INSET;
-        height = (int)frame.height;
+        width = cast(int)frame.width + INSET;
+        height = cast(int)frame.height;
         if (arrow !is null) {
             width += ARROW_INSET + ARROW_WIDTH;
         }
@@ -219,17 +219,17 @@
 void createWidget() {
     createJNIRef ();
     if ((style & DWT.SEPARATOR) !is 0) {
-        SWTBox widget = (SWTBox)new SWTBox().alloc();
+        SWTBox widget = cast(SWTBox)new SWTBox().alloc();
         widget.initWithFrame(new NSRect());
         widget.setBoxType(OS.NSBoxSeparator);
         widget.setTag(jniRef);
         view = widget;
     } else {
-        SWTView widget = (SWTView)new SWTView().alloc();
+        SWTView widget = cast(SWTView)new SWTView().alloc();
         widget.initWithFrame(new NSRect());
         widget.setTag(parent.jniRef);
         parent.contentView().addSubview_(widget);
-        button = (NSButton)new SWTButton().alloc();
+        button = cast(NSButton)new SWTButton().alloc();
         button.initWithFrame(new NSRect());
         button.setBordered(false);
         button.setAction(OS.sel_sendSelection);
@@ -240,7 +240,7 @@
         button.setEnabled(parent.getEnabled());
         widget.addSubview_(button);
         if ((style & DWT.DROP_DOWN) !is 0) {
-            arrow = (NSButton)new SWTButton().alloc();
+            arrow = cast(NSButton)new SWTButton().alloc();
             arrow.initWithFrame(new NSRect());
             arrow.setBordered(false);
             arrow.setAction(OS.sel_sendArrowSelection);
@@ -278,13 +278,13 @@
         NSGraphicsContext context = NSGraphicsContext.currentContext();
         context.saveGraphicsState();
         NSPoint p1 = new NSPoint();
-        p1.y = (float)Math.ceil(frame.height / 2 - frame.width / 2);
+        p1.y = cast(float)Math.ceil(frame.height / 2 - frame.width / 2);
         NSPoint p2 = new NSPoint();
         p2.x = frame.width;
         p2.y = p1.y;
         NSPoint p3 = new NSPoint();
         p3.x = frame.width / 2;
-        p3.y = (float)(p2.y + Math.sqrt(Math.pow(frame.width, 2) - Math.pow(frame.width / 2, 2)));
+        p3.y = cast(float)(p2.y + Math.sqrt(Math.pow(frame.width, 2) - Math.pow(frame.width / 2, 2)));
         NSBezierPath path = NSBezierPath.bezierPath();
         path.moveToPoint(p1);
         path.lineToPoint(p2);
@@ -299,9 +299,9 @@
 
 void enableWidget(bool enabled) {
     if ((style & DWT.SEPARATOR) is 0) {
-        ((NSButton)button).setEnabled(enabled);
+        (cast(NSButton)button).setEnabled(enabled);
         if (arrow !is null) {
-            ((NSButton)arrow).setEnabled(enabled);
+            (cast(NSButton)arrow).setEnabled(enabled);
         }
     }
 }
@@ -320,7 +320,7 @@
 public Rectangle getBounds () {
     checkWidget();
     NSRect rect = view.frame();
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
@@ -555,8 +555,8 @@
     NSRect frame = view.frame();
     Event event = new Event ();
     event.detail = DWT.ARROW;
-    event.x = (int)frame.x;
-    event.y = (int)(frame.y + arrow.frame().height);
+    event.x = cast(int)frame.x;
+    event.y = cast(int)(frame.y + arrow.frame().height);
     postEvent (DWT.Selection, event);
 }
 
@@ -765,16 +765,16 @@
     if ((style & DWT.SEPARATOR) !is 0) return;
     super.setText (string);
     NSString str = NSString.stringWith(string);
-    ((NSButton)button).setTitle(str);
+    (cast(NSButton)button).setTitle(str);
     parent.relayout ();
     if (text.length() !is 0 && image !is null) {
         if ((parent.style & DWT.RIGHT) !is 0) {
-            ((NSButton)button).setImagePosition(OS.NSImageLeft);
+            (cast(NSButton)button).setImagePosition(OS.NSImageLeft);
         } else {
-            ((NSButton)button).setImagePosition(OS.NSImageAbove);       
+            (cast(NSButton)button).setImagePosition(OS.NSImageAbove);       
         }
     } else {
-        ((NSButton)button).setImagePosition(OS.NSImageOverlaps);            
+        (cast(NSButton)button).setImagePosition(OS.NSImageOverlaps);            
     }
 }
 
@@ -836,15 +836,15 @@
             image = disabledImage;
         }
     }
-    ((NSButton)button).setImage(image !is null ? image.handle : null);
+    (cast(NSButton)button).setImage(image !is null ? image.handle : null);
     if (text.length() !is 0 && image !is null) {
         if ((parent.style & DWT.RIGHT) !is 0) {
-            ((NSButton)button).setImagePosition(OS.NSImageLeft);
+            (cast(NSButton)button).setImagePosition(OS.NSImageLeft);
         } else {
-            ((NSButton)button).setImagePosition(OS.NSImageAbove);       
+            (cast(NSButton)button).setImagePosition(OS.NSImageAbove);       
         }
     } else {
-        ((NSButton)button).setImagePosition(OS.NSImageOverlaps);            
+        (cast(NSButton)button).setImagePosition(OS.NSImageOverlaps);            
     }
     parent.relayout();
 }
--- a/dwt/widgets/Tracker.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Tracker.d	Wed Aug 27 14:30:35 2008 +0200
@@ -442,7 +442,7 @@
         location = eventWindow.convertBaseToScreen(location);
         location.y = eventWindow.screen().frame().height - location.y;
     }
-    int newX = (int)location.x, newY = (int)location.y;
+    int newX = cast(int)location.x, newY = cast(int)location.y;
     if (newX !is oldX || newY !is oldY) {
         Rectangle [] oldRectangles = rectangles;
         Rectangle [] rectsToErase = new Rectangle [rectangles.length];
@@ -715,7 +715,7 @@
     checkWidget ();
     cancelled = false;
     tracking = true;
-    window = (NSWindow)new NSWindow().alloc();
+    window = cast(NSWindow)new NSWindow().alloc();
     NSRect frame = NSScreen.mainScreen().frame();
     window = window.initWithContentRect_styleMask_backing_defer_(frame, OS.NSBorderlessWindowMask, OS.NSBackingStoreBuffered, false);
     window.setOpaque(false);
@@ -767,7 +767,7 @@
 
     /* Tracker behaves like a Dialog with its own OS event loop. */
     while (tracking && !cancelled) {
-        NSAutoreleasePool pool = (NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
+        NSAutoreleasePool pool = cast(NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
         NSEvent event = application.nextEventMatchingMask(0, NSDate.distantFuture(), OS.NSDefaultRunLoopMode, true);
         if (event is null) continue;
         int type = event.type();
--- a/dwt/widgets/TrayItem.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TrayItem.d	Wed Aug 27 14:30:35 2008 +0200
@@ -164,7 +164,7 @@
     item.retain();
     item.setHighlightMode(true);    
     NSRect rect = new NSRect();
-    view = (NSImageView)new SWTImageView().alloc();
+    view = cast(NSImageView)new SWTImageView().alloc();
     if (view is null) error (DWT.ERROR_NO_HANDLES);
     view.initWithFrame(rect);
     item.setView(view);
@@ -185,7 +185,7 @@
     pt.y = rect.height;
     pt = view.convertPoint_fromView_(pt, null);
     pt.x += windowRect.x;
-    return new Point ((int)pt.x, (int)pt.y);
+    return new Point (cast(int)pt.x, cast(int)pt.y);
 }
 
 /**
--- a/dwt/widgets/Tree.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Tree.d	Wed Aug 27 14:30:35 2008 +0200
@@ -59,7 +59,7 @@
  *  tree.setItemCount(20);
  *  tree.addListener(DWT.SetData, new Listener() {
  *      public void handleEvent(Event event) {
- *          TreeItem item = (TreeItem)event.item;
+ *          TreeItem item = cast(TreeItem)event.item;
  *          TreeItem parentItem = item.getParentItem();
  *          String text = null;
  *          if (parentItem is null) {
@@ -362,7 +362,7 @@
 //          if (OS.VERSION >= 0x1040) {
 //              float [] metric = new float [1];
 //              OS.DataBrowserGetMetric (handle, OS.kDataBrowserMetricDisclosureColumnPerDepthGap, null, metric);
-//              levelIndent = (int) metric [0];
+//              levelIndent = cast(int) metric [0];
 //          }
 //          GC gc = new GC (this);
 //          width = calculateWidth (childIds, gc, true, 0, levelIndent);
@@ -374,7 +374,7 @@
         width = wHint;
     }
     if (hHint is DWT.DEFAULT) {
-        height = ((NSTableView)view).numberOfRows() * getItemHeight () + getHeaderHeight();
+        height = (cast(NSTableView)view).numberOfRows() * getItemHeight () + getHeaderHeight();
     } else {
         height = hHint;
     }
@@ -385,7 +385,7 @@
 }
 
 void createHandle () {
-    SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+    SWTScrollView scrollWidget = cast(SWTScrollView)new SWTScrollView().alloc();
     scrollWidget.initWithFrame(new NSRect ());
     scrollWidget.setHasHorizontalScroller(true);
     scrollWidget.setHasVerticalScroller(true);
@@ -393,7 +393,7 @@
     scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder);
     scrollWidget.setTag(jniRef);
     
-    NSOutlineView widget = (NSOutlineView)new SWTOutlineView().alloc();
+    NSOutlineView widget = cast(NSOutlineView)new SWTOutlineView().alloc();
     widget.initWithFrame(new NSRect());
     widget.setAllowsMultipleSelection((style & DWT.MULTI) !is 0);
     widget.setAutoresizesOutlineColumn(false);
@@ -410,12 +410,12 @@
     
     NSString str = NSString.stringWith("");
     if ((style & DWT.CHECK) !is 0) {
-        checkColumn = (NSTableColumn)new NSTableColumn().alloc();
+        checkColumn = cast(NSTableColumn)new NSTableColumn().alloc();
         checkColumn.initWithIdentifier(str);
         checkColumn.headerCell().setTitle(str);
         widget.addTableColumn (checkColumn);
         widget.setOutlineTableColumn(checkColumn);
-        NSButtonCell cell = (NSButtonCell)new NSButtonCell().alloc().init();
+        NSButtonCell cell = cast(NSButtonCell)new NSButtonCell().alloc().init();
         checkColumn.setDataCell(cell);
         cell.setButtonType(OS.NSSwitchButton);
         cell.setImagePosition(OS.NSImageOnly);
@@ -426,12 +426,12 @@
         cell.release();
     }
     
-    firstColumn = (NSTableColumn)new NSTableColumn().alloc();
+    firstColumn = cast(NSTableColumn)new NSTableColumn().alloc();
     firstColumn.initWithIdentifier(str);
     firstColumn.headerCell().setTitle(str);
     widget.addTableColumn (firstColumn);
     widget.setOutlineTableColumn(firstColumn);
-    NSBrowserCell cell = (NSBrowserCell)new NSBrowserCell().alloc().init();
+    NSBrowserCell cell = cast(NSBrowserCell)new NSBrowserCell().alloc().init();
     cell.setLeaf(true);
     firstColumn.setDataCell(cell);
     cell.release();
@@ -462,13 +462,13 @@
     } else {
         //TODO - set attributes, alignment etc.
         NSString str = NSString.stringWith("");
-        nsColumn = (NSTableColumn)new NSTableColumn().alloc();
+        nsColumn = cast(NSTableColumn)new NSTableColumn().alloc();
         nsColumn.initWithIdentifier(str);
         nsColumn.headerCell().setTitle(str);
-        ((NSTableView)view).addTableColumn (nsColumn);
+        (cast(NSTableView)view).addTableColumn (nsColumn);
         int checkColumn = (style & DWT.CHECK) !is 0 ? 1 : 0;
-        ((NSTableView)view).moveColumn (columnCount + checkColumn, index + checkColumn);
-        NSBrowserCell cell = (NSBrowserCell)new NSBrowserCell().alloc().init();
+        (cast(NSTableView)view).moveColumn (columnCount + checkColumn, index + checkColumn);
+        NSBrowserCell cell = cast(NSBrowserCell)new NSBrowserCell().alloc().init();
         cell.setLeaf(true);
         nsColumn.setDataCell(cell);
         cell.release();
@@ -551,7 +551,7 @@
     items [index] = item;
     item.items = new TreeItem[4];
     item.createJNIRef();
-    SWTTreeItem handle = (SWTTreeItem)new SWTTreeItem().alloc().init();
+    SWTTreeItem handle = cast(SWTTreeItem)new SWTTreeItem().alloc().init();
     handle.setTag(item.jniRef);
     item.handle = handle;
     if (parentItem !is null) {
@@ -560,7 +560,7 @@
         this.itemCount = count;
     }
     //TODO ?
-    ((NSTableView)view).reloadData();
+    (cast(NSTableView)view).reloadData();
 }
 
 void createWidget () {
@@ -587,7 +587,7 @@
  */
 public void deselectAll () {
     checkWidget ();
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     widget.deselectAll(null);
     ignoreSelect = false;
@@ -737,10 +737,10 @@
     items [count] = null;
     if (parentItem !is null) {
         parentItem.itemCount = count;
-        ((NSOutlineView)view).reloadItem_reloadChildren_(parentItem.handle, true);
+        (cast(NSOutlineView)view).reloadItem_reloadChildren_(parentItem.handle, true);
     } else {
         this.itemCount = count;
-        ((NSOutlineView)view).reloadItem_(null);
+        (cast(NSOutlineView)view).reloadItem_(null);
     }
     
     //noteNumberOfRowsChanged was causing crashes whenever
@@ -749,7 +749,7 @@
     //Not sure that this NSTableView function 
     //makes sense in an NSOutlineView.
     
-    //((NSTableView)view).noteNumberOfRowsChanged();
+    //(cast(NSTableView)view).noteNumberOfRowsChanged();
     
 //  setScrollWidth (true);
 //  fixScrollBar ();
@@ -939,9 +939,9 @@
  */
 public int getHeaderHeight () {
     checkWidget ();
-    NSTableHeaderView headerView = ((NSTableView)view).headerView();
+    NSTableHeaderView headerView = (cast(NSTableView)view).headerView();
     if (headerView is null) return 0;
-    return (int)headerView.bounds().height;
+    return cast(int)headerView.bounds().height;
 }
 
 /**
@@ -965,7 +965,7 @@
  */
 public bool getHeaderVisible () {
     checkWidget ();
-    return ((NSTableView)view).headerView() !is null;
+    return (cast(NSTableView)view).headerView() !is null;
 }
 
 /**
@@ -1020,7 +1020,7 @@
     if (point is null) error (DWT.ERROR_NULL_ARGUMENT);
 //  Rect rect = new Rect ();
 //  dwt.internal.carbon.Point pt = new dwt.internal.carbon.Point ();
-//  OS.SetPt (pt, (short) point.x, (short) point.y);
+//  OS.SetPt (pt, cast(short) point.x, cast(short) point.y);
 //  if (0 < lastHittest && lastHittest <= items.length && lastHittestColumn !is 0) {
 //      TreeItem item = _getItem (lastHittest, false);
 //      if (item !is null) {
@@ -1104,7 +1104,7 @@
  */
 public int getItemHeight () {
     checkWidget ();
-    return (int)((NSTableView)view).rowHeight();
+    return cast(int)(cast(NSTableView)view).rowHeight();
 }
 
 /**
@@ -1197,7 +1197,7 @@
  */
 public TreeItem [] getSelection () {
     checkWidget ();
-    NSOutlineView widget = (NSOutlineView)view;
+    NSOutlineView widget = cast(NSOutlineView)view;
     if (widget.numberOfSelectedRows() is 0) {
         return new TreeItem [0];
     }
@@ -1211,7 +1211,7 @@
         int jniRef = OS.objc_msgSend(item.id, OS.sel_tag);
         if (jniRef !is -1 && jniRef !is 0) {
             //TODO virtual
-            result[i] = (TreeItem)OS.JNIGetObject(jniRef);
+            result[i] = cast(TreeItem)OS.JNIGetObject(jniRef);
         }
     }
     return result;
@@ -1229,7 +1229,7 @@
  */
 public int getSelectionCount () {
     checkWidget ();
-    return ((NSTableView)view).numberOfSelectedRows();
+    return (cast(NSTableView)view).numberOfSelectedRows();
 }
 
 /**
@@ -1367,13 +1367,13 @@
 
 int outlineView_child_ofItem(int outlineView, int index, int ref) {
     TreeItem parent = null;
-    if (ref !is 0) parent = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+    if (ref !is 0) parent = cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
     TreeItem item = _getItem(parent, index);
     return item.handle.id;
 }
 
 int outlineView_objectValueForTableColumn_byItem(int outlineView, int tableColumn, int ref) {
-    TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+    TreeItem item = cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
     if (checkColumn !is null && tableColumn is checkColumn.id) {
         NSNumber value;
         if (item.checked && item.grayed) {
@@ -1393,17 +1393,17 @@
 
 bool outlineView_isItemExpandable(int outlineView, int ref) {
     if (ref is 0) return true;
-    return ((TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag))).itemCount !is 0;
+    return (cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag))).itemCount !is 0;
 }
 
 int outlineView_numberOfChildrenOfItem(int outlineView, int ref) {
     if (ref is 0) return itemCount;
-    return ((TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag))).itemCount;
+    return (cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag))).itemCount;
 }
 
 void outlineView_willDisplayCell_forTableColumn_item(int outlineView, int cell, int tableColumn, int ref) {
     if (checkColumn !is null && tableColumn is checkColumn.id) return;
-    TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+    TreeItem item = cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
     Image image = item.image;
     for (int i=0; i<columnCount; i++) {
         if (columns [i].nsColumn.id is tableColumn) {
@@ -1416,13 +1416,13 @@
 
 void outlineViewSelectionDidChange(int notification) {
     if (ignoreSelect) return;
-    NSOutlineView widget = (NSOutlineView)view;
+    NSOutlineView widget = cast(NSOutlineView)view;
     int row = widget.selectedRow();
     if(row is -1)
         postEvent(DWT.Selection);
     else {
         id _id = widget.itemAtRow(row);
-        TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(_id.id, OS.sel_tag));
+        TreeItem item = cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(_id.id, OS.sel_tag));
         Event event = new Event();
         event.item = item;
         event.index = row;
@@ -1432,7 +1432,7 @@
 
 bool outlineView_shouldCollapseItem(int outlineView, int ref) {
     if (!ignoreExpand) {
-        TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+        TreeItem item = cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
         Event event = new Event();
         event.item = item;
         sendEvent(DWT.Collapse, event);
@@ -1443,7 +1443,7 @@
 
 bool outlineView_shouldExpandItem(int outlineView, int ref) {
     if (!ignoreExpand) {
-        TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+        TreeItem item = cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
         Event event = new Event();
         event.item = item;
         sendEvent(DWT.Expand, event);
@@ -1453,7 +1453,7 @@
 }
 
 void outlineView_setObjectValue_forTableColumn_byItem(int outlineView, int object, int tableColumn, int ref) {
-    TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+    TreeItem item = cast(TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
     if (checkColumn !is null && tableColumn is checkColumn.id)  {
         item.checked = !item.checked;
         Event event = new Event();
@@ -1515,8 +1515,8 @@
     }
     items = new TreeItem [4];
     itemCount = 0;
-    ((NSOutlineView)view).reloadItem_(null);
-    //((NSTableView)view).noteNumberOfRowsChanged();
+    (cast(NSOutlineView)view).reloadItem_(null);
+    //(cast(NSTableView)view).noteNumberOfRowsChanged();
 //  setScrollWidth (true);
 }
 
@@ -1607,7 +1607,7 @@
 public void selectAll () {
     checkWidget ();
     if ((style & DWT.SINGLE) !is 0) return;
-    NSTableView widget = (NSTableView)view;
+    NSTableView widget = cast(NSTableView)view;
     ignoreSelect = true;
     widget.selectAll(null);
     ignoreSelect = false;
@@ -1750,7 +1750,7 @@
  */
 public void setHeaderVisible (bool show) {
     checkWidget ();
-    ((NSTableView)view).setHeaderView (show ? headerView : null);
+    (cast(NSTableView)view).setHeaderView (show ? headerView : null);
 }
 
 /**
@@ -1865,7 +1865,7 @@
     if (itemHeight is -1) {
         //TODO - reset item height, ensure other API's such as setFont don't do this
     } else {
-//      OS.SetDataBrowserTableViewRowHeight (handle, (short) itemHeight);
+//      OS.SetDataBrowserTableViewRowHeight (handle, cast(short) itemHeight);
     }
 }
 
@@ -1876,7 +1876,7 @@
 //  short [] height = new short [1];
 //  if (OS.GetDataBrowserTableViewRowHeight (handle, height) is OS.noErr) {
 //      if (height [0] < bounds.height) {
-//          OS.SetDataBrowserTableViewRowHeight (handle, (short) bounds.height);
+//          OS.SetDataBrowserTableViewRowHeight (handle, cast(short) bounds.height);
 //      }
 //  }
 }
@@ -1901,7 +1901,7 @@
  */
 public void setLinesVisible (bool show) {
     checkWidget ();
-    ((NSTableView)view).setUsesAlternatingRowBackgroundColors(show);
+    (cast(NSTableView)view).setUsesAlternatingRowBackgroundColors(show);
 }
 
 public void setRedraw (bool redraw) {
@@ -1924,7 +1924,7 @@
 //  short [] width = new short [1];
 //  OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
 //  if (width [0] < newWidth) {
-//      OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, (short) newWidth);
+//      OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, cast(short) newWidth);
 //      return true;
 //  }
 //  firstColumn.setWidth(400);
@@ -1948,7 +1948,7 @@
 //      OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
 //      if (width [0] >= newWidth) return false;
 //  }
-//  OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, (short) newWidth);
+//  OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, cast(short) newWidth);
     return true;
 }
 
@@ -2071,7 +2071,7 @@
     if (column is sortColumn) return;
 //  if (column is null) {
 //      if (sortColumn !is null  && !sortColumn.isDisposed ()  && sortDirection !is DWT.NONE) {
-//          OS.SetDataBrowserSortOrder (handle, (short) OS.kDataBrowserOrderIncreasing);
+//          OS.SetDataBrowserSortOrder (handle, cast(short) OS.kDataBrowserOrderIncreasing);
 //          sortColumn = null; 
 //          OS.SetDataBrowserSortProperty (handle, 0);
 //      }
@@ -2080,7 +2080,7 @@
 //  if (sortColumn !is null  && !sortColumn.isDisposed () && sortDirection !is DWT.NONE) {
 //      OS.SetDataBrowserSortProperty (handle, sortColumn.id);
 //      int order = sortDirection is DWT.DOWN ? OS.kDataBrowserOrderDecreasing : OS.kDataBrowserOrderIncreasing;
-//      OS.SetDataBrowserSortOrder (handle, (short) order);
+//      OS.SetDataBrowserSortOrder (handle, cast(short) order);
 //  }
 }
 
@@ -2104,7 +2104,7 @@
 //  sortDirection = direction;
 //  if (sortColumn !is null && !sortColumn.isDisposed ()) {
 //      if (sortDirection is DWT.NONE) {
-//          OS.SetDataBrowserSortOrder (handle, (short) OS.kDataBrowserOrderIncreasing);
+//          OS.SetDataBrowserSortOrder (handle, cast(short) OS.kDataBrowserOrderIncreasing);
 //          TreeColumn column = sortColumn;
 //          sortColumn = null; 
 //          OS.SetDataBrowserSortProperty (handle, 0);
@@ -2113,7 +2113,7 @@
 //          OS.SetDataBrowserSortProperty (handle, 0);
 //          OS.SetDataBrowserSortProperty (handle, sortColumn.id);
 //          int order = sortDirection is DWT.DOWN ? OS.kDataBrowserOrderDecreasing : OS.kDataBrowserOrderIncreasing;
-//          OS.SetDataBrowserSortOrder (handle, (short) order);
+//          OS.SetDataBrowserSortOrder (handle, cast(short) order);
 //      }
 //  }
 }
@@ -2144,7 +2144,7 @@
     if (item.isDisposed ()) error (DWT.ERROR_INVALID_ARGUMENT);
 //  showItem (item, false);
 //  int columnId = (columnCount is 0) ? column_id : columns [0].id;
-//  OS.RevealDataBrowserItem (handle, item.id, columnId, (byte) OS.kDataBrowserRevealWithoutSelecting);
+//  OS.RevealDataBrowserItem (handle, item.id, columnId, cast(byte) OS.kDataBrowserRevealWithoutSelecting);
 //  Rect rect = new Rect ();
 //  if (OS.GetDataBrowserItemPartBounds (handle, item.id, column_id, OS.kDataBrowserPropertyEnclosingPart, rect) is OS.noErr) {
 //      int border = getBorder ();
@@ -2179,7 +2179,7 @@
     if (column.parent !is this) return;
     int index = indexOf (column);
     if (columnCount <= 1 || !(0 <= index && index < columnCount)) return;
-    ((NSTableView)view).scrollColumnToVisible(index + ((style & DWT.CHECK) !is 0 ? 1 : 0));
+    (cast(NSTableView)view).scrollColumnToVisible(index + ((style & DWT.CHECK) !is 0 ? 1 : 0));
 }
 
 /**
@@ -2260,7 +2260,7 @@
 //      * end in some cases).
 //      */
 //      //options |= OS.kDataBrowserRevealAndCenterInView;
-//      OS.RevealDataBrowserItem (handle, item.id, columnId, (byte) options);
+//      OS.RevealDataBrowserItem (handle, item.id, columnId, cast(byte) options);
 //      int [] newTop = new int [1], newLeft = new int [1];
 //      if (columnCount is 0) {
 //          bool fixScroll = false;
@@ -2280,7 +2280,7 @@
 //              if (OS.VERSION >= 0x1040) {
 //                  float [] metric = new float [1];
 //                  OS.DataBrowserGetMetric (handle, OS.kDataBrowserMetricDisclosureColumnPerDepthGap, null, metric);
-//                  levelIndent = (int) metric [0];
+//                  levelIndent = cast(int) metric [0];
 //              }
 //              TreeItem temp = item;
 //              while (temp.parentItem !is null) {
--- a/dwt/widgets/TreeColumn.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TreeColumn.d	Wed Aug 27 14:30:35 2008 +0200
@@ -308,7 +308,7 @@
  */
 public int getWidth () {
     checkWidget ();
-    return (int)nsColumn.width();
+    return cast(int)nsColumn.width();
 }
 
 /**
--- a/dwt/widgets/TreeItem.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TreeItem.d	Wed Aug 27 14:30:35 2008 +0200
@@ -241,7 +241,7 @@
 //      parent.sendEvent (DWT.MeasureItem, event);
 //      if (parent.itemHeight < event.height) {
 //          parent.itemHeight = event.height;
-//          OS.SetDataBrowserTableViewRowHeight (parent.handle, (short) event.height);
+//          OS.SetDataBrowserTableViewRowHeight (parent.handle, cast(short) event.height);
 //      }
 //      width = event.width;
 //  }
@@ -347,7 +347,7 @@
     char[] chars = new char[length];
     text.getChars(0, length, chars, 0);
     NSString str = NSString.stringWithCharacters(chars, length);
-    NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+    NSAttributedString attribStr = (cast(NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
     attribStr.autorelease();
     return attribStr;
 }
@@ -412,11 +412,11 @@
 public Rectangle getBounds () {
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
-    NSOutlineView outlineView = (NSOutlineView) parent.view;
+    NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     int row = outlineView.rowForItem(handle);
     NSRect rect = outlineView.rectOfRow (row);
     rect = outlineView.convertRect_toView_ (rect, parent.scrollView);
-    Rectangle result = new Rectangle((int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height);
+    Rectangle result = new Rectangle(cast(int) rect.x, cast(int) rect.y, cast(int) rect.width, cast(int) rect.height);
     return result;
 }
 
@@ -438,12 +438,12 @@
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     if (index !is 0 && !(0 <= index && index < parent.columnCount)) return new Rectangle (0, 0, 0, 0);
-    NSOutlineView outlineView = (NSOutlineView) parent.view;
+    NSOutlineView outlineView = cast(NSOutlineView) parent.view;
     int row = outlineView.rowForItem(handle);
     if ((parent.style & DWT.CHECK) !is 0) index ++;
     NSRect rect = outlineView.frameOfCellAtColumn(index, row);
     rect = outlineView.convertRect_toView_ (rect, parent.scrollView);
-    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+    return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height);
 }
 
 /**
@@ -961,7 +961,7 @@
     background = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 /**
@@ -999,7 +999,7 @@
     cellBackground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true; 
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 /**
@@ -1019,7 +1019,7 @@
     if (this.checked is checked) return;
     this.checked = checked;
     cached = true;
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 /**
@@ -1038,9 +1038,9 @@
     if (expanded is getExpanded ()) return;
     parent.ignoreExpand = true;
     if (expanded) {
-        ((NSOutlineView)parent.view).expandItem_(handle);
+        (cast(NSOutlineView)parent.view).expandItem_(handle);
     } else {
-        ((NSOutlineView)parent.view).collapseItem_(handle);
+        (cast(NSOutlineView)parent.view).collapseItem_(handle);
     }
     parent.ignoreExpand = false;
     cached = true;
@@ -1079,7 +1079,7 @@
     this.font = font;
     if (oldFont !is null && oldFont.equals (font)) return;
     cached = true;
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 /**
@@ -1117,7 +1117,7 @@
     cellFont [index] = font;
     if (oldFont !is null && oldFont.equals (font)) return;
     cached = true;
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 /**
@@ -1150,7 +1150,7 @@
     foreground = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 /**
@@ -1188,7 +1188,7 @@
     cellForeground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 /**
@@ -1208,7 +1208,7 @@
     if (this.grayed is grayed) return;
     this.grayed = grayed;
     cached = true;
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 /**
@@ -1276,7 +1276,7 @@
     }
 //  cached = true;
 //  if (index is 0) parent.setScrollWidth (this);
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 public void setImage (Image image) {
@@ -1358,7 +1358,7 @@
     }
     cached = true;
     if (index is 0) parent.setScrollWidth (this);
-    ((NSOutlineView)parent.view).reloadItem_(handle);
+    (cast(NSOutlineView)parent.view).reloadItem_(handle);
 }
 
 public void setText (String string) {
--- a/dwt/widgets/TypedListener.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TypedListener.d	Wed Aug 27 14:30:35 2008 +0200
@@ -118,166 +118,166 @@
 public void handleEvent (Event e) {
     switch (e.type) {
         case DWT.Activate: {
-            ((ShellListener) eventListener).shellActivated(new ShellEvent(e));
+            (cast(ShellListener) eventListener).shellActivated(new ShellEvent(e));
             break;
         }
         case DWT.Arm: {
-            ((ArmListener) eventListener).widgetArmed (new ArmEvent (e));
+            (cast(ArmListener) eventListener).widgetArmed (new ArmEvent (e));
             break;
         }
         case DWT.Close: {
             /* Fields set by Decorations */
             ShellEvent event = new ShellEvent (e);
-            ((ShellListener) eventListener).shellClosed(event);
+            (cast(ShellListener) eventListener).shellClosed(event);
             e.doit = event.doit;
             break;
         }
         case DWT.Collapse: {
             if (eventListener instanceof TreeListener) {
-                ((TreeListener) eventListener).treeCollapsed(new TreeEvent(e));
+                (cast(TreeListener) eventListener).treeCollapsed(new TreeEvent(e));
             } else {
-                ((ExpandListener) eventListener).itemCollapsed(new ExpandEvent(e)); 
+                (cast(ExpandListener) eventListener).itemCollapsed(new ExpandEvent(e)); 
             }
             break;
         }
         case DWT.Deactivate: {
-            ((ShellListener) eventListener).shellDeactivated(new ShellEvent(e));
+            (cast(ShellListener) eventListener).shellDeactivated(new ShellEvent(e));
             break;
         }
         case DWT.Deiconify: {
-            ((ShellListener) eventListener).shellDeiconified(new ShellEvent(e));
+            (cast(ShellListener) eventListener).shellDeiconified(new ShellEvent(e));
             break;
         }
         case DWT.DefaultSelection: {
-            ((SelectionListener)eventListener).widgetDefaultSelected(new SelectionEvent(e));
+            (cast(SelectionListener)eventListener).widgetDefaultSelected(new SelectionEvent(e));
             break;
         }
         case DWT.Dispose: {
-            ((DisposeListener) eventListener).widgetDisposed(new DisposeEvent(e));
+            (cast(DisposeListener) eventListener).widgetDisposed(new DisposeEvent(e));
             break;
         }
         case DWT.DragDetect: {
-            ((DragDetectListener) eventListener).dragDetected(new DragDetectEvent(e));
+            (cast(DragDetectListener) eventListener).dragDetected(new DragDetectEvent(e));
             break;
         }
         case DWT.Expand: {
             if (eventListener instanceof TreeListener) {
-                ((TreeListener) eventListener).treeExpanded(new TreeEvent(e));
+                (cast(TreeListener) eventListener).treeExpanded(new TreeEvent(e));
             } else {
-                ((ExpandListener) eventListener).itemExpanded(new ExpandEvent(e));  
+                (cast(ExpandListener) eventListener).itemExpanded(new ExpandEvent(e));  
             }
             break;
         }
         case DWT.FocusIn: {
-            ((FocusListener) eventListener).focusGained(new FocusEvent(e));
+            (cast(FocusListener) eventListener).focusGained(new FocusEvent(e));
             break;
         }
         case DWT.FocusOut: {
-            ((FocusListener) eventListener).focusLost(new FocusEvent(e));
+            (cast(FocusListener) eventListener).focusLost(new FocusEvent(e));
             break;
         }
         case DWT.Help: {
-            ((HelpListener) eventListener).helpRequested (new HelpEvent (e));
+            (cast(HelpListener) eventListener).helpRequested (new HelpEvent (e));
             break;
         }
         case DWT.Hide: {
-            ((MenuListener) eventListener).menuHidden(new MenuEvent(e));
+            (cast(MenuListener) eventListener).menuHidden(new MenuEvent(e));
             break;
         }
         case DWT.Iconify: {
-            ((ShellListener) eventListener).shellIconified(new ShellEvent(e));
+            (cast(ShellListener) eventListener).shellIconified(new ShellEvent(e));
             break;
         }
         case DWT.KeyDown: {
             /* Fields set by Control */
             KeyEvent event = new KeyEvent(e);
-            ((KeyListener) eventListener).keyPressed(event);
+            (cast(KeyListener) eventListener).keyPressed(event);
             e.doit = event.doit;
             break;
         }
         case DWT.KeyUp: {
             /* Fields set by Control */
             KeyEvent event = new KeyEvent(e);
-            ((KeyListener) eventListener).keyReleased(event);
+            (cast(KeyListener) eventListener).keyReleased(event);
             e.doit = event.doit;
             break;
         }
         case DWT.Modify: {
-            ((ModifyListener) eventListener).modifyText(new ModifyEvent(e));
+            (cast(ModifyListener) eventListener).modifyText(new ModifyEvent(e));
             break;
         }
         case DWT.MenuDetect: {
             MenuDetectEvent event = new MenuDetectEvent(e);
-            ((MenuDetectListener) eventListener).menuDetected(event);
+            (cast(MenuDetectListener) eventListener).menuDetected(event);
             e.x = event.x;
             e.y = event.y;
             e.doit = event.doit;
             break;
         }
         case DWT.MouseDown: {
-            ((MouseListener) eventListener).mouseDown(new MouseEvent(e));
+            (cast(MouseListener) eventListener).mouseDown(new MouseEvent(e));
             break;
         }
         case DWT.MouseDoubleClick: {
-            ((MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
+            (cast(MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
             break;
         }
         case DWT.MouseEnter: {
-            ((MouseTrackListener) eventListener).mouseEnter (new MouseEvent (e));
+            (cast(MouseTrackListener) eventListener).mouseEnter (new MouseEvent (e));
             break;
         }
         case DWT.MouseExit: {
-            ((MouseTrackListener) eventListener).mouseExit (new MouseEvent (e));
+            (cast(MouseTrackListener) eventListener).mouseExit (new MouseEvent (e));
             break;
         }
         case DWT.MouseHover: {
-            ((MouseTrackListener) eventListener).mouseHover (new MouseEvent (e));
+            (cast(MouseTrackListener) eventListener).mouseHover (new MouseEvent (e));
             break;
         }
         case DWT.MouseMove: {
-            ((MouseMoveListener) eventListener).mouseMove(new MouseEvent(e));
+            (cast(MouseMoveListener) eventListener).mouseMove(new MouseEvent(e));
             return;
         }
         case DWT.MouseWheel: {
-            ((MouseWheelListener) eventListener).mouseScrolled(new MouseEvent(e));
+            (cast(MouseWheelListener) eventListener).mouseScrolled(new MouseEvent(e));
             return;
         }
         case DWT.MouseUp: {
-            ((MouseListener) eventListener).mouseUp(new MouseEvent(e));
+            (cast(MouseListener) eventListener).mouseUp(new MouseEvent(e));
             break;
         }
         case DWT.Move: {
-            ((ControlListener) eventListener).controlMoved(new ControlEvent(e));
+            (cast(ControlListener) eventListener).controlMoved(new ControlEvent(e));
             break;
         }
         case DWT.Paint: {
             /* Fields set by Control */
             PaintEvent event = new PaintEvent (e);
-            ((PaintListener) eventListener).paintControl (event);
+            (cast(PaintListener) eventListener).paintControl (event);
             e.gc = event.gc;
             break;
         }
         case DWT.Resize: {
-            ((ControlListener) eventListener).controlResized(new ControlEvent(e));
+            (cast(ControlListener) eventListener).controlResized(new ControlEvent(e));
             break;
         }
         case DWT.Selection: {
             /* Fields set by Sash */
             SelectionEvent event = new SelectionEvent (e);
-            ((SelectionListener) eventListener).widgetSelected (event);         
+            (cast(SelectionListener) eventListener).widgetSelected (event);         
             e.x = event.x;
             e.y = event.y;
             e.doit = event.doit;
             break;
         }
         case DWT.Show: {
-            ((MenuListener) eventListener).menuShown(new MenuEvent(e));
+            (cast(MenuListener) eventListener).menuShown(new MenuEvent(e));
             break;
         }
         case DWT.Traverse: {
             /* Fields set by Control */
             TraverseEvent event = new TraverseEvent (e);
-            ((TraverseListener) eventListener).keyTraversed (event);
+            (cast(TraverseListener) eventListener).keyTraversed (event);
             e.detail = event.detail;
             e.doit = event.doit;
             break;
@@ -285,7 +285,7 @@
         case DWT.Verify: {
             /* Fields set by Text, RichText */
             VerifyEvent event = new VerifyEvent (e);
-            ((VerifyListener) eventListener).verifyText (event);
+            (cast(VerifyListener) eventListener).verifyText (event);
             e.text = event.text;
             e.doit = event.doit;
             break;
--- a/dwt/widgets/Widget.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Widget.d	Wed Aug 27 14:30:35 2008 +0200
@@ -1164,20 +1164,20 @@
 //              */
 //          }
 //          if (event.keyCode is 0) {
-//              int kchrPtr = OS.GetScriptManagerVariable ((short) OS.smKCHRCache);
+//              int kchrPtr = OS.GetScriptManagerVariable (cast(short) OS.smKCHRCache);
 //              if (display.kchrPtr !is kchrPtr) {
 //                  display.kchrPtr = kchrPtr;
 //                  display.kchrState [0] = 0;
 //              }
-//              int result = OS.KeyTranslate (display.kchrPtr, (short)keyCode [0], display.kchrState);
+//              int result = OS.KeyTranslate (display.kchrPtr, cast(short)keyCode [0], display.kchrState);
 //              if (result <= 0x7f) {
 //                  event.keyCode = result & 0x7f;
 //              } else {
 //                  int [] encoding = new int [1];
-//                  short keyScript = (short) OS.GetScriptManagerVariable ((short) OS.smKeyScript);
-//                  short regionCode = (short) OS.GetScriptManagerVariable ((short) OS.smRegionCode);
-//                  if (OS.UpgradeScriptInfoToTextEncoding (keyScript, (short) OS.kTextLanguageDontCare, regionCode, null, encoding) is OS.paramErr) {
-//                      if (OS.UpgradeScriptInfoToTextEncoding (keyScript, (short) OS.kTextLanguageDontCare, (short) OS.kTextRegionDontCare, null, encoding) is OS.paramErr) {
+//                  short keyScript = cast(short) OS.GetScriptManagerVariable (cast(short) OS.smKeyScript);
+//                  short regionCode = cast(short) OS.GetScriptManagerVariable (cast(short) OS.smRegionCode);
+//                  if (OS.UpgradeScriptInfoToTextEncoding (keyScript, cast(short) OS.kTextLanguageDontCare, regionCode, null, encoding) is OS.paramErr) {
+//                      if (OS.UpgradeScriptInfoToTextEncoding (keyScript, cast(short) OS.kTextLanguageDontCare, cast(short) OS.kTextRegionDontCare, null, encoding) is OS.paramErr) {
 //                          encoding [0] = OS.kTextEncodingMacRoman;
 //                      }
 //                  }
@@ -1188,7 +1188,7 @@
 //                      int [] nchars = new int [1];
 //                      byte [] buffer = new byte [2];
 //                      buffer [0] = 1;
-//                      buffer [1] = (byte) (result & 0xFF);
+//                      buffer [1] = cast(byte) (result & 0xFF);
 //                      OS.ConvertFromPStringToUnicode (encodingInfo [0], buffer, chars.length * 2, nchars, chars);
 //                      OS.DisposeTextToUnicodeInfo (encodingInfo);
 //                      event.keyCode = chars [0];