[-]
[+]
|
Changed |
_service:tar_git:gestured.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/kimmoli/gesture-daemon.git</param>
<param name="branch">master</param>
- <param name="revision">3d9af76c8fe6b71f83fe3b8ee0f83a9cd0c4e17d</param>
+ <param name="revision">abd81374c3598f8ace03b70037df243cf3445b47</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:gestured-0.0.6.tar.bz2/gesture-daemon.pro
^
|
@@ -1,5 +1,8 @@
TARGET = gestured
+CONFIG += link_pkgconfig
+PKGCONFIG += mlite5
+
QT += dbus
QT -= gui
@@ -16,11 +19,13 @@
SOURCES += \
src/gesture-daemon.cpp \
- src/gesture-actions.cpp
+ src/gesture-actions.cpp \
+ src/gesture-enabler.cpp
OTHER_FILES += \
rpm/$${TARGET}.spec \
config/$${TARGET}.service
HEADERS += \
- src/gesture-actions.h
+ src/gesture-actions.h \
+ src/gesture-enabler.h
|
[-]
[+]
|
Changed |
_service:tar_git:gestured-0.0.6.tar.bz2/src/gesture-daemon.cpp
^
|
@@ -9,6 +9,7 @@
#include <unistd.h>
#include <sys/types.h>
#include "gesture-actions.h"
+#include "gesture-enabler.h"
#include <QtCore/QCoreApplication>
#define MCE_SERVICE "com.nokia.mce"
@@ -27,6 +28,7 @@
qDebug() << "Starting gesture-daemon version" << APPVERSION;
Gestures gestures;
+ GestureEnabler enabledGestures;
static QDBusConnection systembusConnection = QDBusConnection::systemBus();
systembusConnection.connect(MCE_SERVICE,
|
[-]
[+]
|
Added |
_service:tar_git:gestured-0.0.6.tar.bz2/src/gesture-enabler.cpp
^
|
@@ -0,0 +1,63 @@
+/*
+ * (C) 2016 Kimmo Lindholm <kimmo.lindholm@eke.fi>
+ *
+ * Gesture daemon
+ *
+ */
+
+#include "gesture-enabler.h"
+
+GestureEnabler::GestureEnabler(QObject *parent) :
+ QObject(parent)
+{
+ enabledGestures = new MGConfItem("/apps/onyxgestures");
+
+ /*
+ * UpVee_gesture = (buf[0] & BIT0)?1:0; //"V" -- flashlight
+ * DouSwip_gesture = (buf[0] & BIT1)?1:0;//"||" -- music
+ * DownVee_gesture = (buf[0] & BIT2)?1:0;//"^" -- voicecall
+ * LeftVee_gesture = (buf[0] & BIT3)?1:0; //">" -- music
+ * RightVee_gesture = (buf[0] & BIT4)?1:0;//"<" -- music
+ * Circle_gesture = (buf[0] & BIT6)?1:0; //"O" -- camera
+ * DouTap_gesture = (buf[0] & BIT7)?1:0; //double tap
+ */
+
+ gestureMasks.insert("camera", 0x40);
+ gestureMasks.insert("music",0x1A);
+ gestureMasks.insert("flashlight", 0x01);
+ gestureMasks.insert("double_tap", 0x80);
+ gestureMasks.insert("voicecall", 0x04);
+
+ handleEnabledChanged();
+
+ connect(enabledGestures, SIGNAL(valueChanged()), this, SLOT(handleEnabledChanged()));
+}
+
+void GestureEnabler::handleEnabledChanged()
+{
+ QStringList eg = enabledGestures->value().toStringList();
+ unsigned char mask = 0;
+ QMap<QString, char>::iterator i;
+
+ qDebug() << eg;
+
+ for (i = gestureMasks.begin(); i != gestureMasks.end(); ++i)
+ {
+ if (eg.contains(i.key()))
+ mask |= i.value();
+ }
+
+ QFile outputFile( "/proc/touchpanel/gesture_enable" );
+
+ if (outputFile.open(QIODevice::WriteOnly))
+ {
+ QDataStream out(&outputFile);
+ out << mask;
+ outputFile.close();
+ }
+ else
+ {
+ qWarning() << "Failed to write";
+ }
+}
+
|
[-]
[+]
|
Added |
_service:tar_git:gestured-0.0.6.tar.bz2/src/gesture-enabler.h
^
|
@@ -0,0 +1,24 @@
+#ifndef GESTUREENABLER_H
+#define GESTUREENABLER_H
+
+#include <QObject>
+#include <QDebug>
+#include <QFile>
+#include <mlite5/MGConfItem>
+
+class GestureEnabler : public QObject
+{
+ Q_OBJECT
+public:
+ explicit GestureEnabler(QObject *parent = 0);
+
+public slots:
+ void handleEnabledChanged();
+
+private:
+ MGConfItem *enabledGestures;
+ QMap<QString, char> gestureMasks;
+
+};
+
+#endif // GESTUREENABLER_H
|