| Index: core/include/fpdfapi/fpdf_module.h
|
| diff --git a/core/include/fpdfapi/fpdf_module.h b/core/include/fpdfapi/fpdf_module.h
|
| index 8f0621a57bdfaebc0916646ec64f0c3fd78b93f2..897b2ea5744648767fcc9e5d3e32c03a6300242a 100644
|
| --- a/core/include/fpdfapi/fpdf_module.h
|
| +++ b/core/include/fpdfapi/fpdf_module.h
|
| @@ -1,7 +1,7 @@
|
| // Copyright 2014 PDFium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
| -
|
| +
|
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
|
|
|
| #ifndef _FPDF_MODULE_
|
| @@ -21,110 +21,90 @@ class ICodec_FaxModule;
|
| class ICodec_Jbig2Module;
|
| class ICodec_IccModule;
|
| class ICodec_FlateModule;
|
| -#define ADDIN_NAME_CJK "Eastern Asian Language Support"
|
| -#define ADDIN_NAME_DECODER "JPEG2000 and JBIG2 Image Decoders"
|
| -class CPDF_ModuleMgr : public CFX_Object
|
| -{
|
| -public:
|
| -
|
| - static void Create();
|
| -
|
| - static CPDF_ModuleMgr* Get();
|
| -
|
| - static void Destroy();
|
| -
|
| -
|
| -
|
| - void SetCodecModule(CCodec_ModuleMgr* pModule)
|
| - {
|
| - m_pCodecModule = pModule;
|
| - }
|
| - CCodec_ModuleMgr* GetCodecModule()
|
| - {
|
| - return m_pCodecModule;
|
| - }
|
| -
|
| - void InitPageModule();
|
| -
|
| - void InitRenderModule();
|
| -
|
| -
|
| - void SetModulePath(FX_LPCSTR module_name, FX_LPCSTR path);
|
| -
|
| - CFX_ByteString GetModuleFilePath(FX_LPCSTR module_name, FX_LPCSTR name);
|
| -
|
| - void SetDownloadCallback(FX_BOOL (*callback)(FX_LPCSTR module_name));
|
| +#define ADDIN_NAME_CJK "Eastern Asian Language Support"
|
| +#define ADDIN_NAME_DECODER "JPEG2000 and JBIG2 Image Decoders"
|
| +class CPDF_ModuleMgr : public CFX_Object {
|
| + public:
|
| + static void Create();
|
|
|
| - FX_BOOL DownloadModule(FX_LPCSTR module_name);
|
| + static CPDF_ModuleMgr* Get();
|
|
|
| - void NotifyModuleAvailable(FX_LPCSTR module_name);
|
| + static void Destroy();
|
|
|
| + void SetCodecModule(CCodec_ModuleMgr* pModule) { m_pCodecModule = pModule; }
|
| + CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; }
|
|
|
| + void InitPageModule();
|
|
|
| - CPDF_RenderModuleDef* GetRenderModule() const
|
| - {
|
| - return m_pRenderModule;
|
| - }
|
| + void InitRenderModule();
|
|
|
| - CPDF_PageModuleDef* GetPageModule() const
|
| - {
|
| - return m_pPageModule;
|
| - }
|
| + void SetModulePath(FX_LPCSTR module_name, FX_LPCSTR path);
|
|
|
| + CFX_ByteString GetModuleFilePath(FX_LPCSTR module_name, FX_LPCSTR name);
|
|
|
| + void SetDownloadCallback(FX_BOOL (*callback)(FX_LPCSTR module_name));
|
|
|
| + FX_BOOL DownloadModule(FX_LPCSTR module_name);
|
|
|
| - void LoadEmbeddedGB1CMaps();
|
| + void NotifyModuleAvailable(FX_LPCSTR module_name);
|
|
|
| - void LoadEmbeddedCNS1CMaps();
|
| + CPDF_RenderModuleDef* GetRenderModule() const { return m_pRenderModule; }
|
|
|
| - void LoadEmbeddedJapan1CMaps();
|
| + CPDF_PageModuleDef* GetPageModule() const { return m_pPageModule; }
|
|
|
| - void LoadEmbeddedKorea1CMaps();
|
| + void LoadEmbeddedGB1CMaps();
|
|
|
| - ICodec_FaxModule* GetFaxModule();
|
| - ICodec_JpegModule* GetJpegModule();
|
| - ICodec_JpxModule* GetJpxModule();
|
| - ICodec_Jbig2Module* GetJbig2Module();
|
| - ICodec_IccModule* GetIccModule();
|
| - ICodec_FlateModule* GetFlateModule();
|
| + void LoadEmbeddedCNS1CMaps();
|
|
|
| - void RegisterSecurityHandler(FX_LPCSTR name, CPDF_SecurityHandler * (*CreateHandler)(void* param), void* param);
|
| + void LoadEmbeddedJapan1CMaps();
|
|
|
| - CPDF_SecurityHandler* CreateSecurityHandler(FX_LPCSTR name);
|
| + void LoadEmbeddedKorea1CMaps();
|
|
|
| - void SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
|
| + ICodec_FaxModule* GetFaxModule();
|
| + ICodec_JpegModule* GetJpegModule();
|
| + ICodec_JpxModule* GetJpxModule();
|
| + ICodec_Jbig2Module* GetJbig2Module();
|
| + ICodec_IccModule* GetIccModule();
|
| + ICodec_FlateModule* GetFlateModule();
|
|
|
| - FX_LPVOID GetPrivateData(FX_LPVOID module_id);
|
| + void RegisterSecurityHandler(
|
| + FX_LPCSTR name,
|
| + CPDF_SecurityHandler* (*CreateHandler)(void* param),
|
| + void* param);
|
|
|
| - int m_FileBufSize;
|
| -protected:
|
| + CPDF_SecurityHandler* CreateSecurityHandler(FX_LPCSTR name);
|
|
|
| - CPDF_ModuleMgr();
|
| + void SetPrivateData(FX_LPVOID module_id,
|
| + FX_LPVOID pData,
|
| + PD_CALLBACK_FREEDATA callback);
|
|
|
| - ~CPDF_ModuleMgr();
|
| - void Initialize();
|
| + FX_LPVOID GetPrivateData(FX_LPVOID module_id);
|
|
|
| - void InitModules();
|
| + int m_FileBufSize;
|
|
|
| + protected:
|
| + CPDF_ModuleMgr();
|
|
|
| + ~CPDF_ModuleMgr();
|
| + void Initialize();
|
|
|
| - CCodec_ModuleMgr* m_pCodecModule;
|
| + void InitModules();
|
|
|
| - CPDF_RenderModuleDef* m_pRenderModule;
|
| + CCodec_ModuleMgr* m_pCodecModule;
|
|
|
| - CPDF_PageModuleDef* m_pPageModule;
|
| + CPDF_RenderModuleDef* m_pRenderModule;
|
|
|
| + CPDF_PageModuleDef* m_pPageModule;
|
|
|
| - FX_BOOL (*m_pDownloadCallback)(FX_LPCSTR module_name);
|
| + FX_BOOL (*m_pDownloadCallback)(FX_LPCSTR module_name);
|
|
|
| - CFX_ByteString m_DefaultModulePath;
|
| + CFX_ByteString m_DefaultModulePath;
|
|
|
| - CFX_CMapByteStringToPtr m_ModulePathList;
|
| + CFX_CMapByteStringToPtr m_ModulePathList;
|
|
|
| - CFX_MapByteStringToPtr m_SecurityHandlerMap;
|
| + CFX_MapByteStringToPtr m_SecurityHandlerMap;
|
|
|
| - CFX_PrivateData m_privateData;
|
| + CFX_PrivateData m_privateData;
|
| };
|
| class CPDF_Document;
|
| class CPDF_DocPageData;
|
| @@ -132,32 +112,22 @@ class CPDF_FontGlobals;
|
| class IPDF_FontMgr;
|
| class IPDF_FontMapper;
|
| class CPDF_ColorSpace;
|
| -class CPDF_PageModuleDef : public CFX_Object
|
| -{
|
| -public:
|
| - virtual ~CPDF_PageModuleDef() {}
|
| +class CPDF_PageModuleDef : public CFX_Object {
|
| + public:
|
| + virtual ~CPDF_PageModuleDef() {}
|
|
|
| - virtual CPDF_DocPageData* CreateDocData(CPDF_Document* pDoc)
|
| - {
|
| - return NULL;
|
| - }
|
| + virtual CPDF_DocPageData* CreateDocData(CPDF_Document* pDoc) { return NULL; }
|
|
|
| - virtual void ReleaseDoc(CPDF_Document*) {}
|
| - virtual void ClearDoc(CPDF_Document*) {}
|
| + virtual void ReleaseDoc(CPDF_Document*) {}
|
| + virtual void ClearDoc(CPDF_Document*) {}
|
|
|
| - virtual CPDF_FontGlobals* GetFontGlobals()
|
| - {
|
| - return NULL;
|
| - }
|
| + virtual CPDF_FontGlobals* GetFontGlobals() { return NULL; }
|
|
|
| - virtual void ClearStockFont(CPDF_Document* pDoc) {}
|
| + virtual void ClearStockFont(CPDF_Document* pDoc) {}
|
|
|
| - virtual void NotifyCJKAvailable() {}
|
| + virtual void NotifyCJKAvailable() {}
|
|
|
| - virtual CPDF_ColorSpace* GetStockCS(int family)
|
| - {
|
| - return NULL;
|
| - }
|
| + virtual CPDF_ColorSpace* GetStockCS(int family) { return NULL; }
|
| };
|
| class CPDF_PageObjects;
|
| class CFX_AffineMatrix;
|
| @@ -170,36 +140,27 @@ class CPDF_Stream;
|
| class CFX_DIBSource;
|
| class CPDF_RenderConfig;
|
| class CPDF_Image;
|
| -class CPDF_RenderModuleDef : public CFX_Object
|
| -{
|
| -public:
|
| - virtual ~CPDF_RenderModuleDef() {}
|
| +class CPDF_RenderModuleDef : public CFX_Object {
|
| + public:
|
| + virtual ~CPDF_RenderModuleDef() {}
|
|
|
| - virtual CPDF_DocRenderData* CreateDocData(CPDF_Document* pDoc)
|
| - {
|
| - return NULL;
|
| - }
|
| + virtual CPDF_DocRenderData* CreateDocData(CPDF_Document* pDoc) {
|
| + return NULL;
|
| + }
|
|
|
| - virtual void DestroyDocData(CPDF_DocRenderData*) {}
|
| - virtual void ClearDocData(CPDF_DocRenderData*) {}
|
| + virtual void DestroyDocData(CPDF_DocRenderData*) {}
|
| + virtual void ClearDocData(CPDF_DocRenderData*) {}
|
|
|
| - virtual CPDF_DocRenderData* GetRenderData()
|
| - {
|
| - return NULL;
|
| - }
|
| + virtual CPDF_DocRenderData* GetRenderData() { return NULL; }
|
|
|
| - virtual CPDF_PageRenderCache* CreatePageCache(CPDF_Page* pPage)
|
| - {
|
| - return NULL;
|
| - }
|
| + virtual CPDF_PageRenderCache* CreatePageCache(CPDF_Page* pPage) {
|
| + return NULL;
|
| + }
|
|
|
| - virtual void DestroyPageCache(CPDF_PageRenderCache*) {}
|
| + virtual void DestroyPageCache(CPDF_PageRenderCache*) {}
|
|
|
| - virtual void NotifyDecoderAvailable() {}
|
| + virtual void NotifyDecoderAvailable() {}
|
|
|
| - virtual CPDF_RenderConfig* GetConfig()
|
| - {
|
| - return NULL;
|
| - }
|
| + virtual CPDF_RenderConfig* GetConfig() { return NULL; }
|
| };
|
| #endif
|
|
|