Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'pdf')
-rw-r--r--pdf/fofi/Makefile.am4
-rw-r--r--pdf/goo/Makefile.am4
-rw-r--r--pdf/splash/Makefile.am4
-rw-r--r--pdf/xpdf/Makefile.am42
-rw-r--r--pdf/xpdf/pdf-document.c142
-rw-r--r--pdf/xpdf/pdf-document.h38
6 files changed, 213 insertions, 21 deletions
diff --git a/pdf/fofi/Makefile.am b/pdf/fofi/Makefile.am
index ad20a88..0c1887c 100644
--- a/pdf/fofi/Makefile.am
+++ b/pdf/fofi/Makefile.am
@@ -3,9 +3,9 @@ INCLUDES = \
-I$(top_srcdir)/pdf \
-I$(top_srcdir)/pdf/goo
-noinst_LIBRARIES = libfofi.a
+noinst_LTLIBRARIES = libfofi.la
-libfofi_a_SOURCES = \
+libfofi_la_SOURCES = \
FoFiBase.cc \
FoFiBase.h \
FoFiEncodings.cc \
diff --git a/pdf/goo/Makefile.am b/pdf/goo/Makefile.am
index 65502ab..793ee87 100644
--- a/pdf/goo/Makefile.am
+++ b/pdf/goo/Makefile.am
@@ -2,9 +2,9 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/pdf
-noinst_LIBRARIES = libGoo.a
+noinst_LTLIBRARIES = libGoo.la
-libGoo_a_SOURCES = \
+libGoo_la_SOURCES = \
GHash.cc \
GHash.h \
GList.cc \
diff --git a/pdf/splash/Makefile.am b/pdf/splash/Makefile.am
index 180a470..4a4ec28 100644
--- a/pdf/splash/Makefile.am
+++ b/pdf/splash/Makefile.am
@@ -5,9 +5,9 @@ INCLUDES = \
-I$(top_srcdir)/pdf/fofi \
$(FREETYPE_CFLAGS)
-noinst_LIBRARIES = libsplash.a
+noinst_LTLIBRARIES = libsplash.la
-libsplash_a_SOURCES = \
+libsplash_la_SOURCES = \
Splash.cc \
Splash.h \
SplashBitmap.cc \
diff --git a/pdf/xpdf/Makefile.am b/pdf/xpdf/Makefile.am
index 5d93140..2d2216c 100644
--- a/pdf/xpdf/Makefile.am
+++ b/pdf/xpdf/Makefile.am
@@ -1,5 +1,6 @@
INCLUDES = \
-I$(top_srcdir) \
+ -I$(top_srcdir)/backend \
-I$(top_srcdir)/pdf \
-I$(top_srcdir)/pdf/goo \
-I$(top_srcdir)/pdf/fofi \
@@ -9,9 +10,9 @@ INCLUDES = \
noinst_PROGRAMS = test-gdk-output-dev
-noinst_LIBRARIES = libxpdf.a
+noinst_LTLIBRARIES = libxpdf.la libpdfdocument.la
-libxpdf_a_SOURCES = \
+libxpdf_la_SOURCES = \
Annot.cc \
Annot.h \
Array.cc \
@@ -73,6 +74,8 @@ libxpdf_a_SOURCES = \
PDFDocEncoding.h \
PSTokenizer.cc \
PSTokenizer.h \
+ SplashOutputDev.cc \
+ SplashOutputDev.h \
Stream-CCITT.h \
Stream.cc \
Stream.h \
@@ -82,30 +85,39 @@ libxpdf_a_SOURCES = \
UnicodeTypeTable.cc \
UnicodeTypeTable.h \
XRef.cc \
- XRef.h
-
-common_sources = \
+ XRef.h \
+ \
CharTypes.h \
CompactFontTables.h \
ErrorCodes.h \
NameToUnicodeTable.h \
+ GDKSplashOutputDev.cc \
+ GDKSplashOutputDev.h \
TextOutputDev.cc \
TextOutputDev.h \
UTF8.h
+# The sources at the end are put in libxpdf.a for convenience here, but are
+# conceptually part of the apps not part of the libs.
+
test_gdk_output_dev_SOURCES = \
- GDKSplashOutputDev.cc \
- GDKSplashOutputDev.h \
- SplashOutputDev.cc \
- SplashOutputDev.h \
- $(common_sources) \
test-gdk-output-dev.cc
-test_gdk_output_dev_LDADD = \
- libxpdf.a \
- $(top_builddir)/pdf/goo/libGoo.a \
- $(top_builddir)/pdf/fofi/libfofi.a \
- $(top_builddir)/pdf/splash/libsplash.a \
+test_gdk_output_dev_LDADD = \
+ libxpdf.la \
+ $(top_builddir)/pdf/goo/libGoo.la \
+ $(top_builddir)/pdf/fofi/libfofi.la \
+ $(top_builddir)/pdf/splash/libsplash.la \
$(GTK_LIBS)
+libpdfdocument_la_SOURCES = \
+ pdf-document.c \
+ pdf-document.h
+
+libpdfdocument_la_LIBADD = \
+ libxpdf.la \
+ $(top_builddir)/pdf/goo/libGoo.la \
+ $(top_builddir)/pdf/fofi/libfofi.la \
+ $(top_builddir)/pdf/splash/libsplash.la
+
EXTRA_DIST = config.h
diff --git a/pdf/xpdf/pdf-document.c b/pdf/xpdf/pdf-document.c
new file mode 100644
index 0000000..81ad89c
--- /dev/null
+++ b/pdf/xpdf/pdf-document.c
@@ -0,0 +1,142 @@
+/* pdfdocument.h: Implementation of EvDocument for PDF
+ * Copyright (C) 2004, Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "pdf-document.h"
+
+typedef struct _PdfDocumentClass PdfDocumentClass;
+
+#define PDF_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDF_TYPE_DOCUMENT, PdfDocumentClass))
+#define PDF_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDF_TYPE_DOCUMENT))
+#define PDF_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDF_TYPE_DOCUMENT, PdfDocumentClass))
+
+struct _PdfDocumentClass
+{
+ GObjectClass parent_class;
+};
+
+struct _PdfDocument
+{
+ GObject parent_instance;
+
+ GdkRectangle page_rect;
+ GdkDrawable *target;
+
+};
+
+static void pdf_document_document_iface_init (EvDocumentIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (PdfDocument, pdf_document, G_TYPE_OBJECT,
+ { G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT,
+ pdf_document_document_iface_init) });
+
+
+static gboolean
+pdf_document_load (EvDocument *document,
+ const char *uri,
+ GError **error)
+{
+ return TRUE;
+}
+
+static int
+pdf_document_get_n_pages (EvDocument *document)
+{
+ return 1;
+}
+
+static void
+pdf_document_set_page (EvDocument *document,
+ int page)
+{
+}
+
+static void
+pdf_document_set_target (EvDocument *document,
+ GdkDrawable *target)
+{
+ PdfDocument *pdf_document = PDF_DOCUMENT (document);
+
+ if (pdf_document->target != target) {
+ if (pdf_document->target)
+ g_object_unref (pdf_document->target);
+
+ pdf_document->target = target;
+
+ if (pdf_document->target)
+ g_object_ref (pdf_document->target);
+ }
+}
+
+static void
+pdf_document_set_page_rect (EvDocument *document,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+ PdfDocument *pdf_document = PDF_DOCUMENT (document);
+
+ pdf_document->page_rect.x = x;
+ pdf_document->page_rect.y = y;
+ pdf_document->page_rect.width = width;
+ pdf_document->page_rect.height = height;
+}
+
+static void
+pdf_document_render (EvDocument *document,
+ int clip_x,
+ int clip_y,
+ int clip_width,
+ int clip_height)
+{
+}
+
+static void
+pdf_document_finalize (GObject *object)
+{
+ PdfDocument *pdf_document = PDF_DOCUMENT (object);
+
+ if (pdf_document->target)
+ g_object_unref (pdf_document->target);
+
+}
+
+static void
+pdf_document_class_init (PdfDocumentClass *class)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+
+ gobject_class->finalize = pdf_document_finalize;
+}
+
+static void
+pdf_document_document_iface_init (EvDocumentIface *iface)
+{
+ iface->load = pdf_document_load;
+ iface->get_n_pages = pdf_document_get_n_pages;
+ iface->set_page = pdf_document_set_page;
+ iface->set_target = pdf_document_set_target;
+ iface->set_page_rect = pdf_document_set_page_rect;
+ iface->render = pdf_document_render;
+}
+
+static void
+pdf_document_init (PdfDocument *document)
+{
+}
+
diff --git a/pdf/xpdf/pdf-document.h b/pdf/xpdf/pdf-document.h
new file mode 100644
index 0000000..5b119b4
--- /dev/null
+++ b/pdf/xpdf/pdf-document.h
@@ -0,0 +1,38 @@
+/* pdfdocument.h: Implementation of EvDocument for PDF
+ * Copyright (C) 2004, Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __PDF_DOCUMENT_H__
+#define __PDF_DOCUMENT_H__
+
+#include "ev-document.h"
+
+G_BEGIN_DECLS
+
+#define PDF_TYPE_DOCUMENT (pdf_document_get_type ())
+#define PDF_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDF_TYPE_DOCUMENT, PdfDocument))
+#define PDF_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDF_TYPE_DOCUMENT))
+
+typedef struct _PdfDocument PdfDocument;
+
+PdfDocument *pdf_document_new (void);
+
+GType pdf_document_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __PDF_DOCUMENT_H__ */