[evince] [libdocument] Add find_link_page method to EvDocumentLinks interface



commit 5e112daa413bb9520a1818b4068fb7e9143043e6
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Fri Sep 3 10:25:46 2010 +0200

    [libdocument] Add find_link_page method to EvDocumentLinks interface
    
    Very often we only need to know the page of a named destination, for
    example when creating the outline. For some backends getting only the
    page is much faster than creating the destination.

 libdocument/ev-document-links.c |   14 ++++++++++++++
 libdocument/ev-document-links.h |    4 ++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/libdocument/ev-document-links.c b/libdocument/ev-document-links.c
index 48dde7f..0cddb40 100644
--- a/libdocument/ev-document-links.c
+++ b/libdocument/ev-document-links.c
@@ -77,6 +77,20 @@ ev_document_links_find_link_dest (EvDocumentLinks *document_links,
 	return retval;
 }
 
+gint
+ev_document_links_find_link_page (EvDocumentLinks *document_links,
+				  const gchar     *link_name)
+{
+	EvDocumentLinksInterface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
+	gint retval;
+
+	ev_document_doc_mutex_lock ();
+	retval = iface->find_link_page (document_links, link_name);
+	ev_document_doc_mutex_unlock ();
+
+	return retval;
+}
+
 /* Helper functions */
 gint
 ev_document_links_get_dest_page (EvDocumentLinks *document_links,
diff --git a/libdocument/ev-document-links.h b/libdocument/ev-document-links.h
index 1c507e7..36fa254 100644
--- a/libdocument/ev-document-links.h
+++ b/libdocument/ev-document-links.h
@@ -67,6 +67,8 @@ struct _EvDocumentLinksInterface
 					       EvPage          *page);
 	EvLinkDest    *(* find_link_dest)     (EvDocumentLinks *document_links,
 					       const gchar     *link_name);
+	gint           (* find_link_page)     (EvDocumentLinks *document_links,
+					       const gchar     *link_name);
 };
 
 GType          ev_document_links_get_type            (void) G_GNUC_CONST;
@@ -77,6 +79,8 @@ EvMappingList *ev_document_links_get_links           (EvDocumentLinks *document_
 						      EvPage          *page);
 EvLinkDest    *ev_document_links_find_link_dest      (EvDocumentLinks *document_links,
 						      const gchar     *link_name);
+gint           ev_document_links_find_link_page      (EvDocumentLinks *document_links,
+						      const gchar     *link_name);
 gint           ev_document_links_get_dest_page       (EvDocumentLinks *document_links,
 						      EvLinkDest      *dest);
 gchar         *ev_document_links_get_dest_page_label (EvDocumentLinks *document_links,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]