# HG changeset patch # User John Reimer # Date 1225335968 25200 # Node ID 2e591eb0116206184db547ed5a6d7bade940df41 # Parent 5abc6f7f7a958b69b7b521baeefc1f5da8f3766c Browser Package now compiles (phase 2 complete) diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/AppFileLocProvider.d --- a/dwt/browser/AppFileLocProvider.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/AppFileLocProvider.d Wed Oct 29 20:06:08 2008 -0700 @@ -39,16 +39,21 @@ String[] pluginDirs; bool isXULRunner; - static final String SEPARATOR_OS = System.getProperty ("file.separator"); //$NON-NLS-1$ + static String SEPARATOR_OS; static final String CHROME_DIR = "chrome"; //$NON-NLS-1$ static final String COMPONENTS_DIR = "components"; //$NON-NLS-1$ static final String HISTORY_FILE = "history.dat"; //$NON-NLS-1$ static final String LOCALSTORE_FILE = "localstore.rdf"; //$NON-NLS-1$ static final String MIMETYPES_FILE = "mimeTypes.rdf"; //$NON-NLS-1$ static final String PLUGINS_DIR = "plugins"; //$NON-NLS-1$ - static final String USER_PLUGINS_DIR = ".mozilla" ~ SEPARATOR_OS ~ "plugins"; //$NON-NLS-1$ //$NON-NLS-2$ + static String USER_PLUGINS_DIR; static final String PREFERENCES_FILE = "prefs.js"; //$NON-NLS-1$ - + +static this () { + SEPARATOR_OS = System.getProperty ("file.separator"); + USER_PLUGINS_DIR = ".mozilla" ~ SEPARATOR_OS ~ "plugins"; +} + this (String path) { mozillaPath = path ~ SEPARATOR_OS; } diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/HelperAppLauncherDialog.d --- a/dwt/browser/HelperAppLauncherDialog.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/HelperAppLauncherDialog.d Wed Oct 29 20:06:08 2008 -0700 @@ -37,12 +37,9 @@ import dwt.widgets.Shell; class HelperAppLauncherDialog : nsIHelperAppLauncherDialog { - //XPCOMObject supports; - //XPCOMObject helperAppLauncherDialog; int refCount = 0; this() { - //createCOMInterfaces (); } nsrefcnt AddRef () { @@ -52,8 +49,6 @@ nsresult QueryInterface (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); if (*riid == nsISupports.IID) { *ppvObject = cast(void*)cast(nsISupports)this; @@ -85,7 +80,7 @@ /* nsIHelperAppLauncherDialog */ -nsresult Show (nsIHelperAppLauncher aLauncher, nsISupports aContext, PRUint32 aReason) { +nsresult Show(nsIHelperAppLauncher aLauncher, nsISupports aContext, PRUint32 aReason) { /* * The interface for nsIHelperAppLauncher changed in GRE versions 1.8 and 1.9. Query for * each of these interfaces in turn until one is found. diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/InputStream.d --- a/dwt/browser/InputStream.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/InputStream.d Wed Oct 29 20:06:08 2008 -0700 @@ -15,9 +15,8 @@ import Math = tango.math.Math; import dwt.dwthelper.utils; -//import dwt.internal.C; import XPCOM = dwt.internal.mozilla.XPCOM; -//import dwt.internal.mozilla.XPCOMObject; + import dwt.internal.mozilla.nsID; import dwt.internal.mozilla.nsIInputStream; import dwt.internal.mozilla.nsISupports; @@ -136,7 +135,7 @@ return XPCOM.NS_OK; } -nsresult IsNonBlocking (PRUint32* _retval) { +nsresult IsNonBlocking (PRBool* _retval) { /* blocking */ *_retval = 0; return XPCOM.NS_OK; diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/Mozilla.d --- a/dwt/browser/Mozilla.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/Mozilla.d Wed Oct 29 20:06:08 2008 -0700 @@ -14,14 +14,6 @@ import dwt.dwthelper.utils; -//import java.io.UnsupportedEncodingException; -//import java.lang.reflect.Constructor; -//import java.lang.reflect.InvocationTargetException; -//import java.lang.reflect.Method; -//import java.util.Enumeration; -//import java.util.Locale; -//import java.util.Vector; - import tango.text.locale.Core; // Necessary for Region/Culture/Locale code import tango.text.convert.Format; import tango.io.Console; @@ -149,19 +141,6 @@ Object webBrowserObject; MozillaDelegate mozDelegate; - /* Interfaces for this Mozilla embedding notification */ -// XPCOMObject supports; -// XPCOMObject weakReference; -// XPCOMObject webProgressListener; -// XPCOMObject webBrowserChrome; -// XPCOMObject webBrowserChromeFocus; -// XPCOMObject embeddingSiteWindow; -// XPCOMObject interfaceRequestor; -// XPCOMObject supportsWeakReference; -// XPCOMObject contextMenuListener; -// XPCOMObject uriContentListener; -// XPCOMObject tooltipListener; -// XPCOMObject domEventListener; int chromeFlags = nsIWebBrowserChrome.CHROME_DEFAULT; int refCount, lastKeyCode, lastCharCode; nsIRequest request; diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/PromptService2.d --- a/dwt/browser/PromptService2.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/PromptService2.d Wed Oct 29 20:06:08 2008 -0700 @@ -13,14 +13,16 @@ module dwt.browser.PromptService2; import tango.stdc.stdlib; +import tango.text.convert.Format; import dwt.dwthelper.utils; import dwt.DWT; -//import dwt.internal.C; + import dwt.internal.Compatibility; + import XPCOM = dwt.internal.mozilla.XPCOM; -//import dwt.internal.mozilla.XPCOMObject; + import dwt.internal.mozilla.Common; import dwt.internal.mozilla.nsEmbedString; import dwt.internal.mozilla.nsIAuthInformation; @@ -38,9 +40,14 @@ import dwt.internal.mozilla.nsIWindowWatcher; import dwt.internal.mozilla.nsIAuthPromptCallback; import dwt.internal.mozilla.nsICancelable; +import dwt.internal.mozilla.nsStringAPI; + import dwt.widgets.MessageBox; import dwt.widgets.Shell; + import dwt.browser.Browser; +import dwt.browser.Mozilla; +import dwt.browser.PromptDialog; class PromptService2 : nsIPromptService2 { int refCount = 0; @@ -95,7 +102,7 @@ //result[0] = 0; //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_WINDOWWATCHER_CONTRACTID, true); nsIWindowWatcher windowWatcher; - rc = serviceManager.GetServiceByContractID (XPCOM.NS_WINDOWWATCHER_CONTRACTID, &nsIWindowWatcher.IID, cast(void**)&windowWatcher); + rc = serviceManager.GetServiceByContractID (XPCOM.NS_WINDOWWATCHER_CONTRACTID.ptr, &nsIWindowWatcher.IID, cast(void**)&windowWatcher); if (rc !is XPCOM.NS_OK) Mozilla.error(rc); if (windowWatcher is null) Mozilla.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); @@ -119,7 +126,7 @@ //nsIWebBrowserChrome webBrowserChrome = new nsIWebBrowserChrome (result[0]); //result[0] = 0; nsIEmbeddingSiteWindow embeddingSiteWindow; - rc = webBrowserChrome.QueryInterface (nsIEmbeddingSiteWindow.IID, cast(void**)&embeddingSiteWindow); + rc = webBrowserChrome.QueryInterface (&nsIEmbeddingSiteWindow.IID, cast(void**)&embeddingSiteWindow); if (rc !is XPCOM.NS_OK) Mozilla.error (rc); if (embeddingSiteWindow is null) Mozilla.error (XPCOM.NS_NOINTERFACE); webBrowserChrome.Release (); @@ -150,7 +157,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 = Utf.toString (buttonTitle[0 .. span]); } } return label; @@ -353,7 +360,7 @@ //result2[0] = 0; nsIMemory memory; //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); - rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID, &nsIMemory.IID, cast(void**)&memory); + rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID.ptr, &nsIMemory.IID, cast(void**)&memory); if (rc !is XPCOM.NS_OK) DWT.error (rc); if (memory is null) DWT.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); @@ -380,10 +387,10 @@ String title = "Authentication Required"; if (checkboxLabel !is null && checkboxValue !is null) { - int span = XPCOM.strlen_PRUnichar (checkboxLabel); + //int span = XPCOM.strlen_PRUnichar (checkboxLabel); //char[] dest = new char[length]; //XPCOM.memmove (dest, checkboxLabel, length * 2); - checkLabel = Utf.toString (checkboxLabel[0 .. span]); + checkLabel = Utf.toString (fromString16z(checkboxLabel)); checkValue = *checkboxValue; /* PRBool */ } @@ -402,7 +409,7 @@ //XPCOM.nsEmbedString_delete (ptr); scope auto ptr2 = new nsEmbedString; - rc = authInfo.GetPassword (ptr2); + rc = authInfo.GetPassword (cast(nsAString*)ptr2); if (rc !is XPCOM.NS_OK) DWT.error (rc); //length = XPCOM.nsEmbedString_Length (ptr); //buffer = XPCOM.nsEmbedString_get (ptr); @@ -425,7 +432,7 @@ //nsIChannel channel = new nsIChannel (aChannel); nsIURI uri; - rc = channel.GetURI (&uri); + rc = aChannel.GetURI (&uri); if (rc !is XPCOM.NS_OK) DWT.error (rc); if (uri is null) Mozilla.error (XPCOM.NS_NOINTERFACE); @@ -458,12 +465,12 @@ //XPCOM.memmove (_retval, result, 4); /* PRBool */ *_retval = result; if (result is 1) { /* User selected OK */ - scope auto string1 = new nsEmbedString (userLabel); + scope auto string1 = new nsEmbedString (toString16(userLabel)); rc = authInfo.SetUsername(cast(nsAString*)string1); if (rc !is XPCOM.NS_OK) DWT.error (rc); //string.dispose (); - scope auto string2 = new nsEmbedString (passLabel); + scope auto string2 = new nsEmbedString (toString16(passLabel)); rc = authInfo.SetPassword(cast(nsAString*)string2); if (rc !is XPCOM.NS_OK) DWT.error (rc); //string.dispose (); @@ -480,54 +487,54 @@ char[] dest; int span; if (aDialogTitle !is null) { - span = XPCOM.strlen_PRUnichar (aDialogTitle); + //span = XPCOM.strlen_PRUnichar (aDialogTitle); //dest = new char[length]; //XPCOM.memmove (dest, aDialogTitle, length * 2); - titleLabel = Utf.toString (aDialogTitle[0 .. span]); + titleLabel = Utf.toString (fromString16z(aDialogTitle)); } else { //titleLabel = DWT.getMessage ("SWT_Authentication_Required"); //$NON-NLS-1$ titleLabel = "Authentication Required"; } - span = XPCOM.strlen_PRUnichar (aText); + //span = XPCOM.strlen_PRUnichar (aText); //dest = new char[length]; //XPCOM.memmove (dest, aText, length * 2); - textLabel = Utf.toString (aText[0 .. span]); + textLabel = Utf.toString (fromString16z(aText)); //int /*long*/[] userAddr = new int /*long*/[1]; //XPCOM.memmove (userAddr, aUsername, C.PTR_SIZEOF); - auto userAddr = aUsername; - if (userAddr[0] !is null) { - span = XPCOM.strlen_PRUnichar (userAddr[0]); + auto userAddr = *aUsername; + if (*aUsername !is null) { + //span = XPCOM.strlen_PRUnichar (userAddr[0]); //dest = new char[length]; //XPCOM.memmove (dest, userAddr[0], length * 2); - userLabel = Utf.toString((userAddr[0])[0 .. span]); + userLabel = Utf.toString(fromString16z(*aUsername)); } //int /*long*/[] passAddr = new int /*long*/[1]; //XPCOM.memmove (passAddr, aPassword, C.PTR_SIZEOF); - auto passAddr = aPassword; - if (passAddr[0] !is null) { - span = XPCOM.strlen_PRUnichar (passAddr[0]); + auto passAddr = *aPassword; + if (*aPassword !is null) { + //span = XPCOM.strlen_PRUnichar (passAddr[0]); //dest = new char[length]; //XPCOM.memmove (dest, passAddr[0], length * 2); - passLabel = Utf.toString((passAddr[0])[0 .. span]); + passLabel = Utf.toString(fromString16z(*aPassword)); } if (aCheckMsg !is null) { - span = XPCOM.strlen_PRUnichar (aCheckMsg); - if (span > 0) { + //span = XPCOM.strlen_PRUnichar (aCheckMsg); + //if (span > 0) { //dest = new char[length]; //XPCOM.memmove (dest, aCheckMsg, length * 2); - checkLabel = Utf.toString (aCheckMsg[0 .. span]); - } + checkLabel = Utf.toString (fromString16z(aCheckMsg)); + //} } Shell shell = browser is null ? new Shell () : browser.getShell (); PromptDialog dialog = new PromptDialog (shell); int check, result; if (aCheckState !is null) check = *aCheckState; /* PRBool */ - dialog.promptUsernameAndPassword (titleLabel, textLabel, checkLabel, userLabel, passLabel, check, result); + dialog.promptUsernameAndPassword (titleLabel, textLabel, checkLabel, /*ref*/ userLabel, /*ref*/ passLabel, check, result); *_retval = result; /* PRBool */ if (result is 1) { @@ -542,17 +549,17 @@ if (userLabel !is null) { //cnt = userLabel[0].length (); //buffer = new char[cnt + 1]; - buffer = Utf.toString16(userLabel); + //buffer = Utf.toString16(userLabel); //userLabel[0].getChars (0, cnt, buffer, 0); - size = buffer.length * 2; - ptr = tango.stdc.stdlib.malloc (size); - (cast(wchar*)ptr)[0 .. buffer.length] = buffer[0 .. $]; + //size = buffer.length * 2; + //ptr = tango.stdc.stdlib.malloc (size); + //(cast(wchar*)ptr)[0 .. buffer.length] = buffer[0 .. $]; //XPCOM.memmove (ptr, buffer, size); - *aUsername = cast(PRUnichar*)ptr; + *aUsername = toString16z(Utf.toString16(userLabel)); //XPCOM.memmove (aUsername, new int /*long*/[] {ptr}, C.PTR_SIZEOF); nsIServiceManager serviceManager; - if (userAddr[0] !is null) { + if (userAddr !is null) { int rc = XPCOM.NS_GetServiceManager (&serviceManager); if (rc !is XPCOM.NS_OK) DWT.error (rc); if (serviceManager is null) DWT.error (XPCOM.NS_NOINTERFACE); @@ -561,30 +568,31 @@ //result2[0] = 0; //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); nsIMemory memory; - rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID, nsIMemory.IID, cast(void**)&memory); + rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID.ptr, &nsIMemory.IID, cast(void**)&memory); if (rc !is XPCOM.NS_OK) DWT.error (rc); if (memory is null) DWT.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); //nsIMemory memory = new nsIMemory (result2[0]); //result2[0] = 0; - memory.Free (userAddr[0]); + memory.Free (userAddr); memory.Release (); } } if (passLabel !is null) { //cnt = passLabel[0].length (); //buffer = new char[cnt + 1]; - buffer = Utf.toString16( passLabel ); + //buffer = Utf.toString16( passLabel ); //passLabel[0].getChars (0, cnt, buffer, 0); - size = buffer.length * 2; - ptr = tango.stdc.stdlib.malloc (size); - (cast(wchar*)ptr)[0 .. buffer.length] = buffer[0 .. $]; + //size = buffer.length * 2; + //ptr = tango.stdc.stdlib.malloc (size); + //(cast(wchar*)ptr)[0 .. buffer.length] = buffer[0 .. $]; //XPCOM.memmove (ptr, buffer, size); - *aPassword = cast(PRUnichar*)ptr; + *aPassword = toString16z(Utf.toString16(passLabel)); //XPCOM.memmove (aPassword, new int /*long*/[] {ptr}, C.PTR_SIZEOF); - if (passAddr[0] !is null) { + nsIServiceManager serviceManager; + if (passAddr !is null) { int rc = XPCOM.NS_GetServiceManager (&serviceManager); if (rc !is XPCOM.NS_OK) DWT.error (rc); if (serviceManager is null) DWT.error (XPCOM.NS_NOINTERFACE); @@ -593,14 +601,14 @@ //result2[0] = 0; //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true); nsIMemory memory; - rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID, nsIMemory.IID, cast(void**)&memory); + rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID.ptr, &nsIMemory.IID, cast(void**)&memory); if (rc !is XPCOM.NS_OK) DWT.error (rc); if (memory is null) DWT.error (XPCOM.NS_NOINTERFACE); serviceManager.Release (); //nsIMemory memory = new nsIMemory (result2[0]); //result2[0] = 0; - memory.Free (passAddr[0]); + memory.Free (passAddr); memory.Release (); } } diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/StatusTextEvent.d --- a/dwt/browser/StatusTextEvent.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/StatusTextEvent.d Wed Oct 29 20:06:08 2008 -0700 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.browser.StatusTextEvent; +import tango.text.convert.Format; + import dwt.dwthelper.utils; import dwt.events.TypedEvent; diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/TitleEvent.d --- a/dwt/browser/TitleEvent.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/TitleEvent.d Wed Oct 29 20:06:08 2008 -0700 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.browser.TitleEvent; +import tango.text.convert.Format; + import dwt.dwthelper.utils; import dwt.events.TypedEvent; @@ -41,7 +43,7 @@ * @return a string representation of the event */ public override String toString() { - return Format( "{} {text = {}}", - super.toString[1 .. $-2], text ); + return Format( "{} {title = {}}", + super.toString[1 .. $-2], title ); } } diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/WindowCreator2.d --- a/dwt/browser/WindowCreator2.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/WindowCreator2.d Wed Oct 29 20:06:08 2008 -0700 @@ -12,17 +12,16 @@ *******************************************************************************/ module dwt.browser.WindowCreator2; -//import dwt.dwthelper.utils; +import dwt.dwthelper.utils; import dwt.DWT; import dwt.graphics.Point; -//import dwt.internal.C; + import dwt.internal.Platform; import dwt.internal.mozilla.Common; import XPCOM = dwt.internal.mozilla.XPCOM; -//import dwt.internal.mozilla.XPCOMObject; import dwt.internal.mozilla.nsIBaseWindow; import dwt.internal.mozilla.nsID; import dwt.internal.mozilla.nsISupports; @@ -31,11 +30,17 @@ import dwt.internal.mozilla.nsIWebBrowserChrome; import dwt.internal.mozilla.nsIWindowCreator; import dwt.internal.mozilla.nsIWindowCreator2; +import dwt.internal.mozilla.nsStringAPI; +import dwt.internal.mozilla.nsEmbedString; + import dwt.layout.FillLayout; import dwt.widgets.Shell; import dwt.browser.Browser; import dwt.browser.Mozilla; +import dwt.browser.VisibilityWindowListener; +import dwt.browser.CloseWindowListener; +import dwt.browser.WindowEvent; class WindowCreator2 : nsIWindowCreator2 { // XPCOMObject supports; @@ -105,7 +110,7 @@ //nsIWebBrowser webBrowser = new nsIWebBrowser (aWebBrowser[0]); nsIBaseWindow baseWindow; - rc = webBrowser.QueryInterface (nsIBaseWindow.IID, cast(void**)&baseWindow); + rc = webBrowser.QueryInterface (&nsIBaseWindow.IID, cast(void**)&baseWindow); if (rc !is XPCOM.NS_OK) Mozilla.error (rc); if (baseWindow is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE); webBrowser.Release (); @@ -151,7 +156,7 @@ }); browser.addCloseWindowListener (new class(shell) CloseWindowListener { Shell sh; - this (Shell shell) { this.shell = shell; } + this (Shell shell) { this.sh = shell; } public void close (WindowEvent event) { sh.close (); } @@ -168,7 +173,7 @@ browser.setUrl (aSpec.toString); } } - XPCOM.nsEmbedCString_delete (aSpec); + //XPCOM.nsEmbedCString_delete (aSpec); } } else { WindowEvent event = new WindowEvent (src); @@ -199,7 +204,7 @@ mozilla.isChild = true; // And since Mozilla class implements the nsIWebBrowserChrome interface.... nsIWebBrowserChrome chrome; - nsresult rc = mozilla.QueryInterface( nsIWebBrowserChrome.IID, cast(void**)&chrome); + nsresult rc = mozilla.QueryInterface( &nsIWebBrowserChrome.IID, cast(void**)&chrome); if (rc !is XPCOM.NS_OK) Mozilla.error (rc); //nsIWebBrowserChrome webBrowserChrome = new nsIWebBrowserChrome (chromePtr); chrome.SetChromeFlags (chromeFlags); diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/browser/WindowEvent.d --- a/dwt/browser/WindowEvent.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/browser/WindowEvent.d Wed Oct 29 20:06:08 2008 -0700 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwt.browser.WindowEvent; +import tango.text.convert.Format; + import dwt.dwthelper.utils; import dwt.events.TypedEvent; @@ -201,10 +203,10 @@ */ public String toString() { - return Format( "{} {required = {}, browser = {}, location = {}, size = {}, addressbar = {}, menubar = {}, statusbar = {}, toobar = {}}", + return Format( "{} {required = {}, browser = {}, location = {}, size = {}, addressbar = {}, menubar = {}, statusbar = {}, toolbar = {}}", super.toString[1 .. $-2], required, browser, - location, size, addressbar, - menubar, statusbar, toolbar ); + location, size, addressBar, + menuBar, statusBar, toolBar ); } } diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/internal/mozilla/nsIExternalHelperAppService.d --- a/dwt/internal/mozilla/nsIExternalHelperAppService.d Tue Oct 28 22:07:01 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -module dwt.internal.mozilla.nsIExternalHelperAppService; - -import dwt.internal.mozilla.Common; -import dwt.internal.mozilla.nsID; -import dwt.internal.mozilla.nsISupports; -import dwt.internal.mozilla.nsICancelable; -import dwt.internal.mozilla.nsIURI; -import dwt.internal.mozilla.nsIRequest; -import dwt.internal.mozilla.nsIStreamListener; -import dwt.internal.mozilla.nsIFile; -import dwt.internal.mozilla.nsIMIMEInfo; -import dwt.internal.mozilla.nsIWebProgressListener2; -import dwt.internal.mozilla.nsIInterfaceRequestor; -import dwt.internal.mozilla.nsStringAPI; - -import dwt.internal.mozilla.prtime; - -/****************************************************************************** - -******************************************************************************/ - -const char[] NS_IEXTERNALHELPERAPPSERVICE_IID_STR = "0ea90cf3-2dd9-470f-8f76-f141743c5678"; - -const nsIID NS_IEXTERNALHELPERAPPSERVICE_IID= - {0x0ea90cf3, 0x2dd9, 0x470f, - [ 0x8f, 0x76, 0xf1, 0x41, 0x74, 0x3c, 0x56, 0x78 ]}; - -//extern(System) - -interface nsIExternalHelperAppService : nsISupports { - - static const char[] IID_STR = NS_IEXTERNALHELPERAPPSERVICE_IID_STR; - static const nsIID IID = NS_IEXTERNALHELPERAPPSERVICE_IID; - - nsresult DoContent(nsACString * aMimeContentType, nsIRequest aRequest, nsIInterfaceRequestor aWindowContext, nsIStreamListener *_retval); - nsresult ApplyDecodingForExtension(nsACString * aExtension, nsACString * aEncodingType, PRBool *_retval); - -} - -/****************************************************************************** - -******************************************************************************/ - -const char[] NS_PIEXTERNALAPPLAUNCHER_IID_STR = "d0b5d7d3-9565-403d-9fb5-e5089c4567c6"; - -const nsIID NS_PIEXTERNALAPPLAUNCHER_IID= - {0xd0b5d7d3, 0x9565, 0x403d, - [ 0x9f, 0xb5, 0xe5, 0x08, 0x9c, 0x45, 0x67, 0xc6 ]}; - -//extern(System) - -interface nsPIExternalAppLauncher : nsISupports { - - static const char[] IID_STR = NS_PIEXTERNALAPPLAUNCHER_IID_STR; - static const nsIID IID = NS_PIEXTERNALAPPLAUNCHER_IID; - - nsresult DeleteTemporaryFileOnExit(nsIFile aTemporaryFile); - -} - -/****************************************************************************** - -******************************************************************************/ - -const char[] NS_IHELPERAPPLAUNCHER_IID_STR = "99a0882d-2ff9-4659-9952-9ac531ba5592"; - -const nsIID NS_IHELPERAPPLAUNCHER_IID= - {0x99a0882d, 0x2ff9, 0x4659, - [ 0x99, 0x52, 0x9a, 0xc5, 0x31, 0xba, 0x55, 0x92 ]}; - -//extern(System) - -interface nsIHelperAppLauncher : nsICancelable { - - static const char[] IID_STR = NS_IHELPERAPPLAUNCHER_IID_STR; - static const nsIID IID = NS_IHELPERAPPLAUNCHER_IID; - - nsresult GetMIMEInfo(nsIMIMEInfo *aMIMEInfo); - nsresult GetSource(nsIURI *aSource); - nsresult GetSuggestedFileName(nsAString * aSuggestedFileName); - nsresult SaveToDisk(nsIFile aNewFileLocation, PRBool aRememberThisPreference); - nsresult LaunchWithApplication(nsIFile aApplication, PRBool aRememberThisPreference); - nsresult SetWebProgressListener(nsIWebProgressListener2 aWebProgressListener); - nsresult CloseProgressWindow(); - nsresult GetTargetFile(nsIFile *aTargetFile); - nsresult GetTimeDownloadStarted(PRTime *aTimeDownloadStarted); - -} - diff -r 5abc6f7f7a95 -r 2e591eb01162 dwt/internal/mozilla/nsIHelperAppLauncherDialog.d --- a/dwt/internal/mozilla/nsIHelperAppLauncherDialog.d Tue Oct 28 22:07:01 2008 -0700 +++ b/dwt/internal/mozilla/nsIHelperAppLauncherDialog.d Wed Oct 29 20:06:08 2008 -0700 @@ -3,7 +3,7 @@ import dwt.internal.mozilla.Common; import dwt.internal.mozilla.nsID; import dwt.internal.mozilla.nsISupports; -import dwt.internal.mozilla.nsIExternalHelperAppService; +import dwt.internal.mozilla.nsIHelperAppLauncher; import dwt.internal.mozilla.nsILocalFile; const char[] NS_IHELPERAPPLAUNCHERDIALOG_IID_STR = "64355793-988d-40a5-ba8e-fcde78cac631"; @@ -22,6 +22,7 @@ enum { REASON_CANTHANDLE = 0U }; enum { REASON_SERVERREQUEST = 1U }; enum { REASON_TYPESNIFFED = 2U }; + nsresult Show(nsIHelperAppLauncher aLauncher, nsISupports aContext, PRUint32 aReason); nsresult PromptForSaveToFile(nsIHelperAppLauncher aLauncher, nsISupports aWindowContext, PRUnichar *aDefaultFile, PRUnichar *aSuggestedFileExtension, nsILocalFile *_retval);