[epiphany-extensions] Update some extensions to new APIs.
- From: Xan Lopez <xan src gnome org>
- To: svn-commits-list gnome org
- Subject: [epiphany-extensions] Update some extensions to new APIs.
- Date: Tue, 9 Jun 2009 13:37:36 -0400 (EDT)
commit ac221340ca048bbf51f39b3be282167abd0b2366
Author: Xan Lopez <xan gnome org>
Date: Tue Jun 9 20:36:51 2009 +0300
Update some extensions to new APIs.
---
extensions/actions/ephy-actions-extension.c | 2 +-
.../greasemonkey/ephy-greasemonkey-extension.c | 3 +-
extensions/push-scroller/ephy-push-scroller.c | 22 +++++++++++++++++++-
extensions/tab-states/ephy-tab-states-extension.c | 4 +-
4 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/extensions/actions/ephy-actions-extension.c b/extensions/actions/ephy-actions-extension.c
index 05cf203..b141e13 100644
--- a/extensions/actions/ephy-actions-extension.c
+++ b/extensions/actions/ephy-actions-extension.c
@@ -497,7 +497,7 @@ ephy_actions_extension_document_popup_cb (GtkAction *action,
}
embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
- url = ephy_embed_get_location (embed, TRUE);
+ url = ephy_web_view_get_location (EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (embed), TRUE);
ephy_actions_extension_run_action (action, window, url);
g_free (url);
}
diff --git a/extensions/greasemonkey/ephy-greasemonkey-extension.c b/extensions/greasemonkey/ephy-greasemonkey-extension.c
index 1cc386c..a34a9c4 100644
--- a/extensions/greasemonkey/ephy-greasemonkey-extension.c
+++ b/extensions/greasemonkey/ephy-greasemonkey-extension.c
@@ -339,8 +339,7 @@ ephy_greasemonkey_extension_install_cb (GtkAction *action,
LOG ("Installing script at '%s'", url);
- persist = EPHY_EMBED_PERSIST
- (ephy_embed_factory_new_object (EPHY_TYPE_EMBED_PERSIST));
+ persist = g_object_new (EPHY_TYPE_EMBED_PERSIST, NULL);
ephy_embed_persist_set_source (persist, url);
ephy_embed_persist_set_embed (persist, embed);
diff --git a/extensions/push-scroller/ephy-push-scroller.c b/extensions/push-scroller/ephy-push-scroller.c
index f44dda4..9c5c830 100644
--- a/extensions/push-scroller/ephy-push-scroller.c
+++ b/extensions/push-scroller/ephy-push-scroller.c
@@ -68,6 +68,26 @@ ephy_push_scroller_set_window (EphyPushScroller *scroller,
priv->window = window;
}
+static void
+ephy_push_scroller_scroll_pixels (EphyEmbed *embed, int scroll_x, int scroll_y)
+{
+ GtkWidget *child;
+ 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));
+
+ 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_vadjustment (GTK_SCROLLED_WINDOW (child));
+ value = gtk_adjustment_get_value (adj);
+ gtk_adjustment_set_value (adj, value + scroll_y);
+}
+
static gboolean
ephy_push_scroller_motion_cb (GtkWidget *widget,
GdkEventMotion *event,
@@ -88,7 +108,7 @@ ephy_push_scroller_motion_cb (GtkWidget *widget,
y_dist_abs = abs (y_dist);
/* scroll */
- ephy_embed_scroll_pixels (priv->embed, x_dist, y_dist);
+ ephy_push_scroller_scroll_pixels (priv->embed, x_dist, y_dist);
priv->start_x = event->x_root;
priv->start_y = event->y_root;
diff --git a/extensions/tab-states/ephy-tab-states-extension.c b/extensions/tab-states/ephy-tab-states-extension.c
index 4eab72f..ce09279 100644
--- a/extensions/tab-states/ephy-tab-states-extension.c
+++ b/extensions/tab-states/ephy-tab-states-extension.c
@@ -173,7 +173,7 @@ sync_active_tab (EphyWindow *window,
active_tab = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
- if (ephy_embed_get_load_status (active_tab) == FALSE)
+ if (ephy_web_view_get_load_status (EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (active_tab)) == FALSE)
{
/* mark the tab as read */
label = get_real_tab_label (window, active_tab);
@@ -201,7 +201,7 @@ sync_load_status (EphyEmbed *tab,
window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab)));
g_return_if_fail (window != NULL);
- loading = ephy_embed_get_load_status (tab);
+ loading = ephy_web_view_get_load_status (EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (tab));
if (loading)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]