]> git.pld-linux.org Git - packages/kazehakase.git/blob - kazehakase-libxul.patch
- release 7
[packages/kazehakase.git] / kazehakase-libxul.patch
1 diff -ur kazehakase-0.5.5.orig/macros/gecko.m4 kazehakase-0.5.5/macros/gecko.m4
2 --- kazehakase-0.5.5.orig/macros/gecko.m4       2008-07-29 16:15:29.000000000 +0200
3 +++ kazehakase-0.5.5/macros/gecko.m4    2008-07-30 10:38:30.000000000 +0200
4 @@ -290,9 +290,6 @@
5    
6    MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $GECKO_MODULE`"
7    mozilla_include_type="`$PKG_CONFIG --variable=includetype $GECKO_MODULE`"
8 -  if test x"$mozilla_include_type" = "xunstable"; then
9 -    MOZILLA_INCLUDE_ROOT="$MOZILLA_INCLUDE_ROOT/unstable"
10 -  fi
11    AC_SUBST(MOZILLA_INCLUDE_ROOT)
12    
13    MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $GECKO_MODULE`"
14 diff -ur kazehakase-0.5.5.orig/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp kazehakase-0.5.5/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp
15 --- kazehakase-0.5.5.orig/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp       2008-07-29 16:15:30.000000000 +0200
16 +++ kazehakase-0.5.5/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp    2008-07-30 10:38:30.000000000 +0200
17 @@ -306,26 +306,6 @@
18          rv = EnsureProfileFileExists(localFile, domainDir);
19      }
20    }
21 -  else if (strcmp(prop, NS_APP_MAIL_50_DIR) == 0) {
22 -    rv = domainDir->Clone(getter_AddRefs(localFile));
23 -    if (NS_SUCCEEDED(rv))
24 -      rv = localFile->AppendNative(MAIL_DIR_50_NAME);
25 -  }
26 -  else if (strcmp(prop, NS_APP_IMAP_MAIL_50_DIR) == 0) {
27 -    rv = domainDir->Clone(getter_AddRefs(localFile));
28 -    if (NS_SUCCEEDED(rv))
29 -      rv = localFile->AppendNative(IMAP_MAIL_DIR_50_NAME);
30 -  }
31 -  else if (strcmp(prop, NS_APP_NEWS_50_DIR) == 0) {
32 -    rv = domainDir->Clone(getter_AddRefs(localFile));
33 -    if (NS_SUCCEEDED(rv))
34 -      rv = localFile->AppendNative(NEWS_DIR_50_NAME);
35 -  }
36 -  else if (strcmp(prop, NS_APP_MESSENGER_FOLDER_CACHE_50_DIR) == 0) {
37 -    rv = domainDir->Clone(getter_AddRefs(localFile));
38 -    if (NS_SUCCEEDED(rv))
39 -      rv = localFile->AppendNative(MSG_FOLDER_CACHE_DIR_50_NAME);
40 -  }
41    else if (strcmp(prop, NS_APP_STORAGE_50_FILE) == 0) {
42      rv = domainDir->Clone(getter_AddRefs(localFile));
43      if (NS_SUCCEEDED(rv))
44 @@ -518,10 +498,6 @@
45    (void) directoryService->Undefine(NS_APP_BOOKMARKS_50_FILE);
46    (void) directoryService->Undefine(NS_APP_DOWNLOADS_50_FILE);
47    (void) directoryService->Undefine(NS_APP_SEARCH_50_FILE);
48 -  (void) directoryService->Undefine(NS_APP_MAIL_50_DIR);
49 -  (void) directoryService->Undefine(NS_APP_IMAP_MAIL_50_DIR);
50 -  (void) directoryService->Undefine(NS_APP_NEWS_50_DIR);
51 -  (void) directoryService->Undefine(NS_APP_MESSENGER_FOLDER_CACHE_50_DIR);
52  
53    return NS_OK;
54  }
55 diff -urN kazehakase-0.5.5.orig/ext/ruby/Makefile.am kazehakase-0.5.5/ext/ruby/Makefile.am
56 --- kazehakase-0.5.5.orig/ext/ruby/Makefile.am  2008-07-29 17:15:31.000000000 +0300
57 +++ kazehakase-0.5.5/ext/ruby/Makefile.am       2008-08-11 02:22:57.000000000 +0300
58 @@ -8,7 +8,6 @@
59         -DG_DISABLE_DEPRECATED=1
60  
61  INCLUDES =                                             \
62 -       $(MOZILLA_COMPONENT_CFLAGS)                     \
63         $(GTK_CFLAGS)                                   \
64         $(LIBGNUTLS_CFLAGS)                             \
65         $(RUBY_CFLAGS)                                  \
66 @@ -63,5 +62,4 @@
67         $(GTK_LIBS)                             \
68         $(LIBGNUTLS_LIBS)                       \
69         $(RUBY_LIBS)                            \
70 -       $(MOZILLA_COMPONENT_LIBS)               \
71         $(top_builddir)/src/libkazehakase.la
72 diff -urN kazehakase-0.5.5.orig/ext/ruby/Makefile.in kazehakase-0.5.5/ext/ruby/Makefile.in
73 --- kazehakase-0.5.5.orig/ext/ruby/Makefile.in  2008-07-29 17:21:39.000000000 +0300
74 +++ kazehakase-0.5.5/ext/ruby/Makefile.in       2008-08-11 02:22:57.000000000 +0300
75 @@ -306,7 +306,6 @@
76  top_srcdir = @top_srcdir@
77  ext_LTLIBRARIES = ruby.la
78  INCLUDES = \
79 -       $(MOZILLA_COMPONENT_CFLAGS)                     \
80         $(GTK_CFLAGS)                                   \
81         $(LIBGNUTLS_CFLAGS)                             \
82         $(RUBY_CFLAGS)                                  \
83 @@ -354,7 +353,6 @@
84         $(GTK_LIBS)                             \
85         $(LIBGNUTLS_LIBS)                       \
86         $(RUBY_LIBS)                            \
87 -       $(MOZILLA_COMPONENT_LIBS)               \
88         $(top_builddir)/src/libkazehakase.la
89  
90  all: all-am
91 diff -urN kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.cpp kazehakase-0.5.5/module/embed/gecko/GtkPromptService.cpp
92 --- kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.cpp       2008-07-29 17:15:30.000000000 +0300
93 +++ kazehakase-0.5.5/module/embed/gecko/GtkPromptService.cpp    2008-08-11 02:22:57.000000000 +0300
94 @@ -36,6 +36,7 @@
95   *
96   * ***** END LICENSE BLOCK ***** */
97  
98 +#include "config.h"
99  #include "GtkPromptService.h"
100  #include <nsIWindowWatcher.h>
101  #include <nsIWebBrowserChrome.h>
102 @@ -49,6 +50,23 @@
103  #include <nsIDOMCharacterData.h>
104  #include <nsIDOMText.h>
105  #include <nsMemory.h>
106 +#ifdef HAVE_GECKO_1_9
107 +#include <nsIAuthInformation.h>
108 +#include <nsIStringBundle.h>
109 +#include <nsServiceManagerUtils.h>
110 +/* That is ugly but I didn't find another way, except including
111 + * NS_GetAuthHostPort */
112 +#define kNotFound -1
113 +NS_COM void AppendUTF16toUTF8( const nsAString& aSource, nsACString& aDest );
114 +#include <nsStringAPI.h>
115 +#include <nsIProxiedChannel.h>
116 +#include <nsIProxyInfo.h>
117 +#include <nsIIDNService.h>
118 +#include <nsNetCID.h>
119 +#include <nsIURI.h>
120 +#include <nsNetUtil.h>
121 +#include <nsPromptUtils.h>
122 +#endif
123  
124  #include <glib/gi18n.h>
125  #include "kz-prompt-dialog.h"
126 @@ -89,8 +107,11 @@
127  {
128  }
129  
130 -
131 +#ifdef HAVE_GECKO_1_9
132 +NS_IMPL_ISUPPORTS2(GtkPromptService, nsIPromptService, nsIPromptService2)
133 +#else
134  NS_IMPL_ISUPPORTS1(GtkPromptService, nsIPromptService)
135 +#endif
136  
137  NS_IMETHODIMP
138  GtkPromptService::Alert(nsIDOMWindow* aParent, const PRUnichar* aDialogTitle, 
139 @@ -338,10 +359,12 @@
140         KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
141                                                         (TYPE_PROMPT_USER_PASS,
142                                                          GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
143 +#ifndef HAVE_GECKO_1_9
144         gchar *host = GetURIForDOMWindow(aParent);
145         kz_prompt_dialog_set_host (prompt, host);
146         if (host)
147                 g_free(host);
148 +#endif
149         kz_prompt_dialog_set_title(prompt,
150                                    aDialogTitle ? cTitle.get() : _("Prompt"));
151         kz_prompt_dialog_set_message_text(prompt, cText.get());
152 @@ -391,10 +414,12 @@
153         KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
154                                                         (TYPE_PROMPT_PASS,
155                                                          GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
156 +#ifndef HAVE_GECKO_1_9
157         gchar *host = GetURIForDOMWindow(aParent);
158         kz_prompt_dialog_set_host (prompt, host);
159         if (host)
160                 g_free(host);
161 +#endif
162         kz_prompt_dialog_set_title(prompt,
163                                    aDialogTitle ? cTitle.get() : _("Prompt"));
164         kz_prompt_dialog_set_message_text(prompt, cText.get());
165 @@ -510,3 +535,147 @@
166         NS_UTF16ToCString(uri, NS_CSTRING_ENCODING_UTF8, c_uri);
167         return g_strdup(c_uri.get());
168  }
169 +
170 +#ifdef HAVE_GECKO_1_9
171 +static nsresult
172 +MakeDialogText(nsIChannel* aChannel, nsIAuthInformation* aAuthInfo,
173 +               nsString& message)
174 +{
175 +  nsresult rv;
176 +  nsCOMPtr<nsIStringBundleService> bundleSvc =
177 +    do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
178 +  NS_ENSURE_SUCCESS(rv, rv);
179 +
180 +  nsCOMPtr<nsIStringBundle> bundle;
181 +  rv = bundleSvc->CreateBundle("chrome://global/locale/prompts.properties",
182 +                               getter_AddRefs(bundle));
183 +  NS_ENSURE_SUCCESS(rv, rv);
184 +
185 +  // figure out what message to display...
186 +  nsCAutoString host;
187 +  PRInt32 port;
188 +  NS_GetAuthHostPort(aChannel, aAuthInfo, PR_FALSE, host, &port);
189 +
190 +  nsAutoString displayHost;
191 +  CopyUTF8toUTF16(host, displayHost);
192 +
193 +  nsCOMPtr<nsIURI> uri;
194 +  aChannel->GetURI(getter_AddRefs(uri));
195 +
196 +  nsCAutoString scheme;
197 +  uri->GetScheme(scheme);
198 +
199 +  nsAutoString username;
200 +  aAuthInfo->GetUsername(username);
201 +
202 +  PRUint32 flags;
203 +  aAuthInfo->GetFlags(&flags);
204 +  PRBool proxyAuth = (flags & nsIAuthInformation::AUTH_PROXY) != 0;
205 +
206 +  nsAutoString realm;
207 +  aAuthInfo->GetRealm(realm);
208 +
209 +  // Append the port if it was specified
210 +  if (port != -1) {
211 +    displayHost.Append(PRUnichar(':'));
212 +    displayHost.AppendInt(port);
213 +  }
214 +
215 +  NS_NAMED_LITERAL_STRING(proxyText, "EnterLoginForProxy");
216 +  NS_NAMED_LITERAL_STRING(originText, "EnterLoginForRealm");
217 +  NS_NAMED_LITERAL_STRING(noRealmText, "EnterUserPasswordFor");
218 +  NS_NAMED_LITERAL_STRING(passwordText, "EnterPasswordFor");
219 +
220 +  const PRUnichar *text;
221 +  if (proxyAuth) {
222 +    text = proxyText.get();
223 +  } else {
224 +    text = originText.get();
225 +
226 +    // prepend "scheme://"
227 +    nsAutoString schemeU;
228 +    CopyASCIItoUTF16(scheme, schemeU);
229 +    schemeU.AppendLiteral("://");
230 +    displayHost.Insert(schemeU, 0);
231 +  }
232 +
233 +  const PRUnichar *strings[] = { realm.get(), displayHost.get() };
234 +  PRUint32 count = NS_ARRAY_LENGTH(strings);
235 +
236 +  if (flags & nsIAuthInformation::ONLY_PASSWORD) {
237 +    text = passwordText.get();
238 +    strings[0] = username.get();
239 +  } else if (!proxyAuth && realm.IsEmpty()) {
240 +    text = noRealmText.get();
241 +    count--;
242 +    strings[0] = strings[1];
243 +  }
244 +
245 +  rv = bundle->FormatStringFromName(text, strings, count, getter_Copies(message));
246 +  return rv;
247 +}
248 +
249 +NS_METHOD
250 +GtkPromptService::PromptAuth(nsIDOMWindow *aParent,
251 +                              nsIChannel *aChannel,
252 +                              PRUint32 level,
253 +                              nsIAuthInformation *authInfo,
254 +                              const PRUnichar *checkboxLabel,
255 +                              PRBool *checkValue,
256 +                              PRBool *retval)
257 +{
258 +       NS_ENSURE_ARG_POINTER (retval);
259 +       NS_ENSURE_ARG_POINTER (authInfo);
260 +
261 +  nsString message;
262 +  MakeDialogText(aChannel, authInfo, message);
263 +
264 +  nsAutoString defaultUser, defaultDomain, defaultPass;
265 +  authInfo->GetUsername(defaultUser);
266 +  authInfo->GetDomain(defaultDomain);
267 +  authInfo->GetPassword(defaultPass);
268 +
269 +  PRUint32 flags;
270 +  authInfo->GetFlags(&flags);
271 +
272 +  if ((flags & nsIAuthInformation::NEED_DOMAIN) && !defaultDomain.IsEmpty()) {
273 +    defaultDomain.Append(PRUnichar('\\'));
274 +    defaultUser.Insert(defaultDomain, 0);
275 +  }
276 +
277 +  // NOTE: Allocation failure is not fatal here (just default to empty string
278 +  // if allocation fails)
279 +  PRUnichar *user = ToNewUnicode(defaultUser),
280 +    *pass = ToNewUnicode(defaultPass);
281 +  nsresult rv;
282 +  if (flags & nsIAuthInformation::ONLY_PASSWORD)
283 +    rv = PromptPassword(aParent, nsnull, message.get(),
284 +                                  &pass, checkboxLabel,
285 +                                  checkValue, retval);
286 +  else
287 +    rv = PromptUsernameAndPassword(aParent, nsnull, message.get(),
288 +                                             &user, &pass, checkboxLabel,
289 +                                             checkValue, retval);
290 +
291 +  nsString userStr(user);
292 +  nsString passStr(pass);
293 +  authInfo->SetUsername(userStr);
294 +  authInfo->SetPassword(passStr);
295 +
296 +  return rv;
297 +}
298 +
299 +NS_METHOD GtkPromptService::AsyncPromptAuth(nsIDOMWindow *aParent,
300 +                                            nsIChannel *aChannel,
301 +                                            nsIAuthPromptCallback *aCallback,
302 +                                            nsISupports *aContext,
303 +                                            PRUint32 level,
304 +                                            nsIAuthInformation *authInfo,
305 +                                            const PRUnichar *checkboxLabel,
306 +                                            PRBool *checkValue,
307 +                                            nsICancelable **retval)
308 +{
309 +  return NS_ERROR_NOT_IMPLEMENTED;
310 +}
311 +
312 +#endif
313 diff -urN kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.h kazehakase-0.5.5/module/embed/gecko/GtkPromptService.h
314 --- kazehakase-0.5.5.orig/module/embed/gecko/GtkPromptService.h 2008-07-29 17:15:30.000000000 +0300
315 +++ kazehakase-0.5.5/module/embed/gecko/GtkPromptService.h      2008-08-11 02:22:57.000000000 +0300
316 @@ -37,7 +37,11 @@
317   *
318   * ***** END LICENSE BLOCK ***** */
319  
320 +#ifdef HAVE_GECKO_1_9
321 +#include <nsIPromptService2.h>
322 +#else
323  #include <nsIPromptService.h>
324 +#endif
325  #include <gtk/gtk.h>
326  
327  #define NS_PROMPTSERVICE_CID \
328 @@ -45,7 +49,12 @@
329  
330  class nsIDOMWindow;
331  
332 -class GtkPromptService : public nsIPromptService
333 +class GtkPromptService :
334 +#ifdef HAVE_GECKO_1_9
335 +       public nsIPromptService2
336 +#else
337 +       public nsIPromptService
338 +#endif
339  {
340  public:
341         GtkPromptService();
342 @@ -53,6 +62,9 @@
343  
344         NS_DECL_ISUPPORTS
345         NS_DECL_NSIPROMPTSERVICE
346 +#ifdef HAVE_GECKO_1_9
347 +       NS_DECL_NSIPROMPTSERVICE2
348 +#endif
349  
350  private:
351         const char *GetButtonLabel(PRUint32 aFlags, PRUint32 aPos,
352 diff -urN kazehakase-0.5.5.orig/module/embed/gecko/kz-mozutils.h kazehakase-0.5.5/module/embed/gecko/kz-mozutils.h
353 --- kazehakase-0.5.5.orig/module/embed/gecko/kz-mozutils.h      2008-07-29 17:15:30.000000000 +0300
354 +++ kazehakase-0.5.5/module/embed/gecko/kz-mozutils.h   2008-08-11 02:22:57.000000000 +0300
355 @@ -49,6 +49,8 @@
356   * The following functions is taken from include/necko/nsNetUtils.h in mozilla
357   */
358  
359 +#ifndef nsNetUtil_h__
360 +
361  inline nsresult
362  GetIOService (nsIIOService **ioService)
363  {
364 @@ -245,6 +247,6 @@
365  
366    return resultBuffer;
367  }
368 -
369 +#endif
370  
371  #endif /* __KZ_MOZ_UTILS_H__ */
This page took 0.046938 seconds and 3 git commands to generate.