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 #ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_DEFINE_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |
9 | 9 |
10 #include "../../xfa/include/fwl/adapter/fwl_adaptertimermgr.h" | 10 #include "../../xfa/include/fwl/adapter/fwl_adaptertimermgr.h" |
11 #include "../../xfa/include/fxbarcode/BC_BarCode.h" | 11 #include "../../xfa/include/fxbarcode/BC_BarCode.h" |
12 #include "../../xfa/include/fxfa/fxfa.h" | 12 #include "../../xfa/include/fxfa/fxfa.h" |
13 #include "../../xfa/include/fxgraphics/fx_graphics.h" | 13 #include "../../xfa/include/fxgraphics/fx_graphics.h" |
14 #include "../../xfa/include/fxjse/fxjse.h" | 14 #include "../../xfa/include/fxjse/fxjse.h" |
15 #include "core/include/fpdfapi/fpdf_module.h" | 15 #include "core/include/fpdfapi/fpdf_module.h" |
16 #include "core/include/fpdfapi/fpdf_pageobj.h" | 16 #include "core/include/fpdfapi/fpdf_pageobj.h" |
17 #include "core/include/fpdfapi/fpdf_parser.h" | 17 #include "core/include/fpdfapi/fpdf_parser.h" |
18 #include "core/include/fpdfapi/fpdf_render.h" | 18 #include "core/include/fpdfapi/fpdf_render.h" |
19 #include "core/include/fpdfapi/fpdf_serial.h" | 19 #include "core/include/fpdfapi/fpdf_serial.h" |
20 #include "core/include/fpdfapi/fpdfapi.h" | 20 #include "core/include/fpdfapi/fpdfapi.h" |
21 #include "core/include/fpdfdoc/fpdf_doc.h" | 21 #include "core/include/fpdfdoc/fpdf_doc.h" |
22 #include "core/include/fpdfdoc/fpdf_vt.h" | 22 #include "core/include/fpdfdoc/fpdf_vt.h" |
23 #include "core/include/fxge/fx_ge.h" | 23 #include "core/include/fxge/fx_ge.h" |
24 #include "core/include/fxge/fx_ge_win32.h" | 24 #include "core/include/fxge/fx_ge_win32.h" |
| 25 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" |
| 26 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h" |
25 #include "public/fpdfview.h" | 27 #include "public/fpdfview.h" |
26 | 28 |
27 #ifdef _WIN32 | 29 #ifdef _WIN32 |
28 #include <tchar.h> | 30 #include <tchar.h> |
29 #include <math.h> | 31 #include <math.h> |
30 #endif | 32 #endif |
31 | 33 |
32 // Convert a #FX_ARGB to a #FX_COLORREF. | 34 // Convert a #FX_ARGB to a #FX_COLORREF. |
33 #define FX_ARGBTOCOLORREF(argb) \ | 35 #define FX_ARGBTOCOLORREF(argb) \ |
34 ((((FX_DWORD)argb & 0x00FF0000) >> 16) | ((FX_DWORD)argb & 0x0000FF00) | \ | 36 ((((FX_DWORD)argb & 0x00FF0000) >> 16) | ((FX_DWORD)argb & 0x0000FF00) | \ |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 virtual FX_BOOL WriteBlock(const void* buffer, | 82 virtual FX_BOOL WriteBlock(const void* buffer, |
81 FX_FILESIZE offset, | 83 FX_FILESIZE offset, |
82 size_t size); | 84 size_t size); |
83 virtual FX_BOOL Flush(); | 85 virtual FX_BOOL Flush(); |
84 | 86 |
85 protected: | 87 protected: |
86 FPDF_FILEHANDLER* m_pFS; | 88 FPDF_FILEHANDLER* m_pFS; |
87 FX_FILESIZE m_nCurPos; | 89 FX_FILESIZE m_nCurPos; |
88 }; | 90 }; |
89 | 91 |
| 92 // Object types for public FPDF_ types; these correspond to next layer down |
| 93 // from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are |
| 94 // CPDFXFA_ types. |
| 95 using UnderlyingDocumentType = CPDFXFA_Document; |
| 96 using UnderlyingPageType = CPDFXFA_Page; |
| 97 |
| 98 // Conversions to/from underlying types. |
| 99 UnderlyingDocumentType* UnderlyingFromFPDFDocument(FPDF_DOCUMENT doc); |
| 100 FPDF_DOCUMENT FPDFDocumentFromUnderlying(UnderlyingDocumentType* doc); |
| 101 |
| 102 UnderlyingPageType* UnderlyingFromFPDFPage(FPDF_PAGE page); |
| 103 |
90 // Conversions to/from FPDF_ types. | 104 // Conversions to/from FPDF_ types. |
91 CPDF_Document* CPDFDocumentFromFPDFDocument(FPDF_DOCUMENT doc); | 105 CPDF_Document* CPDFDocumentFromFPDFDocument(FPDF_DOCUMENT doc); |
92 FPDF_DOCUMENT FPDFDocumentFromCPDFDocument(CPDF_Document* doc); | 106 FPDF_DOCUMENT FPDFDocumentFromCPDFDocument(CPDF_Document* doc); |
93 | 107 |
94 CPDF_Page* CPDFPageFromFPDFPage(FPDF_PAGE page); | 108 CPDF_Page* CPDFPageFromFPDFPage(FPDF_PAGE page); |
95 | 109 |
96 void DropContext(void* data); | 110 void DropContext(void* data); |
97 void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable); | 111 void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable); |
98 FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy); | 112 FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy); |
99 void FPDF_RenderPage_Retail(CRenderContext* pContext, | 113 void FPDF_RenderPage_Retail(CRenderContext* pContext, |
100 FPDF_PAGE page, | 114 FPDF_PAGE page, |
101 int start_x, | 115 int start_x, |
102 int start_y, | 116 int start_y, |
103 int size_x, | 117 int size_x, |
104 int size_y, | 118 int size_y, |
105 int rotate, | 119 int rotate, |
106 int flags, | 120 int flags, |
107 FX_BOOL bNeedToRestore, | 121 FX_BOOL bNeedToRestore, |
108 IFSDK_PAUSE_Adapter* pause); | 122 IFSDK_PAUSE_Adapter* pause); |
109 | 123 |
110 void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code); | 124 void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code); |
111 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); | 125 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot); |
112 void ProcessParseError(FX_DWORD err_code); | 126 void ProcessParseError(FX_DWORD err_code); |
113 | 127 |
114 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ | 128 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |
OLD | NEW |