cxfrech.cpp

Go to the documentation of this file.
00001 // $Id: cxfrech.cpp 1688 2006-08-10 12:05:20Z gerry $
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 // Implementation of the record handler class of the v2 file format
00099 
00100 #include "camtypes.h"
00101 //#include "cxfrech.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00102 //#include "doccolor.h"
00103 #if !defined(EXCLUDE_FROM_XARLIB)
00104 #include "colcomp.h"
00105 #include "bmpcomp.h"
00106 #include "unitcomp.h"
00107 #include "infocomp.h"
00108 //#include "camfiltr.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00109 #else
00110 #include "cxfile.h"
00111 #endif
00112 //#include "fixmem.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00113 
00114 //#include "cxfrec.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00115 #include "cxftags.h"
00116 
00117 DECLARE_SOURCE("$Revision: 1688 $");
00118 
00119 // An implement to match the Declare in the .h file.
00120 CC_IMPLEMENT_DYNAMIC(CXaraFileRecordHandler,ListItem);
00121 CC_IMPLEMENT_DYNAMIC(CamelotRecordHandler,CXaraFileRecordHandler);
00122 CC_IMPLEMENT_DYNAMIC(StripSubTreeRecordHandler,CamelotRecordHandler);
00123 
00124 // This will get Camelot to display the filename and linenumber of any memory allocations
00125 // that are not released at program exit
00126 // Declare smart memory handling in Debug builds
00127 #define new CAM_DEBUG_NEW
00128 
00129 //-------------------------------------------------------------------------------------------
00130 //-------------------------------------------------------------------------------------------
00131 //-------------------------------------------------------------------------------------------
00132 
00133 
00134 /********************************************************************************************
00135 
00136 >   CXaraFileRecordHandler::CXaraFileRecordHandler()
00137 
00138     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00139     Created:    28/5/96
00140     Inputs:     -
00141     Purpose:    Creates a record handler object.
00142                 These are used by CXaraFile for reading the file.
00143                 Handlers handle records as they are read from a file
00144     Errors:     -
00145     SeeAlso:    -
00146 
00147 ********************************************************************************************/
00148 
00149 CXaraFileRecordHandler::CXaraFileRecordHandler()
00150 {
00151 }
00152 
00153 /********************************************************************************************
00154 
00155 >   CXaraFileRecordHandler::~CXaraFileRecordHandler()
00156 
00157     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00158     Created:    28/5/96
00159     Purpose:    Default destructor
00160     Errors:     -
00161     SeeAlso:    -
00162 
00163 ********************************************************************************************/
00164 
00165 CXaraFileRecordHandler::~CXaraFileRecordHandler()
00166 {
00167 }
00168 
00169 
00170 /********************************************************************************************
00171 
00172 >   BOOL CXaraFileRecordHandler::IsTagInList(UINT32 Tag)
00173 
00174     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00175     Created:    28/5/96
00176     Inputs:     Tag = a tag value
00177     Returns:    TRUE if tag is in handler's tag list
00178                 FALSE otherwise
00179     Purpose:    Helper function that searchs the handler's tag list for a given tag
00180     Errors:     -
00181     SeeAlso:    -
00182 
00183 ********************************************************************************************/
00184 
00185 BOOL CXaraFileRecordHandler::IsTagInList(UINT32 Tag)
00186 {
00187     const UINT32* pTagList = GetTagList();
00188 
00189     ERROR2IF(pTagList == NULL,FALSE,"NULL pTagList - is this a default handler?");
00190     
00191     while (*pTagList != CXFRH_TAG_LIST_END)
00192     {
00193         if (*pTagList == Tag)
00194             return TRUE;
00195 
00196         pTagList++;
00197     }
00198 
00199     return FALSE;
00200 }
00201 
00202 /********************************************************************************************
00203 
00204 >   virtual BOOL CXaraFileRecordHandler::HandleStreamedRecord(CXaraFile * pCXFile, UINT32 Tag,UINT32 Size,UINT32 RecordNumber)
00205 
00206     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
00207     Created:    7/6/96
00208     Inputs:     pCXFile = access to the CXaraFile class
00209                 Tag  = the tag value
00210                 Size = size of record
00211                 RecordNumber = the record number in the file
00212     Returns:    TRUE if handled ok
00213                 FALSE otherwise
00214     Purpose:    This is the baseclass streamed record handler. It should always be overriden.
00215                 We don't want to make it pure virtual and force all handlers to define it
00216                 as most do not require it.
00217     Errors:     -
00218     SeeAlso:    -
00219 
00220 ********************************************************************************************/
00221 
00222 BOOL CXaraFileRecordHandler::HandleStreamedRecord(CXaraFile * pCXFile, UINT32 Tag,UINT32 Size,UINT32 RecordNumber)
00223 {
00224     ERROR2(FALSE,"CXaraFileRecordHandler::HandleStreamedRecord Baseclass handler called");
00225     return FALSE;
00226 }
00227 
00228 
00229 /********************************************************************************************
00230 
00231 >   virtual BOOL CXaraFileRecordHandler::Init(BaseCamelotFilter* pThisBaseCamelotFilter)
00232 
00233     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00234     Created:    28/5/96
00235     Inputs:     pThisBaseCamelotFilter = ptr to the filter that will read the file.
00236     Returns:    TRUE if ok
00237                 FALSE otherwise
00238     Purpose:    Initialises the handler.
00239     
00240                 Base class does nowt
00241     Errors:     -
00242     SeeAlso:    -
00243 
00244 ********************************************************************************************/
00245 
00246 #if !defined(EXCLUDE_FROM_XARLIB)
00247 BOOL CXaraFileRecordHandler::Init(BaseCamelotFilter* pThisBaseCamelotFilter)
00248 #else
00249 BOOL CXaraFileRecordHandler::Init(CXaraFile* pCXFile)
00250 #endif
00251 {
00252     return TRUE;
00253 }
00254 
00255 /********************************************************************************************
00256 
00257 >   virtual BOOL CXaraFileRecordHandler::BeginImport()
00258 
00259     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00260     Created:    8/8/96
00261     Inputs:     pThisBaseCamelotFilter = ptr to the filter that will read the file.
00262     Returns:    TRUE if ok
00263                 FALSE otherwise
00264     Purpose:    Informs the record handler that importing has begun.
00265     Errors:     -
00266     SeeAlso:    -
00267 
00268 ********************************************************************************************/
00269 
00270 BOOL CXaraFileRecordHandler::BeginImport()
00271 {
00272     return TRUE;
00273 }
00274 
00275 /********************************************************************************************
00276 
00277 >   virtual BOOL CXaraFileRecordHandler::EndImport()
00278 
00279     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00280     Created:    31/7/96
00281     Inputs:     -
00282     Returns:    TRUE if ok
00283                 FALSE otherwise
00284     Purpose:    Informs the record handler that importing is over
00285 
00286                 If you override this func, be sure to call the base class varient
00287     Errors:     -
00288     SeeAlso:    -
00289 
00290 ********************************************************************************************/
00291 
00292 BOOL CXaraFileRecordHandler::EndImport()
00293 {
00294     // Just return TRUE in the base class
00295     return TRUE;
00296 }
00297 
00298 /********************************************************************************************
00299 
00300 >   virtual BOOL CXaraFileRecordHandler::BeginSubtree(UINT32 Tag)
00301 
00302     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00303     Created:    2/9/96
00304     Inputs:     Tag = tag value of the tag this handler last handled
00305     Returns:    TRUE if this func wants exclusive handling of the tag
00306                 FALSE otherwise
00307     Purpose:    Informs the record handler that a subtree is following a tag of type 'Tag'
00308 
00309                 If you override this func and you do not wish other parts of the system to be informed of the
00310                 subtree start, you should return TRUE
00311 
00312                 The base class always returns FALSE
00313     Errors:     -
00314     SeeAlso:    -
00315 
00316 ********************************************************************************************/
00317 
00318 BOOL CXaraFileRecordHandler::BeginSubtree(UINT32 Tag)
00319 {
00320     return FALSE;   // FALSE means pass onto other parts of the system
00321 }
00322 
00323 /********************************************************************************************
00324 
00325 >   virtual BOOL CXaraFileRecordHandler::EndSubtree(UINT32 Tag)
00326 
00327     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00328     Created:    2/9/96
00329     Inputs:     Tag = tag value of the tag this handler last handled
00330     Returns:    TRUE if this func wants exclusive handling of the tag
00331                 FALSE otherwise
00332     Purpose:    Informs the record handler that a subtree that followed a tag of type 'Tag' has ended
00333 
00334                 If you override this func and you do not wish other parts of the system to be informed of the
00335                 subtree start, you should return TRUE
00336 
00337                 The base class always returns FALSE
00338     Errors:     -
00339     SeeAlso:    -
00340 
00341 ********************************************************************************************/
00342 
00343 BOOL CXaraFileRecordHandler::EndSubtree(UINT32 Tag)
00344 {
00345     return FALSE;   // FALSE means pass onto other parts of the system
00346 }
00347 
00348 /********************************************************************************************
00349 
00350 >   virtual void CXaraFileRecordHandler::GetTagText(UINT32 Tag,String_256& Str)
00351 
00352     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00353     Created:    12/6/96
00354     Inputs:     Tag = the tag value
00355                 Str = place to put textual description of the tag
00356     Returns:    -
00357     Purpose:    This is the base tag description function.
00358                 Record handler writers may as well update this func for new tags,
00359                 but the func is virtual, so if you want to override it, feel free.
00360     Errors:     -
00361     SeeAlso:    -
00362 
00363 ********************************************************************************************/
00364 
00365 
00366 #ifdef XAR_TREE_DIALOG
00367 void CXaraFileRecordHandler::GetTagText(UINT32 Tag,String_256& Str)
00368 {
00369     switch (Tag)
00370     {
00371         case TAG_UP                     : Str = _T("TAG_UP");                   break;
00372         case TAG_DOWN                   : Str = _T("TAG_DOWN");                 break;
00373         case TAG_FILEHEADER             : Str = _T("TAG_FILEHEADER");           break;
00374         case TAG_ENDOFFILE              : Str = _T("TAG_ENDOFFILE");            break;
00375         case TAG_STARTCOMPRESSION       : Str = _T("TAG_STARTCOMPRESSION");     break;
00376         case TAG_ENDCOMPRESSION         : Str = _T("TAG_ENDCOMPRESSION");       break;
00377         case TAG_DOCUMENT               : Str = _T("TAG_DOCUMENT");             break;
00378         case TAG_CHAPTER                : Str = _T("TAG_CHAPTER");              break;
00379         case TAG_SPREAD                 : Str = _T("TAG_SPREAD");               break;
00380         case TAG_LAYER                  : Str = _T("TAG_LAYER");                break;
00381         case TAG_PAGE                   : Str = _T("TAG_PAGE");                 break;
00382         case TAG_SPREADINFORMATION      : Str = _T("TAG_SPREADINFORMATION");    break;
00383         case TAG_GRIDRULERSETTINGS      : Str = _T("TAG_GRIDRULERSETTINGS");    break;
00384         case TAG_GRIDRULERORIGIN        : Str = _T("TAG_GRIDRULERORIGIN");      break;
00385         case TAG_LAYERDETAILS           : Str = _T("TAG_LAYERDETAILS");         break;
00386         case TAG_GUIDELAYERDETAILS      : Str = _T("TAG_GUIDELAYERDETAILS");    break;
00387         case TAG_GUIDELINE              : Str = _T("TAG_GUIDELINE");            break;
00388 
00389         case TAG_ATOMICTAGS             : Str = _T("TAG_ATOMICTAGS");           break;
00390         case TAG_ESSENTIALTAGS          : Str = _T("TAG_ESSENTIALTAG");         break;
00391         case TAG_TAGDESCRIPTION         : Str = _T("TAG_TAGDESCRIPTION");       break;
00392         case TAG_NONRENDERSECTION_START : Str = _T("TAG_NONRENDERSECTION_START");break;
00393         case TAG_NONRENDERSECTION_END   : Str = _T("TAG_NONRENDERSECTION_END"); break;
00394         case TAG_RENDERING_PAUSE        : Str = _T("TAG_RENDERING_PAUSE");      break;
00395         case TAG_RENDERING_RESUME       : Str = _T("TAG_RENDERING_RESUME");     break;
00396 
00397         case TAG_SPREADSCALING_ACTIVE   : Str = _T("TAG_SPREADSCALING_ACTIVE");     break;
00398         case TAG_SPREADSCALING_INACTIVE : Str = _T("TAG_SPREADSCALING_INACTIVE");   break;
00399 
00400         case TAG_DEFINERGBCOLOUR        : Str = _T("TAG_DEFINERGBCOLOUR");      break;
00401         case TAG_DEFINECOMPLEXCOLOUR    : Str = _T("TAG_DEFINECOMPLEXCOLOUR");  break;
00402 
00403         case TAG_PREVIEWBITMAP_BMP      : Str = _T("TAG_PREVIEWBITMAP_BMP");        break;
00404         case TAG_PREVIEWBITMAP_GIF      : Str = _T("TAG_PREVIEWBITMAP_GIF");        break;
00405         case TAG_PREVIEWBITMAP_JPEG     : Str = _T("TAG_PREVIEWBITMAP_JPEG");       break;
00406         case TAG_PREVIEWBITMAP_PNG      : Str = _T("TAG_PREVIEWBITMAP_PNG");        break;
00407         case TAG_PREVIEWBITMAP_TIFFLZW  : Str = _T("TAG_PREVIEWBITMAP_TIFFLZW");    break;
00408 
00409         case TAG_DEFINEBITMAP_BMP       : Str = _T("TAG_DEFINEBITMAP_BMP");     break;
00410         case TAG_DEFINEBITMAP_GIF       : Str = _T("TAG_DEFINEBITMAP_GIF");     break;
00411         case TAG_DEFINEBITMAP_JPEG      : Str = _T("TAG_DEFINEBITMAP_JPEG");    break;
00412         case TAG_DEFINEBITMAP_PNG       : Str = _T("TAG_DEFINEBITMAP_PNG");     break;
00413         case TAG_DEFINEBITMAP_BMPZIP    : Str = _T("TAG_DEFINEBITMAP_BMPZIP");  break;
00414         case TAG_DEFINESOUND_WAV        : Str = _T("TAG_DEFINESOUND_WAV");      break;
00415         case TAG_DEFINEBITMAP_JPEG8BPP  : Str = _T("TAG_DEFINEBITMAP_JPEG8BPP");    break;
00416 
00417         case TAG_VIEWPORT               : Str = _T("TAG_VIEWPORT");                 break;
00418         case TAG_VIEWQUALITY            : Str = _T("TAG_VIEWQUALITY");              break;
00419         case TAG_DOCUMENTVIEW           : Str = _T("TAG_DOCUMENTVIEW");             break;
00420 
00421         case TAG_DEFINE_PREFIXUSERUNIT  : Str = _T("TAG_DEFINE_PREFIXUSERUNIT");    break;
00422         case TAG_DEFINE_SUFFIXUSERUNIT  : Str = _T("TAG_DEFINE_SUFFIXUSERUNIT");    break;
00423         case TAG_DEFINE_DEFAULTUNITS    : Str = _T("TAG_DEFINE_DEFAULTUNITS");      break;
00424 
00425         case TAG_DOCUMENTCOMMENT        : Str = _T("TAG_DOCUMENTCOMMENT");          break;
00426         case TAG_DOCUMENTDATES          : Str = _T("TAG_DOCUMENTDATES");            break;
00427         case TAG_DOCUMENTUNDOSIZE       : Str = _T("TAG_DOCUMENTUNDOSIZE");         break;
00428         case TAG_DOCUMENTFLAGS          : Str = _T("TAG_DOCUMENTFLAGS");            break;
00429 
00430         case TAG_PATH                           : Str = _T("TAG_PATH");                         break;
00431         case TAG_PATH_FILLED                    : Str = _T("TAG_PATH_FILLED");                  break;
00432         case TAG_PATH_STROKED                   : Str = _T("TAG_PATH_STROKED");                 break;
00433         case TAG_PATH_FILLED_STROKED            : Str = _T("TAG_PATH_FILLED_STROKED");          break;
00434         case TAG_PATH_RELATIVE                  : Str = _T("TAG_PATH_RELATIVE");                break;
00435         case TAG_PATH_RELATIVE_FILLED           : Str = _T("TAG_PATH_RELATIVE_FILLED");         break;
00436         case TAG_PATH_RELATIVE_STROKED          : Str = _T("TAG_PATH_RELATIVE_STROKED");        break;
00437         case TAG_PATH_RELATIVE_FILLED_STROKED   : Str = _T("TAG_PATH_RELATIVE_FILLED_STROKED"); break;
00438         case TAG_PATH_FLAGS                     : Str = _T("TAG_PATH_FLAGS");                   break;
00439         case TAG_PATHREF_TRANSFORM              : Str = _T("TAG_PATHREF_TRANSFORM");            break;
00440         case TAG_GROUP                          : Str = _T("TAG_GROUP");                        break;
00441         case TAG_GROUPTRANSP                    : Str = _T("TAG_GROUPTRANSP");                  break;
00442         case TAG_CACHEDNODESGROUP               : Str = _T("TAG_CACHEDNODESGROUP");             break;
00443         case TAG_BLEND                          : Str = _T("TAG_BLEND");                        break;
00444         case TAG_BLENDER                        : Str = _T("TAG_BLENDER");                      break;
00445         case TAG_BLENDER_CURVEPROP              : Str = _T("TAG_BLENDER_CURVEPROP");            break;
00446         case TAG_BLENDER_CURVEANGLES            : Str = _T("TAG_BLENDER_CURVEANGLES");          break;
00447         case TAG_BLEND_PATH                     : Str = _T("TAG_BLEND_PATH");                   break;
00448 
00449         case TAG_MOULD_ENVELOPE                 : Str = _T("TAG_MOULD_ENVELOPE");               break;
00450         case TAG_MOULD_PERSPECTIVE              : Str = _T("TAG_MOULD_PERSPECTIVE");            break;
00451         case TAG_MOULD_GROUP                    : Str = _T("TAG_MOULD_GROUP");                  break;
00452         case TAG_MOULD_PATH                     : Str = _T("TAG_MOULD_PATH");                   break;
00453 
00454         case TAG_FLATFILL                           : Str = _T("TAG_FLATFILL");                             break;
00455         case TAG_FLATFILL_NONE                      : Str = _T("TAG_FLATFILL_NONE");                        break;
00456         case TAG_FLATFILL_BLACK                     : Str = _T("TAG_FLATFILL_BLACK");                       break;
00457         case TAG_FLATFILL_WHITE                     : Str = _T("TAG_FLATFILL_WHITE");                       break;
00458         case TAG_LINECOLOUR                         : Str = _T("TAG_LINECOLOUR");                           break;
00459         case TAG_LINECOLOUR_NONE                    : Str = _T("TAG_LINECOLOUR_NONE");                      break;
00460         case TAG_LINECOLOUR_BLACK                   : Str = _T("TAG_LINECOLOUR_BLACK");                     break;
00461         case TAG_LINECOLOUR_WHITE                   : Str = _T("TAG_LINECOLOUR_WHITE");                     break;
00462         case TAG_LINEWIDTH                          : Str = _T("TAG_LINEWIDTH");                            break;
00463         case TAG_LINEARFILL                         : Str = _T("TAG_LINEARFILL");                           break;
00464         case TAG_LINEARFILL3POINT                   : Str = _T("TAG_LINEARFILL3POINT");                     break;
00465         case TAG_LINEARFILLMULTISTAGE               : Str = _T("TAG_LINEARFILLMULTISTAGE");                 break;
00466         case TAG_LINEARFILLMULTISTAGE3POINT         : Str = _T("TAG_LINEARFILL3POINTMULTISTAGE");           break;
00467         case TAG_CIRCULARFILL                       : Str = _T("TAG_CIRCULARFILL");                         break;
00468         case TAG_ELLIPTICALFILL                     : Str = _T("TAG_ELLIPTICALFILL");                       break;
00469         case TAG_CONICALFILL                        : Str = _T("TAG_CONICALFILL");                          break;
00470         case TAG_SQUAREFILL                         : Str = _T("TAG_SQUAREFILL");                           break;
00471         case TAG_THREECOLFILL                       : Str = _T("TAG_THREECOLFILL");                         break;
00472         case TAG_FOURCOLFILL                        : Str = _T("TAG_FOURCOLFILL");                          break;
00473         case TAG_BITMAPFILL                         : Str = _T("TAG_BITMAPFILL");                           break;
00474         case TAG_CONTONEBITMAPFILL                  : Str = _T("TAG_CONTONEBITMAPFILL");                    break;
00475         case TAG_FRACTALFILL                        : Str = _T("TAG_FRACTALFILL");                          break;
00476         case TAG_NOISEFILL                          : Str = _T("TAG_NOISEFILL");                            break;
00477         case TAG_FILLEFFECT_FADE                    : Str = _T("TAG_FILLEFFECT_FADE");                      break;
00478         case TAG_FILLEFFECT_RAINBOW                 : Str = _T("TAG_FILLEFFECT_RAINBOW");                   break;
00479         case TAG_FILLEFFECT_ALTRAINBOW              : Str = _T("TAG_FILLEFFECT_ALTRAINBOW");                break;
00480         case TAG_FILL_REPEATING                     : Str = _T("TAG_FILL_REPEATING");                       break;
00481         case TAG_FILL_NONREPEATING                  : Str = _T("TAG_FILL_NONREPEATING");                    break;
00482         case TAG_FILL_REPEATINGINVERTED             : Str = _T("TAG_FILL_REPEATINGINVERTED");               break;
00483         case TAG_TRANSPARENTFILL_REPEATING          : Str = _T("TAG_TRANSPARENTFILL_REPEATING");            break;
00484         case TAG_TRANSPARENTFILL_NONREPEATING       : Str = _T("TAG_TRANSPARENTFILL_NONREPEATING");         break;
00485         case TAG_TRANSPARENTFILL_REPEATINGINVERTED  : Str = _T("TAG_TRANSPARENTFILL_REPEATINGINVERTED");    break;
00486         case TAG_FLATTRANSPARENTFILL                : Str = _T("TAG_FLATTRANSPARENTFILL");                  break;
00487         case TAG_LINEARTRANSPARENTFILL              : Str = _T("TAG_LINEARTRANSPARENTFILL");                break;
00488         case TAG_LINEARTRANSPARENTFILL3POINT        : Str = _T("TAG_LINEARTRANSPARENTFILL3POINT");          break;
00489         case TAG_CIRCULARTRANSPARENTFILL            : Str = _T("TAG_CIRCULARTRANSPARENTFILL");              break;
00490         case TAG_ELLIPTICALTRANSPARENTFILL          : Str = _T("TAG_ELLIPTICALTRANSPARENTFILL");            break;
00491         case TAG_CONICALTRANSPARENTFILL             : Str = _T("TAG_CONICALTRANSPARENTFILLL");              break;
00492         case TAG_SQUARETRANSPARENTFILL              : Str = _T("TAG_SQUARETRANSPARENTFILLL");               break;
00493         case TAG_THREECOLTRANSPARENTFILL            : Str = _T("TAG_THREECOLTRANSPARENTFILL");              break;
00494         case TAG_FOURCOLTRANSPARENTFILL             : Str = _T("TAG_FOURCOLTRANSPARENTFILL");               break;
00495         case TAG_BITMAPTRANSPARENTFILL              : Str = _T("TAG_BITMAPTRANSPARENTFILL");                break;
00496         case TAG_FRACTALTRANSPARENTFILL             : Str = _T("TAG_FRACTALTRANSPARENTFILL");               break;
00497         case TAG_NOISETRANSPARENTFILL               : Str = _T("TAG_NOISETRANSPARENTFILL");                 break;
00498         case TAG_LINETRANSPARENCY                   : Str = _T("TAG_LINETRANSPARENCY");                     break;
00499         case TAG_STARTCAP                           : Str = _T("TAG_STARTCAP");                             break;
00500         case TAG_ENDCAP                             : Str = _T("TAG_ENDCAP");                               break;
00501         case TAG_JOINSTYLE                          : Str = _T("TAG_JOINSTYLE");                            break;
00502         case TAG_MITRELIMIT                         : Str = _T("TAG_MITRELIMIT");                           break;
00503         case TAG_WINDINGRULE                        : Str = _T("TAG_WINDINGRULE");                          break;
00504         case TAG_QUALITY                            : Str = _T("TAG_QUALITY");                              break;
00505 
00506         case TAG_DASHSTYLE                          : Str = _T("TAG_DASHSTYLE");                                break;
00507         case TAG_DEFINEDASH                         : Str = _T("TAG_DEFINEDASH");                               break;
00508         case TAG_DEFINEDASH_SCALED                  : Str = _T("TAG_DEFINEDASH_SCALED");                                break;
00509         case TAG_ARROWHEAD                          : Str = _T("TAG_ARROWHEAD");                                break;
00510         case TAG_ARROWTAIL                          : Str = _T("TAG_ARROWTAIL");                                break;
00511         case TAG_DEFINEARROW                        : Str = _T("TAG_DEFINEARROW");                              break;
00512 
00513         case TAG_USERVALUE                          : Str = _T("TAG_USERVALUE");                                break;
00514 
00515         case TAG_NODE_BITMAP            : Str = _T("TAG_NODE_BITMAP");          break;
00516         case TAG_NODE_CONTONEDBITMAP    : Str = _T("TAG_NODE_CONTONEDBITMAP");  break;
00517 
00518         case TAG_ELLIPSE_SIMPLE                                 : Str = _T("TAG_ELLIPSE_SIMPLE");                               break;
00519         case TAG_ELLIPSE_COMPLEX                                : Str = _T("TAG_ELLIPSE_COMPLEX");                              break;
00520         case TAG_RECTANGLE_SIMPLE                               : Str = _T("TAG_RECTANGLE_SIMPLE");                             break;
00521         case TAG_RECTANGLE_SIMPLE_REFORMED                      : Str = _T("TAG_RECTANGLE_SIMPLE_REFORMED");                    break;
00522         case TAG_RECTANGLE_SIMPLE_STELLATED                     : Str = _T("TAG_RECTANGLE_SIMPLE_STELLATED");                   break;
00523         case TAG_RECTANGLE_SIMPLE_STELLATED_REFORMED            : Str = _T("TAG_RECTANGLE_SIMPLE_STELLATED_REFORMED");          break;
00524         case TAG_RECTANGLE_SIMPLE_ROUNDED                       : Str = _T("TAG_RECTANGLE_SIMPLE_ROUNDED");                     break;
00525         case TAG_RECTANGLE_SIMPLE_ROUNDED_REFORMED              : Str = _T("TAG_RECTANGLE_SIMPLE_ROUNDED_REFORMED");            break;
00526         case TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED             : Str = _T("TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED");           break;
00527         case TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED_REFORMED    : Str = _T("TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED_REFORMED");  break;
00528         case TAG_RECTANGLE_COMPLEX                              : Str = _T("TAG_RECTANGLE_COMPLEX");                            break;
00529         case TAG_RECTANGLE_COMPLEX_REFORMED                     : Str = _T("TAG_RECTANGLE_COMPLEX_REFORMED");                   break;
00530         case TAG_RECTANGLE_COMPLEX_STELLATED                    : Str = _T("TAG_RECTANGLE_COMPLEX_STELLATED");                  break;
00531         case TAG_RECTANGLE_COMPLEX_STELLATED_REFORMED           : Str = _T("TAG_RECTANGLE_COMPLEX_STELLATED_REFORMED");         break;
00532         case TAG_RECTANGLE_COMPLEX_ROUNDED                      : Str = _T("TAG_RECTANGLE_COMPLEX_ROUNDED");                    break;
00533         case TAG_RECTANGLE_COMPLEX_ROUNDED_REFORMED             : Str = _T("TAG_RECTANGLE_COMPLEX_ROUNDED_REFORMED");           break;
00534         case TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED            : Str = _T("TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED");          break;
00535         case TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED_REFORMED   : Str = _T("TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED_REFORMED"); break;
00536         case TAG_POLYGON_COMPLEX                                : Str = _T("TAG_POLYGON_COMPLEX");                              break;
00537         case TAG_POLYGON_COMPLEX_REFORMED                       : Str = _T("TAG_POLYGON_COMPLEX_REFORMED");                     break;
00538         case TAG_POLYGON_COMPLEX_STELLATED                      : Str = _T("TAG_POLYGON_COMPLEX_STELLATED");                    break;
00539         case TAG_POLYGON_COMPLEX_STELLATED_REFORMED             : Str = _T("TAG_POLYGON_COMPLEX_STELLATED_REFORMED");           break;
00540         case TAG_POLYGON_COMPLEX_ROUNDED                        : Str = _T("TAG_POLYGON_COMPLEX_ROUNDED");                      break;
00541         case TAG_POLYGON_COMPLEX_ROUNDED_REFORMED               : Str = _T("TAG_POLYGON_COMPLEX_ROUNDED_REFORMED");             break;
00542         case TAG_POLYGON_COMPLEX_ROUNDED_STELLATED              : Str = _T("TAG_POLYGON_COMPLEX_ROUNDED_STELLATED");            break;
00543         case TAG_POLYGON_COMPLEX_ROUNDED_STELLATED_REFORMED     : Str = _T("TAG_POLYGON_COMPLEX_ROUNDED_STELLATED_REFORMED");   break;
00544         case TAG_REGULAR_SHAPE_PHASE_1                  : Str = _T("TAG_REGULAR_SHAPE_GENERAL_PHASE_1");                break;
00545         case TAG_REGULAR_SHAPE_PHASE_2                  : Str = _T("TAG_REGULAR_SHAPE_GENERAL_PHASE_2");                break;
00546 
00547         case TAG_FONT_DEF_TRUETYPE              : Str=_T("TAG_FONT_DEF_TRUETYPE"); break;
00548         case TAG_FONT_DEF_ATM                   : Str=_T("TAG_FONT_DEF_ATM"); break;
00549 
00550         case TAG_TEXT_STORY_SIMPLE              : Str=_T("TAG_TEXT_STORY_SIMPLE"); break;
00551         case TAG_TEXT_STORY_COMPLEX             : Str=_T("TAG_TEXT_STORY_COMPLEX"); break;
00552         case TAG_TEXT_STORY_SIMPLE_START_LEFT   : Str=_T("TAG_TEXT_STORY_SIMPLE_START_LEFT"); break;
00553         case TAG_TEXT_STORY_SIMPLE_START_RIGHT  : Str=_T("TAG_TEXT_STORY_SIMPLE_START_RIGHT"); break;
00554         case TAG_TEXT_STORY_SIMPLE_END_LEFT     : Str=_T("TAG_TEXT_STORY_SIMPLE_END_LEFT"); break;
00555         case TAG_TEXT_STORY_SIMPLE_END_RIGHT    : Str=_T("TAG_TEXT_STORY_SIMPLE_END_RIGHT"); break;
00556         case TAG_TEXT_STORY_COMPLEX_START_LEFT  : Str=_T("TAG_TEXT_STORY_COMPLEX_START_LEFT"); break;
00557         case TAG_TEXT_STORY_COMPLEX_START_RIGHT : Str=_T("TAG_TEXT_STORY_COMPLEX_START_RIGHT"); break;
00558         case TAG_TEXT_STORY_COMPLEX_END_LEFT    : Str=_T("TAG_TEXT_STORY_COMPLEX_END_LEFT"); break;
00559         case TAG_TEXT_STORY_COMPLEX_END_RIGHT   : Str=_T("TAG_TEXT_STORY_COMPLEX_END_RIGHT"); break;
00560         case TAG_TEXT_STORY_WORD_WRAP_INFO      : Str=_T("TAG_TEXT_STORY_WORD_WRAP_INFO"); break;
00561         case TAG_TEXT_STORY_INDENT_INFO         : Str=_T("TAG_TEXT_STORY_INDENT_INFO"); break;
00562 
00563         case TAG_TEXT_LINE                      : Str=_T("TAG_TEXT_LINE"); break;
00564         case TAG_TEXT_STRING                    : Str=_T("TAG_TEXT_STRING"); break;
00565         case TAG_TEXT_CHAR                      : Str=_T("TAG_TEXT_CHAR"); break;
00566         case TAG_TEXT_EOL                       : Str=_T("TAG_TEXT_EOL"); break;
00567         case TAG_TEXT_KERN                      : Str=_T("TAG_TEXT_KERN"); break;
00568         case TAG_TEXT_CARET                     : Str=_T("TAG_TEXT_CARET"); break;
00569         case TAG_TEXT_LINE_INFO                 : Str=_T("TAG_TEXT_LINE_INFO"); break;
00570         case TAG_TEXT_TAB                       : Str=_T("TAG_TEXT_TAB"); break;
00571 
00572         case TAG_TEXT_LINESPACE_RATIO           : Str=_T("TAG_TEXT_LINESPACE_RATIO"); break;
00573         case TAG_TEXT_LINESPACE_ABSOLUTE        : Str=_T("TAG_TEXT_LINESPACE_ABSOLUTE"); break;
00574         case TAG_TEXT_JUSTIFICATION_LEFT        : Str=_T("TAG_TEXT_JUSTIFICATION_LEFT"); break;
00575         case TAG_TEXT_JUSTIFICATION_CENTRE      : Str=_T("TAG_TEXT_JUSTIFICATION_CENTRE"); break;
00576         case TAG_TEXT_JUSTIFICATION_RIGHT       : Str=_T("TAG_TEXT_JUSTIFICATION_RIGHT"); break;
00577         case TAG_TEXT_JUSTIFICATION_FULL        : Str=_T("TAG_TEXT_JUSTIFICATION_FULL"); break;
00578         case TAG_TEXT_FONT_SIZE                 : Str=_T("TAG_TEXT_FONT_SIZE"); break;
00579         case TAG_TEXT_FONT_TYPEFACE             : Str=_T("TAG_TEXT_FONT_TYPEFACE"); break;
00580         case TAG_TEXT_BOLD_ON                   : Str=_T("TAG_TEXT_BOLD_ON"); break;
00581         case TAG_TEXT_BOLD_OFF                  : Str=_T("TAG_TEXT_BOLD_OFF"); break;
00582         case TAG_TEXT_ITALIC_ON                 : Str=_T("TAG_TEXT_ITALIC_ON"); break;
00583         case TAG_TEXT_ITALIC_OFF                : Str=_T("TAG_TEXT_ITALIC_OFF"); break;
00584         case TAG_TEXT_UNDERLINE_ON              : Str=_T("TAG_TEXT_UNDERLINE_ON"); break;
00585         case TAG_TEXT_UNDERLINE_OFF             : Str=_T("TAG_TEXT_UNDERLINE_OFF"); break;
00586         case TAG_TEXT_SCRIPT_ON                 : Str=_T("TAG_TEXT_SCRIPT_ON"); break;
00587         case TAG_TEXT_SCRIPT_OFF                : Str=_T("TAG_TEXT_SCRIPT_OFF"); break;
00588         case TAG_TEXT_SUPERSCRIPT_ON            : Str=_T("TAG_TEXT_SUPERSCRIPT_ON"); break;
00589         case TAG_TEXT_SUBSCRIPT_ON              : Str=_T("TAG_TEXT_SUBSCRIPT_ON"); break;
00590         case TAG_TEXT_TRACKING                  : Str=_T("TAG_TEXT_TRACKING"); break;
00591         case TAG_TEXT_ASPECT_RATIO              : Str=_T("TAG_TEXT_ASPECT_RATIO"); break;
00592         case TAG_TEXT_BASELINE                  : Str=_T("TAG_TEXT_BASELINE"); break;
00593         case TAG_TEXT_LEFT_INDENT               : Str=_T("TAG_TEXT_LEFT_INDENT"); break;
00594         case TAG_TEXT_FIRST_INDENT              : Str=_T("TAG_TEXT_FIRST_INDENT"); break;
00595         case TAG_TEXT_RIGHT_INDENT              : Str=_T("TAG_TEXT_RIGHT_INDENT"); break;
00596         case TAG_TEXT_RULER                     : Str=_T("TAG_TEXT_RULER"); break;
00597 
00598         case TAG_OVERPRINTLINEON                : Str=_T("TAG_OVERPRINTLINEON"); break;
00599         case TAG_OVERPRINTLINEOFF               : Str=_T("TAG_OVERPRINTLINEOFF"); break;
00600         case TAG_OVERPRINTFILLON                : Str=_T("TAG_OVERPRINTFILLON"); break;
00601         case TAG_OVERPRINTFILLOFF               : Str=_T("TAG_OVERPRINTFILLOFF"); break;
00602         case TAG_PRINTONALLPLATESON             : Str=_T("TAG_PRINTONALLPLATESON"); break;
00603         case TAG_PRINTONALLPLATESOFF            : Str=_T("TAG_PRINTONALLPLATESOFF"); break;
00604 
00605         case TAG_PRINTERSETTINGS                : Str=_T("TAG_PRINTERSETTINGS"); break;
00606         case TAG_IMAGESETTING                   : Str=_T("TAG_IMAGESETTING"); break;
00607         case TAG_COLOURPLATE                    : Str=_T("TAG_COLOURPLATE"); break;
00608 
00609         case TAG_PRINTMARKDEFAULT               : Str=_T("TAG_PRINTMARKDEFAULT"); break;
00610         case TAG_PRINTMARKCUSTOM                : Str=_T("TAG_PRINTMARKCUSTOM"); break;
00611 
00612         // Version 2 tags //////////////////////////////////////////////////////////////////
00613         case TAG_VARIABLEWIDTHFUNC              : Str=_T("TAG_VARIABLEWIDTHFUNC"); break;
00614         case TAG_VARIABLEWIDTHTABLE             : Str=_T("TAG_VARIABLEWIDTHTABLE"); break;
00615         case TAG_STROKETYPE                     : Str=_T("TAG_STROKETYPE"); break;
00616         case TAG_STROKEDEFINITION               : Str=_T("TAG_STROKEDEFINITION"); break;
00617         case TAG_STROKEAIRBRUSH                 : Str=_T("TAG_STROKEAIRBRUSH"); break;
00618 
00619         case TAG_PATHREF_IDENTICAL              : Str = _T("TAG_PATHREF_IDENTICAL"); break;
00620         case TAG_WEBADDRESS                     : Str = _T("TAG_WEBADDRESS"); break;
00621         case TAG_WEBADDRESS_BOUNDINGBOX         : Str = _T("TAG_WEBADDRESS_BOUNDINGBOX"); break;
00622 
00623         case TAG_EXPORT_HINT                    : Str = _T("TAG_EXPORT_HINT"); break;
00624 
00625         case TAG_WIZOP                          : Str = _T("TAG_WIZOP"); break;
00626         case TAG_WIZOP_STYLE                    : Str = _T("TAG_WIZOP_STYLE"); break;
00627         case TAG_WIZOP_STYLEREF                 : Str = _T("TAG_WIZOP_STYLEREF"); break;
00628 
00629         case TAG_LAYER_FRAMEPROPS               : Str = _T("TAG_LAYER_FRAMEPROPS"); break;
00630         case TAG_SPREAD_ANIMPROPS               : Str = _T("TAG_SPREAD_ANIMPROPS"); break;
00631 
00632         case TAG_SHADOWCONTROLLER               : Str = _T("TAG_SHADOWCONTROLLER"); break;
00633         case TAG_SHADOW                         : Str = _T("TAG_SHADOW"); break;
00634 
00635         case TAG_SETSENTINEL                    : Str = _T("TAG_SETSENTINEL"); break;
00636         case TAG_SETPROPERTY                    : Str = _T("TAG_SETPROPERTY"); break;
00637 
00638         case TAG_NAMEGAL_DOCCOMP                : Str = _T("TAG_NAMEGAL_DOCCOMP"); break;
00639 
00640         case TAG_XPE_BITMAP_PROPERTIES          : Str = _T("TAG_XPE_BITMAP_PROPERTIES"); break;
00641 
00642         case TAG_DEFINEBITMAP_XPE               : Str = _T("TAG_DEFINEBITMAP_XPE"); break;
00643 
00644         case TAG_CURRENTATTRIBUTES              : Str = _T("TAG_CURRENTATTRIBUTES"); break;
00645 
00646         case TAG_CURRENTATTRIBUTEBOUNDS         : Str = _T("TAG_CURRENTATTRIBUTEBOUNDS"); break;
00647 
00648         case TAG_LIVE_EFFECT                    : Str = _T("TAG_LIVE_EFFECT"); break;
00649         case TAG_LOCKED_EFFECT                  : Str = _T("TAG_LOCKED_EFFECT"); break;
00650         case TAG_FEATHER_EFFECT                 : Str = _T("TAG_FEATHER_EFFECT"); break;
00651 
00652         case TAG_BRUSHATTR                      : Str = _T("TAG_BRUSHATTR"); break;
00653         case TAG_BRUSHDEFINITION                : Str = _T("TAG_BRUSHDEFINITION"); break;
00654         case TAG_BRUSHDATA                      : Str = _T("TAG_BRUSHDATA"); break;
00655         case TAG_MOREBRUSHDATA                  : Str = _T("TAG_MOREBRUSHDATA"); break;
00656         case TAG_MOREBRUSHATTR                  : Str = _T("TAG_MOREBRUSHATTR"); break;
00657         case TAG_BITMAP_PROPERTIES              : Str = _T("TAG_BITMAP_PROPERTIES"); break;
00658         case TAG_EVENMOREBRUSHDATA              : Str = _T("TAG_EVENMOREBRUSHDATA"); break;
00659         case TAG_EVENMOREBRUSHATTR              : Str = _T("TAG_EVENMOREBRUSHATTR"); break;
00660         case TAG_TIMESTAMPBRUSHDATA             : Str = _T("TAG_TIMESTAMPBRUSHDATA"); break;
00661         case TAG_BRUSHPRESSUREINFO              : Str = _T("TAG_BRUSHPRESSUREINFO"); break;
00662         case TAG_BRUSHPRESSUREDATA              : Str = _T("TAG_BRUSHPRESSUREDATA"); break;
00663         case TAG_BRUSHATTRPRESSUREINFO          : Str = _T("TAG_BRUSHATTRPRESSUREINFO"); break;
00664         case TAG_BRUSHCOLOURDATA                : Str = _T("TAG_BRUSHCOLOURDATA"); break;
00665         case TAG_BRUSHPRESSURESAMPLEDATA        : Str = _T("TAG_BRUSHPRESSURESAMPLEDATA"); break;
00666         case TAG_BRUSHTIMESAMPLEDATA            : Str = _T("TAG_BRUSHTIMESAMPLEDATA"); break;
00667         case TAG_BRUSHATTRFILLFLAGS             : Str = _T("TAG_BRUSHATTRFILLFLAGS"); break;
00668         case TAG_BRUSHTRANSPINFO                : Str = _T("TAG_BRUSHTRANSPINFO"); break;
00669         case TAG_BRUSHATTRTRANSPINFO            : Str = _T("TAG_BRUSHATTRTRANSPINFO"); break;
00670 
00671         case TAG_DOCUMENTNUDGE                  : Str = _T("TAG_DOCUMENTNUDGE"); break;
00672         case TAG_DOCUMENTBITMAPSMOOTHING        : Str = _T("TAG_DOCUMENTBITMAPSMOOTHING"); break;
00673         case TAG_DUPLICATIONOFFSET              : Str = _T("TAG_DUPLICATIONOFFSET"); break;
00674 
00675         case TAG_FEATHER                        : Str = _T("TAG_FEATHER"); break;
00676         case TAG_BARPROPERTY                    : Str = _T("TAG_BARPROPERTY"); break;
00677 
00678         case TAG_COMPOUNDRENDER                 : Str = _T("TAG_COMPOUNDRENDER"); break;
00679         case TAG_OBJECTBOUNDS                   : Str = _T("TAG_OBJECTBOUNDS"); break;
00680 
00681         default:
00682         {
00683             TCHAR s[256];
00684             camSprintf(s, _T("*%d"), Tag);
00685             Str = s;
00686         }
00687         break;
00688     }
00689 }
00690 #endif
00691 
00692 /********************************************************************************************
00693 
00694 >   virtual void CXaraFileRecordHandler::GetRecordDescriptionText(CXaraFileRecord* pRecord,StringBase* pStr)
00695 
00696     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00697     Created:    12/6/96
00698     Inputs:     pRecord = ptr to a record
00699                 pStr = ptr to string to update
00700     Returns:    -
00701     Purpose:    This is the base class record description generator.
00702                 Adds the Tag & Size items to the string, so derived classes should call the base class version
00703                 first.
00704     Errors:     -
00705     SeeAlso:    -
00706 
00707 ********************************************************************************************/
00708 
00709 #ifdef XAR_TREE_DIALOG
00710 void CXaraFileRecordHandler::GetRecordDescriptionText(CXaraFileRecord* pRecord,StringBase* pStr)
00711 {
00712     if (pStr == NULL || pRecord == NULL)
00713         return;
00714 
00715     String_256 TagText;
00716     GetTagText(pRecord->GetTag(),TagText);
00717     TCHAR* pTagText = TagText;
00718 
00719     TCHAR s[256];
00720     camSprintf(s, _T("Record Number = %d\r\nTag = %d (%s)\r\nSize = %d\r\n\r\n"), pRecord->GetRecordNumber(),pRecord->GetTag(),pTagText,pRecord->GetSize());
00721     (*pStr) += s;
00722 }
00723 #endif
00724 
00725 /********************************************************************************************
00726 
00727 >   virtual void CXaraFileRecordHandler::GetRecordInfo(CXaraFileRecord *pRecord, StringBase *pStr)
00728 
00729     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00730     Created:    19/07/96
00731     Inputs:     pRecord - CXaraFileRecord to read information from
00732                 pStr    - StringBase to write information to
00733     Returns:    -
00734     Purpose:    Gathers basic information about the record, tag number, record number and
00735                 record size and writes it to pStr.
00736 
00737 ********************************************************************************************/
00738 
00739 #ifdef XAR_TREE_DIALOG
00740 void CXaraFileRecordHandler::GetRecordInfo(CXaraFileRecord *pCXaraFileRecord, StringBase *pStr)
00741 {
00742     String_256 TagText;
00743     GetTagText(pCXaraFileRecord->GetTag(),TagText);
00744     TCHAR* pTagText = TagText;
00745 
00746     TCHAR s[256];
00747 
00748     camSprintf(s, _T("Record Number = %d\r\n"), pCXaraFileRecord->GetRecordNumber());
00749     (*pStr) += s;
00750     camSprintf(s, _T("Tag = %d (%s)\r\n"), pCXaraFileRecord->GetTag(),pTagText);
00751     (*pStr) += s;
00752     camSprintf(s, _T("Size = %d\r\n\r\n"), pCXaraFileRecord->GetSize());
00753     (*pStr) += s;
00754 }
00755 #endif
00756 
00757 /********************************************************************************************
00758 
00759 >   virtual void CXaraFileRecordHandler::DescribePath(CXaraFileRecord* pRecord,StringBase* pStr)
00760 
00761     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00762     Created:    19/7/96
00763     Inputs:     pRecord = ptr to a record
00764                 pStr = ptr to string to update
00765     Returns:    -
00766     Purpose:    This reads data from the record, assuming that the record contains a standard path
00767                 definition.
00768 
00769                 A description of the path is appended to pStr;
00770     Errors:     -
00771     SeeAlso:    -
00772 
00773 ********************************************************************************************/
00774 
00775 #ifdef XAR_TREE_DIALOG
00776 void CXaraFileRecordHandler::DescribePath(CXaraFileRecord* pRecord,StringBase* pStr)
00777 {
00778     if (pStr == NULL || pRecord == NULL)
00779         return;
00780 
00781     TCHAR s[256];
00782 
00783     INT32 NumCoords;
00784     pRecord->ReadINT32(&NumCoords);
00785     camSprintf(s,_T("Number of Coords = %d\r\n\r\n"),NumCoords);
00786     (*pStr) += s;
00787 
00788     if (NumCoords < 1)
00789         return;
00790 
00791     INT32 i;
00792 
00793     PathVerb* pVerb  = (PathVerb*)CCMalloc(NumCoords*sizeof(PathVerb));
00794     DocCoord* pCoord = (DocCoord*)CCMalloc(NumCoords*sizeof(DocCoord));
00795 
00796     if (pVerb == NULL || pCoord == NULL)
00797         return;
00798 
00799     for (i=0;i<NumCoords;i++)
00800         pRecord->ReadBYTE(pVerb+i);
00801 
00802     for (i=0;i<NumCoords;i++)
00803         pRecord->ReadCoord(pCoord+i);
00804 
00805     (*pStr) += _T("Num\tVerb\tX Coord\tY Coord\r\n");
00806 
00807     for (i=0;i<NumCoords;i++)
00808     {
00809         camSprintf(s, _T("%d\t%d\t%d\t%d\r\n"),i,pVerb[i],pCoord[i].x,pCoord[i].y);
00810         (*pStr) += s;
00811     }
00812 
00813     CCFree(pVerb);
00814     CCFree(pCoord);
00815 }
00816 #endif // _DEBUG
00817 
00818 /********************************************************************************************
00819 
00820 >   virtual void CXaraFileRecordHandler::DescribePathRelative(CXaraFileRecord* pRecord,StringBase* pStr)
00821 
00822     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00823     Created:    19/7/96
00824     Inputs:     pRecord = ptr to a record
00825                 pStr = ptr to string to update
00826     Returns:    -
00827     Purpose:    This reads data from the record, assuming that the record contains a standard path
00828                 definition in relative coord form.
00829 
00830                 A description of the path is appended to pStr;
00831     Errors:     -
00832     SeeAlso:    -
00833 
00834 ********************************************************************************************/
00835 
00836 #ifdef XAR_TREE_DIALOG
00837 void CXaraFileRecordHandler::DescribePathRelative(CXaraFileRecord* pRecord,StringBase* pStr)
00838 {
00839     if (pStr == NULL || pRecord == NULL)
00840         return;
00841 
00842     TCHAR s[256];
00843 
00844     INT32 NumCoords = INT32(pRecord->GetSize())/(sizeof(BYTE)+sizeof(INT32)+sizeof(INT32));
00845     camSprintf(s, _T("Number of Coords = %d\r\n\r\n"),NumCoords);
00846     (*pStr) += s;
00847 
00848     if (NumCoords < 1)
00849         return;
00850 
00851     INT32 i;
00852 
00853     PathVerb* pVerb  = (PathVerb*)CCMalloc(NumCoords*sizeof(PathVerb));
00854     DocCoord* pCoord = (DocCoord*)CCMalloc(NumCoords*sizeof(DocCoord));
00855 
00856     if (pVerb == NULL || pCoord == NULL)
00857         return;
00858 
00859     (*pStr) += _T("Num\tVerb\tX Coord\tY Coord\tRel x\tRel y\r\n");
00860 
00861     DocCoord PrevCoord;
00862 
00863     for (i=0;i<NumCoords;i++)
00864     {
00865         pRecord->ReadBYTE(pVerb+i);
00866 
00867         if (i == 0)
00868         {
00869             pRecord->ReadCoordInterleaved(&PrevCoord);
00870             camSprintf(s, _T("%d\t%d\t%d\t%d\t%d\t%d\r\n"),i,pVerb[0],PrevCoord.x,PrevCoord.y,0,0);
00871             (*pStr) += s;
00872         }
00873         else
00874         {
00875             DocCoord TempCoord;
00876             pRecord->ReadCoordTransInterleaved(&TempCoord,0,0);
00877 
00878 //          INT32 RelX,RelY;
00879 //          pRecord->ReadINT32(&RelX);
00880 //          pRecord->ReadINT32(&RelY);
00881 
00882             PrevCoord.x -= TempCoord.x;
00883             PrevCoord.y -= TempCoord.y;
00884 
00885             camSprintf(s,_T("%d\t%d\t%d\t%d\t%x\t%x\r\n"),i,pVerb[i],PrevCoord.x,PrevCoord.y,TempCoord.x,TempCoord.y);
00886             (*pStr) += s;
00887         }
00888     }
00889 
00890     CCFree(pVerb);
00891     CCFree(pCoord);
00892 }
00893 #endif // _DEBUG
00894 
00895 //------------------------------------------------------------------------------
00896 //------------------------------------------------------------------------------
00897 //------------------------------------------------------------------------------
00898 
00899 /********************************************************************************************
00900 
00901 >   CamelotRecordHandler::CamelotRecordHandler()
00902 
00903     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00904     Created:    28/5/96
00905     Inputs:     -
00906     Purpose:    Creates a camelot record handler object.
00907                 These are used by CXaraFile for reading the file.
00908                 Handlers handle records as they are read from a file.
00909 
00910                 This is a special varient that contains Camelot-specific functionality
00911         
00912     Errors:     -
00913     SeeAlso:    Init()
00914 
00915 ********************************************************************************************/
00916 
00917 CamelotRecordHandler::CamelotRecordHandler()
00918 {
00919 #if !defined(EXCLUDE_FROM_XARLIB)
00920     pBaseCamelotFilter = NULL;
00921 #else
00922     m_pCXFile = NULL;
00923 #endif
00924 }
00925 
00926 /********************************************************************************************
00927 
00928 >   CamelotRecordHandler::~CamelotRecordHandler()
00929 
00930     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00931     Created:    28/5/96
00932     Purpose:    Default destructor
00933     Errors:     -
00934     SeeAlso:    -
00935 
00936 ********************************************************************************************/
00937 
00938 CamelotRecordHandler::~CamelotRecordHandler()
00939 {
00940 }
00941 
00942 
00943 /********************************************************************************************
00944 
00945 >   virtual BOOL CamelotRecordHandler::Init(BaseCamelotFilter* pThisBaseCamelotFilter)
00946 
00947     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00948     Created:    28/5/96
00949     Inputs:     pThisBaseCamelotFilter = ptr to the filter that will read the file.
00950     Returns:    TRUE if ok
00951                 FALSE otherwise
00952     Purpose:    Initialises the handler.
00953     
00954                 The base class forms a link between the handler and the filter class
00955 
00956                 If you override this func, be sure to call the base class varient
00957     Errors:     -
00958     SeeAlso:    -
00959 
00960 ********************************************************************************************/
00961 
00962 #if !defined(EXCLUDE_FROM_XARLIB)
00963 BOOL CamelotRecordHandler::Init(BaseCamelotFilter* pThisBaseCamelotFilter)
00964 {
00965     ERROR2IF(pThisBaseCamelotFilter == NULL,FALSE,"pThisBaseCamelotFilter is NULL");
00966 
00967     pBaseCamelotFilter = pThisBaseCamelotFilter;
00968 
00969     return TRUE;
00970 }
00971 #else
00972 BOOL CamelotRecordHandler::Init(CXaraFile* pCXFile)
00973 {
00974     ERROR2IF(pCXFile == NULL,FALSE,"pCXFile is NULL");
00975 
00976     m_pCXFile = pCXFile;
00977 
00978     return TRUE;
00979 }
00980 #endif
00981 
00982 /********************************************************************************************
00983 
00984 >   virtual BOOL CamelotRecordHandler::IsStreamed(UINT32 Tag)
00985 
00986     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
00987     Created:    7/6/96
00988     Inputs:     The tag of the record
00989     Returns:    TRUE if this is a streamed record
00990                 FALSE otherwise
00991     Purpose:    Function to find out if the record is streamed or not.
00992     Errors:     -
00993     SeeAlso:    -
00994 
00995 ********************************************************************************************/
00996 
00997 BOOL CamelotRecordHandler::IsStreamed(UINT32 Tag)
00998 {
00999     // Baseclass returns False, i.e. not streamed
01000     return FALSE;
01001 }
01002 
01003 /********************************************************************************************
01004 
01005 >   BOOL CamelotRecordHandler::SetCompression(BOOL NewState)
01006 
01007     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01008     Created:    6/6/96
01009     Inputs:     The new compression state required, True for on, False for off
01010     Returns:    TRUE if ok
01011                 FALSE otherwise
01012     Purpose:    Function to turn Compression on or off on the underlying CCFile.
01013     Errors:     -
01014     SeeAlso:    -
01015 
01016 ********************************************************************************************/
01017 
01018 BOOL CamelotRecordHandler::SetCompression(BOOL NewState)
01019 {
01020 #if !defined(EXCLUDE_FROM_XARLIB)
01021     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"CamelotRecordHandler::SetCompression pBaseCamelotFilter is NULL");
01022     
01023     return pBaseCamelotFilter->SetCompression(NewState);
01024 #else
01025     ERROR2IF(m_pCXFile == NULL,FALSE,"CamelotRecordHandler::SetCompression m_pCXFile is NULL");
01026     
01027     return m_pCXFile->SetCompression(NewState);
01028 #endif
01029 }
01030 
01031 #if !defined(EXCLUDE_FROM_XARLIB)
01032 /********************************************************************************************
01033 
01034 >   virtual BOOL CamelotRecordHandler::GetDocColour(INT32 ColourRef,DocColour* pDocColour)
01035 
01036     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
01037     Created:    31/5/96
01038     Inputs:     ColourRef  = a reference to a colour defined earlier in the file
01039                 pDocColour = ptr to a DocColour object
01040     Returns:    TRUE if ok
01041                 FALSE otherwise
01042     Purpose:    This dereferences a colour ref value, and creates a DocColour from it.
01043                 The resultant DocColour is put into pDocColour.
01044 
01045                 The ColourRef value is typically found in records that define a colour or colours.
01046                 It references a colour defined earlier in the file.
01047     Errors:     -
01048     SeeAlso:    -
01049 
01050 ********************************************************************************************/
01051 
01052 BOOL CamelotRecordHandler::GetDocColour(INT32 ColourRef,DocColour* pDocColour)
01053 {
01054     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01055     ERROR2IF(pDocColour == NULL,FALSE,"pDocColour param is NULL");
01056 
01057     ColourListComponent* pColComp = pBaseCamelotFilter->GetColourDocComponent();
01058 
01059     ERROR2IF(pColComp == NULL,FALSE,"No colour component when getting a colour");
01060 
01061     return (pColComp->GetDocColour(ColourRef,pDocColour));
01062 }
01063 
01064 /********************************************************************************************
01065 
01066 >   KernelBitmap* CamelotRecordHandler::GetReadBitmapReference(INT32 BitmapRef)
01067 
01068     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01069     Created:    12/6/96
01070     Inputs:     BitmapRef   = a reference to a colour defined earlier in the file
01071     Outputs:    -
01072     Returns:    pBitmap     = ptr to a KernelBitmap object
01073     Purpose:    This dereferences a bitmap ref value, and returns a pointer to a KernelBitmap
01074                 from it.
01075                 The resultant KernelBitmap can then be used by the caller e.g. in fills.
01076 
01077                 The BitmapRef value is typically found in records that define a bitmap.
01078                 It references a bitmap defined earlier in the file.
01079     Errors:     -
01080     SeeAlso:    -
01081 
01082 ********************************************************************************************/
01083 
01084 KernelBitmap* CamelotRecordHandler::GetReadBitmapReference(INT32 BitmapRef)
01085 {
01086     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01087 
01088     BitmapListComponent* pBmpComp = pBaseCamelotFilter->GetBitmapDocComponent();
01089 
01090     ERROR2IF(pBmpComp == NULL,FALSE,"No bitmap component when getting a bitmap");
01091 
01092     return (pBmpComp->GetReadBitmapReference(BitmapRef));
01093 }
01094 
01095 //------------------------------------------------------------------------------------------
01096 // The following functions map onto functions provided by BaseCamelotFilter
01097 //
01098 // For more details, see the headers of the BaseCamelotFilter func equivalents
01099 
01100 ColourListComponent* CamelotRecordHandler::GetColourDocComponent()
01101 {
01102     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01103     return (pBaseCamelotFilter->GetColourDocComponent());
01104 }
01105 
01106 BitmapListComponent* CamelotRecordHandler::GetBitmapDocComponent()
01107 {
01108     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01109     return (pBaseCamelotFilter->GetBitmapDocComponent());
01110 }
01111 
01112 UnitListComponent* CamelotRecordHandler::GetUnitDocComponent()
01113 {
01114     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01115     return (pBaseCamelotFilter->GetUnitDocComponent());
01116 }
01117 
01118 DocInfoComponent* CamelotRecordHandler::GetDocInfoComponent()
01119 {
01120     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01121     return (pBaseCamelotFilter->GetDocInfoComponent());
01122 }
01123 
01124 PrintComponent* CamelotRecordHandler::GetPrintComponent()
01125 {
01126     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01127     return (pBaseCamelotFilter->GetPrintComponent());
01128 }
01129 
01130 FontComponent* CamelotRecordHandler::GetFontComponent()
01131 {
01132     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01133     return (pBaseCamelotFilter->GetFontComponent());
01134 }
01135 
01136 BOOL CamelotRecordHandler::IsImportingAtPosition()
01137 {
01138     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01139     return (pBaseCamelotFilter->IsImportingAtPosition());
01140 }
01141 
01142 BOOL CamelotRecordHandler::IsImporting()
01143 {
01144     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01145     return (pBaseCamelotFilter->IsImporting());
01146 }
01147 
01148 BOOL CamelotRecordHandler::InsertNode(Node* pNode)
01149 {
01150     ERROR2IF(pBaseCamelotFilter == NULL,FALSE,"pBaseCamelotFilter is NULL");
01151     return (pBaseCamelotFilter->InsertNode(pNode));
01152 }
01153 
01154 void CamelotRecordHandler::EndOfFile()
01155 {
01156     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01157     if (pBaseCamelotFilter != NULL)
01158         pBaseCamelotFilter->EndOfFile();
01159 }
01160 
01161 void CamelotRecordHandler::SetTotalNumBytesToRead(UINT32 s)
01162 {
01163     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01164     if (pBaseCamelotFilter != NULL)
01165         pBaseCamelotFilter->SetTotalNumBytesToRead(s);
01166 }
01167 
01168 void CamelotRecordHandler::IncProgressBarCount(UINT32 n)
01169 {
01170     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01171     if (pBaseCamelotFilter != NULL)
01172         pBaseCamelotFilter->IncProgressBarCount(n);
01173 }
01174 
01175 void CamelotRecordHandler::SetTotalProgressBarCount(UINT32 n)
01176 {
01177     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01178     if (pBaseCamelotFilter != NULL)
01179         pBaseCamelotFilter->SetTotalProgressBarCount(n);
01180 }
01181 
01182 BOOL CamelotRecordHandler::IncInsertLevel()
01183 {
01184     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01185     if (pBaseCamelotFilter != NULL)
01186         return pBaseCamelotFilter->IncInsertLevel();
01187 
01188     return FALSE;
01189 }
01190 
01191 BOOL CamelotRecordHandler::DecInsertLevel()
01192 {
01193     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01194     if (pBaseCamelotFilter != NULL)
01195         return pBaseCamelotFilter->DecInsertLevel();
01196 
01197     return FALSE;
01198 }
01199 
01200 Node* CamelotRecordHandler::GetInsertContextNode()
01201 {
01202     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01203     if (pBaseCamelotFilter != NULL)
01204         return pBaseCamelotFilter->GetInsertContextNode();
01205 
01206     return NULL;
01207 }
01208 
01209 void CamelotRecordHandler::SetInsertContextNode(Node* pNode)
01210 {
01211     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01212     if (pBaseCamelotFilter != NULL)
01213         pBaseCamelotFilter->SetInsertContextNode(pNode);
01214 }
01215 
01216 void CamelotRecordHandler::InsertNextNodeAsChild()
01217 {
01218     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01219     if (pBaseCamelotFilter != NULL)
01220         pBaseCamelotFilter->InsertNextNodeAsChild();
01221 }
01222 
01223 void CamelotRecordHandler::InsertNextNodeAsSibling()
01224 {
01225     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01226     if (pBaseCamelotFilter != NULL)
01227         pBaseCamelotFilter->InsertNextNodeAsSibling();
01228 }
01229 
01230 
01231 InsertTreeContext *CamelotRecordHandler::GetInsertContext(void)
01232 {
01233     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01234     if (pBaseCamelotFilter != NULL)
01235         return(pBaseCamelotFilter->GetInsertContext());
01236 
01237     return(NULL);
01238 }
01239 
01240 void CamelotRecordHandler::RestoreInsertContext(InsertTreeContext *pOldState)
01241 {
01242     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01243     if (pBaseCamelotFilter != NULL)
01244         pBaseCamelotFilter->RestoreInsertContext(pOldState);
01245 }
01246 
01247 
01248 Document* CamelotRecordHandler::GetDocument()
01249 {
01250     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01251     if (pBaseCamelotFilter != NULL)
01252         return pBaseCamelotFilter->GetDocument();
01253 
01254     return NULL;
01255 }
01256 
01257 Spread* CamelotRecordHandler::GetSpread()
01258 {
01259     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01260     if (pBaseCamelotFilter != NULL)
01261         return pBaseCamelotFilter->GetSpread();
01262 
01263     return NULL;
01264 }
01265 
01266 Document* CamelotRecordHandler::GetLastDocumentInserted()
01267 {
01268     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01269     if (pBaseCamelotFilter != NULL)
01270         return pBaseCamelotFilter->GetLastDocumentInserted();
01271 
01272     return NULL;
01273 }
01274 
01275 Chapter* CamelotRecordHandler::GetLastChapterInserted()
01276 {
01277     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01278     if (pBaseCamelotFilter != NULL)
01279         return pBaseCamelotFilter->GetLastChapterInserted();
01280 
01281     return NULL;
01282 }
01283 
01284 Spread* CamelotRecordHandler::GetLastSpreadInserted()
01285 {
01286     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01287     if (pBaseCamelotFilter != NULL)
01288         return pBaseCamelotFilter->GetLastSpreadInserted();
01289 
01290     return NULL;
01291 }
01292 
01293 Layer* CamelotRecordHandler::GetLastLayerInserted()
01294 {
01295     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01296     if (pBaseCamelotFilter != NULL)
01297         return pBaseCamelotFilter->GetLastLayerInserted();
01298 
01299     return NULL;
01300 }
01301 
01302 NodePath* CamelotRecordHandler::GetLastNodePathInserted()
01303 {
01304     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01305     if (pBaseCamelotFilter != NULL)
01306         return pBaseCamelotFilter->GetLastNodePathInserted();
01307 
01308     return NULL;
01309 }
01310 
01311 void CamelotRecordHandler::SetLastDocumentInserted(Document* pNode)
01312 {
01313     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01314     if (pBaseCamelotFilter != NULL)
01315         pBaseCamelotFilter->SetLastDocumentInserted(pNode);
01316 }
01317 
01318 void CamelotRecordHandler::SetLastChapterInserted(Chapter* pNode)
01319 {
01320     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01321     if (pBaseCamelotFilter != NULL)
01322         pBaseCamelotFilter->SetLastChapterInserted(pNode);
01323 }
01324 
01325 void CamelotRecordHandler::SetLastSpreadInserted(Spread* pNode)
01326 {
01327     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01328     if (pBaseCamelotFilter != NULL)
01329         pBaseCamelotFilter->SetLastSpreadInserted(pNode);
01330 }
01331 
01332 void CamelotRecordHandler::SetLastLayerInserted(Layer* pNode)
01333 {
01334     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01335     if (pBaseCamelotFilter != NULL)
01336         pBaseCamelotFilter->SetLastLayerInserted(pNode);
01337 }
01338 
01339 void CamelotRecordHandler::SetLastNodePathInserted(NodePath* pNode)
01340 {
01341     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01342     if (pBaseCamelotFilter != NULL)
01343         pBaseCamelotFilter->SetLastNodePathInserted(pNode);
01344 }
01345 
01346 Layer * CamelotRecordHandler::GetFirstImportedLayer()
01347 {
01348     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01349     if (pBaseCamelotFilter != NULL)
01350         return pBaseCamelotFilter->GetFirstImportedLayer();
01351     return NULL;
01352 }
01353 
01354 void CamelotRecordHandler::SetFirstImportedLayer(Layer* pNode)
01355 {
01356     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01357     if (pBaseCamelotFilter != NULL)
01358         pBaseCamelotFilter->SetFirstImportedLayer(pNode);
01359 }
01360 
01361 UINT32 CamelotRecordHandler::GetDocumentInsertedCount()
01362 {
01363     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01364     if (pBaseCamelotFilter != NULL)
01365         return pBaseCamelotFilter->GetDocumentInsertedCount();
01366 
01367     return 0;
01368 }
01369 
01370 UINT32 CamelotRecordHandler::GetChapterInsertedCount()
01371 {
01372     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01373     if (pBaseCamelotFilter != NULL)
01374         return pBaseCamelotFilter->GetChapterInsertedCount();
01375 
01376     return 0;
01377 }
01378 
01379 UINT32 CamelotRecordHandler::GetSpreadInsertedCount()
01380 {
01381     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01382     if (pBaseCamelotFilter != NULL)
01383         return pBaseCamelotFilter->GetSpreadInsertedCount();
01384 
01385     return 0;
01386 }
01387 
01388 UINT32 CamelotRecordHandler::GetLayerInsertedCount()
01389 {
01390     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01391     if (pBaseCamelotFilter != NULL)
01392         return pBaseCamelotFilter->GetLayerInsertedCount();
01393 
01394     return 0;
01395 }
01396 
01397 UINT32 CamelotRecordHandler::GetSetSentinelInsertedCount()
01398 {
01399     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01400     if (pBaseCamelotFilter != NULL)
01401         return pBaseCamelotFilter->GetSetSentinelInsertedCount();
01402 
01403     return 0;
01404 }
01405 
01406 
01407 void CamelotRecordHandler::IncDocumentInsertedCount()
01408 {
01409     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01410     if (pBaseCamelotFilter != NULL)
01411         pBaseCamelotFilter->IncDocumentInsertedCount();
01412 }
01413 
01414 void CamelotRecordHandler::IncChapterInsertedCount()
01415 {
01416     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01417     if (pBaseCamelotFilter != NULL)
01418         pBaseCamelotFilter->IncChapterInsertedCount();
01419 }
01420 
01421 void CamelotRecordHandler::IncSpreadInsertedCount()
01422 {
01423     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01424     if (pBaseCamelotFilter != NULL)
01425         pBaseCamelotFilter->IncSpreadInsertedCount();
01426 }
01427 
01428 void CamelotRecordHandler::IncLayerInsertedCount()
01429 {
01430     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01431     if (pBaseCamelotFilter != NULL)
01432         pBaseCamelotFilter->IncLayerInsertedCount();
01433 }
01434 
01435 void CamelotRecordHandler::IncSetSentinelInsertedCount()
01436 {
01437     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01438     if (pBaseCamelotFilter != NULL)
01439         pBaseCamelotFilter->IncSetSentinelInsertedCount();
01440 }
01441 
01442 void CamelotRecordHandler::SetCoordOrigin(const DocCoord& Origin)
01443 {
01444     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01445     if (pBaseCamelotFilter != NULL)
01446         pBaseCamelotFilter->SetCoordOrigin(Origin);
01447 }
01448 
01449 DocCoord CamelotRecordHandler::GetCoordOrigin()
01450 {
01451     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01452     if (pBaseCamelotFilter != NULL)
01453         return pBaseCamelotFilter->GetCoordOrigin();
01454 
01455     return DocCoord(0,0);
01456 }
01457 
01458 BOOL CamelotRecordHandler::AddTagDescription(TagDescriptionListItem* pItem)
01459 {
01460     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01461     if (pBaseCamelotFilter != NULL)
01462         return pBaseCamelotFilter->AddTagDescription(pItem);
01463 
01464     return FALSE;
01465 }
01466 
01467 BOOL CamelotRecordHandler::SetDocumentNudgeSize(UINT32 newVal)
01468 {
01469     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01470     if (pBaseCamelotFilter != NULL)
01471         return pBaseCamelotFilter->SetDocumentNudgeSize(newVal);
01472 
01473     return FALSE;
01474 }
01475 
01476 #endif
01477 
01478 
01479 void CamelotRecordHandler::AddAtomicTag(AtomicTagListItem* pItem)
01480 {
01481 #if !defined(EXCLUDE_FROM_XARLIB)
01482     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01483     if (pBaseCamelotFilter != NULL)
01484         pBaseCamelotFilter->AddAtomicTag(pItem);
01485 #else
01486     ERROR3IF(m_pCXFile == NULL,"m_pCXFile is NULL");
01487     if (m_pCXFile != NULL)
01488         m_pCXFile->AddAtomicTag(pItem);
01489 #endif
01490 }
01491 
01492 void CamelotRecordHandler::AddEssentialTag(EssentialTagListItem* pItem)
01493 {
01494 #if !defined(EXCLUDE_FROM_XARLIB)
01495     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01496     if (pBaseCamelotFilter != NULL)
01497         pBaseCamelotFilter->AddEssentialTag(pItem);
01498 #else
01499     ERROR3IF(m_pCXFile == NULL,"m_pCXFile is NULL");
01500     if (m_pCXFile != NULL)
01501         m_pCXFile->AddEssentialTag(pItem);
01502 #endif
01503 }
01504 
01505 BOOL CamelotRecordHandler::IsTagInAtomicList(UINT32 Tag)
01506 {
01507 #if !defined(EXCLUDE_FROM_XARLIB)
01508     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01509     if (pBaseCamelotFilter != NULL)
01510         return pBaseCamelotFilter->IsTagInAtomicList(Tag);
01511 #else
01512     ERROR3IF(m_pCXFile == NULL,"m_pCXFile is NULL");
01513     if (m_pCXFile != NULL)
01514         m_pCXFile->IsTagInAtomicList(Tag);
01515 #endif
01516 
01517     return FALSE;
01518 }
01519 
01520 BOOL CamelotRecordHandler::IsTagInEssentialList(UINT32 Tag)
01521 {
01522 #if !defined(EXCLUDE_FROM_XARLIB)
01523     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01524     if (pBaseCamelotFilter != NULL)
01525         return pBaseCamelotFilter->IsTagInEssentialList(Tag);
01526 #else
01527     ERROR3IF(m_pCXFile == NULL,"m_pCXFile is NULL");
01528     if (m_pCXFile != NULL)
01529         return m_pCXFile->IsTagInEssentialList(Tag);
01530 #endif
01531     return FALSE;
01532 }
01533 
01534 
01535 #if !defined(EXCLUDE_FROM_XARLIB)
01536 BOOL CamelotRecordHandler::UnrecognisedTag(UINT32 Tag)
01537 {
01538     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01539     if (pBaseCamelotFilter != NULL)
01540         return pBaseCamelotFilter->UnrecognisedTag(Tag);
01541 
01542     return FALSE;
01543 }
01544 
01545 TagDescriptionListItem* CamelotRecordHandler::GetTagDescription(UINT32 Tag)
01546 {
01547     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01548     if (pBaseCamelotFilter != NULL)
01549         return pBaseCamelotFilter->GetTagDescription(Tag);
01550 
01551     return NULL;
01552 }
01553 
01554 BOOL CamelotRecordHandler::SetPreCompression(UINT32 Flags)
01555 {
01556     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01557     if (pBaseCamelotFilter != NULL)
01558         return pBaseCamelotFilter->SetPreCompression(Flags);
01559 
01560     return FALSE;
01561 }
01562 
01563 UINT32 CamelotRecordHandler::GetPreCompression()
01564 {
01565     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01566     if (pBaseCamelotFilter != NULL)
01567         return pBaseCamelotFilter->GetPreCompression();
01568 
01569     return 0;
01570 }
01571 
01572 void CamelotRecordHandler::AddPathRecordRefToList(NodePath* pNodePath, UINT32 RecordNumber)
01573 {
01574     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01575     if (pBaseCamelotFilter != NULL)
01576         pBaseCamelotFilter->AddPathRecordRefToList(pNodePath,RecordNumber);
01577 }
01578 
01579 UINT32 CamelotRecordHandler::FindPathRecordRefRecordNumber(NodePath* pNodePath)
01580 {
01581     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01582     if (pBaseCamelotFilter != NULL)
01583         return pBaseCamelotFilter->FindPathRecordRefRecordNumber(pNodePath);
01584 
01585     return 0;
01586 }
01587 
01588 NodePath* CamelotRecordHandler::FindPathRecordRefPath(UINT32 RecordNumber)
01589 {
01590     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01591     if (pBaseCamelotFilter != NULL)
01592         return pBaseCamelotFilter->FindPathRecordRefPath(RecordNumber);
01593 
01594     return NULL;
01595 }
01596 
01597 void CamelotRecordHandler::SetImportFileType(char* pFileType)
01598 {
01599     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01600     if (pBaseCamelotFilter != NULL)
01601         pBaseCamelotFilter->SetImportFileType(pFileType);
01602 }
01603 
01604 BOOL CamelotRecordHandler::IsOpeningMinimalWebFormat()
01605 {
01606     ERROR3IF(pBaseCamelotFilter == NULL,"pBaseCamelotFilter is NULL");
01607     if (pBaseCamelotFilter != NULL)
01608         return pBaseCamelotFilter->IsOpeningMinimalWebFormat();
01609 
01610     return FALSE;
01611 }
01612 #endif
01613 
01614 //-----------------------------------------------------------------------------------------
01615 //-----------------------------------------------------------------------------------------
01616 //-----------------------------------------------------------------------------------------
01617 
01618 
01619 /********************************************************************************************
01620 
01621 >   StripSubTreeRecordHandler::StripSubTreeRecordHandler()
01622 
01623     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
01624     Created:    19/8/96
01625     Inputs:     -
01626     Returns:    -
01627     Purpose:    Default constructor
01628     Errors:     -
01629     SeeAlso:    -
01630 
01631 ********************************************************************************************/
01632 
01633 StripSubTreeRecordHandler::StripSubTreeRecordHandler()
01634 {
01635     StripSubTreeOff();
01636     LevelCounter = 0;
01637 }
01638 
01639 
01640 /********************************************************************************************
01641 
01642 >   virtual BOOL StripSubTreeRecordHandler::BeginImport()
01643 
01644     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
01645     Created:    19/8/96
01646     Inputs:     -
01647     Returns:    TRUE if OK, FALSE otherwise
01648     Purpose:    Informs the record handler that importing is about to begin
01649     Errors:     -
01650     SeeAlso:    -
01651 
01652 ********************************************************************************************/
01653 
01654 BOOL StripSubTreeRecordHandler::BeginImport()
01655 {
01656     StripSubTreeOff();
01657     LevelCounter = 0;
01658 
01659     return TRUE;
01660 }
01661 
01662 /********************************************************************************************
01663 
01664 >   virtual UINT32* StripSubTreeRecordHandler::GetTagList()
01665 
01666     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
01667     Created:    19/8/96
01668     Inputs:     -
01669     Returns:    Ptr to a list of tag values, terminated by CXFRH_TAG_LIST_END
01670     Purpose:    Provides the record handler system with a list of records handled by this
01671                 handler
01672     SeeAlso:    -
01673 
01674 ********************************************************************************************/
01675 
01676 UINT32* StripSubTreeRecordHandler::GetTagList()
01677 {
01678     static UINT32 TagList[] = {CXFRH_TAG_LIST_END};
01679 
01680     return (UINT32*)&TagList;
01681 }
01682 
01683 /********************************************************************************************
01684 
01685 >   virtual BOOL StripSubTreeRecordHandler::HandleRecord(CXaraFileRecord* pCXaraFileRecord)
01686 
01687     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
01688     Created:    19/8/96
01689     Inputs:     pCXaraFileRecord = ptr to the record to handle
01690     Returns:    TRUE if handled ok, FALSE otherwise
01691     Purpose:    The main record handling function
01692     SeeAlso:    -
01693 
01694 ********************************************************************************************/
01695 
01696 BOOL StripSubTreeRecordHandler::HandleRecord(CXaraFileRecord* pCXaraFileRecord)
01697 {
01698     ERROR3IF(!IsStripSubTreeOn(),"This should never be called if it's not stripping a subtree");
01699     if (!IsStripSubTreeOn())
01700         return TRUE;
01701 
01702     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
01703 
01704     switch (pCXaraFileRecord->GetTag())
01705     {
01706         case TAG_UP:
01707             if (LevelCounter > 0)
01708                 LevelCounter--;
01709 
01710             if (LevelCounter == 0)
01711                 StripSubTreeOff();
01712             break;
01713 
01714         case TAG_DOWN:
01715             LevelCounter++;
01716             break;
01717     }
01718 
01719     return TRUE;
01720 }
01721 
01722 
01723 /********************************************************************************************
01724 
01725 >   virtual BOOL StripSubTreeRecordHandler::IsTagInList(UINT32 Tag)
01726 
01727     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
01728     Created:    19/8/96
01729     Inputs:     Tag = tag value of a record
01730     Returns:    TRUE if it's to be handled by this handler
01731                 FALSE otherwise
01732     Purpose:    This decides whether the given Tag should be handled by the sub tree stripper or not.
01733     SeeAlso:    -
01734 
01735 ********************************************************************************************/
01736 
01737 BOOL StripSubTreeRecordHandler::IsTagInList(UINT32 Tag)
01738 {
01739     // If the stripper is not turned on, there's no point in trying
01740     if (!IsStripSubTreeOn())
01741         return FALSE;
01742 
01743     // If the next tag is not a down node (i.e. it's not the start of a sub-tree)
01744     // and the level counter is 0 (i.e. we're not in the depths of a sub-tree either)
01745     // then we should return FALSE & turn the stripper off
01746     if (Tag != TAG_DOWN && LevelCounter == 0)
01747     {
01748         StripSubTreeOff();
01749         return FALSE;
01750     }
01751 
01752     return TRUE;
01753 }
01754 

Generated on Sat Nov 10 03:44:58 2007 for Camelot by  doxygen 1.4.4