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 "elements.hxx"
26 void CGM::ImplDoClass0()
28 switch ( mnElementID
)
30 case 0x01 : /*Begin Metafile*/
36 case 0x02 : /*End MetaFile*/
38 if ( mpBitmapInUse
) // process existing graphic
40 CGMBitmapDescriptor
* pBmpDesc
= mpBitmapInUse
->GetBitmap();
41 // do anything with the bitmap
42 mpOutAct
->DrawBitmap( pBmpDesc
);
43 mpBitmapInUse
.reset();
46 mbPictureBody
= false;
50 case 0x03 : /*Begin Picture*/
52 if (mbPicture
|| mbInDefaultReplacement
)
56 *pCopyOfE
= *pElement
;
57 ImplDefaultReplacement();
59 mbPicture
= mbFirstOutPut
= true;
62 if ( mpChart
== nullptr ) // normal CGM Files determines "BeginPic"
63 mpOutAct
->InsertPage(); // as the next slide
67 case 0x04 : /*Begin Picture Body*/
70 case 0x05 : /* End Picture*/
74 if ( mpBitmapInUse
) // process existing graphic
76 CGMBitmapDescriptor
* pBmpDesc
= mpBitmapInUse
->GetBitmap();
77 // do anything with the bitmap
78 mpOutAct
->DrawBitmap( pBmpDesc
);
79 mpBitmapInUse
.reset();
81 mpOutAct
->EndFigure(); // close potential figures
82 mpOutAct
->EndGrouping(); // finish potential groups
83 *pElement
= *pCopyOfE
;
84 mbFigure
= mbFirstOutPut
= mbPicture
= mbPictureBody
= false;
90 case 0x06 : /*Begin Segment*/
91 case 0x07 : /*End Segment*/
92 pElement
->bSegmentCount
= true;
94 case 0x08 : /*Begin Figure*/
96 mpOutAct
->BeginFigure();
98 case 0x09 : /*End Figure*/
99 mpOutAct
->EndFigure();
102 case 0x0d : /*Begin Protection vcl::Region */break;
103 case 0x0e : /*End Protection vcl::Region */break;
104 case 0x0f : /*Begin Compound Line */break;
105 case 0x10 : /*End Compound Line */break;
106 case 0x11 : /*Begin Compound Text Path */break;
107 case 0x12 : /*End Compound Text Path */break;
108 case 0x13 : /*Begin Tile Array */break; // NS
109 case 0x14 : /*End Tile Array */break; // NS
110 case 0xff : /*Filter Setup */break;
111 case 0xfe : /*Begin Block Text vcl::Region */break;
112 case 0xfd : /*End Block Text vcl::Region */break;
113 case 0xfc : /*Begin Group*/
114 mpOutAct
->BeginGroup();
116 case 0xfb : /*End Group*/
117 mpOutAct
->EndGroup();
119 case 0xfa : /*Begin Patch */break;
120 case 0xf9 : /*Begin Patch */break;
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */