Commit 106283e7479816557272177e8241cde01ca5f0cc

Dev packaging and fixes to systemcapabilities
  
22
33 * Initial release
44
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
  
11Source: qmaemo-ext-libs
22Section: libs
33Priority: optional
4Maintainer: Timo Härkönen <timop.harkonen@gmail.com>
4Maintainer: Timo Härkönen <timop.harkonen@gmail.com>
55Build-Depends: debhelper (>= 5), libqt4-gui, libqt4-core, libqt4-dbus
66Standards-Version: 3.7.2
77
88Package: qhildon-systemcapabilities
99Architecture: any
10Depends: ${shlibs:Depends}, ${misc:Depends}
10Depends: libqt4-gui, libqt4-core, libqt4-dbus
1111Description: 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.
1514
1615Package: qhildon-widgetcapabilities
1716Architecture: any
18Depends: ${shlibs:Depends}, ${misc:Depends}
17Depends: libqt4-core, libqt4-gui, libqt4-dbus
1918Description: 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.
2321
2422Package: qhildon-notifications
2523Architecture: any
26Depends: ${shlibs:Depends}, ${misc:Depends}
24Depends: libqt4-core, libqt4-gui, libqt4-dbus
2725Description: 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
29Package: qmaemo-ext-libs
30Architecture: any
31Depends: qhildon-notifications, qhildon-widgetcapabilities, qhildon-systemcapabilities
32Description: Qt Maemo extra libraries runtime binaries
33
34Package: qmaemo-ext-libs-dev
35Architecture: any
36Depends: qhildon-notifications, qhildon-widgetcapabilities, qhildon-systemcapabilities
37Description: Qt Maemo extra library development headers.
  
1usr/bin
2usr/sbin
  
1qhildon-systemcapabilities_0.1-1-maemo0_i386.deb libs optional
2qhildon-widgetcapabilities_0.1-1-maemo0_i386.deb libs optional
3qhildon-notifications_0.1-1-maemo0_i386.deb libs optional
4qmaemo-ext-libs-dev_0.1-1-maemo0_i386.deb libs optional
  
3030 cd builddir/src/notifications && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/qhildon-notifications install
3131 cd builddir/src/widgetcapabilities && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/qhildon-widgetcapabilities install
3232 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
3341
3442binary-indep: build
3543#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
123#ifndef QHILDONWIDGETCAPABILITIES_GLOBAL_H
224#define QHILDONWIDGETCAPABILITIES_GLOBAL_H
325
  
1414PKGCONFIG += hildon-1
1515
1616target.path = /usr/lib
17
1718INSTALLS += target
  
66#ifndef QNOTIFICATIONS_H
77#define QNOTIFICATIONS_H
88
9#include "global.h"
9#include "../global/global.h"
1010
1111#include <QtCore/QObject>
1212
  
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
  
1313
1414class QOrientationInfoPrivate;
1515
16class QHILDONWIDGETCAPABILITIES_SHARED_EXPORT QOrientationInfo : public QObject
16class QHILDONSYSTEMCAPABILITIES_SHARED_EXPORT QOrientationInfo : public QObject
1717{
1818 Q_OBJECT
1919
  
6161
6262void QOrientationInfoPrivate::startListening()
6363{
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);
6569
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)));
6873
69 m_listening = true;
74 m_listening = true;
75 }
7076}
7177
7278void QOrientationInfoPrivate::stopListening()
7379{
74 MAEMO_PUBLIC(QOrientationInfo);
80 if(m_listening) {
81 MAEMO_PUBLIC(QOrientationInfo);
7582
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)));
7886
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 }
8093}
8194
8295bool QOrientationInfoPrivate::isListening() const
  
77DEFINES += QHILDONSYSTEMCAPABILITIES_LIBRARY
88
99HEADERS += qorientationinfo.h qorientationinfo_p.h
10
1011SOURCES += qorientationinfo.cpp
1112
1213target.path = /usr/lib
14
1315INSTALLS += target
  
66#ifndef QORIENTATIONCAPABILITY_H
77#define QORIENTATIONCAPABILITY_H
88
9#include "global.h"
9#include "../global/global.h"
1010
1111#include <QObject>
1212#include <QtCore>
  
1010
1111HEADERS += qorientationcapability.h \
1212 qorientationcapability_p.h \
13 qxfunctions.h \
14 global.h
13 qxfunctions.h
1514
1615target.path = /usr/lib
16
1717INSTALLS += target