bmapprev.h

Go to the documentation of this file.
00001 // $Id: bmapprev.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 #ifndef INC_BMAPPREV
00100 #define INC_BMAPPREV
00101 
00102 #include "bmpprefs.h"   // ExportFileType
00103 //#include "dialogop.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00104 #include "bmpalctrl.h"  // Required as BmapPrevDlg HasA BitmapExportPaletteControl
00105 
00106 class BitmapExportPreviewDialog;
00107 class BrowserPreviewOptions;
00108 class ImagemapFilterOptions;
00109 class BubbleHelpWnd;
00110 
00111 #define OPTOKEN_GIFTABDLG _T("BmapPrevDlg")
00112 
00113 //PORTNOTE("dialog","Removed BmapPrevDlg - derived from DialogTabOp")
00114 //#ifndef EXCLUDE_FROM_XARALX
00115 class BmapPrevDlg : public DialogTabOp
00116 {         
00117     CC_DECLARE_DYNCREATE( BmapPrevDlg )  
00118     
00119 public:     // Contructors
00120     BmapPrevDlg(); 
00121     ~BmapPrevDlg();
00122 
00123 public:     // Interface (the good bit)
00124     static BOOL Init();
00125     MsgResult Message(Msg* Message);
00126     void SetDontWantMouseMessage( BOOL  ) { ASSERT(FALSE); }
00127     void OnHelpButtonClicked();
00128     void UpdateCurrentTab();
00129     void SetPaletteSelection(INT32 index);
00130         // Set the selected colour in the palette control
00131     void SetPaletteHighlight(INT32 index);
00132         // Set the highlighted colour in the palette control
00133     BOOL DoPreview();
00134 
00135 public:     // Interface
00136     // PLEASE NOTE: The following two functions have no implementation
00137     // and are very broken - any code that uses them should be changed
00138     static INT32 GetNumberOfTransparentColours();
00139     static INT32 GetTransparentColour( INT32 Index );
00140 
00141 public:     // Public data (bad design)
00142     static BitmapExportOptions *m_pExportOptions;
00143     static BOOL m_bUseExistingPalette;
00144     static PathName m_pthExport;            // The path we are exporting the bitmap to
00145     static BOOL m_bSlicingImage;            // Are we doing image slicing or not?
00146     static BOOL m_bIsCreateBitmap;          // Are we using the Create Bitmap dialog?
00147     static INT32 m_NumOfColoursUserAskedFor;    // this is the value that the user has typed into no of clours field
00148                                             // or if they didn't type it is the top value defined by the max possible at this colour depth
00149 //  static BOOL m_bNeedPaletteUpdated;
00150     static BOOL m_bIsOrderedDither;
00151     //  Did the user click on Export or not? This variable is used when the file type
00152     //  has changed, and so have the options.
00153     static BOOL m_bClickedOnExport;
00154     //  This is the original file type for use with the above variable
00155 //  static ExportFileType m_OriginalFileType;
00156     INT32 m_FilterType;
00157 
00158 private:    // Functions
00159     virtual void DoWithParam(OpDescriptor*, OpParam* pParam);
00160     virtual BOOL RegisterYourPagesInOrderPlease(); 
00161 
00162     BOOL OnCreate();
00163     void SetButtonsText();
00164     void SetPreviewButtonState(bool enabled);
00165 
00166     void DoBubbleHelp();
00167     void PrepareBubbleHelp();
00168     void UpdateStatusBar(UINT32 id);
00169 
00170     void SetPreEditedPaletteColour(INT32 r = -1, INT32 g = -1, INT32 b = -1);
00171 
00172     // Functions I have not deleted yet
00173     INT32 GetPositionOfItemInDropList( INT32 ListID, INT32 ItemID );
00174     BOOL SetSelectedDropListItem( INT32 ListID, INT32 ItemID );
00175     void RenderControl( ReDrawInfoType* pExtraInfo );
00176 
00177     void BrowserPreviewGetOptions(BrowserPreviewOptions *pBrowserOptions);
00178 
00179     void ImageMapGetOptions(ImagemapFilterOptions* pOptions);
00180     void ImageMapOnFileNameChanged();
00181     void ImageMapOnBrowseClicked();
00182     void ImageMapEnableExportToFileOptions(BOOL fValue);
00183     void ImageMapEnableOptions(BOOL fValue);
00184     void ImageMapOnCreate();
00185     void ImageMapOnCommit();
00186     WinRect GetExportSize(double dpi);
00187 
00188 private:    // Data
00189     BitmapExportPreviewDialog *m_pPreviewDlg;           // pointer to the preview dialog
00190     CWindowID m_DialogWnd;                              // pointer to the preview dialog window
00191     BaseBitmapFilter *m_pBmpFilter;
00192     BOOL m_bDpiSupported;                               // Does the (should be) given filter support DPI?
00193     BOOL m_CurrentPreview;
00194     BOOL m_bPopularityValuesWanted;
00195     BitmapExportPaletteControl m_PaletteControl;
00196     bool m_bImageMapTabCreated;
00197     bool m_bBrowserPreviewTabCreated;
00198     enum { CLIPBOARD_NONE, CLIPBOARD_IMAGEMAP, CLIPBOARD_HTML } m_ClipBoardUsage;
00199     typedef enum { MODEL_INVALID, MODEL_RGBHEX, MODEL_RGBPERCENT, MODEL_RGBNUMBER, MODEL_HSV } ColourTypes;
00200     ColourTypes m_ColorModelType;
00201     bool m_MouseInsidePaletteControl;                   // variable used to find out when the mouse leaves
00202                                                         // the palette control
00203     BOOL m_LockSizeUpdates;                             // when we update on sizes
00204 
00205     // Bubble help stuff
00206     BubbleHelpWnd *m_pBubbleWnd;                        // pointer the the bubble help window
00207     UINT32 m_LastCursorOverControlID;                       // the id of the last control the cursor was over
00208     MonotonicTime *m_pBubbleTimer;                      // The timer for the bubble help
00209 
00210 private:    // Statics
00211     static const UINT32 IDD;
00212     static const CDlgMode Mode; 
00213     static OpState GetState(String_256*, OpDescriptor*);    
00214 
00215     static bool m_MovedWindow;
00216         // Have we moved the main window to the correct palce?  (This needs to be static so
00217         // it can be used each time the dialog is created).
00218 
00219 private:    // Init methods for each tab/control
00220 //  void InitTabControls();
00221 
00222     void InitPaletteTab();
00223         void InitPaletteDitheringList();
00224         void InitPalettePaletteList();
00225         void InitPaletteColourDepthList();
00226         void InitPaletteColourModelList();
00227         void InitPaletteButtonStrip();
00228         void InitPaletteSortList();
00229 
00230     void InitBitmapSizeTab();
00231         void InitBitmapSizeDPIList();
00232         void InitBitmapSizeSelectionRadioGroup();
00233         void InitBitmapSizeAntiAlisingRadioGroup();
00234         void InitBitmapSizePutHTMLTick();
00235 
00236     void InitBitmapOptionsTab();
00237 
00238 private:    // Message handlers for each tab/control
00239 
00240     // The Palette Tab
00241     void HandlePaletteTabMsg(DialogMsg* Msg);
00242         // Combo boxes & edit controls
00243         void HandlePaletteDitheringListChange();
00244         void HandlePalettePaletteListChange();
00245         void HandlePaletteColourDepthListChange();
00246         void HandlePaletteColoursUsedChange();
00247         void HandlePaletteColourModelListChange();
00248         void HandlePaletteSortListChange();
00249         void HandlePaletteColourEditChange(CGadgetID id);
00250 
00251         // Button messages
00252         void HandlePaletteLockedColourButtonChange();
00253         void HandlePaletteWebSafeColourButtonChange();
00254         void HandlePaletteTransparentBackgroundButtonChange();
00255         void HandlePaletteTransparentColourButtonChange();
00256         void HandlePaletteDeleteColourButtonChnage();
00257         void HandlePaletteRestoreColourButtonChange();
00258         void HandlePaletteSystemColoursButtonChnage();
00259 
00260     // The Bitmap Size Tab
00261     void HandleBitmapSizeTabMsg(DialogMsg* Msg);
00262         void HandleBitmapSizeDPIChange();
00263         void HandleBitmapSizeWidthChange();
00264         void HandleBitmapSizeHeightChange();
00265         void HandleBitmapSizeAreaToSaveChange(SelectionType type);
00266         void HandleBitmapSizeAntiAliasingChange(BOOL DoMinimise);
00267         void HandleBitmapSizePutHTMLChange();
00268         void HandleBitmapSizeScaleFactorChange();
00269 
00270     void HandleBitmapOptionsTicks(UINT32 tick);
00271 
00272     void HandleBrowserPreviewTabMsg(DialogMsg* Msg);
00273 
00274     void HandleBitmapOptionsTabMsg(DialogMsg* Msg);
00275 
00276     void HandleImageMapTabMsg(DialogMsg* Msg); 
00277 
00278 //  void HandleJPEGTabMsg(DialogMsg* Msg);
00279 
00280 //  void HandlePNGTabMsg(DialogMsg* Msg);
00281 
00282 private:    // Refresh functions to sync the controls with the bitmap export options
00283     // The Palette Tab
00284     void RefreshPaletteOptionsTab();                // This function calls all the functions below it
00285         void RefreshPaletteDitheringList();
00286         void RefreshPalettePaletteList();
00287         void RefreshPaletteColourDepthList();
00288         void RefreshPaletteSortList();
00289         void RefreshPaletteLinkedControls();        // This function calls all the functions below it
00290             void RefreshPaletteColourModelList();
00291             void RefreshPaletteButtonStrip();
00292             void RefreshPaletteColoursUsedEdit();
00293             void RefreshPaletteColoursEdit();
00294 
00295     // The Bitmap Size Tab
00296     void RefreshBitmapSizeTab();
00297         void RefreshBitmapSizeScaleFactor();
00298 
00299     void RefreshBitmapOptionsTab();
00300 
00301     void RefreshImageMapTab();
00302 
00303 //  void RefreshJPEGTab();
00304 
00305 //  void RefreshPNGTab();
00306 };
00307 //#endif // EXCLUDE_FROM_XARALX
00308 #endif
00309 

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