Bug 335714 - make windowds a standalone component, r=Neil

git-svn-id: svn://10.0.0.236/trunk@195640 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
benjamin%smedbergs.us 2006-04-28 13:19:36 +00:00
parent 9a7bca367e
commit 4e7f002ccb
11 changed files with 82 additions and 57 deletions

View File

@ -92,10 +92,8 @@ STATIC_LIBS += \
COMPONENT_LIBS += \
xpconnect \
necko \
auth \
uconv \
i18n \
universalchardet \
jar$(VERSION_NUMBER) \
pref \
caps \
@ -112,10 +110,10 @@ COMPONENT_LIBS += \
editor \
nsappshell \
txmgr \
composer \
chrome \
mozfind \
appcomps \
windowds \
commandlines \
toolkitcomps \
xpinstall \
@ -125,6 +123,22 @@ COMPONENT_LIBS += \
autoconfig \
$(NULL)
ifdef MOZ_AUTH_EXTENSION
COMPONENT_LIBS += auth
DEFINES += -DMOZ_AUTH_EXTENSION
endif
ifdef MOZ_UNIVERSALCHARDET
COMPONENT_LIBS += universalchardet
DEFINES += -DMOZ_UNIVERSALCHARDET
endif
ifndef MOZ_PLAINTEXT_EDITOR_ONLY
COMPONENT_LIBS += composer
else
DEFINES += -DMOZ_PLAINTEXT_EDITOR_ONLY
endif
ifdef MOZ_PLACES
COMPONENT_LIBS += storagecomps
STATIC_LIBS += morkreader_s

View File

@ -47,6 +47,18 @@
#define NSGETMODULE(_name) _name##_NSGetModule
#ifdef MOZ_AUTH_EXTENSION
#define AUTH_MODULE MODULE(nsAuthModule)
#else
#define AUTH_MODULE
#endif
#ifdef MOZ_UNIVERSALCHARDET
#define UNIVERSALCHARDET_MODULE MODULE(nsUniversalCharDetModule)
#else
#define UNIVERSALCHARDET_MODULE
#endif
#ifdef MOZ_MATHML
#define MATHML_MODULES MODULE(nsUCvMathModule)
#else
@ -135,6 +147,12 @@
#define OJI_MODULES
#endif
#ifdef MOZ_PLAINTEXT_EDITOR_ONLY
#define COMPOSER_MODULE
#else
#define COMPOSER_MODULE MODULE(nsComposerModule)
#endif
#ifdef ACCESSIBILITY
#define ACCESS_MODULES MODULE(nsAccessibilityModule)
#else
@ -177,9 +195,9 @@
MODULE(nsUConvModule) \
MODULE(nsI18nModule) \
INTL_COMPAT_MODULES \
MODULE(nsUniversalCharDetModule) \
UNIVERSALCHARDET_MODULE \
MODULE(necko) \
MODULE(nsAuthModule) \
AUTH_MODULE \
IPC_MODULE \
MODULE(nsJarModule) \
MODULE(nsPrefModule) \
@ -203,10 +221,11 @@
ACCESS_MODULES \
MODULE(appshell) \
MODULE(nsTransactionManagerModule) \
MODULE(nsComposerModule) \
COMPOSER_MODULE \
MODULE(nsChromeModule) \
MODULE(nsFindComponent) \
MODULE(application) \
MODULE(nsWindowDataSourceModule) \
MODULE(Apprunner) \
MODULE(CommandLineModule) \
PLACES_MODULES \

View File

@ -109,7 +109,6 @@ SHARED_LIBRARY_LIBS = \
ifneq ($(MOZ_BUILD_APP),macbrowser)
SHARED_LIBRARY_LIBS += \
../intl/$(LIB_PREFIX)appcompintl_s.$(LIB_SUFFIX) \
../windowds/$(LIB_PREFIX)windowds_s.$(LIB_SUFFIX) \
../../browser/src/$(LIB_PREFIX)mozbrwsr_s.$(LIB_SUFFIX) \
$(NULL)
endif
@ -150,7 +149,6 @@ endif # MOZ_PHOENIX
LOCAL_INCLUDES = \
-I$(srcdir)/../../browser/src \
-I$(srcdir)/../directory \
-I$(srcdir)/../windowds \
$(NULL)
ifndef MOZ_PHOENIX

View File

@ -42,7 +42,6 @@
#include "nsCharsetMenu.h"
#include "nsDirectoryViewer.h"
#include "nsFontPackageHandler.h"
#include "nsWindowDataSource.h"
#include "nsRDFCID.h"
#if !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) && !defined(MOZ_MACBROWSER)
@ -90,7 +89,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDirectoryViewerFactory)
#if !defined(MOZ_MACBROWSER)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontPackageHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowDataSource, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserStatusFilter)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserInstance)
#endif
@ -159,22 +157,6 @@ UnregisterProc(nsIComponentManager *aCompMgr,
"application/http-index-format", PR_TRUE);
}
static NS_METHOD
RegisterWindowDS(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const char *componentType,
const nsModuleComponentInfo *info)
{
nsresult rv;
nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
return catman->AddCategoryEntry("app-startup", "Window Data Source",
"service," NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
PR_TRUE, PR_TRUE, nsnull);
}
static const nsModuleComponentInfo components[] = {
{ "Directory Viewer", NS_DIRECTORYVIEWERFACTORY_CID,
"@mozilla.org/xpfe/http-index-format-factory-constructor",
@ -231,10 +213,6 @@ static const nsModuleComponentInfo components[] = {
{ "nsFontPackageHandler", NS_FONTPACKAGEHANDLER_CID,
"@mozilla.org/locale/default-font-package-handler;1",
nsFontPackageHandlerConstructor },
{ "nsWindowDataSource",
NS_WINDOWDATASOURCE_CID,
NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
nsWindowDataSourceConstructor, RegisterWindowDS },
{ NS_BROWSERSTATUSFILTER_CLASSNAME,
NS_BROWSERSTATUSFILTER_CID,
NS_BROWSERSTATUSFILTER_CONTRACTID,

View File

@ -73,12 +73,10 @@ REQUIRES = xpcom \
CPPSRCS = nsModule.cpp
SHARED_LIBRARY_LIBS = \
../windowds/$(LIB_PREFIX)windowds_s.$(LIB_SUFFIX) \
../intl/$(LIB_PREFIX)appcompintl_s.$(LIB_SUFFIX) \
$(NULL)
LOCAL_INCLUDES = \
-I$(srcdir)/../windowds \
-I$(srcdir)/../../browser/src \
$(NULL)

View File

@ -54,7 +54,6 @@
#include "nsCURILoader.h"
// Factory constructors
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowDataSource, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontPackageHandler)
@ -62,23 +61,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontPackageHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsHooks)
#endif // Windows
static NS_METHOD
RegisterWindowDS(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const char *componentType,
const nsModuleComponentInfo *info)
{
nsresult rv;
nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
return catman->AddCategoryEntry("app-startup", "Window Data Source",
"service," NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
PR_TRUE, PR_TRUE, nsnull);
return NS_OK;
}
static const nsModuleComponentInfo components[] = {
{ "nsCharsetMenu", NS_CHARSETMENU_CID,
NS_RDF_DATASOURCE_CONTRACTID_PREFIX NS_CHARSETMENU_PID,
@ -86,10 +68,6 @@ static const nsModuleComponentInfo components[] = {
{ "nsFontPackageHandler", NS_FONTPACKAGEHANDLER_CID,
"@mozilla.org/locale/default-font-package-handler;1",
nsFontPackageHandlerConstructor },
{ "nsWindowDataSource",
NS_WINDOWDATASOURCE_CID,
NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
nsWindowDataSourceConstructor, RegisterWindowDS },
};
NS_IMPL_NSGETMODULE(application, components)

View File

@ -44,9 +44,11 @@ include $(DEPTH)/config/autoconf.mk
MODULE = appcomps
XPIDL_MODULE = windowds
LIBRARY_NAME = windowds_s
LIBRARY_NAME = windowds
MODULE_NAME = nsWindowDataSourceModule
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
IS_COMPONENT = 1
EXPORT_LIBRARY = 1
REQUIRES = xpcom \
string \
@ -60,5 +62,8 @@ CPPSRCS = nsWindowDataSource.cpp
XPIDLSRCS = nsIWindowDataSource.idl
include $(topsrcdir)/config/rules.mk
EXTRA_DSO_LDOPTS = \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -44,6 +44,8 @@
#include "nsIObserverService.h"
#include "nsIWindowMediator.h"
#include "nsXPCOMCID.h"
#include "nsICategoryManager.h"
#include "nsIGenericFactory.h"
// just to do the reverse-lookup! sheesh.
#include "nsIInterfaceRequestorUtils.h"
@ -591,3 +593,33 @@ NS_IMETHODIMP nsWindowDataSource::EndUpdateBatch()
return mInner->EndUpdateBatch();
return NS_OK;
}
// The module goop
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowDataSource, Init)
static NS_METHOD
RegisterWindowDS(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const char *componentType,
const nsModuleComponentInfo *info)
{
nsresult rv;
nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
return catman->AddCategoryEntry("app-startup", "Window Data Source",
"service," NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
PR_TRUE, PR_TRUE, nsnull);
return NS_OK;
}
static const nsModuleComponentInfo components[] = {
{ "nsWindowDataSource",
NS_WINDOWDATASOURCE_CID,
NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
nsWindowDataSourceConstructor, RegisterWindowDS }
};
NS_IMPL_NSGETMODULE(nsWindowDataSourceModule, components)

View File

@ -80,6 +80,7 @@ bin/components/accessibility.xpt
bin/components/appshell.xpt
bin/components/appshell.dll
bin/components/appcomps.dll
bin/components/windowds.dll
bin/components/xpautoc.dll
bin/components/srchsvc.dll
bin/components/appstartup.xpt

View File

@ -81,6 +81,7 @@ bin/components/libaccessibility.so
bin/components/accessibility.xpt
bin/components/accessibility-atk.xpt
bin/components/libappcomps.so
bin/components/libwindowds.so
bin/components/libxpautocomplete.so
bin/components/libsearchservice.so
bin/components/appstartup.xpt

View File

@ -63,6 +63,7 @@ bin\xpicleanup.exe
bin\components\AcctIdl.dll
bin\components\AcctIdl.xpt
bin\components\appcomps.dll
bin\components\windowds.dll
bin\components\xpautoc.dll
bin\components\srchsvc.dll
bin\components\autocomplete.xpt