[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:00:25 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 5026e91566a3a6f2800637fdc9dbbade4c09316d
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 9 22:56:15 2003 +0000
Reviewed by Ken.
More Cocoa exception blocking work.
* kwq/KWQFrame.mm:
(QFrame::setFrameStyle):
* kwq/KWQLineEdit.mm:
(QLineEdit::QLineEdit):
(QLineEdit::~QLineEdit):
(QLineEdit::setEchoMode):
(QLineEdit::setFont):
(QLineEdit::setText):
(QLineEdit::text):
(QLineEdit::isReadOnly):
(QLineEdit::setReadOnly):
(QLineEdit::maxLength):
(QLineEdit::selectAll):
(QLineEdit::edited):
(QLineEdit::setEdited):
(QLineEdit::sizeForCharacterWidth):
(QLineEdit::baselinePosition):
(QLineEdit::setAlignment):
* kwq/KWQListBox.mm:
(QListBox::QListBox):
(QListBox::~QListBox):
(QListBox::count):
(QListBox::clear):
(QListBox::setSelectionMode):
(QListBox::insertItem):
(QListBox::insertGroupLabel):
(QListBox::endBatchInsert):
(QListBox::setSelected):
(QListBox::isSelected):
(QListBox::setEnabled):
(QListBox::sizeForNumberOfLines):
(QListBox::focusPolicy):
* kwq/KWQPushButton.mm:
(QPushButton::QPushButton):
(QPushButton::sizeHint):
(QPushButton::baselinePosition):
(QPushButton::dimensions):
* kwq/KWQRadioButton.mm:
(QRadioButton::QRadioButton):
(QRadioButton::setChecked):
(QRadioButton::isChecked):
(QRadioButton::dimensions):
* kwq/KWQScrollBar.mm:
(-[KWQScrollBar initWithQScrollBar:]):
(:m_valueChanged):
(QScrollBar::~QScrollBar):
(QScrollBar::setValue):
(QScrollBar::setKnobProportion):
(QScrollBar::scrollbarHit):
* kwq/KWQScrollView.mm:
(QScrollView::visibleWidth):
(QScrollView::visibleHeight):
(QScrollView::contentsWidth):
(QScrollView::contentsHeight):
(QScrollView::contentsX):
(QScrollView::contentsY):
(QScrollView::setContentsPos):
(QScrollView::setVScrollBarMode):
(QScrollView::setHScrollBarMode):
(QScrollView::setScrollBarsMode):
(QScrollView::vScrollBarMode):
(QScrollView::hScrollBarMode):
(QScrollView::hasVerticalScrollBar):
(QScrollView::hasHorizontalScrollBar):
(QScrollView::suppressScrollBars):
(QScrollView::addChild):
(QScrollView::removeChild):
(QScrollView::resizeContents):
(QScrollView::updateContents):
(QScrollView::contentsToViewport):
(QScrollView::viewportToContents):
(QScrollView::setStaticBackground):
(QScrollView::ensureVisible):
(QScrollView::getDocumentView):
* kwq/KWQTextEdit.mm:
(QTextEdit::QTextEdit):
(QTextEdit::setText):
(QTextEdit::text):
(QTextEdit::textWithHardLineBreaks):
(QTextEdit::getCursorPosition):
(QTextEdit::setCursorPosition):
(QTextEdit::wordWrap):
(QTextEdit::setWordWrap):
(QTextEdit::isReadOnly):
(QTextEdit::setReadOnly):
(QTextEdit::selectAll):
(QTextEdit::setFont):
(QTextEdit::setAlignment):
(QTextEdit::sizeWithColumnsAndRows):
* kwq/KWQWidget.mm:
(QWidget::QWidget):
(QWidget::~QWidget):
(QWidget::setActiveWindow):
(QWidget::setEnabled):
(QWidget::isEnabled):
(QWidget::frameGeometry):
(QWidget::hasFocus):
(QWidget::setFocus):
(QWidget::focusPolicy):
(QWidget::isVisible):
(QWidget::setCursor):
(QWidget::cursor):
(QWidget::setFrameGeometry):
(QWidget::mapFromGlobal):
(QWidget::setView):
(QWidget::getOuterView):
(QWidget::lockDrawingFocus):
(QWidget::unlockDrawingFocus):
(QWidget::disableFlushDrawing):
(QWidget::enableFlushDrawing):
(QWidget::setDrawingAlpha):
(QWidget::paint):
(QWidget::sendConsumedMouseUp):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index d182ba3..27c4f01 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,123 @@
+2003-10-09 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Ken.
+
+ More Cocoa exception blocking work.
+
+ * kwq/KWQFrame.mm:
+ (QFrame::setFrameStyle):
+ * kwq/KWQLineEdit.mm:
+ (QLineEdit::QLineEdit):
+ (QLineEdit::~QLineEdit):
+ (QLineEdit::setEchoMode):
+ (QLineEdit::setFont):
+ (QLineEdit::setText):
+ (QLineEdit::text):
+ (QLineEdit::isReadOnly):
+ (QLineEdit::setReadOnly):
+ (QLineEdit::maxLength):
+ (QLineEdit::selectAll):
+ (QLineEdit::edited):
+ (QLineEdit::setEdited):
+ (QLineEdit::sizeForCharacterWidth):
+ (QLineEdit::baselinePosition):
+ (QLineEdit::setAlignment):
+ * kwq/KWQListBox.mm:
+ (QListBox::QListBox):
+ (QListBox::~QListBox):
+ (QListBox::count):
+ (QListBox::clear):
+ (QListBox::setSelectionMode):
+ (QListBox::insertItem):
+ (QListBox::insertGroupLabel):
+ (QListBox::endBatchInsert):
+ (QListBox::setSelected):
+ (QListBox::isSelected):
+ (QListBox::setEnabled):
+ (QListBox::sizeForNumberOfLines):
+ (QListBox::focusPolicy):
+ * kwq/KWQPushButton.mm:
+ (QPushButton::QPushButton):
+ (QPushButton::sizeHint):
+ (QPushButton::baselinePosition):
+ (QPushButton::dimensions):
+ * kwq/KWQRadioButton.mm:
+ (QRadioButton::QRadioButton):
+ (QRadioButton::setChecked):
+ (QRadioButton::isChecked):
+ (QRadioButton::dimensions):
+ * kwq/KWQScrollBar.mm:
+ (-[KWQScrollBar initWithQScrollBar:]):
+ (:m_valueChanged):
+ (QScrollBar::~QScrollBar):
+ (QScrollBar::setValue):
+ (QScrollBar::setKnobProportion):
+ (QScrollBar::scrollbarHit):
+ * kwq/KWQScrollView.mm:
+ (QScrollView::visibleWidth):
+ (QScrollView::visibleHeight):
+ (QScrollView::contentsWidth):
+ (QScrollView::contentsHeight):
+ (QScrollView::contentsX):
+ (QScrollView::contentsY):
+ (QScrollView::setContentsPos):
+ (QScrollView::setVScrollBarMode):
+ (QScrollView::setHScrollBarMode):
+ (QScrollView::setScrollBarsMode):
+ (QScrollView::vScrollBarMode):
+ (QScrollView::hScrollBarMode):
+ (QScrollView::hasVerticalScrollBar):
+ (QScrollView::hasHorizontalScrollBar):
+ (QScrollView::suppressScrollBars):
+ (QScrollView::addChild):
+ (QScrollView::removeChild):
+ (QScrollView::resizeContents):
+ (QScrollView::updateContents):
+ (QScrollView::contentsToViewport):
+ (QScrollView::viewportToContents):
+ (QScrollView::setStaticBackground):
+ (QScrollView::ensureVisible):
+ (QScrollView::getDocumentView):
+ * kwq/KWQTextEdit.mm:
+ (QTextEdit::QTextEdit):
+ (QTextEdit::setText):
+ (QTextEdit::text):
+ (QTextEdit::textWithHardLineBreaks):
+ (QTextEdit::getCursorPosition):
+ (QTextEdit::setCursorPosition):
+ (QTextEdit::wordWrap):
+ (QTextEdit::setWordWrap):
+ (QTextEdit::isReadOnly):
+ (QTextEdit::setReadOnly):
+ (QTextEdit::selectAll):
+ (QTextEdit::setFont):
+ (QTextEdit::setAlignment):
+ (QTextEdit::sizeWithColumnsAndRows):
+ * kwq/KWQWidget.mm:
+ (QWidget::QWidget):
+ (QWidget::~QWidget):
+ (QWidget::setActiveWindow):
+ (QWidget::setEnabled):
+ (QWidget::isEnabled):
+ (QWidget::frameGeometry):
+ (QWidget::hasFocus):
+ (QWidget::setFocus):
+ (QWidget::focusPolicy):
+ (QWidget::isVisible):
+ (QWidget::setCursor):
+ (QWidget::cursor):
+ (QWidget::setFrameGeometry):
+ (QWidget::mapFromGlobal):
+ (QWidget::setView):
+ (QWidget::getOuterView):
+ (QWidget::lockDrawingFocus):
+ (QWidget::unlockDrawingFocus):
+ (QWidget::disableFlushDrawing):
+ (QWidget::enableFlushDrawing):
+ (QWidget::setDrawingAlpha):
+ (QWidget::paint):
+ (QWidget::sendConsumedMouseUp):
+
2003-10-09 David Hyatt <hyatt at apple.com>
Stop printing extra spaces before list items. Fixes ordered lists with list-style-position: inside.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d182ba3..27c4f01 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,123 @@
+2003-10-09 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Ken.
+
+ More Cocoa exception blocking work.
+
+ * kwq/KWQFrame.mm:
+ (QFrame::setFrameStyle):
+ * kwq/KWQLineEdit.mm:
+ (QLineEdit::QLineEdit):
+ (QLineEdit::~QLineEdit):
+ (QLineEdit::setEchoMode):
+ (QLineEdit::setFont):
+ (QLineEdit::setText):
+ (QLineEdit::text):
+ (QLineEdit::isReadOnly):
+ (QLineEdit::setReadOnly):
+ (QLineEdit::maxLength):
+ (QLineEdit::selectAll):
+ (QLineEdit::edited):
+ (QLineEdit::setEdited):
+ (QLineEdit::sizeForCharacterWidth):
+ (QLineEdit::baselinePosition):
+ (QLineEdit::setAlignment):
+ * kwq/KWQListBox.mm:
+ (QListBox::QListBox):
+ (QListBox::~QListBox):
+ (QListBox::count):
+ (QListBox::clear):
+ (QListBox::setSelectionMode):
+ (QListBox::insertItem):
+ (QListBox::insertGroupLabel):
+ (QListBox::endBatchInsert):
+ (QListBox::setSelected):
+ (QListBox::isSelected):
+ (QListBox::setEnabled):
+ (QListBox::sizeForNumberOfLines):
+ (QListBox::focusPolicy):
+ * kwq/KWQPushButton.mm:
+ (QPushButton::QPushButton):
+ (QPushButton::sizeHint):
+ (QPushButton::baselinePosition):
+ (QPushButton::dimensions):
+ * kwq/KWQRadioButton.mm:
+ (QRadioButton::QRadioButton):
+ (QRadioButton::setChecked):
+ (QRadioButton::isChecked):
+ (QRadioButton::dimensions):
+ * kwq/KWQScrollBar.mm:
+ (-[KWQScrollBar initWithQScrollBar:]):
+ (:m_valueChanged):
+ (QScrollBar::~QScrollBar):
+ (QScrollBar::setValue):
+ (QScrollBar::setKnobProportion):
+ (QScrollBar::scrollbarHit):
+ * kwq/KWQScrollView.mm:
+ (QScrollView::visibleWidth):
+ (QScrollView::visibleHeight):
+ (QScrollView::contentsWidth):
+ (QScrollView::contentsHeight):
+ (QScrollView::contentsX):
+ (QScrollView::contentsY):
+ (QScrollView::setContentsPos):
+ (QScrollView::setVScrollBarMode):
+ (QScrollView::setHScrollBarMode):
+ (QScrollView::setScrollBarsMode):
+ (QScrollView::vScrollBarMode):
+ (QScrollView::hScrollBarMode):
+ (QScrollView::hasVerticalScrollBar):
+ (QScrollView::hasHorizontalScrollBar):
+ (QScrollView::suppressScrollBars):
+ (QScrollView::addChild):
+ (QScrollView::removeChild):
+ (QScrollView::resizeContents):
+ (QScrollView::updateContents):
+ (QScrollView::contentsToViewport):
+ (QScrollView::viewportToContents):
+ (QScrollView::setStaticBackground):
+ (QScrollView::ensureVisible):
+ (QScrollView::getDocumentView):
+ * kwq/KWQTextEdit.mm:
+ (QTextEdit::QTextEdit):
+ (QTextEdit::setText):
+ (QTextEdit::text):
+ (QTextEdit::textWithHardLineBreaks):
+ (QTextEdit::getCursorPosition):
+ (QTextEdit::setCursorPosition):
+ (QTextEdit::wordWrap):
+ (QTextEdit::setWordWrap):
+ (QTextEdit::isReadOnly):
+ (QTextEdit::setReadOnly):
+ (QTextEdit::selectAll):
+ (QTextEdit::setFont):
+ (QTextEdit::setAlignment):
+ (QTextEdit::sizeWithColumnsAndRows):
+ * kwq/KWQWidget.mm:
+ (QWidget::QWidget):
+ (QWidget::~QWidget):
+ (QWidget::setActiveWindow):
+ (QWidget::setEnabled):
+ (QWidget::isEnabled):
+ (QWidget::frameGeometry):
+ (QWidget::hasFocus):
+ (QWidget::setFocus):
+ (QWidget::focusPolicy):
+ (QWidget::isVisible):
+ (QWidget::setCursor):
+ (QWidget::cursor):
+ (QWidget::setFrameGeometry):
+ (QWidget::mapFromGlobal):
+ (QWidget::setView):
+ (QWidget::getOuterView):
+ (QWidget::lockDrawingFocus):
+ (QWidget::unlockDrawingFocus):
+ (QWidget::disableFlushDrawing):
+ (QWidget::enableFlushDrawing):
+ (QWidget::setDrawingAlpha):
+ (QWidget::paint):
+ (QWidget::sendConsumedMouseUp):
+
2003-10-09 David Hyatt <hyatt at apple.com>
Stop printing extra spaces before list items. Fixes ordered lists with list-style-position: inside.
diff --git a/WebCore/kwq/KWQFrame.mm b/WebCore/kwq/KWQFrame.mm
index 8a92e7f..993746a 100644
--- a/WebCore/kwq/KWQFrame.mm
+++ b/WebCore/kwq/KWQFrame.mm
@@ -25,9 +25,10 @@
#import "KWQFrame.h"
-#import "khtmlview.h"
+#import "KWQExceptions.h"
#import "KWQKHTMLPart.h"
#import "WebCoreBridge.h"
+#import "khtmlview.h"
void QFrame::setFrameStyle(int s)
{
@@ -38,7 +39,9 @@ void QFrame::setFrameStyle(int s)
if (view) {
KHTMLPart *part = view->part();
if (part) {
+ KWQ_BLOCK_NS_EXCEPTIONS;
[KWQ(part)->bridge() setHasBorder:(s != NoFrame)];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
}
}
diff --git a/WebCore/kwq/KWQLineEdit.mm b/WebCore/kwq/KWQLineEdit.mm
index 5e5983f..e59fc9c 100644
--- a/WebCore/kwq/KWQLineEdit.mm
+++ b/WebCore/kwq/KWQLineEdit.mm
@@ -25,8 +25,9 @@
#import "KWQLineEdit.h"
-#import "KWQTextField.h"
+#import "KWQExceptions.h"
#import "KWQLogging.h"
+#import "KWQTextField.h"
#import "WebCoreTextRendererFactory.h"
// This replicates constants from [NSTextFieldCell drawingRectForBounds].
@@ -37,22 +38,30 @@ QLineEdit::QLineEdit()
, m_textChanged(this, SIGNAL(textChanged(const QString &)))
, m_clicked(this, SIGNAL(clicked()))
{
- KWQTextField *view = [[KWQTextField alloc] initWithQLineEdit:this];
- [view setSelectable:YES]; // must do this explicitly so setEditable:NO does not make it NO
+ KWQTextField *view = nil;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ view = [[KWQTextField alloc] initWithQLineEdit:this];
setView(view);
[view release];
+ [view setSelectable:YES]; // must do this explicitly so setEditable:NO does not make it NO
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QLineEdit::~QLineEdit()
{
KWQTextField* textField = (KWQTextField*)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textField invalidate];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QLineEdit::setEchoMode(EchoMode mode)
{
KWQTextField *textField = (KWQTextField *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textField setPasswordMode:mode == Password];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QLineEdit::setCursorPosition(int)
@@ -70,22 +79,32 @@ void QLineEdit::setFont(const QFont &font)
{
QWidget::setFont(font);
KWQTextField *textField = (KWQTextField *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textField setFont:font.getNSFont()];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QLineEdit::setText(const QString &s)
{
KWQTextField *textField = (KWQTextField *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textField setStringValue:s.getNSString()];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QString QLineEdit::text()
{
KWQTextField *textField = (KWQTextField *)getView();
+ volatile NSString * volatile result = @"";
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSMutableString *text = [[[textField stringValue] mutableCopy] autorelease];
+ result = text;
[text replaceOccurrencesOfString:@"\r\n" withString:@"\n" options:NSLiteralSearch range:NSMakeRange(0, [text length])];
[text replaceOccurrencesOfString:@"\r" withString:@"\n" options:NSLiteralSearch range:NSMakeRange(0, [text length])];
- return QString::fromNSString(text);
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return QString::fromNSString((NSString *)result);
}
void QLineEdit::setMaxLength(int len)
@@ -97,37 +116,61 @@ void QLineEdit::setMaxLength(int len)
bool QLineEdit::isReadOnly() const
{
KWQTextField *textField = (KWQTextField *)getView();
- return ![textField isEditable];
+ volatile bool result = true;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ result = ![textField isEditable];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
void QLineEdit::setReadOnly(bool flag)
{
KWQTextField *textField = (KWQTextField *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textField setEditable:!flag];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
int QLineEdit::maxLength() const
{
KWQTextField *textField = (KWQTextField *)getView();
- return [textField maximumLength];
+ volatile int result = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ result = [textField maximumLength];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
void QLineEdit::selectAll()
{
KWQTextField *textField = (KWQTextField *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textField selectText:nil];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
bool QLineEdit::edited() const
{
KWQTextField *textField = (KWQTextField *)getView();
- return [textField edited];
+ volatile bool result = false;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ result = [textField edited];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
void QLineEdit::setEdited(bool flag)
{
KWQTextField *textField = (KWQTextField *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textField setEdited:flag];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QSize QLineEdit::sizeForCharacterWidth(int numCharacters) const
@@ -140,6 +183,9 @@ QSize QLineEdit::sizeForCharacterWidth(int numCharacters) const
ASSERT(numCharacters > 0);
+ NSSize size = {0,0};
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSMutableString *nominalWidthString = [NSMutableString stringWithCapacity:numCharacters];
for (int i = 0; i < numCharacters; ++i) {
[nominalWidthString appendString:@"0"];
@@ -149,9 +195,10 @@ QSize QLineEdit::sizeForCharacterWidth(int numCharacters) const
int maximumLength = [textField maximumLength];
[textField setMaximumLength:numCharacters];
[textField setStringValue:nominalWidthString];
- NSSize size = [[textField cell] cellSize];
+ size = [[textField cell] cellSize];
[textField setMaximumLength:maximumLength];
[textField setStringValue:value];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
return QSize(size);
}
@@ -159,10 +206,17 @@ QSize QLineEdit::sizeForCharacterWidth(int numCharacters) const
int QLineEdit::baselinePosition() const
{
KWQTextField *textField = (KWQTextField *)getView();
+
+ volatile int result = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSRect bounds = [textField bounds];
NSFont *font = [textField font];
- return (int)ceil([[textField cell] drawingRectForBounds:bounds].origin.y - bounds.origin.y
+ result = (int)ceil([[textField cell] drawingRectForBounds:bounds].origin.y - bounds.origin.y
+ [font defaultLineHeightForFont] + [font descender]);
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
void QLineEdit::clicked()
@@ -174,7 +228,9 @@ void QLineEdit::setAlignment(AlignmentFlags alignment)
{
ASSERT(alignment == AlignLeft || alignment == AlignRight);
KWQTextField *textField = getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textField setAlignment:(alignment == AlignRight ? NSRightTextAlignment : NSLeftTextAlignment)];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
bool QLineEdit::checksDescendantsForFocus() const
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index 3c15e3a..9e3b72f 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -26,6 +26,7 @@
#import "KWQListBox.h"
#import "KWQAssertions.h"
+#import "KWQExceptions.h"
#import "KWQKHTMLPart.h"
#import "KWQNSViewExtras.h"
#import "KWQView.h"
@@ -52,7 +53,6 @@
QListBox::QListBox(QWidget *parent)
: QScrollView(parent)
- , _items([[NSMutableArray alloc] init])
, _insertingItems(false)
, _changingSelection(false)
, _enabled(true)
@@ -60,7 +60,12 @@ QListBox::QListBox(QWidget *parent)
, _clicked(this, SIGNAL(clicked(QListBoxItem *)))
, _selectionChanged(this, SIGNAL(selectionChanged()))
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
+
+ _items = [[NSMutableArray alloc] init];
NSScrollView *scrollView = [[KWQListBoxScrollView alloc] init];
+ setView(scrollView);
+ [scrollView release];
[scrollView setBorderType:NSBezelBorder];
[scrollView setHasVerticalScroller:YES];
@@ -78,51 +83,64 @@ QListBox::QListBox(QWidget *parent)
[[scrollView contentView] releaseGState];
KWQTableView *tableView = [[KWQTableView alloc] initWithListBox:this items:_items];
-
[scrollView setDocumentView:tableView];
- [scrollView setVerticalLineScroll:[tableView rowHeight]];
-
[tableView release];
- setView(scrollView);
+ [scrollView setVerticalLineScroll:[tableView rowHeight]];
- [scrollView release];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QListBox::~QListBox()
{
NSScrollView *scrollView = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSTableView *tableView = [scrollView documentView];
[tableView setDelegate:nil];
[tableView setDataSource:nil];
[_items release];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
uint QListBox::count() const
{
- return [_items count];
+ volatile uint result = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ result = [_items count];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
void QListBox::clear()
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[_items removeAllObjects];
if (!_insertingItems) {
NSScrollView *scrollView = getView();
NSTableView *tableView = [scrollView documentView];
[tableView reloadData];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
_widthGood = NO;
}
void QListBox::setSelectionMode(SelectionMode mode)
{
NSScrollView *scrollView = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSTableView *tableView = [scrollView documentView];
[tableView setAllowsMultipleSelection:mode != Single];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QListBox::insertItem(NSObject *o, unsigned index)
{
unsigned c = count();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if (index >= c) {
[_items addObject:o];
} else {
@@ -134,6 +152,8 @@ void QListBox::insertItem(NSObject *o, unsigned index)
NSTableView *tableView = [scrollView documentView];
[tableView reloadData];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
_widthGood = NO;
}
@@ -145,6 +165,8 @@ void QListBox::insertItem(const QString &text, unsigned index)
void QListBox::insertGroupLabel(const QString &text, unsigned index)
{
static NSDictionary *groupLabelAttributes;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if (groupLabelAttributes == nil) {
groupLabelAttributes = [[NSDictionary dictionaryWithObject:
[NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]] forKey:NSFontAttributeName] retain];
@@ -154,6 +176,7 @@ void QListBox::insertGroupLabel(const QString &text, unsigned index)
initWithString:text.getNSString() attributes:groupLabelAttributes];
insertItem(s, index);
[s release];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QListBox::beginBatchInsert()
@@ -167,14 +190,19 @@ void QListBox::endBatchInsert()
ASSERT(_insertingItems);
_insertingItems = false;
NSScrollView *scrollView = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSTableView *tableView = [scrollView documentView];
[tableView reloadData];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QListBox::setSelected(int index, bool selectIt)
{
ASSERT(!_insertingItems);
NSScrollView *scrollView = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSTableView *tableView = [scrollView documentView];
_changingSelection = true;
if (selectIt) {
@@ -183,6 +211,7 @@ void QListBox::setSelected(int index, bool selectIt)
} else {
[tableView deselectRow:index];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
_changingSelection = false;
}
@@ -190,16 +219,25 @@ bool QListBox::isSelected(int index) const
{
ASSERT(!_insertingItems);
NSScrollView *scrollView = getView();
+
+ volatile bool result = false;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSTableView *tableView = [scrollView documentView];
- return [tableView isRowSelected:index];
+ result = [tableView isRowSelected:index];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
void QListBox::setEnabled(bool enabled)
{
_enabled = enabled;
// You would think this would work, but not until AK fixes 2177792
+ //KWQ_BLOCK_NS_EXCEPTIONS;
//NSTableView *tableView = [(NSScrollView *)getView() documentView];
//[tableView setEnabled:enabled];
+ //KWQ_UNBLOCK_NS_EXCEPTIONS;
}
bool QListBox::isEnabled()
@@ -212,6 +250,10 @@ QSize QListBox::sizeForNumberOfLines(int lines) const
ASSERT(!_insertingItems);
NSScrollView *scrollView = getView();
+
+ NSSize size = {0,0};
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSTableView *tableView = [scrollView documentView];
float width;
@@ -234,8 +276,9 @@ QSize QListBox::sizeForNumberOfLines(int lines) const
NSSize contentSize;
contentSize.width = ceil(width);
contentSize.height = ceil(([tableView rowHeight] + [tableView intercellSpacing].height) * MAX(MIN_LINES, lines));
- NSSize size = [NSScrollView frameSizeForContentSize:contentSize
+ size = [NSScrollView frameSizeForContentSize:contentSize
hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSBezelBorder];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
return QSize(size);
}
@@ -245,7 +288,14 @@ QWidget::FocusPolicy QListBox::focusPolicy() const
// Add an additional check here.
// For now, selects are only focused when full
// keyboard access is turned on.
- if ([KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode] != WebCoreFullKeyboardAccess)
+
+ volatile bool fullKeyboardAccess = false;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ fullKeyboardAccess = [KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode] == WebCoreFullKeyboardAccess;
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ if (!fullKeyboardAccess)
return NoFocus;
return QScrollView::focusPolicy();
diff --git a/WebCore/kwq/KWQPushButton.mm b/WebCore/kwq/KWQPushButton.mm
index 43f0563..80a11bf 100644
--- a/WebCore/kwq/KWQPushButton.mm
+++ b/WebCore/kwq/KWQPushButton.mm
@@ -25,6 +25,8 @@
#import "KWQPushButton.h"
+#import "KWQExceptions.h"
+
enum {
topMargin,
bottomMargin,
@@ -36,13 +38,18 @@ enum {
QPushButton::QPushButton(QWidget *)
{
NSButton *button = (NSButton *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[button setBezelStyle:NSRoundedBezelStyle];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QPushButton::QPushButton(const QString &text, QWidget *)
{
NSButton *button = (NSButton *)getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
[button setBezelStyle:NSRoundedBezelStyle];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
setText(text);
}
@@ -50,8 +57,15 @@ QPushButton::QPushButton(const QString &text, QWidget *)
QSize QPushButton::sizeHint() const
{
NSButton *button = (NSButton *)getView();
- return QSize((int)[[button cell] cellSize].width - (dimensions()[leftMargin] + dimensions()[rightMargin]),
+
+ QSize size;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ size = QSize((int)[[button cell] cellSize].width - (dimensions()[leftMargin] + dimensions()[rightMargin]),
(int)[[button cell] cellSize].height - (dimensions()[topMargin] + dimensions()[bottomMargin]));
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return size;
}
QRect QPushButton::frameGeometry() const
@@ -73,9 +87,16 @@ int QPushButton::baselinePosition() const
{
// Button text is centered vertically, with a fudge factor to account for the shadow.
NSButton *button = (NSButton *)getView();
+
+ volatile float ascender = 0;
+ volatile float descender = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSFont *font = [button font];
- float ascender = [font ascender];
- float descender = [font descender];
+ ascender = [font ascender];
+ descender = [font descender];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
return (int)ceil(-dimensions()[topMargin]
+ ((height() + dimensions()[topMargin] + dimensions()[bottomMargin]) - (ascender - descender)) / 2.0
+ ascender - dimensions()[baselineFudgeFactor]);
@@ -91,5 +112,11 @@ const int *QPushButton::dimensions() const
{ 0, 1, 1, 1, 1 }
};
NSControl * const button = static_cast<NSControl *>(getView());
- return w[[[button cell] controlSize]];
+ volatile NSControlSize size = NSSmallControlSize;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ size = [[button cell] controlSize];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return w[size];
}
diff --git a/WebCore/kwq/KWQRadioButton.mm b/WebCore/kwq/KWQRadioButton.mm
index aa90980..037785b 100644
--- a/WebCore/kwq/KWQRadioButton.mm
+++ b/WebCore/kwq/KWQRadioButton.mm
@@ -25,6 +25,8 @@
#import "KWQRadioButton.h"
+#import "KWQExceptions.h"
+
enum {
topMargin,
bottomMargin,
@@ -38,7 +40,9 @@ enum {
QRadioButton::QRadioButton(QWidget *w)
{
NSButton *button = (NSButton *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[button setButtonType:NSRadioButton];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QSize QRadioButton::sizeHint() const
@@ -64,13 +68,21 @@ void QRadioButton::setFrameGeometry(const QRect &r)
void QRadioButton::setChecked(bool isChecked)
{
NSButton *button = (NSButton *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[button setState:isChecked ? NSOnState : NSOffState];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
bool QRadioButton::isChecked() const
{
NSButton *button = (NSButton *)getView();
- return [button state] == NSOnState;
+
+ volatile bool result = false;
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ result = [button state] == NSOnState;
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
int QRadioButton::baselinePosition() const
@@ -88,5 +100,11 @@ const int *QRadioButton::dimensions() const
{ 1, 2, 0, 0, 2, 10, 10 },
};
NSControl * const button = static_cast<NSControl *>(getView());
- return w[[[button cell] controlSize]];
+
+ volatile NSControlSize size = NSSmallControlSize;
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ size = [[button cell] controlSize];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return w[size];
}
diff --git a/WebCore/kwq/KWQScrollBar.mm b/WebCore/kwq/KWQScrollBar.mm
index e90053c..925e258 100644
--- a/WebCore/kwq/KWQScrollBar.mm
+++ b/WebCore/kwq/KWQScrollBar.mm
@@ -25,6 +25,8 @@
#import "KWQScrollBar.h"
+#import "KWQExceptions.h"
+
@interface KWQScrollBar : NSScroller
{
QScrollBar* scrollBar;
@@ -57,6 +59,7 @@
[result setEnabled: YES];
[self setTarget:self];
[self setAction:@selector(scroll:)];
+
return result;
}
@@ -70,21 +73,28 @@ QScrollBar::QScrollBar(Qt::Orientation orientation, QWidget* parent)
:m_valueChanged(this, SIGNAL(valueChanged(int)))
{
m_orientation = orientation;
- m_scroller = [[KWQScrollBar alloc] initWithQScrollBar:this];
m_visibleSize = 0;
m_totalSize = 0;
m_currentPos = 0;
m_lineStep = 0;
m_pageStep = 0;
+ m_scroller = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ m_scroller = [[KWQScrollBar alloc] initWithQScrollBar:this];
setView(m_scroller);
- setFocusPolicy(NoFocus);
- [parent->getView() addSubview: m_scroller];
[m_scroller release];
+ [parent->getView() addSubview: m_scroller];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ setFocusPolicy(NoFocus);
}
QScrollBar::~QScrollBar()
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[m_scroller removeFromSuperview];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollBar::setValue(int v)
@@ -96,8 +106,10 @@ void QScrollBar::setValue(int v)
if (m_currentPos == v)
return; // Our value stayed the same.
m_currentPos = v;
+ KWQ_BLOCK_NS_EXCEPTIONS;
[m_scroller setFloatValue: (float)m_currentPos/maxPos
knobProportion: [m_scroller knobProportion]];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
valueChanged(); // Emit the signal that indicates our value has changed.
}
@@ -112,9 +124,11 @@ void QScrollBar::setKnobProportion(int visibleArea, int totalArea)
m_visibleSize = visibleArea;
m_totalSize = totalArea;
float val = (float)m_visibleSize/m_totalSize;
- if (val == [m_scroller knobProportion] || val < 0.0)
- return;
- [m_scroller setFloatValue: [m_scroller floatValue] knobProportion: val];
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ if (!(val == [m_scroller knobProportion] || val < 0.0))
+ [m_scroller setFloatValue: [m_scroller floatValue] knobProportion: val];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollBar::scrollbarHit(NSScrollerPart hitPart)
@@ -123,7 +137,7 @@ void QScrollBar::scrollbarHit(NSScrollerPart hitPart)
if (maxPos <= 0)
return; // Impossible to scroll anywhere.
- int newPos = m_currentPos;
+ volatile int newPos = m_currentPos;
switch (hitPart) {
case NSScrollerDecrementLine:
newPos -= m_lineStep;
@@ -141,7 +155,9 @@ void QScrollBar::scrollbarHit(NSScrollerPart hitPart)
// If the thumb is hit, then the scrollbar changed its value for us.
case NSScrollerKnob:
case NSScrollerKnobSlot:
+ KWQ_BLOCK_NS_EXCEPTIONS;
newPos = (int)([m_scroller floatValue]*maxPos);
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
break;
default: ;
}
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index 27f5f7f..1c082f8 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -24,9 +24,10 @@
*/
#import "KWQScrollView.h"
-#import "WebCoreFrameView.h"
+#import "KWQExceptions.h"
#import "KWQLogging.h"
+#import "WebCoreFrameView.h"
/*
This class implementation does NOT actually emulate the Qt QScrollView.
@@ -64,12 +65,15 @@ QWidget* QScrollView::viewport() const
int QScrollView::visibleWidth() const
{
NSScrollView *view = (NSScrollView *)getView();
- int visibleWidth;
+ volatile int visibleWidth = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView]) {
visibleWidth = (int)[view documentVisibleRect].size.width;
} else {
visibleWidth = (int)[view bounds].size.width;
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
return visibleWidth;
}
@@ -77,13 +81,15 @@ int QScrollView::visibleWidth() const
int QScrollView::visibleHeight() const
{
NSScrollView *view = (NSScrollView *)getView();
- int visibleHeight;
+ volatile int visibleHeight = 0;
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView]) {
visibleHeight = (int)[view documentVisibleRect].size.height;
} else {
visibleHeight = (int)[view bounds].size.height;
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
return visibleHeight;
}
@@ -92,43 +98,67 @@ int QScrollView::contentsWidth() const
{
NSView *docView, *view = getView();
docView = getDocumentView();
- if (docView)
- return (int)[docView bounds].size.width;
- return (int)[view bounds].size.width;
+
+ volatile int result = 0;
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ if (docView) {
+ result = (int)[docView bounds].size.width;
+ } else {
+ result = (int)[view bounds].size.width;
+ }
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
int QScrollView::contentsHeight() const
{
NSView *docView, *view = getView();
docView = getDocumentView();
- if (docView)
- return (int)[docView bounds].size.height;
- return (int)[view bounds].size.height;
+
+ volatile int result = 0;
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ if (docView) {
+ result = (int)[docView bounds].size.height;
+ } else {
+ result = (int)[view bounds].size.height;
+ }
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
int QScrollView::contentsX() const
{
NSView *view = getView();
- float vx;
+ volatile float vx = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView]) {
NSScrollView *sview = view;
vx = (int)[sview documentVisibleRect].origin.x;
} else {
vx = (int)[view visibleRect].origin.x;
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
return (int)vx;
}
int QScrollView::contentsY() const
{
NSView *view = getView();
- float vy;
+ volatile float vy = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView]) {
NSScrollView *sview = view;
vy = (int)[sview documentVisibleRect].origin.y;
} else {
vy = (int)[view visibleRect].origin.y;
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
return (int)vy;
}
@@ -149,98 +179,132 @@ void QScrollView::scrollBy(int dx, int dy)
void QScrollView::setContentsPos(int x, int y)
{
- NSView *docView, *view = getView();
+ NSView *docView;
+ volatile NSView * volatile view = getView();
docView = getDocumentView();
if (docView)
view = docView;
- if (x < 0)
- x = 0;
- if (y < 0)
- y = 0;
- [view scrollPoint: NSMakePoint(x,y)];
+ volatile int _x = (x < 0) ? 0 : x;
+ volatile int _y = (y < 0) ? 0 : y;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ [view scrollPoint: NSMakePoint(_x,_y)];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::setVScrollBarMode(ScrollBarMode vMode)
{
NSView* view = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
[frameView setVerticalScrollingMode: (WebCoreScrollBarMode)vMode];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::setHScrollBarMode(ScrollBarMode hMode)
{
NSView* view = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
[frameView setHorizontalScrollingMode: (WebCoreScrollBarMode)hMode];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::setScrollBarsMode(ScrollBarMode mode)
{
NSView* view = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
[frameView setScrollingMode: (WebCoreScrollBarMode)mode];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QScrollView::ScrollBarMode
QScrollView::vScrollBarMode() const
{
NSView* view = getView();
+
+ volatile QScrollView::ScrollBarMode mode = Auto;
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
- return (ScrollBarMode)[frameView verticalScrollingMode];
+ mode = (ScrollBarMode)[frameView verticalScrollingMode];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
- return Auto;
+ return mode;
}
QScrollView::ScrollBarMode
QScrollView::hScrollBarMode() const
{
NSView* view = getView();
+
+ volatile QScrollView::ScrollBarMode mode = Auto;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
- return (ScrollBarMode)[frameView horizontalScrollingMode];
+ mode = (ScrollBarMode)[frameView horizontalScrollingMode];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
- return Auto;
+ return mode;
}
bool QScrollView::hasVerticalScrollBar() const
{
NSScrollView *view = (NSScrollView *)getView();
+ volatile bool result = false;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView])
- return [view hasVerticalScroller];
- return false;
+ result = [view hasVerticalScroller];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
bool QScrollView::hasHorizontalScrollBar() const
{
NSScrollView *view = (NSScrollView *)getView();
+ volatile bool result = false;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView])
- return [view hasHorizontalScroller];
- return false;
+ result = [view hasHorizontalScroller];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
void QScrollView::suppressScrollBars(bool suppressed, bool repaintOnUnsuppress)
{
NSView* view = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
[frameView setScrollBarsSuppressed: suppressed
repaintOnUnsuppress: repaintOnUnsuppress];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::addChild(QWidget* child, int x, int y)
{
- NSView *thisView, *thisDocView, *subview;
+ volatile NSView * volatile thisView;
+ NSView *thisDocView, *subview;
ASSERT(child != this);
@@ -253,40 +317,48 @@ void QScrollView::addChild(QWidget* child, int x, int y)
subview = child->getOuterView();
ASSERT(subview != thisView);
- if ([subview superview] == thisView) {
- return;
- }
-
- [subview removeFromSuperview];
-
- LOG(Frames, "Adding %p %@ at (%d,%d) w %d h %d\n", subview,
- [(id)[subview class] className], x, y, (int)[subview frame].size.width, (int)[subview frame].size.height);
- [thisView addSubview:subview];
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ if ([subview superview] != thisView) {
+ [subview removeFromSuperview];
+
+ LOG(Frames, "Adding %p %@ at (%d,%d) w %d h %d\n", subview,
+ [(id)[subview class] className], x, y, (int)[subview frame].size.width, (int)[subview frame].size.height);
+
+ [thisView addSubview:subview];
+ }
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::removeChild(QWidget* child)
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[child->getOuterView() removeFromSuperview];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::resizeContents(int w, int h)
{
+ volatile int _w = w;
+ volatile int _h = h;
+
LOG(Frames, "%p %@ at w %d h %d\n", getView(), [(id)[getView() class] className], w, h);
NSView *view = getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView]){
view = getDocumentView();
LOG(Frames, "%p %@ at w %d h %d\n", view, [(id)[view class] className], w, h);
- if (w < 0)
- w = 0;
- if (h < 0)
- h = 0;
+ if (_w < 0)
+ _w = 0;
+ if (_h < 0)
+ _h = 0;
- [view setFrameSize: NSMakeSize (w,h)];
+ [view setFrameSize: NSMakeSize (_w,_h)];
} else {
- resize (w, h);
+ resize (_w, _h);
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::updateContents(int x, int y, int w, int h, bool now)
@@ -296,8 +368,9 @@ void QScrollView::updateContents(int x, int y, int w, int h, bool now)
void QScrollView::updateContents(const QRect &rect, bool now)
{
- NSView *view = getView();
+ volatile NSView * volatile view = getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView])
view = getDocumentView();
@@ -305,6 +378,7 @@ void QScrollView::updateContents(const QRect &rect, bool now)
[view displayRect: rect];
else
[view setNeedsDisplayInRect:rect];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::repaintContents(int x, int y, int w, int h, bool erase)
@@ -321,13 +395,17 @@ QPoint QScrollView::contentsToViewport(const QPoint &p)
void QScrollView::contentsToViewport(int x, int y, int& vx, int& vy)
{
- NSView *docView, *view = getView();
+ NSView *docView;
+ volatile NSView * volatile view = getView();
docView = getDocumentView();
if (docView)
view = docView;
-
- NSPoint np = [view convertPoint: NSMakePoint (x, y) toView: nil];
+
+ NSPoint np = {0,0};
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ np = [view convertPoint: NSMakePoint (x, y) toView: nil];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
vx = (int)np.x;
vy = (int)np.y;
@@ -335,13 +413,17 @@ void QScrollView::contentsToViewport(int x, int y, int& vx, int& vy)
void QScrollView::viewportToContents(int vx, int vy, int& x, int& y)
{
- NSView *docView, *view = getView();
+ NSView *docView;
+ volatile NSView * volatile view = getView();
docView = getDocumentView();
if (docView)
view = docView;
- NSPoint np = [view convertPoint: NSMakePoint (vx, vy) fromView: nil];
+ NSPoint np;
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ np = [view convertPoint: NSMakePoint (vx, vy) fromView: nil];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
x = (int)np.x;
y = (int)np.y;
@@ -350,8 +432,10 @@ void QScrollView::viewportToContents(int vx, int vy, int& x, int& y)
void QScrollView::setStaticBackground(bool b)
{
NSScrollView *view = (NSScrollView *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view _KWQ_isScrollView])
[[view contentView] setCopiesOnScroll: !b];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::resizeEvent(QResizeEvent *)
@@ -360,16 +444,27 @@ void QScrollView::resizeEvent(QResizeEvent *)
void QScrollView::ensureVisible(int x, int y)
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[getDocumentView() scrollRectToVisible:NSMakeRect(x, y, 0, 0)];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QScrollView::ensureVisible(int x, int y, int w, int h)
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[getDocumentView() scrollRectToVisible:NSMakeRect(x, y, w, h)];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
NSView *QScrollView::getDocumentView() const
{
id view = getView();
- return [view respondsToSelector:@selector(documentView)] ? [view documentView] : nil;
+ volatile NSView * volatile result = nil;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ if ([view respondsToSelector:@selector(documentView)])
+ result = [view documentView];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return (NSView *)result;
}
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index 195709f..60ebbde 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -26,57 +26,92 @@
#import "KWQTextEdit.h"
#import "KWQAssertions.h"
+#import "KWQExceptions.h"
#import "KWQTextArea.h"
QTextEdit::QTextEdit(QWidget *parent)
: _clicked(this, SIGNAL(clicked()))
, _textChanged(this, SIGNAL(textChanged()))
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
KWQTextArea *textView = [[KWQTextArea alloc] initWithQTextEdit:this];
setView(textView);
[textView release];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QTextEdit::setText(const QString &string)
{
KWQTextArea *textView = (KWQTextArea *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textView setText:string.getNSString()];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QString QTextEdit::text() const
{
KWQTextArea *textView = (KWQTextArea *)getView();
- return QString::fromNSString([textView text]);
+ volatile NSString * volatile text = @"";
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ text = [textView text];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return QString::fromNSString((NSString *)text);
}
QString QTextEdit::textWithHardLineBreaks() const
{
KWQTextArea *textView = (KWQTextArea *)getView();
- return QString::fromNSString([textView textWithHardLineBreaks]);
+ volatile NSString * volatile text = @"";
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ text = [textView textWithHardLineBreaks];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return QString::fromNSString((NSString *)text);
}
void QTextEdit::getCursorPosition(int *paragraph, int *index) const
{
KWQTextArea *textView = (KWQTextArea *)getView();
+ if (index)
+ *index = 0;
+ if (paragraph)
+ *paragraph = 0;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textView getCursorPositionAsIndex:index inParagraph:paragraph];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QTextEdit::setCursorPosition(int paragraph, int index)
{
KWQTextArea *textView = (KWQTextArea *)getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textView setCursorPositionToIndex:index inParagraph:paragraph];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QTextEdit::WrapStyle QTextEdit::wordWrap() const
{
KWQTextArea *textView = (KWQTextArea *)getView();
- return [textView wordWrap] ? WidgetWidth : NoWrap;
+
+ volatile bool wrap = false;
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ wrap = [textView wordWrap];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return wrap ? WidgetWidth : NoWrap;
}
void QTextEdit::setWordWrap(WrapStyle style)
{
KWQTextArea *textView = (KWQTextArea *)getView();
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textView setWordWrap:style == WidgetWidth];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QTextEdit::setTextFormat(TextFormat)
@@ -90,26 +125,41 @@ void QTextEdit::setTabStopWidth(int)
bool QTextEdit::isReadOnly() const
{
KWQTextArea *textView = (KWQTextArea *)getView();
- return ![textView isEditable];
+ volatile bool result = false;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ result = ![textView isEditable];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
void QTextEdit::setReadOnly(bool flag)
{
KWQTextArea *textView = (KWQTextArea *)getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textView setEditable:!flag];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QTextEdit::selectAll()
{
KWQTextArea *textView = (KWQTextArea *)getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textView selectAll];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QTextEdit::setFont(const QFont &font)
{
QWidget::setFont(font);
KWQTextArea *textView = (KWQTextArea *)getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textView setFont:font.getNSFont()];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QTextEdit::clicked()
@@ -121,13 +171,21 @@ void QTextEdit::setAlignment(AlignmentFlags alignment)
{
ASSERT(alignment == AlignLeft || alignment == AlignRight);
KWQTextArea *textArea = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
[textArea setAlignment:(alignment == AlignRight ? NSRightTextAlignment : NSLeftTextAlignment)];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QSize QTextEdit::sizeWithColumnsAndRows(int numColumns, int numRows) const
{
KWQTextArea *textArea = getView();
- NSSize size = [textArea sizeWithColumns:numColumns rows:numRows];
+ NSSize size = {0,0};
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ size = [textArea sizeWithColumns:numColumns rows:numRows];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
return QSize((int)ceil(size.width), (int)ceil(size.height));
}
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index e69beab..4ff2132 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -25,17 +25,17 @@
#import "KWQWidget.h"
-#import "KWQView.h"
-#import "WebCoreFrameView.h"
+#import "KWQExceptions.h"
+#import "KWQKHTMLPart.h"
#import "KWQLogging.h"
+#import "KWQView.h"
#import "KWQWindowWidget.h"
-
+#import "WebCoreBridge.h"
+#import "WebCoreFrameView.h"
#import "khtmlview.h"
#import "render_canvas.h"
#import "render_replaced.h"
#import "render_style.h"
-#import "KWQKHTMLPart.h"
-#import "WebCoreBridge.h"
using khtml::RenderWidget;
@@ -58,7 +58,11 @@ public:
QWidget::QWidget()
: data(new QWidgetPrivate)
{
+ data->view = nil;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
data->view = [[KWQView alloc] initWithWidget:this];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
static QStyle defaultStyle;
data->style = &defaultStyle;
@@ -75,7 +79,10 @@ QWidget::QWidget(NSView *view)
QWidget::~QWidget()
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[data->view release];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
delete data;
}
@@ -92,24 +99,33 @@ void QWidget::resize(int w, int h)
void QWidget::setActiveWindow()
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[KWQKHTMLPart::bridgeForWidget(this) focusWindow];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QWidget::setEnabled(bool enabled)
{
id view = data->view;
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view respondsToSelector:@selector(setEnabled:)]) {
[view setEnabled:enabled];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
bool QWidget::isEnabled() const
{
id view = data->view;
+
+ volatile bool result = true;
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view respondsToSelector:@selector(isEnabled)]) {
- return [view isEnabled];
+ result = [view isEnabled];
}
- return true;
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return result;
}
long QWidget::winId() const
@@ -164,7 +180,13 @@ void QWidget::move(const QPoint &p)
QRect QWidget::frameGeometry() const
{
- return QRect([getOuterView() frame]);
+ QRect rect;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ rect = QRect([getOuterView() frame]);
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return rect;
}
int QWidget::baselinePosition() const
@@ -175,12 +197,15 @@ int QWidget::baselinePosition() const
bool QWidget::hasFocus() const
{
NSView *view = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSView *firstResponder = [KWQKHTMLPart::bridgeForWidget(this) firstResponder];
+
if (!firstResponder) {
- return false;
+ KWQ_UNBLOCK_RETURN_VALUE(false, bool);
}
if (firstResponder == view) {
- return true;
+ KWQ_UNBLOCK_RETURN_VALUE(true, bool);
}
// Some widgets, like text fields, secure text fields, text areas, and selects
@@ -192,8 +217,9 @@ bool QWidget::hasFocus() const
[firstResponder isKindOfClass:[NSView class]] &&
[(NSView *)firstResponder isDescendantOf:view]) {
// Return true when the first responder is a subview of this widget's view
- return true;
+ KWQ_UNBLOCK_RETURN_VALUE(true, bool);
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
return false;
}
@@ -219,9 +245,12 @@ void QWidget::setFocus()
}
NSView *view = getView();
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view acceptsFirstResponder]) {
[KWQKHTMLPart::bridgeForWidget(this) makeFirstResponder:view];
}
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QWidget::clearFocus()
@@ -253,11 +282,14 @@ QWidget::FocusPolicy QWidget::focusPolicy() const
if (!isEnabled())
return NoFocus;
-
+
+ volatile QWidget::FocusPolicy policy = TabFocus;
+ KWQ_BLOCK_NS_EXCEPTIONS;
if (![getView() acceptsFirstResponder])
- return NoFocus;
+ policy = NoFocus;
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
- return TabFocus;
+ return policy;
}
const QPalette& QWidget::palette() const
@@ -308,31 +340,44 @@ void QWidget::constPolish() const
bool QWidget::isVisible() const
{
// FIXME - rewrite interms of top level widget?
- return [[KWQKHTMLPart::bridgeForWidget(this) window] isVisible];
+
+ volatile bool visible = false;
+ KWQ_BLOCK_NS_EXCEPTIONS;
+ visible = [[KWQKHTMLPart::bridgeForWidget(this) window] isVisible];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return visible;
}
void QWidget::setCursor(const QCursor &cur)
{
- id view = data->view;
+ volatile id view = data->view;
while (view) {
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view respondsToSelector:@selector(setDocumentCursor:)]) {
[view setDocumentCursor:cur.handle()];
break;
}
view = [view superview];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
}
QCursor QWidget::cursor()
{
- id view = data->view;
+ volatile id view = data->view;
+ QCursor cursor;
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
while (view) {
if ([view respondsToSelector:@selector(documentCursor)]) {
- return [view documentCursor];
+ cursor = QCursor([view documentCursor]);
}
view = [view superview];
}
- return QCursor();
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return cursor;
}
void QWidget::unsetCursor()
@@ -358,13 +403,19 @@ bool QWidget::hasMouseTracking() const
void QWidget::setFrameGeometry(const QRect &rect)
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[getOuterView() setFrame:rect];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
QPoint QWidget::mapFromGlobal(const QPoint &p) const
{
- NSPoint bp;
+ NSPoint bp = {0,0};
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
bp = [[KWQKHTMLPart::bridgeForWidget(this) window] convertScreenToBase:[data->view convertPoint:p toView:nil]];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
return QPoint(bp);
}
@@ -379,8 +430,10 @@ void QWidget::setView(NSView *view)
return;
}
+ KWQ_BLOCK_NS_EXCEPTIONS;
[data->view release];
data->view = [view retain];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
NSView *QWidget::getOuterView() const
@@ -388,23 +441,31 @@ NSView *QWidget::getOuterView() const
// A QScrollView is a widget normally used to represent a frame.
// If this widget's view is a WebCoreFrameView the we resize its containing view, a WebFrameView.
// The scroll view contained by the WebFrameView will be autosized.
- NSView *view = data->view;
+ volatile NSView * volatile view = data->view;
ASSERT(view);
+
+ KWQ_BLOCK_NS_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
view = [view superview];
ASSERT(view);
}
- return view;
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
+
+ return (NSView *)view;
}
void QWidget::lockDrawingFocus()
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[getView() lockFocus];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QWidget::unlockDrawingFocus()
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
[getView() unlockFocus];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QWidget::disableFlushDrawing()
@@ -412,7 +473,9 @@ void QWidget::disableFlushDrawing()
// It's OK to use the real window here, because if the view's not
// in the view hierarchy, then we don't actually want to affect
// flushing.
+ KWQ_BLOCK_NS_EXCEPTIONS;
[[getView() window] disableFlushWindow];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QWidget::enableFlushDrawing()
@@ -420,14 +483,18 @@ void QWidget::enableFlushDrawing()
// It's OK to use the real window here, because if the view's not
// in the view hierarchy, then we don't actually want to affect
// flushing.
+ KWQ_BLOCK_NS_EXCEPTIONS;
NSWindow *window = [getView() window];
[window enableFlushWindow];
[window flushWindow];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QWidget::setDrawingAlpha(float alpha)
{
+ KWQ_BLOCK_NS_EXCEPTIONS;
CGContextSetAlpha((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], alpha);
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QWidget::paint(QPainter *p, const QRect &r)
@@ -438,7 +505,9 @@ void QWidget::paint(QPainter *p, const QRect &r)
NSView *view = getOuterView();
// KWQTextArea and KWQTextField both rely on the fact that we use this particular
// NSView display method. If you change this, be sure to update them as well.
+ KWQ_BLOCK_NS_EXCEPTIONS;
[view displayRectIgnoringOpacity:[view convertRect:r fromView:[view superview]]];
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
void QWidget::sendConsumedMouseUp()
@@ -446,7 +515,9 @@ void QWidget::sendConsumedMouseUp()
khtml::RenderWidget *widget = const_cast<khtml::RenderWidget *>
(static_cast<const khtml::RenderWidget *>(eventFilterObject()));
+ KWQ_BLOCK_NS_EXCEPTIONS;
widget->sendConsumedMouseUp(QPoint([[NSApp currentEvent] locationInWindow]),
// FIXME: should send real state and button
0, 0);
+ KWQ_UNBLOCK_NS_EXCEPTIONS;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list