Browse files

Added SmartSignals sample app

Updated to Beta 3
  • Loading branch information...
1 parent 21c2ca0 commit 8f553092d81a7c17ee4434cb0eba4ed27cc69686 Garett committed Nov 12, 2012
Showing with 3,212 additions and 0 deletions.
  1. +209 −0 SmartSignals/.cproject
  2. +90 −0 SmartSignals/.project
  3. +25 −0 SmartSignals/.settings/org.eclipse.cdt.core.prefs
  4. +255 −0 SmartSignals/LICENSE
  5. +35 −0 SmartSignals/Makefile
  6. +9 −0 SmartSignals/NOTICE
  7. +35 −0 SmartSignals/README.md
  8. +50 −0 SmartSignals/SmartSignals.pro
  9. +48 −0 SmartSignals/assets/.preview-1090541320027306950qml~
  10. +79 −0 SmartSignals/assets/.preview-1533676381704176147qml~
  11. +86 −0 SmartSignals/assets/.preview-3354057586964008954qml~
  12. +181 −0 SmartSignals/assets/.preview-6379442569096472680qml~
  13. +32 −0 SmartSignals/assets/.preview-8217363412039261099qml~
  14. +106 −0 SmartSignals/assets/.preview-8831408844579486521qml~
  15. +86 −0 SmartSignals/assets/AlertSign.qml
  16. +79 −0 SmartSignals/assets/CloudButton.qml
  17. +48 −0 SmartSignals/assets/StatusBar.qml
  18. +32 −0 SmartSignals/assets/StatusBarLabel.qml
  19. BIN SmartSignals/assets/images/Cloud1.png
  20. BIN SmartSignals/assets/images/Cloud1_shadow.png
  21. BIN SmartSignals/assets/images/Cloud2.png
  22. BIN SmartSignals/assets/images/Cloud2_shadow.png
  23. BIN SmartSignals/assets/images/Cloud3.png
  24. BIN SmartSignals/assets/images/Cloud3_shadow.png
  25. BIN SmartSignals/assets/images/Hills.png
  26. BIN SmartSignals/assets/images/Sign.png
  27. BIN SmartSignals/assets/images/Sky.png
  28. +181 −0 SmartSignals/assets/main.qml
  29. +117 −0 SmartSignals/bar-descriptor.xml
  30. +4 −0 SmartSignals/device-assets.xml
  31. BIN SmartSignals/icon.png
  32. +98 −0 SmartSignals/src/AbstractSensorService.cpp
  33. +76 −0 SmartSignals/src/AbstractSensorService.h
  34. +43 −0 SmartSignals/src/AccelerometerService.cpp
  35. +58 −0 SmartSignals/src/AccelerometerService.h
  36. +42 −0 SmartSignals/src/AzimuthPitchRollService.cpp
  37. +44 −0 SmartSignals/src/AzimuthPitchRollService.h
  38. +50 −0 SmartSignals/src/BPSEventHandler.cpp
  39. +47 −0 SmartSignals/src/BPSEventHandler.h
  40. +99 −0 SmartSignals/src/BPSMonitor.cpp
  41. +89 −0 SmartSignals/src/BPSMonitor.h
  42. +54 −0 SmartSignals/src/BPSMonitor_p.h
  43. +49 −0 SmartSignals/src/BlackBerryPlatformService.h
  44. +79 −0 SmartSignals/src/GeolocationService.cpp
  45. +63 −0 SmartSignals/src/GeolocationService.h
  46. +41 −0 SmartSignals/src/LightService.cpp
  47. +44 −0 SmartSignals/src/LightService.h
  48. +43 −0 SmartSignals/src/MagnetometerService.cpp
  49. +58 −0 SmartSignals/src/MagnetometerService.h
  50. +42 −0 SmartSignals/src/ProximityService.cpp
  51. +44 −0 SmartSignals/src/ProximityService.h
  52. +38 −0 SmartSignals/src/SmartSignalsApp.cpp
  53. +27 −0 SmartSignals/src/SmartSignalsApp.hpp
  54. +54 −0 SmartSignals/src/VirtualKeyboardService.cpp
  55. +48 −0 SmartSignals/src/VirtualKeyboardService.h
  56. +58 −0 SmartSignals/src/smartsignals.cpp
  57. +12 −0 SmartSignals/translations/Makefile
  58. +1 −0 SmartSignals/translations/SmartSignals.pro
  59. +4 −0 SmartSignals/translations/SmartSignals.ts
  60. +4 −0 SmartSignals/translations/SmartSignals_de.ts
  61. +4 −0 SmartSignals/translations/SmartSignals_en_GB.ts
  62. +4 −0 SmartSignals/translations/SmartSignals_es.ts
  63. +4 −0 SmartSignals/translations/SmartSignals_fr.ts
  64. +4 −0 SmartSignals/translations/SmartSignals_it.ts
View
209 SmartSignals/.cproject
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="com.qnx.qcc.toolChain.393762162">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.toolChain.393762162" moduleId="org.eclipse.cdt.core.settings" name="Default">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildProperties="" id="com.qnx.qcc.toolChain.393762162" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
+ <folderInfo id="com.qnx.qcc.toolChain.393762162.852563530" name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.283543653" name="com.qnx.qcc.toolChain" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.os.864441205" name="Target OS:" superClass="com.qnx.qcc.option.os"/>
+ <option id="com.qnx.qcc.option.cpu.1864286160" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.compiler.831531148" name="Compiler:" superClass="com.qnx.qcc.option.compiler"/>
+ <option id="com.qnx.qcc.option.runtime.73153325" name="Runtime:" superClass="com.qnx.qcc.option.runtime"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.641125113" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder autoBuildTarget="Device-Debug" enableAutoBuild="true" id="com.qnx.qcc.toolChain.393762162.209070138" incrementalBuildTarget="Device-Debug" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+ <tool id="com.qnx.qcc.tool.compiler.1312979667" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compiler.optlevel.1643177718" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.0" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.compiler.includePath.695495416" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4/QtCore"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/c"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/embedded"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.1691314155" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1320135971" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <inputType id="com.qnx.qcc.inputType.assembler.920918856" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1064557313" name="QCC Linker" superClass="com.qnx.qcc.tool.linker"/>
+ <tool id="com.qnx.qcc.tool.archiver.1357892099" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.toolChain.1166208200">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.toolChain.1166208200" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildProperties="" id="com.qnx.qcc.toolChain.1166208200" name="Device-Debug" parent="org.eclipse.cdt.build.core.emptycfg">
+ <folderInfo id="com.qnx.qcc.toolChain.1166208200.1512097810" name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.1572817085" name="com.qnx.qcc.toolChain" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.os.849542468" name="Target OS:" superClass="com.qnx.qcc.option.os"/>
+ <option id="com.qnx.qcc.option.cpu.103362117" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.compiler.1822941551" name="Compiler:" superClass="com.qnx.qcc.option.compiler"/>
+ <option id="com.qnx.qcc.option.runtime.399077651" name="Runtime:" superClass="com.qnx.qcc.option.runtime"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1259300673" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder autoBuildTarget="Device-Debug" enableAutoBuild="true" id="com.qnx.qcc.toolChain.1166208200.266002819" incrementalBuildTarget="Device-Debug" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+ <tool id="com.qnx.qcc.tool.compiler.8118721" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compiler.optlevel.774488599" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.0" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.compiler.includePath.1094430459" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4/QtCore"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/c"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/embedded"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.600417479" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.916512972" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <inputType id="com.qnx.qcc.inputType.assembler.742526667" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1141267033" name="QCC Linker" superClass="com.qnx.qcc.tool.linker"/>
+ <tool id="com.qnx.qcc.tool.archiver.1396473421" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.toolChain.296952375">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.toolChain.296952375" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildProperties="" id="com.qnx.qcc.toolChain.296952375" name="Device-Release" parent="org.eclipse.cdt.build.core.emptycfg">
+ <folderInfo id="com.qnx.qcc.toolChain.296952375.893155754" name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.610137637" name="com.qnx.qcc.toolChain" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.os.791255336" name="Target OS:" superClass="com.qnx.qcc.option.os"/>
+ <option id="com.qnx.qcc.option.cpu.158731983" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.compiler.1086418561" name="Compiler:" superClass="com.qnx.qcc.option.compiler"/>
+ <option id="com.qnx.qcc.option.runtime.1233145249" name="Runtime:" superClass="com.qnx.qcc.option.runtime"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1013261318" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder autoBuildTarget="Device-Release" enableAutoBuild="true" id="com.qnx.qcc.toolChain.296952375.961440761" incrementalBuildTarget="Device-Release" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+ <tool id="com.qnx.qcc.tool.compiler.89072794" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compiler.optlevel.1324783013" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.0" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.compiler.includePath.1066544057" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4/QtCore"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/c"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/embedded"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.1913030781" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1819513004" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <inputType id="com.qnx.qcc.inputType.assembler.787485224" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.688067662" name="QCC Linker" superClass="com.qnx.qcc.tool.linker"/>
+ <tool id="com.qnx.qcc.tool.archiver.1015777103" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.toolChain.1711290786">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.toolChain.1711290786" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildProperties="" id="com.qnx.qcc.toolChain.1711290786" name="Simulator-Debug" parent="org.eclipse.cdt.build.core.emptycfg">
+ <folderInfo id="com.qnx.qcc.toolChain.1711290786.362026212" name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.1466504367" name="com.qnx.qcc.toolChain" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.os.1902770407" name="Target OS:" superClass="com.qnx.qcc.option.os"/>
+ <option id="com.qnx.qcc.option.cpu.999839970" name="Target CPU:" superClass="com.qnx.qcc.option.cpu"/>
+ <option id="com.qnx.qcc.option.compiler.42447627" name="Compiler:" superClass="com.qnx.qcc.option.compiler"/>
+ <option id="com.qnx.qcc.option.runtime.786919181" name="Runtime:" superClass="com.qnx.qcc.option.runtime"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1126955206" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder autoBuildTarget="Simulator-Debug" enableAutoBuild="true" id="com.qnx.qcc.toolChain.1711290786.1973706259" incrementalBuildTarget="Simulator-Debug" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+ <tool id="com.qnx.qcc.tool.compiler.283588536" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compiler.optlevel.630713155" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.0" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.compiler.includePath.1954792615" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4/QtCore"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/c"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/embedded"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.724225247" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1336265459" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <inputType id="com.qnx.qcc.inputType.assembler.1889030859" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1737834052" name="QCC Linker" superClass="com.qnx.qcc.tool.linker"/>
+ <tool id="com.qnx.qcc.tool.archiver.1937273144" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="SmartSignals.null.961499528" name="SmartSignals"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.toolChain.296952375">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.toolChain.1711290786">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.toolChain.1166208200">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.toolChain.393762162">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+</cproject>
View
90 SmartSignals/.project
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SmartSignals</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>Device-Debug</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>Device-Debug</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.rim.tad.tools.qml.core.qmlFileBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>com.rim.tad.tools.qml.core.qmlNature</nature>
+ </natures>
+</projectDescription>
View
25 SmartSignals/.settings/org.eclipse.cdt.core.prefs
@@ -0,0 +1,25 @@
+eclipse.preferences.version=1
+environment/project/com.qnx.qcc.toolChain.1166208200/CPULIST/delimiter=,
+environment/project/com.qnx.qcc.toolChain.1166208200/CPULIST/operation=append
+environment/project/com.qnx.qcc.toolChain.1166208200/CPULIST/value=arm
+environment/project/com.qnx.qcc.toolChain.1166208200/VARIANTLIST/delimiter=,
+environment/project/com.qnx.qcc.toolChain.1166208200/VARIANTLIST/operation=append
+environment/project/com.qnx.qcc.toolChain.1166208200/VARIANTLIST/value=g
+environment/project/com.qnx.qcc.toolChain.1166208200/append=true
+environment/project/com.qnx.qcc.toolChain.1166208200/appendContributed=true
+environment/project/com.qnx.qcc.toolChain.1711290786/CPULIST/delimiter=,
+environment/project/com.qnx.qcc.toolChain.1711290786/CPULIST/operation=append
+environment/project/com.qnx.qcc.toolChain.1711290786/CPULIST/value=x86
+environment/project/com.qnx.qcc.toolChain.1711290786/VARIANTLIST/delimiter=,
+environment/project/com.qnx.qcc.toolChain.1711290786/VARIANTLIST/operation=append
+environment/project/com.qnx.qcc.toolChain.1711290786/VARIANTLIST/value=g
+environment/project/com.qnx.qcc.toolChain.1711290786/append=true
+environment/project/com.qnx.qcc.toolChain.1711290786/appendContributed=true
+environment/project/com.qnx.qcc.toolChain.296952375/CPULIST/delimiter=,
+environment/project/com.qnx.qcc.toolChain.296952375/CPULIST/operation=append
+environment/project/com.qnx.qcc.toolChain.296952375/CPULIST/value=arm
+environment/project/com.qnx.qcc.toolChain.296952375/EXCLUDE_VARIANTLIST/delimiter=,
+environment/project/com.qnx.qcc.toolChain.296952375/EXCLUDE_VARIANTLIST/operation=append
+environment/project/com.qnx.qcc.toolChain.296952375/EXCLUDE_VARIANTLIST/value=r
+environment/project/com.qnx.qcc.toolChain.296952375/append=true
+environment/project/com.qnx.qcc.toolChain.296952375/appendContributed=true
View
255 SmartSignals/LICENSE
@@ -0,0 +1,255 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+--------------------------------------------------
+
+This software includes libogg and libvorbis from http://xiph.org
+Licensed as follows:
+
+Copyright (c) 2002, Xiph.org Foundation
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+- Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+- Neither the name of the Xiph.org Foundation nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------
+
+This software (in particular soundmanager.cpp) includes gameplay
+From http://www.gameplay3d.org/
+Licensed as follows:
+
+ Copyright 2011-2012 Research In Motion Limited.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
View
35 SmartSignals/Makefile
@@ -0,0 +1,35 @@
+QMAKE_TARGET = SmartSignals
+QMAKE = $(QNX_HOST)/usr/bin/qmake
+TARGET = $(QMAKE_TARGET)
+
+
+all: Makefile $(QMAKE_TARGET)
+
+clean:
+ $(MAKE) -C ./arm -f Makefile sureclean
+ $(MAKE) -C ./x86 -f Makefile sureclean
+
+
+Makefile: FORCE
+ $(QMAKE) -spec unsupported/blackberry-armv7le-g++ -o arm/Makefile $(QMAKE_TARGET).pro CONFIG+=device
+ $(QMAKE) -spec unsupported/blackberry-x86-g++ -o x86/Makefile $(QMAKE_TARGET).pro CONFIG+=simulator
+ $(MAKE) -C ./translations -f Makefile update release
+
+FORCE:
+
+$(QMAKE_TARGET): device simulator
+
+device:
+ $(MAKE) -C ./arm -f Makefile all
+
+Device-Debug: Makefile
+ $(MAKE) -C ./arm -f Makefile debug
+
+Device-Release: Makefile
+ $(MAKE) -C ./arm -f Makefile release
+
+simulator:
+ $(MAKE) -C ./x86 -f Makefile all
+
+Simulator-Debug: Makefile
+ $(MAKE) -C ./x86 -f Makefile debug
View
9 SmartSignals/NOTICE
@@ -0,0 +1,9 @@
+SmartSignals
+Copyright (c) 2012 Research In Motion Limited (http://www.rim.com/)
+
+This product includes software developed at
+Research In Motion Limited (http://www.rim.com/).
+
+The images and logos provided in this project are proprietary to their
+owners, excluded from the Apache 2.0 license, and cannot be used for
+any other purpose.
View
35 SmartSignals/README.md
@@ -0,0 +1,35 @@
+SmartSignals - Handle C-Level BPS events in the Cascades framework
+
+========================================================================
+Sample Description.
+
+This sample shows how the AbstractBpsEventHandler interface can be extended to
+receive BPS events without needing to create a separate thread. These events
+are then made accessible to the QML layer by creating and registering a C++
+class, BPSMonitor, so it is known to QML. After registering this type the
+developer can then register to receive various events right from QML.
+
+This sample can be tested either on a real device or using a simulator in pair
+with controller.exe which can be used to perform sensor manipulations.
+
+
+========================================================================
+Requirements:
+
+BlackBerry 10 Native SDK Beta
+
+========================================================================
+Running the example:
+
+1. Download the source code
+2. Launch BlackBerry 10 Native SDK Beta, and from the File menu, select Import.
+3. Expand General, and select Existing Projects into Workspace. Click Next.
+4. Browse to the location of the source code project, and then click OK.
+5. The sample project should display in the the Projects section.
+ Click Finish to import the project into your workspace.
+6. In the Project Explorer pane, Right-click the the project and select Build Project.
+7. In the Project Explorer pane, Right-click the the project and select
+ Run As > BlackBerry C/C++ Application.
+8. The application will now install and launch on your device if not you might
+ have to set up your environment:
+ http://developer.blackberry.com/cascades/documentation/getting_started/setting_up.html
View
50 SmartSignals/SmartSignals.pro
@@ -0,0 +1,50 @@
+TEMPLATE = app
+TARGET = SmartSignals
+
+CONFIG += qt warn_on debug_and_release cascades
+
+INCLUDEPATH += ../src
+SOURCES += ../src/*.cpp
+HEADERS += ../src/*.hpp ../src/*.h
+
+lupdate_inclusion {
+ SOURCES += ../assets/*.qml
+}
+
+device {
+ CONFIG(release, debug|release) {
+ DESTDIR = o.le-v7
+ }
+ CONFIG(debug, debug|release) {
+ DESTDIR = o.le-v7-g
+ }
+}
+
+simulator {
+ CONFIG(release, debug|release) {
+ DESTDIR = o
+ }
+ CONFIG(debug, debug|release) {
+ DESTDIR = o-g
+ }
+}
+
+OBJECTS_DIR = $${DESTDIR}/.obj
+MOC_DIR = $${DESTDIR}/.moc
+RCC_DIR = $${DESTDIR}/.rcc
+UI_DIR = $${DESTDIR}/.ui
+
+suredelete.target = sureclean
+suredelete.commands = $(DEL_FILE) $${MOC_DIR}/*; $(DEL_FILE) $${RCC_DIR}/*; $(DEL_FILE) $${UI_DIR}/*
+suredelete.depends = distclean
+
+QMAKE_EXTRA_TARGETS += suredelete
+
+TRANSLATIONS = \
+ $${TARGET}_en_GB.ts \
+ $${TARGET}_fr.ts \
+ $${TARGET}_it.ts \
+ $${TARGET}_de.ts \
+ $${TARGET}_es.ts \
+ $${TARGET}.ts
+
View
48 SmartSignals/assets/.preview-1090541320027306950qml~
@@ -0,0 +1,48 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import bb.cascades 1.0
+
+ Container {
+ layout: DockLayout {}
+
+ //Refer to StatusBarLabel.qml for more info on this
+ StatusBarLabel { id: label0 }
+ StatusBarLabel { id: label1 }
+
+ //This section performs an animation on the StatusBarLabel when the label switches
+ function setText(text) {
+ var incomingLabel = null
+ var outgoingLabel = null
+ if (label1.opacity == 0) {
+ incomingLabel = label1
+ outgoingLabel = label0
+ } else {
+ incomingLabel = label0
+ outgoingLabel = label1
+ }
+ if (outgoingLabel.text !== text) {
+ incomingLabel.text = text;
+ incomingLabel.opacity = 1;
+ incomingLabel.translationY = 0
+ incomingLabel.scaleX = 1
+ incomingLabel.scaleY = 1
+ outgoingLabel.opacity = 0
+ outgoingLabel.translationY = 200
+ outgoingLabel.scaleX = .1
+ outgoingLabel.scaleY = .1
+ }
+ }
+ }
View
79 SmartSignals/assets/.preview-1533676381704176147qml~
@@ -0,0 +1,79 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import bb.cascades 1.0
+
+/**
+* This class creates a custom Button rather than rely on the Button class. This is
+* done for a few reasons:
+* 1) It allows us to specify a custom image including a shadow
+* 2) It allows us to customize the text
+* 3) It allows us to customize the animation when it is interacted with by the user
+*/
+
+Container {
+ id: container
+ property alias imageSource: cloudImage.imageSource
+ property alias shadowImageSource: shadowImage.imageSource
+ property alias text: label.text
+ signal selected()
+
+ layout: DockLayout {
+ }
+
+ ImageView {
+ id: shadowImage
+ opacity: 0.5
+ }
+
+ ImageView {
+ id: cloudImage
+ }
+
+ Label {
+ id: label
+ text: "<Text>"
+ verticalAlignment: VerticalAlignment.Center
+ horizontalAlignment: HorizontalAlignment.Center
+ textStyle {
+ fontSizeValue: 36
+ color: Color.create("#5a5a5a")
+ }
+ }
+
+ // When the button is pressed/released we display a slight animation
+ // to let the end-user know that something has occurred
+ onTouch: {
+ if (event.isDown()) {
+ container.rotationZ = 10
+ container.opacity = .5
+ shadowImage.translationX = -3;
+ shadowImage.translationY = -3;
+ cloudImage.translationX = 2;
+ cloudImage.translationY = 2;
+ } else if (event.isUp()) {
+ container.rotationZ = 0
+ container.opacity = 1
+ shadowImage.translationX = 0
+ shadowImage.translationY = 0
+ cloudImage.translationX = 0;
+ cloudImage.translationY = 0;
+ //Emit the selected() signal to notify the app that the button is pressed
+ selected();
+ }
+ }
+
+
+}
View
86 SmartSignals/assets/.preview-3354057586964008954qml~
@@ -0,0 +1,86 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import bb.cascades 1.0
+
+ImageView {
+ id: sign
+ property bool activated: false
+
+ imageSource: "asset:///images/Sign.png"
+ translationX: 640
+ translationY: 500
+ pivotY: 110
+ pivotX: -50
+
+ attachedObjects: [
+ ImplicitAnimationController {
+ propertyName: "rotationZ"
+ enabled: false
+ }
+ ]
+
+ animations: [
+ SequentialAnimation {
+ id: swingAnimation
+ animations: [
+ RotateTransition {
+ toAngleZ: 10
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: -10
+ duration: 200
+ },
+ RotateTransition {
+ toAngleZ: 5
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: -5
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: 2
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: -2
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: 0
+ duration: 100
+ }
+ ]
+ }
+ ]
+
+ function activate() {
+ sign.activated = true
+ if (swingAnimation.isPlaying()) {
+ swingAnimation.stop()
+ }
+ if (!swingAnimation.isPlaying()) {
+ swingAnimation.play()
+ }
+ sign.translationY = 320
+ }
+
+ function deactivate() {
+ sign.activated = false
+ sign.translationY = 500
+ }
+}
View
181 SmartSignals/assets/.preview-6379442569096472680qml~
@@ -0,0 +1,181 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import bb.cascades 1.0
+import bb.cascades.bps 1.0
+
+/**
+ * Use the controller.exe bundled with the simulator to manipulate the sensor
+ * readings and get a feel for how these events can be used within your application.
+ */
+
+Page {
+ content: Container {
+ attachedObjects: [
+ /*
+ * This entire block of code initializes the BlackBerry Platform Services (BPS)
+ * Monitor (BPSMonitor) class written in C++ and registers the sensors for which
+ * we would like to receive events
+ */
+ BPSMonitor {
+ id: bpsMonitor
+ //Receive events when the Azimuth Pitch and Roll change
+ azimuthPitchRollService: AzimuthPitchRollService {
+ onAzimuthPitchRollData: {
+ cloud1.rotationZ = roll
+ cloud2.rotationZ = pitch
+ cloud3.rotationZ = azimuth
+ }
+ }
+ //Receive events when the ambient light around the device changes
+ lightService: LightService {
+ id: lightService
+ onIlluminanceData: {
+ if (illuminance == 0) {
+ alertSign.opacity = 1;
+ } else {
+ // This calculation is a bit ugly but it gives a linear scale when
+ // simulating illuminance changes from controller.exe. It may be best
+ // to remove this when testing with a real device.
+ var logIlluminance = 1 - Math.pow(illuminance, 1 / 5) / 9.177;
+ // Set the opacity of the AlertSign to reflect the amount of light
+ // the device is currently receiving
+ alertSign.opacity = logIlluminance;
+ }
+ }
+ }
+ //Receive events when the keyboard becomes visible or hides
+ virtualKeyboardService: VirtualKeyboardService {
+ id: virtualKeyboardService
+ // Swipe from the bottom-left bezel towards the center of the
+ // screen to force the keyboard to be visible
+ onKeyboardVisible: {
+ statusBar.translationY = 768 - statusBar.preferredHeight - 300
+ statusBar.setText("Keyboard Visible");
+ }
+ // Press the hide keyboard button on the keyboard to hide it
+ onKeyboardHidden: {
+ statusBar.translationY = 768 - statusBar.preferredHeight
+ statusBar.setText("Keyboard Hidden");
+ }
+ }
+ //Receive events when the device changes locations
+ geolocationService: GeolocationService {
+ id: geolocationService
+ period: 20 //Receive updates every 20 seconds
+ onLocationUpdate: {
+ statusBar.setText("Location Update: " + latitude + ", " + longitude);
+ }
+ }
+ //Receive events when the device proximity sensor registers that the device
+ // has entered close proximity of another object or exited
+ proximityService: ProximityService {
+ id: proximityService
+ property int proximityVal: 1
+ onProximityData: {
+ if (proximity != proximityVal) {
+ proximityVal = proximity;
+ if (proximityVal == 0) {
+ statusBar.setText("I need some space!");
+ } else {
+ statusBar.setText("Space received, thank-you");
+ }
+ }
+ }
+ }
+ }
+ ]
+ layout: AbsoluteLayout {
+ }
+ preferredWidth: 1280
+ preferredHeight: 768
+ onCreationCompleted: {
+ lightService.setEnableSkipDuplicates(true);
+ }
+
+ // sky background
+ ImageView {
+ imageSource: "asset:///images/Sky.png"
+ }
+ AlertSign {
+ id: alertSign
+ }
+ ImageView {
+ id: hills
+ imageSource: "asset:///images/Hills.png"
+ translationY: 314.0
+ }
+ Container {
+ preferredHeight: 350
+ preferredWidth: 1280
+ layout: DockLayout {
+ }
+ // Add 3 buttons to the screen, take a look at the onSelected functions
+ // to see what happens when these are selected.
+ Container {
+ id: cloud1
+ CloudButton {
+ imageSource: "asset:///images/Cloud1.png"
+ shadowImageSource: "asset:///images/Cloud1_shadow.png"
+ text: "Azimuth"
+ onSelected: {
+ alertSign.activate()
+ statusBar.setText("Azimuth Pressed")
+ }
+ }
+ rotationZ: -10.0
+ translationX: 19.0
+ horizontalAlignment: HorizontalAlignment.Left
+ verticalAlignment: VerticalAlignment.Center
+ }
+ CloudButton {
+ id: cloud2
+ imageSource: "asset:///images/Cloud2.png"
+ shadowImageSource: "asset:///images/Cloud2_shadow.png"
+ text: "Pitch"
+ rotationZ: 1.0
+ translationY: 13.0
+ onSelected: {
+ alertSign.deactivate()
+ statusBar.setText("Pitch Pressed")
+ }
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Top
+ }
+ Container {
+ id: cloud3
+ CloudButton {
+ imageSource: "asset:///images/Cloud3.png"
+ shadowImageSource: "asset:///images/Cloud3_shadow.png"
+ text: "Roll"
+ onSelected: {
+ statusBar.setText("Roll Pressed")
+ }
+ }
+ rotationZ: 28.0
+ horizontalAlignment: HorizontalAlignment.Right
+ verticalAlignment: VerticalAlignment.Center
+ }
+ }
+
+ // The StatusBar will display some text notifications to the end user
+ StatusBar {
+ id: statusBar
+ preferredHeight: 150
+ preferredWidth: 1280
+ translationY: 768 - statusBar.preferredHeight
+ }
+ }
+}
View
32 SmartSignals/assets/.preview-8217363412039261099qml~
@@ -0,0 +1,32 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import bb.cascades 1.0
+
+//This class is a label which is used to display status updates
+//from interaction with the application or sensors
+
+Label {
+ opacity: 0
+ translationY: 200
+ scaleX: .1
+ scaleY: .1
+ verticalAlignment: VerticalAlignment.Center
+ horizontalAlignment: HorizontalAlignment.Center
+ textStyle {
+ fontSizeValue: 42
+ color: Color.White
+ }
+}
View
106 SmartSignals/assets/.preview-8831408844579486521qml~
@@ -0,0 +1,106 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import bb.cascades 1.0
+
+/**
+ * Use the controller.exe bundled with the simulator to manipulate the sensor
+ * readings and get a feel for how these events can be used within your application.
+ */
+
+Page {
+ content: Container {
+ layout: AbsoluteLayout {
+ }
+ preferredWidth: 1280
+ preferredHeight: 768
+ onCreationCompleted: {
+ lightService.setEnableSkipDuplicates(true);
+ }
+
+ // sky background
+ ImageView {
+ imageSource: "asset:///images/Sky.png"
+ }
+ AlertSign {
+ id: alertSign
+ }
+ ImageView {
+ id: hills
+ imageSource: "asset:///images/Hills.png"
+ translationY: 314.0
+ }
+ Container {
+ preferredHeight: 350
+ preferredWidth: 1280
+ layout: DockLayout {
+ }
+ // Add 3 buttons to the screen, take a look at the onSelected functions
+ // to see what happens when these are selected.
+ Container {
+ id: cloud1
+ CloudButton {
+ imageSource: "asset:///images/Cloud1.png"
+ shadowImageSource: "asset:///images/Cloud1_shadow.png"
+ text: "Azimuth"
+ onSelected: {
+ alertSign.activate()
+ statusBar.setText("Azimuth Pressed")
+ }
+ }
+ rotationZ: -10.0
+ translationX: 19.0
+ horizontalAlignment: HorizontalAlignment.Left
+ verticalAlignment: VerticalAlignment.Center
+ }
+ CloudButton {
+ id: cloud2
+ imageSource: "asset:///images/Cloud2.png"
+ shadowImageSource: "asset:///images/Cloud2_shadow.png"
+ text: "Pitch"
+ rotationZ: 1.0
+ translationY: 13.0
+ onSelected: {
+ alertSign.deactivate()
+ statusBar.setText("Pitch Pressed")
+ }
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Top
+ }
+ Container {
+ id: cloud3
+ CloudButton {
+ imageSource: "asset:///images/Cloud3.png"
+ shadowImageSource: "asset:///images/Cloud3_shadow.png"
+ text: "Roll"
+ onSelected: {
+ statusBar.setText("Roll Pressed")
+ }
+ }
+ rotationZ: 28.0
+ horizontalAlignment: HorizontalAlignment.Right
+ verticalAlignment: VerticalAlignment.Center
+ }
+ }
+
+ // The StatusBar will display some text notifications to the end user
+ StatusBar {
+ id: statusBar
+ preferredHeight: 150
+ preferredWidth: 1280
+ translationY: 768 - statusBar.preferredHeight
+ }
+ }
+}
View
86 SmartSignals/assets/AlertSign.qml
@@ -0,0 +1,86 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import bb.cascades 1.0
+
+ImageView {
+ id: sign
+ property bool activated: false
+
+ imageSource: "asset:///images/Sign.png"
+ translationX: 640
+ translationY: 500
+ pivotY: 110
+ pivotX: -50
+
+ attachedObjects: [
+ ImplicitAnimationController {
+ propertyName: "rotationZ"
+ enabled: false
+ }
+ ]
+
+ animations: [
+ SequentialAnimation {
+ id: swingAnimation
+ animations: [
+ RotateTransition {
+ toAngleZ: 10
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: -10
+ duration: 200
+ },
+ RotateTransition {
+ toAngleZ: 5
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: -5
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: 2
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: -2
+ duration: 100
+ },
+ RotateTransition {
+ toAngleZ: 0
+ duration: 100
+ }
+ ]
+ }
+ ]
+
+ function activate() {
+ sign.activated = true
+ if (swingAnimation.isPlaying()) {
+ swingAnimation.stop()
+ }
+ if (!swingAnimation.isPlaying()) {
+ swingAnimation.play()
+ }
+ sign.translationY = 320
+ }
+
+ function deactivate() {
+ sign.activated = false
+ sign.translationY = 500
+ }
+}
View
79 SmartSignals/assets/CloudButton.qml
@@ -0,0 +1,79 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import bb.cascades 1.0
+
+/**
+* This class creates a custom Button rather than rely on the Button class. This is
+* done for a few reasons:
+* 1) It allows us to specify a custom image including a shadow
+* 2) It allows us to customize the text
+* 3) It allows us to customize the animation when it is interacted with by the user
+*/
+
+Container {
+ id: container
+ property alias imageSource: cloudImage.imageSource
+ property alias shadowImageSource: shadowImage.imageSource
+ property alias text: label.text
+ signal selected()
+
+ layout: DockLayout {
+ }
+
+ ImageView {
+ id: shadowImage
+ opacity: 0.5
+ }
+
+ ImageView {
+ id: cloudImage
+ }
+
+ Label {
+ id: label
+ text: "<Text>"
+ verticalAlignment: VerticalAlignment.Center
+ horizontalAlignment: HorizontalAlignment.Center
+ textStyle {
+ fontSize: FontSize.XXLarge
+ color: Color.create("#5a5a5a")
+ }
+ }
+
+ // When the button is pressed/released we display a slight animation
+ // to let the end-user know that something has occurred
+ onTouch: {
+ if (event.isDown()) {
+ container.rotationZ = 10
+ container.opacity = .5
+ shadowImage.translationX = -3;
+ shadowImage.translationY = -3;
+ cloudImage.translationX = 2;
+ cloudImage.translationY = 2;
+ } else if (event.isUp()) {
+ container.rotationZ = 0
+ container.opacity = 1
+ shadowImage.translationX = 0
+ shadowImage.translationY = 0
+ cloudImage.translationX = 0;
+ cloudImage.translationY = 0;
+ //Emit the selected() signal to notify the app that the button is pressed
+ selected();
+ }
+ }
+
+
+}
View
48 SmartSignals/assets/StatusBar.qml
@@ -0,0 +1,48 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import bb.cascades 1.0
+
+ Container {
+ layout: DockLayout {}
+
+ //Refer to StatusBarLabel.qml for more info on this
+ StatusBarLabel { id: label0 }
+ StatusBarLabel { id: label1 }
+
+ //This section performs an animation on the StatusBarLabel when the label switches
+ function setText(text) {
+ var incomingLabel = null
+ var outgoingLabel = null
+ if (label1.opacity == 0) {
+ incomingLabel = label1
+ outgoingLabel = label0
+ } else {
+ incomingLabel = label0
+ outgoingLabel = label1
+ }
+ if (outgoingLabel.text !== text) {
+ incomingLabel.text = text;
+ incomingLabel.opacity = 1;
+ incomingLabel.translationY = 0
+ incomingLabel.scaleX = 1
+ incomingLabel.scaleY = 1
+ outgoingLabel.opacity = 0
+ outgoingLabel.translationY = 200
+ outgoingLabel.scaleX = .1
+ outgoingLabel.scaleY = .1
+ }
+ }
+ }
View
32 SmartSignals/assets/StatusBarLabel.qml
@@ -0,0 +1,32 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import bb.cascades 1.0
+
+//This class is a label which is used to display status updates
+//from interaction with the application or sensors
+
+Label {
+ opacity: 0
+ translationY: 200
+ scaleX: .1
+ scaleY: .1
+ verticalAlignment: VerticalAlignment.Center
+ horizontalAlignment: HorizontalAlignment.Center
+ textStyle {
+ fontSizeValue: 42
+ color: Color.White
+ }
+}
View
BIN SmartSignals/assets/images/Cloud1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SmartSignals/assets/images/Cloud1_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SmartSignals/assets/images/Cloud2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SmartSignals/assets/images/Cloud2_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SmartSignals/assets/images/Cloud3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SmartSignals/assets/images/Cloud3_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SmartSignals/assets/images/Hills.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SmartSignals/assets/images/Sign.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SmartSignals/assets/images/Sky.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
181 SmartSignals/assets/main.qml
@@ -0,0 +1,181 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import bb.cascades 1.0
+import bb.cascades.bps 1.0
+
+/**
+ * Use the controller.exe bundled with the simulator to manipulate the sensor
+ * readings and get a feel for how these events can be used within your application.
+ */
+
+Page {
+ content: Container {
+ attachedObjects: [
+ /*
+ * This entire block of code initializes the BlackBerry Platform Services (BPS)
+ * Monitor (BPSMonitor) class written in C++ and registers the sensors for which
+ * we would like to receive events
+ */
+ BPSMonitor {
+ id: bpsMonitor
+ //Receive events when the Azimuth Pitch and Roll change
+ azimuthPitchRollService: AzimuthPitchRollService {
+ onAzimuthPitchRollData: {
+ cloud1.rotationZ = roll
+ cloud2.rotationZ = pitch
+ cloud3.rotationZ = azimuth
+ }
+ }
+ //Receive events when the ambient light around the device changes
+ lightService: LightService {
+ id: lightService
+ onIlluminanceData: {
+ if (illuminance == 0) {
+ alertSign.opacity = 1;
+ } else {
+ // This calculation is a bit ugly but it gives a linear scale when
+ // simulating illuminance changes from controller.exe. It may be best
+ // to remove this when testing with a real device.
+ var logIlluminance = 1 - Math.pow(illuminance, 1 / 5) / 9.177;
+ // Set the opacity of the AlertSign to reflect the amount of light
+ // the device is currently receiving
+ alertSign.opacity = logIlluminance;
+ }
+ }
+ }
+ //Receive events when the keyboard becomes visible or hides
+ virtualKeyboardService: VirtualKeyboardService {
+ id: virtualKeyboardService
+ // Swipe from the bottom-left bezel towards the center of the
+ // screen to force the keyboard to be visible
+ onKeyboardVisible: {
+ statusBar.translationY = 768 - statusBar.preferredHeight - 300
+ statusBar.setText("Keyboard Visible");
+ }
+ // Press the hide keyboard button on the keyboard to hide it
+ onKeyboardHidden: {
+ statusBar.translationY = 768 - statusBar.preferredHeight
+ statusBar.setText("Keyboard Hidden");
+ }
+ }
+ //Receive events when the device changes locations
+ geolocationService: GeolocationService {
+ id: geolocationService
+ period: 20 //Receive updates every 20 seconds
+ onLocationUpdate: {
+ statusBar.setText("Location Update: " + latitude + ", " + longitude);
+ }
+ }
+ //Receive events when the device proximity sensor registers that the device
+ // has entered close proximity of another object or exited
+ proximityService: ProximityService {
+ id: proximityService
+ property int proximityVal: 1
+ onProximityData: {
+ if (proximity != proximityVal) {
+ proximityVal = proximity;
+ if (proximityVal == 0) {
+ statusBar.setText("I need some space!");
+ } else {
+ statusBar.setText("Space received, thank-you");
+ }
+ }
+ }
+ }
+ }
+ ]
+ layout: AbsoluteLayout {
+ }
+ preferredWidth: 1280
+ preferredHeight: 768
+ onCreationCompleted: {
+ lightService.setEnableSkipDuplicates(true);
+ }
+
+ // sky background
+ ImageView {
+ imageSource: "asset:///images/Sky.png"
+ }
+ AlertSign {
+ id: alertSign
+ }
+ ImageView {
+ id: hills
+ imageSource: "asset:///images/Hills.png"
+ translationY: 314.0
+ }
+ Container {
+ preferredHeight: 350
+ preferredWidth: 1280
+ layout: DockLayout {
+ }
+ // Add 3 buttons to the screen, take a look at the onSelected functions
+ // to see what happens when these are selected.
+ Container {
+ id: cloud1
+ CloudButton {
+ imageSource: "asset:///images/Cloud1.png"
+ shadowImageSource: "asset:///images/Cloud1_shadow.png"
+ text: "Azimuth"
+ onSelected: {
+ alertSign.activate()
+ statusBar.setText("Azimuth Pressed")
+ }
+ }
+ rotationZ: -10.0
+ translationX: 19.0
+ horizontalAlignment: HorizontalAlignment.Left
+ verticalAlignment: VerticalAlignment.Center
+ }
+ CloudButton {
+ id: cloud2
+ imageSource: "asset:///images/Cloud2.png"
+ shadowImageSource: "asset:///images/Cloud2_shadow.png"
+ text: "Pitch"
+ rotationZ: 1.0
+ translationY: 13.0
+ onSelected: {
+ alertSign.deactivate()
+ statusBar.setText("Pitch Pressed")
+ }
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Top
+ }
+ Container {
+ id: cloud3
+ CloudButton {
+ imageSource: "asset:///images/Cloud3.png"
+ shadowImageSource: "asset:///images/Cloud3_shadow.png"
+ text: "Roll"
+ onSelected: {
+ statusBar.setText("Roll Pressed")
+ }
+ }
+ rotationZ: 28.0
+ horizontalAlignment: HorizontalAlignment.Right
+ verticalAlignment: VerticalAlignment.Center
+ }
+ }
+
+ // The StatusBar will display some text notifications to the end user
+ StatusBar {
+ id: statusBar
+ preferredHeight: 150
+ preferredWidth: 1280
+ translationY: 768 - statusBar.preferredHeight
+ }
+ }
+}
View
117 SmartSignals/bar-descriptor.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!--
+
+ Copyright (c) 2011, 2012 Research In Motion Limited.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
+
+<!-- BlackBerry Tablet OS application descriptor file.
+
+ Specifies parameters for identifying, installing, and launching native applications on BlackBerry Tablet OS.
+
+-->
+
+ <!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
+ Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
+ <id>com.example.SmartSignals</id>
+
+ <!-- The name that is displayed in the BlackBerry Tablet OS application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <name>SmartSignals</name>
+
+ <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
+ Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
+ An updated version of application must have a versionNumber value higher than the previous version. Required. -->
+ <versionNumber>1.0.0</versionNumber>
+
+ <!-- Fourth digit segment of the package version. First three segments are taken from the
+ <versionNumber> element. Must be an integer from 0 to 2^16-1 -->
+ <buildId>1</buildId>
+
+ <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
+ <!-- <versionLabel></versionLabel> -->
+
+ <!-- Description, displayed in the BlackBerry Tablet OS application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <description>The SmartSignals application</description>
+
+ <!-- Copyright information. Optional. -->
+ <!-- <copyright></copyright> -->
+
+ <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
+ <author>Example Inc.</author>
+
+ <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
+ <!-- <authorId>ABC1234YjsnUk235h</authorId> -->
+
+ <initialWindow>
+ <aspectRatio>landscape</aspectRatio>
+ <autoOrients>false</autoOrients>
+ <systemChrome>none</systemChrome>
+ <transparent>false</transparent>
+ </initialWindow>
+
+ <!-- The category where the application appears. Either core.games or core.media. -->
+ <category>core.games</category>
+ <configuration id="com.qnx.qcc.toolChain.393762162" name="Default">
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset path="arm/o.le-v7-g/SmartSignals" entry="true" type="Qnx/Elf">SmartSignals</asset>
+ </configuration>
+ <configuration id="com.qnx.qcc.toolChain.1166208200" name="Device-Debug">
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset path="arm/o.le-v7-g/SmartSignals" entry="true" type="Qnx/Elf">SmartSignals</asset>
+ </configuration>
+ <configuration id="com.qnx.qcc.toolChain.296952375" name="Device-Release">
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset path="arm/o.le-v7/SmartSignals" entry="true" type="Qnx/Elf">SmartSignals</asset>
+ </configuration>
+ <configuration id="com.qnx.qcc.toolChain.1711290786" name="Simulator-Debug">
+ <platformArchitecture>x86</platformArchitecture>
+ <asset path="x86/o-g/SmartSignals" entry="true" type="Qnx/Elf">SmartSignals</asset>
+ </configuration>
+
+ <!-- The icon for the application, which should be 86x86. -->
+ <icon>
+ <image>icon.png</image>
+ </icon>
+
+ <asset path="icon.png">icon.png</asset>
+ <asset path="assets">assets</asset>
+ <!-- The splash screen that will appear when your application is launching. Should be 1024x600. -->
+ <!-- <splashscreen></splashscreen> -->
+
+ <!-- Locale support -->
+ <asset path="translations" dest="qm">
+ <include name="*.qm"/>
+ </asset>
+
+ <!-- Request permission to execute native code. Required for native applications. -->
+ <action system="true">run_native</action>
+ <action>read_geolocation</action>
+ <env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>
+
+ <!-- The permissions requested by your application. -->
+ <!-- <action>access_shared</action> -->
+ <!-- <action>record_audio</action> -->
+ <!-- <action>read_geolocation</action> -->
+ <!-- <action>use_camera</action> -->
+ <!-- <action>access_internet</action> -->
+ <!-- <action>play_audio</action> -->
+ <!-- <action>post_notification</action> -->
+ <!-- <action>set_audio_volume</action> -->
+ <!-- <action>read_device_identifying_information</action> -->
+
+</qnx>
View
4 SmartSignals/device-assets.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<assets>
+ <target-device width="768" height="1280" ppi="356" class="phone"/>
+</assets>
View
BIN SmartSignals/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
98 SmartSignals/src/AbstractSensorService.cpp
@@ -0,0 +1,98 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "AbstractSensorService.h"
+#include <QDateTime>
+#include <iostream>
+
+namespace bb {
+namespace cascades {
+namespace bps {
+
+AbstractSensorService::AbstractSensorService(sensor_type_t sensorType,
+ QObject *parent) :
+ BlackBerryPlatformService(parent), m_sensorType(sensorType) {
+}
+AbstractSensorService::~AbstractSensorService() {
+}
+
+bool AbstractSensorService::isSupported() {
+ return sensor_is_supported(m_sensorType);
+}
+
+void AbstractSensorService::setCalibrationEnabled(bool calibrationEnabled) {
+ m_calibrationEnabled = calibrationEnabled;
+ m_calibrationEnabledSet = true;
+}
+
+void AbstractSensorService::setEnableSkipDuplicates(bool enableSkipDuplicates) {
+ m_enableSkipDuplicates = enableSkipDuplicates;
+ m_enableSkipDuplicatesSet = true;
+}
+
+void AbstractSensorService::setEventRate(unsigned int rate) {
+ m_rate = rate;
+ m_rateSet = true;
+}
+
+void AbstractSensorService::setBackgroundEnabled(bool backgroundEnabled) {
+ m_backgroundEnabled = backgroundEnabled;
+ m_backgroundEnabledSet = true;
+}
+
+void AbstractSensorService::requestEvents() {
+ if (m_calibrationEnabledSet)
+ sensor_set_calibration(m_sensorType, m_calibrationEnabled);
+ if (m_rateSet)
+ sensor_set_rate(m_sensorType, m_rate);
+ if (m_enableSkipDuplicatesSet)
+ sensor_set_skip_duplicates(m_sensorType, m_enableSkipDuplicates);
+ //if (m_backgroundEnabledSet) sensor_set_background(m_sensorType, m_backgroundEnabled);
+ sensor_request_events(m_sensorType);
+}
+
+int AbstractSensorService::eventDomain() {
+ return sensor_get_domain();
+}
+
+unsigned long long AbstractSensorService::getTimestamp(bps_event_t *event) {
+ //unsigned long long timestamp = sensor_event_get_timestamp(event);
+ unsigned long long timestamp = QDateTime::currentMSecsSinceEpoch();
+ return timestamp;
+}
+
+AbstractSensorService::SensorAccuracy AbstractSensorService::getAccuracy(
+ bps_event_t *event) {
+ SensorAccuracy accuracy = AccuracyUnreliable;
+ switch (sensor_event_get_accuracy(event)) {
+ case SENSOR_ACCURACY_UNRELIABLE:
+ accuracy = AccuracyUnreliable;
+ break;
+ case SENSOR_ACCURACY_LOW:
+ accuracy = AccuracyLow;
+ break;
+ case SENSOR_ACCURACY_MEDIUM:
+ accuracy = AccuracyMedium;
+ break;
+ case SENSOR_ACCURACY_HIGH:
+ accuracy = AccuracyHigh;
+ break;
+ }
+ return accuracy;
+}
+
+} /* namespace bps */
+} /* namespace cascades */
+} /* namespace bb */
View
76 SmartSignals/src/AbstractSensorService.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef ABSTRACTSENSORSERVICE_H_
+#define ABSTRACTSENSORSERVICE_H_
+
+#include "BlackBerryPlatformService.h"
+#include <bps/sensor.h>
+
+namespace bb {
+namespace cascades {
+namespace bps {
+
+class AbstractSensorService: public BlackBerryPlatformService {
+ Q_OBJECT
+ Q_ENUMS(SensorAccuracy)
+
+public:
+ /**
+ * The accuracy levels for a sensor reading.
+ */
+ enum SensorAccuracy {
+ AccuracyUnreliable = 0,
+ AccuracyLow = 1,
+ AccuracyMedium = 2,
+ AccuracyHigh = 3
+ };
+
+ AbstractSensorService(sensor_type_t sensorType, QObject *parent = 0);
+ virtual ~AbstractSensorService();
+
+ Q_INVOKABLE bool isSupported();
+ Q_INVOKABLE void setCalibrationEnabled(bool calibrationEnabled);
+ Q_INVOKABLE void setEnableSkipDuplicates(bool enableSkipDuplicates);
+ Q_INVOKABLE void setEventRate(unsigned int rate);
+ Q_INVOKABLE void setBackgroundEnabled(bool backgroundEnabled);
+
+ virtual void requestEvents();
+ virtual int eventDomain();
+
+protected:
+ SensorAccuracy getAccuracy(bps_event_t *event);
+ unsigned long long getTimestamp(bps_event_t *event);
+
+private:
+ sensor_type_t m_sensorType;
+ bool m_calibrationEnabled;
+ bool m_calibrationEnabledSet;
+ bool m_enableSkipDuplicates;
+ bool m_enableSkipDuplicatesSet;
+ unsigned int m_rate;
+ bool m_rateSet;
+ bool m_backgroundEnabled;
+ bool m_backgroundEnabledSet;
+};
+
+} /* namespace bps */
+} /* namespace cascades */
+} /* namespace bb */
+
+Q_DECLARE_METATYPE( bb::cascades::bps::AbstractSensorService::SensorAccuracy );
+QML_DECLARE_TYPE(bb::cascades::bps::AbstractSensorService)
+
+#endif /* ABSTRACTSENSORSERVICE_H_ */
View
43 SmartSignals/src/AccelerometerService.cpp
@@ -0,0 +1,43 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "AccelerometerService.h"
+#include <iostream>
+
+namespace bb {
+namespace cascades {
+namespace bps {
+
+AccelerometerService::AccelerometerService(QObject *parent) : AbstractSensorService(SENSOR_TYPE_ACCELEROMETER, parent) {
+}
+
+AccelerometerService::~AccelerometerService() {
+}
+
+void AccelerometerService::handleEvent(bps_event_t *event) {
+ uint16_t code = bps_event_get_code(event);
+ if (code == SENSOR_ACCELEROMETER_READING) {
+ float x, y, z;
+ sensor_event_get_xyz(event, &x, &y, &z);
+ unsigned long long timestamp = getTimestamp(event);
+ SensorAccuracy accuracy = getAccuracy(event);
+
+ Q_EMIT accelerometerData(x, y, z, timestamp, accuracy);
+ }
+}
+
+} /* namespace bps */
+} /* namespace cascades */
+} /* namespace bb */
View
58 SmartSignals/src/AccelerometerService.h
@@ -0,0 +1,58 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef ACCELEROMETER_H_
+#define ACCELEROMETER_H_
+
+#include "AbstractSensorService.h"
+
+namespace bb {
+namespace cascades {
+namespace bps {
+
+class AccelerometerService : public AbstractSensorService {
+ Q_OBJECT
+
+public:
+ AccelerometerService(QObject *parent = 0);
+ virtual ~AccelerometerService();
+
+ virtual void handleEvent(bps_event_t *event);
+
+Q_SIGNALS:
+ /**
+ * @brief Emitted when accelerometer data is available.
+ *
+ * @details The accelerometer measures the acceleration on each axis.
+ *
+ * @param x Acceleration minus Gx on the x-axis, in SI units (m/s^2)
+ * @param y Acceleration minus Gy on the y-axis, in SI units (m/s^2)
+ * @param z Acceleration minus Gz on the z-axis, in SI units (m/s^2)
+ * @param timestamp A monotonic timestamp (not date/time) that can be used to synchronize and/or
+ * fuse different sensor events.
+ * @param accuracy The accuracy of the sensor reading.
+ *
+ * @return None.
+ */
+ void accelerometerData(float x, float y, float z, unsigned long long timestamp, SensorAccuracy accuracy);
+};
+
+} /* namespace bps */
+} /* namespace cascades */
+} /* namespace bb */
+
+QML_DECLARE_TYPE(bb::cascades::bps::AccelerometerService)
+
+#endif /* ACCELEROMETER_H_ */
View
42 SmartSignals/src/AzimuthPitchRollService.cpp
@@ -0,0 +1,42 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "AzimuthPitchRollService.h"
+
+namespace bb {
+namespace cascades {
+namespace bps {
+
+AzimuthPitchRollService::AzimuthPitchRollService(QObject *parent) : AbstractSensorService(SENSOR_TYPE_AZIMUTH_PITCH_ROLL, parent) {
+}
+
+AzimuthPitchRollService::~AzimuthPitchRollService() {
+}
+
+void AzimuthPitchRollService::handleEvent(bps_event_t *event) {
+ uint16_t code = bps_event_get_code(event);
+ if (code == SENSOR_AZIMUTH_PITCH_ROLL_READING) {
+ float azimuth, pitch, roll;
+ sensor_event_get_apr(event, &azimuth, &pitch, &roll);
+ unsigned long long timestamp = getTimestamp(event);
+ SensorAccuracy accuracy = getAccuracy(event);
+
+ Q_EMIT azimuthPitchRollData(azimuth, pitch, roll, timestamp, accuracy);
+ }
+}
+
+} /* namespace bps */
+} /* namespace cascades */
+} /* namespace bb */
View
44 SmartSignals/src/AzimuthPitchRollService.h
@@ -0,0 +1,44 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef AZIMUTHPITCHROLLSERVICE_H_
+#define AZIMUTHPITCHROLLSERVICE_H_