| 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_FXGE_APPLE_APPLE_INT_H_ | 7 #ifndef CORE_FXGE_APPLE_APPLE_INT_H_ |
| 8 #define CORE_FXGE_APPLE_APPLE_INT_H_ | 8 #define CORE_FXGE_APPLE_APPLE_INT_H_ |
| 9 | 9 |
| 10 #include "core/fxcrt/include/fx_system.h" | 10 #include "core/fxcrt/include/fx_system.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 void* CreateFont(const uint8_t* pFontData, uint32_t dwFontSize); | 59 void* CreateFont(const uint8_t* pFontData, uint32_t dwFontSize); |
| 60 void DestroyFont(void* pFont); | 60 void DestroyFont(void* pFont); |
| 61 void setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix); | 61 void setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix); |
| 62 FX_BOOL drawGraphicsString(void* graphics, | 62 FX_BOOL drawGraphicsString(void* graphics, |
| 63 void* font, | 63 void* font, |
| 64 FX_FLOAT fontSize, | 64 FX_FLOAT fontSize, |
| 65 uint16_t* glyphIndices, | 65 uint16_t* glyphIndices, |
| 66 CGPoint* glyphPositions, | 66 CGPoint* glyphPositions, |
| 67 int32_t chars, | 67 int32_t chars, |
| 68 FX_ARGB argb, | 68 FX_ARGB argb, |
| 69 CFX_Matrix* matrix = NULL); | 69 CFX_Matrix* matrix = nullptr); |
| 70 void saveGraphicsState(void* graphics); | 70 void saveGraphicsState(void* graphics); |
| 71 void restoreGraphicsState(void* graphics); | 71 void restoreGraphicsState(void* graphics); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 class CApplePlatform { | 74 class CApplePlatform { |
| 75 public: | 75 public: |
| 76 CApplePlatform() {} | 76 CApplePlatform() {} |
| 77 ~CApplePlatform() {} | 77 ~CApplePlatform() {} |
| 78 | 78 |
| 79 CQuartz2D m_quartz2d; | 79 CQuartz2D m_quartz2d; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 98 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 98 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
| 99 const CFX_Matrix* pObject2Device, | 99 const CFX_Matrix* pObject2Device, |
| 100 const CFX_GraphStateData* pGraphState) override; | 100 const CFX_GraphStateData* pGraphState) override; |
| 101 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 101 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
| 102 const CFX_Matrix* pObject2Device, | 102 const CFX_Matrix* pObject2Device, |
| 103 const CFX_GraphStateData* pGraphState, | 103 const CFX_GraphStateData* pGraphState, |
| 104 uint32_t fill_color, | 104 uint32_t fill_color, |
| 105 uint32_t stroke_color, | 105 uint32_t stroke_color, |
| 106 int fill_mode, | 106 int fill_mode, |
| 107 int alpha_flag = 0, | 107 int alpha_flag = 0, |
| 108 void* pIccTransform = NULL, | 108 void* pIccTransform = nullptr, |
| 109 int blend_type = FXDIB_BLEND_NORMAL) override; | 109 int blend_type = FXDIB_BLEND_NORMAL) override; |
| 110 FX_BOOL SetPixel(int x, | 110 FX_BOOL SetPixel(int x, |
| 111 int y, | 111 int y, |
| 112 uint32_t color, | 112 uint32_t color, |
| 113 int alpha_flag = 0, | 113 int alpha_flag = 0, |
| 114 void* pIccTransform = NULL) override { | 114 void* pIccTransform = nullptr) override { |
| 115 return FALSE; | 115 return FALSE; |
| 116 } | 116 } |
| 117 FX_BOOL FillRect(const FX_RECT* pRect, | 117 FX_BOOL FillRect(const FX_RECT* pRect, |
| 118 uint32_t fill_color, | 118 uint32_t fill_color, |
| 119 int alpha_flag = 0, | 119 int alpha_flag = 0, |
| 120 void* pIccTransform = NULL, | 120 void* pIccTransform = nullptr, |
| 121 int blend_type = FXDIB_BLEND_NORMAL) override; | 121 int blend_type = FXDIB_BLEND_NORMAL) override; |
| 122 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, | 122 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
| 123 FX_FLOAT y1, | 123 FX_FLOAT y1, |
| 124 FX_FLOAT x2, | 124 FX_FLOAT x2, |
| 125 FX_FLOAT y2, | 125 FX_FLOAT y2, |
| 126 uint32_t color, | 126 uint32_t color, |
| 127 int alpha_flag = 0, | 127 int alpha_flag = 0, |
| 128 void* pIccTransform = NULL, | 128 void* pIccTransform = nullptr, |
| 129 int blend_type = FXDIB_BLEND_NORMAL) override; | 129 int blend_type = FXDIB_BLEND_NORMAL) override; |
| 130 FX_BOOL GetClipBox(FX_RECT* pRect) override; | 130 FX_BOOL GetClipBox(FX_RECT* pRect) override; |
| 131 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, | 131 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
| 132 int left, | 132 int left, |
| 133 int top, | 133 int top, |
| 134 void* pIccTransform = NULL, | 134 void* pIccTransform = nullptr, |
| 135 FX_BOOL bDEdge = FALSE) override; | 135 FX_BOOL bDEdge = FALSE) override; |
| 136 CFX_DIBitmap* GetBackDrop() override { return NULL; } | 136 CFX_DIBitmap* GetBackDrop() override { return nullptr; } |
| 137 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 137 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 138 uint32_t color, | 138 uint32_t color, |
| 139 const FX_RECT* pSrcRect, | 139 const FX_RECT* pSrcRect, |
| 140 int dest_left, | 140 int dest_left, |
| 141 int dest_top, | 141 int dest_top, |
| 142 int blend_type, | 142 int blend_type, |
| 143 int alpha_flag = 0, | 143 int alpha_flag = 0, |
| 144 void* pIccTransform = NULL) override; | 144 void* pIccTransform = nullptr) override; |
| 145 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 145 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 146 uint32_t color, | 146 uint32_t color, |
| 147 int dest_left, | 147 int dest_left, |
| 148 int dest_top, | 148 int dest_top, |
| 149 int dest_width, | 149 int dest_width, |
| 150 int dest_height, | 150 int dest_height, |
| 151 const FX_RECT* pClipRect, | 151 const FX_RECT* pClipRect, |
| 152 uint32_t flags, | 152 uint32_t flags, |
| 153 int alpha_flag = 0, | 153 int alpha_flag = 0, |
| 154 void* pIccTransform = NULL, | 154 void* pIccTransform = nullptr, |
| 155 int blend_type = FXDIB_BLEND_NORMAL) override; | 155 int blend_type = FXDIB_BLEND_NORMAL) override; |
| 156 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 156 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 157 int bitmap_alpha, | 157 int bitmap_alpha, |
| 158 uint32_t color, | 158 uint32_t color, |
| 159 const CFX_Matrix* pMatrix, | 159 const CFX_Matrix* pMatrix, |
| 160 uint32_t flags, | 160 uint32_t flags, |
| 161 void*& handle, | 161 void*& handle, |
| 162 int alpha_flag = 0, | 162 int alpha_flag = 0, |
| 163 void* pIccTransform = NULL, | 163 void* pIccTransform = nullptr, |
| 164 int blend_type = FXDIB_BLEND_NORMAL) override { | 164 int blend_type = FXDIB_BLEND_NORMAL) override { |
| 165 return FALSE; | 165 return FALSE; |
| 166 } | 166 } |
| 167 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { | 167 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { |
| 168 return FALSE; | 168 return FALSE; |
| 169 } | 169 } |
| 170 void CancelDIBits(void* handle) override {} | 170 void CancelDIBits(void* handle) override {} |
| 171 FX_BOOL DrawDeviceText(int nChars, | 171 FX_BOOL DrawDeviceText(int nChars, |
| 172 const FXTEXT_CHARPOS* pCharPos, | 172 const FXTEXT_CHARPOS* pCharPos, |
| 173 CFX_Font* pFont, | 173 CFX_Font* pFont, |
| 174 CFX_FontCache* pCache, | 174 CFX_FontCache* pCache, |
| 175 const CFX_Matrix* pObject2Device, | 175 const CFX_Matrix* pObject2Device, |
| 176 FX_FLOAT font_size, | 176 FX_FLOAT font_size, |
| 177 uint32_t color, | 177 uint32_t color, |
| 178 int alpha_flag = 0, | 178 int alpha_flag = 0, |
| 179 void* pIccTransform = NULL) override; | 179 void* pIccTransform = nullptr) override; |
| 180 void* GetPlatformSurface() const override { return NULL; } | 180 void* GetPlatformSurface() const override { return nullptr; } |
| 181 void ClearDriver() override; | 181 void ClearDriver() override; |
| 182 | 182 |
| 183 protected: | 183 protected: |
| 184 void setStrokeInfo(const CFX_GraphStateData* graphState, | 184 void setStrokeInfo(const CFX_GraphStateData* graphState, |
| 185 FX_ARGB argb, | 185 FX_ARGB argb, |
| 186 FX_FLOAT lineWidth); | 186 FX_FLOAT lineWidth); |
| 187 void setFillInfo(FX_ARGB argb); | 187 void setFillInfo(FX_ARGB argb); |
| 188 void setPathToContext(const CFX_PathData* pathData); | 188 void setPathToContext(const CFX_PathData* pathData); |
| 189 FX_FLOAT getLineWidth(const CFX_GraphStateData* graphState, | 189 FX_FLOAT getLineWidth(const CFX_GraphStateData* graphState, |
| 190 CGAffineTransform ctm); | 190 CGAffineTransform ctm); |
| 191 FX_BOOL CG_DrawGlypRun(int nChars, | 191 FX_BOOL CG_DrawGlypRun(int nChars, |
| 192 const FXTEXT_CHARPOS* pCharPos, | 192 const FXTEXT_CHARPOS* pCharPos, |
| 193 CFX_Font* pFont, | 193 CFX_Font* pFont, |
| 194 CFX_FontCache* pCache, | 194 CFX_FontCache* pCache, |
| 195 const CFX_Matrix* pGlyphMatrix, | 195 const CFX_Matrix* pGlyphMatrix, |
| 196 const CFX_Matrix* pObject2Device, | 196 const CFX_Matrix* pObject2Device, |
| 197 FX_FLOAT font_size, | 197 FX_FLOAT font_size, |
| 198 uint32_t argb, | 198 uint32_t argb, |
| 199 int alpha_flag, | 199 int alpha_flag, |
| 200 void* pIccTransform); | 200 void* pIccTransform); |
| 201 void CG_SetImageTransform(int dest_left, | 201 void CG_SetImageTransform(int dest_left, |
| 202 int dest_top, | 202 int dest_top, |
| 203 int dest_width, | 203 int dest_width, |
| 204 int dest_height, | 204 int dest_height, |
| 205 CGRect* rect = NULL); | 205 CGRect* rect = nullptr); |
| 206 | 206 |
| 207 CGContextRef m_context; | 207 CGContextRef m_context; |
| 208 CGAffineTransform m_foxitDevice2User; | 208 CGAffineTransform m_foxitDevice2User; |
| 209 CGAffineTransform m_user2FoxitDevice; | 209 CGAffineTransform m_user2FoxitDevice; |
| 210 int32_t m_saveCount; | 210 int32_t m_saveCount; |
| 211 | 211 |
| 212 int32_t m_width; | 212 int32_t m_width; |
| 213 int32_t m_height; | 213 int32_t m_height; |
| 214 int32_t m_bitsPerPixel; | 214 int32_t m_bitsPerPixel; |
| 215 int32_t m_deviceClass; | 215 int32_t m_deviceClass; |
| 216 int32_t m_renderCaps; | 216 int32_t m_renderCaps; |
| 217 int32_t m_horzSize; | 217 int32_t m_horzSize; |
| 218 int32_t m_vertSize; | 218 int32_t m_vertSize; |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 uint32_t FX_GetHashCode(const FX_CHAR* pStr); | 221 uint32_t FX_GetHashCode(const FX_CHAR* pStr); |
| 222 uint32_t FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); | 222 uint32_t FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); |
| 223 uint32_t FX_IOSGetFamilyNamesCount(); | 223 uint32_t FX_IOSGetFamilyNamesCount(); |
| 224 const FX_CHAR* FX_IOSGetFamilyName(uint32_t uIndex); | 224 const FX_CHAR* FX_IOSGetFamilyName(uint32_t uIndex); |
| 225 #endif | 225 #endif |
| 226 | 226 |
| 227 #endif // CORE_FXGE_APPLE_APPLE_INT_H_ | 227 #endif // CORE_FXGE_APPLE_APPLE_INT_H_ |
| OLD | NEW |