| 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 "../../core/include/fpdfapi/fpdf_module.h" | 10 #include "../../core/include/fpdfapi/fpdf_module.h" |
| 11 #include "../../core/include/fpdfapi/fpdf_pageobj.h" | 11 #include "../../core/include/fpdfapi/fpdf_pageobj.h" |
| 12 #include "../../core/include/fpdfapi/fpdf_parser.h" | 12 #include "../../core/include/fpdfapi/fpdf_parser.h" |
| 13 #include "../../core/include/fpdfapi/fpdf_parser.h" | 13 #include "../../core/include/fpdfapi/fpdf_parser.h" |
| 14 #include "../../core/include/fpdfapi/fpdf_render.h" | 14 #include "../../core/include/fpdfapi/fpdf_render.h" |
| 15 #include "../../core/include/fpdfapi/fpdf_serial.h" | 15 #include "../../core/include/fpdfapi/fpdf_serial.h" |
| 16 #include "../../core/include/fpdfapi/fpdfapi.h" | 16 #include "../../core/include/fpdfapi/fpdfapi.h" |
| 17 #include "../../core/include/fpdfdoc/fpdf_doc.h" | 17 #include "../../core/include/fpdfdoc/fpdf_doc.h" |
| 18 #include "../../core/include/fpdfdoc/fpdf_vt.h" | 18 #include "../../core/include/fpdfdoc/fpdf_vt.h" |
| 19 #include "../../core/include/fxge/fx_ge.h" | 19 #include "../../core/include/fxge/fx_ge.h" |
| 20 #include "../../core/include/fxge/fx_ge_win32.h" | 20 #include "../../core/include/fxge/fx_ge_win32.h" |
| 21 #include "../../public/fpdfview.h" | 21 #include "../../public/fpdfview.h" |
| 22 | 22 |
| 23 #ifdef _WIN32 | 23 #ifdef _WIN32 |
| 24 #include <tchar.h> | 24 #include <tchar.h> |
| 25 #include <math.h> | 25 #include <math.h> |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 #ifndef FX_ARGBTOCOLORREF | 28 #ifndef FX_ARGBTOCOLORREF |
| 29 /** @brief Convert a #FX_ARGB to a #FX_COLORREF. */ | 29 /** @brief Convert a #FX_ARGB to a #FX_COLORREF. */ |
| 30 #define FX_ARGBTOCOLORREF(argb)»» ((((FX_DWORD)argb & 0x00FF0000) >> 16)|(
(FX_DWORD)argb & 0x0000FF00)|(((FX_DWORD)argb & 0x000000FF) << 16)) | 30 #define FX_ARGBTOCOLORREF(argb) \ |
| 31 ((((FX_DWORD)argb & 0x00FF0000) >> 16) | ((FX_DWORD)argb & 0x0000FF00) | \ |
| 32 (((FX_DWORD)argb & 0x000000FF) << 16)) |
| 31 #endif | 33 #endif |
| 32 | 34 |
| 33 #ifndef FX_COLORREFTOARGB | 35 #ifndef FX_COLORREFTOARGB |
| 34 /** @brief Convert a #FX_COLORREF to a #FX_ARGB. */ | 36 /** @brief Convert a #FX_COLORREF to a #FX_ARGB. */ |
| 35 #define FX_COLORREFTOARGB(rgb)» » ((FX_DWORD)0xFF000000|(((FX_DWORD)rgb &
0x000000FF) << 16)|((FX_DWORD)rgb & 0x0000FF00)|(((FX_DWORD)rgb & 0x00FF0000) >>
16)) | 37 #define FX_COLORREFTOARGB(rgb) \ |
| 38 ((FX_DWORD)0xFF000000 | (((FX_DWORD)rgb & 0x000000FF) << 16) | \ |
| 39 ((FX_DWORD)rgb & 0x0000FF00) | (((FX_DWORD)rgb & 0x00FF0000) >> 16)) |
| 36 #endif | 40 #endif |
| 37 | 41 |
| 38 typedef unsigned int FX_UINT; | 42 typedef unsigned int FX_UINT; |
| 39 class CRenderContext; | 43 class CRenderContext; |
| 40 class IFSDK_PAUSE_Adapter; | 44 class IFSDK_PAUSE_Adapter; |
| 41 | 45 |
| 42 class CPDF_CustomAccess final : public IFX_FileRead | 46 class CPDF_CustomAccess final : public IFX_FileRead { |
| 43 { | 47 public: |
| 44 public: | 48 CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); |
| 45 » CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); | 49 ~CPDF_CustomAccess() {} |
| 46 » ~CPDF_CustomAccess() {} | |
| 47 | 50 |
| 48 » virtual FX_FILESIZE» GetSize() override { return m_FileAccess.m_FileL
en; } | 51 virtual FX_FILESIZE GetSize() override { return m_FileAccess.m_FileLen; } |
| 49 | 52 |
| 50 » virtual void» » Release() override { delete this; } | 53 virtual void Release() override { delete this; } |
| 51 | 54 |
| 52 » virtual FX_BOOL»» ReadBlock(void* buffer, FX_FILESIZE offset, size
_t size) override; | 55 virtual FX_BOOL ReadBlock(void* buffer, |
| 56 FX_FILESIZE offset, |
| 57 size_t size) override; |
| 53 | 58 |
| 54 private: | 59 private: |
| 55 » FPDF_FILEACCESS»» m_FileAccess; | 60 FPDF_FILEACCESS m_FileAccess; |
| 56 }; | 61 }; |
| 57 | 62 |
| 58 void DropContext(void* data); | 63 void DropContext(void* data); |
| 59 void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable); | 64 void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable); |
| 60 FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy); | 65 FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy); |
| 61 void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, | 66 void FPDF_RenderPage_Retail(CRenderContext* pContext, |
| 62 int start_x, int start_y, int size_x, int size_y, | 67 FPDF_PAGE page, |
| 63 int rotate, int flags, FX_BOOL bNeedToRestore, | 68 int start_x, |
| 69 int start_y, |
| 70 int size_x, |
| 71 int size_y, |
| 72 int rotate, |
| 73 int flags, |
| 74 FX_BOOL bNeedToRestore, |
| 64 IFSDK_PAUSE_Adapter* pause); | 75 IFSDK_PAUSE_Adapter* pause); |
| 65 | 76 |
| 66 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ | 77 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |
| OLD | NEW |