38#ifndef QEVENTDISPATCHER_CF_P_H
39#define QEVENTDISPATCHER_CF_P_H
52#include <QtCore/qabstracteventdispatcher.h>
53#include <QtCore/private/qtimerinfo_unix_p.h>
54#include <QtCore/private/qcfsocketnotifier_p.h>
55#include <QtCore/private/qcore_mac_p.h>
56#include <QtCore/qdebug.h>
57#include <QtCore/qloggingcategory.h>
59#include <CoreFoundation/CoreFoundation.h>
72template <
class T = QEventDispatcherCoreFoundation>
81 : m_delegate(delegate), m_callback(callback)
83 CFRunLoopSourceContext
context = {};
85 context.perform = RunLoopSource::process;
93 CFRunLoopSourceInvalidate(m_source);
100 runLoop = CFRunLoopGetCurrent();
102 CFRunLoopAddSource(runLoop, m_source,
mode);
105 void signal() { CFRunLoopSourceSignal(m_source); }
108 static void process(
void *
info)
111 ((self->m_delegate)->*(self->m_callback))();
116 CFRunLoopSourceRef m_source;
119template <
class T = QEventDispatcherCoreFoundation>
126 : m_delegate(delegate), m_callback(callback)
128 CFRunLoopObserverContext
context = {};
131 m_observer = CFRunLoopObserverCreate(kCFAllocatorDefault, activities,
true, 0, process, &
context);
137 CFRunLoopObserverInvalidate(m_observer);
138 CFRelease(m_observer);
144 runLoop = CFRunLoopGetCurrent();
146 if (!CFRunLoopContainsObserver(runLoop, m_observer,
mode))
147 CFRunLoopAddObserver(runLoop, m_observer,
mode);
153 runLoop = CFRunLoopGetCurrent();
155 if (CFRunLoopContainsObserver(runLoop, m_observer,
mode))
156 CFRunLoopRemoveObserver(runLoop, m_observer,
mode);
160 static void process(CFRunLoopObserverRef, CFRunLoopActivity activity,
void *
info)
163 ((self->m_delegate)->*(self->m_callback))(activity);
168 CFRunLoopObserverRef m_observer;
204 , processedPostedEvents(
false), processedTimers(
false)
205 , deferredWakeUp(
false), deferredUpdateTimers(
false) {}
224 CFRunLoopTimerRef m_runLoopTimer;
225 CFRunLoopTimerRef m_blockedRunLoopTimer;
227 bool m_overdueTimerScheduled;
231 void processTimers(CFRunLoopTimerRef);
233 void handleRunLoopActivity(CFRunLoopActivity activity);
236 void invalidateTimer();
DarwinBluetooth::LECBManagerNotifier * notifier
~QEventDispatcherCoreFoundation()
void interrupt() override
Interrupts event dispatching.
virtual bool processPostedEvents()
ProcessEventsState m_processEvents
QList< QAbstractEventDispatcher::TimerInfo > registeredTimers(QObject *object) const override
Returns a list of registered timers for object.
void registerTimer(int timerId, qint64 interval, Qt::TimerType timerType, QObject *object) override
Register a timer with the specified timerId, interval, and timerType for the given object.
void registerSocketNotifier(QSocketNotifier *notifier) override
Registers notifier with the event loop.
bool processEvents(QEventLoop::ProcessEventsFlags flags) override
Processes pending events that match flags until there are no more events to process.
void wakeUp() override
\threadsafe
bool unregisterTimers(QObject *object) override
Unregisters all the timers associated with the given object.
QEventDispatcherCoreFoundation(QObject *parent=nullptr)
void unregisterSocketNotifier(QSocketNotifier *notifier) override
Unregisters notifier from the event dispatcher.
void startingUp() override
bool unregisterTimer(int timerId) override
Unregisters the timer with the given timerId.
QEventLoop * currentEventLoop() const
int remainingTime(int timerId) override
Returns the remaining time in milliseconds with the given timerId.
void(T::* CallbackFunction)(CFRunLoopActivity activity)
void addToMode(CFStringRef mode, CFRunLoopRef runLoop=0)
RunLoopObserver(T *delegate, CallbackFunction callback, CFOptionFlags activities)
void removeFromMode(CFStringRef mode, CFRunLoopRef runLoop=0)
void addToMode(CFStringRef mode, CFRunLoopRef runLoop=0)
RunLoopSource(T *delegate, CallbackFunction callback)
enum RunLoopSource::@34 RunLoopSourcePriority
bool(T::* CallbackFunction)()
Combined button and popup list for selecting options.
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
#define Q_DECLARE_EXPORTED_LOGGING_CATEGORY(name, export_macro)
#define QT_MANGLE_NAMESPACE(name)
static int toInt(const QChar &qc, int R)
QFileInfo info(fileName)
[8]
QAtomicInteger< char > processedPostedEvents
ProcessEventsState(QEventLoop::ProcessEventsFlags f)
bool deferredUpdateTimers
QAtomicInteger< char > deferredWakeUp
QAtomicInteger< char > wasInterrupted
QAtomicInteger< char > processedTimers
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent