6#ifndef QEVENTDISPATCHER_MAC_P_H
7#define QEVENTDISPATCHER_MAC_P_H
20#include <QtCore/qabstracteventdispatcher.h>
21#include <QtCore/qstack.h>
22#include <QtGui/qwindowdefs.h>
23#include <QtCore/private/qabstracteventdispatcher_p.h>
24#include <QtCore/private/qcfsocketnotifier_p.h>
25#include <QtCore/private/qtimerinfo_unix_p.h>
26#include <QtCore/qloggingcategory.h>
27#include <QtCore/qpointer.h>
29#include <CoreFoundation/CoreFoundation.h>
31Q_FORWARD_DECLARE_OBJC_CLASS(NSWindow);
42} QCocoaModalSessionInfo;
55 bool processEvents(QEventLoop::ProcessEventsFlags flags)
override;
60 void registerTimer(Qt::TimerId timerId, Duration interval, Qt::TimerType timerType,
61 QObject *object)
final;
77 Q_DECLARE_PUBLIC(QCocoaEventDispatcher)
130 CFRunLoopActivity activity,
void *info);
140 QtCocoaInterruptDispatcher();
141 ~QtCocoaInterruptDispatcher();
bool supportsMode(QClipboard::Mode mode) const override
QMacPasteboard * pasteboardForMode(QClipboard::Mode mode) const
bool ownsMode(QClipboard::Mode mode) const override
QMimeData * mimeData(QClipboard::Mode mode=QClipboard::Clipboard) override
void setMimeData(QMimeData *data, QClipboard::Mode mode=QClipboard::Clipboard) override
void setLastInputEvent(NSEvent *event, NSView *view)
Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override
Qt::DropAction drag(QDrag *m_drag) override
void setAcceptedAction(Qt::DropAction act)
QMimeData * dragMimeData()
QVariant retrieveData_sys(const QString &mimeType, QMetaType type) const
QStringList formats_sys() const
QCocoaDropData(NSPasteboard *pasteboard)
bool hasFormat_sys(const QString &mimeType) const
CFStringRef dropPasteboard
void beginModalSession(QWindow *widget)
void endModalSession(QWindow *widget)
NSModalSession currentModalSessionCached
bool sendQueuedUserInputEvents()
static void postedEventsSourceCallback(void *info)
CFRunLoopSourceRef activateTimersSourceRef
bool blockSendPostedEvents
CFRunLoopObserverRef waitingObserver
void temporarilyStopAllModalSessions()
CFRunLoopSourceRef postedEventsSource
static void runLoopTimerCallback(CFRunLoopTimerRef, void *info)
void processPostedEvents()
QList< void * > queuedUserInputEvents
QCFSocketNotifier cfSocketNotifier
CFRunLoopTimerRef runLoopTimerRef
void maybeCancelWaitForMoreEvents()
bool hasModalSession() const
static void activateTimersSourceCallback(void *info)
void maybeStopCFRunLoopTimer()
void cancelWaitForMoreEvents()
void cleanupModalSessions()
void ensureNSAppInitialized()
static void waitingObserverCallback(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info)
~QCocoaEventDispatcherPrivate() override
QTimerInfoList timerInfoList
NSModalSession currentModalSession()
bool initializingNSApplication
bool cleanupModalSessionsNeeded
void maybeStartCFRunLoopTimer()
QStack< QCocoaModalSessionInfo > cocoaModalSessionStack
bool currentExecIsNSAppRun
QList< TimerInfoV2 > timersForObject(QObject *object) const final
QCocoaEventDispatcher(QObject *parent=nullptr)
void wakeUp() override
\threadsafe
void interrupt() override
Interrupts event dispatching.
bool unregisterTimers(QObject *object) final
Unregisters all the timers associated with the given object.
~QCocoaEventDispatcher() override
void registerTimer(Qt::TimerId timerId, Duration interval, Qt::TimerType timerType, QObject *object) final
bool processEvents(QEventLoop::ProcessEventsFlags flags) override
Processes pending events that match flags until there are no more events to process.
Duration remainingTime(Qt::TimerId timerId) const final
Returns the remaining time of the timer with the given timerId.
bool unregisterTimer(Qt::TimerId timerId) final
void registerSocketNotifier(QSocketNotifier *notifier) override
Registers notifier with the event loop.
friend void qt_mac_maybeCancelWaitForMoreEventsForwarder(QAbstractEventDispatcher *eventDispatcher)
static void clearCurrentThreadCocoaEventDispatcherInterruptFlag()
void unregisterSocketNotifier(QSocketNotifier *notifier) override
Unregisters notifier from the event dispatcher.
NSOpenGLContext * nativeContext() const override
void swapBuffers(QPlatformSurface *surface) override
Reimplement in subclass to native swap buffers calls.
void doneCurrent() override
friend QDebug operator<<(QDebug debug, const QCocoaGLContext *screen)
QSurfaceFormat format() const override
bool isSoftwareContext() const
bool isSharing() const override
void initialize() override
Called after a new instance is constructed.
void beginFrame() override
Called when the RHI begins rendering a new frame in the context.
QFunctionPointer getProcAddress(const char *procName) override
Reimplement in subclass to allow dynamic querying of OpenGL symbols.
QCocoaGLContext(QOpenGLContext *context)
bool makeCurrent(QPlatformSurface *surface) override
bool isValid() const override
void * nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override
NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override
bool handleUrl(const QUrl &url)
bool hasCapability(Capability capability) const override
QPlatformServiceColorPicker * colorPicker(QWindow *parent) override
bool openUrl(const QUrl &url) override
bool openDocument(const QUrl &url) override
void handleWindowStateChanged(HandleFlags flags=NoHandleFlags)
static void setupPopupMonitor()
void setContentBorderAreaEnabled(quintptr identifier, bool enable)
bool alwaysShowToolWindow() const
void setMenubar(QCocoaMenuBar *mb)
QWindow * childWindowAt(QPoint windowPoint)
void setAlertState(bool enabled) override
Reimplement this method to set whether the window demands attention (for example, by flashing the tas...
Qt::WindowModality m_windowModality
QMargins safeAreaMargins() const override
The safe area margins of a window represent the area that is safe to place content within,...
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
void setWindowCursor(NSCursor *cursor)
bool testContentBorderAreaPosition(int position) const
QRect normalGeometry() const override
the geometry of the window as it will appear when shown as a normal (not maximized or full screen) to...
QMacKeyValueObserver m_safeAreaInsetsObserver
bool updatesWithDisplayLink() const
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
bool isForeignWindow() const override
bool setMouseGrabEnabled(bool grab) override
QCocoaNSWindow * m_nsWindow
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
QCocoaNSWindow * createNSWindow(bool shouldBePanel)
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
static id s_globalMouseMonitor
void setMask(const QRegion ®ion) override
Reimplement to be able to let Qt set the mask of a window.
QHash< quintptr, bool > m_enabledContentBorderAreas
void setFrameStrutEventsEnabled(bool enabled) override
Reimplement this method to set whether frame strut events should be sent to enabled.
QCocoaMenuBar * menubar() const
void setWindowFilePath(const QString &filePath) override
Reimplement to set the window file path to filePath.
void setCocoaGeometry(const QRect &rect)
QRect geometry() const override
Returns the current geometry of a window.
NSInteger windowLevel(Qt::WindowFlags flags)
void setContentBorderEnabled(bool enable) override
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
static void removePopupMonitor()
bool m_frameStrutEventsEnabled
bool setWindowModified(bool modified) override
Reimplement to be able to let Qt indicate that the window has been modified.
NSWindow * nativeWindow() const
void applyContentBorderThickness(NSWindow *window=nullptr)
void setWindowState(Qt::WindowStates state) override
Changes the state of the NSWindow, going in/out of minimize/zoomed/fullscreen.
void updateSafeAreaMarginsIfNeeded()
void registerTouch(bool enable)
void updateTitleBarButtons(Qt::WindowFlags flags)
QMargins frameMargins() const override
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
void updateNormalGeometry()
bool isAlertState() const override
Reimplement this method return whether the window is in an alert state.
bool isExposed() const override
Returns if this window is exposed in the windowing system.
QFlatMap< quintptr, NSVisualEffectView * > m_effectViews
void deliverUpdateRequest() override
Delivers an QEvent::UpdateRequest event to the window.
bool isEmbedded() const override
Returns true if the window is a child of a non-Qt window.
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void manageVisualEffectArea(quintptr identifier, const QRect &rect, NSVisualEffectMaterial material, NSVisualEffectBlendingMode blendMode, NSVisualEffectState activationState) override
bool shouldRefuseKeyWindowAndFirstResponder()
void requestUpdate() override
Requests an QEvent::UpdateRequest event.
static QPointer< QCocoaWindow > s_windowUnderMouse
static void closeAllPopups()
void setWindowIcon(const QIcon &icon) override
Reimplement to set the window icon to icon.
bool isContentView() const
Checks if the window is the content view of its immediate NSWindow.
void recreateWindowIfNeeded()
Recreates (or removes) the NSWindow for this QWindow, if needed.
void handleGeometryChange()
bool m_drawContentBorderGradient
bool m_resizableTransientParent
NSUInteger windowStyleMask(Qt::WindowFlags flags)
QCocoaMenuBar * m_menubar
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
bool startSystemMove() override
Reimplement this method to start a system move operation if the system supports it and return true to...
static const int NoAlertRequest
CALayer * contentLayer() const override
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
bool setKeyboardGrabEnabled(bool grab) override
bool windowIsPopupType(Qt::WindowType type=Qt::Widget) const
void registerContentBorderArea(quintptr identifier, int upper, int lower)
void setEmbeddedInForeignView()
void applyWindowState(Qt::WindowStates newState)
QPoint bottomLeftClippedByNSWindowOffset() const override
bool isTransitioningToFullScreen() const
QHash< quintptr, BorderRange > m_contentBorderAreas
Qt::WindowStates windowState() const
qreal devicePixelRatio() const override
Reimplement this function in subclass to return the device pixel ratio for the window.
void initialize() override
Called as part of QWindow::create(), after constructing the window.
Qt::WindowStates m_lastReportedWindowState
QSurfaceFormat format() const override
Returns the actual surface format of the window.
bool frameStrutEventsEnabled() const override
Reimplement this method to return whether frame strut events are enabled.
static id s_applicationActivationObserver
void handleExposeEvent(const QRegion ®ion)
QMargins m_lastReportedSafeAreaMargins
QMacPasteboard(QUtiMimeConverter::HandlerScope scope)
QStringList formats() const
PasteboardRef pasteBoard() const
QMimeData * mimeData() const
QMacPasteboard(PasteboardRef p, QUtiMimeConverter::HandlerScope scope=QUtiMimeConverter::HandlerScopeFlag::All)
bool hasUti(const QString &uti) const
QVariant retrieveData(const QString &format) const
bool hasFormat(const QString &format) const
\inmodule QtCore\reentrant
static void cancelInterruptLater()
static void interruptLater()
QT_DECLARE_NAMESPACED_OBJC_INTERFACE(QMacAccessibilityElement, NSObject -(void) invalidate;) QT_BEGIN_NAMESPACE bool QAccessibleCache
Q_FORWARD_DECLARE_OBJC_CLASS(NSEvent)
Q_FORWARD_DECLARE_OBJC_CLASS(NSPasteboard)
struct _NSModalSession * NSModalSession
Q_FORWARD_DECLARE_OBJC_CLASS(NSOpenGLPixelFormat)
Q_FORWARD_DECLARE_OBJC_CLASS(NSVisualEffectView)
Q_FORWARD_DECLARE_OBJC_CLASS(NSView)
Q_FORWARD_DECLARE_OBJC_CLASS(NSCursor)
const NSNotificationName QCocoaWindowWillReleaseQNSViewNotification
#define Q_NOTIFICATION_HANDLER(notification)
Q_FORWARD_DECLARE_OBJC_CLASS(NSObject)
Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(RunLoopModeTracker))
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
QString qt_mac_get_pasteboardString(PasteboardRef paste)
bool operator<(BorderRange const &right) const
BorderRange(quintptr i, int u, int l)
QPointer< QWindow > window