diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-12-15 00:19:40 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-12-15 00:19:40 +0800 |
commit | deab0d1c914913ae0615eec1cd1dc170255275a5 (patch) | |
tree | da652af5a61920e256db92e2aa8a1d22bfebac7d | |
parent | f21911f22afd1bb0838010ac61fe3c3297657098 (diff) | |
download | gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.gz gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.bz2 gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.lz gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.xz gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.tar.zst gsoc2013-epiphany-deab0d1c914913ae0615eec1cd1dc170255275a5.zip |
Adapt to changed mozilla APIs for 1.6. (Ported from HEAD).
2003-12-14 Christian Persch <chpe@cvs.gnome.org>
* NEWS:
* configure.in:
* embed/mozilla/EphyEventListener.cpp:
* embed/mozilla/EphyWrapper.cpp:
* embed/mozilla/EventContext.cpp:
* embed/mozilla/ExternalProtocolService.cpp:
* embed/mozilla/MozRegisterComponents.cpp:
* embed/mozilla/mozilla-embed-persist.cpp:
* embed/mozilla/mozilla-embed-single.cpp:
* src/ephy-window.c: (show_embed_popup):
Adapt to changed mozilla APIs for 1.6. (Ported from HEAD).
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | configure.in | 12 | ||||
-rw-r--r-- | embed/mozilla/EphyEventListener.cpp | 10 | ||||
-rw-r--r-- | embed/mozilla/EphyWrapper.cpp | 17 | ||||
-rw-r--r-- | embed/mozilla/EventContext.cpp | 18 | ||||
-rw-r--r-- | embed/mozilla/ExternalProtocolService.cpp | 6 | ||||
-rw-r--r-- | embed/mozilla/MozRegisterComponents.cpp | 5 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-persist.cpp | 6 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 15 | ||||
-rw-r--r-- | src/ephy-window.c | 6 |
11 files changed, 99 insertions, 15 deletions
@@ -1,5 +1,20 @@ 2003-12-14 Christian Persch <chpe@cvs.gnome.org> + * NEWS: + * configure.in: + * embed/mozilla/EphyEventListener.cpp: + * embed/mozilla/EphyWrapper.cpp: + * embed/mozilla/EventContext.cpp: + * embed/mozilla/ExternalProtocolService.cpp: + * embed/mozilla/MozRegisterComponents.cpp: + * embed/mozilla/mozilla-embed-persist.cpp: + * embed/mozilla/mozilla-embed-single.cpp: + * src/ephy-window.c: (show_embed_popup): + + Adapt to changed mozilla APIs for 1.6. (Ported from HEAD). + +2003-12-14 Christian Persch <chpe@cvs.gnome.org> + * embed/mozilla/PrintingPromptService.cpp: Some more NULL checks. @@ -2,6 +2,10 @@ Epiphany 1.0.7 ============== +Code changes: + + * Support for mozilla 1.6 (ported from HEAD) (Christian) + Bugfixes: * Fix a compiler warning introduced in 1.0.6 (Christian) diff --git a/configure.in b/configure.in index 6514f6ca6..92d6ec9a0 100644 --- a/configure.in +++ b/configure.in @@ -159,14 +159,14 @@ AC_MSG_RESULT($MOZILLA_VERSION$autodetect) case "$MOZILLA_VERSION" in 1.4) MOZILLA_SNAPSHOT=8 ;; 1.4.1) MOZILLA_SNAPSHOT=9 ;; - 1.5a) MOZILLA_SNAPSHOT=10 ;; - 1.5b) MOZILLA_SNAPSHOT=11 ;; - 1.5) MOZILLA_SNAPSHOT=11 ;; - 1.6a) MOZILLA_SNAPSHOT=12 ;; -trunk) MOZILLA_SNAPSHOT=12 ;; +1.4.2) MOZILLA_SNAPSHOT=9 ;; + 1.5) MOZILLA_SNAPSHOT=11 ;; + 1.6b) MOZILLA_SNAPSHOT=13 ;; + 1.6) MOZILLA_SNAPSHOT=13 ;; +trunk) MOZILLA_SNAPSHOT=13 ;; *) AC_ERROR([ ***************************************************************************** -Epiphany can be built using Mozilla 1.4, 1.5a, 1.5b, 1.5 or +Epiphany can be built using Mozilla 1.4, 1.4.1, 1.5, or 1.6 or trunk snapshot, but the version available is $MOZILLA_VERSION. When using Mozilla trunk snapshot, a successful build is not guaranteed due diff --git a/embed/mozilla/EphyEventListener.cpp b/embed/mozilla/EphyEventListener.cpp index de696bf1e..d2fb70864 100644 --- a/embed/mozilla/EphyEventListener.cpp +++ b/embed/mozilla/EphyEventListener.cpp @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <nsCOMPtr.h> #include "EphyEventListener.h" @@ -80,9 +84,15 @@ EphyEventListener::HandleFaviconLink (nsIDOMNode *node) nsCOMPtr<nsIDocument> doc = do_QueryInterface (domDoc); if(!doc) return NS_ERROR_FAILURE; +#if MOZILLA_SNAPSHOT > 11 + nsIURI *uri; + uri = doc->GetDocumentURL (); + if (uri == NULL) return NS_ERROR_FAILURE; +#else nsCOMPtr<nsIURI> uri; result = doc->GetDocumentURL(getter_AddRefs(uri)); if (NS_FAILED (result)) return NS_ERROR_FAILURE; +#endif const nsACString &link = NS_ConvertUCS2toUTF8(value); nsCAutoString favicon_url; diff --git a/embed/mozilla/EphyWrapper.cpp b/embed/mozilla/EphyWrapper.cpp index 63908dc5d..daf1648b6 100644 --- a/embed/mozilla/EphyWrapper.cpp +++ b/embed/mozilla/EphyWrapper.cpp @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "EphyWrapper.h" #include "GlobalHistory.h" #include "ProgressListener.h" @@ -68,6 +72,7 @@ #include "nsIPresContext.h" #include "ContentHandler.h" #include "EphyEventListener.h" +#include "nsPromiseFlatString.h" EphyWrapper::EphyWrapper () { @@ -582,8 +587,13 @@ nsresult EphyWrapper::GetMainDocumentUrl (nsCString &url) nsCOMPtr<nsIDocument> doc = do_QueryInterface(DOMDocument); if(!doc) return NS_ERROR_FAILURE; +#if MOZILLA_SNAPSHOT > 11 + nsIURI *uri; + uri = doc->GetDocumentURL (); +#else nsCOMPtr<nsIURI> uri; doc->GetDocumentURL(getter_AddRefs(uri)); +#endif if (!uri) return NS_ERROR_FAILURE; return uri->GetSpec (url); @@ -601,8 +611,13 @@ nsresult EphyWrapper::GetDocumentUrl (nsCString &url) nsCOMPtr<nsIDocument> doc = do_QueryInterface(DOMDocument); if(!doc) return NS_ERROR_FAILURE; - nsCOMPtr<nsIURI> uri; +#if MOZILLA_SNAPSHOT > 11 + nsIURI *uri; + uri = doc->GetDocumentURL (); +#else + nsCOMPtr<nsIURI> uri; doc->GetDocumentURL(getter_AddRefs(uri)); +#endif if (!uri) return NS_ERROR_FAILURE; return uri->GetSpec (url); diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp index 50539a8d7..dc7e4a415 100644 --- a/embed/mozilla/EventContext.cpp +++ b/embed/mozilla/EventContext.cpp @@ -14,6 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ */ #include "EventContext.h" @@ -139,13 +141,19 @@ nsresult EventContext::GatherTextUnder (nsIDOMNode* aNode, nsString& aResult) nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl, nsACString &url) { nsresult rv; +#if MOZILLA_SNAPSHOT > 11 + nsIURI *base; + base = doc->GetBaseURL (); + if (!base) return NS_ERROR_FAILURE; +#elif MOZILLA_SNAPSHOT > 9 nsCOMPtr<nsIURI> base; -#if MOZILLA_SNAPSHOT > 9 rv = doc->GetBaseURL (getter_AddRefs(base)); + if (NS_FAILED(rv)) return rv; #else + nsCOMPtr<nsIURI> base; rv = doc->GetBaseURL (*getter_AddRefs(base)); -#endif if (NS_FAILED(rv)) return rv; +#endif return base->Resolve (NS_ConvertUCS2toUTF8(relurl), url); } @@ -153,9 +161,15 @@ nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl nsresult EventContext::ResolveDocumentURL (nsIDocument *doc, const nsAString &relurl, nsACString &url) { nsresult rv; +#if MOZILLA_SNAPSHOT > 11 + nsIURI *uri; + uri = doc->GetDocumentURL (); + if (uri == NULL) return NS_ERROR_FAILURE; +#else nsCOMPtr<nsIURI> uri; rv = doc->GetDocumentURL(getter_AddRefs(uri)); if (NS_FAILED(rv)) return rv; +#endif return uri->Resolve (NS_ConvertUCS2toUTF8(relurl), url); } diff --git a/embed/mozilla/ExternalProtocolService.cpp b/embed/mozilla/ExternalProtocolService.cpp index be5dfdee2..f8d9a008c 100644 --- a/embed/mozilla/ExternalProtocolService.cpp +++ b/embed/mozilla/ExternalProtocolService.cpp @@ -17,9 +17,11 @@ */ #ifdef HAVE_CONFIG_H -#include <config.h> +#include "config.h" #endif +#if MOZILLA_SNAPSHOT < 12 + #include <gtk/gtk.h> #include <libgnome/gnome-exec.h> #include <libgnome/gnome-i18n.h> @@ -155,3 +157,5 @@ NS_IMETHODIMP GExternalProtocolService::LoadUrl(nsIURI *aURL) return NS_OK; } + +#endif /* MOZILLA_SNAPSHOT < 12 */ diff --git a/embed/mozilla/MozRegisterComponents.cpp b/embed/mozilla/MozRegisterComponents.cpp index d6e79f697..dd3baf95c 100644 --- a/embed/mozilla/MozRegisterComponents.cpp +++ b/embed/mozilla/MozRegisterComponents.cpp @@ -45,15 +45,20 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(GPrintingPromptService) NS_GENERIC_FACTORY_CONSTRUCTOR(GIRCProtocolHandler) NS_GENERIC_FACTORY_CONSTRUCTOR(GFtpProtocolHandler) NS_GENERIC_FACTORY_CONSTRUCTOR(GNewsProtocolHandler) + +#if MOZILLA_SNAPSHOT < 12 NS_GENERIC_FACTORY_CONSTRUCTOR(GExternalProtocolService) +#endif static const nsModuleComponentInfo sAppComps[] = { +#if MOZILLA_SNAPSHOT < 12 { G_EXTERNALPROTOCOLSERVICE_CLASSNAME, G_EXTERNALPROTOCOLSERVICE_CID, NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, GExternalProtocolServiceConstructor }, +#endif { G_PROGRESSDIALOG_CLASSNAME, G_PROGRESSDIALOG_CID, diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp index 0161086cb..f3117bbc3 100644 --- a/embed/mozilla/mozilla-embed-persist.cpp +++ b/embed/mozilla/mozilla-embed-persist.cpp @@ -254,9 +254,15 @@ impl_save (EphyEmbedPersist *persist) do_QueryInterface (DOMDocument, &rv); if (NS_FAILED(rv) || !document) return G_FAILED; +#if MOZILLA_SNAPSHOT > 11 + nsIURI *uri; + uri = document->GetDocumentURL (); + if (!uri) return G_FAILED; +#else nsCOMPtr<nsIURI> uri; rv = document->GetDocumentURL (getter_AddRefs(uri)); if (NS_FAILED(rv) || !uri) return G_FAILED; +#endif aProgress->InitForPersist (bpersist, parent, uri, file, diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index a38eef3af..cdb26f90d 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -14,10 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ */ #ifdef HAVE_CONFIG_H -#include <config.h> +#include "config.h" #endif #include "glib.h" @@ -49,12 +51,14 @@ #include <nsIFontEnumerator.h> #include <nsISupportsPrimitives.h> #include <nsReadableUtils.h> -#include <nsICookieManager.h> #include <nsIPasswordManager.h> #include <nsIPassword.h> #include <nsICookie.h> -#include <nsCCookieManager.h> #include <nsCPasswordManager.h> +#include <nsICookieManager.h> +#if MOZILLA_SNAPSHOT < 13 +#include <nsCCookieManager.h> +#endif // FIXME: For setting the locale. hopefully gtkmozembed will do itself soon #include <nsIChromeRegistry.h> @@ -553,9 +557,14 @@ getUILang (nsAString& aUILang) return NS_ERROR_FAILURE; } +#if MOZILLA_SNAPSHOT >= 12 + result = localeService->GetLocaleComponentForUserAgent (aUILang); +#else nsXPIDLString uiLang; result = localeService->GetLocaleComponentForUserAgent (getter_Copies(uiLang)); aUILang = uiLang; +#endif + if (NS_FAILED (result)) { g_warning ("Could not determine locale!\n"); diff --git a/src/ephy-window.c b/src/ephy-window.c index b9dc254e5..a010e4689 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1087,10 +1087,12 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event) { popup = "EphyImagePopup"; } -/* else if (context & EMBED_CONTEXT_INPUT) +#if MOZILLA_SNAPSHOT > 12 + else if (context & EMBED_CONTEXT_INPUT) { popup = "EphyInputPopup"; - }*/ + } +#endif else { popup = framed ? "EphyFramedDocumentPopup" : |