nss: upgrade to release 3.73
[LibreOffice.git] / drawinglayer / source / tools / emfppen.hxx
blob05b2fc376d7df3f6ad82a5b72580186e0b199243
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include "emfpbrush.hxx"
23 #include <vector>
25 namespace emfplushelper
27 const sal_uInt32 EmfPlusLineCapTypeSquare = 0x00000001;
28 const sal_uInt32 EmfPlusLineCapTypeRound = 0x00000002;
30 const sal_uInt32 EmfPlusLineJoinTypeMiter = 0x00000000;
31 const sal_uInt32 EmfPlusLineJoinTypeBevel = 0x00000001;
32 const sal_uInt32 EmfPlusLineJoinTypeRound = 0x00000002;
33 const sal_uInt32 EmfPlusLineJoinTypeMiterClipped = 0x00000003;
35 const sal_Int32 EmfPlusLineStyleSolid = 0x00000000;
36 const sal_Int32 EmfPlusLineStyleDash = 0x00000001;
37 const sal_Int32 EmfPlusLineStyleDot = 0x00000002;
38 const sal_Int32 EmfPlusLineStyleDashDot = 0x00000003;
39 const sal_Int32 EmfPlusLineStyleDashDotDot = 0x00000004;
40 const sal_Int32 EmfPlusLineStyleCustom = 0x00000005;
42 const sal_uInt32 EmfPlusPenDataTransform = 0x00000001;
43 const sal_uInt32 EmfPlusPenDataStartCap = 0x00000002;
44 const sal_uInt32 EmfPlusPenDataEndCap = 0x00000004;
45 const sal_uInt32 EmfPlusPenDataJoin = 0x00000008;
46 const sal_uInt32 EmfPlusPenDataMiterLimit = 0x00000010;
47 const sal_uInt32 EmfPlusPenDataLineStyle = 0x00000020;
48 const sal_uInt32 EmfPlusPenDataDashedLineCap = 0x00000040;
49 const sal_uInt32 EmfPlusPenDataDashedLineOffset = 0x00000080;
50 const sal_uInt32 EmfPlusPenDataDashedLine = 0x00000100;
51 const sal_uInt32 EmfPlusPenDataAlignment = 0x00000200;
52 const sal_uInt32 EmfPlusPenDataCompoundLine = 0x00000400;
53 const sal_uInt32 EmfPlusPenDataCustomStartCap = 0x00000800;
54 const sal_uInt32 EmfPlusPenDataCustomEndCap = 0x000001000;
56 enum LineCapType
58 LineCapTypeFlat = 0x00000000,
59 LineCapTypeSquare = 0x00000001,
60 LineCapTypeRound = 0x00000002,
61 LineCapTypeTriangle = 0x00000003,
62 LineCapTypeNoAnchor = 0x00000010,
63 LineCapTypeSquareAnchor = 0x00000011,
64 LineCapTypeRoundAnchor = 0x00000012,
65 LineCapTypeDiamondAnchor = 0x00000013,
66 LineCapTypeArrowAnchor = 0x00000014,
67 LineCapTypeAnchorMask = 0x000000F0,
68 LineCapTypeCustom = 0x000000FF
71 enum LineJoinType
73 LineJoinTypeMiter = 0x00000000,
74 LineJoinTypeBevel = 0x00000001,
75 LineJoinTypeRound = 0x00000002,
76 LineJoinTypeMiterClipped = 0x00000003
79 enum DashedLineCapType
81 DashedLineCapTypeFlat = 0x00000000,
82 DashedLineCapTypeRound = 0x00000002,
83 DashedLineCapTypeTriangle = 0x00000003
86 enum PenAlignment
88 PenAlignmentCenter = 0x00000000,
89 PenAlignmentInset = 0x00000001,
90 PenAlignmentLeft = 0x00000002,
91 PenAlignmentOutset = 0x00000003,
92 PenAlignmentRight = 0x00000004
95 struct EMFPCustomLineCap;
97 struct EMFPPen : public EMFPBrush
99 basegfx::B2DHomMatrix pen_transformation; //TODO: This isn't used
100 sal_uInt32 penDataFlags;
101 sal_uInt32 penUnit;
102 float penWidth;
103 sal_Int32 startCap;
104 sal_Int32 endCap;
105 sal_Int32 lineJoin;
106 float miterLimit;
107 sal_Int32 dashStyle;
108 sal_Int32 dashCap;
109 float dashOffset;
110 std::vector<float> dashPattern;
111 sal_Int32 alignment;
112 std::vector<float> compoundArray;
113 sal_Int32 customStartCapLen;
114 std::unique_ptr<EMFPCustomLineCap> customStartCap;
115 sal_Int32 customEndCapLen;
116 std::unique_ptr<EMFPCustomLineCap> customEndCap;
118 EMFPPen();
120 virtual ~EMFPPen() override;
122 void Read(SvStream& s, EmfPlusHelperData const & rR);
124 static sal_Int8 lcl_convertStrokeCap(sal_uInt32 nEmfStroke);
125 static sal_Int8 lcl_convertLineJoinType(sal_uInt32 nEmfLineJoin);
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */