#include <impcol.h>
Inheritance diagram for ColourImportContext:
Public Member Functions | |
ColourImportContext () | |
~ColourImportContext () | |
BOOL | Init () |
Declares a preference that allows you to clear memory in delete(). | |
void | SetContext (IndexedColour *) |
IndexedColour * | GetContext () |
BOOL | SaveContext () |
BOOL | RestoreContext () |
BOOL | RestoreContextTo (UINT32) |
Private Member Functions | |
CC_DECLARE_MEMDUMP (ColourImportContext) |
Definition at line 259 of file impcol.h.
|
Definition at line 184 of file impcol.cpp.
|
|
Definition at line 188 of file impcol.cpp. 00189 { 00190 // Just lose all the items in our list. 00191 DeleteAll(); 00192 }
|
|
|
|
Definition at line 219 of file impcol.cpp. 00220 { 00221 // Get the current context item (always the last) 00222 ContextItem *pItem = (ContextItem *) GetTail(); 00223 00224 // Return its colour pointer 00225 return pItem->pCol; 00226 }
|
|
Declares a preference that allows you to clear memory in delete().
Reimplemented from SimpleCCObject. Definition at line 194 of file impcol.cpp. 00195 { 00196 // Add an initial context item 00197 ContextItem *pItem = new ContextItem(NULL); 00198 if (pItem == NULL) 00199 return FALSE; 00200 00201 // Add to the list 00202 AddTail(pItem); 00203 00204 // All ok 00205 return TRUE; 00206 }
|
|
Definition at line 246 of file impcol.cpp. 00247 { 00248 // Make sure we can do this - must always have at least one node 00249 if (GetCount() <= 1) 00250 { 00251 ERROR3("Bad call to ColourImportContext::RestoreContext()"); 00252 return FALSE; 00253 } 00254 00255 // Remove and delete the last context item 00256 delete RemoveTail(); 00257 00258 // All ok 00259 return TRUE; 00260 }
|
|
Definition at line 262 of file impcol.cpp. 00263 { 00264 // How many should we delete? 00265 INT32 NumToDelete = (INT32) (GetCount() - NewLevel) - 1; 00266 00267 // Make sure this is a legal request. 00268 if (NumToDelete < 0) 00269 // No - return failure 00270 return FALSE; 00271 00272 // Ok - delete this many items 00273 while (NumToDelete > 0) 00274 { 00275 if (!RestoreContext()) 00276 { 00277 ERROR3("Bad call to ColourImportContext::RestoreContextTo()"); 00278 return FALSE; 00279 } 00280 00281 NumToDelete--; 00282 } 00283 00284 // All ok 00285 return TRUE; 00286 }
|
|
Definition at line 228 of file impcol.cpp. 00229 { 00230 // Get a pointer to the current context node 00231 ContextItem *pCurrentItem = (ContextItem *) GetTail(); 00232 00233 // Add a new context node to the end of the list, and give it the same 00234 // context as the current context node. 00235 ContextItem *pItem = new ContextItem(pCurrentItem->pCol); 00236 if (pItem == NULL) 00237 return FALSE; 00238 00239 // Add to the list 00240 AddTail(pItem); 00241 00242 // All ok 00243 return TRUE; 00244 }
|
|
Definition at line 209 of file impcol.cpp. 00210 { 00211 // Get the current context item (always the last) 00212 ContextItem *pItem = (ContextItem *) GetTail(); 00213 00214 // Update its colour pointer 00215 pItem->pCol = pCol; 00216 }
|