diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2011-09-17 03:58:13 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2011-09-17 03:58:13 +0200 |
commit | f225345d4de3b198a557fe3566f9630163e76d51 (patch) | |
tree | cca7ba40e560226c138a1d4fc44b032f8fd6c808 | |
parent | b0771d893865ca249bbf191636fad593901cce03 (diff) | |
download | sowatch-f225345d4de3b198a557fe3566f9630163e76d51.tar.gz sowatch-f225345d4de3b198a557fe3566f9630163e76d51.zip |
Putting MetaWatch stuff in a plugin
-rw-r--r-- | libsowatch/libsowatch.pro | 12 | ||||
-rw-r--r-- | libsowatch/sowatch.h | 1 | ||||
-rw-r--r-- | libsowatch/watchplugininterface.cpp | 7 | ||||
-rw-r--r-- | libsowatch/watchplugininterface.h | 25 | ||||
-rw-r--r-- | metawatch/metawatch.cpp (renamed from libsowatch/metawatch.cpp) | 0 | ||||
-rw-r--r-- | metawatch/metawatch.h (renamed from libsowatch/metawatch.h) | 0 | ||||
-rw-r--r-- | metawatch/metawatch.pro | 53 | ||||
-rw-r--r-- | metawatch/metawatchpaintengine.cpp (renamed from libsowatch/metawatchpaintengine.cpp) | 0 | ||||
-rw-r--r-- | metawatch/metawatchpaintengine.h (renamed from libsowatch/metawatchpaintengine.h) | 0 | ||||
-rw-r--r-- | metawatch/metawatchplugin.cpp | 29 | ||||
-rw-r--r-- | metawatch/metawatchplugin.h | 22 | ||||
-rw-r--r-- | metawatch/metawatchsimulator.cpp (renamed from libsowatch/metawatchsimulator.cpp) | 0 | ||||
-rw-r--r-- | metawatch/metawatchsimulator.h (renamed from libsowatch/metawatchsimulator.h) | 0 | ||||
-rw-r--r-- | metawatch/metawatchsimulatorform.cpp (renamed from libsowatch/metawatchsimulatorform.cpp) | 0 | ||||
-rw-r--r-- | metawatch/metawatchsimulatorform.h (renamed from libsowatch/metawatchsimulatorform.h) | 0 | ||||
-rw-r--r-- | metawatch/metawatchsimulatorform.ui (renamed from libsowatch/metawatchsimulatorform.ui) | 0 | ||||
-rw-r--r-- | sowatch.pro | 4 | ||||
-rw-r--r-- | sowatch.pro.user | 2 |
18 files changed, 149 insertions, 6 deletions
diff --git a/libsowatch/libsowatch.pro b/libsowatch/libsowatch.pro index b2ff054..a5b4fd8 100644 --- a/libsowatch/libsowatch.pro +++ b/libsowatch/libsowatch.pro @@ -23,7 +23,8 @@ SOURCES += \ testdeclarativewatchlet.cpp \ graphicswatchlet.cpp \ declarativewatchwrapper.cpp \ - declarativewatchlet.cpp + declarativewatchlet.cpp \ + watchplugininterface.cpp HEADERS +=\ watchsimulator.h \ @@ -37,10 +38,10 @@ HEADERS +=\ graphicswatchlet.h \ declarativewatchwrapper.h \ declarativewatchlet.h \ - sowatch_global.h + sowatch_global.h \ + watchplugininterface.h -FORMS += \ - metawatchsimulatorform.ui +FORMS += install_headers.files =\ watchsimulator.h \ @@ -80,3 +81,6 @@ unix:!symbian { + + + diff --git a/libsowatch/sowatch.h b/libsowatch/sowatch.h index a5044b3..0463389 100644 --- a/libsowatch/sowatch.h +++ b/libsowatch/sowatch.h @@ -8,5 +8,6 @@ #include "declarativewatchlet.h" #include "watchserver.h" #include "watchsimulator.h" +#include "watchplugininterface.h" #endif // SOWATCH_H diff --git a/libsowatch/watchplugininterface.cpp b/libsowatch/watchplugininterface.cpp new file mode 100644 index 0000000..2af65e2 --- /dev/null +++ b/libsowatch/watchplugininterface.cpp @@ -0,0 +1,7 @@ +#include "watchplugininterface.h" + +using namespace sowatch; + +WatchPluginInterface::~WatchPluginInterface() +{ +} diff --git a/libsowatch/watchplugininterface.h b/libsowatch/watchplugininterface.h new file mode 100644 index 0000000..6b32385 --- /dev/null +++ b/libsowatch/watchplugininterface.h @@ -0,0 +1,25 @@ +#ifndef WATCHPLUGININTERFACE_H +#define WATCHPLUGININTERFACE_H + +#include <QtCore/QObject> +#include <QtCore/QStringList> + +namespace sowatch +{ + +class Watch; + +class WatchPluginInterface +{ +public: + virtual ~WatchPluginInterface(); + + virtual QStringList drivers() = 0; + virtual Watch* getWatch(const QString& driver, const QString& connId, QObject *parent = 0) = 0; +}; + +} + +Q_DECLARE_INTERFACE(sowatch::WatchPluginInterface, "com.javispedro.sowatch.WatchPluginInterface") + +#endif // WATCHPLUGININTERFACE_H diff --git a/libsowatch/metawatch.cpp b/metawatch/metawatch.cpp index b968fad..b968fad 100644 --- a/libsowatch/metawatch.cpp +++ b/metawatch/metawatch.cpp diff --git a/libsowatch/metawatch.h b/metawatch/metawatch.h index 80a1894..80a1894 100644 --- a/libsowatch/metawatch.h +++ b/metawatch/metawatch.h diff --git a/metawatch/metawatch.pro b/metawatch/metawatch.pro new file mode 100644 index 0000000..d8c63c4 --- /dev/null +++ b/metawatch/metawatch.pro @@ -0,0 +1,53 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2011-09-17T03:22:32 +# +#------------------------------------------------- + +TARGET = metawatch +TEMPLATE = lib +CONFIG += mobility +MOBILITY += connectivity + +SOURCES += metawatchplugin.cpp \ + metawatchsimulatorform.cpp \ + metawatchsimulator.cpp \ + metawatchpaintengine.cpp \ + metawatch.cpp + +HEADERS += metawatchplugin.h \ + metawatchsimulatorform.h \ + metawatchsimulator.h \ + metawatchpaintengine.h \ + metawatch.h + +FORMS += \ + metawatchsimulatorform.ui + +symbian { + MMP_RULES += EXPORTUNFROZEN + TARGET.UID3 = 0xE4DC26B0 + TARGET.CAPABILITY = + TARGET.EPOCALLOWDLLDATA = 1 + addFiles.sources = metawatch.dll + addFiles.path = !:/sys/bin + DEPLOYMENT += addFiles +} + +unix:!symbian { + maemo5 { + target.path = /opt/usr/lib + } else { + target.path = /usr/lib + } + INSTALLS += target +} + + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/release/ -llibsowatch +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/debug/ -llibsowatch +else:symbian: LIBS += -llibsowatch +else:unix: LIBS += -L$$OUT_PWD/../libsowatch/ -llibsowatch + +INCLUDEPATH += $$PWD/../libsowatch +DEPENDPATH += $$PWD/../libsowatch diff --git a/libsowatch/metawatchpaintengine.cpp b/metawatch/metawatchpaintengine.cpp index 71ad452..71ad452 100644 --- a/libsowatch/metawatchpaintengine.cpp +++ b/metawatch/metawatchpaintengine.cpp diff --git a/libsowatch/metawatchpaintengine.h b/metawatch/metawatchpaintengine.h index efc3d6e..efc3d6e 100644 --- a/libsowatch/metawatchpaintengine.h +++ b/metawatch/metawatchpaintengine.h diff --git a/metawatch/metawatchplugin.cpp b/metawatch/metawatchplugin.cpp new file mode 100644 index 0000000..e5eaabf --- /dev/null +++ b/metawatch/metawatchplugin.cpp @@ -0,0 +1,29 @@ +#include "metawatch.h" +#include "metawatchsimulator.h" +#include "metawatchplugin.h" + +using namespace sowatch; + +MetaWatchPlugin::~MetaWatchPlugin() +{ + +} + +QStringList MetaWatchPlugin::drivers() +{ + QStringList d; + d << "metawatch-digital"; + d << "metawatch-digital-sim"; + return d; +} + +Watch* MetaWatchPlugin::getWatch(const QString& driver, const QString& connId, QObject *parent) +{ + if (driver == "metawatch-digital") { + return new MetaWatch(QBluetoothAddress(connId), parent); + } else if (driver == "metawatch-digital-sim") { + return new MetaWatchSimulator(parent); + } else { + return 0; + } +} diff --git a/metawatch/metawatchplugin.h b/metawatch/metawatchplugin.h new file mode 100644 index 0000000..d0e7c91 --- /dev/null +++ b/metawatch/metawatchplugin.h @@ -0,0 +1,22 @@ +#ifndef METAWATCHPLUGIN_H +#define METAWATCHPLUGIN_H + +#include <sowatch.h> + +namespace sowatch +{ + +class MetaWatchPlugin : public QObject, public WatchPluginInterface { + Q_OBJECT + Q_INTERFACES(WatchPluginInterface) + +public: + ~MetaWatchPlugin(); + + virtual QStringList drivers(); + virtual Watch* getWatch(const QString& driver, const QString& connId, QObject *parent = 0); +}; + +} + +#endif // METAWATCHPLUGIN_H diff --git a/libsowatch/metawatchsimulator.cpp b/metawatch/metawatchsimulator.cpp index 11b938a..11b938a 100644 --- a/libsowatch/metawatchsimulator.cpp +++ b/metawatch/metawatchsimulator.cpp diff --git a/libsowatch/metawatchsimulator.h b/metawatch/metawatchsimulator.h index 674c3c6..674c3c6 100644 --- a/libsowatch/metawatchsimulator.h +++ b/metawatch/metawatchsimulator.h diff --git a/libsowatch/metawatchsimulatorform.cpp b/metawatch/metawatchsimulatorform.cpp index f2323bd..f2323bd 100644 --- a/libsowatch/metawatchsimulatorform.cpp +++ b/metawatch/metawatchsimulatorform.cpp diff --git a/libsowatch/metawatchsimulatorform.h b/metawatch/metawatchsimulatorform.h index 0b45746..0b45746 100644 --- a/libsowatch/metawatchsimulatorform.h +++ b/metawatch/metawatchsimulatorform.h diff --git a/libsowatch/metawatchsimulatorform.ui b/metawatch/metawatchsimulatorform.ui index 39280b3..39280b3 100644 --- a/libsowatch/metawatchsimulatorform.ui +++ b/metawatch/metawatchsimulatorform.ui diff --git a/sowatch.pro b/sowatch.pro index 4082874..75d1a31 100644 --- a/sowatch.pro +++ b/sowatch.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs -SUBDIRS = libsowatch sowsim +SUBDIRS = libsowatch sowsim \ + metawatch OTHER_FILES += \ qtc_packaging/debian_harmattan/rules \ @@ -12,3 +13,4 @@ OTHER_FILES += \ + diff --git a/sowatch.pro.user b/sowatch.pro.user index 78d72ed..123705f 100644 --- a/sowatch.pro.user +++ b/sowatch.pro.user @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by Qt Creator 2.3.0, 2011-09-17T03:15:45. --> +<!-- Written by Qt Creator 2.3.0, 2011-09-17T03:57:54. --> <qtcreator> <data> <variable>ProjectExplorer.Project.ActiveTarget</variable> |