00001 // $Id: rrcaps.cpp 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 // RRCaps are the render region caps. This lets us know what a render region can and can't 00099 // render. 00100 00101 /* 00102 */ 00103 00104 #include "camtypes.h" 00105 //#include "rrcaps.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00106 00107 // An implement to match the Declare in the .h file. 00108 CC_IMPLEMENT_MEMDUMP(RRCaps, CC_CLASS_MEMDUMP) 00109 00110 // Better Memory Dumps 00111 #define new CAM_DEBUG_NEW 00112 00113 00114 /******************************************************************************************** 00115 00116 > RRCaps::RRCaps() 00117 00118 Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> 00119 Created: 10/4/95 00120 Purpose: Constructor. Sets all the params to FALSE 00121 00122 ********************************************************************************************/ 00123 00124 RRCaps::RRCaps() 00125 { 00126 // by default we can render nothing 00127 CanDoNothing(); 00128 } 00129 00130 00131 00132 /******************************************************************************************** 00133 00134 > RRCaps::RRCaps(const RRCaps& Other) 00135 00136 Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> 00137 Created: 10/4/95 00138 Inputs: Other - the one to copy 00139 Returns: this one 00140 Purpose: copies the data from one RRCaps object to another 00141 00142 ********************************************************************************************/ 00143 00144 RRCaps::RRCaps(const RRCaps& Other) 00145 { 00146 // Copy all the params from the other one 00147 Transparency = Other.Transparency; 00148 GradFills = Other.GradFills; 00149 PerspectiveGradFills = Other.PerspectiveGradFills; 00150 BitmapFills = Other.BitmapFills; 00151 PerspectiveBitmapFills = Other.PerspectiveBitmapFills; 00152 LineAttrs = Other.LineAttrs; 00153 ArrowHeads = Other.ArrowHeads; 00154 DashPatterns = Other.DashPatterns; 00155 SimpleBitmaps = Other.SimpleBitmaps; 00156 ArbitraryBitmaps = Other.ArbitraryBitmaps; 00157 ClippedSimpleBitmaps = Other.ClippedSimpleBitmaps; 00158 ClippedArbitraryBitmaps = Other.ClippedArbitraryBitmaps; 00159 Grad3and4Fills = Other.Grad3and4Fills; 00160 ClippedOutput = Other.ClippedOutput; 00161 } 00162 00163 00164 00165 /******************************************************************************************** 00166 00167 > RRCaps& RRCaps::operator=(RRCaps &Other) 00168 00169 Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> 00170 Created: 10/4/95 00171 Inputs: Other - the one to copy 00172 Returns: this one 00173 Purpose: copies the data from one RRCaps object to another 00174 00175 ********************************************************************************************/ 00176 00177 RRCaps& RRCaps::operator=(const RRCaps &Other) 00178 { 00179 // Copy all the params from the other one 00180 Transparency = Other.Transparency; 00181 GradFills = Other.GradFills; 00182 PerspectiveGradFills = Other.PerspectiveGradFills; 00183 BitmapFills = Other.BitmapFills; 00184 PerspectiveBitmapFills = Other.PerspectiveBitmapFills; 00185 LineAttrs = Other.LineAttrs; 00186 ArrowHeads = Other.ArrowHeads; 00187 DashPatterns = Other.DashPatterns; 00188 SimpleBitmaps = Other.SimpleBitmaps; 00189 ArbitraryBitmaps = Other.ArbitraryBitmaps; 00190 ClippedSimpleBitmaps = Other.ClippedSimpleBitmaps; 00191 ClippedArbitraryBitmaps = Other.ClippedArbitraryBitmaps; 00192 Grad3and4Fills = Other.Grad3and4Fills; 00193 ClippedOutput = Other.ClippedOutput; 00194 00195 // return it 00196 return *this; 00197 } 00198 00199 /******************************************************************************************** 00200 00201 > RRCaps::~RRCaps() 00202 00203 Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> 00204 Created: 10/4/95 00205 Purpose: default desctuctor 00206 00207 ********************************************************************************************/ 00208 00209 RRCaps::~RRCaps() 00210 { 00211 // does nothing 00212 } 00213 00214 00215 00216 /******************************************************************************************** 00217 00218 > void RRCaps::CanDoAll() 00219 00220 Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> 00221 Created: 10/4/95 00222 Purpose: Sets all the flags in the RRCaps object to TRUE 00223 00224 ********************************************************************************************/ 00225 00226 void RRCaps::CanDoAll() 00227 { 00228 // we can do everything 00229 Transparency = TRUE; 00230 GradFills = TRUE; 00231 PerspectiveGradFills = TRUE; 00232 BitmapFills = TRUE; 00233 PerspectiveBitmapFills = TRUE; 00234 LineAttrs = TRUE; 00235 ArrowHeads = TRUE; 00236 DashPatterns = TRUE; 00237 SimpleBitmaps = TRUE; 00238 ArbitraryBitmaps = TRUE; 00239 ClippedSimpleBitmaps = TRUE; 00240 ClippedArbitraryBitmaps = TRUE; 00241 Grad3and4Fills = TRUE; 00242 ClippedOutput = TRUE; 00243 } 00244 00245 00246 /******************************************************************************************** 00247 00248 > void RRCaps::CanDoNothing() 00249 00250 Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> 00251 Created: 10/4/95 00252 Purpose: Sets all the flags in the RRCaps object to FALSE 00253 00254 ********************************************************************************************/ 00255 00256 void RRCaps::CanDoNothing() 00257 { 00258 // we can do nothing :-( 00259 Transparency = FALSE; 00260 GradFills = FALSE; 00261 PerspectiveGradFills = FALSE; 00262 BitmapFills = FALSE; 00263 PerspectiveBitmapFills = FALSE; 00264 LineAttrs = FALSE; 00265 ArrowHeads = FALSE; 00266 DashPatterns = FALSE; 00267 SimpleBitmaps = FALSE; 00268 ArbitraryBitmaps = FALSE; 00269 ClippedSimpleBitmaps = FALSE; 00270 ClippedArbitraryBitmaps = FALSE; 00271 Grad3and4Fills = FALSE; 00272 ClippedOutput = FALSE; 00273 } 00274 00275 00276 00277 /******************************************************************************************** 00278 00279 > BOOL RRCaps::DoesRegionDoAll() 00280 00281 Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> 00282 Created: 25/4/95 00283 Returns: TRUE if the region that owns this RRCaps can do everything 00284 Purpose: This function helps to identify render regions that need no special 00285 treatment early on. If this function returns TRUE it means that there is 00286 nothing the region that this caps object belongs to can't do. 00287 00288 ********************************************************************************************/ 00289 00290 BOOL RRCaps::DoesRegionDoAll() 00291 { 00292 // See if everything is set to TRUE 00293 if ((Transparency==TRUE) && 00294 (GradFills==TRUE) && 00295 (PerspectiveGradFills==TRUE) && 00296 (BitmapFills==TRUE) && 00297 (PerspectiveBitmapFills==TRUE) && 00298 (SimpleBitmaps==TRUE) && 00299 (ArbitraryBitmaps==TRUE) && 00300 (ClippedSimpleBitmaps==TRUE) && 00301 (ClippedArbitraryBitmaps==TRUE) && 00302 (LineAttrs==TRUE) && 00303 (ArrowHeads==TRUE) && 00304 (DashPatterns==TRUE) && 00305 (Grad3and4Fills==TRUE) && 00306 (ClippedOutput==TRUE)) 00307 return TRUE; 00308 00309 // something was not set to TRUE 00310 return FALSE; 00311 } 00312 00313 00314 /******************************************************************************************** 00315 00316 > BOOL RRCaps::DoesRegionDoNothing() 00317 00318 Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> 00319 Created: 25/4/95 00320 Returns: TRUE if the region that owns this RRCaps can do nothing. 00321 Purpose: This function helps to identify render regions that need special 00322 treatment early on. If this function returns TRUE it means that there is 00323 nothing the region can do. 00324 00325 ********************************************************************************************/ 00326 00327 BOOL RRCaps::DoesRegionDoNothing() 00328 { 00329 // See if everything is set to TRUE 00330 if ((Transparency==FALSE) && 00331 (GradFills==FALSE) && 00332 (PerspectiveGradFills==FALSE) && 00333 (BitmapFills==FALSE) && 00334 (PerspectiveBitmapFills==FALSE) && 00335 (SimpleBitmaps==FALSE) && 00336 (ArbitraryBitmaps==FALSE) && 00337 (ClippedSimpleBitmaps==FALSE) && 00338 (ClippedArbitraryBitmaps==FALSE) && 00339 (LineAttrs==FALSE) && 00340 (ArrowHeads==FALSE) && 00341 (DashPatterns==FALSE) && 00342 (Grad3and4Fills==FALSE) && 00343 (ClippedOutput==FALSE)) 00344 return TRUE; 00345 00346 // something was not set to TRUE 00347 return FALSE; 00348 }