| 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 25 matching lines...) Expand all Loading... |
| 36 } FX_IOSCHARSET; | 36 } FX_IOSCHARSET; |
| 37 FX_IOSCHARSET FX_GetiOSCharset(int charset); | 37 FX_IOSCHARSET FX_GetiOSCharset(int charset); |
| 38 typedef enum eFXIOSFONTFLAG { | 38 typedef enum eFXIOSFONTFLAG { |
| 39 eFXFontFlagBold = 1, | 39 eFXFontFlagBold = 1, |
| 40 eFXFontFlagItalic = 1 << 1, | 40 eFXFontFlagItalic = 1 << 1, |
| 41 eFXFontFlagFixedPitch = 1 << 2, | 41 eFXFontFlagFixedPitch = 1 << 2, |
| 42 eFXFontFlagSerif = 1 << 3, | 42 eFXFontFlagSerif = 1 << 3, |
| 43 eFXFontFlagScript = 1 << 4, | 43 eFXFontFlagScript = 1 << 4, |
| 44 } FX_IOSFONTFLAG; | 44 } FX_IOSFONTFLAG; |
| 45 typedef struct IOS_FONTDATA_ { | 45 typedef struct IOS_FONTDATA_ { |
| 46 FX_DWORD nHashCode; | 46 uint32_t nHashCode; |
| 47 const char* psName; | 47 const char* psName; |
| 48 FX_DWORD charsets; | 48 uint32_t charsets; |
| 49 FX_DWORD styles; | 49 uint32_t styles; |
| 50 } IOS_FONTDATA; | 50 } IOS_FONTDATA; |
| 51 class CQuartz2D { | 51 class CQuartz2D { |
| 52 public: | 52 public: |
| 53 void* createGraphics(CFX_DIBitmap* bitmap); | 53 void* createGraphics(CFX_DIBitmap* bitmap); |
| 54 void destroyGraphics(void* graphics); | 54 void destroyGraphics(void* graphics); |
| 55 | 55 |
| 56 void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize); | 56 void* CreateFont(const uint8_t* pFontData, uint32_t dwFontSize); |
| 57 void DestroyFont(void* pFont); | 57 void DestroyFont(void* pFont); |
| 58 void setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix); | 58 void setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix); |
| 59 FX_BOOL drawGraphicsString(void* graphics, | 59 FX_BOOL drawGraphicsString(void* graphics, |
| 60 void* font, | 60 void* font, |
| 61 FX_FLOAT fontSize, | 61 FX_FLOAT fontSize, |
| 62 uint16_t* glyphIndices, | 62 uint16_t* glyphIndices, |
| 63 CGPoint* glyphPositions, | 63 CGPoint* glyphPositions, |
| 64 int32_t chars, | 64 int32_t chars, |
| 65 FX_ARGB argb, | 65 FX_ARGB argb, |
| 66 CFX_Matrix* matrix = NULL); | 66 CFX_Matrix* matrix = NULL); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 90 void RestoreState(FX_BOOL bKeepSaved) override; | 90 void RestoreState(FX_BOOL bKeepSaved) override; |
| 91 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 91 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
| 92 const CFX_Matrix* pObject2Device, | 92 const CFX_Matrix* pObject2Device, |
| 93 int fill_mode) override; | 93 int fill_mode) override; |
| 94 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 94 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
| 95 const CFX_Matrix* pObject2Device, | 95 const CFX_Matrix* pObject2Device, |
| 96 const CFX_GraphStateData* pGraphState) override; | 96 const CFX_GraphStateData* pGraphState) override; |
| 97 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 97 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
| 98 const CFX_Matrix* pObject2Device, | 98 const CFX_Matrix* pObject2Device, |
| 99 const CFX_GraphStateData* pGraphState, | 99 const CFX_GraphStateData* pGraphState, |
| 100 FX_DWORD fill_color, | 100 uint32_t fill_color, |
| 101 FX_DWORD stroke_color, | 101 uint32_t stroke_color, |
| 102 int fill_mode, | 102 int fill_mode, |
| 103 int alpha_flag = 0, | 103 int alpha_flag = 0, |
| 104 void* pIccTransform = NULL, | 104 void* pIccTransform = NULL, |
| 105 int blend_type = FXDIB_BLEND_NORMAL) override; | 105 int blend_type = FXDIB_BLEND_NORMAL) override; |
| 106 FX_BOOL SetPixel(int x, | 106 FX_BOOL SetPixel(int x, |
| 107 int y, | 107 int y, |
| 108 FX_DWORD color, | 108 uint32_t color, |
| 109 int alpha_flag = 0, | 109 int alpha_flag = 0, |
| 110 void* pIccTransform = NULL) override { | 110 void* pIccTransform = NULL) override { |
| 111 return FALSE; | 111 return FALSE; |
| 112 } | 112 } |
| 113 FX_BOOL FillRect(const FX_RECT* pRect, | 113 FX_BOOL FillRect(const FX_RECT* pRect, |
| 114 FX_DWORD fill_color, | 114 uint32_t fill_color, |
| 115 int alpha_flag = 0, | 115 int alpha_flag = 0, |
| 116 void* pIccTransform = NULL, | 116 void* pIccTransform = NULL, |
| 117 int blend_type = FXDIB_BLEND_NORMAL) override; | 117 int blend_type = FXDIB_BLEND_NORMAL) override; |
| 118 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, | 118 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
| 119 FX_FLOAT y1, | 119 FX_FLOAT y1, |
| 120 FX_FLOAT x2, | 120 FX_FLOAT x2, |
| 121 FX_FLOAT y2, | 121 FX_FLOAT y2, |
| 122 FX_DWORD color, | 122 uint32_t color, |
| 123 int alpha_flag = 0, | 123 int alpha_flag = 0, |
| 124 void* pIccTransform = NULL, | 124 void* pIccTransform = NULL, |
| 125 int blend_type = FXDIB_BLEND_NORMAL) override; | 125 int blend_type = FXDIB_BLEND_NORMAL) override; |
| 126 FX_BOOL GetClipBox(FX_RECT* pRect) override; | 126 FX_BOOL GetClipBox(FX_RECT* pRect) override; |
| 127 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, | 127 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
| 128 int left, | 128 int left, |
| 129 int top, | 129 int top, |
| 130 void* pIccTransform = NULL, | 130 void* pIccTransform = NULL, |
| 131 FX_BOOL bDEdge = FALSE) override; | 131 FX_BOOL bDEdge = FALSE) override; |
| 132 CFX_DIBitmap* GetBackDrop() override { return NULL; } | 132 CFX_DIBitmap* GetBackDrop() override { return NULL; } |
| 133 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 133 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 134 FX_DWORD color, | 134 uint32_t color, |
| 135 const FX_RECT* pSrcRect, | 135 const FX_RECT* pSrcRect, |
| 136 int dest_left, | 136 int dest_left, |
| 137 int dest_top, | 137 int dest_top, |
| 138 int blend_type, | 138 int blend_type, |
| 139 int alpha_flag = 0, | 139 int alpha_flag = 0, |
| 140 void* pIccTransform = NULL) override; | 140 void* pIccTransform = NULL) override; |
| 141 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 141 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 142 FX_DWORD color, | 142 uint32_t color, |
| 143 int dest_left, | 143 int dest_left, |
| 144 int dest_top, | 144 int dest_top, |
| 145 int dest_width, | 145 int dest_width, |
| 146 int dest_height, | 146 int dest_height, |
| 147 const FX_RECT* pClipRect, | 147 const FX_RECT* pClipRect, |
| 148 FX_DWORD flags, | 148 uint32_t flags, |
| 149 int alpha_flag = 0, | 149 int alpha_flag = 0, |
| 150 void* pIccTransform = NULL, | 150 void* pIccTransform = NULL, |
| 151 int blend_type = FXDIB_BLEND_NORMAL) override; | 151 int blend_type = FXDIB_BLEND_NORMAL) override; |
| 152 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 152 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 153 int bitmap_alpha, | 153 int bitmap_alpha, |
| 154 FX_DWORD color, | 154 uint32_t color, |
| 155 const CFX_Matrix* pMatrix, | 155 const CFX_Matrix* pMatrix, |
| 156 FX_DWORD flags, | 156 uint32_t flags, |
| 157 void*& handle, | 157 void*& handle, |
| 158 int alpha_flag = 0, | 158 int alpha_flag = 0, |
| 159 void* pIccTransform = NULL, | 159 void* pIccTransform = NULL, |
| 160 int blend_type = FXDIB_BLEND_NORMAL) override { | 160 int blend_type = FXDIB_BLEND_NORMAL) override { |
| 161 return FALSE; | 161 return FALSE; |
| 162 } | 162 } |
| 163 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { | 163 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { |
| 164 return FALSE; | 164 return FALSE; |
| 165 } | 165 } |
| 166 void CancelDIBits(void* handle) override {} | 166 void CancelDIBits(void* handle) override {} |
| 167 FX_BOOL DrawDeviceText(int nChars, | 167 FX_BOOL DrawDeviceText(int nChars, |
| 168 const FXTEXT_CHARPOS* pCharPos, | 168 const FXTEXT_CHARPOS* pCharPos, |
| 169 CFX_Font* pFont, | 169 CFX_Font* pFont, |
| 170 CFX_FontCache* pCache, | 170 CFX_FontCache* pCache, |
| 171 const CFX_Matrix* pObject2Device, | 171 const CFX_Matrix* pObject2Device, |
| 172 FX_FLOAT font_size, | 172 FX_FLOAT font_size, |
| 173 FX_DWORD color, | 173 uint32_t color, |
| 174 int alpha_flag = 0, | 174 int alpha_flag = 0, |
| 175 void* pIccTransform = NULL) override; | 175 void* pIccTransform = NULL) override; |
| 176 void* GetPlatformSurface() const override { return NULL; } | 176 void* GetPlatformSurface() const override { return NULL; } |
| 177 void ClearDriver() override; | 177 void ClearDriver() override; |
| 178 | 178 |
| 179 protected: | 179 protected: |
| 180 void setStrokeInfo(const CFX_GraphStateData* graphState, | 180 void setStrokeInfo(const CFX_GraphStateData* graphState, |
| 181 FX_ARGB argb, | 181 FX_ARGB argb, |
| 182 FX_FLOAT lineWidth); | 182 FX_FLOAT lineWidth); |
| 183 void setFillInfo(FX_ARGB argb); | 183 void setFillInfo(FX_ARGB argb); |
| 184 void setPathToContext(const CFX_PathData* pathData); | 184 void setPathToContext(const CFX_PathData* pathData); |
| 185 FX_FLOAT getLineWidth(const CFX_GraphStateData* graphState, | 185 FX_FLOAT getLineWidth(const CFX_GraphStateData* graphState, |
| 186 CGAffineTransform ctm); | 186 CGAffineTransform ctm); |
| 187 FX_BOOL CG_DrawGlypRun(int nChars, | 187 FX_BOOL CG_DrawGlypRun(int nChars, |
| 188 const FXTEXT_CHARPOS* pCharPos, | 188 const FXTEXT_CHARPOS* pCharPos, |
| 189 CFX_Font* pFont, | 189 CFX_Font* pFont, |
| 190 CFX_FontCache* pCache, | 190 CFX_FontCache* pCache, |
| 191 const CFX_Matrix* pGlyphMatrix, | 191 const CFX_Matrix* pGlyphMatrix, |
| 192 const CFX_Matrix* pObject2Device, | 192 const CFX_Matrix* pObject2Device, |
| 193 FX_FLOAT font_size, | 193 FX_FLOAT font_size, |
| 194 FX_DWORD argb, | 194 uint32_t argb, |
| 195 int alpha_flag, | 195 int alpha_flag, |
| 196 void* pIccTransform); | 196 void* pIccTransform); |
| 197 void CG_SetImageTransform(int dest_left, | 197 void CG_SetImageTransform(int dest_left, |
| 198 int dest_top, | 198 int dest_top, |
| 199 int dest_width, | 199 int dest_width, |
| 200 int dest_height, | 200 int dest_height, |
| 201 CGRect* rect = NULL); | 201 CGRect* rect = NULL); |
| 202 | 202 |
| 203 protected: | 203 protected: |
| 204 CGContextRef _context; | 204 CGContextRef _context; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 uint32_t fLength; | 256 uint32_t fLength; |
| 257 } TableEntry; | 257 } TableEntry; |
| 258 FontHeader _fontHeader; | 258 FontHeader _fontHeader; |
| 259 unsigned char* _tableEntries; | 259 unsigned char* _tableEntries; |
| 260 size_t* _tableOffsets; | 260 size_t* _tableOffsets; |
| 261 int _tableCount; | 261 int _tableCount; |
| 262 int _totalSize; | 262 int _totalSize; |
| 263 }; | 263 }; |
| 264 | 264 |
| 265 uint32_t FX_GetHashCode(const FX_CHAR* pStr); | 265 uint32_t FX_GetHashCode(const FX_CHAR* pStr); |
| 266 FX_DWORD FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); | 266 uint32_t FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName); |
| 267 uint32_t FX_IOSGetFamilyNamesCount(); | 267 uint32_t FX_IOSGetFamilyNamesCount(); |
| 268 const FX_CHAR* FX_IOSGetFamilyName(uint32_t uIndex); | 268 const FX_CHAR* FX_IOSGetFamilyName(uint32_t uIndex); |
| 269 #endif | 269 #endif |
| 270 | 270 |
| 271 #endif // CORE_FXGE_APPLE_APPLE_INT_H_ | 271 #endif // CORE_FXGE_APPLE_APPLE_INT_H_ |
| OLD | NEW |