KernCode Class Reference

A Kern code. More...

#include <nodetext.h>

Inheritance diagram for KernCode:

AbstractTextChar VisibleTextNode BaseTextClass NodeRenderableInk NodeRenderableBounded NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 KernCode ()
 Simple KernCode constructor, it is required so that SimpleCopy will work. You should not normally call this constructor as it does not initialise the object.
 KernCode (DocCoord &Value)
 KernCode constructor.
 KernCode (Node *ContextNode, AttachNodeDirection Direction, DocCoord &Value)
 The main KernCode constructor.
virtual BOOL ExportRender (RenderRegion *pRegion)
 This function is called when the render function passes through this node It outputs the Text Object start and end tokens.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual void GetDebugDetails (StringBase *Str)
 For obtaining debug information about the Node. This fn can be deleted before we ship.
void SetValue (DocCoord &KernValue)
DocCoord GetValue ()
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes a kern code record to the new file format filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFIlter)

Protected Member Functions

virtual 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 of Node.
void CopyNodeContents (KernCode *NodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.

Private Attributes

DocCoord Value

Detailed Description

A Kern code.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94

Definition at line 349 of file nodetext.h.


Constructor & Destructor Documentation

KernCode::KernCode  ) 
 

Simple KernCode constructor, it is required so that SimpleCopy will work. You should not normally call this constructor as it does not initialise the object.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94

Definition at line 3561 of file nodetext.cpp.

03561                   : AbstractTextChar()
03562 {
03563 }

KernCode::KernCode DocCoord KernValue  ) 
 

KernCode constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94
Parameters:
KernValue,: Horizontal/Vertical kern value [INPUTS]

Definition at line 3574 of file nodetext.cpp.

03574                                      : AbstractTextChar()
03575 {
03576     Value = KernValue;  
03577 }

KernCode::KernCode Node ContextNode,
AttachNodeDirection  Direction,
DocCoord KernValue
 

The main KernCode constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94
Parameters:
ContextNode,: Pointer to a node which this node is to be attached to. [INPUTS]
Direction:

Specifies the direction in which the node is to be attached to the ContextNode. The values this variable can take are as follows:

PREV : Attach node as a previous sibling of the context node NEXT : Attach node as a next sibling of the context node FIRSTCHILD: Attach node as the first child of the context node LASTCHILD : Attach node as a last child of the context node

Value: Horizontal/Vertical kern value

Definition at line 3602 of file nodetext.cpp.

03603                                        : AbstractTextChar(ContextNode, Direction)
03604 {
03605     Value = KernValue;
03606 }


Member Function Documentation

void KernCode::CopyNodeContents KernCode NodeCopy  )  [protected]
 

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:
A copy of this node [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL

Definition at line 3681 of file nodetext.cpp.

03682 {
03683     // Ask the base class to do its bit
03684     AbstractTextChar::CopyNodeContents( NodeCopy );
03685     // Copy the rest of the data in here
03686     NodeCopy->Value = Value;
03687 }

BOOL KernCode::ExportRender RenderRegion pRegion  )  [virtual]
 

This function is called when the render function passes through this node It outputs the Text Object start and end tokens.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/4/95
Parameters:
pRegion - points to the export render region [INPUTS]
Returns:
TRUE if rendered OK (FALSE=>use normal rendering)

Reimplemented from NodeRenderableInk.

Definition at line 3620 of file nodetext.cpp.

03621 {
03622 #if EXPORT_TEXT
03623     if (pRegion->IsKindOf(CC_RUNTIME_CLASS(EPSRenderRegion)))
03624     {
03625         // Output any valid text attributes necessary
03626         ((EPSRenderRegion*)pRegion)->GetValidPathAttributes();
03627         ((EPSRenderRegion*)pRegion)->GetValidTextAttributes();
03628 
03629         EPSExportDC *pDC=(EPSExportDC*)pRegion->GetRenderDC();
03630 
03631         // Use illustrator 3.0 compatible token.
03632         // Any vertical movement is done by BaselineShift
03633         INT32 autokern = 0;
03634         pDC->OutputValue(autokern);
03635         pDC->OutputValue(-(Value.x));
03636         pDC->OutputToken(_T("Tk"));
03637         pDC->OutputNewLine();
03638         return TRUE;
03639     }
03640 #endif
03641     return FALSE;
03642 }

void KernCode::GetDebugDetails StringBase Str  )  [virtual]
 

For obtaining debug information about the Node. This fn can be deleted before we ship.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/2/95
Parameters:
Str,: String giving debug info about the node [OUTPUTS]

Reimplemented from AbstractTextChar.

Definition at line 3738 of file nodetext.cpp.

03739 {
03740 #if DEBUG_TREE
03741     AbstractTextChar::GetDebugDetails(Str);
03742     String_256 TempStr;
03743         
03744     TempStr._MakeMsg( TEXT( "\r\nKernValue = (#1%u, #2%u)"), Value.x, Value.y);
03745     (*Str) += TempStr;
03746 #endif
03747 }

UINT32 KernCode::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94
Returns:
The size of the node in bytes

Reimplemented from AbstractTextChar.

Definition at line 3722 of file nodetext.cpp.

03723 {
03724     return (sizeof(KernCode)); 
03725 }

DocCoord KernCode::GetValue  )  [inline]
 

Definition at line 363 of file nodetext.h.

00363 { return Value; }

void KernCode::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 AbstractTextChar.

Definition at line 3702 of file nodetext.cpp.

03703 {
03704     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
03705     ENSURE(IS_A(pNodeCopy, KernCode), "PolyCopyNodeContents given wrong dest node type");
03706 
03707     if (IS_A(pNodeCopy, KernCode))
03708         CopyNodeContents((KernCode*)pNodeCopy);
03709 }

void KernCode::SetValue DocCoord KernValue  )  [inline]
 

Definition at line 362 of file nodetext.h.

00362 { Value = KernValue; } 

Node * KernCode::SimpleCopy void   )  [protected, 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 of Node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94
Returns:
A copy of the node, or NULL if we are out of memory

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

Reimplemented from AbstractTextChar.

Definition at line 3657 of file nodetext.cpp.

03658 {
03659     // Make a new BigChar and then copy things into it
03660     KernCode* NodeCopy = new KernCode();
03661 
03662     ERROR1IF(NodeCopy == NULL, NULL, _R(IDE_NOMORE_MEMORY)); 
03663 
03664     if (NodeCopy)
03665         CopyNodeContents(NodeCopy);
03666     
03667     return NodeCopy;
03668 }

BOOL KernCode::WritePreChildrenNative BaseCamelotFilter pFIlter  )  [virtual]
 

Reimplemented from Node.

Definition at line 3771 of file nodetext.cpp.

03772 {
03773 #ifdef DO_EXPORT
03774     return CXaraFileTxtKern::WritePreChildrenNative(pFilter, this);
03775 #else
03776     return FALSE;
03777 #endif
03778 }

BOOL KernCode::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes a kern code record to the new file format filter.

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

Reimplemented from Node.

Definition at line 3762 of file nodetext.cpp.

03763 {
03764 #ifdef DO_EXPORT
03765     return CXaraFileTxtKern::WritePreChildrenWeb(pFilter, this);
03766 #else
03767     return FALSE;
03768 #endif
03769 }


Member Data Documentation

DocCoord KernCode::Value [private]
 

Definition at line 376 of file nodetext.h.


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