#include <objreg.h>
Inheritance diagram for ObjectRegistry:
Static Public Member Functions | |
static BOOL | Init () |
Declares a preference that allows you to clear memory in delete(). | |
static void | RegisterNodeRenderableInkDetails (NodeRenderableInkDetailsItem *ReqdAttribItem) |
RegisterNodeRenderableInkDetails can be called to register extra NodeRenderableInkNodes if they get added in new tools. This must be done at startup. | |
static List * | GetRequiredAttribs (CCRuntimeClass *NodeRenderableInkClass) |
GetRequiredAttribs returns a list of attribute classes which are required by the NodeRenderableInk class. Note that the NodeRenderableInkClass must have been registerd. | |
static NodeRenderableInkDetailsItem * | GetAttribDetails (CCRuntimeClass *pInkClass) |
static void | Delete () |
Deletes the object registry data. | |
static BOOL | RegisterShadowDetails () |
Register required attribute details for shadows. | |
Static Private Attributes | |
static List | NodeRenderableInkDetailsList |
There should never be an instance of the ObjectRegistry it is a static object
Definition at line 184 of file objreg.h.
|
Deletes the object registry data.
Definition at line 236 of file objreg.cpp. 00237 { 00238 // Delete the NodeRenderableInkDetailsList 00239 ListItem* Current = NodeRenderableInkDetailsList.GetHead(); 00240 while (Current != NULL) 00241 { 00242 ListItem* Next = NodeRenderableInkDetailsList.GetNext(Current); 00243 ((NodeRenderableInkDetailsItem*)Current)->NodeAttributeClassList.DeleteAll(); 00244 delete(NodeRenderableInkDetailsList.RemoveItem(Current)); 00245 Current = Next; 00246 } 00247 }
|
|
Definition at line 898 of file objreg.cpp. 00899 { 00900 // validate inputs. 00901 ERROR2IF(pInkClass == NULL, NULL, 00902 "ObjectRegistry::GetAttribDetails; NULL input parameter!"); 00903 00904 // Search for the required details item for the given NodeRenderableInk Class. 00905 NodeRenderableInkDetailsItem* pCurrent = NULL; 00906 pCurrent = (NodeRenderableInkDetailsItem*)NodeRenderableInkDetailsList.GetHead(); 00907 00908 while (pCurrent != NULL) 00909 { 00910 if ((pCurrent->IsABaseClass && pInkClass->IsKindOf(pCurrent->NodeRenderableInkClass)) || 00911 pCurrent->NodeRenderableInkClass == pInkClass) 00912 { 00913 return pCurrent; 00914 } 00915 00916 pCurrent = (NodeRenderableInkDetailsItem*)NodeRenderableInkDetailsList.GetNext(pCurrent); 00917 } 00918 00919 ERROR2(NULL, "ObjectRegistry::GetAttribDetails; Couldn't find details!"); 00920 }
|
|
GetRequiredAttribs returns a list of attribute classes which are required by the NodeRenderableInk class. Note that the NodeRenderableInkClass must have been registerd.
Definition at line 857 of file objreg.cpp. 00858 { 00859 // Search for the required Attrib list for the NodeRenderableInkClass 00860 NodeRenderableInkDetailsItem* Current = (NodeRenderableInkDetailsItem*) 00861 NodeRenderableInkDetailsList.GetHead(); 00862 while (Current != NULL) 00863 { 00864 if ( 00865 ((Current->IsABaseClass) && 00866 (NodeRenderableInkClass != NULL) && 00867 (NodeRenderableInkClass->IsKindOf(Current->NodeRenderableInkClass))) || 00868 (Current->NodeRenderableInkClass == NodeRenderableInkClass) 00869 ) 00870 { 00871 // The default attributes 00872 return (&(Current->NodeAttributeClassList)); 00873 } 00874 00875 Current = (NodeRenderableInkDetailsItem*) 00876 NodeRenderableInkDetailsList.GetNext(Current); 00877 } 00878 ENSURE(FALSE, "Could not find required attributes"); 00879 return NULL; 00880 }
|
|
Declares a preference that allows you to clear memory in delete().
Reimplemented from SimpleCCObject. Definition at line 532 of file objreg.cpp. 00533 { 00534 // The following attribute groups have been set up 00535 /* 00536 00537 00538 NodeBitmapDetails: All attributes which can be applied to bitmap objects. This is a 00539 subset of the Default attributes. 00540 00541 BaseTextClassDetails: All attributes which can be applied to objects derived from the 00542 BaseTextClass. The set includes all DefaultAttributes + attributes 00543 which only make sense when applied to text objects like BOLD, 00544 ITALIC etc. 00545 00546 DefaultAttributes: The attributes required by all other nodes 00547 00548 AllAttrDetails: A list of all attributes 00549 00550 */ 00551 00552 NodeAttributeClassItem* AttrClassItem; 00553 00554 NodeRenderableInkDetailsItem* NodeBitmapDetails; 00555 NodeRenderableInkDetailsItem* BaseTextClassDetails; 00556 NodeRenderableInkDetailsItem* DefaultDetails; 00557 NodeRenderableInkDetailsItem* AllAttrDetails; 00558 NodeRenderableInkDetailsItem* NodeBlenderDetails; 00559 NodeRenderableInkDetailsItem* NodeMouldPathDetails; 00560 00561 00562 00563 // ------------------------------------------------------------------------------------- 00564 // Register NodeBitmap 00565 NodeBitmapDetails = new NodeRenderableInkDetailsItem(); 00566 if (NodeBitmapDetails == NULL) 00567 { 00568 goto OutOfMemory; 00569 } 00570 NodeBitmapDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeBitmap); 00571 RegisterNodeRenderableInkDetails(NodeBitmapDetails); 00572 00573 // Audited by Will 00574 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillGeometry); 00575 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrTranspFillGeometry); 00576 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillMapping); 00577 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrTranspFillMapping); 00578 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrFillEffect); 00579 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrQuality); 00580 // LineWidth required by NodeBitmap but should always be 0, it should be applied when a 00581 // bitmap is created. 00582 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrLineWidth); 00583 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrStrokeColour); 00584 00585 //This is here so you can add HotLinks to bitmaps if you want...Graham 00586 ADD_ATTRIB_CLASS(NodeBitmapDetails, AttrWebAddress); 00587 00588 00589 // ------------------------------------------------------------------------------------- 00590 // Register NodeMouldPath, require no attributes 00591 00592 NodeMouldPathDetails = new NodeRenderableInkDetailsItem(); 00593 if (NodeMouldPathDetails == NULL) 00594 { 00595 goto OutOfMemory; 00596 } 00597 NodeMouldPathDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeMouldPath); 00598 RegisterNodeRenderableInkDetails(NodeMouldPathDetails); 00599 00600 // ------------------------------------------------------------------------------------- 00601 // Register NodeBlender, require no attributes 00602 00603 NodeBlenderDetails = new NodeRenderableInkDetailsItem(); 00604 if (NodeBlenderDetails == NULL) 00605 { 00606 goto OutOfMemory; 00607 } 00608 NodeBlenderDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeBlender); 00609 RegisterNodeRenderableInkDetails(NodeBlenderDetails); 00610 00611 // ------------------------------------------------------------------------------------- 00612 // Register ShadowDetails attributes required by NodeShadow 00613 00614 if (!RegisterShadowDetails()) 00615 goto OutOfMemory; 00616 00617 // ------------------------------------------------------------------------------------- 00618 // Register BaseTextClass 00619 BaseTextClassDetails = new NodeRenderableInkDetailsItem(); 00620 if (BaseTextClassDetails == NULL) 00621 { 00622 goto OutOfMemory; 00623 } 00624 00625 BaseTextClassDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(BaseTextClass); 00626 BaseTextClassDetails->IsABaseClass = TRUE; 00627 RegisterNodeRenderableInkDetails(BaseTextClassDetails); 00628 00629 // All Nodes (except kerns) Derived from BaseTextClass require all the default attributes 00630 // plus attributes which only make sense when applied to text nodes 00631 00632 // Proper default attribute list (audited by Will) 00633 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillGeometry); 00634 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTranspFillGeometry); 00635 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillMapping); 00636 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTranspFillMapping); 00637 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrFillEffect); 00638 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrQuality); 00639 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrLineWidth); 00640 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStrokeColour); 00641 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStrokeTransp); 00642 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStartArrow); 00643 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrEndArrow); 00644 //ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrEndCap); // RIP 00645 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStartCap); 00646 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrJoinType); 00647 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrMitreLimit); 00648 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrUser); 00649 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrWebAddress); 00650 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrWindingRule); 00651 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrDashPattern); 00652 //ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrMould); // RIP 00653 00654 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtFontTypeface); 00655 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtBold); 00656 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtItalic); 00657 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtUnderline); 00658 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtAspectRatio); 00659 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtJustification); 00660 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtTracking); 00661 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtFontSize); 00662 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtBaseLine); 00663 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtScript); 00664 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtLineSpace); 00665 00666 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtLeftMargin); 00667 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtRightMargin); 00668 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtFirstIndent); 00669 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrTxtRuler); 00670 00671 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrOverprintLine); 00672 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrOverprintFill); 00673 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrPrintOnAllPlates); 00674 00675 #ifdef VECTOR_STROKING // Neville 6/8/97 00676 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrStrokeType); 00677 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrVariableWidth); 00678 #endif // VECTOR_STROKING 00679 ADD_ATTRIB_CLASS(BaseTextClassDetails, AttrBrushType); 00680 00681 // ------------------------------------------------------------------------------------- 00682 // Register DefaultDetails 00683 00684 DefaultDetails = new NodeRenderableInkDetailsItem(); 00685 if (DefaultDetails == NULL) 00686 { 00687 goto OutOfMemory; 00688 } 00689 DefaultDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeRenderableInk); 00690 DefaultDetails->IsABaseClass = TRUE; 00691 RegisterNodeRenderableInkDetails(DefaultDetails); 00692 00693 // Proper default attribute list (audited by Will) 00694 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillGeometry); 00695 ADD_ATTRIB_CLASS(DefaultDetails, AttrTranspFillGeometry); 00696 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillMapping); 00697 ADD_ATTRIB_CLASS(DefaultDetails, AttrTranspFillMapping); 00698 ADD_ATTRIB_CLASS(DefaultDetails, AttrFillEffect); 00699 ADD_ATTRIB_CLASS(DefaultDetails, AttrQuality); 00700 ADD_ATTRIB_CLASS(DefaultDetails, AttrLineWidth); 00701 ADD_ATTRIB_CLASS(DefaultDetails, AttrStrokeColour); 00702 ADD_ATTRIB_CLASS(DefaultDetails, AttrStrokeTransp); 00703 ADD_ATTRIB_CLASS(DefaultDetails, AttrStartArrow); 00704 ADD_ATTRIB_CLASS(DefaultDetails, AttrEndArrow); 00705 //ADD_ATTRIB_CLASS(DefaultDetails, AttrEndCap); // RIP 00706 ADD_ATTRIB_CLASS(DefaultDetails, AttrStartCap); 00707 ADD_ATTRIB_CLASS(DefaultDetails, AttrJoinType); 00708 ADD_ATTRIB_CLASS(DefaultDetails, AttrMitreLimit); 00709 ADD_ATTRIB_CLASS(DefaultDetails, AttrUser); 00710 ADD_ATTRIB_CLASS(DefaultDetails, AttrWebAddress); 00711 ADD_ATTRIB_CLASS(DefaultDetails, AttrWindingRule); 00712 ADD_ATTRIB_CLASS(DefaultDetails, AttrDashPattern); 00713 //ADD_ATTRIB_CLASS(DefaultDetails, AttrMould); // RIP 00714 00715 ADD_ATTRIB_CLASS(DefaultDetails, AttrOverprintLine); 00716 ADD_ATTRIB_CLASS(DefaultDetails, AttrOverprintFill); 00717 ADD_ATTRIB_CLASS(DefaultDetails, AttrPrintOnAllPlates); 00718 00719 #ifdef VECTOR_STROKING // Neville 6/8/97 00720 ADD_ATTRIB_CLASS(DefaultDetails, AttrStrokeType); 00721 ADD_ATTRIB_CLASS(DefaultDetails, AttrVariableWidth); 00722 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelIndent); 00723 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelLightAngle); 00724 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelContrast); 00725 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelType); 00726 ADD_ATTRIB_CLASS(DefaultDetails, AttrBevelLightTilt); 00727 #endif // VECTOR_STROKING 00728 ADD_ATTRIB_CLASS(DefaultDetails, AttrBrushType); 00729 ADD_ATTRIB_CLASS(DefaultDetails, AttrFeather); 00730 00731 // ------------------------------------------------------------------------------------- 00732 // Register AllAttrDetails attributes required by compound nodes (all attributes) 00733 00734 AllAttrDetails = new NodeRenderableInkDetailsItem(); 00735 if (AllAttrDetails == NULL) 00736 { 00737 goto OutOfMemory; 00738 } 00739 00740 AllAttrDetails->NodeRenderableInkClass = 0; // Has no class 00741 RegisterNodeRenderableInkDetails(AllAttrDetails); 00742 00743 // Add all attributes in here 00744 // Proper default attribute list (audited by Will) 00745 ADD_ATTRIB_CLASS(AllAttrDetails, AttrFillGeometry); 00746 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTranspFillGeometry); 00747 ADD_ATTRIB_CLASS(AllAttrDetails, AttrFillMapping); 00748 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTranspFillMapping); 00749 ADD_ATTRIB_CLASS(AllAttrDetails, AttrFillEffect); 00750 ADD_ATTRIB_CLASS(AllAttrDetails, AttrQuality); 00751 ADD_ATTRIB_CLASS(AllAttrDetails, AttrLineWidth); 00752 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStrokeColour); 00753 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStrokeTransp); 00754 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStartArrow); 00755 ADD_ATTRIB_CLASS(AllAttrDetails, AttrEndArrow); 00756 //ADD_ATTRIB_CLASS(AllAttrDetails, AttrEndCap); // RIP 00757 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStartCap); 00758 ADD_ATTRIB_CLASS(AllAttrDetails, AttrJoinType); 00759 ADD_ATTRIB_CLASS(AllAttrDetails, AttrMitreLimit); 00760 ADD_ATTRIB_CLASS(AllAttrDetails, AttrUser); 00761 ADD_ATTRIB_CLASS(AllAttrDetails, AttrWebAddress); 00762 ADD_ATTRIB_CLASS(AllAttrDetails, AttrWindingRule); 00763 ADD_ATTRIB_CLASS(AllAttrDetails, AttrDashPattern); 00764 //ADD_ATTRIB_CLASS(AllAttrDetails, AttrMould); // RIP 00765 00766 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtFontTypeface); 00767 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtBold); 00768 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtItalic); 00769 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtUnderline); 00770 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtAspectRatio); 00771 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtJustification); 00772 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtTracking); 00773 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtFontSize); 00774 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtBaseLine); 00775 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtScript); 00776 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtLineSpace); 00777 00778 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtLeftMargin); 00779 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtRightMargin); 00780 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtFirstIndent); 00781 ADD_ATTRIB_CLASS(AllAttrDetails, AttrTxtRuler); 00782 00783 ADD_ATTRIB_CLASS(AllAttrDetails, AttrOverprintLine); 00784 ADD_ATTRIB_CLASS(AllAttrDetails, AttrOverprintFill); 00785 ADD_ATTRIB_CLASS(AllAttrDetails, AttrPrintOnAllPlates); 00786 00787 #ifdef VECTOR_STROKING // Neville 6/8/97 00788 ADD_ATTRIB_CLASS(AllAttrDetails, AttrStrokeType); 00789 ADD_ATTRIB_CLASS(AllAttrDetails, AttrVariableWidth); 00790 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelIndent); 00791 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelLightAngle); 00792 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelContrast); 00793 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelType); 00794 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBevelLightTilt); 00795 #endif // VECTOR_STROKING 00796 ADD_ATTRIB_CLASS(AllAttrDetails, AttrBrushType); 00797 ADD_ATTRIB_CLASS(AllAttrDetails, AttrFeather); 00798 00799 return (TRUE); 00800 00801 OutOfMemory: 00802 return (FALSE); // Failed to initialise. 00803 }
|
|
RegisterNodeRenderableInkDetails can be called to register extra NodeRenderableInkNodes if they get added in new tools. This must be done at startup.
Definition at line 824 of file objreg.cpp. 00825 { 00826 // Simply add the item 00827 NodeRenderableInkDetailsList.AddTail(ReqdAttribItem); 00828 return; 00829 }
|
|
Register required attribute details for shadows.
Definition at line 936 of file objreg.cpp. 00937 { 00938 NodeRenderableInkDetailsItem* pShadowDetails = new NodeRenderableInkDetailsItem(); 00939 BOOL ok = (pShadowDetails != NULL); 00940 if (ok) 00941 { 00942 pShadowDetails->NodeRenderableInkClass = CC_RUNTIME_CLASS(NodeShadow); 00943 RegisterNodeRenderableInkDetails(pShadowDetails); 00944 } 00945 00946 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrFillGeometry )); 00947 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrFillMapping )); 00948 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrFillEffect )); 00949 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrUser )); 00950 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrWebAddress )); 00951 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrOverprintLine )); 00952 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrOverprintFill )); 00953 if (ok) ok = pShadowDetails->AddAttribClass( CC_RUNTIME_CLASS( AttrPrintOnAllPlates )); 00954 00955 return ok; 00956 }
|
|
|