summaryrefslogtreecommitdiff
blob: 77afed22934b74e635b2ee7cd0b854a08afbfc47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
diff -ur gluezilla-2.6.orig/configure.ac gluezilla-2.6/configure.ac
--- gluezilla-2.6.orig/configure.ac	2011-03-27 18:51:37.000000000 +0200
+++ gluezilla-2.6/configure.ac	2011-03-27 18:52:45.000000000 +0200
@@ -87,16 +87,23 @@
 
 	if test "x${oldxul}" != xyes ; then
 
-		AC_MSG_CHECKING(Mozilla XPCOM > 1.8)
-		mozilla_xpcom_pcs="libxul-embedding-unstable"
-		for pc in $mozilla_xpcom_pcs; do
-			if $PKG_CONFIG --exists $pc; then
-				AC_MSG_RESULT($pc)
-				mozilla_xpcom=$pc
-				XUL_VERSION=3
-				break;
-			fi
-		done
+		if test -z $mozilla_xpcom; then
+			AC_MSG_CHECKING(Mozilla XPCOM > 1.8)
+			mozilla_xpcom_pcs="libxul-embedding libxul-embedding-unstable"
+			for pc in $mozilla_xpcom_pcs; do
+				if $PKG_CONFIG --exists $pc; then
+					mozilla_xpcom=$pc
+					XUL_VERSION=3
+					version="$(pkg-config --modversion $pc)"
+					minor=`echo "$version" | sed -e 's,\([[0-9]]*\)\..*,\1,'`
+					if test $minor -ge 2; then
+						XUL_VERSION=4
+					fi
+					AC_MSG_RESULT(Found $version)
+					break;
+				fi
+			done
+		fi
 	fi
 
 	if test -z $mozilla_xpcom; then
@@ -121,10 +128,13 @@
 	XPCOM_PKGS="$mozilla_xpcom"
 fi
 
-AM_CONDITIONAL([OLDXUL], [test x$XUL_VERSION = x2])
-
 AC_SUBST(XUL_VERSION)
 
+AM_CONDITIONAL([XUL_4], [test x$XUL_VERSION = x4])
+AM_CONDITIONAL([XUL_3], [test x$XUL_VERSION = x3])
+AM_CONDITIONAL([XUL_2], [test x$XUL_VERSION = x2])
+
+
 AC_ARG_ENABLE([optimize],
 	AC_HELP_STRING([--enable-optimize], [Enable optimizations (-O2)]),
 		[
Sólo en gluezilla-2.6: configure.ac.orig
Sólo en gluezilla-2.6: configure.ac.rej
diff -ur gluezilla-2.6.orig/src/BrowserWindow.cpp gluezilla-2.6/src/BrowserWindow.cpp
--- gluezilla-2.6.orig/src/BrowserWindow.cpp	2011-03-27 18:51:37.000000000 +0200
+++ gluezilla-2.6/src/BrowserWindow.cpp	2011-03-27 18:51:46.000000000 +0200
@@ -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 @@
     nsCOMPtr<nsIFactory> 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 -ur gluezilla-2.6.orig/src/Makefile.am gluezilla-2.6/src/Makefile.am
--- gluezilla-2.6.orig/src/Makefile.am	2011-03-27 18:51:37.000000000 +0200
+++ gluezilla-2.6/src/Makefile.am	2011-03-27 18:51:46.000000000 +0200
@@ -26,7 +26,7 @@
 	gluezilla.h   \
 	FastDelegate.h
 
-if OLDXUL
+if XUL_2
 libgluezilla_la_SOURCES += \
 	gluezilla_nsIScriptContext.h \
 	gluezilla_nsIScriptGlobalObject.h
diff -ur gluezilla-2.6.orig/src/PromptService.h gluezilla-2.6/src/PromptService.h
--- gluezilla-2.6.orig/src/PromptService.h	2011-03-27 18:51:37.000000000 +0200
+++ gluezilla-2.6/src/PromptService.h	2011-03-27 18:51:46.000000000 +0200
@@ -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 -ur gluezilla-2.6.orig/src/SecurityWarningsDialogs.h gluezilla-2.6/src/SecurityWarningsDialogs.h
--- gluezilla-2.6.orig/src/SecurityWarningsDialogs.h	2011-03-27 18:51:37.000000000 +0200
+++ gluezilla-2.6/src/SecurityWarningsDialogs.h	2011-03-27 18:51:46.000000000 +0200
@@ -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 -ur gluezilla-2.6.orig/src/interfaces.h gluezilla-2.6/src/interfaces.h
--- gluezilla-2.6.orig/src/interfaces.h	2011-03-27 18:51:37.000000000 +0200
+++ gluezilla-2.6/src/interfaces.h	2011-03-27 18:51:46.000000000 +0200
@@ -4,7 +4,18 @@
 #define TO_STRING(x) #x
 
 //Gecko Embedding API
+#if XUL_VERSION < 4
 #include <nsEmbedAPI.h>
+#else
+#include <nscore.h>
+#include <nsXPCOM.h>
+#include <nsILocalFile.h>
+#include <nsIDirectoryService.h>
+#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 <nsCOMPtr.h>
@@ -78,8 +89,12 @@
 #include <nsIPromptService.h>
 #include <nsISecurityWarningDialogs.h>
 #include <nsIComponentRegistrar.h>
+#if XUL_VERSION < 4
 #include <nsIGenericFactory.h>
-
+#else
+#include <mozilla/ModuleUtils.h>
+struct nsModuleComponentInfo;
+#endif
 // preferences
 #include <nsIPrefBranch.h>
 #include <nsIPrefService.h>
@@ -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, ())