[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 06:29:46 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 88b7b7dd1086b9492e11fcb01acee702c03aa971
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 7 02:05:50 2002 +0000
Frame resizing related changes. Frames are now resizable
w/ a resize bar. Still need to draw frame borders.
* khtml/rendering/render_frames.cpp:
(RenderFrameSet::userResize):
(RenderFrame::slotViewCleared):
* kwq/KWQFrame.mm:
(QFrame::setFrameStyle):
(QFrame::frameStyle):
(QFrame::frameWidth):
* kwq/KWQWidget.mm:
(QWidget::lockDrawingFocus):
(QWidget::unlockDrawingFocus):
(QWidget::flushDrawing):
(QWidget::enableFlushDrawing):
(QWidget::disableFlushDrawing):
(QWidget::setDrawingAlpha):
(QWidget::displayRect):
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge drawRect:withPainter:]):
* kwq/qt/qframe.h:
* kwq/qt/qwidget.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 02ae6e2..699f93c 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,28 @@
+2002-08-06 Richard Williamson (Local) <rjw at apple.com>
+
+ Frame resizing related changes. Frames are now resizable
+ w/ a resize bar. Still need to draw frame borders.
+
+ * khtml/rendering/render_frames.cpp:
+ (RenderFrameSet::userResize):
+ (RenderFrame::slotViewCleared):
+ * kwq/KWQFrame.mm:
+ (QFrame::setFrameStyle):
+ (QFrame::frameStyle):
+ (QFrame::frameWidth):
+ * kwq/KWQWidget.mm:
+ (QWidget::lockDrawingFocus):
+ (QWidget::unlockDrawingFocus):
+ (QWidget::flushDrawing):
+ (QWidget::enableFlushDrawing):
+ (QWidget::disableFlushDrawing):
+ (QWidget::setDrawingAlpha):
+ (QWidget::displayRect):
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge drawRect:withPainter:]):
+ * kwq/qt/qframe.h:
+ * kwq/qt/qwidget.h:
+
2002-08-06 Maciej Stachowiak <mjs at apple.com>
Removed some APPLE_CHANGES no longer needed after the part change.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 02ae6e2..699f93c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,28 @@
+2002-08-06 Richard Williamson (Local) <rjw at apple.com>
+
+ Frame resizing related changes. Frames are now resizable
+ w/ a resize bar. Still need to draw frame borders.
+
+ * khtml/rendering/render_frames.cpp:
+ (RenderFrameSet::userResize):
+ (RenderFrame::slotViewCleared):
+ * kwq/KWQFrame.mm:
+ (QFrame::setFrameStyle):
+ (QFrame::frameStyle):
+ (QFrame::frameWidth):
+ * kwq/KWQWidget.mm:
+ (QWidget::lockDrawingFocus):
+ (QWidget::unlockDrawingFocus):
+ (QWidget::flushDrawing):
+ (QWidget::enableFlushDrawing):
+ (QWidget::disableFlushDrawing):
+ (QWidget::setDrawingAlpha):
+ (QWidget::displayRect):
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge drawRect:withPainter:]):
+ * kwq/qt/qframe.h:
+ * kwq/qt/qwidget.h:
+
2002-08-06 Maciej Stachowiak <mjs at apple.com>
Removed some APPLE_CHANGES no longer needed after the part change.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 02ae6e2..699f93c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,28 @@
+2002-08-06 Richard Williamson (Local) <rjw at apple.com>
+
+ Frame resizing related changes. Frames are now resizable
+ w/ a resize bar. Still need to draw frame borders.
+
+ * khtml/rendering/render_frames.cpp:
+ (RenderFrameSet::userResize):
+ (RenderFrame::slotViewCleared):
+ * kwq/KWQFrame.mm:
+ (QFrame::setFrameStyle):
+ (QFrame::frameStyle):
+ (QFrame::frameWidth):
+ * kwq/KWQWidget.mm:
+ (QWidget::lockDrawingFocus):
+ (QWidget::unlockDrawingFocus):
+ (QWidget::flushDrawing):
+ (QWidget::enableFlushDrawing):
+ (QWidget::disableFlushDrawing):
+ (QWidget::setDrawingAlpha):
+ (QWidget::displayRect):
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge drawRect:withPainter:]):
+ * kwq/qt/qframe.h:
+ * kwq/qt/qwidget.h:
+
2002-08-06 Maciej Stachowiak <mjs at apple.com>
Removed some APPLE_CHANGES no longer needed after the part change.
diff --git a/WebCore/khtml/rendering/render_frames.cpp b/WebCore/khtml/rendering/render_frames.cpp
index 4bba89d..4043bc7 100644
--- a/WebCore/khtml/rendering/render_frames.cpp
+++ b/WebCore/khtml/rendering/render_frames.cpp
@@ -329,141 +329,188 @@ void RenderFrameSet::positionFrames()
bool RenderFrameSet::userResize( MouseEventImpl *evt )
{
if (!layouted()) return false;
-
- bool res = false;
- int _x = evt->clientX();
- int _y = evt->clientY();
-
- if ( !m_resizing && evt->id() == EventImpl::MOUSEMOVE_EVENT || evt->id() == EventImpl::MOUSEDOWN_EVENT )
- {
-#ifdef DEBUG_LAYOUT
- kdDebug( 6031 ) << "mouseEvent:check" << endl;
-#endif
-
- m_hSplit = -1;
- m_vSplit = -1;
- //bool resizePossible = true;
-
- // check if we're over a horizontal or vertical boundary
- int pos = m_gridLayout[1][0] + xPos();
- for(int c = 1; c < element()->totalCols(); c++)
+
+ bool res = false;
+ int _x = evt->clientX();
+ int _y = evt->clientY();
+
+ if ( !m_resizing && evt->id() == EventImpl::MOUSEMOVE_EVENT || evt->id() == EventImpl::MOUSEDOWN_EVENT )
{
- if(_x >= pos && _x <= pos+element()->border())
- {
- if(m_vSplitVar && m_vSplitVar[c-1] == true) m_vSplit = c-1;
#ifdef DEBUG_LAYOUT
- kdDebug( 6031 ) << "vsplit!" << endl;
+ kdDebug( 6031 ) << "mouseEvent:check" << endl;
#endif
- res = true;
- break;
- }
- pos += m_gridLayout[1][c] + element()->border();
- }
-
- pos = m_gridLayout[0][0] + yPos();
- for(int r = 1; r < element()->totalRows(); r++)
- {
- if( _y >= pos && _y <= pos+element()->border())
- {
- if(m_hSplitVar && m_hSplitVar[r-1] == true) m_hSplit = r-1;
+
+ m_hSplit = -1;
+ m_vSplit = -1;
+ //bool resizePossible = true;
+
+ // check if we're over a horizontal or vertical boundary
+ int pos = m_gridLayout[1][0] + xPos();
+ for(int c = 1; c < element()->totalCols(); c++)
+ {
+ if(_x >= pos && _x <= pos+element()->border())
+ {
+ if(m_vSplitVar && m_vSplitVar[c-1] == true) m_vSplit = c-1;
#ifdef DEBUG_LAYOUT
- kdDebug( 6031 ) << "hsplitvar = " << m_hSplitVar << endl;
- kdDebug( 6031 ) << "hsplit!" << endl;
+ kdDebug( 6031 ) << "vsplit!" << endl;
#endif
- res = true;
- break;
- }
- pos += m_gridLayout[0][r] + element()->border();
- }
+ res = true;
+ break;
+ }
+ pos += m_gridLayout[1][c] + element()->border();
+ }
+
+ pos = m_gridLayout[0][0] + yPos();
+ for(int r = 1; r < element()->totalRows(); r++)
+ {
+ if( _y >= pos && _y <= pos+element()->border())
+ {
+ if(m_hSplitVar && m_hSplitVar[r-1] == true) m_hSplit = r-1;
#ifdef DEBUG_LAYOUT
- kdDebug( 6031 ) << m_hSplit << "/" << m_vSplit << endl;
+ kdDebug( 6031 ) << "hsplitvar = " << m_hSplitVar << endl;
+ kdDebug( 6031 ) << "hsplit!" << endl;
#endif
-
- QCursor cursor;
- if(m_hSplit != -1 && m_vSplit != -1)
- {
- cursor = Qt::sizeAllCursor;
- }
- else if( m_vSplit != -1 )
- {
- cursor = Qt::sizeHorCursor;
- }
- else if( m_hSplit != -1 )
- {
- cursor = Qt::sizeVerCursor;
- }
-
- if(evt->id() == EventImpl::MOUSEDOWN_EVENT)
- {
- setResizing(true);
- KApplication::setOverrideCursor(cursor);
- m_vSplitPos = _x;
- m_hSplitPos = _y;
- m_oldpos = -1;
- }
- else
- root()->view()->viewport()->setCursor(cursor);
-
- }
-
- // ### check the resize is not going out of bounds.
- if(m_resizing && evt->id() == EventImpl::MOUSEUP_EVENT)
- {
- setResizing(false);
- KApplication::restoreOverrideCursor();
-
- if(m_vSplit != -1 )
- {
+ res = true;
+ break;
+ }
+ pos += m_gridLayout[0][r] + element()->border();
+ }
#ifdef DEBUG_LAYOUT
- kdDebug( 6031 ) << "split xpos=" << _x << endl;
+ kdDebug( 6031 ) << m_hSplit << "/" << m_vSplit << endl;
#endif
- int delta = m_vSplitPos - _x;
- m_gridDelta[1][m_vSplit] -= delta;
- m_gridDelta[1][m_vSplit+1] += delta;
+
+ QCursor cursor;
+ if(m_hSplit != -1 && m_vSplit != -1)
+ {
+ cursor = Qt::sizeAllCursor;
+ }
+ else if( m_vSplit != -1 )
+ {
+ cursor = Qt::sizeHorCursor;
+ }
+ else if( m_hSplit != -1 )
+ {
+ cursor = Qt::sizeVerCursor;
+ }
+
+ if(evt->id() == EventImpl::MOUSEDOWN_EVENT)
+ {
+ setResizing(true);
+ KApplication::setOverrideCursor(cursor);
+ m_vSplitPos = _x;
+ m_hSplitPos = _y;
+ m_oldpos = -1;
+ }
+ else
+ root()->view()->viewport()->setCursor(cursor);
+
}
- if(m_hSplit != -1 )
+
+ // ### check the resize is not going out of bounds.
+ if(m_resizing && evt->id() == EventImpl::MOUSEUP_EVENT)
{
+ setResizing(false);
+ KApplication::restoreOverrideCursor();
+
+ if(m_vSplit != -1 )
+ {
+ #ifdef DEBUG_LAYOUT
+ kdDebug( 6031 ) << "split xpos=" << _x << endl;
+#endif
+ int delta = m_vSplitPos - _x;
+ m_gridDelta[1][m_vSplit] -= delta;
+ m_gridDelta[1][m_vSplit+1] += delta;
+ }
+ if(m_hSplit != -1 )
+ {
#ifdef DEBUG_LAYOUT
- kdDebug( 6031 ) << "split ypos=" << _y << endl;
+ kdDebug( 6031 ) << "split ypos=" << _y << endl;
#endif
- int delta = m_hSplitPos - _y;
- m_gridDelta[0][m_hSplit] -= delta;
- m_gridDelta[0][m_hSplit+1] += delta;
+ int delta = m_hSplitPos - _y;
+ m_gridDelta[0][m_hSplit] -= delta;
+ m_gridDelta[0][m_hSplit+1] += delta;
+ }
+
+ // this just schedules the relayout
+ // important, otherwise the moving indicator is not correctly erased
+ setLayouted(false);
}
-
- // this just schedules the relayout
- // important, otherwise the moving indicator is not correctly erased
- setLayouted(false);
- }
-
+
+ if (m_resizing || evt->id() == EventImpl::MOUSEUP_EVENT) {
+#ifdef APPLE_CHANGES
+ KHTMLView *v = root()->view();
+ QPainter paint;
+
+ v->disableFlushDrawing();
+ v->lockDrawingFocus();
+#else
+ QPainter paint( root()->view() );
+#endif
+ paint.setPen( Qt::gray );
+ paint.setBrush( Qt::gray );
+
#ifndef APPLE_CHANGES
- if (m_resizing || evt->id() == EventImpl::MOUSEUP_EVENT) {
- QPainter paint( root()->view() );
- paint.setPen( Qt::gray );
- paint.setBrush( Qt::gray );
- paint.setRasterOp( Qt::XorROP );
- QRect r(xPos(), yPos(), width(), height());
- const int rBord = 3;
- int sw = element()->border();
- int p = m_resizing ? (m_vSplit > -1 ? _x : _y) : -1;
- if (m_vSplit > -1) {
- if ( m_oldpos >= 0 )
- paint.drawRect( m_oldpos + sw/2 - rBord , r.y(),
- 2*rBord, r.height() );
- if ( p >= 0 )
- paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
- } else {
- if ( m_oldpos >= 0 )
- paint.drawRect( r.x(), m_oldpos + sw/2 - rBord,
- r.width(), 2*rBord );
- if ( p >= 0 )
- paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
- }
- m_oldpos = p;
- }
+ paint.setRasterOp( Qt::XorROP );
#endif
+ QRect r(xPos(), yPos(), width(), height());
+ const int rBord = 3;
+ int sw = element()->border();
+ int p = m_resizing ? (m_vSplit > -1 ? _x : _y) : -1;
+ if (m_vSplit > -1) {
+ if ( m_oldpos >= 0 )
+#ifdef APPLE_CHANGES
+ // FIXME: Should only have to redraw the damage rect, but
+ // the damage rect alone isn't sufficient. areas outside
+ // the specified rect are getting partially drawn.
+ v->updateContents(v->contentsX(), v->contentsY(),
+ v->visibleWidth(), v->visibleHeight());
+ //root()->view()->displayRect( m_oldpos + sw/2 - rBord , r.y(), 2*rBord, r.height() );
+#else
+ paint.drawRect( m_oldpos + sw/2 - rBord , r.y(),
+ 2*rBord, r.height() );
+#endif
+ if ( p >= 0 ){
+#ifdef APPLE_CHANGES
+ v->setDrawingAlpha((float)0.25);
+ paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
+ v->setDrawingAlpha((float)1.0);
+#else
+ paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
+#endif
+ }
+ } else {
+ if ( m_oldpos >= 0 )
+#ifdef APPLE_CHANGES
+ // FIXME: Should only have to redraw the damage rect, but
+ // the damage rect alone isn't sufficient. areas outside
+ // the specified rect are getting partially drawn.
+ v->updateContents(v->contentsX(), v->contentsY(),
+ v->visibleWidth(), v->visibleHeight());
+ //root()->view()->displayRect( r.x(), m_oldpos + sw/2 - rBord, r.width(), 2*rBord );
+#else
+ paint.drawRect( r.x(), m_oldpos + sw/2 - rBord,
+ r.width(), 2*rBord );
+#endif
+ if ( p >= 0 ){
+#ifdef APPLE_CHANGES
+ v->setDrawingAlpha((float)0.25);
+ paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
+ v->setDrawingAlpha((float)1.0);
+#else
+ paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
+#endif
+ }
+ }
+ m_oldpos = p;
- return res;
+#ifdef APPLE_CHANGES
+ v->unlockDrawingFocus();
+ v->enableFlushDrawing();
+ v->flushDrawing();
+#endif
+ }
+
+ return res;
}
void RenderFrameSet::setResizing(bool e)
@@ -575,8 +622,14 @@ void RenderFrame::slotViewCleared()
QScrollView *view = static_cast<QScrollView *>(m_widget);
if(!element()->frameBorder || !((static_cast<HTMLFrameSetElementImpl *>(element()->parentNode()))->frameBorder()))
view->setFrameStyle(QFrame::NoFrame);
- view->setVScrollBarMode(element()->scrolling );
- view->setHScrollBarMode(element()->scrolling );
+#ifdef APPLE_CHANGES
+ // Qt creates QScrollView w/ a default style of QFrame::StyledPanel | QFrame::Sunken.
+ else
+ view->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+#endif
+
+ view->setVScrollBarMode(element()->scrolling );
+ view->setHScrollBarMode(element()->scrolling );
if(view->inherits("KHTMLView")) {
#ifdef DEBUG_LAYOUT
kdDebug(6031) << "frame is a KHTMLview!" << endl;
diff --git a/WebCore/kwq/KWQFrame.h b/WebCore/kwq/KWQFrame.h
index 38db6c0..989ddf9 100644
--- a/WebCore/kwq/KWQFrame.h
+++ b/WebCore/kwq/KWQFrame.h
@@ -36,7 +36,11 @@ public:
QFrame(QWidget *parent);
virtual void setFrameStyle(int);
+ int frameStyle();
int frameWidth() const;
+
+private:
+ int _frameStyle;
};
#endif
diff --git a/WebCore/kwq/KWQFrame.mm b/WebCore/kwq/KWQFrame.mm
index e3dc57b..01ac767 100644
--- a/WebCore/kwq/KWQFrame.mm
+++ b/WebCore/kwq/KWQFrame.mm
@@ -32,11 +32,20 @@ QFrame::QFrame(QWidget *parent)
{
}
-void QFrame::setFrameStyle(int)
+void QFrame::setFrameStyle(int s)
{
+ _frameStyle = s;
+ NSLog (@"framesStyle = %d\n", s);
+}
+
+int QFrame::frameStyle()
+{
+ return _frameStyle;
}
int QFrame::frameWidth() const
{
+ if (_frameStyle == (QFrame::StyledPanel | QFrame::Sunken))
+ return 3;
return 0;
}
diff --git a/WebCore/kwq/KWQWidget.h b/WebCore/kwq/KWQWidget.h
index d58fb8e..659f2e8 100644
--- a/WebCore/kwq/KWQWidget.h
+++ b/WebCore/kwq/KWQWidget.h
@@ -135,6 +135,14 @@ public:
NSView *getView() const;
void setView(NSView *aView);
+ void displayRect(int x, int y, int w, int h);
+ void lockDrawingFocus();
+ void unlockDrawingFocus();
+ void enableFlushDrawing();
+ void disableFlushDrawing();
+ void flushDrawing();
+ void setDrawingAlpha(float alpha);
+
virtual void endEditing();
protected:
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index b92ac35..7e9a5ef 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -341,3 +341,48 @@ void QWidget::endEditing()
[window makeFirstResponder:nil];
}
}
+
+
+void QWidget::lockDrawingFocus()
+{
+ [getView() lockFocus];
+}
+
+
+void QWidget::unlockDrawingFocus()
+{
+ [getView() unlockFocus];
+}
+
+
+void QWidget::flushDrawing()
+{
+ [[getView() window] flushWindow];
+}
+
+
+void QWidget::enableFlushDrawing()
+{
+ [[getView() window] enableFlushWindow];
+}
+
+
+void QWidget::disableFlushDrawing()
+{
+ [[getView() window] disableFlushWindow];
+}
+
+
+void QWidget::setDrawingAlpha(float alpha)
+{
+ CGContextRef cgContext;
+ cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
+ CGContextSetAlpha(cgContext, alpha);
+}
+
+void QWidget::displayRect(int x, int y, int w, int h)
+{
+ [getView() displayRect: NSMakeRect (x,y,w,h)];
+}
+
+
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 271c4c1..a8ed932 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -181,6 +181,14 @@ using khtml::RenderPart;
- (void)drawRect:(NSRect)rect withPainter:(QPainter *)p
{
RenderObject *renderer = part->impl->getRenderer();
+ KHTMLView *view = part->impl->getView();
+
+#define DEBUG_DRAWING
+#ifdef DEBUG_DRAWING
+ [[NSColor redColor] set];
+ [NSBezierPath fillRect:[view->getView() visibleRect]];
+#endif
+
if (renderer) {
renderer->print(p, (int)rect.origin.x, (int)rect.origin.y, (int)rect.size.width, (int)rect.size.height, 0, 0);
}
diff --git a/WebCore/kwq/qt/qframe.h b/WebCore/kwq/qt/qframe.h
index 38db6c0..989ddf9 100644
--- a/WebCore/kwq/qt/qframe.h
+++ b/WebCore/kwq/qt/qframe.h
@@ -36,7 +36,11 @@ public:
QFrame(QWidget *parent);
virtual void setFrameStyle(int);
+ int frameStyle();
int frameWidth() const;
+
+private:
+ int _frameStyle;
};
#endif
diff --git a/WebCore/kwq/qt/qwidget.h b/WebCore/kwq/qt/qwidget.h
index d58fb8e..659f2e8 100644
--- a/WebCore/kwq/qt/qwidget.h
+++ b/WebCore/kwq/qt/qwidget.h
@@ -135,6 +135,14 @@ public:
NSView *getView() const;
void setView(NSView *aView);
+ void displayRect(int x, int y, int w, int h);
+ void lockDrawingFocus();
+ void unlockDrawingFocus();
+ void enableFlushDrawing();
+ void disableFlushDrawing();
+ void flushDrawing();
+ void setDrawingAlpha(float alpha);
+
virtual void endEditing();
protected:
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list