OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_FXGE_WIN32_WIN32_INT_H_ | 7 #ifndef CORE_FXGE_WIN32_WIN32_INT_H_ |
8 #define CORE_FXGE_WIN32_WIN32_INT_H_ | 8 #define CORE_FXGE_WIN32_WIN32_INT_H_ |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
11 | 11 |
12 #include <memory> | |
13 | |
12 #include "core/fxge/cfx_pathdata.h" | 14 #include "core/fxge/cfx_pathdata.h" |
13 #include "core/fxge/ifx_renderdevicedriver.h" | 15 #include "core/fxge/ifx_renderdevicedriver.h" |
14 #include "core/fxge/win32/dwrite_int.h" | 16 #include "core/fxge/win32/dwrite_int.h" |
17 #include "core/fxge/win32/fx_ge_ps.h" | |
15 | 18 |
16 struct FXTEXT_CHARPOS; | 19 struct FXTEXT_CHARPOS; |
17 struct WINDIB_Open_Args_; | 20 struct WINDIB_Open_Args_; |
18 | 21 |
19 typedef HANDLE(__stdcall* FuncType_GdiAddFontMemResourceEx)(PVOID pbFont, | 22 typedef HANDLE(__stdcall* FuncType_GdiAddFontMemResourceEx)(PVOID pbFont, |
20 DWORD cbFont, | 23 DWORD cbFont, |
21 PVOID pdv, | 24 PVOID pdv, |
22 DWORD* pcFonts); | 25 DWORD* pcFonts); |
23 typedef BOOL(__stdcall* FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle); | 26 typedef BOOL(__stdcall* FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle); |
24 | 27 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 const FXTEXT_CHARPOS* pCharPos, | 256 const FXTEXT_CHARPOS* pCharPos, |
254 CFX_Font* pFont, | 257 CFX_Font* pFont, |
255 const CFX_Matrix* pObject2Device, | 258 const CFX_Matrix* pObject2Device, |
256 FX_FLOAT font_size, | 259 FX_FLOAT font_size, |
257 uint32_t color) override; | 260 uint32_t color) override; |
258 | 261 |
259 const int m_HorzSize; | 262 const int m_HorzSize; |
260 const int m_VertSize; | 263 const int m_VertSize; |
261 }; | 264 }; |
262 | 265 |
266 class CPSOutput : public IFX_PSOutput { | |
dsinclair
2017/01/05 17:13:43
Can this go in its own file? (Same with the cpp bi
rbpotter
2017/01/05 22:58:19
Done.
| |
267 public: | |
268 explicit CPSOutput(HDC hDC); | |
269 ~CPSOutput() override; | |
270 | |
271 // IFX_PSOutput | |
272 void Release() override; | |
273 | |
274 void OutputPS(const FX_CHAR* str, int len) override; | |
275 | |
276 HDC m_hDC; | |
277 }; | |
278 | |
279 class CPSPrinterDriver : public IFX_RenderDeviceDriver { | |
280 public: | |
281 CPSPrinterDriver(HDC hDC, int ps_level, bool bCmykOutput); | |
282 ~CPSPrinterDriver() override; | |
283 | |
284 protected: | |
285 // IFX_RenderDeviceDriver | |
286 int GetDeviceCaps(int caps_id) const override; | |
287 bool StartRendering() override; | |
288 void EndRendering() override; | |
289 void SaveState() override; | |
290 void RestoreState(bool bKeepSaved) override; | |
291 bool SetClip_PathFill(const CFX_PathData* pPathData, | |
292 const CFX_Matrix* pObject2Device, | |
293 int fill_mode) override; | |
294 bool SetClip_PathStroke(const CFX_PathData* pPathData, | |
295 const CFX_Matrix* pObject2Device, | |
296 const CFX_GraphStateData* pGraphState) override; | |
297 bool DrawPath(const CFX_PathData* pPathData, | |
298 const CFX_Matrix* pObject2Device, | |
299 const CFX_GraphStateData* pGraphState, | |
300 uint32_t fill_color, | |
301 uint32_t stroke_color, | |
302 int fill_mode, | |
303 int blend_type) override; | |
304 bool GetClipBox(FX_RECT* pRect) override; | |
305 bool SetDIBits(const CFX_DIBSource* pBitmap, | |
306 uint32_t color, | |
307 const FX_RECT* pSrcRect, | |
308 int left, | |
309 int top, | |
310 int blend_type) override; | |
311 bool StretchDIBits(const CFX_DIBSource* pBitmap, | |
312 uint32_t color, | |
313 int dest_left, | |
314 int dest_top, | |
315 int dest_width, | |
316 int dest_height, | |
317 const FX_RECT* pClipRect, | |
318 uint32_t flags, | |
319 int blend_type) override; | |
320 bool StartDIBits(const CFX_DIBSource* pBitmap, | |
321 int bitmap_alpha, | |
322 uint32_t color, | |
323 const CFX_Matrix* pMatrix, | |
324 uint32_t render_flags, | |
325 void*& handle, | |
326 int blend_type) override; | |
327 bool DrawDeviceText(int nChars, | |
328 const FXTEXT_CHARPOS* pCharPos, | |
329 CFX_Font* pFont, | |
330 const CFX_Matrix* pObject2Device, | |
331 FX_FLOAT font_size, | |
332 uint32_t color) override; | |
333 void* GetPlatformSurface() const override; | |
334 | |
335 HDC m_hDC; | |
336 bool m_bCmykOutput; | |
337 int m_Width; | |
338 int m_Height; | |
339 int m_nBitsPerPixel; | |
340 int m_HorzSize; | |
341 int m_VertSize; | |
342 std::unique_ptr<CPSOutput> m_pPSOutput; | |
343 CFX_PSRenderer m_PSRenderer; | |
344 }; | |
345 | |
263 #endif // CORE_FXGE_WIN32_WIN32_INT_H_ | 346 #endif // CORE_FXGE_WIN32_WIN32_INT_H_ |
OLD | NEW |