1 // Copyright 2020 The PDFium Authors 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(RetainPtr<const CFX_DIBBase> bitmap, 25 uint32_t color, 26 const FX_RECT& src_rect, 27 int left, 28 int top, 29 BlendMode blend_type) override; 30 bool StretchDIBits(RetainPtr<const CFX_DIBBase> bitmap, 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 StartResult StartDIBits(RetainPtr<const CFX_DIBBase> bitmap, 40 float alpha, 41 uint32_t color, 42 const CFX_Matrix& matrix, 43 const FXDIB_ResampleOptions& options, 44 BlendMode blend_type) override; 45 bool DrawDeviceText(pdfium::span<const TextCharPos> pCharPos, 46 CFX_Font* pFont, 47 const CFX_Matrix& mtObject2Device, 48 float font_size, 49 uint32_t color, 50 const CFX_TextRenderOptions& options) override; 51 52 const int m_HorzSize; 53 const int m_VertSize; 54 }; 55 56 #endif // CORE_FXGE_WIN32_CGDI_PRINTER_DRIVER_H_ 57