Bug Summary

File:backend/pdf/ev-poppler.cc
Warning:line 2979, 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 -fdebug-compilation-dir=/rootdir/backend/pdf -fcoverage-compilation-dir=/rootdir/backend/pdf -resource-dir /usr/lib/llvm-21/lib/clang/21 -D HAVE_CONFIG_H -I . -I ../.. -I ../.. -I ../../libdocument -D CAFELOCALEDIR="/usr/share/locale" -D LECTOR_COMPILATION -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/glycin-2 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/atk-1.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/fribidi -I /usr/include/pixman-1 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/gio-unix-2.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/sysprof-6 -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/sysprof-6 -I /usr/include/cairo -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/pixman-1 -I /usr/include/poppler -I /usr/include/libxml2 -D PIC -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/x86_64-linux-gnu/c++/15 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/backward -internal-isystem /usr/lib/llvm-21/lib/clang/21/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../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 -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -analyzer-checker deadcode.DeadStores -analyzer-checker security.ArrayBound -analyzer-checker unix.cstring.NotNullTerminated -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -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/2026-04-20-070810-53251-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 G_GNUC_UNUSED__attribute__ ((__unused__)),
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 G_GNUC_UNUSED__attribute__ ((__unused__)),
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 G_GNUC_UNUSED__attribute__ ((__unused__)),
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 G_GNUC_UNUSED__attribute__ ((__unused__)),
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 G_GNUC_UNUSED__attribute__ ((__unused__)),
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 G_GNUC_UNUSED__attribute__ ((__unused__)),
787 EvDocumentBackendInfo *info)
788{
789 PopplerBackend backend;
790
791 backend = poppler_get_backend ();
792 switch (backend) {
793 case POPPLER_BACKEND_CAIRO:
794 info->name = "poppler/cairo";
795 break;
796 case POPPLER_BACKEND_SPLASH:
797 info->name = "poppler/splash";
798 break;
799 default:
800 info->name = "poppler/unknown";
801 break;
802 }
803
804 info->version = poppler_get_version ();
805
806 return TRUE(!(0));
807}
808
809static gboolean
810pdf_document_support_synctex (EvDocument *document G_GNUC_UNUSED__attribute__ ((__unused__)))
811{
812 return TRUE(!(0));
813}
814
815static void
816pdf_document_class_init (PdfDocumentClass *klass)
817{
818 GObjectClass *g_object_class = G_OBJECT_CLASS (klass)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), (((GType) ((20) << (2))))))))
;
819 EvDocumentClass *ev_document_class = EV_DOCUMENT_CLASS (klass)((((EvDocumentClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), ((ev_document_get_type ()))))))
;
820
821 g_object_class->dispose = pdf_document_dispose;
822
823 ev_document_class->save = pdf_document_save;
824 ev_document_class->load = pdf_document_load;
825 ev_document_class->get_n_pages = pdf_document_get_n_pages;
826 ev_document_class->get_page = pdf_document_get_page;
827 ev_document_class->get_page_size = pdf_document_get_page_size;
828 ev_document_class->get_page_label = pdf_document_get_page_label;
829 ev_document_class->render = pdf_document_render;
830 ev_document_class->get_info = pdf_document_get_info;
831 ev_document_class->get_backend_info = pdf_document_get_backend_info;
832 ev_document_class->support_synctex = pdf_document_support_synctex;
833}
834
835/* EvDocumentSecurity */
836static gboolean
837pdf_document_has_document_security (EvDocumentSecurity *document_security G_GNUC_UNUSED__attribute__ ((__unused__)))
838{
839 /* FIXME: do we really need to have this? */
840 return FALSE(0);
841}
842
843static void
844pdf_document_set_password (EvDocumentSecurity *document_security,
845 const char *password)
846{
847 PdfDocument *document = PDF_DOCUMENT (document_security)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_security)), ((pdf_document_get_type ()))))))
;
848
849 if (document->password)
850 g_free (document->password);
851
852 document->password = g_strdup (password)g_strdup_inline (password);
853}
854
855static void
856pdf_document_security_iface_init (EvDocumentSecurityInterface *iface)
857{
858 iface->has_document_security = pdf_document_has_document_security;
859 iface->set_password = pdf_document_set_password;
860}
861
862static gdouble
863pdf_document_fonts_get_progress (EvDocumentFonts *document_fonts)
864{
865 PdfDocument *pdf_document = PDF_DOCUMENT (document_fonts)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_fonts)), ((pdf_document_get_type ()))))))
;
866 int n_pages;
867
868 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 ()))))))
);
869
870 return (double)pdf_document->fonts_scanned_pages / (double)n_pages;
871}
872
873static gboolean
874pdf_document_fonts_scan (EvDocumentFonts *document_fonts,
875 int n_pages)
876{
877 PdfDocument *pdf_document = PDF_DOCUMENT (document_fonts)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_fonts)), ((pdf_document_get_type ()))))))
;
878 gboolean result;
879
880 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)
;
881
882 if (pdf_document->font_info == NULL__null) {
883 pdf_document->font_info = poppler_font_info_new (pdf_document->document);
884 }
885
886 if (pdf_document->fonts_iter) {
887 poppler_fonts_iter_free (pdf_document->fonts_iter);
888 }
889
890 pdf_document->fonts_scanned_pages += n_pages;
891
892 result = poppler_font_info_scan (pdf_document->font_info, n_pages,
893 &pdf_document->fonts_iter);
894 if (!result) {
895 pdf_document->fonts_scanned_pages = 0;
896 poppler_font_info_free (pdf_document->font_info);
897 pdf_document->font_info = NULL__null;
898 }
899
900 return result;
901}
902
903static const char *
904font_type_to_string (PopplerFontType type)
905{
906 switch (type) {
907 case POPPLER_FONT_TYPE_TYPE1:
908 return _("Type 1")((char *) g_dgettext ("lector", "Type 1"));
909 case POPPLER_FONT_TYPE_TYPE1C:
910 return _("Type 1C")((char *) g_dgettext ("lector", "Type 1C"));
911 case POPPLER_FONT_TYPE_TYPE3:
912 return _("Type 3")((char *) g_dgettext ("lector", "Type 3"));
913 case POPPLER_FONT_TYPE_TRUETYPE:
914 return _("TrueType")((char *) g_dgettext ("lector", "TrueType"));
915 case POPPLER_FONT_TYPE_CID_TYPE0:
916 return _("Type 1 (CID)")((char *) g_dgettext ("lector", "Type 1 (CID)"));
917 case POPPLER_FONT_TYPE_CID_TYPE0C:
918 return _("Type 1C (CID)")((char *) g_dgettext ("lector", "Type 1C (CID)"));
919 case POPPLER_FONT_TYPE_CID_TYPE2:
920 return _("TrueType (CID)")((char *) g_dgettext ("lector", "TrueType (CID)"));
921 default:
922 return _("Unknown font type")((char *) g_dgettext ("lector", "Unknown font type"));
923 }
924}
925
926static void
927pdf_document_fonts_fill_model (EvDocumentFonts *document_fonts,
928 CtkTreeModel *model)
929{
930 PdfDocument *pdf_document = PDF_DOCUMENT (document_fonts)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_fonts)), ((pdf_document_get_type ()))))))
;
931 PopplerFontsIter *iter = pdf_document->fonts_iter;
932
933 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)
;
934
935 if (!iter)
936 return;
937
938 do {
939 CtkTreeIter list_iter;
940 const char *name;
941 const char *type;
942 const char *embedded;
943 char *details;
944
945 name = poppler_fonts_iter_get_name (iter);
946
947 if (name == NULL__null) {
948 name = _("No name")((char *) g_dgettext ("lector", "No name"));
949 }
950
951 type = font_type_to_string (
952 poppler_fonts_iter_get_font_type (iter));
953
954 if (poppler_fonts_iter_is_embedded (iter)) {
955 if (poppler_fonts_iter_is_subset (iter))
956 embedded = _("Embedded subset")((char *) g_dgettext ("lector", "Embedded subset"));
957 else
958 embedded = _("Embedded")((char *) g_dgettext ("lector", "Embedded"));
959 } else {
960 embedded = _("Not embedded")((char *) g_dgettext ("lector", "Not embedded"));
961 }
962
963 details = g_markup_printf_escaped ("%s\n%s", type, embedded);
964
965 ctk_list_store_append (CTK_LIST_STORE (model)((((CtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_list_store_get_type ()))))))
, &list_iter);
966 ctk_list_store_set (CTK_LIST_STORE (model)((((CtkListStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_list_store_get_type ()))))))
, &list_iter,
967 EV_DOCUMENT_FONTS_COLUMN_NAME, name,
968 EV_DOCUMENT_FONTS_COLUMN_DETAILS, details,
969 -1);
970
971 g_free (details);
972 } while (poppler_fonts_iter_next (iter));
973}
974
975static void
976pdf_document_document_fonts_iface_init (EvDocumentFontsInterface *iface)
977{
978 iface->fill_model = pdf_document_fonts_fill_model;
979 iface->scan = pdf_document_fonts_scan;
980 iface->get_progress = pdf_document_fonts_get_progress;
981}
982
983static gboolean
984pdf_document_links_has_document_links (EvDocumentLinks *document_links)
985{
986 PdfDocument *pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
987 PopplerIndexIter *iter;
988
989 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)
;
990
991 iter = poppler_index_iter_new (pdf_document->document);
992 if (iter == NULL__null)
993 return FALSE(0);
994 poppler_index_iter_free (iter);
995
996 return TRUE(!(0));
997}
998
999static EvLinkDest *
1000ev_link_dest_from_dest (PdfDocument *pdf_document,
1001 PopplerDest *dest)
1002{
1003 EvLinkDest *ev_dest = NULL__null;
1004 const char *unimplemented_dest = NULL__null;
1005
1006 g_assert (dest != NULL)do { if (dest != __null) ; else g_assertion_message_expr (((gchar
*) 0), "ev-poppler.cc", 1006, ((const char*) (__PRETTY_FUNCTION__
)), "dest != NULL"); } while (0)
;
1007
1008 switch (dest->type) {
1009 case POPPLER_DEST_XYZ: {
1010 PopplerPage *poppler_page;
1011 double height;
1012
1013 poppler_page = poppler_document_get_page (pdf_document->document,
1014 MAX (0, dest->page_num - 1)(((0) > (dest->page_num - 1)) ? (0) : (dest->page_num
- 1))
);
1015 poppler_page_get_size (poppler_page, NULL__null, &height);
1016 ev_dest = ev_link_dest_new_xyz (dest->page_num - 1,
1017 dest->left,
1018 height - MIN (height, dest->top)(((height) < (dest->top)) ? (height) : (dest->top)),
1019 dest->zoom,
1020 dest->change_left,
1021 dest->change_top,
1022 dest->change_zoom);
1023 g_object_unref (poppler_page);
1024 }
1025 break;
1026 case POPPLER_DEST_FITB:
1027 case POPPLER_DEST_FIT:
1028 ev_dest = ev_link_dest_new_fit (dest->page_num - 1);
1029 break;
1030 case POPPLER_DEST_FITBH:
1031 case POPPLER_DEST_FITH: {
1032 PopplerPage *poppler_page;
1033 double height;
1034
1035 poppler_page = poppler_document_get_page (pdf_document->document,
1036 MAX (0, dest->page_num - 1)(((0) > (dest->page_num - 1)) ? (0) : (dest->page_num
- 1))
);
1037 poppler_page_get_size (poppler_page, NULL__null, &height);
1038 ev_dest = ev_link_dest_new_fith (dest->page_num - 1,
1039 height - MIN (height, dest->top)(((height) < (dest->top)) ? (height) : (dest->top)),
1040 dest->change_top);
1041 g_object_unref (poppler_page);
1042 }
1043 break;
1044 case POPPLER_DEST_FITBV:
1045 case POPPLER_DEST_FITV:
1046 ev_dest = ev_link_dest_new_fitv (dest->page_num - 1,
1047 dest->left,
1048 dest->change_left);
1049 break;
1050 case POPPLER_DEST_FITR: {
1051 PopplerPage *poppler_page;
1052 double height;
1053
1054 poppler_page = poppler_document_get_page (pdf_document->document,
1055 MAX (0, dest->page_num - 1)(((0) > (dest->page_num - 1)) ? (0) : (dest->page_num
- 1))
);
1056 poppler_page_get_size (poppler_page, NULL__null, &height);
1057 ev_dest = ev_link_dest_new_fitr (dest->page_num - 1,
1058 dest->left,
1059 height - MIN (height, dest->bottom)(((height) < (dest->bottom)) ? (height) : (dest->bottom
))
,
1060 dest->right,
1061 height - MIN (height, dest->top)(((height) < (dest->top)) ? (height) : (dest->top)));
1062 g_object_unref (poppler_page);
1063 }
1064 break;
1065 case POPPLER_DEST_NAMED:
1066 ev_dest = ev_link_dest_new_named (dest->named_dest);
1067 break;
1068 case POPPLER_DEST_UNKNOWN:
1069 unimplemented_dest = "POPPLER_DEST_UNKNOWN";
1070 break;
1071 }
1072
1073 if (unimplemented_dest) {
1074 g_warning ("Unimplemented destination: %s, please post a "
1075 "bug report on Lector bug tracker "
1076 "(https://github.com/cafe-desktop/lector/issues) with a testcase.",
1077 unimplemented_dest);
1078 }
1079
1080 if (!ev_dest)
1081 ev_dest = ev_link_dest_new_page (dest->page_num - 1);
1082
1083 return ev_dest;
1084}
1085
1086static EvLink *
1087ev_link_from_action (PdfDocument *pdf_document,
1088 PopplerAction *action)
1089{
1090 EvLink *link = NULL__null;
1091 EvLinkAction *ev_action = NULL__null;
1092 const char *unimplemented_action = NULL__null;
1093
1094 switch (action->type) {
1095 case POPPLER_ACTION_NONE:
1096 break;
1097 case POPPLER_ACTION_GOTO_DEST: {
1098 EvLinkDest *dest;
1099
1100 dest = ev_link_dest_from_dest (pdf_document, action->goto_dest.dest);
1101 ev_action = ev_link_action_new_dest (dest);
1102 }
1103 break;
1104 case POPPLER_ACTION_GOTO_REMOTE: {
1105 EvLinkDest *dest;
1106
1107 dest = ev_link_dest_from_dest (pdf_document, action->goto_remote.dest);
1108 ev_action = ev_link_action_new_remote (dest,
1109 action->goto_remote.file_name);
1110
1111 }
1112 break;
1113 case POPPLER_ACTION_LAUNCH:
1114 ev_action = ev_link_action_new_launch (action->launch.file_name,
1115 action->launch.params);
1116 break;
1117 case POPPLER_ACTION_URI:
1118 ev_action = ev_link_action_new_external_uri (action->uri.uri);
1119 break;
1120 case POPPLER_ACTION_NAMED:
1121 ev_action = ev_link_action_new_named (action->named.named_dest);
1122 break;
1123 case POPPLER_ACTION_MOVIE:
1124 unimplemented_action = "POPPLER_ACTION_MOVIE";
1125 break;
1126 case POPPLER_ACTION_RENDITION:
1127 unimplemented_action = "POPPLER_ACTION_RENDITION";
1128 break;
1129 case POPPLER_ACTION_OCG_STATE: {
1130 GList *on_list = NULL__null;
1131 GList *off_list = NULL__null;
1132 GList *toggle_list = NULL__null;
1133 GList *l, *m;
1134
1135 for (l = action->ocg_state.state_list; l; l = g_list_next (l)((l) ? (((GList *)(l))->next) : __null)) {
1136 PopplerActionLayer *action_layer = (PopplerActionLayer *)l->data;
1137
1138 for (m = action_layer->layers; m; m = g_list_next (m)((m) ? (((GList *)(m))->next) : __null)) {
1139 PopplerLayer *layer = (PopplerLayer *)m->data;
1140 EvLayer *ev_layer;
1141
1142 ev_layer = ev_layer_new (poppler_layer_is_parent (layer),
1143 poppler_layer_get_radio_button_group_id (layer));
1144 g_object_set_data_full (G_OBJECT (ev_layer)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_layer)), (((GType) ((20) << (2))))))))
,
1145 "poppler-layer",
1146 g_object_ref (layer)((typename std::remove_reference<decltype (layer)>::type
) (g_object_ref) (layer))
,
1147 (GDestroyNotify)g_object_unref);
1148
1149 switch (action_layer->action) {
1150 case POPPLER_ACTION_LAYER_ON:
1151 on_list = g_list_prepend (on_list, ev_layer);
1152 break;
1153 case POPPLER_ACTION_LAYER_OFF:
1154 off_list = g_list_prepend (off_list, ev_layer);
1155 break;
1156 case POPPLER_ACTION_LAYER_TOGGLE:
1157 toggle_list = g_list_prepend (toggle_list, ev_layer);
1158 break;
1159 }
1160 }
1161 }
1162
1163 /* The action takes the ownership of the lists */
1164 ev_action = ev_link_action_new_layers_state (g_list_reverse (on_list),
1165 g_list_reverse (off_list),
1166 g_list_reverse (toggle_list));
1167
1168
1169 }
1170 break;
1171 case POPPLER_ACTION_JAVASCRIPT:
1172 unimplemented_action = "POPPLER_ACTION_JAVASCRIPT";
1173 break;
1174 case POPPLER_ACTION_UNKNOWN:
1175 unimplemented_action = "POPPLER_ACTION_UNKNOWN";
1176 }
1177
1178 if (unimplemented_action) {
1179 g_warning ("Unimplemented action: %s, please post a bug report "
1180 "on Lector bug tracker (https://github.com/cafe-desktop/lector/issues) "
1181 "with a testcase.", unimplemented_action);
1182 }
1183
1184 link = ev_link_new (action->any.title, ev_action);
1185
1186 return link;
1187}
1188
1189static void
1190build_tree (PdfDocument *pdf_document,
1191 CtkTreeModel *model,
1192 CtkTreeIter *parent,
1193 PopplerIndexIter *iter)
1194{
1195
1196 do {
1197 CtkTreeIter tree_iter;
1198 PopplerIndexIter *child;
1199 PopplerAction *action;
1200 EvLink *link = NULL__null;
1201 gboolean expand;
1202 char *title_markup;
1203
1204 action = poppler_index_iter_get_action (iter);
1205 expand = poppler_index_iter_is_open (iter);
1206
1207 if (!action)
1208 continue;
1209
1210 link = ev_link_from_action (pdf_document, action);
1211 if (!link || strlen (ev_link_get_title (link)) <= 0) {
1212 poppler_action_free (action);
1213 if (link)
1214 g_object_unref (link);
1215
1216 continue;
1217 }
1218
1219 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);
1220 title_markup = g_markup_escape_text (ev_link_get_title (link), -1);
1221
1222 ctk_tree_store_set (CTK_TREE_STORE (model)((((CtkTreeStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_tree_store_get_type ()))))))
, &tree_iter,
1223 EV_DOCUMENT_LINKS_COLUMN_MARKUP, title_markup,
1224 EV_DOCUMENT_LINKS_COLUMN_LINK, link,
1225 EV_DOCUMENT_LINKS_COLUMN_EXPAND, expand,
1226 -1);
1227
1228 g_free (title_markup);
1229 g_object_unref (link);
1230
1231 child = poppler_index_iter_get_child (iter);
1232 if (child)
1233 build_tree (pdf_document, model, &tree_iter, child);
1234 poppler_index_iter_free (child);
1235 poppler_action_free (action);
1236
1237 } while (poppler_index_iter_next (iter));
1238}
1239
1240static CtkTreeModel *
1241pdf_document_links_get_links_model (EvDocumentLinks *document_links)
1242{
1243 PdfDocument *pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
1244 CtkTreeModel *model = NULL__null;
1245 PopplerIndexIter *iter;
1246
1247 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)
;
1248
1249 iter = poppler_index_iter_new (pdf_document->document);
1250 /* Create the model if we have items*/
1251 if (iter != NULL__null) {
1252 model = (CtkTreeModel *) ctk_tree_store_new (EV_DOCUMENT_LINKS_COLUMN_NUM_COLUMNS,
1253 G_TYPE_STRING((GType) ((16) << (2))),
1254 G_TYPE_OBJECT((GType) ((20) << (2))),
1255 G_TYPE_BOOLEAN((GType) ((5) << (2))),
1256 G_TYPE_STRING((GType) ((16) << (2))));
1257 build_tree (pdf_document, model, NULL__null, iter);
1258 poppler_index_iter_free (iter);
1259 }
1260
1261 return model;
1262}
1263
1264static EvMappingList *
1265pdf_document_links_get_links (EvDocumentLinks *document_links,
1266 EvPage *page)
1267{
1268 PdfDocument *pdf_document;
1269 PopplerPage *poppler_page;
1270 GList *retval = NULL__null;
1271 GList *mapping_list;
1272 GList *list;
1273 double height;
1274
1275 pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
1276 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
1277 mapping_list = poppler_page_get_link_mapping (poppler_page);
1278 poppler_page_get_size (poppler_page, NULL__null, &height);
1279
1280 for (list = mapping_list; list; list = list->next) {
1281 PopplerLinkMapping *link_mapping;
1282 EvMapping *ev_link_mapping;
1283
1284 link_mapping = (PopplerLinkMapping *)list->data;
1285 ev_link_mapping = g_new (EvMapping, 1)((EvMapping *) g_malloc_n ((1), sizeof (EvMapping)));
1286 ev_link_mapping->data = ev_link_from_action (pdf_document,
1287 link_mapping->action);
1288 ev_link_mapping->area.x1 = link_mapping->area.x1;
1289 ev_link_mapping->area.x2 = link_mapping->area.x2;
1290 /* Invert this for X-style coordinates */
1291 ev_link_mapping->area.y1 = height - link_mapping->area.y2;
1292 ev_link_mapping->area.y2 = height - link_mapping->area.y1;
1293
1294 retval = g_list_prepend (retval, ev_link_mapping);
1295 }
1296
1297 poppler_page_free_link_mapping (mapping_list);
1298
1299 return ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
1300}
1301
1302static EvLinkDest *
1303pdf_document_links_find_link_dest (EvDocumentLinks *document_links,
1304 const gchar *link_name)
1305{
1306 PdfDocument *pdf_document;
1307 PopplerDest *dest;
1308 EvLinkDest *ev_dest = NULL__null;
1309
1310 pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
1311 dest = poppler_document_find_dest (pdf_document->document,
1312 link_name);
1313 if (dest) {
1314 ev_dest = ev_link_dest_from_dest (pdf_document, dest);
1315 poppler_dest_free (dest);
1316 }
1317
1318 return ev_dest;
1319}
1320
1321static gint
1322pdf_document_links_find_link_page (EvDocumentLinks *document_links,
1323 const gchar *link_name)
1324{
1325 PdfDocument *pdf_document;
1326 PopplerDest *dest;
1327 gint retval = -1;
1328
1329 pdf_document = PDF_DOCUMENT (document_links)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_links)), ((pdf_document_get_type ()))))))
;
1330 dest = poppler_document_find_dest (pdf_document->document,
1331 link_name);
1332 if (dest) {
1333 retval = dest->page_num - 1;
1334 poppler_dest_free (dest);
1335 }
1336
1337 return retval;
1338}
1339
1340static void
1341pdf_document_document_links_iface_init (EvDocumentLinksInterface *iface)
1342{
1343 iface->has_document_links = pdf_document_links_has_document_links;
1344 iface->get_links_model = pdf_document_links_get_links_model;
1345 iface->get_links = pdf_document_links_get_links;
1346 iface->find_link_dest = pdf_document_links_find_link_dest;
1347 iface->find_link_page = pdf_document_links_find_link_page;
1348}
1349
1350static EvMappingList *
1351pdf_document_images_get_image_mapping (EvDocumentImages *document_images G_GNUC_UNUSED__attribute__ ((__unused__)),
1352 EvPage *page)
1353{
1354 GList *retval = NULL__null;
1355 PopplerPage *poppler_page;
1356 GList *mapping_list;
1357 GList *list;
1358
1359 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
1360 mapping_list = poppler_page_get_image_mapping (poppler_page);
1361
1362 for (list = mapping_list; list; list = list->next) {
1363 PopplerImageMapping *image_mapping;
1364 EvMapping *ev_image_mapping;
1365
1366 image_mapping = (PopplerImageMapping *)list->data;
1367
1368 ev_image_mapping = g_new (EvMapping, 1)((EvMapping *) g_malloc_n ((1), sizeof (EvMapping)));
1369
1370 ev_image_mapping->data = ev_image_new (page->index, image_mapping->image_id);
1371 ev_image_mapping->area.x1 = image_mapping->area.x1;
1372 ev_image_mapping->area.y1 = image_mapping->area.y1;
1373 ev_image_mapping->area.x2 = image_mapping->area.x2;
1374 ev_image_mapping->area.y2 = image_mapping->area.y2;
1375
1376 retval = g_list_prepend (retval, ev_image_mapping);
1377 }
1378
1379 poppler_page_free_image_mapping (mapping_list);
1380
1381 return ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
1382}
1383
1384GdkPixbuf *
1385pdf_document_images_get_image (EvDocumentImages *document_images,
1386 EvImage *image)
1387{
1388 GdkPixbuf *retval = NULL__null;
1389 PdfDocument *pdf_document;
1390 PopplerPage *poppler_page;
1391 cairo_surface_t *surface;
1392
1393 pdf_document = PDF_DOCUMENT (document_images)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_images)), ((pdf_document_get_type ()))))))
;
1394 poppler_page = poppler_document_get_page (pdf_document->document,
1395 ev_image_get_page (image));
1396
1397 surface = poppler_page_get_image (poppler_page, ev_image_get_id (image));
1398 if (surface) {
1399 retval = ev_document_misc_pixbuf_from_surface (surface);
1400 cairo_surface_destroy (surface);
1401 }
1402
1403 g_object_unref (poppler_page);
1404
1405 return retval;
1406}
1407
1408static void
1409pdf_document_document_images_iface_init (EvDocumentImagesInterface *iface)
1410{
1411 iface->get_image_mapping = pdf_document_images_get_image_mapping;
1412 iface->get_image = pdf_document_images_get_image;
1413}
1414
1415static GdkPixbuf *
1416make_thumbnail_for_page (PopplerPage *poppler_page,
1417 EvRenderContext *rc,
1418 gint width,
1419 gint height)
1420{
1421 GdkPixbuf *pixbuf;
1422 cairo_surface_t *surface;
1423
1424 ev_document_fc_mutex_lock ();
1425 surface = pdf_page_render (poppler_page, width, height, rc);
1426 ev_document_fc_mutex_unlock ();
1427
1428 pixbuf = ev_document_misc_pixbuf_from_surface (surface);
1429 cairo_surface_destroy (surface);
1430
1431 return pixbuf;
1432}
1433
1434static GdkPixbuf *
1435pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails,
1436 EvRenderContext *rc,
1437 gboolean border)
1438{
1439 PdfDocument *pdf_document = PDF_DOCUMENT (document_thumbnails)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_thumbnails)), ((pdf_document_get_type ()))))))
;
1440 PopplerPage *poppler_page;
1441 cairo_surface_t *surface;
1442 GdkPixbuf *pixbuf = NULL__null;
1443 GdkPixbuf *border_pixbuf;
1444 gint width, height;
1445
1446 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
1447
1448 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
()))))))
,
1449 rc, &width, &height);
1450
1451 surface = poppler_page_get_thumbnail (poppler_page);
1452 if (surface) {
1453 pixbuf = ev_document_misc_pixbuf_from_surface (surface);
1454 cairo_surface_destroy (surface);
1455 }
1456
1457 if (pixbuf != NULL__null) {
1458 int thumb_width = (rc->rotation == 90 || rc->rotation == 270) ?
1459 gdk_pixbuf_get_height (pixbuf) :
1460 gdk_pixbuf_get_width (pixbuf);
1461
1462 if (thumb_width == width) {
1463 GdkPixbuf *rotated_pixbuf;
1464
1465 rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf,
1466 (GdkPixbufRotation) (360 - rc->rotation));
1467 g_object_unref (pixbuf);
1468 pixbuf = rotated_pixbuf;
1469 } else {
1470 /* The provided thumbnail has a different size */
1471 g_object_unref (pixbuf);
1472 pixbuf = make_thumbnail_for_page (poppler_page, rc, width, height);
1473 }
1474 } else {
1475 /* There is no provided thumbnail. We need to make one. */
1476 pixbuf = make_thumbnail_for_page (poppler_page, rc, width, height);
1477 }
1478
1479 if (border && pixbuf) {
1480 border_pixbuf = ev_document_misc_get_thumbnail_frame (-1, -1, pixbuf);
1481 g_object_unref (pixbuf);
1482 pixbuf = border_pixbuf;
1483 }
1484
1485 return pixbuf;
1486}
1487
1488static void
1489pdf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document_thumbnails G_GNUC_UNUSED__attribute__ ((__unused__)),
1490 EvRenderContext *rc,
1491 gint *width,
1492 gint *height)
1493{
1494 double page_width, page_height;
1495
1496 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(
)))))))
,
1497 &page_width, &page_height);
1498
1499 *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))
;
1500 *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))
;
1501
1502 if (rc->rotation == 90 || rc->rotation == 270) {
1503 gint temp;
1504
1505 temp = *width;
1506 *width = *height;
1507 *height = temp;
1508 }
1509}
1510
1511static void
1512pdf_document_document_thumbnails_iface_init (EvDocumentThumbnailsInterface *iface)
1513{
1514 iface->get_thumbnail = pdf_document_thumbnails_get_thumbnail;
1515 iface->get_dimensions = pdf_document_thumbnails_get_dimensions;
1516}
1517
1518
1519static GList *
1520pdf_document_find_find_text (EvDocumentFind *document_find G_GNUC_UNUSED__attribute__ ((__unused__)),
1521 EvPage *page,
1522 const gchar *text,
1523 gboolean case_sensitive)
1524{
1525 GList *matches, *l;
1526 PopplerPage *poppler_page;
1527 gdouble height;
1528 GList *retval = NULL__null;
1529 PopplerFindFlags options = POPPLER_FIND_DEFAULT;
1530
1531 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)
;
1532 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)
;
1533
1534 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
1535
1536 if (case_sensitive)
1537 options = POPPLER_FIND_CASE_SENSITIVE;
1538
1539 matches = poppler_page_find_text_with_options (poppler_page, text, options);
1540 if (!matches)
1541 return NULL__null;
1542
1543 poppler_page_get_size (poppler_page, NULL__null, &height);
1544 for (l = matches; l && l->data; l = g_list_next (l)((l) ? (((GList *)(l))->next) : __null)) {
1545 PopplerRectangle *rect = (PopplerRectangle *)l->data;
1546 EvRectangle *ev_rect;
1547
1548 ev_rect = ev_rectangle_new ();
1549 ev_rect->x1 = rect->x1;
1550 ev_rect->x2 = rect->x2;
1551 /* Invert this for X-style coordinates */
1552 ev_rect->y1 = height - rect->y2;
1553 ev_rect->y2 = height - rect->y1;
1554
1555 retval = g_list_prepend (retval, ev_rect);
1556 }
1557
1558 g_list_foreach (matches, (GFunc)poppler_rectangle_free, NULL__null);
1559 g_list_free (matches);
1560
1561 return g_list_reverse (retval);
1562}
1563
1564static void
1565pdf_document_find_iface_init (EvDocumentFindInterface *iface)
1566{
1567 iface->find_text = pdf_document_find_find_text;
1568}
1569
1570static void
1571pdf_print_context_free (PdfPrintContext *ctx)
1572{
1573 if (!ctx)
1574 return;
1575
1576#ifdef HAVE_CAIRO_PRINT
1577 if (ctx->cr) {
1578 cairo_destroy (ctx->cr);
1579 ctx->cr = NULL__null;
1580 }
1581#else
1582 if (ctx->ps_file) {
1583 poppler_ps_file_free (ctx->ps_file);
1584 ctx->ps_file = NULL__null;
1585 }
1586#endif
1587 g_free (ctx);
1588}
1589
1590static void
1591pdf_document_file_exporter_begin (EvFileExporter *exporter,
1592 EvFileExporterContext *fc)
1593{
1594 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1595 PdfPrintContext *ctx;
1596#ifdef HAVE_CAIRO_PRINT
1597 cairo_surface_t *surface = NULL__null;
1598#endif
1599
1600 if (pdf_document->print_ctx)
1601 pdf_print_context_free (pdf_document->print_ctx);
1602 pdf_document->print_ctx = g_new0 (PdfPrintContext, 1)((PdfPrintContext *) g_malloc0_n ((1), sizeof (PdfPrintContext
)))
;
1603 ctx = pdf_document->print_ctx;
1604 ctx->format = fc->format;
1605
1606#ifdef HAVE_CAIRO_PRINT
1607 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)))
;
1608
1609 ctx->paper_width = fc->paper_width;
1610 ctx->paper_height = fc->paper_height;
1611
1612 switch (fc->pages_per_sheet) {
1613 default:
1614 case 1:
1615 ctx->pages_x = 1;
1616 ctx->pages_y = 1;
1617 break;
1618 case 2:
1619 ctx->pages_x = 1;
1620 ctx->pages_y = 2;
1621 break;
1622 case 4:
1623 ctx->pages_x = 2;
1624 ctx->pages_y = 2;
1625 break;
1626 case 6:
1627 ctx->pages_x = 2;
1628 ctx->pages_y = 3;
1629 break;
1630 case 9:
1631 ctx->pages_x = 3;
1632 ctx->pages_y = 3;
1633 break;
1634 case 16:
1635 ctx->pages_x = 4;
1636 ctx->pages_y = 4;
1637 break;
1638 }
1639
1640 ctx->pages_printed = 0;
1641
1642 switch (fc->format) {
1643 case EV_FILE_FORMAT_PS:
1644#ifdef HAVE_CAIRO_PS1
1645 surface = cairo_ps_surface_create (fc->filename, fc->paper_width, fc->paper_height);
1646#endif
1647 break;
1648 case EV_FILE_FORMAT_PDF:
1649#ifdef HAVE_CAIRO_PDF1
1650 surface = cairo_pdf_surface_create (fc->filename, fc->paper_width, fc->paper_height);
1651#endif
1652 break;
1653 default:
1654 g_assert_not_reached ()do { g_assertion_message_expr (((gchar*) 0), "ev-poppler.cc",
1654, ((const char*) (__PRETTY_FUNCTION__)), __null); } while
(0)
;
1655 }
1656
1657 ctx->cr = cairo_create (surface);
1658 cairo_surface_destroy (surface);
1659
1660#else /* HAVE_CAIRO_PRINT */
1661 if (ctx->format == EV_FILE_FORMAT_PS) {
1662 ctx->ps_file = poppler_ps_file_new (pdf_document->document,
1663 fc->filename, fc->first_page,
1664 fc->last_page - fc->first_page + 1);
1665 poppler_ps_file_set_paper_size (ctx->ps_file, fc->paper_width, fc->paper_height);
1666 poppler_ps_file_set_duplex (ctx->ps_file, fc->duplex);
1667 }
1668#endif /* HAVE_CAIRO_PRINT */
1669}
1670
1671static void
1672pdf_document_file_exporter_begin_page (EvFileExporter *exporter)
1673{
1674 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1675 PdfPrintContext *ctx = pdf_document->print_ctx;
1676
1677 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)
;
1678
1679 ctx->pages_printed = 0;
1680
1681#ifdef HAVE_CAIRO_PRINT
1682 if (ctx->paper_width > ctx->paper_height) {
1683 if (ctx->format == EV_FILE_FORMAT_PS) {
1684 cairo_ps_surface_set_size (cairo_get_target (ctx->cr),
1685 ctx->paper_height,
1686 ctx->paper_width);
1687 } else if (ctx->format == EV_FILE_FORMAT_PDF) {
1688 cairo_pdf_surface_set_size (cairo_get_target (ctx->cr),
1689 ctx->paper_height,
1690 ctx->paper_width);
1691 }
1692 }
1693#endif /* HAVE_CAIRO_PRINT */
1694}
1695
1696static void
1697pdf_document_file_exporter_do_page (EvFileExporter *exporter,
1698 EvRenderContext *rc)
1699{
1700 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1701 PdfPrintContext *ctx = pdf_document->print_ctx;
1702 PopplerPage *poppler_page;
1703#ifdef HAVE_CAIRO_PRINT
1704 gdouble page_width, page_height;
1705 gint x, y;
1706 gboolean rotate;
1707 gdouble width, height;
1708 gdouble pwidth, pheight;
1709 gdouble xscale, yscale;
1710#endif
1711
1712 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)
;
1713
1714 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
1715
1716#ifdef HAVE_CAIRO_PRINT
1717 x = (ctx->pages_printed % ctx->pages_per_sheet) % ctx->pages_x;
1718 y = (ctx->pages_printed % ctx->pages_per_sheet) / ctx->pages_x;
1719 poppler_page_get_size (poppler_page, &page_width, &page_height);
1720
1721 if (page_width > page_height && page_width > ctx->paper_width) {
1722 rotate = TRUE(!(0));
1723 } else {
1724 rotate = FALSE(0);
1725 }
1726
1727 /* Use always portrait mode and rotate when necessary */
1728 if (ctx->paper_width > ctx->paper_height) {
1729 width = ctx->paper_height;
1730 height = ctx->paper_width;
1731 rotate = !rotate;
1732 } else {
1733 width = ctx->paper_width;
1734 height = ctx->paper_height;
1735 }
1736
1737 if (ctx->pages_per_sheet == 2 || ctx->pages_per_sheet == 6) {
1738 rotate = !rotate;
1739 }
1740
1741 if (rotate) {
1742 gint tmp1;
1743 gdouble tmp2;
1744
1745 tmp1 = x;
1746 x = y;
1747 y = tmp1;
1748
1749 tmp2 = page_width;
1750 page_width = page_height;
1751 page_height = tmp2;
1752 }
1753
1754 pwidth = width / ctx->pages_x;
1755 pheight = height / ctx->pages_y;
1756
1757 if ((page_width > pwidth || page_height > pheight) ||
1758 (page_width < pwidth && page_height < pheight)) {
1759 xscale = pwidth / page_width;
1760 yscale = pheight / page_height;
1761
1762 if (yscale < xscale) {
1763 xscale = yscale;
1764 } else {
1765 yscale = xscale;
1766 }
1767
1768 } else {
1769 xscale = yscale = 1;
1770 }
1771
1772 /* TODO: center */
1773
1774 cairo_save (ctx->cr);
1775 if (rotate) {
1776 cairo_matrix_t matrix;
1777
1778 cairo_translate (ctx->cr, (2 * y + 1) * pwidth, 0);
1779 cairo_matrix_init (&matrix,
1780 0, 1,
1781 -1, 0,
1782 0, 0);
1783 cairo_transform (ctx->cr, &matrix);
1784 }
1785
1786 cairo_translate (ctx->cr,
1787 x * (rotate ? pheight : pwidth),
1788 y * (rotate ? pwidth : pheight));
1789 cairo_scale (ctx->cr, xscale, yscale);
1790
1791 poppler_page_render_for_printing (poppler_page, ctx->cr);
1792
1793 ctx->pages_printed++;
1794
1795 cairo_restore (ctx->cr);
1796#else /* HAVE_CAIRO_PRINT */
1797 if (ctx->format == EV_FILE_FORMAT_PS)
1798 poppler_page_render_to_ps (poppler_page, ctx->ps_file);
1799#endif /* HAVE_CAIRO_PRINT */
1800}
1801
1802static void
1803pdf_document_file_exporter_end_page (EvFileExporter *exporter)
1804{
1805 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1806 PdfPrintContext *ctx = pdf_document->print_ctx;
1807
1808 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)
;
1809
1810#ifdef HAVE_CAIRO_PRINT
1811 cairo_show_page (ctx->cr);
1812#endif
1813}
1814
1815static void
1816pdf_document_file_exporter_end (EvFileExporter *exporter)
1817{
1818 PdfDocument *pdf_document = PDF_DOCUMENT (exporter)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((exporter)), ((pdf_document_get_type ()))))))
;
1819
1820 pdf_print_context_free (pdf_document->print_ctx);
1821 pdf_document->print_ctx = NULL__null;
1822}
1823
1824static EvFileExporterCapabilities
1825pdf_document_file_exporter_get_capabilities (EvFileExporter *exporter G_GNUC_UNUSED__attribute__ ((__unused__)))
1826{
1827 return (EvFileExporterCapabilities) (
1828 EV_FILE_EXPORTER_CAN_PAGE_SET |
1829 EV_FILE_EXPORTER_CAN_COPIES |
1830 EV_FILE_EXPORTER_CAN_COLLATE |
1831 EV_FILE_EXPORTER_CAN_REVERSE |
1832 EV_FILE_EXPORTER_CAN_SCALE |
1833#ifdef HAVE_CAIRO_PRINT
1834 EV_FILE_EXPORTER_CAN_NUMBER_UP |
1835#endif
1836
1837#ifdef HAVE_CAIRO_PDF1
1838 EV_FILE_EXPORTER_CAN_GENERATE_PDF |
1839#endif
1840 EV_FILE_EXPORTER_CAN_GENERATE_PS);
1841}
1842
1843static void
1844pdf_document_file_exporter_iface_init (EvFileExporterInterface *iface)
1845{
1846 iface->begin = pdf_document_file_exporter_begin;
1847 iface->begin_page = pdf_document_file_exporter_begin_page;
1848 iface->do_page = pdf_document_file_exporter_do_page;
1849 iface->end_page = pdf_document_file_exporter_end_page;
1850 iface->end = pdf_document_file_exporter_end;
1851 iface->get_capabilities = pdf_document_file_exporter_get_capabilities;
1852}
1853
1854/* EvDocumentPrint */
1855static void
1856pdf_document_print_print_page (EvDocumentPrint *document G_GNUC_UNUSED__attribute__ ((__unused__)),
1857 EvPage *page,
1858 cairo_t *cr)
1859{
1860 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);
1861}
1862
1863static void
1864pdf_document_document_print_iface_init (EvDocumentPrintInterface *iface)
1865{
1866 iface->print_page = pdf_document_print_print_page;
1867}
1868
1869static void
1870pdf_selection_render_selection (EvSelection *selection G_GNUC_UNUSED__attribute__ ((__unused__)),
1871 EvRenderContext *rc,
1872 cairo_surface_t **surface,
1873 EvRectangle *points,
1874 EvRectangle *old_points,
1875 EvSelectionStyle style,
1876 CdkColor *text,
1877 CdkColor *base)
1878{
1879 PopplerPage *poppler_page;
1880 cairo_t *cr;
1881 PopplerColor text_color, base_color;
1882 double width_points, height_points;
1883 gint width, height;
1884
1885 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
1886
1887 poppler_page_get_size (poppler_page,
1888 &width_points, &height_points);
1889 width = (int) ((width_points * rc->scale) + 0.5);
1890 height = (int) ((height_points * rc->scale) + 0.5);
1891
1892 text_color.red = text->red;
1893 text_color.green = text->green;
1894 text_color.blue = text->blue;
1895
1896 base_color.red = base->red;
1897 base_color.green = base->green;
1898 base_color.blue = base->blue;
1899
1900 if (*surface == NULL__null) {
1901 *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
1902 width, height);
1903
1904 }
1905
1906 cr = cairo_create (*surface);
1907 cairo_scale (cr, rc->scale, rc->scale);
1908 cairo_surface_set_device_offset (*surface, 0, 0);
1909 memset (cairo_image_surface_get_data (*surface), 0x00,
1910 cairo_image_surface_get_height (*surface) *
1911 cairo_image_surface_get_stride (*surface));
1912 poppler_page_render_selection (poppler_page,
1913 cr,
1914 (PopplerRectangle *)points,
1915 (PopplerRectangle *)old_points,
1916 (PopplerSelectionStyle)style,
1917 &text_color,
1918 &base_color);
1919 cairo_destroy (cr);
1920}
1921
1922static gchar *
1923pdf_selection_get_selected_text (EvSelection *selection G_GNUC_UNUSED__attribute__ ((__unused__)),
1924 EvPage *page,
1925 EvSelectionStyle style,
1926 EvRectangle *points)
1927{
1928 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)
;
1929
1930 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()))))))
,
1931 (PopplerSelectionStyle)style,
1932 (PopplerRectangle *)points);
1933}
1934
1935static cairo_region_t *
1936pdf_selection_get_selection_region (EvSelection *selection G_GNUC_UNUSED__attribute__ ((__unused__)),
1937 EvRenderContext *rc,
1938 EvSelectionStyle style,
1939 EvRectangle *points)
1940{
1941 PopplerPage *poppler_page;
1942 cairo_region_t *retval;
1943
1944 poppler_page = POPPLER_PAGE (rc->page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((rc->page->backend_page)), ((poppler_page_get_type(
)))))))
;
1945 retval = poppler_page_get_selected_region (poppler_page,
1946 rc->scale,
1947 (PopplerSelectionStyle)style,
1948 (PopplerRectangle *) points);
1949
1950 return retval;
1951}
1952
1953static void
1954pdf_selection_iface_init (EvSelectionInterface *iface)
1955{
1956 iface->render_selection = pdf_selection_render_selection;
1957 iface->get_selected_text = pdf_selection_get_selected_text;
1958 iface->get_selection_region = pdf_selection_get_selection_region;
1959}
1960
1961
1962/* EvDocumentText */
1963static cairo_region_t *
1964pdf_document_text_get_text_mapping (EvDocumentText *document_text G_GNUC_UNUSED__attribute__ ((__unused__)),
1965 EvPage *page)
1966{
1967 PopplerPage *poppler_page;
1968 PopplerRectangle points;
1969 cairo_region_t *retval;
1970
1971 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)
;
1972
1973 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
1974
1975 points.x1 = 0.0;
1976 points.y1 = 0.0;
1977 poppler_page_get_size (poppler_page, &(points.x2), &(points.y2));
1978
1979 retval = poppler_page_get_selected_region (poppler_page, 1.0,
1980 POPPLER_SELECTION_GLYPH,
1981 &points);
1982
1983 return retval;
1984}
1985
1986static gchar *
1987pdf_document_text_get_text (EvDocumentText *selection G_GNUC_UNUSED__attribute__ ((__unused__)),
1988 EvPage *page)
1989{
1990 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)
;
1991
1992 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()))))))
);
1993}
1994
1995static gboolean
1996pdf_document_text_get_text_layout (EvDocumentText *selection G_GNUC_UNUSED__attribute__ ((__unused__)),
1997 EvPage *page,
1998 EvRectangle **areas,
1999 guint *n_areas)
2000{
2001 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)
;
2002
2003 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()))))))
,
2004 (PopplerRectangle **)areas, n_areas);
2005}
2006
2007static PangoAttrList *
2008pdf_document_text_get_text_attrs (EvDocumentText *document_text G_GNUC_UNUSED__attribute__ ((__unused__)),
2009 EvPage *page)
2010{
2011 GList *backend_attrs_list, *l;
2012 PangoAttrList *attrs_list;
2013
2014 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)
;
2015
2016 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()))))))
);
2017 if (!backend_attrs_list)
2018 return NULL__null;
2019
2020 attrs_list = pango_attr_list_new ();
2021 for (l = backend_attrs_list; l; l = g_list_next (l)((l) ? (((GList *)(l))->next) : __null)) {
2022 PopplerTextAttributes *backend_attrs = (PopplerTextAttributes *)l->data;
2023 PangoAttribute *attr;
2024
2025 if (backend_attrs->is_underlined) {
2026 attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
2027 attr->start_index = backend_attrs->start_index;
2028 attr->end_index = backend_attrs->end_index;
2029 pango_attr_list_insert (attrs_list, attr);
2030 }
2031
2032 attr = pango_attr_foreground_new (backend_attrs->color.red,
2033 backend_attrs->color.green,
2034 backend_attrs->color.blue);
2035 attr->start_index = backend_attrs->start_index;
2036 attr->end_index = backend_attrs->end_index;
2037 pango_attr_list_insert (attrs_list, attr);
2038
2039 if (backend_attrs->font_name) {
2040 attr = pango_attr_family_new (backend_attrs->font_name);
2041 attr->start_index = backend_attrs->start_index;
2042 attr->end_index = backend_attrs->end_index;
2043 pango_attr_list_insert (attrs_list, attr);
2044 }
2045
2046 if (backend_attrs->font_size) {
2047 attr = pango_attr_size_new (backend_attrs->font_size * PANGO_SCALE1024);
2048 attr->start_index = backend_attrs->start_index;
2049 attr->end_index = backend_attrs->end_index;
2050 pango_attr_list_insert (attrs_list, attr);
2051 }
2052 }
2053
2054 poppler_page_free_text_attributes (backend_attrs_list);
2055
2056 return attrs_list;
2057}
2058
2059static void
2060pdf_document_text_iface_init (EvDocumentTextInterface *iface)
2061{
2062 iface->get_text_mapping = pdf_document_text_get_text_mapping;
2063 iface->get_text = pdf_document_text_get_text;
2064 iface->get_text_layout = pdf_document_text_get_text_layout;
2065 iface->get_text_attrs = pdf_document_text_get_text_attrs;
2066}
2067
2068/* Page Transitions */
2069static gdouble
2070pdf_document_get_page_duration (EvDocumentTransition *trans,
2071 gint page)
2072{
2073 PdfDocument *pdf_document;
2074 PopplerPage *poppler_page;
2075 gdouble duration = -1;
2076
2077 pdf_document = PDF_DOCUMENT (trans)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((trans)), ((pdf_document_get_type ()))))))
;
2078 poppler_page = poppler_document_get_page (pdf_document->document, page);
2079 if (!poppler_page)
2080 return -1;
2081
2082 duration = poppler_page_get_duration (poppler_page);
2083 g_object_unref (poppler_page);
2084
2085 return duration;
2086}
2087
2088static EvTransitionEffect *
2089pdf_document_get_effect (EvDocumentTransition *trans,
2090 gint page)
2091{
2092 PdfDocument *pdf_document;
2093 PopplerPage *poppler_page;
2094 PopplerPageTransition *page_transition;
2095 EvTransitionEffect *effect;
2096
2097 pdf_document = PDF_DOCUMENT (trans)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((trans)), ((pdf_document_get_type ()))))))
;
2098 poppler_page = poppler_document_get_page (pdf_document->document, page);
2099
2100 if (!poppler_page)
2101 return NULL__null;
2102
2103 page_transition = poppler_page_get_transition (poppler_page);
2104
2105 if (!page_transition) {
2106 g_object_unref (poppler_page);
2107 return NULL__null;
2108 }
2109
2110 /* enums in PopplerPageTransition match the EvTransitionEffect ones */
2111 effect = ev_transition_effect_new ((EvTransitionEffectType) page_transition->type,
2112 "alignment", page_transition->alignment,
2113 "direction", page_transition->direction,
2114 "duration", page_transition->duration,
2115 "angle", page_transition->angle,
2116 "scale", page_transition->scale,
2117 "rectangular", page_transition->rectangular,
2118 NULL__null);
2119
2120 poppler_page_transition_free (page_transition);
2121 g_object_unref (poppler_page);
2122
2123 return effect;
2124}
2125
2126static void
2127pdf_document_page_transition_iface_init (EvDocumentTransitionInterface *iface)
2128{
2129 iface->get_page_duration = pdf_document_get_page_duration;
2130 iface->get_effect = pdf_document_get_effect;
2131}
2132
2133/* Forms */
2134#if 0
2135static void
2136pdf_document_get_crop_box (EvDocument *document,
2137 int page,
2138 EvRectangle *rect)
2139{
2140 PdfDocument *pdf_document;
2141 PopplerPage *poppler_page;
2142 PopplerRectangle poppler_rect;
2143
2144 pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
2145 poppler_page = poppler_document_get_page (pdf_document->document, page);
2146 poppler_page_get_crop_box (poppler_page, &poppler_rect);
2147 rect->x1 = poppler_rect.x1;
2148 rect->x2 = poppler_rect.x2;
2149 rect->y1 = poppler_rect.y1;
2150 rect->y2 = poppler_rect.y2;
2151}
2152#endif
2153
2154static EvFormField *
2155ev_form_field_from_poppler_field (PdfDocument *pdf_document,
2156 PopplerFormField *poppler_field)
2157{
2158 EvFormField *ev_field = NULL__null;
2159 gint id;
2160 gdouble font_size;
2161 gboolean is_read_only;
2162 PopplerAction *action;
2163
2164 id = poppler_form_field_get_id (poppler_field);
2165 font_size = poppler_form_field_get_font_size (poppler_field);
2166 is_read_only = poppler_form_field_is_read_only (poppler_field);
2167 action = poppler_form_field_get_action (poppler_field);
2168
2169 switch (poppler_form_field_get_field_type (poppler_field)) {
2170 case POPPLER_FORM_FIELD_TEXT: {
2171 EvFormFieldText *field_text;
2172 EvFormFieldTextType ev_text_type = EV_FORM_FIELD_TEXT_NORMAL;
2173
2174 switch (poppler_form_field_text_get_text_type (poppler_field)) {
2175 case POPPLER_FORM_TEXT_NORMAL:
2176 ev_text_type = EV_FORM_FIELD_TEXT_NORMAL;
2177 break;
2178 case POPPLER_FORM_TEXT_MULTILINE:
2179 ev_text_type = EV_FORM_FIELD_TEXT_MULTILINE;
2180 break;
2181 case POPPLER_FORM_TEXT_FILE_SELECT:
2182 ev_text_type = EV_FORM_FIELD_TEXT_FILE_SELECT;
2183 break;
2184 }
2185
2186 ev_field = ev_form_field_text_new (id, ev_text_type);
2187 field_text = EV_FORM_FIELD_TEXT (ev_field)((((EvFormFieldText*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_field)), ((ev_form_field_text_get_type()))))))
;
2188
2189 field_text->do_spell_check = poppler_form_field_text_do_spell_check (poppler_field);
2190 field_text->do_scroll = poppler_form_field_text_do_scroll (poppler_field);
2191 field_text->is_rich_text = poppler_form_field_text_is_rich_text (poppler_field);
2192 field_text->is_password = poppler_form_field_text_is_password (poppler_field);
2193 field_text->max_len = poppler_form_field_text_get_max_len (poppler_field);
2194 field_text->text = poppler_form_field_text_get_text (poppler_field);
2195
2196 }
2197 break;
2198 case POPPLER_FORM_FIELD_BUTTON: {
2199 EvFormFieldButton *field_button;
2200 EvFormFieldButtonType ev_button_type = EV_FORM_FIELD_BUTTON_PUSH;
2201
2202 switch (poppler_form_field_button_get_button_type (poppler_field)) {
2203 case POPPLER_FORM_BUTTON_PUSH:
2204 ev_button_type = EV_FORM_FIELD_BUTTON_PUSH;
2205 break;
2206 case POPPLER_FORM_BUTTON_CHECK:
2207 ev_button_type = EV_FORM_FIELD_BUTTON_CHECK;
2208 break;
2209 case POPPLER_FORM_BUTTON_RADIO:
2210 ev_button_type = EV_FORM_FIELD_BUTTON_RADIO;
2211 break;
2212 }
2213
2214 ev_field = ev_form_field_button_new (id, ev_button_type);
2215 field_button = EV_FORM_FIELD_BUTTON (ev_field)((((EvFormFieldButton*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((ev_field)), ((ev_form_field_button_get_type
()))))))
;
2216
2217 field_button->state = poppler_form_field_button_get_state (poppler_field);
2218 }
2219 break;
2220 case POPPLER_FORM_FIELD_CHOICE: {
2221 EvFormFieldChoice *field_choice;
2222 EvFormFieldChoiceType ev_choice_type = EV_FORM_FIELD_CHOICE_COMBO;
2223
2224 switch (poppler_form_field_choice_get_choice_type (poppler_field)) {
2225 case POPPLER_FORM_CHOICE_COMBO:
2226 ev_choice_type = EV_FORM_FIELD_CHOICE_COMBO;
2227 break;
2228 case EV_FORM_FIELD_CHOICE_LIST:
2229 ev_choice_type = EV_FORM_FIELD_CHOICE_LIST;
2230 break;
2231 }
2232
2233 ev_field = ev_form_field_choice_new (id, ev_choice_type);
2234 field_choice = EV_FORM_FIELD_CHOICE (ev_field)((((EvFormFieldChoice*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((ev_field)), ((ev_form_field_choice_get_type
()))))))
;
2235
2236 field_choice->is_editable = poppler_form_field_choice_is_editable (poppler_field);
2237 field_choice->multi_select = poppler_form_field_choice_can_select_multiple (poppler_field);
2238 field_choice->do_spell_check = poppler_form_field_choice_do_spell_check (poppler_field);
2239 field_choice->commit_on_sel_change = poppler_form_field_choice_commit_on_change (poppler_field);
2240
2241 /* TODO: we need poppler_form_field_choice_get_selected_items in poppler
2242 field_choice->selected_items = poppler_form_field_choice_get_selected_items (poppler_field);*/
2243 if (field_choice->is_editable)
2244 field_choice->text = poppler_form_field_choice_get_text (poppler_field);
2245 }
2246 break;
2247 case POPPLER_FORM_FIELD_SIGNATURE:
2248 /* TODO */
2249 ev_field = ev_form_field_signature_new (id);
2250 break;
2251 case POPPLER_FORM_FIELD_UNKNOWN:
2252 return NULL__null;
2253 }
2254
2255 ev_field->font_size = font_size;
2256 ev_field->is_read_only = is_read_only;
2257
2258 if (action)
2259 ev_field->activation_link = ev_link_from_action (pdf_document, action);
2260
2261 return ev_field;
2262}
2263
2264static EvMappingList *
2265pdf_document_forms_get_form_fields (EvDocumentForms *document,
2266 EvPage *page)
2267{
2268 PopplerPage *poppler_page;
2269 GList *retval = NULL__null;
2270 GList *fields;
2271 GList *list;
2272 double height;
2273
2274 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)
;
2275
2276 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
2277 fields = poppler_page_get_form_field_mapping (poppler_page);
2278 poppler_page_get_size (poppler_page, NULL__null, &height);
2279
2280 for (list = fields; list; list = list->next) {
2281 PopplerFormFieldMapping *mapping;
2282 EvMapping *field_mapping;
2283 EvFormField *ev_field;
2284
2285 mapping = (PopplerFormFieldMapping *)list->data;
2286
2287 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);
2288 if (!ev_field)
2289 continue;
2290
2291 field_mapping = g_new0 (EvMapping, 1)((EvMapping *) g_malloc0_n ((1), sizeof (EvMapping)));
2292 field_mapping->area.x1 = mapping->area.x1;
2293 field_mapping->area.x2 = mapping->area.x2;
2294 field_mapping->area.y1 = height - mapping->area.y2;
2295 field_mapping->area.y2 = height - mapping->area.y1;
2296 field_mapping->data = ev_field;
2297 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()))))))
;
2298
2299 g_object_set_data_full (G_OBJECT (ev_field)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_field)), (((GType) ((20) << (2))))))))
,
2300 "poppler-field",
2301 g_object_ref (mapping->field)((typename std::remove_reference<decltype (mapping->field
)>::type) (g_object_ref) (mapping->field))
,
2302 (GDestroyNotify) g_object_unref);
2303
2304 retval = g_list_prepend (retval, field_mapping);
2305 }
2306
2307 poppler_page_free_form_field_mapping (fields);
2308
2309 return retval ? ev_mapping_list_new (page->index,
2310 g_list_reverse (retval),
2311 (GDestroyNotify)g_object_unref) : NULL__null;
2312}
2313
2314static gboolean
2315pdf_document_forms_document_is_modified (EvDocumentForms *document)
2316{
2317 return PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified;
2318}
2319
2320static gchar *
2321pdf_document_forms_form_field_text_get_text (EvDocumentForms *document G_GNUC_UNUSED__attribute__ ((__unused__)),
2322 EvFormField *field)
2323
2324{
2325 PopplerFormField *poppler_field;
2326 gchar *text;
2327
2328 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()))))
))
;
2329 if (!poppler_field)
2330 return NULL__null;
2331
2332 text = poppler_form_field_text_get_text (poppler_field);
2333
2334 return text;
2335}
2336
2337static void
2338pdf_document_forms_form_field_text_set_text (EvDocumentForms *document,
2339 EvFormField *field,
2340 const gchar *text)
2341{
2342 PopplerFormField *poppler_field;
2343
2344 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()))))
))
;
2345 if (!poppler_field)
2346 return;
2347
2348 poppler_form_field_text_set_text (poppler_field, text);
2349 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2350}
2351
2352static void
2353pdf_document_forms_form_field_button_set_state (EvDocumentForms *document,
2354 EvFormField *field,
2355 gboolean state)
2356{
2357 PopplerFormField *poppler_field;
2358
2359 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()))))
))
;
2360 if (!poppler_field)
2361 return;
2362
2363 poppler_form_field_button_set_state (poppler_field, state);
2364 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2365}
2366
2367static gboolean
2368pdf_document_forms_form_field_button_get_state (EvDocumentForms *document G_GNUC_UNUSED__attribute__ ((__unused__)),
2369 EvFormField *field)
2370{
2371 PopplerFormField *poppler_field;
2372 gboolean state;
2373
2374 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()))))
))
;
2375 if (!poppler_field)
2376 return FALSE(0);
2377
2378 state = poppler_form_field_button_get_state (poppler_field);
2379
2380 return state;
2381}
2382
2383static gchar *
2384pdf_document_forms_form_field_choice_get_item (EvDocumentForms *document G_GNUC_UNUSED__attribute__ ((__unused__)),
2385 EvFormField *field,
2386 gint index)
2387{
2388 PopplerFormField *poppler_field;
2389 gchar *text;
2390
2391 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()))))
))
;
2392 if (!poppler_field)
2393 return NULL__null;
2394
2395 text = poppler_form_field_choice_get_item (poppler_field, index);
2396
2397 return text;
2398}
2399
2400static int
2401pdf_document_forms_form_field_choice_get_n_items (EvDocumentForms *document G_GNUC_UNUSED__attribute__ ((__unused__)),
2402 EvFormField *field)
2403{
2404 PopplerFormField *poppler_field;
2405 gint n_items;
2406
2407 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()))))
))
;
2408 if (!poppler_field)
2409 return -1;
2410
2411 n_items = poppler_form_field_choice_get_n_items (poppler_field);
2412
2413 return n_items;
2414}
2415
2416static gboolean
2417pdf_document_forms_form_field_choice_is_item_selected (EvDocumentForms *document G_GNUC_UNUSED__attribute__ ((__unused__)),
2418 EvFormField *field,
2419 gint index)
2420{
2421 PopplerFormField *poppler_field;
2422 gboolean selected;
2423
2424 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()))))
))
;
2425 if (!poppler_field)
2426 return FALSE(0);
2427
2428 selected = poppler_form_field_choice_is_item_selected (poppler_field, index);
2429
2430 return selected;
2431}
2432
2433static void
2434pdf_document_forms_form_field_choice_select_item (EvDocumentForms *document,
2435 EvFormField *field,
2436 gint index)
2437{
2438 PopplerFormField *poppler_field;
2439
2440 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()))))
))
;
2441 if (!poppler_field)
2442 return;
2443
2444 poppler_form_field_choice_select_item (poppler_field, index);
2445 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2446}
2447
2448static void
2449pdf_document_forms_form_field_choice_toggle_item (EvDocumentForms *document,
2450 EvFormField *field,
2451 gint index)
2452{
2453 PopplerFormField *poppler_field;
2454
2455 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()))))
))
;
2456 if (!poppler_field)
2457 return;
2458
2459 poppler_form_field_choice_toggle_item (poppler_field, index);
2460 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2461}
2462
2463static void
2464pdf_document_forms_form_field_choice_unselect_all (EvDocumentForms *document,
2465 EvFormField *field)
2466{
2467 PopplerFormField *poppler_field;
2468
2469 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()))))
))
;
2470 if (!poppler_field)
2471 return;
2472
2473 poppler_form_field_choice_unselect_all (poppler_field);
2474 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2475}
2476
2477static void
2478pdf_document_forms_form_field_choice_set_text (EvDocumentForms *document,
2479 EvFormField *field,
2480 const gchar *text)
2481{
2482 PopplerFormField *poppler_field;
2483
2484 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()))))
))
;
2485 if (!poppler_field)
2486 return;
2487
2488 poppler_form_field_choice_set_text (poppler_field, text);
2489 PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
->forms_modified = TRUE(!(0));
2490}
2491
2492static gchar *
2493pdf_document_forms_form_field_choice_get_text (EvDocumentForms *document G_GNUC_UNUSED__attribute__ ((__unused__)),
2494 EvFormField *field)
2495{
2496 PopplerFormField *poppler_field;
2497 gchar *text;
2498
2499 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()))))
))
;
2500 if (!poppler_field)
2501 return NULL__null;
2502
2503 text = poppler_form_field_choice_get_text (poppler_field);
2504
2505 return text;
2506}
2507
2508static void
2509pdf_document_document_forms_iface_init (EvDocumentFormsInterface *iface)
2510{
2511 iface->get_form_fields = pdf_document_forms_get_form_fields;
2512 iface->document_is_modified = pdf_document_forms_document_is_modified;
2513 iface->form_field_text_get_text = pdf_document_forms_form_field_text_get_text;
2514 iface->form_field_text_set_text = pdf_document_forms_form_field_text_set_text;
2515 iface->form_field_button_set_state = pdf_document_forms_form_field_button_set_state;
2516 iface->form_field_button_get_state = pdf_document_forms_form_field_button_get_state;
2517 iface->form_field_choice_get_item = pdf_document_forms_form_field_choice_get_item;
2518 iface->form_field_choice_get_n_items = pdf_document_forms_form_field_choice_get_n_items;
2519 iface->form_field_choice_is_item_selected = pdf_document_forms_form_field_choice_is_item_selected;
2520 iface->form_field_choice_select_item = pdf_document_forms_form_field_choice_select_item;
2521 iface->form_field_choice_toggle_item = pdf_document_forms_form_field_choice_toggle_item;
2522 iface->form_field_choice_unselect_all = pdf_document_forms_form_field_choice_unselect_all;
2523 iface->form_field_choice_set_text = pdf_document_forms_form_field_choice_set_text;
2524 iface->form_field_choice_get_text = pdf_document_forms_form_field_choice_get_text;
2525}
2526
2527/* Annotations */
2528static void
2529poppler_annot_color_to_cdk_color (PopplerAnnot *poppler_annot,
2530 CdkColor *color)
2531{
2532 PopplerColor *poppler_color;
2533
2534 poppler_color = poppler_annot_get_color (poppler_annot);
2535 if (poppler_color) {
2536 color->red = poppler_color->red;
2537 color->green = poppler_color->green;
2538 color->blue = poppler_color->blue;
2539
2540 g_free (poppler_color);
2541 } /* TODO: else use a default color */
2542}
2543
2544static EvAnnotationTextIcon
2545get_annot_text_icon (PopplerAnnotText *poppler_annot)
2546{
2547 gchar *icon = poppler_annot_text_get_icon (poppler_annot);
2548 EvAnnotationTextIcon retval;
2549
2550 if (!icon)
2551 return EV_ANNOTATION_TEXT_ICON_UNKNOWN;
2552
2553 if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_NOTE"Note") == 0)
2554 retval = EV_ANNOTATION_TEXT_ICON_NOTE;
2555 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_COMMENT"Comment") == 0)
2556 retval = EV_ANNOTATION_TEXT_ICON_COMMENT;
2557 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_KEY"Key") == 0)
2558 retval = EV_ANNOTATION_TEXT_ICON_KEY;
2559 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_HELP"Help") == 0)
2560 retval = EV_ANNOTATION_TEXT_ICON_HELP;
2561 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH"NewParagraph") == 0)
2562 retval = EV_ANNOTATION_TEXT_ICON_NEW_PARAGRAPH;
2563 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_PARAGRAPH"Paragraph") == 0)
2564 retval = EV_ANNOTATION_TEXT_ICON_PARAGRAPH;
2565 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_INSERT"Insert") == 0)
2566 retval = EV_ANNOTATION_TEXT_ICON_INSERT;
2567 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_CROSS"Cross") == 0)
2568 retval = EV_ANNOTATION_TEXT_ICON_CROSS;
2569 else if (strcmp (icon, POPPLER_ANNOT_TEXT_ICON_CIRCLE"Circle") == 0)
2570 retval = EV_ANNOTATION_TEXT_ICON_CIRCLE;
2571 else
2572 retval = EV_ANNOTATION_TEXT_ICON_UNKNOWN;
2573
2574 g_free (icon);
2575
2576 return retval;
2577}
2578
2579static const gchar *
2580get_poppler_annot_text_icon (EvAnnotationTextIcon icon)
2581{
2582 switch (icon) {
2583 case EV_ANNOTATION_TEXT_ICON_NOTE:
2584 return POPPLER_ANNOT_TEXT_ICON_NOTE"Note";
2585 case EV_ANNOTATION_TEXT_ICON_COMMENT:
2586 return POPPLER_ANNOT_TEXT_ICON_COMMENT"Comment";
2587 case EV_ANNOTATION_TEXT_ICON_KEY:
2588 return POPPLER_ANNOT_TEXT_ICON_KEY"Key";
2589 case EV_ANNOTATION_TEXT_ICON_HELP:
2590 return POPPLER_ANNOT_TEXT_ICON_HELP"Help";
2591 case EV_ANNOTATION_TEXT_ICON_NEW_PARAGRAPH:
2592 return POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH"NewParagraph";
2593 case EV_ANNOTATION_TEXT_ICON_PARAGRAPH:
2594 return POPPLER_ANNOT_TEXT_ICON_PARAGRAPH"Paragraph";
2595 case EV_ANNOTATION_TEXT_ICON_INSERT:
2596 return POPPLER_ANNOT_TEXT_ICON_INSERT"Insert";
2597 case EV_ANNOTATION_TEXT_ICON_CROSS:
2598 return POPPLER_ANNOT_TEXT_ICON_CROSS"Cross";
2599 case EV_ANNOTATION_TEXT_ICON_CIRCLE:
2600 return POPPLER_ANNOT_TEXT_ICON_CIRCLE"Circle";
2601 case EV_ANNOTATION_TEXT_ICON_UNKNOWN:
2602 default:
2603 return POPPLER_ANNOT_TEXT_ICON_NOTE"Note";
2604 }
2605}
2606
2607static EvAnnotation *
2608ev_annot_from_poppler_annot (PopplerAnnot *poppler_annot,
2609 EvPage *page)
2610{
2611 EvAnnotation *ev_annot = NULL__null;
2612 const gchar *unimplemented_annot = NULL__null;
2613
2614 switch (poppler_annot_get_annot_type (poppler_annot)) {
2615 case POPPLER_ANNOT_TEXT: {
2616 PopplerAnnotText *poppler_text;
2617 EvAnnotationText *ev_annot_text;
2618
2619 poppler_text = POPPLER_ANNOT_TEXT (poppler_annot)((((PopplerAnnotText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((poppler_annot)), ((poppler_annot_text_get_type
()))))))
;
2620
2621 ev_annot = ev_annotation_text_new (page);
2622
2623 ev_annot_text = EV_ANNOTATION_TEXT (ev_annot)((((EvAnnotationText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((ev_annot)), ((ev_annotation_text_get_type()
))))))
;
2624 ev_annotation_text_set_is_open (ev_annot_text,
2625 poppler_annot_text_get_is_open (poppler_text));
2626 ev_annotation_text_set_icon (ev_annot_text, get_annot_text_icon (poppler_text));
2627 }
2628 break;
2629 case POPPLER_ANNOT_FILE_ATTACHMENT: {
2630 PopplerAnnotFileAttachment *poppler_annot_attachment;
2631 PopplerAttachment *poppler_attachment;
2632 gchar *data = NULL__null;
2633 gsize size;
2634 GError *error = NULL__null;
2635
2636 poppler_annot_attachment = POPPLER_ANNOT_FILE_ATTACHMENT (poppler_annot)((((PopplerAnnotFileAttachment*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((poppler_annot)), ((poppler_annot_file_attachment_get_type
()))))))
;
2637 poppler_attachment = poppler_annot_file_attachment_get_attachment (poppler_annot_attachment);
2638
2639 if (poppler_attachment &&
2640 attachment_save_to_buffer (poppler_attachment, &data, &size, &error)) {
2641 EvAttachment *ev_attachment;
2642
2643 ev_attachment = ev_attachment_new (poppler_attachment->name,
2644 poppler_attachment->description,
2645 poppler_attachment->mtime,
2646 poppler_attachment->ctime,
2647 size, data);
2648 ev_annot = ev_annotation_attachment_new (page, ev_attachment);
2649 g_object_unref (ev_attachment);
2650 } else if (error) {
2651 g_warning ("%s", error->message);
2652 g_error_free (error);
2653 }
2654
2655 if (poppler_attachment)
2656 g_object_unref (poppler_attachment);
2657 }
2658 break;
2659 case POPPLER_ANNOT_LINK:
2660 case POPPLER_ANNOT_WIDGET:
2661 /* Ignore link and widgets annots since they are already handled */
2662 break;
2663 default: {
2664 GEnumValue *enum_value;
2665
2666 enum_value = g_enum_get_value ((GEnumClass *) g_type_class_ref (POPPLER_TYPE_ANNOT_TYPE(poppler_annot_type_get_type ())),
2667 poppler_annot_get_annot_type (poppler_annot));
2668 unimplemented_annot = enum_value ? enum_value->value_name : "Unknown annotation";
2669 }
2670 }
2671
2672 if (unimplemented_annot) {
2673 g_warning ("Unimplemented annotation: %s, please post a "
2674 "bug report on Lector bug tracker "
2675 "(https://github.com/cafe-desktop/lector/issues) with a testcase.",
2676 unimplemented_annot);
2677 }
2678
2679 if (ev_annot) {
2680 time_t utime;
2681 gchar *modified;
2682 gchar *contents;
2683 gchar *name;
2684 CdkColor color;
2685
2686 contents = poppler_annot_get_contents (poppler_annot);
2687 if (contents) {
2688 ev_annotation_set_contents (ev_annot, contents);
2689 g_free (contents);
2690 }
2691
2692 name = poppler_annot_get_name (poppler_annot);
2693 if (name) {
2694 ev_annotation_set_name (ev_annot, name);
2695 g_free (name);
2696 }
2697
2698 modified = poppler_annot_get_modified (poppler_annot);
2699 if (poppler_date_parse (modified, &utime)) {
2700 ev_annotation_set_modified_from_time (ev_annot, utime);
2701 } else {
2702 ev_annotation_set_modified (ev_annot, modified);
2703 }
2704 g_free (modified);
2705
2706 poppler_annot_color_to_cdk_color (poppler_annot, &color);
2707 ev_annotation_set_color (ev_annot, &color);
2708
2709 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; }))))
) {
2710 PopplerAnnotMarkup *markup;
2711 gchar *label;
2712 gdouble opacity;
2713 PopplerRectangle poppler_rect;
2714
2715 markup = POPPLER_ANNOT_MARKUP (poppler_annot)((((PopplerAnnotMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((poppler_annot)), ((poppler_annot_markup_get_type
()))))))
;
2716
2717 if (poppler_annot_markup_get_popup_rectangle (markup, &poppler_rect)) {
2718 EvRectangle ev_rect;
2719 gboolean is_open;
2720 gdouble height;
2721
2722 poppler_page_get_size (POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
,
2723 NULL__null, &height);
2724 ev_rect.x1 = poppler_rect.x1;
2725 ev_rect.x2 = poppler_rect.x2;
2726 ev_rect.y1 = height - poppler_rect.y2;
2727 ev_rect.y2 = height - poppler_rect.y1;
2728
2729 is_open = poppler_annot_markup_get_popup_is_open (markup);
2730
2731 g_object_set (ev_annot,
2732 "rectangle", &ev_rect,
2733 "popup_is_open", is_open,
2734 "has_popup", TRUE(!(0)),
2735 NULL__null);
2736 } else {
2737 g_object_set (ev_annot,
2738 "has_popup", FALSE(0),
2739 NULL__null);
2740 }
2741
2742 label = poppler_annot_markup_get_label (markup);
2743 opacity = poppler_annot_markup_get_opacity (markup);
2744
2745 g_object_set (ev_annot,
2746 "label", label,
2747 "opacity", opacity,
2748 NULL__null);
2749
2750 g_free (label);
2751 }
2752 }
2753
2754 return ev_annot;
2755}
2756
2757static void
2758annot_set_unique_name (EvAnnotation *annot)
2759{
2760 gchar *name;
2761
2762 name = g_strdup_printf ("annot-%" G_GUINT64_FORMAT"lu", g_get_real_time ());
2763 ev_annotation_set_name (annot, name);
2764 g_free (name);
2765}
2766
2767static EvMappingList *
2768pdf_document_annotations_get_annotations (EvDocumentAnnotations *document_annotations,
2769 EvPage *page)
2770{
2771 GList *retval = NULL__null;
2772 PdfDocument *pdf_document;
2773 PopplerPage *poppler_page;
2774 EvMappingList *mapping_list;
2775 GList *annots;
2776 GList *list;
2777 gdouble height;
2778 gint i = 0;
2779
2780 pdf_document = PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
;
2781 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
2782
2783 if (pdf_document->annots) {
2784 mapping_list = (EvMappingList *)g_hash_table_lookup (pdf_document->annots,
2785 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)));
2786 if (mapping_list)
2787 return ev_mapping_list_ref (mapping_list);
2788 }
2789
2790 annots = poppler_page_get_annot_mapping (poppler_page);
2791 poppler_page_get_size (poppler_page, NULL__null, &height);
2792
2793 for (list = annots; list; list = list->next) {
2794 PopplerAnnotMapping *mapping;
2795 EvMapping *annot_mapping;
2796 EvAnnotation *ev_annot;
2797
2798 mapping = (PopplerAnnotMapping *)list->data;
2799
2800 ev_annot = ev_annot_from_poppler_annot (mapping->annot, page);
2801 if (!ev_annot)
2802 continue;
2803
2804 i++;
2805
2806 /* Make sure annot has a unique name */
2807 if (!ev_annotation_get_name (ev_annot))
2808 annot_set_unique_name (ev_annot);
2809
2810 annot_mapping = g_new (EvMapping, 1)((EvMapping *) g_malloc_n ((1), sizeof (EvMapping)));
2811 annot_mapping->area.x1 = mapping->area.x1;
2812 annot_mapping->area.x2 = mapping->area.x2;
2813 annot_mapping->area.y1 = height - mapping->area.y2;
2814 annot_mapping->area.y2 = height - mapping->area.y1;
2815 annot_mapping->data = ev_annot;
2816
2817 g_object_set_data_full (G_OBJECT (ev_annot)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_annot)), (((GType) ((20) << (2))))))))
,
2818 "poppler-annot",
2819 g_object_ref (mapping->annot)((typename std::remove_reference<decltype (mapping->annot
)>::type) (g_object_ref) (mapping->annot))
,
2820 (GDestroyNotify) g_object_unref);
2821
2822 retval = g_list_prepend (retval, annot_mapping);
2823 }
2824
2825 poppler_page_free_annot_mapping (annots);
2826
2827 if (!retval)
2828 return NULL__null;
2829
2830 if (!pdf_document->annots) {
2831 pdf_document->annots = g_hash_table_new_full (g_direct_hash,
2832 g_direct_equal,
2833 (GDestroyNotify)NULL__null,
2834 (GDestroyNotify)ev_mapping_list_unref);
2835 }
2836
2837 mapping_list = ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
2838 g_hash_table_insert (pdf_document->annots,
2839 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)),
2840 ev_mapping_list_ref (mapping_list));
2841
2842 return mapping_list;
2843}
2844
2845static gboolean
2846pdf_document_annotations_document_is_modified (EvDocumentAnnotations *document_annotations)
2847{
2848 return PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
->annots_modified;
2849}
2850
2851static void
2852pdf_document_annotations_remove_annotation (EvDocumentAnnotations *document_annotations,
2853 EvAnnotation *annot)
2854{
2855 PopplerPage *poppler_page;
2856 PdfDocument *pdf_document;
2857 EvPage *page;
2858 PopplerAnnot *poppler_annot;
2859 EvMappingList *mapping_list;
2860 EvMapping *annot_mapping;
2861 GList *list;
2862
2863 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()))))))
;
2864 pdf_document = PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
;
2865 page = ev_annotation_get_page (annot);
2866 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
2867
2868 poppler_page_remove_annot (poppler_page, poppler_annot);
2869
2870 /* We don't check for pdf_document->annots, if it were NULL then something is really wrong */
2871 mapping_list = (EvMappingList *)g_hash_table_lookup (pdf_document->annots,
2872 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)));
2873 if (mapping_list) {
2874 annot_mapping = ev_mapping_list_find (mapping_list, annot);
2875 ev_mapping_list_remove (mapping_list, annot_mapping);
2876 if (ev_mapping_list_length (mapping_list) == 0)
2877 g_hash_table_remove (pdf_document->annots, GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)));
2878 }
2879
2880 pdf_document->annots_modified = TRUE(!(0));
2881}
2882
2883static void
2884pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotations,
2885 EvAnnotation *annot,
2886 EvRectangle *rect)
2887{
2888 PopplerAnnot *poppler_annot;
2889 PdfDocument *pdf_document;
2890 EvPage *page;
2891 PopplerPage *poppler_page;
2892 GList *list = NULL__null;
2893 EvMappingList *mapping_list;
2894 EvMapping *annot_mapping;
2895 PopplerRectangle poppler_rect;
2896 gdouble height;
2897 PopplerColor poppler_color;
2898 CdkColor color;
2899
2900 pdf_document = PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
;
2901 page = ev_annotation_get_page (annot);
2902 poppler_page = POPPLER_PAGE (page->backend_page)((((PopplerPage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((page->backend_page)), ((poppler_page_get_type()))))))
;
2903
2904 poppler_page_get_size (poppler_page, NULL__null, &height);
2905 poppler_rect.x1 = rect->x1;
2906 poppler_rect.x2 = rect->x2;
2907 poppler_rect.y1 = height - rect->y2;
2908 poppler_rect.y2 = height - rect->y1;
2909
2910 switch (ev_annotation_get_annotation_type (annot)) {
2911 case EV_ANNOTATION_TYPE_TEXT: {
2912 EvAnnotationText *text = EV_ANNOTATION_TEXT (annot)((((EvAnnotationText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((annot)), ((ev_annotation_text_get_type())))
)))
;
2913 EvAnnotationTextIcon icon;
2914
2915 poppler_annot = poppler_annot_text_new (pdf_document->document, &poppler_rect);
2916
2917 icon = ev_annotation_text_get_icon (text);
2918 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
()))))))
,
2919 get_poppler_annot_text_icon (icon));
2920 }
2921 break;
2922 default:
2923 g_assert_not_reached ()do { g_assertion_message_expr (((gchar*) 0), "ev-poppler.cc",
2923, ((const char*) (__PRETTY_FUNCTION__)), __null); } while
(0)
;
2924 }
2925
2926 ev_annotation_get_color (annot, &color);
2927 poppler_color.red = color.red;
2928 poppler_color.green = color.green;
2929 poppler_color.blue = color.blue;
2930 poppler_annot_set_color (poppler_annot, &poppler_color);
2931
2932 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; }))))
) {
2933 EvAnnotationMarkup *markup = EV_ANNOTATION_MARKUP (annot)((((EvAnnotationMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((annot)), ((ev_annotation_markup_get_type (
)))))))
;
2934 const gchar *label;
2935
2936 if (ev_annotation_markup_has_popup (markup)) {
2937 EvRectangle popup_rect;
2938
2939 ev_annotation_markup_get_rectangle (markup, &popup_rect);
2940 poppler_rect.x1 = popup_rect.x1;
2941 poppler_rect.x2 = popup_rect.x2;
2942 poppler_rect.y1 = height - popup_rect.y2;
2943 poppler_rect.y2 = height - popup_rect.y1;
2944 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);
2945 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
()))))))
,
2946 ev_annotation_markup_get_popup_is_open (markup));
2947 }
2948
2949 label = ev_annotation_markup_get_label (markup);
2950 if (label)
2951 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);
2952 }
2953
2954 poppler_page_add_annot (poppler_page, poppler_annot);
2955
2956 annot_mapping = g_new (EvMapping, 1)((EvMapping *) g_malloc_n ((1), sizeof (EvMapping)));
2957 annot_mapping->area = *rect;
2958 annot_mapping->data = annot;
2959 g_object_set_data_full (G_OBJECT (annot)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((annot)), (((GType) ((20) << (2))))))))
,
2960 "poppler-annot",
2961 poppler_annot,
2962 (GDestroyNotify) g_object_unref);
2963
2964 if (pdf_document->annots) {
2965 mapping_list = (EvMappingList *)g_hash_table_lookup (pdf_document->annots,
2966 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)));
2967 } else {
2968 pdf_document->annots = g_hash_table_new_full (g_direct_hash,
2969 g_direct_equal,
2970 (GDestroyNotify)NULL__null,
2971 (GDestroyNotify)ev_mapping_list_unref);
2972 mapping_list = NULL__null;
2973 }
2974
2975 annot_set_unique_name (annot);
2976
2977 if (mapping_list) {
2978 list = ev_mapping_list_get_list (mapping_list);
2979 list = g_list_append (list, annot_mapping);
Value stored to 'list' is never read
2980 } else {
2981 list = g_list_append (list, annot_mapping);
2982 mapping_list = ev_mapping_list_new (page->index, list, (GDestroyNotify)g_object_unref);
2983 g_hash_table_insert (pdf_document->annots,
2984 GINT_TO_POINTER (page->index)((gpointer) (glong) (page->index)),
2985 ev_mapping_list_ref (mapping_list));
2986 }
2987
2988 pdf_document->annots_modified = TRUE(!(0));
2989}
2990
2991static void
2992pdf_document_annotations_save_annotation (EvDocumentAnnotations *document_annotations,
2993 EvAnnotation *annot,
2994 EvAnnotationsSaveMask mask)
2995{
2996 PopplerAnnot *poppler_annot;
2997
2998 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()))))))
;
2999 if (!poppler_annot)
3000 return;
3001
3002 if (mask & EV_ANNOTATIONS_SAVE_CONTENTS)
3003 poppler_annot_set_contents (poppler_annot,
3004 ev_annotation_get_contents (annot));
3005
3006 if (mask & EV_ANNOTATIONS_SAVE_COLOR) {
3007 PopplerColor color;
3008 CdkColor ev_color;
3009
3010 ev_annotation_get_color (annot, &ev_color);
3011 color.red = ev_color.red;
3012 color.green = ev_color.green;
3013 color.blue = ev_color.blue;
3014 poppler_annot_set_color (poppler_annot, &color);
3015 }
3016
3017 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; }))))
) {
3018 EvAnnotationMarkup *ev_markup = EV_ANNOTATION_MARKUP (annot)((((EvAnnotationMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((annot)), ((ev_annotation_markup_get_type (
)))))))
;
3019 PopplerAnnotMarkup *markup = POPPLER_ANNOT_MARKUP (poppler_annot)((((PopplerAnnotMarkup*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((poppler_annot)), ((poppler_annot_markup_get_type
()))))))
;
3020
3021 if (mask & EV_ANNOTATIONS_SAVE_LABEL)
3022 poppler_annot_markup_set_label (markup, ev_annotation_markup_get_label (ev_markup));
3023 if (mask & EV_ANNOTATIONS_SAVE_OPACITY)
3024 poppler_annot_markup_set_opacity (markup, ev_annotation_markup_get_opacity (ev_markup));
3025 if (mask & EV_ANNOTATIONS_SAVE_POPUP_IS_OPEN)
3026 poppler_annot_markup_set_popup_is_open (markup, ev_annotation_markup_get_popup_is_open (ev_markup));
3027 }
3028
3029 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; }))))
) {
3030 EvAnnotationText *ev_text = EV_ANNOTATION_TEXT (annot)((((EvAnnotationText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((annot)), ((ev_annotation_text_get_type())))
)))
;
3031 PopplerAnnotText *text = POPPLER_ANNOT_TEXT (poppler_annot)((((PopplerAnnotText*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((poppler_annot)), ((poppler_annot_text_get_type
()))))))
;
3032
3033 if (mask & EV_ANNOTATIONS_SAVE_TEXT_IS_OPEN) {
3034 poppler_annot_text_set_is_open (text,
3035 ev_annotation_text_get_is_open (ev_text));
3036 }
3037 if (mask & EV_ANNOTATIONS_SAVE_TEXT_ICON) {
3038 EvAnnotationTextIcon icon;
3039
3040 icon = ev_annotation_text_get_icon (ev_text);
3041 poppler_annot_text_set_icon (text, get_poppler_annot_text_icon (icon));
3042 }
3043 }
3044
3045 PDF_DOCUMENT (document_annotations)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document_annotations)), ((pdf_document_get_type ()))))))
->annots_modified = TRUE(!(0));
3046}
3047
3048static void
3049pdf_document_document_annotations_iface_init (EvDocumentAnnotationsInterface *iface)
3050{
3051 iface->get_annotations = pdf_document_annotations_get_annotations;
3052 iface->document_is_modified = pdf_document_annotations_document_is_modified;
3053 iface->add_annotation = pdf_document_annotations_add_annotation;
3054 iface->save_annotation = pdf_document_annotations_save_annotation;
3055 iface->remove_annotation = pdf_document_annotations_remove_annotation;
3056}
3057
3058/* Attachments */
3059struct SaveToBufferData {
3060 gchar *buffer;
3061 gsize len, max;
3062};
3063
3064static gboolean
3065attachment_save_to_buffer_callback (const gchar *buf,
3066 gsize count,
3067 gpointer user_data,
3068 GError **error G_GNUC_UNUSED__attribute__ ((__unused__)))
3069{
3070 struct SaveToBufferData *sdata = (SaveToBufferData *)user_data;
3071 gchar *new_buffer;
3072 gsize new_max;
3073
3074 if (sdata->len + count > sdata->max) {
3075 new_max = MAX (sdata->max * 2, sdata->len + count)(((sdata->max * 2) > (sdata->len + count)) ? (sdata->
max * 2) : (sdata->len + count))
;
3076 new_buffer = (gchar *)g_realloc (sdata->buffer, new_max);
3077
3078 sdata->buffer = new_buffer;
3079 sdata->max = new_max;
3080 }
3081
3082 memcpy (sdata->buffer + sdata->len, buf, count);
3083 sdata->len += count;
3084
3085 return TRUE(!(0));
3086}
3087
3088static gboolean
3089attachment_save_to_buffer (PopplerAttachment *attachment,
3090 gchar **buffer,
3091 gsize *buffer_size,
3092 GError **error)
3093{
3094 static const gint initial_max = 1024;
3095 struct SaveToBufferData sdata;
3096
3097 *buffer = NULL__null;
3098 *buffer_size = 0;
3099
3100 sdata.buffer = (gchar *) g_malloc (initial_max);
3101 sdata.max = initial_max;
3102 sdata.len = 0;
3103
3104 if (! poppler_attachment_save_to_callback (attachment,
3105 attachment_save_to_buffer_callback,
3106 &sdata,
3107 error)) {
3108 g_free (sdata.buffer);
3109 return FALSE(0);
3110 }
3111
3112 *buffer = sdata.buffer;
3113 *buffer_size = sdata.len;
3114
3115 return TRUE(!(0));
3116}
3117
3118static GList *
3119pdf_document_attachments_get_attachments (EvDocumentAttachments *document)
3120{
3121 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
3122 GList *attachments;
3123 GList *list;
3124 GList *retval = NULL__null;
3125
3126 attachments = poppler_document_get_attachments (pdf_document->document);
3127
3128 for (list = attachments; list; list = list->next) {
3129 PopplerAttachment *attachment;
3130 EvAttachment *ev_attachment;
3131 gchar *data = NULL__null;
3132 gsize size;
3133 GError *error = NULL__null;
3134
3135 attachment = (PopplerAttachment *) list->data;
3136
3137 if (attachment_save_to_buffer (attachment, &data, &size, &error)) {
3138 ev_attachment = ev_attachment_new (attachment->name,
3139 attachment->description,
3140 attachment->mtime,
3141 attachment->ctime,
3142 size, data);
3143
3144 retval = g_list_prepend (retval, ev_attachment);
3145 } else {
3146 if (error) {
3147 g_warning ("%s", error->message);
3148 g_error_free (error);
3149
3150 g_free (data);
3151 }
3152 }
3153
3154 g_object_unref (attachment);
3155 }
3156
3157 return g_list_reverse (retval);
3158}
3159
3160static gboolean
3161pdf_document_attachments_has_attachments (EvDocumentAttachments *document)
3162{
3163 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
3164
3165 return poppler_document_has_attachments (pdf_document->document);
3166}
3167
3168static void
3169pdf_document_document_attachments_iface_init (EvDocumentAttachmentsInterface *iface)
3170{
3171 iface->has_attachments = pdf_document_attachments_has_attachments;
3172 iface->get_attachments = pdf_document_attachments_get_attachments;
3173}
3174
3175/* Layers */
3176static gboolean
3177pdf_document_layers_has_layers (EvDocumentLayers *document)
3178{
3179 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
3180 PopplerLayersIter *iter;
3181
3182 iter = poppler_layers_iter_new (pdf_document->document);
3183 if (!iter)
3184 return FALSE(0);
3185 poppler_layers_iter_free (iter);
3186
3187 return TRUE(!(0));
3188}
3189
3190static void
3191build_layers_tree (PdfDocument *pdf_document,
3192 CtkTreeModel *model,
3193 CtkTreeIter *parent,
3194 PopplerLayersIter *iter)
3195{
3196 do {
3197 CtkTreeIter tree_iter;
3198 PopplerLayersIter *child;
3199 PopplerLayer *layer;
3200 EvLayer *ev_layer = NULL__null;
3201 gboolean visible;
3202 gchar *markup;
3203 gint rb_group = 0;
3204
3205 layer = poppler_layers_iter_get_layer (iter);
3206 if (layer) {
3207 markup = g_markup_escape_text (poppler_layer_get_title (layer), -1);
3208 visible = poppler_layer_is_visible (layer);
3209 rb_group = poppler_layer_get_radio_button_group_id (layer);
3210 ev_layer = ev_layer_new (poppler_layer_is_parent (layer),
3211 rb_group);
3212 g_object_set_data_full (G_OBJECT (ev_layer)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ev_layer)), (((GType) ((20) << (2))))))))
,
3213 "poppler-layer",
3214 g_object_ref (layer)((typename std::remove_reference<decltype (layer)>::type
) (g_object_ref) (layer))
,
3215 (GDestroyNotify) g_object_unref);
3216 } else {
3217 gchar *title;
3218
3219 title = poppler_layers_iter_get_title (iter);
3220 markup = g_markup_escape_text (title, -1);
3221 g_free (title);
3222
3223 visible = FALSE(0);
3224 layer = NULL__null;
3225 }
3226
3227 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);
3228 ctk_tree_store_set (CTK_TREE_STORE (model)((((CtkTreeStore*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((model)), ((ctk_tree_store_get_type ()))))))
, &tree_iter,
3229 EV_DOCUMENT_LAYERS_COLUMN_TITLE, markup,
3230 EV_DOCUMENT_LAYERS_COLUMN_VISIBLE, visible,
3231 EV_DOCUMENT_LAYERS_COLUMN_ENABLED, TRUE(!(0)), /* FIXME */
3232 EV_DOCUMENT_LAYERS_COLUMN_SHOWTOGGLE, (layer != NULL__null),
3233 EV_DOCUMENT_LAYERS_COLUMN_RBGROUP, rb_group,
3234 EV_DOCUMENT_LAYERS_COLUMN_LAYER, ev_layer,
3235 -1);
3236 if (ev_layer)
3237 g_object_unref (ev_layer);
3238 g_free (markup);
3239
3240 child = poppler_layers_iter_get_child (iter);
3241 if (child)
3242 build_layers_tree (pdf_document, model, &tree_iter, child);
3243 poppler_layers_iter_free (child);
3244 } while (poppler_layers_iter_next (iter));
3245}
3246
3247static CtkTreeModel *
3248pdf_document_layers_get_layers (EvDocumentLayers *document)
3249{
3250 CtkTreeModel *model = NULL__null;
3251 PdfDocument *pdf_document = PDF_DOCUMENT (document)((((PdfDocument*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((document)), ((pdf_document_get_type ()))))))
;
3252 PopplerLayersIter *iter;
3253
3254 iter = poppler_layers_iter_new (pdf_document->document);
3255 if (iter) {
3256 model = (CtkTreeModel *) ctk_tree_store_new (EV_DOCUMENT_LAYERS_N_COLUMNS,
3257 G_TYPE_STRING((GType) ((16) << (2))), /* TITLE */
3258 G_TYPE_OBJECT((GType) ((20) << (2))), /* LAYER */
3259 G_TYPE_BOOLEAN((GType) ((5) << (2))), /* VISIBLE */
3260 G_TYPE_BOOLEAN((GType) ((5) << (2))), /* ENABLED */
3261 G_TYPE_BOOLEAN((GType) ((5) << (2))), /* SHOWTOGGLE */
3262 G_TYPE_INT((GType) ((6) << (2)))); /* RBGROUP */
3263 build_layers_tree (pdf_document, model, NULL__null, iter);
3264 poppler_layers_iter_free (iter);
3265 }
3266 return model;
3267}
3268
3269static void
3270pdf_document_layers_show_layer (EvDocumentLayers *document G_GNUC_UNUSED__attribute__ ((__unused__)),
3271 EvLayer *layer)
3272{
3273 PopplerLayer *poppler_layer;
3274
3275 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()))))))
;
3276 poppler_layer_show (poppler_layer);
3277}
3278
3279static void
3280pdf_document_layers_hide_layer (EvDocumentLayers *document G_GNUC_UNUSED__attribute__ ((__unused__)),
3281 EvLayer *layer)
3282{
3283 PopplerLayer *poppler_layer;
3284
3285 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()))))))
;
3286 poppler_layer_hide (poppler_layer);
3287}
3288
3289static gboolean
3290pdf_document_layers_layer_is_visible (EvDocumentLayers *document G_GNUC_UNUSED__attribute__ ((__unused__)),
3291 EvLayer *layer)
3292{
3293 PopplerLayer *poppler_layer;
3294
3295 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()))))))
;
3296 return poppler_layer_is_visible (poppler_layer);
3297}
3298
3299static void
3300pdf_document_document_layers_iface_init (EvDocumentLayersInterface *iface)
3301{
3302 iface->has_layers = pdf_document_layers_has_layers;
3303 iface->get_layers = pdf_document_layers_get_layers;
3304 iface->show_layer = pdf_document_layers_show_layer;
3305 iface->hide_layer = pdf_document_layers_hide_layer;
3306 iface->layer_is_visible = pdf_document_layers_layer_is_visible;
3307}