summaryrefslogtreecommitdiff
path: root/core/include/fxcodec
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-25 15:52:28 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-25 15:52:28 -0800
commita2c42ce6150c4072613a6fc9fa0dc064dbf0a15d (patch)
treeb1705df8ed8c9f2f8db5095fbb6e19548493eacd /core/include/fxcodec
parent214947de80a9be2ddb134b1962affc82e20563c9 (diff)
downloadpdfium-a2c42ce6150c4072613a6fc9fa0dc064dbf0a15d.tar.xz
Manual fixups to PDF_ENABLE_XFA in core/
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1477663003 .
Diffstat (limited to 'core/include/fxcodec')
-rw-r--r--core/include/fxcodec/fx_codec.h44
-rw-r--r--core/include/fxcodec/fx_codec_def.h24
2 files changed, 27 insertions, 41 deletions
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index 54d185a8ce..e7aeaf939b 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -7,42 +7,26 @@
#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/fxcodec/fx_codec_def.h"
#include "core/include/fxcrt/fx_basic.h"
-#include "fx_codec_def.h"
+#include "core/include/fxcrt/fx_coordinates.h" // For FX_RECT.
#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
@@ -51,7 +35,9 @@ class ICodec_GifModule;
class ICodec_PngModule;
class ICodec_ProgressiveDecoder;
class ICodec_TiffModule;
+#endif // PDF_ENABLE_XFA
+#ifdef PDF_ENABLE_XFA
class CFX_DIBAttribute {
public:
CFX_DIBAttribute();
@@ -70,8 +56,8 @@ class CFX_DIBAttribute {
int32_t m_nBmpCompressType;
std::map<FX_DWORD, void*> m_Exif;
};
+#endif // PDF_ENABLE_XFA
-#endif
class CCodec_ModuleMgr {
public:
CCodec_ModuleMgr();
@@ -90,8 +76,8 @@ class CCodec_ModuleMgr {
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 // PDF_ENABLE_XFA
-#endif
protected:
nonstd::unique_ptr<ICodec_BasicModule> m_pBasicModule;
nonstd::unique_ptr<ICodec_FaxModule> m_pFaxModule;
@@ -99,14 +85,13 @@ class CCodec_ModuleMgr {
nonstd::unique_ptr<ICodec_JpxModule> m_pJpxModule;
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
+#endif // PDF_ENABLE_XFA
+ nonstd::unique_ptr<ICodec_FlateModule> m_pFlateModule;
};
class ICodec_BasicModule {
public:
@@ -247,15 +232,18 @@ class ICodec_JpegModule {
const uint8_t* src_buf,
FX_DWORD src_size) = 0;
+#ifdef PDF_ENABLE_XFA
virtual int ReadHeader(void* pContext,
int* width,
int* height,
-#ifndef PDF_ENABLE_XFA
- int* nComps) = 0;
-#else
int* nComps,
CFX_DIBAttribute* pAttribute) = 0;
-#endif
+#else // PDF_ENABLE_XFA
+ virtual int ReadHeader(void* pContext,
+ int* width,
+ int* height,
+ int* nComps) = 0;
+#endif // PDF_ENABLE_XFA
virtual int StartScanline(void* pContext, int down_scale) = 0;
@@ -465,7 +453,7 @@ class ICodec_ProgressiveDecoder {
virtual FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = NULL) = 0;
};
-#endif
+#endif // PDF_ENABLE_XFA
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 6dd4d0d309..99ccf15f0f 100644
--- a/core/include/fxcodec/fx_codec_def.h
+++ b/core/include/fxcodec/fx_codec_def.h
@@ -7,17 +7,6 @@
#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,
- FXCODEC_IMAGE_JPG,
- FXCODEC_IMAGE_PNG,
- FXCODEC_IMAGE_GIF,
- FXCODEC_IMAGE_TIF,
- FXCODEC_IMAGE_MAX
-};
-#endif
enum FXCODEC_STATUS {
FXCODEC_STATUS_ERROR = -1,
FXCODEC_STATUS_FRAME_READY,
@@ -27,7 +16,7 @@ enum FXCODEC_STATUS {
FXCODEC_STATUS_DECODE_FINISH,
#ifdef PDF_ENABLE_XFA
FXCODEC_STATUS_ERR_MEMORY,
-#endif
+#endif // PDF_ENABLE_XFA
FXCODEC_STATUS_ERR_READ,
FXCODEC_STATUS_ERR_FLUSH,
FXCODEC_STATUS_ERR_FORMAT,
@@ -73,13 +62,22 @@ enum FXCODEC_STATUS {
#define Icc_PARAMTYPE_BUFFER 1
#define Icc_PARAMTYPE_PARAM 2
#ifdef PDF_ENABLE_XFA
+enum FXCODEC_IMAGE_TYPE {
+ FXCODEC_IMAGE_UNKNOWN = 0,
+ FXCODEC_IMAGE_BMP,
+ FXCODEC_IMAGE_JPG,
+ FXCODEC_IMAGE_PNG,
+ FXCODEC_IMAGE_GIF,
+ FXCODEC_IMAGE_TIF,
+ FXCODEC_IMAGE_MAX
+};
enum FXCODEC_RESUNIT {
FXCODEC_RESUNIT_NONE = 0,
FXCODEC_RESUNIT_INCH,
FXCODEC_RESUNIT_CENTIMETER,
FXCODEC_RESUNIT_METER
};
-#endif
+#endif // PDF_ENABLE_XFA
#define EXIFTAG_USHORT_RESUNIT 296
#define EXIFTAG_FLOAT_DPIX 282
#define EXIFTAG_FLOAT_DPIY 283