Commit 4b3688bc authored by hyatt's avatar hyatt

Eliminate QSize and add the new class IntSize in the

        platform subdirectory.  Factor out the Objective-C portion
        of IntSize into a platform-specific IntSize.mm that resides
        in the mac subdirectory.

        Win32 can just compile IntSize.cpp and doesn't need any
        platform-specific extension here.
        
        Reviewed by darin

        * WebCore.xcodeproj/project.pbxproj:
        * kcanvas/KCanvasImage.h:
        * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
        (KCanvasImageQuartz::init):
        (KCanvasImageQuartz::size):
        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
        (KRenderingDeviceQuartz::contextForImage):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/ecma/kjs_html.cpp:
        (KJS::Image::getValueProperty):
        * khtml/ecma/kjs_window.cpp:
        (KJS::WindowFunc::callAsFunction):
        * khtml/misc/CachedImage.cpp:
        (khtml::CachedImage::pixmap_size):
        (khtml::CachedImage::data):
        * khtml/misc/CachedImage.h:
        * khtml/misc/CachedImageCallback.cpp:
        (khtml::CachedImageCallback::notifyUpdate):
        (khtml::CachedImageCallback::notifyFinished):
        * khtml/rendering/render_applet.cpp:
        (RenderApplet::createWidgetIfNecessary):
        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::calcMinMaxWidth):
        (RenderFileButton::calcMinMaxWidth):
        (RenderSelect::layout):
        (RenderTextArea::calcMinMaxWidth):
        (RenderSlider::calcMinMaxWidth):
        * khtml/rendering/render_image.cpp:
        (RenderImage::paint):
        * khtml/rendering/render_object.cpp:
        (RenderObject::paintBorder):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::borderTopLeftRadius):
        (khtml::RenderStyle::borderTopRightRadius):
        (khtml::RenderStyle::borderBottomLeftRadius):
        (khtml::RenderStyle::borderBottomRightRadius):
        (khtml::RenderStyle::setBorderTopLeftRadius):
        (khtml::RenderStyle::setBorderTopRightRadius):
        (khtml::RenderStyle::setBorderBottomLeftRadius):
        (khtml::RenderStyle::setBorderBottomRightRadius):
        (khtml::RenderStyle::setBorderRadius):
        (khtml::RenderStyle::initialBorderRadius):
        * khtml/rendering/render_theme_mac.h:
        * khtml/rendering/render_theme_mac.mm:
        (khtml::RenderThemeMac::inflateRect):
        (khtml::RenderThemeMac::setControlSize):
        (khtml::RenderThemeMac::sizeForFont):
        (khtml::RenderThemeMac::setSizeFromFont):
        (khtml::RenderThemeMac::checkboxSizes):
        (khtml::RenderThemeMac::setCheckboxCellState):
        (khtml::RenderThemeMac::radioSizes):
        (khtml::RenderThemeMac::setRadioCellState):
        (khtml::RenderThemeMac::buttonSizes):
        (khtml::RenderThemeMac::setButtonCellState):
        (khtml::RenderThemeMac::paintButton):
        * ksvg2/svg/SVGMaskElementImpl.cpp:
        (KSVG::SVGMaskElementImpl::attributeChanged):
        (KSVG::SVGMaskElementImpl::drawMaskerContent):
        * ksvg2/svg/SVGPatternElementImpl.cpp:
        (SVGPatternElementImpl::drawPatternContentIntoTile):
        (SVGPatternElementImpl::notifyAttributeChange):
        * ksvg2/svg/SVGPatternElementImpl.h:
        * kwq/KWQComboBox.h:
        * kwq/KWQComboBox.mm:
        (QComboBox::sizeHint):
        * kwq/KWQFileButton.h:
        * kwq/KWQFileButton.mm:
        (KWQFileButton::sizeForCharacterWidth):
        * kwq/KWQFontMetrics.h:
        * kwq/KWQFontMetrics.mm:
        (QFontMetrics::size):
        * kwq/KWQKJavaAppletWidget.h:
        * kwq/KWQKJavaAppletWidget.mm:
        (KJavaAppletWidget::KJavaAppletWidget):
        * kwq/KWQLineEdit.h:
        * kwq/KWQLineEdit.mm:
        (QLineEdit::sizeForCharacterWidth):
        * kwq/KWQListBox.h:
        * kwq/KWQListBox.mm:
        (QListBox::sizeForNumberOfLines):
        * kwq/KWQObject.h:
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::addRoundedRectClip):
        * kwq/KWQPixmap.h:
        * kwq/KWQPixmap.mm:
        (QPixmap::QPixmap):
        (QPixmap::size):
        (QPixmap::resize):
        * kwq/KWQRect.h:
        * kwq/KWQRect.mm:
        (QRect::QRect):
        (QRect::size):
        * kwq/KWQSize.h: Removed.
        * kwq/KWQSize.mm: Removed.
        * kwq/KWQSizeF.h:
        * kwq/KWQSizeF.mm:
        (QSizeF::QSizeF):
        * kwq/KWQSlider.h:
        * kwq/KWQSlider.mm:
        (QSlider::sizeHint):
        * kwq/KWQStyle.cpp:
        (QStyle::sizeFromContents):
        * kwq/KWQStyle.h:
        * kwq/KWQTextEdit.h:
        * kwq/KWQTextEdit.mm:
        (QTextEdit::sizeWithColumnsAndRows):
        * kwq/KWQWidget.h:
        * kwq/KWQWidget.mm:
        (QWidget::sizeHint):
        (QWidget::size):
        (QWidget::resize):
        * kwq/KWQWindowWidget.h:
        * kwq/KWQWindowWidget.mm:
        (KWQWindowWidget::sizeHint):
        * platform: Added.
        * platform/IntSize.cpp: Added.
        (WebCore::IntSize::IntSize):
        (WebCore::IntSize::isValid):
        (WebCore::IntSize::expandedTo):
        (WebCore::operator+):
        (WebCore::operator==):
        (WebCore::operator!=):
        * platform/IntSize.h: Added.
        * platform/mac: Added.
        * platform/mac/IntSize.mm: Added.
        (WebCore::IntSize::IntSize):
        (WebCore::IntSize::operator NSSize):
        (WebCore::IntSize::operator CGSize):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 136b90c8
2006-01-13 David Hyatt <hyatt@apple.com>
Eliminate QSize and add the new class IntSize in the
platform subdirectory. Factor out the Objective-C portion
of IntSize into a platform-specific IntSize.mm that resides
in the mac subdirectory.
Win32 can just compile IntSize.cpp and doesn't need any
platform-specific extension here.
Reviewed by darin
* WebCore.xcodeproj/project.pbxproj:
* kcanvas/KCanvasImage.h:
* kcanvas/device/quartz/KCanvasResourcesQuartz.h:
(KCanvasImageQuartz::init):
(KCanvasImageQuartz::size):
* kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
(KRenderingDeviceQuartz::contextForImage):
* khtml/css/cssstyleselector.cpp:
(khtml::CSSStyleSelector::applyProperty):
* khtml/ecma/kjs_html.cpp:
(KJS::Image::getValueProperty):
* khtml/ecma/kjs_window.cpp:
(KJS::WindowFunc::callAsFunction):
* khtml/misc/CachedImage.cpp:
(khtml::CachedImage::pixmap_size):
(khtml::CachedImage::data):
* khtml/misc/CachedImage.h:
* khtml/misc/CachedImageCallback.cpp:
(khtml::CachedImageCallback::notifyUpdate):
(khtml::CachedImageCallback::notifyFinished):
* khtml/rendering/render_applet.cpp:
(RenderApplet::createWidgetIfNecessary):
* khtml/rendering/render_form.cpp:
(RenderLineEdit::calcMinMaxWidth):
(RenderFileButton::calcMinMaxWidth):
(RenderSelect::layout):
(RenderTextArea::calcMinMaxWidth):
(RenderSlider::calcMinMaxWidth):
* khtml/rendering/render_image.cpp:
(RenderImage::paint):
* khtml/rendering/render_object.cpp:
(RenderObject::paintBorder):
* khtml/rendering/render_style.h:
(khtml::RenderStyle::borderTopLeftRadius):
(khtml::RenderStyle::borderTopRightRadius):
(khtml::RenderStyle::borderBottomLeftRadius):
(khtml::RenderStyle::borderBottomRightRadius):
(khtml::RenderStyle::setBorderTopLeftRadius):
(khtml::RenderStyle::setBorderTopRightRadius):
(khtml::RenderStyle::setBorderBottomLeftRadius):
(khtml::RenderStyle::setBorderBottomRightRadius):
(khtml::RenderStyle::setBorderRadius):
(khtml::RenderStyle::initialBorderRadius):
* khtml/rendering/render_theme_mac.h:
* khtml/rendering/render_theme_mac.mm:
(khtml::RenderThemeMac::inflateRect):
(khtml::RenderThemeMac::setControlSize):
(khtml::RenderThemeMac::sizeForFont):
(khtml::RenderThemeMac::setSizeFromFont):
(khtml::RenderThemeMac::checkboxSizes):
(khtml::RenderThemeMac::setCheckboxCellState):
(khtml::RenderThemeMac::radioSizes):
(khtml::RenderThemeMac::setRadioCellState):
(khtml::RenderThemeMac::buttonSizes):
(khtml::RenderThemeMac::setButtonCellState):
(khtml::RenderThemeMac::paintButton):
* ksvg2/svg/SVGMaskElementImpl.cpp:
(KSVG::SVGMaskElementImpl::attributeChanged):
(KSVG::SVGMaskElementImpl::drawMaskerContent):
* ksvg2/svg/SVGPatternElementImpl.cpp:
(SVGPatternElementImpl::drawPatternContentIntoTile):
(SVGPatternElementImpl::notifyAttributeChange):
* ksvg2/svg/SVGPatternElementImpl.h:
* kwq/KWQComboBox.h:
* kwq/KWQComboBox.mm:
(QComboBox::sizeHint):
* kwq/KWQFileButton.h:
* kwq/KWQFileButton.mm:
(KWQFileButton::sizeForCharacterWidth):
* kwq/KWQFontMetrics.h:
* kwq/KWQFontMetrics.mm:
(QFontMetrics::size):
* kwq/KWQKJavaAppletWidget.h:
* kwq/KWQKJavaAppletWidget.mm:
(KJavaAppletWidget::KJavaAppletWidget):
* kwq/KWQLineEdit.h:
* kwq/KWQLineEdit.mm:
(QLineEdit::sizeForCharacterWidth):
* kwq/KWQListBox.h:
* kwq/KWQListBox.mm:
(QListBox::sizeForNumberOfLines):
* kwq/KWQObject.h:
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(QPainter::addRoundedRectClip):
* kwq/KWQPixmap.h:
* kwq/KWQPixmap.mm:
(QPixmap::QPixmap):
(QPixmap::size):
(QPixmap::resize):
* kwq/KWQRect.h:
* kwq/KWQRect.mm:
(QRect::QRect):
(QRect::size):
* kwq/KWQSize.h: Removed.
* kwq/KWQSize.mm: Removed.
* kwq/KWQSizeF.h:
* kwq/KWQSizeF.mm:
(QSizeF::QSizeF):
* kwq/KWQSlider.h:
* kwq/KWQSlider.mm:
(QSlider::sizeHint):
* kwq/KWQStyle.cpp:
(QStyle::sizeFromContents):
* kwq/KWQStyle.h:
* kwq/KWQTextEdit.h:
* kwq/KWQTextEdit.mm:
(QTextEdit::sizeWithColumnsAndRows):
* kwq/KWQWidget.h:
* kwq/KWQWidget.mm:
(QWidget::sizeHint):
(QWidget::size):
(QWidget::resize):
* kwq/KWQWindowWidget.h:
* kwq/KWQWindowWidget.mm:
(KWQWindowWidget::sizeHint):
* platform: Added.
* platform/IntSize.cpp: Added.
(WebCore::IntSize::IntSize):
(WebCore::IntSize::isValid):
(WebCore::IntSize::expandedTo):
(WebCore::operator+):
(WebCore::operator==):
(WebCore::operator!=):
* platform/IntSize.h: Added.
* platform/mac: Added.
* platform/mac/IntSize.mm: Added.
(WebCore::IntSize::IntSize):
(WebCore::IntSize::operator NSSize):
(WebCore::IntSize::operator CGSize):
2006-01-13 Maks Orlovich <maksim@kde.org>
Reviewed, redone a bit, and landed by Darin (help from Eric too).
......
This diff is collapsed.
......@@ -34,9 +34,9 @@ public:
virtual ~KCanvasImage() { };
virtual void init(const QPixmap &) = 0;
virtual void init(QSize) = 0;
virtual void init(IntSize) = 0;
virtual QSize size() = 0;
virtual IntSize size() = 0;
};
#endif
......
......@@ -72,14 +72,14 @@ public:
KCanvasImageQuartz() : m_cgLayer(0) { }
~KCanvasImageQuartz();
void init(const QPixmap &) { }
void init(QSize size) { m_size = size; }
void init(IntSize size) { m_size = size; }
CGLayerRef cgLayer();
void setCGLayer(CGLayerRef layer);
QSize size() { return m_size; }
IntSize size() { return m_size; }
private:
QSize m_size;
IntSize m_size;
CGLayerRef m_cgLayer;
};
......@@ -158,7 +158,7 @@ KRenderingDeviceContext *KRenderingDeviceQuartz::contextForImage(KCanvasImage *i
if (!cgLayer) {
// FIXME: we might not get back a layer if this is a loaded image
// maybe this logic should go into KCanvasImage?
cgLayer = CGLayerCreateWithContext(currentCGContext(), CGSize(image->size() + QSize(1,1)), NULL); // FIXME + 1 is a hack
cgLayer = CGLayerCreateWithContext(currentCGContext(), CGSize(image->size() + IntSize(1,1)), NULL); // FIXME + 1 is a hack
// FIXME: we should composite the original image onto the layer...
quartzImage->setCGLayer(cgLayer);
CGLayerRelease(cgLayer);
......
......@@ -3521,7 +3521,7 @@ void CSSStyleSelector::applyProperty( int id, CSSValueImpl *value )
else if (height == 0)
width = 0; // Null out the other value.
QSize size(width, height);
IntSize size(width, height);
switch (id) {
case CSS_PROP_BORDER_TOP_LEFT_RADIUS:
style->setBorderTopLeftRadius(size);
......
......@@ -3584,7 +3584,7 @@ JSValue *Image::getValueProperty(ExecState *, int token) const
return jsNumber(width);
int w = 0;
if (img) {
QSize size = img->pixmap_size();
IntSize size = img->pixmap_size();
if (size.isValid())
w = size.width();
}
......@@ -3595,7 +3595,7 @@ JSValue *Image::getValueProperty(ExecState *, int token) const
return jsNumber(height);
int h = 0;
if (img) {
QSize size = img->pixmap_size();
IntSize size = img->pixmap_size();
if (size.isValid())
h = size.height();
}
......
......@@ -1724,7 +1724,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
if(args.size() >= 2 && widget)
{
QWidget * tl = widget->topLevelWidget();
QSize dest = tl->size() + QSize( args[0]->toInt32(exec), args[1]->toInt32(exec) );
IntSize dest = tl->size() + IntSize( args[0]->toInt32(exec), args[1]->toInt32(exec) );
QRect sg = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(tl));
// Security check: within desktop limits and bigger than 100x100 (per spec)
if ( tl->x()+dest.width() <= sg.x()+sg.width() &&
......@@ -1742,7 +1742,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
if(args.size() >= 2 && widget)
{
QWidget * tl = widget->topLevelWidget();
QSize dest = QSize( args[0]->toInt32(exec), args[1]->toInt32(exec) );
IntSize dest = IntSize( args[0]->toInt32(exec), args[1]->toInt32(exec) );
QRect sg = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(tl));
// Security check: within desktop limits and bigger than 100x100 (per spec)
if ( tl->x()+dest.width() <= sg.x()+sg.width() &&
......
......@@ -97,9 +97,9 @@ const QPixmap &CachedImage::pixmap( ) const
return *Cache::nullPixmap;
}
QSize CachedImage::pixmap_size() const
IntSize CachedImage::pixmap_size() const
{
return (p ? p->size() : QSize());
return (p ? p->size() : IntSize());
}
QRect CachedImage::valid_rect() const
......@@ -175,7 +175,7 @@ void CachedImage::data ( QBuffer &_buffer, bool eof )
else
do_notify(*p, p->rect());
QSize s = pixmap_size();
IntSize s = pixmap_size();
setSize(s.width() * s.height() * 2);
}
if (eof) {
......
......@@ -51,7 +51,7 @@ namespace khtml
const QPixmap &pixmap() const;
const QPixmap &tiled_pixmap(const QColor& bg);
QSize pixmap_size() const; // returns the size of the complete (i.e. when finished) loading
IntSize pixmap_size() const; // returns the size of the complete (i.e. when finished) loading
QRect valid_rect() const; // returns the rectangle of pixmap that has been loaded already
void ref(CachedObjectClient *consumer);
......
......@@ -49,7 +49,7 @@ void CachedImageCallback::notifyUpdate()
{
if (cachedImage) {
cachedImage->do_notify (cachedImage->pixmap(), cachedImage->pixmap().rect());
QSize s = cachedImage->pixmap_size();
IntSize s = cachedImage->pixmap_size();
cachedImage->setSize(s.width() * s.height() * 2);
// After receiving the image header we are guaranteed to know
......@@ -84,7 +84,7 @@ void CachedImageCallback::notifyFinished()
cachedImage->do_notify (cachedImage->pixmap(), cachedImage->pixmap().rect());
cachedImage->m_loading = false;
cachedImage->checkNotify();
QSize s = cachedImage->pixmap_size();
IntSize s = cachedImage->pixmap_size();
cachedImage->setSize(s.width() * s.height() * 2);
Request *r = cachedImage->m_request;
......
......@@ -90,7 +90,7 @@ void RenderApplet::createWidgetIfNecessary()
child = child->nextSibling();
}
setQWidget(new KJavaAppletWidget(QSize(width, height), element()->getDocument()->frame(), m_args));
setQWidget(new KJavaAppletWidget(IntSize(width, height), element()->getDocument()->frame(), m_args));
}
}
}
......
......@@ -266,7 +266,7 @@ void RenderLineEdit::calcMinMaxWidth()
// Let the widget tell us how big it wants to be.
m_updating = true;
int size = element()->size();
QSize s(widget()->sizeForCharacterWidth(size > 0 ? size : 20));
IntSize s(widget()->sizeForCharacterWidth(size > 0 ? size : 20));
m_updating = false;
setIntrinsicWidth( s.width() );
......@@ -547,7 +547,7 @@ void RenderFileButton::calcMinMaxWidth()
// Let the widget tell us how big it wants to be.
int size = element()->size();
QSize s(static_cast<KWQFileButton *>(widget())->sizeForCharacterWidth(size > 0 ? size : 20));
IntSize s(static_cast<KWQFileButton *>(widget())->sizeForCharacterWidth(size > 0 ? size : 20));
setIntrinsicWidth( s.width() );
setIntrinsicHeight( s.height() );
......@@ -817,12 +817,12 @@ void RenderSelect::layout( )
size = kMin(static_cast<QListBox*>(m_widget)->count(), 10U);
// Let the widget tell us how big it wants to be.
QSize s(w->sizeForNumberOfLines(size));
IntSize s(w->sizeForNumberOfLines(size));
setIntrinsicWidth( s.width() );
setIntrinsicHeight( s.height() );
}
else {
QSize s(m_widget->sizeHint());
IntSize s(m_widget->sizeHint());
setIntrinsicWidth( s.width() );
setIntrinsicHeight( s.height() );
}
......@@ -1012,7 +1012,7 @@ void RenderTextArea::calcMinMaxWidth()
KHTMLAssert( !minMaxKnown() );
QTextEdit* w = static_cast<QTextEdit*>(m_widget);
QSize size(w->sizeWithColumnsAndRows(kMax(element()->cols(), 1), kMax(element()->rows(), 1)));
IntSize size(w->sizeWithColumnsAndRows(kMax(element()->cols(), 1), kMax(element()->rows(), 1)));
setIntrinsicWidth( size.width() );
setIntrinsicHeight( size.height() );
......@@ -1160,13 +1160,13 @@ void RenderSlider::calcMinMaxWidth()
KHTMLAssert(!minMaxKnown());
// Let the widget tell us how big it wants to be.
QSize s(widget()->sizeHint());
IntSize s(widget()->sizeHint());
bool widthSet = !style()->width().isAuto();
bool heightSet = !style()->height().isAuto();
if (heightSet && !widthSet) {
// Flip the intrinsic dimensions.
int barLength = s.width();
s = QSize(s.height(), barLength);
s = IntSize(s.height(), barLength);
}
setIntrinsicWidth(s.width());
setIntrinsicHeight(s.height());
......
......@@ -284,7 +284,7 @@ void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
if ( (cWidth != intrinsicWidth() || cHeight != intrinsicHeight()) &&
pix.width() > 0 && pix.height() > 0 && image->valid_rect().isValid())
{
QSize tintSize;
IntSize tintSize;
if (resizeCache.isNull() && cWidth && cHeight)
{
QRect scaledrect(image->valid_rect());
......@@ -303,9 +303,9 @@ void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
// sometimes scaledrect.width/height are off by one because
// of rounding errors. if the image is fully loaded, we
// make sure that we don't do unnecessary resizes during painting
QSize s(scaledrect.size());
if(image->valid_rect().size() == QSize( intrinsicWidth(), intrinsicHeight() )) // fully loaded
s = QSize(cWidth, cHeight);
IntSize s(scaledrect.size());
if(image->valid_rect().size() == IntSize( intrinsicWidth(), intrinsicHeight() )) // fully loaded
s = IntSize(cWidth, cHeight);
if(QABS(s.width() - cWidth) < 2) // rounding errors
s.setWidth(cWidth);
if(resizeCache.size() != s)
......
......@@ -1158,10 +1158,10 @@ void RenderObject::paintBorder(QPainter *p, int _tx, int _ty, int w, int h, cons
// values and our width/height values to make sure the curves can all fit. If not, then we won't paint
// any border radii.
bool render_radii = false;
QSize topLeft = style->borderTopLeftRadius();
QSize topRight = style->borderTopRightRadius();
QSize bottomLeft = style->borderBottomLeftRadius();
QSize bottomRight = style->borderBottomRightRadius();
IntSize topLeft = style->borderTopLeftRadius();
IntSize topRight = style->borderTopRightRadius();
IntSize bottomLeft = style->borderBottomLeftRadius();
IntSize bottomRight = style->borderBottomRightRadius();
if (style->hasBorderRadius()) {
int requiredWidth = kMax(topLeft.width() + topRight.width(), bottomLeft.width() + bottomRight.width());
......
......@@ -239,10 +239,10 @@ public:
BorderImage image;
QSize topLeft;
QSize topRight;
QSize bottomLeft;
QSize bottomRight;
IntSize topLeft;
IntSize topRight;
IntSize bottomLeft;
IntSize bottomRight;
bool hasBorder() const
{
......@@ -1141,10 +1141,10 @@ public:
const BorderImage& borderImage() const { return surround->border.image; }
QSize borderTopLeftRadius() const { return surround->border.topLeft; }
QSize borderTopRightRadius() const { return surround->border.topRight; }
QSize borderBottomLeftRadius() const { return surround->border.bottomLeft; }
QSize borderBottomRightRadius() const { return surround->border.bottomRight; }
IntSize borderTopLeftRadius() const { return surround->border.topLeft; }
IntSize borderTopRightRadius() const { return surround->border.topRight; }
IntSize borderBottomLeftRadius() const { return surround->border.bottomLeft; }
IntSize borderBottomRightRadius() const { return surround->border.bottomRight; }
bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); }
......@@ -1382,11 +1382,11 @@ public:
void setBorderImage(const BorderImage& b) { SET_VAR(surround, border.image, b) }
void setBorderTopLeftRadius(const QSize& s) { SET_VAR(surround, border.topLeft, s) }
void setBorderTopRightRadius(const QSize& s) { SET_VAR(surround, border.topRight, s) }
void setBorderBottomLeftRadius(const QSize& s) { SET_VAR(surround, border.bottomLeft, s) }
void setBorderBottomRightRadius(const QSize& s) { SET_VAR(surround, border.bottomRight, s) }
void setBorderRadius(const QSize& s) {
void setBorderTopLeftRadius(const IntSize& s) { SET_VAR(surround, border.topLeft, s) }
void setBorderTopRightRadius(const IntSize& s) { SET_VAR(surround, border.topRight, s) }
void setBorderBottomLeftRadius(const IntSize& s) { SET_VAR(surround, border.bottomLeft, s) }
void setBorderBottomRightRadius(const IntSize& s) { SET_VAR(surround, border.bottomRight, s) }
void setBorderRadius(const IntSize& s) {
setBorderTopLeftRadius(s); setBorderTopRightRadius(s); setBorderBottomLeftRadius(s); setBorderBottomRightRadius(s);
}
......@@ -1594,7 +1594,7 @@ public:
static bool initialBorderCollapse() { return false; }
static EBorderStyle initialBorderStyle() { return BNONE; }
static BorderImage initialBorderImage() { return BorderImage(); }
static QSize initialBorderRadius() { return QSize(0,0); }
static IntSize initialBorderRadius() { return IntSize(0,0); }
static ECaptionSide initialCaptionSide() { return CAPTOP; }
static EClear initialClear() { return CNONE; }
static EDirection initialDirection() { return LTR; }
......
......@@ -60,13 +60,13 @@ protected:
virtual void setButtonSize(RenderStyle* style) const;
private:
QRect inflateRect(const QRect& r, const QSize& size, const int* margins) const;
QRect inflateRect(const QRect& r, const IntSize& size, const int* margins) const;
// Get the control size based off the font. Used by some of the controls (like buttons).
NSControlSize controlSizeForFont(RenderStyle* style) const;
void setControlSize(NSCell* cell, const QSize* sizes, const QSize& minSize);
void setSizeFromFont(RenderStyle* style, const QSize* sizes) const;
QSize sizeForFont(RenderStyle* style, const QSize* sizes) const;
void setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minSize);
void setSizeFromFont(RenderStyle* style, const IntSize* sizes) const;
IntSize sizeForFont(RenderStyle* style, const IntSize* sizes) const;
void setFontFromControlSize(CSSStyleSelector* selector, RenderStyle* style, NSControlSize size) const;
void addIntrinsicMargins(RenderStyle* style, NSControlSize size) const;
......@@ -77,16 +77,16 @@ private:
void updatePressedState(NSCell* cell, const RenderObject* o);
// Helpers for adjusting appearance and for painting
const QSize* checkboxSizes() const;
const IntSize* checkboxSizes() const;
const int* checkboxMargins() const;
void setCheckboxCellState(const RenderObject* o, const QRect& r);
const QSize* radioSizes() const;
const IntSize* radioSizes() const;
const int* radioMargins() const;
void setRadioCellState(const RenderObject* o, const QRect& r);
void setButtonPaddingFromControlSize(RenderStyle* style, NSControlSize size) const;
const QSize* buttonSizes() const;
const IntSize* buttonSizes() const;
const int* buttonMargins() const;
void setButtonCellState(const RenderObject* o, const QRect& r);
......
......@@ -91,7 +91,7 @@ void RenderThemeMac::adjustRepaintRect(const RenderObject* o, QRect& r)
}
}
QRect RenderThemeMac::inflateRect(const QRect& r, const QSize& size, const int* margins) const
QRect RenderThemeMac::inflateRect(const QRect& r, const IntSize& size, const int* margins) const
{
// Only do the inflation if the available width/height are too small. Otherwise try to
// fit the glow/check space into the available box's width/height.
......@@ -181,7 +181,7 @@ NSControlSize RenderThemeMac::controlSizeForFont(RenderStyle* style) const
return NSMiniControlSize;
}
void RenderThemeMac::setControlSize(NSCell* cell, const QSize* sizes, const QSize& minSize)
void RenderThemeMac::setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minSize)
{
NSControlSize size;
if (minSize.width() >= sizes[NSRegularControlSize].width() &&
......@@ -196,15 +196,15 @@ void RenderThemeMac::setControlSize(NSCell* cell, const QSize* sizes, const QSiz
[cell setControlSize:size];
}
QSize RenderThemeMac::sizeForFont(RenderStyle* style, const QSize* sizes) const
IntSize RenderThemeMac::sizeForFont(RenderStyle* style, const IntSize* sizes) const
{
return sizes[controlSizeForFont(style)];
}
void RenderThemeMac::setSizeFromFont(RenderStyle* style, const QSize* sizes) const
void RenderThemeMac::setSizeFromFont(RenderStyle* style, const IntSize* sizes) const
{
// FIXME: Check is flawed, since it doesn't take min-width/max-width into account.
QSize size = sizeForFont(style, sizes);
IntSize size = sizeForFont(style, sizes);
if (style->width().isIntrinsicOrAuto() && size.width() > 0)
style->setWidth(Length(size.width(), Fixed));
if (style->height().isAuto() && size.height() > 0)
......@@ -264,9 +264,9 @@ bool RenderThemeMac::paintCheckbox(RenderObject* o, const RenderObject::PaintInf
return false;
}
const QSize* RenderThemeMac::checkboxSizes() const
const IntSize* RenderThemeMac::checkboxSizes() const
{
static const QSize sizes[3] = { QSize(14, 14), QSize(12, 12), QSize(10, 10) };
static const IntSize sizes[3] = { IntSize(14, 14), IntSize(12, 12), IntSize(10, 10) };
return sizes;
}
......@@ -292,7 +292,7 @@ void RenderThemeMac::setCheckboxCellState(const RenderObject* o, const QRect& r)
}
// Set the control size based off the rectangle we're painting into.
setControlSize(checkbox, checkboxSizes(), QSize(r.width(), r.height()));
setControlSize(checkbox, checkboxSizes(), IntSize(r.width(), r.height()));
// Update the various states we respond to.
updateCheckedState(checkbox, o);
......@@ -325,9 +325,9 @@ bool RenderThemeMac::paintRadio(RenderObject* o, const RenderObject::PaintInfo&
return false;
}
const QSize* RenderThemeMac::radioSizes() const
const IntSize* RenderThemeMac::radioSizes() const
{
static const QSize sizes[3] = { QSize(14, 15), QSize(12, 13), QSize(10, 10) };
static const IntSize sizes[3] = { IntSize(14, 15), IntSize(12, 13), IntSize(10, 10) };
return sizes;
}
......@@ -351,7 +351,7 @@ void RenderThemeMac::setRadioCellState(const RenderObject* o, const QRect& r)
}
// Set the control size based off the rectangle we're painting into.
setControlSize(radio, radioSizes(), QSize(r.width(), r.height()));
setControlSize(radio, radioSizes(), IntSize(r.width(), r.height()));
// Update the various states we respond to.
updateCheckedState(radio, o);
......@@ -432,9 +432,9 @@ void RenderThemeMac::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle*
}
}
const QSize* RenderThemeMac::buttonSizes() const
const IntSize* RenderThemeMac::buttonSizes() const
{
static const QSize sizes[3] = { QSize(0, 21), QSize(0, 18), QSize(0, 15) };
static const IntSize sizes[3] = { IntSize(0, 21), IntSize(0, 18), IntSize(0, 15) };
return sizes;
}
......@@ -476,7 +476,7 @@ void RenderThemeMac::setButtonCellState(const RenderObject* o, const QRect& r)
} else if ([button bezelStyle] != NSRoundedBezelStyle)
[button setBezelStyle:NSRoundedBezelStyle];
setControlSize(button, buttonSizes(), QSize(r.width(), r.height()));
setControlSize(button, buttonSizes(), IntSize(r.width(), r.height()));
// Update the various states we respond to.
updateCheckedState(button, o);
......@@ -492,7 +492,7 @@ bool RenderThemeMac::paintButton(RenderObject* o, const RenderObject::PaintInfo&
// We inflate the rect as needed to account for padding included in the cell to accommodate the button
// shadow. We don't consider this part of the bounds of the control in WebKit.
QSize size = buttonSizes()[[button controlSize]];
IntSize size = buttonSizes()[[button controlSize]];
size.setWidth(r.width());
QRect inflatedRect = r;
if ([button bezelStyle] == NSRoundedBezelStyle) {
......
......@@ -72,7 +72,7 @@ SVGAnimatedLengthImpl *SVGMaskElementImpl::height() const
void SVGMaskElementImpl::attributeChanged(KDOM::AttributeImpl* attr, bool preserveDecls)
{
QSize newSize = QSize(lroundf(width()->baseVal()->value()), lroundf(height()->baseVal()->value()));
IntSize newSize = IntSize(lroundf(width()