summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-25 12:15:38 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-25 12:15:38 -0800
commit5c4c193fd4b6dd0657abf5e74125f9887f91d720 (patch)
tree976cfb53dd2580eff58fb02556d1828fff12659d /core/include
parent8b90ee66872aa883fc46ac2b6e7acad35c7c96c6 (diff)
downloadpdfium-5c4c193fd4b6dd0657abf5e74125f9887f91d720.tar.xz
Inflict PPDF_ENABLE_XFA ifdefs on XFA core/
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1471323004 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fpdfdoc/fpdf_doc.h2
-rw-r--r--core/include/fxcodec/fx_codec.h29
-rw-r--r--core/include/fxcodec/fx_codec_def.h6
-rw-r--r--core/include/fxcrt/fx_basic.h10
-rw-r--r--core/include/fxcrt/fx_ext.h4
-rw-r--r--core/include/fxcrt/fx_stream.h2
-rw-r--r--core/include/fxcrt/fx_ucd.h12
-rw-r--r--core/include/fxge/fx_font.h20
8 files changed, 85 insertions, 0 deletions
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index c270c78bcf..3f05fc9be9 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -825,12 +825,14 @@ class CPDF_FormField {
FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE);
+#ifdef PDF_ENABLE_XFA
FX_BOOL ClearOptions(FX_BOOL bNotify = FALSE);
int InsertOption(CFX_WideString csOptLabel,
int index = -1,
FX_BOOL bNotify = FALSE);
+#endif
FX_FLOAT GetFontSize() { return m_FontSize; }
CPDF_Font* GetFont() { return m_pFont; }
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index 54ea64544a..54d185a8ce 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -7,29 +7,45 @@
#ifndef CORE_INCLUDE_FXCODEC_FX_CODEC_H_
#define CORE_INCLUDE_FXCODEC_FX_CODEC_H_
+#ifdef PDF_ENABLE_XFA
#include <map>
+#endif
#include <vector>
#include "core/include/fxcrt/fx_basic.h"
#include "fx_codec_def.h"
#include "third_party/base/nonstd_unique_ptr.h"
+#ifdef PDF_ENABLE_XFA
#include "../fxcrt/fx_coordinates.h" // For FX_RECT.
+#endif
class CFX_DIBSource;
class CJPX_Decoder;
class CPDF_PrivateData;
class CPDF_StreamAcc;
+#ifndef PDF_ENABLE_XFA
+class ICodec_ScanlineDecoder;
+#endif
class ICodec_BasicModule;
class ICodec_FaxModule;
+#ifdef PDF_ENABLE_XFA
class ICodec_FlateModule;
class ICodec_IccModule;
class ICodec_Jbig2Encoder;
class ICodec_Jbig2Module;
+#endif
class ICodec_JpegModule;
class ICodec_JpxModule;
+#ifndef PDF_ENABLE_XFA
+class ICodec_Jbig2Module;
+class ICodec_IccModule;
+class ICodec_FlateModule;
+class ICodec_Jbig2Encoder;
+#endif
class ICodec_ScanlineDecoder;
+#ifdef PDF_ENABLE_XFA
class ICodec_BmpModule;
class ICodec_GifModule;
class ICodec_PngModule;
@@ -55,6 +71,7 @@ class CFX_DIBAttribute {
std::map<FX_DWORD, void*> m_Exif;
};
+#endif
class CCodec_ModuleMgr {
public:
CCodec_ModuleMgr();
@@ -67,12 +84,14 @@ class CCodec_ModuleMgr {
ICodec_IccModule* GetIccModule() const { return m_pIccModule.get(); }
ICodec_FlateModule* GetFlateModule() const { return m_pFlateModule.get(); }
+#ifdef PDF_ENABLE_XFA
ICodec_ProgressiveDecoder* CreateProgressiveDecoder();
ICodec_PngModule* GetPngModule() const { return m_pPngModule.get(); }
ICodec_GifModule* GetGifModule() const { return m_pGifModule.get(); }
ICodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); }
ICodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); }
+#endif
protected:
nonstd::unique_ptr<ICodec_BasicModule> m_pBasicModule;
nonstd::unique_ptr<ICodec_FaxModule> m_pFaxModule;
@@ -81,11 +100,13 @@ class CCodec_ModuleMgr {
nonstd::unique_ptr<ICodec_Jbig2Module> m_pJbig2Module;
nonstd::unique_ptr<ICodec_IccModule> m_pIccModule;
nonstd::unique_ptr<ICodec_FlateModule> m_pFlateModule;
+#ifdef PDF_ENABLE_XFA
nonstd::unique_ptr<ICodec_PngModule> m_pPngModule;
nonstd::unique_ptr<ICodec_GifModule> m_pGifModule;
nonstd::unique_ptr<ICodec_BmpModule> m_pBmpModule;
nonstd::unique_ptr<ICodec_TiffModule> m_pTiffModule;
+#endif
};
class ICodec_BasicModule {
public:
@@ -229,8 +250,12 @@ class ICodec_JpegModule {
virtual int ReadHeader(void* pContext,
int* width,
int* height,
+#ifndef PDF_ENABLE_XFA
+ int* nComps) = 0;
+#else
int* nComps,
CFX_DIBAttribute* pAttribute) = 0;
+#endif
virtual int StartScanline(void* pContext, int down_scale) = 0;
@@ -260,6 +285,7 @@ class ICodec_JpxModule {
virtual void DestroyDecoder(CJPX_Decoder* pDecoder) = 0;
};
+#ifdef PDF_ENABLE_XFA
class ICodec_PngModule {
public:
virtual ~ICodec_PngModule() {}
@@ -387,6 +413,7 @@ class ICodec_TiffModule {
virtual void DestroyDecoder(void* ctx) = 0;
};
+#endif
class ICodec_Jbig2Module {
public:
@@ -408,6 +435,7 @@ class ICodec_Jbig2Module {
IFX_Pause* pPause) = 0;
virtual void DestroyJbig2Context(void* pJbig2Content) = 0;
};
+#ifdef PDF_ENABLE_XFA
class ICodec_ProgressiveDecoder {
public:
virtual ~ICodec_ProgressiveDecoder() {}
@@ -437,6 +465,7 @@ class ICodec_ProgressiveDecoder {
virtual FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = NULL) = 0;
};
+#endif
class ICodec_Jbig2Encoder {
public:
virtual ~ICodec_Jbig2Encoder() {}
diff --git a/core/include/fxcodec/fx_codec_def.h b/core/include/fxcodec/fx_codec_def.h
index 1cb5909658..6dd4d0d309 100644
--- a/core/include/fxcodec/fx_codec_def.h
+++ b/core/include/fxcodec/fx_codec_def.h
@@ -7,6 +7,7 @@
#ifndef CORE_INCLUDE_FXCODEC_FX_CODEC_DEF_H_
#define CORE_INCLUDE_FXCODEC_FX_CODEC_DEF_H_
+#ifdef PDF_ENABLE_XFA
enum FXCODEC_IMAGE_TYPE {
FXCODEC_IMAGE_UNKNOWN = 0,
FXCODEC_IMAGE_BMP,
@@ -16,6 +17,7 @@ enum FXCODEC_IMAGE_TYPE {
FXCODEC_IMAGE_TIF,
FXCODEC_IMAGE_MAX
};
+#endif
enum FXCODEC_STATUS {
FXCODEC_STATUS_ERROR = -1,
FXCODEC_STATUS_FRAME_READY,
@@ -23,7 +25,9 @@ enum FXCODEC_STATUS {
FXCODEC_STATUS_DECODE_READY,
FXCODEC_STATUS_DECODE_TOBECONTINUE,
FXCODEC_STATUS_DECODE_FINISH,
+#ifdef PDF_ENABLE_XFA
FXCODEC_STATUS_ERR_MEMORY,
+#endif
FXCODEC_STATUS_ERR_READ,
FXCODEC_STATUS_ERR_FLUSH,
FXCODEC_STATUS_ERR_FORMAT,
@@ -68,12 +72,14 @@ enum FXCODEC_STATUS {
#define Icc_PARAMTYPE_NONE 0
#define Icc_PARAMTYPE_BUFFER 1
#define Icc_PARAMTYPE_PARAM 2
+#ifdef PDF_ENABLE_XFA
enum FXCODEC_RESUNIT {
FXCODEC_RESUNIT_NONE = 0,
FXCODEC_RESUNIT_INCH,
FXCODEC_RESUNIT_CENTIMETER,
FXCODEC_RESUNIT_METER
};
+#endif
#define EXIFTAG_USHORT_RESUNIT 296
#define EXIFTAG_FLOAT_DPIX 282
#define EXIFTAG_FLOAT_DPIY 283
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 3a83a3de21..710bbcc3c3 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -130,6 +130,7 @@ class CFX_WideTextBuf : public CFX_BinaryBuf {
CFX_WideStringC GetWideString() const;
};
+#ifdef PDF_ENABLE_XFA
class CFX_ArchiveSaver {
public:
CFX_ArchiveSaver() : m_pStream(NULL) {}
@@ -192,6 +193,7 @@ class CFX_ArchiveLoader {
FX_DWORD m_LoadingSize;
};
+#endif
class IFX_BufferArchive {
public:
@@ -436,8 +438,10 @@ typedef CFX_ArrayTemplate<FX_WORD> CFX_WordArray;
typedef CFX_ArrayTemplate<FX_DWORD> CFX_DWordArray;
typedef CFX_ArrayTemplate<void*> CFX_PtrArray;
typedef CFX_ArrayTemplate<FX_FILESIZE> CFX_FileSizeArray;
+#ifdef PDF_ENABLE_XFA
typedef CFX_ArrayTemplate<FX_FLOAT> CFX_FloatArray;
typedef CFX_ArrayTemplate<int32_t> CFX_Int32Array;
+#endif
template <class ObjectClass>
class CFX_ObjectArray : public CFX_BasicArray {
@@ -698,6 +702,7 @@ class CFX_MapPtrToPtr {
CAssoc* GetAssocAt(void* key, FX_DWORD& hash) const;
};
+#ifdef PDF_ENABLE_XFA
template <class KeyType, class ValueType>
class CFX_MapPtrTemplate : public CFX_MapPtrToPtr {
public:
@@ -723,7 +728,9 @@ class CFX_MapPtrTemplate : public CFX_MapPtrToPtr {
FX_BOOL RemoveKey(KeyType key) {
return CFX_MapPtrToPtr::RemoveKey((void*)(uintptr_t)key);
}
+#endif
+#ifdef PDF_ENABLE_XFA
void GetNextAssoc(FX_POSITION& rNextPosition,
KeyType& rKey,
ValueType& rValue) const {
@@ -734,6 +741,7 @@ class CFX_MapPtrTemplate : public CFX_MapPtrToPtr {
rValue = (ValueType)(uintptr_t)pValue;
}
};
+#endif
class CFX_CMapByteStringToPtr {
public:
CFX_CMapByteStringToPtr();
@@ -1187,6 +1195,7 @@ typedef enum {
} FX_ProgressiveStatus;
#define ProgressiveStatus FX_ProgressiveStatus
#define FX_NAMESPACE_DECLARE(namespace, type) namespace ::type
+#ifdef PDF_ENABLE_XFA
class IFX_Unknown {
public:
virtual ~IFX_Unknown() {}
@@ -1194,6 +1203,7 @@ class IFX_Unknown {
virtual FX_DWORD AddRef() = 0;
};
#define FX_IsOdd(a) ((a)&1)
+#endif
class CFX_Vector_3by1 {
public:
diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h
index 8530263a79..908d6c3fe5 100644
--- a/core/include/fxcrt/fx_ext.h
+++ b/core/include/fxcrt/fx_ext.h
@@ -10,7 +10,9 @@
#include <cctype>
#include <cwctype>
+#ifdef PDF_ENABLE_XFA
#include "fx_string.h"
+#endif
#include "fx_system.h"
FX_FLOAT FXSYS_tan(FX_FLOAT a);
@@ -76,6 +78,7 @@ void FX_Random_GenerateMT(FX_DWORD* pBuffer, int32_t iCount);
void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount);
+#ifdef PDF_ENABLE_XFA
typedef struct FX_GUID {
FX_DWORD data1;
FX_WORD data2;
@@ -90,6 +93,7 @@ void FX_GUID_ToString(FX_LPCGUID pGUID,
CFX_ByteString& bsStr,
FX_BOOL bSeparator = TRUE);
+#endif
template <class baseType>
class CFX_SSortTemplate {
public:
diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h
index 544eacdb5b..300bfb1941 100644
--- a/core/include/fxcrt/fx_stream.h
+++ b/core/include/fxcrt/fx_stream.h
@@ -127,6 +127,7 @@ class IFX_FileStream : public IFX_FileRead, public IFX_FileWrite {
IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes);
IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes);
+#ifdef PDF_ENABLE_XFA
class IFX_FileAccess {
public:
virtual ~IFX_FileAccess() {}
@@ -137,6 +138,7 @@ class IFX_FileAccess {
};
IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath);
+#endif
class IFX_MemoryStream : public IFX_FileStream {
public:
virtual FX_BOOL IsConsecutive() const = 0;
diff --git a/core/include/fxcrt/fx_ucd.h b/core/include/fxcrt/fx_ucd.h
index d4a43bd096..852a893843 100644
--- a/core/include/fxcrt/fx_ucd.h
+++ b/core/include/fxcrt/fx_ucd.h
@@ -7,8 +7,13 @@
#ifndef CORE_INCLUDE_FXCRT_FX_UCD_H_
#define CORE_INCLUDE_FXCRT_FX_UCD_H_
+#ifndef PDF_ENABLE_XFA
+#include "fx_system.h"
+#else
#include "fx_basic.h"
+#endif
+#ifdef PDF_ENABLE_XFA
enum FX_CHARBREAKPROP {
FX_CBP_OP = 0,
FX_CBP_CL = 1,
@@ -50,6 +55,7 @@ enum FX_CHARBREAKPROP {
FX_CBP_TB = 37,
FX_CBP_NONE = 36,
};
+#endif
#define FX_BIDICLASSBITS 6
#define FX_BIDICLASSBITSMASK (31 << FX_BIDICLASSBITS)
enum FX_BIDICLASS {
@@ -84,6 +90,7 @@ extern const size_t kFXTextLayoutVerticalMirrorSize;
extern const FX_WCHAR kFXTextLayoutBidiMirror[];
extern const size_t kFXTextLayoutBidiMirrorSize;
+#ifdef PDF_ENABLE_XFA
#define FX_CHARTYPEBITS 11
#define FX_CHARTYPEBITSMASK (15 << FX_CHARTYPEBITS)
enum FX_CHARTYPE {
@@ -102,9 +109,13 @@ enum FX_CHARTYPE {
FX_CHARTYPE_Arabic = (12 << FX_CHARTYPEBITS),
};
+#endif
FX_DWORD FX_GetUnicodeProperties(FX_WCHAR wch);
+#ifdef PDF_ENABLE_XFA
FX_BOOL FX_IsCtrlCode(FX_WCHAR ch);
+#endif
FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical);
+#ifdef PDF_ENABLE_XFA
FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch,
FX_DWORD dwProps,
FX_BOOL bRTL,
@@ -183,5 +194,6 @@ class CFX_RTFChar : public CFX_Char {
IFX_Unknown* m_pUserData;
};
typedef CFX_ArrayTemplate<CFX_RTFChar> CFX_RTFCharArray;
+#endif
#endif // CORE_INCLUDE_FXCRT_FX_UCD_H_
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index d2b1d5459a..5b31126b3e 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -34,7 +34,9 @@ class IFX_SystemFontInfo;
#define FXFONT_BOLD 0x40000
#define FXFONT_USEEXTERNATTR 0x80000
#define FXFONT_CIDFONT 0x100000
+#ifdef PDF_ENABLE_XFA
#define FXFONT_EXACTMATCH 0x80000000
+#endif
#define FXFONT_ANSI_CHARSET 0
#define FXFONT_DEFAULT_CHARSET 1
#define FXFONT_SYMBOL_CHARSET 2
@@ -69,6 +71,7 @@ class CFX_Font {
int CharsetCP,
FX_BOOL bVertical = FALSE);
FX_BOOL LoadEmbedded(const uint8_t* data, FX_DWORD size);
+#ifdef PDF_ENABLE_XFA
FX_BOOL LoadFile(IFX_FileRead* pFile,
int nFaceIndex = 0,
@@ -76,10 +79,15 @@ class CFX_Font {
FX_BOOL LoadClone(const CFX_Font* pFont);
+#endif
FXFT_Face GetFace() const { return m_Face; }
+#ifndef PDF_ENABLE_XFA
+ const CFX_SubstFont* GetSubstFont() const { return m_pSubstFont; }
+#else
CFX_SubstFont* GetSubstFont() const { return m_pSubstFont; }
void SetFace(FXFT_Face face) { m_Face = face; }
void SetSubstFont(CFX_SubstFont* subst) { m_pSubstFont = subst; }
+#endif
CFX_PathData* LoadGlyphPath(FX_DWORD glyph_index, int dest_width = 0);
int GetGlyphWidth(FX_DWORD glyph_index);
int GetAscent() const;
@@ -125,15 +133,18 @@ class CFX_Font {
FX_BOOL m_bDwLoaded;
FX_BOOL m_bEmbedded;
FX_BOOL m_bVertical;
+#ifdef PDF_ENABLE_XFA
protected:
FX_BOOL m_bLogic;
void* m_pOwnedStream;
+#endif
};
#define ENCODING_INTERNAL 0
#define ENCODING_UNICODE 1
+#ifdef PDF_ENABLE_XFA
#define FXFM_ENC_TAG(a, b, c, d) \
(((FX_DWORD)(a) << 24) | ((FX_DWORD)(b) << 16) | ((FX_DWORD)(c) << 8) | \
(FX_DWORD)(d))
@@ -152,6 +163,7 @@ class CFX_Font {
#define FXFM_ENCODING_OLD_LATIN_2 FXFM_ENC_TAG('l', 'a', 't', '2')
#define FXFM_ENCODING_APPLE_ROMAN FXFM_ENC_TAG('a', 'r', 'm', 'n')
+#endif
class CFX_UnicodeEncoding {
public:
explicit CFX_UnicodeEncoding(CFX_Font* pFont);
@@ -164,6 +176,7 @@ class CFX_UnicodeEncoding {
CFX_Font* m_pFont;
};
+#ifdef PDF_ENABLE_XFA
class CFX_UnicodeEncodingEx : public CFX_UnicodeEncoding {
public:
CFX_UnicodeEncodingEx(CFX_Font* pFont, FX_DWORD EncodingID);
@@ -182,6 +195,7 @@ CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx(
CFX_Font* pFont,
FX_DWORD nEncodingID = FXFM_ENCODING_NONE);
+#endif
#define FXFONT_SUBST_MM 0x01
#define FXFONT_SUBST_GLYPHPATH 0x04
#define FXFONT_SUBST_CLEARTYPE 0x08
@@ -307,11 +321,13 @@ class CFX_FontMapper {
int italic_angle,
int CharsetCP,
CFX_SubstFont* pSubstFont);
+#ifdef PDF_ENABLE_XFA
FXFT_Face FindSubstFontByUnicode(FX_DWORD dwUnicode,
FX_DWORD flags,
int weight,
int italic_angle);
FX_BOOL IsBuiltinFace(const FXFT_Face face) const;
+#endif
private:
static const size_t MM_FACE_COUNT = 2;
@@ -348,12 +364,14 @@ class IFX_SystemFontInfo {
int pitch_family,
const FX_CHAR* face,
int& iExact) = 0;
+#ifdef PDF_ENABLE_XFA
virtual void* MapFontByUnicode(FX_DWORD dwUnicode,
int weight,
FX_BOOL bItalic,
int pitch_family) {
return NULL;
}
+#endif
virtual void* GetFont(const FX_CHAR* face) = 0;
virtual FX_DWORD GetFontData(void* hFont,
FX_DWORD table,
@@ -384,10 +402,12 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo {
int pitch_family,
const FX_CHAR* face,
int& bExact) override;
+#ifdef PDF_ENABLE_XFA
void* MapFontByUnicode(FX_DWORD dwUnicode,
int weight,
FX_BOOL bItalic,
int pitch_family) override;
+#endif
void* GetFont(const FX_CHAR* face) override;
FX_DWORD GetFontData(void* hFont,
FX_DWORD table,