[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:52:06 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 947d78cf9befd7494b237f4508fc2e4f2a47164a
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 9 22:14:32 2001 +0000
More rendering/forms fixes.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index 44bcb41..ceb4aff 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -22,7 +22,6 @@
*
* $Id$
*/
-
#include <kdebug.h>
#include <kurl.h>
#include <klocale.h>
@@ -942,6 +941,7 @@ void RenderSelect::layout( )
QSize s(m_widget->sizeHint());
setIntrinsicWidth( s.width() );
setIntrinsicHeight( s.height() );
+ fprintf (stderr, "select box size w %d, h %d\n", s.width(), s.height());
}
/// uuh, ignore the following line..
@@ -1155,12 +1155,21 @@ void RenderTextArea::calcMinMaxWidth()
TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget);
HTMLTextAreaElementImpl* f = static_cast<HTMLTextAreaElementImpl*>(m_element);
QFontMetrics m = fontMetrics(style()->font());
+#ifdef _KWQ_
+ QSize size( QMAX(f->cols(), 1)*m.width('x') + w->frameWidth()*5 +
+ w->verticalScrollBarWidth(),
+ QMAX(f->rows(), 1)*m.height() + w->frameWidth()*3 +
+ (w->wordWrap() == QMultiLineEdit::NoWrap ?
+ w->horizontalScrollBarHeight() : 0)
+ );
+#else
QSize size( QMAX(f->cols(), 1)*m.width('x') + w->frameWidth()*5 +
w->verticalScrollBar()->sizeHint().width(),
QMAX(f->rows(), 1)*m.height() + w->frameWidth()*3 +
(w->wordWrap() == QMultiLineEdit::NoWrap ?
w->horizontalScrollBar()->sizeHint().height() : 0)
);
+#endif
setIntrinsicWidth( size.width() );
setIntrinsicHeight( size.height() );
diff --git a/WebCore/kwq/KWQApplication.h b/WebCore/kwq/KWQApplication.h
index 0fabfc3..1bc9575 100644
--- a/WebCore/kwq/KWQApplication.h
+++ b/WebCore/kwq/KWQApplication.h
@@ -98,7 +98,6 @@ private:
void *globalPool;
#endif
-
}; // class QApplication =======================================================
#endif
diff --git a/WebCore/kwq/KWQComboBox.h b/WebCore/kwq/KWQComboBox.h
index 3043555..0a0c56b 100644
--- a/WebCore/kwq/KWQComboBox.h
+++ b/WebCore/kwq/KWQComboBox.h
@@ -58,6 +58,7 @@ public:
void insertItem(const QString &text, int index=-1);
void clear();
virtual void setCurrentItem(int);
+ QSize sizeHint() const;
// operators ---------------------------------------------------------------
diff --git a/WebCore/kwq/KWQEvent.mm b/WebCore/kwq/KWQEvent.mm
index ef2caf3..bedb650 100644
--- a/WebCore/kwq/KWQEvent.mm
+++ b/WebCore/kwq/KWQEvent.mm
@@ -33,13 +33,13 @@ static const QPoint ORIGIN(0,0);
QEvent::QEvent(Type)
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
QEvent::~QEvent()
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
diff --git a/WebCore/kwq/KWQKCharsets.mm b/WebCore/kwq/KWQKCharsets.mm
index 5fddd32..4e1d574 100644
--- a/WebCore/kwq/KWQKCharsets.mm
+++ b/WebCore/kwq/KWQKCharsets.mm
@@ -77,7 +77,7 @@ void KCharsets::setQFont(QFont &font, QFont::CharSet) const
// FIXME: do we need a real implementation here?
// [kocienda: 2001-11-05] I don't think we need to implement this
// do nothing
- _logNeverImplemented();
+// _logNeverImplemented();
}
void KCharsets::setQFont(QFont &, QString) const
@@ -85,7 +85,7 @@ void KCharsets::setQFont(QFont &, QString) const
// FIXME: do we need a real implementation here?
// [kocienda: 2001-11-05] I don't think we need to implement this
// do nothing
- _logNeverImplemented();
+// _logNeverImplemented();
}
QString KCharsets::name(QFont::CharSet)
diff --git a/WebCore/kwq/KWQKPartsEvent.mm b/WebCore/kwq/KWQKPartsEvent.mm
index 9800a6a..af77203 100644
--- a/WebCore/kwq/KWQKPartsEvent.mm
+++ b/WebCore/kwq/KWQKPartsEvent.mm
@@ -45,7 +45,7 @@ bool Event::test(const QEvent *, const char *)
Event::Event(const char *)
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
} // namespace KParts
diff --git a/WebCore/kwq/KWQKloader.mm b/WebCore/kwq/KWQKloader.mm
index 4629c6c..1078ae9 100644
--- a/WebCore/kwq/KWQKloader.mm
+++ b/WebCore/kwq/KWQKloader.mm
@@ -923,6 +923,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
NSLog (@"cacheDataAvailable: Received invalid notication, %@", notificationName);
}
else {
+ NSLog (@"cacheDataAvailable: Received notication, %@", notificationName);
id <WCURICacheData> data = [notification object];
KIO::Job *job = static_cast<KIO::Job *>([data userData]);
m_loader->slotData(job, (const char *)[data cacheData], [data cacheDataSize]);
@@ -936,6 +937,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
NSLog (@"cacheFinished: Received invalid notication, %@", notificationName);
}
else {
+ NSLog (@"cacheFinished: Received notication, %@", notificationName);
// FIXME: need an implementation for this
id <WCURICacheData> data = [notification object];
KIO::Job *job = static_cast<KIO::Job *>([data userData]);
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index 4629c6c..1078ae9 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -923,6 +923,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
NSLog (@"cacheDataAvailable: Received invalid notication, %@", notificationName);
}
else {
+ NSLog (@"cacheDataAvailable: Received notication, %@", notificationName);
id <WCURICacheData> data = [notification object];
KIO::Job *job = static_cast<KIO::Job *>([data userData]);
m_loader->slotData(job, (const char *)[data cacheData], [data cacheDataSize]);
@@ -936,6 +937,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
NSLog (@"cacheFinished: Received invalid notication, %@", notificationName);
}
else {
+ NSLog (@"cacheFinished: Received notication, %@", notificationName);
// FIXME: need an implementation for this
id <WCURICacheData> data = [notification object];
KIO::Job *job = static_cast<KIO::Job *>([data userData]);
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index 4629c6c..1078ae9 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -923,6 +923,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
NSLog (@"cacheDataAvailable: Received invalid notication, %@", notificationName);
}
else {
+ NSLog (@"cacheDataAvailable: Received notication, %@", notificationName);
id <WCURICacheData> data = [notification object];
KIO::Job *job = static_cast<KIO::Job *>([data userData]);
m_loader->slotData(job, (const char *)[data cacheData], [data cacheDataSize]);
@@ -936,6 +937,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
NSLog (@"cacheFinished: Received invalid notication, %@", notificationName);
}
else {
+ NSLog (@"cacheFinished: Received notication, %@", notificationName);
// FIXME: need an implementation for this
id <WCURICacheData> data = [notification object];
KIO::Job *job = static_cast<KIO::Job *>([data userData]);
diff --git a/WebCore/kwq/KWQPainter.h b/WebCore/kwq/KWQPainter.h
index a1d54b0..0a08ccf 100644
--- a/WebCore/kwq/KWQPainter.h
+++ b/WebCore/kwq/KWQPainter.h
@@ -50,6 +50,7 @@ class QPainterPrivate;
class QWMatrix {
friend QPainter;
+friend QPixmap;
public:
// typedefs ----------------------------------------------------------------
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 5365b29..b4dd9cd 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -380,18 +380,9 @@ void QPainter::drawPixmap(const QPoint &p, const QPixmap &pix, const QRect &r)
void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
int sx, int sy, int sw, int sh )
{
- NSSize originalSize;
-
_lockFocus();
if (pixmap.nsimage != nil){
- if (pixmap.xmatrix.empty == FALSE){
- originalSize = [pixmap.nsimage size];
- [pixmap.nsimage setScalesWhenResized: YES];
- [pixmap.nsimage setSize: NSMakeSize (originalSize.width * pixmap.xmatrix.sx,
- originalSize.height * pixmap.xmatrix.sy)];
- }
-
if (sw == -1)
sw = (int)[pixmap.nsimage size].width;
if (sh == -1)
@@ -400,9 +391,6 @@ void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
fromRect: NSMakeRect(sx, sy, sw, sh)
operation: NSCompositeSourceOver // Renders transparency correctly
fraction: 1.0];
-
- if (pixmap.xmatrix.empty == FALSE)
- [pixmap.nsimage setSize: originalSize];
}
_unlockFocus();
diff --git a/WebCore/kwq/KWQPixmap.h b/WebCore/kwq/KWQPixmap.h
index 6120875..cfcaf62 100644
--- a/WebCore/kwq/KWQPixmap.h
+++ b/WebCore/kwq/KWQPixmap.h
@@ -93,7 +93,6 @@ public:
#else
void *nsimage;
#endif
- QWMatrix xmatrix;
#endif
}; // class QPixmap ============================================================
diff --git a/WebCore/kwq/KWQPixmap.mm b/WebCore/kwq/KWQPixmap.mm
index 65e0f82..f89683f 100644
--- a/WebCore/kwq/KWQPixmap.mm
+++ b/WebCore/kwq/KWQPixmap.mm
@@ -66,7 +66,13 @@ QPixmap::QPixmap(const QByteArray&bytes)
//NSData *nsdata = [[[NSData alloc] initWithBytesNoCopy: bytes.data() length: bytes.size()] autorelease];
NSData *nsdata = [[[NSData alloc] initWithBytes: bytes.data() length: bytes.size() copy:NO freeWhenDone:NO bytesAreVM:NO] autorelease];
nsimage = [[NSImage alloc] initWithData: nsdata];
+ if (nsimage == nil){
+ NSLog (@"unable to create image");
+ } else {
+ NSLog (@"image created");
+ }
[nsimage setFlipped: YES];
+ [nsimage setScalesWhenResized: YES];
}
@@ -78,11 +84,13 @@ QPixmap::QPixmap(int w, int h)
QPixmap::QPixmap(const QPixmap ©From)
{
- if (copyFrom.nsimage != nil)
- nsimage = [copyFrom.nsimage retain];
+ if (copyFrom.nsimage != nil){
+ // Do a deep copy of the image. This is required because the image
+ // may be transformed, i.e. scaled.
+ nsimage = [copyFrom.nsimage copyWithZone: [copyFrom.nsimage zone]];
+ }
else
nsimage = nil;
- xmatrix = copyFrom.xmatrix;
}
@@ -155,8 +163,14 @@ void QPixmap::resize(int w, int h) {
QPixmap QPixmap::xForm(const QWMatrix &xmatrix) const
{
+ // This function is only called when an image needs to be scaled.
+ // We can depend on render_image.cpp to call resize AFTER
+ // creating a copy of the image to be scaled. So, this
+ // implementation simply returns a copy of the image. Note,
+ // this implementation depends on the implementation of
+ // RenderImage::printObject.
QPixmap xPix = *this;
- xPix.xmatrix = xmatrix;
+ [xPix.nsimage setScalesWhenResized: YES];
return xPix;
}
@@ -173,7 +187,6 @@ QPixmap &QPixmap::operator=(const QPixmap &assignFrom)
return *this;
[nsimage release];
nsimage = [assignFrom.nsimage retain];
- xmatrix = assignFrom.xmatrix;
return *this;
}
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index 371b0c3..be7cdb5 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -187,6 +187,18 @@ void QMultiLineEdit::selectAll()
[textView selectAll];
}
+int QMultiLineEdit::verticalScrollBarWidth() const
+{
+ return (int)[NSScroller scrollerWidth];
+}
+
+
+int QMultiLineEdit::horizontalScrollBarHeight() const
+{
+ return (int)[NSScroller scrollerWidth];
+}
+
+
KEdit::KEdit()
{
diff --git a/WebCore/kwq/KWQView.h b/WebCore/kwq/KWQView.h
index 17a78b0..7283c13 100644
--- a/WebCore/kwq/KWQView.h
+++ b/WebCore/kwq/KWQView.h
@@ -69,6 +69,7 @@ class KHTMLPart;
}
- initWithFrame: (NSRect)r widget: (QWidget *)w;
- (void)setIsFlipped: (bool)flag;
+- (void)setNeedsLayout: (bool)flag;
@end
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index 61c78d7..aa6230c 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -91,6 +91,11 @@
}
+- (void)setNeedsLayout: (bool)flag
+{
+ needsLayout = flag;
+}
+
// This should eventually be removed.
- (void)drawRect:(NSRect)rect {
if (widget != 0l){
@@ -103,7 +108,7 @@
((KHTMLView *)widget)->part()->xmlDocImpl()->renderer()){
if (needsLayout){
((KHTMLView *)widget)->layout(TRUE);
- needsLayout = NO;
+ //needsLayout = NO;
}
}
diff --git a/WebCore/kwq/_KWQOwner.m b/WebCore/kwq/_KWQOwner.m
index b0d5c45..b64de53 100644
--- a/WebCore/kwq/_KWQOwner.m
+++ b/WebCore/kwq/_KWQOwner.m
@@ -23,6 +23,7 @@
subs = [containerView subviews];
htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
[htmlView setURL: url];
+ [htmlView setNeedsLayout: YES];
[containerView setNeedsDisplay: YES];
return self;
diff --git a/WebCore/kwq/kdeui/keditcl.h b/WebCore/kwq/kdeui/keditcl.h
index 02458ab..5c47c8d 100644
--- a/WebCore/kwq/kdeui/keditcl.h
+++ b/WebCore/kwq/kdeui/keditcl.h
@@ -125,6 +125,12 @@ public:
int numLines() const;
void selectAll();
+#ifdef _KWQ_
+ int verticalScrollBarWidth() const;
+ int horizontalScrollBarHeight() const;
+#endif
+
+
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/qapplication.h b/WebCore/kwq/qt/qapplication.h
index 0fabfc3..1bc9575 100644
--- a/WebCore/kwq/qt/qapplication.h
+++ b/WebCore/kwq/qt/qapplication.h
@@ -98,7 +98,6 @@ private:
void *globalPool;
#endif
-
}; // class QApplication =======================================================
#endif
diff --git a/WebCore/kwq/qt/qcombobox.h b/WebCore/kwq/qt/qcombobox.h
index 3043555..0a0c56b 100644
--- a/WebCore/kwq/qt/qcombobox.h
+++ b/WebCore/kwq/qt/qcombobox.h
@@ -58,6 +58,7 @@ public:
void insertItem(const QString &text, int index=-1);
void clear();
virtual void setCurrentItem(int);
+ QSize sizeHint() const;
// operators ---------------------------------------------------------------
diff --git a/WebCore/kwq/qt/qpainter.h b/WebCore/kwq/qt/qpainter.h
index a1d54b0..0a08ccf 100644
--- a/WebCore/kwq/qt/qpainter.h
+++ b/WebCore/kwq/qt/qpainter.h
@@ -50,6 +50,7 @@ class QPainterPrivate;
class QWMatrix {
friend QPainter;
+friend QPixmap;
public:
// typedefs ----------------------------------------------------------------
diff --git a/WebCore/kwq/qt/qpixmap.h b/WebCore/kwq/qt/qpixmap.h
index 6120875..cfcaf62 100644
--- a/WebCore/kwq/qt/qpixmap.h
+++ b/WebCore/kwq/qt/qpixmap.h
@@ -93,7 +93,6 @@ public:
#else
void *nsimage;
#endif
- QWMatrix xmatrix;
#endif
}; // class QPixmap ============================================================
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_form.cpp b/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
index 44bcb41..ceb4aff 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
@@ -22,7 +22,6 @@
*
* $Id$
*/
-
#include <kdebug.h>
#include <kurl.h>
#include <klocale.h>
@@ -942,6 +941,7 @@ void RenderSelect::layout( )
QSize s(m_widget->sizeHint());
setIntrinsicWidth( s.width() );
setIntrinsicHeight( s.height() );
+ fprintf (stderr, "select box size w %d, h %d\n", s.width(), s.height());
}
/// uuh, ignore the following line..
@@ -1155,12 +1155,21 @@ void RenderTextArea::calcMinMaxWidth()
TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget);
HTMLTextAreaElementImpl* f = static_cast<HTMLTextAreaElementImpl*>(m_element);
QFontMetrics m = fontMetrics(style()->font());
+#ifdef _KWQ_
+ QSize size( QMAX(f->cols(), 1)*m.width('x') + w->frameWidth()*5 +
+ w->verticalScrollBarWidth(),
+ QMAX(f->rows(), 1)*m.height() + w->frameWidth()*3 +
+ (w->wordWrap() == QMultiLineEdit::NoWrap ?
+ w->horizontalScrollBarHeight() : 0)
+ );
+#else
QSize size( QMAX(f->cols(), 1)*m.width('x') + w->frameWidth()*5 +
w->verticalScrollBar()->sizeHint().width(),
QMAX(f->rows(), 1)*m.height() + w->frameWidth()*3 +
(w->wordWrap() == QMultiLineEdit::NoWrap ?
w->horizontalScrollBar()->sizeHint().height() : 0)
);
+#endif
setIntrinsicWidth( size.width() );
setIntrinsicHeight( size.height() );
diff --git a/WebCore/src/kwq/KWQEvent.mm b/WebCore/src/kwq/KWQEvent.mm
index ef2caf3..bedb650 100644
--- a/WebCore/src/kwq/KWQEvent.mm
+++ b/WebCore/src/kwq/KWQEvent.mm
@@ -33,13 +33,13 @@ static const QPoint ORIGIN(0,0);
QEvent::QEvent(Type)
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
QEvent::~QEvent()
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
diff --git a/WebCore/src/kwq/KWQKCharsets.mm b/WebCore/src/kwq/KWQKCharsets.mm
index 5fddd32..4e1d574 100644
--- a/WebCore/src/kwq/KWQKCharsets.mm
+++ b/WebCore/src/kwq/KWQKCharsets.mm
@@ -77,7 +77,7 @@ void KCharsets::setQFont(QFont &font, QFont::CharSet) const
// FIXME: do we need a real implementation here?
// [kocienda: 2001-11-05] I don't think we need to implement this
// do nothing
- _logNeverImplemented();
+// _logNeverImplemented();
}
void KCharsets::setQFont(QFont &, QString) const
@@ -85,7 +85,7 @@ void KCharsets::setQFont(QFont &, QString) const
// FIXME: do we need a real implementation here?
// [kocienda: 2001-11-05] I don't think we need to implement this
// do nothing
- _logNeverImplemented();
+// _logNeverImplemented();
}
QString KCharsets::name(QFont::CharSet)
diff --git a/WebCore/src/kwq/KWQKPartsEvent.mm b/WebCore/src/kwq/KWQKPartsEvent.mm
index 9800a6a..af77203 100644
--- a/WebCore/src/kwq/KWQKPartsEvent.mm
+++ b/WebCore/src/kwq/KWQKPartsEvent.mm
@@ -45,7 +45,7 @@ bool Event::test(const QEvent *, const char *)
Event::Event(const char *)
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
} // namespace KParts
diff --git a/WebCore/src/kwq/KWQKloader.mm b/WebCore/src/kwq/KWQKloader.mm
index 4629c6c..1078ae9 100644
--- a/WebCore/src/kwq/KWQKloader.mm
+++ b/WebCore/src/kwq/KWQKloader.mm
@@ -923,6 +923,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
NSLog (@"cacheDataAvailable: Received invalid notication, %@", notificationName);
}
else {
+ NSLog (@"cacheDataAvailable: Received notication, %@", notificationName);
id <WCURICacheData> data = [notification object];
KIO::Job *job = static_cast<KIO::Job *>([data userData]);
m_loader->slotData(job, (const char *)[data cacheData], [data cacheDataSize]);
@@ -936,6 +937,7 @@ void DocLoader::removeCachedObject( CachedObject* o ) const
NSLog (@"cacheFinished: Received invalid notication, %@", notificationName);
}
else {
+ NSLog (@"cacheFinished: Received notication, %@", notificationName);
// FIXME: need an implementation for this
id <WCURICacheData> data = [notification object];
KIO::Job *job = static_cast<KIO::Job *>([data userData]);
diff --git a/WebCore/src/kwq/KWQPainter.mm b/WebCore/src/kwq/KWQPainter.mm
index 5365b29..b4dd9cd 100644
--- a/WebCore/src/kwq/KWQPainter.mm
+++ b/WebCore/src/kwq/KWQPainter.mm
@@ -380,18 +380,9 @@ void QPainter::drawPixmap(const QPoint &p, const QPixmap &pix, const QRect &r)
void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
int sx, int sy, int sw, int sh )
{
- NSSize originalSize;
-
_lockFocus();
if (pixmap.nsimage != nil){
- if (pixmap.xmatrix.empty == FALSE){
- originalSize = [pixmap.nsimage size];
- [pixmap.nsimage setScalesWhenResized: YES];
- [pixmap.nsimage setSize: NSMakeSize (originalSize.width * pixmap.xmatrix.sx,
- originalSize.height * pixmap.xmatrix.sy)];
- }
-
if (sw == -1)
sw = (int)[pixmap.nsimage size].width;
if (sh == -1)
@@ -400,9 +391,6 @@ void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
fromRect: NSMakeRect(sx, sy, sw, sh)
operation: NSCompositeSourceOver // Renders transparency correctly
fraction: 1.0];
-
- if (pixmap.xmatrix.empty == FALSE)
- [pixmap.nsimage setSize: originalSize];
}
_unlockFocus();
diff --git a/WebCore/src/kwq/KWQPixmap.mm b/WebCore/src/kwq/KWQPixmap.mm
index 65e0f82..f89683f 100644
--- a/WebCore/src/kwq/KWQPixmap.mm
+++ b/WebCore/src/kwq/KWQPixmap.mm
@@ -66,7 +66,13 @@ QPixmap::QPixmap(const QByteArray&bytes)
//NSData *nsdata = [[[NSData alloc] initWithBytesNoCopy: bytes.data() length: bytes.size()] autorelease];
NSData *nsdata = [[[NSData alloc] initWithBytes: bytes.data() length: bytes.size() copy:NO freeWhenDone:NO bytesAreVM:NO] autorelease];
nsimage = [[NSImage alloc] initWithData: nsdata];
+ if (nsimage == nil){
+ NSLog (@"unable to create image");
+ } else {
+ NSLog (@"image created");
+ }
[nsimage setFlipped: YES];
+ [nsimage setScalesWhenResized: YES];
}
@@ -78,11 +84,13 @@ QPixmap::QPixmap(int w, int h)
QPixmap::QPixmap(const QPixmap ©From)
{
- if (copyFrom.nsimage != nil)
- nsimage = [copyFrom.nsimage retain];
+ if (copyFrom.nsimage != nil){
+ // Do a deep copy of the image. This is required because the image
+ // may be transformed, i.e. scaled.
+ nsimage = [copyFrom.nsimage copyWithZone: [copyFrom.nsimage zone]];
+ }
else
nsimage = nil;
- xmatrix = copyFrom.xmatrix;
}
@@ -155,8 +163,14 @@ void QPixmap::resize(int w, int h) {
QPixmap QPixmap::xForm(const QWMatrix &xmatrix) const
{
+ // This function is only called when an image needs to be scaled.
+ // We can depend on render_image.cpp to call resize AFTER
+ // creating a copy of the image to be scaled. So, this
+ // implementation simply returns a copy of the image. Note,
+ // this implementation depends on the implementation of
+ // RenderImage::printObject.
QPixmap xPix = *this;
- xPix.xmatrix = xmatrix;
+ [xPix.nsimage setScalesWhenResized: YES];
return xPix;
}
@@ -173,7 +187,6 @@ QPixmap &QPixmap::operator=(const QPixmap &assignFrom)
return *this;
[nsimage release];
nsimage = [assignFrom.nsimage retain];
- xmatrix = assignFrom.xmatrix;
return *this;
}
diff --git a/WebCore/src/kwq/KWQTextEdit.mm b/WebCore/src/kwq/KWQTextEdit.mm
index 371b0c3..be7cdb5 100644
--- a/WebCore/src/kwq/KWQTextEdit.mm
+++ b/WebCore/src/kwq/KWQTextEdit.mm
@@ -187,6 +187,18 @@ void QMultiLineEdit::selectAll()
[textView selectAll];
}
+int QMultiLineEdit::verticalScrollBarWidth() const
+{
+ return (int)[NSScroller scrollerWidth];
+}
+
+
+int QMultiLineEdit::horizontalScrollBarHeight() const
+{
+ return (int)[NSScroller scrollerWidth];
+}
+
+
KEdit::KEdit()
{
diff --git a/WebCore/src/kwq/KWQView.h b/WebCore/src/kwq/KWQView.h
index 17a78b0..7283c13 100644
--- a/WebCore/src/kwq/KWQView.h
+++ b/WebCore/src/kwq/KWQView.h
@@ -69,6 +69,7 @@ class KHTMLPart;
}
- initWithFrame: (NSRect)r widget: (QWidget *)w;
- (void)setIsFlipped: (bool)flag;
+- (void)setNeedsLayout: (bool)flag;
@end
diff --git a/WebCore/src/kwq/KWQView.mm b/WebCore/src/kwq/KWQView.mm
index 61c78d7..aa6230c 100644
--- a/WebCore/src/kwq/KWQView.mm
+++ b/WebCore/src/kwq/KWQView.mm
@@ -91,6 +91,11 @@
}
+- (void)setNeedsLayout: (bool)flag
+{
+ needsLayout = flag;
+}
+
// This should eventually be removed.
- (void)drawRect:(NSRect)rect {
if (widget != 0l){
@@ -103,7 +108,7 @@
((KHTMLView *)widget)->part()->xmlDocImpl()->renderer()){
if (needsLayout){
((KHTMLView *)widget)->layout(TRUE);
- needsLayout = NO;
+ //needsLayout = NO;
}
}
diff --git a/WebCore/src/kwq/_KWQOwner.m b/WebCore/src/kwq/_KWQOwner.m
index b0d5c45..b64de53 100644
--- a/WebCore/src/kwq/_KWQOwner.m
+++ b/WebCore/src/kwq/_KWQOwner.m
@@ -23,6 +23,7 @@
subs = [containerView subviews];
htmlView = (KWQHTMLView *)[[subs objectAtIndex: 0] documentView];
[htmlView setURL: url];
+ [htmlView setNeedsLayout: YES];
[containerView setNeedsDisplay: YES];
return self;
diff --git a/WebCore/src/kwq/kdeui/keditcl.h b/WebCore/src/kwq/kdeui/keditcl.h
index 02458ab..5c47c8d 100644
--- a/WebCore/src/kwq/kdeui/keditcl.h
+++ b/WebCore/src/kwq/kdeui/keditcl.h
@@ -125,6 +125,12 @@ public:
int numLines() const;
void selectAll();
+#ifdef _KWQ_
+ int verticalScrollBarWidth() const;
+ int horizontalScrollBarHeight() const;
+#endif
+
+
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/qapplication.h b/WebCore/src/kwq/qt/qapplication.h
index 0fabfc3..1bc9575 100644
--- a/WebCore/src/kwq/qt/qapplication.h
+++ b/WebCore/src/kwq/qt/qapplication.h
@@ -98,7 +98,6 @@ private:
void *globalPool;
#endif
-
}; // class QApplication =======================================================
#endif
diff --git a/WebCore/src/kwq/qt/qcombobox.h b/WebCore/src/kwq/qt/qcombobox.h
index 3043555..0a0c56b 100644
--- a/WebCore/src/kwq/qt/qcombobox.h
+++ b/WebCore/src/kwq/qt/qcombobox.h
@@ -58,6 +58,7 @@ public:
void insertItem(const QString &text, int index=-1);
void clear();
virtual void setCurrentItem(int);
+ QSize sizeHint() const;
// operators ---------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/qpainter.h b/WebCore/src/kwq/qt/qpainter.h
index a1d54b0..0a08ccf 100644
--- a/WebCore/src/kwq/qt/qpainter.h
+++ b/WebCore/src/kwq/qt/qpainter.h
@@ -50,6 +50,7 @@ class QPainterPrivate;
class QWMatrix {
friend QPainter;
+friend QPixmap;
public:
// typedefs ----------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/qpixmap.h b/WebCore/src/kwq/qt/qpixmap.h
index 6120875..cfcaf62 100644
--- a/WebCore/src/kwq/qt/qpixmap.h
+++ b/WebCore/src/kwq/qt/qpixmap.h
@@ -93,7 +93,6 @@ public:
#else
void *nsimage;
#endif
- QWMatrix xmatrix;
#endif
}; // class QPixmap ============================================================
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list