Clean up nsIAppShellService.idl. b=98026 r=danm sr=alecf

This commit is contained in:
dbaron%fas.harvard.edu 2001-09-10 19:42:54 +00:00
Родитель 9904d904df
Коммит 67ef0876cc
12 изменённых файлов: 63 добавлений и 69 удалений

Просмотреть файл

@ -131,7 +131,7 @@ function (aContentType, aCommand, aWindowTarget, aRequest)
{
var ass =
Components.classes[ASS_CONTRACTID].getService(nsIAppShellService);
w = ass.getHiddenDOMWindow();
w = ass.hiddenDOMWindow;
var args = new Object ();
args.url = channel.URI.spec;

Просмотреть файл

@ -129,7 +129,7 @@ function (aContentType, aCommand, aWindowContext, aRequest)
// Create new XMLterm window
var appShellSvc = Components.classes[ASS_CONTRACTID].getService(nsIAppShellService);
var domWin = appShellSvc.getHiddenDOMWindow();
var domWin = appShellSvc.hiddenDOMWindow;
domWin.open(xmltermChromeURL,"_blank", "chrome,menubar,toolbar,resizable");
}

Просмотреть файл

@ -22,12 +22,6 @@
#include "nsISupports.idl"
%{C++
#include "nscore.h"
#include "nsCom.h"
#include "nsINativeAppSupport.h"
%}
interface nsIXULWindow;
interface nsIURI;
interface nsICmdLineService;
@ -37,17 +31,7 @@ interface nsIDOMWindowInternal;
[ptr] native JSContext(JSContext);
%{C++
/* Forward declarations... */
struct PRThread;
class nsIFactory;
struct JSContext;
#define NS_SIZETOCONTENT -1
// e5e5af70-8a38-11d2-9938-0080c7cb1080
#define NS_IAPPSHELL_SERVICE_IID \
{ 0xe5e5af70, 0x8a38, 0x11d2, \
{0x99, 0x38, 0x00, 0x80, 0xc7, 0xcb, 0x10, 0x80} }
%}
[scriptable, uuid(E5E5AF70-8A38-11D2-9938-0080C7CB1080)]
@ -58,11 +42,13 @@ interface nsIAppShellService : nsISupports
* Required initialization routine.
* @param aCmdLineService is stored and passed to appshell components as
* they are initialized.
* @param aNativeAppSupportOrSplashScreen is an object that can be QI'd to
* either an nsINativeAppSupport or nsISplashScreen;
* this object will be used to implement HideSplashScreen.
* @param aNativeAppSupportOrSplashScreen is an object that can be
* QI'd to either an nsINativeAppSupport or
* nsISplashScreen; this object will be used to
* implement HideSplashScreen.
*/
void Initialize(in nsICmdLineService aCmdLineService, in nsISupports nativeAppSupportOrSplashScreen );
void initialize(in nsICmdLineService aCmdLineService,
in nsISupports nativeAppSupportOrSplashScreen);
/**
* Starts up the profile manager with the given arguments
@ -80,16 +66,18 @@ interface nsIAppShellService : nsISupports
* Runs an application event loop: normally the main event pump which
* defines the lifetime of the application.
*/
void Run();
void run();
/**
* Exit the event loop
*/
void quit();
// Exit the event loop
void Quit();
/**
* Required exit routine. Cleanly shuts down
* the appshell components.
*/
void Shutdown();
void shutdown();
/**
* Create a window.
@ -111,25 +99,28 @@ interface nsIAppShellService : nsISupports
* @param aInitialHeight like aInitialWidth, but subtly different.
* @param aResult the newly created window is returned here.
*/
void CreateTopLevelWindow(in nsIXULWindow aParent,
const long SIZE_TO_CONTENT = -1;
nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent,
in nsIURI aUrl,
in boolean aShowWindow,
in boolean aLoadDefaultPage,
in PRUint32 aChromeMask,
in long aInitialWidth, in long aInitialHeight,
out nsIXULWindow aResult);
in long aInitialWidth,
in long aInitialHeight);
// Apply Initialize function to each app shell component.
void EnumerateAndInitializeComponents();
/**
* Apply Initialize function to each app shell component.
*/
void enumerateAndInitializeComponents();
/**
* Close a window.
* @param aWindow a window.
*/
void CloseTopLevelWindow(in nsIXULWindow aWindow);
void closeTopLevelWindow(in nsIXULWindow aWindow);
[noscript]
void CreateHiddenWindow();
void createHiddenWindow();
/**
* Return the (singleton) application hidden window, automatically created
@ -137,7 +128,7 @@ interface nsIAppShellService : nsISupports
* @param aResult the hidden window. Do not unhide hidden window.
* Do not taunt hidden window.
*/
void GetHiddenWindow(out nsIXULWindow aResult);
readonly attribute nsIXULWindow hiddenWindow;
/**
* Return the (singleton) application hidden window, automatically created
@ -145,7 +136,7 @@ interface nsIAppShellService : nsISupports
* @param aResult the hidden window. Do not unhide hidden window.
* Do not taunt hidden window.
*/
nsIDOMWindowInternal getHiddenDOMWindow();
readonly attribute nsIDOMWindowInternal hiddenDOMWindow;
/**
@ -156,7 +147,7 @@ interface nsIAppShellService : nsISupports
* @aJSContext the corresponding JavaScript context
*/
[noscript]
void GetHiddenWindowAndJSContext(out nsIDOMWindowInternal aHiddenDOMWindow,
void getHiddenWindowAndJSContext(out nsIDOMWindowInternal aHiddenDOMWindow,
out JSContext aJSContext);
/**
@ -165,25 +156,25 @@ interface nsIAppShellService : nsISupports
* knows it can't quit until it's out of registered windows.
* @param aWindow yes
*/
void RegisterTopLevelWindow(in nsIXULWindow aWindow);
void registerTopLevelWindow(in nsIXULWindow aWindow);
/**
* Remove a window from the application's window registry.
* @param aWindow you see the pattern
*/
void UnregisterTopLevelWindow(in nsIXULWindow aWindow);
void unregisterTopLevelWindow(in nsIXULWindow aWindow);
/**
* Remove the splash screen (if visible). This need be called
* only once per application session.
*/
void HideSplashScreen();
void hideSplashScreen();
/**
* We may need to show a XUL dialog before there are any other windows.
* In this case we don't nescesarily want to quit when it is closed.
* Use with extreme caution.
*/
attribute boolean quitOnLastWindowClosing;
};

Просмотреть файл

@ -680,8 +680,8 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
aParent->GetZlevel(&zlevel);
#endif
if (aInitialWidth == NS_SIZETOCONTENT ||
aInitialHeight == NS_SIZETOCONTENT) {
if (aInitialWidth == nsIAppShellService::SIZE_TO_CONTENT ||
aInitialHeight == nsIAppShellService::SIZE_TO_CONTENT) {
aInitialWidth = 1;
aInitialHeight = 1;
intrinsicallySized = PR_TRUE;

Просмотреть файл

@ -23,6 +23,7 @@
#define __nsAppShellService_h
#include "nsIAppShellService.h"
#include "nsINativeAppSupport.h"
#include "nsIObserver.h"
#include "nsWeakReference.h"
#include "nsIAppShell.h"

Просмотреть файл

@ -1267,8 +1267,8 @@ NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags,
nsCOMPtr<nsIXULWindow> newWindow;
appShell->CreateTopLevelWindow(parent, nsnull, PR_FALSE, PR_FALSE,
aChromeFlags, NS_SIZETOCONTENT, NS_SIZETOCONTENT,
getter_AddRefs(newWindow));
aChromeFlags, nsIAppShellService::SIZE_TO_CONTENT,
nsIAppShellService::SIZE_TO_CONTENT, getter_AddRefs(newWindow));
NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE);

Просмотреть файл

@ -346,7 +346,9 @@ static nsresult OpenWindow(const nsAFlatCString& aChromeURL,
static nsresult OpenWindow(const nsAFlatCString& aChromeURL,
const nsAFlatString& aAppArgs)
{
return OpenWindow(aChromeURL, aAppArgs, NS_SIZETOCONTENT, NS_SIZETOCONTENT);
return OpenWindow(aChromeURL, aAppArgs,
nsIAppShellService::SIZE_TO_CONTENT,
nsIAppShellService::SIZE_TO_CONTENT);
}
static nsresult OpenWindow(const nsAFlatCString& aChromeURL,
@ -374,11 +376,11 @@ static nsresult OpenWindow(const nsAFlatCString& aChromeURL,
sarg->SetData(aAppArgs.get());
nsCAutoString features("chrome,dialog=no,all");
if (aHeight != NS_SIZETOCONTENT) {
if (aHeight != nsIAppShellService::SIZE_TO_CONTENT) {
features.Append(",height=");
features.AppendInt(aHeight);
}
if (aWidth != NS_SIZETOCONTENT) {
if (aWidth != nsIAppShellService::SIZE_TO_CONTENT) {
features.Append(",width=");
features.AppendInt(aWidth);
}
@ -634,8 +636,8 @@ static PRBool IsStartupCommand(const char *arg)
static nsresult HandleArbitraryStartup( nsICmdLineService* cmdLineArgs, nsIPref *prefs, PRBool heedGeneralStartupPrefs)
{
nsresult rv;
PRInt32 height = NS_SIZETOCONTENT;
PRInt32 width = NS_SIZETOCONTENT;
PRInt32 height = nsIAppShellService::SIZE_TO_CONTENT;
PRInt32 width = nsIAppShellService::SIZE_TO_CONTENT;
nsXPIDLCString tempString;
// Get the value of -width option
@ -814,8 +816,8 @@ static nsresult Ensure1Window( nsICmdLineService* cmdLineArgs)
}
// No window exists so lets create a browser one
PRInt32 height = NS_SIZETOCONTENT;
PRInt32 width = NS_SIZETOCONTENT;
PRInt32 height = nsIAppShellService::SIZE_TO_CONTENT;
PRInt32 width = nsIAppShellService::SIZE_TO_CONTENT;
// Get the value of -width option
nsXPIDLCString tempString;

Просмотреть файл

@ -100,8 +100,8 @@ nsWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent,
nsCOMPtr<nsIXULWindow> newWindow;
appShell->CreateTopLevelWindow(0, 0, PR_FALSE, PR_FALSE,
aChromeFlags, NS_SIZETOCONTENT, NS_SIZETOCONTENT,
getter_AddRefs(newWindow));
aChromeFlags, nsIAppShellService::SIZE_TO_CONTENT,
nsIAppShellService::SIZE_TO_CONTENT, getter_AddRefs(newWindow));
nsCOMPtr<nsIInterfaceRequestor> thing(do_QueryInterface(newWindow));
if (thing)

Просмотреть файл

@ -165,7 +165,7 @@ nsFilePicker.prototype = {
} else {
try {
var appShellService = Components.classes[APPSHELL_SERV_CONTRACTID].getService(nsIAppShellService);
parent = appShellService.getHiddenDOMWindow();
parent = appShellService.hiddenDOMWindow;
} catch(ex) {
debug("Can't get parent. xpconnect hates me so we can't get one from the appShellService.\n");
debug(ex + "\n");

Просмотреть файл

@ -165,7 +165,7 @@ nsFilePicker.prototype = {
} else {
try {
var appShellService = Components.classes[APPSHELL_SERV_CONTRACTID].getService(nsIAppShellService);
parent = appShellService.getHiddenDOMWindow();
parent = appShellService.hiddenDOMWindow;
} catch(ex) {
debug("Can't get parent. xpconnect hates me so we can't get one from the appShellService.\n");
debug(ex + "\n");

Просмотреть файл

@ -59,8 +59,8 @@ static nsresult DisplayURI(const char *urlStr, PRBool block)
PR_TRUE,
PR_TRUE,
nsIWebBrowserChrome::CHROME_ALL,
NS_SIZETOCONTENT, // width
NS_SIZETOCONTENT, // height
nsIAppShellService::SIZE_TO_CONTENT, // width
nsIAppShellService::SIZE_TO_CONTENT, // height
getter_AddRefs(window));
if (NS_FAILED(rv)) return rv;

Просмотреть файл

@ -40,7 +40,7 @@ function goQuitApplication()
}
};
if (!nativeAppSupport || !nativeAppSupport.isServerMode)
appShell.Quit();
appShell.quit();
return true;
}