diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | embed/ephy-history.h | 3 | ||||
-rw-r--r-- | embed/mozilla/GlobalHistory.cpp | 41 |
3 files changed, 44 insertions, 7 deletions
@@ -1,5 +1,12 @@ 2005-09-05 Christian Persch <chpe@cvs.gnome.org> + * embed/mozilla/GlobalHistory.cpp: + * embed/ephy-history.h: + + Implement [SG]etGeckoURIFlags for gecko 1.9. + +2005-09-05 Christian Persch <chpe@cvs.gnome.org> + * embed/mozilla/EphyUtils.cpp: Mozilla printing code is braindead. Bug #163255. diff --git a/embed/ephy-history.h b/embed/ephy-history.h index fcaf7d039..ef4b62d1e 100644 --- a/embed/ephy-history.h +++ b/embed/ephy-history.h @@ -48,7 +48,8 @@ enum EPHY_NODE_PAGE_PROP_HOST_ID = 7, EPHY_NODE_PAGE_PROP_PRIORITY = 8, EPHY_NODE_PAGE_PROP_ICON = 9, - EPHY_NODE_HOST_PROP_ZOOM = 10 + EPHY_NODE_HOST_PROP_ZOOM = 10, + EPHY_NODE_PAGE_PROP_GECKO_FLAGS = 11 }; struct _EphyHistory diff --git a/embed/mozilla/GlobalHistory.cpp b/embed/mozilla/GlobalHistory.cpp index 27d71b9ab..90b65c020 100644 --- a/embed/mozilla/GlobalHistory.cpp +++ b/embed/mozilla/GlobalHistory.cpp @@ -129,17 +129,46 @@ NS_IMETHODIMP MozGlobalHistory::SetPageTitle(nsIURI *aURI, const nsAString & aTi #ifdef HAVE_GECKO_1_9 /* unsigned long getURIGeckoFlags(in nsIURI aURI); */ NS_IMETHODIMP -GlobalHistory::GetURIGeckoFlags(nsIURI *aURI, PRUint32* aFlags) +MozGlobalHistory::GetURIGeckoFlags(nsIURI *aURI, PRUint32* aFlags) { -#error Implement me! - return NS_ERROR_NOT_IMPLEMENTED: + nsEmbedCString spec; + aURI->GetSpec(spec); + + EphyNode *page = ephy_history_get_page (mGlobalHistory, spec.get()); + + GValue value = { 0, }; + if (page != NULL && + ephy_node_get_property (page, EPHY_NODE_PAGE_PROP_GECKO_FLAGS, &value)) + { + *aFlags = (PRUint32) (gulong) g_value_get_long (&value); + g_value_unset (&value); + + return NS_OK; + } + + return NS_ERROR_FAILURE; } /* void setURIGeckoFlags(in nsIURI aURI, in unsigned long aFlags); */ NS_IMETHODIMP -GlobalHistory::SetURIGeckoFlags(nsIURI *aURI, PRUint32 aFlags) +MozGlobalHistory::SetURIGeckoFlags(nsIURI *aURI, PRUint32 aFlags) { -#error Implement me! - return NS_ERROR_NOT_IMPLEMENTED: + nsEmbedCString spec; + aURI->GetSpec(spec); + + EphyNode *page = ephy_history_get_page (mGlobalHistory, spec.get()); + if (page != NULL) + { + GValue value = { 0, }; + + g_value_init (&value, G_TYPE_LONG); + g_value_set_long (&value, (long) (gulong) aFlags); + ephy_node_set_property (page, EPHY_NODE_PAGE_PROP_GECKO_FLAGS, &value); + g_value_unset (&value); + + return NS_OK; + } + + return NS_ERROR_FAILURE; } #endif /* HAVE_GECKO_1_9 */ |