Commit f3d870f0 authored by SR's avatar SR
Browse files

initial rewrite from kde4-libs to Qt

parent 7ba030e8
build
.kdev4
*.creator.user*
*.pro.user*
Alexander Ryapolov <srwork@gmail.com>
Todor Gyumyushev <yodor1@gmail.com>
Guillaume Martres <smarter@ubuntu.com>
cmake_minimum_required(VERSION 2.4)
project( kvkbd )
cmake_minimum_required(VERSION 2.8.11)
project( qtvkbd )
find_package(KDE4 REQUIRED)
include (KDE4Defaults)
add_subdirectory( doc )
#add_subdirectory( doc )
add_subdirectory( src )
add_subdirectory( pics )
add_subdirectory( colors )
add_subdirectory( themes )
\ No newline at end of file
add_subdirectory( themes )
0.8
* Qt 5 port
0.7
* Polish KDE4 porting
* Implement themese
......
Kvkbd - A virtual keyboard for KDE4
Qtvkbd - A virtual keyboard
===============================================================================
Dependencies:
- cmake
- kdelibs headers
- Qt
- libxtst (X11 Record extension library)
On Debian systems, this can be installed with:
sudo aptitude install cmake kdelibs5-dev libxtst-dev
sudo aptitude install cmake qtbase5-dev libxtst-dev
Build instructions:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$(kde-config --prefix) ..
cmake -DCMAKE_BUILD_TYPE=release ..
make
Then, as root using sudo or su:
make install
Kvkbd - A virtual keyboard for KDE4
===============================================================================
Installations instructions:
See INSTALL
Known issues:
- The mod keys(ctrl, alt, alt gr, pg up, pg down, ...) may not work if you're
not using Xserver >= 1.5 with evdev enabled due to changes in the keys mapping.
Hopefully, new releases of Kvkbd will detect which mapping is used and behave
accordingly.
- The Loginhelper mode(see manual) does not work currently with KDM, you can either
apply the patch for KDM available here: <http://smarter.free.fr/kvkbd/kdm.html>,
wait for your distribution or for KDE to include the patch, or use XDM.
kvkbd
qtvkbd
=====
Virtual Keyboard for KDE
Virtual Keyboard
This is a fork of kvkbd in which all KDE4 dependencies from the original project were replaced with Qt components.
For installation instructions see INSTALL.
install( FILES dark.css legacy.css light.css simple.css DESTINATION ${DATA_INSTALL_DIR}/kvkbd/colors)
install( FILES dark.css legacy.css light.css simple.css DESTINATION ${DATA_INSTALL_DIR}/qtvkbd/colors)
########### install files ###############
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kvkbd)
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR qtvkbd)
install( FILES tray.png DESTINATION ${DATA_INSTALL_DIR}/kvkbd/pics)
[Project]
Manager=KDevCMakeManager
Name=kvkbd
Name=qtvkbd
QT += core gui xml x11extras dbus
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
TARGET = qtvkbd
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
LIBS += -lX11 -lXtst
SOURCES += \
src/dragwidget.cpp \
src/kbddock.cpp \
src/kbdtray.cpp \
src/keysymconvert.cpp \
src/qtvkbdapp.cpp \
src/main.cpp \
src/mainwidget.cpp \
src/resizabledragwidget.cpp \
src/themeloader.cpp \
src/vbutton.cpp \
src/vkeyboard.cpp \
src/x11keyboard.cpp
HEADERS += \
src/dragwidget.h \
src/kbddock.h \
src/kbdtray.h \
src/keysymconvert.h \
src/qtvkbdapp.h \
src/mainwidget.h \
src/resizabledragwidget.h \
src/themeloader.h \
src/vbutton.h \
src/vkeyboard.h \
src/x11keyboard.h
FORMS +=
RESOURCES += \
src/resources.qrc
find_package(KDE4 REQUIRED)
find_package(Qt4 COMPONENTS QtGui QtCore QtXml REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5DBus REQUIRED)
find_package(LibXslt REQUIRED)
include(${QT_USE_FILE})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
set(CMAKE_AUTOMOC ON)
set(kvkbd_SRCS vkeyboard.cpp
set(qtvkbd_SRCS vkeyboard.cpp
x11keyboard.cpp
dragwidget.cpp
mainwidget.cpp
......@@ -15,29 +15,31 @@ set(kvkbd_SRCS vkeyboard.cpp
resizabledragwidget.cpp
keysymconvert.cpp
kbddock.cpp
kvkbdapp.cpp
qtvkbdapp.cpp
kbdtray.cpp
themeloader.cpp
)
SET(kvkbd_RESOURCES resources.qrc)
SET(qtvkbd_RESOURCES resources.qrc)
QT4_ADD_RESOURCES(kvkbd_RESOURCES_RCC ${kvkbd_RESOURCES})
qt5_add_resources(qtvkbd_RESOURCES_RCC ${qtvkbd_RESOURCES})
QT4_ADD_DBUS_ADAPTOR(kvkbd_SRCS org.kde.kvkbd.Kvkbd.xml
qt5_add_dbus_adaptor(qtvkbd_SRCS org.kde.qtvkbd.Qtvkbd.xml
mainwidget.h MainWidget)
QT4_ADD_DBUS_ADAPTOR(kvkbd_SRCS org.kde.kvkbd.Dock.xml
qt5_add_dbus_adaptor(qtvkbd_SRCS org.kde.qtvkbd.Dock.xml
kbddock.h KbdDock)
kde4_add_executable(kvkbd ${kvkbd_SRCS} ${kvkbd_RC_SRCS} ${kvkbd_RESOURCES_RCC})
add_executable(qtvkbd ${qtvkbd_SRCS} ${qtvkbd_RC_SRCS} ${qtvkbd_RESOURCES_RCC})
target_link_libraries(kvkbd ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${QT_LIBRARIES} X11 Xtst)
qt5_use_modules(qtvkbd Core Widgets Gui Xml X11Extras DBus)
target_link_libraries(qtvkbd ${QT_LIBRARIES} X11 Xtst)
install(TARGETS kvkbd ${INSTALL_TARGETS_DEFAULT_ARGS})
install( FILES kvkbd.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install(TARGETS qtvkbd RUNTIME DESTINATION bin)
install( FILES qtvkbd.desktop DESTINATION share/applications )
......@@ -5,10 +5,6 @@
#include <QStylePainter>
#include <QX11Info>
#include <iostream>
using namespace std;
#include <X11/Xatom.h>
#include <X11/Xlib.h>
......
/*
* This file is part of the Kvkbd project.
* This file is part of the Qtvkbd project.
* Copyright (C) 2016-2017 Alexander Ryapolov <srwork@gmail.com>
* Copyright (C) 2007-2014 Todor Gyumyushev <yodor1@gmail.com>
* Copyright (C) 2008 Guillaume Martres <smarter@ubuntu.com>
*
......@@ -26,14 +27,6 @@
#include <QWidget>
#include <QMouseEvent>
#include <KIconLoader>
#include <KLocale>
#include "dockadaptor.h"
#include <iostream>
using namespace std;
#define DEFAULT_WIDTH 105
#define DEFAULT_HEIGHT 35
......@@ -47,7 +40,7 @@ KbdDock::KbdDock(const WId& window) : DragWidget(0), wID(window)
setFocusPolicy(Qt::NoFocus);
setToolTip(i18nc("@info:tooltip Displayed on the movable dock", "Toggle keyboard visibility"));
setToolTip(tr("Toggle keyboard visibility", "tooltip Displayed on the movable dock"));
......
/*
* This file is part of the Kvkbd project.
* This file is part of the Qtvkbd project.
* Copyright (C) 2016-2017 Alexander Ryapolov <srwork@gmail.com>
* Copyright (C) 2007-2014 Todor Gyumyushev <yodor1@gmail.com>
* Copyright (C) 2008 Guillaume Martres <smarter@ubuntu.com>
*
......
/*
* This file is part of the Kvkbd project.
* This file is part of the Qtvkbd project.
* Copyright (C) 2016-2017 Alexander Ryapolov <srwork@gmail.com>
* Copyright (C) 2007-2014 Todor Gyumyushev <yodor1@gmail.com>
* Copyright (C) 2008 Guillaume Martres <smarter@ubuntu.com>
*
......@@ -20,26 +21,13 @@
#include "kbdtray.h"
#include <KAction>
#include <KToggleAction>
#include <KToggleAction>
#include <KLocalizedString>
#include <KIcon>
#include <KIconLoader>
#include <KCmdLineArgs>
#include <KHelpMenu>
#include <KMenu>
#include <KFontDialog>
#include <KUniqueApplication>
// TODO: find a way to hide the widget before asking for quit
KbdTray::KbdTray(QWidget* parent) : KSystemTrayIcon(parent)
KbdTray::KbdTray(QWidget* parent) : QSystemTrayIcon(parent)
{
setObjectName("KvkbdTray");
setIcon(UserIcon("tray"));
setObjectName("QtvkbdTray");
setIcon(QIcon(":/pics/tray.png"));
QAction *titleAction = contextMenuTitle();
titleAction->setText("Kvkbd");
//contextMenu()->setTitle("Qtvkbd");
connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(activationHandler(QSystemTrayIcon::ActivationReason)));
......
/*
* This file is part of the Qtvkbd project.
* Copyright (C) 2016-2017 Alexander Ryapolov <srwork@gmail.com>
* Copyright (C) 2007-2014 Todor Gyumyushev <yodor1@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
......@@ -19,12 +21,12 @@
#ifndef KBDTRAY_H
#define KBDTRAY_H
#include <KSystemTrayIcon>
#include <QSystemTrayIcon>
#include <QMenu>
#include <QSystemTrayIcon>
#include <QFont>
class KbdTray : public KSystemTrayIcon
class KbdTray : public QSystemTrayIcon
{
Q_OBJECT
......
......@@ -21,14 +21,10 @@
#include "kvkbdapp.h"
#include <KAboutData>
#include <KCmdLineArgs>
#include "qtvkbdapp.h"
#include <QCommandLineParser>
static const char description[] =
I18N_NOOP("A virtual keyboard for KDE");
static const char version[] = "0.7.2";
//static const char version[] = "0.7.2";
#include <X11/Xlib.h>
......@@ -57,7 +53,7 @@ void findLoginWindow()
XFetchName(dipsy, kids[i], &win_name);
QString c(win_name);
if (c=="kvkbd.login")
if (c=="qtvkbd.login")
{
long wid = kids[i];
XDestroyWindow(dipsy,wid);
......@@ -71,30 +67,27 @@ void findLoginWindow()
int main(int argc, char **argv)
{
QCommandLineParser parser;
parser.setApplicationDescription("A virtual keyboard");
parser.addOption(
{{"l", "loginhelper"},
QCoreApplication::translate("main", "Stand alone version for use with KDM or XDM.\n"
"See qtvkbd Handbook for information on how to use this option.")}
);
QStringList arguments;
for (int a = 0; a < argc; ++a)
{
arguments.append(QString::fromLocal8Bit(argv[a]));
}
parser.parse(arguments);
KAboutData about("kvkbd", 0, ki18n("Kvkbd"), version, ki18n(description),
KAboutData::License_LGPL_V3, ki18n("(C) 2007-2014 The Kvkbd Developers"));
about.addAuthor(ki18n("Todor Gyumyushev"), ki18n("Original Author"), "yodor1@gmail.com");
about.addAuthor(ki18n("Guillaume Martres"), ki18n("KDE4 port"), "smarter@ubuntu.com");
about.setProgramIconName("preferences-desktop-keyboard");
KCmdLineArgs::init(argc, argv, &about);
KCmdLineOptions options;
options.add("loginhelper", ki18n("Stand alone version for use with KDM or XDM.\n"
"See Kvkbd Handbook for information on how to use this option."));
KCmdLineArgs::addCmdLineOptions(options);
bool is_login = KCmdLineArgs::parsedArgs()->isSet("loginhelper");
bool is_login = parser.isSet("loginhelper");
if (!is_login) {
findLoginWindow();
}
KvkbdApp app(is_login);
QtvkbdApp app(argc, argv, is_login);
return app.exec();
}
......@@ -89,7 +89,7 @@ void MainWidget::updateLayout(int index, QString layout_name)
VButton *btn = (VButton*)buttons.at(a);
if (btn->property("label").toString().length()<1) {
ButtonText text;
QString text;
vkbd->textForKeyCode(btn->getKeyCode(), text);
btn->setButtonText(text);
......@@ -138,4 +138,3 @@ void MainWidget::updateFont(const QFont& widgetFont)
this->setStyleSheet(buttonStyle);
}
#include "mainwidget.moc"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment