attrmgr.cpp

Go to the documentation of this file.
00001 // $Id: attrmgr.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 files 
00103 #include "camtypes.h"
00104 //#include "attrmgr.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 //#include "mario.h"
00106 //#include "fixmem.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00107 //#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00108 #include "toollist.h"
00109 //#include "simon.h"
00110 #include "attrappl.h"
00111 #include "optsmsgs.h"
00112 //#include "resource.h"
00113 #include "qualattr.h"
00114 //#include "jason.h"
00115 #include "nodetext.h"
00116 //#include "will.h"
00117 #include "helpuser.h"           // for the SetNextMsgHelpContext function
00118 #include "filltool.h"
00119 #include "ndoptmz.h"
00120 #include "colormgr.h"
00121 #include "attrmap.h"
00122 #include "isetattr.h"
00123 #include "strkattr.h"
00124 #include "unicdman.h"
00125 #include "fontman.h"
00126 
00127 //#include "will2.h"
00128 
00129 #include "userattr.h"
00130 #include "webattr.h"
00131 
00132 #include "nodeshad.h"
00133 //#include "gerry.h"
00134 
00135 #include "attrbev.h"
00136 #include "nodeshad.h"
00137 #include "brshattr.h"
00138 #include "fthrattr.h"
00139 #include "clipattr.h"
00140 #include "lineattr.h"
00141 #include "coldlog.h"
00142 
00143 //#include "cxfrec.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00144 #include "cxftags.h"
00145 #include "ophist.h"
00146 
00147 DECLARE_SOURCE("$Revision: 1445 $");
00148 
00149 CC_IMPLEMENT_DYNAMIC(CurrentAttrChangedMsg, Msg) 
00150 
00151 // Declare smart memory handling in Debug builds
00152 #define new CAM_DEBUG_NEW  
00153 
00154 const INT32 AttributeTableGranularity = 20;
00155 
00156 // WEBSTER - markn 14/8/97
00157 // Webster 2 uses the attrs last applied by default
00158 
00159 #ifdef WEBSTER
00160 // Static attribute preference variables. They have the same names as the preference
00161 BOOL AttributeManager::LastAttrAppliedBecomesCurrent =1;
00162 #else
00163 // Static attribute preference variables. They have the same names as the preference
00164 BOOL AttributeManager::LastAttrAppliedBecomesCurrent = 0;
00165 #endif // WEBSTER
00166 
00167 // WEBSTER - markn 6/12/96
00168 // Don't ask the user if they want to set the current attr
00169 #ifdef WEBSTER
00170 BOOL AttributeManager::AskBeforeSettingCurrentAttr   =0;
00171 #else
00172 BOOL AttributeManager::AskBeforeSettingCurrentAttr   =1;
00173 #endif // WEBSTER
00174 
00175 BOOL AttributeManager::SendMessages = 1;
00176 
00177 BOOL AttributeManager::ShouldAskAboutContoneColours = 1;
00178 BOOL AttributeManager::HaveAskedAboutContoneColours = 0;
00179 BOOL AttributeManager::UserCancelledContoneColours = 0;
00180 
00181 // Table variables (table is initially empty)
00182 UINT32          AttributeManager::AttributeTableSize = 0;
00183 UINT32          AttributeManager::NumAttributes      = 0;
00184 AttributeEntry *AttributeManager::DefaultAttrValues  = NULL;
00185 NodeTypeEntry  *AttributeManager::DefaultNodeAttrs   = NULL;
00186 
00187 // Default black/white. Defined as RGB so they will separate.
00188 // These are reinitialised in RegisterBasicAttributes to be CMYK
00189 // (because we can't do CMYK static initialisations easily)
00190 DocColour AttributeManager::DefaultBlack = DocColour(0L, 0L, 0L);
00191 DocColour AttributeManager::DefaultWhite = DocColour(255L, 255L, 255L);
00192 
00193 NodeRenderableInk* AttributeManager::pLastNodeAppliedTo = NULL;
00194 DocRect AttributeManager::LastAppliedBounds = DocRect(0,0,0,0);
00195 
00196 
00197 static BOOL UseLastAttrApplied = FALSE;
00198 
00199 AttributeManager::AttributeManager() 
00200 {
00201 }
00202 
00203 
00204 
00205 /********************************************************************************************
00206 
00207     static void AttributeManager::FindDefaultColour(ColourList *ColList,
00208                                                     UINT32 NameResID,  DocColour *Result)
00209 
00210     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00211     Created:    8/12/94
00212     Inputs:     ColList - The colour list in which the default should reside
00213                 NameResID - the ID of the name string for the desired default
00214                 colour (see below)
00215 
00216     Outputs:    (An appropriate colour may have been added to ColList if necessary)
00217                 Result - Is filled in with an appropriate colour. In the case
00218                 of total failure, this may be an immediate DocColour, but will always
00219                 be set to a safe/valid default.
00220     Returns:    -
00221     Purpose:    Used in initialisation of default attributes, and when ensuring no
00222                 current attributes use deleted colour(s), to find a suitable default
00223                 colour to use. Two default colours are currently provided, accessed
00224                 by passing in NameResID of _R(IDS_WHITENAME), _R(IDS_BLACKNAME), in order to
00225                 get the default white or black colour respectively.
00226 
00227     Errors:     ERROR3 if Result==NULL.
00228                 Otherwise, will always return a valid result - even if it failed
00229                 to allocate memory for a new IndexedColour, it'll return safely.
00230 
00231 ********************************************************************************************/
00232 
00233 // Accuracy of colour matching - same value as Tim uses in importer for 'fuzzy match'
00234 // of the colour.
00235 #define COL_ACCURACY (0.001)
00236 
00237 void AttributeManager::FindDefaultColour(ColourList *ColList,
00238                                          UINT32 NameResID,
00239                                          DocColour *Result)
00240 {
00241     ERROR3IF(Result == NULL, "AttrMgr: FindDefaultColour - NULL Result param is illegal");
00242     if (Result == NULL)
00243         return;
00244 
00245     // Generate an appropriate colour definition for the desired default colour
00246     ColourRGBT DesiredDef;          // Existing colour we wish to match (RGB black)
00247     ColourHSVT DefaultDef;          // Definition, if we are forced to create a new colour (HSV black)
00248     ColourCMYK CMYKBlack;           // CMYK definition for black
00249     ColourCMYK CMYKWhite;           // CMYK definition for white
00250 
00251     DesiredDef.Red = DesiredDef.Green = DesiredDef.Blue = DesiredDef.Transparent = 0;
00252     DefaultDef.Hue = DefaultDef.Saturation = DefaultDef.Value = DefaultDef.Transparent = 0;
00253     CMYKBlack.Cyan = CMYKBlack.Magenta = CMYKBlack.Yellow = 0;
00254     CMYKBlack.Key = FIXED24(1.0);
00255     CMYKWhite.Cyan = CMYKWhite.Magenta = CMYKWhite.Yellow = CMYKWhite.Key = 0;
00256 
00257 
00258     if (NameResID ==_R(IDS_BLACKNAME))
00259         // We want the default black to be CMYK so overprint/seps work
00260         *Result = DocColour(COLOURMODEL_CMYK, (ColourGeneric *) &CMYKBlack);
00261     else if (NameResID == _R(IDS_WHITENAME))
00262         // We want the default white to be CMYK so overprint/seps work
00263     {
00264         *Result = DocColour(COLOURMODEL_CMYK, (ColourGeneric *) &CMYKWhite);
00265         // I need to define the desired colour to make the search work OK.
00266         DesiredDef.Red = DesiredDef.Green = DesiredDef.Blue = FIXED24(1.0);
00267         DefaultDef.Value = FIXED24(1.0);
00268     }
00269     else if (NameResID == _R(IDS_REDNAME))
00270     {
00271         DesiredDef.Red = FIXED24(1.0);
00272         DefaultDef.Saturation = DefaultDef.Value = FIXED24(1.0);
00273     }
00274     else if (NameResID == _R(IDS_YELLOWNAME))
00275     {
00276         DesiredDef.Red = DesiredDef.Green = FIXED24(1.0);
00277         DefaultDef.Hue = FIXED24(1.0 / 6.0);                        // 60 degree hue.
00278         DefaultDef.Saturation = DefaultDef.Value = FIXED24(1.0);
00279     }
00280     else
00281     {
00282         // Fill in result with an appropriate Immediate colour in case we fail
00283         *Result = DocColour(COLOURMODEL_HSVT, (ColourGeneric *) &DefaultDef);
00284     }
00285 
00286     if (ColList != NULL)
00287     {   
00288         // Try to find a colour style of appropriate appearance in our colour list
00289         ColourContext *CCRGB = ColourContext::GetGlobalDefault(COLOURMODEL_RGBT);
00290         if (CCRGB == NULL)
00291         {
00292             ERROR3("AttrMgr: FindDefault Colour - Failed to get RGB Colour Context");
00293             return;
00294         }
00295 
00296         // Search the colour list to see if an existing colour is close enough to the desired
00297         // colour to use it.
00298         IndexedColour *NewDefault = (IndexedColour *) ColList->GetHead();
00299         ColourRGBT RGBDef;
00300 
00301         while (NewDefault != NULL)
00302         {
00303             if (!NewDefault->IsDeleted())       // If this colour is alive...
00304             {
00305                 // Convert this colour to RGB, and see if it looks like our default
00306                 // If it is, we drop out with NewDefault still pointing at it.
00307                 CCRGB->ConvertColour(NewDefault, (ColourGeneric *) &RGBDef);
00308 
00309                 if ((ABS(RGBDef.Red   - DesiredDef.Red))   <= FIXED24(COL_ACCURACY) && 
00310                     (ABS(RGBDef.Green - DesiredDef.Green)) <= FIXED24(COL_ACCURACY) && 
00311                     (ABS(RGBDef.Blue  - DesiredDef.Blue))  <= FIXED24(COL_ACCURACY))
00312                     break;
00313             }
00314 
00315             NewDefault = (IndexedColour *) ColList->GetNext(NewDefault);
00316         }
00317 
00318         // If we failed to find a style, create a local colour instead
00319         if (NewDefault == NULL)
00320         {
00321             if (NameResID == _R(IDS_BLACKNAME))
00322                 NewDefault = new INDEXEDCOLOUR_CMYK(&CMYKBlack);
00323             else if (NameResID == _R(IDS_WHITENAME))
00324                 NewDefault = new INDEXEDCOLOUR_CMYK(&CMYKWhite);
00325             else
00326                 NewDefault = new INDEXEDCOLOUR_HSVT(&DefaultDef);
00327 
00328             if (NewDefault == NULL)
00329             {
00330                 ERROR3("AttrMgr: FindDefaultColour failed to generate new default IndexedColour");
00331                 return;
00332             }
00333 
00334             // Set the colour to have a name.
00335             String_64 ColourName;
00336             ColourName.Load ( NameResID );
00337 
00338             NewDefault->SetName ( ColourName );
00339 
00340             // Add the new colour to the end of the colour list
00341             ColList->AddItem(NewDefault);
00342         }
00343 
00344         if (NewDefault != NULL)     // Fix the DocColour to reference the new IndexedColour
00345             Result->MakeRefToIndexedColour(NewDefault);
00346     }
00347 
00348     // else just return - Result has a safe immediate colour definition
00349 }
00350 #undef COL_ACCURACY
00351 
00352 
00353 /********************************************************************************************
00354 
00355 >   BOOL AttributeManager::InitInstance()
00356 
00357     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00358     Created:    19/8/94
00359     Returns:    FALSE if initialisation failed, An error will be set in this situation.
00360                 TRUE is successful.
00361                 
00362                 Purpose:Creates the current attribute groups, and adds the initial current 
00363                         attributes to them.
00364 
00365                         For a description of attribute groups see CreateCurrentAttributeGroup
00366     Errors:     -
00367     SeeAlso:    AttributeManager::CreateCurrentAttributeGroup
00368     SeeAlso:    AttributeManager::UpdateCurrentAttribute
00369 
00370 
00371 ********************************************************************************************/
00372 
00373 BOOL AttributeManager::InitInstance()
00374 {
00375     // ****************************************************************************************
00376     // ****************************************************************************************
00377     // IMPORTANT !!, whenever a new attribute gets added here, make sure that the ObjectRegistry 
00378     // is updated as well. Also remember that there are now two current attribute groups to 
00379     // fill in (TEXT and INK)
00380 
00381     // Register all attribute groups here 
00382 
00383     // Register the NodeRenderableInk attribute group first. The attributes in this group 
00384     // get applied to all objects except text (sort of - see CreateCurrentAttributeGroup) 
00385                 
00386     String_256          strGraphic( _R(IDS_GRAPHIC) );
00387     CreateCurrentAttributeGroup( CC_RUNTIME_CLASS(NodeRenderableInk), (CCRuntimeClass *)NULL, 
00388         strGraphic );
00389 
00390     // Set up initial current attributes 
00391     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00392     AttrFlatColourFill* Attr1 = new AttrFlatColourFill; 
00393     if (Attr1 == NULL)
00394         return FALSE; 
00395 
00396     // Find default black/whith indexed colours. This will create the new
00397     // colours if necessary. This all occurs in the Current Document.
00398     // The constant values give the RGB definition of the colour, and
00399     // the id of its name string (e.g. 255,255,255 "Default White")
00400     DocColour DefWhite;
00401 //  FindDefaultColour(ColourManager::GetCurrentColourList(),
00402 //                      _R(IDS_WHITENAME), &DefWhite);
00403     FindDefaultColour(NULL,
00404                         _R(IDS_WHITENAME), &DefWhite);
00405     DocColour DefBlack;
00406 //  FindDefaultColour(ColourManager::GetCurrentColourList(),
00407 //                      _R(IDS_BLACKNAME), &DefBlack);
00408     FindDefaultColour(NULL,
00409                         _R(IDS_BLACKNAME), &DefBlack);
00410 
00411     Attr1->SetStartColour(&DefBlack);
00412     Attr1->SetEndColour(&DefWhite);
00413 
00414     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), Attr1, FALSE, TRUE);
00415     
00416      // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00417 
00418     AttrFlatTranspFill* Attr4 = new AttrFlatTranspFill; 
00419     if (Attr4 == NULL)
00420         return FALSE; 
00421 
00422     UINT32 Transp = 0;
00423     Attr4->SetStartTransp(&Transp);
00424     Attr4->SetEndTransp(&Transp);
00425     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), Attr4, FALSE, TRUE); 
00426 
00427     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00428 
00429 
00430     AttrFillMappingLinear* FillMapp = new AttrFillMappingLinear; 
00431     if (FillMapp == NULL)
00432         return FALSE; 
00433     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), FillMapp, FALSE, TRUE); 
00434 
00435 
00436     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00437 
00438 
00439     AttrTranspFillMappingLinear* TranspFillMapp = new AttrTranspFillMappingLinear; 
00440     if (TranspFillMapp == NULL)
00441         return FALSE; 
00442     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), TranspFillMapp, FALSE, TRUE); 
00443 
00444                                   
00445     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00446 
00447 
00448     AttrFillEffectFade* Attr5 = new AttrFillEffectFade; 
00449     if (Attr5 == NULL)
00450         return FALSE; 
00451     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), Attr5, FALSE, TRUE); 
00452 
00453     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00454 
00455 
00456     AttrStrokeColour* Attr2 = new AttrStrokeColour; 
00457     if (Attr2 == NULL)
00458         return FALSE; 
00459     Attr2->Value.Colour = DefBlack;
00460 
00461     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), Attr2, FALSE, TRUE);
00462 
00463     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00464 
00465 
00466     AttrStrokeTransp* Attr6 = new AttrStrokeTransp; 
00467     if (Attr6 == NULL)
00468         return FALSE; 
00469     Attr6->Value.Transp = 0;
00470     Attr6->Value.TranspType = TT_Mix;
00471     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), Attr6, FALSE, TRUE);  
00472                                                      
00473 
00474     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00475 
00476 
00477     AttrLineWidth* Attr3 =  new AttrLineWidth;
00478     if (Attr3 == NULL)
00479         return FALSE; 
00480 
00481     Attr3->Value.LineWidth = 500;// 0.5pt
00482     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), Attr3, FALSE, TRUE);  
00483  
00484 
00485                                                     
00486     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00487 
00488 
00489     AttrStartArrow* StartArrow =  new AttrStartArrow;
00490     if (StartArrow == NULL)
00491         return FALSE; 
00492 
00493     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), StartArrow, FALSE, TRUE);  
00494 
00495 
00496                                                     
00497     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00498 
00499 
00500     AttrEndArrow* EndArrow =  new AttrEndArrow;
00501     if (EndArrow == NULL)
00502         return FALSE; 
00503 
00504     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), EndArrow, FALSE, TRUE);  
00505 
00506 
00507                                                     
00508     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00509 
00510 
00511     AttrStartCap* StCaps =  new AttrStartCap;
00512     if (StCaps == NULL)
00513         return FALSE; 
00514 
00515     StCaps->Value.StartCap = LineCapButt; 
00516 
00517     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), StCaps, FALSE, TRUE);  
00518                                                     
00519     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00520 
00521 
00522     AttrJoinType* JoinType =  new AttrJoinType;
00523     if (JoinType == NULL)
00524         return FALSE; 
00525 
00526     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), JoinType, FALSE, TRUE);  
00527                                                     
00528     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00529 
00530 
00531     AttrMitreLimit* MitreLimit =  new AttrMitreLimit;
00532     if (MitreLimit == NULL)
00533         return FALSE; 
00534 
00535     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), MitreLimit, FALSE, TRUE);  
00536 
00537     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00538 
00539 
00540     AttrUser* User =  new AttrUser;
00541     if (User == NULL)
00542         return FALSE; 
00543 
00544     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), User, FALSE, TRUE); 
00545 
00546     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00547 
00548 
00549     AttrWebAddress* WebAddress =  new AttrWebAddress;
00550     if (WebAddress == NULL)
00551         return FALSE; 
00552 
00553     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), WebAddress, FALSE, TRUE); 
00554 
00555                                                     
00556     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00557 
00558 
00559 
00560 
00561     AttrWindingRule* WindingRule =  new AttrWindingRule;
00562     if (WindingRule == NULL)
00563         return FALSE; 
00564 
00565     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), WindingRule, FALSE, TRUE);  
00566                                                     
00567     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00568 
00569 
00570     AttrDashPattern* DashPattern =  new AttrDashPattern;
00571     if (DashPattern == NULL)
00572         return FALSE; 
00573 
00574     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), DashPattern, FALSE, TRUE);  
00575 
00576 
00577     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00578     // BLOCK
00579     {
00580         AttrOverprintLine *OPAttr = new AttrOverprintLine;
00581         if (OPAttr == NULL)
00582             return FALSE;
00583 
00584         UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), OPAttr, FALSE, TRUE);
00585     }
00586 
00587     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00588     // BLOCK
00589     {
00590         AttrOverprintFill *OPAttr = new AttrOverprintFill;
00591         if (OPAttr == NULL)
00592             return FALSE;
00593 
00594         UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), OPAttr, FALSE, TRUE);
00595     }
00596 
00597     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00598     // BLOCK
00599     {
00600         AttrPrintOnAllPlates *POAPAttr = new AttrPrintOnAllPlates;
00601         if (POAPAttr == NULL)
00602             return FALSE;
00603 
00604         UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), POAPAttr, FALSE, TRUE);
00605     }
00606 
00607 
00608 #ifdef VECTOR_STROKING // Neville 6/8/97
00609     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00610 
00611 
00612     AttrStrokeType* pStroke = new AttrStrokeType;
00613     if (pStroke == NULL)
00614         return FALSE; 
00615 
00616     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pStroke, FALSE, TRUE);  
00617 
00618 
00619     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00620 
00621 
00622     AttrVariableWidth* pVarWidth =  new AttrVariableWidth;
00623     if (pVarWidth == NULL)
00624         return FALSE;
00625 
00626     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pVarWidth, FALSE, TRUE);
00627 
00628     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00629     AttrBevelIndent* pBevelIndent =  new AttrBevelIndent;
00630     if (pBevelIndent == NULL)
00631         return FALSE;
00632 
00633     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pBevelIndent, FALSE, TRUE);
00634 
00635     AttrBevelLightAngle* pBevelLightAngle =  new AttrBevelLightAngle;
00636     if (pBevelLightAngle == NULL)
00637         return FALSE;
00638 
00639     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pBevelLightAngle, FALSE, TRUE);
00640 
00641     AttrBevelContrast* pBevelContrast =  new AttrBevelContrast;
00642     if (pBevelContrast == NULL)
00643         return FALSE;
00644 
00645     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pBevelContrast, FALSE, TRUE);
00646 
00647     AttrBevelLightTilt* pBevelTilt =  new AttrBevelLightTilt;
00648     if (pBevelTilt == NULL)
00649         return FALSE;
00650 
00651     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pBevelTilt, FALSE, TRUE);
00652     
00653     AttrBevelType* pBevelType =  new AttrBevelType;
00654     if (pBevelType == NULL)
00655         return FALSE;
00656 
00657     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pBevelType, FALSE, TRUE);
00658 
00659     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00660 
00661     AttrBrushType* pBrushType = new AttrBrushType;
00662     if (pBrushType == NULL)
00663         return FALSE;
00664 
00665     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pBrushType, FALSE, TRUE);
00666      
00667 #endif // VECTOR_STROKING
00668 
00669     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00670     AttrFeather* pFeather = new AttrFeather;
00671     if (pFeather == NULL)
00672         return FALSE;
00673 
00674     UpdateCurrentAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), pFeather, FALSE, TRUE);
00675 
00676     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00677     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00678 
00679     // Create the attribute group for all text objects
00680     String_256          strText( _R(IDS_TEXT) );
00681     CreateCurrentAttributeGroup( CC_RUNTIME_CLASS(BaseTextClass), 
00682                                  CC_RUNTIME_CLASS(NodeRenderableInk), 
00683                                  strText ); // Base class
00684 
00685 
00686     // Attributes specific to text objects first
00687     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00688 
00689     // ----------------------------------------------------------------------------------
00690     // Create the Current text attributes
00691 
00692     AttrTxtFontTypeface* FntAttr = new AttrTxtFontTypeface; 
00693     if (FntAttr == NULL)
00694         return FALSE; 
00695 
00696     PORTNOTETRACE("text", "Japanese default font disabled");
00697 #ifndef EXCLUDE_FROM_XARALX
00698     // If we are in Japan we don't want Times to be the current font
00699     if (UnicodeManager::IsDBCSOS())
00700     {
00701         // This is the Japanese standard font - it's specified in DBCS characters
00702         // so it won't work in UNICODE builds
00703         String_64 FontName  = wxT("\x82\x6c\x82\x72 \x82\x6f\x83\x53\x83\x56\x83\x62\x83\x4e");
00704 
00705         FONTMANAGER->CacheNamedFont(&FontName, FC_UNDEFINED);
00706         FntAttr->Value.HTypeface = FONTMANAGER->GetFontHandle(&FontName, FC_UNDEFINED);
00707     }
00708 #endif
00709 
00710     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), FntAttr, FALSE, TRUE);  
00711 
00712 
00713     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00714 
00715                  
00716     AttrTxtBold* BoldAttr = new AttrTxtBold;
00717     if (BoldAttr == NULL)
00718         return FALSE; 
00719 
00720     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), BoldAttr, FALSE, TRUE);  
00721 
00722 
00723     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00724 
00725 
00726     AttrTxtItalic* ItalicAttr = new AttrTxtItalic;
00727     if (ItalicAttr == NULL)
00728         return FALSE;
00729         
00730     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), ItalicAttr, FALSE, TRUE);  
00731  
00732 
00733     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00734 
00735 
00736     AttrTxtUnderline* UnderlineAttr = new AttrTxtUnderline;
00737     if (UnderlineAttr == NULL)
00738         return FALSE;
00739 
00740 
00741     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), UnderlineAttr, FALSE, TRUE);  
00742 
00743 
00744     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00745 
00746     AttrTxtFontSize* FontSizeAttr   = new AttrTxtFontSize;
00747     if (FontSizeAttr == NULL)
00748         return FALSE;
00749 
00750     // change default text size to 12pt (Jonathan)
00751     FontSizeAttr->Value.FontSize = 12000;
00752 
00753     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), FontSizeAttr, FALSE, TRUE); 
00754     
00755     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00756  
00757 
00758 
00759     AttrTxtAspectRatio* AspectRatioAttr = new AttrTxtAspectRatio;
00760     if (AspectRatioAttr == NULL)
00761         return FALSE;
00762 
00763     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), AspectRatioAttr, FALSE, TRUE);  
00764 
00765 
00766     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00767 
00768 
00769     AttrTxtJustification* JustificationAttr = new  AttrTxtJustification;
00770     if (JustificationAttr == NULL)
00771         return FALSE;
00772 
00773     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), JustificationAttr, FALSE, TRUE);  
00774 
00775 
00776     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00777 
00778 
00779     AttrTxtTracking* TxtTrackingAttr = new AttrTxtTracking;
00780     if (TxtTrackingAttr == NULL)
00781         return FALSE;
00782         
00783     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TxtTrackingAttr, FALSE, TRUE);
00784 
00785     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00786 
00787     AttrTxtScript* TxtScriptAttr = new AttrTxtScript;
00788     if (TxtScriptAttr == NULL)
00789         return FALSE;
00790         
00791     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TxtScriptAttr, FALSE, TRUE);
00792 
00793     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00794 
00795     AttrTxtBaseLine* TxtBaseLineAttr = new AttrTxtBaseLine;
00796     if (TxtBaseLineAttr == NULL)
00797         return FALSE;
00798         
00799     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TxtBaseLineAttr, FALSE, TRUE);  
00800 
00801 
00802     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00803 
00804     AttrTxtLineSpace* TxtLineSpaceAttr = new AttrTxtLineSpace;
00805     if (TxtLineSpaceAttr == NULL)
00806         return FALSE;
00807         
00808     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TxtLineSpaceAttr, FALSE, TRUE);  
00809 
00810     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00811 
00812     AttrTxtLeftMargin* TxtLeftMarginAttr = new AttrTxtLeftMargin;
00813     if (TxtLeftMarginAttr == NULL)
00814         return FALSE;
00815         
00816     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TxtLeftMarginAttr, FALSE, TRUE);
00817 
00818     AttrTxtRightMargin* TxtRightMarginAttr = new AttrTxtRightMargin;
00819     if (TxtRightMarginAttr == NULL)
00820         return FALSE;
00821         
00822     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TxtRightMarginAttr, FALSE, TRUE);
00823 
00824     AttrTxtFirstIndent* TxtFirstIndentAttr = new AttrTxtFirstIndent;
00825     if (TxtFirstIndentAttr == NULL)
00826         return FALSE;
00827         
00828     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TxtFirstIndentAttr, FALSE, TRUE);
00829 
00830     AttrTxtRuler* TxtRulerAttr = new AttrTxtRuler;
00831     if (TxtRulerAttr == NULL)
00832         return FALSE;
00833         
00834     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TxtRulerAttr, FALSE, TRUE);
00835 
00836 
00837     // Attributes which are not unique to the BaseText group
00838     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00839     Attr1 = new AttrFlatColourFill; 
00840     if (Attr1 == NULL)
00841         return FALSE; 
00842 
00843     // Set default black and white colours
00844     Attr1->SetStartColour(&DefBlack);
00845     Attr1->SetEndColour(&DefWhite);
00846 
00847     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), Attr1, FALSE, TRUE);
00848     
00849      // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00850 
00851     Attr4 = new AttrFlatTranspFill; 
00852     if (Attr4 == NULL)
00853         return FALSE; 
00854 
00855     Transp = 0;
00856     Attr4->SetStartTransp(&Transp);
00857     Attr4->SetEndTransp(&Transp);
00858     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), Attr4, FALSE, TRUE); 
00859 
00860     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00861 
00862 
00863     FillMapp = new AttrFillMappingLinear; 
00864     if (FillMapp == NULL)
00865         return FALSE; 
00866     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), FillMapp, FALSE, TRUE); 
00867 
00868 
00869     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00870 
00871 
00872     TranspFillMapp = new AttrTranspFillMappingLinear; 
00873     if (TranspFillMapp == NULL)
00874         return FALSE; 
00875     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), TranspFillMapp, FALSE, TRUE); 
00876 
00877                                   
00878     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00879 
00880 
00881     Attr5 = new AttrFillEffectFade; 
00882     if (Attr5 == NULL)
00883         return FALSE; 
00884     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), Attr5, FALSE, TRUE); 
00885 
00886     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00887 
00888 
00889     Attr2 = new AttrStrokeColour; 
00890     if (Attr2 == NULL)
00891         return FALSE; 
00892     Attr2->Value.Colour = DocColour(COLOUR_NONE);    // Text has no stroke colour attribute
00893 
00894     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), Attr2, FALSE, TRUE);  
00895 
00896     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00897 
00898     
00899     Attr6 = new AttrStrokeTransp; 
00900     if (Attr6 == NULL)
00901         return FALSE; 
00902     Attr6->Value.Transp = 0;
00903     Attr6->Value.TranspType = TT_Mix;
00904     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), Attr6, FALSE, TRUE);  
00905     
00906     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00907 
00908     Attr3 =  new AttrLineWidth;
00909     if (Attr3 == NULL)
00910         return FALSE; 
00911 
00912     Attr3->Value.LineWidth = 250;   // Text has 250 line width
00913     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), Attr3, FALSE, TRUE);  
00914  
00915 
00916                                                     
00917     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00918 
00919 
00920     StartArrow =  new AttrStartArrow;
00921     if (StartArrow == NULL)
00922         return FALSE; 
00923 
00924     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), StartArrow, FALSE, TRUE);  
00925 
00926 
00927                                                     
00928     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00929 
00930 
00931     EndArrow =  new AttrEndArrow;
00932     if (EndArrow == NULL)
00933         return FALSE; 
00934 
00935     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), EndArrow, FALSE, TRUE);  
00936 
00937 
00938                                                     
00939     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00940 
00941 
00942     StCaps =  new AttrStartCap;
00943     if (StCaps == NULL)
00944         return FALSE; 
00945 
00946     StCaps->Value.StartCap = LineCapButt; 
00947 
00948     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), StCaps, FALSE, TRUE);  
00949                                                     
00950     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00951 
00952 
00953     JoinType =  new AttrJoinType;
00954     if (JoinType == NULL)
00955         return FALSE; 
00956     
00957     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), JoinType, FALSE, TRUE);  
00958                                                     
00959     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00960 
00961 
00962     MitreLimit =  new AttrMitreLimit;
00963     if (MitreLimit == NULL)
00964         return FALSE; 
00965 
00966     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), MitreLimit, FALSE, TRUE);  
00967                                                     
00968     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00969 
00970 
00971     WindingRule =  new AttrWindingRule;
00972     if (WindingRule == NULL)
00973         return FALSE; 
00974 
00975     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), WindingRule, FALSE, TRUE);  
00976                                                     
00977     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00978 
00979 
00980     DashPattern =  new AttrDashPattern;
00981     if (DashPattern == NULL)
00982         return FALSE; 
00983 
00984     UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), DashPattern, FALSE, TRUE);
00985     
00986     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00987     // BLOCK
00988     {
00989         AttrOverprintLine *OPAttr = new AttrOverprintLine;
00990         if (OPAttr == NULL)
00991             return FALSE;
00992 
00993         UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), OPAttr, FALSE, TRUE);
00994     }
00995 
00996     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00997     // BLOCK
00998     {
00999         AttrOverprintFill *OPAttr = new AttrOverprintFill;
01000         if (OPAttr == NULL)
01001             return FALSE;
01002 
01003         UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), OPAttr, FALSE, TRUE);
01004     }
01005 
01006     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01007     // BLOCK
01008     {
01009         AttrPrintOnAllPlates *POAPAttr = new AttrPrintOnAllPlates;
01010         if (POAPAttr == NULL)
01011             return FALSE;
01012 
01013         UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), POAPAttr, FALSE, TRUE);
01014     }
01015 
01016 #ifdef VECTOR_STROKING // Neville 6/8/97
01017     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01018 
01019     // BLOCK
01020     {
01021         AttrStrokeType* pStroke = new AttrStrokeType;
01022         if (pStroke == NULL)
01023             return FALSE; 
01024 
01025         UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), pStroke, FALSE, TRUE);  
01026     }
01027 
01028     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01029 
01030 
01031     // BLOCK
01032     {
01033         AttrVariableWidth* pVarWidth =  new AttrVariableWidth;
01034         if (pVarWidth == NULL)
01035             return FALSE;
01036 
01037         UpdateCurrentAttribute(CC_RUNTIME_CLASS(BaseTextClass), pVarWidth, FALSE, TRUE);
01038     } 
01039 
01040     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01041     {
01042         
01043     }
01044     
01045 #endif // VECTOR_STROKING
01046     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01047 
01048     return TRUE; // Success
01049 }
01050 
01051 /********************************************************************************************
01052 
01053 >   AttributeManager::~AttributeManager() 
01054 
01055     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01056     Created:    19/8/94
01057     Inputs:     -
01058     Outputs:    -
01059     Returns:    -
01060     Purpose:    Attribute manager destructor
01061                     Currently destroys all attributes in all attribute groups
01062 
01063     Errors:     -
01064     SeeAlso:    -
01065 
01066 ********************************************************************************************/
01067 
01068 
01069 AttributeManager::~AttributeManager() 
01070 {
01071     // Delete all groups 
01072     AttributeGroup* CurrentGroup = (AttributeGroup*)AttrGroupList.GetHead(); 
01073     NodeAttribute* CurrentAttr;
01074     NodeAttribute* NextAttr;  
01075     while (CurrentGroup != NULL)
01076     {
01077         // Delete all attributes in the group 
01078         CurrentAttr = CurrentGroup->AttrListHd;// get pointer to first attribute in the 
01079                                                     // group 
01080         while (CurrentAttr != NULL)
01081         {
01082             NextAttr = (NodeAttribute*)CurrentAttr->FindNext(); 
01083             delete CurrentAttr; 
01084             CurrentAttr = NextAttr;     
01085         }
01086 
01087         delete (AttrGroupList.RemoveItem((ListItem*)CurrentGroup));
01088         CurrentGroup =(AttributeGroup*)AttrGroupList.GetHead();         // Get next group  
01089     }
01090 }
01091 
01092 /********************************************************************************************
01093 
01094 >   static BOOL AttributeManager::InitDefaults()
01095 
01096     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01097     Created:    17/05/94
01098     Returns:    TRUE if successful, FALSE otherwise
01099 
01100     Purpose:    Initialises the Attribute Manager. 
01101                     Registers basic attributes 
01102                     Declares attribute preferences 
01103 
01104 ********************************************************************************************/
01105 /*********************************************************************************************
01106 
01107     Preference: LastAttrAppliedBecomesCurrent
01108     Section:    Attributes
01109     Range:      TRUE or FALSE
01110     Purpose:    When TRUE - Whenever an attribute is applied to objects the attribute becomes
01111                 a current attribute. 
01112                 
01113     SeeAlso:    AskBeforeSettingCurrentAttr
01114 
01115 **********************************************************************************************/ 
01116 
01117 /*********************************************************************************************
01118 
01119     Preference: AskBeforeSettingCurrentAttr
01120     Section:    Attributes
01121     Range:      TRUE or FALSE
01122