aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorCrispin Flowerday <gnome@flowerday.cx>2005-12-07 04:10:17 +0800
committerCrispin Flowerday <crispin@src.gnome.org>2005-12-07 04:10:17 +0800
commit89e2f69727a24f8667b1daf2341bae55b0567d10 (patch)
treea69bf24ee33e77fb002695bce9e548a4fb18fa3c /embed/mozilla
parenta02815e758437be9ed36485a6a48b09423c59282 (diff)
downloadgsoc2013-epiphany-89e2f69727a24f8667b1daf2341bae55b0567d10.tar
gsoc2013-epiphany-89e2f69727a24f8667b1daf2341bae55b0567d10.tar.gz
gsoc2013-epiphany-89e2f69727a24f8667b1daf2341bae55b0567d10.tar.bz2
gsoc2013-epiphany-89e2f69727a24f8667b1daf2341bae55b0567d10.tar.lz
gsoc2013-epiphany-89e2f69727a24f8667b1daf2341bae55b0567d10.tar.xz
gsoc2013-epiphany-89e2f69727a24f8667b1daf2341bae55b0567d10.tar.zst
gsoc2013-epiphany-89e2f69727a24f8667b1daf2341bae55b0567d10.zip
Forward up/down/page up/page down from the findbar entry to the embed.
2005-12-06 Crispin Flowerday <gnome@flowerday.cx> * embed/ephy-embed.c: (ephy_embed_scroll), (ephy_embed_page_scroll): * embed/ephy-embed.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: * src/ephy-find-toolbar.c: (entry_key_press_event_cb): Forward up/down/page up/page down from the findbar entry to the embed.
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/EphyBrowser.cpp29
-rw-r--r--embed/mozilla/EphyBrowser.h3
-rw-r--r--embed/mozilla/mozilla-embed.cpp18
3 files changed, 50 insertions, 0 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index 7bfda8bcc..b87fe9bf3 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -928,6 +928,35 @@ nsresult EphyBrowser::GetZoom (float *aZoom)
return mdv->GetTextZoom (aZoom);
}
+nsresult EphyBrowser::ScrollLines (int aNumLines)
+{
+ nsresult rv;
+ nsCOMPtr<nsIDOMWindow> DOMWindow;
+
+ mWebBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow));
+ if (!DOMWindow)
+ {
+ DOMWindow = mDOMWindow;
+ }
+
+ DOMWindow->ScrollByLines (aNumLines);
+}
+
+nsresult EphyBrowser::ScrollPages (int aNumPages)
+{
+ nsresult rv;
+ nsCOMPtr<nsIDOMWindow> DOMWindow;
+
+ mWebBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow));
+ if (!DOMWindow)
+ {
+ DOMWindow = mDOMWindow;
+ }
+
+ DOMWindow->ScrollByPages (aNumPages);
+}
+
+
nsresult EphyBrowser::GetDocument (nsIDOMDocument **aDOMDocument)
{
return mDOMWindow->GetDocument (aDOMDocument);
diff --git a/embed/mozilla/EphyBrowser.h b/embed/mozilla/EphyBrowser.h
index c21aac103..56058718b 100644
--- a/embed/mozilla/EphyBrowser.h
+++ b/embed/mozilla/EphyBrowser.h
@@ -147,6 +147,9 @@ public:
nsresult SetZoom (float aTextZoom);
nsresult GetZoom (float *aTextZoom);
+ nsresult ScrollLines (int aNumLines);
+ nsresult ScrollPages (int aNumPages);
+
nsresult Print ();
nsresult SetPrintPreviewMode (PRBool previewMode);
nsresult PrintPreviewNumPages (int *numPages);
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index daeb19eaf..17797f6e3 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -652,6 +652,22 @@ impl_get_zoom (EphyEmbed *embed)
return 1.0;
}
+static void
+impl_scroll (EphyEmbed *embed, int num_lines)
+{
+ MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv;
+
+ mpriv->browser->ScrollLines (num_lines);
+}
+
+static void
+impl_page_scroll (EphyEmbed *embed, int num_pages)
+{
+ MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv;
+
+ mpriv->browser->ScrollPages (num_pages);
+}
+
static int
impl_shistory_n_items (EphyEmbed *embed)
{
@@ -1181,6 +1197,8 @@ ephy_embed_iface_init (EphyEmbedIface *iface)
iface->reload = impl_reload;
iface->set_zoom = impl_set_zoom;
iface->get_zoom = impl_get_zoom;
+ iface->scroll = impl_scroll;
+ iface->page_scroll = impl_page_scroll;
iface->shistory_n_items = impl_shistory_n_items;
iface->shistory_get_nth = impl_shistory_get_nth;
iface->shistory_get_pos = impl_shistory_get_pos;