diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-03-14 13:35:12 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-03-14 13:35:12 -0400 |
commit | 764ec513eecbebd12781bcc96ce81ed5e736ee92 (patch) | |
tree | 12763fde4be1f10ea1183d92185917b2b587e00b /core/fpdfapi/fpdf_basic_module.cpp | |
parent | 97da97662417085774f75c26e535c6fbe70266ae (diff) | |
download | pdfium-764ec513eecbebd12781bcc96ce81ed5e736ee92.tar.xz |
Move core/src/ up to core/.
This CL moves the core/src/ files up to core/ and fixes up the include guards,
includes and build files.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1800523005 .
Diffstat (limited to 'core/fpdfapi/fpdf_basic_module.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_basic_module.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/core/fpdfapi/fpdf_basic_module.cpp b/core/fpdfapi/fpdf_basic_module.cpp new file mode 100644 index 0000000000..cf843cc4d9 --- /dev/null +++ b/core/fpdfapi/fpdf_basic_module.cpp @@ -0,0 +1,62 @@ +// 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 + +#include "core/include/fpdfapi/fpdf_module.h" +#include "core/include/fxcodec/fx_codec.h" + +namespace { + +CPDF_ModuleMgr* g_FPDFAPI_pDefaultMgr = nullptr; + +} // namespace + +// static +CPDF_ModuleMgr* CPDF_ModuleMgr::Get() { + return g_FPDFAPI_pDefaultMgr; +} + +// static +void CPDF_ModuleMgr::Create() { + ASSERT(!g_FPDFAPI_pDefaultMgr); + g_FPDFAPI_pDefaultMgr = new CPDF_ModuleMgr; +} + +// static +void CPDF_ModuleMgr::Destroy() { + delete g_FPDFAPI_pDefaultMgr; + g_FPDFAPI_pDefaultMgr = nullptr; +} + +CPDF_ModuleMgr::CPDF_ModuleMgr() : m_pCodecModule(nullptr) {} + +CPDF_ModuleMgr::~CPDF_ModuleMgr() {} + +void CPDF_ModuleMgr::SetPrivateData(void* module_id, + void* pData, + PD_CALLBACK_FREEDATA callback) { + m_privateData.SetPrivateData(module_id, pData, callback); +} +void* CPDF_ModuleMgr::GetPrivateData(void* module_id) { + return m_privateData.GetPrivateData(module_id); +} +ICodec_FaxModule* CPDF_ModuleMgr::GetFaxModule() { + return m_pCodecModule ? m_pCodecModule->GetFaxModule() : NULL; +} +ICodec_JpegModule* CPDF_ModuleMgr::GetJpegModule() { + return m_pCodecModule ? m_pCodecModule->GetJpegModule() : NULL; +} +ICodec_JpxModule* CPDF_ModuleMgr::GetJpxModule() { + return m_pCodecModule ? m_pCodecModule->GetJpxModule() : NULL; +} +ICodec_Jbig2Module* CPDF_ModuleMgr::GetJbig2Module() { + return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : NULL; +} +ICodec_IccModule* CPDF_ModuleMgr::GetIccModule() { + return m_pCodecModule ? m_pCodecModule->GetIccModule() : NULL; +} +ICodec_FlateModule* CPDF_ModuleMgr::GetFlateModule() { + return m_pCodecModule ? m_pCodecModule->GetFlateModule() : NULL; +} |