1 // Copyright 2017 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 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/dib/fx_dib.h" 12 #include "xfa/fgas/graphics/cfgas_gepath.h" 13 #include "xfa/fxfa/parser/cxfa_node.h" 14 15 class CFGAS_GEGraphics; 16 17 class CXFA_Fill final : public CXFA_Node { 18 public: 19 CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; 20 ~CXFA_Fill() override; 21 22 bool IsVisible(); 23 24 FX_ARGB GetFillColor() const; 25 FX_ARGB GetTextColor() const; 26 void SetColor(FX_ARGB color); 27 28 void Draw(CFGAS_GEGraphics* pGS, 29 const CFGAS_GEPath& fillPath, 30 const CFX_RectF& rtWidget, 31 const CFX_Matrix& matrix); 32 33 private: 34 CXFA_Fill(CXFA_Document* doc, XFA_PacketType packet); 35 36 XFA_Element GetType() const; 37 38 void DrawStipple(CFGAS_GEGraphics* pGS, 39 const CFGAS_GEPath& fillPath, 40 const CFX_RectF& rtWidget, 41 const CFX_Matrix& matrix); 42 void DrawRadial(CFGAS_GEGraphics* pGS, 43 const CFGAS_GEPath& fillPath, 44 const CFX_RectF& rtWidget, 45 const CFX_Matrix& matrix); 46 void DrawLinear(CFGAS_GEGraphics* pGS, 47 const CFGAS_GEPath& fillPath, 48 const CFX_RectF& rtWidget, 49 const CFX_Matrix& matrix); 50 void DrawPattern(CFGAS_GEGraphics* pGS, 51 const CFGAS_GEPath& fillPath, 52 const CFX_RectF& rtWidget, 53 const CFX_Matrix& matrix); 54 }; 55 56 #endif // XFA_FXFA_PARSER_CXFA_FILL_H_ 57