Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libdocument
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2009-08-23 16:35:27 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-09-15 13:59:14 (GMT)
commitc218c0fc841709a869f41e538ccf38df4d48d175 (patch)
treef4828bded7a1cddb1cace3a9d568dc48e4563c86 /libdocument
parent34148304a0237fd9fd7c4ea05ca2e053d9ddd3ff (diff)
[libdocument] Add ev_document_get_uri()
Diffstat (limited to 'libdocument')
-rw-r--r--libdocument/ev-document.c16
-rw-r--r--libdocument/ev-document.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c
index 5c63b25..38c12f2 100644
--- a/libdocument/ev-document.c
+++ b/libdocument/ev-document.c
@@ -36,6 +36,8 @@ typedef struct _EvPageSize
struct _EvDocumentPrivate
{
+ gchar *uri;
+
gint n_pages;
gboolean uniform;
@@ -93,6 +95,11 @@ ev_document_finalize (GObject *object)
{
EvDocument *document = EV_DOCUMENT (object);
+ if (document->priv->uri) {
+ g_free (document->priv->uri);
+ document->priv->uri = NULL;
+ }
+
if (document->priv->page_sizes) {
g_free (document->priv->page_sizes);
document->priv->page_sizes = NULL;
@@ -239,6 +246,7 @@ ev_document_load (EvDocument *document,
/* Cache some info about the document to avoid
* going to the backends since it requires locks
*/
+ priv->uri = g_strdup (uri);
priv->n_pages = _ev_document_get_n_pages (document);
priv->info = _ev_document_get_info (document);
@@ -435,6 +443,14 @@ ev_document_render (EvDocument *document,
}
const gchar *
+ev_document_get_uri (EvDocument *document)
+{
+ g_return_val_if_fail (EV_IS_DOCUMENT (document), NULL);
+
+ return document->priv->uri;
+}
+
+const gchar *
ev_document_get_title (EvDocument *document)
{
g_return_val_if_fail (EV_IS_DOCUMENT (document), NULL);
diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h
index 608e90f..32cdc1f 100644
--- a/libdocument/ev-document.h
+++ b/libdocument/ev-document.h
@@ -134,6 +134,7 @@ gchar *ev_document_get_page_label (EvDocument *document,
gint page_index);
cairo_surface_t *ev_document_render (EvDocument *document,
EvRenderContext *rc);
+const gchar *ev_document_get_uri (EvDocument *document);
const gchar *ev_document_get_title (EvDocument *document);
gboolean ev_document_is_page_size_uniform (EvDocument *document);
void ev_document_get_max_page_size (EvDocument *document,