epiphany r8282 - trunk/embed/webkit
- From: atoker svn gnome org
- To: svn-commits-list gnome org
- Subject: epiphany r8282 - trunk/embed/webkit
- Date: Tue, 17 Jun 2008 12:14:38 +0000 (UTC)
Author: atoker
Date: Tue Jun 17 12:14:38 2008
New Revision: 8282
URL: http://svn.gnome.org/viewvc/epiphany?rev=8282&view=rev
Log:
Emit zoom change signal and implement pixel scrolling
Modified:
trunk/embed/webkit/webkit-embed.c
Modified: trunk/embed/webkit/webkit-embed.c
==============================================================================
--- trunk/embed/webkit/webkit-embed.c (original)
+++ trunk/embed/webkit/webkit-embed.c Tue Jun 17 12:14:38 2008
@@ -65,6 +65,7 @@
struct WebKitEmbedPrivate
{
WebKitWebView *web_view;
+ GtkScrolledWindow *scrolled_window;
WebKitEmbedLoadState load_state;
char *loading_uri;
EphyHistory *history;
@@ -298,6 +299,7 @@
embed->priv = WEBKIT_EMBED_GET_PRIVATE (embed);
sw = gtk_scrolled_window_new (NULL, NULL);
+ embed->priv->scrolled_window = GTK_SCROLLED_WINDOW (sw);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -443,7 +445,10 @@
impl_set_zoom (EphyEmbed *embed,
float zoom)
{
+ g_return_if_fail (zoom > 0.0);
+
g_object_set (WEBKIT_EMBED (embed)->priv->web_view, "zoom-level", zoom, NULL);
+ g_signal_emit_by_name (embed, "ge_zoom_change", zoom);
}
static void
@@ -463,6 +468,18 @@
int dx,
int dy)
{
+ GtkAdjustment *hadj;
+ GtkAdjustment *vadj;
+ WebKitEmbed *wembed = WEBKIT_EMBED (embed);
+
+ hadj = gtk_scrolled_window_get_hadjustment (wembed->priv->scrolled_window);
+ vadj = gtk_scrolled_window_get_vadjustment (wembed->priv->scrolled_window);
+
+ hadj->value += dx;
+ vadj->value += dy;
+
+ gtk_adjustment_value_changed (hadj);
+ gtk_adjustment_value_changed (vadj);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]