LibreOffice Module basegfx (master) 1
DrawCommands.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 */
9
10#ifndef INCLUDED_BASEGFX_DRAWCOMMANDS_H
11#define INCLUDED_BASEGFX_DRAWCOMMANDS_H
12
13#include <memory>
14#include <utility>
15#include <vector>
16
21
22namespace gfx
23{
24class DrawBase;
25
27{
28public:
29 std::vector<std::shared_ptr<DrawBase>> maChildren;
30};
31
33{
34 Root,
36 Path
37};
38
39enum class GradientType
40{
41 Linear
42};
43
45{
46public:
48 float mfOffset;
49 float mfOpacity;
50};
51
53{
54public:
56
57 std::vector<GradientStop> maGradientStops;
58
60 : meType(eType)
61 {
62 }
63};
64
66{
67public:
70 , x1(0.0)
71 , y1(0.0)
72 , x2(0.0)
73 , y2(0.0)
74 {
75 }
76
77 double x1;
78 double y1;
79 double x2;
80 double y2;
81
83};
84
85class DrawBase : public DrawCommand
86{
87private:
89
90public:
92 : meType(eType)
93 {
94 }
95
96 DrawCommandType getType() const { return meType; }
97};
98
99class DrawRoot : public DrawBase
100{
101public:
103
106 {
107 }
108};
109
111{
112public:
114 double mnRx;
115 double mnRy;
116
118 double mnOpacity;
119 std::shared_ptr<basegfx::BColor> mpFillColor;
120 std::shared_ptr<basegfx::BColor> mpStrokeColor;
121 std::shared_ptr<GradientInfo> mpFillGradient;
122
125 , maRectangle(rRectangle)
126 , mnRx(1.0)
127 , mnRy(1.0)
128 , mnStrokeWidth(1.0)
129 , mnOpacity(1.0)
130 {
131 }
132};
133
134class DrawPath : public DrawBase
135{
136public:
138
140 double mnOpacity;
141 std::shared_ptr<basegfx::BColor> mpFillColor;
142 std::shared_ptr<basegfx::BColor> mpStrokeColor;
143 std::shared_ptr<GradientInfo> mpFillGradient;
144
147 , maPolyPolygon(std::move(aPolyPolygon))
148 , mnStrokeWidth(1.0)
149 , mnOpacity(1.0)
150 {
151 }
152};
153
154} // end namespace gfx
155
156#endif // INCLUDED_BASEGFX_DRAWCOMMANDS_H
157
158/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A two-dimensional interval over doubles.
Definition: b2drange.hxx:54
Base Color class with three double values.
Definition: bcolor.hxx:41
DrawCommandType meType
DrawBase(DrawCommandType eType)
DrawCommandType getType() const
std::vector< std::shared_ptr< DrawBase > > maChildren
basegfx::B2DPolyPolygon maPolyPolygon
DrawPath(basegfx::B2DPolyPolygon aPolyPolygon)
std::shared_ptr< basegfx::BColor > mpStrokeColor
std::shared_ptr< basegfx::BColor > mpFillColor
std::shared_ptr< GradientInfo > mpFillGradient
double mnStrokeWidth
basegfx::B2DRange maRectangle
std::shared_ptr< basegfx::BColor > mpFillColor
std::shared_ptr< basegfx::BColor > mpStrokeColor
DrawRectangle(basegfx::B2DRange const &rRectangle)
std::shared_ptr< GradientInfo > mpFillGradient
basegfx::B2DRange maRectangle
std::vector< GradientStop > maGradientStops
GradientInfo(GradientType eType)
GradientType meType
basegfx::BColor maColor
basegfx::B2DHomMatrix maMatrix
DocumentType eType
GradientType
DrawCommandType