[evince/wip/annotation_support: 7/7] pdf: Implement remove_annotation virtual func.
- From: Jose Aliste <jaliste src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/wip/annotation_support: 7/7] pdf: Implement remove_annotation virtual func.
- Date: Wed, 27 Jun 2012 13:01:07 +0000 (UTC)
commit 66414d86f2167e4755ce28383365a6c1dc7d5468
Author: Josà Aliste <jaliste gnome org>
Date: Wed Jun 27 08:59:43 2012 -0400
pdf: Implement remove_annotation virtual func.
backend/pdf/ev-poppler.cc | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index 8209a10..1123d84 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -2899,6 +2899,27 @@ pdf_document_annotations_document_is_modified (EvDocumentAnnotations *document_a
}
static void
+pdf_document_annotations_remove_annotation (EvDocumentAnnotations *document_annotations,
+ EvAnnotation *annot)
+{
+ PopplerPage *poppler_page;
+ PdfDocument *pdf_document;
+ EvPage *page;
+ PopplerAnnot *poppler_annot;
+
+ printf("REMOVE ANNOT 1\n");
+ poppler_annot = POPPLER_ANNOT (g_object_get_data (G_OBJECT (annot), "poppler-annot"));
+ pdf_document = PDF_DOCUMENT (document_annotations);
+ page = ev_annotation_get_page (annot);
+ poppler_page = POPPLER_PAGE (page->backend_page);
+
+ poppler_page_remove_annot (poppler_page, poppler_annot);
+ g_object_unref (poppler_annot);
+
+ pdf_document->annots_modified = TRUE;
+}
+
+static void
pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotations,
EvAnnotation *annot,
EvRectangle *rect)
@@ -3068,6 +3089,7 @@ pdf_document_document_annotations_iface_init (EvDocumentAnnotationsInterface *if
iface->document_is_modified = pdf_document_annotations_document_is_modified;
iface->add_annotation = pdf_document_annotations_add_annotation;
iface->save_annotation = pdf_document_annotations_save_annotation;
+ iface->remove_annotation = pdf_document_annotations_remove_annotation;
}
/* Attachments */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]