[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:04:08 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit c6b6763de27eea299c38e60ab688a2e272e526a6
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Apr 9 23:44:20 2002 +0000
* Plugins.subproj/IFPluginView.h:
* Plugins.subproj/IFPluginView.mm: (-[IFPluginView
initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView setWindow]),
(-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView start]),
(-[IFPluginView stop]), (-[IFPluginView dealloc]), (-[IFPluginView
findSuperview:]), (-[IFPluginView sendUpdateEvent]), (-[IFPluginView drawRect:]),
(-[IFPluginView isFlipped]), (-[IFPluginView viewHasMoved:]), (-[IFPluginView
windowBecameKey:]), (-[IFPluginView windowResignedKey:]), (-[IFPluginView
windowWillClose:]), (-[IFPluginView IFURLHandleResourceDidBeginLoading:]),
(-[IFPluginView IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFPluginView
IFURLHandleResourceDidFinishLoading:data:]), (-[IFPluginView
IFURLHandleResourceDidCancelLoading:]), (-[IFPluginView
IFURLHandle:resourceDidFailLoadingWithResult:]), (-[IFPluginView
IFURLHandle:didRedirectToURL:]), (-[IFPluginView forceRedraw]), (IFPluginMake),
(+[IFPluginView load]):
* WebKit.pbproj/project.pbxproj:
* WebView.subproj/IFLoadProgress.h:
Cleaned up the IFPluginView code. Moved a lot of things around.
Added support for plug-in file download progress.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3475d16..a8f4a02 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,27 @@
+2002-04-09 Chris Blumenberg <cblu at apple.com>
+
+ * Plugins.subproj/IFPluginView.h:
+ * Plugins.subproj/IFPluginView.mm: (-[IFPluginView
+ initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView setWindow]),
+ (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView start]),
+ (-[IFPluginView stop]), (-[IFPluginView dealloc]), (-[IFPluginView
+ findSuperview:]), (-[IFPluginView sendUpdateEvent]), (-[IFPluginView drawRect:]),
+ (-[IFPluginView isFlipped]), (-[IFPluginView viewHasMoved:]), (-[IFPluginView
+ windowBecameKey:]), (-[IFPluginView windowResignedKey:]), (-[IFPluginView
+ windowWillClose:]), (-[IFPluginView IFURLHandleResourceDidBeginLoading:]),
+ (-[IFPluginView IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFPluginView
+ IFURLHandleResourceDidFinishLoading:data:]), (-[IFPluginView
+ IFURLHandleResourceDidCancelLoading:]), (-[IFPluginView
+ IFURLHandle:resourceDidFailLoadingWithResult:]), (-[IFPluginView
+ IFURLHandle:didRedirectToURL:]), (-[IFPluginView forceRedraw]), (IFPluginMake),
+ (+[IFPluginView load]):
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/IFLoadProgress.h:
+
+ Cleaned up the IFPluginView code. Moved a lot of things around.
+
+ Added support for plug-in file download progress.
+
2002-04-08 Chris Blumenberg <cblu at apple.com>
* Plugins.subproj/IFPluginView.h:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 3475d16..a8f4a02 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,27 @@
+2002-04-09 Chris Blumenberg <cblu at apple.com>
+
+ * Plugins.subproj/IFPluginView.h:
+ * Plugins.subproj/IFPluginView.mm: (-[IFPluginView
+ initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView setWindow]),
+ (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView start]),
+ (-[IFPluginView stop]), (-[IFPluginView dealloc]), (-[IFPluginView
+ findSuperview:]), (-[IFPluginView sendUpdateEvent]), (-[IFPluginView drawRect:]),
+ (-[IFPluginView isFlipped]), (-[IFPluginView viewHasMoved:]), (-[IFPluginView
+ windowBecameKey:]), (-[IFPluginView windowResignedKey:]), (-[IFPluginView
+ windowWillClose:]), (-[IFPluginView IFURLHandleResourceDidBeginLoading:]),
+ (-[IFPluginView IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFPluginView
+ IFURLHandleResourceDidFinishLoading:data:]), (-[IFPluginView
+ IFURLHandleResourceDidCancelLoading:]), (-[IFPluginView
+ IFURLHandle:resourceDidFailLoadingWithResult:]), (-[IFPluginView
+ IFURLHandle:didRedirectToURL:]), (-[IFPluginView forceRedraw]), (IFPluginMake),
+ (+[IFPluginView load]):
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/IFLoadProgress.h:
+
+ Cleaned up the IFPluginView code. Moved a lot of things around.
+
+ Added support for plug-in file download progress.
+
2002-04-08 Chris Blumenberg <cblu at apple.com>
* Plugins.subproj/IFPluginView.h:
diff --git a/WebKit/Plugins.subproj/IFPluginView.h b/WebKit/Plugins.subproj/IFPluginView.h
index 715e085..3f04a30 100644
--- a/WebKit/Plugins.subproj/IFPluginView.h
+++ b/WebKit/Plugins.subproj/IFPluginView.h
@@ -5,38 +5,21 @@
#import <AppKit/AppKit.h>
#import <WCPlugin.h>
-#include <qwidget.h>
-#include <npapi.h>
+#import <qwidget.h>
+#import <npapi.h>
#import <WebFoundation/WebFoundation.h>
#import <IFWebView.h>
#import <IFBaseWebController.h>
-
-typedef struct _StreamData{
- uint16 transferMode;
- int32 offset;
- NPStream *stream;
- char *mimeType;
- NSString *filename;
- NSMutableData *data;
-} StreamData;
-
- at interface IFPluginViewNullEventSender : NSObject{
- NPP instance;
- NPP_HandleEventProcPtr NPP_HandleEvent;
- bool shouldStop;
-}
-
--(id)initializeWithNPP:(NPP)pluginInstance functionPointer:(NPP_HandleEventProcPtr)HandleEventFunction;
--(void)sendNullEvents;
--(void)stop;
- at end
+#import <IFPluginNullEventSender.h>
@interface IFPluginView : NSView {
WCPlugin *plugin;
- IFPluginViewNullEventSender *eventSender;
+ IFPluginNullEventSender *eventSender;
IFBaseWebController *webController;
IFWebView *webView;
+ IFWebFrame *webFrame;
+ IFWebDataSource *webDataSource;
NPP instance;
NPWindow window;
@@ -70,9 +53,9 @@ typedef struct _StreamData{
-(void)drawRect:(NSRect)rect;
-(void)setWindow;
-(void)viewHasMoved:(NSNotification *)notification;
--(NSView *)findSuperview:(NSString *) viewName;
-- (void) windowWillClose:(NSNotification *)notification;
+-(void) windowWillClose:(NSNotification *)notification;
-(void)newStream:(NSURL *)streamURL mimeType:(NSString *)mimeType notifyData:(void *)notifyData;
+-(NSView *) findSuperview:(NSString *)viewName;
-(BOOL)acceptsFirstResponder;
-(BOOL)becomeFirstResponder;
-(BOOL)resignFirstResponder;
diff --git a/WebKit/Plugins.subproj/IFPluginView.mm b/WebKit/Plugins.subproj/IFPluginView.mm
index 2522007..20b5298 100644
--- a/WebKit/Plugins.subproj/IFPluginView.mm
+++ b/WebKit/Plugins.subproj/IFPluginView.mm
@@ -2,68 +2,29 @@
IFPluginView.mm
Copyright 2002, Apple, Inc. All rights reserved.
*/
+
#define USE_CARBON 1
#import "IFPluginView.h"
+
#import <AppKit/NSWindow_Private.h>
-#import "WebKitDebug.h"
+#import <Carbon/Carbon.h>
-#include <Carbon/Carbon.h>
-#include <WebFoundation/IFURLHandle.h>
+#import <WCPluginWidget.h>
+#import <WebFoundation/IFURLHandle.h>
+#import <IFPluginStream.h>
#import <IFWebDataSource.h>
-#include <WCPluginWidget.h>
+#import <IFError.h>
+#import <WebKitDebug.h>
extern "C" {
-#include <CoreGraphics/CoreGraphics.h>
-#include <CoreGraphics/CoreGraphicsPrivate.h>
-}
-
- at implementation IFPluginViewNullEventSender
-
--(id)initializeWithNPP:(NPP)pluginInstance functionPointer:(NPP_HandleEventProcPtr)HandleEventFunction;
-{
- instance = pluginInstance;
- NPP_HandleEvent = HandleEventFunction;
- shouldStop = FALSE;
- return self;
-}
-
--(void)sendNullEvents
-{
- EventRecord event;
- bool acceptedEvent;
- UnsignedWide msecs;
-
- if(!shouldStop){
- event.what = nullEvent;
- Microseconds(&msecs);
- event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
- acceptedEvent = NPP_HandleEvent(instance, &event);
- //KWQDebug("NPP_HandleEvent(nullEvent): %d when: %u %d\n", acceptedEvent, (unsigned)event.when, shouldStop);
- [self performSelector:@selector(sendNullEvents) withObject:nil afterDelay:.1];
- }
-}
-
--(void) stop
-{
- WEBKITDEBUG("Stopping null events\n");
- shouldStop = TRUE;
- [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(sendNullEvents) object:nil];
+#import <CoreGraphics/CoreGraphics.h>
+#import <CoreGraphics/CoreGraphicsPrivate.h>
}
- at end
-
@implementation IFPluginView
-static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *mimeType, NSDictionary *arguments, uint16 mode)
-{
- return [[[IFPluginView alloc] initWithFrame:rect plugin:plugin url:url mime:mimeType arguments:arguments mode:mode] autorelease];
-}
-
-+(void) load
-{
- WCSetIFPluginMakeFunc(IFPluginMake);
-}
+#pragma mark IFPLUGINVIEW
- initWithFrame:(NSRect)r plugin:(WCPlugin *)plug url:(NSString *)location mime:(NSString *)mimeType arguments:(NSDictionary *)arguments mode:(uint16)mode
{
@@ -75,20 +36,21 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
uint i;
[super initWithFrame: r];
- //instance = malloc(sizeof(NPP_t)); // this doesn't work for Flash, so I have create a NPP_t and point to it
+
+ // The following line doesn't work for Flash, so I have create a NPP_t struct and point to it
+ //instance = malloc(sizeof(NPP_t));
instance = &instanceStruct;
instance->ndata = self;
- mime = mimeType;
- URL = location;
- plugin = plug;
- [mime retain];
- [URL retain];
- [plugin retain];
+ mime = [mimeType retain];
+ URL = [location retain];
+ plugin = [plug retain];
+ // load the plug-in if it is not already loaded
[plugin load];
- NPP_New = [plugin NPP_New]; // copy function pointers
+ // copy function pointers
+ NPP_New = [plugin NPP_New];
NPP_Destroy = [plugin NPP_Destroy];
NPP_SetWindow = [plugin NPP_SetWindow];
NPP_NewStream = [plugin NPP_NewStream];
@@ -122,7 +84,8 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
hidden = FALSE;
}
- for(i=0; i<[arguments count]; i++){ // convert dictionary to 2 string arrays
+ // convert arugments dictionary to 2 string arrays
+ for(i=0; i<[arguments count]; i++){
attributeString = [attributes objectAtIndex:i];
s = malloc([attributeString length]+1);
[attributeString getCString:s];
@@ -139,63 +102,20 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
}
WEBKITDEBUG("NPP_New: %d\n", npErr);
+ free(cMime);
+
+ // Initialize globals
transferred = FALSE;
stopped = FALSE;
- filesToErase = [NSMutableArray arrayWithCapacity:2];
- [filesToErase retain];
- activeURLHandles = [NSMutableArray arrayWithCapacity:1];
- [activeURLHandles retain];
+ filesToErase = [[NSMutableArray arrayWithCapacity:2] retain];
+ activeURLHandles = [[NSMutableArray arrayWithCapacity:1] retain];
+
+ // Create a WindowRef is one doesn't already exist
[[self window] _windowRef];
+
return self;
}
-- (void)drawRect:(NSRect)rect
-{
- if(!transferred){
- NSNotificationCenter *notificationCenter;
- NSWindow *theWindow;
-
- [self setWindow];
- theWindow = [self window];
- notificationCenter = [NSNotificationCenter defaultCenter];
- [notificationCenter addObserver:self selector:@selector(viewHasMoved:) name:@"NSViewBoundsDidChangeNotification" object:[self findSuperview:@"NSClipView"]];
- [notificationCenter addObserver:self selector:@selector(viewHasMoved:) name:@"NSWindowDidResizeNotification" object:theWindow];
- [notificationCenter addObserver:self selector:@selector(windowWillClose:) name:@"NSWindowWillCloseNotification" object:theWindow];
- [notificationCenter addObserver:self selector:@selector(windowBecameKey:) name:@"NSWindowDidBecomeKeyNotification" object:theWindow];
- [notificationCenter addObserver:self selector:@selector(windowResignedKey:) name:@"NSWindowDidResignKeyNotification" object:theWindow];
- [self sendActivateEvent:[theWindow isKeyWindow]];
- if(URL)
- [self newStream:[NSURL URLWithString:URL] mimeType:mime notifyData:NULL];
- eventSender = [[IFPluginViewNullEventSender alloc] initializeWithNPP:instance functionPointer:NPP_HandleEvent];
- [eventSender sendNullEvents];
- transferred = TRUE;
- webView = [self findSuperview:@"IFWebView"];
- webController = [webView controller];
- trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
- }
- [self sendUpdateEvent];
-}
-
-- (BOOL)isFlipped
-{
- return YES;
-}
-
--(void) viewHasMoved:(NSNotification *)notification
-{
- [self sendUpdateEvent];
- [self setWindow];
-}
-
--(void) windowBecameKey:(NSNotification *)notification
-{
- [self sendActivateEvent:TRUE];
-}
-
--(void) windowResignedKey:(NSNotification *)notification
-{
- [self sendActivateEvent:FALSE];
-}
- (void) setWindow
{
@@ -228,168 +148,179 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
npErr = NPP_SetWindow(instance, &window);
WEBKITDEBUG("NPP_SetWindow: %d, port=%d\n", npErr, (int)nPort.port);
- WEBKITDEBUG("frameInWindow.origin.x=%f, frameInWindow.origin.y=%f, frameInWindow.size.height=%d, frameInWindow.size.width=%d\n",
- frameInWindow.origin.x, frameInWindow.origin.y, (int)frameInWindow.size.height, (int)frameInWindow.size.width);
- WEBKITDEBUG("visibleRectInWindow.origin.x=%f, visibleRectInWindow.origin.y=%f, visibleRectInWindow.size.height=%d, visibleRectInWindow.size.width=%d\n",
- visibleRectInWindow.origin.x, visibleRectInWindow.origin.y, (int)visibleRectInWindow.size.height, (int)visibleRectInWindow.size.width);
-}
-
-- (NSView *) findSuperview:(NSString *) viewName
-{
- NSView *view;
-
- view = self;
- while(view){
- view = [view superview];
- if([[view className] isEqualToString:viewName]){
- return view;
- }
- }
- return nil;
-}
-
-- (void) windowWillClose:(NSNotification *)notification
-{
- [self stop];
}
-
- (void) newStream:(NSURL *)streamURL mimeType:(NSString *)mimeType notifyData:(void *)notifyData
{
- char *cURL, *cMime;
- StreamData *streamData;
- NPStream *stream;
+ IFPluginStream *stream;
+ NPStream *npStream;
NPError npErr;
uint16 transferMode;
IFURLHandle *urlHandle;
NSDictionary *attributes;
- NSString *streamURLString;
+ char *cMime;
- streamURLString = [streamURL absoluteString];
- stream = malloc(sizeof(NPStream));
- cURL = malloc([streamURLString length]+1);
- cMime = malloc([mimeType length]+1);
- [streamURLString getCString:cURL];
- [mimeType getCString:cMime];
- stream->url = cURL;
- stream->end = 0;
- stream->lastmodified = 0;
- stream->notifyData = notifyData;
+ stream = [[IFPluginStream alloc] initWithURL:streamURL mimeType:mimeType notifyData:notifyData];
+ npStream = [stream npStream];
- streamData = malloc(sizeof(StreamData));
- streamData->stream = stream;
- streamData->offset = 0;
- streamData->mimeType = cMime;
+ cMime = malloc([mimeType length]+1);
+ [mimeType getCString:cMime];
- npErr = NPP_NewStream(instance, cMime, stream, FALSE, &transferMode);
+ npErr = NPP_NewStream(instance, cMime, npStream, FALSE, &transferMode);
WEBKITDEBUG("NPP_NewStream: %d\n", npErr);
- streamData->transferMode = transferMode;
+ [stream setTransferMode:transferMode];
+ free(cMime);
if(transferMode == NP_NORMAL){
WEBKITDEBUG("Stream type: NP_NORMAL\n");
- attributes = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:streamData] forKey:IFURLHandleUserData];
- urlHandle = [[IFURLHandle alloc] initWithURL:streamURL attributes:attributes flags:0];
- [urlHandle addClient:self];
- [activeURLHandles addObject:urlHandle];
- [urlHandle loadInBackground];
}else if(transferMode == NP_ASFILEONLY || transferMode == NP_ASFILE){
- if(transferMode == NP_ASFILEONLY) WEBKITDEBUG("Stream type: NP_ASFILEONLY\n");
- if(transferMode == NP_ASFILE) WEBKITDEBUG("Stream type: NP_ASFILE\n");
- streamData->filename = [NSString stringWithString:[streamURLString lastPathComponent]];
- [streamData->filename retain];
- streamData->data = [NSMutableData dataWithCapacity:0];
- [streamData->data retain];
- attributes = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:streamData] forKey:IFURLHandleUserData];
- urlHandle = [[IFURLHandle alloc] initWithURL:streamURL attributes:attributes flags:0];
- [urlHandle addClient:self];
- if(urlHandle!=nil){
- [activeURLHandles addObject:urlHandle];
- [urlHandle loadInBackground];
- }
+ if(transferMode == NP_ASFILEONLY)
+ WEBKITDEBUG("Stream type: NP_ASFILEONLY\n");
+ if(transferMode == NP_ASFILE)
+ WEBKITDEBUG("Stream type: NP_ASFILE\n");
+ [stream setFilename:[[streamURL path] lastPathComponent]];
+ [stream setData:[NSMutableData dataWithCapacity:0]];
}else if(transferMode == NP_SEEK){
WEBKITDEBUG("Stream type: NP_SEEK not yet supported\n");
+ return;
+ }
+ attributes = [NSDictionary dictionaryWithObject:stream forKey:IFURLHandleUserData];
+ urlHandle = [[IFURLHandle alloc] initWithURL:streamURL attributes:attributes flags:0];
+ if(urlHandle!=nil){
+ [urlHandle addClient:self];
+ [activeURLHandles addObject:urlHandle];
+ [urlHandle loadInBackground];
}
}
-// cache methods
+-(void)start
+{
+
+}
-- (void)IFURLHandle:(IFURLHandle *)sender resourceDataDidBecomeAvailable:(NSData *)data
+- (void)stop
{
- int32 bytes;
- StreamData *streamData;
+ NPError npErr;
+ unsigned i;
- streamData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
- if(streamData->transferMode != NP_ASFILEONLY){
- bytes = NPP_WriteReady(instance, streamData->stream);
- //WEBKITDEBUG("NPP_WriteReady bytes=%u\n", bytes);
- bytes = NPP_Write(instance, streamData->stream, streamData->offset, [data length], (void *)[data bytes]);
- //WEBKITDEBUG("NPP_Write bytes=%u\n", bytes);
- streamData->offset += [data length];
- }
- if(streamData->transferMode == NP_ASFILE || streamData->transferMode == NP_ASFILEONLY){
- [streamData->data appendData:data];
+ if (!stopped){
+ for(i=0; i<[activeURLHandles count]; i++){
+ [[activeURLHandles objectAtIndex:i] cancelLoadInBackground];
+ }
+ [eventSender stop];
+ [eventSender release];
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [self removeTrackingRect:trackingTag];
+ npErr = NPP_Destroy(instance, NULL);
+ WEBKITDEBUG("NPP_Destroy: %d\n", npErr);
+ stopped = TRUE;
}
}
-- (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)sender data: (NSData *)data
+-(void)dealloc
{
- NPError npErr;
- char *cFilename;
- NSMutableString *filenameClassic, *filename;
- StreamData *streamData;
+ unsigned i;
NSFileManager *fileManager;
- streamData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
- if(streamData->transferMode == NP_ASFILE || streamData->transferMode == NP_ASFILEONLY){
- filenameClassic = [NSMutableString stringWithCapacity:200];
- filename = [NSMutableString stringWithCapacity:200];
- [filenameClassic appendString:startupVolumeName()];
- [filenameClassic appendString:@":private:tmp:"]; //FIXME: This should be the user's cache directory or somewhere else
- [filenameClassic appendString:streamData->filename];
- [filename appendString:@"/tmp/"];
- [filename appendString:streamData->filename];
- [filesToErase addObject:filename];
- fileManager = [NSFileManager defaultManager];
- WEBKITDEBUG("Writing plugin file out to: %s %s size: %u\n", [filenameClassic cString], [filename cString], [streamData->data length]);
- [fileManager removeFileAtPath:filename handler:nil];
- [fileManager createFileAtPath:filename contents:streamData->data attributes:nil];
- cFilename = malloc([filenameClassic length]+1);
- [filenameClassic getCString:cFilename];
- NPP_StreamAsFile(instance, streamData->stream, cFilename);
- WEBKITDEBUG("NPP_StreamAsFile: %s\n", cFilename);
- [streamData->data release];
- [streamData->filename release];
+ [self stop];
+ fileManager = [NSFileManager defaultManager];
+ for(i=0; i<[filesToErase count]; i++){ // remove downloaded files
+ [fileManager removeFileAtPath:[filesToErase objectAtIndex:i] handler:nil];
}
- npErr = NPP_DestroyStream(instance, streamData->stream, NPRES_DONE);
- WEBKITDEBUG("NPP_DestroyStream: %d\n", npErr);
- if(streamData->stream->notifyData){
- NPP_URLNotify(instance, streamData->stream->url, NPRES_DONE, streamData->stream->notifyData);
- WEBKITDEBUG("NPP_URLNotify\n");
+ [filesToErase release];
+ [activeURLHandles release];
+ [mime release];
+ [URL release];
+ [plugin release];
+ free(cAttributes);
+ free(cValues);
+ [super dealloc];
+}
+
+- (NSView *) findSuperview:(NSString *)viewName
+{
+ NSView *view;
+
+ view = self;
+ while(view){
+ view = [view superview];
+ if([[view className] isEqualToString:viewName]){
+ return view;
+ }
}
- free(streamData);
- [activeURLHandles removeObject:sender];
+ return nil;
}
-- (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)sender
+#pragma mark EVENTS
+
+-(void)sendActivateEvent:(BOOL)isActive;
{
+ EventRecord event;
+ bool acceptedEvent;
+ UnsignedWide msecs;
+
+ event.what = activateEvt;
+ event.message = (uint32)GetWindowPort([[self window] _windowRef]);
+ Microseconds(&msecs);
+ event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
+ event.modifiers = isActive;
+ acceptedEvent = NPP_HandleEvent(instance, &event);
+ WEBKITDEBUG("NPP_HandleEvent(activateEvent): %d isActive: %d\n", acceptedEvent, (event.modifiers & activeFlag));
}
-- (void)IFURLHandleResourceDidCancelLoading:(IFURLHandle *)sender
+-(void)sendUpdateEvent
{
- [self stop];
+ EventRecord event;
+ bool acceptedEvent;
+ UnsignedWide msecs;
+
+ event.what = updateEvt;
+ event.message = (uint32)GetWindowPort([[self window] _windowRef]);
+ Microseconds(&msecs);
+ event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
+ acceptedEvent = NPP_HandleEvent(instance, &event);
+ WEBKITDEBUG("NPP_HandleEvent(updateEvt): %d when: %lu\n", acceptedEvent, event.when);
}
-- (void)IFURLHandle:(IFURLHandle *)sender resourceDidFailLoadingWithResult:(int)result
+
+#pragma mark NSVIEW
+
+- (void)drawRect:(NSRect)rect
{
- [self stop];
+ if(!transferred){
+ NSNotificationCenter *notificationCenter;
+ NSWindow *theWindow;
+
+ [self setWindow];
+ theWindow = [self window];
+ notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter addObserver:self selector:@selector(viewHasMoved:) name:@"NSViewBoundsDidChangeNotification" object:[self findSuperview:@"NSClipView"]];
+ [notificationCenter addObserver:self selector:@selector(viewHasMoved:) name:@"NSWindowDidResizeNotification" object:theWindow];
+ [notificationCenter addObserver:self selector:@selector(windowWillClose:) name:@"NSWindowWillCloseNotification" object:theWindow];
+ [notificationCenter addObserver:self selector:@selector(windowBecameKey:) name:@"NSWindowDidBecomeKeyNotification" object:theWindow];
+ [notificationCenter addObserver:self selector:@selector(windowResignedKey:) name:@"NSWindowDidResignKeyNotification" object:theWindow];
+ [self sendActivateEvent:[theWindow isKeyWindow]];
+ if(URL)
+ [self newStream:[NSURL URLWithString:URL] mimeType:mime notifyData:NULL];
+ eventSender = [[IFPluginNullEventSender alloc] initializeWithNPP:instance functionPointer:NPP_HandleEvent];
+ [eventSender sendNullEvents];
+ transferred = TRUE;
+ trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
+
+ webView = [self findSuperview:@"IFWebView"];
+ webController = [webView controller];
+ webFrame = [webController frameForView:webView];
+ webDataSource = [webFrame dataSource];
+ }
+ [self sendUpdateEvent];
}
-- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)url
+- (BOOL)isFlipped
{
-
+ return YES;
}
-// event methods
+#pragma mark NSRESPONDER
-(BOOL)acceptsFirstResponder
{
@@ -424,34 +355,6 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
return YES;
}
--(void)sendActivateEvent:(BOOL)isActive;
-{
- EventRecord event;
- bool acceptedEvent;
- UnsignedWide msecs;
-
- event.what = activateEvt;
- event.message = (uint32)GetWindowPort([[self window] _windowRef]);
- Microseconds(&msecs);
- event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
- event.modifiers = isActive;
- acceptedEvent = NPP_HandleEvent(instance, &event);
- WEBKITDEBUG("NPP_HandleEvent(activateEvent): %d isActive: %d\n", acceptedEvent, (event.modifiers & activeFlag));
-}
-
--(void)sendUpdateEvent
-{
- EventRecord event;
- bool acceptedEvent;
- UnsignedWide msecs;
-
- event.what = updateEvt;
- event.message = (uint32)GetWindowPort([[self window] _windowRef]);
- Microseconds(&msecs);
- event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
- acceptedEvent = NPP_HandleEvent(instance, &event);
- WEBKITDEBUG("NPP_HandleEvent(updateEvt): %d when: %lu\n", acceptedEvent, event.when);
-}
-(void)mouseDown:(NSEvent *)theEvent
{
@@ -536,7 +439,153 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
WEBKITDEBUG("NPP_HandleEvent(keyDown): %d key:%c\n", acceptedEvent, (char) (event.message & charCodeMask));
}
-// plug-in to browser calls
+#pragma mark NOTIFICATIONS
+
+-(void) viewHasMoved:(NSNotification *)notification
+{
+ [self sendUpdateEvent];
+ [self setWindow];
+}
+
+-(void) windowBecameKey:(NSNotification *)notification
+{
+ [self sendActivateEvent:TRUE];
+}
+
+-(void) windowResignedKey:(NSNotification *)notification
+{
+ [self sendActivateEvent:FALSE];
+}
+
+- (void) windowWillClose:(NSNotification *)notification
+{
+ [self stop];
+}
+
+
+#pragma mark IFURLHANDLE
+
+- (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)sender
+{
+
+}
+
+- (void)IFURLHandle:(IFURLHandle *)sender resourceDataDidBecomeAvailable:(NSData *)data
+{
+ int32 bytes;
+ IFPluginStream *stream;
+ uint16 transferMode;
+ NPStream *npStream;
+
+ stream = [[sender attributes] objectForKey:IFURLHandleUserData];
+ transferMode = [stream transferMode];
+ npStream = [stream npStream];
+
+ if(transferMode != NP_ASFILEONLY){
+ bytes = NPP_WriteReady(instance, npStream);
+ //WEBKITDEBUG("NPP_WriteReady bytes=%u\n", bytes);
+ bytes = NPP_Write(instance, npStream, [stream offset], [data length], (void *)[data bytes]);
+ //WEBKITDEBUG("NPP_Write bytes=%u\n", bytes);
+ [stream incrementOffset:[data length]];
+ }
+ if(transferMode == NP_ASFILE || transferMode == NP_ASFILEONLY){
+ [[stream data] appendData:data];
+ }
+
+ IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
+ loadProgress->totalToLoad = [sender contentLength];
+ loadProgress->bytesSoFar = [sender contentLengthReceived];
+ loadProgress->type = IF_LOAD_TYPE_PLUGIN;
+ [webController receivedProgress: (IFLoadProgress *)loadProgress
+ forResource: [[sender url] absoluteString] fromDataSource: webDataSource];
+ [loadProgress release];
+
+}
+
+- (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)sender data: (NSData *)data
+{
+ NPError npErr;
+ char *cFilename;
+ NSMutableString *filenameClassic, *path;
+ IFPluginStream *stream;
+ NSFileManager *fileManager;
+ uint16 transferMode;
+ NPStream *npStream;
+ NSString *filename;
+
+ stream = [[sender attributes] objectForKey:IFURLHandleUserData];
+ transferMode = [stream transferMode];
+ npStream = [stream npStream];
+ filename = [stream filename];
+
+ if(transferMode == NP_ASFILE || transferMode == NP_ASFILEONLY){
+ path = [NSString stringWithFormat:@"%@%@", @"/tmp/", filename];
+ [filesToErase addObject:path];
+
+ fileManager = [NSFileManager defaultManager];
+ [fileManager removeFileAtPath:path handler:nil];
+ [fileManager createFileAtPath:path contents:[stream data] attributes:nil];
+
+ filenameClassic = [NSString stringWithFormat:@"%@%@%@", startupVolumeName(), @":private:tmp:", filename]; cFilename = malloc([filenameClassic length]+1);
+ [filenameClassic getCString:cFilename];
+
+ NPP_StreamAsFile(instance, npStream, cFilename);
+ WEBKITDEBUG("NPP_StreamAsFile: %s\n", cFilename);
+ }
+ npErr = NPP_DestroyStream(instance, npStream, NPRES_DONE);
+ WEBKITDEBUG("NPP_DestroyStream: %d\n", npErr);
+
+ if(npStream->notifyData){
+ NPP_URLNotify(instance, npStream->url, NPRES_DONE, npStream->notifyData);
+ WEBKITDEBUG("NPP_URLNotify\n");
+ }
+ [stream release];
+ [activeURLHandles removeObject:sender];
+
+ IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
+ loadProgress->totalToLoad = [data length];
+ loadProgress->bytesSoFar = [data length];
+ loadProgress->type = IF_LOAD_TYPE_PLUGIN;
+ [webController receivedProgress: (IFLoadProgress *)loadProgress
+ forResource: [[sender url] absoluteString] fromDataSource: webDataSource];
+ [loadProgress release];
+}
+
+- (void)IFURLHandleResourceDidCancelLoading:(IFURLHandle *)sender
+{
+ [self stop];
+
+ IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
+ loadProgress->totalToLoad = -1;
+ loadProgress->bytesSoFar = -1;
+ loadProgress->type = IF_LOAD_TYPE_PLUGIN;
+ [webController receivedProgress: (IFLoadProgress *)loadProgress
+ forResource: [[sender url] absoluteString] fromDataSource: webDataSource];
+ [loadProgress release];
+}
+
+- (void)IFURLHandle:(IFURLHandle *)sender resourceDidFailLoadingWithResult:(int)result
+{
+ [self stop];
+
+ IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
+ loadProgress->totalToLoad = [sender contentLength];
+ loadProgress->bytesSoFar = [sender contentLengthReceived];
+ loadProgress->type = IF_LOAD_TYPE_PLUGIN;
+
+ IFError *error = [[IFError alloc] initWithErrorCode: result failingURL: [sender url]];
+ [webController receivedError: error forResource: [[sender url] absoluteString]
+ partialProgress: loadProgress fromDataSource: webDataSource];
+ [error release];
+ [loadProgress release];
+}
+
+- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)url
+{
+
+}
+
+#pragma mark PLUGIN-TO-BROWSER
-(NPError)getURLNotify:(const char *)url target:(const char *)target notifyData:(void *)notifyData
{
@@ -638,53 +687,21 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
WEBKITDEBUG("NPN_InvalidateRegion\n");
}
--(void)start
+-(void)forceRedraw
{
-
+ WEBKITDEBUG("forceRedraw\n");
}
-- (void)stop
-{
- NPError npErr;
- unsigned i;
-
- if (!stopped){
- for(i=0; i<[activeURLHandles count]; i++){
- [[activeURLHandles objectAtIndex:i] cancelLoadInBackground];
- }
- [eventSender stop];
- [eventSender release];
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- [self removeTrackingRect:trackingTag];
- npErr = NPP_Destroy(instance, NULL);
- WEBKITDEBUG("NPP_Destroy: %d\n", npErr);
- stopped = TRUE;
- }
-}
+#pragma mark PREBINDING
--(void)forceRedraw
+static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *mimeType, NSDictionary *arguments, uint16 mode)
{
- WEBKITDEBUG("forceRedraw\n");
+ return [[[IFPluginView alloc] initWithFrame:rect plugin:plugin url:url mime:mimeType arguments:arguments mode:mode] autorelease];
}
--(void)dealloc
++(void) load
{
- unsigned i;
- NSFileManager *fileManager;
-
- [self stop];
- fileManager = [NSFileManager defaultManager];
- for(i=0; i<[filesToErase count]; i++){ // remove downloaded files
- [fileManager removeFileAtPath:[filesToErase objectAtIndex:i] handler:nil];
- }
- [filesToErase release];
- [activeURLHandles release];
- [mime release];
- [URL release];
- [plugin release];
- free(cAttributes);
- free(cValues);
- [super dealloc];
+ WCSetIFPluginMakeFunc(IFPluginMake);
}
@end
diff --git a/WebKit/Plugins.subproj/WebPluginView.h b/WebKit/Plugins.subproj/WebPluginView.h
index 715e085..3f04a30 100644
--- a/WebKit/Plugins.subproj/WebPluginView.h
+++ b/WebKit/Plugins.subproj/WebPluginView.h
@@ -5,38 +5,21 @@
#import <AppKit/AppKit.h>
#import <WCPlugin.h>
-#include <qwidget.h>
-#include <npapi.h>
+#import <qwidget.h>
+#import <npapi.h>
#import <WebFoundation/WebFoundation.h>
#import <IFWebView.h>
#import <IFBaseWebController.h>
-
-typedef struct _StreamData{
- uint16 transferMode;
- int32 offset;
- NPStream *stream;
- char *mimeType;
- NSString *filename;
- NSMutableData *data;
-} StreamData;
-
- at interface IFPluginViewNullEventSender : NSObject{
- NPP instance;
- NPP_HandleEventProcPtr NPP_HandleEvent;
- bool shouldStop;
-}
-
--(id)initializeWithNPP:(NPP)pluginInstance functionPointer:(NPP_HandleEventProcPtr)HandleEventFunction;
--(void)sendNullEvents;
--(void)stop;
- at end
+#import <IFPluginNullEventSender.h>
@interface IFPluginView : NSView {
WCPlugin *plugin;
- IFPluginViewNullEventSender *eventSender;
+ IFPluginNullEventSender *eventSender;
IFBaseWebController *webController;
IFWebView *webView;
+ IFWebFrame *webFrame;
+ IFWebDataSource *webDataSource;
NPP instance;
NPWindow window;
@@ -70,9 +53,9 @@ typedef struct _StreamData{
-(void)drawRect:(NSRect)rect;
-(void)setWindow;
-(void)viewHasMoved:(NSNotification *)notification;
--(NSView *)findSuperview:(NSString *) viewName;
-- (void) windowWillClose:(NSNotification *)notification;
+-(void) windowWillClose:(NSNotification *)notification;
-(void)newStream:(NSURL *)streamURL mimeType:(NSString *)mimeType notifyData:(void *)notifyData;
+-(NSView *) findSuperview:(NSString *)viewName;
-(BOOL)acceptsFirstResponder;
-(BOOL)becomeFirstResponder;
-(BOOL)resignFirstResponder;
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index 2522007..20b5298 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -2,68 +2,29 @@
IFPluginView.mm
Copyright 2002, Apple, Inc. All rights reserved.
*/
+
#define USE_CARBON 1
#import "IFPluginView.h"
+
#import <AppKit/NSWindow_Private.h>
-#import "WebKitDebug.h"
+#import <Carbon/Carbon.h>
-#include <Carbon/Carbon.h>
-#include <WebFoundation/IFURLHandle.h>
+#import <WCPluginWidget.h>
+#import <WebFoundation/IFURLHandle.h>
+#import <IFPluginStream.h>
#import <IFWebDataSource.h>
-#include <WCPluginWidget.h>
+#import <IFError.h>
+#import <WebKitDebug.h>
extern "C" {
-#include <CoreGraphics/CoreGraphics.h>
-#include <CoreGraphics/CoreGraphicsPrivate.h>
-}
-
- at implementation IFPluginViewNullEventSender
-
--(id)initializeWithNPP:(NPP)pluginInstance functionPointer:(NPP_HandleEventProcPtr)HandleEventFunction;
-{
- instance = pluginInstance;
- NPP_HandleEvent = HandleEventFunction;
- shouldStop = FALSE;
- return self;
-}
-
--(void)sendNullEvents
-{
- EventRecord event;
- bool acceptedEvent;
- UnsignedWide msecs;
-
- if(!shouldStop){
- event.what = nullEvent;
- Microseconds(&msecs);
- event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
- acceptedEvent = NPP_HandleEvent(instance, &event);
- //KWQDebug("NPP_HandleEvent(nullEvent): %d when: %u %d\n", acceptedEvent, (unsigned)event.when, shouldStop);
- [self performSelector:@selector(sendNullEvents) withObject:nil afterDelay:.1];
- }
-}
-
--(void) stop
-{
- WEBKITDEBUG("Stopping null events\n");
- shouldStop = TRUE;
- [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(sendNullEvents) object:nil];
+#import <CoreGraphics/CoreGraphics.h>
+#import <CoreGraphics/CoreGraphicsPrivate.h>
}
- at end
-
@implementation IFPluginView
-static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *mimeType, NSDictionary *arguments, uint16 mode)
-{
- return [[[IFPluginView alloc] initWithFrame:rect plugin:plugin url:url mime:mimeType arguments:arguments mode:mode] autorelease];
-}
-
-+(void) load
-{
- WCSetIFPluginMakeFunc(IFPluginMake);
-}
+#pragma mark IFPLUGINVIEW
- initWithFrame:(NSRect)r plugin:(WCPlugin *)plug url:(NSString *)location mime:(NSString *)mimeType arguments:(NSDictionary *)arguments mode:(uint16)mode
{
@@ -75,20 +36,21 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
uint i;
[super initWithFrame: r];
- //instance = malloc(sizeof(NPP_t)); // this doesn't work for Flash, so I have create a NPP_t and point to it
+
+ // The following line doesn't work for Flash, so I have create a NPP_t struct and point to it
+ //instance = malloc(sizeof(NPP_t));
instance = &instanceStruct;
instance->ndata = self;
- mime = mimeType;
- URL = location;
- plugin = plug;
- [mime retain];
- [URL retain];
- [plugin retain];
+ mime = [mimeType retain];
+ URL = [location retain];
+ plugin = [plug retain];
+ // load the plug-in if it is not already loaded
[plugin load];
- NPP_New = [plugin NPP_New]; // copy function pointers
+ // copy function pointers
+ NPP_New = [plugin NPP_New];
NPP_Destroy = [plugin NPP_Destroy];
NPP_SetWindow = [plugin NPP_SetWindow];
NPP_NewStream = [plugin NPP_NewStream];
@@ -122,7 +84,8 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
hidden = FALSE;
}
- for(i=0; i<[arguments count]; i++){ // convert dictionary to 2 string arrays
+ // convert arugments dictionary to 2 string arrays
+ for(i=0; i<[arguments count]; i++){
attributeString = [attributes objectAtIndex:i];
s = malloc([attributeString length]+1);
[attributeString getCString:s];
@@ -139,63 +102,20 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
}
WEBKITDEBUG("NPP_New: %d\n", npErr);
+ free(cMime);
+
+ // Initialize globals
transferred = FALSE;
stopped = FALSE;
- filesToErase = [NSMutableArray arrayWithCapacity:2];
- [filesToErase retain];
- activeURLHandles = [NSMutableArray arrayWithCapacity:1];
- [activeURLHandles retain];
+ filesToErase = [[NSMutableArray arrayWithCapacity:2] retain];
+ activeURLHandles = [[NSMutableArray arrayWithCapacity:1] retain];
+
+ // Create a WindowRef is one doesn't already exist
[[self window] _windowRef];
+
return self;
}
-- (void)drawRect:(NSRect)rect
-{
- if(!transferred){
- NSNotificationCenter *notificationCenter;
- NSWindow *theWindow;
-
- [self setWindow];
- theWindow = [self window];
- notificationCenter = [NSNotificationCenter defaultCenter];
- [notificationCenter addObserver:self selector:@selector(viewHasMoved:) name:@"NSViewBoundsDidChangeNotification" object:[self findSuperview:@"NSClipView"]];
- [notificationCenter addObserver:self selector:@selector(viewHasMoved:) name:@"NSWindowDidResizeNotification" object:theWindow];
- [notificationCenter addObserver:self selector:@selector(windowWillClose:) name:@"NSWindowWillCloseNotification" object:theWindow];
- [notificationCenter addObserver:self selector:@selector(windowBecameKey:) name:@"NSWindowDidBecomeKeyNotification" object:theWindow];
- [notificationCenter addObserver:self selector:@selector(windowResignedKey:) name:@"NSWindowDidResignKeyNotification" object:theWindow];
- [self sendActivateEvent:[theWindow isKeyWindow]];
- if(URL)
- [self newStream:[NSURL URLWithString:URL] mimeType:mime notifyData:NULL];
- eventSender = [[IFPluginViewNullEventSender alloc] initializeWithNPP:instance functionPointer:NPP_HandleEvent];
- [eventSender sendNullEvents];
- transferred = TRUE;
- webView = [self findSuperview:@"IFWebView"];
- webController = [webView controller];
- trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
- }
- [self sendUpdateEvent];
-}
-
-- (BOOL)isFlipped
-{
- return YES;
-}
-
--(void) viewHasMoved:(NSNotification *)notification
-{
- [self sendUpdateEvent];
- [self setWindow];
-}
-
--(void) windowBecameKey:(NSNotification *)notification
-{
- [self sendActivateEvent:TRUE];
-}
-
--(void) windowResignedKey:(NSNotification *)notification
-{
- [self sendActivateEvent:FALSE];
-}
- (void) setWindow
{
@@ -228,168 +148,179 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
npErr = NPP_SetWindow(instance, &window);
WEBKITDEBUG("NPP_SetWindow: %d, port=%d\n", npErr, (int)nPort.port);
- WEBKITDEBUG("frameInWindow.origin.x=%f, frameInWindow.origin.y=%f, frameInWindow.size.height=%d, frameInWindow.size.width=%d\n",
- frameInWindow.origin.x, frameInWindow.origin.y, (int)frameInWindow.size.height, (int)frameInWindow.size.width);
- WEBKITDEBUG("visibleRectInWindow.origin.x=%f, visibleRectInWindow.origin.y=%f, visibleRectInWindow.size.height=%d, visibleRectInWindow.size.width=%d\n",
- visibleRectInWindow.origin.x, visibleRectInWindow.origin.y, (int)visibleRectInWindow.size.height, (int)visibleRectInWindow.size.width);
-}
-
-- (NSView *) findSuperview:(NSString *) viewName
-{
- NSView *view;
-
- view = self;
- while(view){
- view = [view superview];
- if([[view className] isEqualToString:viewName]){
- return view;
- }
- }
- return nil;
-}
-
-- (void) windowWillClose:(NSNotification *)notification
-{
- [self stop];
}
-
- (void) newStream:(NSURL *)streamURL mimeType:(NSString *)mimeType notifyData:(void *)notifyData
{
- char *cURL, *cMime;
- StreamData *streamData;
- NPStream *stream;
+ IFPluginStream *stream;
+ NPStream *npStream;
NPError npErr;
uint16 transferMode;
IFURLHandle *urlHandle;
NSDictionary *attributes;
- NSString *streamURLString;
+ char *cMime;
- streamURLString = [streamURL absoluteString];
- stream = malloc(sizeof(NPStream));
- cURL = malloc([streamURLString length]+1);
- cMime = malloc([mimeType length]+1);
- [streamURLString getCString:cURL];
- [mimeType getCString:cMime];
- stream->url = cURL;
- stream->end = 0;
- stream->lastmodified = 0;
- stream->notifyData = notifyData;
+ stream = [[IFPluginStream alloc] initWithURL:streamURL mimeType:mimeType notifyData:notifyData];
+ npStream = [stream npStream];
- streamData = malloc(sizeof(StreamData));
- streamData->stream = stream;
- streamData->offset = 0;
- streamData->mimeType = cMime;
+ cMime = malloc([mimeType length]+1);
+ [mimeType getCString:cMime];
- npErr = NPP_NewStream(instance, cMime, stream, FALSE, &transferMode);
+ npErr = NPP_NewStream(instance, cMime, npStream, FALSE, &transferMode);
WEBKITDEBUG("NPP_NewStream: %d\n", npErr);
- streamData->transferMode = transferMode;
+ [stream setTransferMode:transferMode];
+ free(cMime);
if(transferMode == NP_NORMAL){
WEBKITDEBUG("Stream type: NP_NORMAL\n");
- attributes = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:streamData] forKey:IFURLHandleUserData];
- urlHandle = [[IFURLHandle alloc] initWithURL:streamURL attributes:attributes flags:0];
- [urlHandle addClient:self];
- [activeURLHandles addObject:urlHandle];
- [urlHandle loadInBackground];
}else if(transferMode == NP_ASFILEONLY || transferMode == NP_ASFILE){
- if(transferMode == NP_ASFILEONLY) WEBKITDEBUG("Stream type: NP_ASFILEONLY\n");
- if(transferMode == NP_ASFILE) WEBKITDEBUG("Stream type: NP_ASFILE\n");
- streamData->filename = [NSString stringWithString:[streamURLString lastPathComponent]];
- [streamData->filename retain];
- streamData->data = [NSMutableData dataWithCapacity:0];
- [streamData->data retain];
- attributes = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:streamData] forKey:IFURLHandleUserData];
- urlHandle = [[IFURLHandle alloc] initWithURL:streamURL attributes:attributes flags:0];
- [urlHandle addClient:self];
- if(urlHandle!=nil){
- [activeURLHandles addObject:urlHandle];
- [urlHandle loadInBackground];
- }
+ if(transferMode == NP_ASFILEONLY)
+ WEBKITDEBUG("Stream type: NP_ASFILEONLY\n");
+ if(transferMode == NP_ASFILE)
+ WEBKITDEBUG("Stream type: NP_ASFILE\n");
+ [stream setFilename:[[streamURL path] lastPathComponent]];
+ [stream setData:[NSMutableData dataWithCapacity:0]];
}else if(transferMode == NP_SEEK){
WEBKITDEBUG("Stream type: NP_SEEK not yet supported\n");
+ return;
+ }
+ attributes = [NSDictionary dictionaryWithObject:stream forKey:IFURLHandleUserData];
+ urlHandle = [[IFURLHandle alloc] initWithURL:streamURL attributes:attributes flags:0];
+ if(urlHandle!=nil){
+ [urlHandle addClient:self];
+ [activeURLHandles addObject:urlHandle];
+ [urlHandle loadInBackground];
}
}
-// cache methods
+-(void)start
+{
+
+}
-- (void)IFURLHandle:(IFURLHandle *)sender resourceDataDidBecomeAvailable:(NSData *)data
+- (void)stop
{
- int32 bytes;
- StreamData *streamData;
+ NPError npErr;
+ unsigned i;
- streamData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
- if(streamData->transferMode != NP_ASFILEONLY){
- bytes = NPP_WriteReady(instance, streamData->stream);
- //WEBKITDEBUG("NPP_WriteReady bytes=%u\n", bytes);
- bytes = NPP_Write(instance, streamData->stream, streamData->offset, [data length], (void *)[data bytes]);
- //WEBKITDEBUG("NPP_Write bytes=%u\n", bytes);
- streamData->offset += [data length];
- }
- if(streamData->transferMode == NP_ASFILE || streamData->transferMode == NP_ASFILEONLY){
- [streamData->data appendData:data];
+ if (!stopped){
+ for(i=0; i<[activeURLHandles count]; i++){
+ [[activeURLHandles objectAtIndex:i] cancelLoadInBackground];
+ }
+ [eventSender stop];
+ [eventSender release];
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [self removeTrackingRect:trackingTag];
+ npErr = NPP_Destroy(instance, NULL);
+ WEBKITDEBUG("NPP_Destroy: %d\n", npErr);
+ stopped = TRUE;
}
}
-- (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)sender data: (NSData *)data
+-(void)dealloc
{
- NPError npErr;
- char *cFilename;
- NSMutableString *filenameClassic, *filename;
- StreamData *streamData;
+ unsigned i;
NSFileManager *fileManager;
- streamData = [[[sender attributes] objectForKey:IFURLHandleUserData] pointerValue];
- if(streamData->transferMode == NP_ASFILE || streamData->transferMode == NP_ASFILEONLY){
- filenameClassic = [NSMutableString stringWithCapacity:200];
- filename = [NSMutableString stringWithCapacity:200];
- [filenameClassic appendString:startupVolumeName()];
- [filenameClassic appendString:@":private:tmp:"]; //FIXME: This should be the user's cache directory or somewhere else
- [filenameClassic appendString:streamData->filename];
- [filename appendString:@"/tmp/"];
- [filename appendString:streamData->filename];
- [filesToErase addObject:filename];
- fileManager = [NSFileManager defaultManager];
- WEBKITDEBUG("Writing plugin file out to: %s %s size: %u\n", [filenameClassic cString], [filename cString], [streamData->data length]);
- [fileManager removeFileAtPath:filename handler:nil];
- [fileManager createFileAtPath:filename contents:streamData->data attributes:nil];
- cFilename = malloc([filenameClassic length]+1);
- [filenameClassic getCString:cFilename];
- NPP_StreamAsFile(instance, streamData->stream, cFilename);
- WEBKITDEBUG("NPP_StreamAsFile: %s\n", cFilename);
- [streamData->data release];
- [streamData->filename release];
+ [self stop];
+ fileManager = [NSFileManager defaultManager];
+ for(i=0; i<[filesToErase count]; i++){ // remove downloaded files
+ [fileManager removeFileAtPath:[filesToErase objectAtIndex:i] handler:nil];
}
- npErr = NPP_DestroyStream(instance, streamData->stream, NPRES_DONE);
- WEBKITDEBUG("NPP_DestroyStream: %d\n", npErr);
- if(streamData->stream->notifyData){
- NPP_URLNotify(instance, streamData->stream->url, NPRES_DONE, streamData->stream->notifyData);
- WEBKITDEBUG("NPP_URLNotify\n");
+ [filesToErase release];
+ [activeURLHandles release];
+ [mime release];
+ [URL release];
+ [plugin release];
+ free(cAttributes);
+ free(cValues);
+ [super dealloc];
+}
+
+- (NSView *) findSuperview:(NSString *)viewName
+{
+ NSView *view;
+
+ view = self;
+ while(view){
+ view = [view superview];
+ if([[view className] isEqualToString:viewName]){
+ return view;
+ }
}
- free(streamData);
- [activeURLHandles removeObject:sender];
+ return nil;
}
-- (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)sender
+#pragma mark EVENTS
+
+-(void)sendActivateEvent:(BOOL)isActive;
{
+ EventRecord event;
+ bool acceptedEvent;
+ UnsignedWide msecs;
+
+ event.what = activateEvt;
+ event.message = (uint32)GetWindowPort([[self window] _windowRef]);
+ Microseconds(&msecs);
+ event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
+ event.modifiers = isActive;
+ acceptedEvent = NPP_HandleEvent(instance, &event);
+ WEBKITDEBUG("NPP_HandleEvent(activateEvent): %d isActive: %d\n", acceptedEvent, (event.modifiers & activeFlag));
}
-- (void)IFURLHandleResourceDidCancelLoading:(IFURLHandle *)sender
+-(void)sendUpdateEvent
{
- [self stop];
+ EventRecord event;
+ bool acceptedEvent;
+ UnsignedWide msecs;
+
+ event.what = updateEvt;
+ event.message = (uint32)GetWindowPort([[self window] _windowRef]);
+ Microseconds(&msecs);
+ event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
+ acceptedEvent = NPP_HandleEvent(instance, &event);
+ WEBKITDEBUG("NPP_HandleEvent(updateEvt): %d when: %lu\n", acceptedEvent, event.when);
}
-- (void)IFURLHandle:(IFURLHandle *)sender resourceDidFailLoadingWithResult:(int)result
+
+#pragma mark NSVIEW
+
+- (void)drawRect:(NSRect)rect
{
- [self stop];
+ if(!transferred){
+ NSNotificationCenter *notificationCenter;
+ NSWindow *theWindow;
+
+ [self setWindow];
+ theWindow = [self window];
+ notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter addObserver:self selector:@selector(viewHasMoved:) name:@"NSViewBoundsDidChangeNotification" object:[self findSuperview:@"NSClipView"]];
+ [notificationCenter addObserver:self selector:@selector(viewHasMoved:) name:@"NSWindowDidResizeNotification" object:theWindow];
+ [notificationCenter addObserver:self selector:@selector(windowWillClose:) name:@"NSWindowWillCloseNotification" object:theWindow];
+ [notificationCenter addObserver:self selector:@selector(windowBecameKey:) name:@"NSWindowDidBecomeKeyNotification" object:theWindow];
+ [notificationCenter addObserver:self selector:@selector(windowResignedKey:) name:@"NSWindowDidResignKeyNotification" object:theWindow];
+ [self sendActivateEvent:[theWindow isKeyWindow]];
+ if(URL)
+ [self newStream:[NSURL URLWithString:URL] mimeType:mime notifyData:NULL];
+ eventSender = [[IFPluginNullEventSender alloc] initializeWithNPP:instance functionPointer:NPP_HandleEvent];
+ [eventSender sendNullEvents];
+ transferred = TRUE;
+ trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
+
+ webView = [self findSuperview:@"IFWebView"];
+ webController = [webView controller];
+ webFrame = [webController frameForView:webView];
+ webDataSource = [webFrame dataSource];
+ }
+ [self sendUpdateEvent];
}
-- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)url
+- (BOOL)isFlipped
{
-
+ return YES;
}
-// event methods
+#pragma mark NSRESPONDER
-(BOOL)acceptsFirstResponder
{
@@ -424,34 +355,6 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
return YES;
}
--(void)sendActivateEvent:(BOOL)isActive;
-{
- EventRecord event;
- bool acceptedEvent;
- UnsignedWide msecs;
-
- event.what = activateEvt;
- event.message = (uint32)GetWindowPort([[self window] _windowRef]);
- Microseconds(&msecs);
- event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
- event.modifiers = isActive;
- acceptedEvent = NPP_HandleEvent(instance, &event);
- WEBKITDEBUG("NPP_HandleEvent(activateEvent): %d isActive: %d\n", acceptedEvent, (event.modifiers & activeFlag));
-}
-
--(void)sendUpdateEvent
-{
- EventRecord event;
- bool acceptedEvent;
- UnsignedWide msecs;
-
- event.what = updateEvt;
- event.message = (uint32)GetWindowPort([[self window] _windowRef]);
- Microseconds(&msecs);
- event.when = (uint32)((double)UnsignedWideToUInt64(msecs) / 1000000 * 60); // microseconds to ticks
- acceptedEvent = NPP_HandleEvent(instance, &event);
- WEBKITDEBUG("NPP_HandleEvent(updateEvt): %d when: %lu\n", acceptedEvent, event.when);
-}
-(void)mouseDown:(NSEvent *)theEvent
{
@@ -536,7 +439,153 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
WEBKITDEBUG("NPP_HandleEvent(keyDown): %d key:%c\n", acceptedEvent, (char) (event.message & charCodeMask));
}
-// plug-in to browser calls
+#pragma mark NOTIFICATIONS
+
+-(void) viewHasMoved:(NSNotification *)notification
+{
+ [self sendUpdateEvent];
+ [self setWindow];
+}
+
+-(void) windowBecameKey:(NSNotification *)notification
+{
+ [self sendActivateEvent:TRUE];
+}
+
+-(void) windowResignedKey:(NSNotification *)notification
+{
+ [self sendActivateEvent:FALSE];
+}
+
+- (void) windowWillClose:(NSNotification *)notification
+{
+ [self stop];
+}
+
+
+#pragma mark IFURLHANDLE
+
+- (void)IFURLHandleResourceDidBeginLoading:(IFURLHandle *)sender
+{
+
+}
+
+- (void)IFURLHandle:(IFURLHandle *)sender resourceDataDidBecomeAvailable:(NSData *)data
+{
+ int32 bytes;
+ IFPluginStream *stream;
+ uint16 transferMode;
+ NPStream *npStream;
+
+ stream = [[sender attributes] objectForKey:IFURLHandleUserData];
+ transferMode = [stream transferMode];
+ npStream = [stream npStream];
+
+ if(transferMode != NP_ASFILEONLY){
+ bytes = NPP_WriteReady(instance, npStream);
+ //WEBKITDEBUG("NPP_WriteReady bytes=%u\n", bytes);
+ bytes = NPP_Write(instance, npStream, [stream offset], [data length], (void *)[data bytes]);
+ //WEBKITDEBUG("NPP_Write bytes=%u\n", bytes);
+ [stream incrementOffset:[data length]];
+ }
+ if(transferMode == NP_ASFILE || transferMode == NP_ASFILEONLY){
+ [[stream data] appendData:data];
+ }
+
+ IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
+ loadProgress->totalToLoad = [sender contentLength];
+ loadProgress->bytesSoFar = [sender contentLengthReceived];
+ loadProgress->type = IF_LOAD_TYPE_PLUGIN;
+ [webController receivedProgress: (IFLoadProgress *)loadProgress
+ forResource: [[sender url] absoluteString] fromDataSource: webDataSource];
+ [loadProgress release];
+
+}
+
+- (void)IFURLHandleResourceDidFinishLoading:(IFURLHandle *)sender data: (NSData *)data
+{
+ NPError npErr;
+ char *cFilename;
+ NSMutableString *filenameClassic, *path;
+ IFPluginStream *stream;
+ NSFileManager *fileManager;
+ uint16 transferMode;
+ NPStream *npStream;
+ NSString *filename;
+
+ stream = [[sender attributes] objectForKey:IFURLHandleUserData];
+ transferMode = [stream transferMode];
+ npStream = [stream npStream];
+ filename = [stream filename];
+
+ if(transferMode == NP_ASFILE || transferMode == NP_ASFILEONLY){
+ path = [NSString stringWithFormat:@"%@%@", @"/tmp/", filename];
+ [filesToErase addObject:path];
+
+ fileManager = [NSFileManager defaultManager];
+ [fileManager removeFileAtPath:path handler:nil];
+ [fileManager createFileAtPath:path contents:[stream data] attributes:nil];
+
+ filenameClassic = [NSString stringWithFormat:@"%@%@%@", startupVolumeName(), @":private:tmp:", filename]; cFilename = malloc([filenameClassic length]+1);
+ [filenameClassic getCString:cFilename];
+
+ NPP_StreamAsFile(instance, npStream, cFilename);
+ WEBKITDEBUG("NPP_StreamAsFile: %s\n", cFilename);
+ }
+ npErr = NPP_DestroyStream(instance, npStream, NPRES_DONE);
+ WEBKITDEBUG("NPP_DestroyStream: %d\n", npErr);
+
+ if(npStream->notifyData){
+ NPP_URLNotify(instance, npStream->url, NPRES_DONE, npStream->notifyData);
+ WEBKITDEBUG("NPP_URLNotify\n");
+ }
+ [stream release];
+ [activeURLHandles removeObject:sender];
+
+ IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
+ loadProgress->totalToLoad = [data length];
+ loadProgress->bytesSoFar = [data length];
+ loadProgress->type = IF_LOAD_TYPE_PLUGIN;
+ [webController receivedProgress: (IFLoadProgress *)loadProgress
+ forResource: [[sender url] absoluteString] fromDataSource: webDataSource];
+ [loadProgress release];
+}
+
+- (void)IFURLHandleResourceDidCancelLoading:(IFURLHandle *)sender
+{
+ [self stop];
+
+ IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
+ loadProgress->totalToLoad = -1;
+ loadProgress->bytesSoFar = -1;
+ loadProgress->type = IF_LOAD_TYPE_PLUGIN;
+ [webController receivedProgress: (IFLoadProgress *)loadProgress
+ forResource: [[sender url] absoluteString] fromDataSource: webDataSource];
+ [loadProgress release];
+}
+
+- (void)IFURLHandle:(IFURLHandle *)sender resourceDidFailLoadingWithResult:(int)result
+{
+ [self stop];
+
+ IFLoadProgress *loadProgress = [[IFLoadProgress alloc] init];
+ loadProgress->totalToLoad = [sender contentLength];
+ loadProgress->bytesSoFar = [sender contentLengthReceived];
+ loadProgress->type = IF_LOAD_TYPE_PLUGIN;
+
+ IFError *error = [[IFError alloc] initWithErrorCode: result failingURL: [sender url]];
+ [webController receivedError: error forResource: [[sender url] absoluteString]
+ partialProgress: loadProgress fromDataSource: webDataSource];
+ [error release];
+ [loadProgress release];
+}
+
+- (void)IFURLHandle:(IFURLHandle *)sender didRedirectToURL:(NSURL *)url
+{
+
+}
+
+#pragma mark PLUGIN-TO-BROWSER
-(NPError)getURLNotify:(const char *)url target:(const char *)target notifyData:(void *)notifyData
{
@@ -638,53 +687,21 @@ static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *m
WEBKITDEBUG("NPN_InvalidateRegion\n");
}
--(void)start
+-(void)forceRedraw
{
-
+ WEBKITDEBUG("forceRedraw\n");
}
-- (void)stop
-{
- NPError npErr;
- unsigned i;
-
- if (!stopped){
- for(i=0; i<[activeURLHandles count]; i++){
- [[activeURLHandles objectAtIndex:i] cancelLoadInBackground];
- }
- [eventSender stop];
- [eventSender release];
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- [self removeTrackingRect:trackingTag];
- npErr = NPP_Destroy(instance, NULL);
- WEBKITDEBUG("NPP_Destroy: %d\n", npErr);
- stopped = TRUE;
- }
-}
+#pragma mark PREBINDING
--(void)forceRedraw
+static id IFPluginMake(NSRect rect, WCPlugin *plugin, NSString *url, NSString *mimeType, NSDictionary *arguments, uint16 mode)
{
- WEBKITDEBUG("forceRedraw\n");
+ return [[[IFPluginView alloc] initWithFrame:rect plugin:plugin url:url mime:mimeType arguments:arguments mode:mode] autorelease];
}
--(void)dealloc
++(void) load
{
- unsigned i;
- NSFileManager *fileManager;
-
- [self stop];
- fileManager = [NSFileManager defaultManager];
- for(i=0; i<[filesToErase count]; i++){ // remove downloaded files
- [fileManager removeFileAtPath:[filesToErase objectAtIndex:i] handler:nil];
- }
- [filesToErase release];
- [activeURLHandles release];
- [mime release];
- [URL release];
- [plugin release];
- free(cAttributes);
- free(cValues);
- [super dealloc];
+ WCSetIFPluginMakeFunc(IFPluginMake);
}
@end
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 3476410..412379a 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -214,6 +214,8 @@
9CAE9D080252A4130ECA16EA,
F59EAE400253C7EE018635CA,
F5883BE2025E5E9D01000102,
+ F5A672BB0263866E01000102,
+ F5A672BD0263866E01000102,
);
isa = PBXHeadersBuildPhase;
};
@@ -258,6 +260,8 @@
F58BAB390250363E01C1A526,
F59EAE420253C8DE018635CA,
F5883BE3025E5E9D01000102,
+ F5A672BC0263866E01000102,
+ F5A672BE0263866E01000102,
);
isa = PBXSourcesBuildPhase;
};
@@ -1223,6 +1227,54 @@
settings = {
};
};
+ F5A672B70263866E01000102 = {
+ isa = PBXFileReference;
+ name = IFPluginNullEventSender.h;
+ path = Plugins.subproj/IFPluginNullEventSender.h;
+ refType = 4;
+ };
+ F5A672B80263866E01000102 = {
+ isa = PBXFileReference;
+ name = IFPluginNullEventSender.m;
+ path = Plugins.subproj/IFPluginNullEventSender.m;
+ refType = 4;
+ };
+ F5A672B90263866E01000102 = {
+ isa = PBXFileReference;
+ name = IFPluginStream.h;
+ path = Plugins.subproj/IFPluginStream.h;
+ refType = 4;
+ };
+ F5A672BA0263866E01000102 = {
+ isa = PBXFileReference;
+ name = IFPluginStream.m;
+ path = Plugins.subproj/IFPluginStream.m;
+ refType = 4;
+ };
+ F5A672BB0263866E01000102 = {
+ fileRef = F5A672B70263866E01000102;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5A672BC0263866E01000102 = {
+ fileRef = F5A672B80263866E01000102;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5A672BD0263866E01000102 = {
+ fileRef = F5A672B90263866E01000102;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5A672BE0263866E01000102 = {
+ fileRef = F5A672BA0263866E01000102;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
F5AEBB3D024A527601C1A526 = {
isa = PBXFileReference;
name = IFPreferences.mm;
@@ -1326,6 +1378,10 @@
F5EBC45602134BC301CA1520,
F5883BE0025E5E9D01000102,
F5883BE1025E5E9D01000102,
+ F5A672B70263866E01000102,
+ F5A672B80263866E01000102,
+ F5A672B90263866E01000102,
+ F5A672BA0263866E01000102,
);
isa = PBXGroup;
name = Plugins;
diff --git a/WebKit/WebView.subproj/IFLoadProgress.h b/WebKit/WebView.subproj/IFLoadProgress.h
index b19a3f4..a1256b3 100644
--- a/WebKit/WebView.subproj/IFLoadProgress.h
+++ b/WebKit/WebView.subproj/IFLoadProgress.h
@@ -11,7 +11,8 @@ typedef enum {
IF_LOAD_TYPE_CSS = 1,
IF_LOAD_TYPE_IMAGE = 2,
IF_LOAD_TYPE_SCRIPT = 3,
- IF_LOAD_TYPE_HTML = 4
+ IF_LOAD_TYPE_HTML = 4,
+ IF_LOAD_TYPE_PLUGIN = 5
} IF_LOAD_TYPE;
diff --git a/WebKit/WebView.subproj/WebLoadProgress.h b/WebKit/WebView.subproj/WebLoadProgress.h
index b19a3f4..a1256b3 100644
--- a/WebKit/WebView.subproj/WebLoadProgress.h
+++ b/WebKit/WebView.subproj/WebLoadProgress.h
@@ -11,7 +11,8 @@ typedef enum {
IF_LOAD_TYPE_CSS = 1,
IF_LOAD_TYPE_IMAGE = 2,
IF_LOAD_TYPE_SCRIPT = 3,
- IF_LOAD_TYPE_HTML = 4
+ IF_LOAD_TYPE_HTML = 4,
+ IF_LOAD_TYPE_PLUGIN = 5
} IF_LOAD_TYPE;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list