- if (!changed) {
- /* rest the entry to the current page if we were unable to
- * change it */
- gchar *page_label =
- ev_page_cache_get_page_label (page_cache,
- ev_page_cache_get_current_page (page_cache));
- gtk_entry_set_text (GTK_ENTRY (entry), page_label);
- gtk_editable_set_position (GTK_EDITABLE (entry), -1);
- g_free (page_label);
- }
+ g_signal_emit (action, signals[ACTIVATE_LINK], 0, link);
+
+ g_object_unref (link);
+ g_free (link_text);
+
+ /* rest the entry to the current page if we were unable to
+ * change it */
+ page_label = ev_page_cache_get_page_label (page_cache,
+ ev_page_cache_get_current_page (page_cache));
+ gtk_entry_set_text (GTK_ENTRY (entry), page_label);
+ gtk_editable_set_position (GTK_EDITABLE (entry), -1);
+ g_free (page_label);
+}
+
+static gboolean page_scroll_cb(GtkWidget *widget, GdkEventScroll *event, EvPageAction* action)
+{
+ gint pageno;
+
+ pageno = ev_page_cache_get_current_page (action->priv->page_cache);
+ if ((event->direction == GDK_SCROLL_DOWN) &&
+ (pageno < ev_page_cache_get_n_pages(action->priv->page_cache) - 1))
+ pageno++;
+ if ((event->direction == GDK_SCROLL_UP) && (pageno > 0))
+ pageno--;
+ ev_page_cache_set_current_page (action->priv->page_cache, pageno);
+
+ return TRUE;