Remove specific maemo/meego codepaths
We no longer support the maemo/meego platform, so we can remove the specific code for that platform. Change-Id: Ia7f0730eba2d96794b97b7ca4753f63a2d7bc2a8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
parent
54ca39afec
commit
28fe4e3a86
4
configure
vendored
4
configure
vendored
@ -711,7 +711,6 @@ XPLATFORM_MAC=no
|
|||||||
XPLATFORM_IOS=no
|
XPLATFORM_IOS=no
|
||||||
XPLATFORM_ANDROID=no
|
XPLATFORM_ANDROID=no
|
||||||
XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
|
XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
|
||||||
XPLATFORM_MAEMO=no
|
|
||||||
XPLATFORM_QNX=no
|
XPLATFORM_QNX=no
|
||||||
PLATFORM=$QMAKESPEC
|
PLATFORM=$QMAKESPEC
|
||||||
QT_CROSS_COMPILE=no
|
QT_CROSS_COMPILE=no
|
||||||
@ -2755,9 +2754,6 @@ case "$XPLATFORM" in
|
|||||||
*win32-g++*)
|
*win32-g++*)
|
||||||
XPLATFORM_MINGW=yes
|
XPLATFORM_MINGW=yes
|
||||||
;;
|
;;
|
||||||
*-maemo*)
|
|
||||||
XPLATFORM_MAEMO=yes
|
|
||||||
;;
|
|
||||||
*qnx-*|*blackberry-*)
|
*qnx-*|*blackberry-*)
|
||||||
XPLATFORM_QNX=yes
|
XPLATFORM_QNX=yes
|
||||||
;;
|
;;
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
#
|
|
||||||
# qmake configuration for building Qt5 for the Nokia N9
|
|
||||||
# http://wiki.qt-project.org/Devices/N9
|
|
||||||
|
|
||||||
MAKEFILE_GENERATOR = UNIX
|
|
||||||
CONFIG += incremental
|
|
||||||
QMAKE_INCREMENTAL_STYLE = sublib
|
|
||||||
|
|
||||||
QMAKE_PLATFORM = maemo
|
|
||||||
|
|
||||||
include(../../common/linux.conf)
|
|
||||||
include(../../common/gcc-base-unix.conf)
|
|
||||||
include(../../common/g++-unix.conf)
|
|
||||||
|
|
||||||
load(device_config)
|
|
||||||
|
|
||||||
# modifications to g++.conf
|
|
||||||
QMAKE_CC = $${CROSS_COMPILE}gcc
|
|
||||||
QMAKE_CXX = $${CROSS_COMPILE}g++
|
|
||||||
QMAKE_LINK = $${QMAKE_CXX}
|
|
||||||
QMAKE_LINK_SHLIB = $${QMAKE_CXX}
|
|
||||||
|
|
||||||
# modifications to linux.conf
|
|
||||||
QMAKE_AR = $${CROSS_COMPILE}ar cqs
|
|
||||||
QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
|
|
||||||
QMAKE_NM = $${CROSS_COMPILE}nm -P
|
|
||||||
QMAKE_STRIP = $${CROSS_COMPILE}strip
|
|
||||||
|
|
||||||
QMAKE_CFLAGS += -mfloat-abi=hard -mfpu=neon -march=armv7-a -mcpu=cortex-a8
|
|
||||||
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS
|
|
||||||
|
|
||||||
QT_QPA_DEFAULT_PLATFORM = xcb
|
|
||||||
|
|
||||||
deviceSanityCheckCompiler()
|
|
||||||
|
|
||||||
load(qt_config)
|
|
@ -1,42 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the qmake spec of the Qt 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 Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia 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.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "../../linux-g++/qplatformdefs.h"
|
|
@ -1,12 +0,0 @@
|
|||||||
#
|
|
||||||
# qmake configuration for Harmattan
|
|
||||||
#
|
|
||||||
|
|
||||||
MAKEFILE_GENERATOR = UNIX
|
|
||||||
QMAKE_PLATFORM = maemo
|
|
||||||
CONFIG += incremental
|
|
||||||
CONFIG += nostrip
|
|
||||||
QMAKE_INCREMENTAL_STYLE = sublib
|
|
||||||
|
|
||||||
include(../linux-arm-gnueabi-g++/qmake.conf)
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the qmake spec of the Qt 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 Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia 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.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "../linux-arm-gnueabi-g++/qplatformdefs.h"
|
|
||||||
|
|
||||||
#define QT_GUI_DOUBLE_CLICK_RADIUS 20
|
|
||||||
#define QT_GUI_DRAG_DISTANCE 16
|
|
||||||
|
|
||||||
#define QML_FLICK_OVERSHOOT 160
|
|
||||||
#define QML_FLICK_SAMPLEBUFFER 6
|
|
||||||
#define QML_FLICK_DISCARDSAMPLES 2
|
|
||||||
#define QML_FLICK_DEFAULTMAXVELOCITY 2500
|
|
||||||
#define QML_FLICK_DEFAULTDECELERATION 2000
|
|
||||||
#define QML_FLICK_OVERSHOOTFRICTION 10
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
*-maemo*: SUBDIRS += meego
|
|
||||||
|
|
||||||
contains(QT_CONFIG, evdev) {
|
contains(QT_CONFIG, evdev) {
|
||||||
SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet
|
SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet
|
||||||
}
|
}
|
||||||
|
@ -1,85 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt 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 Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia 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.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "contextkitproperty.h"
|
|
||||||
|
|
||||||
#include <QDBusReply>
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
static QString objectPathForProperty(const QString& property)
|
|
||||||
{
|
|
||||||
QString path = property;
|
|
||||||
if (!path.startsWith(QLatin1Char('/'))) {
|
|
||||||
path.replace(QLatin1Char('.'), QLatin1Char('/'));
|
|
||||||
path.prepend(QLatin1String("/org/maemo/contextkit/"));
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
QContextKitProperty::QContextKitProperty(const QString& serviceName, const QString& propertyName)
|
|
||||||
: propertyInterface(serviceName, objectPathForProperty(propertyName),
|
|
||||||
QLatin1String("org.maemo.contextkit.Property"), QDBusConnection::systemBus())
|
|
||||||
{
|
|
||||||
propertyInterface.call("Subscribe");
|
|
||||||
connect(&propertyInterface, SIGNAL(ValueChanged(QVariantList,qulonglong)),
|
|
||||||
this, SLOT(cacheValue(QVariantList,qulonglong)));
|
|
||||||
|
|
||||||
QDBusMessage reply = propertyInterface.call("Get");
|
|
||||||
if (reply.type() == QDBusMessage::ReplyMessage)
|
|
||||||
cachedValue = qdbus_cast<QList<QVariant> >(reply.arguments().value(0)).value(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
QContextKitProperty::~QContextKitProperty()
|
|
||||||
{
|
|
||||||
propertyInterface.call("Unsubscribe");
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant QContextKitProperty::value() const
|
|
||||||
{
|
|
||||||
return cachedValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QContextKitProperty::cacheValue(const QVariantList& values, qulonglong)
|
|
||||||
{
|
|
||||||
cachedValue = values.value(0);
|
|
||||||
emit valueChanged(cachedValue);
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt 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 Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia 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.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
#ifndef CONTEXTKITPROPERTY_H
|
|
||||||
#define CONTEXTKITPROPERTY_H
|
|
||||||
|
|
||||||
#include <QDBusInterface>
|
|
||||||
|
|
||||||
class QContextKitProperty : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
QContextKitProperty(const QString& serviceName, const QString& propertyName);
|
|
||||||
~QContextKitProperty();
|
|
||||||
|
|
||||||
QVariant value() const;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void valueChanged(const QVariant& value);
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void cacheValue(const QVariantList& values, qulonglong);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QDBusInterface propertyInterface;
|
|
||||||
QVariant cachedValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CONTEXTKITPROPERTY_H
|
|
@ -1,68 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt 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 Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia 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.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include <QtGui/qgenericplugin.h>
|
|
||||||
#include "qmeegointegration.h"
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
class QMeeGoIntegrationPlugin : public QGenericPlugin
|
|
||||||
{
|
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QGenericPluginFactoryInterface" FILE "meego.json")
|
|
||||||
public:
|
|
||||||
QMeeGoIntegrationPlugin();
|
|
||||||
|
|
||||||
QObject* create(const QString &key, const QString &specification);
|
|
||||||
};
|
|
||||||
|
|
||||||
QMeeGoIntegrationPlugin::QMeeGoIntegrationPlugin()
|
|
||||||
: QGenericPlugin()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QObject* QMeeGoIntegrationPlugin::create(const QString &key, const QString &specification)
|
|
||||||
{
|
|
||||||
if (!key.compare(QLatin1String("MeeGoIntegration"), Qt::CaseInsensitive))
|
|
||||||
return new QMeeGoIntegration();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"Keys": [ "MeeGoIntegration" ]
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
TARGET = qmeegointegration
|
|
||||||
|
|
||||||
PLUGIN_TYPE = generic
|
|
||||||
PLUGIN_EXTENDS = -
|
|
||||||
PLUGIN_CLASS_NAME = QMeeGoIntegrationPlugin
|
|
||||||
load(qt_plugin)
|
|
||||||
|
|
||||||
SOURCES = qmeegointegration.cpp \
|
|
||||||
main.cpp \
|
|
||||||
contextkitproperty.cpp
|
|
||||||
HEADERS = qmeegointegration.h \
|
|
||||||
contextkitproperty.h
|
|
||||||
|
|
||||||
QT = core-private gui-private dbus gui-private
|
|
@ -1,81 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt 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 Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia 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.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "qmeegointegration.h"
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QDBusConnection>
|
|
||||||
#include <QDBusArgument>
|
|
||||||
#include <qguiapplication.h>
|
|
||||||
#include <qpa/qwindowsysteminterface.h>
|
|
||||||
|
|
||||||
QMeeGoIntegration::QMeeGoIntegration()
|
|
||||||
: screenTopEdge(QStringLiteral("com.nokia.SensorService"), QStringLiteral("Screen.TopEdge"))
|
|
||||||
{
|
|
||||||
connect(&screenTopEdge, SIGNAL(valueChanged(QVariant)),
|
|
||||||
this, SLOT(updateScreenOrientation(QVariant)));
|
|
||||||
updateScreenOrientation(screenTopEdge.value());
|
|
||||||
}
|
|
||||||
|
|
||||||
QMeeGoIntegration::~QMeeGoIntegration()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMeeGoIntegration::updateScreenOrientation(const QVariant& topEdgeValue)
|
|
||||||
{
|
|
||||||
QString edge = topEdgeValue.toString();
|
|
||||||
Qt::ScreenOrientation orientation = Qt::PrimaryOrientation;
|
|
||||||
|
|
||||||
// ### FIXME: This isn't perfect. We should obey the video_route (tv connected) and
|
|
||||||
// the keyboard slider.
|
|
||||||
|
|
||||||
if (edge == QLatin1String("top"))
|
|
||||||
orientation = Qt::LandscapeOrientation;
|
|
||||||
else if (edge == QLatin1String("left"))
|
|
||||||
orientation = Qt::PortraitOrientation;
|
|
||||||
else if (edge == QLatin1String("right"))
|
|
||||||
orientation = Qt::InvertedPortraitOrientation;
|
|
||||||
else if (edge == QLatin1String("bottom"))
|
|
||||||
orientation = Qt::InvertedLandscapeOrientation;
|
|
||||||
|
|
||||||
QWindowSystemInterface::handleScreenOrientationChange(QGuiApplication::primaryScreen(), orientation);
|
|
||||||
}
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt 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 Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia 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.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef QMEEGOINTEGRATION_H
|
|
||||||
#define QMEEGOINTEGRATION_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QDBusInterface>
|
|
||||||
|
|
||||||
#include "contextkitproperty.h"
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
class QMeeGoIntegration : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
QMeeGoIntegration();
|
|
||||||
~QMeeGoIntegration();
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
|
||||||
void updateScreenOrientation(const QVariant& topEdgeValue);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QContextKitProperty screenTopEdge;
|
|
||||||
};
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QMEEGOINTEGRATION_H
|
|
@ -73,7 +73,7 @@
|
|||||||
#include <X11/Xlibint.h>
|
#include <X11/Xlibint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
|
#if defined(XCB_USE_XINPUT2)
|
||||||
#include <X11/extensions/XInput2.h>
|
#include <X11/extensions/XInput2.h>
|
||||||
#include <X11/extensions/XI2proto.h>
|
#include <X11/extensions/XI2proto.h>
|
||||||
#endif
|
#endif
|
||||||
@ -314,9 +314,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
|
|||||||
, m_primaryScreen(0)
|
, m_primaryScreen(0)
|
||||||
, m_displayName(displayName ? QByteArray(displayName) : qgetenv("DISPLAY"))
|
, m_displayName(displayName ? QByteArray(displayName) : qgetenv("DISPLAY"))
|
||||||
, m_nativeInterface(nativeInterface)
|
, m_nativeInterface(nativeInterface)
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
|
||||||
, m_xinputData(0)
|
|
||||||
#endif
|
|
||||||
, xfixes_first_event(0)
|
, xfixes_first_event(0)
|
||||||
, xrandr_first_event(0)
|
, xrandr_first_event(0)
|
||||||
, xkb_first_event(0)
|
, xkb_first_event(0)
|
||||||
@ -396,9 +393,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
|
|||||||
initializeXFixes();
|
initializeXFixes();
|
||||||
initializeXRender();
|
initializeXRender();
|
||||||
m_xi2Enabled = false;
|
m_xi2Enabled = false;
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
#if defined(XCB_USE_XINPUT2)
|
||||||
initializeXInput2Maemo();
|
|
||||||
#elif defined(XCB_USE_XINPUT2)
|
|
||||||
initializeXInput2();
|
initializeXInput2();
|
||||||
#endif
|
#endif
|
||||||
initializeXShape();
|
initializeXShape();
|
||||||
@ -429,9 +424,7 @@ QXcbConnection::~QXcbConnection()
|
|||||||
delete m_drag;
|
delete m_drag;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
#if defined(XCB_USE_XINPUT2)
|
||||||
finalizeXInput2Maemo();
|
|
||||||
#elif defined(XCB_USE_XINPUT2)
|
|
||||||
finalizeXInput2();
|
finalizeXInput2();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -935,11 +928,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
|
|||||||
case XCB_PROPERTY_NOTIFY:
|
case XCB_PROPERTY_NOTIFY:
|
||||||
HANDLE_PLATFORM_WINDOW_EVENT(xcb_property_notify_event_t, window, handlePropertyNotifyEvent);
|
HANDLE_PLATFORM_WINDOW_EVENT(xcb_property_notify_event_t, window, handlePropertyNotifyEvent);
|
||||||
break;
|
break;
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
#if defined(XCB_USE_XINPUT2)
|
||||||
case GenericEvent:
|
|
||||||
handleGenericEventMaemo((xcb_ge_event_t*)event);
|
|
||||||
break;
|
|
||||||
#elif defined(XCB_USE_XINPUT2)
|
|
||||||
case GenericEvent:
|
case GenericEvent:
|
||||||
if (m_xi2Enabled)
|
if (m_xi2Enabled)
|
||||||
xi2HandleEvent(reinterpret_cast<xcb_ge_event_t *>(event));
|
xi2HandleEvent(reinterpret_cast<xcb_ge_event_t *>(event));
|
||||||
@ -1543,9 +1532,6 @@ static const char * xcb_atomnames = {
|
|||||||
"Rel Vert Wheel\0"
|
"Rel Vert Wheel\0"
|
||||||
"Rel Horiz Scroll\0"
|
"Rel Horiz Scroll\0"
|
||||||
"Rel Vert Scroll\0"
|
"Rel Vert Scroll\0"
|
||||||
#if XCB_USE_MAEMO_WINDOW_PROPERTIES
|
|
||||||
"_MEEGOTOUCH_ORIENTATION_ANGLE\0"
|
|
||||||
#endif
|
|
||||||
"_XSETTINGS_SETTINGS\0"
|
"_XSETTINGS_SETTINGS\0"
|
||||||
"_COMPIZ_DECOR_PENDING\0"
|
"_COMPIZ_DECOR_PENDING\0"
|
||||||
"_COMPIZ_DECOR_REQUEST\0"
|
"_COMPIZ_DECOR_REQUEST\0"
|
||||||
@ -1828,7 +1814,7 @@ bool QXcbConnection::hasEgl() const
|
|||||||
}
|
}
|
||||||
#endif // defined(XCB_USE_EGL)
|
#endif // defined(XCB_USE_EGL)
|
||||||
|
|
||||||
#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
|
#if defined(XCB_USE_XINPUT2)
|
||||||
static int xi2ValuatorOffset(unsigned char *maskPtr, int maskLen, int number)
|
static int xi2ValuatorOffset(unsigned char *maskPtr, int maskLen, int number)
|
||||||
{
|
{
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
@ -1893,7 +1879,7 @@ bool QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *ev, int opCo
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif // defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
|
#endif // defined(XCB_USE_XINPUT2)
|
||||||
|
|
||||||
QXcbSystemTrayTracker *QXcbConnection::systemTrayTracker()
|
QXcbSystemTrayTracker *QXcbConnection::systemTrayTracker()
|
||||||
{
|
{
|
||||||
|
@ -65,9 +65,7 @@
|
|||||||
#include <QTabletEvent>
|
#include <QTabletEvent>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
#if XCB_USE_XINPUT2
|
||||||
struct XInput2MaemoData;
|
|
||||||
#elif XCB_USE_XINPUT2
|
|
||||||
#include <X11/extensions/XI2.h>
|
#include <X11/extensions/XI2.h>
|
||||||
#ifdef XIScrollClass
|
#ifdef XIScrollClass
|
||||||
#define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support
|
#define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support
|
||||||
@ -279,9 +277,6 @@ namespace QXcbAtom {
|
|||||||
RelHorizScroll,
|
RelHorizScroll,
|
||||||
RelVertScroll,
|
RelVertScroll,
|
||||||
|
|
||||||
#if XCB_USE_MAEMO_WINDOW_PROPERTIES
|
|
||||||
MeegoTouchOrientationAngle,
|
|
||||||
#endif
|
|
||||||
_XSETTINGS_SETTINGS,
|
_XSETTINGS_SETTINGS,
|
||||||
|
|
||||||
_COMPIZ_DECOR_PENDING,
|
_COMPIZ_DECOR_PENDING,
|
||||||
@ -411,9 +406,7 @@ public:
|
|||||||
#if defined(XCB_USE_EGL)
|
#if defined(XCB_USE_EGL)
|
||||||
void *egl_display() const { return m_egl_display; }
|
void *egl_display() const { return m_egl_display; }
|
||||||
#endif
|
#endif
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
#if defined(XCB_USE_XINPUT2)
|
||||||
bool isUsingXInput2Maemo();
|
|
||||||
#elif defined(XCB_USE_XINPUT2)
|
|
||||||
void xi2Select(xcb_window_t window);
|
void xi2Select(xcb_window_t window);
|
||||||
#endif
|
#endif
|
||||||
#ifdef XCB_USE_XINPUT21
|
#ifdef XCB_USE_XINPUT21
|
||||||
@ -498,11 +491,6 @@ private:
|
|||||||
void initializeXRandr();
|
void initializeXRandr();
|
||||||
void initializeXShape();
|
void initializeXShape();
|
||||||
void initializeXKB();
|
void initializeXKB();
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
|
||||||
void initializeXInput2Maemo();
|
|
||||||
void finalizeXInput2Maemo();
|
|
||||||
void handleGenericEventMaemo(xcb_ge_event_t *event);
|
|
||||||
#endif
|
|
||||||
void handleClientMessageEvent(const xcb_client_message_event_t *event);
|
void handleClientMessageEvent(const xcb_client_message_event_t *event);
|
||||||
QXcbScreen* findOrCreateScreen(QList<QXcbScreen *>& newScreens, int screenNumber,
|
QXcbScreen* findOrCreateScreen(QList<QXcbScreen *>& newScreens, int screenNumber,
|
||||||
xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL);
|
xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL);
|
||||||
@ -556,7 +544,7 @@ private:
|
|||||||
QHash<int, ScrollingDevice> m_scrollingDevices;
|
QHash<int, ScrollingDevice> m_scrollingDevices;
|
||||||
#endif // XCB_USE_XINPUT2
|
#endif // XCB_USE_XINPUT2
|
||||||
|
|
||||||
#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
|
#if defined(XCB_USE_XINPUT2)
|
||||||
static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value);
|
static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value);
|
||||||
static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode);
|
static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode);
|
||||||
#endif
|
#endif
|
||||||
@ -589,9 +577,7 @@ private:
|
|||||||
void *m_xlib_display;
|
void *m_xlib_display;
|
||||||
#endif
|
#endif
|
||||||
QXcbEventReader *m_reader;
|
QXcbEventReader *m_reader;
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
#if defined(XCB_USE_XINPUT2)
|
||||||
XInput2MaemoData *m_xinputData;
|
|
||||||
#elif defined(XCB_USE_XINPUT2)
|
|
||||||
QHash<int, QWindowSystemInterface::TouchPoint> m_touchPoints;
|
QHash<int, QWindowSystemInterface::TouchPoint> m_touchPoints;
|
||||||
QHash<int, XInput2DeviceData*> m_touchDevices;
|
QHash<int, XInput2DeviceData*> m_touchDevices;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,268 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt 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 Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia 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.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "qxcbconnection.h"
|
|
||||||
|
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
|
||||||
|
|
||||||
#include "qxcbwindow.h"
|
|
||||||
#include <qpa/qwindowsysteminterface.h>
|
|
||||||
#include <X11/extensions/XInput2.h>
|
|
||||||
#include <X11/extensions/XI2proto.h>
|
|
||||||
#include <X11/Xatom.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
// Define it here to work around XLib defining Bool and stuff.
|
|
||||||
// We can't declare those variables in the header without facing include order headaches.
|
|
||||||
struct XInput2MaemoData {
|
|
||||||
XInput2MaemoData()
|
|
||||||
: use_xinput(false)
|
|
||||||
, xinput_opcode(0)
|
|
||||||
, xinput_eventbase(0)
|
|
||||||
, xinput_errorbase(0)
|
|
||||||
, xideviceinfo(0)
|
|
||||||
, xibuttonclassinfo(0)
|
|
||||||
, xiMaxContacts(0)
|
|
||||||
, qtTouchDevice(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
// true if Qt is compiled w/ XInput2 or Tablet support and we have a tablet.
|
|
||||||
bool use_xinput;
|
|
||||||
int xinput_opcode;
|
|
||||||
int xinput_eventbase;
|
|
||||||
int xinput_errorbase;
|
|
||||||
// device info for the master pointer Qt is using
|
|
||||||
XIDeviceInfo *xideviceinfo;
|
|
||||||
XIButtonClassInfo *xibuttonclassinfo;
|
|
||||||
int xiMaxContacts;
|
|
||||||
QList<QWindowSystemInterface::TouchPoint> allTouchPoints;
|
|
||||||
QTouchDevice *qtTouchDevice;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool QXcbConnection::isUsingXInput2Maemo()
|
|
||||||
{
|
|
||||||
return m_xinputData && m_xinputData->use_xinput && m_xinputData->xiMaxContacts != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbConnection::initializeXInput2Maemo()
|
|
||||||
{
|
|
||||||
Q_ASSERT(!m_xinputData);
|
|
||||||
m_xinputData = new XInput2MaemoData;
|
|
||||||
m_xinputData->use_xinput = XQueryExtension((Display *)m_xlib_display, "XInputExtension", &m_xinputData->xinput_opcode,
|
|
||||||
&m_xinputData->xinput_eventbase, &m_xinputData->xinput_errorbase);
|
|
||||||
if (m_xinputData->use_xinput) {
|
|
||||||
// we want XInput2
|
|
||||||
int ximajor = 2, ximinor = 0;
|
|
||||||
if (XIQueryVersion((Display *)m_xlib_display, &ximajor, &ximinor) == BadRequest) {
|
|
||||||
// XInput2 not available
|
|
||||||
m_xinputData->use_xinput = false;
|
|
||||||
} else {
|
|
||||||
// find the first master pointer and use this throughout Qt
|
|
||||||
// when making XI2 calls that need a device id (rationale is that
|
|
||||||
// for the time being, most setups will only have one master
|
|
||||||
// pointer (despite having multiple slaves)
|
|
||||||
int deviceCount = 0;
|
|
||||||
XIDeviceInfo *devices = XIQueryDevice((Display *)m_xlib_display, XIAllMasterDevices, &deviceCount);
|
|
||||||
if (devices) {
|
|
||||||
for (int i = 0; i < deviceCount; ++i) {
|
|
||||||
if (devices[i].use == XIMasterPointer) {
|
|
||||||
int unused = 0;
|
|
||||||
m_xinputData->xideviceinfo = XIQueryDevice((Display *)m_xlib_display, devices[i].deviceid, &unused);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
XIFreeDeviceInfo(devices);
|
|
||||||
}
|
|
||||||
if (!m_xinputData->xideviceinfo)
|
|
||||||
qFatal("Qt: Internal error, no XI2 master pointer found.");
|
|
||||||
|
|
||||||
// find the button info
|
|
||||||
m_xinputData->xibuttonclassinfo = 0;
|
|
||||||
for (int i = 0; i < m_xinputData->xideviceinfo->num_classes; ++i) {
|
|
||||||
if (m_xinputData->xideviceinfo->classes[i]->type == XIButtonClass) {
|
|
||||||
m_xinputData->xibuttonclassinfo = (XIButtonClassInfo *) m_xinputData->xideviceinfo->classes[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// find the "Max Contacts" property on the device
|
|
||||||
Atom typeReturn;
|
|
||||||
int formatReturn;
|
|
||||||
ulong countReturn, bytesReturn;
|
|
||||||
uchar *data = 0;
|
|
||||||
if (XIGetProperty((Display *)m_xlib_display,
|
|
||||||
m_xinputData->xibuttonclassinfo->sourceid,
|
|
||||||
atom(QXcbAtom::MaxContacts),
|
|
||||||
0, 1,
|
|
||||||
False,
|
|
||||||
XA_INTEGER,
|
|
||||||
&typeReturn,
|
|
||||||
&formatReturn,
|
|
||||||
&countReturn,
|
|
||||||
&bytesReturn,
|
|
||||||
&data) == Success
|
|
||||||
&& data != 0
|
|
||||||
&& typeReturn == XA_INTEGER
|
|
||||||
&& formatReturn == 8
|
|
||||||
&& countReturn == 1) {
|
|
||||||
// touch driver reported the max number of touch-points
|
|
||||||
m_xinputData->xiMaxContacts = data[0];
|
|
||||||
} else {
|
|
||||||
m_xinputData->xiMaxContacts = 0;
|
|
||||||
}
|
|
||||||
if (data)
|
|
||||||
XFree(data);
|
|
||||||
XFlush((Display *)m_xlib_display);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbConnection::finalizeXInput2Maemo()
|
|
||||||
{
|
|
||||||
if (m_xinputData && m_xinputData->xideviceinfo) {
|
|
||||||
XIFreeDeviceInfo(m_xinputData->xideviceinfo);
|
|
||||||
}
|
|
||||||
delete m_xinputData;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbConnection::handleGenericEventMaemo(xcb_ge_event_t *event)
|
|
||||||
{
|
|
||||||
if (m_xinputData->use_xinput && xi2PrepareXIGenericDeviceEvent(event, m_xinputData->xinput_opcode)) {
|
|
||||||
xXIGenericDeviceEvent* xievent = (xXIGenericDeviceEvent*)event;
|
|
||||||
|
|
||||||
// On Harmattan XInput2 is hacked to give touch points updates into standard mouse button press/motion events.
|
|
||||||
if (m_xinputData->xiMaxContacts != 0
|
|
||||||
&& (xievent->evtype == XI_ButtonPress
|
|
||||||
|| xievent->evtype == XI_ButtonRelease
|
|
||||||
|| xievent->evtype == XI_Motion)) {
|
|
||||||
xXIDeviceEvent *xideviceevent = (xXIDeviceEvent *)xievent;
|
|
||||||
QList<QWindowSystemInterface::TouchPoint> touchPoints = m_xinputData->allTouchPoints;
|
|
||||||
if (touchPoints.count() != m_xinputData->xiMaxContacts) {
|
|
||||||
// initial event, allocate space for all (potential) touch points
|
|
||||||
touchPoints.reserve(m_xinputData->xiMaxContacts);
|
|
||||||
for (int i = 0; i < m_xinputData->xiMaxContacts; ++i) {
|
|
||||||
QWindowSystemInterface::TouchPoint tp;
|
|
||||||
tp.id = i;
|
|
||||||
tp.state = Qt::TouchPointReleased;
|
|
||||||
touchPoints << tp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qreal x, y, nx, ny, w = 0.0, h = 0.0, p = -1.0;
|
|
||||||
int id;
|
|
||||||
uint active = 0;
|
|
||||||
for (int i = 0; i < m_xinputData->xideviceinfo->num_classes; ++i) {
|
|
||||||
XIAnyClassInfo *classinfo = m_xinputData->xideviceinfo->classes[i];
|
|
||||||
if (classinfo->type == XIValuatorClass) {
|
|
||||||
XIValuatorClassInfo *valuatorclassinfo = reinterpret_cast<XIValuatorClassInfo *>(classinfo);
|
|
||||||
int n = valuatorclassinfo->number;
|
|
||||||
double value;
|
|
||||||
if (!xi2GetValuatorValueIfSet(xideviceevent, n, &value))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (valuatorclassinfo->label == atom(QXcbAtom::AbsMTPositionX)) {
|
|
||||||
x = value;
|
|
||||||
nx = (x - valuatorclassinfo->min) / (valuatorclassinfo->max - valuatorclassinfo->min);
|
|
||||||
} else if (valuatorclassinfo->label == atom(QXcbAtom::AbsMTPositionY)) {
|
|
||||||
y = value;
|
|
||||||
ny = (y - valuatorclassinfo->min) / (valuatorclassinfo->max - valuatorclassinfo->min);
|
|
||||||
} else if (valuatorclassinfo->label == atom(QXcbAtom::AbsMTTouchMajor)) {
|
|
||||||
w = value;
|
|
||||||
} else if (valuatorclassinfo->label == atom(QXcbAtom::AbsMTTouchMinor)) {
|
|
||||||
h = value;
|
|
||||||
} else if (valuatorclassinfo->label == atom(QXcbAtom::AbsMTPressure)) {
|
|
||||||
p = (value - valuatorclassinfo->min) / (valuatorclassinfo->max - valuatorclassinfo->min);
|
|
||||||
} else if (valuatorclassinfo->label == atom(QXcbAtom::AbsMTTrackingID)) {
|
|
||||||
id = value;
|
|
||||||
active |= 1 << id;
|
|
||||||
QWindowSystemInterface::TouchPoint &touchPoint = touchPoints[id];
|
|
||||||
|
|
||||||
Qt::TouchPointState newstate;
|
|
||||||
if (touchPoint.state == Qt::TouchPointReleased) {
|
|
||||||
newstate = Qt::TouchPointPressed;
|
|
||||||
} else {
|
|
||||||
if (touchPoint.area.center() != QPoint(x, y))
|
|
||||||
newstate = Qt::TouchPointMoved;
|
|
||||||
else
|
|
||||||
newstate = Qt::TouchPointStationary;
|
|
||||||
}
|
|
||||||
|
|
||||||
touchPoint.state = newstate;
|
|
||||||
touchPoint.area = QRectF(x - w/2, y - h/2, w, h);
|
|
||||||
touchPoint.normalPosition = QPointF(nx, ny);
|
|
||||||
touchPoint.pressure = p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// mark previously-active-but-now-inactive touch points as released
|
|
||||||
for (int i = 0; i < touchPoints.count(); ++i)
|
|
||||||
if (!(active & (1 << i)) && touchPoints.at(i).state != Qt::TouchPointReleased)
|
|
||||||
touchPoints[i].state = Qt::TouchPointReleased;
|
|
||||||
|
|
||||||
if (QXcbWindow *platformWindow = platformWindowFromId(xideviceevent->event)) {
|
|
||||||
QTouchDevice *dev = m_xinputData->qtTouchDevice;
|
|
||||||
if (!dev) {
|
|
||||||
dev = new QTouchDevice;
|
|
||||||
dev->setType(QTouchDevice::TouchScreen);
|
|
||||||
dev->setCapabilities(QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::Pressure | QTouchDevice::NormalizedPosition);
|
|
||||||
QWindowSystemInterface::registerTouchDevice(dev);
|
|
||||||
m_xinputData->qtTouchDevice = dev;
|
|
||||||
}
|
|
||||||
QWindowSystemInterface::handleTouchEvent(platformWindow->window(), xideviceevent->time, dev, touchPoints);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xideviceevent->evtype == XI_ButtonRelease) {
|
|
||||||
// final event, forget touch state
|
|
||||||
m_xinputData->allTouchPoints.clear();
|
|
||||||
} else {
|
|
||||||
// save current state so that we have something to reuse later
|
|
||||||
m_xinputData->allTouchPoints = touchPoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // XCB_USE_XINPUT2_MAEMO
|
|
||||||
|
|
@ -101,7 +101,7 @@
|
|||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(XCB_USE_XINPUT2_MAEMO) || defined(XCB_USE_XINPUT2)
|
#if defined(XCB_USE_XINPUT2)
|
||||||
#include <X11/extensions/XInput2.h>
|
#include <X11/extensions/XInput2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -492,22 +492,7 @@ void QXcbWindow::create()
|
|||||||
32, 2, (void *)data));
|
32, 2, (void *)data));
|
||||||
|
|
||||||
|
|
||||||
#ifdef XCB_USE_XINPUT2_MAEMO
|
#if defined(XCB_USE_XINPUT2)
|
||||||
if (connection()->isUsingXInput2Maemo()) {
|
|
||||||
XIEventMask xieventmask;
|
|
||||||
uchar bitmask[2] = { 0, 0 };
|
|
||||||
|
|
||||||
xieventmask.deviceid = XIAllMasterDevices;
|
|
||||||
xieventmask.mask = bitmask;
|
|
||||||
xieventmask.mask_len = sizeof(bitmask);
|
|
||||||
|
|
||||||
XISetMask(bitmask, XI_ButtonPress);
|
|
||||||
XISetMask(bitmask, XI_ButtonRelease);
|
|
||||||
XISetMask(bitmask, XI_Motion);
|
|
||||||
|
|
||||||
XISelectEvents(DISPLAY_FROM_XCB(this), m_window, &xieventmask, 1);
|
|
||||||
}
|
|
||||||
#elif defined(XCB_USE_XINPUT2)
|
|
||||||
connection()->xi2Select(m_window);
|
connection()->xi2Select(m_window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1531,23 +1516,6 @@ void QXcbWindow::requestActivateWindow()
|
|||||||
connection()->sync();
|
connection()->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if XCB_USE_MAEMO_WINDOW_PROPERTIES
|
|
||||||
void QXcbWindow::handleContentOrientationChange(Qt::ScreenOrientation orientation)
|
|
||||||
{
|
|
||||||
int angle = 0;
|
|
||||||
switch (orientation) {
|
|
||||||
case Qt::PortraitOrientation: angle = 270; break;
|
|
||||||
case Qt::LandscapeOrientation: angle = 0; break;
|
|
||||||
case Qt::InvertedPortraitOrientation: angle = 90; break;
|
|
||||||
case Qt::InvertedLandscapeOrientation: angle = 180; break;
|
|
||||||
case Qt::PrimaryOrientation: break;
|
|
||||||
}
|
|
||||||
Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
|
|
||||||
atom(QXcbAtom::MeegoTouchOrientationAngle), XCB_ATOM_CARDINAL, 32,
|
|
||||||
1, &angle));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QSurfaceFormat QXcbWindow::format() const
|
QSurfaceFormat QXcbWindow::format() const
|
||||||
{
|
{
|
||||||
// ### return actual format
|
// ### return actual format
|
||||||
|
@ -102,10 +102,6 @@ public:
|
|||||||
|
|
||||||
void requestActivateWindow();
|
void requestActivateWindow();
|
||||||
|
|
||||||
#if XCB_USE_MAEMO_WINDOW_PROPERTIES
|
|
||||||
void handleContentOrientationChange(Qt::ScreenOrientation orientation);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool setKeyboardGrabEnabled(bool grab);
|
bool setKeyboardGrabEnabled(bool grab);
|
||||||
bool setMouseGrabEnabled(bool grab);
|
bool setMouseGrabEnabled(bool grab);
|
||||||
|
|
||||||
|
@ -50,20 +50,10 @@ contains(QT_CONFIG, xcb-xlib) {
|
|||||||
DEFINES += XCB_USE_XLIB
|
DEFINES += XCB_USE_XLIB
|
||||||
LIBS += -lX11 -lX11-xcb
|
LIBS += -lX11 -lX11-xcb
|
||||||
|
|
||||||
*-maemo* {
|
contains(QT_CONFIG, xinput2) {
|
||||||
contains(QT_CONFIG, xinput2) {
|
DEFINES += XCB_USE_XINPUT2
|
||||||
# XInput2 support for Harmattan.
|
SOURCES += qxcbconnection_xi2.cpp
|
||||||
DEFINES += XCB_USE_XINPUT2_MAEMO
|
LIBS += -lXi
|
||||||
SOURCES += qxcbconnection_maemo.cpp
|
|
||||||
LIBS += -lXi
|
|
||||||
}
|
|
||||||
DEFINES += XCB_USE_MAEMO_WINDOW_PROPERTIES
|
|
||||||
} else {
|
|
||||||
contains(QT_CONFIG, xinput2) {
|
|
||||||
DEFINES += XCB_USE_XINPUT2
|
|
||||||
SOURCES += qxcbconnection_xi2.cpp
|
|
||||||
LIBS += -lXi
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user