Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: fpdfsdk/include/fsdk_define.h

Issue 1399273003: fpdfsdk/ differences with XFA (for didactic purposes only). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Regenerate after taking juns patch Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/fsdk_baseform.h ('k') | fpdfsdk/include/fsdk_mgr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/include/fsdk_define.h
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h
index 980411c27b5e8f48d87e9d83f5e10e1a45e54430..4dfe5c284008806cb800a9dab2c21a1f505a2bbc 100644
--- a/fpdfsdk/include/fsdk_define.h
+++ b/fpdfsdk/include/fsdk_define.h
@@ -7,16 +7,31 @@
#ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_
#define FPDFSDK_INCLUDE_FSDK_DEFINE_H_
+#ifndef PDF_ENABLE_XFA
#include "core/include/fpdfapi/fpdfapi.h"
+#else
+#include "../../xfa/include/fwl/adapter/fwl_adaptertimermgr.h"
+#include "../../xfa/include/fxbarcode/BC_BarCode.h"
+#include "../../xfa/include/fxfa/fxfa.h"
+#include "../../xfa/include/fxgraphics/fx_graphics.h"
+#include "../../xfa/include/fxjse/fxjse.h"
+#endif
#include "core/include/fpdfapi/fpdf_module.h"
#include "core/include/fpdfapi/fpdf_pageobj.h"
#include "core/include/fpdfapi/fpdf_parser.h"
#include "core/include/fpdfapi/fpdf_render.h"
#include "core/include/fpdfapi/fpdf_serial.h"
+#ifdef PDF_ENABLE_XFA
+#include "core/include/fpdfapi/fpdfapi.h"
+#endif
#include "core/include/fpdfdoc/fpdf_doc.h"
#include "core/include/fpdfdoc/fpdf_vt.h"
#include "core/include/fxge/fx_ge.h"
#include "core/include/fxge/fx_ge_win32.h"
+#ifdef PDF_ENABLE_XFA
+#include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h"
+#include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h"
+#endif
#include "public/fpdfview.h"
#ifdef _WIN32
@@ -48,15 +63,54 @@ class CPDF_CustomAccess final : public IFX_FileRead {
void Release() override { delete this; }
FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
+#ifdef PDF_ENABLE_XFA
+ virtual CFX_ByteString GetFullPath() { return ""; }
+ virtual FX_BOOL GetByte(FX_DWORD pos, uint8_t& ch);
+ virtual FX_BOOL GetBlock(FX_DWORD pos, uint8_t* pBuf, FX_DWORD size);
+
+#endif
private:
FPDF_FILEACCESS m_FileAccess;
+#ifdef PDF_ENABLE_XFA
+ uint8_t m_Buffer[512];
+ FX_DWORD m_BufferOffset;
+};
+
+class CFPDF_FileStream : public IFX_FileStream {
+ public:
+ CFPDF_FileStream(FPDF_FILEHANDLER* pFS);
+ virtual ~CFPDF_FileStream() {}
+
+ virtual IFX_FileStream* Retain();
+ virtual void Release();
+
+ virtual FX_FILESIZE GetSize();
+ virtual FX_BOOL IsEOF();
+ virtual FX_FILESIZE GetPosition() { return m_nCurPos; }
+ virtual void SetPosition(FX_FILESIZE pos) { m_nCurPos = pos; }
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
+ virtual size_t ReadBlock(void* buffer, size_t size);
+ virtual FX_BOOL WriteBlock(const void* buffer,
+ FX_FILESIZE offset,
+ size_t size);
+ virtual FX_BOOL Flush();
+
+ protected:
+ FPDF_FILEHANDLER* m_pFS;
+ FX_FILESIZE m_nCurPos;
+#endif
};
// Object types for public FPDF_ types; these correspond to next layer down
// from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are
// CPDFXFA_ types.
+#ifndef PDF_ENABLE_XFA
using UnderlyingDocumentType = CPDF_Document;
using UnderlyingPageType = CPDF_Page;
+#else
+using UnderlyingDocumentType = CPDFXFA_Document;
+using UnderlyingPageType = CPDFXFA_Page;
+#endif
// Conversions to/from underlying types.
UnderlyingDocumentType* UnderlyingFromFPDFDocument(FPDF_DOCUMENT doc);
« no previous file with comments | « fpdfsdk/include/fsdk_baseform.h ('k') | fpdfsdk/include/fsdk_mgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698