summaryrefslogtreecommitdiff
path: root/libdocument
diff options
context:
space:
mode:
Diffstat (limited to 'libdocument')
-rw-r--r--libdocument/ev-document-links.c38
-rw-r--r--libdocument/ev-document-links.h4
2 files changed, 42 insertions, 0 deletions
diff --git a/libdocument/ev-document-links.c b/libdocument/ev-document-links.c
index 1c8eb03e..bd4afb01 100644
--- a/libdocument/ev-document-links.c
+++ b/libdocument/ev-document-links.c
@@ -141,3 +141,41 @@ ev_document_links_get_dest_page_label (EvDocumentLinks *document_links,
return label;
}
+
+static EvLinkDest *
+get_link_dest (EvLink *link)
+{
+ EvLinkAction *action;
+
+ action = ev_link_get_action (link);
+ if (!action)
+ return NULL;
+
+ if (ev_link_action_get_action_type (action) !=
+ EV_LINK_ACTION_TYPE_GOTO_DEST)
+ return NULL;
+
+ return ev_link_action_get_dest (action);
+}
+
+gint
+ev_document_links_get_link_page (EvDocumentLinks *document_links,
+ EvLink *link)
+{
+ EvLinkDest *dest;
+
+ dest = get_link_dest (link);
+
+ return dest ? ev_document_links_get_dest_page (document_links, dest) : -1;
+}
+
+gchar *
+ev_document_links_get_link_page_label (EvDocumentLinks *document_links,
+ EvLink *link)
+{
+ EvLinkDest *dest;
+
+ dest = get_link_dest (link);
+
+ return dest ? ev_document_links_get_dest_page_label (document_links, dest) : NULL;
+}
diff --git a/libdocument/ev-document-links.h b/libdocument/ev-document-links.h
index 75cba6a1..6b561c0e 100644
--- a/libdocument/ev-document-links.h
+++ b/libdocument/ev-document-links.h
@@ -85,6 +85,10 @@ gint ev_document_links_get_dest_page (EvDocumentLinks *document_
EvLinkDest *dest);
gchar *ev_document_links_get_dest_page_label (EvDocumentLinks *document_links,
EvLinkDest *dest);
+gint ev_document_links_get_link_page (EvDocumentLinks *document_links,
+ EvLink *link);
+gchar *ev_document_links_get_link_page_label (EvDocumentLinks *document_links,
+ EvLink *link);
G_END_DECLS