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