diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-12-08 01:54:57 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-12-08 01:54:57 +0800 |
commit | c92bf4456143bc5e230bd0153d4bc938b68fddfc (patch) | |
tree | 83b5d68baf5fa04b78b2eb2f1df33562091be071 /embed/mozilla/EphyBrowser.cpp | |
parent | 89e2f69727a24f8667b1daf2341bae55b0567d10 (diff) | |
download | gsoc2013-epiphany-c92bf4456143bc5e230bd0153d4bc938b68fddfc.tar gsoc2013-epiphany-c92bf4456143bc5e230bd0153d4bc938b68fddfc.tar.gz gsoc2013-epiphany-c92bf4456143bc5e230bd0153d4bc938b68fddfc.tar.bz2 gsoc2013-epiphany-c92bf4456143bc5e230bd0153d4bc938b68fddfc.tar.lz gsoc2013-epiphany-c92bf4456143bc5e230bd0153d4bc938b68fddfc.tar.xz gsoc2013-epiphany-c92bf4456143bc5e230bd0153d4bc938b68fddfc.tar.zst gsoc2013-epiphany-c92bf4456143bc5e230bd0153d4bc938b68fddfc.zip |
Add ephy_embed_scroll_pixels.
2005-12-07 Christian Persch <chpe@cvs.gnome.org>
* embed/ephy-embed.c: (ephy_embed_scroll),
(ephy_embed_page_scroll), (ephy_embed_scroll_pixels):
* embed/ephy-embed.h:
* embed/mozilla/EphyBrowser.cpp:
* embed/mozilla/EphyBrowser.h:
* embed/mozilla/mozilla-embed.cpp:
Add ephy_embed_scroll_pixels.
Diffstat (limited to 'embed/mozilla/EphyBrowser.cpp')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index b87fe9bf3..0f49127cf 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -928,9 +928,9 @@ nsresult EphyBrowser::GetZoom (float *aZoom) return mdv->GetTextZoom (aZoom); } -nsresult EphyBrowser::ScrollLines (int aNumLines) +nsresult +EphyBrowser::ScrollLines (PRInt32 aNumLines) { - nsresult rv; nsCOMPtr<nsIDOMWindow> DOMWindow; mWebBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); @@ -938,13 +938,14 @@ nsresult EphyBrowser::ScrollLines (int aNumLines) { DOMWindow = mDOMWindow; } + NS_ENSURE_TRUE (DOMWindow, NS_ERROR_FAILURE); - DOMWindow->ScrollByLines (aNumLines); + return DOMWindow->ScrollByLines (aNumLines); } -nsresult EphyBrowser::ScrollPages (int aNumPages) +nsresult +EphyBrowser::ScrollPages (PRInt32 aNumPages) { - nsresult rv; nsCOMPtr<nsIDOMWindow> DOMWindow; mWebBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); @@ -952,17 +953,35 @@ nsresult EphyBrowser::ScrollPages (int aNumPages) { DOMWindow = mDOMWindow; } + NS_ENSURE_TRUE (DOMWindow, NS_ERROR_FAILURE); - DOMWindow->ScrollByPages (aNumPages); + return DOMWindow->ScrollByPages (aNumPages); } +nsresult +EphyBrowser::ScrollPixels (PRInt32 aDeltaX, + PRInt32 aDeltaY) +{ + nsCOMPtr<nsIDOMWindow> DOMWindow; -nsresult EphyBrowser::GetDocument (nsIDOMDocument **aDOMDocument) + mWebBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); + if (!DOMWindow) + { + DOMWindow = mDOMWindow; + } + NS_ENSURE_TRUE (DOMWindow, NS_ERROR_FAILURE); + + return DOMWindow->ScrollBy (aDeltaX, aDeltaY); +} + +nsresult +EphyBrowser::GetDocument (nsIDOMDocument **aDOMDocument) { return mDOMWindow->GetDocument (aDOMDocument); } -nsresult EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument) +nsresult +EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument) { NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE); |