00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 #include "camtypes.h"
00104
00105
00106
00107
00108 #include "toollist.h"
00109
00110 #include "attrappl.h"
00111 #include "optsmsgs.h"
00112
00113 #include "qualattr.h"
00114
00115 #include "nodetext.h"
00116
00117 #include "helpuser.h"
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
00128
00129 #include "userattr.h"
00130 #include "webattr.h"
00131
00132 #include "nodeshad.h"
00133
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
00144 #include "cxftags.h"
00145 #include "ophist.h"
00146
00147 DECLARE_SOURCE("$Revision: 1445 $");
00148
00149 CC_IMPLEMENT_DYNAMIC(CurrentAttrChangedMsg, Msg)
00150
00151
00152 #define new CAM_DEBUG_NEW
00153
00154 const INT32 AttributeTableGranularity = 20;
00155
00156
00157
00158
00159 #ifdef WEBSTER
00160
00161 BOOL AttributeManager::LastAttrAppliedBecomesCurrent =1;
00162 #else
00163
00164 BOOL AttributeManager::LastAttrAppliedBecomesCurrent = 0;
00165 #endif // WEBSTER
00166
00167
00168
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
00182 UINT32 AttributeManager::AttributeTableSize = 0;
00183 UINT32 AttributeManager::NumAttributes = 0;
00184 AttributeEntry *AttributeManager::DefaultAttrValues = NULL;
00185 NodeTypeEntry *AttributeManager::DefaultNodeAttrs = NULL;
00186
00187
00188
00189
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
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
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
00246 ColourRGBT DesiredDef;
00247 ColourHSVT DefaultDef;
00248 ColourCMYK CMYKBlack;
00249 ColourCMYK CMYKWhite;
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
00260 *Result = DocColour(COLOURMODEL_CMYK, (ColourGeneric *) &CMYKBlack);
00261 else if (NameResID == _R(IDS_WHITENAME))
00262
00263 {
00264 *Result = DocColour(COLOURMODEL_CMYK, (ColourGeneric *) &CMYKWhite);
00265
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);
00278 DefaultDef.Saturation = DefaultDef.Value = FIXED24(1.0);
00279 }
00280 else
00281 {
00282
00283 *Result = DocColour(COLOURMODEL_HSVT, (ColourGeneric *) &DefaultDef);
00284 }
00285
00286 if (ColList != NULL)
00287 {
00288
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
00297
00298 IndexedColour *NewDefault = (IndexedColour *) ColList->GetHead();
00299 ColourRGBT RGBDef;
00300
00301 while (NewDefault != NULL)
00302 {
00303 if (!NewDefault->IsDeleted())
00304 {
00305
00306
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
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
00335 String_64 ColourName;
00336 ColourName.Load ( NameResID );
00337
00338 NewDefault->SetName ( ColourName );
00339
00340
00341 ColList->AddItem(NewDefault);
00342 }
00343
00344 if (NewDefault != NULL)
00345 Result->MakeRefToIndexedColour(NewDefault);
00346 }
00347
00348
00349 }
00350 #undef COL_ACCURACY
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373 BOOL AttributeManager::InitInstance()
00374 {
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386 String_256 strGraphic( _R(IDS_GRAPHIC) );
00387 CreateCurrentAttributeGroup( CC_RUNTIME_CLASS(NodeRenderableInk), (CCRuntimeClass *)NULL,
00388 strGraphic );
00389
00390
00391
00392 AttrFlatColourFill* Attr1 = new AttrFlatColourFill;
00393 if (Attr1 == NULL)
00394 return FALSE;
00395
00396
00397
00398
00399
00400 DocColour DefWhite;
00401
00402
00403 FindDefaultColour(NULL,
00404 _R(IDS_WHITENAME), &DefWhite);
00405 DocColour DefBlack;
00406
00407
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;
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
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
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
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
00680 String_256 strText( _R(IDS_TEXT) );
00681 CreateCurrentAttributeGroup( CC_RUNTIME_CLASS(BaseTextClass),
00682 CC_RUNTIME_CLASS(NodeRenderableInk),
00683 strText );
00684
00685
00686
00687
00688
00689
00690
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
00699 if (UnicodeManager::IsDBCSOS())
00700 {
00701
00702
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
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
00838
00839 Attr1 = new AttrFlatColourFill;
00840 if (Attr1 == NULL)
00841 return FALSE;
00842
00843
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);
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;
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
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
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
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
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
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;
01049 }
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069 AttributeManager::~AttributeManager()
01070 {
01071
01072 AttributeGroup* CurrentGroup = (AttributeGroup*)AttrGroupList.GetHead();
01073 NodeAttribute* CurrentAttr;
01074 NodeAttribute* NextAttr;
01075 while (CurrentGroup != NULL)
01076 {
01077
01078 CurrentAttr = CurrentGroup->AttrListHd;
01079
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();
01089 }
01090 }
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122