From 280aba512ee1933b6cbff4dfda586c64a009113e Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 27 Jul 2019 16:31:14 +0000 Subject: [PATCH] drop Glib2 event dispatcher support Signed-off-by: Ivailo Monev --- .travis.yml | 2 +- CMakeLists.txt | 16 - cmake/modules/FindGLib2.cmake | 62 --- package/archlinux/PKGBUILD | 2 +- package/debian/control | 8 +- src/core/CMakeLists.txt | 12 - src/core/global/qconfig.h.cmake | 2 +- src/core/kernel/kernel.cmake | 16 - src/core/kernel/qcoreapplication.cpp | 11 +- src/core/kernel/qeventdispatcher_glib.cpp | 586 ---------------------------- src/core/kernel/qeventdispatcher_glib_p.h | 105 ----- src/core/thread/qthread_unix.cpp | 9 - src/gui/kernel/kernel.cmake | 16 - src/gui/kernel/qapplication_x11.cpp | 17 +- src/gui/kernel/qguieventdispatcher_glib.cpp | 226 ----------- src/gui/kernel/qguieventdispatcher_glib_p.h | 71 ---- 16 files changed, 11 insertions(+), 1150 deletions(-) delete mode 100644 cmake/modules/FindGLib2.cmake delete mode 100644 src/core/kernel/qeventdispatcher_glib.cpp delete mode 100644 src/core/kernel/qeventdispatcher_glib_p.h delete mode 100644 src/gui/kernel/qguieventdispatcher_glib.cpp delete mode 100644 src/gui/kernel/qguieventdispatcher_glib_p.h diff --git a/.travis.yml b/.travis.yml index 2ffd65313..e659fe9ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ services: - xvfb before_install: - sudo apt-get update -qq - - sudo apt-get install -qq ninja-build python-dev libpcre3-dev libssl-dev zlib1g-dev libc6-dev libpng-dev libjpeg-dev libtiff-dev libmng-dev libcups2-dev libfreetype6-dev libfontconfig1-dev libglib2.0-dev libdbus-1-dev unixodbc-dev libpq-dev libpqtypes-dev libmysqld-dev libaio-dev libwrap0-dev liblz4-dev libsqlite3-dev xorg-dev + - sudo apt-get install -qq ninja-build python-dev libpcre3-dev libssl-dev zlib1g-dev libc6-dev libpng-dev libjpeg-dev libtiff-dev libmng-dev libcups2-dev libfreetype6-dev libfontconfig1-dev libdbus-1-dev unixodbc-dev libpq-dev libpqtypes-dev libmysqld-dev libaio-dev libwrap0-dev liblz4-dev libsqlite3-dev xorg-dev - wget 'http://mirrors.kernel.org/ubuntu/pool/universe/libz/libzstd/libzstd1_1.3.1+dfsg-1~ubuntu0.16.04.1_amd64.deb' - wget 'http://mirrors.kernel.org/ubuntu/pool/universe/libz/libzstd/libzstd1-dev_1.3.1+dfsg-1~ubuntu0.16.04.1_amd64.deb' - sudo dpkg -i *.deb diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d7d1b86e..ccce6fa49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,9 +131,6 @@ add_feature_info(mng WITH_MNG "build MNG support") option(WITH_ICONV "Build Iconv support" ON) add_feature_info(iconv WITH_ICONV "build Iconv support") -option(WITH_GLIB2 "Build GLib2 support" OFF) -add_feature_info(glib2 WITH_GLIB2 "build GLib2 support") - option(WITH_DBUS "Build DBus support" ON) add_feature_info(dbus WITH_DBUS "build DBus support") @@ -386,15 +383,6 @@ set_package_properties(HarfBuzz PROPERTIES TYPE RECOMMENDED ) -# v2.22.0+ to avoid too many conditionals in sources -find_package(GLib2 2.22.0) -set_package_properties(GLib2 PROPERTIES - PURPOSE "Required for glib mainloop support" - DESCRIPTION "Core application building blocks for libraries and applications written in C" - URL "https://developer.gnome.org/glib" - TYPE RECOMMENDED -) - # v1.2+ required for dbus_watch_get_unix_fd find_package(DBus 1.2) set_package_properties(DBus PROPERTIES @@ -486,10 +474,6 @@ else() set(KATIE_TOOLS "${KATIE_TOOLS} qdbusxml2cpp qdbuscpp2xml qdbusviewer") endif() -if(NOT WITH_GLIB2 OR NOT GLIB2_FOUND) - katie_definition(-DQT_NO_GLIB) -endif() - if(NOT WITH_CUPS OR NOT CUPS_FOUND) katie_definition(-DQT_NO_CUPS -DQT_NO_LPR) endif() diff --git a/cmake/modules/FindGLib2.cmake b/cmake/modules/FindGLib2.cmake deleted file mode 100644 index 80736045b..000000000 --- a/cmake/modules/FindGLib2.cmake +++ /dev/null @@ -1,62 +0,0 @@ -# - Try to find GLib2 core application building -# Once done this will define -# -# GLIB2_FOUND - system has GLib2 -# GLIB2_INCLUDES - the GLib2 include directory -# GLIB2_CONFIG_INCLUDES - the GLib2 config include directory -# GLIB2_LIBRARIES - The libraries needed to use GLib2 -# -# Copyright (c) 2015-2019, Ivailo Monev, -# -# Redistribution and use is allowed according to the terms of the BSD license. - -if(GLIB2_INCLUDES AND GLIB2_LIBRARIES) - set(GLIB2_FIND_QUIETLY TRUE) -endif() - -if(NOT WIN32) - include(FindPkgConfig) - pkg_check_modules(PC_GLIB2 QUIET glib-2.0) -endif() - -find_path(GLIB2_INCLUDES - NAMES - glib.h - PATH_SUFFIXES glib-2.0 - HINTS - $ENV{GLIB2DIR}/include - ${PC_GLIB2_INCLUDEDIR} - ${INCLUDE_INSTALL_DIR} -) - -find_path(GLIB2_CONFIG_INCLUDES - NAMES - glibconfig.h - PATH_SUFFIXES glib-2.0/include - HINTS - $ENV{GLIB2DIR}/include - $ENV{GLIB2DIR}/lib - ${PC_GLIB2_INCLUDEDIR} - ${PC_GLIB2_LIBDIR} - ${INCLUDE_INSTALL_DIR} -) - -if(GLIB2_INCLUDES AND GLIB2_CONFIG_INCLUDES) - set(GLIB2_INCLUDES ${GLIB2_INCLUDES} ${GLIB2_CONFIG_INCLUDES}) -endif() - -find_library(GLIB2_LIBRARIES - glib-2.0 - HINTS - $ENV{GLIB2DIR}/lib - ${PC_GLIB2_LIBDIR} - ${LIB_INSTALL_DIR} -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GLib2 - VERSION_VAR PC_GLIB2_VERSION - REQUIRED_VARS GLIB2_LIBRARIES GLIB2_INCLUDES GLIB2_CONFIG_INCLUDES -) - -mark_as_advanced(GLIB2_INCLUDES GLIB2_CONFIG_INCLUDES GLIB2_LIBRARIES) diff --git a/package/archlinux/PKGBUILD b/package/archlinux/PKGBUILD index e0f340167..e76bce427 100644 --- a/package/archlinux/PKGBUILD +++ b/package/archlinux/PKGBUILD @@ -10,7 +10,7 @@ url='https://github.com/fluxer/katie' license=('LGPL' 'FDL' 'custom') depends=('openssl' 'zlib' 'cups' 'libice' 'libsm' 'pcre' 'libxcursor' 'libxext' 'libxfixes' 'libxi' 'libxinerama' 'libxrandr' 'libxrender' - 'libx11' 'fontconfig' 'freetype2' 'glib2' 'libmng' 'zstd') + 'libx11' 'fontconfig' 'freetype2' 'libmng' 'zstd') makedepends=('cmake' 'git' 'python' 'postgresql' 'libmariadbclient' 'unixodbc' 'unifdef') optdepends=('postgresql-libs: PostgreSQL driver' 'libmariadbclient: MariaDB driver' diff --git a/package/debian/control b/package/debian/control index 502475691..98ff859e7 100644 --- a/package/debian/control +++ b/package/debian/control @@ -10,14 +10,14 @@ X-Python-Version: >= 2.7 Build-Depends: debhelper (>= 9~), g++, python-dev (>= 2.7~), libssl-dev, zlib1g-dev, libzstd-dev, libc6-dev, libpng-dev, libjpeg-dev, libtiff5-dev, libmng-dev, libcups2-dev, libfreetype6-dev, libfontconfig1-dev, - libpcre3-dev, libglib2.0-dev, libdbus-1-dev, unixodbc-dev, libpq-dev, - libpqtypes-dev, libmariadbclient-dev, libmariadbd-dev, libaio-dev, - libsqlite3-dev, xorg-dev, cmake, git + libpcre3-dev, libdbus-1-dev, unixodbc-dev, libpq-dev, libpqtypes-dev, + libmariadbclient-dev, libmariadbd-dev, libaio-dev, libsqlite3-dev, xorg-dev, + cmake, git Package: katie-git Architecture: i386 amd64 Depends: ${shlibs:Depends}, ${misc:Depends}, openssl, zlib1g, libzstd1, libc6, libpng16-16, libjpeg62-turbo, libtiffxx5, libmng1, libcups2, libfreetype6, - libfontconfig1, libpcre3, libglib2.0-0, libdbus-1-3, libsqlite3-0 + libfontconfig1, libpcre3, libdbus-1-3, libsqlite3-0 Recommends: unixodbc, libpq5, libmariadbclient, xorg Description: C++ toolkit derived from the Qt 4.8 framework diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 02f33f905..ae6880009 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -254,18 +254,6 @@ set(CORE_HEADERS ${CMAKE_SOURCE_DIR}/src/3rdparty/utf8proc/utf8proc.h ) -if(WITH_GLIB2 AND GLIB2_FOUND) - set(CORE_HEADERS - ${CORE_HEADERS} - ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qeventdispatcher_glib_p.h - ) - set(EXTRA_CORE_LIBS - ${EXTRA_CORE_LIBS} - ${GLIB2_LIBRARIES} - ) - include_directories(${GLIB2_INCLUDES}) -endif() - if(${KATIE_PLATFORM} STREQUAL "linux") set(EXTRA_CORE_LIBS ${EXTRA_CORE_LIBS} diff --git a/src/core/global/qconfig.h.cmake b/src/core/global/qconfig.h.cmake index ecbdfe06b..71c3d64e3 100644 --- a/src/core/global/qconfig.h.cmake +++ b/src/core/global/qconfig.h.cmake @@ -88,6 +88,7 @@ #define QT_NO_GCONF2 #define QT_NO_RAWFONT #define QT_NO_IMAGE_TEXT +#define QT_NO_GLIB /* Qt build specs */ #ifndef QT_EDITION @@ -172,7 +173,6 @@ #cmakedefine QT_NO_GESTURES #cmakedefine QT_NO_GETADDRINFO #cmakedefine QT_NO_GETIFADDRS -#cmakedefine QT_NO_GLIB #cmakedefine QT_NO_GRAPHICSEFFECT #cmakedefine QT_NO_GRAPHICSSVGITEM #cmakedefine QT_NO_GRAPHICSVIEW diff --git a/src/core/kernel/kernel.cmake b/src/core/kernel/kernel.cmake index a7f9c2e90..6886bc385 100644 --- a/src/core/kernel/kernel.cmake +++ b/src/core/kernel/kernel.cmake @@ -64,19 +64,3 @@ set(CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsystemsemaphore_unix.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qeventdispatcher_unix.cpp ) - -if(WITH_GLIB2 AND GLIB2_FOUND) - set(CORE_SOURCES - ${CORE_SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qeventdispatcher_glib.cpp - ) - set(CORE_HEADERS - ${CORE_HEADERS} - ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qeventdispatcher_glib_p.h - ) - include_directories(${GLIB2_INCLUDES}) - set(EXTRA_CORE_LIBS - ${EXTRA_CORE_LIBS} - ${GLIB2_LIBRARIES} - ) -endif() diff --git a/src/core/kernel/qcoreapplication.cpp b/src/core/kernel/qcoreapplication.cpp index 9ee6f503e..a7f7e5eae 100644 --- a/src/core/kernel/qcoreapplication.cpp +++ b/src/core/kernel/qcoreapplication.cpp @@ -56,10 +56,6 @@ #include "qlocale_p.h" #include "qmutexpool_p.h" #include "qscopedpointer.h" - -#if !defined(QT_NO_GLIB) -# include "qeventdispatcher_glib_p.h" -#endif #include "qeventdispatcher_unix_p.h" #include @@ -262,12 +258,7 @@ QCoreApplicationPrivate::~QCoreApplicationPrivate() void QCoreApplicationPrivate::createEventDispatcher() { Q_Q(QCoreApplication); -#if !defined(QT_NO_GLIB) - if (qgetenv("QT_NO_GLIB").isEmpty()) - eventDispatcher = new QEventDispatcherGlib(q); - else -#endif - eventDispatcher = new QEventDispatcherUNIX(q); + eventDispatcher = new QEventDispatcherUNIX(q); } QThread *QCoreApplicationPrivate::theMainThread = Q_NULLPTR; diff --git a/src/core/kernel/qeventdispatcher_glib.cpp b/src/core/kernel/qeventdispatcher_glib.cpp deleted file mode 100644 index 4b292c72c..000000000 --- a/src/core/kernel/qeventdispatcher_glib.cpp +++ /dev/null @@ -1,586 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2016-2019 Ivailo Monev -** -** This file is part of the QtCore module of the Katie Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qeventdispatcher_glib_p.h" -#include "qeventdispatcher_unix_p.h" - -#include "qmutexpool_p.h" -#include "qthread_p.h" - -#include "qcoreapplication.h" -#include "qsocketnotifier.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -struct GPollFDWithQSocketNotifier -{ - GPollFD pollfd; - QSocketNotifier *socketNotifier; -}; - -struct GSocketNotifierSource -{ - GSource source; - QList pollfds; -}; - -static gboolean socketNotifierSourcePrepare(GSource *, gint *timeout) -{ - if (timeout) - *timeout = -1; - return false; -} - -static gboolean socketNotifierSourceCheck(GSource *source) -{ - GSocketNotifierSource *src = reinterpret_cast(source); - - bool pending = false; - for (int i = 0; !pending && i < src->pollfds.count(); ++i) { - GPollFDWithQSocketNotifier *p = src->pollfds.at(i); - - if (p->pollfd.revents & G_IO_NVAL) { - // disable the invalid socket notifier - static const char *t[] = { "Read", "Write", "Exception" }; - qWarning("QSocketNotifier: Invalid socket %d and type '%s', disabling...", - p->pollfd.fd, t[int(p->socketNotifier->type())]); - // ### note, modifies src->pollfds! - p->socketNotifier->setEnabled(false); - } - - pending = ((p->pollfd.revents & p->pollfd.events) != 0); - } - - return pending; -} - -static gboolean socketNotifierSourceDispatch(GSource *source, GSourceFunc, gpointer) -{ - QEvent event(QEvent::SockAct); - - GSocketNotifierSource *src = reinterpret_cast(source); - for (int i = 0; i < src->pollfds.count(); ++i) { - GPollFDWithQSocketNotifier *p = src->pollfds.at(i); - - if ((p->pollfd.revents & p->pollfd.events) != 0) - QCoreApplication::sendEvent(p->socketNotifier, &event); - } - - return true; // ??? don't remove, right? -} - -static GSourceFuncs socketNotifierSourceFuncs = { - socketNotifierSourcePrepare, - socketNotifierSourceCheck, - socketNotifierSourceDispatch, - NULL, - NULL, - NULL -}; - -struct GTimerSource -{ - GSource source; - QTimerInfoList timerList; - QEventLoop::ProcessEventsFlags processEventsFlags; - bool runWithIdlePriority; -}; - -static gboolean timerSourcePrepareHelper(GTimerSource *src, gint *timeout) -{ - timeval tv = { 0l, 0l }; - if (!(src->processEventsFlags & QEventLoop::X11ExcludeTimers) && src->timerList.timerWait(tv)) - *timeout = (tv.tv_sec * 1000) + (tv.tv_usec / 1000); - else - *timeout = -1; - - return (*timeout == 0); -} - -static gboolean timerSourceCheckHelper(GTimerSource *src) -{ - if (src->timerList.isEmpty() - || (src->processEventsFlags & QEventLoop::X11ExcludeTimers)) - return false; - - if (src->timerList.updateCurrentTime() < src->timerList.first()->timeout) - return false; - - return true; -} - -static gboolean timerSourcePrepare(GSource *source, gint *timeout) -{ - gint dummy; - if (!timeout) - timeout = &dummy; - - GTimerSource *src = reinterpret_cast(source); - if (src->runWithIdlePriority) { - if (timeout) - *timeout = -1; - return false; - } - - return timerSourcePrepareHelper(src, timeout); -} - -static gboolean timerSourceCheck(GSource *source) -{ - GTimerSource *src = reinterpret_cast(source); - if (src->runWithIdlePriority) - return false; - return timerSourceCheckHelper(src); -} - -static gboolean timerSourceDispatch(GSource *source, GSourceFunc, gpointer) -{ - GTimerSource *timerSource = reinterpret_cast(source); - if (timerSource->processEventsFlags & QEventLoop::X11ExcludeTimers) - return true; - timerSource->runWithIdlePriority = true; - (void) timerSource->timerList.activateTimers(); - return true; // ??? don't remove, right again? -} - -static GSourceFuncs timerSourceFuncs = { - timerSourcePrepare, - timerSourceCheck, - timerSourceDispatch, - NULL, - NULL, - NULL -}; - -struct GIdleTimerSource -{ - GSource source; - GTimerSource *timerSource; -}; - -static gboolean idleTimerSourcePrepare(GSource *source, gint *timeout) -{ - GIdleTimerSource *idleTimerSource = reinterpret_cast(source); - GTimerSource *timerSource = idleTimerSource->timerSource; - if (!timerSource->runWithIdlePriority) { - // Yield to the normal priority timer source - if (timeout) - *timeout = -1; - return false; - } - - return timerSourcePrepareHelper(timerSource, timeout); -} - -static gboolean idleTimerSourceCheck(GSource *source) -{ - GIdleTimerSource *idleTimerSource = reinterpret_cast(source); - GTimerSource *timerSource = idleTimerSource->timerSource; - if (!timerSource->runWithIdlePriority) { - // Yield to the normal priority timer source - return false; - } - return timerSourceCheckHelper(timerSource); -} - -static gboolean idleTimerSourceDispatch(GSource *source, GSourceFunc, gpointer) -{ - GTimerSource *timerSource = reinterpret_cast(source)->timerSource; - (void) timerSourceDispatch(&timerSource->source, 0, 0); - return true; -} - -static GSourceFuncs idleTimerSourceFuncs = { - idleTimerSourcePrepare, - idleTimerSourceCheck, - idleTimerSourceDispatch, - NULL, - NULL, - NULL -}; - -struct GPostEventSource -{ - GSource source; - QAtomicInt serialNumber; - int lastSerialNumber; - QEventDispatcherGlibPrivate *d; -}; - -static gboolean postEventSourcePrepare(GSource *s, gint *timeout) -{ - QThreadData *data = QThreadData::current(); - if (!data) - return false; - - gint dummy; - if (!timeout) - timeout = &dummy; - const bool canWait = data->canWaitLocked(); - *timeout = canWait ? -1 : 0; - - GPostEventSource *source = reinterpret_cast(s); - return (!canWait - || (source->serialNumber != source->lastSerialNumber)); -} - -static gboolean postEventSourceCheck(GSource *source) -{ - return postEventSourcePrepare(source, 0); -} - -static gboolean postEventSourceDispatch(GSource *s, GSourceFunc, gpointer) -{ - GPostEventSource *source = reinterpret_cast(s); - source->lastSerialNumber = source->serialNumber; - QCoreApplication::sendPostedEvents(); - source->d->runTimersOnceWithNormalPriority(); - return true; // i dunno, george... -} - -static GSourceFuncs postEventSourceFuncs = { - postEventSourcePrepare, - postEventSourceCheck, - postEventSourceDispatch, - NULL, - NULL, - NULL -}; - - -QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) - : mainContext(context) -{ - if (qgetenv("QT_NO_THREADED_GLIB").isEmpty()) { -#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 32 - static int dummyValue = 0; // only used for its address - QMutexLocker locker(QMutexPool::instance()->get(&dummyValue)); - if (!g_thread_supported()) - g_thread_init(NULL); -#else - } else { - qWarning("QEventDispatcherGlib: it is not possible to disable GLib threading"); -#endif - } - - if (mainContext) { - g_main_context_ref(mainContext); - } else { - QCoreApplication *app = QCoreApplication::instance(); - if (app && QThread::currentThread() == app->thread()) { - mainContext = g_main_context_default(); - g_main_context_ref(mainContext); - } else { - mainContext = g_main_context_new(); - } - } - - g_main_context_push_thread_default (mainContext); - - // setup post event source - postEventSource = reinterpret_cast(g_source_new(&postEventSourceFuncs, - sizeof(GPostEventSource))); - postEventSource->serialNumber = 1; - postEventSource->d = this; - g_source_set_can_recurse(&postEventSource->source, true); - g_source_attach(&postEventSource->source, mainContext); - - // setup socketNotifierSource - socketNotifierSource = - reinterpret_cast(g_source_new(&socketNotifierSourceFuncs, - sizeof(GSocketNotifierSource))); - (void) new (&socketNotifierSource->pollfds) QList(); - g_source_set_can_recurse(&socketNotifierSource->source, true); - g_source_attach(&socketNotifierSource->source, mainContext); - - // setup normal and idle timer sources - timerSource = reinterpret_cast(g_source_new(&timerSourceFuncs, - sizeof(GTimerSource))); - (void) new (&timerSource->timerList) QTimerInfoList(); - timerSource->processEventsFlags = QEventLoop::AllEvents; - timerSource->runWithIdlePriority = false; - g_source_set_can_recurse(&timerSource->source, true); - g_source_attach(&timerSource->source, mainContext); - - idleTimerSource = reinterpret_cast(g_source_new(&idleTimerSourceFuncs, - sizeof(GIdleTimerSource))); - idleTimerSource->timerSource = timerSource; - g_source_set_can_recurse(&idleTimerSource->source, true); - g_source_set_priority(&idleTimerSource->source, G_PRIORITY_DEFAULT_IDLE); - g_source_attach(&idleTimerSource->source, mainContext); -} - -void QEventDispatcherGlibPrivate::runTimersOnceWithNormalPriority() -{ - timerSource->runWithIdlePriority = false; -} - -QEventDispatcherGlib::QEventDispatcherGlib(QObject *parent) - : QAbstractEventDispatcher(*(new QEventDispatcherGlibPrivate), parent) -{ -} - -QEventDispatcherGlib::QEventDispatcherGlib(GMainContext *mainContext, QObject *parent) - : QAbstractEventDispatcher(*(new QEventDispatcherGlibPrivate(mainContext)), parent) -{ } - -QEventDispatcherGlib::~QEventDispatcherGlib() -{ - Q_D(QEventDispatcherGlib); - - // destroy all timer sources - qDeleteAll(d->timerSource->timerList); - d->timerSource->timerList.~QTimerInfoList(); - g_source_destroy(&d->timerSource->source); - g_source_unref(&d->timerSource->source); - d->timerSource = 0; - g_source_destroy(&d->idleTimerSource->source); - g_source_unref(&d->idleTimerSource->source); - d->idleTimerSource = 0; - - // destroy socket notifier source - for (int i = 0; i < d->socketNotifierSource->pollfds.count(); ++i) { - GPollFDWithQSocketNotifier *p = d->socketNotifierSource->pollfds[i]; - g_source_remove_poll(&d->socketNotifierSource->source, &p->pollfd); - delete p; - } - d->socketNotifierSource->pollfds.~QList(); - g_source_destroy(&d->socketNotifierSource->source); - g_source_unref(&d->socketNotifierSource->source); - d->socketNotifierSource = 0; - - // destroy post event source - g_source_destroy(&d->postEventSource->source); - g_source_unref(&d->postEventSource->source); - d->postEventSource = 0; - - Q_ASSERT(d->mainContext != 0); - g_main_context_pop_thread_default (d->mainContext); - g_main_context_unref(d->mainContext); - d->mainContext = 0; -} - -bool QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags) -{ - Q_D(QEventDispatcherGlib); - - const bool canWait = (flags & QEventLoop::WaitForMoreEvents); - if (canWait) - emit aboutToBlock(); - else - emit awake(); - - // tell postEventSourcePrepare() and timerSource about any new flags - QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags; - d->timerSource->processEventsFlags = flags; - - if (!(flags & QEventLoop::EventLoopExec)) { - // force timers to be sent at normal priority - d->timerSource->runWithIdlePriority = false; - } - - bool result = g_main_context_iteration(d->mainContext, canWait); - while (!result && canWait) - result = g_main_context_iteration(d->mainContext, canWait); - - d->timerSource->processEventsFlags = savedFlags; - - if (canWait) - emit awake(); - - return result; -} - -bool QEventDispatcherGlib::hasPendingEvents() -{ - Q_D(QEventDispatcherGlib); - return g_main_context_pending(d->mainContext); -} - -void QEventDispatcherGlib::registerSocketNotifier(QSocketNotifier *notifier) -{ - Q_ASSERT(notifier); - int sockfd = notifier->socket(); - int type = notifier->type(); -#ifndef QT_NO_DEBUG - if (sockfd < 0) { - qWarning("QSocketNotifier: Internal error"); - return; - } else if (notifier->thread() != thread() - || thread() != QThread::currentThread()) { - qWarning("QSocketNotifier: socket notifiers cannot be enabled from another thread"); - return; - } -#endif - - Q_D(QEventDispatcherGlib); - - - GPollFDWithQSocketNotifier *p = new GPollFDWithQSocketNotifier; - p->pollfd.fd = sockfd; - switch (type) { - case QSocketNotifier::Read: - p->pollfd.events = G_IO_IN | G_IO_HUP | G_IO_ERR; - break; - case QSocketNotifier::Write: - p->pollfd.events = G_IO_OUT | G_IO_ERR; - break; - case QSocketNotifier::Exception: - p->pollfd.events = G_IO_PRI | G_IO_ERR; - break; - } - p->socketNotifier = notifier; - - d->socketNotifierSource->pollfds.append(p); - - g_source_add_poll(&d->socketNotifierSource->source, &p->pollfd); -} - -void QEventDispatcherGlib::unregisterSocketNotifier(QSocketNotifier *notifier) -{ - Q_ASSERT(notifier); -#ifndef QT_NO_DEBUG - int sockfd = notifier->socket(); - if (sockfd < 0) { - qWarning("QSocketNotifier: Internal error"); - return; - } else if (notifier->thread() != thread() - || thread() != QThread::currentThread()) { - qWarning("QSocketNotifier: socket notifiers cannot be disabled from another thread"); - return; - } -#endif - - Q_D(QEventDispatcherGlib); - - for (int i = 0; i < d->socketNotifierSource->pollfds.count(); ++i) { - GPollFDWithQSocketNotifier *p = d->socketNotifierSource->pollfds.at(i); - if (p->socketNotifier == notifier) { - // found it - g_source_remove_poll(&d->socketNotifierSource->source, &p->pollfd); - - d->socketNotifierSource->pollfds.removeAt(i); - delete p; - - return; - } - } -} - -void QEventDispatcherGlib::registerTimer(int timerId, int interval, QObject *object) -{ -#ifndef QT_NO_DEBUG - if (timerId < 1 || interval < 0 || !object) { - qWarning("QEventDispatcherGlib::registerTimer: invalid arguments"); - return; - } else if (object->thread() != thread() || thread() != QThread::currentThread()) { - qWarning("QObject::startTimer: timers cannot be started from another thread"); - return; - } -#endif - - Q_D(QEventDispatcherGlib); - d->timerSource->timerList.registerTimer(timerId, interval, object); -} - -bool QEventDispatcherGlib::unregisterTimer(int timerId) -{ -#ifndef QT_NO_DEBUG - if (timerId < 1) { - qWarning("QEventDispatcherGlib::unregisterTimer: invalid argument"); - return false; - } else if (thread() != QThread::currentThread()) { - qWarning("QObject::killTimer: timers cannot be stopped from another thread"); - return false; - } -#endif - - Q_D(QEventDispatcherGlib); - return d->timerSource->timerList.unregisterTimer(timerId); -} - -bool QEventDispatcherGlib::unregisterTimers(QObject *object) -{ -#ifndef QT_NO_DEBUG - if (!object) { - qWarning("QEventDispatcherGlib::unregisterTimers: invalid argument"); - return false; - } else if (object->thread() != thread() || thread() != QThread::currentThread()) { - qWarning("QObject::killTimers: timers cannot be stopped from another thread"); - return false; - } -#endif - - Q_D(QEventDispatcherGlib); - return d->timerSource->timerList.unregisterTimers(object); -} - -QList QEventDispatcherGlib::registeredTimers(QObject *object) const -{ - if (!object) { - qWarning("QEventDispatcherUNIX:registeredTimers: invalid argument"); - return QList(); - } - - Q_D(const QEventDispatcherGlib); - return d->timerSource->timerList.registeredTimers(object); -} - -void QEventDispatcherGlib::interrupt() -{ - wakeUp(); -} - -void QEventDispatcherGlib::wakeUp() -{ - Q_D(QEventDispatcherGlib); - d->postEventSource->serialNumber.ref(); - g_main_context_wakeup(d->mainContext); -} - -void QEventDispatcherGlib::flush() -{ -} - -QEventDispatcherGlib::QEventDispatcherGlib(QEventDispatcherGlibPrivate &dd, QObject *parent) - : QAbstractEventDispatcher(dd, parent) -{ -} - -#include "moc_qeventdispatcher_glib_p.h" - -QT_END_NAMESPACE diff --git a/src/core/kernel/qeventdispatcher_glib_p.h b/src/core/kernel/qeventdispatcher_glib_p.h deleted file mode 100644 index e96d36713..000000000 --- a/src/core/kernel/qeventdispatcher_glib_p.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2016-2019 Ivailo Monev -** -** This file is part of the QtCore module of the Katie Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QEVENTDISPATCHER_GLIB_P_H -#define QEVENTDISPATCHER_GLIB_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Katie API. It exists for the convenience -// of the QEventDispatcherGlib class. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - -#include "qabstracteventdispatcher.h" -#include "qabstracteventdispatcher_p.h" - -#include - -QT_BEGIN_NAMESPACE - -struct GPostEventSource; -struct GSocketNotifierSource; -struct GTimerSource; -struct GIdleTimerSource; - -class Q_CORE_EXPORT QEventDispatcherGlibPrivate : public QAbstractEventDispatcherPrivate -{ - -public: - QEventDispatcherGlibPrivate(GMainContext *context = Q_NULLPTR); - GMainContext *mainContext; - GPostEventSource *postEventSource; - GSocketNotifierSource *socketNotifierSource; - GTimerSource *timerSource; - GIdleTimerSource *idleTimerSource; - - void runTimersOnceWithNormalPriority(); -}; - -class Q_CORE_EXPORT QEventDispatcherGlib : public QAbstractEventDispatcher -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QEventDispatcherGlib) - -public: - explicit QEventDispatcherGlib(QObject *parent = Q_NULLPTR); - explicit QEventDispatcherGlib(GMainContext *context, QObject *parent = Q_NULLPTR); - ~QEventDispatcherGlib(); - - bool processEvents(QEventLoop::ProcessEventsFlags flags); - bool hasPendingEvents(); - - void registerSocketNotifier(QSocketNotifier *socketNotifier); - void unregisterSocketNotifier(QSocketNotifier *socketNotifier); - - void registerTimer(int timerId, int interval, QObject *object); - bool unregisterTimer(int timerId); - bool unregisterTimers(QObject *object); - QList registeredTimers(QObject *object) const; - - void wakeUp(); - void interrupt(); - void flush(); - -protected: - QEventDispatcherGlib(QEventDispatcherGlibPrivate &dd, QObject *parent); -}; - -QT_END_NAMESPACE - -#endif // QEVENTDISPATCHER_GLIB_P_H diff --git a/src/core/thread/qthread_unix.cpp b/src/core/thread/qthread_unix.cpp index 93a50187c..f3f6919a2 100644 --- a/src/core/thread/qthread_unix.cpp +++ b/src/core/thread/qthread_unix.cpp @@ -37,10 +37,6 @@ #include "qcoreapplication_p.h" #include "qthread_p.h" #include "qdebug.h" - -#if !defined(QT_NO_GLIB) -# include "../kernel/qeventdispatcher_glib_p.h" -#endif #include "qeventdispatcher_unix_p.h" #include @@ -173,11 +169,6 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data) { QMutexLocker l(&data->postEventList.mutex); -#if !defined(QT_NO_GLIB) - if (qgetenv("QT_NO_GLIB").isEmpty() && qgetenv("QT_NO_THREADED_GLIB").isEmpty()) - data->eventDispatcher = new QEventDispatcherGlib; - else -#endif data->eventDispatcher = new QEventDispatcherUNIX; l.unlock(); diff --git a/src/gui/kernel/kernel.cmake b/src/gui/kernel/kernel.cmake index 3f69923d9..a03257104 100644 --- a/src/gui/kernel/kernel.cmake +++ b/src/gui/kernel/kernel.cmake @@ -92,19 +92,3 @@ set(GUI_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qkeymapper_x11.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qeventdispatcher_x11.cpp ) - -if(WITH_GLIB2 AND GLIB2_FOUND) - set(GUI_HEADERS - ${GUI_HEADERS} - ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qguieventdispatcher_glib_p.h - ) - set(GUI_SOURCES - ${GUI_SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qguieventdispatcher_glib.cpp - ) - set(EXTRA_GUI_LIBS - ${EXTRA_GUI_LIBS} - ${GLIB2_LIBRARIES} - ) - include_directories(${GLIB2_INCLUDES}) -endif() diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index c6858f32e..e83be8085 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -81,10 +81,6 @@ #include "qwidget_p.h" #include "qbackingstore_p.h" -#if !defined(QT_NO_GLIB) -# include "qguieventdispatcher_glib_p.h" -#endif - #ifndef QT_GUI_DOUBLE_CLICK_RADIUS #define QT_GUI_DOUBLE_CLICK_RADIUS 5 #endif @@ -470,16 +466,9 @@ public: void QApplicationPrivate::createEventDispatcher() { Q_Q(QApplication); -#if !defined(QT_NO_GLIB) - if (qgetenv("QT_NO_GLIB").isEmpty()) - eventDispatcher = (q->type() != QApplication::Tty - ? new QGuiEventDispatcherGlib(q) - : new QEventDispatcherGlib(q)); - else -#endif - eventDispatcher = (q->type() != QApplication::Tty - ? new QEventDispatcherX11(q) - : new QEventDispatcherUNIX(q)); + eventDispatcher = (q->type() != QApplication::Tty + ? new QEventDispatcherX11(q) + : new QEventDispatcherUNIX(q)); } /***************************************************************************** diff --git a/src/gui/kernel/qguieventdispatcher_glib.cpp b/src/gui/kernel/qguieventdispatcher_glib.cpp deleted file mode 100644 index 90df52221..000000000 --- a/src/gui/kernel/qguieventdispatcher_glib.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2016-2019 Ivailo Monev -** -** This file is part of the QtGui module of the Katie Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qguieventdispatcher_glib_p.h" - -#include "qapplication.h" -#include "qx11info_x11.h" - -#include "qt_x11_p.h" - -#include - -QT_BEGIN_NAMESPACE - -struct GX11EventSource -{ - GSource source; - GPollFD pollfd; - QEventLoop::ProcessEventsFlags flags; - QGuiEventDispatcherGlib *q; - QGuiEventDispatcherGlibPrivate *d; -}; - -class QGuiEventDispatcherGlibPrivate : public QEventDispatcherGlibPrivate -{ - Q_DECLARE_PUBLIC(QGuiEventDispatcherGlib) - -public: - QGuiEventDispatcherGlibPrivate(); - GX11EventSource *x11EventSource; - QList queuedUserInputEvents; -}; - -static gboolean x11EventSourcePrepare(GSource *s, gint *timeout) -{ - if (timeout) - *timeout = -1; - GX11EventSource *source = reinterpret_cast(s); - return (XEventsQueued(qt_x11Data->display, QueuedAfterFlush) - || (!(source->flags & QEventLoop::ExcludeUserInputEvents) - && !source->d->queuedUserInputEvents.isEmpty())); -} - -static gboolean x11EventSourceCheck(GSource *s) -{ - GX11EventSource *source = reinterpret_cast(s); - return (XEventsQueued(qt_x11Data->display, QueuedAfterFlush) - || (!(source->flags & QEventLoop::ExcludeUserInputEvents) - && !source->d->queuedUserInputEvents.isEmpty())); -} - -static gboolean x11EventSourceDispatch(GSource *s, GSourceFunc callback, gpointer user_data) -{ - GX11EventSource *source = reinterpret_cast(s); - - ulong marker = XNextRequest(qt_x11Data->display); - do { - XEvent event; - if (!(source->flags & QEventLoop::ExcludeUserInputEvents) - && !source->d->queuedUserInputEvents.isEmpty()) { - // process a pending user input event - event = source->d->queuedUserInputEvents.takeFirst(); - } else if (XEventsQueued(qt_x11Data->display, QueuedAlready)) { - // process events from the X server - XNextEvent(qt_x11Data->display, &event); - - if (source->flags & QEventLoop::ExcludeUserInputEvents) { - // queue user input events - switch (event.type) { - case XButtonPress: - case XButtonRelease: - case MotionNotify: - case XKeyPress: - case XKeyRelease: - case EnterNotify: - case LeaveNotify: - source->d->queuedUserInputEvents.append(event); - continue; - - case ClientMessage: - // only keep the wm_take_focus and - // _qt_scrolldone protocols, queue all other - // client messages - if (event.xclient.format == 32) { - if (event.xclient.message_type == ATOM(WM_PROTOCOLS) && - (Atom) event.xclient.data.l[0] == ATOM(WM_TAKE_FOCUS)) { - break; - } else if (event.xclient.message_type == ATOM(_QT_SCROLL_DONE)) { - break; - } - } - source->d->queuedUserInputEvents.append(event); - continue; - - default: - break; - } - } - } else { - // no event to process - break; - } - - // send through event filter - if (source->q->filterEvent(&event)) - continue; - - if (qApp->x11ProcessEvent(&event) == 1) - return true; - - if (event.xany.serial >= marker) - goto out; - } while (XEventsQueued(qt_x11Data->display, QueuedAfterFlush)); - - out: - - source->d->runTimersOnceWithNormalPriority(); - - if (callback) - callback(user_data); - return true; -} - -static GSourceFuncs x11EventSourceFuncs = { - x11EventSourcePrepare, - x11EventSourceCheck, - x11EventSourceDispatch, - NULL, - NULL, - NULL -}; - -QGuiEventDispatcherGlibPrivate::QGuiEventDispatcherGlibPrivate() -{ - x11EventSource = reinterpret_cast(g_source_new(&x11EventSourceFuncs, - sizeof(GX11EventSource))); - g_source_set_can_recurse(&x11EventSource->source, true); - - memset(&x11EventSource->pollfd, 0, sizeof(GPollFD)); - x11EventSource->flags = QEventLoop::AllEvents; - x11EventSource->q = 0; - x11EventSource->d = 0; - - g_source_attach(&x11EventSource->source, mainContext); -} - -QGuiEventDispatcherGlib::QGuiEventDispatcherGlib(QObject *parent) - : QEventDispatcherGlib(*new QGuiEventDispatcherGlibPrivate, parent) -{ -} - -QGuiEventDispatcherGlib::~QGuiEventDispatcherGlib() -{ - Q_D(QGuiEventDispatcherGlib); - - g_source_remove_poll(&d->x11EventSource->source, &d->x11EventSource->pollfd); - g_source_destroy(&d->x11EventSource->source); - d->x11EventSource = 0; -} - -bool QGuiEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags) -{ - Q_D(QGuiEventDispatcherGlib); - QEventLoop::ProcessEventsFlags saved_flags = d->x11EventSource->flags; - d->x11EventSource->flags = flags; - bool returnValue = QEventDispatcherGlib::processEvents(flags); - d->x11EventSource->flags = saved_flags; - return returnValue; -} - -void QGuiEventDispatcherGlib::startingUp() -{ - Q_D(QGuiEventDispatcherGlib); - d->x11EventSource->pollfd.fd = XConnectionNumber(qt_x11Data->display); - d->x11EventSource->pollfd.events = G_IO_IN | G_IO_HUP | G_IO_ERR; - d->x11EventSource->q = this; - d->x11EventSource->d = d; - g_source_add_poll(&d->x11EventSource->source, &d->x11EventSource->pollfd); -} - -void QGuiEventDispatcherGlib::flush() -{ - XFlush(qt_x11Data->display); -} - -QT_END_NAMESPACE - -#include "moc_qguieventdispatcher_glib_p.h" diff --git a/src/gui/kernel/qguieventdispatcher_glib_p.h b/src/gui/kernel/qguieventdispatcher_glib_p.h deleted file mode 100644 index d33525b8b..000000000 --- a/src/gui/kernel/qguieventdispatcher_glib_p.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2016-2019 Ivailo Monev -** -** This file is part of the QtGui module of the Katie Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QGUIEVENTDISPATCHER_GLIB_P_H -#define QGUIEVENTDISPATCHER_GLIB_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Katie API. It exists for the convenience -// of the QLibrary class. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QGuiEventDispatcherGlibPrivate; - -class QGuiEventDispatcherGlib : public QEventDispatcherGlib -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QGuiEventDispatcherGlib) - -public: - explicit QGuiEventDispatcherGlib(QObject *parent = Q_NULLPTR); - ~QGuiEventDispatcherGlib(); - - bool processEvents(QEventLoop::ProcessEventsFlags flags); - - void startingUp(); - void flush(); -}; - -QT_END_NAMESPACE - -#endif // QGUIEVENTDISPATCHER_GLIB_P_H -- 2.11.0