00001 // $Id: cxflists.h 1282 2006-06-09 09:46:49Z alex $ 00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE 00003 ================================XARAHEADERSTART=========================== 00004 00005 Xara LX, a vector drawing and manipulation program. 00006 Copyright (C) 1993-2006 Xara Group Ltd. 00007 Copyright on certain contributions may be held in joint with their 00008 respective authors. See AUTHORS file for details. 00009 00010 LICENSE TO USE AND MODIFY SOFTWARE 00011 ---------------------------------- 00012 00013 This file is part of Xara LX. 00014 00015 Xara LX is free software; you can redistribute it and/or modify it 00016 under the terms of the GNU General Public License version 2 as published 00017 by the Free Software Foundation. 00018 00019 Xara LX and its component source files are distributed in the hope 00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the 00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00022 See the GNU General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with Xara LX (see the file GPL in the root directory of the 00026 distribution); if not, write to the Free Software Foundation, Inc., 51 00027 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00028 00029 00030 ADDITIONAL RIGHTS 00031 ----------------- 00032 00033 Conditional upon your continuing compliance with the GNU General Public 00034 License described above, Xara Group Ltd grants to you certain additional 00035 rights. 00036 00037 The additional rights are to use, modify, and distribute the software 00038 together with the wxWidgets library, the wxXtra library, and the "CDraw" 00039 library and any other such library that any version of Xara LX relased 00040 by Xara Group Ltd requires in order to compile and execute, including 00041 the static linking of that library to XaraLX. In the case of the 00042 "CDraw" library, you may satisfy obligation under the GNU General Public 00043 License to provide source code by providing a binary copy of the library 00044 concerned and a copy of the license accompanying it. 00045 00046 Nothing in this section restricts any of the rights you have under 00047 the GNU General Public License. 00048 00049 00050 SCOPE OF LICENSE 00051 ---------------- 00052 00053 This license applies to this program (XaraLX) and its constituent source 00054 files only, and does not necessarily apply to other Xara products which may 00055 in part share the same code base, and are subject to their own licensing 00056 terms. 00057 00058 This license does not apply to files in the wxXtra directory, which 00059 are built into a separate library, and are subject to the wxWindows 00060 license contained within that directory in the file "WXXTRA-LICENSE". 00061 00062 This license does not apply to the binary libraries (if any) within 00063 the "libs" directory, which are subject to a separate license contained 00064 within that directory in the file "LIBS-LICENSE". 00065 00066 00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS 00068 ---------------------------------------------- 00069 00070 Subject to the terms of the GNU Public License (see above), you are 00071 free to do whatever you like with your modifications. However, you may 00072 (at your option) wish contribute them to Xara's source tree. You can 00073 find details of how to do this at: 00074 http://www.xaraxtreme.org/developers/ 00075 00076 Prior to contributing your modifications, you will need to complete our 00077 contributor agreement. This can be found at: 00078 http://www.xaraxtreme.org/developers/contribute/ 00079 00080 Please note that Xara will not accept modifications which modify any of 00081 the text between the start and end of this header (marked 00082 XARAHEADERSTART and XARAHEADEREND). 00083 00084 00085 MARKS 00086 ----- 00087 00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara 00089 designs are registered or unregistered trademarks, design-marks, and/or 00090 service marks of Xara Group Ltd. All rights in these marks are reserved. 00091 00092 00093 Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK. 00094 http://www.xara.com/ 00095 00096 =================================XARAHEADEREND============================ 00097 */ 00098 00099 // Defines the various lists and list items used by the new file format 00100 00101 //#include "list.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00102 //#include "listitem.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00103 00104 class NodePath; 00105 class TextStory; 00106 class NodeGroup; 00107 class Node; 00108 class CXaraFileRecordHandler; 00109 class BaseCamelotFilter; 00110 00111 /*********************************************************************************************** 00112 00113 > class CXaraFilePathRecordRefListItem : public ListItem 00114 00115 Author: Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 00116 Created: 31/8/96 00117 Purpose: An item that appears in the CXaraFilePathRecordRefList 00118 00119 ***********************************************************************************************/ 00120 00121 class CXaraFilePathRecordRefListItem : public ListItem 00122 { 00123 CC_DECLARE_MEMDUMP(CXaraFilePathRecordRefListItem) 00124 00125 public: 00126 CXaraFilePathRecordRefListItem(NodePath* pPath,UINT32 RecNum) { pNodePath = pPath; RecordNumber = RecNum; } 00127 00128 NodePath* GetNodePath() { return pNodePath; } 00129 UINT32 GetRecordNumber() { return RecordNumber; } 00130 00131 private: 00132 NodePath* pNodePath; 00133 UINT32 RecordNumber; 00134 }; 00135 00136 /*********************************************************************************************** 00137 00138 > class CXaraFilePathRecordRefList : public List 00139 00140 Author: Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 00141 Created: 31/8/96 00142 Purpose: Holds a list of node path objects, and the corresponding record numbers of the 00143 records that represent the paths in the file 00144 00145 ***********************************************************************************************/ 00146 00147 class CXaraFilePathRecordRefList : public List 00148 { 00149 CC_DECLARE_MEMDUMP(CXaraFilePathRecordRefList) 00150 00151 public: 00152 CXaraFilePathRecordRefList() {} 00153 00154 void AddTail(CXaraFilePathRecordRefListItem* pItem) { List::AddTail(pItem); }; 00155 CXaraFilePathRecordRefListItem* GetHead() { return (CXaraFilePathRecordRefListItem*)List::GetHead(); } 00156 CXaraFilePathRecordRefListItem* GetTail() { return (CXaraFilePathRecordRefListItem*)List::GetTail(); } 00157 CXaraFilePathRecordRefListItem* GetNext(CXaraFilePathRecordRefListItem* pItem) { return (CXaraFilePathRecordRefListItem*)List::GetNext(pItem); } 00158 CXaraFilePathRecordRefListItem* GetPrev(CXaraFilePathRecordRefListItem* pItem) { return (CXaraFilePathRecordRefListItem*)List::GetPrev(pItem); } 00159 }; 00160 00161 //------------------------------------------------------------------------------------- 00162 //------------------------------------------------------------------------------------- 00163 //------------------------------------------------------------------------------------- 00164 00165 /*********************************************************************************************** 00166 00167 > class CXaraFileTextStoryGroupRefListItem : public ListItem 00168 00169 Author: Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 00170 Created: 31/8/96 00171 Purpose: An item that appears in the CXaraFileTextStoryGroupRefList 00172 00173 The group node that is in this object is assumed to be deletable and not in the tree. 00174 The destructor will CascadeDelete() the group, then delete the group itself 00175 00176 ***********************************************************************************************/ 00177 00178 // WEBSTER - markn 31/1/97 00179 // Replaced with general system 00180 /* 00181 class CXaraFileTextStoryGroupRefListItem : public ListItem 00182 { 00183 CC_DECLARE_MEMDUMP(CXaraFileTextStoryGroupRefListItem) 00184 00185 public: 00186 CXaraFileTextStoryGroupRefListItem(TextStory* pStory,NodeGroup* pGroup) { pTextStory = pStory; pNodeGroup = pGroup; } 00187 00188 // NOTE! The destructor deletes the group and all it's children 00189 ~CXaraFileTextStoryGroupRefListItem(); 00190 00191 TextStory* GetTextStory() { return pTextStory; } 00192 NodeGroup* GetNodeGroup() { return pNodeGroup; } 00193 00194 private: 00195 TextStory* pTextStory; 00196 NodeGroup* pNodeGroup; 00197 }; 00198 */ 00199 00200 /*********************************************************************************************** 00201 00202 > class CXaraFileTextStoryGroupRefList : public List 00203 00204 Author: Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 00205 Created: 31/8/96 00206 Purpose: Holds a list of text stories and corresponding group objects. 00207 00208 When automatically converting text to outlines during export of the web format, 00209 an out-of-tree group of paths is generated for each text story converted to outlines. 00210 00211 This list allows the group of paths to be generated once during the export process 00212 (instead of once for calc of file size, then again for actual output) 00213 It also allows the paths to exist for the entire export lifetime, so that the paths 00214 can safely be used during export for other processes (such as the smart path similarity 00215 code that detects paths that differ only by a transformation). 00216 00217 ***********************************************************************************************/ 00218 00219 // WEBSTER - markn 31/1/97 00220 // Replaced with general system 00221 /* 00222 class CXaraFileTextStoryGroupRefList : public List 00223 { 00224 CC_DECLARE_MEMDUMP(CXaraFileTextStoryGroupRefList) 00225 00226 public: 00227 CXaraFileTextStoryGroupRefList() {} 00228 00229 void AddTail(CXaraFileTextStoryGroupRefListItem* pItem) { List::AddTail(pItem); }; 00230 CXaraFileTextStoryGroupRefListItem* GetHead() { return (CXaraFileTextStoryGroupRefListItem*)List::GetHead(); } 00231 CXaraFileTextStoryGroupRefListItem* GetNext(CXaraFileTextStoryGroupRefListItem* pItem) { return (CXaraFileTextStoryGroupRefListItem*)List::GetNext(pItem); } 00232 }; 00233 */ 00234 00235 //------------------------------------------------------------------------------------- 00236 //------------------------------------------------------------------------------------- 00237 //------------------------------------------------------------------------------------- 00238 00239 //------------------------------------------------------------------------------------- 00240 //------------------------------------------------------------------------------------- 00241 //------------------------------------------------------------------------------------- 00242 00243 /*********************************************************************************************** 00244 00245 > class CXaraFileNodeGroupRefListItem : public ListItem 00246 00247 Author: Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 00248 Created: 29/1/97 00249 Purpose: An item that appears in the CXaraFileNodeGroupRefList 00250 00251 The group node that is in this object is assumed to be deletable and not in the tree. 00252 The destructor will CascadeDelete() the group, then delete the group itself 00253 00254 WEBSTER - markn 29/1/97 00255 Part of the general form of the system used to convert text to outlines in v1.5 00256 00257 ***********************************************************************************************/ 00258 00259 class CXaraFileNodeGroupRefListItem : public ListItem 00260 { 00261 CC_DECLARE_MEMDUMP(CXaraFileNodeGroupRefListItem) 00262 00263 public: 00264 CXaraFileNodeGroupRefListItem(Node* pThisNode,NodeGroup* pGroup) { pNode = pThisNode; pNodeGroup = pGroup; } 00265 00266 // NOTE! The destructor deletes the group and all it's children 00267 ~CXaraFileNodeGroupRefListItem(); 00268 00269 Node* GetNode() { return pNode; } 00270 NodeGroup* GetNodeGroup() { return pNodeGroup; } 00271 00272 private: 00273 Node* pNode; 00274 NodeGroup* pNodeGroup; 00275 }; 00276 00277 /*********************************************************************************************** 00278 00279 > class CXaraFileNodeGroupRefList : public List 00280 00281 Author: Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 00282 Created: 29/1/97 00283 Purpose: Holds a list of nodes and corresponding group objects. 00284 00285 When automatically converting a node to outlines during export of the web format, 00286 an out-of-tree group of paths is generated for each node converted to outlines. 00287 00288 This list allows the group of paths to be generated once during the export process 00289 (instead of once for calc of file size, then again for actual output) 00290 It also allows the paths to exist for the entire export lifetime, so that the paths 00291 can safely be used during export for other processes (such as the smart path similarity 00292 code that detects paths that differ only by a transformation). 00293 00294 WEBSTER - markn 29/1/97 00295 Part of the general form of the system used to convert text to outlines in v1.5 00296 00297 ***********************************************************************************************/ 00298 00299 class CXaraFileNodeGroupRefList : public List 00300 { 00301 CC_DECLARE_MEMDUMP(CXaraFileNodeGroupRefList) 00302 00303 public: 00304 CXaraFileNodeGroupRefList() {} 00305 00306 void AddTail(CXaraFileNodeGroupRefListItem* pItem) { List::AddTail(pItem); }; 00307 CXaraFileNodeGroupRefListItem* GetHead() { return (CXaraFileNodeGroupRefListItem*)List::GetHead(); } 00308 CXaraFileNodeGroupRefListItem* GetNext(CXaraFileNodeGroupRefListItem* pItem) { return (CXaraFileNodeGroupRefListItem*)List::GetNext(pItem); } 00309 }; 00310 00311 //------------------------------------------------------------------------------------- 00312 //------------------------------------------------------------------------------------- 00313 //------------------------------------------------------------------------------------- 00314 00315 /******************************************************************************************** 00316 00317 > class InsertLevelStackItem : public ListItem 00318 00319 Author: Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 00320 Created: 6/6/96 00321 Purpose: This item holds all the info for a given insert level of the tree. 00322 It is used when building the tree on import 00323 00324 Use it on conjunction with the InsertLevelStack class 00325 00326 ********************************************************************************************/ 00327 00328 class InsertLevelStackItem : public ListItem 00329 { 00330 // Give my name in memory dumps 00331 CC_DECLARE_MEMDUMP(InsertLevelStackItem); 00332 00333 public: 00334 InsertLevelStackItem(BaseCamelotFilter* pFilter); 00335 00336 UINT32 GetNumNodesInserted() { return NumNodesInserted; } 00337 00338 BOOL SetLastInsertedNode(Node* pNode); 00339 Node* GetLastInsertedNode() { return pLastInsertedNode; } 00340 00341 void SetLastHandler(CXaraFileRecordHandler* pHandler, UINT32 Tag) { pLastHandler = pHandler; LastHandledTag = Tag; } 00342 CXaraFileRecordHandler* GetLastHandler() { return pLastHandler; } 00343 UINT32 GetLastHandledTag() { return LastHandledTag; } 00344 00345 BOOL InformLastInsertedNodeChildrenComplete(); 00346 00347 private: 00348 void IncNumNodesInserted() { NumNodesInserted++; } 00349 00350 UINT32 NumNodesInserted; 00351 Node* pLastInsertedNode; 00352 CXaraFileRecordHandler* pLastHandler; 00353 UINT32 LastHandledTag; 00354 BaseCamelotFilter* pFilter; 00355 BOOL LastNodeInformedChildrenComplete; 00356 }; 00357 00358 /*********************************************************************************************** 00359 00360 > class InsertLevelStack : public List 00361 00362 Author: Mark_Neves (Xara Group Ltd) <camelotdev@xara.com> 00363 Created: 3/9/96 00364 Purpose: Holds a list of level items 00365 The class gives the list a stack-like interface 00366 00367 Each item holds info on a particular level during import. 00368 00369 The list is actually treated as a stack, where the tail item is the item on the 00370 top of the stack, and items are only added and removed from the tail of the list 00371 00372 ***********************************************************************************************/ 00373 00374 class InsertLevelStack : public List 00375 { 00376 CC_DECLARE_MEMDUMP(InsertLevelStack) 00377 00378 public: 00379 InsertLevelStack(); 00380 ~InsertLevelStack(); 00381 00382 void Add(InsertLevelStackItem* pItem); 00383 InsertLevelStackItem* Get(); 00384 InsertLevelStackItem* Pop(); 00385 00386 private: 00387 UINT32 InsertLevel; 00388 }; 00389