nsRepository -> nsIComponentManager changes.

This commit is contained in:
warren%netscape.com 1999-03-09 09:44:27 +00:00
Родитель 58164daf67
Коммит 4b2d56fbaa
278 изменённых файлов: 7360 добавлений и 5853 удалений

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

@ -303,7 +303,7 @@ class NS_BASE nsFileSpec
relativePath(inRelativePath);
return *this + relativePath;
}
void operator += (const char* inRelativePath);
void operator += (const char* inRelativePath);
// Concatenate the relative path to this directory.
// Used for constructing the filespec of a descendant.
// This must be a directory for this to work. This differs
@ -312,7 +312,7 @@ class NS_BASE nsFileSpec
// away its leaf information, whereas this one assumes
// this is a directory, and the relative path starts
// "below" this.
void operator += (const nsString& inRelativePath)
void operator += (const nsString& inRelativePath)
{
const nsAutoCString relativePath(inRelativePath);
*this += relativePath;

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

@ -20,7 +20,10 @@
#include "nscore.h"
#include "nsIProperties.h"
#include "nsProperties.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
PRInt32 gLockCount = 0;
@ -29,28 +32,26 @@ NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
extern "C" NS_EXPORT nsresult
NSRegisterSelf(nsISupports* aServMgr, const char* path)
{
nsresult ret;
nsresult rv;
ret = nsRepository::RegisterComponent(kPropertiesCID, NULL, NULL,
path, PR_TRUE, PR_TRUE);
if (NS_FAILED(ret)) {
return ret;
}
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
return ret;
rv = compMgr->RegisterComponent(kPropertiesCID, NULL, NULL,
path, PR_TRUE, PR_TRUE);
return rv;
}
extern "C" NS_EXPORT nsresult
NSUnregisterSelf(nsISupports* aServMgr, const char* path)
{
nsresult ret;
nsresult rv;
ret = nsRepository::UnregisterFactory(kPropertiesCID, path);
if (NS_FAILED(ret)) {
return ret;
}
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
return ret;
rv = compMgr->UnregisterFactory(kPropertiesCID, path);
return rv;
}
extern "C" NS_EXPORT nsresult

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

@ -24,7 +24,7 @@
#include "nsIProperties.h"
#include "nsIServiceManager.h"
#include "nsIURL.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#ifdef XP_PC
#include "plevent.h"
#endif
@ -60,9 +60,9 @@ extern "C" void NS_SetupRegistry();
int
main(int argc, char *argv[])
{
nsRepository::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL,
nsComponentManager::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL,
PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL,
nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL,
PR_FALSE, PR_FALSE);
#ifdef XP_MAC // have not build this on PC and UNIX yet so make it #ifdef XP_MAC
NS_SetupRegistry();
@ -102,7 +102,7 @@ main(int argc, char *argv[])
return 1;
}
nsIProperties *props = nsnull;
ret = nsRepository::CreateInstance(kPropertiesCID, NULL,
ret = nsComponentManager::CreateInstance(kPropertiesCID, NULL,
kIPropertiesIID, (void**) &props);
if (NS_FAILED(ret)) {
printf("create nsIProperties failed\n");

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

@ -15,7 +15,7 @@
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsCapsEnums.h"
#include "nsCCapsManager.h"
#include "nsICodebasePrincipal.h"

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

@ -22,7 +22,7 @@
#include "nsCCapsManager.h"
#include "nsCCapsManagerFactory.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
@ -137,7 +137,7 @@ nsCCapsManagerFactory::nsCCapsManagerFactory(void)
if ( (err == NS_OK) && (m_pNSIFactory != NULL) )
{
NS_DEFINE_CID(kCCapsManagerCID, NS_CCAPSMANAGER_CID);
nsRepository::RegisterFactory(kCCapsManagerCID, 0, 0,
nsComponentManager::RegisterFactory(kCCapsManagerCID, 0, 0,
m_pNSIFactory, PR_FALSE);
}
}
@ -147,7 +147,7 @@ nsCCapsManagerFactory::~nsCCapsManagerFactory()
if(mRefCnt == 0)
{
NS_DEFINE_CID(kCCapsManagerCID, NS_CCAPSMANAGER_CID);
nsRepository::UnregisterFactory(kCCapsManagerCID, (nsIFactory *)m_pNSIFactory);
nsComponentManager::UnregisterFactory(kCCapsManagerCID, (nsIFactory *)m_pNSIFactory);
}
}

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

@ -471,6 +471,11 @@ unmangle:: $(DIRS)
-$(MAKE_UNMANGLE)
alltags::
echo Making emacs tags
c:\\mksnt\\find . -name dist -prune -o ( -name '*.[hc]' -o -name '*.cpp' ) -print | c:\\mksnt\\xargs etags -a
#//------------------------------------------------------------------------
#//
#// Rule to create the object directory (if necessary)
@ -628,3 +633,4 @@ CFLAGS = $(CFLAGS) -DNO_JNI_STUBS
!endif
!endif # CONFIG_RULES_MAK

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

@ -45,7 +45,7 @@
#include "nsIDOMHTMLOptionElement.h"
#include "nsIFormControl.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIScrollableView.h"
#include "nsHTMLAtoms.h"

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

@ -46,7 +46,7 @@
#include "nsINetService.h"
#include "nsIServiceManager.h"
#include "nsIFormManager.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsParserCIID.h"
#include "nsIDOMHTMLElement.h"
#include "nsIDOMHTMLMapElement.h"
@ -334,7 +334,7 @@ nsHTMLDocument::StartDocumentLoad(nsIURL *aURL,
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
if (rv == NS_OK)
rv = nsRepository::CreateInstance(kCParserCID,
rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&mParser);
@ -1244,7 +1244,7 @@ nsHTMLDocument::Open(JSContext *cx, jsval *argv, PRUint32 argc)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
result = nsRepository::CreateInstance(kCParserCID,
result = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&mParser);

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

@ -953,7 +953,7 @@ nsXMLContentSink::LoadXSLStyleSheet(const nsIURL* aUrl)
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
// Create the XML parser
rv = nsRepository::CreateInstance(kCParserCID,
rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);

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

@ -34,7 +34,7 @@
#include "nsIHTMLStyleSheet.h"
#include "nsIHTMLCSSStyleSheet.h"
#include "nsIStyleSet.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIDOMComment.h"
#include "nsIDOMElement.h"
#include "nsIDOMText.h"
@ -279,7 +279,7 @@ nsXMLDocument::StartDocumentLoad(nsIURL *aUrl,
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
rv = nsRepository::CreateInstance(kCParserCID,
rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&mParser);

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

@ -86,6 +86,7 @@
#include "nsIStyleRule.h"
#include "nsIURL.h"
#include "rdfutil.h"
#include "prlog.h"
// The XUL interfaces implemented by the RDF content node.
#include "nsIDOMXULElement.h"
@ -344,7 +345,7 @@ RDFElementImpl::RDFElementImpl(PRInt32 aNameSpaceID, nsIAtom* aTag)
kStyleAtom = NS_NewAtom("style");
kContainerAtom = NS_NewAtom("container");
rv = nsRepository::CreateInstance(kNameSpaceManagerCID,
rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,
nsnull,
kINameSpaceManagerIID,
(void**) &gNameSpaceManager);
@ -1008,7 +1009,7 @@ RDFElementImpl::GetListenerManager(nsIEventListenerManager** aResult)
*aResult = mListenerManager;
return NS_OK;
}
nsresult rv = nsRepository::CreateInstance(kEventListenerManagerCID,
nsresult rv = nsComponentManager::CreateInstance(kEventListenerManagerCID,
nsnull,
kIEventListenerManagerIID,
(void**) aResult);
@ -1022,7 +1023,7 @@ RDFElementImpl::GetListenerManager(nsIEventListenerManager** aResult)
NS_IMETHODIMP
RDFElementImpl::GetNewListenerManager(nsIEventListenerManager **aResult)
{
return nsRepository::CreateInstance(kEventListenerManagerCID,
return nsComponentManager::CreateInstance(kEventListenerManagerCID,
nsnull,
kIEventListenerManagerIID,
(void**) aResult);

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

@ -81,10 +81,11 @@
#include "plhash.h"
#include "plstr.h"
#include "rdfutil.h"
#include "prlog.h"
#include "nsILineBreakerFactory.h"
#include "nsLWBrkCIID.h"
////////////////////////////////////////////////////////////////////////
static NS_DEFINE_IID(kICSSParserIID, NS_ICSS_PARSER_IID); // XXX grr..
@ -640,7 +641,7 @@ XULDocumentImpl::XULDocumentImpl(void)
nsresult rv;
// construct a selection object
if (NS_FAILED(rv = nsRepository::CreateInstance(kRangeListCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRangeListCID,
nsnull,
kIDOMSelectionIID,
(void**) &mSelection))) {
@ -803,7 +804,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
// Create an HTML style sheet for the HTML content.
nsIHTMLStyleSheet* sheet;
if (NS_SUCCEEDED(rv = nsRepository::CreateInstance(kHTMLStyleSheetCID,
if (NS_SUCCEEDED(rv = nsComponentManager::CreateInstance(kHTMLStyleSheetCID,
nsnull,
kIHTMLStyleSheetIID,
(void**) &sheet))) {
@ -824,7 +825,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
// Create an inline style sheet for inline content that contains a style
// attribute.
nsIHTMLCSSStyleSheet* inlineSheet;
if (NS_SUCCEEDED(rv = nsRepository::CreateInstance(kHTMLCSSStyleSheetCID,
if (NS_SUCCEEDED(rv = nsComponentManager::CreateInstance(kHTMLCSSStyleSheetCID,
nsnull,
kIHTMLCSSStyleSheetIID,
(void**) &inlineSheet))) {
@ -845,7 +846,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
// Create a composite data source that'll tie together local and
// remote stores.
nsIRDFCompositeDataSource* db;
if (NS_FAILED(rv = nsRepository::CreateInstance(kRDFCompositeDataSourceCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFCompositeDataSourceCID,
nsnull,
kIRDFCompositeDataSourceIID,
(void**) &db))) {
@ -855,7 +856,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
// Create a XUL content model builder
NS_IF_RELEASE(mXULBuilder);
if (NS_FAILED(rv = nsRepository::CreateInstance(kRDFXULBuilderCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFXULBuilderCID,
nsnull,
kIRDFContentModelBuilderIID,
(void**) &mXULBuilder))) {
@ -881,7 +882,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
// XXX This needs to be cloned across windows, and the final
// instance needs to be flushed to disk. It may be that this is
// really an RDFXML data source...
if (NS_FAILED(rv = nsRepository::CreateInstance(kRDFInMemoryDataSourceCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFInMemoryDataSourceCID,
nsnull,
kIRDFDataSourceIID,
(void**) &mLocalDataSource))) {
@ -909,7 +910,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
// meantime, add us as an nsIRDFXMLDataSourceObserver so that
// we'll be notified when we need to load style sheets, etc.
NS_IF_RELEASE(mDocumentDataSource);
if (NS_FAILED(rv = nsRepository::CreateInstance(kRDFInMemoryDataSourceCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFInMemoryDataSourceCID,
nsnull,
kIRDFDataSourceIID,
(void**) &mDocumentDataSource))) {
@ -928,7 +929,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
}
nsCOMPtr<nsIXULContentSink> sink;
if (NS_FAILED(rv = nsRepository::CreateInstance(kXULContentSinkCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kXULContentSinkCID,
nsnull,
kIXULContentSinkIID,
(void**) getter_AddRefs(sink)))) {
@ -946,7 +947,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
}
}
if (NS_FAILED(rv = nsRepository::CreateInstance(kParserCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kParserCID,
nsnull,
kIParserIID,
(void**) &mParser))) {
@ -960,7 +961,7 @@ XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
}
nsCOMPtr<nsIDTD> dtd;
if (NS_FAILED(rv = nsRepository::CreateInstance(kWellFormedDTDCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kWellFormedDTDCID,
nsnull,
kIDTDIID,
(void**) getter_AddRefs(dtd)))) {
@ -1078,7 +1079,7 @@ XULDocumentImpl::CreateShell(nsIPresContext* aContext,
nsresult rv;
nsIPresShell* shell;
if (NS_FAILED(rv = nsRepository::CreateInstance(kPresShellCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kPresShellCID,
nsnull,
kIPresShellIID,
(void**) &shell)))
@ -2821,7 +2822,7 @@ XULDocumentImpl::LoadCSSStyleSheet(nsIURL* url)
}
nsICSSParser* parser;
rv = nsRepository::CreateInstance(kCSSParserCID,
rv = nsComponentManager::CreateInstance(kCSSParserCID,
nsnull,
kICSSParserIID,
(void**) &parser);
@ -2887,7 +2888,7 @@ XULDocumentImpl::Init(void)
return rv;
// Create a namespace manager so we can manage tags
if (NS_FAILED(rv = nsRepository::CreateInstance(kNameSpaceManagerCID,
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,
nsnull,
kINameSpaceManagerIID,
(void**) &mNameSpaceManager)))

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

@ -217,7 +217,7 @@ XULSortServiceImpl::XULSortServiceImpl(void)
// Register the XUL and RDF namespaces: these'll just retrieve
// the IDs if they've already been registered by someone else.
nsINameSpaceManager* mgr;
if (NS_SUCCEEDED(rv = nsRepository::CreateInstance(kNameSpaceManagerCID,
if (NS_SUCCEEDED(rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,
nsnull,
kINameSpaceManagerIID,
(void**) &mgr)))

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

@ -160,7 +160,7 @@ RDFGenericBuilderImpl::RDFGenericBuilderImpl(void)
// Register the XUL and RDF namespaces: these'll just retrieve
// the IDs if they've already been registered by someone else.
if (NS_SUCCEEDED(rv = nsRepository::CreateInstance(kNameSpaceManagerCID,
if (NS_SUCCEEDED(rv = nsComponentManager::CreateInstance(kNameSpaceManagerCID,
nsnull,
kINameSpaceManagerIID,
(void**) &gNameSpaceManager))) {

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

@ -30,7 +30,7 @@
#include "nsIDocumentLoaderObserver.h"
#include "nsDOMEvent.h"
#include "nsIPresContext.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
#include "nsXPComCIID.h"
@ -771,7 +771,7 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
mDocLoader->AddObserver((nsIDocumentLoaderObserver*)this);
// Create device context
rv = nsRepository::CreateInstance(kDeviceContextCID, nsnull,
rv = nsComponentManager::CreateInstance(kDeviceContextCID, nsnull,
kIDeviceContextIID,
(void **)&mDeviceContext);
if (NS_FAILED(rv)) {
@ -788,7 +788,7 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
mDeviceContext->SetGamma(1.0f);
// Create a Native window for the shell container...
rv = nsRepository::CreateInstance(kChildCID, nsnull, kIWidgetIID, (void**)&mWindow);
rv = nsComponentManager::CreateInstance(kChildCID, nsnull, kIWidgetIID, (void**)&mWindow);
if (NS_FAILED(rv)) {
goto done;
}

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

@ -21,7 +21,7 @@
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#define NS_DOM_SCRIPT_OBJECT_FACTORY_CID \
{ /* 9eb760f0-4380-11d2-b328-00805f8a3859 */ \

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

@ -32,7 +32,7 @@
#include "nsIScriptGlobalObject.h"
#include "nsString.h"
#include "nsIScriptNameSpaceManager.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIJSScriptObjectIID, NS_IJSSCRIPTOBJECT_IID);
@ -78,7 +78,7 @@ nsJSUtils::nsLookupGlobalName(nsISupports* aSupports,
result = manager->LookupName(name, PR_FALSE, classID);
NS_RELEASE(manager);
if (NS_OK == result) {
result = nsRepository::CreateInstance(classID,
result = nsComponentManager::CreateInstance(classID,
nsnull,
kISupportsIID,
(void **)&native);
@ -284,7 +284,7 @@ nsJSUtils::nsGlobalResolve(JSContext* aContext,
result = manager->LookupName(name, PR_FALSE, classID);
NS_RELEASE(manager);
if (NS_OK == result) {
result = nsRepository::CreateInstance(classID,
result = nsComponentManager::CreateInstance(classID,
nsnull,
kISupportsIID,
(void **)&native);

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

@ -29,7 +29,7 @@
#include "nsIDOMImage.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsIScriptNameSpaceManager.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsDOMCID.h"
@ -483,7 +483,7 @@ HTMLImageElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
return JS_FALSE;
}
result = nsRepository::CreateInstance(classID,
result = nsComponentManager::CreateInstance(classID,
nsnull,
kIDOMHTMLImageElementIID,
(void **)&nativeThis);

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

@ -99,7 +99,7 @@ static const char *kIncludeDefaultsStr = "\n"
static const char *kIncludeStr = "#include \"nsIDOM%s.h\"\n";
static const char *kIncludeConstructorStr =
"#include \"nsIScriptNameSpaceManager.h\"\n"
"#include \"nsRepository.h\"\n"
"#include \"nsComponentManager.h\"\n"
"#include \"nsDOMCID.h\"\n";
static PRIntn
@ -1269,7 +1269,7 @@ static const char *kConstructorBeginStr =
" return JS_FALSE;\n"
" }\n"
"\n"
" result = nsRepository::CreateInstance(classID,\n"
" result = nsComponentManager::CreateInstance(classID,\n"
" nsnull,\n"
" kIDOM%sIID,\n"
" (void **)&nativeThis);\n"

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

@ -20,7 +20,7 @@
#include "nsIEditor.h"
#include "nsEditor.h"
#include "nsEditorCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
@ -119,7 +119,7 @@ nsEditFactory::nsEditFactory(const nsCID &aClass)
nsEditFactory::~nsEditFactory()
{
//nsRepository::UnregisterFactory(mCID, (nsIFactory *)this); //we are out of ref counts anyway
//nsComponentManager::UnregisterFactory(mCID, (nsIFactory *)this); //we are out of ref counts anyway
}

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

@ -90,6 +90,8 @@ static NS_DEFINE_IID(kChangeAttributeTxnIID,CHANGE_ATTRIBUTE_TXN_IID);
static NS_DEFINE_IID(kSplitElementTxnIID, SPLIT_ELEMENT_TXN_IID);
static NS_DEFINE_IID(kJoinElementTxnIID, JOIN_ELEMENT_TXN_IID);
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
#ifdef XP_PC
#define TRANSACTION_MANAGER_DLL "txmgr.dll"
#else
@ -128,12 +130,13 @@ PRMonitor *getEditorMonitor() //if more than one person asks for the monitor at
return ns_editlock;
}
nsIComponentManager* gCompMgr = NULL;
/*
we must be good providers of factories ect. this is where to put ALL editor exports
*/
//BEGIN EXPORTS
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports * aServiceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports * aServMgr,
const nsCID & aClass,
const char *aClassName,
const char *aProgID,
@ -145,6 +148,9 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports * aServiceMgr,
*aFactory = nsnull;
nsresult rv = aServMgr->QueryInterface(nsIComponentManager::IID(), (void**)&gCompMgr);
if (NS_FAILED(rv)) return rv;
if (aClass.Equals(kEditorCID)) {
return GetEditFactory(aFactory, aClass);
}
@ -160,7 +166,7 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports * aServiceMgr,
extern "C" NS_EXPORT PRBool
NSCanUnload(nsISupports* serviceMgr)
NSCanUnload(nsISupports* aServMgr)
{
return nsEditor::gInstanceCount; //I have no idea. I am copying code here
}
@ -168,40 +174,33 @@ NSCanUnload(nsISupports* serviceMgr)
extern "C" NS_EXPORT nsresult
NSRegisterSelf(nsISupports* serviceMgr, const char *path)
NSRegisterSelf(nsISupports* aServMgr, const char *path)
{
nsresult result = NS_ERROR_UNEXPECTED;
//this will register the editor classes with the xpcom dll.
result = nsRepository::RegisterComponent(kEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_SUCCEEDED(result))
{
result = nsRepository::RegisterComponent(kTextEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_SUCCEEDED(result))
{
result = nsRepository::RegisterComponent(kHTMLEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
}
}
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = compMgr->RegisterComponent(kEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) return rv;
rv = compMgr->RegisterComponent(kTextEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) return rv;
rv = compMgr->RegisterComponent(kHTMLEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
return result;
}
extern "C" NS_EXPORT nsresult
NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
NSUnregisterSelf(nsISupports* aServMgr, const char *path)
{
nsresult result = NS_ERROR_UNEXPECTED;
result = nsRepository::UnregisterFactory(kIEditFactoryIID, path);
if (NS_SUCCEEDED(result))
{
result = nsRepository::UnregisterFactory(kITextEditFactoryIID, path);
if (NS_SUCCEEDED(result))
{
result = nsRepository::UnregisterFactory(kIHTMLEditFactoryIID, path);
}
}
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kIEditFactoryIID, path);
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kITextEditFactoryIID, path);
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kIHTMLEditFactoryIID, path);
return result;
}
@ -333,16 +332,16 @@ nsEditor::EnableUndo(PRBool aEnable)
nsresult result=NS_OK;
/** -- temp code until the txn mgr auto-registers -- **/
nsRepository::RegisterComponent(kCTransactionManagerFactoryCID, NULL, NULL,
TRANSACTION_MANAGER_DLL, PR_FALSE, PR_FALSE);
gCompMgr->RegisterComponent(kCTransactionManagerFactoryCID, NULL, NULL,
TRANSACTION_MANAGER_DLL, PR_FALSE, PR_FALSE);
/** -- end temp code -- **/
if (PR_TRUE==aEnable)
{
if (!mTxnMgr)
{
result = nsRepository::CreateInstance(kCTransactionManagerFactoryCID,
nsnull,
kITransactionManagerIID, (void **)&txnMgr);
result = gCompMgr->CreateInstance(kCTransactionManagerFactoryCID,
nsnull,
kITransactionManagerIID, (void **)&txnMgr);
if (NS_FAILED(result) || !txnMgr) {
printf("ERROR: Failed to get TransactionManager instance.\n");
return NS_ERROR_NOT_AVAILABLE;

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

@ -28,7 +28,7 @@
#include "nsCOMPtr.h"
#include "nsITransactionManager.h"
#include "TransactionFactory.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
class nsIDOMCharacterData;
class nsIDOMRange;

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

@ -21,7 +21,7 @@
#include "nsHTMLEditor.h"
#include "nsEditor.h"
#include "nsEditorCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
@ -121,7 +121,7 @@ nsHTMLEditFactory::nsHTMLEditFactory(const nsCID &aClass)
nsHTMLEditFactory::~nsHTMLEditFactory()
{
//nsRepository::UnregisterFactory(mCID, (nsIFactory *)this); //we are out of ref counts anyway
//nsComponentManager::UnregisterFactory(mCID, (nsIFactory *)this); //we are out of ref counts anyway
}

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

@ -25,7 +25,7 @@
#include "nsIDOMMouseListener.h"
#include "nsEditorCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsITableCellLayout.h" //For GetColIndexForCell

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

@ -21,7 +21,7 @@
#include "nsTextEditor.h"
#include "nsEditor.h"
#include "nsEditorCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
@ -123,5 +123,5 @@ nsTextEditFactory::nsTextEditFactory(const nsCID &aClass)
nsTextEditFactory::~nsTextEditFactory()
{
//nsRepository::UnregisterFactory(mCID, (nsIFactory *)this); //we are out of ref counts anyway
//nsComponentManager::UnregisterFactory(mCID, (nsIFactory *)this); //we are out of ref counts anyway
}

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

@ -66,7 +66,7 @@ class nsIFrame;
#include "CreateElementTxn.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
static NS_DEFINE_IID(kIDOMEventReceiverIID, NS_IDOMEVENTRECEIVER_IID);
@ -289,7 +289,7 @@ NS_IMETHODIMP nsTextEditor::GetTextProperty(nsIAtom *aProperty, PRBool &aAny, PR
{
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
nsCOMPtr<nsIContentIterator> iter;
result = nsRepository::CreateInstance(kCContentIteratorCID, nsnull,
result = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
kIContentIteratorIID,
getter_AddRefs(iter));
if ((NS_SUCCEEDED(result)) && iter)
@ -538,7 +538,7 @@ NS_IMETHODIMP nsTextEditor::OutputText(nsString& aOutputString)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
rv = nsRepository::CreateInstance(kCParserCID,
rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);
@ -606,7 +606,7 @@ NS_IMETHODIMP nsTextEditor::OutputHTML(nsString& aOutputString)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
rv = nsRepository::CreateInstance(kCParserCID,
rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);
@ -834,7 +834,7 @@ nsTextEditor::SetTextPropertiesForNodeWithDifferentParents(nsIDOMRange *aRange,
// create style nodes for all the content between the start and end nodes
nsCOMPtr<nsIContentIterator>iter;
result = nsRepository::CreateInstance(kCContentIteratorCID, nsnull,
result = nsComponentManager::CreateInstance(kCContentIteratorCID, nsnull,
kIContentIteratorIID, getter_AddRefs(iter));
if ((NS_SUCCEEDED(result)) && iter)
{

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

@ -20,7 +20,7 @@
#include "nsEditGuiManager.h"
#include "nsGuiManagerFactory.h"
#include "nsIEditor.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsCOMPtr.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
@ -119,7 +119,7 @@ nsGuiManagerFactory::nsGuiManagerFactory(nsIFactory **aFactory)
nsGuiManagerFactory::~nsGuiManagerFactory()
{
nsRepository::UnregisterFactory(kIGuiManagerFactoryIID, (nsIFactory *)this); //we are out of ref counts anyway
nsComponentManager::UnregisterFactory(kIGuiManagerFactoryIID, (nsIFactory *)this); //we are out of ref counts anyway
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char *path)

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

@ -90,6 +90,8 @@ static NS_DEFINE_IID(kChangeAttributeTxnIID,CHANGE_ATTRIBUTE_TXN_IID);
static NS_DEFINE_IID(kSplitElementTxnIID, SPLIT_ELEMENT_TXN_IID);
static NS_DEFINE_IID(kJoinElementTxnIID, JOIN_ELEMENT_TXN_IID);
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
#ifdef XP_PC
#define TRANSACTION_MANAGER_DLL "txmgr.dll"
#else
@ -128,12 +130,13 @@ PRMonitor *getEditorMonitor() //if more than one person asks for the monitor at
return ns_editlock;
}
nsIComponentManager* gCompMgr = NULL;
/*
we must be good providers of factories ect. this is where to put ALL editor exports
*/
//BEGIN EXPORTS
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports * aServiceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports * aServMgr,
const nsCID & aClass,
const char *aClassName,
const char *aProgID,
@ -145,6 +148,9 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports * aServiceMgr,
*aFactory = nsnull;
nsresult rv = aServMgr->QueryInterface(nsIComponentManager::IID(), (void**)&gCompMgr);
if (NS_FAILED(rv)) return rv;
if (aClass.Equals(kEditorCID)) {
return GetEditFactory(aFactory, aClass);
}
@ -160,7 +166,7 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports * aServiceMgr,
extern "C" NS_EXPORT PRBool
NSCanUnload(nsISupports* serviceMgr)
NSCanUnload(nsISupports* aServMgr)
{
return nsEditor::gInstanceCount; //I have no idea. I am copying code here
}
@ -168,40 +174,33 @@ NSCanUnload(nsISupports* serviceMgr)
extern "C" NS_EXPORT nsresult
NSRegisterSelf(nsISupports* serviceMgr, const char *path)
NSRegisterSelf(nsISupports* aServMgr, const char *path)
{
nsresult result = NS_ERROR_UNEXPECTED;
//this will register the editor classes with the xpcom dll.
result = nsRepository::RegisterComponent(kEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_SUCCEEDED(result))
{
result = nsRepository::RegisterComponent(kTextEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_SUCCEEDED(result))
{
result = nsRepository::RegisterComponent(kHTMLEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
}
}
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = compMgr->RegisterComponent(kEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) return rv;
rv = compMgr->RegisterComponent(kTextEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) return rv;
rv = compMgr->RegisterComponent(kHTMLEditorCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
return result;
}
extern "C" NS_EXPORT nsresult
NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
NSUnregisterSelf(nsISupports* aServMgr, const char *path)
{
nsresult result = NS_ERROR_UNEXPECTED;
result = nsRepository::UnregisterFactory(kIEditFactoryIID, path);
if (NS_SUCCEEDED(result))
{
result = nsRepository::UnregisterFactory(kITextEditFactoryIID, path);
if (NS_SUCCEEDED(result))
{
result = nsRepository::UnregisterFactory(kIHTMLEditFactoryIID, path);
}
}
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kIEditFactoryIID, path);
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kITextEditFactoryIID, path);
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kIHTMLEditFactoryIID, path);
return result;
}
@ -333,16 +332,16 @@ nsEditor::EnableUndo(PRBool aEnable)
nsresult result=NS_OK;
/** -- temp code until the txn mgr auto-registers -- **/
nsRepository::RegisterComponent(kCTransactionManagerFactoryCID, NULL, NULL,
TRANSACTION_MANAGER_DLL, PR_FALSE, PR_FALSE);
gCompMgr->RegisterComponent(kCTransactionManagerFactoryCID, NULL, NULL,
TRANSACTION_MANAGER_DLL, PR_FALSE, PR_FALSE);
/** -- end temp code -- **/
if (PR_TRUE==aEnable)
{
if (!mTxnMgr)
{
result = nsRepository::CreateInstance(kCTransactionManagerFactoryCID,
nsnull,
kITransactionManagerIID, (void **)&txnMgr);
result = gCompMgr->CreateInstance(kCTransactionManagerFactoryCID,
nsnull,
kITransactionManagerIID, (void **)&txnMgr);
if (NS_FAILED(result) || !txnMgr) {
printf("ERROR: Failed to get TransactionManager instance.\n");
return NS_ERROR_NOT_AVAILABLE;

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

@ -28,7 +28,7 @@
#include "nsCOMPtr.h"
#include "nsITransactionManager.h"
#include "TransactionFactory.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
class nsIDOMCharacterData;
class nsIDOMRange;

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

@ -25,7 +25,7 @@
#include "nsIDOMMouseListener.h"
#include "nsEditorCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsITableCellLayout.h" //For GetColIndexForCell

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

@ -19,7 +19,8 @@
#include "nscore.h"
#include "nsIFactory.h"
#include "nsISupports.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsTransactionManagerCID.h"
#include "nsTransactionManager.h"
@ -27,6 +28,7 @@
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
static NS_DEFINE_CID(kCTransactionManagerFactoryCID, NS_TRANSACTION_MANAGER_FACTORY_CID);
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
class nsTransactionManagerFactory : public nsIFactory
{
@ -113,7 +115,7 @@ nsresult nsTransactionManagerFactory::LockFactory(PRBool aLock)
}
// return the proper factory to the caller
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,
@ -132,15 +134,25 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return (*aFactory)->QueryInterface(kIFactoryIID, (void**)aFactory);
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char *path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *path)
{
return nsRepository::RegisterComponent(kCTransactionManagerFactoryCID,
NULL, NULL, path,
PR_TRUE, PR_TRUE);
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
return compMgr->RegisterComponent(kCTransactionManagerFactoryCID,
NULL, NULL, path,
PR_TRUE, PR_TRUE);
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char *path)
{
return nsRepository::UnregisterFactory(kCTransactionManagerFactoryCID, path);
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
return compMgr->UnregisterFactory(kCTransactionManagerFactoryCID, path);
}

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

@ -19,7 +19,7 @@
#include <stdlib.h>
#include "nsITransactionManager.h"
#include "nsTransactionManagerCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
static PRInt32 sConstructorCount = 0;
static PRInt32 sDestructorCount = 0;
@ -865,7 +865,7 @@ quick_test(TestTransactionFactory *factory)
nsITransaction *r1 = 0, *r2 = 0;
nsresult result;
result = nsRepository::CreateInstance(kCTransactionManagerFactoryCID, nsnull,
result = nsComponentManager::CreateInstance(kCTransactionManagerFactoryCID, nsnull,
kITransactionManagerIID, (void **)&mgr);
if (NS_FAILED(result) || !mgr) {
@ -2734,7 +2734,7 @@ quick_batch_test(TestTransactionFactory *factory)
nsITransaction *r1 = 0, *r2 = 0;
nsresult result;
result = nsRepository::CreateInstance(kCTransactionManagerFactoryCID, nsnull,
result = nsComponentManager::CreateInstance(kCTransactionManagerFactoryCID, nsnull,
kITransactionManagerIID, (void **)&mgr);
if (NS_FAILED(result) || !mgr) {
@ -4348,7 +4348,7 @@ stress_test(TestTransactionFactory *factory, PRInt32 iterations)
nsITransaction *tx = 0;
nsresult result;
result = nsRepository::CreateInstance(kCTransactionManagerFactoryCID, nsnull,
result = nsComponentManager::CreateInstance(kCTransactionManagerFactoryCID, nsnull,
kITransactionManagerIID, (void **)&mgr);
if (NS_FAILED(result) || !mgr) {
@ -4542,7 +4542,7 @@ main (int argc, char *argv[])
{
nsresult result;
nsRepository::RegisterComponent(kCTransactionManagerFactoryCID, NULL, NULL,
nsComponentManager::RegisterComponent(kCTransactionManagerFactoryCID, NULL, NULL,
TRANSACTION_MANAGER_DLL, PR_FALSE, PR_FALSE);
result = simple_test();

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

@ -21,7 +21,7 @@
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#define NS_IMAGE_CID \
{ 0x6049b260, 0xc1e6, 0x11d1, \

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

@ -65,7 +65,7 @@ NS_IMETHODIMP nsDeviceContextSpecFactoryGTK :: CreateDeviceContextSpec(nsIDevice
nsresult rv = NS_ERROR_FAILURE;
nsIDeviceContextSpec *devSpec = nsnull;
nsRepository::CreateInstance(kDeviceContextSpecCID, nsnull, kIDeviceContextSpecIID, (void **)&devSpec);
nsComponentManager::CreateInstance(kDeviceContextSpecCID, nsnull, kIDeviceContextSpecIID, (void **)&devSpec);
if (nsnull != devSpec){
if (NS_OK == ((nsDeviceContextSpecGTK *)devSpec)->Init(aQuiet)){

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

@ -65,7 +65,7 @@ NS_IMETHODIMP nsDeviceContextSpecFactoryMac :: CreateDeviceContextSpec(nsIDevice
nsresult rv = NS_ERROR_FAILURE;
nsIDeviceContextSpec *devSpec = nsnull;
nsRepository::CreateInstance(kDeviceContextSpecCID, nsnull, kIDeviceContextSpecIID, (void **)&devSpec);
nsComponentManager::CreateInstance(kDeviceContextSpecCID, nsnull, kIDeviceContextSpecIID, (void **)&devSpec);
if (nsnull != devSpec){
if (NS_OK == ((nsDeviceContextSpecMac *)devSpec)->Init(aQuiet)){

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

@ -530,7 +530,7 @@ NS_IMETHODIMP nsRenderingContextMotif :: GetClipRegion(nsIRegion **aRegion)
static NS_DEFINE_IID(kCRegionCID, NS_REGION_CID);
static NS_DEFINE_IID(kIRegionIID, NS_IREGION_IID);
nsresult rv = nsRepository::CreateInstance(kCRegionCID,
nsresult rv = nsComponentManager::CreateInstance(kCRegionCID,
nsnull,
kIRegionIID,
(void **)aRegion);

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

@ -26,6 +26,7 @@
#include "il_util.h"
#include "nsVoidArray.h"
#include "nsIFontMetrics.h"
#include "nsHashtable.h"
class nsFontCache
{
@ -180,7 +181,7 @@ NS_IMETHODIMP DeviceContextImpl :: CreateRenderingContext(nsIView *aView, nsIRen
static NS_DEFINE_IID(kRCIID, NS_IRENDERING_CONTEXT_IID);
aContext = nsnull;
rv = nsRepository::CreateInstance(kRCCID, nsnull, kRCIID, (void **)&pContext);
rv = nsComponentManager::CreateInstance(kRCCID, nsnull, kRCIID, (void **)&pContext);
if (NS_OK == rv) {
rv = InitRenderingContext(pContext, win);
@ -203,7 +204,7 @@ NS_IMETHODIMP DeviceContextImpl :: CreateRenderingContext(nsIWidget *aWidget, ns
static NS_DEFINE_IID(kRCIID, NS_IRENDERING_CONTEXT_IID);
aContext = nsnull;
rv = nsRepository::CreateInstance(kRCCID, nsnull, kRCIID, (void **)&pContext);
rv = nsComponentManager::CreateInstance(kRCCID, nsnull, kRCIID, (void **)&pContext);
if (NS_OK == rv) {
rv = InitRenderingContext(pContext, aWidget);
@ -658,7 +659,7 @@ nsresult nsFontCache :: GetMetricsFor(const nsFont& aFont, nsIFontMetrics *&aMet
static NS_DEFINE_IID(kFontMetricsIID, NS_IFONT_METRICS_IID);
nsIFontMetrics* fm;
nsresult rv = nsRepository::CreateInstance(kFontMetricsCID, nsnull,
nsresult rv = nsComponentManager::CreateInstance(kFontMetricsCID, nsnull,
kFontMetricsIID, (void **)&fm);
if (NS_OK != rv) {
aMetrics = nsnull;

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

@ -81,7 +81,7 @@ ImageRendererImpl::NewPixmap(void* aDisplayContext,
static NS_DEFINE_IID(kImageIID, NS_IIMAGE_IID);
// Create a new image object
rv = nsRepository::CreateInstance(kImageCID, nsnull, kImageIID, (void **)&img);
rv = nsComponentManager::CreateInstance(kImageCID, nsnull, kImageIID, (void **)&img);
if (NS_OK != rv) {
// XXX What about error handling?
return;

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

@ -93,7 +93,7 @@ printf("printer: driver %s, device %s\n", driver, device);
nsIDeviceContextSpec *devspec = nsnull;
nsRepository::CreateInstance(kDeviceContextSpecCID, nsnull, kIDeviceContextSpecIID, (void **)&devspec);
nsComponentManager::CreateInstance(kDeviceContextSpecCID, nsnull, kIDeviceContextSpecIID, (void **)&devspec);
if (nsnull != devspec)
{

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

@ -291,7 +291,7 @@ nsIDeviceContext *dx = nsnull;
gSobits = (HBITMAP)::SelectObject(gSrcdc, gSrcbits);
gDobits = (HBITMAP)::SelectObject(gDestdc, gDestbits);
rv = nsRepository::CreateInstance(kBlenderCID, nsnull, kBlenderIID, (void **)&gImageblender);
rv = nsComponentManager::CreateInstance(kBlenderCID, nsnull, kBlenderIID, (void **)&gImageblender);
//gImageblender->Init(gSrcdc,gDestdc);
gImageblender->Init(dx);
}
@ -1109,7 +1109,7 @@ static HWND CreateTopLevel(const char* clazz, const char* title,int aWidth, int
nsRect rect(0, 0, aWidth, aHeight);
nsresult rv = nsRepository::CreateInstance(kCChildWindowIID, NULL, kIWidgetIID, (void**)&gWindow);
nsresult rv = nsComponentManager::CreateInstance(kCChildWindowIID, NULL, kIWidgetIID, (void**)&gWindow);
if (NS_OK == rv)
@ -1118,9 +1118,9 @@ static HWND CreateTopLevel(const char* clazz, const char* title,int aWidth, int
}
// something for input
nsRepository::RegisterComponent(kCTextFieldCID, NULL, NULL, "raptorwidget.dll", PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCTextFieldCID, NULL, NULL, "raptorwidget.dll", PR_FALSE, PR_FALSE);
rect.SetRect(25, 370, 40, 25);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gBlendMessage);
nsComponentManager::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gBlendMessage);
nsIWidget* widget = nsnull;
if (NS_OK == gBlendMessage->QueryInterface(kIWidgetIID,(void**)&widget))
@ -1132,7 +1132,7 @@ static HWND CreateTopLevel(const char* clazz, const char* title,int aWidth, int
gBlendMessage->SetText("50",size);
rect.SetRect(70,370,40,25);
nsRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gQualMessage);
nsComponentManager::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (void**)&gQualMessage);
if (NS_OK == gQualMessage->QueryInterface(kIWidgetIID,(void**)&widget))
{
widget->Create(gWindow, rect, nsnull, nsnull);
@ -1155,9 +1155,9 @@ WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam, int nCmdShow
{
gInstance = instance;
nsRepository::RegisterComponent(kCWindowIID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kCChildWindowIID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kCScrollbarIID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCWindowIID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCChildWindowIID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCScrollbarIID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID);
@ -1165,11 +1165,11 @@ WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam, int nCmdShow
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
static NS_DEFINE_IID(kCBlenderIID, NS_BLENDER_CID);
nsRepository::RegisterComponent(kCRenderingContextIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kCDeviceContextIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kCFontMetricsIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kCImageIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kCBlenderIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCRenderingContextIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCDeviceContextIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCFontMetricsIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCImageIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCBlenderIID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
if (!prevInstance) {
WNDCLASS wndClass;

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

@ -24,7 +24,7 @@
#include "nsIURL.h"
#include "nsIStreamListener.h"
#include "nsIDTDDebug.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsParserCIID.h"
static NS_DEFINE_IID(kIRobotSinkObserverIID, NS_IROBOTSINKOBSERVER_IID);
@ -216,7 +216,7 @@ extern "C" NS_EXPORT int DebugRobot(
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
rv = nsRepository::CreateInstance(kCParserCID,
rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);

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

@ -2,7 +2,7 @@
#include "nsVoidArray.h"
#include "nsIWebShell.h"
#include "nsString.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsParserCIID.h"
#ifdef XP_PC
@ -22,7 +22,7 @@ int main(int argc, char **argv)
}
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsRepository::RegisterComponent(kCParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE);
return DebugRobot(gWorkList, nsnull);
}

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

@ -28,7 +28,7 @@
#include "nsHTMLDelegate.h"
#include "nsIParser.h"
#include "nsHTMLContentSink.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsParserCIID.h"
#ifdef XP_PC
@ -117,7 +117,7 @@ void parseFile (const char* aFilename,int size)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsresult rv = nsRepository::CreateInstance(kCParserCID,
nsresult rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);
@ -203,7 +203,7 @@ int main(int argc, char* argv [])
else _getcwd(buffer,_MAX_PATH);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsRepository::RegisterComponent(kCParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE);
walkDirectoryTree(buffer);
return 0;

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

@ -40,6 +40,7 @@
#include "prtypes.h" //this is here for debug reasons...
#include "prio.h"
#include "plstr.h"
#include "prlog.h"
#ifdef XP_PC
#include <direct.h> //this is here for debug reasons...

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

@ -21,7 +21,7 @@
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#define NS_PARSER_IID \
{0x2ce606b0, 0xbee6, 0x11d1, \

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

@ -16,7 +16,7 @@
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsParserCIID.h"
#include "nsIParser.h"
#include "nsILoggingSink.h"
@ -44,8 +44,8 @@ static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID);
static void SetupRegistry()
{
nsRepository::RegisterComponent(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kLoggingSinkCID, NULL, NULL, PARSER_DLL,PR_FALSE,PR_FALSE);
nsComponentManager::RegisterComponent(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kLoggingSinkCID, NULL, NULL, PARSER_DLL,PR_FALSE,PR_FALSE);
}
//----------------------------------------------------------------------
@ -61,7 +61,7 @@ nsresult GenerateBaselineFile(const char* aSourceFilename,const char* aBaselineF
// Create a parser
nsIParser* parser;
nsresult rv = nsRepository::CreateInstance(kParserCID,nsnull,kIParserIID,(void**)&parser);
nsresult rv = nsComponentManager::CreateInstance(kParserCID,nsnull,kIParserIID,(void**)&parser);
if (NS_OK != rv) {
cout << "Unable to create a parser (" << rv << ")" <<endl;
return -1;
@ -69,7 +69,7 @@ nsresult GenerateBaselineFile(const char* aSourceFilename,const char* aBaselineF
// Create a sink
nsILoggingSink* sink;
rv = nsRepository::CreateInstance(kLoggingSinkCID,nsnull,kILoggingSinkIID,(void**)&sink);
rv = nsComponentManager::CreateInstance(kLoggingSinkCID,nsnull,kILoggingSinkIID,(void**)&sink);
if (NS_OK != rv) {
cout << "Unable to create a sink (" << rv << ")" <<endl;
return -1;

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

@ -17,7 +17,8 @@
* Netscape Communications Corporation. All Rights Reserved.
*/
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsCOMPtr.h"
#include "nsIFactory.h"
#include "nsILocaleFactory.h"
@ -28,6 +29,9 @@
#include "nsLocaleFactoryMac.h"
#include "nsDateTimeFormatCID.h"
#include "nsCollationCID.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
//
// kLocaleFactory for the nsILocaleFactory interface
@ -100,56 +104,60 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return res;
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
//
// register the generic factory
//
res = nsRepository::RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (res!=NS_OK) return res;
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (rv!=NS_OK) return rv;
//
// register the collation factory
//
res = nsRepository::RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(rv)) return rv;
//
// register the collation interface
//
res = nsRepository::RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(rv)) return rv;
//
// register the date time formatter
//
res = nsRepository::RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(rv)) return rv;
return NS_OK;
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
res = nsRepository::UnregisterFactory(kLocaleFactoryCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kCollationFactoryCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kCollationCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kCollationCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kDateTimeFormatCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
if (rv!=NS_OK) return rv;
return NS_OK;
}

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

@ -19,7 +19,7 @@
#define NS_IMPL_IDS
#include "nsIServiceManager.h"
#include "nsICharsetConverterManager.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsCollation.h"
#include "nsCollationCID.h"
#include "nsUnicharUtilCIID.h"
@ -40,7 +40,7 @@ nsresult nsCollationFactory::CreateCollation(nsILocale* locale, nsICollation** i
nsICollation *inst;
nsresult res;
res = nsRepository::CreateInstance(kCollationCID, NULL, kICollationIID, (void**) &inst);
res = nsComponentManager::CreateInstance(kCollationCID, NULL, kICollationIID, (void**) &inst);
if (NS_FAILED(res)) {
return res;
}
@ -59,7 +59,7 @@ NS_DEFINE_IID(kCaseConversionIID, NS_ICASECONVERSION_IID);
nsCollation::nsCollation()
{
mCaseConversion = NULL;
nsresult res = nsRepository::CreateInstance(kUnicharUtilCID, NULL, kCaseConversionIID, (void**) &mCaseConversion);
nsresult res = nsComponentManager::CreateInstance(kUnicharUtilCID, NULL, kCaseConversionIID, (void**) &mCaseConversion);
NS_ASSERTION(NS_SUCCEEDED(res), "CreateInstance failed for kCaseConversionIID");
}

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

@ -17,7 +17,8 @@
* Netscape Communications Corporation. All Rights Reserved.
*/
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsCOMPtr.h"
#include "nsIFactory.h"
#include "nsILocaleFactory.h"
@ -29,6 +30,9 @@
#include "nsDateTimeFormatCID.h"
#include "nsCollationCID.h"
#include "nsLocaleSO.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
//
// kLocaleFactory for the nsILocaleFactory interface
@ -97,56 +101,60 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return res;
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
//
// register the generic factory
//
res = nsRepository::RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (res!=NS_OK) return res;
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (rv!=NS_OK) return rv;
//
// register the collation factory
//
res = nsRepository::RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(rv)) return rv;
//
// register the collation interface
//
res = nsRepository::RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(rv)) return rv;
//
// register the date time formatter
//
res = nsRepository::RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(rv)) return rv;
return NS_OK;
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
res = nsRepository::UnregisterFactory(kLocaleFactoryCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kCollationFactoryCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kCollationCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kCollationCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kDateTimeFormatCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
if (rv!=NS_OK) return rv;
return NS_OK;
}

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

@ -18,7 +18,7 @@
#include "nsCollationWin.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsLocaleCID.h"
#include "nsIWin32Locale.h"
#include <windows.h>
@ -62,7 +62,7 @@ nsresult nsCollationWin::Initialize(nsILocale* locale)
}
nsIWin32Locale* win32Locale;
res = nsRepository::CreateInstance(kWin32LocaleFactoryCID, NULL, kIWin32LocaleIID, (void**)&win32Locale);
res = nsComponentManager::CreateInstance(kWin32LocaleFactoryCID, NULL, kIWin32LocaleIID, (void**)&win32Locale);
if (NS_FAILED(res)) {
return res;
}

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

@ -17,7 +17,7 @@
*/
#include "nsDateTimeFormatWin.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsLocaleCID.h"
#include "nsIWin32Locale.h"
@ -106,7 +106,7 @@ nsresult nsDateTimeFormatWin::FormatTMTime(nsILocale* locale,
}
nsIWin32Locale* win32Locale;
res = nsRepository::CreateInstance(kWin32LocaleFactoryCID, NULL, kIWin32LocaleIID, (void**)&win32Locale);
res = nsComponentManager::CreateInstance(kWin32LocaleFactoryCID, NULL, kIWin32LocaleIID, (void**)&win32Locale);
if (NS_FAILED(res)) {
return res;
}

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

@ -17,7 +17,8 @@
* Netscape Communications Corporation. All Rights Reserved.
*/
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsCOMPtr.h"
#include "nsIFactory.h"
#include "nsILocaleFactory.h"
@ -30,6 +31,10 @@
#include "nsIWin32LocaleFactory.h"
#include "nsDateTimeFormatCID.h"
#include "nsCollationCID.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
//
// kLocaleFactory for the nsILocaleFactory interface and friends
//
@ -113,66 +118,70 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return res;
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
//
// register the generic factory
//
res = nsRepository::RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (res!=NS_OK) return res;
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (rv!=NS_OK) return rv;
//
// register the windows specific factory
//
res = nsRepository::RegisterComponent(kWin32LocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register nsIWin32LocaleFactory failed.");
if (res!=NS_OK) return res;
rv = compMgr->RegisterComponent(kWin32LocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register nsIWin32LocaleFactory failed.");
if (rv!=NS_OK) return rv;
//
// register the collation factory
//
res = nsRepository::RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(rv)) return rv;
//
// register the collation interface
//
res = nsRepository::RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(rv)) return rv;
//
// register the date time formatter
//
res = nsRepository::RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(res)) return res;
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(rv)) return rv;
return NS_OK;
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
res = nsRepository::UnregisterFactory(kLocaleFactoryCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kWin32LocaleFactoryCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kWin32LocaleFactoryCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kCollationFactoryCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kCollationCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kCollationCID, path);
if (rv!=NS_OK) return rv;
res = nsRepository::UnregisterFactory(kDateTimeFormatCID, path);
if (res!=NS_OK) return res;
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
if (rv!=NS_OK) return rv;
return NS_OK;
}

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

@ -20,7 +20,7 @@
#include <stdlib.h>
#define NS_IMPL_IDS
#include "nsISupports.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsILocale.h"
#include "nsILocaleFactory.h"
@ -167,7 +167,7 @@ static void TestCollation(nsILocale *locale)
cout << "Start nsICollation Test \n";
cout << "==============================\n";
res = nsRepository::CreateInstance(kCollationFactoryCID,
res = nsComponentManager::CreateInstance(kCollationFactoryCID,
NULL,
kICollationFactoryIID,
(void**) &f);
@ -179,7 +179,7 @@ static void TestCollation(nsILocale *locale)
f->Release();
}
res = nsRepository::CreateInstance(kCollationFactoryCID,
res = nsComponentManager::CreateInstance(kCollationFactoryCID,
NULL,
kICollationFactoryIID,
(void**) &f);
@ -467,7 +467,7 @@ static void TestSort(nsILocale *locale, nsCollationStrength collationStrength, F
cout << "Start sort Test \n";
cout << "==============================\n";
res = nsRepository::CreateInstance(kCollationFactoryCID,
res = nsComponentManager::CreateInstance(kCollationFactoryCID,
NULL,
kICollationFactoryIID,
(void**) &factoryInst);
@ -582,7 +582,7 @@ static void TestDateTimeFormat(nsILocale *locale)
nsIDateTimeFormat *t = NULL;
nsresult res;
res = nsRepository::CreateInstance(kDateTimeFormatCID,
res = nsComponentManager::CreateInstance(kDateTimeFormatCID,
NULL,
kIDateTimeFormatIID,
(void**) &t);
@ -594,7 +594,7 @@ static void TestDateTimeFormat(nsILocale *locale)
t->Release();
}
res = nsRepository::CreateInstance(kDateTimeFormatCID,
res = nsComponentManager::CreateInstance(kDateTimeFormatCID,
NULL,
kIDateTimeFormatIID,
(void**) &t);
@ -684,7 +684,7 @@ static nsresult NewLocale(const nsString* localeName, nsILocale** locale)
nsILocaleFactory* localeFactory;
nsresult res;
res = nsRepository::FindFactory(kLocaleFactoryCID, (nsIFactory**)&localeFactory);
res = nsComponentManager::FindFactory(kLocaleFactoryCID, (nsIFactory**)&localeFactory);
if (NS_FAILED(res) || localeFactory == nsnull) cout << "FindFactory nsILocaleFactory failed\n";
res = localeFactory->NewLocale(localeName, locale);
@ -719,25 +719,25 @@ int main(int argc, char** argv) {
nsresult res;
#if !XP_PC
res = nsRepository::RegisterComponent(kCollationFactoryCID, NULL, NULL, LOCALE_DLL_NAME, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kCollationFactoryCID, NULL, NULL, LOCALE_DLL_NAME, PR_FALSE, PR_FALSE);
if (NS_FAILED(res)) cout << "RegisterComponent failed\n";
res = nsRepository::RegisterComponent(kCollationCID, NULL, NULL, LOCALE_DLL_NAME, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kCollationCID, NULL, NULL, LOCALE_DLL_NAME, PR_FALSE, PR_FALSE);
if (NS_FAILED(res)) cout << "RegisterComponent failed\n";
res = nsRepository::RegisterComponent(kDateTimeFormatCID, NULL, NULL, LOCALE_DLL_NAME, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kDateTimeFormatCID, NULL, NULL, LOCALE_DLL_NAME, PR_FALSE, PR_FALSE);
if (NS_FAILED(res)) cout << "RegisterComponent failed\n";
res = nsRepository::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res)) cout << "RegisterComponent failed\n";
res = nsRepository::RegisterComponent(kLatin1ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kLatin1ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res)) cout << "RegisterComponent failed\n";
res = nsRepository::RegisterComponent(kUnicharUtilCID, NULL, NULL, UNICHARUTIL_DLL_NAME, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kUnicharUtilCID, NULL, NULL, UNICHARUTIL_DLL_NAME, PR_FALSE, PR_FALSE);
if (NS_FAILED(res)) cout << "RegisterComponent failed\n";
res = nsRepository::RegisterComponent(kLocaleFactoryCID, NULL, NULL, LOCALE_DLL_NAME, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kLocaleFactoryCID, NULL, NULL, LOCALE_DLL_NAME, PR_FALSE, PR_FALSE);
NS_ASSERTION(res==NS_OK,"nsLocaleTest: RegisterComponent failed.");
#endif
@ -748,7 +748,7 @@ int main(int argc, char** argv) {
#if 0
nsILocaleFactory* localeFactory;
res = nsRepository::FindFactory(kLocaleFactoryCID, (nsIFactory**)&localeFactory);
res = nsComponentManager::FindFactory(kLocaleFactoryCID, (nsIFactory**)&localeFactory);
if (NS_FAILED(res) || localeFactory == nsnull) cout << "FindFactory nsILocaleFactory failed\n";
res = localeFactory->GetSystemLocale(&locale);
@ -820,11 +820,11 @@ int main(int argc, char** argv) {
cout << "Finish All The Test Cases\n";
#if !XP_PC
res = nsRepository::FreeLibraries();
res = nsComponentManager::FreeLibraries();
if(NS_FAILED(res))
cout << "nsRepository failed\n";
cout << "nsComponentManager failed\n";
else
cout << "nsRepository FreeLibraries Done\n";
cout << "nsComponentManager FreeLibraries Done\n";
#endif
return 0;

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

@ -19,7 +19,7 @@
#include "nsILocale.h"
#include "nsILocaleFactory.h"
#include "nsLocaleCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#ifdef XP_PC
#include "nsIWin32Locale.h"
#include <windows.h>
@ -62,7 +62,7 @@ factory_create_interface(void)
nsILocaleFactory* localeFactory;
nsIFactory* genericFactory;
result = nsRepository::CreateInstance(kLocaleFactoryCID,
result = nsComponentManager::CreateInstance(kLocaleFactoryCID,
NULL,
kILocaleFactoryIID,
(void**)&localeFactory);
@ -71,7 +71,7 @@ factory_create_interface(void)
localeFactory->Release();
result = nsRepository::CreateInstance(kLocaleFactoryCID,
result = nsComponentManager::CreateInstance(kLocaleFactoryCID,
NULL,
kIFactoryIID,
(void**)&genericFactory);
@ -89,7 +89,7 @@ factory_test_isupports(void)
nsISupports* genericInterface1, *genericInterface2;
nsIFactory* genericFactory1, *genericFactory2;
result = nsRepository::FindFactory(kLocaleFactoryCID,
result = nsComponentManager::FindFactory(kLocaleFactoryCID,
(nsIFactory**)&localeFactory);
NS_ASSERTION(localeFactory!=NULL,"nsLocaleTest: factory_create_interface failed.");
NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_create_interface failed");
@ -146,7 +146,7 @@ factory_new_locale(void)
int i;
nsString** catagoryList, **valueList;
result = nsRepository::FindFactory(kLocaleFactoryCID,
result = nsComponentManager::FindFactory(kLocaleFactoryCID,
(nsIFactory**)&localeFactory);
NS_ASSERTION(localeFactory!=NULL,"nsLocaleTest: factory_create_interface failed.");
NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_create_interface failed");
@ -222,7 +222,7 @@ factory_get_locale(void)
nsString* catagory;
nsString* value;
result = nsRepository::FindFactory(kLocaleFactoryCID,
result = nsComponentManager::FindFactory(kLocaleFactoryCID,
(nsIFactory**)&localeFactory);
NS_ASSERTION(localeFactory!=NULL,"nsLocaleTest: factory_create_interface failed.");
NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_create_interface failed");
@ -290,7 +290,7 @@ win32factory_create_interface(void)
nsIFactory* factory;
nsIWin32Locale* win32Locale;
result = nsRepository::CreateInstance(kWin32LocaleFactoryCID,
result = nsComponentManager::CreateInstance(kWin32LocaleFactoryCID,
NULL,
kIFactoryIID,
(void**)&factory);
@ -299,7 +299,7 @@ win32factory_create_interface(void)
factory->Release();
result = nsRepository::CreateInstance(kWin32LocaleFactoryCID,
result = nsComponentManager::CreateInstance(kWin32LocaleFactoryCID,
NULL,
kIWin32LocaleIID,
(void**)&win32Locale);
@ -323,7 +323,7 @@ win32locale_test(void)
locale = new nsString("en-US");
loc_id = 0;
result = nsRepository::CreateInstance(kWin32LocaleFactoryCID,
result = nsComponentManager::CreateInstance(kWin32LocaleFactoryCID,
NULL,
kIWin32LocaleIID,
(void**)&win32Locale);
@ -377,7 +377,7 @@ main(int argc, char** argv)
//
// register the Locale Factory
//
res = nsRepository::RegisterComponent(kLocaleFactoryCID,
res = nsComponentManager::RegisterComponent(kLocaleFactoryCID,
NULL,
NULL,
LOCALE_DLL_NAME,
@ -390,7 +390,7 @@ main(int argc, char** argv)
//
// register the Windows specific factory
//
res = nsRepository::RegisterComponent(kWin32LocaleFactoryCID,
res = nsComponentManager::RegisterComponent(kWin32LocaleFactoryCID,
NULL,
NULL,
LOCALE_DLL_NAME,

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

@ -18,13 +18,16 @@
#include "pratom.h"
#include "nsISupports.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsCOMPtr.h"
#include "nsIFactory.h"
#include "nsLWBrkCIID.h"
#include "nsILineBreakerFactory.h"
#include "nsIWordBreakerFactory.h"
#include "nsLWBreakerFImp.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
NS_DEFINE_CID(kLWBrkCID, NS_LWBRK_CID);
@ -79,7 +82,7 @@ nsresult nsLWBrkFactory::CreateInstance(nsISupports *aDelegate,
return res;
}
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,
@ -100,17 +103,25 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return NS_NOINTERFACE;
}
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr) {
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr) {
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char *path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *path)
{
return nsRepository::RegisterComponent(kLWBrkCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
return compMgr->RegisterComponent(kLWBrkCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char *path)
{
return nsRepository::UnregisterFactory(kLWBrkCID, path);
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
return compMgr->UnregisterFactory(kLWBrkCID, path);
}

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

@ -16,7 +16,7 @@
* Reserved.
*/
#include <iostream.h>
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsISupports.h"
#include "nsIServiceManager.h"
#include "nsILineBreakerFactory.h"
@ -373,7 +373,7 @@ PRBool TestWordBreaker()
extern "C" void NS_SetupRegistry()
{
nsRepository::RegisterComponent(kLWBrkCID, NULL, NULL, LWBRK_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kLWBrkCID, NULL, NULL, LWBRK_DLL, PR_FALSE, PR_FALSE);
}
void SamplePrintWordWithBreak();
@ -579,12 +579,12 @@ int main(int argc, char** argv) {
// --------------------------------------------
cout << "Finish All The Test Cases\n";
nsresult res = NS_OK;
res = nsRepository::FreeLibraries();
res = nsComponentManager::FreeLibraries();
if(NS_FAILED(res))
cout << "nsRepository failed\n";
cout << "nsComponentManager failed\n";
else
cout << "nsRepository FreeLibraries Done\n";
cout << "nsComponentManager FreeLibraries Done\n";
if(lbok && wbok)
cout << "Line/Word Break Test\nOK\n";
else

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

@ -24,11 +24,15 @@
#include "nscore.h"
#include "nsILocale.h"
#include "nsINetService.h"
#include "nsIServiceManager.h"
#include "nsIURL.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#include "pratom.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static PRInt32 gLockCount = 0;
@ -66,19 +70,25 @@ nsStringBundle::nsStringBundle(nsIURL* aURL, nsILocale* aLocale,
*aResult = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID, (nsISupports**) &pNetService);
if (NS_FAILED(*aResult)) {
#ifdef NS_DEBUG
printf("cannot get net service\n");
#endif
return;
}
nsIInputStream *in = nsnull;
*aResult = pNetService->OpenBlockingStream(aURL, nsnull, &in);
if (NS_FAILED(*aResult)) {
#ifdef NS_DEBUG
printf("cannot open stream\n");
#endif
return;
}
*aResult = nsRepository::CreateInstance(kPropertiesCID, NULL,
*aResult = nsComponentManager::CreateInstance(kPropertiesCID, NULL,
kIPropertiesIID, (void**) &mProps);
if (NS_FAILED(*aResult)) {
#ifdef NS_DEBUG
printf("create nsIProperties failed\n");
#endif
return;
}
*aResult = mProps->Load(in);
@ -208,34 +218,38 @@ nsStringBundleServiceFactory::LockFactory(PRBool aLock)
}
extern "C" NS_EXPORT nsresult
NSRegisterSelf(nsISupports* serviceMgr, const char* path)
NSRegisterSelf(nsISupports* aServMgr, const char* path)
{
nsresult ret;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
ret = nsRepository::RegisterComponent(kStringBundleServiceCID, NULL, NULL, path,
rv = compMgr->RegisterComponent(kStringBundleServiceCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if (NS_FAILED(ret)) {
return ret;
if (NS_FAILED(rv)) {
return rv;
}
return ret;
return rv;
}
extern "C" NS_EXPORT nsresult
NSUnregisterSelf(nsISupports* serviceMgr, const char* path)
NSUnregisterSelf(nsISupports* aServMgr, const char* path)
{
nsresult ret;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
ret = nsRepository::UnregisterFactory(kStringBundleServiceCID, path);
if (NS_FAILED(ret)) {
return ret;
rv = compMgr->UnregisterFactory(kStringBundleServiceCID, path);
if (NS_FAILED(rv)) {
return rv;
}
return ret;
return rv;
}
extern "C" NS_EXPORT nsresult
NSGetFactory(nsISupports* serviceMgr,
NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,

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

@ -21,7 +21,7 @@
#include "nsILocale.h"
#include "nsINetService.h"
#include "nsIServiceManager.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsXPComCIID.h"
#define TEST_URL "resource:/res/strres.properties"
@ -49,7 +49,7 @@ main(int argc, char *argv[])
return 1;
}
nsRepository::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL,
nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL,
PR_FALSE, PR_FALSE);
nsIEventQueueService* pEventQueueService = nsnull;
ret = nsServiceManager::GetService(kEventQueueServiceCID,
@ -64,7 +64,7 @@ main(int argc, char *argv[])
return 1;
}
nsRepository::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
nsINetService* pNetService = nsnull;
ret = nsServiceManager::GetService(kNetServiceCID, kINetServiceIID,
(nsISupports**) &pNetService);

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

@ -21,7 +21,7 @@
#include "pratom.h"
#include "nsString.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsICharsetConverterManager.h"
#include "nsICharsetConverterInfo.h"
#include "nsIUnicodeEncoder.h"
@ -264,7 +264,7 @@ nsCharsetConverterManager::GetICharsetConverterInfo(ConverterInfo * aArray,
nsIFactory * factory;
nsICharsetConverterInfo * info;
res=nsRepository::FindFactory(*(aArray[aIndex].mCID), &factory);
res=nsComponentManager::FindFactory(*(aArray[aIndex].mCID), &factory);
if (NS_FAILED(res)) goto reduceArray;
res=factory->QueryInterface(kICharsetConverterInfoIID, (void ** )&info);
@ -300,7 +300,7 @@ nsresult nsCharsetConverterManager::GetCharsetConverter(
*aResult = NULL;
for (PRInt32 i=0; i<aSize; i++) if (str->EqualsIgnoreCase(*(aArray[i].mCharset))) {
res = nsRepository::CreateInstance(*(aArray[i].mCID),NULL,*aCID,aResult);
res = nsComponentManager::CreateInstance(*(aArray[i].mCID),NULL,*aCID,aResult);
break;
}

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

@ -17,7 +17,8 @@
* Netscape Communications Corporation. All Rights Reserved.
*/
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsCOMPtr.h"
#include "nsICharsetConverterManager.h"
#include "nsCharsetConverterManager.h"
#include "nsIUnicodeEncodeHelper.h"
@ -26,6 +27,9 @@
#include "nsPlatformCharsetFactory.h"
#include "nsICharsetAlias.h"
#include "nsCharsetAliasFactory.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -38,12 +42,12 @@ extern "C" PRInt32 g_LockCount = 0;
NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr)
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr)
{
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
}
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,
@ -102,40 +106,44 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return NS_NOINTERFACE;
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
res = nsRepository::RegisterComponent(kUnicodeEncodeHelperCID, NULL, NULL,
rv = compMgr->RegisterComponent(kUnicodeEncodeHelperCID, NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) return rv;
res = nsRepository::RegisterComponent(kCharsetAliasCID, NULL, NULL, path,
rv = compMgr->RegisterComponent(kCharsetAliasCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) return rv;
res = nsRepository::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL,
rv = compMgr->RegisterComponent(kCharsetConverterManagerCID, NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) return rv;
res = nsRepository::RegisterComponent(kPlatformCharsetCID, NULL, NULL, path,
rv = compMgr->RegisterComponent(kPlatformCharsetCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
return res;
return rv;
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
res = nsRepository::UnregisterFactory(kUnicodeEncodeHelperCID, path);
if(NS_FAILED(res)) return res;
rv = compMgr->UnregisterFactory(kUnicodeEncodeHelperCID, path);
if(NS_FAILED(rv)) return rv;
res = nsRepository::UnregisterFactory(kCharsetAliasCID, path);
if(NS_FAILED(res)) return res;
rv = compMgr->UnregisterFactory(kCharsetAliasCID, path);
if(NS_FAILED(rv)) return rv;
res = nsRepository::UnregisterFactory(kCharsetConverterManagerCID, path);
if(NS_FAILED(res)) return res;
rv = compMgr->UnregisterFactory(kCharsetConverterManagerCID, path);
if(NS_FAILED(rv)) return rv;
res = nsRepository::UnregisterFactory(kPlatformCharsetCID, path);
return res;
rv = compMgr->UnregisterFactory(kPlatformCharsetCID, path);
return rv;
}

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

@ -19,7 +19,7 @@
#include "pratom.h"
#include "nsUConvDll.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsUnicodeDecodeUtil.h"
#include "nsIUnicodeDecoder.h"

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

@ -21,6 +21,7 @@
#include <stdio.h>
#include <string.h>
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsISupports.h"
#include "nsICharsetConverterManager.h"
@ -80,25 +81,25 @@ nsresult setupRegistry()
{
nsresult res;
res = nsRepository::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kCharsetConverterManagerCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterComponent(kLatin1ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kLatin1ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterComponent(kCP1253ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kCP1253ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterComponent(kISO88597ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kISO88597ToUnicodeCID, NULL, NULL, UCVLATIN_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterComponent(kSJIS2UnicodeCID, NULL, NULL, UCVJA_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kSJIS2UnicodeCID, NULL, NULL, UCVJA_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterComponent(kISO2022JPToUnicodeCID, NULL, NULL, UCVJA2_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kISO2022JPToUnicodeCID, NULL, NULL, UCVJA2_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
res = nsRepository::RegisterComponent(kPlatformCharsetCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
res = nsComponentManager::RegisterComponent(kPlatformCharsetCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE);
if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
return NS_OK;

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

@ -18,7 +18,7 @@
*/
#include "pratom.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsSJIS2Unicode.h"
#include "nsUCVJADll.h"
@ -74,7 +74,7 @@ NS_IMETHODIMP nsSJIS2Unicode::Convert(PRUnichar * aDest, PRInt32 aDestOffset,
if(nsnull == mUtil)
{
nsresult res = NS_OK;
res = nsRepository::CreateInstance(
res = nsComponentManager::CreateInstance(
kCharsetConverterManagerCID,
NULL,
kIUnicodeDecodeUtilIID,

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

@ -20,11 +20,14 @@
#define NS_IMPL_IDS
#include "pratom.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIFactory.h"
#include "nsICharsetConverterInfo.h"
#include "nsUCVJACID.h"
#include "nsSJIS2Unicode.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
// just for NS_IMPL_IDS; this is a good, central place to implement GUIDs
#include "nsIUnicodeDecoder.h"
@ -110,12 +113,12 @@ public:
NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr)
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr)
{
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
}
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,
@ -144,29 +147,33 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return NS_NOINTERFACE;
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
for (PRUint32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
rv = compMgr->RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) return rv;
}
return res;
return rv;
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
for (PRUint32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::UnregisterFactory(*(g_FactoryData[i].mCID), path);
if(NS_FAILED(res)) return res;
rv = compMgr->UnregisterFactory(*(g_FactoryData[i].mCID), path);
if(NS_FAILED(rv)) return rv;
}
return res;
return rv;
}
//----------------------------------------------------------------------

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

@ -18,7 +18,7 @@
*/
#include "pratom.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsEUCJPToUnicode.h"
#include "nsUCVJA2Dll.h"
@ -101,7 +101,7 @@ NS_IMETHODIMP nsEUCJPToUnicode::Convert(PRUnichar * aDest, PRInt32 aDestOffset,
if(nsnull == mUtil)
{
nsresult res = NS_OK;
res = nsRepository::CreateInstance(
res = nsComponentManager::CreateInstance(
kCharsetConverterManagerCID,
NULL,
kIUnicodeDecodeUtilIID,

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

@ -18,7 +18,7 @@
*/
#include "pratom.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsISO2022JPToUnicode.h"
#include "nsUCVJA2Dll.h"
@ -81,7 +81,7 @@ nsresult nsISO2022JPToUnicode::ConvertBuffer(const char ** aSrc,
if (mHelper == nsnull) {
// XXX change the helper object to have its own CID!
res = nsRepository::CreateInstance(kCharsetConverterManagerCID, NULL,
res = nsComponentManager::CreateInstance(kCharsetConverterManagerCID, NULL,
kIUnicodeDecodeUtilIID, (void**) & mHelper);
if (NS_FAILED(res)) return res;

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

@ -20,12 +20,15 @@
#define NS_IMPL_IDS
#include "pratom.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIFactory.h"
#include "nsICharsetConverterInfo.h"
#include "nsUCVJA2CID.h"
#include "nsEUCJPToUnicode.h"
#include "nsISO2022JPToUnicode.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
// just for NS_IMPL_IDS; this is a good, central place to implement GUIDs
#include "nsIUnicodeDecoder.h"
@ -129,12 +132,12 @@ public:
NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr)
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr)
{
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
}
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,
@ -163,29 +166,33 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return NS_NOINTERFACE;
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
for (PRUint32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
rv = compMgr->RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) return rv;
}
return res;
return rv;
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
for (PRUint32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::UnregisterFactory(*(g_FactoryData[i].mCID), path);
if(NS_FAILED(res)) return res;
rv = compMgr->UnregisterFactory(*(g_FactoryData[i].mCID), path);
if(NS_FAILED(rv)) return rv;
}
return res;
return rv;
}
//----------------------------------------------------------------------

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

@ -19,7 +19,7 @@
#include "pratom.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIUnicodeDecoder.h"
#include "nsIUnicodeDecodeUtil.h"
#include "nsICharsetConverterManager.h"
@ -46,7 +46,7 @@ NS_IMETHODIMP ns1ByteToUnicodeBase::Convert(PRUnichar * aDest, PRInt32 aDestOffs
if(nsnull == mUtil)
{
nsresult res = NS_OK;
res = nsRepository::CreateInstance(
res = nsComponentManager::CreateInstance(
kCharsetConverterManagerCID,
NULL,
kIUnicodeDecodeUtilIID,

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

@ -20,7 +20,7 @@
#ifndef ns1ByteToUnicodeBase_h__
#define ns1ByteToUnicodeBase_h__
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIUnicodeDecoder.h"
#include "nsIUnicodeDecodeUtil.h"

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

@ -20,7 +20,7 @@
#define NS_IMPL_IDS
#include "pratom.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIFactory.h"
#include "nsICharsetConverterInfo.h"
#include "nsUCvLatinCID.h"
@ -28,6 +28,9 @@
#include "nsISO88597ToUnicode.h"
#include "nsCP1253ToUnicode.h"
#include "nsUnicodeToLatin1.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
// just for NS_IMPL_IDS; this is a good, central place to implement GUIDs
#include "nsIUnicodeEncoder.h"
@ -133,12 +136,12 @@ public:
NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr)
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr)
{
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
}
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,
@ -167,29 +170,33 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return NS_NOINTERFACE;
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
for (PRUint32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
rv = compMgr->RegisterComponent(*(g_FactoryData[i].mCID), NULL, NULL,
path, PR_TRUE, PR_TRUE);
if(NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) return rv;
}
return res;
return rv;
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char * path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char * path)
{
nsresult res;
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
for (PRUint32 i=0; i<ARRAY_SIZE(g_FactoryData); i++) {
res = nsRepository::UnregisterFactory(*(g_FactoryData[i].mCID), path);
if(NS_FAILED(res)) return res;
rv = compMgr->UnregisterFactory(*(g_FactoryData[i].mCID), path);
if(NS_FAILED(rv)) return rv;
}
return res;
return rv;
}
//----------------------------------------------------------------------

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

@ -18,7 +18,7 @@
*/
#include "pratom.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsUCvLatinSupport.h"
#include "nsUCvLatinDll.h"
@ -296,7 +296,7 @@ NS_IMETHODIMP nsTableEncoderSupport::ConvertNoBuffNoErr(
nsresult res;
if (mHelper == nsnull) {
res = nsRepository::CreateInstance(kUnicodeEncodeHelperCID, NULL,
res = nsComponentManager::CreateInstance(kUnicodeEncodeHelperCID, NULL,
kIUnicodeEncodeHelperIID, (void**) & mHelper);
if (NS_FAILED(res)) return NS_ERROR_UENC_NOHELPER;

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

@ -19,12 +19,14 @@
#include "pratom.h"
#include "nsUUDll.h"
#include "nsISupports.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIFactory.h"
#include "nsUnicharUtilCIID.h"
#include "nsICaseConversion.h"
#include "nsCaseConversionImp2.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
NS_DEFINE_IID(kFactoryIID, NS_IFACTORY_IID);
NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
@ -82,7 +84,7 @@ nsresult nsUnicharUtilFactory::CreateInstance(nsISupports *aDelegate,
return res;
}
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,
@ -103,16 +105,24 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
return NS_NOINTERFACE;
}
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr) {
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr) {
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
}
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char *path)
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *path)
{
return nsRepository::RegisterComponent(kUnicharUtilCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
return compMgr->RegisterComponent(kUnicharUtilCID, NULL, NULL, path,
PR_TRUE, PR_TRUE);
}
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char *path)
{
return nsRepository::UnregisterFactory(kUnicharUtilCID, path);
nsresult rv;
nsService<nsIComponentManager> compMgr(aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
return compMgr->UnregisterFactory(kUnicharUtilCID, path);
}

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

@ -18,6 +18,7 @@
#include <iostream.h>
#include "nsISupports.h"
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
#include "nsICaseConversion.h"
#include "nsUnicharUtilCIID.h"
@ -347,7 +348,7 @@ void TestCaseConversion()
void RegisterFactories()
{
nsresult res;
res = nsRepository::RegisterComponent(kUnicharUtilCID,
res = nsComponentManager::RegisterComponent(kUnicharUtilCID,
NULL,
NULL,
UNICHARUTIL_DLL_NAME,
@ -370,11 +371,11 @@ int main(int argc, char** argv) {
// --------------------------------------------
cout << "Finish All The Test Cases\n";
nsresult res = NS_OK;
res = nsRepository::FreeLibraries();
res = nsComponentManager::FreeLibraries();
if(NS_FAILED(res))
cout << "nsRepository failed\n";
cout << "nsComponentManager failed\n";
else
cout << "nsRepository FreeLibraries Done\n";
cout << "nsComponentManager FreeLibraries Done\n";
return 0;
}

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

@ -29,7 +29,7 @@
#include "nsCLiveconnect.h"
#include "nsCLiveconnectFactory.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);

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

@ -46,7 +46,7 @@ static NS_DEFINE_IID(kAllocatorCID, NS_ALLOCATOR_CID);
static void RegAllocator()
{
nsRepository::RegisterComponent(kAllocatorCID, NULL, NULL, XPCOM_DLL,
nsComponentManager::RegisterComponent(kAllocatorCID, NULL, NULL, XPCOM_DLL,
PR_FALSE, PR_FALSE);
}
@ -650,4 +650,4 @@ void Datom(JSAtom *atom) { if (atom) DumpAtom(&atom->entry, 0, gErrFile); }
void Dobj(nsISupports* p, int depth) {if(p)XPC_DUMP(p,depth);}
void Dxpc(int depth) {Dobj(XPC_GetXPConnect(), depth);}
JS_END_EXTERN_C
#endif
#endif

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

@ -557,7 +557,7 @@ PresShell::Init(nsIDocument* aDocument,
NS_ADDREF(aStyleSet);
nsCOMPtr<nsIDOMSelection>domselection;
nsresult result = nsRepository::CreateInstance(kRangeListCID, nsnull,
nsresult result = nsComponentManager::CreateInstance(kRangeListCID, nsnull,
kIDOMSelectionIID,
getter_AddRefs(domselection));
if (!NS_SUCCEEDED(result))
@ -570,7 +570,7 @@ PresShell::Init(nsIDocument* aDocument,
// XXX This code causes the document object (and the entire content model) to be leaked...
#if 0
nsCOMPtr<nsIDOMRange>range;
if (NS_SUCCEEDED(nsRepository::CreateInstance(kCRangeCID, nsnull, kIDOMRangeIID, getter_AddRefs(range)))){ //create an irange
if (NS_SUCCEEDED(nsComponentManager::CreateInstance(kCRangeCID, nsnull, kIDOMRangeIID, getter_AddRefs(range)))){ //create an irange
nsCOMPtr<nsIDocument>doc(GetDocument());
nsCOMPtr<nsIDOMDocument>domDoc(doc);
if (domDoc){
@ -1493,7 +1493,7 @@ PresShell::DoCopy(nsISelectionMgr* aSelectionMgr)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsresult rv = nsRepository::CreateInstance(kCParserCID,
nsresult rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);
@ -2200,7 +2200,7 @@ PresShell::VerifyIncrementalReflow()
void* nativeParentWidget = rootWidget->GetNativeData(NS_NATIVE_WIDGET);
// Create a new view manager.
rv = nsRepository::CreateInstance(kViewManagerCID, nsnull, kIViewManagerIID,
rv = nsComponentManager::CreateInstance(kViewManagerCID, nsnull, kIViewManagerIID,
(void**) &vm);
if ((NS_OK != rv) || (NS_OK != vm->Init(dc))) {
NS_ASSERTION(NS_OK == rv, "failed to create view manager");
@ -2212,7 +2212,7 @@ PresShell::VerifyIncrementalReflow()
// Create a view
nsRect tbounds;
mPresContext->GetVisibleArea(tbounds);
rv = nsRepository::CreateInstance(kScrollingViewCID, nsnull, kIViewIID,
rv = nsComponentManager::CreateInstance(kScrollingViewCID, nsnull, kIViewIID,
(void **) &view);
if ((NS_OK != rv) || (NS_OK != view->Init(vm, tbounds, nsnull))) {
NS_ASSERTION(NS_OK == rv, "failed to create scroll view");

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

@ -26,7 +26,7 @@
#include "nsIFrameSelection.h"
#include "nsIDOMSelection.h"
#include "nsIFocusTracker.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsLayoutCID.h"
#include "nsIContent.h"
#include "nsIDOMNode.h"
@ -1187,7 +1187,7 @@ nsRangeList::Collapse(nsIDOMNode* aParentNode, PRInt32 aOffset)
Clear();
nsCOMPtr<nsIDOMRange> range;
result = nsRepository::CreateInstance(kRangeCID, nsnull,
result = nsComponentManager::CreateInstance(kRangeCID, nsnull,
kIDOMRangeIID,
getter_AddRefs(range));
if (NS_FAILED(result))

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

@ -21,7 +21,7 @@
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#define NS_HTMLDOCUMENT_CID \
{ /* 5d0fcdd0-4daa-11d2-b328-00805f8a3859 */ \

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

@ -30,7 +30,7 @@
#include "nsIFileWidget.h"
#include "nsITextWidget.h"
#include "nsWidgetsCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIView.h"
#include "nsHTMLParts.h"
#include "nsIDOMHTMLInputElement.h"

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

@ -30,7 +30,7 @@
#include "nsIFileWidget.h"
#include "nsITextWidget.h"
#include "nsWidgetsCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIView.h"
#include "nsHTMLParts.h"
#include "nsIDOMHTMLInputElement.h"
@ -157,7 +157,7 @@ void nsFileControlFrame::MouseClicked(nsIPresContext* aPresContext)
nsIFileWidget *fileWidget;
nsString title("FileWidget Title <here> mode = save");
nsRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);
nsComponentManager::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (void**)&fileWidget);
nsString titles[] = {"all files"};
nsString filters[] = {"*.*"};

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

@ -31,7 +31,7 @@
#include "nsCoord.h"
#include "nsWidgetsCID.h"
#include "nsViewsCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsGUIEvent.h"
#include "nsDOMEvent.h"
#include "nsIFontMetrics.h"
@ -255,7 +255,7 @@ nsFormControlFrame::Reflow(nsIPresContext& aPresContext,
nsIView* view = nsnull;
GetView(&view);
if (nsnull == view) {
result = nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
if (!NS_SUCCEEDED(result)) {
NS_ASSERTION(0, "Could not create view for form control");
aStatus = NS_FRAME_NOT_COMPLETE;

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

@ -31,7 +31,7 @@
#include "nsCoord.h"
#include "nsWidgetsCID.h"
#include "nsViewsCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsGUIEvent.h"
#include "nsDOMEvent.h"
#include "nsIFontMetrics.h"

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

@ -40,7 +40,7 @@
#include "nsIHTMLAttributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIWidget.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsViewsCID.h"
@ -519,7 +519,7 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
nsIView* view;
GetView(&view);
if (!view) {
nsresult result = nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
nsCOMPtr<nsIPresShell> presShell;
aPresContext.GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIViewManager> viewMan;

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

@ -187,7 +187,7 @@ nsImageControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
nsIView* view;
GetView(&view);
if (!view) {
nsresult result = nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);
nsCOMPtr<nsIPresShell> presShell;
aPresContext.GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIViewManager> viewMan;

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

@ -44,7 +44,7 @@
#include "nsIDeviceContext.h"
#include "nsIFontMetrics.h"
#include "nsILookAndFeel.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#ifdef SingleSignon
#include "nsIDocument.h"
@ -110,7 +110,7 @@ nsTextControlFrame::GetVerticalInsidePadding(float aPixToTwip,
PRInt32 vertPad;
PRInt32 shouldUseVertPad;
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsRepository::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetMetric(nsILookAndFeel::eMetricFloat_TextAreaVerticalInsidePadding, padTextArea);
lookAndFeel->GetMetric(nsILookAndFeel::eMetricFloat_TextFieldVerticalInsidePadding, padTextField);
// These two (below) are really only needed for GTK
@ -154,7 +154,7 @@ nsTextControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext,
PRInt32 shouldUsePadMinText;
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsRepository::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetMetric(nsILookAndFeel::eMetricFloat_TextFieldHorizontalInsidePadding, padTextField);
lookAndFeel->GetMetric(nsILookAndFeel::eMetricFloat_TextAreaHorizontalInsidePadding, padTextArea);
lookAndFeel->GetMetric(nsILookAndFeel::eMetric_TextHorizontalInsideMinimumPadding, padMinText);

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

@ -23,7 +23,7 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsHTMLIIDs.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#include "nsIDocument.h"
@ -647,7 +647,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
nsIContent* content;
GetParentContent(content);
rv = nsRepository::CreateInstance(kWebShellCID, nsnull, kIWebShellIID,
rv = nsComponentManager::CreateInstance(kWebShellCID, nsnull, kIWebShellIID,
(void**)&mWebShell);
if (NS_OK != rv) {
NS_ASSERTION(0, "could not create web widget");
@ -704,7 +704,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
// create, init, set the parent of the view
nsIView* view;
rv = nsRepository::CreateInstance(kCViewCID, nsnull, kIViewIID,
rv = nsComponentManager::CreateInstance(kCViewCID, nsnull, kIViewIID,
(void **)&view);
if (NS_OK != rv) {
NS_ASSERTION(0, "Could not create view for nsHTMLFrame");

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

@ -24,7 +24,7 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsHTMLIIDs.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#include "nsIDocument.h"
@ -42,7 +42,7 @@
#include "nsHTMLParts.h"
#include "nsILookAndFeel.h"
#include "nsWidgetsCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
// masks for mEdgeVisibility
#define LEFT_VIS 0x0001
#define RIGHT_VIS 0x0002
@ -838,7 +838,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
// create the view. a view is needed since it needs to be a mouse grabber
nsIView* view;
nsresult result = nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID,
(void **)&view);
nsCOMPtr<nsIPresShell> presShell;
aPresContext.GetShell(getter_AddRefs(presShell));
@ -1530,7 +1530,7 @@ nsHTMLFramesetBorderFrame::Paint(nsIPresContext& aPresContext,
nscolor sdwColor = NS_RGB(128,128,128);
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsRepository::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetBackground, bgColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetForeground, fgColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DShadow, sdwColor);

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

@ -230,7 +230,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext,
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
nsresult result = nsRepository::CreateInstance(kViewCID,
nsresult result = nsComponentManager::CreateInstance(kViewCID,
nsnull,
kIViewIID,
(void **)&view);

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

@ -317,7 +317,7 @@ nsObjectFrame::CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly)
// Create our view and widget
nsresult result =
nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID,
(void **)&view);
if (NS_OK != result) {
return result;
@ -532,7 +532,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
nsRect r = nsRect(x, y, width, height);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
nsresult rv = nsRepository::CreateInstance(aWidgetCID, nsnull, kIWidgetIID,
nsresult rv = nsComponentManager::CreateInstance(aWidgetCID, nsnull, kIWidgetIID,
(void**)&mWidget);
// XXX use rv!
nsIWidget *parent;

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

@ -230,7 +230,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext,
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
nsresult result = nsRepository::CreateInstance(kViewCID,
nsresult result = nsComponentManager::CreateInstance(kViewCID,
nsnull,
kIViewIID,
(void **)&view);

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

@ -317,7 +317,7 @@ nsObjectFrame::CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly)
// Create our view and widget
nsresult result =
nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID,
(void **)&view);
if (NS_OK != result) {
return result;
@ -532,7 +532,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
nsRect r = nsRect(x, y, width, height);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
nsresult rv = nsRepository::CreateInstance(aWidgetCID, nsnull, kIWidgetIID,
nsresult rv = nsComponentManager::CreateInstance(aWidgetCID, nsnull, kIWidgetIID,
(void**)&mWidget);
// XXX use rv!
nsIWidget *parent;

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

@ -557,7 +557,7 @@ PresShell::Init(nsIDocument* aDocument,
NS_ADDREF(aStyleSet);
nsCOMPtr<nsIDOMSelection>domselection;
nsresult result = nsRepository::CreateInstance(kRangeListCID, nsnull,
nsresult result = nsComponentManager::CreateInstance(kRangeListCID, nsnull,
kIDOMSelectionIID,
getter_AddRefs(domselection));
if (!NS_SUCCEEDED(result))
@ -570,7 +570,7 @@ PresShell::Init(nsIDocument* aDocument,
// XXX This code causes the document object (and the entire content model) to be leaked...
#if 0
nsCOMPtr<nsIDOMRange>range;
if (NS_SUCCEEDED(nsRepository::CreateInstance(kCRangeCID, nsnull, kIDOMRangeIID, getter_AddRefs(range)))){ //create an irange
if (NS_SUCCEEDED(nsComponentManager::CreateInstance(kCRangeCID, nsnull, kIDOMRangeIID, getter_AddRefs(range)))){ //create an irange
nsCOMPtr<nsIDocument>doc(GetDocument());
nsCOMPtr<nsIDOMDocument>domDoc(doc);
if (domDoc){
@ -1493,7 +1493,7 @@ PresShell::DoCopy(nsISelectionMgr* aSelectionMgr)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsresult rv = nsRepository::CreateInstance(kCParserCID,
nsresult rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&parser);
@ -2200,7 +2200,7 @@ PresShell::VerifyIncrementalReflow()
void* nativeParentWidget = rootWidget->GetNativeData(NS_NATIVE_WIDGET);
// Create a new view manager.
rv = nsRepository::CreateInstance(kViewManagerCID, nsnull, kIViewManagerIID,
rv = nsComponentManager::CreateInstance(kViewManagerCID, nsnull, kIViewManagerIID,
(void**) &vm);
if ((NS_OK != rv) || (NS_OK != vm->Init(dc))) {
NS_ASSERTION(NS_OK == rv, "failed to create view manager");
@ -2212,7 +2212,7 @@ PresShell::VerifyIncrementalReflow()
// Create a view
nsRect tbounds;
mPresContext->GetVisibleArea(tbounds);
rv = nsRepository::CreateInstance(kScrollingViewCID, nsnull, kIViewIID,
rv = nsComponentManager::CreateInstance(kScrollingViewCID, nsnull, kIViewIID,
(void **) &view);
if ((NS_OK != rv) || (NS_OK != view->Init(vm, tbounds, nsnull))) {
NS_ASSERTION(NS_OK == rv, "failed to create scroll view");

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

@ -146,7 +146,7 @@ nsScrollFrame::CreateScrollingView()
parentView->GetViewManager(viewManager);
// Create the scrolling view
nsresult rv = nsRepository::CreateInstance(kScrollingViewCID,
nsresult rv = nsComponentManager::CreateInstance(kScrollingViewCID,
nsnull,
kIViewIID,
(void **)&view);

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

@ -23,7 +23,7 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsHTMLIIDs.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#include "nsIDocument.h"
@ -647,7 +647,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
nsIContent* content;
GetParentContent(content);
rv = nsRepository::CreateInstance(kWebShellCID, nsnull, kIWebShellIID,
rv = nsComponentManager::CreateInstance(kWebShellCID, nsnull, kIWebShellIID,
(void**)&mWebShell);
if (NS_OK != rv) {
NS_ASSERTION(0, "could not create web widget");
@ -704,7 +704,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
// create, init, set the parent of the view
nsIView* view;
rv = nsRepository::CreateInstance(kCViewCID, nsnull, kIViewIID,
rv = nsComponentManager::CreateInstance(kCViewCID, nsnull, kIViewIID,
(void **)&view);
if (NS_OK != rv) {
NS_ASSERTION(0, "Could not create view for nsHTMLFrame");

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

@ -24,7 +24,7 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsHTMLIIDs.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#include "nsIDocument.h"
@ -42,7 +42,7 @@
#include "nsHTMLParts.h"
#include "nsILookAndFeel.h"
#include "nsWidgetsCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
// masks for mEdgeVisibility
#define LEFT_VIS 0x0001
#define RIGHT_VIS 0x0002
@ -838,7 +838,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
// create the view. a view is needed since it needs to be a mouse grabber
nsIView* view;
nsresult result = nsRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, kIViewIID,
(void **)&view);
nsCOMPtr<nsIPresShell> presShell;
aPresContext.GetShell(getter_AddRefs(presShell));
@ -1530,7 +1530,7 @@ nsHTMLFramesetBorderFrame::Paint(nsIPresContext& aPresContext,
nscolor sdwColor = NS_RGB(128,128,128);
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsRepository::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetBackground, bgColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetForeground, fgColor);
lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DShadow, sdwColor);

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

@ -45,7 +45,7 @@
#include "nsIDOMHTMLOptionElement.h"
#include "nsIFormControl.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIScrollableView.h"
#include "nsHTMLAtoms.h"

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

@ -46,7 +46,7 @@
#include "nsINetService.h"
#include "nsIServiceManager.h"
#include "nsIFormManager.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsParserCIID.h"
#include "nsIDOMHTMLElement.h"
#include "nsIDOMHTMLMapElement.h"
@ -334,7 +334,7 @@ nsHTMLDocument::StartDocumentLoad(nsIURL *aURL,
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
if (rv == NS_OK)
rv = nsRepository::CreateInstance(kCParserCID,
rv = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&mParser);
@ -1244,7 +1244,7 @@ nsHTMLDocument::Open(JSContext *cx, jsval *argv, PRUint32 argc)
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
result = nsRepository::CreateInstance(kCParserCID,
result = nsComponentManager::CreateInstance(kCParserCID,
nsnull,
kCParserIID,
(void **)&mParser);

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

@ -169,7 +169,7 @@ nsButtonControlFrame::GetVerticalInsidePadding(float aPixToTwip,
{
float pad;
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsRepository::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetMetric(nsILookAndFeel::eMetricFloat_ButtonVerticalInsidePadding, pad);
NS_RELEASE(lookAndFeel);
}
@ -189,7 +189,7 @@ nsButtonControlFrame::GetHorizontalInsidePadding(nsIPresContext& aPresContext,
PRInt32 padQuirks;
PRInt32 padQuirksOffset;
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsRepository::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetMetric(nsILookAndFeel::eMetricFloat_ButtonHorizontalInsidePadding, pad);
lookAndFeel->GetMetric(nsILookAndFeel::eMetric_ButtonHorizontalInsidePaddingNavQuirks, padQuirks);
lookAndFeel->GetMetric(nsILookAndFeel::eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks, padQuirksOffset);

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

@ -36,7 +36,7 @@
#include "nsIDOMHTMLInputElement.h"
#include "nsCSSRendering.h"
#include "nsILookAndFeel.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#define NS_DEFAULT_CHECKBOX_SIZE 12
@ -155,7 +155,7 @@ nsCheckboxControlFrame::GetCheckboxSize(float aPixToTwip) const
{
nsILookAndFeel * lookAndFeel;
PRInt32 checkboxSize = 0;
if (NS_OK == nsRepository::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetMetric(nsILookAndFeel::eMetric_CheckboxSize, checkboxSize);
NS_RELEASE(lookAndFeel);
}

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

@ -30,7 +30,7 @@
#include "nsIFileWidget.h"
#include "nsITextWidget.h"
#include "nsWidgetsCID.h"
#include "nsRepository.h"
#include "nsIComponentManager.h"
#include "nsIView.h"
#include "nsHTMLParts.h"
#include "nsIDOMHTMLInputElement.h"

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше