From 4bb9bc83e2de5cd88fa2e3f81a7da6e7d81cbf99 Mon Sep 17 00:00:00 2001 From: Nickolay V. Shmyrev Date: Sun, 28 Jan 2007 20:43:21 +0000 Subject: Implements another history variant 2007-01-28 Nickolay V. Shmyrev * NOTES: * backend/djvu/djvu-links.c: (djvu_links_get_links_model): * backend/pdf/ev-poppler.cc: * libdocument/ev-document-links.h: * libdocument/ev-link.c: (ev_link_get_page): * libdocument/ev-link.h: * shell/ev-history.c: (ev_history_init), (ev_history_class_init), (ev_history_add_link): * shell/ev-history.h: * shell/ev-navigation-action.c: (activate_menu_item_cb), (new_history_menu_item), (build_menu): * shell/ev-page-cache.c: (ev_page_cache_set_current_page_history): * shell/ev-sidebar-links.c: (create_loading_model), (print_section_cb), (ev_sidebar_links_construct), (fill_page_labels), (update_page_callback_foreach), (update_page_callback), (job_finished_callback): * shell/ev-view.c: (ev_view_handle_link): * shell/ev-window.c: (ev_window_find_chapter), (ev_window_add_history), (view_handle_link_cb), (history_changed_cb): Implements another history variant svn path=/trunk/; revision=2264 --- (limited to 'libdocument') diff --git a/libdocument/ev-document-links.h b/libdocument/ev-document-links.h index 8e8f20a..a9208f4 100644 --- a/libdocument/ev-document-links.h +++ b/libdocument/ev-document-links.h @@ -48,6 +48,7 @@ enum { EV_DOCUMENT_LINKS_COLUMN_MARKUP, EV_DOCUMENT_LINKS_COLUMN_LINK, EV_DOCUMENT_LINKS_COLUMN_EXPAND, + EV_DOCUMENT_LINKS_COLUMN_PAGE_LABEL, EV_DOCUMENT_LINKS_COLUMN_NUM_COLUMNS }; diff --git a/libdocument/ev-link.c b/libdocument/ev-link.c index 8561914..17e4421 100644 --- a/libdocument/ev-link.c +++ b/libdocument/ev-link.c @@ -224,3 +224,23 @@ ev_link_mapping_find (GList *link_mapping, return link; } +gint +ev_link_get_page (EvLink *link) +{ + EvLinkAction *action; + EvLinkDest *dest; + + action = ev_link_get_action (link); + if (!action) + return -1; + + if (ev_link_action_get_action_type (action) != + EV_LINK_ACTION_TYPE_GOTO_DEST) + return -1; + + dest = ev_link_action_get_dest (action); + if (dest) + return ev_link_dest_get_page (dest); + + return -1; +} diff --git a/libdocument/ev-link.h b/libdocument/ev-link.h index b7304de..9bd7f6e 100644 --- a/libdocument/ev-link.h +++ b/libdocument/ev-link.h @@ -43,6 +43,7 @@ EvLink *ev_link_new (const gchar *title, const gchar *ev_link_get_title (EvLink *self); EvLinkAction *ev_link_get_action (EvLink *self); +gint ev_link_get_page (EvLink *link); /* Link Mapping stuff */ typedef struct _EvLinkMapping EvLinkMapping; -- cgit v0.9.1