Bug Summary

File:backend/pdf/ev-poppler.cc
Warning:line 2978, column 3
Value stored to 'list' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name ev-poppler.cc -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/backend/pdf -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -I ../.. -I ../.. -I ../../libdocument -D CAFELOCALEDIR="/usr/share/locale" -D LECTOR_COMPILATION -I /usr/include/cairo -I /usr/include/libpng16 -I /usr/include/freetype2 -I /usr/include/pixman-1 -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -D CDK_MULTIHEAD_SAFE -D CTK_MULTIHEAD_SAFE -I /usr/include/poppler/glib -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/cairo -I /usr/include/libpng16 -I /usr/include/freetype2 -I /usr/include/pixman-1 -I /usr/include/poppler -I /usr/include/libxml2 -D PIC -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/backward -internal-isystem /usr/lib/llvm-16/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir=/rootdir/backend/pdf -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-02-17-123548-54190-1 -x c++ ev-poppler.cc
1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2/* this file is part of lector, a cafe document viewer
3 *
4 * Copyright (C) 2009, Juanjo Marín <juanj.marin@juntadeandalucia.es>
5 * Copyright (C) 2004, Red Hat, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21
22#include "config.h"
23
24#include <math.h>
25#include <string.h>
26#include <ctk/ctk.h>
27#include <poppler.h>
28#include <poppler-document.h>
29#include <poppler-page.h>
30#ifdef HAVE_CAIRO_PDF1
31#include <cairo-pdf.h>
32#endif
33#ifdef HAVE_CAIRO_PS1
34#include <cairo-ps.h>
35#endif
36#include <glib/gi18n-lib.h>
37
38#include "ev-poppler.h"
39#include "ev-file-exporter.h"
40#include "ev-document-find.h"
41#include "ev-document-misc.h"
42#include "ev-document-links.h"
43#include "ev-document-images.h"
44#include "ev-document-fonts.h"
45#include "ev-document-security.h"
46#include "ev-document-thumbnails.h"
47#include "ev-document-transition.h"
48#include "ev-document-forms.h"
49#include "ev-document-layers.h"
50#include "ev-document-print.h"
51#include "ev-document-annotations.h"
52#include "ev-document-attachments.h"
53#include "ev-document-text.h"
54#include "ev-selection.h"
55#include "ev-transition-effect.h"
56#include "ev-attachment.h"
57#include "ev-image.h"
58
59#include <libxml/tree.h>
60#include <libxml/parser.h>
61#include <libxml/xpath.h>
62#include <libxml/xpathInternals.h>
63
64#if (defined (HAVE_CAIRO_PDF1) || defined (HAVE_CAIRO_PS1))
65#define HAVE_CAIRO_PRINT
66#endif
67
68/* fields from the XMP Rights Management Schema, XMP Specification Sept 2005, pag. 45 */
69#define LICENSE_MARKED"/x:xmpmeta/rdf:RDF/rdf:Description/xmpRights:Marked" "/x:xmpmeta/rdf:RDF/rdf:Description/xmpRights:Marked"
70#define LICENSE_TEXT"/x:xmpmeta/rdf:RDF/rdf:Description/dc:rights/rdf:Alt/rdf:li[lang('%s')]" "/x:xmpmeta/rdf:RDF/rdf:Description/dc:rights/rdf:Alt/rdf:li[lang('%s')]"
71#define LICENSE_WEB_STATEMENT"/x:xmpmeta/rdf:RDF/rdf:Description/xmpRights:WebStatement" "/x:xmpmeta/rdf:RDF/rdf:Description/xmpRights:WebStatement"
72/* license field from Creative Commons schema, http://creativecommons.org/ns */
73#define LICENSE_URI"/x:xmpmeta/rdf:RDF/rdf:Description/cc:license/@rdf:resource" "/x:xmpmeta/rdf:RDF/rdf:Description/cc:license/@rdf:resource"
74
75typedef struct {
76 EvFileExporterFormat format;
77
78 /* Pages per sheet */
79 gint pages_per_sheet;
80 gint pages_printed;
81 gint pages_x;
82 gint pages_y;
83 gdouble paper_width;
84 gdouble paper_height;
85
86#ifdef HAVE_CAIRO_PRINT
87 cairo_t *cr;
88#else
89 PopplerPSFile *ps_file;
90#endif
91} PdfPrintContext;
92
93struct _PdfDocumentClass
94{
95 EvDocumentClass parent_class;
96};
97
98struct _PdfDocument
99{
100 EvDocument parent_instance;
101
102 PopplerDocument *document;
103 gchar *password;
104 gboolean forms_modified;
105 gboolean annots_modified;
106
107 PopplerFontInfo *font_info;
108 PopplerFontsIter *fonts_iter;
109 int fonts_scanned_pages;
110
111 PdfPrintContext *print_ctx;
112
113 GHashTable *annots;
114};
115
116static void pdf_document_security_iface_init (EvDocumentSecurityInterface *iface);
117static void pdf_document_document_thumbnails_iface_init (EvDocumentThumbnailsInterface *iface);
118static void pdf_document_document_links_iface_init (EvDocumentLinksInterface *iface);
119static void pdf_document_document_images_iface_init (EvDocumentImagesInterface *iface);
120static void pdf_document_document_forms_iface_init (EvDocumentFormsInterface *iface);
121static void pdf_document_document_fonts_iface_init (EvDocumentFontsInterface *iface);
122static void pdf_document_document_layers_iface_init (EvDocumentLayersInterface *iface);
123static void pdf_document_document_print_iface_init (EvDocumentPrintInterface *iface);
124static void pdf_document_document_annotations_iface_init (EvDocumentAnnotationsInterface *iface);
125static void pdf_document_document_attachments_iface_init (EvDocumentAttachmentsInterface *iface);
126static void pdf_document_find_iface_init (EvDocumentFindInterface *iface);
127static void pdf_document_file_exporter_iface_init (EvFileExporterInterface *iface);
128static void pdf_selection_iface_init (EvSelectionInterface *iface);
129static void pdf_document_page_transition_iface_init (EvDocumentTransitionInterface *iface);
130static void pdf_document_text_iface_init (EvDocumentTextInterface *iface);
131static void pdf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document_thumbnails,
132 EvRenderContext *rc,
133 gint *width,
134 gint *height);
135static int pdf_document_get_n_pages (EvDocument *document);
136
137static EvLinkDest *ev_link_dest_from_dest (PdfDocument *pdf_document,
138 PopplerDest *dest);
139static EvLink *ev_link_from_action (PdfDocument *pdf_document,
140 PopplerAction *action);
141static void pdf_print_context_free (PdfPrintContext *ctx);
142static gboolean attachment_save_to_buffer (PopplerAttachment *attachment,
143 gchar **buffer,
144 gsize *buffer_size,
145 GError **error);
146
147EV_BACKEND_REGISTER_WITH_CODE (PdfDocument, pdf_document,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
148 {static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
149 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_SECURITY,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
150 pdf_document_security_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
151 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
152 pdf_document_document_thumbnails_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
153 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_LINKS,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
154 pdf_document_document_links_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
155 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_IMAGES,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
156 pdf_document_document_images_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
157 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FORMS,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
158 pdf_document_document_forms_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
159 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FONTS,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
160 pdf_document_document_fonts_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
161 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_LAYERS,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
162 pdf_document_document_layers_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
163 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_PRINT,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
164 pdf_document_document_print_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
165 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_ANNOTATIONS,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
166 pdf_document_document_annotations_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
167 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_ATTACHMENTS,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
168 pdf_document_document_attachments_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
169 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_FIND,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
170 pdf_document_find_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
171 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_FILE_EXPORTER,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
172 pdf_document_file_exporter_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
173 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_SELECTION,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
174 pdf_selection_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
175 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_TRANSITION,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
176 pdf_document_page_transition_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
177 EV_BACKEND_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_TEXT,static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
178 pdf_document_text_iface_init);static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
179 })static GType g_define_type_id = 0; GType pdf_document_get_type
(void) { return g_define_type_id; } static void pdf_document_init
(PdfDocument *self); static void pdf_document_class_init (PdfDocumentClass
*klass); static gpointer pdf_document_parent_class = __null;
static void pdf_document_class_intern_init (gpointer klass) {
pdf_document_parent_class = g_type_class_peek_parent (klass)
; pdf_document_class_init ((PdfDocumentClass *) klass); } __attribute__
((visibility("default"))) GType register_lector_backend (GTypeModule
*module) { const GTypeInfo our_info = { sizeof (PdfDocumentClass
), __null, __null, (GClassInitFunc) pdf_document_class_intern_init
, __null, __null, sizeof (PdfDocument), 0, (GInstanceInitFunc
) pdf_document_init }; bindtextdomain ("lector", "/usr/share/locale"
); bind_textdomain_codeset ("lector", "UTF-8"); g_define_type_id
= g_type_module_register_type (module, (ev_document_get_type
()), "PdfDocument", &our_info, (GTypeFlags)0); { { const
GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc
) pdf_document_security_iface_init, __null, __null }; g_type_module_add_interface
(module, g_define_type_id, (ev_document_security_get_type ()
), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_document_thumbnails_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_thumbnails_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_links_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_links_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_images_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_images_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_forms_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_forms_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_fonts_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_fonts_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_layers_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_layers_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_print_iface_init, __null
, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_print_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_annotations_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_annotations_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_document_attachments_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_attachments_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_find_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_find_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_file_exporter_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_file_exporter_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_selection_iface_init, __null, __null }
; g_type_module_add_interface (module, g_define_type_id, (ev_selection_get_type
()), &g_implement_interface_info); }; { const GInterfaceInfo
g_implement_interface_info = { (GInterfaceInitFunc) pdf_document_page_transition_iface_init
, __null, __null }; g_type_module_add_interface (module, g_define_type_id
, (ev_document_transition_get_type ()), &g_implement_interface_info
); }; { const GInterfaceInfo g_implement_interface_info = { (
GInterfaceInitFunc) pdf_document_text_iface_init, __null, __null
}; g_type_module_add_interface (module, g_define_type_id, (ev_document_text_get_type
()), &g_implement_interface_info); }; } return g_define_type_id
; }
;
180
181static void
182pdf_document_dispose (GObject *object)
183{
184 PdfDocument *pdf_document = PDF_DOCUMENT(object)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((object)), ((pdf_document_get_type ()))))))
;
185
186 if (pdf_document->print_ctx) {
187 pdf_print_context_free (pdf_document->print_ctx);
188 pdf_document->print_ctx = NULL__null;
189 }
190
191 if (pdf_document->annots) {
192 g_hash_table_destroy (pdf_document->annots);
193 pdf_document->annots = NULL__null;
194 }
195
196 if (pdf_document->document) {
197 g_object_unref (pdf_document->document);
198 }
199
200 if (pdf_document->font_info) {
201 poppler_font_info_free (pdf_document->font_info);
202 }
203
204 if (pdf_document->fonts_iter) {
205 poppler_fonts_iter_free (pdf_document->fonts_iter);
206 }
207
208 G_OBJECT_CLASS (pdf_document_parent_class)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((pdf_document_parent_class)), (((GType) ((20) << (2
))))))))
->dispose (object);
209}
210
211static void
212pdf_document_init (PdfDocument *pdf_document)
213{
214 pdf_document->password = NULL__null;
215}
216
217static void
218convert_error (GError *poppler_error,
219 GError **error)
220{
221 if (poppler_error == NULL__null)
222 return;
223
224 if (poppler_error->domain == POPPLER_ERRORpoppler_error_quark()) {
225 /* convert poppler errors into EvDocument errors */
226 gint code = EV_DOCUMENT_ERROR_INVALID;
227 if (poppler_error->code == POPPLER_ERROR_INVALID)
228 code = EV_DOCUMENT_ERROR_INVALID;
229 else if (poppler_error->code == POPPLER_ERROR_ENCRYPTED)
230 code = EV_DOCUMENT_ERROR_ENCRYPTED;
231
232 g_set_error_literal (error,
233 EV_DOCUMENT_ERRORev_document_error_quark (),
234 code,
235 poppler_error->message);
236
237 g_error_free (poppler_error);
238 } else {
239 g_propagate_error (error, poppler_error);
240 }
241}
242
243
244/* EvDocument */
245static gboolean
246pdf_document_save (EvDocument *document,
247 const char *uri,
248 GError **error)
249{
250 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
251 gboolean retval;
252 GError *poppler_error = NULL__null;
253
254 if (pdf_document->forms_modified || pdf_document->annots_modified) {
255 retval = poppler_document_save (pdf_document->document,
256 uri, &poppler_error);
257 if (retval) {
258 pdf_document->forms_modified = FALSE(0);
259 pdf_document->annots_modified = FALSE(0);
260 }
261 } else {
262 retval = poppler_document_save_a_copy (pdf_document->document,
263 uri, &poppler_error);
264 }
265
266 if (! retval)
267 convert_error (poppler_error, error);
268
269 return retval;
270}
271
272static gboolean
273pdf_document_load (EvDocument *document,
274 const char *uri,
275 GError **error)
276{
277 GError *poppler_error = NULL__null;
278 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
279
280 pdf_document->document =
281 poppler_document_new_from_file (uri, pdf_document->password, &poppler_error);
282
283 if (pdf_document->document == NULL__null) {
284 convert_error (poppler_error, error);
285 return FALSE(0);
286 }
287
288 return TRUE(!(0));
289}
290
291static int
292pdf_document_get_n_pages (EvDocument *document)
293{
294 return poppler_document_get_n_pages (PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->document);
295}
296
297static EvPage *
298pdf_document_get_page (EvDocument *document,
299 gint index)
300{
301 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
302 PopplerPage *poppler_page;
303 EvPage *page;
304
305 poppler_page = poppler_document_get_page (pdf_document->document, index);
306 page = ev_page_new (index);
307 page->backend_page = (EvBackendPage)g_object_ref (poppler_page)((typename std::remove_reference<decltype (poppler_page)>
::type) (g_object_ref) (poppler_page))
;
308 page->backend_destroy_func = (EvBackendPageDestroyFunc)g_object_unref;
309 g_object_unref (poppler_page);
310
311 return page;
312}
313
314static void
315pdf_document_get_page_size (EvDocument *document,
316 EvPage *page,
317 double *width,
318 double *height)
319{
320 g_return_if_fail (POPPLER_IS_PAGE (page->backend_page))do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return; } } while (0)
;
321
322 poppler_page_get_size (POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
, width, height);
323}
324
325static char *
326pdf_document_get_page_label (EvDocument *document,
327 EvPage *page)
328{
329 char *label = NULL__null;
330
331 g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return (__null); } } while (0)
;
332
333 g_object_get (G_OBJECT (page->backend_page)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), (((GType) ((20) << (2))))
))))
,
334 "label", &label,
335 NULL__null);
336 return label;
337}
338
339static cairo_surface_t *
340pdf_page_render (PopplerPage *page,
341 gint width,
342 gint height,
343 EvRenderContext *rc)
344{
345 cairo_surface_t *surface;
346 cairo_t *cr;
347
348 surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
349 width, height);
350 cr = cairo_create (surface);
351
352 switch (rc->rotation) {
353 case 90:
354 cairo_translate (cr, width, 0);
355 break;
356 case 180:
357 cairo_translate (cr, width, height);
358 break;
359 case 270:
360 cairo_translate (cr, 0, height);
361 break;
362 default:
363 cairo_translate (cr, 0, 0);
364 }
365 cairo_scale (cr, rc->scale, rc->scale);
366 cairo_rotate (cr, rc->rotation * G_PI3.1415926535897932384626433832795028841971693993751 / 180.0);
367 poppler_page_render (page, cr);
368
369 cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER);
370 cairo_set_source_rgb (cr, 1., 1., 1.);
371 cairo_paint (cr);
372
373 cairo_destroy (cr);
374
375 return surface;
376}
377
378static cairo_surface_t *
379pdf_document_render (EvDocument *document,
380 EvRenderContext *rc)
381{
382 PopplerPage *poppler_page;
383 double width_points, height_points;
384 gint width, height;
385
386 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
387
388 poppler_page_get_size (poppler_page,
389 &width_points, &height_points);
390
391 if (rc->rotation == 90 || rc->rotation == 270) {
392 width = (int) ((height_points * rc->scale) + 0.5);
393 height = (int) ((width_points * rc->scale) + 0.5);
394 } else {
395 width = (int) ((width_points * rc->scale) + 0.5);
396 height = (int) ((height_points * rc->scale) + 0.5);
397 }
398
399 return pdf_page_render (poppler_page,
400 width, height, rc);
401}
402
403/* reference:
404http://www.pdfa.org/lib/exe/fetch.php?id=pdfa%3Aen%3Atechdoc&cache=cache&media=pdfa:techdoc:tn0001_pdfa-1_and_namespaces_2008-03-18.pdf */
405static char *
406pdf_document_get_format_from_metadata (xmlDocPtr doc,
407 xmlXPathContextPtr xpathCtx)
408{
409 xmlXPathObjectPtr xpathObj;
410 xmlChar *part = NULL__null;
411 xmlChar *conf = NULL__null;
412 char *result = NULL__null;
413 int i;
414
415 /* add pdf/a namespaces */
416 xmlXPathRegisterNs (xpathCtx, BAD_CAST(xmlChar *) "x", BAD_CAST(xmlChar *) "adobe:ns:meta/");
417 xmlXPathRegisterNs (xpathCtx, BAD_CAST(xmlChar *) "rdf", BAD_CAST(xmlChar *) "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
418 xmlXPathRegisterNs (xpathCtx, BAD_CAST(xmlChar *) "pdfaid", BAD_CAST(xmlChar *) "http://www.aiim.org/pdfa/ns/id/");
419
420 /* reads pdf/a part */
421 /* first syntax: child node */
422 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) "/x:xmpmeta/rdf:RDF/rdf:Description/pdfaid:part", xpathCtx);
423 if (xpathObj != NULL__null) {
424 if (xpathObj->nodesetval != NULL__null && xpathObj->nodesetval->nodeNr != 0)
425 part = xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
426
427 xmlXPathFreeObject (xpathObj);
428 }
429 if (part == NULL__null) {
430 /* second syntax: attribute */
431 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) "/x:xmpmeta/rdf:RDF/rdf:Description/@pdfaid:part", xpathCtx);
432 if (xpathObj != NULL__null) {
433 if (xpathObj->nodesetval != NULL__null && xpathObj->nodesetval->nodeNr != 0)
434 part = xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
435
436 xmlXPathFreeObject (xpathObj);
437 }
438 }
439
440 /* reads pdf/a conformance */
441 /* first syntax: child node */
442 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) "/x:xmpmeta/rdf:RDF/rdf:Description/pdfaid:conformance", xpathCtx);
443 if (xpathObj != NULL__null) {
444 if (xpathObj->nodesetval != NULL__null && xpathObj->nodesetval->nodeNr != 0)
445 conf = xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
446
447 xmlXPathFreeObject (xpathObj);
448 }
449 if (conf == NULL__null) {
450 /* second syntax: attribute */
451 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) "/x:xmpmeta/rdf:RDF/rdf:Description/@pdfaid:conformance", xpathCtx);
452 if (xpathObj != NULL__null) {
453 if (xpathObj->nodesetval != NULL__null && xpathObj->nodesetval->nodeNr != 0)
454 conf = xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
455
456 xmlXPathFreeObject (xpathObj);
457 }
458 }
459
460 if (part != NULL__null && conf != NULL__null) {
461 /* makes conf lowercase */
462 for (i = 0; conf[i]; i++)
463 conf[i] = g_ascii_tolower (conf[i]);
464
465 /* return buffer */
466 result = g_strdup_printf ("PDF/A - %s%s", part, conf);
467 }
468
469 /* Cleanup */
470 xmlFree (part);
471 xmlFree (conf);
472
473 return result;
474}
475
476static EvDocumentLicense *
477pdf_document_get_license_from_metadata (xmlDocPtr doc,
478 xmlXPathContextPtr xpathCtx)
479{
480 xmlXPathObjectPtr xpathObj;
481 xmlChar *marked = NULL__null;
482 const char *language_string;
483 char *aux;
484 gchar **tags;
485 gchar *tag, *tag_aux;
486 int i, j;
487 EvDocumentLicense *license;
488
489 /* register namespaces */
490 xmlXPathRegisterNs (xpathCtx, BAD_CAST(xmlChar *) "x", BAD_CAST(xmlChar *) "adobe:ns:meta/");
491 xmlXPathRegisterNs (xpathCtx, BAD_CAST(xmlChar *) "rdf", BAD_CAST(xmlChar *) "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
492 xmlXPathRegisterNs (xpathCtx, BAD_CAST(xmlChar *) "dc", BAD_CAST(xmlChar *) "http://purl.org/dc/elements/1.1/");
493 /* XMP Rights Management Schema */
494 xmlXPathRegisterNs (xpathCtx, BAD_CAST(xmlChar *) "xmpRights", BAD_CAST(xmlChar *) "http://ns.adobe.com/xap/1.0/rights/");
495 /* Creative Commons Schema */
496 xmlXPathRegisterNs (xpathCtx, BAD_CAST(xmlChar *) "cc", BAD_CAST(xmlChar *) "http://creativecommons.org/ns#");
497
498 /* checking if the document has been marked as defined on the XMP Rights
499 * Management Schema */
500 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) LICENSE_MARKED"/x:xmpmeta/rdf:RDF/rdf:Description/xmpRights:Marked", xpathCtx);
501 if (xpathObj != NULL__null) {
502 if (xpathObj->nodesetval != NULL__null &&
503 xpathObj->nodesetval->nodeNr != 0)
504 marked = xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
505 xmlXPathFreeObject (xpathObj);
506 }
507
508 /* a) Not marked => No XMP Rights information */
509 if (!marked) {
510 xmlFree (marked);
511 return NULL__null;
512 }
513
514 license = ev_document_license_new ();
515
516 /* b) Marked False => Public Domain, no copyrighted material and no
517 * license needed */
518 if (g_strrstr ((char *) marked, "False") != NULL__null) {
519 license->text = g_strdup (_("This work is in the Public Domain"))g_strdup_inline (((char *) g_dgettext ("lector", "This work is in the Public Domain"
)))
;
520 /* c) Marked True => Copyrighted material */
521 } else {
522 /* Checking usage terms as defined by the XMP Rights Management
523 * Schema. This field is recomended to be checked by Creative
524 * Commons */
525 /* 1) checking for a suitable localized string */
526 language_string = pango_language_to_string (ctk_get_default_language ())((const char *)ctk_get_default_language ());
527 tags = g_strsplit (language_string, "-", -1);
528 i = g_strv_length (tags);
529 while (i-- && !license->text) {
530 tag = g_strdup (tags[0])g_strdup_inline (tags[0]);
531 for (j = 1; j <= i; j++) {
532 tag_aux = g_strdup_printf ("%s-%s", tag, tags[j]);
533 g_free (tag);
534 tag = tag_aux;
535 }
536 aux = g_strdup_printf (LICENSE_TEXT"/x:xmpmeta/rdf:RDF/rdf:Description/dc:rights/rdf:Alt/rdf:li[lang('%s')]", tag);
537 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) aux, xpathCtx);
538 if (xpathObj != NULL__null) {
539 if (xpathObj->nodesetval != NULL__null &&
540 xpathObj->nodesetval->nodeNr != 0)
541 license->text = (gchar *)xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
542 xmlXPathFreeObject (xpathObj);
543 }
544 g_free (tag);
545 g_free (aux);
546 }
547 g_strfreev(tags);
548
549 /* 2) if not, use the default string */
550 if (!license->text) {
551 aux = g_strdup_printf (LICENSE_TEXT"/x:xmpmeta/rdf:RDF/rdf:Description/dc:rights/rdf:Alt/rdf:li[lang('%s')]", "x-default");
552 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) aux, xpathCtx);
553 if (xpathObj != NULL__null) {
554 if (xpathObj->nodesetval != NULL__null &&
555 xpathObj->nodesetval->nodeNr != 0)
556 license->text = (gchar *)xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
557 xmlXPathFreeObject (xpathObj);
558 }
559 g_free (aux);
560 }
561
562 /* Checking the license URI as defined by the Creative Commons
563 * Schema. This field is recomended to be checked by Creative
564 * Commons */
565 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) LICENSE_URI"/x:xmpmeta/rdf:RDF/rdf:Description/cc:license/@rdf:resource", xpathCtx);
566 if (xpathObj != NULL__null) {
567 if (xpathObj->nodesetval != NULL__null &&
568 xpathObj->nodesetval->nodeNr != 0)
569 license->uri = (gchar *)xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
570 xmlXPathFreeObject (xpathObj);
571 }
572
573 /* Checking the web statement as defined by the XMP Rights
574 * Management Schema. Checking it out is a sort of above-and-beyond
575 * the basic recommendations by Creative Commons. It can be
576 * considered as a "reinforcement" approach to add certainty. */
577 xpathObj = xmlXPathEvalExpression (BAD_CAST(xmlChar *) LICENSE_WEB_STATEMENT"/x:xmpmeta/rdf:RDF/rdf:Description/xmpRights:WebStatement", xpathCtx);
578 if (xpathObj != NULL__null) {
579 if (xpathObj->nodesetval != NULL__null &&
580 xpathObj->nodesetval->nodeNr != 0)
581 license->web_statement = (gchar *)xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
582 xmlXPathFreeObject (xpathObj);
583 }
584 }
585 xmlFree (marked);
586
587 if (!license->text && !license->uri && !license->web_statement) {
588 ev_document_license_free (license);
589 return NULL__null;
590 }
591
592 return license;
593}
594
595static void
596pdf_document_parse_metadata (const gchar *metadata,
597 EvDocumentInfo *info)
598{
599 xmlDocPtr doc;
600 xmlXPathContextPtr xpathCtx;
601 gchar *fmt;
602
603 doc = xmlParseMemory (metadata, strlen (metadata));
604 if (doc == NULL__null)
605 return; /* invalid xml metadata */
606
607 xpathCtx = xmlXPathNewContext (doc);
608 if (xpathCtx == NULL__null) {
609 xmlFreeDoc (doc);
610 return; /* invalid xpath context */
611 }
612
613 fmt = pdf_document_get_format_from_metadata (doc, xpathCtx);
614 if (fmt != NULL__null) {
615 g_free (info->format);
616 info->format = fmt;
617 }
618
619 info->license = pdf_document_get_license_from_metadata (doc, xpathCtx);
620
621 xmlXPathFreeContext (xpathCtx);
622 xmlFreeDoc (doc);
623}
624
625
626static EvDocumentInfo *
627pdf_document_get_info (EvDocument *document)
628{
629 EvDocumentInfo *info;
630 PopplerPageLayout layout;
631 PopplerPageMode mode;
632 PopplerViewerPreferences view_prefs;
633 PopplerPermissions permissions;
634 char *metadata;
635 gboolean linearized;
636
637 info = g_new0 (EvDocumentInfo, 1)((EvDocumentInfo *) g_malloc0_n ((1), sizeof (EvDocumentInfo)
))
;
638
639 info->fields_mask = EV_DOCUMENT_INFO_TITLE |
640 EV_DOCUMENT_INFO_FORMAT |
641 EV_DOCUMENT_INFO_AUTHOR |
642 EV_DOCUMENT_INFO_SUBJECT |
643 EV_DOCUMENT_INFO_KEYWORDS |
644 EV_DOCUMENT_INFO_LAYOUT |
645 EV_DOCUMENT_INFO_START_MODE |
646 EV_DOCUMENT_INFO_PERMISSIONS |
647 EV_DOCUMENT_INFO_UI_HINTS |
648 EV_DOCUMENT_INFO_CREATOR |
649 EV_DOCUMENT_INFO_PRODUCER |
650 EV_DOCUMENT_INFO_CREATION_DATE |
651 EV_DOCUMENT_INFO_MOD_DATE |
652 EV_DOCUMENT_INFO_LINEARIZED |
653 EV_DOCUMENT_INFO_N_PAGES |
654 EV_DOCUMENT_INFO_SECURITY |
655 EV_DOCUMENT_INFO_PAPER_SIZE |
656 EV_DOCUMENT_INFO_LICENSE;
657
658 g_object_get (PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->document,
659 "title", &(info->title),
660 "format", &(info->format),
661 "author", &(info->author),
662 "subject", &(info->subject),
663 "keywords", &(info->keywords),
664 "page-mode", &mode,
665 "page-layout", &layout,
666 "viewer-preferences", &view_prefs,
667 "permissions", &permissions,
668 "creator", &(info->creator),
669 "producer", &(info->producer),
670 "linearized", &linearized,
671 "metadata", &metadata,
672 NULL__null);
673
674 info->creation_date = (gint64) poppler_document_get_creation_date (PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->document);
675 info->modified_date = (gint64) poppler_document_get_modification_date (PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->document);
676
677 if (metadata != NULL__null) {
678 pdf_document_parse_metadata (metadata, info);
679 g_free (metadata);
680 }
681
682 info->n_pages = ev_document_get_n_pages (document);
683
684 if (info->n_pages > 0) {
685 ev_document_get_page_size (document, 0,
686 &(info->paper_width),
687 &(info->paper_height));
688 // Convert to mm.
689 info->paper_width = info->paper_width / 72.0f * 25.4f;
690 info->paper_height = info->paper_height / 72.0f * 25.4f;
691 }
692
693 switch (layout) {
694 case POPPLER_PAGE_LAYOUT_SINGLE_PAGE:
695 info->layout = EV_DOCUMENT_LAYOUT_SINGLE_PAGE;
696 break;
697 case POPPLER_PAGE_LAYOUT_ONE_COLUMN:
698 info->layout = EV_DOCUMENT_LAYOUT_ONE_COLUMN;
699 break;
700 case POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT:
701 info->layout = EV_DOCUMENT_LAYOUT_TWO_COLUMN_LEFT;
702 break;
703 case POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT:
704 info->layout = EV_DOCUMENT_LAYOUT_TWO_COLUMN_RIGHT;
705 break;
706 case POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT:
707 info->layout = EV_DOCUMENT_LAYOUT_TWO_PAGE_LEFT;
708 break;
709 case POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT:
710 info->layout = EV_DOCUMENT_LAYOUT_TWO_PAGE_RIGHT;
711 break;
712 default:
713 break;
714 }
715
716 switch (mode) {
717 case POPPLER_PAGE_MODE_NONE:
718 info->mode = EV_DOCUMENT_MODE_NONE;
719 break;
720 case POPPLER_PAGE_MODE_USE_THUMBS:
721 info->mode = EV_DOCUMENT_MODE_USE_THUMBS;
722 break;
723 case POPPLER_PAGE_MODE_USE_OC:
724 info->mode = EV_DOCUMENT_MODE_USE_OC;
725 break;
726 case POPPLER_PAGE_MODE_FULL_SCREEN:
727 info->mode = EV_DOCUMENT_MODE_FULL_SCREEN;
728 break;
729 case POPPLER_PAGE_MODE_USE_ATTACHMENTS:
730 info->mode = EV_DOCUMENT_MODE_USE_ATTACHMENTS;
731 default:
732 break;
733 }
734
735 info->ui_hints = 0;
736 if (view_prefs & POPPLER_VIEWER_PREFERENCES_HIDE_TOOLBAR) {
737 info->ui_hints |= EV_DOCUMENT_UI_HINT_HIDE_TOOLBAR;
738 }
739 if (view_prefs & POPPLER_VIEWER_PREFERENCES_HIDE_MENUBAR) {
740 info->ui_hints |= EV_DOCUMENT_UI_HINT_HIDE_MENUBAR;
741 }
742 if (view_prefs & POPPLER_VIEWER_PREFERENCES_HIDE_WINDOWUI) {
743 info->ui_hints |= EV_DOCUMENT_UI_HINT_HIDE_WINDOWUI;
744 }
745 if (view_prefs & POPPLER_VIEWER_PREFERENCES_FIT_WINDOW) {
746 info->ui_hints |= EV_DOCUMENT_UI_HINT_FIT_WINDOW;
747 }
748 if (view_prefs & POPPLER_VIEWER_PREFERENCES_CENTER_WINDOW) {
749 info->ui_hints |= EV_DOCUMENT_UI_HINT_CENTER_WINDOW;
750 }
751 if (view_prefs & POPPLER_VIEWER_PREFERENCES_DISPLAY_DOC_TITLE) {
752 info->ui_hints |= EV_DOCUMENT_UI_HINT_DISPLAY_DOC_TITLE;
753 }
754 if (view_prefs & POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL) {
755 info->ui_hints |= EV_DOCUMENT_UI_HINT_DIRECTION_RTL;
756 }
757
758 info->permissions = 0;
759 if (permissions & POPPLER_PERMISSIONS_OK_TO_PRINT) {
760 info->permissions |= EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT;
761 }
762 if (permissions & POPPLER_PERMISSIONS_OK_TO_MODIFY) {
763 info->permissions |= EV_DOCUMENT_PERMISSIONS_OK_TO_MODIFY;
764 }
765 if (permissions & POPPLER_PERMISSIONS_OK_TO_COPY) {
766 info->permissions |= EV_DOCUMENT_PERMISSIONS_OK_TO_COPY;
767 }
768 if (permissions & POPPLER_PERMISSIONS_OK_TO_ADD_NOTES) {
769 info->permissions |= EV_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES;
770 }
771
772 if (ev_document_security_has_document_security (EV_DOCUMENT_SECURITY (document)((((EvDocumentSecurity*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((document)), ((ev_document_security_get_type
()))))))
)) {
773 /* translators: this is the document security state */
774 info->security = g_strdup (_("Yes"))g_strdup_inline (((char *) g_dgettext ("lector", "Yes")));
775 } else {
776 /* translators: this is the document security state */
777 info->security = g_strdup (_("No"))g_strdup_inline (((char *) g_dgettext ("lector", "No")));
778 }
779
780 info->linearized = linearized ? g_strdup (_("Yes"))g_strdup_inline (((char *) g_dgettext ("lector", "Yes"))) : g_strdup (_("No"))g_strdup_inline (((char *) g_dgettext ("lector", "No")));
781
782 return info;
783}
784
785static gboolean
786pdf_document_get_backend_info (EvDocument *document, EvDocumentBackendInfo *info)
787{
788 PopplerBackend backend;
789
790 backend = poppler_get_backend ();
791 switch (backend) {
792 case POPPLER_BACKEND_CAIRO:
793 info->name = "poppler/cairo";
794 break;
795 case POPPLER_BACKEND_SPLASH:
796 info->name = "poppler/splash";
797 break;
798 default:
799 info->name = "poppler/unknown";
800 break;
801 }
802
803 info->version = poppler_get_version ();
804
805 return TRUE(!(0));
806}
807
808static gboolean
809pdf_document_support_synctex (EvDocument *document)
810{
811 return TRUE(!(0));
812}
813
814static void
815pdf_document_class_init (PdfDocumentClass *klass)
816{
817 GObjectClass *g_object_class = G_OBJECT_CLASS (klass)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), (((GType) ((20) << (2))))))))
;
818 EvDocumentClass *ev_document_class = EV_DOCUMENT_CLASS (klass)((((EvDocumentClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), ((ev_document_get_type ()))))))
;
819
820 g_object_class->dispose = pdf_document_dispose;
821
822 ev_document_class->save = pdf_document_save;
823 ev_document_class->load = pdf_document_load;
824 ev_document_class->get_n_pages = pdf_document_get_n_pages;
825 ev_document_class->get_page = pdf_document_get_page;
826 ev_document_class->get_page_size = pdf_document_get_page_size;
827 ev_document_class->get_page_label = pdf_document_get_page_label;
828 ev_document_class->render = pdf_document_render;
829 ev_document_class->get_info = pdf_document_get_info;
830 ev_document_class->get_backend_info = pdf_document_get_backend_info;
831 ev_document_class->support_synctex = pdf_document_support_synctex;
832}
833
834/* EvDocumentSecurity */
835static gboolean
836pdf_document_has_document_security (EvDocumentSecurity *document_security)
837{
838 /* FIXME: do we really need to have this? */
839 return FALSE(0);
840}
841
842static void
843pdf_document_set_password (EvDocumentSecurity *document_security,
844 const char *password)
845{
846 PdfDocument *document = PDF_DOCUMENT (document_security)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_security)), ((pdf_document_get_type ()))))))
;
847
848 if (document->password)
849 g_free (document->password);
850
851 document->password = g_strdup (password)g_strdup_inline (password);
852}
853
854static void
855pdf_document_security_iface_init (EvDocumentSecurityInterface *iface)
856{
857 iface->has_document_security = pdf_document_has_document_security;
858 iface->set_password = pdf_document_set_password;
859}
860
861static gdouble
862pdf_document_fonts_get_progress (EvDocumentFonts *document_fonts)
863{
864 PdfDocument *pdf_document = PDF_DOCUMENT (document_fonts)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_fonts)), ((pdf_document_get_type ()))))))
;
865 int n_pages;
866
867 n_pages = pdf_document_get_n_pages (EV_DOCUMENT (pdf_document)((((EvDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((pdf_document)), ((ev_document_get_type ()))))))
);
868
869 return (double)pdf_document->fonts_scanned_pages / (double)n_pages;
870}
871
872static gboolean
873pdf_document_fonts_scan (EvDocumentFonts *document_fonts,
874 int n_pages)
875{
876 PdfDocument *pdf_document = PDF_DOCUMENT (document_fonts)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_fonts)), ((pdf_document_get_type ()))))))
;
877 gboolean result;
878
879 g_return_val_if_fail (PDF_IS_DOCUMENT (document_fonts), FALSE)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((document_fonts)); GType __t = ((pdf_document_get_type ()
)); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "PDF_IS_DOCUMENT (document_fonts)"
); return ((0)); } } while (0)
;
880
881 if (pdf_document->font_info == NULL__null) {
882 pdf_document->font_info = poppler_font_info_new (pdf_document->document);
883 }
884
885 if (pdf_document->fonts_iter) {
886 poppler_fonts_iter_free (pdf_document->fonts_iter);
887 }
888
889 pdf_document->fonts_scanned_pages += n_pages;
890
891 result = poppler_font_info_scan (pdf_document->font_info, n_pages,
892 &pdf_document->fonts_iter);
893 if (!result) {
894 pdf_document->fonts_scanned_pages = 0;
895 poppler_font_info_free (pdf_document->font_info);
896 pdf_document->font_info = NULL__null;
897 }
898
899 return result;
900}
901
902static const char *
903font_type_to_string (PopplerFontType type)
904{
905 switch (type) {
906 case POPPLER_FONT_TYPE_TYPE1:
907 return _("Type 1")((char *) g_dgettext ("lector", "Type 1"));
908 case POPPLER_FONT_TYPE_TYPE1C:
909 return _("Type 1C")((char *) g_dgettext ("lector", "Type 1C"));
910 case POPPLER_FONT_TYPE_TYPE3:
911 return _("Type 3")((char *) g_dgettext ("lector", "Type 3"));
912 case POPPLER_FONT_TYPE_TRUETYPE:
913 return _("TrueType")((char *) g_dgettext ("lector", "TrueType"));
914 case POPPLER_FONT_TYPE_CID_TYPE0:
915 return _("Type 1 (CID)")((char *) g_dgettext ("lector", "Type 1 (CID)"));
916 case POPPLER_FONT_TYPE_CID_TYPE0C:
917 return _("Type 1C (CID)")((char *) g_dgettext ("lector", "Type 1C (CID)"));
918 case POPPLER_FONT_TYPE_CID_TYPE2:
919 return _("TrueType (CID)")((char *) g_dgettext ("lector", "TrueType (CID)"));
920 default:
921 return _("Unknown font type")((char *) g_dgettext ("lector", "Unknown font type"));
922 }
923}
924
925static void
926pdf_document_fonts_fill_model (EvDocumentFonts *document_fonts,
927 CtkTreeModel *model)
928{
929 PdfDocument *pdf_document = PDF_DOCUMENT (document_fonts)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_fonts)), ((pdf_document_get_type ()))))))
;
930 PopplerFontsIter *iter = pdf_document->fonts_iter;
931
932 g_return_if_fail (PDF_IS_DOCUMENT (document_fonts))do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((document_fonts)); GType __t = ((pdf_document_get_type ()
)); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "PDF_IS_DOCUMENT (document_fonts)"
); return; } } while (0)
;
933
934 if (!iter)
935 return;
936
937 do {
938 CtkTreeIter list_iter;
939 const char *name;
940 const char *type;
941 const char *embedded;
942 char *details;
943
944 name = poppler_fonts_iter_get_name (iter);
945
946 if (name == NULL__null) {
947 name = _("No name")((char *) g_dgettext ("lector", "No name"));
948 }
949
950 type = font_type_to_string (
951 poppler_fonts_iter_get_font_type (iter));
952
953 if (poppler_fonts_iter_is_embedded (iter)) {
954 if (poppler_fonts_iter_is_subset (iter))
955 embedded = _("Embedded subset")((char *) g_dgettext ("lector", "Embedded subset"));
956 else
957 embedded = _("Embedded")((char *) g_dgettext ("lector", "Embedded"));
958 } else {
959 embedded = _("Not embedded")((char *) g_dgettext ("lector", "Not embedded"));
960 }
961
962 details = g_markup_printf_escaped ("%s\n%s", type, embedded);
963
964 ctk_list_store_append (CTK_LIST_STORE (model)((((CtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_list_store_get_type ()))))))
, &list_iter);
965 ctk_list_store_set (CTK_LIST_STORE (model)((((CtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_list_store_get_type ()))))))
, &list_iter,
966 EV_DOCUMENT_FONTS_COLUMN_NAME, name,
967 EV_DOCUMENT_FONTS_COLUMN_DETAILS, details,
968 -1);
969
970 g_free (details);
971 } while (poppler_fonts_iter_next (iter));
972}
973
974static void
975pdf_document_document_fonts_iface_init (EvDocumentFontsInterface *iface)
976{
977 iface->fill_model = pdf_document_fonts_fill_model;
978 iface->scan = pdf_document_fonts_scan;
979 iface->get_progress = pdf_document_fonts_get_progress;
980}
981
982static gboolean
983pdf_document_links_has_document_links (EvDocumentLinks *document_links)
984{
985 PdfDocument *pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
986 PopplerIndexIter *iter;
987
988 g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), FALSE)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((document_links)); GType __t = ((pdf_document_get_type ()
)); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "PDF_IS_DOCUMENT (document_links)"
); return ((0)); } } while (0)
;
989
990 iter = poppler_index_iter_new (pdf_document->document);
991 if (iter == NULL__null)
992 return FALSE(0);
993 poppler_index_iter_free (iter);
994
995 return TRUE(!(0));
996}
997
998static EvLinkDest *
999ev_link_dest_from_dest (PdfDocument *pdf_document,
1000 PopplerDest *dest)
1001{
1002 EvLinkDest *ev_dest = NULL__null;
1003 const char *unimplemented_dest = NULL__null;
1004
1005 g_assert (dest != NULL)do { if (dest != __null) ; else g_assertion_message_expr (((gchar
*) 0), "ev-poppler.cc", 1005, ((const char*) (__PRETTY_FUNCTION__
)), "dest != NULL"); } while (0)
;
1006
1007 switch (dest->type) {
1008 case POPPLER_DEST_XYZ: {
1009 PopplerPage *poppler_page;
1010 double height;
1011
1012 poppler_page = poppler_document_get_page (pdf_document->document,
1013 MAX (0, dest->page_num - 1)(((0) > (dest->page_num - 1)) ? (0) : (dest->page_num
- 1))
);
1014 poppler_page_get_size (poppler_page, NULL__null, &height);
1015 ev_dest = ev_link_dest_new_xyz (dest->page_num - 1,
1016 dest->left,
1017 height - MIN (height, dest->top)(((height) < (dest->top)) ? (height) : (dest->top)),
1018 dest->zoom,
1019 dest->change_left,
1020 dest->change_top,
1021 dest->change_zoom);
1022 g_object_unref (poppler_page);
1023 }
1024 break;
1025 case POPPLER_DEST_FITB:
1026 case POPPLER_DEST_FIT:
1027 ev_dest = ev_link_dest_new_fit (dest->page_num - 1);
1028 break;
1029 case POPPLER_DEST_FITBH:
1030 case POPPLER_DEST_FITH: {
1031 PopplerPage *poppler_page;
1032 double height;
1033
1034 poppler_page = poppler_document_get_page (pdf_document->document,
1035 MAX (0, dest->page_num - 1)(((0) > (dest->page_num - 1)) ? (0) : (dest->page_num
- 1))
);
1036 poppler_page_get_size (poppler_page, NULL__null, &height);
1037 ev_dest = ev_link_dest_new_fith (dest->page_num - 1,
1038 height - MIN (height, dest->top)(((height) < (dest->top)) ? (height) : (dest->top)),
1039 dest->change_top);
1040 g_object_unref (poppler_page);
1041 }
1042 break;
1043 case POPPLER_DEST_FITBV:
1044 case POPPLER_DEST_FITV:
1045 ev_dest = ev_link_dest_new_fitv (dest->page_num - 1,
1046 dest->left,
1047 dest->change_left);
1048 break;
1049 case POPPLER_DEST_FITR: {
1050 PopplerPage *poppler_page;
1051 double height;
1052
1053 poppler_page = poppler_document_get_page (pdf_document->document,
1054 MAX (0, dest->page_num - 1)(((0) > (dest->page_num - 1)) ? (0) : (dest->page_num
- 1))
);
1055 poppler_page_get_size (poppler_page, NULL__null, &height);
1056 ev_dest = ev_link_dest_new_fitr (dest->page_num - 1,
1057 dest->left,
1058 height - MIN (height, dest->bottom)(((height) < (dest->bottom)) ? (height) : (dest->bottom
))
,
1059 dest->right,
1060 height - MIN (height, dest->top)(((height) < (dest->top)) ? (height) : (dest->top)));
1061 g_object_unref (poppler_page);
1062 }
1063 break;
1064 case POPPLER_DEST_NAMED:
1065 ev_dest = ev_link_dest_new_named (dest->named_dest);
1066 break;
1067 case POPPLER_DEST_UNKNOWN:
1068 unimplemented_dest = "POPPLER_DEST_UNKNOWN";
1069 break;
1070 }
1071
1072 if (unimplemented_dest) {
1073 g_warning ("Unimplemented destination: %s, please post a "
1074 "bug report on Lector bug tracker "
1075 "(https://github.com/cafe-desktop/lector/issues) with a testcase.",
1076 unimplemented_dest);
1077 }
1078
1079 if (!ev_dest)
1080 ev_dest = ev_link_dest_new_page (dest->page_num - 1);
1081
1082 return ev_dest;
1083}
1084
1085static EvLink *
1086ev_link_from_action (PdfDocument *pdf_document,
1087 PopplerAction *action)
1088{
1089 EvLink *link = NULL__null;
1090 EvLinkAction *ev_action = NULL__null;
1091 const char *unimplemented_action = NULL__null;
1092
1093 switch (action->type) {
1094 case POPPLER_ACTION_NONE:
1095 break;
1096 case POPPLER_ACTION_GOTO_DEST: {
1097 EvLinkDest *dest;
1098
1099 dest = ev_link_dest_from_dest (pdf_document, action->goto_dest.dest);
1100 ev_action = ev_link_action_new_dest (dest);
1101 }
1102 break;
1103 case POPPLER_ACTION_GOTO_REMOTE: {
1104 EvLinkDest *dest;
1105
1106 dest = ev_link_dest_from_dest (pdf_document, action->goto_remote.dest);
1107 ev_action = ev_link_action_new_remote (dest,
1108 action->goto_remote.file_name);
1109
1110 }
1111 break;
1112 case POPPLER_ACTION_LAUNCH:
1113 ev_action = ev_link_action_new_launch (action->launch.file_name,
1114 action->launch.params);
1115 break;
1116 case POPPLER_ACTION_URI:
1117 ev_action = ev_link_action_new_external_uri (action->uri.uri);
1118 break;
1119 case POPPLER_ACTION_NAMED:
1120 ev_action = ev_link_action_new_named (action->named.named_dest);
1121 break;
1122 case POPPLER_ACTION_MOVIE:
1123 unimplemented_action = "POPPLER_ACTION_MOVIE";
1124 break;
1125 case POPPLER_ACTION_RENDITION:
1126 unimplemented_action = "POPPLER_ACTION_RENDITION";
1127 break;
1128 case POPPLER_ACTION_OCG_STATE: {
1129 GList *on_list = NULL__null;
1130 GList *off_list = NULL__null;
1131 GList *toggle_list = NULL__null;
1132 GList *l, *m;
1133
1134 for (l = action->ocg_state.state_list; l; l = g_list_next (l)((l) ? (((GList *)(l))->next) : __null)) {
1135 PopplerActionLayer *action_layer = (PopplerActionLayer *)l->data;
1136
1137 for (m = action_layer->layers; m; m = g_list_next (m)((m) ? (((GList *)(m))->next) : __null)) {
1138 PopplerLayer *layer = (PopplerLayer *)m->data;
1139 EvLayer *ev_layer;
1140
1141 ev_layer = ev_layer_new (poppler_layer_is_parent (layer),
1142 poppler_layer_get_radio_button_group_id (layer));
1143 g_object_set_data_full (G_OBJECT (ev_layer)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_layer)), (((GType) ((20) << (2))))))))
,
1144 "poppler-layer",
1145 g_object_ref (layer)((typename std::remove_reference<decltype (layer)>::type
) (g_object_ref) (layer))
,
1146 (GDestroyNotify)g_object_unref);
1147
1148 switch (action_layer->action) {
1149 case POPPLER_ACTION_LAYER_ON:
1150 on_list = g_list_prepend (on_list, ev_layer);
1151 break;
1152 case POPPLER_ACTION_LAYER_OFF:
1153 off_list = g_list_prepend (off_list, ev_layer);
1154 break;
1155 case POPPLER_ACTION_LAYER_TOGGLE:
1156 toggle_list = g_list_prepend (toggle_list, ev_layer);
1157 break;
1158 }
1159 }
1160 }
1161
1162 /* The action takes the ownership of the lists */
1163 ev_action = ev_link_action_new_layers_state (g_list_reverse (on_list),
1164 g_list_reverse (off_list),
1165 g_list_reverse (toggle_list));
1166
1167
1168 }
1169 break;
1170 case POPPLER_ACTION_JAVASCRIPT:
1171 unimplemented_action = "POPPLER_ACTION_JAVASCRIPT";
1172 break;
1173 case POPPLER_ACTION_UNKNOWN:
1174 unimplemented_action = "POPPLER_ACTION_UNKNOWN";
1175 }
1176
1177 if (unimplemented_action) {
1178 g_warning ("Unimplemented action: %s, please post a bug report "
1179 "on Lector bug tracker (https://github.com/cafe-desktop/lector/issues) "
1180 "with a testcase.", unimplemented_action);
1181 }
1182
1183 link = ev_link_new (action->any.title, ev_action);
1184
1185 return link;
1186}
1187
1188static void
1189build_tree (PdfDocument *pdf_document,
1190 CtkTreeModel *model,
1191 CtkTreeIter *parent,
1192 PopplerIndexIter *iter)
1193{
1194
1195 do {
1196 CtkTreeIter tree_iter;
1197 PopplerIndexIter *child;
1198 PopplerAction *action;
1199 EvLink *link = NULL__null;
1200 gboolean expand;
1201 char *title_markup;
1202
1203 action = poppler_index_iter_get_action (iter);
1204 expand = poppler_index_iter_is_open (iter);
1205
1206 if (!action)
1207 continue;
1208
1209 link = ev_link_from_action (pdf_document, action);
1210 if (!link || strlen (ev_link_get_title (link)) <= 0) {
1211 poppler_action_free (action);
1212 if (link)
1213 g_object_unref (link);
1214
1215 continue;
1216 }
1217
1218 ctk_tree_store_append (CTK_TREE_STORE (model)((((CtkTreeStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_tree_store_get_type ()))))))
, &tree_iter, parent);
1219 title_markup = g_markup_escape_text (ev_link_get_title (link), -1);
1220
1221 ctk_tree_store_set (CTK_TREE_STORE (model)((((CtkTreeStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_tree_store_get_type ()))))))
, &tree_iter,
1222 EV_DOCUMENT_LINKS_COLUMN_MARKUP, title_markup,
1223 EV_DOCUMENT_LINKS_COLUMN_LINK, link,
1224 EV_DOCUMENT_LINKS_COLUMN_EXPAND, expand,
1225 -1);
1226
1227 g_free (title_markup);
1228 g_object_unref (link);
1229
1230 child = poppler_index_iter_get_child (iter);
1231 if (child)
1232 build_tree (pdf_document, model, &tree_iter, child);
1233 poppler_index_iter_free (child);
1234 poppler_action_free (action);
1235
1236 } while (poppler_index_iter_next (iter));
1237}
1238
1239static CtkTreeModel *
1240pdf_document_links_get_links_model (EvDocumentLinks *document_links)
1241{
1242 PdfDocument *pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
1243 CtkTreeModel *model = NULL__null;
1244 PopplerIndexIter *iter;
1245
1246 g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((document_links)); GType __t = ((pdf_document_get_type ()
)); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "PDF_IS_DOCUMENT (document_links)"
); return (__null); } } while (0)
;
1247
1248 iter = poppler_index_iter_new (pdf_document->document);
1249 /* Create the model if we have items*/
1250 if (iter != NULL__null) {
1251 model = (CtkTreeModel *) ctk_tree_store_new (EV_DOCUMENT_LINKS_COLUMN_NUM_COLUMNS,
1252 G_TYPE_STRING((GType) ((16) << (2))),
1253 G_TYPE_OBJECT((GType) ((20) << (2))),
1254 G_TYPE_BOOLEAN((GType) ((5) << (2))),
1255 G_TYPE_STRING((GType) ((16) << (2))));
1256 build_tree (pdf_document, model, NULL__null, iter);
1257 poppler_index_iter_free (iter);
1258 }
1259
1260 return model;
1261}
1262
1263static EvMappingList *
1264pdf_document_links_get_links (EvDocumentLinks *document_links,
1265 EvPage *page)
1266{
1267 PdfDocument *pdf_document;
1268 PopplerPage *poppler_page;
1269 GList *retval = NULL__null;
1270 GList *mapping_list;
1271 GList *list;
1272 double height;
1273
1274 pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
1275 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
1276 mapping_list = poppler_page_get_link_mapping (poppler_page);
1277 poppler_page_get_size (poppler_page, NULL__null, &height);
1278
1279 for (list = mapping_list; list; list = list->next) {
1280 PopplerLinkMapping *link_mapping;
1281 EvMapping *ev_link_mapping;
1282
1283 link_mapping = (PopplerLinkMapping *)list->data;
1284 ev_link_mapping = g_new (EvMapping, 1)((EvMapping *) g_malloc_n ((1), sizeof (EvMapping)));
1285 ev_link_mapping->data = ev_link_from_action (pdf_document,
1286 link_mapping->action);
1287 ev_link_mapping->area.x1 = link_mapping->area.x1;
1288 ev_link_mapping->area.x2 = link_mapping->area.x2;
1289 /* Invert this for X-style coordinates */
1290 ev_link_mapping->area.y1 = height - link_mapping->area.y2;
1291 ev_link_mapping->area.y2 = height - link_mapping->area.y1;
1292
1293 retval = g_list_prepend (retval, ev_link_mapping);
1294 }
1295
1296 poppler_page_free_link_mapping (mapping_list);
1297
1298 return ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
1299}
1300
1301static EvLinkDest *
1302pdf_document_links_find_link_dest (EvDocumentLinks *document_links,
1303 const gchar *link_name)
1304{
1305 PdfDocument *pdf_document;
1306 PopplerDest *dest;
1307 EvLinkDest *ev_dest = NULL__null;
1308
1309 pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
1310 dest = poppler_document_find_dest (pdf_document->document,
1311 link_name);
1312 if (dest) {
1313 ev_dest = ev_link_dest_from_dest (pdf_document, dest);
1314 poppler_dest_free (dest);
1315 }
1316
1317 return ev_dest;
1318}
1319
1320static gint
1321pdf_document_links_find_link_page (EvDocumentLinks *document_links,
1322 const gchar *link_name)
1323{
1324 PdfDocument *pdf_document;
1325 PopplerDest *dest;
1326 gint retval = -1;
1327
1328 pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
1329 dest = poppler_document_find_dest (pdf_document->document,
1330 link_name);
1331 if (dest) {
1332 retval = dest->page_num - 1;
1333 poppler_dest_free (dest);
1334 }
1335
1336 return retval;
1337}
1338
1339static void
1340pdf_document_document_links_iface_init (EvDocumentLinksInterface *iface)
1341{
1342 iface->has_document_links = pdf_document_links_has_document_links;
1343 iface->get_links_model = pdf_document_links_get_links_model;
1344 iface->get_links = pdf_document_links_get_links;
1345 iface->find_link_dest = pdf_document_links_find_link_dest;
1346 iface->find_link_page = pdf_document_links_find_link_page;
1347}
1348
1349static EvMappingList *
1350pdf_document_images_get_image_mapping (EvDocumentImages *document_images,
1351 EvPage *page)
1352{
1353 GList *retval = NULL__null;
1354 PopplerPage *poppler_page;
1355 GList *mapping_list;
1356 GList *list;
1357
1358 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
1359 mapping_list = poppler_page_get_image_mapping (poppler_page);
1360
1361 for (list = mapping_list; list; list = list->next) {
1362 PopplerImageMapping *image_mapping;
1363 EvMapping *ev_image_mapping;
1364
1365 image_mapping = (PopplerImageMapping *)list->data;
1366
1367 ev_image_mapping = g_new (EvMapping, 1)((EvMapping *) g_malloc_n ((1), sizeof (EvMapping)));
1368
1369 ev_image_mapping->data = ev_image_new (page->index, image_mapping->image_id);
1370 ev_image_mapping->area.x1 = image_mapping->area.x1;
1371 ev_image_mapping->area.y1 = image_mapping->area.y1;
1372 ev_image_mapping->area.x2 = image_mapping->area.x2;
1373 ev_image_mapping->area.y2 = image_mapping->area.y2;
1374
1375 retval = g_list_prepend (retval, ev_image_mapping);
1376 }
1377
1378 poppler_page_free_image_mapping (mapping_list);
1379
1380 return ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
1381}
1382
1383GdkPixbuf *
1384pdf_document_images_get_image (EvDocumentImages *document_images,
1385 EvImage *image)
1386{
1387 GdkPixbuf *retval = NULL__null;
1388 PdfDocument *pdf_document;
1389 PopplerPage *poppler_page;
1390 cairo_surface_t *surface;
1391
1392 pdf_document = PDF_DOCUMENT (document_images)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_images)), ((pdf_document_get_type ()))))))
;
1393 poppler_page = poppler_document_get_page (pdf_document->document,
1394 ev_image_get_page (image));
1395
1396 surface = poppler_page_get_image (poppler_page, ev_image_get_id (image));
1397 if (surface) {
1398 retval = ev_document_misc_pixbuf_from_surface (surface);
1399 cairo_surface_destroy (surface);
1400 }
1401
1402 g_object_unref (poppler_page);
1403
1404 return retval;
1405}
1406
1407static void
1408pdf_document_document_images_iface_init (EvDocumentImagesInterface *iface)
1409{
1410 iface->get_image_mapping = pdf_document_images_get_image_mapping;
1411 iface->get_image = pdf_document_images_get_image;
1412}
1413
1414static GdkPixbuf *
1415make_thumbnail_for_page (PopplerPage *poppler_page,
1416 EvRenderContext *rc,
1417 gint width,
1418 gint height)
1419{
1420 GdkPixbuf *pixbuf;
1421 cairo_surface_t *surface;
1422
1423 ev_document_fc_mutex_lock ();
1424 surface = pdf_page_render (poppler_page, width, height, rc);
1425 ev_document_fc_mutex_unlock ();
1426
1427 pixbuf = ev_document_misc_pixbuf_from_surface (surface);
1428 cairo_surface_destroy (surface);
1429
1430 return pixbuf;
1431}
1432
1433static GdkPixbuf *
1434pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails,
1435 EvRenderContext *rc,
1436 gboolean border)
1437{
1438 PdfDocument *pdf_document = PDF_DOCUMENT (document_thumbnails)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_thumbnails)), ((pdf_document_get_type ()))))))
;
1439 PopplerPage *poppler_page;
1440 cairo_surface_t *surface;
1441 GdkPixbuf *pixbuf = NULL__null;
1442 GdkPixbuf *border_pixbuf;
1443 gint width, height;
1444
1445 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
1446
1447 pdf_document_thumbnails_get_dimensions (EV_DOCUMENT_THUMBNAILS (pdf_document)((((EvDocumentThumbnails*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((pdf_document)), ((ev_document_thumbnails_get_type
()))))))
,
1448 rc, &width, &height);
1449
1450 surface = poppler_page_get_thumbnail (poppler_page);
1451 if (surface) {
1452 pixbuf = ev_document_misc_pixbuf_from_surface (surface);
1453 cairo_surface_destroy (surface);
1454 }
1455
1456 if (pixbuf != NULL__null) {
1457 int thumb_width = (rc->rotation == 90 || rc->rotation == 270) ?
1458 gdk_pixbuf_get_height (pixbuf) :
1459 gdk_pixbuf_get_width (pixbuf);
1460
1461 if (thumb_width == width) {
1462 GdkPixbuf *rotated_pixbuf;
1463
1464 rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf,
1465 (GdkPixbufRotation) (360 - rc->rotation));
1466 g_object_unref (pixbuf);
1467 pixbuf = rotated_pixbuf;
1468 } else {
1469 /* The provided thumbnail has a different size */
1470 g_object_unref (pixbuf);
1471 pixbuf = make_thumbnail_for_page (poppler_page, rc, width, height);
1472 }
1473 } else {
1474 /* There is no provided thumbnail. We need to make one. */
1475 pixbuf = make_thumbnail_for_page (poppler_page, rc, width, height);
1476 }
1477
1478 if (border && pixbuf) {
1479 border_pixbuf = ev_document_misc_get_thumbnail_frame (-1, -1, pixbuf);
1480 g_object_unref (pixbuf);
1481 pixbuf = border_pixbuf;
1482 }
1483
1484 return pixbuf;
1485}
1486
1487static void
1488pdf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document_thumbnails,
1489 EvRenderContext *rc,
1490 gint *width,
1491 gint *height)
1492{
1493 double page_width, page_height;
1494
1495 poppler_page_get_size (POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
,
1496 &page_width, &page_height);
1497
1498 *width = MAX ((gint)(page_width * rc->scale + 0.5), 1)((((gint)(page_width * rc->scale + 0.5)) > (1)) ? ((gint
)(page_width * rc->scale + 0.5)) : (1))
;
1499 *height = MAX ((gint)(page_height * rc->scale + 0.5), 1)((((gint)(page_height * rc->scale + 0.5)) > (1)) ? ((gint
)(page_height * rc->scale + 0.5)) : (1))
;
1500
1501 if (rc->rotation == 90 || rc->rotation == 270) {
1502 gint temp;
1503
1504 temp = *width;
1505 *width = *height;
1506 *height = temp;
1507 }
1508}
1509
1510static void
1511pdf_document_document_thumbnails_iface_init (EvDocumentThumbnailsInterface *iface)
1512{
1513 iface->get_thumbnail = pdf_document_thumbnails_get_thumbnail;
1514 iface->get_dimensions = pdf_document_thumbnails_get_dimensions;
1515}
1516
1517
1518static GList *
1519pdf_document_find_find_text (EvDocumentFind *document_find,
1520 EvPage *page,
1521 const gchar *text,
1522 gboolean case_sensitive)
1523{
1524 GList *matches, *l;
1525 PopplerPage *poppler_page;
1526 gdouble height;
1527 GList *retval = NULL__null;
1528 PopplerFindFlags options = POPPLER_FIND_DEFAULT;
1529
1530 g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return (__null); } } while (0)
;
1531 g_return_val_if_fail (text != NULL, NULL)do { if ((text != __null)) { } else { g_return_if_fail_warning
(((gchar*) 0), ((const char*) (__PRETTY_FUNCTION__)), "text != NULL"
); return (__null); } } while (0)
;
1532
1533 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
1534
1535 if (case_sensitive)
1536 options = POPPLER_FIND_CASE_SENSITIVE;
1537
1538 matches = poppler_page_find_text_with_options (poppler_page, text, options);
1539 if (!matches)
1540 return NULL__null;
1541
1542 poppler_page_get_size (poppler_page, NULL__null, &height);
1543 for (l = matches; l && l->data; l = g_list_next (l)((l) ? (((GList *)(l))->next) : __null)) {
1544 PopplerRectangle *rect = (PopplerRectangle *)l->data;
1545 EvRectangle *ev_rect;
1546
1547 ev_rect = ev_rectangle_new ();
1548 ev_rect->x1 = rect->x1;
1549 ev_rect->x2 = rect->x2;
1550 /* Invert this for X-style coordinates */
1551 ev_rect->y1 = height - rect->y2;
1552 ev_rect->y2 = height - rect->y1;
1553
1554 retval = g_list_prepend (retval, ev_rect);
1555 }
1556
1557 g_list_foreach (matches, (GFunc)poppler_rectangle_free, NULL__null);
1558 g_list_free (matches);
1559
1560 return g_list_reverse (retval);
1561}
1562
1563static void
1564pdf_document_find_iface_init (EvDocumentFindInterface *iface)
1565{
1566 iface->find_text = pdf_document_find_find_text;
1567}
1568
1569static void
1570pdf_print_context_free (PdfPrintContext *ctx)
1571{
1572 if (!ctx)
1573 return;
1574
1575#ifdef HAVE_CAIRO_PRINT
1576 if (ctx->cr) {
1577 cairo_destroy (ctx->cr);
1578 ctx->cr = NULL__null;
1579 }
1580#else
1581 if (ctx->ps_file) {
1582 poppler_ps_file_free (ctx->ps_file);
1583 ctx->ps_file = NULL__null;
1584 }
1585#endif
1586 g_free (ctx);
1587}
1588
1589static void
1590pdf_document_file_exporter_begin (EvFileExporter *exporter,
1591 EvFileExporterContext *fc)
1592{
1593 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1594 PdfPrintContext *ctx;
1595#ifdef HAVE_CAIRO_PRINT
1596 cairo_surface_t *surface = NULL__null;
1597#endif
1598
1599 if (pdf_document->print_ctx)
1600 pdf_print_context_free (pdf_document->print_ctx);
1601 pdf_document->print_ctx = g_new0 (PdfPrintContext, 1)((PdfPrintContext *) g_malloc0_n ((1), sizeof (PdfPrintContext
)))
;
1602 ctx = pdf_document->print_ctx;
1603 ctx->format = fc->format;
1604
1605#ifdef HAVE_CAIRO_PRINT
1606 ctx->pages_per_sheet = CLAMP (fc->pages_per_sheet, 1, 16)(((fc->pages_per_sheet) > (16)) ? (16) : (((fc->pages_per_sheet
) < (1)) ? (1) : (fc->pages_per_sheet)))
;
1607
1608 ctx->paper_width = fc->paper_width;
1609 ctx->paper_height = fc->paper_height;
1610
1611 switch (fc->pages_per_sheet) {
1612 default:
1613 case 1:
1614 ctx->pages_x = 1;
1615 ctx->pages_y = 1;
1616 break;
1617 case 2:
1618 ctx->pages_x = 1;
1619 ctx->pages_y = 2;
1620 break;
1621 case 4:
1622 ctx->pages_x = 2;
1623 ctx->pages_y = 2;
1624 break;
1625 case 6:
1626 ctx->pages_x = 2;
1627 ctx->pages_y = 3;
1628 break;
1629 case 9:
1630 ctx->pages_x = 3;
1631 ctx->pages_y = 3;
1632 break;
1633 case 16:
1634 ctx->pages_x = 4;
1635 ctx->pages_y = 4;
1636 break;
1637 }
1638
1639 ctx->pages_printed = 0;
1640
1641 switch (fc->format) {
1642 case EV_FILE_FORMAT_PS:
1643#ifdef HAVE_CAIRO_PS1
1644 surface = cairo_ps_surface_create (fc->filename, fc->paper_width, fc->paper_height);
1645#endif
1646 break;
1647 case EV_FILE_FORMAT_PDF:
1648#ifdef HAVE_CAIRO_PDF1
1649 surface = cairo_pdf_surface_create (fc->filename, fc->paper_width, fc->paper_height);
1650#endif
1651 break;
1652 default:
1653 g_assert_not_reached ()do { g_assertion_message_expr (((gchar*) 0), "ev-poppler.cc",
1653, ((const char*) (__PRETTY_FUNCTION__)), __null); } while
(0)
;
1654 }
1655
1656 ctx->cr = cairo_create (surface);
1657 cairo_surface_destroy (surface);
1658
1659#else /* HAVE_CAIRO_PRINT */
1660 if (ctx->format == EV_FILE_FORMAT_PS) {
1661 ctx->ps_file = poppler_ps_file_new (pdf_document->document,
1662 fc->filename, fc->first_page,
1663 fc->last_page - fc->first_page + 1);
1664 poppler_ps_file_set_paper_size (ctx->ps_file, fc->paper_width, fc->paper_height);
1665 poppler_ps_file_set_duplex (ctx->ps_file, fc->duplex);
1666 }
1667#endif /* HAVE_CAIRO_PRINT */
1668}
1669
1670static void
1671pdf_document_file_exporter_begin_page (EvFileExporter *exporter)
1672{
1673 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1674 PdfPrintContext *ctx = pdf_document->print_ctx;
1675
1676 g_return_if_fail (pdf_document->print_ctx != NULL)do { if ((pdf_document->print_ctx != __null)) { } else { g_return_if_fail_warning
(((gchar*) 0), ((const char*) (__PRETTY_FUNCTION__)), "pdf_document->print_ctx != NULL"
); return; } } while (0)
;
1677
1678 ctx->pages_printed = 0;
1679
1680#ifdef HAVE_CAIRO_PRINT
1681 if (ctx->paper_width > ctx->paper_height) {
1682 if (ctx->format == EV_FILE_FORMAT_PS) {
1683 cairo_ps_surface_set_size (cairo_get_target (ctx->cr),
1684 ctx->paper_height,
1685 ctx->paper_width);
1686 } else if (ctx->format == EV_FILE_FORMAT_PDF) {
1687 cairo_pdf_surface_set_size (cairo_get_target (ctx->cr),
1688 ctx->paper_height,
1689 ctx->paper_width);
1690 }
1691 }
1692#endif /* HAVE_CAIRO_PRINT */
1693}
1694
1695static void
1696pdf_document_file_exporter_do_page (EvFileExporter *exporter,
1697 EvRenderContext *rc)
1698{
1699 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1700 PdfPrintContext *ctx = pdf_document->print_ctx;
1701 PopplerPage *poppler_page;
1702#ifdef HAVE_CAIRO_PRINT
1703 gdouble page_width, page_height;
1704 gint x, y;
1705 gboolean rotate;
1706 gdouble width, height;
1707 gdouble pwidth, pheight;
1708 gdouble xscale, yscale;
1709#endif
1710
1711 g_return_if_fail (pdf_document->print_ctx != NULL)do { if ((pdf_document->print_ctx != __null)) { } else { g_return_if_fail_warning
(((gchar*) 0), ((const char*) (__PRETTY_FUNCTION__)), "pdf_document->print_ctx != NULL"
); return; } } while (0)
;
1712
1713 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
1714
1715#ifdef HAVE_CAIRO_PRINT
1716 x = (ctx->pages_printed % ctx->pages_per_sheet) % ctx->pages_x;
1717 y = (ctx->pages_printed % ctx->pages_per_sheet) / ctx->pages_x;
1718 poppler_page_get_size (poppler_page, &page_width, &page_height);
1719
1720 if (page_width > page_height && page_width > ctx->paper_width) {
1721 rotate = TRUE(!(0));
1722 } else {
1723 rotate = FALSE(0);
1724 }
1725
1726 /* Use always portrait mode and rotate when necessary */
1727 if (ctx->paper_width > ctx->paper_height) {
1728 width = ctx->paper_height;
1729 height = ctx->paper_width;
1730 rotate = !rotate;
1731 } else {
1732 width = ctx->paper_width;
1733 height = ctx->paper_height;
1734 }
1735
1736 if (ctx->pages_per_sheet == 2 || ctx->pages_per_sheet == 6) {
1737 rotate = !rotate;
1738 }
1739
1740 if (rotate) {
1741 gint tmp1;
1742 gdouble tmp2;
1743
1744 tmp1 = x;
1745 x = y;
1746 y = tmp1;
1747
1748 tmp2 = page_width;
1749 page_width = page_height;
1750 page_height = tmp2;
1751 }
1752
1753 pwidth = width / ctx->pages_x;
1754 pheight = height / ctx->pages_y;
1755
1756 if ((page_width > pwidth || page_height > pheight) ||
1757 (page_width < pwidth && page_height < pheight)) {
1758 xscale = pwidth / page_width;
1759 yscale = pheight / page_height;
1760
1761 if (yscale < xscale) {
1762 xscale = yscale;
1763 } else {
1764 yscale = xscale;
1765 }
1766
1767 } else {
1768 xscale = yscale = 1;
1769 }
1770
1771 /* TODO: center */
1772
1773 cairo_save (ctx->cr);
1774 if (rotate) {
1775 cairo_matrix_t matrix;
1776
1777 cairo_translate (ctx->cr, (2 * y + 1) * pwidth, 0);
1778 cairo_matrix_init (&matrix,
1779 0, 1,
1780 -1, 0,
1781 0, 0);
1782 cairo_transform (ctx->cr, &matrix);
1783 }
1784
1785 cairo_translate (ctx->cr,
1786 x * (rotate ? pheight : pwidth),
1787 y * (rotate ? pwidth : pheight));
1788 cairo_scale (ctx->cr, xscale, yscale);
1789
1790 poppler_page_render_for_printing (poppler_page, ctx->cr);
1791
1792 ctx->pages_printed++;
1793
1794 cairo_restore (ctx->cr);
1795#else /* HAVE_CAIRO_PRINT */
1796 if (ctx->format == EV_FILE_FORMAT_PS)
1797 poppler_page_render_to_ps (poppler_page, ctx->ps_file);
1798#endif /* HAVE_CAIRO_PRINT */
1799}
1800
1801static void
1802pdf_document_file_exporter_end_page (EvFileExporter *exporter)
1803{
1804 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1805 PdfPrintContext *ctx = pdf_document->print_ctx;
1806
1807 g_return_if_fail (pdf_document->print_ctx != NULL)do { if ((pdf_document->print_ctx != __null)) { } else { g_return_if_fail_warning
(((gchar*) 0), ((const char*) (__PRETTY_FUNCTION__)), "pdf_document->print_ctx != NULL"
); return; } } while (0)
;
1808
1809#ifdef HAVE_CAIRO_PRINT
1810 cairo_show_page (ctx->cr);
1811#endif
1812}
1813
1814static void
1815pdf_document_file_exporter_end (EvFileExporter *exporter)
1816{
1817 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1818
1819 pdf_print_context_free (pdf_document->print_ctx);
1820 pdf_document->print_ctx = NULL__null;
1821}
1822
1823static EvFileExporterCapabilities
1824pdf_document_file_exporter_get_capabilities (EvFileExporter *exporter)
1825{
1826 return (EvFileExporterCapabilities) (
1827 EV_FILE_EXPORTER_CAN_PAGE_SET |
1828 EV_FILE_EXPORTER_CAN_COPIES |
1829 EV_FILE_EXPORTER_CAN_COLLATE |
1830 EV_FILE_EXPORTER_CAN_REVERSE |
1831 EV_FILE_EXPORTER_CAN_SCALE |
1832#ifdef HAVE_CAIRO_PRINT
1833 EV_FILE_EXPORTER_CAN_NUMBER_UP |
1834#endif
1835
1836#ifdef HAVE_CAIRO_PDF1
1837 EV_FILE_EXPORTER_CAN_GENERATE_PDF |
1838#endif
1839 EV_FILE_EXPORTER_CAN_GENERATE_PS);
1840}
1841
1842static void
1843pdf_document_file_exporter_iface_init (EvFileExporterInterface *iface)
1844{
1845 iface->begin = pdf_document_file_exporter_begin;
1846 iface->begin_page = pdf_document_file_exporter_begin_page;
1847 iface->do_page = pdf_document_file_exporter_do_page;
1848 iface->end_page = pdf_document_file_exporter_end_page;
1849 iface->end = pdf_document_file_exporter_end;
1850 iface->get_capabilities = pdf_document_file_exporter_get_capabilities;
1851}
1852
1853/* EvDocumentPrint */
1854static void
1855pdf_document_print_print_page (EvDocumentPrint *document,
1856 EvPage *page,
1857 cairo_t *cr)
1858{
1859 poppler_page_render_for_printing (POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
, cr);
1860}
1861
1862static void
1863pdf_document_document_print_iface_init (EvDocumentPrintInterface *iface)
1864{
1865 iface->print_page = pdf_document_print_print_page;
1866}
1867
1868static void
1869pdf_selection_render_selection (EvSelection *selection,
1870 EvRenderContext *rc,
1871 cairo_surface_t **surface,
1872 EvRectangle *points,
1873 EvRectangle *old_points,
1874 EvSelectionStyle style,
1875 CdkColor *text,
1876 CdkColor *base)
1877{
1878 PopplerPage *poppler_page;
1879 cairo_t *cr;
1880 PopplerColor text_color, base_color;
1881 double width_points, height_points;
1882 gint width, height;
1883
1884 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
1885
1886 poppler_page_get_size (poppler_page,
1887 &width_points, &height_points);
1888 width = (int) ((width_points * rc->scale) + 0.5);
1889 height = (int) ((height_points * rc->scale) + 0.5);
1890
1891 text_color.red = text->red;
1892 text_color.green = text->green;
1893 text_color.blue = text->blue;
1894
1895 base_color.red = base->red;
1896 base_color.green = base->green;
1897 base_color.blue = base->blue;
1898
1899 if (*surface == NULL__null) {
1900 *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
1901 width, height);
1902
1903 }
1904
1905 cr = cairo_create (*surface);
1906 cairo_scale (cr, rc->scale, rc->scale);
1907 cairo_surface_set_device_offset (*surface, 0, 0);
1908 memset (cairo_image_surface_get_data (*surface), 0x00,
1909 cairo_image_surface_get_height (*surface) *
1910 cairo_image_surface_get_stride (*surface));
1911 poppler_page_render_selection (poppler_page,
1912 cr,
1913 (PopplerRectangle *)points,
1914 (PopplerRectangle *)old_points,
1915 (PopplerSelectionStyle)style,
1916 &text_color,
1917 &base_color);
1918 cairo_destroy (cr);
1919}
1920
1921static gchar *
1922pdf_selection_get_selected_text (EvSelection *selection,
1923 EvPage *page,
1924 EvSelectionStyle style,
1925 EvRectangle *points)
1926{
1927 g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return (__null); } } while (0)
;
1928
1929 return poppler_page_get_selected_text (POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
,
1930 (PopplerSelectionStyle)style,
1931 (PopplerRectangle *)points);
1932}
1933
1934static cairo_region_t *
1935pdf_selection_get_selection_region (EvSelection *selection,
1936 EvRenderContext *rc,
1937 EvSelectionStyle style,
1938 EvRectangle *points)
1939{
1940 PopplerPage *poppler_page;
1941 cairo_region_t *retval;
1942
1943 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
1944 retval = poppler_page_get_selected_region (poppler_page,
1945 rc->scale,
1946 (PopplerSelectionStyle)style,
1947 (PopplerRectangle *) points);
1948
1949 return retval;
1950}
1951
1952static void
1953pdf_selection_iface_init (EvSelectionInterface *iface)
1954{
1955 iface->render_selection = pdf_selection_render_selection;
1956 iface->get_selected_text = pdf_selection_get_selected_text;
1957 iface->get_selection_region = pdf_selection_get_selection_region;
1958}
1959
1960
1961/* EvDocumentText */
1962static cairo_region_t *
1963pdf_document_text_get_text_mapping (EvDocumentText *document_text,
1964 EvPage *page)
1965{
1966 PopplerPage *poppler_page;
1967 PopplerRectangle points;
1968 cairo_region_t *retval;
1969
1970 g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return (__null); } } while (0)
;
1971
1972 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
1973
1974 points.x1 = 0.0;
1975 points.y1 = 0.0;
1976 poppler_page_get_size (poppler_page, &(points.x2), &(points.y2));
1977
1978 retval = poppler_page_get_selected_region (poppler_page, 1.0,
1979 POPPLER_SELECTION_GLYPH,
1980 &points);
1981
1982 return retval;
1983}
1984
1985static gchar *
1986pdf_document_text_get_text (EvDocumentText *selection,
1987 EvPage *page)
1988{
1989 g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return (__null); } } while (0)
;
1990
1991 return poppler_page_get_text (POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
);
1992}
1993
1994static gboolean
1995pdf_document_text_get_text_layout (EvDocumentText *selection,
1996 EvPage *page,
1997 EvRectangle **areas,
1998 guint *n_areas)
1999{
2000 g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), FALSE)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return ((0)); } } while (0)
;
2001
2002 return poppler_page_get_text_layout (POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
,
2003 (PopplerRectangle **)areas, n_areas);
2004}
2005
2006static PangoAttrList *
2007pdf_document_text_get_text_attrs (EvDocumentText *document_text,
2008 EvPage *page)
2009{
2010 GList *backend_attrs_list, *l;
2011 PangoAttrList *attrs_list;
2012
2013 g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return (__null); } } while (0)
;
2014
2015 backend_attrs_list = poppler_page_get_text_attributes (POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
);
2016 if (!backend_attrs_list)
2017 return NULL__null;
2018
2019 attrs_list = pango_attr_list_new ();
2020 for (l = backend_attrs_list; l; l = g_list_next (l)((l) ? (((GList *)(l))->next) : __null)) {
2021 PopplerTextAttributes *backend_attrs = (PopplerTextAttributes *)l->data;
2022 PangoAttribute *attr;
2023
2024 if (backend_attrs->is_underlined) {
2025 attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
2026 attr->start_index = backend_attrs->start_index;
2027 attr->end_index = backend_attrs->end_index;
2028 pango_attr_list_insert (attrs_list, attr);
2029 }
2030
2031 attr = pango_attr_foreground_new (backend_attrs->color.red,
2032 backend_attrs->color.green,
2033 backend_attrs->color.blue);
2034 attr->start_index = backend_attrs->start_index;
2035 attr->end_index = backend_attrs->end_index;
2036 pango_attr_list_insert (attrs_list, attr);
2037
2038 if (backend_attrs->font_name) {
2039 attr = pango_attr_family_new (backend_attrs->font_name);
2040 attr->start_index = backend_attrs->start_index;
2041 attr->end_index = backend_attrs->end_index;
2042 pango_attr_list_insert (attrs_list, attr);
2043 }
2044
2045 if (backend_attrs->font_size) {
2046 attr = pango_attr_size_new (backend_attrs->font_size * PANGO_SCALE1024);
2047 attr->start_index = backend_attrs->start_index;
2048 attr->end_index = backend_attrs->end_index;
2049 pango_attr_list_insert (attrs_list, attr);
2050 }
2051 }
2052
2053 poppler_page_free_text_attributes (backend_attrs_list);
2054
2055 return attrs_list;
2056}
2057
2058static void
2059pdf_document_text_iface_init (EvDocumentTextInterface *iface)
2060{
2061 iface->get_text_mapping = pdf_document_text_get_text_mapping;
2062 iface->get_text = pdf_document_text_get_text;
2063 iface->get_text_layout = pdf_document_text_get_text_layout;
2064 iface->get_text_attrs = pdf_document_text_get_text_attrs;
2065}
2066
2067/* Page Transitions */
2068static gdouble
2069pdf_document_get_page_duration (EvDocumentTransition *trans,
2070 gint page)
2071{
2072 PdfDocument *pdf_document;
2073 PopplerPage *poppler_page;
2074 gdouble duration = -1;
2075
2076 pdf_document = PDF_DOCUMENT (trans)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((trans)), ((pdf_document_get_type ()))))))
;
2077 poppler_page = poppler_document_get_page (pdf_document->document, page);
2078 if (!poppler_page)
2079 return -1;
2080
2081 duration = poppler_page_get_duration (poppler_page);
2082 g_object_unref (poppler_page);
2083
2084 return duration;
2085}
2086
2087static EvTransitionEffect *
2088pdf_document_get_effect (EvDocumentTransition *trans,
2089 gint page)
2090{
2091 PdfDocument *pdf_document;
2092 PopplerPage *poppler_page;
2093 PopplerPageTransition *page_transition;
2094 EvTransitionEffect *effect;
2095
2096 pdf_document = PDF_DOCUMENT (trans)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((trans)), ((pdf_document_get_type ()))))))
;
2097 poppler_page = poppler_document_get_page (pdf_document->document, page);
2098
2099 if (!poppler_page)
2100 return NULL__null;
2101
2102 page_transition = poppler_page_get_transition (poppler_page);
2103
2104 if (!page_transition) {
2105 g_object_unref (poppler_page);
2106 return NULL__null;
2107 }
2108
2109 /* enums in PopplerPageTransition match the EvTransitionEffect ones */
2110 effect = ev_transition_effect_new ((EvTransitionEffectType) page_transition->type,
2111 "alignment", page_transition->alignment,
2112 "direction", page_transition->direction,
2113 "duration", page_transition->duration,
2114 "angle", page_transition->angle,
2115 "scale", page_transition->scale,
2116 "rectangular", page_transition->rectangular,
2117 NULL__null);
2118
2119 poppler_page_transition_free (page_transition);
2120 g_object_unref (poppler_page);
2121
2122 return effect;
2123}
2124
2125static void
2126pdf_document_page_transition_iface_init (EvDocumentTransitionInterface *iface)
2127{
2128 iface->get_page_duration = pdf_document_get_page_duration;
2129 iface->get_effect = pdf_document_get_effect;
2130}
2131
2132/* Forms */
2133#if 0
2134static void
2135pdf_document_get_crop_box (EvDocument *document,
2136 int page,
2137 EvRectangle *rect)
2138{
2139 PdfDocument *pdf_document;
2140 PopplerPage *poppler_page;
2141 PopplerRectangle poppler_rect;
2142
2143 pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
2144 poppler_page = poppler_document_get_page (pdf_document->document, page);
2145 poppler_page_get_crop_box (poppler_page, &poppler_rect);
2146 rect->x1 = poppler_rect.x1;
2147 rect->x2 = poppler_rect.x2;
2148 rect->y1 = poppler_rect.y1;
2149 rect->y2 = poppler_rect.y2;
2150}
2151#endif
2152
2153static EvFormField *
2154ev_form_field_from_poppler_field (PdfDocument *pdf_document,
2155 PopplerFormField *poppler_field)
2156{
2157 EvFormField *ev_field = NULL__null;
2158 gint id;
2159 gdouble font_size;
2160 gboolean is_read_only;
2161 PopplerAction *action;
2162
2163 id = poppler_form_field_get_id (poppler_field);
2164 font_size = poppler_form_field_get_font_size (poppler_field);
2165 is_read_only = poppler_form_field_is_read_only (poppler_field);
2166 action = poppler_form_field_get_action (poppler_field);
2167
2168 switch (poppler_form_field_get_field_type (poppler_field)) {
2169 case POPPLER_FORM_FIELD_TEXT: {
2170 EvFormFieldText *field_text;
2171 EvFormFieldTextType ev_text_type = EV_FORM_FIELD_TEXT_NORMAL;
2172
2173 switch (poppler_form_field_text_get_text_type (poppler_field)) {
2174 case POPPLER_FORM_TEXT_NORMAL:
2175 ev_text_type = EV_FORM_FIELD_TEXT_NORMAL;
2176 break;
2177 case POPPLER_FORM_TEXT_MULTILINE:
2178 ev_text_type = EV_FORM_FIELD_TEXT_MULTILINE;
2179 break;
2180 case POPPLER_FORM_TEXT_FILE_SELECT:
2181 ev_text_type = EV_FORM_FIELD_TEXT_FILE_SELECT;
2182 break;
2183 }
2184
2185 ev_field = ev_form_field_text_new (id, ev_text_type);
2186 field_text = EV_FORM_FIELD_TEXT (ev_field)((((EvFormFieldText*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_field)), ((ev_form_field_text_get_type()))))))
;
2187
2188 field_text->do_spell_check = poppler_form_field_text_do_spell_check (poppler_field);
2189 field_text->do_scroll = poppler_form_field_text_do_scroll (poppler_field);
2190 field_text->is_rich_text = poppler_form_field_text_is_rich_text (poppler_field);
2191 field_text->is_password = poppler_form_field_text_is_password (poppler_field);
2192 field_text->max_len = poppler_form_field_text_get_max_len (poppler_field);
2193 field_text->text = poppler_form_field_text_get_text (poppler_field);
2194
2195 }
2196 break;
2197 case POPPLER_FORM_FIELD_BUTTON: {
2198 EvFormFieldButton *field_button;
2199 EvFormFieldButtonType ev_button_type = EV_FORM_FIELD_BUTTON_PUSH;
2200
2201 switch (poppler_form_field_button_get_button_type (poppler_field)) {
2202 case POPPLER_FORM_BUTTON_PUSH:
2203 ev_button_type = EV_FORM_FIELD_BUTTON_PUSH;
2204 break;
2205 case POPPLER_FORM_BUTTON_CHECK:
2206 ev_button_type = EV_FORM_FIELD_BUTTON_CHECK;
2207 break;
2208 case POPPLER_FORM_BUTTON_RADIO:
2209 ev_button_type = EV_FORM_FIELD_BUTTON_RADIO;
2210 break;
2211 }
2212
2213 ev_field = ev_form_field_button_new (id, ev_button_type);
2214 field_button = EV_FORM_FIELD_BUTTON (ev_field)((((EvFormFieldButton*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((ev_field)), ((ev_form_field_button_get_type
()))))))
;
2215
2216 field_button->state = poppler_form_field_button_get_state (poppler_field);
2217 }
2218 break;
2219 case POPPLER_FORM_FIELD_CHOICE: {
2220 EvFormFieldChoice *field_choice;
2221 EvFormFieldChoiceType ev_choice_type = EV_FORM_FIELD_CHOICE_COMBO;
2222
2223 switch (poppler_form_field_choice_get_choice_type (poppler_field)) {
2224 case POPPLER_FORM_CHOICE_COMBO:
2225 ev_choice_type = EV_FORM_FIELD_CHOICE_COMBO;
2226 break;
2227 case EV_FORM_FIELD_CHOICE_LIST:
2228 ev_choice_type = EV_FORM_FIELD_CHOICE_LIST;
2229 break;
2230 }
2231
2232 ev_field = ev_form_field_choice_new (id, ev_choice_type);
2233 field_choice = EV_FORM_FIELD_CHOICE (ev_field)((((EvFormFieldChoice*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((ev_field)), ((ev_form_field_choice_get_type
()))))))
;
2234
2235 field_choice->is_editable = poppler_form_field_choice_is_editable (poppler_field);
2236 field_choice->multi_select = poppler_form_field_choice_can_select_multiple (poppler_field);
2237 field_choice->do_spell_check = poppler_form_field_choice_do_spell_check (poppler_field);
2238 field_choice->commit_on_sel_change = poppler_form_field_choice_commit_on_change (poppler_field);
2239
2240 /* TODO: we need poppler_form_field_choice_get_selected_items in poppler
2241 field_choice->selected_items = poppler_form_field_choice_get_selected_items (poppler_field);*/
2242 if (field_choice->is_editable)
2243 field_choice->text = poppler_form_field_choice_get_text (poppler_field);
2244 }
2245 break;
2246 case POPPLER_FORM_FIELD_SIGNATURE:
2247 /* TODO */
2248 ev_field = ev_form_field_signature_new (id);
2249 break;
2250 case POPPLER_FORM_FIELD_UNKNOWN:
2251 return NULL__null;
2252 }
2253
2254 ev_field->font_size = font_size;
2255 ev_field->is_read_only = is_read_only;
2256
2257 if (action)
2258 ev_field->activation_link = ev_link_from_action (pdf_document, action);
2259
2260 return ev_field;
2261}
2262
2263static EvMappingList *
2264pdf_document_forms_get_form_fields (EvDocumentForms *document,
2265 EvPage *page)
2266{
2267 PopplerPage *poppler_page;
2268 GList *retval = NULL__null;
2269 GList *fields;
2270 GList *list;
2271 double height;
2272
2273 g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) ((page->backend_page)); GType __t = ((poppler_page_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning (((gchar*) 0
), ((const char*) (__PRETTY_FUNCTION__)), "POPPLER_IS_PAGE (page->backend_page)"
); return (__null); } } while (0)
;
2274
2275 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
2276 fields = poppler_page_get_form_field_mapping (poppler_page);
2277 poppler_page_get_size (poppler_page, NULL__null, &height);
2278
2279 for (list = fields; list; list = list->next) {
2280 PopplerFormFieldMapping *mapping;
2281 EvMapping *field_mapping;
2282 EvFormField *ev_field;
2283
2284 mapping = (PopplerFormFieldMapping *)list->data;
2285
2286 ev_field = ev_form_field_from_poppler_field (PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
, mapping->field);
2287 if (!ev_field)
2288 continue;
2289
2290 field_mapping = g_new0 (EvMapping, 1)((EvMapping *) g_malloc0_n ((1), sizeof (EvMapping)));
2291 field_mapping->area.x1 = mapping->area.x1;
2292 field_mapping->area.x2 = mapping->area.x2;
2293 field_mapping->area.y1 = height - mapping->area.y2;
2294 field_mapping->area.y2 = height - mapping->area.y1;
2295 field_mapping->data = ev_field;
2296 ev_field->page = EV_PAGE (g_object_ref (page))((((EvPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((((typename std::remove_reference<decltype (page)>::
type) (g_object_ref) (page)))), ((ev_page_get_type()))))))
;
2297
2298 g_object_set_data_full (G_OBJECT (ev_field)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_field)), (((GType) ((20) << (2))))))))
,
2299 "poppler-field",
2300 g_object_ref (mapping->field)((typename std::remove_reference<decltype (mapping->field
)>::type) (g_object_ref) (mapping->field))
,
2301 (GDestroyNotify) g_object_unref);
2302
2303 retval = g_list_prepend (retval, field_mapping);
2304 }
2305
2306 poppler_page_free_form_field_mapping (fields);
2307
2308 return retval ? ev_mapping_list_new (page->index,
2309 g_list_reverse (retval),
2310 (GDestroyNotify)g_object_unref) : NULL__null;
2311}
2312
2313static gboolean
2314pdf_document_forms_document_is_modified (EvDocumentForms *document)
2315{
2316 return PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified;
2317}
2318
2319static gchar *
2320pdf_document_forms_form_field_text_get_text (EvDocumentForms *document,
2321 EvFormField *field)
2322
2323{
2324 PopplerFormField *poppler_field;
2325 gchar *text;
2326
2327 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2328 if (!poppler_field)
2329 return NULL__null;
2330
2331 text = poppler_form_field_text_get_text (poppler_field);
2332
2333 return text;
2334}
2335
2336static void
2337pdf_document_forms_form_field_text_set_text (EvDocumentForms *document,
2338 EvFormField *field,
2339 const gchar *text)
2340{
2341 PopplerFormField *poppler_field;
2342
2343 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2344 if (!poppler_field)
2345 return;
2346
2347 poppler_form_field_text_set_text (poppler_field, text);
2348 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2349}
2350
2351static void
2352pdf_document_forms_form_field_button_set_state (EvDocumentForms *document,
2353 EvFormField *field,
2354 gboolean state)
2355{
2356 PopplerFormField *poppler_field;
2357
2358 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2359 if (!poppler_field)
2360 return;
2361
2362 poppler_form_field_button_set_state (poppler_field, state);
2363 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2364}
2365
2366static gboolean
2367pdf_document_forms_form_field_button_get_state (EvDocumentForms *document,
2368 EvFormField *field)
2369{
2370 PopplerFormField *poppler_field;
2371 gboolean state;
2372
2373 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2374 if (!poppler_field)
2375 return FALSE(0);
2376
2377 state = poppler_form_field_button_get_state (poppler_field);
2378
2379 return state;
2380}
2381
2382static gchar *
2383pdf_document_forms_form_field_choice_get_item (EvDocumentForms *document,
2384 EvFormField *field,
2385 gint index)
2386{
2387 PopplerFormField *poppler_field;
2388 gchar *text;
2389
2390 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2391 if (!poppler_field)
2392 return NULL__null;
2393
2394 text = poppler_form_field_choice_get_item (poppler_field, index);
2395
2396 return text;
2397}
2398
2399static int
2400pdf_document_forms_form_field_choice_get_n_items (EvDocumentForms *document,
2401 EvFormField *field)
2402{
2403 PopplerFormField *poppler_field;
2404 gint n_items;
2405
2406 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2407 if (!poppler_field)
2408 return -1;
2409
2410 n_items = poppler_form_field_choice_get_n_items (poppler_field);
2411
2412 return n_items;
2413}
2414
2415static gboolean
2416pdf_document_forms_form_field_choice_is_item_selected (EvDocumentForms *document,
2417 EvFormField *field,
2418 gint index)
2419{
2420 PopplerFormField *poppler_field;
2421 gboolean selected;
2422
2423 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2424 if (!poppler_field)
2425 return FALSE(0);
2426
2427 selected = poppler_form_field_choice_is_item_selected (poppler_field, index);
2428
2429 return selected;
2430}
2431
2432static void
2433pdf_document_forms_form_field_choice_select_item (EvDocumentForms *document,
2434 EvFormField *field,
2435 gint index)
2436{
2437 PopplerFormField *poppler_field;
2438
2439 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2440 if (!poppler_field)
2441 return;
2442
2443 poppler_form_field_choice_select_item (poppler_field, index);
2444 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2445}
2446
2447static void
2448pdf_document_forms_form_field_choice_toggle_item (EvDocumentForms *document,
2449 EvFormField *field,
2450 gint index)
2451{
2452 PopplerFormField *poppler_field;
2453
2454 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2455 if (!poppler_field)
2456 return;
2457
2458 poppler_form_field_choice_toggle_item (poppler_field, index);
2459 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2460}
2461
2462static void
2463pdf_document_forms_form_field_choice_unselect_all (EvDocumentForms *document,
2464 EvFormField *field)
2465{
2466 PopplerFormField *poppler_field;
2467
2468 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2469 if (!poppler_field)
2470 return;
2471
2472 poppler_form_field_choice_unselect_all (poppler_field);
2473 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2474}
2475
2476static void
2477pdf_document_forms_form_field_choice_set_text (EvDocumentForms *document,
2478 EvFormField *field,
2479 const gchar *text)
2480{
2481 PopplerFormField *poppler_field;
2482
2483 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2484 if (!poppler_field)
2485 return;
2486
2487 poppler_form_field_choice_set_text (poppler_field, text);
2488 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2489}
2490
2491static gchar *
2492pdf_document_forms_form_field_choice_get_text (EvDocumentForms *document,
2493 EvFormField *field)
2494{
2495 PopplerFormField *poppler_field;
2496 gchar *text;
2497
2498 poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"))((((PopplerFormField*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((field)), (((GType) ((20) << (2))))
)))), "poppler-field"))), ((poppler_form_field_get_type()))))
))
;
2499 if (!poppler_field)
2500 return NULL__null;
2501
2502 text = poppler_form_field_choice_get_text (poppler_field);
2503
2504 return text;
2505}
2506
2507static void
2508pdf_document_document_forms_iface_init (EvDocumentFormsInterface *iface)
2509{
2510 iface->get_form_fields = pdf_document_forms_get_form_fields;
2511 iface->document_is_modified = pdf_document_forms_document_is_modified;
2512 iface->form_field_text_get_text = pdf_document_forms_form_field_text_get_text;
2513 iface->form_field_text_set_text = pdf_document_forms_form_field_text_set_text;
2514 iface->form_field_button_set_state = pdf_document_forms_form_field_button_set_state;
2515 iface->form_field_button_get_state = pdf_document_forms_form_field_button_get_state;
2516 iface->form_field_choice_get_item = pdf_document_forms_form_field_choice_get_item;
2517 iface->form_field_choice_get_n_items = pdf_document_forms_form_field_choice_get_n_items;
2518 iface->form_field_choice_is_item_selected = pdf_document_forms_form_field_choice_is_item_selected;
2519 iface->form_field_choice_select_item = pdf_document_forms_form_field_choice_select_item;
2520 iface->form_field_choice_toggle_item = pdf_document_forms_form_field_choice_toggle_item;
2521 iface->form_field_choice_unselect_all = pdf_document_forms_form_field_choice_unselect_all;
2522 iface->form_field_choice_set_text = pdf_document_forms_form_field_choice_set_text;
2523 iface->form_field_choice_get_text = pdf_document_forms_form_field_choice_get_text;
2524}
2525
2526/* Annotations */
2527static void
2528poppler_annot_color_to_cdk_color (PopplerAnnot *poppler_annot,
2529 CdkColor *color)
2530{
2531 PopplerColor *poppler_color;
2532
2533 poppler_color = poppler_annot_get_color (poppler_annot);
2534 if (poppler_color) {
2535 color->red = poppler_color->red;
2536 color->green = poppler_color->green;
2537 color->blue = poppler_color->blue;
2538
2539 g_free (poppler_color);
2540 } /* TODO: else use a default color */
2541}
2542
2543static EvAnnotationTextIcon
2544get_annot_text_icon (PopplerAnnotText *poppler_annot)
2545{
2546 gchar *icon = poppler_annot_text_get_icon (poppler_annot);
2547 EvAnnotationTextIcon retval;
2548
2549 if (!icon)
2550 return EV_ANNOTATION_TEXT_ICON_UNKNOWN;
2551
2552 if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_NOTE"Note") == 0)
2553 retval = EV_ANNOTATION_TEXT_ICON_NOTE;
2554 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_COMMENT"Comment") == 0)
2555 retval = EV_ANNOTATION_TEXT_ICON_COMMENT;
2556 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_KEY"Key") == 0)
2557 retval = EV_ANNOTATION_TEXT_ICON_KEY;
2558 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_HELP"Help") == 0)
2559 retval = EV_ANNOTATION_TEXT_ICON_HELP;
2560 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH"NewParagraph") == 0)
2561 retval = EV_ANNOTATION_TEXT_ICON_NEW_PARAGRAPH;
2562 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_PARAGRAPH"Paragraph") == 0)
2563 retval = EV_ANNOTATION_TEXT_ICON_PARAGRAPH;
2564 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_INSERT"Insert") == 0)
2565 retval = EV_ANNOTATION_TEXT_ICON_INSERT;
2566 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_CROSS"Cross") == 0)
2567 retval = EV_ANNOTATION_TEXT_ICON_CROSS;
2568 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_CIRCLE"Circle") == 0)
2569 retval = EV_ANNOTATION_TEXT_ICON_CIRCLE;
2570 else
2571 retval = EV_ANNOTATION_TEXT_ICON_UNKNOWN;
2572
2573 g_free (icon);
2574
2575 return retval;
2576}
2577
2578static const gchar *
2579get_poppler_annot_text_icon (EvAnnotationTextIcon icon)
2580{
2581 switch (icon) {
2582 case EV_ANNOTATION_TEXT_ICON_NOTE:
2583 return POPPLER_ANNOT_TEXT_ICON_NOTE"Note";
2584 case EV_ANNOTATION_TEXT_ICON_COMMENT:
2585 return POPPLER_ANNOT_TEXT_ICON_COMMENT"Comment";
2586 case EV_ANNOTATION_TEXT_ICON_KEY:
2587 return POPPLER_ANNOT_TEXT_ICON_KEY"Key";
2588 case EV_ANNOTATION_TEXT_ICON_HELP:
2589 return POPPLER_ANNOT_TEXT_ICON_HELP"Help";
2590 case EV_ANNOTATION_TEXT_ICON_NEW_PARAGRAPH:
2591 return POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH"NewParagraph";
2592 case EV_ANNOTATION_TEXT_ICON_PARAGRAPH:
2593 return POPPLER_ANNOT_TEXT_ICON_PARAGRAPH"Paragraph";
2594 case EV_ANNOTATION_TEXT_ICON_INSERT:
2595 return POPPLER_ANNOT_TEXT_ICON_INSERT"Insert";
2596 case EV_ANNOTATION_TEXT_ICON_CROSS:
2597 return POPPLER_ANNOT_TEXT_ICON_CROSS"Cross";
2598 case EV_ANNOTATION_TEXT_ICON_CIRCLE:
2599 return POPPLER_ANNOT_TEXT_ICON_CIRCLE"Circle";
2600 case EV_ANNOTATION_TEXT_ICON_UNKNOWN:
2601 default:
2602 return POPPLER_ANNOT_TEXT_ICON_NOTE"Note";
2603 }
2604}
2605
2606static EvAnnotation *
2607ev_annot_from_poppler_annot (PopplerAnnot *poppler_annot,
2608 EvPage *page)
2609{
2610 EvAnnotation *ev_annot = NULL__null;
2611 const gchar *unimplemented_annot = NULL__null;
2612
2613 switch (poppler_annot_get_annot_type (poppler_annot)) {
2614 case POPPLER_ANNOT_TEXT: {
2615 PopplerAnnotText *poppler_text;
2616 EvAnnotationText *ev_annot_text;
2617
2618 poppler_text = POPPLER_ANNOT_TEXT (poppler_annot)((((PopplerAnnotText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((poppler_annot)), ((poppler_annot_text_get_type
()))))))
;
2619
2620 ev_annot = ev_annotation_text_new (page);
2621
2622 ev_annot_text = EV_ANNOTATION_TEXT (ev_annot)((((EvAnnotationText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((ev_annot)), ((ev_annotation_text_get_type()
))))))
;
2623 ev_annotation_text_set_is_open (ev_annot_text,
2624 poppler_annot_text_get_is_open (poppler_text));
2625 ev_annotation_text_set_icon (ev_annot_text, get_annot_text_icon (poppler_text));
2626 }
2627 break;
2628 case POPPLER_ANNOT_FILE_ATTACHMENT: {
2629 PopplerAnnotFileAttachment *poppler_annot_attachment;
2630 PopplerAttachment *poppler_attachment;
2631 gchar *data = NULL__null;
2632 gsize size;
2633 GError *error = NULL__null;
2634
2635 poppler_annot_attachment = POPPLER_ANNOT_FILE_ATTACHMENT (poppler_annot)((((PopplerAnnotFileAttachment*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((poppler_annot)), ((poppler_annot_markup_get_type
()))))))
;
2636 poppler_attachment = poppler_annot_file_attachment_get_attachment (poppler_annot_attachment);
2637
2638 if (poppler_attachment &&
2639 attachment_save_to_buffer (poppler_attachment, &data, &size, &error)) {
2640 EvAttachment *ev_attachment;
2641
2642 ev_attachment = ev_attachment_new (poppler_attachment->name,
2643 poppler_attachment->description,
2644 poppler_attachment->mtime,
2645 poppler_attachment->ctime,
2646 size, data);
2647 ev_annot = ev_annotation_attachment_new (page, ev_attachment);
2648 g_object_unref (ev_attachment);
2649 } else if (error) {
2650 g_warning ("%s", error->message);
2651 g_error_free (error);
2652 }
2653
2654 if (poppler_attachment)
2655 g_object_unref (poppler_attachment);
2656 }
2657 break;
2658 case POPPLER_ANNOT_LINK:
2659 case POPPLER_ANNOT_WIDGET:
2660 /* Ignore link and widgets annots since they are already handled */
2661 break;
2662 default: {
2663 GEnumValue *enum_value;
2664
2665 enum_value = g_enum_get_value ((GEnumClass *) g_type_class_ref (POPPLER_TYPE_ANNOT_TYPE(poppler_annot_type_get_type ())),
2666 poppler_annot_get_annot_type (poppler_annot));
2667 unimplemented_annot = enum_value ? enum_value->value_name : "Unknown annotation";
2668 }
2669 }
2670
2671 if (unimplemented_annot) {
2672 g_warning ("Unimplemented annotation: %s, please post a "
2673 "bug report on Lector bug tracker "
2674 "(https://github.com/cafe-desktop/lector/issues) with a testcase.",
2675 unimplemented_annot);
2676 }
2677
2678 if (ev_annot) {
2679 time_t utime;
2680 gchar *modified;
2681 gchar *contents;
2682 gchar *name;
2683 CdkColor color;
2684
2685 contents = poppler_annot_get_contents (poppler_annot);
2686 if (contents) {
2687 ev_annotation_set_contents (ev_annot, contents);
2688 g_free (contents);
2689 }
2690
2691 name = poppler_annot_get_name (poppler_annot);
2692 if (name) {
2693 ev_annotation_set_name (ev_annot, name);
2694 g_free (name);
2695 }
2696
2697 modified = poppler_annot_get_modified (poppler_annot);
2698 if (poppler_date_parse (modified, &utime)) {
2699 ev_annotation_set_modified_from_time (ev_annot, utime);
2700 } else {
2701 ev_annotation_set_modified (ev_annot, modified);
2702 }
2703 g_free (modified);
2704
2705 poppler_annot_color_to_cdk_color (poppler_annot, &color);
2706 ev_annotation_set_color (ev_annot, &color);
2707
2708 if (POPPLER_IS_ANNOT_MARKUP (poppler_annot)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(poppler_annot)); GType __t = ((poppler_annot_markup_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; }))))
) {
2709 PopplerAnnotMarkup *markup;
2710 gchar *label;
2711 gdouble opacity;
2712 PopplerRectangle poppler_rect;
2713
2714 markup = POPPLER_ANNOT_MARKUP (poppler_annot)((((PopplerAnnotMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((poppler_annot)), ((poppler_annot_markup_get_type
()))))))
;
2715
2716 if (poppler_annot_markup_get_popup_rectangle (markup, &poppler_rect)) {
2717 EvRectangle ev_rect;
2718 gboolean is_open;
2719 gdouble height;
2720
2721 poppler_page_get_size (POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
,
2722 NULL__null, &height);
2723 ev_rect.x1 = poppler_rect.x1;
2724 ev_rect.x2 = poppler_rect.x2;
2725 ev_rect.y1 = height - poppler_rect.y2;
2726 ev_rect.y2 = height - poppler_rect.y1;
2727
2728 is_open = poppler_annot_markup_get_popup_is_open (markup);
2729
2730 g_object_set (ev_annot,
2731 "rectangle", &ev_rect,
2732 "popup_is_open", is_open,
2733 "has_popup", TRUE(!(0)),
2734 NULL__null);
2735 } else {
2736 g_object_set (ev_annot,
2737 "has_popup", FALSE(0),
2738 NULL__null);
2739 }
2740
2741 label = poppler_annot_markup_get_label (markup);
2742 opacity = poppler_annot_markup_get_opacity (markup);
2743
2744 g_object_set (ev_annot,
2745 "label", label,
2746 "opacity", opacity,
2747 NULL__null);
2748
2749 g_free (label);
2750 }
2751 }
2752
2753 return ev_annot;
2754}
2755
2756static void
2757annot_set_unique_name (EvAnnotation *annot)
2758{
2759 gchar *name;
2760
2761 name = g_strdup_printf ("annot-%" G_GUINT64_FORMAT"lu", g_get_real_time ());
2762 ev_annotation_set_name (annot, name);
2763 g_free (name);
2764}
2765
2766static EvMappingList *
2767pdf_document_annotations_get_annotations (EvDocumentAnnotations *document_annotations,
2768 EvPage *page)
2769{
2770 GList *retval = NULL__null;
2771 PdfDocument *pdf_document;
2772 PopplerPage *poppler_page;
2773 EvMappingList *mapping_list;
2774 GList *annots;
2775 GList *list;
2776 gdouble height;
2777 gint i = 0;
2778
2779 pdf_document = PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
;
2780 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
2781
2782 if (pdf_document->annots) {
2783 mapping_list = (EvMappingList *)g_hash_table_lookup (pdf_document->annots,
2784 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)));
2785 if (mapping_list)
2786 return ev_mapping_list_ref (mapping_list);
2787 }
2788
2789 annots = poppler_page_get_annot_mapping (poppler_page);
2790 poppler_page_get_size (poppler_page, NULL__null, &height);
2791
2792 for (list = annots; list; list = list->next) {
2793 PopplerAnnotMapping *mapping;
2794 EvMapping *annot_mapping;
2795 EvAnnotation *ev_annot;
2796
2797 mapping = (PopplerAnnotMapping *)list->data;
2798
2799 ev_annot = ev_annot_from_poppler_annot (mapping->annot, page);
2800 if (!ev_annot)
2801 continue;
2802
2803 i++;
2804
2805 /* Make sure annot has a unique name */
2806 if (!ev_annotation_get_name (ev_annot))
2807 annot_set_unique_name (ev_annot);
2808
2809 annot_mapping = g_new (EvMapping, 1)((EvMapping *) g_malloc_n ((1), sizeof (EvMapping)));
2810 annot_mapping->area.x1 = mapping->area.x1;
2811 annot_mapping->area.x2 = mapping->area.x2;
2812 annot_mapping->area.y1 = height - mapping->area.y2;
2813 annot_mapping->area.y2 = height - mapping->area.y1;
2814 annot_mapping->data = ev_annot;
2815
2816 g_object_set_data_full (G_OBJECT (ev_annot)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_annot)), (((GType) ((20) << (2))))))))
,
2817 "poppler-annot",
2818 g_object_ref (mapping->annot)((typename std::remove_reference<decltype (mapping->annot
)>::type) (g_object_ref) (mapping->annot))
,
2819 (GDestroyNotify) g_object_unref);
2820
2821 retval = g_list_prepend (retval, annot_mapping);
2822 }
2823
2824 poppler_page_free_annot_mapping (annots);
2825
2826 if (!retval)
2827 return NULL__null;
2828
2829 if (!pdf_document->annots) {
2830 pdf_document->annots = g_hash_table_new_full (g_direct_hash,
2831 g_direct_equal,
2832 (GDestroyNotify)NULL__null,
2833 (GDestroyNotify)ev_mapping_list_unref);
2834 }
2835
2836 mapping_list = ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
2837 g_hash_table_insert (pdf_document->annots,
2838 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)),
2839 ev_mapping_list_ref (mapping_list));
2840
2841 return mapping_list;
2842}
2843
2844static gboolean
2845pdf_document_annotations_document_is_modified (EvDocumentAnnotations *document_annotations)
2846{
2847 return PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
->annots_modified;
2848}
2849
2850static void
2851pdf_document_annotations_remove_annotation (EvDocumentAnnotations *document_annotations,
2852 EvAnnotation *annot)
2853{
2854 PopplerPage *poppler_page;
2855 PdfDocument *pdf_document;
2856 EvPage *page;
2857 PopplerAnnot *poppler_annot;
2858 EvMappingList *mapping_list;
2859 EvMapping *annot_mapping;
2860 GList *list;
2861
2862 poppler_annot = POPPLER_ANNOT (g_object_get_data (G_OBJECT (annot), "poppler-annot"))((((PopplerAnnot*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((annot)), (((GType) ((20) << (2))))
)))), "poppler-annot"))), ((poppler_annot_get_type()))))))
;
2863 pdf_document = PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
;
2864 page = ev_annotation_get_page (annot);
2865 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
2866
2867 poppler_page_remove_annot (poppler_page, poppler_annot);
2868
2869 /* We don't check for pdf_document->annots, if it were NULL then something is really wrong */
2870 mapping_list = (EvMappingList *)g_hash_table_lookup (pdf_document->annots,
2871 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)));
2872 if (mapping_list) {
2873 annot_mapping = ev_mapping_list_find (mapping_list, annot);
2874 ev_mapping_list_remove (mapping_list, annot_mapping);
2875 if (ev_mapping_list_length (mapping_list) == 0)
2876 g_hash_table_remove (pdf_document->annots, GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)));
2877 }
2878
2879 pdf_document->annots_modified = TRUE(!(0));
2880}
2881
2882static void
2883pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotations,
2884 EvAnnotation *annot,
2885 EvRectangle *rect)
2886{
2887 PopplerAnnot *poppler_annot;
2888 PdfDocument *pdf_document;
2889 EvPage *page;
2890 PopplerPage *poppler_page;
2891 GList *list = NULL__null;
2892 EvMappingList *mapping_list;
2893 EvMapping *annot_mapping;
2894 PopplerRectangle poppler_rect;
2895 gdouble height;
2896 PopplerColor poppler_color;
2897 CdkColor color;
2898
2899 pdf_document = PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
;
2900 page = ev_annotation_get_page (annot);
2901 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
2902
2903 poppler_page_get_size (poppler_page, NULL__null, &height);
2904 poppler_rect.x1 = rect->x1;
2905 poppler_rect.x2 = rect->x2;
2906 poppler_rect.y1 = height - rect->y2;
2907 poppler_rect.y2 = height - rect->y1;
2908
2909 switch (ev_annotation_get_annotation_type (annot)) {
2910 case EV_ANNOTATION_TYPE_TEXT: {
2911 EvAnnotationText *text = EV_ANNOTATION_TEXT (annot)((((EvAnnotationText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((annot)), ((ev_annotation_text_get_type())))
)))
;
2912 EvAnnotationTextIcon icon;
2913
2914 poppler_annot = poppler_annot_text_new (pdf_document->document, &poppler_rect);
2915
2916 icon = ev_annotation_text_get_icon (text);
2917 poppler_annot_text_set_icon (POPPLER_ANNOT_TEXT (poppler_annot)((((PopplerAnnotText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((poppler_annot)), ((poppler_annot_text_get_type
()))))))
,
2918 get_poppler_annot_text_icon (icon));
2919 }
2920 break;
2921 default:
2922 g_assert_not_reached ()do { g_assertion_message_expr (((gchar*) 0), "ev-poppler.cc",
2922, ((const char*) (__PRETTY_FUNCTION__)), __null); } while
(0)
;
2923 }
2924
2925 ev_annotation_get_color (annot, &color);
2926 poppler_color.red = color.red;
2927 poppler_color.green = color.green;
2928 poppler_color.blue = color.blue;
2929 poppler_annot_set_color (poppler_annot, &poppler_color);
2930
2931 if (EV_IS_ANNOTATION_MARKUP (annot)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(annot)); GType __t = ((ev_annotation_markup_get_type ())); gboolean
__r; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
) {
2932 EvAnnotationMarkup *markup = EV_ANNOTATION_MARKUP (annot)((((EvAnnotationMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((annot)), ((ev_annotation_markup_get_type (
)))))))
;
2933 const gchar *label;
2934
2935 if (ev_annotation_markup_has_popup (markup)) {
2936 EvRectangle popup_rect;
2937
2938 ev_annotation_markup_get_rectangle (markup, &popup_rect);
2939 poppler_rect.x1 = popup_rect.x1;
2940 poppler_rect.x2 = popup_rect.x2;
2941 poppler_rect.y1 = height - popup_rect.y2;
2942 poppler_rect.y2 = height - popup_rect.y1;
2943 poppler_annot_markup_set_popup (POPPLER_ANNOT_MARKUP (poppler_annot)((((PopplerAnnotMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((poppler_annot)), ((poppler_annot_markup_get_type
()))))))
, &poppler_rect);
2944 poppler_annot_markup_set_popup_is_open (POPPLER_ANNOT_MARKUP (poppler_annot)((((PopplerAnnotMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((poppler_annot)), ((poppler_annot_markup_get_type
()))))))
,
2945 ev_annotation_markup_get_popup_is_open (markup));
2946 }
2947
2948 label = ev_annotation_markup_get_label (markup);
2949 if (label)
2950 poppler_annot_markup_set_label (POPPLER_ANNOT_MARKUP (poppler_annot)((((PopplerAnnotMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((poppler_annot)), ((poppler_annot_markup_get_type
()))))))
, label);
2951 }
2952
2953 poppler_page_add_annot (poppler_page, poppler_annot);
2954
2955 annot_mapping = g_new (EvMapping, 1)((EvMapping *) g_malloc_n ((1), sizeof (EvMapping)));
2956 annot_mapping->area = *rect;
2957 annot_mapping->data = annot;
2958 g_object_set_data_full (G_OBJECT (annot)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((annot)), (((GType) ((20) << (2))))))))
,
2959 "poppler-annot",
2960 poppler_annot,
2961 (GDestroyNotify) g_object_unref);
2962
2963 if (pdf_document->annots) {
2964 mapping_list = (EvMappingList *)g_hash_table_lookup (pdf_document->annots,
2965 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)));
2966 } else {
2967 pdf_document->annots = g_hash_table_new_full (g_direct_hash,
2968 g_direct_equal,
2969 (GDestroyNotify)NULL__null,
2970 (GDestroyNotify)ev_mapping_list_unref);
2971 mapping_list = NULL__null;
2972 }
2973
2974 annot_set_unique_name (annot);
2975
2976 if (mapping_list) {
2977 list = ev_mapping_list_get_list (mapping_list);
2978 list = g_list_append (list, annot_mapping);
Value stored to 'list' is never read
2979 } else {
2980 list = g_list_append (list, annot_mapping);
2981 mapping_list = ev_mapping_list_new (page->index, list, (GDestroyNotify)g_object_unref);
2982 g_hash_table_insert (pdf_document->annots,
2983 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)),
2984 ev_mapping_list_ref (mapping_list));
2985 }
2986
2987 pdf_document->annots_modified = TRUE(!(0));
2988}
2989
2990static void
2991pdf_document_annotations_save_annotation (EvDocumentAnnotations *document_annotations,
2992 EvAnnotation *annot,
2993 EvAnnotationsSaveMask mask)
2994{
2995 PopplerAnnot *poppler_annot;
2996
2997 poppler_annot = POPPLER_ANNOT (g_object_get_data (G_OBJECT (annot), "poppler-annot"))((((PopplerAnnot*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((annot)), (((GType) ((20) << (2))))
)))), "poppler-annot"))), ((poppler_annot_get_type()))))))
;
2998 if (!poppler_annot)
2999 return;
3000
3001 if (mask & EV_ANNOTATIONS_SAVE_CONTENTS)
3002 poppler_annot_set_contents (poppler_annot,
3003 ev_annotation_get_contents (annot));
3004
3005 if (mask & EV_ANNOTATIONS_SAVE_COLOR) {
3006 PopplerColor color;
3007 CdkColor ev_color;
3008
3009 ev_annotation_get_color (annot, &ev_color);
3010 color.red = ev_color.red;
3011 color.green = ev_color.green;
3012 color.blue = ev_color.blue;
3013 poppler_annot_set_color (poppler_annot, &color);
3014 }
3015
3016 if (EV_IS_ANNOTATION_MARKUP (annot)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(annot)); GType __t = ((ev_annotation_markup_get_type ())); gboolean
__r; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
) {
3017 EvAnnotationMarkup *ev_markup = EV_ANNOTATION_MARKUP (annot)((((EvAnnotationMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((annot)), ((ev_annotation_markup_get_type (
)))))))
;
3018 PopplerAnnotMarkup *markup = POPPLER_ANNOT_MARKUP (poppler_annot)((((PopplerAnnotMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((poppler_annot)), ((poppler_annot_markup_get_type
()))))))
;
3019
3020 if (mask & EV_ANNOTATIONS_SAVE_LABEL)
3021 poppler_annot_markup_set_label (markup, ev_annotation_markup_get_label (ev_markup));
3022 if (mask & EV_ANNOTATIONS_SAVE_OPACITY)
3023 poppler_annot_markup_set_opacity (markup, ev_annotation_markup_get_opacity (ev_markup));
3024 if (mask & EV_ANNOTATIONS_SAVE_POPUP_IS_OPEN)
3025 poppler_annot_markup_set_popup_is_open (markup, ev_annotation_markup_get_popup_is_open (ev_markup));
3026 }
3027
3028 if (EV_IS_ANNOTATION_TEXT (annot)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (
(annot)); GType __t = ((ev_annotation_text_get_type())); gboolean
__r; if (!__inst) __r = (0); else if (__inst->g_class &&
__inst->g_class->g_type == __t) __r = (!(0)); else __r
= g_type_check_instance_is_a (__inst, __t); __r; }))))
) {
3029 EvAnnotationText *ev_text = EV_ANNOTATION_TEXT (annot)((((EvAnnotationText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((annot)), ((ev_annotation_text_get_type())))
)))
;
3030 PopplerAnnotText *text = POPPLER_ANNOT_TEXT (poppler_annot)((((PopplerAnnotText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((poppler_annot)), ((poppler_annot_text_get_type
()))))))
;
3031
3032 if (mask & EV_ANNOTATIONS_SAVE_TEXT_IS_OPEN) {
3033 poppler_annot_text_set_is_open (text,
3034 ev_annotation_text_get_is_open (ev_text));
3035 }
3036 if (mask & EV_ANNOTATIONS_SAVE_TEXT_ICON) {
3037 EvAnnotationTextIcon icon;
3038
3039 icon = ev_annotation_text_get_icon (ev_text);
3040 poppler_annot_text_set_icon (text, get_poppler_annot_text_icon (icon));
3041 }
3042 }
3043
3044 PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
->annots_modified = TRUE(!(0));
3045}
3046
3047static void
3048pdf_document_document_annotations_iface_init (EvDocumentAnnotationsInterface *iface)
3049{
3050 iface->get_annotations = pdf_document_annotations_get_annotations;
3051 iface->document_is_modified = pdf_document_annotations_document_is_modified;
3052 iface->add_annotation = pdf_document_annotations_add_annotation;
3053 iface->save_annotation = pdf_document_annotations_save_annotation;
3054 iface->remove_annotation = pdf_document_annotations_remove_annotation;
3055}
3056
3057/* Attachments */
3058struct SaveToBufferData {
3059 gchar *buffer;
3060 gsize len, max;
3061};
3062
3063static gboolean
3064attachment_save_to_buffer_callback (const gchar *buf,
3065 gsize count,
3066 gpointer user_data,
3067 GError **error)
3068{
3069 struct SaveToBufferData *sdata = (SaveToBufferData *)user_data;
3070 gchar *new_buffer;
3071 gsize new_max;
3072
3073 if (sdata->len + count > sdata->max) {
3074 new_max = MAX (sdata->max * 2, sdata->len + count)(((sdata->max * 2) > (sdata->len + count)) ? (sdata->
max * 2) : (sdata->len + count))
;
3075 new_buffer = (gchar *)g_realloc (sdata->buffer, new_max);
3076
3077 sdata->buffer = new_buffer;
3078 sdata->max = new_max;
3079 }
3080
3081 memcpy (sdata->buffer + sdata->len, buf, count);
3082 sdata->len += count;
3083
3084 return TRUE(!(0));
3085}
3086
3087static gboolean
3088attachment_save_to_buffer (PopplerAttachment *attachment,
3089 gchar **buffer,
3090 gsize *buffer_size,
3091 GError **error)
3092{
3093 static const gint initial_max = 1024;
3094 struct SaveToBufferData sdata;
3095
3096 *buffer = NULL__null;
3097 *buffer_size = 0;
3098
3099 sdata.buffer = (gchar *) g_malloc (initial_max);
3100 sdata.max = initial_max;
3101 sdata.len = 0;
3102
3103 if (! poppler_attachment_save_to_callback (attachment,
3104 attachment_save_to_buffer_callback,
3105 &sdata,
3106 error)) {
3107 g_free (sdata.buffer);
3108 return FALSE(0);
3109 }
3110
3111 *buffer = sdata.buffer;
3112 *buffer_size = sdata.len;
3113
3114 return TRUE(!(0));
3115}
3116
3117static GList *
3118pdf_document_attachments_get_attachments (EvDocumentAttachments *document)
3119{
3120 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
3121 GList *attachments;
3122 GList *list;
3123 GList *retval = NULL__null;
3124
3125 attachments = poppler_document_get_attachments (pdf_document->document);
3126
3127 for (list = attachments; list; list = list->next) {
3128 PopplerAttachment *attachment;
3129 EvAttachment *ev_attachment;
3130 gchar *data = NULL__null;
3131 gsize size;
3132 GError *error = NULL__null;
3133
3134 attachment = (PopplerAttachment *) list->data;
3135
3136 if (attachment_save_to_buffer (attachment, &data, &size, &error)) {
3137 ev_attachment = ev_attachment_new (attachment->name,
3138 attachment->description,
3139 attachment->mtime,
3140 attachment->ctime,
3141 size, data);
3142
3143 retval = g_list_prepend (retval, ev_attachment);
3144 } else {
3145 if (error) {
3146 g_warning ("%s", error->message);
3147 g_error_free (error);
3148
3149 g_free (data);
3150 }
3151 }
3152
3153 g_object_unref (attachment);
3154 }
3155
3156 return g_list_reverse (retval);
3157}
3158
3159static gboolean
3160pdf_document_attachments_has_attachments (EvDocumentAttachments *document)
3161{
3162 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
3163
3164 return poppler_document_has_attachments (pdf_document->document);
3165}
3166
3167static void
3168pdf_document_document_attachments_iface_init (EvDocumentAttachmentsInterface *iface)
3169{
3170 iface->has_attachments = pdf_document_attachments_has_attachments;
3171 iface->get_attachments = pdf_document_attachments_get_attachments;
3172}
3173
3174/* Layers */
3175static gboolean
3176pdf_document_layers_has_layers (EvDocumentLayers *document)
3177{
3178 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
3179 PopplerLayersIter *iter;
3180
3181 iter = poppler_layers_iter_new (pdf_document->document);
3182 if (!iter)
3183 return FALSE(0);
3184 poppler_layers_iter_free (iter);
3185
3186 return TRUE(!(0));
3187}
3188
3189static void
3190build_layers_tree (PdfDocument *pdf_document,
3191 CtkTreeModel *model,
3192 CtkTreeIter *parent,
3193 PopplerLayersIter *iter)
3194{
3195 do {
3196 CtkTreeIter tree_iter;
3197 PopplerLayersIter *child;
3198 PopplerLayer *layer;
3199 EvLayer *ev_layer = NULL__null;
3200 gboolean visible;
3201 gchar *markup;
3202 gint rb_group = 0;
3203
3204 layer = poppler_layers_iter_get_layer (iter);
3205 if (layer) {
3206 markup = g_markup_escape_text (poppler_layer_get_title (layer), -1);
3207 visible = poppler_layer_is_visible (layer);
3208 rb_group = poppler_layer_get_radio_button_group_id (layer);
3209 ev_layer = ev_layer_new (poppler_layer_is_parent (layer),
3210 rb_group);
3211 g_object_set_data_full (G_OBJECT (ev_layer)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_layer)), (((GType) ((20) << (2))))))))
,
3212 "poppler-layer",
3213 g_object_ref (layer)((typename std::remove_reference<decltype (layer)>::type
) (g_object_ref) (layer))
,
3214 (GDestroyNotify) g_object_unref);
3215 } else {
3216 gchar *title;
3217
3218 title = poppler_layers_iter_get_title (iter);
3219 markup = g_markup_escape_text (title, -1);
3220 g_free (title);
3221
3222 visible = FALSE(0);
3223 layer = NULL__null;
3224 }
3225
3226 ctk_tree_store_append (CTK_TREE_STORE (model)((((CtkTreeStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_tree_store_get_type ()))))))
, &tree_iter, parent);
3227 ctk_tree_store_set (CTK_TREE_STORE (model)((((CtkTreeStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_tree_store_get_type ()))))))
, &tree_iter,
3228 EV_DOCUMENT_LAYERS_COLUMN_TITLE, markup,
3229 EV_DOCUMENT_LAYERS_COLUMN_VISIBLE, visible,
3230 EV_DOCUMENT_LAYERS_COLUMN_ENABLED, TRUE(!(0)), /* FIXME */
3231 EV_DOCUMENT_LAYERS_COLUMN_SHOWTOGGLE, (layer != NULL__null),
3232 EV_DOCUMENT_LAYERS_COLUMN_RBGROUP, rb_group,
3233 EV_DOCUMENT_LAYERS_COLUMN_LAYER, ev_layer,
3234 -1);
3235 if (ev_layer)
3236 g_object_unref (ev_layer);
3237 g_free (markup);
3238
3239 child = poppler_layers_iter_get_child (iter);
3240 if (child)
3241 build_layers_tree (pdf_document, model, &tree_iter, child);
3242 poppler_layers_iter_free (child);
3243 } while (poppler_layers_iter_next (iter));
3244}
3245
3246static CtkTreeModel *
3247pdf_document_layers_get_layers (EvDocumentLayers *document)
3248{
3249 CtkTreeModel *model = NULL__null;
3250 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
3251 PopplerLayersIter *iter;
3252
3253 iter = poppler_layers_iter_new (pdf_document->document);
3254 if (iter) {
3255 model = (CtkTreeModel *) ctk_tree_store_new (EV_DOCUMENT_LAYERS_N_COLUMNS,
3256 G_TYPE_STRING((GType) ((16) << (2))), /* TITLE */
3257 G_TYPE_OBJECT((GType) ((20) << (2))), /* LAYER */
3258 G_TYPE_BOOLEAN((GType) ((5) << (2))), /* VISIBLE */
3259 G_TYPE_BOOLEAN((GType) ((5) << (2))), /* ENABLED */
3260 G_TYPE_BOOLEAN((GType) ((5) << (2))), /* SHOWTOGGLE */
3261 G_TYPE_INT((GType) ((6) << (2)))); /* RBGROUP */
3262 build_layers_tree (pdf_document, model, NULL__null, iter);
3263 poppler_layers_iter_free (iter);
3264 }
3265 return model;
3266}
3267
3268static void
3269pdf_document_layers_show_layer (EvDocumentLayers *document,
3270 EvLayer *layer)
3271{
3272 PopplerLayer *poppler_layer;
3273
3274 poppler_layer = POPPLER_LAYER (g_object_get_data (G_OBJECT (layer), "poppler-layer"))((((PopplerLayer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((layer)), (((GType) ((20) << (2))))
)))), "poppler-layer"))), ((poppler_layer_get_type()))))))
;
3275 poppler_layer_show (poppler_layer);
3276}
3277
3278static void
3279pdf_document_layers_hide_layer (EvDocumentLayers *document,
3280 EvLayer *layer)
3281{
3282 PopplerLayer *poppler_layer;
3283
3284 poppler_layer = POPPLER_LAYER (g_object_get_data (G_OBJECT (layer), "poppler-layer"))((((PopplerLayer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((layer)), (((GType) ((20) << (2))))
)))), "poppler-layer"))), ((poppler_layer_get_type()))))))
;
3285 poppler_layer_hide (poppler_layer);
3286}
3287
3288static gboolean
3289pdf_document_layers_layer_is_visible (EvDocumentLayers *document,
3290 EvLayer *layer)
3291{
3292 PopplerLayer *poppler_layer;
3293
3294 poppler_layer = POPPLER_LAYER (g_object_get_data (G_OBJECT (layer), "poppler-layer"))((((PopplerLayer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((g_object_get_data (((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((layer)), (((GType) ((20) << (2))))
)))), "poppler-layer"))), ((poppler_layer_get_type()))))))
;
3295 return poppler_layer_is_visible (poppler_layer);
3296}
3297
3298static void
3299pdf_document_document_layers_iface_init (EvDocumentLayersInterface *iface)
3300{
3301 iface->has_layers = pdf_document_layers_has_layers;
3302 iface->get_layers = pdf_document_layers_get_layers;
3303 iface->show_layer = pdf_document_layers_show_layer;
3304 iface->hide_layer = pdf_document_layers_hide_layer;
3305 iface->layer_is_visible = pdf_document_layers_layer_is_visible;
3306}