| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_SRC_FDP_INCLUDE_FDE_BRS_H_ | 7 #ifndef XFA_SRC_FDP_INCLUDE_FDE_BRS_H_ |
| 8 #define XFA_SRC_FDP_INCLUDE_FDE_BRS_H_ | 8 #define XFA_SRC_FDP_INCLUDE_FDE_BRS_H_ |
| 9 | 9 |
| 10 #include "core/include/fxcrt/fx_system.h" |
| 11 #include "core/include/fxge/fx_dib.h" |
| 12 |
| 10 class IFDE_Image; | 13 class IFDE_Image; |
| 11 class IFDE_Path; | 14 class IFDE_Path; |
| 12 class IFDE_Brush; | 15 |
| 13 class IFDE_SolidBrush; | |
| 14 class IFDE_HatchBrush; | |
| 15 class IFDE_TextureBrush; | |
| 16 class IFDE_LinearGradientBrush; | |
| 17 #define FDE_BRUSHTYPE_Unknown -1 | 16 #define FDE_BRUSHTYPE_Unknown -1 |
| 18 #define FDE_BRUSHTYPE_Solid 0 | 17 #define FDE_BRUSHTYPE_Solid 0 |
| 19 #define FDE_BRUSHTYPE_Hatch 1 | 18 #define FDE_BRUSHTYPE_Hatch 1 |
| 20 #define FDE_BRUSHTYPE_Texture 2 | 19 #define FDE_BRUSHTYPE_Texture 2 |
| 21 #define FDE_BRUSHTYPE_LinearGradient 3 | 20 #define FDE_BRUSHTYPE_LinearGradient 3 |
| 22 #define FDE_BRUSHTYPE_MAX 3 | 21 #define FDE_BRUSHTYPE_MAX 3 |
| 23 #define FDE_WRAPMODE_Tile 0 | 22 #define FDE_WRAPMODE_Tile 0 |
| 24 #define FDE_WRAPMODE_TileFlipX 1 | 23 #define FDE_WRAPMODE_TileFlipX 1 |
| 25 #define FDE_WRAPMODE_TileFlipY 2 | 24 #define FDE_WRAPMODE_TileFlipY 2 |
| 26 #define FDE_WRAPMODE_TileFlipXY 3 | 25 #define FDE_WRAPMODE_TileFlipXY 3 |
| 27 #define FDE_WRAPMODE_Clamp 4 | 26 #define FDE_WRAPMODE_Clamp 4 |
| 27 |
| 28 struct FDE_GRADIENTCOLOR { | 28 struct FDE_GRADIENTCOLOR { |
| 29 FX_FLOAT pos; | 29 FX_FLOAT pos; |
| 30 FX_ARGB color; | 30 FX_ARGB color; |
| 31 }; | 31 }; |
| 32 typedef CFX_ArrayTemplate<FDE_GRADIENTCOLOR> CFDE_GradientColors; | 32 typedef CFX_ArrayTemplate<FDE_GRADIENTCOLOR> CFDE_GradientColors; |
| 33 |
| 33 class IFDE_Brush { | 34 class IFDE_Brush { |
| 34 public: | 35 public: |
| 35 static IFDE_Brush* Create(int32_t iType); | 36 static IFDE_Brush* Create(int32_t iType); |
| 36 virtual ~IFDE_Brush() {} | 37 virtual ~IFDE_Brush() {} |
| 37 virtual void Release() = 0; | 38 virtual void Release() = 0; |
| 38 virtual int32_t GetType() const = 0; | 39 virtual int32_t GetType() const = 0; |
| 39 }; | 40 }; |
| 41 |
| 40 class IFDE_SolidBrush : public IFDE_Brush { | 42 class IFDE_SolidBrush : public IFDE_Brush { |
| 41 public: | 43 public: |
| 42 virtual FX_ARGB GetColor() const = 0; | 44 virtual FX_ARGB GetColor() const = 0; |
| 43 virtual void SetColor(FX_ARGB color) = 0; | 45 virtual void SetColor(FX_ARGB color) = 0; |
| 44 virtual const CFX_Matrix& GetMatrix() const = 0; | 46 virtual const CFX_Matrix& GetMatrix() const = 0; |
| 45 virtual void ResetMatrix() = 0; | 47 virtual void ResetMatrix() = 0; |
| 46 virtual void TranslateMatrix(FX_FLOAT dx, FX_FLOAT dy) = 0; | 48 virtual void TranslateMatrix(FX_FLOAT dx, FX_FLOAT dy) = 0; |
| 47 virtual void RotateMatrix(FX_FLOAT fRadian) = 0; | 49 virtual void RotateMatrix(FX_FLOAT fRadian) = 0; |
| 48 virtual void ScaleMatrix(FX_FLOAT sx, FX_FLOAT sy) = 0; | 50 virtual void ScaleMatrix(FX_FLOAT sx, FX_FLOAT sy) = 0; |
| 49 virtual void ConcatMatrix(const CFX_Matrix& matrix) = 0; | 51 virtual void ConcatMatrix(const CFX_Matrix& matrix) = 0; |
| 50 virtual void SetMatrix(const CFX_Matrix& matrix) = 0; | 52 virtual void SetMatrix(const CFX_Matrix& matrix) = 0; |
| 51 }; | 53 }; |
| 54 |
| 52 #define FDE_HATCHSTYLE_Horizontal 0 | 55 #define FDE_HATCHSTYLE_Horizontal 0 |
| 53 #define FDE_HATCHSTYLE_Vertical 1 | 56 #define FDE_HATCHSTYLE_Vertical 1 |
| 54 #define FDE_HATCHSTYLE_ForwardDiagonal 2 | 57 #define FDE_HATCHSTYLE_ForwardDiagonal 2 |
| 55 #define FDE_HATCHSTYLE_BackwardDiagonal 3 | 58 #define FDE_HATCHSTYLE_BackwardDiagonal 3 |
| 56 #define FDE_HATCHSTYLE_Cross 4 | 59 #define FDE_HATCHSTYLE_Cross 4 |
| 57 #define FDE_HATCHSTYLE_DiagonalCross 5 | 60 #define FDE_HATCHSTYLE_DiagonalCross 5 |
| 58 #define FDE_HATCHSTYLE_05Percent 6 | 61 #define FDE_HATCHSTYLE_05Percent 6 |
| 59 #define FDE_HATCHSTYLE_10Percent 7 | 62 #define FDE_HATCHSTYLE_10Percent 7 |
| 60 #define FDE_HATCHSTYLE_20Percent 8 | 63 #define FDE_HATCHSTYLE_20Percent 8 |
| 61 #define FDE_HATCHSTYLE_25Percent 9 | 64 #define FDE_HATCHSTYLE_25Percent 9 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 #define FDE_HATCHSTYLE_Sphere 47 | 102 #define FDE_HATCHSTYLE_Sphere 47 |
| 100 #define FDE_HATCHSTYLE_SmallGrid 48 | 103 #define FDE_HATCHSTYLE_SmallGrid 48 |
| 101 #define FDE_HATCHSTYLE_SmallCheckerBoard 49 | 104 #define FDE_HATCHSTYLE_SmallCheckerBoard 49 |
| 102 #define FDE_HATCHSTYLE_LargeCheckerBoard 50 | 105 #define FDE_HATCHSTYLE_LargeCheckerBoard 50 |
| 103 #define FDE_HATCHSTYLE_OutlinedDiamond 51 | 106 #define FDE_HATCHSTYLE_OutlinedDiamond 51 |
| 104 #define FDE_HATCHSTYLE_SolidDiamond 52 | 107 #define FDE_HATCHSTYLE_SolidDiamond 52 |
| 105 #define FDE_HATCHSTYLE_Total 53 | 108 #define FDE_HATCHSTYLE_Total 53 |
| 106 #define FDE_HATCHSTYLE_LargeGrid FDE_HATCHSTYLE_Cross | 109 #define FDE_HATCHSTYLE_LargeGrid FDE_HATCHSTYLE_Cross |
| 107 #define FDE_HATCHSTYLE_Min FDE_HATCHSTYLE_Horizontal | 110 #define FDE_HATCHSTYLE_Min FDE_HATCHSTYLE_Horizontal |
| 108 #define FDE_HATCHSTYLE_Max (FDE_HATCHSTYLE_Total - 1) | 111 #define FDE_HATCHSTYLE_Max (FDE_HATCHSTYLE_Total - 1) |
| 112 |
| 109 class IFDE_HatchBrush : public IFDE_Brush { | 113 class IFDE_HatchBrush : public IFDE_Brush { |
| 110 public: | 114 public: |
| 111 virtual FX_ARGB GetColor(FX_BOOL bForegroundColor) const = 0; | 115 virtual FX_ARGB GetColor(FX_BOOL bForegroundColor) const = 0; |
| 112 virtual void SetColor(FX_ARGB color, FX_BOOL bForegroundColor) = 0; | 116 virtual void SetColor(FX_ARGB color, FX_BOOL bForegroundColor) = 0; |
| 113 virtual int32_t GetHatchStyle() const = 0; | 117 virtual int32_t GetHatchStyle() const = 0; |
| 114 virtual FX_BOOL SetHatchStyle(int32_t iHatchStyle) = 0; | 118 virtual FX_BOOL SetHatchStyle(int32_t iHatchStyle) = 0; |
| 115 }; | 119 }; |
| 120 |
| 116 class IFDE_TextureBrush : public IFDE_Brush { | 121 class IFDE_TextureBrush : public IFDE_Brush { |
| 117 public: | 122 public: |
| 118 virtual IFDE_Image* GetImage() const = 0; | 123 virtual IFDE_Image* GetImage() const = 0; |
| 119 virtual void SetImage(IFDE_Image* pImage, FX_BOOL bAutoRelease) = 0; | 124 virtual void SetImage(IFDE_Image* pImage, FX_BOOL bAutoRelease) = 0; |
| 120 virtual int32_t GetWrapMode() const = 0; | 125 virtual int32_t GetWrapMode() const = 0; |
| 121 virtual void SetWrapMode(int32_t iWrapMode) = 0; | 126 virtual void SetWrapMode(int32_t iWrapMode) = 0; |
| 122 }; | 127 }; |
| 128 |
| 123 #define FDE_LINEARGRADIENTMODE_Horizontal 0 | 129 #define FDE_LINEARGRADIENTMODE_Horizontal 0 |
| 124 #define FDE_LINEARGRADIENTMODE_Vertical 1 | 130 #define FDE_LINEARGRADIENTMODE_Vertical 1 |
| 125 #define FDE_LINEARGRADIENTMODE_ForwardDiagonal 2 | 131 #define FDE_LINEARGRADIENTMODE_ForwardDiagonal 2 |
| 126 #define FDE_LINEARGRADIENTMODE_BackwardDiagonal 3 | 132 #define FDE_LINEARGRADIENTMODE_BackwardDiagonal 3 |
| 133 |
| 127 class IFDE_LinearGradientBrush : public IFDE_Brush { | 134 class IFDE_LinearGradientBrush : public IFDE_Brush { |
| 128 public: | 135 public: |
| 129 virtual void GetLinearPoints(CFX_PointF& startingPoint, | 136 virtual void GetLinearPoints(CFX_PointF& startingPoint, |
| 130 CFX_PointF& endingPoint) const = 0; | 137 CFX_PointF& endingPoint) const = 0; |
| 131 virtual void SetLinearPoints(const CFX_PointF& startingPoint, | 138 virtual void SetLinearPoints(const CFX_PointF& startingPoint, |
| 132 const CFX_PointF& endingPoint) = 0; | 139 const CFX_PointF& endingPoint) = 0; |
| 133 virtual void GetLinearColors(FX_ARGB& startingColor, | 140 virtual void GetLinearColors(FX_ARGB& startingColor, |
| 134 FX_ARGB& endingColor) const = 0; | 141 FX_ARGB& endingColor) const = 0; |
| 135 virtual void SetLinearColors(const FX_ARGB& startingColor, | 142 virtual void SetLinearColors(const FX_ARGB& startingColor, |
| 136 const FX_ARGB& endingColor) = 0; | 143 const FX_ARGB& endingColor) = 0; |
| 137 virtual int32_t CountGradientColors() const = 0; | 144 virtual int32_t CountGradientColors() const = 0; |
| 138 virtual FX_BOOL GetGradientColors(CFDE_GradientColors& colors) const = 0; | 145 virtual FX_BOOL GetGradientColors(CFDE_GradientColors& colors) const = 0; |
| 139 virtual FX_BOOL SetGradientColors(const CFDE_GradientColors& colors) = 0; | 146 virtual FX_BOOL SetGradientColors(const CFDE_GradientColors& colors) = 0; |
| 140 virtual int32_t GetWrapMode() const = 0; | 147 virtual int32_t GetWrapMode() const = 0; |
| 141 virtual void SetWrapMode(int32_t iWrapMode) = 0; | 148 virtual void SetWrapMode(int32_t iWrapMode) = 0; |
| 142 }; | 149 }; |
| 143 | 150 |
| 144 #endif // XFA_SRC_FDP_INCLUDE_FDE_BRS_H_ | 151 #endif // XFA_SRC_FDP_INCLUDE_FDE_BRS_H_ |
| OLD | NEW |