NodeAnimatingBitmap Class Reference

#include <nodeabmp.h>

Inheritance diagram for NodeAnimatingBitmap:

NodeBitmap NodeRect NodeSimpleShape NodeRenderableInk NodeRenderableBounded NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 NodeAnimatingBitmap ()
 NodeAnimatingBitmap (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
virtual ~NodeAnimatingBitmap ()
virtual String Describe (BOOL Plural, BOOL Verbose)
 To return a description of the NodeBitmap object in either the singular or the plural. This method is called by the DescribeRange method. The description will always begin with a lower case letter.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual NodeSimpleCopy ()
 Makes a copy of all the data in the node.
void CopyNodeContents (NodeAnimatingBitmap *pCopy)
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual KernelBitmapEnumerateBitmaps (UINT32 Count)
 Find out what bitmaps, if any, are used by this node.
virtual KernelBitmapRefGetBitmapRef ()
virtual KernelBitmapGetBitmap ()
 Get the bitmap referenced by this node.

Private Member Functions

BOOL AllocBitmapRefs (INT32 nCount)

Private Attributes

KernelBitmapRefm_pBmpRefs
UINT32 m_nBmpCount
UINT32 m_nCurrentBmp

Detailed Description

Definition at line 111 of file nodeabmp.h.


Constructor & Destructor Documentation

NodeAnimatingBitmap::NodeAnimatingBitmap  ) 
 

Definition at line 114 of file nodeabmp.cpp.

00115   : m_pBmpRefs(0),
00116     m_nBmpCount(0)
00117 {
00118 
00119 }

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

Definition at line 123 of file nodeabmp.cpp.

00125   : NodeBitmap(ContextNode, Direction, Locked, Mangled, Marked, Selected),
00126     m_pBmpRefs(0),
00127     m_nBmpCount(0)
00128 {
00129 
00130 }

NodeAnimatingBitmap::~NodeAnimatingBitmap  )  [virtual]
 

Definition at line 134 of file nodeabmp.cpp.

00135 {
00136 
00137 }


Member Function Documentation

BOOL NodeAnimatingBitmap::AllocBitmapRefs INT32  nCount  )  [private]
 

Definition at line 231 of file nodeabmp.cpp.

00232 {
00233     ERROR3IF(m_pBmpRefs != 0, "Bitmaps already allocated in NodeAnimatingBitmap::AllocBitmapRefs");
00234     ERROR3IF(nCount <= 0, "Invalid count in NodeAnimatingBitmap::AllocBitmapRefs");
00235     m_pBmpRefs = new KernelBitmapRef[nCount];
00236     return m_pBmpRefs != 0;
00237 }

void NodeAnimatingBitmap::CopyNodeContents NodeAnimatingBitmap pCopy  ) 
 

Definition at line 165 of file nodeabmp.cpp.

00166 {
00167     // Copy the base class followed by members specific to this derived class.
00168     NodeBitmap::CopyNodeContents(pCopy);
00169     if (pCopy->AllocBitmapRefs(m_nBmpCount))
00170         for (UINT32 i = 0; i < m_nBmpCount; i++)
00171             pCopy->m_pBmpRefs[i] = m_pBmpRefs[i];
00172 }

String NodeAnimatingBitmap::Describe BOOL  Plural,
BOOL  Verbose
[virtual]
 

To return a description of the NodeBitmap object in either the singular or the plural. This method is called by the DescribeRange method. The description will always begin with a lower case letter.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/6/93
Parameters:
Plural,: Flag indicating if the string description should be plural or [INPUTS] singular.
Returns:
Description of the object

Errors: A resource exception will be thrown if a problem occurs when loading the string resource.

Reimplemented from NodeBitmap.

Definition at line 141 of file nodeabmp.cpp.

00142 {
00143     // TEMP: this is candy-floss for now.
00144     return NodeBitmap::Describe(Plural, Verbose);
00145 }

KernelBitmap * NodeAnimatingBitmap::EnumerateBitmaps UINT32  nCount  )  [virtual]
 

Find out what bitmaps, if any, are used by this node.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/17/95
Parameters:
Count - the bitmap to get (see Purpose). [INPUTS]
Returns:
The KernelBitmap in use by the node, or NULL if no more are used.
The base class returns NULL always, so you over-ride this in any node classes that use bitmaps.

This function supports nodes that use more than one bitmap - you call this function repeatedly and keep incrementing the Count parameter that you pass in each time by 1. You should stop calling it when it returns NULL, as this indicates that no more bitmaps are used by this node. Count should start off as 0 for the first call. Note that this function can (and often will) return NULL for the first call, as many nodes don't use bitmaps, obviously.

See also:
KernelBitmap

Reimplemented from NodeBitmap.

Definition at line 199 of file nodeabmp.cpp.

00200 {
00201     return (nCount < m_nBmpCount) ? m_pBmpRefs[nCount].GetBitmap() : 0;
00202 }

KernelBitmap * NodeAnimatingBitmap::GetBitmap void   )  [virtual]
 

Get the bitmap referenced by this node.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/1/95

Reimplemented from NodeBitmap.

Definition at line 213 of file nodeabmp.cpp.

00214 {
00215     KernelBitmap* pBitmap = m_pBmpRefs[m_nCurrentBmp].GetBitmap();
00216     if (pBitmap && pBitmap->HasBeenDeleted())
00217     {   
00218         // If necessary (due to the crud that is the bitmap system) use the default bitmap instead.
00219         ERROR2IF(pBitmap->GetParentBitmapList() == NULL, NULL, "Deleted bitmap has no parent list");
00220         pBitmap = pBitmap->GetParentBitmapList()->FindDefaultBitmap();
00221 
00222         // There should always be a default bitmap in the list
00223         ERROR2IF(pBitmap == NULL, 0L, "Couldn't find the default bitmap");
00224     }
00225     
00226     return pBitmap;
00227 }

KernelBitmapRef * NodeAnimatingBitmap::GetBitmapRef  )  [virtual]
 

Reimplemented from NodeBitmap.

Definition at line 206 of file nodeabmp.cpp.

00207 {
00208     return &m_pBmpRefs[m_nCurrentBmp];
00209 }

UINT32 NodeAnimatingBitmap::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

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

Reimplemented from NodeBitmap.

Definition at line 149 of file nodeabmp.cpp.

00150 {
00151     return sizeof(*this);
00152 }

void NodeAnimatingBitmap::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 NodeBitmap.

Definition at line 188 of file nodeabmp.cpp.

00189 {
00190     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
00191     ENSURE(IS_A(pNodeCopy, NodeAnimatingBitmap), "PolyCopyNodeContents given wrong dest node type");
00192 
00193     if (IS_A(pNodeCopy, NodeAnimatingBitmap))
00194         CopyNodeContents((NodeAnimatingBitmap*)pNodeCopy);
00195 }

Node * NodeAnimatingBitmap::SimpleCopy void   )  [virtual]
 

Makes a copy of all the data in the node.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/5/93
Returns:
Pointer to a Node

Reimplemented from NodeBitmap.

Definition at line 156 of file nodeabmp.cpp.

00157 {
00158     NodeAnimatingBitmap* pCopy = new NodeAnimatingBitmap;
00159     if (pCopy) CopyNodeContents(pCopy);
00160     return pCopy;
00161 }


Member Data Documentation

UINT32 NodeAnimatingBitmap::m_nBmpCount [private]
 

Definition at line 147 of file nodeabmp.h.

UINT32 NodeAnimatingBitmap::m_nCurrentBmp [private]
 

Definition at line 148 of file nodeabmp.h.

KernelBitmapRef* NodeAnimatingBitmap::m_pBmpRefs [private]
 

Definition at line 146 of file nodeabmp.h.


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