-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9985 from rouault/pdf_sdk_headers_split
PDF: split import of SDK headers into separate file per backend
- Loading branch information
Showing
8 changed files
with
220 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/****************************************************************************** | ||
* | ||
* Project: GDAL | ||
* Purpose: Includes PDF SDK headers | ||
* Author: Even Rouault <even dot rouault at spatialys dot com> | ||
* | ||
****************************************************************************** | ||
* Copyright (c) 2015, Even Rouault <even dot rouault at spatialys dot com> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*****************************************************************************/ | ||
|
||
#ifndef PDFSDK_HEADERS_ALL_H | ||
#define PDFSDK_HEADERS_ALL_H | ||
|
||
#if defined(__GNUC__) && !defined(_MSC_VER) | ||
#pragma GCC system_header | ||
#endif | ||
|
||
#include "pdfsdk_headers_poppler.h" | ||
#include "pdfsdk_headers_podofo.h" | ||
#include "pdfsdk_headers_pdfium.h" | ||
|
||
#endif // PDFSDK_HEADERS_ALL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/****************************************************************************** | ||
* | ||
* Project: GDAL | ||
* Purpose: Includes PoDoFo headers | ||
* Author: Even Rouault <even dot rouault at spatialys dot com> | ||
* | ||
****************************************************************************** | ||
* Copyright (c) 2015, Even Rouault <even dot rouault at spatialys dot com> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*****************************************************************************/ | ||
|
||
#ifndef PDFSDK_HEADERS_PODOFO_H | ||
#define PDFSDK_HEADERS_PODOFO_H | ||
|
||
#if defined(__GNUC__) && !defined(_MSC_VER) | ||
#pragma GCC system_header | ||
#endif | ||
|
||
#ifdef HAVE_PODOFO | ||
|
||
#ifdef _WIN32 | ||
/* | ||
* Some Windows header defines a GetObject macro that | ||
* shadows a GetObject() method in PoDoFo. As pdfdataset.cpp includes cpl_spawn.h | ||
* which includes windows.h, so let's bite the bullet and important windows.h | ||
* right now, and then undef GetObject. Undef'ing GetObject is done in some | ||
* source files of PoDoFo itself. | ||
*/ | ||
#include <windows.h> | ||
#ifdef GetObject | ||
#undef GetObject | ||
#endif | ||
#endif | ||
|
||
// Related fix submitted per https://github.com/podofo/podofo/pull/98 | ||
#ifdef HAVE_PODOFO_0_10_OR_LATER | ||
#define USE_HACK_BECAUSE_PdfInputStream_constructor_is_not_exported_in_podofo_0_11 | ||
#endif | ||
|
||
#ifdef USE_HACK_BECAUSE_PdfInputStream_constructor_is_not_exported_in_podofo_0_11 | ||
// If we <sstream> is included after our below #define private public errors out | ||
// with an error like: | ||
// /usr/include/c++/13.2.1/sstream:457:7: error: 'struct std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs' redeclared with different access | ||
// 457 | struct __xfer_bufptrs | ||
// so include it before, as otherwise it would get indirectly included by | ||
// PdfDate.h, which includes <chrono>, which includes <sstream> | ||
#include <sstream> | ||
// Ugly! PfdObjectStream::GetParent() is private but we need it... | ||
#define private public | ||
#endif | ||
#include "podofo.h" | ||
#ifdef private | ||
#undef private | ||
#endif | ||
|
||
#if PODOFO_VERSION_MAJOR > 0 || \ | ||
(PODOFO_VERSION_MAJOR == 0 && PODOFO_VERSION_MINOR >= 10) | ||
#define PdfVecObjects PdfIndirectObjectList | ||
#endif | ||
|
||
#endif // HAVE_PODOFO | ||
|
||
#endif // PDFSDK_HEADERS_PODOFO_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/****************************************************************************** | ||
* | ||
* Project: GDAL | ||
* Purpose: Includes Poppler headers | ||
* Author: Even Rouault <even dot rouault at spatialys dot com> | ||
* | ||
****************************************************************************** | ||
* Copyright (c) 2015, Even Rouault <even dot rouault at spatialys dot com> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
*****************************************************************************/ | ||
|
||
#ifndef PDFSDK_HEADERS_POPPLER_H | ||
#define PDFSDK_HEADERS_POPPLER_H | ||
|
||
#if defined(__GNUC__) && !defined(_MSC_VER) | ||
#pragma GCC system_header | ||
#endif | ||
|
||
#ifdef HAVE_POPPLER | ||
|
||
/* Horrible hack because there's a conflict between struct FlateDecode of */ | ||
/* include/poppler/Stream.h and the FlateDecode() function of */ | ||
/* pdfium/core/include/fpdfapi/fpdf_parser.h. */ | ||
/* The part of Stream.h where struct FlateDecode is defined isn't needed */ | ||
/* by GDAL, and is luckily protected by a #ifndef ENABLE_ZLIB section */ | ||
#ifdef HAVE_PDFIUM | ||
#define ENABLE_ZLIB | ||
#endif /* HAVE_PDFIUM */ | ||
|
||
#ifdef _MSC_VER | ||
#pragma warning(push) | ||
// conversion from 'const int' to 'Guchar', possible loss of data | ||
#pragma warning(disable : 4244) | ||
// conversion from 'size_t' to 'int', possible loss of data | ||
#pragma warning(disable : 4267) | ||
#endif | ||
|
||
/* begin of poppler xpdf includes */ | ||
#include <Object.h> | ||
#include <Stream.h> | ||
|
||
#define private public /* Ugly! Page::pageObj is private but we need it... */ | ||
#include <Page.h> | ||
#undef private | ||
|
||
#include <Dict.h> | ||
|
||
#define private \ | ||
public /* Ugly! Catalog::optContent is private but we need it... */ | ||
#include <Catalog.h> | ||
#undef private | ||
|
||
#define private public /* Ugly! PDFDoc::str is private but we need it... */ | ||
#include <PDFDoc.h> | ||
#undef private | ||
|
||
#include <splash/SplashBitmap.h> | ||
#include <splash/Splash.h> | ||
#include <SplashOutputDev.h> | ||
#include <GlobalParams.h> | ||
#include <ErrorCodes.h> | ||
|
||
/* end of poppler xpdf includes */ | ||
|
||
#ifdef _MSC_VER | ||
#pragma warning(pop) | ||
#endif | ||
|
||
#endif /* HAVE_POPPLER */ | ||
|
||
#endif // PDFSDK_HEADERS_POPPLER_H |