00001 // $Id: fillndge.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 // Definition of the fill nudge classes 00099 00100 #ifndef INC_FILLNDGE 00101 #define INC_FILLNDGE 00102 00103 #include "tranlate.h" 00104 //#include "fillattr.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00105 00106 #define OPTOKEN_FILLNUDGE _T("FillNudge") 00107 00108 /******************************************************************************************** 00109 00110 > class OpFillNudge : public Operation 00111 00112 Author: Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> 00113 Created: 8/3/95 00114 Purpose: The underlying nudge op that does a nudge on the selected points in a path. 00115 SeeAlso: class OpNudge 00116 00117 ********************************************************************************************/ 00118 00119 class OpFillNudge : public Operation 00120 { 00121 CC_DECLARE_DYNCREATE(OpFillNudge); 00122 00123 public: 00124 static BOOL Init(); 00125 static OpState GetState(String_256*, OpDescriptor*); 00126 //BOOL IsPixelNudgeClass ; //flag to determnie whether to nudge in MM otr Pixels rabir 00127 00128 // The actual nudge displacement is the one that takes into account the nudge factor, which 00129 // provides the magnitude and direction. 00130 // Use these functions to get the X and Y nudge displacements to apply 00131 // chnaged from MIILIPOINT to double to get 0.2MM nudging 00132 static double GetXNudgeDisplacement() { return NudgeStep * X_NudgeFactor; } 00133 static double GetYNudgeDisplacement() { return NudgeStep * Y_NudgeFactor; } 00134 double GetXPixelDisplacement() { return PixelNudge * X_NudgeFactor;} 00135 double GetYPixelDisplacement() { return PixelNudge * Y_NudgeFactor;} 00136 00137 // Do() will nudge each selected object by GetXNudgeDisplacement() in the x direction 00138 // and GetYNudgeDisplacement in the y direction 00139 virtual void Do(OpDescriptor* pOpDesc); 00140 00141 // Overide GetOpName() so the correct string appears in the undo/redo menu item strings 00142 void GetOpName(String_256* OpName); 00143 00144 static void NudgeColours(BOOL); 00145 00146 protected: 00147 // The X and Y nudge factors are set up by a derived class' Do() function 00148 // E.g. OpNudgeUp1::Do() would set X_NudgeFactor=0, and Y_NudgeFactor = 1 00149 // Changed from INT32 to double for 0.2 MM Nudging 00150 static double X_NudgeFactor; // displacement nudged in x dir = NudgeStep * X_NudgeFactor; 00151 static double Y_NudgeFactor; // displacement nudged in y dir = NudgeStep * Y_NudgeFactor; 00152 00153 UINT32 NudgeUndoIDS; 00154 00155 private: 00156 static MILLIPOINT NudgeStep; // The size of a single nudge (must be a +ve value) 00157 static BOOL NudgeCols; // Shall we nudge colour or transparency fills ? 00158 BOOL IsPixelNudgeClass ; // Flag to test whether to nudge in MM or PIXELS 00159 double PixelNudge; // The size of a single nudge 00160 }; 00161 00162 00163 #define OPTOKEN_FILLNUDGEUP1 _T("FillNudgeUp1") 00164 #define OPTOKEN_FILLNUDGEUP5 _T("FillNudgeUp5") 00165 #define OPTOKEN_FILLNUDGEUP10 _T("FillNudgeUp10") 00166 #define OPTOKEN_FILLNUDGEUPFIFTH _T("FillNudgeUpFifth") 00167 #define OPTOKEN_FILLNUDGEUPPIXEL1 _T("FillNudgeUpPixel1") 00168 #define OPTOKEN_FILLNUDGEUPPIXEL10 _T("FillNudgeUpPixel10") 00169 00170 #define OPTOKEN_FILLNUDGEDOWN1 _T("FillNudgeDown1") 00171 #define OPTOKEN_FILLNUDGEDOWN5 _T("FillNudgeDown5") 00172 #define OPTOKEN_FILLNUDGEDOWN10 _T("FillNudgeDown10") 00173 #define OPTOKEN_FILLNUDGEDOWNFIFTH _T("FillNudgeDownFifth") 00174 #define OPTOKEN_FILLNUDGEDOWNPIXEL1 _T("FillNudgeDownPixel1") 00175 #define OPTOKEN_FILLNUDGEDOWNPIXEL10 _T("FillNudgeDownPixel10") 00176 00177 #define OPTOKEN_FILLNUDGELEFT1 _T("FillNudgeLeft1") 00178 #define OPTOKEN_FILLNUDGELEFT5 _T("FillNudgeLeft5") 00179 #define OPTOKEN_FILLNUDGELEFT10 _T("FillNudgeLeft10") 00180 #define OPTOKEN_FILLNUDGELEFTFIFTH _T("FillNudgeLeftFifth") 00181 #define OPTOKEN_FILLNUDGELEFTPIXEL1 _T("FillNudgeLeftPixel1") 00182 #define OPTOKEN_FILLNUDGELEFTPIXEL10 _T("FillNudgeLeftPixel10") 00183 00184 #define OPTOKEN_FILLNUDGERIGHT1 _T("FillNudgeRight1") 00185 #define OPTOKEN_FILLNUDGERIGHT5 _T("FillNudgeRight5") 00186 #define OPTOKEN_FILLNUDGERIGHT10 _T("FillNudgeRight10") 00187 #define OPTOKEN_FILLNUDGERIGHTFIFTH _T("FillNudgeRightFifth") 00188 #define OPTOKEN_FILLNUDGERIGHTPIXEL1 _T("FillNudgeRightPixel1") 00189 #define OPTOKEN_FILLNUDGERIGHTPIXEL10 _T("FillNudgeRightPixel10") 00190 00191 00192 #define DECLARE_OPFILLNUDGE_CLASS(DIR1) \ 00193 class OpFillNudge ## DIR1 : public OpFillNudge \ 00194 { \ 00195 CC_DECLARE_DYNCREATE(OpFillNudge ## DIR1) \ 00196 public: \ 00197 virtual void Do(OpDescriptor* pOpDesc); \ 00198 }; \ 00199 00200 00201 DECLARE_OPFILLNUDGE_CLASS (Up1) 00202 DECLARE_OPFILLNUDGE_CLASS (Up5) 00203 DECLARE_OPFILLNUDGE_CLASS (Up10) 00204 DECLARE_OPFILLNUDGE_CLASS (UpFifth) 00205 DECLARE_OPFILLNUDGE_CLASS (UpPixel1) 00206 DECLARE_OPFILLNUDGE_CLASS (UpPixel10) 00207 00208 DECLARE_OPFILLNUDGE_CLASS (Down1) 00209 DECLARE_OPFILLNUDGE_CLASS (Down5) 00210 DECLARE_OPFILLNUDGE_CLASS (Down10) 00211 DECLARE_OPFILLNUDGE_CLASS (DownFifth) 00212 DECLARE_OPFILLNUDGE_CLASS (DownPixel1) 00213 DECLARE_OPFILLNUDGE_CLASS (DownPixel10) 00214 00215 00216 DECLARE_OPFILLNUDGE_CLASS (Left1) 00217 DECLARE_OPFILLNUDGE_CLASS (Left5) 00218 DECLARE_OPFILLNUDGE_CLASS (Left10) 00219 DECLARE_OPFILLNUDGE_CLASS (LeftFifth) 00220 DECLARE_OPFILLNUDGE_CLASS (LeftPixel1) 00221 DECLARE_OPFILLNUDGE_CLASS (LeftPixel10) 00222 00223 DECLARE_OPFILLNUDGE_CLASS (Right1) 00224 DECLARE_OPFILLNUDGE_CLASS (Right5) 00225 DECLARE_OPFILLNUDGE_CLASS (Right10) 00226 DECLARE_OPFILLNUDGE_CLASS (RightFifth) 00227 DECLARE_OPFILLNUDGE_CLASS (RightPixel1) 00228 DECLARE_OPFILLNUDGE_CLASS (RightPixel10) 00229 00230 00231 /*********************************************************************************************** 00232 00233 > class FillGeometryNudger : public AttrValueChange 00234 00235 Author: Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> 00236 Created: 29/3/94 00237 Purpose: Nudges a fill geometry. 00238 This Attribute never exists in the Tree. 00239 SeeAlso: AttrValueChange 00240 00241 ***********************************************************************************************/ 00242 00243 class FillGeometryNudger : public AttrValueChange 00244 { 00245 CC_DECLARE_DYNCREATE(FillGeometryNudger) 00246 00247 public: 00248 FillGeometryNudger() : AttrValueChange() {} 00249 00250 virtual UINT32 GetAttrNameID(void); 00251 virtual AttributeValue* GetAttributeValue() { return NULL; } 00252 virtual AttrFillGeometry* MutateFill(AttrFillGeometry* FillToMutate); 00253 00254 void SetNudgeDistance(INT32 xOffset, INT32 yOffset); 00255 00256 protected: 00257 INT32 X_NudgeDistance; 00258 INT32 Y_NudgeDistance; 00259 }; 00260 #endif