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)
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
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);
}
}
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;
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();
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
}
/*!
#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;
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
};
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
};
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
};
// 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;
//
#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
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
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
{
}
QAtomicInt ref;
QFontCache *fontCache;
-#if !defined(Q_WS_MAC)
QFontEngine *engines[QUnicodeTables::ScriptCount];
-#else
- QFontEngine *engine;
-#endif
};
#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;
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,
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;
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);
#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
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;
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;
#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
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;
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)
{
allowedAreas(Qt::AllToolBarAreas), orientation(Qt::Horizontal),
toolButtonStyle(Qt::ToolButtonIconOnly),
layout(0), state(0)
-#ifdef Q_WS_MAC
- , macWindowDragging(false)
-#endif
{ }
void init();
};
DragState *state;
-#ifdef Q_WS_MAC
- bool macWindowDragging;
- QPoint macWindowDragPressPosition;
-#endif
-
bool mousePressEvent(QMouseEvent *e);
bool mouseReleaseEvent(QMouseEvent *e);
bool mouseMoveEvent(QMouseEvent *e);