diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-10-13 14:25:18 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-13 15:07:41 +0200 |
commit | 1582407fc782c0befd0760633324dd5c206524a1 (patch) | |
tree | e993d66e824da41ece006d44c48acd4df0ba749e /src/gui/kernel | |
parent | 30cb91e17d2fbbdce90f7542f44e12af971ba2de (diff) |
Remove Q_WS_ and Q_OS_SYMBIAN from QtGui.
Change-Id: I2ac3376513c3fbfc81a2e695a73a0d948d2696bc
Reviewed-on: http://codereview.qt-project.org/6607
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qcursor.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qcursor.h | 33 | ||||
-rw-r--r-- | src/gui/kernel/qcursor_p.h | 45 | ||||
-rw-r--r-- | src/gui/kernel/qdnd.cpp | 19 | ||||
-rw-r--r-- | src/gui/kernel/qevent.cpp | 45 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 6 | ||||
-rw-r--r-- | src/gui/kernel/qevent_p.h | 6 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 115 | ||||
-rw-r--r-- | src/gui/kernel/qkeymapper_p.h | 62 | ||||
-rw-r--r-- | src/gui/kernel/qsessionmanager.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwindowdefs.h | 36 |
11 files changed, 1 insertions, 373 deletions
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 9ca06aaa98..faa9500f9f 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -395,10 +395,6 @@ void QCursorData::initialize() { if (QCursorData::initialized) return; -#ifdef Q_WS_MAC - // DRSWAT - Not Needed Cocoa or Carbon - //InitCursor(); -#endif for (int shape = 0; shape <= Qt::LastCursor; ++shape) qt_cursorTable[shape] = new QCursorData((Qt::CursorShape)shape); QCursorData::initialized = true; diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h index dac74c2c01..584aff42d3 100644 --- a/src/gui/kernel/qcursor.h +++ b/src/gui/kernel/qcursor.h @@ -76,15 +76,6 @@ class QCursorData; class QBitmap; class QPixmap; -#if defined(Q_WS_MAC) -void qt_mac_set_cursor(const QCursor *c); -#endif -#if defined(Q_OS_SYMBIAN) -extern void qt_symbian_show_pointer_sprite(); -extern void qt_symbian_hide_pointer_sprite(); -extern void qt_symbian_set_pointer_sprite(const QCursor& cursor); -extern void qt_symbian_move_cursor_sprite(); -#endif class Q_GUI_EXPORT QCursor { @@ -121,35 +112,11 @@ public: #endif #ifndef qdoc -#if defined(Q_WS_WIN) - HCURSOR handle() const; - QCursor(HCURSOR cursor); -#elif defined(Q_WS_X11) - Qt::HANDLE handle() const; - QCursor(Qt::HANDLE cursor); - static int x11Screen(); -#elif defined(Q_WS_MAC) - Qt::HANDLE handle() const; -#elif defined(Q_WS_QWS) || defined(Q_WS_QPA) int handle() const; -#elif defined(Q_OS_SYMBIAN) - Qt::HANDLE handle() const; -#endif #endif private: QCursorData *d; -#if defined(Q_WS_MAC) - friend void *qt_mac_nsCursorForQCursor(const QCursor &c); - friend void qt_mac_set_cursor(const QCursor *c); - friend void qt_mac_updateCursorWithWidgetUnderMouse(QWidget *widgetUnderMouse); -#endif -#if defined(Q_OS_SYMBIAN) - friend void qt_symbian_show_pointer_sprite(); - friend void qt_symbian_hide_pointer_sprite(); - friend void qt_symbian_set_pointer_sprite(const QCursor& cursor); - friend void qt_symbian_move_cursor_sprite(); -#endif }; /***************************************************************************** diff --git a/src/gui/kernel/qcursor_p.h b/src/gui/kernel/qcursor_p.h index 775d46d792..71a07cca49 100644 --- a/src/gui/kernel/qcursor_p.h +++ b/src/gui/kernel/qcursor_p.h @@ -58,22 +58,9 @@ #include "QtCore/qnamespace.h" #include "QtGui/qpixmap.h" -# if defined (Q_WS_MAC) -# include "private/qt_mac_p.h" -# elif defined(Q_WS_X11) -# include "private/qt_x11_p.h" -# elif defined(Q_WS_WIN) -# include "QtCore/qt_windows.h" -# elif defined(Q_OS_SYMBIAN) -# include "private/qt_s60_p.h" -#endif QT_BEGIN_NAMESPACE -#if defined (Q_WS_MAC) -void *qt_mac_nsCursorForQCursor(const QCursor &c); -class QMacAnimateCursor; -#endif class QBitmap; class QCursorData { @@ -89,39 +76,7 @@ public: QBitmap *bm, *bmm; QPixmap pixmap; short hx, hy; -#if defined (Q_WS_MAC) - int mId; -#elif defined(Q_WS_QWS) || defined(Q_WS_QPA) int id; -#endif -#if defined (Q_WS_WIN) - HCURSOR hcurs; -#elif defined (Q_WS_X11) - XColor fg, bg; - Cursor hcurs; - Pixmap pm, pmm; -#elif defined (Q_WS_MAC) - enum { TYPE_None, TYPE_ImageCursor, TYPE_ThemeCursor } type; - union { - struct { - uint my_cursor:1; - void *nscursor; - } cp; - struct { - QMacAnimateCursor *anim; - ThemeCursor curs; - } tc; - } curs; - void initCursorFromBitmap(); - void initCursorFromPixmap(); -#elif defined Q_OS_SYMBIAN - void loadShapeFromResource(RWsSpriteBase& target, QString resource, int hx, int hy, int interval=0); - void constructShapeSprite(RWsSpriteBase& target); - void constructCursorSprite(RWsSpriteBase& target); - RWsPointerCursor pcurs; - RWsSprite scurs; - RPointerArray<TSpriteMember> nativeSpriteMembers; -#endif static bool initialized; void update(); static QCursorData *setBitmap(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY); diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp index de255b9cc5..6cf986ff66 100644 --- a/src/gui/kernel/qdnd.cpp +++ b/src/gui/kernel/qdnd.cpp @@ -132,18 +132,12 @@ QDragManager::QDragManager() { Q_ASSERT(!instance); -#ifdef Q_WS_QWS - currentActionForOverrideCursor = Qt::IgnoreAction; -#endif object = 0; beingCancelled = false; restoreCursor = false; willDrop = false; eventLoop = 0; currentDropTarget = 0; -#ifdef Q_WS_X11 - xdndMimeTransferedPixmapIndex = 0; -#endif shapedPixmapWindow = 0; possible_actions = Qt::IgnoreAction; @@ -211,21 +205,9 @@ Qt::DropAction QDragManager::defaultAction(Qt::DropActions possibleActions, if (defaultAction == Qt::IgnoreAction) { //This means that the drag was initiated by QDrag::start and we need to //preserve the old behavior -#ifdef Q_WS_MAC - defaultAction = Qt::MoveAction; -#else defaultAction = Qt::CopyAction; -#endif } -#ifdef Q_WS_MAC - if (modifiers & Qt::ControlModifier && modifiers & Qt::AltModifier) - defaultAction = Qt::LinkAction; - else if (modifiers & Qt::AltModifier) - defaultAction = Qt::CopyAction; - else if (modifiers & Qt::ControlModifier) - defaultAction = Qt::MoveAction; -#else if (modifiers & Qt::ControlModifier && modifiers & Qt::ShiftModifier) defaultAction = Qt::LinkAction; else if (modifiers & Qt::ControlModifier) @@ -234,7 +216,6 @@ Qt::DropAction QDragManager::defaultAction(Qt::DropActions possibleActions, defaultAction = Qt::MoveAction; else if (modifiers & Qt::AltModifier) defaultAction = Qt::LinkAction; -#endif #ifdef QDND_DEBUG qDebug("possible actions : %s", dragActionsToString(possibleActions).latin1()); diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index ed22ffe148..c9e49ef700 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -50,9 +50,6 @@ #include "qevent_p.h" #include "qmath.h" -#ifdef Q_OS_SYMBIAN -#include "private/qcore_symbian_p.h" -#endif QT_BEGIN_NAMESPACE @@ -838,16 +835,6 @@ bool QKeyEvent::matches(QKeySequence::StandardKey matchKey) const uint searchkey = (modifiers() | key()) & ~(Qt::KeypadModifier); //The keypad modifier should not make a difference uint platform = QGuiApplicationPrivate::currentKeyPlatform(); -#ifdef Q_WS_MAC - if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) { - uint oldSearchKey = searchkey; - searchkey &= ~(Qt::ControlModifier | Qt::MetaModifier); - if (oldSearchKey & Qt::ControlModifier) - searchkey |= Qt::MetaModifier; - if (oldSearchKey & Qt::MetaModifier) - searchkey |= Qt::ControlModifier; - } -#endif uint N = QKeySequencePrivate::numberOfKeyBindings; int first = 0; @@ -2733,9 +2720,6 @@ QShowEvent::~QShowEvent() QFileOpenEventPrivate::~QFileOpenEventPrivate() { -#ifdef Q_OS_SYMBIAN - file.Close(); -#endif } /*! @@ -2761,21 +2745,6 @@ QFileOpenEvent::QFileOpenEvent(const QUrl &url) f = url.toLocalFile(); } -#ifdef Q_OS_SYMBIAN -/*! \internal -*/ -QFileOpenEvent::QFileOpenEvent(const RFile &fileHandle) - : QEvent(FileOpen) -{ - TFileName fullName; - fileHandle.FullName(fullName); - f = qt_TDesC2QString(fullName); - QScopedPointer<QFileOpenEventPrivate> priv(new QFileOpenEventPrivate(QUrl::fromLocalFile(f))); - // Duplicate here allows the file handle to be valid after S60 app construction is complete. - qt_symbian_throwIfError(priv->file.Duplicate(fileHandle)); - d = reinterpret_cast<QEventPrivate *>(priv.take()); -} -#endif /*! \internal */ @@ -2818,20 +2787,6 @@ QUrl QFileOpenEvent::url() const bool QFileOpenEvent::openFile(QFile &file, QIODevice::OpenMode flags) const { file.setFileName(f); -#ifdef Q_OS_SYMBIAN - const QFileOpenEventPrivate *priv = reinterpret_cast<const QFileOpenEventPrivate *>(d); - if (priv->file.SubSessionHandle()) { - RFile dup; - // Duplicate here means that the opened QFile will continue to be valid beyond the lifetime of this QFileOpenEvent. - // It also allows openFile to be used in threads other than the thread in which the QFileOpenEvent was created. - if (dup.Duplicate(priv->file) == KErrNone) { - QScopedPointer<RFile, QScopedPointerRCloser<RFile> > dupCloser(&dup); - bool open = file.open(dup, flags, QFile::AutoCloseHandle); - dupCloser.take(); - return open; - } - } -#endif return file.open(flags); } diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index eea9b2bdf1..ae16776c57 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -55,9 +55,6 @@ #include <QtCore/qset.h> #include <QtCore/qfile.h> -#ifdef Q_OS_SYMBIAN -class RFile; -#endif QT_BEGIN_HEADER @@ -609,9 +606,6 @@ class Q_GUI_EXPORT QFileOpenEvent : public QEvent public: QFileOpenEvent(const QString &file); QFileOpenEvent(const QUrl &url); -#ifdef Q_OS_SYMBIAN - QFileOpenEvent(const RFile &fileHandle); -#endif ~QFileOpenEvent(); inline QString file() const { return f; } diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h index f304f44846..1d65eb63be 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -46,9 +46,6 @@ #include <QtCore/qurl.h> #include <QtGui/qevent.h> -#ifdef Q_OS_SYMBIAN -#include <f32file.h> -#endif QT_BEGIN_NAMESPACE @@ -120,9 +117,6 @@ public: ~QFileOpenEventPrivate(); QUrl url; -#ifdef Q_OS_SYMBIAN - RFile file; -#endif }; diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 723f69199f..e4216a60b9 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1369,13 +1369,8 @@ Qt::LayoutDirection QGuiApplication::keyboardInputDirection() static const char * const move_xpm[] = { "11 20 3 1", ". c None", -#if defined(Q_WS_WIN) -"a c #000000", -"X c #FFFFFF", // Windows cursor is traditionally white -#else "a c #FFFFFF", "X c #000000", // X11 cursor is traditionally black -#endif "aa.........", "aXa........", "aXXa.......", @@ -1397,44 +1392,6 @@ static const char * const move_xpm[] = { ".......aXXa", "........aa."}; -#ifdef Q_WS_WIN -/* XPM */ -static const char * const ignore_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa.....XXXX.....", -".......aXXa..XXaaaaXX...", -".......aXXa.XaaaaaaaaX..", -"........aa.XaaaXXXXaaaX.", -"...........XaaaaX..XaaX.", -"..........XaaXaaaX..XaaX", -"..........XaaXXaaaX.XaaX", -"..........XaaX.XaaaXXaaX", -"..........XaaX..XaaaXaaX", -"...........XaaX..XaaaaX.", -"...........XaaaXXXXaaaX.", -"............XaaaaaaaaX..", -".............XXaaaaXX...", -"...............XXXX....."}; -#endif /* XPM */ static const char * const copy_xpm[] = { @@ -1442,28 +1399,6 @@ static const char * const copy_xpm[] = { ". c None", "a c #000000", "X c #FFFFFF", -#if defined(Q_WS_WIN) // Windows cursor is traditionally white -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa..............", -".......aXXa.............", -".......aXXa.............", -"........aa...aaaaaaaaaaa", -#else "XX......................", "XaX.....................", "XaaX....................", @@ -1484,7 +1419,6 @@ static const char * const copy_xpm[] = { ".......XaaX.............", ".......XaaX.............", "........XX...aaaaaaaaaaa", -#endif ".............aXXXXXXXXXa", ".............aXXXXXXXXXa", ".............aXXXXaXXXXa", @@ -1502,28 +1436,6 @@ static const char * const link_xpm[] = { ". c None", "a c #000000", "X c #FFFFFF", -#if defined(Q_WS_WIN) // Windows cursor is traditionally white -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa..............", -".......aXXa.............", -".......aXXa.............", -"........aa...aaaaaaaaaaa", -#else "XX......................", "XaX.....................", "XaaX....................", @@ -1544,7 +1456,6 @@ static const char * const link_xpm[] = { ".......XaaX.............", ".......XaaX.............", "........XX...aaaaaaaaaaa", -#endif ".............aXXXXXXXXXa", ".............aXXXaaaaXXa", ".............aXXXXaaaXXa", @@ -1558,33 +1469,7 @@ static const char * const link_xpm[] = { QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) { -#if defined(Q_WS_X11) || defined(Q_WS_WIN) - if (!move_cursor) { - move_cursor = new QPixmap((const char **)move_xpm); - copy_cursor = new QPixmap((const char **)copy_xpm); - link_cursor = new QPixmap((const char **)link_xpm); -#ifdef Q_WS_WIN - ignore_cursor = new QPixmap((const char **)ignore_xpm); -#endif - } - - switch (cshape) { - case Qt::DragMoveCursor: - return *move_cursor; - case Qt::DragCopyCursor: - return *copy_cursor; - case Qt::DragLinkCursor: - return *link_cursor; -#ifdef Q_WS_WIN - case Qt::ForbiddenCursor: - return *ignore_cursor; -#endif - default: - break; - } -#else Q_UNUSED(cshape); -#endif return QPixmap(); } diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h index 35f2a63345..95dd624164 100644 --- a/src/gui/kernel/qkeymapper_p.h +++ b/src/gui/kernel/qkeymapper_p.h @@ -60,9 +60,6 @@ #include <qevent.h> #include <qhash.h> -#if defined (Q_WS_MAC64) -# include <private/qt_mac_p.h> -#endif QT_BEGIN_NAMESPACE @@ -76,13 +73,6 @@ public: static QKeyMapper *instance(); static void changeKeyboard(); -#ifndef Q_WS_QPA - static bool sendKeyEvent(QWidget *widget, bool grab, - QEvent::Type type, int code, Qt::KeyboardModifiers modifiers, - const QString &text, bool autorepeat, int count, - quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, - bool *unusedExceptForCocoa = 0); -#endif static QList<int> possibleKeys(QKeyEvent *e); private: @@ -166,57 +156,7 @@ public: void deleteLayouts(); KeyboardLayoutItem *keyLayout[256]; - -#elif defined(Q_WS_X11) - - QList<int> possibleKeysXKB(QKeyEvent *event); - QList<int> possibleKeysCore(QKeyEvent *event); - - bool translateKeyEventInternal(QWidget *keywidget, - const XEvent *, - KeySym &keysym, - int& count, - QString& text, - Qt::KeyboardModifiers& modifiers, - int &code, - QEvent::Type &type, - bool statefulTranslation = true); - bool translateKeyEvent(QWidget *keywidget, - const XEvent *, - bool grab); - - int xkb_currentGroup; - QXCoreDesc coreDesc; - -#elif defined(Q_WS_MAC) - bool updateKeyboard(); - void updateKeyMap(EventHandlerCallRef, EventRef, void *); - bool translateKeyEvent(QWidget *, EventHandlerCallRef, EventRef, void *, bool); - void deleteLayouts(); - - enum { NullMode, UnicodeMode, OtherMode } keyboard_mode; - union { - const UCKeyboardLayout *unicode; - void *other; - } keyboard_layout_format; -#ifdef Q_WS_MAC64 - QCFType<TISInputSourceRef> currentInputSource; -#else - KeyboardLayoutRef currentKeyboardLayout; -#endif - KeyboardLayoutKind keyboard_kind; - UInt32 keyboard_dead; - KeyboardLayoutItem *keyLayout[256]; -#elif defined(Q_WS_QWS) -#elif defined(Q_OS_SYMBIAN) -public: - QString translateKeyEvent(int keySym, Qt::KeyboardModifiers modifiers); - int mapS60KeyToQt(TUint s60key); - int mapS60ScanCodesToQt(TUint s60key); - int mapQtToS60Key(int qtKey); - int mapQtToS60ScanCodes(int qtKey); - void updateInputLanguage(); -#endif +#endif // defined(Q_OS_WIN) }; QKeyMapperPrivate *qt_keymapper_private(); // from qkeymapper.cpp diff --git a/src/gui/kernel/qsessionmanager.h b/src/gui/kernel/qsessionmanager.h index 3328fa9011..31a26c1582 100644 --- a/src/gui/kernel/qsessionmanager.h +++ b/src/gui/kernel/qsessionmanager.h @@ -68,9 +68,6 @@ class Q_GUI_EXPORT QSessionManager : public QObject public: QString sessionId() const; QString sessionKey() const; -#if defined(Q_WS_X11) || defined(Q_WS_MAC) - void *handle() const; -#endif bool allowsInteraction(); bool allowsErrorInteraction(); diff --git a/src/gui/kernel/qwindowdefs.h b/src/gui/kernel/qwindowdefs.h index 165b62da8f..b77ec0b2f3 100644 --- a/src/gui/kernel/qwindowdefs.h +++ b/src/gui/kernel/qwindowdefs.h @@ -92,53 +92,17 @@ QT_END_HEADER // Window system dependent definitions -#if defined(Q_WS_MAC) && !defined(Q_WS_QWS) - -#include <QtGui/qmacdefines_mac.h> - -#ifdef Q_WS_MAC32 -typedef int WId; -#else -typedef long WId; -#endif - -#endif // Q_WS_MAC #if defined(Q_OS_WIN) # include <QtGui/qwindowdefs_win.h> #endif // Q_OS_WIN -#if defined(Q_WS_X11) - -typedef struct _XDisplay Display; -typedef union _XEvent XEvent; -typedef struct _XGC *GC; -typedef struct _XRegion *Region; -typedef unsigned long WId; - -#endif // Q_WS_X11 - -#if defined(Q_WS_QWS) - -typedef unsigned long WId; -QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE -struct QWSEvent; -QT_END_NAMESPACE -QT_END_HEADER -#endif // Q_WS_QWS -#if defined(Q_WS_QPA) typedef unsigned long WId; -#endif // Q_WS_QPA -#if defined(Q_OS_SYMBIAN) -class CCoeControl; -typedef CCoeControl * WId; -#endif // Q_OS_SYMBIAN QT_BEGIN_HEADER QT_BEGIN_NAMESPACE |