Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(970)

Side by Side Diff: core/src/fxge/win32/win32_int.h

Issue 1800523005: Move core/src/ up to core/. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxge/win32/fx_win32_print.cpp ('k') | pdfium.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #ifndef CORE_SRC_FXGE_WIN32_WIN32_INT_H_
8 #define CORE_SRC_FXGE_WIN32_WIN32_INT_H_
9
10 #include "core/include/fxge/fx_ge.h"
11 #include "core/src/fxge/win32/dwrite_int.h"
12
13 struct WINDIB_Open_Args_;
14 class CGdiplusExt {
15 public:
16 CGdiplusExt();
17 ~CGdiplusExt();
18 void Load();
19 FX_BOOL IsAvailable() { return m_hModule != NULL; }
20 FX_BOOL StretchBitMask(HDC hDC,
21 BOOL bMonoDevice,
22 const CFX_DIBitmap* pBitmap,
23 int dest_left,
24 int dest_top,
25 int dest_width,
26 int dest_height,
27 FX_DWORD argb,
28 const FX_RECT* pClipRect,
29 int flags);
30 FX_BOOL StretchDIBits(HDC hDC,
31 const CFX_DIBitmap* pBitmap,
32 int dest_left,
33 int dest_top,
34 int dest_width,
35 int dest_height,
36 const FX_RECT* pClipRect,
37 int flags);
38 FX_BOOL DrawPath(HDC hDC,
39 const CFX_PathData* pPathData,
40 const CFX_Matrix* pObject2Device,
41 const CFX_GraphStateData* pGraphState,
42 FX_DWORD fill_argb,
43 FX_DWORD stroke_argb,
44 int fill_mode);
45
46 void* LoadMemFont(uint8_t* pData, FX_DWORD size);
47 void DeleteMemFont(void* pFontCollection);
48 FX_BOOL GdipCreateFromImage(void* bitmap, void** graphics);
49 void GdipDeleteGraphics(void* graphics);
50 void GdipSetTextRenderingHint(void* graphics, int mode);
51 void GdipSetPageUnit(void* graphics, FX_DWORD unit);
52 void GdipSetWorldTransform(void* graphics, void* pMatrix);
53 FX_BOOL GdipDrawDriverString(void* graphics,
54 unsigned short* text,
55 int length,
56 void* font,
57 void* brush,
58 void* positions,
59 int flags,
60 const void* matrix);
61 void GdipCreateBrush(FX_DWORD fill_argb, void** pBrush);
62 void GdipDeleteBrush(void* pBrush);
63 void GdipCreateMatrix(FX_FLOAT a,
64 FX_FLOAT b,
65 FX_FLOAT c,
66 FX_FLOAT d,
67 FX_FLOAT e,
68 FX_FLOAT f,
69 void** matrix);
70 void GdipDeleteMatrix(void* matrix);
71 FX_BOOL GdipCreateFontFamilyFromName(const FX_WCHAR* name,
72 void* pFontCollection,
73 void** pFamily);
74 void GdipDeleteFontFamily(void* pFamily);
75 FX_BOOL GdipCreateFontFromFamily(void* pFamily,
76 FX_FLOAT font_size,
77 int fontstyle,
78 int flag,
79 void** pFont);
80 void* GdipCreateFontFromCollection(void* pFontCollection,
81 FX_FLOAT font_size,
82 int fontstyle);
83 void GdipDeleteFont(void* pFont);
84 FX_BOOL GdipCreateBitmap(CFX_DIBitmap* pBitmap, void** bitmap);
85 void GdipDisposeImage(void* bitmap);
86 void GdipGetFontSize(void* pFont, FX_FLOAT* size);
87 void* GdiAddFontMemResourceEx(void* pFontdata,
88 FX_DWORD size,
89 void* pdv,
90 FX_DWORD* num_face);
91 FX_BOOL GdiRemoveFontMemResourceEx(void* handle);
92 void* m_Functions[100];
93 void* m_pGdiAddFontMemResourceEx;
94 void* m_pGdiRemoveFontMemResourseEx;
95 CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args);
96
97 protected:
98 HMODULE m_hModule;
99 HMODULE m_GdiModule;
100 };
101 class CWin32Platform {
102 public:
103 FX_BOOL m_bHalfTone;
104 CGdiplusExt m_GdiplusExt;
105 CDWriteExt m_DWriteExt;
106 };
107
108 class CGdiDeviceDriver : public IFX_RenderDeviceDriver {
109 protected:
110 // IFX_RenderDeviceDriver
111 int GetDeviceCaps(int caps_id) override;
112 void SaveState() override { SaveDC(m_hDC); }
113 void RestoreState(FX_BOOL bKeepSaved = FALSE) override {
114 RestoreDC(m_hDC, -1);
115 if (bKeepSaved) {
116 SaveDC(m_hDC);
117 }
118 }
119 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
120 const CFX_Matrix* pObject2Device,
121 int fill_mode) override;
122 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
123 const CFX_Matrix* pObject2Device,
124 const CFX_GraphStateData* pGraphState) override;
125 FX_BOOL DrawPath(const CFX_PathData* pPathData,
126 const CFX_Matrix* pObject2Device,
127 const CFX_GraphStateData* pGraphState,
128 FX_DWORD fill_color,
129 FX_DWORD stroke_color,
130 int fill_mode,
131 int alpha_flag,
132 void* pIccTransform,
133 int blend_type) override;
134 FX_BOOL FillRect(const FX_RECT* pRect,
135 FX_DWORD fill_color,
136 int alpha_flag,
137 void* pIccTransform,
138 int blend_type) override;
139 FX_BOOL DrawCosmeticLine(FX_FLOAT x1,
140 FX_FLOAT y1,
141 FX_FLOAT x2,
142 FX_FLOAT y2,
143 FX_DWORD color,
144 int alpha_flag,
145 void* pIccTransform,
146 int blend_type) override;
147 FX_BOOL GetClipBox(FX_RECT* pRect) override;
148 void* GetPlatformSurface() override { return (void*)m_hDC; }
149
150 virtual void* GetClipRgn();
151 virtual FX_BOOL SetClipRgn(void* pRgn);
152 virtual FX_BOOL DeleteDeviceRgn(void* pRgn);
153 virtual void DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2);
154
155 FX_BOOL GDI_SetDIBits(const CFX_DIBitmap* pBitmap,
156 const FX_RECT* pSrcRect,
157 int left,
158 int top,
159 void* pIccTransform);
160 FX_BOOL GDI_StretchDIBits(const CFX_DIBitmap* pBitmap,
161 int dest_left,
162 int dest_top,
163 int dest_width,
164 int dest_height,
165 FX_DWORD flags,
166 void* pIccTransform);
167 FX_BOOL GDI_StretchBitMask(const CFX_DIBitmap* pBitmap,
168 int dest_left,
169 int dest_top,
170 int dest_width,
171 int dest_height,
172 FX_DWORD bitmap_color,
173 FX_DWORD flags,
174 int alpha_flag,
175 void* pIccTransform);
176 HDC m_hDC;
177 int m_Width, m_Height, m_nBitsPerPixel;
178 int m_DeviceClass, m_RenderCaps;
179 CGdiDeviceDriver(HDC hDC, int device_class);
180 ~CGdiDeviceDriver() override {}
181 };
182
183 class CGdiDisplayDriver : public CGdiDeviceDriver {
184 public:
185 CGdiDisplayDriver(HDC hDC);
186
187 protected:
188 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap,
189 int left,
190 int top,
191 void* pIccTransform = NULL,
192 FX_BOOL bDEdge = FALSE);
193 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
194 FX_DWORD color,
195 const FX_RECT* pSrcRect,
196 int left,
197 int top,
198 int blend_type,
199 int alpha_flag,
200 void* pIccTransform);
201 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
202 FX_DWORD color,
203 int dest_left,
204 int dest_top,
205 int dest_width,
206 int dest_height,
207 const FX_RECT* pClipRect,
208 FX_DWORD flags,
209 int alpha_flag,
210 void* pIccTransform,
211 int blend_type);
212 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
213 int bitmap_alpha,
214 FX_DWORD color,
215 const CFX_Matrix* pMatrix,
216 FX_DWORD render_flags,
217 void*& handle,
218 int alpha_flag,
219 void* pIccTransform,
220 int blend_type) {
221 return FALSE;
222 }
223 FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource,
224 FX_DWORD color,
225 int dest_left,
226 int dest_top,
227 int dest_width,
228 int dest_height,
229 const FX_RECT* pClipRect,
230 int render_flags,
231 int alpha_flag = 0,
232 void* pIccTransform = NULL,
233 int blend_type = FXDIB_BLEND_NORMAL);
234 };
235 class CGdiPrinterDriver : public CGdiDeviceDriver {
236 public:
237 CGdiPrinterDriver(HDC hDC);
238
239 protected:
240 virtual int GetDeviceCaps(int caps_id);
241 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
242 FX_DWORD color,
243 const FX_RECT* pSrcRect,
244 int left,
245 int top,
246 int blend_type,
247 int alpha_flag,
248 void* pIccTransform);
249 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
250 FX_DWORD color,
251 int dest_left,
252 int dest_top,
253 int dest_width,
254 int dest_height,
255 const FX_RECT* pClipRect,
256 FX_DWORD flags,
257 int alpha_flag,
258 void* pIccTransform,
259 int blend_type);
260 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
261 int bitmap_alpha,
262 FX_DWORD color,
263 const CFX_Matrix* pMatrix,
264 FX_DWORD render_flags,
265 void*& handle,
266 int alpha_flag,
267 void* pIccTransform,
268 int blend_type);
269 int m_HorzSize, m_VertSize;
270 FX_BOOL m_bSupportROP;
271 };
272
273 class CPSOutput : public IFX_PSOutput {
274 public:
275 explicit CPSOutput(HDC hDC);
276 ~CPSOutput() override;
277
278 // IFX_PSOutput
279 void Release() override { delete this; }
280 void OutputPS(const FX_CHAR* str, int len) override;
281
282 void Init();
283
284 HDC m_hDC;
285 FX_CHAR* m_pBuf;
286 };
287
288 class CPSPrinterDriver : public IFX_RenderDeviceDriver {
289 public:
290 CPSPrinterDriver();
291 FX_BOOL Init(HDC hDC, int ps_level, FX_BOOL bCmykOutput);
292 ~CPSPrinterDriver() override;
293
294 protected:
295 // IFX_RenderDeviceDriver
296 int GetDeviceCaps(int caps_id);
297 FX_BOOL IsPSPrintDriver() override { return TRUE; }
298 FX_BOOL StartRendering() override;
299 void EndRendering() override;
300 void SaveState() override;
301 void RestoreState(FX_BOOL bKeepSaved = FALSE) override;
302 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
303 const CFX_Matrix* pObject2Device,
304 int fill_mode) override;
305 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
306 const CFX_Matrix* pObject2Device,
307 const CFX_GraphStateData* pGraphState) override;
308 FX_BOOL DrawPath(const CFX_PathData* pPathData,
309 const CFX_Matrix* pObject2Device,
310 const CFX_GraphStateData* pGraphState,
311 FX_DWORD fill_color,
312 FX_DWORD stroke_color,
313 int fill_mode,
314 int alpha_flag,
315 void* pIccTransform,
316 int blend_type) override;
317 FX_BOOL GetClipBox(FX_RECT* pRect) override;
318 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
319 FX_DWORD color,
320 const FX_RECT* pSrcRect,
321 int left,
322 int top,
323 int blend_type,
324 int alpha_flag,
325 void* pIccTransform) override;
326 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
327 FX_DWORD color,
328 int dest_left,
329 int dest_top,
330 int dest_width,
331 int dest_height,
332 const FX_RECT* pClipRect,
333 FX_DWORD flags,
334 int alpha_flag,
335 void* pIccTransform,
336 int blend_type) override;
337 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
338 int bitmap_alpha,
339 FX_DWORD color,
340 const CFX_Matrix* pMatrix,
341 FX_DWORD render_flags,
342 void*& handle,
343 int alpha_flag,
344 void* pIccTransform,
345 int blend_type) override;
346 FX_BOOL DrawDeviceText(int nChars,
347 const FXTEXT_CHARPOS* pCharPos,
348 CFX_Font* pFont,
349 CFX_FontCache* pCache,
350 const CFX_Matrix* pObject2Device,
351 FX_FLOAT font_size,
352 FX_DWORD color,
353 int alpha_flag,
354 void* pIccTransform) override;
355 void* GetPlatformSurface() override { return (void*)m_hDC; }
356
357 HDC m_hDC;
358 FX_BOOL m_bCmykOutput;
359 int m_Width, m_Height, m_nBitsPerPixel;
360 int m_HorzSize, m_VertSize;
361 CPSOutput* m_pPSOutput;
362 CFX_PSRenderer m_PSRenderer;
363 };
364 void _Color2Argb(FX_ARGB& argb,
365 FX_DWORD color,
366 int alpha_flag,
367 void* pIccTransform);
368
369 #endif // CORE_SRC_FXGE_WIN32_WIN32_INT_H_
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_print.cpp ('k') | pdfium.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698