diff --git a/CMakeLists.txt b/CMakeLists.txt index b33b2c7..5b130bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,7 +217,12 @@ if(WIN32) set(poppler_LIBS ${poppler_LIBS} gdi32) endif(WIN32) +if(MSVC) +set(poppler_SRCS ${poppler_SRCS} poppler/GlobalParamsWin.cc) +add_library(poppler STATIC ${poppler_SRCS}) +else(MSVC) add_library(poppler SHARED ${poppler_SRCS}) +endif(MSVC) set_target_properties(poppler PROPERTIES VERSION 2.0.0 SOVERSION 2) target_link_libraries(poppler ${poppler_LIBS}) install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) diff --git a/qt4/src/CMakeLists.txt b/qt4/src/CMakeLists.txt index 29ef8e5..cd6014e 100644 --- a/qt4/src/CMakeLists.txt +++ b/qt4/src/CMakeLists.txt @@ -32,6 +32,9 @@ endif (ENABLE_SPLASH) add_library(poppler-qt4 SHARED ${poppler_qt4_SRCS}) set_target_properties(poppler-qt4 PROPERTIES VERSION 2.0.0 SOVERSION 2) target_link_libraries(poppler-qt4 poppler ${QT4_QTCORE_LIBRARY} ${QT4_QTGUI_LIBRARY} ${QT4_QTXML_LIBRARY}) +if(MSVC) +target_link_libraries(poppler-qt4 poppler ${poppler_LIBS}) +endif(MSVC) install(TARGETS poppler-qt4 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) install(FILES diff --git a/qt4/src/poppler-annotation-helper.h b/qt4/src/poppler-annotation-helper.h index 0215729..1308b62 100644 --- a/qt4/src/poppler-annotation-helper.h +++ b/qt4/src/poppler-annotation-helper.h @@ -19,6 +19,7 @@ */ #include +#include "poppler-export.h" class QColor; @@ -26,7 +27,7 @@ class AnnotColor; namespace Poppler { -class XPDFReader +class poppler_qt4_EXPORT XPDFReader { public: // find named symbol and parse it diff --git a/qt4/src/poppler-annotation-private.h b/qt4/src/poppler-annotation-private.h index b428347..368d78d 100644 --- a/qt4/src/poppler-annotation-private.h +++ b/qt4/src/poppler-annotation-private.h @@ -20,11 +20,12 @@ #define _POPPLER_ANNOTATION_PRIVATE_H_ #include "poppler-annotation.h" +#include "poppler-export.h" namespace Poppler { -class AnnotationPrivate +class poppler_qt4_EXPORT AnnotationPrivate { public: AnnotationPrivate(); diff --git a/qt4/src/poppler-annotation.h b/qt4/src/poppler-annotation.h index efc9948..c5ac38a 100644 --- a/qt4/src/poppler-annotation.h +++ b/qt4/src/poppler-annotation.h @@ -29,6 +29,7 @@ #include #include #include +#include "poppler-export.h" namespace Poppler { @@ -47,7 +48,7 @@ class Link; * \short Helper class for (recursive) Annotation retrieval/storage. * */ -class AnnotationUtils +class poppler_qt4_EXPORT AnnotationUtils { public: /** @@ -80,7 +81,7 @@ class AnnotationUtils * An Annotation is an object (text note, highlight, sound, popup window, ..) * contained by a Page in the document. */ -class Annotation +class poppler_qt4_EXPORT Annotation { public: // enum definitions @@ -193,7 +194,7 @@ class Annotation * A text annotation is an object showing some text directly on the page, or * linked to the contents using an icon shown on a page. */ -class TextAnnotation : public Annotation +class poppler_qt4_EXPORT TextAnnotation : public Annotation { public: TextAnnotation(); @@ -262,7 +263,7 @@ class TextAnnotation : public Annotation * * This annotation represents a polygon (or polyline) to be drawn on a page. */ -class LineAnnotation : public Annotation +class poppler_qt4_EXPORT LineAnnotation : public Annotation { public: LineAnnotation(); @@ -314,7 +315,7 @@ class LineAnnotation : public Annotation * The geometric annotation represents a geometric figure, like a rectangle or * an ellipse. */ -class GeomAnnotation : public Annotation +class poppler_qt4_EXPORT GeomAnnotation : public Annotation { public: GeomAnnotation(); @@ -345,7 +346,7 @@ class GeomAnnotation : public Annotation * * The higlight annotation represents some areas of text being "highlighted". */ -class HighlightAnnotation : public Annotation +class poppler_qt4_EXPORT HighlightAnnotation : public Annotation { public: HighlightAnnotation(); @@ -408,7 +409,7 @@ class HighlightAnnotation : public Annotation * * A simple annotation drawing a stamp on a page. */ -class StampAnnotation : public Annotation +class poppler_qt4_EXPORT StampAnnotation : public Annotation { public: StampAnnotation(); @@ -455,7 +456,7 @@ class StampAnnotation : public Annotation * * Annotation representing an ink path on a page. */ -class InkAnnotation : public Annotation +class poppler_qt4_EXPORT InkAnnotation : public Annotation { public: InkAnnotation(); @@ -472,7 +473,7 @@ class InkAnnotation : public Annotation Q_DISABLE_COPY( InkAnnotation ) }; -class LinkAnnotation : public Annotation +class poppler_qt4_EXPORT LinkAnnotation : public Annotation { public: LinkAnnotation(); diff --git a/qt4/src/poppler-converter-private.h b/qt4/src/poppler-converter-private.h index 051d9eb..3cd1dbd 100644 --- a/qt4/src/poppler-converter-private.h +++ b/qt4/src/poppler-converter-private.h @@ -21,6 +21,7 @@ #define POPPLER_QT4_CONVERTER_PRIVATE_H #include +#include "poppler-export.h" class QIODevice; @@ -28,7 +29,7 @@ namespace Poppler { class DocumentData; -class BaseConverterPrivate +class poppler_qt4_EXPORT BaseConverterPrivate { public: BaseConverterPrivate(); diff --git a/qt4/src/poppler-export.h b/qt4/src/poppler-export.h new file mode 100755 index 0000000..8b0e88b --- /dev/null +++ b/qt4/src/poppler-export.h @@ -0,0 +1,17 @@ +/* +* This file is used to set the poppler_qt4_EXPORT macros right. +* This is needed for setting the visibility on windows, it will have no effect on other platforms. +*/ +#if _WIN32 +# define LIB_EXPORT __declspec(dllexport) +# define LIB_IMPORT __declspec(dllimport) +#else +# define LIB_EXPORT +# define LIB_IMPORT +#endif + +#ifdef poppler_qt4_EXPORTS +# define poppler_qt4_EXPORT LIB_EXPORT +#else +# define poppler_qt4_EXPORT LIB_IMPORT +#endif diff --git a/qt4/src/poppler-form.h b/qt4/src/poppler-form.h index fa3317d..ef8ecf4 100644 --- a/qt4/src/poppler-form.h +++ b/qt4/src/poppler-form.h @@ -21,6 +21,7 @@ #include #include +#include "poppler-export.h" class Page; class FormWidget; @@ -36,7 +37,7 @@ namespace Poppler { /** The base class representing a form field. */ - class FormField { + class poppler_qt4_EXPORT FormField { public: /** @@ -102,7 +103,7 @@ namespace Poppler { /** A form field that represents a "button". */ - class FormFieldButton : public FormField { + class poppler_qt4_EXPORT FormFieldButton : public FormField { public: /** @@ -157,7 +158,7 @@ namespace Poppler { /** A form field that represents a text input. */ - class FormFieldText : public FormField { + class poppler_qt4_EXPORT FormFieldText : public FormField { public: /** @@ -228,7 +229,7 @@ namespace Poppler { /** A form field that represents a choice field. */ - class FormFieldChoice : public FormField { + class poppler_qt4_EXPORT FormFieldChoice : public FormField { public: /** diff --git a/qt4/src/poppler-link-extractor-private.h b/qt4/src/poppler-link-extractor-private.h index 03d93e0..6222c43 100644 --- a/qt4/src/poppler-link-extractor-private.h +++ b/qt4/src/poppler-link-extractor-private.h @@ -23,6 +23,7 @@ #include #include +#include "poppler-export.h" namespace Poppler { @@ -30,7 +31,7 @@ namespace Poppler class Link; class PageData; -class LinkExtractorOutputDev : public OutputDev +class poppler_qt4_EXPORT LinkExtractorOutputDev : public OutputDev { public: LinkExtractorOutputDev(PageData *data); diff --git a/qt4/src/poppler-link.h b/qt4/src/poppler-link.h index 7c6e60b..a44ad04 100644 --- a/qt4/src/poppler-link.h +++ b/qt4/src/poppler-link.h @@ -24,6 +24,7 @@ #include #include #include +#include "poppler-export.h" namespace Poppler { @@ -43,7 +44,7 @@ class SoundObject; * * Coordinates are in 0..1 range */ -class LinkDestination +class poppler_qt4_EXPORT LinkDestination { public: enum Kind @@ -102,7 +103,7 @@ class LinkDestination * kind of links to reimplement the linkType() method and return the type of * the link described by the reimplemented class. */ -class Link +class poppler_qt4_EXPORT Link { public: Link( const QRectF &linkArea ); @@ -155,7 +156,7 @@ class Link /** Goto: a viewport and maybe a reference to an external filename **/ -class LinkGoto : public Link +class poppler_qt4_EXPORT LinkGoto : public Link { public: /** @@ -187,7 +188,7 @@ class LinkGoto : public Link }; /** Execute: filename and parameters to execute **/ -class LinkExecute : public Link +class poppler_qt4_EXPORT LinkExecute : public Link { public: /** @@ -216,7 +217,7 @@ class LinkExecute : public Link }; /** Browse: an URL to open, ranging from 'http://' to 'mailto:', etc. **/ -class LinkBrowse : public Link +class poppler_qt4_EXPORT LinkBrowse : public Link { public: /** @@ -243,7 +244,7 @@ class LinkBrowse : public Link }; /** Action: contains an action to perform on document / viewer **/ -class LinkAction : public Link +class poppler_qt4_EXPORT LinkAction : public Link { public: /** @@ -287,7 +288,7 @@ class LinkAction : public Link }; /** Sound: a sound to be played **/ -class LinkSound : public Link +class poppler_qt4_EXPORT LinkSound : public Link { public: // create a Link_Sound @@ -325,7 +326,7 @@ class LinkSound : public Link }; /** Movie: Not yet defined -> think renaming to 'Media' link **/ -class LinkMovie : public Link +class poppler_qt4_EXPORT LinkMovie : public Link // TODO this (Movie link) { public: diff --git a/qt4/src/poppler-page-private.h b/qt4/src/poppler-page-private.h index dd79306..35e04b8 100644 --- a/qt4/src/poppler-page-private.h +++ b/qt4/src/poppler-page-private.h @@ -18,6 +18,7 @@ #ifndef _POPPLER_PAGE_PRIVATE_H_ #define _POPPLER_PAGE_PRIVATE_H_ +#include "poppler-export.h" class QRectF; @@ -30,7 +31,7 @@ namespace Poppler class DocumentData; class PageTransition; -class PageData { +class poppler_qt4_EXPORT PageData { public: Link* convertLinkActionToLink(::LinkAction * a, const QRectF &linkArea); diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h index 77cb431..3c2d3ae 100644 --- a/qt4/src/poppler-private.h +++ b/qt4/src/poppler-private.h @@ -38,6 +38,7 @@ #if defined(HAVE_SPLASH) #include #endif +#include "poppler-export.h" #include "poppler-qt4.h" @@ -56,7 +57,7 @@ namespace Poppler { void qt4ErrorFunction(int pos, char *msg, va_list args); - class LinkDestinationData + class poppler_qt4_EXPORT LinkDestinationData { public: LinkDestinationData( LinkDest *l, GooString *nd, Poppler::DocumentData *pdfdoc ) @@ -69,7 +70,7 @@ namespace Poppler { Poppler::DocumentData *doc; }; - class DocumentData { + class poppler_qt4_EXPORT DocumentData { public: DocumentData(GooString *filePath, GooString *ownerPassword, GooString *userPassword) { @@ -259,7 +260,7 @@ namespace Poppler { static int count; }; - class FontInfoData + class poppler_qt4_EXPORT FontInfoData { public: FontInfoData( const FontInfoData &fid ) @@ -287,7 +288,7 @@ namespace Poppler { FontInfo::Type type; }; - class TextBoxData + class poppler_qt4_EXPORT TextBoxData { public: QString text; @@ -298,7 +299,7 @@ namespace Poppler { bool hasSpaceAfter; }; - class FormFieldData + class poppler_qt4_EXPORT FormFieldData { public: FormFieldData(DocumentData *_doc, ::Page *p, ::FormWidget *w) : diff --git a/qt4/src/poppler-qiodeviceoutstream-private.h b/qt4/src/poppler-qiodeviceoutstream-private.h index 74b56ca..f5d912a 100644 --- a/qt4/src/poppler-qiodeviceoutstream-private.h +++ b/qt4/src/poppler-qiodeviceoutstream-private.h @@ -21,12 +21,13 @@ #include "Object.h" #include "Stream.h" +#include "poppler-export.h" class QIODevice; namespace Poppler { -class QIODeviceOutStream : public OutStream +class poppler_qt4_EXPORT QIODeviceOutStream : public OutStream { public: QIODeviceOutStream(QIODevice* device); diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h index 280607b..b80100a 100644 --- a/qt4/src/poppler-qt4.h +++ b/qt4/src/poppler-qt4.h @@ -28,6 +28,7 @@ #include #include #include +#include "poppler-export.h" class EmbFile; class Sound; @@ -58,7 +59,7 @@ namespace Poppler { - a QRectF that gives a box that describes where on the page the text is found. */ - class TextBox { + class poppler_qt4_EXPORT TextBox { friend class Page; public: /** @@ -101,7 +102,7 @@ namespace Poppler { Container class for information about a font within a PDF document */ - class FontInfo { + class poppler_qt4_EXPORT FontInfo { public: enum Type { unknown, @@ -192,7 +193,7 @@ namespace Poppler { /** Container class for an embedded file with a PDF document */ - class EmbeddedFile { + class poppler_qt4_EXPORT EmbeddedFile { public: /// \cond PRIVATE EmbeddedFile(EmbFile *embfile); @@ -259,7 +260,7 @@ namespace Poppler { /** Page within a PDF document */ - class Page { + class poppler_qt4_EXPORT Page { friend class Document; public: /** @@ -462,7 +463,7 @@ namespace Poppler { A document potentially contains multiple Pages */ - class Document { + class poppler_qt4_EXPORT Document { friend class Page; friend class DocumentData; @@ -884,7 +885,7 @@ QString subject = m_doc->info("Subject"); This is the base class for the converters. */ - class BaseConverter + class poppler_qt4_EXPORT BaseConverter { friend class Document; public: @@ -931,7 +932,7 @@ width = dummy.width(); height = dummy.height(); \endcode */ - class PSConverter : public BaseConverter + class poppler_qt4_EXPORT PSConverter : public BaseConverter { friend class Document; public: @@ -1017,7 +1018,7 @@ height = dummy.height(); /** Converts a PDF to PDF (thus saves a copy of the document). */ - class PDFConverter : public BaseConverter + class poppler_qt4_EXPORT PDFConverter : public BaseConverter { friend class Document; public: @@ -1052,7 +1053,7 @@ height = dummy.height(); /** Conversion from PDF date string format to QDateTime */ - QDateTime convertDate( char *dateString ); + poppler_qt4_EXPORT QDateTime convertDate( char *dateString ); class SoundData; /** @@ -1062,7 +1063,7 @@ height = dummy.height(); whose url is represented by url() ), or Embedded, and the player has to play the data contained in data(). */ - class SoundObject { + class poppler_qt4_EXPORT SoundObject { public: /** The type of sound diff --git a/qt4/tests/CMakeLists.txt b/qt4/tests/CMakeLists.txt index b17da53..06dd988 100644 --- a/qt4/tests/CMakeLists.txt +++ b/qt4/tests/CMakeLists.txt @@ -15,6 +15,9 @@ macro(QT4_ADD_SIMPLETEST exe source) ) poppler_add_test(${exe} BUILD_QT4_TESTS ${${test_name}_SOURCES}) target_link_libraries(${exe} poppler-qt4) + if(MSVC) + target_link_libraries(${exe} poppler ${poppler_LIBS}) + endif(MSVC) endmacro(QT4_ADD_SIMPLETEST) macro(QT4_ADD_QTEST exe source) @@ -26,6 +29,9 @@ macro(QT4_ADD_QTEST exe source) poppler_add_unittest(${exe} BUILD_QT4_TESTS ${${test_name}_SOURCES}) qt4_automoc(${${test_name}_SOURCES}) target_link_libraries(${exe} poppler-qt4 ${QT4_QTTEST_LIBRARY}) + if(MSVC) + target_link_libraries(${exe} poppler ${poppler_LIBS}) + endif(MSVC) endif (QT4_QTTEST_FOUND) endmacro(QT4_ADD_QTEST)