[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:50:48 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit d35865e6ada563daf919c5eede1304fac81ed64c
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 18 21:08:20 2001 +0000

    Added classes to get past drawing problems.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@362 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 687add1..31c5cbf 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -171,7 +171,7 @@ void KHTMLPart::slotData(id <WCURICacheData> data)
 bool KHTMLPart::openURL( const KURL &url )
 {
     // Close the previous URL.
-    closeURL();
+    //closeURL();
     
     //if ( args.doPost() && (url.protocol().startsWith("http")) )
     //{
@@ -629,13 +629,15 @@ QString KHTMLPart::jsDefaultStatusBarText() const
 
 DOM::HTMLDocumentImpl *KHTMLPart::docImpl() const
 {
-    _logNeverImplemented();
+    _logPartiallyImplemented();
+    return dynamic_cast<DOM::HTMLDocumentImpl *>(d->m_doc);
 }
 
 
 DOM::DocumentImpl *KHTMLPart::xmlDocImpl() const
 {
-    _logNeverImplemented();
+    _logPartiallyImplemented();
+    return d->m_doc;
 }
 
 
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 687add1..31c5cbf 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -171,7 +171,7 @@ void KHTMLPart::slotData(id <WCURICacheData> data)
 bool KHTMLPart::openURL( const KURL &url )
 {
     // Close the previous URL.
-    closeURL();
+    //closeURL();
     
     //if ( args.doPost() && (url.protocol().startsWith("http")) )
     //{
@@ -629,13 +629,15 @@ QString KHTMLPart::jsDefaultStatusBarText() const
 
 DOM::HTMLDocumentImpl *KHTMLPart::docImpl() const
 {
-    _logNeverImplemented();
+    _logPartiallyImplemented();
+    return dynamic_cast<DOM::HTMLDocumentImpl *>(d->m_doc);
 }
 
 
 DOM::DocumentImpl *KHTMLPart::xmlDocImpl() const
 {
-    _logNeverImplemented();
+    _logPartiallyImplemented();
+    return d->m_doc;
 }
 
 
diff --git a/WebCore/kwq/KWQObject.mm b/WebCore/kwq/KWQObject.mm
index d24e780..ba3e832 100644
--- a/WebCore/kwq/KWQObject.mm
+++ b/WebCore/kwq/KWQObject.mm
@@ -31,6 +31,7 @@ bool QObject::connect(const QObject *src, const char *signal, const QObject *des
     const char *slot)
 {
     NSLog (@"QObject::connect() signal %s, slot %s\n", signal, slot);
+    return FALSE;
 //    _logNeverImplemented();
 }
 
@@ -39,6 +40,7 @@ bool QObject::disconnect( const QObject *, const char *, const QObject *,
     const char *)
 {
     _logNeverImplemented();
+    return FALSE;
 }
 
 
@@ -59,6 +61,7 @@ QObject::~QObject()
 const char *QObject::name() const
 {
     _logNeverImplemented();
+    return "noname";
 }
 
 
diff --git a/WebCore/kwq/KWQPainter.h b/WebCore/kwq/KWQPainter.h
index de87f07..543ec4a 100644
--- a/WebCore/kwq/KWQPainter.h
+++ b/WebCore/kwq/KWQPainter.h
@@ -198,6 +198,7 @@ private:
 #else
         uint compositingOperation;
 #endif
+        const QPaintDevice  *bufferDevice;
     } *data;
 #endif
 }; // end class QPainter
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index b1e6da8..5fea92d 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -67,6 +67,7 @@ void QPainter::_initialize(QWidget *widget)
     data->qpen = QPen (Qt::black);
     data->isFocusLocked = 0;
     data->compositingOperation = NSCompositeCopy;
+    data->bufferDevice = 0L;
 }
 
 
@@ -540,15 +541,15 @@ void QPainter::scale(double dx, double dy)
 }
 
 
-bool QPainter::begin(const QPaintDevice *)
+bool QPainter::begin(const QPaintDevice *bd)
 {
-     NSLog (@"ERROR %s:%s:%d (NOT IMPLEMENTED)\n", __FILE__, __FUNCTION__, __LINE__);
+    data->bufferDevice = bd;
 }
 
 
 bool QPainter::end()
 {
-     NSLog (@"ERROR %s:%s:%d (NOT IMPLEMENTED)\n", __FILE__, __FUNCTION__, __LINE__);
+    data->bufferDevice = 0L;
 }
 
 
@@ -559,14 +560,26 @@ QPaintDevice *QPainter::device() const
 
 void QPainter::_lockFocus(){
     if (data->isFocusLocked == 0){
-        [data->widget->getView() lockFocus];
+        if (data->bufferDevice != 0L){
+            const QPixmap *pixmap = (QPixmap *)(data->bufferDevice);
+            [pixmap->nsimage lockFocus];
+        }
+        else {
+            [data->widget->getView() lockFocus];
+        }
         data->isFocusLocked = 1;
     }	
 }
 
 void QPainter::_unlockFocus(){
     if (data->isFocusLocked == 1){
-        [data->widget->getView() unlockFocus];
+        if (data->bufferDevice != 0L){
+            const QPixmap *pixmap = (QPixmap *)(data->bufferDevice);
+            [pixmap->nsimage unlockFocus];
+        }
+        else  {
+            [data->widget->getView() unlockFocus];
+        }
         data->isFocusLocked = 0;
     }	
 }
diff --git a/WebCore/kwq/KWQPixmap.h b/WebCore/kwq/KWQPixmap.h
index 49c6f7d..6120875 100644
--- a/WebCore/kwq/KWQPixmap.h
+++ b/WebCore/kwq/KWQPixmap.h
@@ -87,8 +87,6 @@ public:
 
     QPixmap &operator=(const QPixmap &);
 
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
 #ifdef _KWQ_
 #if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
     NSImage *nsimage;
diff --git a/WebCore/kwq/KWQView.h b/WebCore/kwq/KWQView.h
index d22c9d9..676529d 100644
--- a/WebCore/kwq/KWQView.h
+++ b/WebCore/kwq/KWQView.h
@@ -59,5 +59,17 @@ class QWidget;
 @end
 
 
+ at interface KWQHTMLView : NSView
+{
+    QWidget *widget;
+    bool isFlipped;
+}
+- initWithFrame: (NSRect)r widget: (QWidget *)w; 
+- (void)setIsFlipped: (bool)flag;
+ at end
+
+
+
+
 
 
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index 9303fdc..9825e14 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -24,7 +24,9 @@
  */
 #import "KWQView.h"
 
-#import <qwidget.h>
+#include <khtmlview.h>
+#include <qwidget.h>
+#include <qpainter.h>
 
 @implementation KWQView
 
@@ -75,3 +77,43 @@
 }
 
 @end
+
+
+ at implementation KWQHTMLView
+
+- initWithFrame: (NSRect) r widget: (QWidget *)w 
+{
+    [super initWithFrame: r];
+    widget = w;
+    isFlipped = YES;
+}
+
+
+// This should eventually be removed.
+- (void)drawRect:(NSRect)rect {
+    if (widget != 0l){
+        //widget->paint((void *)0);
+        
+        QPainter p(widget);
+        NSRect frame = [self frame];
+        
+        ((KHTMLView *)widget)->drawContents( &p, (int)frame.origin.x, 
+                    (int)frame.origin.y, 
+                    (int)frame.size.width, 
+                    (int)frame.size.height );
+    }
+}
+
+- (void)setIsFlipped: (bool)flag
+{
+    isFlipped = flag;
+}
+
+
+- (BOOL)isFlipped 
+{
+    return isFlipped;
+}
+
+ at end
+
diff --git a/WebCore/kwq/qt/qpainter.h b/WebCore/kwq/qt/qpainter.h
index de87f07..543ec4a 100644
--- a/WebCore/kwq/qt/qpainter.h
+++ b/WebCore/kwq/qt/qpainter.h
@@ -198,6 +198,7 @@ private:
 #else
         uint compositingOperation;
 #endif
+        const QPaintDevice  *bufferDevice;
     } *data;
 #endif
 }; // end class QPainter
diff --git a/WebCore/kwq/qt/qpixmap.h b/WebCore/kwq/qt/qpixmap.h
index 49c6f7d..6120875 100644
--- a/WebCore/kwq/qt/qpixmap.h
+++ b/WebCore/kwq/qt/qpixmap.h
@@ -87,8 +87,6 @@ public:
 
     QPixmap &operator=(const QPixmap &);
 
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
 #ifdef _KWQ_
 #if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
     NSImage *nsimage;
diff --git a/WebCore/kwq/tests/khtmlview/WebViewTest/WebViewTest.pbproj/project.pbxproj b/WebCore/kwq/tests/khtmlview/WebViewTest/WebViewTest.pbproj/project.pbxproj
index eab7f44..677bddb 100644
--- a/WebCore/kwq/tests/khtmlview/WebViewTest/WebViewTest.pbproj/project.pbxproj
+++ b/WebCore/kwq/tests/khtmlview/WebViewTest/WebViewTest.pbproj/project.pbxproj
@@ -236,7 +236,7 @@
 				HEADER_SEARCH_PATHS = "";
 				INSTALL_PATH = "$(HOME)/Applications";
 				LIBRARY_SEARCH_PATHS = ../../../../../lib;
-				OTHER_CFLAGS = "-DHAVE_CONFIG_H -DQT_NO_DATASTREAM -D_KWQ_ -I../../../qt -I../../.. -I../../../../.. -I../../../../kdelibs/khtml -I../../../../kwq/kdecore -I../../../../kwq/kde";
+				OTHER_CFLAGS = "-DHAVE_CONFIG_H -DQT_NO_DATASTREAM -D_KWQ_ -I../../../qt -I../../.. -I../../../../.. -I../../../../kdelibs/khtml -I../../../../kwq/kdecore -I../../../../kwq/kde -I../../../../kwq -I../../../../../include";
 				OTHER_LDFLAGS = "-lwebcore -framework WebKit";
 				PRODUCT_NAME = WebViewTest;
 				SECTORDER_FLAGS = "";
diff --git a/WebCore/kwq/tests/khtmlview/draw.mm b/WebCore/kwq/tests/khtmlview/draw.mm
index 0a58bdb..3509014 100644
--- a/WebCore/kwq/tests/khtmlview/draw.mm
+++ b/WebCore/kwq/tests/khtmlview/draw.mm
@@ -26,6 +26,8 @@
 #include <qapplication.h>
 #include <khtmlview.h>
 
+#include <KWQView.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -70,6 +72,9 @@ int main( int argc, char **argv )
     // WebPageView. 
     // [[WebPageView alloc] initWithFrame: (NSRect)rect document: (WebPageDocument *)doc]
     KHTMLView   *htmlView = new KHTMLView (w, 0);
+    KWQHTMLView *kwqHTMLView = [[[KWQHTMLView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: htmlView] autorelease];
+    
+    htmlView->setView (kwqHTMLView);
     
     htmlView->resize(500, 400);
  
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 687add1..31c5cbf 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -171,7 +171,7 @@ void KHTMLPart::slotData(id <WCURICacheData> data)
 bool KHTMLPart::openURL( const KURL &url )
 {
     // Close the previous URL.
-    closeURL();
+    //closeURL();
     
     //if ( args.doPost() && (url.protocol().startsWith("http")) )
     //{
@@ -629,13 +629,15 @@ QString KHTMLPart::jsDefaultStatusBarText() const
 
 DOM::HTMLDocumentImpl *KHTMLPart::docImpl() const
 {
-    _logNeverImplemented();
+    _logPartiallyImplemented();
+    return dynamic_cast<DOM::HTMLDocumentImpl *>(d->m_doc);
 }
 
 
 DOM::DocumentImpl *KHTMLPart::xmlDocImpl() const
 {
-    _logNeverImplemented();
+    _logPartiallyImplemented();
+    return d->m_doc;
 }
 
 
diff --git a/WebCore/src/kwq/KWQObject.mm b/WebCore/src/kwq/KWQObject.mm
index d24e780..ba3e832 100644
--- a/WebCore/src/kwq/KWQObject.mm
+++ b/WebCore/src/kwq/KWQObject.mm
@@ -31,6 +31,7 @@ bool QObject::connect(const QObject *src, const char *signal, const QObject *des
     const char *slot)
 {
     NSLog (@"QObject::connect() signal %s, slot %s\n", signal, slot);
+    return FALSE;
 //    _logNeverImplemented();
 }
 
@@ -39,6 +40,7 @@ bool QObject::disconnect( const QObject *, const char *, const QObject *,
     const char *)
 {
     _logNeverImplemented();
+    return FALSE;
 }
 
 
@@ -59,6 +61,7 @@ QObject::~QObject()
 const char *QObject::name() const
 {
     _logNeverImplemented();
+    return "noname";
 }
 
 
diff --git a/WebCore/src/kwq/KWQPainter.mm b/WebCore/src/kwq/KWQPainter.mm
index b1e6da8..5fea92d 100644
--- a/WebCore/src/kwq/KWQPainter.mm
+++ b/WebCore/src/kwq/KWQPainter.mm
@@ -67,6 +67,7 @@ void QPainter::_initialize(QWidget *widget)
     data->qpen = QPen (Qt::black);
     data->isFocusLocked = 0;
     data->compositingOperation = NSCompositeCopy;
+    data->bufferDevice = 0L;
 }
 
 
@@ -540,15 +541,15 @@ void QPainter::scale(double dx, double dy)
 }
 
 
-bool QPainter::begin(const QPaintDevice *)
+bool QPainter::begin(const QPaintDevice *bd)
 {
-     NSLog (@"ERROR %s:%s:%d (NOT IMPLEMENTED)\n", __FILE__, __FUNCTION__, __LINE__);
+    data->bufferDevice = bd;
 }
 
 
 bool QPainter::end()
 {
-     NSLog (@"ERROR %s:%s:%d (NOT IMPLEMENTED)\n", __FILE__, __FUNCTION__, __LINE__);
+    data->bufferDevice = 0L;
 }
 
 
@@ -559,14 +560,26 @@ QPaintDevice *QPainter::device() const
 
 void QPainter::_lockFocus(){
     if (data->isFocusLocked == 0){
-        [data->widget->getView() lockFocus];
+        if (data->bufferDevice != 0L){
+            const QPixmap *pixmap = (QPixmap *)(data->bufferDevice);
+            [pixmap->nsimage lockFocus];
+        }
+        else {
+            [data->widget->getView() lockFocus];
+        }
         data->isFocusLocked = 1;
     }	
 }
 
 void QPainter::_unlockFocus(){
     if (data->isFocusLocked == 1){
-        [data->widget->getView() unlockFocus];
+        if (data->bufferDevice != 0L){
+            const QPixmap *pixmap = (QPixmap *)(data->bufferDevice);
+            [pixmap->nsimage unlockFocus];
+        }
+        else  {
+            [data->widget->getView() unlockFocus];
+        }
         data->isFocusLocked = 0;
     }	
 }
diff --git a/WebCore/src/kwq/KWQView.h b/WebCore/src/kwq/KWQView.h
index d22c9d9..676529d 100644
--- a/WebCore/src/kwq/KWQView.h
+++ b/WebCore/src/kwq/KWQView.h
@@ -59,5 +59,17 @@ class QWidget;
 @end
 
 
+ at interface KWQHTMLView : NSView
+{
+    QWidget *widget;
+    bool isFlipped;
+}
+- initWithFrame: (NSRect)r widget: (QWidget *)w; 
+- (void)setIsFlipped: (bool)flag;
+ at end
+
+
+
+
 
 
diff --git a/WebCore/src/kwq/KWQView.mm b/WebCore/src/kwq/KWQView.mm
index 9303fdc..9825e14 100644
--- a/WebCore/src/kwq/KWQView.mm
+++ b/WebCore/src/kwq/KWQView.mm
@@ -24,7 +24,9 @@
  */
 #import "KWQView.h"
 
-#import <qwidget.h>
+#include <khtmlview.h>
+#include <qwidget.h>
+#include <qpainter.h>
 
 @implementation KWQView
 
@@ -75,3 +77,43 @@
 }
 
 @end
+
+
+ at implementation KWQHTMLView
+
+- initWithFrame: (NSRect) r widget: (QWidget *)w 
+{
+    [super initWithFrame: r];
+    widget = w;
+    isFlipped = YES;
+}
+
+
+// This should eventually be removed.
+- (void)drawRect:(NSRect)rect {
+    if (widget != 0l){
+        //widget->paint((void *)0);
+        
+        QPainter p(widget);
+        NSRect frame = [self frame];
+        
+        ((KHTMLView *)widget)->drawContents( &p, (int)frame.origin.x, 
+                    (int)frame.origin.y, 
+                    (int)frame.size.width, 
+                    (int)frame.size.height );
+    }
+}
+
+- (void)setIsFlipped: (bool)flag
+{
+    isFlipped = flag;
+}
+
+
+- (BOOL)isFlipped 
+{
+    return isFlipped;
+}
+
+ at end
+
diff --git a/WebCore/src/kwq/qt/qpainter.h b/WebCore/src/kwq/qt/qpainter.h
index de87f07..543ec4a 100644
--- a/WebCore/src/kwq/qt/qpainter.h
+++ b/WebCore/src/kwq/qt/qpainter.h
@@ -198,6 +198,7 @@ private:
 #else
         uint compositingOperation;
 #endif
+        const QPaintDevice  *bufferDevice;
     } *data;
 #endif
 }; // end class QPainter
diff --git a/WebCore/src/kwq/qt/qpixmap.h b/WebCore/src/kwq/qt/qpixmap.h
index 49c6f7d..6120875 100644
--- a/WebCore/src/kwq/qt/qpixmap.h
+++ b/WebCore/src/kwq/qt/qpixmap.h
@@ -87,8 +87,6 @@ public:
 
     QPixmap &operator=(const QPixmap &);
 
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
 #ifdef _KWQ_
 #if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
     NSImage *nsimage;
diff --git a/WebCore/src/kwq/tests/khtmlview/WebViewTest/WebViewTest.pbproj/project.pbxproj b/WebCore/src/kwq/tests/khtmlview/WebViewTest/WebViewTest.pbproj/project.pbxproj
index eab7f44..677bddb 100644
--- a/WebCore/src/kwq/tests/khtmlview/WebViewTest/WebViewTest.pbproj/project.pbxproj
+++ b/WebCore/src/kwq/tests/khtmlview/WebViewTest/WebViewTest.pbproj/project.pbxproj
@@ -236,7 +236,7 @@
 				HEADER_SEARCH_PATHS = "";
 				INSTALL_PATH = "$(HOME)/Applications";
 				LIBRARY_SEARCH_PATHS = ../../../../../lib;
-				OTHER_CFLAGS = "-DHAVE_CONFIG_H -DQT_NO_DATASTREAM -D_KWQ_ -I../../../qt -I../../.. -I../../../../.. -I../../../../kdelibs/khtml -I../../../../kwq/kdecore -I../../../../kwq/kde";
+				OTHER_CFLAGS = "-DHAVE_CONFIG_H -DQT_NO_DATASTREAM -D_KWQ_ -I../../../qt -I../../.. -I../../../../.. -I../../../../kdelibs/khtml -I../../../../kwq/kdecore -I../../../../kwq/kde -I../../../../kwq -I../../../../../include";
 				OTHER_LDFLAGS = "-lwebcore -framework WebKit";
 				PRODUCT_NAME = WebViewTest;
 				SECTORDER_FLAGS = "";
diff --git a/WebCore/src/kwq/tests/khtmlview/draw.mm b/WebCore/src/kwq/tests/khtmlview/draw.mm
index 0a58bdb..3509014 100644
--- a/WebCore/src/kwq/tests/khtmlview/draw.mm
+++ b/WebCore/src/kwq/tests/khtmlview/draw.mm
@@ -26,6 +26,8 @@
 #include <qapplication.h>
 #include <khtmlview.h>
 
+#include <KWQView.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -70,6 +72,9 @@ int main( int argc, char **argv )
     // WebPageView. 
     // [[WebPageView alloc] initWithFrame: (NSRect)rect document: (WebPageDocument *)doc]
     KHTMLView   *htmlView = new KHTMLView (w, 0);
+    KWQHTMLView *kwqHTMLView = [[[KWQHTMLView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: htmlView] autorelease];
+    
+    htmlView->setView (kwqHTMLView);
     
     htmlView->resize(500, 400);
  

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list