• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 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_FXFA_PARSER_CXFA_FILL_H_
8 #define XFA_FXFA_PARSER_CXFA_FILL_H_
9 
10 #include "core/fxcrt/fx_coordinates.h"
11 #include "core/fxge/fx_dib.h"
12 #include "xfa/fxfa/parser/cxfa_node.h"
13 #include "xfa/fxgraphics/cxfa_gepath.h"
14 
15 class CXFA_Graphics;
16 class CXFA_Linear;
17 class CXFA_Pattern;
18 class CXFA_Radial;
19 class CXFA_Stipple;
20 
21 class CXFA_Fill final : public CXFA_Node {
22  public:
23   CXFA_Fill(CXFA_Document* doc, XFA_PacketType packet);
24   ~CXFA_Fill() override;
25 
26   bool IsVisible();
27 
28   FX_ARGB GetColor(bool bText);
29   void SetColor(FX_ARGB color);
30 
31   void Draw(CXFA_Graphics* pGS,
32             CXFA_GEPath* fillPath,
33             const CFX_RectF& rtWidget,
34             const CFX_Matrix& matrix);
35 
36  private:
37   XFA_Element GetType() const;
38 
39   void DrawStipple(CXFA_Graphics* pGS,
40                    CXFA_GEPath* fillPath,
41                    const CFX_RectF& rtWidget,
42                    const CFX_Matrix& matrix);
43   void DrawRadial(CXFA_Graphics* pGS,
44                   CXFA_GEPath* fillPath,
45                   const CFX_RectF& rtWidget,
46                   const CFX_Matrix& matrix);
47   void DrawLinear(CXFA_Graphics* pGS,
48                   CXFA_GEPath* fillPath,
49                   const CFX_RectF& rtWidget,
50                   const CFX_Matrix& matrix);
51   void DrawPattern(CXFA_Graphics* pGS,
52                    CXFA_GEPath* fillPath,
53                    const CFX_RectF& rtWidget,
54                    const CFX_Matrix& matrix);
55 };
56 
57 #endif  // XFA_FXFA_PARSER_CXFA_FILL_H_
58