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


The following commit has been merged in the debian/unstable branch:
commit f4e8156b3b57080dc10af1ed883e454e3c244d11
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 16 05:35:20 2002 +0000

    	Give the same good loving to the check boxes and radio buttons.
    	I'm not saying our rules for where to position them are great, but
    	the rules are implemented cleanly and thus easier to tweak.
    
    	Got rid of the old Action system altogether, using signals now.
    
            * khtml/rendering/render_form.h: Remove now-unneeded APPLE_CHANGES.
            * khtml/rendering/render_form.cpp:
            (RenderButton::baselinePosition): All the buttons now share a single
    	version of this call, since none need any special baseline hacking at
    	the moment.
            (RenderSubmitButton::baselinePosition): Just call the RenderButton version.
    
            * kwq/KWQCheckBox.mm:
            (QCheckBox::sizeHint): Use 12x12, not 22x22.
            (QCheckBox::frameGeometry): Adjust for margins.
            (QCheckBox::setFrameGeometry): Adjust for margins.
            * kwq/KWQRadioButton.mm:
            (QRadioButton::sizeHint): Use 12x12, not 22x22.
            (QRadioButton::frameGeometry): Adjust for margins.
            (QRadioButton::setFrameGeometry): Adjust for margins.
    
            * kwq/qt/qcombobox.h:
            * kwq/KWQComboBox.mm: (QComboBox::QComboBox): Set up the activated signal.
            * kwq/KWQView.mm: (-[KWQNSComboBox action:]): Emit the activated signal.
    
            * kwq/KWQListBox.h:
            * kwq/KWQListBox.mm:
            (-[KWQBrowserDelegate browserSingleClick:]): Send a selectionChanged signal
    	and a clicked signal instead of a ACTION_LISTBOX_CLICKED.
            (QListBox::QListBox): Set up the clicked and selectionChanged signals.
    
            * kwq/qt/qobject.h: Remove Actions, ACTION_TEXT_AREA_END_EDITING,
    	ACTION_LISTBOX_CLICKED, ACTION_COMBOBOX_CLICKED, emitAction, performAction,
    	and target.
            * kwq/KWQObject.mm:
            (QObject::connect): Remove the target hack, no longer needed.
            (QObject::QObject): Remove target initialization.
    
            * kwq/KWQSlot.mm: (KWQSlot::KWQSlot), (KWQSlot::call):
    	Added selected and selectionChanged slots.
    
            * kwq/KWQTextArea.mm:
            (-[KWQTextArea textDidEndEditing:]): Removed code to emit the
    	ACTION_TEXT_AREA_END_EDITING action, which was no longer used.
    
            * force-clean-timestamp: Yes, again.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1835 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 7979428..3f0ad3b 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,55 @@
 2002-08-15  Darin Adler  <darin at apple.com>
 
+	Give the same good loving to the check boxes and radio buttons.
+	I'm not saying our rules for where to position them are great, but
+	the rules are implemented cleanly and thus easier to tweak.
+
+	Got rid of the old Action system altogether, using signals now.
+
+        * khtml/rendering/render_form.h: Remove now-unneeded APPLE_CHANGES.
+        * khtml/rendering/render_form.cpp:
+        (RenderButton::baselinePosition): All the buttons now share a single
+	version of this call, since none need any special baseline hacking at
+	the moment.
+        (RenderSubmitButton::baselinePosition): Just call the RenderButton version.
+
+        * kwq/KWQCheckBox.mm:
+        (QCheckBox::sizeHint): Use 12x12, not 22x22.
+        (QCheckBox::frameGeometry): Adjust for margins.
+        (QCheckBox::setFrameGeometry): Adjust for margins.
+        * kwq/KWQRadioButton.mm:
+        (QRadioButton::sizeHint): Use 12x12, not 22x22.
+        (QRadioButton::frameGeometry): Adjust for margins.
+        (QRadioButton::setFrameGeometry): Adjust for margins.
+
+        * kwq/qt/qcombobox.h:
+        * kwq/KWQComboBox.mm: (QComboBox::QComboBox): Set up the activated signal.
+        * kwq/KWQView.mm: (-[KWQNSComboBox action:]): Emit the activated signal.
+
+        * kwq/KWQListBox.h:
+        * kwq/KWQListBox.mm:
+        (-[KWQBrowserDelegate browserSingleClick:]): Send a selectionChanged signal
+	and a clicked signal instead of a ACTION_LISTBOX_CLICKED.
+        (QListBox::QListBox): Set up the clicked and selectionChanged signals.
+
+        * kwq/qt/qobject.h: Remove Actions, ACTION_TEXT_AREA_END_EDITING,
+	ACTION_LISTBOX_CLICKED, ACTION_COMBOBOX_CLICKED, emitAction, performAction,
+	and target.
+        * kwq/KWQObject.mm:
+        (QObject::connect): Remove the target hack, no longer needed.
+        (QObject::QObject): Remove target initialization.
+
+        * kwq/KWQSlot.mm: (KWQSlot::KWQSlot), (KWQSlot::call):
+	Added selected and selectionChanged slots.
+
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextArea textDidEndEditing:]): Removed code to emit the
+	ACTION_TEXT_AREA_END_EDITING action, which was no longer used.
+
+        * force-clean-timestamp: Yes, again.
+
+2002-08-15  Darin Adler  <darin at apple.com>
+
 	- fixed 3017376 -- button height is too tall
 
 	Reworked how widget sizing and positioning is done for a few of the most important
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 7979428..3f0ad3b 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,55 @@
 2002-08-15  Darin Adler  <darin at apple.com>
 
+	Give the same good loving to the check boxes and radio buttons.
+	I'm not saying our rules for where to position them are great, but
+	the rules are implemented cleanly and thus easier to tweak.
+
+	Got rid of the old Action system altogether, using signals now.
+
+        * khtml/rendering/render_form.h: Remove now-unneeded APPLE_CHANGES.
+        * khtml/rendering/render_form.cpp:
+        (RenderButton::baselinePosition): All the buttons now share a single
+	version of this call, since none need any special baseline hacking at
+	the moment.
+        (RenderSubmitButton::baselinePosition): Just call the RenderButton version.
+
+        * kwq/KWQCheckBox.mm:
+        (QCheckBox::sizeHint): Use 12x12, not 22x22.
+        (QCheckBox::frameGeometry): Adjust for margins.
+        (QCheckBox::setFrameGeometry): Adjust for margins.
+        * kwq/KWQRadioButton.mm:
+        (QRadioButton::sizeHint): Use 12x12, not 22x22.
+        (QRadioButton::frameGeometry): Adjust for margins.
+        (QRadioButton::setFrameGeometry): Adjust for margins.
+
+        * kwq/qt/qcombobox.h:
+        * kwq/KWQComboBox.mm: (QComboBox::QComboBox): Set up the activated signal.
+        * kwq/KWQView.mm: (-[KWQNSComboBox action:]): Emit the activated signal.
+
+        * kwq/KWQListBox.h:
+        * kwq/KWQListBox.mm:
+        (-[KWQBrowserDelegate browserSingleClick:]): Send a selectionChanged signal
+	and a clicked signal instead of a ACTION_LISTBOX_CLICKED.
+        (QListBox::QListBox): Set up the clicked and selectionChanged signals.
+
+        * kwq/qt/qobject.h: Remove Actions, ACTION_TEXT_AREA_END_EDITING,
+	ACTION_LISTBOX_CLICKED, ACTION_COMBOBOX_CLICKED, emitAction, performAction,
+	and target.
+        * kwq/KWQObject.mm:
+        (QObject::connect): Remove the target hack, no longer needed.
+        (QObject::QObject): Remove target initialization.
+
+        * kwq/KWQSlot.mm: (KWQSlot::KWQSlot), (KWQSlot::call):
+	Added selected and selectionChanged slots.
+
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextArea textDidEndEditing:]): Removed code to emit the
+	ACTION_TEXT_AREA_END_EDITING action, which was no longer used.
+
+        * force-clean-timestamp: Yes, again.
+
+2002-08-15  Darin Adler  <darin at apple.com>
+
 	- fixed 3017376 -- button height is too tall
 
 	Reworked how widget sizing and positioning is done for a few of the most important
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 7979428..3f0ad3b 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,55 @@
 2002-08-15  Darin Adler  <darin at apple.com>
 
+	Give the same good loving to the check boxes and radio buttons.
+	I'm not saying our rules for where to position them are great, but
+	the rules are implemented cleanly and thus easier to tweak.
+
+	Got rid of the old Action system altogether, using signals now.
+
+        * khtml/rendering/render_form.h: Remove now-unneeded APPLE_CHANGES.
+        * khtml/rendering/render_form.cpp:
+        (RenderButton::baselinePosition): All the buttons now share a single
+	version of this call, since none need any special baseline hacking at
+	the moment.
+        (RenderSubmitButton::baselinePosition): Just call the RenderButton version.
+
+        * kwq/KWQCheckBox.mm:
+        (QCheckBox::sizeHint): Use 12x12, not 22x22.
+        (QCheckBox::frameGeometry): Adjust for margins.
+        (QCheckBox::setFrameGeometry): Adjust for margins.
+        * kwq/KWQRadioButton.mm:
+        (QRadioButton::sizeHint): Use 12x12, not 22x22.
+        (QRadioButton::frameGeometry): Adjust for margins.
+        (QRadioButton::setFrameGeometry): Adjust for margins.
+
+        * kwq/qt/qcombobox.h:
+        * kwq/KWQComboBox.mm: (QComboBox::QComboBox): Set up the activated signal.
+        * kwq/KWQView.mm: (-[KWQNSComboBox action:]): Emit the activated signal.
+
+        * kwq/KWQListBox.h:
+        * kwq/KWQListBox.mm:
+        (-[KWQBrowserDelegate browserSingleClick:]): Send a selectionChanged signal
+	and a clicked signal instead of a ACTION_LISTBOX_CLICKED.
+        (QListBox::QListBox): Set up the clicked and selectionChanged signals.
+
+        * kwq/qt/qobject.h: Remove Actions, ACTION_TEXT_AREA_END_EDITING,
+	ACTION_LISTBOX_CLICKED, ACTION_COMBOBOX_CLICKED, emitAction, performAction,
+	and target.
+        * kwq/KWQObject.mm:
+        (QObject::connect): Remove the target hack, no longer needed.
+        (QObject::QObject): Remove target initialization.
+
+        * kwq/KWQSlot.mm: (KWQSlot::KWQSlot), (KWQSlot::call):
+	Added selected and selectionChanged slots.
+
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextArea textDidEndEditing:]): Removed code to emit the
+	ACTION_TEXT_AREA_END_EDITING action, which was no longer used.
+
+        * force-clean-timestamp: Yes, again.
+
+2002-08-15  Darin Adler  <darin at apple.com>
+
 	- fixed 3017376 -- button height is too tall
 
 	Reworked how widget sizing and positioning is done for a few of the most important
diff --git a/WebCore/force-clean-timestamp b/WebCore/force-clean-timestamp
index 55442bd..9d97da6 100644
--- a/WebCore/force-clean-timestamp
+++ b/WebCore/force-clean-timestamp
@@ -1 +1 @@
-widget changes 8/15
+widget changes 8/16
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index 658aaf8..1314339 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -200,7 +200,13 @@ RenderButton::RenderButton(HTMLGenericFormElementImpl *element)
 
 short RenderButton::baselinePosition( bool f ) const
 {
+#if APPLE_CHANGES
+    // We put the bottoms of buttons on the baseline,
+    // This looks better than trying to line up the button text's baseline.
+    return height() + marginTop();
+#else
     return RenderWidget::baselinePosition( f ) - 2;
+#endif
 }
 
 // -------------------------------------------------------------------------------
@@ -216,14 +222,6 @@ RenderCheckBox::RenderCheckBox(HTMLInputElementImpl *element)
     connect(b, SIGNAL(clicked()), this, SLOT(slotClicked()));
 }
 
-#ifdef APPLE_CHANGES
-// Override to deal with our widget.
-short RenderCheckBox::baselinePosition( bool f ) const
-{
-    return RenderWidget::baselinePosition( f ) - 9;
-}
-#endif
-
 void RenderCheckBox::calcMinMaxWidth()
 {
     KHTMLAssert( !minMaxKnown() );
@@ -268,14 +266,6 @@ RenderRadioButton::RenderRadioButton(HTMLInputElementImpl *element)
     connect(b, SIGNAL(clicked()), this, SLOT(slotClicked()));
 }
 
-#ifdef APPLE_CHANGES
-// Override to deal with our widget.
-short RenderRadioButton::baselinePosition( bool f ) const
-{
-    return RenderWidget::baselinePosition( f ) - 10;
-}
-#endif
-
 void RenderRadioButton::updateFromElement()
 {
     widget()->setChecked(element()->checked());
@@ -385,9 +375,7 @@ QString RenderSubmitButton::defaultLabel() {
 short RenderSubmitButton::baselinePosition( bool f ) const
 {
 #ifdef APPLE_CHANGES
-    // We  put the bottoms of buttons on the baseline,
-    // This looks better than trying to line up the button text's baseline.
-    return height() + marginTop();
+    return RenderButton::baselinePosition( f );
 #else
     return RenderFormElement::baselinePosition( f );
 #endif
@@ -1029,19 +1017,6 @@ void RenderSelect::slotSelected(int index)
 }
 
 
-#ifdef APPLE_CHANGES
-void RenderSelect::performAction(Actions action)
-{
-    if (action == ACTION_LISTBOX_CLICKED)
-        slotSelectionChanged();
-    else if (action == ACTION_COMBOBOX_CLICKED){
-        ComboBoxWidget *combo = static_cast<ComboBoxWidget*>(m_widget);
-
-        slotSelected(combo->indexOfCurrentItem());
-    }
-}
-#endif /* APPLE_CHANGES */
-
 void RenderSelect::slotSelectionChanged()
 {
     if ( m_ignoreSelectEvents ) return;
diff --git a/WebCore/khtml/rendering/render_form.h b/WebCore/khtml/rendering/render_form.h
index 65f12f0..4327774 100644
--- a/WebCore/khtml/rendering/render_form.h
+++ b/WebCore/khtml/rendering/render_form.h
@@ -137,9 +137,6 @@ public:
     virtual void calcMinMaxWidth();
 
     QCheckBox *widget() const { return static_cast<QCheckBox*>(m_widget); }
-#ifdef APPLE_CHANGES
-    short baselinePosition( bool f ) const;
-#endif
 
 public slots:
     virtual void slotStateChanged(int state);
@@ -158,10 +155,6 @@ public:
     virtual void calcMinMaxWidth();
     virtual void updateFromElement();
 
-#ifdef APPLE_CHANGES
-    short baselinePosition( bool f ) const;
-#endif
-
     QRadioButton *widget() const { return static_cast<QRadioButton*>(m_widget); }
 
 public slots:
@@ -374,9 +367,6 @@ public:
     virtual void updateFromElement();
 
     void updateSelection();
-#ifdef APPLE_CHANGES
-    void performAction(QObject::Actions action);
-#endif
 
     DOM::HTMLSelectElementImpl *element() const
     { return static_cast<DOM::HTMLSelectElementImpl*>(RenderObject::element()); }
diff --git a/WebCore/kwq/KWQCheckBox.mm b/WebCore/kwq/KWQCheckBox.mm
index 4d11159..9a695a6 100644
--- a/WebCore/kwq/KWQCheckBox.mm
+++ b/WebCore/kwq/KWQCheckBox.mm
@@ -27,6 +27,13 @@
 
 #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
+#define BOTTOM_MARGIN 6
+#define LEFT_MARGIN 3
+#define RIGHT_MARGIN 3
+
 QCheckBox::QCheckBox(QWidget *w)
     : QButton(w)
     , m_stateChanged(this, SIGNAL(stateChanged(int)))
@@ -38,17 +45,22 @@ QCheckBox::QCheckBox(QWidget *w)
 
 QSize QCheckBox::sizeHint() const 
 {
-    return QSize(22, 22);
+    return QSize(12, 12);
 }
 
 QRect QCheckBox::frameGeometry() const
 {
-    return QWidget::frameGeometry();
+    QRect r = QWidget::frameGeometry();
+    return QRect(r.x() + LEFT_MARGIN, r.y() + TOP_MARGIN,
+        r.width() - (LEFT_MARGIN + RIGHT_MARGIN),
+        r.height() - (TOP_MARGIN + BOTTOM_MARGIN));
 }
 
 void QCheckBox::setFrameGeometry(const QRect &r)
 {
-    QWidget::setFrameGeometry(r);
+    QWidget::setFrameGeometry(QRect(r.x() - LEFT_MARGIN, r.y() - TOP_MARGIN,
+        r.width() + LEFT_MARGIN + RIGHT_MARGIN,
+        r.height() + TOP_MARGIN + BOTTOM_MARGIN));
 }
 
 void QCheckBox::setChecked(bool isChecked)
diff --git a/WebCore/kwq/KWQComboBox.h b/WebCore/kwq/KWQComboBox.h
index ef36e1b..07d0a42 100644
--- a/WebCore/kwq/KWQComboBox.h
+++ b/WebCore/kwq/KWQComboBox.h
@@ -58,8 +58,12 @@ public:
 
     NSMutableArray *items;
 
+    void activated() { m_activated.call(indexOfCurrentItem()); }
+
 private:
     void init(bool isEditable);
+    
+    KWQSignal m_activated;
 };
 
 #endif
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index a29ed0d..885728b 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -37,11 +37,13 @@
 #define RIGHT_MARGIN 3
 
 QComboBox::QComboBox(QWidget *parent, const char *name)
+    : m_activated(this, SIGNAL(activated(int)))
 {
     init(false);
 }
 
 QComboBox::QComboBox(bool rw, QWidget *parent, const char *name)
+    : m_activated(this, SIGNAL(activated(int)))
 {
     init(rw);
 }
diff --git a/WebCore/kwq/KWQListBox.h b/WebCore/kwq/KWQListBox.h
index 39c3b14..e4af947 100644
--- a/WebCore/kwq/KWQListBox.h
+++ b/WebCore/kwq/KWQListBox.h
@@ -28,6 +28,7 @@
 
 #include <qscrollview.h>
 #include <qstring.h>
+#include <KWQSignal.h>
 
 class QListBoxItem;
 class QListBoxText;
@@ -53,10 +54,16 @@ public:
     void endBatchInsert();
     void setSelected(int, bool);
     bool isSelected(int);
+    
+    void clicked() { m_clicked.call(); }
+    void selectionChanged() { m_selectionChanged.call(); }
 
 private:
     QListBoxItem *head;
     bool m_insertingItems;
+    
+    KWQSignal m_clicked;
+    KWQSignal m_selectionChanged;
 };
 
 class QListBoxItem {
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index bc9bea8..abd463a 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -80,7 +80,8 @@
 
 - (IBAction)browserSingleClick:(id)browser
 {
-    box->emitAction(QObject::ACTION_LISTBOX_CLICKED);
+    box->selectionChanged();
+    box->clicked();
 }
 
 - (IBAction)browserDoubleClick:(id)browser
@@ -92,6 +93,8 @@
 
 QListBox::QListBox(QWidget *parent)
     : QScrollView(parent), m_insertingItems(false)
+    , m_clicked(this, SIGNAL(clicked(QListBoxItem *)))
+    , m_selectionChanged(this, SIGNAL(selectionChanged()))
 {
     NSBrowser *browser =  [[NSBrowser alloc] initWithFrame: NSMakeRect (0,0,1,1)];
     KWQBrowserDelegate *delegate = [[KWQBrowserDelegate alloc] initWithListBox: this];
diff --git a/WebCore/kwq/KWQObject.h b/WebCore/kwq/KWQObject.h
index 3617bfc..93483d1 100644
--- a/WebCore/kwq/KWQObject.h
+++ b/WebCore/kwq/KWQObject.h
@@ -68,13 +68,6 @@ class KWQSignal;
 
 class QObject : public Qt {
 public:
-
-    enum Actions {
-        ACTION_TEXT_AREA_END_EDITING = 5,        
-        ACTION_LISTBOX_CLICKED = 6,
-        ACTION_COMBOBOX_CLICKED = 7
-    };
-
     QObject(QObject *parent = 0, const char *name = 0);
     virtual ~QObject();
 
@@ -98,9 +91,6 @@ public:
 
     virtual bool event(QEvent *);
 
-    void emitAction(Actions action);
-    virtual void performAction(Actions action);
-    
     static const QObject *sender() { return m_sender; }
 
 private:
@@ -110,7 +100,6 @@ private:
     
     KWQSignal *findSignal(const char *signalName) const;
     
-    mutable QObject *target;
     QPtrList<QObject> guardedPtrDummyList;
     mutable KWQSignal *m_signalListHead;
     bool m_signalsBlocked;
diff --git a/WebCore/kwq/KWQObject.mm b/WebCore/kwq/KWQObject.mm
index 2b1aacf..6844548 100644
--- a/WebCore/kwq/KWQObject.mm
+++ b/WebCore/kwq/KWQObject.mm
@@ -50,9 +50,6 @@ void QObject::connect(const QObject *sender, const char *signalName, const QObje
         return;
     }
     
-    // FIXME: Do away with this after we change clients to use the KWQSignal scheme.
-    sender->target = const_cast<QObject *>(receiver);
-
     KWQSignal *signal = sender->findSignal(signalName);
     if (!signal) {
         // FIXME: ERROR
@@ -86,18 +83,8 @@ KWQObjectSenderScope::~KWQObjectSenderScope()
     QObject::m_sender = m_savedSender;
 }
 
-void QObject::emitAction(QObject::Actions action)
-{
-    if (target)
-        target->performAction (action);
-}
-
-void QObject::performAction(QObject::Actions action)
-{
-}
-
 QObject::QObject(QObject *parent, const char *name)
-    : target(0), m_signalListHead(0), m_signalsBlocked(false)
+    : m_signalListHead(0), m_signalsBlocked(false)
 {
     guardedPtrDummyList.append(this);
 }
diff --git a/WebCore/kwq/KWQRadioButton.mm b/WebCore/kwq/KWQRadioButton.mm
index b9b776a..421e54e 100644
--- a/WebCore/kwq/KWQRadioButton.mm
+++ b/WebCore/kwq/KWQRadioButton.mm
@@ -27,6 +27,13 @@
 
 #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
+#define BOTTOM_MARGIN 6
+#define LEFT_MARGIN 3
+#define RIGHT_MARGIN 3
+
 QRadioButton::QRadioButton(QWidget *w) : QButton(w)
 {
     KWQNSButton *button = (KWQNSButton *)getView();
@@ -35,17 +42,22 @@ QRadioButton::QRadioButton(QWidget *w) : QButton(w)
 
 QSize QRadioButton::sizeHint() const 
 {
-    return QSize(22, 22);
+    return QSize(12, 12);
 }
 
 QRect QRadioButton::frameGeometry() const
 {
-    return QWidget::frameGeometry();
+    QRect r = QWidget::frameGeometry();
+    return QRect(r.x() + LEFT_MARGIN, r.y() + TOP_MARGIN,
+        r.width() - (LEFT_MARGIN + RIGHT_MARGIN),
+        r.height() - (TOP_MARGIN + BOTTOM_MARGIN));
 }
 
 void QRadioButton::setFrameGeometry(const QRect &r)
 {
-    QWidget::setFrameGeometry(r);
+    QWidget::setFrameGeometry(QRect(r.x() - LEFT_MARGIN, r.y() - TOP_MARGIN,
+        r.width() + LEFT_MARGIN + RIGHT_MARGIN,
+        r.height() + TOP_MARGIN + BOTTOM_MARGIN));
 }
 
 void QRadioButton::setChecked(bool isChecked)
diff --git a/WebCore/kwq/KWQSlot.mm b/WebCore/kwq/KWQSlot.mm
index 250ba9b..5e330df 100644
--- a/WebCore/kwq/KWQSlot.mm
+++ b/WebCore/kwq/KWQSlot.mm
@@ -36,6 +36,7 @@ using khtml::RenderCheckBox;
 using khtml::RenderFileButton;
 using khtml::RenderFormElement;
 using khtml::RenderLineEdit;
+using khtml::RenderSelect;
 using khtml::RenderTextArea;
 
 enum FunctionNumber {
@@ -45,6 +46,8 @@ enum FunctionNumber {
     slotFinishedParsing,
     slotRedirect,
     slotReturnPressed,
+    slotSelected,
+    slotSelectionChanged,
     slotStateChanged,
     slotTextChanged,
     slotTextChangedWithString
@@ -70,6 +73,12 @@ KWQSlot::KWQSlot(QObject *object, const char *member) : m_object(0)
     } else if (KWQNamesMatch(member, SLOT(slotReturnPressed()))) {
         KWQ_ASSERT(dynamic_cast<RenderLineEdit *>(object) || dynamic_cast<RenderFileButton *>(object));
         m_function = slotReturnPressed;
+    } else if (KWQNamesMatch(member, SLOT(slotSelected(int)))) {
+        KWQ_ASSERT(dynamic_cast<RenderSelect *>(object));
+        m_function = slotSelected;
+    } else if (KWQNamesMatch(member, SLOT(slotSelectionChanged()))) {
+        KWQ_ASSERT(dynamic_cast<RenderSelect *>(object));
+        m_function = slotSelectionChanged;
     } else if (KWQNamesMatch(member, SLOT(slotStateChanged(int)))) {
         KWQ_ASSERT(dynamic_cast<RenderCheckBox *>(object));
         m_function = slotStateChanged;
@@ -139,6 +148,13 @@ void KWQSlot::call() const
             }
             return;
         }
+        case slotSelectionChanged: {
+            RenderSelect *select = dynamic_cast<RenderSelect *>(m_object.pointer());
+            if (select) {
+                select->slotSelectionChanged();
+            }
+            return;
+        }
         case slotTextChanged: {
             RenderTextArea *area = dynamic_cast<RenderTextArea *>(m_object.pointer());
             if (area) {
@@ -163,6 +179,13 @@ void KWQSlot::call(int i) const
             }
             return;
         }
+        case slotSelected: {
+            RenderSelect *select = dynamic_cast<RenderSelect *>(m_object.pointer());
+            if (select) {
+                select->slotSelected(i);
+            }
+            return;
+        }
     }
     
     call();
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index 00f3b9f..41124ea 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -109,7 +109,6 @@ const float LargeNumberForText = 1.0e7;
 - (void)textDidEndEditing:(NSNotification *)aNotification
 {
     if (widget) {
-        widget->emitAction(QObject::ACTION_TEXT_AREA_END_EDITING);
         QTextEdit *textEdit = dynamic_cast<QTextEdit *>(widget);
         if (textEdit) {
             textEdit->textChanged();
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index 881424a..ca29af0 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -24,7 +24,9 @@
  */
 
 #import "KWQView.h"
+
 #import <qcheckbox.h>
+#import <qcombobox.h>
 
 @implementation KWQView
 
@@ -126,7 +128,10 @@
 
 - (void)action:(id)sender
 {
-    widget->emitAction(QObject::ACTION_COMBOBOX_CLICKED);
+    QComboBox *box = dynamic_cast<QComboBox *>(widget);
+    if (box) {
+        box->activated();
+    }
 }
 
 @end
diff --git a/WebCore/kwq/qt/qcombobox.h b/WebCore/kwq/qt/qcombobox.h
index ef36e1b..07d0a42 100644
--- a/WebCore/kwq/qt/qcombobox.h
+++ b/WebCore/kwq/qt/qcombobox.h
@@ -58,8 +58,12 @@ public:
 
     NSMutableArray *items;
 
+    void activated() { m_activated.call(indexOfCurrentItem()); }
+
 private:
     void init(bool isEditable);
+    
+    KWQSignal m_activated;
 };
 
 #endif
diff --git a/WebCore/kwq/qt/qobject.h b/WebCore/kwq/qt/qobject.h
index 3617bfc..93483d1 100644
--- a/WebCore/kwq/qt/qobject.h
+++ b/WebCore/kwq/qt/qobject.h
@@ -68,13 +68,6 @@ class KWQSignal;
 
 class QObject : public Qt {
 public:
-
-    enum Actions {
-        ACTION_TEXT_AREA_END_EDITING = 5,        
-        ACTION_LISTBOX_CLICKED = 6,
-        ACTION_COMBOBOX_CLICKED = 7
-    };
-
     QObject(QObject *parent = 0, const char *name = 0);
     virtual ~QObject();
 
@@ -98,9 +91,6 @@ public:
 
     virtual bool event(QEvent *);
 
-    void emitAction(Actions action);
-    virtual void performAction(Actions action);
-    
     static const QObject *sender() { return m_sender; }
 
 private:
@@ -110,7 +100,6 @@ private:
     
     KWQSignal *findSignal(const char *signalName) const;
     
-    mutable QObject *target;
     QPtrList<QObject> guardedPtrDummyList;
     mutable KWQSignal *m_signalListHead;
     bool m_signalsBlocked;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list