diff --git a/mozilla/xpfe/appshell/public/Makefile.in b/mozilla/xpfe/appshell/public/Makefile.in index 878785fc235..058565a481c 100644 --- a/mozilla/xpfe/appshell/public/Makefile.in +++ b/mozilla/xpfe/appshell/public/Makefile.in @@ -24,6 +24,7 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/config.mk EXPORTS = \ + nsIWebShellWindow.h \ nsAppShellCIDs.h \ nsIAppShellService.h \ nsICmdLineService.h \ diff --git a/mozilla/xpfe/appshell/public/makefile.win b/mozilla/xpfe/appshell/public/makefile.win index cf016fb7c3e..6f1570a18b0 100644 --- a/mozilla/xpfe/appshell/public/makefile.win +++ b/mozilla/xpfe/appshell/public/makefile.win @@ -22,6 +22,7 @@ IGNORE_MANIFEST=1 MODULE=raptor EXPORTS = \ + nsIWebShellWindow.h \ nsAppShellCIDs.h \ nsIAppShellService.h \ nsICmdLineService.h \ diff --git a/mozilla/xpfe/appshell/public/nsIAppShellService.h b/mozilla/xpfe/appshell/public/nsIAppShellService.h index aa55db62dd0..e79ecedcc12 100644 --- a/mozilla/xpfe/appshell/public/nsIAppShellService.h +++ b/mozilla/xpfe/appshell/public/nsIAppShellService.h @@ -29,6 +29,7 @@ class nsIFactory; class nsIURL; class nsIWidget; class nsString; +class nsIStreamObserver; // e5e5af70-8a38-11d2-9938-0080c7cb1080 #define NS_IAPPSHELL_SERVICE_IID \ @@ -39,14 +40,21 @@ class nsString; class nsIAppShellService : public nsISupports { public: + static const nsIID& IID() { static nsIID iid = NS_IAPPSHELL_SERVICE_IID; return iid; } NS_IMETHOD Initialize(void) = 0; NS_IMETHOD Run(void) = 0; + NS_IMETHOD GetNativeEvent(void *& aEvent, nsIWidget* aWidget, PRBool &aIsInWindow, PRBool &aIsMouseEvent) = 0; + NS_IMETHOD DispatchNativeEvent(void * aEvent) = 0; NS_IMETHOD Shutdown(void) = 0; NS_IMETHOD CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID, - nsIWidget*& aResult) = 0; + nsIWidget*& aResult, nsIStreamObserver* anObserver) = 0; + NS_IMETHOD CreateDialogWindow(nsIWidget * aParent, + nsIURL* aUrl, + nsString& aControllerIID, + nsIWidget*& aResult, nsIStreamObserver* anObserver) = 0; NS_IMETHOD CloseTopLevelWindow(nsIWidget* aWindow) = 0; }; diff --git a/mozilla/xpfe/appshell/src/nsAppShellService.cpp b/mozilla/xpfe/appshell/src/nsAppShellService.cpp index 0e8e8546a2f..9338ef0692b 100644 --- a/mozilla/xpfe/appshell/src/nsAppShellService.cpp +++ b/mozilla/xpfe/appshell/src/nsAppShellService.cpp @@ -32,6 +32,7 @@ #include "nsWebShellWindow.h" #include "nsWidgetsCID.h" +#include "nsIStreamObserver.h" #ifdef MOZ_FULLCIRCLE #include "fullsoft.h" @@ -59,9 +60,15 @@ public: NS_IMETHOD Initialize(void); NS_IMETHOD Run(void); + NS_IMETHOD GetNativeEvent(void *& aEvent, nsIWidget* aWidget, PRBool &aIsInWindow, PRBool &aIsMouseEvent); + NS_IMETHOD DispatchNativeEvent(void * aEvent); NS_IMETHOD Shutdown(void); NS_IMETHOD CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID, - nsIWidget*& aResult); + nsIWidget*& aResult, nsIStreamObserver* anObserver); + NS_IMETHOD CreateDialogWindow(nsIWidget * aParent, + nsIURL* aUrl, + nsString& aControllerIID, + nsIWidget*& aResult, nsIStreamObserver* anObserver); NS_IMETHOD CloseTopLevelWindow(nsIWidget* aWindow); @@ -138,6 +145,18 @@ nsAppShellService::Run(void) return mAppShell->Run(); } +NS_IMETHODIMP +nsAppShellService::GetNativeEvent(void *& aEvent, nsIWidget* aWidget, PRBool &aIsInWindow, PRBool &aIsMouseEvent) +{ + return mAppShell->GetNativeEvent(aEvent, aWidget, aIsInWindow, aIsMouseEvent); +} + +NS_IMETHODIMP +nsAppShellService::DispatchNativeEvent(void * aEvent) +{ + return mAppShell->DispatchNativeEvent(aEvent); +} + NS_IMETHODIMP nsAppShellService::Shutdown(void) { @@ -154,7 +173,7 @@ nsAppShellService::Shutdown(void) */ NS_IMETHODIMP nsAppShellService::CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID, - nsIWidget*& aResult) + nsIWidget*& aResult, nsIStreamObserver* anObserver) { nsresult rv; nsWebShellWindow* window; @@ -163,7 +182,7 @@ nsAppShellService::CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID, if (nsnull == window) { rv = NS_ERROR_OUT_OF_MEMORY; } else { - rv = window->Initialize(mAppShell, aUrl, aControllerIID); + rv = window->Initialize(mAppShell, aUrl, aControllerIID, anObserver); if (NS_SUCCEEDED(rv)) { mWindowList->AppendElement((nsIWebShellContainer*)window); aResult = window->GetWidget(); @@ -173,6 +192,35 @@ nsAppShellService::CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID, return rv; } +/* + * Create a new top level window and display the given URL within it... + * + * XXX: + * Currently, the IID of the Controller object for the URL is provided as an + * argument. In the future, this argument will be specified by the XUL document + * itself. + */ +NS_IMETHODIMP +nsAppShellService::CreateDialogWindow(nsIWidget * aParent, + nsIURL* aUrl, nsString& aControllerIID, + nsIWidget*& aResult, nsIStreamObserver* anObserver) +{ + nsresult rv; + nsWebShellWindow* window; + + window = new nsWebShellWindow(); + if (nsnull == window) { + rv = NS_ERROR_OUT_OF_MEMORY; + } else { + rv = window->Initialize(nsnull, mAppShell, aUrl, aControllerIID, anObserver); + if (NS_SUCCEEDED(rv)) { + mWindowList->AppendElement((nsIWebShellContainer*)window); + aResult = window->GetWidget(); + } + } + + return rv; +} NS_IMETHODIMP nsAppShellService::CloseTopLevelWindow(nsIWidget* aWindow)