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 "../include/fpdfxfa/fpdfxfa_app.h" | 9 #include "../include/fpdfxfa/fpdfxfa_app.h" |
10 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 10 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 return FALSE; | 185 return FALSE; |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 CCodec_ModuleMgr* g_pCodecModule = nullptr; | 189 CCodec_ModuleMgr* g_pCodecModule = nullptr; |
190 | 190 |
191 DLLEXPORT void STDCALL FPDF_InitLibrary() { | 191 DLLEXPORT void STDCALL FPDF_InitLibrary() { |
192 FPDF_InitLibraryWithConfig(nullptr); | 192 FPDF_InitLibraryWithConfig(nullptr); |
193 } | 193 } |
194 | 194 |
195 DLLEXPORT void STDCALL | 195 DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig( |
196 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { | 196 const FPDF_LIBRARY_CONFIG* cfg) { |
197 g_pCodecModule = new CCodec_ModuleMgr(); | 197 g_pCodecModule = new CCodec_ModuleMgr(); |
198 | 198 |
199 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr); | 199 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr); |
200 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); | 200 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); |
201 | 201 |
202 CPDF_ModuleMgr::Create(); | 202 CPDF_ModuleMgr::Create(); |
203 CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule); | 203 CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule); |
204 CPDF_ModuleMgr::Get()->InitPageModule(); | 204 CPDF_ModuleMgr::Get()->InitPageModule(); |
205 CPDF_ModuleMgr::Get()->InitRenderModule(); | 205 CPDF_ModuleMgr::Get()->InitRenderModule(); |
206 CPDFXFA_App::GetInstance()->Initialize(); | 206 CPDFXFA_App::GetInstance()->Initialize(); |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 if (flags & FPDF_ANNOT) { | 845 if (flags & FPDF_ANNOT) { |
846 pContext->m_pAnnots = new CPDF_AnnotList(pPage); | 846 pContext->m_pAnnots = new CPDF_AnnotList(pPage); |
847 FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY; | 847 FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY; |
848 pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, | 848 pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, |
849 &matrix, TRUE, NULL); | 849 &matrix, TRUE, NULL); |
850 } | 850 } |
851 | 851 |
852 pContext->m_pRenderer = new CPDF_ProgressiveRenderer( | 852 pContext->m_pRenderer = new CPDF_ProgressiveRenderer( |
853 pContext->m_pContext, pContext->m_pDevice, pContext->m_pOptions); | 853 pContext->m_pContext, pContext->m_pDevice, pContext->m_pOptions); |
854 pContext->m_pRenderer->Start(pause); | 854 pContext->m_pRenderer->Start(pause); |
855 if (bNeedToRestore) { | 855 if (bNeedToRestore) |
856 pContext->m_pDevice->RestoreState(); | 856 pContext->m_pDevice->RestoreState(); |
857 } | |
858 } | 857 } |
859 | 858 |
860 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, | 859 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, |
861 int page_index, | 860 int page_index, |
862 double* width, | 861 double* width, |
863 double* height) { | 862 double* height) { |
864 CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document; | 863 CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document; |
865 if (pDoc == NULL) | 864 if (pDoc == NULL) |
866 return FALSE; | 865 return FALSE; |
867 | 866 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 if (!buffer) { | 1056 if (!buffer) { |
1058 *buflen = len; | 1057 *buflen = len; |
1059 } else if (*buflen >= len) { | 1058 } else if (*buflen >= len) { |
1060 memcpy(buffer, utf16Name.c_str(), len); | 1059 memcpy(buffer, utf16Name.c_str(), len); |
1061 *buflen = len; | 1060 *buflen = len; |
1062 } else { | 1061 } else { |
1063 *buflen = -1; | 1062 *buflen = -1; |
1064 } | 1063 } |
1065 return (FPDF_DEST)pDestObj; | 1064 return (FPDF_DEST)pDestObj; |
1066 } | 1065 } |
OLD | NEW |