StrokeColourAttribute Class Reference

Represent a colour for a stroke, as opposed to a fill. Implementation is very similar (identical!) to the FillColourAttribute class. More...

#include <fillval.h>

Inheritance diagram for StrokeColourAttribute:

ColourFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 StrokeColourAttribute ()
 StrokeColourAttribute (DocColour &NewColour)
 Sets the line colour for this attribute.
virtual NodeAttributeMakeNode ()
 Make a AttrStrokeColour node from this fill colour attribute.
virtual void Restore (RenderRegion *, BOOL)
 Restores the line colour attribute for the given render region. i.e. all lines drawn will now be drawn in this colour.
virtual void Render (RenderRegion *, BOOL Temp=FALSE)
 Sets the line colour attribute for the given render region. i.e. all lines drawn will now be drawn in this colour.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.

Static Public Member Functions

static BOOL Init ()
 Registers line colour attribute, and provides a default attribute to give black lines.

Detailed Description

Represent a colour for a stroke, as opposed to a fill. Implementation is very similar (identical!) to the FillColourAttribute class.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/06/94
See also:
AttributeValue

Definition at line 1861 of file fillval.h.


Constructor & Destructor Documentation

StrokeColourAttribute::StrokeColourAttribute  )  [inline]
 

Definition at line 1865 of file fillval.h.

01865 {}

StrokeColourAttribute::StrokeColourAttribute DocColour NewCol  ) 
 

Sets the line colour for this attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/02/94
Parameters:
NewCol - the new stroke colour [INPUTS]

Definition at line 8583 of file fillval.cpp.

08584 {
08585     SetStartColour(&NewCol);
08586 }


Member Function Documentation

BOOL StrokeColourAttribute::Init void   )  [static]
 

Registers line colour attribute, and provides a default attribute to give black lines.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/04/94
Returns:
TRUE - initialised ok; FALSE if not.

Errors: Out of memory.

See also:
AttributeManager

Reimplemented from ColourFillAttribute.

Definition at line 8688 of file fillval.cpp.

08689 {
08690     // Default to black lines
08691     StrokeColourAttribute *pAttr = new StrokeColourAttribute;
08692     if (pAttr == NULL)
08693         return FALSE;
08694 
08695     AttributeManager::FindDefaultColour( ColourManager::GetCurrentColourList(),
08696                                         _R(IDS_BLACKNAME), &pAttr->Colour );
08697 
08698 //  pAttr->Colour = AttributeManager::DefaultBlack;
08699     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 
08700                                                          pAttr);
08701     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising StrokeColourAttribute");
08702     ERROR2IF(ID != ATTR_STROKECOLOUR, FALSE, "Incorrect ID for StrokeColourAttribute");
08703 
08704     return TRUE;
08705 }

NodeAttribute * StrokeColourAttribute::MakeNode  )  [virtual]
 

Make a AttrStrokeColour node from this fill colour attribute.

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

Errors: Out of memory

See also:
AttributeValue::MakeNode

Reimplemented from AttributeValue.

Definition at line 8643 of file fillval.cpp.

08644 {
08645     // Create new attribute node
08646     AttrStrokeColour *pAttr = new AttrStrokeColour();
08647 
08648     // Copy attribute value into the new node.
08649     pAttr->Value.SimpleCopy(this);
08650 
08651     // Return the new node
08652     return pAttr;
08653 }

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

Sets the line colour attribute for the given render region. i.e. all lines drawn will now be drawn in this colour.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/02/94
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
StrokeColourAttribute; RenderStack; AttributeValue; NodeAttribute; StrokeColourAttribute::Restore; StrokeColourAttribute::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from ColourFillAttribute.

Definition at line 8603 of file fillval.cpp.

08604 {
08605     pRegion->SetLineColour(this, Temp);
08606 }

void StrokeColourAttribute::Restore RenderRegion pRegion,
BOOL  Temp
[virtual]
 

Restores the line colour attribute for the given render region. i.e. all lines drawn will now be drawn in this colour.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/02/94
Parameters:
pRegion - the render region to restore the attribute into. [INPUTS] Temp - TRUE if this is a temporary attribute, FALSE if it is permanent (e.g. it's in a document tree).
See also:
StrokeColourAttribute; RenderStack; AttributeValue; NodeAttribute; StrokeColourAttribute::Render; StrokeColourAttribute::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from ColourFillAttribute.

Definition at line 8625 of file fillval.cpp.

08626 {
08627     pRegion->RestoreLineColour(this, Temp);
08628 }

void StrokeColourAttribute::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/02/94
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]
See also:
FillColourAttribute; RenderStack; AttributeValue; NodeAttribute; FillColourAttribute::Render; FillColourAttribute::Restore; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from FillGeometryAttribute.

Definition at line 8669 of file fillval.cpp.

08670 {
08671     Colour = ((StrokeColourAttribute *) pValue)->Colour;
08672 }


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