Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-04-03 00:30:59 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-04-03 00:30:59 (GMT)
commitf91763ca68146b026095915fc0ee380ac23ab9ab (patch)
tree636d8ebd106709f96a3ef7e54e8a919ddce4b256 /backend
parenta4a3a2301361cb6a71e1b127e8e43589f2749105 (diff)
Add support for PDF attachments. Fixes bug #325143
* backend/Makefile.am: * data/evince-ui.xml: * backend/ev-attachment.[ch]: * backend/ev-document.[ch]: (ev_document_has_attachments), (ev_document_get_attachments): * pdf/ev-poppler.cc: (pdf_document_has_attachments), (attachment_save_to_buffer), (pdf_document_get_attachments), (pdf_document_document_iface_init): * shell/Makefile.am: * shell/ev-attachment-bar.[ch]: * shell/ev-window.c: Add support for PDF attachments. Fixes bug #325143
Diffstat (limited to 'backend')
-rw-r--r--backend/Makefile.am2
-rw-r--r--backend/ev-document.c23
-rw-r--r--backend/ev-document.h4
3 files changed, 29 insertions, 0 deletions
diff --git a/backend/Makefile.am b/backend/Makefile.am
index 97f9910..c2adf47 100644
--- a/backend/Makefile.am
+++ b/backend/Makefile.am
@@ -17,6 +17,8 @@ noinst_LTLIBRARIES = libevbackend.la
libevbackend_la_SOURCES= \
ev-async-renderer.c \
ev-async-renderer.h \
+ ev-attachment.c \
+ ev-attachment.h \
ev-backend-marshal.c \
ev-link.c \
ev-link.h \
diff --git a/backend/ev-document.c b/backend/ev-document.c
index a800866..10f1d00 100644
--- a/backend/ev-document.c
+++ b/backend/ev-document.c
@@ -200,7 +200,30 @@ ev_document_get_links (EvDocument *document,
return retval;
}
+gboolean
+ev_document_has_attachments (EvDocument *document)
+{
+ EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
+
+ if (iface->has_attachments == NULL)
+ return FALSE;
+
+ return iface->has_attachments (document);
+}
+
+GList *
+ev_document_get_attachments (EvDocument *document)
+{
+ EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
+ GList *retval;
+ LOG ("ev_document_get_attachments");
+ if (iface->get_attachments == NULL)
+ return NULL;
+ retval = iface->get_attachments (document);
+
+ return retval;
+}
GdkPixbuf *
ev_document_render_pixbuf (EvDocument *document,
diff --git a/backend/ev-document.h b/backend/ev-document.h
index 2cea42f..ce7714c 100644
--- a/backend/ev-document.h
+++ b/backend/ev-document.h
@@ -92,6 +92,8 @@ struct _EvDocumentIface
EvRectangle *rect);
GList * (* get_links) (EvDocument *document,
int page);
+ gboolean (* has_attachments) (EvDocument *document);
+ GList * (* get_attachments) (EvDocument *document);
GdkPixbuf * (* render_pixbuf) (EvDocument *document,
EvRenderContext *rc);
EvDocumentInfo * (* get_info) (EvDocument *document);
@@ -123,6 +125,8 @@ char *ev_document_get_text (EvDocument *document,
EvRectangle *rect);
GList *ev_document_get_links (EvDocument *document,
int page);
+gboolean ev_document_has_attachments (EvDocument *document);
+GList *ev_document_get_attachments (EvDocument *document);
GdkPixbuf *ev_document_render_pixbuf (EvDocument *document,
EvRenderContext *rc);