| 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 CORE_INCLUDE_FXCRT_FX_BASIC_H_ | 7 #ifndef CORE_INCLUDE_FXCRT_FX_BASIC_H_ |
| 8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_ | 8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_ |
| 9 | 9 |
| 10 #include "fx_memory.h" | 10 #include "fx_memory.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 FX_BOOL Read(void* pBuf, FX_DWORD dwSize); | 187 FX_BOOL Read(void* pBuf, FX_DWORD dwSize); |
| 188 | 188 |
| 189 protected: | 189 protected: |
| 190 FX_DWORD m_LoadingPos; | 190 FX_DWORD m_LoadingPos; |
| 191 | 191 |
| 192 const uint8_t* m_pLoadingBuf; | 192 const uint8_t* m_pLoadingBuf; |
| 193 | 193 |
| 194 FX_DWORD m_LoadingSize; | 194 FX_DWORD m_LoadingSize; |
| 195 }; | 195 }; |
| 196 #endif | 196 #endif // PDF_ENABLE_XFA |
| 197 | 197 |
| 198 class IFX_BufferArchive { | 198 class IFX_BufferArchive { |
| 199 public: | 199 public: |
| 200 IFX_BufferArchive(FX_STRSIZE size); | 200 IFX_BufferArchive(FX_STRSIZE size); |
| 201 virtual ~IFX_BufferArchive() {} | 201 virtual ~IFX_BufferArchive() {} |
| 202 | 202 |
| 203 virtual void Clear(); | 203 virtual void Clear(); |
| 204 | 204 |
| 205 FX_BOOL Flush(); | 205 FX_BOOL Flush(); |
| 206 | 206 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } | 434 } |
| 435 }; | 435 }; |
| 436 typedef CFX_ArrayTemplate<uint8_t> CFX_ByteArray; | 436 typedef CFX_ArrayTemplate<uint8_t> CFX_ByteArray; |
| 437 typedef CFX_ArrayTemplate<FX_WORD> CFX_WordArray; | 437 typedef CFX_ArrayTemplate<FX_WORD> CFX_WordArray; |
| 438 typedef CFX_ArrayTemplate<FX_DWORD> CFX_DWordArray; | 438 typedef CFX_ArrayTemplate<FX_DWORD> CFX_DWordArray; |
| 439 typedef CFX_ArrayTemplate<void*> CFX_PtrArray; | 439 typedef CFX_ArrayTemplate<void*> CFX_PtrArray; |
| 440 typedef CFX_ArrayTemplate<FX_FILESIZE> CFX_FileSizeArray; | 440 typedef CFX_ArrayTemplate<FX_FILESIZE> CFX_FileSizeArray; |
| 441 #ifdef PDF_ENABLE_XFA | 441 #ifdef PDF_ENABLE_XFA |
| 442 typedef CFX_ArrayTemplate<FX_FLOAT> CFX_FloatArray; | 442 typedef CFX_ArrayTemplate<FX_FLOAT> CFX_FloatArray; |
| 443 typedef CFX_ArrayTemplate<int32_t> CFX_Int32Array; | 443 typedef CFX_ArrayTemplate<int32_t> CFX_Int32Array; |
| 444 #endif | 444 #endif // PDF_ENABLE_XFA |
| 445 | 445 |
| 446 template <class ObjectClass> | 446 template <class ObjectClass> |
| 447 class CFX_ObjectArray : public CFX_BasicArray { | 447 class CFX_ObjectArray : public CFX_BasicArray { |
| 448 public: | 448 public: |
| 449 CFX_ObjectArray() : CFX_BasicArray(sizeof(ObjectClass)) {} | 449 CFX_ObjectArray() : CFX_BasicArray(sizeof(ObjectClass)) {} |
| 450 | 450 |
| 451 ~CFX_ObjectArray() { RemoveAll(); } | 451 ~CFX_ObjectArray() { RemoveAll(); } |
| 452 | 452 |
| 453 void Add(const ObjectClass& data) { | 453 void Add(const ObjectClass& data) { |
| 454 new ((void*)InsertSpaceAt(m_nSize, 1)) ObjectClass(data); | 454 new ((void*)InsertSpaceAt(m_nSize, 1)) ObjectClass(data); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 return (ValueType&)CFX_MapPtrToPtr::operator[]((void*)(uintptr_t)key); | 721 return (ValueType&)CFX_MapPtrToPtr::operator[]((void*)(uintptr_t)key); |
| 722 } | 722 } |
| 723 | 723 |
| 724 void SetAt(KeyType key, ValueType newValue) { | 724 void SetAt(KeyType key, ValueType newValue) { |
| 725 CFX_MapPtrToPtr::SetAt((void*)(uintptr_t)key, (void*)(uintptr_t)newValue); | 725 CFX_MapPtrToPtr::SetAt((void*)(uintptr_t)key, (void*)(uintptr_t)newValue); |
| 726 } | 726 } |
| 727 | 727 |
| 728 FX_BOOL RemoveKey(KeyType key) { | 728 FX_BOOL RemoveKey(KeyType key) { |
| 729 return CFX_MapPtrToPtr::RemoveKey((void*)(uintptr_t)key); | 729 return CFX_MapPtrToPtr::RemoveKey((void*)(uintptr_t)key); |
| 730 } | 730 } |
| 731 #endif | |
| 732 | 731 |
| 733 #ifdef PDF_ENABLE_XFA | |
| 734 void GetNextAssoc(FX_POSITION& rNextPosition, | 732 void GetNextAssoc(FX_POSITION& rNextPosition, |
| 735 KeyType& rKey, | 733 KeyType& rKey, |
| 736 ValueType& rValue) const { | 734 ValueType& rValue) const { |
| 737 void* pKey = NULL; | 735 void* pKey = NULL; |
| 738 void* pValue = NULL; | 736 void* pValue = NULL; |
| 739 CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); | 737 CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); |
| 740 rKey = (KeyType)(uintptr_t)pKey; | 738 rKey = (KeyType)(uintptr_t)pKey; |
| 741 rValue = (ValueType)(uintptr_t)pValue; | 739 rValue = (ValueType)(uintptr_t)pValue; |
| 742 } | 740 } |
| 743 }; | 741 }; |
| 744 #endif | 742 #endif // PDF_ENABLE_XFA |
| 745 class CFX_CMapByteStringToPtr { | 743 class CFX_CMapByteStringToPtr { |
| 746 public: | 744 public: |
| 747 CFX_CMapByteStringToPtr(); | 745 CFX_CMapByteStringToPtr(); |
| 748 | 746 |
| 749 ~CFX_CMapByteStringToPtr(); | 747 ~CFX_CMapByteStringToPtr(); |
| 750 | 748 |
| 751 void RemoveAll(); | 749 void RemoveAll(); |
| 752 | 750 |
| 753 FX_POSITION GetStartPosition() const; | 751 FX_POSITION GetStartPosition() const; |
| 754 | 752 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 #define ProgressiveStatus FX_ProgressiveStatus | 1194 #define ProgressiveStatus FX_ProgressiveStatus |
| 1197 #define FX_NAMESPACE_DECLARE(namespace, type) namespace ::type | 1195 #define FX_NAMESPACE_DECLARE(namespace, type) namespace ::type |
| 1198 #ifdef PDF_ENABLE_XFA | 1196 #ifdef PDF_ENABLE_XFA |
| 1199 class IFX_Unknown { | 1197 class IFX_Unknown { |
| 1200 public: | 1198 public: |
| 1201 virtual ~IFX_Unknown() {} | 1199 virtual ~IFX_Unknown() {} |
| 1202 virtual FX_DWORD Release() = 0; | 1200 virtual FX_DWORD Release() = 0; |
| 1203 virtual FX_DWORD AddRef() = 0; | 1201 virtual FX_DWORD AddRef() = 0; |
| 1204 }; | 1202 }; |
| 1205 #define FX_IsOdd(a) ((a)&1) | 1203 #define FX_IsOdd(a) ((a)&1) |
| 1206 #endif | 1204 #endif // PDF_ENABLE_XFA |
| 1207 | 1205 |
| 1208 class CFX_Vector_3by1 { | 1206 class CFX_Vector_3by1 { |
| 1209 public: | 1207 public: |
| 1210 CFX_Vector_3by1() : a(0.0f), b(0.0f), c(0.0f) {} | 1208 CFX_Vector_3by1() : a(0.0f), b(0.0f), c(0.0f) {} |
| 1211 | 1209 |
| 1212 CFX_Vector_3by1(FX_FLOAT a1, FX_FLOAT b1, FX_FLOAT c1) | 1210 CFX_Vector_3by1(FX_FLOAT a1, FX_FLOAT b1, FX_FLOAT c1) |
| 1213 : a(a1), b(b1), c(c1) {} | 1211 : a(a1), b(b1), c(c1) {} |
| 1214 | 1212 |
| 1215 FX_FLOAT a; | 1213 FX_FLOAT a; |
| 1216 FX_FLOAT b; | 1214 FX_FLOAT b; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 FX_FLOAT c; | 1249 FX_FLOAT c; |
| 1252 FX_FLOAT d; | 1250 FX_FLOAT d; |
| 1253 FX_FLOAT e; | 1251 FX_FLOAT e; |
| 1254 FX_FLOAT f; | 1252 FX_FLOAT f; |
| 1255 FX_FLOAT g; | 1253 FX_FLOAT g; |
| 1256 FX_FLOAT h; | 1254 FX_FLOAT h; |
| 1257 FX_FLOAT i; | 1255 FX_FLOAT i; |
| 1258 }; | 1256 }; |
| 1259 | 1257 |
| 1260 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ | 1258 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ |
| OLD | NEW |