Commit 106283e7479816557272177e8241cde01ca5f0cc
- Diff rendering mode:
- inline
- side by side
|   | |||
| 2 | 2 | ||
| 3 | 3 | * Initial release | |
| 4 | 4 | ||
| 5 | -- Timo Härkönen <timop.harkonen@gmail.com> Mon, 19 Oct 2009 21:26:22 +0300 | ||
| 5 | -- Timo Härkönen <timop.harkonen@gmail.com> Mon, 19 Oct 2009 21:26:22 +0300 |
qt-maemo-extra/debian/control
(20 / 13)
|   | |||
| 1 | 1 | Source: qmaemo-ext-libs | |
| 2 | 2 | Section: libs | |
| 3 | 3 | Priority: optional | |
| 4 | Maintainer: Timo Härkönen <timop.harkonen@gmail.com> | ||
| 4 | Maintainer: Timo Härkönen <timop.harkonen@gmail.com> | ||
| 5 | 5 | Build-Depends: debhelper (>= 5), libqt4-gui, libqt4-core, libqt4-dbus | |
| 6 | 6 | Standards-Version: 3.7.2 | |
| 7 | 7 | ||
| 8 | 8 | Package: qhildon-systemcapabilities | |
| 9 | 9 | Architecture: any | |
| 10 | Depends: ${shlibs:Depends}, ${misc:Depends} | ||
| 10 | Depends: libqt4-gui, libqt4-core, libqt4-dbus | ||
| 11 | 11 | Description: Extensions to the Qt4 libraries for Maemo 5 | |
| 12 | Extensions to the Qt4 libraries for Maemo 5. The package | ||
| 13 | includes capabilities to change screen orientation, display | ||
| 14 | system nofifications, and listen to accelerometer. | ||
| 12 | This package containt classes to listen to the devices | ||
| 13 | accelerometer, etc. | ||
| 15 | 14 | ||
| 16 | 15 | Package: qhildon-widgetcapabilities | |
| 17 | 16 | Architecture: any | |
| 18 | Depends: ${shlibs:Depends}, ${misc:Depends} | ||
| 17 | Depends: libqt4-core, libqt4-gui, libqt4-dbus | ||
| 19 | 18 | Description: Extensions to the Qt4 libraries for Maemo 5 | |
| 20 | Extensions to the Qt4 libraries for Maemo 5. The package | ||
| 21 | includes capabilities to change screen orientation, display | ||
| 22 | system nofifications, and listen to accelerometer. | ||
| 19 | This package contains capabilities to change screen | ||
| 20 | orientation, etc. | ||
| 23 | 21 | ||
| 24 | 22 | Package: qhildon-notifications | |
| 25 | 23 | Architecture: any | |
| 26 | Depends: ${shlibs:Depends}, ${misc:Depends} | ||
| 24 | Depends: libqt4-core, libqt4-gui, libqt4-dbus | ||
| 27 | 25 | Description: Extensions to the Qt4 libraries for Maemo 5 | |
| 28 | Extensions to the Qt4 libraries for Maemo 5. The package | ||
| 29 | includes capabilities to change screen orientation, display | ||
| 30 | system nofifications, and listen to accelerometer. | ||
| 26 | This package contains capabilities to display | ||
| 27 | system nofifications, etc. | ||
| 28 | |||
| 29 | Package: qmaemo-ext-libs | ||
| 30 | Architecture: any | ||
| 31 | Depends: qhildon-notifications, qhildon-widgetcapabilities, qhildon-systemcapabilities | ||
| 32 | Description: Qt Maemo extra libraries runtime binaries | ||
| 33 | |||
| 34 | Package: qmaemo-ext-libs-dev | ||
| 35 | Architecture: any | ||
| 36 | Depends: qhildon-notifications, qhildon-widgetcapabilities, qhildon-systemcapabilities | ||
| 37 | Description: Qt Maemo extra library development headers. |
qt-maemo-extra/debian/dirs
(0 / 2)
|   | |||
| 1 | usr/bin | ||
| 2 | usr/sbin |
qt-maemo-extra/debian/files
(4 / 0)
|   | |||
| 1 | qhildon-systemcapabilities_0.1-1-maemo0_i386.deb libs optional | ||
| 2 | qhildon-widgetcapabilities_0.1-1-maemo0_i386.deb libs optional | ||
| 3 | qhildon-notifications_0.1-1-maemo0_i386.deb libs optional | ||
| 4 | qmaemo-ext-libs-dev_0.1-1-maemo0_i386.deb libs optional |
qt-maemo-extra/debian/rules
(8 / 0)
|   | |||
| 30 | 30 | cd builddir/src/notifications && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/qhildon-notifications install | |
| 31 | 31 | cd builddir/src/widgetcapabilities && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/qhildon-widgetcapabilities install | |
| 32 | 32 | cd builddir/src/systemcapabilities && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/qhildon-systemcapabilities install | |
| 33 | mkdir -p $(CURDIR)/debian/qmaemo-ext-libs-dev/usr/include/qmaemo-ext/notifications | ||
| 34 | cp src/notifications/qnotification.h $(CURDIR)/debian/qmaemo-ext-libs-dev/usr/include/qmaemo-ext/notifications | ||
| 35 | mkdir -p $(CURDIR)/debian/qmaemo-ext-libs-dev/usr/include/qmaemo-ext/widget | ||
| 36 | cp src/widgetcapabilities/qorientationcapability.h $(CURDIR)/debian/qmaemo-ext-libs-dev/usr/include/qmaemo-ext/widget | ||
| 37 | mkdir -p $(CURDIR)/debian/qmaemo-ext-libs-dev/usr/include/qmaemo-ext/system | ||
| 38 | cp src/systemcapabilities/qorientationinfo.h $(CURDIR)/debian/qmaemo-ext-libs-dev/usr/include/qmaemo-ext/system | ||
| 39 | mkdir -p $(CURDIR)/debian/qmaemo-ext-libs-dev/usr/include/qmaemo-ext/global | ||
| 40 | cp src/global/global.h $(CURDIR)/debian/qmaemo-ext-libs-dev/usr/include/qmaemo-ext/global | ||
| 33 | 41 | ||
| 34 | 42 | binary-indep: build | |
| 35 | 43 | #nothing to do |
|   | |||
| 1 | #ifndef QHILDONNOTIFICATIONS_GLOBAL_H | ||
| 2 | #define QHILDONNOTIFICATIONS_GLOBAL_H | ||
| 3 | |||
| 4 | #if defined(QHILDONNOTIFICATIONS_LIBRARY) | ||
| 5 | # define QHILDONNOFICATIONS_SHARED_EXPORT Q_DECL_EXPORT | ||
| 6 | #else | ||
| 7 | # define QHILDONNOTIFICATIONS_SHARED_EXPORT Q_DECL_IMPORT | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #endif //QHILDONNOTIFICATIONS_GLOBAL_H | ||
| 11 | |||
| 12 | #ifndef QHILDONSYSTEMCAPABILITIES_GLOBAL_H | ||
| 13 | #define QHILDONSYSTEMCAPABILITIES_GLOBAL_H | ||
| 14 | |||
| 15 | #if defined(QHILDONSYSTEMCAPABILITIES_LIBRARY) | ||
| 16 | # define QHILDONSYSTEMCAPABILITIES_SHARED_EXPORT Q_DECL_EXPORT | ||
| 17 | #else | ||
| 18 | # define QHILDONSYSTEMCAPABILITIES_SHARED_EXPORT Q_DECL_IMPORT | ||
| 19 | #endif | ||
| 20 | |||
| 21 | #endif //QHILDONSYSTEMCAPABILITIES_GLOBAL_H | ||
| 22 | |||
| 1 | 23 | #ifndef QHILDONWIDGETCAPABILITIES_GLOBAL_H | |
| 2 | 24 | #define QHILDONWIDGETCAPABILITIES_GLOBAL_H | |
| 3 | 25 |
|   | |||
| 14 | 14 | PKGCONFIG += hildon-1 | |
| 15 | 15 | ||
| 16 | 16 | target.path = /usr/lib | |
| 17 | |||
| 17 | 18 | INSTALLS += target |
|   | |||
| 6 | 6 | #ifndef QNOTIFICATIONS_H | |
| 7 | 7 | #define QNOTIFICATIONS_H | |
| 8 | 8 | ||
| 9 | #include "global.h" | ||
| 9 | #include "../global/global.h" | ||
| 10 | 10 | ||
| 11 | 11 | #include <QtCore/QObject> | |
| 12 | 12 |
|   | |||
| 1 | #ifndef QHILDONSYSTEMCAPABILITIES_GLOBAL_H | ||
| 2 | #define QHILDONSYSTEMCAPABILITIES_GLOBAL_H | ||
| 3 | |||
| 4 | #include <QtCore/qglobal.h> | ||
| 5 | |||
| 6 | #if defined(QHILDONSYSTEMCAPABILITIES_LIBRARY) | ||
| 7 | # define QHILDONSYSTEMCAPABILITIES_SHARED_EXPORT Q_DECL_EXPORT | ||
| 8 | #else | ||
| 9 | # define QHILDONSYSTEMCAPABILITIES_SHARED_EXPORT Q_DECL_IMPORT | ||
| 10 | #endif | ||
| 11 | |||
| 12 | //PRIVATE IMPLEMENTATION | ||
| 13 | #define MAEMO_DECLARE_PRIVATE(Class) \ | ||
| 14 | private: \ | ||
| 15 | inline Class##Private* priv_func() { return reinterpret_cast<Class##Private *>(priv_ptr); } \ | ||
| 16 | inline const Class##Private* priv_func() const { return reinterpret_cast<const Class##Private *>(priv_ptr); } \ | ||
| 17 | friend class Class##Private; \ | ||
| 18 | void* priv_ptr; | ||
| 19 | |||
| 20 | #define MAEMO_DECLARE_PUBLIC(Class) \ | ||
| 21 | public: \ | ||
| 22 | inline Class* pub_func() { return static_cast<Class *>(pub_ptr); } \ | ||
| 23 | inline const Class* pub_func() const { return static_cast<const Class *>(pub_ptr); } \ | ||
| 24 | private: \ | ||
| 25 | friend class Class; \ | ||
| 26 | void* pub_ptr; | ||
| 27 | |||
| 28 | #define MAEMO_PRIVATE(Class) Class##Private * const priv = priv_func(); | ||
| 29 | #define MAEMO_PRIVATE_CONST(Class) const Class##Private * const priv = priv_func(); | ||
| 30 | #define MAEMO_PUBLIC(Class) Class * const pub = pub_func(); | ||
| 31 | |||
| 32 | #define MAEMO_INITIALIZE(Class) \ | ||
| 33 | priv_ptr = new Class##Private(); \ | ||
| 34 | MAEMO_PRIVATE(Class); \ | ||
| 35 | priv->pub_ptr = this; | ||
| 36 | |||
| 37 | #define MAEMO_UNINITIALIZE(Class) do { MAEMO_PRIVATE(Class); delete priv; } while(0) | ||
| 38 | |||
| 39 | #define compilation_assert(const_expr) do {switch(0){case 0: case const_expr: ; }} while(0) | ||
| 40 | |||
| 41 | #endif // QHILDONSYSTEMCAPABILITIES_GLOBAL_H |
|   | |||
| 13 | 13 | ||
| 14 | 14 | class QOrientationInfoPrivate; | |
| 15 | 15 | ||
| 16 | class QHILDONWIDGETCAPABILITIES_SHARED_EXPORT QOrientationInfo : public QObject | ||
| 16 | class QHILDONSYSTEMCAPABILITIES_SHARED_EXPORT QOrientationInfo : public QObject | ||
| 17 | 17 | { | |
| 18 | 18 | Q_OBJECT | |
| 19 | 19 |
|   | |||
| 61 | 61 | ||
| 62 | 62 | void QOrientationInfoPrivate::startListening() | |
| 63 | 63 | { | |
| 64 | MAEMO_PUBLIC(QOrientationInfo); | ||
| 64 | if(!m_listening) { | ||
| 65 | //request to start accelerometer | ||
| 66 | QDBusConnection::systemBus().call(QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH, | ||
| 67 | MCE_REQUEST_IF, MCE_ACCELEROMETER_ENABLE_REQ)); | ||
| 68 | MAEMO_PUBLIC(QOrientationInfo); | ||
| 65 | 69 | ||
| 66 | QDBusConnection::systemBus().connect("", MCE_SIGNAL_PATH, MCE_SIGNAL_IF, | ||
| 67 | MCE_DEVICE_ORIENTATION_SIG, pub, SLOT(orientationUpdate(QString, QString, QString, int, int, int))); | ||
| 70 | //connect accelerometer signal to orientation update slot | ||
| 71 | QDBusConnection::systemBus().connect("", MCE_SIGNAL_PATH, MCE_SIGNAL_IF, | ||
| 72 | MCE_DEVICE_ORIENTATION_SIG, pub, SLOT(orientationUpdate(QString, QString, QString, int, int, int))); | ||
| 68 | 73 | ||
| 69 | m_listening = true; | ||
| 74 | m_listening = true; | ||
| 75 | } | ||
| 70 | 76 | } | |
| 71 | 77 | ||
| 72 | 78 | void QOrientationInfoPrivate::stopListening() | |
| 73 | 79 | { | |
| 74 | MAEMO_PUBLIC(QOrientationInfo); | ||
| 80 | if(m_listening) { | ||
| 81 | MAEMO_PUBLIC(QOrientationInfo); | ||
| 75 | 82 | ||
| 76 | QDBusConnection::systemBus().disconnect("", MCE_SIGNAL_PATH, MCE_SIGNAL_IF, | ||
| 77 | MCE_DEVICE_ORIENTATION_SIG, pub, SLOT(orientationUpdate(QString,QString,QString, int, int, int))); | ||
| 83 | //disconnect update slot from accelerometer signal | ||
| 84 | QDBusConnection::systemBus().disconnect("", MCE_SIGNAL_PATH, MCE_SIGNAL_IF, | ||
| 85 | MCE_DEVICE_ORIENTATION_SIG, pub, SLOT(orientationUpdate(QString,QString,QString, int, int, int))); | ||
| 78 | 86 | ||
| 79 | m_listening = false; | ||
| 87 | //request to stop accelerometer | ||
| 88 | QDBusConnection::systemBus().call(QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH, | ||
| 89 | MCE_REQUEST_IF, MCE_ACCELEROMETER_DISABLE_REQ)); | ||
| 90 | |||
| 91 | m_listening = false; | ||
| 92 | } | ||
| 80 | 93 | } | |
| 81 | 94 | ||
| 82 | 95 | bool QOrientationInfoPrivate::isListening() const |
|   | |||
| 7 | 7 | DEFINES += QHILDONSYSTEMCAPABILITIES_LIBRARY | |
| 8 | 8 | ||
| 9 | 9 | HEADERS += qorientationinfo.h qorientationinfo_p.h | |
| 10 | |||
| 10 | 11 | SOURCES += qorientationinfo.cpp | |
| 11 | 12 | ||
| 12 | 13 | target.path = /usr/lib | |
| 14 | |||
| 13 | 15 | INSTALLS += target |
|   | |||
| 6 | 6 | #ifndef QORIENTATIONCAPABILITY_H | |
| 7 | 7 | #define QORIENTATIONCAPABILITY_H | |
| 8 | 8 | ||
| 9 | #include "global.h" | ||
| 9 | #include "../global/global.h" | ||
| 10 | 10 | ||
| 11 | 11 | #include <QObject> | |
| 12 | 12 | #include <QtCore> |
|   | |||
| 10 | 10 | ||
| 11 | 11 | HEADERS += qorientationcapability.h \ | |
| 12 | 12 | qorientationcapability_p.h \ | |
| 13 | qxfunctions.h \ | ||
| 14 | global.h | ||
| 13 | qxfunctions.h | ||
| 15 | 14 | ||
| 16 | 15 | target.path = /usr/lib | |
| 16 | |||
| 17 | 17 | INSTALLS += target |

