1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_filter.hxx"
26 #include <main.hxx>
27 #include <outact.hxx>
28 
29 // ---------------------------------------------------------------
30 
ImplDoClass0()31 void CGM::ImplDoClass0()
32 {
33 	switch ( mnElementID )
34 	{
35 		case 0x01 : ComOut( CGM_LEVEL1, "Begin Metafile" )
36 		{
37 			ImplSetMapMode();
38 			mbMetaFile = sal_True;
39 		}
40 		break;
41 		case 0x02 : ComOut( CGM_LEVEL1, "End MetaFile" )
42 		{
43 			if ( mpBitmapInUse )							// vorhandene grafik verarbeiten,
44 			{
45 				CGMBitmapDescriptor* pBmpDesc = mpBitmapInUse->GetBitmap();
46 				// irgendetwas mit der Bitmap anfangen
47 				mpOutAct->DrawBitmap( pBmpDesc );
48 				delete mpBitmapInUse;
49 				mpBitmapInUse = NULL;
50 			}
51 			mbIsFinished = sal_True;
52 			mbPictureBody = sal_False;
53 			mbMetaFile = sal_False;
54 		}
55 		break;
56 		case 0x03 : ComOut( CGM_LEVEL1, "Begin Picture" )
57 		{
58 			ImplDefaultReplacement();
59 			ImplSetMapMode();
60 			if ( mbPicture )
61 				mbStatus = sal_False;
62 			else
63 			{
64 				*pCopyOfE = *pElement;
65 				mbPicture = mbFirstOutPut = sal_True;
66 				mbFigure = sal_False;
67 				mnAct4PostReset = 0;
68 				if ( mpChart == NULL )		// normal CGM Files determines "BeginPic"
69 					mpOutAct->InsertPage();		// as the next slide
70 			}
71 		}
72 		break;
73 		case 0x04 : ComOut( CGM_LEVEL1, "Begin Picture Body" )
74 			mbPictureBody = sal_True;
75 		break;
76 		case 0x05 : ComOut( CGM_LEVEL1, "	End Picture" )
77 		{
78 			if ( mbPicture )
79 			{
80 				if ( mpBitmapInUse )							// vorhandene grafik verarbeiten,
81 				{
82 					CGMBitmapDescriptor* pBmpDesc = mpBitmapInUse->GetBitmap();
83 					// irgendetwas mit der Bitmap anfangen
84 					mpOutAct->DrawBitmap( pBmpDesc );
85 					delete mpBitmapInUse;
86 					mpBitmapInUse = NULL;
87 				}
88 				mpOutAct->EndFigure();							// eventuelle figuren schliessen
89 				mpOutAct->EndGrouping();						// eventuelle gruppierungen noch abschliessen
90 				*pElement = *pCopyOfE;
91 				mbFigure = mbFirstOutPut = mbPicture = mbPictureBody = sal_False;
92 			}
93 			else
94 				mbStatus = sal_False;
95 		}
96 		break;
97 		case 0x06 : ComOut( CGM_LEVEL2, "Begin Segment" )
98 			pElement->bSegmentCount = sal_True;
99 		break;
100 		case 0x07 : ComOut( CGM_LEVEL2, "End Segment" )
101 			pElement->bSegmentCount = sal_True;
102 		break;
103 		case 0x08 : ComOut( CGM_LEVEL2, "Begin Figure" )
104 			mbFigure = sal_True;
105 			mpOutAct->BeginFigure();
106 		break;
107 		case 0x09 : ComOut( CGM_LEVEL2, "End Figure" )
108 			mpOutAct->EndFigure();
109 			mbFigure = sal_False;
110 		break;
111 		case 0x0d : ComOut( CGM_LEVEL3, "Begin Protection Region" ) break;
112 		case 0x0e : ComOut( CGM_LEVEL3, "End Protection Region" ) break;
113 		case 0x0f : ComOut( CGM_LEVEL3, "Begin Compound Line" ) break;
114 		case 0x10 : ComOut( CGM_LEVEL3, "End Compound Line" ) break;
115 		case 0x11 : ComOut( CGM_LEVEL3, "Begin Compound Text Path" ) break;
116 		case 0x12 : ComOut( CGM_LEVEL3, "End Compound Text Path" ) break;
117 		case 0x13 : ComOut( CGM_LEVEL3, "Begin Tile Array" ) break;					// NS
118 		case 0x14 : ComOut( CGM_LEVEL3, "End Tile Array" ) break;					// NS
119 		case 0xff : ComOut( CGM_GDSF_ONLY, "Filter Setup" ) break;
120 		case 0xfe : ComOut( CGM_GDSF_ONLY, "Begin Block Text Region" ) break;
121 		case 0xfd : ComOut( CGM_GDSF_ONLY, "End Block Text Region" ) break;
122 		case 0xfc : ComOut( CGM_GDSF_ONLY, "Begin Group" )
123 			mpOutAct->BeginGroup();
124 		break;
125 		case 0xfb : ComOut( CGM_GDSF_ONLY, "End Group" )
126 			mpOutAct->EndGroup();
127 		break;
128 		case 0xfa : ComOut( CGM_GDSF_ONLY, "Begin Patch" ) break;
129 		case 0xf9 : ComOut( CGM_GDSF_ONLY, "Begin Patch" ) break;
130 		default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;
131 	}
132 };
133 
134 
135