xref: /AOO41X/main/filter/source/graphicfilter/icgm/class3.cxx (revision 9e0fc027f109ec4ffcb6033aeec742a099701108)
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 
27 #include <main.hxx>
28 #include <outact.hxx>
29 
30 // ---------------------------------------------------------------
31 
ImplDoClass3()32 void CGM::ImplDoClass3()
33 {
34     sal_uInt32  nUInteger;
35     long    nI0, nI1;
36     switch ( mnElementID )
37     {
38         case 0x01 : ComOut( CGM_LEVEL1, "VDC Integer Precision" )
39         {
40             switch( ImplGetI( pElement->nIntegerPrecision ) )
41             {
42                 case 16 : pElement->nVDCIntegerPrecision = 2; break;
43                 case 32 : pElement->nVDCIntegerPrecision = 4; break;
44                 default : mbStatus = sal_False; break;
45             }
46         }
47         break;
48         case 0x02 : ComOut( CGM_LEVEL1, "VDC Real Precision" )
49         {
50             nUInteger = ImplGetUI16();
51             nI0 = ImplGetI( pElement->nIntegerPrecision );  // exponent
52             nI1 = ImplGetI( pElement->nIntegerPrecision );  // mantisse
53             switch( nUInteger )
54             {
55                 case 0 :
56                     pElement->eVDCRealPrecision = RP_FLOAT;
57                     switch ( nI0 )
58                     {
59                         case 9 :
60                             if ( nI1 != 23 )
61                                 mbStatus = sal_False;
62                             pElement->nVDCRealSize = 4;
63                             break;
64                         case 12 :
65                             if ( nI1 != 52 )
66                                 mbStatus =sal_False;
67                             pElement->nVDCRealSize = 8;
68                             break;
69                         default:
70                             mbStatus = sal_False;
71                             break;
72                     }
73                     break;
74                 case 1 :
75                     pElement->eVDCRealPrecision = RP_FIXED;
76                     if ( nI0 != nI1 )
77                         mbStatus = sal_False;
78                     if ( nI0 == 16 )
79                         pElement->nVDCRealSize = 4;
80                     else if ( nI0 == 32 )
81                         pElement->nVDCRealSize = 8;
82                     else
83                         mbStatus = sal_False;
84                     break;
85                 default :
86                     mbStatus = sal_False; break;
87             }
88         }
89         break;
90         case 0x03 : ComOut( CGM_LEVEL1, "Auxiliary Colour" )
91         {
92             pElement->nAuxiliaryColor = ImplGetBitmapColor();
93         }
94         break;
95         case 0x04 : ComOut( CGM_LEVEL1, "Transparency" )
96         {
97             switch( ImplGetUI16() )
98             {
99                 case 0 : pElement->eTransparency = T_OFF; break;
100                 case 1 : pElement->eTransparency = T_ON; break;
101                 default : mbStatus = sal_False; break;
102             }
103         }
104         break;
105         case 0x05 : ComOut( CGM_LEVEL1, "Clip Rectangle" )
106             ImplGetRectangle( pElement->aClipRect );
107         break;
108         case 0x06 : ComOut( CGM_LEVEL1, "Clip Indicator" )
109         {
110             switch( ImplGetUI16() )
111             {
112                 case 0 : pElement->eClipIndicator = CI_OFF; break;
113                 case 1 : pElement->eClipIndicator = CI_ON; break;
114                 default : mbStatus = sal_False; break;
115             }
116         }
117         break;
118         case 0x07 : ComOut( CGM_LEVEL2, "Line Clipping Mode" ) break;               // NS
119         case 0x08 : ComOut( CGM_LEVEL2, "Marker Clipping Mode" ) break;             // NS
120         case 0x09 : ComOut( CGM_LEVEL2, "Edge Clipping Mode" ) break;               // NS
121         case 0x0a : ComOut( CGM_LEVEL2, "New Region" )
122             mpOutAct->NewRegion();
123         break;
124         case 0x0b : ComOut( CGM_LEVEL2, "Save Primitive Context" ) break;           // NS
125         case 0x0c : ComOut( CGM_LEVEL2, "Restore Primitive Context" ) break;        // NS
126         case 0x11 : ComOut( CGM_LEVEL3, "Protection Region Indicator" ) break;
127         case 0x12 : ComOut( CGM_LEVEL3, "Generalized Text Path Mode" ) break;       // NS
128         case 0x13 : ComOut( CGM_LEVEL3, "Mitre Limit" )
129             pElement->nMitreLimit = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
130         break;                                                                      // NS
131         case 0x14 : ComOut( CGM_LEVEL3, "Transparent Cell Color" ) break;           // NS
132         case 0xfc : ComOut( CGM_GDSF_ONLY, "Text Path Alignment Modes" ) break;
133         case 0xfd : ComOut( CGM_GDSF_ONLY, "Pop Transformation Stack" ) break;
134         case 0xfe : ComOut( CGM_GDSF_ONLY, "Push Transformation Stack" ) break;
135         case 0xff : ComOut( CGM_GDSF_ONLY, "Set Patch ID" ) break;
136         default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;
137     }
138 };
139 
140 
141