1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_BASEGFX_DRAWCOMMANDS_H
11 #define INCLUDED_BASEGFX_DRAWCOMMANDS_H
16 #include <basegfx/color/bcolor.hxx>
17 #include <basegfx/polygon/b2dpolypolygon.hxx>
18 #include <basegfx/range/b2drange.hxx>
19 #include <basegfx/matrix/b2dhommatrix.hxx>
28 std::vector
<std::shared_ptr
<DrawBase
>> maChildren
;
31 enum class DrawCommandType
38 enum class GradientType
47 basegfx::BColor maColor
;
56 std::vector
<GradientStop
> maGradientStops
;
58 GradientInfo(GradientType eType
)
64 class LinearGradientInfo
: public GradientInfo
68 : GradientInfo(GradientType::Linear
)
81 basegfx::B2DHomMatrix maMatrix
;
84 class DrawBase
: public DrawCommand
87 DrawCommandType meType
;
90 DrawBase(DrawCommandType eType
)
95 DrawCommandType
getType() const { return meType
; }
98 class DrawRoot
: public DrawBase
101 basegfx::B2DRange maRectangle
;
104 : DrawBase(DrawCommandType::Root
)
109 class DrawRectangle
: public DrawBase
112 basegfx::B2DRange maRectangle
;
116 double mnStrokeWidth
;
118 std::shared_ptr
<basegfx::BColor
> mpFillColor
;
119 std::shared_ptr
<basegfx::BColor
> mpStrokeColor
;
120 std::shared_ptr
<GradientInfo
> mpFillGradient
;
122 DrawRectangle(basegfx::B2DRange
const& rRectangle
)
123 : DrawBase(DrawCommandType::Rectangle
)
124 , maRectangle(rRectangle
)
133 class DrawPath
: public DrawBase
136 basegfx::B2DPolyPolygon maPolyPolygon
;
138 double mnStrokeWidth
;
140 std::shared_ptr
<basegfx::BColor
> mpFillColor
;
141 std::shared_ptr
<basegfx::BColor
> mpStrokeColor
;
142 std::shared_ptr
<GradientInfo
> mpFillGradient
;
144 DrawPath(basegfx::B2DPolyPolygon
const& rPolyPolygon
)
145 : DrawBase(DrawCommandType::Path
)
146 , maPolyPolygon(rPolyPolygon
)
153 } // end namespace gfx
155 #endif // INCLUDED_BASEGFX_DRAWCOMMANDS_H
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */