00001 // $Id: objchge.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 perspective mould shapes implementation 00099 00100 #ifndef INC_OBJCHANGE 00101 #define INC_OBJCHANGE 00102 00103 //#include "node.h" // for ChangeCode enum - in camtypes.h [AUTOMATICALLY REMOVED] 00104 00105 class Node; 00106 class UndoableOperation; 00107 class Path; 00108 class Spread; 00109 00110 00111 /*********************************************************************************************** 00112 > typedef enum ObjChangeType 00113 00114 Author: Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com> 00115 Date: 4/5/95 00116 Purpose: Indicate to AllowOp()'s from which direction they were called 00117 SeeAlso: ObjChangeFlags, ObjChangeParam 00118 ***********************************************************************************************/ 00119 00120 typedef enum ObjChangeDirection 00121 { 00122 OBJCHANGE_CALLEDBYOP, 00123 OBJCHANGE_CALLEDBYPARENT, 00124 OBJCHANGE_CALLEDBYCHILD 00125 }; 00126 00127 00128 /*********************************************************************************************** 00129 > typedef enum ObjChangeType 00130 00131 Author: Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com> 00132 Date: 09/01/95 00133 Purpose: Types of change one can generate on a child object. These types form the 00134 ObjChangeType field inside the following class ObjChangeParam. 00135 SeeAlso: ObjChangeFlags, ObjChangeParam 00136 ***********************************************************************************************/ 00137 00138 typedef enum ObjChangeType 00139 { 00140 OBJCHANGE_UNDEFINED, 00141 OBJCHANGE_STARTING, // the child object is about to undergo a change 00142 OBJCHANGE_RENDERCURRENTBLOBS, // during an interactive change ie a drag signal 'before' 00143 OBJCHANGE_RENDERCHANGEDBLOBS, // during an interactive change signal 'after' 00144 OBJCHANGE_FINISHED, // having actually changed the tree child object inform the parent 00145 OBJCHANGE_IGNORE, // Ignore this ObjChangeParam message 00146 OBJCHANGE_FAILED // failed to actually change the child object 00147 }; 00148 00149 00150 /*********************************************************************************************** 00151 > class ObjChangeFlags 00152 00153 Author: Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com> (& Markn) 00154 Date: 09/01/95 00155 Purpose: Defines physical changes which have occured on an object. These should be as 00156 high level as possible. 00157 If your object has changed in a subtle way, try and choose the field which best 00158 matches the change. Try not to invent a new field for your change as like as 00159 not no one will respond to it. 00160 SeeAlso: ObjChangeType, ObjChangeParam 00161 ***********************************************************************************************/ 00162 00163 class ObjChangeFlags 00164 { 00165 public: 00166 ObjChangeFlags( BOOL Delete = FALSE, 00167 BOOL Replace = FALSE, 00168 BOOL Move = FALSE, 00169 BOOL Attr = FALSE, 00170 BOOL MultiReplace = FALSE, 00171 BOOL TransForm = FALSE, 00172 BOOL Copy = FALSE, 00173 BOOL Regen = FALSE); 00174 00175 public: 00176 BYTE DeleteNode : 1; // The node will be deleted (or hidden) 00177 BYTE ReplaceNode : 1; // The node will be replaced with *one* other 00178 BYTE MoveNode : 1; // The node will be moved to another place in the tree 00179 BYTE Attribute : 1; // One or more attributes will be applied to this node 00180 BYTE MultiReplaceNode : 1; // The node will be replaced with one or more nodes 00181 BYTE TransformNode : 1; // The node will be transformed 00182 BYTE CopyNode : 1; // The node will be copied to the clipboard 00183 BYTE RegenerateNode : 1; // The node will be regenerated 00184 }; 00185 00186 00187 00188 /*********************************************************************************************** 00189 > class ObjChangeMask 00190 00191 Author: Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com> 00192 Date: 11/01/95 00193 Purpose: Defines what messages if any are passed to parent objects. The starting message 00194 is not defined here as this is used to allow nodes to actually set the mask. 00195 All flags are initialised to FALSE and should be set by nodes to TRUE when they 00196 want to receive a message. If any parent node requires a message then all will 00197 get the message. 00198 Note the mask is verified and corrected so that messages will be sent correctly 00199 in sequence. 00200 ***********************************************************************************************/ 00201 00202 class ObjChangeMask 00203 { 00204 public: 00205 ObjChangeMask(); 00206 void CorrectMask(); 00207 void ClaimAll(); 00208 00209 public: 00210 BYTE EorBlobs : 1; 00211 BYTE Finished : 1; 00212 }; 00213 00214 00215 /*********************************************************************************************** 00216 > class ObjChangeParam 00217 00218 Author: Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com> 00219 Date: 09/01/95 00220 Purpose: Provides a derivable structure for passing to a nodes OnChildChange virtual 00221 function. To create this class parameter simply call Define with the necessary 00222 change variables. 00223 SeeAlso: ObjChangeType, ObjChangeFlags 00224 ***********************************************************************************************/ 00225 00226 class ObjChangeParam : public CCObject 00227 { 00228 CC_DECLARE_DYNAMIC(ObjChangeParam) 00229 00230 public: 00231 ObjChangeParam(); 00232 ObjChangeParam(ObjChangeType cType,ObjChangeFlags cFlags,Node* cNode,UndoableOperation* cOp, 00233 ObjChangeDirection=OBJCHANGE_CALLEDBYOP, Node* pCallingChild = NULL); 00234 ~ObjChangeParam(); 00235 00236 void Define(ObjChangeType, ObjChangeFlags, Node*, UndoableOperation*, 00237 ObjChangeDirection direction=OBJCHANGE_CALLEDBYOP, 00238 Node* pCallingChild = NULL); 00239 ObjChangeType GetChangeType() const { return ChangeType; } 00240 ObjChangeFlags GetChangeFlags() const { return ChangeFlags; } 00241 UndoableOperation* GetOpPointer() const { return pChangeOp; } 00242 Node* GetChangeObj() const { return pChangeNode; } 00243 ObjChangeDirection GetDirection() const { return ChangeDirection; } 00244 void SetDirection(ObjChangeDirection direction) { ChangeDirection=direction; } 00245 00246 void SetReasonForDenial(UINT32 IDS) { DenialReason = IDS; } 00247 UINT32 GetReasonForDenial() { return DenialReason; } 00248 ObjChangeFlags* GetSettableChangeFlags() { return &ChangeFlags; } 00249 00250 void SetCallingChild(Node* pCallingChild) { m_pCallingChild = pCallingChild; } 00251 Node* GetCallingChild() { return m_pCallingChild; } 00252 00253 void SetRetainCachedData(BOOL bNewValue) {m_bRetainCachedData = bNewValue;} 00254 BOOL GetRetainCachedData() const {return m_bRetainCachedData;} 00255 00256 public: 00257 ObjChangeMask ChangeMask; 00258 00259 protected: 00260 ObjChangeType ChangeType; 00261 ObjChangeFlags ChangeFlags; 00262 ObjChangeDirection ChangeDirection; 00263 UndoableOperation* pChangeOp; 00264 Node* pChangeNode; 00265 UINT32 DenialReason; 00266 Node* m_pCallingChild; 00267 BOOL m_bRetainCachedData; // When processing try to retain cached data if possible 00268 00269 }; 00270 00271 00272 00273 00274 /*********************************************************************************************** 00275 00276 > class ObjChangePathEdit : public ObjChangeParam 00277 00278 Author: Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com> 00279 Date: 10/01/95 00280 Purpose: A derived change parameter for use in path editing. It is exactly the same as 00281 ObjChangeParam apart from providing a path pointer, for use during eor drags, 00282 to describe the current state of the dragged path. Obviously this cannot be 00283 determined from the tree object until it has been updated when the drag finishes 00284 SeeAlso: 00285 00286 ***********************************************************************************************/ 00287 00288 class ObjChangePathEdit : public ObjChangeParam 00289 { 00290 CC_DECLARE_DYNAMIC(ObjChangePathEdit) 00291 00292 public: 00293 ObjChangePathEdit(); 00294 ~ObjChangePathEdit(); 00295 void Define(ObjChangeType, ObjChangeFlags, Node*, UndoableOperation*, Path*, Spread*); 00296 00297 ChangeCode ObjChangeStarting(Node*,UndoableOperation*,Path*,Spread*,BOOL); 00298 ChangeCode RenderCurrentBlobs(Node*,UndoableOperation*,Path*,Spread*,BOOL); 00299 ChangeCode RenderChangedBlobs(Node*,UndoableOperation*,Path*,Spread*,BOOL); 00300 ChangeCode ObjChangeFinished(Node*,UndoableOperation*,Path*,Spread*,BOOL); 00301 ChangeCode ObjChangeFailed(Node*,UndoableOperation*,Path*,Spread*,BOOL); 00302 00303 public: 00304 Path* pChangePath; 00305 Spread* pChangeSpread; 00306 }; 00307 00308 00309 00310 /*********************************************************************************************** 00311 00312 > class ObjChangeParamWithToken 00313 00314 Author: Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com> 00315 Date: 6/3/95 00316 Purpose: Identical to a ObjChangeParam object, except that there is an additional field 00317 that contains the OpToken 00318 SeeAlso: ObjChangeParam 00319 00320 ***********************************************************************************************/ 00321 00322 class ObjChangeParamWithToken : public ObjChangeParam 00323 { 00324 CC_DECLARE_DYNAMIC(ObjChangeParamWithToken) 00325 00326 public: 00327 ObjChangeParamWithToken(ObjChangeType cType,ObjChangeFlags cFlags,Node* cNode,UndoableOperation* cOp, String* pToken); 00328 ~ObjChangeParamWithToken(); 00329 00330 String* GetOpToken() {return &OperationToken;}; 00331 00332 protected: 00333 String OperationToken; 00334 }; 00335 00336 00337 #endif 00338