TxtScriptAttribute Class Reference

This text attribute specifies the superscript/subscript value of a char. More...

#include <txtattr.h>

Inheritance diagram for TxtScriptAttribute:

TxtBaseClassAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 TxtScriptAttribute ()
 Default Constuctor for TxtScriptAttribute The function sets the Offset to 0, and the Size to 1.
 TxtScriptAttribute (FIXED16 offset, FIXED16 size)
 TxtScriptAttribute constructor.
virtual void Restore (RenderRegion *, BOOL)
 Restores the TxtScriptAttribute attribute for the given render region.
virtual void Render (RenderRegion *pRegion, BOOL Temp=FALSE)
 Sets the TxtScriptAttribute attribute for the given render region.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual NodeAttributeMakeNode ()
 Make a AttrTxtTracking node, see base class.
BOOL IsDifferent (AttributeValue *pAttr)
 See base class version.
virtual TxtScriptAttributeoperator= (TxtScriptAttribute &Attrib)
 Make the Attribute the same as the other.
INT32 operator== (const TxtScriptAttribute &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 Offset
FIXED16 Size

Detailed Description

This text attribute specifies the superscript/subscript value of a char.

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

Definition at line 480 of file txtattr.h.


Constructor & Destructor Documentation

TxtScriptAttribute::TxtScriptAttribute  ) 
 

Default Constuctor for TxtScriptAttribute The function sets the Offset to 0, and the Size to 1.

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

Definition at line 1972 of file txtattr.cpp.

01973 {
01974     Offset = 0;
01975     Size = 1;
01976 
01977 } 

TxtScriptAttribute::TxtScriptAttribute FIXED16  offset,
FIXED16  size
 

TxtScriptAttribute constructor.

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

Errors: -

See also:
-

Definition at line 1995 of file txtattr.cpp.

01996 { 
01997     Offset = offset;
01998     Size = size;
01999 }


Member Function Documentation

BOOL TxtScriptAttribute::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 2133 of file txtattr.cpp.

02134 {
02135     TxtScriptAttribute *pAttr = new TxtScriptAttribute;
02136     if (pAttr==NULL)
02137         // error message has already been set by new
02138         return FALSE;
02139 
02140     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(BaseTextClass), 
02141                                                          pAttr);
02142 
02143     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TxtScriptAttribute");
02144 
02145     return TRUE;
02146 }

BOOL TxtScriptAttribute::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 2110 of file txtattr.cpp.

02111 {
02112     // This must be at least a FillGeometryAttribute...
02113     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(TxtScriptAttribute)), 
02114                 "Different attribute types in TxtScriptAttribute::IsDifferent()");
02115 
02116     // Check they are NOT the same.
02117     return ( !(*((TxtScriptAttribute *)pAttr) == *this) ); 
02118 }

NodeAttribute * TxtScriptAttribute::MakeNode  )  [virtual]
 

Make a AttrTxtTracking 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 2161 of file txtattr.cpp.

02162 {
02163     // Create new attribute node
02164     AttrTxtScript*  pAttr = new AttrTxtScript();
02165     if (pAttr==NULL)      
02166         // error message has already been set by new
02167         return NULL;
02168 
02169     // Copy attribute value into the new node.
02170     pAttr->Value.SimpleCopy(this);
02171 
02172     // Return the new node
02173     return pAttr;
02174 }

TxtScriptAttribute & TxtScriptAttribute::operator= TxtScriptAttribute 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 2052 of file txtattr.cpp.

02053 {    
02054     Offset = Attrib.Offset;
02055     Size = Attrib.Size;
02056     return *this;
02057 }

INT32 TxtScriptAttribute::operator== const TxtScriptAttribute 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 2073 of file txtattr.cpp.

02074 {
02075     return ((Attrib.Offset == Offset) && (Attrib.Size == Size)); 
02076 }

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

Sets the TxtScriptAttribute 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]
See also:
-

Implements AttributeValue.

Definition at line 2015 of file txtattr.cpp.

02016 {
02017     pRegion->SetTxtScript(this, Temp);
02018 }

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

Restores the TxtScriptAttribute 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).
See also:
-

Implements TxtBaseClassAttribute.

Definition at line 2034 of file txtattr.cpp.

02035 {
02036     pRegion->RestoreTxtScript(this, Temp);
02037 }

void TxtScriptAttribute::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 2089 of file txtattr.cpp.

02090 {
02091     ERROR3IF(!IS_A(pValue, TxtScriptAttribute), 
02092         "Invalid Attribute value passed to TxtScriptAttribute::SimpleCopy");
02093     // We may as well just use our assignment operator.
02094     *this = *((TxtScriptAttribute*)pValue);
02095 }


Member Data Documentation

FIXED16 TxtScriptAttribute::Offset
 

Definition at line 501 of file txtattr.h.

FIXED16 TxtScriptAttribute::Size
 

Definition at line 502 of file txtattr.h.


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