WebCore/ChangeLog

112006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
22
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10466
 6 WebKit should have Qt platform support.
 7
 8 * platform/Color.h:
 9 * platform/Cursor.h:
 10 (WebCore::Cursor::Cursor):
 11 * platform/FloatPoint.h:
 12 * platform/FloatRect.h:
 13 * platform/GlyphBuffer.h:
 14 (WebCore::GlyphBuffer::glyphAt):
 15 (WebCore::GlyphBuffer::advanceAt):
 16 (WebCore::GlyphBuffer::add):
 17 * platform/GraphicsContext.h:
 18 * platform/ImageSource.h:
 19 * platform/IntPoint.h:
 20 * platform/IntRect.h:
 21 * platform/IntSize.h:
 22 * platform/ListBox.h:
 23 * platform/Path.h:
 24 * platform/PlatformKeyboardEvent.h:
 25 * platform/PlatformMouseEvent.h:
 26 * platform/ResourceLoader.h:
 27 * platform/ResourceLoaderClient.h:
 28 * platform/ResourceLoaderInternal.h:
 29 (WebCore::ResourceLoaderInternal::ResourceLoaderInternal):
 30 * platform/ScrollView.h:
 31 * platform/Widget.h:
 32
 332006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
 34
335 Reviewed by Anders.
436
537 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10447
Revision 15926

WebCore/platform/GraphicsContext.h

4444typedef struct _cairo PlatformGraphicsContext;
4545#elif PLATFORM(GDK)
4646typedef struct _cairo PlatformGraphicsContext;
 47#elif PLATFORM(QT)
 48class QPainter;
 49typedef QPainter PlatformGraphicsContext;
4750#else
4851typedef void PlatformGraphicsContext;
4952#endif
Revision 15924

WebCore/platform/Cursor.h

3232#include <windows.h>
3333#elif PLATFORM(GDK)
3434#include <gdk/gdk.h>
 35#elif PLATFORM(QT)
 36#include <QCursor>
3537#endif
3638
3739#ifdef __APPLE__

5254 typedef NSCursor* PlatformCursor;
5355#elif PLATFORM(GDK)
5456 typedef GdkCursor* PlatformCursor;
 57#elif PLATFORM(QT)
 58 typedef QCursor PlatformCursor;
5559#else
5660 typedef void* PlatformCursor;
5761#endif
5862
5963 class Cursor {
6064 public:
61  Cursor() : m_impl(0) { }
 65 Cursor()
 66#if PLATFORM(QT)
 67 // use default QCursor constructor. QCursor(0) creates
 68 // an invalid cursor due to implicit constructors ;(
 69#else
 70 : m_impl(0)
 71#endif
 72 { }
 73
6274 Cursor(Image*);
6375 Cursor(const Cursor&);
6476 ~Cursor();
Revision 15924

WebCore/platform/Color.h

2626#ifndef COLOR_H_
2727#define COLOR_H_
2828
 29#include <wtf/Platform.h>
 30
2931#if __APPLE__
3032
3133#ifdef __OBJC__

3638
3739typedef struct CGColor* CGColorRef;
3840
 41#endif // __APPLE__
 42
 43#if PLATFORM(QT)
 44class QColor;
3945#endif
4046
4147namespace WebCore {

8389
8490 Color blendWithWhite() const;
8591
 92#if PLATFORM(QT)
 93 Color(const QColor&);
 94 operator QColor() const;
 95#endif
 96
8697 static const RGBA32 black = 0xFF000000;
8798 static const RGBA32 white = 0xFFFFFFFF;
8899 static const RGBA32 darkGray = 0xFF808080;
Revision 15924

WebCore/platform/FloatPoint.h

2828#define FLOATPOINT_H_
2929
3030#include "FloatSize.h"
 31#include <wtf/Platform.h>
3132
3233#if __APPLE__
3334

4142
4243#endif
4344
 45#if PLATFORM(QT)
 46class QPointF;
 47#endif
 48
4449namespace WebCore {
4550
4651class IntPoint;

7075
7176#endif
7277
 78#if PLATFORM(QT)
 79 FloatPoint(const QPointF&);
 80 operator QPointF() const;
 81#endif
 82
7383private:
7484 float m_x, m_y;
7585};
Revision 15924

WebCore/platform/IntRect.h

4343
4444#if PLATFORM(WIN)
4545typedef struct tagRECT RECT;
 46#elif PLATFORM(QT)
 47class QRect;
4648#endif
4749
4850namespace WebCore {

107109#if PLATFORM(WIN)
108110 IntRect(const RECT&);
109111 operator RECT() const;
 112#elif PLATFORM(QT)
 113 IntRect(const QRect&);
 114 operator QRect() const;
110115#endif
111116
112117#if __APPLE__
Revision 15924

WebCore/platform/IntPoint.h

4343
4444#if PLATFORM(WIN)
4545typedef struct tagPOINT POINT;
 46#elif PLATFORM(QT)
 47class QPoint;
4648#endif
4749
4850namespace WebCore {

7577#if PLATFORM(WIN)
7678 IntPoint(const POINT&);
7779 operator POINT() const;
 80#elif PLATFORM(QT)
 81 IntPoint(const QPoint&);
 82 operator QPoint() const;
7883#endif
7984
8085private:
Revision 15924

WebCore/platform/PlatformKeyboardEvent.h

4545typedef union _GdkEvent GdkEvent;
4646#endif
4747
 48#if PLATFORM(QT)
 49class QKeyEvent;
 50#endif
4851
4952namespace WebCore {
5053

7477 PlatformKeyboardEvent(GdkEvent*);
7578#endif
7679
 80#if PLATFORM(QT)
 81 PlatformKeyboardEvent(QKeyEvent*, bool isKeyUp);
 82#endif
 83
7784 private:
7885 String m_text;
7986 String m_unmodifiedText;
Revision 15924

WebCore/platform/ResourceLoader.h

8989 friend LRESULT __stdcall ResourceLoaderWndProc(HWND, unsigned message, WPARAM, LPARAM);
9090#endif
9191
92 #if PLATFORM(GDK)
 92#if PLATFORM(GDK) || PLATFORM(QT)
9393 ResourceLoaderInternal * getInternal() { return d;}
9494#endif
9595
Revision 15924

WebCore/platform/ListBox.h

3131#include "ScrollView.h"
3232#include "TextDirection.h"
3333
 34#if PLATFORM(QT)
 35class QListWidget;
 36#endif
 37
3438namespace WebCore {
3539
3640enum ListBoxItemType {

8488 static void clearCachedTextRenderers();
8589 void setFont(const Font&);
8690
 91#if PLATFORM(QT)
 92 virtual void setParentWidget(QWidget* parent);
 93#endif
 94
8795private:
 96#if PLATFORM(QT)
 97 QListWidget* m_listWidget;
 98 SelectionMode m_selectionMode;
 99#endif
 100
88101 void appendItem(const DeprecatedString &, ListBoxItemType, bool);
89102
90103 // A Vector<ListBoxItem> might be more efficient for large lists.
Revision 15924

WebCore/platform/Widget.h

4545typedef struct _GdkDrawable GdkDrawable;
4646#endif
4747
 48#if PLATFORM(QT)
 49class QWidget;
 50#endif
 51
4852namespace WebCore {
4953
5054 class Cursor;

141145 GdkDrawable* drawable() const;
142146#endif
143147
 148
 149#if PLATFORM(QT)
 150 QWidget* parentWidget() const;
 151 virtual void setParentWidget(QWidget* parent);
 152
 153 QWidget* qwidget();
 154 void setQWidget(QWidget* widget);
 155#endif
 156
 157
144158#if __APPLE__
145159 Widget(NSView* view);
146160
Revision 15924

WebCore/platform/ImageSource.h

3131
3232#if __APPLE__
3333#include <ApplicationServices/ApplicationServices.h>
 34#elif PLATFORM(QT)
 35class QImage;
3436#else
3537struct _cairo_surface;
3638typedef struct _cairo_surface cairo_surface_t;

4446typedef CGImageSourceRef NativeImageSourcePtr;
4547typedef CGImageRef NativeImagePtr;
4648typedef CFDataRef NativeBytePtr;
 49#elif PLATFORM(QT)
 50class ImageDecoder;
 51typedef ImageDecoder* NativeImageSourcePtr;
 52typedef const Vector<char>* NativeBytePtr;
 53typedef QImage* NativeImagePtr;
4754#else
4855class ImageDecoder;
4956typedef ImageDecoder* NativeImageSourcePtr;
Revision 15924

WebCore/platform/ResourceLoaderInternal.h

4040typedef void CURL;
4141#endif
4242
 43#if PLATFORM(QT)
 44#include <QString>
 45typedef void CURL;
 46#endif
 47
4348// The allocations and releases in ResourceLoaderInternal are
4449// Cocoa-exception-free (either simple Foundation classes or
4550// WebCoreResourceLoaderImp which avoids doing work in dealloc).

7277 , m_formDataLength(0)
7378 , m_bytesRemainingToWrite(0)
7479#endif
75 #if PLATFORM(GDK)
 80#if PLATFORM(GDK) || PLATFORM(QT)
7681 , m_handle(0)
7782#endif
7883 {

102107 , m_formDataLength(0)
103108 , m_bytesRemainingToWrite(0)
104109#endif
105 #if PLATFORM(GDK)
 110#if PLATFORM(GDK) || PLATFORM(QT)
106111 , m_handle(0)
107112#endif
108113 {

142147#if PLATFORM(GDK)
143148 CURL *m_handle;
144149#endif
 150#if PLATFORM(QT)
 151 CURL *m_handle;
 152 QString response;
 153#endif
 154
145155 };
146156
147157} // namespace WebCore
Revision 15924

WebCore/platform/GlyphBuffer.h

3939#elif PLATFORM(WIN) || PLATFORM(GDK)
4040#include <cairo.h>
4141#include "FloatSize.h"
 42#elif PLATFORM(QT)
 43#include "FloatSize.h"
4244#endif
4345
4446#include <wtf/Vector.h>

5456#elif PLATFORM(WIN) || PLATFORM(GDK)
5557typedef cairo_glyph_t GlyphBufferGlyph;
5658typedef FloatSize GlyphBufferAdvance;
 59#elif PLATFORM(QT)
 60typedef unsigned short GlyphBufferGlyph;
 61typedef FloatSize GlyphBufferAdvance;
5762#endif
5863
5964class GlyphBuffer

9398
9499 Glyph glyphAt(int index) const
95100 {
96 #if __APPLE__
 101#if __APPLE__ || PLATFORM(QT)
97102 return m_glyphs[index];
98103#elif PLATFORM(WIN) || PLATFORM(GDK)
99104 return m_glyphs[index].index;

104109 {
105110#if __APPLE__
106111 return m_advances[index].width;
107 #elif PLATFORM(WIN) || PLATFORM(GDK)
 112#elif PLATFORM(WIN) || PLATFORM(GDK) || PLATFORM(QT)
108113 return m_advances[index].width();
109114#endif
110115 }

124129 cairoGlyph.y = 0;
125130 m_glyphs.append(cairoGlyph);
126131 m_advances.append(FloatSize(width, 0));
 132#elif PLATFORM(QT)
 133 m_glyphs.append(glyph);
 134 m_advances.append(FloatSize(width, 0));
127135#endif
128136 }
129137
Revision 15924

WebCore/platform/FloatRect.h

3939typedef struct _NSRect NSRect;
4040#endif
4141
 42#endif // __APPLE__
 43
 44#if PLATFORM(QT)
 45class QRectF;
4246#endif
4347
4448namespace WebCore {

105109 operator NSRect() const;
106110#endif
107111
 112#elif PLATFORM(QT)
 113 FloatRect(const QRectF&);
 114 operator QRectF() const;
108115#endif
109116
110117private:
Revision 15924

WebCore/platform/IntSize.h

4242
4343#if PLATFORM(WIN)
4444typedef struct tagSIZE SIZE;
 45#elif PLATFORM(QT)
 46class QSize;
4547#endif
4648
4749namespace WebCore {

9395 operator SIZE() const;
9496#endif
9597
 98#if PLATFORM(QT)
 99 IntSize(const QSize&);
 100 operator QSize() const;
 101#endif
 102
 103
96104private:
97105 int m_width, m_height;
98106};
Revision 15924

WebCore/platform/ScrollView.h

3030#include "Widget.h"
3131#include <wtf/Platform.h>
3232
 33#if PLATFORM(QT)
 34class QScrollArea;
 35#endif
 36
3337namespace WebCore {
3438 class FloatRect;
3539

101105 class ScrollViewPrivate;
102106 ScrollViewPrivate* m_data;
103107#endif
 108
 109#if PLATFORM(QT)
 110 ScrollView();
 111 ~ScrollView();
 112
 113 virtual void setParentWidget(QWidget* parent);
 114
 115 private:
 116 QScrollArea* m_area;
 117#endif
104118 };
105119
106120} // namespace WebCore
Revision 15924

WebCore/platform/Path.h

2828
2929#if __APPLE__
3030typedef struct CGPath PlatformPath;
 31#elif PLATFORM(QT)
 32class QPainterPath;
 33typedef QPainterPath PlatformPath;
3134#else
3235typedef void PlatformPath;
3336#endif
Revision 15924

WebCore/platform/PlatformMouseEvent.h

4747typedef union _GdkEvent GdkEvent;
4848#endif
4949
 50#if PLATFORM(QT)
 51class QMouseEvent;
 52#endif
 53
5054namespace WebCore {
5155
5256 // These button numbers match the one used in the DOM API.

100104#if PLATFORM(GDK)
101105 PlatformMouseEvent(GdkEvent*);
102106#endif
 107#if PLATFORM(QT)
 108 PlatformMouseEvent(QMouseEvent*, int clickCount);
 109#endif
103110
104111 private:
105112 IntPoint m_position;
Revision 15924

WebCore/platform/ResourceLoaderClient.h

4141#ifdef __APPLE__
4242 typedef NSData* PlatformData;
4343 typedef NSURLResponse* PlatformResponse;
 44#elif PLATFORM(QT)
 45 typedef void* PlatformData;
 46 typedef char* PlatformResponse;
4447#else
4548 // Not sure what the strategy for this will be on other platforms.
4649 typedef struct PlatformDataStruct *PlatformData;
Revision 15924