Line data Source code
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 : #ifndef INCLUDED_FILTER_SOURCE_GRAPHICFILTER_ICGM_CGM_HXX
21 : #define INCLUDED_FILTER_SOURCE_GRAPHICFILTER_ICGM_CGM_HXX
22 :
23 : #include <com/sun/star/frame/XModel.hpp>
24 :
25 : #define CGM_IMPORT_CGM 0x00000001
26 : #define CGM_EXPORT_IMPRESS 0x00000100
27 : #define CGM_EXPORT_META 0x00000200
28 :
29 : #include <rtl/ustring.hxx>
30 : #include <vector>
31 : #include "cgmtypes.hxx"
32 :
33 : class Graphic;
34 : class SvStream;
35 : class CGMChart;
36 : class CGMBitmap;
37 : class CGMOutAct;
38 : class CGMElements;
39 : class GDIMetaFile;
40 : class VirtualDevice;
41 :
42 : class CGM
43 : {
44 : friend class CGMChart;
45 : friend class CGMBitmap;
46 : friend class CGMElements;
47 : friend class CGMOutAct;
48 : friend class CGMImpressOutAct;
49 :
50 : double mnOutdx; // Ausgabe Groesse in 1/100TH mm
51 : double mnOutdy; // auf das gemappt wird
52 : double mnVDCXadd;
53 : double mnVDCYadd;
54 : double mnVDCXmul;
55 : double mnVDCYmul;
56 : double mnVDCdx;
57 : double mnVDCdy;
58 : double mnXFraction;
59 : double mnYFraction;
60 : bool mbAngReverse; // AngularDirection
61 :
62 : Graphic* mpGraphic;
63 :
64 : bool mbStatus;
65 : bool mbMetaFile;
66 : bool mbIsFinished;
67 : bool mbPicture;
68 : bool mbPictureBody;
69 : bool mbFigure;
70 : bool mbFirstOutPut;
71 : sal_uInt32 mnAct4PostReset;
72 : CGMBitmap* mpBitmapInUse;
73 : CGMChart* mpChart; // if sal_True->"SHWSLIDEREC"
74 : // otherwise "BEGINPIC" commands
75 : // controls page inserting
76 : CGMElements* pElement;
77 : CGMElements* pCopyOfE;
78 : CGMOutAct* mpOutAct;
79 : ::std::vector< sal_uInt8 * > maDefRepList;
80 : ::std::vector< sal_uInt32 > maDefRepSizeList;
81 :
82 : sal_uInt8* mpSource; // start of source buffer that is not increased
83 : // ( instead use mnParaCount to index )
84 : sal_uInt8* mpEndValidSource; // end position in source buffer of last valid data
85 : sal_uInt32 mnParaSize; // actual parameter size which has been done so far
86 : sal_uInt32 mnActCount; // increased by each action
87 : sal_uInt8* mpBuf; // source stream operation -> then this is allocated for
88 : // the temp input buffer
89 :
90 : sal_uInt32 mnMode; // source description
91 : sal_uInt32 mnEscape;
92 : sal_uInt32 mnElementClass;
93 : sal_uInt32 mnElementID;
94 : sal_uInt32 mnElementSize; // full parameter size for the latest action
95 :
96 : sal_uInt32 ImplGetUI16( sal_uInt32 nAlign = 0 );
97 : sal_uInt8 ImplGetByte( sal_uInt32 nSource, sal_uInt32 nPrecision );
98 : sal_Int32 ImplGetI( sal_uInt32 nPrecision );
99 : sal_uInt32 ImplGetUI( sal_uInt32 nPrecision );
100 : void ImplGetSwitch4( sal_uInt8* pSource, sal_uInt8* pDest );
101 : void ImplGetSwitch8( sal_uInt8* pSource, sal_uInt8* pDest );
102 : double ImplGetFloat( RealPrecision, sal_uInt32 nRealSize );
103 : sal_uInt32 ImplGetBitmapColor( bool bDirectColor = false );
104 : void ImplSetMapMode();
105 : void ImplMapDouble( double& );
106 : void ImplMapX( double& );
107 : void ImplMapY( double& );
108 : void ImplMapPoint( FloatPoint& );
109 : inline double ImplGetIY();
110 : inline double ImplGetFY();
111 : inline double ImplGetIX();
112 : inline double ImplGetFX();
113 : sal_uInt32 ImplGetPointSize();
114 : void ImplGetPoint( FloatPoint& rFloatPoint, bool bMap = false );
115 : void ImplGetRectangle( FloatRect&, bool bMap = false );
116 : void ImplGetRectangleNS( FloatRect& );
117 : void ImplGetVector( double* );
118 : double ImplGetOrientation( FloatPoint& rCenter, FloatPoint& rPoint );
119 : void ImplSwitchStartEndAngle( double& rStartAngle, double& rEndAngle );
120 : bool ImplGetEllipse( FloatPoint& rCenter, FloatPoint& rRadius, double& rOrientation );
121 :
122 : void ImplDefaultReplacement();
123 : void ImplDoClass();
124 : void ImplDoClass0();
125 : void ImplDoClass1();
126 : void ImplDoClass2();
127 : void ImplDoClass3();
128 : void ImplDoClass4();
129 : void ImplDoClass5();
130 : void ImplDoClass6();
131 : void ImplDoClass7();
132 : void ImplDoClass8();
133 : void ImplDoClass9();
134 : void ImplDoClass15();
135 :
136 : public:
137 :
138 : ~CGM();
139 :
140 : CGM( sal_uInt32 nMode, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > const & rModel );
141 : VirtualDevice* mpVirDev;
142 : GDIMetaFile* mpGDIMetaFile;
143 : sal_uInt32 GetBackGroundColor();
144 488 : bool IsValid() const { return mbStatus; };
145 482 : bool IsFinished() const { return mbIsFinished; };
146 : bool Write( SvStream& rIStm );
147 :
148 : friend SvStream& ReadCGM( SvStream& rOStm, CGM& rCGM );
149 :
150 : };
151 : #endif
152 :
153 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|