#include <strkattr.h>
Inheritance diagram for AttrVariableWidth:
Public Member Functions | |
AttrVariableWidth () | |
Default constructor for AttrVariableWidth. | |
AttrVariableWidth (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
Constructs an AttrVariableWidth Attribute. | |
virtual void | Render (RenderRegion *pRender) |
Renders this attribute (by simply calling the Render function of its contained AttributeValue). | |
virtual void | CopyNodeContents (AttrVariableWidth *NodeCopy) |
Copies the node's contents to the node pointed to by NodeCopy. | |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
virtual INT32 | operator== (const NodeAttribute &NodeAttrib) |
Comparison operator - determines if the AttributeValues of both objects are ==. | |
virtual Node * | SimpleCopy () |
This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes. | |
virtual UINT32 | GetAttrNameID (void) |
Retrieves a string resource ID describing this attribute. | |
virtual AttrIndex | GetAttributeIndex () |
virtual void | GetDebugDetails (StringBase *Str) |
Produces debug details about this node. | |
virtual UINT32 | GetNodeSize () const |
For finding the size of the node, in bytes. | |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *pFilter) |
Writes out a record that represents the node, to either Native or Web file format. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *pFilter) |
virtual AttributeValue * | GetAttributeValue () |
BOOL | DoBecomeA (BecomeA *pBecomeA, Node *pParent) |
BOOL | HasActiveValueFunction () |
To find out if this attribute is actually going to do anything or not. | |
Protected Attributes | |
VariableWidthAttrValue | Value |
Friends | |
class | PathProcessorStroke |
Definition at line 326 of file strkattr.h.
|
Default constructor for AttrVariableWidth.
Definition at line 1028 of file strkattr.cpp.
|
|
Constructs an AttrVariableWidth Attribute.
Definition at line 1049 of file strkattr.cpp. 01055 : NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected) 01056 { 01057 }
|
|
Copies the node's contents to the node pointed to by NodeCopy.
Definition at line 1093 of file strkattr.cpp. 01094 { 01095 // Let the base class do its bit 01096 NodeAttribute::CopyNodeContents(NodeCopy); 01097 01098 // And then copy our Value 01099 *(NodeCopy->GetAttributeValue()) = *(GetAttributeValue()); 01100 }
|
|
|
|
Reimplemented from NodeAttribute. Definition at line 348 of file strkattr.h. 00348 { return ATTR_VARWIDTH; }
|
|
Reimplemented from NodeAttribute. Definition at line 355 of file strkattr.h. 00355 { return(&Value); };
|
|
Retrieves a string resource ID describing this attribute.
Reimplemented from NodeAttribute. Definition at line 1201 of file strkattr.cpp. 01202 { 01203 return(_R(IDS_ATTRVARWIDTH)); 01204 }
|
|
Produces debug details about this node.
Reimplemented from NodeRenderable. Definition at line 1221 of file strkattr.cpp. 01222 { 01223 #ifdef _DEBUG 01224 NodeAttribute::GetDebugDetails(Str); 01225 01226 String_256 TempStr; 01227 TempStr._MakeMsg( _T("\r\nVariable width of type:\r\n") ); 01228 *Str += TempStr; 01229 01230 if (Value.GetWidthFunction() != NULL) 01231 { 01232 TempStr._MakeMsg( _T(" #1%s\r\n"), 01233 Value.GetWidthFunction()->GetRuntimeClass()->GetClassName() ); 01234 } 01235 else 01236 TempStr._MakeMsg( _T(" old-style constant width\r\n") ); 01237 01238 *Str += TempStr; 01239 #endif 01240 }
|
|
For finding the size of the node, in bytes.
Reimplemented from Node. Definition at line 1257 of file strkattr.cpp. 01258 { 01259 return(sizeof(AttrVariableWidth)); 01260 }
|
|
To find out if this attribute is actually going to do anything or not.
Definition at line 1277 of file strkattr.cpp. 01278 { 01279 return (Value.GetWidthFunction() != NULL); 01280 }
|
|
Comparison operator - determines if the AttributeValues of both objects are ==.
Reimplemented from NodeAttribute. Definition at line 1141 of file strkattr.cpp. 01142 { 01143 // First check they are of the same type 01144 if (((NodeAttribute*)&NodeAttrib)->GetAttributeType() != GetAttributeType()) 01145 return FALSE; 01146 01147 // Make a more sensible pointer 01148 AttrVariableWidth *Attr = (AttrVariableWidth *) &NodeAttrib; 01149 01150 // Now let the AttributeValues compare themselves 01151 return( *((VariableWidthAttrValue *) Attr->GetAttributeValue()) == 01152 *((VariableWidthAttrValue *) GetAttributeValue()) ); 01153 }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderable. Definition at line 1116 of file strkattr.cpp. 01117 { 01118 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 01119 ENSURE(IS_A(pNodeCopy, AttrVariableWidth), "PolyCopyNodeContents given wrong dest node type"); 01120 01121 if (IS_A(pNodeCopy, AttrVariableWidth)) 01122 CopyNodeContents((AttrVariableWidth*)pNodeCopy); 01123 }
|
|
Renders this attribute (by simply calling the Render function of its contained AttributeValue).
Reimplemented from NodeAttribute. Definition at line 1073 of file strkattr.cpp. 01074 { 01075 GetAttributeValue()->Render(pRender); 01076 }
|
|
This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
Reimplemented from NodeAttribute. Definition at line 1171 of file strkattr.cpp. 01172 { 01173 AttrVariableWidth* NodeCopy = new AttrVariableWidth; 01174 if (NodeCopy == NULL) 01175 return(NULL); 01176 01177 // Call the base class 01178 NodeAttribute::CopyNodeContents(NodeCopy); 01179 01180 // And call our AttributeValue to copy itself too 01181 NodeCopy->GetAttributeValue()->SimpleCopy(GetAttributeValue()); 01182 01183 return(NodeCopy); 01184 }
|
|
Reimplemented from Node. Definition at line 1319 of file strkattr.cpp. 01320 { 01321 #ifdef DO_EXPORT 01322 ERROR3IF(pFilter == NULL, "Illegal NULL param"); 01323 01324 BOOL ok = TRUE; 01325 VariableWidthID PredefinedFunctionID = Value.GetWidthFunctionID(); 01326 01327 if (PredefinedFunctionID == VarWidth_NotPredefined) 01328 { 01329 ValueFunction *pFunction = Value.GetWidthFunction(); 01330 if (pFunction != NULL) 01331 { 01332 CamelotFileRecord *pRec = pFunction->WriteFileRecord(TAG_VARIABLEWIDTHTABLE, 0, pFilter); 01333 if (pRec != NULL) 01334 { 01335 pFilter->Write(pRec); 01336 delete pRec; 01337 pRec = NULL; 01338 } 01339 else 01340 ok = FALSE; 01341 } 01342 else 01343 { 01344 // The default attribute (for simple old-style lines) has no ValueFunction 01345 CamelotFileRecord Rec(pFilter, TAG_VARIABLEWIDTHFUNC, TAG_VARIABLEWIDTHFUNC_SIZE); 01346 if (ok) ok = Rec.Init(); 01347 if (ok) ok = Rec.WriteUINT32((UINT32) 0); 01348 if (ok) ok = pFilter->Write(&Rec); 01349 } 01350 } 01351 else 01352 { 01353 CamelotFileRecord Rec(pFilter, TAG_VARIABLEWIDTHFUNC, TAG_VARIABLEWIDTHFUNC_SIZE); 01354 01355 if (ok) ok = Rec.Init(); 01356 if (ok) ok = Rec.WriteUINT32((UINT32) PredefinedFunctionID); 01357 if (ok) ok = pFilter->Write(&Rec); 01358 } 01359 01360 if (!ok) 01361 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 01362 01363 return(ok); 01364 #else 01365 return FALSE; 01366 #endif 01367 }
|
|
Writes out a record that represents the node, to either Native or Web file format.
If the AttrVariableWidth writes out a record successfully to the file, it will return TRUE. If the AttrVariableWidth chooses not to write itself to the filter (e.g. because it is not appropriate for this filter), then this function will return FALSE. Notes: Simple
Reimplemented from Node. Definition at line 1314 of file strkattr.cpp. 01315 { 01316 return(WritePreChildrenNative(pFilter)); 01317 }
|
|
Definition at line 331 of file strkattr.h. |
|
Definition at line 361 of file strkattr.h. |