1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: class0.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_goodies.hxx"
36 // ---------------------------------------------------------------
38 void CGM::ImplDoClass0()
40 switch ( mnElementID
)
42 case 0x01 : ComOut( CGM_LEVEL1
, "Begin Metafile" )
45 mbMetaFile
= sal_True
;
48 case 0x02 : ComOut( CGM_LEVEL1
, "End MetaFile" )
50 if ( mpBitmapInUse
) // vorhandene grafik verarbeiten,
52 CGMBitmapDescriptor
* pBmpDesc
= mpBitmapInUse
->GetBitmap();
53 // irgendetwas mit der Bitmap anfangen
54 mpOutAct
->DrawBitmap( pBmpDesc
);
58 mbIsFinished
= sal_True
;
59 mbPictureBody
= sal_False
;
60 mbMetaFile
= sal_False
;
63 case 0x03 : ComOut( CGM_LEVEL1
, "Begin Picture" )
65 ImplDefaultReplacement();
71 *pCopyOfE
= *pElement
;
72 mbPicture
= mbFirstOutPut
= sal_True
;
75 if ( mpChart
== NULL
) // normal CGM Files determines "BeginPic"
76 mpOutAct
->InsertPage(); // as the next slide
80 case 0x04 : ComOut( CGM_LEVEL1
, "Begin Picture Body" )
81 mbPictureBody
= sal_True
;
83 case 0x05 : ComOut( CGM_LEVEL1
, " End Picture" )
87 if ( mpBitmapInUse
) // vorhandene grafik verarbeiten,
89 CGMBitmapDescriptor
* pBmpDesc
= mpBitmapInUse
->GetBitmap();
90 // irgendetwas mit der Bitmap anfangen
91 mpOutAct
->DrawBitmap( pBmpDesc
);
95 mpOutAct
->EndFigure(); // eventuelle figuren schliessen
96 mpOutAct
->EndGrouping(); // eventuelle gruppierungen noch abschliessen
97 *pElement
= *pCopyOfE
;
98 mbFigure
= mbFirstOutPut
= mbPicture
= mbPictureBody
= sal_False
;
101 mbStatus
= sal_False
;
104 case 0x06 : ComOut( CGM_LEVEL2
, "Begin Segment" )
105 pElement
->bSegmentCount
= sal_True
;
107 case 0x07 : ComOut( CGM_LEVEL2
, "End Segment" )
108 pElement
->bSegmentCount
= sal_True
;
110 case 0x08 : ComOut( CGM_LEVEL2
, "Begin Figure" )
112 mpOutAct
->BeginFigure();
114 case 0x09 : ComOut( CGM_LEVEL2
, "End Figure" )
115 mpOutAct
->EndFigure();
116 mbFigure
= sal_False
;
118 case 0x0d : ComOut( CGM_LEVEL3
, "Begin Protection Region" ) break;
119 case 0x0e : ComOut( CGM_LEVEL3
, "End Protection Region" ) break;
120 case 0x0f : ComOut( CGM_LEVEL3
, "Begin Compound Line" ) break;
121 case 0x10 : ComOut( CGM_LEVEL3
, "End Compound Line" ) break;
122 case 0x11 : ComOut( CGM_LEVEL3
, "Begin Compound Text Path" ) break;
123 case 0x12 : ComOut( CGM_LEVEL3
, "End Compound Text Path" ) break;
124 case 0x13 : ComOut( CGM_LEVEL3
, "Begin Tile Array" ) break; // NS
125 case 0x14 : ComOut( CGM_LEVEL3
, "End Tile Array" ) break; // NS
126 case 0xff : ComOut( CGM_GDSF_ONLY
, "Filter Setup" ) break;
127 case 0xfe : ComOut( CGM_GDSF_ONLY
, "Begin Block Text Region" ) break;
128 case 0xfd : ComOut( CGM_GDSF_ONLY
, "End Block Text Region" ) break;
129 case 0xfc : ComOut( CGM_GDSF_ONLY
, "Begin Group" )
130 mpOutAct
->BeginGroup();
132 case 0xfb : ComOut( CGM_GDSF_ONLY
, "End Group" )
133 mpOutAct
->EndGroup();
135 case 0xfa : ComOut( CGM_GDSF_ONLY
, "Begin Patch" ) break;
136 case 0xf9 : ComOut( CGM_GDSF_ONLY
, "Begin Patch" ) break;
137 default: ComOut( CGM_UNKNOWN_COMMAND
, "" ) break;