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 
32 #define ImplSetUnderlineMode()									\
33 																\
34 	sal_uInt32 nMode = ImplGetUI16();								\
35 	switch ( nMode )											\
36 	{															\
37 		case 1 : pElement->eUnderlineMode = UM_LOW; break;		\
38 		case 2 : pElement->eUnderlineMode = UM_HIGH; break;		\
39 		case 4 : pElement->eUnderlineMode = UM_STRIKEOUT; break;\
40 		case 8 : pElement->eUnderlineMode = UM_OVERSCORE; break;\
41 		default: pElement->eUnderlineMode = UM_OFF; break;		\
42 	}															\
43 	pElement->nUnderlineColor = ImplGetBitmapColor();
44 
45 // ---------------------------------------------------------------
46 
ImplDoClass6()47 void CGM::ImplDoClass6()
48 {
49 	switch ( mnElementID )
50 	{
51 		case 0x01 : ComOut( CGM_LEVEL1, "Escape" )
52 		{
53 			long	nIdentifier = ImplGetI( pElement->nIntegerPrecision );
54 			switch ( nIdentifier )
55 			{
56 				case 0 : ComOut( CGM_DESCRIPTION, "inquire function support" ) break;
57 				case -1	: ComOut( CGM_DESCRIPTION, "set underline mode" )
58 				{
59 					ImplSetUnderlineMode()
60 				}
61 				break;
62 				case -2 : ComOut( CGM_DESCRIPTION, "set script mode" ) break;
63 				case -3 : ComOut( CGM_DESCRIPTION, "set shadow mode" ) break;
64 				case -6 : ComOut( CGM_DESCRIPTION, "inquire origin offset" ) break;
65 				case -8 : ComOut( CGM_DESCRIPTION, "set media size" ) break;
66 				case -10 : ComOut( CGM_DESCRIPTION, "set character mode" ) break;
67 				case -14 : ComOut( CGM_DESCRIPTION, "resolution mode" ) break;
68 				case -17 : ComOut( CGM_DESCRIPTION, "line cap" ) break;
69 				case -18 : ComOut( CGM_DESCRIPTION, "line join" ) break;
70 				case -19 : ComOut( CGM_DESCRIPTION, "edge join" ) break;
71 				case -30 : ComOut( CGM_DESCRIPTION, "media type" ) break;
72 				case -31 : ComOut( CGM_DESCRIPTION, "number of copies" ) break;
73 				case -32 : ComOut( CGM_DESCRIPTION, "orientation" ) break;
74 				case -33 : ComOut( CGM_DESCRIPTION, "device color representation" ) break;
75 				case -34 : ComOut( CGM_DESCRIPTION, "device font list" ) break;
76 				case -35 : ComOut( CGM_DESCRIPTION, "color reversal mode" ) break;
77 				case -36 : ComOut( CGM_DESCRIPTION, "line cap attributes" ) break;
78 				case -37 : ComOut( CGM_DESCRIPTION, "begin effect" ) break;
79 				case -38 : ComOut( CGM_DESCRIPTION, "end effect" ) break;
80 				case -39 : ComOut( CGM_DESCRIPTION, "begin effect definition" ) break;
81 				case -40 : ComOut( CGM_DESCRIPTION, "end effect definition" ) break;
82 				case -41 : ComOut( CGM_DESCRIPTION, "end style definition" ) break;
83 				case -42 : ComOut( CGM_DESCRIPTION, "begin eps data" ) break;
84 				case -43 : ComOut( CGM_DESCRIPTION, "eps data" ) break;
85 				case -44 : ComOut( CGM_DESCRIPTION, "end eps data" ) break;
86 				case -45 : ComOut( CGM_DESCRIPTION, "set background style" ) break;
87 				case -46 : ComOut( CGM_DESCRIPTION, "set eps mode" ) break;
88 				case -47 : ComOut( CGM_DESCRIPTION, "fill mode" ) break;
89 				case -48 : ComOut( CGM_DESCRIPTION, "begin symbol" ) break;
90 				case -49 : ComOut( CGM_DESCRIPTION, "end symbol" ) break;
91 				case -50 : ComOut( CGM_DESCRIPTION, "begin layer" ) break;
92 				case -51 : ComOut( CGM_DESCRIPTION, "end layer" ) break;
93 				case -52 : ComOut( CGM_DESCRIPTION, "layer visibility" ) break;
94 				case -53 : ComOut( CGM_DESCRIPTION, "inquire foreign data" ) break;
95 				case -54 : ComOut( CGM_DESCRIPTION, "set text offset" ) break;
96 				case -55 : ComOut( CGM_DESCRIPTION, "begin group" ) break;
97 				case -56 : ComOut( CGM_DESCRIPTION, "end group" ) break;
98 				case -100 : ComOut( CGM_DESCRIPTION, "begin patch" ) break;
99 				case -101 : ComOut( CGM_DESCRIPTION, "end patch" ) break;
100 				case -102 : ComOut( CGM_DESCRIPTION, "begin block text region" ) break;
101 				case -103 : ComOut( CGM_DESCRIPTION, "end block text region" ) break;
102 				case -120 : ComOut( CGM_DESCRIPTION, "region margins" ) break;
103 				case -121 : ComOut( CGM_DESCRIPTION, "region expansions" ) break;
104 				case -122 : ComOut( CGM_DESCRIPTION, "region anchor" ) break;
105 				case -123 : ComOut( CGM_DESCRIPTION, "paragraph horizontal align" ) break;
106 				case -124 : ComOut( CGM_DESCRIPTION, "paragraph vertical align" ) break;
107 				case -125 : ComOut( CGM_DESCRIPTION, "region line flow" ) break;
108 				case -130 : ComOut( CGM_DESCRIPTION, "paragraph spacing" ) break;
109 				case -131 : ComOut( CGM_DESCRIPTION, "paragraph identation" ) break;
110 				case -132 : ComOut( CGM_DESCRIPTION, "paragraph tabs" ) break;
111 				case -133 : ComOut( CGM_DESCRIPTION, "paragraph bullet" ) break;
112 				case -134 : ComOut( CGM_DESCRIPTION, "paragraph bulet level" ) break;
113 				case -135 : ComOut( CGM_DESCRIPTION, "line horuzontal align" ) break;
114 				case -136 : ComOut( CGM_DESCRIPTION, "line vertical align" ) break;
115 				case -137 : ComOut( CGM_DESCRIPTION, "line spacing" ) break;
116 				case -138 : ComOut( CGM_DESCRIPTION, "word wrap" ) break;
117 				case -150 : ComOut( CGM_DESCRIPTION, "forward advance distance" ) break;
118 				case -151 : ComOut( CGM_DESCRIPTION, "word spacing" ) break;
119 				case -152 : ComOut( CGM_DESCRIPTION, "external leading" ) break;
120 				case -160 : ComOut( CGM_DESCRIPTION, "set gradient offset" ) break;
121 				case -161 : ComOut( CGM_DESCRIPTION, "set gradient edge" ) break;
122 				case -162 : ComOut( CGM_DESCRIPTION, "set gradient angle" ) break;
123 				case -163 : ComOut( CGM_DESCRIPTION, "set gradient description" ) break;
124 				case -164 : ComOut( CGM_DESCRIPTION, "set gradient style" ) break;
125 				case -165 : ComOut( CGM_DESCRIPTION, "set back ground style" ) break;
126 				case -170 : ComOut( CGM_DESCRIPTION, "geometric pattern draw style" ) break;
127 				case -190 : ComOut( CGM_DESCRIPTION, "set character width" ) break;
128 				case -191 : ComOut( CGM_DESCRIPTION, "hyperlink definitions" ) break;
129 				case -192 : ComOut( CGM_DESCRIPTION, "set color name for pantone" ) break;
130 				case -32746 : ComOut( CGM_DESCRIPTION, "set text font" ) break;
131 				case -32747 : ComOut( CGM_DESCRIPTION, "font selection mode" ) break;
132 				case -32752 : ComOut( CGM_DESCRIPTION, "connecting edge" ) break;
133 				case -32753	: ComOut( CGM_DESCRIPTION, "set drawing mode" ) break;
134 				case -32754 : ComOut( CGM_DESCRIPTION, "inquire clip rectangle" ) break;
135 				case -32755 : ComOut( CGM_DESCRIPTION, "protection region indicator" ) break;
136 				case -32756 : ComOut( CGM_DESCRIPTION, "end protection region" ) break;
137 				case -32757 : ComOut( CGM_DESCRIPTION, "begin protection region" ) break;
138 				case -32758 : ComOut( CGM_DESCRIPTION, "geometric pattern definition" ) break;
139 				case -32759 : ComOut( CGM_DESCRIPTION, "hatch style definition" ) break;
140 				case -32760 : ComOut( CGM_DESCRIPTION, "close figure" ) break;
141 				case -32761 : ComOut( CGM_DESCRIPTION, "end figure" )
142 				{
143 					mpOutAct->EndFigure();
144 					mbFigure = sal_False;
145 				}
146 				break;
147 				case -32762	: ComOut( CGM_DESCRIPTION, "begin figure" )
148 				{
149 					mbFigure = sal_True;
150 					mpOutAct->BeginFigure();
151 				}
152 				break;
153 				case -32763 : ComOut( CGM_DESCRIPTION, "pop transformatin" ) break;
154 				case -32764 : ComOut( CGM_DESCRIPTION, "push transformation" ) break;
155 				case -32765 : ComOut( CGM_DESCRIPTION, "copy segment" ) break;
156 				case -32766 : ComOut( CGM_DESCRIPTION, "endseg" ) break;
157 				case -32767 : ComOut( CGM_DESCRIPTION, "begin segment" ) break;
158 				default : ComOut( CGM_DESCRIPTION, "????????????????????????????????" ) break;
159 			}
160 			mnParaSize = mnElementSize;
161 		}
162 		break;
163 		case 0x02 : ComOut( CGM_LEVEL1, "Get Escape" ) break;
164 		case 0x11 : ComOut( CGM_GDSF_ONLY, "Set Underline Mode" )
165 		{
166 			ImplSetUnderlineMode();
167 		}
168 		break;
169 		case 0x12 : ComOut( CGM_GDSF_ONLY, "Set Script Mode" ) break;
170 		case 0x13 : ComOut( CGM_GDSF_ONLY, "Set Shadow Mode" ) break;
171 		case 0x18 : ComOut( CGM_GDSF_ONLY, "Set Media Size" ) break;
172 		case 0x20 : ComOut( CGM_GDSF_ONLY, "Set Character Mode" ) break;
173 		case 0x24 : ComOut( CGM_GDSF_ONLY, "Resolution Mode" ) break;
174 		case 0x27 : ComOut( CGM_GDSF_ONLY, "Line Cap" ) break;
175 		case 0x28 : ComOut( CGM_GDSF_ONLY, "Line Join" ) break;
176 		case 0x29 : ComOut( CGM_GDSF_ONLY, "Edge Join" ) break;
177 		case 0x40 : ComOut( CGM_GDSF_ONLY, "Media Type" ) break;
178 		case 0x41 : ComOut( CGM_GDSF_ONLY, "Number of Copies" ) break;
179 		case 0x42 : ComOut( CGM_GDSF_ONLY, "Origin" ) break;
180 		case 0x45 : ComOut( CGM_GDSF_ONLY, "Color Reversal Mode" ) break;
181 		case 0x46 : ComOut( CGM_GDSF_ONLY, "Line Cap Attributes" ) break;
182 		case 0x49 : ComOut( CGM_GDSF_ONLY, "Begin Effect Definition" ) break;
183 		case 0x50 : ComOut( CGM_GDSF_ONLY, "End Effect Definition" ) break;
184 		case 0x51 : ComOut( CGM_GDSF_ONLY, "Line End Style Attributes" ) break;
185 		case 0x52 : ComOut( CGM_GDSF_ONLY, "Begin Data" ) break;
186 		case 0x53 : ComOut( CGM_GDSF_ONLY, "Data" ) break;
187 		case 0x54 : ComOut( CGM_GDSF_ONLY, "End Data" ) break;
188 		case 0x55 : ComOut( CGM_GDSF_ONLY, "Set Background Style" ) break;
189 		case 0x56 : ComOut( CGM_GDSF_ONLY, "Set EPS Mode" ) break;
190 		case 0x57 : ComOut( CGM_GDSF_ONLY, "Fill Mode" ) break;
191 		case 0x58 : ComOut( CGM_GDSF_ONLY, "Begin Symbol" ) break;
192 		case 0x59 : ComOut( CGM_GDSF_ONLY, "End Symbol" ) break;
193 		case 0x60 : ComOut( CGM_GDSF_ONLY, "Begin Layer" ) break;
194 		case 0x61 : ComOut( CGM_GDSF_ONLY, "End Layer" ) break;
195 		case 0x62 : ComOut( CGM_GDSF_ONLY, "Layer Visibility" ) break;
196 		case 0x64 : ComOut( CGM_GDSF_ONLY, "Set Text Offset" ) break;
197 		case 0xFF : ComOut( CGM_GDSF_ONLY, "Inquire Function Support" ) break;
198 		case 0xFE : ComOut( CGM_GDSF_ONLY, "Inquire Origin" ) break;
199 		case 0xFD : ComOut( CGM_GDSF_ONLY, "Inquire Foreign Data Mode" ) break;
200 		case 0xFC : ComOut( CGM_GDSF_ONLY, "Inquire Text Extent" ) break;
201 		case 0xFB : ComOut( CGM_GDSF_ONLY, "Inquire DPI" ) break;
202 		default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;
203 	}
204 };
205 
206 // ---------------------------------------------------------------
207 
ImplDoClass8()208 void CGM::ImplDoClass8()
209 {
210 	switch ( mnElementID )
211 	{
212 		case 0x01 : ComOut( CGM_LEVEL2, "Copy Segment" ) break;						// NS
213 		case 0x02 : ComOut( CGM_LEVEL2, "Inheritance Filter" ) break;				// NS
214 		case 0x03 : ComOut( CGM_LEVEL2, "Clip Inheritance" ) break;					// NS
215 		case 0x04 : ComOut( CGM_LEVEL2, "Segment Transformation" ) break;
216 		case 0x05 : ComOut( CGM_LEVEL2, "Segment HighLighting" ) break;				// NS
217 		case 0x06 : ComOut( CGM_LEVEL2, "Segment Display Priority" ) break;			// NS
218 		case 0x07 : ComOut( CGM_LEVEL2, "Segment Pick Priority" ) break;			// NS
219 		case 0xfe : ComOut( CGM_GDSF_ONLY, "INQ Current Position" ) break;
220 		case 0xff : ComOut( CGM_GDSF_ONLY, "INQ Inserted Object Extent" ) break;
221 		default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;							// NS
222 	}
223 };
224 
225 // ---------------------------------------------------------------
226 
ImplDoClass9()227 void CGM::ImplDoClass9()
228 {
229 	switch ( mnElementID )
230 	{
231 		case 0x01 : ComOut( CGM_UNKNOWN_LEVEL, "Pixel Array" ) break;					// NS
232 		case 0x02 : ComOut( CGM_UNKNOWN_LEVEL, "Create Bitmap" ) break;					// NS
233 		case 0x03 : ComOut( CGM_UNKNOWN_LEVEL, "Delete Bitmap" ) break;					// NS
234 		case 0x04 : ComOut( CGM_UNKNOWN_LEVEL, "Select Drawing Bitmap" ) break;			// NS
235 		case 0x05 : ComOut( CGM_UNKNOWN_LEVEL, "Display Bitmap" ) break;				// NS
236 		case 0x06 : ComOut( CGM_UNKNOWN_LEVEL, "Drawing Mode" ) break;
237 		case 0x07 : ComOut( CGM_UNKNOWN_LEVEL, "Mapped Bitmap ForeGrnd Color" ) break;	// NS
238 		case 0x08 : ComOut( CGM_UNKNOWN_LEVEL, "Fill Bitmap" ) break;					// NS
239 		case 0x09 : ComOut( CGM_UNKNOWN_LEVEL, "Two Operand BitBlt" ) break;			// NS
240 		case 0x0a : ComOut( CGM_UNKNOWN_LEVEL, "Three Operand BitBlt" ) break;			// NS
241 		default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;
242 	}
243 };
244 
245 // ---------------------------------------------------------------
246 
ImplDoClass15()247 void CGM::ImplDoClass15()
248 {
249 	switch ( mnElementID )
250 	{
251 		case 0x01 : ComOut( CGM_UNKNOWN_LEVEL, "Inquire Error Stack" ) break;
252 		case 0x02 : ComOut( CGM_UNKNOWN_LEVEL, "Pop Error Stack" ) break;
253 		case 0x03 : ComOut( CGM_UNKNOWN_LEVEL, "Empty Error Stack" ) break;
254 		default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;
255 	}
256 };
257 
258 // ---------------------------------------------------------------
259