summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor/mockseat.cpp
diff options
context:
space:
mode:
authorMikko Levonmaa <mikko.levonmaa@lge.com>2014-03-31 11:31:18 -0700
committerMikko Levonmaa <mikko.levonmaa@lge.com>2014-10-20 09:58:56 +0200
commit155aee0c513e88f83364ee932b344cfbee1f4986 (patch)
tree40da8e773c2f62d6dbbb676570392912677c6940 /tests/auto/compositor/mockseat.cpp
parent0febf7c52f5cc4bc5c7767f7572ff87a5aa8a7af (diff)
Support for multiple input devices
Allows the registration of multiple input devices for the compositor via private APIs. Since the Qt stack does not support separate input devices via the QPA, the identification of each device (wl_seat) is left up to the implementor. The compositor will identify input event via the QWaylandInputDevice::isOwner method. Usually this will happen when an item on the UI has received an event and would like to send it to the client surface. See QWaylandSurfaceItem for more details. Includes basic unit tests Change-Id: I7ee1db49388713bf3076c23cf8f8a165aefc2fe0 Reviewed-by: Mikko Levonmaa <mikko.levonmaa@lge.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Diffstat (limited to 'tests/auto/compositor/mockseat.cpp')
-rw-r--r--tests/auto/compositor/mockseat.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/auto/compositor/mockseat.cpp b/tests/auto/compositor/mockseat.cpp
new file mode 100644
index 000000000..ff6e449dd
--- /dev/null
+++ b/tests/auto/compositor/mockseat.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 LG Electronics Ltd., author: <mikko.levonmaa@lge.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite 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 "mockseat.h"
+
+MockSeat::MockSeat(wl_seat *seat)
+ : m_seat(seat)
+{
+ // Bind to the keyboard interface so that the compositor has
+ // the right resource associations
+ m_keyboard = wl_seat_get_keyboard(seat);
+}
+
+MockSeat::~MockSeat()
+{
+ wl_keyboard_destroy(m_keyboard);
+ wl_seat_destroy(m_seat);
+}