Remove the depenency on the toolkit service.

This commit is contained in:
ramiro%netscape.com 1999-08-27 06:21:43 +00:00
Родитель 9b93a6290a
Коммит ef23a412ce
4 изменённых файлов: 21 добавлений и 150 удалений

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

@ -25,11 +25,6 @@
#include <stdlib.h>
#include "plevent.h"
#include "nsIUnixToolkitService.h"
#include "nsIComponentManager.h"
static NS_DEFINE_CID(kCUnixToolkitServiceCID, NS_UNIX_TOOLKIT_SERVICE_CID);
static nsNativeViewerApp* gTheApp;
nsNativeViewerApp::nsNativeViewerApp()
@ -91,36 +86,14 @@ int main(int argc, char **argv)
gTheApp = new nsNativeViewerApp();
//////////////////////////////////////////////////////////////////////
//
// Toolkit Service setup
//
// Note: This must happend before NS_SetupRegistry() is called so
// that the toolkit specific xpcom components can be registered
// as needed.
//
//////////////////////////////////////////////////////////////////////
nsIUnixToolkitService * unixToolkitService = nsnull;
nsresult rv =
nsComponentManager::CreateInstance(kCUnixToolkitServiceCID,
nsnull,
nsIUnixToolkitService::GetIID(),
(void **) &unixToolkitService);
NS_ASSERTION(NS_SUCCEEDED(rv),"Cannot obtain unix toolkit service.");
// Damn, there's no PR_PutEnv() ???
//PR_PutEnv("MOZ_TOOLKIT=gtk");
if (NS_SUCCEEDED(rv) && (nsnull != unixToolkitService))
{
// Force the toolkit into "gtk" mode
unixToolkitService->SetToolkitName("gtk");
NS_RELEASE(unixToolkitService);
}
//////////////////////////////////////////////////////////////////////
// End toolkit service setup
//////////////////////////////////////////////////////////////////////
// The toolkit service in mozilla will look in the environment
// to determine which toolkit to use. Yes, it is a dumb hack to
// force it here, but we have no choice because of toolkit specific
// code linked into the viewer.
putenv("MOZ_TOOLKIT=gtk");
gTheApp->Initialize(argc, argv);
gTheApp->Run();

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

@ -21,11 +21,6 @@
#include "nsMotifMenu.h"
#include "nsIImageManager.h"
#include "nsIUnixToolkitService.h"
#include "nsIComponentManager.h"
static NS_DEFINE_CID(kCUnixToolkitServiceCID, NS_UNIX_TOOLKIT_SERVICE_CID);
static nsNativeViewerApp* gTheApp;
nsNativeViewerApp::nsNativeViewerApp()
@ -96,36 +91,7 @@ int main(int argc, char **argv)
gTheApp = new nsNativeViewerApp();
//////////////////////////////////////////////////////////////////////
//
// Toolkit Service setup
//
// Note: This must happend before NS_SetupRegistry() is called so
// that the toolkit specific xpcom components can be registered
// as needed.
//
//////////////////////////////////////////////////////////////////////
nsIUnixToolkitService * unixToolkitService = nsnull;
nsresult rv =
nsComponentManager::CreateInstance(kCUnixToolkitServiceCID,
nsnull,
nsIUnixToolkitService::GetIID(),
(void **) &unixToolkitService);
NS_ASSERTION(NS_SUCCEEDED(rv),"Cannot obtain unix toolkit service.");
if (NS_SUCCEEDED(rv) && (nsnull != unixToolkitService))
{
// Force the toolkit into "motif" mode regardless of MOZ_TOOLKIT
unixToolkitService->SetToolkitName("motif");
NS_RELEASE(unixToolkitService);
}
//////////////////////////////////////////////////////////////////////
// End toolkit service setup
//////////////////////////////////////////////////////////////////////
putenv("MOZ_TOOLKIT=motif");
gTheApp->Initialize(argc, argv);
gTheApp->Run();

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
@ -25,11 +25,6 @@
#include <stdlib.h>
#include "plevent.h"
#include "nsIUnixToolkitService.h"
#include "nsIComponentManager.h"
static NS_DEFINE_CID(kCUnixToolkitServiceCID, NS_UNIX_TOOLKIT_SERVICE_CID);
static nsNativeViewerApp* gTheApp;
nsNativeViewerApp::nsNativeViewerApp()
@ -92,47 +87,18 @@ nsNativeBrowserWindow::DispatchMenuItem(PRInt32 aID)
int main(int argc, char **argv)
{
// Hack to get il_ss set so it doesn't fail in xpcompat.c
nsIImageManager *manager;
NS_NewImageManager(&manager);
gTheApp = new nsNativeViewerApp();
//////////////////////////////////////////////////////////////////////
//
// Toolkit Service setup
//
// Note: This must happend before NS_SetupRegistry() is called so
// that the toolkit specific xpcom components can be registered
// as needed.
//
//////////////////////////////////////////////////////////////////////
nsIUnixToolkitService * unixToolkitService = nsnull;
nsresult rv =
nsComponentManager::CreateInstance(kCUnixToolkitServiceCID,
nsnull,
nsIUnixToolkitService::GetIID(),
(void **) &unixToolkitService);
// Hack to get il_ss set so it doesn't fail in xpcompat.c
nsIImageManager *manager;
NS_NewImageManager(&manager);
NS_ASSERTION(NS_SUCCEEDED(rv),"Cannot obtain unix toolkit service.");
if (NS_SUCCEEDED(rv) && (nsnull != unixToolkitService))
{
// Force the toolkit into "qt" mode regardless of MOZ_TOOLKIT
unixToolkitService->SetToolkitName("qt");
NS_RELEASE(unixToolkitService);
}
//////////////////////////////////////////////////////////////////////
// End toolkit service setup
//////////////////////////////////////////////////////////////////////
gTheApp->Initialize(argc, argv);
gTheApp->Run();
return 0;
gTheApp = new nsNativeViewerApp();
putenv("MOZ_TOOLKIT=qt");
gTheApp->Initialize(argc, argv);
gTheApp->Run();
return 0;
}

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

@ -19,11 +19,6 @@
#include "nsBrowserWindow.h"
#include "nsViewerApp.h"
#include "nsIUnixToolkitService.h"
#include "nsIComponentManager.h"
static NS_DEFINE_CID(kCUnixToolkitServiceCID, NS_UNIX_TOOLKIT_SERVICE_CID);
nsNativeViewerApp::nsNativeViewerApp()
{
}
@ -71,36 +66,7 @@ int main (int argc, char **argv)
nsViewerApp *app = new nsNativeViewerApp();
NS_ADDREF(app);
//////////////////////////////////////////////////////////////////////
//
// Toolkit Service setup
//
// Note: This must happend before NS_SetupRegistry() is called so
// that the toolkit specific xpcom components can be registered
// as needed.
//
//////////////////////////////////////////////////////////////////////
nsIUnixToolkitService * unixToolkitService = nsnull;
nsresult rv =
nsComponentManager::CreateInstance(kCUnixToolkitServiceCID,
nsnull,
nsIUnixToolkitService::GetIID(),
(void **) &unixToolkitService);
NS_ASSERTION(NS_SUCCEEDED(rv),"Cannot obtain unix toolkit service.");
if (NS_SUCCEEDED(rv) && (nsnull != unixToolkitService))
{
// Force the toolkit into "xlib" mode
unixToolkitService->SetToolkitName("xlib");
NS_RELEASE(unixToolkitService);
}
//////////////////////////////////////////////////////////////////////
// End toolkit service setup
//////////////////////////////////////////////////////////////////////
putenv("MOZ_TOOLKIT=xlib");
app->Initialize(argc, argv);
app->Run();