Reviewed by Eric. Landed by rwlbuis.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Aug 2006 11:45:29 +0000 (11:45 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Aug 2006 11:45:29 +0000 (11:45 +0000)
        Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10466
        WebKit should have Qt platform support.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15933 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
WebCore/ChangeLog
WebCore/platform/Color.h
WebCore/platform/Cursor.h
WebCore/platform/FloatPoint.h
WebCore/platform/FloatRect.h
WebCore/platform/GlyphBuffer.h
WebCore/platform/GraphicsContext.h
WebCore/platform/ImageSource.h
WebCore/platform/IntPoint.h
WebCore/platform/IntRect.h
WebCore/platform/IntSize.h
WebCore/platform/ListBox.h
WebCore/platform/Path.h
WebCore/platform/PlatformKeyboardEvent.h
WebCore/platform/PlatformMouseEvent.h
WebCore/platform/ResourceLoader.h
WebCore/platform/ResourceLoaderClient.h
WebCore/platform/ResourceLoaderInternal.h
WebCore/platform/ScrollView.h
WebCore/platform/Widget.h

index 0123919..bae73eb 100644 (file)
@@ -2,6 +2,38 @@
 
         Reviewed by Eric. Landed by rwlbuis.
 
+        Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10466
+        WebKit should have Qt platform support.
+
+        * platform/Color.h:
+        * platform/Cursor.h:
+        (WebCore::Cursor::Cursor):
+        * platform/FloatPoint.h:
+        * platform/FloatRect.h:
+        * platform/GlyphBuffer.h:
+        (WebCore::GlyphBuffer::glyphAt):
+        (WebCore::GlyphBuffer::advanceAt):
+        (WebCore::GlyphBuffer::add):
+        * platform/GraphicsContext.h:
+        * platform/ImageSource.h:
+        * platform/IntPoint.h:
+        * platform/IntRect.h:
+        * platform/IntSize.h:
+        * platform/ListBox.h:
+        * platform/Path.h:
+        * platform/PlatformKeyboardEvent.h:
+        * platform/PlatformMouseEvent.h:
+        * platform/ResourceLoader.h:
+        * platform/ResourceLoaderClient.h:
+        * platform/ResourceLoaderInternal.h:
+        (WebCore::ResourceLoaderInternal::ResourceLoaderInternal):
+        * platform/ScrollView.h:
+        * platform/Widget.h:
+
+2006-08-17  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Eric. Landed by rwlbuis.
+
         Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10465
         General WebKit Linux build fixes.
 
index 7e8e51e..4918b60 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef COLOR_H_
 #define COLOR_H_
 
+#include <wtf/Platform.h>
+
 #if __APPLE__
 
 #ifdef __OBJC__
@@ -36,6 +38,10 @@ class NSColor;
 
 typedef struct CGColor* CGColorRef;
 
+#endif // __APPLE__
+
+#if PLATFORM(QT)
+class QColor;
 #endif
 
 namespace WebCore {
@@ -83,6 +89,11 @@ public:
 
     Color blendWithWhite() const;
 
+#if PLATFORM(QT)
+    Color(const QColor&);
+    operator QColor() const;
+#endif
+
     static const RGBA32 black = 0xFF000000;
     static const RGBA32 white = 0xFFFFFFFF;
     static const RGBA32 darkGray = 0xFF808080;
index ad4751a..b494cc3 100644 (file)
@@ -32,6 +32,8 @@
 #include <windows.h>
 #elif PLATFORM(GDK)
 #include <gdk/gdk.h>
+#elif PLATFORM(QT)
+#include <QCursor>
 #endif
 
 #ifdef __APPLE__
@@ -52,13 +54,20 @@ namespace WebCore {
     typedef NSCursor* PlatformCursor;
 #elif PLATFORM(GDK)
     typedef GdkCursor* PlatformCursor;
+#elif PLATFORM(QT)
+    typedef QCursor PlatformCursor;
 #else
     typedef void* PlatformCursor;
 #endif
 
     class Cursor {
     public:
-        Cursor() : m_impl(0) { }
+        Cursor()
+#if !PLATFORM(QT)
+        : m_impl(0)
+#endif
+        { }
+
         Cursor(Image*);
         Cursor(const Cursor&);
         ~Cursor();
index b25aa0f..4f2856f 100644 (file)
@@ -28,6 +28,7 @@
 #define FLOATPOINT_H_
 
 #include "FloatSize.h"
+#include <wtf/Platform.h>
 
 #if __APPLE__
 
@@ -41,6 +42,10 @@ typedef struct _NSPoint NSPoint;
 
 #endif
 
+#if PLATFORM(QT)
+class QPointF;
+#endif
+
 namespace WebCore {
 
 class IntPoint;
@@ -70,6 +75,11 @@ public:
 
 #endif
 
+#if PLATFORM(QT)
+    FloatPoint(const QPointF&);
+    operator QPointF() const;
+#endif
+
 private:
     float m_x, m_y;
 };
index 0fb7c89..a6952c8 100644 (file)
@@ -39,6 +39,10 @@ typedef struct CGRect NSRect;
 typedef struct _NSRect NSRect;
 #endif
 
+#endif // __APPLE__
+
+#if PLATFORM(QT)
+class QRectF;
 #endif
 
 namespace WebCore {
@@ -105,6 +109,9 @@ public:
     operator NSRect() const;
 #endif
 
+#elif PLATFORM(QT)
+    FloatRect(const QRectF&);
+    operator QRectF() const;
 #endif
 
 private:
index 33ac6b6..f1ac809 100644 (file)
@@ -39,6 +39,8 @@
 #elif PLATFORM(WIN) || PLATFORM(GDK)
 #include <cairo.h>
 #include "FloatSize.h"
+#elif PLATFORM(QT)
+#include "FloatSize.h"
 #endif
 
 #include <wtf/Vector.h>
@@ -54,6 +56,9 @@ typedef CGSize GlyphBufferAdvance;
 #elif PLATFORM(WIN) || PLATFORM(GDK)
 typedef cairo_glyph_t GlyphBufferGlyph;
 typedef FloatSize GlyphBufferAdvance;
+#elif PLATFORM(QT)
+typedef unsigned short GlyphBufferGlyph;
+typedef FloatSize GlyphBufferAdvance;
 #endif
 
 class GlyphBuffer
@@ -93,7 +98,7 @@ public:
 
     Glyph glyphAt(int index) const
     {
-#if __APPLE__
+#if __APPLE__ || PLATFORM(QT)
         return m_glyphs[index];
 #elif PLATFORM(WIN) || PLATFORM(GDK)
         return m_glyphs[index].index;
@@ -104,7 +109,7 @@ public:
     {
 #if __APPLE__
         return m_advances[index].width;
-#elif PLATFORM(WIN) || PLATFORM(GDK)
+#elif PLATFORM(WIN) || PLATFORM(GDK) || PLATFORM(QT)
         return m_advances[index].width();
 #endif
     }
@@ -124,6 +129,9 @@ public:
         cairoGlyph.y = 0;
         m_glyphs.append(cairoGlyph);
         m_advances.append(FloatSize(width, 0));
+#elif PLATFORM(QT)
+        m_glyphs.append(glyph);
+        m_advances.append(FloatSize(width, 0));
 #endif
     }
     
index 304b6d6..432fa8c 100644 (file)
@@ -44,6 +44,9 @@ typedef struct HDC__* HDC;
 typedef struct _cairo PlatformGraphicsContext;
 #elif PLATFORM(GDK)
 typedef struct _cairo PlatformGraphicsContext;
+#elif PLATFORM(QT)
+class QPainter;
+typedef QPainter PlatformGraphicsContext;
 #else
 typedef void PlatformGraphicsContext;
 #endif
index 9d0dcd0..2d95237 100644 (file)
@@ -31,6 +31,8 @@
 
 #if __APPLE__
 #include <ApplicationServices/ApplicationServices.h>
+#elif PLATFORM(QT)
+class QImage;
 #else
 struct _cairo_surface;
 typedef struct _cairo_surface cairo_surface_t;
@@ -44,6 +46,11 @@ class IntSize;
 typedef CGImageSourceRef NativeImageSourcePtr;
 typedef CGImageRef NativeImagePtr;
 typedef CFDataRef NativeBytePtr;
+#elif PLATFORM(QT)
+class ImageDecoder;
+typedef ImageDecoder* NativeImageSourcePtr;
+typedef const Vector<char>* NativeBytePtr;
+typedef QImage* NativeImagePtr;
 #else
 class ImageDecoder;
 typedef ImageDecoder* NativeImageSourcePtr;
index 278c779..2819464 100644 (file)
@@ -43,6 +43,8 @@ typedef struct _NSPoint NSPoint;
 
 #if PLATFORM(WIN)
 typedef struct tagPOINT POINT;
+#elif PLATFORM(QT)
+class QPoint;
 #endif
 
 namespace WebCore {
@@ -75,6 +77,9 @@ public:
 #if PLATFORM(WIN)
     IntPoint(const POINT&);
     operator POINT() const;
+#elif PLATFORM(QT)
+    IntPoint(const QPoint&);
+    operator QPoint() const;
 #endif
 
 private:
index 3fd0664..cf5dd94 100644 (file)
@@ -43,6 +43,8 @@ typedef struct _NSRect NSRect;
 
 #if PLATFORM(WIN)
 typedef struct tagRECT RECT;
+#elif PLATFORM(QT)
+class QRect;
 #endif
 
 namespace WebCore {
@@ -107,6 +109,9 @@ public:
 #if PLATFORM(WIN)
     IntRect(const RECT&);
     operator RECT() const;
+#elif PLATFORM(QT)
+    IntRect(const QRect&);
+    operator QRect() const;
 #endif
 
 #if __APPLE__
index d2cb6c5..a62bf5b 100644 (file)
@@ -42,6 +42,8 @@ typedef struct _NSSize NSSize;
 
 #if PLATFORM(WIN)
 typedef struct tagSIZE SIZE;
+#elif PLATFORM(QT)
+class QSize;
 #endif
 
 namespace WebCore {
@@ -93,6 +95,12 @@ public:
     operator SIZE() const;
 #endif
 
+#if PLATFORM(QT)
+    IntSize(const QSize&);
+    operator QSize() const;
+#endif
+
+
 private:
     int m_width, m_height;
 };
index 2877302..e71ee0e 100644 (file)
 #include "ScrollView.h"
 #include "TextDirection.h"
 
+#if PLATFORM(QT)
+class QListWidget;
+#endif
+
 namespace WebCore {
 
 enum ListBoxItemType {
@@ -84,7 +88,16 @@ public:
     static void clearCachedTextRenderers();
     void setFont(const Font&);
 
+#if PLATFORM(QT)
+    virtual void setParentWidget(QWidget*);
+#endif
+
 private:
+#if PLATFORM(QT)
+    QListWidget* m_listWidget;
+    SelectionMode m_selectionMode;
+#endif
+
     void appendItem(const DeprecatedString &, ListBoxItemType, bool);
 
     // A Vector<ListBoxItem> might be more efficient for large lists.
index fe93ac0..89fba0d 100644 (file)
@@ -28,6 +28,9 @@
 
 #if __APPLE__
 typedef struct CGPath PlatformPath;
+#elif PLATFORM(QT)
+class QPainterPath;
+typedef QPainterPath PlatformPath;
 #else
 typedef void PlatformPath;
 #endif
index 4cd984c..2bda80d 100644 (file)
@@ -45,6 +45,9 @@ typedef long        LPARAM;
 typedef union _GdkEvent GdkEvent;
 #endif
 
+#if PLATFORM(QT)
+class QKeyEvent;
+#endif
 
 namespace WebCore {
 
@@ -74,6 +77,10 @@ namespace WebCore {
         PlatformKeyboardEvent(GdkEvent*);
 #endif
 
+#if PLATFORM(QT)
+        PlatformKeyboardEvent(QKeyEvent*, bool isKeyUp);
+#endif
+
     private:
         String m_text;
         String m_unmodifiedText;
index 8f74077..bb9ff50 100644 (file)
@@ -47,6 +47,10 @@ typedef long LPARAM;
 typedef union _GdkEvent GdkEvent;
 #endif
 
+#if PLATFORM(QT)
+class QMouseEvent;
+#endif
+
 namespace WebCore {
 
     // These button numbers match the one used in the DOM API.
@@ -100,6 +104,9 @@ namespace WebCore {
 #if PLATFORM(GDK) 
         PlatformMouseEvent(GdkEvent*);
 #endif
+#if PLATFORM(QT)
+        PlatformMouseEvent(QMouseEvent*, int clickCount);
+#endif
 
     private:
         IntPoint m_position;
index c06992a..ccec88d 100644 (file)
@@ -89,8 +89,8 @@ public:
     friend LRESULT __stdcall ResourceLoaderWndProc(HWND, unsigned message, WPARAM, LPARAM);
 #endif
 
-#if PLATFORM(GDK)
-    ResourceLoaderInternal * getInternal() { return d;}
+#if PLATFORM(GDK) || PLATFORM(QT)
+    ResourceLoaderInternal* getInternal() { return d; }
 #endif
 
     void cancel();
index b98b8e5..ca64a8c 100644 (file)
@@ -41,6 +41,9 @@ namespace WebCore {
 #ifdef __APPLE__
     typedef NSData* PlatformData;
     typedef NSURLResponse* PlatformResponse;
+#elif PLATFORM(QT)
+    typedef void* PlatformData;
+    typedef char* PlatformResponse;
 #else
     // Not sure what the strategy for this will be on other platforms.
     typedef struct PlatformDataStruct *PlatformData;
index f228894..76a0e34 100644 (file)
@@ -40,6 +40,11 @@ typedef void* HANDLE;
 typedef void CURL;
 #endif
 
+#if PLATFORM(QT)
+#include <QString>
+typedef void CURL;
+#endif
+
 // The allocations and releases in ResourceLoaderInternal are
 // Cocoa-exception-free (either simple Foundation classes or
 // WebCoreResourceLoaderImp which avoids doing work in dealloc).
@@ -72,7 +77,7 @@ namespace WebCore {
             , m_formDataLength(0)
             , m_bytesRemainingToWrite(0)
 #endif
-#if PLATFORM(GDK)
+#if PLATFORM(GDK) || PLATFORM(QT)
             , m_handle(0)
 #endif
         {
@@ -102,7 +107,7 @@ namespace WebCore {
             , m_formDataLength(0)
             , m_bytesRemainingToWrite(0)
 #endif
-#if PLATFORM(GDK)
+#if PLATFORM(GDK) || PLATFORM(QT)
             , m_handle(0)
 #endif
         {
@@ -142,6 +147,11 @@ namespace WebCore {
 #if PLATFORM(GDK)
         CURL *m_handle;
 #endif
+#if PLATFORM(QT)
+        CURL *m_handle;
+        QString response;
+#endif
+
         };
 
 } // namespace WebCore
index af495d4..a3ca611 100644 (file)
 #include "Widget.h"
 #include <wtf/Platform.h>
 
+#if PLATFORM(QT)
+class QScrollArea;
+#endif
+
 namespace WebCore {
     class FloatRect;
 
@@ -101,6 +105,16 @@ namespace WebCore {
         class ScrollViewPrivate;
         ScrollViewPrivate* m_data;
 #endif
+
+#if PLATFORM(QT)
+        ScrollView();
+        ~ScrollView();
+
+        virtual void setParentWidget(QWidget*);
+
+    private:
+        QScrollArea* m_area;
+#endif
     };
 
 } // namespace WebCore
index f74a699..a2bcce2 100644 (file)
@@ -45,6 +45,10 @@ typedef struct HINSTANCE__ *HINSTANCE;
 typedef struct _GdkDrawable GdkDrawable;
 #endif
 
+#if PLATFORM(QT)
+class QWidget;
+#endif
+
 namespace WebCore {
 
     class Cursor;
@@ -141,6 +145,16 @@ namespace WebCore {
       GdkDrawable* drawable() const;
 #endif
 
+
+#if PLATFORM(QT)
+        QWidget* parentWidget() const;
+        virtual void setParentWidget(QWidget*);
+
+        QWidget* qwidget();
+        void setQWidget(QWidget*);
+#endif
+
+
 #if __APPLE__
         Widget(NSView* view);