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 #ifndef INCLUDED_FILTER_SOURCE_SVG_UNITS_HXX
10 #define INCLUDED_FILTER_SOURCE_SVG_UNITS_HXX
12 #include <sal/config.h>
13 #include <rtl/ustring.hxx>
17 // recommended value for this device dependent unit, see CSS2 section 4.3.2 Lengths
19 #define F_SVG_PIXEL_PER_INCH 90.0
32 SVG_LENGTH_UNIT_PERCENTAGE
,
37 /** return svg_length_t in 100th's of mm
38 @param fVal value to convert
39 @param unit unit the value is in
40 @param rState current state (needed for viewport dimensions etc.)
41 @param dir direction - either 'h' or 'v' for horizonal or vertical, resp.
43 double convLength( const OUString
& sVal
, SvgUnit unit
, const State
& rState
, char dir
);
45 /** return svg_length_t in 100th's of mm
46 @param sValue value to convert
47 @param rState current state (needed for viewport dimensions etc.)
48 @param dir direction - either 'h' or 'v' for horizonal or vertical, resp.
50 double convLength( const OUString
& sValue
, const State
& rState
, char dir
);
52 inline double pt2mm(double fVal
) { return fVal
*25.4/72.0; }
53 inline double pt100thmm(double fVal
) { return fVal
*2540.0/72.0; }
59 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */