LibreOffice Module cppcanvas (master) 1
mtftools.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
22#include <action.hxx>
23#include <cppcanvas/canvas.hxx>
24
25
26class VirtualDevice;
27class Size;
28
29namespace basegfx
30{
31 class B2DVector;
32 class B2DPoint;
33}
35{
36 struct RenderState;
37}
38
39
40namespace cppcanvas
41{
42 namespace internal
43 {
44 struct OutDevState;
45 }
46
47 namespace tools
48 {
55 void initRenderState( css::rendering::RenderState& renderState,
56 const ::cppcanvas::internal::OutDevState& outdevState );
57
72 ::Size getBaselineOffset( const ::cppcanvas::internal::OutDevState& outdevState,
73 const VirtualDevice& rVDev );
74
90 const VirtualDevice& rVDev );
91
105 const VirtualDevice& rVDev );
106
132 bool modifyClip( css::rendering::RenderState& o_rRenderState,
133 const struct ::cppcanvas::internal::OutDevState& rOutdevState,
134 const CanvasSharedPtr& rCanvas,
135 const ::basegfx::B2DPoint& rOffset,
136 const ::basegfx::B2DVector* pScaling,
137 const double* pRotation );
138
140 {
141 TextLineInfo( const double& rLineHeight,
142 const double& rOverlineHeight,
143 const double& rOverlineOffset,
144 const double& rUnderlineOffset,
145 const double& rStrikeoutOffset,
146 sal_Int8 nOverlineStyle,
147 sal_Int8 nUnderlineStyle,
148 sal_Int8 nStrikeoutStyle ) :
149 mnLineHeight( rLineHeight ),
150 mnOverlineHeight( rOverlineHeight ),
151 mnOverlineOffset( rOverlineOffset ),
152 mnUnderlineOffset( rUnderlineOffset ),
153 mnStrikeoutOffset( rStrikeoutOffset ),
154 mnOverlineStyle( nOverlineStyle ),
155 mnUnderlineStyle( nUnderlineStyle ),
156 mnStrikeoutStyle( nStrikeoutStyle )
157 {
158 }
159
168 };
169
172 ::basegfx::B2DRange calcDevicePixelBounds( const ::basegfx::B2DRange& rBounds,
173 const css::rendering::ViewState& viewState,
174 const css::rendering::RenderState& renderState );
175
179 TextLineInfo createTextLineInfo( const ::VirtualDevice& rVDev,
180 const ::cppcanvas::internal::OutDevState& rState );
181
194 ::basegfx::B2DPolyPolygon createTextLinesPolyPolygon( const double& rStartOffset,
195 const double& rLineWidth,
196 const TextLineInfo& rTextLineInfo );
197
198 ::basegfx::B2DPolyPolygon createTextLinesPolyPolygon( const ::basegfx::B2DPoint& rStartPos,
199 const double& rLineWidth,
200 const TextLineInfo& rTextLineInfo );
201
202 void createTextLinesPolyPolygon( const double& rStartOffset,
203 const double& rLineWidth,
204 const TextLineInfo& rTextLineInfo,
205 ::basegfx::B2DPolyPolygon& rOverlinePolyPoly,
206 ::basegfx::B2DPolyPolygon& rUnderlinePolyPoly,
207 ::basegfx::B2DPolyPolygon& rStrikeoutPolyPoly );
208
209 }
210}
211
212/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool modifyClip(rendering::RenderState &o_rRenderState, const struct ::cppcanvas::internal::OutDevState &rOutdevState, const CanvasSharedPtr &rCanvas, const ::basegfx::B2DPoint &rOffset, const ::basegfx::B2DVector *pScaling, const double *pRotation)
Definition: mtftools.cxx:112
void initRenderState(rendering::RenderState &renderState, const ::cppcanvas::internal::OutDevState &outdevState)
Definition: mtftools.cxx:42
::basegfx::B2DHomMatrix & calcLogic2PixelAffineTransform(::basegfx::B2DHomMatrix &o_rMatrix, const VirtualDevice &rVDev)
Construct a matrix that converts from logical to pixel coordinate system.
Definition: mtftools.cxx:95
::basegfx::B2DPolyPolygon createTextLinesPolyPolygon(const ::basegfx::B2DPoint &rStartPos, const double &rLineWidth, const TextLineInfo &rTextLineInfo)
Definition: mtftools.cxx:615
TextLineInfo createTextLineInfo(const ::VirtualDevice &rVDev, const ::cppcanvas::internal::OutDevState &rState)
Generate text underline/strikeout info struct from OutDev state.
Definition: mtftools.cxx:218
::basegfx::B2DHomMatrix & calcLogic2PixelLinearTransform(::basegfx::B2DHomMatrix &o_rMatrix, const VirtualDevice &rVDev)
Construct a matrix that converts from logical to pixel coordinate system.
Definition: mtftools.cxx:77
::Size getBaselineOffset(const ::cppcanvas::internal::OutDevState &outdevState, const VirtualDevice &rVDev)
Calc output offset relative to baseline.
Definition: mtftools.cxx:51
::basegfx::B2DRange calcDevicePixelBounds(const ::basegfx::B2DRange &rBounds, const rendering::ViewState &viewState, const rendering::RenderState &renderState)
Definition: mtftools.cxx:628
std::shared_ptr< Canvas > CanvasSharedPtr
TextLineInfo(const double &rLineHeight, const double &rOverlineHeight, const double &rOverlineOffset, const double &rUnderlineOffset, const double &rStrikeoutOffset, sal_Int8 nOverlineStyle, sal_Int8 nUnderlineStyle, sal_Int8 nStrikeoutStyle)
Definition: mtftools.hxx:141
signed char sal_Int8