diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-23 09:18:55 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-23 09:18:55 (GMT) |
commit | e5fcad302d86d316390c6b0f62759a067313e8a9 (patch) | |
tree | c2afbf6f1066b6ce261f14341cf6d310e5595bc1 /src/plugins/kbddrivers | |
download | Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.zip Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.gz Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.bz2 |
Long live Qt 4.5!
Diffstat (limited to 'src/plugins/kbddrivers')
-rw-r--r-- | src/plugins/kbddrivers/kbddrivers.pro | 6 | ||||
-rw-r--r-- | src/plugins/kbddrivers/linuxis/README | 1 | ||||
-rw-r--r-- | src/plugins/kbddrivers/linuxis/linuxis.pro | 11 | ||||
-rw-r--r-- | src/plugins/kbddrivers/linuxis/linuxiskbddriverplugin.cpp | 87 | ||||
-rw-r--r-- | src/plugins/kbddrivers/linuxis/linuxiskbddriverplugin.h | 58 | ||||
-rw-r--r-- | src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp | 171 | ||||
-rw-r--r-- | src/plugins/kbddrivers/linuxis/linuxiskbdhandler.h | 80 | ||||
-rw-r--r-- | src/plugins/kbddrivers/sl5000/main.cpp | 77 | ||||
-rw-r--r-- | src/plugins/kbddrivers/sl5000/sl5000.pro | 16 | ||||
-rw-r--r-- | src/plugins/kbddrivers/usb/main.cpp | 77 | ||||
-rw-r--r-- | src/plugins/kbddrivers/usb/usb.pro | 14 | ||||
-rw-r--r-- | src/plugins/kbddrivers/vr41xx/main.cpp | 77 | ||||
-rw-r--r-- | src/plugins/kbddrivers/vr41xx/vr41xx.pro | 14 | ||||
-rw-r--r-- | src/plugins/kbddrivers/yopy/main.cpp | 77 | ||||
-rw-r--r-- | src/plugins/kbddrivers/yopy/yopy.pro | 14 |
15 files changed, 780 insertions, 0 deletions
diff --git a/src/plugins/kbddrivers/kbddrivers.pro b/src/plugins/kbddrivers/kbddrivers.pro new file mode 100644 index 0000000..6605972 --- /dev/null +++ b/src/plugins/kbddrivers/kbddrivers.pro @@ -0,0 +1,6 @@ +TEMPLATE = subdirs +contains(kbd-plugins, usb): SUBDIRS += usb +contains(kbd-plugins, sl5000): SUBDIRS += sl5000 +contains(kbd-plugins, vr41xx): SUBDIRS += vr41xx +contains(kbd-plugins, yopy): SUBDIRS += yopy +contains(kbd-plugins, linuxis): SUBDIRS += linuxis diff --git a/src/plugins/kbddrivers/linuxis/README b/src/plugins/kbddrivers/linuxis/README new file mode 100644 index 0000000..37a9a89 --- /dev/null +++ b/src/plugins/kbddrivers/linuxis/README @@ -0,0 +1 @@ +This is a keypad/only keyboard driver based on the Linux input subsystem. diff --git a/src/plugins/kbddrivers/linuxis/linuxis.pro b/src/plugins/kbddrivers/linuxis/linuxis.pro new file mode 100644 index 0000000..5e652b5 --- /dev/null +++ b/src/plugins/kbddrivers/linuxis/linuxis.pro @@ -0,0 +1,11 @@ +TARGET = linuxiskbdhandler +include(../../qpluginbase.pri) + +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers +target.path = $$[QT_INSTALL_PLUGINS]/kbddrivers +INSTALLS += target + +CONFIG+=no_tr + +HEADERS = linuxiskbddriverplugin.h linuxiskbdhandler.h +SOURCES = linuxiskbddriverplugin.cpp linuxiskbdhandler.cpp diff --git a/src/plugins/kbddrivers/linuxis/linuxiskbddriverplugin.cpp b/src/plugins/kbddrivers/linuxis/linuxiskbddriverplugin.cpp new file mode 100644 index 0000000..79cd298 --- /dev/null +++ b/src/plugins/kbddrivers/linuxis/linuxiskbddriverplugin.cpp @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "linuxiskbddriverplugin.h" +#include "linuxiskbdhandler.h" + +#include <qdebug.h> +#if 1 +#define qLog(x) qDebug() +#else +#define qLog(x) while (0) qDebug() +#endif + +LinuxInputSubsystemKbdDriverPlugin::LinuxInputSubsystemKbdDriverPlugin( QObject *parent ) + : QKbdDriverPlugin( parent ) +{ +} + +LinuxInputSubsystemKbdDriverPlugin::~LinuxInputSubsystemKbdDriverPlugin() +{ +} + +QWSKeyboardHandler* LinuxInputSubsystemKbdDriverPlugin::create(const QString &driver, const QString &device) +{ + if (device.isEmpty()) { + return create( driver ); + } + if( driver.toLower() == "linuxis" || driver.toLower() == "linuxiskbdhandler" ) { + qLog(Input) << "Before call LinuxInputSubsystemKbdHandler(" << device << ")"; + return new LinuxInputSubsystemKbdHandler(device); + } + return 0; +} + +QWSKeyboardHandler* LinuxInputSubsystemKbdDriverPlugin::create( const QString &driver) +{ + if( driver.toLower() == "linuxis" || driver.toLower() == "linuxiskbdhandler" ) { + qLog(Input) << "Before call LinuxInputSubsystemKbdHandler()"; + return new LinuxInputSubsystemKbdHandler(); + } + return 0; +} + +QStringList LinuxInputSubsystemKbdDriverPlugin::keys() const +{ + return QStringList() << "linuxis" << "linuxiskbdhandler"; +} + +Q_EXPORT_PLUGIN2(qwslinuxiskbdhandler, LinuxInputSubsystemKbdDriverPlugin) diff --git a/src/plugins/kbddrivers/linuxis/linuxiskbddriverplugin.h b/src/plugins/kbddrivers/linuxis/linuxiskbddriverplugin.h new file mode 100644 index 0000000..b5f599f --- /dev/null +++ b/src/plugins/kbddrivers/linuxis/linuxiskbddriverplugin.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LINUXISKBDDRIVERPLUGIN_H +#define LINUXISKBDDRIVERPLUGIN_H + +#include <QtGui/QWSKeyboardHandlerFactoryInterface> + +class LinuxInputSubsystemKbdDriverPlugin : public QKbdDriverPlugin { + Q_OBJECT +public: + LinuxInputSubsystemKbdDriverPlugin( QObject *parent = 0 ); + ~LinuxInputSubsystemKbdDriverPlugin(); + + QWSKeyboardHandler* create(const QString& driver, const QString& device); + QWSKeyboardHandler* create(const QString& driver); + QStringList keys()const; +}; + +#endif // LINUXISKBDDRIVERPLUGIN_H diff --git a/src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp b/src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp new file mode 100644 index 0000000..99b98b7 --- /dev/null +++ b/src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp @@ -0,0 +1,171 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "linuxiskbdhandler.h" + +#include <QSocketNotifier> + +#include <stdlib.h> +#include <fcntl.h> +#include <unistd.h> +#include <errno.h> +#include <string.h> + +#include <linux/input.h> +#include <linux/kd.h> + +#include <qdebug.h> +#if 1 +#define qLog(x) qDebug() +#else +#define qLog(x) while (0) qDebug() +#endif + +struct LinuxInputSubsystemKbdHandler::keytable_s LinuxInputSubsystemKbdHandler::keytable[] = { + { KEY_PAGEDOWN, 0xffff, Qt::Key_Context1 }, + { KEY_END, 0xffff, Qt::Key_Back }, + { KEY_RIGHTCTRL, 0xffff, Qt::Key_Home }, + { KEY_SPACE, 0xffff, Qt::Key_Menu }, + { KEY_ENTER, 0xffff, Qt::Key_Select }, + { KEY_UP, 0xffff, Qt::Key_Up }, + { KEY_LEFT, 0xffff, Qt::Key_Left }, + { KEY_RIGHT, 0xffff, Qt::Key_Right }, + { KEY_DOWN, 0xffff, Qt::Key_Down }, + { KEY_POWER, 0xffff, Qt::Key_Call }, + { KEY_BACKSPACE, 0xffff, Qt::Key_Backspace }, + { KEY_F1, 0xffff, Qt::Key_Hangup }, + { KEY_KP1, '1', Qt::Key_1 }, + { KEY_KP2, '2', Qt::Key_2 }, + { KEY_KP3, '3', Qt::Key_3 }, + { KEY_KP4, '4', Qt::Key_4 }, + { KEY_KP5, '5', Qt::Key_5 }, + { KEY_KP6, '6', Qt::Key_6 }, + { KEY_KP7, '7', Qt::Key_7 }, + { KEY_KP8, '8', Qt::Key_8 }, + { KEY_KP9, '9', Qt::Key_9 }, + { KEY_KP0, '0', Qt::Key_0 }, + { KEY_APOSTROPHE, '*', Qt::Key_Asterisk }, + { KEY_3, '#', Qt::Key_NumberSign }, + { KEY_F2, 0xffff, Qt::Key_F2 }, + { KEY_F3, 0xffff, Qt::Key_F3 }, + { KEY_F4, 0xffff, Qt::Key_F4 }, + { KEY_F5, 0xffff, Qt::Key_F5 }, + { KEY_F6, 0xffff, Qt::Key_F6 }, + { KEY_F7, 0xffff, Qt::Key_VolumeUp }, + { KEY_F8, 0xffff, Qt::Key_VolumeDown }, + { KEY_F9, 0xffff, Qt::Key_F9 }, + { 0, 0, Qt::Key_unknown }, +}; + +struct LinuxInputSubsystemKbdHandler::keymap_s LinuxInputSubsystemKbdHandler::keymap[KEY_MAX]; + +LinuxInputSubsystemKbdHandler::LinuxInputSubsystemKbdHandler(const QString &device) +{ + qLog(Input) << "Loaded LinuxInputSubsystem keypad plugin!"; + setObjectName( "LinuxInputSubsystem Keypad Handler" ); + kbdFD = ::open(device.toLocal8Bit().constData(), O_RDONLY, 0); + if (kbdFD >= 0) { + qLog(Input) << "Opened" << device << "as keypad input"; +#if 0 + struct kbd_repeat kbdrep; + kbdrep.delay = 500; /* ms */ + kbdrep.period = 250; /* ms */ + ioctl(kbdFD, KDKBDREP, &kbdrep); +#endif + m_notify = new QSocketNotifier( kbdFD, QSocketNotifier::Read, this ); + connect( m_notify, SIGNAL(activated(int)), this, SLOT(readKbdData())); + } else { + qWarning("Cannot open '%s' for keypad (%s)", + device.toLocal8Bit().constData(), strerror(errno)); + return; + } + shift = false; + + initmap(); +} + +LinuxInputSubsystemKbdHandler::~LinuxInputSubsystemKbdHandler() +{ +} + +void LinuxInputSubsystemKbdHandler::initmap() +{ + for (int i = 0; i < KEY_MAX; i++) { + keymap[i].unicode = 0xffff; + keymap[i].keycode = Qt::Key_unknown; + } + for (int i = 0; keytable[i].unicode; i++) { + int idx = keytable[i].code; + keymap[idx].unicode = keytable[i].unicode; + keymap[idx].keycode = keytable[i].keycode; + } +} + +void LinuxInputSubsystemKbdHandler::readKbdData() +{ + struct input_event *ie; + struct input_event iebuf[32]; + + uint n = ::read(kbdFD, iebuf, sizeof(iebuf)); + + bool pressed; + bool autorepeat; + int modifiers = 0; + int unicode, keycode; + + n /= sizeof(struct input_event); + ie = iebuf; + for (uint i = 0; i < n; i++) { + + pressed = ie->value != 0; + autorepeat = ie->value == 2; + qLog() << "keyEvent" << hex << ie->type << ie->code << ie->value; + unicode = keymap[ie->code].unicode; + keycode = keymap[ie->code].keycode; + + processKeyEvent(unicode, keycode, (Qt::KeyboardModifiers)modifiers, + pressed, autorepeat); + + ie++; + } + +} + diff --git a/src/plugins/kbddrivers/linuxis/linuxiskbdhandler.h b/src/plugins/kbddrivers/linuxis/linuxiskbdhandler.h new file mode 100644 index 0000000..3211309 --- /dev/null +++ b/src/plugins/kbddrivers/linuxis/linuxiskbdhandler.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LINUXISKBDHANDLER_H +#define LINUXISKBDHANDLER_H + +#include <QObject> +#include <QWSKeyboardHandler> + +class QSocketNotifier; +class LinuxInputSubsystemKbdHandler : public QObject, public QWSKeyboardHandler { + Q_OBJECT +public: + LinuxInputSubsystemKbdHandler(const QString &device = QString("/dev/input/event0")); + ~LinuxInputSubsystemKbdHandler(); + + struct keytable_s { + int code; + int unicode; + int keycode; + }; + + struct keymap_s { + int unicode; + int keycode; + }; + +private: + void initmap(); + + QSocketNotifier *m_notify; + int kbdFD; + bool shift; + + static struct keytable_s keytable[]; + static struct keymap_s keymap[]; + +private Q_SLOTS: + void readKbdData(); +}; + +#endif // LINUXISKBDHANDLER_H diff --git a/src/plugins/kbddrivers/sl5000/main.cpp b/src/plugins/kbddrivers/sl5000/main.cpp new file mode 100644 index 0000000..8986ebe --- /dev/null +++ b/src/plugins/kbddrivers/sl5000/main.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qkbddriverplugin_qws.h> +#include <qkbdsl5000_qws.h> + +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) +{ + Q_UNUSED(device); + if (driver.compare(QLatin1String("SL5000"), Qt::CaseInsensitive)) + return 0; + return new QWSSL5000KeyboardHandler(driver); +} + +Q_EXPORT_PLUGIN2(qwssl5000kbddriver, QSL5000KbdDriver) + +QT_END_NAMESPACE diff --git a/src/plugins/kbddrivers/sl5000/sl5000.pro b/src/plugins/kbddrivers/sl5000/sl5000.pro new file mode 100644 index 0000000..e52cf0d --- /dev/null +++ b/src/plugins/kbddrivers/sl5000/sl5000.pro @@ -0,0 +1,16 @@ +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/usb/main.cpp b/src/plugins/kbddrivers/usb/main.cpp new file mode 100644 index 0000000..1d6ab89 --- /dev/null +++ b/src/plugins/kbddrivers/usb/main.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qkbddriverplugin_qws.h> +#include <qkbdusb_qws.h> + +QT_BEGIN_NAMESPACE + +class QUsbKbdDriver : public QKbdDriverPlugin +{ +public: + QUsbKbdDriver(); + + QStringList keys() const; + QWSKeyboardHandler* create(const QString &driver, const QString &device); +}; + +QUsbKbdDriver::QUsbKbdDriver() + : QKbdDriverPlugin() +{ +} + +QStringList QUsbKbdDriver::keys() const +{ + return (QStringList() << QLatin1String("Usb")); +} + +QWSKeyboardHandler* QUsbKbdDriver::create(const QString &driver, + const QString &device) +{ + Q_UNUSED(device); + if (driver.compare(QLatin1String("Usb"), Qt::CaseInsensitive)) + return 0; + return new QWSUsbKeyboardHandler(driver); +} + +Q_EXPORT_PLUGIN2(qwsusbkbddriver, QUsbKbdDriver) + +QT_END_NAMESPACE diff --git a/src/plugins/kbddrivers/usb/usb.pro b/src/plugins/kbddrivers/usb/usb.pro new file mode 100644 index 0000000..4187255 --- /dev/null +++ b/src/plugins/kbddrivers/usb/usb.pro @@ -0,0 +1,14 @@ +TARGET = qusbkbddriver +include(../../qpluginbase.pri) + +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers +target.path = $$[QT_INSTALL_PLUGINS]/kbddrivers +INSTALLS += target + +DEFINES += QT_QWS_KBD_USB + +HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qkbdusb_qws.h + +SOURCES = main.cpp \ + $$QT_SOURCE_TREE/src/gui/embedded/qkbdusb_qws.cpp + diff --git a/src/plugins/kbddrivers/vr41xx/main.cpp b/src/plugins/kbddrivers/vr41xx/main.cpp new file mode 100644 index 0000000..9262fe7 --- /dev/null +++ b/src/plugins/kbddrivers/vr41xx/main.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qkbddriverplugin_qws.h> +#include <qkbdvr41xx_qws.h> + +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) +{ + Q_UNUSED(device); + if (driver.compare(QLatin1String("VR41xx"), Qt::CaseInsensitive)) + return 0; + return new QWSVr41xxKeyboardHandler(driver); +} + +Q_EXPORT_PLUGIN2(qwsvr41xxkbddriver, QVr41xxKbdDriver) + +QT_END_NAMESPACE diff --git a/src/plugins/kbddrivers/vr41xx/vr41xx.pro b/src/plugins/kbddrivers/vr41xx/vr41xx.pro new file mode 100644 index 0000000..f9f103f --- /dev/null +++ b/src/plugins/kbddrivers/vr41xx/vr41xx.pro @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000..766a263 --- /dev/null +++ b/src/plugins/kbddrivers/yopy/main.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qkbddriverplugin_qws.h> +#include <qkbdyopy_qws.h> + +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) +{ + Q_UNUSED(device); + if (driver.compare(QLatin1String("Yopy"), Qt::CaseInsensitive)) + return 0; + return new QWSYopyKeyboardHandler(driver); +} + +Q_EXPORT_PLUGIN2(qwsyopykbddriver, QYopyKbdDriver) + +QT_END_NAMESPACE diff --git a/src/plugins/kbddrivers/yopy/yopy.pro b/src/plugins/kbddrivers/yopy/yopy.pro new file mode 100644 index 0000000..66a663c --- /dev/null +++ b/src/plugins/kbddrivers/yopy/yopy.pro @@ -0,0 +1,14 @@ +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 + |