[epiphany-extensions] ephy-push-scroller: update to recent changes
- From: Xan Lopez <xan src gnome org>
- To: svn-commits-list gnome org
- Subject: [epiphany-extensions] ephy-push-scroller: update to recent changes
- Date: Fri, 24 Jul 2009 06:47:07 +0000 (UTC)
commit b2815a5e87ee55271673f1531b3152dcf9f23169
Author: Xan Lopez <xan gnome org>
Date: Fri Jul 24 09:46:23 2009 +0300
ephy-push-scroller: update to recent changes
The extension won't work at the moment though, since we don't have a
working dom-mouse-down implementation.
.../push-scroller/ephy-push-scroller-extension.c | 15 +++++++-----
extensions/push-scroller/ephy-push-scroller.c | 24 ++++++++-----------
2 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/extensions/push-scroller/ephy-push-scroller-extension.c b/extensions/push-scroller/ephy-push-scroller-extension.c
index a5b409d..d87b653 100644
--- a/extensions/push-scroller/ephy-push-scroller-extension.c
+++ b/extensions/push-scroller/ephy-push-scroller-extension.c
@@ -17,7 +17,6 @@
* 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 "config.h"
@@ -57,19 +56,21 @@ ensure_push_scroller (EphyWindow *window)
}
static gboolean
-dom_mouse_down_cb (EphyEmbed *embed,
+dom_mouse_down_cb (EphyWebView *view,
EphyEmbedEvent *event,
EphyWindow *window)
{
EphyPushScroller *scroller;
+ EphyEmbed *embed;
EphyEmbedEventContext context;
guint button, x, y;
+ embed = gtk_widget_get_parent (GTK_WIDGET (view));
button = ephy_embed_event_get_button (event);
context = ephy_embed_event_get_context (event);
if (button != 2 || (context & EPHY_EMBED_CONTEXT_INPUT) ||
- (context & EPHY_EMBED_CONTEXT_LINK))
+ (context & EPHY_EMBED_CONTEXT_LINK))
{
return FALSE;
}
@@ -99,8 +100,9 @@ impl_attach_tab (EphyExtension *ext,
g_return_if_fail (embed != NULL);
- g_signal_connect_object (embed, "ge-dom-mouse-down",
- G_CALLBACK (dom_mouse_down_cb), window, 0);
+ g_signal_connect_object (EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (embed),
+ "ge-dom-mouse-down",
+ G_CALLBACK (dom_mouse_down_cb), window, 0);
}
static void
@@ -113,7 +115,8 @@ impl_detach_tab (EphyExtension *ext,
g_return_if_fail (embed != NULL);
g_signal_handlers_disconnect_by_func
- (embed, G_CALLBACK (dom_mouse_down_cb), window);
+ (EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (embed)
+ , G_CALLBACK (dom_mouse_down_cb), window);
}
static void
diff --git a/extensions/push-scroller/ephy-push-scroller.c b/extensions/push-scroller/ephy-push-scroller.c
index 9c5c830..63c9add 100644
--- a/extensions/push-scroller/ephy-push-scroller.c
+++ b/extensions/push-scroller/ephy-push-scroller.c
@@ -18,7 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id$
*/
/* this file is based on work of Daniel Erat for galeon 1 */
@@ -71,21 +70,18 @@ ephy_push_scroller_set_window (EphyPushScroller *scroller,
static void
ephy_push_scroller_scroll_pixels (EphyEmbed *embed, int scroll_x, int scroll_y)
{
- GtkWidget *child;
- GtkAdjustment *adj;
- gdouble value;
+ GtkAdjustment *adj;
+ gdouble value;
- child = gtk_bin_get_child (GTK_BIN (embed));
- g_return_if_fail (child);
- g_return_if_fail (GTK_IS_SCROLLED_WINDOW (child));
+ g_return_if_fail (GTK_IS_SCROLLED_WINDOW (embed));
- adj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (child));
- value = gtk_adjustment_get_value (adj);
- gtk_adjustment_set_value (adj, value + scroll_x);
+ adj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (embed));
+ value = gtk_adjustment_get_value (adj);
+ gtk_adjustment_set_value (adj, value + scroll_x);
- adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (child));
- value = gtk_adjustment_get_value (adj);
- gtk_adjustment_set_value (adj, value + scroll_y);
+ adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (embed));
+ value = gtk_adjustment_get_value (adj);
+ gtk_adjustment_set_value (adj, value + scroll_y);
}
static gboolean
@@ -218,7 +214,7 @@ ephy_push_scroller_start (EphyPushScroller *scroller,
priv->start_y = y;
g_signal_connect (priv->window, "motion-notify-event",
- G_CALLBACK (ephy_push_scroller_motion_cb), scroller);
+ G_CALLBACK (ephy_push_scroller_motion_cb), scroller);
g_signal_connect (priv->window, "button-press-event",
G_CALLBACK (ephy_push_scroller_mouse_press_cb), scroller);
g_signal_connect (priv->window, "button-release-event",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]