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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <drawinglayer/attribute/strokeattribute.hxx>
23 #include "emfpbrush.hxx"
26 namespace emfplushelper
28 const sal_uInt32 EmfPlusLineCapTypeSquare
= 0x00000001;
29 const sal_uInt32 EmfPlusLineCapTypeRound
= 0x00000002;
30 const sal_uInt32 EmfPlusLineCapTypeTriangle
= 0x00000003;
32 const sal_uInt32 EmfPlusLineJoinTypeMiter
= 0x00000000;
33 const sal_uInt32 EmfPlusLineJoinTypeBevel
= 0x00000001;
34 const sal_uInt32 EmfPlusLineJoinTypeRound
= 0x00000002;
35 const sal_uInt32 EmfPlusLineJoinTypeMiterClipped
= 0x00000003;
37 const sal_Int32 EmfPlusLineStyleSolid
= 0x00000000;
38 const sal_Int32 EmfPlusLineStyleDash
= 0x00000001;
39 const sal_Int32 EmfPlusLineStyleDot
= 0x00000002;
40 const sal_Int32 EmfPlusLineStyleDashDot
= 0x00000003;
41 const sal_Int32 EmfPlusLineStyleDashDotDot
= 0x00000004;
42 const sal_Int32 EmfPlusLineStyleCustom
= 0x00000005;
44 const sal_uInt32 EmfPlusPenDataTransform
= 0x00000001;
45 const sal_uInt32 EmfPlusPenDataStartCap
= 0x00000002;
46 const sal_uInt32 EmfPlusPenDataEndCap
= 0x00000004;
47 const sal_uInt32 EmfPlusPenDataJoin
= 0x00000008;
48 const sal_uInt32 EmfPlusPenDataMiterLimit
= 0x00000010;
49 const sal_uInt32 EmfPlusPenDataLineStyle
= 0x00000020;
50 const sal_uInt32 EmfPlusPenDataDashedLineCap
= 0x00000040;
51 const sal_uInt32 EmfPlusPenDataDashedLineOffset
= 0x00000080;
52 const sal_uInt32 EmfPlusPenDataDashedLine
= 0x00000100;
53 const sal_uInt32 EmfPlusPenDataAlignment
= 0x00000200;
54 const sal_uInt32 EmfPlusPenDataCompoundLine
= 0x00000400;
55 const sal_uInt32 EmfPlusPenDataCustomStartCap
= 0x00000800;
56 const sal_uInt32 EmfPlusPenDataCustomEndCap
= 0x000001000;
60 LineCapTypeFlat
= 0x00000000,
61 LineCapTypeSquare
= 0x00000001,
62 LineCapTypeRound
= 0x00000002,
63 LineCapTypeTriangle
= 0x00000003,
64 LineCapTypeNoAnchor
= 0x00000010,
65 LineCapTypeSquareAnchor
= 0x00000011,
66 LineCapTypeRoundAnchor
= 0x00000012,
67 LineCapTypeDiamondAnchor
= 0x00000013,
68 LineCapTypeArrowAnchor
= 0x00000014,
69 LineCapTypeAnchorMask
= 0x000000F0,
70 LineCapTypeCustom
= 0x000000FF
75 LineJoinTypeMiter
= 0x00000000,
76 LineJoinTypeBevel
= 0x00000001,
77 LineJoinTypeRound
= 0x00000002,
78 LineJoinTypeMiterClipped
= 0x00000003
81 enum DashedLineCapType
83 DashedLineCapTypeFlat
= 0x00000000,
84 DashedLineCapTypeRound
= 0x00000002,
85 DashedLineCapTypeTriangle
= 0x00000003
90 PenAlignmentCenter
= 0x00000000,
91 PenAlignmentInset
= 0x00000001,
92 PenAlignmentLeft
= 0x00000002,
93 PenAlignmentOutset
= 0x00000003,
94 PenAlignmentRight
= 0x00000004
97 struct EMFPCustomLineCap
;
99 struct EMFPPen
: public EMFPBrush
101 basegfx::B2DHomMatrix pen_transformation
; //TODO: This isn't used
102 sal_uInt32 penDataFlags
;
107 basegfx::B2DLineJoin maLineJoin
;
108 double fMiterMinimumAngle
;
112 std::vector
<float> dashPattern
;
114 std::vector
<float> compoundArray
;
115 sal_uInt32 customStartCapLen
;
116 std::unique_ptr
<EMFPCustomLineCap
> customStartCap
;
117 sal_uInt32 customEndCapLen
;
118 std::unique_ptr
<EMFPCustomLineCap
> customEndCap
;
122 virtual ~EMFPPen() override
;
124 void Read(SvStream
& s
, EmfPlusHelperData
const & rR
);
126 drawinglayer::attribute::StrokeAttribute
GetStrokeAttribute(const double aTransformation
) const;
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */