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 #ifndef CGM_ELEMENTS_HXX_
24 #define CGM_ELEMENTS_HXX_
25 
26 #include "main.hxx"
27 #include <tools/table.hxx>
28 
29 #define nBackGroundColor	aColorTable[ 0 ]
30 
31 class CGMElements
32 {
33 		void				ImplInsertHatch( sal_Int32 Key, int Style, long Distance, long Angle );
34 	public:
35 		CGM*				mpCGM;
36 		long				nMetaFileVersion;
37 
38 		sal_uInt32				nIntegerPrecision;	// maybe 1, 2, 4 Bytes
39 		sal_uInt32				nIndexPrecision;	//   "		"	    "
40 		RealPrecision		eRealPrecision;
41 		sal_uInt32				nRealSize;			// maybe 4 or 8 bytes
42 		sal_uInt32				nColorPrecision;	//	 "	    "       "
43 		sal_uInt32				nColorIndexPrecision;//	 "      "       "
44 
45 		ScalingMode			eScalingMode;
46 		double				nScalingFactor;
47 
48 		VDCType				eVDCType;			// Integer / Real
49 		sal_uInt32				nVDCIntegerPrecision;
50 		RealPrecision		eVDCRealPrecision;
51 		sal_uInt32				nVDCRealSize;
52 		FloatRect			aVDCExtent;
53 		FloatRect			aVDCExtentMaximum;
54 
55 		DeviceViewPortMode	eDeviceViewPortMode;
56 		double				nDeviceViewPortScale;
57 		DeviceViewPortMap	eDeviceViewPortMap;
58 		DeviceViewPortMapH	eDeviceViewPortMapH;
59 		DeviceViewPortMapV	eDeviceViewPortMapV;
60 		FloatRect			aDeviceViewPort;
61 
62 		double				nMitreLimit;
63 
64 		ClipIndicator		eClipIndicator;
65 		FloatRect			aClipRect;
66 
67 		ColorSelectionMode	eColorSelectionMode;
68 		ColorModel			eColorModel;
69 		sal_uInt32				nColorMaximumIndex;				// default 63
70 		sal_uInt32				nLatestColorMaximumIndex;		// default 63
71 		sal_Int8				aColorTableEntryIs[ 256 ];
72 		sal_uInt32				aColorTable[ 256 ];
73 		sal_uInt32				aLatestColorTable[ 256 ];
74 		sal_uInt32				nColorValueExtent[ 8 ];	// RGB, CMYK
75 
76 		// ASPECT SOURCE FLAGS
77 		sal_uInt32				nAspectSourceFlags;	// bit = 0 -> INDIVIDUAL
78 												//       1 -> BUNDLED
79 
80 		LineBundle*			pLineBundle;		// Pointer to the current LineBundleIndex
81 		LineBundle			aLineBundle;
82 		List				aLineList;
83 		SpecMode			eLineWidthSpecMode;
84 		LineCapType			eLineCapType;
85 		LineJoinType		eLineJoinType;
86 
87 		MarkerBundle*		pMarkerBundle;		// Pointer to the current MarkerBundleIndex
88 		MarkerBundle		aMarkerBundle;
89 		List				aMarkerList;
90 		SpecMode			eMarkerSizeSpecMode;
91 
92 		EdgeBundle*			pEdgeBundle;		// Pointer to the current EdgeBundleIndex
93 		EdgeBundle			aEdgeBundle;
94 		List				aEdgeList;
95 		EdgeVisibility		eEdgeVisibility;
96 		SpecMode			eEdgeWidthSpecMode;
97 
98 		TextBundle*			pTextBundle;		// Pointer to the current TextBundleIndex
99 		TextBundle			aTextBundle;
100 		List				aTextList;
101 		double				nCharacterHeight;
102 		double				nCharacterOrientation[ 4 ];
103 		UnderlineMode		eUnderlineMode;
104 		sal_uInt32				nUnderlineColor;
105 		TextPath			eTextPath;
106 		TextAlignmentH		eTextAlignmentH;
107 		TextAlignmentV		eTextAlignmentV;
108 		double				nTextAlignmentHCont;
109 		double				nTextAlignmentVCont;
110 		long				nCharacterSetIndex;
111 		long				nAlternateCharacterSetIndex;
112 		CharacterCodingA	eCharacterCodingA;
113 		CGMFList			aFontList;
114 
115 		FillBundle*			pFillBundle;		// Pointer to the current EdgeBundleIndex
116 		FillBundle			aFillBundle;
117 		List				aFillList;
118 		FloatPoint			aFillRefPoint;
119 		Table				aHatchTable;
120 
121 		Transparency		eTransparency;
122 
123 		sal_uInt32				nAuxiliaryColor;
124 
125 		// Delimiter Counts -> which will be increased by each 'begin' operation
126 		//					   and decreased by each 'end' operation
127 		sal_Bool				bSegmentCount;
128 							CGMElements( CGM& rCGM );
129 							~CGMElements();
130 		CGMElements&		operator=( CGMElements& );
131 		void				Init();
132 		void				DeleteTable( Table& );
133 		Bundle*				GetBundleIndex( sal_uInt32 nIndex, List&, Bundle& );
134 		Bundle*				GetBundle( List& rList, long nIndex );
135 		Bundle*				InsertBundle( List&, Bundle& );
136 		void				DeleteAllBundles( List& );
137 		void				CopyAllBundles( List& Source, List& Dest );
138 };
139 
140 #endif
141 
142