StartCapAttribute Class Reference

Attribute for start cap style of paths. More...

#include <attrval.h>

Inheritance diagram for StartCapAttribute:

AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 StartCapAttribute ()
virtual void Restore (RenderRegion *, BOOL)
virtual void Render (RenderRegion *, BOOL Temp=FALSE)
virtual void SimpleCopy (AttributeValue *)
virtual NodeAttributeMakeNode ()
 Used when restoring attributes from the render region's context stack.Used when a render region needs to change a particular rendering attribute.This function provides a way of copying the contents of an AttributeValue derived class to another. It is assumed that the source object is the same class as the destination object. The data from the object pointed to by pAttr is copied into this object. This is primarily used when cloning render regions - the context stack must be copied, and if it points to any temporary objects, then they must be copied too, to avoid multiple deletion errors. Given an AttributeValue object, construct the appropriate NodeAttribute object which can be put into a document tree. This should be over-ridden for all derived AttributeValue classes, except those that cannot be put into the document tree (e.g. DrawingModeAttribute). The base class version (i.e. this one) will always ENSURE because it should not be called.
virtual BOOL IsDifferent (AttributeValue *)
 Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality.

Static Public Member Functions

static BOOL Init ()
 Declares a preference that allows you to clear memory in delete().

Public Attributes

LineCapType StartCap

Detailed Description

Attribute for start cap style of paths.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/94
See also:
FillColourAttribute; StrokeColourAttribute; LineWidthAttribute; StartArrowAttribute; EndArrowAttribute; EndCapAttribute; JoinTypeAttribute; MitreLimitAttribute; WindingRuleAttribute; DashPatternAttribute

Definition at line 297 of file attrval.h.


Constructor & Destructor Documentation

StartCapAttribute::StartCapAttribute  ) 
 

Definition at line 1868 of file attr.cpp.

01869 {
01870     // Default to butt line caps (because ArtWorks does).
01871     StartCap = LineCapButt;
01872 }


Member Function Documentation

BOOL StartCapAttribute::Init void   )  [static]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

Definition at line 1908 of file attr.cpp.

01909 {
01910     StartCapAttribute *pAttr = new StartCapAttribute;
01911     if (pAttr == NULL)
01912         return FALSE;
01913 
01914     // Default to butt line caps (because ArtWorks does).
01915     pAttr->StartCap = LineCapButt;
01916 
01917     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 
01918                                                          pAttr);
01919     if (ID == ATTR_BAD_ID)
01920         return FALSE;
01921     ENSURE(ID == ATTR_STARTCAP, "Incorrect ID for attribute!");
01922     return TRUE;
01923 }

BOOL StartCapAttribute::IsDifferent AttributeValue pAttr  )  [virtual]
 

Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the attribute to compare against this one. [INPUTS]
Returns:
TRUE if objects represent different attributes (e.g. one is red and the other is blue); FALSE otherwise (i.e. they represent the same attribute, e.g. both represent 0.25pt lines).
See also:
AttributeManager::ApplyBasedOnDefaults

Reimplemented from AttributeValue.

Definition at line 1874 of file attr.cpp.

01875 {
01876     ENSURE(GetRuntimeClass() == pAttr->GetRuntimeClass(), 
01877            "Different attribute types in AttributeValue::IsDifferent()");
01878     return ((StartCapAttribute *) pAttr)->StartCap != StartCap;
01879 }

NodeAttribute * StartCapAttribute::MakeNode  )  [virtual]
 

Used when restoring attributes from the render region's context stack.Used when a render region needs to change a particular rendering attribute.This function provides a way of copying the contents of an AttributeValue derived class to another. It is assumed that the source object is the same class as the destination object. The data from the object pointed to by pAttr is copied into this object. This is primarily used when cloning render regions - the context stack must be copied, and if it points to any temporary objects, then they must be copied too, to avoid multiple deletion errors. Given an AttributeValue object, construct the appropriate NodeAttribute object which can be put into a document tree. This should be over-ridden for all derived AttributeValue classes, except those that cannot be put into the document tree (e.g. DrawingModeAttribute). The base class version (i.e. this one) will always ENSURE because it should not be called.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/04/94
Returns:
Pointer to NodeAttribute object, or NULL if out of memory.

Errors: Out of memory.

See also:
NodeAttribute

Reimplemented from AttributeValue.

Definition at line 1896 of file attr.cpp.

01897 {
01898     // Create new attribute node
01899     AttrStartCap *pAttr = new AttrStartCap;
01900 
01901     // Copy attribute value into the new node.
01902     pAttr->Value.SimpleCopy(this);
01903 
01904     // Return the new node
01905     return pAttr;
01906 }

void StartCapAttribute::Render RenderRegion ,
BOOL  Temp = FALSE
[virtual]
 

Implements AttributeValue.

Definition at line 1886 of file attr.cpp.

01887 {
01888     pRegion->SetStartCap(this, Temp);
01889 }

void StartCapAttribute::Restore RenderRegion ,
BOOL 
[virtual]
 

Implements AttributeValue.

Definition at line 1881 of file attr.cpp.

01882 {
01883     pRegion->RestoreStartCap(this, Temp);
01884 }

void StartCapAttribute::SimpleCopy AttributeValue  )  [virtual]
 

Implements AttributeValue.

Definition at line 1891 of file attr.cpp.

01892 {
01893     StartCap = ((StartCapAttribute *) pValue)->StartCap;
01894 }


Member Data Documentation

LineCapType StartCapAttribute::StartCap
 

Definition at line 310 of file attrval.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:01:25 2007 for Camelot by  doxygen 1.4.4