Commit d5af8808 authored by cblu's avatar cblu
Browse files

A ton o' plugin view clean-up and arch changes. Turned WebPluginView into...

	A ton o' plugin view clean-up and arch changes. Turned WebPluginView into WebBaseNetscapePluginView. New classes WebNetscapePluginEmbeddedView and WebNetscapePluginDocumentView are subclasses of WebBaseNetscapePluginView. WebNetscapePluginDocumentView handles non-HTML plug-in content and WebNetscapePluginEmbeddedView is the WebHTMLView subview.

	Found that we leak the world on complex pages with plug-ins such as macromedia.com and marvel.com when closing the window. Still need to figure this out.

        * Plugins.subproj/WebBaseNetscapePluginView.h: Added.
        * Plugins.subproj/WebBaseNetscapePluginView.m: Added.
        (+[WebBaseNetscapePluginView getCarbonEvent:]):
        (-[WebBaseNetscapePluginView getCarbonEvent:]):
        (-[WebBaseNetscapePluginView modifiersForEvent:]):
        (-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]):
        (-[WebBaseNetscapePluginView keyMessageForEvent:]):
        (-[WebBaseNetscapePluginView sendEvent:]):
        (-[WebBaseNetscapePluginView sendActivateEvent:]):
        (-[WebBaseNetscapePluginView sendUpdateEvent]):
        (-[WebBaseNetscapePluginView acceptsFirstResponder]):
        (-[WebBaseNetscapePluginView becomeFirstResponder]):
        (-[WebBaseNetscapePluginView resignFirstResponder]):
        (-[WebBaseNetscapePluginView mouseDown:]):
        (-[WebBaseNetscapePluginView mouseUp:]):
        (-[WebBaseNetscapePluginView mouseEntered:]):
        (-[WebBaseNetscapePluginView mouseExited:]):
        (-[WebBaseNetscapePluginView keyUp:]):
        (-[WebBaseNetscapePluginView keyDown:]):
        (-[WebBaseNetscapePluginView isInResponderChain]):
        (-[WebBaseNetscapePluginView performKeyEquivalent:]):
        (-[WebBaseNetscapePluginView menuForEvent:]):
        (-[WebBaseNetscapePluginView setUpWindowAndPort]):
        (-[WebBaseNetscapePluginView setWindow]):
        (-[WebBaseNetscapePluginView removeTrackingRect]):
        (-[WebBaseNetscapePluginView resetTrackingRect]):
        (-[WebBaseNetscapePluginView start]):
        (-[WebBaseNetscapePluginView stop]):
        (-[WebBaseNetscapePluginView dataSource]):
        (-[WebBaseNetscapePluginView webFrame]):
        (-[WebBaseNetscapePluginView controller]):
        (-[WebBaseNetscapePluginView plugin]):
        (-[WebBaseNetscapePluginView setMIMEType:]):
        (-[WebBaseNetscapePluginView setBaseURL:]):
        (-[WebBaseNetscapePluginView setArguments:]):
        (-[WebBaseNetscapePluginView setMode:]):
        (-[WebBaseNetscapePluginView initWithFrame:]):
        (-[WebBaseNetscapePluginView dealloc]):
        (-[WebBaseNetscapePluginView drawRect:]):
        (-[WebBaseNetscapePluginView isFlipped]):
        (-[WebBaseNetscapePluginView viewWillMoveToWindow:]):
        (-[WebBaseNetscapePluginView viewDidMoveToWindow]):
        (-[WebBaseNetscapePluginView viewHasMoved:]):
        (-[WebBaseNetscapePluginView windowWillClose:]):
        (-[WebBaseNetscapePluginView windowBecameKey:]):
        (-[WebBaseNetscapePluginView windowResignedKey:]):
        (-[WebBaseNetscapePluginView defaultsHaveChanged:]):
        (-[WebBaseNetscapePluginView frameStateChanged:]):
        (-[WebBaseNetscapePluginView pluginInstance]):
        (-[WebBaseNetscapePluginView pluginURLFromCString:]):
        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
        (-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]):
        (-[WebBaseNetscapePluginView getURL:target:]):
        (-[WebBaseNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]):
        (-[WebBaseNetscapePluginView postURL:target:len:buf:file:]):
        (-[WebBaseNetscapePluginView newStream:target:stream:]):
        (-[WebBaseNetscapePluginView write:len:buffer:]):
        (-[WebBaseNetscapePluginView destroyStream:reason:]):
        (-[WebBaseNetscapePluginView status:]):
        (-[WebBaseNetscapePluginView invalidateRect:]):
        (-[WebBaseNetscapePluginView invalidateRegion:]):
        (-[WebBaseNetscapePluginView forceRedraw]):
        * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: Added.
        * Plugins.subproj/WebNetscapePluginDocumentView.h: Added.
        * Plugins.subproj/WebNetscapePluginDocumentView.m: Added.
        (-[WebNetscapePluginDocumentView initWithFrame:]):
        (-[WebNetscapePluginDocumentView dealloc]):
        (-[WebNetscapePluginDocumentView drawRect:]):
        (-[WebNetscapePluginDocumentView dataSource]):
        (-[WebNetscapePluginDocumentView setDataSource:]):
        (-[WebNetscapePluginDocumentView dataSourceUpdated:]):
        (-[WebNetscapePluginDocumentView setNeedsLayout:]):
        (-[WebNetscapePluginDocumentView layout]):
        * Plugins.subproj/WebNetscapePluginEmbeddedView.h: Added.
        * Plugins.subproj/WebNetscapePluginEmbeddedView.m: Added.
        (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:mime:arguments:]):
        (-[WebNetscapePluginEmbeddedView dealloc]):
        (-[WebNetscapePluginEmbeddedView viewDidMoveToWindow]):
        (-[WebNetscapePluginEmbeddedView start]):
        (-[WebNetscapePluginEmbeddedView dataSource]):
        * Plugins.subproj/WebNetscapePluginViewPrivate.h: Removed.
        * Plugins.subproj/WebPluginDatabase.m:
        (-[WebNetscapePluginDatabase init]):
        * Plugins.subproj/WebPluginNullEventSender.h:
        * Plugins.subproj/WebPluginNullEventSender.m:
        (-[WebNetscapePluginNullEventSender initWithPluginView:]):
        (-[WebNetscapePluginNullEventSender sendNullEvents]):
        * Plugins.subproj/WebPluginStream.h:
        * Plugins.subproj/WebPluginStream.m:
        (-[WebNetscapePluginStream getFunctionPointersFromPluginView:]):
        (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]):
        (-[WebNetscapePluginStream dealloc]):
        (-[WebNetscapePluginStream startLoad]):
        (-[WebNetscapePluginStream receivedData:withDataSource:]):
        (-[WebNetscapePluginStream handleWillUseUserAgent:forURL:]):
        (-[WebNetscapePluginStream handle:didReceiveData:]):
        (-[WebNetscapePluginStream handleDidFinishLoading:]):
        (-[WebNetscapePluginStream cancel]):
        (-[WebNetscapePluginStream handle:didFailLoadingWithError:]):
        (-[WebNetscapePluginStream handleDidRedirect:toURL:]):
        * Plugins.subproj/WebPluginView.h: Removed.
        * Plugins.subproj/WebPluginView.m: Removed.
        * Plugins.subproj/npapi.m:
        (NPN_GetURLNotify):
        (NPN_GetURL):
        (NPN_PostURLNotify):
        (NPN_PostURL):
        (NPN_NewStream):
        (NPN_Write):
        (NPN_DestroyStream):
        (NPN_Status):
        (NPN_InvalidateRect):
        (NPN_InvalidateRegion):
        (NPN_ForceRedraw):
        * WebCoreSupport.subproj/WebViewFactory.m:
        (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]):
        (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]):
        * WebKit.pbproj/project.pbxproj:
        * WebView.subproj/WebHTMLViewPrivate.m:
        (-[NSView _web_stopIfPluginView]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b3307e1e
2002-09-30 Chris Blumenberg <cblu@apple.com>
A ton o' plugin view clean-up and arch changes. Turned WebPluginView into WebBaseNetscapePluginView. New classes WebNetscapePluginEmbeddedView and WebNetscapePluginDocumentView are subclasses of WebBaseNetscapePluginView. WebNetscapePluginDocumentView handles non-HTML plug-in content and WebNetscapePluginEmbeddedView is the WebHTMLView subview.
Found that we leak the world on complex pages with plug-ins such as macromedia.com and marvel.com when closing the window. Still need to figure this out.
* Plugins.subproj/WebBaseNetscapePluginView.h: Added.
* Plugins.subproj/WebBaseNetscapePluginView.m: Added.
(+[WebBaseNetscapePluginView getCarbonEvent:]):
(-[WebBaseNetscapePluginView getCarbonEvent:]):
(-[WebBaseNetscapePluginView modifiersForEvent:]):
(-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]):
(-[WebBaseNetscapePluginView keyMessageForEvent:]):
(-[WebBaseNetscapePluginView sendEvent:]):
(-[WebBaseNetscapePluginView sendActivateEvent:]):
(-[WebBaseNetscapePluginView sendUpdateEvent]):
(-[WebBaseNetscapePluginView acceptsFirstResponder]):
(-[WebBaseNetscapePluginView becomeFirstResponder]):
(-[WebBaseNetscapePluginView resignFirstResponder]):
(-[WebBaseNetscapePluginView mouseDown:]):
(-[WebBaseNetscapePluginView mouseUp:]):
(-[WebBaseNetscapePluginView mouseEntered:]):
(-[WebBaseNetscapePluginView mouseExited:]):
(-[WebBaseNetscapePluginView keyUp:]):
(-[WebBaseNetscapePluginView keyDown:]):
(-[WebBaseNetscapePluginView isInResponderChain]):
(-[WebBaseNetscapePluginView performKeyEquivalent:]):
(-[WebBaseNetscapePluginView menuForEvent:]):
(-[WebBaseNetscapePluginView setUpWindowAndPort]):
(-[WebBaseNetscapePluginView setWindow]):
(-[WebBaseNetscapePluginView removeTrackingRect]):
(-[WebBaseNetscapePluginView resetTrackingRect]):
(-[WebBaseNetscapePluginView start]):
(-[WebBaseNetscapePluginView stop]):
(-[WebBaseNetscapePluginView dataSource]):
(-[WebBaseNetscapePluginView webFrame]):
(-[WebBaseNetscapePluginView controller]):
(-[WebBaseNetscapePluginView plugin]):
(-[WebBaseNetscapePluginView setMIMEType:]):
(-[WebBaseNetscapePluginView setBaseURL:]):
(-[WebBaseNetscapePluginView setArguments:]):
(-[WebBaseNetscapePluginView setMode:]):
(-[WebBaseNetscapePluginView initWithFrame:]):
(-[WebBaseNetscapePluginView dealloc]):
(-[WebBaseNetscapePluginView drawRect:]):
(-[WebBaseNetscapePluginView isFlipped]):
(-[WebBaseNetscapePluginView viewWillMoveToWindow:]):
(-[WebBaseNetscapePluginView viewDidMoveToWindow]):
(-[WebBaseNetscapePluginView viewHasMoved:]):
(-[WebBaseNetscapePluginView windowWillClose:]):
(-[WebBaseNetscapePluginView windowBecameKey:]):
(-[WebBaseNetscapePluginView windowResignedKey:]):
(-[WebBaseNetscapePluginView defaultsHaveChanged:]):
(-[WebBaseNetscapePluginView frameStateChanged:]):
(-[WebBaseNetscapePluginView pluginInstance]):
(-[WebBaseNetscapePluginView pluginURLFromCString:]):
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
(-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]):
(-[WebBaseNetscapePluginView getURL:target:]):
(-[WebBaseNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]):
(-[WebBaseNetscapePluginView postURL:target:len:buf:file:]):
(-[WebBaseNetscapePluginView newStream:target:stream:]):
(-[WebBaseNetscapePluginView write:len:buffer:]):
(-[WebBaseNetscapePluginView destroyStream:reason:]):
(-[WebBaseNetscapePluginView status:]):
(-[WebBaseNetscapePluginView invalidateRect:]):
(-[WebBaseNetscapePluginView invalidateRegion:]):
(-[WebBaseNetscapePluginView forceRedraw]):
* Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: Added.
* Plugins.subproj/WebNetscapePluginDocumentView.h: Added.
* Plugins.subproj/WebNetscapePluginDocumentView.m: Added.
(-[WebNetscapePluginDocumentView initWithFrame:]):
(-[WebNetscapePluginDocumentView dealloc]):
(-[WebNetscapePluginDocumentView drawRect:]):
(-[WebNetscapePluginDocumentView dataSource]):
(-[WebNetscapePluginDocumentView setDataSource:]):
(-[WebNetscapePluginDocumentView dataSourceUpdated:]):
(-[WebNetscapePluginDocumentView setNeedsLayout:]):
(-[WebNetscapePluginDocumentView layout]):
* Plugins.subproj/WebNetscapePluginEmbeddedView.h: Added.
* Plugins.subproj/WebNetscapePluginEmbeddedView.m: Added.
(-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:mime:arguments:]):
(-[WebNetscapePluginEmbeddedView dealloc]):
(-[WebNetscapePluginEmbeddedView viewDidMoveToWindow]):
(-[WebNetscapePluginEmbeddedView start]):
(-[WebNetscapePluginEmbeddedView dataSource]):
* Plugins.subproj/WebNetscapePluginViewPrivate.h: Removed.
* Plugins.subproj/WebPluginDatabase.m:
(-[WebNetscapePluginDatabase init]):
* Plugins.subproj/WebPluginNullEventSender.h:
* Plugins.subproj/WebPluginNullEventSender.m:
(-[WebNetscapePluginNullEventSender initWithPluginView:]):
(-[WebNetscapePluginNullEventSender sendNullEvents]):
* Plugins.subproj/WebPluginStream.h:
* Plugins.subproj/WebPluginStream.m:
(-[WebNetscapePluginStream getFunctionPointersFromPluginView:]):
(-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]):
(-[WebNetscapePluginStream dealloc]):
(-[WebNetscapePluginStream startLoad]):
(-[WebNetscapePluginStream receivedData:withDataSource:]):
(-[WebNetscapePluginStream handleWillUseUserAgent:forURL:]):
(-[WebNetscapePluginStream handle:didReceiveData:]):
(-[WebNetscapePluginStream handleDidFinishLoading:]):
(-[WebNetscapePluginStream cancel]):
(-[WebNetscapePluginStream handle:didFailLoadingWithError:]):
(-[WebNetscapePluginStream handleDidRedirect:toURL:]):
* Plugins.subproj/WebPluginView.h: Removed.
* Plugins.subproj/WebPluginView.m: Removed.
* Plugins.subproj/npapi.m:
(NPN_GetURLNotify):
(NPN_GetURL):
(NPN_PostURLNotify):
(NPN_PostURL):
(NPN_NewStream):
(NPN_Write):
(NPN_DestroyStream):
(NPN_Status):
(NPN_InvalidateRect):
(NPN_InvalidateRegion):
(NPN_ForceRedraw):
* WebCoreSupport.subproj/WebViewFactory.m:
(-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]):
(-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]):
* WebKit.pbproj/project.pbxproj:
* WebView.subproj/WebHTMLViewPrivate.m:
(-[NSView _web_stopIfPluginView]):
2002-09-30 Darin Adler <darin@apple.com>
 
* WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]):
......
2002-09-30 Chris Blumenberg <cblu@apple.com>
A ton o' plugin view clean-up and arch changes. Turned WebPluginView into WebBaseNetscapePluginView. New classes WebNetscapePluginEmbeddedView and WebNetscapePluginDocumentView are subclasses of WebBaseNetscapePluginView. WebNetscapePluginDocumentView handles non-HTML plug-in content and WebNetscapePluginEmbeddedView is the WebHTMLView subview.
Found that we leak the world on complex pages with plug-ins such as macromedia.com and marvel.com when closing the window. Still need to figure this out.
* Plugins.subproj/WebBaseNetscapePluginView.h: Added.
* Plugins.subproj/WebBaseNetscapePluginView.m: Added.
(+[WebBaseNetscapePluginView getCarbonEvent:]):
(-[WebBaseNetscapePluginView getCarbonEvent:]):
(-[WebBaseNetscapePluginView modifiersForEvent:]):
(-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]):
(-[WebBaseNetscapePluginView keyMessageForEvent:]):
(-[WebBaseNetscapePluginView sendEvent:]):
(-[WebBaseNetscapePluginView sendActivateEvent:]):
(-[WebBaseNetscapePluginView sendUpdateEvent]):
(-[WebBaseNetscapePluginView acceptsFirstResponder]):
(-[WebBaseNetscapePluginView becomeFirstResponder]):
(-[WebBaseNetscapePluginView resignFirstResponder]):
(-[WebBaseNetscapePluginView mouseDown:]):
(-[WebBaseNetscapePluginView mouseUp:]):
(-[WebBaseNetscapePluginView mouseEntered:]):
(-[WebBaseNetscapePluginView mouseExited:]):
(-[WebBaseNetscapePluginView keyUp:]):
(-[WebBaseNetscapePluginView keyDown:]):
(-[WebBaseNetscapePluginView isInResponderChain]):
(-[WebBaseNetscapePluginView performKeyEquivalent:]):
(-[WebBaseNetscapePluginView menuForEvent:]):
(-[WebBaseNetscapePluginView setUpWindowAndPort]):
(-[WebBaseNetscapePluginView setWindow]):
(-[WebBaseNetscapePluginView removeTrackingRect]):
(-[WebBaseNetscapePluginView resetTrackingRect]):
(-[WebBaseNetscapePluginView start]):
(-[WebBaseNetscapePluginView stop]):
(-[WebBaseNetscapePluginView dataSource]):
(-[WebBaseNetscapePluginView webFrame]):
(-[WebBaseNetscapePluginView controller]):
(-[WebBaseNetscapePluginView plugin]):
(-[WebBaseNetscapePluginView setMIMEType:]):
(-[WebBaseNetscapePluginView setBaseURL:]):
(-[WebBaseNetscapePluginView setArguments:]):
(-[WebBaseNetscapePluginView setMode:]):
(-[WebBaseNetscapePluginView initWithFrame:]):
(-[WebBaseNetscapePluginView dealloc]):
(-[WebBaseNetscapePluginView drawRect:]):
(-[WebBaseNetscapePluginView isFlipped]):
(-[WebBaseNetscapePluginView viewWillMoveToWindow:]):
(-[WebBaseNetscapePluginView viewDidMoveToWindow]):
(-[WebBaseNetscapePluginView viewHasMoved:]):
(-[WebBaseNetscapePluginView windowWillClose:]):
(-[WebBaseNetscapePluginView windowBecameKey:]):
(-[WebBaseNetscapePluginView windowResignedKey:]):
(-[WebBaseNetscapePluginView defaultsHaveChanged:]):
(-[WebBaseNetscapePluginView frameStateChanged:]):
(-[WebBaseNetscapePluginView pluginInstance]):
(-[WebBaseNetscapePluginView pluginURLFromCString:]):
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
(-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]):
(-[WebBaseNetscapePluginView getURL:target:]):
(-[WebBaseNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]):
(-[WebBaseNetscapePluginView postURL:target:len:buf:file:]):
(-[WebBaseNetscapePluginView newStream:target:stream:]):
(-[WebBaseNetscapePluginView write:len:buffer:]):
(-[WebBaseNetscapePluginView destroyStream:reason:]):
(-[WebBaseNetscapePluginView status:]):
(-[WebBaseNetscapePluginView invalidateRect:]):
(-[WebBaseNetscapePluginView invalidateRegion:]):
(-[WebBaseNetscapePluginView forceRedraw]):
* Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: Added.
* Plugins.subproj/WebNetscapePluginDocumentView.h: Added.
* Plugins.subproj/WebNetscapePluginDocumentView.m: Added.
(-[WebNetscapePluginDocumentView initWithFrame:]):
(-[WebNetscapePluginDocumentView dealloc]):
(-[WebNetscapePluginDocumentView drawRect:]):
(-[WebNetscapePluginDocumentView dataSource]):
(-[WebNetscapePluginDocumentView setDataSource:]):
(-[WebNetscapePluginDocumentView dataSourceUpdated:]):
(-[WebNetscapePluginDocumentView setNeedsLayout:]):
(-[WebNetscapePluginDocumentView layout]):
* Plugins.subproj/WebNetscapePluginEmbeddedView.h: Added.
* Plugins.subproj/WebNetscapePluginEmbeddedView.m: Added.
(-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:mime:arguments:]):
(-[WebNetscapePluginEmbeddedView dealloc]):
(-[WebNetscapePluginEmbeddedView viewDidMoveToWindow]):
(-[WebNetscapePluginEmbeddedView start]):
(-[WebNetscapePluginEmbeddedView dataSource]):
* Plugins.subproj/WebNetscapePluginViewPrivate.h: Removed.
* Plugins.subproj/WebPluginDatabase.m:
(-[WebNetscapePluginDatabase init]):
* Plugins.subproj/WebPluginNullEventSender.h:
* Plugins.subproj/WebPluginNullEventSender.m:
(-[WebNetscapePluginNullEventSender initWithPluginView:]):
(-[WebNetscapePluginNullEventSender sendNullEvents]):
* Plugins.subproj/WebPluginStream.h:
* Plugins.subproj/WebPluginStream.m:
(-[WebNetscapePluginStream getFunctionPointersFromPluginView:]):
(-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]):
(-[WebNetscapePluginStream dealloc]):
(-[WebNetscapePluginStream startLoad]):
(-[WebNetscapePluginStream receivedData:withDataSource:]):
(-[WebNetscapePluginStream handleWillUseUserAgent:forURL:]):
(-[WebNetscapePluginStream handle:didReceiveData:]):
(-[WebNetscapePluginStream handleDidFinishLoading:]):
(-[WebNetscapePluginStream cancel]):
(-[WebNetscapePluginStream handle:didFailLoadingWithError:]):
(-[WebNetscapePluginStream handleDidRedirect:toURL:]):
* Plugins.subproj/WebPluginView.h: Removed.
* Plugins.subproj/WebPluginView.m: Removed.
* Plugins.subproj/npapi.m:
(NPN_GetURLNotify):
(NPN_GetURL):
(NPN_PostURLNotify):
(NPN_PostURL):
(NPN_NewStream):
(NPN_Write):
(NPN_DestroyStream):
(NPN_Status):
(NPN_InvalidateRect):
(NPN_InvalidateRegion):
(NPN_ForceRedraw):
* WebCoreSupport.subproj/WebViewFactory.m:
(-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]):
(-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]):
* WebKit.pbproj/project.pbxproj:
* WebView.subproj/WebHTMLViewPrivate.m:
(-[NSView _web_stopIfPluginView]):
2002-09-30 Darin Adler <darin@apple.com>
 
* WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]):
......
/*
WebPluginView.h
WebBaseNetscapePluginView.h
Copyright 2002, Apple, Inc. All rights reserved.
*/
#import <WebKit/WebKit.h>
#import <WebKit/WebFrame.h>
#import <Cocoa/Cocoa.h>
#import <npapi.h>
@class WebNetscapePluginNullEventSender;
@class WebController;
@class WebDataSource;
@class WebFrame;
@class WebNetscapePlugin;
@class WebController;
@protocol WebDocumentView;
@class WebNetscapePluginNullEventSender;
@interface WebNetscapePluginView : NSView <WebDocumentView>
@interface WebBaseNetscapePluginView : NSView
{
WebNetscapePluginNullEventSender *eventSender;
unsigned argsCount;
char **cAttributes, **cValues;
WebNetscapePlugin *plugin;
WebController *webController;
WebDataSource *webDataSource;
WebFrame *webFrame;
int mode;
unsigned argsCount;
char **cAttributes;
char **cValues;
NPP instance;
NPWindow window;
NP_Port nPort;
NPP_t instanceStruct;
BOOL canRestart, isHidden, isStarted, fullMode, needsLayout;
BOOL canRestart;
BOOL isHidden;
BOOL isStarted;
NSString *mime;
NSURL *srcURL, *baseURL;
NSString *MIMEType;
NSURL *baseURL;
NSTrackingRectTag trackingTag;
NSMutableArray *streams;
NSMutableDictionary *notificationData;
......@@ -53,22 +56,26 @@
NPP_SetValueProcPtr NPP_SetValue;
}
- (id)initWithFrame:(NSRect)r plugin:(WebNetscapePlugin *)plugin URL:(NSURL *)URL baseURL:(NSURL *)baseURL mime:(NSString *)mimeType arguments:(NSDictionary *)arguments;
- (void)start;
- (void)stop;
- (WebDataSource *)webDataSource;
- (WebController *)webController;
- (WebFrame *)webFrame;
- (WebDataSource *)dataSource;
- (WebController *)controller;
+ (void)getCarbonEvent:(EventRecord *)carbonEvent;
- (BOOL)sendEvent:(EventRecord *)event;
- (BOOL)sendUpdateEvent;
- (NPP)pluginInstance;
- (NPP_NewStreamProcPtr)NPP_NewStream;
- (NPP_WriteReadyProcPtr)NPP_WriteReady;
- (NPP_WriteProcPtr)NPP_Write;
- (NPP_StreamAsFileProcPtr)NPP_StreamAsFile;
- (NPP_DestroyStreamProcPtr)NPP_DestroyStream;
- (NPP_URLNotifyProcPtr)NPP_URLNotify;
- (void)setUpWindowAndPort;
- (WebNetscapePlugin *)plugin;
- (void)setPlugin:(WebNetscapePlugin *)thePlugin;
- (void)setMIMEType:(NSString *)theMIMEType;
- (void)setBaseURL:(NSURL *)theBaseURL;
- (void)setArguments:(NSDictionary *)theArguments;
- (void)setMode:(int)theMode;
@end
/*
WebPluginView.mm
WebBaseNetscapePluginView.m
Copyright 2002, Apple, Inc. All rights reserved.
*/
#define USE_CARBON 1
#import <WebKit/WebBaseNetscapePluginView.h>
#import <WebKit/WebController.h>
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebDataSource.h>
......@@ -13,25 +14,23 @@
#import <WebKit/WebKitLogging.h>
#import <WebKit/WebNullPluginView.h>
#import <WebKit/WebNSViewExtras.h>
#import <WebKit/WebPluginDatabase.h>
#import <WebKit/WebPluginStream.h>
#import <WebKit/WebPluginNullEventSender.h>
#import <WebKit/WebPluginView.h>
#import <WebKit/WebPlugin.h>
#import <WebKit/WebView.h>
#import <WebKit/WebWindowOperationsDelegate.h>
#import <WebFoundation/WebAssertions.h>
#import <WebFoundation/WebError.h>
//#import <WebFoundation/WebAssertions.h>
#import <WebFoundation/WebFoundation.h>
#import <WebFoundation/WebNSStringExtras.h>
#import <WebFoundation/WebNSURLExtras.h>
#import <WebFoundation/WebResourceRequest.h>
#import <AppKit/NSEvent_Private.h>
#import <AppKit/NSWindow_Private.h>
#import <Carbon/Carbon.h>
@implementation WebNetscapePluginView
@implementation WebBaseNetscapePluginView
#pragma mark EVENTS
......@@ -116,15 +115,15 @@ - (UInt32)keyMessageForEvent:(NSEvent *)theEvent
- (BOOL)sendEvent:(EventRecord *)event
{
BOOL defers = [webController _defersCallbacks];
BOOL defers = [[self controller] _defersCallbacks];
if (!defers) {
[webController _setDefersCallbacks:YES];
[[self controller] _setDefersCallbacks:YES];
}
BOOL acceptedEvent = NPP_HandleEvent(instance, event);
if (!defers) {
[webController _setDefersCallbacks:NO];
[[self controller] _setDefersCallbacks:NO];
}
return acceptedEvent;
......@@ -370,92 +369,7 @@ - (NSMenu *)menuForEvent:(NSEvent *)theEvent
return nil;
}
#pragma mark WEB_PLUGIN_VIEW
- (id)initWithFrame:(NSRect)r plugin:(WebNetscapePlugin *)plugin URL:(NSURL *)theURL baseURL:(NSURL *)theBaseURL mime:(NSString *)mimeType arguments:(NSDictionary *)arguments
{
[super initWithFrame:r];
instance = &instanceStruct;
instance->ndata = self;
canRestart = YES;
mime = [mimeType retain];
srcURL = [theURL retain];
baseURL = [theBaseURL retain];
// load the plug-in if it is not already loaded
if (![plugin load])
return nil;
// copy function pointers
NPP_New = [plugin NPP_New];
NPP_Destroy = [plugin NPP_Destroy];
NPP_SetWindow = [plugin NPP_SetWindow];
NPP_NewStream = [plugin NPP_NewStream];
NPP_WriteReady = [plugin NPP_WriteReady];
NPP_Write = [plugin NPP_Write];
NPP_StreamAsFile = [plugin NPP_StreamAsFile];
NPP_DestroyStream = [plugin NPP_DestroyStream];
NPP_HandleEvent = [plugin NPP_HandleEvent];
NPP_URLNotify = [plugin NPP_URLNotify];
NPP_GetValue = [plugin NPP_GetValue];
NPP_SetValue = [plugin NPP_SetValue];
NPP_Print = [plugin NPP_Print];
LOG(Plugins, "%@", arguments);
// Convert arguments dictionary to 2 string arrays.
// These arrays are passed to NPP_New, but the strings need to be
// modifiable and live the entire life of the plugin.
// The Java plug-in requires the first argument to be the base URL
if ([mime isEqualToString:@"application/x-java-applet"]) {
cAttributes = (char **)malloc(([arguments count] + 1) * sizeof(char *));
cValues = (char **)malloc(([arguments count] + 1) * sizeof(char *));
cAttributes[0] = strdup("DOCBASE");
cValues[0] = strdup([[baseURL absoluteString] UTF8String]);
argsCount++;
} else {
cAttributes = (char **)malloc([arguments count] * sizeof(char *));
cValues = (char **)malloc([arguments count] * sizeof(char *));
}
NSEnumerator *e = [arguments keyEnumerator];
NSString *key;
while ((key = [e nextObject])) {
cAttributes[argsCount] = strdup([key UTF8String]);
cValues[argsCount] = strdup([[arguments objectForKey:key] UTF8String]);
argsCount++;
}
streams = [[NSMutableArray alloc] init];
notificationData = [[NSMutableDictionary alloc] init];
return self;
}
-(void)dealloc
{
unsigned i;
[self stop];
for (i = 0; i < argsCount; i++) {
free(cAttributes[i]);
free(cValues[i]);
}
[streams removeAllObjects];
[streams release];
[mime release];
[srcURL release];
[baseURL release];
[notificationData release];
free(cAttributes);
free(cValues);
[super dealloc];
}
#pragma mark WEB_NETSCAPE_PLUGIN
- (void)setUpWindowAndPort
{
......@@ -533,15 +447,16 @@ - (void)resetTrackingRect
-(void)start
{
if (isStarted || !canRestart || NPP_New == 0)
if (isStarted || !canRestart || NPP_New == 0){
return;
}
isStarted = YES;
#if !LOG_DISABLED
NPError npErr =
#endif
NPP_New((char *)[mime cString], instance, fullMode ? NP_FULL : NP_EMBED, argsCount, cAttributes, cValues, NULL);
NPP_New((char *)[MIMEType cString], instance, mode, argsCount, cAttributes, cValues, NULL);
LOG(Plugins, "NPP_New: %d", npErr);
// Create a WindowRef is one doesn't already exist
......@@ -566,22 +481,9 @@ -(void)start
name:NSWindowDidResignKeyNotification object:theWindow];
[notificationCenter addObserver:self selector:@selector(defaultsHaveChanged:)
name:NSUserDefaultsDidChangeNotification object:nil];
if ([theWindow isKeyWindow])
[self sendActivateEvent:YES];
WebView *webView = (WebView *)[self _web_superviewOfClass:[WebView class]];
webController = [[webView controller] retain];
webFrame = [[webController frameForView:webView] retain];
webDataSource = [[webFrame dataSource] retain];
if(srcURL){
WebNetscapePluginStream *stream = [[WebNetscapePluginStream alloc] initWithURL:srcURL pluginPointer:instance];
if(stream){
[stream startLoad];
[streams addObject:stream];
[stream release];
}
if ([theWindow isKeyWindow]){
[self sendActivateEvent:YES];
}
eventSender = [[WebNetscapePluginNullEventSender alloc] initWithPluginView:self];
......@@ -592,9 +494,11 @@ -(void)start
- (void)stop
{
[self removeTrackingRect];
if (!isStarted)
if (!isStarted){
return;
}
isStarted = NO;
// Stop any active streams
......@@ -610,57 +514,36 @@ - (void)stop
// Stop notifications
[[NSNotificationCenter defaultCenter] removeObserver:self];
// Release web objects here to avoid circular retain
[webController release];
[webFrame release];
[webDataSource release];
#if !LOG_DISABLED
NPError npErr =
#endif
NPP_Destroy(instance, NULL);
NPError npErr = NPP_Destroy(instance, NULL);
LOG(Plugins, "NPP_Destroy: %d", npErr);
}
- (WebDataSource *)webDataSource
- (WebDataSource *)dataSource
{
return webDataSource;
// Do nothing. Overridden by subclasses.
return nil;
}
- (WebController *)webController
- (WebFrame *)webFrame
{
return webController;
return [[self dataSource] webFrame];
}
#pragma mark WEB_DOCUMENT_VIEW
- (WebController *)controller
{
return [[self webFrame] controller];
}
- initWithFrame:(NSRect)frame
- (WebNetscapePlugin *)plugin
{