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_INCLUDE_FXGE_FX_GE_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FX_GE_H_ |
8 #define CORE_INCLUDE_FXGE_FX_GE_H_ | 8 #define CORE_INCLUDE_FXGE_FX_GE_H_ |
9 | 9 |
10 #include "fx_dib.h" | 10 #include "fx_dib.h" |
11 #include "fx_font.h" | 11 #include "fx_font.h" |
12 | 12 |
13 class CFX_ClipRgn; | 13 class CFX_ClipRgn; |
14 class CFX_PathData; | 14 class CFX_PathData; |
15 class CFX_GraphStateData; | 15 class CFX_GraphStateData; |
16 class CFX_Font; | 16 class CFX_Font; |
17 class CFX_FontMgr; | 17 class CFX_FontMgr; |
18 class CFX_FontCache; | 18 class CFX_FontCache; |
19 class CFX_FaceCache; | 19 class CFX_FaceCache; |
20 class CFX_RenderDevice; | 20 class CFX_RenderDevice; |
21 class IFX_RenderDeviceDriver; | 21 class IFX_RenderDeviceDriver; |
22 class CCodec_ModuleMgr; | 22 class CCodec_ModuleMgr; |
23 class IFXG_PaintModuleMgr; | 23 class IFXG_PaintModuleMgr; |
24 | 24 |
25 class CFX_GEModule | 25 class CFX_GEModule { |
26 { | 26 public: |
27 public: | 27 static void Create(); |
28 | 28 |
29 static void»» » » Create(); | 29 static void Use(CFX_GEModule* pMgr); |
30 | 30 |
31 static void»» » » Use(CFX_GEModule* pMgr); | 31 static CFX_GEModule* Get(); |
32 | 32 |
33 static CFX_GEModule*» Get(); | 33 static void Destroy(); |
34 | 34 |
35 static void»» » » Destroy(); | 35 public: |
36 public: | 36 CFX_FontCache* GetFontCache(); |
37 | 37 CFX_FontMgr* GetFontMgr() { return m_pFontMgr; } |
38 CFX_FontCache*» » » GetFontCache(); | 38 void SetTextGamma(FX_FLOAT gammaValue); |
39 CFX_FontMgr*» » » GetFontMgr() | 39 const uint8_t* GetTextGammaTable(); |
40 { | 40 |
41 return m_pFontMgr; | 41 void SetCodecModule(CCodec_ModuleMgr* pCodecModule) { |
42 } | 42 m_pCodecModule = pCodecModule; |
43 void» » » » » SetTextGamma(FX_FLOAT gammaValue
); | 43 } |
44 const uint8_t*» » » » GetTextGammaTable(); | 44 CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } |
45 | 45 FXFT_Library m_FTLibrary; |
46 void» » » » » SetCodecModule(CCodec_ModuleMgr*
pCodecModule) | 46 void* GetPlatformData() { return m_pPlatformData; } |
47 { | 47 |
48 m_pCodecModule = pCodecModule; | 48 protected: |
49 } | 49 CFX_GEModule(); |
50 CCodec_ModuleMgr*» » GetCodecModule() | 50 |
51 { | 51 ~CFX_GEModule(); |
52 return m_pCodecModule; | 52 void InitPlatform(); |
53 } | 53 void DestroyPlatform(); |
54 FXFT_Library» » » m_FTLibrary; | 54 |
55 void*» » » » » GetPlatformData() | 55 private: |
56 { | 56 uint8_t m_GammaValue[256]; |
57 return m_pPlatformData; | 57 CFX_FontCache* m_pFontCache; |
58 } | 58 CFX_FontMgr* m_pFontMgr; |
59 protected: | 59 CCodec_ModuleMgr* m_pCodecModule; |
60 | 60 void* m_pPlatformData; |
61 CFX_GEModule(); | |
62 | |
63 ~CFX_GEModule(); | |
64 void» » » » » InitPlatform(); | |
65 void» » » » » DestroyPlatform(); | |
66 private: | |
67 uint8_t» » » » » m_GammaValue[256]; | |
68 CFX_FontCache*» » » m_pFontCache; | |
69 CFX_FontMgr*» » » m_pFontMgr; | |
70 CCodec_ModuleMgr*» » m_pCodecModule; | |
71 void*» » » » » m_pPlatformData; | |
72 }; | 61 }; |
73 typedef struct { | 62 typedef struct { |
74 | 63 FX_FLOAT m_PointX; |
75 FX_FLOAT» » » m_PointX; | 64 |
76 | 65 FX_FLOAT m_PointY; |
77 FX_FLOAT» » » m_PointY; | 66 |
78 | 67 int m_Flag; |
79 int»» » » » m_Flag; | |
80 } FX_PATHPOINT; | 68 } FX_PATHPOINT; |
81 #define FXPT_CLOSEFIGURE» » 0x01 | 69 #define FXPT_CLOSEFIGURE 0x01 |
82 #define FXPT_LINETO» » » » 0x02 | 70 #define FXPT_LINETO 0x02 |
83 #define FXPT_BEZIERTO» » » 0x04 | 71 #define FXPT_BEZIERTO 0x04 |
84 #define FXPT_MOVETO» » » » 0x06 | 72 #define FXPT_MOVETO 0x06 |
85 #define FXPT_TYPE» » » » 0x06 | 73 #define FXPT_TYPE 0x06 |
86 #define FXFILL_ALTERNATE» » 1 | 74 #define FXFILL_ALTERNATE 1 |
87 #define FXFILL_WINDING» » » 2 | 75 #define FXFILL_WINDING 2 |
88 class CFX_ClipRgn | 76 class CFX_ClipRgn { |
89 { | 77 public: |
90 public: | 78 CFX_ClipRgn(int device_width, int device_height); |
91 | 79 |
92 CFX_ClipRgn(int device_width, int device_height); | 80 CFX_ClipRgn(const FX_RECT& rect); |
93 | 81 |
94 CFX_ClipRgn(const FX_RECT& rect); | 82 CFX_ClipRgn(const CFX_ClipRgn& src); |
95 | 83 |
96 CFX_ClipRgn(const CFX_ClipRgn& src); | 84 ~CFX_ClipRgn(); |
97 | 85 |
98 ~CFX_ClipRgn(); | 86 typedef enum { RectI, MaskF } ClipType; |
99 | 87 |
100 typedef enum { | 88 void Reset(const FX_RECT& rect); |
101 RectI, | 89 |
102 MaskF | 90 ClipType GetType() const { return m_Type; } |
103 } ClipType; | 91 |
104 | 92 const FX_RECT& GetBox() const { return m_Box; } |
105 void» » » Reset(const FX_RECT& rect); | 93 |
106 | 94 CFX_DIBitmapRef GetMask() const { return m_Mask; } |
107 ClipType» » GetType() const | 95 |
108 { | 96 void IntersectRect(const FX_RECT& rect); |
109 return m_Type; | 97 |
110 } | 98 void IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask); |
111 | 99 |
112 const FX_RECT&» GetBox() const | 100 protected: |
113 { | 101 ClipType m_Type; |
114 return m_Box; | 102 |
115 } | 103 FX_RECT m_Box; |
116 | 104 |
117 CFX_DIBitmapRef» GetMask() const | 105 CFX_DIBitmapRef m_Mask; |
118 { | 106 |
119 return m_Mask; | 107 void IntersectMaskRect(FX_RECT rect, FX_RECT mask_box, CFX_DIBitmapRef Mask); |
120 } | 108 }; |
121 | 109 #define FX_GAMMA(value) (value) |
122 void» » » IntersectRect(const FX_RECT& rect); | 110 #define FX_GAMMA_INVERSE(value) (value) |
123 | 111 inline FX_ARGB ArgbGamma(FX_ARGB argb) { |
124 void» » » IntersectMaskF(int left, int top, CFX_DIBitmapRe
f Mask); | 112 return argb; |
125 protected: | |
126 | |
127 ClipType» » m_Type; | |
128 | |
129 FX_RECT» » » m_Box; | |
130 | |
131 CFX_DIBitmapRef» m_Mask; | |
132 | |
133 void» » » IntersectMaskRect(FX_RECT rect, FX_RECT mask_box
, CFX_DIBitmapRef Mask); | |
134 }; | |
135 #define FX_GAMMA(value)»» » (value) | |
136 #define FX_GAMMA_INVERSE(value)»(value) | |
137 inline FX_ARGB ArgbGamma(FX_ARGB argb) | |
138 { | |
139 return argb; | |
140 } | 113 } |
141 inline FX_ARGB ArgbGammaInverse(FX_ARGB argb) | 114 inline FX_ARGB ArgbGammaInverse(FX_ARGB argb) { |
142 { | 115 return argb; |
143 return argb; | |
144 } | 116 } |
145 class CFX_PathData | 117 class CFX_PathData { |
146 { | 118 public: |
147 public: | 119 CFX_PathData(); |
148 | 120 |
149 CFX_PathData(); | 121 CFX_PathData(const CFX_PathData& src); |
150 | 122 |
151 CFX_PathData(const CFX_PathData& src); | 123 ~CFX_PathData(); |
152 | 124 |
153 ~CFX_PathData(); | 125 int GetPointCount() const { return m_PointCount; } |
154 | 126 |
155 | 127 int GetFlag(int index) const { return m_pPoints[index].m_Flag; } |
156 | 128 |
157 | 129 FX_FLOAT GetPointX(int index) const { return m_pPoints[index].m_PointX; } |
158 int»» » » » GetPointCount() const | 130 |
159 { | 131 FX_FLOAT GetPointY(int index) const { return m_pPoints[index].m_PointY; } |
160 return m_PointCount; | 132 |
161 } | 133 FX_PATHPOINT* GetPoints() const { return m_pPoints; } |
162 | 134 |
163 int»» » » » GetFlag(int index) const | 135 void SetPointCount(int nPoints); |
164 { | 136 void AllocPointCount(int nPoints); |
165 return m_pPoints[index].m_Flag; | 137 void AddPointCount(int addPoints); |
166 } | 138 |
167 | 139 CFX_FloatRect GetBoundingBox() const; |
168 FX_FLOAT» » » GetPointX(int index) const | 140 |
169 { | 141 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const; |
170 return m_pPoints[index].m_PointX; | 142 |
171 } | 143 void Transform(const CFX_AffineMatrix* pMatrix); |
172 | 144 |
173 FX_FLOAT» » » GetPointY(int index) const | 145 FX_BOOL IsRect() const; |
174 { | 146 |
175 return m_pPoints[index].m_PointY; | 147 FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, |
176 } | 148 CFX_AffineMatrix* pMatrix, |
177 | 149 FX_BOOL& bThin, |
178 | 150 FX_BOOL bAdjust) const; |
179 | 151 |
180 FX_PATHPOINT*» » GetPoints() const | 152 FX_BOOL IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const; |
181 { | 153 |
182 return m_pPoints; | 154 void Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix); |
183 } | 155 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); |
184 | 156 |
185 void SetPointCount(int nPoints); | 157 void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag); |
186 void AllocPointCount(int nPoints); | 158 |
187 void AddPointCount(int addPoints); | 159 void TrimPoints(int nPoints); |
188 | 160 |
189 CFX_FloatRect» » GetBoundingBox() const; | 161 void Copy(const CFX_PathData& src); |
190 | 162 |
191 CFX_FloatRect» » GetBoundingBox(FX_FLOAT line_width, FX_FLOAT mit
er_limit) const; | 163 protected: |
192 | 164 friend class CPDF_Path; |
193 void» » » » Transform(const CFX_AffineMatrix* pMatri
x); | 165 |
194 | 166 int m_PointCount; |
195 FX_BOOL» » » » IsRect() const; | 167 |
196 | 168 FX_PATHPOINT* m_pPoints; |
197 FX_BOOL» » » » GetZeroAreaPath(CFX_PathData& NewPath, C
FX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const; | 169 |
198 | 170 int m_AllocCount; |
199 FX_BOOL» » » » IsRect(const CFX_AffineMatrix* pMatrix,
CFX_FloatRect* rect) const; | 171 }; |
200 | 172 class CFX_GraphStateData { |
201 void Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix); | 173 public: |
202 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top
); | 174 CFX_GraphStateData(); |
203 | 175 |
204 void» » » » SetPoint(int index, FX_FLOAT x, FX_FLOAT
y, int flag); | 176 CFX_GraphStateData(const CFX_GraphStateData& src); |
205 | 177 |
206 void» » » » TrimPoints(int nPoints); | 178 ~CFX_GraphStateData(); |
207 | 179 |
208 void Copy(const CFX_PathData &src); | 180 void Copy(const CFX_GraphStateData& src); |
209 protected: | 181 |
210 friend class» » CPDF_Path; | 182 void SetDashCount(int count); |
211 | 183 |
212 int»» » » » m_PointCount; | 184 typedef enum { LineCapButt = 0, LineCapRound = 1, LineCapSquare = 2 } LineCap; |
213 | 185 LineCap m_LineCap; |
214 FX_PATHPOINT*» » m_pPoints; | 186 int m_DashCount; |
215 | 187 FX_FLOAT* m_DashArray; |
216 int»» » » » m_AllocCount; | 188 FX_FLOAT m_DashPhase; |
217 }; | 189 |
218 class CFX_GraphStateData | 190 typedef enum { |
219 { | 191 LineJoinMiter = 0, |
220 public: | 192 LineJoinRound = 1, |
221 | 193 LineJoinBevel = 2, |
222 CFX_GraphStateData(); | 194 } LineJoin; |
223 | 195 LineJoin m_LineJoin; |
224 CFX_GraphStateData(const CFX_GraphStateData& src); | 196 FX_FLOAT m_MiterLimit; |
225 | 197 FX_FLOAT m_LineWidth; |
226 ~CFX_GraphStateData(); | 198 }; |
227 | 199 #define FXDC_DEVICE_CLASS 1 |
228 void» » » » Copy(const CFX_GraphStateData& src); | 200 #define FXDC_PIXEL_WIDTH 2 |
229 | 201 #define FXDC_PIXEL_HEIGHT 3 |
230 void» » » » SetDashCount(int count); | 202 #define FXDC_BITS_PIXEL 4 |
231 | 203 #define FXDC_HORZ_SIZE 5 |
232 | 204 #define FXDC_VERT_SIZE 6 |
233 | 205 #define FXDC_RENDER_CAPS 7 |
234 typedef enum { | 206 #define FXDC_DITHER_BITS 8 |
235 LineCapButt = 0, | 207 #define FXDC_DISPLAY 1 |
236 LineCapRound = 1, | 208 #define FXDC_PRINTER 2 |
237 LineCapSquare = 2 | 209 #define FXRC_GET_BITS 0x01 |
238 } LineCap; | 210 #define FXRC_BIT_MASK 0x02 |
239 LineCap» » » » m_LineCap; | 211 #define FXRC_ALPHA_MASK 0x04 |
240 int»» » » » m_DashCount; | 212 #define FXRC_ALPHA_PATH 0x10 |
241 FX_FLOAT*» » m_DashArray; | 213 #define FXRC_ALPHA_IMAGE 0x20 |
242 FX_FLOAT» » » m_DashPhase; | 214 #define FXRC_ALPHA_OUTPUT 0x40 |
243 | 215 #define FXRC_BLEND_MODE 0x80 |
244 typedef enum { | 216 #define FXRC_SOFT_CLIP 0x100 |
245 LineJoinMiter = 0, | 217 #define FXRC_CMYK_OUTPUT 0x200 |
246 LineJoinRound = 1, | 218 #define FXRC_BITMASK_OUTPUT 0x400 |
247 LineJoinBevel = 2, | 219 #define FXRC_BYTEMASK_OUTPUT 0x800 |
248 } LineJoin; | 220 #define FXRENDER_IMAGE_LOSSY 0x1000 |
249 LineJoin» » » m_LineJoin; | 221 #define FXFILL_ALTERNATE 1 |
250 FX_FLOAT» » » m_MiterLimit; | 222 #define FXFILL_WINDING 2 |
251 FX_FLOAT» » » m_LineWidth; | 223 #define FXFILL_FULLCOVER 4 |
252 | 224 #define FXFILL_RECT_AA 8 |
253 }; | 225 #define FX_FILL_STROKE 16 |
254 #define FXDC_DEVICE_CLASS» » » 1 | 226 #define FX_STROKE_ADJUST 32 |
255 #define FXDC_PIXEL_WIDTH» » » 2 | 227 #define FX_STROKE_TEXT_MODE 64 |
256 #define FXDC_PIXEL_HEIGHT» » » 3 | 228 #define FX_FILL_TEXT_MODE 128 |
257 #define FXDC_BITS_PIXEL»» » » 4 | 229 #define FX_ZEROAREA_FILL 256 |
258 #define FXDC_HORZ_SIZE» » » » 5 | 230 #define FXFILL_NOPATHSMOOTH 512 |
259 #define FXDC_VERT_SIZE» » » » 6 | 231 #define FXTEXT_CLEARTYPE 0x01 |
260 #define FXDC_RENDER_CAPS» » » 7 | 232 #define FXTEXT_BGR_STRIPE 0x02 |
261 #define FXDC_DITHER_BITS» » » 8 | 233 #define FXTEXT_PRINTGRAPHICTEXT 0x04 |
262 #define FXDC_DISPLAY» » » » 1 | 234 #define FXTEXT_NO_NATIVETEXT 0x08 |
263 #define FXDC_PRINTER» » » » 2 | 235 #define FXTEXT_PRINTIMAGETEXT 0x10 |
264 #define FXRC_GET_BITS» » » » 0x01 | 236 #define FXTEXT_NOSMOOTH 0x20 |
265 #define FXRC_BIT_MASK» » » » 0x02 | |
266 #define FXRC_ALPHA_MASK»» » » 0x04 | |
267 #define FXRC_ALPHA_PATH»» » » 0x10 | |
268 #define FXRC_ALPHA_IMAGE» » » 0x20 | |
269 #define FXRC_ALPHA_OUTPUT» » » 0x40 | |
270 #define FXRC_BLEND_MODE»» » » 0x80 | |
271 #define FXRC_SOFT_CLIP» » » » 0x100 | |
272 #define FXRC_CMYK_OUTPUT» » » 0x200 | |
273 #define FXRC_BITMASK_OUTPUT 0x400 | |
274 #define FXRC_BYTEMASK_OUTPUT 0x800 | |
275 #define FXRENDER_IMAGE_LOSSY» » 0x1000 | |
276 #define FXFILL_ALTERNATE» » 1 | |
277 #define FXFILL_WINDING» » » 2 | |
278 #define FXFILL_FULLCOVER» » 4 | |
279 #define FXFILL_RECT_AA» » » 8 | |
280 #define FX_FILL_STROKE» » » 16 | |
281 #define FX_STROKE_ADJUST» » 32 | |
282 #define FX_STROKE_TEXT_MODE» » 64 | |
283 #define FX_FILL_TEXT_MODE» » 128 | |
284 #define FX_ZEROAREA_FILL» » 256 | |
285 #define FXFILL_NOPATHSMOOTH» » 512 | |
286 #define FXTEXT_CLEARTYPE» » » 0x01 | |
287 #define FXTEXT_BGR_STRIPE» » » 0x02 | |
288 #define FXTEXT_PRINTGRAPHICTEXT»» 0x04 | |
289 #define FXTEXT_NO_NATIVETEXT» » 0x08 | |
290 #define FXTEXT_PRINTIMAGETEXT» » 0x10 | |
291 #define FXTEXT_NOSMOOTH»» » » 0x20 | |
292 typedef struct { | 237 typedef struct { |
293 FX_DWORD» » » m_GlyphIndex; | 238 FX_DWORD m_GlyphIndex; |
294 FX_FLOAT» » » m_OriginX, m_OriginY; | 239 FX_FLOAT m_OriginX, m_OriginY; |
295 int»» » » » m_FontCharWidth; | 240 int m_FontCharWidth; |
296 FX_BOOL» » » » m_bGlyphAdjust; | 241 FX_BOOL m_bGlyphAdjust; |
297 FX_FLOAT» » » m_AdjustMatrix[4]; | 242 FX_FLOAT m_AdjustMatrix[4]; |
298 FX_DWORD» » » m_ExtGID; | 243 FX_DWORD m_ExtGID; |
299 FX_BOOL» » » » m_bFontStyle; | 244 FX_BOOL m_bFontStyle; |
300 } FXTEXT_CHARPOS; | 245 } FXTEXT_CHARPOS; |
301 class CFX_RenderDevice | 246 class CFX_RenderDevice { |
302 { | 247 public: |
303 public: | 248 CFX_RenderDevice(); |
304 CFX_RenderDevice(); | 249 |
305 | 250 virtual ~CFX_RenderDevice(); |
306 virtual ~CFX_RenderDevice(); | 251 |
307 | 252 void SetDeviceDriver(IFX_RenderDeviceDriver* pDriver); |
308 void» » » SetDeviceDriver(IFX_RenderDeviceDriver* pDriver)
; | 253 |
309 | 254 IFX_RenderDeviceDriver* GetDeviceDriver() const { return m_pDeviceDriver; } |
310 IFX_RenderDeviceDriver*» GetDeviceDriver() const | 255 |
311 { | 256 FX_BOOL StartRendering(); |
312 return m_pDeviceDriver; | 257 |
313 } | 258 void EndRendering(); |
314 | 259 |
315 FX_BOOL» » » StartRendering(); | 260 void SaveState(); |
316 | 261 |
317 void» » » EndRendering(); | 262 void RestoreState(FX_BOOL bKeepSaved = FALSE); |
318 | 263 |
319 | 264 int GetWidth() const { return m_Width; } |
320 | 265 |
321 void» » » SaveState(); | 266 int GetHeight() const { return m_Height; } |
322 | 267 |
323 void» » » RestoreState(FX_BOOL bKeepSaved = FALSE); | 268 int GetDeviceClass() const { return m_DeviceClass; } |
324 | 269 |
325 | 270 int GetBPP() const { return m_bpp; } |
326 | 271 |
327 | 272 int GetRenderCaps() const { return m_RenderCaps; } |
328 int»» » » GetWidth() const | 273 |
329 { | 274 int GetDeviceCaps(int id) const; |
330 return m_Width; | 275 |
331 } | 276 CFX_Matrix GetCTM() const; |
332 | 277 |
333 int»» » » GetHeight() const | 278 CFX_DIBitmap* GetBitmap() const { return m_pBitmap; } |
334 { | 279 void SetBitmap(CFX_DIBitmap* pBitmap) { m_pBitmap = pBitmap; } |
335 return m_Height; | 280 |
336 } | 281 FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, |
337 | 282 int width, |
338 int»» » » GetDeviceClass() const | 283 int height) const; |
339 { | 284 |
340 return m_DeviceClass; | 285 const FX_RECT& GetClipBox() const { return m_ClipBox; } |
341 } | 286 |
342 | 287 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
343 int»» » » GetBPP() const | 288 const CFX_AffineMatrix* pObject2Device, |
344 { | 289 int fill_mode); |
345 return m_bpp; | 290 |
346 } | 291 FX_BOOL SetClip_Rect(const FX_RECT* pRect); |
347 | 292 |
348 int»» » » GetRenderCaps() const | 293 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
349 { | 294 const CFX_AffineMatrix* pObject2Device, |
350 return m_RenderCaps; | 295 const CFX_GraphStateData* pGraphState); |
351 } | 296 |
352 | 297 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
353 int»» » » GetDeviceCaps(int id) const; | 298 const CFX_AffineMatrix* pObject2Device, |
354 | 299 const CFX_GraphStateData* pGraphState, |
355 CFX_Matrix» » GetCTM() const; | 300 FX_DWORD fill_color, |
356 | 301 FX_DWORD stroke_color, |
357 | 302 int fill_mode, |
358 CFX_DIBitmap*» GetBitmap() const | 303 int alpha_flag = 0, |
359 { | 304 void* pIccTransform = NULL, |
360 return m_pBitmap; | 305 int blend_type = FXDIB_BLEND_NORMAL); |
361 } | 306 |
362 void» » » SetBitmap(CFX_DIBitmap* pBitmap) | 307 FX_BOOL SetPixel(int x, |
363 { | 308 int y, |
364 m_pBitmap = pBitmap; | 309 FX_DWORD color, |
365 } | 310 int alpha_flag = 0, |
366 | 311 void* pIccTransform = NULL); |
367 FX_BOOL» » » CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int w
idth, int height) const; | 312 |
368 | 313 FX_BOOL FillRect(const FX_RECT* pRect, |
369 const FX_RECT&» GetClipBox() const | 314 FX_DWORD color, |
370 { | 315 int alpha_flag = 0, |
371 return m_ClipBox; | 316 void* pIccTransform = NULL, |
372 } | 317 int blend_type = FXDIB_BLEND_NORMAL); |
373 | 318 |
374 FX_BOOL» » » SetClip_PathFill(const CFX_PathData* pPathData, | 319 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
| 320 FX_FLOAT y1, |
| 321 FX_FLOAT x2, |
| 322 FX_FLOAT y2, |
| 323 FX_DWORD color, |
| 324 int fill_mode = 0, |
| 325 int alpha_flag = 0, |
| 326 void* pIccTransform = NULL, |
| 327 int blend_type = FXDIB_BLEND_NORMAL); |
| 328 |
| 329 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
| 330 int left, |
| 331 int top, |
| 332 void* pIccTransform = NULL); |
| 333 |
| 334 CFX_DIBitmap* GetBackDrop(); |
| 335 |
| 336 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 337 int left, |
| 338 int top, |
| 339 int blend_type = FXDIB_BLEND_NORMAL, |
| 340 void* pIccTransform = NULL); |
| 341 |
| 342 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 343 int left, |
| 344 int top, |
| 345 int dest_width, |
| 346 int dest_height, |
| 347 FX_DWORD flags = 0, |
| 348 void* pIccTransform = NULL, |
| 349 int blend_type = FXDIB_BLEND_NORMAL); |
| 350 |
| 351 FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, |
| 352 int left, |
| 353 int top, |
| 354 FX_DWORD color, |
| 355 int alpha_flag = 0, |
| 356 void* pIccTransform = NULL); |
| 357 |
| 358 FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, |
| 359 int left, |
| 360 int top, |
| 361 int dest_width, |
| 362 int dest_height, |
| 363 FX_DWORD color, |
| 364 FX_DWORD flags = 0, |
| 365 int alpha_flag = 0, |
| 366 void* pIccTransform = NULL); |
| 367 |
| 368 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 369 int bitmap_alpha, |
| 370 FX_DWORD color, |
| 371 const CFX_AffineMatrix* pMatrix, |
| 372 FX_DWORD flags, |
| 373 void*& handle, |
| 374 int alpha_flag = 0, |
| 375 void* pIccTransform = NULL, |
| 376 int blend_type = FXDIB_BLEND_NORMAL); |
| 377 |
| 378 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); |
| 379 |
| 380 void CancelDIBits(void* handle); |
| 381 |
| 382 FX_BOOL DrawNormalText(int nChars, |
| 383 const FXTEXT_CHARPOS* pCharPos, |
| 384 CFX_Font* pFont, |
| 385 CFX_FontCache* pCache, |
| 386 FX_FLOAT font_size, |
| 387 const CFX_AffineMatrix* pText2Device, |
| 388 FX_DWORD fill_color, |
| 389 FX_DWORD text_flags, |
| 390 int alpha_flag = 0, |
| 391 void* pIccTransform = NULL); |
| 392 |
| 393 FX_BOOL DrawTextPath(int nChars, |
| 394 const FXTEXT_CHARPOS* pCharPos, |
| 395 CFX_Font* pFont, |
| 396 CFX_FontCache* pCache, |
| 397 FX_FLOAT font_size, |
| 398 const CFX_AffineMatrix* pText2User, |
| 399 const CFX_AffineMatrix* pUser2Device, |
| 400 const CFX_GraphStateData* pGraphState, |
| 401 FX_DWORD fill_color, |
| 402 FX_DWORD stroke_color, |
| 403 CFX_PathData* pClippingPath, |
| 404 int nFlag = 0, |
| 405 int alpha_flag = 0, |
| 406 void* pIccTransform = NULL, |
| 407 int blend_type = FXDIB_BLEND_NORMAL); |
| 408 virtual void Begin() {} |
| 409 virtual void End() {} |
| 410 |
| 411 private: |
| 412 CFX_DIBitmap* m_pBitmap; |
| 413 |
| 414 int m_Width; |
| 415 |
| 416 int m_Height; |
| 417 |
| 418 int m_bpp; |
| 419 |
| 420 int m_RenderCaps; |
| 421 |
| 422 int m_DeviceClass; |
| 423 |
| 424 FX_RECT m_ClipBox; |
| 425 |
| 426 protected: |
| 427 IFX_RenderDeviceDriver* m_pDeviceDriver; |
| 428 |
| 429 private: |
| 430 void InitDeviceInfo(); |
| 431 |
| 432 void UpdateClipBox(); |
| 433 }; |
| 434 class CFX_FxgeDevice : public CFX_RenderDevice { |
| 435 public: |
| 436 CFX_FxgeDevice(); |
| 437 |
| 438 ~CFX_FxgeDevice(); |
| 439 |
| 440 FX_BOOL Attach(CFX_DIBitmap* pBitmap, |
| 441 int dither_bits = 0, |
| 442 FX_BOOL bRgbByteOrder = FALSE, |
| 443 CFX_DIBitmap* pOriDevice = NULL, |
| 444 FX_BOOL bGroupKnockout = FALSE); |
| 445 |
| 446 FX_BOOL Create(int width, |
| 447 int height, |
| 448 FXDIB_Format format, |
| 449 int dither_bits = 0, |
| 450 CFX_DIBitmap* pOriDevice = NULL); |
| 451 |
| 452 protected: |
| 453 FX_BOOL m_bOwnedBitmap; |
| 454 }; |
| 455 class CFX_SkiaDevice : public CFX_RenderDevice { |
| 456 public: |
| 457 CFX_SkiaDevice(); |
| 458 |
| 459 ~CFX_SkiaDevice(); |
| 460 |
| 461 FX_BOOL Attach(CFX_DIBitmap* pBitmap, |
| 462 int dither_bits = 0, |
| 463 FX_BOOL bRgbByteOrder = FALSE, |
| 464 CFX_DIBitmap* pOriDevice = NULL, |
| 465 FX_BOOL bGroupKnockout = FALSE); |
| 466 |
| 467 FX_BOOL Create(int width, |
| 468 int height, |
| 469 FXDIB_Format format, |
| 470 int dither_bits = 0, |
| 471 CFX_DIBitmap* pOriDevice = NULL); |
| 472 |
| 473 protected: |
| 474 FX_BOOL m_bOwnedBitmap; |
| 475 }; |
| 476 class IFX_RenderDeviceDriver { |
| 477 public: |
| 478 static IFX_RenderDeviceDriver* CreateFxgeDriver( |
| 479 CFX_DIBitmap* pBitmap, |
| 480 FX_BOOL bRgbByteOrder = FALSE, |
| 481 CFX_DIBitmap* pOriDevice = NULL, |
| 482 FX_BOOL bGroupKnockout = FALSE); |
| 483 |
| 484 virtual ~IFX_RenderDeviceDriver() {} |
| 485 virtual void Begin() {} |
| 486 virtual void End() {} |
| 487 |
| 488 virtual int GetDeviceCaps(int caps_id) = 0; |
| 489 |
| 490 virtual CFX_Matrix GetCTM() const { return CFX_Matrix(); } |
| 491 |
| 492 virtual FX_BOOL IsPSPrintDriver() { return FALSE; } |
| 493 |
| 494 virtual FX_BOOL StartRendering() { return TRUE; } |
| 495 |
| 496 virtual void EndRendering() {} |
| 497 |
| 498 virtual void SaveState() = 0; |
| 499 |
| 500 virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0; |
| 501 |
| 502 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
| 503 const CFX_AffineMatrix* pObject2Device, |
| 504 int fill_mode) = 0; |
| 505 |
| 506 virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
375 const CFX_AffineMatrix* pObject2Device, | 507 const CFX_AffineMatrix* pObject2Device, |
376 int fill_mode | 508 const CFX_GraphStateData* pGraphState) { |
377 ); | 509 return FALSE; |
378 | 510 } |
379 FX_BOOL SetClip_Rect(const FX_RECT* pRect); | 511 |
380 | 512 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, |
381 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData
, | 513 const CFX_AffineMatrix* pObject2Device, |
382 const CFX_AffineMatrix* pObject2Device, | 514 const CFX_GraphStateData* pGraphState, |
383 const CFX_GraphStateData* pGraphState | 515 FX_DWORD fill_color, |
384 ); | 516 FX_DWORD stroke_color, |
385 | 517 int fill_mode, |
386 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 518 int alpha_flag = 0, |
387 const CFX_AffineMatrix* pObject2Device, | 519 void* pIccTransform = NULL, |
388 const CFX_GraphStateData* pGraphState, | 520 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
389 FX_DWORD fill_color, | 521 |
390 FX_DWORD stroke_color, | 522 virtual FX_BOOL SetPixel(int x, |
391 int fill_mode, | 523 int y, |
392 int alpha_flag = 0, | 524 FX_DWORD color, |
393 void* pIccTransform = NULL, | 525 int alpha_flag = 0, |
394 int blend_type = FXDIB_BLEND_NORMAL | 526 void* pIccTransform = NULL) { |
395 ); | 527 return FALSE; |
396 | 528 } |
397 FX_BOOL SetPixel(int x, int y, FX_DWORD color, | 529 |
398 int alpha_flag = 0, void* pIccTransform = NULL); | 530 virtual FX_BOOL FillRect(const FX_RECT* pRect, |
399 | 531 FX_DWORD fill_color, |
400 FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD color, | 532 int alpha_flag = 0, |
401 int alpha_flag = 0, void* pIccTransform = NULL, int
blend_type = FXDIB_BLEND_NORMAL); | 533 void* pIccTransform = NULL, |
402 | 534 int blend_type = FXDIB_BLEND_NORMAL) { |
403 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FL
OAT x2, FX_FLOAT y2, FX_DWORD color, | 535 return FALSE; |
404 int fill_mode = 0, int alpha_flag = 0, void
* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); | 536 } |
405 | 537 |
406 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int t
op, void* pIccTransform = NULL); | 538 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
407 | 539 FX_FLOAT y1, |
408 CFX_DIBitmap* GetBackDrop(); | 540 FX_FLOAT x2, |
409 | 541 FX_FLOAT y2, |
410 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, int left
, int top, int blend_type = FXDIB_BLEND_NORMAL, | 542 FX_DWORD color, |
411 void* pIccTransform = NULL); | 543 int alpha_flag = 0, |
412 | 544 void* pIccTransform = NULL, |
413 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, int
left, int top, int dest_width, int dest_height, | 545 int blend_type = FXDIB_BLEND_NORMAL) { |
414 FX_DWORD flags = 0, void* pIccTransform = NULL
, int blend_type = FXDIB_BLEND_NORMAL); | 546 return FALSE; |
415 | 547 } |
416 FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, int lef
t, int top, FX_DWORD color, | 548 |
417 int alpha_flag = 0, void* pIccTransform = NULL); | 549 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; |
418 | 550 |
419 FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, int
left, int top, int dest_width, int dest_height, | 551 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
420 FX_DWORD color, FX_DWORD flags = 0, int alpha
_flag = 0, void* pIccTransform = NULL); | 552 int left, |
421 | 553 int top, |
422 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bi
tmap_alpha, FX_DWORD color, | 554 void* pIccTransform = NULL, |
423 const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
void*& handle, | 555 FX_BOOL bDEdge = FALSE) { |
424 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL); | 556 return FALSE; |
425 | 557 } |
426 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); | 558 virtual CFX_DIBitmap* GetBackDrop() { return NULL; } |
427 | 559 |
428 void CancelDIBits(void* handle); | 560 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
429 | 561 FX_DWORD color, |
430 FX_BOOL DrawNormalText(int nChars, const FXTEXT_CHARPOS*
pCharPos, | 562 const FX_RECT* pSrcRect, |
431 CFX_Font* pFont, CFX_FontCache* pCache, | 563 int dest_left, |
432 FX_FLOAT font_size, const CFX_AffineMatrix* p
Text2Device, | 564 int dest_top, |
433 FX_DWORD fill_color, FX_DWORD text_flags, | 565 int blend_type, |
434 int alpha_flag = 0, void* pIccTransform = NUL
L); | 566 int alpha_flag = 0, |
435 | 567 void* pIccTransform = NULL) = 0; |
436 FX_BOOL DrawTextPath(int nChars, const FXTEXT_CHARPOS* p
CharPos, | 568 |
437 CFX_Font* pFont, CFX_FontCache* pCache, | 569 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
438 FX_FLOAT font_size, const CFX_AffineMatrix* pTe
xt2User, | 570 FX_DWORD color, |
439 const CFX_AffineMatrix* pUser2Device, const CFX
_GraphStateData* pGraphState, | 571 int dest_left, |
440 FX_DWORD fill_color, FX_DWORD stroke_color, CFX
_PathData* pClippingPath, int nFlag = 0, | 572 int dest_top, |
441 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL); | 573 int dest_width, |
442 virtual void Begin() {} | 574 int dest_height, |
443 virtual void End() {} | 575 const FX_RECT* pClipRect, |
444 private: | 576 FX_DWORD flags, |
445 | 577 int alpha_flag = 0, |
446 CFX_DIBitmap* m_pBitmap; | 578 void* pIccTransform = NULL, |
447 | 579 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
448 | 580 |
449 | 581 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
450 int m_Width; | 582 int bitmap_alpha, |
451 | 583 FX_DWORD color, |
452 int m_Height; | 584 const CFX_AffineMatrix* pMatrix, |
453 | 585 FX_DWORD flags, |
454 int m_bpp; | 586 void*& handle, |
455 | 587 int alpha_flag = 0, |
456 int m_RenderCaps; | 588 void* pIccTransform = NULL, |
457 | 589 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
458 int m_DeviceClass; | 590 |
459 | 591 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) { |
460 FX_RECT m_ClipBox; | 592 return FALSE; |
461 | 593 } |
462 protected: | 594 |
463 | 595 virtual void CancelDIBits(void* handle) {} |
464 IFX_RenderDeviceDriver* m_pDeviceDriver; | 596 |
465 private: | 597 virtual FX_BOOL DrawDeviceText(int nChars, |
466 | 598 const FXTEXT_CHARPOS* pCharPos, |
467 void InitDeviceInfo(); | 599 CFX_Font* pFont, |
468 | 600 CFX_FontCache* pCache, |
469 void UpdateClipBox(); | 601 const CFX_AffineMatrix* pObject2Device, |
470 }; | 602 FX_FLOAT font_size, |
471 class CFX_FxgeDevice : public CFX_RenderDevice | 603 FX_DWORD color, |
472 { | 604 int alpha_flag = 0, |
473 public: | 605 void* pIccTransform = NULL) { |
474 | 606 return FALSE; |
475 CFX_FxgeDevice(); | 607 } |
476 | 608 |
477 ~CFX_FxgeDevice(); | 609 virtual void* GetPlatformSurface() { return NULL; } |
478 | 610 |
479 FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits =
0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGrou
pKnockout = FALSE); | 611 virtual int GetDriverType() { return 0; } |
480 | 612 |
481 FX_BOOL Create(int width, int height, FXDIB_Format forma
t, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); | 613 virtual void ClearDriver() {} |
482 protected: | 614 }; |
483 | 615 class IFX_PSOutput { |
484 FX_BOOL m_bOwnedBitmap; | 616 public: |
485 }; | 617 virtual void Release() = 0; |
486 class CFX_SkiaDevice : public CFX_RenderDevice | 618 virtual void OutputPS(const FX_CHAR* string, int len) = 0; |
487 { | 619 |
488 public: | 620 protected: |
489 | 621 ~IFX_PSOutput() {} |
490 CFX_SkiaDevice(); | |
491 | |
492 ~CFX_SkiaDevice(); | |
493 | |
494 FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits =
0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGrou
pKnockout = FALSE); | |
495 | |
496 FX_BOOL Create(int width, int height, FXDIB_Format forma
t, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); | |
497 protected: | |
498 | |
499 FX_BOOL m_bOwnedBitmap; | |
500 }; | |
501 class IFX_RenderDeviceDriver | |
502 { | |
503 public: | |
504 | |
505 static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* p
Bitmap, FX_BOOL bRgbByteOrder = FALSE, | |
506 CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE); | |
507 | |
508 virtual ~IFX_RenderDeviceDriver() {} | |
509 virtual void Begin() { } | |
510 virtual void End() { } | |
511 | |
512 virtual int GetDeviceCaps(int caps_id) = 0; | |
513 | |
514 virtual CFX_Matrix GetCTM() const | |
515 { | |
516 return CFX_Matrix(); | |
517 } | |
518 | |
519 virtual FX_BOOL IsPSPrintDriver() | |
520 { | |
521 return FALSE; | |
522 } | |
523 | |
524 virtual FX_BOOL StartRendering() | |
525 { | |
526 return TRUE; | |
527 } | |
528 | |
529 virtual void EndRendering() {} | |
530 | |
531 | |
532 | |
533 | |
534 virtual void SaveState() = 0; | |
535 | |
536 virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0; | |
537 | |
538 | |
539 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | |
540 const CFX_AffineMatrix* pObject2Device, | |
541 int fill_mode | |
542 ) = 0; | |
543 | |
544 virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | |
545 const CFX_AffineMatrix* pObject2Device, | |
546 const CFX_GraphStateData* pGraphState | |
547 ) | |
548 { | |
549 return FALSE; | |
550 } | |
551 | |
552 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, | |
553 const CFX_AffineMatrix* pObject2Device, | |
554 const CFX_GraphStateData* pGraphState, | |
555 FX_DWORD fill_color, | |
556 FX_DWORD stroke_color, | |
557 int fill_mode, | |
558 int alpha_flag = 0, | |
559 void* pIccTransform = NULL, | |
560 int blend_type = FXDIB_BLEND_NORMAL | |
561 ) = 0; | |
562 | |
563 virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color, | |
564 int alpha_flag = 0, void* pIccTransform = NULL) | |
565 { | |
566 return FALSE; | |
567 } | |
568 | |
569 virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color, | |
570 int alpha_flag = 0, void* pIccTransform = NULL, int
blend_type = FXDIB_BLEND_NORMAL) | |
571 { | |
572 return FALSE; | |
573 } | |
574 | |
575 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2,
FX_FLOAT y2, FX_DWORD color, | |
576 int alpha_flag = 0, void* pIccTransform = N
ULL, int blend_type = FXDIB_BLEND_NORMAL) | |
577 { | |
578 return FALSE; | |
579 } | |
580 | |
581 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; | |
582 | |
583 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void
* pIccTransform = NULL, FX_BOOL bDEdge = FALSE) | |
584 { | |
585 return FALSE; | |
586 } | |
587 virtual CFX_DIBitmap* GetBackDrop() | |
588 { | |
589 return NULL; | |
590 } | |
591 | |
592 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
const FX_RECT* pSrcRect, | |
593 int dest_left, int dest_top, int blend_type, | |
594 int alpha_flag = 0, void* pIccTransform = NULL) =
0; | |
595 | |
596 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD col
or, int dest_left, int dest_top, | |
597 int dest_width, int dest_height, const FX_RECT
* pClipRect, FX_DWORD flags, | |
598 int alpha_flag = 0, void* pIccTransform = NULL
, int blend_type = FXDIB_BLEND_NORMAL) = 0; | |
599 | |
600 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alp
ha, FX_DWORD color, | |
601 const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
void*& handle, | |
602 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL) = 0; | |
603 | |
604 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) | |
605 { | |
606 return FALSE; | |
607 } | |
608 | |
609 virtual void CancelDIBits(void* handle) {} | |
610 | |
611 virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, C
FX_Font* pFont, | |
612 CFX_FontCache* pCache, const CFX_AffineMatrix
* pObject2Device, FX_FLOAT font_size, FX_DWORD color, | |
613 int alpha_flag = 0, void* pIccTransform = NUL
L) | |
614 { | |
615 return FALSE; | |
616 } | |
617 | |
618 virtual void* GetPlatformSurface() | |
619 { | |
620 return NULL; | |
621 } | |
622 | |
623 virtual int GetDriverType() | |
624 { | |
625 return 0; | |
626 } | |
627 | |
628 virtual void ClearDriver() {} | |
629 }; | |
630 class IFX_PSOutput | |
631 { | |
632 public: | |
633 virtual void Release() = 0; | |
634 virtual void OutputPS(const FX_CHAR* string, int len) = 0; | |
635 | |
636 protected: | |
637 ~IFX_PSOutput() { } | |
638 }; | 622 }; |
639 class CPSFont; | 623 class CPSFont; |
640 class CFX_PSRenderer | 624 class CFX_PSRenderer { |
641 { | 625 public: |
642 public: | 626 CFX_PSRenderer(); |
643 | 627 |
644 CFX_PSRenderer(); | 628 ~CFX_PSRenderer(); |
645 | 629 |
646 ~CFX_PSRenderer(); | 630 void Init(IFX_PSOutput* pOutput, |
647 | 631 int ps_level, |
648 void» » » Init(IFX_PSOutput* pOutput, int ps_level, int wi
dth, int height, FX_BOOL bCmykOutput); | 632 int width, |
649 FX_BOOL» » » StartRendering(); | 633 int height, |
650 void» » » EndRendering(); | 634 FX_BOOL bCmykOutput); |
651 | 635 FX_BOOL StartRendering(); |
652 void» » » SaveState(); | 636 void EndRendering(); |
653 | 637 |
654 void» » » RestoreState(FX_BOOL bKeepSaved = FALSE); | 638 void SaveState(); |
655 | 639 |
656 void» » » SetClip_PathFill(const CFX_PathData* pPathData, | 640 void RestoreState(FX_BOOL bKeepSaved = FALSE); |
657 const CFX_AffineMatrix* pObject2Device, | 641 |
658 int fill_mode | 642 void SetClip_PathFill(const CFX_PathData* pPathData, |
659 ); | 643 const CFX_AffineMatrix* pObject2Device, |
660 | 644 int fill_mode); |
661 void» » » SetClip_PathStroke(const CFX_PathData* pPathData
, | 645 |
662 const CFX_AffineMatrix* pObject2Device, | 646 void SetClip_PathStroke(const CFX_PathData* pPathData, |
663 const CFX_GraphStateData* pGraphState | 647 const CFX_AffineMatrix* pObject2Device, |
664 ); | 648 const CFX_GraphStateData* pGraphState); |
665 | 649 |
666 FX_RECT» » » GetClipBox() | 650 FX_RECT GetClipBox() { return m_ClipBox; } |
667 { | 651 |
668 return m_ClipBox; | 652 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
669 } | 653 const CFX_AffineMatrix* pObject2Device, |
670 | 654 const CFX_GraphStateData* pGraphState, |
671 FX_BOOL» » » DrawPath(const CFX_PathData* pPathData, | 655 FX_DWORD fill_color, |
672 const CFX_AffineMatrix* pObject2Device, | 656 FX_DWORD stroke_color, |
673 const CFX_GraphStateData* pGraphState, | 657 int fill_mode, |
674 FX_DWORD fill_color, | 658 int alpha_flag = 0, |
675 FX_DWORD stroke_color, | 659 void* pIccTransform = NULL); |
676 int fill_mode, | 660 |
677 int alpha_flag = 0, | 661 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
678 void* pIccTransform = NULL | 662 FX_DWORD color, |
679 ); | 663 int dest_left, |
680 | 664 int dest_top, |
681 FX_BOOL» » » SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD
color, int dest_left, int dest_top, | 665 int alpha_flag = 0, |
682 int alpha_flag = 0, void* pIccTransform = NULL); | 666 void* pIccTransform = NULL); |
683 | 667 |
684 FX_BOOL» » » StretchDIBits(const CFX_DIBSource* pBitmap, FX_D
WORD color, int dest_left, int dest_top, | 668 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
685 int dest_width, int dest_height, FX_DWORD flag
s, | 669 FX_DWORD color, |
686 int alpha_flag = 0, void* pIccTransform = NULL
); | 670 int dest_left, |
687 | 671 int dest_top, |
688 FX_BOOL» » » DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWOR
D color, | 672 int dest_width, |
689 const CFX_AffineMatrix* pMatrix, FX_DWORD flags, | 673 int dest_height, |
690 int alpha_flag = 0, void* pIccTransform = NULL); | 674 FX_DWORD flags, |
691 | 675 int alpha_flag = 0, |
692 FX_BOOL» » » DrawText(int nChars, const FXTEXT_CHARPOS* pChar
Pos, CFX_Font* pFont, CFX_FontCache* pCache, | 676 void* pIccTransform = NULL); |
693 const CFX_AffineMatrix* pObject2Device, FX_FLOAT fo
nt_size, FX_DWORD color, | 677 |
694 int alpha_flag = 0, void* pIccTransform = NULL); | 678 FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, |
695 private: | 679 FX_DWORD color, |
696 | 680 const CFX_AffineMatrix* pMatrix, |
697 IFX_PSOutput*» m_pOutput; | 681 FX_DWORD flags, |
698 | 682 int alpha_flag = 0, |
699 int»» » » m_PSLevel; | 683 void* pIccTransform = NULL); |
700 | 684 |
701 CFX_GraphStateData» m_CurGraphState; | 685 FX_BOOL DrawText(int nChars, |
702 | 686 const FXTEXT_CHARPOS* pCharPos, |
703 FX_BOOL» » » m_bGraphStateSet; | 687 CFX_Font* pFont, |
704 | 688 CFX_FontCache* pCache, |
705 FX_BOOL» » » m_bCmykOutput; | 689 const CFX_AffineMatrix* pObject2Device, |
706 | 690 FX_FLOAT font_size, |
707 FX_BOOL» » » m_bColorSet; | 691 FX_DWORD color, |
708 | 692 int alpha_flag = 0, |
709 FX_DWORD» » m_LastColor; | 693 void* pIccTransform = NULL); |
710 | 694 |
711 FX_RECT» » » m_ClipBox; | 695 private: |
712 | 696 IFX_PSOutput* m_pOutput; |
713 CFX_ArrayTemplate<CPSFont*>»m_PSFontList; | 697 |
714 | 698 int m_PSLevel; |
715 CFX_ArrayTemplate<FX_RECT>» m_ClipBoxStack; | 699 |
716 FX_BOOL» » » m_bInited; | 700 CFX_GraphStateData m_CurGraphState; |
717 | 701 |
718 void» » » OutputPath(const CFX_PathData* pPathData, const
CFX_AffineMatrix* pObject2Device); | 702 FX_BOOL m_bGraphStateSet; |
719 | 703 |
720 void» » » SetGraphState(const CFX_GraphStateData* pGraphSt
ate); | 704 FX_BOOL m_bCmykOutput; |
721 | 705 |
722 void» » » SetColor(FX_DWORD color, int alpha_flag, void* p
IccTransform); | 706 FX_BOOL m_bColorSet; |
723 | 707 |
724 void» » » FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_F
ont* pFont, const FXTEXT_CHARPOS& charpos, int& ps_fontnum, int &ps_glyphindex); | 708 FX_DWORD m_LastColor; |
725 | 709 |
726 void» » » WritePSBinary(const uint8_t* data, int len); | 710 FX_RECT m_ClipBox; |
| 711 |
| 712 CFX_ArrayTemplate<CPSFont*> m_PSFontList; |
| 713 |
| 714 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; |
| 715 FX_BOOL m_bInited; |
| 716 |
| 717 void OutputPath(const CFX_PathData* pPathData, |
| 718 const CFX_AffineMatrix* pObject2Device); |
| 719 |
| 720 void SetGraphState(const CFX_GraphStateData* pGraphState); |
| 721 |
| 722 void SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform); |
| 723 |
| 724 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, |
| 725 CFX_Font* pFont, |
| 726 const FXTEXT_CHARPOS& charpos, |
| 727 int& ps_fontnum, |
| 728 int& ps_glyphindex); |
| 729 |
| 730 void WritePSBinary(const uint8_t* data, int len); |
727 }; | 731 }; |
728 | 732 |
729 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ | 733 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ |
OLD | NEW |