TxtAspectRatioAttribute Class Reference

This text attribute specifies the aspect ratio of characters. More...

#include <txtattr.h>

Inheritance diagram for TxtAspectRatioAttribute:

TxtBaseClassAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 TxtAspectRatioAttribute ()
 Default Constuctor for TxtAspectRatioAttribute A zero aspect ratio is set.
 TxtAspectRatioAttribute (FIXED16 aspect)
 TxtAspectRatioAttribute constructor.
virtual void Restore (RenderRegion *, BOOL)
 Restores the TxtAspectRatioAttribute attribute for the given render region.
virtual void Render (RenderRegion *pRegion, BOOL Temp=FALSE)
 Sets the TxtFontTypeface attribute for the given render region.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual NodeAttributeMakeNode ()
 Make a AttrTextFontTypeface node, see base class.
BOOL IsDifferent (AttributeValue *pAttr)
 See base class version.
virtual TxtAspectRatioAttributeoperator= (TxtAspectRatioAttribute &Attrib)
 Make the Attribute the same as the other.
INT32 operator== (const TxtAspectRatioAttribute &Attrib)
 Comparison operator. See NodeAttribute::operator== for a description of why it's required.

Static Public Member Functions

static BOOL Init ()
 Registers default attribute.

Public Attributes

FIXED16 AspectRatio

Detailed Description

This text attribute specifies the aspect ratio of characters.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
See also:
-

Definition at line 444 of file txtattr.h.


Constructor & Destructor Documentation

TxtAspectRatioAttribute::TxtAspectRatioAttribute  ) 
 

Default Constuctor for TxtAspectRatioAttribute A zero aspect ratio is set.

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

Definition at line 1318 of file txtattr.cpp.

01319 {
01320     AspectRatio = 1;
01321 } 

TxtAspectRatioAttribute::TxtAspectRatioAttribute FIXED16  aspect  ) 
 

TxtAspectRatioAttribute constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
Parameters:
aspectRatio,: The aspectRatio value [INPUTS]

Definition at line 1335 of file txtattr.cpp.

01336 { 
01337     AspectRatio = aspect; 
01338 }


Member Function Documentation

BOOL TxtAspectRatioAttribute::Init void   )  [static]
 

Registers default attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
TRUE - initialised ok; FALSE if not.

Errors: Out of memory.

See also:
AttributeManager

Reimplemented from SimpleCCObject.

Definition at line 1471 of file txtattr.cpp.

01472 {
01473     TxtAspectRatioAttribute *pAttr = new TxtAspectRatioAttribute;
01474     if (pAttr==NULL)
01475         // error message has already been set by new
01476         return FALSE;
01477 
01478     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(BaseTextClass), 
01479                                                          pAttr);
01480 
01481     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TxtAspectRatioAttribute");
01482 
01483     return TRUE;
01484 }

BOOL TxtAspectRatioAttribute::IsDifferent AttributeValue pAttr  )  [virtual]
 

See base class version.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
Errors: The two attributes are not of the same type.
See also:
AttributeValue::IsDifferent

Reimplemented from AttributeValue.

Definition at line 1448 of file txtattr.cpp.

01449 {
01450     // This must be at least a FillGeometryAttribute...
01451     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(TxtAspectRatioAttribute)), 
01452                 "Different attribute types in TxtAspectRatioAttribute::IsDifferent()");
01453 
01454     // Check they are NOT the same.
01455     return ( !(*((TxtAspectRatioAttribute *)pAttr) == *this) ); 
01456 }

NodeAttribute * TxtAspectRatioAttribute::MakeNode  )  [virtual]
 

Make a AttrTextFontTypeface node, see base class.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
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 1499 of file txtattr.cpp.

01500 {
01501     // Create new attribute node
01502     AttrTxtAspectRatio*  pAttr = new AttrTxtAspectRatio();
01503     if (pAttr==NULL)      
01504         // error message has already been set by new
01505         return NULL;
01506 
01507     // Copy attribute value into the new node.
01508     pAttr->Value.SimpleCopy(this);
01509 
01510     // Return the new node
01511     return pAttr;
01512 }

TxtAspectRatioAttribute & TxtAspectRatioAttribute::operator= TxtAspectRatioAttribute Attrib  )  [virtual]
 

Make the Attribute the same as the other.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
Attrib - the attribute to copy [INPUTS]
Returns:
Usual semantics for equality.

Definition at line 1389 of file txtattr.cpp.

01390 {    
01391     AspectRatio = Attrib.AspectRatio;
01392     return *this;
01393 }

INT32 TxtAspectRatioAttribute::operator== const TxtAspectRatioAttribute Attrib  ) 
 

Comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
Attrib - the attribute to compare this attribute with [INPUTS]
Returns:
Usual semantics for equality.
See also:
NodeAttribute::operator==

Definition at line 1410 of file txtattr.cpp.

01411 {
01412     return (Attrib.AspectRatio == AspectRatio); 
01413 }

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

Sets the TxtFontTypeface attribute for the given render region.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]

Implements AttributeValue.

Definition at line 1352 of file txtattr.cpp.

01353 {
01354     pRegion->SetTxtAspectRatio(this, Temp);
01355 }

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

Restores the TxtAspectRatioAttribute attribute for the given render region.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
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).

Implements TxtBaseClassAttribute.

Definition at line 1371 of file txtattr.cpp.

01372 {
01373     pRegion->RestoreTxtAspectRatio(this, Temp);
01374 }

void TxtAspectRatioAttribute::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]

Implements AttributeValue.

Definition at line 1427 of file txtattr.cpp.

01428 {
01429     ERROR3IF(!IS_A(pValue, TxtAspectRatioAttribute), 
01430         "Invalid Attribute value passed to TxtAspectRatioAttribute::SimpleCopy");
01431     // We may as well just use our assignment operator.
01432     *this = *((TxtAspectRatioAttribute*)pValue);
01433 }


Member Data Documentation

FIXED16 TxtAspectRatioAttribute::AspectRatio
 

Definition at line 465 of file txtattr.h.


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