• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 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_FXGE_CFX_WINDOWSRENDERDEVICE_H_
8 #define CORE_FXGE_CFX_WINDOWSRENDERDEVICE_H_
9 
10 #include <windows.h>
11 
12 #include "core/fxge/cfx_renderdevice.h"
13 
14 enum WindowsPrintMode {
15   kModeEmf = 0,
16   kModeTextOnly = 1,
17   kModePostScript2 = 2,
18   kModePostScript3 = 3,
19   kModePostScript2PassThrough = 4,
20   kModePostScript3PassThrough = 5,
21 };
22 
23 class RenderDeviceDriverIface;
24 struct EncoderIface;
25 
26 #if defined(PDFIUM_PRINT_TEXT_WITH_GDI)
27 typedef void (*PDFiumEnsureTypefaceCharactersAccessible)(const LOGFONT* font,
28                                                          const wchar_t* text,
29                                                          size_t text_length);
30 
31 extern bool g_pdfium_print_text_with_gdi;
32 extern PDFiumEnsureTypefaceCharactersAccessible
33     g_pdfium_typeface_accessible_func;
34 #endif
35 extern WindowsPrintMode g_pdfium_print_mode;
36 
37 class CFX_WindowsRenderDevice : public CFX_RenderDevice {
38  public:
39   CFX_WindowsRenderDevice(HDC hDC, const EncoderIface* pEncoderIface);
40   ~CFX_WindowsRenderDevice() override;
41 
42  private:
43   static RenderDeviceDriverIface* CreateDriver(
44       HDC hDC,
45       const EncoderIface* pEncoderIface);
46 };
47 
48 #endif  // CORE_FXGE_CFX_WINDOWSRENDERDEVICE_H_
49