diff options
author | Perberos <[email protected]> | 2011-11-09 18:17:43 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2011-11-09 18:17:43 -0300 |
commit | f6ce926719943751cf65cacde7fae050593eb2d6 (patch) | |
tree | 9224d1751678cf2d1fbd0431f128b711311c0287 /libdocument/ev-document-annotations.c | |
download | atril-f6ce926719943751cf65cacde7fae050593eb2d6.tar.bz2 atril-f6ce926719943751cf65cacde7fae050593eb2d6.tar.xz |
inicial
Diffstat (limited to 'libdocument/ev-document-annotations.c')
-rw-r--r-- | libdocument/ev-document-annotations.c | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/libdocument/ev-document-annotations.c b/libdocument/ev-document-annotations.c new file mode 100644 index 00000000..f153f3eb --- /dev/null +++ b/libdocument/ev-document-annotations.c @@ -0,0 +1,75 @@ +/* ev-document-annotations.c + * this file is part of evince, a mate document viewer + * + * Copyright (C) 2009 Carlos Garcia Campos <[email protected]> + * Copyright (C) 2007 IƱigo Martinez <[email protected]> + * + * Evince is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Evince is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "ev-document-annotations.h" + +G_DEFINE_INTERFACE (EvDocumentAnnotations, ev_document_annotations, 0) + +static void +ev_document_annotations_default_init (EvDocumentAnnotationsInterface *klass) +{ +} + +EvMappingList * +ev_document_annotations_get_annotations (EvDocumentAnnotations *document_annots, + EvPage *page) +{ + EvDocumentAnnotationsInterface *iface = EV_DOCUMENT_ANNOTATIONS_GET_IFACE (document_annots); + + return iface->get_annotations (document_annots, page); +} + +gboolean +ev_document_annotations_document_is_modified (EvDocumentAnnotations *document_annots) +{ + EvDocumentAnnotationsInterface *iface = EV_DOCUMENT_ANNOTATIONS_GET_IFACE (document_annots); + + return (iface->document_is_modified) ? iface->document_is_modified (document_annots) : FALSE; +} + +void +ev_document_annotations_save_annotation (EvDocumentAnnotations *document_annots, + EvAnnotation *annot, + EvAnnotationsSaveMask mask) +{ + EvDocumentAnnotationsInterface *iface = EV_DOCUMENT_ANNOTATIONS_GET_IFACE (document_annots); + + iface->save_annotation (document_annots, annot, mask); +} + +void +ev_document_annotations_add_annotation (EvDocumentAnnotations *document_annots, + EvAnnotation *annot, + EvRectangle *rect) +{ + EvDocumentAnnotationsInterface *iface = EV_DOCUMENT_ANNOTATIONS_GET_IFACE (document_annots); + + if (iface->add_annotation) + iface->add_annotation (document_annots, annot, rect); +} + +gboolean +ev_document_annotations_can_add_annotation (EvDocumentAnnotations *document_annots) +{ + EvDocumentAnnotationsInterface *iface = EV_DOCUMENT_ANNOTATIONS_GET_IFACE (document_annots); + + return iface->add_annotation != NULL; +} |