OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../include/fxcodec/fx_codec.h" | 7 #include "../../include/fxcodec/fx_codec.h" |
8 #include "../../include/fpdfapi/fpdf_module.h" | 8 #include "../../include/fpdfapi/fpdf_module.h" |
9 static CPDF_ModuleMgr* g_FPDFAPI_pDefaultMgr = NULL; | 9 static CPDF_ModuleMgr* g_FPDFAPI_pDefaultMgr = NULL; |
10 CPDF_ModuleMgr* CPDF_ModuleMgr::Get() | 10 CPDF_ModuleMgr* CPDF_ModuleMgr::Get() |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 { | 54 { |
55 m_pDownloadCallback = callback; | 55 m_pDownloadCallback = callback; |
56 } | 56 } |
57 FX_BOOL CPDF_ModuleMgr::DownloadModule(FX_LPCSTR module_name) | 57 FX_BOOL CPDF_ModuleMgr::DownloadModule(FX_LPCSTR module_name) |
58 { | 58 { |
59 if (m_pDownloadCallback == NULL) { | 59 if (m_pDownloadCallback == NULL) { |
60 return FALSE; | 60 return FALSE; |
61 } | 61 } |
62 return m_pDownloadCallback(module_name); | 62 return m_pDownloadCallback(module_name); |
63 } | 63 } |
64 static CFX_ByteString _GetPath(const CFX_ByteString& folder, FX_LPCSTR name) | |
65 { | |
66 FX_STRSIZE folder_len = folder.GetLength(); | |
67 #if _FX_OS_ == _FX_SYMBIAN_ || _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | |
68 if (folder[folder_len - 1] == '\\') { | |
69 return folder + name; | |
70 } else { | |
71 return (folder + "\\") + name; | |
72 } | |
73 #else | |
74 if (folder[folder_len - 1] == '/') { | |
75 return folder + name; | |
76 } else { | |
77 return (folder + "/") + name; | |
78 } | |
79 #endif | |
80 } | |
81 void CPDF_ModuleMgr::NotifyModuleAvailable(FX_LPCSTR module_name) | 64 void CPDF_ModuleMgr::NotifyModuleAvailable(FX_LPCSTR module_name) |
82 { | 65 { |
83 if (FXSYS_strcmp(module_name, ADDIN_NAME_CJK) == 0) { | 66 if (FXSYS_strcmp(module_name, ADDIN_NAME_CJK) == 0) { |
84 m_pPageModule->NotifyCJKAvailable(); | 67 m_pPageModule->NotifyCJKAvailable(); |
85 } else if (FXSYS_strcmp(module_name, ADDIN_NAME_DECODER) == 0) { | 68 } else if (FXSYS_strcmp(module_name, ADDIN_NAME_DECODER) == 0) { |
86 m_pRenderModule->NotifyDecoderAvailable(); | 69 m_pRenderModule->NotifyDecoderAvailable(); |
87 } | 70 } |
88 } | 71 } |
89 void CPDF_ModuleMgr::RegisterSecurityHandler(FX_LPCSTR filter, CPDF_SecurityHand
ler * (*CreateHandler)(void* param), void* param) | 72 void CPDF_ModuleMgr::RegisterSecurityHandler(FX_LPCSTR filter, CPDF_SecurityHand
ler * (*CreateHandler)(void* param), void* param) |
90 { | 73 { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : NULL; | 118 return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : NULL; |
136 } | 119 } |
137 ICodec_IccModule* CPDF_ModuleMgr::GetIccModule() | 120 ICodec_IccModule* CPDF_ModuleMgr::GetIccModule() |
138 { | 121 { |
139 return m_pCodecModule ? m_pCodecModule->GetIccModule() : NULL; | 122 return m_pCodecModule ? m_pCodecModule->GetIccModule() : NULL; |
140 } | 123 } |
141 ICodec_FlateModule* CPDF_ModuleMgr::GetFlateModule() | 124 ICodec_FlateModule* CPDF_ModuleMgr::GetFlateModule() |
142 { | 125 { |
143 return m_pCodecModule ? m_pCodecModule->GetFlateModule() : NULL; | 126 return m_pCodecModule ? m_pCodecModule->GetFlateModule() : NULL; |
144 } | 127 } |
OLD | NEW |