opshadow.h

Go to the documentation of this file.
00001 // $Id: opshadow.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 // Header for the shadow tool operations
00099 
00100 #ifndef INC_OPSHADOW
00101 #define INC_OPSHADOW
00102 
00103 #include "nodecont.h"
00104 
00105 #ifdef BUILDSHADOWS
00106 
00107 //#include "selop.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00108 #include "attrappl.h"
00109 //#include "biasgain.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00110 #include "shadinfo.h"   // for SoftShadowInfoBarData
00111 #include "menuitem.h"
00112 #include "effects_stack.h"
00113 
00114 class NodeShadowParam;
00115 
00116 //#define OPTOKEN_CREATESHADOW          "CreateShadow"
00117 #define OPTOKEN_APPLYSHADOW             _T("ApplyShadow")
00118 #define OPTOKEN_CHANGESHADOWTYPE        _T("ChangeShadowType")
00119 #define OPTOKEN_REMOVESHADOW            _T("RemoveShadow")
00120 #define OPTOKEN_SHADOWPOSITION          _T("ShadowPosition")
00121 #define OPTOKEN_SHADOWPENUMBRA          _T("ShadowPenumbra")
00122 #define OPTOKEN_SHADOWATTRIB            _T("ShadowAttributeApply")
00123 #define OPTOKEN_SHADOWANGLE             _T("ShadowAngle")
00124 #define OPTOKEN_SHADOWHEIGHT            _T("ShadowHeight")
00125 #define OPTOKEN_SHADOWSCALE             _T("ShadowScale")
00126 #define OPTOKEN_SHADOWHEIGHTANDANGLE    _T("ShadowHeightAndAngle")
00127 #define OPTOKEN_SAVESHADOWDATA          _T("SaveShadowData")
00128 #define OPTOKEN_GLOWWIDTH               _T("GlowWidth")
00129 #define OPTOKEN_SHADOWPROFILE           _T("ShadowProfile")
00130 #define OPTOKEN_SHADOWDARKNESS          _T("ShadowDarkness")
00131 
00137 
00138 
00139 /********************************************************************************************
00140 >   class OpApplyShadow : public SelOperation
00141 
00142     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00143     Created:    16/11/2004
00144     Purpose:    Create a shadow object in the tree giving the current selection a shadow.
00145 ********************************************************************************************/
00146 class OpApplyShadow : public SelOperation
00147 {
00148 
00149 CC_DECLARE_DYNCREATE(OpApplyShadow)
00150 
00151 public:
00152     static BOOL Declare();
00153     static ListRange*               DoApplyShadow(UndoableOperation* pOp, Range* pRange, NodeShadowParam* pNSParam);
00154     static NodeShadowController*    DoApplyShadow(UndoableOperation* pOp, Node* pNode, NodeShadowParam* pNSParam, BOOL bSetSelected = TRUE);
00155 
00156 public:
00157     // Construction/Destruction
00158     OpApplyShadow();
00159     ~OpApplyShadow();
00160 
00161     virtual void Do(OpDescriptor *pOpDesc);
00162     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00163 
00164     // These functions required for the OpDescriptor class
00165     static OpState GetState(String_256* Description, OpDescriptor*);
00166     static OpState GetParamState(String_256* pstrDescription, OpDescriptor* pOpDesc, OpParam* pOpParam);
00167 
00168 //  void GetOpName(String_256 * pString);
00169 
00170 //private:
00171 //  void AddShadowToNode(Node * pNode);
00172 //  UINT32 m_OpName;
00173 };
00174 
00175 
00181 
00182 
00183 /********************************************************************************************
00184 >   class OpChangeShadowType : public SelOperation
00185 
00186     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00187     Created:    18/11/2004
00188     Purpose:    Create a shadow object in the tree giving the current selection a shadow.
00189 ********************************************************************************************/
00190 class OpChangeShadowType : public SelOperation
00191 {
00192 
00193 CC_DECLARE_DYNCREATE(OpChangeShadowType)
00194 
00195 public:
00196     static BOOL Declare();
00197     static BOOL DoChangeShadowType(UndoableOperation* pOp, NodeShadowParam* pNSParam);
00198 
00199 public:
00200     // Construction/Destruction
00201     OpChangeShadowType();
00202     ~OpChangeShadowType();
00203 
00204     virtual void Do(OpDescriptor *pOpDesc);
00205     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00206 
00207     // These functions required for the OpDescriptor class
00208     static OpState GetState(String_256* Description, OpDescriptor*);
00209     static OpState GetParamState(String_256* pstrDescription, OpDescriptor* pOpDesc, OpParam* pOpParam);
00210 
00211 //  void GetOpName(String_256 * pString);
00212 
00213 //private:
00214 //  void AddShadowToNode(Node * pNode);
00215 //  UINT32 m_OpName;
00216 };
00217 
00218 
00224 
00225 
00226 /********************************************************************************************
00227 >   class OpRemoveShadow : public SelOperation
00228 
00229     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00230     Created:    21/11/96
00231     Purpose:    Remove a shadow object 
00232 ********************************************************************************************/
00233 class OpRemoveShadow : public SelOperation
00234 {
00235 
00236 CC_DECLARE_DYNCREATE(OpRemoveShadow)
00237 
00238 public:
00239     // Construction/Destruction
00240     OpRemoveShadow();
00241     ~OpRemoveShadow();
00242 
00243 //  virtual void Do(OpDescriptor *pOpDesc);
00244     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00245         
00246     // These functions required for the OpDescriptor class
00247     static BOOL Declare();
00248     static OpState GetState(String_256* Description, OpDescriptor*);
00249 };
00250 
00251 
00257 
00258 /********************************************************************************************
00259 >   class ShadowPosition : public OpParam
00260 
00261     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00262     Created:    17/12/96
00263     Purpose:    Used by OpShadowPosition
00264 ********************************************************************************************/
00265 
00266 class ShadowPosition : public OpParam
00267 {
00268     CC_DECLARE_DYNCREATE(ShadowPosition)
00269 
00270 public:
00271     ShadowPosition();
00272     ShadowPosition(const INT32 x, const INT32 y, BOOL UpdateX=TRUE, BOOL UpdateY=TRUE, SoftShadowTool* pTool=NULL);
00273     ~ShadowPosition();
00274 
00275 public:
00276     INT32 X;
00277     INT32 Y;
00278     BOOL m_bUpdateX;
00279     BOOL m_bUpdateY;
00280     SoftShadowTool* m_pTool;
00281 };
00282 
00283 /********************************************************************************************
00284 >   class OpShadowPosition : public SelOperation
00285 
00286     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00287     Created:    16/12/96
00288     Purpose:    Update the position of the shadow after modifying the infobar controls
00289 ********************************************************************************************/
00290 
00291 class OpShadowPosition : public SelOperation
00292 {
00293     CC_DECLARE_DYNCREATE(OpShadowPosition)
00294 
00295 public:
00296     OpShadowPosition();
00297     ~OpShadowPosition();
00298 
00299     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00300     static OpState GetState(String_256* Description, OpDescriptor*);
00301     static BOOL Declare();
00302 
00303 };
00304 
00305 
00311 
00312 
00313 /********************************************************************************************
00314 >   class ShadowPosition : public OpParam
00315 
00316     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00317     Created:    18/12/96
00318     Purpose:    Used by OpShadowPenumbra
00319 ********************************************************************************************/
00320 
00321 class ShadowPenumbra : public OpParam
00322 {
00323     CC_DECLARE_DYNCREATE(ShadowPenumbra)
00324 
00325 public:
00326     ShadowPenumbra();
00327     ShadowPenumbra(const INT32 p, SoftShadowTool* pTool);
00328     ~ShadowPenumbra();
00329 
00330 public:
00331     INT32 P;
00332     SoftShadowTool* m_pTool;
00333 };
00334 
00335 
00336 /********************************************************************************************
00337 >   class OpShadowPenumbra : public SelOperation
00338 
00339     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00340     Created:    16/12/96
00341     Purpose:    Update the position of the shadow after modifying the infobar controls
00342 ********************************************************************************************/
00343 
00344 class OpShadowPenumbra : public SelOperation
00345 {
00346     CC_DECLARE_DYNCREATE(OpShadowPenumbra)
00347 
00348 public:
00349     OpShadowPenumbra();
00350     ~OpShadowPenumbra();
00351 
00352     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00353     static OpState GetState(String_256* Description, OpDescriptor*);
00354     static BOOL Declare();
00355 };
00356 
00357 
00363 
00364 /********************************************************************************************
00365 
00366 >   class ChangePositionShadowAction : public Action
00367 
00368     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00369     Created:    06/01/97
00370     Purpose:    An action which undoes the modification of the position of the shadow (X)
00371     SeeAlso:    -
00372 
00373 ********************************************************************************************/
00374 
00375 class ChangePositionShadowAction : public Action
00376 {
00377 
00378 CC_DECLARE_DYNCREATE(ChangePositionShadowAction)
00379 
00380 public:
00381     ChangePositionShadowAction();
00382     ~ChangePositionShadowAction();
00383     virtual ActionCode Execute();
00384     static ActionCode Init( Operation* pOp,
00385                             ActionList* pActionList,
00386                             NodeShadowController* pThisNodeShadow,
00387                             MILLIPOINT NewOffsetX,
00388                             MILLIPOINT NewOffsetY,
00389                             BOOL UpdateX,
00390                             BOOL UpdateY,
00391                             ChangePositionShadowAction** NewAction,
00392                             BOOL Reverse = TRUE);
00393 protected:
00394     NodeShadowController* m_pNodeShadowCont;
00395     MILLIPOINT  m_OldPositionX;
00396     MILLIPOINT  m_OldPositionY;
00397     BOOL m_bUpdateX;
00398     BOOL m_bUpdateY;
00399 };
00400 
00401 
00407 
00408 /********************************************************************************************
00409 
00410 >   class ChangePenumbraSizeAction : public Action
00411 
00412     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00413     Created:    06/01/97
00414     Purpose:    An action which undoes the modification of the penumbra size
00415     SeeAlso:    -
00416 
00417 ********************************************************************************************/
00418 
00419 class ChangePenumbraSizeAction : public Action
00420 {
00421 
00422 CC_DECLARE_DYNCREATE(ChangePenumbraSizeAction)
00423 
00424 public:
00425     ChangePenumbraSizeAction();
00426     ~ChangePenumbraSizeAction();
00427     virtual ActionCode Execute();
00428     static ActionCode Init( Operation* pOp,
00429                             ActionList* pActionList,
00430                             NodeShadowController* pThisNodeShadow,
00431                             MILLIPOINT NewPenumbraSize,
00432                             ChangePenumbraSizeAction** NewAction,
00433                             BOOL bReverse = TRUE,
00434                             BOOL bCache = FALSE);
00435 protected:
00436     NodeShadowController* m_pNodeShadowCont;
00437     MILLIPOINT  m_OldPenumbraSize;
00438     DocRect m_LastRect;
00439     BOOL m_bCache;
00440 };
00441 
00442 
00448 
00449 
00450 /********************************************************************************************
00451 >   class NodeShadowClick : public OpParam
00452 
00453     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00454     Created:    13/01/97
00455     Purpose:    When a user click, used by SoftShadowTool::DoWithParam()
00456 ********************************************************************************************/
00457 
00458 class NodeShadowClick : public OpParam
00459 {
00460     CC_DECLARE_DYNCREATE(NodeShadowClick)
00461 
00462 public:
00463     NodeShadowClick();
00464     NodeShadowClick(Node *p, SoftShadowTool* pTool);
00465     ~NodeShadowClick();
00466 
00467 public:
00468     Node *m_pNode;
00469     SoftShadowTool* m_pTool;
00470 };
00471 
00472 /********************************************************************************************
00473 >   class NodeShadowParam : public OpMenuParam
00474 
00475     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00476     Created:    9/6/99
00477     Purpose:    Creation parameter for shadows (i.e. OpApplyShadow)
00478 ********************************************************************************************/
00479 class NodeShadowParam : public OpMenuParam
00480 {
00481 public:
00482     NodeShadowParam(ShadowType Type             = NodeShadowController::DefaultType,
00483                     double FloorShadowAngle     = NodeShadowController::DefaultFloorAngle,
00484                     double FloorShadowHeight    = NodeShadowController::DefaultFloorHeight,
00485                     INT32 OffsetX                   = NodeShadowController::DefaultWallOffsetX,
00486                     INT32 OffsetY                   = NodeShadowController::DefaultWallOffsetY,
00487                     INT32 Blur                  = NodeShadowController::DefaultBlurSize,
00488                     double Darkness             = NodeShadowController::DefaultDarkness,
00489                     double Scale                = NodeShadowController::DefaultScale,
00490                     MILLIPOINT Width            = NodeShadowController::DefaultGlowWidth,
00491                     const CProfileBiasGain &Profile = CProfileBiasGain(),
00492                     BOOL bRedraw                = TRUE,
00493                     MILLIPOINT FeatherWidth     = NodeShadowController::DefaultFeatherWidth
00494                     ) :
00495         m_Type(Type),
00496         m_FloorShadowAngle(FloorShadowAngle),
00497         m_FloorShadowHeight(FloorShadowHeight),
00498         m_OffsetX(OffsetX),
00499         m_OffsetY(OffsetY),
00500         m_Blur(Blur),
00501         m_dDarkness(Darkness),
00502         m_Scale(Scale),
00503         m_GlowWidth(Width),
00504         m_FeatherWidth(FeatherWidth),
00505         m_bRedraw(bRedraw),
00506         m_Profile(Profile)
00507     {
00508         StackPosition = STACKPOS_INSERT_TOP;
00509         pPPStack = NULL;
00510         pShadowTool = NULL;
00511     }
00512 
00513     ShadowType          m_Type;
00514     double              m_FloorShadowAngle;
00515     double              m_FloorShadowHeight;
00516     INT32               m_OffsetX;
00517     INT32               m_OffsetY;
00518     INT32               m_Blur;
00519     double              m_dDarkness;
00520     double              m_Scale;
00521     MILLIPOINT          m_GlowWidth;
00522     MILLIPOINT          m_FeatherWidth;
00523     BOOL                m_bRedraw;
00524     CProfileBiasGain    m_Profile;
00525 
00526     INT32               StackPosition;          // PostProcessor Stack position
00527     EffectsStack*       pPPStack;               // PostProcessor Stack
00528     SoftShadowTool*     pShadowTool;
00529 };
00530 
00531 /********************************************************************************************
00532 
00533 >   class OpApplyAttrib : public SelOperation
00534 
00535     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00536     Created:    30/1/95
00537     Purpose:    Virtual base class for ops that apply attibutes.
00538 
00539 ********************************************************************************************/
00540 
00541 class CCAPI OpApplyAttribForShadows: public OpApplyAttribToSelected
00542 {         
00543     CC_DECLARE_DYNCREATE( OpApplyAttribForShadows )    
00544 
00545 public:
00546     static BOOL Init();
00547 
00548 
00549     
00550 protected:
00551     // DMc
00552     // applies a fill attribute to a shadow node
00553     BOOL DoApply(Node* CurrentNode, 
00554                             NodeAttribute* Attrib, 
00555                             BOOL Mutate, 
00556                             BOOL InvalidateRegion,
00557                             BOOL KeepExistingCols, /* = TRUE */
00558                             BOOL* AttribWasRequired    /* = NULL */);
00559 };
00560 
00561 /********************************************************************************************
00562 
00563 >   class ChangeFloorShadowHeightAction : public Action
00564 
00565     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00566     Created:    10/6/99
00567     Purpose:    Action for changing floor shadow heights
00568     SeeAlso:    -
00569 
00570 ********************************************************************************************/
00571 
00572 class ChangeFloorShadowHeightAction : public Action
00573 {
00574 
00575 CC_DECLARE_DYNCREATE(ChangeFloorShadowHeightAction)
00576 
00577 public:
00578     ChangeFloorShadowHeightAction();
00579     ~ChangeFloorShadowHeightAction();
00580     virtual ActionCode Execute();
00581     static ActionCode Init( Operation* pOp,
00582                             ActionList* pActionList,
00583                             NodeShadowController* pThisNodeShadow,
00584                             double NewHeight,
00585                             ChangeFloorShadowHeightAction** NewAction,
00586                             BOOL bReverse = TRUE,
00587                             BOOL bCache = FALSE);
00588 protected:
00589     NodeShadowController* m_pNodeShadowCont;
00590     double  m_LastHeight;
00591     DocRect m_LastRect;
00592     BOOL m_bCache;
00593 };
00594 
00595 /********************************************************************************************
00596 
00597 >   class ChangeFloorShadowAngleAction : public Action
00598 
00599     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00600     Created:    10/6/99
00601     Purpose:    Action for changing floor shadow heights
00602     SeeAlso:    -
00603 
00604 ********************************************************************************************/
00605 
00606 class ChangeFloorShadowAngleAction : public Action
00607 {
00608 
00609 CC_DECLARE_DYNCREATE(ChangeFloorShadowAngleAction)
00610 
00611 public:
00612     ChangeFloorShadowAngleAction();
00613     ~ChangeFloorShadowAngleAction();
00614     virtual ActionCode Execute();
00615     static ActionCode Init( Operation* pOp,
00616                             ActionList* pActionList,
00617                             NodeShadowController* pThisNodeShadow,
00618                             INT32 NewAngle,
00619                             ChangeFloorShadowAngleAction** NewAction,
00620                             BOOL bReverse = TRUE,
00621                             BOOL bCache = FALSE);
00622 protected:
00623     NodeShadowController* m_pNodeShadowCont;
00624     INT32   m_LastAngle;
00625     DocRect m_LastRect;
00626     BOOL m_bCache;
00627 };
00628 
00629 /********************************************************************************************
00630 
00631 >   class ChangeShadowTypeAction : public Action
00632 
00633     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00634     Created:    10/6/99
00635     Purpose:    Action for changing floor shadow heights
00636     SeeAlso:    -
00637 
00638 ********************************************************************************************/
00639 
00640 class ChangeShadowTypeAction : public Action
00641 {
00642 
00643 CC_DECLARE_DYNCREATE(ChangeShadowTypeAction)
00644 
00645 public:
00646     ChangeShadowTypeAction();
00647     ~ChangeShadowTypeAction();
00648     virtual ActionCode Execute();
00649     static ActionCode Init( Operation* pOp,
00650                             ActionList* pActionList,
00651                             NodeShadowController* pThisNodeShadow,
00652                             ShadowType NewType,
00653                             ChangeShadowTypeAction** NewAction,
00654                             BOOL bReverse = TRUE);
00655 protected:
00656     NodeShadowController* m_pNodeShadowCont;
00657     ShadowType  m_LastType;
00658     DocRect m_LastRect;
00659 };
00660 
00666 
00667 
00668 /********************************************************************************************
00669 >   class OpShadowAngle : public SelOperation
00670 
00671     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00672     Created:    10/6/99
00673     Purpose:    Update the angle of the selected shadows
00674 ********************************************************************************************/
00675 
00676 class OpShadowAngle : public SelOperation
00677 {
00678     CC_DECLARE_DYNCREATE(OpShadowAngle)
00679 
00680 public:
00681     OpShadowAngle();
00682     ~OpShadowAngle();
00683 
00684     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00685     static OpState GetState(String_256* Description, OpDescriptor*);
00686     static BOOL Declare();
00687 
00688     // Karim 21/01/2000 - see UndoableOperation base implementation.
00689     virtual BOOL MayChangeNodeBounds() const { return FALSE; }
00690 };
00691 
00692 /********************************************************************************************
00693 >   class OpShadowHeightAndAngle : public SelOperation
00694 
00695     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00696     Created:    10/6/99
00697     Purpose:    Update the angle and height of the selected shadows
00698                 Used by the blob rendering / manipulation code in ShadowTool
00699 ********************************************************************************************/
00700 
00701 class OpShadowHeightAndAngle : public SelOperation
00702 {
00703     CC_DECLARE_DYNCREATE(OpShadowHeightAndAngle)
00704 
00705 public:
00706     OpShadowHeightAndAngle();
00707     ~OpShadowHeightAndAngle();
00708 
00709     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00710     static OpState GetState(String_256* Description, OpDescriptor*);
00711     static BOOL Declare();
00712 };
00713 
00714 
00720 
00721 
00722 /********************************************************************************************
00723 >   class OpShadowHeight : public SelOperation
00724 
00725     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00726     Created:    10/6/99
00727     Purpose:    Update the height of the selected shadows
00728 ********************************************************************************************/
00729 
00730 class OpShadowHeight : public SelOperation
00731 {
00732     CC_DECLARE_DYNCREATE(OpShadowHeight)
00733 
00734 public:
00735     OpShadowHeight();
00736     ~OpShadowHeight();
00737 
00738     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00739     static OpState GetState(String_256* Description, OpDescriptor*);
00740     static BOOL Declare();
00741 };
00742 
00748 
00749 
00750 /********************************************************************************************
00751 >   class OpShadowScale : public SelOperation
00752 
00753     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00754     Created:    10/6/99
00755     Purpose:    Update the angle of the selected shadows
00756 ********************************************************************************************/
00757 
00758 class OpShadowScale : public SelOperation
00759 {
00760     CC_DECLARE_DYNCREATE(OpShadowScale)
00761 
00762 public:
00763     OpShadowScale();
00764     ~OpShadowScale();
00765 
00766     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00767     static OpState GetState(String_256* Description, OpDescriptor*);
00768     static BOOL Declare();
00769 };
00770 
00771 /********************************************************************************************
00772 
00773 >   class ChangeShadowScaleAction : public Action
00774 
00775     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00776     Created:    10/6/99
00777     Purpose:    Action for changing shadow scale factors
00778     SeeAlso:    -
00779 
00780 ********************************************************************************************/
00781 
00782 class ChangeShadowScaleAction : public Action
00783 {
00784 
00785 CC_DECLARE_DYNCREATE(ChangeShadowScaleAction)
00786 
00787 public:
00788     ChangeShadowScaleAction();
00789     ~ChangeShadowScaleAction();
00790     virtual ActionCode Execute();
00791     static ActionCode Init( Operation* pOp,
00792                             ActionList* pActionList,
00793                             NodeShadowController* pThisNodeShadow,
00794                             double NewScale,
00795                             ChangeShadowScaleAction** NewAction,
00796                             BOOL bReverse = TRUE);
00797 protected:
00798     NodeShadowController* m_pNodeShadowCont;
00799     double m_LastScale;
00800     DocRect m_LastRect;
00801 };
00802 
00803 /********************************************************************************************
00804 
00805 >   class SaveShadowDataAction : public Action
00806 
00807     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00808     Created:    10/6/99
00809     Purpose:    Saves all the shadow data for regeneration purposes on undo/redo
00810     SeeAlso:    -
00811 
00812 ********************************************************************************************/
00813 
00814 class SaveShadowDataAction : public Action
00815 {
00816 
00817 CC_DECLARE_DYNCREATE(SaveShadowDataAction)
00818 
00819 public:
00820     SaveShadowDataAction();
00821     ~SaveShadowDataAction();
00822     virtual ActionCode Execute();
00823     static ActionCode Init( Operation* pOp,
00824                             ActionList* pActionList,
00825                             Range &MyRange,
00826                             SaveShadowDataAction** NewAction,
00827                             BOOL bReverse = TRUE);
00828 protected:
00829     Range * m_pSelRange;
00830     List m_DataList;
00831     DocRect m_LastRect;
00832 };
00833 
00839 /********************************************************************************************
00840 >   class SaveShadowDataInfo : public OpParam
00841 
00842     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00843     Created:    10/6/99
00844     Purpose:    The id for the op to give in the undo/redo menus
00845 ********************************************************************************************/
00846 class SaveShadowDataInfo : public OpParam
00847 {
00848 public:
00849     SaveShadowDataInfo() { ID = 0; }
00850 
00851     UINT32 ID;
00852 };
00853 
00854 /********************************************************************************************
00855 >   class OpSaveShadowData : public SelOperation
00856 
00857     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00858     Created:    10/6/99
00859     Purpose:    Save the current selection's shadow data (to be restored on undo/redo)
00860 ********************************************************************************************/
00861 
00862 class OpSaveShadowData : public SelOperation
00863 {
00864     CC_DECLARE_DYNCREATE(OpSaveShadowData)
00865 
00866 public:
00867     OpSaveShadowData();
00868     ~OpSaveShadowData();
00869 
00870     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00871     static OpState GetState(String_256* Description, OpDescriptor*);
00872     static BOOL Declare();
00873 
00874     // this is public so other fns can use it
00875     static BOOL SaveShadowData(UndoableOperation * pOp);
00876 
00877     void GetOpName(String_256 * pString);
00878 
00879     // Karim 21/01/2000 - see UndoableOperation base implementation.
00880     virtual BOOL MayChangeNodeBounds() const { return FALSE; }
00881 
00882 private:
00883     UINT32 m_OpName;
00884 };
00885 
00886 /********************************************************************************************
00887 
00888 >   class ChangeGlowWidthAction : public Action
00889 
00890     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00891     Created:    6/6/99
00892     Purpose:    Action for changing glow widths
00893     SeeAlso:    -
00894 
00895 ********************************************************************************************/
00896 
00897 class ChangeGlowWidthAction : public Action
00898 {
00899 
00900 CC_DECLARE_DYNCREATE(ChangeGlowWidthAction)
00901 
00902 public:
00903     ChangeGlowWidthAction();
00904     ~ChangeGlowWidthAction();
00905     virtual ActionCode Execute();
00906     static ActionCode Init( Operation* pOp,
00907                             ActionList* pActionList,
00908                             NodeShadowController* pThisNodeShadow,
00909                             INT32 NewWidth,
00910                             ChangeGlowWidthAction** NewAction,
00911                             BOOL bReverse = TRUE,
00912                             BOOL bCache = FALSE);
00913 protected:
00914     NodeShadowController* m_pNodeShadowCont;
00915     INT32   m_LastWidth;
00916     DocRect m_LastRect;
00917     BOOL m_bCache;
00918 };
00919 
00925 
00926 
00927 /********************************************************************************************
00928 >   class OpGlowWidth : public SelOperation
00929 
00930     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00931     Created:    10/6/99
00932     Purpose:    Update the width of the selected glows
00933 ********************************************************************************************/
00934 
00935 class OpGlowWidth : public SelOperation
00936 {
00937     CC_DECLARE_DYNCREATE(OpGlowWidth)
00938 
00939 public:
00940     OpGlowWidth();
00941     ~OpGlowWidth();
00942 
00943     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00944     static OpState GetState(String_256* Description, OpDescriptor*);
00945     static BOOL Declare();
00946 };
00947 
00948 /********************************************************************************************
00949 >   class ShadowProfileOpParam : public OpParam
00950 
00951     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
00952     Created:    17/12/96
00953     Purpose:    Used by OpShadowPosition
00954 ********************************************************************************************/
00955 
00956 class ShadowProfileOpParam : public OpParam
00957 {
00958     CC_DECLARE_DYNCREATE(ShadowProfileOpParam)
00959 
00960 public:
00961     ShadowProfileOpParam() { m_pTool=NULL; }
00962     ShadowProfileOpParam(CProfileBiasGain newProfile, SoftShadowTool* pTool) { Profile = newProfile; m_pTool=pTool; }
00963     ~ShadowProfileOpParam() { };
00964 
00965 public:
00966     CProfileBiasGain Profile;
00967     SoftShadowTool* m_pTool;
00968 };
00969 
00970 
00971 
00972 /********************************************************************************************
00973 >   class OpChangeShadowProfile : public SelOperation
00974 
00975     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
00976     Created:    10/6/99
00977     Purpose:    Update the width of the selected glows
00978 ********************************************************************************************/
00979 
00980 class OpChangeShadowProfile : public SelOperation
00981 {
00982     CC_DECLARE_DYNCREATE(OpChangeShadowProfile)
00983 
00984 public:
00985     OpChangeShadowProfile();
00986     ~OpChangeShadowProfile();
00987 
00988     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
00989     static OpState GetState(String_256* Description, OpDescriptor*);
00990     static BOOL Declare();
00991 
00992     // Karim 21/01/2000 - see UndoableOperation base implementation.
00993     virtual BOOL MayChangeNodeBounds() const { return FALSE; }
00994 };
00995 
00996 /********************************************************************************************
00997 
00998 >   class ChangeProfileAction : public Action
00999 
01000     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
01001     Created:    6/6/99
01002     Purpose:    Action for changing shadow profiles
01003     SeeAlso:    -
01004 
01005 ********************************************************************************************/
01006 
01007 class ChangeProfileAction : public Action
01008 {
01009 
01010 CC_DECLARE_DYNCREATE(ChangeProfileAction)
01011 
01012 public:
01013     ChangeProfileAction();
01014     ~ChangeProfileAction();
01015     virtual ActionCode Execute();
01016     static ActionCode Init( Operation* pOp,
01017                             ActionList* pActionList,
01018                             NodeShadow* pThisNodeShadow,
01019                             CProfileBiasGain &Profile,
01020                             ChangeProfileAction** NewAction,
01021                             BOOL bReverse = TRUE,
01022                             BOOL bCache = FALSE);
01023 
01024     static void ChangeShadowProfileWithNoUndo (CProfileBiasGain &Profile, SoftShadowTool* pTool);
01025 protected:
01026     NodeShadow* m_pNodeShadow;
01027     CProfileBiasGain m_LastProfile; 
01028 };
01029 
01030 /********************************************************************************************
01031 >   class ShadowDarknessOpParam : public OpParam
01032 
01033     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
01034     Created:    17/12/96
01035     Purpose:    Used by OpShadowPosition
01036 ********************************************************************************************/
01037 
01038 class ShadowDarknessOpParam : public OpParam
01039 {
01040     CC_DECLARE_DYNCREATE(ShadowDarknessOpParam)
01041 
01042 public:
01043     ShadowDarknessOpParam() { m_dDarkness = 0; m_pTool=NULL; }
01044     ShadowDarknessOpParam(double dNewDarkness, SoftShadowTool* pTool) { m_dDarkness = dNewDarkness; m_pTool=pTool; }
01045     ~ShadowDarknessOpParam() { };
01046 
01047 public:
01048     double m_dDarkness;
01049     SoftShadowTool* m_pTool;
01050 };
01051 
01052 
01053 
01054 /********************************************************************************************
01055 >   class OpChangeShadowDarkness : public SelOperation
01056 
01057     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
01058     Created:    10/6/99
01059     Purpose:    Update the width of the selected glows
01060 ********************************************************************************************/
01061 
01062 class OpChangeShadowDarkness : public SelOperation
01063 {
01064     CC_DECLARE_DYNCREATE(OpChangeShadowDarkness)
01065 
01066 public:
01067     OpChangeShadowDarkness();
01068     ~OpChangeShadowDarkness();
01069 
01070     virtual void DoWithParam(OpDescriptor* pOp, OpParam* pParam);
01071     static OpState GetState(String_256* Description, OpDescriptor*);
01072     static BOOL Declare();
01073 
01074     // Karim 21/01/2000 - see UndoableOperation base implementation.
01075     virtual BOOL MayChangeNodeBounds() const { return FALSE; }
01076 };
01077 
01078 /********************************************************************************************
01079 
01080 >   class ChangeShadowDarknessAction : public Action
01081 
01082     Author:     David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
01083     Created:    6/6/99
01084     Purpose:    Action for changing shadow profiles
01085     SeeAlso:    -
01086 
01087 ********************************************************************************************/
01088 
01089 class ChangeShadowDarknessAction : public Action
01090 {
01091 
01092 CC_DECLARE_DYNCREATE(ChangeShadowDarknessAction)
01093 
01094 public:
01095     ChangeShadowDarknessAction();
01096     ~ChangeShadowDarknessAction();
01097     virtual ActionCode Execute();
01098     static ActionCode Init( Operation* pOp,
01099                             ActionList* pActionList,
01100                             NodeShadow* pThisNodeShadow,
01101                             double dDarkness,
01102                             ChangeShadowDarknessAction** NewAction,
01103                             BOOL bReverse = FALSE,
01104                             BOOL bCache = FALSE);
01105 protected:
01106     NodeShadow* m_pNodeShadow;
01107     double m_dLastDarkness;
01108 };
01109 
01110 
01111 
01112 
01113 
01114 
01115 
01116 
01117 
01118 
01119 
01120 #endif      // BUILDSHADOWS
01121 #endif      // INC_OPSHADOW
01122  

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