[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:15:28 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit b3888bbf411c814cbab9608febdefa6d45841457
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu May 30 05:12:53 2002 +0000
Changes to support animated image rendering.
Moved image rendering into webkit.
Still need to implement preferences stubs and
start/stop stubs.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 086ce4e..6c70e66 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,54 @@
+2002-05-29 Richard Williamson <rjw at apple.com>
+
+ Changes to support animated image rendering.
+ Moved image rendering into webkit.
+ Still need to implement preferences stubs and
+ start/stop stubs.
+
+ * WebCoreSupport.subproj/IFImageRenderer.h: Added.
+ * WebCoreSupport.subproj/IFImageRenderer.m: Added.
+ * WebCoreSupport.subproj/IFImageRendererFactory.h: Added.
+ * WebCoreSupport.subproj/IFImageRendererFactory.m: Added.
+ (+[IFImageRendererFactory createSharedFactory]):
+ (+[IFImageRendererFactory sharedFactory]):
+ (-[IFImageRendererFactory imageRendererWithBytes:length:]):
+ (-[IFImageRendererFactory imageRendererWithSize:]):
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/IFBaseWebController.mm:
+ (-[IFBaseWebController stopAnimatedImages]):
+ (-[IFBaseWebController startAnimatedImages]):
+ (-[IFBaseWebController stopAnimatedImageLooping]):
+ (-[IFBaseWebController startAnimatedImageLooping]):
+ * WebView.subproj/IFPreferences.h:
+ * WebView.subproj/IFPreferences.mm:
+ (+[IFPreferences load]):
+ (-[IFPreferences _resourceTimedLayoutEnabled]):
+ (-[IFPreferences allowAnimatedImages]):
+ (-[IFPreferences allowAnimatedImageLooping]):
+ (-[IFPreferences setAllowAnimatedImageLooping:]):
+ * WebView.subproj/IFWebController.h:
+ * WebView.subproj/IFWebView.mm:
+ (-[IFWebView initWithFrame:]):
+
+2002-05-29 Richard Williamson <rjw at apple.com>
+
+ API stubs for image animation.
+
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/IFBaseWebController.mm:
+ (-[IFBaseWebController stopAnimatedImages]):
+ (-[IFBaseWebController startAnimatedImages]):
+ (-[IFBaseWebController stopAnimatedImageLooping]):
+ (-[IFBaseWebController startAnimatedImageLooping]):
+ * WebView.subproj/IFPreferences.h:
+ * WebView.subproj/IFPreferences.mm:
+ (+[IFPreferences load]):
+ (-[IFPreferences _resourceTimedLayoutEnabled]):
+ (-[IFPreferences allowAnimatedImages]):
+ (-[IFPreferences allowAnimatedImageLooping]):
+ (-[IFPreferences setAllowAnimatedImageLooping:]):
+ * WebView.subproj/IFWebController.h:
+
2002-05-29 John Sullivan <sullivan at apple.com>
Removed acceptsFirstMouse override, this fixes at least:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 086ce4e..6c70e66 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,54 @@
+2002-05-29 Richard Williamson <rjw at apple.com>
+
+ Changes to support animated image rendering.
+ Moved image rendering into webkit.
+ Still need to implement preferences stubs and
+ start/stop stubs.
+
+ * WebCoreSupport.subproj/IFImageRenderer.h: Added.
+ * WebCoreSupport.subproj/IFImageRenderer.m: Added.
+ * WebCoreSupport.subproj/IFImageRendererFactory.h: Added.
+ * WebCoreSupport.subproj/IFImageRendererFactory.m: Added.
+ (+[IFImageRendererFactory createSharedFactory]):
+ (+[IFImageRendererFactory sharedFactory]):
+ (-[IFImageRendererFactory imageRendererWithBytes:length:]):
+ (-[IFImageRendererFactory imageRendererWithSize:]):
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/IFBaseWebController.mm:
+ (-[IFBaseWebController stopAnimatedImages]):
+ (-[IFBaseWebController startAnimatedImages]):
+ (-[IFBaseWebController stopAnimatedImageLooping]):
+ (-[IFBaseWebController startAnimatedImageLooping]):
+ * WebView.subproj/IFPreferences.h:
+ * WebView.subproj/IFPreferences.mm:
+ (+[IFPreferences load]):
+ (-[IFPreferences _resourceTimedLayoutEnabled]):
+ (-[IFPreferences allowAnimatedImages]):
+ (-[IFPreferences allowAnimatedImageLooping]):
+ (-[IFPreferences setAllowAnimatedImageLooping:]):
+ * WebView.subproj/IFWebController.h:
+ * WebView.subproj/IFWebView.mm:
+ (-[IFWebView initWithFrame:]):
+
+2002-05-29 Richard Williamson <rjw at apple.com>
+
+ API stubs for image animation.
+
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/IFBaseWebController.mm:
+ (-[IFBaseWebController stopAnimatedImages]):
+ (-[IFBaseWebController startAnimatedImages]):
+ (-[IFBaseWebController stopAnimatedImageLooping]):
+ (-[IFBaseWebController startAnimatedImageLooping]):
+ * WebView.subproj/IFPreferences.h:
+ * WebView.subproj/IFPreferences.mm:
+ (+[IFPreferences load]):
+ (-[IFPreferences _resourceTimedLayoutEnabled]):
+ (-[IFPreferences allowAnimatedImages]):
+ (-[IFPreferences allowAnimatedImageLooping]):
+ (-[IFPreferences setAllowAnimatedImageLooping:]):
+ * WebView.subproj/IFWebController.h:
+
2002-05-29 John Sullivan <sullivan at apple.com>
Removed acceptsFirstMouse override, this fixes at least:
diff --git a/WebKit/WebCoreSupport.subproj/IFImageRenderer.h b/WebKit/WebCoreSupport.subproj/IFImageRenderer.h
new file mode 100644
index 0000000..91a0e35
--- /dev/null
+++ b/WebKit/WebCoreSupport.subproj/IFImageRenderer.h
@@ -0,0 +1,22 @@
+/* IFAnimatedImage.h
+ Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+#import <Cocoa/Cocoa.h>
+
+#import <WebCoreImageRenderer.h>
+
+ at interface IFImageRenderer : NSImage <WebCoreImageRenderer>
+{
+ NSTimer *frameTimer;
+ NSView *frameView;
+ NSRect imageRect;
+ NSRect targetRect;
+}
+
+- (int)frameCount;
+- (int)currentFrame;
+- (void)setCurrentFrame:(int)frame;
+- (float)frameDuration;
+
+ at end
diff --git a/WebKit/WebCoreSupport.subproj/IFImageRenderer.m b/WebKit/WebCoreSupport.subproj/IFImageRenderer.m
new file mode 100644
index 0000000..02a9dfb
--- /dev/null
+++ b/WebKit/WebCoreSupport.subproj/IFImageRenderer.m
@@ -0,0 +1,125 @@
+/* IFAnimatedImage.m
+ Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+#import <WebKit/IFImageRenderer.h>
+
+ at implementation IFImageRenderer
+
+- (void)dealloc
+{
+ [self stopAnimation];
+ [frameTimer release];
+ [frameView release];
+ [super dealloc];
+}
+
+- (int) frameCount {
+ NSBitmapImageRep* imageRep = [[self representations] objectAtIndex:0];
+ id property = nil;
+
+ if ([imageRep respondsToSelector: @selector(valueForProperty:)])
+ property = [imageRep valueForProperty:NSImageFrameCount];
+ return property != nil ? [property intValue] : 1;
+}
+
+- (int) currentFrame {
+ NSBitmapImageRep* imageRep = [[self representations] objectAtIndex:0];
+ id property = nil;
+
+ if ([imageRep respondsToSelector: @selector(valueForProperty:)])
+ property = [imageRep valueForProperty:NSImageCurrentFrame];
+ return property != nil ? [property intValue] : 1;
+}
+
+- (void) setCurrentFrame:(int)frame {
+ NSBitmapImageRep* imageRep = [[self representations] objectAtIndex:0];
+ [imageRep setProperty:NSImageCurrentFrame withValue: [NSNumber numberWithInt:frame]];
+}
+
+- (float) frameDuration {
+ NSBitmapImageRep* imageRep = [[self representations] objectAtIndex:0];
+ id property = nil;
+
+ if ([imageRep respondsToSelector: @selector(valueForProperty:)])
+ property = [imageRep valueForProperty:NSImageCurrentFrameDuration];
+ return property != nil ? [property floatValue] : 0.0;
+}
+
+- (void)timerFired: (id)context
+{
+ int currentFrame = [self currentFrame];
+
+ // Release the timer that just fired.
+ [frameTimer release];
+
+ currentFrame++;
+ if (currentFrame >= [self frameCount]){
+ currentFrame = 0;
+ }
+
+ [self setCurrentFrame: currentFrame];
+
+ [frameView lockFocus];
+ [self drawInRect: targetRect
+ fromRect: imageRect
+ operation: NSCompositeSourceOver // Renders transparency correctly
+ fraction: 1.0];
+ [frameView unlockFocus];
+ [[frameView window] flushWindow];
+
+ float frameDuration = [self frameDuration];
+ frameTimer = [[NSTimer scheduledTimerWithTimeInterval: frameDuration
+ target: self
+ selector: @selector(timerFired:)
+ userInfo: nil
+ repeats: NO] retain];
+}
+
+- (void)beginAnimationInView: (NSView *)view inRect: (NSRect)ir fromRect: (NSRect)fr
+{
+ [self stopAnimation];
+
+ if ([self frameCount] > 1){
+ float frameDuration = [self frameDuration];
+
+ imageRect = fr;
+ targetRect = ir;
+ frameView = [view retain];
+ frameTimer = [[NSTimer scheduledTimerWithTimeInterval: frameDuration
+ target: self
+ selector: @selector(timerFired:)
+ userInfo: nil
+ repeats: NO] retain];
+ }
+}
+
+- (void)stopAnimation
+{
+ [frameTimer invalidate];
+ [frameTimer release];
+ frameTimer = 0;
+
+ [frameView release];
+ frameView = 0;
+}
+
+- (void)resize: (NSSize)s
+{
+ [self setScalesWhenResized: YES];
+ [self setSize: s];
+}
+
+// require by protocol
+- (NSSize)size
+{
+ return [super size];
+}
+
+- (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(float)delta
+{
+ [super drawInRect:dstRect fromRect:srcRect operation:op fraction:delta];
+}
+
+
+ at end
diff --git a/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.h b/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.h
new file mode 100644
index 0000000..8ff7e33
--- /dev/null
+++ b/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.h
@@ -0,0 +1,20 @@
+//
+// IFImageRendererFactory.h
+// WebKit
+//
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <WebCoreImageRendererFactory.h>
+
+ at class IFImageRenderer;
+
+ at interface IFImageRendererFactory : WebCoreImageRendererFactory
+{
+}
+
++ (void)createSharedFactory;
++ (IFImageRendererFactory *)sharedFactory;
+- (id <WebCoreImageRenderer>)imageRendererWithBytes: (const void *)bytes length:(unsigned)length;
+
+ at end
diff --git a/WebCore/kwq/WebCoreViewFactory.h b/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.m
similarity index 54%
copy from WebCore/kwq/WebCoreViewFactory.h
copy to WebKit/WebCoreSupport.subproj/IFImageRendererFactory.m
index 8157faf..1ee45c7 100644
--- a/WebCore/kwq/WebCoreViewFactory.h
+++ b/WebKit/WebCoreSupport.subproj/IFImageRendererFactory.m
@@ -22,35 +22,46 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#import <Cocoa/Cocoa.h>
- at class NSArray;
- at class NSString;
- at class NSView;
+#import <WebKit/IFImageRenderer.h>
+#import <WebKit/IFImageRendererFactory.h>
+
+#import <WebKit/WebKitDebug.h>
-typedef NSView *(*IFPluginViewCreationFunction)();
-void IFSetPluginViewCreationFunction(IFPluginViewCreationFunction);
+ at implementation IFImageRendererFactory
- at interface WebCoreViewFactory : NSObject
++ (void)createSharedFactory
{
+ if (![self sharedFactory]) {
+ [[[self alloc] init] release];
+ }
+ WEBKIT_ASSERT([[self sharedFactory] isMemberOfClass:self]);
}
-+ (WebCoreViewFactory *)sharedFactory;
-- init;
-
-- (NSView *)viewForPluginWithURL:(NSString *)url serviceType:(NSString *)serviceType arguments:(NSArray *)arguments baseURL:(NSString *)baseURL;
-- (NSArray *)pluginsInfo; // array of id <WebCorePluginInfo>
-
-- (NSView *)viewForJavaAppletWithArguments:(NSDictionary *)arguments;
++ (IFImageRendererFactory *)sharedFactory
+{
+ return (IFImageRendererFactory *)[super sharedFactory];
+}
- at end
+- (id <WebCoreImageRenderer>)imageRendererWithBytes: (const void *)bytes length:(unsigned)length
+{
+ NSData *data = [[NSData alloc] initWithBytes: bytes length: length];
+ IFImageRenderer *imageRenderer = [[IFImageRenderer alloc] initWithData: data];
+ NSArray *reps = [imageRenderer representations];
+ NSImageRep *rep = [reps objectAtIndex: 0];
+ // Force the image to use the pixel size and ignore the dpi.
+ [rep setSize:NSMakeSize([rep pixelsWide], [rep pixelsHigh])];
+ [data release];
+ [imageRenderer setFlipped: YES];
+ return [imageRenderer autorelease];
+}
- at protocol WebCorePluginInfo <NSObject>
+- (id <WebCoreImageRenderer>)imageRendererWithSize: (NSSize)s
+{
+ IFImageRenderer *imageRenderer = [[NSImage alloc] initWithSize: s];
+ return [imageRenderer autorelease];
+}
-- (NSString *)name;
-- (NSString *)filename;
-- (NSString *)pluginDescription;
-- (NSArray *)mimeTypes; // array of NSArrays with 3 parts of MIME type in each
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebImageRenderer.h b/WebKit/WebCoreSupport.subproj/WebImageRenderer.h
new file mode 100644
index 0000000..91a0e35
--- /dev/null
+++ b/WebKit/WebCoreSupport.subproj/WebImageRenderer.h
@@ -0,0 +1,22 @@
+/* IFAnimatedImage.h
+ Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+#import <Cocoa/Cocoa.h>
+
+#import <WebCoreImageRenderer.h>
+
+ at interface IFImageRenderer : NSImage <WebCoreImageRenderer>
+{
+ NSTimer *frameTimer;
+ NSView *frameView;
+ NSRect imageRect;
+ NSRect targetRect;
+}
+
+- (int)frameCount;
+- (int)currentFrame;
+- (void)setCurrentFrame:(int)frame;
+- (float)frameDuration;
+
+ at end
diff --git a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
new file mode 100644
index 0000000..02a9dfb
--- /dev/null
+++ b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
@@ -0,0 +1,125 @@
+/* IFAnimatedImage.m
+ Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+#import <WebKit/IFImageRenderer.h>
+
+ at implementation IFImageRenderer
+
+- (void)dealloc
+{
+ [self stopAnimation];
+ [frameTimer release];
+ [frameView release];
+ [super dealloc];
+}
+
+- (int) frameCount {
+ NSBitmapImageRep* imageRep = [[self representations] objectAtIndex:0];
+ id property = nil;
+
+ if ([imageRep respondsToSelector: @selector(valueForProperty:)])
+ property = [imageRep valueForProperty:NSImageFrameCount];
+ return property != nil ? [property intValue] : 1;
+}
+
+- (int) currentFrame {
+ NSBitmapImageRep* imageRep = [[self representations] objectAtIndex:0];
+ id property = nil;
+
+ if ([imageRep respondsToSelector: @selector(valueForProperty:)])
+ property = [imageRep valueForProperty:NSImageCurrentFrame];
+ return property != nil ? [property intValue] : 1;
+}
+
+- (void) setCurrentFrame:(int)frame {
+ NSBitmapImageRep* imageRep = [[self representations] objectAtIndex:0];
+ [imageRep setProperty:NSImageCurrentFrame withValue: [NSNumber numberWithInt:frame]];
+}
+
+- (float) frameDuration {
+ NSBitmapImageRep* imageRep = [[self representations] objectAtIndex:0];
+ id property = nil;
+
+ if ([imageRep respondsToSelector: @selector(valueForProperty:)])
+ property = [imageRep valueForProperty:NSImageCurrentFrameDuration];
+ return property != nil ? [property floatValue] : 0.0;
+}
+
+- (void)timerFired: (id)context
+{
+ int currentFrame = [self currentFrame];
+
+ // Release the timer that just fired.
+ [frameTimer release];
+
+ currentFrame++;
+ if (currentFrame >= [self frameCount]){
+ currentFrame = 0;
+ }
+
+ [self setCurrentFrame: currentFrame];
+
+ [frameView lockFocus];
+ [self drawInRect: targetRect
+ fromRect: imageRect
+ operation: NSCompositeSourceOver // Renders transparency correctly
+ fraction: 1.0];
+ [frameView unlockFocus];
+ [[frameView window] flushWindow];
+
+ float frameDuration = [self frameDuration];
+ frameTimer = [[NSTimer scheduledTimerWithTimeInterval: frameDuration
+ target: self
+ selector: @selector(timerFired:)
+ userInfo: nil
+ repeats: NO] retain];
+}
+
+- (void)beginAnimationInView: (NSView *)view inRect: (NSRect)ir fromRect: (NSRect)fr
+{
+ [self stopAnimation];
+
+ if ([self frameCount] > 1){
+ float frameDuration = [self frameDuration];
+
+ imageRect = fr;
+ targetRect = ir;
+ frameView = [view retain];
+ frameTimer = [[NSTimer scheduledTimerWithTimeInterval: frameDuration
+ target: self
+ selector: @selector(timerFired:)
+ userInfo: nil
+ repeats: NO] retain];
+ }
+}
+
+- (void)stopAnimation
+{
+ [frameTimer invalidate];
+ [frameTimer release];
+ frameTimer = 0;
+
+ [frameView release];
+ frameView = 0;
+}
+
+- (void)resize: (NSSize)s
+{
+ [self setScalesWhenResized: YES];
+ [self setSize: s];
+}
+
+// require by protocol
+- (NSSize)size
+{
+ return [super size];
+}
+
+- (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(float)delta
+{
+ [super drawInRect:dstRect fromRect:srcRect operation:op fraction:delta];
+}
+
+
+ at end
diff --git a/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.h b/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.h
new file mode 100644
index 0000000..8ff7e33
--- /dev/null
+++ b/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.h
@@ -0,0 +1,20 @@
+//
+// IFImageRendererFactory.h
+// WebKit
+//
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <WebCoreImageRendererFactory.h>
+
+ at class IFImageRenderer;
+
+ at interface IFImageRendererFactory : WebCoreImageRendererFactory
+{
+}
+
++ (void)createSharedFactory;
++ (IFImageRendererFactory *)sharedFactory;
+- (id <WebCoreImageRenderer>)imageRendererWithBytes: (const void *)bytes length:(unsigned)length;
+
+ at end
diff --git a/WebCore/kwq/WebCoreViewFactory.h b/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.m
similarity index 54%
copy from WebCore/kwq/WebCoreViewFactory.h
copy to WebKit/WebCoreSupport.subproj/WebImageRendererFactory.m
index 8157faf..1ee45c7 100644
--- a/WebCore/kwq/WebCoreViewFactory.h
+++ b/WebKit/WebCoreSupport.subproj/WebImageRendererFactory.m
@@ -22,35 +22,46 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#import <Cocoa/Cocoa.h>
- at class NSArray;
- at class NSString;
- at class NSView;
+#import <WebKit/IFImageRenderer.h>
+#import <WebKit/IFImageRendererFactory.h>
+
+#import <WebKit/WebKitDebug.h>
-typedef NSView *(*IFPluginViewCreationFunction)();
-void IFSetPluginViewCreationFunction(IFPluginViewCreationFunction);
+ at implementation IFImageRendererFactory
- at interface WebCoreViewFactory : NSObject
++ (void)createSharedFactory
{
+ if (![self sharedFactory]) {
+ [[[self alloc] init] release];
+ }
+ WEBKIT_ASSERT([[self sharedFactory] isMemberOfClass:self]);
}
-+ (WebCoreViewFactory *)sharedFactory;
-- init;
-
-- (NSView *)viewForPluginWithURL:(NSString *)url serviceType:(NSString *)serviceType arguments:(NSArray *)arguments baseURL:(NSString *)baseURL;
-- (NSArray *)pluginsInfo; // array of id <WebCorePluginInfo>
-
-- (NSView *)viewForJavaAppletWithArguments:(NSDictionary *)arguments;
++ (IFImageRendererFactory *)sharedFactory
+{
+ return (IFImageRendererFactory *)[super sharedFactory];
+}
- at end
+- (id <WebCoreImageRenderer>)imageRendererWithBytes: (const void *)bytes length:(unsigned)length
+{
+ NSData *data = [[NSData alloc] initWithBytes: bytes length: length];
+ IFImageRenderer *imageRenderer = [[IFImageRenderer alloc] initWithData: data];
+ NSArray *reps = [imageRenderer representations];
+ NSImageRep *rep = [reps objectAtIndex: 0];
+ // Force the image to use the pixel size and ignore the dpi.
+ [rep setSize:NSMakeSize([rep pixelsWide], [rep pixelsHigh])];
+ [data release];
+ [imageRenderer setFlipped: YES];
+ return [imageRenderer autorelease];
+}
- at protocol WebCorePluginInfo <NSObject>
+- (id <WebCoreImageRenderer>)imageRendererWithSize: (NSSize)s
+{
+ IFImageRenderer *imageRenderer = [[NSImage alloc] initWithSize: s];
+ return [imageRenderer autorelease];
+}
-- (NSString *)name;
-- (NSString *)filename;
-- (NSString *)pluginDescription;
-- (NSArray *)mimeTypes; // array of NSArrays with 3 parts of MIME type in each
@end
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 194362e..d25b5ff 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -241,6 +241,8 @@
F8CA15BB029A39D901000122,
F8CA15C2029A3E0D01000122,
F83DCC73029D09F301000131,
+ 9CE1F8A402A5C6F30ECA2ACD,
+ 9CE1F8A602A5C6F30ECA2ACD,
);
isa = PBXHeadersBuildPhase;
};
@@ -304,6 +306,8 @@
F8CA15BA029A39D901000122,
F8CA15BC029A39D901000122,
F83DCC74029D09F301000131,
+ 9CE1F8A502A5C6F30ECA2ACD,
+ 9CE1F8A702A5C6F30ECA2ACD,
);
isa = PBXSourcesBuildPhase;
};
@@ -1017,6 +1021,54 @@
);
};
};
+ 9CE1F8A002A5C6F30ECA2ACD = {
+ isa = PBXFileReference;
+ name = IFImageRenderer.h;
+ path = WebCoreSupport.subproj/IFImageRenderer.h;
+ refType = 2;
+ };
+ 9CE1F8A102A5C6F30ECA2ACD = {
+ isa = PBXFileReference;
+ name = IFImageRenderer.m;
+ path = WebCoreSupport.subproj/IFImageRenderer.m;
+ refType = 2;
+ };
+ 9CE1F8A202A5C6F30ECA2ACD = {
+ isa = PBXFileReference;
+ name = IFImageRendererFactory.h;
+ path = WebCoreSupport.subproj/IFImageRendererFactory.h;
+ refType = 2;
+ };
+ 9CE1F8A302A5C6F30ECA2ACD = {
+ isa = PBXFileReference;
+ name = IFImageRendererFactory.m;
+ path = WebCoreSupport.subproj/IFImageRendererFactory.m;
+ refType = 2;
+ };
+ 9CE1F8A402A5C6F30ECA2ACD = {
+ fileRef = 9CE1F8A002A5C6F30ECA2ACD;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 9CE1F8A502A5C6F30ECA2ACD = {
+ fileRef = 9CE1F8A102A5C6F30ECA2ACD;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 9CE1F8A602A5C6F30ECA2ACD = {
+ fileRef = 9CE1F8A202A5C6F30ECA2ACD;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 9CE1F8A702A5C6F30ECA2ACD = {
+ fileRef = 9CE1F8A302A5C6F30ECA2ACD;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
9CF0E249021361B00ECA16EA = {
isa = PBXFileReference;
name = IFWebFramePrivate.h;
@@ -1484,6 +1536,10 @@
F5B36B420281DF55018635CB,
F5F7174C02885C5B018635CA,
F5F7174D02885C5B018635CA,
+ 9CE1F8A002A5C6F30ECA2ACD,
+ 9CE1F8A102A5C6F30ECA2ACD,
+ 9CE1F8A202A5C6F30ECA2ACD,
+ 9CE1F8A302A5C6F30ECA2ACD,
);
isa = PBXGroup;
name = "WebCore Support";
diff --git a/WebKit/WebView.subproj/IFBaseWebController.mm b/WebKit/WebView.subproj/IFBaseWebController.mm
index 060de35..697c410 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.mm
+++ b/WebKit/WebView.subproj/IFBaseWebController.mm
@@ -287,4 +287,20 @@
}
}
+- (void)stopAnimatedImages
+{
+}
+
+- (void)startAnimatedImages
+{
+}
+
+- (void)stopAnimatedImageLooping
+{
+}
+
+- (void)startAnimatedImageLooping
+{
+}
+
@end
diff --git a/WebKit/WebView.subproj/IFPreferences.h b/WebKit/WebView.subproj/IFPreferences.h
index 6c2a6c4..d415a75 100644
--- a/WebKit/WebView.subproj/IFPreferences.h
+++ b/WebKit/WebView.subproj/IFPreferences.h
@@ -44,6 +44,12 @@
- (BOOL)pluginsEnabled;
- (void)setPluginsEnabled:(BOOL)flag;
+- (BOOL)allowAnimatedImages;
+- (void)setAllowAnimatedImages:(BOOL)flag;
+
+- (BOOL)allowAnimatedImageLooping;
+- (void)setAllowAnimatedImageLooping: (BOOL)flag;
+
@end
#ifdef READY_FOR_PRIMETIME
diff --git a/WebKit/WebView.subproj/IFPreferences.mm b/WebKit/WebView.subproj/IFPreferences.mm
index 76c9ade..2a31df7 100644
--- a/WebKit/WebView.subproj/IFPreferences.mm
+++ b/WebKit/WebView.subproj/IFPreferences.mm
@@ -24,6 +24,8 @@
#define WebKitInitialTimedLayoutEnabledPreferenceKey @"WebKitInitialTimedLayoutEnabled"
#define WebKitResourceTimedLayoutEnabledPreferenceKey @"WebKitResourceTimedLayoutEnabled"
#define WebKitResourceTimedLayoutDelayPreferenceKey @"WebKitResourceTimedLayoutDelay"
+#define WebKitAllowAnimatedImagesPreferenceKey @"WebKitAllowAnimatedImagesPreferenceKey"
+#define WebKitAllowAnimatedImageLoopingPreferenceKey @"WebKitAllowAnimatedImageLoopingPreferenceKey"
@implementation IFPreferences
@@ -48,6 +50,8 @@ static IFPreferences *_standardPreferences = nil;
NSNumber *jScriptEnabled = [NSNumber numberWithBool:TRUE];
NSNumber *timedLayoutEnabled = [NSNumber numberWithBool:TRUE];
NSNumber *resourceTimedLayoutEnabled = [NSNumber numberWithBool:TRUE];
+ NSNumber *allowAnimatedImages = [NSNumber numberWithBool:TRUE];
+ NSNumber *allowAnimatedImageLooping = [NSNumber numberWithBool:TRUE];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"0x0", WebKitLogLevelPreferenceKey,
@@ -67,6 +71,8 @@ static IFPreferences *_standardPreferences = nil;
javaEnabled, WebKitJavaEnabledPreferenceKey,
jScriptEnabled, WebKitJScriptEnabledPreferenceKey,
pluginsEnabled, WebKitPluginsEnabledPreferenceKey,
+ allowAnimatedImages, WebKitAllowAnimatedImagesPreferenceKey,
+ allowAnimatedImageLooping, WebKitAllowAnimatedImageLoopingPreferenceKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -214,5 +220,26 @@ static IFPreferences *_standardPreferences = nil;
}
+- (BOOL)allowAnimatedImages
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitAllowAnimatedImagesPreferenceKey];
+}
+
+- (void)setAllowAnimatedImages:(BOOL)flag;
+{
+ [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitAllowAnimatedImagesPreferenceKey];
+}
+
+- (BOOL)allowAnimatedImageLooping
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitAllowAnimatedImageLoopingPreferenceKey];
+}
+
+- (void)setAllowAnimatedImageLooping: (BOOL)flag
+{
+ [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitAllowAnimatedImageLoopingPreferenceKey];
+}
+
+
@end
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index 1314dfb..4198d90 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -146,4 +146,12 @@ typedef enum {
// is only used when the policy is either IFContentPolicySave or IFContentPolicyOpenExternally.
- (void)haveContentPolicy: (IFContentPolicy)policy andPath: (NSString *)path forLocationChangeHandler: (id <IFLocationChangeHandler>)handler;
+// API to manage animated images.
+- (void)stopAnimatedImages;
+- (void)startAnimatedImages;
+
+- (void)stopAnimatedImageLooping;
+- (void)startAnimatedImageLooping;
+
+
@end
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index a3eec41..d2c3b38 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -12,6 +12,7 @@
#import <WebKit/IFException.h>
#import <WebKit/IFWebCoreViewFactory.h>
#import <WebKit/IFTextRendererFactory.h>
+#import <WebKit/IFImageRendererFactory.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/IFNSStringExtensions.h>
@@ -35,6 +36,7 @@
[IFWebCoreViewFactory createSharedFactory];
[IFTextRendererFactory createSharedFactory];
+ [IFImageRendererFactory createSharedFactory];
_private = [[IFWebViewPrivate alloc] init];
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index 1314dfb..4198d90 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -146,4 +146,12 @@ typedef enum {
// is only used when the policy is either IFContentPolicySave or IFContentPolicyOpenExternally.
- (void)haveContentPolicy: (IFContentPolicy)policy andPath: (NSString *)path forLocationChangeHandler: (id <IFLocationChangeHandler>)handler;
+// API to manage animated images.
+- (void)stopAnimatedImages;
+- (void)startAnimatedImages;
+
+- (void)stopAnimatedImageLooping;
+- (void)startAnimatedImageLooping;
+
+
@end
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index a3eec41..d2c3b38 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -12,6 +12,7 @@
#import <WebKit/IFException.h>
#import <WebKit/IFWebCoreViewFactory.h>
#import <WebKit/IFTextRendererFactory.h>
+#import <WebKit/IFImageRendererFactory.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/IFNSStringExtensions.h>
@@ -35,6 +36,7 @@
[IFWebCoreViewFactory createSharedFactory];
[IFTextRendererFactory createSharedFactory];
+ [IFImageRendererFactory createSharedFactory];
_private = [[IFWebViewPrivate alloc] init];
diff --git a/WebKit/WebView.subproj/WebPreferences.h b/WebKit/WebView.subproj/WebPreferences.h
index 6c2a6c4..d415a75 100644
--- a/WebKit/WebView.subproj/WebPreferences.h
+++ b/WebKit/WebView.subproj/WebPreferences.h
@@ -44,6 +44,12 @@
- (BOOL)pluginsEnabled;
- (void)setPluginsEnabled:(BOOL)flag;
+- (BOOL)allowAnimatedImages;
+- (void)setAllowAnimatedImages:(BOOL)flag;
+
+- (BOOL)allowAnimatedImageLooping;
+- (void)setAllowAnimatedImageLooping: (BOOL)flag;
+
@end
#ifdef READY_FOR_PRIMETIME
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
index 76c9ade..2a31df7 100644
--- a/WebKit/WebView.subproj/WebPreferences.m
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -24,6 +24,8 @@
#define WebKitInitialTimedLayoutEnabledPreferenceKey @"WebKitInitialTimedLayoutEnabled"
#define WebKitResourceTimedLayoutEnabledPreferenceKey @"WebKitResourceTimedLayoutEnabled"
#define WebKitResourceTimedLayoutDelayPreferenceKey @"WebKitResourceTimedLayoutDelay"
+#define WebKitAllowAnimatedImagesPreferenceKey @"WebKitAllowAnimatedImagesPreferenceKey"
+#define WebKitAllowAnimatedImageLoopingPreferenceKey @"WebKitAllowAnimatedImageLoopingPreferenceKey"
@implementation IFPreferences
@@ -48,6 +50,8 @@ static IFPreferences *_standardPreferences = nil;
NSNumber *jScriptEnabled = [NSNumber numberWithBool:TRUE];
NSNumber *timedLayoutEnabled = [NSNumber numberWithBool:TRUE];
NSNumber *resourceTimedLayoutEnabled = [NSNumber numberWithBool:TRUE];
+ NSNumber *allowAnimatedImages = [NSNumber numberWithBool:TRUE];
+ NSNumber *allowAnimatedImageLooping = [NSNumber numberWithBool:TRUE];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"0x0", WebKitLogLevelPreferenceKey,
@@ -67,6 +71,8 @@ static IFPreferences *_standardPreferences = nil;
javaEnabled, WebKitJavaEnabledPreferenceKey,
jScriptEnabled, WebKitJScriptEnabledPreferenceKey,
pluginsEnabled, WebKitPluginsEnabledPreferenceKey,
+ allowAnimatedImages, WebKitAllowAnimatedImagesPreferenceKey,
+ allowAnimatedImageLooping, WebKitAllowAnimatedImageLoopingPreferenceKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -214,5 +220,26 @@ static IFPreferences *_standardPreferences = nil;
}
+- (BOOL)allowAnimatedImages
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitAllowAnimatedImagesPreferenceKey];
+}
+
+- (void)setAllowAnimatedImages:(BOOL)flag;
+{
+ [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitAllowAnimatedImagesPreferenceKey];
+}
+
+- (BOOL)allowAnimatedImageLooping
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitAllowAnimatedImageLoopingPreferenceKey];
+}
+
+- (void)setAllowAnimatedImageLooping: (BOOL)flag
+{
+ [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitAllowAnimatedImageLoopingPreferenceKey];
+}
+
+
@end
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 1314dfb..4198d90 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -146,4 +146,12 @@ typedef enum {
// is only used when the policy is either IFContentPolicySave or IFContentPolicyOpenExternally.
- (void)haveContentPolicy: (IFContentPolicy)policy andPath: (NSString *)path forLocationChangeHandler: (id <IFLocationChangeHandler>)handler;
+// API to manage animated images.
+- (void)stopAnimatedImages;
+- (void)startAnimatedImages;
+
+- (void)stopAnimatedImageLooping;
+- (void)startAnimatedImageLooping;
+
+
@end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list