BitmapSequence Class Reference

Maintains a sequence of bitmaps. More...

#include <bmpseq.h>

Inheritance diagram for BitmapSequence:

ImportedBitmaps CCObject SimpleCCObject List of all members.

Public Member Functions

 BitmapSequence (BitmapSequenceInfo *pSequenceInfo)
void DeleteAll ()
 Deletes all the KernelBitmaps in the sequence.
KernelBitmapFindInDocumentList (Document *pDocument)
 Searches for this BitmapSequence in pImportDocument's bitmap list.
BOOL CopyFromDocumentList (Document *pDocument, const KernelBitmap *pStartBitmap, const UINT32 uNumberToCopy)
 Copies a sequence of bitmaps from the given document's bitmap list into this BitmapSequence.
BitmapSequenceInfoGetSequenceInfo () const
 Er...
BOOL SetSequenceInfo (BitmapSequenceInfo *pNewInfo)
 To allow for future extensions.
UINT32 GetCount () const
 You would probably want to know this.

Protected Attributes

BitmapSequenceInfom_pSequenceInfo

Detailed Description

Maintains a sequence of bitmaps.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
05-07-96
See also:
NewImportBitmap; ImportBitmapList

Definition at line 143 of file bmpseq.h.


Constructor & Destructor Documentation

BitmapSequence::BitmapSequence BitmapSequenceInfo pSequenceInfo  )  [inline]
 

Definition at line 148 of file bmpseq.h.

00148                                                       :
00149         m_pSequenceInfo(pSequenceInfo) {}


Member Function Documentation

BOOL BitmapSequence::CopyFromDocumentList Document pDocument,
const KernelBitmap pStartBitmap,
const UINT32  uNumberToCopy
 

Copies a sequence of bitmaps from the given document's bitmap list into this BitmapSequence.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96
Parameters:
pDocument - the document to copy from [INPUTS] pStartBitmap - a pointer to a KernelBitmap in the document's bitmap list providing a starting point from which to copy. uNumberToCopy - the number of bitmaps to copy

Definition at line 161 of file bmpseq.cpp.

00162 {
00163     if (pDocument == NULL)
00164     {
00165         pDocument = Document::GetSelected();
00166     }
00167     ERROR2IF(pDocument == NULL, FALSE, "pDocument == NULL")
00168     // The bitmap system relies on the Current Doc being correct,
00169     // so we'll set it to be on the safe side
00170     pDocument->SetCurrent();
00171 
00172     // Find this document's BitmapListComponent
00173     DocComponent* pDocBitmapList = pDocument->GetDocComponent(CC_RUNTIME_CLASS(BitmapListComponent));
00174     ERROR2IF(pDocBitmapList == NULL, FALSE, "Couldn't find document bitmap list");
00175 
00176     // Now get the actual bitmap list
00177     BitmapList* pBmpList = ((BitmapListComponent*)pDocBitmapList)->GetBitmapList();
00178 
00179     ListItem* pItem = (ListItem*)pStartBitmap;
00180     UINT32 uCurrentIndex = 1;
00181 
00182     while (uCurrentIndex <= uNumberToCopy)
00183     {
00184         KernelBitmap* pBmp = (KernelBitmap*)pItem;
00185         ERROR3IF_NULL_CLASS(pBmp, KernelBitmap);
00186 
00187         if (!AddBitmap(pBmp, INT32(uCurrentIndex)))
00188         {
00189             return FALSE;
00190         }
00191 
00192         pItem = pBmpList->GetNext(pItem);
00193         ++uCurrentIndex;
00194     }
00195     return TRUE;
00196 }

void BitmapSequence::DeleteAll  ) 
 

Deletes all the KernelBitmaps in the sequence.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96

Definition at line 141 of file bmpseq.cpp.

00142 {
00143     Bitmaps.DeleteAll();
00144 }

KernelBitmap * BitmapSequence::FindInDocumentList Document pImportDocument  ) 
 

Searches for this BitmapSequence in pImportDocument's bitmap list.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96
Parameters:
pImportDocument - the document in which to search for this BitmapSequence [INPUTS]
Returns:
A pointer to the first KernelBitmap in pMainList where the matched sequence starts. NULL if pSubList wasn't found

Definition at line 625 of file bmpseq.cpp.

00626 {
00627     ERROR2IF(pImportDocument == NULL, FALSE, "pImportDocument NULL");
00628     ERROR3IF(!pImportDocument->IS_KIND_OF(Document), "BitmapSequence::FindInDocumentList - pImportDocument isn't");
00629 
00630     // First we need to look at the Bitmap List in the document we are Importing
00631     // into, and if we find a KernelBitmap that points at a bitmap the same as the
00632     // one we have imported, then we'll just use that.
00633 
00634     // The bitmap system relies on the Current Doc being correct,
00635     // so we'll set it to be on the safe side
00636     pImportDocument->SetCurrent();
00637 
00638     // Find this document's BitmapListComponent
00639     DocComponent* pDocBitmapList = 
00640                         pImportDocument->GetDocComponent(CC_RUNTIME_CLASS(BitmapListComponent));
00641     ERROR2IF(pDocBitmapList == NULL, FALSE, "Couldn't find document bitmap list");
00642     List* pMainList = (List*)((BitmapListComponent*)pDocBitmapList)->GetBitmapList();
00643 
00644     KernelBitmap* pFound;       // the first item in the document list for the match
00645     // if there's only one bitmap do a simple search for it...
00646 /*  if (GetCount() == 1)
00647     {
00648         KernelBitmap* pStart = (KernelBitmap*)pMainList->GetHead();
00649         KernelBitmap* pBitmap = ((ImportBitmap*)((List*)&Bitmaps)->GetHead())->pBmp;
00650         pFound = FindBitmap(pMainList, pStart, pBitmap);
00651     }
00652     else        // do a hideous search
00653     {*/
00654         ListItem* pFirstMain = (ListItem*)pMainList->GetHead();
00655         List* pNewBitmaps = (List*)&Bitmaps;
00656         pFound = FindSimple(pMainList, pNewBitmaps, pFirstMain);
00657 //  }
00658 
00659     return pFound;
00660 }

UINT32 BitmapSequence::GetCount  )  const
 

You would probably want to know this.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96
Returns:
The number of bitmaps in this BitmapSequence

Definition at line 604 of file bmpseq.cpp.

00605 {   
00606     return Bitmaps.GetCount();
00607 }

BitmapSequenceInfo * BitmapSequence::GetSequenceInfo  )  const
 

Er...

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96
Returns:
The BitmapSequenceInfo for this BitmapSequence

Definition at line 565 of file bmpseq.cpp.

00566 {
00567     return m_pSequenceInfo;
00568 }

BOOL BitmapSequence::SetSequenceInfo BitmapSequenceInfo pNewInfo  ) 
 

To allow for future extensions.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96
Parameters:
pNewInfo - a pointer [INPUTS]
Returns:
TRUE if set OK FALSE otherwise

Errors: ERROR3's for invalid args

Definition at line 584 of file bmpseq.cpp.

00585 {
00586     ERROR3IF(pNewInfo != NULL && !pNewInfo->IS_KIND_OF(BitmapSequenceInfo), 
00587                 "BitmapSequence::SetSequenceInfo - pNewInfo isn't");
00588 
00589     m_pSequenceInfo = pNewInfo;
00590     return TRUE;
00591 }


Member Data Documentation

BitmapSequenceInfo* BitmapSequence::m_pSequenceInfo [protected]
 

Definition at line 162 of file bmpseq.h.


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