00001 // $Id: frameops.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 // The Frame Operations header file 00100 00101 #ifndef INC_FRAMEOPS 00102 #define INC_FRAMEOPS 00103 00104 //#include "dialogop.h" 00105 //#include "undoop.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00106 #include "layergal.h" 00107 00108 #include "makebmp.h" // MakeBitmapFilter 00109 #include "impexpop.h" // OpMenuExport BitmapExportParam 00110 //#include "animparams.h" // AnimPropertiesParam - in camtypes.h [AUTOMATICALLY REMOVED] 00111 00112 //#if _DEBUG // removal of these ops from non-debug builds 00113 00114 class PathName; 00115 class Layer; 00116 class BitmapPreviewData; 00117 class PreviewDialog; 00118 00119 //------------------------------------------------------------------------------------------ 00120 // OpLayerGalChange related items 00121 00122 /******************************************************************************************** 00123 00124 > class CCAPI OpSelectStartFrame : public OpLayerGalChange 00125 00126 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00127 Created: 21/4/97 00128 Purpose: Performs an undoable change of selecting the bottom most frame layer. 00129 SeeAlso: - 00130 00131 ********************************************************************************************/ 00132 #define OPTOKEN_FRAME_STARTFRAME _T("GotoStartFrame") 00133 00134 class CCAPI OpSelectStartFrame : public OpLayerGalChange 00135 { 00136 CC_DECLARE_DYNCREATE( OpSelectStartFrame ); 00137 00138 public: 00139 OpSelectStartFrame() { } // nothing yet 00140 00141 static OpState GetState(String_256*, OpDescriptor*); 00142 00143 void Do( OpDescriptor * pOpDesc ); 00144 }; 00145 00146 /******************************************************************************************** 00147 00148 > class CCAPI OpSelectEndFrame : public OpLayerGalChange 00149 00150 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00151 Created: 22/4/97 00152 Purpose: Performs an undoable change of selecting the top most frame layer. 00153 SeeAlso: - 00154 00155 ********************************************************************************************/ 00156 #define OPTOKEN_FRAME_ENDFRAME _T("GotoEndFrame") 00157 00158 class CCAPI OpSelectEndFrame : public OpLayerGalChange 00159 { 00160 CC_DECLARE_DYNCREATE( OpSelectEndFrame ); 00161 00162 public: 00163 OpSelectEndFrame() { } // nothing yet 00164 00165 static OpState GetState(String_256*, OpDescriptor*); 00166 00167 void Do( OpDescriptor * pOpDesc ); 00168 }; 00169 00170 /******************************************************************************************** 00171 00172 > class CCAPI OpSelectPrevFrame : public OpLayerGalChange 00173 00174 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00175 Created: 22/4/97 00176 Purpose: Performs an undoable change of selecting the previous frame (layer). 00177 SeeAlso: - 00178 00179 ********************************************************************************************/ 00180 #define OPTOKEN_FRAME_PREVFRAME _T("GotoPrevFrame") 00181 00182 class CCAPI OpSelectPrevFrame : public OpLayerGalChange 00183 { 00184 CC_DECLARE_DYNCREATE( OpSelectPrevFrame ); 00185 00186 public: 00187 OpSelectPrevFrame() { } // nothing yet 00188 00189 static OpState GetState(String_256*, OpDescriptor*); 00190 00191 void Do( OpDescriptor * pOpDesc ); 00192 }; 00193 00194 /******************************************************************************************** 00195 00196 > class CCAPI OpSelectNextFrame : public OpLayerGalChange 00197 00198 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00199 Created: 22/4/97 00200 Purpose: Performs an undoable change of selecting the next frame (layer). 00201 SeeAlso: - 00202 00203 ********************************************************************************************/ 00204 #define OPTOKEN_FRAME_NEXTFRAME _T("GotoNextFrame") 00205 00206 class CCAPI OpSelectNextFrame : public OpLayerGalChange 00207 { 00208 CC_DECLARE_DYNCREATE( OpSelectNextFrame ); 00209 00210 public: 00211 OpSelectNextFrame() { } // nothing yet 00212 00213 static OpState GetState(String_256*, OpDescriptor*); 00214 00215 void Do( OpDescriptor * pOpDesc ); 00216 }; 00217 00218 /******************************************************************************************** 00219 00220 > class CCAPI OpCreateNewFrame : public OpLayerGalChange 00221 00222 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00223 Created: 22/4/97 00224 Purpose: Performs an undoable change of creating a new frame layer. 00225 SeeAlso: - 00226 00227 ********************************************************************************************/ 00228 #define OPTOKEN_FRAME_NEWFRAME _T("NewFrame") 00229 00230 class CCAPI OpCreateNewFrame : public OpLayerGalChange 00231 { 00232 CC_DECLARE_DYNCREATE( OpCreateNewFrame ); 00233 00234 public: 00235 OpCreateNewFrame() { } // nothing yet 00236 00237 static OpState GetState(String_256*, OpDescriptor*); 00238 00239 void Do( OpDescriptor * pOpDesc ); 00240 }; 00241 00242 /******************************************************************************************** 00243 00244 > class CCAPI OpCopyFrame : public OpLayerGalChange 00245 00246 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00247 Created: 22/4/97 00248 Purpose: Performs an undoable change of copying the selected frame layer. 00249 SeeAlso: - 00250 00251 ********************************************************************************************/ 00252 #define OPTOKEN_FRAME_COPYFRAME _T("CopyFrame") 00253 00254 class CCAPI OpCopyFrame : public OpLayerGalChange 00255 { 00256 CC_DECLARE_DYNCREATE( OpCopyFrame ); 00257 00258 public: 00259 OpCopyFrame() { } // nothing yet 00260 00261 static OpState GetState(String_256*, OpDescriptor*); 00262 00263 void Do( OpDescriptor * pOpDesc ); 00264 }; 00265 00266 /******************************************************************************************** 00267 00268 > class CCAPI OpDeleteFrame : public OpLayerGalChange 00269 00270 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00271 Created: 23/4/97 00272 Purpose: Performs an undoable change of deleting the selected frame layer. 00273 SeeAlso: - 00274 00275 ********************************************************************************************/ 00276 #define OPTOKEN_FRAME_DELETEFRAME _T("DeleteFrame") 00277 00278 class CCAPI OpDeleteFrame : public OpLayerGalChange 00279 { 00280 CC_DECLARE_DYNCREATE( OpDeleteFrame ); 00281 00282 public: 00283 OpDeleteFrame() { } // nothing yet 00284 00285 static OpState GetState(String_256*, OpDescriptor*); 00286 00287 void Do( OpDescriptor * pOpDesc ); 00288 }; 00289 00290 //------------------------------------------------------------------------------------------ 00291 // Property related items 00292 00293 /******************************************************************************************** 00294 00295 > class CCAPI OpFrameProperties : public Operation 00296 00297 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00298 Created: 29/4/97 00299 Purpose: Performs an operation to pop up the frame properties dialog. 00300 SeeAlso: - 00301 00302 ********************************************************************************************/ 00303 #define OPTOKEN_FRAME_PROPERTIES _T("FrameProperties") 00304 00305 class CCAPI OpFrameProperties : public Operation 00306 { 00307 CC_DECLARE_DYNCREATE( OpFrameProperties ); 00308 00309 public: 00310 OpFrameProperties() { } // nothing yet 00311 00312 static OpState GetState(String_256*, OpDescriptor*); 00313 00314 void Do( OpDescriptor * pOpDesc ); 00315 }; 00316 00317 /******************************************************************************************** 00318 00319 > class CCAPI OpAnimationProperties : public Operation 00320 00321 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00322 Created: 29/4/97 00323 Purpose: Performs an operation to pop up the animation properties dialog. 00324 SeeAlso: - 00325 00326 ********************************************************************************************/ 00327 #define OPTOKEN_FRAME_ANIPROPERTIES _T("AnimationProperties") 00328 00329 class CCAPI OpAnimationProperties : public Operation 00330 { 00331 CC_DECLARE_DYNCREATE( OpAnimationProperties ); 00332 00333 public: 00334 OpAnimationProperties() { } // nothing yet 00335 00336 static OpState GetState(String_256*, OpDescriptor*); 00337 00338 void Do( OpDescriptor * pOpDesc ); 00339 }; 00340 00341 //------------------------------------------------------------------------------------------ 00342 // Make bitmap copy related items 00343 00344 00345 //------------------------------------------------------------------------------------------ 00346 //#endif // _DEBUG removal of these ops from non-debug builds 00347 //------------------------------------------------------------------------------------------ 00348 00349 /******************************************************************************************** 00350 00351 > class GIFAnimationExportParam : public BitmapExportParam 00352 00353 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00354 Created: 13/5/97 00355 Purpose: Passes infomation about the GIF animation and its bitmap(s) being exported 00356 SeeAlso: OpParam 00357 00358 ********************************************************************************************/ 00359 00360 class GIFAnimationExportParam : public BitmapExportParam 00361 { 00362 CC_DECLARE_DYNAMIC(GIFAnimationExportParam); 00363 00364 public: 00365 GIFAnimationExportParam(); 00366 GIFAnimationExportParam(UINT32 Count, KernelBitmap** pBitmap); 00367 00368 ~GIFAnimationExportParam(); 00369 00370 // Access functions with helpful checking 00371 virtual UINT32 GetBitmapCount(); 00372 virtual KernelBitmap* GetBitmap(UINT32 Index); 00373 virtual BOOL AddBitmap(KernelBitmap * pBitmap); 00374 00375 // Access functions. 00376 UINT32 GetRegeneratedBitmapPosition()const { return m_RegeneratedBitmapPosition; } 00377 void SetRegeneratedBitmapPosition(const UINT32 Pos) { m_RegeneratedBitmapPosition = Pos; } 00378 00379 virtual UINT32 GetLayerCount(); 00380 virtual Layer * GetLayer(UINT32 Index); 00381 virtual BOOL AddLayer(Layer * pLayer); 00382 00383 virtual BOOL AddLayerAndBitmap(Layer * pLayer, KernelBitmap * pBitmap); 00384 00385 AnimPropertiesParam& GetSpreadAnimPropertiesParam(); 00386 void SetSpreadAnimPropertiesParam(const AnimPropertiesParam& Param); 00387 00388 DWORD GetAnimLoop() const { return m_AnimPropertiesParam.GetAnimLoop(); } 00389 DWORD GetGlobalAnimDelay() const { return m_AnimPropertiesParam.GetGlobalAnimDelay(); } 00390 WEB_PALETTE GetPalette() const { return m_AnimPropertiesParam.GetPalette(); } 00391 PALETTE_COLOURS GetPaletteCols() const { return m_AnimPropertiesParam.GetPaletteCols(); } 00392 DWORD GetNumColsInPalette() const { return m_AnimPropertiesParam.GetNumColsInPalette(); } 00393 DITHER GetDither()const { return m_AnimPropertiesParam.GetDither(); } 00394 BOOL GetUseSystemCols() const { return m_AnimPropertiesParam.GetUseSystemCols(); } 00395 BOOL GetIsBackGroundTransp() const { return m_AnimPropertiesParam.GetIsBackGroundTransp(); } 00396 00397 virtual DocRect GetBoundingRect() const; 00398 00399 DocRect GetAnimationBoundingRect() const { return m_AnimPropertiesParam.GetBoundingRect(); } 00400 void SetAnimationBoundingRect(const DocRect& BoundingRect) { m_AnimPropertiesParam.SetBoundingRect(BoundingRect); } 00401 00402 protected: 00403 // This is a copy of the version stored in the spread 00404 AnimPropertiesParam m_AnimPropertiesParam; 00405 // The following values for a GIF animation will be stored:- 00406 // Animation loop 00407 // Global Delay 00408 // Dither 00409 // Palette 00410 // Number of Cols In Palette 00411 // Use System Colours flag 00412 00413 KernelBitmap** m_pBitmaps; // The array of bitmaps 00414 UINT32 m_BitmapCount; // The number of bitmaps in the above array 00415 Layer** m_pLayers; // The array of layers 00416 UINT32 m_LayerCount; // The number of frame layers in the above array 00417 UINT32 m_RegeneratedBitmapPosition; // The position of the regenerated bitmap in the array. 00418 }; 00419 00420 #define OPTOKEN_FRAME_GRABFRAME _T("GrabFrame") 00421 #define OPTOKEN_FRAME_GRABALLFRAMES _T("GrabAllFrames") 00422 #define OPTOKEN_SAVEANIMATEDGIF _T("SaveAnimatedGIF") 00423 #define OPTOKEN_FRAME_BROWSERPREVIEW _T("BrowserPreview") 00424 00425 PORTNOTE("other", "Removed GrabFrameFilter, OpGrabFrame, OpGrabAllFrames") 00426 #ifndef EXCLUDE_FROM_XARALX 00427 //------------------------------------------------------------------------------------------ 00428 //#if _DEBUG // removal of these ops from non-debug builds 00429 //------------------------------------------------------------------------------------------ 00430 00431 /******************************************************************************************** 00432 00433 > class GrabFrameFilter : public MakeBitmapFilter 00434 00435 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00436 Created: 24/4/97 00437 Purpose: Special filter used to convert the selected frame into a bitmap 00438 00439 ********************************************************************************************/ 00440 00441 class GrabFrameFilter : public MakeBitmapFilter 00442 { 00443 CC_DECLARE_DYNAMIC(GrabFrameFilter); 00444 00445 public: 00446 GrabFrameFilter(); 00447 ~GrabFrameFilter(); 00448 00449 // Function which determines if a filter should export invisible layers or not 00450 virtual BOOL ExportVisibleLayersOnly(); 00451 00452 // Function which determines if a filter should export the selected items or not 00453 virtual BOOL ExportSelectionOnly(BOOL MaskedRender = FALSE); 00454 00455 // Function which returns whether a second rendering pass is required or not 00456 virtual BOOL IsSecondPassRequired(); 00457 00458 virtual BOOL DoExportBitmaps(Operation* pOp, CCLexFile* pFile, PathName* pPath, 00459 BitmapExportParam* pParam, BOOL DontShowFileName = FALSE); 00460 00461 // Function to generate an optimised palette 00462 // Overide the baseclass to do GLOBAL OPTIMISED palette 00463 virtual BOOL GenerateOptimisedPalette(Spread *pSpread, UINT32 Depth, double DPI, BOOL SnapToBrowserPalette, UINT32 NumColsInPalette, BOOL UsePrimaryCols); 00464 00465 public: 00466 // Special access functions for this filter 00467 Layer * GetLayerBeingCaptured() { return m_pLayer; } 00468 BOOL SetLayerBeingCaptured(Layer * pNewLayer); 00469 00470 virtual BOOL SetUpClippingRectangleForExport(Spread *pSpread, SelectionType Selection); 00471 00472 // This is just a public interface on the normal filter's GetExportOptions which is protected 00473 virtual BOOL SetupExportOptions(BitmapExportOptions* pOptions, Spread * pCurrentSpread); 00474 // This is just a public interface on the normal filter's CreateExportOptions which is protected 00475 virtual MakeBitmapExportOptions * MakeExportOptions() { return (MakeBitmapExportOptions*)CreateExportOptions(); } 00476 00477 virtual MakeBitmapExportOptions * GetCurrentExportOptions() { return m_pMkBmpOptions; } 00478 virtual MakeBitmapExportOptions * GetCurrentExportOptionsCopy() { return m_pCopyMkBmpOptions; } 00479 00480 LPLOGPALETTE GetGlobalOptimisedPalette() { return m_pOptimisedPalette; } 00481 void SetGlobalOptimisedPalette(LPLOGPALETTE pOptimisedPalette); 00482 00483 // Functions for returning the import and export message ids. 00484 // Baseclass versions just return the ExportMsgID and ImportMsgID 00485 // Allow somebody to read the export ID and to override it for say multistage exports 00486 virtual UINT32 GetExportMsgID(); 00487 00488 // Almost-a-bodge addition by Jonathan. We need to use the GrabFrameFilter in a 00489 // different way when we are generating bitmaps to pass to the palette optimiser 00490 // from when we are actually generating the bitmaps that are used in the animation. 00491 // (For palette optimisation, we need 32 bit bitmaps and for normal use we need 00492 // 8 bit bitmaps). For this system to work, before using the filter to generate 00493 // a bitmap, call SetGrabMode to set the filter to the way you want it to work. 00494 enum GRABMODE { GRABMODE_PREVIEW, GRABMODE_FOROUTPUT }; 00495 void SetGrabMode(GRABMODE newmode) { m_GrabMode = newmode; } 00496 00497 protected: 00498 00499 GRABMODE m_GrabMode; 00500 00501 00502 // 00503 // Export related functions 00504 // 00505 // Just override the ones that are necessary 00506 //virtual BitmapExportOptions* CreateExportOptions() const; 00507 virtual BOOL GetExportOptions(BitmapExportOptions* pOptions); 00508 00509 virtual KernelBitmap* GetTheBitmap(); 00510 00511 private: 00512 Layer * m_pLayer; 00513 00514 // This is a bit OILy, so will need to be moved some time 00515 // As Bitfilt.h has the same problem we will worry about it when it does... 00516 LPLOGPALETTE m_pOptimisedPalette; 00517 00518 // Take a copy of the export parameters 00519 MakeBitmapExportOptions* m_pMkBmpOptions; 00520 00521 MakeBitmapExportOptions* m_pCopyMkBmpOptions; 00522 }; 00523 00524 /******************************************************************************************** 00525 00526 > class CCAPI OpGrabFrame : public Operation 00527 00528 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00529 Created: 22/4/97 00530 Purpose: Performs an operation to grab the selected frame layer and preview it. 00531 SeeAlso: - 00532 00533 ********************************************************************************************/ 00534 00535 class CCAPI OpGrabFrame : public Operation 00536 { 00537 CC_DECLARE_DYNCREATE( OpGrabFrame ); 00538 00539 public: 00540 OpGrabFrame(); 00541 ~OpGrabFrame(); 00542 00543 static BOOL Init(); 00544 static void DeInit(); 00545 static OpState GetState(String_256*, OpDescriptor*); 00546 00547 virtual void Do( OpDescriptor * pOpDesc ); 00548 virtual void DoWithParam(OpDescriptor* pOpDesc, OpParam* Param); 00549 00550 protected: 00551 // Frame grabbing related functions 00552 virtual BOOL StartGrab(); 00553 virtual KernelBitmap * GrabFrame(); 00554 virtual KernelBitmap * GrabTheFrame(); 00555 virtual BOOL EndGrab(); 00556 00557 // Actions associated with frame grabbing 00558 virtual BOOL GetFileNameFromUser(); 00559 virtual BOOL PreviewAnimation(); 00560 00561 // This does the actually job in hand, e.g. preview, save, preview in browser 00562 virtual BOOL SaveOrShowTheAnimation(PreviewDialog * pPreviewDialog, BitmapExportParam* pExportParam); 00563 00564 // Some useful helper functions 00565 BOOL SetFullBitmapList(BOOL SetFlagState = FALSE); 00566 BOOL SetSingleBitmapInList(); 00567 BOOL SetBitmapToListTail(); 00568 00569 BOOL CheckIfSingleBitmap(Layer * pLayer, KernelBitmap ** ppBitmap); 00570 BOOL CheckAllForSingleBitmaps(Spread * pSpread, GrabFrameFilter * pBitmapFilter); 00571 00572 virtual BitmapPreviewData * GetBitmapPreviewData() { return m_pBitmapData; } 00573 00574 protected: 00575 // we must remember the selection and then try and put it back at the end of the op 00576 virtual BOOL RememberTheSelection(); 00577 virtual BOOL PutBackTheSelection(); 00578 00579 // The remembered selection state 00580 SelectionState * m_pSelState; 00581 00582 protected: 00583 // This encapsulates the list of bitmaps and associated layers/frames 00584 // plus the other relevant GIF animation export details 00585 GIFAnimationExportParam m_ExportParams; 00586 00587 GrabFrameFilter * m_pBitmapFilter; 00588 00589 Document * m_pDocument; 00590 Spread * m_pSpread; 00591 Layer * m_pLayer; 00592 DocView * m_pView; 00593 00594 static BitmapPreviewData * m_pBitmapData; 00595 00596 LPLOGPALETTE m_pBrowserPalette; 00597 }; 00598 00599 /******************************************************************************************** 00600 00601 > class CCAPI OpGrabAllFrames : public OpGrabFrame 00602 00603 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00604 Created: 23/4/97 00605 Purpose: Performs an operation to grab all of the frame layers and preview them. 00606 SeeAlso: - 00607 00608 ********************************************************************************************/ 00609 00610 class CCAPI OpGrabAllFrames : public OpGrabFrame 00611 { 00612 CC_DECLARE_DYNCREATE( OpGrabAllFrames ); 00613 00614 public: 00615 OpGrabAllFrames() { } // nothing yet 00616 00617 //static OpState GetState(String_256*, OpDescriptor*); 00618 00619 void Do( OpDescriptor * pOpDesc ); 00620 00621 static BOOL ms_ForceRefreshOfAllFrames; 00622 00623 // Helper functions 00624 protected: 00625 void CreateGlobalPalette(DWORD NumColsInPalette, BOOL RegenerateAllFrames); 00626 }; 00627 00628 //------------------------------------------------------------------------------------------ 00629 // Save related items 00630 00631 /******************************************************************************************** 00632 00633 > class OpSaveAnimatedGIF : public OpGrabAllFrames 00634 00635 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00636 Created: 24/4/97 00637 Purpose: Pops up a common dialog to allow the user to export an animated GIF from Camelot. 00638 This is for the special frame related export so we have all the options set up. 00639 SeeAlso: OpMenuExport; 00640 00641 ********************************************************************************************/ 00642 00643 // Operation token for the OpMenuExport class 00644 00645 class OpSaveAnimatedGIF : public OpGrabAllFrames 00646 { 00647 CC_DECLARE_DYNCREATE(OpSaveAnimatedGIF) 00648 00649 public: 00650 static OpState GetState(String_256*, OpDescriptor*); 00651 00652 protected: 00653 // Actions associated with frame grabbing 00654 virtual BOOL GetFileNameFromUser(); 00655 00656 // This does the actually job in hand, e.g. preview, save, preview in browser 00657 virtual BOOL SaveOrShowTheAnimation(PreviewDialog * pPreviewDialog, BitmapExportParam* pExportParam); 00658 00659 // This checks to see that the file type/extension is ok 00660 BOOL EnsureFileType(PathName * pPath); 00661 00662 private: 00663 PathName m_SavePath; 00664 }; 00665 00666 //------------------------------------------------------------------------------------------ 00667 // Browser Preview related items 00668 00669 /******************************************************************************************** 00670 00671 > class CCAPI OpBrowserPreview : public OpSaveAnimatedGIF 00672 00673 Author: Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 00674 Created: 29/4/97 00675 Purpose: Performs an operation to preview the animation in a browser. 00676 SeeAlso: - 00677 00678 ********************************************************************************************/ 00679 00680 class CCAPI OpBrowserPreview : public OpSaveAnimatedGIF 00681 { 00682 CC_DECLARE_DYNCREATE( OpBrowserPreview ); 00683 00684 public: 00685 static BOOL RemoveTempFile(); 00686 00687 protected: 00688 // Actions associated with frame grabbing 00689 virtual BOOL GetFileNameFromUser(); 00690 00691 // This does the actually job in hand, e.g. preview, save, preview in browser 00692 virtual BOOL SaveOrShowTheAnimation(PreviewDialog * pPreviewDialog, BitmapExportParam* pExportParam); 00693 00694 private: 00695 static PathName m_TempPath; 00696 }; 00697 00698 //------------------------------------------------------------------------------------------ 00699 //#endif // _DEBUG removal of these ops from non-debug builds 00700 #endif // EXCLUDE_FROM_XARALX 00701 00702 #endif // INC_FRAMEOPS