[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 08:39:51 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 8ce9ad0e97ed87d2969073e2a7ac6d8f9cb83f58
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri May 14 00:24:54 2004 +0000
Updated to implementation to reflect new API. Left old SPI
in place for compatibility. Can remove when the Java plug-in
updates.
Reviewed by Chris.
* Plugins.subproj/WebPlugin.h:
* Plugins.subproj/WebPluginContainer.h:
* Plugins.subproj/WebPluginController.h:
* Plugins.subproj/WebPluginController.m:
(-[WebPluginController startAllPlugins]):
(-[WebPluginController stopAllPlugins]):
(-[WebPluginController addPlugin:]):
(-[WebPluginController destroyAllPlugins]):
(-[WebPluginController webPlugInContainerLoadRequest:inFrame:]):
(-[WebPluginController showURL:inFrame:]):
(-[WebPluginController webPlugInContainerShowStatus:]):
(-[WebPluginController showStatus:]):
(-[WebPluginController webPlugInContainerSelectionColor]):
(-[WebPluginController selectionColor]):
(-[WebPluginController webFrame]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 30af763..4019904 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,27 @@
+2004-05-13 Richard Williamson <rjw at apple.com>
+
+ Updated to implementation to reflect new API. Left old SPI
+ in place for compatibility. Can remove when the Java plug-in
+ updates.
+
+ Reviewed by Chris.
+
+ * Plugins.subproj/WebPlugin.h:
+ * Plugins.subproj/WebPluginContainer.h:
+ * Plugins.subproj/WebPluginController.h:
+ * Plugins.subproj/WebPluginController.m:
+ (-[WebPluginController startAllPlugins]):
+ (-[WebPluginController stopAllPlugins]):
+ (-[WebPluginController addPlugin:]):
+ (-[WebPluginController destroyAllPlugins]):
+ (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]):
+ (-[WebPluginController showURL:inFrame:]):
+ (-[WebPluginController webPlugInContainerShowStatus:]):
+ (-[WebPluginController showStatus:]):
+ (-[WebPluginController webPlugInContainerSelectionColor]):
+ (-[WebPluginController selectionColor]):
+ (-[WebPluginController webFrame]):
+
2004-05-13 Chris Blumenberg <cblu at apple.com>
- Added stubs for WebView action and drag & drop customization API's
diff --git a/WebKit/Plugins.subproj/WebPlugin.h b/WebKit/Plugins.subproj/WebPlugin.h
index 8f360d8..95bda4d 100644
--- a/WebKit/Plugins.subproj/WebPlugin.h
+++ b/WebKit/Plugins.subproj/WebPlugin.h
@@ -6,64 +6,6 @@
#import <Cocoa/Cocoa.h>
/*!
- @protocol WebPlugin
- @discussion Protocol that enables the application that loads the web plugin
- to control it (e.g. init, start, stop, destroy). This protocol is typically
- implemented by an NSView subclass.
-*/
-
- at protocol WebPlugin <NSObject>
-
-/*!
- @method pluginInitialize
- @abstract Tell the plugin to perform one-time initialization.
- @discussion This method must be only called once per instance of the plugin
- object and must be called before any other methods in this protocol.
-*/
-- (void)pluginInitialize;
-
-/*!
- @method pluginStart
- @abstract Tell the plugin to start normal operation.
- @discussion The plug-in usually begins drawing, playing sounds and/or
- animation in this method. This method must be called before calling pluginStop.
- This method may called more than once, provided that the application has
- already called pluginInitialize and that each call to pluginStart is followed
- by a call to pluginStop.
-*/
-- (void)pluginStart;
-
-/*!
- @method pluginStop
- @abstract Tell the plugin stop normal operation.
- @discussion pluginStart must be called before this method. This method may be
- called more than once, provided that the application has already called
- pluginInitialize and that each call to pluginStop is preceded by a call to
- pluginStart.
-*/
-- (void)pluginStop;
-
-/*!
- @method pluginDestroy
- @abstract Tell the plugin perform cleanup and prepare to be deallocated.
- @discussion The plug-in typically releases memory and other resources in this
- method. If the plug-in has retained the WebPluginContainer, it must release
- it in this mehthod. This method must be only called once per instance of the
- plugin object. No other methods in this interface may be called after the
- application has called pluginDestroy.
-*/
-- (void)pluginDestroy;
-
- at end
-
- at protocol WebPluginSelection <NSObject>
-
-- (void)setIsSelected:(BOOL)isSelected;
-- (BOOL)isSelected;
-
- at end
-
-/*!
WebPlugIn is an informal protocol that enables interaction between an application
and web related plug-ins it may contain.
*/
diff --git a/WebKit/Plugins.subproj/WebPluginContainer.h b/WebKit/Plugins.subproj/WebPluginContainer.h
index 777e1e0..1cce502 100644
--- a/WebKit/Plugins.subproj/WebPluginContainer.h
+++ b/WebKit/Plugins.subproj/WebPluginContainer.h
@@ -8,37 +8,6 @@
#import <Cocoa/Cocoa.h>
/*!
- @protocol WebPluginContainer
- @discussion This protocol enables a plug-in to request that its application
- perform certain operations.
-*/
-
- at protocol WebPluginContainer <NSObject>
-
-/*!
- @method showURL:inFrame:
- @abstract Tell the application to show a URL in a target frame
- @param URL The URL to be shown. May not be nil.
- @param target The target frame. If the frame with the specified target is not
- found, a new window is opened and the main frame of the new window is named
- with the specified target.
-*/
-- (void)showURL:(NSURL *)URL inFrame:(NSString *)target;
-
-
-/*!
- @method showStatus:
- @abstract Tell the application to show the specified status message.
- @param message The string to be shown. May not be nil.
-*/
-- (void)showStatus:(NSString *)message;
-
-- (NSColor *)selectionColor;
-
- at end
-
-
-/*!
This informal protocol enables a plug-in to request that its containing application
perform certain operations.
*/
diff --git a/WebKit/Plugins.subproj/WebPluginController.h b/WebKit/Plugins.subproj/WebPluginController.h
index 5c9971f..a9ca254 100644
--- a/WebKit/Plugins.subproj/WebPluginController.h
+++ b/WebKit/Plugins.subproj/WebPluginController.h
@@ -13,7 +13,7 @@
@protocol WebPlugin;
@protocol WebPluginContainer;
- at interface WebPluginController : NSObject <WebPluginContainer>
+ at interface WebPluginController : NSObject
{
WebHTMLView *_HTMLView;
NSMutableArray *_views;
@@ -22,7 +22,7 @@
- (id)initWithHTMLView:(WebHTMLView *)HTMLView;
-- (void)addPlugin:(NSView <WebPlugin> *)view;
+- (void)addPlugin:(NSView *)view;
- (void)startAllPlugins;
- (void)stopAllPlugins;
diff --git a/WebKit/Plugins.subproj/WebPluginController.m b/WebKit/Plugins.subproj/WebPluginController.m
index b8c928b..affd1e4 100644
--- a/WebKit/Plugins.subproj/WebPluginController.m
+++ b/WebKit/Plugins.subproj/WebPluginController.m
@@ -27,6 +27,14 @@
- (void)setContainingWindow:(NSWindow *)w;
@end
+// For compatibility only.
+ at interface NSView (OldPluginAPI)
+- (void)pluginInitialize;
+- (void)pluginStart;
+- (void)pluginStop;
+- (void)pluginDestroy;
+ at end
+
@implementation WebPluginController
- initWithHTMLView:(WebHTMLView *)HTMLView
@@ -47,7 +55,14 @@
LOG(Plugins, "starting WebKit plugins : %@", [_views description]);
}
- [_views makeObjectsPerformSelector:@selector(pluginStart)];
+ int i, count = [_views count];
+ for (i = 0; i < count; i++) {
+ id aView = [_views objectAtIndex:i];
+ if ([aView respondsToSelector:@selector(webPlugInStart)])
+ [aView webPlugInStart];
+ else if ([aView respondsToSelector:@selector(pluginStart)])
+ [aView pluginStart];
+ }
_started = YES;
}
@@ -61,11 +76,18 @@
LOG(Plugins, "stopping WebKit plugins: %@", [_views description]);
}
- [_views makeObjectsPerformSelector:@selector(pluginStop)];
+ int i, count = [_views count];
+ for (i = 0; i < count; i++) {
+ id aView = [_views objectAtIndex:i];
+ if ([aView respondsToSelector:@selector(webPlugInStop)])
+ [aView webPlugInStop];
+ else if ([aView respondsToSelector:@selector(pluginStop)])
+ [aView pluginStop];
+ }
_started = NO;
}
-- (void)addPlugin:(NSView <WebPlugin> *)view
+- (void)addPlugin:(NSView *)view
{
if (!_HTMLView) {
ERROR("can't add a plug-in to a defunct WebPluginController");
@@ -76,11 +98,17 @@
[_views addObject:view];
LOG(Plugins, "initializing plug-in %@", view);
- [view pluginInitialize];
+ if ([view respondsToSelector:@selector(webPlugInInitialize)])
+ [view webPlugInInitialize];
+ else if ([view respondsToSelector:@selector(pluginInitialize)])
+ [view pluginInitialize];
if (_started) {
LOG(Plugins, "starting plug-in %@", view);
- [view pluginStart];
+ if ([view respondsToSelector:@selector(webPlugInStart)])
+ [view webPlugInStart];
+ else if ([view respondsToSelector:@selector(pluginStart)])
+ [view pluginStart];
if ([view respondsToSelector:@selector(setContainingWindow:)])
[view setContainingWindow:[_HTMLView window]];
@@ -96,7 +124,14 @@
LOG(Plugins, "destroying WebKit plugins: %@", [_views description]);
}
- [_views makeObjectsPerformSelector:@selector(pluginDestroy)];
+ int i, count = [_views count];
+ for (i = 0; i < count; i++) {
+ id aView = [_views objectAtIndex:i];
+ if ([aView respondsToSelector:@selector(webPlugInDestroy)])
+ [aView webPlugInDestroy];
+ else if ([aView respondsToSelector:@selector(pluginDestroy)])
+ [aView pluginDestroy];
+ }
[_views makeObjectsPerformSelector:@selector(removeFromSuperviewWithoutNeedingDisplay)];
[_views release];
_views = nil;
@@ -104,25 +139,25 @@
_HTMLView = nil;
}
-- (void)showURL:(NSURL *)URL inFrame:(NSString *)target
+- (void)webPlugInContainerLoadRequest:(NSURLRequest *)request inFrame:(NSString *)target
{
- if (!URL) {
+ if (!request) {
ERROR("nil URL passed");
return;
}
if (!_HTMLView) {
- ERROR("could not load URL %@ because plug-in has already been destroyed", URL);
+ ERROR("could not load URL %@ because plug-in has already been destroyed", request);
return;
}
WebFrame *frame = [_HTMLView _frame];
if (!frame) {
- ERROR("could not load URL %@ because plug-in has already been stopped", URL);
+ ERROR("could not load URL %@ because plug-in has already been stopped", request);
return;
}
if (!target) {
target = @"_top";
}
- NSString *JSString = [URL _web_scriptIfJavaScriptURL];
+ NSString *JSString = [[request URL] _web_scriptIfJavaScriptURL];
if (JSString) {
if ([frame findFrameNamed:target] != frame) {
ERROR("JavaScript requests can only be made on the frame that contains the plug-in");
@@ -130,7 +165,6 @@
}
[[frame _bridge] stringByEvaluatingJavaScriptFromString:JSString];
} else {
- NSURLRequest *request = [NSURLRequest requestWithURL:URL];
if (!request) {
ERROR("could not load URL %@", URL);
return;
@@ -139,7 +173,13 @@
}
}
-- (void)showStatus:(NSString *)message
+// For compatibility only.
+- (void)showURL:(NSURL *)URL inFrame:(NSString *)target
+{
+ [self webPlugInContainerLoadRequest:[NSURLRequest requestWithURL:URL] inFrame:target];
+}
+
+- (void)webPlugInContainerShowStatus:(NSString *)message
{
if (!message) {
message = @"";
@@ -152,9 +192,26 @@
[[v _UIDelegateForwarder] webView:v setStatusText:message];
}
-- (NSColor *)selectionColor
+// For compatibility only.
+- (void)showStatus:(NSString *)message
+{
+ [self webPlugInContainerShowStatus:message];
+}
+
+- (NSColor *)webPlugInContainerSelectionColor
{
return [[_HTMLView _bridge] selectionColor];
}
+// For compatibility only.
+- (NSColor *)selectionColor
+{
+ return [self webPlugInContainerSelectionColor];
+}
+
+- (WebFrame *)webFrame
+{
+ return [_HTMLView _frame];
+}
+
@end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list