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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 FX_DWORD charsets; | 46 FX_DWORD charsets; |
47 FX_DWORD styles; | 47 FX_DWORD styles; |
48 } IOS_FONTDATA; | 48 } IOS_FONTDATA; |
49 class CQuartz2D { | 49 class CQuartz2D { |
50 public: | 50 public: |
51 void* createGraphics(CFX_DIBitmap* bitmap); | 51 void* createGraphics(CFX_DIBitmap* bitmap); |
52 void destroyGraphics(void* graphics); | 52 void destroyGraphics(void* graphics); |
53 | 53 |
54 void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize); | 54 void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize); |
55 void DestroyFont(void* pFont); | 55 void DestroyFont(void* pFont); |
56 void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix); | 56 void setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix); |
57 FX_BOOL drawGraphicsString(void* graphics, | 57 FX_BOOL drawGraphicsString(void* graphics, |
58 void* font, | 58 void* font, |
59 FX_FLOAT fontSize, | 59 FX_FLOAT fontSize, |
60 FX_WORD* glyphIndices, | 60 FX_WORD* glyphIndices, |
61 CGPoint* glyphPositions, | 61 CGPoint* glyphPositions, |
62 int32_t chars, | 62 int32_t chars, |
63 FX_ARGB argb, | 63 FX_ARGB argb, |
64 CFX_AffineMatrix* matrix = NULL); | 64 CFX_Matrix* matrix = NULL); |
65 void saveGraphicsState(void* graphics); | 65 void saveGraphicsState(void* graphics); |
66 void restoreGraphicsState(void* graphics); | 66 void restoreGraphicsState(void* graphics); |
67 }; | 67 }; |
68 class CApplePlatform { | 68 class CApplePlatform { |
69 public: | 69 public: |
70 CApplePlatform() {} | 70 CApplePlatform() {} |
71 ~CApplePlatform() {} | 71 ~CApplePlatform() {} |
72 | 72 |
73 CQuartz2D _quartz2d; | 73 CQuartz2D _quartz2d; |
74 }; | 74 }; |
75 | 75 |
76 class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { | 76 class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { |
77 public: | 77 public: |
78 CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass); | 78 CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass); |
79 ~CFX_QuartzDeviceDriver() override; | 79 ~CFX_QuartzDeviceDriver() override; |
80 | 80 |
81 // IFX_RenderDeviceDriver | 81 // IFX_RenderDeviceDriver |
82 int GetDeviceCaps(int caps_id) override; | 82 int GetDeviceCaps(int caps_id) override; |
83 CFX_Matrix GetCTM() const override; | 83 CFX_Matrix GetCTM() const override; |
84 FX_BOOL IsPSPrintDriver() override { return FALSE; } | 84 FX_BOOL IsPSPrintDriver() override { return FALSE; } |
85 FX_BOOL StartRendering() override { return TRUE; } | 85 FX_BOOL StartRendering() override { return TRUE; } |
86 void EndRendering() override {} | 86 void EndRendering() override {} |
87 void SaveState() override; | 87 void SaveState() override; |
88 void RestoreState(FX_BOOL bKeepSaved) override; | 88 void RestoreState(FX_BOOL bKeepSaved) override; |
89 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 89 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
90 const CFX_AffineMatrix* pObject2Device, | 90 const CFX_Matrix* pObject2Device, |
91 int fill_mode) override; | 91 int fill_mode) override; |
92 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 92 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
93 const CFX_AffineMatrix* pObject2Device, | 93 const CFX_Matrix* pObject2Device, |
94 const CFX_GraphStateData* pGraphState) override; | 94 const CFX_GraphStateData* pGraphState) override; |
95 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 95 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
96 const CFX_AffineMatrix* pObject2Device, | 96 const CFX_Matrix* pObject2Device, |
97 const CFX_GraphStateData* pGraphState, | 97 const CFX_GraphStateData* pGraphState, |
98 FX_DWORD fill_color, | 98 FX_DWORD fill_color, |
99 FX_DWORD stroke_color, | 99 FX_DWORD stroke_color, |
100 int fill_mode, | 100 int fill_mode, |
101 int alpha_flag = 0, | 101 int alpha_flag = 0, |
102 void* pIccTransform = NULL, | 102 void* pIccTransform = NULL, |
103 int blend_type = FXDIB_BLEND_NORMAL) override; | 103 int blend_type = FXDIB_BLEND_NORMAL) override; |
104 FX_BOOL SetPixel(int x, | 104 FX_BOOL SetPixel(int x, |
105 int y, | 105 int y, |
106 FX_DWORD color, | 106 FX_DWORD color, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 int dest_width, | 143 int dest_width, |
144 int dest_height, | 144 int dest_height, |
145 const FX_RECT* pClipRect, | 145 const FX_RECT* pClipRect, |
146 FX_DWORD flags, | 146 FX_DWORD flags, |
147 int alpha_flag = 0, | 147 int alpha_flag = 0, |
148 void* pIccTransform = NULL, | 148 void* pIccTransform = NULL, |
149 int blend_type = FXDIB_BLEND_NORMAL) override; | 149 int blend_type = FXDIB_BLEND_NORMAL) override; |
150 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 150 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
151 int bitmap_alpha, | 151 int bitmap_alpha, |
152 FX_DWORD color, | 152 FX_DWORD color, |
153 const CFX_AffineMatrix* pMatrix, | 153 const CFX_Matrix* pMatrix, |
154 FX_DWORD flags, | 154 FX_DWORD flags, |
155 void*& handle, | 155 void*& handle, |
156 int alpha_flag = 0, | 156 int alpha_flag = 0, |
157 void* pIccTransform = NULL, | 157 void* pIccTransform = NULL, |
158 int blend_type = FXDIB_BLEND_NORMAL) override { | 158 int blend_type = FXDIB_BLEND_NORMAL) override { |
159 return FALSE; | 159 return FALSE; |
160 } | 160 } |
161 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { | 161 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { |
162 return FALSE; | 162 return FALSE; |
163 } | 163 } |
164 void CancelDIBits(void* handle) override {} | 164 void CancelDIBits(void* handle) override {} |
165 FX_BOOL DrawDeviceText(int nChars, | 165 FX_BOOL DrawDeviceText(int nChars, |
166 const FXTEXT_CHARPOS* pCharPos, | 166 const FXTEXT_CHARPOS* pCharPos, |
167 CFX_Font* pFont, | 167 CFX_Font* pFont, |
168 CFX_FontCache* pCache, | 168 CFX_FontCache* pCache, |
169 const CFX_AffineMatrix* pObject2Device, | 169 const CFX_Matrix* pObject2Device, |
170 FX_FLOAT font_size, | 170 FX_FLOAT font_size, |
171 FX_DWORD color, | 171 FX_DWORD color, |
172 int alpha_flag = 0, | 172 int alpha_flag = 0, |
173 void* pIccTransform = NULL) override; | 173 void* pIccTransform = NULL) override; |
174 void* GetPlatformSurface() override { return NULL; } | 174 void* GetPlatformSurface() override { return NULL; } |
175 void ClearDriver() override; | 175 void ClearDriver() override; |
176 | 176 |
177 protected: | 177 protected: |
178 void setStrokeInfo(const CFX_GraphStateData* graphState, | 178 void setStrokeInfo(const CFX_GraphStateData* graphState, |
179 FX_ARGB argb, | 179 FX_ARGB argb, |
180 FX_FLOAT lineWidth); | 180 FX_FLOAT lineWidth); |
181 void setFillInfo(FX_ARGB argb); | 181 void setFillInfo(FX_ARGB argb); |
182 void setPathToContext(const CFX_PathData* pathData); | 182 void setPathToContext(const CFX_PathData* pathData); |
183 FX_FLOAT getLineWidth(const CFX_GraphStateData* graphState, | 183 FX_FLOAT getLineWidth(const CFX_GraphStateData* graphState, |
184 CGAffineTransform ctm); | 184 CGAffineTransform ctm); |
185 FX_BOOL CG_DrawGlypRun(int nChars, | 185 FX_BOOL CG_DrawGlypRun(int nChars, |
186 const FXTEXT_CHARPOS* pCharPos, | 186 const FXTEXT_CHARPOS* pCharPos, |
187 CFX_Font* pFont, | 187 CFX_Font* pFont, |
188 CFX_FontCache* pCache, | 188 CFX_FontCache* pCache, |
189 const CFX_AffineMatrix* pGlyphMatrix, | 189 const CFX_Matrix* pGlyphMatrix, |
190 const CFX_AffineMatrix* pObject2Device, | 190 const CFX_Matrix* pObject2Device, |
191 FX_FLOAT font_size, | 191 FX_FLOAT font_size, |
192 FX_DWORD argb, | 192 FX_DWORD argb, |
193 int alpha_flag, | 193 int alpha_flag, |
194 void* pIccTransform); | 194 void* pIccTransform); |
195 void CG_SetImageTransform(int dest_left, | 195 void CG_SetImageTransform(int dest_left, |
196 int dest_top, | 196 int dest_top, |
197 int dest_width, | 197 int dest_width, |
198 int dest_height, | 198 int dest_height, |
199 CGRect* rect = NULL); | 199 CGRect* rect = NULL); |
200 | 200 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 int _totalSize; | 260 int _totalSize; |
261 }; | 261 }; |
262 | 262 |
263 uint32_t FX_GetHashCode(const FX_CHAR* pStr); | 263 uint32_t FX_GetHashCode(const FX_CHAR* pStr); |
264 FX_DWORD FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); | 264 FX_DWORD FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); |
265 uint32_t FX_IOSGetFamilyNamesCount(); | 265 uint32_t FX_IOSGetFamilyNamesCount(); |
266 const FX_CHAR* FX_IOSGetFamilyName(uint32_t uIndex); | 266 const FX_CHAR* FX_IOSGetFamilyName(uint32_t uIndex); |
267 #endif | 267 #endif |
268 | 268 |
269 #endif // CORE_SRC_FXGE_APPLE_APPLE_INT_H_ | 269 #endif // CORE_SRC_FXGE_APPLE_APPLE_INT_H_ |
OLD | NEW |