changeset 54:70388b0e6dad

[swt lin] compiles
author Frank Benoit <benoit@tionex.de>
date Fri, 27 Mar 2009 23:31:11 +0100
parents 7e78af7adab5
children ea8b884d85f6
files base/src/java/io/File.d base/src/java/lang/String.d base/src/java/util/ResourceBundle.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/AppFileLocProvider.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePicker.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePickerFactory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/InputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Mozilla.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2Factory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/SimpleEnumerator.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WindowCreator2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/HTMLTransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Font.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/FontData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GC.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Image.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoader.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Path.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Pattern.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/TextLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Compatibility.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gdk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/XPCOMInit.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICategoryManager.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentManager.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentRegistrar.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsID.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIInterfaceRequestor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObserverService.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefBranch.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProperties.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIServiceManager.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISupports.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowser.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d
diffstat 44 files changed, 301 insertions(+), 249 deletions(-) [+]
line wrap: on
line diff
--- a/base/src/java/io/File.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/base/src/java/io/File.d	Fri Mar 27 23:31:11 2009 +0100
@@ -46,30 +46,30 @@
         }
     }
 
-    private static String toStd( String path ){
+    private static String toStd( CString path ){
         version(Tango){
-            return tango.io.Path.standard( path );
+            return tango.io.Path.standard( path._idup() );
         } else { // Phobos
-            return path;
+            return path._idup();
         }
     }
-    private static String join( String path, String file ){
+    private static String join( CString path, CString file ){
         version(Tango){
-            return tango.io.Path.join( path, file );
+            return tango.io.Path.join( path._idup(), file._idup() );
         } else { // Phobos
-            return std.path.join( path, file );
+            return std.path.join( path._idup(), file._idup() );
         }
     }
 
-    public this ( String pathname ){
+    public this ( CString pathname ){
         mFilePath = toStd( pathname );
     }
 
-    public this ( String parent, String child ){
+    public this ( CString parent, CString child ){
         mFilePath = join( toStd(parent), toStd(child) );
     }
 
-    public this ( java.io.File.File parent, String child ){
+    public this ( java.io.File.File parent, CString child ){
         mFilePath = join( parent.mFilePath, toStd(child) );
     }
 
@@ -237,12 +237,12 @@
         return null;
     }
 
-    public static java.io.File.File createTempFile( String prefix, String suffix, java.io.File.File directory ){
+    public static java.io.File.File createTempFile( CString prefix, CString suffix, java.io.File.File directory ){
         implMissing( __FILE__, __LINE__ );
         return null;
     }
 
-    public static java.io.File.File createTempFile( String prefix, String suffix ){
+    public static java.io.File.File createTempFile( CString prefix, CString suffix ){
         implMissing( __FILE__, __LINE__ );
         return null;
     }
--- a/base/src/java/lang/String.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/base/src/java/lang/String.d	Fri Mar 27 23:31:11 2009 +0100
@@ -30,10 +30,10 @@
     alias wstring String16;
     mixin("alias const(char)[]     CString;");
     mixin("alias const(wchar)[]    CString16;");
-    mixin("alias invariant(char*)  ICharPtr;");
-    mixin("alias const(char*)      CCharPtr;");
-    mixin("alias const(wchar*)     CWCharPtr;");
-    mixin("alias invariant(wchar*) IWCharPtr;");
+    mixin("alias invariant(char)*  ICharPtr;");
+    mixin("alias const(char)*      CCharPtr;");
+    mixin("alias const(wchar)*     CWCharPtr;");
+    mixin("alias invariant(wchar)* IWCharPtr;");
 }
 
 int codepointIndexToIndex( CString str, int cpIndex ){
@@ -304,17 +304,17 @@
     }
     return i;
 }
-dchar getRelativeCodePoint( String str, int startIndex, int searchRelCp ){
+dchar getRelativeCodePoint( CString str, int startIndex, int searchRelCp ){
     int dummy;
     return getRelativeCodePoint( str, startIndex, dummy );
 }
-dchar getRelativeCodePoint( String str, int startIndex, int searchRelCp, out int relIndex ){
+dchar getRelativeCodePoint( CString str, int startIndex, int searchRelCp, out int relIndex ){
     relIndex = getRelativeCodePointOffset( str, startIndex, searchRelCp );
     int ignore;
     return firstCodePoint( str[ startIndex+relIndex .. $ ], ignore );
 }
 
-int utf8AdjustOffset( String str, int offset ){
+int utf8AdjustOffset( CString str, int offset ){
     if( str.length <= offset || offset <= 0 ){
         return offset;
     }
@@ -323,7 +323,7 @@
     }
     return offset;
 }
-int utf8OffsetIncr( String str, int offset ){
+int utf8OffsetIncr( CString str, int offset ){
     int res = offset +1;
     if( str.length <= res || res <= 0 ){
         return res;
@@ -335,7 +335,7 @@
     }
     return res;
 }
-int utf8OffsetDecr( String str, int offset ){
+int utf8OffsetDecr( CString str, int offset ){
     int res = offset-1;
     if( str.length <= res || res <= 0 ){
         return res;
@@ -350,7 +350,7 @@
     return res;
 }
 
-String new_String( String cont, int offset, int len ){
+String new_String( CString cont, int offset, int len ){
     version(D_Version2){
         return cont[ offset .. offset+len ].idup;
     } else {
@@ -358,7 +358,7 @@
     }
 }
 
-String new_String( String cont ){
+String new_String( CString cont ){
     version(D_Version2){
         return cont.idup;
     } else {
@@ -475,7 +475,7 @@
     }
 }
 
-int length( String str ){
+int length( CString str ){
     return str.length;
 }
 
@@ -632,12 +632,12 @@
 }
 
 /// Extension to String
-public char[] toCharArray( String str ){
+public char[] toCharArray( CString str ){
     return cast(char[])str;
 }
 
 /// Extension to String
-public bool endsWith( String src, String pattern ){
+public bool endsWith( CString src, CString pattern ){
     if( src.length < pattern.length ){
         return false;
     }
@@ -645,12 +645,12 @@
 }
 
 /// Extension to String
-public bool equals( String src, String other ){
+public bool equals( CString src, CString other ){
     return src == other;
 }
 
 /// Extension to String
-public bool equalsIgnoreCase( String src, String other ){
+public bool equalsIgnoreCase( CString src, CString other ){
     version(Tango){
         return tango.text.Unicode.toFold(src) == tango.text.Unicode.toFold(other);
     } else { // Phobos
@@ -660,7 +660,7 @@
 }
 
 /// Extension to String
-public int compareToIgnoreCase( String src, String other ){
+public int compareToIgnoreCase( CString src, CString other ){
     version(Tango){
         return compareTo( tango.text.Unicode.toFold(src), tango.text.Unicode.toFold(other));
     } else { // Phobos
@@ -670,12 +670,12 @@
 }
 
 /// Extension to String
-public int compareTo( String src, String other ){
+public int compareTo( CString src, CString other ){
     return typeid(String).compare( cast(void*)&src, cast(void*)&other );
 }
 
 /// Extension to String
-public bool startsWith( String src, String pattern ){
+public bool startsWith( CString src, CString pattern ){
     if( src.length < pattern.length ){
         return false;
     }
@@ -683,7 +683,7 @@
 }
 
 /// Extension to String
-public String toLowerCase( String src ){
+public String toLowerCase( CString src ){
     version(Tango){
         return tango.text.Unicode.toLower( src );
     } else { // Phobos
@@ -693,12 +693,12 @@
 }
 
 /// Extension to String
-public hash_t toHash( String src ){
+public hash_t toHash( CString src ){
     return typeid(String).getHash(&src);
 }
 
 /// Extension to String
-public String trim( String str ){
+public String trim( CString str ){
     version(Tango){
         return tango.text.Util.trim( str ).dup;
     } else { // Phobos
@@ -708,8 +708,8 @@
 }
 
 /// Extension to String
-public String intern( String str ){
-    return str;
+public String intern( CString str ){
+    return str._idup();
 }
 
 /++
--- a/base/src/java/util/ResourceBundle.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/base/src/java/util/ResourceBundle.d	Fri Mar 27 23:31:11 2009 +0100
@@ -147,11 +147,11 @@
         }
     }
 
-    public bool hasString( String key ){
+    public bool hasString( CString key ){
         return ( key in map ) !is null;
     }
 
-    public String getString( String key ){
+    public String getString( CString key ){
         if( auto v = key in map ){
             version(D_Version2){
                 return (*v).idup;
@@ -159,7 +159,7 @@
                 return (*v).dup;
             }
         }
-        throw new MissingResourceException( "key not found", this.classinfo.name, key );
+        throw new MissingResourceException( "key not found", this.classinfo.name, key._idup() );
     }
 
     public String[] getKeys(){
@@ -172,7 +172,7 @@
     public static ResourceBundle getBundle( ImportData data ){
         return new ResourceBundle( data );
     }
-    public static ResourceBundle getBundle( String name ){
+    public static ResourceBundle getBundle( CString name ){
         try{
             version(Tango){
                 return new ResourceBundle( cast(String) File.get(name) );
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/AppFileLocProvider.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/AppFileLocProvider.d	Fri Mar 27 23:31:11 2009 +0100
@@ -19,6 +19,8 @@
 }
 
 import java.lang.all;
+import java.util.Vector;
+
 import org.eclipse.swt.browser.Mozilla;
 import org.eclipse.swt.browser.SimpleEnumerator;
 
@@ -68,7 +70,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in cnsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
 
     if (*riid == nsISupports.IID) {
@@ -116,19 +118,40 @@
 /* nsIDirectoryServiceProvider2 */
 extern(System)
 nsresult GetFiles (char* prop, nsISimpleEnumerator* _retval) {
-    String propertyName = fromStringz(prop);
+    String propertyName = fromStringz(prop)._idup();
     String[] propertyValues = null;
 
     if (propertyName == XPCOM.NS_APP_PLUGINS_DIR_LIST) {
         if (pluginDirs is null) {
             int index = 0;
             /* set the first value(s) to the MOZ_PLUGIN_PATH environment variable value if it's defined */
-            String value = Environment.get (XPCOM.MOZILLA_PLUGIN_PATH);
+            version(Tango){
+                String value = Environment.get (XPCOM.MOZILLA_PLUGIN_PATH);
+            } else { // Phobos
+                implMissing(__FILE__, __LINE__);
+                String value;
+            }
             if (value !is null) {
                 if (value.length > 0) {
-                    String separator = System.getProperty ("file.separator"); // $NON-NLS-1$
-                    foreach (segment; delimiters(value, separator))
-                        pluginDirs ~= segment;
+                    String separator = System.getProperty ("path.separator"); // $NON-NLS-1$
+                    Vector segments = new Vector ();
+                    int start, end = -1;
+                    do {
+                        start = end + 1;
+                        end = value.indexOf (separator, start);
+                        String segment;
+                        if (end is -1) {
+                            segment = value.substring (start);
+                        } else {
+                            segment = value.substring (start, end);
+                        }
+                        if (segment.length () > 0) segments.addElement (stringcast(segment));
+                    } while (end !is -1);
+                    int segmentsSize = segments.size ();
+                    pluginDirs = new String [segmentsSize + 2];
+                    for (index = 0; index < segmentsSize; index++) {
+                        pluginDirs[index] = stringcast(segments.elementAt (index));
+                    }
                 }
             }
             if (pluginDirs is null) {
@@ -136,10 +159,10 @@
             }
 
             /* set the next value to the GRE path + "plugins" */
-            pluginDirs ~= mozillaPath ~ PLUGINS_DIR;
+            pluginDirs[ index++ ] = mozillaPath ~ PLUGINS_DIR;
 
             /* set the next value to the home directory + "/.mozilla/plugins" */
-            pluginDirs ~= System.getProperty("user.home") ~ SEPARATOR_OS ~ USER_PLUGINS_DIR;
+            pluginDirs[ index++ ] = System.getProperty("user.home") ~ SEPARATOR_OS ~ USER_PLUGINS_DIR;
         }
         propertyValues = pluginDirs;
     }
@@ -185,7 +208,7 @@
 /* nsIDirectoryServiceProvider implementation */
 extern(System)
 nsresult GetFile(char* prop, PRBool* persistent, nsIFile* _retval) {
-    String propertyName = tango.stdc.stringz.fromStringz( prop );
+    String propertyName = fromStringz( prop )._idup();
     String propertyValue = null;
 
     if (propertyName == (XPCOM.NS_APP_HISTORY_50_FILE)) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download.d	Fri Mar 27 23:31:11 2009 +0100
@@ -68,7 +68,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in cnsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
  
     if (*riid == nsISupports.IID) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory.d	Fri Mar 27 23:31:11 2009 +0100
@@ -34,7 +34,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in cnsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     
     if (*riid == nsISupports.IID) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory_1_8.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory_1_8.d	Fri Mar 27 23:31:11 2009 +0100
@@ -39,7 +39,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (nsIID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsIID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     //nsID guid = new nsID ();
     //XPCOM.memmove (guid, riid, nsID.sizeof);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download_1_8.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download_1_8.d	Fri Mar 27 23:31:11 2009 +0100
@@ -66,7 +66,7 @@
 }
 
 extern(System)
-nsresult QueryInterface ( cnsID* riid, void** ppvObject) {
+nsresult QueryInterface ( in cnsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
    
     if (*riid == nsISupports.IID) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePicker.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePicker.d	Fri Mar 27 23:31:11 2009 +0100
@@ -59,7 +59,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     
     if (*riid == nsISupports.IID) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePickerFactory.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePickerFactory.d	Fri Mar 27 23:31:11 2009 +0100
@@ -38,7 +38,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     //nsID guid = new nsID ();
     //XPCOM.memmove (guid, riid, nsID.sizeof);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog.d	Fri Mar 27 23:31:11 2009 +0100
@@ -58,7 +58,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     
     if (*riid == nsISupports.IID) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.d	Fri Mar 27 23:31:11 2009 +0100
@@ -39,7 +39,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     
     if (*riid == nsISupports.IID) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.d	Fri Mar 27 23:31:11 2009 +0100
@@ -52,7 +52,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
 
     if (*riid is nsISupports.IID) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/InputStream.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/InputStream.d	Fri Mar 27 23:31:11 2009 +0100
@@ -40,7 +40,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     //nsID guid = new nsID ();
     //XPCOM.memmove (guid, riid, nsID.sizeof);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Mozilla.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Mozilla.d	Fri Mar 27 23:31:11 2009 +0100
@@ -22,7 +22,7 @@
 } else { // Phobos
 }
 
-import org.eclipse.swt.internal.c.gtk;
+//import org.eclipse.swt.internal.c.gtk;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.SWTError;
@@ -51,6 +51,7 @@
 import org.eclipse.swt.internal.Compatibility;
 import org.eclipse.swt.internal.LONG;
 import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.internal.gtk.OS;
 
 import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
 import XPCOMInit = org.eclipse.swt.internal.mozilla.XPCOMInit;
@@ -298,7 +299,7 @@
 
             if (rc is XPCOM.NS_OK) {
                 /* indicates that a XULRunner was found */
-                mozillaPath = greBuffer;
+                mozillaPath = cast(String)greBuffer;
                 IsXULRunner = mozillaPath.length > 0;
 
                 /*
@@ -317,7 +318,12 @@
                         if (Device.DEBUG) getDwtLogger().error (__FILE__, __LINE__, "cannot use detected XULRunner: {}", mozillaPath); //$NON-NLS-1$
                         
                         /* attempt to XPCOMGlueStartup the GRE pointed at by MOZILLA_FIVE_HOME */
-                        auto ptr = Environment.get(XPCOM.MOZILLA_FIVE_HOME);
+                        version(Tango){
+                            auto ptr = Environment.get(XPCOM.MOZILLA_FIVE_HOME);
+                        } else { // Phobos
+                            implMissing(__FILE__, __LINE__);
+                            String ptr;
+                        }
 
                         if (ptr is null) {
                             IsXULRunner = false;
@@ -368,7 +374,12 @@
             }
 
             /* attempt to use the GRE pointed at by MOZILLA_FIVE_HOME */
-            auto mozFiveHome = Environment.get(XPCOM.MOZILLA_FIVE_HOME);
+            version(Tango){
+                auto mozFiveHome = Environment.get(XPCOM.MOZILLA_FIVE_HOME);
+            } else { // Phobos
+                implMissing(__FILE__, __LINE__);
+                String mozFiveHome;
+            }
             if (mozFiveHome !is null) {
                 mozillaPath = mozFiveHome;
             } else {
@@ -629,7 +640,7 @@
                 error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
             }
             int span = XPCOM.strlen_PRUnichar (tmpChars);
-            prefLocales = Utf.toString(tmpChars[0 .. span]) ~ TOKENIZER_LOCALE;
+            prefLocales = String_valueOf(tmpChars[0 .. span]) ~ TOKENIZER_LOCALE;
         }
 
         /*
@@ -637,16 +648,22 @@
          * user's current locale and language to the original value 
          */
 
-        String language = Culture.current.twoLetterLanguageName ();
-        String country = Region.current.twoLetterRegionName ();
-        String stringBuffer = language.dup;
+        version(Tango){
+            String language = Culture.current.twoLetterLanguageName ();
+            String country = Region.current.twoLetterRegionName ();
+        } else { // Phobos
+            implMissing(__FILE__, __LINE__);
+            String language = "en";
+            String country = "us";
+        }
+        String stringBuffer = language._idup();
 
         stringBuffer ~= SEPARATOR_LOCALE;
         stringBuffer ~= country.toLowerCase ();
         stringBuffer ~= TOKENIZER_LOCALE;
         stringBuffer ~= language;
         stringBuffer ~= TOKENIZER_LOCALE;
-        String newLocales = stringBuffer.dup;
+        String newLocales = stringBuffer._idup();
 
         int start, end = -1;
         do {
@@ -666,7 +683,7 @@
                 }
             }
         } while (end !is -1);
-        newLocales[] = stringBuffer[];
+        (cast(char[])newLocales)[] = stringBuffer[];
         if (!newLocales.equals (prefLocales)) {
             /* write the new locale value */
             newLocales = newLocales.substring (0, newLocales.length () - TOKENIZER_LOCALE.length ()); /* remove trailing tokenizer */
@@ -716,7 +733,7 @@
                 error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
             }
             int span = XPCOM.strlen_PRUnichar (tmpChar);
-            prefCharset = Utf.toString(tmpChar[0 .. span]);
+            prefCharset = String_valueOf(tmpChar[0 .. span]);
         }
 
         String newCharset = System.getProperty ("file.encoding");   // $NON-NLS-1$
@@ -1327,12 +1344,12 @@
         //int length = XPCOM.strlen_PRUnichar (string);
         //chars = new char[length];
         //XPCOM.memmove (chars, result[0], length * 2);
-        chars = Utf.toString(fromString16z(string));
+        chars = String_valueOf(fromString16z(string));
     }
 
     componentManager.Release ();
     document.Release ();
-    return chars.dup;
+    return chars._idup();
 }
 
 extern(D)
@@ -1885,7 +1902,7 @@
 /* nsISupports */
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
 
     if (*riid == nsISupports.IID) {
@@ -1970,7 +1987,7 @@
 /* nsIInterfaceRequestor */
 
 extern(System)
-nsresult GetInterface ( nsID* riid, void** ppvObject) {
+nsresult GetInterface ( in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     //nsID guid = new nsID ();
     //XPCOM.memmove (guid, riid, nsID.sizeof);
@@ -2230,7 +2247,7 @@
     //int length = XPCOM.strlen_PRUnichar (aMessage);
     //char[] dest = new char[length];
     //XPCOM.memmove (dest, aMessage, length * 2);
-    event.text = Utf.toString(fromString16z(aMessage));
+    event.text = String_valueOf(fromString16z(aMessage));
     for (int i = 0; i < statusTextListeners.length; i++) {
         statusTextListeners[i].changed (event);
     }
@@ -2254,7 +2271,7 @@
     //char[] dest = new char[length];
     //XPCOM.memmove (dest, status, length * 2);
     //String string = new String (dest);
-    event.text = Utf.toString(fromString16z(status));
+    event.text = String_valueOf(fromString16z(status));
     for (int i = 0; i < statusTextListeners.length; i++) {
         statusTextListeners[i].changed (event);
     }
@@ -2492,7 +2509,7 @@
     if (length > 0) {
         //char[] dest = new char[length];
         //XPCOM.memmove (dest, aTitle, length * 2);
-        event.title = Utf.toString(fromString16z(aTitle));
+        event.title = String_valueOf(fromString16z(aTitle));
     } else {
         event.title = getUrl ();
     }
@@ -2642,11 +2659,11 @@
 extern(System)
 nsresult IsPreferred (char* aContentType, char** aDesiredContentType, PRBool* retval) {
     bool preferred = false;
-    auto size = strlen (aContentType);
+    auto size = OS.strlen (aContentType);
     if (size > 0) {
         //byte[] typeBytes = new byte[size + 1];
         //XPCOM.memmove (typeBytes, aContentType, size);
-        String contentType = fromStringz(aContentType);
+        String contentType = fromStringz(aContentType)._idup();
 
         /* do not attempt to handle known problematic content types */
         if (!contentType.equals (XPCOM.CONTENT_MAYBETEXT) && !contentType.equals (XPCOM.CONTENT_MULTIPART)) {
@@ -2684,7 +2701,7 @@
 
                 //nsICategoryManager categoryManager = new nsICategoryManager (result[0]);
                 //result[0] = 0;
-                char* categoryBytes = "Gecko-Content-Viewers"; //$NON-NLS-1$
+                CCharPtr categoryBytes = "Gecko-Content-Viewers"; //$NON-NLS-1$
                 char* result;
                 rc = categoryManager.GetCategoryEntry (categoryBytes, aContentType, &result);
                 categoryManager.Release ();
@@ -2736,7 +2753,7 @@
     //int length = XPCOM.strlen_PRUnichar (aTipText);
     //char[] dest = new char[length];
     //XPCOM.memmove (dest, aTipText, length * 2);
-    String text = Utf.toString(fromString16z(aTipText));
+    String text = String_valueOf(fromString16z(aTipText));
     if (tip !is null && !tip.isDisposed ()) tip.dispose ();
     Display display = browser.getDisplay ();
     Shell parent = browser.getShell ();
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2.d	Fri Mar 27 23:31:11 2009 +0100
@@ -13,8 +13,9 @@
 module org.eclipse.swt.browser.PromptService2;
 
 version(Tango){
-import tango.stdc.stdlib;
+    static import tango.stdc.stdlib;
 } else { // Phobos
+    static import std.c.stdlib;
 }
 
 import java.lang.all;
@@ -64,7 +65,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in cnsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
  
     if (*riid == nsISupports.IID) {
@@ -163,7 +164,7 @@
             auto span = XPCOM.strlen_PRUnichar (buttonTitle);
             //char[] dest = new char[length];
             //XPCOM.memmove (dest, buttonTitle, length * 2);
-            label = Utf.toString (buttonTitle[0 .. span]);
+            label = String_valueOf (buttonTitle[0 .. span]);
         }
     }
     return label;
@@ -178,12 +179,12 @@
     int span = XPCOM.strlen_PRUnichar (aDialogTitle);
     //char[] dest = new char[length];
     //XPCOM.memmove (dest, aDialogTitle, length * 2);
-    String titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+    String titleLabel = String_valueOf (aDialogTitle[0 .. span]);
 
     span = XPCOM.strlen_PRUnichar (aText);
     //dest = new char[length];
     //XPCOM.memmove (dest, aText, length * 2);
-    String textLabel = Utf.toString (aText[0 .. span]);
+    String textLabel = String_valueOf (aText[0 .. span]);
 
     Shell shell = browser is null ? new Shell () : browser.getShell (); 
     MessageBox messageBox = new MessageBox (shell, SWT.OK | SWT.ICON_WARNING);
@@ -200,17 +201,17 @@
     int span = XPCOM.strlen_PRUnichar (aDialogTitle);
     //char[] dest = new char[length];
     //XPCOM.memmove (dest, aDialogTitle, length * 2);
-    String titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+    String titleLabel = String_valueOf (aDialogTitle[0 .. span]);
 
     span = XPCOM.strlen_PRUnichar (aText);
     //dest = new char[length];
     //XPCOM.memmove (dest, aText, length * 2);
-    String textLabel = Utf.toString (aText[0 .. span]);
+    String textLabel = String_valueOf (aText[0 .. span]);
 
     span = XPCOM.strlen_PRUnichar (aCheckMsg);
     //dest = new char[length];
     //XPCOM.memmove (dest, aCheckMsg, length * 2);
-    String checkLabel = Utf.toString (aCheckMsg[0..span]);
+    String checkLabel = String_valueOf (aCheckMsg[0..span]);
 
     Shell shell = browser is null ? new Shell () : browser.getShell ();
     PromptDialog dialog = new PromptDialog (shell);
@@ -233,12 +234,12 @@
     int span = XPCOM.strlen_PRUnichar (aDialogTitle);
     //char[] dest = new char[length];
     //XPCOM.memmove (dest, aDialogTitle, length * 2);
-    String titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+    String titleLabel = String_valueOf (aDialogTitle[0 .. span]);
 
     span = XPCOM.strlen_PRUnichar (aText);
     //dest = new char[length];
     //XPCOM.memmove (dest, aText, length * 2);
-    String textLabel = Utf.toString (aText[0 .. span]);
+    String textLabel = String_valueOf (aText[0 .. span]);
 
     Shell shell = browser is null ? new Shell () : browser.getShell ();
     MessageBox messageBox = new MessageBox (shell, SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION);
@@ -262,19 +263,19 @@
     int span = XPCOM.strlen_PRUnichar (aDialogTitle);
     //char[] dest = new char[length];
     //XPCOM.memmove (dest, aDialogTitle, length * 2);
-    String titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+    String titleLabel = String_valueOf (aDialogTitle[0 .. span]);
 
     span = XPCOM.strlen_PRUnichar (aText);
     //dest = new char[length];
     //XPCOM.memmove (dest, aText, length * 2);
-    String textLabel = Utf.toString (aText[0 .. span]);
+    String textLabel = String_valueOf (aText[0 .. span]);
     
     String checkLabel = null;
     if (aCheckMsg !is null) {
         span = XPCOM.strlen_PRUnichar (aCheckMsg);
         //dest = new char[length];
         //XPCOM.memmove (dest, aCheckMsg, length * 2);
-        checkLabel = Utf.toString (aCheckMsg[0 .. span]);
+        checkLabel = String_valueOf (aCheckMsg[0 .. span]);
     }
     
     String button0Label = getLabel (aButtonFlags, nsIPromptService.BUTTON_POS_0, aButton0Title);
@@ -310,13 +311,13 @@
         span = XPCOM.strlen_PRUnichar (aDialogTitle);
         //dest = new char[length];
         //XPCOM.memmove (dest, aDialogTitle, length * 2);
-        titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+        titleLabel = String_valueOf (aDialogTitle[0 .. span]);
     }
     
     span = XPCOM.strlen_PRUnichar (aText);
     //dest = new char[length];
     //XPCOM.memmove (dest, aText, length * 2);
-    textLabel = Utf.toString (aText[0 .. span]);
+    textLabel = String_valueOf (aText[0 .. span]);
     
     //int /*long*/[] valueAddr = new int /*long*/[1];
     //XPCOM.memmove (valueAddr, aValue, C.PTR_SIZEOF);
@@ -325,7 +326,7 @@
         span = XPCOM.strlen_PRUnichar (valueAddr[0]);
         //dest = new char[length];
         //XPCOM.memmove (dest, valueAddr[0], length * 2);
-        valueLabel = Utf.toString ((valueAddr[0])[0 .. span]);
+        valueLabel = String_valueOf ((valueAddr[0])[0 .. span]);
     }
     
     if (aCheckMsg !is null) {
@@ -333,7 +334,7 @@
         if (span > 0) {
             //dest = new char[length];
             //XPCOM.memmove (dest, aCheckMsg, length * 2);
-            checkLabel = Utf.toString (aCheckMsg[0 .. span]);
+            checkLabel = String_valueOf (aCheckMsg[0 .. span]);
         }
     }
 
@@ -350,15 +351,19 @@
         */
         int size;
         void* ptr;
-        wchar[] buffer;
+        String16 buffer;
         nsIServiceManager serviceManager;
         if (valueLabel !is null) {
             //cnt = valueLabel.length;
             //buffer = new wchar[cnt + 1];
             //valueLabel.getChars (0, cnt, buffer, 0);
-            buffer = toWCharArray(valueLabel);
+            buffer = valueLabel.toWCharArray();
             size = buffer.length * 2;
-            ptr = tango.stdc.stdlib.malloc (size);
+            version(Tango){
+                ptr = tango.stdc.stdlib.malloc (size);
+            } else { // Phobos
+                ptr = std.c.stdlib.malloc (size);
+            }
             (cast(wchar*)ptr)[0 .. buffer.length] = buffer[0 .. $];
             //XPCOM.memmove (ptr, buffer, size);
             //XPCOM.memmove (aValue, new int /*long*/[] {ptr}, C.PTR_SIZEOF);
@@ -404,7 +409,7 @@
         //int span = XPCOM.strlen_PRUnichar (checkboxLabel);
         //char[] dest = new char[length];
         //XPCOM.memmove (dest, checkboxLabel, length * 2);
-        checkLabel = Utf.toString (fromString16z(checkboxLabel));
+        checkLabel = String_valueOf (fromString16z(checkboxLabel));
         checkValue = *checkboxValue; /* PRBool */
     }
 
@@ -505,7 +510,7 @@
         //span = XPCOM.strlen_PRUnichar (aDialogTitle);
         //dest = new char[length];
         //XPCOM.memmove (dest, aDialogTitle, length * 2);
-        titleLabel = Utf.toString (fromString16z(aDialogTitle));
+        titleLabel = String_valueOf (fromString16z(aDialogTitle));
     } else {
         //titleLabel = SWT.getMessage ("SWT_Authentication_Required");    //$NON-NLS-1$
         titleLabel = "Authentication Required";
@@ -514,7 +519,7 @@
     //span = XPCOM.strlen_PRUnichar (aText);
     //dest = new char[length];
     //XPCOM.memmove (dest, aText, length * 2);
-    textLabel = Utf.toString (fromString16z(aText));
+    textLabel = String_valueOf (fromString16z(aText));
     
     //int /*long*/[] userAddr = new int /*long*/[1];
     //XPCOM.memmove (userAddr, aUsername, C.PTR_SIZEOF);
@@ -523,7 +528,7 @@
             //span = XPCOM.strlen_PRUnichar (userAddr[0]);
             //dest = new char[length];
             //XPCOM.memmove (dest, userAddr[0], length * 2);
-            userLabel = Utf.toString(fromString16z(*aUsername));       
+            userLabel = String_valueOf(fromString16z(*aUsername));       
     }
     
     //int /*long*/[] passAddr = new int /*long*/[1];
@@ -533,7 +538,7 @@
             //span = XPCOM.strlen_PRUnichar (passAddr[0]);
             //dest = new char[length];
             //XPCOM.memmove (dest, passAddr[0], length * 2);
-            passLabel = Utf.toString(fromString16z(*aPassword));       
+            passLabel = String_valueOf(fromString16z(*aPassword));       
     }
     
     if (aCheckMsg !is null) {
@@ -541,7 +546,7 @@
         //if (span > 0) {
             //dest = new char[length];
             //XPCOM.memmove (dest, aCheckMsg, length * 2);
-        checkLabel = Utf.toString (fromString16z(aCheckMsg));
+        checkLabel = String_valueOf (fromString16z(aCheckMsg));
         //}
     }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2Factory.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2Factory.d	Fri Mar 27 23:31:11 2009 +0100
@@ -38,7 +38,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     //nsID guid = new nsID ();
     //XPCOM.memmove (guid, riid, nsID.sizeof);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/SimpleEnumerator.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/SimpleEnumerator.d	Fri Mar 27 23:31:11 2009 +0100
@@ -41,7 +41,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     //nsID guid = new nsID ();
     //XPCOM.memmove (guid, riid, nsID.sizeof);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WindowCreator2.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WindowCreator2.d	Fri Mar 27 23:31:11 2009 +0100
@@ -54,7 +54,7 @@
 }
 
 extern(System)
-nsresult QueryInterface (cnsID* riid, void** ppvObject) {
+nsresult QueryInterface (in cnsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     //nsID guid = new nsID ();
     //XPCOM.memmove (guid, riid, nsID.sizeof);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/HTMLTransfer.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/HTMLTransfer.d	Fri Mar 27 23:31:11 2009 +0100
@@ -103,7 +103,7 @@
     int size = (transferData.format * transferData.length / 8) / 2 * 2;
     if (size <= 0) return null;
     String chars = transferData.pValue[ 0 .. size ]._idup();
-    int end = string.indexOf('\0');
+    int end = chars.indexOf('\0');
     return new ArrayWrapperString( (end is -1 )? chars : chars[ 0 .. end ] );
 }
 protected override int[] getTypeIds() {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Font.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Font.d	Fri Mar 27 23:31:11 2009 +0100
@@ -140,13 +140,13 @@
  *    <li>ERROR_NO_HANDLES - if a font could not be created from the given arguments</li>
  * </ul>
  */
-public this(Device device, String name, int height, int style) {
+public this(Device device, in String name, int height, int style) {
     super(device);
     init_(name, height, style, null);
     init_();
 }
 
-/*public*/ this(Device device, String name, float height, int style) {
+/*public*/ this(Device device, in String name, float height, int style) {
     super(device);
     init_(name, height, style, null);
     init_();
@@ -192,7 +192,7 @@
     if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
 
     auto family = OS.pango_font_description_get_family(handle);
-    String name = fromStringz( family );
+    String name = fromStringz( family )._idup();
     float height = cast(float)OS.pango_font_description_get_size(handle) / OS.PANGO_SCALE;
     int pangoStyle = OS.pango_font_description_get_style(handle);
     int pangoWeight = OS.pango_font_description_get_weight(handle);
@@ -201,7 +201,7 @@
     if (pangoStyle is OS.PANGO_STYLE_OBLIQUE) style |= SWT.ROMAN;
     if (pangoWeight >= OS.PANGO_WEIGHT_BOLD) style |= SWT.BOLD;
     auto fontString = OS.pango_font_description_to_string (handle);
-    auto buffer = fromStringz( fontString ).dup;
+    auto buffer = fromStringz( fontString )._idup();
     FontData data = new FontData( buffer , height, style);
     OS.g_free (fontString);
     data.str = buffer;
@@ -243,7 +243,7 @@
     return cast(hash_t)/*64*/handle;
 }
 
-void init_(String name, float height, int style, char[] fontString) {
+void init_( in String name, float height, int style, in String fontString) {
     if (name is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
     if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
     if (fontString !is null) {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/FontData.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/FontData.d	Fri Mar 27 23:31:11 2009 +0100
@@ -134,8 +134,8 @@
     if (end is -1 ) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
     String version1 = str[ start .. end ];
     try {
-        if (to!(int)(version1) !is 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
-    } catch (ConversionException e) {
+        if (Integer.parseInt(version1) !is 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    } catch (NumberFormatException e) {
         SWT.error(SWT.ERROR_INVALID_ARGUMENT);
     }
 
@@ -149,8 +149,8 @@
     if (end is -1 ) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
     float height = 0;
     try {
-        height = to!(float)(str[start .. end]);
-    } catch (ConversionException e) {
+        height = Float.parseFloat(str[start .. end]);
+    } catch (NumberFormatException e) {
         SWT.error(SWT.ERROR_INVALID_ARGUMENT);
     }
 
@@ -159,8 +159,8 @@
     if (end is -1 ) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
     int style = 0;
     try {
-        style = to!(int)( str[start .. end ]);
-    } catch (ConversionException e) {
+        style = Integer.parseInt( str[start .. end ]);
+    } catch (NumberFormatException e) {
         SWT.error(SWT.ERROR_INVALID_ARGUMENT);
     }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GC.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GC.d	Fri Mar 27 23:31:11 2009 +0100
@@ -410,7 +410,7 @@
         }
         if (dashes !is null) {
             if ((state & LINE_STYLE) !is 0) {
-                String dash_list = new char[dashes.length];
+                auto dash_list = new char[dashes.length];
                 for (int i = 0; i < dash_list.length; i++) {
                     dash_list[i] = cast(char)(width is 0 || data.lineStyle is SWT.LINE_CUSTOM ? dashes[i] : dashes[i] * width);
                 }
@@ -957,11 +957,11 @@
     byte[] alphaData = srcImage.alphaData;
     for (int y=0; y<srcHeight; y++) {
         int alphaIndex = (y + srcY) * imgWidth + srcX;
-        memmove(line.ptr, pixels + (y * stride), stride);
+        OS.memmove(line.ptr, pixels + (y * stride), stride);
         for (int x=3; x<stride; x+=4) {
             line[x] = alphaData is null ? alpha : alphaData[alphaIndex++];
         }
-        memmove(pixels + (y * stride), line.ptr, stride);
+        OS.memmove(pixels + (y * stride), line.ptr, stride);
     }
     if (srcWidth !is destWidth || srcHeight !is destHeight) {
         auto scaledPixbuf = OS.gdk_pixbuf_scale_simple(pixbuf, destWidth, destHeight, OS.GDK_INTERP_BILINEAR);
@@ -1006,15 +1006,15 @@
                     byte[] maskLine = new byte[maskStride];
                     for (int y=0; y<srcHeight; y++) {
                         auto offset = pixels + (y * stride);
-                        memmove(line.ptr, offset, stride);
+                        OS.memmove(line.ptr, offset, stride);
                         auto maskOffset = maskPixels + (y * maskStride);
-                        memmove(maskLine.ptr, maskOffset, maskStride);
+                        OS.memmove(maskLine.ptr, maskOffset, maskStride);
                         for (int x=0; x<srcWidth; x++) {
                             if (maskLine[x * 3] is 0) {
                                 line[x*4+3] = 0;
                             }
                         }
-                        memmove(offset, line.ptr, stride);
+                        OS.memmove(offset, line.ptr, stride);
                     }
                     OS.g_object_unref(maskPixbuf);
                     auto scaledPixbuf = OS.gdk_pixbuf_scale_simple(pixbuf, destWidth, destHeight, OS.GDK_INTERP_BILINEAR);
@@ -1040,7 +1040,7 @@
             int newWidth =  srcX + srcWidth;
             int newHeight = srcY + srcHeight;
             int bytesPerLine = (newWidth + 7) / 8;
-            String maskData = new char[bytesPerLine * newHeight];
+            auto maskData = new char[bytesPerLine * newHeight];
             auto mask = cast(GdkDrawable *) OS.gdk_bitmap_create_from_data(null, maskData.ptr, newWidth, newHeight);
             if (mask !is null) {
                 auto gc = OS.gdk_gc_new(mask);
@@ -3126,8 +3126,8 @@
 static void setCairoFont(cairo_t* cairo, PangoFontDescription* font) {
     auto family = OS.pango_font_description_get_family(font);
     int len = /*OS.*/strlen(family);
-    String buffer = new char[len + 1];
-    memmove(buffer.ptr, family, len);
+    auto buffer = new char[len + 1];
+    OS.memmove(buffer.ptr, family, len);
     //TODO - convert font height from pango to cairo
     double height = OS.PANGO_PIXELS(OS.pango_font_description_get_size(font)) * 96 / 72;
     int pangoStyle = OS.pango_font_description_get_style(font);
@@ -3763,7 +3763,7 @@
     if (str is data.str && (flags & ~SWT.DRAW_TRANSPARENT) is (data.drawFlags  & ~SWT.DRAW_TRANSPARENT)) {
         return;
     }
-    String buffer;
+    char[] buffer;
     int mnemonic, len = str.length ;
     auto layout = data.layout;
     char[] text = str.dup;
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Image.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Image.d	Fri Mar 27 23:31:11 2009 +0100
@@ -314,7 +314,7 @@
                 byte oneBlue = cast(byte)oneRGB.blue;
                 byte[] line = new byte[stride];
                 for (int y=0; y<height; y++) {
-                    memmove(line.ptr, pixels + (y * stride), stride);
+                    OS.memmove(line.ptr, pixels + (y * stride), stride);
                     for (int x=0; x<width; x++) {
                         int offset = x*3;
                         int red = line[offset] & 0xFF;
@@ -331,14 +331,14 @@
                             line[offset+2] = oneBlue;
                         }
                     }
-                    memmove(pixels + (y * stride), line.ptr, stride);
+                    OS.memmove(pixels + (y * stride), line.ptr, stride);
                 }
                 break;
             }
             case SWT.IMAGE_GRAY: {
                 byte[] line = new byte[stride];
                 for (int y=0; y<height; y++) {
-                memmove(line.ptr, pixels + (y * stride), stride);
+                OS.memmove(line.ptr, pixels + (y * stride), stride);
                     for (int x=0; x<width; x++) {
                         int offset = x*3;
                         int red = line[offset] & 0xFF;
@@ -347,7 +347,7 @@
                         byte intensity = cast(byte)((red+red+green+green+green+green+green+blue) >> 3);
                         line[offset] = line[offset+1] = line[offset+2] = intensity;
                     }
-                    memmove(pixels + (y * stride), line.ptr, stride);
+                    OS.memmove(pixels + (y * stride), line.ptr, stride);
                 }
                 break;
             }
@@ -569,12 +569,12 @@
                 byte[] line = new byte[stride];
                 alphaData = new byte[width * height];
                 for (int y = 0; y < height; y++) {
-                    memmove(line.ptr, pixels + (y * stride), stride);
+                    OS.memmove(line.ptr, pixels + (y * stride), stride);
                     for (int x = 0; x < width; x++) {
                         alphaData[y*width+x] = line[x*4 + 3];
                         line[x*4 + 3] = cast(byte) 0xFF;
                     }
-                    memmove(pixels + (y * stride), line.ptr, stride);
+                    OS.memmove(pixels + (y * stride), line.ptr, stride);
                 }
                 createAlphaMask(width, height);
             }
@@ -607,12 +607,12 @@
             GdkImage* gdkImage = new GdkImage();
             *gdkImage = *imagePtr;
             if (gdkImage.bpl is width) {
-                memmove(gdkImage.mem, alphaData.ptr, alphaData.length);
+                OS.memmove(gdkImage.mem, alphaData.ptr, alphaData.length);
             } else {
                 byte[] line = new byte[gdkImage.bpl];
                 for (int y = 0; y < height; y++) {
                     System.arraycopy(alphaData, width * y, line, 0, width);
-                    memmove(gdkImage.mem + (gdkImage.bpl * y), line.ptr, gdkImage.bpl);
+                    OS.memmove(gdkImage.mem + (gdkImage.bpl * y), line.ptr, gdkImage.bpl);
                 }
             }
             OS.gdk_draw_image(mask, gc, imagePtr, 0, 0, 0, 0, width, height);
@@ -669,8 +669,8 @@
             byte[] maskLine = new byte[maskStride];
             auto offset = pixels, maskOffset = maskPixels;
             for (int y=0; y<height; y++) {
-                memmove(line.ptr, offset, stride);
-                memmove(maskLine.ptr, maskOffset, maskStride);
+                OS.memmove(line.ptr, offset, stride);
+                OS.memmove(maskLine.ptr, maskOffset, maskStride);
                 for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
                     if (maskLine[x * 3] is 0) {
                         line[offset1 + 0] = line[offset1 + 1] = line[offset1 + 2] = line[offset1 + 3] = 0;
@@ -679,7 +679,7 @@
                     line[offset1] = line[offset1 + 2];
                     line[offset1 + 2] = temp;
                 }
-                memmove(offset, line.ptr, stride);
+                OS.memmove(offset, line.ptr, stride);
                 offset += stride;
                 maskOffset += maskStride;
             }
@@ -687,7 +687,7 @@
         } else if (alpha !is -1) {
             auto offset = pixels;
             for (int y=0; y<height; y++) {
-                memmove(line.ptr, offset, stride);
+                OS.memmove(line.ptr, offset, stride);
                 for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
                     line[offset1+3] = cast(byte)alpha;
                     /* pre-multiplied alpha */
@@ -701,13 +701,13 @@
                     line[offset1 + 1] = cast(byte)g;
                     line[offset1 + 2] = cast(byte)r;
                 }
-                memmove(offset, line.ptr, stride);
+                OS.memmove(offset, line.ptr, stride);
                 offset += stride;
             }
         } else if (alphaData !is null) {
             auto offset = pixels;
             for (int y = 0; y < h; y++) {
-                memmove (line.ptr, offset, stride);
+                OS.memmove (line.ptr, offset, stride);
                 for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
                     int alpha = alphaData [y*w+x] & 0xFF;
                     line[offset1+3] = cast(byte)alpha;
@@ -722,25 +722,25 @@
                     line[offset1 + 1] = cast(byte)g;
                     line[offset1 + 2] = cast(byte)r;
                 }
-                memmove (offset, line.ptr, stride);
+                OS.memmove (offset, line.ptr, stride);
                 offset += stride;
             }
         } else {
             auto offset = pixels;
             for (int y = 0; y < h; y++) {
-                memmove (line.ptr, offset, stride);
+                OS.memmove (line.ptr, offset, stride);
                 for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
                     line[offset1+3] = cast(byte)0xFF;
                     byte temp = line[offset1];
                     line[offset1] = line[offset1 + 2];
                     line[offset1 + 2] = temp;
                 }
-                memmove (offset, line.ptr, stride);
+                OS.memmove (offset, line.ptr, stride);
                 offset += stride;
             }
         }
         surfaceData = cast(cairo_surface_t*) OS.g_malloc(stride * height);
-        memmove(surfaceData, pixels, stride * height);
+        OS.memmove(surfaceData, pixels, stride * height);
         surface = Cairo.cairo_image_surface_create_for_data(cast(char*)surfaceData, Cairo.CAIRO_FORMAT_ARGB32, width, height, stride);
         OS.g_object_unref(pixbuf);
     } else {
@@ -868,7 +868,7 @@
     int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
     auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
     byte[] srcData = new byte[stride * height];
-    memmove(srcData.ptr, pixels, srcData.length);
+    OS.memmove(srcData.ptr, pixels, srcData.length);
     OS.g_object_unref(pixbuf);
 
     PaletteData palette = new PaletteData(0xFF0000, 0xFF00, 0xFF);
@@ -881,9 +881,9 @@
         auto gdkImagePtr = OS.gdk_drawable_get_image(mask, 0, 0, width, height);
         if (gdkImagePtr is null) SWT.error(SWT.ERROR_NO_HANDLES);
         GdkImage* gdkImage = new GdkImage();
-        memmove(gdkImage, gdkImagePtr, GdkImage.sizeof );
+        OS.memmove(gdkImage, gdkImagePtr, GdkImage.sizeof );
         byte[] maskData = new byte[gdkImage.bpl * gdkImage.height];
-        memmove(maskData.ptr, gdkImage.mem, maskData.length);
+        OS.memmove(maskData.ptr, gdkImage.mem, maskData.length);
         OS.g_object_unref(gdkImagePtr);
         int maskPad;
         for (maskPad = 1; maskPad < 128; maskPad++) {
@@ -1016,7 +1016,7 @@
                 false, false);
         }
     }
-    memmove(data, buffer.ptr, stride * height);
+    OS.memmove(data, buffer.ptr, stride * height);
     auto pixmap = cast(GdkDrawable*) OS.gdk_pixmap_new (cast(GdkDrawable*) OS.GDK_ROOT_PARENT(), width, height, -1);
     if (pixmap is null) SWT.error(SWT.ERROR_NO_HANDLES);
     auto gdkGC = OS.gdk_gc_new(pixmap);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoader.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoader.d	Fri Mar 27 23:31:11 2009 +0100
@@ -13,6 +13,7 @@
 module org.eclipse.swt.graphics.ImageLoader;
 
 import java.lang.all;
+import java.util.Vector;
 
 
 public import org.eclipse.swt.graphics.ImageLoaderListener;
@@ -97,12 +98,13 @@
     /*
      * the set of ImageLoader event listeners, created on demand
      */
-    ImageLoaderListener[] imageLoaderListeners;
+    Vector imageLoaderListeners;
 
 /**
  * Construct a new empty ImageLoader.
  */
 public this() {
+    imageLoaderListeners = new Vector();
     reset();
 }
 
@@ -283,7 +285,7 @@
  */
 public void addImageLoaderListener(ImageLoaderListener listener) {
     if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-    imageLoaderListeners ~= listener;
+    imageLoaderListeners.addElement(cast(Object)listener);
 }
 
 /**
@@ -300,8 +302,8 @@
  */
 public void removeImageLoaderListener(ImageLoaderListener listener) {
     if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-    if (imageLoaderListeners.length is 0 ) return;
-    imageLoaderListeners.length = tango.core.Array.remove( imageLoaderListeners, listener, delegate bool(ImageLoaderListener l1, ImageLoaderListener l2 ){ return l1 is l2; });
+    if (imageLoaderListeners is null ) return;
+    imageLoaderListeners.removeElement( cast(Object)listener );
 }
 
 /**
@@ -314,7 +316,8 @@
  * @see #removeImageLoaderListener(ImageLoaderListener)
  */
 public bool hasListeners() {
-    return imageLoaderListeners.length > 0;
+    if( imageLoaderListeners is null ) return false;
+    return imageLoaderListeners.size() > 0;
 }
 
 /**
@@ -325,7 +328,9 @@
  */
 public void notifyListeners(ImageLoaderEvent event) {
     if (!hasListeners()) return;
-    foreach( listener; imageLoaderListeners ){
+    int size = imageLoaderListeners.size();
+    for (int i = 0; i < size; i++) {
+        ImageLoaderListener listener = cast(ImageLoaderListener) imageLoaderListeners.elementAt(i);
         listener.imageDataLoaded(event);
     }
 }
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Path.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Path.d	Fri Mar 27 23:31:11 2009 +0100
@@ -14,7 +14,8 @@
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.internal.Compatibility;
-import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.cairo.Cairo : Cairo;
+import org.eclipse.swt.internal.gtk.OS;
 import org.eclipse.swt.graphics.Resource;
 import org.eclipse.swt.graphics.Device;
 import org.eclipse.swt.graphics.Font;
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Pattern.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Pattern.d	Fri Mar 27 23:31:11 2009 +0100
@@ -21,7 +21,8 @@
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Device;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.cairo.Cairo : Cairo;
+import org.eclipse.swt.internal.gtk.OS;
 
 
 /**
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/TextLayout.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/TextLayout.d	Fri Mar 27 23:31:11 2009 +0100
@@ -15,7 +15,7 @@
 import java.lang.all;
 
 import org.eclipse.swt.internal.Compatibility;
-import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.cairo.Cairo : Cairo;
 import org.eclipse.swt.internal.gtk.OS;
 import org.eclipse.swt.internal.Converter;
 import org.eclipse.swt.SWT;
@@ -176,7 +176,7 @@
             lineIndex++;
         }
         segmentsText.getChars(oldPos, segementsLength, chars,  oldPos + lineIndex * 6);
-        String buffer = chars;// Converter.wcsToMbcs(null, chars, false);
+        auto buffer = chars;// Converter.wcsToMbcs(null, chars, false);
 
         OS.pango_layout_set_text (layout, buffer.ptr, buffer.length);
         ptr = OS.pango_layout_get_text(layout);
@@ -1587,7 +1587,7 @@
         newChars[charCount + segmentCount .. charCount + segmentCount + separator.length ] = separator;
         segmentCount+=separator.length;
     }
-    return newChars[ 0 .. Math.min(charCount + segmentCount, newChars.length) ];
+    return cast(String)newChars[ 0 .. Math.min(charCount + segmentCount, newChars.length) ];
 }
 
 /**
@@ -2213,7 +2213,7 @@
     return offset - invalidOffsets.length;
 }
 
-int validateOffset( String cont, int offset, int step) {
+int validateOffset( CString cont, int offset, int step) {
     if (invalidOffsets is null) return offset + step;
     int i = step > 0 ? 0 : invalidOffsets.length - 1;
     do {
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Compatibility.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Compatibility.d	Fri Mar 27 23:31:11 2009 +0100
@@ -117,7 +117,7 @@
  * @param child the file's name
  * @return true if the file exists
  */
-public static bool fileExists(String parent, String child) {
+public static bool fileExists(CString parent, CString child) {
     return (new File (parent, child)).exists();
 }
 
@@ -192,8 +192,8 @@
  * @return a stream on the file if it could be opened.
  * @exception IOException
  */
-public static InputStream newFileInputStream(String filename) {
-    return new FileInputStream(filename);
+public static InputStream newFileInputStream(CString filename) {
+    return new FileInputStream(filename._idup());
 }
 
 /**
@@ -203,8 +203,8 @@
  * @return a stream on the file if it could be opened.
  * @exception IOException
  */
-public static OutputStream newFileOutputStream(String filename) {
-    return new FileOutputStream(filename);
+public static OutputStream newFileOutputStream(CString filename) {
+    return new FileOutputStream(filename._idup());
 }
 
 /**
@@ -272,7 +272,7 @@
  * @exception ProcessException
  *  if the program cannot be executed
  */
-public static void exec(String prog) {
+public static void exec(CString prog) {
     version(Tango){
         auto proc = new Process( prog );
         proc.execute;
@@ -293,7 +293,7 @@
  * @exception ProcessException
  *  if the program cannot be executed
  */
-public static void exec(String[] progArray) {
+public static void exec(CString[] progArray) {
     version(Tango){
         auto proc = new Process( progArray );
         proc.execute;
@@ -341,8 +341,8 @@
  *
  * @see SWT#getMessage(String)
  */
-public static String getMessage(String key) {
-    String answer = key;
+public static String getMessage(CString key) {
+    String answer = key._idup();
 
     if (key is null) {
         SWT.error (SWT.ERROR_NULL_ARGUMENT);
@@ -351,7 +351,7 @@
         try {
             msgs = ResourceBundle.getBundle(SWTMessagesBundleData); //$NON-NLS-1$
         } catch (MissingResourceException ex) {
-            answer = key ~ " (no resource bundle)"; //$NON-NLS-1$
+            answer = cast(String)(key ~ " (no resource bundle)"); //$NON-NLS-1$
         }
     }
     if (msgs !is null) {
@@ -362,8 +362,8 @@
     return answer;
 }
 
-public static String getMessage(String key, Object[] args) {
-    String answer = key;
+public static String getMessage(CString key, Object[] args) {
+    String answer = key._idup();
 
     if (key is null || args is null) {
         SWT.error (SWT.ERROR_NULL_ARGUMENT);
@@ -372,7 +372,7 @@
         try {
             msgs = ResourceBundle.getBundle(SWTMessagesBundleData); //$NON-NLS-1$
         } catch (MissingResourceException ex) {
-            answer = key ~ " (no resource bundle)"; //$NON-NLS-1$
+            answer = cast(String)(key ~ " (no resource bundle)"); //$NON-NLS-1$
         }
     }
     if (msgs !is null) {
@@ -413,7 +413,7 @@
  * @param s2 string
  * @return true if the two instances of class String are equal
  */
-public static bool equalsIgnoreCase(String s1, String s2) {
+public static bool equalsIgnoreCase(CString s1, CString s2) {
     version(Tango){
         String s1b = new char[ s1.length ];
         String s2b = new char[ s1.length ];
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo.d	Fri Mar 27 23:31:11 2009 +0100
@@ -391,7 +391,7 @@
 extern (C) void function(void *, _cairo_matrix *)cairo_get_font_matrix;
 extern (C) void function(void *, _cairo_matrix *)cairo_set_font_matrix;
 extern (C) void function(void *, double)cairo_set_font_size;
-extern (C) void function(void *, char *, int, int)cairo_select_font_face;
+extern (C) void function(void *, in char *, int, int)cairo_select_font_face;
 extern (C) int function(void *)cairo_font_options_get_hint_metrics;
 extern (C) void function(void *, int)cairo_font_options_set_hint_metrics;
 extern (C) int function(void *)cairo_font_options_get_hint_style;
@@ -819,7 +819,7 @@
 extern (C) void cairo_get_font_matrix(void *, _cairo_matrix *);
 extern (C) void cairo_set_font_matrix(void *, _cairo_matrix *);
 extern (C) void cairo_set_font_size(void *, double);
-extern (C) void cairo_select_font_face(void *, char *, int, int);
+extern (C) void cairo_select_font_face(void *, in char *, int, int);
 extern (C) int cairo_font_options_get_hint_metrics(void *);
 extern (C) void cairo_font_options_set_hint_metrics(void *, int);
 extern (C) int cairo_font_options_get_hint_style(void *);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gdk.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gdk.d	Fri Mar 27 23:31:11 2009 +0100
@@ -1600,7 +1600,7 @@
 extern (C) _GdkDrawable * function(_GdkDrawable *, _GdkColormap *, _GdkDrawable * *, _GdkColor *, char *)gdk_pixmap_colormap_create_from_xpm;
 extern (C) _GdkDrawable * function(_GdkDrawable *, _GdkDrawable * *, _GdkColor *, char *)gdk_pixmap_create_from_xpm;
 extern (C) _GdkDrawable * function(_GdkDrawable *, char *, int, int, int, _GdkColor *, _GdkColor *)gdk_pixmap_create_from_data;
-extern (C) _GdkDrawable * function(_GdkDrawable *, char *, int, int)gdk_bitmap_create_from_data;
+extern (C) _GdkDrawable * function(_GdkDrawable *, in char *, int, int)gdk_bitmap_create_from_data;
 extern (C) _GdkDrawable * function(_GdkDrawable *, int, int, int)gdk_pixmap_new;
 extern (C) uint function()gdk_pixmap_get_type;
 extern (C) _PangoAttribute * function(_GdkColor *)gdk_pango_attr_emboss_color_new;
@@ -1766,7 +1766,7 @@
 extern (C) void function(_GdkGC *, _GdkColormap *)gdk_gc_set_colormap;
 extern (C) void function(_GdkGC *, _GdkGC *)gdk_gc_copy;
 extern (C) void function(_GdkGC *, int, int)gdk_gc_offset;
-extern (C) void function(_GdkGC *, int, char *, int)gdk_gc_set_dashes;
+extern (C) void function(_GdkGC *, int, in char *, int)gdk_gc_set_dashes;
 extern (C) void function(_GdkGC *, int, int, int, int)gdk_gc_set_line_attributes;
 extern (C) void function(_GdkGC *, int)gdk_gc_set_exposures;
 extern (C) void function(_GdkGC *, int)gdk_gc_set_subwindow;
@@ -3026,7 +3026,7 @@
 extern (C) _GdkDrawable * gdk_pixmap_colormap_create_from_xpm(_GdkDrawable *, _GdkColormap *, _GdkDrawable * *, _GdkColor *, char *);
 extern (C) _GdkDrawable * gdk_pixmap_create_from_xpm(_GdkDrawable *, _GdkDrawable * *, _GdkColor *, char *);
 extern (C) _GdkDrawable * gdk_pixmap_create_from_data(_GdkDrawable *, char *, int, int, int, _GdkColor *, _GdkColor *);
-extern (C) _GdkDrawable * gdk_bitmap_create_from_data(_GdkDrawable *, char *, int, int);
+extern (C) _GdkDrawable * gdk_bitmap_create_from_data(_GdkDrawable *, in char *, int, int);
 extern (C) _GdkDrawable * gdk_pixmap_new(_GdkDrawable *, int, int, int);
 extern (C) uint gdk_pixmap_get_type();
 extern (C) _PangoAttribute * gdk_pango_attr_emboss_color_new(_GdkColor *);
@@ -3192,7 +3192,7 @@
 extern (C) void gdk_gc_set_colormap(_GdkGC *, _GdkColormap *);
 extern (C) void gdk_gc_copy(_GdkGC *, _GdkGC *);
 extern (C) void gdk_gc_offset(_GdkGC *, int, int);
-extern (C) void gdk_gc_set_dashes(_GdkGC *, int, char *, int);
+extern (C) void gdk_gc_set_dashes(_GdkGC *, int, in char *, int);
 extern (C) void gdk_gc_set_line_attributes(_GdkGC *, int, int, int, int);
 extern (C) void gdk_gc_set_exposures(_GdkGC *, int);
 extern (C) void gdk_gc_set_subwindow(_GdkGC *, int);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/XPCOMInit.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/XPCOMInit.d	Fri Mar 27 23:31:11 2009 +0100
@@ -38,10 +38,10 @@
     align(4):
 
     struct GREVersionRange {
-        char    *lower;
-        int     lowerInclusive;
-        char    *upper;
-        int     upperInclusive;
+        CCharPtr    lower;
+        int         lowerInclusive;
+        CCharPtr    upper;
+        int         upperInclusive;
     }
 
     struct GREProperty {
@@ -55,5 +55,5 @@
 extern(System):
 
 nsresult GRE_GetGREPathWithProperties(GREVersionRange *versions, PRUint32 versionsLength, GREProperty *properties, PRUint32 propertiesLength, char *buffer, PRUint32 buflen);
-nsresult XPCOMGlueStartup(char* xpcomFile);
+nsresult XPCOMGlueStartup(in char* xpcomFile);
 nsresult XPCOMGlueShutdown ();
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICategoryManager.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICategoryManager.d	Fri Mar 27 23:31:11 2009 +0100
@@ -19,11 +19,11 @@
   static const nsIID IID = NS_ICATEGORYMANAGER_IID;
 
 extern(System):
-  nsresult GetCategoryEntry(char *aCategory, char *aEntry, char **_retval);
-  nsresult AddCategoryEntry(char *aCategory, char *aEntry, char *aValue, PRBool aPersist, PRBool aReplace, char **_retval);
-  nsresult DeleteCategoryEntry(char *aCategory, char *aEntry, PRBool aPersist);
-  nsresult DeleteCategory(char *aCategory);
-  nsresult EnumerateCategory(char *aCategory, nsISimpleEnumerator *_retval);
+  nsresult GetCategoryEntry(in char *aCategory, in char *aEntry, char **_retval);
+  nsresult AddCategoryEntry(in char *aCategory, in char *aEntry, in char *aValue, PRBool aPersist, PRBool aReplace, char **_retval);
+  nsresult DeleteCategoryEntry(in char *aCategory, in char *aEntry, PRBool aPersist);
+  nsresult DeleteCategory(in char *aCategory);
+  nsresult EnumerateCategory(in char *aCategory, nsISimpleEnumerator *_retval);
   nsresult EnumerateCategories(nsISimpleEnumerator *_retval);
 }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentManager.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentManager.d	Fri Mar 27 23:31:11 2009 +0100
@@ -18,9 +18,9 @@
   static const nsIID IID = NS_ICOMPONENTMANAGER_IID;
 
 extern(System):
-  nsresult GetClassObject(nsCID * aClass, nsIID * aIID, void * *result);
-  nsresult GetClassObjectByContractID(char *aContractID, nsIID * aIID, void * *result);
-  nsresult CreateInstance(nsCID * aClass, nsISupports aDelegate, nsIID * aIID, void * *result);
-  nsresult CreateInstanceByContractID(char *aContractID, nsISupports aDelegate, nsIID * aIID, void * *result);
+  nsresult GetClassObject(in nsCID * aClass, nsIID * aIID, void * *result);
+  nsresult GetClassObjectByContractID(in char *aContractID, nsIID * aIID, void * *result);
+  nsresult CreateInstance(in nsCID * aClass, nsISupports aDelegate, in nsIID * aIID, void * *result);
+  nsresult CreateInstanceByContractID(in char *aContractID, nsISupports aDelegate, in nsIID * aIID, void * *result);
 }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentRegistrar.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentRegistrar.d	Fri Mar 27 23:31:11 2009 +0100
@@ -22,15 +22,15 @@
 extern(System):
   nsresult AutoRegister(nsIFile aSpec);
   nsresult AutoUnregister(nsIFile aSpec);
-  nsresult RegisterFactory(nsCID * aClass, char *aClassName, char *aContractID, nsIFactory aFactory);
-  nsresult UnregisterFactory(nsCID * aClass, nsIFactory aFactory);
-  nsresult RegisterFactoryLocation(nsCID * aClass, char *aClassName, char *aContractID, nsIFile aFile, char *aLoaderStr, char *aType);
-  nsresult UnregisterFactoryLocation(nsCID * aClass, nsIFile aFile);
-  nsresult IsCIDRegistered(nsCID * aClass, PRBool *_retval);
-  nsresult IsContractIDRegistered(char *aContractID, PRBool *_retval);
+  nsresult RegisterFactory(in nsCID * aClass, in char *aClassName, in char *aContractID, nsIFactory aFactory);
+  nsresult UnregisterFactory(in nsCID * aClass, nsIFactory aFactory);
+  nsresult RegisterFactoryLocation(in nsCID * aClass, in char *aClassName, in char *aContractID, nsIFile aFile, in char *aLoaderStr, in char *aType);
+  nsresult UnregisterFactoryLocation(in nsCID * aClass, nsIFile aFile);
+  nsresult IsCIDRegistered(in nsCID * aClass, PRBool *_retval);
+  nsresult IsContractIDRegistered(in char *aContractID, PRBool *_retval);
   nsresult EnumerateCIDs(nsISimpleEnumerator *_retval);
   nsresult EnumerateContractIDs(nsISimpleEnumerator *_retval);
   nsresult CIDToContractID(nsCID * aClass, char **_retval);
-  nsresult ContractIDToCID(char *aContractID, nsCID * *_retval);
+  nsresult ContractIDToCID(in char *aContractID, nsCID * *_retval);
 }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsID.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsID.d	Fri Mar 27 23:31:11 2009 +0100
@@ -44,5 +44,12 @@
 
 }
 
-alias nsID nsCID;
-alias nsID nsIID;
+version(D_Version2){
+    mixin("alias const(nsID) cnsID;");
+} else { // D1
+    alias nsID cnsID;
+}
+alias nsID  nsCID;
+alias nsID  nsIID;
+alias cnsID cnsCID;
+alias cnsID cnsIID;
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIInterfaceRequestor.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIInterfaceRequestor.d	Fri Mar 27 23:31:11 2009 +0100
@@ -18,7 +18,7 @@
   static const nsIID IID = NS_IINTERFACEREQUESTOR_IID;
 
 extern(System):
-  nsresult GetInterface(nsIID * uuid, void * *result);
+  nsresult GetInterface(in nsIID * uuid, void * *result);
 
 }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObserverService.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObserverService.d	Fri Mar 27 23:31:11 2009 +0100
@@ -20,10 +20,10 @@
   static const nsIID IID = NS_IOBSERVERSERVICE_IID;
 
 extern(System):
-  nsresult AddObserver(nsIObserver anObserver, char *aTopic, PRBool ownsWeak);
-  nsresult RemoveObserver(nsIObserver anObserver, char *aTopic);
-  nsresult NotifyObservers(nsISupports aSubject, char *aTopic, PRUnichar *someData);
-  nsresult EnumerateObservers(char *aTopic, nsISimpleEnumerator *_retval);
+  nsresult AddObserver(nsIObserver anObserver, in char *aTopic, PRBool ownsWeak);
+  nsresult RemoveObserver(nsIObserver anObserver, in char *aTopic);
+  nsresult NotifyObservers(nsISupports aSubject, in char *aTopic, PRUnichar *someData);
+  nsresult EnumerateObservers(in char *aTopic, nsISimpleEnumerator *_retval);
 
 }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefBranch.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefBranch.d	Fri Mar 27 23:31:11 2009 +0100
@@ -24,23 +24,23 @@
 
 extern(System):
   nsresult GetRoot(char * *aRoot);
-  nsresult GetPrefType(char *aPrefName, PRInt32 *_retval);
-  nsresult GetBoolPref(char *aPrefName, PRBool *_retval);
-  nsresult SetBoolPref(char *aPrefName, PRInt32 aValue);
-  nsresult GetCharPref(char *aPrefName, char **_retval);
-  nsresult SetCharPref(char *aPrefName, char *aValue);
-  nsresult GetIntPref(char *aPrefName, PRInt32 *_retval);
-  nsresult SetIntPref(char *aPrefName, PRInt32 aValue);
-  nsresult GetComplexValue(char *aPrefName, nsIID * aType, void * *aValue);
-  nsresult SetComplexValue(char *aPrefName, nsIID * aType, nsISupports aValue);
-  nsresult ClearUserPref(char *aPrefName);
-  nsresult LockPref(char *aPrefName);
-  nsresult PrefHasUserValue(char *aPrefName, PRBool *_retval);
-  nsresult PrefIsLocked(char *aPrefName, PRBool *_retval);
-  nsresult UnlockPref(char *aPrefName);
-  nsresult DeleteBranch(char *aStartingAt);
-  nsresult GetChildList(char *aStartingAt, PRUint32 *aCount, char ***aChildArray);
-  nsresult ResetBranch(char *aStartingAt);
+  nsresult GetPrefType(in char *aPrefName, PRInt32 *_retval);
+  nsresult GetBoolPref(in char *aPrefName, PRBool *_retval);
+  nsresult SetBoolPref(in char *aPrefName, PRInt32 aValue);
+  nsresult GetCharPref(in char *aPrefName, char **_retval);
+  nsresult SetCharPref(in char *aPrefName, in char *aValue);
+  nsresult GetIntPref(in char *aPrefName, PRInt32 *_retval);
+  nsresult SetIntPref(in char *aPrefName, PRInt32 aValue);
+  nsresult GetComplexValue(in char *aPrefName, in nsIID * aType, void * *aValue);
+  nsresult SetComplexValue(in char *aPrefName, in nsIID * aType, nsISupports aValue);
+  nsresult ClearUserPref(in char *aPrefName);
+  nsresult LockPref(in char *aPrefName);
+  nsresult PrefHasUserValue(in char *aPrefName, PRBool *_retval);
+  nsresult PrefIsLocked(in char *aPrefName, PRBool *_retval);
+  nsresult UnlockPref(in char *aPrefName);
+  nsresult DeleteBranch(in char *aStartingAt);
+  nsresult GetChildList(in char *aStartingAt, PRUint32 *aCount, char ***aChildArray);
+  nsresult ResetBranch(in char *aStartingAt);
 
 }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProperties.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProperties.d	Fri Mar 27 23:31:11 2009 +0100
@@ -18,10 +18,10 @@
   static const nsIID IID = NS_IPROPERTIES_IID;
 
 extern(System):
-  nsresult Get(char *prop, nsIID * iid, void * *result);
-  nsresult Set(char *prop, nsISupports value);
-  nsresult Has(char *prop, PRBool *_retval);
-  nsresult Undefine(char *prop);
+  nsresult Get(in char *prop, in nsIID * iid, void * *result);
+  nsresult Set(in char *prop, nsISupports value);
+  nsresult Has(in char *prop, PRBool *_retval);
+  nsresult Undefine(in char *prop);
   nsresult GetKeys(PRUint32 *count, char ***keys);
 
 }
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIServiceManager.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIServiceManager.d	Fri Mar 27 23:31:11 2009 +0100
@@ -17,10 +17,10 @@
   static const nsIID IID = NS_ISERVICEMANAGER_IID;
 
 extern(System):
-  nsresult GetService(nsCID * aClass, nsIID * aIID, void * *result);
-  nsresult GetServiceByContractID( in char *aContractID, cnsIID * aIID, void * *result);
-  nsresult IsServiceInstantiated(nsCID * aClass, nsIID * aIID, PRBool *_retval);
-  nsresult IsServiceInstantiatedByContractID(char *aContractID, nsIID * aIID, PRBool *_retval);
+  nsresult GetService(in nsCID * aClass, in nsIID * aIID, void * *result);
+  nsresult GetServiceByContractID( in char *aContractID, in nsIID * aIID, void * *result);
+  nsresult IsServiceInstantiated(in nsCID * aClass, in nsIID * aIID, PRBool *_retval);
+  nsresult IsServiceInstantiatedByContractID(in char *aContractID, in nsIID * aIID, PRBool *_retval);
 
 }
 
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISupports.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISupports.d	Fri Mar 27 23:31:11 2009 +0100
@@ -11,20 +11,13 @@
         { 0x00000000, 0x0000, 0x0000, 
           [ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 ] };
 
-version(D_Version2){
-    mixin("alias const(nsIID) cnsIID;");
-    mixin("alias const(nsID) cnsID;");
-} else { // D1
-    alias nsIID cnsIID;
-    alias nsID cnsID;
-}
 interface IUnknown
 {
     static const char[] IID_STR = NS_ISUPPORTS_IID_STR;
     static const nsIID IID = NS_ISUPPORTS_IID;
 
 extern(System):
-    nsresult QueryInterface( cnsIID* uuid, void **result);
+    nsresult QueryInterface( in nsIID* uuid, void **result);
 
     nsrefcnt AddRef();
     nsrefcnt Release();
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowser.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowser.d	Fri Mar 27 23:31:11 2009 +0100
@@ -23,8 +23,8 @@
   static const nsIID IID = NS_IWEBBROWSER_IID;
 
 extern(System):
-  nsresult AddWebBrowserListener(nsIWeakReference aListener, nsIID * aIID);
-  nsresult RemoveWebBrowserListener(nsIWeakReference aListener, nsIID * aIID);
+  nsresult AddWebBrowserListener(nsIWeakReference aListener, in nsIID * aIID);
+  nsresult RemoveWebBrowserListener(nsIWeakReference aListener, in nsIID * aIID);
   nsresult GetContainerWindow(nsIWebBrowserChrome  *aContainerWindow);
   nsresult SetContainerWindow(nsIWebBrowserChrome  aContainerWindow);
   nsresult GetParentURIContentListener(nsIURIContentListener  *aParentURIContentListener);
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d	Fri Mar 27 21:29:10 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d	Fri Mar 27 23:31:11 2009 +0100
@@ -173,7 +173,7 @@
         GList* function() gnome_vfs_get_registered_mime_types;
         char* function(char*) gnome_vfs_mime_type_from_name;
     }
-    Symbol symbols[] = [
+    static Symbol symbols[] = [
         { "gnome_vfs_mime_get_default_application", cast(void**)&gnome_vfs_mime_get_default_application },
         { "gnome_vfs_make_uri_from_input_with_dirs", cast(void**)&gnome_vfs_make_uri_from_input_with_dirs },
         { "gnome_vfs_mime_application_launch", cast(void**)&gnome_vfs_mime_application_launch },