[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:05:52 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit e1e5e4ee37e288803056eac0f8ab0f084c03a36c
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Apr 16 17:43:07 2002 +0000
Change headers so they don't include so much.
Also change IF_LOAD_TYPE to IFLoadType.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index a0281ff..c2b1d3b 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,52 @@
+2002-04-16 Darin Adler <darin at apple.com>
+
+ Change headers so they don't include so much.
+ Also change IF_LOAD_TYPE to IFLoadType.
+
+ * History.subproj/IFBackForwardList.h:
+ * History.subproj/IFBackForwardList.m:
+ * History.subproj/IFURIEntry.h:
+ * History.subproj/IFURIList.h:
+ * History.subproj/IFURIList.m:
+ * History.subproj/IFWebHistory.h:
+ * History.subproj/IFWebHistoryPrivate.h:
+ * History.subproj/IFWebHistoryPrivate.m:
+ * MIME.subproj/IFContentHandler.h:
+ * MIME.subproj/IFDownloadHandler.h:
+ * MIME.subproj/IFDownloadHandlerPrivate.h:
+ * MIME.subproj/IFDownloadHandlerPrivate.m:
+ * MIME.subproj/IFMIMEDatabase.h:
+ * MIME.subproj/IFMIMEDatabase.m:
+ * Misc.subproj/IFException.h:
+ * Plugins.subproj/IFNullPluginView.mm:
+ * Plugins.subproj/IFPluginView.h:
+ * Plugins.subproj/IFPluginView.mm:
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/IFBaseWebController.h:
+ * WebView.subproj/IFBaseWebController.mm:
+ * WebView.subproj/IFBaseWebControllerPrivate.h:
+ * WebView.subproj/IFBaseWebControllerPrivate.mm:
+ * WebView.subproj/IFLoadProgress.h:
+ * WebView.subproj/IFLoadProgress.mm:
+ * WebView.subproj/IFLocationChangeHandler.h:
+ * WebView.subproj/IFMainURLHandleClient.h:
+ * WebView.subproj/IFMainURLHandleClient.mm:
+ * WebView.subproj/IFPreferences.h:
+ * WebView.subproj/IFPreferencesPrivate.h:
+ * WebView.subproj/IFWebController.h:
+ * WebView.subproj/IFWebDataSource.h:
+ * WebView.subproj/IFWebDataSource.mm:
+ * WebView.subproj/IFWebDataSourcePrivate.h:
+ * WebView.subproj/IFWebDataSourcePrivate.mm:
+ * WebView.subproj/IFWebFrame.h:
+ * WebView.subproj/IFWebFrame.mm:
+ * WebView.subproj/IFWebFramePrivate.h:
+ * WebView.subproj/IFWebFramePrivate.mm:
+ * WebView.subproj/IFWebView.h:
+ * WebView.subproj/IFWebView.mm:
+ * WebView.subproj/IFWebViewPrivate.h:
+ * WebView.subproj/IFWebViewPrivate.mm:
+
2002-04-16 Kenneth Kocienda <kocienda at apple.com>
Moved IFError class from WebKit to WebFoundation.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index a0281ff..c2b1d3b 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,52 @@
+2002-04-16 Darin Adler <darin at apple.com>
+
+ Change headers so they don't include so much.
+ Also change IF_LOAD_TYPE to IFLoadType.
+
+ * History.subproj/IFBackForwardList.h:
+ * History.subproj/IFBackForwardList.m:
+ * History.subproj/IFURIEntry.h:
+ * History.subproj/IFURIList.h:
+ * History.subproj/IFURIList.m:
+ * History.subproj/IFWebHistory.h:
+ * History.subproj/IFWebHistoryPrivate.h:
+ * History.subproj/IFWebHistoryPrivate.m:
+ * MIME.subproj/IFContentHandler.h:
+ * MIME.subproj/IFDownloadHandler.h:
+ * MIME.subproj/IFDownloadHandlerPrivate.h:
+ * MIME.subproj/IFDownloadHandlerPrivate.m:
+ * MIME.subproj/IFMIMEDatabase.h:
+ * MIME.subproj/IFMIMEDatabase.m:
+ * Misc.subproj/IFException.h:
+ * Plugins.subproj/IFNullPluginView.mm:
+ * Plugins.subproj/IFPluginView.h:
+ * Plugins.subproj/IFPluginView.mm:
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/IFBaseWebController.h:
+ * WebView.subproj/IFBaseWebController.mm:
+ * WebView.subproj/IFBaseWebControllerPrivate.h:
+ * WebView.subproj/IFBaseWebControllerPrivate.mm:
+ * WebView.subproj/IFLoadProgress.h:
+ * WebView.subproj/IFLoadProgress.mm:
+ * WebView.subproj/IFLocationChangeHandler.h:
+ * WebView.subproj/IFMainURLHandleClient.h:
+ * WebView.subproj/IFMainURLHandleClient.mm:
+ * WebView.subproj/IFPreferences.h:
+ * WebView.subproj/IFPreferencesPrivate.h:
+ * WebView.subproj/IFWebController.h:
+ * WebView.subproj/IFWebDataSource.h:
+ * WebView.subproj/IFWebDataSource.mm:
+ * WebView.subproj/IFWebDataSourcePrivate.h:
+ * WebView.subproj/IFWebDataSourcePrivate.mm:
+ * WebView.subproj/IFWebFrame.h:
+ * WebView.subproj/IFWebFrame.mm:
+ * WebView.subproj/IFWebFramePrivate.h:
+ * WebView.subproj/IFWebFramePrivate.mm:
+ * WebView.subproj/IFWebView.h:
+ * WebView.subproj/IFWebView.mm:
+ * WebView.subproj/IFWebViewPrivate.h:
+ * WebView.subproj/IFWebViewPrivate.mm:
+
2002-04-16 Kenneth Kocienda <kocienda at apple.com>
Moved IFError class from WebKit to WebFoundation.
diff --git a/WebKit/History.subproj/IFBackForwardList.h b/WebKit/History.subproj/IFBackForwardList.h
index 1b97e41..ff94568 100644
--- a/WebKit/History.subproj/IFBackForwardList.h
+++ b/WebKit/History.subproj/IFBackForwardList.h
@@ -3,8 +3,9 @@
*/
#import <Foundation/Foundation.h>
-#import <WebKit/IFURIList.h>
-#import <WebKit/IFURIEntry.h>
+
+ at class IFURIList;
+ at class IFURIEntry;
@interface IFBackForwardList : NSObject {
IFURIList *uriList;
diff --git a/WebKit/History.subproj/IFBackForwardList.m b/WebKit/History.subproj/IFBackForwardList.m
index fabd556..c44ad40 100644
--- a/WebKit/History.subproj/IFBackForwardList.m
+++ b/WebKit/History.subproj/IFBackForwardList.m
@@ -8,6 +8,9 @@
#import "IFBackForwardList.h"
+#import "IFURIEntry.h"
+#import "IFURIList.h"
+
@implementation IFBackForwardList
-(id)init
diff --git a/WebKit/History.subproj/IFURIEntry.h b/WebKit/History.subproj/IFURIEntry.h
index 2137a32..26b678f 100644
--- a/WebKit/History.subproj/IFURIEntry.h
+++ b/WebKit/History.subproj/IFURIEntry.h
@@ -6,8 +6,7 @@
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
-#import <Foundation/Foundation.h>
-#import <AppKit/AppKit.h>
+#import <Cocoa/Cocoa.h>
@interface IFURIEntry : NSObject
{
diff --git a/WebKit/History.subproj/IFURIList.h b/WebKit/History.subproj/IFURIList.h
index 2d13a27..074b722 100644
--- a/WebKit/History.subproj/IFURIList.h
+++ b/WebKit/History.subproj/IFURIList.h
@@ -4,7 +4,7 @@
#import <Foundation/Foundation.h>
-#import "IFURIEntry.h"
+ at class IFURIEntry;
typedef struct IFURIListNode IFURIListNode;
diff --git a/WebKit/History.subproj/IFURIList.m b/WebKit/History.subproj/IFURIList.m
index e015246..600617e 100644
--- a/WebKit/History.subproj/IFURIList.m
+++ b/WebKit/History.subproj/IFURIList.m
@@ -3,7 +3,8 @@
*/
#import "IFURIList.h"
-#import "WebKitReallyPrivate.h"
+#import "IFURIEntry.h"
+#import "WebKitDebug.h"
struct IFURIListNode
{
diff --git a/WebKit/History.subproj/IFWebHistory.h b/WebKit/History.subproj/IFWebHistory.h
index ca28490..4a2e5c5 100644
--- a/WebKit/History.subproj/IFWebHistory.h
+++ b/WebKit/History.subproj/IFWebHistory.h
@@ -7,8 +7,8 @@
//
#import <Foundation/Foundation.h>
-#import <WebKit/IFURIEntry.h>
+ at class IFURIEntry;
@class IFWebHistoryPrivate;
// notification sent when history is modified
diff --git a/WebKit/History.subproj/IFWebHistoryPrivate.h b/WebKit/History.subproj/IFWebHistoryPrivate.h
index 309bdd9..7ab339c 100644
--- a/WebKit/History.subproj/IFWebHistoryPrivate.h
+++ b/WebKit/History.subproj/IFWebHistoryPrivate.h
@@ -7,7 +7,8 @@
//
#import <Foundation/Foundation.h>
-#import <WebKit/IFURIEntry.h>
+
+ at class IFURIEntry;
@interface IFWebHistoryPrivate : NSObject {
@private
diff --git a/WebKit/History.subproj/IFWebHistoryPrivate.m b/WebKit/History.subproj/IFWebHistoryPrivate.m
index 65a077d..99589ba 100644
--- a/WebKit/History.subproj/IFWebHistoryPrivate.m
+++ b/WebKit/History.subproj/IFWebHistoryPrivate.m
@@ -10,6 +10,7 @@
#import <WebFoundation/IFNSCalendarDateExtensions.h>
#import <WebKit/WebKitDebug.h>
+#import "IFURIEntry.h"
@interface IFWebHistoryPrivate (Private)
-(IFURIEntry *)_entryForURLString:(NSString *)urlString;
diff --git a/WebKit/History.subproj/WebBackForwardList.h b/WebKit/History.subproj/WebBackForwardList.h
index 1b97e41..ff94568 100644
--- a/WebKit/History.subproj/WebBackForwardList.h
+++ b/WebKit/History.subproj/WebBackForwardList.h
@@ -3,8 +3,9 @@
*/
#import <Foundation/Foundation.h>
-#import <WebKit/IFURIList.h>
-#import <WebKit/IFURIEntry.h>
+
+ at class IFURIList;
+ at class IFURIEntry;
@interface IFBackForwardList : NSObject {
IFURIList *uriList;
diff --git a/WebKit/History.subproj/WebBackForwardList.m b/WebKit/History.subproj/WebBackForwardList.m
index fabd556..c44ad40 100644
--- a/WebKit/History.subproj/WebBackForwardList.m
+++ b/WebKit/History.subproj/WebBackForwardList.m
@@ -8,6 +8,9 @@
#import "IFBackForwardList.h"
+#import "IFURIEntry.h"
+#import "IFURIList.h"
+
@implementation IFBackForwardList
-(id)init
diff --git a/WebKit/History.subproj/WebHistory.h b/WebKit/History.subproj/WebHistory.h
index ca28490..4a2e5c5 100644
--- a/WebKit/History.subproj/WebHistory.h
+++ b/WebKit/History.subproj/WebHistory.h
@@ -7,8 +7,8 @@
//
#import <Foundation/Foundation.h>
-#import <WebKit/IFURIEntry.h>
+ at class IFURIEntry;
@class IFWebHistoryPrivate;
// notification sent when history is modified
diff --git a/WebKit/History.subproj/WebHistoryItem.h b/WebKit/History.subproj/WebHistoryItem.h
index 2137a32..26b678f 100644
--- a/WebKit/History.subproj/WebHistoryItem.h
+++ b/WebKit/History.subproj/WebHistoryItem.h
@@ -6,8 +6,7 @@
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
-#import <Foundation/Foundation.h>
-#import <AppKit/AppKit.h>
+#import <Cocoa/Cocoa.h>
@interface IFURIEntry : NSObject
{
diff --git a/WebKit/History.subproj/WebHistoryList.h b/WebKit/History.subproj/WebHistoryList.h
index 2d13a27..074b722 100644
--- a/WebKit/History.subproj/WebHistoryList.h
+++ b/WebKit/History.subproj/WebHistoryList.h
@@ -4,7 +4,7 @@
#import <Foundation/Foundation.h>
-#import "IFURIEntry.h"
+ at class IFURIEntry;
typedef struct IFURIListNode IFURIListNode;
diff --git a/WebKit/History.subproj/WebHistoryList.m b/WebKit/History.subproj/WebHistoryList.m
index e015246..600617e 100644
--- a/WebKit/History.subproj/WebHistoryList.m
+++ b/WebKit/History.subproj/WebHistoryList.m
@@ -3,7 +3,8 @@
*/
#import "IFURIList.h"
-#import "WebKitReallyPrivate.h"
+#import "IFURIEntry.h"
+#import "WebKitDebug.h"
struct IFURIListNode
{
diff --git a/WebKit/History.subproj/WebHistoryPrivate.h b/WebKit/History.subproj/WebHistoryPrivate.h
index 309bdd9..7ab339c 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.h
+++ b/WebKit/History.subproj/WebHistoryPrivate.h
@@ -7,7 +7,8 @@
//
#import <Foundation/Foundation.h>
-#import <WebKit/IFURIEntry.h>
+
+ at class IFURIEntry;
@interface IFWebHistoryPrivate : NSObject {
@private
diff --git a/WebKit/History.subproj/WebHistoryPrivate.m b/WebKit/History.subproj/WebHistoryPrivate.m
index 65a077d..99589ba 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.m
+++ b/WebKit/History.subproj/WebHistoryPrivate.m
@@ -10,6 +10,7 @@
#import <WebFoundation/IFNSCalendarDateExtensions.h>
#import <WebKit/WebKitDebug.h>
+#import "IFURIEntry.h"
@interface IFWebHistoryPrivate (Private)
-(IFURIEntry *)_entryForURLString:(NSString *)urlString;
diff --git a/WebKit/MIME.subproj/IFContentHandler.h b/WebKit/MIME.subproj/IFContentHandler.h
index 05def3f..77c0a32 100644
--- a/WebKit/MIME.subproj/IFContentHandler.h
+++ b/WebKit/MIME.subproj/IFContentHandler.h
@@ -3,7 +3,6 @@
Copyright 2002, Apple, Inc. All rights reserved.
*/
-#import <Foundation/Foundation.h>
#import <WebKit/IFMIMEHandler.h>
@interface IFContentHandler : NSObject {
@@ -15,5 +14,4 @@
- (NSString *) HTMLDocument;
- (NSString *) textHTMLDocumentBottom;
-
@end
diff --git a/WebKit/MIME.subproj/IFDownloadHandler.h b/WebKit/MIME.subproj/IFDownloadHandler.h
index 0962512..2ab50b2 100644
--- a/WebKit/MIME.subproj/IFDownloadHandler.h
+++ b/WebKit/MIME.subproj/IFDownloadHandler.h
@@ -7,12 +7,14 @@
//
#import <Foundation/Foundation.h>
-#import <WebKit/IFMIMEHandler.h>
-#import <WebFoundation/WebFoundation.h>
+
+ at class IFMIMEHandler;
+
+ at class IFDownloadHandlerPrivate;
@interface IFDownloadHandler : NSObject {
@private
- id _downloadHandlerPrivate;
+ IFDownloadHandlerPrivate *_downloadHandlerPrivate;
}
- (NSURL *) url;
diff --git a/WebKit/MIME.subproj/IFDownloadHandlerPrivate.h b/WebKit/MIME.subproj/IFDownloadHandlerPrivate.h
index e9e4478..7b889c1 100644
--- a/WebKit/MIME.subproj/IFDownloadHandlerPrivate.h
+++ b/WebKit/MIME.subproj/IFDownloadHandlerPrivate.h
@@ -7,9 +7,9 @@
//
#import <Foundation/Foundation.h>
-#import <WebFoundation/WebFoundation.h>
#import <WebKit/IFDownloadHandler.h>
-#import <WebKit/IFMIMEHandler.h>
+
+ at class IFURLHandle;
@interface IFDownloadHandlerPrivate : NSObject {
IFMIMEHandler *mimeHandler;
@@ -36,5 +36,4 @@
- _initWithURLHandle:(IFURLHandle *)uHandle mimeHandler:(IFMIMEHandler *)mHandler;
- (void) _receivedData:(NSData *)data;
- (void) _finishedDownload;
-
- at end
\ No newline at end of file
+ at end
diff --git a/WebKit/MIME.subproj/IFDownloadHandlerPrivate.m b/WebKit/MIME.subproj/IFDownloadHandlerPrivate.m
index 0ae7b2b..6f65aac 100644
--- a/WebKit/MIME.subproj/IFDownloadHandlerPrivate.m
+++ b/WebKit/MIME.subproj/IFDownloadHandlerPrivate.m
@@ -10,6 +10,9 @@
#import <ApplicationServices/ApplicationServices.h>
#import <Carbon/Carbon.h>
+#import "IFMIMEHandler.h"
+#import <WebFoundation/IFURLHandle.h>
+
@implementation IFDownloadHandlerPrivate
diff --git a/WebKit/MIME.subproj/IFMIMEDatabase.h b/WebKit/MIME.subproj/IFMIMEDatabase.h
index 53248b9..7dc3763 100644
--- a/WebKit/MIME.subproj/IFMIMEDatabase.h
+++ b/WebKit/MIME.subproj/IFMIMEDatabase.h
@@ -7,7 +7,8 @@
//
#import <Foundation/Foundation.h>
-#import <IFMIMEHandler.h>
+
+ at class IFMIMEHandler;
@interface IFMIMEDatabase : NSObject {
NSMutableDictionary *mimeHandlers;
diff --git a/WebKit/MIME.subproj/IFMIMEDatabase.m b/WebKit/MIME.subproj/IFMIMEDatabase.m
index 2cafc91..a9fd918 100644
--- a/WebKit/MIME.subproj/IFMIMEDatabase.m
+++ b/WebKit/MIME.subproj/IFMIMEDatabase.m
@@ -7,6 +7,8 @@
//
#import "IFMIMEDatabase.h"
+
+#import "IFMIMEHandler.h"
#import <WCPluginDatabase.h>
#import <WCPlugin.h>
diff --git a/WebKit/Misc.subproj/IFException.h b/WebKit/Misc.subproj/IFException.h
index 0a754cb..fa7a079 100644
--- a/WebKit/Misc.subproj/IFException.h
+++ b/WebKit/Misc.subproj/IFException.h
@@ -22,8 +22,9 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _IFEXCEPTION_H
-#define _IFEXCEPTION_H
+
+#ifndef IFEXCEPTION_H
+#define IFEXCEPTION_H
extern NSString * const IFMethodNotYetImplemented;
extern NSString * const IFRuntimeError;
diff --git a/WebKit/Misc.subproj/WebException.h b/WebKit/Misc.subproj/WebException.h
index 0a754cb..fa7a079 100644
--- a/WebKit/Misc.subproj/WebException.h
+++ b/WebKit/Misc.subproj/WebException.h
@@ -22,8 +22,9 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _IFEXCEPTION_H
-#define _IFEXCEPTION_H
+
+#ifndef IFEXCEPTION_H
+#define IFEXCEPTION_H
extern NSString * const IFMethodNotYetImplemented;
extern NSString * const IFRuntimeError;
diff --git a/WebKit/Plugins.subproj/IFNullPluginView.mm b/WebKit/Plugins.subproj/IFNullPluginView.mm
index d5f6d58..1b63cbd 100644
--- a/WebKit/Plugins.subproj/IFNullPluginView.mm
+++ b/WebKit/Plugins.subproj/IFNullPluginView.mm
@@ -7,7 +7,7 @@
#import "WCPluginWidget.h"
#import "IFWebView.h"
#import "IFBaseWebController.h"
-
+#import "IFWebController.h"
static BOOL imageLoaded = NO;
static NSImage *image = nil;
diff --git a/WebKit/Plugins.subproj/IFPluginView.h b/WebKit/Plugins.subproj/IFPluginView.h
index 3f04a30..9935775 100644
--- a/WebKit/Plugins.subproj/IFPluginView.h
+++ b/WebKit/Plugins.subproj/IFPluginView.h
@@ -3,22 +3,19 @@
Copyright 2002, Apple, Inc. All rights reserved.
*/
-#import <AppKit/AppKit.h>
-#import <WCPlugin.h>
-#import <qwidget.h>
+#import <Cocoa/Cocoa.h>
#import <npapi.h>
-#import <WebFoundation/WebFoundation.h>
-#import <IFWebView.h>
-#import <IFBaseWebController.h>
-#import <IFPluginNullEventSender.h>
+
+ at class IFPluginNullEventSender;
+ at class IFWebDataSource;
+ at class WCPlugin;
+ at protocol IFWebController;
@interface IFPluginView : NSView {
WCPlugin *plugin;
IFPluginNullEventSender *eventSender;
- IFBaseWebController *webController;
- IFWebView *webView;
- IFWebFrame *webFrame;
+ id <IFWebController> webController;
IFWebDataSource *webDataSource;
NPP instance;
@@ -49,7 +46,7 @@
NPP_SetValueProcPtr NPP_SetValue;
}
-- initWithFrame:(NSRect) r plugin:(WCPlugin *)plug url:(NSString *)location mime:(NSString *)mime arguments:(NSDictionary *)arguments mode:(uint16)mode;
+- initWithFrame:(NSRect)r plugin:(WCPlugin *)plug url:(NSString *)location mime:(NSString *)mime arguments:(NSDictionary *)arguments mode:(uint16)mode;
-(void)drawRect:(NSRect)rect;
-(void)setWindow;
-(void)viewHasMoved:(NSNotification *)notification;
@@ -69,7 +66,6 @@
-(void)keyUp:(NSEvent *)theEvent;
-(void)stop;
-(void)start;
--(void)dealloc;
// plug-in to browser calls
-(NPError)getURLNotify:(const char *)url target:(const char *)target notifyData:(void *)notifyData;
diff --git a/WebKit/Plugins.subproj/IFPluginView.mm b/WebKit/Plugins.subproj/IFPluginView.mm
index 18781c4..3d6a216 100644
--- a/WebKit/Plugins.subproj/IFPluginView.mm
+++ b/WebKit/Plugins.subproj/IFPluginView.mm
@@ -7,6 +7,10 @@
#import "IFPluginView.h"
+#import <WebKit/IFLoadProgress.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebFrame.h>
+
#import <AppKit/NSWindow_Private.h>
#import <Carbon/Carbon.h>
@@ -17,6 +21,12 @@
#import <WebFoundation/IFError.h>
#import <WebKitDebug.h>
+#import <WCPlugin.h>
+#import <qwidget.h>
+#import <IFWebView.h>
+#import <IFBaseWebController.h>
+#import <IFPluginNullEventSender.h>
+
extern "C" {
#import <CoreGraphics/CoreGraphics.h>
#import <CoreGraphics/CoreGraphicsPrivate.h>
@@ -224,12 +234,9 @@ extern "C" {
- (void)stop
{
NPError npErr;
- unsigned i;
if (!stopped){
- for(i=0; i<[activeURLHandles count]; i++){
- [[activeURLHandles objectAtIndex:i] cancelLoadInBackground];
- }
+ [activeURLHandles makeObjectsPerformSelector:@selector(cancelLoadInBackground)];
[eventSender stop];
[eventSender release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -310,10 +317,9 @@ extern "C" {
transferred = TRUE;
trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
- webView = [self findSuperview:@"IFWebView"];
+ id webView = [self findSuperview:@"IFWebView"];
webController = [webView controller];
- webFrame = [webController frameForView:webView];
- webDataSource = [webFrame dataSource];
+ webDataSource = [[webController frameForView:webView] dataSource];
}
[self sendUpdateEvent];
}
diff --git a/WebKit/Plugins.subproj/WebNullPluginView.m b/WebKit/Plugins.subproj/WebNullPluginView.m
index d5f6d58..1b63cbd 100644
--- a/WebKit/Plugins.subproj/WebNullPluginView.m
+++ b/WebKit/Plugins.subproj/WebNullPluginView.m
@@ -7,7 +7,7 @@
#import "WCPluginWidget.h"
#import "IFWebView.h"
#import "IFBaseWebController.h"
-
+#import "IFWebController.h"
static BOOL imageLoaded = NO;
static NSImage *image = nil;
diff --git a/WebKit/Plugins.subproj/WebPluginView.h b/WebKit/Plugins.subproj/WebPluginView.h
index 3f04a30..9935775 100644
--- a/WebKit/Plugins.subproj/WebPluginView.h
+++ b/WebKit/Plugins.subproj/WebPluginView.h
@@ -3,22 +3,19 @@
Copyright 2002, Apple, Inc. All rights reserved.
*/
-#import <AppKit/AppKit.h>
-#import <WCPlugin.h>
-#import <qwidget.h>
+#import <Cocoa/Cocoa.h>
#import <npapi.h>
-#import <WebFoundation/WebFoundation.h>
-#import <IFWebView.h>
-#import <IFBaseWebController.h>
-#import <IFPluginNullEventSender.h>
+
+ at class IFPluginNullEventSender;
+ at class IFWebDataSource;
+ at class WCPlugin;
+ at protocol IFWebController;
@interface IFPluginView : NSView {
WCPlugin *plugin;
IFPluginNullEventSender *eventSender;
- IFBaseWebController *webController;
- IFWebView *webView;
- IFWebFrame *webFrame;
+ id <IFWebController> webController;
IFWebDataSource *webDataSource;
NPP instance;
@@ -49,7 +46,7 @@
NPP_SetValueProcPtr NPP_SetValue;
}
-- initWithFrame:(NSRect) r plugin:(WCPlugin *)plug url:(NSString *)location mime:(NSString *)mime arguments:(NSDictionary *)arguments mode:(uint16)mode;
+- initWithFrame:(NSRect)r plugin:(WCPlugin *)plug url:(NSString *)location mime:(NSString *)mime arguments:(NSDictionary *)arguments mode:(uint16)mode;
-(void)drawRect:(NSRect)rect;
-(void)setWindow;
-(void)viewHasMoved:(NSNotification *)notification;
@@ -69,7 +66,6 @@
-(void)keyUp:(NSEvent *)theEvent;
-(void)stop;
-(void)start;
--(void)dealloc;
// plug-in to browser calls
-(NPError)getURLNotify:(const char *)url target:(const char *)target notifyData:(void *)notifyData;
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index 18781c4..3d6a216 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -7,6 +7,10 @@
#import "IFPluginView.h"
+#import <WebKit/IFLoadProgress.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebFrame.h>
+
#import <AppKit/NSWindow_Private.h>
#import <Carbon/Carbon.h>
@@ -17,6 +21,12 @@
#import <WebFoundation/IFError.h>
#import <WebKitDebug.h>
+#import <WCPlugin.h>
+#import <qwidget.h>
+#import <IFWebView.h>
+#import <IFBaseWebController.h>
+#import <IFPluginNullEventSender.h>
+
extern "C" {
#import <CoreGraphics/CoreGraphics.h>
#import <CoreGraphics/CoreGraphicsPrivate.h>
@@ -224,12 +234,9 @@ extern "C" {
- (void)stop
{
NPError npErr;
- unsigned i;
if (!stopped){
- for(i=0; i<[activeURLHandles count]; i++){
- [[activeURLHandles objectAtIndex:i] cancelLoadInBackground];
- }
+ [activeURLHandles makeObjectsPerformSelector:@selector(cancelLoadInBackground)];
[eventSender stop];
[eventSender release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -310,10 +317,9 @@ extern "C" {
transferred = TRUE;
trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
- webView = [self findSuperview:@"IFWebView"];
+ id webView = [self findSuperview:@"IFWebView"];
webController = [webView controller];
- webFrame = [webController frameForView:webView];
- webDataSource = [webFrame dataSource];
+ webDataSource = [[webController frameForView:webView] dataSource];
}
[self sendUpdateEvent];
}
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index cb7b179..8036071 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 36;
+ objectVersion = 38;
objects = {
014CEA440018CDF011CA2923 = {
buildRules = (
diff --git a/WebKit/WebView.subproj/IFBaseWebController.h b/WebKit/WebView.subproj/IFBaseWebController.h
index b72e45f..cb98bd8 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.h
+++ b/WebKit/WebView.subproj/IFBaseWebController.h
@@ -3,34 +3,28 @@
Copyright 2001, 2002 Apple, Inc. All rights reserved.
*/
-#import <WebKit/IFWebController.h>
+
+#import <Foundation/Foundation.h>
@class IFWebDataSource;
@class IFWebView;
+ at protocol IFWebController;
+
+ at class IFBaseWebControllerPrivate;
-/*
-*/
@interface IFBaseWebController : NSObject <IFWebController>
{
@private
- id _controllerPrivate;
+ IFBaseWebControllerPrivate *_controllerPrivate;
}
-
-/*
- Calls designated initializer with nil arguments.
-*/
+// Calls designated initializer with nil arguments.
- init;
-/*
- Designated initializer.
-*/
+// Designated initializer.
- initWithView: (IFWebView *)view provisionalDataSource: (IFWebDataSource *)dataSource;
-
- (void)setDirectsAllLinksToSystemBrowser: (BOOL)flag;
-
-
- (BOOL)directsAllLinksToSystemBrowser;
@end
diff --git a/WebKit/WebView.subproj/IFBaseWebController.mm b/WebKit/WebView.subproj/IFBaseWebController.mm
index a640105..f78866a 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.mm
+++ b/WebKit/WebView.subproj/IFBaseWebController.mm
@@ -10,6 +10,7 @@
#import <WebKit/IFWebFramePrivate.h>
#import <WebKit/IFDynamicScrollBarsView.h>
#import <WebKit/IFException.h>
+#import <WebKit/IFWebController.h>
#import <WebKit/WebKitDebug.h>
diff --git a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h
index 2f46a12..6fe0322 100644
--- a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h
+++ b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h
@@ -2,10 +2,12 @@
IFWebController.mm
Copyright 2001, Apple, Inc. All rights reserved.
*/
+
#import <WebKit/IFBaseWebController.h>
-#import <WebKit/IFWebDataSource.h>
-#import <WebKit/IFWebFrame.h>
+ at class IFError;
+ at class IFLoadProgress;
+ at class IFWebFrame;
@interface IFBaseWebControllerPrivate : NSObject
{
@@ -13,7 +15,6 @@
}
@end
-
@interface IFBaseWebController (IFPrivate);
- (void)_receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
- (void)_receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
diff --git a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
index d505422..b618d68 100644
--- a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
+++ b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
@@ -7,10 +7,13 @@
#import <WebKit/IFWebViewPrivate.h>
#import <WebKit/IFWebFramePrivate.h>
#import <WebKit/IFPreferencesPrivate.h>
+#import <WebKit/IFLoadProgress.h>
+#import <WebKit/IFWebController.h>
#import <WebFoundation/IFError.h>
-#include <KWQKHTMLPart.h>
-#include <rendering/render_frames.h>
+#import <WebFoundation/IFURLCacheLoaderConstants.h>
+#import <KWQKHTMLPart.h>
+#import <rendering/render_frames.h>
#import <WebKit/WebKitDebug.h>
diff --git a/WebKit/WebView.subproj/IFLoadProgress.h b/WebKit/WebView.subproj/IFLoadProgress.h
index a1256b3..8a17f1e 100644
--- a/WebKit/WebView.subproj/IFLoadProgress.h
+++ b/WebKit/WebView.subproj/IFLoadProgress.h
@@ -13,7 +13,7 @@ typedef enum {
IF_LOAD_TYPE_SCRIPT = 3,
IF_LOAD_TYPE_HTML = 4,
IF_LOAD_TYPE_PLUGIN = 5
-} IF_LOAD_TYPE;
+} IFLoadType;
@interface IFLoadProgress : NSObject
@@ -21,14 +21,14 @@ typedef enum {
int bytesSoFar; // 0 if this is the start of load
int totalToLoad; // -1 if this is not known.
// bytesSoFar == totalLoaded when complete
- IF_LOAD_TYPE type;
+ IFLoadType type;
}
-- (id)initWithBytesSoFar:(int)bytes totalToLoad:(int)total type:(IF_LOAD_TYPE)loadType;
+- (id)initWithBytesSoFar:(int)bytes totalToLoad:(int)total type:(IFLoadType)loadType;
- (int)bytesSoFar;
- (int)totalToLoad;
-- (IF_LOAD_TYPE)type;
+- (IFLoadType)type;
@end
diff --git a/WebKit/WebView.subproj/IFLoadProgress.mm b/WebKit/WebView.subproj/IFLoadProgress.mm
index ca11a8f..701af82 100644
--- a/WebKit/WebView.subproj/IFLoadProgress.mm
+++ b/WebKit/WebView.subproj/IFLoadProgress.mm
@@ -9,7 +9,7 @@
@implementation IFLoadProgress
-static id IFLoadProgressMake()
+static id IFLoadProgressMake(void)
{
return [[[IFLoadProgress alloc] init] autorelease];
}
@@ -19,7 +19,7 @@ static id IFLoadProgressMake()
WCSetIFLoadProgressMakeFunc(IFLoadProgressMake);
}
-- (id)initWithBytesSoFar:(int)bytes totalToLoad:(int)total type:(IF_LOAD_TYPE)loadType
+- (id)initWithBytesSoFar:(int)bytes totalToLoad:(int)total type:(IFLoadType)loadType
{
if (![super init]) {
return nil;
@@ -42,7 +42,7 @@ static id IFLoadProgressMake()
return totalToLoad;
}
-- (IF_LOAD_TYPE)type
+- (IFLoadType)type
{
return type;
}
diff --git a/WebKit/WebView.subproj/IFLocationChangeHandler.h b/WebKit/WebView.subproj/IFLocationChangeHandler.h
index bb0a935..383e552 100644
--- a/WebKit/WebView.subproj/IFLocationChangeHandler.h
+++ b/WebKit/WebView.subproj/IFLocationChangeHandler.h
@@ -4,7 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
+
+#import <Foundation/Foundation.h>
@class IFError;
@class IFWebDataSource;
@@ -57,5 +58,3 @@
- (void) downloadingWithHandler:(IFDownloadHandler *)downloadHandler;
@end
-
-
diff --git a/WebKit/WebView.subproj/IFMainURLHandleClient.h b/WebKit/WebView.subproj/IFMainURLHandleClient.h
index 545e218..2e248c9 100644
--- a/WebKit/WebView.subproj/IFMainURLHandleClient.h
+++ b/WebKit/WebView.subproj/IFMainURLHandleClient.h
@@ -6,12 +6,13 @@
Copyright 2001, Apple, Inc. All rights reserved.
*/
-#import <Cocoa/Cocoa.h>
+#import <WebKit/IFMIMEHandler.h>
-#import <WebFoundation/WebFoundation.h>
+ at class IFDownloadHandler;
+ at class IFWebDataSource;
+ at protocol IFURLHandleClient;
-#import <WebKit/IFWebDataSourcePrivate.h>
-#import <WebKit/IFMIMEHandler.h>
+class KHTMLPart;
@interface IFMainURLHandleClient : NSObject <IFURLHandleClient>
{
diff --git a/WebKit/WebView.subproj/IFMainURLHandleClient.mm b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
index f7d88e2..e5e94f6 100644
--- a/WebKit/WebView.subproj/IFMainURLHandleClient.mm
+++ b/WebKit/WebView.subproj/IFMainURLHandleClient.mm
@@ -3,18 +3,26 @@
Copyright 2001, Apple, Inc. All rights reserved.
*/
-#include <pthread.h>
-#import <WebKit/IFBaseWebControllerPrivate.h>
#import <WebKit/IFMainURLHandleClient.h>
+
+#import <pthread.h>
+
+#import <WebKit/IFLoadProgress.h>
+#import <WebKit/IFBaseWebControllerPrivate.h>
#import <WebKit/IFMIMEDatabase.h>
#import <WebKit/WebKitDebug.h>
#import <WebKit/IFContentHandler.h>
#import <WebKit/IFDownloadHandlerPrivate.h>
+#import <WebKit/IFWebDataSourcePrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFLocationChangeHandler.h>
#import <WebFoundation/IFError.h>
+#import <WebFoundation/IFURLHandle.h>
-#include <khtmlview.h>
+#import <khtmlview.h>
+#import <khtml_part.h>
@implementation IFMainURLHandleClient
diff --git a/WebKit/WebView.subproj/IFPreferences.h b/WebKit/WebView.subproj/IFPreferences.h
index 73a0063..6c2a6c4 100644
--- a/WebKit/WebView.subproj/IFPreferences.h
+++ b/WebKit/WebView.subproj/IFPreferences.h
@@ -4,7 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
+
+#import <Foundation/Foundation.h>
@interface IFPreferences: NSObject
@@ -78,4 +79,3 @@
- (BOOL)onlyLocalReferences;
#endif
-
diff --git a/WebKit/WebView.subproj/IFPreferencesPrivate.h b/WebKit/WebView.subproj/IFPreferencesPrivate.h
index 0b4a202..bd14bce 100644
--- a/WebKit/WebView.subproj/IFPreferencesPrivate.h
+++ b/WebKit/WebView.subproj/IFPreferencesPrivate.h
@@ -4,7 +4,6 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
#import <WebKit/IFPreferences.h>
@@ -17,4 +16,3 @@
- (NSTimeInterval)_resourceTimedLayoutDelay;
@end
-
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index c17f717..7ddcc48 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -4,11 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFLoadProgress.h>
-#import <WebKit/IFLocationChangeHandler.h>
-#import <WebKit/IFDownloadHandler.h>
+#import <Cocoa/Cocoa.h>
/*
=============================================================================
@@ -28,11 +25,13 @@
=============================================================================
*/
-
- at class IFWebDataSource;
+ at class IFDownloadHandler;
@class IFError;
+ at class IFLoadProgress;
+ at class IFWebDataSource;
@class IFWebFrame;
+ at protocol IFLocationChangeHandler;
/*
=============================================================================
@@ -45,6 +44,7 @@
=============================================================================
*/
+
@protocol IFResourceProgressHandler
/*
@@ -59,8 +59,8 @@
@end
-
@protocol IFDownloadProgressHandler
+
// Called when progress of a download has been made
- (void) receivedProgress:(IFLoadProgress *)progress forDownloadHandler:(IFDownloadHandler *)downloadHandler;
@@ -69,7 +69,6 @@
@end
-
/*
=============================================================================
@@ -90,10 +89,6 @@
@end
-
-
-
-
/*
=============================================================================
@@ -103,43 +98,33 @@
=============================================================================
*/
- at protocol IFWebController <IFResourceProgressHandler, IFDownloadProgressHandler, IFScriptContextHandler>
+ at protocol IFWebController <IFResourceProgressHandler, IFDownloadProgressHandler, IFScriptContextHandler>
// Called when a data source needs to create a frame. This method encapsulates the
// specifics of creating and initializaing a view of the appropriate class.
- (IFWebFrame *)createFrameNamed: (NSString *)fname for: (IFWebDataSource *)child inParent: (IFWebDataSource *)parent inScrollView: (BOOL)inScrollView;
-
// Look for a frame named name, recursively.
- (IFWebFrame *)frameNamed: (NSString *)name;
-
// Return the top level frame. Note that even document that are not framesets will have a
// mainFrame.
- (IFWebFrame *)mainFrame;
-
// Return the frame associated with the data source. Traverses the
// frame tree to find the data source.
- (IFWebFrame *)frameForDataSource: (IFWebDataSource *)dataSource;
-
// Return the frame associated with the view. Traverses the
// frame tree to find the data source. Typically aView is
// an IFWebView.
- (IFWebFrame *)frameForView: (NSView *)aView;
-
- (id <IFLocationChangeHandler>)provideLocationChangeHandlerForFrame: (IFWebFrame *)frame;
-
// FIXME: this method should be moved to a protocol
// Called when a plug-in for a certain mime type is not installed
- (void)pluginNotFoundForMIMEType:(NSString *)mime pluginPageURL:(NSURL *)url;
-
@end
-
-
-
diff --git a/WebKit/WebView.subproj/IFWebDataSource.h b/WebKit/WebView.subproj/IFWebDataSource.h
index 393329a..1a87b0b 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.h
+++ b/WebKit/WebView.subproj/IFWebDataSource.h
@@ -4,10 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebController.h>
-#import <WebKit/IFWebFrame.h>
+#import <Cocoa/Cocoa.h>
/*
=============================================================================
@@ -16,19 +14,21 @@
============================================================================= */
+ at class IFWebFrame;
+ at protocol IFWebController;
+
#ifdef TENTATIVE_API
@class IFLoader;
#endif
-
+ at class IFWebDataSourcePrivate;
@interface IFWebDataSource : NSObject
{
@private
- id _dataSourcePrivate;
+ IFWebDataSourcePrivate *_dataSourcePrivate;
}
-
// Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
- initWithURL: (NSURL *)inputURL;
@@ -42,31 +42,22 @@
// document, typically either a frameset or a normal HTML document.
- (BOOL)isMainDocument;
-
// Returns nil if this data source represents the main document. Otherwise
// returns the parent data source.
- (IFWebDataSource *)parent;
-
-// Set the frame that represents this data source.
-//- (void)setFrame: (IFWebFrame *)f;
-
-
// Return the frame that represents this data source.
- (IFWebFrame *)frame;
-
// Add a child frame. This should only be called by the data source's controller
// as a result of a createFrame:inParent:.
// [Should this be private?]
- (void)addFrame: (IFWebFrame *)frame;
-
// Returns an array of IFWebFrame. The frames in the array are
// associated with a frame set or iframe.
- (NSArray *)children;
-
- (IFWebFrame *)frameNamed: (NSString *)frameName;
// Returns an array of NSStrings or nil. The NSStrings corresponds to
@@ -78,14 +69,10 @@
// the frame named 'name', or nil.
- (IFWebDataSource *) findDataSourceForFrameNamed: (NSString *)name;
-
- (BOOL)frameExists: (NSString *)name;
-
- (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName;
-
-
// Set the controller for this data source. NOTE: The controller is not retained by the
// data source. Perhaps setController: should be private? Perhaps the back pointers
// can be managed externally, i.e. + controllerForDataSource: as a class method on
@@ -93,11 +80,9 @@
//- (void)setController: (id <IFWebController>)controller;
- (id <IFWebController>)controller;
-
// May return nil if not initialized with a URL.
- (NSURL *)inputURL;
-
// redirectedURL returns the URL that was actually used if there was a redirect.
// The value of redirectedURL will change if more than one redirect occurs. If no
// redirect occurs the value of redirectedURL will be nil. To monitor change in
@@ -105,7 +90,6 @@
// serverRedirectTo:forDataSource: method.
- (NSURL *)redirectedURL;
-
// Returns true if the inputURL has been redirected by the server,
// i.e. inputURL != finalURL.
- (BOOL)wasRedirected;
@@ -115,17 +99,14 @@
// If forceRefresh is YES the document will load from the net, not the cache.
- (void)startLoading: (BOOL)forceRefresh;
-
// Cancels any pending loads. A data source is conceptually only ever loading
// one document at a time, although one document may have many related
// resources. stopLoading will stop all loads related to the data source.
- (void)stopLoading;
-
// Returns YES if there are any pending loads.
- (BOOL)isLoading;
-
#ifdef TENTATIVE_API
// Get DOM access to the document.
- (IFDOMDocument *)document;
@@ -134,39 +115,30 @@
// Get the source of the document by reconstructing it from the DOM.
- (NSString *)documentTextFromDOM;
-
// Get the actual source of the document.
- (NSString *)documentText;
-
// URL reference point, these should probably not be public for 1.0.
- (NSURL *)base;
- (NSString *)baseTarget;
-
- (NSString *)encoding;
-
// Style sheet
- (void)setUserStyleSheetFromURL: (NSURL *)url;
- (void)setUserStyleSheetFromString: (NSString *)sheet;
-
// a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
// This method may be moved to a category to prevent unnecessary linkage to the AppKit. Note, however
// that WebCore also has dependencies on the appkit.
- (NSImage *)icon;
-
// Is page secure, e.g. https, ftps
- (BOOL)isPageSecure;
-
// Returns nil or the page title.
- (NSString *)pageTitle;
- (NSString *)frameName;
@end
-
-
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 5d8b4ba..36d5be6 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -6,10 +6,13 @@
#import <WebKit/IFWebDataSourcePrivate.h>
#import <WebKit/IFException.h>
#import <WebKit/WebKitDebug.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebFrame.h>
-#include <xml/dom_docimpl.h>
+#import <xml/dom_docimpl.h>
+#import <khtml_part.h>
-#include <WCWebDataSource.h>
+#import <WCWebDataSource.h>
@interface _IFDataSourceHolder : NSObject
{
@@ -49,7 +52,7 @@ static id IFWebDataSourceMake(void *url)
- (void)_commonInitialization
{
- ((IFWebDataSourcePrivate *)_dataSourcePrivate) = [[IFWebDataSourcePrivate alloc] init];
+ _dataSourcePrivate = [[IFWebDataSourcePrivate alloc] init];
}
// Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
@@ -57,7 +60,7 @@ static id IFWebDataSourceMake(void *url)
{
[super init];
[self _commonInitialization];
- ((IFWebDataSourcePrivate *)_dataSourcePrivate)->inputURL = [inputURL retain];
+ _dataSourcePrivate->inputURL = [inputURL retain];
return self;
}
@@ -85,11 +88,9 @@ static id IFWebDataSourceMake(void *url)
- (IFWebFrame *)frame
{
- IFWebDataSourcePrivate *data = (IFWebDataSourcePrivate *)_dataSourcePrivate;
- return [data->controller frameForDataSource: self];
+ return [_dataSourcePrivate->controller frameForDataSource: self];
}
-
// Returns the name of the frame containing this data source, or nil
// if the data source is not in a frame set.
- (NSString *)frameName
@@ -97,22 +98,20 @@ static id IFWebDataSourceMake(void *url)
return [[self frame] name];
}
-
// Returns YES if this is the main document. The main document is the 'top'
// document, typically either a frameset or a normal HTML document.
- (BOOL)isMainDocument
{
- if (((IFWebDataSourcePrivate *)_dataSourcePrivate)->parent == nil)
+ if (_dataSourcePrivate->parent == nil)
return YES;
return NO;
}
-
// Returns nil if this data source represents the main document. Otherwise
// returns the parent data source.
- (IFWebDataSource *)parent
{
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->parent;
+ return _dataSourcePrivate->parent;
}
@@ -120,7 +119,7 @@ static id IFWebDataSourceMake(void *url)
// associated with a frame set or iframe.
- (NSArray *)children
{
- return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->frames allValues];
+ return [_dataSourcePrivate->frames allValues];
}
- (void)addFrame: (IFWebFrame *)frame
@@ -148,7 +147,7 @@ static id IFWebDataSourceMake(void *url)
// frames then frameNames will return nil.
- (NSArray *)frameNames
{
- return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->frames allKeys];
+ return [_dataSourcePrivate->frames allKeys];
}
@@ -177,16 +176,16 @@ static id IFWebDataSourceMake(void *url)
// All data sources used in a document share the same
// controller. A single document may have many datasource corresponding to
// frame or iframes.
- if (((IFWebDataSourcePrivate *)_dataSourcePrivate)->parent != nil)
- return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->parent controller];
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->controller;
+ if (_dataSourcePrivate->parent != nil)
+ return [_dataSourcePrivate->parent controller];
+ return _dataSourcePrivate->controller;
}
// May return nil if not initialized with a URL.
- (NSURL *)inputURL
{
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->inputURL;
+ return _dataSourcePrivate->inputURL;
}
@@ -196,7 +195,7 @@ static id IFWebDataSourceMake(void *url)
// a redirect is processed
- (NSURL *)redirectedURL
{
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->finalURL;
+ return _dataSourcePrivate->finalURL;
}
@@ -204,7 +203,7 @@ static id IFWebDataSourceMake(void *url)
// i.e. inputURL != redirectedURL.
- (BOOL)wasRedirected
{
- return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->inputURL isEqual: [self redirectedURL]];
+ return [_dataSourcePrivate->inputURL isEqual: [self redirectedURL]];
}
@@ -312,20 +311,17 @@ static id IFWebDataSourceMake(void *url)
return nil;
}
-
// Style sheet
- (void)setUserStyleSheetFromURL: (NSURL *)url
{
[NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::setUserStyleSheetFromURL: is not implemented"];
}
-
- (void)setUserStyleSheetFromString: (NSString *)sheet
{
[NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::setUserStyleSheetFromString: is not implemented"];
}
-
// a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
// This method may be moved to a category to prevent unnecessary linkage to the AppKit. Note, however
// that WebCore also has dependencies on the appkit.
@@ -335,7 +331,6 @@ static id IFWebDataSourceMake(void *url)
return nil;
}
-
// Is page secure, e.g. https, ftps
- (BOOL)isPageSecure
{
@@ -343,12 +338,10 @@ static id IFWebDataSourceMake(void *url)
return NO;
}
-
// Returns nil or the page title.
- (NSString *)pageTitle
{
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->pageTitle;
+ return _dataSourcePrivate->pageTitle;
}
-
@end
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
index b159b17..da18650 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
@@ -5,17 +5,14 @@
in WebCore. Instances of this class are referenced by _dataSourcePrivate in
NSWebPageDataSource.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebFoundation/WebFoundation.h>
-
-#import <WebKit/IFLocationChangeHandler.h>
#import <WebKit/IFWebDataSource.h>
-// includes from kde
-#include <khtmlview.h>
+class KHTMLPart;
+ at class IFURLHandle;
@class IFMainURLHandleClient;
+ at protocol IFLocationChangeHandler;
@interface IFWebDataSourcePrivate : NSObject
{
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
index 85fd22b..15d7a27 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
@@ -10,7 +10,9 @@
#import <WebKit/IFWebFramePrivate.h>
#import <WebKit/IFException.h>
#import <WebKit/WebKitDebug.h>
-
+#import <WebFoundation/IFURLHandle.h>
+#import <WebKit/IFLocationChangeHandler.h>
+#import <khtml_part.h>
@implementation IFWebDataSourcePrivate
diff --git a/WebKit/WebView.subproj/IFWebFrame.h b/WebKit/WebView.subproj/IFWebFrame.h
index 8f10444..9ca9b33 100644
--- a/WebKit/WebView.subproj/IFWebFrame.h
+++ b/WebKit/WebView.subproj/IFWebFrame.h
@@ -5,22 +5,24 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebController.h>
+#import <Foundation/Foundation.h>
+ at class IFError;
@class IFWebDataSource;
+ at protocol IFWebController;
+
+ at class IFWebFramePrivate;
@interface IFWebFrame : NSObject
{
@private
- id _framePrivate;
+ IFWebFramePrivate *_framePrivate;
}
- initWithName: (NSString *)name view: view provisionalDataSource: (IFWebDataSource *)dataSource controller: (id <IFWebController>)controller;
- (NSString *)name;
-
- (void)setController: (id <IFWebController>)controller;
- (id <IFWebController>)controller;
diff --git a/WebKit/WebView.subproj/IFWebFrame.mm b/WebKit/WebView.subproj/IFWebFrame.mm
index ae6d99a..8f71a6f 100644
--- a/WebKit/WebView.subproj/IFWebFrame.mm
+++ b/WebKit/WebView.subproj/IFWebFrame.mm
@@ -10,6 +10,8 @@
#import <WebKit/IFWebViewPrivate.h>
#import <WebKit/IFWebDataSourcePrivate.h>
#import <WebKit/IFBaseWebControllerPrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFLocationChangeHandler.h>
#import <WebKit/WebKitDebug.h>
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.h b/WebKit/WebView.subproj/IFWebFramePrivate.h
index feb8bd0..5f4fd25 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.h
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.h
@@ -5,10 +5,14 @@
Private header file.
*/
-#import <Cocoa/Cocoa.h>
#import <WebKit/IFWebFrame.h>
-#import <WebKit/IFWebDataSource.h>
+
+ at class IFWebView;
+
+namespace khtml {
+ class RenderPart;
+}
typedef enum {
IFWEBFRAMESTATE_UNINITIALIZED = 1,
@@ -29,10 +33,10 @@ typedef enum {
@interface IFWebFramePrivate : NSObject
{
NSString *name;
- id view;
+ IFWebView *view;
IFWebDataSource *dataSource;
IFWebDataSource *provisionalDataSource;
- void *renderFramePart;
+ khtml::RenderPart *renderFramePart;
id <IFWebController>controller;
IFWebFrameState state;
NSMutableDictionary *errors;
@@ -44,21 +48,21 @@ typedef enum {
- (NSString *)name;
- (void)setController: (id <IFWebController>)c;
- (id <IFWebController>)controller;
-- (void)setView: v;
-- view;
+- (void)setView: (IFWebView *)v;
+- (IFWebView *)view;
- (void)setDataSource: (IFWebDataSource *)d;
- (IFWebDataSource *)dataSource;
- (void)setProvisionalDataSource: (IFWebDataSource *)d;
- (IFWebDataSource *)provisionalDataSource;
-- (void)setRenderFramePart: (void *)p;
-- (void *)renderFramePart;
+- (void)setRenderFramePart: (khtml::RenderPart *)p;
+- (khtml::RenderPart *)renderFramePart;
@end
@interface IFWebFrame (IFPrivate)
- (void)_setController: (id <IFWebController>)controller;
-- (void)_setRenderFramePart: (void *)p;
-- (void *)_renderFramePart;
+- (void)_setRenderFramePart: (khtml::RenderPart *)p;
+- (khtml::RenderPart *)_renderFramePart;
- (void)_setDataSource: (IFWebDataSource *)d;
- (void)_transitionProvisionalToCommitted;
- (void)_transitionProvisionalToLayoutAcceptable;
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index b78a698..f40007e 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -8,6 +8,8 @@
#import <WebKit/IFWebViewPrivate.h>
#import <WebKit/IFWebFramePrivate.h>
#import <WebKit/IFPreferencesPrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFLocationChangeHandler.h>
#import <WebKit/WebKitDebug.h>
@@ -17,21 +19,31 @@
#include <khtmlview.h>
#include <rendering/render_frames.h>
+static const char * const stateNames[6] = {
+ "zero state",
+ "IFWEBFRAMESTATE_UNINITIALIZED",
+ "IFWEBFRAMESTATE_PROVISIONAL",
+ "IFWEBFRAMESTATE_COMMITTED_PAGE",
+ "IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE",
+ "IFWEBFRAMESTATE_COMPLETE"
+};
+
@implementation IFWebFramePrivate
- (void)dealloc
{
- [name autorelease];
[view _setController: nil];
- [view autorelease];
[dataSource _setController: nil];
- [dataSource autorelease];
[provisionalDataSource _setController: nil];
+
+ [name autorelease];
+ [view autorelease];
+ [dataSource autorelease];
[provisionalDataSource autorelease];
[errors release];
[mainDocumentError release];
if (renderFramePart)
- ((khtml::RenderPart *)renderFramePart)->deref();
+ renderFramePart->deref();
[super dealloc];
}
@@ -42,7 +54,6 @@
name = [n retain];
}
-
- view { return view; }
- (void)setView: v
{
@@ -53,101 +64,77 @@
- (IFWebDataSource *)dataSource { return dataSource; }
- (void)setDataSource: (IFWebDataSource *)d
{
- if (dataSource != d){
+ if (dataSource != d) {
[dataSource _setController: nil];
[dataSource autorelease];
dataSource = [d retain];
}
}
-
- (id <IFWebController>)controller { return controller; }
- (void)setController: (id <IFWebController>)c
{
- // Warning: non-retained reference
- controller = c;
+ controller = c; // not retained (yet)
}
-
- (IFWebDataSource *)provisionalDataSource { return provisionalDataSource; }
- (void)setProvisionalDataSource: (IFWebDataSource *)d
{
- if (provisionalDataSource != d){
+ if (provisionalDataSource != d) {
[provisionalDataSource autorelease];
provisionalDataSource = [d retain];
}
}
-
-- (void *)renderFramePart { return renderFramePart; }
-- (void)setRenderFramePart: (void *)p
+- (khtml::RenderPart *)renderFramePart { return renderFramePart; }
+- (void)setRenderFramePart: (khtml::RenderPart *)p
{
if (p)
- ((khtml::RenderPart *)p)->ref();
+ p->ref();
if (renderFramePart)
- ((khtml::RenderPart *)renderFramePart)->deref();
+ renderFramePart->deref();
renderFramePart = p;
}
-
@end
-
@implementation IFWebFrame (IFPrivate)
+
- (void)_setController: (id <IFWebController>)controller
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- [data setController: controller];
+ [_framePrivate setController: controller];
}
-
-// renderFramePart is a pointer to a RenderPart
-- (void)_setRenderFramePart: (void *)p
+- (void)_setRenderFramePart: (khtml::RenderPart *)p
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- [data setRenderFramePart: p];
+ [_framePrivate setRenderFramePart:p];
}
-- (void *)_renderFramePart
+- (khtml::RenderPart *)_renderFramePart
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- return [data renderFramePart];
+ return [_framePrivate renderFramePart];
}
- (void)_setDataSource: (IFWebDataSource *)ds
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- [data setDataSource: ds];
+ [_framePrivate setDataSource: ds];
[ds _setController: [self controller]];
}
-char *stateNames[6] = {
- "zero state",
- "IFWEBFRAMESTATE_UNINITIALIZED",
- "IFWEBFRAMESTATE_PROVISIONAL",
- "IFWEBFRAMESTATE_COMMITTED_PAGE",
- "IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE",
- "IFWEBFRAMESTATE_COMPLETE" };
-
-
- (void)_scheduleLayout: (NSTimeInterval)inSeconds
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- if (data->scheduledLayoutPending == NO){
+ if (_framePrivate->scheduledLayoutPending == NO) {
[NSTimer scheduledTimerWithTimeInterval:inSeconds target:self selector: @selector(_timedLayout:) userInfo: nil repeats:FALSE];
- data->scheduledLayoutPending = YES;
+ _framePrivate->scheduledLayoutPending = YES;
}
}
-- (void)_timedLayout: userInfo
+- (void)_timedLayout: (id)userInfo
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: state = %s\n", [[self name] cString], stateNames[data->state]);
+ WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: state = %s\n", [[self name] cString], stateNames[_framePrivate->state]);
- data->scheduledLayoutPending = NO;
- if (data->state == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE){
+ _framePrivate->scheduledLayoutPending = NO;
+ if (_framePrivate->state == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE) {
if ([self controller])
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: performing timed layout, %f seconds since start of document load\n", [[self name] cString], CFAbsoluteTimeGetCurrent() - [[[[self controller] mainFrame] dataSource] _loadingStartedTime]);
[[self view] setNeedsLayout: YES];
@@ -162,9 +149,7 @@ char *stateNames[6] = {
- (void)_transitionProvisionalToLayoutAcceptable
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- switch ([self _state]){
+ switch ([self _state]) {
case IFWEBFRAMESTATE_COMMITTED_PAGE:
{
[self _setState: IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE];
@@ -173,14 +158,14 @@ char *stateNames[6] = {
// X interval, even if the document and resources are not completely
// loaded.
BOOL timedDelayEnabled = [[IFPreferences standardPreferences] _initialTimedLayoutEnabled];
- if (timedDelayEnabled){
+ if (timedDelayEnabled) {
NSTimeInterval defaultTimedDelay = [[IFPreferences standardPreferences] _initialTimedLayoutDelay];
double timeSinceStart;
// If the delay getting to the commited state exceeds the initial layout delay, go
// ahead and schedule a layout.
timeSinceStart = (CFAbsoluteTimeGetCurrent() - [[self dataSource] _loadingStartedTime]);
- if (timeSinceStart > (double)defaultTimedDelay){
+ if (timeSinceStart > (double)defaultTimedDelay) {
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "performing early layout because commit time, %f, exceeded initial layout interval %f\n", timeSinceStart, defaultTimedDelay);
[self _timedLayout: nil];
}
@@ -204,7 +189,7 @@ char *stateNames[6] = {
case IFWEBFRAMESTATE_UNINITIALIZED:
default:
{
- [[NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE from %s", stateNames[data->state]] userInfo: nil] raise];
+ [[NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE from %s", stateNames[_framePrivate->state]] userInfo: nil] raise];
return;
}
}
@@ -213,11 +198,9 @@ char *stateNames[6] = {
- (void)_transitionProvisionalToCommitted
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
WEBKIT_ASSERT ([self controller] != nil);
- switch ([self _state]){
+ switch ([self _state]) {
case IFWEBFRAMESTATE_PROVISIONAL:
{
id view = [self view];
@@ -231,23 +214,23 @@ char *stateNames[6] = {
[view _removeSubviews];
// Set the committed data source on the frame.
- [self _setDataSource: data->provisionalDataSource];
+ [self _setDataSource: _framePrivate->provisionalDataSource];
// If we're a frame (not the main frame) hookup the kde internals. This introduces a nasty dependency
// in kde on the view.
khtml::RenderPart *renderPartFrame = [self _renderFramePart];
- if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")]){
+ if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")]) {
// Setting the widget will delete the previous KHTMLView associated with the frame.
renderPartFrame->setWidget ([view _provisionalWidget]);
}
// dataSourceChanged: will reset the view and begin trying to
// display the new new datasource.
- [view dataSourceChanged: data->provisionalDataSource];
+ [view dataSourceChanged: _framePrivate->provisionalDataSource];
// Now that the provisional data source is committed, release it.
- [data setProvisionalDataSource: nil];
+ [_framePrivate setProvisionalDataSource: nil];
[self _setState: IFWEBFRAMESTATE_COMMITTED_PAGE];
@@ -266,50 +249,42 @@ char *stateNames[6] = {
case IFWEBFRAMESTATE_COMPLETE:
default:
{
- [[NSException exceptionWithName:NSGenericException reason:[NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_COMMITTED from %s", stateNames[data->state]] userInfo: nil] raise];
+ [[NSException exceptionWithName:NSGenericException reason:[NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_COMMITTED from %s", stateNames[_framePrivate->state]] userInfo: nil] raise];
return;
}
}
}
-
- (IFWebFrameState)_state
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- return data->state;
+ return _framePrivate->state;
}
- (void)_setState: (IFWebFrameState)newState
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: transition from %s to %s\n", [[self name] cString], stateNames[data->state], stateNames[newState]);
+ WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: transition from %s to %s\n", [[self name] cString], stateNames[_framePrivate->state], stateNames[newState]);
if ([self controller])
- WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: transition from %s to %s, %f seconds since start of document load\n", [[self name] cString], stateNames[data->state], stateNames[newState], CFAbsoluteTimeGetCurrent() - [[[[self controller] mainFrame] dataSource] _loadingStartedTime]);
+ WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: transition from %s to %s, %f seconds since start of document load\n", [[self name] cString], stateNames[_framePrivate->state], stateNames[newState], CFAbsoluteTimeGetCurrent() - [[[[self controller] mainFrame] dataSource] _loadingStartedTime]);
if (newState == IFWEBFRAMESTATE_COMPLETE && self == [[self controller] mainFrame])
WEBKITDEBUGLEVEL (WEBKIT_LOG_DOCUMENTLOAD, "completed %s (%f seconds)", [[[[self dataSource] inputURL] absoluteString] cString], CFAbsoluteTimeGetCurrent() - [[self dataSource] _loadingStartedTime]);
- data->state = newState;
+ _framePrivate->state = newState;
}
- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- if (data->errors == 0)
- data->errors = [[NSMutableDictionary alloc] init];
+ if (_framePrivate->errors == 0)
+ _framePrivate->errors = [[NSMutableDictionary alloc] init];
- [data->errors setObject: error forKey: resourceDescription];
+ [_framePrivate->errors setObject: error forKey: resourceDescription];
}
- (void)_isLoadComplete
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
WEBKIT_ASSERT ([self controller] != nil);
- switch ([self _state]){
+ switch ([self _state]) {
// Shouldn't ever be in this state.
case IFWEBFRAMESTATE_UNINITIALIZED:
{
@@ -322,13 +297,13 @@ char *stateNames[6] = {
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete in IFWEBFRAMESTATE_PROVISIONAL\n", [[self name] cString]);
// If we've received any errors we may be stuck in the provisional state and actually
// complete.
- if ([[self errors] count] != 0){
+ if ([[self errors] count] != 0) {
// Check all children first.
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_PROVISIONAL, %d errors\n", [[self name] cString], [[self errors] count]);
- if (![[self provisionalDataSource] isLoading]){
+ if (![[self provisionalDataSource] isLoading]) {
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete in IFWEBFRAMESTATE_PROVISIONAL, load done\n", [[self name] cString]);
// We now the provisional data source didn't cut the mustard, release it.
- [data setProvisionalDataSource: nil];
+ [_framePrivate setProvisionalDataSource: nil];
[self _setState: IFWEBFRAMESTATE_COMPLETE];
[[[self provisionalDataSource] _locationChangeHandler] locationChangeDone: [self mainDocumentError]];
@@ -342,7 +317,7 @@ char *stateNames[6] = {
case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
{
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_COMMITTED\n", [[self name] cString]);
- if (![[self dataSource] isLoading]){
+ if (![[self dataSource] isLoading]) {
id mainView = [[[self controller] mainFrame] view];
id thisView = [self view];
@@ -366,7 +341,7 @@ char *stateNames[6] = {
[[thisView _frameScrollView] setNeedsDisplay: YES];
// Force a relayout and draw NOW if we are complete are the top level.
- if ([[self controller] mainFrame] == self){
+ if ([[self controller] mainFrame] == self) {
[mainView layout];
[mainView display];
}
@@ -381,9 +356,9 @@ char *stateNames[6] = {
// A resource was loaded, but the entire frame isn't complete. Schedule a
// layout.
else {
- if ([self _state] == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE){
+ if ([self _state] == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE) {
BOOL resourceTimedDelayEnabled = [[IFPreferences standardPreferences] _resourceTimedLayoutEnabled];
- if (resourceTimedDelayEnabled){
+ if (resourceTimedDelayEnabled) {
NSTimeInterval timedDelay = [[IFPreferences standardPreferences] _resourceTimedLayoutDelay];
[self _scheduleLayout: timedDelay];
}
@@ -414,7 +389,7 @@ char *stateNames[6] = {
childFrames = [[fromFrame dataSource] children];
count = [childFrames count];
- for (i = 0; i < count; i++){
+ for (i = 0; i < count; i++) {
IFWebFrame *childFrame;
childFrame = [childFrames objectAtIndex: i];
@@ -443,19 +418,17 @@ char *stateNames[6] = {
- (void)_setMainDocumentError: (IFError *)error
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- data->mainDocumentError = [error retain];
+ [error retain];
+ [_framePrivate->mainDocumentError release];
+ _framePrivate->mainDocumentError = error;
}
- (void)_clearErrors
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- [data->errors release];
- data->errors = nil;
- [data->mainDocumentError release];
- data->mainDocumentError = nil;
+ [_framePrivate->errors release];
+ _framePrivate->errors = nil;
+ [_framePrivate->mainDocumentError release];
+ _framePrivate->mainDocumentError = nil;
}
@end
-
diff --git a/WebKit/WebView.subproj/IFWebView.h b/WebKit/WebView.subproj/IFWebView.h
index 7686022..69b78e6 100644
--- a/WebKit/WebView.subproj/IFWebView.h
+++ b/WebKit/WebView.subproj/IFWebView.h
@@ -4,10 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebDataSource.h>
-#import <WebKit/IFWebController.h>
+#import <Cocoa/Cocoa.h>
/*
=============================================================================
@@ -40,7 +38,7 @@
Controllers should initiate progress indicators upon receipt of loadingStarted,
and terminate when either a loadingCancelled or loadingStopped is received.
- 2. After the controller receives it's first receivedDataForLocation: the contents of
+ 2. After the controller receives its first receivedDataForLocation: the contents of
the view will be cleared and layout may begin.
3. Upon subsequent receipt of receivedDataForLocation: messages the controller
@@ -73,43 +71,40 @@
the selected text.
*/
+
+ at class IFWebDataSource;
+ at protocol IFWebController;
+
+ at class IFWebViewPrivate;
+
@interface IFWebView : NSView
{
@private
- id _viewPrivate;
+ IFWebViewPrivate *_viewPrivate;
}
- initWithFrame: (NSRect)frame;
-
#ifdef TENTATIVE_API
// Set and get the delegate.
- (void)setDelegate: (id <IFWebViewDelegate>)delegate;
- (id <IFWebViewDelegate>)delegate;
#endif
-
-// Set and get the controller. Note that the controller is not retained.
-// Perhaps setController: should be private?
+// Note that the controller is not retained.
- (id <IFWebController>)controller;
-
-// This method is typically called by the view's controller when
+// These methods is typically called by the view's controller when
// the data source is changed.
- (void)dataSourceChanged: (IFWebDataSource *)dataSource;
-
-
- (void)provisionalDataSourceChanged: (IFWebDataSource *)dataSource;
-
- (void)setNeedsLayout: (bool)flag;
-
// This method should not be public until we have a more completely
// understood way to subclass IFWebView.
- (void)layout;
-
// Set needsToApplyStyles if you change anything that might impact styles, like
// font preferences.
- (void)setNeedsToApplyStyles: (bool)flag;
@@ -118,18 +113,15 @@
// instead call setNeedsToApplyStyles:.
- (void)reapplyStyles;
-
// Stop animating animated GIFs, etc.
- (void)stopAnimations;
-
// Drag and drop links and images. Others?
- (void)setCanDragFrom: (BOOL)flag;
- (BOOL)canDragFrom;
- (void)setCanDragTo: (BOOL)flag;
- (BOOL)canDragTo;
-
// Returns an array of built-in context menu items for this node.
// Generally called by IFContextMenuHandlers from contextMenuItemsForNode:
#ifdef TENTATIVE_API
@@ -138,23 +130,18 @@
- (void)setContextMenusEnabled: (BOOL)flag;
- (BOOL)contextMenusEnabled;
-
// Remove the selection.
- (void)deselectText;
-
// Search from the end of the currently selected location, or from the beginning of the document if nothing
// is selected.
- (void)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag;
-
// Get an attributed string that represents the current selection.
- (NSAttributedString *)selectedText;
@end
-
-
/*
Areas still to consider:
@@ -171,5 +158,3 @@
subclassing of IFWebView
*/
-
-
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index df95653..4458055 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -26,8 +26,8 @@
_viewPrivate = [[IFWebViewPrivate alloc] init];
- ((IFWebViewPrivate *)_viewPrivate)->isFlipped = YES;
- ((IFWebViewPrivate *)_viewPrivate)->needsLayout = YES;
+ _viewPrivate->isFlipped = YES;
+ _viewPrivate->needsLayout = YES;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
@@ -44,11 +44,10 @@
}
-// Set and get the controller. Note that the controller is not retained.
-// Perhaps setController: should be private?
+// Note that the controller is not retained.
- (id <IFWebController>)controller
{
- return ((IFWebViewPrivate *)_viewPrivate)->controller;
+ return _viewPrivate->controller;
}
@@ -70,7 +69,6 @@
// the data source is changed.
- (void)provisionalDataSourceChanged: (IFWebDataSource *)dataSource
{
- IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
NSRect r = [self frame];
IFWebView *provisionalView;
@@ -78,21 +76,21 @@
// the KHTMLPart.
KHTMLPart *part = [dataSource _part];
- data->provisionalWidget = new KHTMLView (part, 0);
- part->setView (data->provisionalWidget);
+ _viewPrivate->provisionalWidget = new KHTMLView (part, 0);
+ part->setView (_viewPrivate->provisionalWidget);
// Create a temporary provisional view. It will be replaced with
// the actual view once the datasource has been committed.
provisionalView = [[IFWebView alloc] initWithFrame: NSMakeRect (0,0,0,0)];
- data->provisionalWidget->setView (provisionalView);
+ _viewPrivate->provisionalWidget->setView (provisionalView);
[provisionalView release];
- data->provisionalWidget->resize (r.size.width,r.size.height);
+ _viewPrivate->provisionalWidget->resize (r.size.width,r.size.height);
}
- (void)dataSourceChanged: (IFWebDataSource *)dataSource
{
- IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
+ IFWebViewPrivate *data = _viewPrivate;
// Setup the real view.
if ([self _frameScrollView])
@@ -112,16 +110,16 @@
- (void)reapplyStyles
{
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
+ KHTMLView *widget = _viewPrivate->widget;
if (widget->part()->xmlDocImpl() &&
widget->part()->xmlDocImpl()->renderer()){
- if (((IFWebViewPrivate *)_viewPrivate)->needsToApplyStyles){
+ if (_viewPrivate->needsToApplyStyles){
#ifdef _KWQ_TIMING
double start = CFAbsoluteTimeGetCurrent();
#endif
widget->part()->xmlDocImpl()->updateStyleSelector();
- ((IFWebViewPrivate *)_viewPrivate)->needsToApplyStyles = NO;
+ _viewPrivate->needsToApplyStyles = NO;
#ifdef _KWQ_TIMING
double thisTime = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s apply style seconds = %f\n", widget->part()->baseURL().url().latin1(), thisTime);
@@ -137,11 +135,11 @@
// understood how IFWebView will be subclassed.
- (void)layout
{
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
+ KHTMLView *widget = _viewPrivate->widget;
if (widget->part()->xmlDocImpl() &&
widget->part()->xmlDocImpl()->renderer()){
- if (((IFWebViewPrivate *)_viewPrivate)->needsLayout){
+ if (_viewPrivate->needsLayout){
#ifdef _KWQ_TIMING
double start = CFAbsoluteTimeGetCurrent();
#endif
@@ -150,7 +148,7 @@
//double start = CFAbsoluteTimeGetCurrent();
widget->layout();
//WebKitDebugAtLevel (WEBKIT_LOG_TIMING, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
- ((IFWebViewPrivate *)_viewPrivate)->needsLayout = NO;
+ _viewPrivate->needsLayout = NO;
#ifdef _KWQ_TIMING
double thisTime = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s layout seconds = %f\n", widget->part()->baseURL().url().latin1(), thisTime);
@@ -278,21 +276,21 @@
- (void)setNeedsLayout: (bool)flag
{
WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "flag = %d\n", (int)flag);
- ((IFWebViewPrivate *)_viewPrivate)->needsLayout = flag;
+ _viewPrivate->needsLayout = flag;
}
- (void)setNeedsToApplyStyles: (bool)flag
{
WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "flag = %d\n", (int)flag);
- ((IFWebViewPrivate *)_viewPrivate)->needsToApplyStyles = flag;
+ _viewPrivate->needsToApplyStyles = flag;
}
// This should eventually be removed.
- (void)drawRect:(NSRect)rect {
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
- //IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
+ KHTMLView *widget = _viewPrivate->widget;
+ //IFWebViewPrivate *data = _viewPrivate;
//if (data->provisionalWidget != 0){
// WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "not drawing, frame in provisional state.\n");
@@ -357,13 +355,13 @@
- (void)setIsFlipped: (bool)flag
{
- ((IFWebViewPrivate *)_viewPrivate)->isFlipped = flag;
+ _viewPrivate->isFlipped = flag;
}
- (BOOL)isFlipped
{
- return ((IFWebViewPrivate *)_viewPrivate)->isFlipped;
+ return _viewPrivate->isFlipped;
}
@@ -398,7 +396,7 @@
NSPoint p = [event locationInWindow];
QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
+ KHTMLView *widget = _viewPrivate->widget;
if (widget != 0l) {
widget->viewportMouseReleaseEvent(kEvent);
}
@@ -427,7 +425,7 @@
NSPoint p = [event locationInWindow];
QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
+ KHTMLView *widget = _viewPrivate->widget;
if (widget != 0l) {
widget->viewportMousePressEvent(kEvent);
}
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.h b/WebKit/WebView.subproj/IFWebViewPrivate.h
index bcdf956..b4cdb93 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.h
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.h
@@ -5,10 +5,7 @@
in WebCore. Instances of this class are referenced by _viewPrivate in
NSWebPageView.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebController.h>
-#import <WebKit/IFDynamicScrollBarsView.h>
#import <WebKit/IFWebView.h>
class QWidget;
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.mm b/WebKit/WebView.subproj/IFWebViewPrivate.mm
index affc552..41e4e03 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.mm
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.mm
@@ -11,27 +11,14 @@
#import <WebKit/IFPluginView.h>
// Includes from KDE
-#include <khtmlview.h>
-#include <html/html_documentimpl.h>
+#import <khtmlview.h>
+#import <html/html_documentimpl.h>
@implementation IFWebViewPrivate
-- init
-{
- [super init];
-
- controller = nil;
- widget = 0;
-
- return self;
-}
-
-
- (void)dealloc
{
- // controller is not retained! IFWebControllers maintain
- // a reference to their view and main data source.
-
+ [controller release];
[frameScrollView release];
//if (widget)
@@ -40,68 +27,49 @@
[super dealloc];
}
-
-
@end
-
@implementation IFWebView (IFPrivate)
- (void)_resetWidget
{
- if (((IFWebViewPrivate *)_viewPrivate)->widget)
- delete ((IFWebViewPrivate *)_viewPrivate)->widget;
- ((IFWebViewPrivate *)_viewPrivate)->widget = 0;
+ delete _viewPrivate->widget;
+ _viewPrivate->widget = 0;
}
- (void)_stopPlugins
{
NSArray *views = [self subviews];
- int count;
-
- count = [views count];
- while (count--){
- id view;
-
- view = [views objectAtIndex: count];
+ int count = [views count];
+ while (count--) {
+ id view = [views objectAtIndex: count];
if ([view isKindOfClass: NSClassFromString (@"IFPluginView")])
[(IFPluginView *)view stop];
}
}
-
- (void)_removeSubviews
{
- // Remove all the views. They will be be re-added if this
- // is a re-layout.
- NSArray *views = [self subviews];
- int count;
-
- count = [views count];
- while (count--){
- id view;
- view = [views objectAtIndex: count];
- [view removeFromSuperviewWithoutNeedingDisplay];
- }
+ // Remove all the views. They will be be re-added if this is a re-layout.
+ [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperviewWithoutNeedingDisplay)];
}
-
-
- (void)_setController: (id <IFWebController>)controller
{
- // Not retained.
- ((IFWebViewPrivate *)_viewPrivate)->controller = controller;
+ [controller retain];
+ [_viewPrivate->controller release];
+ _viewPrivate->controller = controller;
}
- (KHTMLView *)_widget
{
- return ((IFWebViewPrivate *)_viewPrivate)->widget;
+ return _viewPrivate->widget;
}
- (DOM::DocumentImpl *)_document
{
- KHTMLPart *part = ((IFWebViewPrivate *)_viewPrivate)->widget->part();
- if (part){
+ KHTMLPart *part = _viewPrivate->widget->part();
+ if (part) {
return part->xmlDocImpl();
}
return 0;
@@ -109,12 +77,14 @@
+ (NSString *)_nodeName: (DOM::NodeImpl *)node
{
- return [NSString stringWithCString: node->nodeName().string().latin1()];
+ // FIXME: good for debugging only since it's Latin 1 only
+ return [NSString stringWithCString:node->nodeName().string().latin1()];
}
+ (NSString *)_nodeValue: (DOM::NodeImpl *)node
{
- return [NSString stringWithCString: node->nodeValue().string().latin1()];
+ // FIXME: good for debugging only since it's Latin 1 only
+ return [NSString stringWithCString:node->nodeValue().string().latin1()];
}
+ (NSString *)_nodeHTML: (DOM::NodeImpl *)node
@@ -124,9 +94,9 @@
- (khtml::RenderObject *)_renderRoot
{
- KHTMLPart *part = ((IFWebViewPrivate *)_viewPrivate)->widget->part();
+ KHTMLPart *part = _viewPrivate->widget->part();
DOM::DocumentImpl *doc;
- if (part){
+ if (part) {
doc = part->xmlDocImpl();
if (doc)
return doc->renderer();
@@ -134,16 +104,16 @@
return 0;
}
-
- (KHTMLView *)_provisionalWidget
{
- return ((IFWebViewPrivate *)_viewPrivate)->provisionalWidget;
+ return _viewPrivate->provisionalWidget;
}
-
- (void)_setFrameScrollView: (NSScrollView *)sv
{
- ((IFWebViewPrivate *)_viewPrivate)->frameScrollView = [sv retain];
+ [sv retain];
+ [_viewPrivate->frameScrollView release];
+ _viewPrivate->frameScrollView = sv;
//[sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
//[sv setHasVerticalScroller: YES];
//[sv setHasHorizontalScroller: YES];
@@ -153,7 +123,7 @@
- (NSScrollView *)_frameScrollView
{
- return ((IFWebViewPrivate *)_viewPrivate)->frameScrollView;
+ return _viewPrivate->frameScrollView;
}
- (void)_setupScrollers
@@ -161,7 +131,7 @@
BOOL scrollsVertically;
BOOL scrollsHorizontally;
- if ([self _frameScrollView]){
+ if ([self _frameScrollView]) {
scrollsVertically = [self bounds].size.height > [[self _frameScrollView] frame].size.height;
scrollsHorizontally = [self bounds].size.width > [[self _frameScrollView] frame].size.width;
@@ -170,6 +140,4 @@
}
}
-
-
@end
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index c17f717..7ddcc48 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -4,11 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFLoadProgress.h>
-#import <WebKit/IFLocationChangeHandler.h>
-#import <WebKit/IFDownloadHandler.h>
+#import <Cocoa/Cocoa.h>
/*
=============================================================================
@@ -28,11 +25,13 @@
=============================================================================
*/
-
- at class IFWebDataSource;
+ at class IFDownloadHandler;
@class IFError;
+ at class IFLoadProgress;
+ at class IFWebDataSource;
@class IFWebFrame;
+ at protocol IFLocationChangeHandler;
/*
=============================================================================
@@ -45,6 +44,7 @@
=============================================================================
*/
+
@protocol IFResourceProgressHandler
/*
@@ -59,8 +59,8 @@
@end
-
@protocol IFDownloadProgressHandler
+
// Called when progress of a download has been made
- (void) receivedProgress:(IFLoadProgress *)progress forDownloadHandler:(IFDownloadHandler *)downloadHandler;
@@ -69,7 +69,6 @@
@end
-
/*
=============================================================================
@@ -90,10 +89,6 @@
@end
-
-
-
-
/*
=============================================================================
@@ -103,43 +98,33 @@
=============================================================================
*/
- at protocol IFWebController <IFResourceProgressHandler, IFDownloadProgressHandler, IFScriptContextHandler>
+ at protocol IFWebController <IFResourceProgressHandler, IFDownloadProgressHandler, IFScriptContextHandler>
// Called when a data source needs to create a frame. This method encapsulates the
// specifics of creating and initializaing a view of the appropriate class.
- (IFWebFrame *)createFrameNamed: (NSString *)fname for: (IFWebDataSource *)child inParent: (IFWebDataSource *)parent inScrollView: (BOOL)inScrollView;
-
// Look for a frame named name, recursively.
- (IFWebFrame *)frameNamed: (NSString *)name;
-
// Return the top level frame. Note that even document that are not framesets will have a
// mainFrame.
- (IFWebFrame *)mainFrame;
-
// Return the frame associated with the data source. Traverses the
// frame tree to find the data source.
- (IFWebFrame *)frameForDataSource: (IFWebDataSource *)dataSource;
-
// Return the frame associated with the view. Traverses the
// frame tree to find the data source. Typically aView is
// an IFWebView.
- (IFWebFrame *)frameForView: (NSView *)aView;
-
- (id <IFLocationChangeHandler>)provideLocationChangeHandlerForFrame: (IFWebFrame *)frame;
-
// FIXME: this method should be moved to a protocol
// Called when a plug-in for a certain mime type is not installed
- (void)pluginNotFoundForMIMEType:(NSString *)mime pluginPageURL:(NSURL *)url;
-
@end
-
-
-
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 393329a..1a87b0b 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -4,10 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebController.h>
-#import <WebKit/IFWebFrame.h>
+#import <Cocoa/Cocoa.h>
/*
=============================================================================
@@ -16,19 +14,21 @@
============================================================================= */
+ at class IFWebFrame;
+ at protocol IFWebController;
+
#ifdef TENTATIVE_API
@class IFLoader;
#endif
-
+ at class IFWebDataSourcePrivate;
@interface IFWebDataSource : NSObject
{
@private
- id _dataSourcePrivate;
+ IFWebDataSourcePrivate *_dataSourcePrivate;
}
-
// Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
- initWithURL: (NSURL *)inputURL;
@@ -42,31 +42,22 @@
// document, typically either a frameset or a normal HTML document.
- (BOOL)isMainDocument;
-
// Returns nil if this data source represents the main document. Otherwise
// returns the parent data source.
- (IFWebDataSource *)parent;
-
-// Set the frame that represents this data source.
-//- (void)setFrame: (IFWebFrame *)f;
-
-
// Return the frame that represents this data source.
- (IFWebFrame *)frame;
-
// Add a child frame. This should only be called by the data source's controller
// as a result of a createFrame:inParent:.
// [Should this be private?]
- (void)addFrame: (IFWebFrame *)frame;
-
// Returns an array of IFWebFrame. The frames in the array are
// associated with a frame set or iframe.
- (NSArray *)children;
-
- (IFWebFrame *)frameNamed: (NSString *)frameName;
// Returns an array of NSStrings or nil. The NSStrings corresponds to
@@ -78,14 +69,10 @@
// the frame named 'name', or nil.
- (IFWebDataSource *) findDataSourceForFrameNamed: (NSString *)name;
-
- (BOOL)frameExists: (NSString *)name;
-
- (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName;
-
-
// Set the controller for this data source. NOTE: The controller is not retained by the
// data source. Perhaps setController: should be private? Perhaps the back pointers
// can be managed externally, i.e. + controllerForDataSource: as a class method on
@@ -93,11 +80,9 @@
//- (void)setController: (id <IFWebController>)controller;
- (id <IFWebController>)controller;
-
// May return nil if not initialized with a URL.
- (NSURL *)inputURL;
-
// redirectedURL returns the URL that was actually used if there was a redirect.
// The value of redirectedURL will change if more than one redirect occurs. If no
// redirect occurs the value of redirectedURL will be nil. To monitor change in
@@ -105,7 +90,6 @@
// serverRedirectTo:forDataSource: method.
- (NSURL *)redirectedURL;
-
// Returns true if the inputURL has been redirected by the server,
// i.e. inputURL != finalURL.
- (BOOL)wasRedirected;
@@ -115,17 +99,14 @@
// If forceRefresh is YES the document will load from the net, not the cache.
- (void)startLoading: (BOOL)forceRefresh;
-
// Cancels any pending loads. A data source is conceptually only ever loading
// one document at a time, although one document may have many related
// resources. stopLoading will stop all loads related to the data source.
- (void)stopLoading;
-
// Returns YES if there are any pending loads.
- (BOOL)isLoading;
-
#ifdef TENTATIVE_API
// Get DOM access to the document.
- (IFDOMDocument *)document;
@@ -134,39 +115,30 @@
// Get the source of the document by reconstructing it from the DOM.
- (NSString *)documentTextFromDOM;
-
// Get the actual source of the document.
- (NSString *)documentText;
-
// URL reference point, these should probably not be public for 1.0.
- (NSURL *)base;
- (NSString *)baseTarget;
-
- (NSString *)encoding;
-
// Style sheet
- (void)setUserStyleSheetFromURL: (NSURL *)url;
- (void)setUserStyleSheetFromString: (NSString *)sheet;
-
// a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
// This method may be moved to a category to prevent unnecessary linkage to the AppKit. Note, however
// that WebCore also has dependencies on the appkit.
- (NSImage *)icon;
-
// Is page secure, e.g. https, ftps
- (BOOL)isPageSecure;
-
// Returns nil or the page title.
- (NSString *)pageTitle;
- (NSString *)frameName;
@end
-
-
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 5d8b4ba..36d5be6 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -6,10 +6,13 @@
#import <WebKit/IFWebDataSourcePrivate.h>
#import <WebKit/IFException.h>
#import <WebKit/WebKitDebug.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFWebFrame.h>
-#include <xml/dom_docimpl.h>
+#import <xml/dom_docimpl.h>
+#import <khtml_part.h>
-#include <WCWebDataSource.h>
+#import <WCWebDataSource.h>
@interface _IFDataSourceHolder : NSObject
{
@@ -49,7 +52,7 @@ static id IFWebDataSourceMake(void *url)
- (void)_commonInitialization
{
- ((IFWebDataSourcePrivate *)_dataSourcePrivate) = [[IFWebDataSourcePrivate alloc] init];
+ _dataSourcePrivate = [[IFWebDataSourcePrivate alloc] init];
}
// Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
@@ -57,7 +60,7 @@ static id IFWebDataSourceMake(void *url)
{
[super init];
[self _commonInitialization];
- ((IFWebDataSourcePrivate *)_dataSourcePrivate)->inputURL = [inputURL retain];
+ _dataSourcePrivate->inputURL = [inputURL retain];
return self;
}
@@ -85,11 +88,9 @@ static id IFWebDataSourceMake(void *url)
- (IFWebFrame *)frame
{
- IFWebDataSourcePrivate *data = (IFWebDataSourcePrivate *)_dataSourcePrivate;
- return [data->controller frameForDataSource: self];
+ return [_dataSourcePrivate->controller frameForDataSource: self];
}
-
// Returns the name of the frame containing this data source, or nil
// if the data source is not in a frame set.
- (NSString *)frameName
@@ -97,22 +98,20 @@ static id IFWebDataSourceMake(void *url)
return [[self frame] name];
}
-
// Returns YES if this is the main document. The main document is the 'top'
// document, typically either a frameset or a normal HTML document.
- (BOOL)isMainDocument
{
- if (((IFWebDataSourcePrivate *)_dataSourcePrivate)->parent == nil)
+ if (_dataSourcePrivate->parent == nil)
return YES;
return NO;
}
-
// Returns nil if this data source represents the main document. Otherwise
// returns the parent data source.
- (IFWebDataSource *)parent
{
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->parent;
+ return _dataSourcePrivate->parent;
}
@@ -120,7 +119,7 @@ static id IFWebDataSourceMake(void *url)
// associated with a frame set or iframe.
- (NSArray *)children
{
- return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->frames allValues];
+ return [_dataSourcePrivate->frames allValues];
}
- (void)addFrame: (IFWebFrame *)frame
@@ -148,7 +147,7 @@ static id IFWebDataSourceMake(void *url)
// frames then frameNames will return nil.
- (NSArray *)frameNames
{
- return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->frames allKeys];
+ return [_dataSourcePrivate->frames allKeys];
}
@@ -177,16 +176,16 @@ static id IFWebDataSourceMake(void *url)
// All data sources used in a document share the same
// controller. A single document may have many datasource corresponding to
// frame or iframes.
- if (((IFWebDataSourcePrivate *)_dataSourcePrivate)->parent != nil)
- return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->parent controller];
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->controller;
+ if (_dataSourcePrivate->parent != nil)
+ return [_dataSourcePrivate->parent controller];
+ return _dataSourcePrivate->controller;
}
// May return nil if not initialized with a URL.
- (NSURL *)inputURL
{
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->inputURL;
+ return _dataSourcePrivate->inputURL;
}
@@ -196,7 +195,7 @@ static id IFWebDataSourceMake(void *url)
// a redirect is processed
- (NSURL *)redirectedURL
{
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->finalURL;
+ return _dataSourcePrivate->finalURL;
}
@@ -204,7 +203,7 @@ static id IFWebDataSourceMake(void *url)
// i.e. inputURL != redirectedURL.
- (BOOL)wasRedirected
{
- return [((IFWebDataSourcePrivate *)_dataSourcePrivate)->inputURL isEqual: [self redirectedURL]];
+ return [_dataSourcePrivate->inputURL isEqual: [self redirectedURL]];
}
@@ -312,20 +311,17 @@ static id IFWebDataSourceMake(void *url)
return nil;
}
-
// Style sheet
- (void)setUserStyleSheetFromURL: (NSURL *)url
{
[NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::setUserStyleSheetFromURL: is not implemented"];
}
-
- (void)setUserStyleSheetFromString: (NSString *)sheet
{
[NSException raise:IFMethodNotYetImplemented format:@"IFWebDataSource::setUserStyleSheetFromString: is not implemented"];
}
-
// a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
// This method may be moved to a category to prevent unnecessary linkage to the AppKit. Note, however
// that WebCore also has dependencies on the appkit.
@@ -335,7 +331,6 @@ static id IFWebDataSourceMake(void *url)
return nil;
}
-
// Is page secure, e.g. https, ftps
- (BOOL)isPageSecure
{
@@ -343,12 +338,10 @@ static id IFWebDataSourceMake(void *url)
return NO;
}
-
// Returns nil or the page title.
- (NSString *)pageTitle
{
- return ((IFWebDataSourcePrivate *)_dataSourcePrivate)->pageTitle;
+ return _dataSourcePrivate->pageTitle;
}
-
@end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index b159b17..da18650 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -5,17 +5,14 @@
in WebCore. Instances of this class are referenced by _dataSourcePrivate in
NSWebPageDataSource.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebFoundation/WebFoundation.h>
-
-#import <WebKit/IFLocationChangeHandler.h>
#import <WebKit/IFWebDataSource.h>
-// includes from kde
-#include <khtmlview.h>
+class KHTMLPart;
+ at class IFURLHandle;
@class IFMainURLHandleClient;
+ at protocol IFLocationChangeHandler;
@interface IFWebDataSourcePrivate : NSObject
{
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 85fd22b..15d7a27 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -10,7 +10,9 @@
#import <WebKit/IFWebFramePrivate.h>
#import <WebKit/IFException.h>
#import <WebKit/WebKitDebug.h>
-
+#import <WebFoundation/IFURLHandle.h>
+#import <WebKit/IFLocationChangeHandler.h>
+#import <khtml_part.h>
@implementation IFWebDataSourcePrivate
diff --git a/WebKit/WebView.subproj/WebFrame.h b/WebKit/WebView.subproj/WebFrame.h
index 8f10444..9ca9b33 100644
--- a/WebKit/WebView.subproj/WebFrame.h
+++ b/WebKit/WebView.subproj/WebFrame.h
@@ -5,22 +5,24 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebController.h>
+#import <Foundation/Foundation.h>
+ at class IFError;
@class IFWebDataSource;
+ at protocol IFWebController;
+
+ at class IFWebFramePrivate;
@interface IFWebFrame : NSObject
{
@private
- id _framePrivate;
+ IFWebFramePrivate *_framePrivate;
}
- initWithName: (NSString *)name view: view provisionalDataSource: (IFWebDataSource *)dataSource controller: (id <IFWebController>)controller;
- (NSString *)name;
-
- (void)setController: (id <IFWebController>)controller;
- (id <IFWebController>)controller;
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index ae6d99a..8f71a6f 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -10,6 +10,8 @@
#import <WebKit/IFWebViewPrivate.h>
#import <WebKit/IFWebDataSourcePrivate.h>
#import <WebKit/IFBaseWebControllerPrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFLocationChangeHandler.h>
#import <WebKit/WebKitDebug.h>
diff --git a/WebKit/WebView.subproj/WebFrameLoadDelegate.h b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
index bb0a935..383e552 100644
--- a/WebKit/WebView.subproj/WebFrameLoadDelegate.h
+++ b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
@@ -4,7 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
+
+#import <Foundation/Foundation.h>
@class IFError;
@class IFWebDataSource;
@@ -57,5 +58,3 @@
- (void) downloadingWithHandler:(IFDownloadHandler *)downloadHandler;
@end
-
-
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index feb8bd0..5f4fd25 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -5,10 +5,14 @@
Private header file.
*/
-#import <Cocoa/Cocoa.h>
#import <WebKit/IFWebFrame.h>
-#import <WebKit/IFWebDataSource.h>
+
+ at class IFWebView;
+
+namespace khtml {
+ class RenderPart;
+}
typedef enum {
IFWEBFRAMESTATE_UNINITIALIZED = 1,
@@ -29,10 +33,10 @@ typedef enum {
@interface IFWebFramePrivate : NSObject
{
NSString *name;
- id view;
+ IFWebView *view;
IFWebDataSource *dataSource;
IFWebDataSource *provisionalDataSource;
- void *renderFramePart;
+ khtml::RenderPart *renderFramePart;
id <IFWebController>controller;
IFWebFrameState state;
NSMutableDictionary *errors;
@@ -44,21 +48,21 @@ typedef enum {
- (NSString *)name;
- (void)setController: (id <IFWebController>)c;
- (id <IFWebController>)controller;
-- (void)setView: v;
-- view;
+- (void)setView: (IFWebView *)v;
+- (IFWebView *)view;
- (void)setDataSource: (IFWebDataSource *)d;
- (IFWebDataSource *)dataSource;
- (void)setProvisionalDataSource: (IFWebDataSource *)d;
- (IFWebDataSource *)provisionalDataSource;
-- (void)setRenderFramePart: (void *)p;
-- (void *)renderFramePart;
+- (void)setRenderFramePart: (khtml::RenderPart *)p;
+- (khtml::RenderPart *)renderFramePart;
@end
@interface IFWebFrame (IFPrivate)
- (void)_setController: (id <IFWebController>)controller;
-- (void)_setRenderFramePart: (void *)p;
-- (void *)_renderFramePart;
+- (void)_setRenderFramePart: (khtml::RenderPart *)p;
+- (khtml::RenderPart *)_renderFramePart;
- (void)_setDataSource: (IFWebDataSource *)d;
- (void)_transitionProvisionalToCommitted;
- (void)_transitionProvisionalToLayoutAcceptable;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index b78a698..f40007e 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -8,6 +8,8 @@
#import <WebKit/IFWebViewPrivate.h>
#import <WebKit/IFWebFramePrivate.h>
#import <WebKit/IFPreferencesPrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFLocationChangeHandler.h>
#import <WebKit/WebKitDebug.h>
@@ -17,21 +19,31 @@
#include <khtmlview.h>
#include <rendering/render_frames.h>
+static const char * const stateNames[6] = {
+ "zero state",
+ "IFWEBFRAMESTATE_UNINITIALIZED",
+ "IFWEBFRAMESTATE_PROVISIONAL",
+ "IFWEBFRAMESTATE_COMMITTED_PAGE",
+ "IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE",
+ "IFWEBFRAMESTATE_COMPLETE"
+};
+
@implementation IFWebFramePrivate
- (void)dealloc
{
- [name autorelease];
[view _setController: nil];
- [view autorelease];
[dataSource _setController: nil];
- [dataSource autorelease];
[provisionalDataSource _setController: nil];
+
+ [name autorelease];
+ [view autorelease];
+ [dataSource autorelease];
[provisionalDataSource autorelease];
[errors release];
[mainDocumentError release];
if (renderFramePart)
- ((khtml::RenderPart *)renderFramePart)->deref();
+ renderFramePart->deref();
[super dealloc];
}
@@ -42,7 +54,6 @@
name = [n retain];
}
-
- view { return view; }
- (void)setView: v
{
@@ -53,101 +64,77 @@
- (IFWebDataSource *)dataSource { return dataSource; }
- (void)setDataSource: (IFWebDataSource *)d
{
- if (dataSource != d){
+ if (dataSource != d) {
[dataSource _setController: nil];
[dataSource autorelease];
dataSource = [d retain];
}
}
-
- (id <IFWebController>)controller { return controller; }
- (void)setController: (id <IFWebController>)c
{
- // Warning: non-retained reference
- controller = c;
+ controller = c; // not retained (yet)
}
-
- (IFWebDataSource *)provisionalDataSource { return provisionalDataSource; }
- (void)setProvisionalDataSource: (IFWebDataSource *)d
{
- if (provisionalDataSource != d){
+ if (provisionalDataSource != d) {
[provisionalDataSource autorelease];
provisionalDataSource = [d retain];
}
}
-
-- (void *)renderFramePart { return renderFramePart; }
-- (void)setRenderFramePart: (void *)p
+- (khtml::RenderPart *)renderFramePart { return renderFramePart; }
+- (void)setRenderFramePart: (khtml::RenderPart *)p
{
if (p)
- ((khtml::RenderPart *)p)->ref();
+ p->ref();
if (renderFramePart)
- ((khtml::RenderPart *)renderFramePart)->deref();
+ renderFramePart->deref();
renderFramePart = p;
}
-
@end
-
@implementation IFWebFrame (IFPrivate)
+
- (void)_setController: (id <IFWebController>)controller
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- [data setController: controller];
+ [_framePrivate setController: controller];
}
-
-// renderFramePart is a pointer to a RenderPart
-- (void)_setRenderFramePart: (void *)p
+- (void)_setRenderFramePart: (khtml::RenderPart *)p
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- [data setRenderFramePart: p];
+ [_framePrivate setRenderFramePart:p];
}
-- (void *)_renderFramePart
+- (khtml::RenderPart *)_renderFramePart
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- return [data renderFramePart];
+ return [_framePrivate renderFramePart];
}
- (void)_setDataSource: (IFWebDataSource *)ds
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- [data setDataSource: ds];
+ [_framePrivate setDataSource: ds];
[ds _setController: [self controller]];
}
-char *stateNames[6] = {
- "zero state",
- "IFWEBFRAMESTATE_UNINITIALIZED",
- "IFWEBFRAMESTATE_PROVISIONAL",
- "IFWEBFRAMESTATE_COMMITTED_PAGE",
- "IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE",
- "IFWEBFRAMESTATE_COMPLETE" };
-
-
- (void)_scheduleLayout: (NSTimeInterval)inSeconds
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- if (data->scheduledLayoutPending == NO){
+ if (_framePrivate->scheduledLayoutPending == NO) {
[NSTimer scheduledTimerWithTimeInterval:inSeconds target:self selector: @selector(_timedLayout:) userInfo: nil repeats:FALSE];
- data->scheduledLayoutPending = YES;
+ _framePrivate->scheduledLayoutPending = YES;
}
}
-- (void)_timedLayout: userInfo
+- (void)_timedLayout: (id)userInfo
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: state = %s\n", [[self name] cString], stateNames[data->state]);
+ WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: state = %s\n", [[self name] cString], stateNames[_framePrivate->state]);
- data->scheduledLayoutPending = NO;
- if (data->state == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE){
+ _framePrivate->scheduledLayoutPending = NO;
+ if (_framePrivate->state == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE) {
if ([self controller])
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: performing timed layout, %f seconds since start of document load\n", [[self name] cString], CFAbsoluteTimeGetCurrent() - [[[[self controller] mainFrame] dataSource] _loadingStartedTime]);
[[self view] setNeedsLayout: YES];
@@ -162,9 +149,7 @@ char *stateNames[6] = {
- (void)_transitionProvisionalToLayoutAcceptable
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- switch ([self _state]){
+ switch ([self _state]) {
case IFWEBFRAMESTATE_COMMITTED_PAGE:
{
[self _setState: IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE];
@@ -173,14 +158,14 @@ char *stateNames[6] = {
// X interval, even if the document and resources are not completely
// loaded.
BOOL timedDelayEnabled = [[IFPreferences standardPreferences] _initialTimedLayoutEnabled];
- if (timedDelayEnabled){
+ if (timedDelayEnabled) {
NSTimeInterval defaultTimedDelay = [[IFPreferences standardPreferences] _initialTimedLayoutDelay];
double timeSinceStart;
// If the delay getting to the commited state exceeds the initial layout delay, go
// ahead and schedule a layout.
timeSinceStart = (CFAbsoluteTimeGetCurrent() - [[self dataSource] _loadingStartedTime]);
- if (timeSinceStart > (double)defaultTimedDelay){
+ if (timeSinceStart > (double)defaultTimedDelay) {
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "performing early layout because commit time, %f, exceeded initial layout interval %f\n", timeSinceStart, defaultTimedDelay);
[self _timedLayout: nil];
}
@@ -204,7 +189,7 @@ char *stateNames[6] = {
case IFWEBFRAMESTATE_UNINITIALIZED:
default:
{
- [[NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE from %s", stateNames[data->state]] userInfo: nil] raise];
+ [[NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE from %s", stateNames[_framePrivate->state]] userInfo: nil] raise];
return;
}
}
@@ -213,11 +198,9 @@ char *stateNames[6] = {
- (void)_transitionProvisionalToCommitted
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
WEBKIT_ASSERT ([self controller] != nil);
- switch ([self _state]){
+ switch ([self _state]) {
case IFWEBFRAMESTATE_PROVISIONAL:
{
id view = [self view];
@@ -231,23 +214,23 @@ char *stateNames[6] = {
[view _removeSubviews];
// Set the committed data source on the frame.
- [self _setDataSource: data->provisionalDataSource];
+ [self _setDataSource: _framePrivate->provisionalDataSource];
// If we're a frame (not the main frame) hookup the kde internals. This introduces a nasty dependency
// in kde on the view.
khtml::RenderPart *renderPartFrame = [self _renderFramePart];
- if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")]){
+ if (renderPartFrame && [view isKindOfClass: NSClassFromString(@"IFWebView")]) {
// Setting the widget will delete the previous KHTMLView associated with the frame.
renderPartFrame->setWidget ([view _provisionalWidget]);
}
// dataSourceChanged: will reset the view and begin trying to
// display the new new datasource.
- [view dataSourceChanged: data->provisionalDataSource];
+ [view dataSourceChanged: _framePrivate->provisionalDataSource];
// Now that the provisional data source is committed, release it.
- [data setProvisionalDataSource: nil];
+ [_framePrivate setProvisionalDataSource: nil];
[self _setState: IFWEBFRAMESTATE_COMMITTED_PAGE];
@@ -266,50 +249,42 @@ char *stateNames[6] = {
case IFWEBFRAMESTATE_COMPLETE:
default:
{
- [[NSException exceptionWithName:NSGenericException reason:[NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_COMMITTED from %s", stateNames[data->state]] userInfo: nil] raise];
+ [[NSException exceptionWithName:NSGenericException reason:[NSString stringWithFormat: @"invalid state attempting to transition to IFWEBFRAMESTATE_COMMITTED from %s", stateNames[_framePrivate->state]] userInfo: nil] raise];
return;
}
}
}
-
- (IFWebFrameState)_state
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- return data->state;
+ return _framePrivate->state;
}
- (void)_setState: (IFWebFrameState)newState
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: transition from %s to %s\n", [[self name] cString], stateNames[data->state], stateNames[newState]);
+ WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: transition from %s to %s\n", [[self name] cString], stateNames[_framePrivate->state], stateNames[newState]);
if ([self controller])
- WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: transition from %s to %s, %f seconds since start of document load\n", [[self name] cString], stateNames[data->state], stateNames[newState], CFAbsoluteTimeGetCurrent() - [[[[self controller] mainFrame] dataSource] _loadingStartedTime]);
+ WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s: transition from %s to %s, %f seconds since start of document load\n", [[self name] cString], stateNames[_framePrivate->state], stateNames[newState], CFAbsoluteTimeGetCurrent() - [[[[self controller] mainFrame] dataSource] _loadingStartedTime]);
if (newState == IFWEBFRAMESTATE_COMPLETE && self == [[self controller] mainFrame])
WEBKITDEBUGLEVEL (WEBKIT_LOG_DOCUMENTLOAD, "completed %s (%f seconds)", [[[[self dataSource] inputURL] absoluteString] cString], CFAbsoluteTimeGetCurrent() - [[self dataSource] _loadingStartedTime]);
- data->state = newState;
+ _framePrivate->state = newState;
}
- (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- if (data->errors == 0)
- data->errors = [[NSMutableDictionary alloc] init];
+ if (_framePrivate->errors == 0)
+ _framePrivate->errors = [[NSMutableDictionary alloc] init];
- [data->errors setObject: error forKey: resourceDescription];
+ [_framePrivate->errors setObject: error forKey: resourceDescription];
}
- (void)_isLoadComplete
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
WEBKIT_ASSERT ([self controller] != nil);
- switch ([self _state]){
+ switch ([self _state]) {
// Shouldn't ever be in this state.
case IFWEBFRAMESTATE_UNINITIALIZED:
{
@@ -322,13 +297,13 @@ char *stateNames[6] = {
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete in IFWEBFRAMESTATE_PROVISIONAL\n", [[self name] cString]);
// If we've received any errors we may be stuck in the provisional state and actually
// complete.
- if ([[self errors] count] != 0){
+ if ([[self errors] count] != 0) {
// Check all children first.
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_PROVISIONAL, %d errors\n", [[self name] cString], [[self errors] count]);
- if (![[self provisionalDataSource] isLoading]){
+ if (![[self provisionalDataSource] isLoading]) {
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete in IFWEBFRAMESTATE_PROVISIONAL, load done\n", [[self name] cString]);
// We now the provisional data source didn't cut the mustard, release it.
- [data setProvisionalDataSource: nil];
+ [_framePrivate setProvisionalDataSource: nil];
[self _setState: IFWEBFRAMESTATE_COMPLETE];
[[[self provisionalDataSource] _locationChangeHandler] locationChangeDone: [self mainDocumentError]];
@@ -342,7 +317,7 @@ char *stateNames[6] = {
case IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE:
{
WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s: checking complete, current state IFWEBFRAMESTATE_COMMITTED\n", [[self name] cString]);
- if (![[self dataSource] isLoading]){
+ if (![[self dataSource] isLoading]) {
id mainView = [[[self controller] mainFrame] view];
id thisView = [self view];
@@ -366,7 +341,7 @@ char *stateNames[6] = {
[[thisView _frameScrollView] setNeedsDisplay: YES];
// Force a relayout and draw NOW if we are complete are the top level.
- if ([[self controller] mainFrame] == self){
+ if ([[self controller] mainFrame] == self) {
[mainView layout];
[mainView display];
}
@@ -381,9 +356,9 @@ char *stateNames[6] = {
// A resource was loaded, but the entire frame isn't complete. Schedule a
// layout.
else {
- if ([self _state] == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE){
+ if ([self _state] == IFWEBFRAMESTATE_LAYOUT_ACCEPTABLE) {
BOOL resourceTimedDelayEnabled = [[IFPreferences standardPreferences] _resourceTimedLayoutEnabled];
- if (resourceTimedDelayEnabled){
+ if (resourceTimedDelayEnabled) {
NSTimeInterval timedDelay = [[IFPreferences standardPreferences] _resourceTimedLayoutDelay];
[self _scheduleLayout: timedDelay];
}
@@ -414,7 +389,7 @@ char *stateNames[6] = {
childFrames = [[fromFrame dataSource] children];
count = [childFrames count];
- for (i = 0; i < count; i++){
+ for (i = 0; i < count; i++) {
IFWebFrame *childFrame;
childFrame = [childFrames objectAtIndex: i];
@@ -443,19 +418,17 @@ char *stateNames[6] = {
- (void)_setMainDocumentError: (IFError *)error
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
- data->mainDocumentError = [error retain];
+ [error retain];
+ [_framePrivate->mainDocumentError release];
+ _framePrivate->mainDocumentError = error;
}
- (void)_clearErrors
{
- IFWebFramePrivate *data = (IFWebFramePrivate *)_framePrivate;
-
- [data->errors release];
- data->errors = nil;
- [data->mainDocumentError release];
- data->mainDocumentError = nil;
+ [_framePrivate->errors release];
+ _framePrivate->errors = nil;
+ [_framePrivate->mainDocumentError release];
+ _framePrivate->mainDocumentError = nil;
}
@end
-
diff --git a/WebKit/WebView.subproj/WebFrameView.h b/WebKit/WebView.subproj/WebFrameView.h
index 7686022..69b78e6 100644
--- a/WebKit/WebView.subproj/WebFrameView.h
+++ b/WebKit/WebView.subproj/WebFrameView.h
@@ -4,10 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebDataSource.h>
-#import <WebKit/IFWebController.h>
+#import <Cocoa/Cocoa.h>
/*
=============================================================================
@@ -40,7 +38,7 @@
Controllers should initiate progress indicators upon receipt of loadingStarted,
and terminate when either a loadingCancelled or loadingStopped is received.
- 2. After the controller receives it's first receivedDataForLocation: the contents of
+ 2. After the controller receives its first receivedDataForLocation: the contents of
the view will be cleared and layout may begin.
3. Upon subsequent receipt of receivedDataForLocation: messages the controller
@@ -73,43 +71,40 @@
the selected text.
*/
+
+ at class IFWebDataSource;
+ at protocol IFWebController;
+
+ at class IFWebViewPrivate;
+
@interface IFWebView : NSView
{
@private
- id _viewPrivate;
+ IFWebViewPrivate *_viewPrivate;
}
- initWithFrame: (NSRect)frame;
-
#ifdef TENTATIVE_API
// Set and get the delegate.
- (void)setDelegate: (id <IFWebViewDelegate>)delegate;
- (id <IFWebViewDelegate>)delegate;
#endif
-
-// Set and get the controller. Note that the controller is not retained.
-// Perhaps setController: should be private?
+// Note that the controller is not retained.
- (id <IFWebController>)controller;
-
-// This method is typically called by the view's controller when
+// These methods is typically called by the view's controller when
// the data source is changed.
- (void)dataSourceChanged: (IFWebDataSource *)dataSource;
-
-
- (void)provisionalDataSourceChanged: (IFWebDataSource *)dataSource;
-
- (void)setNeedsLayout: (bool)flag;
-
// This method should not be public until we have a more completely
// understood way to subclass IFWebView.
- (void)layout;
-
// Set needsToApplyStyles if you change anything that might impact styles, like
// font preferences.
- (void)setNeedsToApplyStyles: (bool)flag;
@@ -118,18 +113,15 @@
// instead call setNeedsToApplyStyles:.
- (void)reapplyStyles;
-
// Stop animating animated GIFs, etc.
- (void)stopAnimations;
-
// Drag and drop links and images. Others?
- (void)setCanDragFrom: (BOOL)flag;
- (BOOL)canDragFrom;
- (void)setCanDragTo: (BOOL)flag;
- (BOOL)canDragTo;
-
// Returns an array of built-in context menu items for this node.
// Generally called by IFContextMenuHandlers from contextMenuItemsForNode:
#ifdef TENTATIVE_API
@@ -138,23 +130,18 @@
- (void)setContextMenusEnabled: (BOOL)flag;
- (BOOL)contextMenusEnabled;
-
// Remove the selection.
- (void)deselectText;
-
// Search from the end of the currently selected location, or from the beginning of the document if nothing
// is selected.
- (void)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag;
-
// Get an attributed string that represents the current selection.
- (NSAttributedString *)selectedText;
@end
-
-
/*
Areas still to consider:
@@ -171,5 +158,3 @@
subclassing of IFWebView
*/
-
-
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index df95653..4458055 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -26,8 +26,8 @@
_viewPrivate = [[IFWebViewPrivate alloc] init];
- ((IFWebViewPrivate *)_viewPrivate)->isFlipped = YES;
- ((IFWebViewPrivate *)_viewPrivate)->needsLayout = YES;
+ _viewPrivate->isFlipped = YES;
+ _viewPrivate->needsLayout = YES;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
@@ -44,11 +44,10 @@
}
-// Set and get the controller. Note that the controller is not retained.
-// Perhaps setController: should be private?
+// Note that the controller is not retained.
- (id <IFWebController>)controller
{
- return ((IFWebViewPrivate *)_viewPrivate)->controller;
+ return _viewPrivate->controller;
}
@@ -70,7 +69,6 @@
// the data source is changed.
- (void)provisionalDataSourceChanged: (IFWebDataSource *)dataSource
{
- IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
NSRect r = [self frame];
IFWebView *provisionalView;
@@ -78,21 +76,21 @@
// the KHTMLPart.
KHTMLPart *part = [dataSource _part];
- data->provisionalWidget = new KHTMLView (part, 0);
- part->setView (data->provisionalWidget);
+ _viewPrivate->provisionalWidget = new KHTMLView (part, 0);
+ part->setView (_viewPrivate->provisionalWidget);
// Create a temporary provisional view. It will be replaced with
// the actual view once the datasource has been committed.
provisionalView = [[IFWebView alloc] initWithFrame: NSMakeRect (0,0,0,0)];
- data->provisionalWidget->setView (provisionalView);
+ _viewPrivate->provisionalWidget->setView (provisionalView);
[provisionalView release];
- data->provisionalWidget->resize (r.size.width,r.size.height);
+ _viewPrivate->provisionalWidget->resize (r.size.width,r.size.height);
}
- (void)dataSourceChanged: (IFWebDataSource *)dataSource
{
- IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
+ IFWebViewPrivate *data = _viewPrivate;
// Setup the real view.
if ([self _frameScrollView])
@@ -112,16 +110,16 @@
- (void)reapplyStyles
{
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
+ KHTMLView *widget = _viewPrivate->widget;
if (widget->part()->xmlDocImpl() &&
widget->part()->xmlDocImpl()->renderer()){
- if (((IFWebViewPrivate *)_viewPrivate)->needsToApplyStyles){
+ if (_viewPrivate->needsToApplyStyles){
#ifdef _KWQ_TIMING
double start = CFAbsoluteTimeGetCurrent();
#endif
widget->part()->xmlDocImpl()->updateStyleSelector();
- ((IFWebViewPrivate *)_viewPrivate)->needsToApplyStyles = NO;
+ _viewPrivate->needsToApplyStyles = NO;
#ifdef _KWQ_TIMING
double thisTime = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s apply style seconds = %f\n", widget->part()->baseURL().url().latin1(), thisTime);
@@ -137,11 +135,11 @@
// understood how IFWebView will be subclassed.
- (void)layout
{
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
+ KHTMLView *widget = _viewPrivate->widget;
if (widget->part()->xmlDocImpl() &&
widget->part()->xmlDocImpl()->renderer()){
- if (((IFWebViewPrivate *)_viewPrivate)->needsLayout){
+ if (_viewPrivate->needsLayout){
#ifdef _KWQ_TIMING
double start = CFAbsoluteTimeGetCurrent();
#endif
@@ -150,7 +148,7 @@
//double start = CFAbsoluteTimeGetCurrent();
widget->layout();
//WebKitDebugAtLevel (WEBKIT_LOG_TIMING, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
- ((IFWebViewPrivate *)_viewPrivate)->needsLayout = NO;
+ _viewPrivate->needsLayout = NO;
#ifdef _KWQ_TIMING
double thisTime = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "%s layout seconds = %f\n", widget->part()->baseURL().url().latin1(), thisTime);
@@ -278,21 +276,21 @@
- (void)setNeedsLayout: (bool)flag
{
WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "flag = %d\n", (int)flag);
- ((IFWebViewPrivate *)_viewPrivate)->needsLayout = flag;
+ _viewPrivate->needsLayout = flag;
}
- (void)setNeedsToApplyStyles: (bool)flag
{
WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "flag = %d\n", (int)flag);
- ((IFWebViewPrivate *)_viewPrivate)->needsToApplyStyles = flag;
+ _viewPrivate->needsToApplyStyles = flag;
}
// This should eventually be removed.
- (void)drawRect:(NSRect)rect {
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
- //IFWebViewPrivate *data = ((IFWebViewPrivate *)_viewPrivate);
+ KHTMLView *widget = _viewPrivate->widget;
+ //IFWebViewPrivate *data = _viewPrivate;
//if (data->provisionalWidget != 0){
// WEBKITDEBUGLEVEL (WEBKIT_LOG_VIEW, "not drawing, frame in provisional state.\n");
@@ -357,13 +355,13 @@
- (void)setIsFlipped: (bool)flag
{
- ((IFWebViewPrivate *)_viewPrivate)->isFlipped = flag;
+ _viewPrivate->isFlipped = flag;
}
- (BOOL)isFlipped
{
- return ((IFWebViewPrivate *)_viewPrivate)->isFlipped;
+ return _viewPrivate->isFlipped;
}
@@ -398,7 +396,7 @@
NSPoint p = [event locationInWindow];
QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
+ KHTMLView *widget = _viewPrivate->widget;
if (widget != 0l) {
widget->viewportMouseReleaseEvent(kEvent);
}
@@ -427,7 +425,7 @@
NSPoint p = [event locationInWindow];
QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
- KHTMLView *widget = ((IFWebViewPrivate *)_viewPrivate)->widget;
+ KHTMLView *widget = _viewPrivate->widget;
if (widget != 0l) {
widget->viewportMousePressEvent(kEvent);
}
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index bcdf956..b4cdb93 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -5,10 +5,7 @@
in WebCore. Instances of this class are referenced by _viewPrivate in
NSWebPageView.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebController.h>
-#import <WebKit/IFDynamicScrollBarsView.h>
#import <WebKit/IFWebView.h>
class QWidget;
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index bcdf956..b4cdb93 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -5,10 +5,7 @@
in WebCore. Instances of this class are referenced by _viewPrivate in
NSWebPageView.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFWebController.h>
-#import <WebKit/IFDynamicScrollBarsView.h>
#import <WebKit/IFWebView.h>
class QWidget;
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index affc552..41e4e03 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -11,27 +11,14 @@
#import <WebKit/IFPluginView.h>
// Includes from KDE
-#include <khtmlview.h>
-#include <html/html_documentimpl.h>
+#import <khtmlview.h>
+#import <html/html_documentimpl.h>
@implementation IFWebViewPrivate
-- init
-{
- [super init];
-
- controller = nil;
- widget = 0;
-
- return self;
-}
-
-
- (void)dealloc
{
- // controller is not retained! IFWebControllers maintain
- // a reference to their view and main data source.
-
+ [controller release];
[frameScrollView release];
//if (widget)
@@ -40,68 +27,49 @@
[super dealloc];
}
-
-
@end
-
@implementation IFWebView (IFPrivate)
- (void)_resetWidget
{
- if (((IFWebViewPrivate *)_viewPrivate)->widget)
- delete ((IFWebViewPrivate *)_viewPrivate)->widget;
- ((IFWebViewPrivate *)_viewPrivate)->widget = 0;
+ delete _viewPrivate->widget;
+ _viewPrivate->widget = 0;
}
- (void)_stopPlugins
{
NSArray *views = [self subviews];
- int count;
-
- count = [views count];
- while (count--){
- id view;
-
- view = [views objectAtIndex: count];
+ int count = [views count];
+ while (count--) {
+ id view = [views objectAtIndex: count];
if ([view isKindOfClass: NSClassFromString (@"IFPluginView")])
[(IFPluginView *)view stop];
}
}
-
- (void)_removeSubviews
{
- // Remove all the views. They will be be re-added if this
- // is a re-layout.
- NSArray *views = [self subviews];
- int count;
-
- count = [views count];
- while (count--){
- id view;
- view = [views objectAtIndex: count];
- [view removeFromSuperviewWithoutNeedingDisplay];
- }
+ // Remove all the views. They will be be re-added if this is a re-layout.
+ [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperviewWithoutNeedingDisplay)];
}
-
-
- (void)_setController: (id <IFWebController>)controller
{
- // Not retained.
- ((IFWebViewPrivate *)_viewPrivate)->controller = controller;
+ [controller retain];
+ [_viewPrivate->controller release];
+ _viewPrivate->controller = controller;
}
- (KHTMLView *)_widget
{
- return ((IFWebViewPrivate *)_viewPrivate)->widget;
+ return _viewPrivate->widget;
}
- (DOM::DocumentImpl *)_document
{
- KHTMLPart *part = ((IFWebViewPrivate *)_viewPrivate)->widget->part();
- if (part){
+ KHTMLPart *part = _viewPrivate->widget->part();
+ if (part) {
return part->xmlDocImpl();
}
return 0;
@@ -109,12 +77,14 @@
+ (NSString *)_nodeName: (DOM::NodeImpl *)node
{
- return [NSString stringWithCString: node->nodeName().string().latin1()];
+ // FIXME: good for debugging only since it's Latin 1 only
+ return [NSString stringWithCString:node->nodeName().string().latin1()];
}
+ (NSString *)_nodeValue: (DOM::NodeImpl *)node
{
- return [NSString stringWithCString: node->nodeValue().string().latin1()];
+ // FIXME: good for debugging only since it's Latin 1 only
+ return [NSString stringWithCString:node->nodeValue().string().latin1()];
}
+ (NSString *)_nodeHTML: (DOM::NodeImpl *)node
@@ -124,9 +94,9 @@
- (khtml::RenderObject *)_renderRoot
{
- KHTMLPart *part = ((IFWebViewPrivate *)_viewPrivate)->widget->part();
+ KHTMLPart *part = _viewPrivate->widget->part();
DOM::DocumentImpl *doc;
- if (part){
+ if (part) {
doc = part->xmlDocImpl();
if (doc)
return doc->renderer();
@@ -134,16 +104,16 @@
return 0;
}
-
- (KHTMLView *)_provisionalWidget
{
- return ((IFWebViewPrivate *)_viewPrivate)->provisionalWidget;
+ return _viewPrivate->provisionalWidget;
}
-
- (void)_setFrameScrollView: (NSScrollView *)sv
{
- ((IFWebViewPrivate *)_viewPrivate)->frameScrollView = [sv retain];
+ [sv retain];
+ [_viewPrivate->frameScrollView release];
+ _viewPrivate->frameScrollView = sv;
//[sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
//[sv setHasVerticalScroller: YES];
//[sv setHasHorizontalScroller: YES];
@@ -153,7 +123,7 @@
- (NSScrollView *)_frameScrollView
{
- return ((IFWebViewPrivate *)_viewPrivate)->frameScrollView;
+ return _viewPrivate->frameScrollView;
}
- (void)_setupScrollers
@@ -161,7 +131,7 @@
BOOL scrollsVertically;
BOOL scrollsHorizontally;
- if ([self _frameScrollView]){
+ if ([self _frameScrollView]) {
scrollsVertically = [self bounds].size.height > [[self _frameScrollView] frame].size.height;
scrollsHorizontally = [self bounds].size.width > [[self _frameScrollView] frame].size.width;
@@ -170,6 +140,4 @@
}
}
-
-
@end
diff --git a/WebKit/WebView.subproj/WebLoadProgress.h b/WebKit/WebView.subproj/WebLoadProgress.h
index a1256b3..8a17f1e 100644
--- a/WebKit/WebView.subproj/WebLoadProgress.h
+++ b/WebKit/WebView.subproj/WebLoadProgress.h
@@ -13,7 +13,7 @@ typedef enum {
IF_LOAD_TYPE_SCRIPT = 3,
IF_LOAD_TYPE_HTML = 4,
IF_LOAD_TYPE_PLUGIN = 5
-} IF_LOAD_TYPE;
+} IFLoadType;
@interface IFLoadProgress : NSObject
@@ -21,14 +21,14 @@ typedef enum {
int bytesSoFar; // 0 if this is the start of load
int totalToLoad; // -1 if this is not known.
// bytesSoFar == totalLoaded when complete
- IF_LOAD_TYPE type;
+ IFLoadType type;
}
-- (id)initWithBytesSoFar:(int)bytes totalToLoad:(int)total type:(IF_LOAD_TYPE)loadType;
+- (id)initWithBytesSoFar:(int)bytes totalToLoad:(int)total type:(IFLoadType)loadType;
- (int)bytesSoFar;
- (int)totalToLoad;
-- (IF_LOAD_TYPE)type;
+- (IFLoadType)type;
@end
diff --git a/WebKit/WebView.subproj/WebLoadProgress.m b/WebKit/WebView.subproj/WebLoadProgress.m
index ca11a8f..701af82 100644
--- a/WebKit/WebView.subproj/WebLoadProgress.m
+++ b/WebKit/WebView.subproj/WebLoadProgress.m
@@ -9,7 +9,7 @@
@implementation IFLoadProgress
-static id IFLoadProgressMake()
+static id IFLoadProgressMake(void)
{
return [[[IFLoadProgress alloc] init] autorelease];
}
@@ -19,7 +19,7 @@ static id IFLoadProgressMake()
WCSetIFLoadProgressMakeFunc(IFLoadProgressMake);
}
-- (id)initWithBytesSoFar:(int)bytes totalToLoad:(int)total type:(IF_LOAD_TYPE)loadType
+- (id)initWithBytesSoFar:(int)bytes totalToLoad:(int)total type:(IFLoadType)loadType
{
if (![super init]) {
return nil;
@@ -42,7 +42,7 @@ static id IFLoadProgressMake()
return totalToLoad;
}
-- (IF_LOAD_TYPE)type
+- (IFLoadType)type
{
return type;
}
diff --git a/WebKit/WebView.subproj/WebLocationChangeDelegate.h b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
index bb0a935..383e552 100644
--- a/WebKit/WebView.subproj/WebLocationChangeDelegate.h
+++ b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
@@ -4,7 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
+
+#import <Foundation/Foundation.h>
@class IFError;
@class IFWebDataSource;
@@ -57,5 +58,3 @@
- (void) downloadingWithHandler:(IFDownloadHandler *)downloadHandler;
@end
-
-
diff --git a/WebKit/WebView.subproj/WebLocationChangeHandler.h b/WebKit/WebView.subproj/WebLocationChangeHandler.h
index bb0a935..383e552 100644
--- a/WebKit/WebView.subproj/WebLocationChangeHandler.h
+++ b/WebKit/WebView.subproj/WebLocationChangeHandler.h
@@ -4,7 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
+
+#import <Foundation/Foundation.h>
@class IFError;
@class IFWebDataSource;
@@ -57,5 +58,3 @@
- (void) downloadingWithHandler:(IFDownloadHandler *)downloadHandler;
@end
-
-
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.h b/WebKit/WebView.subproj/WebMainResourceClient.h
index 545e218..2e248c9 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.h
+++ b/WebKit/WebView.subproj/WebMainResourceClient.h
@@ -6,12 +6,13 @@
Copyright 2001, Apple, Inc. All rights reserved.
*/
-#import <Cocoa/Cocoa.h>
+#import <WebKit/IFMIMEHandler.h>
-#import <WebFoundation/WebFoundation.h>
+ at class IFDownloadHandler;
+ at class IFWebDataSource;
+ at protocol IFURLHandleClient;
-#import <WebKit/IFWebDataSourcePrivate.h>
-#import <WebKit/IFMIMEHandler.h>
+class KHTMLPart;
@interface IFMainURLHandleClient : NSObject <IFURLHandleClient>
{
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index f7d88e2..e5e94f6 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -3,18 +3,26 @@
Copyright 2001, Apple, Inc. All rights reserved.
*/
-#include <pthread.h>
-#import <WebKit/IFBaseWebControllerPrivate.h>
#import <WebKit/IFMainURLHandleClient.h>
+
+#import <pthread.h>
+
+#import <WebKit/IFLoadProgress.h>
+#import <WebKit/IFBaseWebControllerPrivate.h>
#import <WebKit/IFMIMEDatabase.h>
#import <WebKit/WebKitDebug.h>
#import <WebKit/IFContentHandler.h>
#import <WebKit/IFDownloadHandlerPrivate.h>
+#import <WebKit/IFWebDataSourcePrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFLocationChangeHandler.h>
#import <WebFoundation/IFError.h>
+#import <WebFoundation/IFURLHandle.h>
-#include <khtmlview.h>
+#import <khtmlview.h>
+#import <khtml_part.h>
@implementation IFMainURLHandleClient
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.h b/WebKit/WebView.subproj/WebMainResourceLoader.h
index 545e218..2e248c9 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.h
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.h
@@ -6,12 +6,13 @@
Copyright 2001, Apple, Inc. All rights reserved.
*/
-#import <Cocoa/Cocoa.h>
+#import <WebKit/IFMIMEHandler.h>
-#import <WebFoundation/WebFoundation.h>
+ at class IFDownloadHandler;
+ at class IFWebDataSource;
+ at protocol IFURLHandleClient;
-#import <WebKit/IFWebDataSourcePrivate.h>
-#import <WebKit/IFMIMEHandler.h>
+class KHTMLPart;
@interface IFMainURLHandleClient : NSObject <IFURLHandleClient>
{
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index f7d88e2..e5e94f6 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -3,18 +3,26 @@
Copyright 2001, Apple, Inc. All rights reserved.
*/
-#include <pthread.h>
-#import <WebKit/IFBaseWebControllerPrivate.h>
#import <WebKit/IFMainURLHandleClient.h>
+
+#import <pthread.h>
+
+#import <WebKit/IFLoadProgress.h>
+#import <WebKit/IFBaseWebControllerPrivate.h>
#import <WebKit/IFMIMEDatabase.h>
#import <WebKit/WebKitDebug.h>
#import <WebKit/IFContentHandler.h>
#import <WebKit/IFDownloadHandlerPrivate.h>
+#import <WebKit/IFWebDataSourcePrivate.h>
+#import <WebKit/IFWebController.h>
+#import <WebKit/IFLocationChangeHandler.h>
#import <WebFoundation/IFError.h>
+#import <WebFoundation/IFURLHandle.h>
-#include <khtmlview.h>
+#import <khtmlview.h>
+#import <khtml_part.h>
@implementation IFMainURLHandleClient
diff --git a/WebKit/WebView.subproj/WebPreferences.h b/WebKit/WebView.subproj/WebPreferences.h
index 73a0063..6c2a6c4 100644
--- a/WebKit/WebView.subproj/WebPreferences.h
+++ b/WebKit/WebView.subproj/WebPreferences.h
@@ -4,7 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
+
+#import <Foundation/Foundation.h>
@interface IFPreferences: NSObject
@@ -78,4 +79,3 @@
- (BOOL)onlyLocalReferences;
#endif
-
diff --git a/WebKit/WebView.subproj/WebPreferencesPrivate.h b/WebKit/WebView.subproj/WebPreferencesPrivate.h
index 0b4a202..bd14bce 100644
--- a/WebKit/WebView.subproj/WebPreferencesPrivate.h
+++ b/WebKit/WebView.subproj/WebPreferencesPrivate.h
@@ -4,7 +4,6 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
#import <WebKit/IFPreferences.h>
@@ -17,4 +16,3 @@
- (NSTimeInterval)_resourceTimedLayoutDelay;
@end
-
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index c17f717..7ddcc48 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -4,11 +4,8 @@
Public header file.
*/
-#import <Cocoa/Cocoa.h>
-#import <WebKit/IFLoadProgress.h>
-#import <WebKit/IFLocationChangeHandler.h>
-#import <WebKit/IFDownloadHandler.h>
+#import <Cocoa/Cocoa.h>
/*
=============================================================================
@@ -28,11 +25,13 @@
=============================================================================
*/
-
- at class IFWebDataSource;
+ at class IFDownloadHandler;
@class IFError;
+ at class IFLoadProgress;
+ at class IFWebDataSource;
@class IFWebFrame;
+ at protocol IFLocationChangeHandler;
/*
=============================================================================
@@ -45,6 +44,7 @@
=============================================================================
*/
+
@protocol IFResourceProgressHandler
/*
@@ -59,8 +59,8 @@
@end
-
@protocol IFDownloadProgressHandler
+
// Called when progress of a download has been made
- (void) receivedProgress:(IFLoadProgress *)progress forDownloadHandler:(IFDownloadHandler *)downloadHandler;
@@ -69,7 +69,6 @@
@end
-
/*
=============================================================================
@@ -90,10 +89,6 @@
@end
-
-
-
-
/*
=============================================================================
@@ -103,43 +98,33 @@
=============================================================================
*/
- at protocol IFWebController <IFResourceProgressHandler, IFDownloadProgressHandler, IFScriptContextHandler>
+ at protocol IFWebController <IFResourceProgressHandler, IFDownloadProgressHandler, IFScriptContextHandler>
// Called when a data source needs to create a frame. This method encapsulates the
// specifics of creating and initializaing a view of the appropriate class.
- (IFWebFrame *)createFrameNamed: (NSString *)fname for: (IFWebDataSource *)child inParent: (IFWebDataSource *)parent inScrollView: (BOOL)inScrollView;
-
// Look for a frame named name, recursively.
- (IFWebFrame *)frameNamed: (NSString *)name;
-
// Return the top level frame. Note that even document that are not framesets will have a
// mainFrame.
- (IFWebFrame *)mainFrame;
-
// Return the frame associated with the data source. Traverses the
// frame tree to find the data source.
- (IFWebFrame *)frameForDataSource: (IFWebDataSource *)dataSource;
-
// Return the frame associated with the view. Traverses the
// frame tree to find the data source. Typically aView is
// an IFWebView.
- (IFWebFrame *)frameForView: (NSView *)aView;
-
- (id <IFLocationChangeHandler>)provideLocationChangeHandlerForFrame: (IFWebFrame *)frame;
-
// FIXME: this method should be moved to a protocol
// Called when a plug-in for a certain mime type is not installed
- (void)pluginNotFoundForMIMEType:(NSString *)mime pluginPageURL:(NSURL *)url;
-
@end
-
-
-
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list