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 #include "camtypes.h"
00103
00104 #include "cxftree.h"
00105
00106
00107
00108 #include "oildbug.h"
00109 #include "nodedoc.h"
00110
00111
00112 #include "nodetext.h"
00113
00114 #include "bubbleid.h"
00115
00116
00117
00118
00119 #include "cxfile.h"
00120 #include "cxftfile.h"
00121 #include "cxftags.h"
00122
00123
00124
00125 #include "clipint.h"
00126 #include "keypress.h"
00127 #include "vkextra.h"
00128 #include "insertnd.h"
00129
00130 #ifdef XAR_TREE_DIALOG
00131
00132 CC_IMPLEMENT_DYNCREATE(CXFTreeDlg, DialogOp)
00133 CC_IMPLEMENT_DYNAMIC(CXFTreeDlgRecordHandler,CXaraFileRecordHandler)
00134
00135 CC_IMPLEMENT_DYNAMIC(CXFNode, CCObject)
00136
00137 CC_IMPLEMENT_MEMDUMP(CXFNodeTypeStatistics,ListItem)
00138 CC_IMPLEMENT_MEMDUMP(CXFNodeTypeStatisticsList,List)
00139
00140
00141
00142 #define new CAM_DEBUG_NEW
00143
00144 CXFTreeDlg* CXFTreeDlg::pCurrentCXFTreeDlg = NULL;
00145 BOOL CXFTreeDlg::s_bExpandClicked = FALSE;
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 CXFTreeDlg::CXFTreeDlg(): DialogOp(CXFTreeDlg::IDD(), MODELESS)
00159 {
00160 pRoot = NULL;
00161 pContextNode = NULL;
00162 EndOfFile = FALSE;
00163 AddNextAsChild = FALSE;
00164 Level = 0;
00165 MaxIndex = 0;
00166
00167 EditStr = new StringBase;
00168 if (!EditStr || !EditStr->Alloc(0x100000)) return;
00169
00170 CXFTreeDlg::pCurrentCXFTreeDlg = this;
00171 }
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184 CXFTreeDlg::~CXFTreeDlg()
00185 {
00186 Delete(pRoot);
00187 pRoot = NULL;
00188
00189
00190 delete EditStr;
00191
00192 CXFTreeDlg::pCurrentCXFTreeDlg = NULL;
00193 }
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209 void CXFTreeDlg::Do(OpDescriptor*)
00210 {
00211 Create();
00212 Open();
00213 }
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229 BOOL CXFTreeDlg::Init()
00230 {
00231
00232 return (RegisterOpDescriptor(
00233 0,
00234 _R(IDS_CXFTREEDLG),
00235 CC_RUNTIME_CLASS(CXFTreeDlg),
00236 OPTOKEN_CXFTREEDLG,
00237 CXFTreeDlg::GetState,
00238 0,
00239 _R(IDBBL_DEBUGTREEDLG),
00240 0 ));
00241 }
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255 BOOL CXFTreeDlg::Create()
00256 {
00257 if (DialogOp::Create())
00258 {
00259 EnableGadget(_R(IDC_DEBUGTREE_EXPAND), TRUE);
00260 EnableGadget(_R(IDC_DEBUGTREE_DUMP), FALSE);
00261 EnableGadget(_R(IDC_DEBUGTREE_HIDDEN), FALSE);
00262 EnableGadget(_R(IDC_DEBUGTREE_SELNONLY),FALSE);
00263 EnableGadget(_R(IDC_DEBUGTREE_REFRESH), FALSE);
00264
00265 InitialiseNewTreeControl();
00266 }
00267
00268 return TRUE;
00269 }
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283 OpState CXFTreeDlg::GetState(String_256*, OpDescriptor*)
00284 {
00285 OpState OpSt;
00286 return(OpSt);
00287 }
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300 void CXFTreeDlg::ShowFile(TCHAR* pFile)
00301 {
00302 String_256 s = pFile;
00303 SetFileName(s);
00304
00305 CreateTree();
00306 }
00307
00308
00309 void CXFTreeDlg::DeInit()
00310 {
00311 DeleteAllValues(_R(IDC_DEBUGTREE_TREE));
00312
00313 Delete(pRoot);
00314 pRoot = NULL;
00315 }
00316
00317
00318 void CXFTreeDlg::Delete(CXFNode* pNode)
00319 {
00320 if (pNode == NULL)
00321 return;
00322
00323 while (pNode)
00324 {
00325 CXFNode* pNext = pNode->GetNext();
00326
00327 CXFNode* pChild = pNode->GetChild();
00328 if (pChild)
00329 {
00330 Delete(pChild);
00331 }
00332
00333 delete pNode;
00334 pNode = pNext;
00335 }
00336 }
00337
00338 void CXFTreeDlg::SetFileName(String_256& ThisFileName)
00339 {
00340 FileName = ThisFileName;
00341 }
00342
00343
00344 void CXFTreeDlg::CreateTree()
00345 {
00346
00347 DeleteAllValues(_R(IDC_DEBUGTREE_TREE));
00348 Delete(pRoot);
00349 pRoot = NULL;
00350
00351
00352 AddNextAsChild = FALSE;
00353 Level = 0;
00354 pContextNode = NULL;
00355
00356 ListOfNodeTypeStats.DeleteAll();
00357
00358 PathName* pPath = new PathName(FileName);
00359
00360 if (pPath != NULL && pPath->IsValid())
00361 {
00362 CCDiskFile* pFile = new CCDiskFile(*pPath,ios::in | ios::binary);
00363
00364 if (pFile != NULL)
00365 {
00366 EndOfFile = FALSE;
00367 CXaraFile* pCXFile = NULL;
00368
00369 PORTNOTE("other", "Removed wix reading - uses COM object")
00370 #if FALSE
00371 char Buf[10];
00372 pFile->read(Buf, 10);
00373
00374 pFile->seek(0);
00375
00376 if ((memcmp(Buf, "FLARETEXT", 9) == 0) &&
00377 ((Buf[9] == 13) || (Buf[9] == 10)))
00378 {
00379 pCXFile = new CXaraTemplateFile();
00380 }
00381 else
00382 #endif
00383 {
00384 pCXFile = new CXaraFile();
00385 }
00386
00387 if (pCXFile != NULL)
00388 {
00389 CXaraFileRecordHandler* pHandler = new CXFTreeDlgRecordHandler(this,pCXFile);
00390 if (pHandler != NULL)
00391 {
00392 pCXFile->SetDefaultRecordHandler(pHandler);
00393
00394 if (pCXFile->OpenToRead(pFile))
00395 {
00396 BOOL ok = TRUE;
00397
00398 while (!EndOfFile && ok)
00399 ok = pCXFile->ReadNextRecord();
00400
00401 pCXFile->Close();
00402 }
00403
00404 delete pHandler;
00405 pHandler = NULL;
00406 }
00407 delete pCXFile;
00408 }
00409 delete pFile;
00410 }
00411 }
00412
00413 if (pPath != NULL)
00414 delete pPath;
00415
00416
00417 ListOfNodeTypeStats.DeleteAll();
00418
00419 CTreeItemID hThisItem = AddOneItem(CTreeItemID(), FileName, CTreeItemID(), m_idxPage, NULL);
00420
00421
00422 CTreeItemID hContext;
00423 CXFNode* pNode = pRoot;
00424 while (pNode)
00425 {
00426 hContext = AddItemToNewTreeControl(hThisItem, hContext, pNode, TRUE);
00427 pNode = pNode->GetNext();
00428 }
00429 }
00430
00431
00432
00433
00434 void CXFTreeDlg::AddNode(CXFNode* pNode)
00435 {
00436 if (pNode == NULL)
00437 return;
00438
00439 ListOfNodeTypeStats.Update(pNode);
00440
00441 if (pRoot == NULL)
00442 {
00443 pRoot = pNode;
00444 return;
00445 }
00446
00447 if (pContextNode == NULL)
00448 pContextNode = pRoot;
00449
00450 if (pContextNode != NULL)
00451 {
00452 switch (pNode->GetTag())
00453 {
00454 case TAG_UP:
00455 AddNextAsChild = FALSE;
00456 Level--;
00457 break;
00458
00459 case TAG_DOWN:
00460 AddNextAsChild = TRUE;
00461 Level++;
00462 break;
00463 }
00464
00465 if (pContextNode != NULL)
00466 {
00467 if (AddNextAsChild)
00468 {
00469 CXFNode* pChildNode = pContextNode->GetChild();
00470 if (pChildNode != NULL)
00471 {
00472 TRACEUSER( "Markn", _T("Take cover - context node has already got children"));
00473
00474 while (pChildNode->GetNext() != NULL)
00475 pChildNode = pChildNode->GetNext();
00476
00477 pChildNode->SetNext(pNode);
00478 pNode->SetPrevious(pChildNode);
00479 pNode->SetParent(pChildNode->GetParent());
00480 }
00481 else
00482 {
00483 pContextNode->SetChild(pNode);
00484 pNode->SetParent(pContextNode);
00485 }
00486
00487 AddNextAsChild = FALSE;
00488 pContextNode = pNode;
00489 }
00490 else
00491 {
00492 pContextNode->SetNext(pNode);
00493 pNode->SetPrevious(pContextNode);
00494 pNode->SetParent(pContextNode->GetParent());
00495
00496 if (pNode->GetTag() == TAG_UP)
00497 pContextNode = pNode->GetParent();
00498 else
00499 pContextNode = pNode;
00500 }
00501 }
00502 }
00503 }
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519 CXaraFileRecordHandler* CXFTreeDlg::FindHandler(UINT32 Tag)
00520 {
00521 List* pRecordHandlerList = BaseCamelotFilter::GetRecordHandlers();
00522
00523 ERROR3IF(pRecordHandlerList == NULL,"pRecordHandlerList is NULL");
00524
00525 if (pRecordHandlerList != NULL)
00526 {
00527 CXaraFileRecordHandler* pHandler = (CXaraFileRecordHandler*) pRecordHandlerList->GetHead();
00528 while (pHandler != NULL)
00529 {
00530 if (pHandler->IsTagInList(Tag))
00531 return pHandler;
00532
00533 pHandler = (CXaraFileRecordHandler*) pRecordHandlerList->GetNext(pHandler);
00534 }
00535 }
00536
00537 return NULL;
00538 }
00539
00540 void CXFTreeDlg::GetTagText(CXFNode* pNode,String_256& Str)
00541 {
00542 if (pNode != NULL)
00543 GetTagText(pNode->GetTag(),Str);
00544 }
00545
00546 void CXFTreeDlg::GetTagText(UINT32 Tag,String_256& Str)
00547 {
00548 CXaraFileRecordHandler* pHandler = FindHandler(Tag);
00549
00550 if (pHandler != NULL)
00551 pHandler->GetTagText(Tag,Str);
00552 }
00553
00554
00555 void CXFTreeDlg::ShowNodeDebugInfoForNode(CXFNode *pNode)
00556 {
00557 if (pNode != NULL)
00558 {
00559 (*EditStr).Empty();
00560
00561 pNode->ResetReadPos();
00562
00563 CXaraFileRecordHandler* pHandler = FindHandler(pNode->GetTag());
00564 if (pHandler != NULL)
00565 pHandler->GetRecordDescriptionText(pNode->GetCXaraFileRecord(),EditStr);
00566 else
00567 {
00568 TCHAR s[256];
00569 camSprintf(s,_T("CAN'T FIND HANDLER FOR TAG (%d)\r\nMissing from a handler's tag list perhaps?\r\n"),pNode->GetTag());
00570 (*EditStr) += s;
00571 }
00572
00573
00574 SetStringGadgetValue(_R(IDC_DEBUGTREE_DETAILS), *EditStr);
00575 }
00576 }
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591 MsgResult CXFTreeDlg::Message( Msg* Message)
00592 {
00593 if (IS_OUR_DIALOG_MSG(Message))
00594 {
00595 DialogMsg* Msg = (DialogMsg*) Message;
00596 if ((Msg->DlgMsg == DIM_COMMIT || Msg->DlgMsg == DIM_CANCEL))
00597 {
00598 DeInit();
00599 Close();
00600 End();
00601 }
00602 else if ((Msg->GadgetID == _R(IDC_DEBUGTREE_EXPAND))
00603 && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
00604 {
00605
00606 ExpandNewTree();
00607 }
00608 else if ((Msg->GadgetID == _R(IDC_DEBUGTREE_TREE)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED))
00609 {
00610
00611 CTreeItemID hItem = GetTreeGadgetFirstSelectedItem(_R(IDC_DEBUGTREE_TREE));
00612 if (hItem.IsOk())
00613 {
00614 CCObject* pNode = GetTreeGadgetItemData(_R(IDC_DEBUGTREE_TREE), hItem);
00615 if (pNode)
00616 ShowNodeDebugInfoForNode((CXFNode*)pNode);
00617 }
00618 }
00619
00620 return (DLG_EAT_IF_HUNGRY(Msg));
00621 }
00622 return OK;
00623 }
00624
00625
00626
00627
00628
00629 CXFTreeDlgRecordHandler::CXFTreeDlgRecordHandler(CXFTreeDlg * pThisDlg,CXaraFile* pThisCXFile)
00630 {
00631 ERROR3IF(pThisDlg == NULL,"Null pThisDlg");
00632 ERROR3IF(pThisCXFile == NULL,"Null pThisCXFile");
00633
00634 pCXFDlg = pThisDlg;
00635 pCXFile = pThisCXFile;
00636 }
00637
00638
00639
00640 BOOL CXFTreeDlgRecordHandler::HandleRecord(CXaraFileRecord* pRecord)
00641 {
00642 ERROR2IF(pRecord == NULL,FALSE,"NULL record given!");
00643 ERROR2IF(pCXFDlg == NULL,FALSE,"NULL pCXFDlg!");
00644 ERROR2IF(pCXFile == NULL,FALSE,"NULL pCXFile!");
00645
00646 CXFNode* pNode = new CXFNode(pRecord);
00647
00648 pCXFDlg->AddNode(pNode);
00649
00650 switch (pRecord->GetTag())
00651 {
00652 case TAG_STARTCOMPRESSION:
00653
00654 pCXFile->SetCompression(TRUE);
00655 break;
00656 case TAG_ENDCOMPRESSION:
00657
00658 pCXFile->SetCompression(FALSE);
00659 break;
00660
00661 case TAG_ENDOFFILE:
00662 pCXFDlg->SetEndOfFile(TRUE);
00663 break;
00664 }
00665
00666 return TRUE;
00667 }
00668
00669 BOOL CXFTreeDlgRecordHandler::HandleStreamedRecord(CXaraFile * pCXFile, UINT32 Tag,UINT32 Size,UINT32 RecordNumber)
00670 {
00671 ERROR2IF(pCXFDlg == NULL,FALSE,"NULL pCXFDlg!");
00672 ERROR2IF(pCXFile == NULL,FALSE,"NULL pCXFile!");
00673
00674 CXaraFileRecord* pRecord = new CXaraFileRecord(Tag,Size);
00675 if (pRecord == NULL || !pRecord->Init(TRUE))
00676 return TRUE;
00677
00678 pRecord->SetRecordNumber(RecordNumber);
00679
00680 CXFNode* pNode = new CXFNode(pRecord);
00681 delete pRecord;
00682 pRecord = NULL;
00683
00684 pCXFDlg->AddNode(pNode);
00685
00686 switch (Tag)
00687 {
00688 case TAG_STARTCOMPRESSION:
00689
00690 pCXFile->SetCompression(TRUE);
00691 break;
00692 case TAG_ENDCOMPRESSION:
00693
00694 pCXFile->SetCompression(FALSE);
00695 break;
00696
00697 case TAG_ENDOFFILE:
00698 pCXFDlg->SetEndOfFile(TRUE);
00699 break;
00700 }
00701
00702 return TRUE;
00703 }
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721 BOOL CXFTreeDlgRecordHandler::IsStreamed(UINT32 Tag)
00722 {
00723 switch (Tag)
00724 {
00725 case TAG_STARTCOMPRESSION:
00726 case TAG_ENDCOMPRESSION:
00727 return TRUE;
00728 break;
00729 }
00730
00731 return FALSE;
00732 }
00733
00734
00735
00736
00737
00738 CXFNode::CXFNode(CXaraFileRecord* pThisRecord)
00739 {
00740 pRecord = NULL;
00741 pNext = NULL;
00742 pPrevious = NULL;
00743 pParent = NULL;
00744 pChild = NULL;
00745
00746 DoShowChildren = FALSE;
00747
00748 if (pThisRecord != NULL)
00749 pRecord = pThisRecord->GetCopy();
00750 }
00751
00752 CXFNode::~CXFNode()
00753 {
00754 if (pRecord != NULL)
00755 delete pRecord;
00756 }
00757
00758 UINT32 CXFNode::GetTag()
00759 {
00760 if (pRecord != NULL)
00761 return pRecord->GetTag();
00762
00763 return UINT32(-1);
00764 }
00765
00766 UINT32 CXFNode::GetSize()
00767 {
00768 if (pRecord != NULL)
00769 return pRecord->GetSize();
00770
00771 return UINT32(-1);
00772 }
00773
00774 void CXFNode::ResetReadPos()
00775 {
00776 if (pRecord != NULL)
00777 pRecord->ResetReadPos();
00778 }
00779
00780
00781
00782
00783
00784
00785 void CXFNodeTypeStatisticsList::Update(CXFNode* pNode)
00786 {
00787 CXFNodeTypeStatistics* pItem = FindNodeType(pNode->GetTag());
00788
00789 if (pItem == NULL)
00790 {
00791 pItem = new CXFNodeTypeStatistics(pNode->GetTag());
00792 if (pItem != NULL)
00793 Add(pItem);
00794 }
00795
00796 if (pItem != NULL)
00797 {
00798 pItem->IncNumOccurances();
00799 pItem->AddToTotalSize(pNode->GetSize());
00800 }
00801 }
00802
00803 void CXFNodeTypeStatisticsList::Dump(CXFTreeDlg* pDlg)
00804 {
00805 TRACE( _T("\nRecord stats:\n\n"));
00806
00807 CXFNodeTypeStatistics* pItem = GetHead();
00808
00809 String_256 Str;
00810
00811 while (pItem != NULL)
00812 {
00813 pDlg->GetTagText(pItem->GetTag(),Str);
00814
00815 INT32 o = pItem->GetNumOccurances();
00816 INT32 s = pItem->GetTotalSize();
00817
00818 TRACE( _T("%s\t%d\t%d\t%d\n"),(TCHAR*)Str,o,s,(o*8)+s);
00819
00820 pItem = GetNext(pItem);
00821 }
00822 }
00823
00824
00825 CXFNodeTypeStatistics* CXFNodeTypeStatisticsList::FindNodeType(UINT32 Tag)
00826 {
00827 CXFNodeTypeStatistics* pItem = GetHead();
00828 while (pItem != NULL)
00829 {
00830 if (pItem->GetTag() == Tag)
00831 return pItem;
00832
00833 pItem = GetNext(pItem);
00834 }
00835
00836 return NULL;
00837 }
00838
00839
00840 void CXFNodeTypeStatisticsList::Add(CXFNodeTypeStatistics* pNodeType)
00841 {
00842 AddTail(pNodeType);
00843 }
00844
00845 CXFNodeTypeStatistics* CXFNodeTypeStatisticsList::GetHead()
00846 {
00847 return (CXFNodeTypeStatistics*)List::GetHead();
00848 }
00849
00850 CXFNodeTypeStatistics* CXFNodeTypeStatisticsList::GetNext(CXFNodeTypeStatistics* pItem)
00851 {
00852 return (CXFNodeTypeStatistics*)List::GetNext(pItem);
00853 }
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875 CTreeItemID CXFTreeDlg::AddOneItem(CTreeItemID hParent, const StringBase& str, CTreeItemID hInsAfter, INT32 iImage, CXFNode *pNode)
00876 {
00877 return SetTreeGadgetItem(_R(IDC_DEBUGTREE_TREE), hParent, str, hInsAfter, iImage, pNode);
00878 }
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891 INT32 CXFTreeDlg::GetImageForNode(CXFNode *pNode)
00892 {
00893 INT32 iImage = m_idxGeneralTag;
00894
00895 if(pNode != NULL)
00896 {
00897 UINT32 Tag = pNode->GetTag();
00898
00899 switch(Tag)
00900 {
00901 case TAG_UP:
00902 iImage = m_idxUp;
00903 break;
00904
00905 case TAG_DOWN:
00906 iImage = m_idxDown;
00907 break;
00908
00909 case TAG_STARTCOMPRESSION:
00910 case TAG_ENDCOMPRESSION:
00911 iImage = m_idxCompression;
00912 break;
00913
00914 case TAG_DOCUMENT:
00915 case TAG_CHAPTER:
00916 case TAG_SPREAD:
00917 case TAG_LAYER:
00918 case TAG_PAGE:
00919 case TAG_SPREADINFORMATION:
00920 iImage = m_idxPage;
00921 break;
00922
00923 case TAG_DEFINERGBCOLOUR:
00924 case TAG_DEFINECOMPLEXCOLOUR:
00925 iImage = m_idxDefineColour;
00926 break;
00927
00928 case TAG_PREVIEWBITMAP_BMP:
00929 case TAG_PREVIEWBITMAP_GIF:
00930 case TAG_PREVIEWBITMAP_JPEG:
00931 case TAG_PREVIEWBITMAP_PNG:
00932 case TAG_PREVIEWBITMAP_TIFFLZW:
00933 case TAG_DEFINEBITMAP_BMP:
00934 case TAG_DEFINEBITMAP_GIF:
00935 case TAG_DEFINEBITMAP_JPEG:
00936 case TAG_DEFINEBITMAP_PNG:
00937 case TAG_DEFINEBITMAP_BMPZIP:
00938 case TAG_DEFINESOUND_WAV:
00939 case TAG_DEFINEBITMAP_JPEG8BPP:
00940 case TAG_NODE_BITMAP:
00941 case TAG_NODE_CONTONEDBITMAP:
00942 iImage = m_idxDefineBitmap;
00943 break;
00944
00945 case TAG_GROUP:
00946 case TAG_COMPOUNDRENDER:
00947 case TAG_LIVE_EFFECT:
00948 case TAG_LOCKED_EFFECT:
00949 case TAG_FEATHER_EFFECT:
00950 case TAG_GROUPTRANSP:
00951 case TAG_CACHEDNODESGROUP:
00952 iImage = m_idxGroup;
00953 break;
00954
00955 case TAG_PATH:
00956 case TAG_PATH_FILLED:
00957 case TAG_PATH_STROKED:
00958 case TAG_PATH_FILLED_STROKED:
00959 case TAG_BLEND:
00960 case TAG_BLENDER:
00961 case TAG_BLENDER_CURVEPROP:
00962 case TAG_BLENDER_CURVEANGLES:
00963 case TAG_BLEND_PATH:
00964 case TAG_MOULD_ENVELOPE:
00965 case TAG_MOULD_PERSPECTIVE:
00966 case TAG_MOULD_GROUP:
00967 case TAG_MOULD_PATH:
00968 case TAG_PATH_FLAGS:
00969 case TAG_GUIDELINE:
00970 case TAG_PATH_RELATIVE:
00971 case TAG_PATH_RELATIVE_FILLED:
00972 case TAG_PATH_RELATIVE_STROKED:
00973 case TAG_PATH_RELATIVE_FILLED_STROKED:
00974 case TAG_PATHREF_IDENTICAL:
00975 case TAG_PATHREF_TRANSFORM:
00976 case TAG_ELLIPSE_SIMPLE:
00977 case TAG_ELLIPSE_COMPLEX:
00978 case TAG_RECTANGLE_SIMPLE:
00979 case TAG_RECTANGLE_SIMPLE_REFORMED:
00980 case TAG_RECTANGLE_SIMPLE_STELLATED:
00981 case TAG_RECTANGLE_SIMPLE_STELLATED_REFORMED:
00982 case TAG_RECTANGLE_SIMPLE_ROUNDED:
00983 case TAG_RECTANGLE_SIMPLE_ROUNDED_REFORMED:
00984 case TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED:
00985 case TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED_REFORMED:
00986 case TAG_RECTANGLE_COMPLEX:
00987 case TAG_RECTANGLE_COMPLEX_REFORMED:
00988 case TAG_RECTANGLE_COMPLEX_STELLATED:
00989 case TAG_RECTANGLE_COMPLEX_STELLATED_REFORMED:
00990 case TAG_RECTANGLE_COMPLEX_ROUNDED:
00991 case TAG_RECTANGLE_COMPLEX_ROUNDED_REFORMED:
00992 case TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED:
00993 case TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED_REFORMED:
00994 case TAG_POLYGON_COMPLEX:
00995 case TAG_POLYGON_COMPLEX_REFORMED:
00996 case TAG_POLYGON_COMPLEX_STELLATED:
00997 case TAG_POLYGON_COMPLEX_STELLATED_REFORMED:
00998 case TAG_POLYGON_COMPLEX_ROUNDED:
00999 case TAG_POLYGON_COMPLEX_ROUNDED_REFORMED:
01000 case TAG_POLYGON_COMPLEX_ROUNDED_STELLATED:
01001 case TAG_POLYGON_COMPLEX_ROUNDED_STELLATED_REFORMED:
01002 case TAG_REGULAR_SHAPE_PHASE_1:
01003 case TAG_REGULAR_SHAPE_PHASE_2:
01004 iImage = m_idxShape;
01005 break;
01006
01007 case TAG_FLATFILL:
01008 case TAG_LINECOLOUR:
01009 case TAG_LINEWIDTH:
01010 case TAG_LINEARFILL:
01011 case TAG_LINEARFILL3POINT:
01012 case TAG_LINEARFILLMULTISTAGE:
01013 case TAG_LINEARFILLMULTISTAGE3POINT:
01014 case TAG_CIRCULARFILL:
01015 case TAG_ELLIPTICALFILL:
01016 case TAG_CONICALFILL:
01017 case TAG_BITMAPFILL:
01018 case TAG_CONTONEBITMAPFILL:
01019 case TAG_FRACTALFILL:
01020 case TAG_FILLEFFECT_FADE:
01021 case TAG_FILLEFFECT_RAINBOW:
01022 case TAG_FILLEFFECT_ALTRAINBOW:
01023 case TAG_FILL_REPEATING:
01024 case TAG_FILL_NONREPEATING:
01025 case TAG_FILL_REPEATINGINVERTED:
01026 case TAG_FILL_REPEATING_EXTRA:
01027 case TAG_FLATTRANSPARENTFILL:
01028 case TAG_LINEARTRANSPARENTFILL:
01029 case TAG_LINEARTRANSPARENTFILL3POINT:
01030 case TAG_CIRCULARTRANSPARENTFILL:
01031 case TAG_ELLIPTICALTRANSPARENTFILL:
01032 case TAG_CONICALTRANSPARENTFILL:
01033 case TAG_BITMAPTRANSPARENTFILL:
01034 case TAG_FRACTALTRANSPARENTFILL:
01035 case TAG_LINETRANSPARENCY:
01036 case TAG_STARTCAP:
01037 case TAG_ENDCAP:
01038 case TAG_JOINSTYLE:
01039 case TAG_MITRELIMIT:
01040 case TAG_WINDINGRULE:
01041 case TAG_QUALITY:
01042 case TAG_TRANSPARENTFILL_REPEATING:
01043 case TAG_TRANSPARENTFILL_NONREPEATING:
01044 case TAG_TRANSPARENTFILL_REPEATINGINVERTED:
01045 case TAG_DASHSTYLE:
01046 case TAG_DEFINEDASH:
01047 case TAG_ARROWHEAD:
01048 case TAG_ARROWTAIL:
01049 case TAG_DEFINEARROW:
01050 case TAG_DEFINEDASH_SCALED:
01051 case TAG_USERVALUE:
01052 case TAG_WEBADDRESS:
01053 case TAG_WEBADDRESS_BOUNDINGBOX:
01054 case TAG_FLATFILL_NONE:
01055 case TAG_FLATFILL_BLACK:
01056 case TAG_FLATFILL_WHITE:
01057 case TAG_LINECOLOUR_NONE:
01058 case TAG_LINECOLOUR_BLACK:
01059 case TAG_LINECOLOUR_WHITE:
01060 case TAG_SQUAREFILL:
01061 case TAG_SQUARETRANSPARENTFILL:
01062 case TAG_THREECOLFILL:
01063 case TAG_THREECOLTRANSPARENTFILL:
01064 case TAG_FOURCOLFILL:
01065 case TAG_FOURCOLTRANSPARENTFILL:
01066 case TAG_VARIABLEWIDTHFUNC:
01067 case TAG_VARIABLEWIDTHTABLE:
01068 case TAG_STROKETYPE:
01069 case TAG_STROKEDEFINITION:
01070 case TAG_STROKEAIRBRUSH:
01071 case TAG_NOISEFILL:
01072 case TAG_NOISETRANSPARENTFILL:
01073 case TAG_WIZOP:
01074 iImage = m_idxAttribute;
01075 break;
01076
01077 case TAG_SETSENTINEL:
01078 iImage = m_idxSentinelNode; break;
01079
01080 case TAG_SETPROPERTY:
01081 iImage = m_idxSetProperty; break;
01082 }
01083 }
01084
01085 return iImage;
01086 }
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100 CTreeItemID CXFTreeDlg::AddItemToNewTreeControl(CTreeItemID hParentItem, CTreeItemID hInsAfterItem, CXFNode *pNode, BOOL bAddChildren)
01101 {
01102 if(pNode == NULL)
01103 return CTreeItemID();
01104
01105 String_256 NodeText;
01106
01107 GetTagText(pNode, NodeText);
01108 INT32 iImage = GetImageForNode(pNode);
01109
01110 CTreeItemID hThisItem = AddOneItem(hParentItem, NodeText, hInsAfterItem, iImage, pNode);
01111
01112
01113 CXFNode *pChild = pNode->GetChild();
01114 if (pChild && bAddChildren)
01115 {
01116 CTreeItemID hInsContext;
01117
01118 while (pChild != NULL)
01119 {
01120
01121 hInsContext = AddItemToNewTreeControl(hThisItem, hInsContext, pChild, bAddChildren);
01122 pChild = pChild->GetNext();
01123 }
01124 }
01125
01126 return hThisItem;
01127 }
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141 BOOL CXFTreeDlg::InitialiseNewTreeControl(void)
01142 {
01143 CGadgetImageList NewImageList(16, 16);
01144 m_idxGeneralTag = NewImageList.Add(_R(IDB_CXFTREE_GENERALTAG));
01145 m_idxDefineBitmap = NewImageList.Add(_R(IDB_CXFTREE_DEFINEBITMAP));
01146 m_idxDefineColour = NewImageList.Add(_R(IDB_CXFTREE_DEFINECOLOUR));
01147 m_idxCompression = NewImageList.Add(_R(IDB_CXFTREE_COMPRESSION));
01148 m_idxDown = NewImageList.Add(_R(IDB_CXFTREE_DOWN));
01149 m_idxUp = NewImageList.Add(_R(IDB_CXFTREE_UP));
01150 m_idxGroup = NewImageList.Add(_R(IDB_CXFTREE_GROUP));
01151 m_idxPage = NewImageList.Add(_R(IDB_DEBUGTREE_RENDERABLEPAPER));
01152 m_idxAttribute = NewImageList.Add(_R(IDB_DEBUGTREE_ATTRIBUTE));
01153 m_idxShape = NewImageList.Add(_R(IDB_DEBUGTREE_RENDERABLEINK));
01154 m_idxSentinelNode = NewImageList.Add(_R(IDB_DEBUGTREE_SENTINELNODE));
01155 m_idxSetProperty = NewImageList.Add(_R(IDB_DEBUGTREE_SETPROPERTY));
01156
01157 SetGadgetBitmaps(_R(IDC_DEBUGTREE_TREE), NewImageList);
01158
01159 return(TRUE);
01160 }
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173 BOOL CXFTreeDlg::GetInfoFromTreeItem(CTreeItemID hItem, CXFNode **ppNode, INT32 *pChildren)
01174 {
01175 CCObject* pNode = GetTreeGadgetItemData(_R(IDC_DEBUGTREE_TREE), hItem);
01176 ERROR3IF(!pNode->IsKindOf(CC_RUNTIME_CLASS(CXFNode)), "DebugTreeDlg found a non-CXFNode tree item");
01177 if (!pNode->IsKindOf(CC_RUNTIME_CLASS(CXFNode)))
01178 return FALSE;
01179
01180 *ppNode = (CXFNode*)pNode;
01181 *pChildren = GetTreeGadgetChildrenCount(_R(IDC_DEBUGTREE_TREE), hItem, FALSE);
01182
01183 return TRUE;
01184 }
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197 void CXFTreeDlg::ExpandNewTree()
01198 {
01199 CTreeItemID hItem = GetTreeGadgetRootItem(_R(IDC_DEBUGTREE_TREE));
01200
01201
01202
01203 while (hItem.IsOk())
01204 {
01205 TreeGadgetExpandItem(_R(IDC_DEBUGTREE_TREE), hItem);
01206
01207
01208
01209
01210
01211 hItem = GetTreeGadgetNextVisItem(_R(IDC_DEBUGTREE_TREE), hItem);
01212 }
01213
01214
01215
01216 }
01217
01218 #if FALSE
01219 void CXFTreeDlg::ExpandTreeItem(CTreeItemID hItem, BOOL bChildren)
01220 {
01221 if (hItem.IsOk())
01222 TreeGadgetExpandItem(_R(IDC_DEBUGTREE_TREE), hItem);
01223
01224 if (bChildren)
01225 {
01226 CTreeItemID hChild = GetTreeGadgetFirstChildItem(_R(IDC_DEBUGTREE_TREE), hItem);
01227
01228
01229 while (hChild.IsOk())
01230 {
01231 ExpandTreeItem(hChild, bChildren);
01232
01233
01234 hItem = GetTreeGadgetNextItem(_R(IDC_DEBUGTREE_TREE), hChild);
01235 }
01236 }
01237 }
01238 #endif
01239
01240 #endif // XAR_TREE_DIALOG
01241