comparison dwt/browser/DownloadFactory_1_8.d @ 345:5abc6f7f7a95

Fixups
author John Reimer <terminal.node@gmail.com>
date Tue, 28 Oct 2008 22:07:01 -0700
parents 942da4b6558a
children 9a4d7706df52
comparison
equal deleted inserted replaced
344:8198e6052012 345:5abc6f7f7a95
19 import dwt.internal.mozilla.Common; 19 import dwt.internal.mozilla.Common;
20 //import dwt.internal.mozilla.XPCOMObject; 20 //import dwt.internal.mozilla.XPCOMObject;
21 import dwt.internal.mozilla.nsID; 21 import dwt.internal.mozilla.nsID;
22 import dwt.internal.mozilla.nsIFactory; 22 import dwt.internal.mozilla.nsIFactory;
23 import dwt.internal.mozilla.nsISupports; 23 import dwt.internal.mozilla.nsISupports;
24 import dwt.browser.Download_1_8;
24 25
25 class DownloadFactory_1_8 : nsIFactory { 26 class DownloadFactory_1_8 : nsIFactory {
26 //XPCOMObject supports; 27 //XPCOMObject supports;
27 //XPCOMObject factory; 28 //XPCOMObject factory;
28 int refCount = 0; 29 int refCount = 0;
33 34
34 nsrefcnt AddRef () { 35 nsrefcnt AddRef () {
35 refCount++; 36 refCount++;
36 return refCount; 37 return refCount;
37 } 38 }
38 /+
39 void createCOMInterfaces () {
40 /* Create each of the interfaces that this object implements */
41 supports = new XPCOMObject (new int[] {2, 0, 0}) {
42 public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
43 public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
44 public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
45 };
46
47 factory = new XPCOMObject (new int[] {2, 0, 0, 3, 1}) {
48 public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
49 public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
50 public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
51 public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
52 public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
53 };
54 }
55 39
56 void disposeCOMInterfaces () {
57 if (supports !is null) {
58 supports.dispose ();
59 supports = null;
60 }
61 if (factory !is null) {
62 factory.dispose ();
63 factory = null;
64 }
65 }
66
67 int /*long*/ getAddress () {
68 return factory.getAddress ();
69 }
70 +/
71 nsresult QueryInterface (nsIID* riid, void** ppvObject) { 40 nsresult QueryInterface (nsIID* riid, void** ppvObject) {
72 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE; 41 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
73 //nsID guid = new nsID (); 42 //nsID guid = new nsID ();
74 //XPCOM.memmove (guid, riid, nsID.sizeof); 43 //XPCOM.memmove (guid, riid, nsID.sizeof);
75 44