671f59c9fd6b522733eb4aacf27291855c484010
[WebKit-https.git] / WebKit / WebCoreSupport.subproj / WebImageData.h
1 /*      WebImageData.h
2         Copyright 2004, Apple, Inc. All rights reserved.
3 */
4 #ifndef OMIT_TIGER_FEATURES
5
6 #import <Cocoa/Cocoa.h>
7
8 // Needed for CGCompositeOperation
9 #import <CoreGraphics/CGContextPrivate.h>
10
11 @class WebImageRenderer;
12
13 @interface WebImageData : NSObject <NSCopying>
14 {
15     size_t imagesSize;
16     CGImageRef *images;
17     size_t imagePropertiesSize;
18     CFDictionaryRef fileProperties;
19     CFDictionaryRef *imageProperties;
20     CGImageSourceRef imageSource;
21
22     CGSize size;
23     BOOL haveSize;
24     
25     CFMutableDictionaryRef animatingRenderers;
26     NSTimer *frameTimer;
27
28     size_t frameDurationsSize;
29     float *frameDurations;
30     
31     size_t currentFrame;
32     int repetitionsComplete;
33     BOOL animationFinished;
34     
35     NSLock *decodeLock;
36     
37     id _PDFDoc;
38     BOOL isPDF;
39     
40     BOOL isSolidColor;                              // Is frame 0 a solid color?
41     CGColorRef solidColor;                          // If isSolidColor this is the color, or NULL for transparent
42     
43     BOOL sizeAvailable;
44 }
45
46 - (size_t)numberOfImages;
47 - (CGImageRef)imageAtIndex:(size_t)index;
48 - (BOOL)incrementalLoadWithBytes:(const void *)bytes length:(unsigned)length complete:(BOOL)isComplete callback:(id)c;
49 - (void)drawImageAtIndex:(size_t)index inRect:(CGRect)ir fromRect:(CGRect)fr compositeOperation:(CGCompositeOperation)op context:(CGContextRef)aContext;
50 - (void)drawImageAtIndex:(size_t)index inRect:(CGRect)ir fromRect:(CGRect)fr adjustedSize:(CGSize)size compositeOperation:(CGCompositeOperation)op context:(CGContextRef)aContext;
51 - (void)tileInRect:(CGRect)rect fromPoint:(CGPoint)point context:(CGContextRef)aContext;
52 - (BOOL)isNull;
53 - (CGSize)size;
54 - (void)animate;
55 - (BOOL)shouldAnimate;
56 + (void)stopAnimationsInView:(NSView *)aView;
57 - (void)addAnimatingRenderer:(WebImageRenderer *)r inView:(NSView *)view;
58 - (void)removeAnimatingRenderer:(WebImageRenderer *)self;
59 - (BOOL)isAnimationFinished;
60 - (size_t)currentFrame;
61 - (CFDictionaryRef)propertiesAtIndex:(size_t)index;
62
63 - (void)decodeData:(CFDataRef)data isComplete:(BOOL)f callback:(id)c;
64
65 - (void)setIsPDF:(BOOL)f;
66 - (BOOL)isPDF;
67
68 - (void)resetAnimation;
69
70 @end
71
72 #endif