From d5bd552195e0c46cbf232bc9501c9db8d22dd7c7 Mon Sep 17 00:00:00 2001 From: "kandrot%netscape.com" Date: Sat, 5 May 2001 05:33:37 +0000 Subject: [PATCH] Check in for Ron Guilmette. r=shaver, sr=waterson. For intl r=nhotta. Changes for NS_IMPL_NSGETMODULE. bug #46775. --- accessible/build/nsAccessibilityFactory.cpp | 2 +- caps/src/nsSecurityManagerFactory.cpp | 2 +- chrome/src/nsChromeFactory.cpp | 2 +- db/mork/build/nsMorkFactory.cpp | 2 +- .../xpcom/base/src/nsLDAPProtocolModule.cpp | 2 +- docshell/build/nsDocShellModule.cpp | 2 +- dom/src/build/nsDOMFactory.cpp | 114 +-- dom/src/jsurl/nsJSProtocolHandler.cpp | 2 +- editor/base/nsEditorRegistration.cpp | 2 +- editor/base/nsTextEditorReg.cpp | 2 +- .../libeditor/build/nsEditorRegistration.cpp | 2 +- editor/libeditor/build/nsTextEditorReg.cpp | 2 +- .../txtsvc/nsTextServicesFactory.cpp | 2 +- .../txmgr/src/nsTransactionManagerFactory.cpp | 2 +- editor/txtsvc/src/nsTextServicesFactory.cpp | 2 +- .../browser/build/nsWebBrowserModule.cpp | 2 +- embedding/components/build/nsModule.cpp | 2 +- .../accessproxy/nsAccessProxyRegistration.cpp | 2 +- extensions/cookie/nsModuleFactory.cpp | 2 +- extensions/datetime/nsDateTimeModule.cpp | 2 +- extensions/finger/nsFingerModule.cpp | 2 +- .../inspector/build/src/nsInspectorModule.cpp | 2 +- extensions/pics/src/nsPICS.cpp | 2 +- extensions/psm-glue/src/nsPSMModule.cpp | 178 ---- .../build/XSLTProcessorModule.cpp | 2 +- extensions/vixen/build/src/nsVixenModule.cpp | 2 +- .../wallet/build/nsWalletViewerFactory.cpp | 2 +- extensions/wallet/src/nsWalletFactory.cpp | 2 +- .../xmlextras/build/src/nsXMLExtrasModule.cpp | 2 +- gfx/src/beos/nsGfxFactoryBeOS.cpp | 2 +- gfx/src/gtk/nsGfxFactoryGTK.cpp | 2 +- gfx/src/os2/nsGfxFactoryOS2.cpp | 2 +- gfx/src/photon/nsGfxFactoryPh.cpp | 2 +- gfx/src/ps/nsGfxFactoryPS.cpp | 2 +- gfx/src/xlib/nsGfxFactoryXlib.cpp | 2 +- gfx/src/xprint/nsGfxFactoryXP.cpp | 2 +- gfx2/src/nsGfxFactory.cpp | 2 +- intl/chardet/src/nsCharDetDll.h | 3 + intl/chardet/src/nsCharDetModule.cpp | 2 +- .../compatibility/src/nsI18nCompatibility.cpp | 2 +- intl/lwbrk/src/nsLWBRKDll.h | 3 + intl/lwbrk/src/nsLWBrkModule.cpp | 2 +- intl/strres/src/nsStringBundle.cpp | 2 +- intl/uconv/ucvcn/nsUCvCnDll.h | 1 + intl/uconv/ucvcn/nsUCvCnModule.cpp | 2 +- intl/uconv/ucvibm/nsUCvIBMModule.cpp | 2 +- intl/uconv/ucvja/nsUCvJaModule.cpp | 2 +- intl/uconv/ucvko/nsUCvKODll.h | 1 + intl/uconv/ucvko/nsUCvKoModule.cpp | 2 +- intl/uconv/ucvlatin/nsUCvLatinDll.h | 3 + intl/uconv/ucvlatin/nsUCvLatinModule.cpp | 2 +- intl/uconv/ucvmath/nsUCvMathModule.cpp | 2 +- intl/uconv/ucvtw/nsUCvTwModule.cpp | 2 +- intl/uconv/ucvtw2/nsUCvTw2Module.cpp | 2 +- intl/unicharutil/src/nsUUDll.h | 3 + intl/unicharutil/src/nsUcharUtilModule.cpp | 2 +- .../xpconnect/loader/mozJSComponentLoader.cpp | 2 +- js/src/xpconnect/sample/xpcsample1.cpp | 2 +- js/src/xpconnect/src/xpcmodule.cpp | 2 +- .../tests/components/xpctest_module.cpp | 2 +- .../xpconnect/tools/src/nsXPCToolsModule.cpp | 2 +- mailnews/absync/build/nsAbSyncFactory.cpp | 2 +- mailnews/addrbook/build/nsAbFactory.cpp | 2 +- mailnews/base/build/nsMsgFactory.cpp | 2 +- mailnews/compose/build/nsMsgCompFactory.cpp | 2 +- mailnews/imap/build/nsImapFactory.cpp | 2 +- .../import/eudora/src/nsEudoraFactory.cpp | 2 +- mailnews/import/oexpress/nsOEFactory.cpp | 2 +- .../import/outlook/src/nsOutlookFactory.cpp | 2 +- mailnews/import/src/nsImportFactory.cpp | 2 +- mailnews/import/text/src/nsTextFactory.cpp | 2 +- mailnews/local/build/nsMsgLocalFactory.cpp | 2 +- mailnews/mime/build/nsMimeModule.cpp | 2 +- .../mime/cthandlers/vcard/nsVCardFactory.cpp | 2 +- .../mime/emitters/build/nsEmitterFactory.cpp | 2 +- mailnews/news/build/nsMsgNewsFactory.cpp | 2 +- modules/libimg/gifcom/nsGIFModule.cpp | 2 +- modules/libimg/jpgcom/nsJPGModule.cpp | 40 - modules/libimg/mngcom/nsMNGModule.cpp | 44 - modules/libimg/pngcom/nsPNGModule.cpp | 40 - modules/libjar/nsJARFactory.cpp | 2 +- modules/libjar/nsJARProtocolModule.cpp | 2 +- modules/libpr0n/decoders/gif/nsGIFModule.cpp | 2 +- .../libpr0n/decoders/jpeg/nsJPEGFactory.cpp | 2 +- modules/libpr0n/decoders/png/nsPNGFactory.cpp | 2 +- modules/libpr0n/decoders/ppm/nsPPMFactory.cpp | 2 +- modules/libpr0n/src/ImageFactory.cpp | 2 +- modules/oji/src/nsCJVMManagerFactory.cpp | 2 +- .../src/TestLoader/OJITestLoaderFactory.cpp | 2 +- .../plugin/base/src/nsPluginClassicModule.cpp | 2 +- modules/plugin/base/src/nsPluginModule.cpp | 2 +- .../plugin/nglsrc/nsPluginClassicModule.cpp | 80 -- modules/plugin/nglsrc/nsPluginModule.cpp | 55 -- modules/plugin/samples/simple/npsimple.cpp | 2 +- .../plugin/samples/testevents/npevents.cpp | 2 +- modules/plugin/test/npsimple.cpp | 2 +- modules/plugin/testevents/npevents.cpp | 851 ------------------ netwerk/build/nsNetModule.cpp | 2 +- netwerk/build2/nsNetModule2.cpp | 2 +- netwerk/cache/build/nsNetDataCacheModule.cpp | 49 - netwerk/cache/src/nsCacheModule.cpp | 2 +- netwerk/mime/src/nsMIMEServiceModule.cpp | 2 +- .../about/src/nsAboutProtocolModule.cpp | 2 +- netwerk/protocol/data/src/nsDataModule.cpp | 2 +- .../datetime/src/nsDateTimeModule.cpp | 2 +- .../file/src/nsFileProtocolModule.cpp | 2 +- .../protocol/finger/src/nsFingerModule.cpp | 2 +- .../protocol/http/src/nsHTTPHandlerModule.cpp | 52 -- .../protocol/jar/src/nsJARProtocolModule.cpp | 2 +- .../protocol/keyword/src/nsKeywordModule.cpp | 2 +- .../protocol/res/src/nsResProtocolModule.cpp | 34 - netwerk/protocol/theme/src/nsThemeModule.cpp | 2 +- .../streamconv/converters/nsConvFactories.cpp | 2 +- .../src/nsStreamConvServiceFactory.cpp | 2 +- .../src/nsPrefMigrationFactory.cpp | 2 +- profile/src/nsProfileFactory.cpp | 2 +- rdf/build/nsRDFModule.cpp | 2 +- rdf/chrome/build/nsChromeFactory.cpp | 2 +- rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp | 2 +- uriloader/build/nsURILoaderModule.cpp | 2 +- view/src/nsViewFactory.cpp | 299 +----- widget/src/gtk/nsWidgetFactory.cpp | 2 +- widget/src/os2/nsWidgetFactory.cpp | 2 +- widget/src/photon/nsWidgetFactory.cpp | 2 +- widget/src/qt/nsWidgetFactory.cpp | 2 +- widget/src/xlib/nsWidgetFactory.cpp | 2 +- widget/src/xremoteclient/XRemoteClient.cpp | 2 +- widget/timer/src/beos/nsTimerBeOSFactory.cpp | 2 +- .../timer/src/unix/gtk/nsTimerGtkFactory.cpp | 2 +- .../src/unix/photon/nsTimerPhFactory.cpp | 2 +- widget/timer/src/unix/qt/nsTimerQtFactory.cpp | 2 +- .../src/unix/xlib/nsTimerXlibFactory.cpp | 2 +- xpcom/appshell/eventloop/xp/nsCLoopModule.cpp | 41 - .../appshell/nativeApp/nsCNativeAppModule.cpp | 33 - xpcom/components/nsIGenericFactory.h | 23 +- xpcom/glue/nsIGenericFactory.h | 23 +- xpcom/sample/nsSampleModule.cpp | 2 +- xpcom/tests/dynamic/TestDynamic.cpp | 2 +- xpfe/appshell/src/nsAppShellFactory.cpp | 2 +- xpfe/browser/src/nsBrowserInstance.cpp | 2 +- xpfe/components/build/nsModule.cpp | 2 +- xpfe/components/find/src/nsFindModule.cpp | 2 +- .../public/nsIAppShellComponentImpl.h | 42 +- .../regviewer/nsRegistryDataSource.cpp | 2 +- .../search/src/nsRegisterSearch.cpp | 2 +- .../shistory/src/nsSHistoryModule.cpp | 2 +- .../ucth/src/nsUnknownContentTypeHandler.cpp | 2 +- .../urlbarhistory/src/nsUBHistoryModule.cpp | 2 +- xpfe/components/xfer/src/nsStreamTransfer.cpp | 2 +- xpinstall/src/nsSoftwareUpdate.cpp | 2 +- 150 files changed, 240 insertions(+), 2026 deletions(-) diff --git a/accessible/build/nsAccessibilityFactory.cpp b/accessible/build/nsAccessibilityFactory.cpp index 525bcc9228b..e1b7c106b63 100644 --- a/accessible/build/nsAccessibilityFactory.cpp +++ b/accessible/build/nsAccessibilityFactory.cpp @@ -56,5 +56,5 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsAccessibilityModule", components); +NS_IMPL_NSGETMODULE(nsAccessibilityModule, components); diff --git a/caps/src/nsSecurityManagerFactory.cpp b/caps/src/nsSecurityManagerFactory.cpp index 4b0c1055620..4007f3ef972 100644 --- a/caps/src/nsSecurityManagerFactory.cpp +++ b/caps/src/nsSecurityManagerFactory.cpp @@ -64,6 +64,6 @@ static nsModuleComponentInfo components[] = }; -NS_IMPL_NSGETMODULE("nsSecurityManagerModule", components); +NS_IMPL_NSGETMODULE(nsSecurityManagerModule, components); diff --git a/chrome/src/nsChromeFactory.cpp b/chrome/src/nsChromeFactory.cpp index 4b25c4767af..ee404d77418 100644 --- a/chrome/src/nsChromeFactory.cpp +++ b/chrome/src/nsChromeFactory.cpp @@ -51,5 +51,5 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsChromeModule", components); +NS_IMPL_NSGETMODULE(nsChromeModule, components); diff --git a/db/mork/build/nsMorkFactory.cpp b/db/mork/build/nsMorkFactory.cpp index 3685e8087d5..b0be4eaec28 100644 --- a/db/mork/build/nsMorkFactory.cpp +++ b/db/mork/build/nsMorkFactory.cpp @@ -51,7 +51,7 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsMorkModule", components); +NS_IMPL_NSGETMODULE(nsMorkModule, components); diff --git a/directory/xpcom/base/src/nsLDAPProtocolModule.cpp b/directory/xpcom/base/src/nsLDAPProtocolModule.cpp index 8e51a9faaee..46742459ac1 100644 --- a/directory/xpcom/base/src/nsLDAPProtocolModule.cpp +++ b/directory/xpcom/base/src/nsLDAPProtocolModule.cpp @@ -87,7 +87,7 @@ static nsModuleComponentInfo components[] = // implement the NSGetModule() exported function // -NS_IMPL_NSGETMODULE("nsLDAPProtocolModule", components); +NS_IMPL_NSGETMODULE(nsLDAPProtocolModule, components); #ifdef PR_LOGGING PRLogModuleInfo *gLDAPLogModule = 0; diff --git a/docshell/build/nsDocShellModule.cpp b/docshell/build/nsDocShellModule.cpp index cc3c97adafb..97aba34799f 100644 --- a/docshell/build/nsDocShellModule.cpp +++ b/docshell/build/nsDocShellModule.cpp @@ -50,5 +50,5 @@ static nsModuleComponentInfo gDocShellModuleInfo[] = { // "docshell provider" to illustrate that this thing really *should* // be dispensing docshells rather than webshells. -NS_IMPL_NSGETMODULE("docshell provider", gDocShellModuleInfo) +NS_IMPL_NSGETMODULE(docshell_provider, gDocShellModuleInfo) diff --git a/dom/src/build/nsDOMFactory.cpp b/dom/src/build/nsDOMFactory.cpp index 3b25147e24c..806cd12b597 100644 --- a/dom/src/build/nsDOMFactory.cpp +++ b/dom/src/build/nsDOMFactory.cpp @@ -38,6 +38,7 @@ #include "nsJSEnvironment.h" #include "nsIScriptGlobalObject.h" +#include "nsIGenericFactory.h" #include "nsDOMCID.h" #include "nsIDOMScriptObjectFactory.h" #include "nsIDOMNativeObjectRegistry.h" @@ -700,109 +701,20 @@ nsDOMScriptObjectFactory::NewScriptPkcs11(nsIScriptContext *aContext, ////////////////////////////////////////////////////////////////////// -static NS_DEFINE_CID(kCDOMScriptObjectFactory, NS_DOM_SCRIPT_OBJECT_FACTORY_CID); -static NS_DEFINE_CID(kCDOMNativeObjectRegistry, NS_DOM_NATIVE_OBJECT_REGISTRY_CID); -static NS_DEFINE_CID(kCScriptNameSetRegistry, NS_SCRIPT_NAMESET_REGISTRY_CID); +NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMScriptObjectFactory); +NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMNativeObjectRegistry); +NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptNameSetRegistry); -class nsDOMFactory : public nsIFactory -{ - public: - NS_DECL_ISUPPORTS - - NS_DECL_NSIFACTORY - - nsDOMFactory(const nsCID &aClass); - - protected: - virtual ~nsDOMFactory(); - - private: - nsCID mClassID; -}; - -nsDOMFactory::nsDOMFactory(const nsCID &aClass) -{ - NS_INIT_ISUPPORTS(); - mClassID = aClass; -} - -nsDOMFactory::~nsDOMFactory() -{ -} - -NS_IMPL_ISUPPORTS(nsDOMFactory, NS_GET_IID(nsIFactory)) - -nsresult nsDOMFactory::CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult) -{ - if (aResult == NULL) { - return NS_ERROR_NULL_POINTER; - } - - *aResult = NULL; - - nsISupports *inst = nsnull; - - if (mClassID.Equals(kCDOMScriptObjectFactory)) { - inst = (nsISupports *)new nsDOMScriptObjectFactory(); - } - else if (mClassID.Equals(kCDOMNativeObjectRegistry)) { - inst = (nsISupports *)new nsDOMNativeObjectRegistry(); - } - else if (mClassID.Equals(kCScriptNameSetRegistry)) { - inst = (nsISupports *)new nsScriptNameSetRegistry(); - } - - if (inst == NULL) { - return NS_ERROR_OUT_OF_MEMORY; - } - - NS_ADDREF(inst); // Stabilize - - nsresult res = inst->QueryInterface(aIID, aResult); - - NS_RELEASE(inst); // Destabilize and avoid leaks. Avoid calling delete - - return res; -} - -nsresult nsDOMFactory::LockFactory(PRBool aLock) -{ - // Not implemented in simplest case. - return NS_OK; -} - -// return the proper factory to the caller -#if defined(XP_MAC) && defined(MAC_STATIC) -extern "C" NS_DOM nsresult -NSGetFactory_DOM_DLL(nsISupports* servMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory) -#else -extern "C" NS_DOM nsresult -NSGetFactory(nsISupports* servMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory) -#endif -{ - if (nsnull == aFactory) { - return NS_ERROR_NULL_POINTER; - } - - *aFactory = new nsDOMFactory(aClass); - - if (nsnull == aFactory) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return (*aFactory)->QueryInterface(NS_GET_IID(nsIFactory), (void**)aFactory); -} +static nsModuleComponentInfo components[] = { + { "Script Object Factory", NS_DOM_SCRIPT_OBJECT_FACTORY_CID, nsnull, + nsDOMScriptObjectFactoryConstructor }, + { "Native Object Registry", NS_DOM_NATIVE_OBJECT_REGISTRY_CID, nsnull, + nsDOMNativeObjectRegistryConstructor }, + { "Script Name Set Registry", NS_SCRIPT_NAMESET_REGISTRY_CID, nsnull, + nsScriptNameSetRegistryConstructor } +}; +NS_IMPL_NSGETMODULE(DOM_components, components); void XXXDomNeverCalled(); void XXXDomNeverCalled() diff --git a/dom/src/jsurl/nsJSProtocolHandler.cpp b/dom/src/jsurl/nsJSProtocolHandler.cpp index 7e9cab24d37..214a4765cd6 100644 --- a/dom/src/jsurl/nsJSProtocolHandler.cpp +++ b/dom/src/jsurl/nsJSProtocolHandler.cpp @@ -517,6 +517,6 @@ static nsModuleComponentInfo gJSModuleInfo[] = { nsJSProtocolHandler::Create } }; -NS_IMPL_NSGETMODULE("javascript: protocol", gJSModuleInfo) +NS_IMPL_NSGETMODULE(javascript__protocol, gJSModuleInfo) //////////////////////////////////////////////////////////////////////////////// diff --git a/editor/base/nsEditorRegistration.cpp b/editor/base/nsEditorRegistration.cpp index df7e4b59ee5..8b4defb8e65 100644 --- a/editor/base/nsEditorRegistration.cpp +++ b/editor/base/nsEditorRegistration.cpp @@ -101,4 +101,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsEditorModule", components) +NS_IMPL_NSGETMODULE(nsEditorModule, components) diff --git a/editor/base/nsTextEditorReg.cpp b/editor/base/nsTextEditorReg.cpp index 6a79e2d8de6..618e1f799d9 100644 --- a/editor/base/nsTextEditorReg.cpp +++ b/editor/base/nsTextEditorReg.cpp @@ -55,4 +55,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsEditorModule", components) +NS_IMPL_NSGETMODULE(nsEditorModule, components) diff --git a/editor/libeditor/build/nsEditorRegistration.cpp b/editor/libeditor/build/nsEditorRegistration.cpp index df7e4b59ee5..8b4defb8e65 100644 --- a/editor/libeditor/build/nsEditorRegistration.cpp +++ b/editor/libeditor/build/nsEditorRegistration.cpp @@ -101,4 +101,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsEditorModule", components) +NS_IMPL_NSGETMODULE(nsEditorModule, components) diff --git a/editor/libeditor/build/nsTextEditorReg.cpp b/editor/libeditor/build/nsTextEditorReg.cpp index 6a79e2d8de6..618e1f799d9 100644 --- a/editor/libeditor/build/nsTextEditorReg.cpp +++ b/editor/libeditor/build/nsTextEditorReg.cpp @@ -55,4 +55,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsEditorModule", components) +NS_IMPL_NSGETMODULE(nsEditorModule, components) diff --git a/editor/libeditor/txtsvc/nsTextServicesFactory.cpp b/editor/libeditor/txtsvc/nsTextServicesFactory.cpp index 0481b7c2f03..f2472c18709 100644 --- a/editor/libeditor/txtsvc/nsTextServicesFactory.cpp +++ b/editor/libeditor/txtsvc/nsTextServicesFactory.cpp @@ -54,4 +54,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsTextServicesModule", components) +NS_IMPL_NSGETMODULE(nsTextServicesModule, components) diff --git a/editor/txmgr/src/nsTransactionManagerFactory.cpp b/editor/txmgr/src/nsTransactionManagerFactory.cpp index 88570a248d4..09befe5c6a0 100644 --- a/editor/txmgr/src/nsTransactionManagerFactory.cpp +++ b/editor/txmgr/src/nsTransactionManagerFactory.cpp @@ -46,4 +46,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsTransactionManagerModule", components) +NS_IMPL_NSGETMODULE(nsTransactionManagerModule, components) diff --git a/editor/txtsvc/src/nsTextServicesFactory.cpp b/editor/txtsvc/src/nsTextServicesFactory.cpp index 0481b7c2f03..f2472c18709 100644 --- a/editor/txtsvc/src/nsTextServicesFactory.cpp +++ b/editor/txtsvc/src/nsTextServicesFactory.cpp @@ -54,4 +54,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsTextServicesModule", components) +NS_IMPL_NSGETMODULE(nsTextServicesModule, components) diff --git a/embedding/browser/build/nsWebBrowserModule.cpp b/embedding/browser/build/nsWebBrowserModule.cpp index 5debb6eb3a7..86c269f02ee 100644 --- a/embedding/browser/build/nsWebBrowserModule.cpp +++ b/embedding/browser/build/nsWebBrowserModule.cpp @@ -49,7 +49,7 @@ static nsModuleComponentInfo components[] = // NSGetModule implementation. -NS_IMPL_NSGETMODULE("Browser Embedding Module", components) +NS_IMPL_NSGETMODULE(Browser_Embedding_Module, components) diff --git a/embedding/components/build/nsModule.cpp b/embedding/components/build/nsModule.cpp index 8b8588c6333..95d79c946b3 100644 --- a/embedding/components/build/nsModule.cpp +++ b/embedding/components/build/nsModule.cpp @@ -42,4 +42,4 @@ static nsModuleComponentInfo gComponents[] = { { NS_APPSTARTUPNOTIFIER_CLASSNAME, NS_APPSTARTUPNOTIFIER_CID, NS_APPSTARTUPNOTIFIER_CONTRACTID, nsAppStartupNotifierConstructor } }; -NS_IMPL_NSGETMODULE("embedcomponents", gComponents) +NS_IMPL_NSGETMODULE(embedcomponents, gComponents) diff --git a/extensions/access-builtin/accessproxy/nsAccessProxyRegistration.cpp b/extensions/access-builtin/accessproxy/nsAccessProxyRegistration.cpp index b1c6509d66e..99eca34ca8a 100644 --- a/extensions/access-builtin/accessproxy/nsAccessProxyRegistration.cpp +++ b/extensions/access-builtin/accessproxy/nsAccessProxyRegistration.cpp @@ -87,7 +87,7 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE_WITH_DTOR("nsAccessProxy", components, AccessProxyModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsAccessProxy, components, AccessProxyModuleDtor) diff --git a/extensions/cookie/nsModuleFactory.cpp b/extensions/cookie/nsModuleFactory.cpp index 69d3fa0f8e2..2c5d6b6b1f9 100644 --- a/extensions/cookie/nsModuleFactory.cpp +++ b/extensions/cookie/nsModuleFactory.cpp @@ -81,4 +81,4 @@ static nsModuleComponentInfo components[] = { }, }; -NS_IMPL_NSGETMODULE("nsCookieModule", components) +NS_IMPL_NSGETMODULE(nsCookieModule, components) diff --git a/extensions/datetime/nsDateTimeModule.cpp b/extensions/datetime/nsDateTimeModule.cpp index 8f470b46fe5..c2e1c491c1e 100644 --- a/extensions/datetime/nsDateTimeModule.cpp +++ b/extensions/datetime/nsDateTimeModule.cpp @@ -31,4 +31,4 @@ static nsModuleComponentInfo gResComponents[] = { } }; -NS_IMPL_NSGETMODULE("datetime", gResComponents) +NS_IMPL_NSGETMODULE(datetime, gResComponents) diff --git a/extensions/finger/nsFingerModule.cpp b/extensions/finger/nsFingerModule.cpp index aa127b9e2d2..97d3cdf0745 100644 --- a/extensions/finger/nsFingerModule.cpp +++ b/extensions/finger/nsFingerModule.cpp @@ -31,4 +31,4 @@ static nsModuleComponentInfo gResComponents[] = { } }; -NS_IMPL_NSGETMODULE("finger", gResComponents) +NS_IMPL_NSGETMODULE(finger, gResComponents) diff --git a/extensions/inspector/build/src/nsInspectorModule.cpp b/extensions/inspector/build/src/nsInspectorModule.cpp index 59317781501..5973a8a88fc 100644 --- a/extensions/inspector/build/src/nsInspectorModule.cpp +++ b/extensions/inspector/build/src/nsInspectorModule.cpp @@ -53,4 +53,4 @@ static nsModuleComponentInfo components[] = }; -NS_IMPL_NSGETMODULE("nsInspectorModule", components) +NS_IMPL_NSGETMODULE(nsInspectorModule, components) diff --git a/extensions/pics/src/nsPICS.cpp b/extensions/pics/src/nsPICS.cpp index 9d302236abe..fad145f08d0 100644 --- a/extensions/pics/src/nsPICS.cpp +++ b/extensions/pics/src/nsPICS.cpp @@ -1403,4 +1403,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsPICSModule", components) +NS_IMPL_NSGETMODULE(nsPICSModule, components) diff --git a/extensions/psm-glue/src/nsPSMModule.cpp b/extensions/psm-glue/src/nsPSMModule.cpp index d4a77027d89..e69de29bb2d 100644 --- a/extensions/psm-glue/src/nsPSMModule.cpp +++ b/extensions/psm-glue/src/nsPSMModule.cpp @@ -1,178 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Hubbie Shaw - * Doug Turner -*/ - -#include "nsIModule.h" -#include "nsIGenericFactory.h" - -#include "nsPSMUICallbacks.h" -#include "nsPSMComponent.h" - -#include "nsISecureBrowserUI.h" -#include "nsSecureBrowserUIImpl.h" - -#include "nsSSLSocketProvider.h" -#include "nsTLSSocketProvider.h" - -#include "nsSDR.h" -#include "nsFSDR.h" -#include "nsCrypto.h" -#include "nsKeygenHandler.h" -//For the NS_CRYPTO_CONTRACTID define -#include "nsDOMCID.h" - -#include "nsCURILoader.h" -#include "nsISupportsUtils.h" - - - -// Define SDR object constructor -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID); - -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSecretDecoderRing, init) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFSecretDecoderRing, init) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsCrypto, init) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPkcs11, init) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(CertContentListener, init); - -static nsModuleComponentInfo components[] = -{ - { - PSM_COMPONENT_CLASSNAME, - NS_PSMCOMPONENT_CID, - PSM_COMPONENT_CONTRACTID, - nsPSMComponent::CreatePSMComponent - }, - - { - "PSM Content Handler - application/x-x509-ca-cert", - NS_PSMCOMPONENT_CID, - NS_CONTENT_HANDLER_CONTRACTID_PREFIX"application/x-x509-ca-cert", - nsPSMComponent::CreatePSMComponent - }, - - { - "PSM Content Handler - application/x-x509-server-cert", - NS_PSMCOMPONENT_CID, - NS_CONTENT_HANDLER_CONTRACTID_PREFIX"application/x-x509-server-cert", - nsPSMComponent::CreatePSMComponent - }, - - { - "PSM Content Handler - application/x-x509-user-cert", - NS_PSMCOMPONENT_CID, - NS_CONTENT_HANDLER_CONTRACTID_PREFIX"application/x-x509-user-cert", - nsPSMComponent::CreatePSMComponent - }, - - { - "PSM Content Handler - application/x-x509-email-cert", - NS_PSMCOMPONENT_CID, - NS_CONTENT_HANDLER_CONTRACTID_PREFIX"application/x-x509-email-cert", - nsPSMComponent::CreatePSMComponent - }, - - - { - PSM_UI_HANDLER_CLASSNAME, - NS_PSMUIHANDLER_CID, - PSM_UI_HANDLER_CONTRACTID, - nsPSMUIHandlerImpl::CreatePSMUIHandler - }, - - { - NS_SECURE_BROWSER_UI_CLASSNAME, - NS_SECURE_BROWSER_UI_CID, - NS_SECURE_BROWSER_UI_CONTRACTID, - nsSecureBrowserUIImpl::Create - }, - - { - NS_ISSLSOCKETPROVIDER_CLASSNAME, - NS_SSLSOCKETPROVIDER_CID, - NS_ISSLSOCKETPROVIDER_CONTRACTID, - nsSSLSocketProvider::Create - }, - - { - NS_ISSLFHSOCKETPROVIDER_CLASSNAME, - NS_SSLSOCKETPROVIDER_CID, - NS_ISSLFHSOCKETPROVIDER_CONTRACTID, - nsSSLSocketProvider::Create - }, - - { - NS_TLSSOCKETPROVIDER_CLASSNAME, - NS_TLSSOCKETPROVIDER_CID, - NS_TLSSOCKETPROVIDER_CONTRACTID, - nsTLSSocketProvider::Create - }, - - { - NS_SDR_CLASSNAME, - NS_SDR_CID, - NS_SDR_CONTRACTID, - nsSecretDecoderRingConstructor - }, - - { - NS_FSDR_CLASSNAME, - NS_FSDR_CID, - NS_FSDR_CONTRACTID, - nsFSecretDecoderRingConstructor - }, - - { - NS_CRYPTO_CLASSNAME, - NS_CRYPTO_CID, - NS_CRYPTO_CONTRACTID, - nsCryptoConstructor - }, - { - NS_PKCS11_CLASSNAME, - NS_PKCS11_CID, - NS_PKCS11_CONTRACTID, - nsPkcs11Constructor - }, - { - "Generic Certificate Content Handler", - NS_CERTCONTENTLISTEN_CID, - NS_CERTCONTENTLISTEN_CONTRACTID, - CertContentListenerConstructor - }, - { - "Form Processor", - NS_FORMPROCESSOR_CID, - NS_FORMPROCESSOR_CONTRACTID, - nsKeygenFormProcessor::Create - }, - { - "Entropy Collector", - NS_PSMCOMPONENT_CID, - NS_ENTROPYCOLLECTOR_CONTRACTID, - nsPSMComponent::CreatePSMComponent - } -}; - -NS_IMPL_NSGETMODULE("PSMComponent", components); diff --git a/extensions/transformiix/build/XSLTProcessorModule.cpp b/extensions/transformiix/build/XSLTProcessorModule.cpp index cc31ff1de1a..6023d50fb29 100755 --- a/extensions/transformiix/build/XSLTProcessorModule.cpp +++ b/extensions/transformiix/build/XSLTProcessorModule.cpp @@ -195,4 +195,4 @@ static nsModuleComponentInfo components[] = { nsSyncLoaderConstructor } }; -NS_IMPL_NSGETMODULE("TransformiixModule", components) +NS_IMPL_NSGETMODULE(TransformiixModule, components) diff --git a/extensions/vixen/build/src/nsVixenModule.cpp b/extensions/vixen/build/src/nsVixenModule.cpp index 3143c83d519..4410fec40d1 100644 --- a/extensions/vixen/build/src/nsVixenModule.cpp +++ b/extensions/vixen/build/src/nsVixenModule.cpp @@ -33,4 +33,4 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsVixenModule", components) +NS_IMPL_NSGETMODULE(nsVixenModule, components) diff --git a/extensions/wallet/build/nsWalletViewerFactory.cpp b/extensions/wallet/build/nsWalletViewerFactory.cpp index f7e6e5438a6..e5d14f6a66f 100644 --- a/extensions/wallet/build/nsWalletViewerFactory.cpp +++ b/extensions/wallet/build/nsWalletViewerFactory.cpp @@ -42,5 +42,5 @@ static nsModuleComponentInfo components[] = { "@mozilla.org/walleteditor/walleteditor-world;1", WalletEditorImplConstructor }, }; -NS_IMPL_NSGETMODULE("nsWalletViewerModule", components) +NS_IMPL_NSGETMODULE(nsWalletViewerModule, components) diff --git a/extensions/wallet/src/nsWalletFactory.cpp b/extensions/wallet/src/nsWalletFactory.cpp index f5e4ec04550..4edf7de7c8f 100644 --- a/extensions/wallet/src/nsWalletFactory.cpp +++ b/extensions/wallet/src/nsWalletFactory.cpp @@ -42,4 +42,4 @@ static nsModuleComponentInfo components[] = { NS_SINGLESIGNONPROMPT_CONTRACTID, nsSingleSignOnPromptConstructor } }; -NS_IMPL_NSGETMODULE("nsWalletModule", components) +NS_IMPL_NSGETMODULE(nsWalletModule, components) diff --git a/extensions/xmlextras/build/src/nsXMLExtrasModule.cpp b/extensions/xmlextras/build/src/nsXMLExtrasModule.cpp index b45b50a6d7b..751f1df6fc8 100644 --- a/extensions/xmlextras/build/src/nsXMLExtrasModule.cpp +++ b/extensions/xmlextras/build/src/nsXMLExtrasModule.cpp @@ -231,4 +231,4 @@ static nsModuleComponentInfo components[] = { #endif }; -NS_IMPL_NSGETMODULE("nsXMLExtrasModule", components) +NS_IMPL_NSGETMODULE(nsXMLExtrasModule, components) diff --git a/gfx/src/beos/nsGfxFactoryBeOS.cpp b/gfx/src/beos/nsGfxFactoryBeOS.cpp index c6a3ca055ea..f9847eb7d27 100644 --- a/gfx/src/beos/nsGfxFactoryBeOS.cpp +++ b/gfx/src/beos/nsGfxFactoryBeOS.cpp @@ -173,4 +173,4 @@ static nsModuleComponentInfo components[] = nsScreenManagerBeOSConstructor } }; -NS_IMPL_NSGETMODULE("nsGfxBeOSModule", components) +NS_IMPL_NSGETMODULE(nsGfxBeOSModule, components) diff --git a/gfx/src/gtk/nsGfxFactoryGTK.cpp b/gfx/src/gtk/nsGfxFactoryGTK.cpp index d059dc75989..aa33088a4df 100644 --- a/gfx/src/gtk/nsGfxFactoryGTK.cpp +++ b/gfx/src/gtk/nsGfxFactoryGTK.cpp @@ -186,5 +186,5 @@ nsGfxGTKModuleDtor(nsIModule *self) nsRenderingContextGTK::Shutdown(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsGfxGTKModule", components, nsGfxGTKModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsGfxGTKModule, components, nsGfxGTKModuleDtor) diff --git a/gfx/src/os2/nsGfxFactoryOS2.cpp b/gfx/src/os2/nsGfxFactoryOS2.cpp index 4ada5c2a994..f6dc02447be 100644 --- a/gfx/src/os2/nsGfxFactoryOS2.cpp +++ b/gfx/src/os2/nsGfxFactoryOS2.cpp @@ -186,5 +186,5 @@ nsGfxOS2ModuleDtor(nsIModule *self) // nsRenderingContextOS2::Shutdown(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsGfxOS2Module", components, nsGfxOS2ModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsGfxOS2Module, components, nsGfxOS2ModuleDtor) diff --git a/gfx/src/photon/nsGfxFactoryPh.cpp b/gfx/src/photon/nsGfxFactoryPh.cpp index 4ecd1258fe8..bc7f088aabe 100644 --- a/gfx/src/photon/nsGfxFactoryPh.cpp +++ b/gfx/src/photon/nsGfxFactoryPh.cpp @@ -161,5 +161,5 @@ static nsModuleComponentInfo components[] = nsScreenManagerPhConstructor } }; -NS_IMPL_NSGETMODULE("nsGfxPhModule", components) +NS_IMPL_NSGETMODULE(nsGfxPhModule, components) diff --git a/gfx/src/ps/nsGfxFactoryPS.cpp b/gfx/src/ps/nsGfxFactoryPS.cpp index fdaa7584de6..48796b2be77 100644 --- a/gfx/src/ps/nsGfxFactoryPS.cpp +++ b/gfx/src/ps/nsGfxFactoryPS.cpp @@ -38,5 +38,5 @@ static nsModuleComponentInfo components[] = nsDeviceContextPSConstructor } }; -NS_IMPL_NSGETMODULE("nsGfxPSModule", components) +NS_IMPL_NSGETMODULE(nsGfxPSModule, components) diff --git a/gfx/src/xlib/nsGfxFactoryXlib.cpp b/gfx/src/xlib/nsGfxFactoryXlib.cpp index b4da8209bb6..52bd0b50e68 100644 --- a/gfx/src/xlib/nsGfxFactoryXlib.cpp +++ b/gfx/src/xlib/nsGfxFactoryXlib.cpp @@ -175,5 +175,5 @@ static nsModuleComponentInfo components[] = nsScreenManagerXlibConstructor } }; -NS_IMPL_NSGETMODULE("nsGfxXlibModule", components) +NS_IMPL_NSGETMODULE(nsGfxXlibModule, components) diff --git a/gfx/src/xprint/nsGfxFactoryXP.cpp b/gfx/src/xprint/nsGfxFactoryXP.cpp index 10e6c7a3294..d1d5de17ab0 100644 --- a/gfx/src/xprint/nsGfxFactoryXP.cpp +++ b/gfx/src/xprint/nsGfxFactoryXP.cpp @@ -42,4 +42,4 @@ static nsModuleComponentInfo components[] = nsDeviceContextXPConstructor } }; -NS_IMPL_NSGETMODULE("nsGfxXPModule", components) +NS_IMPL_NSGETMODULE(nsGfxXPModule, components) diff --git a/gfx2/src/nsGfxFactory.cpp b/gfx2/src/nsGfxFactory.cpp index 3f0b9c0fdf8..6852bed91ce 100644 --- a/gfx2/src/nsGfxFactory.cpp +++ b/gfx2/src/nsGfxFactory.cpp @@ -38,5 +38,5 @@ static nsModuleComponentInfo components[] = gfxImageFrameConstructor, }, }; -NS_IMPL_NSGETMODULE("nsGfx2Module", components) +NS_IMPL_NSGETMODULE(nsGfx2Module, components) diff --git a/intl/chardet/src/nsCharDetDll.h b/intl/chardet/src/nsCharDetDll.h index 877c31412e2..4a0b276641b 100644 --- a/intl/chardet/src/nsCharDetDll.h +++ b/intl/chardet/src/nsCharDetDll.h @@ -30,6 +30,9 @@ #include "nsIStringCharsetDetector.h" #include "nsICharsetDetectionAdaptor.h" +#define g_InstanceCount nsCharDetModule_g_InstanceCount +#define g_LockCount nsCharDetModule_g_LockCount + extern "C" PRInt32 g_InstanceCount; extern "C" PRInt32 g_LockCount; diff --git a/intl/chardet/src/nsCharDetModule.cpp b/intl/chardet/src/nsCharDetModule.cpp index bb1233561b1..63774833476 100644 --- a/intl/chardet/src/nsCharDetModule.cpp +++ b/intl/chardet/src/nsCharDetModule.cpp @@ -469,5 +469,5 @@ static nsModuleComponentInfo components[] = #endif /* INCLUDE_DBGDETECTOR */ }; -NS_IMPL_NSGETMODULE("nsCharDetModule", components) +NS_IMPL_NSGETMODULE(nsCharDetModule, components) diff --git a/intl/compatibility/src/nsI18nCompatibility.cpp b/intl/compatibility/src/nsI18nCompatibility.cpp index ffb377de808..e0a360fb75a 100644 --- a/intl/compatibility/src/nsI18nCompatibility.cpp +++ b/intl/compatibility/src/nsI18nCompatibility.cpp @@ -69,4 +69,4 @@ static nsModuleComponentInfo components[] = NS_I18NCOMPATIBILITY_CONTRACTID, nsI18nCompatibilityConstructor} }; -NS_IMPL_NSGETMODULE("I18nCompatibility", components) +NS_IMPL_NSGETMODULE(I18nCompatibility, components) diff --git a/intl/lwbrk/src/nsLWBRKDll.h b/intl/lwbrk/src/nsLWBRKDll.h index c16ee876c07..9abe0153676 100644 --- a/intl/lwbrk/src/nsLWBRKDll.h +++ b/intl/lwbrk/src/nsLWBRKDll.h @@ -25,6 +25,9 @@ #include "prtypes.h" +#define g_InstanceCount lwbrk_g_InstanceCount +#define g_LockCount lwbrk_g_LockCount + extern "C" PRInt32 g_InstanceCount; extern "C" PRInt32 g_LockCount; diff --git a/intl/lwbrk/src/nsLWBrkModule.cpp b/intl/lwbrk/src/nsLWBrkModule.cpp index fd2d9a7aedb..108877828e3 100644 --- a/intl/lwbrk/src/nsLWBrkModule.cpp +++ b/intl/lwbrk/src/nsLWBrkModule.cpp @@ -37,4 +37,4 @@ static nsModuleComponentInfo components[] = { NS_LWBRK_CONTRACTID, nsLWBreakerFImpConstructor} }; -NS_IMPL_NSGETMODULE("nsLWBrkModule", components); +NS_IMPL_NSGETMODULE(nsLWBrkModule, components); diff --git a/intl/strres/src/nsStringBundle.cpp b/intl/strres/src/nsStringBundle.cpp index 98c1e414006..92508dd988c 100644 --- a/intl/strres/src/nsStringBundle.cpp +++ b/intl/strres/src/nsStringBundle.cpp @@ -1092,5 +1092,5 @@ static nsModuleComponentInfo components[] = { "Accept Language", NS_ACCEPTLANG_CID, NS_ACCEPTLANG_CONTRACTID, nsAcceptLangConstructor} }; -NS_IMPL_NSGETMODULE("nsStringBundleModule", components) +NS_IMPL_NSGETMODULE(nsStringBundleModule, components) diff --git a/intl/uconv/ucvcn/nsUCvCnDll.h b/intl/uconv/ucvcn/nsUCvCnDll.h index 1458e74d8e3..52523e58d05 100644 --- a/intl/uconv/ucvcn/nsUCvCnDll.h +++ b/intl/uconv/ucvcn/nsUCvCnDll.h @@ -28,4 +28,5 @@ extern "C" PRInt32 g_InstanceCount; extern "C" PRInt32 g_LockCount; +#define g_AsciiMapping ucvcn_g_AsciiMapping #endif /* nsUCvCnDll_h___ */ diff --git a/intl/uconv/ucvcn/nsUCvCnModule.cpp b/intl/uconv/ucvcn/nsUCvCnModule.cpp index 57022f757aa..4c6f9277ce4 100644 --- a/intl/uconv/ucvcn/nsUCvCnModule.cpp +++ b/intl/uconv/ucvcn/nsUCvCnModule.cpp @@ -161,4 +161,4 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsUCvCnModule", components); +NS_IMPL_NSGETMODULE(nsUCvCnModule, components); diff --git a/intl/uconv/ucvibm/nsUCvIBMModule.cpp b/intl/uconv/ucvibm/nsUCvIBMModule.cpp index b4bf292ff74..4ca1dbe372f 100644 --- a/intl/uconv/ucvibm/nsUCvIBMModule.cpp +++ b/intl/uconv/ucvibm/nsUCvIBMModule.cpp @@ -194,5 +194,5 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsUCvIBMModule", components); +NS_IMPL_NSGETMODULE(nsUCvIBMModule, components); diff --git a/intl/uconv/ucvja/nsUCvJaModule.cpp b/intl/uconv/ucvja/nsUCvJaModule.cpp index 1479604bf3c..7d0b7b83ee8 100644 --- a/intl/uconv/ucvja/nsUCvJaModule.cpp +++ b/intl/uconv/ucvja/nsUCvJaModule.cpp @@ -152,5 +152,5 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsUCvJAModule", components); +NS_IMPL_NSGETMODULE(nsUCvJAModule, components); diff --git a/intl/uconv/ucvko/nsUCvKODll.h b/intl/uconv/ucvko/nsUCvKODll.h index d2c890782c5..a46bdd26f4b 100644 --- a/intl/uconv/ucvko/nsUCvKODll.h +++ b/intl/uconv/ucvko/nsUCvKODll.h @@ -31,6 +31,7 @@ extern "C" PRInt32 g_LockCount; extern "C" PRUint16 g_utKSC5601Mapping[]; extern "C" PRUint16 g_ufKSC5601Mapping[]; +#define g_AsciiMapping ucvko_g_AsciiMapping extern "C" PRUint16 g_AsciiMapping[]; extern "C" PRUint16 g_HangulNullMapping[]; diff --git a/intl/uconv/ucvko/nsUCvKoModule.cpp b/intl/uconv/ucvko/nsUCvKoModule.cpp index 7b70cf4f932..c1a77712e07 100644 --- a/intl/uconv/ucvko/nsUCvKoModule.cpp +++ b/intl/uconv/ucvko/nsUCvKoModule.cpp @@ -117,5 +117,5 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsUCvKoModule", components); +NS_IMPL_NSGETMODULE(nsUCvKoModule, components); diff --git a/intl/uconv/ucvlatin/nsUCvLatinDll.h b/intl/uconv/ucvlatin/nsUCvLatinDll.h index a1b2444c519..b0e3bdcc615 100644 --- a/intl/uconv/ucvlatin/nsUCvLatinDll.h +++ b/intl/uconv/ucvlatin/nsUCvLatinDll.h @@ -25,6 +25,9 @@ #include "prtypes.h" +#define g_InstanceCount ucvlatin_g_InstanceCount +#define g_LockCount ucvlatin_g_LockCount + extern PRInt32 g_InstanceCount; extern PRInt32 g_LockCount; diff --git a/intl/uconv/ucvlatin/nsUCvLatinModule.cpp b/intl/uconv/ucvlatin/nsUCvLatinModule.cpp index 2f98d426691..9a63dd247b7 100644 --- a/intl/uconv/ucvlatin/nsUCvLatinModule.cpp +++ b/intl/uconv/ucvlatin/nsUCvLatinModule.cpp @@ -1103,5 +1103,5 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsUCvLatinModule", components); +NS_IMPL_NSGETMODULE(nsUCvLatinModule, components); diff --git a/intl/uconv/ucvmath/nsUCvMathModule.cpp b/intl/uconv/ucvmath/nsUCvMathModule.cpp index b6a828eafd8..f91bbb18a39 100644 --- a/intl/uconv/ucvmath/nsUCvMathModule.cpp +++ b/intl/uconv/ucvmath/nsUCvMathModule.cpp @@ -204,5 +204,5 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsUCvMathModule", components); +NS_IMPL_NSGETMODULE(nsUCvMathModule, components); diff --git a/intl/uconv/ucvtw/nsUCvTwModule.cpp b/intl/uconv/ucvtw/nsUCvTwModule.cpp index 7f2a14f5e84..4f7b969c525 100644 --- a/intl/uconv/ucvtw/nsUCvTwModule.cpp +++ b/intl/uconv/ucvtw/nsUCvTwModule.cpp @@ -119,5 +119,5 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsUCvTWModule", components); +NS_IMPL_NSGETMODULE(nsUCvTWModule, components); diff --git a/intl/uconv/ucvtw2/nsUCvTw2Module.cpp b/intl/uconv/ucvtw2/nsUCvTw2Module.cpp index dab5c0d1a24..8bccc9404f7 100644 --- a/intl/uconv/ucvtw2/nsUCvTw2Module.cpp +++ b/intl/uconv/ucvtw2/nsUCvTw2Module.cpp @@ -198,4 +198,4 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsUCvTW2Module", components); +NS_IMPL_NSGETMODULE(nsUCvTW2Module, components); diff --git a/intl/unicharutil/src/nsUUDll.h b/intl/unicharutil/src/nsUUDll.h index dd1d892e174..3be3feca088 100644 --- a/intl/unicharutil/src/nsUUDll.h +++ b/intl/unicharutil/src/nsUUDll.h @@ -25,6 +25,9 @@ #include "prtypes.h" +#define g_InstanceCount nsUcharUtilModule_g_InstanceCount +#define g_LockCount nsUcharUtilModule_g_LockCount + extern "C" PRInt32 g_InstanceCount; extern "C" PRInt32 g_LockCount; diff --git a/intl/unicharutil/src/nsUcharUtilModule.cpp b/intl/unicharutil/src/nsUcharUtilModule.cpp index 41eeac03e14..a036b44ac9f 100644 --- a/intl/unicharutil/src/nsUcharUtilModule.cpp +++ b/intl/unicharutil/src/nsUcharUtilModule.cpp @@ -101,5 +101,5 @@ static nsModuleComponentInfo components[] = #endif // IBMBIDI }; -NS_IMPL_NSGETMODULE("UcharUtil", components) +NS_IMPL_NSGETMODULE(UcharUtil, components) diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect/loader/mozJSComponentLoader.cpp index 781b6ad9258..aaebb2a1cf3 100644 --- a/js/src/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/src/xpconnect/loader/mozJSComponentLoader.cpp @@ -1324,4 +1324,4 @@ static nsModuleComponentInfo components[] = { #endif }; -NS_IMPL_NSGETMODULE("JS component loader", components); +NS_IMPL_NSGETMODULE(JS_component_loader, components); diff --git a/js/src/xpconnect/sample/xpcsample1.cpp b/js/src/xpconnect/sample/xpcsample1.cpp index e317f96d420..22957df1d98 100644 --- a/js/src/xpconnect/sample/xpcsample1.cpp +++ b/js/src/xpconnect/sample/xpcsample1.cpp @@ -332,5 +332,5 @@ static nsModuleComponentInfo components[] = { nsXPCSample_HookerUpperConstructor } }; -NS_IMPL_NSGETMODULE("xpconnect samples", components) +NS_IMPL_NSGETMODULE(xpconnect_samples, components) diff --git a/js/src/xpconnect/src/xpcmodule.cpp b/js/src/xpconnect/src/xpcmodule.cpp index 55366395a07..08317091659 100644 --- a/js/src/xpconnect/src/xpcmodule.cpp +++ b/js/src/xpconnect/src/xpcmodule.cpp @@ -65,4 +65,4 @@ xpcModuleDtor(nsIModule* self) nsJSRuntimeServiceImpl::FreeSingleton(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("xpconnect", components, xpcModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(xpconnect, components, xpcModuleDtor) diff --git a/js/src/xpconnect/tests/components/xpctest_module.cpp b/js/src/xpconnect/tests/components/xpctest_module.cpp index a2d26904e1f..6dbc4d6ab4e 100644 --- a/js/src/xpconnect/tests/components/xpctest_module.cpp +++ b/js/src/xpconnect/tests/components/xpctest_module.cpp @@ -68,5 +68,5 @@ static nsModuleComponentInfo components[] = { {nsnull, NS_XPCTESTDOMSTRING_CID, "@mozilla.org/js/xpc/test/DOMString;1", xpctest::ConstructXPCTestDOMString } }; -NS_IMPL_NSGETMODULE("xpconnect test", components) +NS_IMPL_NSGETMODULE(xpconnect_test, components) diff --git a/js/src/xpconnect/tools/src/nsXPCToolsModule.cpp b/js/src/xpconnect/tools/src/nsXPCToolsModule.cpp index a0ac2f2f44a..a6ad8304251 100644 --- a/js/src/xpconnect/tools/src/nsXPCToolsModule.cpp +++ b/js/src/xpconnect/tools/src/nsXPCToolsModule.cpp @@ -57,4 +57,4 @@ static nsModuleComponentInfo components[] = { {nsnull, PROFILER_CID, XPCTOOLS_PROFILER_CONTRACTID, nsXPCToolsProfilerConstructor} }; -NS_IMPL_NSGETMODULE("xpctools", components) +NS_IMPL_NSGETMODULE(xpctools, components) diff --git a/mailnews/absync/build/nsAbSyncFactory.cpp b/mailnews/absync/build/nsAbSyncFactory.cpp index 39df656b115..7f0ae969053 100644 --- a/mailnews/absync/build/nsAbSyncFactory.cpp +++ b/mailnews/absync/build/nsAbSyncFactory.cpp @@ -61,4 +61,4 @@ static nsModuleComponentInfo components[] = nsAbSyncDriverConstructor } }; -NS_IMPL_NSGETMODULE("nsAbSyncModule", components) +NS_IMPL_NSGETMODULE(nsAbSyncModule, components) diff --git a/mailnews/addrbook/build/nsAbFactory.cpp b/mailnews/addrbook/build/nsAbFactory.cpp index 63801c1c815..4646cf6abae 100644 --- a/mailnews/addrbook/build/nsAbFactory.cpp +++ b/mailnews/addrbook/build/nsAbFactory.cpp @@ -154,4 +154,4 @@ static nsModuleComponentInfo components[] = nsAddbookProtocolHandler::Create } }; -NS_IMPL_NSGETMODULE("nsAbModule", components) +NS_IMPL_NSGETMODULE(nsAbModule, components) diff --git a/mailnews/base/build/nsMsgFactory.cpp b/mailnews/base/build/nsMsgFactory.cpp index 550f0916fb0..181c3738a43 100644 --- a/mailnews/base/build/nsMsgFactory.cpp +++ b/mailnews/base/build/nsMsgFactory.cpp @@ -294,5 +294,5 @@ static nsModuleComponentInfo gComponents[] = { }; -NS_IMPL_NSGETMODULE("nsMsgBaseModule", gComponents) +NS_IMPL_NSGETMODULE(nsMsgBaseModule, gComponents) diff --git a/mailnews/compose/build/nsMsgCompFactory.cpp b/mailnews/compose/build/nsMsgCompFactory.cpp index c2b12875040..1c27fa21c86 100644 --- a/mailnews/compose/build/nsMsgCompFactory.cpp +++ b/mailnews/compose/build/nsMsgCompFactory.cpp @@ -184,4 +184,4 @@ static nsModuleComponentInfo components[] = }; -NS_IMPL_NSGETMODULE("nsMsgComposeModule", components) +NS_IMPL_NSGETMODULE(nsMsgComposeModule, components) diff --git a/mailnews/imap/build/nsImapFactory.cpp b/mailnews/imap/build/nsImapFactory.cpp index ed9bda4593e..4bd4c2cb990 100644 --- a/mailnews/imap/build/nsImapFactory.cpp +++ b/mailnews/imap/build/nsImapFactory.cpp @@ -79,4 +79,4 @@ static nsModuleComponentInfo gComponents[] = { NS_IMAPPROTOCOLINFO_CONTRACTID, nsImapServiceConstructor } }; -NS_IMPL_NSGETMODULE("IMAP factory", gComponents); +NS_IMPL_NSGETMODULE(IMAP_factory, gComponents); diff --git a/mailnews/import/eudora/src/nsEudoraFactory.cpp b/mailnews/import/eudora/src/nsEudoraFactory.cpp index c43586392d8..3cc69c60138 100644 --- a/mailnews/import/eudora/src/nsEudoraFactory.cpp +++ b/mailnews/import/eudora/src/nsEudoraFactory.cpp @@ -79,5 +79,5 @@ eudoraModuleDtor(nsIModule* self) } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsEudoraImportModule", components, eudoraModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsEudoraImportModule, components, eudoraModuleDtor) diff --git a/mailnews/import/oexpress/nsOEFactory.cpp b/mailnews/import/oexpress/nsOEFactory.cpp index b71d92e93b2..17a6c15e5eb 100644 --- a/mailnews/import/oexpress/nsOEFactory.cpp +++ b/mailnews/import/oexpress/nsOEFactory.cpp @@ -82,7 +82,7 @@ oeModuleDtor(nsIModule* self) nsOEStringBundle::Cleanup(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsOEImport", components, oeModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsOEImport, components, oeModuleDtor) diff --git a/mailnews/import/outlook/src/nsOutlookFactory.cpp b/mailnews/import/outlook/src/nsOutlookFactory.cpp index 91a79236317..75fee8e1a7f 100644 --- a/mailnews/import/outlook/src/nsOutlookFactory.cpp +++ b/mailnews/import/outlook/src/nsOutlookFactory.cpp @@ -83,5 +83,5 @@ outlookModuleDtor(nsIModule* self) } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsOutlookImport", components, outlookModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsOutlookImport, components, outlookModuleDtor) diff --git a/mailnews/import/src/nsImportFactory.cpp b/mailnews/import/src/nsImportFactory.cpp index e86784b3229..15623f11a42 100644 --- a/mailnews/import/src/nsImportFactory.cpp +++ b/mailnews/import/src/nsImportFactory.cpp @@ -53,6 +53,6 @@ importModuleDtor(nsIModule* self) nsImportStringBundle::Cleanup(); } -NS_IMPL_NSGETMODULE_WITH_DTOR( "nsImportServiceModule", components, importModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR( nsImportServiceModule, components, importModuleDtor) diff --git a/mailnews/import/text/src/nsTextFactory.cpp b/mailnews/import/text/src/nsTextFactory.cpp index 0799ceeb078..38874e81b9e 100644 --- a/mailnews/import/text/src/nsTextFactory.cpp +++ b/mailnews/import/text/src/nsTextFactory.cpp @@ -79,6 +79,6 @@ textModuleDtor(nsIModule* self) } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsTextImportModule", components, textModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsTextImportModule, components, textModuleDtor) diff --git a/mailnews/local/build/nsMsgLocalFactory.cpp b/mailnews/local/build/nsMsgLocalFactory.cpp index ff442725766..47c52cb4da9 100644 --- a/mailnews/local/build/nsMsgLocalFactory.cpp +++ b/mailnews/local/build/nsMsgLocalFactory.cpp @@ -136,5 +136,5 @@ static nsModuleComponentInfo gComponents[] = { NS_MSG_POPSTRINGSERVICE_CONTRACTID, nsLocalStringServiceConstructor }, }; -NS_IMPL_NSGETMODULE("local mail services", gComponents); +NS_IMPL_NSGETMODULE(local_mail_services, gComponents); diff --git a/mailnews/mime/build/nsMimeModule.cpp b/mailnews/mime/build/nsMimeModule.cpp index 2599985e3cf..233f6439ce9 100644 --- a/mailnews/mime/build/nsMimeModule.cpp +++ b/mailnews/mime/build/nsMimeModule.cpp @@ -76,4 +76,4 @@ static nsModuleComponentInfo gComponents[] = { nsnull, nsMimeHeadersConstructor } }; -NS_IMPL_NSGETMODULE("mime services", gComponents) +NS_IMPL_NSGETMODULE(mime_services, gComponents) diff --git a/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp b/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp index 5bbf458f7eb..067d974bc41 100644 --- a/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp +++ b/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp @@ -51,5 +51,5 @@ static nsModuleComponentInfo components[] = // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsVCardModule", components) +NS_IMPL_NSGETMODULE(nsVCardModule, components) diff --git a/mailnews/mime/emitters/build/nsEmitterFactory.cpp b/mailnews/mime/emitters/build/nsEmitterFactory.cpp index da1fad9b878..d25517d68c6 100644 --- a/mailnews/mime/emitters/build/nsEmitterFactory.cpp +++ b/mailnews/mime/emitters/build/nsEmitterFactory.cpp @@ -62,4 +62,4 @@ static nsModuleComponentInfo components[] = nsMimeXULEmitterConstructor } }; -NS_IMPL_NSGETMODULE("nsMimeEmitterModule", components) +NS_IMPL_NSGETMODULE(nsMimeEmitterModule, components) diff --git a/mailnews/news/build/nsMsgNewsFactory.cpp b/mailnews/news/build/nsMsgNewsFactory.cpp index 2426799fc6a..ca0d1cc1506 100644 --- a/mailnews/news/build/nsMsgNewsFactory.cpp +++ b/mailnews/news/build/nsMsgNewsFactory.cpp @@ -125,6 +125,6 @@ static nsModuleComponentInfo components[] = nsNewsDownloadDialogArgsConstructor } }; -NS_IMPL_NSGETMODULE("nsMsgNewsModule", components) +NS_IMPL_NSGETMODULE(nsMsgNewsModule, components) diff --git a/modules/libimg/gifcom/nsGIFModule.cpp b/modules/libimg/gifcom/nsGIFModule.cpp index c56761864cd..a8beceb9c21 100644 --- a/modules/libimg/gifcom/nsGIFModule.cpp +++ b/modules/libimg/gifcom/nsGIFModule.cpp @@ -36,5 +36,5 @@ static nsModuleComponentInfo components[] = GIFDecoder::Create } }; -NS_IMPL_NSGETMODULE("nsGIFModule", components) +NS_IMPL_NSGETMODULE(nsGIFModule, components) diff --git a/modules/libimg/jpgcom/nsJPGModule.cpp b/modules/libimg/jpgcom/nsJPGModule.cpp index 2a2a8547443..e69de29bb2d 100644 --- a/modules/libimg/jpgcom/nsJPGModule.cpp +++ b/modules/libimg/jpgcom/nsJPGModule.cpp @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - */ - -#include "nsJPGDecoder.h" -#include "nsIComponentManager.h" -#include "nsIGenericFactory.h" -#include "nsISupports.h" -#include "nsCOMPtr.h" - -static NS_DEFINE_CID(kJPGDecoderCID, NS_JPGDECODER_CID); - -static nsModuleComponentInfo components[] = -{ - { "JPEG Decoder", - NS_JPGDECODER_CID, - "@mozilla.org/image/decoder;1?type=image/jpeg", - JPGDecoder::Create } -}; - -NS_IMPL_NSGETMODULE("nsJPGModule", components) diff --git a/modules/libimg/mngcom/nsMNGModule.cpp b/modules/libimg/mngcom/nsMNGModule.cpp index b7cd48e7a9e..e69de29bb2d 100644 --- a/modules/libimg/mngcom/nsMNGModule.cpp +++ b/modules/libimg/mngcom/nsMNGModule.cpp @@ -1,44 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Tim Rowley, tor@cs.brown.edu, original author - */ - -#include "nsMNGDecoder.h" -#include "nsIComponentManager.h" -#include "nsIGenericFactory.h" -#include "nsISupports.h" -#include "nsCOMPtr.h" - -static NS_DEFINE_CID(kMNGDecoderCID, NS_MNGDECODER_CID); - -static nsModuleComponentInfo components[] = -{ - { "MNG Decoder", - NS_MNGDECODER_CID, - "@mozilla.org/image/decoder;1?type=video/x-mng", - MNGDecoder::Create }, - { "JNG Decoder", - NS_MNGDECODER_CID, - "@mozilla.org/image/decoder;1?type=image/x-jng", - MNGDecoder::Create } -}; - -NS_IMPL_NSGETMODULE("nsMNGModule", components) diff --git a/modules/libimg/pngcom/nsPNGModule.cpp b/modules/libimg/pngcom/nsPNGModule.cpp index 1fcbf7ea3af..e69de29bb2d 100644 --- a/modules/libimg/pngcom/nsPNGModule.cpp +++ b/modules/libimg/pngcom/nsPNGModule.cpp @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -#include "nsPNGDecoder.h" -#include "nsIComponentManager.h" -#include "nsIGenericFactory.h" -#include "nsISupports.h" -#include "nsCOMPtr.h" - -static NS_DEFINE_CID(kPNGDecoderCID, NS_PNGDECODER_CID); - -static nsModuleComponentInfo components[] = -{ - { "PNG Decoder", - NS_PNGDECODER_CID, - "@mozilla.org/image/decoder;1?type=image/png", - PNGDecoder::Create } -}; - -NS_IMPL_NSGETMODULE("nsPNGModule", components) - diff --git a/modules/libjar/nsJARFactory.cpp b/modules/libjar/nsJARFactory.cpp index 9e34e0d0cac..c1efef076f8 100644 --- a/modules/libjar/nsJARFactory.cpp +++ b/modules/libjar/nsJARFactory.cpp @@ -55,7 +55,7 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsJarModule", components); +NS_IMPL_NSGETMODULE(nsJarModule, components); diff --git a/modules/libjar/nsJARProtocolModule.cpp b/modules/libjar/nsJARProtocolModule.cpp index 4f2f0d06ee2..df4974546ca 100644 --- a/modules/libjar/nsJARProtocolModule.cpp +++ b/modules/libjar/nsJARProtocolModule.cpp @@ -33,6 +33,6 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsJarProtocolModule", components); +NS_IMPL_NSGETMODULE(nsJarProtocolModule, components); diff --git a/modules/libpr0n/decoders/gif/nsGIFModule.cpp b/modules/libpr0n/decoders/gif/nsGIFModule.cpp index f12bcd5bba4..b9f23bc6ed1 100644 --- a/modules/libpr0n/decoders/gif/nsGIFModule.cpp +++ b/modules/libpr0n/decoders/gif/nsGIFModule.cpp @@ -37,5 +37,5 @@ static nsModuleComponentInfo components[] = nsGIFDecoder2Constructor, }, }; -NS_IMPL_NSGETMODULE("nsGIFModule2", components) +NS_IMPL_NSGETMODULE(nsGIFModule2, components) diff --git a/modules/libpr0n/decoders/jpeg/nsJPEGFactory.cpp b/modules/libpr0n/decoders/jpeg/nsJPEGFactory.cpp index 5c62ca852ba..28e5288c80d 100644 --- a/modules/libpr0n/decoders/jpeg/nsJPEGFactory.cpp +++ b/modules/libpr0n/decoders/jpeg/nsJPEGFactory.cpp @@ -38,5 +38,5 @@ static nsModuleComponentInfo components[] = nsJPEGDecoderConstructor, }, }; -NS_IMPL_NSGETMODULE("nsJPEGDecoderModule", components) +NS_IMPL_NSGETMODULE(nsJPEGDecoderModule, components) diff --git a/modules/libpr0n/decoders/png/nsPNGFactory.cpp b/modules/libpr0n/decoders/png/nsPNGFactory.cpp index 82c34ea3cce..17ffa300d02 100644 --- a/modules/libpr0n/decoders/png/nsPNGFactory.cpp +++ b/modules/libpr0n/decoders/png/nsPNGFactory.cpp @@ -42,5 +42,5 @@ static nsModuleComponentInfo components[] = nsPNGDecoderConstructor, }, }; -NS_IMPL_NSGETMODULE("nsPNGDecoderModule", components) +NS_IMPL_NSGETMODULE(nsPNGDecoderModule, components) diff --git a/modules/libpr0n/decoders/ppm/nsPPMFactory.cpp b/modules/libpr0n/decoders/ppm/nsPPMFactory.cpp index 022ad74a0de..7ad5b0fa470 100644 --- a/modules/libpr0n/decoders/ppm/nsPPMFactory.cpp +++ b/modules/libpr0n/decoders/ppm/nsPPMFactory.cpp @@ -38,5 +38,5 @@ static nsModuleComponentInfo components[] = nsPPMDecoderConstructor, }, }; -NS_IMPL_NSGETMODULE("nsPPMDecoderModule", components) +NS_IMPL_NSGETMODULE(nsPPMDecoderModule, components) diff --git a/modules/libpr0n/src/ImageFactory.cpp b/modules/libpr0n/src/ImageFactory.cpp index fe904499b65..e1e638f12a2 100644 --- a/modules/libpr0n/src/ImageFactory.cpp +++ b/modules/libpr0n/src/ImageFactory.cpp @@ -68,4 +68,4 @@ ImageModuleDestructor(nsIModule *self) imgCache::Shutdown(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsImageLib2Module", components, ImageModuleDestructor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsImageLib2Module, components, ImageModuleDestructor) diff --git a/modules/oji/src/nsCJVMManagerFactory.cpp b/modules/oji/src/nsCJVMManagerFactory.cpp index aa18dfe25a6..3e6ab8ab7c3 100644 --- a/modules/oji/src/nsCJVMManagerFactory.cpp +++ b/modules/oji/src/nsCJVMManagerFactory.cpp @@ -37,7 +37,7 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsCJVMManagerModule", components); +NS_IMPL_NSGETMODULE(nsCJVMManagerModule, components); #else diff --git a/modules/oji/tests/src/TestLoader/OJITestLoaderFactory.cpp b/modules/oji/tests/src/TestLoader/OJITestLoaderFactory.cpp index 4f0bb222f2f..9bac56209d6 100755 --- a/modules/oji/tests/src/TestLoader/OJITestLoaderFactory.cpp +++ b/modules/oji/tests/src/TestLoader/OJITestLoaderFactory.cpp @@ -47,7 +47,7 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("OJITestLoader", components); +NS_IMPL_NSGETMODULE(OJITestLoader, components); extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *path) diff --git a/modules/plugin/base/src/nsPluginClassicModule.cpp b/modules/plugin/base/src/nsPluginClassicModule.cpp index b2d6cdd3fd4..3cc5a164722 100644 --- a/modules/plugin/base/src/nsPluginClassicModule.cpp +++ b/modules/plugin/base/src/nsPluginClassicModule.cpp @@ -76,5 +76,5 @@ nsPluginModuleDtor(nsIModule *self) ns4xPlugin::ReleaseStatics(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsClassicPluginModule", gComponentInfo, +NS_IMPL_NSGETMODULE_WITH_DTOR(nsClassicPluginModule, gComponentInfo, nsPluginModuleDtor); diff --git a/modules/plugin/base/src/nsPluginModule.cpp b/modules/plugin/base/src/nsPluginModule.cpp index 1a9eff8e039..a9a6f1b58dc 100644 --- a/modules/plugin/base/src/nsPluginModule.cpp +++ b/modules/plugin/base/src/nsPluginModule.cpp @@ -51,5 +51,5 @@ nsPluginModuleDtor(nsIModule *self) ns4xPlugin::ReleaseStatics(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsPluginModule", gComponentInfo, +NS_IMPL_NSGETMODULE_WITH_DTOR(nsPluginModule, gComponentInfo, nsPluginModuleDtor); diff --git a/modules/plugin/nglsrc/nsPluginClassicModule.cpp b/modules/plugin/nglsrc/nsPluginClassicModule.cpp index b2d6cdd3fd4..e69de29bb2d 100644 --- a/modules/plugin/nglsrc/nsPluginClassicModule.cpp +++ b/modules/plugin/nglsrc/nsPluginClassicModule.cpp @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - */ - -#include "nsIGenericFactory.h" -#include "nsIClassicPluginFactory.h" -#include "ns4xPlugin.h" - -class nsClassicPluginFactory : public nsIClassicPluginFactory { -public: - NS_DECL_ISUPPORTS - - nsClassicPluginFactory(); - - static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult); - - NS_IMETHOD CreatePlugin(nsIServiceManager* aServiceMgr, const char* aFileName, - PRLibrary* aLibrary, nsIPlugin** aResult); -}; - -NS_IMPL_ISUPPORTS1(nsClassicPluginFactory, nsIClassicPluginFactory) - -nsClassicPluginFactory::nsClassicPluginFactory() -{ - NS_INIT_ISUPPORTS(); -} - -nsresult nsClassicPluginFactory::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult) -{ - NS_PRECONDITION(aOuter == nsnull, "no aggregation"); - if (aOuter) - return NS_ERROR_NO_AGGREGATION; - - nsCOMPtr factory = new nsClassicPluginFactory; - if (! factory) - return NS_ERROR_OUT_OF_MEMORY; - - return factory->QueryInterface(aIID, aResult); -} - -NS_METHOD nsClassicPluginFactory::CreatePlugin(nsIServiceManager* aServiceMgr, const char* aFileName, - PRLibrary* aLibrary, nsIPlugin** aResult) -{ - return ns4xPlugin::CreatePlugin(aServiceMgr, aFileName, aLibrary, aResult); -} - -static nsModuleComponentInfo gComponentInfo[] = { - { "Classic Plugin Factory", - NS_CLASSIC_PLUGIN_FACTORY_CID, - NS_CLASSIC_PLUGIN_FACTORY_CONTRACTID, - nsClassicPluginFactory::Create }, -}; - -PR_STATIC_CALLBACK(void) -nsPluginModuleDtor(nsIModule *self) -{ - ns4xPlugin::ReleaseStatics(); -} - -NS_IMPL_NSGETMODULE_WITH_DTOR("nsClassicPluginModule", gComponentInfo, - nsPluginModuleDtor); diff --git a/modules/plugin/nglsrc/nsPluginModule.cpp b/modules/plugin/nglsrc/nsPluginModule.cpp index 1a9eff8e039..e69de29bb2d 100644 --- a/modules/plugin/nglsrc/nsPluginModule.cpp +++ b/modules/plugin/nglsrc/nsPluginModule.cpp @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - */ - -#include "nsIGenericFactory.h" -#include "nsIPluginManager.h" -#include "nsPluginsCID.h" -#include "nsPluginHostImpl.h" -#include "nsPluginDocLoaderFactory.h" -#include "ns4xPlugin.h" - -static nsModuleComponentInfo gComponentInfo[] = { - { "Plugin Host", - NS_PLUGIN_HOST_CID, - "@mozilla.org/plugin/host;1", - nsPluginHostImpl::Create }, - - { "Plugin Manager", - NS_PLUGINMANAGER_CID, - "@mozilla.org/plugin/manager;1", - nsPluginHostImpl::Create }, - - { "Plugin Doc Loader Factory", - NS_PLUGINDOCLOADERFACTORY_CID, - "@mozilla.org/plugin/doc-loader/factory;1", - nsPluginDocLoaderFactory::Create }, -}; - -PR_STATIC_CALLBACK(void) -nsPluginModuleDtor(nsIModule *self) -{ - ns4xPlugin::ReleaseStatics(); -} - -NS_IMPL_NSGETMODULE_WITH_DTOR("nsPluginModule", gComponentInfo, - nsPluginModuleDtor); diff --git a/modules/plugin/samples/simple/npsimple.cpp b/modules/plugin/samples/simple/npsimple.cpp index dab0738fce1..4cf56737866 100644 --- a/modules/plugin/samples/simple/npsimple.cpp +++ b/modules/plugin/samples/simple/npsimple.cpp @@ -371,7 +371,7 @@ static nsModuleComponentInfo gComponentInfo[] = { SimplePluginInstance::UnregisterSelf }, }; -NS_IMPL_NSGETMODULE("SimplePlugin", gComponentInfo); +NS_IMPL_NSGETMODULE(SimplePlugin, gComponentInfo); diff --git a/modules/plugin/samples/testevents/npevents.cpp b/modules/plugin/samples/testevents/npevents.cpp index bc841b957d0..1ec60d98135 100644 --- a/modules/plugin/samples/testevents/npevents.cpp +++ b/modules/plugin/samples/testevents/npevents.cpp @@ -253,7 +253,7 @@ static nsModuleComponentInfo gComponentInfo[] = { EventsPluginInstance::UnregisterSelf }, }; -NS_IMPL_NSGETMODULE("EventsPlugin", gComponentInfo); +NS_IMPL_NSGETMODULE(EventsPlugin, gComponentInfo); //////////////////////////////////////////////////////////////////////////////// diff --git a/modules/plugin/test/npsimple.cpp b/modules/plugin/test/npsimple.cpp index dab0738fce1..4cf56737866 100644 --- a/modules/plugin/test/npsimple.cpp +++ b/modules/plugin/test/npsimple.cpp @@ -371,7 +371,7 @@ static nsModuleComponentInfo gComponentInfo[] = { SimplePluginInstance::UnregisterSelf }, }; -NS_IMPL_NSGETMODULE("SimplePlugin", gComponentInfo); +NS_IMPL_NSGETMODULE(SimplePlugin, gComponentInfo); diff --git a/modules/plugin/testevents/npevents.cpp b/modules/plugin/testevents/npevents.cpp index bc841b957d0..e69de29bb2d 100644 --- a/modules/plugin/testevents/npevents.cpp +++ b/modules/plugin/testevents/npevents.cpp @@ -1,851 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code was developed by ActiveState. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Neil Hodgson - * Mark Hammond - */ - -// npevents.cxx -// Demonstration plugin for Mozilla that handles events, focus and keystrokes. -// See README.txt for more details. - -#include "nsplugin.h" -#include "nsIServiceManager.h" -#include "nsISupports.h" -#include "nsIFactory.h" -#include "nsIGenericFactory.h" -#include "nsString.h" -#include "nsIAllocator.h" - -#include "nsIEventsPluginInstance.h" - -#include -#include - -#if defined (XP_WIN) - -#include - -#elif defined (XP_UNIX) - -#include -#include -#include -#include - -#endif - -#define EVENTSPLUGIN_DEBUG - -/** - * {CB2EF72A-856A-4818-8E72-3439395E335F} - */ -#define NS_EVENTSAMPLEPLUGIN_CID { 0xcb2ef72a, 0x856a, 0x4818, { 0x8e, 0x72, 0x34, 0x39, 0x39, 0x5e, 0x33, 0x5f } } - -#if defined(XP_UNIX) -typedef struct _PlatformInstance { - GtkWidget *moz_box; - Display * display; - uint32 x, y; - uint32 width, height; -} -PlatformInstance; - -typedef GtkWidget* WinID; - -#endif // XP_UNIX - -#if defined(XP_WIN) -typedef struct _PlatformInstance -{ - WNDPROC fOldChildWindowProc; // The original WNDPROC of the edit control. - WNDPROC fParentWindowProc; // The Mozilla WNDPROC for main (parent) window. -} PlatformInstance; - -// Unique string for associating a pointer with our WNDPROC -static const char* gInstanceLookupString = "instance->pdata"; - -typedef HWND WinID; - -#endif // XP_WIN - -static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID); -static NS_DEFINE_CID(kEventsPluginCID, NS_EVENTSAMPLEPLUGIN_CID); - -const char *kPluginName = "Events Sample Plug-in"; -const char *kPluginDescription = "Sample plugin that demonstrates events, focus and keystrokes."; -#define PLUGIN_MIME_TYPE "application/x-events-sample-plugin" - -static const char* kMimeTypes[] = { - PLUGIN_MIME_TYPE -}; - -static const char* kMimeDescriptions[] = { - "Event Sample Plug-in" -}; - -static const char* kFileExtensions[] = { - "smpev" -}; - -static const PRInt32 kNumMimeTypes = sizeof(kMimeTypes) / sizeof(*kMimeTypes); - -//////////////////////////////////////////////////////////////////////////////// -// EventsPluginInstance represents an instance of the EventsPlugin class. - -class EventsPluginInstance : - public nsIPluginInstance, - public nsIEventsSampleInstance { -public: - //////////////////////////////////////////////////////////////////////////// - // for implementing a generic module - static NS_METHOD - Create(nsISupports* aOuter, REFNSIID aIID, void** aResult); - - static NS_METHOD - RegisterSelf(nsIComponentManager* aCompMgr, - nsIFile* aPath, - const char* aRegistryLocation, - const char* aComponentType, - const nsModuleComponentInfo *info); - - static NS_METHOD - UnregisterSelf(nsIComponentManager* aCompMgr, - nsIFile* aPath, - const char* aRegistryLocation, - const nsModuleComponentInfo *info); - - - NS_DECL_ISUPPORTS - NS_DECL_NSIEVENTSSAMPLEINSTANCE - - //////////////////////////////////////////////////////////////////////////// - // from nsIEventHandler: - - NS_IMETHOD HandleEvent(nsPluginEvent* event, PRBool* handled); - - //////////////////////////////////////////////////////////////////////////// - // from nsIPluginInstance: - - NS_IMETHOD Initialize(nsIPluginInstancePeer *peer); - - // Required backpointer to the peer. - NS_IMETHOD GetPeer(nsIPluginInstancePeer **result); - - NS_IMETHOD Start(void); - - NS_IMETHOD Stop(void); - - NS_IMETHOD Destroy(void); - - NS_IMETHOD SetWindow(nsPluginWindow* window); - - NS_IMETHOD NewStream(nsIPluginStreamListener** listener); - - NS_IMETHOD Print(nsPluginPrint* platformPrint); - - NS_IMETHOD GetValue(nsPluginInstanceVariable variable, void *value); - - //////////////////////////////////////////////////////////////////////////// - // EventsPluginInstance specific methods: - - EventsPluginInstance(); - virtual ~EventsPluginInstance(); - - void PlatformNew(void); - nsresult PlatformDestroy(void); - void PlatformResetWindow(); - PRInt16 PlatformHandleEvent(nsPluginEvent* event); - void PlatformResizeWindow(nsPluginWindow* window); - nsresult PlatformCreateWindow(nsPluginWindow* window); - - void SetMode(nsPluginMode mode) { fMode = mode; } - -protected: - //////////////////////////////////////////////////////////////////////////// - // Implementation methods - nsresult DoSetWindow(nsPluginWindow* window); - - // Data - nsCOMPtr fPeer; - nsPluginWindow *fWindow; // no nsCOMPtr as not an interface! - nsPluginMode fMode; - PlatformInstance fPlatform; - - WinID wMain; // The window created by Mozilla for us. - WinID wChild; // The window we create as a child of the nsWindow. - - //////////////////////////////////////////////////////////////////////////// - // Platform specific helpers -#ifdef XP_WIN - static LRESULT CALLBACK WndProcChild(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -#endif -}; - -//////////////////////////////////////////////////////////////////////////////// -// EventsPluginStream represents the stream used by EvMozs -// to receive data from the browser. - -class EventsPluginStreamListener : public nsIPluginStreamListener { -public: - - NS_DECL_ISUPPORTS - - //////////////////////////////////////////////////////////////////////////// - // from nsIPluginStreamListener: - - // Notify the observer that the URL has started to load. This method is - // called only once, at the beginning of a URL load. - NS_IMETHOD OnStartBinding(nsIPluginStreamInfo* pluginInfo); - - // Notify the client that data is available in the input stream. This method is - // called whenver data is written into the input stream by the networking library. - NS_IMETHOD OnDataAvailable(nsIPluginStreamInfo* pluginInfo, - nsIInputStream* input, - PRUint32 length); - - NS_IMETHOD OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName); - - // Notify the observer that the URL has finished loading. This method is - // called once when the networking library has finished processing the - // URL transaction initiatied via the nsINetService::Open(...) call. - NS_IMETHOD OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status); - - NS_IMETHOD OnNotify(const char* url, nsresult status); - - NS_IMETHOD GetStreamType(nsPluginStreamType *result); - - //////////////////////////////////////////////////////////////////////////// - // EventsPluginStreamListener specific methods: - - EventsPluginStreamListener(EventsPluginInstance *inst_, const char* url); - virtual ~EventsPluginStreamListener(void); - -protected: - const char* fMessageName; - EventsPluginInstance *inst; -}; - -// The module loader information. -static nsModuleComponentInfo gComponentInfo[] = { - { "Events Sample Plugin", - NS_EVENTSAMPLEPLUGIN_CID, - NS_INLINE_PLUGIN_CONTRACTID_PREFIX PLUGIN_MIME_TYPE, - EventsPluginInstance::Create, - EventsPluginInstance::RegisterSelf, - EventsPluginInstance::UnregisterSelf }, -}; - -NS_IMPL_NSGETMODULE("EventsPlugin", gComponentInfo); - - -//////////////////////////////////////////////////////////////////////////////// -// EventsPluginInstance static Methods -//////////////////////////////////////////////////////////////////////////////// - -NS_METHOD -EventsPluginInstance::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult) -{ - NS_PRECONDITION(aOuter == nsnull, "no aggregation"); - if (aOuter) - return NS_ERROR_NO_AGGREGATION; - - EventsPluginInstance* plugin = new EventsPluginInstance(); - if (! plugin) - return NS_ERROR_OUT_OF_MEMORY; - - nsresult rv; - NS_ADDREF(plugin); - rv = plugin->QueryInterface(aIID, aResult); - NS_RELEASE(plugin); - return rv; -} - -NS_METHOD -EventsPluginInstance::RegisterSelf(nsIComponentManager* aCompMgr, - nsIFile* aPath, - const char* aRegistryLocation, - const char* aComponentType, - const nsModuleComponentInfo *info) -{ - nsresult rv; - - nsIPluginManager* pm; - rv = nsServiceManager::GetService(kPluginManagerCID, NS_GET_IID(nsIPluginManager), - NS_REINTERPRET_CAST(nsISupports**, &pm)); - if (NS_SUCCEEDED(rv)) { - rv = pm->RegisterPlugin(kEventsPluginCID, - kPluginName, - kPluginDescription, - kMimeTypes, - kMimeDescriptions, - kFileExtensions, - kNumMimeTypes); - - NS_RELEASE(pm); - } - - return rv; -} - - -NS_METHOD -EventsPluginInstance::UnregisterSelf(nsIComponentManager* aCompMgr, - nsIFile* aPath, - const char* aRegistryLocation, - const nsModuleComponentInfo *info) -{ - nsresult rv; - - nsIPluginManager* pm; - rv = nsServiceManager::GetService(kPluginManagerCID, NS_GET_IID(nsIPluginManager), - NS_REINTERPRET_CAST(nsISupports**, &pm)); - if (NS_SUCCEEDED(rv)) { - rv = pm->UnregisterPlugin(kEventsPluginCID); - NS_RELEASE(pm); - } - - return rv; -} - -//////////////////////////////////////////////////////////////////////////////// -// EventsPluginInstance Methods -//////////////////////////////////////////////////////////////////////////////// - -// These macros produce simple version of QueryInterface and AddRef. -// See the nsISupports.h header file for details. - -NS_IMPL_ISUPPORTS2(EventsPluginInstance, nsIPluginInstance, nsIEventsSampleInstance) - -EventsPluginInstance::EventsPluginInstance() : - fPeer(NULL), fWindow(NULL), fMode(nsPluginMode_Embedded) -{ - NS_INIT_REFCNT(); - wChild = 0; -} - -EventsPluginInstance::~EventsPluginInstance(void) { -} - - -NS_METHOD EventsPluginInstance::Initialize(nsIPluginInstancePeer *peer) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::Initialize\n"); -#endif - - NS_ASSERTION(peer != NULL, "null peer"); - - fPeer = peer; - nsCOMPtr taginfo; - const char* const* names = nsnull; - const char* const* values = nsnull; - PRUint16 count = 0; - nsresult result; - - peer->AddRef(); - result = peer->GetMode(&fMode); - if (NS_FAILED(result)) return result; - - taginfo = do_QueryInterface(peer, &result); - if (!NS_FAILED(result)) { - taginfo->GetAttributes(count, names, values); - } - - PlatformNew(); /* Call Platform-specific initializations */ - return NS_OK; -} - -NS_METHOD EventsPluginInstance::GetPeer(nsIPluginInstancePeer* *result) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::GetPeer\n"); -#endif - - *result = fPeer; - NS_IF_ADDREF(*result); - return NS_OK; -} - -NS_METHOD EventsPluginInstance::Start(void) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::Start\n"); -#endif - - return NS_OK; -} - -NS_METHOD EventsPluginInstance::Stop(void) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::Stop\n"); -#endif - - return NS_OK; -} - -NS_METHOD EventsPluginInstance::Destroy(void) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::Destroy\n"); -#endif - - PlatformDestroy(); // Perform platform specific cleanup - return NS_OK; -} - -/*+++++++++++++++++++++++++++++++++++++++++++++++++ - * NPP_SetWindow: - * Sets the window in which a plug-in draws, and returns an error value. - * - * NPP_SetWindow informs the plug-in instance specified by instance of the - * the window denoted by window in which the instance draws. This nsPluginWindow - * pointer is valid for the life of the instance, or until NPP_SetWindow is called - * again with a different value. Subsequent calls to NPP_SetWindow for a given - * instance typically indicate that the window has been resized. If either window - * or window->window are NULL, the plug-in must not perform any additional - * graphics operations on the window and should free any resources associated - * with the window. - +++++++++++++++++++++++++++++++++++++++++++++++++*/ -NS_METHOD EventsPluginInstance::SetWindow(nsPluginWindow* window) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::SetWindow\n"); -#endif - - nsresult result; - result = DoSetWindow(window); - fWindow = window; - return result; -} - -nsresult EventsPluginInstance::DoSetWindow(nsPluginWindow* window) { - /* - * PLUGIN DEVELOPERS: - * Before setting window to point to the - * new window, you may wish to compare the new window - * info to the previous window (if any) to note window - * size changes, etc. - */ - nsresult result = NS_OK; - if ( fWindow != NULL ) { - // If we already have a window, clean it up - // before working with the new window - if ( window && window->window && wMain == (WinID)window->window ) { - /* The new window is the same as the old one. Exit now. */ - PlatformResizeWindow(window); - return NS_OK; - } - // Otherwise, just reset the window ready for the new one. - PlatformResetWindow(); - } - else if ( (window == NULL) || ( window->window == NULL ) ) { - /* We can just get out of here if there is no current - * window and there is no new window to use. */ - return NS_OK; - } - if (window && window->window) { - // Remember our main parent window. - wMain = (WinID)window->window; - // And create the child window. - result = PlatformCreateWindow(window); - } - return result; -} - -NS_METHOD EventsPluginInstance::NewStream(nsIPluginStreamListener** listener) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::NewStream\n"); -#endif - - if (listener != NULL) { - EventsPluginStreamListener* sl = - new EventsPluginStreamListener(this, "http://www.mozilla.org"); - if (!sl) - return NS_ERROR_UNEXPECTED; - sl->AddRef(); - *listener = sl; - } - - return NS_OK; -} - -NS_METHOD EventsPluginInstance::Print(nsPluginPrint* printInfo) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::Print\n"); -#endif - - if (printInfo == NULL) - return NS_ERROR_FAILURE; - - if (printInfo->mode == nsPluginMode_Full) { - /* - * PLUGIN DEVELOPERS: - * If your plugin would like to take over - * printing completely when it is in full-screen mode, - * set printInfo->pluginPrinted to TRUE and print your - * plugin as you see fit. If your plugin wants Netscape - * to handle printing in this case, set - * printInfo->pluginPrinted to FALSE (the default) and - * do nothing. If you do want to handle printing - * yourself, printOne is true if the print button - * (as opposed to the print menu) was clicked. - * On the Macintosh, platformPrint is a THPrint; on - * Windows, platformPrint is a structure - * (defined in npapi.h) containing the printer name, port, - * etc. - */ - - /* Do the default*/ - printInfo->print.fullPrint.pluginPrinted = PR_FALSE; - } else { /* If not fullscreen, we must be embedded */ - /* - * PLUGIN DEVELOPERS: - * If your plugin is embedded, or is full-screen - * but you returned false in pluginPrinted above, NPP_Print - * will be called with mode == nsPluginMode_Embedded. The nsPluginWindow - * in the printInfo gives the location and dimensions of - * the embedded plugin on the printed page. On the - * Macintosh, platformPrint is the printer port; on - * Windows, platformPrint is the handle to the printing - * device context. - */ - } - return NS_OK; -} - -/*+++++++++++++++++++++++++++++++++++++++++++++++++ - * NPP_HandleEvent: - * Mac-only, but stub must be present for Windows - * Delivers a platform-specific event to the instance. - * - * On the Macintosh, event is a pointer to a standard Macintosh EventRecord. - * All standard event types are passed to the instance as appropriate. In general, - * return TRUE if you handle the event and FALSE if you ignore the event. - +++++++++++++++++++++++++++++++++++++++++++++++++*/ - -NS_METHOD EventsPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* handled) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::HandleEvent\n"); -#endif - - *handled = (PRBool)PlatformHandleEvent(event); - return NS_OK; -} - -NS_METHOD EventsPluginInstance::GetValue(nsPluginInstanceVariable /*variable*/, void * /*value*/) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::GetValue\n"); -#endif - - return NS_ERROR_FAILURE; -} - -//////////////////////////////////////////////////////////////////////////////// -// EventsPluginStreamListener Methods -//////////////////////////////////////////////////////////////////////////////// - -EventsPluginStreamListener::EventsPluginStreamListener(EventsPluginInstance* inst_, - const char* msgName) - : fMessageName(msgName), inst(inst_) { - NS_INIT_REFCNT(); -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginStreamListener: EventsPluginStreamListener for %s\n", fMessageName); -#endif -} - -EventsPluginStreamListener::~EventsPluginStreamListener(void) { -} - -// This macro produces a simple version of QueryInterface, AddRef and Release. -// See the nsISupports.h header file for details. - -NS_IMPL_ISUPPORTS1(EventsPluginStreamListener, nsIPluginStreamListener); - -NS_METHOD EventsPluginStreamListener::OnStartBinding(nsIPluginStreamInfo * /*pluginInfo*/) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginStreamListener::OnStartBinding\n"); - printf("EventsPluginStreamListener: Opening plugin stream for %s\n", fMessageName); -#endif - return NS_OK; -} - -NS_METHOD EventsPluginStreamListener::OnDataAvailable( - nsIPluginStreamInfo * /*pluginInfo*/, - nsIInputStream* input, - PRUint32 length) { - -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginStreamListener::OnDataAvailable\n"); -#endif - - char* buffer = new char[length]; - if (buffer) { - PRUint32 amountRead = 0; - nsresult rslt = input->Read(buffer, length, &amountRead); - if (rslt == NS_OK) { - char msg[256]; - sprintf(msg, "### Received %d bytes for %s\n", length, fMessageName); - } - delete buffer; - } - return NS_OK; -} - -NS_METHOD EventsPluginStreamListener::OnFileAvailable( - nsIPluginStreamInfo * /*pluginInfo*/, - const char* fileName) { - -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginStreamListener::OnFileAvailable\n"); -#endif - - char msg[256]; - sprintf(msg, "### File available for %s: %s\n", fMessageName, fileName); - return NS_OK; -} - -NS_METHOD EventsPluginStreamListener::OnStopBinding( - nsIPluginStreamInfo * /*pluginInfo*/, - nsresult /*status*/) { - -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginStreamListener::OnStopBinding\n"); -#endif - - char msg[256]; - sprintf(msg, "### Closing plugin stream for %s\n", fMessageName); - return NS_OK; -} - -NS_METHOD EventsPluginStreamListener::OnNotify(const char * /*url*/, nsresult /*status*/) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginStreamListener::OnNotify\n"); -#endif - - return NS_OK; -} - -NS_METHOD EventsPluginStreamListener::GetStreamType(nsPluginStreamType *result) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginStreamListener::GetStreamType\n"); -#endif - - *result = nsPluginStreamType_Normal; - return NS_OK; -} - -/////////////////////////////////////////////////////////////////////////////// -// Platform-Specific Implemenations - -// UNIX Implementations - -#ifdef XP_UNIX - -void EventsPluginInstance::PlatformNew(void) { - fPlatform.moz_box = 0; -} - -nsresult EventsPluginInstance::PlatformDestroy(void) { - // the mozbox will be destroyed by the native destruction of the - // widget's parent. - return NS_OK; -} - -void EventsPluginInstance::PlatformResetWindow() { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::PlatformResetWindow\n"); -#endif - fPlatform.moz_box = 0; -} - -nsresult EventsPluginInstance::PlatformCreateWindow(nsPluginWindow* window) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::PlatformCreateWindow %lx\n", (long)window); -#endif - - Window x_window = (Window)window->window; - GdkWindow *gdk_window = (GdkWindow *)gdk_xid_table_lookup(x_window); - if (!gdk_window) { - fprintf(stderr, "NO WINDOW!!!\n"); - return NS_ERROR_FAILURE; - } - fPlatform.moz_box = gtk_mozbox_new(gdk_window); - - wChild = gtk_entry_new(); - gtk_container_add(GTK_CONTAINER(fPlatform.moz_box), wChild); - gtk_widget_show_all(fPlatform.moz_box); - return NS_OK; -} - -void EventsPluginInstance::PlatformResizeWindow(nsPluginWindow* window) { - NS_PRECONDITION(wChild, "Have no wChild!"); -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::PlatformResizeWindow to size (%d,%d)\n", window->width, window->height); -#endif - // Mozilla has already sized the mozbox - we just need to handle the child. - gtk_widget_set_usize(wChild, window->width, window->height); -} - -int16 EventsPluginInstance::PlatformHandleEvent(nsPluginEvent * /*event*/) { - /* UNIX Plugins do not use HandleEvent */ - return 0; -} - -/* attribute string text; */ -NS_IMETHODIMP EventsPluginInstance::GetVal(char * *aText) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::GetVal\n"); -#endif - char *text = gtk_entry_get_text(GTK_ENTRY(wChild)); - *aText = reinterpret_cast(nsAllocator::Clone(text, strlen(text) + 1)); - return (*aText) ? NS_OK : NS_ERROR_OUT_OF_MEMORY; -} - -NS_IMETHODIMP EventsPluginInstance::SetVal(const char * aText) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::SetVal\n"); -#endif - gtk_entry_set_text(GTK_ENTRY(wChild), aText); - return NS_OK; -} -#endif /* XP_UNIX */ - -// Windows Implementations - -#if defined(XP_WIN) - -void EventsPluginInstance::PlatformNew(void) { - // Nothing to do! -} - -nsresult EventsPluginInstance::PlatformDestroy(void) { - wChild = 0; - return NS_OK; -} - -nsresult EventsPluginInstance::PlatformCreateWindow(nsPluginWindow* window) { - // Remember parent wndproc. - fPlatform.fParentWindowProc = (WNDPROC)::GetWindowLong(wMain, GWL_WNDPROC); - NS_ABORT_IF_FALSE(fPlatform.fParentWindowProc!=NULL, "Couldn't get the parent WNDPROC"); - - // Create the child window that fills our nsWindow - RECT rc; - ::GetWindowRect(wMain, &rc); - - wChild = ::CreateWindow("Edit", // class - standard Windows edit control. - "", // title - WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL, // style - 0, 0, rc.right-rc.left, rc.bottom-rc.top, - wMain, // parent - (HMENU)1111, // window ID - 0, // instance - NULL); //creation data. - NS_ABORT_IF_FALSE(wChild != NULL, "Failed to create the child window!"); - if (!wChild) - return NS_ERROR_FAILURE; - // Stash away our "this" pointer so our WNDPROC can talk to us. - ::SetProp(wChild, gInstanceLookupString, (HANDLE)this); - fPlatform.fOldChildWindowProc = - (WNDPROC)::SetWindowLong( wChild, - GWL_WNDPROC, - (LONG)EventsPluginInstance::WndProcChild); - return NS_OK; -} - -int16 EventsPluginInstance::PlatformHandleEvent(nsPluginEvent * /*event*/) { - return NS_OK; -} - -void EventsPluginInstance::PlatformResetWindow() { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::PlatformResetWindow\n"); -#endif - fPlatform.fParentWindowProc = NULL; - ::SetWindowLong(wChild, GWL_WNDPROC, (LONG)fPlatform.fOldChildWindowProc); - fPlatform.fOldChildWindowProc = NULL; - wChild = NULL; - wMain = NULL; -} - -void EventsPluginInstance::PlatformResizeWindow(nsPluginWindow* window) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::PlatformResizeWindow with new size (%d,%d)\n", window->width, window->height); -#endif - RECT rc; - NS_PRECONDITION(wMain != nsnull, "Must have a valid wMain to resize"); - ::GetClientRect(wMain, &rc); - ::SetWindowPos(wChild, 0, rc.left, rc.top, - rc.right - rc.left, rc.bottom - rc.top, SWP_NOZORDER | SWP_NOACTIVATE); -} - -/* attribute string text; */ -NS_IMETHODIMP EventsPluginInstance::GetVal(char * *aText) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::GetVal\n"); -#endif - static char *empty = ""; - char *value = empty; - char buffer[256]; - if (wChild) { - GetWindowText(wChild, buffer, sizeof(buffer)/sizeof(buffer[0])); - value = buffer; - } - *aText = reinterpret_cast(nsAllocator::Clone(value, strlen(value) + 1)); - return (*aText) ? NS_OK : NS_ERROR_OUT_OF_MEMORY; -} - -NS_IMETHODIMP EventsPluginInstance::SetVal(const char * aText) { -#ifdef EVENTSPLUGIN_DEBUG - printf("EventsPluginInstance::SetVal\n"); -#endif - NS_ABORT_IF_FALSE(wChild != 0, "Don't have a window!"); - SetWindowText(wChild, aText); - return NS_OK; -} - -// This is the WndProc for our child window (the edit control) -LRESULT CALLBACK EventsPluginInstance::WndProcChild(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { - EventsPluginInstance* inst = (EventsPluginInstance*) GetProp(hWnd, gInstanceLookupString); - NS_ABORT_IF_FALSE(inst, "Could not get the inst from the Window!!"); - switch (Msg) { - // NOTE: We DONT pass on DBLCLK messages, as both Scintilla and - // Mozilla have their own special logic, and they step on each other. - // (causing our child to see a double-click as a triple-click) - case WM_KEYDOWN: - case WM_SYSKEYDOWN: - case WM_KEYUP: - case WM_SYSKEYUP: - case WM_CHAR: - case WM_SYSCHAR: - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MBUTTONDOWN: - case WM_MBUTTONUP: - case WM_RBUTTONDOWN: - case WM_RBUTTONUP: - case WM_MOUSEMOVE: - // pretend the message happened in our parent. - return ::CallWindowProc(inst->fPlatform.fParentWindowProc, (HWND)inst->wMain, Msg, wParam, lParam); - default: - // let our child's default handle it. - return ::CallWindowProc(inst->fPlatform.fOldChildWindowProc, hWnd, Msg, wParam, lParam); - } - /* not reached */ - NS_ABORT_IF_FALSE(0, "not reached!"); -} - - -#endif /* XP_WIN */ diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index 58616f4d89b..36c25010240 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -880,5 +880,5 @@ static nsModuleComponentInfo gNetModuleInfo[] = { }; -NS_IMPL_NSGETMODULE_WITH_DTOR("necko core and primary protocols", gNetModuleInfo, +NS_IMPL_NSGETMODULE_WITH_DTOR(necko_core_and_primary_protocols, gNetModuleInfo, nsNeckoShutdown) diff --git a/netwerk/build2/nsNetModule2.cpp b/netwerk/build2/nsNetModule2.cpp index 37f704885ef..416887561a0 100644 --- a/netwerk/build2/nsNetModule2.cpp +++ b/netwerk/build2/nsNetModule2.cpp @@ -70,4 +70,4 @@ static nsModuleComponentInfo gNetModuleInfo[] = { } }; -NS_IMPL_NSGETMODULE("necko secondary protocols", gNetModuleInfo) +NS_IMPL_NSGETMODULE(necko_secondary_protocols, gNetModuleInfo) diff --git a/netwerk/cache/build/nsNetDataCacheModule.cpp b/netwerk/cache/build/nsNetDataCacheModule.cpp index 925b87940bd..e69de29bb2d 100644 --- a/netwerk/cache/build/nsNetDataCacheModule.cpp +++ b/netwerk/cache/build/nsNetDataCacheModule.cpp @@ -1,49 +0,0 @@ - /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998-1999 Netscape Communications Corporation. All - * Rights Reserved. - * - */ - -#include "nsCOMPtr.h" -#include "nsIModule.h" -#include "nscore.h" -#include "nsIComponentManager.h" -#include "nsIServiceManager.h" -#include "nsIGenericFactory.h" - -#include "nsINetDataCache.h" -#include "nsINetDataCacheManager.h" -#include "nsMemCacheCID.h" -#include "nsMemCache.h" -#include "nsNetDiskCache.h" -#include "nsNetDiskCacheCID.h" -#include "nsCacheManager.h" - -// Factory method to create a new nsMemCache instance. Used -// by nsNetDataCacheModule -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMemCache, Init) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetDiskCache, Init) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsCacheManager, Init) - -static nsModuleComponentInfo components[] = { - { "Memory Cache", NS_MEM_CACHE_FACTORY_CID, NS_NETWORK_MEMORY_CACHE_CONTRACTID, nsMemCacheConstructor }, - { "File Cache", NS_NETDISKCACHE_CID, NS_NETWORK_FILE_CACHE_CONTRACTID, nsNetDiskCacheConstructor }, - { "Cache Manager",NS_CACHE_MANAGER_CID, NS_NETWORK_CACHE_MANAGER_CONTRACTID,nsCacheManagerConstructor } -}; - -NS_IMPL_NSGETMODULE("Network Data Cache", components) diff --git a/netwerk/cache/src/nsCacheModule.cpp b/netwerk/cache/src/nsCacheModule.cpp index ccd23039c64..d7148b44714 100644 --- a/netwerk/cache/src/nsCacheModule.cpp +++ b/netwerk/cache/src/nsCacheModule.cpp @@ -38,4 +38,4 @@ static nsModuleComponentInfo gResComponents[] = { } }; -NS_IMPL_NSGETMODULE("cacheservice", gResComponents) +NS_IMPL_NSGETMODULE(cacheservice, gResComponents) diff --git a/netwerk/mime/src/nsMIMEServiceModule.cpp b/netwerk/mime/src/nsMIMEServiceModule.cpp index 844fd58b1ed..e6ada5a4eb9 100644 --- a/netwerk/mime/src/nsMIMEServiceModule.cpp +++ b/netwerk/mime/src/nsMIMEServiceModule.cpp @@ -44,4 +44,4 @@ static nsModuleComponentInfo gResComponents[] = { }, }; -NS_IMPL_NSGETMODULE("nsMIMEService", gResComponents) +NS_IMPL_NSGETMODULE(nsMIMEService, gResComponents) diff --git a/netwerk/protocol/about/src/nsAboutProtocolModule.cpp b/netwerk/protocol/about/src/nsAboutProtocolModule.cpp index f952a1e7e19..19837fcf031 100644 --- a/netwerk/protocol/about/src/nsAboutProtocolModule.cpp +++ b/netwerk/protocol/about/src/nsAboutProtocolModule.cpp @@ -68,5 +68,5 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsAboutProtocolModule", components); +NS_IMPL_NSGETMODULE(nsAboutProtocolModule, components); diff --git a/netwerk/protocol/data/src/nsDataModule.cpp b/netwerk/protocol/data/src/nsDataModule.cpp index bcb08b6ab86..5c8f2c8cbe1 100644 --- a/netwerk/protocol/data/src/nsDataModule.cpp +++ b/netwerk/protocol/data/src/nsDataModule.cpp @@ -32,7 +32,7 @@ static nsModuleComponentInfo components[] = { nsDataHandler::Create}, }; -NS_IMPL_NSGETMODULE("nsDataProtocolModule", components) +NS_IMPL_NSGETMODULE(nsDataProtocolModule, components) diff --git a/netwerk/protocol/datetime/src/nsDateTimeModule.cpp b/netwerk/protocol/datetime/src/nsDateTimeModule.cpp index 8f470b46fe5..c2e1c491c1e 100644 --- a/netwerk/protocol/datetime/src/nsDateTimeModule.cpp +++ b/netwerk/protocol/datetime/src/nsDateTimeModule.cpp @@ -31,4 +31,4 @@ static nsModuleComponentInfo gResComponents[] = { } }; -NS_IMPL_NSGETMODULE("datetime", gResComponents) +NS_IMPL_NSGETMODULE(datetime, gResComponents) diff --git a/netwerk/protocol/file/src/nsFileProtocolModule.cpp b/netwerk/protocol/file/src/nsFileProtocolModule.cpp index 57b77836ba3..86c3eac1c0e 100644 --- a/netwerk/protocol/file/src/nsFileProtocolModule.cpp +++ b/netwerk/protocol/file/src/nsFileProtocolModule.cpp @@ -39,4 +39,4 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsFileProtocolModule", components); +NS_IMPL_NSGETMODULE(nsFileProtocolModule, components); diff --git a/netwerk/protocol/finger/src/nsFingerModule.cpp b/netwerk/protocol/finger/src/nsFingerModule.cpp index aa127b9e2d2..97d3cdf0745 100644 --- a/netwerk/protocol/finger/src/nsFingerModule.cpp +++ b/netwerk/protocol/finger/src/nsFingerModule.cpp @@ -31,4 +31,4 @@ static nsModuleComponentInfo gResComponents[] = { } }; -NS_IMPL_NSGETMODULE("finger", gResComponents) +NS_IMPL_NSGETMODULE(finger, gResComponents) diff --git a/netwerk/protocol/http/src/nsHTTPHandlerModule.cpp b/netwerk/protocol/http/src/nsHTTPHandlerModule.cpp index aaf03704fc2..e69de29bb2d 100644 --- a/netwerk/protocol/http/src/nsHTTPHandlerModule.cpp +++ b/netwerk/protocol/http/src/nsHTTPHandlerModule.cpp @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Gagan Saksena - */ -#include "nsIGenericFactory.h" -#include "nsIServiceManager.h" -#include "nsIModule.h" - -#include "nsXPComFactory.h" - -#include "nsIHTTPProtocolHandler.h" -#include "nsHTTPHandler.h" -#include "nsHTTPSHandler.h" - -//////////////////////////////////////////////////////////////////////// - -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHTTPHandler, Init); -//NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTTPSHandler); - -#define NS_HTTPS_HANDLER_FACTORY_CID { 0xd2771480, 0xcac4, 0x11d3, { 0x8c, 0xaf, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } } - -static nsModuleComponentInfo components[] = -{ - { "HTTP Handler", - NS_IHTTPHANDLER_CID, - NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", - nsHTTPHandlerConstructor }, - { "HTTPS Handler", - NS_HTTPS_HANDLER_FACTORY_CID, - NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "https", - nsHTTPSHandler::Create } -}; - -NS_IMPL_NSGETMODULE("nsHTTPHandlerModule", components) diff --git a/netwerk/protocol/jar/src/nsJARProtocolModule.cpp b/netwerk/protocol/jar/src/nsJARProtocolModule.cpp index 4f2f0d06ee2..df4974546ca 100644 --- a/netwerk/protocol/jar/src/nsJARProtocolModule.cpp +++ b/netwerk/protocol/jar/src/nsJARProtocolModule.cpp @@ -33,6 +33,6 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsJarProtocolModule", components); +NS_IMPL_NSGETMODULE(nsJarProtocolModule, components); diff --git a/netwerk/protocol/keyword/src/nsKeywordModule.cpp b/netwerk/protocol/keyword/src/nsKeywordModule.cpp index 6252bb2aabf..24fc4cfc7c3 100644 --- a/netwerk/protocol/keyword/src/nsKeywordModule.cpp +++ b/netwerk/protocol/keyword/src/nsKeywordModule.cpp @@ -31,4 +31,4 @@ static nsModuleComponentInfo gResComponents[] = { } }; -NS_IMPL_NSGETMODULE("keyword", gResComponents) +NS_IMPL_NSGETMODULE(keyword, gResComponents) diff --git a/netwerk/protocol/res/src/nsResProtocolModule.cpp b/netwerk/protocol/res/src/nsResProtocolModule.cpp index 679766dd3ef..e69de29bb2d 100644 --- a/netwerk/protocol/res/src/nsResProtocolModule.cpp +++ b/netwerk/protocol/res/src/nsResProtocolModule.cpp @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -#include "nsIGenericFactory.h" -#include "nsResProtocolHandler.h" - -static nsModuleComponentInfo gResComponents[] = { - { "The Resource Protocol Handler", - NS_RESPROTOCOLHANDLER_CID, - NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "resource", - nsResProtocolHandler::Create - } -2}; - -NS_IMPL_NSGETMODULE("res", gResComponents) diff --git a/netwerk/protocol/theme/src/nsThemeModule.cpp b/netwerk/protocol/theme/src/nsThemeModule.cpp index e0db0eb6178..d5d541e0f36 100644 --- a/netwerk/protocol/theme/src/nsThemeModule.cpp +++ b/netwerk/protocol/theme/src/nsThemeModule.cpp @@ -32,4 +32,4 @@ static nsModuleComponentInfo gResComponents[] = { } }; -NS_IMPL_NSGETMODULE("theme", gResComponents) +NS_IMPL_NSGETMODULE(theme, gResComponents) diff --git a/netwerk/streamconv/converters/nsConvFactories.cpp b/netwerk/streamconv/converters/nsConvFactories.cpp index 7f9cbc995fe..1e50743e0ff 100644 --- a/netwerk/streamconv/converters/nsConvFactories.cpp +++ b/netwerk/streamconv/converters/nsConvFactories.cpp @@ -304,4 +304,4 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsConvModule", components); +NS_IMPL_NSGETMODULE(nsConvModule, components); diff --git a/netwerk/streamconv/src/nsStreamConvServiceFactory.cpp b/netwerk/streamconv/src/nsStreamConvServiceFactory.cpp index be074be1a4a..77b249a4f2d 100644 --- a/netwerk/streamconv/src/nsStreamConvServiceFactory.cpp +++ b/netwerk/streamconv/src/nsStreamConvServiceFactory.cpp @@ -89,4 +89,4 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsStreamConvModule", components); +NS_IMPL_NSGETMODULE(nsStreamConvModule, components); diff --git a/profile/pref-migrator/src/nsPrefMigrationFactory.cpp b/profile/pref-migrator/src/nsPrefMigrationFactory.cpp index 153215c462b..3e7c3395963 100644 --- a/profile/pref-migrator/src/nsPrefMigrationFactory.cpp +++ b/profile/pref-migrator/src/nsPrefMigrationFactory.cpp @@ -61,4 +61,4 @@ static nsModuleComponentInfo components[] = NS_PREFCONVERTER_CONTRACTID, nsPrefConverterConstructor} }; -NS_IMPL_NSGETMODULE("nsPrefMigrationModule", components); +NS_IMPL_NSGETMODULE(nsPrefMigrationModule, components); diff --git a/profile/src/nsProfileFactory.cpp b/profile/src/nsProfileFactory.cpp index 4d7e8ab63de..2bcebfede04 100644 --- a/profile/src/nsProfileFactory.cpp +++ b/profile/src/nsProfileFactory.cpp @@ -35,4 +35,4 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsProfileModule", components); +NS_IMPL_NSGETMODULE(nsProfileModule, components); diff --git a/rdf/build/nsRDFModule.cpp b/rdf/build/nsRDFModule.cpp index 2b1f4a833e0..39a4fa5a22b 100644 --- a/rdf/build/nsRDFModule.cpp +++ b/rdf/build/nsRDFModule.cpp @@ -151,4 +151,4 @@ static nsModuleComponentInfo components[] = NS_LOCALSTORE_CONTRACTID, NS_NewLocalStore }, }; -NS_IMPL_NSGETMODULE("nsRDFModule", components); +NS_IMPL_NSGETMODULE(nsRDFModule, components); diff --git a/rdf/chrome/build/nsChromeFactory.cpp b/rdf/chrome/build/nsChromeFactory.cpp index 4b25c4767af..ee404d77418 100644 --- a/rdf/chrome/build/nsChromeFactory.cpp +++ b/rdf/chrome/build/nsChromeFactory.cpp @@ -51,5 +51,5 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsChromeModule", components); +NS_IMPL_NSGETMODULE(nsChromeModule, components); diff --git a/rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp b/rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp index a6dd340d84e..523bd3eb2e3 100644 --- a/rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp +++ b/rdf/tests/domds/nsRDFDOMDataSourceFactory.cpp @@ -43,4 +43,4 @@ static nsModuleComponentInfo gRDFDOMViewerModuleComponents[] = nsRDFDOMViewerElementConstructor } }; -NS_IMPL_NSGETMODULE("nsRDFDOMViewerModule", gRDFDOMViewerModuleComponents) +NS_IMPL_NSGETMODULE(nsRDFDOMViewerModule, gRDFDOMViewerModuleComponents) diff --git a/uriloader/build/nsURILoaderModule.cpp b/uriloader/build/nsURILoaderModule.cpp index 6d853d071eb..8e92f776d9f 100644 --- a/uriloader/build/nsURILoaderModule.cpp +++ b/uriloader/build/nsURILoaderModule.cpp @@ -61,4 +61,4 @@ static nsModuleComponentInfo components[] = { // Implement the NSGetModule() exported function for your module // and the entire implementation of the module object. // -NS_IMPL_NSGETMODULE("nsURILoaderModule", components) +NS_IMPL_NSGETMODULE(nsURILoaderModule, components) diff --git a/view/src/nsViewFactory.cpp b/view/src/nsViewFactory.cpp index fc4cca2b7e0..7e3bbaf1c83 100644 --- a/view/src/nsViewFactory.cpp +++ b/view/src/nsViewFactory.cpp @@ -26,6 +26,7 @@ #include "nsISupports.h" #include "nsCOMPtr.h" #include "nsIServiceManager.h" +#include "nsIGenericFactory.h" #include "nsViewsCID.h" #include "nsView.h" @@ -35,82 +36,8 @@ #include "nsIModule.h" #include "nsIPref.h" -static NS_DEFINE_CID(kCViewManager, NS_VIEW_MANAGER_CID); -static NS_DEFINE_CID(kCView, NS_VIEW_CID); -static NS_DEFINE_CID(kCScrollingView, NS_SCROLLING_VIEW_CID); -static NS_DEFINE_IID(kCScrollPortView, NS_SCROLL_PORT_VIEW_CID); -static NS_DEFINE_CID(kCComponentManager, NS_COMPONENTMANAGER_CID); - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); - static const char kUseNewViewManagerPref[] = "nglayout.debug.enable_scary_view_manager"; - -class nsViewFactory : public nsIFactory -{ -public: - nsViewFactory(const nsCID &aClass); - virtual ~nsViewFactory(); - - NS_DECL_ISUPPORTS - - NS_DECL_NSIFACTORY - - private: - nsCID mClassID; -}; - -nsViewFactory::nsViewFactory(const nsCID &aClass) -{ - NS_INIT_ISUPPORTS(); - mClassID = aClass; -} - -nsViewFactory::~nsViewFactory() -{ -} - -NS_IMPL_ISUPPORTS1(nsViewFactory, nsIFactory) - -nsresult nsViewFactory::CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult) -{ - nsresult rv = NS_OK; - - if (aResult == NULL) { - return NS_ERROR_NULL_POINTER; - } - - *aResult = NULL; - - // views aren't reference counted, so have to be treated specially. - // their lifetimes are managed by the view manager they are associated with. - nsIView* view = nsnull; - if (mClassID.Equals(kCView)) { - view = new nsView(); - } else if (mClassID.Equals(kCScrollingView)) { - view = new nsScrollingView(); - } else if (mClassID.Equals(kCScrollPortView)) { - view = new nsScrollPortView(); - } - - if (nsnull == view) - return NS_ERROR_OUT_OF_MEMORY; - rv = view->QueryInterface(aIID, aResult); - if (NS_FAILED(rv)) - view->Destroy(); - - return rv; -} - -nsresult nsViewFactory::LockFactory(PRBool aLock) -{ - // Not implemented in simplest case. - return NS_OK; -} - #include "nsViewManager.h" #include "nsViewManager2.h" @@ -129,213 +56,23 @@ static NS_IMETHODIMP ViewManagerConstructor(nsISupports *aOuter, REFNSIID aIID, : nsViewManager2Constructor(aOuter, aIID, aResult); } -#define nsViewManagerConstructor ViewManagerConstructor +/* man, I'm going to hell for this, but they're not refcounted */ +#undef NS_ADDREF +#define NS_ADDREF(x) (void)0; +#undef NS_RELEASE +#define NS_RELEASE(x) (void)0; +NS_GENERIC_FACTORY_CONSTRUCTOR(nsView) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsScrollingView) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsScrollPortView) - -////////////////////////////////////////////////////////////////////// -// Module object definition - -class nsViewModule : public nsIModule -{ - public: - NS_DECL_ISUPPORTS - - // Construction, Init and destruction - nsViewModule(); - virtual ~nsViewModule(); - - // nsIModule Interfaces - NS_DECL_NSIMODULE - - // Facility for counting object instances - int IncrementObjCount() { if (mObjCount < 0) mObjCount = 0; return ++mObjCount; } - int DecrementObjCount() - { - NS_ASSERTION(mObjCount <= -1, "Object count negative."); - return --mObjCount; - } - int GetObjCount() { return mObjCount; } - - private: - int mObjCount; +static nsModuleComponentInfo components[] = { + { "View Manager", NS_VIEW_MANAGER_CID, "@mozilla.org/view-manager;1", + ViewManagerConstructor }, + { "View", NS_VIEW_CID, "@mozilla.org/view;1", nsViewConstructor }, + { "Scrolling View", NS_SCROLLING_VIEW_CID, "@mozilla.org/scrolling-view;1", + nsScrollingViewConstructor }, + { "Scroll Port View", NS_SCROLL_PORT_VIEW_CID, + "@mozilla.org/scroll-port-view;1", nsScrollPortViewConstructor } }; -////////////////////////////////////////////////////////////////////// -// Module Global -// -// This is used by the module to count object. Constructors and -// destructors of objects created by this module need to -// inc/dec the object count for the module. Unload decision will -// be taken based on this. -// -// Constructor: -// gModule->IncrementObjCount(); -// -// Descructor: -// gModule->DecrementObjCount(); -// -// WARNING: This is weak reference. XPCOM guarantees that this module -// object will be deleted just before the dll is unloaded. Hence, -// holding a weak reference is ok. - -static nsViewModule *gModule = NULL; - -////////////////////////////////////////////////////////////////////// -// Module entry point - -extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr, - nsIFile* aPath, - nsIModule** return_cobj) -{ - nsViewModule *viewModule; - nsresult rv = NS_OK; - - NS_ASSERTION(return_cobj, "Null argument"); - NS_ASSERTION(gModule == NULL, "nsViewModule: Module already created."); - - viewModule = new nsViewModule; - if (viewModule == NULL) return NS_ERROR_OUT_OF_MEMORY; - - rv = viewModule->QueryInterface(NS_GET_IID(nsIModule), (void **)return_cobj); - - if (NS_FAILED(rv)) - { - delete viewModule; - viewModule = NULL; - } - - // WARNING: Weak Reference - gModule = viewModule; - - return rv; -} - -////////////////////////////////////////////////////////////////////// -// VIEW Decoder Module Implementation - -NS_IMPL_ISUPPORTS(nsViewModule, NS_GET_IID(nsIModule)) - -nsViewModule::nsViewModule(void) - : mObjCount(-1) -{ - NS_INIT_ISUPPORTS(); -} - -nsViewModule::~nsViewModule(void) -{ - NS_ASSERTION(mObjCount <= 0, "Module released while having outstanding objects."); -} - -static nsModuleComponentInfo ViewManagerCI = { - NULL, NS_VIEW_MANAGER_CID, NULL, nsViewManagerConstructor -}; - -// -// The class object for us is just the factory and nothing more. -// -NS_IMETHODIMP -nsViewModule::GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass, - const nsIID &aIID, void **aFactory) -{ - nsresult rv = NS_OK; - - if (nsnull == aFactory) - return NS_ERROR_NULL_POINTER; - - // XXX should we do this ? - *aFactory = nsnull; - - if (aClass.Equals(kCViewManager)) - { - nsCOMPtr factory; - rv = NS_NewGenericFactory(getter_AddRefs(factory), &ViewManagerCI); - if (NS_SUCCEEDED(rv)) - { - rv = factory->QueryInterface(aIID, aFactory); - } - } - else if (aClass.Equals(kCView) || aClass.Equals(kCScrollingView) || aClass.Equals(kCScrollPortView)) - { - rv = NS_ERROR_OUT_OF_MEMORY; - nsViewFactory* factory = new nsViewFactory(aClass); - if (factory) - { - NS_ADDREF(factory); - rv = factory->QueryInterface(aIID, aFactory); - NS_RELEASE(factory); - } - } - - return rv; -} - -NS_IMETHODIMP -nsViewModule::RegisterSelf(nsIComponentManager *aCompMgr, - nsIFile* aPath, - const char *registryLocation, - const char *componentType) -{ - nsresult rv; - -#ifdef DEBUG_dp - printf("***Registering view library..."); -#endif - - rv = aCompMgr->RegisterComponentSpec(kCViewManager, "View Manager", - "@mozilla.org/view-manager;1", - aPath, PR_TRUE, PR_TRUE); - if (NS_FAILED(rv)) return rv; - rv = aCompMgr->RegisterComponentSpec(kCView, "View", - "@mozilla.org/view;1", - aPath, PR_TRUE, PR_TRUE); - if (NS_FAILED(rv)) return rv; - rv = aCompMgr->RegisterComponentSpec(kCScrollingView, "Scrolling View", - "@mozilla.org/scrolling-view;1", - aPath, PR_TRUE, PR_TRUE); - if (NS_FAILED(rv)) return rv; - rv = aCompMgr->RegisterComponentSpec(kCScrollPortView, "Scroll Port View", - "@mozilla.org/scroll-port-view;1", - aPath, PR_TRUE, PR_TRUE); -#ifdef DEBUG_dp - printf("done.\n"); -#endif - return rv; -} - -NS_IMETHODIMP -nsViewModule::UnregisterSelf(nsIComponentManager *aCompMgr, - nsIFile* aPath, - const char *registryLocation) -{ - nsresult rv; - rv = aCompMgr->UnregisterComponentSpec(kCViewManager, aPath); - if (NS_FAILED(rv)) return rv; - rv = aCompMgr->UnregisterComponentSpec(kCView, aPath); - if (NS_FAILED(rv)) return rv; - rv = aCompMgr->UnregisterComponentSpec(kCScrollingView, aPath); - if (NS_FAILED(rv)) return rv; - rv = aCompMgr->UnregisterComponentSpec(kCScrollPortView, aPath); - return rv; -} - -NS_IMETHODIMP -nsViewModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload) -{ - if (mObjCount < 0) - { - // Dll doesn't count objects. - return NS_ERROR_FAILURE; - } - - PRBool unloadable = PR_FALSE; - if (mObjCount == 0) - { - // This dll can be unloaded now - unloadable = PR_TRUE; - } - - if (okToUnload) *okToUnload = unloadable; - return NS_OK; -} - -////////////////////////////////////////////////////////////////////// +NS_IMPL_NSGETMODULE(nsViewModule, components) diff --git a/widget/src/gtk/nsWidgetFactory.cpp b/widget/src/gtk/nsWidgetFactory.cpp index 8d3f37b9493..393721c2e45 100644 --- a/widget/src/gtk/nsWidgetFactory.cpp +++ b/widget/src/gtk/nsWidgetFactory.cpp @@ -225,6 +225,6 @@ nsWidgetGTKModuleDtor(nsIModule *self) nsGtkIMEHelper::Shutdown(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsWidgetGTKModule", +NS_IMPL_NSGETMODULE_WITH_DTOR(nsWidgetGTKModule, components, nsWidgetGTKModuleDtor) diff --git a/widget/src/os2/nsWidgetFactory.cpp b/widget/src/os2/nsWidgetFactory.cpp index b885e95fa6c..c32051f4a11 100644 --- a/widget/src/os2/nsWidgetFactory.cpp +++ b/widget/src/os2/nsWidgetFactory.cpp @@ -309,6 +309,6 @@ nsWidgetOS2ModuleDtor(nsIModule *self) // what shall we do here? } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsWidgetOS2Module", +NS_IMPL_NSGETMODULE_WITH_DTOR(nsWidgetOS2Module, components, nsWidgetOS2ModuleDtor) diff --git a/widget/src/photon/nsWidgetFactory.cpp b/widget/src/photon/nsWidgetFactory.cpp index 8c1aae3cbdc..4a1f1dbece1 100644 --- a/widget/src/photon/nsWidgetFactory.cpp +++ b/widget/src/photon/nsWidgetFactory.cpp @@ -168,5 +168,5 @@ static nsModuleComponentInfo components[] = }; -NS_IMPL_NSGETMODULE("nsWidgetPhModule", components) +NS_IMPL_NSGETMODULE(nsWidgetPhModule, components) diff --git a/widget/src/qt/nsWidgetFactory.cpp b/widget/src/qt/nsWidgetFactory.cpp index 8e4327521d2..ee7de76ade7 100644 --- a/widget/src/qt/nsWidgetFactory.cpp +++ b/widget/src/qt/nsWidgetFactory.cpp @@ -165,4 +165,4 @@ static nsModuleComponentInfo components[] = nsFileSpecWithUIImplConstructor } }; -NS_IMPL_NSGETMODULE("nsWidgetQTModule",components) +NS_IMPL_NSGETMODULE(nsWidgetQTModule,components) diff --git a/widget/src/xlib/nsWidgetFactory.cpp b/widget/src/xlib/nsWidgetFactory.cpp index 82211b7c852..74f0e443045 100644 --- a/widget/src/xlib/nsWidgetFactory.cpp +++ b/widget/src/xlib/nsWidgetFactory.cpp @@ -225,6 +225,6 @@ nsWidgetXLIBModuleDtor(nsIModule *self) nsClipboard::Shutdown(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsWidgetXLIBModule", +NS_IMPL_NSGETMODULE_WITH_DTOR(nsWidgetXLIBModule, components, nsWidgetXLIBModuleDtor) diff --git a/widget/src/xremoteclient/XRemoteClient.cpp b/widget/src/xremoteclient/XRemoteClient.cpp index 5d123d4fb61..ca39abc7123 100644 --- a/widget/src/xremoteclient/XRemoteClient.cpp +++ b/widget/src/xremoteclient/XRemoteClient.cpp @@ -489,5 +489,5 @@ static nsModuleComponentInfo components[] = XRemoteClientConstructor } }; -NS_IMPL_NSGETMODULE("XRemoteClientModule", components); +NS_IMPL_NSGETMODULE(XRemoteClientModule, components); diff --git a/widget/timer/src/beos/nsTimerBeOSFactory.cpp b/widget/timer/src/beos/nsTimerBeOSFactory.cpp index 7e5b2d9d8d8..33523498322 100644 --- a/widget/timer/src/beos/nsTimerBeOSFactory.cpp +++ b/widget/timer/src/beos/nsTimerBeOSFactory.cpp @@ -41,4 +41,4 @@ static nsModuleComponentInfo components[] = nsTimerBeOSConstructor } }; -NS_IMPL_NSGETMODULE("nsBeOSTimerModule", components) +NS_IMPL_NSGETMODULE(nsBeOSTimerModule, components) diff --git a/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp b/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp index bab019b58b6..d8c30cd45ee 100644 --- a/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp +++ b/widget/timer/src/unix/gtk/nsTimerGtkFactory.cpp @@ -47,4 +47,4 @@ nsGtkTimerModuleDtor(nsIModule *self) nsTimerGtk::Shutdown(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsGtkTimerModule", components, nsGtkTimerModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsGtkTimerModule, components, nsGtkTimerModuleDtor) diff --git a/widget/timer/src/unix/photon/nsTimerPhFactory.cpp b/widget/timer/src/unix/photon/nsTimerPhFactory.cpp index 8889f9bacbb..187e997b05a 100644 --- a/widget/timer/src/unix/photon/nsTimerPhFactory.cpp +++ b/widget/timer/src/unix/photon/nsTimerPhFactory.cpp @@ -42,4 +42,4 @@ static nsModuleComponentInfo components[] = nsTimerPhConstructor } }; -NS_IMPL_NSGETMODULE("nsPhTimerModule", components) +NS_IMPL_NSGETMODULE(nsPhTimerModule, components) diff --git a/widget/timer/src/unix/qt/nsTimerQtFactory.cpp b/widget/timer/src/unix/qt/nsTimerQtFactory.cpp index a303ea7da04..0a1052c63a0 100644 --- a/widget/timer/src/unix/qt/nsTimerQtFactory.cpp +++ b/widget/timer/src/unix/qt/nsTimerQtFactory.cpp @@ -43,5 +43,5 @@ static nsModuleComponentInfo components[] = nsTimerQtConstructor } }; -NS_IMPL_NSGETMODULE("nsQtTimerModule",components) +NS_IMPL_NSGETMODULE(nsQtTimerModule,components) diff --git a/widget/timer/src/unix/xlib/nsTimerXlibFactory.cpp b/widget/timer/src/unix/xlib/nsTimerXlibFactory.cpp index ec6824436f4..b1cb9ae8d07 100644 --- a/widget/timer/src/unix/xlib/nsTimerXlibFactory.cpp +++ b/widget/timer/src/unix/xlib/nsTimerXlibFactory.cpp @@ -54,6 +54,6 @@ nsXlibTimerModuleDtor(nsIModule *self) nsTimerXlib::Shutdown(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsXlibTimerModule", +NS_IMPL_NSGETMODULE_WITH_DTOR(nsXlibTimerModule, components, nsXlibTimerModuleDtor) diff --git a/xpcom/appshell/eventloop/xp/nsCLoopModule.cpp b/xpcom/appshell/eventloop/xp/nsCLoopModule.cpp index bd8b73b9a09..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/xp/nsCLoopModule.cpp +++ b/xpcom/appshell/eventloop/xp/nsCLoopModule.cpp @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCAppLoop.h" -#include "nsCThreadLoop.h" -#include "nsCBreathLoop.h" -#include "nsIGenericFactory.h" - -static nsModuleComponentInfo components[] = -{ - { "Native App Service", NS_EVENTLOOP_APP_CID, NS_EVENTLOOP_APP_CONTRACTID, - nsCAppLoop::Create - }, - { "Native App Service", NS_EVENTLOOP_THREAD_CID, NS_EVENTLOOP_THREAD_CONTRACTID, - nsCThreadLoop::Create - }, - { "Native App Service", NS_EVENTLOOP_BREATH_CID, NS_EVENTLOOP_BREATH_CONTRACTID, - nsCBreathLoop::Create - } -}; - -NS_IMPL_NSGETMODULE("nsNativeAppModule", components) diff --git a/xpcom/appshell/nativeApp/nsCNativeAppModule.cpp b/xpcom/appshell/nativeApp/nsCNativeAppModule.cpp index 5a9f81fb079..e69de29bb2d 100644 --- a/xpcom/appshell/nativeApp/nsCNativeAppModule.cpp +++ b/xpcom/appshell/nativeApp/nsCNativeAppModule.cpp @@ -1,33 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCNativeAppImpl.h" -#include "nsIGenericFactory.h" - -static nsModuleComponentInfo components[] = -{ - { "Native App Service", NS_NATIVE_APP_CID, NS_NATIVE_APP_CONTRACTID, - nsCNativeAppImpl::Create - } -}; - -NS_IMPL_NSGETMODULE("nsCNativeAppModule", components) diff --git a/xpcom/components/nsIGenericFactory.h b/xpcom/components/nsIGenericFactory.h index 77d6a20e566..c67ac696116 100644 --- a/xpcom/components/nsIGenericFactory.h +++ b/xpcom/components/nsIGenericFactory.h @@ -113,21 +113,30 @@ NS_NewGenericModule(const char* moduleName, nsModuleDestructorProc dtor, nsIModule* *result); +#ifdef MOZ_STATIC_COMPONENT_LIBS +# define NSGETMODULE_ENTRY_POINT(_name) NSGetModule_##_name +#else +# define NSGETMODULE_ENTRY_POINT(_name) NSGetModule +#endif + #define NS_IMPL_NSGETMODULE(_name, _components) \ NS_IMPL_NSGETMODULE_WITH_DTOR(_name, _components, nsnull) #define NS_IMPL_NSGETMODULE_WITH_DTOR(_name, _components, _dtor) \ \ -PRUint32 NSGetModule_components_count = \ - sizeof(_components) / sizeof(_components[0]); \ +enum { \ + NSGetModule_components_count = \ + sizeof(_components) / sizeof(_components[0]) \ +}; \ \ -nsModuleComponentInfo* NSGetModule_components = (_components); \ +static nsModuleComponentInfo* NSGetModule_components = (_components); \ \ -extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr, \ - nsIFile* location, \ - nsIModule** result) \ +extern "C" NS_EXPORT nsresult \ +NSGETMODULE_ENTRY_POINT(_name) (nsIComponentManager *servMgr, \ + nsIFile* location, \ + nsIModule** result) \ { \ - return NS_NewGenericModule((_name), \ + return NS_NewGenericModule((#_name), \ NSGetModule_components_count, \ NSGetModule_components, \ _dtor, result); \ diff --git a/xpcom/glue/nsIGenericFactory.h b/xpcom/glue/nsIGenericFactory.h index 77d6a20e566..c67ac696116 100644 --- a/xpcom/glue/nsIGenericFactory.h +++ b/xpcom/glue/nsIGenericFactory.h @@ -113,21 +113,30 @@ NS_NewGenericModule(const char* moduleName, nsModuleDestructorProc dtor, nsIModule* *result); +#ifdef MOZ_STATIC_COMPONENT_LIBS +# define NSGETMODULE_ENTRY_POINT(_name) NSGetModule_##_name +#else +# define NSGETMODULE_ENTRY_POINT(_name) NSGetModule +#endif + #define NS_IMPL_NSGETMODULE(_name, _components) \ NS_IMPL_NSGETMODULE_WITH_DTOR(_name, _components, nsnull) #define NS_IMPL_NSGETMODULE_WITH_DTOR(_name, _components, _dtor) \ \ -PRUint32 NSGetModule_components_count = \ - sizeof(_components) / sizeof(_components[0]); \ +enum { \ + NSGetModule_components_count = \ + sizeof(_components) / sizeof(_components[0]) \ +}; \ \ -nsModuleComponentInfo* NSGetModule_components = (_components); \ +static nsModuleComponentInfo* NSGetModule_components = (_components); \ \ -extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr, \ - nsIFile* location, \ - nsIModule** result) \ +extern "C" NS_EXPORT nsresult \ +NSGETMODULE_ENTRY_POINT(_name) (nsIComponentManager *servMgr, \ + nsIFile* location, \ + nsIModule** result) \ { \ - return NS_NewGenericModule((_name), \ + return NS_NewGenericModule((#_name), \ NSGetModule_components_count, \ NSGetModule_components, \ _dtor, result); \ diff --git a/xpcom/sample/nsSampleModule.cpp b/xpcom/sample/nsSampleModule.cpp index 52b75a35167..fac32a0ea68 100644 --- a/xpcom/sample/nsSampleModule.cpp +++ b/xpcom/sample/nsSampleModule.cpp @@ -113,4 +113,4 @@ static nsModuleComponentInfo components[] = // NS_IMPL_NSGETMODULE_WITH_DTOR() instead of the vanilla // NS_IMPL_NSGETMODULE() // -NS_IMPL_NSGETMODULE("nsSampleModule", components) +NS_IMPL_NSGETMODULE(nsSampleModule, components) diff --git a/xpcom/tests/dynamic/TestDynamic.cpp b/xpcom/tests/dynamic/TestDynamic.cpp index 03882fa870a..138ac70aba6 100644 --- a/xpcom/tests/dynamic/TestDynamic.cpp +++ b/xpcom/tests/dynamic/TestDynamic.cpp @@ -58,5 +58,5 @@ static nsModuleComponentInfo components[] = } }; -NS_IMPL_NSGETMODULE("nsTestDynamicModule", components) +NS_IMPL_NSGETMODULE(nsTestDynamicModule, components) diff --git a/xpfe/appshell/src/nsAppShellFactory.cpp b/xpfe/appshell/src/nsAppShellFactory.cpp index c890ebda074..ecee9794aa1 100644 --- a/xpfe/appshell/src/nsAppShellFactory.cpp +++ b/xpfe/appshell/src/nsAppShellFactory.cpp @@ -117,5 +117,5 @@ static nsModuleComponentInfo gAppShellModuleInfo[] = #endif }; -NS_IMPL_NSGETMODULE("appshell", gAppShellModuleInfo) +NS_IMPL_NSGETMODULE(appshell, gAppShellModuleInfo) diff --git a/xpfe/browser/src/nsBrowserInstance.cpp b/xpfe/browser/src/nsBrowserInstance.cpp index 2966641ee61..6efc20cb586 100644 --- a/xpfe/browser/src/nsBrowserInstance.cpp +++ b/xpfe/browser/src/nsBrowserInstance.cpp @@ -1082,5 +1082,5 @@ static nsModuleComponentInfo components[] = { }; -NS_IMPL_NSGETMODULE("nsBrowserModule", components) +NS_IMPL_NSGETMODULE(nsBrowserModule, components) diff --git a/xpfe/components/build/nsModule.cpp b/xpfe/components/build/nsModule.cpp index 60121d52325..f15a8bd2a40 100644 --- a/xpfe/components/build/nsModule.cpp +++ b/xpfe/components/build/nsModule.cpp @@ -148,4 +148,4 @@ static nsModuleComponentInfo components[] = { #endif }; -NS_IMPL_NSGETMODULE("application", components) +NS_IMPL_NSGETMODULE(application, components) diff --git a/xpfe/components/find/src/nsFindModule.cpp b/xpfe/components/find/src/nsFindModule.cpp index d2ed7e6bec3..1a20be5ede6 100644 --- a/xpfe/components/find/src/nsFindModule.cpp +++ b/xpfe/components/find/src/nsFindModule.cpp @@ -37,5 +37,5 @@ nsFindModuleDtor(nsIModule* self) nsFindService::FreeSingleton(); } -NS_IMPL_NSGETMODULE_WITH_DTOR("nsFindComponent", gComponents, nsFindModuleDtor) +NS_IMPL_NSGETMODULE_WITH_DTOR(nsFindComponent, gComponents, nsFindModuleDtor) diff --git a/xpfe/components/public/nsIAppShellComponentImpl.h b/xpfe/components/public/nsIAppShellComponentImpl.h index 2ea05ffafc9..dbe2798e1b8 100644 --- a/xpfe/components/public/nsIAppShellComponentImpl.h +++ b/xpfe/components/public/nsIAppShellComponentImpl.h @@ -63,7 +63,7 @@ #define NS_IMPL_NSGETMODULE1(_class) \ static _class *g##_class; \ extern "C" NS_EXPORT nsresult \ -NSGetModule(nsIComponentManager *servMgr, \ +NSGetModule_##_class(nsIComponentManager *servMgr, \ nsIFile* aPath, \ nsIModule** aResult) \ { \ @@ -88,32 +88,48 @@ class nsInstanceCounter { public: // ctor increments (shared library) global instance counter. nsInstanceCounter() { +#if defined (DYNLINKED_MODULES) PR_AtomicIncrement( &mInstanceCount ); +#endif /* defined (DYNLINKED_MODULES) */ } // dtor decrements it. ~nsInstanceCounter() { +#if defined (DYNLINKED_MODULES) PR_AtomicDecrement( &mInstanceCount ); +#endif /* defined (DYNLINKED_MODULES) */ } // Tests whether shared library can be unloaded. static PRBool CanUnload() { +#if defined (DYNLINKED_MODULES) return mInstanceCount == 0 && mLockCount == 0; +#else /* !defined (DYNLINKED_MODULES) */ + return 0; +#endif /* !defined (DYNLINKED_MODULES) */ } // Lock/unlock (a factory). static nsresult LockFactory( PRBool aLock ) { +#if defined (DYNLINKED_MODULES) if (aLock) PR_AtomicIncrement( &mLockCount ); else PR_AtomicDecrement( &mLockCount ); +#endif /* defined (DYNLINKED_MODULES) */ return NS_OK; } +#if defined (DYNLINKED_MODULES) private: static PRInt32 mInstanceCount, mLockCount; +#endif /* defined (DYNLINKED_MODULES) */ }; // nsInstanceCounter +#if defined (DYNLINKED_MODULES) #define NS_DEFINE_MODULE_INSTANCE_COUNTER() \ PRInt32 nsInstanceCounter::mInstanceCount = 0; \ -PRInt32 nsInstanceCounter::mLockCount = 0; \ -\ +PRInt32 nsInstanceCounter::mLockCount = 0; +#else /* !defined (DYNLINKED_MODULES) */ +#define NS_DEFINE_MODULE_INSTANCE_COUNTER() +#endif /* !defined (DYNLINKED_MODULES) */ + // Declare component-global class. class nsAppShellComponentImpl { public: @@ -124,7 +140,12 @@ public: // Override this to perform initialization for your component. NS_IMETHOD DoInitialization() { return NS_OK; } static nsIAppShellService *GetAppShell() { - if ( !mAppShell ) { +#if defined (DYNLINKED_MODULES) + if ( !mAppShell ) +#else /* !defined (DYNLINKED_MODULES) */ + nsIAppShellService *mAppShell = 0; +#endif /* !defined (DYNLINKED_MODULES) */ + { nsCID cid = NS_APPSHELL_SERVICE_CID; nsServiceManager::GetService( cid, NS_GET_IID(nsIAppShellService), @@ -132,17 +153,27 @@ public: } return mAppShell; } +#if defined (DYNLINKED_MODULES) static nsIAppShellService *mAppShell; static nsICmdLineService *mCmdLine; +#endif /* !defined (DYNLINKED_MODULES) */ #ifdef NS_DEBUG nsAppShellComponentImpl(); virtual ~nsAppShellComponentImpl(); #endif }; // nsAppShellComponent +#if defined (DYNLINKED_MODULES) #define NS_DEFINE_COMPONENT_GLOBALS() \ nsIAppShellService *nsAppShellComponentImpl::mAppShell = 0; \ nsICmdLineService *nsAppShellComponentImpl::mCmdLine = 0; +#define SAVE_STUFF \ + mAppShell = anAppShell; \ + mCmdLine = aCmdLineService; +#else /* !defined (DYNLINKED_MODULES) */ +#define NS_DEFINE_COMPONENT_GLOBALS() +#define SAVE_STUFF +#endif /* !defined (DYNLINKED_MODULES) */ // Macros to define ctor/dtor for implementation class. // These differ in debug vs. non-debug situations. @@ -168,8 +199,7 @@ NS_IMETHODIMP \ className::Initialize( nsIAppShellService *anAppShell, \ nsICmdLineService *aCmdLineService ) { \ nsresult rv = NS_OK; \ - mAppShell = anAppShell; \ - mCmdLine = aCmdLineService; \ + SAVE_STUFF \ if ( Is_Service() ) { \ rv = nsServiceManager::RegisterService( contractId, this ); \ } \ diff --git a/xpfe/components/regviewer/nsRegistryDataSource.cpp b/xpfe/components/regviewer/nsRegistryDataSource.cpp index 4954807bad5..e17353fdfad 100644 --- a/xpfe/components/regviewer/nsRegistryDataSource.cpp +++ b/xpfe/components/regviewer/nsRegistryDataSource.cpp @@ -849,4 +849,4 @@ static nsModuleComponentInfo components[] = { }, }; -NS_IMPL_NSGETMODULE("nsRegistryViewerModule", components) +NS_IMPL_NSGETMODULE(nsRegistryViewerModule, components) diff --git a/xpfe/components/search/src/nsRegisterSearch.cpp b/xpfe/components/search/src/nsRegisterSearch.cpp index 49c78a6cdb1..2a71e33d4f9 100755 --- a/xpfe/components/search/src/nsRegisterSearch.cpp +++ b/xpfe/components/search/src/nsRegisterSearch.cpp @@ -49,5 +49,5 @@ static nsModuleComponentInfo components[] = }, }; -NS_IMPL_NSGETMODULE("nsSearchModule", components) +NS_IMPL_NSGETMODULE(nsSearchModule, components) diff --git a/xpfe/components/shistory/src/nsSHistoryModule.cpp b/xpfe/components/shistory/src/nsSHistoryModule.cpp index 0a7ba6cda10..9ace8d21c5b 100644 --- a/xpfe/components/shistory/src/nsSHistoryModule.cpp +++ b/xpfe/components/shistory/src/nsSHistoryModule.cpp @@ -56,4 +56,4 @@ static nsModuleComponentInfo gSHistoryModuleInfo[] = NS_SHISTORY_INTERNAL_CONTRACTID, nsSHistoryConstructor } }; -NS_IMPL_NSGETMODULE("Session History Module", gSHistoryModuleInfo) +NS_IMPL_NSGETMODULE(Session_History_Module, gSHistoryModuleInfo) diff --git a/xpfe/components/ucth/src/nsUnknownContentTypeHandler.cpp b/xpfe/components/ucth/src/nsUnknownContentTypeHandler.cpp index 4a74dcd5b53..36f0fcbc1f7 100644 --- a/xpfe/components/ucth/src/nsUnknownContentTypeHandler.cpp +++ b/xpfe/components/ucth/src/nsUnknownContentTypeHandler.cpp @@ -328,7 +328,7 @@ static nsModuleComponentInfo components[] = { nsUnknownContentTypeHandlerConstructor }, }; -NS_IMPL_NSGETMODULE( "nsUnknownContentTypeHandler", components ) +NS_IMPL_NSGETMODULE(nsUnknownContentTypeHandler, components ) /* nsISupports Implementation for the class */ NS_IMPL_ISUPPORTS2(nsUnknownContentTypeHandler, diff --git a/xpfe/components/urlbarhistory/src/nsUBHistoryModule.cpp b/xpfe/components/urlbarhistory/src/nsUBHistoryModule.cpp index 01a06429361..9d4cc83ac4a 100644 --- a/xpfe/components/urlbarhistory/src/nsUBHistoryModule.cpp +++ b/xpfe/components/urlbarhistory/src/nsUBHistoryModule.cpp @@ -43,4 +43,4 @@ static nsModuleComponentInfo gUBHistoryModuleInfo[] = NS_URLBARAUTOCOMPLETE_CONTRACTID, nsUrlbarHistoryConstructor } }; -NS_IMPL_NSGETMODULE("Urlbar History Module", gUBHistoryModuleInfo) +NS_IMPL_NSGETMODULE(Urlbar_History_Module, gUBHistoryModuleInfo) diff --git a/xpfe/components/xfer/src/nsStreamTransfer.cpp b/xpfe/components/xfer/src/nsStreamTransfer.cpp index 366fc1bf463..52e9bd61e0a 100644 --- a/xpfe/components/xfer/src/nsStreamTransfer.cpp +++ b/xpfe/components/xfer/src/nsStreamTransfer.cpp @@ -365,5 +365,5 @@ static nsModuleComponentInfo components[] = { }; -NS_IMPL_NSGETMODULE("Stream Transfer", components); +NS_IMPL_NSGETMODULE(nsStreamTransferModule, components); diff --git a/xpinstall/src/nsSoftwareUpdate.cpp b/xpinstall/src/nsSoftwareUpdate.cpp index 248c89336f3..2ea56410ed5 100644 --- a/xpinstall/src/nsSoftwareUpdate.cpp +++ b/xpinstall/src/nsSoftwareUpdate.cpp @@ -721,5 +721,5 @@ static nsModuleComponentInfo components[] = -NS_IMPL_NSGETMODULE("nsSoftwareUpdate", components) +NS_IMPL_NSGETMODULE(nsSoftwareUpdate, components)