Add lighthouse event dispatcher API.
Platform plugin creation is now moved forward in order to have a platform plugin instance at event dispatcher creation time. Plugins are now responsible for implementing PlatformIntegration::createEventDispatcher and returning an QAbstractEventDispatcher subclass.
This commit is contained in:
parent
18c1d67137
commit
4efaf305f5
@ -217,7 +217,7 @@ private:
|
|||||||
friend class QWidget;
|
friend class QWidget;
|
||||||
friend class QWidgetWindow;
|
friend class QWidgetWindow;
|
||||||
friend class QWidgetPrivate;
|
friend class QWidgetPrivate;
|
||||||
friend class QEventDispatcherMacPrivate;
|
friend class QCocoaEventDispatcherPrivate;
|
||||||
friend bool qt_sendSpontaneousEvent(QObject*, QEvent*);
|
friend bool qt_sendSpontaneousEvent(QObject*, QEvent*);
|
||||||
friend Q_CORE_EXPORT QString qAppName();
|
friend Q_CORE_EXPORT QString qAppName();
|
||||||
friend class QClassFactory;
|
friend class QClassFactory;
|
||||||
|
@ -38,7 +38,6 @@ qpa {
|
|||||||
HEADERS += \
|
HEADERS += \
|
||||||
kernel/qgenericpluginfactory_qpa.h \
|
kernel/qgenericpluginfactory_qpa.h \
|
||||||
kernel/qgenericplugin_qpa.h \
|
kernel/qgenericplugin_qpa.h \
|
||||||
kernel/qeventdispatcher_qpa_p.h \
|
|
||||||
kernel/qwindowsysteminterface_qpa.h \
|
kernel/qwindowsysteminterface_qpa.h \
|
||||||
kernel/qwindowsysteminterface_qpa_p.h \
|
kernel/qwindowsysteminterface_qpa_p.h \
|
||||||
kernel/qplatformintegration_qpa.h \
|
kernel/qplatformintegration_qpa.h \
|
||||||
@ -63,7 +62,6 @@ qpa {
|
|||||||
kernel/qcursor_qpa.cpp \
|
kernel/qcursor_qpa.cpp \
|
||||||
kernel/qgenericpluginfactory_qpa.cpp \
|
kernel/qgenericpluginfactory_qpa.cpp \
|
||||||
kernel/qgenericplugin_qpa.cpp \
|
kernel/qgenericplugin_qpa.cpp \
|
||||||
kernel/qeventdispatcher_qpa.cpp \
|
|
||||||
kernel/qwindowsysteminterface_qpa.cpp \
|
kernel/qwindowsysteminterface_qpa.cpp \
|
||||||
kernel/qplatformintegration_qpa.cpp \
|
kernel/qplatformintegration_qpa.cpp \
|
||||||
kernel/qplatformscreen_qpa.cpp \
|
kernel/qplatformscreen_qpa.cpp \
|
||||||
@ -79,23 +77,6 @@ qpa {
|
|||||||
kernel/qsurfaceformat.cpp \
|
kernel/qsurfaceformat.cpp \
|
||||||
kernel/qguiapplication.cpp \
|
kernel/qguiapplication.cpp \
|
||||||
kernel/qwindow.cpp
|
kernel/qwindow.cpp
|
||||||
|
|
||||||
contains(QT_CONFIG, glib) {
|
|
||||||
SOURCES += \
|
|
||||||
kernel/qeventdispatcher_glib_qpa.cpp
|
|
||||||
HEADERS += \
|
|
||||||
kernel/qeventdispatcher_glib_qpa_p.h
|
|
||||||
QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB
|
|
||||||
LIBS_PRIVATE +=$$QT_LIBS_GLIB
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mac {
|
|
||||||
HEADERS += \
|
|
||||||
kernel/qeventdispatcher_mac_p.h
|
|
||||||
OBJECTIVE_SOURCES += \
|
|
||||||
kernel/qeventdispatcher_mac.mm
|
|
||||||
LIBS += -framework CoreFoundation -framework Cocoa -framework Carbon
|
|
||||||
}
|
}
|
||||||
|
|
||||||
win32:HEADERS+=kernel/qwindowdefs_win.h
|
win32:HEADERS+=kernel/qwindowdefs_win.h
|
||||||
|
@ -46,14 +46,6 @@
|
|||||||
#include "private/qevent_p.h"
|
#include "private/qevent_p.h"
|
||||||
#include "qfont.h"
|
#include "qfont.h"
|
||||||
|
|
||||||
#if !defined(QT_NO_GLIB)
|
|
||||||
#include "qeventdispatcher_glib_qpa_p.h"
|
|
||||||
#endif
|
|
||||||
#include "qeventdispatcher_qpa_p.h"
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
#include "qeventdispatcher_mac_p.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QtCore/QAbstractEventDispatcher>
|
#include <QtCore/QAbstractEventDispatcher>
|
||||||
#include <QtCore/private/qcoreapplication_p.h>
|
#include <QtCore/private/qcoreapplication_p.h>
|
||||||
#include <QtCore/private/qabstracteventdispatcher_p.h>
|
#include <QtCore/private/qabstracteventdispatcher_p.h>
|
||||||
@ -240,24 +232,9 @@ static void init_plugins(const QList<QByteArray> &pluginList)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGuiApplicationPrivate::createEventDispatcher()
|
void QGuiApplicationPrivate::createPlatformIntegration()
|
||||||
{
|
{
|
||||||
Q_Q(QGuiApplication);
|
// Load the platform integration
|
||||||
#if !defined(QT_NO_GLIB) && !defined(Q_OS_WIN)
|
|
||||||
if (qgetenv("QT_NO_GLIB").isEmpty() && QEventDispatcherGlib::versionSupported())
|
|
||||||
eventDispatcher = new QPAEventDispatcherGlib(q);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
eventDispatcher = new QEventDispatcherMac(q);
|
|
||||||
#else
|
|
||||||
eventDispatcher = new QEventDispatcherQPA(q);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void QGuiApplicationPrivate::init()
|
|
||||||
{
|
|
||||||
QList<QByteArray> pluginList;
|
|
||||||
QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
|
QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
|
||||||
QByteArray platformName;
|
QByteArray platformName;
|
||||||
#ifdef QT_QPA_DEFAULT_PLATFORM_NAME
|
#ifdef QT_QPA_DEFAULT_PLATFORM_NAME
|
||||||
@ -283,7 +260,45 @@ void QGuiApplicationPrivate::init()
|
|||||||
} else if (arg == "-platform") {
|
} else if (arg == "-platform") {
|
||||||
if (++i < argc)
|
if (++i < argc)
|
||||||
platformName = argv[i];
|
platformName = argv[i];
|
||||||
} else if (arg == "-plugin") {
|
} else {
|
||||||
|
argv[j++] = argv[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j < argc) {
|
||||||
|
argv[j] = 0;
|
||||||
|
argc = j;
|
||||||
|
}
|
||||||
|
|
||||||
|
init_platform(QLatin1String(platformName), platformPluginPath);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void QGuiApplicationPrivate::createEventDispatcher()
|
||||||
|
{
|
||||||
|
Q_Q(QGuiApplication);
|
||||||
|
|
||||||
|
if (platform_integration == 0)
|
||||||
|
createPlatformIntegration();
|
||||||
|
|
||||||
|
eventDispatcher = platform_integration->createEventDispatcher();
|
||||||
|
eventDispatcher->setParent(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QGuiApplicationPrivate::init()
|
||||||
|
{
|
||||||
|
qDebug() << "QGuiApplicationPrivate::init";
|
||||||
|
QList<QByteArray> pluginList;
|
||||||
|
// Get command line params
|
||||||
|
|
||||||
|
int j = argc ? 1 : 0;
|
||||||
|
for (int i=1; i<argc; i++) {
|
||||||
|
if (argv[i] && *argv[i] != '-') {
|
||||||
|
argv[j++] = argv[i];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QByteArray arg = argv[i];
|
||||||
|
if (arg == "-plugin") {
|
||||||
if (++i < argc)
|
if (++i < argc)
|
||||||
pluginList << argv[i];
|
pluginList << argv[i];
|
||||||
} else if (arg == "-reverse") {
|
} else if (arg == "-reverse") {
|
||||||
@ -299,14 +314,9 @@ void QGuiApplicationPrivate::init()
|
|||||||
argc = j;
|
argc = j;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
if (platform_integration == 0)
|
||||||
QByteArray pluginEnv = qgetenv("QT_QPA_PLUGINS");
|
createPlatformIntegration();
|
||||||
if (!pluginEnv.isEmpty()) {
|
|
||||||
pluginList.append(pluginEnv.split(';'));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
init_platform(QLatin1String(platformName), platformPluginPath);
|
|
||||||
init_plugins(pluginList);
|
init_plugins(pluginList);
|
||||||
|
|
||||||
// Set up which span functions should be used in raster engine...
|
// Set up which span functions should be used in raster engine...
|
||||||
|
@ -67,6 +67,7 @@ public:
|
|||||||
QGuiApplicationPrivate(int &argc, char **argv, int flags);
|
QGuiApplicationPrivate(int &argc, char **argv, int flags);
|
||||||
~QGuiApplicationPrivate();
|
~QGuiApplicationPrivate();
|
||||||
|
|
||||||
|
void createPlatformIntegration();
|
||||||
void createEventDispatcher();
|
void createEventDispatcher();
|
||||||
|
|
||||||
virtual void notifyLayoutDirectionChange();
|
virtual void notifyLayoutDirectionChange();
|
||||||
|
@ -214,6 +214,13 @@ QPlatformGLContext *QPlatformIntegration::createPlatformGLContext(const QSurface
|
|||||||
QRect(x,y,width,height).
|
QRect(x,y,width,height).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn QAbstractEventDispatcher *createEventDispatcher() const
|
||||||
|
|
||||||
|
Factory function for the event dispatcher. The platform plugin
|
||||||
|
must create and and return a QAbstractEventDispatcher subclass when
|
||||||
|
this function is called.
|
||||||
|
*/
|
||||||
|
|
||||||
bool QPlatformIntegration::hasCapability(Capability cap) const
|
bool QPlatformIntegration::hasCapability(Capability cap) const
|
||||||
{
|
{
|
||||||
|
@ -63,6 +63,7 @@ class QPlatformPrinterSupport;
|
|||||||
class QPlatformDrag;
|
class QPlatformDrag;
|
||||||
class QPlatformGLContext;
|
class QPlatformGLContext;
|
||||||
class QGuiGLFormat;
|
class QGuiGLFormat;
|
||||||
|
class QAbstractEventDispatcher;
|
||||||
|
|
||||||
class Q_GUI_EXPORT QPlatformIntegration
|
class Q_GUI_EXPORT QPlatformIntegration
|
||||||
{
|
{
|
||||||
@ -88,6 +89,9 @@ public:
|
|||||||
virtual bool isVirtualDesktop() { return false; }
|
virtual bool isVirtualDesktop() { return false; }
|
||||||
virtual QPixmap grabWindow(WId window, int x, int y, int width, int height) const;
|
virtual QPixmap grabWindow(WId window, int x, int y, int width, int height) const;
|
||||||
|
|
||||||
|
// Event dispatcher:
|
||||||
|
virtual QAbstractEventDispatcher *createEventDispatcher() const = 0;
|
||||||
|
|
||||||
//Deeper window system integrations
|
//Deeper window system integrations
|
||||||
virtual QPlatformFontDatabase *fontDatabase() const;
|
virtual QPlatformFontDatabase *fontDatabase() const;
|
||||||
#ifndef QT_NO_CLIPBOARD
|
#ifndef QT_NO_CLIPBOARD
|
||||||
|
@ -47,7 +47,7 @@ QT_BEGIN_HEADER
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QWindowSystemInterfacePrivate {
|
class Q_GUI_EXPORT QWindowSystemInterfacePrivate {
|
||||||
public:
|
public:
|
||||||
enum EventType {
|
enum EventType {
|
||||||
Close,
|
Close,
|
||||||
|
16
src/platformsupport/eventdispatchers/eventdispatchers.pri
Normal file
16
src/platformsupport/eventdispatchers/eventdispatchers.pri
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
unix {
|
||||||
|
SOURCES +=\
|
||||||
|
$$PWD/qeventdispatcher_qpa.cpp\
|
||||||
|
$$PWD/qgenericunixeventdispatcher.cpp\
|
||||||
|
|
||||||
|
HEADERS +=\
|
||||||
|
$$PWD/qeventdispatcher_qpa_p.h\
|
||||||
|
$$PWD/qgenericunixeventdispatcher_p.h\
|
||||||
|
}
|
||||||
|
|
||||||
|
contains(QT_CONFIG, glib) {
|
||||||
|
SOURCES +=$$PWD/qeventdispatcher_glib.cpp
|
||||||
|
HEADERS +=$$PWD/qeventdispatcher_glib_p.h
|
||||||
|
QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB
|
||||||
|
LIBS_PRIVATE += $$QT_LIBS_GLIB
|
||||||
|
}
|
10
src/platformsupport/eventdispatchers/fontdatabases.pri
Normal file
10
src/platformsupport/eventdispatchers/fontdatabases.pri
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
DEFINES += QT_COMPILES_IN_HARFBUZZ
|
||||||
|
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
|
||||||
|
|
||||||
|
unix {
|
||||||
|
include($$PWD/basicunix/basicunix.pri)
|
||||||
|
include($$PWD/genericunix/genericunix.pri)
|
||||||
|
contains(QT_CONFIG,fontconfig) {
|
||||||
|
include($$PWD/fontconfig/fontconfig.pri)
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@
|
|||||||
** All rights reserved.
|
** All rights reserved.
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
**
|
**
|
||||||
** This file is part of the QtCore module of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
||||||
@ -39,7 +39,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qeventdispatcher_glib_qpa_p.h"
|
#include "qeventdispatcher_glib_p.h"
|
||||||
|
|
||||||
#include "qguiapplication.h"
|
#include "qguiapplication.h"
|
||||||
|
|
@ -4,7 +4,7 @@
|
|||||||
** All rights reserved.
|
** All rights reserved.
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
**
|
**
|
||||||
** This file is part of the QtCore module of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
@ -4,7 +4,7 @@
|
|||||||
** All rights reserved.
|
** All rights reserved.
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
**
|
**
|
||||||
** This file is part of the QtGui module of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
@ -4,7 +4,7 @@
|
|||||||
** All rights reserved.
|
** All rights reserved.
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
**
|
**
|
||||||
** This file is part of the QtGui module of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
||||||
@ -39,8 +39,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef QEVENTDISPATCHER_QPA_P_H
|
#ifndef QEVENTDISPATCHER_QPA_H
|
||||||
#define QEVENTDISPATCHER_QPA_P_H
|
#define QEVENTDISPATCHER_QPA_H
|
||||||
|
|
||||||
//
|
//
|
||||||
// W A R N I N G
|
// W A R N I N G
|
||||||
@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QEventDispatcherQPAPrivate;
|
class QEventDispatcherQPAPrivate;
|
||||||
|
|
||||||
class QEventDispatcherQPA : public EVENTDISPATCHERBASE
|
class Q_GUI_EXPORT QEventDispatcherQPA : public EVENTDISPATCHERBASE
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DECLARE_PRIVATE(QEventDispatcherQPA)
|
Q_DECLARE_PRIVATE(QEventDispatcherQPA)
|
||||||
@ -84,7 +84,7 @@ public:
|
|||||||
void flush();
|
void flush();
|
||||||
};
|
};
|
||||||
|
|
||||||
class QEventDispatcherQPAPrivate : public EVENTDISPATCHERBASEPRIVATE
|
class Q_GUI_EXPORT QEventDispatcherQPAPrivate : public EVENTDISPATCHERBASEPRIVATE
|
||||||
{
|
{
|
||||||
Q_DECLARE_PUBLIC(QEventDispatcherQPA)
|
Q_DECLARE_PUBLIC(QEventDispatcherQPA)
|
||||||
public:
|
public:
|
||||||
@ -94,4 +94,4 @@ public:
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QEVENTDISPATCHER_QPA_P_H
|
#endif // QEVENTDISPATCHER_QPA_H
|
@ -0,0 +1,55 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
** All rights reserved.
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||||
|
** file. Please review the following information to ensure the GNU Lesser
|
||||||
|
** General Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt 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.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "qgenericunixeventdispatcher_p.h"
|
||||||
|
#include "qeventdispatcher_qpa_p.h"
|
||||||
|
#include "qeventdispatcher_glib_p.h"
|
||||||
|
#include <qglobal.h>
|
||||||
|
|
||||||
|
class QAbstractEventDispatcher *createUnixEventDispatcher()
|
||||||
|
{
|
||||||
|
#if !defined(QT_NO_GLIB) && !defined(Q_OS_WIN)
|
||||||
|
if (qgetenv("QT_NO_GLIB").isEmpty() && QEventDispatcherGlib::versionSupported())
|
||||||
|
return new QPAEventDispatcherGlib();
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
return new QEventDispatcherQPA();
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
** All rights reserved.
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||||
|
** file. Please review the following information to ensure the GNU Lesser
|
||||||
|
** General Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt 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.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
class QAbstractEventDispatcher;
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
Q_GUI_EXPORT QAbstractEventDispatcher* createUnixEventDispatcher();
|
||||||
|
#else
|
||||||
|
Q_GUI_EXPORT QAbstractEventDispatcher* createUnixEventDispatcher();
|
||||||
|
#endif
|
@ -7,7 +7,7 @@ DESTDIR = $$QMAKE_LIBDIR_QT
|
|||||||
|
|
||||||
CONFIG += module
|
CONFIG += module
|
||||||
!mac:CONFIG += staticlib
|
!mac:CONFIG += staticlib
|
||||||
mac:LIBS+=-lz
|
mac:LIBS += -lz -framework CoreFoundation -framework Carbon
|
||||||
|
|
||||||
MODULE_PRI = ../modules/qt_platformssupport.pri
|
MODULE_PRI = ../modules/qt_platformssupport.pri
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
|
|||||||
|
|
||||||
include(dnd/dnd.pri)
|
include(dnd/dnd.pri)
|
||||||
include(eglconvenience/eglconvenience.pri)
|
include(eglconvenience/eglconvenience.pri)
|
||||||
|
include(eventdispatchers/eventdispatchers.pri)
|
||||||
include(fb_base/fb_base.pri)
|
include(fb_base/fb_base.pri)
|
||||||
include(fontdatabases/fontdatabases.pri)
|
include(fontdatabases/fontdatabases.pri)
|
||||||
include(glxconvenience/glxconvenience.pri)
|
include(glxconvenience/glxconvenience.pri)
|
||||||
|
@ -2,7 +2,7 @@ TARGET = qcocoa
|
|||||||
load(qt_plugin)
|
load(qt_plugin)
|
||||||
DESTDIR = $$QT.gui.plugins/platforms
|
DESTDIR = $$QT.gui.plugins/platforms
|
||||||
|
|
||||||
OBJECTIVE_SOURCES = main.mm \
|
OBJECTIVE_SOURCES += main.mm \
|
||||||
qcocoaintegration.mm \
|
qcocoaintegration.mm \
|
||||||
qcocoabackingstore.mm \
|
qcocoabackingstore.mm \
|
||||||
qcocoawindow.mm \
|
qcocoawindow.mm \
|
||||||
@ -10,23 +10,24 @@ OBJECTIVE_SOURCES = main.mm \
|
|||||||
qcocoaautoreleasepool.mm \
|
qcocoaautoreleasepool.mm \
|
||||||
qnswindowdelegate.mm \
|
qnswindowdelegate.mm \
|
||||||
qcocoaglcontext.mm \
|
qcocoaglcontext.mm \
|
||||||
qcocoanativeinterface.mm
|
qcocoanativeinterface.mm \
|
||||||
|
qcocoaeventdispatcher.mm
|
||||||
|
|
||||||
|
HEADERS += qcocoaintegration.h \
|
||||||
OBJECTIVE_HEADERS = qcocoaintegration.h \
|
|
||||||
qcocoabackingstore.h \
|
qcocoabackingstore.h \
|
||||||
qcocoawindow.h \
|
qcocoawindow.h \
|
||||||
qnsview.h \
|
qnsview.h \
|
||||||
qcocoaautoreleasepool.h \
|
qcocoaautoreleasepool.h \
|
||||||
qnswindowdelegate.h \
|
qnswindowdelegate.h \
|
||||||
qcocoaglcontext.h \
|
qcocoaglcontext.h \
|
||||||
qcocoanativeinterface.h
|
qcocoanativeinterface.h \
|
||||||
|
qcocoaeventdispatcher.h
|
||||||
|
|
||||||
DEFINES += QT_BUILD_COCOA_LIB
|
DEFINES += QT_BUILD_COCOA_LIB
|
||||||
|
|
||||||
#add libz for freetype.
|
#add libz for freetype.
|
||||||
LIBS += -lz
|
LIBS += -lz
|
||||||
LIBS += -framework cocoa
|
LIBS += -framework cocoa -framework Carbon
|
||||||
|
|
||||||
QT += core-private gui-private platformsupport-private
|
QT += core-private gui-private platformsupport-private
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
** All rights reserved.
|
** All rights reserved.
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
**
|
**
|
||||||
** This file is part of the QtGui module of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
||||||
@ -87,12 +87,10 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <QtGui/qwindowdefs.h>
|
|
||||||
#include <QtCore/qhash.h>
|
#include <QtCore/qhash.h>
|
||||||
#include <QtCore/qstack.h>
|
#include <QtCore/qstack.h>
|
||||||
#include "private/qabstracteventdispatcher_p.h"
|
#include <QtGui/qwindowdefs.h>
|
||||||
#include <private/qeventdispatcher_qpa_p.h>
|
#include <qeventdispatcher_qpa.h>
|
||||||
//#include "private/qt_mac_p.h"
|
|
||||||
|
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
|
||||||
@ -116,16 +114,16 @@ public:
|
|||||||
inline void *handle() const { return pool; }
|
inline void *handle() const { return pool; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class QEventDispatcherMacPrivate;
|
class QCocoaEventDispatcherPrivate;
|
||||||
class QEventDispatcherMac : public QEventDispatcherQPA
|
class QCocoaEventDispatcher : public QEventDispatcherQPA
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DECLARE_PRIVATE(QEventDispatcherMac)
|
Q_DECLARE_PRIVATE(QCocoaEventDispatcher)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QEventDispatcherMac(QAbstractEventDispatcherPrivate &priv, QObject *parent = 0);
|
QCocoaEventDispatcher(QAbstractEventDispatcherPrivate &priv, QObject *parent = 0);
|
||||||
explicit QEventDispatcherMac(QObject *parent = 0);
|
explicit QCocoaEventDispatcher(QObject *parent = 0);
|
||||||
~QEventDispatcherMac();
|
~QCocoaEventDispatcher();
|
||||||
|
|
||||||
|
|
||||||
bool processEvents(QEventLoop::ProcessEventsFlags flags);
|
bool processEvents(QEventLoop::ProcessEventsFlags flags);
|
||||||
@ -169,12 +167,12 @@ struct MacSocketInfo {
|
|||||||
};
|
};
|
||||||
typedef QHash<int, MacSocketInfo *> MacSocketHash;
|
typedef QHash<int, MacSocketInfo *> MacSocketHash;
|
||||||
|
|
||||||
class QEventDispatcherMacPrivate : public QEventDispatcherQPAPrivate
|
class QCocoaEventDispatcherPrivate : public QEventDispatcherQPAPrivate
|
||||||
{
|
{
|
||||||
Q_DECLARE_PUBLIC(QEventDispatcherMac)
|
Q_DECLARE_PUBLIC(QCocoaEventDispatcher)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QEventDispatcherMacPrivate();
|
QCocoaEventDispatcherPrivate();
|
||||||
|
|
||||||
static MacTimerHash macTimerHash;
|
static MacTimerHash macTimerHash;
|
||||||
// Set 'blockSendPostedEvents' to true if you _really_ need
|
// Set 'blockSendPostedEvents' to true if you _really_ need
|
||||||
@ -198,7 +196,7 @@ public:
|
|||||||
static void ensureNSAppInitialized();
|
static void ensureNSAppInitialized();
|
||||||
|
|
||||||
MacSocketHash macSockets;
|
MacSocketHash macSockets;
|
||||||
QList<void *> queuedUserInputEvents; // List of EventRef in Carbon, and NSEvent * in Cocoa
|
QList<void *> queuedUserInputEvents; // NSEvent *
|
||||||
CFRunLoopSourceRef postedEventsSource;
|
CFRunLoopSourceRef postedEventsSource;
|
||||||
CFRunLoopObserverRef waitingObserver;
|
CFRunLoopObserverRef waitingObserver;
|
||||||
CFRunLoopObserverRef firstTimeObserver;
|
CFRunLoopObserverRef firstTimeObserver;
|
||||||
@ -212,16 +210,16 @@ private:
|
|||||||
static void waitingObserverCallback(CFRunLoopObserverRef observer,
|
static void waitingObserverCallback(CFRunLoopObserverRef observer,
|
||||||
CFRunLoopActivity activity, void *info);
|
CFRunLoopActivity activity, void *info);
|
||||||
static void firstLoopEntry(CFRunLoopObserverRef ref, CFRunLoopActivity activity, void *info);
|
static void firstLoopEntry(CFRunLoopObserverRef ref, CFRunLoopActivity activity, void *info);
|
||||||
friend void processPostedEvents(QEventDispatcherMacPrivate *const d, const bool blockSendPostedEvents);
|
friend void processPostedEvents(QCocoaEventDispatcherPrivate *const d, const bool blockSendPostedEvents);
|
||||||
};
|
};
|
||||||
|
|
||||||
class QtMacInterruptDispatcherHelp : public QObject
|
class QtCocoaInterruptDispatcher : public QObject
|
||||||
{
|
{
|
||||||
static QtMacInterruptDispatcherHelp *instance;
|
static QtCocoaInterruptDispatcher *instance;
|
||||||
bool cancelled;
|
bool cancelled;
|
||||||
|
|
||||||
QtMacInterruptDispatcherHelp();
|
QtCocoaInterruptDispatcher();
|
||||||
~QtMacInterruptDispatcherHelp();
|
~QtCocoaInterruptDispatcher();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void interruptLater();
|
static void interruptLater();
|
@ -4,7 +4,7 @@
|
|||||||
** All rights reserved.
|
** All rights reserved.
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
**
|
**
|
||||||
** This file is part of the QtGui module of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
||||||
@ -73,7 +73,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qeventdispatcher_mac_p.h"
|
#include "qcocoaeventdispatcher.h"
|
||||||
#include "qguiapplication.h"
|
#include "qguiapplication.h"
|
||||||
#include "qevent.h"
|
#include "qevent.h"
|
||||||
#include "qhash.h"
|
#include "qhash.h"
|
||||||
@ -119,7 +119,7 @@ QMacCocoaAutoReleasePool::~QMacCocoaAutoReleasePool()
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/* timer call back */
|
/* timer call back */
|
||||||
void QEventDispatcherMacPrivate::activateTimer(CFRunLoopTimerRef, void *info)
|
void QCocoaEventDispatcherPrivate::activateTimer(CFRunLoopTimerRef, void *info)
|
||||||
{
|
{
|
||||||
int timerID =
|
int timerID =
|
||||||
#ifdef Q_OS_MAC64
|
#ifdef Q_OS_MAC64
|
||||||
@ -149,7 +149,7 @@ void QEventDispatcherMacPrivate::activateTimer(CFRunLoopTimerRef, void *info)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMac::registerTimer(int timerId, int interval, QObject *obj)
|
void QCocoaEventDispatcher::registerTimer(int timerId, int interval, QObject *obj)
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
if (timerId < 1 || interval < 0 || !obj) {
|
if (timerId < 1 || interval < 0 || !obj) {
|
||||||
@ -171,17 +171,17 @@ void QEventDispatcherMac::registerTimer(int timerId, int interval, QObject *obj)
|
|||||||
CFAbsoluteTime fireDate = CFAbsoluteTimeGetCurrent();
|
CFAbsoluteTime fireDate = CFAbsoluteTimeGetCurrent();
|
||||||
CFTimeInterval cfinterval = qMax(CFTimeInterval(interval) / 1000, 0.0000001);
|
CFTimeInterval cfinterval = qMax(CFTimeInterval(interval) / 1000, 0.0000001);
|
||||||
fireDate += cfinterval;
|
fireDate += cfinterval;
|
||||||
QEventDispatcherMacPrivate::macTimerHash.insert(timerId, t);
|
QCocoaEventDispatcherPrivate::macTimerHash.insert(timerId, t);
|
||||||
CFRunLoopTimerContext info = { 0, (void *)timerId, 0, 0, 0 };
|
CFRunLoopTimerContext info = { 0, (void *)timerId, 0, 0, 0 };
|
||||||
t->runLoopTimer = CFRunLoopTimerCreate(0, fireDate, cfinterval, 0, 0,
|
t->runLoopTimer = CFRunLoopTimerCreate(0, fireDate, cfinterval, 0, 0,
|
||||||
QEventDispatcherMacPrivate::activateTimer, &info);
|
QCocoaEventDispatcherPrivate::activateTimer, &info);
|
||||||
if (t->runLoopTimer == 0) {
|
if (t->runLoopTimer == 0) {
|
||||||
qFatal("QEventDispatcherMac::registerTimer: Cannot create timer");
|
qFatal("QEventDispatcherMac::registerTimer: Cannot create timer");
|
||||||
}
|
}
|
||||||
CFRunLoopAddTimer(mainRunLoop(), t->runLoopTimer, kCFRunLoopCommonModes);
|
CFRunLoopAddTimer(mainRunLoop(), t->runLoopTimer, kCFRunLoopCommonModes);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QEventDispatcherMac::unregisterTimer(int identifier)
|
bool QCocoaEventDispatcher::unregisterTimer(int identifier)
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
if (identifier < 1) {
|
if (identifier < 1) {
|
||||||
@ -195,7 +195,7 @@ bool QEventDispatcherMac::unregisterTimer(int identifier)
|
|||||||
if (identifier <= 0)
|
if (identifier <= 0)
|
||||||
return false; // not init'd or invalid timer
|
return false; // not init'd or invalid timer
|
||||||
|
|
||||||
MacTimerInfo *timerInfo = QEventDispatcherMacPrivate::macTimerHash.take(identifier);
|
MacTimerInfo *timerInfo = QCocoaEventDispatcherPrivate::macTimerHash.take(identifier);
|
||||||
if (timerInfo == 0)
|
if (timerInfo == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ bool QEventDispatcherMac::unregisterTimer(int identifier)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QEventDispatcherMac::unregisterTimers(QObject *obj)
|
bool QCocoaEventDispatcher::unregisterTimers(QObject *obj)
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
@ -220,8 +220,8 @@ bool QEventDispatcherMac::unregisterTimers(QObject *obj)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MacTimerHash::iterator it = QEventDispatcherMacPrivate::macTimerHash.begin();
|
MacTimerHash::iterator it = QCocoaEventDispatcherPrivate::macTimerHash.begin();
|
||||||
while (it != QEventDispatcherMacPrivate::macTimerHash.end()) {
|
while (it != QCocoaEventDispatcherPrivate::macTimerHash.end()) {
|
||||||
MacTimerInfo *timerInfo = it.value();
|
MacTimerInfo *timerInfo = it.value();
|
||||||
if (timerInfo->obj != obj) {
|
if (timerInfo->obj != obj) {
|
||||||
++it;
|
++it;
|
||||||
@ -231,14 +231,14 @@ bool QEventDispatcherMac::unregisterTimers(QObject *obj)
|
|||||||
CFRunLoopTimerInvalidate(timerInfo->runLoopTimer);
|
CFRunLoopTimerInvalidate(timerInfo->runLoopTimer);
|
||||||
CFRelease(timerInfo->runLoopTimer);
|
CFRelease(timerInfo->runLoopTimer);
|
||||||
delete timerInfo;
|
delete timerInfo;
|
||||||
it = QEventDispatcherMacPrivate::macTimerHash.erase(it);
|
it = QCocoaEventDispatcherPrivate::macTimerHash.erase(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QEventDispatcherMac::TimerInfo>
|
QList<QCocoaEventDispatcher::TimerInfo>
|
||||||
QEventDispatcherMac::registeredTimers(QObject *object) const
|
QCocoaEventDispatcher::registeredTimers(QObject *object) const
|
||||||
{
|
{
|
||||||
if (!object) {
|
if (!object) {
|
||||||
qWarning("QEventDispatcherMac:registeredTimers: invalid argument");
|
qWarning("QEventDispatcherMac:registeredTimers: invalid argument");
|
||||||
@ -247,8 +247,8 @@ QEventDispatcherMac::registeredTimers(QObject *object) const
|
|||||||
|
|
||||||
QList<TimerInfo> list;
|
QList<TimerInfo> list;
|
||||||
|
|
||||||
MacTimerHash::const_iterator it = QEventDispatcherMacPrivate::macTimerHash.constBegin();
|
MacTimerHash::const_iterator it = QCocoaEventDispatcherPrivate::macTimerHash.constBegin();
|
||||||
while (it != QEventDispatcherMacPrivate::macTimerHash.constEnd()) {
|
while (it != QCocoaEventDispatcherPrivate::macTimerHash.constEnd()) {
|
||||||
MacTimerInfo *t = it.value();
|
MacTimerInfo *t = it.value();
|
||||||
if (t->obj == object)
|
if (t->obj == object)
|
||||||
list << TimerInfo(t->id, t->interval);
|
list << TimerInfo(t->id, t->interval);
|
||||||
@ -262,8 +262,8 @@ QEventDispatcherMac::registeredTimers(QObject *object) const
|
|||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void qt_mac_socket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef,
|
void qt_mac_socket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef,
|
||||||
const void *, void *info) {
|
const void *, void *info) {
|
||||||
QEventDispatcherMacPrivate *const eventDispatcher
|
QCocoaEventDispatcherPrivate *const eventDispatcher
|
||||||
= static_cast<QEventDispatcherMacPrivate *>(info);
|
= static_cast<QCocoaEventDispatcherPrivate *>(info);
|
||||||
int nativeSocket = CFSocketGetNative(s);
|
int nativeSocket = CFSocketGetNative(s);
|
||||||
MacSocketInfo *socketInfo = eventDispatcher->macSockets.value(nativeSocket);
|
MacSocketInfo *socketInfo = eventDispatcher->macSockets.value(nativeSocket);
|
||||||
QEvent notifierEvent(QEvent::SockAct);
|
QEvent notifierEvent(QEvent::SockAct);
|
||||||
@ -314,7 +314,7 @@ void qt_mac_remove_socket_from_runloop(const CFSocketRef socket, CFRunLoopSource
|
|||||||
Qt has separate socket notifiers for reading and writing, but on the mac there is
|
Qt has separate socket notifiers for reading and writing, but on the mac there is
|
||||||
a limitation of one CFSocket object for each native socket.
|
a limitation of one CFSocket object for each native socket.
|
||||||
*/
|
*/
|
||||||
void QEventDispatcherMac::registerSocketNotifier(QSocketNotifier *notifier)
|
void QCocoaEventDispatcher::registerSocketNotifier(QSocketNotifier *notifier)
|
||||||
{
|
{
|
||||||
Q_ASSERT(notifier);
|
Q_ASSERT(notifier);
|
||||||
int nativeSocket = notifier->socket();
|
int nativeSocket = notifier->socket();
|
||||||
@ -330,7 +330,7 @@ void QEventDispatcherMac::registerSocketNotifier(QSocketNotifier *notifier)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Q_D(QEventDispatcherMac);
|
Q_D(QCocoaEventDispatcher);
|
||||||
|
|
||||||
if (type == QSocketNotifier::Exception) {
|
if (type == QSocketNotifier::Exception) {
|
||||||
qWarning("QSocketNotifier::Exception is not supported on Mac OS X");
|
qWarning("QSocketNotifier::Exception is not supported on Mac OS X");
|
||||||
@ -391,7 +391,7 @@ void QEventDispatcherMac::registerSocketNotifier(QSocketNotifier *notifier)
|
|||||||
removed from the runloop of this is the last notifier that users
|
removed from the runloop of this is the last notifier that users
|
||||||
that CFSocket.
|
that CFSocket.
|
||||||
*/
|
*/
|
||||||
void QEventDispatcherMac::unregisterSocketNotifier(QSocketNotifier *notifier)
|
void QCocoaEventDispatcher::unregisterSocketNotifier(QSocketNotifier *notifier)
|
||||||
{
|
{
|
||||||
Q_ASSERT(notifier);
|
Q_ASSERT(notifier);
|
||||||
int nativeSocket = notifier->socket();
|
int nativeSocket = notifier->socket();
|
||||||
@ -406,7 +406,7 @@ void QEventDispatcherMac::unregisterSocketNotifier(QSocketNotifier *notifier)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Q_D(QEventDispatcherMac);
|
Q_D(QCocoaEventDispatcher);
|
||||||
|
|
||||||
if (type == QSocketNotifier::Exception) {
|
if (type == QSocketNotifier::Exception) {
|
||||||
qWarning("QSocketNotifier::Exception is not supported on Mac OS X");
|
qWarning("QSocketNotifier::Exception is not supported on Mac OS X");
|
||||||
@ -442,7 +442,7 @@ void QEventDispatcherMac::unregisterSocketNotifier(QSocketNotifier *notifier)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QEventDispatcherMac::hasPendingEvents()
|
bool QCocoaEventDispatcher::hasPendingEvents()
|
||||||
{
|
{
|
||||||
extern uint qGlobalPostedEventsCount();
|
extern uint qGlobalPostedEventsCount();
|
||||||
extern bool qt_is_gui_used; //qapplication.cpp
|
extern bool qt_is_gui_used; //qapplication.cpp
|
||||||
@ -521,13 +521,13 @@ static inline void qt_mac_waitForMoreModalSessionEvents()
|
|||||||
[NSApp postEvent:event atStart:YES];
|
[NSApp postEvent:event atStart:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
|
bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
|
||||||
{
|
{
|
||||||
Q_D(QEventDispatcherMac);
|
Q_D(QCocoaEventDispatcher);
|
||||||
d->interrupt = false;
|
d->interrupt = false;
|
||||||
|
|
||||||
bool interruptLater = false;
|
bool interruptLater = false;
|
||||||
QtMacInterruptDispatcherHelp::cancelInterruptLater();
|
QtCocoaInterruptDispatcher::cancelInterruptLater();
|
||||||
|
|
||||||
// In case we end up recursing while we now process events, make sure
|
// In case we end up recursing while we now process events, make sure
|
||||||
// that we send remaining posted Qt events before this call returns:
|
// that we send remaining posted Qt events before this call returns:
|
||||||
@ -686,14 +686,14 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags)
|
|||||||
interrupt();
|
interrupt();
|
||||||
|
|
||||||
if (interruptLater)
|
if (interruptLater)
|
||||||
QtMacInterruptDispatcherHelp::interruptLater();
|
QtCocoaInterruptDispatcher::interruptLater();
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMac::wakeUp()
|
void QCocoaEventDispatcher::wakeUp()
|
||||||
{
|
{
|
||||||
Q_D(QEventDispatcherMac);
|
Q_D(QCocoaEventDispatcher);
|
||||||
d->serialNumber.ref();
|
d->serialNumber.ref();
|
||||||
CFRunLoopSourceSignal(d->postedEventsSource);
|
CFRunLoopSourceSignal(d->postedEventsSource);
|
||||||
CFRunLoopWakeUp(mainRunLoop());
|
CFRunLoopWakeUp(mainRunLoop());
|
||||||
@ -702,18 +702,18 @@ void QEventDispatcherMac::wakeUp()
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
QEventDispatcherMac Implementation
|
QEventDispatcherMac Implementation
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
MacTimerHash QEventDispatcherMacPrivate::macTimerHash;
|
MacTimerHash QCocoaEventDispatcherPrivate::macTimerHash;
|
||||||
bool QEventDispatcherMacPrivate::blockSendPostedEvents = false;
|
bool QCocoaEventDispatcherPrivate::blockSendPostedEvents = false;
|
||||||
bool QEventDispatcherMacPrivate::interrupt = false;
|
bool QCocoaEventDispatcherPrivate::interrupt = false;
|
||||||
|
|
||||||
|
|
||||||
QStack<QCocoaModalSessionInfo> QEventDispatcherMacPrivate::cocoaModalSessionStack;
|
QStack<QCocoaModalSessionInfo> QCocoaEventDispatcherPrivate::cocoaModalSessionStack;
|
||||||
bool QEventDispatcherMacPrivate::currentExecIsNSAppRun = false;
|
bool QCocoaEventDispatcherPrivate::currentExecIsNSAppRun = false;
|
||||||
bool QEventDispatcherMacPrivate::nsAppRunCalledByQt = false;
|
bool QCocoaEventDispatcherPrivate::nsAppRunCalledByQt = false;
|
||||||
bool QEventDispatcherMacPrivate::cleanupModalSessionsNeeded = false;
|
bool QCocoaEventDispatcherPrivate::cleanupModalSessionsNeeded = false;
|
||||||
NSModalSession QEventDispatcherMacPrivate::currentModalSessionCached = 0;
|
NSModalSession QCocoaEventDispatcherPrivate::currentModalSessionCached = 0;
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::ensureNSAppInitialized()
|
void QCocoaEventDispatcherPrivate::ensureNSAppInitialized()
|
||||||
{
|
{
|
||||||
// Some elements in Cocoa require NSApplication to be running before
|
// Some elements in Cocoa require NSApplication to be running before
|
||||||
// they get fully initialized, in particular the menu bar. This
|
// they get fully initialized, in particular the menu bar. This
|
||||||
@ -733,7 +733,7 @@ void QEventDispatcherMacPrivate::ensureNSAppInitialized()
|
|||||||
[NSApp run];
|
[NSApp run];
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::temporarilyStopAllModalSessions()
|
void QCocoaEventDispatcherPrivate::temporarilyStopAllModalSessions()
|
||||||
{
|
{
|
||||||
// Flush, and Stop, all created modal session, and as
|
// Flush, and Stop, all created modal session, and as
|
||||||
// such, make them pending again. The next call to
|
// such, make them pending again. The next call to
|
||||||
@ -755,7 +755,7 @@ void QEventDispatcherMacPrivate::temporarilyStopAllModalSessions()
|
|||||||
currentModalSessionCached = 0;
|
currentModalSessionCached = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSModalSession QEventDispatcherMacPrivate::currentModalSession()
|
NSModalSession QCocoaEventDispatcherPrivate::currentModalSession()
|
||||||
{
|
{
|
||||||
// If we have one or more modal windows, this function will create
|
// If we have one or more modal windows, this function will create
|
||||||
// a session for each of those, and return the one for the top.
|
// a session for each of those, and return the one for the top.
|
||||||
@ -816,7 +816,7 @@ static void setChildrenWorksWhenModal(QWindow *window, bool worksWhenModal)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::updateChildrenWorksWhenModal()
|
void QCocoaEventDispatcherPrivate::updateChildrenWorksWhenModal()
|
||||||
{
|
{
|
||||||
// Make the dialog children of the window
|
// Make the dialog children of the window
|
||||||
// active. And make the dialog children of
|
// active. And make the dialog children of
|
||||||
@ -833,7 +833,7 @@ void QEventDispatcherMacPrivate::updateChildrenWorksWhenModal()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::cleanupModalSessions()
|
void QCocoaEventDispatcherPrivate::cleanupModalSessions()
|
||||||
{
|
{
|
||||||
// Go through the list of modal sessions, and end those
|
// Go through the list of modal sessions, and end those
|
||||||
// that no longer has a window assosiated; no window means
|
// that no longer has a window assosiated; no window means
|
||||||
@ -867,7 +867,7 @@ void QEventDispatcherMacPrivate::cleanupModalSessions()
|
|||||||
cleanupModalSessionsNeeded = false;
|
cleanupModalSessionsNeeded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::beginModalSession(QWindow *window)
|
void QCocoaEventDispatcherPrivate::beginModalSession(QWindow *window)
|
||||||
{
|
{
|
||||||
// Add a new, empty (null), NSModalSession to the stack.
|
// Add a new, empty (null), NSModalSession to the stack.
|
||||||
// It will become active the next time QEventDispatcher::processEvents is called.
|
// It will become active the next time QEventDispatcher::processEvents is called.
|
||||||
@ -882,7 +882,7 @@ void QEventDispatcherMacPrivate::beginModalSession(QWindow *window)
|
|||||||
currentModalSessionCached = 0;
|
currentModalSessionCached = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::endModalSession(QWindow *window)
|
void QCocoaEventDispatcherPrivate::endModalSession(QWindow *window)
|
||||||
{
|
{
|
||||||
// Mark all sessions attached to window as pending to be stopped. We do this
|
// Mark all sessions attached to window as pending to be stopped. We do this
|
||||||
// by setting the window pointer to zero, but leave the session pointer.
|
// by setting the window pointer to zero, but leave the session pointer.
|
||||||
@ -899,25 +899,25 @@ void QEventDispatcherMacPrivate::endModalSession(QWindow *window)
|
|||||||
// to start spinning the correct session immidiatly:
|
// to start spinning the correct session immidiatly:
|
||||||
currentModalSessionCached = 0;
|
currentModalSessionCached = 0;
|
||||||
cleanupModalSessionsNeeded = true;
|
cleanupModalSessionsNeeded = true;
|
||||||
QEventDispatcherMac::instance()->interrupt();
|
QCocoaEventDispatcher::instance()->interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QEventDispatcherMacPrivate::QEventDispatcherMacPrivate()
|
QCocoaEventDispatcherPrivate::QCocoaEventDispatcherPrivate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QEventDispatcherMac::QEventDispatcherMac(QObject *parent)
|
QCocoaEventDispatcher::QCocoaEventDispatcher(QObject *parent)
|
||||||
: QEventDispatcherQPA(*new QEventDispatcherMacPrivate, parent)
|
: QEventDispatcherQPA(*new QCocoaEventDispatcherPrivate, parent)
|
||||||
{
|
{
|
||||||
Q_D(QEventDispatcherMac);
|
Q_D(QCocoaEventDispatcher);
|
||||||
CFRunLoopSourceContext context;
|
CFRunLoopSourceContext context;
|
||||||
bzero(&context, sizeof(CFRunLoopSourceContext));
|
bzero(&context, sizeof(CFRunLoopSourceContext));
|
||||||
context.info = d;
|
context.info = d;
|
||||||
context.equal = QEventDispatcherMacPrivate::postedEventSourceEqualCallback;
|
context.equal = QCocoaEventDispatcherPrivate::postedEventSourceEqualCallback;
|
||||||
context.perform = QEventDispatcherMacPrivate::postedEventsSourcePerformCallback;
|
context.perform = QCocoaEventDispatcherPrivate::postedEventsSourcePerformCallback;
|
||||||
d->postedEventsSource = CFRunLoopSourceCreate(0, 0, &context);
|
d->postedEventsSource = CFRunLoopSourceCreate(0, 0, &context);
|
||||||
Q_ASSERT(d->postedEventsSource);
|
Q_ASSERT(d->postedEventsSource);
|
||||||
CFRunLoopAddSource(mainRunLoop(), d->postedEventsSource, kCFRunLoopCommonModes);
|
CFRunLoopAddSource(mainRunLoop(), d->postedEventsSource, kCFRunLoopCommonModes);
|
||||||
@ -928,7 +928,7 @@ QEventDispatcherMac::QEventDispatcherMac(QObject *parent)
|
|||||||
d->waitingObserver = CFRunLoopObserverCreate(kCFAllocatorDefault,
|
d->waitingObserver = CFRunLoopObserverCreate(kCFAllocatorDefault,
|
||||||
kCFRunLoopBeforeWaiting | kCFRunLoopAfterWaiting,
|
kCFRunLoopBeforeWaiting | kCFRunLoopAfterWaiting,
|
||||||
true, 0,
|
true, 0,
|
||||||
QEventDispatcherMacPrivate::waitingObserverCallback,
|
QCocoaEventDispatcherPrivate::waitingObserverCallback,
|
||||||
&observerContext);
|
&observerContext);
|
||||||
CFRunLoopAddObserver(mainRunLoop(), d->waitingObserver, kCFRunLoopCommonModes);
|
CFRunLoopAddObserver(mainRunLoop(), d->waitingObserver, kCFRunLoopCommonModes);
|
||||||
|
|
||||||
@ -943,26 +943,26 @@ QEventDispatcherMac::QEventDispatcherMac(QObject *parent)
|
|||||||
kCFRunLoopEntry,
|
kCFRunLoopEntry,
|
||||||
/* repeats = */ false,
|
/* repeats = */ false,
|
||||||
0,
|
0,
|
||||||
QEventDispatcherMacPrivate::firstLoopEntry,
|
QCocoaEventDispatcherPrivate::firstLoopEntry,
|
||||||
&firstTimeObserverContext);
|
&firstTimeObserverContext);
|
||||||
CFRunLoopAddObserver(mainRunLoop(), d->firstTimeObserver, kCFRunLoopCommonModes);
|
CFRunLoopAddObserver(mainRunLoop(), d->firstTimeObserver, kCFRunLoopCommonModes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::waitingObserverCallback(CFRunLoopObserverRef,
|
void QCocoaEventDispatcherPrivate::waitingObserverCallback(CFRunLoopObserverRef,
|
||||||
CFRunLoopActivity activity, void *info)
|
CFRunLoopActivity activity, void *info)
|
||||||
{
|
{
|
||||||
if (activity == kCFRunLoopBeforeWaiting)
|
if (activity == kCFRunLoopBeforeWaiting)
|
||||||
emit static_cast<QEventDispatcherMac*>(info)->aboutToBlock();
|
emit static_cast<QCocoaEventDispatcher*>(info)->aboutToBlock();
|
||||||
else
|
else
|
||||||
emit static_cast<QEventDispatcherMac*>(info)->awake();
|
emit static_cast<QCocoaEventDispatcher*>(info)->awake();
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean QEventDispatcherMacPrivate::postedEventSourceEqualCallback(const void *info1, const void *info2)
|
Boolean QCocoaEventDispatcherPrivate::postedEventSourceEqualCallback(const void *info1, const void *info2)
|
||||||
{
|
{
|
||||||
return info1 == info2;
|
return info1 == info2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void processPostedEvents(QEventDispatcherMacPrivate *const d, const bool blockSendPostedEvents)
|
void processPostedEvents(QCocoaEventDispatcherPrivate *const d, const bool blockSendPostedEvents)
|
||||||
{
|
{
|
||||||
if (blockSendPostedEvents) {
|
if (blockSendPostedEvents) {
|
||||||
// We're told to not send posted events (because the event dispatcher
|
// We're told to not send posted events (because the event dispatcher
|
||||||
@ -998,7 +998,7 @@ void processPostedEvents(QEventDispatcherMacPrivate *const d, const bool blockSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::firstLoopEntry(CFRunLoopObserverRef ref,
|
void QCocoaEventDispatcherPrivate::firstLoopEntry(CFRunLoopObserverRef ref,
|
||||||
CFRunLoopActivity activity,
|
CFRunLoopActivity activity,
|
||||||
void *info)
|
void *info)
|
||||||
{
|
{
|
||||||
@ -1024,15 +1024,15 @@ void QEventDispatcherMacPrivate::firstLoopEntry(CFRunLoopObserverRef ref,
|
|||||||
forEventClass:kInternetEventClass andEventID:kAEGetURL];
|
forEventClass:kInternetEventClass andEventID:kAEGetURL];
|
||||||
*/
|
*/
|
||||||
|
|
||||||
processPostedEvents(static_cast<QEventDispatcherMacPrivate *>(info), blockSendPostedEvents);
|
processPostedEvents(static_cast<QCocoaEventDispatcherPrivate *>(info), blockSendPostedEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::postedEventsSourcePerformCallback(void *info)
|
void QCocoaEventDispatcherPrivate::postedEventsSourcePerformCallback(void *info)
|
||||||
{
|
{
|
||||||
processPostedEvents(static_cast<QEventDispatcherMacPrivate *>(info), blockSendPostedEvents);
|
processPostedEvents(static_cast<QCocoaEventDispatcherPrivate *>(info), blockSendPostedEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMacPrivate::cancelWaitForMoreEvents()
|
void QCocoaEventDispatcherPrivate::cancelWaitForMoreEvents()
|
||||||
{
|
{
|
||||||
// In case the event dispatcher is waiting for more
|
// In case the event dispatcher is waiting for more
|
||||||
// events somewhere, we post a dummy event to wake it up:
|
// events somewhere, we post a dummy event to wake it up:
|
||||||
@ -1042,9 +1042,9 @@ void QEventDispatcherMacPrivate::cancelWaitForMoreEvents()
|
|||||||
subtype:QtCocoaEventSubTypeWakeup data1:0 data2:0] atStart:NO];
|
subtype:QtCocoaEventSubTypeWakeup data1:0 data2:0] atStart:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherMac::interrupt()
|
void QCocoaEventDispatcher::interrupt()
|
||||||
{
|
{
|
||||||
Q_D(QEventDispatcherMac);
|
Q_D(QCocoaEventDispatcher);
|
||||||
d->interrupt = true;
|
d->interrupt = true;
|
||||||
wakeUp();
|
wakeUp();
|
||||||
|
|
||||||
@ -1058,12 +1058,12 @@ void QEventDispatcherMac::interrupt()
|
|||||||
d->cancelWaitForMoreEvents();
|
d->cancelWaitForMoreEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
QEventDispatcherMac::~QEventDispatcherMac()
|
QCocoaEventDispatcher::~QCocoaEventDispatcher()
|
||||||
{
|
{
|
||||||
Q_D(QEventDispatcherMac);
|
Q_D(QCocoaEventDispatcher);
|
||||||
//timer cleanup
|
//timer cleanup
|
||||||
MacTimerHash::iterator it = QEventDispatcherMacPrivate::macTimerHash.begin();
|
MacTimerHash::iterator it = QCocoaEventDispatcherPrivate::macTimerHash.begin();
|
||||||
while (it != QEventDispatcherMacPrivate::macTimerHash.end()) {
|
while (it != QCocoaEventDispatcherPrivate::macTimerHash.end()) {
|
||||||
MacTimerInfo *t = it.value();
|
MacTimerInfo *t = it.value();
|
||||||
if (t->runLoopTimer) {
|
if (t->runLoopTimer) {
|
||||||
CFRunLoopTimerInvalidate(t->runLoopTimer);
|
CFRunLoopTimerInvalidate(t->runLoopTimer);
|
||||||
@ -1072,7 +1072,7 @@ QEventDispatcherMac::~QEventDispatcherMac()
|
|||||||
delete t;
|
delete t;
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
QEventDispatcherMacPrivate::macTimerHash.clear();
|
QCocoaEventDispatcherPrivate::macTimerHash.clear();
|
||||||
|
|
||||||
// Remove CFSockets from the runloop.
|
// Remove CFSockets from the runloop.
|
||||||
for (MacSocketHash::ConstIterator it = d->macSockets.constBegin(); it != d->macSockets.constEnd(); ++it) {
|
for (MacSocketHash::ConstIterator it = d->macSockets.constBegin(); it != d->macSockets.constEnd(); ++it) {
|
||||||
@ -1095,9 +1095,9 @@ QEventDispatcherMac::~QEventDispatcherMac()
|
|||||||
CFRelease(d->firstTimeObserver);
|
CFRelease(d->firstTimeObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
QtMacInterruptDispatcherHelp* QtMacInterruptDispatcherHelp::instance = 0;
|
QtCocoaInterruptDispatcher* QtCocoaInterruptDispatcher::instance = 0;
|
||||||
|
|
||||||
QtMacInterruptDispatcherHelp::QtMacInterruptDispatcherHelp() : cancelled(false)
|
QtCocoaInterruptDispatcher::QtCocoaInterruptDispatcher() : cancelled(false)
|
||||||
{
|
{
|
||||||
// The whole point of this class is that we enable a way to interrupt
|
// The whole point of this class is that we enable a way to interrupt
|
||||||
// the event dispatcher when returning back to a lower recursion level
|
// the event dispatcher when returning back to a lower recursion level
|
||||||
@ -1108,15 +1108,15 @@ QtMacInterruptDispatcherHelp::QtMacInterruptDispatcherHelp() : cancelled(false)
|
|||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
QtMacInterruptDispatcherHelp::~QtMacInterruptDispatcherHelp()
|
QtCocoaInterruptDispatcher::~QtCocoaInterruptDispatcher()
|
||||||
{
|
{
|
||||||
if (cancelled)
|
if (cancelled)
|
||||||
return;
|
return;
|
||||||
instance = 0;
|
instance = 0;
|
||||||
QEventDispatcherMac::instance()->interrupt();
|
QCocoaEventDispatcher::instance()->interrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtMacInterruptDispatcherHelp::cancelInterruptLater()
|
void QtCocoaInterruptDispatcher::cancelInterruptLater()
|
||||||
{
|
{
|
||||||
if (!instance)
|
if (!instance)
|
||||||
return;
|
return;
|
||||||
@ -1125,10 +1125,10 @@ void QtMacInterruptDispatcherHelp::cancelInterruptLater()
|
|||||||
instance = 0;
|
instance = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtMacInterruptDispatcherHelp::interruptLater()
|
void QtCocoaInterruptDispatcher::interruptLater()
|
||||||
{
|
{
|
||||||
cancelInterruptLater();
|
cancelInterruptLater();
|
||||||
instance = new QtMacInterruptDispatcherHelp;
|
instance = new QtCocoaInterruptDispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
@ -80,6 +80,7 @@ public:
|
|||||||
QPlatformWindow *createPlatformWindow(QWindow *window) const;
|
QPlatformWindow *createPlatformWindow(QWindow *window) const;
|
||||||
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
|
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
|
||||||
QPlatformBackingStore *createPlatformBackingStore(QWindow *widget) const;
|
QPlatformBackingStore *createPlatformBackingStore(QWindow *widget) const;
|
||||||
|
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||||
|
|
||||||
QList<QPlatformScreen *> screens() const { return mScreens; }
|
QList<QPlatformScreen *> screens() const { return mScreens; }
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "qcocoabackingstore.h"
|
#include "qcocoabackingstore.h"
|
||||||
#include "qcocoanativeinterface.h"
|
#include "qcocoanativeinterface.h"
|
||||||
|
|
||||||
|
#include "qcocoaeventdispatcher.h"
|
||||||
#include <QtPlatformSupport/private/qbasicunixfontdatabase_p.h>
|
#include <QtPlatformSupport/private/qbasicunixfontdatabase_p.h>
|
||||||
#include <private/qpixmap_raster_p.h>
|
#include <private/qpixmap_raster_p.h>
|
||||||
|
|
||||||
@ -122,6 +123,11 @@ QPlatformBackingStore *QCocoaIntegration::createPlatformBackingStore(QWindow *wi
|
|||||||
return new QCocoaBackingStore(window);
|
return new QCocoaBackingStore(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QCocoaIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return new QCocoaEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformFontDatabase *QCocoaIntegration::fontDatabase() const
|
QPlatformFontDatabase *QCocoaIntegration::fontDatabase() const
|
||||||
{
|
{
|
||||||
return mFontDb;
|
return mFontDb;
|
||||||
|
@ -2,6 +2,8 @@ TARGET = qdirectfb
|
|||||||
load(qt_plugin)
|
load(qt_plugin)
|
||||||
DESTDIR = $$QT.gui.plugins/platforms
|
DESTDIR = $$QT.gui.plugins/platforms
|
||||||
|
|
||||||
|
QT += core-private gui-private platformsupport-private
|
||||||
|
|
||||||
isEmpty(DIRECTFB_LIBS) {
|
isEmpty(DIRECTFB_LIBS) {
|
||||||
DIRECTFB_LIBS = -ldirectfb -lfusion -ldirect -lpthread
|
DIRECTFB_LIBS = -ldirectfb -lfusion -ldirect -lpthread
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,8 @@
|
|||||||
#include "qdirectfbcursor.h"
|
#include "qdirectfbcursor.h"
|
||||||
#include "qdirectfbwindow.h"
|
#include "qdirectfbwindow.h"
|
||||||
|
|
||||||
#include "qgenericunixfontdatabase.h"
|
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
|
||||||
|
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
|
||||||
|
|
||||||
#include <private/qwindowsurface_raster_p.h>
|
#include <private/qwindowsurface_raster_p.h>
|
||||||
#include <private/qpixmap_raster_p.h>
|
#include <private/qpixmap_raster_p.h>
|
||||||
@ -55,6 +56,7 @@
|
|||||||
#include <QtGui/private/qpixmapdata_p.h>
|
#include <QtGui/private/qpixmapdata_p.h>
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtCore/QThread>
|
#include <QtCore/QThread>
|
||||||
|
#include <QtCore/QAbstractEventDispatcher>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -131,6 +133,11 @@ QPlatformWindow *QDirectFbIntegration::createPlatformWindow(QWidget *widget, WId
|
|||||||
return new QDirectFbWindow(widget,input);
|
return new QDirectFbWindow(widget,input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QDirectFbIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return createUnixEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
QWindowSurface *QDirectFbIntegration::createWindowSurface(QWidget *widget, WId winId) const
|
QWindowSurface *QDirectFbIntegration::createWindowSurface(QWidget *widget, WId winId) const
|
||||||
{
|
{
|
||||||
return new QDirectFbWindowSurface(widget,winId);
|
return new QDirectFbWindowSurface(widget,winId);
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QThread;
|
class QThread;
|
||||||
|
class QAbstractEventDispatcher;
|
||||||
class QDirectFBCursor;
|
class QDirectFBCursor;
|
||||||
|
|
||||||
class QDirectFbScreen : public QPlatformScreen
|
class QDirectFbScreen : public QPlatformScreen
|
||||||
@ -87,6 +88,7 @@ public:
|
|||||||
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
||||||
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const;
|
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const;
|
||||||
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
|
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
|
||||||
|
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||||
|
|
||||||
QList<QPlatformScreen *> screens() const { return mScreens; }
|
QList<QPlatformScreen *> screens() const { return mScreens; }
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ load(qt_plugin)
|
|||||||
|
|
||||||
DESTDIR = $$QT.gui.plugins/platforms
|
DESTDIR = $$QT.gui.plugins/platforms
|
||||||
|
|
||||||
|
QT += core-private gui-private platformsupport-private
|
||||||
|
|
||||||
SOURCES = main.cpp qlinuxfbintegration.cpp
|
SOURCES = main.cpp qlinuxfbintegration.cpp
|
||||||
HEADERS = qlinuxfbintegration.h
|
HEADERS = qlinuxfbintegration.h
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "qlinuxfbintegration.h"
|
#include "qlinuxfbintegration.h"
|
||||||
#include "../fb_base/fb_base.h"
|
#include "../fb_base/fb_base.h"
|
||||||
#include "qgenericunixfontdatabase.h"
|
#include "qgenericunixfontdatabase.h"
|
||||||
|
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
|
||||||
#include <QtGui/private/qpixmap_raster_p.h>
|
#include <QtGui/private/qpixmap_raster_p.h>
|
||||||
#include <private/qcore_unix_p.h> // overrides QT_OPEN
|
#include <private/qcore_unix_p.h> // overrides QT_OPEN
|
||||||
#include <qimage.h>
|
#include <qimage.h>
|
||||||
@ -810,6 +811,11 @@ QPlatformWindow *QLinuxFbIntegration::createPlatformWindow(QWidget *widget, WId
|
|||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QMinimalIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return createUnixEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformFontDatabase *QLinuxFbIntegration::fontDatabase() const
|
QPlatformFontDatabase *QLinuxFbIntegration::fontDatabase() const
|
||||||
{
|
{
|
||||||
return fontDb;
|
return fontDb;
|
||||||
|
@ -70,6 +70,7 @@ class QLinuxFbIntegrationPrivate;
|
|||||||
struct fb_cmap;
|
struct fb_cmap;
|
||||||
struct fb_var_screeninfo;
|
struct fb_var_screeninfo;
|
||||||
struct fb_fix_screeninfo;
|
struct fb_fix_screeninfo;
|
||||||
|
class QAbstractEventDispatcher;
|
||||||
|
|
||||||
class QLinuxFbIntegration : public QPlatformIntegration
|
class QLinuxFbIntegration : public QPlatformIntegration
|
||||||
{
|
{
|
||||||
@ -82,6 +83,7 @@ public:
|
|||||||
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
||||||
QPlatformWindow *createPlatformWindow(QWidget *widget, WId WinId) const;
|
QPlatformWindow *createPlatformWindow(QWidget *widget, WId WinId) const;
|
||||||
QWindowSurface *createWindowSurface(QWidget *widget, WId WinId) const;
|
QWindowSurface *createWindowSurface(QWidget *widget, WId WinId) const;
|
||||||
|
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||||
|
|
||||||
QList<QPlatformScreen *> screens() const { return mScreens; }
|
QList<QPlatformScreen *> screens() const { return mScreens; }
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
TARGET = qminimal
|
TARGET = qminimal
|
||||||
load(qt_plugin)
|
load(qt_plugin)
|
||||||
|
|
||||||
QT = core-private gui-private
|
QT += core-private gui-private platformsupport-private
|
||||||
DESTDIR = $$QT.gui.plugins/platforms
|
DESTDIR = $$QT.gui.plugins/platforms
|
||||||
|
|
||||||
SOURCES = main.cpp \
|
SOURCES = main.cpp \
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
#include "qminimalintegration.h"
|
#include "qminimalintegration.h"
|
||||||
#include "qminimalbackingstore.h"
|
#include "qminimalbackingstore.h"
|
||||||
|
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
|
||||||
|
|
||||||
#include <QtGui/private/qpixmap_raster_p.h>
|
#include <QtGui/private/qpixmap_raster_p.h>
|
||||||
#include <QtGui/QPlatformWindow>
|
#include <QtGui/QPlatformWindow>
|
||||||
@ -79,3 +80,9 @@ QPlatformBackingStore *QMinimalIntegration::createPlatformBackingStore(QWindow *
|
|||||||
{
|
{
|
||||||
return new QMinimalBackingStore(window);
|
return new QMinimalBackingStore(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QMinimalIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return createUnixEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,8 @@ public:
|
|||||||
|
|
||||||
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
||||||
QPlatformWindow *createPlatformWindow(QWindow *window) const;
|
QPlatformWindow *createPlatformWindow(QWindow *window) const;
|
||||||
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
|
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
|
||||||
|
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||||
|
|
||||||
QList<QPlatformScreen *> screens() const { return mScreens; }
|
QList<QPlatformScreen *> screens() const { return mScreens; }
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ load(qt_plugin)
|
|||||||
|
|
||||||
DESTDIR = $$QT.gui.plugins/platforms
|
DESTDIR = $$QT.gui.plugins/platforms
|
||||||
|
|
||||||
|
QT += core-private gui-private platformsupport-private
|
||||||
|
|
||||||
SOURCES = main.cpp qvfbintegration.cpp qvfbwindowsurface.cpp
|
SOURCES = main.cpp qvfbintegration.cpp qvfbwindowsurface.cpp
|
||||||
HEADERS = qvfbintegration.h qvfbwindowsurface.h
|
HEADERS = qvfbintegration.h qvfbwindowsurface.h
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
#include <QWindowSystemInterface>
|
#include <QWindowSystemInterface>
|
||||||
|
|
||||||
#include "qgenericunixfontdatabase.h"
|
#include "qgenericunixfontdatabase.h"
|
||||||
|
#include "qgenericunixeventdispatcher.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -438,6 +439,11 @@ QPlatformWindow *QVFbIntegration::createPlatformWindow(QWidget *widget, WId) con
|
|||||||
return new QVFbWindow(mPrimaryScreen, widget);
|
return new QVFbWindow(mPrimaryScreen, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QVFbIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return createUnixEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformFontDatabase *QVFbIntegration::fontDatabase() const
|
QPlatformFontDatabase *QVFbIntegration::fontDatabase() const
|
||||||
{
|
{
|
||||||
return mFontDb;
|
return mFontDb;
|
||||||
|
@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
|
|
||||||
class QVFbScreenPrivate;
|
class QVFbScreenPrivate;
|
||||||
|
class QAbstractEventDispatcher;
|
||||||
|
|
||||||
class QVFbScreen : public QPlatformScreen
|
class QVFbScreen : public QPlatformScreen
|
||||||
{
|
{
|
||||||
@ -81,6 +82,7 @@ public:
|
|||||||
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
||||||
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
|
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
|
||||||
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
|
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
|
||||||
|
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||||
|
|
||||||
QList<QPlatformScreen *> screens() const { return mScreens; }
|
QList<QPlatformScreen *> screens() const { return mScreens; }
|
||||||
|
|
||||||
|
@ -173,6 +173,10 @@ QWindowSurface *QVNCIntegration::createWindowSurface(QWidget *widget, WId) const
|
|||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QVFbIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return createUnixEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformWindow *QVNCIntegration::createPlatformWindow(QWidget *widget, WId /*winId*/) const
|
QPlatformWindow *QVNCIntegration::createPlatformWindow(QWidget *widget, WId /*winId*/) const
|
||||||
{
|
{
|
||||||
|
@ -74,7 +74,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class QVNCIntegrationPrivate;
|
class QVNCIntegrationPrivate;
|
||||||
|
class QAbstractEventDispatcher;
|
||||||
|
|
||||||
class QVNCIntegration : public QPlatformIntegration
|
class QVNCIntegration : public QPlatformIntegration
|
||||||
{
|
{
|
||||||
@ -85,6 +85,7 @@ public:
|
|||||||
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
||||||
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
|
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
|
||||||
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
|
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
|
||||||
|
QAbstractEventDispatcher createEventDispatcher() const;
|
||||||
|
|
||||||
QPixmap grabWindow(WId window, int x, int y, int width, int height) const;
|
QPixmap grabWindow(WId window, int x, int y, int width, int height) const;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
TARGET = qvncgraphicssystem
|
TARGET = qvncgraphicssystem
|
||||||
load(qt_plugin)
|
load(qt_plugin)
|
||||||
|
|
||||||
QT += network
|
QT += network core-private gui-private platformsupport-private
|
||||||
|
|
||||||
DESTDIR = $$QT.gui.plugins/platforms
|
DESTDIR = $$QT.gui.plugins/platforms
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include "qwaylandclipboard.h"
|
#include "qwaylandclipboard.h"
|
||||||
|
|
||||||
#include "QtPlatformSupport/private/qgenericunixfontdatabase_p.h"
|
#include "QtPlatformSupport/private/qgenericunixfontdatabase_p.h"
|
||||||
|
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
|
||||||
|
|
||||||
#include <QtGui/QWindowSystemInterface>
|
#include <QtGui/QWindowSystemInterface>
|
||||||
#include <QtGui/QPlatformCursor>
|
#include <QtGui/QPlatformCursor>
|
||||||
@ -122,6 +123,11 @@ QPlatformBackingStore *QWaylandIntegration::createPlatformBackingStore(QWindow *
|
|||||||
return new QWaylandShmBackingStore(window);
|
return new QWaylandShmBackingStore(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return createUnixEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
|
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
|
||||||
{
|
{
|
||||||
return mFontDb;
|
return mFontDb;
|
||||||
|
@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QWaylandBuffer;
|
class QWaylandBuffer;
|
||||||
class QWaylandDisplay;
|
class QWaylandDisplay;
|
||||||
|
class QAbstractEventDispatcher;
|
||||||
|
|
||||||
class QWaylandIntegration : public QPlatformIntegration
|
class QWaylandIntegration : public QPlatformIntegration
|
||||||
{
|
{
|
||||||
@ -59,6 +60,7 @@ public:
|
|||||||
QPlatformWindow *createPlatformWindow(QWindow *window) const;
|
QPlatformWindow *createPlatformWindow(QWindow *window) const;
|
||||||
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
|
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
|
||||||
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
|
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
|
||||||
|
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||||
|
|
||||||
QList<QPlatformScreen *> screens() const;
|
QList<QPlatformScreen *> screens() const;
|
||||||
|
|
||||||
|
@ -42,3 +42,4 @@ INSTALLS += target
|
|||||||
|
|
||||||
include ($$PWD/gl_integration/gl_integration.pri)
|
include ($$PWD/gl_integration/gl_integration.pri)
|
||||||
include ($$PWD/windowmanager_integration/windowmanager_integration.pri)
|
include ($$PWD/windowmanager_integration/windowmanager_integration.pri)
|
||||||
|
load(qpa/eventdispatchers/eventdispatchers)
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
|
|
||||||
#include <private/qpixmap_raster_p.h>
|
#include <private/qpixmap_raster_p.h>
|
||||||
|
|
||||||
|
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
|
||||||
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
|
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -136,6 +137,11 @@ QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *wind
|
|||||||
return new QXcbBackingStore(window);
|
return new QXcbBackingStore(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return createUnixEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
QList<QPlatformScreen *> QXcbIntegration::screens() const
|
QList<QPlatformScreen *> QXcbIntegration::screens() const
|
||||||
{
|
{
|
||||||
return m_screens;
|
return m_screens;
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QXcbConnection;
|
class QXcbConnection;
|
||||||
|
class QAbstractEventDispatcher;
|
||||||
|
|
||||||
class QXcbIntegration : public QPlatformIntegration
|
class QXcbIntegration : public QPlatformIntegration
|
||||||
{
|
{
|
||||||
@ -60,6 +61,7 @@ public:
|
|||||||
QPlatformWindow *createPlatformWindow(QWindow *window) const;
|
QPlatformWindow *createPlatformWindow(QWindow *window) const;
|
||||||
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
|
QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
|
||||||
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
|
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
|
||||||
|
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||||
|
|
||||||
QList<QPlatformScreen *> screens() const;
|
QList<QPlatformScreen *> screens() const;
|
||||||
void moveToScreen(QWindow *window, int screen);
|
void moveToScreen(QWindow *window, int screen);
|
||||||
|
@ -45,7 +45,8 @@
|
|||||||
#include <QtCore/qdebug.h>
|
#include <QtCore/qdebug.h>
|
||||||
|
|
||||||
#include "qxlibwindow.h"
|
#include "qxlibwindow.h"
|
||||||
#include "qgenericunixfontdatabase.h"
|
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
|
||||||
|
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
|
||||||
#include "qxlibscreen.h"
|
#include "qxlibscreen.h"
|
||||||
#include "qxlibclipboard.h"
|
#include "qxlibclipboard.h"
|
||||||
#include "qxlibdisplay.h"
|
#include "qxlibdisplay.h"
|
||||||
@ -106,7 +107,10 @@ QPlatformWindow *QXlibIntegration::createPlatformWindow(QWidget *widget, WId /*w
|
|||||||
return new QXlibWindow(widget);
|
return new QXlibWindow(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAbstractEventDispatcher *QXlibIntegration::createEventDispatcher() const
|
||||||
|
{
|
||||||
|
return createUnixEventDispatcher();
|
||||||
|
}
|
||||||
|
|
||||||
QPixmap QXlibIntegration::grabWindow(WId window, int x, int y, int width, int height) const
|
QPixmap QXlibIntegration::grabWindow(WId window, int x, int y, int width, int height) const
|
||||||
{
|
{
|
||||||
|
@ -64,6 +64,7 @@ public:
|
|||||||
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
|
||||||
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
|
QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId) const;
|
||||||
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
|
QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const;
|
||||||
|
QAbstractEventDispatcher *createEventDispatcher() const;
|
||||||
|
|
||||||
QPixmap grabWindow(WId window, int x, int y, int width, int height) const;
|
QPixmap grabWindow(WId window, int x, int y, int width, int height) const;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ TARGET = qxlib
|
|||||||
load(qpa/plugin)
|
load(qpa/plugin)
|
||||||
DESTDIR = $$QT.gui.plugins/platforms
|
DESTDIR = $$QT.gui.plugins/platforms
|
||||||
|
|
||||||
QT += core-private gui-private opengl-private
|
QT += core-private gui-private opengl-private platformsupport-private
|
||||||
|
|
||||||
SOURCES = \
|
SOURCES = \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
@ -42,10 +42,6 @@
|
|||||||
#include "qapplication_p.h"
|
#include "qapplication_p.h"
|
||||||
#include "qcolormap.h"
|
#include "qcolormap.h"
|
||||||
#include "qpixmapcache.h"
|
#include "qpixmapcache.h"
|
||||||
#if !defined(QT_NO_GLIB)
|
|
||||||
#include "private/qeventdispatcher_glib_qpa_p.h"
|
|
||||||
#endif
|
|
||||||
#include "private/qeventdispatcher_qpa_p.h"
|
|
||||||
#ifndef QT_NO_CURSOR
|
#ifndef QT_NO_CURSOR
|
||||||
#include "private/qcursor_p.h"
|
#include "private/qcursor_p.h"
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user