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