From 89fc5334c2ef0b92114284d0ffb26d65f76fdb3b Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Wed, 22 Jul 2009 16:21:43 +0200 Subject: Qt/EL mouse and keyboard driver cleanup. * removed the vr41xx, yopy and sl5000 drivers (old PDAs) * removed the bus mouse driver (ISA days should be over) * renamed the LinuxIS mouse driver to LinuxInput (consistency with the key driver) * unified the LinuxInput mouse and key driver I/O handling Reviewed-By: Paul --- configure | 4 +- src/gui/embedded/embedded.pri | 40 +-- src/gui/embedded/qkbddriverfactory_qws.cpp | 24 -- src/gui/embedded/qkbdlinuxinput_qws.cpp | 13 +- src/gui/embedded/qkbdsl5000_qws.cpp | 367 --------------------- src/gui/embedded/qkbdsl5000_qws.h | 92 ------ src/gui/embedded/qkbdtty_qws.cpp | 20 +- src/gui/embedded/qkbdvr41xx_qws.cpp | 186 ----------- src/gui/embedded/qkbdvr41xx_qws.h | 73 ---- src/gui/embedded/qkbdyopy_qws.cpp | 211 ------------ src/gui/embedded/qkbdyopy_qws.h | 73 ---- src/gui/embedded/qmousebus_qws.cpp | 239 -------------- src/gui/embedded/qmousebus_qws.h | 76 ----- src/gui/embedded/qmousedriverfactory_qws.cpp | 34 +- src/gui/embedded/qmouselinuxinput_qws.cpp | 205 ++++++++++++ src/gui/embedded/qmouselinuxinput_qws.h | 78 +++++ src/gui/embedded/qmousevr41xx_qws.cpp | 251 -------------- src/gui/embedded/qmousevr41xx_qws.h | 80 ----- src/gui/embedded/qmouseyopy_qws.cpp | 185 ----------- src/gui/embedded/qmouseyopy_qws.h | 80 ----- src/plugins/kbddrivers/kbddrivers.pro | 3 - src/plugins/kbddrivers/sl5000/main.cpp | 76 ----- src/plugins/kbddrivers/sl5000/sl5000.pro | 16 - src/plugins/kbddrivers/vr41xx/main.cpp | 76 ----- src/plugins/kbddrivers/vr41xx/vr41xx.pro | 14 - src/plugins/kbddrivers/yopy/main.cpp | 76 ----- src/plugins/kbddrivers/yopy/yopy.pro | 14 - src/plugins/mousedrivers/bus/bus.pro | 14 - src/plugins/mousedrivers/bus/main.cpp | 76 ----- src/plugins/mousedrivers/linuxis/linuxis.pro | 10 - .../linuxis/linuxismousedriverplugin.cpp | 83 ----- .../linuxis/linuxismousedriverplugin.h | 58 ---- .../mousedrivers/linuxis/linuxismousehandler.cpp | 180 ---------- .../mousedrivers/linuxis/linuxismousehandler.h | 72 ---- src/plugins/mousedrivers/mousedrivers.pro | 5 +- src/plugins/mousedrivers/vr41xx/main.cpp | 76 ----- src/plugins/mousedrivers/vr41xx/vr41xx.pro | 14 - src/plugins/mousedrivers/yopy/main.cpp | 76 ----- src/plugins/mousedrivers/yopy/yopy.pro | 14 - 39 files changed, 319 insertions(+), 2965 deletions(-) delete mode 100644 src/gui/embedded/qkbdsl5000_qws.cpp delete mode 100644 src/gui/embedded/qkbdsl5000_qws.h delete mode 100644 src/gui/embedded/qkbdvr41xx_qws.cpp delete mode 100644 src/gui/embedded/qkbdvr41xx_qws.h delete mode 100644 src/gui/embedded/qkbdyopy_qws.cpp delete mode 100644 src/gui/embedded/qkbdyopy_qws.h delete mode 100644 src/gui/embedded/qmousebus_qws.cpp delete mode 100644 src/gui/embedded/qmousebus_qws.h create mode 100644 src/gui/embedded/qmouselinuxinput_qws.cpp create mode 100644 src/gui/embedded/qmouselinuxinput_qws.h delete mode 100644 src/gui/embedded/qmousevr41xx_qws.cpp delete mode 100644 src/gui/embedded/qmousevr41xx_qws.h delete mode 100644 src/gui/embedded/qmouseyopy_qws.cpp delete mode 100644 src/gui/embedded/qmouseyopy_qws.h delete mode 100644 src/plugins/kbddrivers/sl5000/main.cpp delete mode 100644 src/plugins/kbddrivers/sl5000/sl5000.pro delete mode 100644 src/plugins/kbddrivers/vr41xx/main.cpp delete mode 100644 src/plugins/kbddrivers/vr41xx/vr41xx.pro delete mode 100644 src/plugins/kbddrivers/yopy/main.cpp delete mode 100644 src/plugins/kbddrivers/yopy/yopy.pro delete mode 100644 src/plugins/mousedrivers/bus/bus.pro delete mode 100644 src/plugins/mousedrivers/bus/main.cpp delete mode 100644 src/plugins/mousedrivers/linuxis/linuxis.pro delete mode 100644 src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.cpp delete mode 100644 src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.h delete mode 100644 src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp delete mode 100644 src/plugins/mousedrivers/linuxis/linuxismousehandler.h delete mode 100644 src/plugins/mousedrivers/vr41xx/main.cpp delete mode 100644 src/plugins/mousedrivers/vr41xx/vr41xx.pro delete mode 100644 src/plugins/mousedrivers/yopy/main.cpp delete mode 100644 src/plugins/mousedrivers/yopy/yopy.pro diff --git a/configure b/configure index b65e6d5..4b75a75 100755 --- a/configure +++ b/configure @@ -614,9 +614,9 @@ CFG_GFX_ON="linuxfb multiscreen" CFG_GFX_PLUGIN_AVAILABLE= CFG_GFX_PLUGIN= CFG_GFX_OFF= -CFG_KBD_AVAILABLE="tty linuxinput sl5000 yopy vr41xx qvfb" +CFG_KBD_AVAILABLE="tty linuxinput qvfb" CFG_KBD_ON="tty" #default, see QMakeVar above -CFG_MOUSE_AVAILABLE="pc bus linuxtp yopy vr41xx tslib qvfb" +CFG_MOUSE_AVAILABLE="pc linuxtp linuxinput tslib qvfb" CFG_MOUSE_ON="pc linuxtp" #default, see QMakeVar above CFG_ARCH= diff --git a/src/gui/embedded/embedded.pri b/src/gui/embedded/embedded.pri index 4a9aa3f..53a2512 100644 --- a/src/gui/embedded/embedded.pri +++ b/src/gui/embedded/embedded.pri @@ -141,15 +141,7 @@ embedded { !contains( kbd-drivers, qvfb ) { kbd-drivers += qvfb } - } - - contains( kbd-drivers, sl5000 ) { - HEADERS +=embedded/qkbdsl5000_qws.h - SOURCES +=embedded/qkbdsl5000_qws.cpp - !contains( kbd-drivers, tty ) { - kbd-drivers += tty - } - } + } contains( kbd-drivers, tty ) { HEADERS +=embedded/qkbdtty_qws.h @@ -166,16 +158,6 @@ embedded { SOURCES +=embedded/qkbdum_qws.cpp } - contains( kbd-drivers, yopy ) { - HEADERS +=embedded/qkbdyopy_qws.h - SOURCES +=embedded/qkbdyopy_qws.cpp - } - - contains( kbd-drivers, vr41xx ) { - HEADERS +=embedded/qkbdvr41xx_qws.h - SOURCES +=embedded/qkbdvr41xx_qws.cpp - } - # # Mouse drivers # @@ -189,29 +171,19 @@ embedded { SOURCES +=embedded/qmousepc_qws.cpp } - contains( mouse-drivers, bus ) { - HEADERS +=embedded/qmousebus_qws.h - SOURCES +=embedded/qmousebus_qws.cpp - } - contains( mouse-drivers, linuxtp ) { HEADERS +=embedded/qmouselinuxtp_qws.h SOURCES +=embedded/qmouselinuxtp_qws.cpp } - contains( mouse-drivers, vr41xx ) { - HEADERS +=embedded/qmousevr41xx_qws.h - SOURCES +=embedded/qmousevr41xx_qws.cpp - } - - contains( mouse-drivers, yopy ) { - HEADERS +=embedded/qmouseyopy_qws.h - SOURCES +=embedded/qmouseyopy_qws.cpp - } - contains( mouse-drivers, tslib ) { LIBS += -lts HEADERS +=embedded/qmousetslib_qws.h SOURCES +=embedded/qmousetslib_qws.cpp } + + contains( mouse-drivers, linuxinput ) { + HEADERS +=embedded/qmouselinuxinput_qws.h + SOURCES +=embedded/qmouselinuxinput_qws.cpp + } } diff --git a/src/gui/embedded/qkbddriverfactory_qws.cpp b/src/gui/embedded/qkbddriverfactory_qws.cpp index c599396..b77eb72 100644 --- a/src/gui/embedded/qkbddriverfactory_qws.cpp +++ b/src/gui/embedded/qkbddriverfactory_qws.cpp @@ -47,10 +47,7 @@ #include "qkbdtty_qws.h" #include "qkbdlinuxinput_qws.h" #include "qkbdum_qws.h" -#include "qkbdsl5000_qws.h" #include "qkbdvfb_qws.h" -#include "qkbdyopy_qws.h" -#include "qkbdvr41xx_qws.h" #include #include "private/qfactoryloader_p.h" #include "qkbddriverplugin_qws.h" @@ -104,18 +101,6 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, QWSKeyboardHandler *QKbdDriverFactory::create(const QString& key, const QString& device) { QString driver = key.toLower(); -#ifndef QT_NO_QWS_KBD_SL5000 - if (driver == QLatin1String("sl5000") || driver.isEmpty()) - return new QWSSL5000KeyboardHandler(device); -#endif -#ifndef QT_NO_QWS_KBD_YOPY - if (driver == QLatin1String("yopy") || driver.isEmpty()) - return new QWSYopyKeyboardHandler(device); -#endif -#ifndef QT_NO_QWS_KBD_VR41XX - if (driver == QLatin1String("vr41xx") || driver.isEmpty()) - return new QWSVr41xxKeyboardHandler(device); -#endif #ifndef QT_NO_QWS_KEYBOARD # ifndef QT_NO_QWS_KBD_TTY if (driver == QLatin1String("tty") || driver.isEmpty()) @@ -158,15 +143,6 @@ QStringList QKbdDriverFactory::keys() { QStringList list; -#ifndef QT_NO_QWS_KBD_SL5000 - list << QLatin1String("SL5000"); -#endif -#ifndef QT_NO_QWS_KBD_YOPY - list << QLatin1String("YOPY"); -#endif -#ifndef QT_NO_QWS_KBD_VR41XX - list << QLatin1String("VR41xx"); -#endif #ifndef QT_NO_QWS_KBD_TTY list << QLatin1String("TTY"); #endif diff --git a/src/gui/embedded/qkbdlinuxinput_qws.cpp b/src/gui/embedded/qkbdlinuxinput_qws.cpp index e552731..6aa6633 100644 --- a/src/gui/embedded/qkbdlinuxinput_qws.cpp +++ b/src/gui/embedded/qkbdlinuxinput_qws.cpp @@ -76,6 +76,7 @@ private: int m_fd; int m_tty_fd; struct termios m_tty_attr; + int m_orig_kbmode; }; QWSLinuxInputKeyboardHandler::QWSLinuxInputKeyboardHandler(const QString &device) @@ -95,8 +96,7 @@ bool QWSLinuxInputKeyboardHandler::filterInputEvent(quint16 &, qint32 &) } QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *h, const QString &device) - : m_handler(h), m_fd(-1), m_tty_fd(-1) - + : m_handler(h), m_fd(-1), m_tty_fd(-1), m_orig_kbmode(K_XLATE) { setObjectName(QLatin1String("LinuxInputSubsystem Keyboard Handler")); @@ -135,7 +135,10 @@ QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *h, struct ::termios termdata; tcgetattr(m_tty_fd, &termdata); - // setting this tranlation mode is also needed in INPUT mode to prevent + // record the original mode so we can restore it again in the destructor. + ::ioctl(m_tty_fd, KDGKBMODE, &m_orig_kbmode); + + // setting this tranlation mode is even needed in INPUT mode to prevent // the shell from also interpreting codes, if the process has a tty // attached: e.g. Ctrl+C wouldn't copy, but kill the application. ::ioctl(m_tty_fd, KDSKBMODE, K_MEDIUMRAW); @@ -152,7 +155,7 @@ QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *h, tcsetattr(m_tty_fd, TCSANOW, &termdata); } } else { - qWarning("Cannot open input device '%s': %s", qPrintable(dev), strerror(errno)); + qWarning("Cannot open keyboard input device '%s': %s", qPrintable(dev), strerror(errno)); return; } } @@ -160,7 +163,7 @@ QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *h, QWSLinuxInputKbPrivate::~QWSLinuxInputKbPrivate() { if (m_tty_fd >= 0) { - ::ioctl(m_tty_fd, KDSKBMODE, K_XLATE); + ::ioctl(m_tty_fd, KDSKBMODE, m_orig_kbmode); tcsetattr(m_tty_fd, TCSANOW, &m_tty_attr); } if (m_fd >= 0) diff --git a/src/gui/embedded/qkbdsl5000_qws.cpp b/src/gui/embedded/qkbdsl5000_qws.cpp deleted file mode 100644 index cf82c10..0000000 --- a/src/gui/embedded/qkbdsl5000_qws.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qkbdsl5000_qws.h" - -#ifndef QT_NO_QWS_KBD_SL5000 - -#include "qwindowsystem_qws.h" -#include "qwsutils_qws.h" -#include "qscreen_qws.h" - -#include "qapplication.h" -#include "qnamespace.h" -#include "qtimer.h" - -#include // overrides QT_OPEN - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -static const QWSKeyMap sl5000KeyMap[] = { - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 00 - { Qt::Key_A, 'a' , 'A' , 'A'-64 }, // 01 - { Qt::Key_B, 'b' , 'B' , 'B'-64 }, // 02 - { Qt::Key_C, 'c' , 'C' , 'C'-64 }, // 03 - { Qt::Key_D, 'd' , 'D' , 'D'-64 }, // 04 - { Qt::Key_E, 'e' , 'E' , 'E'-64 }, // 05 - { Qt::Key_F, 'f' , 'F' , 'F'-64 }, // 06 - { Qt::Key_G, 'g' , 'G' , 'G'-64 }, // 07 - { Qt::Key_H, 'h' , 'H' , 'H'-64 }, // 08 - { Qt::Key_I, 'i' , 'I' , 'I'-64 }, // 09 - { Qt::Key_J, 'j' , 'J' , 'J'-64 }, // 0a 10 - { Qt::Key_K, 'k' , 'K' , 'K'-64 }, // 0b - { Qt::Key_L, 'l' , 'L' , 'L'-64 }, // 0c - { Qt::Key_M, 'm' , 'M' , 'M'-64 }, // 0d - { Qt::Key_N, 'n' , 'N' , 'N'-64 }, // 0e - { Qt::Key_O, 'o' , 'O' , 'O'-64 }, // 0f - { Qt::Key_P, 'p' , 'P' , 'P'-64 }, // 10 - { Qt::Key_Q, 'q' , 'Q' , 'Q'-64 }, // 11 - { Qt::Key_R, 'r' , 'R' , 'R'-64 }, // 12 - { Qt::Key_S, 's' , 'S' , 'S'-64 }, // 13 - { Qt::Key_T, 't' , 'T' , 'T'-64 }, // 14 20 - { Qt::Key_U, 'u' , 'U' , 'U'-64 }, // 15 - { Qt::Key_V, 'v' , 'V' , 'V'-64 }, // 16 - { Qt::Key_W, 'w' , 'W' , 'W'-64 }, // 17 - { Qt::Key_X, 'x' , 'X' , 'X'-64 }, // 18 - { Qt::Key_Y, 'y' , 'Y' , 'Y'-64 }, // 19 - { Qt::Key_Z, 'z' , 'Z' , 'Z'-64 }, // 1a - { Qt::Key_Shift, 0xffff , 0xffff , 0xffff }, // 1b - { Qt::Key_Return, 13 , 13 , 0xffff }, // 1c - { Qt::Key_F11, 0xffff , 0xffff , 0xffff }, // 1d todo - { Qt::Key_F22, 0xffff , 0xffff , 0xffff }, // 1e 30 - { Qt::Key_Backspace, 8 , 8 , 0xffff }, // 1f - { Qt::Key_F31, 0xffff , 0xffff , 0xffff }, // 20 - { Qt::Key_F35, 0xffff , 0xffff , 0xffff }, // 21 light - { Qt::Key_Escape, 0xffff , 0xffff , 0xffff }, // 22 - - // Direction key code are for *UNROTATED* display. - { Qt::Key_Up, 0xffff , 0xffff , 0xffff }, // 23 - { Qt::Key_Right, 0xffff , 0xffff , 0xffff }, // 24 - { Qt::Key_Left, 0xffff , 0xffff , 0xffff }, // 25 - { Qt::Key_Down, 0xffff , 0xffff , 0xffff }, // 26 - - { Qt::Key_F33, 0xffff , 0xffff , 0xffff }, // 27 OK - { Qt::Key_F12, 0xffff , 0xffff , 0xffff }, // 28 40 home - { Qt::Key_1, '1' , 'q' , 'Q'-64 }, // 29 - { Qt::Key_2, '2' , 'w' , 'W'-64 }, // 2a - { Qt::Key_3, '3' , 'e' , 'E'-64 }, // 2b - { Qt::Key_4, '4' , 'r' , 'R'-64 }, // 2c - { Qt::Key_5, '5' , 't' , 'T'-64 }, // 2d - { Qt::Key_6, '6' , 'y' , 'Y'-64 }, // 2e - { Qt::Key_7, '7' , 'u' , 'U'-64 }, // 2f - { Qt::Key_8, '8' , 'i' , 'I'-64 }, // 30 - { Qt::Key_9, '9' , 'o' , 'O'-64 }, // 31 - { Qt::Key_0, '0' , 'p' , 'P'-64 }, // 32 50 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 33 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 34 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 35 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 36 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 37 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 38 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 39 - { Qt::Key_Minus, '-' , 'b' , 'B'-64 }, // 3a - { Qt::Key_Plus, '+' , 'n' , 'N'-64 }, // 3b - { Qt::Key_CapsLock, 0xffff , 0xffff , 0xffff }, // 3c 60 - { Qt::Key_At, '@' , 's' , 'S'-64 }, // 3d - { Qt::Key_Question, '?' , '?' , 0xffff }, // 3e - { Qt::Key_Comma, ',' , ',' , 0xffff }, // 3f - { Qt::Key_Period, '.' , '.' , 0xffff }, // 40 - { Qt::Key_Tab, 9 , '\\' , 0xffff }, // 41 - { Qt::Key_X, 0xffff , 'x' , 'X'-64 }, // 42 - { Qt::Key_C, 0xffff , 'c' , 'C'-64 }, // 43 - { Qt::Key_V, 0xffff , 'v' , 'V'-64 }, // 44 - { Qt::Key_Slash, '/' , '/' , 0xffff }, // 45 - { Qt::Key_Apostrophe, '\'' , '\'' , 0xffff }, // 46 70 - { Qt::Key_Semicolon, ';' , ';' , 0xffff }, // 47 - { Qt::Key_QuoteDbl, '\"' , '\"' , 0xffff }, // 48 - { Qt::Key_Colon, ':' , ':' , 0xffff }, // 49 - { Qt::Key_NumberSign, '#' , 'd' , 'D'-64 }, // 4a - { Qt::Key_Dollar, '$' , 'f' , 'F'-64 }, // 4b - { Qt::Key_Percent, '%' , 'g' , 'G'-64 }, // 4c - { Qt::Key_Underscore, '_' , 'h' , 'H'-64 }, // 4d - { Qt::Key_Ampersand, '&' , 'j' , 'J'-64 }, // 4e - { Qt::Key_Asterisk, '*' , 'k' , 'K'-64 }, // 4f - { Qt::Key_ParenLeft, '(' , 'l' , 'L'-64 }, // 50 80 - { Qt::Key_Delete, '[' , '[' , '[' }, // 51 - { Qt::Key_Z, 0xffff , 'z' , 'Z'-64 }, // 52 - { Qt::Key_Equal, '=' , 'm' , 'M'-64 }, // 53 - { Qt::Key_ParenRight, ')' , ']' , ']' }, // 54 - { Qt::Key_AsciiTilde, '~' , '^' , '^' }, // 55 - { Qt::Key_Less, '<' , '{' , '{' }, // 56 - { Qt::Key_Greater, '>' , '}' , '}' }, // 57 - { Qt::Key_F9, 0xffff , 0xffff , 0xffff }, // 58 datebook - { Qt::Key_F10, 0xffff , 0xffff , 0xffff }, // 59 address - { Qt::Key_F13, 0xffff , 0xffff , 0xffff }, // 5a 90 email - { Qt::Key_F30, ' ' , ' ' , 0xffff }, // 5b select - { Qt::Key_Space, ' ' , '|' , '`' }, // 5c - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 5d - { Qt::Key_Exclam, '!' , 'a' , 'A'-64 }, // 5e - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 5f - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 60 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 61 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 62 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 63 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 64 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 65 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 66 - { Qt::Key_Meta, 0xffff , 0xffff , 0xffff }, // 67 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 68 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 69 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 6a - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 6b - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 6c - { Qt::Key_F34, 0xffff , 0xffff , 0xffff }, // 6d power - { Qt::Key_F13, 0xffff , 0xffff , 0xffff }, // 6e mail long - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 6f - { Qt::Key_NumLock, 0xffff , 0xffff , 0xffff }, // 70 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 71 - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 72 - { 0x20ac, 0xffff , 0x20ac , 0x20ac }, // 73 Euro sign - { Qt::Key_unknown, 0xffff , 0xffff , 0xffff }, // 74 - { Qt::Key_F32, 0xffff , 0xffff , 0xffff }, // 75 Sync - { 0, 0xffff , 0xffff , 0xffff } -}; - -static const int keyMSize = sizeof(sl5000KeyMap)/sizeof(QWSKeyMap)-1; - -QWSSL5000KeyboardHandler::QWSSL5000KeyboardHandler(const QString &device) - : QWSTtyKeyboardHandler(device) -{ - shift = false; - alt = false; - ctrl = false; - extended = 0; - prevuni = 0; - prevkey = 0; - caps = false; - meta = false; - fn = false; - numLock = false; - - sharp_kbdctl_modifstat st; - int dev = QT_OPEN(device.isEmpty()?"/dev/sharp_kbdctl":device.toLocal8Bit().constData(), O_RDWR); - if (dev >= 0) { - memset(&st, 0, sizeof(st)); - st.which = 3; - int ret = ioctl(dev, SHARP_KBDCTL_GETMODIFSTAT, (char*)&st); - if(!ret) - numLock = (bool)st.stat; - QT_CLOSE(dev); - } -} - -QWSSL5000KeyboardHandler::~QWSSL5000KeyboardHandler() -{ -} - -const QWSKeyMap *QWSSL5000KeyboardHandler::keyMap() const -{ - return sl5000KeyMap; -} - -bool QWSSL5000KeyboardHandler::filterKeycode(char &code) -{ - int keyCode = Qt::Key_unknown; - bool release = false; - - if (code & 0x80) { - release = true; - code &= 0x7f; - } - - if (fn && !meta && (code >= 0x42 && code <= 0x52)) { - ushort unicode=0; - int scan=0; - if (code == 0x42) { unicode='X'-'@'; scan=Qt::Key_X; } // Cut - else if (code == 0x43) { unicode='C'-'@'; scan=Qt::Key_C; } // Copy - else if (code == 0x44) { unicode='V'-'@'; scan=Qt::Key_V; } // Paste - else if (code == 0x52) { unicode='Z'-'@'; scan=Qt::Key_Z; } // Undo - if (scan) { - processKeyEvent(unicode, scan, Qt::ControlModifier, !release, false); - return true; - } - } - - if (code < keyMSize) { - keyCode = keyMap()[int(code)].key_code; - } - - bool repeatable = true; - - if (release && (keyCode == Qt::Key_F34 || keyCode == Qt::Key_F35)) - return true; // no release for power and light keys - if ((keyCode >= Qt::Key_F1 && keyCode <= Qt::Key_F35) - || keyCode == Qt::Key_Escape || keyCode == Qt::Key_Home - || keyCode == Qt::Key_Shift || keyCode == Qt::Key_Meta) - repeatable = false; - - if (qt_screen->isTransformed() - && keyCode >= Qt::Key_Left && keyCode <= Qt::Key_Down) - { - keyCode = transformDirKey(keyCode); - } - - // Ctrl-Alt-Delete exits qws - if (ctrl && alt && keyCode == Qt::Key_Delete) { - qApp->quit(); - } - - if (keyCode == Qt::Key_F22) { /* Fn key */ - fn = !release; - } else if (keyCode == Qt::Key_NumLock) { - if (release) - numLock = !numLock; - } else if (keyCode == Qt::AltModifier) { - alt = !release; - } else if (keyCode == Qt::ControlModifier) { - ctrl = !release; - } else if (keyCode == Qt::ShiftModifier) { - shift = !release; - } else if (keyCode == Qt::MetaModifier) { - meta = !release; - } else if (keyCode == Qt::Key_CapsLock && release) { - caps = !caps; - } - if (keyCode != Qt::Key_unknown) { - bool bAlt = alt; - bool bCtrl = ctrl; - bool bShift = shift; - int unicode = 0; - if (code < keyMSize) { - bool bCaps = caps ^ shift; - if (fn) { - if (shift) { - bCaps = bShift = false; - bCtrl = true; - } - if (meta) { - bCaps = bShift = true; - bAlt = true; - } - } else if (meta) { - bCaps = bShift = true; - } - if (code > 40 && caps) { - // fn-keys should only react to shift, not caps - bCaps = bShift = shift; - } - if (numLock) { - if (keyCode != Qt::Key_Space && keyCode != Qt::Key_Tab) - bCaps = bShift = false; - } - if (keyCode == Qt::Key_Delete && (bAlt || bCtrl)) { - keyCode = Qt::Key_BraceLeft; - unicode = '['; - bCaps = bShift = bAlt = bCtrl = false; - } else if (keyCode == Qt::Key_F31 && bCtrl) { - keyCode = Qt::Key_QuoteLeft; - unicode = '`'; - } else if (bCtrl) - unicode = keyMap()[int(code)].ctrl_unicode ? keyMap()[int(code)].ctrl_unicode : 0xffff; - else if (bCaps) - unicode = keyMap()[int(code)].shift_unicode ? keyMap()[int(code)].shift_unicode : 0xffff; - else - unicode = keyMap()[int(code)].unicode ? keyMap()[int(code)].unicode : 0xffff; - } - - modifiers = 0; - if (bAlt) modifiers |= Qt::AltModifier; - if (bCtrl) modifiers |= Qt::ControlModifier; - if (bShift) modifiers |= Qt::ShiftModifier; - - // looks wrong -- WWA - bool repeat = false; - if (prevuni == unicode && prevkey == keyCode && !release) - repeat = true; - - processKeyEvent(unicode, keyCode, modifiers, !release, repeat); - - if (!release) { - prevuni = unicode; - prevkey = keyCode; - } else { - prevkey = prevuni = 0; - } - } - - if (repeatable && !release) - beginAutoRepeat(prevuni, prevkey, modifiers); - else - endAutoRepeat(); - - return true; -} - -QT_END_NAMESPACE - -#endif // QT_NO_QWS_KBD_SL5000 diff --git a/src/gui/embedded/qkbdsl5000_qws.h b/src/gui/embedded/qkbdsl5000_qws.h deleted file mode 100644 index 42afbe1..0000000 --- a/src/gui/embedded/qkbdsl5000_qws.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QKBDSL5000_QWS_H -#define QKBDSL5000_QWS_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#ifndef QT_NO_QWS_KBD_SL5000 - -struct QWSKeyMap { - uint key_code; - ushort unicode; - ushort shift_unicode; - ushort ctrl_unicode; -}; - - -class QWSSL5000KeyboardHandler : public QWSTtyKeyboardHandler -{ -public: - explicit QWSSL5000KeyboardHandler(const QString&); - virtual ~QWSSL5000KeyboardHandler(); - - bool filterKeycode(char &keycode); - virtual const QWSKeyMap *keyMap() const; - -private: - bool shift; - bool alt; - bool ctrl; - bool caps; - uint extended:2; - Qt::KeyboardModifiers modifiers; - int prevuni; - int prevkey; - bool meta; - bool fn; - bool numLock; -}; - -#endif // QT_NO_QWS_KBD_SL5000 - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QKBDSL5000_QWS_H diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp index 8c1e79b..f107567 100644 --- a/src/gui/embedded/qkbdtty_qws.cpp +++ b/src/gui/embedded/qkbdtty_qws.cpp @@ -90,7 +90,7 @@ private: struct termios m_tty_attr; char m_last_keycode; int m_vt_qws; - int m_originalKbdMode; + int m_orig_kbmode; }; @@ -111,7 +111,7 @@ bool QWSTtyKeyboardHandler::filterKeycode(char &) } QWSTtyKbPrivate::QWSTtyKbPrivate(QWSTtyKeyboardHandler *h, const QString &device) - : m_handler(h), m_tty_fd(-1), m_last_keycode(0), m_vt_qws(0) + : m_handler(h), m_tty_fd(-1), m_last_keycode(0), m_vt_qws(0), m_orig_kbmode(K_XLATE) { setObjectName(QLatin1String("TTY Keyboard Handler")); #ifndef QT_NO_QWS_SIGNALHANDLER @@ -152,15 +152,15 @@ QWSTtyKbPrivate::QWSTtyKbPrivate(QWSTtyKeyboardHandler *h, const QString &device tcgetattr(m_tty_fd, &termdata); #if defined(Q_OS_LINUX) - // record the original mode so we can restore it again in the constructor - ::ioctl(m_tty_fd, KDGKBMODE, m_originalKbdMode); + // record the original mode so we can restore it again in the destructor. + ::ioctl(m_tty_fd, KDGKBMODE, &m_orig_kbmode); // PLEASE NOTE: - // The tty keycode interface can only report keycodes 0x01 .. 0x7f + // the tty keycode interface can only report keycodes 0x01 .. 0x7f // KEY_MAX is however defined to 0x1ff. In practice this is sufficient // for a PC style keyboard though. - // we don't support K_RAW anymore - if you need, you habe to add a - // scan- to keycode converter. + // we don't support K_RAW anymore - if you need that, you have to add + // a scan- to keycode converter yourself. ::ioctl(m_tty_fd, KDSKBMODE, K_MEDIUMRAW); #endif @@ -211,12 +211,10 @@ QWSTtyKbPrivate::~QWSTtyKbPrivate() { if (m_tty_fd >= 0) { #if defined(Q_OS_LINUX) - ::ioctl(m_tty_fd, KDSKBMODE, m_originalKbdMode); + ::ioctl(m_tty_fd, KDSKBMODE, m_orig_kbmode); #endif tcsetattr(m_tty_fd, TCSANOW, &m_tty_attr); - - // we're leaking m_tty_fd here? - //QT_CLOSE(m_tty_fd); + QT_CLOSE(m_tty_fd); } } diff --git a/src/gui/embedded/qkbdvr41xx_qws.cpp b/src/gui/embedded/qkbdvr41xx_qws.cpp deleted file mode 100644 index 6d8299b..0000000 --- a/src/gui/embedded/qkbdvr41xx_qws.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qkbdvr41xx_qws.h" - -#if !defined(QT_NO_QWS_KEYBOARD) && !defined(QT_NO_QWS_KBD_VR41XX) - -#include -#include -#include -#include -#include -#include -#include - -#include -#include // overrides QT_OPEN - -QT_BEGIN_NAMESPACE - -class QWSVr41xxKbPrivate : public QObject -{ - Q_OBJECT -public: - QWSVr41xxKbPrivate(QWSVr41xxKeyboardHandler *h, const QString&); - virtual ~QWSVr41xxKbPrivate(); - - bool isOpen() { return buttonFD > 0; } - -private slots: - void readKeyboardData(); - -private: - QString terminalName; - int buttonFD; - int kbdIdx; - int kbdBufferLen; - unsigned char *kbdBuffer; - QSocketNotifier *notifier; - QWSVr41xxKeyboardHandler *handler; -}; - -QWSVr41xxKeyboardHandler::QWSVr41xxKeyboardHandler(const QString &device) -{ - d = new QWSVr41xxKbPrivate(this, device); -} - -QWSVr41xxKeyboardHandler::~QWSVr41xxKeyboardHandler() -{ - delete d; -} - -QWSVr41xxKbPrivate::QWSVr41xxKbPrivate(QWSVr41xxKeyboardHandler *h, const QString &device) : handler(h) -{ - terminalName = device; - if (terminalName.isEmpty()) - terminalName = QLatin1String("/dev/buttons"); - buttonFD = -1; - notifier = 0; - - buttonFD = QT_OPEN(terminalName.toLatin1().constData(), O_RDWR | O_NDELAY, 0);; - if (buttonFD < 0) { - qWarning("Cannot open %s\n", qPrintable(terminalName)); - return; - } - - if (buttonFD >= 0) { - notifier = new QSocketNotifier(buttonFD, QSocketNotifier::Read, this); - connect(notifier, SIGNAL(activated(int)),this, - SLOT(readKeyboardData())); - } - - kbdBufferLen = 80; - kbdBuffer = new unsigned char [kbdBufferLen]; - kbdIdx = 0; -} - -QWSVr41xxKbPrivate::~QWSVr41xxKbPrivate() -{ - if (buttonFD > 0) { - QT_CLOSE(buttonFD); - buttonFD = -1; - } - delete notifier; - notifier = 0; - delete [] kbdBuffer; -} - -void QWSVr41xxKbPrivate::readKeyboardData() -{ - int n = 0; - do { - n = QT_READ(buttonFD, kbdBuffer+kbdIdx, kbdBufferLen - kbdIdx); - if (n > 0) - kbdIdx += n; - } while (n > 0); - - int idx = 0; - while (kbdIdx - idx >= 2) { - unsigned char *next = kbdBuffer + idx; - unsigned short *code = (unsigned short *)next; - int keycode = Qt::Key_unknown; - switch ((*code) & 0x0fff) { - case 0x7: - keycode = Qt::Key_Up; - break; - case 0x9: - keycode = Qt::Key_Right; - break; - case 0x8: - keycode = Qt::Key_Down; - break; - case 0xa: - keycode = Qt::Key_Left; - break; - case 0x3: - keycode = Qt::Key_Up; - break; - case 0x4: - keycode = Qt::Key_Down; - break; - case 0x1: - keycode = Qt::Key_Return; - break; - case 0x2: - keycode = Qt::Key_F4; - break; - default: - qDebug("Unrecognised key sequence %d", *code); - } - if ((*code) & 0x8000) - handler->processKeyEvent(0, keycode, 0, false, false); - else - handler->processKeyEvent(0, keycode, 0, true, false); - idx += 2; - } - - int surplus = kbdIdx - idx; - for (int i = 0; i < surplus; i++) - kbdBuffer[i] = kbdBuffer[idx+i]; - kbdIdx = surplus; -} - -QT_END_NAMESPACE - -#include "qkbdvr41xx_qws.moc" - -#endif // QT_NO_QWS_KBD_VR41XX diff --git a/src/gui/embedded/qkbdvr41xx_qws.h b/src/gui/embedded/qkbdvr41xx_qws.h deleted file mode 100644 index 1a657b9..0000000 --- a/src/gui/embedded/qkbdvr41xx_qws.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QKBDVR41XX_QWS_H -#define QKBDVR41XX_QWS_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#if !defined(QT_NO_QWS_KEYBOARD) && !defined(QT_NO_QWS_KBD_VR41XX) - -class QWSVr41xxKbPrivate; - -class QWSVr41xxKeyboardHandler : public QWSKeyboardHandler -{ -public: - explicit QWSVr41xxKeyboardHandler(const QString&); - virtual ~QWSVr41xxKeyboardHandler(); - -private: - QWSVr41xxKbPrivate *d; -}; - -#endif // QT_NO_QWS_KBD_VR41XX - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QKBDVR41XX_QWS_H diff --git a/src/gui/embedded/qkbdyopy_qws.cpp b/src/gui/embedded/qkbdyopy_qws.cpp deleted file mode 100644 index edb732c..0000000 --- a/src/gui/embedded/qkbdyopy_qws.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - * YOPY buttons driver - * Contributed by Ron Victorelli (victorrj at icubed.com) - */ - -#include "qkbdyopy_qws.h" - -#ifndef QT_NO_QWS_KBD_YOPY - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include // overrides QT_OPEN - -extern "C" { - int getpgid(int); -} - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWSYopyKbPrivate : public QObject -{ - Q_OBJECT -public: - QWSYopyKbPrivate(QWSYopyKeyboardHandler *h, const QString&); - virtual ~QWSYopyKbPrivate(); - - bool isOpen() { return buttonFD > 0; } - -private slots: - void readKeyboardData(); - -private: - QString terminalName; - int buttonFD; - struct termios newT, oldT; - QSocketNotifier *notifier; - QWSYopyKeyboardHandler *handler; -}; - -QWSYopyKeyboardHandler::QWSYopyKeyboardHandler(const QString &device) -{ - d = new QWSYopyKbPrivate(this, device); -} - -QWSYopyKeyboardHandler::~QWSYopyKeyboardHandler() -{ - delete d; -} - -QWSYopyKbPrivate::QWSYopyKbPrivate(QWSYopyKeyboardHandler *h, const QString &device) : handler(h) -{ - terminalName = device.isEmpty()?"/dev/tty1":device.toLatin1().constData(); - buttonFD = -1; - notifier = 0; - - buttonFD = QT_OPEN(terminalName.toLatin1().constData(), O_RDWR | O_NDELAY, 0); - if (buttonFD < 0) { - qWarning("Cannot open %s\n", qPrintable(terminalName)); - return; - } else { - - tcsetpgrp(buttonFD, getpgid(0)); - - /* put tty into "straight through" mode. - */ - if (tcgetattr(buttonFD, &oldT) < 0) { - qFatal("Linux-kbd: tcgetattr failed"); - } - - newT = oldT; - newT.c_lflag &= ~(ICANON | ECHO | ISIG); - newT.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON); - newT.c_iflag |= IGNBRK; - newT.c_cc[VMIN] = 0; - newT.c_cc[VTIME] = 0; - - - if (tcsetattr(buttonFD, TCSANOW, &newT) < 0) { - qFatal("Linux-kbd: TCSANOW tcsetattr failed"); - } - - if (ioctl(buttonFD, KDSKBMODE, K_MEDIUMRAW) < 0) { - qFatal("Linux-kbd: KDSKBMODE tcsetattr failed"); - } - - notifier = new QSocketNotifier(buttonFD, QSocketNotifier::Read, this); - connect(notifier, SIGNAL(activated(int)),this, - SLOT(readKeyboardData())); - } -} - -QWSYopyKbPrivate::~QWSYopyKbPrivate() -{ - if (buttonFD > 0) { - ::close(buttonFD); - buttonFD = -1; - } -} - -void QWSYopyKbPrivate::readKeyboardData() -{ - uchar buf[1]; - char c='1'; - int fd; - - int n=read(buttonFD,buf,1); - if (n<0) { - qDebug("Keyboard read error %s",strerror(errno)); - } else { - uint code = buf[0]&YPBUTTON_CODE_MASK; - bool press = !(buf[0]&0x80); - // printf("Key=%d/%d/%d\n",buf[1],code,press); - int k=(-1); - switch(code) { - case 39: k=Qt::Key_Up; break; - case 44: k=Qt::Key_Down; break; - case 41: k=Qt::Key_Left; break; - case 42: k=Qt::Key_Right; break; - case 56: k=Qt::Key_F1; break; //windows - case 29: k=Qt::Key_F2; break; //cycle - case 24: k=Qt::Key_F3; break; //record - case 23: k=Qt::Key_F4; break; //mp3 - case 4: k=Qt::Key_F5; break; // PIMS - case 1: k=Qt::Key_Escape; break; // Escape - case 40: k=Qt::Key_Up; break; // prev - case 45: k=Qt::Key_Down; break; // next - case 35: if(!press) { - fd = QT_OPEN("/proc/sys/pm/sleep",O_RDWR,0); - if(fd >= 0) { - QT_WRITE(fd,&c,sizeof(c)); - QT_CLOSE(fd); - // - // Updates all widgets. - // - QWidgetList list = QApplication::allWidgets(); - for (int i = 0; i < list.size(); ++i) { - QWidget *w = list.at(i); - w->update(); - } - } - } - break; - - default: k=(-1); break; - } - - if (k >= 0) { - handler->processKeyEvent(0, k, 0, press, false); - } - } -} - -QT_END_NAMESPACE - -#include "qkbdyopy_qws.moc" - -#endif // QT_NO_QWS_KBD_YOPY diff --git a/src/gui/embedded/qkbdyopy_qws.h b/src/gui/embedded/qkbdyopy_qws.h deleted file mode 100644 index b4e45bd..0000000 --- a/src/gui/embedded/qkbdyopy_qws.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QKBDYOPY_QWS_H -#define QKBDYOPY_QWS_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#ifndef QT_NO_QWS_KBD_YOPY - -class QWSYopyKbPrivate; - -class QWSYopyKeyboardHandler : public QWSKeyboardHandler -{ -public: - explicit QWSYopyKeyboardHandler(const QString&); - virtual ~QWSYopyKeyboardHandler(); - -private: - QWSYopyKbPrivate *d; -}; - -#endif // QT_NO_QWS_KBD_YOPY - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QKBDYOPY_QWS_H diff --git a/src/gui/embedded/qmousebus_qws.cpp b/src/gui/embedded/qmousebus_qws.cpp deleted file mode 100644 index 0b674b6..0000000 --- a/src/gui/embedded/qmousebus_qws.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmousebus_qws.h" - -#ifndef QT_NO_QWS_MOUSE_BUS - -#include "qwindowsystem_qws.h" -#include "qsocketnotifier.h" - -#include "qapplication.h" -#include // overrides QT_OPEN - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -/* - * bus mouse driver (a.k.a. Logitech busmouse) - */ - -class QWSBusMouseHandlerPrivate : public QObject -{ - Q_OBJECT -public: - QWSBusMouseHandlerPrivate(QWSBusMouseHandler *h, const QString &driver, const QString &device); - ~QWSBusMouseHandlerPrivate(); - - void suspend(); - void resume(); - -private slots: - void readMouseData(); - -protected: - enum { mouseBufSize = 128 }; - QWSBusMouseHandler *handler; - QSocketNotifier *mouseNotifier; - int mouseFD; - int mouseIdx; - int obstate; - uchar mouseBuf[mouseBufSize]; -}; - -QWSBusMouseHandler::QWSBusMouseHandler(const QString &driver, const QString &device) - : QWSMouseHandler(driver, device) -{ - d = new QWSBusMouseHandlerPrivate(this, driver, device); -} - -QWSBusMouseHandler::~QWSBusMouseHandler() -{ - delete d; -} - -void QWSBusMouseHandler::suspend() -{ - d->suspend(); -} - -void QWSBusMouseHandler::resume() -{ - d->resume(); -} - - -QWSBusMouseHandlerPrivate::QWSBusMouseHandlerPrivate(QWSBusMouseHandler *h, - const QString &, const QString &device) - : handler(h) - -{ - QString mouseDev = device; - if (mouseDev.isEmpty()) - mouseDev = QLatin1String("/dev/mouse"); - obstate = -1; - mouseFD = -1; - mouseFD = QT_OPEN(mouseDev.toLocal8Bit(), O_RDWR | O_NDELAY); - if (mouseFD < 0) - mouseFD = QT_OPEN(mouseDev.toLocal8Bit(), O_RDONLY | O_NDELAY); - if (mouseFD < 0) - qDebug("Cannot open %s (%s)", qPrintable(mouseDev), strerror(errno)); - - // Clear pending input - tcflush(mouseFD,TCIFLUSH); - usleep(50000); - - char buf[100]; // busmouse driver will not read if bufsize < 3, YYD - while (QT_READ(mouseFD, buf, 100) > 0) { } // eat unwanted replies - - mouseIdx = 0; - - mouseNotifier = new QSocketNotifier(mouseFD, QSocketNotifier::Read, this); - connect(mouseNotifier, SIGNAL(activated(int)),this, SLOT(readMouseData())); -} - -QWSBusMouseHandlerPrivate::~QWSBusMouseHandlerPrivate() -{ - if (mouseFD >= 0) { - tcflush(mouseFD,TCIFLUSH); // yyd. - QT_CLOSE(mouseFD); - } -} - - -void QWSBusMouseHandlerPrivate::suspend() -{ - mouseNotifier->setEnabled(false); -} - - -void QWSBusMouseHandlerPrivate::resume() -{ - mouseIdx = 0; - obstate = -1; - mouseNotifier->setEnabled(true); -} - -void QWSBusMouseHandlerPrivate::readMouseData() -{ - int n; - // It'll only read 3 bytes a time and return all other buffer zeroed, thus cause protocol errors - for (;;) { - if (mouseBufSize - mouseIdx < 3) - break; - n = QT_READ(mouseFD, mouseBuf+mouseIdx, 3); - if (n != 3) - break; - mouseIdx += 3; - } - - static const int accel_limit = 5; - static const int accel = 2; - - int idx = 0; - int bstate = 0; - int dx = 0, dy = 0; - bool sendEvent = false; - int tdx = 0, tdy = 0; - - while (mouseIdx-idx >= 3) { -#if 0 // debug - qDebug("Got mouse data"); -#endif - uchar *mb = mouseBuf+idx; - bstate = 0; - dx = 0; - dy = 0; - sendEvent = false; - if (((mb[0] & 0x04))) - bstate |= Qt::LeftButton; - if (((mb[0] & 0x01))) - bstate |= Qt::RightButton; - - dx=(signed char)mb[1]; - dy=(signed char)mb[2]; - sendEvent=true; - - if (sendEvent) { - if (qAbs(dx) > accel_limit || qAbs(dy) > accel_limit) { - dx *= accel; - dy *= accel; - } - tdx += dx; - tdy += dy; - if (bstate != obstate) { - QPoint pos = handler->pos() + QPoint(tdx,-tdy); - handler->limitToScreen(pos); - handler->mouseChanged(pos,bstate); - sendEvent = false; - tdx = 0; - tdy = 0; - obstate = bstate; - } - } - idx += 3; - } - if (sendEvent) { - QPoint pos = handler->pos() + QPoint(tdx,-tdy); - handler->limitToScreen(pos); - handler->mouseChanged(pos,bstate); - } - - int surplus = mouseIdx - idx; - for (int i = 0; i < surplus; i++) - mouseBuf[i] = mouseBuf[idx+i]; - mouseIdx = surplus; -} - -QT_END_NAMESPACE - -#include "qmousebus_qws.moc" - -#endif // QT_NO_QWS_MOUSE_BUS diff --git a/src/gui/embedded/qmousebus_qws.h b/src/gui/embedded/qmousebus_qws.h deleted file mode 100644 index 407da98..0000000 --- a/src/gui/embedded/qmousebus_qws.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMOUSEBUS_QWS_H -#define QMOUSEBUS_QWS_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#ifndef QT_NO_QWS_MOUSE_BUS - -class QWSBusMouseHandlerPrivate; - -class QWSBusMouseHandler : public QWSMouseHandler -{ -public: - explicit QWSBusMouseHandler(const QString & = QString(), - const QString & = QString()); - ~QWSBusMouseHandler(); - - void suspend(); - void resume(); -protected: - QWSBusMouseHandlerPrivate *d; -}; - -#endif // QT_NO_QWS_MOUSE_BUS - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMOUSEBUS_QWS_H diff --git a/src/gui/embedded/qmousedriverfactory_qws.cpp b/src/gui/embedded/qmousedriverfactory_qws.cpp index 7e51818..46898ae 100644 --- a/src/gui/embedded/qmousedriverfactory_qws.cpp +++ b/src/gui/embedded/qmousedriverfactory_qws.cpp @@ -43,10 +43,8 @@ #include "qapplication.h" #include "qmousepc_qws.h" -#include "qmousebus_qws.h" -#include "qmousevr41xx_qws.h" -#include "qmouseyopy_qws.h" #include "qmouselinuxtp_qws.h" +#include "qmouselinuxinput_qws.h" #include "qmousevfb_qws.h" #include "qmousetslib_qws.h" #include @@ -108,14 +106,6 @@ QWSMouseHandler *QMouseDriverFactory::create(const QString& key, const QString & if (driver == QLatin1String("linuxtp") || driver.isEmpty()) return new QWSLinuxTPMouseHandler(key, device); #endif -#ifndef QT_NO_QWS_MOUSE_YOPY - if (driver == QLatin1String("yopy") || driver.isEmpty()) - return new QWSYopyMouseHandler(key, device); -#endif -#ifndef QT_NO_QWS_MOUSE_VR41XX - if (driver == QLatin1String("vr41xx") || driver.isEmpty()) - return new QWSVr41xxMouseHandler(key, device); -#endif #ifndef QT_NO_QWS_MOUSE_PC if (driver == QLatin1String("auto") || driver == QLatin1String("intellimouse") @@ -126,14 +116,16 @@ QWSMouseHandler *QMouseDriverFactory::create(const QString& key, const QString & return new QWSPcMouseHandler(key, device); } #endif -#ifndef QT_NO_QWS_MOUSE_BUS - if (driver == QLatin1String("bus")) - return new QWSBusMouseHandler(key, device); -#endif #ifndef QT_NO_QWS_MOUSE_TSLIB if (driver == QLatin1String("tslib") || driver.isEmpty()) return new QWSTslibMouseHandler(key, device); #endif +# ifndef QT_NO_QWS_MOUSE_LINUXINPUT + if (driver == QLatin1String("linuxinput") || \ + driver == QLatin1String("usb") || \ + driver == QLatin1String("linuxis")) + return new QWSLinuxInputMouseHandler(device); +# endif #ifndef QT_NO_QWS_MOUSE_QVFB if (driver == QLatin1String("qvfbmouse") || driver == QLatin1String("qvfb")) return new QVFbMouseHandler(key, device); @@ -160,12 +152,6 @@ QStringList QMouseDriverFactory::keys() #ifndef QT_NO_QWS_MOUSE_LINUXTP list << QLatin1String("LinuxTP"); #endif -#ifndef QT_NO_QWS_MOUSE_YOPY - list << QLatin1String("Yopy"); -#endif -#ifndef QT_NO_QWS_MOUSE_VR41XX - list << QLatin1String("VR41xx"); -#endif #ifndef QT_NO_QWS_MOUSE_PC list << QLatin1String("Auto") << QLatin1String("IntelliMouse") @@ -173,12 +159,12 @@ QStringList QMouseDriverFactory::keys() << QLatin1String("MouseSystems") << QLatin1String("MouseMan"); #endif -#ifndef QT_NO_QWS_MOUSE_BUS - list << QLatin1String("Bus"); -#endif #ifndef QT_NO_QWS_MOUSE_TSLIB list << QLatin1String("Tslib"); #endif +#ifndef QT_NO_QWS_MOUSE_LINUXINPUT + list << QLatin1String("LinuxInput"); +#endif #if !defined(Q_OS_WIN32) || defined(QT_MAKEDLL) #ifndef QT_NO_LIBRARY diff --git a/src/gui/embedded/qmouselinuxinput_qws.cpp b/src/gui/embedded/qmouselinuxinput_qws.cpp new file mode 100644 index 0000000..6ea8807 --- /dev/null +++ b/src/gui/embedded/qmouselinuxinput_qws.cpp @@ -0,0 +1,205 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmouselinuxinput_qws.h" + +#include +#include + +#include +#include // overrides QT_OPEN + +#include + +#include + +QT_BEGIN_NAMESPACE + + +class QWSLinuxInputMousePrivate : public QObject +{ + Q_OBJECT +public: + QWSLinuxInputMousePrivate(QWSLinuxInputMouseHandler *, const QString &); + ~QWSLinuxInputMousePrivate(); + + void enable(bool on); + +private Q_SLOTS: + void readMouseData(); + +private: + QWSLinuxInputMouseHandler *m_handler; + QSocketNotifier * m_notify; + int m_fd; + int m_x, m_y; + int m_buttons; +}; + +QWSLinuxInputMouseHandler::QWSLinuxInputMouseHandler(const QString &device) + : QWSCalibratedMouseHandler(device) +{ + d = new QWSLinuxInputMousePrivate(this, device); +} + +QWSLinuxInputMouseHandler::~QWSLinuxInputMouseHandler() +{ + delete d; +} + +void QWSLinuxInputMouseHandler::suspend() +{ + d->enable(false); +} + +void QWSLinuxInputMouseHandler::resume() +{ + d->enable(true); +} + +QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(QWSLinuxInputMouseHandler *h, const QString &device) + : m_handler(h), m_notify(0), m_x(0), m_y(0), m_buttons(0) +{ + setObjectName(QLatin1String("LinuxInputSubsystem Mouse Handler")); + + QString dev = QLatin1String("/dev/input/event0"); + if (device.startsWith(QLatin1String("/dev/"))) + dev = device; + + m_fd = QT_OPEN(dev.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0); + if (m_fd >= 0) { + m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); + connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData())); + } else { + qWarning("Cannot open mouse input device '%s': %s", qPrintable(dev), strerror(errno)); + return; + } +} + +QWSLinuxInputMousePrivate::~QWSLinuxInputMousePrivate() +{ + if (m_fd >= 0) + QT_CLOSE(m_fd); +} + +void QWSLinuxInputMousePrivate::enable(bool on) +{ + if (m_notify) + m_notify->setEnabled(on); +} + +void QWSLinuxInputMousePrivate::readMouseData() +{ + if (!qt_screen) + return; + + struct ::input_event buffer[32]; + int n = 0; + + forever { + n = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); + + if (n == 0) { + qWarning("Got EOF from the input device."); + return; + } else if (n < 0 && (errno != EINTR && errno != EAGAIN)) { + qWarning("Could not read from input device: %s", strerror(errno)); + return; + } else if (n % sizeof(buffer[0]) == 0) { + break; + } + } + + n /= sizeof(buffer[0]); + + for (int i = 0; i < n; ++i) { + struct ::input_event *data = &buffer[i]; + + bool unknown = false; + if (data->type == EV_ABS) { + if (data->code == ABS_X) { + m_x = data->value; + } else if (data->code == ABS_Y) { + m_y = data->value; + } else { + unknown = true; + } + } else if (data->type == EV_REL) { + if (data->code == REL_X) { + m_x += data->value; + } else if (data->code == REL_Y) { + m_y += data->value; + } else { + unknown = true; + } + } else if (data->type == EV_KEY && data->code == BTN_TOUCH) { + m_buttons = data->value ? Qt::LeftButton : 0; + } else if (data->type == EV_KEY) { + int button = 0; + switch (data->code) { + case BTN_LEFT: button = Qt::LeftButton; break; + case BTN_MIDDLE: button = Qt::MidButton; break; + case BTN_RIGHT: button = Qt::RightButton; break; + } + if (data->value) + m_buttons |= button; + else + m_buttons &= ~button; + } else if (data->type == EV_SYN && data->code == SYN_REPORT) { + QPoint pos(m_x, m_y); + pos = m_handler->transform(pos); + m_handler->limitToScreen(pos); + m_handler->mouseChanged(pos, m_buttons); + } else if (data->type == EV_MSC && data->code == MSC_SCAN) { + // kernel encountered an unmapped key - just ignore it + continue; + } else { + unknown = true; + } + if (unknown) { + qWarning("unknown mouse event type=%x, code=%x, value=%x", data->type, data->code, data->value); + } + } +} + +QT_END_NAMESPACE + +#include "qmouselinuxinput_qws.moc" diff --git a/src/gui/embedded/qmouselinuxinput_qws.h b/src/gui/embedded/qmouselinuxinput_qws.h new file mode 100644 index 0000000..25e351f --- /dev/null +++ b/src/gui/embedded/qmouselinuxinput_qws.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMOUSELINUXINPUT_QWS_H +#define QMOUSELINUXINPUT_QWS_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_QWS_MOUSE_LINUXINPUT + +class QWSLinuxInputMousePrivate; + +class QWSLinuxInputMouseHandler : public QWSCalibratedMouseHandler +{ +public: + QWSLinuxInputMouseHandler(const QString &); + ~QWSLinuxInputMouseHandler(); + + void suspend(); + void resume(); + +private: + QWSLinuxInputMousePrivate *d; + + friend class QWSLinuxInputMousePrivate; +}; + +#endif // QT_NO_QWS_MOUSE_LINUXINPUT + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMOUSELINUXINPUT_QWS_H diff --git a/src/gui/embedded/qmousevr41xx_qws.cpp b/src/gui/embedded/qmousevr41xx_qws.cpp deleted file mode 100644 index b7491d9..0000000 --- a/src/gui/embedded/qmousevr41xx_qws.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmousevr41xx_qws.h" - -#ifndef QT_NO_QWS_MOUSE_VR41XX -#include "qwindowsystem_qws.h" -#include "qsocketnotifier.h" -#include "qtimer.h" -#include "qapplication.h" -#include "qscreen_qws.h" -#include -#include -#include // overrides QT_OPEN - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static const int defaultFilterSize = 3; - -class QWSVr41xxMouseHandlerPrivate : public QObject -{ - Q_OBJECT -public: - QWSVr41xxMouseHandlerPrivate(QWSVr41xxMouseHandler *, const QString &, const QString &); - ~QWSVr41xxMouseHandlerPrivate(); - - void resume(); - void suspend(); - -private slots: - void sendRelease(); - void readMouseData(); - -private: - bool getSample(); - ushort currSample[6]; - uint currLength; - - int mouseFD; - int mouseIdx; - QTimer *rtimer; - QSocketNotifier *mouseNotifier; - QWSVr41xxMouseHandler *handler; - QPoint lastPos; - bool isPressed; - int filterSize; - int pressLimit; -}; - -QWSVr41xxMouseHandler::QWSVr41xxMouseHandler(const QString &drv, const QString &dev) - : QWSCalibratedMouseHandler(drv, dev) -{ - d = new QWSVr41xxMouseHandlerPrivate(this, drv, dev); -} - -QWSVr41xxMouseHandler::~QWSVr41xxMouseHandler() -{ - delete d; -} - -void QWSVr41xxMouseHandler::resume() -{ - d->resume(); -} - -void QWSVr41xxMouseHandler::suspend() -{ - d->suspend(); -} - -QWSVr41xxMouseHandlerPrivate::QWSVr41xxMouseHandlerPrivate(QWSVr41xxMouseHandler *h, const QString &, const QString &device) - : currLength(0), handler(h) -{ - QStringList options = device.split(QLatin1String(":")); - int index = -1; - - filterSize = defaultFilterSize; - QRegExp filterRegExp(QLatin1String("filter=(\\d+)")); - index = options.indexOf(filterRegExp); - if (index != -1) { - filterSize = qMax(1, filterRegExp.cap(1).toInt()); - options.removeAt(index); - } - handler->setFilterSize(filterSize); - - pressLimit = 750; - QRegExp pressRegExp(QLatin1String("press=(\\d+)")); - index = options.indexOf(pressRegExp); - if (index != -1) { - pressLimit = filterRegExp.cap(1).toInt(); - options.removeAt(index); - } - - QString dev; - if (options.isEmpty()) - dev = QLatin1String("/dev/vrtpanel"); - else - dev = options.first(); - - if ((mouseFD = QT_OPEN(dev.toLocal8Bit().constData(), O_RDONLY)) < 0) { - qWarning("Cannot open %s (%s)", qPrintable(dev), strerror(errno)); - return; - } - sleep(1); - - if (fcntl(mouseFD, F_SETFL, O_NONBLOCK) < 0) { - qWarning("Error initializing touch panel."); - return; - } - - mouseNotifier = new QSocketNotifier(mouseFD, QSocketNotifier::Read, this); - connect(mouseNotifier, SIGNAL(activated(int)),this, SLOT(readMouseData())); - - rtimer = new QTimer(this); - rtimer->setSingleShot(true); - connect(rtimer, SIGNAL(timeout()), this, SLOT(sendRelease())); - mouseIdx = 0; -} - -QWSVr41xxMouseHandlerPrivate::~QWSVr41xxMouseHandlerPrivate() -{ - if (mouseFD >= 0) - QT_CLOSE(mouseFD); -} - -void QWSVr41xxMouseHandlerPrivate::suspend() -{ - mouseNotifier->setEnabled(false); -} - - -void QWSVr41xxMouseHandlerPrivate::resume() -{ - mouseIdx = 0; - mouseNotifier->setEnabled(true); -} - -void QWSVr41xxMouseHandlerPrivate::sendRelease() -{ - handler->sendFiltered(lastPos, Qt::NoButton); - isPressed = false; -} - -bool QWSVr41xxMouseHandlerPrivate::getSample() -{ - const int n = QT_READ(mouseFD, - reinterpret_cast(currSample) + currLength, - sizeof(currSample) - currLength); - - if (n > 0) - currLength += n; - - if (currLength < sizeof(currSample)) - return false; - - currLength = 0; - return true; -} - -void QWSVr41xxMouseHandlerPrivate::readMouseData() -{ - const int sampleLength = sizeof(currSample) / sizeof(ushort); - QVarLengthArray samples(sampleLength * filterSize); - - // Only return last 'filterSize' samples - int head = 0; - int tail = 0; - int nSamples = 0; - while (getSample()) { - if (!(currSample[0] & 0x8000) || (currSample[5] < pressLimit)) - continue; - - ushort *data = samples.data() + head * sampleLength; - memcpy(data, currSample, sizeof(currSample)); - ++nSamples; - head = (head + 1) % filterSize; - if (nSamples >= filterSize) - tail = (tail + 1) % filterSize; - } - - if (nSamples == 0) - return; - - // send mouse events - while (tail != head || filterSize == 1) { - const ushort *data = samples.data() + tail * sampleLength; - lastPos = QPoint(data[3] - data[4], data[2] - data[1]); - handler->sendFiltered(lastPos, Qt::LeftButton); - isPressed = true; - tail = (tail + 1) % filterSize; - if (filterSize == 1) - break; - } - - if (isPressed) - rtimer->start(50); // release unreliable -} - -QT_END_NAMESPACE - -#include "qmousevr41xx_qws.moc" - -#endif //QT_NO_QWS_MOUSE_VR41 diff --git a/src/gui/embedded/qmousevr41xx_qws.h b/src/gui/embedded/qmousevr41xx_qws.h deleted file mode 100644 index 46d07e0..0000000 --- a/src/gui/embedded/qmousevr41xx_qws.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMOUSEVR41XX_QWS_H -#define QMOUSEVR41XX_QWS_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#ifndef QT_NO_QWS_MOUSE_VR41XX - -class QWSVr41xxMouseHandlerPrivate; - -class QWSVr41xxMouseHandler : public QWSCalibratedMouseHandler -{ -public: - explicit QWSVr41xxMouseHandler(const QString & = QString(), - const QString & = QString()); - ~QWSVr41xxMouseHandler(); - - void resume(); - void suspend(); - -protected: - QWSVr41xxMouseHandlerPrivate *d; - -private: - friend class QWSVr41xxMouseHandlerPrivate; -}; - -#endif // QT_NO_QWS_MOUSE_VR41XX - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMOUSEVR41XX_QWS_H diff --git a/src/gui/embedded/qmouseyopy_qws.cpp b/src/gui/embedded/qmouseyopy_qws.cpp deleted file mode 100644 index 3a541d3..0000000 --- a/src/gui/embedded/qmouseyopy_qws.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmouseyopy_qws.h" - -#ifndef QT_NO_QWS_MOUSE_YOPY -#include "qwindowsystem_qws.h" -#include "qsocketnotifier.h" -#include "qapplication.h" -#include "qscreen_qws.h" -#include // overrides QT_OPEN - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QWSYopyMouseHandlerPrivate : public QObject -{ - Q_OBJECT -public: - QWSYopyMouseHandlerPrivate(QWSYopyMouseHandler *h); - ~QWSYopyMouseHandlerPrivate(); - - void suspend(); - void resume(); - -private slots: - void readMouseData(); - -private: - int mouseFD; - int prevstate; - QSocketNotifier *mouseNotifier; - QWSYopyMouseHandler *handler; -}; - -QWSYopyMouseHandler::QWSYopyMouseHandler(const QString &driver, const QString &device) - : QWSMouseHandler(driver, device) -{ - d = new QWSYopyMouseHandlerPrivate(this); -} - -QWSYopyMouseHandler::~QWSYopyMouseHandler() -{ - delete d; -} - -void QWSYopyMouseHandler::resume() -{ - d->resume(); -} - -void QWSYopyMouseHandler::suspend() -{ - d->suspend(); -} - -QWSYopyMouseHandlerPrivate::QWSYopyMouseHandlerPrivate(QWSYopyMouseHandler *h) - : handler(h) -{ - if ((mouseFD = QT_OPEN("/dev/ts", O_RDONLY)) < 0) { - qWarning("Cannot open /dev/ts (%s)", strerror(errno)); - return; - } else { - sleep(1); - } - prevstate=0; - mouseNotifier = new QSocketNotifier(mouseFD, QSocketNotifier::Read, - this); - connect(mouseNotifier, SIGNAL(activated(int)),this, SLOT(readMouseData())); -} - -QWSYopyMouseHandlerPrivate::~QWSYopyMouseHandlerPrivate() -{ - if (mouseFD >= 0) - QT_CLOSE(mouseFD); -} - -#define YOPY_XPOS(d) (d[1]&0x3FF) -#define YOPY_YPOS(d) (d[2]&0x3FF) -#define YOPY_PRES(d) (d[0]&0xFF) -#define YOPY_STAT(d) (d[3]&0x01) - -struct YopyTPdata { - - unsigned char status; - unsigned short xpos; - unsigned short ypos; - -}; - -void QWSYopyMouseHandlerPrivate::suspend() -{ - mouseNotifier->setEnabled(false); -} - - -void QWSYopyMouseHandlerPrivate::resume() -{ - prevstate = 0; - mouseNotifier->setEnabled(true); -} - -void QWSYopyMouseHandlerPrivate::readMouseData() -{ - if(!qt_screen) - return; - YopyTPdata data; - - unsigned int yopDat[4]; - - int ret; - - ret=QT_READ(mouseFD,&yopDat,sizeof(yopDat)); - - if(ret) { - data.status= (YOPY_PRES(yopDat)) ? 1 : 0; - data.xpos=YOPY_XPOS(yopDat); - data.ypos=YOPY_YPOS(yopDat); - QPoint q; - q.setX(data.xpos); - q.setY(data.ypos); - if (data.status && !prevstate) { - handler->mouseChanged(q,Qt::LeftButton); - } else if(!data.status && prevstate) { - handler->mouseChanged(q,0); - } - prevstate = data.status; - } - if(ret<0) { - qDebug("Error %s",strerror(errno)); - } -} - -QT_END_NAMESPACE - -#include "qmouseyopy_qws.moc" - -#endif //QT_NO_QWS_MOUSE_YOPY diff --git a/src/gui/embedded/qmouseyopy_qws.h b/src/gui/embedded/qmouseyopy_qws.h deleted file mode 100644 index 0d24a8f..0000000 --- a/src/gui/embedded/qmouseyopy_qws.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMOUSEYOPY_QWS_H -#define QMOUSEYOPY_QWS_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#ifndef QT_NO_QWS_MOUSE_YOPY - -// YOPY touch panel support based on changes contributed by Ron Victorelli -// (victorrj at icubed.com) to Custom TP driver. - -class QWSYopyMouseHandlerPrivate; - -class QWSYopyMouseHandler : public QWSMouseHandler -{ -public: - explicit QWSYopyMouseHandler(const QString & = QString(), - const QString & = QString()); - ~QWSYopyMouseHandler(); - - void resume(); - void suspend(); - -protected: - QWSYopyMouseHandlerPrivate *d; -}; - -#endif // QT_NO_QWS_MOUSE_YOPY - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMOUSEYOPY_QWS_H diff --git a/src/plugins/kbddrivers/kbddrivers.pro b/src/plugins/kbddrivers/kbddrivers.pro index a34b780..dbab47b 100644 --- a/src/plugins/kbddrivers/kbddrivers.pro +++ b/src/plugins/kbddrivers/kbddrivers.pro @@ -1,5 +1,2 @@ TEMPLATE = subdirs contains(kbd-plugins, linuxinput): SUBDIRS += linuxinput -contains(kbd-plugins, sl5000): SUBDIRS += sl5000 -contains(kbd-plugins, vr41xx): SUBDIRS += vr41xx -contains(kbd-plugins, yopy): SUBDIRS += yopy diff --git a/src/plugins/kbddrivers/sl5000/main.cpp b/src/plugins/kbddrivers/sl5000/main.cpp deleted file mode 100644 index cc68747..0000000 --- a/src/plugins/kbddrivers/sl5000/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -QT_BEGIN_NAMESPACE - -class QSL5000KbdDriver : public QKbdDriverPlugin -{ -public: - QSL5000KbdDriver(); - - QStringList keys() const; - QWSKeyboardHandler* create(const QString &driver, const QString &device); -}; - -QSL5000KbdDriver::QSL5000KbdDriver() - : QKbdDriverPlugin() -{ -} - -QStringList QSL5000KbdDriver::keys() const -{ - return (QStringList() << QLatin1String("SL5000")); -} - -QWSKeyboardHandler* QSL5000KbdDriver::create(const QString &driver, - const QString &device) -{ - if (driver.compare(QLatin1String("SL5000"), Qt::CaseInsensitive)) - return 0; - return new QWSSL5000KeyboardHandler(device); -} - -Q_EXPORT_PLUGIN2(qwssl5000kbddriver, QSL5000KbdDriver) - -QT_END_NAMESPACE diff --git a/src/plugins/kbddrivers/sl5000/sl5000.pro b/src/plugins/kbddrivers/sl5000/sl5000.pro deleted file mode 100644 index e52cf0d..0000000 --- a/src/plugins/kbddrivers/sl5000/sl5000.pro +++ /dev/null @@ -1,16 +0,0 @@ -TARGET = qsl5000kbddriver -include(../../qpluginbase.pri) - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers -target.path = $$[QT_INSTALL_PLUGINS]/kbddrivers -INSTALLS += target - -DEFINES += QT_QWS_KBD_SL5000 QT_QWS_KBD_TTY - -HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qkbdsl5000_qws.h \ - $$QT_SOURCE_TREE/src/gui/embedded/qkbdtty_qws.h - -SOURCES = main.cpp \ - $$QT_SOURCE_TREE/src/gui/embedded/qkbdsl5000_qws.cpp \ - $$QT_SOURCE_TREE/src/gui/embedded/qkbdtty_qws.cpp - diff --git a/src/plugins/kbddrivers/vr41xx/main.cpp b/src/plugins/kbddrivers/vr41xx/main.cpp deleted file mode 100644 index c9ba4d7..0000000 --- a/src/plugins/kbddrivers/vr41xx/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -QT_BEGIN_NAMESPACE - -class QVr41xxKbdDriver : public QKbdDriverPlugin -{ -public: - QVr41xxKbdDriver(); - - QStringList keys() const; - QWSKeyboardHandler* create(const QString &driver, const QString &device); -}; - -QVr41xxKbdDriver::QVr41xxKbdDriver() - : QKbdDriverPlugin() -{ -} - -QStringList QVr41xxKbdDriver::keys() const -{ - return (QStringList() << QLatin1String("VR41xx")); -} - -QWSKeyboardHandler* QVr41xxKbdDriver::create(const QString &driver, - const QString &device) -{ - if (driver.compare(QLatin1String("VR41xx"), Qt::CaseInsensitive)) - return 0; - return new QWSVr41xxKeyboardHandler(device); -} - -Q_EXPORT_PLUGIN2(qwsvr41xxkbddriver, QVr41xxKbdDriver) - -QT_END_NAMESPACE diff --git a/src/plugins/kbddrivers/vr41xx/vr41xx.pro b/src/plugins/kbddrivers/vr41xx/vr41xx.pro deleted file mode 100644 index f9f103f..0000000 --- a/src/plugins/kbddrivers/vr41xx/vr41xx.pro +++ /dev/null @@ -1,14 +0,0 @@ -TARGET = qvr41xxkbddriver -include(../../qpluginbase.pri) - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers -target.path = $$[QT_INSTALL_PLUGINS]/kbddrivers -INSTALLS += target - -DEFINES += QT_QWS_KBD_VR41XX - -HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qkbdvr41xx_qws.h - -SOURCES = main.cpp \ - $$QT_SOURCE_TREE/src/gui/embedded/qkbdvr41xx_qws.cpp - diff --git a/src/plugins/kbddrivers/yopy/main.cpp b/src/plugins/kbddrivers/yopy/main.cpp deleted file mode 100644 index 7079d88..0000000 --- a/src/plugins/kbddrivers/yopy/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -QT_BEGIN_NAMESPACE - -class QYopyKbdDriver : public QKbdDriverPlugin -{ -public: - QYopyKbdDriver(); - - QStringList keys() const; - QWSKeyboardHandler* create(const QString &driver, const QString &device); -}; - -QYopyKbdDriver::QYopyKbdDriver() - : QKbdDriverPlugin() -{ -} - -QStringList QYopyKbdDriver::keys() const -{ - return (QStringList() << QLatin1String("Yopy")); -} - -QWSKeyboardHandler* QYopyKbdDriver::create(const QString &driver, - const QString &device) -{ - if (driver.compare(QLatin1String("Yopy"), Qt::CaseInsensitive)) - return 0; - return new QWSYopyKeyboardHandler(device); -} - -Q_EXPORT_PLUGIN2(qwsyopykbddriver, QYopyKbdDriver) - -QT_END_NAMESPACE diff --git a/src/plugins/kbddrivers/yopy/yopy.pro b/src/plugins/kbddrivers/yopy/yopy.pro deleted file mode 100644 index 66a663c..0000000 --- a/src/plugins/kbddrivers/yopy/yopy.pro +++ /dev/null @@ -1,14 +0,0 @@ -TARGET = qyopykbddriver -include(../../qpluginbase.pri) - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers -target.path = $$[QT_INSTALL_PLUGINS]/kbddrivers -INSTALLS += target - -DEFINES += QT_QWS_KBD_YOPY - -HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qkbdyopy_qws.h - -SOURCES = main.cpp \ - $$QT_SOURCE_TREE/src/gui/embedded/qkbdyopy_qws.cpp - diff --git a/src/plugins/mousedrivers/bus/bus.pro b/src/plugins/mousedrivers/bus/bus.pro deleted file mode 100644 index cdb0332..0000000 --- a/src/plugins/mousedrivers/bus/bus.pro +++ /dev/null @@ -1,14 +0,0 @@ -TARGET = qbusmousedriver -include(../../qpluginbase.pri) - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers -target.path = $$[QT_INSTALL_PLUGINS]/mousedrivers -INSTALLS += target - -DEFINES += QT_QWS_MOUSE_BUS - -HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qmousebus_qws.h - -SOURCES = main.cpp \ - $$QT_SOURCE_TREE/src/gui/embedded/qmousebus_qws.cpp - diff --git a/src/plugins/mousedrivers/bus/main.cpp b/src/plugins/mousedrivers/bus/main.cpp deleted file mode 100644 index f56c890..0000000 --- a/src/plugins/mousedrivers/bus/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -QT_BEGIN_NAMESPACE - -class QBusMouseDriver : public QMouseDriverPlugin -{ -public: - QBusMouseDriver(); - - QStringList keys() const; - QWSMouseHandler* create(const QString &driver, const QString &device); -}; - -QBusMouseDriver::QBusMouseDriver() - : QMouseDriverPlugin() -{ -} - -QStringList QBusMouseDriver::keys() const -{ - return (QStringList() << "Bus"); -} - -QWSMouseHandler* QBusMouseDriver::create(const QString &driver, - const QString &device) -{ - if (driver.compare(QLatin1String("Bus"), Qt::CaseInsensitive)) - return 0; - return new QWSBusMouseHandler(driver, device); -} - -Q_EXPORT_PLUGIN2(qwsbusmousehandler, QBusMouseDriver) - -QT_END_NAMESPACE diff --git a/src/plugins/mousedrivers/linuxis/linuxis.pro b/src/plugins/mousedrivers/linuxis/linuxis.pro deleted file mode 100644 index bcc209b..0000000 --- a/src/plugins/mousedrivers/linuxis/linuxis.pro +++ /dev/null @@ -1,10 +0,0 @@ -TARGET = linuxismousehandler -include(../../qpluginbase.pri) - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers -target.path = $$[QT_INSTALL_PLUGINS]/mousedrivers -INSTALLS += target - -HEADERS = linuxismousedriverplugin.h linuxismousehandler.h -SOURCES = linuxismousedriverplugin.cpp linuxismousehandler.cpp - diff --git a/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.cpp b/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.cpp deleted file mode 100644 index 4d530d9..0000000 --- a/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "linuxismousedriverplugin.h" -#include "linuxismousehandler.h" - -#include -#if 1 -#define qLog(x) qDebug() -#else -#define qLog(x) while (0) qDebug() -#endif -LinuxInputSubsystemMouseDriverPlugin::LinuxInputSubsystemMouseDriverPlugin( QObject *parent ) - : QMouseDriverPlugin( parent ) -{ -} - -LinuxInputSubsystemMouseDriverPlugin::~LinuxInputSubsystemMouseDriverPlugin() -{ -} - -QWSMouseHandler* LinuxInputSubsystemMouseDriverPlugin::create(const QString& driver, const QString& device) -{ - if ( driver.toLower() == "linuxis" ) { - qLog(Input) << "Before call LinuxInputSubsystemMouseHandler()"; - return new LinuxInputSubsystemMouseHandler(device); - } - return 0; -} - -QWSMouseHandler* LinuxInputSubsystemMouseDriverPlugin::create(const QString& driver) -{ - if( driver.toLower() == "linuxis" ) { - qLog(Input) << "Before call LinuxInputSubsystemMouseHandler()"; - return new LinuxInputSubsystemMouseHandler(); - } - return 0; -} - -QStringList LinuxInputSubsystemMouseDriverPlugin::keys() const -{ - return QStringList() << "linuxis"; -} - -Q_EXPORT_PLUGIN2(qwslinuxismousehandler, LinuxInputSubsystemMouseDriverPlugin) diff --git a/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.h b/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.h deleted file mode 100644 index 57759c5..0000000 --- a/src/plugins/mousedrivers/linuxis/linuxismousedriverplugin.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LINUXISMOUSEDRIVERPLUGIN_H -#define LINUXISMOUSEDRIVERPLUGIN_H - -#include - -class LinuxInputSubsystemMouseDriverPlugin : public QMouseDriverPlugin { - Q_OBJECT -public: - LinuxInputSubsystemMouseDriverPlugin( QObject *parent = 0 ); - ~LinuxInputSubsystemMouseDriverPlugin(); - - QWSMouseHandler* create(const QString& driver); - QWSMouseHandler* create(const QString& driver, const QString& device); - QStringList keys()const; -}; - -#endif // LINUXISMOUSEDRIVERPLUGIN_H diff --git a/src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp b/src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp deleted file mode 100644 index aaa6eae..0000000 --- a/src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "linuxismousehandler.h" - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include - - -#if 1 -#define qLog(x) qDebug() -#else -#define qLog(x) while (0) qDebug() -#endif - - -// sanity check values of the range of possible mouse positions -#define MOUSE_SAMPLE_MIN 0 -#define MOUSE_SAMPLE_MAX 2000 - -LinuxInputSubsystemMouseHandler::LinuxInputSubsystemMouseHandler(const QString &device) - : mouseX(0), mouseY(0), mouseBtn(0), mouseIdx(0) -{ - qLog(Input) << "Loaded LinuxInputSubsystem touchscreen plugin!"; - setObjectName("LinuxInputSubsystem Mouse Handler"); - mouseFd = ::open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY); - // mouseFd = ::open(device.toLocal8Bit().constData(), O_RDONLY); - if (mouseFd >= 0) { - qLog(Input) << "Opened" << device << "as touchscreen input"; - m_notify = new QSocketNotifier(mouseFd, QSocketNotifier::Read, this); - connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData())); - } else { - qWarning("Cannot open %s for touchscreen input (%s)", - device.toLocal8Bit().constData(), strerror(errno)); - return; - } -} - -LinuxInputSubsystemMouseHandler::~LinuxInputSubsystemMouseHandler() -{ - if (mouseFd >= 0) - ::close(mouseFd); -} - -void LinuxInputSubsystemMouseHandler::suspend() -{ - m_notify->setEnabled( false ); -} - -void LinuxInputSubsystemMouseHandler::resume() -{ - m_notify->setEnabled( true ); -} - -void LinuxInputSubsystemMouseHandler::readMouseData() -{ - if (!qt_screen) - return; - - int n; - - do { - n = read(mouseFd, mouseBuf + mouseIdx, mouseBufSize - mouseIdx); - if (n > 0) - mouseIdx += n; - - struct input_event *data; - int idx = 0; - - while (mouseIdx-idx >= (int)sizeof(struct input_event)) { - uchar *mb = mouseBuf + idx; - data = (struct input_event *) mb; - // qLog(Input) << "mouse event type =" << data->type << "code =" << data->code << "value =" << data->value; - bool unknown = false; - if (data->type == EV_ABS) { - if (data->code == ABS_X) { - //qLog(Input) << "\tABS_X" << data->value; - mouseX = data->value; - } else if (data->code == ABS_Y) { - //qLog(Input) << "\tABS_Y" << data->value; - mouseY = data->value; - } else { - unknown = true; - } - } else if (data->type == EV_REL) { - //qLog(Input) << "\tEV_REL" << hex << data->code << dec << data->value; - if (data->code == REL_X) { - mouseX += data->value; - } else if (data->code == REL_Y) { - mouseY += data->value; - } else { - unknown = true; - } - } else if (data->type == EV_KEY && data->code == BTN_TOUCH) { - qLog(Input) << "\tBTN_TOUCH" << data->value; - mouseBtn = data->value ? Qt::LeftButton : 0; - } else if (data->type == EV_KEY) { - int button = 0; - switch (data->code) { - case BTN_LEFT: button = Qt::LeftButton; break; - case BTN_MIDDLE: button = Qt::MidButton; break; - case BTN_RIGHT: button = Qt::RightButton; break; - } - if (data->value) - mouseBtn |= button; - else - mouseBtn &= ~button; - } else if (data->type == EV_SYN && data->code == SYN_REPORT) { - QPoint pos( mouseX, mouseY ); - oldmouse = transform( pos ); - //qLog(Input) << "\tSYN_REPORT" << mouseBtn << pos << oldmouse; - emit mouseChanged(oldmouse, mouseBtn); - - } else { - unknown = true; - } - if (unknown) { - qWarning("unknown mouse event type=%x, code=%x, value=%x", data->type, data->code, data->value); - } - idx += sizeof(struct input_event); - } - int surplus = mouseIdx - idx; - for (int i = 0; i < surplus; i++) - mouseBuf[i] = mouseBuf[idx+i]; - mouseIdx = surplus; - } while (n > 0); -} - diff --git a/src/plugins/mousedrivers/linuxis/linuxismousehandler.h b/src/plugins/mousedrivers/linuxis/linuxismousehandler.h deleted file mode 100644 index c898ddb..0000000 --- a/src/plugins/mousedrivers/linuxis/linuxismousehandler.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LINUXISMOUSEHANDLER_H -#define LINUXISMOUSEHANDLER_H - -#include - -class QSocketNotifier; -class LinuxInputSubsystemMouseHandler : public QObject, public QWSCalibratedMouseHandler { - Q_OBJECT -public: - LinuxInputSubsystemMouseHandler(const QString &device = QString("/dev/input/event0")); - ~LinuxInputSubsystemMouseHandler(); - - void suspend(); - void resume(); - -private: - int mouseX, mouseY; - int mouseBtn; - static const int mouseBufSize = 2048; - uchar mouseBuf[mouseBufSize]; - int mouseIdx; - QPoint oldmouse; - - QSocketNotifier *m_notify; - int mouseFd; - -private Q_SLOTS: - void readMouseData(); -}; - -#endif // LINUXISMOUSEHANDLER_H diff --git a/src/plugins/mousedrivers/mousedrivers.pro b/src/plugins/mousedrivers/mousedrivers.pro index e644361..f89682b 100644 --- a/src/plugins/mousedrivers/mousedrivers.pro +++ b/src/plugins/mousedrivers/mousedrivers.pro @@ -1,8 +1,5 @@ TEMPLATE = subdirs -contains(mouse-plugins, bus): SUBDIRS += bus contains(mouse-plugins, linuxtp): SUBDIRS += linuxtp contains(mouse-plugins, pc): SUBDIRS += pc contains(mouse-plugins, tslib): SUBDIRS += tslib -contains(mouse-plugins, vr41xx): SUBDIRS += vr41xx -contains(mouse-plugins, yopy): SUBDIRS += yopy -contains(mouse-plugins, linuxis): SUBDIRS += linuxis +contains(mouse-plugins, linuxinput): SUBDIRS += linuxinput diff --git a/src/plugins/mousedrivers/vr41xx/main.cpp b/src/plugins/mousedrivers/vr41xx/main.cpp deleted file mode 100644 index 8802a02..0000000 --- a/src/plugins/mousedrivers/vr41xx/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -QT_BEGIN_NAMESPACE - -class QVr41xxMouseDriver : public QMouseDriverPlugin -{ -public: - QVr41xxMouseDriver(); - - QStringList keys() const; - QWSMouseHandler* create(const QString &driver, const QString &device); -}; - -QVr41xxMouseDriver::QVr41xxMouseDriver() - : QMouseDriverPlugin() -{ -} - -QStringList QVr41xxMouseDriver::keys() const -{ - return (QStringList() << QLatin1String("VR41xx")); -} - -QWSMouseHandler* QVr41xxMouseDriver::create(const QString &driver, - const QString &device) -{ - if (driver.compare(QLatin1String("VR41xx"), Qt::CaseInsensitive)) - return 0; - return new QWSVr41xxMouseHandler(driver, device); -} - -Q_EXPORT_PLUGIN2(qwsvr41xxmousehandler, QVr41xxMouseDriver) - -QT_END_NAMESPACE diff --git a/src/plugins/mousedrivers/vr41xx/vr41xx.pro b/src/plugins/mousedrivers/vr41xx/vr41xx.pro deleted file mode 100644 index 1c22d04..0000000 --- a/src/plugins/mousedrivers/vr41xx/vr41xx.pro +++ /dev/null @@ -1,14 +0,0 @@ -TARGET = qvr41xxmousedriver -include(../../qpluginbase.pri) - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers -target.path = $$[QT_INSTALL_PLUGINS]/mousedrivers -INSTALLS += target - -DEFINES += QT_QWS_MOUSE_VR41XX - -HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qmousevr41xx_qws.h - -SOURCES = main.cpp \ - $$QT_SOURCE_TREE/src/gui/embedded/qmousevr41xx_qws.cpp - diff --git a/src/plugins/mousedrivers/yopy/main.cpp b/src/plugins/mousedrivers/yopy/main.cpp deleted file mode 100644 index 9db9c4f..0000000 --- a/src/plugins/mousedrivers/yopy/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -QT_BEGIN_NAMESPACE - -class QYopyMouseDriver : public QMouseDriverPlugin -{ -public: - QYopyMouseDriver(); - - QStringList keys() const; - QWSMouseHandler* create(const QString &driver, const QString &device); -}; - -QYopyMouseDriver::QYopyMouseDriver() - : QMouseDriverPlugin() -{ -} - -QStringList QYopyMouseDriver::keys() const -{ - return (QStringList() << QLatin1String("Yopy")); -} - -QWSMouseHandler* QYopyMouseDriver::create(const QString &driver, - const QString &device) -{ - if (driver.compare(QLatin1String("yopy"), Qt::CaseInsensitive)) - return 0; - return new QWSYopyMouseHandler(driver, device); -} - -Q_EXPORT_PLUGIN2(qwsyopymousehandler, QYopyMouseDriver) - -QT_END_NAMESPACE diff --git a/src/plugins/mousedrivers/yopy/yopy.pro b/src/plugins/mousedrivers/yopy/yopy.pro deleted file mode 100644 index 3045430..0000000 --- a/src/plugins/mousedrivers/yopy/yopy.pro +++ /dev/null @@ -1,14 +0,0 @@ -TARGET = qyopymousedriver -include(../../qpluginbase.pri) - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers -target.path = $$[QT_INSTALL_PLUGINS]/mousedrivers -INSTALLS += target - -DEFINES += QT_QWS_MOUSE_YOPY - -HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qmouseyopy_qws.h - -SOURCES = main.cpp \ - $$QT_SOURCE_TREE/src/gui/embedded/qmouseyopy_qws.cpp - -- cgit v0.12