LibreOffice Module drawinglayer (master) 1
emfppen.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 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23#include "emfpbrush.hxx"
24#include <vector>
25
26namespace emfplushelper
27{
28 const sal_uInt32 EmfPlusLineCapTypeSquare = 0x00000001;
29 const sal_uInt32 EmfPlusLineCapTypeRound = 0x00000002;
30 const sal_uInt32 EmfPlusLineCapTypeTriangle = 0x00000003;
31
32 const sal_uInt32 EmfPlusLineJoinTypeMiter = 0x00000000;
33 const sal_uInt32 EmfPlusLineJoinTypeBevel = 0x00000001;
34 const sal_uInt32 EmfPlusLineJoinTypeRound = 0x00000002;
35 const sal_uInt32 EmfPlusLineJoinTypeMiterClipped = 0x00000003;
36
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;
43
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;
57
59 {
60 LineCapTypeFlat = 0x00000000,
61 LineCapTypeSquare = 0x00000001,
62 LineCapTypeRound = 0x00000002,
63 LineCapTypeTriangle = 0x00000003,
64 LineCapTypeNoAnchor = 0x00000010,
70 LineCapTypeCustom = 0x000000FF
71 };
72
74 {
75 LineJoinTypeMiter = 0x00000000,
76 LineJoinTypeBevel = 0x00000001,
77 LineJoinTypeRound = 0x00000002,
78 LineJoinTypeMiterClipped = 0x00000003
79 };
80
82 {
85 DashedLineCapTypeTriangle = 0x00000003
86 };
87
89 {
90 PenAlignmentCenter = 0x00000000,
91 PenAlignmentInset = 0x00000001,
92 PenAlignmentLeft = 0x00000002,
93 PenAlignmentOutset = 0x00000003,
94 PenAlignmentRight = 0x00000004
95 };
96
97 struct EMFPCustomLineCap;
98
99 struct EMFPPen : public EMFPBrush
100 {
102 sal_uInt32 penDataFlags;
103 sal_uInt32 penUnit;
104 float penWidth;
105 sal_Int32 startCap;
106 sal_Int32 endCap;
109 sal_Int32 dashStyle;
110 sal_Int32 dashCap;
112 std::vector<float> dashPattern;
113 sal_Int32 alignment;
114 std::vector<float> compoundArray;
116 std::unique_ptr<EMFPCustomLineCap> customStartCap;
117 sal_uInt32 customEndCapLen;
118 std::unique_ptr<EMFPCustomLineCap> customEndCap;
119
120 EMFPPen();
121
122 virtual ~EMFPPen() override;
123
124 void Read(SvStream& s, EmfPlusHelperData const & rR);
125
126 drawinglayer::attribute::StrokeAttribute GetStrokeAttribute(const double aTransformation) const;
127 };
128}
129
130/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_Int32 EmfPlusLineStyleCustom
Definition: emfppen.hxx:42
@ LineJoinTypeBevel
Definition: emfppen.hxx:76
@ LineJoinTypeMiter
Definition: emfppen.hxx:75
@ LineJoinTypeMiterClipped
Definition: emfppen.hxx:78
@ LineJoinTypeRound
Definition: emfppen.hxx:77
const sal_uInt32 EmfPlusPenDataCompoundLine
Definition: emfppen.hxx:54
@ DashedLineCapTypeRound
Definition: emfppen.hxx:84
@ DashedLineCapTypeTriangle
Definition: emfppen.hxx:85
@ DashedLineCapTypeFlat
Definition: emfppen.hxx:83
const sal_uInt32 EmfPlusPenDataCustomStartCap
Definition: emfppen.hxx:55
const sal_uInt32 EmfPlusPenDataDashedLineOffset
Definition: emfppen.hxx:51
const sal_uInt32 EmfPlusPenDataTransform
Definition: emfppen.hxx:44
const sal_uInt32 EmfPlusPenDataDashedLine
Definition: emfppen.hxx:52
const sal_uInt32 EmfPlusLineJoinTypeRound
Definition: emfppen.hxx:34
const sal_Int32 EmfPlusLineStyleDash
Definition: emfppen.hxx:38
const sal_uInt32 EmfPlusPenDataEndCap
Definition: emfppen.hxx:46
const sal_uInt32 EmfPlusLineCapTypeTriangle
Definition: emfppen.hxx:30
const sal_uInt32 EmfPlusLineJoinTypeMiter
Definition: emfppen.hxx:32
const sal_uInt32 EmfPlusLineJoinTypeBevel
Definition: emfppen.hxx:33
const sal_uInt32 EmfPlusPenDataDashedLineCap
Definition: emfppen.hxx:50
@ LineCapTypeRound
Definition: emfppen.hxx:62
@ LineCapTypeSquareAnchor
Definition: emfppen.hxx:65
@ LineCapTypeSquare
Definition: emfppen.hxx:61
@ LineCapTypeTriangle
Definition: emfppen.hxx:63
@ LineCapTypeCustom
Definition: emfppen.hxx:70
@ LineCapTypeAnchorMask
Definition: emfppen.hxx:69
@ LineCapTypeDiamondAnchor
Definition: emfppen.hxx:67
@ LineCapTypeArrowAnchor
Definition: emfppen.hxx:68
@ LineCapTypeNoAnchor
Definition: emfppen.hxx:64
@ LineCapTypeRoundAnchor
Definition: emfppen.hxx:66
const sal_uInt32 EmfPlusPenDataStartCap
Definition: emfppen.hxx:45
const sal_uInt32 EmfPlusLineJoinTypeMiterClipped
Definition: emfppen.hxx:35
const sal_uInt32 EmfPlusLineCapTypeRound
Definition: emfppen.hxx:29
const sal_Int32 EmfPlusLineStyleDot
Definition: emfppen.hxx:39
const sal_uInt32 EmfPlusLineCapTypeSquare
Definition: emfppen.hxx:28
const sal_uInt32 EmfPlusPenDataMiterLimit
Definition: emfppen.hxx:48
const sal_uInt32 EmfPlusPenDataJoin
Definition: emfppen.hxx:47
const sal_Int32 EmfPlusLineStyleDashDot
Definition: emfppen.hxx:40
const sal_uInt32 EmfPlusPenDataLineStyle
Definition: emfppen.hxx:49
const sal_Int32 EmfPlusLineStyleSolid
Definition: emfppen.hxx:37
const sal_uInt32 EmfPlusPenDataAlignment
Definition: emfppen.hxx:53
const sal_uInt32 EmfPlusPenDataCustomEndCap
Definition: emfppen.hxx:56
const sal_Int32 EmfPlusLineStyleDashDotDot
Definition: emfppen.hxx:41
@ PenAlignmentRight
Definition: emfppen.hxx:94
@ PenAlignmentLeft
Definition: emfppen.hxx:92
@ PenAlignmentInset
Definition: emfppen.hxx:91
@ PenAlignmentCenter
Definition: emfppen.hxx:90
@ PenAlignmentOutset
Definition: emfppen.hxx:93
virtual ~EMFPPen() override
Definition: emfppen.cxx:51
sal_uInt32 customStartCapLen
Definition: emfppen.hxx:115
sal_uInt32 customEndCapLen
Definition: emfppen.hxx:117
basegfx::B2DLineJoin maLineJoin
Definition: emfppen.hxx:107
std::unique_ptr< EMFPCustomLineCap > customEndCap
Definition: emfppen.hxx:118
std::unique_ptr< EMFPCustomLineCap > customStartCap
Definition: emfppen.hxx:116
std::vector< float > compoundArray
Definition: emfppen.hxx:114
void Read(SvStream &s, EmfPlusHelperData const &rR)
Definition: emfppen.cxx:183
sal_uInt32 penDataFlags
Definition: emfppen.hxx:102
std::vector< float > dashPattern
Definition: emfppen.hxx:112
drawinglayer::attribute::StrokeAttribute GetStrokeAttribute(const double aTransformation) const
Definition: emfppen.cxx:145
basegfx::B2DHomMatrix pen_transformation
Definition: emfppen.hxx:101