From 89f69159efed9124916b4af4f3efc46ea9b44edc Mon Sep 17 00:00:00 2001 From: mental Date: Thu, 17 Aug 2006 03:21:58 +0000 Subject: [PATCH] see, if someone else with actual time had done this they probably wouldn't be tired and in a hurry and making stupid mistakes --- configure.ac | 5 +++++ src/extension/init.cpp | 10 ++++++++-- src/extension/internal/cairo-pdf-out.cpp | 5 +++++ src/extension/internal/cairo-pdf-out.h | 4 ++++ src/extension/internal/pdf-cairo.cpp | 4 ++++ src/extension/internal/pdf-cairo.h | 3 +++ 6 files changed, 29 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index de8151734..c22fc4f89 100644 --- a/configure.ac +++ b/configure.ac @@ -519,6 +519,11 @@ else fi PKG_CHECK_MODULES(INKSCAPE, gdkmm-2.4 glibmm-2.4 gtkmm-2.4 gtk+-2.0 >= 2.4.0 libxml-2.0 >= 2.6.11 libxslt >= 1.0.15 cairo sigc++-2.0 >= $min_sigc_version $ink_spell_pkg gthread-2.0 >= 2.0 libpng >= 1.2) +PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, cairo_pdf=yes, cairo_pdf=no) +if test "x$cairo_pdf" = "xyes"; then + AC_DEFINE(HAVE_CAIRO_PDF, 1, [Whether the Cairo PDF backend is available]) +fi + dnl Shouldn't we test for libpng and libz? INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz" diff --git a/src/extension/init.cpp b/src/extension/init.cpp index affa3bcd0..756fff964 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -26,7 +26,9 @@ #include "internal/svgz.h" #include "internal/ps.h" #include "internal/pdf.h" -#include "internal/pdf-cairo.h" +#ifdef HAVE_CAIRO_PDF +# include "internal/pdf-cairo.h" +#endif #ifdef WITH_GNOME_PRINT # include "internal/gnome.h" #endif @@ -35,7 +37,9 @@ #endif #include "internal/ps-out.h" #include "internal/pdf-out.h" -#include "internal/cairo-pdf-out.h" +#ifdef HAVE_CAIRO_PDF +# include "internal/cairo-pdf-out.h" +#endif #include "internal/pov-out.h" #include "internal/odf.h" #include "internal/latex-pstricks-out.h" @@ -110,8 +114,10 @@ init() Internal::PrintPS::init(); Internal::PdfOutput::init(); Internal::PrintPDF::init(); +#ifdef HAVE_CAIRO_PDF Internal::CairoPdfOutput::init(); Internal::PrintCairoPDF::init(); +#endif #ifdef WITH_GNOME_PRINT Internal::PrintGNOME::init(); #endif diff --git a/src/extension/internal/cairo-pdf-out.cpp b/src/extension/internal/cairo-pdf-out.cpp index c73faaef6..9ee1ae32f 100644 --- a/src/extension/internal/cairo-pdf-out.cpp +++ b/src/extension/internal/cairo-pdf-out.cpp @@ -14,6 +14,9 @@ #ifdef HAVE_CONFIG_H # include #endif + +#ifdef HAVE_CAIRO_PDF + #include "cairo-pdf-out.h" #include #include "extension/system.h" @@ -143,3 +146,5 @@ CairoPdfOutput::init (void) } } } } /* namespace Inkscape, Extension, Implementation */ + +#endif /* HAVE_CAIRO_PDF */ diff --git a/src/extension/internal/cairo-pdf-out.h b/src/extension/internal/cairo-pdf-out.h index 394c0749a..f0e67f165 100644 --- a/src/extension/internal/cairo-pdf-out.h +++ b/src/extension/internal/cairo-pdf-out.h @@ -16,6 +16,8 @@ #include "extension/implementation/implementation.h" +#ifdef HAVE_CAIRO_PDF + namespace Inkscape { namespace Extension { namespace Internal { @@ -32,6 +34,8 @@ public: } } } /* namespace Inkscape, Extension, Implementation */ +#endif /* HAVE_CAIRO_PDF */ + #endif /* !EXTENSION_INTERNAL_CAIRO_PDF_OUT_H */ /* diff --git a/src/extension/internal/pdf-cairo.cpp b/src/extension/internal/pdf-cairo.cpp index 52ca35e33..b58023afe 100644 --- a/src/extension/internal/pdf-cairo.cpp +++ b/src/extension/internal/pdf-cairo.cpp @@ -18,6 +18,8 @@ # include "config.h" #endif +#ifdef HAVE_CAIRO_PDF + #ifndef PANGO_ENABLE_BACKEND #define PANGO_ENABLE_BACKEND #endif @@ -1030,6 +1032,8 @@ PrintCairoPDF::init(void) /* End of GNU GPL code */ +#endif /* HAVE_CAIRO_PDF */ + /* Local Variables: diff --git a/src/extension/internal/pdf-cairo.h b/src/extension/internal/pdf-cairo.h index d8c4eb676..f18a15d86 100644 --- a/src/extension/internal/pdf-cairo.h +++ b/src/extension/internal/pdf-cairo.h @@ -17,6 +17,8 @@ # include "config.h" #endif +#ifdef HAVE_CAIRO_PDF + #include "extension/extension.h" #include "extension/implementation/implementation.h" #include @@ -93,6 +95,7 @@ public: } /* namespace Extension */ } /* namespace Inkscape */ +#endif /* HAVE_CAIRO_PDF */ #endif /* !EXTENSION_INTERNAL_PDF_CAIRO_H_SEEN */ -- 2.30.2