comparison dwt/browser/WindowCreator2.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 2e591eb01162
children
comparison
equal deleted inserted replaced
347:ff6dd48f5248 348:9a4d7706df52
41 import dwt.browser.VisibilityWindowListener; 41 import dwt.browser.VisibilityWindowListener;
42 import dwt.browser.CloseWindowListener; 42 import dwt.browser.CloseWindowListener;
43 import dwt.browser.WindowEvent; 43 import dwt.browser.WindowEvent;
44 44
45 class WindowCreator2 : nsIWindowCreator2 { 45 class WindowCreator2 : nsIWindowCreator2 {
46 // XPCOMObject supports;
47 // XPCOMObject windowCreator;
48 // XPCOMObject windowCreator2;
49 int refCount = 0; 46 int refCount = 0;
50 47
51 this () { 48 this () {}
52 // createCOMInterfaces (); 49
53 } 50 extern(System)
54
55 nsrefcnt AddRef () { 51 nsrefcnt AddRef () {
56 refCount++; 52 refCount++;
57 return refCount; 53 return refCount;
58 } 54 }
59 55
56 extern(System)
60 nsresult QueryInterface (nsID* riid, void** ppvObject) { 57 nsresult QueryInterface (nsID* riid, void** ppvObject) {
61 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE; 58 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
62 //nsID guid = new nsID (); 59 //nsID guid = new nsID ();
63 //XPCOM.memmove (guid, riid, nsID.sizeof); 60 //XPCOM.memmove (guid, riid, nsID.sizeof);
64 61
79 } 76 }
80 77
81 *ppvObject = null; 78 *ppvObject = null;
82 return XPCOM.NS_ERROR_NO_INTERFACE; 79 return XPCOM.NS_ERROR_NO_INTERFACE;
83 } 80 }
84 81
82 extern(System)
85 nsresult Release () { 83 nsresult Release () {
86 refCount--; 84 refCount--;
87 //if (refCount is 0) disposeCOMInterfaces (); 85 //if (refCount is 0) disposeCOMInterfaces ();
88 return refCount; 86 return refCount;
89 } 87 }
90 88
91 /* nsIWindowCreator */ 89 /* nsIWindowCreator */
92 90
91 extern(System)
93 nsresult CreateChromeWindow (nsIWebBrowserChrome parent, PRUint32 chromeFlags, nsIWebBrowserChrome* _retval) { 92 nsresult CreateChromeWindow (nsIWebBrowserChrome parent, PRUint32 chromeFlags, nsIWebBrowserChrome* _retval) {
94 return CreateChromeWindow2 (parent, chromeFlags, 0, null, null, _retval); 93 return CreateChromeWindow2 (parent, chromeFlags, 0, null, null, _retval);
95 } 94 }
96 95
97 /* nsIWindowCreator2 */ 96 /* nsIWindowCreator2 */
98 97
98 extern(System)
99 nsresult CreateChromeWindow2 (nsIWebBrowserChrome parent, PRUint32 chromeFlags, PRUint32 contextFlags, nsIURI uri, PRBool* cancel, nsIWebBrowserChrome* _retval) { 99 nsresult CreateChromeWindow2 (nsIWebBrowserChrome parent, PRUint32 chromeFlags, PRUint32 contextFlags, nsIURI uri, PRBool* cancel, nsIWebBrowserChrome* _retval) {
100 if (parent is null && (chromeFlags & nsIWebBrowserChrome.CHROME_OPENAS_CHROME) is 0) { 100 if (parent is null && (chromeFlags & nsIWebBrowserChrome.CHROME_OPENAS_CHROME) is 0) {
101 return XPCOM.NS_ERROR_NOT_IMPLEMENTED; 101 return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
102 } 102 }
103 Browser src = null; 103 Browser src = null;