Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fdp / src / fde / fde_gedevice.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _FDE_FXGEDEVICE_IMP\r
8 #define _FDE_FXGEDEVICE_IMP\r
9 #ifndef _FDEPLUS\r
10 class CFDE_FxgeDevice : public IFDE_RenderDevice, public CFX_Target\r
11 {\r
12 public:\r
13     CFDE_FxgeDevice(CFX_RenderDevice *pDevice, FX_BOOL bOwnerDevice);\r
14     ~CFDE_FxgeDevice();\r
15     virtual void                                Release()\r
16     {\r
17         FDE_Delete this;\r
18     }\r
19 \r
20     virtual FX_INT32                    GetWidth() const;\r
21     virtual FX_INT32                    GetHeight() const;\r
22     virtual FDE_HDEVICESTATE    SaveState();\r
23     virtual void                                RestoreState(FDE_HDEVICESTATE hState);\r
24     virtual FX_BOOL                             SetClipPath(const IFDE_Path *pClip);\r
25     virtual IFDE_Path*                  GetClipPath() const;\r
26     virtual FX_BOOL                             SetClipRect(const CFX_RectF &rtClip);\r
27     virtual const CFX_RectF&    GetClipRect();\r
28 \r
29     virtual FX_FLOAT                    GetDpiX() const;\r
30     virtual FX_FLOAT                    GetDpiY() const;\r
31 \r
32     virtual FX_BOOL                             DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL);\r
33     virtual FX_BOOL                             DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL);\r
34     virtual FX_BOOL                             DrawBezier(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointF &pt1, const CFX_PointF &pt2, const CFX_PointF &pt3, const CFX_PointF &pt4, const CFX_Matrix *pMatrix = NULL);\r
35     virtual FX_BOOL                             DrawCurve(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL);\r
36     virtual FX_BOOL                             DrawEllipse(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL);\r
37     virtual FX_BOOL                             DrawLines(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, const CFX_Matrix *pMatrix = NULL);\r
38     virtual FX_BOOL                             DrawLine(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointF &pt1, const CFX_PointF &pt2, const CFX_Matrix *pMatrix = NULL);\r
39     virtual FX_BOOL                             DrawPath(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const IFDE_Path *pPath, const CFX_Matrix *pMatrix = NULL);\r
40     virtual FX_BOOL                             DrawPolygon(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, const CFX_Matrix *pMatrix = NULL);\r
41     virtual FX_BOOL                             DrawRectangle(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL);\r
42     virtual FX_BOOL                             FillClosedCurve(IFDE_Brush *pBrush, const CFX_PointsF &points, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL);\r
43     virtual FX_BOOL                             FillEllipse(IFDE_Brush* pBrush, const CFX_RectF& rect, const CFX_Matrix *pMatrix = NULL);\r
44     virtual FX_BOOL                             FillPath(IFDE_Brush *pBrush, const IFDE_Path *pPath, const CFX_Matrix *pMatrix = NULL);\r
45     virtual FX_BOOL                             FillPolygon(IFDE_Brush *pBrush, const CFX_PointsF &points, const CFX_Matrix *pMatrix = NULL);\r
46     virtual FX_BOOL                             FillRectangle(IFDE_Brush *pBrush, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL);\r
47     FX_BOOL                                             FillSolidPath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);\r
48     FX_BOOL                                             FillHatchPath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);\r
49     FX_BOOL                                             FillTexturePath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);\r
50     FX_BOOL                                             FillLinearGradientPath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);\r
51     FX_BOOL                                             DrawSolidString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix);\r
52     FX_BOOL                                             DrawStringPath(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix);\r
53 protected:\r
54     FX_BOOL                                             CreatePen(IFDE_Pen *pPen, FX_FLOAT fPenWidth, CFX_GraphStateData &graphState);\r
55     FX_BOOL                                             WrapTexture(FX_INT32 iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix);\r
56     CFX_RenderDevice                    *m_pDevice;\r
57     CFX_RectF                                   m_rtClip;\r
58     FX_BOOL                                             m_bOwnerDevice;\r
59     FXTEXT_CHARPOS                              *m_pCharPos;\r
60     FX_INT32                                    m_iCharCount;\r
61 };\r
62 #endif\r
63 #endif\r