[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:10:53 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit e894e944bd783c5e84e9e1c582691aba5c929bb4
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon May 6 20:49:09 2002 +0000
Changes to support dhmtl.
Changes to support targeting (regression after 3.0 merge).
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 5946eeb..20cca3f 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-05-06 Richard J. Williamson <rjw at apple.com>
+
+ Changes to support dhmtl.
+ Changes to support targeting (regression after 3.0 merge).
+
+ * khtml/khtmlview.cpp:
+ * kwq/KWQEvent.mm:
+ * kwq/KWQKHTMLPart.mm:
+ * kwq/KWQObject.mm:
+ * kwq/KWQWidget.mm:
+ * kwq/qt/qevent.h:
+ * kwq/qt/qobject.h:
+ * kwq/qt/qwidget.h:
+
2002-05-03 Darin Adler <darin at apple.com>
* khtml/css/cssstyleselector.cpp:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 5946eeb..20cca3f 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2002-05-06 Richard J. Williamson <rjw at apple.com>
+
+ Changes to support dhmtl.
+ Changes to support targeting (regression after 3.0 merge).
+
+ * khtml/khtmlview.cpp:
+ * kwq/KWQEvent.mm:
+ * kwq/KWQKHTMLPart.mm:
+ * kwq/KWQObject.mm:
+ * kwq/KWQWidget.mm:
+ * kwq/qt/qevent.h:
+ * kwq/qt/qobject.h:
+ * kwq/qt/qwidget.h:
+
2002-05-03 Darin Adler <darin at apple.com>
* khtml/css/cssstyleselector.cpp:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 5946eeb..20cca3f 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2002-05-06 Richard J. Williamson <rjw at apple.com>
+
+ Changes to support dhmtl.
+ Changes to support targeting (regression after 3.0 merge).
+
+ * khtml/khtmlview.cpp:
+ * kwq/KWQEvent.mm:
+ * kwq/KWQKHTMLPart.mm:
+ * kwq/KWQObject.mm:
+ * kwq/KWQWidget.mm:
+ * kwq/qt/qevent.h:
+ * kwq/qt/qobject.h:
+ * kwq/qt/qwidget.h:
+
2002-05-03 Darin Adler <darin at apple.com>
* khtml/css/cssstyleselector.cpp:
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index ca80668..b6b8a4b 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -111,6 +111,7 @@ public:
#ifndef APPLE_CHANGES
delete tp; tp = 0;
delete paintBuffer; paintBuffer =0;
+
#endif /* APPLE_CHANGES not defined */
if (underMouse)
underMouse->deref();
@@ -247,6 +248,7 @@ KHTMLView::~KHTMLView()
if (m_part)
{
#ifdef APPLE_CHANGES
+ killTimers();
m_part->deref();
#endif
@@ -1519,7 +1521,19 @@ void KHTMLView::timerEvent ( QTimerEvent *e )
// kdDebug() << "scheduled repaint "<< d->repaintTimerId << endl;
killTimer(d->repaintTimerId);
+
+#ifdef APPLE_CHANGES
+// if (_lockFocus()){
+// QPainter p(this);
+//
+// drawContents (&p, d->updateRect.x(), d->updateRect.y(), d->updateRect.width(), d->updateRect.height());
+//
+// _unlockFocus();
+// }
+ _displayRect (d->updateRect);
+#else
updateContents( d->updateRect );
+#endif
d->repaintTimerId = 0;
}
diff --git a/WebCore/kwq/KWQEvent.h b/WebCore/kwq/KWQEvent.h
index f569ff5..c51731b 100644
--- a/WebCore/kwq/KWQEvent.h
+++ b/WebCore/kwq/KWQEvent.h
@@ -187,21 +187,7 @@ public:
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
-
-private:
-
-// add copy constructor
-// this private declaration prevents copying
-#ifdef _KWQ_PEDANTIC_
- QTimerEvent(const QTimerEvent &);
-#endif
-
-// add assignment operator
-// this private declaration prevents assignment
-#ifdef _KWQ_PEDANTIC_
- QTimerEvent &operator=(const QTimerEvent &);
-#endif
-
+ int _timerId;
}; // class QTimerEvent ========================================================
diff --git a/WebCore/kwq/KWQEvent.mm b/WebCore/kwq/KWQEvent.mm
index a763d96..60c1697 100644
--- a/WebCore/kwq/KWQEvent.mm
+++ b/WebCore/kwq/KWQEvent.mm
@@ -105,22 +105,20 @@ Qt::ButtonState QMouseEvent::stateAfter()
// class QTimerEvent ===========================================================
-QTimerEvent::QTimerEvent(int timerId)
+QTimerEvent::QTimerEvent(int t)
{
- _logNotYetImplemented();
+ _timerId = t;
}
QTimerEvent::~QTimerEvent()
{
- _logNotYetImplemented();
}
int QTimerEvent::timerId() const
{
- _logNotYetImplemented();
- return 0;
+ return _timerId;
}
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 08d5049..1096234 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -147,6 +147,7 @@ public:
int m_runningScripts;
QString m_strSelectedURL;
+ QString m_strSelectedURLTarget;
QString m_referrer;
QString m_documentSource;
@@ -215,6 +216,7 @@ public:
};
+#if 0
static QString splitUrlTarget(const QString &url, QString *target=0)
{
QString result = url;
@@ -242,6 +244,7 @@ static QString splitUrlTarget(const QString &url, QString *target=0)
}
return result;
}
+#endif
KHTMLPart::KHTMLPart( QWidget *, const char *, QObject *, const char *, GUIProfile )
{
@@ -656,6 +659,9 @@ void KHTMLPart::end()
d->m_doc->close();
KURL::clearCaches();
+
+ d->m_doc->setParsing(false);
+ d->m_view->complete();
}
bool KHTMLPart::gotoBaseAnchor()
@@ -1128,59 +1134,61 @@ bool KHTMLPart::event( QEvent *event )
void KHTMLPart::khtmlMousePressEvent( khtml::MousePressEvent *event )
{
- DOM::DOMString url = event->url();
- QMouseEvent *_mouse = event->qmouseEvent();
- DOM::Node innerNode = event->innerNode();
- d->m_mousePressNode = innerNode;
-
- d->m_dragStartPos = _mouse->pos();
-
- if ( !event->url().isNull() )
- d->m_strSelectedURL = event->url().string();
- else
- d->m_strSelectedURL = QString::null;
-
- if ( _mouse->button() == LeftButton ||
- _mouse->button() == MidButton )
- {
- d->m_bMousePressed = true;
-
-#ifndef KHTML_NO_SELECTION
- if ( _mouse->button() == LeftButton )
- {
- if ( !innerNode.isNull() && innerNode.handle()->renderer()) {
- int offset = 0;
- DOM::NodeImpl* node = 0;
- innerNode.handle()->renderer()->checkSelectionPoint( event->x(), event->y(),
- event->absX()-innerNode.handle()->renderer()->xPos(),
- event->absY()-innerNode.handle()->renderer()->yPos(), node, offset);
-
- d->m_selectionStart = node;
- d->m_startOffset = offset;
-// kdDebug(6005) << "KHTMLPart::khtmlMousePressEvent selectionStart=" << d->m_selectionStart.handle()->renderer()
-// << " offset=" << d->m_startOffset << endl;
- d->m_selectionEnd = d->m_selectionStart;
- d->m_endOffset = d->m_startOffset;
- d->m_doc->clearSelection();
- }
- else
- {
- d->m_selectionStart = DOM::Node();
- d->m_selectionEnd = DOM::Node();
- }
- //emitSelectionChanged();
- //startAutoScroll();
+ DOM::DOMString url = event->url();
+ QMouseEvent *_mouse = event->qmouseEvent();
+ DOM::Node innerNode = event->innerNode();
+ d->m_mousePressNode = innerNode;
+
+ d->m_dragStartPos = _mouse->pos();
+
+ if ( !event->url().isNull() ){
+ d->m_strSelectedURL = event->url().string();
+ d->m_strSelectedURLTarget = event->target().string();
}
+ else
+ d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null;
+
+ if ( _mouse->button() == LeftButton ||
+ _mouse->button() == MidButton )
+ {
+ d->m_bMousePressed = true;
+
+#ifndef KHTML_NO_SELECTION
+ if ( _mouse->button() == LeftButton )
+ {
+ if ( !innerNode.isNull() && innerNode.handle()->renderer()) {
+ int offset = 0;
+ DOM::NodeImpl* node = 0;
+ innerNode.handle()->renderer()->checkSelectionPoint( event->x(), event->y(),
+ event->absX()-innerNode.handle()->renderer()->xPos(),
+ event->absY()-innerNode.handle()->renderer()->yPos(), node, offset);
+
+ d->m_selectionStart = node;
+ d->m_startOffset = offset;
+ // kdDebug(6005) << "KHTMLPart::khtmlMousePressEvent selectionStart=" << d->m_selectionStart.handle()->renderer()
+ // << " offset=" << d->m_startOffset << endl;
+ d->m_selectionEnd = d->m_selectionStart;
+ d->m_endOffset = d->m_startOffset;
+ d->m_doc->clearSelection();
+ }
+ else
+ {
+ d->m_selectionStart = DOM::Node();
+ d->m_selectionEnd = DOM::Node();
+ }
+ //emitSelectionChanged();
+ //startAutoScroll();
+ }
#else
- d->m_dragLastPos = _mouse->globalPos();
+ d->m_dragLastPos = _mouse->globalPos();
#endif
- }
-
- if ( _mouse->button() == RightButton )
- {
- //popupMenu( splitUrlTarget(d->m_strSelectedURL) );
- d->m_strSelectedURL = QString::null;
- }
+ }
+
+ if ( _mouse->button() == RightButton )
+ {
+ //popupMenu( d->m_strSelectedURL );
+ d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null;
+ }
}
void KHTMLPart::khtmlMouseDoubleClickEvent( khtml::MouseDoubleClickEvent * )
@@ -1234,13 +1242,12 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
// when we finish our drag, we need to undo our mouse press
d->m_bMousePressed = false;
- d->m_strSelectedURL = "";
+ d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null;
return;
}
#endif
-
- QString target;
- QString surl = splitUrlTarget(url.string(), &target);
+ DOM::DOMString url = event->url();
+ DOM::DOMString target = event->target();
// Not clicked -> mouse over stuff
if ( !d->m_bMousePressed )
@@ -1248,8 +1255,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
// The mouse is over something
if ( url.length() )
{
- // FIXME: this is unused
- //bool shiftPressed = ( _mouse->state() & ShiftButton );
+ bool shiftPressed = ( _mouse->state() & ShiftButton );
// Image map
if ( !innerNode.isNull() && innerNode.elementId() == ID_IMG )
@@ -1261,37 +1267,35 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
if(r)
{
int absx, absy, vx, vy;
- // FIXME: when compiling with -02, compilation breaks with a
- // complaint that vx and vy might be uninitialized before use
r->absolutePosition(absx, absy);
- //view()->contentsToViewport( absx, absy, vx, vy );
+ view()->contentsToViewport( absx, absy, vx, vy );
int x(_mouse->x() - vx), y(_mouse->y() - vy);
- d->m_overURL = surl + QString("?%1,%2").arg(x).arg(y);
- //overURL( d->m_overURL, target, shiftPressed );
+ d->m_overURL = url.string() + QString("?%1,%2").arg(x).arg(y);
+ d->m_overURLTarget = target.string();
+ overURL( d->m_overURL, target.string(), shiftPressed );
return;
}
}
}
// normal link
- QString target;
- QString surl = splitUrlTarget(url.string(), &target);
- if ( d->m_overURL.isEmpty() || d->m_overURL != surl )
+ if ( d->m_overURL.isEmpty() || d->m_overURL != url || d->m_overURLTarget != target )
{
- d->m_overURL = surl;
- //overURL( d->m_overURL, target, shiftPressed );
+ d->m_overURL = url.string();
+ d->m_overURLTarget = target.string();
+ overURL( d->m_overURL, target.string(), shiftPressed );
}
}
else // Not over a link...
{
if( !d->m_overURL.isEmpty() ) // and we were over a link -> reset to "default statusbar text"
{
- d->m_overURL = QString::null;
- //emit onURL( QString::null );
+ d->m_overURL = d->m_overURLTarget = QString::null;
+ emit onURL( QString::null );
// Default statusbar text can be set from javascript. Otherwise it's empty.
- //emit setStatusBarText( d->m_kjsDefaultStatusBarText );
+ emit setStatusBarText( d->m_kjsDefaultStatusBarText );
}
}
}
@@ -1347,7 +1351,6 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
->setSelection(d->m_selectionEnd.handle(),d->m_endOffset,
d->m_selectionStart.handle(),d->m_startOffset);
}
- }
#else
if ( d->m_doc && d->m_view ) {
QPoint diff( _mouse->globalPos() - d->m_dragLastPos );
@@ -1356,8 +1359,8 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
d->m_view->scrollBy( -diff.x(), -diff.y() );
d->m_dragLastPos = _mouse->globalPos();
}
- }
#endif
+ }
}
#endif
}
@@ -1377,8 +1380,8 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
// HACK! FIXME!
if (d->m_strSelectedURL != QString::null) {
IFWebDataSource *oldDataSource, *newDataSource;
- QString target;
- KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL, &target)));
+ QString target = event->target().string();
+ KURL clickedURL(completeURL( d->m_strSelectedURL));
IFWebFrame *frame;
KURL refLess(clickedURL);
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 08d5049..1096234 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -147,6 +147,7 @@ public:
int m_runningScripts;
QString m_strSelectedURL;
+ QString m_strSelectedURLTarget;
QString m_referrer;
QString m_documentSource;
@@ -215,6 +216,7 @@ public:
};
+#if 0
static QString splitUrlTarget(const QString &url, QString *target=0)
{
QString result = url;
@@ -242,6 +244,7 @@ static QString splitUrlTarget(const QString &url, QString *target=0)
}
return result;
}
+#endif
KHTMLPart::KHTMLPart( QWidget *, const char *, QObject *, const char *, GUIProfile )
{
@@ -656,6 +659,9 @@ void KHTMLPart::end()
d->m_doc->close();
KURL::clearCaches();
+
+ d->m_doc->setParsing(false);
+ d->m_view->complete();
}
bool KHTMLPart::gotoBaseAnchor()
@@ -1128,59 +1134,61 @@ bool KHTMLPart::event( QEvent *event )
void KHTMLPart::khtmlMousePressEvent( khtml::MousePressEvent *event )
{
- DOM::DOMString url = event->url();
- QMouseEvent *_mouse = event->qmouseEvent();
- DOM::Node innerNode = event->innerNode();
- d->m_mousePressNode = innerNode;
-
- d->m_dragStartPos = _mouse->pos();
-
- if ( !event->url().isNull() )
- d->m_strSelectedURL = event->url().string();
- else
- d->m_strSelectedURL = QString::null;
-
- if ( _mouse->button() == LeftButton ||
- _mouse->button() == MidButton )
- {
- d->m_bMousePressed = true;
-
-#ifndef KHTML_NO_SELECTION
- if ( _mouse->button() == LeftButton )
- {
- if ( !innerNode.isNull() && innerNode.handle()->renderer()) {
- int offset = 0;
- DOM::NodeImpl* node = 0;
- innerNode.handle()->renderer()->checkSelectionPoint( event->x(), event->y(),
- event->absX()-innerNode.handle()->renderer()->xPos(),
- event->absY()-innerNode.handle()->renderer()->yPos(), node, offset);
-
- d->m_selectionStart = node;
- d->m_startOffset = offset;
-// kdDebug(6005) << "KHTMLPart::khtmlMousePressEvent selectionStart=" << d->m_selectionStart.handle()->renderer()
-// << " offset=" << d->m_startOffset << endl;
- d->m_selectionEnd = d->m_selectionStart;
- d->m_endOffset = d->m_startOffset;
- d->m_doc->clearSelection();
- }
- else
- {
- d->m_selectionStart = DOM::Node();
- d->m_selectionEnd = DOM::Node();
- }
- //emitSelectionChanged();
- //startAutoScroll();
+ DOM::DOMString url = event->url();
+ QMouseEvent *_mouse = event->qmouseEvent();
+ DOM::Node innerNode = event->innerNode();
+ d->m_mousePressNode = innerNode;
+
+ d->m_dragStartPos = _mouse->pos();
+
+ if ( !event->url().isNull() ){
+ d->m_strSelectedURL = event->url().string();
+ d->m_strSelectedURLTarget = event->target().string();
}
+ else
+ d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null;
+
+ if ( _mouse->button() == LeftButton ||
+ _mouse->button() == MidButton )
+ {
+ d->m_bMousePressed = true;
+
+#ifndef KHTML_NO_SELECTION
+ if ( _mouse->button() == LeftButton )
+ {
+ if ( !innerNode.isNull() && innerNode.handle()->renderer()) {
+ int offset = 0;
+ DOM::NodeImpl* node = 0;
+ innerNode.handle()->renderer()->checkSelectionPoint( event->x(), event->y(),
+ event->absX()-innerNode.handle()->renderer()->xPos(),
+ event->absY()-innerNode.handle()->renderer()->yPos(), node, offset);
+
+ d->m_selectionStart = node;
+ d->m_startOffset = offset;
+ // kdDebug(6005) << "KHTMLPart::khtmlMousePressEvent selectionStart=" << d->m_selectionStart.handle()->renderer()
+ // << " offset=" << d->m_startOffset << endl;
+ d->m_selectionEnd = d->m_selectionStart;
+ d->m_endOffset = d->m_startOffset;
+ d->m_doc->clearSelection();
+ }
+ else
+ {
+ d->m_selectionStart = DOM::Node();
+ d->m_selectionEnd = DOM::Node();
+ }
+ //emitSelectionChanged();
+ //startAutoScroll();
+ }
#else
- d->m_dragLastPos = _mouse->globalPos();
+ d->m_dragLastPos = _mouse->globalPos();
#endif
- }
-
- if ( _mouse->button() == RightButton )
- {
- //popupMenu( splitUrlTarget(d->m_strSelectedURL) );
- d->m_strSelectedURL = QString::null;
- }
+ }
+
+ if ( _mouse->button() == RightButton )
+ {
+ //popupMenu( d->m_strSelectedURL );
+ d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null;
+ }
}
void KHTMLPart::khtmlMouseDoubleClickEvent( khtml::MouseDoubleClickEvent * )
@@ -1234,13 +1242,12 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
// when we finish our drag, we need to undo our mouse press
d->m_bMousePressed = false;
- d->m_strSelectedURL = "";
+ d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null;
return;
}
#endif
-
- QString target;
- QString surl = splitUrlTarget(url.string(), &target);
+ DOM::DOMString url = event->url();
+ DOM::DOMString target = event->target();
// Not clicked -> mouse over stuff
if ( !d->m_bMousePressed )
@@ -1248,8 +1255,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
// The mouse is over something
if ( url.length() )
{
- // FIXME: this is unused
- //bool shiftPressed = ( _mouse->state() & ShiftButton );
+ bool shiftPressed = ( _mouse->state() & ShiftButton );
// Image map
if ( !innerNode.isNull() && innerNode.elementId() == ID_IMG )
@@ -1261,37 +1267,35 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
if(r)
{
int absx, absy, vx, vy;
- // FIXME: when compiling with -02, compilation breaks with a
- // complaint that vx and vy might be uninitialized before use
r->absolutePosition(absx, absy);
- //view()->contentsToViewport( absx, absy, vx, vy );
+ view()->contentsToViewport( absx, absy, vx, vy );
int x(_mouse->x() - vx), y(_mouse->y() - vy);
- d->m_overURL = surl + QString("?%1,%2").arg(x).arg(y);
- //overURL( d->m_overURL, target, shiftPressed );
+ d->m_overURL = url.string() + QString("?%1,%2").arg(x).arg(y);
+ d->m_overURLTarget = target.string();
+ overURL( d->m_overURL, target.string(), shiftPressed );
return;
}
}
}
// normal link
- QString target;
- QString surl = splitUrlTarget(url.string(), &target);
- if ( d->m_overURL.isEmpty() || d->m_overURL != surl )
+ if ( d->m_overURL.isEmpty() || d->m_overURL != url || d->m_overURLTarget != target )
{
- d->m_overURL = surl;
- //overURL( d->m_overURL, target, shiftPressed );
+ d->m_overURL = url.string();
+ d->m_overURLTarget = target.string();
+ overURL( d->m_overURL, target.string(), shiftPressed );
}
}
else // Not over a link...
{
if( !d->m_overURL.isEmpty() ) // and we were over a link -> reset to "default statusbar text"
{
- d->m_overURL = QString::null;
- //emit onURL( QString::null );
+ d->m_overURL = d->m_overURLTarget = QString::null;
+ emit onURL( QString::null );
// Default statusbar text can be set from javascript. Otherwise it's empty.
- //emit setStatusBarText( d->m_kjsDefaultStatusBarText );
+ emit setStatusBarText( d->m_kjsDefaultStatusBarText );
}
}
}
@@ -1347,7 +1351,6 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
->setSelection(d->m_selectionEnd.handle(),d->m_endOffset,
d->m_selectionStart.handle(),d->m_startOffset);
}
- }
#else
if ( d->m_doc && d->m_view ) {
QPoint diff( _mouse->globalPos() - d->m_dragLastPos );
@@ -1356,8 +1359,8 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
d->m_view->scrollBy( -diff.x(), -diff.y() );
d->m_dragLastPos = _mouse->globalPos();
}
- }
#endif
+ }
}
#endif
}
@@ -1377,8 +1380,8 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
// HACK! FIXME!
if (d->m_strSelectedURL != QString::null) {
IFWebDataSource *oldDataSource, *newDataSource;
- QString target;
- KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL, &target)));
+ QString target = event->target().string();
+ KURL clickedURL(completeURL( d->m_strSelectedURL));
IFWebFrame *frame;
KURL refLess(clickedURL);
diff --git a/WebCore/kwq/KWQObject.h b/WebCore/kwq/KWQObject.h
index fa8df70..7c6d418 100644
--- a/WebCore/kwq/KWQObject.h
+++ b/WebCore/kwq/KWQObject.h
@@ -122,7 +122,8 @@ public:
int startTimer(int);
void killTimer(int);
void killTimers();
-
+ virtual void timerEvent( QTimerEvent * );
+
void installEventFilter(const QObject *);
void removeEventFilter(const QObject *);
bool eventFilter(QObject *o, QEvent *e);
diff --git a/WebCore/kwq/KWQObject.mm b/WebCore/kwq/KWQObject.mm
index a0be3ed..b6af841 100644
--- a/WebCore/kwq/KWQObject.mm
+++ b/WebCore/kwq/KWQObject.mm
@@ -110,23 +110,85 @@ bool QObject::inherits(const char *) const
return FALSE;
}
+ at interface KWQTimerCallback : NSObject
+{
+ QObject *target;
+ int timerId;
+}
+- initWithQObject: (QObject *)object timerId: (int)timerId;
+- (void)timerFired: (id)context;
+ at end
-int QObject:: startTimer(int)
+ at implementation KWQTimerCallback
+- initWithQObject: (QObject *)qo timerId: (int)t
{
- _logNeverImplemented();
- return 0;
+ [super init];
+ timerId = t;
+ target = qo;
+ return self;
+}
+
+- (void)timerFired: (id)context
+{
+ QTimerEvent te(timerId);
+ target->timerEvent (&te);
}
+ at end
+int timerCount = 1;
-void QObject::killTimer(int)
+NSMutableDictionary *timers;
+
+void QObject::timerEvent (QTimerEvent *te)
{
- _logNeverImplemented();
+}
+
+int QObject:: startTimer(int milliseconds)
+{
+ NSNumber *timerId = [NSNumber numberWithInt: timerCount];
+
+ if (timers == nil){
+ // The timers dictionary itself leaks, but the contents are removed
+ // when a timer expires or is killed.
+ timers = [[NSMutableDictionary alloc] init];
+ }
+ NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval: ((NSTimeInterval)milliseconds)/1000
+ target: [[[KWQTimerCallback alloc] initWithQObject: this timerId: timerCount] autorelease]
+ selector: @selector(timerFired:)
+ userInfo: timerId
+ repeats: NO];
+ [timers setObject: timer forKey: timerId];
+
+ return timerCount++;
+}
+
+
+void QObject::killTimer(int _timerId)
+{
+ NSNumber *timerId = [NSNumber numberWithInt: _timerId];
+ NSTimer *timer;
+
+ timer = (NSTimer *)[timers objectForKey: timerId];
+ [timer invalidate];
+ [timers removeObjectForKey: timerId];
}
void QObject::killTimers()
{
- _logNeverImplemented();
+ NSArray *contexts;
+ NSNumber *key;
+ NSTimer *timer;
+ int i, count;
+
+ contexts = [timers allKeys];
+ count = [contexts count];
+ for (i = 0; i < count; i++){
+ key = (NSNumber *)[contexts objectAtIndex: i];
+ timer = (NSTimer *)[timers objectForKey: key];
+ [timer invalidate];
+ [timers removeObjectForKey: key];
+ }
}
diff --git a/WebCore/kwq/KWQWidget.h b/WebCore/kwq/KWQWidget.h
index 3328d7d..9081766 100644
--- a/WebCore/kwq/KWQWidget.h
+++ b/WebCore/kwq/KWQWidget.h
@@ -164,7 +164,12 @@ public:
#ifdef _KWQ_
virtual void paint (void *);
-
+
+ bool _lockFocus();
+ void _unlockFocus();
+ void _displayRect(QRect rect);
+ void _flushWindow();
+
#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
NSView *getView() const;
void setView(NSView *aView);
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 1b1b9f0..2c18ef4 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -66,6 +66,7 @@ private:
QCursor cursor;
QPalette pal;
NSView *view;
+ int lockCount;
};
QWidget::QWidget(QWidget *parent=0, const char *name=0, WFlags f=0)
@@ -73,6 +74,7 @@ QWidget::QWidget(QWidget *parent=0, const char *name=0, WFlags f=0)
static QStyle *defaultStyle = new QStyle;
data = new QWidgetPrivate;
+ data->lockCount = 0;
data->view = [[KWQView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: this];
data->style = defaultStyle;
}
@@ -504,3 +506,35 @@ void QWidget::endEditing()
if ([firstResponder isKindOfClass: NSClassFromString(@"NSText")])
[window makeFirstResponder: nil];
}
+
+
+bool QWidget::_lockFocus()
+{
+ if ([getView() canDraw]){
+ [getView() lockFocus];
+ data->lockCount++;
+ return 1;
+ }
+ return 0;
+}
+
+void QWidget::_unlockFocus()
+{
+ if (data->lockCount){
+ [getView() unlockFocus];
+ data->lockCount--;
+ }
+}
+
+
+void QWidget::_flushWindow()
+{
+ [[getView() window] flushWindow];
+}
+
+
+void QWidget::_displayRect (QRect rect)
+{
+ [getView() displayRect: NSMakeRect (rect.x(), rect.y(), rect.width(), rect.height())];
+}
+
diff --git a/WebCore/kwq/qt/qevent.h b/WebCore/kwq/qt/qevent.h
index f569ff5..c51731b 100644
--- a/WebCore/kwq/qt/qevent.h
+++ b/WebCore/kwq/qt/qevent.h
@@ -187,21 +187,7 @@ public:
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
-
-private:
-
-// add copy constructor
-// this private declaration prevents copying
-#ifdef _KWQ_PEDANTIC_
- QTimerEvent(const QTimerEvent &);
-#endif
-
-// add assignment operator
-// this private declaration prevents assignment
-#ifdef _KWQ_PEDANTIC_
- QTimerEvent &operator=(const QTimerEvent &);
-#endif
-
+ int _timerId;
}; // class QTimerEvent ========================================================
diff --git a/WebCore/kwq/qt/qobject.h b/WebCore/kwq/qt/qobject.h
index fa8df70..7c6d418 100644
--- a/WebCore/kwq/qt/qobject.h
+++ b/WebCore/kwq/qt/qobject.h
@@ -122,7 +122,8 @@ public:
int startTimer(int);
void killTimer(int);
void killTimers();
-
+ virtual void timerEvent( QTimerEvent * );
+
void installEventFilter(const QObject *);
void removeEventFilter(const QObject *);
bool eventFilter(QObject *o, QEvent *e);
diff --git a/WebCore/kwq/qt/qwidget.h b/WebCore/kwq/qt/qwidget.h
index 3328d7d..9081766 100644
--- a/WebCore/kwq/qt/qwidget.h
+++ b/WebCore/kwq/qt/qwidget.h
@@ -164,7 +164,12 @@ public:
#ifdef _KWQ_
virtual void paint (void *);
-
+
+ bool _lockFocus();
+ void _unlockFocus();
+ void _displayRect(QRect rect);
+ void _flushWindow();
+
#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
NSView *getView() const;
void setView(NSView *aView);
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d0993c4..a4e96d9 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-06 Richard J. Williamson <rjw at apple.com>
+
+ Changes to support dhtml.
+
+ * WebView.subproj/IFWebView.mm:
+
2002-05-06 John Sullivan <sullivan at apple.com>
* Resources/url_icon.tiff: New bookmarks/history icon, looks
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index d0993c4..a4e96d9 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,9 @@
+2002-05-06 Richard J. Williamson <rjw at apple.com>
+
+ Changes to support dhtml.
+
+ * WebView.subproj/IFWebView.mm:
+
2002-05-06 John Sullivan <sullivan at apple.com>
* Resources/url_icon.tiff: New bookmarks/history icon, looks
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index 25ecab7..05a29e6 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -33,6 +33,8 @@
_private->needsLayout = YES;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowDidBecomeMain:) name: NSWindowDidBecomeMainNotification object: nil];
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowDidBecomeKey:) name: NSWindowDidBecomeKeyNotification object: nil];
return self;
}
@@ -52,6 +54,13 @@
return YES;
}
+
+- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
+{
+ return YES;
+}
+
+
// Note that the controller is not retained.
- (id <IFWebController>)controller
{
@@ -377,7 +386,6 @@
}
-
- (void)windowResized: (NSNotification *)notification
{
if ([notification object] == [self window])
@@ -385,6 +393,18 @@
}
+- (void)windowDidBecomeMain: (NSNotification *)notification
+{
+ [[self window] makeFirstResponder: self];
+}
+
+
+- (void)windowDidBecomeKey: (NSNotification *)notification
+{
+ [[self window] makeFirstResponder: self];
+}
+
+
- (void)mouseUp: (NSEvent *)event
{
int button, state;
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 25ecab7..05a29e6 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -33,6 +33,8 @@
_private->needsLayout = YES;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResized:) name: NSWindowDidResizeNotification object: nil];
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowDidBecomeMain:) name: NSWindowDidBecomeMainNotification object: nil];
+ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowDidBecomeKey:) name: NSWindowDidBecomeKeyNotification object: nil];
return self;
}
@@ -52,6 +54,13 @@
return YES;
}
+
+- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
+{
+ return YES;
+}
+
+
// Note that the controller is not retained.
- (id <IFWebController>)controller
{
@@ -377,7 +386,6 @@
}
-
- (void)windowResized: (NSNotification *)notification
{
if ([notification object] == [self window])
@@ -385,6 +393,18 @@
}
+- (void)windowDidBecomeMain: (NSNotification *)notification
+{
+ [[self window] makeFirstResponder: self];
+}
+
+
+- (void)windowDidBecomeKey: (NSNotification *)notification
+{
+ [[self window] makeFirstResponder: self];
+}
+
+
- (void)mouseUp: (NSEvent *)event
{
int button, state;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list