+2005-09-19 Marco Pesenti Gritti <mpg@redhat.com>
+
+ * shell/ev-page-cache.c:
+ * shell/ev-page-cache.h:
+ * shell/ev-view.c: (ev_view_binding_activated),
+ (ev_view_next_page), (ev_view_previous_page),
+ (ev_sizing_mode_get_type):
+ * shell/ev-view.h:
+ * shell/ev-window.c: (ev_window_cmd_go_previous_page),
+ (ev_window_cmd_go_next_page):
+
+ Move page next/previous functions from page chace to
+ view and change it to move by 2 page steps in dual mode.
+
2005-09-19 Marco Pesenti Gritti <mpg@redhat.com>
* shell/ev-window.c: (update_sidebar_visibility),
return page_cache->page_info;
}
-
-gboolean
-ev_page_cache_next_page (EvPageCache *page_cache)
-{
- g_return_val_if_fail (EV_IS_PAGE_CACHE (page_cache), FALSE);
-
- if (page_cache->current_page >= page_cache->n_pages - 1)
- return FALSE;
-
- ev_page_cache_set_current_page (page_cache, page_cache->current_page + 1);
- return TRUE;
-
-}
-
-gboolean
-ev_page_cache_prev_page (EvPageCache *page_cache)
-{
- g_return_val_if_fail (EV_IS_PAGE_CACHE (page_cache), FALSE);
-
- if (page_cache->current_page <= 0)
- return FALSE;
-
- ev_page_cache_set_current_page (page_cache, page_cache->current_page - 1);
- return TRUE;
-}
-
#define PAGE_CACHE_STRING "ev-page-cache"
EvPageCache *
int page);
gboolean ev_page_cache_set_page_label (EvPageCache *page_cache,
const char *page_label);
-gboolean ev_page_cache_next_page (EvPageCache *page_cache);
-gboolean ev_page_cache_prev_page (EvPageCache *page_cache);
EvPageCache *ev_page_cache_get (EvDocument *document);
if (view->presentation) {
switch (scroll) {
case GTK_SCROLL_STEP_BACKWARD:
- ev_page_cache_prev_page (view->page_cache);
+ ev_view_previous_page (view);
break;
case GTK_SCROLL_STEP_FORWARD:
- ev_page_cache_next_page (view->page_cache);
+ ev_view_next_page (view);
break;
default:
break;
ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
}
+gboolean
+ev_view_next_page (EvView *view)
+{
+ int page;
+
+ g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
+
+ page = ev_page_cache_get_current_page (view->page_cache);
+ page = ev_view_get_dual_page (view) ? page + 2 : page + 1;
+
+ if (page < ev_page_cache_get_n_pages (view->page_cache)) {
+ ev_page_cache_set_current_page (view->page_cache, page);
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+gboolean
+ev_view_previous_page (EvView *view)
+{
+ int page;
+
+ g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
+
+ page = ev_page_cache_get_current_page (view->page_cache);
+ page = ev_view_get_dual_page (view) ? page - 2 : page - 1;
+
+ if (page >= 0) {
+ ev_page_cache_set_current_page (view->page_cache, page);
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
/*** Enum description for usage in signal ***/
GType
}
return etype;
}
-
EvScrollType scroll);
void ev_view_goto_link (EvView *view,
EvLink *link);
+gboolean ev_view_next_page (EvView *view);
+gboolean ev_view_previous_page (EvView *view);
G_END_DECLS
{
g_return_if_fail (EV_IS_WINDOW (ev_window));
- ev_page_cache_prev_page (ev_window->priv->page_cache);
+ ev_view_previous_page (ev_window->priv->view);
}
static void
{
g_return_if_fail (EV_IS_WINDOW (ev_window));
- ev_page_cache_next_page (ev_window->priv->page_cache);
+ ev_view_next_page (ev_window->priv->view);
}
static void