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" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ((FX_DWORD)rgb & 0x0000FF00) | (((FX_DWORD)rgb & 0x00FF0000) >> 16)) | 43 ((FX_DWORD)rgb & 0x0000FF00) | (((FX_DWORD)rgb & 0x00FF0000) >> 16)) |
44 #endif | 44 #endif |
45 | 45 |
46 typedef unsigned int FX_UINT; | 46 typedef unsigned int FX_UINT; |
47 class CRenderContext; | 47 class CRenderContext; |
48 class IFSDK_PAUSE_Adapter; | 48 class IFSDK_PAUSE_Adapter; |
49 | 49 |
50 class CPDF_CustomAccess final : public IFX_FileRead { | 50 class CPDF_CustomAccess final : public IFX_FileRead { |
51 public: | 51 public: |
52 CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); | 52 CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess); |
53 ~CPDF_CustomAccess() {} | 53 ~CPDF_CustomAccess() override {} |
| 54 |
| 55 // IFX_FileRead |
| 56 FX_FILESIZE GetSize() override { return m_FileAccess.m_FileLen; } |
| 57 void Release() override { delete this; } |
| 58 FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; |
54 | 59 |
55 virtual CFX_ByteString GetFullPath() { return ""; } | 60 virtual CFX_ByteString GetFullPath() { return ""; } |
56 virtual FX_FILESIZE GetSize() override { return m_FileAccess.m_FileLen; } | |
57 virtual FX_BOOL GetByte(FX_DWORD pos, uint8_t& ch); | 61 virtual FX_BOOL GetByte(FX_DWORD pos, uint8_t& ch); |
58 virtual FX_BOOL GetBlock(FX_DWORD pos, uint8_t* pBuf, FX_DWORD size); | 62 virtual FX_BOOL GetBlock(FX_DWORD pos, uint8_t* pBuf, FX_DWORD size); |
59 virtual void Release() override { delete this; } | |
60 virtual FX_BOOL ReadBlock(void* buffer, | |
61 FX_FILESIZE offset, | |
62 size_t size) override; | |
63 | 63 |
64 FPDF_FILEACCESS m_FileAccess; | 64 FPDF_FILEACCESS m_FileAccess; |
65 uint8_t m_Buffer[512]; | 65 uint8_t m_Buffer[512]; |
66 FX_DWORD m_BufferOffset; | 66 FX_DWORD m_BufferOffset; |
67 }; | 67 }; |
68 | 68 |
69 class CFPDF_FileStream : public IFX_FileStream { | 69 class CFPDF_FileStream : public IFX_FileStream { |
70 public: | 70 public: |
71 CFPDF_FileStream(FPDF_FILEHANDLER* pFS); | 71 CFPDF_FileStream(FPDF_FILEHANDLER* pFS); |
72 virtual ~CFPDF_FileStream() {} | 72 virtual ~CFPDF_FileStream() {} |
(...skipping 25 matching lines...) Expand all Loading... |
98 int start_x, | 98 int start_x, |
99 int start_y, | 99 int start_y, |
100 int size_x, | 100 int size_x, |
101 int size_y, | 101 int size_y, |
102 int rotate, | 102 int rotate, |
103 int flags, | 103 int flags, |
104 FX_BOOL bNeedToRestore, | 104 FX_BOOL bNeedToRestore, |
105 IFSDK_PAUSE_Adapter* pause); | 105 IFSDK_PAUSE_Adapter* pause); |
106 | 106 |
107 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ | 107 #endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_ |
OLD | NEW |