Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cps_printer_driver.h
Go to the documentation of this file.
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_CPS_PRINTER_DRIVER_H_
8#define CORE_FXGE_WIN32_CPS_PRINTER_DRIVER_H_
9
10#include <windows.h>
11
12#include <memory>
13
14#include "core/fxge/cfx_windowsrenderdevice.h"
15#include "core/fxge/renderdevicedriver_iface.h"
16#include "core/fxge/win32/cfx_psrenderer.h"
17
19
20class CPSPrinterDriver final : public RenderDeviceDriverIface {
21 public:
22 CPSPrinterDriver(HDC hDC,
24 CFX_PSFontTracker* ps_font_tracker,
25 const EncoderIface* encoder_iface);
26 ~CPSPrinterDriver() override;
27
28 private:
29 // RenderDeviceDriverIface:
30 DeviceType GetDeviceType() const override;
31 int GetDeviceCaps(int caps_id) const override;
32 void SaveState() override;
33 void RestoreState(bool bKeepSaved) override;
34 bool SetClip_PathFill(const CFX_Path& paath,
35 const CFX_Matrix* pObject2Device,
36 const CFX_FillRenderOptions& fill_options) override;
37 bool SetClip_PathStroke(const CFX_Path& path,
38 const CFX_Matrix* pObject2Device,
39 const CFX_GraphStateData* pGraphState) override;
40 bool DrawPath(const CFX_Path& path,
41 const CFX_Matrix* pObject2Device,
42 const CFX_GraphStateData* pGraphState,
43 uint32_t fill_color,
44 uint32_t stroke_color,
45 const CFX_FillRenderOptions& fill_options) override;
46 FX_RECT GetClipBox() const override;
47 bool SetDIBits(RetainPtr<const CFX_DIBBase> bitmap,
48 uint32_t color,
49 const FX_RECT& src_rect,
50 int left,
51 int top,
52 BlendMode blend_type) override;
53 bool StretchDIBits(RetainPtr<const CFX_DIBBase> bitmap,
54 uint32_t color,
55 int dest_left,
56 int dest_top,
57 int dest_width,
58 int dest_height,
59 const FX_RECT* pClipRect,
60 const FXDIB_ResampleOptions& options,
61 BlendMode blend_type) override;
63 float alpha,
64 uint32_t color,
65 const CFX_Matrix& matrix,
66 const FXDIB_ResampleOptions& options,
67 BlendMode blend_type) override;
68 bool DrawDeviceText(pdfium::span<const TextCharPos> pCharPos,
69 CFX_Font* pFont,
70 const CFX_Matrix& mtObject2Device,
71 float font_size,
72 uint32_t color,
73 const CFX_TextRenderOptions& options) override;
74 bool MultiplyAlpha(float alpha) override;
75 bool MultiplyAlphaMask(RetainPtr<const CFX_DIBitmap> mask) override;
76
77 HDC m_hDC;
78 int m_Width;
79 int m_Height;
80 int m_nBitsPerPixel;
81 int m_HorzSize;
82 int m_VertSize;
83 CFX_PSRenderer m_PSRenderer;
84};
85
86#endif // CORE_FXGE_WIN32_CPS_PRINTER_DRIVER_H_
WindowsPrintMode g_pdfium_print_mode
CFX_WindowsRenderDevice(HDC hDC, CFX_PSFontTracker *ps_font_tracker, const EncoderIface *encoder_iface)
~CFX_WindowsRenderDevice() override
bool GDI_SetDIBits(RetainPtr< const CFX_DIBBase > source, const FX_RECT &src_rect, int left, int top)
void SetBaseClip(const FX_RECT &rect) override
const DeviceType m_DeviceType
bool SetClip_PathStroke(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState) override
void DrawLine(float x1, float y1, float x2, float y2)
bool FillRect(const FX_RECT &rect, uint32_t fill_color) override
~CGdiDeviceDriver() override
bool SetClip_PathFill(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_FillRenderOptions &fill_options) override
bool GDI_StretchDIBits(RetainPtr< const CFX_DIBBase > source, int dest_left, int dest_top, int dest_width, int dest_height, const FXDIB_ResampleOptions &options)
bool DrawPath(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options) override
int GetDeviceCaps(int caps_id) const override
FX_RECT GetClipBox() const override
bool MultiplyAlpha(float alpha) override
CGdiDeviceDriver(HDC hDC, DeviceType device_type)
void RestoreState(bool bKeepSaved) override
DeviceType GetDeviceType() const override
bool MultiplyAlphaMask(RetainPtr< const CFX_DIBitmap > mask) override
std::optional< FX_RECT > m_BaseClipBox
void SaveState() override
bool GDI_StretchBitMask(RetainPtr< const CFX_DIBBase > source, int dest_left, int dest_top, int dest_width, int dest_height, uint32_t bitmap_color)
bool DrawCosmeticLine(const CFX_PointF &ptMoveTo, const CFX_PointF &ptLineTo, uint32_t color) override
~CGdiDisplayDriver() override
bool GetDIBits(RetainPtr< CFX_DIBitmap > bitmap, int left, int top) const override
StartResult StartDIBits(RetainPtr< const CFX_DIBBase > bitmap, float alpha, uint32_t color, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, BlendMode blend_type) override
int GetDeviceCaps(int caps_id) const override
bool SetDIBits(RetainPtr< const CFX_DIBBase > bitmap, uint32_t color, const FX_RECT &src_rect, int left, int top, BlendMode blend_type) override
bool StretchDIBits(RetainPtr< const CFX_DIBBase > bitmap, uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT *pClipRect, const FXDIB_ResampleOptions &options, BlendMode blend_type) override
bool StretchDIBits(RetainPtr< const CFX_DIBBase > bitmap, uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT *pClipRect, const FXDIB_ResampleOptions &options, BlendMode blend_type) override
bool SetDIBits(RetainPtr< const CFX_DIBBase > bitmap, uint32_t color, const FX_RECT &src_rect, int left, int top, BlendMode blend_type) override
~CGdiPrinterDriver() override
int GetDeviceCaps(int caps_id) const override
StartResult StartDIBits(RetainPtr< const CFX_DIBBase > bitmap, float alpha, uint32_t color, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, BlendMode blend_type) override
bool DrawDeviceText(pdfium::span< const TextCharPos > pCharPos, CFX_Font *pFont, const CFX_Matrix &mtObject2Device, float font_size, uint32_t color, const CFX_TextRenderOptions &options) override
bool SetClip_PathFill(const CFX_Path &paath, const CFX_Matrix *pObject2Device, const CFX_FillRenderOptions &fill_options) override
bool StretchDIBits(RetainPtr< const CFX_DIBBase > bitmap, uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT *pClipRect, const FXDIB_ResampleOptions &options, BlendMode blend_type) override
CPSPrinterDriver(HDC hDC, WindowsPrintMode mode, CFX_PSFontTracker *ps_font_tracker, const EncoderIface *encoder_iface)
~CPSPrinterDriver() override
int GetDeviceCaps(int caps_id) const override
bool DrawDeviceText(pdfium::span< const TextCharPos > pCharPos, CFX_Font *pFont, const CFX_Matrix &mtObject2Device, float font_size, uint32_t color, const CFX_TextRenderOptions &options) override
bool MultiplyAlpha(float alpha) override
void SaveState() override
bool SetClip_PathStroke(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState) override
bool MultiplyAlphaMask(RetainPtr< const CFX_DIBitmap > mask) override
bool SetDIBits(RetainPtr< const CFX_DIBBase > bitmap, uint32_t color, const FX_RECT &src_rect, int left, int top, BlendMode blend_type) override
StartResult StartDIBits(RetainPtr< const CFX_DIBBase > bitmap, float alpha, uint32_t color, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, BlendMode blend_type) override
DeviceType GetDeviceType() const override
void RestoreState(bool bKeepSaved) override
FX_RECT GetClipBox() const override
bool DrawPath(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options) override
CFX_PTemplate< float > CFX_PointF
BlendMode
Definition fx_dib.h:119