| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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 XFA_SRC_FDE_FDE_RENDERDEVICE_H_ | |
| 8 #define XFA_SRC_FDE_FDE_RENDERDEVICE_H_ | |
| 9 | |
| 10 #include "core/include/fxcrt/fx_coordinates.h" | |
| 11 #include "core/include/fxge/fx_font.h" | |
| 12 #include "core/include/fxge/fx_ge.h" | |
| 13 #include "xfa/src/fde/fde_path.h" | |
| 14 #include "xfa/src/fgas/font/fgas_font.h" | |
| 15 | |
| 16 class IFDE_Pen; | |
| 17 class IFDE_Brush; | |
| 18 class CFX_DIBitmap; | |
| 19 class CFX_DIBSource; | |
| 20 | |
| 21 typedef struct FDE_HDEVICESTATE_ { void* pData; } * FDE_HDEVICESTATE; | |
| 22 | |
| 23 class IFDE_RenderDevice { | |
| 24 public: | |
| 25 static IFDE_RenderDevice* Create(CFX_DIBitmap* pBitmap, | |
| 26 FX_BOOL bRgbByteOrder = FALSE); | |
| 27 static IFDE_RenderDevice* Create(CFX_RenderDevice* pDevice); | |
| 28 virtual ~IFDE_RenderDevice() {} | |
| 29 virtual void Release() = 0; | |
| 30 | |
| 31 virtual int32_t GetWidth() const = 0; | |
| 32 virtual int32_t GetHeight() const = 0; | |
| 33 virtual FDE_HDEVICESTATE SaveState() = 0; | |
| 34 virtual void RestoreState(FDE_HDEVICESTATE hState) = 0; | |
| 35 virtual FX_BOOL SetClipPath(const IFDE_Path* pClip) = 0; | |
| 36 virtual IFDE_Path* GetClipPath() const = 0; | |
| 37 virtual FX_BOOL SetClipRect(const CFX_RectF& rtClip) = 0; | |
| 38 virtual const CFX_RectF& GetClipRect() = 0; | |
| 39 | |
| 40 virtual FX_FLOAT GetDpiX() const = 0; | |
| 41 virtual FX_FLOAT GetDpiY() const = 0; | |
| 42 | |
| 43 virtual FX_BOOL DrawImage(CFX_DIBSource* pDib, | |
| 44 const CFX_RectF* pSrcRect, | |
| 45 const CFX_RectF& dstRect, | |
| 46 const CFX_Matrix* pImgMatrix = NULL, | |
| 47 const CFX_Matrix* pDevMatrix = NULL) = 0; | |
| 48 virtual FX_BOOL DrawString(IFDE_Brush* pBrush, | |
| 49 IFX_Font* pFont, | |
| 50 const FXTEXT_CHARPOS* pCharPos, | |
| 51 int32_t iCount, | |
| 52 FX_FLOAT fFontSize, | |
| 53 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 54 virtual FX_BOOL DrawBezier(IFDE_Pen* pPen, | |
| 55 FX_FLOAT fPenWidth, | |
| 56 const CFX_PointF& pt1, | |
| 57 const CFX_PointF& pt2, | |
| 58 const CFX_PointF& pt3, | |
| 59 const CFX_PointF& pt4, | |
| 60 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 61 virtual FX_BOOL DrawCurve(IFDE_Pen* pPen, | |
| 62 FX_FLOAT fPenWidth, | |
| 63 const CFX_PointsF& points, | |
| 64 FX_BOOL bClosed, | |
| 65 FX_FLOAT fTension = 0.5f, | |
| 66 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 67 virtual FX_BOOL DrawEllipse(IFDE_Pen* pPen, | |
| 68 FX_FLOAT fPenWidth, | |
| 69 const CFX_RectF& rect, | |
| 70 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 71 virtual FX_BOOL DrawLines(IFDE_Pen* pPen, | |
| 72 FX_FLOAT fPenWidth, | |
| 73 const CFX_PointsF& points, | |
| 74 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 75 virtual FX_BOOL DrawLine(IFDE_Pen* pPen, | |
| 76 FX_FLOAT fPenWidth, | |
| 77 const CFX_PointF& pt1, | |
| 78 const CFX_PointF& pt2, | |
| 79 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 80 virtual FX_BOOL DrawPath(IFDE_Pen* pPen, | |
| 81 FX_FLOAT fPenWidth, | |
| 82 const IFDE_Path* pPath, | |
| 83 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 84 virtual FX_BOOL DrawPolygon(IFDE_Pen* pPen, | |
| 85 FX_FLOAT fPenWidth, | |
| 86 const CFX_PointsF& points, | |
| 87 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 88 virtual FX_BOOL DrawRectangle(IFDE_Pen* pPen, | |
| 89 FX_FLOAT fPenWidth, | |
| 90 const CFX_RectF& rect, | |
| 91 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 92 virtual FX_BOOL FillClosedCurve(IFDE_Brush* pBrush, | |
| 93 const CFX_PointsF& points, | |
| 94 FX_FLOAT fTension = 0.5f, | |
| 95 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 96 virtual FX_BOOL FillEllipse(IFDE_Brush* pBrush, | |
| 97 const CFX_RectF& rect, | |
| 98 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 99 virtual FX_BOOL FillPath(IFDE_Brush* pBrush, | |
| 100 const IFDE_Path* pPath, | |
| 101 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 102 virtual FX_BOOL FillPolygon(IFDE_Brush* pBrush, | |
| 103 const CFX_PointsF& points, | |
| 104 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 105 virtual FX_BOOL FillRectangle(IFDE_Brush* pBrush, | |
| 106 const CFX_RectF& rect, | |
| 107 const CFX_Matrix* pMatrix = NULL) = 0; | |
| 108 }; | |
| 109 | |
| 110 #endif // XFA_SRC_FDE_FDE_RENDERDEVICE_H_ | |
| OLD | NEW |