From 54bfc70eeac2002ee590da5efd0db0fda07a1aba Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Tue, 2 Nov 1999 01:12:32 +0000 Subject: [PATCH] cleanup NS_IMPL_MODULE and friends - define new nsModuleComponentInfo and use it instead of components_t - use size_t instead of unsigned int - add some docs - allow user to define own module name git-svn-id: svn://10.0.0.236/trunk@52452 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/ps/nsGfxFactoryPS.cpp | 157 +----------------- .../compose/build/nsMsgCompFactory.cpp | 13 +- .../mime/emitters/build/nsEmitterFactory.cpp | 12 +- .../mailnews/news/build/nsMsgNewsFactory.cpp | 13 +- .../tests/domds/nsRDFDOMDataSourceFactory.cpp | 13 +- .../nsUnixToolkitServiceFactory.cpp | 13 +- .../timer/src/unix/gtk/nsTimerGtkFactory.cpp | 13 +- mozilla/xpcom/components/nsIGenericFactory.h | 52 ++++-- mozilla/xpcom/glue/nsIGenericFactory.h | 52 ++++-- .../xpfe/browser/src/nsBrowserInstance.cpp | 15 +- .../prefwindow/src/nsPrefWindowFactory.cpp | 13 +- 11 files changed, 111 insertions(+), 255 deletions(-) diff --git a/mozilla/gfx/src/ps/nsGfxFactoryPS.cpp b/mozilla/gfx/src/ps/nsGfxFactoryPS.cpp index 1ddc6744a3a..9f16854fcf6 100644 --- a/mozilla/gfx/src/ps/nsGfxFactoryPS.cpp +++ b/mozilla/gfx/src/ps/nsGfxFactoryPS.cpp @@ -26,162 +26,11 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextPS) -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; - -static components_t components[] = +static nsModuleComponentInfo components[] = { { NS_DEVICECONTEXTPS_CID, &nsDeviceContextPSConstructor, "component://netscape/gfx/decidecontext/ps", "GFX Postscript Device Context", }, }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) +NS_IMPL_MODULE(nsGfxPSModule, components) +NS_IMPL_NSGETMODULE(nsGfxPSModule) - - -#if 0 -static NS_DEFINE_CID(kCDeviceContextPS, NS_DEVICECONTEXTPS_CID); -static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); - -class nsGfxFactoryPS : public nsIFactory -{ -public: - NS_DECL_ISUPPORTS - - NS_IMETHOD CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult); - - NS_IMETHOD LockFactory(PRBool aLock); - - nsGfxFactoryPS(const nsCID &aClass); - virtual ~nsGfxFactoryPS(); - -private: - nsCID mClassID; - -}; - -nsGfxFactoryPS::nsGfxFactoryPS(const nsCID &aClass) : - mRefCnt(0), - mClassID(aClass) -{ -} - -nsGfxFactoryPS::~nsGfxFactoryPS() -{ -} - -NS_IMPL_ISUPPORTS(nsGfxFactoryPS, nsIFactory::GetIID()) - - -NS_IMETHODIMP -nsGfxFactoryPS::CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult) -{ - if (aResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - *aResult = nsnull; - - nsISupports *inst = nsnull; - - if (mClassID.Equals(kCDeviceContextPS)) { - inst = (nsISupports *)(nsIDeviceContextPS*)new nsDeviceContextPS(); - } - - if (inst == nsnull) { - return NS_ERROR_OUT_OF_MEMORY; - } - - nsresult rv = inst->QueryInterface(aIID, aResult); - - if (rv != NS_OK) { - delete inst; - } - - return rv; - -} - -nsresult nsGfxFactoryPS::LockFactory(PRBool aLock) -{ - // Not implemented in simplest case. - return NS_OK; -} - -nsresult -NSGetFactory(nsISupports* servMgr, - const nsCID &aClass, - const char *aClassName, - const char *aProgID, - nsIFactory **aFactory) -{ - if (nsnull == aFactory) { - return NS_ERROR_NULL_POINTER; - } - - *aFactory = new nsGfxFactoryPS(aClass); - - if (nsnull == aFactory) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return (*aFactory)->QueryInterface(nsIFactory::GetIID(), (void**)aFactory); - -} - -PRBool -NSCanUnload(nsISupports* aServMgr) -{ - return PR_TRUE; -} - -nsresult -NSRegisterSelf(nsISupports* aServMgr, const char *fullpath) -{ - nsresult rv; - -#ifdef NS_DEBUG - printf("*** Registering GFX Postscript\n"); -#endif - - nsCOMPtr - serviceManager(do_QueryInterface(aServMgr, &rv)); - if (NS_FAILED(rv)) return rv; - - NS_WITH_SERVICE(nsIComponentManager, compMgr, kComponentManagerCID, &rv); - if (NS_FAILED(rv)) return rv; - - rv = compMgr->RegisterComponent(kCDeviceContextPS, - "GFX Postscript Device Context", - "component://netscape/gfx/devicecontext/ps", - fullpath, - PR_TRUE, PR_TRUE); - - return rv; -} - -nsresult -NSUnregisterSelf(nsISupports* aServMgr, const char *fullpath) -{ - - nsresult rv; - nsCOMPtr - serviceManager(do_QueryInterface(aServMgr, &rv)); - if (NS_FAILED(rv)) return rv; - - NS_WITH_SERVICE(nsIComponentManager, compMgr, kComponentManagerCID, &rv); - if (NS_FAILED(rv)) return rv; - - compMgr->UnregisterComponent(kCDeviceContextPS, fullpath); - - return NS_OK; -} -#endif /* 0 */ diff --git a/mozilla/mailnews/compose/build/nsMsgCompFactory.cpp b/mozilla/mailnews/compose/build/nsMsgCompFactory.cpp index fa35ef085da..b42c710ec7f 100644 --- a/mozilla/mailnews/compose/build/nsMsgCompFactory.cpp +++ b/mozilla/mailnews/compose/build/nsMsgCompFactory.cpp @@ -67,14 +67,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpUrl); static PRInt32 g_InstanceCount = 0; static PRInt32 g_LockCount = 0; -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; - -static components_t components[] = +static nsModuleComponentInfo components[] = { { NS_MSGCOMPOSE_CID, &nsMsgComposeConstructor, NS_MSGCOMPOSE_PROGID, }, { NS_MSGCOMPOSESERVICE_CID, &nsMsgComposeServiceConstructor, NS_MSGCOMPOSESERVICE_PROGID, }, @@ -91,5 +84,5 @@ static components_t components[] = }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) +NS_IMPL_MODULE(nsMsgComposeModule, components) +NS_IMPL_NSGETMODULE(nsMsgComposeModule) diff --git a/mozilla/mailnews/mime/emitters/build/nsEmitterFactory.cpp b/mozilla/mailnews/mime/emitters/build/nsEmitterFactory.cpp index 8fcd1602466..f1b071f198b 100644 --- a/mozilla/mailnews/mime/emitters/build/nsEmitterFactory.cpp +++ b/mozilla/mailnews/mime/emitters/build/nsEmitterFactory.cpp @@ -44,14 +44,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeRawEmitter); NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeXmlEmitter); NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeXULEmitter); -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; -static components_t components[] = +static nsModuleComponentInfo components[] = { { NS_HTML_MIME_EMITTER_CID, &nsMimeHtmlEmitterConstructor, NS_HTML_MIME_EMITTER_PROGID, }, { NS_XML_MIME_EMITTER_CID, &nsMimeXmlEmitterConstructor, NS_XML_MIME_EMITTER_PROGID, }, @@ -59,5 +53,5 @@ static components_t components[] = { NS_XUL_MIME_EMITTER_CID, &nsMimeXULEmitterConstructor, NS_XUL_MIME_EMITTER_PROGID, }, }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) +NS_IMPL_MODULE(nsMimeEmitterModule, components) +NS_IMPL_NSGETMODULE(nsMimeEmitterModule) diff --git a/mozilla/mailnews/news/build/nsMsgNewsFactory.cpp b/mozilla/mailnews/news/build/nsMsgNewsFactory.cpp index 0df0070f4cc..b95d4ce96f2 100644 --- a/mozilla/mailnews/news/build/nsMsgNewsFactory.cpp +++ b/mozilla/mailnews/news/build/nsMsgNewsFactory.cpp @@ -54,14 +54,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsNNTPNewsgroupList) NS_GENERIC_FACTORY_CONSTRUCTOR(nsNewsMessage) NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgNewsFolder) -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; - -static components_t components[] = +static nsModuleComponentInfo components[] = { { NS_NNTPURL_CID, &nsNntpUrlConstructor, NS_NNTPURL_PROGID, }, { NS_NNTPSERVICE_CID, &nsNntpServiceConstructor, NS_NNTPSERVICE_PROGID, }, @@ -79,7 +72,7 @@ static components_t components[] = { NS_NNTPHOST_CID, &nsNNTPHostConstructor, NS_NNTPHOST_PROGID, }, }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) +NS_IMPL_MODULE(nsMsgNewsModule, components) +NS_IMPL_NSGETMODULE(nsMsgNewsModule) diff --git a/mozilla/rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp b/mozilla/rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp index 92f64bb0fea..bae22544f75 100644 --- a/mozilla/rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp +++ b/mozilla/rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp @@ -35,18 +35,11 @@ static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); NS_GENERIC_FACTORY_CONSTRUCTOR(nsRDFDOMDataSource); NS_GENERIC_FACTORY_CONSTRUCTOR(nsRDFDOMViewerElement); -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; - -static components_t components[] = +static nsModuleComponentInfo components[] = { { NS_RDF_DOMDATASOURCE_CID, &nsRDFDOMDataSourceConstructor, NS_RDF_DATASOURCE_PROGID_PREFIX "domds", }, { NS_RDF_DOMRESOURCEFACTORY_CID, &nsRDFDOMViewerElementConstructor, NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "dom", }, }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) +NS_IMPL_MODULE(nsRDFDOMViewerModule, components) +NS_IMPL_NSGETMODULE(nsRDFDOMViewerModule) diff --git a/mozilla/widget/src/unix_services/toolkit_service/nsUnixToolkitServiceFactory.cpp b/mozilla/widget/src/unix_services/toolkit_service/nsUnixToolkitServiceFactory.cpp index 3d5e05ea4ce..7d6940b8918 100644 --- a/mozilla/widget/src/unix_services/toolkit_service/nsUnixToolkitServiceFactory.cpp +++ b/mozilla/widget/src/unix_services/toolkit_service/nsUnixToolkitServiceFactory.cpp @@ -25,18 +25,11 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnixToolkitService) -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; - -static components_t components[] = +static nsModuleComponentInfo components[] = { { NS_UNIX_TOOLKIT_SERVICE_CID, &nsUnixToolkitServiceConstructor, NS_UNIX_TOOLKIT_SERVICE_PROGID, "Unix WIndow Service", }, }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) +NS_IMPL_MODULE(nsToolkitModule, components) +NS_IMPL_NSGETMODULE(nsToolkitModule) diff --git a/mozilla/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp b/mozilla/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp index 562af82c386..b19df5ba022 100644 --- a/mozilla/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp +++ b/mozilla/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp @@ -25,18 +25,11 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimerGtk) -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; - -static components_t components[] = +static nsModuleComponentInfo components[] = { { NS_TIMER_GTK_CID, &nsTimerGtkConstructor, "component://netscape/timer/unix/gtk", "GTK timer", }, }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) +NS_IMPL_MODULE(nsGtkTimerModule, components) +NS_IMPL_NSGETMODULE(nsGtkTimerModule) diff --git a/mozilla/xpcom/components/nsIGenericFactory.h b/mozilla/xpcom/components/nsIGenericFactory.h index 9c7678a2027..961c98897c9 100644 --- a/mozilla/xpcom/components/nsIGenericFactory.h +++ b/mozilla/xpcom/components/nsIGenericFactory.h @@ -128,6 +128,15 @@ _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID, void **aResult) } \ +// if you add entries to this structure, add them at the +// END so you don't break declarations like +// { NS_MY_CID, &nsMyObjectConstructor, etc.... } +struct nsModuleComponentInfo { + nsCID cid; + nsIGenericFactory::ConstructorProcPtr constructor; + const char *progid; + const char *description; +}; #define NS_DECL_MODULE(_class) \ class _class : public nsIModule { \ @@ -180,7 +189,8 @@ _class::RegisterSelf(nsIComponentManager *aCompMgr, \ const char* componentType) \ { \ nsresult rv = NS_OK; \ - for (unsigned int i=0; i<(sizeof(_table) / sizeof(_table[0])); i++) { \ + size_t i; \ + for (i=0; i<(sizeof(_table) / sizeof(_table[0])); i++) { \ rv = aCompMgr->RegisterComponentSpec(_table[i].cid, \ _table[i].description, \ _table[i].progid, \ @@ -197,7 +207,8 @@ _class::UnregisterSelf(nsIComponentManager *aCompMgr, \ const char* registryLocation) \ { \ nsresult rv = NS_OK; \ - for (unsigned int i=0; i<(sizeof(_table) / sizeof(_table[0])); i++) { \ + size_t i; \ + for (i=0; i<(sizeof(_table) / sizeof(_table[0])); i++) { \ rv = aCompMgr->UnregisterComponentSpec(_table[i].cid, aPath); \ } \ return rv; \ @@ -238,13 +249,34 @@ NSGetModule(nsIComponentManager *servMgr, \ } -#define NS_IMPL_MODULE(_table) \ - NS_DECL_MODULE(nsModule) \ - NS_IMPL_MODULE_CORE(nsModule) \ - NS_IMPL_ISUPPORTS1(nsModule, nsIModule) \ - NS_IMPL_MODULE_GETCLASSOBJECT(nsModule, _table) \ - NS_IMPL_MODULE_REGISTERSELF(nsModule, _table) \ - NS_IMPL_MODULE_UNREGISTERSELF(nsModule, _table) \ - NS_IMPL_MODULE_CANUNLOAD(nsModule) +#define NS_IMPL_MODULE(_module, _table) \ + NS_DECL_MODULE(_module) \ + NS_IMPL_MODULE_CORE(_module) \ + NS_IMPL_ISUPPORTS1(_module, nsIModule) \ + NS_IMPL_MODULE_GETCLASSOBJECT(_module, _table) \ + NS_IMPL_MODULE_REGISTERSELF(_module, _table) \ + NS_IMPL_MODULE_UNREGISTERSELF(_module, _table) \ + NS_IMPL_MODULE_CANUNLOAD(_module) + + + +// how to use the NS_IMPL_MODULE: +// define your static constructors: +// +// NS_GENERIC_FACTORY_CONSTRUCTOR(nsMyObject1) +// NS_GENERIC_FACTORY_CONSTRUCTOR(nsMyObject2) +// +// define your array of component information: +// static nsModuleComponentInfo components[] = +// { +// { NS_MYOBJECT1_CID, &nsMyObject1Constructor, NS_MYOBJECT1_PROGID, }, +// { NS_MYOBJECT2_CID, &nsMyObject2Constructor, NS_MYOBJECT2_PROGID, }, +// { NS_MYOBJECT2_CID, &nsMyObject2Constructor, NS_MYoBJECT2_PROGID2, }, +// }; +// +// NS_IMPL_MODULE(nsMyModule, components) +// NS_IMPL_NSGETMODULE(nsMyModule) + + #endif /* nsIGenericFactory_h___ */ diff --git a/mozilla/xpcom/glue/nsIGenericFactory.h b/mozilla/xpcom/glue/nsIGenericFactory.h index 9c7678a2027..961c98897c9 100644 --- a/mozilla/xpcom/glue/nsIGenericFactory.h +++ b/mozilla/xpcom/glue/nsIGenericFactory.h @@ -128,6 +128,15 @@ _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID, void **aResult) } \ +// if you add entries to this structure, add them at the +// END so you don't break declarations like +// { NS_MY_CID, &nsMyObjectConstructor, etc.... } +struct nsModuleComponentInfo { + nsCID cid; + nsIGenericFactory::ConstructorProcPtr constructor; + const char *progid; + const char *description; +}; #define NS_DECL_MODULE(_class) \ class _class : public nsIModule { \ @@ -180,7 +189,8 @@ _class::RegisterSelf(nsIComponentManager *aCompMgr, \ const char* componentType) \ { \ nsresult rv = NS_OK; \ - for (unsigned int i=0; i<(sizeof(_table) / sizeof(_table[0])); i++) { \ + size_t i; \ + for (i=0; i<(sizeof(_table) / sizeof(_table[0])); i++) { \ rv = aCompMgr->RegisterComponentSpec(_table[i].cid, \ _table[i].description, \ _table[i].progid, \ @@ -197,7 +207,8 @@ _class::UnregisterSelf(nsIComponentManager *aCompMgr, \ const char* registryLocation) \ { \ nsresult rv = NS_OK; \ - for (unsigned int i=0; i<(sizeof(_table) / sizeof(_table[0])); i++) { \ + size_t i; \ + for (i=0; i<(sizeof(_table) / sizeof(_table[0])); i++) { \ rv = aCompMgr->UnregisterComponentSpec(_table[i].cid, aPath); \ } \ return rv; \ @@ -238,13 +249,34 @@ NSGetModule(nsIComponentManager *servMgr, \ } -#define NS_IMPL_MODULE(_table) \ - NS_DECL_MODULE(nsModule) \ - NS_IMPL_MODULE_CORE(nsModule) \ - NS_IMPL_ISUPPORTS1(nsModule, nsIModule) \ - NS_IMPL_MODULE_GETCLASSOBJECT(nsModule, _table) \ - NS_IMPL_MODULE_REGISTERSELF(nsModule, _table) \ - NS_IMPL_MODULE_UNREGISTERSELF(nsModule, _table) \ - NS_IMPL_MODULE_CANUNLOAD(nsModule) +#define NS_IMPL_MODULE(_module, _table) \ + NS_DECL_MODULE(_module) \ + NS_IMPL_MODULE_CORE(_module) \ + NS_IMPL_ISUPPORTS1(_module, nsIModule) \ + NS_IMPL_MODULE_GETCLASSOBJECT(_module, _table) \ + NS_IMPL_MODULE_REGISTERSELF(_module, _table) \ + NS_IMPL_MODULE_UNREGISTERSELF(_module, _table) \ + NS_IMPL_MODULE_CANUNLOAD(_module) + + + +// how to use the NS_IMPL_MODULE: +// define your static constructors: +// +// NS_GENERIC_FACTORY_CONSTRUCTOR(nsMyObject1) +// NS_GENERIC_FACTORY_CONSTRUCTOR(nsMyObject2) +// +// define your array of component information: +// static nsModuleComponentInfo components[] = +// { +// { NS_MYOBJECT1_CID, &nsMyObject1Constructor, NS_MYOBJECT1_PROGID, }, +// { NS_MYOBJECT2_CID, &nsMyObject2Constructor, NS_MYOBJECT2_PROGID, }, +// { NS_MYOBJECT2_CID, &nsMyObject2Constructor, NS_MYoBJECT2_PROGID2, }, +// }; +// +// NS_IMPL_MODULE(nsMyModule, components) +// NS_IMPL_NSGETMODULE(nsMyModule) + + #endif /* nsIGenericFactory_h___ */ diff --git a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp index f27631f64b1..9d9cb13321e 100644 --- a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp +++ b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp @@ -2307,18 +2307,9 @@ NS_DEFINE_MODULE_INSTANCE_COUNTER() NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBrowserInstance, Init) -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; - -components_t components[] = { +static nsModuleComponentInfo components[] = { { NS_BROWSERINSTANCE_CID, &nsBrowserInstanceConstructor, NS_IBROWSERINSTANCE_PROGID, "nsBrowserInstance", }, }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) - - +NS_IMPL_MODULE(nsBrowserModule,components) +NS_IMPL_NSGETMODULE(nsBrowserModule) diff --git a/mozilla/xpfe/components/prefwindow/src/nsPrefWindowFactory.cpp b/mozilla/xpfe/components/prefwindow/src/nsPrefWindowFactory.cpp index 7ba4bda6f24..976c6f596a8 100644 --- a/mozilla/xpfe/components/prefwindow/src/nsPrefWindowFactory.cpp +++ b/mozilla/xpfe/components/prefwindow/src/nsPrefWindowFactory.cpp @@ -29,16 +29,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrefWindow) -struct components_t { - nsCID cid; - nsIGenericFactory::ConstructorProcPtr constructor; - const char *progid; - const char *description; -}; - -components_t components[] = { +static nsModuleComponentInfo components[] = { { NS_PREFWINDOW_CID, &nsPrefWindowConstructor, NS_PREFWINDOW_PROGID, "Preferences window helper object", }, }; -NS_IMPL_MODULE(components) -NS_IMPL_NSGETMODULE(nsModule) +NS_IMPL_MODULE(nsPrefWindowModule, components) +NS_IMPL_NSGETMODULE(nsPrefWindowModule)