00001 // $Id: ai5_eps.h 1312 2006-06-13 15:46:45Z alex $ 00002 // Declaration of Adobe Illustrator EPS filter. 00003 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE 00004 ================================XARAHEADERSTART=========================== 00005 00006 Xara LX, a vector drawing and manipulation program. 00007 Copyright (C) 1993-2006 Xara Group Ltd. 00008 Copyright on certain contributions may be held in joint with their 00009 respective authors. See AUTHORS file for details. 00010 00011 LICENSE TO USE AND MODIFY SOFTWARE 00012 ---------------------------------- 00013 00014 This file is part of Xara LX. 00015 00016 Xara LX is free software; you can redistribute it and/or modify it 00017 under the terms of the GNU General Public License version 2 as published 00018 by the Free Software Foundation. 00019 00020 Xara LX and its component source files are distributed in the hope 00021 that it will be useful, but WITHOUT ANY WARRANTY; without even the 00022 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00023 See the GNU General Public License for more details. 00024 00025 You should have received a copy of the GNU General Public License along 00026 with Xara LX (see the file GPL in the root directory of the 00027 distribution); if not, write to the Free Software Foundation, Inc., 51 00028 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00029 00030 00031 ADDITIONAL RIGHTS 00032 ----------------- 00033 00034 Conditional upon your continuing compliance with the GNU General Public 00035 License described above, Xara Group Ltd grants to you certain additional 00036 rights. 00037 00038 The additional rights are to use, modify, and distribute the software 00039 together with the wxWidgets library, the wxXtra library, and the "CDraw" 00040 library and any other such library that any version of Xara LX relased 00041 by Xara Group Ltd requires in order to compile and execute, including 00042 the static linking of that library to XaraLX. In the case of the 00043 "CDraw" library, you may satisfy obligation under the GNU General Public 00044 License to provide source code by providing a binary copy of the library 00045 concerned and a copy of the license accompanying it. 00046 00047 Nothing in this section restricts any of the rights you have under 00048 the GNU General Public License. 00049 00050 00051 SCOPE OF LICENSE 00052 ---------------- 00053 00054 This license applies to this program (XaraLX) and its constituent source 00055 files only, and does not necessarily apply to other Xara products which may 00056 in part share the same code base, and are subject to their own licensing 00057 terms. 00058 00059 This license does not apply to files in the wxXtra directory, which 00060 are built into a separate library, and are subject to the wxWindows 00061 license contained within that directory in the file "WXXTRA-LICENSE". 00062 00063 This license does not apply to the binary libraries (if any) within 00064 the "libs" directory, which are subject to a separate license contained 00065 within that directory in the file "LIBS-LICENSE". 00066 00067 00068 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS 00069 ---------------------------------------------- 00070 00071 Subject to the terms of the GNU Public License (see above), you are 00072 free to do whatever you like with your modifications. However, you may 00073 (at your option) wish contribute them to Xara's source tree. You can 00074 find details of how to do this at: 00075 http://www.xaraxtreme.org/developers/ 00076 00077 Prior to contributing your modifications, you will need to complete our 00078 contributor agreement. This can be found at: 00079 http://www.xaraxtreme.org/developers/contribute/ 00080 00081 Please note that Xara will not accept modifications which modify any of 00082 the text between the start and end of this header (marked 00083 XARAHEADERSTART and XARAHEADEREND). 00084 00085 00086 MARKS 00087 ----- 00088 00089 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara 00090 designs are registered or unregistered trademarks, design-marks, and/or 00091 service marks of Xara Group Ltd. All rights in these marks are reserved. 00092 00093 00094 Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK. 00095 http://www.xara.com/ 00096 00097 =================================XARAHEADEREND============================ 00098 */ 00099 00100 #ifndef INC_AI_EPS_5 00101 #define INC_AI_EPS_5 00102 00103 //#include "epsfiltr.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00104 #include "ai_eps.h" 00105 //#include "list.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00106 //#include "document.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00107 #include "impbmp.h" 00108 00109 class AI5Gradient; 00110 class AIGradientProcessor; 00111 class AIBitmapProcessor; 00112 class AILayerProcessor; 00113 00114 // All the commands used by AI EPS 5 files. 00115 enum 00116 { 00117 // Graduated fills 00118 EPSC_Bd = EPSC_t + 1, 00119 EPSC_Bm, 00120 EPSC_Bc, 00121 EPSC__Bs, 00122 EPSC__BS, 00123 EPSC__Br, 00124 EPSC_BD, 00125 EPSC_Bg, 00126 EPSC_Bb, 00127 EPSC_BB, 00128 EPSC_Bh, 00129 EPSC_HexStart, 00130 EPSC_HexEnd, 00131 00132 // Layer stuff 00133 EPSC_Lb, 00134 EPSC_LB, 00135 EPSC_Ln, 00136 00137 // Path tweaks 00138 EPSC_Ap, 00139 EPSC_Ar, 00140 EPSC_XR, 00141 00142 // bitmaps 00143 EPSC_XI, 00144 EPSC_XF, 00145 EPSC_XG, 00146 EPSC_Xh, 00147 EPSC_XH, 00148 00149 // unknown 00150 EPSC_XP, 00151 00152 // object tags 00153 EPSC_XT, 00154 00155 // spurious 00156 EPSC_Xm, 00157 00158 // RGB Colours 00159 EPSC_Xa, 00160 EPSC_XA, 00161 EPSC_Xx, 00162 EPSC_XX 00163 }; 00164 00165 /******************************************************************************************** 00166 00167 > class AI5EPSFilter : public AIEPSFilter 00168 00169 Author: Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> 00170 Created: 08/03/94 00171 Purpose: A filter that imports EPS files in Adobe Illustrator 7.0 EPS format. 00172 SeeAlso: EPSFilter 00173 00174 ********************************************************************************************/ 00175 00176 class AI5EPSFilter : public AIEPSFilter 00177 { 00178 CC_DECLARE_DYNAMIC(AI5EPSFilter); 00179 00180 public: 00181 AI5EPSFilter(); 00182 BOOL Init(); 00183 TCHAR* GetEPSCommand(EPSCommand Cmd); 00184 00185 // Allow a layer to be set with property flags. 00186 BOOL CreateLayer ( String_256 &LayerName, 00187 BOOL IsLocked, 00188 BOOL IsPrintable, 00189 BOOL IsVisible ); 00190 00191 // data access 00192 EPSStack& GetStack() { return Stack; } 00193 CCLexFile* GetEPSFile() { return EPSFile; } 00194 const TCHAR* GetTokenBuf() { return TokenBuf; } 00195 INT32& GetLastProgressUpdate() { return LastProgressUpdate; } 00196 00197 protected: 00198 virtual BOOL PrepareToImport(); 00199 virtual void CleanUpAfterImport(BOOL Successful); 00200 virtual void LookUpToken(); 00201 virtual BOOL ProcessToken(); 00202 INT32 EPSHeaderIsOk(ADDR pFileHeader, UINT32 HeaderSize); 00203 virtual BOOL ProcessFilterComment(); 00204 00205 void DecodeAI5GradFill(const DocCoord& StartPoint, 00206 double Angle, 00207 double Length, 00208 const String_64& FillName); 00209 virtual BOOL DecodeLayer ( void ); 00210 BOOL DecodeImageOperator(); 00211 BOOL ReadImageData( ADDR pData, INT32 nLength ); 00212 BOOL IgnoreHexData(); 00213 // The array of keyword names 00214 static CommandMap AI5Commands[]; 00215 00216 00217 // the "processors" maintain the state for the current import 00218 // hypothetically it should be possible to push them on a stack 00219 // but this has not been implemented 00220 AIGradientProcessor *mpGradientProc; 00221 AIBitmapProcessor *mpBitmapProc; 00222 AILayerProcessor *mpLayerProc; 00223 00224 BOOL mbReadingGradFill; 00225 BOOL mbReadingBitmap; 00226 }; 00227 00228 #endif