Commit ba59951f authored by Pino Toscano's avatar Pino Toscano

merge the checks for stuff in the development version of poppler in a HAVE_POPPLER_0_7

svn path=/trunk/KDE/kdegraphics/okular/; revision=773566
parent 7aceeecb
# check for Poppler::PSConverter::setOutputDevice()
# check for Poppler::FormFieldButton as "0.7 check"
set(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIR} ${QT_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${POPPLER_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY})
check_cxx_source_compiles("
#include <poppler-qt4.h>
int main()
{
Poppler::Document * doc = Poppler::Document::load(\"foo\");
Poppler::PSConverter * psconv = doc->psConverter();
psconv->setOutputDevice( 0 );
return 0;
}
" POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE)
macro_bool_to_01(POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE _POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE)
check_cxx_source_compiles("
#include <poppler-qt4.h>
#include <poppler-form.h>
int main()
{
Poppler::FormFieldButton * button = 0;
button->buttonType();
return 0;
}
" POPPLER_HAVE_FORMFIELDBUTTON)
macro_bool_to_01(POPPLER_HAVE_FORMFIELDBUTTON _POPPLER_HAVE_FORMFIELDBUTTON)
" HAVE_POPPLER_0_7)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config-okular-poppler.h.cmake
......
/* Defined if we have the 0.6 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_6 1
/* Defined if Poppler::PSConverter has setOutputDevice */
#define POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE ${_POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE}
/* Defined if Poppler::FormFieldButton is available */
#define POPPLER_HAVE_FORMFIELDBUTTON ${_POPPLER_HAVE_FORMFIELDBUTTON}
/* Defined if we have the 0.7 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_7 1
......@@ -9,7 +9,7 @@
#include "formfields.h"
#ifdef POPPLER_HAVE_FORMFIELDBUTTON
#ifdef HAVE_POPPLER_0_7
PopplerFormFieldButton::PopplerFormFieldButton( Poppler::FormFieldButton * field )
: Okular::FormFieldButton(), m_field( field )
{
......
......@@ -15,7 +15,7 @@
#include <config-okular-poppler.h>
#ifdef POPPLER_HAVE_FORMFIELDBUTTON
#ifdef HAVE_POPPLER_0_7
class PopplerFormFieldButton : public Okular::FormFieldButton
{
public:
......
......@@ -874,7 +874,7 @@ bool PDFGenerator::print( QPrinter& printer )
#ifdef HAVE_POPPLER_0_6
#if POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE
#if HAVE_POPPLER_0_7
tf.setAutoRemove(false);
#else
tf.close();
......@@ -890,7 +890,7 @@ bool PDFGenerator::print( QPrinter& printer )
Poppler::PSConverter *psConverter = pdfdoc->psConverter();
#if POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE
#if HAVE_POPPLER_0_7
psConverter->setOutputDevice(&tf);
#else
psConverter->setOutputFileName(tempfilename);
......@@ -1386,7 +1386,7 @@ void PDFGenerator::addFormFields( Poppler::Page * popplerPage, Okular::Page * pa
Okular::FormField * of = 0;
switch ( f->type() )
{
#ifdef POPPLER_HAVE_FORMFIELDBUTTON
#ifdef HAVE_POPPLER_0_7
case Poppler::FormField::FormButton:
of = new PopplerFormFieldButton( static_cast<Poppler::FormFieldButton*>( f ) );
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment