AttrTxtAspectRatio Class Reference

AttrTxtAspectRatio specifies the aspect ratio of text. More...

#include <txtattr.h>

Inheritance diagram for AttrTxtAspectRatio:

AttrTxtBase NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrTxtAspectRatio ()
 Default constructor for AttrTxtAspectRatio class.
 AttrTxtAspectRatio (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a AttrTxtAspectRatio Attribute.
void Render (RenderRegion *pRender)
 'Renders' a Line Width attribute.
NodeSimpleCopy ()
 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 INT32 operator== (const NodeAttribute &NodeAttrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual UINT32 GetAttrNameID (void)
 Returns back a string resource ID describing the attribute.
virtual AttrIndex GetAttributeIndex ()
void GetDebugDetails (StringBase *Str)
 Used for debugging purposes during developement. Override in your own class and output suitable debugging details.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual AttributeValueGetAttributeValue ()
virtual void BaseLineRelativeTransform (FIXED16 Scale, FIXED16 Aspect)
 Transform the attribute using the baseline relative scale and aspect.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Saves the text aspect ratio attribute to the new file format filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)

Public Attributes

TxtAspectRatioAttribute Value

Private Member Functions

void CopyNodeContents (AttrTxtAspectRatio *NodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.

Detailed Description

AttrTxtAspectRatio specifies the aspect ratio of text.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/03/95

Definition at line 1070 of file txtattr.h.


Constructor & Destructor Documentation

AttrTxtAspectRatio::AttrTxtAspectRatio  ) 
 

Default constructor for AttrTxtAspectRatio class.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95

Definition at line 5295 of file txtattr.cpp.

05296 {
05297 }

AttrTxtAspectRatio::AttrTxtAspectRatio Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
 

Creates a AttrTxtAspectRatio Attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95

Definition at line 5275 of file txtattr.cpp.

05281              : AttrTxtBase(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
05282 {                         
05283 } 


Member Function Documentation

void AttrTxtAspectRatio::BaseLineRelativeTransform FIXED16  Scale,
FIXED16  Aspect
[virtual]
 

Transform the attribute using the baseline relative scale and aspect.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/6/95
Parameters:
Scale - [INPUTS] Aspect -

Reimplemented from AttrTxtBase.

Definition at line 5492 of file txtattr.cpp.

05493 {
05494     TxtAspectRatioAttribute* pAspectRatioAttrVal=(TxtAspectRatioAttribute*)GetAttributeValue();
05495     pAspectRatioAttrVal->AspectRatio = pAspectRatioAttrVal->AspectRatio * Aspect;
05496 }

void AttrTxtAspectRatio::CopyNodeContents AttrTxtAspectRatio NodeCopy  )  [private]
 

This method copies the node's contents to the node pointed to by NodeCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
[INPUTS] 
A copy of this node [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL
Scope: protected

Definition at line 5402 of file txtattr.cpp.

05403 {
05404     // Let the base class do its bit
05405     AttrTxtBase::CopyNodeContents( NodeCopy );
05406     
05407     //Copy contents specific to derived class here
05408     NodeCopy->Value.AspectRatio = Value.AspectRatio;
05409 } 

virtual AttrIndex AttrTxtAspectRatio::GetAttributeIndex  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1092 of file txtattr.h.

01092 { return ATTR_TXTASPECTRATIO; }

virtual AttributeValue* AttrTxtAspectRatio::GetAttributeValue  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1100 of file txtattr.h.

01100 { return &Value; }

UINT32 AttrTxtAspectRatio::GetAttrNameID void   )  [virtual]
 

Returns back a string resource ID describing the attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/2/94
Returns:
Attribute description ID

Reimplemented from NodeAttribute.

Definition at line 5379 of file txtattr.cpp.

05380 {
05381     return (_R(IDS_ASPECTRATIO)); 
05382 }  

void AttrTxtAspectRatio::GetDebugDetails StringBase Str  )  [virtual]
 

Used for debugging purposes during developement. Override in your own class and output suitable debugging details.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/04/94
Parameters:
- [INPUTS]

Reimplemented from NodeRenderable.

Definition at line 5468 of file txtattr.cpp.

05469 {
05470 #if DEBUG_TREE
05471     NodeAttribute::GetDebugDetails( Str );
05472 
05473     String_256          TempStr;
05474     TCHAR               floatStr[20];
05475     camSnprintf( floatStr, 20, _T("%f"), Value.AspectRatio.MakeDouble() );
05476     TempStr._MakeMsg( TEXT("\r\nAspect ratio :\t#1%s\r\n"), floatStr);
05477     (*Str) += TempStr;
05478 #endif
05479 }

UINT32 AttrTxtAspectRatio::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from Node.

Definition at line 5450 of file txtattr.cpp.

05451 {     
05452     return (sizeof(AttrTxtAspectRatio)); 
05453 }

INT32 AttrTxtAspectRatio::operator== const NodeAttribute Attrib  )  [virtual]
 

A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
Atrib,: The attribute to compare, which must be an AttrLineWidth [INPUTS]
Returns:
Errors: An ENSURE failure will occur if Attrib does not have a AttrTxtAspectRatio runtime class.
See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 5359 of file txtattr.cpp.

05360 {
05361     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrTxtAspectRatio)), 
05362         "Trying to compare two objects with different types"); 
05363     AttrTxtAspectRatio* Attr = (AttrTxtAspectRatio*) &Attrib;
05364     return (Attr->Value.AspectRatio == Value.AspectRatio); 
05365 } 

void AttrTxtAspectRatio::PolyCopyNodeContents NodeRenderable pNodeCopy  )  [virtual]
 

Polymorphically copies the contents of this node to another.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/2003
Parameters:
- [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Reimplemented from NodeRenderable.

Definition at line 5424 of file txtattr.cpp.

05425 {
05426     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
05427     ENSURE(IS_A(pNodeCopy, AttrTxtAspectRatio), "PolyCopyNodeContents given wrong dest node type");
05428 
05429     if (IS_A(pNodeCopy, AttrTxtAspectRatio))
05430         CopyNodeContents((AttrTxtAspectRatio*)pNodeCopy);
05431 }

void AttrTxtAspectRatio::Render RenderRegion pRegion  )  [virtual]
 

'Renders' a Line Width attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95

Reimplemented from NodeAttribute.

Definition at line 5310 of file txtattr.cpp.

05311 {
05312     pRegion->SetTxtAspectRatio(&Value, FALSE);
05313 }

Node * AttrTxtAspectRatio::SimpleCopy void   )  [virtual]
 

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.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
A copy of the node, or NULL if memory runs out

Errors: If memory runs out when trying to copy, then ERROR is called with an out of memory error and the function returns NULL.

Scope: protected

Reimplemented from NodeAttribute.

Definition at line 5334 of file txtattr.cpp.

05335 {
05336     AttrTxtAspectRatio* NodeCopy = new AttrTxtAspectRatio();
05337     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
05338     CopyNodeContents(NodeCopy);
05339     return NodeCopy;
05340 } 

BOOL AttrTxtAspectRatio::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 5522 of file txtattr.cpp.

05523 {
05524 #ifdef DO_EXPORT
05525     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
05526 
05527     return CXaraFileTxtAspectRatio::WritePreChildrenNative(pFilter, this);
05528 #else
05529     return FALSE;
05530 #endif
05531 }

BOOL AttrTxtAspectRatio::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Saves the text aspect ratio attribute to the new file format filter.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96
Parameters:
pFilter - new camelot filter to save to [INPUTS]
Returns:
TRUE if successful, FALSE otherwise

Reimplemented from Node.

Definition at line 5511 of file txtattr.cpp.

05512 {
05513 #ifdef DO_EXPORT
05514     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
05515 
05516     return CXaraFileTxtAspectRatio::WritePreChildrenWeb(pFilter, this);
05517 #else
05518     return FALSE;
05519 #endif
05520 }


Member Data Documentation

TxtAspectRatioAttribute AttrTxtAspectRatio::Value
 

Definition at line 1114 of file txtattr.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:50:39 2007 for Camelot by  doxygen 1.4.4