| 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_SRC_FXGE_APPLE_APPLE_INT_H_ | 7 #ifndef CORE_SRC_FXGE_APPLE_APPLE_INT_H_ |
| 8 #define CORE_SRC_FXGE_APPLE_APPLE_INT_H_ | 8 #define CORE_SRC_FXGE_APPLE_APPLE_INT_H_ |
| 9 | 9 |
| 10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } IOS_FONTDATA; | 44 } IOS_FONTDATA; |
| 45 class CQuartz2D | 45 class CQuartz2D |
| 46 { | 46 { |
| 47 public: | 47 public: |
| 48 void* createGraphics(CFX_DIBitmap* bitmap); | 48 void* createGraphics(CFX_DIBitmap* bitmap); |
| 49 void destroyGraphics(void* graphics); | 49 void destroyGraphics(void* graphics); |
| 50 | 50 |
| 51 void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize); | 51 void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize); |
| 52 void DestroyFont(void* pFont); | 52 void DestroyFont(void* pFont); |
| 53 void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix); | 53 void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix); |
| 54 FX_BOOL» drawGraphicsString(void* graphics, | 54 bool» drawGraphicsString(void* graphics, |
| 55 void* font, | 55 void* font, |
| 56 FX_FLOAT fontSize, | 56 FX_FLOAT fontSize, |
| 57 FX_WORD* glyphIndices, | 57 FX_WORD* glyphIndices, |
| 58 CGPoint* glyphPositions, | 58 CGPoint* glyphPositions, |
| 59 int32_t chars, | 59 int32_t chars, |
| 60 FX_ARGB argb, | 60 FX_ARGB argb, |
| 61 CFX_AffineMatrix* matrix = NULL); | 61 CFX_AffineMatrix* matrix = NULL); |
| 62 void saveGraphicsState(void* graphics); | 62 void saveGraphicsState(void* graphics); |
| 63 void restoreGraphicsState(void* graphics); | 63 void restoreGraphicsState(void* graphics); |
| 64 }; | 64 }; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 85 virtual int GetDeviceCaps(int caps_id); | 85 virtual int GetDeviceCaps(int caps_id); |
| 86 virtual CFX_Matrix GetCTM() const; | 86 virtual CFX_Matrix GetCTM() const; |
| 87 virtual CFX_DIBitmap* GetBackDrop() | 87 virtual CFX_DIBitmap* GetBackDrop() |
| 88 { | 88 { |
| 89 return NULL; | 89 return NULL; |
| 90 } | 90 } |
| 91 virtual void* GetPlatformSurface() | 91 virtual void* GetPlatformSurface() |
| 92 { | 92 { |
| 93 return NULL; | 93 return NULL; |
| 94 } | 94 } |
| 95 virtual FX_BOOL IsPSPrintDriver() | 95 virtual bool IsPSPrintDriver() |
| 96 { | 96 { |
| 97 return FALSE; | 97 return false; |
| 98 } | 98 } |
| 99 virtual FX_BOOL» StartRendering() | 99 virtual bool» StartRendering() |
| 100 { | 100 { |
| 101 return TRUE; | 101 return true; |
| 102 } | 102 } |
| 103 virtual void EndRendering() {} | 103 virtual void EndRendering() {} |
| 104 virtual void SaveState(); | 104 virtual void SaveState(); |
| 105 virtual void» RestoreState(FX_BOOL bKeepSaved); | 105 virtual void» RestoreState(bool bKeepSaved); |
| 106 virtual FX_BOOL» SetClip_PathFill(const CFX_PathData* pPathData, | 106 virtual bool» SetClip_PathFill(const CFX_PathData* pPathData, |
| 107 const CFX_AffineMatrix* pObject2Device, | 107 const CFX_AffineMatrix* pObject2Device, |
| 108 int fill_mode | 108 int fill_mode |
| 109 ); | 109 ); |
| 110 virtual FX_BOOL» SetClip_PathStroke(const CFX_PathData* pPathData, | 110 virtual bool» SetClip_PathStroke(const CFX_PathData* pPathData, |
| 111 const CFX_AffineMatrix* pObject2Device, | 111 const CFX_AffineMatrix* pObject2Device, |
| 112 const CFX_GraphStateData* pGraphState | 112 const CFX_GraphStateData* pGraphState |
| 113 ); | 113 ); |
| 114 virtual FX_BOOL» DrawPath(const CFX_PathData* pPathData, | 114 virtual bool» DrawPath(const CFX_PathData* pPathData, |
| 115 const CFX_AffineMatrix* pObject2Device, | 115 const CFX_AffineMatrix* pObject2Device, |
| 116 const CFX_GraphStateData* pGraphState, | 116 const CFX_GraphStateData* pGraphState, |
| 117 FX_DWORD fill_color, | 117 FX_DWORD fill_color, |
| 118 FX_DWORD stroke_color, | 118 FX_DWORD stroke_color, |
| 119 int fill_mode, | 119 int fill_mode, |
| 120 int alpha_flag = 0, | 120 int alpha_flag = 0, |
| 121 void* pIccTransform = NULL, | 121 void* pIccTransform = NULL, |
| 122 int blend_type = FXDIB_BLEND_NORMAL | 122 int blend_type = FXDIB_BLEND_NORMAL |
| 123 ); | 123 ); |
| 124 virtual FX_BOOL» SetPixel(int x, int y, FX_DWORD color, | 124 virtual bool» SetPixel(int x, int y, FX_DWORD color, |
| 125 int alpha_flag = 0, void* pIccTransform = NULL) | 125 int alpha_flag = 0, void* pIccTransform = NULL) |
| 126 { | 126 { |
| 127 return FALSE; | 127 return false; |
| 128 } | 128 } |
| 129 virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color, | 129 virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color, |
| 130 int alpha_flag = 0, void* pIccTransform = NULL, int
blend_type = FXDIB_BLEND_NORMAL); | 130 int alpha_flag = 0, void* pIccTransform = NULL, int
blend_type = FXDIB_BLEND_NORMAL); |
| 131 virtual FX_BOOL» DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2,
FX_FLOAT y2, FX_DWORD color, | 131 virtual bool» DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2,
FX_FLOAT y2, FX_DWORD color, |
| 132 int alpha_flag = 0, void* pIccTransform = N
ULL, int blend_type = FXDIB_BLEND_NORMAL); | 132 int alpha_flag = 0, void* pIccTransform = N
ULL, int blend_type = FXDIB_BLEND_NORMAL); |
| 133 virtual FX_BOOL GetClipBox(FX_RECT* pRect); | 133 virtual bool GetClipBox(FX_RECT* pRect); |
| 134 virtual FX_BOOL» GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void
* pIccTransform = NULL, FX_BOOL bDEdge = FALSE); | 134 virtual bool» GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void
* pIccTransform = NULL, bool bDEdge = false); |
| 135 virtual FX_BOOL» SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
const FX_RECT* pSrcRect, | 135 virtual bool» SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
const FX_RECT* pSrcRect, |
| 136 int dest_left, int dest_top, int blend_type, | 136 int dest_left, int dest_top, int blend_type, |
| 137 int alpha_flag = 0, void* pIccTransform = NULL); | 137 int alpha_flag = 0, void* pIccTransform = NULL); |
| 138 virtual FX_BOOL» StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD col
or, int dest_left, int dest_top, | 138 virtual bool» StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD col
or, int dest_left, int dest_top, |
| 139 int dest_width, int dest_height, const FX_RECT
* pClipRect, FX_DWORD flags, | 139 int dest_width, int dest_height, const FX_RECT
* pClipRect, FX_DWORD flags, |
| 140 int alpha_flag = 0, void* pIccTransform = NULL
, int blend_type = FXDIB_BLEND_NORMAL); | 140 int alpha_flag = 0, void* pIccTransform = NULL
, int blend_type = FXDIB_BLEND_NORMAL); |
| 141 virtual FX_BOOL» StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alp
ha, FX_DWORD color, | 141 virtual bool» StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alp
ha, FX_DWORD color, |
| 142 const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
void*& handle, | 142 const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
void*& handle, |
| 143 int alpha_flag = 0, void* pIccTransform = NULL, | 143 int alpha_flag = 0, void* pIccTransform = NULL, |
| 144 int blend_type = FXDIB_BLEND_NORMAL) | 144 int blend_type = FXDIB_BLEND_NORMAL) |
| 145 { | 145 { |
| 146 return FALSE; | 146 return false; |
| 147 } | 147 } |
| 148 virtual FX_BOOL» ContinueDIBits(void* handle, IFX_Pause* pPause) | 148 virtual bool» ContinueDIBits(void* handle, IFX_Pause* pPause) |
| 149 { | 149 { |
| 150 return FALSE; | 150 return false; |
| 151 } | 151 } |
| 152 virtual void CancelDIBits(void* handle) {} | 152 virtual void CancelDIBits(void* handle) {} |
| 153 virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, C
FX_Font* pFont, | 153 virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_
Font* pFont, |
| 154 CFX_FontCache* pCache, const CFX_AffineMatrix
* pObject2Device, FX_FLOAT font_size, FX_DWORD color, | 154 CFX_FontCache* pCache, const CFX_AffineMatrix
* pObject2Device, FX_FLOAT font_size, FX_DWORD color, |
| 155 int alpha_flag = 0, void* pIccTransform = NUL
L); | 155 int alpha_flag = 0, void* pIccTransform = NUL
L); |
| 156 virtual void ClearDriver(); | 156 virtual void ClearDriver(); |
| 157 protected: | 157 protected: |
| 158 void setStrokeInfo(const CFX_GraphStateData * graphState, FX_ARGB argb, FX_F
LOAT lineWidth); | 158 void setStrokeInfo(const CFX_GraphStateData * graphState, FX_ARGB argb, FX_F
LOAT lineWidth); |
| 159 void setFillInfo(FX_ARGB argb); | 159 void setFillInfo(FX_ARGB argb); |
| 160 void setPathToContext(const CFX_PathData * pathData); | 160 void setPathToContext(const CFX_PathData * pathData); |
| 161 FX_FLOAT getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransfo
rm ctm); | 161 FX_FLOAT getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransfo
rm ctm); |
| 162 FX_BOOL CG_DrawGlypRun(int nChars, | 162 bool CG_DrawGlypRun(int nChars, |
| 163 const FXTEXT_CHARPOS* pCharPos, | 163 const FXTEXT_CHARPOS* pCharPos, |
| 164 CFX_Font* pFont, | 164 CFX_Font* pFont, |
| 165 CFX_FontCache* pCache, | 165 CFX_FontCache* pCache, |
| 166 const CFX_AffineMatrix* pGlyphMatrix, | 166 const CFX_AffineMatrix* pGlyphMatrix, |
| 167 const CFX_AffineMatrix* pObject2Device, | 167 const CFX_AffineMatrix* pObject2Device, |
| 168 FX_FLOAT font_size, | 168 FX_FLOAT font_size, |
| 169 FX_DWORD argb, | 169 FX_DWORD argb, |
| 170 int alpha_flag, | 170 int alpha_flag, |
| 171 void* pIccTransform); | 171 void* pIccTransform); |
| 172 void CG_SetImageTransform(int dest_left, int dest_top, int dest_width, in
t dest_height, CGRect* rect = NULL); | 172 void CG_SetImageTransform(int dest_left, int dest_top, int dest_width, in
t dest_height, CGRect* rect = NULL); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 188 { | 188 { |
| 189 public: | 189 public: |
| 190 virtual void Release() override | 190 virtual void Release() override |
| 191 { | 191 { |
| 192 delete this; | 192 delete this; |
| 193 } | 193 } |
| 194 virtual FX_FILESIZE GetSize() override | 194 virtual FX_FILESIZE GetSize() override |
| 195 { | 195 { |
| 196 return (FX_FILESIZE)_totalSize; | 196 return (FX_FILESIZE)_totalSize; |
| 197 } | 197 } |
| 198 virtual FX_BOOL» » » ReadBlock(void* buffer, FX_FILESIZE offs
et, size_t size) override; | 198 virtual bool» » » ReadBlock(void* buffer, FX_FILESIZE offs
et, size_t size) override; |
| 199 | 199 |
| 200 virtual FX_BOOL» » » IsEOF() override | 200 virtual bool» » » IsEOF() override |
| 201 { | 201 { |
| 202 return _offSet == _totalSize; | 202 return _offSet == _totalSize; |
| 203 } | 203 } |
| 204 virtual FX_FILESIZE GetPosition() override | 204 virtual FX_FILESIZE GetPosition() override |
| 205 { | 205 { |
| 206 return (FX_FILESIZE)_offSet; | 206 return (FX_FILESIZE)_offSet; |
| 207 } | 207 } |
| 208 virtual size_t ReadBlock(void* buffer, size_t size) ove
rride; | 208 virtual size_t ReadBlock(void* buffer, size_t size) ove
rride; |
| 209 public: | 209 public: |
| 210 CFX_FontProvider(CGFontRef cgFont); | 210 CFX_FontProvider(CGFontRef cgFont); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 237 int _tableCount; | 237 int _tableCount; |
| 238 int _totalSize; | 238 int _totalSize; |
| 239 }; | 239 }; |
| 240 uint32_t FX_GetHashCode( const FX_CHAR* pStr); | 240 uint32_t FX_GetHashCode( const FX_CHAR* pStr); |
| 241 FX_DWORD FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); | 241 FX_DWORD FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); |
| 242 uint32_t FX_IOSGetFamilyNamesCount(); | 242 uint32_t FX_IOSGetFamilyNamesCount(); |
| 243 const FX_CHAR* FX_IOSGetFamilyName( uint32_t uIndex); | 243 const FX_CHAR* FX_IOSGetFamilyName( uint32_t uIndex); |
| 244 #endif | 244 #endif |
| 245 | 245 |
| 246 #endif // CORE_SRC_FXGE_APPLE_APPLE_INT_H_ | 246 #endif // CORE_SRC_FXGE_APPLE_APPLE_INT_H_ |
| OLD | NEW |