[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:52:07 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f7e02c466791d867e151a960c2e2739bea9cdaf9
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 10 01:33:02 2001 +0000

    More fixes.  Added support for incremental layout.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@433 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 173b1e1..8f51ddc 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -231,6 +231,7 @@ bool KHTMLPart::closeURL()
     
     // Reset the the current working URL to the default URL.
     d->m_workingURL = KURL();
+    //d->m_doc = 0;
 }
 
 
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 173b1e1..8f51ddc 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -231,6 +231,7 @@ bool KHTMLPart::closeURL()
     
     // Reset the the current working URL to the default URL.
     d->m_workingURL = KURL();
+    //d->m_doc = 0;
 }
 
 
diff --git a/WebCore/kwq/KWQNSTextField.mm b/WebCore/kwq/KWQNSTextField.mm
index e4f87cd..4e559dc 100644
--- a/WebCore/kwq/KWQNSTextField.mm
+++ b/WebCore/kwq/KWQNSTextField.mm
@@ -35,6 +35,7 @@
     formatter = [[KWQNSTextFieldFormatter alloc] init];
     [self setFormatter: formatter];
     widget = w;
+    return self;
 }
 
 - (void)dealloc
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index 30abf5d..be144e7 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -79,6 +79,8 @@ const float LargeNumberForText = 1.0e7;
     [self setDocumentView: textView];
     
     widget = w;
+    
+    return self;
 }
 
 
@@ -131,13 +133,13 @@ const float LargeNumberForText = 1.0e7;
 
 - (BOOL) isReadOnly
 {
-    return [textView isEditable];
+    return [textView isEditable] ? NO : YES;
 }
 
 
 - (void) setReadOnly: (BOOL)flag
 {
-    return [textView setEditable: flag];
+    return [textView setEditable: flag?NO:YES];
 }
 
 - (void) setText: (NSString *)s
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index be7cdb5..e9dfae5 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -122,7 +122,7 @@ bool QMultiLineEdit::isReadOnly() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
     
-    return [textView isEditable];
+    return [textView isEditable] ? NO : YES;
 }
 
 
@@ -130,7 +130,7 @@ void QMultiLineEdit::setReadOnly(bool flag)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
 
-    [textView setEditable: (BOOL)flag];
+    [textView setEditable: (BOOL)flag ? NO : YES];
 }
 
 
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index e4f87cd..4e559dc 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -35,6 +35,7 @@
     formatter = [[KWQNSTextFieldFormatter alloc] init];
     [self setFormatter: formatter];
     widget = w;
+    return self;
 }
 
 - (void)dealloc
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index aa6230c..e562664 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -36,6 +36,7 @@
     [super initWithFrame: r];
     widget = w;
     isFlipped = YES;
+    return self;
 }
 
 
@@ -64,6 +65,7 @@
 {
     [super initWithFrame: r];
     widget = w;
+    return self;
 }
 
 @end
@@ -75,6 +77,7 @@
 {
     [super initWithFrame: r];
     widget = w;
+    return self;
 }
 
 @end
@@ -84,10 +87,40 @@
 
 - initWithFrame: (NSRect) r widget: (QWidget *)w 
 {
+    NSNotificationCenter *notificationCenter;
+    SEL notificationReceivedSEL;
+
     [super initWithFrame: r];
     widget = w;
     isFlipped = YES;
     needsLayout = YES;
+    notificationCenter = [NSNotificationCenter defaultCenter];
+
+    notificationReceivedSEL = @selector(notificationReceived:);
+    [notificationCenter addObserver:self
+            selector:notificationReceivedSEL name:nil object:nil];
+            
+    return self;
+}
+
+-(void)notificationReceived:(NSNotification *)notification
+{
+    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
+        NSLog (@"KWQHTMLView: Received notification, %@", [notification name]);
+        [self setNeedsLayout: YES];
+        [self setNeedsDisplay: YES];
+    }
+}
+
+- (void)layout
+{
+    if (((KHTMLView *)widget)->part()->xmlDocImpl() && 
+        ((KHTMLView *)widget)->part()->xmlDocImpl()->renderer()){
+        if (needsLayout){
+            ((KHTMLView *)widget)->layout(TRUE);
+            needsLayout = NO;
+        }
+    }
 }
 
 
@@ -101,17 +134,9 @@
     if (widget != 0l){
         //widget->paint((void *)0);
         
-        QPainter p(widget);
-        NSRect frame = [self frame];
- 
-        if (((KHTMLView *)widget)->part()->xmlDocImpl() && 
-            ((KHTMLView *)widget)->part()->xmlDocImpl()->renderer()){
-            if (needsLayout){
-                ((KHTMLView *)widget)->layout(TRUE);
-                //needsLayout = NO;
-            }
-        }
-    
+        [self layout];
+
+        QPainter p(widget);         
         ((KHTMLView *)widget)->drawContents( &p, (int)rect.origin.x, 
                     (int)rect.origin.y, 
                     (int)rect.size.width, 
@@ -130,14 +155,29 @@
     return isFlipped;
 }
 
+
+- (void)resetView 
+{
+    NSArray *views = [self subviews];
+    int count;
+    
+    count = [views count];
+    while (count--){
+        NSLog (@"Removing 0x%08x %@", [views objectAtIndex: 0], [[[views objectAtIndex: 0] class] className]);
+        [[views objectAtIndex: 0] removeFromSuperviewWithoutNeedingDisplay]; 
+    }
+}
+
 // FIXME.  This should be replaced.  Ultimately we will use something like:
 // [[webView dataSource] setURL: url];
 - (void)setURL: (NSString *)urlString
 {
     KURL url = [urlString cString];
-    
+ 
+    [self resetView];
     part->openURL (url);
 }
 
+
 @end
 
diff --git a/WebCore/kwq/_KWQOwner.m b/WebCore/kwq/_KWQOwner.m
index b64de53..520adca 100644
--- a/WebCore/kwq/_KWQOwner.m
+++ b/WebCore/kwq/_KWQOwner.m
@@ -23,8 +23,6 @@
     subs = [containerView subviews];
     htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
     [htmlView setURL: url];
-    [htmlView setNeedsLayout: YES];
-    [containerView setNeedsDisplay: YES];
     
     return self;
 }
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 173b1e1..8f51ddc 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -231,6 +231,7 @@ bool KHTMLPart::closeURL()
     
     // Reset the the current working URL to the default URL.
     d->m_workingURL = KURL();
+    //d->m_doc = 0;
 }
 
 
diff --git a/WebCore/src/kwq/KWQNSTextField.mm b/WebCore/src/kwq/KWQNSTextField.mm
index e4f87cd..4e559dc 100644
--- a/WebCore/src/kwq/KWQNSTextField.mm
+++ b/WebCore/src/kwq/KWQNSTextField.mm
@@ -35,6 +35,7 @@
     formatter = [[KWQNSTextFieldFormatter alloc] init];
     [self setFormatter: formatter];
     widget = w;
+    return self;
 }
 
 - (void)dealloc
diff --git a/WebCore/src/kwq/KWQTextArea.mm b/WebCore/src/kwq/KWQTextArea.mm
index 30abf5d..be144e7 100644
--- a/WebCore/src/kwq/KWQTextArea.mm
+++ b/WebCore/src/kwq/KWQTextArea.mm
@@ -79,6 +79,8 @@ const float LargeNumberForText = 1.0e7;
     [self setDocumentView: textView];
     
     widget = w;
+    
+    return self;
 }
 
 
@@ -131,13 +133,13 @@ const float LargeNumberForText = 1.0e7;
 
 - (BOOL) isReadOnly
 {
-    return [textView isEditable];
+    return [textView isEditable] ? NO : YES;
 }
 
 
 - (void) setReadOnly: (BOOL)flag
 {
-    return [textView setEditable: flag];
+    return [textView setEditable: flag?NO:YES];
 }
 
 - (void) setText: (NSString *)s
diff --git a/WebCore/src/kwq/KWQTextEdit.mm b/WebCore/src/kwq/KWQTextEdit.mm
index be7cdb5..e9dfae5 100644
--- a/WebCore/src/kwq/KWQTextEdit.mm
+++ b/WebCore/src/kwq/KWQTextEdit.mm
@@ -122,7 +122,7 @@ bool QMultiLineEdit::isReadOnly() const
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
     
-    return [textView isEditable];
+    return [textView isEditable] ? NO : YES;
 }
 
 
@@ -130,7 +130,7 @@ void QMultiLineEdit::setReadOnly(bool flag)
 {
     KWQTextArea *textView = (KWQTextArea *)getView();
 
-    [textView setEditable: (BOOL)flag];
+    [textView setEditable: (BOOL)flag ? NO : YES];
 }
 
 
diff --git a/WebCore/src/kwq/KWQView.mm b/WebCore/src/kwq/KWQView.mm
index aa6230c..e562664 100644
--- a/WebCore/src/kwq/KWQView.mm
+++ b/WebCore/src/kwq/KWQView.mm
@@ -36,6 +36,7 @@
     [super initWithFrame: r];
     widget = w;
     isFlipped = YES;
+    return self;
 }
 
 
@@ -64,6 +65,7 @@
 {
     [super initWithFrame: r];
     widget = w;
+    return self;
 }
 
 @end
@@ -75,6 +77,7 @@
 {
     [super initWithFrame: r];
     widget = w;
+    return self;
 }
 
 @end
@@ -84,10 +87,40 @@
 
 - initWithFrame: (NSRect) r widget: (QWidget *)w 
 {
+    NSNotificationCenter *notificationCenter;
+    SEL notificationReceivedSEL;
+
     [super initWithFrame: r];
     widget = w;
     isFlipped = YES;
     needsLayout = YES;
+    notificationCenter = [NSNotificationCenter defaultCenter];
+
+    notificationReceivedSEL = @selector(notificationReceived:);
+    [notificationCenter addObserver:self
+            selector:notificationReceivedSEL name:nil object:nil];
+            
+    return self;
+}
+
+-(void)notificationReceived:(NSNotification *)notification
+{
+    if ([[notification name] rangeOfString: @"uri-fin-"].location == 0){
+        NSLog (@"KWQHTMLView: Received notification, %@", [notification name]);
+        [self setNeedsLayout: YES];
+        [self setNeedsDisplay: YES];
+    }
+}
+
+- (void)layout
+{
+    if (((KHTMLView *)widget)->part()->xmlDocImpl() && 
+        ((KHTMLView *)widget)->part()->xmlDocImpl()->renderer()){
+        if (needsLayout){
+            ((KHTMLView *)widget)->layout(TRUE);
+            needsLayout = NO;
+        }
+    }
 }
 
 
@@ -101,17 +134,9 @@
     if (widget != 0l){
         //widget->paint((void *)0);
         
-        QPainter p(widget);
-        NSRect frame = [self frame];
- 
-        if (((KHTMLView *)widget)->part()->xmlDocImpl() && 
-            ((KHTMLView *)widget)->part()->xmlDocImpl()->renderer()){
-            if (needsLayout){
-                ((KHTMLView *)widget)->layout(TRUE);
-                //needsLayout = NO;
-            }
-        }
-    
+        [self layout];
+
+        QPainter p(widget);         
         ((KHTMLView *)widget)->drawContents( &p, (int)rect.origin.x, 
                     (int)rect.origin.y, 
                     (int)rect.size.width, 
@@ -130,14 +155,29 @@
     return isFlipped;
 }
 
+
+- (void)resetView 
+{
+    NSArray *views = [self subviews];
+    int count;
+    
+    count = [views count];
+    while (count--){
+        NSLog (@"Removing 0x%08x %@", [views objectAtIndex: 0], [[[views objectAtIndex: 0] class] className]);
+        [[views objectAtIndex: 0] removeFromSuperviewWithoutNeedingDisplay]; 
+    }
+}
+
 // FIXME.  This should be replaced.  Ultimately we will use something like:
 // [[webView dataSource] setURL: url];
 - (void)setURL: (NSString *)urlString
 {
     KURL url = [urlString cString];
-    
+ 
+    [self resetView];
     part->openURL (url);
 }
 
+
 @end
 
diff --git a/WebCore/src/kwq/_KWQOwner.m b/WebCore/src/kwq/_KWQOwner.m
index b64de53..520adca 100644
--- a/WebCore/src/kwq/_KWQOwner.m
+++ b/WebCore/src/kwq/_KWQOwner.m
@@ -23,8 +23,6 @@
     subs = [containerView subviews];
     htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
     [htmlView setURL: url];
-    [htmlView setNeedsLayout: YES];
-    [containerView setNeedsDisplay: YES];
     
     return self;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list