LibreOffice Module filter (master) 1
class0.cxx
Go to the documentation of this file.
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#include "bitmap.hxx"
21#include "cgm.hxx"
22#include "elements.hxx"
23#include "outact.hxx"
24
25
27{
28 switch ( mnElementID )
29 {
30 case 0x01 : /*Begin Metafile*/
31 {
33 mbMetaFile = true;
34 }
35 break;
36 case 0x02 : /*End MetaFile*/
37 {
38 if ( mpBitmapInUse ) // process existing graphic
39 {
40 CGMBitmapDescriptor* pBmpDesc = mpBitmapInUse->GetBitmap();
41 // do anything with the bitmap
42 mpOutAct->DrawBitmap( pBmpDesc );
43 mpBitmapInUse.reset();
44 }
45 mbIsFinished = true;
46 mbPictureBody = false;
47 mbMetaFile = false;
48 }
49 break;
50 case 0x03 : /*Begin Picture*/
51 {
53 mbStatus = false;
54 else
55 {
59 mbPicture = mbFirstOutPut = true;
60 mbFigure = false;
62 if ( mpChart == nullptr ) // normal CGM Files determines "BeginPic"
63 mpOutAct->InsertPage(); // as the next slide
64 }
65 }
66 break;
67 case 0x04 : /*Begin Picture Body*/
68 mbPictureBody = true;
69 break;
70 case 0x05 : /* End Picture*/
71 {
72 if ( mbPicture )
73 {
74 if ( mpBitmapInUse ) // process existing graphic
75 {
76 CGMBitmapDescriptor* pBmpDesc = mpBitmapInUse->GetBitmap();
77 // do anything with the bitmap
78 mpOutAct->DrawBitmap( pBmpDesc );
79 mpBitmapInUse.reset();
80 }
81 mpOutAct->EndFigure(); // close potential figures
82 mpOutAct->EndGrouping(); // finish potential groups
85 }
86 else
87 mbStatus = false;
88 }
89 break;
90 case 0x06 : /*Begin Segment*/
91 pElement->bSegmentCount = true;
92 break;
93 case 0x07 : /*End Segment*/
94 pElement->bSegmentCount = true;
95 break;
96 case 0x08 : /*Begin Figure*/
97 mbFigure = true;
98 mpOutAct->BeginFigure();
99 break;
100 case 0x09 : /*End Figure*/
101 mpOutAct->EndFigure();
102 mbFigure = false;
103 break;
104 case 0x0d : /*Begin Protection vcl::Region */break;
105 case 0x0e : /*End Protection vcl::Region */break;
106 case 0x0f : /*Begin Compound Line */break;
107 case 0x10 : /*End Compound Line */break;
108 case 0x11 : /*Begin Compound Text Path */break;
109 case 0x12 : /*End Compound Text Path */break;
110 case 0x13 : /*Begin Tile Array */break; // NS
111 case 0x14 : /*End Tile Array */break; // NS
112 case 0xff : /*Filter Setup */break;
113 case 0xfe : /*Begin Block Text vcl::Region */break;
114 case 0xfd : /*End Block Text vcl::Region */break;
115 case 0xfc : /*Begin Group*/
116 mpOutAct->BeginGroup();
117 break;
118 case 0xfb : /*End Group*/
119 mpOutAct->EndGroup();
120 break;
121 case 0xfa : /*Begin Patch */break;
122 case 0xf9 : /*Begin Patch */break;
123 default: break;
124 }
125};
126
127
128/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< CGMBitmap > mpBitmapInUse
Definition: cgm.hxx:65
void ImplSetMapMode()
Definition: cgm.cxx:372
std::unique_ptr< CGMChart > mpChart
Definition: cgm.hxx:66
std::unique_ptr< CGMImpressOutAct > mpOutAct
Definition: cgm.hxx:71
bool mbStatus
Definition: cgm.hxx:55
bool mbMetaFile
Definition: cgm.hxx:56
sal_uInt32 mnElementID
Definition: cgm.hxx:86
bool mbFirstOutPut
Definition: cgm.hxx:61
bool mbFigure
Definition: cgm.hxx:60
bool mbInDefaultReplacement
Definition: cgm.hxx:62
void ImplDoClass0()
Definition: class0.cxx:26
void ImplDefaultReplacement()
Definition: cgm.cxx:590
bool mbPictureBody
Definition: cgm.hxx:59
bool mbPicture
Definition: cgm.hxx:58
std::unique_ptr< CGMElements > pCopyOfE
Definition: cgm.hxx:70
std::unique_ptr< CGMElements > pElement
Definition: cgm.hxx:69
sal_uInt32 mnAct4PostReset
Definition: cgm.hxx:63
bool mbIsFinished
Definition: cgm.hxx:57