Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: core/include/fpdfapi/fpdf_resource.h

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/include/fpdfapi/fpdf_render.h ('k') | core/include/fpdfapi/fpdf_serial.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_FPDFAPI_FPDF_RESOURCE_H_ 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_
8 #define CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ 8 #define CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_
9 9
10 #include "../fxge/fx_font.h" 10 #include "../fxge/fx_font.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 FXFT_Face GetFace() const 153 FXFT_Face GetFace() const
154 { 154 {
155 return m_Font.GetFace(); 155 return m_Font.GetFace();
156 } 156 }
157 157
158 virtual FX_DWORD GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) const 158 virtual FX_DWORD GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) const
159 { 159 {
160 if (offset < 0 || nStrLen < 1) { 160 if (offset < 0 || nStrLen < 1) {
161 return 0; 161 return 0;
162 } 162 }
163 FX_BYTE ch = offset < nStrLen ? pString[offset++] : pString[nStrLen-1]; 163 uint8_t ch = offset < nStrLen ? pString[offset++] : pString[nStrLen-1];
164 return static_cast<FX_DWORD>(ch); 164 return static_cast<FX_DWORD>(ch);
165 } 165 }
166 166
167 virtual int CountChar(FX_LPCSTR pString, int size) c onst 167 virtual int CountChar(FX_LPCSTR pString, int size) c onst
168 { 168 {
169 return size; 169 return size;
170 } 170 }
171 171
172 void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const; 172 void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const;
173 173
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 public: 319 public:
320 320
321 CPDF_FontEncoding(); 321 CPDF_FontEncoding();
322 322
323 CPDF_FontEncoding(int PredefinedEncoding); 323 CPDF_FontEncoding(int PredefinedEncoding);
324 324
325 void LoadEncoding(CPDF_Object* pEncod ing); 325 void LoadEncoding(CPDF_Object* pEncod ing);
326 326
327 FX_BOOL IsIdentical(CPDF_FontEncoding* p Another) const; 327 FX_BOOL IsIdentical(CPDF_FontEncoding* p Another) const;
328 328
329 FX_WCHAR» » » » UnicodeFromCharCode(FX_BYTE charcode) co nst 329 FX_WCHAR» » » » UnicodeFromCharCode(uint8_t charcode) co nst
330 { 330 {
331 return m_Unicodes[charcode]; 331 return m_Unicodes[charcode];
332 } 332 }
333 333
334 int CharCodeFromUnicode(FX_WCHAR uni code) const; 334 int CharCodeFromUnicode(FX_WCHAR uni code) const;
335 335
336 void» » » » » SetUnicode(FX_BYTE charcode, FX_ WCHAR unicode) 336 void» » » » » SetUnicode(uint8_t charcode, FX_ WCHAR unicode)
337 { 337 {
338 m_Unicodes[charcode] = unicode; 338 m_Unicodes[charcode] = unicode;
339 } 339 }
340 340
341 CPDF_Object* Realize(); 341 CPDF_Object* Realize();
342 public: 342 public:
343 343
344 FX_WCHAR m_Unicodes[256]; 344 FX_WCHAR m_Unicodes[256];
345 }; 345 };
346 class CPDF_SimpleFont : public CPDF_Font 346 class CPDF_SimpleFont : public CPDF_Font
(...skipping 14 matching lines...) Expand all
361 361
362 FX_BOOL LoadCommon(); 362 FX_BOOL LoadCommon();
363 363
364 void LoadSubstFont(); 364 void LoadSubstFont();
365 365
366 void LoadFaceMetrics(); 366 void LoadFaceMetrics();
367 367
368 virtual void LoadGlyphMap() = 0; 368 virtual void LoadGlyphMap() = 0;
369 virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const 369 virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const
370 { 370 {
371 return m_Encoding.UnicodeFromCharCode((FX_BYTE)charcode); 371 return m_Encoding.UnicodeFromCharCode((uint8_t)charcode);
372 } 372 }
373 virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const 373 virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const
374 { 374 {
375 return m_Encoding.CharCodeFromUnicode(Unicode); 375 return m_Encoding.CharCodeFromUnicode(Unicode);
376 } 376 }
377 377
378 378
379 379
380 CPDF_FontEncoding m_Encoding; 380 CPDF_FontEncoding m_Encoding;
381 381
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 #define PDF_IMAGE_MASK_LOSSLESS_COMPRESS 0x0008 824 #define PDF_IMAGE_MASK_LOSSLESS_COMPRESS 0x0008
825 class CPDF_ImageSetParam 825 class CPDF_ImageSetParam
826 { 826 {
827 public: 827 public:
828 CPDF_ImageSetParam() 828 CPDF_ImageSetParam()
829 : pMatteColor(NULL) 829 : pMatteColor(NULL)
830 , nQuality(80) 830 , nQuality(80)
831 { 831 {
832 } 832 }
833 FX_ARGB* pMatteColor; 833 FX_ARGB* pMatteColor;
834 FX_INT32 nQuality; 834 int32_t nQuality;
835 }; 835 };
836 class CPDF_Image 836 class CPDF_Image
837 { 837 {
838 public: 838 public:
839 839
840 CPDF_Image(CPDF_Document* pDoc); 840 CPDF_Image(CPDF_Document* pDoc);
841 841
842 ~CPDF_Image(); 842 ~CPDF_Image();
843 843
844 FX_BOOL LoadImageF(CPDF_Stream* pImageSt ream, FX_BOOL bInline); 844 FX_BOOL LoadImageF(CPDF_Stream* pImageSt ream, FX_BOOL bInline);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 return m_pOC; 877 return m_pOC;
878 } 878 }
879 879
880 CPDF_Document* GetDocument() const 880 CPDF_Document* GetDocument() const
881 { 881 {
882 return m_pDocument; 882 return m_pDocument;
883 } 883 }
884 884
885 885
886 886
887 FX_INT32» » » » GetPixelHeight() const 887 int32_t» » » » GetPixelHeight() const
888 { 888 {
889 return m_Height; 889 return m_Height;
890 } 890 }
891 891
892 FX_INT32» » » » GetPixelWidth() const 892 int32_t» » » » GetPixelWidth() const
893 { 893 {
894 return m_Width; 894 return m_Width;
895 } 895 }
896 896
897 897
898 FX_BOOL IsMask() const 898 FX_BOOL IsMask() const
899 { 899 {
900 return m_bIsMask; 900 return m_bIsMask;
901 } 901 }
902 902
903 FX_BOOL IsInterpol() const 903 FX_BOOL IsInterpol() const
904 { 904 {
905 return m_bInterpolate; 905 return m_bInterpolate;
906 } 906 }
907 907
908 CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = N ULL, FX_DWORD* pMatteColor = NULL, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE) const; 908 CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = N ULL, FX_DWORD* pMatteColor = NULL, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE) const;
909 909
910 910
911 911
912 void» » » » » SetImage(const CFX_DIBitmap* pDI Bitmap, FX_INT32 iCompress, IFX_FileWrite *pFileWrite = NULL, IFX_FileRead *pFil eRead = NULL, const CFX_DIBitmap* pMask = NULL, const CPDF_ImageSetParam* pParam = NULL); 912 void» » » » » SetImage(const CFX_DIBitmap* pDI Bitmap, int32_t iCompress, IFX_FileWrite *pFileWrite = NULL, IFX_FileRead *pFile Read = NULL, const CFX_DIBitmap* pMask = NULL, const CPDF_ImageSetParam* pParam = NULL);
913 913
914 void» » » » » SetJpegImage(FX_BYTE* pImageData , FX_DWORD size); 914 void» » » » » SetJpegImage(uint8_t* pImageData , FX_DWORD size);
915 915
916 void SetJpegImage(IFX_FileRead *pFile ); 916 void SetJpegImage(IFX_FileRead *pFile );
917 917
918 void ResetCache(CPDF_Page* pPage, con st CFX_DIBitmap* pDIBitmap); 918 void ResetCache(CPDF_Page* pPage, con st CFX_DIBitmap* pDIBitmap);
919 919
920 public: 920 public:
921 FX_BOOL StartLoadDIBSource(CPDF_Dictiona ry* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS = FALSE, FX_DW ORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE); 921 FX_BOOL StartLoadDIBSource(CPDF_Dictiona ry* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS = FALSE, FX_DW ORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
922 FX_BOOL Continue(IFX_Pause* pPause); 922 FX_BOOL Continue(IFX_Pause* pPause);
923 CFX_DIBSource* DetachBitmap(); 923 CFX_DIBSource* DetachBitmap();
924 CFX_DIBSource* DetachMask(); 924 CFX_DIBSource* DetachMask();
925 CFX_DIBSource* m_pDIBSource; 925 CFX_DIBSource* m_pDIBSource;
926 CFX_DIBSource* m_pMask; 926 CFX_DIBSource* m_pMask;
927 FX_DWORD m_MatteColor; 927 FX_DWORD m_MatteColor;
928 private: 928 private:
929 929
930 CPDF_Stream* m_pStream; 930 CPDF_Stream* m_pStream;
931 FX_BOOL m_bInline; 931 FX_BOOL m_bInline;
932 CPDF_Dictionary* m_pInlineDict; 932 CPDF_Dictionary* m_pInlineDict;
933 933
934 FX_INT32» » » » m_Height; 934 int32_t» » » » m_Height;
935 935
936 FX_INT32» » » » m_Width; 936 int32_t» » » » m_Width;
937 937
938 FX_BOOL m_bIsMask; 938 FX_BOOL m_bIsMask;
939 939
940 FX_BOOL m_bInterpolate; 940 FX_BOOL m_bInterpolate;
941 941
942 CPDF_Document* m_pDocument; 942 CPDF_Document* m_pDocument;
943 943
944 CPDF_Dictionary* m_pOC; 944 CPDF_Dictionary* m_pOC;
945 CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size); 945 CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size);
946 }; 946 };
947 947
948 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ 948 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_
OLDNEW
« no previous file with comments | « core/include/fpdfapi/fpdf_render.h ('k') | core/include/fpdfapi/fpdf_serial.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698