[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:54:22 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 10143820b4a683df72d78c8ba20df87dbf1916e0
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jan 19 02:27:06 2002 +0000

        First pass at new view/datasource/controller API.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@549 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index f6d09af..466bafe 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,16 @@
+2002-01-18  Richard Williamson  <rjw at apple.com>
+
+    First pass at new view/datasource/controller API.
+
+	* src/kwq/KWQApplication.mm: (QApplication::QApplication),
+	(QApplication::setMainWidget), (QApplication::exec):
+	* src/kwq/KWQRegion.mm: (QRegion::QRegion), (QRegion::~QRegion),
+	(QRegion::contains), (QRegion::isNull):
+	* src/kwq/Makefile.am:
+	* src/kwq/_KWQOwner.h:
+	* src/kwq/_KWQOwner.m:
+	* src/kwq/qt/qnamespace.h:
+
 2002-01-18  Maciej Stachowiak  <mjs at apple.com>
 
 	Avoid static initialization of objects as much as possible. Order
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index f6d09af..466bafe 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,16 @@
+2002-01-18  Richard Williamson  <rjw at apple.com>
+
+    First pass at new view/datasource/controller API.
+
+	* src/kwq/KWQApplication.mm: (QApplication::QApplication),
+	(QApplication::setMainWidget), (QApplication::exec):
+	* src/kwq/KWQRegion.mm: (QRegion::QRegion), (QRegion::~QRegion),
+	(QRegion::contains), (QRegion::isNull):
+	* src/kwq/Makefile.am:
+	* src/kwq/_KWQOwner.h:
+	* src/kwq/_KWQOwner.m:
+	* src/kwq/qt/qnamespace.h:
+
 2002-01-18  Maciej Stachowiak  <mjs at apple.com>
 
 	Avoid static initialization of objects as much as possible. Order
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index f6d09af..466bafe 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,16 @@
+2002-01-18  Richard Williamson  <rjw at apple.com>
+
+    First pass at new view/datasource/controller API.
+
+	* src/kwq/KWQApplication.mm: (QApplication::QApplication),
+	(QApplication::setMainWidget), (QApplication::exec):
+	* src/kwq/KWQRegion.mm: (QRegion::QRegion), (QRegion::~QRegion),
+	(QRegion::contains), (QRegion::isNull):
+	* src/kwq/Makefile.am:
+	* src/kwq/_KWQOwner.h:
+	* src/kwq/_KWQOwner.m:
+	* src/kwq/qt/qnamespace.h:
+
 2002-01-18  Maciej Stachowiak  <mjs at apple.com>
 
 	Avoid static initialization of objects as much as possible. Order
diff --git a/WebCore/kwq/KWQApplication.mm b/WebCore/kwq/KWQApplication.mm
index fa40d6e..9294a4c 100644
--- a/WebCore/kwq/KWQApplication.mm
+++ b/WebCore/kwq/KWQApplication.mm
@@ -27,8 +27,6 @@
 #include <qapplication.h>
 #include <qpalette.h>
 
-#import "_KWQOwner.h"
-
 // FIXME: 
 static QPalette *DEFAULT_PALETTE = NULL;
 static QSize *DEFAULT_SIZE = NULL;
@@ -100,10 +98,13 @@ void QApplication::sendPostedEvents(QObject *receiver, int event_type)
 
 QApplication::QApplication( int &argc, char **argv)
 {
+#ifdef TRANSITIONAL_CODE
     _initialize();
+#endif    
 }
 
 
+#ifdef TRANSITIONAL_CODE
 void QApplication::_initialize(){
     NSDictionary *info;
     NSString *principalClassName;
@@ -127,6 +128,7 @@ void QApplication::_initialize(){
     //  Force linkage
     [_KWQOwner class];
 }
+#endif
 
 
 QApplication::~QApplication()
@@ -137,6 +139,7 @@ QApplication::~QApplication()
 
 void QApplication::setMainWidget(QWidget *w)
 {
+#ifdef TRANSITIONAL_CODE
     NSRect b = [((_KWQOwner *)application)->containerView bounds];
     
     if (application == nil){
@@ -156,22 +159,29 @@ void QApplication::setMainWidget(QWidget *w)
     [sv setHasHorizontalScroller: YES];
     [w->getView() setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
     [sv setDocumentView: w->getView()];
-    
     [((_KWQOwner *)application)->window setOpaque: FALSE];
     //[((_KWQOwner *)application)->window setAlphaValue: (float)0.8];
     
      
     [((_KWQOwner *)application)->containerView addSubview: sv];
+#else
+    [NSException raise:@"Not implemented" format:@"QApplication::setMainWidget(QWidget *) is not implemented"];
+#endif
 }
 
 
 int QApplication::exec()
 {
+#ifdef TRANSITIONAL_CODE
     if (application == nil){
         KWQDEBUGLEVEL(KWQ_LOG_ERROR, "ERROR: QApplication::exec() application not set.\n");
         return 0;
     }
     [application run];
     return 1;
+#else
+    [NSException raise:@"Not implemented" format:@"QApplication::exec() is not implemented"];
+    return 0;
+#endif
 }
 
diff --git a/WebCore/kwq/KWQNamespace.h b/WebCore/kwq/KWQNamespace.h
index 6a63c17..0cfc272 100644
--- a/WebCore/kwq/KWQNamespace.h
+++ b/WebCore/kwq/KWQNamespace.h
@@ -249,6 +249,7 @@ public:
 
     // constants ---------------------------------------------------------------
 
+
     QT_STATIC_CONST QColor &color0;
     QT_STATIC_CONST QColor &color1;
     QT_STATIC_CONST QColor &black;
diff --git a/WebCore/kwq/KWQRegion.mm b/WebCore/kwq/KWQRegion.mm
index eccd709..f66bb3d 100644
--- a/WebCore/kwq/KWQRegion.mm
+++ b/WebCore/kwq/KWQRegion.mm
@@ -37,7 +37,8 @@ void QRegion::_initialize() {
 QRegion::QRegion()
 {
     _initialize();
-    data->path = [[NSBezierPath bezierPath] retain];
+    // Create lazily - RJW
+    //data->path = [[NSBezierPath bezierPath] retain];
 }
 
 QRegion::QRegion(const QRect &rect)
@@ -83,7 +84,8 @@ QRegion::QRegion(const QRegion &other)
 
 QRegion::~QRegion()
 {
-    [data->path release];
+    if (data->path)
+        [data->path release];
     free(data);
 }
 
@@ -99,12 +101,16 @@ bool QRegion::contains(const QPoint &point) const
 
     nspoint = NSMakePoint(point.x(), point.y());
     
-    return [data->path containsPoint:nspoint] ? 1 : 0;
+    if (data->path)
+        return [data->path containsPoint:nspoint] ? 1 : 0;
+    return 0;
 }
 
 bool QRegion::isNull() const
 {
-    return [data->path elementCount] == 0 ? 1 : 0;
+    if (data->path)
+        return [data->path elementCount] == 0 ? 1 : 0;
+    return 1;
 }
 
 QRegion &QRegion::operator=(const QRegion &other)
diff --git a/WebCore/kwq/Makefile.am b/WebCore/kwq/Makefile.am
index 45a1c88..42d33e7 100644
--- a/WebCore/kwq/Makefile.am
+++ b/WebCore/kwq/Makefile.am
@@ -118,7 +118,6 @@ libkwq_o_SOURCES = \
 	KWQtextcodec.mm \
 	KWQtextstream.mm \
 	KWQxml.mm \
-	_KWQOwner.m \
 	kwqdebug.mm \
 	WKPlugin.mm \
 	WKPluginView.mm \
diff --git a/WebCore/kwq/_KWQOwner.h b/WebCore/kwq/_KWQOwner.h
deleted file mode 100644
index b82670d..0000000
--- a/WebCore/kwq/_KWQOwner.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (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 KWQOWNER_H_
-#define KWQOWNER_H_
-
-#import <Cocoa/Cocoa.h>
-#import <WCBackForwardList.h>
-
- at interface _KWQOwner : NSApplication
-{
-    IBOutlet id window;
-    IBOutlet id containerView;
-    IBOutlet NSProgressIndicator *throbber;
-    IBOutlet NSComboBox *urlBar;
-    IBOutlet NSButton *backButton;
-    IBOutlet NSButton *forwardButton;
-    id <WCBackForwardList> backForwardList;
-}
-
--(void)updateButtons;
-
- at end
-
-#endif
diff --git a/WebCore/kwq/_KWQOwner.m b/WebCore/kwq/_KWQOwner.m
deleted file mode 100644
index 7063f8f..0000000
--- a/WebCore/kwq/_KWQOwner.m
+++ /dev/null
@@ -1,140 +0,0 @@
-// This class is a temporary hack for our test apps.
-
-#import "_KWQOwner.h"
-
- at interface KWQHTMLView : NSView
-- (void)setURL: (NSString *)urlString;
- at end
-
-static BOOL flag = NO;
-
- at implementation _KWQOwner
-
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
-{
-    NSLog (@"Did finish launching\n", nil);
-}
-
-- changeURL: sender
-{
-    // Get the 
-    NSString *url = [sender stringValue];
-    KWQHTMLView *htmlView;
-    NSArray *subs;
-    
-    if (!flag) {
-        flag = YES;
-        backForwardList = WCCreateBackForwardList();
-        [self updateButtons];
-        [throbber setUsesThreadedAnimation:YES];
-        [[NSNotificationCenter defaultCenter] addObserver:self
-            selector:@selector(uriClick:) name:@"uri-click" object:nil];
-    }
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-        selector:@selector(newUriDone:) name:@"uri-done" object:nil];
-    
-    subs = [containerView subviews];
-    htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
-    [htmlView setURL: url];
-    [throbber startAnimation:self];
-       
-    return self;
-}
-
--(void)back:(id)sender
-{
-    NSString *url;
-    KWQHTMLView *htmlView;
-    NSArray *subs;
-    id <WCURIEntry> entry;
- 
-    entry = [backForwardList back];
-    url = [[entry url] absoluteString];
-    [urlBar setStringValue:url];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-        selector:@selector(backForwardUriDone:) name:@"uri-done" object:nil];
-    
-    subs = [containerView subviews];
-    htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
-    [htmlView setURL: url];
-    [throbber startAnimation:self];
-}
-
--(void)forward:(id)sender
-{
-    NSString *url;
-    KWQHTMLView *htmlView;
-    NSArray *subs;
-    id <WCURIEntry> entry;
-    
-    entry = [backForwardList forward];
-    url = [[entry url] absoluteString];
-    [urlBar setStringValue:url];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-        selector:@selector(backForwardUriDone:) name:@"uri-done" object:nil];
-    
-    subs = [containerView subviews];
-    htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
-    [htmlView setURL: url];
-    [throbber startAnimation:self];
-}
-
--(void)uriClick:(NSNotification *)notification
-{
-    [[NSNotificationCenter defaultCenter] addObserver:self
-        selector:@selector(newUriDone:) name:@"uri-done" object:nil];
-    [urlBar setStringValue:[notification object]];
-    [throbber startAnimation:self];
-}
-
--(void)backForwardUriDone:(NSNotification *)notification
-{
-    NSString *uriString;
-    
-    uriString = [notification object];
-
-    [[NSNotificationCenter defaultCenter] removeObserver:self 
-        name:@"uri-done" object:nil];
-
-    [self updateButtons];
-    [throbber stopAnimation:self];
-}
-
--(void)newUriDone:(NSNotification *)notification
-{
-    NSString *uriString;
-    id <WCURIEntry> entry;
-    
-    uriString = [notification object];
-
-    entry = WCCreateURIEntry();
-    [entry setURL:[NSURL URLWithString:uriString]];
-    [backForwardList addEntry: entry];
-
-    [[NSNotificationCenter defaultCenter] removeObserver:self 
-        name:@"uri-done" object:nil];
-
-    [self updateButtons];
-    [throbber stopAnimation:self];
-}
-
--(void)updateButtons
-{
-    if ([backForwardList canGoBack]) {
-        [backButton setEnabled: YES];
-    }
-    else {
-        [backButton setEnabled: NO];
-    }
-    if ([backForwardList canGoForward]) {
-        [forwardButton setEnabled: YES];
-    }
-    else {
-        [forwardButton setEnabled: NO];
-    }
-}
-
- at end
diff --git a/WebCore/kwq/qt/qnamespace.h b/WebCore/kwq/qt/qnamespace.h
index 6a63c17..0cfc272 100644
--- a/WebCore/kwq/qt/qnamespace.h
+++ b/WebCore/kwq/qt/qnamespace.h
@@ -249,6 +249,7 @@ public:
 
     // constants ---------------------------------------------------------------
 
+
     QT_STATIC_CONST QColor &color0;
     QT_STATIC_CONST QColor &color1;
     QT_STATIC_CONST QColor &black;
diff --git a/WebCore/src/kwq/KWQApplication.mm b/WebCore/src/kwq/KWQApplication.mm
index fa40d6e..9294a4c 100644
--- a/WebCore/src/kwq/KWQApplication.mm
+++ b/WebCore/src/kwq/KWQApplication.mm
@@ -27,8 +27,6 @@
 #include <qapplication.h>
 #include <qpalette.h>
 
-#import "_KWQOwner.h"
-
 // FIXME: 
 static QPalette *DEFAULT_PALETTE = NULL;
 static QSize *DEFAULT_SIZE = NULL;
@@ -100,10 +98,13 @@ void QApplication::sendPostedEvents(QObject *receiver, int event_type)
 
 QApplication::QApplication( int &argc, char **argv)
 {
+#ifdef TRANSITIONAL_CODE
     _initialize();
+#endif    
 }
 
 
+#ifdef TRANSITIONAL_CODE
 void QApplication::_initialize(){
     NSDictionary *info;
     NSString *principalClassName;
@@ -127,6 +128,7 @@ void QApplication::_initialize(){
     //  Force linkage
     [_KWQOwner class];
 }
+#endif
 
 
 QApplication::~QApplication()
@@ -137,6 +139,7 @@ QApplication::~QApplication()
 
 void QApplication::setMainWidget(QWidget *w)
 {
+#ifdef TRANSITIONAL_CODE
     NSRect b = [((_KWQOwner *)application)->containerView bounds];
     
     if (application == nil){
@@ -156,22 +159,29 @@ void QApplication::setMainWidget(QWidget *w)
     [sv setHasHorizontalScroller: YES];
     [w->getView() setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
     [sv setDocumentView: w->getView()];
-    
     [((_KWQOwner *)application)->window setOpaque: FALSE];
     //[((_KWQOwner *)application)->window setAlphaValue: (float)0.8];
     
      
     [((_KWQOwner *)application)->containerView addSubview: sv];
+#else
+    [NSException raise:@"Not implemented" format:@"QApplication::setMainWidget(QWidget *) is not implemented"];
+#endif
 }
 
 
 int QApplication::exec()
 {
+#ifdef TRANSITIONAL_CODE
     if (application == nil){
         KWQDEBUGLEVEL(KWQ_LOG_ERROR, "ERROR: QApplication::exec() application not set.\n");
         return 0;
     }
     [application run];
     return 1;
+#else
+    [NSException raise:@"Not implemented" format:@"QApplication::exec() is not implemented"];
+    return 0;
+#endif
 }
 
diff --git a/WebCore/src/kwq/KWQRegion.mm b/WebCore/src/kwq/KWQRegion.mm
index eccd709..f66bb3d 100644
--- a/WebCore/src/kwq/KWQRegion.mm
+++ b/WebCore/src/kwq/KWQRegion.mm
@@ -37,7 +37,8 @@ void QRegion::_initialize() {
 QRegion::QRegion()
 {
     _initialize();
-    data->path = [[NSBezierPath bezierPath] retain];
+    // Create lazily - RJW
+    //data->path = [[NSBezierPath bezierPath] retain];
 }
 
 QRegion::QRegion(const QRect &rect)
@@ -83,7 +84,8 @@ QRegion::QRegion(const QRegion &other)
 
 QRegion::~QRegion()
 {
-    [data->path release];
+    if (data->path)
+        [data->path release];
     free(data);
 }
 
@@ -99,12 +101,16 @@ bool QRegion::contains(const QPoint &point) const
 
     nspoint = NSMakePoint(point.x(), point.y());
     
-    return [data->path containsPoint:nspoint] ? 1 : 0;
+    if (data->path)
+        return [data->path containsPoint:nspoint] ? 1 : 0;
+    return 0;
 }
 
 bool QRegion::isNull() const
 {
-    return [data->path elementCount] == 0 ? 1 : 0;
+    if (data->path)
+        return [data->path elementCount] == 0 ? 1 : 0;
+    return 1;
 }
 
 QRegion &QRegion::operator=(const QRegion &other)
diff --git a/WebCore/src/kwq/Makefile.am b/WebCore/src/kwq/Makefile.am
index 45a1c88..42d33e7 100644
--- a/WebCore/src/kwq/Makefile.am
+++ b/WebCore/src/kwq/Makefile.am
@@ -118,7 +118,6 @@ libkwq_o_SOURCES = \
 	KWQtextcodec.mm \
 	KWQtextstream.mm \
 	KWQxml.mm \
-	_KWQOwner.m \
 	kwqdebug.mm \
 	WKPlugin.mm \
 	WKPluginView.mm \
diff --git a/WebCore/src/kwq/_KWQOwner.h b/WebCore/src/kwq/_KWQOwner.h
deleted file mode 100644
index b82670d..0000000
--- a/WebCore/src/kwq/_KWQOwner.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (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 KWQOWNER_H_
-#define KWQOWNER_H_
-
-#import <Cocoa/Cocoa.h>
-#import <WCBackForwardList.h>
-
- at interface _KWQOwner : NSApplication
-{
-    IBOutlet id window;
-    IBOutlet id containerView;
-    IBOutlet NSProgressIndicator *throbber;
-    IBOutlet NSComboBox *urlBar;
-    IBOutlet NSButton *backButton;
-    IBOutlet NSButton *forwardButton;
-    id <WCBackForwardList> backForwardList;
-}
-
--(void)updateButtons;
-
- at end
-
-#endif
diff --git a/WebCore/src/kwq/_KWQOwner.m b/WebCore/src/kwq/_KWQOwner.m
deleted file mode 100644
index 7063f8f..0000000
--- a/WebCore/src/kwq/_KWQOwner.m
+++ /dev/null
@@ -1,140 +0,0 @@
-// This class is a temporary hack for our test apps.
-
-#import "_KWQOwner.h"
-
- at interface KWQHTMLView : NSView
-- (void)setURL: (NSString *)urlString;
- at end
-
-static BOOL flag = NO;
-
- at implementation _KWQOwner
-
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
-{
-    NSLog (@"Did finish launching\n", nil);
-}
-
-- changeURL: sender
-{
-    // Get the 
-    NSString *url = [sender stringValue];
-    KWQHTMLView *htmlView;
-    NSArray *subs;
-    
-    if (!flag) {
-        flag = YES;
-        backForwardList = WCCreateBackForwardList();
-        [self updateButtons];
-        [throbber setUsesThreadedAnimation:YES];
-        [[NSNotificationCenter defaultCenter] addObserver:self
-            selector:@selector(uriClick:) name:@"uri-click" object:nil];
-    }
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-        selector:@selector(newUriDone:) name:@"uri-done" object:nil];
-    
-    subs = [containerView subviews];
-    htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
-    [htmlView setURL: url];
-    [throbber startAnimation:self];
-       
-    return self;
-}
-
--(void)back:(id)sender
-{
-    NSString *url;
-    KWQHTMLView *htmlView;
-    NSArray *subs;
-    id <WCURIEntry> entry;
- 
-    entry = [backForwardList back];
-    url = [[entry url] absoluteString];
-    [urlBar setStringValue:url];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-        selector:@selector(backForwardUriDone:) name:@"uri-done" object:nil];
-    
-    subs = [containerView subviews];
-    htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
-    [htmlView setURL: url];
-    [throbber startAnimation:self];
-}
-
--(void)forward:(id)sender
-{
-    NSString *url;
-    KWQHTMLView *htmlView;
-    NSArray *subs;
-    id <WCURIEntry> entry;
-    
-    entry = [backForwardList forward];
-    url = [[entry url] absoluteString];
-    [urlBar setStringValue:url];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-        selector:@selector(backForwardUriDone:) name:@"uri-done" object:nil];
-    
-    subs = [containerView subviews];
-    htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
-    [htmlView setURL: url];
-    [throbber startAnimation:self];
-}
-
--(void)uriClick:(NSNotification *)notification
-{
-    [[NSNotificationCenter defaultCenter] addObserver:self
-        selector:@selector(newUriDone:) name:@"uri-done" object:nil];
-    [urlBar setStringValue:[notification object]];
-    [throbber startAnimation:self];
-}
-
--(void)backForwardUriDone:(NSNotification *)notification
-{
-    NSString *uriString;
-    
-    uriString = [notification object];
-
-    [[NSNotificationCenter defaultCenter] removeObserver:self 
-        name:@"uri-done" object:nil];
-
-    [self updateButtons];
-    [throbber stopAnimation:self];
-}
-
--(void)newUriDone:(NSNotification *)notification
-{
-    NSString *uriString;
-    id <WCURIEntry> entry;
-    
-    uriString = [notification object];
-
-    entry = WCCreateURIEntry();
-    [entry setURL:[NSURL URLWithString:uriString]];
-    [backForwardList addEntry: entry];
-
-    [[NSNotificationCenter defaultCenter] removeObserver:self 
-        name:@"uri-done" object:nil];
-
-    [self updateButtons];
-    [throbber stopAnimation:self];
-}
-
--(void)updateButtons
-{
-    if ([backForwardList canGoBack]) {
-        [backButton setEnabled: YES];
-    }
-    else {
-        [backButton setEnabled: NO];
-    }
-    if ([backForwardList canGoForward]) {
-        [forwardButton setEnabled: YES];
-    }
-    else {
-        [forwardButton setEnabled: NO];
-    }
-}
-
- at end
diff --git a/WebCore/src/kwq/qt/qnamespace.h b/WebCore/src/kwq/qt/qnamespace.h
index 6a63c17..0cfc272 100644
--- a/WebCore/src/kwq/qt/qnamespace.h
+++ b/WebCore/src/kwq/qt/qnamespace.h
@@ -249,6 +249,7 @@ public:
 
     // constants ---------------------------------------------------------------
 
+
     QT_STATIC_CONST QColor &color0;
     QT_STATIC_CONST QColor &color1;
     QT_STATIC_CONST QColor &black;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 49eab83..35dc441 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,79 @@
+2002-01-18  Richard Williamson  <rjw at apple.com>
+
+    First pass at new view/datasource/controller API.
+    
+	* Misc.subproj/WKException.h:
+	* Misc.subproj/WKException.m:
+	* WebKit.pbproj/project.pbxproj:
+	* WebView.subproj/WKDefaultWebController.h:
+	* WebView.subproj/WKDefaultWebController.mm: (+[WKObjectHolder
+	holderWithObject:]), (-[WKObjectHolder initWithObject:]), (-[WKObjectHolder
+	dealloc]), (-[WKObjectHolder copyWithZone:]), (-[WKObjectHolder hash]),
+	(-[WKObjectHolder object]), (-[WKObjectHolder isEqual:]),
+	(-[WKDefaultWebController initWithView:dataSource:]), (-[WKDefaultWebController
+	dealloc]), (-[WKDefaultWebController setDirectsAllLinksToSystemBrowser:]),
+	(-[WKDefaultWebController directsAllLinksToSystemBrowser]),
+	(-[WKDefaultWebController setView:andDataSource:]), (-[WKDefaultWebController
+	viewForDataSource:]), (-[WKDefaultWebController dataSourceForView:]),
+	(-[WKDefaultWebController mainView]), (-[WKDefaultWebController mainDataSource]),
+	(-[WKDefaultWebController createViewForDataSource:inFrameNamed:]),
+	(-[WKDefaultWebController createViewForDataSource:inIFrame:]),
+	(-[WKDefaultWebController setStatusText:forDataSource:]),
+	(-[WKDefaultWebController statusTextForDataSource:]), (-[WKDefaultWebController
+	authenticate:]), (-[WKDefaultWebController
+	receivedProgress:forResource:fromDataSource:]), (-[WKDefaultWebController
+	receivedError:forResource:partialProgress:fromDataSource:]),
+	(-[WKDefaultWebController locationWillChangeTo:]), (-[WKDefaultWebController
+	locationChangeStartedForDataSource:]), (-[WKDefaultWebController
+	locationChangeInProgressForDataSource:]), (-[WKDefaultWebController
+	locationChangeDone:forDataSource:]), (-[WKDefaultWebController
+	receivedPageTitle:forDataSource:]), (-[WKDefaultWebController
+	serverRedirectTo:forDataSource:]):
+	* WebView.subproj/WKDefaultWebControllerPrivate.h:
+	* WebView.subproj/WKDefaultWebControllerPrivate.mm:
+	(-[WKDefaultWebControllerPrivate init]), (-[WKDefaultWebControllerPrivate
+	dealloc]):
+	* WebView.subproj/WKWebController.h:
+	* WebView.subproj/WKWebController.mm:
+	* WebView.subproj/WKWebDataSource.h:
+	* WebView.subproj/WKWebDataSource.mm: (-[WKWebDataSource _commonInitialization]),
+	(-[WKWebDataSource initWithURL:]), (-[WKWebDataSource parent]),
+	(-[WKWebDataSource isMainDocument]), (-[WKWebDataSource children]),
+	(-[WKWebDataSource frameNames]), (-[WKWebDataSource
+	findDataSourceForFrameNamed:]), (-[WKWebDataSource frameExists:]),
+	(-[WKWebDataSource openURL:inFrameNamed:]), (-[WKWebDataSource
+	openURL:inIFrame:]), (-[WKWebDataSource controller]), (-[WKWebDataSource
+	inputURL]), (-[WKWebDataSource finalURL]), (-[WKWebDataSource wasRedirected]),
+	(-[WKWebDataSource startLoading:]), (-[WKWebDataSource stopLoading]),
+	(-[WKWebDataSource isLoading]), (-[WKWebDataSource documentText]),
+	(-[WKWebDataSource base]), (-[WKWebDataSource baseTarget]), (-[WKWebDataSource
+	encoding]), (-[WKWebDataSource setUserStyleSheetFromURL:]), (-[WKWebDataSource
+	setUserStyleSheetFromString:]), (-[WKWebDataSource icon]), (-[WKWebDataSource
+	isPageSecure]), (-[WKWebDataSource pageTitle]):
+	* WebView.subproj/WKWebDataSourcePrivate.h:
+	* WebView.subproj/WKWebDataSourcePrivate.mm: (-[WKWebDataSourcePrivate init]),
+	(-[WKWebDataSourcePrivate dealloc]), (-[WKWebDataSource _setController:]),
+	(-[WKWebDataSource _part]):
+	* WebView.subproj/WKWebView.h:
+	* WebView.subproj/WKWebView.mm: (-[WKWebView initWithFrame:]), (-[WKWebView
+	dealloc]), (-[WKWebView controller]), (-[WKWebView dataSourceChanged]),
+	(-[WKWebView layout]), (-[WKWebView stopAnimations]), (-[WKWebView
+	setFontSizes:]), (-[WKWebView fontSizes]), (-[WKWebView resetFontSizes]),
+	(-[WKWebView setStandardFont:]), (-[WKWebView standardFont]), (-[WKWebView
+	setFixedFont:]), (-[WKWebView fixedFont]), (-[WKWebView setCanDragFrom:]),
+	(-[WKWebView canDragFrom]), (-[WKWebView setCanDragTo:]), (-[WKWebView
+	canDragTo]), (-[WKWebView defaultContextMenuItemsForNode:]), (-[WKWebView
+	setContextMenusEnabled:]), (-[WKWebView deselectText]), (-[WKWebView
+	searchFor:direction:caseSensitive:]), (-[WKWebView selectedText]), (-[WKWebView
+	delayLayout:]), (-[WKWebView notificationReceived:]), (-[WKWebView
+	setNeedsLayout:]), (-[WKWebView drawRect:]), (-[WKWebView setIsFlipped:]),
+	(-[WKWebView isFlipped]), (-[WKWebView setFrame:]), (-[WKWebView mouseUp:]),
+	(-[WKWebView mouseDown:]), (-[WKWebView mouseDragged:]):
+	* WebView.subproj/WKWebViewPrivate.h:
+	* WebView.subproj/WKWebViewPrivate.mm: (-[WKWebViewPrivate init]),
+	(-[WKWebViewPrivate dealloc]), (-[WKWebView _resetView]), (-[WKWebView
+	_setController:]):
+
 2002-01-14  Maciej Stachowiak  <mjs at apple.com>
 
 	Convert build system to automake
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 49eab83..35dc441 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,79 @@
+2002-01-18  Richard Williamson  <rjw at apple.com>
+
+    First pass at new view/datasource/controller API.
+    
+	* Misc.subproj/WKException.h:
+	* Misc.subproj/WKException.m:
+	* WebKit.pbproj/project.pbxproj:
+	* WebView.subproj/WKDefaultWebController.h:
+	* WebView.subproj/WKDefaultWebController.mm: (+[WKObjectHolder
+	holderWithObject:]), (-[WKObjectHolder initWithObject:]), (-[WKObjectHolder
+	dealloc]), (-[WKObjectHolder copyWithZone:]), (-[WKObjectHolder hash]),
+	(-[WKObjectHolder object]), (-[WKObjectHolder isEqual:]),
+	(-[WKDefaultWebController initWithView:dataSource:]), (-[WKDefaultWebController
+	dealloc]), (-[WKDefaultWebController setDirectsAllLinksToSystemBrowser:]),
+	(-[WKDefaultWebController directsAllLinksToSystemBrowser]),
+	(-[WKDefaultWebController setView:andDataSource:]), (-[WKDefaultWebController
+	viewForDataSource:]), (-[WKDefaultWebController dataSourceForView:]),
+	(-[WKDefaultWebController mainView]), (-[WKDefaultWebController mainDataSource]),
+	(-[WKDefaultWebController createViewForDataSource:inFrameNamed:]),
+	(-[WKDefaultWebController createViewForDataSource:inIFrame:]),
+	(-[WKDefaultWebController setStatusText:forDataSource:]),
+	(-[WKDefaultWebController statusTextForDataSource:]), (-[WKDefaultWebController
+	authenticate:]), (-[WKDefaultWebController
+	receivedProgress:forResource:fromDataSource:]), (-[WKDefaultWebController
+	receivedError:forResource:partialProgress:fromDataSource:]),
+	(-[WKDefaultWebController locationWillChangeTo:]), (-[WKDefaultWebController
+	locationChangeStartedForDataSource:]), (-[WKDefaultWebController
+	locationChangeInProgressForDataSource:]), (-[WKDefaultWebController
+	locationChangeDone:forDataSource:]), (-[WKDefaultWebController
+	receivedPageTitle:forDataSource:]), (-[WKDefaultWebController
+	serverRedirectTo:forDataSource:]):
+	* WebView.subproj/WKDefaultWebControllerPrivate.h:
+	* WebView.subproj/WKDefaultWebControllerPrivate.mm:
+	(-[WKDefaultWebControllerPrivate init]), (-[WKDefaultWebControllerPrivate
+	dealloc]):
+	* WebView.subproj/WKWebController.h:
+	* WebView.subproj/WKWebController.mm:
+	* WebView.subproj/WKWebDataSource.h:
+	* WebView.subproj/WKWebDataSource.mm: (-[WKWebDataSource _commonInitialization]),
+	(-[WKWebDataSource initWithURL:]), (-[WKWebDataSource parent]),
+	(-[WKWebDataSource isMainDocument]), (-[WKWebDataSource children]),
+	(-[WKWebDataSource frameNames]), (-[WKWebDataSource
+	findDataSourceForFrameNamed:]), (-[WKWebDataSource frameExists:]),
+	(-[WKWebDataSource openURL:inFrameNamed:]), (-[WKWebDataSource
+	openURL:inIFrame:]), (-[WKWebDataSource controller]), (-[WKWebDataSource
+	inputURL]), (-[WKWebDataSource finalURL]), (-[WKWebDataSource wasRedirected]),
+	(-[WKWebDataSource startLoading:]), (-[WKWebDataSource stopLoading]),
+	(-[WKWebDataSource isLoading]), (-[WKWebDataSource documentText]),
+	(-[WKWebDataSource base]), (-[WKWebDataSource baseTarget]), (-[WKWebDataSource
+	encoding]), (-[WKWebDataSource setUserStyleSheetFromURL:]), (-[WKWebDataSource
+	setUserStyleSheetFromString:]), (-[WKWebDataSource icon]), (-[WKWebDataSource
+	isPageSecure]), (-[WKWebDataSource pageTitle]):
+	* WebView.subproj/WKWebDataSourcePrivate.h:
+	* WebView.subproj/WKWebDataSourcePrivate.mm: (-[WKWebDataSourcePrivate init]),
+	(-[WKWebDataSourcePrivate dealloc]), (-[WKWebDataSource _setController:]),
+	(-[WKWebDataSource _part]):
+	* WebView.subproj/WKWebView.h:
+	* WebView.subproj/WKWebView.mm: (-[WKWebView initWithFrame:]), (-[WKWebView
+	dealloc]), (-[WKWebView controller]), (-[WKWebView dataSourceChanged]),
+	(-[WKWebView layout]), (-[WKWebView stopAnimations]), (-[WKWebView
+	setFontSizes:]), (-[WKWebView fontSizes]), (-[WKWebView resetFontSizes]),
+	(-[WKWebView setStandardFont:]), (-[WKWebView standardFont]), (-[WKWebView
+	setFixedFont:]), (-[WKWebView fixedFont]), (-[WKWebView setCanDragFrom:]),
+	(-[WKWebView canDragFrom]), (-[WKWebView setCanDragTo:]), (-[WKWebView
+	canDragTo]), (-[WKWebView defaultContextMenuItemsForNode:]), (-[WKWebView
+	setContextMenusEnabled:]), (-[WKWebView deselectText]), (-[WKWebView
+	searchFor:direction:caseSensitive:]), (-[WKWebView selectedText]), (-[WKWebView
+	delayLayout:]), (-[WKWebView notificationReceived:]), (-[WKWebView
+	setNeedsLayout:]), (-[WKWebView drawRect:]), (-[WKWebView setIsFlipped:]),
+	(-[WKWebView isFlipped]), (-[WKWebView setFrame:]), (-[WKWebView mouseUp:]),
+	(-[WKWebView mouseDown:]), (-[WKWebView mouseDragged:]):
+	* WebView.subproj/WKWebViewPrivate.h:
+	* WebView.subproj/WKWebViewPrivate.mm: (-[WKWebViewPrivate init]),
+	(-[WKWebViewPrivate dealloc]), (-[WKWebView _resetView]), (-[WKWebView
+	_setController:]):
+
 2002-01-14  Maciej Stachowiak  <mjs at apple.com>
 
 	Convert build system to automake
diff --git a/WebCore/kwq/qt/qintcache.h b/WebKit/Misc.subproj/IFException.h
similarity index 90%
copy from WebCore/kwq/qt/qintcache.h
copy to WebKit/Misc.subproj/IFException.h
index 8ac1b75..60522ae 100644
--- a/WebCore/kwq/qt/qintcache.h
+++ b/WebKit/Misc.subproj/IFException.h
@@ -22,12 +22,10 @@
  * (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 _WKEXCEPTION_H
+#define _WKEXCEPTION_H
 
-#ifndef QINTCACHE_H_
-#define QINTCACHE_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+extern NSString * const WKMethodNotYetImplemented;
+extern NSString * const WKRuntimeError;
 
 #endif
diff --git a/WebCore/kwq/KWQKWin.mm b/WebKit/Misc.subproj/IFException.m
similarity index 89%
copy from WebCore/kwq/KWQKWin.mm
copy to WebKit/Misc.subproj/IFException.m
index 3c741b4..b2b54d4 100644
--- a/WebCore/kwq/KWQKWin.mm
+++ b/WebKit/Misc.subproj/IFException.m
@@ -22,14 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
+#import <Cocoa/Cocoa.h>
 
-#include <kwin.h>
-
-#include <kwqdebug.h>
-
-KWin::Info KWin::info(int win)
-{
-    _logNotYetImplemented();
-    KWin::Info result;
-    return result;
-}
+NSString * const WKMethodNotYetImplemented = @"WKMethodNotYetImplemented";
+NSString * const WKRuntimeError = @"WKRuntimeError";
diff --git a/WebCore/kwq/qt/qintcache.h b/WebKit/Misc.subproj/WKException.h
similarity index 90%
copy from WebCore/kwq/qt/qintcache.h
copy to WebKit/Misc.subproj/WKException.h
index 8ac1b75..60522ae 100644
--- a/WebCore/kwq/qt/qintcache.h
+++ b/WebKit/Misc.subproj/WKException.h
@@ -22,12 +22,10 @@
  * (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 _WKEXCEPTION_H
+#define _WKEXCEPTION_H
 
-#ifndef QINTCACHE_H_
-#define QINTCACHE_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+extern NSString * const WKMethodNotYetImplemented;
+extern NSString * const WKRuntimeError;
 
 #endif
diff --git a/WebCore/kwq/KWQKWin.mm b/WebKit/Misc.subproj/WKException.m
similarity index 89%
copy from WebCore/kwq/KWQKWin.mm
copy to WebKit/Misc.subproj/WKException.m
index 3c741b4..b2b54d4 100644
--- a/WebCore/kwq/KWQKWin.mm
+++ b/WebKit/Misc.subproj/WKException.m
@@ -22,14 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
+#import <Cocoa/Cocoa.h>
 
-#include <kwin.h>
-
-#include <kwqdebug.h>
-
-KWin::Info KWin::info(int win)
-{
-    _logNotYetImplemented();
-    KWin::Info result;
-    return result;
-}
+NSString * const WKMethodNotYetImplemented = @"WKMethodNotYetImplemented";
+NSString * const WKRuntimeError = @"WKRuntimeError";
diff --git a/WebCore/kwq/qt/qintcache.h b/WebKit/Misc.subproj/WebException.h
similarity index 90%
copy from WebCore/kwq/qt/qintcache.h
copy to WebKit/Misc.subproj/WebException.h
index 8ac1b75..60522ae 100644
--- a/WebCore/kwq/qt/qintcache.h
+++ b/WebKit/Misc.subproj/WebException.h
@@ -22,12 +22,10 @@
  * (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 _WKEXCEPTION_H
+#define _WKEXCEPTION_H
 
-#ifndef QINTCACHE_H_
-#define QINTCACHE_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+extern NSString * const WKMethodNotYetImplemented;
+extern NSString * const WKRuntimeError;
 
 #endif
diff --git a/WebCore/kwq/KWQKWin.mm b/WebKit/Misc.subproj/WebException.m
similarity index 89%
copy from WebCore/kwq/KWQKWin.mm
copy to WebKit/Misc.subproj/WebException.m
index 3c741b4..b2b54d4 100644
--- a/WebCore/kwq/KWQKWin.mm
+++ b/WebKit/Misc.subproj/WebException.m
@@ -22,14 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
+#import <Cocoa/Cocoa.h>
 
-#include <kwin.h>
-
-#include <kwqdebug.h>
-
-KWin::Info KWin::info(int win)
-{
-    _logNotYetImplemented();
-    KWin::Info result;
-    return result;
-}
+NSString * const WKMethodNotYetImplemented = @"WKMethodNotYetImplemented";
+NSString * const WKRuntimeError = @"WKRuntimeError";
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 5b90451..376f00a 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -124,8 +124,8 @@
 				HEADER_SEARCH_PATHS = ../WebCore/include;
 				INSTALL_PATH = "@executable_path/../Frameworks";
 				LIBRARY_SEARCH_PATHS = "";
-				OTHER_CFLAGS = "-Wall -Werror -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare";
-				OTHER_LDFLAGS = "-ljpeg -lwebcore";
+				OTHER_CFLAGS = "-Wall -Werror -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -DHAVE_CONFIG_H -DQT_NO_DATASTREAM -D_KWQ_  -I.. -I../WebCore/src/kdelibs/khtml -I../WebCore/src/kwq -I../WebCore/src/kwq/kparts -I../WebCore/include -I../WebCore/include/private";
+				OTHER_LDFLAGS = "-lwebcore";
 				PRODUCT_NAME = WebKit;
 				SECTORDER_FLAGS = "";
 				WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
@@ -191,6 +191,9 @@
 				9C04853101CFFD060ECA16EA,
 				9C04853201CFFD060ECA16EA,
 				9C04853301CFFD060ECA16EA,
+				9C64424901F790750ECA16EA,
+				9C64424F01F7AF2D0ECA16EA,
+				9C64425001F7AF2D0ECA16EA,
 			);
 			isa = PBXHeadersBuildPhase;
 			name = Headers;
@@ -218,7 +221,12 @@
 				25A8177401B698760ECA149E,
 				25A8177801B6A5240ECA149E,
 				9C04852A01CFF9CE0ECA16EA,
-				9C04852B01CFF9CE0ECA16EA,
+				9C64424601F78B4B0ECA16EA,
+				9C64424A01F790750ECA16EA,
+				9C64425101F7AF2D0ECA16EA,
+				9C64425201F7AF2D0ECA16EA,
+				9C64425401F7B1740ECA16EA,
+				9C64425601F7B4E20ECA16EA,
 			);
 			isa = PBXSourcesBuildPhase;
 			name = Sources;
@@ -360,6 +368,8 @@
 				2568C72B017491070ECA149E,
 				25A5593101A5996D0ECA149E,
 				25A5593201A5996D0ECA149E,
+				9C64424701F790750ECA16EA,
+				9C64424801F790750ECA16EA,
 			);
 			isa = PBXGroup;
 			name = Misc;
@@ -797,12 +807,6 @@
 			path = WebView.subproj/WKWebView.h;
 			refType = 2;
 		};
-		9C04852301CFF9CE0ECA16EA = {
-			isa = PBXFileReference;
-			name = WKWebController.mm;
-			path = WebView.subproj/WKWebController.mm;
-			refType = 2;
-		};
 		9C04852401CFF9CE0ECA16EA = {
 			isa = PBXFileReference;
 			name = WKWebViewPrivate.h;
@@ -860,12 +864,6 @@
 			settings = {
 			};
 		};
-		9C04852B01CFF9CE0ECA16EA = {
-			fileRef = 9C04852301CFF9CE0ECA16EA;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
 		9C04852C01CFFD060ECA16EA = {
 			isa = PBXFileReference;
 			name = WKLoadChunk.h;
@@ -926,6 +924,123 @@
 				);
 			};
 		};
+		9C64424501F78B4B0ECA16EA = {
+			isa = PBXFileReference;
+			name = WKWebViewPrivate.mm;
+			path = WebView.subproj/WKWebViewPrivate.mm;
+			refType = 2;
+		};
+		9C64424601F78B4B0ECA16EA = {
+			fileRef = 9C64424501F78B4B0ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		9C64424701F790750ECA16EA = {
+			isa = PBXFileReference;
+			name = WKException.h;
+			path = Misc.subproj/WKException.h;
+			refType = 2;
+		};
+		9C64424801F790750ECA16EA = {
+			isa = PBXFileReference;
+			name = WKException.m;
+			path = Misc.subproj/WKException.m;
+			refType = 2;
+		};
+		9C64424901F790750ECA16EA = {
+			fileRef = 9C64424701F790750ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Public,
+				);
+			};
+		};
+		9C64424A01F790750ECA16EA = {
+			fileRef = 9C64424801F790750ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		9C64424B01F7AF2D0ECA16EA = {
+			isa = PBXFileReference;
+			name = WKDefaultWebController.h;
+			path = WebView.subproj/WKDefaultWebController.h;
+			refType = 2;
+		};
+		9C64424C01F7AF2D0ECA16EA = {
+			isa = PBXFileReference;
+			name = WKDefaultWebController.mm;
+			path = WebView.subproj/WKDefaultWebController.mm;
+			refType = 2;
+		};
+		9C64424D01F7AF2D0ECA16EA = {
+			isa = PBXFileReference;
+			name = WKDefaultWebControllerPrivate.h;
+			path = WebView.subproj/WKDefaultWebControllerPrivate.h;
+			refType = 2;
+		};
+		9C64424E01F7AF2D0ECA16EA = {
+			isa = PBXFileReference;
+			name = WKDefaultWebControllerPrivate.mm;
+			path = WebView.subproj/WKDefaultWebControllerPrivate.mm;
+			refType = 2;
+		};
+		9C64424F01F7AF2D0ECA16EA = {
+			fileRef = 9C64424B01F7AF2D0ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Public,
+				);
+			};
+		};
+		9C64425001F7AF2D0ECA16EA = {
+			fileRef = 9C64424D01F7AF2D0ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Private,
+				);
+			};
+		};
+		9C64425101F7AF2D0ECA16EA = {
+			fileRef = 9C64424C01F7AF2D0ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		9C64425201F7AF2D0ECA16EA = {
+			fileRef = 9C64424E01F7AF2D0ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		9C64425301F7B1740ECA16EA = {
+			isa = PBXFileReference;
+			name = WKWebDataSourcePrivate.mm;
+			path = WebView.subproj/WKWebDataSourcePrivate.mm;
+			refType = 2;
+		};
+		9C64425401F7B1740ECA16EA = {
+			fileRef = 9C64425301F7B1740ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		9C64425501F7B4E20ECA16EA = {
+			isa = PBXFileReference;
+			name = WKWebView.mm;
+			path = WebView.subproj/WKWebView.mm;
+			refType = 2;
+		};
+		9C64425601F7B4E20ECA16EA = {
+			fileRef = 9C64425501F7B4E20ECA16EA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		9C7CABBB0190A37C0ECA16EA = {
 			children = (
 				9C04851E01CFF9CE0ECA16EA,
@@ -933,8 +1048,14 @@
 				9C04852001CFF9CE0ECA16EA,
 				9C04852101CFF9CE0ECA16EA,
 				9C04852201CFF9CE0ECA16EA,
-				9C04852301CFF9CE0ECA16EA,
 				9C04852401CFF9CE0ECA16EA,
+				9C64424501F78B4B0ECA16EA,
+				9C64424B01F7AF2D0ECA16EA,
+				9C64424C01F7AF2D0ECA16EA,
+				9C64424D01F7AF2D0ECA16EA,
+				9C64424E01F7AF2D0ECA16EA,
+				9C64425301F7B1740ECA16EA,
+				9C64425501F7B4E20ECA16EA,
 			);
 			isa = PBXGroup;
 			name = WebView;
diff --git a/WebKit/WebView.subproj/IFBaseWebController.h b/WebKit/WebView.subproj/IFBaseWebController.h
new file mode 100644
index 0000000..39f4eb7
--- /dev/null
+++ b/WebKit/WebView.subproj/IFBaseWebController.h
@@ -0,0 +1,40 @@
+/*	
+    WKDefaultWebController.mm
+	Copyright 2001, 2002 Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKWebController.h>
+
+
+/*
+*/
+ at interface WKDefaultWebController : NSObject <WKWebController>
+{
+ at private
+    id _controllerPrivate;
+}
+
+
+- initWithView: (WKWebView *)view dataSource: (WKWebDataSource *)dataSource;
+
+- (void)setDirectsAllLinksToSystemBrowser: (BOOL)flag;
+- (BOOL)directsAllLinksToSystemBrowser;
+
+// Sets the mainView and the mainDataSource.
+- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource;
+
+// Find the view for the specified data source.
+- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource;
+
+// Find the data source for the specified view.
+- (WKWebDataSource *)dataSourceForView: (WKWebView *)view;
+
+- (WKWebView *)mainView;
+
+- (void)setMainDataSource: (WKWebDataSource *)dataSource;
+- (WKWebDataSource *)mainDataSource;
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name;
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier;
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFBaseWebController.mm b/WebKit/WebView.subproj/IFBaseWebController.mm
new file mode 100644
index 0000000..7d724ef
--- /dev/null
+++ b/WebKit/WebView.subproj/IFBaseWebController.mm
@@ -0,0 +1,250 @@
+/*	
+    WKDefaultWebController.mm
+	Copyright 2001, 2002 Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKDefaultWebController.h>
+#import <WebKit/WKDefaultWebControllerPrivate.h>
+#import <WebKit/WKWebViewPrivate.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
+
+
+// Used so we can use objects as keys in dictionaries without
+// copying.
+ at interface WKObjectHolder : NSObject
+{
+    id object;
+}
+
++ holderWithObject: o;
+- initWithObject: o;
+- (void)dealloc;
+- object;
+
+ at end
+
+ at implementation WKObjectHolder
+
++ holderWithObject: o
+{
+    return [[[WKObjectHolder alloc] initWithObject: o] autorelease];
+}
+
+- initWithObject: o
+{
+    [super init];
+    object = [o retain];
+    return self;
+}
+
+- (void)dealloc
+{
+    [object release];
+}
+
+- (id)copyWithZone:(NSZone *)zone
+{
+    return [self retain];
+}
+
+- (unsigned)hash
+{
+    return [object hash];
+}
+
+- object
+{
+    return object;
+}
+
+- (BOOL)isEqual:(id)anObject
+{
+    return object == [anObject object];
+}
+
+ at end
+
+
+ at implementation WKDefaultWebController
+
+
+- initWithView: (WKWebView *)view dataSource: (WKWebDataSource *)dataSource
+{
+    [super init];
+    _controllerPrivate = [[WKDefaultWebControllerPrivate alloc] init];
+    [self setView: view andDataSource: dataSource];
+    return self;   
+}
+
+
+- (void)dealloc
+{
+    [_controllerPrivate release];
+}
+
+- (void)setDirectsAllLinksToSystemBrowser: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::setDirectsAllLinksToSystemBrowser: is not implemented"];
+}
+
+
+- (BOOL)directsAllLinksToSystemBrowser
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::directsAllLinksToSystemBrowser is not implemented"];
+    return NO;
+}
+
+
+- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+
+    [data->viewMap release];
+    data->viewMap = [[NSMutableDictionary alloc] init];
+    
+    [data->dataSourceMap release];
+    data->dataSourceMap = [[NSMutableDictionary alloc] init];
+    
+    [data->mainView release];
+    data->mainView = [view retain];
+    [view _setController: self];
+    
+    [data->mainDataSource release];
+    data->mainDataSource = [dataSource retain];
+    [dataSource _setController: self];
+
+    [data->viewMap setObject: dataSource forKey: [WKObjectHolder holderWithObject:view]];
+    [data->dataSourceMap setObject: view forKey: [WKObjectHolder holderWithObject:dataSource]];
+    
+    [view dataSourceChanged];
+}
+
+- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return [data->viewMap objectForKey: dataSource];
+}
+
+
+- (WKWebDataSource *)dataSourceForView: (WKWebView *)view
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return [data->dataSourceMap objectForKey: view];
+}
+
+
+- (WKWebView *)mainView
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return data->mainView;
+}
+
+
+- (void)setMainDataSource: (WKWebDataSource *)dataSource;
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    [self setView: data->mainView andDataSource: dataSource];
+}
+
+- (WKWebDataSource *)mainDataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return data->mainDataSource;
+}
+
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::createViewForDataSource:inFrameNamed: is not implemented"];
+}
+
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::createViewForDataSource:inIFrame: is not implemented"];
+}
+
+
+
+// ---------------------------------------------------------------------
+// WKScriptContextHandler
+// ---------------------------------------------------------------------
+- (void)setStatusText: (NSString *)text forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::setStatusText:forDataSource: is not implemented"];
+}
+
+
+- (NSString *)statusTextForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::statusTextForDataSource: is not implemented"];
+    return nil;
+}
+
+
+// ---------------------------------------------------------------------
+// WKAuthenticationHandler
+// ---------------------------------------------------------------------
+- (WKSimpleAuthenticationResult *) authenticate: (WKSimpleAuthenticationRequest *)request
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::authenticate: is not implemented"];
+    return nil;
+}
+
+
+// ---------------------------------------------------------------------
+// WKLoadHandler
+// ---------------------------------------------------------------------
+- (void)receivedProgress: (WKLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedProgress:forResource:fromDataSource: is not implemented"];
+}
+
+
+- (void)receivedError: (WKError *)error forResource: (NSString *)resourceDescription partialProgress: (WKLoadProgress *)progress fromDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedError:forResource:partialProgress:fromDataSource: is not implemented"];
+}
+
+
+// ---------------------------------------------------------------------
+// WKLocationChangeHandler
+// ---------------------------------------------------------------------
+- (BOOL)locationWillChangeTo: (NSURL *)url
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationWillChangeTo: is not implemented"];
+    return NO;
+}
+
+
+- (void)locationChangeStartedForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationWillChangeTo: is not implemented"];
+}
+
+
+- (void)locationChangeInProgressForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationChangeInProgressForDataSource:forDataSource: is not implemented"];
+}
+
+
+- (void)locationChangeDone: (WKError *)error forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationChangeDone:forDataSource: is not implemented"];
+}
+
+
+- (void)receivedPageTitle: (NSString *)title forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedPageTitle:forDataSource: is not implemented"];
+}
+
+
+- (void)serverRedirectTo: (NSURL *)url forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::serverRedirectTo:forDataSource: is not implemented"];
+}
+
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h
new file mode 100644
index 0000000..2ecf399
--- /dev/null
+++ b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.h
@@ -0,0 +1,17 @@
+/*	
+    WKWebController.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKWebController.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebView.h>
+
+
+ at interface WKDefaultWebControllerPrivate : NSObject
+{
+    WKWebView *mainView;
+    WKWebDataSource *mainDataSource;
+    NSMutableDictionary *viewMap;
+    NSMutableDictionary *dataSourceMap;
+}
+ at end
diff --git a/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
new file mode 100644
index 0000000..52c6d72
--- /dev/null
+++ b/WebKit/WebView.subproj/IFBaseWebControllerPrivate.mm
@@ -0,0 +1,30 @@
+/*	
+    WKWebController.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKDefaultWebControllerPrivate.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebView.h>
+
+
+ at implementation WKDefaultWebControllerPrivate
+
+- init 
+{
+    mainView = nil;
+    mainDataSource = nil;
+    viewMap = nil;
+    dataSourceMap = nil;
+    return self;
+}
+
+- (void)dealloc
+{
+    [mainView release];
+    [mainDataSource release];
+    
+    [viewMap release];
+    [dataSourceMap release];
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/IFDefaultWebController.h b/WebKit/WebView.subproj/IFDefaultWebController.h
new file mode 100644
index 0000000..39f4eb7
--- /dev/null
+++ b/WebKit/WebView.subproj/IFDefaultWebController.h
@@ -0,0 +1,40 @@
+/*	
+    WKDefaultWebController.mm
+	Copyright 2001, 2002 Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKWebController.h>
+
+
+/*
+*/
+ at interface WKDefaultWebController : NSObject <WKWebController>
+{
+ at private
+    id _controllerPrivate;
+}
+
+
+- initWithView: (WKWebView *)view dataSource: (WKWebDataSource *)dataSource;
+
+- (void)setDirectsAllLinksToSystemBrowser: (BOOL)flag;
+- (BOOL)directsAllLinksToSystemBrowser;
+
+// Sets the mainView and the mainDataSource.
+- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource;
+
+// Find the view for the specified data source.
+- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource;
+
+// Find the data source for the specified view.
+- (WKWebDataSource *)dataSourceForView: (WKWebView *)view;
+
+- (WKWebView *)mainView;
+
+- (void)setMainDataSource: (WKWebDataSource *)dataSource;
+- (WKWebDataSource *)mainDataSource;
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name;
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier;
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFDefaultWebController.mm b/WebKit/WebView.subproj/IFDefaultWebController.mm
new file mode 100644
index 0000000..7d724ef
--- /dev/null
+++ b/WebKit/WebView.subproj/IFDefaultWebController.mm
@@ -0,0 +1,250 @@
+/*	
+    WKDefaultWebController.mm
+	Copyright 2001, 2002 Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKDefaultWebController.h>
+#import <WebKit/WKDefaultWebControllerPrivate.h>
+#import <WebKit/WKWebViewPrivate.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
+
+
+// Used so we can use objects as keys in dictionaries without
+// copying.
+ at interface WKObjectHolder : NSObject
+{
+    id object;
+}
+
++ holderWithObject: o;
+- initWithObject: o;
+- (void)dealloc;
+- object;
+
+ at end
+
+ at implementation WKObjectHolder
+
++ holderWithObject: o
+{
+    return [[[WKObjectHolder alloc] initWithObject: o] autorelease];
+}
+
+- initWithObject: o
+{
+    [super init];
+    object = [o retain];
+    return self;
+}
+
+- (void)dealloc
+{
+    [object release];
+}
+
+- (id)copyWithZone:(NSZone *)zone
+{
+    return [self retain];
+}
+
+- (unsigned)hash
+{
+    return [object hash];
+}
+
+- object
+{
+    return object;
+}
+
+- (BOOL)isEqual:(id)anObject
+{
+    return object == [anObject object];
+}
+
+ at end
+
+
+ at implementation WKDefaultWebController
+
+
+- initWithView: (WKWebView *)view dataSource: (WKWebDataSource *)dataSource
+{
+    [super init];
+    _controllerPrivate = [[WKDefaultWebControllerPrivate alloc] init];
+    [self setView: view andDataSource: dataSource];
+    return self;   
+}
+
+
+- (void)dealloc
+{
+    [_controllerPrivate release];
+}
+
+- (void)setDirectsAllLinksToSystemBrowser: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::setDirectsAllLinksToSystemBrowser: is not implemented"];
+}
+
+
+- (BOOL)directsAllLinksToSystemBrowser
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::directsAllLinksToSystemBrowser is not implemented"];
+    return NO;
+}
+
+
+- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+
+    [data->viewMap release];
+    data->viewMap = [[NSMutableDictionary alloc] init];
+    
+    [data->dataSourceMap release];
+    data->dataSourceMap = [[NSMutableDictionary alloc] init];
+    
+    [data->mainView release];
+    data->mainView = [view retain];
+    [view _setController: self];
+    
+    [data->mainDataSource release];
+    data->mainDataSource = [dataSource retain];
+    [dataSource _setController: self];
+
+    [data->viewMap setObject: dataSource forKey: [WKObjectHolder holderWithObject:view]];
+    [data->dataSourceMap setObject: view forKey: [WKObjectHolder holderWithObject:dataSource]];
+    
+    [view dataSourceChanged];
+}
+
+- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return [data->viewMap objectForKey: dataSource];
+}
+
+
+- (WKWebDataSource *)dataSourceForView: (WKWebView *)view
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return [data->dataSourceMap objectForKey: view];
+}
+
+
+- (WKWebView *)mainView
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return data->mainView;
+}
+
+
+- (void)setMainDataSource: (WKWebDataSource *)dataSource;
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    [self setView: data->mainView andDataSource: dataSource];
+}
+
+- (WKWebDataSource *)mainDataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return data->mainDataSource;
+}
+
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::createViewForDataSource:inFrameNamed: is not implemented"];
+}
+
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::createViewForDataSource:inIFrame: is not implemented"];
+}
+
+
+
+// ---------------------------------------------------------------------
+// WKScriptContextHandler
+// ---------------------------------------------------------------------
+- (void)setStatusText: (NSString *)text forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::setStatusText:forDataSource: is not implemented"];
+}
+
+
+- (NSString *)statusTextForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::statusTextForDataSource: is not implemented"];
+    return nil;
+}
+
+
+// ---------------------------------------------------------------------
+// WKAuthenticationHandler
+// ---------------------------------------------------------------------
+- (WKSimpleAuthenticationResult *) authenticate: (WKSimpleAuthenticationRequest *)request
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::authenticate: is not implemented"];
+    return nil;
+}
+
+
+// ---------------------------------------------------------------------
+// WKLoadHandler
+// ---------------------------------------------------------------------
+- (void)receivedProgress: (WKLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedProgress:forResource:fromDataSource: is not implemented"];
+}
+
+
+- (void)receivedError: (WKError *)error forResource: (NSString *)resourceDescription partialProgress: (WKLoadProgress *)progress fromDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedError:forResource:partialProgress:fromDataSource: is not implemented"];
+}
+
+
+// ---------------------------------------------------------------------
+// WKLocationChangeHandler
+// ---------------------------------------------------------------------
+- (BOOL)locationWillChangeTo: (NSURL *)url
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationWillChangeTo: is not implemented"];
+    return NO;
+}
+
+
+- (void)locationChangeStartedForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationWillChangeTo: is not implemented"];
+}
+
+
+- (void)locationChangeInProgressForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationChangeInProgressForDataSource:forDataSource: is not implemented"];
+}
+
+
+- (void)locationChangeDone: (WKError *)error forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationChangeDone:forDataSource: is not implemented"];
+}
+
+
+- (void)receivedPageTitle: (NSString *)title forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedPageTitle:forDataSource: is not implemented"];
+}
+
+
+- (void)serverRedirectTo: (NSURL *)url forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::serverRedirectTo:forDataSource: is not implemented"];
+}
+
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFDefaultWebControllerPrivate.h b/WebKit/WebView.subproj/IFDefaultWebControllerPrivate.h
new file mode 100644
index 0000000..2ecf399
--- /dev/null
+++ b/WebKit/WebView.subproj/IFDefaultWebControllerPrivate.h
@@ -0,0 +1,17 @@
+/*	
+    WKWebController.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKWebController.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebView.h>
+
+
+ at interface WKDefaultWebControllerPrivate : NSObject
+{
+    WKWebView *mainView;
+    WKWebDataSource *mainDataSource;
+    NSMutableDictionary *viewMap;
+    NSMutableDictionary *dataSourceMap;
+}
+ at end
diff --git a/WebKit/WebView.subproj/IFDefaultWebControllerPrivate.mm b/WebKit/WebView.subproj/IFDefaultWebControllerPrivate.mm
new file mode 100644
index 0000000..52c6d72
--- /dev/null
+++ b/WebKit/WebView.subproj/IFDefaultWebControllerPrivate.mm
@@ -0,0 +1,30 @@
+/*	
+    WKWebController.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKDefaultWebControllerPrivate.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebView.h>
+
+
+ at implementation WKDefaultWebControllerPrivate
+
+- init 
+{
+    mainView = nil;
+    mainDataSource = nil;
+    viewMap = nil;
+    dataSourceMap = nil;
+    return self;
+}
+
+- (void)dealloc
+{
+    [mainView release];
+    [mainDataSource release];
+    
+    [viewMap release];
+    [dataSourceMap release];
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index a5249b0..4262a6e 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -100,59 +100,11 @@
 */
 
 
+ at class WKWebDataSource;
+ at class WKError;
+ at class WKWebView;
 
-
-
-/*
-   ============================================================================= 
-
-    Is WKConcreteWebController the right name?  The name fits with the
-    scheme used by Foundation, although Foundation's concrete classes
-    typically aren't public.
-*/
-#ifndef NEW_WEBKIT_API
- at interface WKDefaultWebController : NSObject
- at end
-#else
- at interface WKDefaultWebController : NSObject <WKWebController>
-
-- initWithView: (WKWebView *) dataSource: (WKWebDataSource *)dataSource;
-
-- setDirectsAllLinksToSystemBrowser: (BOOL)flag
-- (BOOL)directsAllLinksToSystemBrowser;
-
-- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource;
-- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource;
-- (WKWebDataSource *)dataSourceForView: (WKWebVew *)view
-
-- (WKWebView *)mainView;
-- (WKWebDataSource *)mainDataSource;
-
-- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name;
-
-- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier;
-
- at end
-
-
-
-/*
-   ============================================================================= 
-
-    WKWebController implements all the behavior that ties together WKWebView
-    and WKWebDataSource.  See each inherited protocol for a more complete
-    description.
-    
-    [Don and I both agree that all these little protocols are useful to cleanly
-     describe snippets of behavior, but do we explicity reference them anywhere,
-     or do we just use the umbrella protocol?]
-*/
- at protocol WKWebController <WKLoadHandler, WKScriptContextHandler, WKAuthenticationHandler, WKLocationChangeHandler>
- at end
-
-
-
-
+#ifdef TENTATIVE_API
 /*
    ============================================================================= 
 
@@ -191,6 +143,7 @@
 - (void)serverRedirectTo: (NSURL *)url;
 
 @end
+#endif
 
 
 /*
@@ -230,7 +183,9 @@
     int bytesSoFar;	// 0 if this is the start of load
     int totalToLoad;	// -1 if this is not known.
                         // bytesSoFar == totalLoaded when complete
+#ifdef TENTATIVE_API
     WK_LOAD_TYPES type;	// load types, either image, css, jscript, or html
+#endif
 }
 @end
 
@@ -288,11 +243,13 @@
                                // location has failed; useful to be able to show a 
                                // different dialog based on count
 }
+ at end
+
 
 @protocol WKAuthenticationHandler
 // Can we make this work without blocking the UI, or do we need to make it explicitly async
 // somehow?
-- (WKSimpleAuthenticationResult) authenticate: (WKSimpleAuthenticationRequest)request;
+- (WKSimpleAuthenticationResult *) authenticate: (WKSimpleAuthenticationRequest *)request;
 
 // do we need anything for fancier authentication schemes like kerberos or GSSAPI?
 
@@ -329,12 +286,22 @@
 @end
 
 
+
+
+
 /*
    ============================================================================= 
 
+    WKWebController implements all the behavior that ties together WKWebView
+    and WKWebDataSource.  See each inherited protocol for a more complete
+    description.
+    
+    [Don and I both agree that all these little protocols are useful to cleanly
+     describe snippets of behavior, but do we explicity reference them anywhere,
+     or do we just use the umbrella protocol?]
 */
- at protocol WKFrame
+ at protocol WKWebController <WKLoadHandler, WKScriptContextHandler, WKAuthenticationHandler, WKLocationChangeHandler>
 @end
 
-#endif
+
 
diff --git a/WebKit/WebView.subproj/IFWebDataSource.h b/WebKit/WebView.subproj/IFWebDataSource.h
index 085fbc8..c8c2feb 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.h
+++ b/WebKit/WebView.subproj/IFWebDataSource.h
@@ -66,7 +66,10 @@
 	Minor naming changes.
 
    ============================================================================= */
-   
+
+#ifdef TENTATIVE_API
+ at class WKLoader;
+#endif
 
 @interface WKWebDataSource : NSObject
 {
@@ -74,22 +77,19 @@
     id _dataSourcePrivate;
 }
 
-#ifdef READY_FOR_PRIMETIME
-
 
 // Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
 - initWithURL: (NSURL *)inputURL;
 
+#ifdef TENTATIVE_API
 - initWithData: (NSData *)data;
 - initWithString: (NSString *)string;
-
-// Ken, need some help with one.
 - initWithLoader: (WKLoader *)loader;
-
+#endif
 
 // Returns nil if this data source represents the main document.  Otherwise
 // returns the parent data source.
-- (WKDataSource *)parent;
+- (WKWebDataSource *)parent;
 
 
 // Returns YES if this is the main document.  The main document is the 'top'
@@ -109,7 +109,7 @@
 
 // findDataSourceForFrameNamed: returns the child data source associated with
 // the frame named 'name', or nil. 
-- (WKWebDataSource) findDataSourceForFrameNamed: (NSString *)name;
+- (WKWebDataSource *) findDataSourceForFrameNamed: (NSString *)name;
 
 
 - (BOOL)frameExists: (NSString *)name;
@@ -161,9 +161,10 @@
 - (BOOL)isLoading;
 
 
+#ifdef TENTATIVE_API
 // Get DOM access to the document.
 - (WKDOMDocument *)document;
-
+#endif
 
 // Get the actual source of the docment.
 - (NSString *)documentText;
@@ -178,8 +179,8 @@
 
 
 // Style sheet
-- (void)setUserStyleSheet: (NSURL *)url;
-- (void)setUserStyleSheet: (NSString *)sheet;
+- (void)setUserStyleSheetFromURL: (NSURL *)url;
+- (void)setUserStyleSheetFromString: (NSString *)sheet;
 
 
 // a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
@@ -195,8 +196,6 @@
 // Returns nil or the page title.
 - (NSString *)pageTitle;
 
-#endif
-
 @end
 
 
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 419bef8..48d1b3c 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -3,6 +3,8 @@
 	Copyright 2001, Apple, Inc. All rights reserved.
 */
 #import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
 
 @implementation WKWebDataSource
 
@@ -29,4 +31,233 @@
     [defaults registerDefaults:dict];
 }
 
+
+- (void)_commonInitialization
+{
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate) = [[WKWebDataSourcePrivate alloc] init];
+}
+
+// Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
+- initWithURL: (NSURL *)inputURL
+{
+    [super init];
+    [self _commonInitialization];
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate)->inputURL = inputURL;
+    return self;
+}
+
+
+#ifdef TENTATIVE_API
+- initWithData: (NSData *)data 
+- initWithString: (NSString *)string;
+- initWithLoader: (WKLoader *)loader;
+#endif
+
+
+// Returns nil if this data source represents the main document.  Otherwise
+// returns the parent data source.
+- (WKWebDataSource *)parent 
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent;
+}
+
+
+
+// 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 (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent == nil)
+        return YES;
+    return NO;
+}
+
+
+// Returns an array of WKWebDataSource.  The data sources in the array are
+// the data source assoicated with a frame set or iframe.  If the main document
+// is not a frameset, or has not iframes children will return nil.
+- (NSArray *)children
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->children;
+}
+
+
+// Returns an array of NSStrings or nil.  The NSStrings corresponds to
+// frame names.  If this data source is the main document and has no
+// frames then frameNames will return nil.
+- (NSArray *)frameNames
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::frameNames is not implemented"];
+    return nil;
+}
+
+
+// findDataSourceForFrameNamed: returns the child data source associated with
+// the frame named 'name', or nil. 
+- (WKWebDataSource *) findDataSourceForFrameNamed: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::findDataSourceForFrameNamed: is not implemented"];
+    return nil;
+}
+
+
+- (BOOL)frameExists: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::frameExists: is not implemented"];
+    return NO;
+}
+
+
+- (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::openURL:inFrameNamed: is not implemented"];
+}
+
+
+- (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::openURL:inIFrame: is not implemented"];
+}
+
+
+- (id <WKWebController>)controller
+{
+    // All data source from a document (frameset) share the same
+    // controller.
+    if (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent != nil)
+        return [((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent controller];
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->controller;
+}
+
+
+// May return nil if not initialized with a URL.
+- (NSURL *)inputURL
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->inputURL;
+}
+
+
+// finalURL returns the URL that was actually used.  The final URL
+// may be different than the inputURL if the server redirects.
+// <WKLocationChangedHandler> includes a message that is sent when
+// a redirect is processed
+- (NSURL *)finalURL
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::finalURL is not implemented"];
+    return nil;
+}
+
+
+// Returns true if the inputURL has been redirected by the server,
+// i.e. inputURL != finalURL.
+- (BOOL)wasRedirected
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::wasRedirected is not implemented"];
+    return NO;
+}
+
+
+// Start actually getting (if initialized with a URL) and parsing data. If the data source
+// is still performing a previous load it will be stopped.
+// If forceRefresh is YES the document will load from the net, not the cache.
+- (void)startLoading: (BOOL)forceRefresh
+{
+    KURL url = [[[self inputURL] absoluteString] cString];
+    
+    [self _part]->openURL (url);
+}
+
+
+// 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.
+// Returns NO if the data source is not currently loading.
+- (void)stopLoading
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::stopLoading is not implemented"];
+}
+
+
+// Returns YES if there are any pending loads.
+- (BOOL)isLoading
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::isLoading is not implemented"];
+    return NO;
+}
+
+
+#ifdef TENTATIVE_API
+// Get DOM access to the document.
+- (WKDOMDocument *)document;
+#endif
+
+// Get the actual source of the docment.
+- (NSString *)documentText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::documentText is not implemented"];
+    return nil;
+}
+
+
+// URL reference point, these should probably not be public for 1.0.
+- (NSURL *)base
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::base is not implemented"];
+    return nil;
+}
+
+
+- (NSString *)baseTarget
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::baseTarget is not implemented"];
+    return nil;
+}
+
+
+- (NSString *)encoding
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::encoding is not implemented"];
+    return nil;
+}
+
+
+// Style sheet
+- (void)setUserStyleSheetFromURL: (NSURL *)url
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::setUserStyleSheetFromURL: is not implemented"];
+}
+
+
+- (void)setUserStyleSheetFromString: (NSString *)sheet
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::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.
+- (NSImage *)icon
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::setUserStyleSheetFromString: is not implemented"];
+    return nil;
+}
+
+
+// Is page secure, e.g. https, ftps
+- (BOOL)isPageSecure
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::isPageSecure is not implemented"];
+    return NO;
+}
+
+
+// Returns nil or the page title.
+- (NSString *)pageTitle
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::pageTitle is not implemented"];
+    return nil;
+}
+
+
 @end
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
index 380846a..718b7f4 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
@@ -5,12 +5,28 @@
         in WebCore.  Instances of this class are referenced by _dataSourcePrivate in
         NSWebPageDataSource.
 */
+#import <Cocoa/Cocoa.h>
 
+#import <WebKit/WKWebDataSource.h>
 
- at interface NSWebPageDataSourcePrivate : NSObject
+// includes from kde
+#include <khtmlview.h>
+
+ at interface WKWebDataSourcePrivate : NSObject
 {
+    WKWebDataSource *parent;
+    NSArray *children;
+    id <WKWebController>controller;
+    NSURL *inputURL;
+    KHTMLPart *part;
 }
 
+- init;
+- (void)dealloc;
 
 @end
 
+ at interface WKWebDataSource (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller;
+- (KHTMLPart *)_part;
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
new file mode 100644
index 0000000..2e9824e
--- /dev/null
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
@@ -0,0 +1,55 @@
+/*	WKWebDataSourcePrivate.h
+	Copyright 2001, Apple, Inc. All rights reserved.
+
+        Private header file.  This file may reference classes (both ObjectiveC and C++)
+        in WebCore.  Instances of this class are referenced by _dataSourcePrivate in
+        NSWebPageDataSource.
+*/
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
+
+
+
+
+ at implementation WKWebDataSourcePrivate 
+
+- init
+{
+    parent = nil;
+    children = nil;
+    controller = nil;
+    inputURL = nil;
+
+    part = new KHTMLPart();
+    
+    return self;
+}
+
+- (void)dealloc
+{
+    // controller is not retained!  WKWebControllers maintain
+    // a reference to their view and main data source.
+    [parent release];
+    [children release];
+    
+    //delete part;
+}
+
+ at end
+
+ at implementation WKWebDataSource (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller
+{
+    if (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent != nil)
+        [NSException raise:WKRuntimeError format:@"WKWebDataSource::_setController: called not called on main data source."];
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate)->controller = controller;
+}
+
+
+- (KHTMLPart *)_part
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->part;
+}
+
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFWebView.h b/WebKit/WebView.subproj/IFWebView.h
index a4f596b..b0de617 100644
--- a/WebKit/WebView.subproj/IFWebView.h
+++ b/WebKit/WebView.subproj/IFWebView.h
@@ -23,13 +23,6 @@
 
     ...
 
-    or
-
-    ...
-    
-    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame url: url];
-    [[[view controller] dataSource] startLoading];
-
     
     What is the behaviour of the view after it has been initialized and 
     startLoading: is called?
@@ -86,25 +79,28 @@
     id _viewPrivate;
 }
 
-#ifdef READY_FOR_PRIMETIME
-
 - initWithFrame: (NSRect)frame;
 
-// Convenience method.  initWithFrame:url: will create a controller and data source.
-- initWithFrame: (NSRect)frame url: (NSURL *)url;
-
 
+#ifdef TENTATIVE_API
 // Set and get the delegate.
 - (void)setDelegate: (id <WKWebViewDelegate>)delegate;
 - (id <WKWebViewDelegate>)delegate;
+#endif
 
  
 // Set and get the controller.  Note that the controller is not retained.
 // Perhaps setController: should be private?
-//- (void)setController: (id <WKWebController>)controller;
 - (id <WKWebController>)controller;
 
 
+// This method is typically called by the view's controller when
+// the data source is changed.
+- (void)dataSourceChanged;
+
+- (void)setNeedsLayout: (bool)flag;
+
+
 // This method should not be public until we have a more completely
 // understood way to subclass WKWebView.
 - (void)layout;
@@ -118,9 +114,9 @@
 - (void)setFontSizes: (NSArray *)sizes;
 - (NSArray *)fontSizes;
 - (void)resetFontSizes;
-- (void)setStandardFont: (NSSFont *)font;
+- (void)setStandardFont: (NSFont *)font;
 - (NSFont *)standardFont;
-- (void)setFixedFont: (NSSFont *)font;
+- (void)setFixedFont: (NSFont *)font;
 - (NSFont *)fixedFont;
 
 
@@ -133,25 +129,25 @@
 
 // Returns an array of built-in context menu items for this node.
 // Generally called by WKContextMenuHandlers from contextMenuItemsForNode:
+#ifdef TENTATIVE_API
 - (NSArray *)defaultContextMenuItemsForNode: (WKDOMNode *);
+#endif
 - (void)setContextMenusEnabled: (BOOL)flag;
 - (BOOL)contextMenusEnabled;
 
 
 // Remove the selection.
-- deselectText;
+- (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)case
+- (void)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag;
 
 
 // Get an attributed string that represents the current selection.
 - (NSAttributedString *)selectedText;
 
-#endif
-
 @end
 
 
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index 3cf71cb..19f2fb2 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -2,7 +2,349 @@
 	Copyright 2001, Apple, Inc. All rights reserved.
 */
 #import <WebKit/WKWebView.h>
+#import <WebKit/WKWebViewPrivate.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKDefaultWebController.h>
+#import <WebKit/WKException.h>
+#import <WebKit/WebKitDebug.h>
+
+// KDE related includes
+#include <khtmlview.h>
+#include <qwidget.h>
+#include <qpainter.h>
+#include <qevent.h>
+#include <html/html_documentimpl.h>
+
 
 @implementation WKWebView
 
+- initWithFrame: (NSRect) frame
+{
+    [super initWithFrame: frame];
+
+    _viewPrivate = [[WKWebViewPrivate alloc] init];
+
+    ((WKWebViewPrivate *)_viewPrivate)->isFlipped = YES;
+    ((WKWebViewPrivate *)_viewPrivate)->needsLayout = YES;
+
+    return self;
+}
+
+
+- (void)dealloc 
+{
+    [_viewPrivate release];
+}
+
+ 
+// Set and get the controller.  Note that the controller is not retained.
+// Perhaps setController: should be private?
+- (id <WKWebController>)controller
+{
+    return ((WKWebViewPrivate *)_viewPrivate)->controller;
+}
+
+
+
+// This method is typically called by the view's controller when
+// the data source is changed.
+- (void)dataSourceChanged 
+{
+    WKWebViewPrivate *data = ((WKWebViewPrivate *)_viewPrivate);
+    NSRect r = [self frame];
+    
+    if (data->widget)
+        delete data->widget;
+
+    // Nasty!  Setup the cross references between the KHTMLView and
+    // the KHTMLPart.
+    KHTMLPart *part = [[[self controller] mainDataSource] _part];
+
+    data->widget = new KHTMLView (part, 0);
+    part->setView (data->widget);
+    
+    data->widget->setView (self);
+    
+    data->widget->resize (r.size.width,r.size.height);
+
+    [self _resetView];
+    [self layout];
+}
+
+
+
+// This method should not be public until we have a more completely
+// understood way to subclass WKWebView.
+- (void)layout
+{
+    KHTMLView *widget = ((WKWebViewPrivate *)_viewPrivate)->widget;
+    if (widget->part()->xmlDocImpl() && 
+        widget->part()->xmlDocImpl()->renderer()){
+        if (((WKWebViewPrivate *)_viewPrivate)->needsLayout){
+            //double start = CFAbsoluteTimeGetCurrent();
+            widget->layout(TRUE);
+            //WebKitDebugAtLevel (0x200, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
+            ((WKWebViewPrivate *)_viewPrivate)->needsLayout = NO;
+        }
+    }
+}
+
+
+// Stop animating animated GIFs, etc.
+- (void)stopAnimations
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::stopAnimations is not implemented"];
+}
+
+
+// Font API
+- (void)setFontSizes: (NSArray *)sizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setFontSizes: is not implemented"];
+}
+
+
+- (NSArray *)fontSizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::fontSizes is not implemented"];
+    return nil;
+}
+
+
+
+- (void)resetFontSizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::resetFontSizes is not implemented"];
+}
+
+
+- (void)setStandardFont: (NSFont *)font
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setStandardFont: is not implemented"];
+}
+
+
+- (NSFont *)standardFont
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::standardFont is not implemented"];
+    return nil;
+}
+
+
+- (void)setFixedFont: (NSFont *)font
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setFixedFont: is not implemented"];
+}
+
+
+- (NSFont *)fixedFont
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::fixedFont is not implemented"];
+    return nil;
+}
+
+
+// Drag and drop links and images.  Others?
+- (void)setCanDragFrom: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setCanDragFrom: is not implemented"];
+}
+
+- (BOOL)canDragFrom
+{
+    return NO;
+}
+
+- (void)setCanDragTo: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setCanDragTo: is not implemented"];
+}
+
+- (BOOL)canDragTo
+{
+    return NO;
+}
+
+
+// Returns an array of built-in context menu items for this node.
+// Generally called by WKContextMenuHandlers from contextMenuItemsForNode:
+#ifdef TENTATIVE_API
+- (NSArray *)defaultContextMenuItemsForNode: (WKDOMNode *)
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::defaultContextMenuItemsForNode: is not implemented"];
+    return nil;
+}
+#endif
+
+- (void)setContextMenusEnabled: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setContextMenusEnabled: is not implemented"];
+}
+
+
+- (BOOL)contextMenusEnabled;
+{
+    return NO;
+}
+
+
+// Remove the selection.
+- (void)deselectText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::deselectText: is not implemented"];
+}
+
+
+
+// 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
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::searchFor:direction:caseSensitive: is not implemented"];
+}
+
+
+// Get an attributed string that represents the current selection.
+- (NSAttributedString *)selectedText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::selectedText is not implemented"];
+    return nil;
+}
+
+
+
+#ifdef DELAY_LAYOUT
+- delayLayout: sender
+{
+    [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(delayLayout:) object: self];
+    KWQDEBUG("KWQHTMLView:  delayLayout called\n");
+    [self setNeedsLayout: YES];
+    [self setNeedsDisplay: YES];
+}
+
+-(void)notificationReceived:(NSNotification *)notification
+{
+    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
+        KWQDEBUG1("KWQHTMLView: Received notification, %s\n", DEBUG_OBJECT([notification name]));
+        [self performSelector:@selector(delayLayout:) withObject:self afterDelay:(NSTimeInterval)0.5];
+    }
+}
+#else
+-(void)notificationReceived:(NSNotification *)notification
+{
+    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
+        [self setNeedsLayout: YES];
+        [self setNeedsDisplay: YES];
+    }
+}
+#endif
+
+
+- (void)setNeedsLayout: (bool)flag
+{
+    ((WKWebViewPrivate *)_viewPrivate)->needsLayout = flag;
+}
+
+
+// This should eventually be removed.
+- (void)drawRect:(NSRect)rect {
+    KHTMLView *widget = ((WKWebViewPrivate *)_viewPrivate)->widget;
+
+    if (widget != 0l){        
+        [self layout];
+
+        QPainter p(widget);    
+        
+        [self lockFocus];
+
+        //double start = CFAbsoluteTimeGetCurrent();
+        ((KHTMLView *)widget)->drawContents( &p, (int)rect.origin.x, 
+                    (int)rect.origin.y, 
+                    (int)rect.size.width, 
+                    (int)rect.size.height );
+        //WebKitDebugAtLevel (0x200, "draw time %e\n", CFAbsoluteTimeGetCurrent() - start);
+        [self unlockFocus];
+    }
+}
+
+- (void)setIsFlipped: (bool)flag
+{
+    ((WKWebViewPrivate *)_viewPrivate)->isFlipped = flag;
+}
+
+
+- (BOOL)isFlipped 
+{
+    return ((WKWebViewPrivate *)_viewPrivate)->isFlipped;
+}
+
+
+
+// Override superclass implementation.  We want to relayout when the frame size is changed.
+- (void)setFrame:(NSRect)frameRect
+{
+    [super setFrame:frameRect];
+    [self setNeedsLayout: YES];
+}
+
+
+- (void)mouseUp: (NSEvent *)event
+{
+    int button, state;
+     
+    if ([event type] == NSLeftMouseDown){
+        button = Qt::LeftButton;
+        state = Qt::LeftButton;
+    }
+    else if ([event type] == NSRightMouseDown){
+        button = Qt::RightButton;
+        state = Qt::RightButton;
+    }
+    else if ([event type] == NSOtherMouseDown){
+        button = Qt::MidButton;
+        state = Qt::MidButton;
+    }
+    else {
+        [NSException raise:WKRuntimeError format:@"WKWebView::mouseUp: unknown button type"];
+        button = 0; state = 0; // Shutup the compiler.
+    }
+    NSPoint p = [event locationInWindow];
+    
+    QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
+    ((WKWebViewPrivate *)_viewPrivate)->widget->viewportMouseReleaseEvent(kEvent);
+}
+
+- (void)mouseDown: (NSEvent *)event
+{
+    int button, state;
+     
+    if ([event type] == NSLeftMouseDown){
+        button = Qt::LeftButton;
+        state = Qt::LeftButton;
+    }
+    else if ([event type] == NSRightMouseDown){
+        button = Qt::RightButton;
+        state = Qt::RightButton;
+    }
+    else if ([event type] == NSOtherMouseDown){
+        button = Qt::MidButton;
+        state = Qt::MidButton;
+    }
+    else {
+        [NSException raise:WKRuntimeError format:@"WKWebView::mouseUp: unknown button type"];
+        button = 0; state = 0; // Shutup the compiler.
+    }
+    NSPoint p = [event locationInWindow];
+    
+    QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
+    ((WKWebViewPrivate *)_viewPrivate)->widget->viewportMousePressEvent(kEvent);
+}
+
+- (void)mouseDragged: (NSEvent *)event
+{
+    NSPoint p = [event locationInWindow];
+    //WebKitDebugAtLevel (0x200, "mouseDragged %f, %f\n", p.x, p.y);
+}
+
 @end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.h b/WebKit/WebView.subproj/IFWebViewPrivate.h
index d39520c..ae54238 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.h
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.h
@@ -5,9 +5,26 @@
         in WebCore.  Instances of this class are referenced by _viewPrivate in 
         NSWebPageView.
 */
+#import <Cocoa/Cocoa.h>
 
- at interface NSWebPageViewPrivate : NSObject
+#import <WebKit/WKWebController.h>
+#import <WebKit/WKWebView.h>
+
+class QWidget;
+class KHTMLPart;
+class KHTMLView;
+
+ at interface WKWebViewPrivate : NSObject
 {
+    id <WKWebController>controller;
+    KHTMLView *widget;
+    bool isFlipped;
+    bool needsLayout;
 }
 
- at end
\ No newline at end of file
+ at end
+
+ at interface WKWebView (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller;
+- (void)_resetView;
+ at end
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.mm b/WebKit/WebView.subproj/IFWebViewPrivate.mm
new file mode 100644
index 0000000..9b78fc6
--- /dev/null
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.mm
@@ -0,0 +1,62 @@
+/*	WKWebViewPrivate.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+        
+        Private header file.  This file may reference classes (both ObjectiveC and C++)
+        in WebCore.  Instances of this class are referenced by _viewPrivate in 
+        NSWebPageView.
+*/
+#import <WKWebViewPrivate.h>
+
+// Includes from KDE
+#include <khtmlview.h>
+
+ at implementation WKWebViewPrivate
+
+- init
+{
+    [super init];
+    
+    controller = nil;
+    widget = 0;
+    
+    return self;
+}
+
+
+- (void)dealloc
+{
+    // controller is not retained!  WKWebControllers maintain
+    // a reference to their view and main data source.
+
+    //if (widget)
+    //    delete widget;
+}
+
+
+
+ at end
+
+
+ at implementation WKWebView  (WKPrivate)
+
+- (void)_resetView 
+{
+    NSArray *views = [self subviews];
+    int count;
+    
+    count = [views count];
+    while (count--){
+        //WebKitDebugAtLevel(0x200, "Removing %p %s\n", [views objectAtIndex: 0], DEBUG_OBJECT([[[views objectAtIndex: 0] class] className]));
+        [[views objectAtIndex: 0] removeFromSuperviewWithoutNeedingDisplay]; 
+    }
+    [self setFrameSize: NSMakeSize (0,0)];
+}
+
+
+- (void)_setController: (id <WKWebController>)controller
+{
+    // Not retained.
+    ((WKWebViewPrivate *)_viewPrivate)->controller = controller;    
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WKDefaultWebController.h b/WebKit/WebView.subproj/WKDefaultWebController.h
new file mode 100644
index 0000000..39f4eb7
--- /dev/null
+++ b/WebKit/WebView.subproj/WKDefaultWebController.h
@@ -0,0 +1,40 @@
+/*	
+    WKDefaultWebController.mm
+	Copyright 2001, 2002 Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKWebController.h>
+
+
+/*
+*/
+ at interface WKDefaultWebController : NSObject <WKWebController>
+{
+ at private
+    id _controllerPrivate;
+}
+
+
+- initWithView: (WKWebView *)view dataSource: (WKWebDataSource *)dataSource;
+
+- (void)setDirectsAllLinksToSystemBrowser: (BOOL)flag;
+- (BOOL)directsAllLinksToSystemBrowser;
+
+// Sets the mainView and the mainDataSource.
+- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource;
+
+// Find the view for the specified data source.
+- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource;
+
+// Find the data source for the specified view.
+- (WKWebDataSource *)dataSourceForView: (WKWebView *)view;
+
+- (WKWebView *)mainView;
+
+- (void)setMainDataSource: (WKWebDataSource *)dataSource;
+- (WKWebDataSource *)mainDataSource;
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name;
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier;
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WKDefaultWebController.mm b/WebKit/WebView.subproj/WKDefaultWebController.mm
new file mode 100644
index 0000000..7d724ef
--- /dev/null
+++ b/WebKit/WebView.subproj/WKDefaultWebController.mm
@@ -0,0 +1,250 @@
+/*	
+    WKDefaultWebController.mm
+	Copyright 2001, 2002 Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKDefaultWebController.h>
+#import <WebKit/WKDefaultWebControllerPrivate.h>
+#import <WebKit/WKWebViewPrivate.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
+
+
+// Used so we can use objects as keys in dictionaries without
+// copying.
+ at interface WKObjectHolder : NSObject
+{
+    id object;
+}
+
++ holderWithObject: o;
+- initWithObject: o;
+- (void)dealloc;
+- object;
+
+ at end
+
+ at implementation WKObjectHolder
+
++ holderWithObject: o
+{
+    return [[[WKObjectHolder alloc] initWithObject: o] autorelease];
+}
+
+- initWithObject: o
+{
+    [super init];
+    object = [o retain];
+    return self;
+}
+
+- (void)dealloc
+{
+    [object release];
+}
+
+- (id)copyWithZone:(NSZone *)zone
+{
+    return [self retain];
+}
+
+- (unsigned)hash
+{
+    return [object hash];
+}
+
+- object
+{
+    return object;
+}
+
+- (BOOL)isEqual:(id)anObject
+{
+    return object == [anObject object];
+}
+
+ at end
+
+
+ at implementation WKDefaultWebController
+
+
+- initWithView: (WKWebView *)view dataSource: (WKWebDataSource *)dataSource
+{
+    [super init];
+    _controllerPrivate = [[WKDefaultWebControllerPrivate alloc] init];
+    [self setView: view andDataSource: dataSource];
+    return self;   
+}
+
+
+- (void)dealloc
+{
+    [_controllerPrivate release];
+}
+
+- (void)setDirectsAllLinksToSystemBrowser: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::setDirectsAllLinksToSystemBrowser: is not implemented"];
+}
+
+
+- (BOOL)directsAllLinksToSystemBrowser
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::directsAllLinksToSystemBrowser is not implemented"];
+    return NO;
+}
+
+
+- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+
+    [data->viewMap release];
+    data->viewMap = [[NSMutableDictionary alloc] init];
+    
+    [data->dataSourceMap release];
+    data->dataSourceMap = [[NSMutableDictionary alloc] init];
+    
+    [data->mainView release];
+    data->mainView = [view retain];
+    [view _setController: self];
+    
+    [data->mainDataSource release];
+    data->mainDataSource = [dataSource retain];
+    [dataSource _setController: self];
+
+    [data->viewMap setObject: dataSource forKey: [WKObjectHolder holderWithObject:view]];
+    [data->dataSourceMap setObject: view forKey: [WKObjectHolder holderWithObject:dataSource]];
+    
+    [view dataSourceChanged];
+}
+
+- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return [data->viewMap objectForKey: dataSource];
+}
+
+
+- (WKWebDataSource *)dataSourceForView: (WKWebView *)view
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return [data->dataSourceMap objectForKey: view];
+}
+
+
+- (WKWebView *)mainView
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return data->mainView;
+}
+
+
+- (void)setMainDataSource: (WKWebDataSource *)dataSource;
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    [self setView: data->mainView andDataSource: dataSource];
+}
+
+- (WKWebDataSource *)mainDataSource
+{
+    WKDefaultWebControllerPrivate *data = ((WKDefaultWebControllerPrivate *)_controllerPrivate);
+    return data->mainDataSource;
+}
+
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::createViewForDataSource:inFrameNamed: is not implemented"];
+}
+
+
+- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::createViewForDataSource:inIFrame: is not implemented"];
+}
+
+
+
+// ---------------------------------------------------------------------
+// WKScriptContextHandler
+// ---------------------------------------------------------------------
+- (void)setStatusText: (NSString *)text forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::setStatusText:forDataSource: is not implemented"];
+}
+
+
+- (NSString *)statusTextForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::statusTextForDataSource: is not implemented"];
+    return nil;
+}
+
+
+// ---------------------------------------------------------------------
+// WKAuthenticationHandler
+// ---------------------------------------------------------------------
+- (WKSimpleAuthenticationResult *) authenticate: (WKSimpleAuthenticationRequest *)request
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::authenticate: is not implemented"];
+    return nil;
+}
+
+
+// ---------------------------------------------------------------------
+// WKLoadHandler
+// ---------------------------------------------------------------------
+- (void)receivedProgress: (WKLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedProgress:forResource:fromDataSource: is not implemented"];
+}
+
+
+- (void)receivedError: (WKError *)error forResource: (NSString *)resourceDescription partialProgress: (WKLoadProgress *)progress fromDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedError:forResource:partialProgress:fromDataSource: is not implemented"];
+}
+
+
+// ---------------------------------------------------------------------
+// WKLocationChangeHandler
+// ---------------------------------------------------------------------
+- (BOOL)locationWillChangeTo: (NSURL *)url
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationWillChangeTo: is not implemented"];
+    return NO;
+}
+
+
+- (void)locationChangeStartedForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationWillChangeTo: is not implemented"];
+}
+
+
+- (void)locationChangeInProgressForDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationChangeInProgressForDataSource:forDataSource: is not implemented"];
+}
+
+
+- (void)locationChangeDone: (WKError *)error forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::locationChangeDone:forDataSource: is not implemented"];
+}
+
+
+- (void)receivedPageTitle: (NSString *)title forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::receivedPageTitle:forDataSource: is not implemented"];
+}
+
+
+- (void)serverRedirectTo: (NSURL *)url forDataSource: (WKWebDataSource *)dataSource
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKDefaultWebController::serverRedirectTo:forDataSource: is not implemented"];
+}
+
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WKDefaultWebControllerPrivate.h b/WebKit/WebView.subproj/WKDefaultWebControllerPrivate.h
new file mode 100644
index 0000000..2ecf399
--- /dev/null
+++ b/WebKit/WebView.subproj/WKDefaultWebControllerPrivate.h
@@ -0,0 +1,17 @@
+/*	
+    WKWebController.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKWebController.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebView.h>
+
+
+ at interface WKDefaultWebControllerPrivate : NSObject
+{
+    WKWebView *mainView;
+    WKWebDataSource *mainDataSource;
+    NSMutableDictionary *viewMap;
+    NSMutableDictionary *dataSourceMap;
+}
+ at end
diff --git a/WebKit/WebView.subproj/WKDefaultWebControllerPrivate.mm b/WebKit/WebView.subproj/WKDefaultWebControllerPrivate.mm
new file mode 100644
index 0000000..52c6d72
--- /dev/null
+++ b/WebKit/WebView.subproj/WKDefaultWebControllerPrivate.mm
@@ -0,0 +1,30 @@
+/*	
+    WKWebController.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+*/
+#import <WebKit/WKDefaultWebControllerPrivate.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebView.h>
+
+
+ at implementation WKDefaultWebControllerPrivate
+
+- init 
+{
+    mainView = nil;
+    mainDataSource = nil;
+    viewMap = nil;
+    dataSourceMap = nil;
+    return self;
+}
+
+- (void)dealloc
+{
+    [mainView release];
+    [mainDataSource release];
+    
+    [viewMap release];
+    [dataSourceMap release];
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WKWebController.h b/WebKit/WebView.subproj/WKWebController.h
index a5249b0..4262a6e 100644
--- a/WebKit/WebView.subproj/WKWebController.h
+++ b/WebKit/WebView.subproj/WKWebController.h
@@ -100,59 +100,11 @@
 */
 
 
+ at class WKWebDataSource;
+ at class WKError;
+ at class WKWebView;
 
-
-
-/*
-   ============================================================================= 
-
-    Is WKConcreteWebController the right name?  The name fits with the
-    scheme used by Foundation, although Foundation's concrete classes
-    typically aren't public.
-*/
-#ifndef NEW_WEBKIT_API
- at interface WKDefaultWebController : NSObject
- at end
-#else
- at interface WKDefaultWebController : NSObject <WKWebController>
-
-- initWithView: (WKWebView *) dataSource: (WKWebDataSource *)dataSource;
-
-- setDirectsAllLinksToSystemBrowser: (BOOL)flag
-- (BOOL)directsAllLinksToSystemBrowser;
-
-- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource;
-- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource;
-- (WKWebDataSource *)dataSourceForView: (WKWebVew *)view
-
-- (WKWebView *)mainView;
-- (WKWebDataSource *)mainDataSource;
-
-- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name;
-
-- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier;
-
- at end
-
-
-
-/*
-   ============================================================================= 
-
-    WKWebController implements all the behavior that ties together WKWebView
-    and WKWebDataSource.  See each inherited protocol for a more complete
-    description.
-    
-    [Don and I both agree that all these little protocols are useful to cleanly
-     describe snippets of behavior, but do we explicity reference them anywhere,
-     or do we just use the umbrella protocol?]
-*/
- at protocol WKWebController <WKLoadHandler, WKScriptContextHandler, WKAuthenticationHandler, WKLocationChangeHandler>
- at end
-
-
-
-
+#ifdef TENTATIVE_API
 /*
    ============================================================================= 
 
@@ -191,6 +143,7 @@
 - (void)serverRedirectTo: (NSURL *)url;
 
 @end
+#endif
 
 
 /*
@@ -230,7 +183,9 @@
     int bytesSoFar;	// 0 if this is the start of load
     int totalToLoad;	// -1 if this is not known.
                         // bytesSoFar == totalLoaded when complete
+#ifdef TENTATIVE_API
     WK_LOAD_TYPES type;	// load types, either image, css, jscript, or html
+#endif
 }
 @end
 
@@ -288,11 +243,13 @@
                                // location has failed; useful to be able to show a 
                                // different dialog based on count
 }
+ at end
+
 
 @protocol WKAuthenticationHandler
 // Can we make this work without blocking the UI, or do we need to make it explicitly async
 // somehow?
-- (WKSimpleAuthenticationResult) authenticate: (WKSimpleAuthenticationRequest)request;
+- (WKSimpleAuthenticationResult *) authenticate: (WKSimpleAuthenticationRequest *)request;
 
 // do we need anything for fancier authentication schemes like kerberos or GSSAPI?
 
@@ -329,12 +286,22 @@
 @end
 
 
+
+
+
 /*
    ============================================================================= 
 
+    WKWebController implements all the behavior that ties together WKWebView
+    and WKWebDataSource.  See each inherited protocol for a more complete
+    description.
+    
+    [Don and I both agree that all these little protocols are useful to cleanly
+     describe snippets of behavior, but do we explicity reference them anywhere,
+     or do we just use the umbrella protocol?]
 */
- at protocol WKFrame
+ at protocol WKWebController <WKLoadHandler, WKScriptContextHandler, WKAuthenticationHandler, WKLocationChangeHandler>
 @end
 
-#endif
+
 
diff --git a/WebKit/WebView.subproj/WKWebController.mm b/WebKit/WebView.subproj/WKWebController.mm
deleted file mode 100644
index b786a9a..0000000
--- a/WebKit/WebView.subproj/WKWebController.mm
+++ /dev/null
@@ -1,9 +0,0 @@
-/*	
-        WKWebController.mm
-	Copyright 2001, Apple, Inc. All rights reserved.
-*/
-#import <WebKit/WKWebController.h>
-
- at implementation WKDefaultWebController
-
- at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WKWebDataSource.h b/WebKit/WebView.subproj/WKWebDataSource.h
index 085fbc8..c8c2feb 100644
--- a/WebKit/WebView.subproj/WKWebDataSource.h
+++ b/WebKit/WebView.subproj/WKWebDataSource.h
@@ -66,7 +66,10 @@
 	Minor naming changes.
 
    ============================================================================= */
-   
+
+#ifdef TENTATIVE_API
+ at class WKLoader;
+#endif
 
 @interface WKWebDataSource : NSObject
 {
@@ -74,22 +77,19 @@
     id _dataSourcePrivate;
 }
 
-#ifdef READY_FOR_PRIMETIME
-
 
 // Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
 - initWithURL: (NSURL *)inputURL;
 
+#ifdef TENTATIVE_API
 - initWithData: (NSData *)data;
 - initWithString: (NSString *)string;
-
-// Ken, need some help with one.
 - initWithLoader: (WKLoader *)loader;
-
+#endif
 
 // Returns nil if this data source represents the main document.  Otherwise
 // returns the parent data source.
-- (WKDataSource *)parent;
+- (WKWebDataSource *)parent;
 
 
 // Returns YES if this is the main document.  The main document is the 'top'
@@ -109,7 +109,7 @@
 
 // findDataSourceForFrameNamed: returns the child data source associated with
 // the frame named 'name', or nil. 
-- (WKWebDataSource) findDataSourceForFrameNamed: (NSString *)name;
+- (WKWebDataSource *) findDataSourceForFrameNamed: (NSString *)name;
 
 
 - (BOOL)frameExists: (NSString *)name;
@@ -161,9 +161,10 @@
 - (BOOL)isLoading;
 
 
+#ifdef TENTATIVE_API
 // Get DOM access to the document.
 - (WKDOMDocument *)document;
-
+#endif
 
 // Get the actual source of the docment.
 - (NSString *)documentText;
@@ -178,8 +179,8 @@
 
 
 // Style sheet
-- (void)setUserStyleSheet: (NSURL *)url;
-- (void)setUserStyleSheet: (NSString *)sheet;
+- (void)setUserStyleSheetFromURL: (NSURL *)url;
+- (void)setUserStyleSheetFromString: (NSString *)sheet;
 
 
 // a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
@@ -195,8 +196,6 @@
 // Returns nil or the page title.
 - (NSString *)pageTitle;
 
-#endif
-
 @end
 
 
diff --git a/WebKit/WebView.subproj/WKWebDataSource.mm b/WebKit/WebView.subproj/WKWebDataSource.mm
index 419bef8..48d1b3c 100644
--- a/WebKit/WebView.subproj/WKWebDataSource.mm
+++ b/WebKit/WebView.subproj/WKWebDataSource.mm
@@ -3,6 +3,8 @@
 	Copyright 2001, Apple, Inc. All rights reserved.
 */
 #import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
 
 @implementation WKWebDataSource
 
@@ -29,4 +31,233 @@
     [defaults registerDefaults:dict];
 }
 
+
+- (void)_commonInitialization
+{
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate) = [[WKWebDataSourcePrivate alloc] init];
+}
+
+// Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
+- initWithURL: (NSURL *)inputURL
+{
+    [super init];
+    [self _commonInitialization];
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate)->inputURL = inputURL;
+    return self;
+}
+
+
+#ifdef TENTATIVE_API
+- initWithData: (NSData *)data 
+- initWithString: (NSString *)string;
+- initWithLoader: (WKLoader *)loader;
+#endif
+
+
+// Returns nil if this data source represents the main document.  Otherwise
+// returns the parent data source.
+- (WKWebDataSource *)parent 
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent;
+}
+
+
+
+// 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 (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent == nil)
+        return YES;
+    return NO;
+}
+
+
+// Returns an array of WKWebDataSource.  The data sources in the array are
+// the data source assoicated with a frame set or iframe.  If the main document
+// is not a frameset, or has not iframes children will return nil.
+- (NSArray *)children
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->children;
+}
+
+
+// Returns an array of NSStrings or nil.  The NSStrings corresponds to
+// frame names.  If this data source is the main document and has no
+// frames then frameNames will return nil.
+- (NSArray *)frameNames
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::frameNames is not implemented"];
+    return nil;
+}
+
+
+// findDataSourceForFrameNamed: returns the child data source associated with
+// the frame named 'name', or nil. 
+- (WKWebDataSource *) findDataSourceForFrameNamed: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::findDataSourceForFrameNamed: is not implemented"];
+    return nil;
+}
+
+
+- (BOOL)frameExists: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::frameExists: is not implemented"];
+    return NO;
+}
+
+
+- (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::openURL:inFrameNamed: is not implemented"];
+}
+
+
+- (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::openURL:inIFrame: is not implemented"];
+}
+
+
+- (id <WKWebController>)controller
+{
+    // All data source from a document (frameset) share the same
+    // controller.
+    if (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent != nil)
+        return [((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent controller];
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->controller;
+}
+
+
+// May return nil if not initialized with a URL.
+- (NSURL *)inputURL
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->inputURL;
+}
+
+
+// finalURL returns the URL that was actually used.  The final URL
+// may be different than the inputURL if the server redirects.
+// <WKLocationChangedHandler> includes a message that is sent when
+// a redirect is processed
+- (NSURL *)finalURL
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::finalURL is not implemented"];
+    return nil;
+}
+
+
+// Returns true if the inputURL has been redirected by the server,
+// i.e. inputURL != finalURL.
+- (BOOL)wasRedirected
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::wasRedirected is not implemented"];
+    return NO;
+}
+
+
+// Start actually getting (if initialized with a URL) and parsing data. If the data source
+// is still performing a previous load it will be stopped.
+// If forceRefresh is YES the document will load from the net, not the cache.
+- (void)startLoading: (BOOL)forceRefresh
+{
+    KURL url = [[[self inputURL] absoluteString] cString];
+    
+    [self _part]->openURL (url);
+}
+
+
+// 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.
+// Returns NO if the data source is not currently loading.
+- (void)stopLoading
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::stopLoading is not implemented"];
+}
+
+
+// Returns YES if there are any pending loads.
+- (BOOL)isLoading
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::isLoading is not implemented"];
+    return NO;
+}
+
+
+#ifdef TENTATIVE_API
+// Get DOM access to the document.
+- (WKDOMDocument *)document;
+#endif
+
+// Get the actual source of the docment.
+- (NSString *)documentText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::documentText is not implemented"];
+    return nil;
+}
+
+
+// URL reference point, these should probably not be public for 1.0.
+- (NSURL *)base
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::base is not implemented"];
+    return nil;
+}
+
+
+- (NSString *)baseTarget
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::baseTarget is not implemented"];
+    return nil;
+}
+
+
+- (NSString *)encoding
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::encoding is not implemented"];
+    return nil;
+}
+
+
+// Style sheet
+- (void)setUserStyleSheetFromURL: (NSURL *)url
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::setUserStyleSheetFromURL: is not implemented"];
+}
+
+
+- (void)setUserStyleSheetFromString: (NSString *)sheet
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::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.
+- (NSImage *)icon
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::setUserStyleSheetFromString: is not implemented"];
+    return nil;
+}
+
+
+// Is page secure, e.g. https, ftps
+- (BOOL)isPageSecure
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::isPageSecure is not implemented"];
+    return NO;
+}
+
+
+// Returns nil or the page title.
+- (NSString *)pageTitle
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::pageTitle is not implemented"];
+    return nil;
+}
+
+
 @end
diff --git a/WebKit/WebView.subproj/WKWebDataSourcePrivate.h b/WebKit/WebView.subproj/WKWebDataSourcePrivate.h
index 380846a..718b7f4 100644
--- a/WebKit/WebView.subproj/WKWebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WKWebDataSourcePrivate.h
@@ -5,12 +5,28 @@
         in WebCore.  Instances of this class are referenced by _dataSourcePrivate in
         NSWebPageDataSource.
 */
+#import <Cocoa/Cocoa.h>
 
+#import <WebKit/WKWebDataSource.h>
 
- at interface NSWebPageDataSourcePrivate : NSObject
+// includes from kde
+#include <khtmlview.h>
+
+ at interface WKWebDataSourcePrivate : NSObject
 {
+    WKWebDataSource *parent;
+    NSArray *children;
+    id <WKWebController>controller;
+    NSURL *inputURL;
+    KHTMLPart *part;
 }
 
+- init;
+- (void)dealloc;
 
 @end
 
+ at interface WKWebDataSource (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller;
+- (KHTMLPart *)_part;
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WKWebDataSourcePrivate.mm b/WebKit/WebView.subproj/WKWebDataSourcePrivate.mm
new file mode 100644
index 0000000..2e9824e
--- /dev/null
+++ b/WebKit/WebView.subproj/WKWebDataSourcePrivate.mm
@@ -0,0 +1,55 @@
+/*	WKWebDataSourcePrivate.h
+	Copyright 2001, Apple, Inc. All rights reserved.
+
+        Private header file.  This file may reference classes (both ObjectiveC and C++)
+        in WebCore.  Instances of this class are referenced by _dataSourcePrivate in
+        NSWebPageDataSource.
+*/
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
+
+
+
+
+ at implementation WKWebDataSourcePrivate 
+
+- init
+{
+    parent = nil;
+    children = nil;
+    controller = nil;
+    inputURL = nil;
+
+    part = new KHTMLPart();
+    
+    return self;
+}
+
+- (void)dealloc
+{
+    // controller is not retained!  WKWebControllers maintain
+    // a reference to their view and main data source.
+    [parent release];
+    [children release];
+    
+    //delete part;
+}
+
+ at end
+
+ at implementation WKWebDataSource (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller
+{
+    if (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent != nil)
+        [NSException raise:WKRuntimeError format:@"WKWebDataSource::_setController: called not called on main data source."];
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate)->controller = controller;
+}
+
+
+- (KHTMLPart *)_part
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->part;
+}
+
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WKWebView.h b/WebKit/WebView.subproj/WKWebView.h
index a4f596b..b0de617 100644
--- a/WebKit/WebView.subproj/WKWebView.h
+++ b/WebKit/WebView.subproj/WKWebView.h
@@ -23,13 +23,6 @@
 
     ...
 
-    or
-
-    ...
-    
-    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame url: url];
-    [[[view controller] dataSource] startLoading];
-
     
     What is the behaviour of the view after it has been initialized and 
     startLoading: is called?
@@ -86,25 +79,28 @@
     id _viewPrivate;
 }
 
-#ifdef READY_FOR_PRIMETIME
-
 - initWithFrame: (NSRect)frame;
 
-// Convenience method.  initWithFrame:url: will create a controller and data source.
-- initWithFrame: (NSRect)frame url: (NSURL *)url;
-
 
+#ifdef TENTATIVE_API
 // Set and get the delegate.
 - (void)setDelegate: (id <WKWebViewDelegate>)delegate;
 - (id <WKWebViewDelegate>)delegate;
+#endif
 
  
 // Set and get the controller.  Note that the controller is not retained.
 // Perhaps setController: should be private?
-//- (void)setController: (id <WKWebController>)controller;
 - (id <WKWebController>)controller;
 
 
+// This method is typically called by the view's controller when
+// the data source is changed.
+- (void)dataSourceChanged;
+
+- (void)setNeedsLayout: (bool)flag;
+
+
 // This method should not be public until we have a more completely
 // understood way to subclass WKWebView.
 - (void)layout;
@@ -118,9 +114,9 @@
 - (void)setFontSizes: (NSArray *)sizes;
 - (NSArray *)fontSizes;
 - (void)resetFontSizes;
-- (void)setStandardFont: (NSSFont *)font;
+- (void)setStandardFont: (NSFont *)font;
 - (NSFont *)standardFont;
-- (void)setFixedFont: (NSSFont *)font;
+- (void)setFixedFont: (NSFont *)font;
 - (NSFont *)fixedFont;
 
 
@@ -133,25 +129,25 @@
 
 // Returns an array of built-in context menu items for this node.
 // Generally called by WKContextMenuHandlers from contextMenuItemsForNode:
+#ifdef TENTATIVE_API
 - (NSArray *)defaultContextMenuItemsForNode: (WKDOMNode *);
+#endif
 - (void)setContextMenusEnabled: (BOOL)flag;
 - (BOOL)contextMenusEnabled;
 
 
 // Remove the selection.
-- deselectText;
+- (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)case
+- (void)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag;
 
 
 // Get an attributed string that represents the current selection.
 - (NSAttributedString *)selectedText;
 
-#endif
-
 @end
 
 
diff --git a/WebKit/WebView.subproj/WKWebView.mm b/WebKit/WebView.subproj/WKWebView.mm
index 3cf71cb..19f2fb2 100644
--- a/WebKit/WebView.subproj/WKWebView.mm
+++ b/WebKit/WebView.subproj/WKWebView.mm
@@ -2,7 +2,349 @@
 	Copyright 2001, Apple, Inc. All rights reserved.
 */
 #import <WebKit/WKWebView.h>
+#import <WebKit/WKWebViewPrivate.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKDefaultWebController.h>
+#import <WebKit/WKException.h>
+#import <WebKit/WebKitDebug.h>
+
+// KDE related includes
+#include <khtmlview.h>
+#include <qwidget.h>
+#include <qpainter.h>
+#include <qevent.h>
+#include <html/html_documentimpl.h>
+
 
 @implementation WKWebView
 
+- initWithFrame: (NSRect) frame
+{
+    [super initWithFrame: frame];
+
+    _viewPrivate = [[WKWebViewPrivate alloc] init];
+
+    ((WKWebViewPrivate *)_viewPrivate)->isFlipped = YES;
+    ((WKWebViewPrivate *)_viewPrivate)->needsLayout = YES;
+
+    return self;
+}
+
+
+- (void)dealloc 
+{
+    [_viewPrivate release];
+}
+
+ 
+// Set and get the controller.  Note that the controller is not retained.
+// Perhaps setController: should be private?
+- (id <WKWebController>)controller
+{
+    return ((WKWebViewPrivate *)_viewPrivate)->controller;
+}
+
+
+
+// This method is typically called by the view's controller when
+// the data source is changed.
+- (void)dataSourceChanged 
+{
+    WKWebViewPrivate *data = ((WKWebViewPrivate *)_viewPrivate);
+    NSRect r = [self frame];
+    
+    if (data->widget)
+        delete data->widget;
+
+    // Nasty!  Setup the cross references between the KHTMLView and
+    // the KHTMLPart.
+    KHTMLPart *part = [[[self controller] mainDataSource] _part];
+
+    data->widget = new KHTMLView (part, 0);
+    part->setView (data->widget);
+    
+    data->widget->setView (self);
+    
+    data->widget->resize (r.size.width,r.size.height);
+
+    [self _resetView];
+    [self layout];
+}
+
+
+
+// This method should not be public until we have a more completely
+// understood way to subclass WKWebView.
+- (void)layout
+{
+    KHTMLView *widget = ((WKWebViewPrivate *)_viewPrivate)->widget;
+    if (widget->part()->xmlDocImpl() && 
+        widget->part()->xmlDocImpl()->renderer()){
+        if (((WKWebViewPrivate *)_viewPrivate)->needsLayout){
+            //double start = CFAbsoluteTimeGetCurrent();
+            widget->layout(TRUE);
+            //WebKitDebugAtLevel (0x200, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
+            ((WKWebViewPrivate *)_viewPrivate)->needsLayout = NO;
+        }
+    }
+}
+
+
+// Stop animating animated GIFs, etc.
+- (void)stopAnimations
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::stopAnimations is not implemented"];
+}
+
+
+// Font API
+- (void)setFontSizes: (NSArray *)sizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setFontSizes: is not implemented"];
+}
+
+
+- (NSArray *)fontSizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::fontSizes is not implemented"];
+    return nil;
+}
+
+
+
+- (void)resetFontSizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::resetFontSizes is not implemented"];
+}
+
+
+- (void)setStandardFont: (NSFont *)font
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setStandardFont: is not implemented"];
+}
+
+
+- (NSFont *)standardFont
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::standardFont is not implemented"];
+    return nil;
+}
+
+
+- (void)setFixedFont: (NSFont *)font
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setFixedFont: is not implemented"];
+}
+
+
+- (NSFont *)fixedFont
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::fixedFont is not implemented"];
+    return nil;
+}
+
+
+// Drag and drop links and images.  Others?
+- (void)setCanDragFrom: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setCanDragFrom: is not implemented"];
+}
+
+- (BOOL)canDragFrom
+{
+    return NO;
+}
+
+- (void)setCanDragTo: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setCanDragTo: is not implemented"];
+}
+
+- (BOOL)canDragTo
+{
+    return NO;
+}
+
+
+// Returns an array of built-in context menu items for this node.
+// Generally called by WKContextMenuHandlers from contextMenuItemsForNode:
+#ifdef TENTATIVE_API
+- (NSArray *)defaultContextMenuItemsForNode: (WKDOMNode *)
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::defaultContextMenuItemsForNode: is not implemented"];
+    return nil;
+}
+#endif
+
+- (void)setContextMenusEnabled: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setContextMenusEnabled: is not implemented"];
+}
+
+
+- (BOOL)contextMenusEnabled;
+{
+    return NO;
+}
+
+
+// Remove the selection.
+- (void)deselectText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::deselectText: is not implemented"];
+}
+
+
+
+// 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
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::searchFor:direction:caseSensitive: is not implemented"];
+}
+
+
+// Get an attributed string that represents the current selection.
+- (NSAttributedString *)selectedText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::selectedText is not implemented"];
+    return nil;
+}
+
+
+
+#ifdef DELAY_LAYOUT
+- delayLayout: sender
+{
+    [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(delayLayout:) object: self];
+    KWQDEBUG("KWQHTMLView:  delayLayout called\n");
+    [self setNeedsLayout: YES];
+    [self setNeedsDisplay: YES];
+}
+
+-(void)notificationReceived:(NSNotification *)notification
+{
+    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
+        KWQDEBUG1("KWQHTMLView: Received notification, %s\n", DEBUG_OBJECT([notification name]));
+        [self performSelector:@selector(delayLayout:) withObject:self afterDelay:(NSTimeInterval)0.5];
+    }
+}
+#else
+-(void)notificationReceived:(NSNotification *)notification
+{
+    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
+        [self setNeedsLayout: YES];
+        [self setNeedsDisplay: YES];
+    }
+}
+#endif
+
+
+- (void)setNeedsLayout: (bool)flag
+{
+    ((WKWebViewPrivate *)_viewPrivate)->needsLayout = flag;
+}
+
+
+// This should eventually be removed.
+- (void)drawRect:(NSRect)rect {
+    KHTMLView *widget = ((WKWebViewPrivate *)_viewPrivate)->widget;
+
+    if (widget != 0l){        
+        [self layout];
+
+        QPainter p(widget);    
+        
+        [self lockFocus];
+
+        //double start = CFAbsoluteTimeGetCurrent();
+        ((KHTMLView *)widget)->drawContents( &p, (int)rect.origin.x, 
+                    (int)rect.origin.y, 
+                    (int)rect.size.width, 
+                    (int)rect.size.height );
+        //WebKitDebugAtLevel (0x200, "draw time %e\n", CFAbsoluteTimeGetCurrent() - start);
+        [self unlockFocus];
+    }
+}
+
+- (void)setIsFlipped: (bool)flag
+{
+    ((WKWebViewPrivate *)_viewPrivate)->isFlipped = flag;
+}
+
+
+- (BOOL)isFlipped 
+{
+    return ((WKWebViewPrivate *)_viewPrivate)->isFlipped;
+}
+
+
+
+// Override superclass implementation.  We want to relayout when the frame size is changed.
+- (void)setFrame:(NSRect)frameRect
+{
+    [super setFrame:frameRect];
+    [self setNeedsLayout: YES];
+}
+
+
+- (void)mouseUp: (NSEvent *)event
+{
+    int button, state;
+     
+    if ([event type] == NSLeftMouseDown){
+        button = Qt::LeftButton;
+        state = Qt::LeftButton;
+    }
+    else if ([event type] == NSRightMouseDown){
+        button = Qt::RightButton;
+        state = Qt::RightButton;
+    }
+    else if ([event type] == NSOtherMouseDown){
+        button = Qt::MidButton;
+        state = Qt::MidButton;
+    }
+    else {
+        [NSException raise:WKRuntimeError format:@"WKWebView::mouseUp: unknown button type"];
+        button = 0; state = 0; // Shutup the compiler.
+    }
+    NSPoint p = [event locationInWindow];
+    
+    QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
+    ((WKWebViewPrivate *)_viewPrivate)->widget->viewportMouseReleaseEvent(kEvent);
+}
+
+- (void)mouseDown: (NSEvent *)event
+{
+    int button, state;
+     
+    if ([event type] == NSLeftMouseDown){
+        button = Qt::LeftButton;
+        state = Qt::LeftButton;
+    }
+    else if ([event type] == NSRightMouseDown){
+        button = Qt::RightButton;
+        state = Qt::RightButton;
+    }
+    else if ([event type] == NSOtherMouseDown){
+        button = Qt::MidButton;
+        state = Qt::MidButton;
+    }
+    else {
+        [NSException raise:WKRuntimeError format:@"WKWebView::mouseUp: unknown button type"];
+        button = 0; state = 0; // Shutup the compiler.
+    }
+    NSPoint p = [event locationInWindow];
+    
+    QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
+    ((WKWebViewPrivate *)_viewPrivate)->widget->viewportMousePressEvent(kEvent);
+}
+
+- (void)mouseDragged: (NSEvent *)event
+{
+    NSPoint p = [event locationInWindow];
+    //WebKitDebugAtLevel (0x200, "mouseDragged %f, %f\n", p.x, p.y);
+}
+
 @end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WKWebViewPrivate.h b/WebKit/WebView.subproj/WKWebViewPrivate.h
index d39520c..ae54238 100644
--- a/WebKit/WebView.subproj/WKWebViewPrivate.h
+++ b/WebKit/WebView.subproj/WKWebViewPrivate.h
@@ -5,9 +5,26 @@
         in WebCore.  Instances of this class are referenced by _viewPrivate in 
         NSWebPageView.
 */
+#import <Cocoa/Cocoa.h>
 
- at interface NSWebPageViewPrivate : NSObject
+#import <WebKit/WKWebController.h>
+#import <WebKit/WKWebView.h>
+
+class QWidget;
+class KHTMLPart;
+class KHTMLView;
+
+ at interface WKWebViewPrivate : NSObject
 {
+    id <WKWebController>controller;
+    KHTMLView *widget;
+    bool isFlipped;
+    bool needsLayout;
 }
 
- at end
\ No newline at end of file
+ at end
+
+ at interface WKWebView (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller;
+- (void)_resetView;
+ at end
diff --git a/WebKit/WebView.subproj/WKWebViewPrivate.mm b/WebKit/WebView.subproj/WKWebViewPrivate.mm
new file mode 100644
index 0000000..9b78fc6
--- /dev/null
+++ b/WebKit/WebView.subproj/WKWebViewPrivate.mm
@@ -0,0 +1,62 @@
+/*	WKWebViewPrivate.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+        
+        Private header file.  This file may reference classes (both ObjectiveC and C++)
+        in WebCore.  Instances of this class are referenced by _viewPrivate in 
+        NSWebPageView.
+*/
+#import <WKWebViewPrivate.h>
+
+// Includes from KDE
+#include <khtmlview.h>
+
+ at implementation WKWebViewPrivate
+
+- init
+{
+    [super init];
+    
+    controller = nil;
+    widget = 0;
+    
+    return self;
+}
+
+
+- (void)dealloc
+{
+    // controller is not retained!  WKWebControllers maintain
+    // a reference to their view and main data source.
+
+    //if (widget)
+    //    delete widget;
+}
+
+
+
+ at end
+
+
+ at implementation WKWebView  (WKPrivate)
+
+- (void)_resetView 
+{
+    NSArray *views = [self subviews];
+    int count;
+    
+    count = [views count];
+    while (count--){
+        //WebKitDebugAtLevel(0x200, "Removing %p %s\n", [views objectAtIndex: 0], DEBUG_OBJECT([[[views objectAtIndex: 0] class] className]));
+        [[views objectAtIndex: 0] removeFromSuperviewWithoutNeedingDisplay]; 
+    }
+    [self setFrameSize: NSMakeSize (0,0)];
+}
+
+
+- (void)_setController: (id <WKWebController>)controller
+{
+    // Not retained.
+    ((WKWebViewPrivate *)_viewPrivate)->controller = controller;    
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index a5249b0..4262a6e 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -100,59 +100,11 @@
 */
 
 
+ at class WKWebDataSource;
+ at class WKError;
+ at class WKWebView;
 
-
-
-/*
-   ============================================================================= 
-
-    Is WKConcreteWebController the right name?  The name fits with the
-    scheme used by Foundation, although Foundation's concrete classes
-    typically aren't public.
-*/
-#ifndef NEW_WEBKIT_API
- at interface WKDefaultWebController : NSObject
- at end
-#else
- at interface WKDefaultWebController : NSObject <WKWebController>
-
-- initWithView: (WKWebView *) dataSource: (WKWebDataSource *)dataSource;
-
-- setDirectsAllLinksToSystemBrowser: (BOOL)flag
-- (BOOL)directsAllLinksToSystemBrowser;
-
-- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource;
-- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource;
-- (WKWebDataSource *)dataSourceForView: (WKWebVew *)view
-
-- (WKWebView *)mainView;
-- (WKWebDataSource *)mainDataSource;
-
-- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name;
-
-- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier;
-
- at end
-
-
-
-/*
-   ============================================================================= 
-
-    WKWebController implements all the behavior that ties together WKWebView
-    and WKWebDataSource.  See each inherited protocol for a more complete
-    description.
-    
-    [Don and I both agree that all these little protocols are useful to cleanly
-     describe snippets of behavior, but do we explicity reference them anywhere,
-     or do we just use the umbrella protocol?]
-*/
- at protocol WKWebController <WKLoadHandler, WKScriptContextHandler, WKAuthenticationHandler, WKLocationChangeHandler>
- at end
-
-
-
-
+#ifdef TENTATIVE_API
 /*
    ============================================================================= 
 
@@ -191,6 +143,7 @@
 - (void)serverRedirectTo: (NSURL *)url;
 
 @end
+#endif
 
 
 /*
@@ -230,7 +183,9 @@
     int bytesSoFar;	// 0 if this is the start of load
     int totalToLoad;	// -1 if this is not known.
                         // bytesSoFar == totalLoaded when complete
+#ifdef TENTATIVE_API
     WK_LOAD_TYPES type;	// load types, either image, css, jscript, or html
+#endif
 }
 @end
 
@@ -288,11 +243,13 @@
                                // location has failed; useful to be able to show a 
                                // different dialog based on count
 }
+ at end
+
 
 @protocol WKAuthenticationHandler
 // Can we make this work without blocking the UI, or do we need to make it explicitly async
 // somehow?
-- (WKSimpleAuthenticationResult) authenticate: (WKSimpleAuthenticationRequest)request;
+- (WKSimpleAuthenticationResult *) authenticate: (WKSimpleAuthenticationRequest *)request;
 
 // do we need anything for fancier authentication schemes like kerberos or GSSAPI?
 
@@ -329,12 +286,22 @@
 @end
 
 
+
+
+
 /*
    ============================================================================= 
 
+    WKWebController implements all the behavior that ties together WKWebView
+    and WKWebDataSource.  See each inherited protocol for a more complete
+    description.
+    
+    [Don and I both agree that all these little protocols are useful to cleanly
+     describe snippets of behavior, but do we explicity reference them anywhere,
+     or do we just use the umbrella protocol?]
 */
- at protocol WKFrame
+ at protocol WKWebController <WKLoadHandler, WKScriptContextHandler, WKAuthenticationHandler, WKLocationChangeHandler>
 @end
 
-#endif
+
 
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 085fbc8..c8c2feb 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -66,7 +66,10 @@
 	Minor naming changes.
 
    ============================================================================= */
-   
+
+#ifdef TENTATIVE_API
+ at class WKLoader;
+#endif
 
 @interface WKWebDataSource : NSObject
 {
@@ -74,22 +77,19 @@
     id _dataSourcePrivate;
 }
 
-#ifdef READY_FOR_PRIMETIME
-
 
 // Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
 - initWithURL: (NSURL *)inputURL;
 
+#ifdef TENTATIVE_API
 - initWithData: (NSData *)data;
 - initWithString: (NSString *)string;
-
-// Ken, need some help with one.
 - initWithLoader: (WKLoader *)loader;
-
+#endif
 
 // Returns nil if this data source represents the main document.  Otherwise
 // returns the parent data source.
-- (WKDataSource *)parent;
+- (WKWebDataSource *)parent;
 
 
 // Returns YES if this is the main document.  The main document is the 'top'
@@ -109,7 +109,7 @@
 
 // findDataSourceForFrameNamed: returns the child data source associated with
 // the frame named 'name', or nil. 
-- (WKWebDataSource) findDataSourceForFrameNamed: (NSString *)name;
+- (WKWebDataSource *) findDataSourceForFrameNamed: (NSString *)name;
 
 
 - (BOOL)frameExists: (NSString *)name;
@@ -161,9 +161,10 @@
 - (BOOL)isLoading;
 
 
+#ifdef TENTATIVE_API
 // Get DOM access to the document.
 - (WKDOMDocument *)document;
-
+#endif
 
 // Get the actual source of the docment.
 - (NSString *)documentText;
@@ -178,8 +179,8 @@
 
 
 // Style sheet
-- (void)setUserStyleSheet: (NSURL *)url;
-- (void)setUserStyleSheet: (NSString *)sheet;
+- (void)setUserStyleSheetFromURL: (NSURL *)url;
+- (void)setUserStyleSheetFromString: (NSString *)sheet;
 
 
 // a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
@@ -195,8 +196,6 @@
 // Returns nil or the page title.
 - (NSString *)pageTitle;
 
-#endif
-
 @end
 
 
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 419bef8..48d1b3c 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -3,6 +3,8 @@
 	Copyright 2001, Apple, Inc. All rights reserved.
 */
 #import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
 
 @implementation WKWebDataSource
 
@@ -29,4 +31,233 @@
     [defaults registerDefaults:dict];
 }
 
+
+- (void)_commonInitialization
+{
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate) = [[WKWebDataSourcePrivate alloc] init];
+}
+
+// Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
+- initWithURL: (NSURL *)inputURL
+{
+    [super init];
+    [self _commonInitialization];
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate)->inputURL = inputURL;
+    return self;
+}
+
+
+#ifdef TENTATIVE_API
+- initWithData: (NSData *)data 
+- initWithString: (NSString *)string;
+- initWithLoader: (WKLoader *)loader;
+#endif
+
+
+// Returns nil if this data source represents the main document.  Otherwise
+// returns the parent data source.
+- (WKWebDataSource *)parent 
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent;
+}
+
+
+
+// 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 (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent == nil)
+        return YES;
+    return NO;
+}
+
+
+// Returns an array of WKWebDataSource.  The data sources in the array are
+// the data source assoicated with a frame set or iframe.  If the main document
+// is not a frameset, or has not iframes children will return nil.
+- (NSArray *)children
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->children;
+}
+
+
+// Returns an array of NSStrings or nil.  The NSStrings corresponds to
+// frame names.  If this data source is the main document and has no
+// frames then frameNames will return nil.
+- (NSArray *)frameNames
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::frameNames is not implemented"];
+    return nil;
+}
+
+
+// findDataSourceForFrameNamed: returns the child data source associated with
+// the frame named 'name', or nil. 
+- (WKWebDataSource *) findDataSourceForFrameNamed: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::findDataSourceForFrameNamed: is not implemented"];
+    return nil;
+}
+
+
+- (BOOL)frameExists: (NSString *)name
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::frameExists: is not implemented"];
+    return NO;
+}
+
+
+- (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::openURL:inFrameNamed: is not implemented"];
+}
+
+
+- (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::openURL:inIFrame: is not implemented"];
+}
+
+
+- (id <WKWebController>)controller
+{
+    // All data source from a document (frameset) share the same
+    // controller.
+    if (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent != nil)
+        return [((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent controller];
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->controller;
+}
+
+
+// May return nil if not initialized with a URL.
+- (NSURL *)inputURL
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->inputURL;
+}
+
+
+// finalURL returns the URL that was actually used.  The final URL
+// may be different than the inputURL if the server redirects.
+// <WKLocationChangedHandler> includes a message that is sent when
+// a redirect is processed
+- (NSURL *)finalURL
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::finalURL is not implemented"];
+    return nil;
+}
+
+
+// Returns true if the inputURL has been redirected by the server,
+// i.e. inputURL != finalURL.
+- (BOOL)wasRedirected
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::wasRedirected is not implemented"];
+    return NO;
+}
+
+
+// Start actually getting (if initialized with a URL) and parsing data. If the data source
+// is still performing a previous load it will be stopped.
+// If forceRefresh is YES the document will load from the net, not the cache.
+- (void)startLoading: (BOOL)forceRefresh
+{
+    KURL url = [[[self inputURL] absoluteString] cString];
+    
+    [self _part]->openURL (url);
+}
+
+
+// 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.
+// Returns NO if the data source is not currently loading.
+- (void)stopLoading
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::stopLoading is not implemented"];
+}
+
+
+// Returns YES if there are any pending loads.
+- (BOOL)isLoading
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::isLoading is not implemented"];
+    return NO;
+}
+
+
+#ifdef TENTATIVE_API
+// Get DOM access to the document.
+- (WKDOMDocument *)document;
+#endif
+
+// Get the actual source of the docment.
+- (NSString *)documentText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::documentText is not implemented"];
+    return nil;
+}
+
+
+// URL reference point, these should probably not be public for 1.0.
+- (NSURL *)base
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::base is not implemented"];
+    return nil;
+}
+
+
+- (NSString *)baseTarget
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::baseTarget is not implemented"];
+    return nil;
+}
+
+
+- (NSString *)encoding
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::encoding is not implemented"];
+    return nil;
+}
+
+
+// Style sheet
+- (void)setUserStyleSheetFromURL: (NSURL *)url
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::setUserStyleSheetFromURL: is not implemented"];
+}
+
+
+- (void)setUserStyleSheetFromString: (NSString *)sheet
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::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.
+- (NSImage *)icon
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::setUserStyleSheetFromString: is not implemented"];
+    return nil;
+}
+
+
+// Is page secure, e.g. https, ftps
+- (BOOL)isPageSecure
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::isPageSecure is not implemented"];
+    return NO;
+}
+
+
+// Returns nil or the page title.
+- (NSString *)pageTitle
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebDataSource::pageTitle is not implemented"];
+    return nil;
+}
+
+
 @end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 380846a..718b7f4 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -5,12 +5,28 @@
         in WebCore.  Instances of this class are referenced by _dataSourcePrivate in
         NSWebPageDataSource.
 */
+#import <Cocoa/Cocoa.h>
 
+#import <WebKit/WKWebDataSource.h>
 
- at interface NSWebPageDataSourcePrivate : NSObject
+// includes from kde
+#include <khtmlview.h>
+
+ at interface WKWebDataSourcePrivate : NSObject
 {
+    WKWebDataSource *parent;
+    NSArray *children;
+    id <WKWebController>controller;
+    NSURL *inputURL;
+    KHTMLPart *part;
 }
 
+- init;
+- (void)dealloc;
 
 @end
 
+ at interface WKWebDataSource (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller;
+- (KHTMLPart *)_part;
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
new file mode 100644
index 0000000..2e9824e
--- /dev/null
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -0,0 +1,55 @@
+/*	WKWebDataSourcePrivate.h
+	Copyright 2001, Apple, Inc. All rights reserved.
+
+        Private header file.  This file may reference classes (both ObjectiveC and C++)
+        in WebCore.  Instances of this class are referenced by _dataSourcePrivate in
+        NSWebPageDataSource.
+*/
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKException.h>
+
+
+
+
+ at implementation WKWebDataSourcePrivate 
+
+- init
+{
+    parent = nil;
+    children = nil;
+    controller = nil;
+    inputURL = nil;
+
+    part = new KHTMLPart();
+    
+    return self;
+}
+
+- (void)dealloc
+{
+    // controller is not retained!  WKWebControllers maintain
+    // a reference to their view and main data source.
+    [parent release];
+    [children release];
+    
+    //delete part;
+}
+
+ at end
+
+ at implementation WKWebDataSource (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller
+{
+    if (((WKWebDataSourcePrivate *)_dataSourcePrivate)->parent != nil)
+        [NSException raise:WKRuntimeError format:@"WKWebDataSource::_setController: called not called on main data source."];
+    ((WKWebDataSourcePrivate *)_dataSourcePrivate)->controller = controller;
+}
+
+
+- (KHTMLPart *)_part
+{
+    return ((WKWebDataSourcePrivate *)_dataSourcePrivate)->part;
+}
+
+
+ at end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebFrameView.h b/WebKit/WebView.subproj/WebFrameView.h
index a4f596b..b0de617 100644
--- a/WebKit/WebView.subproj/WebFrameView.h
+++ b/WebKit/WebView.subproj/WebFrameView.h
@@ -23,13 +23,6 @@
 
     ...
 
-    or
-
-    ...
-    
-    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame url: url];
-    [[[view controller] dataSource] startLoading];
-
     
     What is the behaviour of the view after it has been initialized and 
     startLoading: is called?
@@ -86,25 +79,28 @@
     id _viewPrivate;
 }
 
-#ifdef READY_FOR_PRIMETIME
-
 - initWithFrame: (NSRect)frame;
 
-// Convenience method.  initWithFrame:url: will create a controller and data source.
-- initWithFrame: (NSRect)frame url: (NSURL *)url;
-
 
+#ifdef TENTATIVE_API
 // Set and get the delegate.
 - (void)setDelegate: (id <WKWebViewDelegate>)delegate;
 - (id <WKWebViewDelegate>)delegate;
+#endif
 
  
 // Set and get the controller.  Note that the controller is not retained.
 // Perhaps setController: should be private?
-//- (void)setController: (id <WKWebController>)controller;
 - (id <WKWebController>)controller;
 
 
+// This method is typically called by the view's controller when
+// the data source is changed.
+- (void)dataSourceChanged;
+
+- (void)setNeedsLayout: (bool)flag;
+
+
 // This method should not be public until we have a more completely
 // understood way to subclass WKWebView.
 - (void)layout;
@@ -118,9 +114,9 @@
 - (void)setFontSizes: (NSArray *)sizes;
 - (NSArray *)fontSizes;
 - (void)resetFontSizes;
-- (void)setStandardFont: (NSSFont *)font;
+- (void)setStandardFont: (NSFont *)font;
 - (NSFont *)standardFont;
-- (void)setFixedFont: (NSSFont *)font;
+- (void)setFixedFont: (NSFont *)font;
 - (NSFont *)fixedFont;
 
 
@@ -133,25 +129,25 @@
 
 // Returns an array of built-in context menu items for this node.
 // Generally called by WKContextMenuHandlers from contextMenuItemsForNode:
+#ifdef TENTATIVE_API
 - (NSArray *)defaultContextMenuItemsForNode: (WKDOMNode *);
+#endif
 - (void)setContextMenusEnabled: (BOOL)flag;
 - (BOOL)contextMenusEnabled;
 
 
 // Remove the selection.
-- deselectText;
+- (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)case
+- (void)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag;
 
 
 // Get an attributed string that represents the current selection.
 - (NSAttributedString *)selectedText;
 
-#endif
-
 @end
 
 
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 3cf71cb..19f2fb2 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -2,7 +2,349 @@
 	Copyright 2001, Apple, Inc. All rights reserved.
 */
 #import <WebKit/WKWebView.h>
+#import <WebKit/WKWebViewPrivate.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebDataSourcePrivate.h>
+#import <WebKit/WKDefaultWebController.h>
+#import <WebKit/WKException.h>
+#import <WebKit/WebKitDebug.h>
+
+// KDE related includes
+#include <khtmlview.h>
+#include <qwidget.h>
+#include <qpainter.h>
+#include <qevent.h>
+#include <html/html_documentimpl.h>
+
 
 @implementation WKWebView
 
+- initWithFrame: (NSRect) frame
+{
+    [super initWithFrame: frame];
+
+    _viewPrivate = [[WKWebViewPrivate alloc] init];
+
+    ((WKWebViewPrivate *)_viewPrivate)->isFlipped = YES;
+    ((WKWebViewPrivate *)_viewPrivate)->needsLayout = YES;
+
+    return self;
+}
+
+
+- (void)dealloc 
+{
+    [_viewPrivate release];
+}
+
+ 
+// Set and get the controller.  Note that the controller is not retained.
+// Perhaps setController: should be private?
+- (id <WKWebController>)controller
+{
+    return ((WKWebViewPrivate *)_viewPrivate)->controller;
+}
+
+
+
+// This method is typically called by the view's controller when
+// the data source is changed.
+- (void)dataSourceChanged 
+{
+    WKWebViewPrivate *data = ((WKWebViewPrivate *)_viewPrivate);
+    NSRect r = [self frame];
+    
+    if (data->widget)
+        delete data->widget;
+
+    // Nasty!  Setup the cross references between the KHTMLView and
+    // the KHTMLPart.
+    KHTMLPart *part = [[[self controller] mainDataSource] _part];
+
+    data->widget = new KHTMLView (part, 0);
+    part->setView (data->widget);
+    
+    data->widget->setView (self);
+    
+    data->widget->resize (r.size.width,r.size.height);
+
+    [self _resetView];
+    [self layout];
+}
+
+
+
+// This method should not be public until we have a more completely
+// understood way to subclass WKWebView.
+- (void)layout
+{
+    KHTMLView *widget = ((WKWebViewPrivate *)_viewPrivate)->widget;
+    if (widget->part()->xmlDocImpl() && 
+        widget->part()->xmlDocImpl()->renderer()){
+        if (((WKWebViewPrivate *)_viewPrivate)->needsLayout){
+            //double start = CFAbsoluteTimeGetCurrent();
+            widget->layout(TRUE);
+            //WebKitDebugAtLevel (0x200, "layout time %e\n", CFAbsoluteTimeGetCurrent() - start);
+            ((WKWebViewPrivate *)_viewPrivate)->needsLayout = NO;
+        }
+    }
+}
+
+
+// Stop animating animated GIFs, etc.
+- (void)stopAnimations
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::stopAnimations is not implemented"];
+}
+
+
+// Font API
+- (void)setFontSizes: (NSArray *)sizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setFontSizes: is not implemented"];
+}
+
+
+- (NSArray *)fontSizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::fontSizes is not implemented"];
+    return nil;
+}
+
+
+
+- (void)resetFontSizes
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::resetFontSizes is not implemented"];
+}
+
+
+- (void)setStandardFont: (NSFont *)font
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setStandardFont: is not implemented"];
+}
+
+
+- (NSFont *)standardFont
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::standardFont is not implemented"];
+    return nil;
+}
+
+
+- (void)setFixedFont: (NSFont *)font
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setFixedFont: is not implemented"];
+}
+
+
+- (NSFont *)fixedFont
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::fixedFont is not implemented"];
+    return nil;
+}
+
+
+// Drag and drop links and images.  Others?
+- (void)setCanDragFrom: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setCanDragFrom: is not implemented"];
+}
+
+- (BOOL)canDragFrom
+{
+    return NO;
+}
+
+- (void)setCanDragTo: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setCanDragTo: is not implemented"];
+}
+
+- (BOOL)canDragTo
+{
+    return NO;
+}
+
+
+// Returns an array of built-in context menu items for this node.
+// Generally called by WKContextMenuHandlers from contextMenuItemsForNode:
+#ifdef TENTATIVE_API
+- (NSArray *)defaultContextMenuItemsForNode: (WKDOMNode *)
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::defaultContextMenuItemsForNode: is not implemented"];
+    return nil;
+}
+#endif
+
+- (void)setContextMenusEnabled: (BOOL)flag
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::setContextMenusEnabled: is not implemented"];
+}
+
+
+- (BOOL)contextMenusEnabled;
+{
+    return NO;
+}
+
+
+// Remove the selection.
+- (void)deselectText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::deselectText: is not implemented"];
+}
+
+
+
+// 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
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::searchFor:direction:caseSensitive: is not implemented"];
+}
+
+
+// Get an attributed string that represents the current selection.
+- (NSAttributedString *)selectedText
+{
+    [NSException raise:WKMethodNotYetImplemented format:@"WKWebView::selectedText is not implemented"];
+    return nil;
+}
+
+
+
+#ifdef DELAY_LAYOUT
+- delayLayout: sender
+{
+    [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(delayLayout:) object: self];
+    KWQDEBUG("KWQHTMLView:  delayLayout called\n");
+    [self setNeedsLayout: YES];
+    [self setNeedsDisplay: YES];
+}
+
+-(void)notificationReceived:(NSNotification *)notification
+{
+    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
+        KWQDEBUG1("KWQHTMLView: Received notification, %s\n", DEBUG_OBJECT([notification name]));
+        [self performSelector:@selector(delayLayout:) withObject:self afterDelay:(NSTimeInterval)0.5];
+    }
+}
+#else
+-(void)notificationReceived:(NSNotification *)notification
+{
+    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
+        [self setNeedsLayout: YES];
+        [self setNeedsDisplay: YES];
+    }
+}
+#endif
+
+
+- (void)setNeedsLayout: (bool)flag
+{
+    ((WKWebViewPrivate *)_viewPrivate)->needsLayout = flag;
+}
+
+
+// This should eventually be removed.
+- (void)drawRect:(NSRect)rect {
+    KHTMLView *widget = ((WKWebViewPrivate *)_viewPrivate)->widget;
+
+    if (widget != 0l){        
+        [self layout];
+
+        QPainter p(widget);    
+        
+        [self lockFocus];
+
+        //double start = CFAbsoluteTimeGetCurrent();
+        ((KHTMLView *)widget)->drawContents( &p, (int)rect.origin.x, 
+                    (int)rect.origin.y, 
+                    (int)rect.size.width, 
+                    (int)rect.size.height );
+        //WebKitDebugAtLevel (0x200, "draw time %e\n", CFAbsoluteTimeGetCurrent() - start);
+        [self unlockFocus];
+    }
+}
+
+- (void)setIsFlipped: (bool)flag
+{
+    ((WKWebViewPrivate *)_viewPrivate)->isFlipped = flag;
+}
+
+
+- (BOOL)isFlipped 
+{
+    return ((WKWebViewPrivate *)_viewPrivate)->isFlipped;
+}
+
+
+
+// Override superclass implementation.  We want to relayout when the frame size is changed.
+- (void)setFrame:(NSRect)frameRect
+{
+    [super setFrame:frameRect];
+    [self setNeedsLayout: YES];
+}
+
+
+- (void)mouseUp: (NSEvent *)event
+{
+    int button, state;
+     
+    if ([event type] == NSLeftMouseDown){
+        button = Qt::LeftButton;
+        state = Qt::LeftButton;
+    }
+    else if ([event type] == NSRightMouseDown){
+        button = Qt::RightButton;
+        state = Qt::RightButton;
+    }
+    else if ([event type] == NSOtherMouseDown){
+        button = Qt::MidButton;
+        state = Qt::MidButton;
+    }
+    else {
+        [NSException raise:WKRuntimeError format:@"WKWebView::mouseUp: unknown button type"];
+        button = 0; state = 0; // Shutup the compiler.
+    }
+    NSPoint p = [event locationInWindow];
+    
+    QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
+    ((WKWebViewPrivate *)_viewPrivate)->widget->viewportMouseReleaseEvent(kEvent);
+}
+
+- (void)mouseDown: (NSEvent *)event
+{
+    int button, state;
+     
+    if ([event type] == NSLeftMouseDown){
+        button = Qt::LeftButton;
+        state = Qt::LeftButton;
+    }
+    else if ([event type] == NSRightMouseDown){
+        button = Qt::RightButton;
+        state = Qt::RightButton;
+    }
+    else if ([event type] == NSOtherMouseDown){
+        button = Qt::MidButton;
+        state = Qt::MidButton;
+    }
+    else {
+        [NSException raise:WKRuntimeError format:@"WKWebView::mouseUp: unknown button type"];
+        button = 0; state = 0; // Shutup the compiler.
+    }
+    NSPoint p = [event locationInWindow];
+    
+    QMouseEvent *kEvent = new QMouseEvent(QEvent::MouseButtonPress, QPoint(p.x, p.y), button, state);
+    ((WKWebViewPrivate *)_viewPrivate)->widget->viewportMousePressEvent(kEvent);
+}
+
+- (void)mouseDragged: (NSEvent *)event
+{
+    NSPoint p = [event locationInWindow];
+    //WebKitDebugAtLevel (0x200, "mouseDragged %f, %f\n", p.x, p.y);
+}
+
 @end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index d39520c..ae54238 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -5,9 +5,26 @@
         in WebCore.  Instances of this class are referenced by _viewPrivate in 
         NSWebPageView.
 */
+#import <Cocoa/Cocoa.h>
 
- at interface NSWebPageViewPrivate : NSObject
+#import <WebKit/WKWebController.h>
+#import <WebKit/WKWebView.h>
+
+class QWidget;
+class KHTMLPart;
+class KHTMLView;
+
+ at interface WKWebViewPrivate : NSObject
 {
+    id <WKWebController>controller;
+    KHTMLView *widget;
+    bool isFlipped;
+    bool needsLayout;
 }
 
- at end
\ No newline at end of file
+ at end
+
+ at interface WKWebView (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller;
+- (void)_resetView;
+ at end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index d39520c..ae54238 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -5,9 +5,26 @@
         in WebCore.  Instances of this class are referenced by _viewPrivate in 
         NSWebPageView.
 */
+#import <Cocoa/Cocoa.h>
 
- at interface NSWebPageViewPrivate : NSObject
+#import <WebKit/WKWebController.h>
+#import <WebKit/WKWebView.h>
+
+class QWidget;
+class KHTMLPart;
+class KHTMLView;
+
+ at interface WKWebViewPrivate : NSObject
 {
+    id <WKWebController>controller;
+    KHTMLView *widget;
+    bool isFlipped;
+    bool needsLayout;
 }
 
- at end
\ No newline at end of file
+ at end
+
+ at interface WKWebView (WKPrivate)
+- (void)_setController: (id <WKWebController>)controller;
+- (void)_resetView;
+ at end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
new file mode 100644
index 0000000..9b78fc6
--- /dev/null
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -0,0 +1,62 @@
+/*	WKWebViewPrivate.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+        
+        Private header file.  This file may reference classes (both ObjectiveC and C++)
+        in WebCore.  Instances of this class are referenced by _viewPrivate in 
+        NSWebPageView.
+*/
+#import <WKWebViewPrivate.h>
+
+// Includes from KDE
+#include <khtmlview.h>
+
+ at implementation WKWebViewPrivate
+
+- init
+{
+    [super init];
+    
+    controller = nil;
+    widget = 0;
+    
+    return self;
+}
+
+
+- (void)dealloc
+{
+    // controller is not retained!  WKWebControllers maintain
+    // a reference to their view and main data source.
+
+    //if (widget)
+    //    delete widget;
+}
+
+
+
+ at end
+
+
+ at implementation WKWebView  (WKPrivate)
+
+- (void)_resetView 
+{
+    NSArray *views = [self subviews];
+    int count;
+    
+    count = [views count];
+    while (count--){
+        //WebKitDebugAtLevel(0x200, "Removing %p %s\n", [views objectAtIndex: 0], DEBUG_OBJECT([[[views objectAtIndex: 0] class] className]));
+        [[views objectAtIndex: 0] removeFromSuperviewWithoutNeedingDisplay]; 
+    }
+    [self setFrameSize: NSMakeSize (0,0)];
+}
+
+
+- (void)_setController: (id <WKWebController>)controller
+{
+    // Not retained.
+    ((WKWebViewPrivate *)_viewPrivate)->controller = controller;    
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index a5249b0..4262a6e 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -100,59 +100,11 @@
 */
 
 
+ at class WKWebDataSource;
+ at class WKError;
+ at class WKWebView;
 
-
-
-/*
-   ============================================================================= 
-
-    Is WKConcreteWebController the right name?  The name fits with the
-    scheme used by Foundation, although Foundation's concrete classes
-    typically aren't public.
-*/
-#ifndef NEW_WEBKIT_API
- at interface WKDefaultWebController : NSObject
- at end
-#else
- at interface WKDefaultWebController : NSObject <WKWebController>
-
-- initWithView: (WKWebView *) dataSource: (WKWebDataSource *)dataSource;
-
-- setDirectsAllLinksToSystemBrowser: (BOOL)flag
-- (BOOL)directsAllLinksToSystemBrowser;
-
-- (void)setView: (WKWebView *)view andDataSource: (WKWebDataSource *)dataSource;
-- (WKWebView *)viewForDataSource: (WKWebDataSource *)dataSource;
-- (WKWebDataSource *)dataSourceForView: (WKWebVew *)view
-
-- (WKWebView *)mainView;
-- (WKWebDataSource *)mainDataSource;
-
-- (void)createViewForDataSource: (WKWebDataSource *)dataSource inFrameNamed: (NSString *)name;
-
-- (void)createViewForDataSource: (WKWebDataSource *)dataSource inIFrame: (id)iFrameIdentifier;
-
- at end
-
-
-
-/*
-   ============================================================================= 
-
-    WKWebController implements all the behavior that ties together WKWebView
-    and WKWebDataSource.  See each inherited protocol for a more complete
-    description.
-    
-    [Don and I both agree that all these little protocols are useful to cleanly
-     describe snippets of behavior, but do we explicity reference them anywhere,
-     or do we just use the umbrella protocol?]
-*/
- at protocol WKWebController <WKLoadHandler, WKScriptContextHandler, WKAuthenticationHandler, WKLocationChangeHandler>
- at end
-
-
-
-
+#ifdef TENTATIVE_API
 /*
    ============================================================================= 
 
@@ -191,6 +143,7 @@
 - (void)serverRedirectTo: (NSURL *)url;
 
 @end
+#endif
 
 
 /*
@@ -230,7 +183,9 @@
     int bytesSoFar;	// 0 if this is the start of load
     int totalToLoad;	// -1 if this is not known.
                         // bytesSoFar == totalLoaded when complete
+#ifdef TENTATIVE_API
     WK_LOAD_TYPES type;	// load types, either image, css, jscript, or html
+#endif
 }
 @end
 
@@ -288,11 +243,13 @@
                                // location has failed; useful to be able to show a 
                                // different dialog based on count
 }
+ at end
+
 
 @protocol WKAuthenticationHandler
 // Can we make this work without blocking the UI, or do we need to make it explicitly async
 // somehow?
-- (WKSimpleAuthenticationResult) authenticate: (WKSimpleAuthenticationRequest)request;
+- (WKSimpleAuthenticationResult *) authenticate: (WKSimpleAuthenticationRequest *)request;
 
 // do we need anything for fancier authentication schemes like kerberos or GSSAPI?
 
@@ -329,12 +286,22 @@
 @end
 
 
+
+
+
 /*
    ============================================================================= 
 
+    WKWebController implements all the behavior that ties together WKWebView
+    and WKWebDataSource.  See each inherited protocol for a more complete
+    description.
+    
+    [Don and I both agree that all these little protocols are useful to cleanly
+     describe snippets of behavior, but do we explicity reference them anywhere,
+     or do we just use the umbrella protocol?]
 */
- at protocol WKFrame
+ at protocol WKWebController <WKLoadHandler, WKScriptContextHandler, WKAuthenticationHandler, WKLocationChangeHandler>
 @end
 
-#endif
+
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list