fillattr.h

Go to the documentation of this file.
00001 // $Id: fillattr.h 1272 2006-06-08 17:01:06Z 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 // This file holds all the AttributeValue and NodeAttribute classes to do with path
00100 // filling attributes.
00101 
00102 // fillattr.h has been split into two. This contains essentially the implementation or
00103 // specific classes. Not many files should need to include this. This MUST NOT include
00104 // fillval.h - see fillattr2.h for the rest
00105 
00106 #ifndef INC_FILLATTR
00107 #define INC_FILLATTR
00108 
00109 #include "attr.h"
00110 #include "nodeattr.h"
00111 #include "msg.h"
00112 #include "bitmap.h"
00113 #include "list.h"
00114 #include "binds.h"
00115 #include "clikmods.h"
00116 
00117 
00118 class TransparencyRamp;
00119 class ColourRamp;
00120 class CProfileBiasGain;
00121 class FillGeometryAttribute;
00122 class AttrValueChange;
00123 class AttrColourChange;
00124 class AttrTranspChange;
00125 class AttrColourDrop;
00126 class FillRamp;
00127 class AttrColFillRampChange;
00128 class AttrTranspFillRampChange;
00129 class UndoableOperation;
00130 class SelectedAttrs;
00131 class MouldGeometry;
00132 class NodeMould;
00133  
00134 /********************************************************************************************
00135 
00136 < FillControl
00137 
00138     Comment:    An Enum, specifying a particular Fill Control Point.
00139 
00140                 MonoOn
00141                 FILLCONTROL_STARTPOINT,
00142                 FILLCONTROL_ENDPOINT,
00143                 FILLCONTROL_SECONDARYPOINT,
00144                 FILLCONTROL_ENDPOINT2,
00145                 FILLCONTROL_ENDPOINT3,
00146                 FILLCONTROL_DRAGPOINT,
00147                 FILLCONTROL_DRAGPOINT2,
00148                 FILLCONTROL_DRAGPOINT3,
00149                 FILLCONTROL_MANY,
00150                 FILLCONTROL_NULL
00151                 MonoOff
00152             
00153                 FILLCONTROL_NULL is used in Hit Testing to indicate no control was hit.
00154 
00155 ********************************************************************************************/
00156 
00157 typedef INT32 FillControl;
00158 
00159 enum
00160 {
00161     FILLCONTROL_STARTPOINT,
00162     FILLCONTROL_ENDPOINT,
00163     FILLCONTROL_ENDPOINT2,
00164     FILLCONTROL_ENDPOINT3,
00165     FILLCONTROL_SECONDARYPOINT,
00166     FILLCONTROL_DRAGPOINT,
00167     FILLCONTROL_DRAGPOINT2,
00168     FILLCONTROL_DRAGPOINT3,
00169     FILLCONTROL_MANY,
00170     FILLCONTROL_RAMPPOINT,
00171     FILLCONTROL_NULL
00172 };
00173 
00174 enum
00175 {
00176     BLOBSTATE_OFF,
00177     BLOBSTATE_ON,
00178     BLOBSTATE_TOGGLE
00179 };
00180 
00181 #define NUMCONTROLPOINTS FILLCONTROL_NULL
00182 
00183 #define DEFAULT_FILLWIDTH 72000;
00184 #define DEFAULT_FILLHEIGHT 72000;
00185 
00186 #define ATTRVALUE() ((FillGeometryAttribute*)GetAttributeValue())
00187 
00189 //
00190 //                              NodeAttribute classes
00191 //
00193 
00194 
00195 /********************************************************************************************
00196 
00197 >   class AttrFillGeometry : public NodeAttribute
00198 
00199     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00200     Created:    18/07/94
00201     Purpose:    Fill Geometry Attribute class.
00202     SeeAlso:    FillGeometryAttribute
00203 
00204 ***********************************************************************************************/
00205 
00206 class AttrFillGeometry : public NodeAttribute
00207 {
00208     CC_DECLARE_DYNCREATE(AttrFillGeometry)
00209     
00210 public:
00211     AttrFillGeometry();
00212     ~AttrFillGeometry();
00213     AttrFillGeometry(Node* ContextNode,  
00214                  AttachNodeDirection Direction,    
00215                  BOOL Locked=FALSE, 
00216                  BOOL Mangled=FALSE,  
00217                  BOOL Marked=FALSE, 
00218                  BOOL Selected=FALSE): 
00219         NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}
00220 
00221     static BOOL Init();
00222 
00223     virtual INT32 operator==(const NodeAttribute& NodeAttrib);
00224     virtual INT32 operator=(AttrFillGeometry& FillAttrib);
00225 
00226     // Funcions for rendering the Fill Mesh
00227     virtual void RenderFillBlobs(RenderRegion* pRender) {}
00228     virtual void RenderFillMesh(RenderRegion*, DocCoord* , BOOL*, INT32 NumControlPoints = 0) {}
00229     virtual void RenderFillBlobs();
00230     
00231     // The following allow us to redraw multi-stage fill with no flicker ....
00232     BOOL AllowRampRedraw;
00233     void DisableRampRedraw () { AllowRampRedraw = FALSE; }
00234     void EnableRampRedraw () { AllowRampRedraw = TRUE; }
00235 
00236     // The following allow us to redraw only particular parts of a fills mesh when
00237     // dragging a multi-stage fill blob ....
00238     BOOL AllowBoundsRedraw;
00239     void DisableBoundsRedraw () { AllowBoundsRedraw = FALSE; }
00240     void EnableBoundsRedraw () { AllowBoundsRedraw = TRUE; }
00241 
00242     virtual void DrawEndBlobs();
00243 
00244     virtual DocColour* GetStartColour();
00245     virtual DocColour* GetEndColour();
00246     virtual DocColour* GetEndColour2();
00247     virtual DocColour* GetEndColour3();
00248     virtual UINT32*    GetStartTransp();
00249     virtual UINT32*    GetEndTransp();
00250     virtual UINT32*    GetEndTransp2();
00251     virtual UINT32*    GetEndTransp3();
00252     virtual DocCoord*  GetStartPoint();
00253     virtual DocCoord*  GetEndPoint();
00254     virtual DocCoord*  GetEndPoint2();
00255     virtual DocCoord*  GetEndPoint3();
00256     virtual CProfileBiasGain& GetProfile ();
00257 
00258     virtual void SetStartColour(DocColour* NewCol);
00259     virtual void SetEndColour(DocColour* NewCol);
00260     virtual void SetEndColour2(DocColour* NewCol);
00261     virtual void SetEndColour3(DocColour* NewCol);
00262     virtual void SetStartTransp(UINT32* NewTransp);
00263     virtual void SetEndTransp(UINT32* NewTransp);
00264     virtual void SetEndTransp2(UINT32* NewTransp);
00265     virtual void SetEndTransp3(UINT32* NewTransp);
00266     virtual void SetStartPoint(DocCoord* Pos);
00267     virtual void SetEndPoint(DocCoord* Pos);
00268     virtual void SetEndPoint2(DocCoord* Pos);
00269     virtual void SetEndPoint3(DocCoord* Pos);
00270     virtual void SetProfile (CProfileBiasGain& SetWith);
00271 
00272     virtual UINT32  GetTranspType();
00273     virtual UINT32  GetDPI();
00274     virtual UINT32  GetFractalDPI();
00275     virtual UINT32  GetFractalDim();
00276     virtual INT32    GetSeed();
00277     virtual FIXED16 GetGraininess();
00278     virtual FIXED16 GetGravity();
00279     virtual FIXED16 GetSquash();
00280     virtual BOOL    GetTileable();
00281     virtual double  GetNoiseScale();
00282 
00283     virtual void    SetTranspType(UINT32 NewType);
00284     virtual BOOL    SetDPI(UINT32 NewDpi);
00285     virtual BOOL    SetFractalDPI(UINT32 NewDpi);
00286     virtual void    SetFractalDim(UINT32 NewDim);
00287     virtual BOOL    SetSeed(INT32 NewSeed);
00288     virtual BOOL    SetGraininess(FIXED16 NewGrain);
00289     virtual BOOL    SetGravity(FIXED16 NewGrav);
00290     virtual BOOL    SetSquash(FIXED16 NewSquash);
00291     virtual BOOL    SetTileable(BOOL NewTile);
00292     virtual BOOL    SetNoiseScale(double ns);
00293 
00294     virtual BOOL RecalcFractal();
00295     virtual BOOL Randomise();
00296 
00297     virtual BOOL AttachBitmap(KernelBitmap* NewBitmap);
00298     virtual BOOL DetachBitmap();
00299     virtual KernelBitmap* GetBitmap();
00300     virtual BOOL CopyBitmap(KernelBitmap* CopyBitmap);
00301 
00302     virtual KernelBitmapRef* GetBitmapRef();
00303 
00304     virtual INT32 GetTesselation();
00305     virtual void SetTesselation(INT32 NewTess);
00306 
00307     virtual BOOL IsPerspective();
00308     virtual ColourRamp*       GetColourRamp();
00309     virtual TransparencyRamp* GetTranspRamp();
00310     virtual void          SetColourRamp(ColourRamp* New);
00311     virtual void          SetTranspRamp(TransparencyRamp* New);
00312 
00313     virtual void MakePerspective(UndoableOperation* pUndoOp = NULL);
00314     virtual void RemovePerspective(UndoableOperation* pUndoOp = NULL);
00315 
00316     virtual DocColour *EnumerateColourFields(UINT32 Context);
00317 
00318     virtual AttributeValue* GetAttributeValue() = 0;
00319     virtual DocRect GetBlobBoundingRect();
00320     virtual ANGLE GetSecondaryAngle() { return 0; }
00321 
00322     FillRamp*         GetFillRamp();
00323 
00324     // get some data from this fill.
00325     DocColour*  GetFirstSelectedColour();
00326     UINT32*     GetFirstSelectedTransp();
00327     INT32       GetFirstSelectedIndex();
00328 
00329     // Bodge Functions for Current Attribute Transformation
00330     DocRect GetBoundingRect() { return AttrBounds; }
00331     void SetBoundingRect(DocRect &NewBounds);
00332     BOOL WriteBoundingRect(BaseCamelotFilter* pFilter);
00333 
00334     // Functions to cope with the selections of Control Points
00335     virtual BOOL OnClick( DocCoord, ClickType, ClickModifiers, Spread * );
00336 
00337     virtual void GetControlPoints(DocCoord*, INT32);    
00338     virtual void OnControlDrag( DocCoord, FillControl&, ClickModifiers );
00339     virtual void SetAspectRatio(double Ratio);
00340 
00341     UINT32 GetSelectionState(BOOL**);
00342     BOOL IsSelected(UINT32 Control);
00343 
00344     UINT32 GetSelectionCount();
00345     UINT32 GetBlobCount(BOOL IncludeRamps=TRUE);
00346 
00347     virtual void SetBlobState(FillControl, BOOL);
00348     virtual void ToggleSelection(FillControl);  
00349     virtual void SelectBlob(FillControl);   
00350     virtual void DeselectBlob(FillControl);
00351     virtual void DeselectAll();
00352     virtual void DeselectAllBut(FillControl);   
00353     virtual void DeselectAllNoRedraw();
00354 
00355     virtual void CycleSelection(BOOL Reverse);
00356 
00357     static AttrFillGeometry* FindFirstSelectedAttr(CCRuntimeClass* AttrType = (CCRuntimeClass*)CC_RUNTIME_CLASS(AttrFillGeometry));
00358     static AttrFillGeometry* FindNextSelectedAttr(CCRuntimeClass* AttrType = (CCRuntimeClass*)CC_RUNTIME_CLASS(AttrFillGeometry));
00359 
00360     static UINT32 CountSelectionControlPoints();
00361     static BOOL CheckAttrClick( DocCoord PointerPos, ClickType Click, ClickModifiers ClickMods, Spread* pSpread);
00362     static BOOL CheckForFillControlHit(DocCoord Pos, UINT32* Status);
00363 
00364     static FillControl DoColourDropTest(AttrColourDrop*, NodeRenderableInk**, AttrFillGeometry** FillAttr = NULL);
00365 
00366     static BOOL IsTranspMeshVisible();
00367     static BOOL IsColourMeshVisible();
00368 
00369     virtual BOOL IsVisible() { return IsColourMeshVisible(); }
00370     virtual BOOL NeedsTransparency() const;
00371 
00372     virtual FillControl CheckForControlHit(DocCoord &); 
00373 
00374     virtual AttrFillGeometry* Mutate(AttrFillGeometry*, BOOL bOptimise = TRUE);
00375     virtual AttrFillGeometry* ChangeAttrValue(AttrValueChange*) { return NULL; }
00376 
00377     virtual void AttributeChanged();
00378 
00379     static UINT32 FillSelectionCount();
00380     static void SetSelectionCount(UINT32);
00381     static void SetTranspMeshesVisible(BOOL);
00382 
00383     virtual BOOL Blend(BlendAttrParam* pBlendParam);
00384 
00385     virtual AttrFillGeometry* DoColourDrop(AttrColourDrop*);
00386     virtual FillControl TestColourDrop(AttrColourDrop*);
00387 
00388     virtual BOOL ChangeControlColour(AttrColourChange *);
00389     virtual BOOL ChangeControlTransp(AttrTranspChange *);
00390     virtual BOOL ChangeControlColour(DocColour&, FillControl, AttrColourDrop * pColDrop = NULL);
00391     virtual BOOL EditColourFillRamp(AttrColFillRampChange *);
00392     virtual BOOL EditTranspFillRamp(AttrTranspFillRampChange *);
00393     
00394     virtual BOOL IsAFillAttr() const { return TRUE; }
00395 
00396     virtual void TransformSelectedControlPoints( TransformBase&, BOOL* isARampBlob = NULL );
00397     virtual void TransformSelectedFillRampControlPoints (TransformBase&, ClickModifiers ClickMods, BOOL* isARampBlob);
00398 
00399     // Transforms the attributes bounds to new bounds. Used when applying stored attribute 
00400     // to an object. 
00401     virtual void TransformToNewBounds(DocRect& NewBounds); 
00402 
00403     virtual BOOL NeedsForceToSimpleMapping() { return(TRUE); }
00404     
00405     virtual BOOL IsARadialColourFill() const { return FALSE;}
00406 
00407     virtual BOOL CopyComponentData(BaseDocument* SrcDoc, BaseDocument* NodesDoc);
00408 
00409     virtual BOOL WriteColourDefinitions (BaseCamelotFilter* pFilter) { return (TRUE); }
00410 
00411     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00412 
00413 protected:
00414     virtual void ValidateAttributeValue() { }
00415     virtual BOOL CopyNodeContents(AttrFillGeometry* NodeCopy);
00416     virtual void RenderControl(FillControl, BOOL);  
00417 
00418     void RenderFillControl(BOOL RenderOn, 
00419                            DocRect* ControlRect, 
00420                            Spread* pSpread, 
00421                            NodeRenderable* pParent);
00422 
00423     void RenderControlIntoPendingRegions(DocRect* ControlRect, 
00424                                          Spread* pSpread, 
00425                                          NodeRenderable* pParent);
00426 
00427     AttrFillGeometry* ChangeColour(AttrValueChange*);
00428     AttrFillGeometry* ChangeTransp(AttrValueChange*);
00429 
00430     BOOL CheckPreviousFillMesh();
00431     BOOL IsFillBeingEdited();
00432     static BOOL IsMeshSame(FillGeometryAttribute* , FillGeometryAttribute*);
00433 
00434     void SetLastRenderedBlob(FillControl);
00435     BOOL IsBlobSame(FillControl);
00436     void ChangeBlobState(FillControl, INT32);
00437 
00438 // Karim MacDonald 03/12/1999
00439 // Extend functions.
00440 // Note that if a sub-class returns TRUE from IsTypeExtendible, it must
00441 // also provide complete implementations of ValidateExtend and Extend,
00442 // which should usually check/extend its children.
00443 public:
00444     virtual BOOL IsTypeExtendible() const { return TRUE; }
00445     virtual DocRect ValidateExtend(const ExtendParams& ExtParams);
00446     virtual void Extend(const ExtendParams& ExtParams);
00447 
00448     // Find the extend reference-centre of this Node, for use with Extension.
00449     virtual DocCoord FindExtendCentre() { return *GetStartPoint(); }
00450 
00451     // virtual override of NodeRenderable::TransformTranslateObject.
00452     virtual void TransformTranslateObject(const ExtendParams& ExtParams);
00453 
00454     // returns the number of control points required to describe this fill,
00455     // for instance flat fill - 0, linear fill - 2, four-colour fill - 4.
00456     // this value is 0 by default for fills without control points.
00457     virtual INT32 GetNumberOfControlPoints() { return 0; }
00458 
00459 public:
00460     static AttrFillGeometry* EditedFill;
00461     static AttrFillGeometry* DraggedFill;
00462     static List HitList;
00463 
00464     static BOOL DoFillMeshCheck;
00465     static FillGeometryAttribute* LastRenderedMesh;
00466 
00467     static DocCoord LastRenderedStartBlob;
00468     static DocCoord LastRenderedEndBlob;
00469     static DocCoord LastRenderedEnd2Blob;
00470     static DocCoord LastRenderedEnd3Blob;
00471 
00472     static UINT32 SelectionCount;
00473 
00474     static INT32 FractalSeed;
00475     static double FractalGraininess;
00476     static double FractalGravity;
00477 
00478     static INT32 FractalDPI;
00479     static INT32 MaxFractalSize;
00480 
00481     static BOOL TranspMeshesVisible;
00482 
00483     static BOOL DoCheckOnFillRampMesh;          // this could be changed a variable passed in with
00484                                                 // CheckForControlHit.  This variable exists so that
00485                                                 // we avoid this check when we are changing the cursor
00486                                                 // (since the filltool gets this incorrect - and says that
00487                                                 // we can move the fillramp)
00488 
00489     static BOOL s_bGroupTransparency;
00490 
00491 protected:
00492     BOOL SelectionState[5];
00493 
00494     static FillControl ControlHit;
00495     static AttrFillGeometry* FillHit;
00496 
00497     static SelectedAttrs s_SelAttrs;
00498     static CCAttrMap AttribMap;
00499 
00500     // Bodge variable for Current Attribute Transformation
00501     DocRect AttrBounds;
00502 
00503     // DMc 22-10-99
00504     // Find the ramp fill point (0 - 1.0) given certain coordinates
00505     virtual double FindRampPoint(DocCoord &dc, DocCoord &StartPoint, DocCoord &EndPoint);
00506  };
00507 
00508 
00509 /***********************************************************************************************
00510 
00511 >   class SelectedAttrs : public CCObject
00512 
00513     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00514     Created:    20/4/2005
00515     Purpose:    -
00516     SeeAlso:    -
00517 
00518 ***********************************************************************************************/
00519 
00520 class SelectedAttrs : public CCObject
00521 {
00522 public:
00523     SelectedAttrs()
00524     {
00525         m_pAttrSelectionLevel = NULL;
00526         m_pAttrSelection = NULL;
00527         m_pSelNode = NULL;
00528         m_pLastSelectedAttr = NULL;
00529     }
00530 
00531     ~SelectedAttrs()
00532     {
00533         if (m_pAttrSelectionLevel)
00534         {
00535             delete m_pAttrSelectionLevel;
00536             m_pAttrSelectionLevel = NULL;
00537         }
00538     }
00539 
00540     NodeAttribute*  FindFirst(CCRuntimeClass* AttrType = (CCRuntimeClass*)CC_RUNTIME_CLASS(AttrFillGeometry));
00541     NodeAttribute*  FindNext(CCRuntimeClass* AttrType = (CCRuntimeClass*)CC_RUNTIME_CLASS(AttrFillGeometry));
00542 
00543 private:
00544     Range*          m_pAttrSelectionLevel;
00545     SelRange*       m_pAttrSelection;
00546     Node*           m_pSelNode;
00547     NodeAttribute*  m_pLastSelectedAttr;
00548 };
00549 
00550 
00551 /***********************************************************************************************
00552 
00553 >   class AttrTranspFillGeometry : public AttrFillGeometry
00554 
00555     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00556     Created:    8/8/94
00557     Purpose:    -
00558     SeeAlso:    -
00559 
00560 ***********************************************************************************************/
00561 
00562 class AttrTranspFillGeometry : public virtual AttrFillGeometry
00563 {
00564     CC_DECLARE_DYNAMIC(AttrTranspFillGeometry)
00565     
00566 public:
00567     AttrTranspFillGeometry() : AttrFillGeometry() {}
00568 };
00569 
00570 /***********************************************************************************************
00571 
00572 >   class AttrValueChange : public AttrFillGeometry
00573 
00574     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00575     Created:    8/8/94
00576     Purpose:    Change Fill colour Attribute class.
00577                 This Attribute never exists in the Tree.  It is used for changing the colours
00578                 of an existing Fill Geometry.
00579     SeeAlso:    AttrFillGeometry
00580 
00581 ***********************************************************************************************/
00582 
00583 class AttrValueChange : public AttrFillGeometry
00584 {
00585     CC_DECLARE_DYNAMIC(AttrValueChange)
00586     
00587 public:
00588     AttrValueChange();
00589 
00590     virtual UINT32 GetAttrNameID(void);  
00591 
00592     virtual AttributeValue* GetAttributeValue() = 0;
00593     virtual CCRuntimeClass* GetAttributeType();
00594 
00595     virtual void MutateColourFills(BOOL Change);
00596     virtual void MutateTranspFills(BOOL Change);
00597 
00598     virtual AttrFillGeometry* MutateFill(AttrFillGeometry* FillToMutate) { return NULL; }
00599 
00600     virtual BOOL IsAValueChange() const { return TRUE; }
00601 
00602 protected:
00603     BOOL    Colour;
00604     BOOL    Transp;
00605 };
00606 
00607 /***********************************************************************************************
00608 
00609 >   class AttrFlatFill : public AttrFillGeometry
00610 
00611     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00612     Created:    18/07/94
00613     Purpose:    Flat Fill colour Attribute class.
00614     SeeAlso:    FlatFillAttribute
00615 
00616 ***********************************************************************************************/
00617 
00618 class AttrFlatFill : public AttrFillGeometry
00619 {
00620     CC_DECLARE_DYNCREATE(AttrFlatFill)
00621     
00622 public:
00623     AttrFlatFill();
00624     AttrFlatFill(Node* ContextNode,  
00625                  AttachNodeDirection Direction,    
00626                  BOOL Locked=FALSE, 
00627                  BOOL Mangled=FALSE,  
00628                  BOOL Marked=FALSE, 
00629                  BOOL Selected=FALSE): 
00630         AttrFillGeometry(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}
00631 
00632     // Selection Functions
00633     virtual BOOL OnClick( DocCoord, ClickType, ClickModifiers, Spread * ) { return FALSE; }
00634 
00635     virtual DocRect GetBlobBoundingRect();
00636 
00637     virtual BOOL ChangeControlColour(AttrColourChange *) { return FALSE; }
00638     virtual BOOL ChangeControlTransp(AttrTranspChange *) { return FALSE; }
00639 
00640     virtual void ToggleSelection(FillControl Blob) { DeselectBlob(Blob); }  
00641     virtual void SelectBlob(FillControl Blob) { DeselectBlob(Blob); }   
00642 
00643     virtual FillControl TestColourDrop(AttrColourDrop*);
00644 
00645     virtual BOOL IsAFlatFill() const { return TRUE; } 
00646 
00647 protected:
00648     virtual void ValidateAttributeValue();
00649 };
00650 
00651 
00652 
00653 /********************************************************************************************
00654 
00655 >   class AttrChangedMsg: public Msg
00656 
00657     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00658     Created:    8/8/94
00659     Purpose:    This message is sent whenever an attribute changes in some way.
00660                 It is used to update the Grad Fill Info Bar.
00661     SeeAlso:    -
00662 
00663 ********************************************************************************************/
00664 
00665 class AttrChangedMsg: public Msg
00666 {
00667     CC_DECLARE_DYNAMIC(AttrChangedMsg);
00668 public:
00669 
00670     AttrFillGeometry* pChangedFill;
00671     AttrChangedMsg(AttrFillGeometry* pFill): pChangedFill(pFill) { } 
00672 };
00673 
00674 /********************************************************************************************
00675 
00676 >   class FillAttrBlobState : public ListItem
00677 
00678     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00679     Created:    12/3/96
00680     Purpose:    Used to record the fill blob selection state to determine wether apply ops
00681                 should be merged or not.
00682     SeeAlso:    -
00683 
00684 ********************************************************************************************/
00685 
00686 class FillAttrBlobState : public ListItem
00687 {
00688     public:
00689          FillAttrBlobState();
00690         ~FillAttrBlobState();
00691 
00692         BOOL operator==(FillAttrBlobState& BlobState);
00693 
00694     public:
00695         AttrFillGeometry* pFillAttr;
00696         UINT32  count;
00697         BOOL* SelectionState;
00698 };
00699 
00700 /********************************************************************************************
00701 
00702 >   class FillBlobSelectionState
00703 
00704     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00705     Created:    12/3/96
00706     Purpose:    Used to record the fill blob selection state to determine wether apply ops
00707                 should be merged or not.
00708     SeeAlso:    -
00709 
00710 ********************************************************************************************/
00711 
00712 class FillBlobSelectionState : public CC_CLASS_MEMDUMP
00713 {
00714     CC_DECLARE_MEMDUMP(FillBlobSelectionState);
00715 
00716 public:  
00717     FillBlobSelectionState(); 
00718     ~FillBlobSelectionState();                          // Deletes lists 
00719     BOOL Record();                                      // Records the current selected state
00720     BOOL operator==(FillBlobSelectionState& SelState);  // Compares this SelectionState with another to determine
00721                                                         // if they are the same. 
00722     void DeleteAll() { BlobStateList.DeleteAll(); }
00723 
00724 private:    
00725 
00726     CCRuntimeClass* FillType;           // Visible fill type
00727     UINT32  BlobCount;                  // Number of blobs selected
00728     List    BlobStateList;              // Details of the selected blobs
00729 }; 
00730 
00731 
00732 #endif  // INC_FILLATTR

Generated on Sat Nov 10 03:45:13 2007 for Camelot by  doxygen 1.4.4