diff --git a/include/poppler/Annot.h b/include/poppler/Annot.h index 93ea312..4fbdcda 100644 --- a/include/poppler/Annot.h +++ b/include/poppler/Annot.h @@ -682,7 +682,7 @@ class Annot { virtual void setContents(GooString *new_content); void setName(GooString *new_name); void setModified(GooString *new_date); - void setFlags(Guint new_flags); + void setFlags(unsigned int new_flags); void setBorder(std::unique_ptr &&new_border); void setColor(std::unique_ptr &&new_color); @@ -701,7 +701,7 @@ class Annot { int getPageNum() const { return page; } const GooString *getName() const { return name.get(); } const GooString *getModified() const { return modified.get(); } - Guint getFlags() const { return flags; } + unsigned int getFlags() const { return flags; } AnnotAppearance *getAppearStreams() const { return appearStreams.get(); } const GooString *getAppearState() const { return appearState.get(); } AnnotBorder *getBorder() const { return border.get(); } @@ -755,7 +755,7 @@ class Annot { std::unique_ptr name; // NM std::unique_ptr modified; // M int page; // P - Guint flags; // F (must be a 32 bit unsigned int) + unsigned int flags; // F (must be a 32 bit unsigned int) std::unique_ptr appearStreams; // AP Object appearance; // a reference to the Form XObject stream // for the normal appearance @@ -832,7 +832,7 @@ class AnnotMarkup: public Annot { protected: void removeReferencedObjects() override; - std::unique_ptr label; // T (Default autor) + std::unique_ptr label; // T (Default author) std::unique_ptr popup; // Popup double opacity; // CA (Default 1.0) // RC @@ -840,7 +840,7 @@ class AnnotMarkup: public Annot { Ref inReplyTo; // IRT std::unique_ptr subject; // Subj AnnotMarkupReplyType replyTo; // RT (Default R) - // this object is overrided by the custom intent fields defined in some + // this object is overridden by the custom intent fields defined in some // annotation types. //GooString *intent; // IT AnnotExternalDataType exData; // ExData diff --git a/include/poppler/Array.h b/include/poppler/Array.h index 0eb4e78..dfe7c75 100644 --- a/include/poppler/Array.h +++ b/include/poppler/Array.h @@ -67,7 +67,7 @@ class Array { void remove(int i); // Accessors. - Object get(int i, int resursion = 0) const; + Object get(int i, int recursion = 0) const; Object getNF(int i) const; bool getString(int i, GooString *string) const; diff --git a/include/poppler/BuiltinFont.h b/include/poppler/BuiltinFont.h index 3821d6a..f755a9c 100644 --- a/include/poppler/BuiltinFont.h +++ b/include/poppler/BuiltinFont.h @@ -23,8 +23,6 @@ #ifndef BUILTINFONT_H #define BUILTINFONT_H -#include "goo/gtypes.h" - struct BuiltinFont; class BuiltinFontWidths; @@ -43,7 +41,7 @@ struct BuiltinFont { struct BuiltinFontWidth { const char *name; - Gushort width; + unsigned short width; BuiltinFontWidth *next; }; @@ -56,7 +54,7 @@ class BuiltinFontWidths { BuiltinFontWidths(const BuiltinFontWidths &) = delete; BuiltinFontWidths& operator=(const BuiltinFontWidths &) = delete; - bool getWidth(const char *name, Gushort *width); + bool getWidth(const char *name, unsigned short *width); private: diff --git a/include/poppler/CMap.h b/include/poppler/CMap.h index 4cb7a53..c02a8a0 100644 --- a/include/poppler/CMap.h +++ b/include/poppler/CMap.h @@ -29,7 +29,6 @@ #include #include "poppler-config.h" -#include "goo/gtypes.h" #include "CharTypes.h" class GooString; @@ -89,7 +88,7 @@ class CMap { // Return the writing mode (0=horizontal, 1=vertical). int getWMode() { return wMode; } - void setReverseMap(Guint *rmap, Guint rmapSize, Guint ncand); + void setReverseMap(unsigned int *rmap, unsigned int rmapSize, unsigned int ncand); private: @@ -99,10 +98,10 @@ class CMap { void useCMap(CMapCache *cache, char *useName); void useCMap(CMapCache *cache, Object *obj); void copyVector(CMapVectorEntry *dest, CMapVectorEntry *src); - void addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID); + void addCIDs(unsigned int start, unsigned int end, unsigned int nBytes, CID firstCID); void freeCMapVector(CMapVectorEntry *vec); - void setReverseMapVector(Guint startCode, CMapVectorEntry *vec, - Guint *rmap, Guint rmapSize, Guint ncand); + void setReverseMapVector(unsigned int startCode, CMapVectorEntry *vec, + unsigned int *rmap, unsigned int rmapSize, unsigned int ncand); GooString *collection; GooString *cMapName; diff --git a/include/poppler/CachedFile.h b/include/poppler/CachedFile.h index 51edec8..665744c 100644 --- a/include/poppler/CachedFile.h +++ b/include/poppler/CachedFile.h @@ -17,7 +17,6 @@ #include "poppler-config.h" -#include "goo/gtypes.h" #include "Object.h" #include "Stream.h" @@ -50,7 +49,7 @@ friend class CachedFileWriter; CachedFile(const CachedFile &) = delete; CachedFile& operator=(const CachedFile &) = delete; - Guint getLength() { return length; } + unsigned int getLength() { return length; } long int tell(); int seek(long int offset, int origin); size_t read(void * ptr, size_t unitsize, size_t count); @@ -141,7 +140,7 @@ class CachedFileLoader { // The caller is responsible for deleting uri and cachedFile. virtual size_t init(GooString *uri, CachedFile *cachedFile) = 0; - // Loads speficified byte ranges and passes it to the writer to store them. + // Loads specified byte ranges and passes it to the writer to store them. // Returns 0 on success, Anything but 0 on failure. // The caller is responsible for deleting the writer. virtual int load(const std::vector &ranges, CachedFileWriter *writer) = 0; diff --git a/include/poppler/Catalog.h b/include/poppler/Catalog.h index 5c638dc..ab120b3 100644 --- a/include/poppler/Catalog.h +++ b/include/poppler/Catalog.h @@ -144,7 +144,7 @@ class Catalog { markInfoUserProperties = 1 << 2, markInfoSuspects = 1 << 3, }; - Guint getMarkInfo(); + unsigned int getMarkInfo(); // Find a page, given its object ID. Returns page number, or 0 if // not found. @@ -266,7 +266,7 @@ class Catalog { GooString *baseURI; // base URI for URI-type links Object metadata; // metadata stream StructTreeRoot *structTreeRoot; // structure tree root - Guint markInfo; // Flags from MarkInfo dictionary + unsigned int markInfo; // Flags from MarkInfo dictionary Object outline; // outline dictionary Object acroForm; // AcroForm dictionary Object viewerPreferences; // ViewerPreference dictionary diff --git a/include/poppler/CharCodeToUnicode.h b/include/poppler/CharCodeToUnicode.h index 0f998b1..9c57fb2 100644 --- a/include/poppler/CharCodeToUnicode.h +++ b/include/poppler/CharCodeToUnicode.h @@ -34,7 +34,6 @@ #include "poppler-config.h" #include "CharTypes.h" -#include "goo/gtypes.h" struct CharCodeToUnicodeString; class GooString; diff --git a/include/poppler/CompactFontTables.h b/include/poppler/CompactFontTables.h index cfbfdaf..303e536 100644 --- a/include/poppler/CompactFontTables.h +++ b/include/poppler/CompactFontTables.h @@ -23,8 +23,6 @@ #ifndef COMPACTFONTINFO_H #define COMPACTFONTINFO_H -#include "goo/gtypes.h" - static char *type1CStdStrings[391] = { ".notdef", "space", @@ -419,7 +417,7 @@ static char *type1CStdStrings[391] = { "Semibold" }; -static Gushort type1CISOAdobeCharset[229] = { +static unsigned short type1CISOAdobeCharset[229] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, @@ -445,7 +443,7 @@ static Gushort type1CISOAdobeCharset[229] = { 220, 221, 222, 223, 224, 225, 226, 227, 228 }; -static const Gushort type1CExpertCharset[166] = { +static const unsigned short type1CExpertCharset[166] = { 0, 1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 13, 14, 15, 99, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 27, 28, 249, 250, @@ -465,7 +463,7 @@ static const Gushort type1CExpertCharset[166] = { 373, 374, 375, 376, 377, 378 }; -static Gushort type1CExpertSubsetCharset[87] = { +static unsigned short type1CExpertSubsetCharset[87] = { 0, 1, 231, 232, 235, 236, 237, 238, 13, 14, 15, 99, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 27, 28, 249, 250, 251, 253, 254, 255, diff --git a/include/poppler/DateInfo.h b/include/poppler/DateInfo.h index 653e677..4fb03c3 100644 --- a/include/poppler/DateInfo.h +++ b/include/poppler/DateInfo.h @@ -24,7 +24,6 @@ #ifndef DATE_INFO_H #define DATE_INFO_H -#include "goo/gtypes.h" #include "goo/GooString.h" #include diff --git a/include/poppler/Decrypt.h b/include/poppler/Decrypt.h index c974d0a..d4667c8 100644 --- a/include/poppler/Decrypt.h +++ b/include/poppler/Decrypt.h @@ -28,7 +28,6 @@ #ifndef DECRYPT_H #define DECRYPT_H -#include "goo/gtypes.h" #include "goo/GooString.h" #include "Object.h" #include "Stream.h" @@ -50,7 +49,7 @@ class Decrypt { const GooString *ownerEnc, const GooString *userEnc, int permissions, const GooString *fileID, const GooString *ownerPassword, const GooString *userPassword, - Guchar *fileKey, bool encryptMetadata, + unsigned char *fileKey, bool encryptMetadata, bool *ownerPasswordOk); private: @@ -58,7 +57,7 @@ class Decrypt { static bool makeFileKey2(int encVersion, int encRevision, int keyLength, const GooString *ownerKey, const GooString *userKey, int permissions, const GooString *fileID, - const GooString *userPassword, Guchar *fileKey, + const GooString *userPassword, unsigned char *fileKey, bool encryptMetadata); }; @@ -74,24 +73,24 @@ class Decrypt { * previous output is kept in buf. The paddingReached field is only used in * case of encryption. */ struct DecryptRC4State { - Guchar state[256]; - Guchar x, y; + unsigned char state[256]; + unsigned char x, y; }; struct DecryptAESState { - Guint w[44]; - Guchar state[16]; - Guchar cbc[16]; - Guchar buf[16]; + unsigned int w[44]; + unsigned char state[16]; + unsigned char cbc[16]; + unsigned char buf[16]; bool paddingReached; // encryption only int bufIdx; }; struct DecryptAES256State { - Guint w[60]; - Guchar state[16]; - Guchar cbc[16]; - Guchar buf[16]; + unsigned int w[60]; + unsigned char state[16]; + unsigned char cbc[16]; + unsigned char buf[16]; bool paddingReached; // encryption only int bufIdx; }; @@ -99,7 +98,7 @@ struct DecryptAES256State { class BaseCryptStream : public FilterStream { public: - BaseCryptStream(Stream *strA, const Guchar *fileKey, CryptAlgorithm algoA, + BaseCryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, int keyLength, int objNum, int objGen); ~BaseCryptStream(); StreamKind getKind() override { return strCrypt; } @@ -114,7 +113,7 @@ class BaseCryptStream : public FilterStream { protected: CryptAlgorithm algo; int objKeyLength; - Guchar objKey[32]; + unsigned char objKey[32]; Goffset charactersRead; // so that getPos() can be correct int nextCharBuff; // EOF means not read yet bool autoDelete; @@ -133,7 +132,7 @@ class BaseCryptStream : public FilterStream { class EncryptStream : public BaseCryptStream { public: - EncryptStream(Stream *strA, const Guchar *fileKey, CryptAlgorithm algoA, + EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, int keyLength, int objNum, int objGen); ~EncryptStream(); void reset() override; @@ -143,7 +142,7 @@ class EncryptStream : public BaseCryptStream { class DecryptStream : public BaseCryptStream { public: - DecryptStream(Stream *strA, const Guchar *fileKey, CryptAlgorithm algoA, + DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, int keyLength, int objNum, int objGen); ~DecryptStream(); void reset() override; @@ -152,6 +151,6 @@ class DecryptStream : public BaseCryptStream { //------------------------------------------------------------------------ -extern void md5(const Guchar *msg, int msgLen, Guchar *digest); +extern void md5(const unsigned char *msg, int msgLen, unsigned char *digest); #endif diff --git a/include/poppler/Error.h b/include/poppler/Error.h index 50c9110..a1c8ee9 100644 --- a/include/poppler/Error.h +++ b/include/poppler/Error.h @@ -29,7 +29,7 @@ #include #include "poppler-config.h" -#include "goo/gtypes.h" +#include "goo/gfile.h" #include "goo/GooString.h" enum ErrorCategory { diff --git a/include/poppler/FontInfo.h b/include/poppler/FontInfo.h index 48eaefd..7d6af0c 100644 --- a/include/poppler/FontInfo.h +++ b/include/poppler/FontInfo.h @@ -26,7 +26,6 @@ #define FONT_INFO_H #include "Object.h" -#include "goo/gtypes.h" #include "goo/GooList.h" class GfxFont; diff --git a/include/poppler/Function.h b/include/poppler/Function.h index 16d9140..da9caad 100644 --- a/include/poppler/Function.h +++ b/include/poppler/Function.h @@ -27,7 +27,6 @@ #ifndef FUNCTION_H #define FUNCTION_H -#include "goo/gtypes.h" #include "Object.h" #include diff --git a/include/poppler/Gfx.h b/include/poppler/Gfx.h index f966e8f..47ae015 100644 --- a/include/poppler/Gfx.h +++ b/include/poppler/Gfx.h @@ -34,7 +34,6 @@ #define GFX_H #include "poppler-config.h" -#include "goo/gtypes.h" #include "goo/GooList.h" #include "GfxState.h" #include "Object.h" diff --git a/include/poppler/GfxFont.h b/include/poppler/GfxFont.h index 5a52e05..de99e29 100644 --- a/include/poppler/GfxFont.h +++ b/include/poppler/GfxFont.h @@ -33,7 +33,6 @@ #ifndef GFXFONT_H #define GFXFONT_H -#include "goo/gtypes.h" #include "goo/GooString.h" #include "Object.h" #include "CharTypes.h" @@ -346,7 +345,7 @@ class Gfx8BitFont: public GfxFont { bool getUsesMacRomanEnc() const { return usesMacRomanEnc; } // Get width of a character. - double getWidth(Guchar c) const { return widths[c]; } + double getWidth(unsigned char c) const { return widths[c]; } // Return a char code-to-GID mapping for the provided font file. // (This is only useful for TrueType fonts.) diff --git a/include/poppler/GfxState.h b/include/poppler/GfxState.h index f5f3d0c..4bfcd73 100644 --- a/include/poppler/GfxState.h +++ b/include/poppler/GfxState.h @@ -36,7 +36,6 @@ #include "poppler-config.h" -#include "goo/gtypes.h" #include "Object.h" #include "Function.h" @@ -108,15 +107,15 @@ static inline double colToDbl(GfxColorComp x) { return (double)x / (double)gfxColorComp1; } -static inline Guchar dblToByte(double x) { +static inline unsigned char dblToByte(double x) { return (x * 255.0); } -static inline double byteToDbl(Guchar x) { +static inline double byteToDbl(unsigned char x) { return (double)x / (double)255.0; } -static inline GfxColorComp byteToCol(Guchar x) { +static inline GfxColorComp byteToCol(unsigned char x) { // (x / 255) << 16 = (0.0000000100000001... * x) << 16 // = ((x << 8) + (x) + (x >> 8) + ...) << 16 // = (x << 8) + (x) + (x >> 7) @@ -124,13 +123,13 @@ static inline GfxColorComp byteToCol(Guchar x) { return (GfxColorComp)((x << 8) + x + (x >> 7)); } -static inline Guchar colToByte(GfxColorComp x) { +static inline unsigned char colToByte(GfxColorComp x) { // 255 * x + 0.5 = 256 * x - x + 0x8000 - return (Guchar)(((x << 8) - x + 0x8000) >> 16); + return (unsigned char)(((x << 8) - x + 0x8000) >> 16); } -static inline Gushort colToShort(GfxColorComp x) { - return (Gushort)(x); +static inline unsigned short colToShort(GfxColorComp x) { + return (unsigned short)(x); } //------------------------------------------------------------------------ @@ -228,12 +227,12 @@ class GfxColorSpace { virtual void getRGB(const GfxColor *color, GfxRGB *rgb) const = 0; virtual void getCMYK(const GfxColor *color, GfxCMYK *cmyk) const = 0; virtual void getDeviceN(const GfxColor *color, GfxColor *deviceN) const = 0; - virtual void getGrayLine(Guchar * /*in*/, Guchar * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getGrayLine this should not happen"); } - virtual void getRGBLine(Guchar * /*in*/, unsigned int * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getRGBLine (first variant) this should not happen"); } - virtual void getRGBLine(Guchar * /*in*/, Guchar * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getRGBLine (second variant) this should not happen"); } - virtual void getRGBXLine(Guchar * /*in*/, Guchar * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getRGBXLine this should not happen"); } - virtual void getCMYKLine(Guchar * /*in*/, Guchar * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getCMYKLine this should not happen"); } - virtual void getDeviceNLine(Guchar * /*in*/, Guchar * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getDeviceNLine this should not happen"); } + virtual void getGrayLine(unsigned char * /*in*/, unsigned char * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getGrayLine this should not happen"); } + virtual void getRGBLine(unsigned char * /*in*/, unsigned int * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getRGBLine (first variant) this should not happen"); } + virtual void getRGBLine(unsigned char * /*in*/, unsigned char * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getRGBLine (second variant) this should not happen"); } + virtual void getRGBXLine(unsigned char * /*in*/, unsigned char * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getRGBXLine this should not happen"); } + virtual void getCMYKLine(unsigned char * /*in*/, unsigned char * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getCMYKLine this should not happen"); } + virtual void getDeviceNLine(unsigned char * /*in*/, unsigned char * /*out*/, int /*length*/) { error(errInternal, -1, "GfxColorSpace::getDeviceNLine this should not happen"); } // create mapping for spot colorants virtual void createMapping(GooList *separationList, int maxSepComps); @@ -263,7 +262,7 @@ class GfxColorSpace { virtual bool isNonMarking() const { return false; } // Return the color space's overprint mask. - Guint getOverprintMask() const { return overprintMask; } + unsigned int getOverprintMask() const { return overprintMask; } // Return the number of color space modes static int getNumColorSpaceModes(); @@ -283,7 +282,7 @@ class GfxColorSpace { #endif protected: - Guint overprintMask; + unsigned int overprintMask; int *mapping; }; @@ -303,12 +302,12 @@ class GfxDeviceGrayColorSpace: public GfxColorSpace { void getRGB(const GfxColor *color, GfxRGB *rgb) const override; void getCMYK(const GfxColor *color, GfxCMYK *cmyk) const override; void getDeviceN(const GfxColor *color, GfxColor *deviceN) const override; - void getGrayLine(Guchar *in, Guchar *out, int length) override; - void getRGBLine(Guchar *in, unsigned int *out, int length) override; - void getRGBLine(Guchar *in, Guchar *out, int length) override; - void getRGBXLine(Guchar *in, Guchar *out, int length) override; - void getCMYKLine(Guchar *in, Guchar *out, int length) override; - void getDeviceNLine(Guchar *in, Guchar *out, int length) override; + void getGrayLine(unsigned char *in, unsigned char *out, int length) override; + void getRGBLine(unsigned char *in, unsigned int *out, int length) override; + void getRGBLine(unsigned char *in, unsigned char *out, int length) override; + void getRGBXLine(unsigned char *in, unsigned char *out, int length) override; + void getCMYKLine(unsigned char *in, unsigned char *out, int length) override; + void getDeviceNLine(unsigned char *in, unsigned char *out, int length) override; bool useGetRGBLine() const override { return true; } bool useGetGrayLine() const override { return true; } @@ -381,12 +380,12 @@ class GfxDeviceRGBColorSpace: public GfxColorSpace { void getRGB(const GfxColor *color, GfxRGB *rgb) const override; void getCMYK(const GfxColor *color, GfxCMYK *cmyk) const override; void getDeviceN(const GfxColor *color, GfxColor *deviceN) const override; - void getGrayLine(Guchar *in, Guchar *out, int length) override; - void getRGBLine(Guchar *in, unsigned int *out, int length) override; - void getRGBLine(Guchar *in, Guchar *out, int length) override; - void getRGBXLine(Guchar *in, Guchar *out, int length) override; - void getCMYKLine(Guchar *in, Guchar *out, int length) override; - void getDeviceNLine(Guchar *in, Guchar *out, int length) override; + void getGrayLine(unsigned char *in, unsigned char *out, int length) override; + void getRGBLine(unsigned char *in, unsigned int *out, int length) override; + void getRGBLine(unsigned char *in, unsigned char *out, int length) override; + void getRGBXLine(unsigned char *in, unsigned char *out, int length) override; + void getCMYKLine(unsigned char *in, unsigned char *out, int length) override; + void getDeviceNLine(unsigned char *in, unsigned char *out, int length) override; bool useGetRGBLine() const override { return true; } bool useGetGrayLine() const override { return true; } @@ -463,11 +462,11 @@ class GfxDeviceCMYKColorSpace: public GfxColorSpace { void getRGB(const GfxColor *color, GfxRGB *rgb) const override; void getCMYK(const GfxColor *color, GfxCMYK *cmyk) const override; void getDeviceN(const GfxColor *color, GfxColor *deviceN) const override; - void getRGBLine(Guchar *in, unsigned int *out, int length) override; - void getRGBLine(Guchar *, Guchar *out, int length) override; - void getRGBXLine(Guchar *in, Guchar *out, int length) override; - void getCMYKLine(Guchar *in, Guchar *out, int length) override; - void getDeviceNLine(Guchar *in, Guchar *out, int length) override; + void getRGBLine(unsigned char *in, unsigned int *out, int length) override; + void getRGBLine(unsigned char *, unsigned char *out, int length) override; + void getRGBXLine(unsigned char *in, unsigned char *out, int length) override; + void getCMYKLine(unsigned char *in, unsigned char *out, int length) override; + void getDeviceNLine(unsigned char *in, unsigned char *out, int length) override; bool useGetRGBLine() const override { return true; } bool useGetCMYKLine() const override { return true; } bool useGetDeviceNLine() const override { return true; } @@ -548,11 +547,11 @@ class GfxICCBasedColorSpace: public GfxColorSpace { void getRGB(const GfxColor *color, GfxRGB *rgb) const override; void getCMYK(const GfxColor *color, GfxCMYK *cmyk) const override; void getDeviceN(const GfxColor *color, GfxColor *deviceN) const override; - void getRGBLine(Guchar *in, unsigned int *out, int length) override; - void getRGBLine(Guchar *in, Guchar *out, int length) override; - void getRGBXLine(Guchar *in, Guchar *out, int length) override; - void getCMYKLine(Guchar *in, Guchar *out, int length) override; - void getDeviceNLine(Guchar *in, Guchar *out, int length) override; + void getRGBLine(unsigned char *in, unsigned int *out, int length) override; + void getRGBLine(unsigned char *in, unsigned char *out, int length) override; + void getRGBXLine(unsigned char *in, unsigned char *out, int length) override; + void getCMYKLine(unsigned char *in, unsigned char *out, int length) override; + void getDeviceNLine(unsigned char *in, unsigned char *out, int length) override; bool useGetRGBLine() const override; bool useGetCMYKLine() const override; @@ -600,11 +599,11 @@ class GfxIndexedColorSpace: public GfxColorSpace { void getRGB(const GfxColor *color, GfxRGB *rgb) const override; void getCMYK(const GfxColor *color, GfxCMYK *cmyk) const override; void getDeviceN(const GfxColor *color, GfxColor *deviceN) const override; - void getRGBLine(Guchar *in, unsigned int *out, int length) override; - void getRGBLine(Guchar *in, Guchar *out, int length) override; - void getRGBXLine(Guchar *in, Guchar *out, int length) override; - void getCMYKLine(Guchar *in, Guchar *out, int length) override; - void getDeviceNLine(Guchar *in, Guchar *out, int length) override; + void getRGBLine(unsigned char *in, unsigned int *out, int length) override; + void getRGBLine(unsigned char *in, unsigned char *out, int length) override; + void getRGBXLine(unsigned char *in, unsigned char *out, int length) override; + void getCMYKLine(unsigned char *in, unsigned char *out, int length) override; + void getDeviceNLine(unsigned char *in, unsigned char *out, int length) override; bool useGetRGBLine() const override { return true; } bool useGetCMYKLine() const override { return true; } @@ -619,9 +618,9 @@ class GfxIndexedColorSpace: public GfxColorSpace { // Indexed-specific access. GfxColorSpace *getBase() { return base; } int getIndexHigh() { return indexHigh; } - Guchar *getLookup() { return lookup; } + unsigned char *getLookup() { return lookup; } GfxColor *mapColorToBase(const GfxColor *color, GfxColor *baseColor) const; - Guint getOverprintMask() { return base->getOverprintMask(); } + unsigned int getOverprintMask() { return base->getOverprintMask(); } void createMapping(GooList *separationList, int maxSepComps) override { base->createMapping(separationList, maxSepComps); } @@ -630,7 +629,7 @@ class GfxIndexedColorSpace: public GfxColorSpace { GfxColorSpace *base; // base color space int indexHigh; // max pixel value - Guchar *lookup; // lookup table + unsigned char *lookup; // lookup table }; //------------------------------------------------------------------------ @@ -670,7 +669,7 @@ class GfxSeparationColorSpace: public GfxColorSpace { GfxSeparationColorSpace(GooString *nameA, GfxColorSpace *altA, Function *funcA, bool nonMarkingA, - Guint overprintMaskA, int *mappingA); + unsigned int overprintMaskA, int *mappingA); GooString *name; // colorant name GfxColorSpace *alt; // alternate color space @@ -715,7 +714,7 @@ class GfxDeviceNColorSpace: public GfxColorSpace { GfxDeviceNColorSpace(int nCompsA, GooString **namesA, GfxColorSpace *alt, Function *func, GooList *sepsCSA, - int *mappingA, bool nonMarkingA, Guint overprintMaskA); + int *mappingA, bool nonMarkingA, unsigned int overprintMaskA); int nComps; // number of components GooString // colorant names @@ -1210,17 +1209,17 @@ class GfxImageColorMap { bool useDeviceNLine() const { return (colorSpace2 && colorSpace2->useGetDeviceNLine ()) || (!colorSpace2 && colorSpace->useGetDeviceNLine ()); } // Convert an image pixel to a color. - void getGray(Guchar *x, GfxGray *gray); - void getRGB(Guchar *x, GfxRGB *rgb); - void getRGBLine(Guchar *in, unsigned int *out, int length); - void getRGBLine(Guchar *in, Guchar *out, int length); - void getRGBXLine(Guchar *in, Guchar *out, int length); - void getGrayLine(Guchar *in, Guchar *out, int length); - void getCMYKLine(Guchar *in, Guchar *out, int length); - void getDeviceNLine(Guchar *in, Guchar *out, int length); - void getCMYK(Guchar *x, GfxCMYK *cmyk); - void getDeviceN(Guchar *x, GfxColor *deviceN); - void getColor(Guchar *x, GfxColor *color); + void getGray(unsigned char *x, GfxGray *gray); + void getRGB(unsigned char *x, GfxRGB *rgb); + void getRGBLine(unsigned char *in, unsigned int *out, int length); + void getRGBLine(unsigned char *in, unsigned char *out, int length); + void getRGBXLine(unsigned char *in, unsigned char *out, int length); + void getGrayLine(unsigned char *in, unsigned char *out, int length); + void getCMYKLine(unsigned char *in, unsigned char *out, int length); + void getDeviceNLine(unsigned char *in, unsigned char *out, int length); + void getCMYK(unsigned char *x, GfxCMYK *cmyk); + void getDeviceN(unsigned char *x, GfxColor *deviceN); + void getColor(unsigned char *x, GfxColor *color); // Matte color ops void setMatteColor(const GfxColor *color) { useMatte = true; matteColor = *color; } @@ -1238,7 +1237,7 @@ class GfxImageColorMap { lookup[gfxColorMaxComps]; GfxColorComp * // optimized case lookup table lookup2[gfxColorMaxComps]; - Guchar *byte_lookup; + unsigned char *byte_lookup; double // minimum values for each component decodeLow[gfxColorMaxComps]; double // max - min value for each component @@ -1377,9 +1376,9 @@ class GfxState { * When GfxState::getReusablePath() is invoked, the currently active * path is taken per reference and its coordinates can be re-edited. * - * A ReusablePathIterator is intented to reduce overhead when the same + * A ReusablePathIterator is intended to reduce overhead when the same * path type is used a lot of times, only with different coordinates. It - * allows just to update the coordinates (occuring in the same order as + * allows just to update the coordinates (occurring in the same order as * in the original path). */ class ReusablePathIterator { diff --git a/include/poppler/GlobalParams.h b/include/poppler/GlobalParams.h index 4c0b28d..365c489 100644 --- a/include/poppler/GlobalParams.h +++ b/include/poppler/GlobalParams.h @@ -39,7 +39,6 @@ #include #include "poppler-config.h" #include -#include "goo/gtypes.h" #include "CharTypes.h" #include "UnicodeMap.h" #include diff --git a/include/poppler/Hints.h b/include/poppler/Hints.h index b535abe..d6a2807 100644 --- a/include/poppler/Hints.h +++ b/include/poppler/Hints.h @@ -14,7 +14,6 @@ #define HINTS_H #include -#include "goo/gtypes.h" #include #include "PDFDoc.h" @@ -48,45 +47,45 @@ class Hints { bool readPageOffsetTable(Stream *str); bool readSharedObjectsTable(Stream *str); - Guint hintsOffset; - Guint hintsLength; - Guint hintsOffset2; - Guint hintsLength2; - Guint mainXRefEntriesOffset; + unsigned int hintsOffset; + unsigned int hintsLength; + unsigned int hintsOffset2; + unsigned int hintsLength2; + unsigned int mainXRefEntriesOffset; int nPages; int pageFirst; int pageObjectFirst; Goffset pageOffsetFirst; - Guint pageEndFirst; - - Guint nObjectLeast; - Guint objectOffsetFirst; - Guint nBitsDiffObjects; - Guint pageLengthLeast; - Guint nBitsDiffPageLength; - Guint OffsetStreamLeast; - Guint nBitsOffsetStream; - Guint lengthStreamLeast; - Guint nBitsLengthStream; - Guint nBitsNumShared; - Guint nBitsShared; - Guint nBitsNumerator; - Guint denominator; - - Guint *nObjects; + unsigned int pageEndFirst; + + unsigned int nObjectLeast; + unsigned int objectOffsetFirst; + unsigned int nBitsDiffObjects; + unsigned int pageLengthLeast; + unsigned int nBitsDiffPageLength; + unsigned int OffsetStreamLeast; + unsigned int nBitsOffsetStream; + unsigned int lengthStreamLeast; + unsigned int nBitsLengthStream; + unsigned int nBitsNumShared; + unsigned int nBitsShared; + unsigned int nBitsNumerator; + unsigned int denominator; + + unsigned int *nObjects; int *pageObjectNum; - Guint *xRefOffset; - Guint *pageLength; + unsigned int *xRefOffset; + unsigned int *pageLength; Goffset *pageOffset; - Guint *numSharedObject; - Guint **sharedObjectId; - - Guint *groupLength; - Guint *groupOffset; - Guint *groupHasSignature; - Guint *groupNumObjects; - Guint *groupXRefOffset; + unsigned int *numSharedObject; + unsigned int **sharedObjectId; + + unsigned int *groupLength; + unsigned int *groupOffset; + unsigned int *groupHasSignature; + unsigned int *groupNumObjects; + unsigned int *groupXRefOffset; bool ok; }; diff --git a/include/poppler/JArithmeticDecoder.h b/include/poppler/JArithmeticDecoder.h index 9e65170..993901a 100644 --- a/include/poppler/JArithmeticDecoder.h +++ b/include/poppler/JArithmeticDecoder.h @@ -25,8 +25,6 @@ #ifndef JARITHMETICDECODER_H #define JARITHMETICDECODER_H -#include "goo/gtypes.h" - class Stream; //------------------------------------------------------------------------ @@ -44,11 +42,11 @@ class JArithmeticDecoderStats { void reset(); int getContextSize() { return contextSize; } void copyFrom(JArithmeticDecoderStats *stats); - void setEntry(Guint cx, int i, int mps); + void setEntry(unsigned int cx, int i, int mps); private: - Guchar *cxTab; // cxTab[cx] = (i[cx] << 1) + mps[cx] + unsigned char *cxTab; // cxTab[cx] = (i[cx] << 1) + mps[cx] int contextSize; friend class JArithmeticDecoder; @@ -85,39 +83,39 @@ class JArithmeticDecoder { void cleanup(); // Decode one bit. - int decodeBit(Guint context, JArithmeticDecoderStats *stats); + int decodeBit(unsigned int context, JArithmeticDecoderStats *stats); // Decode eight bits. - int decodeByte(Guint context, JArithmeticDecoderStats *stats); + int decodeByte(unsigned int context, JArithmeticDecoderStats *stats); // Returns false for OOB, otherwise sets * and returns true. bool decodeInt(int *x, JArithmeticDecoderStats *stats); - Guint decodeIAID(Guint codeLen, + unsigned int decodeIAID(unsigned int codeLen, JArithmeticDecoderStats *stats); void resetByteCounter() { nBytesRead = 0; } - Guint getByteCounter() { return nBytesRead; } + unsigned int getByteCounter() { return nBytesRead; } private: - Guint readByte(); + unsigned int readByte(); int decodeIntBit(JArithmeticDecoderStats *stats); void byteIn(); - static Guint qeTab[47]; + static unsigned int qeTab[47]; static int nmpsTab[47]; static int nlpsTab[47]; static int switchTab[47]; - Guint buf0, buf1; - Guint c, a; + unsigned int buf0, buf1; + unsigned int c, a; int ct; - Guint prev; // for the integer decoder + unsigned int prev; // for the integer decoder Stream *str; - Guint nBytesRead; + unsigned int nBytesRead; int dataLen; bool limitStream; }; diff --git a/include/poppler/JBIG2Stream.h b/include/poppler/JBIG2Stream.h index 1f6a02a..ab746c9 100644 --- a/include/poppler/JBIG2Stream.h +++ b/include/poppler/JBIG2Stream.h @@ -25,7 +25,6 @@ #ifndef JBIG2STREAM_H #define JBIG2STREAM_H -#include "goo/gtypes.h" #include "Object.h" #include "Stream.h" @@ -58,24 +57,24 @@ class JBIG2Stream: public FilterStream { private: bool hasGetChars() override { return true; } - int getChars(int nChars, Guchar *buffer) override; + int getChars(int nChars, unsigned char *buffer) override; void readSegments(); - bool readSymbolDictSeg(Guint segNum, Guint length, - Guint *refSegs, Guint nRefSegs); - void readTextRegionSeg(Guint segNum, bool imm, - bool lossless, Guint length, - Guint *refSegs, Guint nRefSegs); + bool readSymbolDictSeg(unsigned int segNum, unsigned int length, + unsigned int *refSegs, unsigned int nRefSegs); + void readTextRegionSeg(unsigned int segNum, bool imm, + bool lossless, unsigned int length, + unsigned int *refSegs, unsigned int nRefSegs); JBIG2Bitmap *readTextRegion(bool huff, bool refine, int w, int h, - Guint numInstances, - Guint logStrips, + unsigned int numInstances, + unsigned int logStrips, int numSyms, JBIG2HuffmanTable *symCodeTab, - Guint symCodeLen, + unsigned int symCodeLen, JBIG2Bitmap **syms, - Guint defPixel, Guint combOp, - Guint transposed, Guint refCorner, + unsigned int defPixel, unsigned int combOp, + unsigned int transposed, unsigned int refCorner, int sOffset, JBIG2HuffmanTable *huffFSTable, JBIG2HuffmanTable *huffDSTable, @@ -85,14 +84,14 @@ class JBIG2Stream: public FilterStream { JBIG2HuffmanTable *huffRDXTable, JBIG2HuffmanTable *huffRDYTable, JBIG2HuffmanTable *huffRSizeTable, - Guint templ, + unsigned int templ, int *atx, int *aty); - void readPatternDictSeg(Guint segNum, Guint length); - void readHalftoneRegionSeg(Guint segNum, bool imm, - bool lossless, Guint length, - Guint *refSegs, Guint nRefSegs); - void readGenericRegionSeg(Guint segNum, bool imm, - bool lossless, Guint length); + void readPatternDictSeg(unsigned int segNum, unsigned int length); + void readHalftoneRegionSeg(unsigned int segNum, bool imm, + bool lossless, unsigned int length, + unsigned int *refSegs, unsigned int nRefSegs); + void readGenericRegionSeg(unsigned int segNum, bool imm, + bool lossless, unsigned int length); void mmrAddPixels(int a1, int blackPixels, int *codingLine, int *a0i, int w); void mmrAddPixelsNeg(int a1, int blackPixels, @@ -102,44 +101,44 @@ class JBIG2Stream: public FilterStream { bool useSkip, JBIG2Bitmap *skip, int *atx, int *aty, int mmrDataLength); - void readGenericRefinementRegionSeg(Guint segNum, bool imm, - bool lossless, Guint length, - Guint *refSegs, - Guint nRefSegs); + void readGenericRefinementRegionSeg(unsigned int segNum, bool imm, + bool lossless, unsigned int length, + unsigned int *refSegs, + unsigned int nRefSegs); JBIG2Bitmap *readGenericRefinementRegion(int w, int h, int templ, bool tpgrOn, JBIG2Bitmap *refBitmap, int refDX, int refDY, int *atx, int *aty); - void readPageInfoSeg(Guint length); - void readEndOfStripeSeg(Guint length); - void readProfilesSeg(Guint length); - void readCodeTableSeg(Guint segNum, Guint length); - void readExtensionSeg(Guint length); - JBIG2Segment *findSegment(Guint segNum); - void discardSegment(Guint segNum); - void resetGenericStats(Guint templ, + void readPageInfoSeg(unsigned int length); + void readEndOfStripeSeg(unsigned int length); + void readProfilesSeg(unsigned int length); + void readCodeTableSeg(unsigned int segNum, unsigned int length); + void readExtensionSeg(unsigned int length); + JBIG2Segment *findSegment(unsigned int segNum); + void discardSegment(unsigned int segNum); + void resetGenericStats(unsigned int templ, JArithmeticDecoderStats *prevStats); - void resetRefinementStats(Guint templ, + void resetRefinementStats(unsigned int templ, JArithmeticDecoderStats *prevStats); void resetIntStats(int symCodeLen); - bool readUByte(Guint *x); + bool readUByte(unsigned int *x); bool readByte(int *x); - bool readUWord(Guint *x); - bool readULong(Guint *x); + bool readUWord(unsigned int *x); + bool readULong(unsigned int *x); bool readLong(int *x); Object globalsStream; Ref globalsStreamRef; - Guint pageW, pageH, curPageH; - Guint pageDefPixel; + unsigned int pageW, pageH, curPageH; + unsigned int pageDefPixel; JBIG2Bitmap *pageBitmap; - Guint defCombOp; + unsigned int defCombOp; GooList *segments; // [JBIG2Segment] GooList *globalSegments; // [JBIG2Segment] Stream *curStr; - Guchar *dataPtr; - Guchar *dataEnd; + unsigned char *dataPtr; + unsigned char *dataEnd; JArithmeticDecoder *arithDecoder; JArithmeticDecoderStats *genericRegionStats; diff --git a/include/poppler/JPEG2000Stream.h b/include/poppler/JPEG2000Stream.h index 33a84a3..06461e8 100644 --- a/include/poppler/JPEG2000Stream.h +++ b/include/poppler/JPEG2000Stream.h @@ -18,7 +18,6 @@ #define JPEG2000STREAM_H #include "config.h" -#include "goo/gtypes.h" #include "Object.h" #include "Stream.h" @@ -39,7 +38,7 @@ class JPXStream: public FilterStream { bool isBinary(bool last = true) override; void getImageParams(int *bitsPerComponent, StreamColorSpaceMode *csMode) override; - int readStream(int nChars, Guchar *buffer) { + int readStream(int nChars, unsigned char *buffer) { return str->doGetChars(nChars, buffer); } private: @@ -49,7 +48,7 @@ class JPXStream: public FilterStream { void init(); bool hasGetChars() override { return true; } - int getChars(int nChars, Guchar *buffer) override; + int getChars(int nChars, unsigned char *buffer) override; }; #endif diff --git a/include/poppler/Linearization.h b/include/poppler/Linearization.h index 6728a75..6db33b3 100644 --- a/include/poppler/Linearization.h +++ b/include/poppler/Linearization.h @@ -11,7 +11,6 @@ #ifndef LINEARIZATION_H #define LINEARIZATION_H -#include "goo/gtypes.h" #include "Object.h" class BaseStream; @@ -25,15 +24,15 @@ class Linearization { Linearization(BaseStream *str); ~Linearization(); - Guint getLength(); - Guint getHintsOffset(); - Guint getHintsLength(); - Guint getHintsOffset2(); - Guint getHintsLength2(); + unsigned int getLength(); + unsigned int getHintsOffset(); + unsigned int getHintsLength(); + unsigned int getHintsOffset2(); + unsigned int getHintsLength2(); int getObjectNumberFirst(); - Guint getEndFirst(); + unsigned int getEndFirst(); int getNumPages(); - Guint getMainXRefEntriesOffset(); + unsigned int getMainXRefEntriesOffset(); int getPageFirst(); private: diff --git a/include/poppler/MarkedContentOutputDev.h b/include/poppler/MarkedContentOutputDev.h index 84f15b9..0e1d9ce 100644 --- a/include/poppler/MarkedContentOutputDev.h +++ b/include/poppler/MarkedContentOutputDev.h @@ -12,7 +12,6 @@ #ifndef MARKEDCONTENTOUTPUTDEV_H #define MARKEDCONTENTOUTPUTDEV_H -#include "goo/gtypes.h" #include "goo/gmem.h" #include "OutputDev.h" #include "GfxState.h" diff --git a/include/poppler/Movie.h b/include/poppler/Movie.h index bffd0e3..edcd67c 100644 --- a/include/poppler/Movie.h +++ b/include/poppler/Movie.h @@ -44,7 +44,7 @@ struct MovieActivationParameters { struct MovieTime { MovieTime() { units_per_second = 0; } - Gulong units; + unsigned long units; int units_per_second; // 0 : defined by movie }; @@ -81,7 +81,7 @@ class Movie { const GooString* getFileName() const { return fileName; } - Gushort getRotationAngle() const { return rotationAngle; } + unsigned short getRotationAngle() const { return rotationAngle; } void getAspect (int *widthA, int *heightA) const { *widthA = width; *heightA = height; } Object getPoster() const { return poster.copy(); } @@ -97,7 +97,7 @@ class Movie { bool ok; - Gushort rotationAngle; // 0 + unsigned short rotationAngle; // 0 int width; // Aspect int height; // Aspect diff --git a/include/poppler/Object.h b/include/poppler/Object.h index 97bb742..5c7058a 100644 --- a/include/poppler/Object.h +++ b/include/poppler/Object.h @@ -38,7 +38,6 @@ #include #include #include -#include "goo/gtypes.h" #include "goo/gmem.h" #include "goo/GooString.h" #include "goo/GooLikely.h" @@ -291,7 +290,7 @@ class Object { void streamReset(); void streamClose(); int streamGetChar() const; - int streamGetChars(int nChars, Guchar *buffer) const; + int streamGetChars(int nChars, unsigned char *buffer) const; int streamLookChar() const; char *streamGetLine(char *buf, int size) const; Goffset streamGetPos() const; @@ -402,7 +401,7 @@ inline void Object::streamClose() inline int Object::streamGetChar() const { OBJECT_TYPE_CHECK(objStream); return stream->getChar(); } -inline int Object::streamGetChars(int nChars, Guchar *buffer) const +inline int Object::streamGetChars(int nChars, unsigned char *buffer) const { OBJECT_TYPE_CHECK(objStream); return stream->doGetChars(nChars, buffer); } inline int Object::streamLookChar() const diff --git a/include/poppler/OutputDev.h b/include/poppler/OutputDev.h index 8195a25..2445bcc 100644 --- a/include/poppler/OutputDev.h +++ b/include/poppler/OutputDev.h @@ -36,7 +36,6 @@ #define OUTPUTDEV_H #include "poppler-config.h" -#include "goo/gtypes.h" #include "CharTypes.h" #include "Object.h" #include "PopplerCache.h" diff --git a/include/poppler/PDFDoc.h b/include/poppler/PDFDoc.h index d57c049..1a1e376 100644 --- a/include/poppler/PDFDoc.h +++ b/include/poppler/PDFDoc.h @@ -331,12 +331,12 @@ class PDFDoc { // rewrite pageDict with MediaBox, CropBox and new page CTM void replacePageDict(int pageNo, int rotate, const PDFRectangle *mediaBox, const PDFRectangle *cropBox); - void markPageObjects(Dict *pageDict, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum, std::set *alreadyMarkedDicts = nullptr); - bool markAnnotations(Object *annots, XRef *xRef, XRef *countRef, Guint numOffset, int oldPageNum, int newPageNum, std::set *alreadyMarkedDicts = nullptr); - void markAcroForm(Object *acrpForm, XRef *xRef, XRef *countRef, Guint numOffset, int oldPageNum, int newPageNum); + void markPageObjects(Dict *pageDict, XRef *xRef, XRef *countRef, unsigned int numOffset, int oldRefNum, int newRefNum, std::set *alreadyMarkedDicts = nullptr); + bool markAnnotations(Object *annots, XRef *xRef, XRef *countRef, unsigned int numOffset, int oldPageNum, int newPageNum, std::set *alreadyMarkedDicts = nullptr); + void markAcroForm(Object *acrpForm, XRef *xRef, XRef *countRef, unsigned int numOffset, int oldPageNum, int newPageNum); // write all objects used by pageDict to outStr - Guint writePageObjects(OutStream *outStr, XRef *xRef, Guint numOffset, bool combine = false); - static void writeObject (Object *obj, OutStream* outStr, XRef *xref, Guint numOffset, Guchar *fileKey, + unsigned int writePageObjects(OutStream *outStr, XRef *xRef, unsigned int numOffset, bool combine = false); + static void writeObject (Object *obj, OutStream* outStr, XRef *xref, unsigned int numOffset, unsigned char *fileKey, CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen, std::set *alreadyWrittenDicts = nullptr); static void writeHeader(OutStream *outStr, int major, int minor); @@ -349,23 +349,23 @@ class PDFDoc { private: // insert referenced objects in XRef - void markDictionnary (Dict* dict, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum, std::set *alreadyMarkedDicts); - void markObject (Object *obj, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum, std::set *alreadyMarkedDicts = nullptr); - static void writeDictionnary (Dict* dict, OutStream* outStr, XRef *xRef, Guint numOffset, Guchar *fileKey, + void markDictionnary (Dict* dict, XRef *xRef, XRef *countRef, unsigned int numOffset, int oldRefNum, int newRefNum, std::set *alreadyMarkedDicts); + void markObject (Object *obj, XRef *xRef, XRef *countRef, unsigned int numOffset, int oldRefNum, int newRefNum, std::set *alreadyMarkedDicts = nullptr); + static void writeDictionnary (Dict* dict, OutStream* outStr, XRef *xRef, unsigned int numOffset, unsigned char *fileKey, CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen, std::set *alreadyWrittenDicts); // Write object header to current file stream and return its offset static Goffset writeObjectHeader (Ref *ref, OutStream* outStr); static void writeObjectFooter (OutStream* outStr); - void writeObject (Object *obj, OutStream* outStr, Guchar *fileKey, CryptAlgorithm encAlgorithm, + void writeObject (Object *obj, OutStream* outStr, unsigned char *fileKey, CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen, std::set *alreadyWrittenDicts = nullptr) { writeObject(obj, outStr, getXRef(), 0, fileKey, encAlgorithm, keyLength, objNum, objGen, alreadyWrittenDicts); } static void writeStream (Stream* str, OutStream* outStr); static void writeRawStream (Stream* str, OutStream* outStr); void writeXRefTableTrailer (Goffset uxrefOffset, XRef *uxref, bool writeAllEntries, int uxrefSize, OutStream* outStr, bool incrUpdate); - static void writeString (const GooString* s, OutStream* outStr, const Guchar *fileKey, + static void writeString (const GooString* s, OutStream* outStr, const unsigned char *fileKey, CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen); void saveIncrementalUpdate (OutStream* outStr); void saveCompleteRewrite (OutStream* outStr); diff --git a/include/poppler/PSTokenizer.h b/include/poppler/PSTokenizer.h index 0cd8e23..c63ccbe 100644 --- a/include/poppler/PSTokenizer.h +++ b/include/poppler/PSTokenizer.h @@ -23,8 +23,6 @@ #ifndef PSTOKENIZER_H #define PSTOKENIZER_H -#include "goo/gtypes.h" - //------------------------------------------------------------------------ class PSTokenizer { diff --git a/include/poppler/Parser.h b/include/poppler/Parser.h index 418e2f2..2d2ed36 100644 --- a/include/poppler/Parser.h +++ b/include/poppler/Parser.h @@ -48,7 +48,7 @@ class Parser { // true, do not parse compound objects (arrays, dictionaries, or // streams). Object getObj(bool simpleOnly = false, - Guchar *fileKey = nullptr, + unsigned char *fileKey = nullptr, CryptAlgorithm encAlgorithm = cryptRC4, int keyLength = 0, int objNum = 0, int objGen = 0, int recursion = 0, bool strict = false); @@ -70,7 +70,7 @@ class Parser { Object buf1, buf2; // next two tokens int inlineImg; // set when inline image data is encountered - Stream *makeStream(Object &&dict, Guchar *fileKey, + Stream *makeStream(Object &&dict, unsigned char *fileKey, CryptAlgorithm encAlgorithm, int keyLength, int objNum, int objGen, int recursion, bool strict); diff --git a/include/poppler/PreScanOutputDev.h b/include/poppler/PreScanOutputDev.h index a53aa13..cd62479 100644 --- a/include/poppler/PreScanOutputDev.h +++ b/include/poppler/PreScanOutputDev.h @@ -27,7 +27,6 @@ #ifndef PRESCANOUTPUTDEV_H #define PRESCANOUTPUTDEV_H -#include "goo/gtypes.h" #include "Object.h" #include "GfxState.h" #include "GlobalParams.h" diff --git a/include/poppler/SecurityHandler.h b/include/poppler/SecurityHandler.h index 017a328..c8a4caf 100644 --- a/include/poppler/SecurityHandler.h +++ b/include/poppler/SecurityHandler.h @@ -25,7 +25,6 @@ #include "poppler-config.h" -#include "goo/gtypes.h" #include "Object.h" class GooString; @@ -87,7 +86,7 @@ class SecurityHandler { // valid after authorize has returned true. virtual int getPermissionFlags() = 0; virtual bool getOwnerPasswordOk() = 0; - virtual Guchar *getFileKey() = 0; + virtual unsigned char *getFileKey() = 0; virtual int getFileKeyLength() = 0; virtual int getEncVersion() = 0; virtual int getEncRevision() = 0; @@ -116,7 +115,7 @@ class StandardSecurityHandler: public SecurityHandler { bool authorize(void *authData) override; int getPermissionFlags() override { return permFlags; } bool getOwnerPasswordOk() override { return ownerPasswordOk; } - Guchar *getFileKey() override { return fileKey; } + unsigned char *getFileKey() override { return fileKey; } int getFileKeyLength() override { return fileKeyLength; } int getEncVersion() override { return encVersion; } int getEncRevision() override { return encRevision; } @@ -126,7 +125,7 @@ class StandardSecurityHandler: public SecurityHandler { int permFlags; bool ownerPasswordOk; - Guchar fileKey[32]; + unsigned char fileKey[32]; int fileKeyLength; int encVersion; int encRevision; diff --git a/include/poppler/SplashOutputDev.h b/include/poppler/SplashOutputDev.h index 5960405..72f524a 100644 --- a/include/poppler/SplashOutputDev.h +++ b/include/poppler/SplashOutputDev.h @@ -32,7 +32,6 @@ #ifndef SPLASHOUTPUTDEV_H #define SPLASHOUTPUTDEV_H -#include "goo/gtypes.h" #include "splash/SplashTypes.h" #include "splash/SplashPattern.h" #include "poppler-config.h" @@ -410,22 +409,22 @@ class SplashOutputDev: public OutputDev { SplashPath convertPath(GfxState *state, GfxPath *path, bool dropEmptySubpaths); void drawType3Glyph(GfxState *state, T3FontCache *t3Font, - T3FontCacheTag *tag, Guchar *data); + T3FontCacheTag *tag, unsigned char *data); #ifdef USE_CMS bool useIccImageSrc(void *data); static void iccTransform(void *data, SplashBitmap *bitmap); static bool iccImageSrc(void *data, SplashColorPtr colorLine, - Guchar *alphaLine); + unsigned char *alphaLine); #endif static bool imageMaskSrc(void *data, SplashColorPtr line); static bool imageSrc(void *data, SplashColorPtr colorLine, - Guchar *alphaLine); + unsigned char *alphaLine); static bool alphaImageSrc(void *data, SplashColorPtr line, - Guchar *alphaLine); + unsigned char *alphaLine); static bool maskedImageSrc(void *data, SplashColorPtr line, - Guchar *alphaLine); + unsigned char *alphaLine); static bool tilingBitmapSrc(void *data, SplashColorPtr line, - Guchar *alphaLine); + unsigned char *alphaLine); bool keepAlphaChannel; // don't fill with paper color, keep alpha channel diff --git a/include/poppler/Stream.h b/include/poppler/Stream.h index 6a9a6e8..f6aa41c 100644 --- a/include/poppler/Stream.h +++ b/include/poppler/Stream.h @@ -39,7 +39,6 @@ #include #include "poppler-config.h" -#include "goo/gtypes.h" #include "Object.h" class GooFile; @@ -85,8 +84,8 @@ enum CryptAlgorithm { //------------------------------------------------------------------------ typedef struct _ByteRange { - Guint offset; - Guint length; + unsigned int offset; + unsigned int length; } ByteRange; //------------------------------------------------------------------------ @@ -114,7 +113,7 @@ class Stream { // Close down the stream. virtual void close(); - inline int doGetChars(int nChars, Guchar *buffer) + inline int doGetChars(int nChars, unsigned char *buffer) { if (hasGetChars()) { return getChars(nChars, buffer); @@ -130,7 +129,7 @@ class Stream { inline void fillGooString(GooString *s) { - Guchar readBuf[4096]; + unsigned char readBuf[4096]; int readChars; reset(); while ((readChars = doGetChars(4096, readBuf)) != 0) { @@ -138,10 +137,10 @@ class Stream { } } - inline Guchar *toUnsignedChars(int *length, int initialSize = 4096, int sizeIncrement = 4096) + inline unsigned char *toUnsignedChars(int *length, int initialSize = 4096, int sizeIncrement = 4096) { int readChars; - Guchar *buf = (Guchar *)gmalloc(initialSize); + unsigned char *buf = (unsigned char *)gmalloc(initialSize); int size = initialSize; *length = 0; int charsToRead = initialSize; @@ -153,7 +152,7 @@ class Stream { if (lookChar() != EOF) { size += sizeIncrement; charsToRead = sizeIncrement; - buf = (Guchar *)grealloc(buf, size); + buf = (unsigned char *)grealloc(buf, size); } else { continueReading = false; } @@ -233,7 +232,7 @@ class Stream { int decRef() { return --ref; } virtual bool hasGetChars() { return false; } - virtual int getChars(int nChars, Guchar *buffer); + virtual int getChars(int nChars, unsigned char *buffer); Stream *makeFilter(const char *name, Stream *str, Object *params, int recursion = 0, Dict *dict = nullptr); @@ -379,11 +378,11 @@ class ImageStream { // Gets the next pixel from the stream. should be able to hold // at least nComps elements. Returns false at end of file. - bool getPixel(Guchar *pix); + bool getPixel(unsigned char *pix); // Returns a pointer to the next line of pixels. Returns NULL at // end of file. - Guchar *getLine(); + unsigned char *getLine(); // Skip an entire line from the image. void skipLine(); @@ -396,8 +395,8 @@ class ImageStream { int nBits; // bits per component int nVals; // components per line int inputLineSize; // input line buffer size - Guchar *inputLine; // input line buffer - Guchar *imgLine; // line buffer + unsigned char *inputLine; // input line buffer + unsigned char *imgLine; // line buffer int imgIdx; // current index in imgLine }; @@ -422,7 +421,7 @@ class StreamPredictor { int lookChar(); int getChar(); - int getChars(int nChars, Guchar *buffer); + int getChars(int nChars, unsigned char *buffer); private: @@ -436,7 +435,7 @@ class StreamPredictor { int nVals; // components per line int pixBytes; // bytes per pixel int rowBytes; // bytes per line - Guchar *predLine; // line buffer + unsigned char *predLine; // line buffer int predIdx; // current index in predLine bool ok; }; @@ -476,7 +475,7 @@ class FileStream: public BaseStream { bool fillBuf(); bool hasGetChars() override { return true; } - int getChars(int nChars, Guchar *buffer) override + int getChars(int nChars, unsigned char *buffer) override { int n, m; @@ -551,7 +550,7 @@ class CachedFileStream: public BaseStream { char buf[cachedStreamBufSize]; char *bufPtr; char *bufEnd; - Guint bufPos; + unsigned int bufPos; int savePos; bool saved; }; @@ -605,7 +604,7 @@ class BaseMemStream: public BaseStream { Goffset getPos() override { return (int)(bufPtr - buf); } void setPos(Goffset pos, int dir = 0) override { - Guint i; + unsigned int i; if (dir >= 0) { i = pos; @@ -639,7 +638,7 @@ class BaseMemStream: public BaseStream { bool hasGetChars() override { return true; } - int getChars(int nChars, Guchar *buffer) override { + int getChars(int nChars, unsigned char *buffer) override { int n; if (nChars <= 0) { @@ -716,7 +715,7 @@ class EmbedStream: public BaseStream { private: bool hasGetChars() override { return true; } - int getChars(int nChars, Guchar *buffer) override; + int getChars(int nChars, unsigned char *buffer) override; Stream *str; bool limited; @@ -800,7 +799,7 @@ class LZWStream: public FilterStream { private: bool hasGetChars() override { return true; } - int getChars(int nChars, Guchar *buffer) override; + int getChars(int nChars, unsigned char *buffer) override; inline int doGetRawChar() { if (eof) { @@ -822,13 +821,13 @@ class LZWStream: public FilterStream { struct { // decoding table int length; int head; - Guchar tail; + unsigned char tail; } table[4097]; int nextCode; // next code to be used int nextBits; // number of bits in next code word int prevCode; // previous code used in stream int newChar; // next char to be added to table - Guchar seqBuf[4097]; // buffer for current sequence + unsigned char seqBuf[4097]; // buffer for current sequence int seqLength; // length of current sequence int seqIndex; // index into current sequence bool first; // first code after a table clear @@ -859,7 +858,7 @@ class RunLengthStream: public FilterStream { private: bool hasGetChars() override { return true; } - int getChars(int nChars, Guchar *buffer) override; + int getChars(int nChars, unsigned char *buffer) override; char buf[128]; // buffer char *bufPtr; // next char to read @@ -914,7 +913,7 @@ class CCITTFaxStream: public FilterStream { bool eof; // true if at eof bool nextLine2D; // true if next line uses 2D encoding int row; // current row - Guint inputBuf; // input buffer + unsigned int inputBuf; // input buffer int inputBits; // number of bits in input buffer int *codingLine; // coding line changing elements int *refLine; // reference line changing elements @@ -957,10 +956,10 @@ struct DCTScanInfo { // DCT Huffman decoding table struct DCTHuffTable { - Guchar firstSym[17]; // first symbol for this bit length - Gushort firstCode[17]; // first code for this bit length - Gushort numCodes[17]; // number of codes of this bit length - Guchar sym[256]; // symbols + unsigned char firstSym[17]; // first symbol for this bit length + unsigned short firstCode[17]; // first code for this bit length + unsigned short numCodes[17]; // number of codes of this bit length + unsigned char sym[256]; // symbols }; class DCTStream: public FilterStream { @@ -995,13 +994,13 @@ class DCTStream: public FilterStream { bool gotJFIFMarker; // set if APP0 JFIF marker was present bool gotAdobeMarker; // set if APP14 Adobe marker was present int restartInterval; // restart interval, in MCUs - Gushort quantTables[4][64]; // quantization tables + unsigned short quantTables[4][64]; // quantization tables int numQuantTables; // number of quantization tables DCTHuffTable dcHuffTables[4]; // DC Huffman tables DCTHuffTable acHuffTables[4]; // AC Huffman tables int numDCHuffTables; // number of DC Huffman tables int numACHuffTables; // number of AC Huffman tables - Guchar *rowBuf[4][32]; // buffer for one MCU (non-progressive mode) + unsigned char *rowBuf[4][32]; // buffer for one MCU (non-progressive mode) int *frameBuf[4]; // buffer for frame (progressive mode) int comp, x, y, dy; // current position within image/MCU int restartCtr; // MCUs left until restart @@ -1020,8 +1019,8 @@ class DCTStream: public FilterStream { DCTHuffTable *acHuffTable, int *prevDC, int data[64]); void decodeImage(); - void transformDataUnit(Gushort *quantTable, - int dataIn[64], Guchar dataOut[64]); + void transformDataUnit(unsigned short *quantTable, + int dataIn[64], unsigned char dataOut[64]); int readHuffSym(DCTHuffTable *table); int readAmp(int size); int readBit(); @@ -1055,8 +1054,8 @@ class DCTStream: public FilterStream { // Huffman code table entry struct FlateCode { - Gushort len; // code length, in bits - Gushort val; // value represented by this code + unsigned short len; // code length, in bits + unsigned short val; // value represented by this code }; struct FlateHuffmanTab { @@ -1103,10 +1102,10 @@ class FlateStream: public FilterStream { } bool hasGetChars() override { return true; } - int getChars(int nChars, Guchar *buffer) override; + int getChars(int nChars, unsigned char *buffer) override; StreamPredictor *pred; // predictor - Guchar buf[flateWindow]; // output data buffer + unsigned char buf[flateWindow]; // output data buffer int index; // current index into output buffer int remain; // number valid bytes in output buffer int codeBuf; // input buffer @@ -1325,7 +1324,7 @@ class LZWEncoder: public FilterStream { LZWEncoderNode table[4096]; int nextSeq; int codeLen; - Guchar inBuf[4096]; + unsigned char inBuf[4096]; int inBufLen; int outBuf; int outBufLen; diff --git a/include/poppler/StructElement.h b/include/poppler/StructElement.h index 5db317b..7c232a9 100644 --- a/include/poppler/StructElement.h +++ b/include/poppler/StructElement.h @@ -14,7 +14,6 @@ #ifndef STRUCTELEMENT_H #define STRUCTELEMENT_H -#include "goo/gtypes.h" #include "goo/GooString.h" #include "MarkedContentOutputDev.h" #include "Object.h" @@ -89,8 +88,8 @@ class Attribute { GooString *getName() const { return type == UserProperty ? name.copy() : new GooString(getTypeName()); } // The revision is optional, and defaults to zero. - Guint getRevision() const { return revision; } - void setRevision(Guint revisionA) { revision = revisionA; } + unsigned int getRevision() const { return revision; } + void setRevision(unsigned int revisionA) { revision = revisionA; } // Hidden elements should not be displayed by the user agent bool isHidden() const { return hidden; } @@ -106,7 +105,7 @@ class Attribute { private: Type type; Owner owner; - Guint revision; + unsigned int revision; mutable GooString name; mutable Object value; bool hidden; @@ -180,8 +179,8 @@ class StructElement { } // Optional revision number, defaults to zero. - Guint getRevision() const { return isContent() ? 0 : s->revision; } - void setRevision(Guint revision) { if (isContent()) s->revision = revision; } + unsigned int getRevision() const { return isContent() ? 0 : s->revision; } + void setRevision(unsigned int revision) { if (isContent()) s->revision = revision; } // Optional element title, in human-readable form. const GooString *getTitle() const { return isContent() ? nullptr : s->title; } @@ -261,7 +260,7 @@ class StructElement { GooString *title; GooString *expandedAbbr; GooString *language; - Guint revision; + unsigned int revision; ElemPtrArray elements; AttrPtrArray attributes; diff --git a/include/poppler/StructTreeRoot.h b/include/poppler/StructTreeRoot.h index 1b7a560..41b1cd8 100644 --- a/include/poppler/StructTreeRoot.h +++ b/include/poppler/StructTreeRoot.h @@ -14,7 +14,6 @@ #ifndef STRUCTTREEROOT_H #define STRUCTTREEROOT_H -#include "goo/gtypes.h" #include "Object.h" #include "StructElement.h" #include diff --git a/include/poppler/TextOutputDev.h b/include/poppler/TextOutputDev.h index 1daf964..e935088 100644 --- a/include/poppler/TextOutputDev.h +++ b/include/poppler/TextOutputDev.h @@ -23,6 +23,7 @@ // Copyright (C) 2013 Thomas Freitag // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, . Work sponsored by the LiMux project of the city of Munich // Copyright (C) 2018 Sanchit Anand +// Copyright (C) 2018 Nelson Benítez León // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -34,7 +35,6 @@ #include "poppler-config.h" #include -#include "goo/gtypes.h" #include "GfxFont.h" #include "GfxState.h" #include "OutputDev.h" @@ -341,6 +341,9 @@ class TextLine { Unicode *normalized; // normalized form of Unicode text int normalized_len; // number of normalized Unicode chars int *normalized_idx; // indices of normalized chars into Unicode text + Unicode *ascii_translation; // ascii translation from the normalized text + int ascii_len; // length of ascii translation text + int *ascii_idx; // indices of ascii chars into Unicode text of line friend class TextLineFrag; friend class TextBlock; @@ -606,6 +609,18 @@ class TextPage { double *xMin, double *yMin, double *xMax, double *yMax); + // Adds new parameter ignoreDiacritics, which will do diacritics + // insensitive search, i.e. ignore accents, umlauts, diaeresis,etc. + // while matching. This option will be ignored if contains characters + // which are not pure ascii. + bool findText(Unicode *s, int len, + bool startAtTop, bool stopAtBottom, + bool startAtLast, bool stopAtLast, + bool caseSensitive, bool ignoreDiacritics, + bool backward, bool wholeWord, + double *xMin, double *yMin, + double *xMax, double *yMax); + // Get the text which is inside the specified rectangle. GooString *getText(double xMin, double yMin, double xMax, double yMax); diff --git a/include/poppler/UTF.h b/include/poppler/UTF.h index 5fa2782..566bfb3 100644 --- a/include/poppler/UTF.h +++ b/include/poppler/UTF.h @@ -7,6 +7,7 @@ // Copyright (C) 2012, 2017 Adrian Johnson // Copyright (C) 2016 Jason Crain // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, . Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Nelson Benítez León // //======================================================================== @@ -75,4 +76,17 @@ int utf16ToUtf8(const uint16_t *utf16, char *utf8, int maxUtf8 = INT_MAX, int ma // Allocate utf8 string and convert utf16 into it. char *utf16ToUtf8(const uint16_t *utf16, int *len = nullptr); +// Convert a UCS-4 string to pure ASCII (7bit) +// in - UCS-4 string bytes +// len - number of UCS-4 characters +// ucs4_out - if not NULL, allocates and returns UCS-4 string. Free with gfree. +// out_len - number of UCS-4 characters in ucs4_out. +// in_idx - if not NULL, the int array returned by the out fourth parameter of +// unicodeNormalizeNFKC() function. Optional, needed for @indices out parameter. +// indices - if not NULL, @indices is assigned the location of a newly-allocated array +// of length @out_len + 1, for each character in the ascii string giving the index +// of the corresponding character in the text of the line (thanks to this info +// being passed in @in_idx parameter). +void unicodeToAscii7(Unicode *in, int len, Unicode **ucs4_out, int *out_len, int *in_idx, int **indices); + #endif diff --git a/include/poppler/UnicodeMap.h b/include/poppler/UnicodeMap.h index 070faeb..383a693 100644 --- a/include/poppler/UnicodeMap.h +++ b/include/poppler/UnicodeMap.h @@ -28,7 +28,6 @@ #define UNICODEMAP_H #include "poppler-config.h" -#include "goo/gtypes.h" #include "CharTypes.h" #include @@ -46,7 +45,7 @@ typedef int (*UnicodeMapFunc)(Unicode u, char *buf, int bufSize); struct UnicodeMapRange { Unicode start, end; // range of Unicode chars - Guint code, nBytes; // first output code + unsigned int code, nBytes; // first output code }; struct UnicodeMapExt; diff --git a/include/poppler/UnicodeTypeTable.h b/include/poppler/UnicodeTypeTable.h index ca84338..5468051 100644 --- a/include/poppler/UnicodeTypeTable.h +++ b/include/poppler/UnicodeTypeTable.h @@ -25,8 +25,6 @@ #ifndef UNICODETYPETABLE_H #define UNICODETYPETABLE_H -#include "goo/gtypes.h" - extern bool unicodeTypeL(Unicode c); extern bool unicodeTypeR(Unicode c); diff --git a/include/poppler/ViewerPreferences.h b/include/poppler/ViewerPreferences.h index b9b813a..fead992 100644 --- a/include/poppler/ViewerPreferences.h +++ b/include/poppler/ViewerPreferences.h @@ -11,8 +11,6 @@ #ifndef VIEWERPREFERENCES_H #define VIEWERPREFERENCES_H -#include "goo/gtypes.h" - class Dict; //------------------------------------------------------------------------ diff --git a/include/poppler/XRef.h b/include/poppler/XRef.h index dc6659a..14b0308 100644 --- a/include/poppler/XRef.h +++ b/include/poppler/XRef.h @@ -35,7 +35,6 @@ #define XREF_H #include "poppler-config.h" -#include "goo/gtypes.h" #include "Object.h" #include "Stream.h" #include "PopplerCache.h" @@ -118,13 +117,13 @@ class XRef { // Set the encryption parameters. void setEncryption(int permFlagsA, bool ownerPasswordOkA, - const Guchar *fileKeyA, int keyLengthA, + const unsigned char *fileKeyA, int keyLengthA, int encVersionA, int encRevisionA, CryptAlgorithm encAlgorithmA); // Mark Encrypt entry as Unencrypted void markUnencrypted(); - void getEncryptionParameters(Guchar **fileKeyA, CryptAlgorithm *encAlgorithmA, int *keyLengthA); + void getEncryptionParameters(unsigned char **fileKeyA, CryptAlgorithm *encAlgorithmA, int *keyLengthA); // Is the file encrypted? bool isEncrypted() const { return encrypted; } @@ -227,7 +226,7 @@ class XRef { CryptAlgorithm encAlgorithm; // encryption algorithm int keyLength; // length of key, in bytes int permFlags; // permission bits - Guchar fileKey[32]; // file decryption key + unsigned char fileKey[32]; // file decryption key bool ownerPasswordOk; // true if owner password is correct Goffset prevXRefOffset; // position of prev XRef section (= next to read) Goffset mainXRefEntriesOffset; // offset of entries in main XRef table diff --git a/include/poppler/cpp/poppler-global.h b/include/poppler/cpp/poppler-global.h index eb7ec24..b214aec 100644 --- a/include/poppler/cpp/poppler-global.h +++ b/include/poppler/cpp/poppler-global.h @@ -2,6 +2,7 @@ * Copyright (C) 2009-2010, Pino Toscano * Copyright (C) 2010, Patrick Spendrin * Copyright (C) 2014, Hans-Peter Deifel + * Copyright (C) 2018, Adam Reichold * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -107,6 +108,8 @@ POPPLER_CPP_EXPORT time_type convert_date(const std::string &date); POPPLER_CPP_EXPORT std::ostream& operator<<(std::ostream& stream, const byte_array &array); +POPPLER_CPP_EXPORT bool set_data_dir(const std::string &new_data_dir); + typedef void(*debug_func)(const std::string &, void *); POPPLER_CPP_EXPORT void set_debug_error_function(debug_func debug_function, void *closure); diff --git a/include/poppler/cpp/poppler-version.h b/include/poppler/cpp/poppler-version.h index 666be3c..0652606 100644 --- a/include/poppler/cpp/poppler-version.h +++ b/include/poppler/cpp/poppler-version.h @@ -21,10 +21,10 @@ #include "poppler-global.h" -#define POPPLER_VERSION "0.72.1" +#define POPPLER_VERSION "0.73.0" #define POPPLER_VERSION_MAJOR 0 -#define POPPLER_VERSION_MINOR 72 -#define POPPLER_VERSION_MICRO 1 +#define POPPLER_VERSION_MINOR 73 +#define POPPLER_VERSION_MICRO 0 namespace poppler { diff --git a/include/poppler/fofi/FoFiBase.h b/include/poppler/fofi/FoFiBase.h index 7384276..745bc92 100644 --- a/include/poppler/fofi/FoFiBase.h +++ b/include/poppler/fofi/FoFiBase.h @@ -23,8 +23,6 @@ #ifndef FOFIBASE_H #define FOFIBASE_H -#include "goo/gtypes.h" - //------------------------------------------------------------------------ typedef void (*FoFiOutputFunc)(void *stream, const char *data, int len); @@ -53,13 +51,13 @@ class FoFiBase { int getS16BE(int pos, bool *ok) const; int getU16BE(int pos, bool *ok) const; int getS32BE(int pos, bool *ok) const; - Guint getU32BE(int pos, bool *ok) const; - Guint getU32LE(int pos, bool *ok) const; - Guint getUVarBE(int pos, int size, bool *ok) const; + unsigned int getU32BE(int pos, bool *ok) const; + unsigned int getU32LE(int pos, bool *ok) const; + unsigned int getUVarBE(int pos, int size, bool *ok) const; bool checkRegion(int pos, int size) const; - const Guchar *file; + const unsigned char *file; int len; bool freeFileData; }; diff --git a/include/poppler/fofi/FoFiEncodings.h b/include/poppler/fofi/FoFiEncodings.h index c27a370..c4fbf48 100644 --- a/include/poppler/fofi/FoFiEncodings.h +++ b/include/poppler/fofi/FoFiEncodings.h @@ -23,8 +23,6 @@ #ifndef FOFIENCODINGS_H #define FOFIENCODINGS_H -#include "goo/gtypes.h" - //------------------------------------------------------------------------ // Type 1 and 1C font data //------------------------------------------------------------------------ @@ -37,8 +35,8 @@ extern const char * const fofiType1ExpertEncoding[256]; //------------------------------------------------------------------------ extern const char *fofiType1CStdStrings[391]; -extern Gushort fofiType1CISOAdobeCharset[229]; -extern Gushort fofiType1CExpertCharset[166]; -extern Gushort fofiType1CExpertSubsetCharset[87]; +extern unsigned short fofiType1CISOAdobeCharset[229]; +extern unsigned short fofiType1CExpertCharset[166]; +extern unsigned short fofiType1CExpertSubsetCharset[87]; #endif diff --git a/include/poppler/fofi/FoFiTrueType.h b/include/poppler/fofi/FoFiTrueType.h index 3f2a1b7..ee35e4f 100644 --- a/include/poppler/fofi/FoFiTrueType.h +++ b/include/poppler/fofi/FoFiTrueType.h @@ -31,7 +31,6 @@ #include "stddef.h" #include #include -#include "goo/gtypes.h" #include "FoFiBase.h" class GooString; @@ -71,11 +70,11 @@ class FoFiTrueType: public FoFiBase { int findCmap(int platform, int encoding) const; // Return the GID corresponding to according to the th cmap. - int mapCodeToGID(int i, Guint c) const; + int mapCodeToGID(int i, unsigned int c) const; // map gid to vertical glyph gid if exist. // if not exist return original gid - Guint mapToVertGID(Guint orgGID); + unsigned int mapToVertGID(unsigned int orgGID); // Returns the GID corresponding to according to the post // table. Returns 0 if there is no mapping for or if the @@ -177,18 +176,18 @@ class FoFiTrueType: public FoFiBase { void *outputStream, GooString *name, bool needVerticalMetrics, int *maxUsedGlyph) const; - void dumpString(const Guchar *s, int length, + void dumpString(const unsigned char *s, int length, FoFiOutputFunc outputFunc, void *outputStream) const; - Guint computeTableChecksum(const Guchar *data, int length) const; + unsigned int computeTableChecksum(const unsigned char *data, int length) const; void parse(); void readPostTable(); int seekTable(const char *tag) const; - Guint charToTag(const char *tagName); - Guint doMapToVertGID(Guint orgGID); - Guint scanLookupList(Guint listIndex, Guint orgGID); - Guint scanLookupSubTable(Guint subTable, Guint orgGID); - int checkGIDInCoverage(Guint coverage, Guint orgGID); + unsigned int charToTag(const char *tagName); + unsigned int doMapToVertGID(unsigned int orgGID); + unsigned int scanLookupList(unsigned int listIndex, unsigned int orgGID); + unsigned int scanLookupSubTable(unsigned int subTable, unsigned int orgGID); + int checkGIDInCoverage(unsigned int coverage, unsigned int orgGID); TrueTypeTable *tables; int nTables; @@ -202,8 +201,8 @@ class FoFiTrueType: public FoFiBase { bool parsedOk; int faceIndex; - Guint gsubFeatureTable; - Guint gsubLookupList; + unsigned int gsubFeatureTable; + unsigned int gsubLookupList; }; #endif diff --git a/include/poppler/fofi/FoFiType1.h b/include/poppler/fofi/FoFiType1.h index 313b298..b8d3a43 100644 --- a/include/poppler/fofi/FoFiType1.h +++ b/include/poppler/fofi/FoFiType1.h @@ -23,7 +23,6 @@ #ifndef FOFITYPE1_H #define FOFITYPE1_H -#include "goo/gtypes.h" #include "FoFiBase.h" //------------------------------------------------------------------------ diff --git a/include/poppler/fofi/FoFiType1C.h b/include/poppler/fofi/FoFiType1C.h index 0c7884f..920abdd 100644 --- a/include/poppler/fofi/FoFiType1C.h +++ b/include/poppler/fofi/FoFiType1C.h @@ -25,7 +25,6 @@ #ifndef FOFITYPE1C_H #define FOFITYPE1C_H -#include "goo/gtypes.h" #include "FoFiBase.h" class GooString; @@ -133,7 +132,7 @@ struct Type1CEexecBuf { FoFiOutputFunc outputFunc; void *outputStream; bool ascii; // ASCII encoding? - Gushort r1; // eexec encryption key + unsigned short r1; // eexec encryption key int line; // number of eexec chars left on current line }; @@ -216,7 +215,7 @@ class FoFiType1C: public FoFiBase { Type1CPrivateDict *pDict); void cvtNum(double x, bool isFP, GooString *charBuf) const; void eexecWrite(Type1CEexecBuf *eb, const char *s) const; - void eexecWriteCharstring(Type1CEexecBuf *eb, const Guchar *s, int n) const; + void eexecWriteCharstring(Type1CEexecBuf *eb, const unsigned char *s, int n) const; void writePSString(const char *s, FoFiOutputFunc outputFunc, void *outputStream) const; bool parse(); void readTopDict(); @@ -246,9 +245,9 @@ class FoFiType1C: public FoFiBase { int nGlyphs; int nFDs; - Guchar *fdSelect; - Gushort *charset; - Gushort charsetLength; + unsigned char *fdSelect; + unsigned short *charset; + unsigned short charsetLength; int gsubrBias; bool parsedOk; diff --git a/include/poppler/goo/FixedPoint.h b/include/poppler/goo/FixedPoint.h index 9ba5ed7..960c5bd 100644 --- a/include/poppler/goo/FixedPoint.h +++ b/include/poppler/goo/FixedPoint.h @@ -32,7 +32,6 @@ #include #include -#include "gtypes.h" #define fixptShift 16 #define fixptMaskL ((1 << fixptShift) - 1) diff --git a/include/poppler/goo/GooString.h b/include/poppler/goo/GooString.h index 5d0986f..bae3a18 100644 --- a/include/poppler/goo/GooString.h +++ b/include/poppler/goo/GooString.h @@ -36,8 +36,6 @@ #include #include -#include "gtypes.h" - #ifdef __clang__ # define GOOSTRING_FORMAT __attribute__((__annotate__("gooformat"))) #else diff --git a/include/poppler/goo/GooTimer.h b/include/poppler/goo/GooTimer.h index 9df747b..6e8e5b5 100644 --- a/include/poppler/goo/GooTimer.h +++ b/include/poppler/goo/GooTimer.h @@ -18,7 +18,6 @@ #define GOOTIMER_H #include "poppler-config.h" -#include "gtypes.h" #ifdef HAVE_GETTIMEOFDAY #include #endif diff --git a/include/poppler/goo/gdir.h b/include/poppler/goo/gdir.h index 505b4b0..7d39c49 100644 --- a/include/poppler/goo/gdir.h +++ b/include/poppler/goo/gdir.h @@ -35,7 +35,6 @@ #define GDIR_H #include "poppler-config.h" -#include "gtypes.h" class GooString; diff --git a/include/poppler/goo/gfile.h b/include/poppler/goo/gfile.h index daf99dc..e6ab2d9 100644 --- a/include/poppler/goo/gfile.h +++ b/include/poppler/goo/gfile.h @@ -25,6 +25,7 @@ // Copyright (C) 2017 Christoph Cullmann // Copyright (C) 2017 Thomas Freitag // Copyright (C) 2018 Mojca Miklavec +// Copyright (C) 2019 Christian Persch // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -76,16 +77,25 @@ extern "C" { # endif #endif } -#include "gtypes.h" class GooString; +/* Integer type for all file offsets and file sizes */ +typedef long long Goffset; + //------------------------------------------------------------------------ // Append a file name to a path string. may be an empty // string, denoting the current directory). Returns . extern GooString *appendToPath(GooString *path, const char *fileName); +#ifndef _WIN32 +// Open a file descriptor +// Could be implemented on WIN32 too, but the only external caller of +// this function is not used on WIN32 +extern int openFileDescriptor(const char *path, int flags); +#endif + // Open a file. On Windows, this converts the path from UTF-8 to // UCS-2 and calls _wfopen (if available). On other OSes, this simply // calls fopen. diff --git a/include/poppler/goo/grandom.h b/include/poppler/goo/grandom.h index 63bca38..8153272 100644 --- a/include/poppler/goo/grandom.h +++ b/include/poppler/goo/grandom.h @@ -12,10 +12,8 @@ #ifndef GRANDOM_H #define GRANDOM_H -#include "gtypes.h" - /// Fills the given buffer with random bytes -void grandom_fill(Guchar *buff, int size); +void grandom_fill(unsigned char *buff, int size); /// Returns a random number in [0,1) double grandom_double(); diff --git a/include/poppler/goo/gtypes.h b/include/poppler/goo/gtypes.h deleted file mode 100644 index 922cf90..0000000 --- a/include/poppler/goo/gtypes.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * gtypes.h - * - * Some useful simple types. - * - * Copyright 1996-2003 Glyph & Cog, LLC - */ - -//======================================================================== -// -// Modified under the Poppler project - http://poppler.freedesktop.org -// -// All changes made under the Poppler project to this file are licensed -// under GPL version 2 or later -// -// Copyright (C) 2010 Patrick Spendrin -// Copyright (C) 2010 Albert Astals Cid -// Copyright (C) 2013 Adrian Johnson -// -// To see a description of the changes please see the Changelog file that -// came with your tarball or type make ChangeLog if you are building from git -// -//======================================================================== - -#ifndef GTYPES_H -#define GTYPES_H - -#include "poppler-config.h" - -/* - * These have stupid names to avoid conflicts with , - * which on various systems defines some random subset of these. - */ -typedef unsigned char Guchar; -typedef unsigned short Gushort; -typedef unsigned int Guint; -typedef unsigned long Gulong; -typedef long long Goffset; - -#endif diff --git a/include/poppler/poppler-config.h b/include/poppler/poppler-config.h index 6ba97e3..aa5edda 100644 --- a/include/poppler/poppler-config.h +++ b/include/poppler/poppler-config.h @@ -34,7 +34,7 @@ /* Defines the poppler version. */ #ifndef POPPLER_VERSION -#define POPPLER_VERSION "0.72.1" +#define POPPLER_VERSION "0.73.0" #endif /* Use fixedpoint. */ @@ -120,7 +120,7 @@ //------------------------------------------------------------------------ // copyright notice -#define popplerCopyright "Copyright 2005-2018 The Poppler Developers - http://poppler.freedesktop.org" +#define popplerCopyright "Copyright 2005-2019 The Poppler Developers - http://poppler.freedesktop.org" #define xpdfCopyright "Copyright 1996-2011 Glyph & Cog, LLC" //------------------------------------------------------------------------ diff --git a/include/poppler/splash/Splash.h b/include/poppler/splash/Splash.h index 97ed32e..35d61f1 100644 --- a/include/poppler/splash/Splash.h +++ b/include/poppler/splash/Splash.h @@ -50,7 +50,7 @@ typedef bool (*SplashImageMaskSource)(void *data, SplashColorPtr pixel); // * and returns true. If the image stream is exhausted, // returns false. typedef bool (*SplashImageSource)(void *data, SplashColorPtr colorLine, - Guchar *alphaLine); + unsigned char *alphaLine); // Use ICCColorSpace to transform a bitmap typedef void (*SplashICCTransform)(void *data, SplashBitmap *bitmap); @@ -153,8 +153,8 @@ class Splash { void setSoftMask(SplashBitmap *softMask); void setInNonIsolatedGroup(SplashBitmap *alpha0BitmapA, int alpha0XA, int alpha0YA); - void setTransfer(Guchar *red, Guchar *green, Guchar *blue, Guchar *gray); - void setOverprintMask(Guint overprintMask, bool additive); + void setTransfer(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *gray); + void setOverprintMask(unsigned int overprintMask, bool additive); //----- state save/restore @@ -164,7 +164,7 @@ class Splash { //----- drawing operations // Fill the bitmap with . This is not subject to clipping. - void clear(SplashColorPtr color, Guchar alpha = 0x00); + void clear(SplashColorPtr color, unsigned char alpha = 0x00); // Stroke a path using the current stroke pattern. SplashError stroke(SplashPath *path); @@ -288,9 +288,9 @@ class Splash { void pipeInit(SplashPipe *pipe, int x, int y, SplashPattern *pattern, SplashColorPtr cSrc, - Guchar aInput, bool usesShape, + unsigned char aInput, bool usesShape, bool nonIsolatedGroup, - bool knockout = false, Guchar knockoutOpacity = 255); + bool knockout = false, unsigned char knockoutOpacity = 255); void pipeRun(SplashPipe *pipe); void pipeRunSimpleMono1(SplashPipe *pipe); void pipeRunSimpleMono8(SplashPipe *pipe); @@ -316,7 +316,7 @@ class Splash { void drawAAPixelInit(); void drawAAPixel(SplashPipe *pipe, int x, int y); void drawSpan(SplashPipe *pipe, int x0, int x1, int y, bool noClip); - void drawAALine(SplashPipe *pipe, int x0, int x1, int y, bool adjustLine = false, Guchar lineOpacity = 0); + void drawAALine(SplashPipe *pipe, int x0, int x1, int y, bool adjustLine = false, unsigned char lineOpacity = 0); void transform(SplashCoord *matrix, SplashCoord xi, SplashCoord yi, SplashCoord *xo, SplashCoord *yo); void updateModX(int x); diff --git a/include/poppler/splash/SplashBitmap.h b/include/poppler/splash/SplashBitmap.h index 6dad56f..b824e63 100644 --- a/include/poppler/splash/SplashBitmap.h +++ b/include/poppler/splash/SplashBitmap.h @@ -66,7 +66,7 @@ class SplashBitmap { int getRowPad() { return rowPad; } SplashColorMode getMode() { return mode; } SplashColorPtr getDataPtr() { return data; } - Guchar *getAlphaPtr() { return alpha; } + unsigned char *getAlphaPtr() { return alpha; } GooList *getSeparationList() { return separationList; } SplashError writePNMFile(char *fileName); @@ -100,7 +100,7 @@ class SplashBitmap { #ifdef SPLASH_CMYK void getCMYKLine(int y, SplashColorPtr line); #endif - Guchar getAlpha(int x, int y); + unsigned char getAlpha(int x, int y); // Caller takes ownership of the bitmap data. The SplashBitmap // object is no longer valid -- the next call should be to the @@ -115,7 +115,7 @@ class SplashBitmap { // - negative for bottom-up bitmaps SplashColorMode mode; // color mode SplashColorPtr data; // pointer to row zero of the color data - Guchar *alpha; // pointer to row zero of the alpha data + unsigned char *alpha; // pointer to row zero of the alpha data // (always top-down) GooList *separationList; // list of spot colorants and their mapping functions diff --git a/include/poppler/splash/SplashClip.h b/include/poppler/splash/SplashClip.h index 7b587d2..ddc4897 100644 --- a/include/poppler/splash/SplashClip.h +++ b/include/poppler/splash/SplashClip.h @@ -66,7 +66,7 @@ class SplashClip { SplashError clipToRect(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoord y1); - // Interesect the clip with . + // Intersect the clip with . SplashError clipToPath(SplashPath *path, SplashCoord *matrix, SplashCoord flatness, bool eo); @@ -143,7 +143,7 @@ class SplashClip { SplashCoord xMin, yMin, xMax, yMax; int xMinI, yMinI, xMaxI, yMaxI; SplashXPath **paths; - Guchar *flags; + unsigned char *flags; SplashXPathScanner **scanners; int length, size; }; diff --git a/include/poppler/splash/SplashFTFontEngine.h b/include/poppler/splash/SplashFTFontEngine.h index ec1ad4d..5e1d595 100644 --- a/include/poppler/splash/SplashFTFontEngine.h +++ b/include/poppler/splash/SplashFTFontEngine.h @@ -28,7 +28,6 @@ #include #include FT_FREETYPE_H -#include "goo/gtypes.h" class SplashFontFile; class SplashFontFileID; diff --git a/include/poppler/splash/SplashFTFontFile.h b/include/poppler/splash/SplashFTFontFile.h index a73c671..e5e0e94 100644 --- a/include/poppler/splash/SplashFTFontFile.h +++ b/include/poppler/splash/SplashFTFontFile.h @@ -58,9 +58,6 @@ class SplashFTFontFile: public SplashFontFile { SplashFont *makeFont(SplashCoord *mat, const SplashCoord *textMat) override; - // Provide access to the code-to-GID map - int* getCodeToGID(); - private: SplashFTFontFile(SplashFTFontEngine *engineA, diff --git a/include/poppler/splash/SplashFont.h b/include/poppler/splash/SplashFont.h index 8a5109d..45875c9 100644 --- a/include/poppler/splash/SplashFont.h +++ b/include/poppler/splash/SplashFont.h @@ -22,7 +22,6 @@ #ifndef SPLASHFONT_H #define SPLASHFONT_H -#include "goo/gtypes.h" #include "SplashTypes.h" #include "SplashClip.h" @@ -109,7 +108,7 @@ class SplashFont { // (text space -> user space) bool aa; // anti-aliasing int xMin, yMin, xMax, yMax; // glyph bounding box - Guchar *cache; // glyph bitmap cache + unsigned char *cache; // glyph bitmap cache SplashFontCacheTag * // cache tags cacheTags; int glyphW, glyphH; // size of glyph bitmaps diff --git a/include/poppler/splash/SplashFontEngine.h b/include/poppler/splash/SplashFontEngine.h index 84334f5..44396af 100644 --- a/include/poppler/splash/SplashFontEngine.h +++ b/include/poppler/splash/SplashFontEngine.h @@ -29,7 +29,6 @@ #include -#include "goo/gtypes.h" #include "SplashTypes.h" class SplashT1FontEngine; diff --git a/include/poppler/splash/SplashFontFile.h b/include/poppler/splash/SplashFontFile.h index aa1c267..133a144 100644 --- a/include/poppler/splash/SplashFontFile.h +++ b/include/poppler/splash/SplashFontFile.h @@ -22,7 +22,6 @@ #ifndef SPLASHFONTFILE_H #define SPLASHFONTFILE_H -#include "goo/gtypes.h" #include "SplashTypes.h" class GooString; diff --git a/include/poppler/splash/SplashFontFileID.h b/include/poppler/splash/SplashFontFileID.h index e3fc599..35487f2 100644 --- a/include/poppler/splash/SplashFontFileID.h +++ b/include/poppler/splash/SplashFontFileID.h @@ -21,8 +21,6 @@ #ifndef SPLASHFONTFILEID_H #define SPLASHFONTFILEID_H -#include "goo/gtypes.h" - //------------------------------------------------------------------------ // SplashFontFileID //------------------------------------------------------------------------ diff --git a/include/poppler/splash/SplashGlyphBitmap.h b/include/poppler/splash/SplashGlyphBitmap.h index 6133290..d9ef907 100644 --- a/include/poppler/splash/SplashGlyphBitmap.h +++ b/include/poppler/splash/SplashGlyphBitmap.h @@ -7,8 +7,6 @@ #ifndef SPLASHGLYPHBITMAP_H #define SPLASHGLYPHBITMAP_H -#include "goo/gtypes.h" - //------------------------------------------------------------------------ // SplashGlyphBitmap //------------------------------------------------------------------------ @@ -17,7 +15,7 @@ struct SplashGlyphBitmap { int x, y, w, h; // offset and size of glyph bool aa; // anti-aliased: true means 8-bit alpha // bitmap; false means 1-bit - Guchar *data; // bitmap data + unsigned char *data; // bitmap data bool freeData; // true if data memory should be freed }; diff --git a/include/poppler/splash/SplashMath.h b/include/poppler/splash/SplashMath.h index 7e7696a..8edcf18 100644 --- a/include/poppler/splash/SplashMath.h +++ b/include/poppler/splash/SplashMath.h @@ -50,7 +50,7 @@ static inline int splashFloor(SplashCoord x) { // floor() and (int)() are implemented separately, which results // in changing the FPCW multiple times - so we optimize it with // some inline assembly - Gushort oldCW, newCW, t; + unsigned short oldCW, newCW, t; int result; __asm__ volatile("fldl %4\n" @@ -69,7 +69,7 @@ static inline int splashFloor(SplashCoord x) { // floor() and (int)() are implemented separately, which results // in changing the FPCW multiple times - so we optimize it with // some inline assembly - Gushort oldCW, newCW; + unsigned short oldCW, newCW; int result; __asm fld QWORD PTR x @@ -97,7 +97,7 @@ static inline int splashCeil(SplashCoord x) { // ceil() and (int)() are implemented separately, which results // in changing the FPCW multiple times - so we optimize it with // some inline assembly - Gushort oldCW, newCW, t; + unsigned short oldCW, newCW, t; int result; __asm__ volatile("fldl %4\n" @@ -116,7 +116,7 @@ static inline int splashCeil(SplashCoord x) { // ceil() and (int)() are implemented separately, which results // in changing the FPCW multiple times - so we optimize it with // some inline assembly - Gushort oldCW, newCW; + unsigned short oldCW, newCW; int result; __asm fld QWORD PTR x @@ -141,7 +141,7 @@ static inline int splashRound(SplashCoord x) { // this could use round-to-nearest mode and avoid the "+0.5", // but that produces slightly different results (because i+0.5 // sometimes rounds up and sometimes down using the even rule) - Gushort oldCW, newCW, t; + unsigned short oldCW, newCW, t; int result; x += 0.5; @@ -161,7 +161,7 @@ static inline int splashRound(SplashCoord x) { // this could use round-to-nearest mode and avoid the "+0.5", // but that produces slightly different results (because i+0.5 // sometimes rounds up and sometimes down using the even rule) - Gushort oldCW, newCW; + unsigned short oldCW, newCW; int result; x += 0.5; diff --git a/include/poppler/splash/SplashPath.h b/include/poppler/splash/SplashPath.h index a44732d..e20d533 100644 --- a/include/poppler/splash/SplashPath.h +++ b/include/poppler/splash/SplashPath.h @@ -107,7 +107,7 @@ class SplashPath { // Get the points on the path. int getLength() { return length; } - void getPoint(int i, double *x, double *y, Guchar *f) + void getPoint(int i, double *x, double *y, unsigned char *f) { *x = pts[i].x; *y = pts[i].y; *f = flags[i]; } // Get the current point. @@ -125,7 +125,7 @@ class SplashPath { bool openSubpath() { return curSubpath < length - 1; } SplashPathPoint *pts; // array of points - Guchar *flags; // array of flags + unsigned char *flags; // array of flags int length, size; // length/size of the pts and flags arrays int curSubpath; // index of first point in last subpath diff --git a/include/poppler/splash/SplashScreen.h b/include/poppler/splash/SplashScreen.h index 9d4c880..da29a2f 100644 --- a/include/poppler/splash/SplashScreen.h +++ b/include/poppler/splash/SplashScreen.h @@ -43,7 +43,7 @@ class SplashScreen { // Return the computed pixel value (0=black, 1=white) for the gray // level at (, ). - int test(int x, int y, Guchar value) { + int test(int x, int y, unsigned char value) { int xx, yy; if (mat == nullptr) createMatrix(); xx = x & sizeM1; @@ -54,7 +54,7 @@ class SplashScreen { // Returns true if value is above the white threshold or below the // black threshold, i.e., if the corresponding halftone will be // solid white or black. - bool isStatic(Guchar value) { if (mat == nullptr) createMatrix(); return value < minVal || value >= maxVal; } + bool isStatic(unsigned char value) { if (mat == nullptr) createMatrix(); return value < minVal || value >= maxVal; } private: void createMatrix(); @@ -66,13 +66,13 @@ class SplashScreen { void buildSCDMatrix(int r); SplashScreenParams *screenParams; // params to create the other members - Guchar *mat; // threshold matrix + unsigned char *mat; // threshold matrix int size; // size of the threshold matrix int sizeM1; // size - 1 int log2Size; // log2(size) - Guchar minVal; // any pixel value below minVal generates + unsigned char minVal; // any pixel value below minVal generates // solid black - Guchar maxVal; // any pixel value above maxVal generates + unsigned char maxVal; // any pixel value above maxVal generates // solid white }; diff --git a/include/poppler/splash/SplashState.h b/include/poppler/splash/SplashState.h index ec0bc5d..e367f5f 100644 --- a/include/poppler/splash/SplashState.h +++ b/include/poppler/splash/SplashState.h @@ -89,7 +89,7 @@ class SplashState { void setOverprintMode(int overprintModeA) { overprintMode = overprintModeA; } // Set the transfer function. - void setTransfer(Guchar *red, Guchar *green, Guchar *blue, Guchar *gray); + void setTransfer(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *gray); private: @@ -121,18 +121,18 @@ class SplashState { bool fillOverprint; bool strokeOverprint; int overprintMode; - Guchar rgbTransferR[256], + unsigned char rgbTransferR[256], rgbTransferG[256], rgbTransferB[256]; - Guchar grayTransfer[256]; + unsigned char grayTransfer[256]; #ifdef SPLASH_CMYK - Guchar cmykTransferC[256], + unsigned char cmykTransferC[256], cmykTransferM[256], cmykTransferY[256], cmykTransferK[256]; - Guchar deviceNTransfer[SPOT_NCOMPS+4][256]; + unsigned char deviceNTransfer[SPOT_NCOMPS+4][256]; #endif - Guint overprintMask; + unsigned int overprintMask; bool overprintAdditive; SplashState *next; // used by Splash class diff --git a/include/poppler/splash/SplashTypes.h b/include/poppler/splash/SplashTypes.h index 1bede11..812225a 100644 --- a/include/poppler/splash/SplashTypes.h +++ b/include/poppler/splash/SplashTypes.h @@ -27,8 +27,6 @@ #ifndef SPLASHTYPES_H #define SPLASHTYPES_H -#include "goo/gtypes.h" - //------------------------------------------------------------------------ // coordinates //------------------------------------------------------------------------ @@ -93,32 +91,32 @@ extern int splashColorModeNComps[]; #define splashMaxColorComps 4 #endif -typedef Guchar SplashColor[splashMaxColorComps]; -typedef Guchar *SplashColorPtr; +typedef unsigned char SplashColor[splashMaxColorComps]; +typedef unsigned char *SplashColorPtr; // RGB8 -static inline Guchar splashRGB8R(SplashColorPtr rgb8) { return rgb8[0]; } -static inline Guchar splashRGB8G(SplashColorPtr rgb8) { return rgb8[1]; } -static inline Guchar splashRGB8B(SplashColorPtr rgb8) { return rgb8[2]; } +static inline unsigned char splashRGB8R(SplashColorPtr rgb8) { return rgb8[0]; } +static inline unsigned char splashRGB8G(SplashColorPtr rgb8) { return rgb8[1]; } +static inline unsigned char splashRGB8B(SplashColorPtr rgb8) { return rgb8[2]; } // BGR8 -static inline Guchar splashBGR8R(SplashColorPtr bgr8) { return bgr8[2]; } -static inline Guchar splashBGR8G(SplashColorPtr bgr8) { return bgr8[1]; } -static inline Guchar splashBGR8B(SplashColorPtr bgr8) { return bgr8[0]; } +static inline unsigned char splashBGR8R(SplashColorPtr bgr8) { return bgr8[2]; } +static inline unsigned char splashBGR8G(SplashColorPtr bgr8) { return bgr8[1]; } +static inline unsigned char splashBGR8B(SplashColorPtr bgr8) { return bgr8[0]; } #ifdef SPLASH_CMYK // CMYK8 -static inline Guchar splashCMYK8C(SplashColorPtr cmyk8) { return cmyk8[0]; } -static inline Guchar splashCMYK8M(SplashColorPtr cmyk8) { return cmyk8[1]; } -static inline Guchar splashCMYK8Y(SplashColorPtr cmyk8) { return cmyk8[2]; } -static inline Guchar splashCMYK8K(SplashColorPtr cmyk8) { return cmyk8[3]; } +static inline unsigned char splashCMYK8C(SplashColorPtr cmyk8) { return cmyk8[0]; } +static inline unsigned char splashCMYK8M(SplashColorPtr cmyk8) { return cmyk8[1]; } +static inline unsigned char splashCMYK8Y(SplashColorPtr cmyk8) { return cmyk8[2]; } +static inline unsigned char splashCMYK8K(SplashColorPtr cmyk8) { return cmyk8[3]; } // DEVICEN8 -static inline Guchar splashDeviceN8C(SplashColorPtr deviceN8) { return deviceN8[0]; } -static inline Guchar splashDeviceN8M(SplashColorPtr deviceN8) { return deviceN8[1]; } -static inline Guchar splashDeviceN8Y(SplashColorPtr deviceN8) { return deviceN8[2]; } -static inline Guchar splashDeviceN8K(SplashColorPtr deviceN8) { return deviceN8[3]; } -static inline Guchar splashDeviceN8S(SplashColorPtr deviceN8, int nSpot) { return deviceN8[4 + nSpot]; } +static inline unsigned char splashDeviceN8C(SplashColorPtr deviceN8) { return deviceN8[0]; } +static inline unsigned char splashDeviceN8M(SplashColorPtr deviceN8) { return deviceN8[1]; } +static inline unsigned char splashDeviceN8Y(SplashColorPtr deviceN8) { return deviceN8[2]; } +static inline unsigned char splashDeviceN8K(SplashColorPtr deviceN8) { return deviceN8[3]; } +static inline unsigned char splashDeviceN8S(SplashColorPtr deviceN8, int nSpot) { return deviceN8[4 + nSpot]; } #endif static inline void splashClearColor(SplashColorPtr dest) { diff --git a/include/poppler/splash/SplashXPath.h b/include/poppler/splash/SplashXPath.h index 14d5f72..cf9705a 100644 --- a/include/poppler/splash/SplashXPath.h +++ b/include/poppler/splash/SplashXPath.h @@ -40,7 +40,7 @@ struct SplashXPathSeg { SplashCoord x1, y1; // second endpoint SplashCoord dxdy; // slope: delta-x / delta-y SplashCoord dydx; // slope: delta-y / delta-x - Guint flags; + unsigned int flags; }; #define splashXPathHoriz 0x01 // segment is vertical (y0 == y1) diff --git a/lib-4.9.3/i386/libpoppler-cpp.a b/lib-4.9.3/i386/libpoppler-cpp.a index 7bbe06c..123bb6d 100644 Binary files a/lib-4.9.3/i386/libpoppler-cpp.a and b/lib-4.9.3/i386/libpoppler-cpp.a differ diff --git a/lib-4.9.3/i386/libpoppler.a b/lib-4.9.3/i386/libpoppler.a index c599d8a..056cc2e 100644 Binary files a/lib-4.9.3/i386/libpoppler.a and b/lib-4.9.3/i386/libpoppler.a differ diff --git a/lib-4.9.3/x64/libpoppler-cpp.a b/lib-4.9.3/x64/libpoppler-cpp.a index a11f426..402cc48 100644 Binary files a/lib-4.9.3/x64/libpoppler-cpp.a and b/lib-4.9.3/x64/libpoppler-cpp.a differ diff --git a/lib-4.9.3/x64/libpoppler.a b/lib-4.9.3/x64/libpoppler.a index bf7fa9d..90755be 100644 Binary files a/lib-4.9.3/x64/libpoppler.a and b/lib-4.9.3/x64/libpoppler.a differ diff --git a/lib/i386/libpoppler-cpp.a b/lib/i386/libpoppler-cpp.a index b0be00a..e7c0b26 100644 Binary files a/lib/i386/libpoppler-cpp.a and b/lib/i386/libpoppler-cpp.a differ diff --git a/lib/i386/libpoppler.a b/lib/i386/libpoppler.a index c3b9af8..fceca7e 100644 Binary files a/lib/i386/libpoppler.a and b/lib/i386/libpoppler.a differ diff --git a/lib/x64/libpoppler-cpp.a b/lib/x64/libpoppler-cpp.a index bc870ce..36b80b2 100644 Binary files a/lib/x64/libpoppler-cpp.a and b/lib/x64/libpoppler-cpp.a differ diff --git a/lib/x64/libpoppler.a b/lib/x64/libpoppler.a index c01ec91..0b83675 100644 Binary files a/lib/x64/libpoppler.a and b/lib/x64/libpoppler.a differ diff --git a/mingw-w64-poppler/004-basename-include.patch b/mingw-w64-poppler/004-basename-include.patch deleted file mode 100644 index a7fd7f1..0000000 --- a/mingw-w64-poppler/004-basename-include.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- poppler-0.64.0/utils/pdfsig.cc.orig 2018-04-20 07:58:26.204947200 +0300 -+++ poppler-0.64.0/utils/pdfsig.cc 2018-04-20 07:57:26.815642900 +0300 -@@ -34,6 +34,7 @@ - #include "SignatureInfo.h" - #include "Win32Console.h" - #include "numberofcharacters.h" -+#include - - static const char * getReadableSigState(SignatureValidationStatus sig_vs) - { -@@ -91,7 +92,7 @@ - return time_str; - } - --static void dumpSignature(int sig_num, int sigCount, FormWidgetSignature *sig_widget, const char *filename) -+static void dumpSignature(int sig_num, int sigCount, FormWidgetSignature *sig_widget, char *filename) - { - const GooString *signature = sig_widget->getSignature(); - if (!signature) { diff --git a/mingw-w64-poppler/005-openjpeg2-include-dirs.patch b/mingw-w64-poppler/005-openjpeg2-include-dirs.patch deleted file mode 100644 index 7ddba82..0000000 --- a/mingw-w64-poppler/005-openjpeg2-include-dirs.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- poppler-0.68.0/CMakeLists.txt.orig 2018-08-21 10:29:01.835136600 +0300 -+++ poppler-0.68.0/CMakeLists.txt 2018-08-21 10:29:51.156957700 +0300 -@@ -206,6 +206,7 @@ - if(NOT OpenJPEG_FOUND OR OPENJPEG_MAJOR_VERSION VERSION_LESS 2) - message(FATAL_ERROR "Install libopenjpeg2 before trying to build poppler. You can also decide to use the internal unmaintained JPX decoder or none at all.") - endif() -+ include_directories(${OPENJPEG_INCLUDE_DIRS}) - set(HAVE_JPX_DECODER ON) - elseif(ENABLE_LIBOPENJPEG STREQUAL "unmaintained") - set(WITH_OPENJPEG OFF) diff --git a/mingw-w64-poppler/PKGBUILD b/mingw-w64-poppler/PKGBUILD index a3fb8e2..3b638c8 100644 --- a/mingw-w64-poppler/PKGBUILD +++ b/mingw-w64-poppler/PKGBUILD @@ -1,7 +1,7 @@ _realname=poppler pkgbase=mingw-w64-${_realname} -pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=0.72.0 +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-backport" +pkgver=0.73.0 pkgrel=1 pkgdesc="PDF rendering library based on xpdf 3.0 (mingw-w64)" arch=('any') @@ -21,37 +21,26 @@ depends=("${MINGW_PACKAGE_PREFIX}-cairo" "${MINGW_PACKAGE_PREFIX}-zlib") options=('strip' 'staticlibs') source=("https://poppler.freedesktop.org/${_realname}-${pkgver}.tar.xz" - 004-basename-include.patch - 005-openjpeg2-include-dirs.patch - static-mingw.patch - backports.patch - gcc493.patch) -sha256sums=('c1747eb8f26e9e753c4001ed951db2896edc1021b6d0f547a0bd2a27c30ada51' - 'a0d1dfb3d5e698cc8d3348b108ede52d44165122e57754c6a696efe745e93030' - 'c2e401f94739a15125c06041eef2e4f988355422aa35aaea2144f7dc7bdfa047' - 'SKIP' - 'SKIP' + "gcc493.patch") +sha256sums=('e44b5543903128884ba4538c2a97d3bcc8889e97ffacc4636112101f0238db03' 'SKIP') prepare() { cd ${_realname}-${pkgver} - patch -p1 -i ${srcdir}/004-basename-include.patch - patch -p1 -i ${srcdir}/005-openjpeg2-include-dirs.patch - patch -p1 -i ${srcdir}/static-mingw.patch - patch -p1 -i ${srcdir}/backports.patch patch -p1 -i ${srcdir}/gcc493.patch } build() { [[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST} mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST} - - export CC="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin/gcc" - export CXX="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin/g++" - export LIBS="-L${MINGW_PREFIX}/lib" - export CPPFLAGS="-DOPJ_STATIC -Dpoppler_cpp_EXPORTS" - export CFLAGS=$CPPFLAGS - export CXXFLAGS=$CPPFLAGS + + export CPPFLAGS="-I${MINGW_PREFIX}/include -DOPJ_STATIC -Dpoppler_cpp_EXPORTS" + export CC="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin/gcc $CPPFLAGS" + export CXX="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin/g++ $CPPFLAGS" + export PATH="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin:$PATH" + + # Also set -DCMAKE_EXE_LINKER_FLAGS ! + export LDFLAGS="-L${MINGW_PREFIX}/libs" unset PKG_CONFIG MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ @@ -61,7 +50,7 @@ build() { -DCMAKE_EXE_LINKER_FLAGS="-L${MINGW_PREFIX}/lib" \ -DCMAKE_CXX_STANDARD_LIBRARIES="$(pkg-config --libs-only-l --static cairo libtiff-4) -lfreetype -lWinspool -lMsimg32 -lComdlg32" \ -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ - -DENABLE_XPDF_HEADERS=ON \ + -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \ -DENABLE_GTK_DOC=OFF \ -DENABLE_GLIB=OFF \ -DENABLE_QT5=OFF \ @@ -72,6 +61,7 @@ build() { -DENABLE_UTILS=ON \ ../${_realname}-${pkgver} + CC="${MINGW_PREFIX}/bin/gcc.exe" \ PKG_CONFIG_PATH="${MINGW_PREFIX}/lib/pkgconfig" \ make } diff --git a/mingw-w64-poppler/backports.patch b/mingw-w64-poppler/backports.patch deleted file mode 100644 index 4a6a6d3..0000000 --- a/mingw-w64-poppler/backports.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -aurp poppler-0.72.0-orig/CMakeLists.txt poppler-0.72.0/CMakeLists.txt ---- poppler-0.72.0-orig/CMakeLists.txt 2018-12-10 10:32:37.091040000 +0000 -+++ poppler-0.72.0/CMakeLists.txt 2018-12-10 10:36:19.530546300 +0000 -@@ -37,7 +37,7 @@ endif() - - set(POPPLER_MAJOR_VERSION "0") - set(POPPLER_MINOR_VERSION "72") --set(POPPLER_MICRO_VERSION "0") -+set(POPPLER_MICRO_VERSION "1") - set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION}.${POPPLER_MICRO_VERSION}") - - set (CMAKE_CXX_STANDARD 14) -diff -aurp poppler-0.72.0-orig/cpp/poppler-global.cpp poppler-0.72.0/cpp/poppler-global.cpp ---- poppler-0.72.0-orig/cpp/poppler-global.cpp 2018-12-10 10:32:37.109040000 +0000 -+++ poppler-0.72.0/cpp/poppler-global.cpp 2018-12-10 10:32:58.368040000 +0000 -@@ -226,7 +226,11 @@ byte_array ustring::to_utf8() const - return byte_array(); - } - -- MiniIconv ic("UTF-8", "UTF-16"); -+#ifdef WORDS_BIGENDIAN -+ MiniIconv ic("UTF-8", "UTF-16BE"); -+#else -+ MiniIconv ic("UTF-8", "UTF-16LE"); -+#endif - if (!ic.is_valid()) { - return byte_array(); - } -@@ -274,7 +278,11 @@ ustring ustring::from_utf8(const char *s - } - } - -- MiniIconv ic("UTF-16", "UTF-8"); -+#ifdef WORDS_BIGENDIAN -+ MiniIconv ic("UTF-16BE", "UTF-8"); -+#else -+ MiniIconv ic("UTF-16LE", "UTF-8"); -+#endif - if (!ic.is_valid()) { - return ustring(); - } -diff -aurp poppler-0.72.0-orig/cpp/poppler-page.cpp poppler-0.72.0/cpp/poppler-page.cpp ---- poppler-0.72.0-orig/cpp/poppler-page.cpp 2018-12-10 10:32:37.106040000 +0000 -+++ poppler-0.72.0/cpp/poppler-page.cpp 2018-12-10 10:33:12.163810000 +0000 -@@ -365,7 +365,7 @@ std::vector page::text_list() - TextWord *word = word_list->get(i); - - std::unique_ptr gooWord{word->getText()}; -- ustring ustr = detail::unicode_GooString_to_ustring(gooWord.get()); -+ ustring ustr = ustring::from_utf8(gooWord->c_str()); - - double xMin, yMin, xMax, yMax; - word->getBBox(&xMin, &yMin, &xMax, &yMax); -diff -aurp poppler-0.72.0-orig/cpp/poppler-private.cpp poppler-0.72.0/cpp/poppler-private.cpp ---- poppler-0.72.0-orig/cpp/poppler-private.cpp 2018-12-10 10:32:37.139040000 +0000 -+++ poppler-0.72.0/cpp/poppler-private.cpp 2018-12-10 10:32:58.370040000 +0000 -@@ -93,7 +93,7 @@ ustring detail::unicode_GooString_to_ust - - ustring detail::unicode_to_ustring(const Unicode *u, int length) - { -- ustring str(length * 2, 0); -+ ustring str(length, 0); - ustring::iterator it = str.begin(); - const Unicode *uu = u; - for (int i = 0; i < length; ++i) { diff --git a/mingw-w64-poppler/static-mingw.patch b/mingw-w64-poppler/static-mingw.patch deleted file mode 100644 index 05863de..0000000 --- a/mingw-w64-poppler/static-mingw.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -aurp poppler-0.72.0-orig/CMakeLists.txt poppler-0.72.0/CMakeLists.txt ---- poppler-0.72.0-orig/CMakeLists.txt 2018-12-09 14:40:02.261109200 +0000 -+++ poppler-0.72.0/CMakeLists.txt 2018-12-09 14:44:48.176108500 +0000 -@@ -485,7 +485,7 @@ else() - add_library(poppler ${poppler_SRCS}) - endif() - set_target_properties(poppler PROPERTIES VERSION 83.0.0 SOVERSION 83) --if(MINGW) -+if(MINGW AND BUILD_SHARED_LIBS) - get_target_property(POPPLER_SOVERSION poppler SOVERSION) - set_target_properties(poppler PROPERTIES SUFFIX "-${POPPLER_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") - endif() -diff -aurp poppler-0.72.0-orig/cpp/CMakeLists.txt poppler-0.72.0/cpp/CMakeLists.txt ---- poppler-0.72.0-orig/cpp/CMakeLists.txt 2018-12-09 14:40:01.596109200 +0000 -+++ poppler-0.72.0/cpp/CMakeLists.txt 2018-12-09 14:45:06.631108500 +0000 -@@ -25,7 +25,7 @@ set(poppler_cpp_SRCS - - add_library(poppler-cpp ${poppler_cpp_SRCS}) - set_target_properties(poppler-cpp PROPERTIES VERSION 0.5.0 SOVERSION 0) --if(MINGW) -+if(MINGW AND BUILD_SHARED_LIBS) - get_target_property(POPPLER_CPP_SOVERSION poppler-cpp SOVERSION) - set_target_properties(poppler-cpp PROPERTIES SUFFIX "-${POPPLER_CPP_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") - endif() -diff -aurp poppler-0.72.0-orig/glib/CMakeLists.txt poppler-0.72.0/glib/CMakeLists.txt ---- poppler-0.72.0-orig/glib/CMakeLists.txt 2018-12-09 14:40:02.016109200 +0000 -+++ poppler-0.72.0/glib/CMakeLists.txt 2018-12-09 14:45:26.289108500 +0000 -@@ -90,7 +90,7 @@ set_target_properties(poppler-glib PROPE - set_target_properties(poppler-glib PROPERTIES C_VISIBILITY_PRESET hidden) - set_target_properties(poppler-glib PROPERTIES CXX_VISIBILITY_PRESET hidden) - set_target_properties(poppler-glib PROPERTIES VISIBILITY_INLINES_HIDDEN 1) --if(MINGW) -+if(MINGW AND BUILD_SHARED_LIBS) - get_target_property(POPPLER_GLIB_SOVERSION poppler-glib SOVERSION) - set_target_properties(poppler-glib PROPERTIES SUFFIX "-${POPPLER_GLIB_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") - endif() diff --git a/readme.md b/readme.md index bea416c..adb926a 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,7 @@ -# Poppler 0.72.1 +# Poppler 0.73.0 -This is a build of poppler 0.72.0 with some patches: +This is a build of poppler 0.73.0 with one patch: - - Backport two patches from poppler 0.73.0 to fix UTF-8 - Patch to make it work with GCC 4.9.3 which had some conflict with `timegm` For more details see [PKGBUILD](mingw-w64-poppler/PKGBUILD).