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
17 #include <basegfx/color/bcolor.hxx>
18 #include <basegfx/polygon/b2dpolypolygon.hxx>
19 #include <basegfx/range/b2drange.hxx>
20 #include <basegfx/matrix/b2dhommatrix.hxx>
29 std::vector
<std::shared_ptr
<DrawBase
>> maChildren
;
32 enum class DrawCommandType
39 enum class GradientType
47 basegfx::BColor maColor
;
57 std::vector
<GradientStop
> maGradientStops
;
59 GradientInfo(GradientType eType
)
65 class LinearGradientInfo
: public GradientInfo
69 : GradientInfo(GradientType::Linear
)
82 basegfx::B2DHomMatrix maMatrix
;
85 class DrawBase
: public DrawCommand
88 DrawCommandType meType
;
91 DrawBase(DrawCommandType eType
)
96 DrawCommandType
getType() const { return meType
; }
99 class DrawRoot
: public DrawBase
102 basegfx::B2DRange maRectangle
;
105 : DrawBase(DrawCommandType::Root
)
110 class DrawRectangle
: public DrawBase
113 basegfx::B2DRange maRectangle
;
117 double mnStrokeWidth
;
119 std::shared_ptr
<basegfx::BColor
> mpFillColor
;
120 std::shared_ptr
<basegfx::BColor
> mpStrokeColor
;
121 std::shared_ptr
<GradientInfo
> mpFillGradient
;
123 DrawRectangle(basegfx::B2DRange
const& rRectangle
)
124 : DrawBase(DrawCommandType::Rectangle
)
125 , maRectangle(rRectangle
)
134 class DrawPath
: public DrawBase
137 basegfx::B2DPolyPolygon maPolyPolygon
;
139 double mnStrokeWidth
;
141 std::shared_ptr
<basegfx::BColor
> mpFillColor
;
142 std::shared_ptr
<basegfx::BColor
> mpStrokeColor
;
143 std::shared_ptr
<GradientInfo
> mpFillGradient
;
145 DrawPath(basegfx::B2DPolyPolygon aPolyPolygon
)
146 : DrawBase(DrawCommandType::Path
)
147 , maPolyPolygon(std::move(aPolyPolygon
))
154 } // end namespace gfx
156 #endif // INCLUDED_BASEGFX_DRAWCOMMANDS_H
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */