1 // 2 // ZoomBlorbFile.h 3 // ZoomCocoa 4 // 5 // Created by Andrew Hunter on Fri Jul 30 2004. 6 // Copyright (c) 2004 Andrew Hunter. All rights reserved. 7 // 8 9 #import <Foundation/Foundation.h> 10 11 #import "ZoomProtocol.h" 12 13 @interface ZoomBlorbFile : NSObject { 14 NSObject<ZFile>* file; 15 16 NSString* formID; 17 unsigned int formLength; 18 19 NSMutableArray* iffBlocks; 20 NSMutableDictionary* typesToBlocks; 21 NSMutableDictionary* locationsToBlocks; 22 23 NSMutableDictionary* resourceIndex; 24 25 BOOL adaptive; 26 NSMutableSet* adaptiveImages; 27 NSData* activePalette; 28 29 NSSize stdSize; 30 NSSize minSize; 31 NSSize maxSize; 32 NSMutableDictionary* resolution; 33 34 NSMutableDictionary* cache; 35 unsigned int maxCacheNum; 36 } 37 38 // Testing files 39 + (BOOL) dataIsBlorbFile: (NSData*) data; 40 + (BOOL) fileContentsIsBlorb: (NSString*) filename; 41 + (BOOL) zfileIsBlorb: (NSObject<ZFile>*) file; 42 43 // Initialisation 44 - (id) initWithZFile: (NSObject<ZFile>*) file; // Designated initialiser 45 - (id) initWithData: (NSData*) blorbFile; 46 - (id) initWithContentsOfFile: (NSString*) filename; 47 48 // Cache control 49 - (void) removeAdaptiveImagesFromCache; 50 51 // Generic IFF data 52 - (NSArray*) chunksWithType: (NSString*) chunkType; 53 - (NSData*) dataForChunk: (id) chunk; 54 - (NSData*) dataForChunkWithType: (NSString*) chunkType; 55 56 // The resource index 57 - (BOOL) parseResourceIndex; 58 - (BOOL) containsImageWithNumber: (int) num; 59 60 // Typed data 61 - (NSData*) imageDataWithNumber: (int) num; 62 - (NSData*) soundDataWithNumber: (int) num; 63 64 // Decoded data 65 - (NSImage*) imageWithNumber: (int) num; 66 - (NSSize) sizeForImageWithNumber: (int) num 67 forPixmapSize: (NSSize) pixmapSize; 68 @end 69