[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:32:36 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 8a5da4fd66e7f980199f25a0bb252304f5906a2a
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Aug 19 16:53:03 2002 +0000
First cut at implementation of "tab to change focus": Lots of loose ends, but it's
going well.
* kwq/KWQNSTextField.h: Change initWithWidget to initWithQLineEdit.
* kwq/KWQNSTextField.mm:
(-[KWQNSTextField initWithQLineEdit:]): Keep a QLineEdit pointer so we don't cast later.
(-[KWQNSTextField dealloc]): Sets widget to 0 to make nextKeyView and previousKeyView
return nil while deallocating.
(-[KWQNSTextField setPasswordMode:]): Pass widget when creating secure text field so it
can handle the next/previous links properly.
(-[KWQNSTextField nextKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
(-[KWQNSTextField previousKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
(-[KWQTextFieldCell isOpaque]): Added. Returns NO; fixes focus rectangle updating.
(-[KWQSecureTextField initWithQWidget:]): Added.
(-[KWQSecureTextField dealloc]): Added. Sets widget to 0 to make nextKeyView and
previousKeyView return nil while deallocating.
(-[KWQSecureTextField nextKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
(-[KWQSecureTextField previousKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
* kwq/KWQKHTMLPartImpl.h: Add KWQSelectionDirection. Change name of getBridge() to
bridge(), getDocument() to document(), getRenderer() to renderer(), getBridgeForFrameName()
to bridgeForFrameName(). Also added nextKeyView family of member functions.
* kwq/KWQKHTMLPartImpl.mm:
(KWQKHTMLPartImpl::nextKeyViewInFrame): Added.
(KWQKHTMLPartImpl::nextKeyView): Added.
* kwq/qt/qwidget.h: Remove unneeded parameters from constructor. Also added a
constructor that takes an NSView.
* kwq/KWQWidget.mm:
(QWidget::QWidget): Don't store focus policy (it was uninitialized before).
(QWidget::focusPolicy): Return TabFocus for any widget that has a view with a first
responder, NoFocus for any other.
(QWidget::setFocusPolicy): Do nothing.
(QWidget::setFocusProxy): Do nothing.
* kwq/qt/qobject.h: Store the event filter object when installEventFilter is called.
This is used to find the RenderWidget for a QWidget by the new tabbing code.
* kwq/KWQObject.mm: Removed event-filter functions. Two are now inlines, one deleted.
Other changes related to KWQKHTMLPartImpl improvements.
* kwq/KWQKHTMLPartBrowserExtension.mm:
* kwq/KWQKHTMLPartImpl.mm:
* kwq/KWQLoaderImpl.mm:
* kwq/WebCoreBridge.mm:
Update for KWQKHTMLPartImpl member name changes.
Various improvements for other widget implementations.
* kwq/qt/qbutton.h:
* kwq/KWQButton.mm: Stop using KWQNSButton. Instead just use a button adapter
object, and a plain old NSButton.
(QButton::QButton): Put all the NSButton setup in here.
(QButton::~QButton): Release the adapter here.
(QButton::clicked): Move this in here because it's virtual now so that QCheckBox
can override it.
(-[KWQButtonAdapter initWithQButton:]): Added.
(-[KWQButtonAdapter action:]): Just call clicked().
* kwq/qt/qpushbutton.h: Don't pass unused parent pointer to QButton constructor.
* kwq/KWQPushButton.mm: (QPushButton::QPushButton): Don't pass unused parent pointer to
QButton contructor.
* kwq/qt/qcheckbox.h:
* kwq/KWQCheckBox.mm: Just use NSButton, not KWQNSButton.
(QCheckBox::clicked): Move the state-changed logic here; used to be in KWQNSButton.
* kwq/KWQRadioButton.mm:
(QRadioButton::QRadioButton): Don't pass unused parent pointer to
QButton contructor.
* kwq/qt/qcombobox.h:
* kwq/KWQComboBox.mm:
(QComboBox::QComboBox): Removed extra constructor. Make a plain NSPopUpButton,
and use an adapter object, rather than having a KWQNSComboBox.
(QComboBox::~QComboBox): Release the adapter.
(QComboBox::insertItem): New implementation. No need to keep an items array around,
because the menu does that just fine.
(QComboBox::clear): Remove the items from the pop-up button directly.
(-[KWQComboBoxAdapter initWithQComboBox:]): Added.
(-[KWQComboBoxAdapter action:]): Just call activated().
* kwq/kdeui/kcombobox.h: Empty this out and make it use only inlines.
* khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
Remove the setSize()/doneLoading() optimization for QComboBox because the new
simpler QComboBox implementation obviates the speed problem this was originally
intended to fix.
* kwq/qt/qlineedit.h:
* kwq/KWQLineEdit.mm: (QLineEdit::QLineEdit): Call initWithQLineEdit instead of
initWithWidget. Also don't take an unused parent pointer parameter.
* kwq/kdeui/klineedit.h: Empty this out and make it use only inlines.
* kwq/qt/qframe.h: Remove unused parent pointer from constructor.
* kwq/KWQFrame.mm: Remove unneeded constructor.
* kwq/KWQHBox.mm: (QHBox::QHBox): Don't pass unused parent pointer to QFrame.
* kwq/KWQLabel.mm: (QLabel::QLabel): Don't pass unused parent pointer to QFrame.
* kwq/qt/qscrollview.h: Make constructor inline.
* kwq/KWQScrollView.mm: Remove unneeded constructor.
* kwq/KWQWindowWidget.h: Remove unneeded constructor.
* WebCore.pbproj/project.pbxproj: Remove KWQKComboBox.mm, KWQKLineEdit.mm,
and KWQScrollBar.h.
* kwq/KWQKComboBox.mm: Removed.
* kwq/KWQKLineEdit.mm: Removed.
* kwq/KWQScrollBar.h: Removed. Unused.
* kwq/KWQTextArea.h: Change initWithWidget to initWithQTextEdit.
* kwq/KWQTextArea.mm: (-[KWQTextArea initWithQTextEdit:]): Changed name.
* kwq/KWQTextEdit.mm: (QTextEdit::QTextEdit): Call initWithQTextEdit instead of
initWithWidget.
* kwq/KWQView.h: Eliminated KWQNSButton, KWQNSComboBox, and KWQNSScrollView.
* kwq/KWQView.mm: Ditto.
Housekeeping.
* force-clean-timestamp: Yes, again.
* khtml/khtml_part.h: Rearrange APPLE_CHANGES a bit.
* kwq/qt/qvaluelist.h: Added -- as well as ++ for the const iterator, and fixed some
minor const issues. At one point I needed this for the focus changes, but not any more.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index c0d574c..a0f91e8 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,132 @@
+2002-08-19 Darin Adler <darin at apple.com>
+
+ First cut at implementation of "tab to change focus": Lots of loose ends, but it's
+ going well.
+
+ * kwq/KWQNSTextField.h: Change initWithWidget to initWithQLineEdit.
+ * kwq/KWQNSTextField.mm:
+ (-[KWQNSTextField initWithQLineEdit:]): Keep a QLineEdit pointer so we don't cast later.
+ (-[KWQNSTextField dealloc]): Sets widget to 0 to make nextKeyView and previousKeyView
+ return nil while deallocating.
+ (-[KWQNSTextField setPasswordMode:]): Pass widget when creating secure text field so it
+ can handle the next/previous links properly.
+ (-[KWQNSTextField nextKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQNSTextField previousKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQTextFieldCell isOpaque]): Added. Returns NO; fixes focus rectangle updating.
+ (-[KWQSecureTextField initWithQWidget:]): Added.
+ (-[KWQSecureTextField dealloc]): Added. Sets widget to 0 to make nextKeyView and
+ previousKeyView return nil while deallocating.
+ (-[KWQSecureTextField nextKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQSecureTextField previousKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+
+ * kwq/KWQKHTMLPartImpl.h: Add KWQSelectionDirection. Change name of getBridge() to
+ bridge(), getDocument() to document(), getRenderer() to renderer(), getBridgeForFrameName()
+ to bridgeForFrameName(). Also added nextKeyView family of member functions.
+
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::nextKeyViewInFrame): Added.
+ (KWQKHTMLPartImpl::nextKeyView): Added.
+
+ * kwq/qt/qwidget.h: Remove unneeded parameters from constructor. Also added a
+ constructor that takes an NSView.
+ * kwq/KWQWidget.mm:
+ (QWidget::QWidget): Don't store focus policy (it was uninitialized before).
+ (QWidget::focusPolicy): Return TabFocus for any widget that has a view with a first
+ responder, NoFocus for any other.
+ (QWidget::setFocusPolicy): Do nothing.
+ (QWidget::setFocusProxy): Do nothing.
+
+ * kwq/qt/qobject.h: Store the event filter object when installEventFilter is called.
+ This is used to find the RenderWidget for a QWidget by the new tabbing code.
+ * kwq/KWQObject.mm: Removed event-filter functions. Two are now inlines, one deleted.
+
+ Other changes related to KWQKHTMLPartImpl improvements.
+
+ * kwq/KWQKHTMLPartBrowserExtension.mm:
+ * kwq/KWQKHTMLPartImpl.mm:
+ * kwq/KWQLoaderImpl.mm:
+ * kwq/WebCoreBridge.mm:
+ Update for KWQKHTMLPartImpl member name changes.
+
+ Various improvements for other widget implementations.
+
+ * kwq/qt/qbutton.h:
+ * kwq/KWQButton.mm: Stop using KWQNSButton. Instead just use a button adapter
+ object, and a plain old NSButton.
+ (QButton::QButton): Put all the NSButton setup in here.
+ (QButton::~QButton): Release the adapter here.
+ (QButton::clicked): Move this in here because it's virtual now so that QCheckBox
+ can override it.
+ (-[KWQButtonAdapter initWithQButton:]): Added.
+ (-[KWQButtonAdapter action:]): Just call clicked().
+
+ * kwq/qt/qpushbutton.h: Don't pass unused parent pointer to QButton constructor.
+ * kwq/KWQPushButton.mm: (QPushButton::QPushButton): Don't pass unused parent pointer to
+ QButton contructor.
+
+ * kwq/qt/qcheckbox.h:
+ * kwq/KWQCheckBox.mm: Just use NSButton, not KWQNSButton.
+ (QCheckBox::clicked): Move the state-changed logic here; used to be in KWQNSButton.
+
+ * kwq/KWQRadioButton.mm:
+ (QRadioButton::QRadioButton): Don't pass unused parent pointer to
+ QButton contructor.
+
+ * kwq/qt/qcombobox.h:
+ * kwq/KWQComboBox.mm:
+ (QComboBox::QComboBox): Removed extra constructor. Make a plain NSPopUpButton,
+ and use an adapter object, rather than having a KWQNSComboBox.
+ (QComboBox::~QComboBox): Release the adapter.
+ (QComboBox::insertItem): New implementation. No need to keep an items array around,
+ because the menu does that just fine.
+ (QComboBox::clear): Remove the items from the pop-up button directly.
+ (-[KWQComboBoxAdapter initWithQComboBox:]): Added.
+ (-[KWQComboBoxAdapter action:]): Just call activated().
+
+ * kwq/kdeui/kcombobox.h: Empty this out and make it use only inlines.
+
+ * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
+ Remove the setSize()/doneLoading() optimization for QComboBox because the new
+ simpler QComboBox implementation obviates the speed problem this was originally
+ intended to fix.
+
+ * kwq/qt/qlineedit.h:
+ * kwq/KWQLineEdit.mm: (QLineEdit::QLineEdit): Call initWithQLineEdit instead of
+ initWithWidget. Also don't take an unused parent pointer parameter.
+
+ * kwq/kdeui/klineedit.h: Empty this out and make it use only inlines.
+
+ * kwq/qt/qframe.h: Remove unused parent pointer from constructor.
+ * kwq/KWQFrame.mm: Remove unneeded constructor.
+ * kwq/KWQHBox.mm: (QHBox::QHBox): Don't pass unused parent pointer to QFrame.
+ * kwq/KWQLabel.mm: (QLabel::QLabel): Don't pass unused parent pointer to QFrame.
+ * kwq/qt/qscrollview.h: Make constructor inline.
+ * kwq/KWQScrollView.mm: Remove unneeded constructor.
+ * kwq/KWQWindowWidget.h: Remove unneeded constructor.
+
+ * WebCore.pbproj/project.pbxproj: Remove KWQKComboBox.mm, KWQKLineEdit.mm,
+ and KWQScrollBar.h.
+ * kwq/KWQKComboBox.mm: Removed.
+ * kwq/KWQKLineEdit.mm: Removed.
+ * kwq/KWQScrollBar.h: Removed. Unused.
+
+ * kwq/KWQTextArea.h: Change initWithWidget to initWithQTextEdit.
+ * kwq/KWQTextArea.mm: (-[KWQTextArea initWithQTextEdit:]): Changed name.
+ * kwq/KWQTextEdit.mm: (QTextEdit::QTextEdit): Call initWithQTextEdit instead of
+ initWithWidget.
+
+ * kwq/KWQView.h: Eliminated KWQNSButton, KWQNSComboBox, and KWQNSScrollView.
+ * kwq/KWQView.mm: Ditto.
+
+ Housekeeping.
+
+ * force-clean-timestamp: Yes, again.
+
+ * khtml/khtml_part.h: Rearrange APPLE_CHANGES a bit.
+
+ * kwq/qt/qvaluelist.h: Added -- as well as ++ for the const iterator, and fixed some
+ minor const issues. At one point I needed this for the focus changes, but not any more.
+
2002-08-16 Darin Adler <darin at apple.com>
* kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::userAgent):
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c0d574c..a0f91e8 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,132 @@
+2002-08-19 Darin Adler <darin at apple.com>
+
+ First cut at implementation of "tab to change focus": Lots of loose ends, but it's
+ going well.
+
+ * kwq/KWQNSTextField.h: Change initWithWidget to initWithQLineEdit.
+ * kwq/KWQNSTextField.mm:
+ (-[KWQNSTextField initWithQLineEdit:]): Keep a QLineEdit pointer so we don't cast later.
+ (-[KWQNSTextField dealloc]): Sets widget to 0 to make nextKeyView and previousKeyView
+ return nil while deallocating.
+ (-[KWQNSTextField setPasswordMode:]): Pass widget when creating secure text field so it
+ can handle the next/previous links properly.
+ (-[KWQNSTextField nextKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQNSTextField previousKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQTextFieldCell isOpaque]): Added. Returns NO; fixes focus rectangle updating.
+ (-[KWQSecureTextField initWithQWidget:]): Added.
+ (-[KWQSecureTextField dealloc]): Added. Sets widget to 0 to make nextKeyView and
+ previousKeyView return nil while deallocating.
+ (-[KWQSecureTextField nextKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQSecureTextField previousKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+
+ * kwq/KWQKHTMLPartImpl.h: Add KWQSelectionDirection. Change name of getBridge() to
+ bridge(), getDocument() to document(), getRenderer() to renderer(), getBridgeForFrameName()
+ to bridgeForFrameName(). Also added nextKeyView family of member functions.
+
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::nextKeyViewInFrame): Added.
+ (KWQKHTMLPartImpl::nextKeyView): Added.
+
+ * kwq/qt/qwidget.h: Remove unneeded parameters from constructor. Also added a
+ constructor that takes an NSView.
+ * kwq/KWQWidget.mm:
+ (QWidget::QWidget): Don't store focus policy (it was uninitialized before).
+ (QWidget::focusPolicy): Return TabFocus for any widget that has a view with a first
+ responder, NoFocus for any other.
+ (QWidget::setFocusPolicy): Do nothing.
+ (QWidget::setFocusProxy): Do nothing.
+
+ * kwq/qt/qobject.h: Store the event filter object when installEventFilter is called.
+ This is used to find the RenderWidget for a QWidget by the new tabbing code.
+ * kwq/KWQObject.mm: Removed event-filter functions. Two are now inlines, one deleted.
+
+ Other changes related to KWQKHTMLPartImpl improvements.
+
+ * kwq/KWQKHTMLPartBrowserExtension.mm:
+ * kwq/KWQKHTMLPartImpl.mm:
+ * kwq/KWQLoaderImpl.mm:
+ * kwq/WebCoreBridge.mm:
+ Update for KWQKHTMLPartImpl member name changes.
+
+ Various improvements for other widget implementations.
+
+ * kwq/qt/qbutton.h:
+ * kwq/KWQButton.mm: Stop using KWQNSButton. Instead just use a button adapter
+ object, and a plain old NSButton.
+ (QButton::QButton): Put all the NSButton setup in here.
+ (QButton::~QButton): Release the adapter here.
+ (QButton::clicked): Move this in here because it's virtual now so that QCheckBox
+ can override it.
+ (-[KWQButtonAdapter initWithQButton:]): Added.
+ (-[KWQButtonAdapter action:]): Just call clicked().
+
+ * kwq/qt/qpushbutton.h: Don't pass unused parent pointer to QButton constructor.
+ * kwq/KWQPushButton.mm: (QPushButton::QPushButton): Don't pass unused parent pointer to
+ QButton contructor.
+
+ * kwq/qt/qcheckbox.h:
+ * kwq/KWQCheckBox.mm: Just use NSButton, not KWQNSButton.
+ (QCheckBox::clicked): Move the state-changed logic here; used to be in KWQNSButton.
+
+ * kwq/KWQRadioButton.mm:
+ (QRadioButton::QRadioButton): Don't pass unused parent pointer to
+ QButton contructor.
+
+ * kwq/qt/qcombobox.h:
+ * kwq/KWQComboBox.mm:
+ (QComboBox::QComboBox): Removed extra constructor. Make a plain NSPopUpButton,
+ and use an adapter object, rather than having a KWQNSComboBox.
+ (QComboBox::~QComboBox): Release the adapter.
+ (QComboBox::insertItem): New implementation. No need to keep an items array around,
+ because the menu does that just fine.
+ (QComboBox::clear): Remove the items from the pop-up button directly.
+ (-[KWQComboBoxAdapter initWithQComboBox:]): Added.
+ (-[KWQComboBoxAdapter action:]): Just call activated().
+
+ * kwq/kdeui/kcombobox.h: Empty this out and make it use only inlines.
+
+ * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
+ Remove the setSize()/doneLoading() optimization for QComboBox because the new
+ simpler QComboBox implementation obviates the speed problem this was originally
+ intended to fix.
+
+ * kwq/qt/qlineedit.h:
+ * kwq/KWQLineEdit.mm: (QLineEdit::QLineEdit): Call initWithQLineEdit instead of
+ initWithWidget. Also don't take an unused parent pointer parameter.
+
+ * kwq/kdeui/klineedit.h: Empty this out and make it use only inlines.
+
+ * kwq/qt/qframe.h: Remove unused parent pointer from constructor.
+ * kwq/KWQFrame.mm: Remove unneeded constructor.
+ * kwq/KWQHBox.mm: (QHBox::QHBox): Don't pass unused parent pointer to QFrame.
+ * kwq/KWQLabel.mm: (QLabel::QLabel): Don't pass unused parent pointer to QFrame.
+ * kwq/qt/qscrollview.h: Make constructor inline.
+ * kwq/KWQScrollView.mm: Remove unneeded constructor.
+ * kwq/KWQWindowWidget.h: Remove unneeded constructor.
+
+ * WebCore.pbproj/project.pbxproj: Remove KWQKComboBox.mm, KWQKLineEdit.mm,
+ and KWQScrollBar.h.
+ * kwq/KWQKComboBox.mm: Removed.
+ * kwq/KWQKLineEdit.mm: Removed.
+ * kwq/KWQScrollBar.h: Removed. Unused.
+
+ * kwq/KWQTextArea.h: Change initWithWidget to initWithQTextEdit.
+ * kwq/KWQTextArea.mm: (-[KWQTextArea initWithQTextEdit:]): Changed name.
+ * kwq/KWQTextEdit.mm: (QTextEdit::QTextEdit): Call initWithQTextEdit instead of
+ initWithWidget.
+
+ * kwq/KWQView.h: Eliminated KWQNSButton, KWQNSComboBox, and KWQNSScrollView.
+ * kwq/KWQView.mm: Ditto.
+
+ Housekeeping.
+
+ * force-clean-timestamp: Yes, again.
+
+ * khtml/khtml_part.h: Rearrange APPLE_CHANGES a bit.
+
+ * kwq/qt/qvaluelist.h: Added -- as well as ++ for the const iterator, and fixed some
+ minor const issues. At one point I needed this for the focus changes, but not any more.
+
2002-08-16 Darin Adler <darin at apple.com>
* kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::userAgent):
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c0d574c..a0f91e8 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,132 @@
+2002-08-19 Darin Adler <darin at apple.com>
+
+ First cut at implementation of "tab to change focus": Lots of loose ends, but it's
+ going well.
+
+ * kwq/KWQNSTextField.h: Change initWithWidget to initWithQLineEdit.
+ * kwq/KWQNSTextField.mm:
+ (-[KWQNSTextField initWithQLineEdit:]): Keep a QLineEdit pointer so we don't cast later.
+ (-[KWQNSTextField dealloc]): Sets widget to 0 to make nextKeyView and previousKeyView
+ return nil while deallocating.
+ (-[KWQNSTextField setPasswordMode:]): Pass widget when creating secure text field so it
+ can handle the next/previous links properly.
+ (-[KWQNSTextField nextKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQNSTextField previousKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQTextFieldCell isOpaque]): Added. Returns NO; fixes focus rectangle updating.
+ (-[KWQSecureTextField initWithQWidget:]): Added.
+ (-[KWQSecureTextField dealloc]): Added. Sets widget to 0 to make nextKeyView and
+ previousKeyView return nil while deallocating.
+ (-[KWQSecureTextField nextKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+ (-[KWQSecureTextField previousKeyView]): Added. Calls KWQKHTMLPartImpl::nextKeyView.
+
+ * kwq/KWQKHTMLPartImpl.h: Add KWQSelectionDirection. Change name of getBridge() to
+ bridge(), getDocument() to document(), getRenderer() to renderer(), getBridgeForFrameName()
+ to bridgeForFrameName(). Also added nextKeyView family of member functions.
+
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::nextKeyViewInFrame): Added.
+ (KWQKHTMLPartImpl::nextKeyView): Added.
+
+ * kwq/qt/qwidget.h: Remove unneeded parameters from constructor. Also added a
+ constructor that takes an NSView.
+ * kwq/KWQWidget.mm:
+ (QWidget::QWidget): Don't store focus policy (it was uninitialized before).
+ (QWidget::focusPolicy): Return TabFocus for any widget that has a view with a first
+ responder, NoFocus for any other.
+ (QWidget::setFocusPolicy): Do nothing.
+ (QWidget::setFocusProxy): Do nothing.
+
+ * kwq/qt/qobject.h: Store the event filter object when installEventFilter is called.
+ This is used to find the RenderWidget for a QWidget by the new tabbing code.
+ * kwq/KWQObject.mm: Removed event-filter functions. Two are now inlines, one deleted.
+
+ Other changes related to KWQKHTMLPartImpl improvements.
+
+ * kwq/KWQKHTMLPartBrowserExtension.mm:
+ * kwq/KWQKHTMLPartImpl.mm:
+ * kwq/KWQLoaderImpl.mm:
+ * kwq/WebCoreBridge.mm:
+ Update for KWQKHTMLPartImpl member name changes.
+
+ Various improvements for other widget implementations.
+
+ * kwq/qt/qbutton.h:
+ * kwq/KWQButton.mm: Stop using KWQNSButton. Instead just use a button adapter
+ object, and a plain old NSButton.
+ (QButton::QButton): Put all the NSButton setup in here.
+ (QButton::~QButton): Release the adapter here.
+ (QButton::clicked): Move this in here because it's virtual now so that QCheckBox
+ can override it.
+ (-[KWQButtonAdapter initWithQButton:]): Added.
+ (-[KWQButtonAdapter action:]): Just call clicked().
+
+ * kwq/qt/qpushbutton.h: Don't pass unused parent pointer to QButton constructor.
+ * kwq/KWQPushButton.mm: (QPushButton::QPushButton): Don't pass unused parent pointer to
+ QButton contructor.
+
+ * kwq/qt/qcheckbox.h:
+ * kwq/KWQCheckBox.mm: Just use NSButton, not KWQNSButton.
+ (QCheckBox::clicked): Move the state-changed logic here; used to be in KWQNSButton.
+
+ * kwq/KWQRadioButton.mm:
+ (QRadioButton::QRadioButton): Don't pass unused parent pointer to
+ QButton contructor.
+
+ * kwq/qt/qcombobox.h:
+ * kwq/KWQComboBox.mm:
+ (QComboBox::QComboBox): Removed extra constructor. Make a plain NSPopUpButton,
+ and use an adapter object, rather than having a KWQNSComboBox.
+ (QComboBox::~QComboBox): Release the adapter.
+ (QComboBox::insertItem): New implementation. No need to keep an items array around,
+ because the menu does that just fine.
+ (QComboBox::clear): Remove the items from the pop-up button directly.
+ (-[KWQComboBoxAdapter initWithQComboBox:]): Added.
+ (-[KWQComboBoxAdapter action:]): Just call activated().
+
+ * kwq/kdeui/kcombobox.h: Empty this out and make it use only inlines.
+
+ * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
+ Remove the setSize()/doneLoading() optimization for QComboBox because the new
+ simpler QComboBox implementation obviates the speed problem this was originally
+ intended to fix.
+
+ * kwq/qt/qlineedit.h:
+ * kwq/KWQLineEdit.mm: (QLineEdit::QLineEdit): Call initWithQLineEdit instead of
+ initWithWidget. Also don't take an unused parent pointer parameter.
+
+ * kwq/kdeui/klineedit.h: Empty this out and make it use only inlines.
+
+ * kwq/qt/qframe.h: Remove unused parent pointer from constructor.
+ * kwq/KWQFrame.mm: Remove unneeded constructor.
+ * kwq/KWQHBox.mm: (QHBox::QHBox): Don't pass unused parent pointer to QFrame.
+ * kwq/KWQLabel.mm: (QLabel::QLabel): Don't pass unused parent pointer to QFrame.
+ * kwq/qt/qscrollview.h: Make constructor inline.
+ * kwq/KWQScrollView.mm: Remove unneeded constructor.
+ * kwq/KWQWindowWidget.h: Remove unneeded constructor.
+
+ * WebCore.pbproj/project.pbxproj: Remove KWQKComboBox.mm, KWQKLineEdit.mm,
+ and KWQScrollBar.h.
+ * kwq/KWQKComboBox.mm: Removed.
+ * kwq/KWQKLineEdit.mm: Removed.
+ * kwq/KWQScrollBar.h: Removed. Unused.
+
+ * kwq/KWQTextArea.h: Change initWithWidget to initWithQTextEdit.
+ * kwq/KWQTextArea.mm: (-[KWQTextArea initWithQTextEdit:]): Changed name.
+ * kwq/KWQTextEdit.mm: (QTextEdit::QTextEdit): Call initWithQTextEdit instead of
+ initWithWidget.
+
+ * kwq/KWQView.h: Eliminated KWQNSButton, KWQNSComboBox, and KWQNSScrollView.
+ * kwq/KWQView.mm: Ditto.
+
+ Housekeeping.
+
+ * force-clean-timestamp: Yes, again.
+
+ * khtml/khtml_part.h: Rearrange APPLE_CHANGES a bit.
+
+ * kwq/qt/qvaluelist.h: Added -- as well as ++ for the const iterator, and fixed some
+ minor const issues. At one point I needed this for the focus changes, but not any more.
+
2002-08-16 Darin Adler <darin at apple.com>
* kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::userAgent):
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index e93f172..3b9b699 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -204,7 +204,6 @@
F58785AD02DE375901EA4122,
F58785B702DE375901EA4122,
F58785BC02DE375901EA4122,
- F58785BF02DE375901EA4122,
F58785C702DE375901EA4122,
F58785CD02DE375901EA4122,
F58785D002DE375901EA4122,
@@ -539,7 +538,6 @@
F587857A02DE375901EA4122,
F587857C02DE375901EA4122,
F587857D02DE375901EA4122,
- F587857E02DE375901EA4122,
F587857F02DE375901EA4122,
F587858102DE375901EA4122,
F587858202DE375901EA4122,
@@ -557,7 +555,6 @@
F587859102DE375901EA4122,
F587859202DE375901EA4122,
F587859302DE375901EA4122,
- F587859402DE375901EA4122,
F587859502DE375901EA4122,
F587859602DE375901EA4122,
F587859702DE375901EA4122,
@@ -3973,11 +3970,6 @@
path = KWQKCharsets.mm;
refType = 4;
};
- F58784EC02DE375901EA4122 = {
- isa = PBXFileReference;
- path = KWQKComboBox.mm;
- refType = 4;
- };
F58784ED02DE375901EA4122 = {
isa = PBXFileReference;
path = KWQKConfigBase.mm;
@@ -4073,11 +4065,6 @@
path = KWQKjobclasses.mm;
refType = 4;
};
- F587850202DE375901EA4122 = {
- isa = PBXFileReference;
- path = KWQKLineEdit.mm;
- refType = 4;
- };
F587850302DE375901EA4122 = {
isa = PBXFileReference;
path = KWQLoaderImpl.mm;
@@ -4296,12 +4283,6 @@
path = ../KWQRegion.mm;
refType = 4;
};
- F587852D02DE375901EA4122 = {
- isa = PBXFileReference;
- name = KWQScrollBar.h;
- path = ../KWQScrollBar.h;
- refType = 4;
- };
F587852E02DE375901EA4122 = {
isa = PBXFileReference;
name = KWQScrollView.mm;
@@ -4737,12 +4718,6 @@
settings = {
};
};
- F587857E02DE375901EA4122 = {
- fileRef = F58784EC02DE375901EA4122;
- isa = PBXBuildFile;
- settings = {
- };
- };
F587857F02DE375901EA4122 = {
fileRef = F58784ED02DE375901EA4122;
isa = PBXBuildFile;
@@ -4857,12 +4832,6 @@
settings = {
};
};
- F587859402DE375901EA4122 = {
- fileRef = F587850202DE375901EA4122;
- isa = PBXBuildFile;
- settings = {
- };
- };
F587859502DE375901EA4122 = {
fileRef = F587850302DE375901EA4122;
isa = PBXBuildFile;
@@ -5097,12 +5066,6 @@
settings = {
};
};
- F58785BF02DE375901EA4122 = {
- fileRef = F587852D02DE375901EA4122;
- isa = PBXBuildFile;
- settings = {
- };
- };
F58785C002DE375901EA4122 = {
fileRef = F587852E02DE375901EA4122;
isa = PBXBuildFile;
@@ -5852,12 +5815,10 @@
children = (
F587861D02DE398401EA4122,
F587861E02DE398401EA4122,
- F58784EC02DE375901EA4122,
F587861F02DE398401EA4122,
F587862002DE398401EA4122,
F58784F002DE375901EA4122,
F587862102DE398401EA4122,
- F587850202DE375901EA4122,
F587862202DE398401EA4122,
F587862302DE398401EA4122,
F587850502DE375901EA4122,
@@ -7349,7 +7310,6 @@
F587852B02DE375901EA4122,
F58786B402DE3B8601EA4122,
F587852C02DE375901EA4122,
- F587852D02DE375901EA4122,
F58786B502DE3B8601EA4122,
F587852E02DE375901EA4122,
F58786B602DE3B8601EA4122,
diff --git a/WebCore/force-clean-timestamp b/WebCore/force-clean-timestamp
index f532475..c455133 100644
--- a/WebCore/force-clean-timestamp
+++ b/WebCore/force-clean-timestamp
@@ -1,2 +1 @@
-JavaScriptCore changes again 8/16 - mjs
-
+widget changes 8/17
diff --git a/WebCore/khtml/khtml_part.h b/WebCore/khtml/khtml_part.h
index 9639369..27ba140 100644
--- a/WebCore/khtml/khtml_part.h
+++ b/WebCore/khtml/khtml_part.h
@@ -740,12 +740,6 @@ signals:
*/
void nodeActivated(const DOM::Node &);
-#ifdef APPLE_CHANGES
- void completed();
- void completed(bool);
- void started(KIO::Job *);
-#endif
-
protected:
/**
@@ -1091,9 +1085,13 @@ private:
#ifdef APPLE_CHANGES
public:
- void setStatusBarText(const QString &);
KWQKHTMLPartImpl *impl;
friend class KWQKHTMLPartImpl;
+
+ void completed();
+ void completed(bool);
+ void setStatusBarText(const QString &);
+ void started(KIO::Job *);
#endif
};
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index 1314339..fb6376b 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -811,9 +811,7 @@ void RenderSelect::updateFromElement()
static_cast<KComboBox*>(m_widget)->clear();
#ifdef APPLE_CHANGES
- if(!m_useListBox)
- static_cast<KComboBox*>(m_widget)->setSize(listItems.size());
- else
+ if (m_useListBox)
static_cast<KListBox*>(m_widget)->beginBatchInsert();
#endif
for (listIndex = 0; listIndex < int(listItems.size()); listIndex++) {
@@ -851,9 +849,7 @@ void RenderSelect::updateFromElement()
m_selectionChanged = true;
}
#ifdef APPLE_CHANGES
- if(!m_useListBox)
- static_cast<KComboBox*>(m_widget)->doneLoading();
- else
+ if (m_useListBox)
static_cast<KListBox*>(m_widget)->endBatchInsert();
#endif
setMinMaxKnown(false);
diff --git a/WebCore/kwq/KWQButton.h b/WebCore/kwq/KWQButton.h
index 57da053..ad2449d 100644
--- a/WebCore/kwq/KWQButton.h
+++ b/WebCore/kwq/KWQButton.h
@@ -29,10 +29,17 @@
#include <qwidget.h>
#include <qstring.h>
#include <KWQSignal.h>
-
+
+#ifdef __OBJC__
+ at class KWQButtonAdapter;
+#else
+class KWQButtonAdapter;
+#endif
+
class QButton : public QWidget {
public:
- QButton(QWidget *parent = 0);
+ QButton();
+ ~QButton();
virtual void setText(const QString &);
QString text() const;
@@ -41,10 +48,11 @@ public:
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
- void clicked() { m_clicked.call(); }
+ virtual void clicked();
private:
KWQSignal m_clicked;
+ KWQButtonAdapter *m_adapter;
};
#endif
diff --git a/WebCore/kwq/KWQButton.mm b/WebCore/kwq/KWQButton.mm
index 02d362e..d8e945a 100644
--- a/WebCore/kwq/KWQButton.mm
+++ b/WebCore/kwq/KWQButton.mm
@@ -25,7 +25,7 @@
#import <qbutton.h>
-#import <KWQView.h>
+#import <qcheckbox.h>
// We empirically determined that buttons have these extra pixels on all
// sides. It would be better to get this info from AppKit somehow.
@@ -34,17 +34,43 @@
#define LEFT_MARGIN 5
#define RIGHT_MARGIN 5
-QButton::QButton(QWidget *parent)
+ at interface KWQButtonAdapter : NSObject
+{
+ QButton *button;
+}
+
+- initWithQButton:(QButton *)b;
+- (void)action:(id)sender;
+
+ at end
+
+QButton::QButton()
: m_clicked(this, SIGNAL(clicked()))
+ , m_adapter([[KWQButtonAdapter alloc] initWithQButton:this])
{
- KWQNSButton *button = [[KWQNSButton alloc] initWithWidget:this];
+ NSButton *button = [[NSButton alloc] init];
+
+ [button setTarget:m_adapter];
+ [button setAction:@selector(action:)];
+
+ [button setTitle:@""];
+ [button setBezelStyle:NSRoundedBezelStyle];
+ [[button cell] setControlSize:NSSmallControlSize];
+ [button setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+
setView(button);
+
[button release];
}
+QButton::~QButton()
+{
+ [m_adapter release];
+}
+
QSize QButton::sizeHint() const
{
- KWQNSButton *button = (KWQNSButton *)getView();
+ NSButton *button = (NSButton *)getView();
return QSize((int)[[button cell] cellSize].width - (LEFT_MARGIN + RIGHT_MARGIN),
(int)[[button cell] cellSize].height - (TOP_MARGIN + BOTTOM_MARGIN));
}
@@ -66,12 +92,32 @@ void QButton::setFrameGeometry(const QRect &r)
void QButton::setText(const QString &s)
{
- KWQNSButton *button = (KWQNSButton *)getView();
+ NSButton *button = (NSButton *)getView();
[button setTitle:s.getNSString()];
}
QString QButton::text() const
{
- KWQNSButton *button = (KWQNSButton *)getView();
+ NSButton *button = (NSButton *)getView();
return QString::fromNSString([button title]);
}
+
+void QButton::clicked()
+{
+ m_clicked.call();
+}
+
+ at implementation KWQButtonAdapter
+
+- initWithQButton:(QButton *)b
+{
+ button = b;
+ return [super init];
+}
+
+- (void)action:(id)sender
+{
+ button->clicked();
+}
+
+ at end
diff --git a/WebCore/kwq/KWQCheckBox.h b/WebCore/kwq/KWQCheckBox.h
index 8112da4..0af3f29 100644
--- a/WebCore/kwq/KWQCheckBox.h
+++ b/WebCore/kwq/KWQCheckBox.h
@@ -39,7 +39,7 @@ public:
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
- void stateChanged() { m_stateChanged.call(isChecked() ? 2 : 0); }
+ virtual void clicked();
private:
KWQSignal m_stateChanged;
diff --git a/WebCore/kwq/KWQCheckBox.mm b/WebCore/kwq/KWQCheckBox.mm
index 9a695a6..c64306f 100644
--- a/WebCore/kwq/KWQCheckBox.mm
+++ b/WebCore/kwq/KWQCheckBox.mm
@@ -25,8 +25,6 @@
#import <qcheckbox.h>
-#import <KWQView.h>
-
// We empirically determined that check boxes have these extra pixels on all
// sides. It would be better to get this info from AppKit somehow.
#define TOP_MARGIN 1
@@ -35,12 +33,10 @@
#define RIGHT_MARGIN 3
QCheckBox::QCheckBox(QWidget *w)
- : QButton(w)
- , m_stateChanged(this, SIGNAL(stateChanged(int)))
+ : m_stateChanged(this, SIGNAL(stateChanged(int)))
{
- KWQNSButton *button = (KWQNSButton *)getView();
- [button setButtonType: NSSwitchButton];
- [button setAction:@selector(stateChanged:)];
+ NSButton *button = (NSButton *)getView();
+ [button setButtonType:NSSwitchButton];
}
QSize QCheckBox::sizeHint() const
@@ -65,12 +61,23 @@ void QCheckBox::setFrameGeometry(const QRect &r)
void QCheckBox::setChecked(bool isChecked)
{
- KWQNSButton *button = (KWQNSButton *)getView();
+ NSButton *button = (NSButton *)getView();
[button setState:isChecked ? NSOnState : NSOffState];
}
bool QCheckBox::isChecked()
{
- KWQNSButton *button = (KWQNSButton *)getView();
+ NSButton *button = (NSButton *)getView();
return [button state] == NSOnState;
}
+
+void QCheckBox::clicked()
+{
+ // Note that it's important to give the stateChanged signal before
+ // the clicked signal so that the corresponding JavaScript messages
+ // go in the right order. A test for this at the time of this writing
+ // was the languages radio buttons and check boxes at google.com prefs.
+
+ m_stateChanged.call(isChecked() ? 2 : 0);
+ QButton::clicked();
+}
diff --git a/WebCore/kwq/KWQComboBox.h b/WebCore/kwq/KWQComboBox.h
index 07d0a42..116fb30 100644
--- a/WebCore/kwq/KWQComboBox.h
+++ b/WebCore/kwq/KWQComboBox.h
@@ -30,40 +30,36 @@
#include <qwidget.h>
#ifdef __OBJC__
- at class NSMutableArray;
+ at class KWQComboBoxAdapter;
#else
-class NSMutableArray;
+class KWQComboBoxAdapter;
#endif
class QComboBox : public QWidget {
public:
- QComboBox(QWidget *parent=0, const char *name=0);
- QComboBox(bool rw, QWidget *parent=0, const char *name=0);
+ QComboBox();
~QComboBox();
-
- int count() const;
- QListBox *listBox() const;
- void popup();
- bool eventFilter(QObject *object, QEvent *event);
- void insertItem(const QString &text, int index=-1);
+
void clear();
- int currentItem() const;
+ void insertItem(const QString &text, int index=-1);
- int indexOfCurrentItem();
+ int currentItem() const;
void setCurrentItem(int);
+
+ QListBox *listBox() const { return 0; }
+ void popup() { }
QSize sizeHint() const;
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
- NSMutableArray *items;
+ bool eventFilter(QObject *object, QEvent *event) { return false; }
- void activated() { m_activated.call(indexOfCurrentItem()); }
+ void activated() { m_activated.call(currentItem()); }
private:
- void init(bool isEditable);
-
KWQSignal m_activated;
+ KWQComboBoxAdapter *m_adapter;
};
#endif
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index 885728b..3d3d561 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -25,8 +25,6 @@
#import <qcombobox.h>
-#import <KWQView.h>
-
#import <kwqdebug.h>
// We empirically determined that combo boxes have these extra pixels on all
@@ -36,75 +34,60 @@
#define LEFT_MARGIN 3
#define RIGHT_MARGIN 3
-QComboBox::QComboBox(QWidget *parent, const char *name)
- : m_activated(this, SIGNAL(activated(int)))
+ at interface KWQComboBoxAdapter : NSObject
{
- init(false);
+ QComboBox *box;
}
-QComboBox::QComboBox(bool rw, QWidget *parent, const char *name)
- : m_activated(this, SIGNAL(activated(int)))
-{
- init(rw);
-}
+- initWithQComboBox:(QComboBox *)b;
+- (void)action:(id)sender;
-void QComboBox::init(bool isEditable)
-{
- KWQNSComboBox *comboBox = [[KWQNSComboBox alloc] initWithWidget:this];
- setView(comboBox);
- [comboBox release];
-
- items = [[NSMutableArray alloc] init];
-}
+ at end
-QComboBox::~QComboBox()
+QComboBox::QComboBox()
+ : m_activated(this, SIGNAL(activated(int)))
+ , m_adapter([[KWQComboBoxAdapter alloc] initWithQComboBox:this])
{
- [items release];
-}
+ NSPopUpButton *button = [[NSPopUpButton alloc] init];
-int QComboBox::count() const
-{
- KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
- return [comboBox numberOfItems];
-}
+ [button setTarget:m_adapter];
+ [button setAction:@selector(action:)];
-QListBox *QComboBox::listBox() const
-{
- return 0;
-}
+ [[button cell] setControlSize:NSSmallControlSize];
+ [button setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
-void QComboBox::popup()
-{
+ setView(button);
+
+ [button release];
}
-bool QComboBox::eventFilter(QObject *object, QEvent *event)
+QComboBox::~QComboBox()
{
- _logNotYetImplemented();
- return FALSE;
+ [m_adapter release];
}
void QComboBox::insertItem(const QString &text, int index)
{
- NSString *string;
- int numItems = [items count];
- string = [text.getNSString() copy];
- if (index < 0 || index == numItems) {
- [items addObject:string];
- } else {
- while (index >= numItems) {
- [items addObject: @""];
- ++numItems;
- }
- [items replaceObjectAtIndex:index withObject:string];
+ NSPopUpButton *button = (NSPopUpButton *)getView();
+ int numItems = [button numberOfItems];
+ if (index < 0) {
+ index = numItems;
+ }
+ while (index >= numItems) {
+ [button addItemWithTitle:@""];
+ ++numItems;
}
- [string release];
+ // It's convenient that we added the item with an empty title,
+ // because addItemWithTitle will not allow multiple items with the
+ // same title. But this way, we can have such duplicate items.
+ [[button itemAtIndex:index] setTitle:text.getNSString()];
}
QSize QComboBox::sizeHint() const
{
- KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
- return QSize((int)[[comboBox cell] cellSize].width - (LEFT_MARGIN + RIGHT_MARGIN),
- (int)[[comboBox cell] cellSize].height - (TOP_MARGIN + BOTTOM_MARGIN));
+ NSPopUpButton *button = (NSPopUpButton *)getView();
+ return QSize((int)[[button cell] cellSize].width - (LEFT_MARGIN + RIGHT_MARGIN),
+ (int)[[button cell] cellSize].height - (TOP_MARGIN + BOTTOM_MARGIN));
}
QRect QComboBox::frameGeometry() const
@@ -124,28 +107,33 @@ void QComboBox::setFrameGeometry(const QRect &r)
void QComboBox::clear()
{
- KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
- [comboBox removeAllItems];
+ NSPopUpButton *button = (NSPopUpButton *)getView();
+ [button removeAllItems];
}
-int QComboBox::indexOfCurrentItem()
+void QComboBox::setCurrentItem(int index)
{
- KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
- return [comboBox indexOfSelectedItem];
+ NSPopUpButton *button = (NSPopUpButton *)getView();
+ [button selectItemAtIndex:index];
}
-void QComboBox::setCurrentItem(int index)
+int QComboBox::currentItem() const
{
- KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
- int num = [comboBox numberOfItems];
- if (num != 0 && index < num)
- [comboBox selectItemAtIndex:index];
- else
- KWQDEBUG("Error, index = %d, numberOfItems = %d", index, num);
+ NSPopUpButton *button = (NSPopUpButton *)getView();
+ return [button indexOfSelectedItem];
}
-int QComboBox::currentItem() const
+ at implementation KWQComboBoxAdapter
+
+- initWithQComboBox:(QComboBox *)b
+{
+ box = b;
+ return [super init];
+}
+
+- (void)action:(id)sender
{
- KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
- return [comboBox indexOfSelectedItem];
+ box->activated();
}
+
+ at end
diff --git a/WebCore/kwq/KWQFrame.h b/WebCore/kwq/KWQFrame.h
index 989ddf9..bf7d8ee 100644
--- a/WebCore/kwq/KWQFrame.h
+++ b/WebCore/kwq/KWQFrame.h
@@ -33,7 +33,7 @@ public:
enum Shape { NoFrame, Box, StyledPanel };
enum Shadow { Sunken };
- QFrame(QWidget *parent);
+ QFrame() { }
virtual void setFrameStyle(int);
int frameStyle();
diff --git a/WebCore/kwq/KWQFrame.mm b/WebCore/kwq/KWQFrame.mm
index fada6b7..979db79 100644
--- a/WebCore/kwq/KWQFrame.mm
+++ b/WebCore/kwq/KWQFrame.mm
@@ -27,11 +27,6 @@
#import <kwqdebug.h>
-QFrame::QFrame(QWidget *parent)
- : QWidget(parent)
-{
-}
-
void QFrame::setFrameStyle(int s)
{
_frameStyle = s;
diff --git a/WebCore/kwq/KWQHBox.mm b/WebCore/kwq/KWQHBox.mm
index 7f22cde..4922b47 100644
--- a/WebCore/kwq/KWQHBox.mm
+++ b/WebCore/kwq/KWQHBox.mm
@@ -32,7 +32,6 @@
// to stretch a LineEditWidget. We probably don't need it at all.
QHBox::QHBox(QWidget *parent)
- : QFrame(parent)
{
KWQView *view = (KWQView *)getView();
[view setIsFlipped: NO];
diff --git a/WebCore/kwq/KWQKComboBox.h b/WebCore/kwq/KWQKComboBox.h
index 69ac55c..df31902 100644
--- a/WebCore/kwq/KWQKComboBox.h
+++ b/WebCore/kwq/KWQKComboBox.h
@@ -27,17 +27,11 @@
#define KCOMBOBOX_H_
#include <qcombobox.h>
-
#include <KWQCompletion.h>
class KComboBox : public QComboBox, public KCompletionBase {
public:
- KComboBox(QWidget *parent=0, const char *name=0);
- KComboBox(bool rw, QWidget *parent=0, const char *name=0);
- virtual ~KComboBox();
-
- void doneLoading();
- void setSize(int size);
+ KComboBox(bool, QWidget *) { }
};
#endif
diff --git a/WebCore/kwq/KWQKComboBox.mm b/WebCore/kwq/KWQKComboBox.mm
deleted file mode 100644
index c0719bc..0000000
--- a/WebCore/kwq/KWQKComboBox.mm
+++ /dev/null
@@ -1,79 +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.
- */
-#import <kwqdebug.h>
-#import <kcombobox.h>
-
-#import <KWQView.h>
-
-KComboBox::KComboBox(QWidget *parent, const char *name)
-{
- _logNotYetImplemented();
-}
-
-
-KComboBox::KComboBox(bool rw, QWidget *parent, const char *name)
-{
- _logNotYetImplemented();
-}
-
-KComboBox::~KComboBox()
-{
- _logNotYetImplemented();
-}
-
-void KComboBox::doneLoading()
-{
- KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
- NSMutableArray *numberedItems;
- int i, _count = [items count];
-
- [comboBox removeAllItems];
-
- // Hack to allow multiple items with same name. Ugh.
- // NSPopupButton is really stupid. It doesn't allow
- // entries with the same title, unless you explicitly
- // set the title with setTitle: after all the entries
- // have been added.
- numberedItems = [[NSMutableArray alloc] init];
- for (i = 0; i < _count; i++)
- [numberedItems addObject: [NSString stringWithFormat: @"%d", i]];
-
- [comboBox addItemsWithTitles: numberedItems];
-
- for (i = 0; i < _count; i++){
- [[comboBox itemAtIndex: i] setTitle: [items objectAtIndex: i]];
- }
-
- [numberedItems release];
-}
-
-
-void KComboBox::setSize(int size)
-{
- NSMutableArray *newItems = [[NSMutableArray alloc] initWithCapacity: size];
- [items release];
- items = newItems;
-}
-
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 40ab633..f1a549e 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -41,6 +41,7 @@ namespace KParts {
namespace DOM {
class DOMString;
class DocumentImpl;
+ class NodeImpl;
}
namespace khtml {
@@ -49,23 +50,28 @@ namespace khtml {
}
#ifdef __OBJC__
+ at class NSView;
@class WebCoreBridge;
- at class NSMutableSet;
#else
+class NSView;
class WebCoreBridge;
-class NSMutableSet;
#endif
+enum KWQSelectionDirection {
+ KWQSelectingNext,
+ KWQSelectingPrevious
+};
+
class KWQKHTMLPartImpl : public QObject
{
public:
KWQKHTMLPartImpl(KHTMLPart *);
~KWQKHTMLPartImpl();
- void setBridge(WebCoreBridge *p) { bridge = p; }
- WebCoreBridge *getBridge() const { return bridge; }
+ void setBridge(WebCoreBridge *p) { _bridge = p; }
+ WebCoreBridge *bridge() const { return _bridge; }
void setView(KHTMLView *view);
- KHTMLView *getView() const;
+ KHTMLView *view() const;
void openURLRequest(const KURL &, const KParts::URLArgs &);
@@ -98,22 +104,27 @@ public:
QString userAgent() const;
+ static NSView *nextKeyView(QWidget *startingPoint, KWQSelectionDirection);
+
// Incoming calls, used by the bridge.
- DOM::DocumentImpl *getDocument();
- khtml::RenderObject *getRenderer();
+ DOM::DocumentImpl *document();
+ khtml::RenderObject *renderer();
// Used internally, but need to be public because they are used by non-member functions.
void redirectionTimerStartedOrStopped();
private:
- WebCoreBridge *getBridgeForFrameName(const QString &frameName);
+ WebCoreBridge *bridgeForFrameName(const QString &frameName);
+
+ NSView *nextKeyView(DOM::NodeImpl *, KWQSelectionDirection);
+ NSView *nextKeyViewInFrame(DOM::NodeImpl *, KWQSelectionDirection);
KHTMLPart *part;
KHTMLPartPrivate *d;
- WebCoreBridge *bridge;
+ WebCoreBridge *_bridge;
friend class KHTMLPart;
};
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index ceb5631..9eb2d94 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -94,8 +94,8 @@ void KHTMLPart::completed(bool arg)
parentPart()->slotChildCompleted(arg);
}
- QValueList<ChildFrame>::ConstIterator it = d->m_frames.begin();
- QValueList<ChildFrame>::ConstIterator end = d->m_frames.end();
+ ConstFrameIt it = d->m_frames.begin();
+ ConstFrameIt end = d->m_frames.end();
for (; it != end; ++it ) {
KHTMLPart *part = dynamic_cast<KHTMLPart *>((*it).m_part.pointer());
if (part) {
@@ -114,21 +114,21 @@ KWQKHTMLPartImpl::~KWQKHTMLPartImpl()
{
}
-WebCoreBridge *KWQKHTMLPartImpl::getBridgeForFrameName(const QString &frameName)
+WebCoreBridge *KWQKHTMLPartImpl::bridgeForFrameName(const QString &frameName)
{
WebCoreBridge *frame;
if (frameName.isEmpty()) {
// If we're the only frame in a frameset then pop the frame.
KHTMLPart *parentPart = part->parentPart();
- frame = parentPart ? parentPart->impl->bridge : nil;
+ frame = parentPart ? parentPart->impl->_bridge : nil;
if ([[frame childFrames] count] != 1) {
- frame = bridge;
+ frame = _bridge;
}
} else {
- frame = [bridge descendantFrameNamed:frameName.getNSString()];
+ frame = [_bridge descendantFrameNamed:frameName.getNSString()];
if (frame == nil) {
NSLog (@"WARNING: unable to find frame named %@, creating new window with \"_blank\" name. New window will not be named until 2959902 is fixed.\n", frameName.getNSString());
- frame = [bridge descendantFrameNamed:@"_blank"];
+ frame = [_bridge descendantFrameNamed:@"_blank"];
}
}
@@ -143,7 +143,7 @@ void KWQKHTMLPartImpl::openURLRequest(const KURL &url, const URLArgs &args)
return;
}
- [getBridgeForFrameName(args.frameName) loadURL:cocoaURL];
+ [bridgeForFrameName(args.frameName) loadURL:cocoaURL];
}
void KWQKHTMLPartImpl::slotData(NSString *encoding, bool forceEncoding, const char *bytes, int length, bool complete)
@@ -186,11 +186,11 @@ void KWQKHTMLPartImpl::urlSelected(const QString &url, int button, int state, co
// Open new window on command-click
if (state & MetaButton) {
- [bridge openNewWindowWithURL:cocoaURL];
+ [_bridge openNewWindowWithURL:cocoaURL];
return;
}
- WebCoreBridge *targetBridge = getBridgeForFrameName(target);
+ WebCoreBridge *targetBridge = bridgeForFrameName(target);
// FIXME: KHTML does this in openURL -- we should do this at that level so we don't
// have the complexity of dealing with the target here.
@@ -225,7 +225,7 @@ bool KWQKHTMLPartImpl::requestFrame( RenderPart *frame, const QString &url, cons
KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "name %s\n", frameName.ascii());
HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(frame->element());
- WebCoreBridge *childBridge = [bridge createChildFrameNamed:frameName.getNSString() withURL:childURL
+ WebCoreBridge *childBridge = [_bridge createChildFrameNamed:frameName.getNSString() withURL:childURL
renderPart:frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()];
@@ -282,8 +282,7 @@ bool KWQKHTMLPartImpl::requestObject(RenderPart *frame, const QString &url, cons
[argsArray addObject:args[i].getNSString()];
}
- QWidget *widget = new QWidget();
- widget->setView([[WebCoreViewFactory sharedFactory]
+ QWidget *widget = new QWidget([[WebCoreViewFactory sharedFactory]
viewForPluginWithURL:cocoaURL
serviceType:serviceType.getNSString()
arguments:argsArray
@@ -330,7 +329,7 @@ void KWQKHTMLPartImpl::submitForm(const char *action, const QString &url, const
if (strcmp(action, "get") == 0) {
u.setQuery(QString(formData.data(), formData.size()));
- [getBridgeForFrameName(target) loadURL:u.getNSURL()];
+ [bridgeForFrameName(target) loadURL:u.getNSURL()];
} else {
#ifdef NEED_THIS
// construct some user headers if necessary
@@ -340,7 +339,7 @@ void KWQKHTMLPartImpl::submitForm(const char *action, const QString &url, const
args.setContentType( "Content-Type: " + contentType + "; boundary=" + boundary );
#endif
NSData *postData = [NSData dataWithBytes:formData.data() length:formData.size()];
- [getBridgeForFrameName(target) postWithURL:u.getNSURL() data:postData];
+ [bridgeForFrameName(target) postWithURL:u.getNSURL() data:postData];
}
#ifdef NEED_THIS
@@ -364,18 +363,18 @@ void KWQKHTMLPartImpl::submitForm(const char *action, const QString &url, const
bool KWQKHTMLPartImpl::frameExists(const QString &frameName)
{
- return [bridge frameNamed:frameName.getNSString()] != nil;
+ return [_bridge frameNamed:frameName.getNSString()] != nil;
}
KHTMLPart *KWQKHTMLPartImpl::findFrame(const QString &frameName)
{
- return [[bridge frameNamed:frameName.getNSString()] part];
+ return [[_bridge frameNamed:frameName.getNSString()] part];
}
QPtrList<KParts::ReadOnlyPart> KWQKHTMLPartImpl::frames() const
{
QPtrList<KParts::ReadOnlyPart> parts;
- NSEnumerator *e = [[bridge childFrames] objectEnumerator];
+ NSEnumerator *e = [[_bridge childFrames] objectEnumerator];
WebCoreBridge *childFrame;
while ((childFrame = [e nextObject])) {
KHTMLPart *childPart = [childFrame part];
@@ -391,35 +390,35 @@ void KWQKHTMLPartImpl::setView(KHTMLView *view)
part->setWidget(view);
}
-KHTMLView *KWQKHTMLPartImpl::getView() const
+KHTMLView *KWQKHTMLPartImpl::view() const
{
return d->m_view;
}
void KWQKHTMLPartImpl::setTitle(const DOMString &title)
{
- [bridge setTitle:title.string().getNSString()];
+ [_bridge setTitle:title.string().getNSString()];
}
void KWQKHTMLPartImpl::setStatusBarText(const QString &status)
{
- [bridge setStatusText:status.getNSString()];
+ [_bridge setStatusText:status.getNSString()];
}
void KWQKHTMLPartImpl::scheduleClose()
{
- [[bridge window] performSelector:@selector(close) withObject:nil afterDelay:0.0];
+ [[_bridge window] performSelector:@selector(close) withObject:nil afterDelay:0.0];
}
void KWQKHTMLPartImpl::unfocusWindow()
{
- [bridge unfocusWindow];
+ [_bridge unfocusWindow];
}
void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int modifierState)
{
if (url.isEmpty()) {
- [bridge setStatusText:@""];
+ [_bridge setStatusText:@""];
return;
}
@@ -427,7 +426,7 @@ void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int m
if (position == 0) {
// FIXME: Is it worthwhile to special-case scripts that do a window.open and nothing else?
const QString scriptName = url.mid(strlen("javascript:"));
- [bridge setStatusText:[NSString stringWithFormat:@"Run script \"%@\"", scriptName.getNSString()]];
+ [_bridge setStatusText:[NSString stringWithFormat:@"Run script \"%@\"", scriptName.getNSString()]];
return;
}
@@ -436,7 +435,7 @@ void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int m
if (u.protocol() == QString("mailto")) {
// FIXME: Add address book integration so we show the real name instead?
const QString address = KURL::decode_string(u.path());
- [bridge setStatusText:[NSString stringWithFormat:@"Send email to %@", address.getNSString()]];
+ [_bridge setStatusText:[NSString stringWithFormat:@"Send email to %@", address.getNSString()]];
return;
}
@@ -460,7 +459,7 @@ void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int m
format = @"Go to \"%@\"";
}
- if ([bridge modifierTrackingEnabled]) {
+ if ([_bridge modifierTrackingEnabled]) {
if (modifierState & MetaButton) {
if (modifierState & ShiftButton) {
format = @"Open \"%@\" in a new window, behind the current window";
@@ -472,7 +471,7 @@ void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int m
}
}
- [bridge setStatusText:[NSString stringWithFormat:format, u.url().getNSString()]];
+ [_bridge setStatusText:[NSString stringWithFormat:format, u.url().getNSString()]];
}
void KWQKHTMLPartImpl::jumpToSelection()
@@ -494,11 +493,11 @@ void KWQKHTMLPartImpl::jumpToSelection()
void KWQKHTMLPartImpl::redirectionTimerStartedOrStopped()
{
if (d->m_redirectionTimer.isActive()) {
- [bridge reportClientRedirectTo:[NSURL _web_URLWithString:d->m_redirectURL.getNSString()]
+ [_bridge reportClientRedirectTo:[NSURL _web_URLWithString:d->m_redirectURL.getNSString()]
delay:d->m_delayRedirect
fireDate:[d->m_redirectionTimer.getNSTimer() fireDate]];
} else {
- [bridge reportClientRedirectCancelled];
+ [_bridge reportClientRedirectCancelled];
}
}
@@ -521,17 +520,17 @@ void KWQKHTMLPartImpl::layout()
{
// Since not all widgets will get a print call, it's important to move them away
// so that they won't linger in an old position left over from a previous print.
- if (getRenderer()) {
- moveWidgetsAside(getRenderer());
+ if (renderer()) {
+ moveWidgetsAside(renderer());
}
}
-DocumentImpl *KWQKHTMLPartImpl::getDocument()
+DocumentImpl *KWQKHTMLPartImpl::document()
{
return part->xmlDocImpl();
}
-RenderObject *KWQKHTMLPartImpl::getRenderer()
+RenderObject *KWQKHTMLPartImpl::renderer()
{
DocumentImpl *doc = part->xmlDocImpl();
return doc ? doc->renderer() : 0;
@@ -539,5 +538,91 @@ RenderObject *KWQKHTMLPartImpl::getRenderer()
QString KWQKHTMLPartImpl::userAgent() const
{
- return QString::fromNSString([bridge userAgentForURL:part->m_url.getNSURL()]);
+ return QString::fromNSString([_bridge userAgentForURL:part->m_url.getNSURL()]);
+}
+
+NSView *KWQKHTMLPartImpl::nextKeyViewInFrame(NodeImpl *node, KWQSelectionDirection direction)
+{
+ DocumentImpl *doc = document();
+ for (;;) {
+ node = direction == KWQSelectingNext ? doc->nextFocusNode(node) : doc->previousFocusNode(node);
+ if (!node) {
+ return nil;
+ }
+ RenderWidget *renderWidget = dynamic_cast<RenderWidget *>(node->renderer());
+ QWidget *widget = renderWidget->widget();
+ KHTMLView *childFrameWidget = dynamic_cast<KHTMLView *>(widget);
+ NSView *view;
+ if (childFrameWidget) {
+ NodeImpl *nullNode = 0;
+ view = childFrameWidget->part()->impl->nextKeyViewInFrame(nullNode, direction);
+ } else {
+ view = widget->getView();
+#if 0
+ NSView *fieldEditor = [[view window] fieldEditor:NO forObject:view];
+ if (fieldEditor) {
+ view = fieldEditor;
+ }
+#endif
+ }
+ if (view) {
+ return view;
+ }
+ }
+}
+
+NSView *KWQKHTMLPartImpl::nextKeyView(NodeImpl *node, KWQSelectionDirection direction)
+{
+ NSView *next = nextKeyViewInFrame(node, direction);
+ if (next) {
+ return next;
+ }
+
+ KHTMLPart *parentPart = part->parentPart();
+ if (parentPart) {
+ next = parentPart->impl->nextKeyView(parentPart->frame(part)->m_frame->element(), direction);
+ if (next) {
+ return next;
+ }
+ }
+
+ return nil;
+}
+
+NSView *KWQKHTMLPartImpl::nextKeyView(QWidget *startingWidget, KWQSelectionDirection direction)
+{
+ // The only time the starting widget should be 0 is when we are deallocating a view.
+ // In that case, we return nil to prevent AppKit from going astray trying to remove us from a key view loop.
+ if (!startingWidget) {
+ return nil;
+ }
+
+ // Use the event filter object to figure out which RenderWidget owns this QWidget and get to the DOM.
+ // Then get the next key view in the order determined by the DOM.
+ NodeImpl *node = static_cast<const RenderWidget *>(startingWidget->eventFilterObject())->element();
+ KHTMLPart *part = node->getDocument()->view()->part();
+ NSView *next = part->impl->nextKeyView(node, direction);
+ if (next) {
+ return next;
+ }
+
+ // If we are the last key view, then go up to the top level part.
+ KHTMLPart *parentPart;
+ while ((parentPart = part->parentPart())) {
+ part = parentPart;
+ }
+
+#if 0
+ // Look at views from the top level part up, looking for a next key view that we can use.
+ for (NSView *view = part->widget()->getView(); view; view = [view superview]) {
+ next = direction == KWQSelectingNext ? [view nextKeyView] : [view previousKeyView];
+ if (next) {
+ return next;
+ }
+ }
+#endif
+
+ // If all else fails, make a loop by starting from 0.
+ NodeImpl *nullNode = 0;
+ return part->impl->nextKeyView(nullNode, direction);
}
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
index 11d13fd..6b09089 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.mm
@@ -57,7 +57,7 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
const KParts::WindowArgs &winArgs,
KParts::ReadOnlyPart **partResult)
{
- WebCoreBridge *bridge = [m_part->impl->getBridge() openNewWindowWithURL:url.getNSURL()];
+ WebCoreBridge *bridge = [m_part->impl->bridge() openNewWindowWithURL:url.getNSURL()];
if (!winArgs.toolBarsVisible) {
[bridge setToolbarsVisible:NO];
@@ -110,10 +110,10 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
void KHTMLPartBrowserExtension::setIconURL(const KURL &url)
{
- [m_part->impl->getBridge() setIconURL:url.getNSURL()];
+ [m_part->impl->bridge() setIconURL:url.getNSURL()];
}
void KHTMLPartBrowserExtension::setTypedIconURL(const KURL &url, const QString &type)
{
- [m_part->impl->getBridge() setIconURL:url.getNSURL() withType:type.getNSString()];
+ [m_part->impl->bridge() setIconURL:url.getNSURL() withType:type.getNSString()];
}
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 40ab633..f1a549e 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -41,6 +41,7 @@ namespace KParts {
namespace DOM {
class DOMString;
class DocumentImpl;
+ class NodeImpl;
}
namespace khtml {
@@ -49,23 +50,28 @@ namespace khtml {
}
#ifdef __OBJC__
+ at class NSView;
@class WebCoreBridge;
- at class NSMutableSet;
#else
+class NSView;
class WebCoreBridge;
-class NSMutableSet;
#endif
+enum KWQSelectionDirection {
+ KWQSelectingNext,
+ KWQSelectingPrevious
+};
+
class KWQKHTMLPartImpl : public QObject
{
public:
KWQKHTMLPartImpl(KHTMLPart *);
~KWQKHTMLPartImpl();
- void setBridge(WebCoreBridge *p) { bridge = p; }
- WebCoreBridge *getBridge() const { return bridge; }
+ void setBridge(WebCoreBridge *p) { _bridge = p; }
+ WebCoreBridge *bridge() const { return _bridge; }
void setView(KHTMLView *view);
- KHTMLView *getView() const;
+ KHTMLView *view() const;
void openURLRequest(const KURL &, const KParts::URLArgs &);
@@ -98,22 +104,27 @@ public:
QString userAgent() const;
+ static NSView *nextKeyView(QWidget *startingPoint, KWQSelectionDirection);
+
// Incoming calls, used by the bridge.
- DOM::DocumentImpl *getDocument();
- khtml::RenderObject *getRenderer();
+ DOM::DocumentImpl *document();
+ khtml::RenderObject *renderer();
// Used internally, but need to be public because they are used by non-member functions.
void redirectionTimerStartedOrStopped();
private:
- WebCoreBridge *getBridgeForFrameName(const QString &frameName);
+ WebCoreBridge *bridgeForFrameName(const QString &frameName);
+
+ NSView *nextKeyView(DOM::NodeImpl *, KWQSelectionDirection);
+ NSView *nextKeyViewInFrame(DOM::NodeImpl *, KWQSelectionDirection);
KHTMLPart *part;
KHTMLPartPrivate *d;
- WebCoreBridge *bridge;
+ WebCoreBridge *_bridge;
friend class KHTMLPart;
};
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index ceb5631..9eb2d94 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -94,8 +94,8 @@ void KHTMLPart::completed(bool arg)
parentPart()->slotChildCompleted(arg);
}
- QValueList<ChildFrame>::ConstIterator it = d->m_frames.begin();
- QValueList<ChildFrame>::ConstIterator end = d->m_frames.end();
+ ConstFrameIt it = d->m_frames.begin();
+ ConstFrameIt end = d->m_frames.end();
for (; it != end; ++it ) {
KHTMLPart *part = dynamic_cast<KHTMLPart *>((*it).m_part.pointer());
if (part) {
@@ -114,21 +114,21 @@ KWQKHTMLPartImpl::~KWQKHTMLPartImpl()
{
}
-WebCoreBridge *KWQKHTMLPartImpl::getBridgeForFrameName(const QString &frameName)
+WebCoreBridge *KWQKHTMLPartImpl::bridgeForFrameName(const QString &frameName)
{
WebCoreBridge *frame;
if (frameName.isEmpty()) {
// If we're the only frame in a frameset then pop the frame.
KHTMLPart *parentPart = part->parentPart();
- frame = parentPart ? parentPart->impl->bridge : nil;
+ frame = parentPart ? parentPart->impl->_bridge : nil;
if ([[frame childFrames] count] != 1) {
- frame = bridge;
+ frame = _bridge;
}
} else {
- frame = [bridge descendantFrameNamed:frameName.getNSString()];
+ frame = [_bridge descendantFrameNamed:frameName.getNSString()];
if (frame == nil) {
NSLog (@"WARNING: unable to find frame named %@, creating new window with \"_blank\" name. New window will not be named until 2959902 is fixed.\n", frameName.getNSString());
- frame = [bridge descendantFrameNamed:@"_blank"];
+ frame = [_bridge descendantFrameNamed:@"_blank"];
}
}
@@ -143,7 +143,7 @@ void KWQKHTMLPartImpl::openURLRequest(const KURL &url, const URLArgs &args)
return;
}
- [getBridgeForFrameName(args.frameName) loadURL:cocoaURL];
+ [bridgeForFrameName(args.frameName) loadURL:cocoaURL];
}
void KWQKHTMLPartImpl::slotData(NSString *encoding, bool forceEncoding, const char *bytes, int length, bool complete)
@@ -186,11 +186,11 @@ void KWQKHTMLPartImpl::urlSelected(const QString &url, int button, int state, co
// Open new window on command-click
if (state & MetaButton) {
- [bridge openNewWindowWithURL:cocoaURL];
+ [_bridge openNewWindowWithURL:cocoaURL];
return;
}
- WebCoreBridge *targetBridge = getBridgeForFrameName(target);
+ WebCoreBridge *targetBridge = bridgeForFrameName(target);
// FIXME: KHTML does this in openURL -- we should do this at that level so we don't
// have the complexity of dealing with the target here.
@@ -225,7 +225,7 @@ bool KWQKHTMLPartImpl::requestFrame( RenderPart *frame, const QString &url, cons
KWQDEBUGLEVEL(KWQ_LOG_FRAMES, "name %s\n", frameName.ascii());
HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(frame->element());
- WebCoreBridge *childBridge = [bridge createChildFrameNamed:frameName.getNSString() withURL:childURL
+ WebCoreBridge *childBridge = [_bridge createChildFrameNamed:frameName.getNSString() withURL:childURL
renderPart:frame allowsScrolling:o->scrollingMode() != QScrollView::AlwaysOff
marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()];
@@ -282,8 +282,7 @@ bool KWQKHTMLPartImpl::requestObject(RenderPart *frame, const QString &url, cons
[argsArray addObject:args[i].getNSString()];
}
- QWidget *widget = new QWidget();
- widget->setView([[WebCoreViewFactory sharedFactory]
+ QWidget *widget = new QWidget([[WebCoreViewFactory sharedFactory]
viewForPluginWithURL:cocoaURL
serviceType:serviceType.getNSString()
arguments:argsArray
@@ -330,7 +329,7 @@ void KWQKHTMLPartImpl::submitForm(const char *action, const QString &url, const
if (strcmp(action, "get") == 0) {
u.setQuery(QString(formData.data(), formData.size()));
- [getBridgeForFrameName(target) loadURL:u.getNSURL()];
+ [bridgeForFrameName(target) loadURL:u.getNSURL()];
} else {
#ifdef NEED_THIS
// construct some user headers if necessary
@@ -340,7 +339,7 @@ void KWQKHTMLPartImpl::submitForm(const char *action, const QString &url, const
args.setContentType( "Content-Type: " + contentType + "; boundary=" + boundary );
#endif
NSData *postData = [NSData dataWithBytes:formData.data() length:formData.size()];
- [getBridgeForFrameName(target) postWithURL:u.getNSURL() data:postData];
+ [bridgeForFrameName(target) postWithURL:u.getNSURL() data:postData];
}
#ifdef NEED_THIS
@@ -364,18 +363,18 @@ void KWQKHTMLPartImpl::submitForm(const char *action, const QString &url, const
bool KWQKHTMLPartImpl::frameExists(const QString &frameName)
{
- return [bridge frameNamed:frameName.getNSString()] != nil;
+ return [_bridge frameNamed:frameName.getNSString()] != nil;
}
KHTMLPart *KWQKHTMLPartImpl::findFrame(const QString &frameName)
{
- return [[bridge frameNamed:frameName.getNSString()] part];
+ return [[_bridge frameNamed:frameName.getNSString()] part];
}
QPtrList<KParts::ReadOnlyPart> KWQKHTMLPartImpl::frames() const
{
QPtrList<KParts::ReadOnlyPart> parts;
- NSEnumerator *e = [[bridge childFrames] objectEnumerator];
+ NSEnumerator *e = [[_bridge childFrames] objectEnumerator];
WebCoreBridge *childFrame;
while ((childFrame = [e nextObject])) {
KHTMLPart *childPart = [childFrame part];
@@ -391,35 +390,35 @@ void KWQKHTMLPartImpl::setView(KHTMLView *view)
part->setWidget(view);
}
-KHTMLView *KWQKHTMLPartImpl::getView() const
+KHTMLView *KWQKHTMLPartImpl::view() const
{
return d->m_view;
}
void KWQKHTMLPartImpl::setTitle(const DOMString &title)
{
- [bridge setTitle:title.string().getNSString()];
+ [_bridge setTitle:title.string().getNSString()];
}
void KWQKHTMLPartImpl::setStatusBarText(const QString &status)
{
- [bridge setStatusText:status.getNSString()];
+ [_bridge setStatusText:status.getNSString()];
}
void KWQKHTMLPartImpl::scheduleClose()
{
- [[bridge window] performSelector:@selector(close) withObject:nil afterDelay:0.0];
+ [[_bridge window] performSelector:@selector(close) withObject:nil afterDelay:0.0];
}
void KWQKHTMLPartImpl::unfocusWindow()
{
- [bridge unfocusWindow];
+ [_bridge unfocusWindow];
}
void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int modifierState)
{
if (url.isEmpty()) {
- [bridge setStatusText:@""];
+ [_bridge setStatusText:@""];
return;
}
@@ -427,7 +426,7 @@ void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int m
if (position == 0) {
// FIXME: Is it worthwhile to special-case scripts that do a window.open and nothing else?
const QString scriptName = url.mid(strlen("javascript:"));
- [bridge setStatusText:[NSString stringWithFormat:@"Run script \"%@\"", scriptName.getNSString()]];
+ [_bridge setStatusText:[NSString stringWithFormat:@"Run script \"%@\"", scriptName.getNSString()]];
return;
}
@@ -436,7 +435,7 @@ void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int m
if (u.protocol() == QString("mailto")) {
// FIXME: Add address book integration so we show the real name instead?
const QString address = KURL::decode_string(u.path());
- [bridge setStatusText:[NSString stringWithFormat:@"Send email to %@", address.getNSString()]];
+ [_bridge setStatusText:[NSString stringWithFormat:@"Send email to %@", address.getNSString()]];
return;
}
@@ -460,7 +459,7 @@ void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int m
format = @"Go to \"%@\"";
}
- if ([bridge modifierTrackingEnabled]) {
+ if ([_bridge modifierTrackingEnabled]) {
if (modifierState & MetaButton) {
if (modifierState & ShiftButton) {
format = @"Open \"%@\" in a new window, behind the current window";
@@ -472,7 +471,7 @@ void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int m
}
}
- [bridge setStatusText:[NSString stringWithFormat:format, u.url().getNSString()]];
+ [_bridge setStatusText:[NSString stringWithFormat:format, u.url().getNSString()]];
}
void KWQKHTMLPartImpl::jumpToSelection()
@@ -494,11 +493,11 @@ void KWQKHTMLPartImpl::jumpToSelection()
void KWQKHTMLPartImpl::redirectionTimerStartedOrStopped()
{
if (d->m_redirectionTimer.isActive()) {
- [bridge reportClientRedirectTo:[NSURL _web_URLWithString:d->m_redirectURL.getNSString()]
+ [_bridge reportClientRedirectTo:[NSURL _web_URLWithString:d->m_redirectURL.getNSString()]
delay:d->m_delayRedirect
fireDate:[d->m_redirectionTimer.getNSTimer() fireDate]];
} else {
- [bridge reportClientRedirectCancelled];
+ [_bridge reportClientRedirectCancelled];
}
}
@@ -521,17 +520,17 @@ void KWQKHTMLPartImpl::layout()
{
// Since not all widgets will get a print call, it's important to move them away
// so that they won't linger in an old position left over from a previous print.
- if (getRenderer()) {
- moveWidgetsAside(getRenderer());
+ if (renderer()) {
+ moveWidgetsAside(renderer());
}
}
-DocumentImpl *KWQKHTMLPartImpl::getDocument()
+DocumentImpl *KWQKHTMLPartImpl::document()
{
return part->xmlDocImpl();
}
-RenderObject *KWQKHTMLPartImpl::getRenderer()
+RenderObject *KWQKHTMLPartImpl::renderer()
{
DocumentImpl *doc = part->xmlDocImpl();
return doc ? doc->renderer() : 0;
@@ -539,5 +538,91 @@ RenderObject *KWQKHTMLPartImpl::getRenderer()
QString KWQKHTMLPartImpl::userAgent() const
{
- return QString::fromNSString([bridge userAgentForURL:part->m_url.getNSURL()]);
+ return QString::fromNSString([_bridge userAgentForURL:part->m_url.getNSURL()]);
+}
+
+NSView *KWQKHTMLPartImpl::nextKeyViewInFrame(NodeImpl *node, KWQSelectionDirection direction)
+{
+ DocumentImpl *doc = document();
+ for (;;) {
+ node = direction == KWQSelectingNext ? doc->nextFocusNode(node) : doc->previousFocusNode(node);
+ if (!node) {
+ return nil;
+ }
+ RenderWidget *renderWidget = dynamic_cast<RenderWidget *>(node->renderer());
+ QWidget *widget = renderWidget->widget();
+ KHTMLView *childFrameWidget = dynamic_cast<KHTMLView *>(widget);
+ NSView *view;
+ if (childFrameWidget) {
+ NodeImpl *nullNode = 0;
+ view = childFrameWidget->part()->impl->nextKeyViewInFrame(nullNode, direction);
+ } else {
+ view = widget->getView();
+#if 0
+ NSView *fieldEditor = [[view window] fieldEditor:NO forObject:view];
+ if (fieldEditor) {
+ view = fieldEditor;
+ }
+#endif
+ }
+ if (view) {
+ return view;
+ }
+ }
+}
+
+NSView *KWQKHTMLPartImpl::nextKeyView(NodeImpl *node, KWQSelectionDirection direction)
+{
+ NSView *next = nextKeyViewInFrame(node, direction);
+ if (next) {
+ return next;
+ }
+
+ KHTMLPart *parentPart = part->parentPart();
+ if (parentPart) {
+ next = parentPart->impl->nextKeyView(parentPart->frame(part)->m_frame->element(), direction);
+ if (next) {
+ return next;
+ }
+ }
+
+ return nil;
+}
+
+NSView *KWQKHTMLPartImpl::nextKeyView(QWidget *startingWidget, KWQSelectionDirection direction)
+{
+ // The only time the starting widget should be 0 is when we are deallocating a view.
+ // In that case, we return nil to prevent AppKit from going astray trying to remove us from a key view loop.
+ if (!startingWidget) {
+ return nil;
+ }
+
+ // Use the event filter object to figure out which RenderWidget owns this QWidget and get to the DOM.
+ // Then get the next key view in the order determined by the DOM.
+ NodeImpl *node = static_cast<const RenderWidget *>(startingWidget->eventFilterObject())->element();
+ KHTMLPart *part = node->getDocument()->view()->part();
+ NSView *next = part->impl->nextKeyView(node, direction);
+ if (next) {
+ return next;
+ }
+
+ // If we are the last key view, then go up to the top level part.
+ KHTMLPart *parentPart;
+ while ((parentPart = part->parentPart())) {
+ part = parentPart;
+ }
+
+#if 0
+ // Look at views from the top level part up, looking for a next key view that we can use.
+ for (NSView *view = part->widget()->getView(); view; view = [view superview]) {
+ next = direction == KWQSelectingNext ? [view nextKeyView] : [view previousKeyView];
+ if (next) {
+ return next;
+ }
+ }
+#endif
+
+ // If all else fails, make a loop by starting from 0.
+ NodeImpl *nullNode = 0;
+ return part->impl->nextKeyView(nullNode, direction);
}
diff --git a/WebCore/kwq/KWQKLineEdit.h b/WebCore/kwq/KWQKLineEdit.h
index c3d4c9c..a198edf 100644
--- a/WebCore/kwq/KWQKLineEdit.h
+++ b/WebCore/kwq/KWQKLineEdit.h
@@ -27,17 +27,15 @@
#define KLINEEDIT_H_
#include <qlineedit.h>
-
#include <KWQCompletion.h>
-
-#include "kcompletionbox.h"
+#include <kcompletionbox.h>
class KLineEdit : public QLineEdit, public KCompletionBase {
public:
- KLineEdit(QWidget *parent=0);
+ KLineEdit(QWidget *parent) { }
- void setContextMenuEnabled(bool showMenu);
- KCompletionBox *completionBox(bool create);
+ void setContextMenuEnabled(bool showMenu) { }
+ KCompletionBox *completionBox(bool create) { return 0; }
int frameWidth() const { return 2; }
};
diff --git a/WebCore/kwq/KWQKLineEdit.mm b/WebCore/kwq/KWQKLineEdit.mm
deleted file mode 100644
index 332268c..0000000
--- a/WebCore/kwq/KWQKLineEdit.mm
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2001, 2002 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.
- */
-
-#import <klineedit.h>
-
-KLineEdit::KLineEdit(QWidget *parent)
- : QLineEdit(parent)
-{
-}
-
-void KLineEdit::setContextMenuEnabled(bool showMenu)
-{
-}
-
-KCompletionBox *KLineEdit::completionBox(bool create)
-{
- return 0;
-}
diff --git a/WebCore/kwq/KWQLabel.mm b/WebCore/kwq/KWQLabel.mm
index 0e79a37..4299edf 100644
--- a/WebCore/kwq/KWQLabel.mm
+++ b/WebCore/kwq/KWQLabel.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 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
@@ -27,8 +27,7 @@
#import <kwqdebug.h>
-QLabel::QLabel(const QString &, QWidget *parent)
- : QFrame(parent)
+QLabel::QLabel(const QString &, QWidget *)
{
}
diff --git a/WebCore/kwq/KWQLineEdit.h b/WebCore/kwq/KWQLineEdit.h
index aa789f6..bbe84bd 100644
--- a/WebCore/kwq/KWQLineEdit.h
+++ b/WebCore/kwq/KWQLineEdit.h
@@ -35,7 +35,7 @@ class QLineEdit : public QWidget {
public:
enum EchoMode { Normal, Password };
- QLineEdit(QWidget *parent);
+ QLineEdit();
virtual void setEchoMode(EchoMode);
virtual void setCursorPosition(int);
diff --git a/WebCore/kwq/KWQLineEdit.mm b/WebCore/kwq/KWQLineEdit.mm
index 968db77..cf02632 100644
--- a/WebCore/kwq/KWQLineEdit.mm
+++ b/WebCore/kwq/KWQLineEdit.mm
@@ -29,11 +29,11 @@
#import <kwqdebug.h>
#import <WebCoreTextRendererFactory.h>
-QLineEdit::QLineEdit(QWidget *parent)
+QLineEdit::QLineEdit()
: m_returnPressed(this, SIGNAL(returnPressed()))
, m_textChanged(this, SIGNAL(textChanged(const QString &)))
{
- NSView *view = [[KWQNSTextField alloc] initWithWidget:this];
+ NSView *view = [[KWQNSTextField alloc] initWithQLineEdit:this];
setView(view);
[view release];
}
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index d3a1175..2dc62ac 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -98,7 +98,7 @@ bool KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
request->m_docLoader->part()->baseURL().url().latin1(),
request->object->url().string().latin1());
- WebCoreBridge *bridge = ((KHTMLPart *)request->m_docLoader->part())->impl->getBridge();
+ WebCoreBridge *bridge = ((KHTMLPart *)request->m_docLoader->part())->impl->bridge();
NSURL *URL = job->url().getNSURL();
if (URL == nil) {
@@ -125,7 +125,7 @@ bool KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
bool KWQCheckIfReloading(DocLoader *loader)
{
- return [((KHTMLPart *)loader->part())->impl->getBridge() isReloading];
+ return [((KHTMLPart *)loader->part())->impl->bridge() isReloading];
}
void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
@@ -146,7 +146,7 @@ void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
}
// Notify the caller that we "loaded".
- WebCoreBridge *bridge = ((KHTMLPart *)loader->part())->impl->getBridge();
+ WebCoreBridge *bridge = ((KHTMLPart *)loader->part())->impl->bridge();
NSURL *URL = [[NSURL alloc] initWithString:cachedObject->url().string().getNSString()];
KWQ_ASSERT(URL);
CachedImage *cachedImage = dynamic_cast<CachedImage *>(cachedObject);
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index d3a1175..2dc62ac 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -98,7 +98,7 @@ bool KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
request->m_docLoader->part()->baseURL().url().latin1(),
request->object->url().string().latin1());
- WebCoreBridge *bridge = ((KHTMLPart *)request->m_docLoader->part())->impl->getBridge();
+ WebCoreBridge *bridge = ((KHTMLPart *)request->m_docLoader->part())->impl->bridge();
NSURL *URL = job->url().getNSURL();
if (URL == nil) {
@@ -125,7 +125,7 @@ bool KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
bool KWQCheckIfReloading(DocLoader *loader)
{
- return [((KHTMLPart *)loader->part())->impl->getBridge() isReloading];
+ return [((KHTMLPart *)loader->part())->impl->bridge() isReloading];
}
void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
@@ -146,7 +146,7 @@ void KWQCheckCacheObjectStatus(DocLoader *loader, CachedObject *cachedObject)
}
// Notify the caller that we "loaded".
- WebCoreBridge *bridge = ((KHTMLPart *)loader->part())->impl->getBridge();
+ WebCoreBridge *bridge = ((KHTMLPart *)loader->part())->impl->bridge();
NSURL *URL = [[NSURL alloc] initWithString:cachedObject->url().string().getNSString()];
KWQ_ASSERT(URL);
CachedImage *cachedImage = dynamic_cast<CachedImage *>(cachedObject);
diff --git a/WebCore/kwq/KWQNSTextField.h b/WebCore/kwq/KWQNSTextField.h
index ee906c7..7ed5cfd 100644
--- a/WebCore/kwq/KWQNSTextField.h
+++ b/WebCore/kwq/KWQNSTextField.h
@@ -25,8 +25,7 @@
#import <Cocoa/Cocoa.h>
-class QWidget;
-
+class QLineEdit;
@class KWQTextFieldFormatter;
#define FOCUS_BORDER_SIZE 3
@@ -34,13 +33,13 @@ class QWidget;
@interface KWQNSTextField : NSTextField
{
@private
+ QLineEdit *widget;
NSTextField *secureField;
- QWidget *widget;
KWQTextFieldFormatter *formatter;
BOOL edited;
}
-- initWithWidget:(QWidget *)widget;
+- initWithQLineEdit:(QLineEdit *)widget;
- (void)setPasswordMode:(BOOL)flag;
- (BOOL)passwordMode;
diff --git a/WebCore/kwq/KWQNSTextField.mm b/WebCore/kwq/KWQNSTextField.mm
index c04ab8b..19818cf 100644
--- a/WebCore/kwq/KWQNSTextField.mm
+++ b/WebCore/kwq/KWQNSTextField.mm
@@ -26,6 +26,7 @@
#import <KWQNSTextField.h>
#import <qlineedit.h>
+#import <KWQKHTMLPartImpl.h>
// KWQTextFieldCell is larger than a normal text field cell, so it includes
// the focus border as well as the rest of the text field.
@@ -47,12 +48,18 @@
@end
-// KWQSecureTextField is a workaround for bug 3024443.
+// KWQSecureTextField has two purposes.
+// One is a workaround for bug 3024443.
+// The other is hook up next and previous key views to KHTML.
@interface KWQSecureTextField : NSSecureTextField
{
+ QWidget *widget;
BOOL inSetFrameSize;
}
+
+- initWithQWidget:(QWidget *)widget;
+
@end
@implementation KWQNSTextField
@@ -81,31 +88,27 @@
return self;
}
-- initWithWidget:(QWidget *)w
+- initWithQLineEdit:(QLineEdit *)w
{
- [super init];
widget = w;
- return self;
+ return [super init];
}
- (void)action:sender
{
- QLineEdit *edit = dynamic_cast<QLineEdit *>(widget);
- if (edit) {
- edit->returnPressed();
- }
+ widget->returnPressed();
}
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
{
- QLineEdit *edit = dynamic_cast<QLineEdit *>(widget);
- if (edit) {
- edit->textChanged();
- }
+ widget->textChanged();
}
- (void)dealloc
{
+ // Set widget to 0 so that nextKeyView and previousKeyView will return nil.
+ widget = 0;
+
[secureField release];
[formatter release];
[super dealloc];
@@ -138,7 +141,7 @@
[secureField removeFromSuperview];
} else {
if (secureField == nil) {
- secureField = [[KWQSecureTextField alloc] init];
+ secureField = [[KWQSecureTextField alloc] initWithQWidget:widget];
[secureField setDelegate:self];
[secureField setFormatter:formatter];
[secureField setFont:[self font]];
@@ -223,13 +226,29 @@
[super setFont:font];
}
+- (NSView *)nextKeyView
+{
+ return KWQKHTMLPartImpl::nextKeyView(widget, KWQSelectingNext);
+}
+
+- (NSView *)previousKeyView
+{
+ return KWQKHTMLPartImpl::nextKeyView(widget, KWQSelectingPrevious);
+}
+
@end
// This cell is used so that our frame includes the place where the focus rectangle is drawn.
-// If that makes the widget too big for layout, we'll account for that at the QWidget level.
+// We account for this at the QWidget level so the placement of the text field is still correct,
+// just as we account for the margins in NSButton and other AppKit controls.
@implementation KWQTextFieldCell
+- (BOOL)isOpaque
+{
+ return NO;
+}
+
- (NSSize)cellSizeForBounds:(NSRect)bounds
{
NSSize size = [super cellSizeForBounds:bounds];
@@ -304,6 +323,34 @@
@implementation KWQSecureTextField
+- initWithQWidget:(QWidget *)w
+{
+ widget = w;
+ return [super init];
+}
+
+- (void)dealloc
+{
+ // Set widget to 0 so that nextKeyView and previousKeyView will return nil.
+ widget = 0;
+
+ [super dealloc];
+}
+
+- (NSView *)nextKeyView
+{
+ return KWQKHTMLPartImpl::nextKeyView(widget, KWQSelectingNext);
+}
+
+- (NSView *)previousKeyView
+{
+ return KWQKHTMLPartImpl::nextKeyView(widget, KWQSelectingPrevious);
+}
+
+// These next two methods are the workaround for bug 3024443.
+// Basically, setFrameSize ends up calling an inappropriate selectText, so we just ignore
+// calls to selectText while setFrameSize is running.
+
- (void)selectText:(id)sender
{
if (sender == self && inSetFrameSize) {
diff --git a/WebCore/kwq/KWQObject.h b/WebCore/kwq/KWQObject.h
index 93483d1..9f0b233 100644
--- a/WebCore/kwq/KWQObject.h
+++ b/WebCore/kwq/KWQObject.h
@@ -83,9 +83,9 @@ public:
void killTimers();
virtual void timerEvent(QTimerEvent *);
- void installEventFilter(const QObject *);
- void removeEventFilter(const QObject *);
- bool eventFilter(QObject *o, QEvent *e);
+ void installEventFilter(const QObject *o) { m_eventFilterObject = o; }
+ void removeEventFilter(const QObject *) { m_eventFilterObject = 0; }
+ const QObject *eventFilterObject() const { return m_eventFilterObject; }
void blockSignals(bool b) { m_signalsBlocked = b; }
@@ -104,6 +104,8 @@ private:
mutable KWQSignal *m_signalListHead;
bool m_signalsBlocked;
+ const QObject *m_eventFilterObject;
+
static const QObject *m_sender;
friend class KWQGuardedPtrBase;
diff --git a/WebCore/kwq/KWQObject.mm b/WebCore/kwq/KWQObject.mm
index 6844548..8a907c5 100644
--- a/WebCore/kwq/KWQObject.mm
+++ b/WebCore/kwq/KWQObject.mm
@@ -173,22 +173,6 @@ void QObject::killTimers()
}
}
-void QObject::installEventFilter(const QObject *)
-{
- _logNeverImplemented();
-}
-
-void QObject::removeEventFilter(const QObject *)
-{
- _logNeverImplemented();
-}
-
-bool QObject::eventFilter(QObject *o, QEvent *e)
-{
- _logNeverImplemented();
- return false;
-}
-
bool QObject::event(QEvent *)
{
return false;
diff --git a/WebCore/kwq/KWQPushButton.h b/WebCore/kwq/KWQPushButton.h
index 292cfe7..29044d1 100644
--- a/WebCore/kwq/KWQPushButton.h
+++ b/WebCore/kwq/KWQPushButton.h
@@ -30,7 +30,7 @@
class QPushButton : public QButton {
public:
- QPushButton(QWidget *w) : QButton(w) { }
+ QPushButton(QWidget *parent) { }
QPushButton(const QString &text, QWidget *parent);
};
diff --git a/WebCore/kwq/KWQPushButton.mm b/WebCore/kwq/KWQPushButton.mm
index f9f7cf4..d540748 100644
--- a/WebCore/kwq/KWQPushButton.mm
+++ b/WebCore/kwq/KWQPushButton.mm
@@ -25,7 +25,7 @@
#import <qpushbutton.h>
-QPushButton::QPushButton(const QString &text, QWidget *parent) : QButton(parent)
+QPushButton::QPushButton(const QString &text, QWidget *parent)
{
setText(text);
}
diff --git a/WebCore/kwq/KWQRadioButton.mm b/WebCore/kwq/KWQRadioButton.mm
index 421e54e..a0b4496 100644
--- a/WebCore/kwq/KWQRadioButton.mm
+++ b/WebCore/kwq/KWQRadioButton.mm
@@ -34,10 +34,10 @@
#define LEFT_MARGIN 3
#define RIGHT_MARGIN 3
-QRadioButton::QRadioButton(QWidget *w) : QButton(w)
+QRadioButton::QRadioButton(QWidget *w)
{
- KWQNSButton *button = (KWQNSButton *)getView();
- [button setButtonType: NSRadioButton];
+ NSButton *button = (NSButton *)getView();
+ [button setButtonType:NSRadioButton];
}
QSize QRadioButton::sizeHint() const
@@ -62,12 +62,12 @@ void QRadioButton::setFrameGeometry(const QRect &r)
void QRadioButton::setChecked(bool isChecked)
{
- KWQNSButton *button = (KWQNSButton *)getView();
- [button setState: isChecked ? NSOnState : NSOffState];
+ NSButton *button = (NSButton *)getView();
+ [button setState:isChecked ? NSOnState : NSOffState];
}
bool QRadioButton::isChecked() const
{
- KWQNSButton *button = (KWQNSButton *)getView();
+ NSButton *button = (NSButton *)getView();
return [button state] == NSOnState;
}
diff --git a/WebCore/kwq/KWQScrollBar.h b/WebCore/kwq/KWQScrollBar.h
deleted file mode 100644
index 534f9c0..0000000
--- a/WebCore/kwq/KWQScrollBar.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2001, 2002 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 KWQSCROLLBAR_H_
-#define KWQSCROLLBAR_H_
-
-#include <qwidget.h>
-#include <qpalette.h>
-
-class QScrollBar : public QWidget {
-public:
- QScrollBar(QWidget *);
-
- virtual void setPalette(const QPalette &);
-};
-
-#endif
diff --git a/WebCore/kwq/KWQScrollView.h b/WebCore/kwq/KWQScrollView.h
index 5be9a18..ba20272 100644
--- a/WebCore/kwq/KWQScrollView.h
+++ b/WebCore/kwq/KWQScrollView.h
@@ -38,7 +38,7 @@ class QScrollView : public QFrame {
public:
enum ScrollBarMode { AlwaysOff, AlwaysOn, Auto };
- QScrollView(QWidget *parent = 0, const char *name = 0, int flags = 0);
+ QScrollView(QWidget *parent = 0, const char *name = 0, int flags = 0) { }
QWidget *viewport() const;
int visibleWidth() const;
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index 8c1fdae..1bbbe04 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -67,11 +67,6 @@
@end
-QScrollView::QScrollView(QWidget *parent, const char *name, int f)
- : QFrame(parent)
-{
-}
-
QWidget* QScrollView::viewport() const
{
return const_cast<QScrollView *>(this);
diff --git a/WebCore/kwq/KWQTextArea.h b/WebCore/kwq/KWQTextArea.h
index 2885fe5..062da15 100644
--- a/WebCore/kwq/KWQTextArea.h
+++ b/WebCore/kwq/KWQTextArea.h
@@ -25,15 +25,16 @@
#import <Cocoa/Cocoa.h>
-class QWidget;
+class QTextEdit;
@interface KWQTextArea : NSScrollView
{
NSTextView *textView;
- QWidget *widget;
+ QTextEdit *widget;
BOOL wrap;
}
-- initWithWidget:(QWidget *)w;
+
+- initWithQTextEdit:(QTextEdit *)w;
// The following methods corresponds to methods required by KDE.
- (void)setWordWrap:(BOOL)wrap;
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index 41124ea..5e95b2f 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -94,12 +94,10 @@ const float LargeNumberForText = 1.0e7;
[self _createTextView];
- widget = 0;
-
return self;
}
-- initWithWidget:(QWidget *)w
+- initWithQTextEdit:(QTextEdit *)w
{
[super init];
widget = w;
@@ -108,31 +106,25 @@ const float LargeNumberForText = 1.0e7;
- (void)textDidEndEditing:(NSNotification *)aNotification
{
- if (widget) {
- QTextEdit *textEdit = dynamic_cast<QTextEdit *>(widget);
- if (textEdit) {
- textEdit->textChanged();
- }
- }
+ widget->textChanged();
}
-
- (void)setWordWrap:(BOOL)f
{
- if (f == wrap)
+ if (f == wrap) {
return;
+ }
// This widget may have issues toggling back and forth between WRAP=YES and WRAP=NO.
NSDictionary *attr;
NSMutableParagraphStyle *style = [[[NSMutableParagraphStyle alloc] init] autorelease];
- if (f){
+ if (f) {
[self setHasHorizontalScroller:NO];
[textView setHorizontallyResizable:NO];
[[textView textContainer] setWidthTracksTextView:NO];
[style setLineBreakMode:NSLineBreakByWordWrapping];
- }
- else {
+ } else {
[self setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
[[self contentView] setAutoresizesSubviews:YES];
[self setHasHorizontalScroller:YES];
@@ -177,25 +169,20 @@ const float LargeNumberForText = 1.0e7;
{
NSRange glyphRange = NSMakeRange(0,0), characterRange;
int lineCount = 0;
- NSString *stringLine;
NSLayoutManager *layoutManager = [textView layoutManager];
unsigned numberOfGlyphs = [layoutManager numberOfGlyphs];
while (NSMaxRange(glyphRange) < numberOfGlyphs) {
(void)[layoutManager lineFragmentRectForGlyphAtIndex:NSMaxRange(glyphRange) effectiveRange:&glyphRange];
characterRange = [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL];
- if (line == lineCount){
- // I hope this works, the alternative is
- // [[view string] substringWithRange:characterRange]
- stringLine = [[[textView textStorage] attributedSubstringFromRange:characterRange] string];
- return stringLine;
+ if (line == lineCount) {
+ return [[[textView textStorage] attributedSubstringFromRange:characterRange] string];
}
lineCount++;
}
return @"";
}
-
- (int) numLines
{
NSRange glyphRange = NSMakeRange(0,0);
@@ -210,16 +197,14 @@ const float LargeNumberForText = 1.0e7;
return lineCount;
}
-
- (void)selectAll
{
- [textView setSelectedRange:NSMakeRange(0, [[textView textStorage] length])];
+ [textView selectAll:nil];
}
-
- (void)setEditable:(BOOL)flag
{
- [textView setEditable: flag];
+ [textView setEditable:flag];
}
- (BOOL)isEditable
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index c923e57..3dc4299 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -30,7 +30,7 @@
QTextEdit::QTextEdit(QWidget *parent)
: m_textChanged(this, SIGNAL(textChanged()))
{
- KWQTextArea *textView = [[KWQTextArea alloc] initWithWidget:this];
+ KWQTextArea *textView = [[KWQTextArea alloc] initWithQTextEdit:this];
setView(textView);
[textView release];
}
diff --git a/WebCore/kwq/KWQTextField.h b/WebCore/kwq/KWQTextField.h
index ee906c7..7ed5cfd 100644
--- a/WebCore/kwq/KWQTextField.h
+++ b/WebCore/kwq/KWQTextField.h
@@ -25,8 +25,7 @@
#import <Cocoa/Cocoa.h>
-class QWidget;
-
+class QLineEdit;
@class KWQTextFieldFormatter;
#define FOCUS_BORDER_SIZE 3
@@ -34,13 +33,13 @@ class QWidget;
@interface KWQNSTextField : NSTextField
{
@private
+ QLineEdit *widget;
NSTextField *secureField;
- QWidget *widget;
KWQTextFieldFormatter *formatter;
BOOL edited;
}
-- initWithWidget:(QWidget *)widget;
+- initWithQLineEdit:(QLineEdit *)widget;
- (void)setPasswordMode:(BOOL)flag;
- (BOOL)passwordMode;
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index c04ab8b..19818cf 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -26,6 +26,7 @@
#import <KWQNSTextField.h>
#import <qlineedit.h>
+#import <KWQKHTMLPartImpl.h>
// KWQTextFieldCell is larger than a normal text field cell, so it includes
// the focus border as well as the rest of the text field.
@@ -47,12 +48,18 @@
@end
-// KWQSecureTextField is a workaround for bug 3024443.
+// KWQSecureTextField has two purposes.
+// One is a workaround for bug 3024443.
+// The other is hook up next and previous key views to KHTML.
@interface KWQSecureTextField : NSSecureTextField
{
+ QWidget *widget;
BOOL inSetFrameSize;
}
+
+- initWithQWidget:(QWidget *)widget;
+
@end
@implementation KWQNSTextField
@@ -81,31 +88,27 @@
return self;
}
-- initWithWidget:(QWidget *)w
+- initWithQLineEdit:(QLineEdit *)w
{
- [super init];
widget = w;
- return self;
+ return [super init];
}
- (void)action:sender
{
- QLineEdit *edit = dynamic_cast<QLineEdit *>(widget);
- if (edit) {
- edit->returnPressed();
- }
+ widget->returnPressed();
}
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
{
- QLineEdit *edit = dynamic_cast<QLineEdit *>(widget);
- if (edit) {
- edit->textChanged();
- }
+ widget->textChanged();
}
- (void)dealloc
{
+ // Set widget to 0 so that nextKeyView and previousKeyView will return nil.
+ widget = 0;
+
[secureField release];
[formatter release];
[super dealloc];
@@ -138,7 +141,7 @@
[secureField removeFromSuperview];
} else {
if (secureField == nil) {
- secureField = [[KWQSecureTextField alloc] init];
+ secureField = [[KWQSecureTextField alloc] initWithQWidget:widget];
[secureField setDelegate:self];
[secureField setFormatter:formatter];
[secureField setFont:[self font]];
@@ -223,13 +226,29 @@
[super setFont:font];
}
+- (NSView *)nextKeyView
+{
+ return KWQKHTMLPartImpl::nextKeyView(widget, KWQSelectingNext);
+}
+
+- (NSView *)previousKeyView
+{
+ return KWQKHTMLPartImpl::nextKeyView(widget, KWQSelectingPrevious);
+}
+
@end
// This cell is used so that our frame includes the place where the focus rectangle is drawn.
-// If that makes the widget too big for layout, we'll account for that at the QWidget level.
+// We account for this at the QWidget level so the placement of the text field is still correct,
+// just as we account for the margins in NSButton and other AppKit controls.
@implementation KWQTextFieldCell
+- (BOOL)isOpaque
+{
+ return NO;
+}
+
- (NSSize)cellSizeForBounds:(NSRect)bounds
{
NSSize size = [super cellSizeForBounds:bounds];
@@ -304,6 +323,34 @@
@implementation KWQSecureTextField
+- initWithQWidget:(QWidget *)w
+{
+ widget = w;
+ return [super init];
+}
+
+- (void)dealloc
+{
+ // Set widget to 0 so that nextKeyView and previousKeyView will return nil.
+ widget = 0;
+
+ [super dealloc];
+}
+
+- (NSView *)nextKeyView
+{
+ return KWQKHTMLPartImpl::nextKeyView(widget, KWQSelectingNext);
+}
+
+- (NSView *)previousKeyView
+{
+ return KWQKHTMLPartImpl::nextKeyView(widget, KWQSelectingPrevious);
+}
+
+// These next two methods are the workaround for bug 3024443.
+// Basically, setFrameSize ends up calling an inappropriate selectText, so we just ignore
+// calls to selectText while setFrameSize is running.
+
- (void)selectText:(id)sender
{
if (sender == self && inSetFrameSize) {
diff --git a/WebCore/kwq/KWQValueList.h b/WebCore/kwq/KWQValueList.h
index 244edf6..56ba558 100644
--- a/WebCore/kwq/KWQValueList.h
+++ b/WebCore/kwq/KWQValueList.h
@@ -47,14 +47,14 @@ template<class T> class QValueListIterator {
public:
QValueListIterator() { }
+ T& operator*() const { return ((QValueListNode<T> *)impl.node())->value; }
+
+ QValueListIterator &operator++() { ++impl; return *this; }
+ QValueListIterator &operator--() { --impl; return *this; }
+ QValueListIterator operator++(int) { return impl++; }
+
bool operator==(const QValueListIterator &other) { return impl == other.impl; }
bool operator!=(const QValueListIterator &other) { return impl != other.impl; }
- const T& operator*() const { return ((const QValueListNode<T> *)impl.node())->value; }
- QValueListIterator operator++() { ++impl; return *this; }
-
- T& operator*() { return ((QValueListNode<T> *)impl.node())->value; }
- QValueListIterator& operator--() { --impl; return *this; }
- QValueListIterator operator++(int) { return impl++; }
private:
QValueListIterator(const KWQValueListIteratorImpl &pImp) : impl(pImp) { }
@@ -68,13 +68,16 @@ private:
template<class T> class QValueListConstIterator {
public:
QValueListConstIterator() { }
- QValueListConstIterator(const QValueListIterator<T> &other) : impl(other.impl) { }
+ QValueListConstIterator(const QValueListIterator<T> &it) : impl(it.impl) { }
+
+ const T& operator*() const { return ((const QValueListNode<T> *)impl.node())->value; }
+
+ QValueListConstIterator &operator++() { ++impl; return *this; }
+ QValueListConstIterator &operator--() { --impl; return *this; }
+ QValueListConstIterator operator++(int) { return impl++; }
bool operator==(const QValueListConstIterator &other) { return impl == other.impl; }
bool operator!=(const QValueListConstIterator &other) { return impl != other.impl; }
- const T& operator*() const { return ((const QValueListNode<T> *)impl.node())->value; }
- QValueListConstIterator operator++() { ++impl; return *this; }
- QValueListConstIterator operator++(int) { return impl++; }
private:
QValueListConstIterator(const KWQValueListIteratorImpl &pImp) : impl(pImp) { }
@@ -92,8 +95,6 @@ public:
QValueList() : impl(deleteNode, copyNode) { }
- // member functions --------------------------------------------------------
-
void clear() { impl.clear(); }
uint count() const { return impl.count(); }
bool isEmpty() const { return impl.isEmpty(); }
diff --git a/WebCore/kwq/KWQView.h b/WebCore/kwq/KWQView.h
index bea4bca..0a1dc16 100644
--- a/WebCore/kwq/KWQView.h
+++ b/WebCore/kwq/KWQView.h
@@ -35,24 +35,3 @@ class QWidget;
- initWithWidget:(QWidget *)w;
- (void)setIsFlipped:(bool)flag;
@end
-
- at interface KWQNSButton : NSButton
-{
- QWidget *widget;
-}
-- initWithWidget:(QWidget *)w;
- at end
-
- at interface KWQNSComboBox : NSPopUpButton
-{
- QWidget *widget;
-}
-- initWithWidget:(QWidget *)w;
- at end
-
- at interface KWQNSScrollView : NSScrollView
-{
- QWidget *widget;
-}
-- initWithWidget:(QWidget *)w;
- at end
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index ca29af0..e946a4c 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -25,9 +25,6 @@
#import "KWQView.h"
-#import <qcheckbox.h>
-#import <qcombobox.h>
-
@implementation KWQView
- initWithFrame:(NSRect)frame
@@ -55,94 +52,3 @@
}
@end
-
- at implementation KWQNSButton
-
-- initWithFrame:(NSRect)frame
-{
- [super initWithFrame:frame];
-
- [self setTarget:self];
- [self setAction:@selector(action:)];
-
- [self setTitle:@""];
- [self setBezelStyle:NSRoundedBezelStyle];
- [[self cell] setControlSize:NSSmallControlSize];
- [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
-
- return self;
-}
-
-- initWithWidget:(QWidget *)w
-{
- [super init];
- widget = w;
- return self;
-}
-
-- (void)action:(id)sender
-{
- QButton *button = dynamic_cast<QButton *>(widget);
- if (button) {
- button->clicked();
- }
-}
-
-- (void)stateChanged:(id)sender
-{
- // Note that it's important to give the stateChanged signal before
- // the clicked signal so that the corresponding JavaScript messages
- // go in the right order. A test for this at the time of this writing
- // was the languages radio buttons and check boxes at google.com prefs.
-
- QCheckBox *checkBox = dynamic_cast<QCheckBox *>(widget);
- if (checkBox) {
- checkBox->stateChanged();
- }
- [self action:sender];
-}
-
- at end
-
- at implementation KWQNSComboBox
-
-- initWithFrame:(NSRect)frame
-{
- [super initWithFrame:frame];
-
- [self setTarget:self];
- [self setAction:@selector(action:)];
-
- [[self cell] setControlSize:NSSmallControlSize];
- [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
-
- return self;
-}
-
-- initWithWidget:(QWidget *)w
-{
- [super init];
- widget = w;
- return self;
-}
-
-- (void)action:(id)sender
-{
- QComboBox *box = dynamic_cast<QComboBox *>(widget);
- if (box) {
- box->activated();
- }
-}
-
- at end
-
- at implementation KWQNSScrollView
-
-- initWithWidget:(QWidget *)w
-{
- [super init];
- widget = w;
- return self;
-}
-
- at end
diff --git a/WebCore/kwq/KWQWidget.h b/WebCore/kwq/KWQWidget.h
index 27a2614..795a903 100644
--- a/WebCore/kwq/KWQWidget.h
+++ b/WebCore/kwq/KWQWidget.h
@@ -62,7 +62,8 @@ public:
WheelFocus = 0x7
};
- QWidget(QWidget *parent = 0, const char *name = 0, int flags = 0);
+ QWidget();
+ QWidget(NSView *view);
virtual ~QWidget();
virtual QSize sizeHint() const;
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 94eee04..60d4db1 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -40,7 +40,6 @@
class QWidgetPrivate
{
public:
- QWidget::FocusPolicy focusPolicy;
QStyle *style;
QFont font;
QCursor cursor;
@@ -48,12 +47,21 @@ public:
NSView *view;
};
-QWidget::QWidget(QWidget *parent, const char *name, int f)
+QWidget::QWidget()
+ : data(new QWidgetPrivate)
{
- static QStyle defaultStyle;
-
- data = new QWidgetPrivate;
data->view = [[KWQView alloc] initWithWidget:this];
+
+ static QStyle defaultStyle;
+ data->style = &defaultStyle;
+}
+
+QWidget::QWidget(NSView *view)
+ : data(new QWidgetPrivate)
+{
+ data->view = [view retain];
+
+ static QStyle defaultStyle;
data->style = &defaultStyle;
}
@@ -181,20 +189,15 @@ void QWidget::clearFocus()
QWidget::FocusPolicy QWidget::focusPolicy() const
{
- return data->focusPolicy;
+ return [getView() acceptsFirstResponder] ? TabFocus : NoFocus;
}
void QWidget::setFocusPolicy(FocusPolicy fp)
{
- data->focusPolicy = fp;
}
void QWidget::setFocusProxy(QWidget *w)
{
- if (w)
- data->focusPolicy = w->focusPolicy();
- // else? FIXME: [rjw] we need to understand kde's focus policy. I don't
- // think this is even relevant for us.
}
const QPalette& QWidget::palette() const
diff --git a/WebCore/kwq/KWQWindowWidget.h b/WebCore/kwq/KWQWindowWidget.h
index 109e786..9d6609c 100644
--- a/WebCore/kwq/KWQWindowWidget.h
+++ b/WebCore/kwq/KWQWindowWidget.h
@@ -52,7 +52,6 @@ class KWQWindowWidget : public QWidget
virtual QPoint mapFromGlobal(const QPoint &) const;
private:
- KWQWindowWidget();
KWQWindowWidget(NSWindow *window);
KWQWindowWidgetPrivate *d;
};
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 766eae3..610bb8f 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -131,7 +131,7 @@ using khtml::RenderPart;
// If we own the view, delete the old one - otherwise the render
// widget should take care of deleting the view
if (bridgeOwnsKHTMLView) {
- delete part->impl->getView();
+ delete part->impl->view();
}
KHTMLView *kview = new KHTMLView(part, 0);
@@ -174,11 +174,11 @@ using khtml::RenderPart;
- (void)forceLayout
{
- RenderObject *renderer = part->impl->getRenderer();
+ RenderObject *renderer = part->impl->renderer();
if (renderer) {
renderer->setLayouted(false);
}
- KHTMLView *view = part->impl->getView();
+ KHTMLView *view = part->impl->view();
if (view) {
view->layout();
}
@@ -186,11 +186,11 @@ using khtml::RenderPart;
- (void)drawRect:(NSRect)rect withPainter:(QPainter *)p
{
- RenderObject *renderer = part->impl->getRenderer();
+ RenderObject *renderer = part->impl->renderer();
#ifdef DEBUG_DRAWING
[[NSColor redColor] set];
- [NSBezierPath fillRect:[part->impl->getView()->getView() visibleRect]];
+ [NSBezierPath fillRect:[part->impl->view()->getView() visibleRect]];
#endif
if (renderer) {
@@ -232,7 +232,7 @@ using khtml::RenderPart;
- (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier
{
- DOM::DocumentImpl *doc = part->impl->getDocument();
+ DOM::DocumentImpl *doc = part->impl->document();
if (!doc) {
return nil;
}
@@ -265,7 +265,7 @@ using khtml::RenderPart;
- (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier
{
- RenderObject *renderer = part->impl->getRenderer();
+ RenderObject *renderer = part->impl->renderer();
if (!renderer) {
return nil;
}
@@ -275,21 +275,21 @@ using khtml::RenderPart;
- (void)removeFromFrame
{
if (bridgeOwnsKHTMLView) {
- delete part->impl->getView();
+ delete part->impl->view();
}
bridgeOwnsKHTMLView = NO;
}
- (void)installInFrame:(NSView *)view
{
- part->impl->getView()->setView(view);
+ part->impl->view()->setView(view);
// If this isn't the main frame, it must have a render part set, or it
// won't ever get installed in the view hierarchy.
KWQ_ASSERT(self == [self mainFrame] || renderPart != nil);
if (renderPart) {
- renderPart->setWidget(part->impl->getView());
+ renderPart->setWidget(part->impl->view());
// Now that the render part is holding the widget, we don't own it any more.
bridgeOwnsKHTMLView = NO;
}
@@ -336,8 +336,8 @@ using khtml::RenderPart;
state |= [self stateForEvent:event];
QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
- if (part->impl->getView()) {
- part->impl->getView()->viewportMouseReleaseEvent(&kEvent);
+ if (part->impl->view()) {
+ part->impl->view()->viewportMouseReleaseEvent(&kEvent);
}
}
@@ -363,8 +363,8 @@ using khtml::RenderPart;
state |= [self stateForEvent:event];
QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
- if (part->impl->getView()) {
- part->impl->getView()->viewportMousePressEvent(&kEvent);
+ if (part->impl->view()) {
+ part->impl->view()->viewportMousePressEvent(&kEvent);
}
}
@@ -373,8 +373,8 @@ using khtml::RenderPart;
NSPoint p = [event locationInWindow];
QMouseEvent kEvent(QEvent::MouseMove, QPoint((int)p.x, (int)p.y), 0, [self stateForEvent:event]);
- if (part->impl->getView()) {
- part->impl->getView()->viewportMouseMoveEvent(&kEvent);
+ if (part->impl->view()) {
+ part->impl->view()->viewportMouseMoveEvent(&kEvent);
}
}
@@ -383,21 +383,21 @@ using khtml::RenderPart;
NSPoint p = [event locationInWindow];
QMouseEvent kEvent(QEvent::MouseMove, QPoint((int)p.x, (int)p.y), Qt::LeftButton, Qt::LeftButton);
- if (part->impl->getView()) {
- part->impl->getView()->viewportMouseMoveEvent(&kEvent);
+ if (part->impl->view()) {
+ part->impl->view()->viewportMouseMoveEvent(&kEvent);
}
}
- (NSURL *)completeURLForDOMString:(const DOMString &)s
{
- NSString *URLString = part->impl->getDocument()->completeURL(s.string()).getNSString();
+ NSString *URLString = part->impl->document()->completeURL(s.string()).getNSString();
return [NSURL _web_URLWithString:URLString];
}
- (NSDictionary *)elementAtPoint:(NSPoint)point
{
RenderObject::NodeInfo nodeInfo(true, true);
- part->impl->getRenderer()->nodeAtPoint(nodeInfo, (int)point.x, (int)point.y, 0, 0);
+ part->impl->renderer()->nodeAtPoint(nodeInfo, (int)point.x, (int)point.y, 0, 0);
NSMutableDictionary *elementInfo = [NSMutableDictionary dictionary];
diff --git a/WebCore/kwq/kdeui/kcombobox.h b/WebCore/kwq/kdeui/kcombobox.h
index 69ac55c..df31902 100644
--- a/WebCore/kwq/kdeui/kcombobox.h
+++ b/WebCore/kwq/kdeui/kcombobox.h
@@ -27,17 +27,11 @@
#define KCOMBOBOX_H_
#include <qcombobox.h>
-
#include <KWQCompletion.h>
class KComboBox : public QComboBox, public KCompletionBase {
public:
- KComboBox(QWidget *parent=0, const char *name=0);
- KComboBox(bool rw, QWidget *parent=0, const char *name=0);
- virtual ~KComboBox();
-
- void doneLoading();
- void setSize(int size);
+ KComboBox(bool, QWidget *) { }
};
#endif
diff --git a/WebCore/kwq/kdeui/klineedit.h b/WebCore/kwq/kdeui/klineedit.h
index c3d4c9c..a198edf 100644
--- a/WebCore/kwq/kdeui/klineedit.h
+++ b/WebCore/kwq/kdeui/klineedit.h
@@ -27,17 +27,15 @@
#define KLINEEDIT_H_
#include <qlineedit.h>
-
#include <KWQCompletion.h>
-
-#include "kcompletionbox.h"
+#include <kcompletionbox.h>
class KLineEdit : public QLineEdit, public KCompletionBase {
public:
- KLineEdit(QWidget *parent=0);
+ KLineEdit(QWidget *parent) { }
- void setContextMenuEnabled(bool showMenu);
- KCompletionBox *completionBox(bool create);
+ void setContextMenuEnabled(bool showMenu) { }
+ KCompletionBox *completionBox(bool create) { return 0; }
int frameWidth() const { return 2; }
};
diff --git a/WebCore/kwq/qt/qbutton.h b/WebCore/kwq/qt/qbutton.h
index 57da053..ad2449d 100644
--- a/WebCore/kwq/qt/qbutton.h
+++ b/WebCore/kwq/qt/qbutton.h
@@ -29,10 +29,17 @@
#include <qwidget.h>
#include <qstring.h>
#include <KWQSignal.h>
-
+
+#ifdef __OBJC__
+ at class KWQButtonAdapter;
+#else
+class KWQButtonAdapter;
+#endif
+
class QButton : public QWidget {
public:
- QButton(QWidget *parent = 0);
+ QButton();
+ ~QButton();
virtual void setText(const QString &);
QString text() const;
@@ -41,10 +48,11 @@ public:
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
- void clicked() { m_clicked.call(); }
+ virtual void clicked();
private:
KWQSignal m_clicked;
+ KWQButtonAdapter *m_adapter;
};
#endif
diff --git a/WebCore/kwq/qt/qcheckbox.h b/WebCore/kwq/qt/qcheckbox.h
index 8112da4..0af3f29 100644
--- a/WebCore/kwq/qt/qcheckbox.h
+++ b/WebCore/kwq/qt/qcheckbox.h
@@ -39,7 +39,7 @@ public:
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
- void stateChanged() { m_stateChanged.call(isChecked() ? 2 : 0); }
+ virtual void clicked();
private:
KWQSignal m_stateChanged;
diff --git a/WebCore/kwq/qt/qcombobox.h b/WebCore/kwq/qt/qcombobox.h
index 07d0a42..116fb30 100644
--- a/WebCore/kwq/qt/qcombobox.h
+++ b/WebCore/kwq/qt/qcombobox.h
@@ -30,40 +30,36 @@
#include <qwidget.h>
#ifdef __OBJC__
- at class NSMutableArray;
+ at class KWQComboBoxAdapter;
#else
-class NSMutableArray;
+class KWQComboBoxAdapter;
#endif
class QComboBox : public QWidget {
public:
- QComboBox(QWidget *parent=0, const char *name=0);
- QComboBox(bool rw, QWidget *parent=0, const char *name=0);
+ QComboBox();
~QComboBox();
-
- int count() const;
- QListBox *listBox() const;
- void popup();
- bool eventFilter(QObject *object, QEvent *event);
- void insertItem(const QString &text, int index=-1);
+
void clear();
- int currentItem() const;
+ void insertItem(const QString &text, int index=-1);
- int indexOfCurrentItem();
+ int currentItem() const;
void setCurrentItem(int);
+
+ QListBox *listBox() const { return 0; }
+ void popup() { }
QSize sizeHint() const;
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
- NSMutableArray *items;
+ bool eventFilter(QObject *object, QEvent *event) { return false; }
- void activated() { m_activated.call(indexOfCurrentItem()); }
+ void activated() { m_activated.call(currentItem()); }
private:
- void init(bool isEditable);
-
KWQSignal m_activated;
+ KWQComboBoxAdapter *m_adapter;
};
#endif
diff --git a/WebCore/kwq/qt/qframe.h b/WebCore/kwq/qt/qframe.h
index 989ddf9..bf7d8ee 100644
--- a/WebCore/kwq/qt/qframe.h
+++ b/WebCore/kwq/qt/qframe.h
@@ -33,7 +33,7 @@ public:
enum Shape { NoFrame, Box, StyledPanel };
enum Shadow { Sunken };
- QFrame(QWidget *parent);
+ QFrame() { }
virtual void setFrameStyle(int);
int frameStyle();
diff --git a/WebCore/kwq/qt/qlineedit.h b/WebCore/kwq/qt/qlineedit.h
index aa789f6..bbe84bd 100644
--- a/WebCore/kwq/qt/qlineedit.h
+++ b/WebCore/kwq/qt/qlineedit.h
@@ -35,7 +35,7 @@ class QLineEdit : public QWidget {
public:
enum EchoMode { Normal, Password };
- QLineEdit(QWidget *parent);
+ QLineEdit();
virtual void setEchoMode(EchoMode);
virtual void setCursorPosition(int);
diff --git a/WebCore/kwq/qt/qobject.h b/WebCore/kwq/qt/qobject.h
index 93483d1..9f0b233 100644
--- a/WebCore/kwq/qt/qobject.h
+++ b/WebCore/kwq/qt/qobject.h
@@ -83,9 +83,9 @@ public:
void killTimers();
virtual void timerEvent(QTimerEvent *);
- void installEventFilter(const QObject *);
- void removeEventFilter(const QObject *);
- bool eventFilter(QObject *o, QEvent *e);
+ void installEventFilter(const QObject *o) { m_eventFilterObject = o; }
+ void removeEventFilter(const QObject *) { m_eventFilterObject = 0; }
+ const QObject *eventFilterObject() const { return m_eventFilterObject; }
void blockSignals(bool b) { m_signalsBlocked = b; }
@@ -104,6 +104,8 @@ private:
mutable KWQSignal *m_signalListHead;
bool m_signalsBlocked;
+ const QObject *m_eventFilterObject;
+
static const QObject *m_sender;
friend class KWQGuardedPtrBase;
diff --git a/WebCore/kwq/qt/qpushbutton.h b/WebCore/kwq/qt/qpushbutton.h
index 292cfe7..29044d1 100644
--- a/WebCore/kwq/qt/qpushbutton.h
+++ b/WebCore/kwq/qt/qpushbutton.h
@@ -30,7 +30,7 @@
class QPushButton : public QButton {
public:
- QPushButton(QWidget *w) : QButton(w) { }
+ QPushButton(QWidget *parent) { }
QPushButton(const QString &text, QWidget *parent);
};
diff --git a/WebCore/kwq/qt/qscrollview.h b/WebCore/kwq/qt/qscrollview.h
index 5be9a18..ba20272 100644
--- a/WebCore/kwq/qt/qscrollview.h
+++ b/WebCore/kwq/qt/qscrollview.h
@@ -38,7 +38,7 @@ class QScrollView : public QFrame {
public:
enum ScrollBarMode { AlwaysOff, AlwaysOn, Auto };
- QScrollView(QWidget *parent = 0, const char *name = 0, int flags = 0);
+ QScrollView(QWidget *parent = 0, const char *name = 0, int flags = 0) { }
QWidget *viewport() const;
int visibleWidth() const;
diff --git a/WebCore/kwq/qt/qvaluelist.h b/WebCore/kwq/qt/qvaluelist.h
index 244edf6..56ba558 100644
--- a/WebCore/kwq/qt/qvaluelist.h
+++ b/WebCore/kwq/qt/qvaluelist.h
@@ -47,14 +47,14 @@ template<class T> class QValueListIterator {
public:
QValueListIterator() { }
+ T& operator*() const { return ((QValueListNode<T> *)impl.node())->value; }
+
+ QValueListIterator &operator++() { ++impl; return *this; }
+ QValueListIterator &operator--() { --impl; return *this; }
+ QValueListIterator operator++(int) { return impl++; }
+
bool operator==(const QValueListIterator &other) { return impl == other.impl; }
bool operator!=(const QValueListIterator &other) { return impl != other.impl; }
- const T& operator*() const { return ((const QValueListNode<T> *)impl.node())->value; }
- QValueListIterator operator++() { ++impl; return *this; }
-
- T& operator*() { return ((QValueListNode<T> *)impl.node())->value; }
- QValueListIterator& operator--() { --impl; return *this; }
- QValueListIterator operator++(int) { return impl++; }
private:
QValueListIterator(const KWQValueListIteratorImpl &pImp) : impl(pImp) { }
@@ -68,13 +68,16 @@ private:
template<class T> class QValueListConstIterator {
public:
QValueListConstIterator() { }
- QValueListConstIterator(const QValueListIterator<T> &other) : impl(other.impl) { }
+ QValueListConstIterator(const QValueListIterator<T> &it) : impl(it.impl) { }
+
+ const T& operator*() const { return ((const QValueListNode<T> *)impl.node())->value; }
+
+ QValueListConstIterator &operator++() { ++impl; return *this; }
+ QValueListConstIterator &operator--() { --impl; return *this; }
+ QValueListConstIterator operator++(int) { return impl++; }
bool operator==(const QValueListConstIterator &other) { return impl == other.impl; }
bool operator!=(const QValueListConstIterator &other) { return impl != other.impl; }
- const T& operator*() const { return ((const QValueListNode<T> *)impl.node())->value; }
- QValueListConstIterator operator++() { ++impl; return *this; }
- QValueListConstIterator operator++(int) { return impl++; }
private:
QValueListConstIterator(const KWQValueListIteratorImpl &pImp) : impl(pImp) { }
@@ -92,8 +95,6 @@ public:
QValueList() : impl(deleteNode, copyNode) { }
- // member functions --------------------------------------------------------
-
void clear() { impl.clear(); }
uint count() const { return impl.count(); }
bool isEmpty() const { return impl.isEmpty(); }
diff --git a/WebCore/kwq/qt/qwidget.h b/WebCore/kwq/qt/qwidget.h
index 27a2614..795a903 100644
--- a/WebCore/kwq/qt/qwidget.h
+++ b/WebCore/kwq/qt/qwidget.h
@@ -62,7 +62,8 @@ public:
WheelFocus = 0x7
};
- QWidget(QWidget *parent = 0, const char *name = 0, int flags = 0);
+ QWidget();
+ QWidget(NSView *view);
virtual ~QWidget();
virtual QSize sizeHint() const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list