Fixed editor classes to do autoregistration correctly and moved target directory to bin/components
git-svn-id: svn://10.0.0.236/trunk@23216 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -122,7 +122,7 @@ LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
|
||||
@@ -67,6 +67,8 @@ static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIPresShellIID, NS_IPRESSHELL_IID);
|
||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||
static NS_DEFINE_IID(kIEditFactoryIID, NS_IEDITORFACTORY_IID);
|
||||
static NS_DEFINE_IID(kITextEditFactoryIID, NS_ITEXTEDITORFACTORY_IID);
|
||||
static NS_DEFINE_IID(kIHTMLEditFactoryIID, NS_IHTMLEDITORFACTORY_IID);
|
||||
static NS_DEFINE_IID(kIEditorIID, NS_IEDITOR_IID);
|
||||
static NS_DEFINE_IID(kIEditorSupportIID, NS_IEDITORSUPPORT_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
@@ -168,14 +170,39 @@ NSCanUnload(nsISupports* serviceMgr)
|
||||
extern "C" NS_EXPORT nsresult
|
||||
NSRegisterSelf(nsISupports* serviceMgr, const char *path)
|
||||
{
|
||||
return nsRepository::RegisterComponent(kIEditFactoryIID, NULL, NULL, path,
|
||||
PR_TRUE, PR_TRUE); //this will register the factory with the xpcom dll.
|
||||
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);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult
|
||||
NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
|
||||
{
|
||||
return nsRepository::UnregisterFactory(kIEditFactoryIID, path);//this will unregister the factory with the xpcom dll.
|
||||
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);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//END EXPORTS
|
||||
|
||||
@@ -125,10 +125,3 @@ nsTextEditFactory::~nsTextEditFactory()
|
||||
{
|
||||
//nsRepository::UnregisterFactory(mCID, (nsIFactory *)this); //we are out of ref counts anyway
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
|
||||
@@ -121,3 +121,15 @@ nsGuiManagerFactory::~nsGuiManagerFactory()
|
||||
{
|
||||
nsRepository::UnregisterFactory(kIGuiManagerFactoryIID, (nsIFactory *)this); //we are out of ref counts anyway
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* serviceMgr, const char *path)
|
||||
{
|
||||
return nsRepository::RegisterComponent(kIGuiManagerFactoryIID,
|
||||
NULL, NULL, path,
|
||||
PR_TRUE, PR_TRUE);
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
|
||||
{
|
||||
return nsRepository::UnregisterFactory(kIGuiManagerFactoryIID, path);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIPresShellIID, NS_IPRESSHELL_IID);
|
||||
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||
static NS_DEFINE_IID(kIEditFactoryIID, NS_IEDITORFACTORY_IID);
|
||||
static NS_DEFINE_IID(kITextEditFactoryIID, NS_ITEXTEDITORFACTORY_IID);
|
||||
static NS_DEFINE_IID(kIHTMLEditFactoryIID, NS_IHTMLEDITORFACTORY_IID);
|
||||
static NS_DEFINE_IID(kIEditorIID, NS_IEDITOR_IID);
|
||||
static NS_DEFINE_IID(kIEditorSupportIID, NS_IEDITORSUPPORT_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
@@ -168,14 +170,39 @@ NSCanUnload(nsISupports* serviceMgr)
|
||||
extern "C" NS_EXPORT nsresult
|
||||
NSRegisterSelf(nsISupports* serviceMgr, const char *path)
|
||||
{
|
||||
return nsRepository::RegisterComponent(kIEditFactoryIID, NULL, NULL, path,
|
||||
PR_TRUE, PR_TRUE); //this will register the factory with the xpcom dll.
|
||||
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);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult
|
||||
NSUnregisterSelf(nsISupports* serviceMgr, const char *path)
|
||||
{
|
||||
return nsRepository::UnregisterFactory(kIEditFactoryIID, path);//this will unregister the factory with the xpcom dll.
|
||||
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);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//END EXPORTS
|
||||
|
||||
@@ -69,7 +69,7 @@ LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
|
||||
Reference in New Issue
Block a user