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 "public/fpdfview.h" | 7 #include "public/fpdfview.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return FALSE; | 223 return FALSE; |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 CCodec_ModuleMgr* g_pCodecModule = nullptr; | 227 CCodec_ModuleMgr* g_pCodecModule = nullptr; |
228 | 228 |
229 DLLEXPORT void STDCALL FPDF_InitLibrary() { | 229 DLLEXPORT void STDCALL FPDF_InitLibrary() { |
230 FPDF_InitLibraryWithConfig(nullptr); | 230 FPDF_InitLibraryWithConfig(nullptr); |
231 } | 231 } |
232 | 232 |
233 DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig( | 233 DLLEXPORT void STDCALL |
234 const FPDF_LIBRARY_CONFIG* cfg) { | 234 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { |
235 g_pCodecModule = new CCodec_ModuleMgr(); | 235 g_pCodecModule = new CCodec_ModuleMgr(); |
236 | 236 |
237 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr); | 237 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr); |
238 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); | 238 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); |
239 | 239 |
240 CPDF_ModuleMgr::Create(); | 240 CPDF_ModuleMgr::Create(); |
241 CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get(); | 241 CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get(); |
242 pModuleMgr->SetCodecModule(g_pCodecModule); | 242 pModuleMgr->SetCodecModule(g_pCodecModule); |
243 pModuleMgr->InitPageModule(); | 243 pModuleMgr->InitPageModule(); |
244 pModuleMgr->InitRenderModule(); | 244 pModuleMgr->InitRenderModule(); |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 if (!buffer) { | 1136 if (!buffer) { |
1137 *buflen = len; | 1137 *buflen = len; |
1138 } else if (*buflen >= len) { | 1138 } else if (*buflen >= len) { |
1139 memcpy(buffer, utf16Name.c_str(), len); | 1139 memcpy(buffer, utf16Name.c_str(), len); |
1140 *buflen = len; | 1140 *buflen = len; |
1141 } else { | 1141 } else { |
1142 *buflen = -1; | 1142 *buflen = -1; |
1143 } | 1143 } |
1144 return (FPDF_DEST)pDestObj; | 1144 return (FPDF_DEST)pDestObj; |
1145 } | 1145 } |
OLD | NEW |