OSDN Git Service

mostly mac leftovers removal
authorIvailo Monev <xakepa10@laimg.moc>
Mon, 19 Sep 2016 18:52:24 +0000 (18:52 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Mon, 19 Sep 2016 18:52:24 +0000 (18:52 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
15 files changed:
src/gui/dialogs/qfontdialog.h
src/gui/dialogs/qfontdialog_p.h
src/gui/graphicsview/qgraphicsview_p.h
src/gui/graphicsview/qgraphicswidget.cpp
src/gui/kernel/qwidget_p.h
src/gui/kernel/qwindowdefs.h
src/gui/painting/qgraphicssystem_p.h
src/gui/text/qfont.h
src/gui/text/qfont_p.h
src/gui/text/qfontengine_p.h
src/gui/text/qfontengineglyphcache_p.h
src/gui/text/qfontmetrics.h
src/gui/widgets/qmainwindowlayout_p.h
src/gui/widgets/qtabbar_p.h
src/gui/widgets/qtoolbar_p.h

index b7a07f7..17643a7 100644 (file)
@@ -119,9 +119,6 @@ private:
     Q_PRIVATE_SLOT(d_func(), void _q_styleHighlighted(int))
     Q_PRIVATE_SLOT(d_func(), void _q_sizeHighlighted(int))
     Q_PRIVATE_SLOT(d_func(), void _q_updateSample())
-#if defined(Q_WS_MAC)
-    Q_PRIVATE_SLOT(d_func(), void _q_macRunNativeAppModalPanel())
-#endif
 };
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(QFontDialog::FontDialogOptions)
index f767db7..1cd9ede 100644 (file)
@@ -137,26 +137,6 @@ public:
     QFontDialog::FontDialogOptions opts;
     QPointer<QObject> receiverToDisconnectOnClose;
     QByteArray memberToDisconnectOnClose;
-
-#ifdef Q_WS_MAC
-    static void setFont(void *delegate, const QFont &font);
-
-    inline void done(int result) { q_func()->done(result); }
-    inline QFontDialog *fontDialog() { return q_func(); }
-
-    void *delegate;
-    void closeCocoaFontPanel();
-    bool nativeDialogInUse;
-    bool canBeNativeDialog();
-    bool setVisible_sys(bool visible);
-    void createNSFontPanelDelegate();
-    void _q_macRunNativeAppModalPanel();
-    void mac_nativeDialogModalHelp();
-    bool showCocoaFontPanel();
-    bool hideCocoaFontPanel();
-
-    static bool sharedFontPanelAvailable;
-#endif
 };
 
 #endif // QT_NO_FONTDIALOG
index c930dfa..ee86ec1 100644 (file)
@@ -180,23 +180,10 @@ public:
 
     inline void dispatchPendingUpdateRequests()
     {
-#ifdef Q_WS_MAC
-        // QWidget::update() works slightly different on the Mac without the raster engine;
-        // it's not part of our backing store so it needs special threatment.
-        if (QApplicationPrivate::graphics_system_name != QLatin1String("raster")) {
-            // At this point either HIViewSetNeedsDisplay (Carbon) or setNeedsDisplay: YES (Cocoa)
-            // is called, which means there's a pending update request. We want to dispatch it
-            // now because otherwise graphics view updates would require two
-            // round-trips in the event loop before the item is painted.
-            extern void qt_mac_dispatchPendingUpdateRequests(QWidget *);
-            qt_mac_dispatchPendingUpdateRequests(viewport->window());
-        } else
-#endif // !Q_WS_MAC
         {
             if (qt_widget_private(viewport)->paintOnScreen())
                 QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest);
-            else
-                QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
+            QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
         }
     }
 
index 2c318c9..45746b5 100644 (file)
@@ -693,22 +693,6 @@ void QGraphicsWidget::initStyleOption(QStyleOption *option) const
         option->state |= QStyle::State_Window;
     /*
       ###
-#ifdef Q_WS_MAC
-    extern bool qt_mac_can_clickThrough(const QGraphicsWidget *w); //qwidget_mac.cpp
-    if (!(option->state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
-        option->state &= ~QStyle::State_Enabled;
-
-    switch (QMacStyle::widgetSizePolicy(widget)) {
-    case QMacStyle::SizeSmall:
-        option->state |= QStyle::State_Small;
-        break;
-    case QMacStyle::SizeMini:
-        option->state |= QStyle::State_Mini;
-        break;
-    default:
-        ;
-    }
-#endif
 #ifdef QT_KEYPAD_NAVIGATION
     if (widget->hasEditFocus())
         state |= QStyle::State_HasEditFocus;
@@ -2268,15 +2252,6 @@ void QGraphicsWidget::paintWindowFrame(QPainter *painter, const QStyleOptionGrap
     const QPointF styleOrigin = this->windowFrameRect().topLeft();
     painter->translate(styleOrigin);
 
-#ifdef Q_WS_MAC
-    const QSize pixmapSize = windowFrameRect.size();
-    if (pixmapSize.width() <= 0 || pixmapSize.height() <= 0)
-        return;
-    QPainter *realPainter = painter;
-    QPixmap pm(pixmapSize);
-    painter = new QPainter(&pm);
-#endif
-
     // Fill background
     QStyleHintReturnMask mask;
     bool setMask = style()->styleHint(QStyle::SH_WindowFrame_Mask, &bar, widget, &mask) && !mask.region.isEmpty();
@@ -2336,11 +2311,6 @@ void QGraphicsWidget::paintWindowFrame(QPainter *painter, const QStyleOptionGrap
     frameOptions.lineWidth = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, widget);
     frameOptions.midLineWidth = 1;
     style()->drawPrimitive(QStyle::PE_FrameWindow, &frameOptions, painter, widget);
-
-#ifdef Q_WS_MAC
-    realPainter->drawPixmap(QPoint(), pm);
-    delete painter;
-#endif
 }
 
 /*!
index 22aec90..e22e4bf 100644 (file)
 #include "QtGui/qgraphicsview.h"
 #include <qgesture_p.h>
 
-#ifdef Q_WS_WIN
-#include "QtCore/qt_windows.h"
-#include <qdnd_p.h>
-#endif // Q_WS_WIN
-
 #ifdef Q_WS_X11
 #include "QtGui/qx11info_x11.h"
 #endif
 
-#ifdef Q_WS_MAC
-#include <qt_mac_p.h>
-#endif
-
 QT_BEGIN_NAMESPACE
 
 // Extra QWidget data
 //  - to minimize memory usage for members that are seldom used.
 //  - top-level widgets have extra extra data to reduce cost further
-#if defined(Q_WS_MAC)
-class QCoreGraphicsPaintEnginePrivate;
-#endif
 class QPaintEngine;
 class QPixmap;
 class QWidgetBackingStore;
@@ -188,26 +176,6 @@ struct QTLWExtra {
     qint32 newCounterValueHi;
     quint32 newCounterValueLo;
 #endif
-#elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN
-    uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered.
-    HICON winIconBig; // internal big Windows icon
-    HICON winIconSmall; // internal small Windows icon
-#elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC
-    uint resizer : 4;
-    uint isSetGeometry : 1;
-    uint isMove : 1;
-    quint32 wattr;
-    quint32 wclass;
-    WindowGroupRef group;
-    IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys.
-    quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys()
-#ifdef QT_MAC_USE_COCOA
-    // This value is just to make sure we maximize and restore to the right location, yet we allow apps to be maximized and
-    // manually resized.
-    // The name is misleading, since this is set when maximizing the window. It is a hint to saveGeometry(..) to record the
-    // starting position as 0,0 instead of the normal starting position.
-    bool wasMaximized;
-#endif // QT_MAC_USE_COCOA
 #endif
 };
 
@@ -248,20 +216,9 @@ struct QWExtra {
     uint hasMask : 1;
 
     // *************************** Platform specific values (bit fields first) **********
-#if defined(Q_WS_WIN) // <----------------------------------------------------------- WIN
-#ifndef QT_NO_DRAGANDDROP
-    QOleDropTarget *dropTarget; // drop target
-    QList<QPointer<QWidget> > oleDropWidgets;
-#endif
-#elif defined(Q_WS_X11) // <--------------------------------------------------------- X11
+#if defined(Q_WS_X11) // <--------------------------------------------------------- X11
     uint compress_events : 1;
     WId xDndProxy; // XDND forwarding to embedded windows
-#elif defined(Q_WS_MAC) // <------------------------------------------------------ MAC
-#ifdef QT_MAC_USE_COCOA
-    // Cocoa Mask stuff
-    QImage maskBits;
-    CGImageRef imageMask;
-#endif
 #endif
 };
 
@@ -711,104 +668,6 @@ public:
     void updateX11AcceptFocus();
     QPoint mapToGlobal(const QPoint &pos) const;
     QPoint mapFromGlobal(const QPoint &pos) const;
-#elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN
-    uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine()
-#ifndef QT_NO_GESTURES
-    uint nativeGesturePanEnabled : 1;
-#endif
-    bool shouldShowMaximizeButton();
-    void winUpdateIsOpaque();
-    void reparentChildren();
-#ifndef QT_NO_DRAGANDDROP
-    QOleDropTarget *registerOleDnd(QWidget *widget);
-    void unregisterOleDnd(QWidget *widget, QOleDropTarget *target);
-#endif
-    void grabMouseWhileInWindow();
-    void registerTouchWindow();
-    void winSetupGestures();
-#elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC
-    // This is new stuff
-    uint needWindowChange : 1;
-
-    // Each wiget keeps a list of all its child and grandchild OpenGL widgets.
-    // This list is used to update the gl context whenever a parent and a granparent
-    // moves, and also to check for intersections with gl widgets within the window
-    // when a widget moves.
-    struct GlWidgetInfo
-    {
-        GlWidgetInfo(QWidget *widget) : widget(widget), lastUpdateWidget(0) { }
-        bool operator==(const GlWidgetInfo &other) const { return (widget == other.widget); }
-        QWidget * widget;
-        QWidget * lastUpdateWidget;
-    };
-
-    // dirtyOnWidget contains the areas in the widget that needs to be repained,
-    // in the same way as dirtyOnScreen does for the window. Areas are added in
-    // dirtyWidget_sys and cleared in the paint event. In scroll_sys we then use
-    // this information repaint invalid areas when widgets are scrolled.
-    QRegion dirtyOnWidget;
-    EventHandlerRef window_event;
-    QList<GlWidgetInfo> glWidgets;
-
-    //these are here just for code compat (HIViews)
-    Qt::HANDLE qd_hd;
-
-    void macUpdateSizeAttribute();
-    void macUpdateHideOnSuspend();
-    void macUpdateOpaqueSizeGrip();
-    void macUpdateIgnoreMouseEvents();
-    void macUpdateMetalAttribute();
-    void macUpdateIsOpaque();
-    void macSetNeedsDisplay(QRegion region);
-    void setEnabled_helper_sys(bool enable);
-    bool isRealWindow() const;
-    void adjustWithinMaxAndMinSize(int &w, int &h);
-    void applyMaxAndMinSizeOnWindow();
-    void update_sys(const QRect &rect);
-    void update_sys(const QRegion &rgn);
-    void setGeometry_sys_helper(int, int, int, int, bool);
-    void setWindowModified_sys(bool b);
-    void updateMaximizeButton_sys();
-    void setWindowFilePath_sys(const QString &filePath);
-    void createWindow_sys();
-    void recreateMacWindow();
-#ifndef QT_MAC_USE_COCOA
-    void initWindowPtr();
-    void finishCreateWindow_sys_Carbon(OSWindowRef windowRef);
-#else
-    void setSubWindowStacking(bool set);
-    void setWindowLevel();
-    void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef);
-    void syncCocoaMask();
-    void finishCocoaMaskSetup();
-    void syncUnifiedMode();
-    // Did we add the drawRectOriginal method?
-    bool drawRectOriginalAdded;
-    // Is the original drawRect method available?
-    bool originalDrawMethod;
-    // Do we need to change the methods?
-    bool changeMethods;
-
-    // Unified toolbar variables
-    bool isInUnifiedToolbar;
-    QUnifiedToolbarSurface *unifiedSurface;
-    QPoint toolbar_offset;
-    QWidget *toolbar_ancestor;
-    bool flushRequested;
-    bool touchEventsEnabled;
-#endif // QT_MAC_USE_COCOA
-    void determineWindowClass();
-    void transferChildren();
-    bool qt_mac_dnd_event(uint, DragRef);
-    void toggleDrawers(bool);
-    //mac event functions
-    static bool qt_create_root_win();
-    static void qt_clean_root_win();
-    static bool qt_mac_update_sizer(QWidget *, int up = 0);
-    static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *);
-    static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *);
-    static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool);
-    void registerTouchWindow(bool enable = true);
 #endif
 
 };
index abce189..bee557a 100644 (file)
@@ -90,22 +90,6 @@ QT_END_HEADER
 
 // Window system dependent definitions
 
-#if defined(Q_WS_MAC)
-
-#include <QtGui/qmacdefines_mac.h>
-
-#ifdef Q_WS_MAC32
-typedef int WId;
-#else
-typedef long WId;
-#endif
-
-#endif // Q_WS_MAC
-
-#if defined(Q_WS_WIN)
-#include <QtGui/qwindowdefs_win.h>
-#endif // Q_WS_WIN
-
 #if defined(Q_WS_X11)
 
 typedef struct _XDisplay Display;
index faf7e7b..4cafde5 100644 (file)
@@ -54,8 +54,8 @@
 //
 
 #include "qwindowsurface_p.h"
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MAC)
-# include <qpixmap_raster_p.h>
+#if defined(Q_WS_X11)
+# include "qpixmap_raster_p.h"
 #else
 #error QGraphicsSystem::createDefaultPixmapData() not implemented
 #endif
index ec071e3..7cc7c70 100644 (file)
@@ -281,9 +281,7 @@ private:
 
     void detach();
 
-#if defined(Q_WS_MAC)
-    void macSetFont(QPaintDevice *);
-#elif defined(Q_WS_X11)
+#if defined(Q_WS_X11)
     void x11SetScreen(int screen = -1);
     int x11Screen() const;
 #endif
index 94c6d45..d76ce61 100644 (file)
@@ -73,9 +73,6 @@ struct QFontDef
           styleStrategy(QFont::PreferDefault), styleHint(QFont::AnyStyle),
           weight(50), fixedPitch(false), style(QFont::StyleNormal), stretch(100),
           ignorePitch(true), hintingPreference(QFont::PreferDefaultHinting)
-#ifdef Q_WS_MAC
-          ,fixedPitchComputed(false)
-#endif
     {
     }
 
@@ -152,11 +149,7 @@ public:
     QAtomicInt ref;
     QFontCache *fontCache;
 
-#if !defined(Q_WS_MAC)
     QFontEngine *engines[QUnicodeTables::ScriptCount];
-#else
-    QFontEngine *engine;
-#endif
 };
 
 
index 66a8f12..41e41d9 100644 (file)
 #include <QtCore/QLinkedList>
 #include "qtextengine_p.h"
 #include "qfont_p.h"
-
-#ifdef Q_WS_WIN
-#   include "QtCore/qt_windows.h"
-#endif
-
-#ifdef Q_WS_MAC
-#   include "qt_mac_p.h"
-#   include "QtCore/qmap.h"
-#   include "QtCore/qcache.h"
-#   include "qcore_mac_p.h"
-#endif
-
-#include <qfontengineglyphcache_p.h>
+#include "qfontengineglyphcache_p.h"
 
 struct glyph_metrics_t;
 typedef unsigned int glyph_t;
@@ -167,7 +155,7 @@ public:
     virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const {}
     virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
 
-#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
+#if !defined(Q_WS_X11)
     virtual void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si) = 0;
 #endif
     virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
@@ -246,7 +234,7 @@ public:
     bool symbol;
     mutable HB_FontRec hbFont;
     mutable HB_Face hbFace;
-#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC)
+#if defined(Q_WS_X11)
     struct KernPair {
         uint left_right;
         QFixed adjust;
@@ -299,7 +287,7 @@ public:
     virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
     virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
 
-#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
+#if !defined(Q_WS_X11)
     void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
 #endif
     virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags);
index 409edcb..60d7039 100644 (file)
 #include "QtCore/qatomic.h"
 #include "qfont_p.h"
 
-#ifdef Q_WS_WIN
-#   include "QtCore/qt_windows.h"
-#endif
-
-#ifdef Q_WS_MAC
-#   include "qt_mac_p.h"
-#   include "QtCore/qmap.h"
-#   include "QtCore/qcache.h"
-#   include "qcore_mac_p.h"
-#endif
-
 QT_BEGIN_NAMESPACE
 
 class QFontEngineGlyphCache: public QSharedData
index e026e1e..e66764c 100644 (file)
@@ -114,9 +114,6 @@ public:
     inline bool operator !=(const QFontMetrics &other) const { return !operator==(other); }
 
 private:
-#if defined(Q_WS_MAC)
-    friend class QFontPrivate;
-#endif
     friend class QFontMetricsF;
     friend class QStackTextEngine;
 
index 9180f47..c1a6fb1 100644 (file)
@@ -77,20 +77,6 @@ Q_GUI_EXPORT void qt_dumpLayout(QTextStream &qout, QMainWindow *window);
 QT_END_NAMESPACE
 #endif // Q_DEBUG_MAINWINDOW_LAYOUT && !QT_NO_DOCKWIDGET
 
-#ifdef Q_WS_MAC
-// Forward defs to make avoid including Carbon.h (faster compile you know ;).
-struct OpaqueHIObjectRef;
-typedef struct OpaqueHIObjectRef*       HIObjectRef;
-typedef HIObjectRef                     HIToolbarItemRef;
-typedef const void * CFTypeRef;
-typedef const struct __CFString * CFStringRef;
-
-#  ifdef QT_MAC_USE_COCOA
-#include <qunifiedtoolbarsurface_mac_p.h>
-# endif // QT_MAC_USE_COCOA
-
-#endif // Q_WS_MAC
-
 QT_BEGIN_NAMESPACE
 
 class QToolBar;
@@ -311,43 +297,6 @@ private:
 #ifndef QT_NO_TABBAR
     void updateTabBarShapes();
 #endif
-#ifdef Q_WS_MAC
-#  ifndef QT_MAC_USE_COCOA
-    static OSStatus qtmacToolbarDelegate(EventHandlerCallRef, EventRef , void *);
-    static OSStatus qtoolbarInHIToolbarHandler(EventHandlerCallRef inCallRef, EventRef event,
-                                               void *data);
-    static void qtMacHIToolbarRegisterQToolBarInHIToolborItemClass();
-    static HIToolbarItemRef CreateToolbarItemForIdentifier(CFStringRef identifier, CFTypeRef data);
-    static HIToolbarItemRef createQToolBarInHIToolbarItem(QToolBar *toolbar,
-                                                          QMainWindowLayout *layout);
-#  endif
-public:
-    struct ToolBarSaveState {
-        ToolBarSaveState() : movable(false) { }
-        ToolBarSaveState(bool newMovable, const QSize &newMax)
-        : movable(newMovable), maximumSize(newMax) { }
-        bool movable;
-        QSize maximumSize;
-    };
-    QList<QToolBar *> qtoolbarsInUnifiedToolbarList;
-    QList<void *> toolbarItemsCopy;
-    QHash<void *, QToolBar *> unifiedToolbarHash;
-    QHash<QToolBar *, ToolBarSaveState> toolbarSaveState;
-    QHash<QString, QToolBar *> cocoaItemIDToToolbarHash;
-    void insertIntoMacToolbar(QToolBar *before, QToolBar *after);
-    void removeFromMacToolbar(QToolBar *toolbar);
-    void cleanUpMacToolbarItems();
-    void fixSizeInUnifiedToolbar(QToolBar *tb) const;
-    bool activateUnifiedToolbarAfterFullScreen;
-    void syncUnifiedToolbarVisibility();
-    bool blockVisiblityCheck;
-
-#ifdef QT_MAC_USE_COCOA
-    QUnifiedToolbarSurface *unifiedSurface;
-    void updateUnifiedToolbarOffset();
-#endif // QT_MAC_USE_COCOA
-
-#endif // Q_WS_MAC
 };
 QT_END_NAMESPACE
 
index b3755b0..a3b07c9 100644 (file)
@@ -78,9 +78,6 @@ public:
         drawBase(true), scrollOffset(0), elideModeSetByUser(false), useScrollButtonsSetByUser(false), expanding(true), closeButtonOnTabs(false),
         selectionBehaviorOnRemove(QTabBar::SelectRightTab), paintWithOffsets(true), movable(false),
         dragInProgress(false), documentMode(false), movingTab(0)
-#ifdef Q_WS_MAC
-        , previousPressedIndex(-1)
-#endif
         {}
 
     int currentIndex;
@@ -201,9 +198,6 @@ public:
     bool documentMode;
 
     QWidget *movingTab;
-#ifdef Q_WS_MAC
-    int previousPressedIndex;
-#endif
     // shared by tabwidget and qtabbar
     static void initStyleBaseOption(QStyleOptionTabBarBaseV2 *optTabBase, QTabBar *tabbar, QSize size)
     {
index b055ae6..20c1997 100644 (file)
@@ -75,9 +75,6 @@ public:
           allowedAreas(Qt::AllToolBarAreas), orientation(Qt::Horizontal),
           toolButtonStyle(Qt::ToolButtonIconOnly),
           layout(0), state(0)
-#ifdef Q_WS_MAC
-        , macWindowDragging(false)
-#endif
     { }
 
     void init();
@@ -107,11 +104,6 @@ public:
     };
     DragState *state;
 
-#ifdef Q_WS_MAC
-    bool macWindowDragging;
-    QPoint macWindowDragPressPosition;
-#endif
-
     bool mousePressEvent(QMouseEvent *e);
     bool mouseReleaseEvent(QMouseEvent *e);
     bool mouseMoveEvent(QMouseEvent *e);