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


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

    More fixes for window resizing, etc.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@434 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/KWQApplication.mm b/WebCore/kwq/KWQApplication.mm
index 6e2711a..8d7d782 100644
--- a/WebCore/kwq/KWQApplication.mm
+++ b/WebCore/kwq/KWQApplication.mm
@@ -142,6 +142,7 @@ void QApplication::setMainWidget(QWidget *w)
     [sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
     [sv setHasVerticalScroller: YES];
     [sv setHasHorizontalScroller: YES];
+    [w->getView() setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
     [sv setDocumentView: w->getView()];
     
     [((_KWQOwner *)application)->window setOpaque: FALSE];
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index d426d81..c577b04 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -169,6 +169,7 @@ void QScrollView::removeChild(QWidget* child)
 
 void QScrollView::resizeContents(int w, int h)
 {
+    NSLog (@"KWQScrollView resizing to w %d, h %d");
     resize (w, h);
 }
 
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index e562664..0496286 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -166,8 +166,16 @@
         NSLog (@"Removing 0x%08x %@", [views objectAtIndex: 0], [[[views objectAtIndex: 0] class] className]);
         [[views objectAtIndex: 0] removeFromSuperviewWithoutNeedingDisplay]; 
     }
+    [self setFrameSize: NSMakeSize (0,0)];
 }
 
+- (void)setFrame:(NSRect)frameRect
+{
+    [super setFrame:frameRect];
+    [self setNeedsLayout: YES];
+}
+
+
 // FIXME.  This should be replaced.  Ultimately we will use something like:
 // [[webView dataSource] setURL: url];
 - (void)setURL: (NSString *)urlString
diff --git a/WebCore/kwq/KWQWidget.h b/WebCore/kwq/KWQWidget.h
index 143d775..3d9ba4a 100644
--- a/WebCore/kwq/KWQWidget.h
+++ b/WebCore/kwq/KWQWidget.h
@@ -177,7 +177,7 @@ private:
     QWidget &operator=(const QWidget &);
 
     void setCRect( const QRect &r );
-    void internalSetGeometry( int x, int y, int w, int h, bool updateView );
+    void internalSetGeometry( int x, int y, int w, int h );
 
     void _initialize();
     
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index eaa7378..7dc6a5d 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -115,7 +115,7 @@ QSize QWidget::sizeHint() const
 
 void QWidget::resize(int w, int h) 
 {
-    internalSetGeometry( data->rect.x(), data->rect.y(), w, h, TRUE );
+    internalSetGeometry( pos().x(), pos().y(), w, h );
 }
 
 void QWidget::setActiveWindow() 
@@ -157,31 +157,36 @@ int QWidget::winId() const
 
 int QWidget::x() const 
 {
-    return data->rect.x();
+    NSRect vFrame = [getView() frame];
+    return (int)vFrame.origin.x;
 }
 
 
 int QWidget::y() const 
 {
-    return data->rect.y();
+    NSRect vFrame = [getView() frame];
+    return (int)vFrame.origin.y;
 }
 
 
 int QWidget::width() const 
 { 
-    return data->rect.width();
+    NSRect vFrame = [getView() frame];
+    return (int)vFrame.size.width;
 }
 
 
 int QWidget::height() const 
 {
-    return data->rect.height();
+    NSRect vFrame = [getView() frame];
+    return (int)vFrame.size.height;
 }
 
 
 QSize QWidget::size() const 
 {
-    return data->rect.size();
+    NSRect vFrame = [getView() frame];
+    return QSize ((int)vFrame.size.width, (int)vFrame.size.height);
 }
 
 
@@ -193,18 +198,16 @@ void QWidget::resize(const QSize &s)
 
 QPoint QWidget::pos() const 
 {
-    return data->pos;
+    NSRect vFrame = [getView() frame];
+    return QPoint ((int)vFrame.origin.x, (int)vFrame.origin.y);
 }
 
 
 void QWidget::move(int x, int y) 
 {
-//    internalSetGeometry( x + data->rect.x(),
-//			 y + data->rect.y(),
-//			 width(), height(), TRUE );
     internalSetGeometry( x,
 			 y,
-			 width(), height(), TRUE );
+			 width(), height() );
 }
 
 
@@ -388,34 +391,9 @@ void QWidget::hide()
 
 
 
-// Non-public
-void QWidget::setCRect( const QRect &r )
+void QWidget::internalSetGeometry( int x, int y, int w, int h )
 {
-    // One rect is both the same.
-    data->pos = r.topLeft();
-    data->rect = r;
-}
-
-void QWidget::internalSetGeometry( int x, int y, int w, int h, bool updateView )
-{
-    if ( w < 1 )				// invalid size
-	w = 1;
-    if ( h < 1 )
-	h = 1;
-
-    QRect  r( x, y, w, h );
-
-    // We only care about stuff that changes the geometry, or may
-    // cause the window manager to change its state
-    if ( data->rect == r )
-	return;
-
-    QSize oldSize( size() );
-
-    setCRect( r );
-
-    if (updateView != FALSE)
-        [data->view setFrame: NSMakeRect (data->rect.x(), data->rect.y(), data->rect.width(), data->rect.height())];
+    [data->view setFrame: NSMakeRect (x, y, w, h)];
 }
 
 
@@ -509,7 +487,6 @@ void QWidget::setView(NSView *view)
     data->view = [view retain];
         
     NSRect frame = [data->view frame];
-    internalSetGeometry (frame.origin.x, frame.origin.y, frame.size.width, frame.size.height, FALSE);
 }
 #else
 void *QWidget::getView() const
@@ -524,7 +501,6 @@ void QWidget::setView(void *view)
     data->view = [view retain];
         
     NSRect frame = [data->view frame];
-    internalSetGeometry (frame.x, frame.y, frame.width, frame.height, FALSE);
 }
 #endif
 
diff --git a/WebCore/kwq/qt/qwidget.h b/WebCore/kwq/qt/qwidget.h
index 143d775..3d9ba4a 100644
--- a/WebCore/kwq/qt/qwidget.h
+++ b/WebCore/kwq/qt/qwidget.h
@@ -177,7 +177,7 @@ private:
     QWidget &operator=(const QWidget &);
 
     void setCRect( const QRect &r );
-    void internalSetGeometry( int x, int y, int w, int h, bool updateView );
+    void internalSetGeometry( int x, int y, int w, int h );
 
     void _initialize();
     
diff --git a/WebCore/src/kwq/KWQApplication.mm b/WebCore/src/kwq/KWQApplication.mm
index 6e2711a..8d7d782 100644
--- a/WebCore/src/kwq/KWQApplication.mm
+++ b/WebCore/src/kwq/KWQApplication.mm
@@ -142,6 +142,7 @@ void QApplication::setMainWidget(QWidget *w)
     [sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
     [sv setHasVerticalScroller: YES];
     [sv setHasHorizontalScroller: YES];
+    [w->getView() setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
     [sv setDocumentView: w->getView()];
     
     [((_KWQOwner *)application)->window setOpaque: FALSE];
diff --git a/WebCore/src/kwq/KWQScrollView.mm b/WebCore/src/kwq/KWQScrollView.mm
index d426d81..c577b04 100644
--- a/WebCore/src/kwq/KWQScrollView.mm
+++ b/WebCore/src/kwq/KWQScrollView.mm
@@ -169,6 +169,7 @@ void QScrollView::removeChild(QWidget* child)
 
 void QScrollView::resizeContents(int w, int h)
 {
+    NSLog (@"KWQScrollView resizing to w %d, h %d");
     resize (w, h);
 }
 
diff --git a/WebCore/src/kwq/KWQView.mm b/WebCore/src/kwq/KWQView.mm
index e562664..0496286 100644
--- a/WebCore/src/kwq/KWQView.mm
+++ b/WebCore/src/kwq/KWQView.mm
@@ -166,8 +166,16 @@
         NSLog (@"Removing 0x%08x %@", [views objectAtIndex: 0], [[[views objectAtIndex: 0] class] className]);
         [[views objectAtIndex: 0] removeFromSuperviewWithoutNeedingDisplay]; 
     }
+    [self setFrameSize: NSMakeSize (0,0)];
 }
 
+- (void)setFrame:(NSRect)frameRect
+{
+    [super setFrame:frameRect];
+    [self setNeedsLayout: YES];
+}
+
+
 // FIXME.  This should be replaced.  Ultimately we will use something like:
 // [[webView dataSource] setURL: url];
 - (void)setURL: (NSString *)urlString
diff --git a/WebCore/src/kwq/KWQWidget.mm b/WebCore/src/kwq/KWQWidget.mm
index eaa7378..7dc6a5d 100644
--- a/WebCore/src/kwq/KWQWidget.mm
+++ b/WebCore/src/kwq/KWQWidget.mm
@@ -115,7 +115,7 @@ QSize QWidget::sizeHint() const
 
 void QWidget::resize(int w, int h) 
 {
-    internalSetGeometry( data->rect.x(), data->rect.y(), w, h, TRUE );
+    internalSetGeometry( pos().x(), pos().y(), w, h );
 }
 
 void QWidget::setActiveWindow() 
@@ -157,31 +157,36 @@ int QWidget::winId() const
 
 int QWidget::x() const 
 {
-    return data->rect.x();
+    NSRect vFrame = [getView() frame];
+    return (int)vFrame.origin.x;
 }
 
 
 int QWidget::y() const 
 {
-    return data->rect.y();
+    NSRect vFrame = [getView() frame];
+    return (int)vFrame.origin.y;
 }
 
 
 int QWidget::width() const 
 { 
-    return data->rect.width();
+    NSRect vFrame = [getView() frame];
+    return (int)vFrame.size.width;
 }
 
 
 int QWidget::height() const 
 {
-    return data->rect.height();
+    NSRect vFrame = [getView() frame];
+    return (int)vFrame.size.height;
 }
 
 
 QSize QWidget::size() const 
 {
-    return data->rect.size();
+    NSRect vFrame = [getView() frame];
+    return QSize ((int)vFrame.size.width, (int)vFrame.size.height);
 }
 
 
@@ -193,18 +198,16 @@ void QWidget::resize(const QSize &s)
 
 QPoint QWidget::pos() const 
 {
-    return data->pos;
+    NSRect vFrame = [getView() frame];
+    return QPoint ((int)vFrame.origin.x, (int)vFrame.origin.y);
 }
 
 
 void QWidget::move(int x, int y) 
 {
-//    internalSetGeometry( x + data->rect.x(),
-//			 y + data->rect.y(),
-//			 width(), height(), TRUE );
     internalSetGeometry( x,
 			 y,
-			 width(), height(), TRUE );
+			 width(), height() );
 }
 
 
@@ -388,34 +391,9 @@ void QWidget::hide()
 
 
 
-// Non-public
-void QWidget::setCRect( const QRect &r )
+void QWidget::internalSetGeometry( int x, int y, int w, int h )
 {
-    // One rect is both the same.
-    data->pos = r.topLeft();
-    data->rect = r;
-}
-
-void QWidget::internalSetGeometry( int x, int y, int w, int h, bool updateView )
-{
-    if ( w < 1 )				// invalid size
-	w = 1;
-    if ( h < 1 )
-	h = 1;
-
-    QRect  r( x, y, w, h );
-
-    // We only care about stuff that changes the geometry, or may
-    // cause the window manager to change its state
-    if ( data->rect == r )
-	return;
-
-    QSize oldSize( size() );
-
-    setCRect( r );
-
-    if (updateView != FALSE)
-        [data->view setFrame: NSMakeRect (data->rect.x(), data->rect.y(), data->rect.width(), data->rect.height())];
+    [data->view setFrame: NSMakeRect (x, y, w, h)];
 }
 
 
@@ -509,7 +487,6 @@ void QWidget::setView(NSView *view)
     data->view = [view retain];
         
     NSRect frame = [data->view frame];
-    internalSetGeometry (frame.origin.x, frame.origin.y, frame.size.width, frame.size.height, FALSE);
 }
 #else
 void *QWidget::getView() const
@@ -524,7 +501,6 @@ void QWidget::setView(void *view)
     data->view = [view retain];
         
     NSRect frame = [data->view frame];
-    internalSetGeometry (frame.x, frame.y, frame.width, frame.height, FALSE);
 }
 #endif
 
diff --git a/WebCore/src/kwq/qt/qwidget.h b/WebCore/src/kwq/qt/qwidget.h
index 143d775..3d9ba4a 100644
--- a/WebCore/src/kwq/qt/qwidget.h
+++ b/WebCore/src/kwq/qt/qwidget.h
@@ -177,7 +177,7 @@ private:
     QWidget &operator=(const QWidget &);
 
     void setCRect( const QRect &r );
-    void internalSetGeometry( int x, int y, int w, int h, bool updateView );
+    void internalSetGeometry( int x, int y, int w, int h );
 
     void _initialize();
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list