00001 // $Id: objreg.cpp 1445 2006-07-14 20:15:02Z phil $ 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 //*/ 00100 00101 00102 #include "camtypes.h" 00103 #include "objreg.h" 00104 //#include "listitem.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00105 //#include "list.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00106 //#include "ensure.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00107 #include "lineattr.h" 00108 //#include "node.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00109 #include "nodepath.h" 00110 #include "noderect.h" 00111 //#include "errors.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00112 //#include "group.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00113 //#include "fillattr.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00114 #include "qualattr.h" 00115 #include "nodebmp.h" 00116 //#include "txtattr.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00117 #include "nodetxts.h" 00118 #include "nodershp.h" 00119 #include "nodetext.h" 00120 #include "nodebldr.h" 00121 #include "ndmldpth.h" 00122 #include "isetattr.h" 00123 #include "userattr.h" 00124 #include "webattr.h" 00125 #include "strkattr.h" 00126 #include "attrbev.h" 00127 #include "nodeshad.h" 00128 #include "brshattr.h" 00129 #include "fthrattr.h" 00130 00131 00132 // Declare all the class and details of memory leaks 00133 CC_IMPLEMENT_MEMDUMP(NodeAttributeClassItem, ListItem) 00134 CC_IMPLEMENT_MEMDUMP(NodeRenderableInkDetailsItem, ListItem) 00135 00136 // Declare smart memory handling in Debug builds 00137 #define new CAM_DEBUG_NEW 00138 00139 List ObjectRegistry::NodeRenderableInkDetailsList; 00140 00141 00142 00143 // Implementation of NodeRenderableInkDetailsItem class 00144 00145 /******************************************************************************************** 00146 00147 > BOOL NodeRenderableInkDetailsItem::AddAttribClass(CCRuntimeClass* pAttribClass) 00148 00149 Author: Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com> 00150 Created: 07/02/2001 00151 00152 Inputs: pAttr ptr to the runtime class of a specific attribute type. 00153 00154 Returns: TRUE if successful, FALSE otherwise (eg out of memory). 00155 00156 Purpose: Add a NodeAttribute class to this details item, eg: 00157 00158 NodeRenderableInkDetailsItem* pFillDetails; 00159 pFillDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrFillGeometry )); 00160 00161 to add the AttrFillGeometry type to the pNewDetails item. 00162 00163 ********************************************************************************************/ 00164 BOOL NodeRenderableInkDetailsItem::AddAttribClass(CCRuntimeClass* pAttribClass) 00165 { 00166 NodeAttributeClassItem* pAttrClassItem = new NodeAttributeClassItem; 00167 if (pAttrClassItem == NULL) 00168 return FALSE; 00169 00170 pAttrClassItem->AttributeClass = pAttribClass; 00171 NodeAttributeClassList.AddTail(pAttrClassItem); 00172 00173 return TRUE; 00174 } 00175 00176 00177 00178 /******************************************************************************************** 00179 00180 > void NodeRenderableInkDetailsItem::RemoveAttribClass(CCRuntimeClass* pAttribClass) 00181 00182 Author: Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com> 00183 Created: 08/02/2001 00184 00185 Inputs: pAttr ptr to the runtime class of a specific attribute type. 00186 00187 Purpose: Remove a NodeAttribute class from this details item, eg: 00188 00189 pFillDetails->RemoveAttribClass( CC_RUNTIME_CLASS( AttrFillGeometry )); 00190 00191 to Remove the AttrFillGeometry type from the pFillDetails item. 00192 00193 Notes: * We do nothing if pAttribClass is not in our list. 00194 * We remove all occurrences of pAttribClass from our list. 00195 00196 ********************************************************************************************/ 00197 void NodeRenderableInkDetailsItem::RemoveAttribClass(CCRuntimeClass* pAttribClass) 00198 { 00199 NodeAttributeClassItem* pThisClassItem = (NodeAttributeClassItem*) 00200 NodeAttributeClassList.GetHead(); 00201 NodeAttributeClassItem* pNextClassItem = NULL; 00202 while (pThisClassItem != NULL) 00203 { 00204 pNextClassItem = (NodeAttributeClassItem*) NodeAttributeClassList.GetNext(pThisClassItem); 00205 00206 if (pThisClassItem->AttributeClass == pAttribClass) 00207 { 00208 NodeAttributeClassList.RemoveItem(pThisClassItem); 00209 delete pThisClassItem; 00210 } 00211 00212 pThisClassItem = pNextClassItem; 00213 } 00214 } 00215 00216 00217 00218 // Implementation of the object registry class 00219 00220 00221 /******************************************************************************************** 00222 00223 > static void ObjectRegistry::Delete() 00224 00225 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00226 Created: 11/2/94 00227 Inputs: - 00228 Outputs: - 00229 Returns: - 00230 Purpose: Deletes the object registry data 00231 Errors: - 00232 SeeAlso: - 00233 00234 ********************************************************************************************/ 00235 00236 void ObjectRegistry::Delete() 00237 { 00238 // Delete the NodeRenderableInkDetailsList 00239 ListItem* Current = NodeRenderableInkDetailsList.GetHead(); 00240 while (Current != NULL) 00241 { 00242 ListItem* Next = NodeRenderableInkDetailsList.GetNext(Current); 00243 ((NodeRenderableInkDetailsItem*)Current)->NodeAttributeClassList.DeleteAll(); 00244 delete(NodeRenderableInkDetailsList.RemoveItem(Current)); 00245 Current = Next; 00246 } 00247 } 00248 00249 /******************************************************************************************** 00250 00251 > static BOOL ObjectRegistry::Init() 00252 00253 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00254 Created: 10/2/94 00255 Inputs: - 00256 Outputs: - 00257 Returns: TRUE if successful, FALSE if we run out of memory 00258 00259 Purpose: Sets up the NodeRenderableInkDetailsList for all NodeRenderableInkNodes defined 00260 in Camelot. 00261 00262 Errors: If we run out of memory then ERROR is called and FALSE returned. 00263 SeeAlso: - 00264 00265 ********************************************************************************************/ 00266 00267 // A little MACRO to make adding attributes to NodeRenderableInkDetailsItem's easier 00268 #define ADD_ATTRIB_CLASS(ReqdAttribItem, AttribClass) \ 00269 AttrClassItem = new NodeAttributeClassItem; \ 00270 if (AttrClassItem == NULL) \ 00271 goto OutOfMemory; \ 00272 AttrClassItem->AttributeClass = CC_RUNTIME_CLASS(AttribClass); \ 00273 (ReqdAttribItem)->NodeAttributeClassList.AddTail(AttrClassItem); 00274 00275 00276 /* 00277 BOOL ObjectRegistry::Init() 00278 { 00279 // All NodeRenderableInk nodes must be registered in here. If the node requires 00280 // no attributes then simply give it an empty attribute list. 00281 00282 // Create all the attribute classes in an array so that they can easily be deleted 00283 // if we run out of memory. 00284 NodeAttributeClassItem* AttrClassItem; 00285 00286 NodeRenderableInkDetailsItem* NodeGroupsDetails; 00287 NodeRenderableInkDetailsItem* NodePathsDetails; 00288 NodeRenderableInkDetailsItem* NodeRectDetails; 00289 NodeRenderableInkDetailsItem* NodeBitmapDetails; 00290 NodeRenderableInkDetailsItem* BaseTextClassDetails; 00291 NodeRenderableInkDetailsItem* NodeRegularShapeDetails; 00292 00293 NodeRenderableInkDetailsItem* DefaultDetails; 00294 00295 00296 // Have removed those attributes which are currently not used 00297 00298 // ------------------------------------------------------------------------------------ 00299 // Register NodeGroup 00300 NodeGroupsDetails = new NodeRenderableInkDetailsItem(); 00301 if (NodeGroupsDetails == NULL) 00302 { 00303 goto OutOfMemory; 00304 } 00305 NodeGroupsDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeGroup); 00306 RegisterNodeRenderableInkDetails(NodeGroupsDetails); 00307 00308 // A node group allways requires all attributes 00309 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrFillGeometry); 00310 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrTranspFillGeometry); 00311 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrFillMapping); 00312 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrTranspFillMapping); 00313 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrFillEffect); 00314 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrQuality); 00315 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrLineWidth); 00316 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrStrokeColour); 00317 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrStrokeTransp); 00318 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrStartArrow); 00319 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrEndArrow); 00320 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrStartCap); 00321 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrEndCap); 00322 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrJoinType); 00323 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrMitreLimit); 00324 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrWindingRule); 00325 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrDashPattern); 00326 ADD_ATTRIB_CLASS(NodeGroupsDetails, AttrMould); 00327 00328 00329 // ------------------------------------------------------------------------------------ 00330 // Register NodeRegularShape 00331 NodeRegularShapeDetails = new NodeRenderableInkDetailsItem(); 00332 if (NodeRegularShapeDetails == NULL) 00333 { 00334 goto OutOfMemory; 00335 } 00336 NodeRegularShapeDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeRegularShape); 00337 NodeRegularShapeDetails->IsABaseClass = TRUE; 00338 RegisterNodeRenderableInkDetails(NodeRegularShapeDetails); 00339 00340 // A node group allways requires all attributes 00341 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrFillGeometry); 00342 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrTranspFillGeometry); 00343 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrFillMapping); 00344 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrTranspFillMapping); 00345 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrFillEffect); 00346 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrQuality); 00347 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrLineWidth); 00348 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrStrokeColour); 00349 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrStrokeTransp); 00350 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrStartArrow); 00351 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrEndArrow); 00352 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrStartCap); 00353 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrEndCap); 00354 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrJoinType); 00355 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrMitreLimit); 00356 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrWindingRule); 00357 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrDashPattern); 00358 ADD_ATTRIB_CLASS(NodeRegularShapeDetails, AttrMould); 00359 00360 // ------------------------------------------------------------------------------------- 00361 // Register NodeRect 00362 NodeRectDetails = new NodeRenderableInkDetailsItem(); 00363 if (NodeRectDetails == NULL) 00364 { 00365 goto OutOfMemory; 00366 } 00367 NodeRectDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeRect); 00368 RegisterNodeRenderableInkDetails(NodeRectDetails); 00369 00370 ADD_ATTRIB_CLASS(NodeRectDetails, AttrFillGeometry); 00371 ADD_ATTRIB_CLASS(NodeRectDetails, AttrTranspFillGeometry); 00372 ADD_ATTRIB_CLASS(NodeRectDetails, AttrFillMapping); 00373 ADD_ATTRIB_CLASS(NodeRectDetails, AttrTranspFillMapping); 00374 ADD_ATTRIB_CLASS(NodeRectDetails, AttrFillEffect); 00375 ADD_ATTRIB_CLASS(NodeRectDetails, AttrQuality); 00376 ADD_ATTRIB_CLASS(NodeRectDetails, AttrLineWidth); 00377 ADD_ATTRIB_CLASS(NodeRectDetails, AttrStrokeColour); 00378 ADD_ATTRIB_CLASS(NodeRectDetails, AttrStrokeTransp); 00379 ADD_ATTRIB_CLASS(NodeRectDetails, AttrStartArrow); 00380 ADD_ATTRIB_CLASS(NodeRectDetails, AttrEndArrow); 00381 ADD_ATTRIB_CLASS(NodeRectDetails, AttrStartCap); 00382 ADD_ATTRIB_CLASS(NodeRectDetails, AttrEndCap); 00383 ADD_ATTRIB_CLASS(NodeRectDetails, AttrJoinType); 00384 ADD_ATTRIB_CLASS(NodeRectDetails, AttrMitreLimit); 00385 ADD_ATTRIB_CLASS(NodeRectDetails, AttrWindingRule); 00386 ADD_ATTRIB_CLASS(NodeRectDetails, AttrDashPattern); 00387 ADD_ATTRIB_CLASS(NodeRectDetails, AttrMould); 00388 00389 // ------------------------------------------------------------------------------------- 00390 // Register NodeBitmap 00391 NodeBitmapDetails = new NodeRenderableInkDetailsItem(); 00392 if (NodeBitmapDetails == NULL) 00393 { 00394 goto OutOfMemory; 00395 } 00396 NodeBitmapDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeBitmap); 00397 RegisterNodeRenderableInkDetails(NodeBitmapDetails); 00398 00399 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillGeometry); 00400 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrTranspFillGeometry); 00401 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillMapping); 00402 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrTranspFillMapping); 00403 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillEffect); 00404 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrQuality); 00405 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrStrokeColour); 00406 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrMould); 00407 00408 // BODGE we need to add a seperate list for KernCodes which don't require any attributes 00409 00410 // ------------------------------------------------------------------------------------- 00411 // Register BaseTextClass 00412 BaseTextClassDetails = new NodeRenderableInkDetailsItem(); 00413 if (BaseTextClassDetails == NULL) 00414 { 00415 goto OutOfMemory; 00416 } 00417 00418 BaseTextClassDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(BaseTextClass); 00419 BaseTextClassDetails->IsABaseClass = TRUE; 00420 RegisterNodeRenderableInkDetails(BaseTextClassDetails); 00421 00422 // All Nodes Derived from BaseTextClass require all the normal attributes plus attributes 00423 // which only make sense when applied to text nodes 00424 00425 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillGeometry); 00426 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTranspFillGeometry); 00427 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillMapping); 00428 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTranspFillMapping); 00429 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillEffect); 00430 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrQuality); 00431 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrLineWidth); 00432 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStrokeColour); 00433 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStrokeTransp); 00434 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStartArrow); 00435 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrEndArrow); 00436 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStartCap); 00437 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrEndCap); 00438 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrJoinType); 00439 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrMitreLimit); 00440 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrWindingRule); 00441 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrDashPattern); 00442 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrMould); 00443 00444 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtFontTypeface); 00445 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtBold); 00446 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtItalic); 00447 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtUnderline); 00448 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtAspectRatio); 00449 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtJustification); 00450 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtTracking); 00451 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtFontSize); 00452 00453 // ------------------------------------------------------------------------------------ 00454 // Register NodePath 00455 NodePathsDetails = new NodeRenderableInkDetailsItem(); 00456 if (NodePathsDetails == NULL) 00457 { 00458 goto OutOfMemory; 00459 } 00460 NodePathsDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodePath); 00461 RegisterNodeRenderableInkDetails(NodePathsDetails); 00462 00463 ADD_ATTRIB_CLASS(NodePathsDetails, AttrFillGeometry); 00464 ADD_ATTRIB_CLASS(NodePathsDetails, AttrTranspFillGeometry); 00465 ADD_ATTRIB_CLASS(NodePathsDetails, AttrFillMapping); 00466 ADD_ATTRIB_CLASS(NodePathsDetails, AttrTranspFillMapping); 00467 ADD_ATTRIB_CLASS(NodePathsDetails, AttrFillEffect); 00468 ADD_ATTRIB_CLASS(NodePathsDetails, AttrQuality); 00469 ADD_ATTRIB_CLASS(NodePathsDetails, AttrLineWidth); 00470 ADD_ATTRIB_CLASS(NodePathsDetails, AttrStrokeColour); 00471 ADD_ATTRIB_CLASS(NodePathsDetails, AttrStrokeTransp); 00472 ADD_ATTRIB_CLASS(NodePathsDetails, AttrStartArrow); 00473 ADD_ATTRIB_CLASS(NodePathsDetails, AttrEndArrow); 00474 ADD_ATTRIB_CLASS(NodePathsDetails, AttrStartCap); 00475 ADD_ATTRIB_CLASS(NodePathsDetails, AttrEndCap); 00476 ADD_ATTRIB_CLASS(NodePathsDetails, AttrJoinType); 00477 ADD_ATTRIB_CLASS(NodePathsDetails, AttrMitreLimit); 00478 ADD_ATTRIB_CLASS(NodePathsDetails, AttrWindingRule); 00479 ADD_ATTRIB_CLASS(NodePathsDetails, AttrDashPattern); 00480 ADD_ATTRIB_CLASS(NodePathsDetails, AttrMould); 00481 00482 00483 // Set up the default NodeAttributeClassList. This list is returned by 00484 // GetRequiredAttribs if the NodeRenderableInkClass is not found in 00485 // the registry (this should never occur!!). 00486 00487 DefaultDetails = new NodeRenderableInkDetailsItem(); 00488 if (DefaultDetails == NULL) 00489 { 00490 goto OutOfMemory; 00491 } 00492 DefaultDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeRenderableInk); 00493 RegisterNodeRenderableInkDetails(DefaultDetails); 00494 00495 // Add all attributes in here 00496 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillGeometry); 00497 ADD_ATTRIB_CLASS(DefaultDetails, AttrTranspFillGeometry); 00498 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillMapping); 00499 ADD_ATTRIB_CLASS(DefaultDetails, AttrTranspFillMapping); 00500 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillEffect); 00501 ADD_ATTRIB_CLASS(DefaultDetails, AttrQuality); 00502 ADD_ATTRIB_CLASS(DefaultDetails, AttrLineWidth); 00503 ADD_ATTRIB_CLASS(DefaultDetails, AttrStrokeColour); 00504 ADD_ATTRIB_CLASS(DefaultDetails, AttrStrokeTransp); 00505 ADD_ATTRIB_CLASS(DefaultDetails, AttrStartArrow); 00506 ADD_ATTRIB_CLASS(DefaultDetails, AttrEndArrow); 00507 ADD_ATTRIB_CLASS(DefaultDetails, AttrStartCap); 00508 ADD_ATTRIB_CLASS(DefaultDetails, AttrEndCap); 00509 ADD_ATTRIB_CLASS(DefaultDetails, AttrJoinType); 00510 ADD_ATTRIB_CLASS(DefaultDetails, AttrMitreLimit); 00511 ADD_ATTRIB_CLASS(DefaultDetails, AttrWindingRule); 00512 ADD_ATTRIB_CLASS(DefaultDetails, AttrDashPattern); 00513 ADD_ATTRIB_CLASS(DefaultDetails, AttrMould); 00514 00515 ADD_ATTRIB_CLASS(DefaultDetails, AttrTxtFontTypeface); 00516 ADD_ATTRIB_CLASS(DefaultDetails, AttrTxtBold); 00517 ADD_ATTRIB_CLASS(DefaultDetails, AttrTxtItalic); 00518 ADD_ATTRIB_CLASS(DefaultDetails, AttrTxtUnderline); 00519 ADD_ATTRIB_CLASS(DefaultDetails, AttrTxtAspectRatio); 00520 ADD_ATTRIB_CLASS(DefaultDetails, AttrTxtJustification); 00521 ADD_ATTRIB_CLASS(DefaultDetails, AttrTxtTracking); 00522 ADD_ATTRIB_CLASS(DefaultDetails, AttrTxtFontSize); 00523 00524 return (TRUE); 00525 00526 OutOfMemory: 00527 return (FALSE); // Failed to initialise. 00528 } 00529 */ 00530 00531 00532 BOOL ObjectRegistry::Init() 00533 { 00534 // The following attribute groups have been set up 00535 /* 00536 00537 00538 NodeBitmapDetails: All attributes which can be applied to bitmap objects. This is a 00539 subset of the Default attributes. 00540 00541 BaseTextClassDetails: All attributes which can be applied to objects derived from the 00542 BaseTextClass. The set includes all DefaultAttributes + attributes 00543 which only make sense when applied to text objects like BOLD, 00544 ITALIC etc. 00545 00546 DefaultAttributes: The attributes required by all other nodes 00547 00548 AllAttrDetails: A list of all attributes 00549 00550 */ 00551 00552 NodeAttributeClassItem* AttrClassItem; 00553 00554 NodeRenderableInkDetailsItem* NodeBitmapDetails; 00555 NodeRenderableInkDetailsItem* BaseTextClassDetails; 00556 NodeRenderableInkDetailsItem* DefaultDetails; 00557 NodeRenderableInkDetailsItem* AllAttrDetails; 00558 NodeRenderableInkDetailsItem* NodeBlenderDetails; 00559 NodeRenderableInkDetailsItem* NodeMouldPathDetails; 00560 00561 00562 00563 // ------------------------------------------------------------------------------------- 00564 // Register NodeBitmap 00565 NodeBitmapDetails = new NodeRenderableInkDetailsItem(); 00566 if (NodeBitmapDetails == NULL) 00567 { 00568 goto OutOfMemory; 00569 } 00570 NodeBitmapDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeBitmap); 00571 RegisterNodeRenderableInkDetails(NodeBitmapDetails); 00572 00573 // Audited by Will 00574 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillGeometry); 00575 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrTranspFillGeometry); 00576 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillMapping); 00577 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrTranspFillMapping); 00578 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillEffect); 00579 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrQuality); 00580 // LineWidth required by NodeBitmap but should always be 0, it should be applied when a 00581 // bitmap is created. 00582 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrLineWidth); 00583 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrStrokeColour); 00584 00585 //This is here so you can add HotLinks to bitmaps if you want...Graham 00586 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrWebAddress); 00587 00588 00589 // ------------------------------------------------------------------------------------- 00590 // Register NodeMouldPath, require no attributes 00591 00592 NodeMouldPathDetails = new NodeRenderableInkDetailsItem(); 00593 if (NodeMouldPathDetails == NULL) 00594 { 00595 goto OutOfMemory; 00596 } 00597 NodeMouldPathDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeMouldPath); 00598 RegisterNodeRenderableInkDetails(NodeMouldPathDetails); 00599 00600 // ------------------------------------------------------------------------------------- 00601 // Register NodeBlender, require no attributes 00602 00603 NodeBlenderDetails = new NodeRenderableInkDetailsItem(); 00604 if (NodeBlenderDetails == NULL) 00605 { 00606 goto OutOfMemory; 00607 } 00608 NodeBlenderDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeBlender); 00609 RegisterNodeRenderableInkDetails(NodeBlenderDetails); 00610 00611 // ------------------------------------------------------------------------------------- 00612 // Register ShadowDetails attributes required by NodeShadow 00613 00614 if (!RegisterShadowDetails()) 00615 goto OutOfMemory; 00616 00617 // ------------------------------------------------------------------------------------- 00618 // Register BaseTextClass 00619 BaseTextClassDetails = new NodeRenderableInkDetailsItem(); 00620 if (BaseTextClassDetails == NULL) 00621 { 00622 goto OutOfMemory; 00623 } 00624 00625 BaseTextClassDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(BaseTextClass); 00626 BaseTextClassDetails->IsABaseClass = TRUE; 00627 RegisterNodeRenderableInkDetails(BaseTextClassDetails); 00628 00629 // All Nodes (except kerns) Derived from BaseTextClass require all the default attributes 00630 // plus attributes which only make sense when applied to text nodes 00631 00632 // Proper default attribute list (audited by Will) 00633 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillGeometry); 00634 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTranspFillGeometry); 00635 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillMapping); 00636 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTranspFillMapping); 00637 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillEffect); 00638 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrQuality); 00639 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrLineWidth); 00640 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStrokeColour); 00641 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStrokeTransp); 00642 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStartArrow); 00643 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrEndArrow); 00644 //ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrEndCap); // RIP 00645 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStartCap); 00646 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrJoinType); 00647 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrMitreLimit); 00648 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrUser); 00649 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrWebAddress); 00650 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrWindingRule); 00651 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrDashPattern); 00652 //ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrMould); // RIP 00653 00654 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtFontTypeface); 00655 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtBold); 00656 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtItalic); 00657 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtUnderline); 00658 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtAspectRatio); 00659 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtJustification); 00660 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtTracking); 00661 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtFontSize); 00662 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtBaseLine); 00663 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtScript); 00664 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtLineSpace); 00665 00666 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtLeftMargin); 00667 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtRightMargin); 00668 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtFirstIndent); 00669 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtRuler); 00670 00671 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrOverprintLine); 00672 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrOverprintFill); 00673 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrPrintOnAllPlates); 00674 00675 #ifdef VECTOR_STROKING // Neville 6/8/97 00676 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStrokeType); 00677 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrVariableWidth); 00678 #endif // VECTOR_STROKING 00679 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrBrushType); 00680 00681 // ------------------------------------------------------------------------------------- 00682 // Register DefaultDetails 00683 00684 DefaultDetails = new NodeRenderableInkDetailsItem(); 00685 if (DefaultDetails == NULL) 00686 { 00687 goto OutOfMemory; 00688 } 00689 DefaultDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeRenderableInk); 00690 DefaultDetails->IsABaseClass = TRUE; 00691 RegisterNodeRenderableInkDetails(DefaultDetails); 00692 00693 // Proper default attribute list (audited by Will) 00694 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillGeometry); 00695 ADD_ATTRIB_CLASS(DefaultDetails, AttrTranspFillGeometry); 00696 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillMapping); 00697 ADD_ATTRIB_CLASS(DefaultDetails, AttrTranspFillMapping); 00698 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillEffect); 00699 ADD_ATTRIB_CLASS(DefaultDetails, AttrQuality); 00700 ADD_ATTRIB_CLASS(DefaultDetails, AttrLineWidth); 00701 ADD_ATTRIB_CLASS(DefaultDetails, AttrStrokeColour); 00702 ADD_ATTRIB_CLASS(DefaultDetails, AttrStrokeTransp); 00703 ADD_ATTRIB_CLASS(DefaultDetails, AttrStartArrow); 00704 ADD_ATTRIB_CLASS(DefaultDetails, AttrEndArrow); 00705 //ADD_ATTRIB_CLASS(DefaultDetails, AttrEndCap); // RIP 00706 ADD_ATTRIB_CLASS(DefaultDetails, AttrStartCap); 00707 ADD_ATTRIB_CLASS(DefaultDetails, AttrJoinType); 00708 ADD_ATTRIB_CLASS(DefaultDetails, AttrMitreLimit); 00709 ADD_ATTRIB_CLASS(DefaultDetails, AttrUser); 00710 ADD_ATTRIB_CLASS(DefaultDetails, AttrWebAddress); 00711 ADD_ATTRIB_CLASS(DefaultDetails, AttrWindingRule); 00712 ADD_ATTRIB_CLASS(DefaultDetails, AttrDashPattern); 00713 //ADD_ATTRIB_CLASS(DefaultDetails, AttrMould); // RIP 00714 00715 ADD_ATTRIB_CLASS(DefaultDetails, AttrOverprintLine); 00716 ADD_ATTRIB_CLASS(DefaultDetails, AttrOverprintFill); 00717 ADD_ATTRIB_CLASS(DefaultDetails, AttrPrintOnAllPlates); 00718 00719 #ifdef VECTOR_STROKING // Neville 6/8/97 00720 ADD_ATTRIB_CLASS(DefaultDetails, AttrStrokeType); 00721 ADD_ATTRIB_CLASS(DefaultDetails, AttrVariableWidth); 00722 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelIndent); 00723 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelLightAngle); 00724 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelContrast); 00725 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelType); 00726 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelLightTilt); 00727 #endif // VECTOR_STROKING 00728 ADD_ATTRIB_CLASS(DefaultDetails, AttrBrushType); 00729 ADD_ATTRIB_CLASS(DefaultDetails, AttrFeather); 00730 00731 // ------------------------------------------------------------------------------------- 00732 // Register AllAttrDetails attributes required by compound nodes (all attributes) 00733 00734 AllAttrDetails = new NodeRenderableInkDetailsItem(); 00735 if (AllAttrDetails == NULL) 00736 { 00737 goto OutOfMemory; 00738 } 00739 00740 AllAttrDetails->NodeRenderableInkClass = 0; // Has no class 00741 RegisterNodeRenderableInkDetails(AllAttrDetails); 00742 00743 // Add all attributes in here 00744 // Proper default attribute list (audited by Will) 00745 ADD_ATTRIB_CLASS(AllAttrDetails, AttrFillGeometry); 00746 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTranspFillGeometry); 00747 ADD_ATTRIB_CLASS(AllAttrDetails, AttrFillMapping); 00748 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTranspFillMapping); 00749 ADD_ATTRIB_CLASS(AllAttrDetails, AttrFillEffect); 00750 ADD_ATTRIB_CLASS(AllAttrDetails, AttrQuality); 00751 ADD_ATTRIB_CLASS(AllAttrDetails, AttrLineWidth); 00752 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStrokeColour); 00753 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStrokeTransp); 00754 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStartArrow); 00755 ADD_ATTRIB_CLASS(AllAttrDetails, AttrEndArrow); 00756 //ADD_ATTRIB_CLASS(AllAttrDetails, AttrEndCap); // RIP 00757 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStartCap); 00758 ADD_ATTRIB_CLASS(AllAttrDetails, AttrJoinType); 00759 ADD_ATTRIB_CLASS(AllAttrDetails, AttrMitreLimit); 00760 ADD_ATTRIB_CLASS(AllAttrDetails, AttrUser); 00761 ADD_ATTRIB_CLASS(AllAttrDetails, AttrWebAddress); 00762 ADD_ATTRIB_CLASS(AllAttrDetails, AttrWindingRule); 00763 ADD_ATTRIB_CLASS(AllAttrDetails, AttrDashPattern); 00764 //ADD_ATTRIB_CLASS(AllAttrDetails, AttrMould); // RIP 00765 00766 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtFontTypeface); 00767 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtBold); 00768 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtItalic); 00769 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtUnderline); 00770 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtAspectRatio); 00771 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtJustification); 00772 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtTracking); 00773 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtFontSize); 00774 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtBaseLine); 00775 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtScript); 00776 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtLineSpace); 00777 00778 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtLeftMargin); 00779 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtRightMargin); 00780 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtFirstIndent); 00781 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtRuler); 00782 00783 ADD_ATTRIB_CLASS(AllAttrDetails, AttrOverprintLine); 00784 ADD_ATTRIB_CLASS(AllAttrDetails, AttrOverprintFill); 00785 ADD_ATTRIB_CLASS(AllAttrDetails, AttrPrintOnAllPlates); 00786 00787 #ifdef VECTOR_STROKING // Neville 6/8/97 00788 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStrokeType); 00789 ADD_ATTRIB_CLASS(AllAttrDetails, AttrVariableWidth); 00790 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelIndent); 00791 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelLightAngle); 00792 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelContrast); 00793 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelType); 00794 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelLightTilt); 00795 #endif // VECTOR_STROKING 00796 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBrushType); 00797 ADD_ATTRIB_CLASS(AllAttrDetails, AttrFeather); 00798 00799 return (TRUE); 00800 00801 OutOfMemory: 00802 return (FALSE); // Failed to initialise. 00803 } 00804 00805 00806 /******************************************************************************************** 00807 00808 > static void ObjectRegistry::RegisterNodeRenderableInkDetails(NodeRenderableInkDetailsItem* ReqdAttribItem) 00809 00810 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00811 Created: 10/2/94 00812 Inputs: The NodeRenderableInkDetailsItem that needs to be registered. 00813 Outputs: - 00814 Returns: - 00815 Purpose: RegisterNodeRenderableInkDetails can be called to register extra 00816 NodeRenderableInkNodes if they get added in new tools. This must be done at startup 00817 00818 Errors: - 00819 SeeAlso: ObjectRegistry::Init 00820 00821 ********************************************************************************************/ 00822 00823 void ObjectRegistry:: 00824 RegisterNodeRenderableInkDetails(NodeRenderableInkDetailsItem* ReqdAttribItem) 00825 { 00826 // Simply add the item 00827 NodeRenderableInkDetailsList.AddTail(ReqdAttribItem); 00828 return; 00829 } 00830 00831 /******************************************************************************************** 00832 00833 > static List* ObjectRegistry::GetRequiredAttribs(CCRuntimeClass* NodeRenderableInkClass) 00834 00835 Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com> 00836 Created: 10/2/94 00837 Inputs: NodeRenderableInkClass: The class to find the required attributes for 00838 when NULL a complete list of all attributes is returned. 00839 Outputs: - 00840 Returns: A list of required attributes for NodeRenderableInkClass. The list contains 00841 NodeAttributeClassItems 00842 00843 Purpose: GetRequiredAttribs returns a list of attribute classes which are required by 00844 the NodeRenderableInk class. Note that the NodeRenderableInkClass must have 00845 been registerd. 00846 00847 In the situation where a NodeRenderableInk class has not been registered 00848 we return back a default attribute list in a retail build. In a debug 00849 build an ENSURE failure will occur. 00850 00851 Errors: An ENSURE failure will occur if the NodeRenderableInk class has not been 00852 registered 00853 SeeAlso: - 00854 00855 ********************************************************************************************/ 00856 00857 List* ObjectRegistry::GetRequiredAttribs(CCRuntimeClass* NodeRenderableInkClass) 00858 { 00859 // Search for the required Attrib list for the NodeRenderableInkClass 00860 NodeRenderableInkDetailsItem* Current = (NodeRenderableInkDetailsItem*) 00861 NodeRenderableInkDetailsList.GetHead(); 00862 while (Current != NULL) 00863 { 00864 if ( 00865 ((Current->IsABaseClass) && 00866 (NodeRenderableInkClass != NULL) && 00867 (NodeRenderableInkClass->IsKindOf(Current->NodeRenderableInkClass))) || 00868 (Current->NodeRenderableInkClass == NodeRenderableInkClass) 00869 ) 00870 { 00871 // The default attributes 00872 return (&(Current->NodeAttributeClassList)); 00873 } 00874 00875 Current = (NodeRenderableInkDetailsItem*) 00876 NodeRenderableInkDetailsList.GetNext(Current); 00877 } 00878 ENSURE(FALSE, "Could not find required attributes"); 00879 return NULL; 00880 } 00881 00882 00883 00884 /******************************************************************************************** 00885 00886 > static NodeRenderableInkDetailsItem* ObjectRegistry::GetAttribDetails(CCRuntimeClass* pInkClass) 00887 00888 Author: Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com> 00889 Created: 08/02/2001 00890 00891 Inputs: pInkClass the class type to lookup details for. 00892 00893 Returns: The attribute details item for the given class type. 00894 00895 Errors: ERROR2 if NULL input param or we couldn't find details for it. 00896 00897 ********************************************************************************************/ 00898 NodeRenderableInkDetailsItem* ObjectRegistry::GetAttribDetails(CCRuntimeClass* pInkClass) 00899 { 00900 // validate inputs. 00901 ERROR2IF(pInkClass == NULL, NULL, 00902 "ObjectRegistry::GetAttribDetails; NULL input parameter!"); 00903 00904 // Search for the required details item for the given NodeRenderableInk Class. 00905 NodeRenderableInkDetailsItem* pCurrent = NULL; 00906 pCurrent = (NodeRenderableInkDetailsItem*)NodeRenderableInkDetailsList.GetHead(); 00907 00908 while (pCurrent != NULL) 00909 { 00910 if ((pCurrent->IsABaseClass && pInkClass->IsKindOf(pCurrent->NodeRenderableInkClass)) || 00911 pCurrent->NodeRenderableInkClass == pInkClass) 00912 { 00913 return pCurrent; 00914 } 00915 00916 pCurrent = (NodeRenderableInkDetailsItem*)NodeRenderableInkDetailsList.GetNext(pCurrent); 00917 } 00918 00919 ERROR2(NULL, "ObjectRegistry::GetAttribDetails; Couldn't find details!"); 00920 } 00921 00922 00923 00924 /******************************************************************************************** 00925 00926 > static BOOL ObjectRegistry::RegisterShadowDetails() 00927 00928 Author: Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com> 00929 Created: 07/02/2001 00930 00931 Purpose: Register required attribute details for shadows. 00932 00933 See also: Init(), RegisterNodeRenderableInkDetails(). 00934 00935 ********************************************************************************************/ 00936 BOOL ObjectRegistry::RegisterShadowDetails() 00937 { 00938 NodeRenderableInkDetailsItem* pShadowDetails = new NodeRenderableInkDetailsItem(); 00939 BOOL ok = (pShadowDetails != NULL); 00940 if (ok) 00941 { 00942 pShadowDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeShadow); 00943 RegisterNodeRenderableInkDetails(pShadowDetails); 00944 } 00945 00946 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrFillGeometry )); 00947 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrFillMapping )); 00948 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrFillEffect )); 00949 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrUser )); 00950 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrWebAddress )); 00951 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrOverprintLine )); 00952 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrOverprintFill )); 00953 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrPrintOnAllPlates )); 00954 00955 return ok; 00956 }