00001 // $Id: bmpcomp.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 // kernel class to encompass bitmaps lists 00100 // This covers the bitmap document component related items 00101 // The global bitmap lists are in bmplist.h 00102 // This file was broken off from bmplist 11/6/96 00103 00104 #ifndef INC_BMPCOMP 00105 #define INC_BMPCOMP 00106 00107 //#include "list.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00108 //#include "doccomp.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00109 00110 class OILBitmap; 00111 class BitmapInfo; 00112 class RenderRegion; 00113 class Filter; 00114 class FillGeometryAttribute; 00115 class Document; 00116 class EPSExportDC; 00117 class KernelBitmap; 00118 class KernelBitmapRef; 00119 00120 class ExportedBitmaps; 00121 class ImportedBitmaps; 00122 class CXaraFileRecord; 00123 class CXaraFile; 00124 class CXaraFileRecordHandler; 00125 00126 00127 00128 /*********************************************************************************************** 00129 00130 > class SaveBitmapsPool : public List 00131 00132 Author: Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> 00133 Purpose: A list of Kernel Bitmaps to save out 00134 SeeAlso: - 00135 00136 ***********************************************************************************************/ 00137 00138 class BitmapSavePool : public List 00139 { 00140 CC_DECLARE_MEMDUMP(BitmapSavePool) 00141 00142 public: 00143 BOOL AddBitmap(KernelBitmap* pBitmap); 00144 INT32 GetBitmapIndex(KernelBitmap* pBitmap); 00145 }; 00146 00147 /*********************************************************************************************** 00148 00149 > class BitmapList : public List 00150 00151 Author: Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> 00152 Purpose: A list of Kernel Bitmaps used by a document 00153 SeeAlso: - 00154 00155 ***********************************************************************************************/ 00156 00157 class BitmapList : public List 00158 { 00159 CC_DECLARE_MEMDUMP(BitmapList) 00160 00161 friend class GlobalBitmapList; 00162 00163 public: 00164 BitmapList(); 00165 ~BitmapList(); 00166 00167 void Init(BaseDocument *ParentDocument); 00168 00169 public: // Access to special BitmapList data members 00170 BOOL AddItem(KernelBitmap *Item); 00171 BOOL RemoveItem(KernelBitmap *Item); 00172 00173 BOOL MoveAfter(KernelBitmap *InsertPoint, KernelBitmap *ItemToMove); 00174 BOOL MoveBefore(KernelBitmap *InsertPoint, KernelBitmap *ItemToMove); 00175 00176 BaseDocument *GetParentDocument(void); 00177 00178 // Check to see if the bitmap exists already 00179 KernelBitmap* FindDuplicateBitmap(OILBitmap* pBitmap); 00180 00181 // Find the default bitmap 00182 KernelBitmap* FindDefaultBitmap(); 00183 00184 private: 00185 BaseDocument *ParentDoc; 00186 }; 00187 00188 /******************************************************************************************** 00189 00190 > class BitmapListComponentClass : public DocComponentClass 00191 00192 Author: Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> 00193 Created: 12/12/94 00194 Purpose: Provide a class that will add Bitmap components to new documents. 00195 SeeAlso: DocComponentClass 00196 00197 ********************************************************************************************/ 00198 00199 class BitmapListComponentClass : public DocComponentClass 00200 { 00201 CC_DECLARE_DYNAMIC(BitmapListComponentClass) 00202 00203 public: 00204 static BOOL Init(); 00205 00206 BOOL AddComponent(BaseDocument *); 00207 }; 00208 00209 /******************************************************************************************** 00210 00211 > class BitmapListComponent : public DocComponent 00212 00213 Author: Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> 00214 Created: 12/12/94 00215 Purpose: Provide a component that contains a list of kernel bitmaps in use by 00216 a document. 00217 SeeAlso: DocComponent 00218 00219 ********************************************************************************************/ 00220 00221 class BitmapListComponent : public DocComponent 00222 { 00223 CC_DECLARE_DYNAMIC(BitmapListComponent) 00224 00225 public: 00226 BitmapListComponent(); 00227 BitmapListComponent(BitmapList *); 00228 virtual ~BitmapListComponent(); 00229 BitmapList* GetBitmapList() { return pBitmaps; } 00230 00231 public: 00232 // Usual document component functions... 00233 virtual BOOL EPSStartImport(EPSFilter*); 00234 virtual void EPSEndImport(EPSFilter*, BOOL); 00235 virtual BOOL WriteEPSComments(EPSFilter*); 00236 virtual BOOL WriteScript(EPSFilter*); 00237 virtual ProcessEPSResult ProcessEPSComment(EPSFilter*, const char*); 00238 virtual void EndOfEPSComment(EPSFilter*); 00239 virtual INT32 GetSizeOfExport(Filter*); 00240 00241 virtual BOOL EPSStartExport(EPSFilter*); 00242 virtual void EPSEndExport(EPSFilter*); 00243 00244 ExportedBitmaps* GetBitmapExportPool() { return pBitmapsToExport; } 00245 ImportedBitmaps* GetImportList() { return pImportedBitmaps; } 00246 00247 protected: 00248 // Function to help with the exporting of the bitmap pool 00249 BOOL ExportBitmapPoolItem(INT32 BitmapNum, EPSFilter* pFilter, EPSExportDC* pDC, KernelBitmap* pBitmap); 00250 00251 protected: 00252 // This is the list of bitmaps that we need to export (used for EPS export only) ... 00253 ExportedBitmaps* pBitmapsToExport; 00254 00255 private: 00256 BitmapList* pBitmaps; 00257 00258 public: 00259 virtual BOOL StartComponentCopy(); 00260 virtual BOOL EndComponentCopy(); 00261 virtual void AbortComponentCopy(); 00262 00263 public: 00264 // These are the Camelot Version 2 Web and Native file related functions 00265 virtual BOOL StartImport(BaseCamelotFilter* pFilter); 00266 virtual BOOL EndImport(BaseCamelotFilter* pFilter, BOOL Success); 00267 virtual BOOL StartExport(BaseCamelotFilter* pFilter); 00268 virtual BOOL EndExport(BaseCamelotFilter* pFilter, BOOL Success); 00269 00270 // The public way of importing and exporting bitmaps for the new native/web filters 00271 KernelBitmap* GetReadBitmapReference(INT32 BitmapRef); 00272 INT32 GetWriteBitmapReference(KernelBitmap* pBitmap, BaseCamelotFilter* pFilter); 00273 // Code to save out a bitmap definition 00274 INT32 SaveBitmapDefinition(KernelBitmap* pBitmap, BaseCamelotFilter* pFilter); 00275 BOOL LoadBitmapDefinition(CXaraFileRecordHandler* pXFileRecHandler, CXaraFile* pCXFile, 00276 INT32 Tag, UINT32 Size, UINT32 RecordNumber); 00277 00278 // Helper function for SaveBitmapDefinition: writes a bitmap properties record 00279 BOOL WriteBitmapPropertiesRecord(KernelBitmap* pBitmap, BaseCamelotFilter* pFilter, INT32 BmpRef); 00280 00281 protected: 00282 // Our list of bitmaps that we have currently exported from this document 00283 ExportedBitmaps* pExportedBitmaps; 00284 00285 // Our list of bitmaps that we have currently imported into this document 00286 ImportedBitmaps* pImportedBitmaps; 00287 00288 private: // Private link used during Importing to provide warnings to the user 00289 BaseCamelotFilter* pCamFilter; 00290 // Private variable which means that during Importing we only warn the user 00291 // once about problem bitmaps 00292 BOOL WarnedBefore; 00293 }; 00294 00295 #endif // INC_BMPCOMP