1 // Copyright 2020 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_WIN32_CGDI_PRINTER_DRIVER_H_
8 #define CORE_FXGE_WIN32_CGDI_PRINTER_DRIVER_H_
9 
10 #include <windows.h>
11 
12 #include <memory>
13 
14 #include "core/fxge/win32/cgdi_device_driver.h"
15 
16 class CGdiPrinterDriver final : public CGdiDeviceDriver {
17  public:
18   explicit CGdiPrinterDriver(HDC hDC);
19   ~CGdiPrinterDriver() override;
20 
21  private:
22   // CGdiPrinterDriver:
23   int GetDeviceCaps(int caps_id) const override;
24   bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap,
25                  uint32_t color,
26                  const FX_RECT& src_rect,
27                  int left,
28                  int top,
29                  BlendMode blend_type) override;
30   bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap,
31                      uint32_t color,
32                      int dest_left,
33                      int dest_top,
34                      int dest_width,
35                      int dest_height,
36                      const FX_RECT* pClipRect,
37                      const FXDIB_ResampleOptions& options,
38                      BlendMode blend_type) override;
39   bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap,
40                    int bitmap_alpha,
41                    uint32_t color,
42                    const CFX_Matrix& matrix,
43                    const FXDIB_ResampleOptions& options,
44                    std::unique_ptr<CFX_ImageRenderer>* handle,
45                    BlendMode blend_type) override;
46   bool DrawDeviceText(int nChars,
47                       const TextCharPos* pCharPos,
48                       CFX_Font* pFont,
49                       const CFX_Matrix& mtObject2Device,
50                       float font_size,
51                       uint32_t color,
52                       const CFX_TextRenderOptions& options) override;
53 
54   const int m_HorzSize;
55   const int m_VertSize;
56 };
57 
58 #endif  // CORE_FXGE_WIN32_CGDI_PRINTER_DRIVER_H_
59