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 <com/sun/star/frame/XModel.hpp>
27 #include "cgmtypes.hxx"
33 class CGMImpressOutAct
;
40 friend class CGMChart
;
41 friend class CGMBitmap
;
42 friend class CGMElements
;
43 friend class CGMImpressOutAct
;
53 bool mbAngReverse
; // AngularDirection
62 bool mbInDefaultReplacement
;
63 sal_uInt32 mnAct4PostReset
;
65 std::unique_ptr
<CGMBitmap
> mpBitmapInUse
;
66 std::unique_ptr
<CGMChart
> mpChart
; // if sal_True->"SHWSLIDEREC"
67 // otherwise "BEGINPIC" commands
68 // controls page inserting
69 std::unique_ptr
<CGMElements
> pElement
;
70 std::unique_ptr
<CGMElements
> pCopyOfE
;
71 std::unique_ptr
<CGMImpressOutAct
> mpOutAct
;
72 ::std::vector
< std::unique_ptr
<sal_uInt8
[]> > maDefRepList
;
73 ::std::vector
< sal_uInt32
> maDefRepSizeList
;
75 sal_uInt8
* mpSource
; // start of source buffer that is not increased
76 // ( instead use mnParaCount to index )
77 sal_uInt8
* mpEndValidSource
; // end position in source buffer of last valid data
78 sal_uInt32 mnParaSize
; // actual parameter size which has been done so far
79 sal_uInt32 mnActCount
; // increased by each action
80 std::unique_ptr
<sal_uInt8
[]>
81 mpBuf
; // source stream operation -> then this is allocated for
82 // the temp input buffer
85 sal_uInt32 mnElementClass
;
86 sal_uInt32 mnElementID
;
87 sal_uInt32 mnElementSize
; // full parameter size for the latest action
89 sal_uInt32
ImplGetUI16();
90 static sal_uInt8
ImplGetByte( sal_uInt32 nSource
, sal_uInt32 nPrecision
);
91 sal_Int32
ImplGetI( sal_uInt32 nPrecision
);
92 sal_uInt32
ImplGetUI( sal_uInt32 nPrecision
);
93 static void ImplGetSwitch4( const sal_uInt8
* pSource
, sal_uInt8
* pDest
);
94 static void ImplGetSwitch8( const sal_uInt8
* pSource
, sal_uInt8
* pDest
);
95 double ImplGetFloat( RealPrecision
, sal_uInt32 nRealSize
);
96 sal_uInt32
ImplGetBitmapColor( bool bDirectColor
= false );
97 void ImplSetMapMode();
98 void ImplSetUnderlineMode();
99 void ImplMapDouble( double& );
100 void ImplMapX( double& );
101 void ImplMapY( double& );
102 void ImplMapPoint( FloatPoint
& );
103 inline double ImplGetIY();
104 inline double ImplGetFY();
105 inline double ImplGetIX();
106 inline double ImplGetFX();
107 sal_uInt32
ImplGetPointSize();
108 void ImplGetPoint( FloatPoint
& rFloatPoint
, bool bMap
= false );
109 void ImplGetRectangle( FloatRect
&, bool bMap
= false );
110 void ImplGetRectangleNS( FloatRect
& );
111 void ImplGetVector( double* );
112 static double ImplGetOrientation( FloatPoint
const & rCenter
, FloatPoint
const & rPoint
);
113 static void ImplSwitchStartEndAngle( double& rStartAngle
, double& rEndAngle
);
114 bool ImplGetEllipse( FloatPoint
& rCenter
, FloatPoint
& rRadius
, double& rOrientation
);
116 void ImplDefaultReplacement();
128 void ImplDoClass15();
134 CGM(css::uno::Reference
< css::frame::XModel
> const & rModel
);
135 sal_uInt32
GetBackGroundColor() const;
136 bool IsValid() const { return mbStatus
; };
137 bool IsFinished() const { return mbIsFinished
; };
138 bool Write( SvStream
& rIStm
);
142 inline bool useless(double value
)
144 if (!std::isfinite(value
))
147 std::frexp(value
, &exp
);
148 const int maxbits
= sizeof(tools::Long
) * 8;
149 return exp
> maxbits
;
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */