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 "../../core/include/fpdfapi/fpdf_module.h" | 7 #include "../../core/include/fpdfapi/fpdf_module.h" |
8 #include "../../core/include/fxcodec/fx_codec.h" | 8 #include "../../core/include/fxcodec/fx_codec.h" |
9 #include "../../core/include/fxcrt/fx_safe_types.h" | 9 #include "../../core/include/fxcrt/fx_safe_types.h" |
10 #include "../../public/fpdf_ext.h" | 10 #include "../../public/fpdf_ext.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } break; | 173 } break; |
174 default: | 174 default: |
175 break; | 175 break; |
176 } | 176 } |
177 return FALSE; | 177 return FALSE; |
178 } | 178 } |
179 | 179 |
180 CCodec_ModuleMgr* g_pCodecModule = nullptr; | 180 CCodec_ModuleMgr* g_pCodecModule = nullptr; |
181 | 181 |
182 DLLEXPORT void STDCALL FPDF_InitLibrary() { | 182 DLLEXPORT void STDCALL FPDF_InitLibrary() { |
| 183 FPDF_InitLibraryWithConfig(nullptr); |
| 184 } |
| 185 |
| 186 DLLEXPORT void STDCALL |
| 187 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { |
183 g_pCodecModule = new CCodec_ModuleMgr(); | 188 g_pCodecModule = new CCodec_ModuleMgr(); |
184 | 189 |
185 CFX_GEModule::Create(); | 190 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr); |
186 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); | 191 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); |
187 | 192 |
188 CPDF_ModuleMgr::Create(); | 193 CPDF_ModuleMgr::Create(); |
189 CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule); | 194 CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule); |
190 CPDF_ModuleMgr::Get()->InitPageModule(); | 195 CPDF_ModuleMgr::Get()->InitPageModule(); |
191 CPDF_ModuleMgr::Get()->InitRenderModule(); | 196 CPDF_ModuleMgr::Get()->InitRenderModule(); |
192 | 197 |
193 CPDFXFA_App::GetInstance()->Initialize(); | 198 CPDFXFA_App::GetInstance()->Initialize(); |
194 } | 199 } |
195 | 200 |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 if (!buffer) { | 1097 if (!buffer) { |
1093 *buflen = len; | 1098 *buflen = len; |
1094 } else if (*buflen >= len) { | 1099 } else if (*buflen >= len) { |
1095 memcpy(buffer, utf16Name.c_str(), len); | 1100 memcpy(buffer, utf16Name.c_str(), len); |
1096 *buflen = len; | 1101 *buflen = len; |
1097 } else { | 1102 } else { |
1098 *buflen = -1; | 1103 *buflen = -1; |
1099 } | 1104 } |
1100 return (FPDF_DEST)pDestObj; | 1105 return (FPDF_DEST)pDestObj; |
1101 } | 1106 } |
OLD | NEW |