filltool.h

Go to the documentation of this file.
00001 // $Id: filltool.h 1702 2006-08-16 15:21:09Z 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 // The Graduated Fill Tool
00099 
00100 #ifndef INC_GRADFILL
00101 #define INC_GRADFILL
00102 
00103 #include "tool.h"
00104 #include "transop.h"
00105 #include "bars.h"
00106 #include "range.h"
00107 #include "fillattr.h"
00108 #include "lineattr.h"
00109 #include "biasgdgt.h"
00110 #include "bitmapgriddropdown.h"
00111 //#include "selop.h"
00112 #include "brshattr.h"
00113 #include "list.h"
00114 //#include "opbevel.h"
00115 #include "dragtool.h"
00116 
00117 
00118 class Cursor;
00119 class GradInfoBarOp;
00120 class TranspInfoBarOp;
00121 class AttrFillGeometry;
00122 class AttrFillMapping;
00123 class AttrFillEffect;
00124 class SelRange;
00125 class OpApplyAttrInteractive;
00126 
00127 enum FillGeometry
00128 {
00129     FGMENU_FLAT,
00130     FGMENU_LINEAR,
00131     FGMENU_CIRCULAR,
00132     FGMENU_RADIAL,
00133     FGMENU_CONICAL,
00134     FGMENU_SQUARE,
00135     FGMENU_THREECOL,
00136     FGMENU_FOURCOL,
00137     FGMENU_BITMAP,
00138     FGMENU_FRACTAL,
00139     FGMENU_NOISE
00140 };
00141 
00142 #define FGMENU_MANY -1          // cannot be included in above since user cannot select
00143 
00144 enum TransparencyGeometry
00145 {
00146     FGMENU_NOTRANSP,
00147     FGMENU_FLATTRANSP,
00148     FGMENU_LINEARTRANSP,
00149     FGMENU_CIRCULARTRANSP,
00150     FGMENU_RADIALTRANSP,
00151     FGMENU_CONICALTRANSP,
00152     FGMENU_SQUARETRANSP,
00153     FGMENU_THREECOLTRANSP,
00154     FGMENU_FOURCOLTRANSP,
00155     FGMENU_BITMAPTRANSP,
00156     FGMENU_FRACTALTRANSP,
00157     FGMENU_NOISETRANSP
00158 };
00159 
00160 #define FGMENU_MANYTRANSP -1    // cannot be included in above since user cannot select
00161 
00162 enum
00163 {
00164     FTMENU_REFLECT,
00165     FTMENU_SUB,
00166     FTMENU_ADD,
00167     FTMENU_CON,
00168     FTMENU_SAT,
00169     FTMENU_DARK,
00170     FTMENU_LIGHT,
00171     FTMENU_BRI,
00172     FTMENU_LUM,
00173     FTMENU_HUE,
00174 // <-------------Include your next menu item here!!!!
00175     FTMENU_MAX
00176 };
00177 
00178 enum
00179 {
00180     FMMENU_SIMPLE,
00181     FMMENU_REPEATING
00182 };
00183 
00184 enum
00185 {
00186     FEMENU_FADE,
00187     FEMENU_RAINBOW,
00188     FEMENU_ALTRAINBOW
00189 };
00190 
00191 enum
00192 {
00193     FTMENU_SIMPLE,
00194     FTMENU_REPEAT,
00195     FTMENU_REPEATINV
00196 };
00197 
00198 typedef enum
00199 {
00200     FLATFILL,
00201     GRADFILL,
00202     GRADREPEATFILL,
00203     BITMAPFILL,
00204     FRACTALFILL,
00205     NOISEFILL,
00206     MANYFILLS,
00207     NOFILL
00208 } FillMode; 
00209 
00210 double GetDoubleGrain(INT32);
00211 INT32 GetGrainPos(double);
00212 INT32 GetGrainPosMax();
00213 
00214 double GetDoubleScale(INT32);
00215 INT32 GetScalePos(double);
00216 INT32 GetScalePosMax();
00217 
00218 /********************************************************************************************
00219 
00220 >   class FillTools
00221 
00222     Author:     Chris_Snook (Xara Group Ltd) <camelotdev@xara.com> (based upon DMc BevelTools class)
00223     Created:    9/2/2000
00224     Purpose:    Provides functionality for generating a list of AttrFillGeometry nodes.
00225                 This class is used by the profiling function GetProfileFromSelection
00226                 (virtual overide).
00227 
00228                 And I'm fed up with explaining why this class exists, so here is a short
00229                 and blunt explanation:
00230 
00231                 "we have to do a couple of extra things, so its much better to have the
00232                 functionality here than it is to go mucking up things as far as bevel nodes
00233                 etc. are concerned.
00234 
00235 ********************************************************************************************/
00236 
00237 class FillTools
00238 {
00239 public:
00240     // builds a list of all selected nodes of given class
00241 //  static BOOL BuildListOfSelectedNodes(List *pList,
00242 //                              const CCRuntimeClass * pClass,
00243 //                              BOOL bPromoteToParents = TRUE);
00244 //  static BOOL BuildListOfSelectedAttrs(List *pList,
00245 //                              const CCRuntimeClass * pClass,
00246 //                              BOOL bPromoteToParents = TRUE);
00247 //
00248 //  // recursion down to find nodes
00249 //  static BOOL GetAllNodesUnderNode(const Node * pNode, List * pList,
00250 //      const CCRuntimeClass * pClass, INT32 depth = 0);
00251 //
00252 //  // finds the parent of the given node, the one which is a child of
00253 //  // the spread. Used to get the root of a hierarchy.
00254 
00255     static BOOL GetSelectedAttrList(List* pList,
00256                                     const CCRuntimeClass* pClass,
00257                                     BOOL bGradFill,
00258                                     BOOL bTranspFill,
00259                                     EffectsStack* pUseThisStack = NULL);
00260 
00261 private:
00262     static BOOL IsNodeInList(List * pList, const Node * pNode);
00263     static BOOL IsNodeTrueFill(const Node * pNode);
00264     static BOOL bScanForTransparency;
00265 };
00266 
00267 /********************************************************************************************
00268 
00269 >   class CCAPI GradFillTool : public Tool_v1
00270 
00271     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00272     Created:    3/10/94
00273     Purpose:    The fill tool.
00274 
00275 ********************************************************************************************/
00276 
00277 class CCAPI GradFillTool : public DragTool
00278 {
00279 // Give my name in memory dumps
00280 CC_DECLARE_MEMDUMP(GradFillTool);
00281 
00282 public:
00283     GradFillTool();
00284     ~GradFillTool();
00285     BOOL Init();
00286     void Describe(void* InfoPtr);
00287     UINT32 GetID() { return TOOLID_GRADFILL; };
00288     
00289     // Event Handlers
00290     virtual void SelectChange(BOOL);
00291     virtual void OnClick( DocCoord, ClickType, ClickModifiers, Spread* );
00292     virtual void OnMouseMove(DocCoord Pos, Spread* pSpread, ClickModifiers ClickMods);
00293     virtual BOOL OnKeyPress(KeyPress* pKeyPress);
00294 
00295     virtual BOOL GetStatusLineText(String_256*, Spread*, DocCoord, ClickModifiers);
00296     void GetCursorAndStatus(DocCoord, Spread*, Cursor**, String_256*);
00297 
00298     static BOOL IsCurrentTool() { return CurrentTool; }
00299 
00300     void    ToggleControlPoints(BOOL Reverse);
00301 
00302     static void EnableFillNudge(); 
00303     static void DisableFillNudge();
00304     static BOOL IsFillNudgeEnabled();
00305 
00306 public:
00307     static  BOOL AllowFillNudges;
00308 
00309 private:
00310     static  TCHAR* FamilyName;  // The Tools Family Name
00311     static  TCHAR* ToolName;        // The Tool Name
00312     static  TCHAR* Purpose;     // What the tool is for
00313     static  TCHAR* Author;      // Who wrote it
00314 
00315     static void DisplayStatusBarHelp(UINT32 StatusID);
00316 
00317     static UINT32 LastStatusID;
00318 
00319     static BOOL CurrentTool;
00320     
00321     // info about clicks as they arrive
00322     DocCoord ClickStart;        // Where the first click was clicked
00323     DocCoord StartPos;          
00324     Spread*  StartSpread;       // The spread where we received the first click
00325 
00326     // The bounding box of the selection
00327     DocRect  SelectionBox;
00328 
00329     // A count of the number of selected object when the tool was selected
00330     BOOL     IsSelection;
00331 
00332     // The tools cursors
00333     Cursor*  pCurrentCursor;
00334     Cursor*  pGradFillCursor;
00335     Cursor*  pGradPointCursor;
00336 
00337     INT32 CurrentCursorID;
00338 
00339     static GradInfoBarOp*   pGradInfoBarOp;
00340     static TranspInfoBarOp* pTranspInfoBarOp;
00341 
00342     AttrFillGeometry* EditingFill;
00343     BOOL DoubleClicked;
00344     BOOL OpBusy;
00345 
00346     static BOOL NudgeFills;
00347 };
00348 
00349 /********************************************************************************************
00350 
00351 >   class CCAPI TranspTool : public Tool_v1
00352 
00353     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00354     Created:    3/10/94
00355     Purpose:    The transparency tool.
00356 
00357 ********************************************************************************************/
00358 
00359 class CCAPI TranspTool : public DragTool
00360 {
00361 // Give my name in memory dumps
00362 CC_DECLARE_MEMDUMP(TranspTool);
00363 
00364 public:
00365     TranspTool();
00366     ~TranspTool();
00367     BOOL Init();
00368     void Describe(void* InfoPtr);
00369     UINT32 GetID() { return TOOLID_TRANSP; };
00370     
00371     // Event Handlers
00372     virtual void SelectChange(BOOL);
00373     virtual void OnClick( DocCoord, ClickType, ClickModifiers, Spread* );
00374     virtual void OnMouseMove(DocCoord Pos, Spread* pSpread, ClickModifiers ClickMods);
00375     virtual BOOL OnKeyPress(KeyPress* pKeyPress);
00376 
00377     virtual BOOL GetStatusLineText(String_256*, Spread*, DocCoord, ClickModifiers);
00378     void GetCursorAndStatus(DocCoord, Spread*, Cursor**, String_256*);
00379 
00380     static BOOL IsCurrentTool() { return CurrentTool; }
00381 
00382     void    ToggleControlPoints(BOOL Reverse);
00383 
00384     static void EnableFillNudge();
00385     static void DisableFillNudge();
00386     static BOOL IsFillNudgeEnabled();
00387 
00388 private:
00389     static  TCHAR* FamilyName;  // The Tools Family Name
00390     static  TCHAR* ToolName;        // The Tool Name
00391     static  TCHAR* Purpose;     // What the tool is for
00392     static  TCHAR* Author;      // Who wrote it
00393 
00394     static void DisplayStatusBarHelp(UINT32 StatusID);
00395 
00396     static UINT32 LastStatusID;
00397 
00398     static BOOL CurrentTool;
00399     
00400     // info about clicks as they arrive
00401     DocCoord ClickStart;        // Where the first click was clicked
00402     DocCoord StartPos;          
00403     Spread*  StartSpread;       // The spread where we received the first click
00404 
00405     // The bounding box of the selection
00406     DocRect  SelectionBox;
00407 
00408     // A count of the number of selected object when the tool was selected
00409     BOOL     IsSelection;
00410 
00411     // The tools cursors
00412     Cursor*  pCurrentCursor;
00413     Cursor*  pTranspCursor;
00414     Cursor*  pTranspPointCursor;
00415 
00416     INT32 CurrentCursorID;
00417 
00418     static TranspInfoBarOp* pTranspInfoBarOp;
00419 
00420     AttrFillGeometry* EditingFill;
00421     BOOL DoubleClicked;
00422     BOOL OpBusy;
00423 
00424     static BOOL NudgeFills;
00425 };
00426 
00427 /********************************************************************************************
00428 
00429 >   class GradInfoBarOp : public InformationBarOp
00430 
00431     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00432     Created:    3/8/94
00433     Purpose:    Class for handling the gradfill tool's information bar.
00434 
00435 ********************************************************************************************/
00436 
00437 class GradInfoBarOp : public InformationBarOp
00438 {
00439     CC_DECLARE_DYNCREATE( GradInfoBarOp )  
00440 public:
00441     GradInfoBarOp(ResourceID r=_R(IDD_GRADTOOLBAR)) {DlgResID=r;}               // Dummy default constructor for DYNCREATE
00442 
00443     MsgResult   Message(Msg* Msg);  // All messages to the info bar come through here
00444 
00445     void        InitControls();     // Initialises the controls in the info bar
00446     void        EnableControls();   // Enables/disables the controls in the info bar
00447 
00448     void        ShowInfo();
00449 
00450     // A set of routines for displaying information in the info bar
00451     void        ShowFlatInfo();
00452     void        ShowGraduatedInfo();
00453 //  void        ShowRepeatGraduatedInfo();
00454     void        ShowBitmapInfo();
00455     void        ShowFractalInfo();
00456     void        ShowNoiseInfo();
00457 
00458     void        ShowCommonType(BOOL ShowDataAndNotSet = TRUE);
00459     void        ShowCommonMapping(BOOL ShowDataAndNotSet = TRUE);
00460     void        ShowCommonEffect(BOOL ShowDataAndNotSet = TRUE);
00461     void        ShowCommonTesselate();
00462     void        ShowCommonBitmapName();
00463     void        ShowCommonBitmapDpi();
00464     void        ShowControlPointInfo();
00465     void        ShowCommonFractalGrain();
00466     void        ShowCommonNoiseScale();
00467 
00468 private:
00469     void ChangeProfile(CProfileBiasGain* Profile, CGadgetID GadgetID);
00470     CProfileBiasGain* GetProfileFromSelection(CGadgetID GadgetID, BOOL* bMany, BOOL* bAllSameType);
00471     
00472     void        ChangeFillType();
00473     void        ChangeFillMapping();
00474     void        ChangeFillEffect();
00475 
00476     void        ChangeDPI();
00477     void        ChangeFractalGrain();
00478     void        ChangeNoiseScale();
00479     void        ChangeBitmapName();
00480 
00481     void        SetGadgetWritable(INT32, BOOL);
00482     BOOL        GetGadgetWritable (INT32);
00483 
00484     INT32       FindCommonTesselate();
00485     String_256  FindCommonBitmapName();
00486     INT32       FindCommonBitmapDpi();
00487     double      FindCommonFractalGrain();
00488     double      FindCommonNoiseScale();
00489 
00490     String_64   GetSelectedPoint(AttrFillGeometry*);
00491     String_64   GetSelectedColour(AttrFillGeometry*);
00492     String_64   GetColourName(DocColour&);
00493     void        ScanSelectionForControlPoints(String_64* ,String_64*);
00494 
00495     AttrFillGeometry* GetCurrentGeometry();
00496     AttrFillMapping*  GetCurrentMapping();
00497 
00498     AttrFillGeometry* MakeFillMutator();
00499 
00500     BOOL SetGadgetString(CGadgetID Gadget, StringBase* StrValue);
00501 
00502     void InitEffect();
00503     void InitMapping();
00504     void InitBitmapName();
00505     void InitTesselate();
00506 
00507 public:
00508     static INT32 CurrentGeometryIndex;
00509     static INT32 CurrentMappingIndex;
00510     static INT32 CurrentEffectIndex;
00511 
00512     static INT32 CurrentTesselateIndex;
00513     static INT32 CurrentBitmapIndex;
00514 
00515     SelRange *Selection;        // Can't be changed in this tool
00516     SelRange::CommonAttribResult CommonAttr;
00517     SelRange::CommonAttribResult CommonAttrEffect;
00518     SelRange::CommonAttribResult CommonAttrMap;
00519 
00520 private:
00521     FillMode Mode;
00522     FillMode OldMode;
00523 
00524     BOOL BitmapListChanged;
00525 
00526     BOOL MappingDisabled;
00527     BOOL EffectDisabled;
00528     BOOL AllowForceToSimpleMapping;
00529 
00530     AttrFillGeometry* CommonGeometry;
00531     AttrFillMapping* CommonMapping;
00532     AttrFillEffect* CommonEffect;
00533 
00534     INT32 SelGeometryIndex;
00535     INT32 SelMappingIndex;
00536     INT32 SelEffectIndex;
00537 
00538     INT32 SelPointIndex;
00539     INT32 SliderMax;
00540 
00541 public:
00542     CBiasGainGadget     m_BiasGainGadget;   // Gadget for invoking bias gain dialog
00543     CBitmapGridDropDown m_oBitmapDropDown;  // bitmap selector combobox.
00544 };
00545     
00546 
00547 /********************************************************************************************
00548 
00549 >   class GradInfoBarOpCreate : public BarCreate
00550 
00551     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00552     Created:    3/8/94
00553     Purpose:    Class for creating GradInfoBarOps.
00554                 Derived classes of BarCreate are used by DialogBarOp::ReadBarsFromFile()
00555 
00556 ********************************************************************************************/
00557 
00558 class GradInfoBarOpCreate : public BarCreate
00559 {
00560 public:
00561     DialogBarOp*    Create() { return (new GradInfoBarOp); }
00562 };
00563 
00564 /********************************************************************************************
00565 
00566 >   class TranspInfoBarOp : public InformationBarOp
00567 
00568     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00569     Created:    3/8/94
00570     Purpose:    Class for handling the gradfill tool's information bar.
00571 
00572 ********************************************************************************************/
00573 
00574 class TranspInfoBarOp : public InformationBarOp
00575 {
00576     CC_DECLARE_DYNCREATE( TranspInfoBarOp )  
00577 public:
00578     TranspInfoBarOp(ResourceID r=_R(IDD_ZOOMTOOLBAR)) {DlgResID=r; m_pAttrApplyOp = NULL; m_pDragTransp = NULL;}
00579 
00580     MsgResult   Message(Msg* Msg);  // All messages to the info bar come through here
00581 
00582     void        InitControls();     // Initialises the controls in the info bar
00583     void        EnableControls();   // Enables/disables the controls in the info bar
00584 
00585     void        ShowInfo();
00586 
00587     // A set of routines for displaying information in the info bar
00588     void        ShowFlatInfo();
00589     void        ShowGraduatedInfo();
00590 //  void        ShowRepeatGraduatedInfo();
00591     void        ShowBitmapInfo();
00592     void        ShowFractalInfo();
00593     void        ShowNoiseInfo();
00594 
00595     void        ShowCommonType(BOOL ShowDataAndNotSet = TRUE);
00596     void        ShowCommonMapping(BOOL ShowDataAndNotSet = TRUE);
00597     void        ShowCommonTranspType (BOOL ShowDataAndNotSet = TRUE);
00598     void        ShowCommonTesselate();
00599     void        ShowCommonBitmapName();
00600     void        ShowCommonBitmapDpi();
00601     void        ShowControlPointInfo();
00602     void        ShowCommonFractalGrain();
00603     void        ShowCommonNoiseScale();
00604 
00605     UINT32      GetTranspType() { return CurrentTransTypeIndex + 1; }
00606 
00607 private:
00608     void ChangeProfile(CProfileBiasGain* Profile, CGadgetID GadgetID);
00609     CProfileBiasGain* GetProfileFromSelection(CGadgetID GadgetID, BOOL* bMany, BOOL* bAllSameType);
00610     
00611     void        ChangeFillType();
00612     void        ChangeFillMapping();
00613     BOOL        ChangeBitmapName();
00614     void        ChangeTranspType();
00615 
00616     void        ChangeDPI ();
00617     void        ChangeTransparencyValue ();
00618     void        ChangeFractalGrain (BOOL useEditbox = FALSE);
00619     void        ChangeNoiseScale (BOOL useEditbox = FALSE);
00620 
00621     void        SetGadgetWritable(INT32, BOOL);
00622     BOOL        GetGadgetWritable (INT32);
00623 
00624     String_64   GetSelectedPoint(AttrFillGeometry*);
00625     UINT32      GetSelectedTransp(AttrFillGeometry*);
00626     void        ScanSelectionForControlPoints(String_64* ,INT32*);
00627 
00628     INT32       FindCommonTranspType();
00629     INT32       FindCommonTesselate();
00630     String_64   FindCommonBitmapName();
00631     INT32       FindCommonBitmapDpi();
00632     double      FindCommonFractalGrain();
00633     double      FindCommonNoiseScale();
00634 
00635     void        SetTranspValue(UINT32, BOOL bIntermediateStep = FALSE, BOOL bFirstStep = FALSE);
00636 
00637     AttrFillGeometry*       GetCurrentGeometry();
00638 //  AttrPaintingMode* GetCurrentPaintingMode ();
00639     AttrTranspFillMapping*  GetCurrentMapping();
00640 
00641     AttrFillGeometry* MakeFillMutator();
00642 
00643     BOOL SetGadgetString(CGadgetID Gadget, StringBase* StrValue);
00644 
00645     void InitMapping();
00646     void InitBitmapName();
00647     void InitTesselate();
00648     void InitTransType();
00649 
00650     void DisplayTransparencyPercentString (double value);
00651 
00652     // bodgey fn. to let brush attributes know when transparency is being applied
00653     void UpdateBrushAttributes();  
00654 
00655 public:
00656     static INT32 CurrentGeometryIndex;
00657     static INT32 CurrentTransTypeIndex;
00658     static INT32 CurrentMappingIndex;
00659     static INT32 CurrentTypeIndex;
00660 
00661     static INT32 CurrentTesselateIndex;
00662     static INT32 CurrentBitmapIndex;
00663 
00664     SelRange *Selection;        // Can't be changed in this tool
00665     SelRange::CommonAttribResult CommonAttr;
00666     SelRange::CommonAttribResult CommonAttrMap;
00667 
00668 private:
00669     FillMode Mode;
00670     FillMode OldMode;
00671 
00672     BOOL BitmapListChanged;
00673 
00674     BOOL MappingDisabled;
00675     BOOL TypeDisabled;
00676     BOOL AllowForceToSimpleMapping;
00677 
00678     AttrFillGeometry* CommonGeometry;
00679     AttrFillMapping* CommonMapping;
00680 
00681     INT32 SelGeometryIndex;
00682     INT32 SelMappingIndex;
00683     INT32 SelTypeIndex;
00684 
00685     BOOL SliderDragged;
00686     INT32 SliderMax;
00687 
00688     INT32 LastSliderPos;
00689 
00690     OpApplyAttrInteractive* m_pAttrApplyOp;
00691     AttrValueChange* m_pDragTransp;
00692 
00693 public:
00694     CBiasGainGadget     m_BiasGainGadget;   // Gadget for invoking the bias gain dialog.
00695     CBitmapGridDropDown m_oBitmapDropDown;  // bitmap selector combobox.
00696 };
00697 
00698 /********************************************************************************************
00699 
00700 >   class TranspInfoBarOpCreate : public BarCreate
00701 
00702     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00703     Created:    3/8/94
00704     Purpose:    Class for creating TranspInfoBarOps.
00705                 Derived classes of BarCreate are used by DialogBarOp::ReadBarsFromFile()
00706 
00707 ********************************************************************************************/
00708 
00709 class TranspInfoBarOpCreate : public BarCreate
00710 {
00711 public:
00712     DialogBarOp*    Create() { return (new TranspInfoBarOp); }
00713 };
00714 
00715 /***********************************************************************************************
00716 
00717 >   class AttrRemoveTransp : public AttrTranspChange
00718 
00719     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00720     Created:    1/4/94
00721     Purpose:    Removes the transparency from objects.
00722                 This Attribute never exists in the Tree.  It is used for changing the Transp
00723                 of an existing Fill Geometry.
00724     SeeAlso:    AttrFillGeometry
00725 
00726 ***********************************************************************************************/
00727 
00728 class AttrRemoveTransp : public AttrTranspChange
00729 {
00730     CC_DECLARE_DYNCREATE(AttrRemoveTransp)
00731     
00732 public:
00733     AttrRemoveTransp() {}
00734 
00735     virtual AttrFillGeometry* MutateFill(AttrFillGeometry* FillToMutate);
00736 
00737     // This routine returns any secondary attribute that needs to be changed,
00738     // when this attribute is changed.
00739     virtual NodeAttribute* GetOtherAttrToApply(BOOL* IsMutate);
00740 };
00741 
00742 /***********************************************************************************************
00743 
00744 >   class AttrRemoveTransp : public AttrTranspChange
00745 
00746     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00747     Created:    1/4/94
00748     Purpose:    Removes the transparency from objects.
00749                 This Attribute never exists in the Tree.  It is used for changing the Transp
00750                 of an existing Fill Geometry.
00751     SeeAlso:    AttrFillGeometry
00752 
00753 ***********************************************************************************************/
00754 
00755 class AttrRemoveStrokeTransp : public AttrValueChange
00756 {
00757     CC_DECLARE_DYNCREATE(AttrRemoveStrokeTransp)
00758     
00759 public:
00760     AttrRemoveStrokeTransp() : AttrValueChange() {}
00761 
00762     virtual AttributeValue* GetAttributeValue() { return &Value; }
00763     virtual CCRuntimeClass* GetAttributeType() { return CC_RUNTIME_CLASS(AttrStrokeTransp); }
00764 
00765     virtual AttrFillGeometry* MutateFill(AttrFillGeometry* FillToMutate);
00766 
00767 protected:
00768     StrokeTranspAttribute Value;
00769 };
00770 
00771 /***********************************************************************************************
00772 
00773 >   class AttrMakeFlatTransp : public AttrTranspChange
00774 
00775     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00776     Created:    1/4/94
00777     Purpose:    Force object to be 50% transparent
00778                 This Attribute never exists in the Tree.  It is used for changing the Transp
00779                 of an existing Fill Geometry.
00780     SeeAlso:    AttrFillGeometry
00781 
00782 ***********************************************************************************************/
00783 
00784 class AttrMakeFlatTransp : public AttrTranspChange
00785 {
00786     CC_DECLARE_DYNCREATE(AttrMakeFlatTransp)
00787     
00788 public:
00789     AttrMakeFlatTransp() {}
00790 
00791     virtual AttrFillGeometry* MutateFill(AttrFillGeometry* FillToMutate);
00792 
00793     // This routine returns any secondary attribute that needs to be changed,
00794     // when this attribute is changed.
00795     virtual NodeAttribute* GetOtherAttrToApply(BOOL* IsMutate);
00796 };
00797 
00798 /***********************************************************************************************
00799 
00800 >   class FillProfileOpParam : public OpParam
00801 
00802     Author:     Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
00803     Created:    7/2/2000
00804     Purpose:    Serves as our param passing stuff for undo/redo of fill profile changing.
00805     SeeAlso:
00806 
00807 ***********************************************************************************************/
00808 
00809 class FillProfileOpParam : public OpParam
00810 {
00811     CC_DECLARE_DYNCREATE(FillProfileOpParam)
00812 
00813 public:
00814     FillProfileOpParam() { };
00815     ~FillProfileOpParam() { };
00816 
00817 public:
00818     CProfileBiasGain Profile;
00819     
00820 };
00821 
00822 /********************************************************************************************
00823 
00824 >   class OpChangeFillProfile : public SelOperation
00825 
00826     Author:     Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
00827     Created:    7/2/2000
00828     Purpose:    The operation class that is responsible for changing fill profiles.
00829     SeeAlso:    -
00830 
00831 ********************************************************************************************/
00832 
00833 #define OPTOKEN_FILLPROFILE _T("FillProfile")               // our all important optoken!
00834 
00835 class OpChangeFillProfile : public SelOperation
00836 {
00837     CC_DECLARE_DYNCREATE(OpChangeFillProfile)
00838 
00839 public:
00840     OpChangeFillProfile();
00841     ~OpChangeFillProfile();
00842 
00843     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00844     static OpState GetState(String_256* Description, OpDescriptor*);
00845     static BOOL Declare();
00846 };
00847 
00848 /********************************************************************************************
00849 
00850 >   class ChangeFillProfileAction : public Action
00851 
00852     Author:     Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
00853     Created:    7/2/2000
00854     Purpose:    Action for changing fill profiles
00855     SeeAlso:    -
00856 
00857 ********************************************************************************************/
00858 
00859 class ChangeFillProfileAction : public Action
00860 {
00861 
00862 CC_DECLARE_DYNCREATE(ChangeFillProfileAction)
00863 
00864 public:
00865     ChangeFillProfileAction();
00866     ~ChangeFillProfileAction();
00867 
00868     virtual ActionCode Execute();
00869     static ActionCode Init( Operation* pOp,
00870                             ActionList* pActionList,
00871                             AttrFillGeometry* pThisNodeFill,
00872                             CProfileBiasGain &Profile,
00873                             ChangeFillProfileAction** NewAction,
00874                             BOOL bReverse = TRUE,
00875                             BOOL bCache = FALSE);
00876 
00877     static void ChangeFillProfileWithNoUndo (CProfileBiasGain &Profile);
00878 protected:
00879     AttrFillGeometry* m_pNodeFill;
00880     CProfileBiasGain m_LastProfile; 
00881 };
00882 
00883 /***********************************************************************************************
00884 
00885 >   class TranspFillProfileOpParam : public OpParam
00886 
00887     Author:     Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
00888     Created:    10/2/2000
00889     Purpose:    Serves as our param passing stuff for undo/redo of transp fill profile changing.
00890     SeeAlso:
00891 
00892 ***********************************************************************************************/
00893 
00894 class TranspFillProfileOpParam : public OpParam
00895 {
00896     CC_DECLARE_DYNCREATE(TranspFillProfileOpParam)
00897 
00898 public:
00899     TranspFillProfileOpParam() { };
00900     ~TranspFillProfileOpParam() { };
00901 
00902 public:
00903     CProfileBiasGain Profile;
00904     
00905 };
00906 
00907 /********************************************************************************************
00908 
00909 >   class OpChangeTranspFillProfile : public SelOperation
00910 
00911     Author:     Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
00912     Created:    10/2/2000
00913     Purpose:    The operation class that is responsible for changing transp fill profiles.
00914     SeeAlso:    -
00915 
00916 ********************************************************************************************/
00917 
00918 #define OPTOKEN_TRANSPFILLPROFILE   _T("TranspFillProfile")         // our all important optoken!
00919 
00920 class OpChangeTranspFillProfile : public SelOperation
00921 {
00922     CC_DECLARE_DYNCREATE(OpChangeTranspFillProfile)
00923 
00924 public:
00925     OpChangeTranspFillProfile();
00926     ~OpChangeTranspFillProfile();
00927 
00928     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00929     static OpState GetState(String_256* Description, OpDescriptor*);
00930     static BOOL Declare();
00931 };
00932 
00933 /********************************************************************************************
00934 
00935 >   class ChangeTranspFillProfileAction : public Action
00936 
00937     Author:     Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
00938     Created:    10/2/2000
00939     Purpose:    Action for changing transp fill profiles
00940     SeeAlso:    -
00941 
00942 ********************************************************************************************/
00943 
00944 class ChangeTranspFillProfileAction : public Action
00945 {
00946 
00947 CC_DECLARE_DYNCREATE(ChangeTranspFillProfileAction)
00948 
00949 public:
00950     ChangeTranspFillProfileAction();
00951     ~ChangeTranspFillProfileAction();
00952 
00953     virtual ActionCode Execute();
00954     static ActionCode Init( Operation* pOp,
00955                             ActionList* pActionList,
00956                             AttrFillGeometry* pThisNodeTranspFill,
00957                             CProfileBiasGain &Profile,
00958                             ChangeTranspFillProfileAction** NewAction,
00959                             BOOL bReverse = TRUE,
00960                             BOOL bCache = FALSE);
00961 
00962     static void ChangeTranspFillProfileWithNoUndo (CProfileBiasGain &Profile);
00963 protected:
00964     AttrFillGeometry* m_pNodeTranspFill;
00965     CProfileBiasGain m_LastProfile; 
00966 };
00967 
00968 
00969 #endif

Generated on Sat Nov 10 03:47:37 2007 for Camelot by  doxygen 1.4.4