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 XFA_FDE_FDE_GEDEVICE_H_ | 7 #ifndef XFA_FDE_FDE_GEDEVICE_H_ |
8 #define XFA_FDE_FDE_GEDEVICE_H_ | 8 #define XFA_FDE_FDE_GEDEVICE_H_ |
9 | 9 |
10 #include "core/fxge/include/fx_ge.h" | 10 #include "core/fxge/include/fx_ge.h" |
11 #include "xfa/fgas/crt/fgas_memory.h" | 11 #include "xfa/fgas/crt/fgas_memory.h" |
12 | 12 |
13 typedef struct FDE_HDEVICESTATE_ { void* pData; } * FDE_HDEVICESTATE; | 13 typedef struct FDE_HDEVICESTATE_ { void* pData; } * FDE_HDEVICESTATE; |
14 | 14 |
15 class CFDE_Brush; | 15 class CFDE_Brush; |
16 class CFDE_Path; | 16 class CFDE_Path; |
17 class CFDE_Pen; | 17 class CFDE_Pen; |
18 class IFX_Font; | 18 class CFX_GEFont; |
19 | 19 |
20 class CFDE_RenderDevice : public CFX_Target { | 20 class CFDE_RenderDevice : public CFX_Target { |
21 public: | 21 public: |
22 CFDE_RenderDevice(CFX_RenderDevice* pDevice, FX_BOOL bOwnerDevice); | 22 CFDE_RenderDevice(CFX_RenderDevice* pDevice, FX_BOOL bOwnerDevice); |
23 ~CFDE_RenderDevice() override; | 23 ~CFDE_RenderDevice() override; |
24 | 24 |
25 int32_t GetWidth() const; | 25 int32_t GetWidth() const; |
26 int32_t GetHeight() const; | 26 int32_t GetHeight() const; |
27 FDE_HDEVICESTATE SaveState(); | 27 FDE_HDEVICESTATE SaveState(); |
28 void RestoreState(FDE_HDEVICESTATE hState); | 28 void RestoreState(FDE_HDEVICESTATE hState); |
29 FX_BOOL SetClipPath(const CFDE_Path* pClip); | 29 FX_BOOL SetClipPath(const CFDE_Path* pClip); |
30 CFDE_Path* GetClipPath() const; | 30 CFDE_Path* GetClipPath() const; |
31 FX_BOOL SetClipRect(const CFX_RectF& rtClip); | 31 FX_BOOL SetClipRect(const CFX_RectF& rtClip); |
32 const CFX_RectF& GetClipRect(); | 32 const CFX_RectF& GetClipRect(); |
33 | 33 |
34 FX_FLOAT GetDpiX() const; | 34 FX_FLOAT GetDpiX() const; |
35 FX_FLOAT GetDpiY() const; | 35 FX_FLOAT GetDpiY() const; |
36 | 36 |
37 FX_BOOL DrawImage(CFX_DIBSource* pDib, | 37 FX_BOOL DrawImage(CFX_DIBSource* pDib, |
38 const CFX_RectF* pSrcRect, | 38 const CFX_RectF* pSrcRect, |
39 const CFX_RectF& dstRect, | 39 const CFX_RectF& dstRect, |
40 const CFX_Matrix* pImgMatrix = NULL, | 40 const CFX_Matrix* pImgMatrix = NULL, |
41 const CFX_Matrix* pDevMatrix = NULL); | 41 const CFX_Matrix* pDevMatrix = NULL); |
42 FX_BOOL DrawString(CFDE_Brush* pBrush, | 42 FX_BOOL DrawString(CFDE_Brush* pBrush, |
43 IFX_Font* pFont, | 43 CFX_GEFont* pFont, |
44 const FXTEXT_CHARPOS* pCharPos, | 44 const FXTEXT_CHARPOS* pCharPos, |
45 int32_t iCount, | 45 int32_t iCount, |
46 FX_FLOAT fFontSize, | 46 FX_FLOAT fFontSize, |
47 const CFX_Matrix* pMatrix = NULL); | 47 const CFX_Matrix* pMatrix = NULL); |
48 FX_BOOL DrawBezier(CFDE_Pen* pPen, | 48 FX_BOOL DrawBezier(CFDE_Pen* pPen, |
49 FX_FLOAT fPenWidth, | 49 FX_FLOAT fPenWidth, |
50 const CFX_PointF& pt1, | 50 const CFX_PointF& pt1, |
51 const CFX_PointF& pt2, | 51 const CFX_PointF& pt2, |
52 const CFX_PointF& pt3, | 52 const CFX_PointF& pt3, |
53 const CFX_PointF& pt4, | 53 const CFX_PointF& pt4, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 const CFDE_Path* pPath, | 94 const CFDE_Path* pPath, |
95 const CFX_Matrix* pMatrix = NULL); | 95 const CFX_Matrix* pMatrix = NULL); |
96 FX_BOOL FillPolygon(CFDE_Brush* pBrush, | 96 FX_BOOL FillPolygon(CFDE_Brush* pBrush, |
97 const CFX_PointsF& points, | 97 const CFX_PointsF& points, |
98 const CFX_Matrix* pMatrix = NULL); | 98 const CFX_Matrix* pMatrix = NULL); |
99 FX_BOOL FillRectangle(CFDE_Brush* pBrush, | 99 FX_BOOL FillRectangle(CFDE_Brush* pBrush, |
100 const CFX_RectF& rect, | 100 const CFX_RectF& rect, |
101 const CFX_Matrix* pMatrix = NULL); | 101 const CFX_Matrix* pMatrix = NULL); |
102 | 102 |
103 FX_BOOL DrawSolidString(CFDE_Brush* pBrush, | 103 FX_BOOL DrawSolidString(CFDE_Brush* pBrush, |
104 IFX_Font* pFont, | 104 CFX_GEFont* pFont, |
105 const FXTEXT_CHARPOS* pCharPos, | 105 const FXTEXT_CHARPOS* pCharPos, |
106 int32_t iCount, | 106 int32_t iCount, |
107 FX_FLOAT fFontSize, | 107 FX_FLOAT fFontSize, |
108 const CFX_Matrix* pMatrix); | 108 const CFX_Matrix* pMatrix); |
109 FX_BOOL DrawStringPath(CFDE_Brush* pBrush, | 109 FX_BOOL DrawStringPath(CFDE_Brush* pBrush, |
110 IFX_Font* pFont, | 110 CFX_GEFont* pFont, |
111 const FXTEXT_CHARPOS* pCharPos, | 111 const FXTEXT_CHARPOS* pCharPos, |
112 int32_t iCount, | 112 int32_t iCount, |
113 FX_FLOAT fFontSize, | 113 FX_FLOAT fFontSize, |
114 const CFX_Matrix* pMatrix); | 114 const CFX_Matrix* pMatrix); |
115 | 115 |
116 protected: | 116 protected: |
117 FX_BOOL CreatePen(CFDE_Pen* pPen, | 117 FX_BOOL CreatePen(CFDE_Pen* pPen, |
118 FX_FLOAT fPenWidth, | 118 FX_FLOAT fPenWidth, |
119 CFX_GraphStateData& graphState); | 119 CFX_GraphStateData& graphState); |
120 | 120 |
121 CFX_RenderDevice* m_pDevice; | 121 CFX_RenderDevice* m_pDevice; |
122 CFX_RectF m_rtClip; | 122 CFX_RectF m_rtClip; |
123 FX_BOOL m_bOwnerDevice; | 123 FX_BOOL m_bOwnerDevice; |
124 FXTEXT_CHARPOS* m_pCharPos; | 124 FXTEXT_CHARPOS* m_pCharPos; |
125 int32_t m_iCharCount; | 125 int32_t m_iCharCount; |
126 }; | 126 }; |
127 | 127 |
128 #endif // XFA_FDE_FDE_GEDEVICE_H_ | 128 #endif // XFA_FDE_FDE_GEDEVICE_H_ |
OLD | NEW |