diff dwt/browser/FilePickerFactory.d @ 348:9a4d7706df52

Test Update to fix linux XPCOM interface issues
author John Reimer <terminal.node@gmail.com>
date Fri, 31 Oct 2008 21:46:44 -0700
parents 5abc6f7f7a95
children
line wrap: on
line diff
--- a/dwt/browser/FilePickerFactory.d	Wed Oct 29 20:12:27 2008 -0700
+++ b/dwt/browser/FilePickerFactory.d	Fri Oct 31 21:46:44 2008 -0700
@@ -29,47 +29,15 @@
     //XPCOMObject factory;
     int refCount = 0;
 
-this () {
-//   createCOMInterfaces ();
-}
+this () { }
 
+extern(System)
 nsrefcnt AddRef () {
     refCount++;
     return refCount;
 }
-/+
-void createCOMInterfaces () {
-    /* Create each of the interfaces that this object implements */
-    supports = new XPCOMObject (new int[] {2, 0, 0}) {
-        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 ();}
-    };
-    
-    factory = new XPCOMObject (new int[] {2, 0, 0, 3, 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 CreateInstance (args[0], args[1], args[2]);}
-        public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
-    };
-}
 
-void disposeCOMInterfaces () {
-    if (supports !is null) {
-        supports.dispose ();
-        supports = null;
-    }   
-    if (factory !is null) {
-        factory.dispose ();
-        factory = null; 
-    }
-}
-
-int /*long*/ getAddress () {
-    return factory.getAddress ();
-}
-+/
+extern(System)
 nsresult QueryInterface (nsID* riid, void** ppvObject) {
     if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
     //nsID guid = new nsID ();
@@ -90,6 +58,7 @@
     return XPCOM.NS_ERROR_NO_INTERFACE;
 }
 
+extern(System)
 nsrefcnt Release () {
     refCount--;
     //if (refCount is 0) disposeCOMInterfaces ();
@@ -98,6 +67,7 @@
     
 /* nsIFactory */
 
+extern(System)
 nsresult CreateInstance (nsISupports aOuter, nsID* iid, void** result) { 
      if (result is null) 
         return XPCOM.NS_ERROR_INVALID_ARG;
@@ -110,6 +80,7 @@
     return rv;
 }
 
+extern(System)
 nsresult LockFactory (PRBool lock) {
     return XPCOM.NS_OK;
 }