summaryrefslogtreecommitdiff
path: root/Build/source/libs/poppler/poppler-0.12.4/test
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/poppler/poppler-0.12.4/test')
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/CMakeLists.txt52
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/Makefile.am97
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/Makefile.in682
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/gtk-cairo-test.cc190
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/gtk-splash-test.cc309
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/pdf-fullrewrite.cc46
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/pdf-inspector.cc373
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/pdf-inspector.ui416
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/pdf-operators.c81
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/perf-test-preview-dummy.cc22
-rw-r--r--Build/source/libs/poppler/poppler-0.12.4/test/perf-test.cc1277
11 files changed, 0 insertions, 3545 deletions
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/CMakeLists.txt b/Build/source/libs/poppler/poppler-0.12.4/test/CMakeLists.txt
deleted file mode 100644
index 478cb31a58f..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-
-if (ENABLE_SPLASH)
-
- set (perf_test_SRCS
- perf-test.cc
- perf-test-preview-dummy.cc
- )
- add_executable(perf-test ${perf_test_SRCS})
- target_link_libraries(perf-test poppler)
-
-endif (ENABLE_SPLASH)
-
-if (GTK_FOUND)
-
- add_definitions(${GTK2_CFLAGS})
-
- include_directories(
- ${CMAKE_SOURCE_DIR}/glib
- ${CMAKE_BINARY_DIR}/glib
- )
-
- set (gtk_splash_test_SRCS
- gtk-splash-test.cc
- )
- poppler_add_test(gtk-splash-test BUILD_GTK_TESTS ${gtk_splash_test_SRCS})
- target_link_libraries(gtk-splash-test poppler ${GTK2_LIBRARIES})
-
- if (HAVE_CAIRO)
-
- set (gtk_cairo_test_SRCS
- gtk-cairo-test.cc
- )
- poppler_add_test(gtk-cairo-test BUILD_GTK_TESTS ${gtk_cairo_test_SRCS})
- target_link_libraries(gtk-cairo-test poppler-glib ${GTK2_LIBRARIES})
-
- set (pdf_inspector_SRCS
- pdf-inspector.cc
- )
- poppler_add_test(pdf-inspector BUILD_GTK_TESTS ${pdf_inspector_SRCS})
- target_link_libraries(pdf-inspector poppler-glib ${GTK2_LIBRARIES})
-
- endif (HAVE_CAIRO)
-
-endif (GTK_FOUND)
-
-set (pdf_fullrewrite_SRCS
- pdf-fullrewrite.cc
-)
-add_executable(pdf-fullrewrite ${pdf_fullrewrite_SRCS})
-target_link_libraries(pdf-fullrewrite poppler)
-
-
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/Makefile.am b/Build/source/libs/poppler/poppler-0.12.4/test/Makefile.am
deleted file mode 100644
index 38bf72dc9d6..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/Makefile.am
+++ /dev/null
@@ -1,97 +0,0 @@
-if BUILD_GTK_TEST
-
-if BUILD_SPLASH_OUTPUT
-
-gtk_splash_test = \
- gtk-splash-test
-
-splash_includes = \
- -I$(top_srcdir)/splash
-
-endif
-
-if BUILD_CAIRO_OUTPUT
-
-gtk_cairo_test = \
- gtk-cairo-test
-
-pdf_inspector = \
- pdf_inspector
-
-cairo_includes = \
- $(CAIRO_CFLAGS) \
- $(FREETYPE_CFLAGS)
-
-endif
-
-endif
-
-if BUILD_SPLASH_OUTPUT
-
-perf_test = \
- perf-test
-
-endif
-
-pdf_fullrewrite = \
- pdf-fullrewrite
-
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/poppler \
- -I$(top_srcdir)/glib \
- -I$(top_builddir)/glib \
- $(cairo_includes) \
- $(GTK_TEST_CFLAGS) \
- $(FONTCONFIG_CFLAGS)
-
-noinst_PROGRAMS = $(gtk_splash_test) $(gtk_cairo_test) $(pdf_inspector) $(perf_test) $(pdf_fullrewrite)
-
-AM_LDFLAGS = @auto_import_flags@
-
-gtk_splash_test_SOURCES = \
- gtk-splash-test.cc
-
-gtk_splash_test_LDADD = \
- $(top_builddir)/poppler/libpoppler.la \
- $(GTK_TEST_LIBS)
-
-gtk_cairo_test_SOURCES = \
- gtk-cairo-test.cc
-
-gtk_cairo_test_LDADD = \
- $(top_builddir)/poppler/libpoppler.la \
- $(top_builddir)/glib/libpoppler-glib.la \
- $(CAIRO_LIBS) \
- $(GTK_TEST_LIBS) \
- $(FONTCONFIG_LIBS)
-
-pdf_inspector_SOURCES = \
- pdf-inspector.cc
-
-pdf_inspector_LDADD = \
- $(top_builddir)/poppler/libpoppler-cairo.la \
- $(top_builddir)/poppler/libpoppler.la \
- $(CAIRO_LIBS) \
- $(FREETYPE_LIBS) \
- $(GTK_TEST_LIBS) \
- $(X_EXTRA_LIBS)
-
-perf_test_SOURCES = \
- perf-test.cc \
- perf-test-preview-dummy.cc
-
-perf_test_LDADD = \
- $(top_builddir)/poppler/libpoppler.la \
- $(FREETYPE_LIBS) \
- $(X_EXTRA_LIBS)
-
-pdf_fullrewrite_SOURCES = \
- pdf-fullrewrite.cc
-
-pdf_fullrewrite_LDADD = \
- $(top_builddir)/poppler/libpoppler.la
-
-EXTRA_DIST = \
- pdf-operators.c \
- pdf-inspector.ui
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/Makefile.in b/Build/source/libs/poppler/poppler-0.12.4/test/Makefile.in
deleted file mode 100644
index e0437e3be9f..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/Makefile.in
+++ /dev/null
@@ -1,682 +0,0 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
- $(am__EXEEXT_4) $(am__EXEEXT_5)
-subdir = test
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
- $(top_srcdir)/m4/define-dir.m4 $(top_srcdir)/m4/gtk-doc.m4 \
- $(top_srcdir)/m4/libjpeg.m4 $(top_srcdir)/m4/libpng.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/qt.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h \
- $(top_builddir)/poppler/poppler-config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-@BUILD_GTK_TEST_TRUE@@BUILD_SPLASH_OUTPUT_TRUE@am__EXEEXT_1 = gtk-splash-test$(EXEEXT)
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@am__EXEEXT_2 = gtk-cairo-test$(EXEEXT)
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@am__EXEEXT_3 = pdf_inspector$(EXEEXT)
-@BUILD_SPLASH_OUTPUT_TRUE@am__EXEEXT_4 = perf-test$(EXEEXT)
-am__EXEEXT_5 = pdf-fullrewrite$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-am_gtk_cairo_test_OBJECTS = gtk-cairo-test.$(OBJEXT)
-gtk_cairo_test_OBJECTS = $(am_gtk_cairo_test_OBJECTS)
-am__DEPENDENCIES_1 =
-gtk_cairo_test_DEPENDENCIES = $(top_builddir)/poppler/libpoppler.la \
- $(top_builddir)/glib/libpoppler-glib.la $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
-am__v_lt_0 = --silent
-am_gtk_splash_test_OBJECTS = gtk-splash-test.$(OBJEXT)
-gtk_splash_test_OBJECTS = $(am_gtk_splash_test_OBJECTS)
-gtk_splash_test_DEPENDENCIES = $(top_builddir)/poppler/libpoppler.la \
- $(am__DEPENDENCIES_1)
-am_pdf_fullrewrite_OBJECTS = pdf-fullrewrite.$(OBJEXT)
-pdf_fullrewrite_OBJECTS = $(am_pdf_fullrewrite_OBJECTS)
-pdf_fullrewrite_DEPENDENCIES = $(top_builddir)/poppler/libpoppler.la
-am_pdf_inspector_OBJECTS = pdf-inspector.$(OBJEXT)
-pdf_inspector_OBJECTS = $(am_pdf_inspector_OBJECTS)
-pdf_inspector_DEPENDENCIES = \
- $(top_builddir)/poppler/libpoppler-cairo.la \
- $(top_builddir)/poppler/libpoppler.la $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am_perf_test_OBJECTS = perf-test.$(OBJEXT) \
- perf-test-preview-dummy.$(OBJEXT)
-perf_test_OBJECTS = $(am_perf_test_OBJECTS)
-perf_test_DEPENDENCIES = $(top_builddir)/poppler/libpoppler.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/poppler
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_$(V))
-am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY))
-am__v_CXX_0 = @echo " CXX " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_$(V))
-am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(gtk_cairo_test_SOURCES) $(gtk_splash_test_SOURCES) \
- $(pdf_fullrewrite_SOURCES) $(pdf_inspector_SOURCES) \
- $(perf_test_SOURCES)
-DIST_SOURCES = $(gtk_cairo_test_SOURCES) $(gtk_splash_test_SOURCES) \
- $(pdf_fullrewrite_SOURCES) $(pdf_inspector_SOURCES) \
- $(perf_test_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABIWORD_CFLAGS = @ABIWORD_CFLAGS@
-ABIWORD_LIBS = @ABIWORD_LIBS@
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CAIRO_CFLAGS = @CAIRO_CFLAGS@
-CAIRO_FEATURE = @CAIRO_FEATURE@
-CAIRO_LIBS = @CAIRO_LIBS@
-CAIRO_REQ = @CAIRO_REQ@
-CAIRO_VERSION = @CAIRO_VERSION@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
-FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
-FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
-FREETYPE_CONFIG = @FREETYPE_CONFIG@
-FREETYPE_LIBS = @FREETYPE_LIBS@
-GDK_CFLAGS = @GDK_CFLAGS@
-GDK_FEATURE = @GDK_FEATURE@
-GDK_LIBS = @GDK_LIBS@
-GLIB_MKENUMS = @GLIB_MKENUMS@
-GREP = @GREP@
-GTKDOC_CHECK = @GTKDOC_CHECK@
-GTK_TEST_CFLAGS = @GTK_TEST_CFLAGS@
-GTK_TEST_LIBS = @GTK_TEST_LIBS@
-HTML_DIR = @HTML_DIR@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LCMS_CFLAGS = @LCMS_CFLAGS@
-LCMS_LIBS = @LCMS_LIBS@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBJPEG_LIBS = @LIBJPEG_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBOPENJPEG_LIBS = @LIBOPENJPEG_LIBS@
-LIBPNG_LIBS = @LIBPNG_LIBS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-MOCQT4 = @MOCQT4@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PC_REQUIRES = @PC_REQUIRES@
-PC_REQUIRES_PRIVATE = @PC_REQUIRES_PRIVATE@
-PKG_CONFIG = @PKG_CONFIG@
-POPPLER_DATADIR = @POPPLER_DATADIR@
-POPPLER_GLIB_CFLAGS = @POPPLER_GLIB_CFLAGS@
-POPPLER_GLIB_DISABLE_DEPRECATED = @POPPLER_GLIB_DISABLE_DEPRECATED@
-POPPLER_GLIB_DISABLE_SINGLE_INCLUDES = @POPPLER_GLIB_DISABLE_SINGLE_INCLUDES@
-POPPLER_GLIB_LIBS = @POPPLER_GLIB_LIBS@
-POPPLER_MAJOR_VERSION = @POPPLER_MAJOR_VERSION@
-POPPLER_MICRO_VERSION = @POPPLER_MICRO_VERSION@
-POPPLER_MINOR_VERSION = @POPPLER_MINOR_VERSION@
-POPPLER_QT4_CFLAGS = @POPPLER_QT4_CFLAGS@
-POPPLER_QT4_CXXFLAGS = @POPPLER_QT4_CXXFLAGS@
-POPPLER_QT4_LIBS = @POPPLER_QT4_LIBS@
-POPPLER_QT4_TEST_CFLAGS = @POPPLER_QT4_TEST_CFLAGS@
-POPPLER_QT4_TEST_LIBS = @POPPLER_QT4_TEST_LIBS@
-POPPLER_QT_CXXFLAGS = @POPPLER_QT_CXXFLAGS@
-POPPLER_QT_LIBS = @POPPLER_QT_LIBS@
-PTHREAD_CC = @PTHREAD_CC@
-PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
-PTHREAD_LIBS = @PTHREAD_LIBS@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XMKMF = @XMKMF@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-ZLIB_LIBS = @ZLIB_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-auto_import_flags = @auto_import_flags@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-create_shared_lib = @create_shared_lib@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-win32_libs = @win32_libs@
-@BUILD_GTK_TEST_TRUE@@BUILD_SPLASH_OUTPUT_TRUE@gtk_splash_test = \
-@BUILD_GTK_TEST_TRUE@@BUILD_SPLASH_OUTPUT_TRUE@ gtk-splash-test
-
-@BUILD_GTK_TEST_TRUE@@BUILD_SPLASH_OUTPUT_TRUE@splash_includes = \
-@BUILD_GTK_TEST_TRUE@@BUILD_SPLASH_OUTPUT_TRUE@ -I$(top_srcdir)/splash
-
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@gtk_cairo_test = \
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@ gtk-cairo-test
-
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@pdf_inspector = \
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@ pdf_inspector
-
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@cairo_includes = \
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@ $(CAIRO_CFLAGS) \
-@BUILD_CAIRO_OUTPUT_TRUE@@BUILD_GTK_TEST_TRUE@ $(FREETYPE_CFLAGS)
-
-@BUILD_SPLASH_OUTPUT_TRUE@perf_test = \
-@BUILD_SPLASH_OUTPUT_TRUE@ perf-test
-
-pdf_fullrewrite = \
- pdf-fullrewrite
-
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/poppler \
- -I$(top_srcdir)/glib \
- -I$(top_builddir)/glib \
- $(cairo_includes) \
- $(GTK_TEST_CFLAGS) \
- $(FONTCONFIG_CFLAGS)
-
-AM_LDFLAGS = @auto_import_flags@
-gtk_splash_test_SOURCES = \
- gtk-splash-test.cc
-
-gtk_splash_test_LDADD = \
- $(top_builddir)/poppler/libpoppler.la \
- $(GTK_TEST_LIBS)
-
-gtk_cairo_test_SOURCES = \
- gtk-cairo-test.cc
-
-gtk_cairo_test_LDADD = \
- $(top_builddir)/poppler/libpoppler.la \
- $(top_builddir)/glib/libpoppler-glib.la \
- $(CAIRO_LIBS) \
- $(GTK_TEST_LIBS) \
- $(FONTCONFIG_LIBS)
-
-pdf_inspector_SOURCES = \
- pdf-inspector.cc
-
-pdf_inspector_LDADD = \
- $(top_builddir)/poppler/libpoppler-cairo.la \
- $(top_builddir)/poppler/libpoppler.la \
- $(CAIRO_LIBS) \
- $(FREETYPE_LIBS) \
- $(GTK_TEST_LIBS) \
- $(X_EXTRA_LIBS)
-
-perf_test_SOURCES = \
- perf-test.cc \
- perf-test-preview-dummy.cc
-
-perf_test_LDADD = \
- $(top_builddir)/poppler/libpoppler.la \
- $(FREETYPE_LIBS) \
- $(X_EXTRA_LIBS)
-
-pdf_fullrewrite_SOURCES = \
- pdf-fullrewrite.cc
-
-pdf_fullrewrite_LDADD = \
- $(top_builddir)/poppler/libpoppler.la
-
-EXTRA_DIST = \
- pdf-operators.c \
- pdf-inspector.ui
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cc .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign test/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-gtk-cairo-test$(EXEEXT): $(gtk_cairo_test_OBJECTS) $(gtk_cairo_test_DEPENDENCIES)
- @rm -f gtk-cairo-test$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(gtk_cairo_test_OBJECTS) $(gtk_cairo_test_LDADD) $(LIBS)
-gtk-splash-test$(EXEEXT): $(gtk_splash_test_OBJECTS) $(gtk_splash_test_DEPENDENCIES)
- @rm -f gtk-splash-test$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(gtk_splash_test_OBJECTS) $(gtk_splash_test_LDADD) $(LIBS)
-pdf-fullrewrite$(EXEEXT): $(pdf_fullrewrite_OBJECTS) $(pdf_fullrewrite_DEPENDENCIES)
- @rm -f pdf-fullrewrite$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(pdf_fullrewrite_OBJECTS) $(pdf_fullrewrite_LDADD) $(LIBS)
-pdf_inspector$(EXEEXT): $(pdf_inspector_OBJECTS) $(pdf_inspector_DEPENDENCIES)
- @rm -f pdf_inspector$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(pdf_inspector_OBJECTS) $(pdf_inspector_LDADD) $(LIBS)
-perf-test$(EXEEXT): $(perf_test_OBJECTS) $(perf_test_DEPENDENCIES)
- @rm -f perf-test$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(perf_test_OBJECTS) $(perf_test_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtk-cairo-test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtk-splash-test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdf-fullrewrite.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdf-inspector.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf-test-preview-dummy.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf-test.Po@am__quote@
-
-.cc.o:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
-
-.cc.obj:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cc.lo:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstPROGRAMS ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/gtk-cairo-test.cc b/Build/source/libs/poppler/poppler-0.12.4/test/gtk-cairo-test.cc
deleted file mode 100644
index 8c405685027..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/gtk-cairo-test.cc
+++ /dev/null
@@ -1,190 +0,0 @@
-//========================================================================
-//
-// GDKSplashOutputDev.cc
-//
-// Copyright 2003 Glyph & Cog, LLC
-// Copyright 2004 Red Hat, Inc. (GDK port)
-//
-//========================================================================
-
-#include <config.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <math.h>
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-#include <poppler.h>
-
-typedef struct
-{
- GtkWidget *window;
- GtkWidget *sw;
- GtkWidget *drawing_area;
- GtkWidget *spin_button;
- PopplerPage *page;
- PopplerDocument *document;
- cairo_surface_t *surface;
- int *window_count;
-} View;
-
-static void
-drawing_area_expose (GtkWidget *drawing_area,
- GdkEventExpose *event,
- void *data)
-{
- View *v = (View*) data;
- cairo_t *cr;
-
- gdk_window_clear (drawing_area->window);
- cr = gdk_cairo_create (drawing_area->window);
-
- cairo_set_source_surface (cr, v->surface, 0, 0);
- cairo_paint (cr);
- cairo_destroy (cr);
-}
-
-static void
-view_set_page (View *v, int page)
-{
- int w, h;
- double width, height;
- cairo_t *cr;
-
- v->page = poppler_document_get_page (v->document, page);
- poppler_page_get_size (v->page, &width, &height);
- w = (int) ceil(width);
- h = (int) ceil(height);
- cairo_surface_destroy (v->surface);
- v->surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
- cr = cairo_create (v->surface);
- poppler_page_render (v->page, cr);
- cairo_destroy (cr);
- gtk_widget_set_size_request (v->drawing_area, w, h);
- gtk_widget_queue_draw (v->drawing_area);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (v->spin_button), page);
-}
-
-static void
-page_changed_callback (GtkSpinButton *button, View *v)
-{
- int page;
-
- page = gtk_spin_button_get_value_as_int (button);
- view_set_page (v, page);
-}
-
-static void
-destroy_window_callback (GtkWindow *window, View *v)
-{
- if (--(*v->window_count) == 0)
- gtk_main_quit();
-}
-
-static View*
-view_new (const char *filename, int *window_count)
-{
- View *v;
- GtkWidget *window;
- GtkWidget *drawing_area;
- GtkWidget *sw;
- GtkWidget *vbox, *hbox;
- GtkWidget *spin_button;
- int n_pages;
-
- v = g_new0 (View, 1);
-
- v->document = poppler_document_new_from_file (filename, NULL, NULL);
- if (v->document == NULL)
- return NULL;
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- vbox = gtk_vbox_new(FALSE, 5);
-
- gtk_container_add (GTK_CONTAINER (window), vbox);
- drawing_area = gtk_drawing_area_new ();
-
- sw = gtk_scrolled_window_new (NULL, NULL);
-
- gtk_box_pack_end (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw),
- drawing_area);
-
- n_pages = poppler_document_get_n_pages (v->document);
- spin_button = gtk_spin_button_new_with_range (0, n_pages - 1, 1);
- g_signal_connect (G_OBJECT (spin_button), "value-changed",
- G_CALLBACK (page_changed_callback), v);
- hbox = gtk_hbox_new (FALSE, 5);
- gtk_box_pack_end (GTK_BOX (hbox), spin_button, FALSE, TRUE, 0);
-
- gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
-
- gtk_widget_show_all (window);
- gtk_widget_realize (window);
-
- v->window = window;
- v->drawing_area = drawing_area;
- v->sw = sw;
- v->window_count = window_count;
- v->spin_button = spin_button;
-
- g_signal_connect (drawing_area,
- "expose_event",
- G_CALLBACK (drawing_area_expose),
- (void*) v);
-
- g_signal_connect (window,
- "destroy",
- G_CALLBACK (destroy_window_callback),
- (void*) v);
-
- return v;
-}
-
-static int option_page = 0;
-static GOptionEntry demo_options[] = {
- { "page", 0, 0, G_OPTION_ARG_INT, &option_page, "Page number", "PAGE" },
- { NULL }
-};
-
-int
-main (int argc, char *argv [])
-{
- View *v;
- int i, window_count;
- GOptionContext *ctx;
-
- ctx = g_option_context_new("FILENAME ...");
- g_option_context_add_main_entries(ctx, demo_options, "main");
- g_option_context_parse(ctx, &argc, &argv, NULL);
- g_option_context_free(ctx);
-
- gtk_init (&argc, &argv);
-
- if (argc == 1)
- {
- char *basename = g_path_get_basename (argv[0]);
- fprintf (stderr, "usage: %s PDF-FILES...\n", basename);
- g_free (basename);
- return -1;
- }
-
- window_count = 0;
- for (i = 1; i < argc; i++) {
- v = view_new (argv[i], &window_count);
- if (v == NULL) {
- g_printerr ("Error loading %s\n", argv[i]);
- continue;
- }
-
- view_set_page (v, option_page);
- window_count++;
- }
-
- if (window_count > 0)
- gtk_main ();
-
- return 0;
-}
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/gtk-splash-test.cc b/Build/source/libs/poppler/poppler-0.12.4/test/gtk-splash-test.cc
deleted file mode 100644
index d5a41d308d5..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/gtk-splash-test.cc
+++ /dev/null
@@ -1,309 +0,0 @@
-//========================================================================
-//
-// GDKSplashOutputDev.cc
-//
-// Copyright 2003 Glyph & Cog, LLC
-// Copyright 2004 Red Hat, Inc. (GDK port)
-//
-//========================================================================
-
-#include <config.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <goo/gmem.h>
-#include <splash/SplashTypes.h>
-#include <splash/SplashBitmap.h>
-#include "Object.h"
-#include "SplashOutputDev.h"
-#include "GfxState.h"
-
-#include <gdk/gdk.h>
-
-#include "PDFDoc.h"
-#include "GlobalParams.h"
-#include "ErrorCodes.h"
-#include <gtk/gtk.h>
-
-//------------------------------------------------------------------------
-
-#define xOutMaxRGBCube 6 // max size of RGB color cube
-
-//------------------------------------------------------------------------
-// GDKSplashOutputDev
-//------------------------------------------------------------------------
-
-class GDKSplashOutputDev: public SplashOutputDev {
-public:
-
- GDKSplashOutputDev(GdkScreen *screen,
- void (*redrawCbkA)(void *data),
- void *redrawCbkDataA, SplashColor sc);
-
- virtual ~GDKSplashOutputDev();
-
- //----- initialization and control
-
- // End a page.
- virtual void endPage();
-
- // Dump page contents to display.
- virtual void dump();
-
- //----- update text state
- virtual void updateFont(GfxState *state);
-
- //----- special access
-
- // Clear out the document (used when displaying an empty window).
- void clear();
-
- // Copy the rectangle (srcX, srcY, width, height) to (destX, destY)
- // in destDC.
- void redraw(int srcX, int srcY,
- GdkDrawable *drawable,
- int destX, int destY,
- int width, int height);
-
-private:
-
- int incrementalUpdate;
- void (*redrawCbk)(void *data);
- void *redrawCbkData;
-};
-
-//------------------------------------------------------------------------
-// Constants and macros
-//------------------------------------------------------------------------
-
-#define xoutRound(x) ((int)(x + 0.5))
-
-//------------------------------------------------------------------------
-// GDKSplashOutputDev
-//------------------------------------------------------------------------
-
-GDKSplashOutputDev::GDKSplashOutputDev(GdkScreen *screen,
- void (*redrawCbkA)(void *data),
- void *redrawCbkDataA, SplashColor sc):
- SplashOutputDev(splashModeRGB8, 4, gFalse, sc),
- incrementalUpdate (1)
-{
- redrawCbk = redrawCbkA;
- redrawCbkData = redrawCbkDataA;
-}
-
-GDKSplashOutputDev::~GDKSplashOutputDev() {
-}
-
-void GDKSplashOutputDev::clear() {
- startDoc(NULL);
- startPage(0, NULL);
-}
-
-void GDKSplashOutputDev::endPage() {
- SplashOutputDev::endPage();
- if (!incrementalUpdate) {
- (*redrawCbk)(redrawCbkData);
- }
-}
-
-void GDKSplashOutputDev::dump() {
- if (incrementalUpdate && redrawCbk) {
- (*redrawCbk)(redrawCbkData);
- }
-}
-
-void GDKSplashOutputDev::updateFont(GfxState *state) {
- SplashOutputDev::updateFont(state);
-}
-
-void GDKSplashOutputDev::redraw(int srcX, int srcY,
- GdkDrawable *drawable,
- int destX, int destY,
- int width, int height) {
- GdkGC *gc;
- int gdk_rowstride;
-
- gdk_rowstride = getBitmap()->getRowSize();
- gc = gdk_gc_new (drawable);
-
- gdk_draw_rgb_image (drawable, gc,
- destX, destY,
- width, height,
- GDK_RGB_DITHER_NORMAL,
- getBitmap()->getDataPtr() + srcY * gdk_rowstride + srcX * 3,
- gdk_rowstride);
-
- g_object_unref (gc);
-}
-
-
-typedef struct
-{
- GtkWidget *window;
- GtkWidget *sw;
- GtkWidget *drawing_area;
- GDKSplashOutputDev *out;
- PDFDoc *doc;
-} View;
-
-static void
-drawing_area_expose (GtkWidget *drawing_area,
- GdkEventExpose *event,
- void *data)
-{
- View *v = (View*) data;
- GdkRectangle document;
- GdkRectangle draw;
-
- gdk_window_clear (drawing_area->window);
-
- document.x = 0;
- document.y = 0;
- document.width = v->out->getBitmapWidth();
- document.height = v->out->getBitmapHeight();
-
- if (gdk_rectangle_intersect (&document, &event->area, &draw))
- {
- v->out->redraw (draw.x, draw.y,
- drawing_area->window,
- draw.x, draw.y,
- draw.width, draw.height);
- }
-}
-
-static int
-view_load (View *v,
- const char *filename)
-{
- PDFDoc *newDoc;
- int err;
- GooString *filename_g;
- int w, h;
-
- filename_g = new GooString (filename);
-
- // open the PDF file
- newDoc = new PDFDoc(filename_g, 0, 0);
-
- delete filename_g;
-
- if (!newDoc->isOk())
- {
- err = newDoc->getErrorCode();
- delete newDoc;
- return err;
- }
-
- if (v->doc)
- delete v->doc;
- v->doc = newDoc;
-
- v->out->startDoc(v->doc->getXRef());
-
- v->doc->displayPage (v->out, 1, 72, 72, 0, gFalse, gTrue, gTrue);
-
- w = v->out->getBitmapWidth();
- h = v->out->getBitmapHeight();
-
- gtk_widget_set_size_request (v->drawing_area, w, h);
-
- return errNone;
-}
-
-static void
-view_show (View *v)
-{
- gtk_widget_show (v->window);
-}
-
-static void
-redraw_callback (void *data)
-{
- View *v = (View*) data;
-
- gtk_widget_queue_draw (v->drawing_area);
-}
-
-static View*
-view_new (void)
-{
- View *v;
- GtkWidget *window;
- GtkWidget *drawing_area;
- GtkWidget *sw;
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- drawing_area = gtk_drawing_area_new ();
-
- sw = gtk_scrolled_window_new (NULL, NULL);
-
- gtk_container_add (GTK_CONTAINER (window), sw);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), drawing_area);
-
- gtk_widget_show_all (sw);
-
- v = g_new0 (View, 1);
-
- v->window = window;
- v->drawing_area = drawing_area;
- v->sw = sw;
- SplashColor sc;
- sc[0] = 255;
- sc[1] = 255;
- sc[2] = 255;
- v->out = new GDKSplashOutputDev (gtk_widget_get_screen (window),
- redraw_callback, (void*) v, sc);
- v->doc = 0;
-
- g_signal_connect (drawing_area,
- "expose_event",
- G_CALLBACK (drawing_area_expose),
- (void*) v);
-
- return v;
-}
-
-int
-main (int argc, char *argv [])
-{
- View *v;
- int i;
-
- gtk_init (&argc, &argv);
-
- globalParams = new GlobalParams();
-
- if (argc == 1)
- {
- fprintf (stderr, "usage: %s PDF-FILES...\n", argv[0]);
- return -1;
- }
-
-
- i = 1;
- while (i < argc)
- {
- int err;
-
- v = view_new ();
-
- err = view_load (v, argv[i]);
-
- if (err != errNone)
- g_printerr ("Error loading document!\n");
-
- view_show (v);
-
- ++i;
- }
-
- gtk_main ();
-
- delete globalParams;
-
- return 0;
-}
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/pdf-fullrewrite.cc b/Build/source/libs/poppler/poppler-0.12.4/test/pdf-fullrewrite.cc
deleted file mode 100644
index 9658e55a6dc..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/pdf-fullrewrite.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-//========================================================================
-//
-// pdf-fullrewrite.cc
-//
-// Copyright 2007 Julien Rebetez
-//
-//========================================================================
-#include "config.h"
-#include <poppler-config.h>
-#include "GlobalParams.h"
-#include "Error.h"
-#include "PDFDoc.h"
-#include "goo/GooString.h"
-
-int main (int argc, char *argv[])
-{
- PDFDoc *doc;
- GooString *inputName, *outputName;
-
- // parse args
- if (argc < 3) {
- fprintf(stderr, "usage: %s INPUT-FILE OUTPUT-FILE\n", argv[0]);
- return 1;
- }
-
- inputName = new GooString(argv[1]);
- outputName = new GooString(argv[2]);
-
- globalParams = new GlobalParams();
-
- doc = new PDFDoc(inputName);
-
- if (!doc->isOk()) {
- delete doc;
- fprintf(stderr, "Error loading document !\n");
- return 1;
- }
-
-
- int res = doc->saveAs(outputName, writeForceRewrite);
-
- delete doc;
- delete globalParams;
- delete outputName;
- return res;
-}
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/pdf-inspector.cc b/Build/source/libs/poppler/poppler-0.12.4/test/pdf-inspector.cc
deleted file mode 100644
index 24bebbd61b7..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/pdf-inspector.cc
+++ /dev/null
@@ -1,373 +0,0 @@
-//========================================================================
-//
-// GDKSplashOutputDev.cc
-//
-// Copyright 2003 Glyph & Cog, LLC
-// Copyright 2004 Red Hat, Inc. (GDK port)
-//
-//========================================================================
-
-#include <config.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <goo/gmem.h>
-#include <goo/GooHash.h>
-#include <goo/GooTimer.h>
-#include <splash/SplashTypes.h>
-#include <splash/SplashBitmap.h>
-#include "Object.h"
-#include "ProfileData.h"
-#include "GfxState.h"
-
-#include <gdk/gdk.h>
-#include "CairoOutputDev.h"
-
-#include "PDFDoc.h"
-#include "GlobalParams.h"
-#include "ErrorCodes.h"
-#include <gtk/gtk.h>
-
-
-// Mapping
-#include "pdf-operators.c"
-
-enum {
- OP_STRING,
- OP_COUNT,
- OP_TOTAL,
- OP_MIN,
- OP_MAX,
- N_COLUMNS
-};
-
-class PdfInspector {
-public:
-
- PdfInspector(void);
-
- void set_file_name (const char *file_name);
- void load (const char *file_name);
- void run (void);
- void error_dialog (const char *error_message);
- void analyze_page (int page);
-
-private:
- static void on_file_activated (GtkWidget *widget, PdfInspector *inspector);
- static void on_selection_changed (GtkTreeSelection *selection, PdfInspector *inspector);
- static void on_analyze_clicked (GtkWidget *widget, PdfInspector *inspector);
-
- GtkBuilder* builder;
- GtkTreeModel *model;
- PDFDoc *doc;
- CairoOutputDev *output;
-};
-
-
-
-PdfInspector::PdfInspector(void)
-{
- GtkWidget *widget;
- GError* error = NULL;
-
- builder = gtk_builder_new ();
-
- if (!gtk_builder_add_from_file (builder, "./pdf-inspector.ui", &error))
- {
- g_warning ("Couldn't load builder file: %s", error->message);
- g_error_free (error);
- }
-
- widget = GTK_WIDGET (gtk_builder_get_object (builder, "pdf_file_chooser_button"));
- g_signal_connect (widget, "selection-changed", G_CALLBACK (on_file_activated), this);
-
- widget = GTK_WIDGET (gtk_builder_get_object (builder, "analyze_button"));
- g_signal_connect (widget, "clicked", G_CALLBACK (on_analyze_clicked), this);
-
- // setup the TreeView
- widget = GTK_WIDGET (gtk_builder_get_object (builder, "pdf_tree_view"));
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)),
- "changed", G_CALLBACK (on_selection_changed), this);
- model = (GtkTreeModel *)gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_INT,
- G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
- gtk_tree_view_set_model (GTK_TREE_VIEW (widget), model);
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (widget),
- 0, "Operation",
- gtk_cell_renderer_text_new (),
- "text", OP_STRING,
- NULL);
-
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (widget),
- 1, "Count",
- gtk_cell_renderer_text_new (),
- "text", OP_COUNT,
- NULL);
-
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (widget),
- 2, "Elapsed",
- gtk_cell_renderer_text_new (),
- "text", OP_TOTAL,
- NULL);
-
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (widget),
- 3, "Min",
- gtk_cell_renderer_text_new (),
- "text", OP_MIN,
- NULL);
-
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (widget),
- 4, "Max",
- gtk_cell_renderer_text_new (),
- "text", OP_MAX,
- NULL);
-
- for (int i = 0; i < N_COLUMNS; i++)
- {
- GtkTreeViewColumn *column;
-
- column = gtk_tree_view_get_column (GTK_TREE_VIEW (widget), i);
- gtk_tree_view_column_set_sort_column_id (column, i);
- }
- doc = NULL;
- output = new CairoOutputDev();
-
- // set up initial widgets
- load (NULL);
-}
-
-void
-PdfInspector::set_file_name(const char *file_name)
-{
- GtkWidget *widget;
-
- widget = GTK_WIDGET (gtk_builder_get_object (builder, "pdf_file_chooser_button"));
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), file_name);
-}
-
-void
-PdfInspector::on_file_activated (GtkWidget *widget, PdfInspector *inspector)
-{
- gchar *file_name;
-
- file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
- if (file_name)
- inspector->load (file_name);
-
- g_free (file_name);
-}
-
-void
-PdfInspector::on_selection_changed (GtkTreeSelection *selection, PdfInspector *inspector)
-{
- GtkWidget *label;
- size_t i;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gchar *op = NULL;
-
- label = GTK_WIDGET (gtk_builder_get_object (inspector->builder, "description_label"));
- gtk_label_set_markup (GTK_LABEL (label), "<i>No Description</i>");
-
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
- {
- gtk_tree_model_get (model, &iter,
- OP_STRING, &op,
- -1);
-
- }
-
- if (op == NULL)
- return;
-
- for (i = 0; i < G_N_ELEMENTS (op_mapping); i++)
- {
-
- if (!strcmp (op, op_mapping[i].op))
- {
- gchar *text;
- text = g_strdup_printf ("<i>%s</i>", op_mapping[i].description);
- gtk_label_set_markup (GTK_LABEL (label), text);
- g_free (text);
- break;
- }
- }
-
- g_free (op);
-}
-
-void
-PdfInspector::on_analyze_clicked (GtkWidget *widget, PdfInspector *inspector)
-{
- GtkWidget *spin;
- int page;
-
- spin = GTK_WIDGET (gtk_builder_get_object (inspector->builder, "pdf_spin"));
-
- page = (int) gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin));
-
- inspector->analyze_page (page);
-
-}
-
-void
-PdfInspector::analyze_page (int page)
-{
- GooHashIter *iter;
- GooHash *hash;
- GooString *key;
- void *p;
- GtkWidget *label;
- char *text;
- cairo_t *cr;
- cairo_surface_t *surface;
-
- label = GTK_WIDGET (gtk_builder_get_object (builder, "pdf_total_label"));
-
- output->startProfile ();
- gtk_list_store_clear (GTK_LIST_STORE (model));
-
- GooTimer timer;
- surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
- doc->getPageCropWidth(page + 1),
- doc->getPageCropHeight(page + 1));
- cr = cairo_create (surface);
- cairo_surface_destroy (surface);
- output->setCairo (cr);
- cairo_destroy (cr);
- doc->displayPage (output, page + 1, 72, 72, 0, gFalse, gTrue, gTrue);
- output->setCairo (NULL);
-
- // Total time;
- text = g_strdup_printf ("%g", timer.getElapsed ());
- gtk_label_set_text (GTK_LABEL (label), text);
- g_free (text);
-
- // Individual times;
- hash = output->endProfile ();
- hash->startIter(&iter);
- while (hash->getNext(&iter, &key, &p))
- {
- GtkTreeIter tree_iter;
- ProfileData *data_p = (ProfileData *) p;
-
- gtk_list_store_append (GTK_LIST_STORE (model), &tree_iter);
- gtk_list_store_set (GTK_LIST_STORE (model), &tree_iter,
- OP_STRING, key->getCString(),
- OP_COUNT, data_p->getCount (),
- OP_TOTAL, data_p->getTotal (),
- OP_MIN, data_p->getMin (),
- OP_MAX, data_p->getMax (),
- -1);
- }
- hash->killIter(&iter);
- deleteGooHash (hash, ProfileData);
-}
-
-void
-PdfInspector::load(const char *file_name)
-{
- GtkWidget *spin;
- GtkWidget *button;
- GtkWidget *label;
-
- // kill the old PDF file
- if (doc != NULL)
- {
- delete doc;
- doc = NULL;
- }
-
- // load the new file
- if (file_name)
- {
- GooString *filename_g;
-
- filename_g = new GooString (file_name);
- doc = new PDFDoc(filename_g, 0, 0);
- delete filename_g;
- }
-
- if (doc && !doc->isOk())
- {
- this->error_dialog ("Failed to load file.");
- delete doc;
- doc = NULL;
- }
-
- spin = GTK_WIDGET (gtk_builder_get_object (builder, "pdf_spin"));
- button = GTK_WIDGET (gtk_builder_get_object (builder, "analyze_button"));
- label = GTK_WIDGET (gtk_builder_get_object (builder, "pdf_total_label"));
- gtk_label_set_text (GTK_LABEL (label), "");
-
- if (doc)
- {
- gtk_widget_set_sensitive (spin, TRUE);
- gtk_widget_set_sensitive (button, TRUE);
- gtk_widget_set_sensitive (label, TRUE);
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (spin), 0, doc->getNumPages()-1);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), 0);
-
- output->startDoc (doc->getXRef(), doc->getCatalog());
- }
- else
- {
- gtk_widget_set_sensitive (spin, FALSE);
- gtk_widget_set_sensitive (button, FALSE);
- gtk_widget_set_sensitive (label, FALSE);
- }
-}
-
-void
-PdfInspector::error_dialog (const char *error_message)
-{
- g_warning ("%s", error_message);
-}
-
-void
-PdfInspector::run()
-{
- GtkWidget *dialog;
-
- dialog = GTK_WIDGET (gtk_builder_get_object (builder, "pdf_dialog"));
-
- gtk_dialog_run (GTK_DIALOG (dialog));
-}
-
-
-
-int
-main (int argc, char *argv [])
-{
- const char *file_name = NULL;
- PdfInspector *inspector;
-
- gtk_init (&argc, &argv);
-
- globalParams = new GlobalParams();
- globalParams->setProfileCommands (true);
- globalParams->setPrintCommands (true);
-
- if (argc == 2)
- file_name = argv[1];
- else if (argc > 2)
- {
- fprintf (stderr, "usage: %s [PDF-FILE]\n", argv[0]);
- return -1;
- }
-
- inspector = new PdfInspector ();
-
- if (file_name)
- inspector->set_file_name (file_name);
-
- inspector->run ();
-
- delete inspector;
- delete globalParams;
-
- return 0;
-}
-
-
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/pdf-inspector.ui b/Build/source/libs/poppler/poppler-0.12.4/test/pdf-inspector.ui
deleted file mode 100644
index 8e20b2f24ba..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/pdf-inspector.ui
+++ /dev/null
@@ -1,416 +0,0 @@
-<?xml version="1.0"?>
-<!--*- mode: xml -*-->
-<interface>
- <object class="GtkAdjustment" id="adjustment1">
- <property name="upper">100</property>
- <property name="lower">0</property>
- <property name="page_increment">10</property>
- <property name="step_increment">1</property>
- <property name="page_size">10</property>
- <property name="value">1</property>
- </object>
- <object class="GtkDialog" id="pdf_dialog">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">PDF Inspector</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">600</property>
- <property name="default_height">400</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="has_separator">False</property>
- <child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <child>
- <object class="GtkButton" id="closebutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox1">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_File:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Page Number</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkFileChooserButton" id="pdf_file_chooser_button">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select A File</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="width_chars">-1</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="pdf_spin">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">adjustment1</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"/>
- </packing>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <child>
- <object class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">12</property>
- <property name="right_padding">0</property>
- <child>
- <object class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
- <child>
- <object class="GtkTreeView" id="pdf_tree_view">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table2">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Total time elapsed:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="pdf_total_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes"/>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Description:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="description_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;i&gt;No Description&lt;/i&gt;</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xscale">0.0</property>
- <property name="yscale">0.0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
- <child>
- <object class="GtkButton" id="analyze_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Analyze</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;PDF Instructions&lt;/b&gt;</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-7">closebutton1</action-widget>
- </action-widgets>
- </object>
-</interface>
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/pdf-operators.c b/Build/source/libs/poppler/poppler-0.12.4/test/pdf-operators.c
deleted file mode 100644
index 3e838a2c641..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/pdf-operators.c
+++ /dev/null
@@ -1,81 +0,0 @@
-typedef struct
-{
- char *op;
- char *description;
-} OperatorMapping;
-
-OperatorMapping op_mapping[] = {
- { "b", "Close, fill, and stroke path using nonzero winding number rule" },
- { "B", "Fill and stroke path using nonzero winding number rule" },
- { "b*", "Close, fill, and stroke path using even-odd rule" },
- { "B*", "Fill and stroke path using even-odd rule" },
- { "BDC", "(PDF 1.2) Begin marked-content sequence with property list" },
- { "BI", "Begin inline image object" },
- { "BMC", "(PDF 1.2) Begin marked-content sequence" },
- { "BT", "Begin text object" },
- { "BX", "(PDF 1.1) Begin compatibility section" },
- { "c", "Append curved segment to path (three control points)" },
- { "cm", "Concatenate matrix to current transformation matrix" },
- { "CS", "(PDF 1.1) Set color space for stroking operations" },
- { "cs", "(PDF 1.1) Set color space for nonstroking operations" },
- { "d", "Set line dash pattern" },
- { "d0", "Set glyph width in Type 3 font" },
- { "d1", "Set glyph width and bounding box in Type 3 font" },
- { "Do", "Invoke named XObject" },
- { "DP", "(PDF 1.2) Define marked-content point with property list" },
- { "EI", "End inline image object" },
- { "EMC", "(PDF 1.2) End marked-content sequence" },
- { "ET", "End text object" },
- { "EX", "(PDF 1.1) End compatibility section" },
- { "f", "Fill path using nonzero winding number rule" },
- { "F", "Fill path using nonzero winding number rule (obsolete)" },
- { "f*", "Fill path using even-odd rule" },
- { "G", "Set gray level for stroking operations" },
- { "g", "Set gray level for nonstroking operations" },
- { "gs", "(PDF 1.2) Set parameters from graphics state parameter dictionary" },
- { "h", "Close subpath" },
- { "i", "Set flatness tolerance" },
- { "ID", "Begin inline image data" },
- { "j", "Set line join style" },
- { "J", "Set line cap style" },
- { "K", "Set CMYK color for stroking operations" },
- { "k", "Set CMYK color for nonstroking operations" },
- { "l", "Append straight line segment to path" },
- { "m", "Begin new subpath" },
- { "M", "Set miter limit" },
- { "MP", "(PDF 1.2) Define marked-content point" },
- { "n", "End path without filling or stroking" },
- { "q", "Save graphics state" },
- { "Q", "Restore graphics state" },
- { "re", "Append rectangle to path" },
- { "RG", "Set RGB color for stroking operations" },
- { "rg", "Set RGB color for nonstroking operations" },
- { "ri", "Set color rendering intent" },
- { "s", "Close and stroke path" },
- { "S", "Stroke path" },
- { "SC", "(PDF 1.1) Set color for stroking operations" },
- { "sc", "(PDF 1.1) Set color for nonstroking operations" },
- { "SCN", "(PDF 1.2) Set color for stroking operations (ICCBased and special color spaces)" },
- { "scn", "(PDF 1.2) Set color for nonstroking operations (ICCBased and special color spaces)" },
- { "sh", "(PDF 1.3) Paint area defined by shading pattern" },
- { "T*", "Move to start of next text line" },
- { "Tc", "Set character spacing" },
- { "Td", "Move text position" },
- { "TD", "Move text position and set leading" },
- { "Tf", "Set text font and size" },
- { "Tj", "Show text" },
- { "TJ", "Show text, allowing individual glyph positioning" },
- { "TL", "Set text leading" },
- { "Tm", "Set text matrix and text line matrix" },
- { "Tr", "Set text rendering mode" },
- { "Ts", "Set text rise" },
- { "Tw", "Set word spacing" },
- { "Tz", "Set horizontal text scaling" },
- { "v", "Append curved segment to path (initial point replicated)" },
- { "w", "Set line width" },
- { "W", "Set clipping path using nonzero winding number rule" },
- { "W*", "Set clipping path using even-odd rule" },
- { "y", "Append curved segment to path (final point replicated)" },
- { "'", "Move to next line and show text" },
- { "\"", "Set word and character spacing, move to next line, and show text" },
-};
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/perf-test-preview-dummy.cc b/Build/source/libs/poppler/poppler-0.12.4/test/perf-test-preview-dummy.cc
deleted file mode 100644
index 09f7d0f8790..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/perf-test-preview-dummy.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright Krzysztof Kowalczyk 2006-2007
- License: GPLv2 */
-
-/* This is a no-op preview support for perf-test.
-Using this perf-test still works for performance testing, you just don't
-get any visual feedback during testing.
-*/
-
-#include "splash/SplashBitmap.h"
-
-void PreviewBitmapSplash(SplashBitmap *bmpSplash)
-{
-}
-
-void PreviewBitmapDestroy(void)
-{
-}
-
-void PreviewBitmapInit(void)
-{
-}
-
diff --git a/Build/source/libs/poppler/poppler-0.12.4/test/perf-test.cc b/Build/source/libs/poppler/poppler-0.12.4/test/perf-test.cc
deleted file mode 100644
index a11a377052d..00000000000
--- a/Build/source/libs/poppler/poppler-0.12.4/test/perf-test.cc
+++ /dev/null
@@ -1,1277 +0,0 @@
-/* Copyright Krzysztof Kowalczyk 2006-2007
- Copyright Hib Eris <hib@hiberis.nl> 2008
- License: GPLv2 */
-/*
- A tool to stress-test poppler rendering and measure rendering times for
- very simplistic performance measuring.
-
- TODO:
- * make it work with cairo output as well
- * print more info about document like e.g. enumarate images,
- streams, compression, encryption, password-protection. Each should have
- a command-line arguments to turn it on/off
- * never over-write file given as -out argument (optionally, provide -force
- option to force writing the -out file). It's way too easy too lose results
- of a previous run.
-*/
-
-#ifdef _MSC_VER
-// this sucks but I don't know any other way
-#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#endif
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-// Define COPY_FILE if you want the file to be copied to a local disk first
-// before it's tested. This is desired if a file is on a slow drive.
-// Currently copying only works on Windows.
-// Not enabled by default.
-//#define COPY_FILE 1
-
-#include <assert.h>
-#include <config.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
-#include "Error.h"
-#include "ErrorCodes.h"
-#include "goo/GooString.h"
-#include "goo/GooList.h"
-#include "goo/GooTimer.h"
-#include "GlobalParams.h"
-#include "splash/SplashBitmap.h"
-#include "Object.h" /* must be included before SplashOutputDev.h because of sloppiness in SplashOutputDev.h */
-#include "SplashOutputDev.h"
-#include "TextOutputDev.h"
-#include "PDFDoc.h"
-#include "Link.h"
-
-#ifdef _MSC_VER
-#define strdup _strdup
-#define strcasecmp _stricmp
-#endif
-
-#define dimof(X) (sizeof(X)/sizeof((X)[0]))
-
-#define INVALID_PAGE_NO -1
-
-/* Those must be implemented in order to provide preview during execution.
- They can be no-ops. An implementation for windows is in
- perf-test-preview-win.cc
-*/
-extern void PreviewBitmapInit(void);
-extern void PreviewBitmapDestroy(void);
-extern void PreviewBitmapSplash(SplashBitmap *bmpSplash);
-
-class PdfEnginePoppler {
-public:
- PdfEnginePoppler();
- ~PdfEnginePoppler();
-
- const char *fileName(void) const { return _fileName; };
-
- void setFileName(const char *fileName) {
- assert(!_fileName);
- _fileName = (char*)strdup(fileName);
- }
-
- int pageCount(void) const { return _pageCount; }
-
- bool load(const char *fileName);
- SplashBitmap *renderBitmap(int pageNo, double zoomReal, int rotation);
-
- SplashOutputDev * outputDevice();
-private:
- char * _fileName;
- int _pageCount;
-
- PDFDoc * _pdfDoc;
- SplashOutputDev * _outputDev;
-};
-
-typedef struct StrList {
- struct StrList *next;
- char * str;
-} StrList;
-
-/* List of all command-line arguments that are not switches.
- We assume those are:
- - names of PDF files
- - names of a file with a list of PDF files
- - names of directories with PDF files
-*/
-static StrList *gArgsListRoot = NULL;
-
-/* Names of all command-line switches we recognize */
-#define TIMINGS_ARG "-timings"
-#define RESOLUTION_ARG "-resolution"
-#define RECURSIVE_ARG "-recursive"
-#define OUT_ARG "-out"
-#define PREVIEW_ARG "-preview"
-#define SLOW_PREVIEW_ARG "-slowpreview"
-#define LOAD_ONLY_ARG "-loadonly"
-#define PAGE_ARG "-page"
-#define TEXT_ARG "-text"
-
-/* Should we record timings? True if -timings command-line argument was given. */
-static bool gfTimings = false;
-
-/* If true, we use render each page at resolution 'gResolutionX'/'gResolutionY'.
- If false, we render each page at its native resolution.
- True if -resolution NxM command-line argument was given. */
-static bool gfForceResolution = false;
-static int gResolutionX = 0;
-static int gResolutionY = 0;
-/* If NULL, we output the log info to stdout. If not NULL, should be a name
- of the file to which we output log info.
- Controled by -out command-line argument. */
-static char * gOutFileName = NULL;
-/* FILE * correspondig to gOutFileName or stdout if gOutFileName is NULL or
- was invalid name */
-static FILE * gOutFile = NULL;
-/* FILE * correspondig to gOutFileName or stderr if gOutFileName is NULL or
- was invalid name */
-static FILE * gErrFile = NULL;
-
-/* If True and a directory is given as a command-line argument, we'll process
- pdf files in sub-directories as well.
- Controlled by -recursive command-line argument */
-static bool gfRecursive = false;
-
-/* If true, preview rendered image. To make sure that they're being rendered correctly. */
-static bool gfPreview = false;
-
-/* 1 second (1000 milliseconds) */
-#define SLOW_PREVIEW_TIME 1000
-
-/* If true, preview rendered image in a slow mode i.e. delay displaying for
- SLOW_PREVIEW_TIME. This is so that a human has enough time to see if the
- PDF renders ok. In release mode on fast processor pages take only ~100-200 ms
- to render and they go away too quickly to be inspected by a human. */
-static bool gfSlowPreview = false;
-
-/* If true, we only dump the text, not render */
-static bool gfTextOnly = false;
-
-#define PAGE_NO_NOT_GIVEN -1
-
-/* If equals PAGE_NO_NOT_GIVEN, we're in default mode where we render all pages.
- If different, will only render this page */
-static int gPageNo = PAGE_NO_NOT_GIVEN;
-/* If true, will only load the file, not render any pages. Mostly for
- profiling load time */
-static bool gfLoadOnly = false;
-
-#define PDF_FILE_DPI 72
-
-#define MAX_FILENAME_SIZE 1024
-
-/* DOS is 0xd 0xa */
-#define DOS_NEWLINE "\x0d\x0a"
-/* Mac is single 0xd */
-#define MAC_NEWLINE "\x0d"
-/* Unix is single 0xa (10) */
-#define UNIX_NEWLINE "\x0a"
-#define UNIX_NEWLINE_C 0xa
-
-#ifdef _WIN32
- #define DIR_SEP_CHAR '\\'
- #define DIR_SEP_STR "\\"
-#else
- #define DIR_SEP_CHAR '/'
- #define DIR_SEP_STR "/"
-#endif
-
-void memzero(void *data, size_t len)
-{
- memset(data, 0, len);
-}
-
-void *zmalloc(size_t len)
-{
- void *data = malloc(len);
- if (data)
- memzero(data, len);
- return data;
-}
-
-/* Concatenate 4 strings. Any string can be NULL.
- Caller needs to free() memory. */
-char *str_cat4(const char *str1, const char *str2, const char *str3, const char *str4)
-{
- char *str;
- char *tmp;
- size_t str1_len = 0;
- size_t str2_len = 0;
- size_t str3_len = 0;
- size_t str4_len = 0;
-
- if (str1)
- str1_len = strlen(str1);
- if (str2)
- str2_len = strlen(str2);
- if (str3)
- str3_len = strlen(str3);
- if (str4)
- str4_len = strlen(str4);
-
- str = (char*)zmalloc(str1_len + str2_len + str3_len + str4_len + 1);
- if (!str)
- return NULL;
-
- tmp = str;
- if (str1) {
- memcpy(tmp, str1, str1_len);
- tmp += str1_len;
- }
- if (str2) {
- memcpy(tmp, str2, str2_len);
- tmp += str2_len;
- }
- if (str3) {
- memcpy(tmp, str3, str3_len);
- tmp += str3_len;
- }
- if (str4) {
- memcpy(tmp, str4, str1_len);
- }
- return str;
-}
-
-char *str_dup(const char *str)
-{
- return str_cat4(str, NULL, NULL, NULL);
-}
-
-bool str_eq(const char *str1, const char *str2)
-{
- if (!str1 && !str2)
- return true;
- if (!str1 || !str2)
- return false;
- if (0 == strcmp(str1, str2))
- return true;
- return false;
-}
-
-bool str_ieq(const char *str1, const char *str2)
-{
- if (!str1 && !str2)
- return true;
- if (!str1 || !str2)
- return false;
- if (0 == strcasecmp(str1, str2))
- return true;
- return false;
-}
-
-bool str_endswith(const char *txt, const char *end)
-{
- size_t end_len;
- size_t txt_len;
-
- if (!txt || !end)
- return false;
-
- txt_len = strlen(txt);
- end_len = strlen(end);
- if (end_len > txt_len)
- return false;
- if (str_eq(txt+txt_len-end_len, end))
- return true;
- return false;
-}
-
-/* TODO: probably should move to some other file and change name to
- sleep_milliseconds */
-void sleep_milliseconds(int milliseconds)
-{
-#ifdef _WIN32
- Sleep((DWORD)milliseconds);
-#else
- struct timespec tv;
- int secs, nanosecs;
- secs = milliseconds / 1000;
- nanosecs = (milliseconds - (secs * 1000)) * 1000;
- tv.tv_sec = (time_t) secs;
- tv.tv_nsec = (long) nanosecs;
- while (1)
- {
- int rval = nanosleep(&tv, &tv);
- if (rval == 0)
- /* Completed the entire sleep time; all done. */
- return;
- else if (errno == EINTR)
- /* Interrupted by a signal. Try again. */
- continue;
- else
- /* Some other error; bail out. */
- return;
- }
- return;
-#endif
-}
-
-#ifndef _MSC_VER
-void strcpy_s(char* dst, size_t dst_size, const char* src)
-{
- size_t src_size = strlen(src) + 1;
- if (src_size <= dst_size)
- memcpy(dst, src, src_size);
- else {
- if (dst_size > 0) {
- memcpy(dst, src, dst_size);
- dst[dst_size-1] = 0;
- }
- }
-}
-
-void strcat_s(char *dst, size_t dst_size, const char* src)
-{
- size_t dst_len = strlen(dst);
- if (dst_len >= dst_size) {
- if (dst_size > 0)
- dst[dst_size-1] = 0;
- return;
- }
- strcpy_s(dst+dst_len, dst_size - dst_len, src);
-}
-#endif
-
-static SplashColorMode gSplashColorMode = splashModeBGR8;
-
-static SplashColor splashColRed;
-static SplashColor splashColGreen;
-static SplashColor splashColBlue;
-static SplashColor splashColWhite;
-static SplashColor splashColBlack;
-
-#define SPLASH_COL_RED_PTR (SplashColorPtr)&(splashColRed[0])
-#define SPLASH_COL_GREEN_PTR (SplashColorPtr)&(splashColGreen[0])
-#define SPLASH_COL_BLUE_PTR (SplashColorPtr)&(splashColBlue[0])
-#define SPLASH_COL_WHITE_PTR (SplashColorPtr)&(splashColWhite[0])
-#define SPLASH_COL_BLACK_PTR (SplashColorPtr)&(splashColBlack[0])
-
-static SplashColorPtr gBgColor = SPLASH_COL_WHITE_PTR;
-
-static void splashColorSet(SplashColorPtr col, Guchar red, Guchar green, Guchar blue, Guchar alpha)
-{
- switch (gSplashColorMode)
- {
- case splashModeBGR8:
- col[0] = blue;
- col[1] = green;
- col[2] = red;
- break;
- case splashModeRGB8:
- col[0] = red;
- col[1] = green;
- col[2] = blue;
- break;
- default:
- assert(0);
- break;
- }
-}
-
-void SplashColorsInit(void)
-{
- splashColorSet(SPLASH_COL_RED_PTR, 0xff, 0, 0, 0);
- splashColorSet(SPLASH_COL_GREEN_PTR, 0, 0xff, 0, 0);
- splashColorSet(SPLASH_COL_BLUE_PTR, 0, 0, 0xff, 0);
- splashColorSet(SPLASH_COL_BLACK_PTR, 0, 0, 0, 0);
- splashColorSet(SPLASH_COL_WHITE_PTR, 0xff, 0xff, 0xff, 0);
-}
-
-PdfEnginePoppler::PdfEnginePoppler() :
- _fileName(0)
- , _pageCount(INVALID_PAGE_NO)
- , _pdfDoc(NULL)
- , _outputDev(NULL)
-{
-}
-
-PdfEnginePoppler::~PdfEnginePoppler()
-{
- free(_fileName);
- delete _outputDev;
- delete _pdfDoc;
-}
-
-bool PdfEnginePoppler::load(const char *fileName)
-{
- setFileName(fileName);
- /* note: don't delete fileNameStr since PDFDoc takes ownership and deletes them itself */
- GooString *fileNameStr = new GooString(fileName);
- if (!fileNameStr) return false;
-
- _pdfDoc = new PDFDoc(fileNameStr, NULL, NULL, (void*)NULL);
- if (!_pdfDoc->isOk()) {
- return false;
- }
- _pageCount = _pdfDoc->getNumPages();
- return true;
-}
-
-SplashOutputDev * PdfEnginePoppler::outputDevice() {
- if (!_outputDev) {
- GBool bitmapTopDown = gTrue;
- _outputDev = new SplashOutputDev(gSplashColorMode, 4, gFalse, gBgColor, bitmapTopDown);
- if (_outputDev)
- _outputDev->startDoc(_pdfDoc->getXRef());
- }
- return _outputDev;
-}
-
-SplashBitmap *PdfEnginePoppler::renderBitmap(int pageNo, double zoomReal, int rotation)
-{
- assert(outputDevice());
- if (!outputDevice()) return NULL;
-
- double hDPI = (double)PDF_FILE_DPI * zoomReal * 0.01;
- double vDPI = (double)PDF_FILE_DPI * zoomReal * 0.01;
- GBool useMediaBox = gFalse;
- GBool crop = gTrue;
- GBool doLinks = gTrue;
- _pdfDoc->displayPage(_outputDev, pageNo, hDPI, vDPI, rotation, useMediaBox,
- crop, doLinks, NULL, NULL);
-
- SplashBitmap* bmp = _outputDev->takeBitmap();
- return bmp;
-}
-
-struct FindFileState {
- char path[MAX_FILENAME_SIZE];
- char dirpath[MAX_FILENAME_SIZE]; /* current dir path */
- char pattern[MAX_FILENAME_SIZE]; /* search pattern */
- const char *bufptr;
-#ifdef _WIN32
- WIN32_FIND_DATA fileinfo;
- HANDLE dir;
-#else
- DIR *dir;
-#endif
-};
-
-#ifdef _WIN32
-#include <windows.h>
-#include <sys/timeb.h>
-#include <direct.h>
-
-__inline char *getcwd(char *buffer, int maxlen)
-{
- return _getcwd(buffer, maxlen);
-}
-
-int fnmatch(const char *pattern, const char *string, int flags)
-{
- int prefix_len;
- const char *star_pos = strchr(pattern, '*');
- if (!star_pos)
- return strcmp(pattern, string) != 0;
-
- prefix_len = (int)(star_pos-pattern);
- if (0 == prefix_len)
- return 0;
-
- if (0 == _strnicmp(pattern, string, prefix_len))
- return 0;
-
- return 1;
-}
-
-#else
-#include <fnmatch.h>
-#endif
-
-#ifdef _WIN32
-/* on windows to query dirs we need foo\* to get files in this directory.
- foo\ always fails and foo will return just info about foo directory,
- not files in this directory */
-static void win_correct_path_for_FindFirstFile(char *path, int path_max_len)
-{
- int path_len = strlen(path);
- if (path_len >= path_max_len-4)
- return;
- if (DIR_SEP_CHAR != path[path_len])
- path[path_len++] = DIR_SEP_CHAR;
- path[path_len++] = '*';
- path[path_len] = 0;
-}
-#endif
-
-FindFileState *find_file_open(const char *path, const char *pattern)
-{
- FindFileState *s;
-
- s = (FindFileState*)malloc(sizeof(FindFileState));
- if (!s)
- return NULL;
- strcpy_s(s->path, sizeof(s->path), path);
- strcpy_s(s->dirpath, sizeof(s->path), path);
-#ifdef _WIN32
- win_correct_path_for_FindFirstFile(s->path, sizeof(s->path));
-#endif
- strcpy_s(s->pattern, sizeof(s->pattern), pattern);
- s->bufptr = s->path;
-#ifdef _WIN32
- s->dir = INVALID_HANDLE_VALUE;
-#else
- s->dir = NULL;
-#endif
- return s;
-}
-
-#if 0 /* re-enable if we #define USE_OWN_GET_AUTH_DATA */
-void *StandardSecurityHandler::getAuthData()
-{
- return NULL;
-}
-#endif
-
-char *makepath(char *buf, int buf_size, const char *path,
- const char *filename)
-{
- strcpy_s(buf, buf_size, path);
- int len = strlen(path);
- if (len > 0 && path[len - 1] != DIR_SEP_CHAR && len + 1 < buf_size) {
- buf[len++] = DIR_SEP_CHAR;
- buf[len] = '\0';
- }
- strcat_s(buf, buf_size, filename);
- return buf;
-}
-
-#ifdef _WIN32
-static int skip_matching_file(const char *filename)
-{
- if (0 == strcmp(".", filename))
- return 1;
- if (0 == strcmp("..", filename))
- return 1;
- return 0;
-}
-#endif
-
-int find_file_next(FindFileState *s, char *filename, int filename_size_max)
-{
-#ifdef _WIN32
- int fFound;
- if (INVALID_HANDLE_VALUE == s->dir) {
- s->dir = FindFirstFile(s->path, &(s->fileinfo));
- if (INVALID_HANDLE_VALUE == s->dir)
- return -1;
- goto CheckFile;
- }
-
- while (1) {
- fFound = FindNextFile(s->dir, &(s->fileinfo));
- if (!fFound)
- return -1;
-CheckFile:
- if (skip_matching_file(s->fileinfo.cFileName))
- continue;
- if (0 == fnmatch(s->pattern, s->fileinfo.cFileName, 0) ) {
- makepath(filename, filename_size_max, s->dirpath, s->fileinfo.cFileName);
- return 0;
- }
- }
-#else
- struct dirent *dirent;
- const char *p;
- char *q;
-
- if (s->dir == NULL)
- goto redo;
-
- for (;;) {
- dirent = readdir(s->dir);
- if (dirent == NULL) {
- redo:
- if (s->dir) {
- closedir(s->dir);
- s->dir = NULL;
- }
- p = s->bufptr;
- if (*p == '\0')
- return -1;
- /* CG: get_str(&p, s->dirpath, sizeof(s->dirpath), ":") */
- q = s->dirpath;
- while (*p != ':' && *p != '\0') {
- if ((q - s->dirpath) < (int)sizeof(s->dirpath) - 1)
- *q++ = *p;
- p++;
- }
- *q = '\0';
- if (*p == ':')
- p++;
- s->bufptr = p;
- s->dir = opendir(s->dirpath);
- if (!s->dir)
- goto redo;
- } else {
- if (fnmatch(s->pattern, dirent->d_name, 0) == 0) {
- makepath(filename, filename_size_max,
- s->dirpath, dirent->d_name);
- return 0;
- }
- }
- }
-#endif
-}
-
-void find_file_close(FindFileState *s)
-{
-#ifdef _WIN32
- if (INVALID_HANDLE_VALUE != s->dir)
- FindClose(s->dir);
-#else
- if (s->dir)
- closedir(s->dir);
-#endif
- free(s);
-}
-
-int StrList_Len(StrList **root)
-{
- int len = 0;
- StrList * cur;
- assert(root);
- if (!root)
- return 0;
- cur = *root;
- while (cur) {
- ++len;
- cur = cur->next;
- }
- return len;
-}
-
-int StrList_InsertAndOwn(StrList **root, char *txt)
-{
- StrList * el;
- assert(root && txt);
- if (!root || !txt)
- return false;
-
- el = (StrList*)malloc(sizeof(StrList));
- if (!el)
- return false;
- el->str = txt;
- el->next = *root;
- *root = el;
- return true;
-}
-
-int StrList_Insert(StrList **root, char *txt)
-{
- char *txtDup;
-
- assert(root && txt);
- if (!root || !txt)
- return false;
- txtDup = str_dup(txt);
- if (!txtDup)
- return false;
-
- if (!StrList_InsertAndOwn(root, txtDup)) {
- free((void*)txtDup);
- return false;
- }
- return true;
-}
-
-StrList* StrList_RemoveHead(StrList **root)
-{
- StrList *tmp;
- assert(root);
- if (!root)
- return NULL;
-
- if (!*root)
- return NULL;
- tmp = *root;
- *root = tmp->next;
- tmp->next = NULL;
- return tmp;
-}
-
-void StrList_FreeElement(StrList *el)
-{
- if (!el)
- return;
- free((void*)el->str);
- free((void*)el);
-}
-
-void StrList_Destroy(StrList **root)
-{
- StrList * cur;
- StrList * next;
-
- if (!root)
- return;
- cur = *root;
- while (cur) {
- next = cur->next;
- StrList_FreeElement(cur);
- cur = next;
- }
- *root = NULL;
-}
-
-#ifndef _WIN32
-void OutputDebugString(const char *txt)
-{
- /* do nothing */
-}
-#define _snprintf snprintf
-#define _vsnprintf vsnprintf
-#endif
-
-void my_error(int pos, char *msg, va_list args) {
-#if 0
- char buf[4096], *p = buf;
-
- // NB: this can be called before the globalParams object is created
- if (globalParams && globalParams->getErrQuiet()) {
- return;
- }
-
- if (pos >= 0) {
- p += _snprintf(p, sizeof(buf)-1, "Error (%d): ", pos);
- *p = '\0';
- OutputDebugString(p);
- } else {
- OutputDebugString("Error: ");
- }
-
- p = buf;
- p += _vsnprintf(p, sizeof(buf) - 1, msg, args);
- while ( p > buf && isspace(p[-1]) )
- *--p = '\0';
- *p++ = '\r';
- *p++ = '\n';
- *p = '\0';
- OutputDebugString(buf);
-
- if (pos >= 0) {
- p += _snprintf(p, sizeof(buf)-1, "Error (%d): ", pos);
- *p = '\0';
- OutputDebugString(buf);
- if (gErrFile)
- fprintf(gErrFile, buf);
- } else {
- OutputDebugString("Error: ");
- if (gErrFile)
- fprintf(gErrFile, "Error: ");
- }
-#endif
-#if 0
- p = buf;
- va_start(args, msg);
- p += _vsnprintf(p, sizeof(buf) - 3, msg, args);
- while ( p > buf && isspace(p[-1]) )
- *--p = '\0';
- *p++ = '\r';
- *p++ = '\n';
- *p = '\0';
- OutputDebugString(buf);
- if (gErrFile)
- fprintf(gErrFile, buf);
- va_end(args);
-#endif
-}
-
-void LogInfo(char *fmt, ...)
-{
- va_list args;
- char buf[4096], *p = buf;
-
- p = buf;
- va_start(args, fmt);
- p += _vsnprintf(p, sizeof(buf) - 1, fmt, args);
- *p = '\0';
- fprintf(gOutFile, "%s", buf);
- va_end(args);
- fflush(gOutFile);
-}
-
-static void PrintUsageAndExit(int argc, char **argv)
-{
- printf("Usage: pdftest [-preview|-slowpreview] [-loadonly] [-timings] [-text] [-resolution NxM] [-recursive] [-page N] [-out out.txt] pdf-files-to-process\n");
- for (int i=0; i < argc; i++) {
- printf("i=%d, '%s'\n", i, argv[i]);
- }
- exit(0);
-}
-
-static bool ShowPreview(void)
-{
- if (gfPreview || gfSlowPreview)
- return true;
- return false;
-}
-
-static void RenderPdfAsText(const char *fileName)
-{
- GooString * fileNameStr = NULL;
- PDFDoc * pdfDoc = NULL;
- GooString * txt = NULL;
- int pageCount;
- double timeInMs;
-
- assert(fileName);
- if (!fileName)
- return;
-
- LogInfo("started: %s\n", fileName);
-
- TextOutputDev * textOut = new TextOutputDev(NULL, gTrue, gFalse, gFalse);
- if (!textOut->isOk()) {
- delete textOut;
- return;
- }
-
- GooTimer msTimer;
- /* note: don't delete fileNameStr since PDFDoc takes ownership and deletes them itself */
- fileNameStr = new GooString(fileName);
- if (!fileNameStr)
- goto Exit;
-
- pdfDoc = new PDFDoc(fileNameStr, NULL, NULL, NULL);
- if (!pdfDoc->isOk()) {
- error(-1, "RenderPdfFile(): failed to open PDF file %s\n", fileName);
- goto Exit;
- }
-
- msTimer.stop();
- timeInMs = msTimer.getElapsed();
- LogInfo("load: %.2f ms\n", timeInMs);
-
- pageCount = pdfDoc->getNumPages();
- LogInfo("page count: %d\n", pageCount);
-
- for (int curPage = 1; curPage <= pageCount; curPage++) {
- if ((gPageNo != PAGE_NO_NOT_GIVEN) && (gPageNo != curPage))
- continue;
-
- msTimer.start();
- int rotate = 0;
- GBool useMediaBox = gFalse;
- GBool crop = gTrue;
- GBool doLinks = gFalse;
- pdfDoc->displayPage(textOut, curPage, 72, 72, rotate, useMediaBox, crop, doLinks);
- txt = textOut->getText(0.0, 0.0, 10000.0, 10000.0);
- msTimer.stop();
- timeInMs = msTimer.getElapsed();
- if (gfTimings)
- LogInfo("page %d: %.2f ms\n", curPage, timeInMs);
- printf("%s\n", txt->getCString());
- delete txt;
- txt = NULL;
- }
-
-Exit:
- LogInfo("finished: %s\n", fileName);
- delete textOut;
- delete pdfDoc;
-}
-
-#ifdef _MSC_VER
-#define POPPLER_TMP_NAME "c:\\poppler_tmp.pdf"
-#else
-#define POPPLER_TMP_NAME "/tmp/poppler_tmp.pdf"
-#endif
-
-static void RenderPdf(const char *fileName)
-{
- const char * fileNameSplash = NULL;
- PdfEnginePoppler * engineSplash = NULL;
- int pageCount;
- double timeInMs;
-
-#ifdef COPY_FILE
- // TODO: fails if file already exists and has read-only attribute
- CopyFile(fileName, POPPLER_TMP_NAME, false);
- fileNameSplash = POPPLER_TMP_NAME;
-#else
- fileNameSplash = fileName;
-#endif
- LogInfo("started: %s\n", fileName);
-
- engineSplash = new PdfEnginePoppler();
-
- GooTimer msTimer;
- if (!engineSplash->load(fileNameSplash)) {
- LogInfo("failed to load splash\n");
- goto Error;
- }
- msTimer.stop();
- timeInMs = msTimer.getElapsed();
- LogInfo("load splash: %.2f ms\n", timeInMs);
- pageCount = engineSplash->pageCount();
-
- LogInfo("page count: %d\n", pageCount);
- if (gfLoadOnly)
- goto Error;
-
- for (int curPage = 1; curPage <= pageCount; curPage++) {
- if ((gPageNo != PAGE_NO_NOT_GIVEN) && (gPageNo != curPage))
- continue;
-
- SplashBitmap *bmpSplash = NULL;
-
- GooTimer msTimer;
- bmpSplash = engineSplash->renderBitmap(curPage, 100.0, 0);
- msTimer.stop();
- double timeInMs = msTimer.getElapsed();
- if (gfTimings) {
- if (!bmpSplash)
- LogInfo("page splash %d: failed to render\n", curPage);
- else
- LogInfo("page splash %d (%dx%d): %.2f ms\n", curPage, bmpSplash->getWidth(), bmpSplash->getHeight(), timeInMs);
- }
-
- if (ShowPreview()) {
- PreviewBitmapSplash(bmpSplash);
- if (gfSlowPreview)
- sleep_milliseconds(SLOW_PREVIEW_TIME);
- }
- delete bmpSplash;
- }
-Error:
- delete engineSplash;
- LogInfo("finished: %s\n", fileName);
-}
-
-static void RenderFile(const char *fileName)
-{
- if (gfTextOnly) {
- RenderPdfAsText(fileName);
- return;
- }
-
- RenderPdf(fileName);
-}
-
-static bool ParseInteger(const char *start, const char *end, int *intOut)
-{
- char numBuf[16];
- int digitsCount;
- const char * tmp;
-
- assert(start && end && intOut);
- assert(end >= start);
- if (!start || !end || !intOut || (start > end))
- return false;
-
- digitsCount = 0;
- tmp = start;
- while (tmp <= end) {
- if (isspace(*tmp)) {
- /* do nothing, we allow whitespace */
- } else if (!isdigit(*tmp))
- return false;
- numBuf[digitsCount] = *tmp;
- ++digitsCount;
- if (digitsCount == dimof(numBuf)-3) /* -3 to be safe */
- return false;
- ++tmp;
- }
- if (0 == digitsCount)
- return false;
- numBuf[digitsCount] = 0;
- *intOut = atoi(numBuf);
- return true;
-}
-
-/* Given 'resolutionString' in format NxM (e.g. "100x200"), parse the string and put N
- into 'resolutionXOut' and M into 'resolutionYOut'.
- Return false if there was an error (e.g. string is not in the right format */
-static bool ParseResolutionString(const char *resolutionString, int *resolutionXOut, int *resolutionYOut)
-{
- const char * posOfX;
-
- assert(resolutionString);
- assert(resolutionXOut);
- assert(resolutionYOut);
- if (!resolutionString || !resolutionXOut || !resolutionYOut)
- return false;
- *resolutionXOut = 0;
- *resolutionYOut = 0;
- posOfX = strchr(resolutionString, 'X');
- if (!posOfX)
- posOfX = strchr(resolutionString, 'x');
- if (!posOfX)
- return false;
- if (posOfX == resolutionString)
- return false;
- if (!ParseInteger(resolutionString, posOfX-1, resolutionXOut))
- return false;
- if (!ParseInteger(posOfX+1, resolutionString+strlen(resolutionString)-1, resolutionYOut))
- return false;
- return true;
-}
-
-static void ParseCommandLine(int argc, char **argv)
-{
- char * arg;
-
- if (argc < 2)
- PrintUsageAndExit(argc, argv);
-
- for (int i=1; i < argc; i++) {
- arg = argv[i];
- assert(arg);
- if ('-' == arg[0]) {
- if (str_ieq(arg, TIMINGS_ARG)) {
- gfTimings = true;
- } else if (str_ieq(arg, RESOLUTION_ARG)) {
- ++i;
- if (i == argc)
- PrintUsageAndExit(argc, argv); /* expect a file name after that */
- if (!ParseResolutionString(argv[i], &gResolutionX, &gResolutionY))
- PrintUsageAndExit(argc, argv);
- gfForceResolution = true;
- } else if (str_ieq(arg, RECURSIVE_ARG)) {
- gfRecursive = true;
- } else if (str_ieq(arg, OUT_ARG)) {
- /* expect a file name after that */
- ++i;
- if (i == argc)
- PrintUsageAndExit(argc, argv);
- gOutFileName = str_dup(argv[i]);
- } else if (str_ieq(arg, PREVIEW_ARG)) {
- gfPreview = true;
- } else if (str_ieq(arg, TEXT_ARG)) {
- gfTextOnly = true;
- } else if (str_ieq(arg, SLOW_PREVIEW_ARG)) {
- gfSlowPreview = true;
- } else if (str_ieq(arg, LOAD_ONLY_ARG)) {
- gfLoadOnly = true;
- } else if (str_ieq(arg, PAGE_ARG)) {
- /* expect an integer after that */
- ++i;
- if (i == argc)
- PrintUsageAndExit(argc, argv);
- gPageNo = atoi(argv[i]);
- if (gPageNo < 1)
- PrintUsageAndExit(argc, argv);
- } else {
- /* unknown option */
- PrintUsageAndExit(argc, argv);
- }
- } else {
- /* we assume that this is not an option hence it must be
- a name of PDF/directory/file with PDF names */
- StrList_Insert(&gArgsListRoot, arg);
- }
- }
-}
-
-#if 0
-void RenderFileList(char *pdfFileList)
-{
- char *data = NULL;
- char *dataNormalized = NULL;
- char *pdfFileName;
- uint64_t fileSize;
-
- assert(pdfFileList);
- if (!pdfFileList)
- return;
- data = file_read_all(pdfFileList, &fileSize);
- if (!data) {
- error(-1, "couldn't load file '%s'", pdfFileList);
- return;
- }
- dataNormalized = str_normalize_newline(data, UNIX_NEWLINE);
- if (!dataNormalized) {
- error(-1, "couldn't normalize data of file '%s'", pdfFileList);
- goto Exit;
- }
- for (;;) {
- pdfFileName = str_split_iter(&dataNormalized, UNIX_NEWLINE_C);
- if (!pdfFileName)
- break;
- str_strip_ws_both(pdfFileName);
- if (str_empty(pdfFileName)) {
- free((void*)pdfFileName);
- continue;
- }
- RenderFile(pdfFileName);
- free((void*)pdfFileName);
- }
-Exit:
- free((void*)dataNormalized);
- free((void*)data);
-}
-#endif
-
-#ifdef _WIN32
-#include <sys/types.h>
-#include <sys/stat.h>
-
-bool IsDirectoryName(char *path)
-{
- struct _stat buf;
- int result;
-
- result = _stat(path, &buf );
- if (0 != result)
- return false;
-
- if (buf.st_mode & _S_IFDIR)
- return true;
-
- return false;
-}
-
-bool IsFileName(char *path)
-{
- struct _stat buf;
- int result;
-
- result = _stat(path, &buf );
- if (0 != result)
- return false;
-
- if (buf.st_mode & _S_IFREG)
- return true;
-
- return false;
-}
-#else
-bool IsDirectoryName(char *path)
-{
- /* TODO: implement me */
- return false;
-}
-
-bool IsFileName(char *path)
-{
- /* TODO: implement me */
- return true;
-}
-#endif
-
-bool IsPdfFileName(char *path)
-{
- if (str_endswith(path, ".pdf"))
- return true;
- return false;
-}
-
-static void RenderDirectory(char *path)
-{
- FindFileState * ffs;
- char filename[MAX_FILENAME_SIZE];
- StrList * dirList = NULL;
- StrList * el;
-
- StrList_Insert(&dirList, path);
-
- while (0 != StrList_Len(&dirList)) {
- el = StrList_RemoveHead(&dirList);
- ffs = find_file_open(el->str, "*");
- while (!find_file_next(ffs, filename, sizeof(filename))) {
- if (IsDirectoryName(filename)) {
- if (gfRecursive) {
- StrList_Insert(&dirList, filename);
- }
- } else if (IsFileName(filename)) {
- if (IsPdfFileName(filename)) {
- RenderFile(filename);
- }
- }
- }
- find_file_close(ffs);
- StrList_FreeElement(el);
- }
- StrList_Destroy(&dirList);
-}
-
-/* Render 'cmdLineArg', which can be:
- - directory name
- - name of PDF file
- - name of text file with names of PDF files
-*/
-static void RenderCmdLineArg(char *cmdLineArg)
-{
- assert(cmdLineArg);
- if (!cmdLineArg)
- return;
- if (IsDirectoryName(cmdLineArg)) {
- RenderDirectory(cmdLineArg);
- } else if (IsFileName(cmdLineArg)) {
- if (IsPdfFileName(cmdLineArg))
- RenderFile(cmdLineArg);
-#if 0
- else
- RenderFileList(cmdLineArg);
-#endif
- } else {
- error(-1, "unexpected argument '%s'", cmdLineArg);
- }
-}
-
-int main(int argc, char **argv)
-{
- setErrorFunction(my_error);
- ParseCommandLine(argc, argv);
- if (0 == StrList_Len(&gArgsListRoot))
- PrintUsageAndExit(argc, argv);
- assert(gArgsListRoot);
-
- SplashColorsInit();
- globalParams = new GlobalParams();
- if (!globalParams)
- return 1;
- globalParams->setErrQuiet(gFalse);
- globalParams->setBaseDir("");
-
- FILE * outFile = NULL;
- if (gOutFileName) {
- outFile = fopen(gOutFileName, "wb");
- if (!outFile) {
- printf("failed to open -out file %s\n", gOutFileName);
- return 1;
- }
- gOutFile = outFile;
- }
- else
- gOutFile = stdout;
-
- if (gOutFileName)
- gErrFile = outFile;
- else
- gErrFile = stderr;
-
- PreviewBitmapInit();
-
- StrList * curr = gArgsListRoot;
- while (curr) {
- RenderCmdLineArg(curr->str);
- curr = curr->next;
- }
- if (outFile)
- fclose(outFile);
- PreviewBitmapDestroy();
- StrList_Destroy(&gArgsListRoot);
- delete globalParams;
- free(gOutFileName);
- return 0;
-}
-