diff --git a/src/BrowserWindow.cpp b/src/BrowserWindow.cpp index f260295..10ae7bd 100755 --- a/src/BrowserWindow.cpp +++ b/src/BrowserWindow.cpp @@ -28,23 +28,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(SecurityWarningDialogs) NS_GENERIC_FACTORY_CONSTRUCTOR(PromptService) -static const nsModuleComponentInfo components[] = { - { - SECURITYWARNINGSDIALOGS_CLASSNAME, - SECURITYWARNINGSDIALOGS_CID, - NS_SECURITYWARNINGDIALOGS_CONTRACTID, - SecurityWarningDialogsConstructor - }, - { - PROMPTSERVICE_CLASSNAME, - PROMPTSERVICE_CID, - NS_PROMPTSERVICE_CONTRACTID, - PromptServiceConstructor - } - -}; - - BrowserWindow::BrowserWindow (void) { owner = nsnull; @@ -162,17 +145,17 @@ nsresult BrowserWindow::RegisterComponents () nsCOMPtr componentFactory; rv = NS_NewSecurityWarningServiceFactory(getter_AddRefs(componentFactory)); if (NS_SUCCEEDED(rv)) { - compReg->RegisterFactory(components[0].mCID, - components[0].mDescription, - components[0].mContractID, + compReg->RegisterFactory(kSECURITYWARNINGSDIALOGS_CID, + SECURITYWARNINGSDIALOGS_CLASSNAME, + NS_SECURITYWARNINGDIALOGS_CONTRACTID, componentFactory); } rv = NS_NewPromptServiceFactory(getter_AddRefs(componentFactory), this); if (NS_SUCCEEDED(rv)) { - compReg->RegisterFactory(components[1].mCID, - components[1].mDescription, - components[1].mContractID, + compReg->RegisterFactory(kPROMPTSERVICE_CID, + PROMPTSERVICE_CLASSNAME, + NS_PROMPTSERVICE_CONTRACTID, componentFactory); } diff --git a/src/Makefile.am b/src/Makefile.am index 3b7bce3..cd6ec99 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ libgluezilla_la_SOURCES = \ gluezilla.h \ FastDelegate.h -if OLDXUL +if XUL_2 libgluezilla_la_SOURCES += \ gluezilla_nsIScriptContext.h \ gluezilla_nsIScriptGlobalObject.h diff --git a/src/PromptService.h b/src/PromptService.h index 04fddb9..174bca4 100644 --- a/src/PromptService.h +++ b/src/PromptService.h @@ -20,8 +20,9 @@ // {77686174-2061-6d20-6920-746F20646F20} #define PROMPTSERVICE_CID \ { 0x77686174, 0x2061, 0x6d20, { 0x69, 0x20, 0x74, 0x6F, 0x20, 0x64, 0x6F, 0x20 } } - - + +static NS_DEFINE_CID(kPROMPTSERVICE_CID, PROMPTSERVICE_CID); + class PromptService : public nsIPromptService { NS_DECL_ISUPPORTS diff --git a/src/SecurityWarningsDialogs.h b/src/SecurityWarningsDialogs.h index b75f529..ae352ad 100644 --- a/src/SecurityWarningsDialogs.h +++ b/src/SecurityWarningsDialogs.h @@ -21,8 +21,9 @@ // {696E7465-7265-7374-696E-67206C696665} #define SECURITYWARNINGSDIALOGS_CID \ { 0x696E7465, 0x7265, 0x7374, { 0x69, 0x6E, 0x67, 0x20, 0x6C, 0x69, 0x66, 0x65 } } - - + +static NS_DEFINE_CID(kSECURITYWARNINGSDIALOGS_CID, SECURITYWARNINGSDIALOGS_CID); + class SecurityWarningDialogs : public nsISecurityWarningDialogs { public: diff --git a/src/interfaces.h b/src/interfaces.h index 3a9f9dd..6acebb8 100644 --- a/src/interfaces.h +++ b/src/interfaces.h @@ -4,7 +4,18 @@ #define TO_STRING(x) #x //Gecko Embedding API +#if XUL_VERSION < 4 #include +#else +#include +#include +#include +#include +#define NS_GRE_COMPONENT_DIR "GreComsD" +#define NS_XPCOM_COMPONENT_DIR "ComsD" +#define NS_XPCOM_COMPONENT_REGISTRY_FILE "ComRegF" +#define NS_XPCOM_XPTI_REGISTRY_FILE "XptiRegF" +#endif //XPCOM API #include @@ -78,8 +89,12 @@ #include #include #include +#if XUL_VERSION < 4 #include - +#else +#include +struct nsModuleComponentInfo; +#endif // preferences #include #include @@ -131,12 +146,15 @@ typedef type (NS_FROZENCALL * name##Type) params; \ extern name##Type name NS_HIDDEN; +#if XUL_VERSION < 4 XRE_API(nsresult, XRE_InitEmbedding, (nsILocalFile *aLibXULDirectory, nsILocalFile *aAppDirectory, nsIDirectoryServiceProvider *aAppDirProvider, nsStaticModuleInfo const *aStaticComponents, PRUint32 aStaticComponentCount)) +#endif + XRE_API(void, XRE_TermEmbedding, ())