Commit 511b001e authored by hausmann@webkit.org's avatar hausmann@webkit.org

Fix compilation with Qt namespaces

Qt can be configured to have all of its classes inside a specified namespaces.
This is for example used in plugin/component environments like Eclipse.

This change makes it possible to let the Qt port compile against a namespaced
Qt by the use of macros Qt provides to properly forward declare Qt classes in
the namespace.

Signed-off-by: Simon


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 87342af4
2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
Reviewed by Simon.
Fix compilation with Qt namespaces
Qt can be configured to have all of its classes inside a specified namespaces.
This is for example used in plugin/component environments like Eclipse.
This change makes it possible to let the Qt port compile against a namespaced
Qt by the use of macros Qt provides to properly forward declare Qt classes in
the namespace.
* wtf/unicode/qt4/UnicodeQt4.h:
2008-04-14 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
......
......@@ -31,6 +31,7 @@
#include <stdint.h>
#if QT_VERSION >= 0x040300
QT_BEGIN_NAMESPACE
namespace QUnicodeTables {
struct Properties {
ushort category : 8;
......@@ -53,6 +54,7 @@ namespace QUnicodeTables {
Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4);
Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2);
}
QT_END_NAMESPACE
#endif
// ugly hack to make UChar compatible with JSChar in API/JSStringRef.h
......
2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
Reviewed by Simon.
Fix compilation with Qt namespaces
Qt can be configured to have all of its classes inside a specified namespaces.
This is for example used in plugin/component environments like Eclipse.
This change makes it possible to let the Qt port compile against a namespaced
Qt by the use of macros Qt provides to properly forward declare Qt classes in
the namespace.
* WebCore.pro:
* bridge/qt/qt_class.h:
* bridge/qt/qt_instance.h:
* html/HTMLCanvasElement.h:
* platform/DragData.h:
* platform/DragImage.h:
* platform/KURL.h:
* platform/PlatformKeyboardEvent.h:
* platform/PlatformMouseEvent.h:
* platform/PlatformWheelEvent.h:
* platform/Widget.h:
* platform/graphics/Color.h:
* platform/graphics/FloatPoint.h:
* platform/graphics/FloatRect.h:
* platform/graphics/Gradient.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageSource.h:
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/Path.h:
* platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
* platform/graphics/qt/MediaPlayerPrivatePhonon.h:
* platform/network/qt/QNetworkReplyHandler.h:
* platform/network/qt/ResourceRequest.h:
* platform/qt/ClipboardQt.h:
* platform/qt/RenderThemeQt.h:
* platform/text/PlatformString.h:
* platform/text/qt/TextCodecQt.h:
* svg/graphics/SVGPaintServer.h:
* svg/graphics/SVGPaintServerGradient.h:
2008-04-14 Brady Eidson <beidson@apple.com>
Reviewed by Anders
......@@ -1044,6 +1044,7 @@ qt-port {
../WebKit/qt/Api/qwebnetworkinterface.cpp \
../WebKit/qt/Api/qcookiejar.cpp
DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE=""
}
}
......
......@@ -21,8 +21,13 @@
#define BINDINGS_QT_CLASS_H_
#include "runtime.h"
#include "qglobal.h"
QT_BEGIN_NAMESPACE
class QObject;
class QMetaObject;
QT_END_NAMESPACE
namespace KJS {
namespace Bindings {
......
......@@ -25,8 +25,6 @@
#include <qpointer.h>
#include <qhash.h>
class QObject;
namespace KJS {
namespace Bindings {
......
......@@ -35,8 +35,10 @@
typedef struct CGContext* CGContextRef;
typedef struct CGImage* CGImageRef;
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QPixmap;
class QPainter;
QT_END_NAMESPACE
#elif PLATFORM(CAIRO)
typedef struct _cairo_surface cairo_surface_t;
#endif
......
......@@ -43,7 +43,9 @@ typedef id <NSDraggingInfo> DragDataRef;
typedef void* DragDataRef;
#endif
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QMimeData;
QT_END_NAMESPACE
typedef const QMimeData* DragDataRef;
#elif PLATFORM(WIN)
typedef struct IDataObject* DragDataRef;
......
......@@ -37,7 +37,9 @@
class NSImage;
#endif
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QPixmap;
QT_END_NAMESPACE
#elif PLATFORM(WIN)
typedef struct HBITMAP__* HBITMAP;
#elif PLATFORM(WX)
......
......@@ -41,7 +41,9 @@ class NSURL;
#endif
#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QUrl;
QT_END_NAMESPACE
#endif
namespace WebCore {
......
......@@ -50,7 +50,9 @@ typedef struct _GdkEventKey GdkEventKey;
#endif
#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QKeyEvent;
QT_END_NAMESPACE
#endif
#if PLATFORM(WX)
......
......@@ -54,7 +54,9 @@ typedef struct _GdkEventMotion GdkEventMotion;
#endif
#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QInputEvent;
QT_END_NAMESPACE
#endif
#if PLATFORM(WX)
......
......@@ -47,7 +47,9 @@ typedef struct _GdkEventScroll GdkEventScroll;
#endif
#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QWheelEvent;
QT_END_NAMESPACE
#endif
#if PLATFORM(WX)
......
......@@ -51,7 +51,10 @@ typedef GtkWidget* PlatformWidget;
#endif
#if PLATFORM(QT)
#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QWidget;
QT_END_NAMESPACE
typedef QWidget* PlatformWidget;
#endif
......
......@@ -33,7 +33,10 @@ typedef struct CGColor* CGColorRef;
#endif
#if PLATFORM(QT)
#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QColor;
QT_END_NAMESPACE
#endif
#if PLATFORM(GTK)
......
......@@ -43,7 +43,10 @@ typedef struct _NSPoint NSPoint;
#endif
#if PLATFORM(QT)
#include "qglobal.h"
QT_BEGIN_NAMESPACE
class QPointF;
QT_END_NAMESPACE
#endif
#if PLATFORM(SYMBIAN)
......
......@@ -42,7 +42,9 @@ typedef struct _NSRect NSRect;
#endif
#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QRectF;
QT_END_NAMESPACE
#endif
#if PLATFORM(WX) && USE(WXGC)
......
......@@ -37,7 +37,9 @@
typedef struct CGShading* CGShadingRef;
typedef CGShadingRef PlatformGradient;
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QGradient;
QT_END_NAMESPACE
typedef QGradient* PlatformGradient;
#elif PLATFORM(CAIRO)
typedef struct _cairo_pattern cairo_pattern_t;
......
......@@ -39,7 +39,9 @@ typedef struct CGContext PlatformGraphicsContext;
#elif PLATFORM(CAIRO)
typedef struct _cairo PlatformGraphicsContext;
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QPainter;
QT_END_NAMESPACE
typedef QPainter PlatformGraphicsContext;
#elif PLATFORM(WX)
class wxGCDC;
......
......@@ -43,7 +43,9 @@ typedef struct CGImage* CGImageRef;
#if PLATFORM(QT)
#include <QPixmap>
QT_BEGIN_NAMESPACE
class QPainter;
QT_END_NAMESPACE
#endif
#if PLATFORM(CAIRO)
......
......@@ -36,7 +36,10 @@ typedef struct CGImageSource* CGImageSourceRef;
typedef struct CGImage* CGImageRef;
typedef const struct __CFData* CFDataRef;
#elif PLATFORM(QT)
#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QPixmap;
QT_END_NAMESPACE
#elif PLATFORM(CAIRO)
struct _cairo_surface;
typedef struct _cairo_surface cairo_surface_t;
......
......@@ -45,7 +45,9 @@ typedef struct _NSPoint NSPoint;
typedef struct tagPOINT POINT;
typedef struct tagPOINTS POINTS;
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QPoint;
QT_END_NAMESPACE
#elif PLATFORM(GTK)
typedef struct _GdkPoint GdkPoint;
#endif
......
......@@ -44,7 +44,9 @@ typedef struct _NSRect NSRect;
#if PLATFORM(WIN)
typedef struct tagRECT RECT;
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QRect;
QT_END_NAMESPACE
#elif PLATFORM(GTK)
typedef struct _GdkRectangle GdkRectangle;
#endif
......
......@@ -43,7 +43,10 @@ typedef struct _NSSize NSSize;
#if PLATFORM(WIN)
typedef struct tagSIZE SIZE;
#elif PLATFORM(QT)
#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QSize;
QT_END_NAMESPACE
#endif
#if PLATFORM(SYMBIAN)
class TSize;
......
......@@ -30,7 +30,10 @@
#if PLATFORM(CG)
typedef struct CGPath PlatformPath;
#elif PLATFORM(QT)
#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QPainterPath;
QT_END_NAMESPACE
typedef QPainterPath PlatformPath;
#elif PLATFORM(WX) && USE(WXGC)
class wxGraphicsPath;
......
......@@ -32,6 +32,9 @@
#include <QDebug>
#include <QPainter>
#include <QWidget>
#include <QMetaEnum>
#include <QUrl>
#include <QEvent>
#include <phonon>
using namespace Phonon;
......
......@@ -29,7 +29,6 @@
QT_BEGIN_NAMESPACE
class QWidget;
class QUrl;
QT_END_NAMESPACE
namespace Phonon {
class MediaObject;
......@@ -37,6 +36,7 @@ namespace Phonon {
class AudioOutput;
class MediaSource;
}
QT_END_NAMESPACE
namespace WebCore {
......
......@@ -28,8 +28,10 @@
#include "FormData.h"
QT_BEGIN_NAMESPACE
class QFile;
class QNetworkReply;
QT_END_NAMESPACE
namespace WebCore {
......
......@@ -30,7 +30,9 @@
#include "ResourceRequestBase.h"
QT_BEGIN_NAMESPACE
class QNetworkRequest;
QT_END_NAMESPACE
namespace WebCore {
......
......@@ -30,7 +30,9 @@
#include "CachedResourceClient.h"
#include "ClipboardAccessPolicy.h"
QT_BEGIN_NAMESPACE
class QMimeData;
QT_END_NAMESPACE
namespace WebCore {
......
......@@ -24,10 +24,12 @@
#include "RenderTheme.h"
QT_BEGIN_NAMESPACE
class QStyle;
class QPainter;
class QWidget;
class QStyleOption;
QT_END_NAMESPACE
namespace WebCore {
......
......@@ -32,7 +32,9 @@ typedef const struct __CFString * CFStringRef;
#endif
#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QString;
QT_END_NAMESPACE
#endif
#if PLATFORM(WX)
......
......@@ -30,8 +30,6 @@
#include "TextEncoding.h"
#include <QTextCodec>
class QTextCodec;
namespace WebCore {
class TextCodecQt : public TextCodec {
......
......@@ -35,7 +35,10 @@
#endif
#if PLATFORM(QT)
#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QPen;
QT_END_NAMESPACE
#endif
#if PLATFORM(CG)
......
......@@ -36,7 +36,10 @@
#include <wtf/RefPtr.h>
#if PLATFORM(QT)
#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QGradient;
QT_END_NAMESPACE
#endif
namespace WebCore {
......
......@@ -31,18 +31,20 @@
#endif
#include "qwebkitglobal.h"
QT_BEGIN_NAMESPACE
class QRect;
class QPoint;
class QPainter;
class QPixmap;
class QMouseEvent;
class QWheelEvent;
class QWebNetworkRequest;
class QNetworkRequest;
class QRegion;
QT_END_NAMESPACE
class QWebNetworkRequest;
class QWebFramePrivate;
class QWebPage;
class QRegion;
namespace WebCore {
class WidgetPrivate;
......
......@@ -29,14 +29,18 @@
#include <QtCore/qobject.h>
#include <QtGui/qwidget.h>
QT_BEGIN_NAMESPACE
class QNetworkProxy;
class QUndoStack;
class QUrl;
class QWebFrame;
class QWebNetworkRequest;
class QNetworkRequest;
class QNetworkReply;
class QNetworkAccessManager;
QT_END_NAMESPACE
class QWebFrame;
class QWebNetworkRequest;
class QWebHistory;
class QWebPagePrivate;
......
......@@ -46,8 +46,10 @@ namespace WebCore
class Page;
}
QT_BEGIN_NAMESPACE
class QUndoStack;
class QMenu;
QT_END_NAMESPACE
class QWebPageContextPrivate
{
......
......@@ -25,9 +25,11 @@
#include <QtCore/qobject.h>
#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
class QUrl;
class QWebPluginFactoryPrivate;
class QString;
QT_END_NAMESPACE
class QWebPluginFactoryPrivate;
class QWEBKIT_EXPORT QWebPluginFactory : public QObject
{
......
......@@ -36,7 +36,9 @@ namespace WebCore
class QWebPage;
class QWebSettingsPrivate;
QT_BEGIN_NAMESPACE
class QUrl;
QT_END_NAMESPACE
class QWEBKIT_EXPORT QWebSettings
{
......
......@@ -28,9 +28,12 @@
#include <QtNetwork/qnetworkaccessmanager.h>
#endif
QT_BEGIN_NAMESPACE
class QNetworkRequest;
QT_END_NAMESPACE
class QWebPage;
class QWebViewPrivate;
class QNetworkRequest;
class QWebNetworkRequest;
class QWEBKIT_EXPORT QWebView : public QWidget
......
2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
Reviewed by Simon.
Fix compilation with Qt namespaces
Qt can be configured to have all of its classes inside a specified namespaces.
This is for example used in plugin/component environments like Eclipse.
This change makes it possible to let the Qt port compile against a namespaced
Qt by the use of macros Qt provides to properly forward declare Qt classes in
the namespace.
* Api/qwebframe.h:
* Api/qwebpage.h:
* Api/qwebpage_p.h:
* Api/qwebpluginfactory.h:
* Api/qwebsettings.h:
* Api/qwebview.h:
2008-04-05 Olivier Goffart <ogoffart@trolltech.com>
Reviewed by Holger.
......
2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
Reviewed by Simon.
Fix compilation with Qt namespaces
Qt can be configured to have all of its classes inside a specified namespaces.
This is for example used in plugin/component environments like Eclipse.
This change makes it possible to let the Qt port compile against a namespaced
Qt by the use of macros Qt provides to properly forward declare Qt classes in
the namespace.
* DumpRenderTree/qt/DumpRenderTree.h:
2008-04-08 Kevin Ollivier <kevino@theolliviers.com>
Reviewed by Darin Adler.
......
......@@ -33,8 +33,11 @@
#include <QObject>
#include <QTextStream>
#include <QSocketNotifier>
QT_BEGIN_NAMESPACE
class QUrl;
class QFile;
QT_END_NAMESPACE
class QWebPage;
class QWebFrame;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment