• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 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 CORE_FXGE_CFX_GRAPHSTATE_H_
8 #define CORE_FXGE_CFX_GRAPHSTATE_H_
9 
10 #include "core/fxcrt/shared_copy_on_write.h"
11 #include "core/fxge/cfx_graphstatedata.h"
12 
13 class CPDF_Array;
14 
15 class CFX_GraphState {
16  public:
17   CFX_GraphState();
18   CFX_GraphState(const CFX_GraphState& that);
19   ~CFX_GraphState();
20 
21   void Emplace();
22 
23   void SetLineDash(CPDF_Array* pArray, float phase, float scale);
24 
25   float GetLineWidth() const;
26   void SetLineWidth(float width);
27 
28   CFX_GraphStateData::LineCap GetLineCap() const;
29   void SetLineCap(CFX_GraphStateData::LineCap cap);
30 
31   CFX_GraphStateData::LineJoin GetLineJoin() const;
32   void SetLineJoin(CFX_GraphStateData::LineJoin join);
33 
34   float GetMiterLimit() const;
35   void SetMiterLimit(float limit);
36 
37   // FIXME(tsepez): remove when all GraphStateData usage gone.
GetObject()38   const CFX_GraphStateData* GetObject() const { return m_Ref.GetObject(); }
39 
40  private:
41   SharedCopyOnWrite<CFX_GraphStateData> m_Ref;
42 };
43 
44 #endif  // CORE_FXGE_CFX_GRAPHSTATE_H_
45