Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qeventdispatcher_glib_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QEVENTDISPATCHER_GLIB_P_H
6#define QEVENTDISPATCHER_GLIB_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of the QLibrary class. This header file may change from
14// version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
21
23
24QT_BEGIN_NAMESPACE
25
26class QEventDispatcherGlibPrivate;
27
28class Q_CORE_EXPORT QEventDispatcherGlib : public QAbstractEventDispatcherV2
29{
30 Q_OBJECT
31 Q_DECLARE_PRIVATE(QEventDispatcherGlib)
32
33public:
34 explicit QEventDispatcherGlib(QObject *parent = nullptr);
35 explicit QEventDispatcherGlib(GMainContext *context, QObject *parent = nullptr);
36 ~QEventDispatcherGlib();
37
38 bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
39
40 void registerSocketNotifier(QSocketNotifier *socketNotifier) final;
41 void unregisterSocketNotifier(QSocketNotifier *socketNotifier) final;
42
43 void registerTimer(Qt::TimerId timerId, Duration interval, Qt::TimerType timerType,
44 QObject *object) override final;
45 bool unregisterTimer(Qt::TimerId timerId) override final;
46 bool unregisterTimers(QObject *object) override final;
47 QList<TimerInfoV2> timersForObject(QObject *object) const override final;
48 Duration remainingTime(Qt::TimerId timerId) const override final;
49
50 void wakeUp() final;
51 void interrupt() final;
52
53 static bool versionSupported();
54
55protected:
56 QEventDispatcherGlib(QEventDispatcherGlibPrivate &dd, QObject *parent);
57};
58
59struct GPostEventSource;
61struct GTimerSource;
62struct GIdleTimerSource;
63
64class Q_CORE_EXPORT QEventDispatcherGlibPrivate : public QAbstractEventDispatcherPrivate
65{
66
67public:
68 QEventDispatcherGlibPrivate(GMainContext *context = nullptr);
69 ~QEventDispatcherGlibPrivate() override;
70
71 GMainContext *mainContext;
72 GPostEventSource *postEventSource;
73 GSocketNotifierSource *socketNotifierSource;
74 GTimerSource *timerSource;
75 GIdleTimerSource *idleTimerSource;
76 bool wakeUpCalled = true;
77
78 void runTimersOnceWithNormalPriority();
79};
80
81QT_END_NAMESPACE
82
83#endif // QEVENTDISPATCHER_GLIB_P_H
static gboolean timerSourcePrepareHelper(GTimerSource *src, gint *timeout)
static gboolean postEventSourceDispatch(GSource *s, GSourceFunc, gpointer)
static gboolean timerSourceCheck(GSource *source)
static gboolean idleTimerSourcePrepare(GSource *source, gint *timeout)
static gboolean socketNotifierSourcePrepare(GSource *, gint *timeout)
static gboolean idleTimerSourceDispatch(GSource *source, GSourceFunc, gpointer)
static gboolean postEventSourcePrepare(GSource *s, gint *timeout)
static gboolean idleTimerSourceCheck(GSource *source)
static gboolean timerSourceCheckHelper(GTimerSource *src)
static gboolean socketNotifierSourceCheck(GSource *source)
static gboolean postEventSourceCheck(GSource *source)
static gboolean socketNotifierSourceDispatch(GSource *source, GSourceFunc, gpointer)
static gboolean timerSourcePrepare(GSource *source, gint *timeout)
static gboolean timerSourceDispatch(GSource *source, GSourceFunc, gpointer)
struct _GMainContext GMainContext
QEventDispatcherGlibPrivate * d
QList< GPollFDWithQSocketNotifier * > pollfds
QTimerInfoList timerList
QEventLoop::ProcessEventsFlags processEventsFlags