CDRBitmapStore Class Reference

A storage object for bitmaps from a CDR file import. More...

#include <cdrfiltr.h>

Inheritance diagram for CDRBitmapStore:

CDRAttributeStore List CCObject SimpleCCObject List of all members.

Public Member Functions

BOOL AddChunkToStore (RIFFFile *RIFF, BOOL Pattern, CDRFilter *C)
 Adds a bitmap to the store, converting it now rather than storing it up for later.
KernelBitmapFindBitmap (DWORD Reference)
 Finds a bitmap within the store. Finding a bitmap sets it's used flag to TRUE to avoid it being deleted.

Private Member Functions

 CC_DECLARE_MEMDUMP (CDRBitmapStore)

Detailed Description

A storage object for bitmaps from a CDR file import.

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/04/95

Definition at line 342 of file cdrfiltr.h.


Member Function Documentation

BOOL CDRBitmapStore::AddChunkToStore RIFFFile RIFF,
BOOL  Pattern,
CDRFilter C
 

Adds a bitmap to the store, converting it now rather than storing it up for later.

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/04/95
Parameters:
RIFF file to get the chunk from, and wether it's pattern or not (Pattern are [INPUTS] 1bpp and have a different format)
Returns:
error flag
See also:
CDRFilter

Definition at line 1069 of file cdrfill.cpp.

01070 {
01071     CDRBitmapStoredItem *Item = new CDRBitmapStoredItem;
01072 
01073     if(Item == 0)
01074         return FALSE;
01075     
01076     // convert the bitmap
01077     FOURCC Reference = 0;       // the reference number of this thingy
01078 
01079     // convert depending on the type of thing
01080     if(Pattern)
01081     {
01082         Item->pBitmap = CDRBitmap::ConvertPattern(RIFF, &Reference, C);
01083     }
01084     else
01085     {
01086         switch(C->Version)
01087         {
01088             case CDRVERSION_5:
01089                 Item->pBitmap = CDRBitmap::ConvertBitmap5(RIFF, &Reference, C);
01090                 break;
01091 
01092             default:
01093                 Item->pBitmap = CDRBitmap::ConvertBitmap4(RIFF, &Reference, C);
01094                 break;
01095         }
01096     }
01097 
01098     // check that we got one
01099     if(Item->pBitmap == 0)
01100         return FALSE;
01101     
01102     // make a nice name for it
01103     String_256 Name;
01104     if(Pattern)
01105         Name.MakeMsg(_R(IDT_CDRPATTERNNAME), CDRFilter::PatternNumber++);
01106     else
01107         Name.MakeMsg(_R(IDT_CDRBITMAPNAME), CDRFilter::BitmapNumber++);
01108 
01109     // and set the name
01110     Item->pBitmap->ActualBitmap->SetName(Name);
01111 
01112     // store the reference
01113     Item->Reference = Reference;
01114     
01115     // add the item to this list
01116     AddTail(Item);
01117     
01118     return TRUE;
01119 }

CDRBitmapStore::CC_DECLARE_MEMDUMP CDRBitmapStore   )  [private]
 

KernelBitmap * CDRBitmapStore::FindBitmap DWORD  Reference  ) 
 

Finds a bitmap within the store. Finding a bitmap sets it's used flag to TRUE to avoid it being deleted.

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/04/95
Parameters:
reference of the bitmap to find (a CDRDATA_ should already have been done [INPUTS] on it)
Returns:
a pointer to a KernelBitmap or 0 for not found
See also:
CDRFilter

Definition at line 1137 of file cdrfill.cpp.

01138 {
01139     CDRBitmapStoredItem *Item = (CDRBitmapStoredItem *)GetHead();
01140     
01141     // go through the list of items searching for the reference number given
01142     while(Item != 0)
01143     {
01144         if(Item->Reference == Reference)
01145         {
01146             // set the used flag
01147             Item->Used = TRUE;
01148 
01149             return Item->pBitmap;
01150         }
01151 
01152         Item = (CDRBitmapStoredItem *)GetNext(Item);
01153     }
01154 
01155     return 0;
01156 }


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