droid:jni, extend input device handling
authordavilla <davilla@4pi.com>
Sun, 20 Oct 2013 20:23:32 +0000 (16:23 -0400)
committerdavilla <davilla@4pi.com>
Fri, 1 Nov 2013 20:29:28 +0000 (16:29 -0400)
xbmc/android/jni/List.cpp
xbmc/android/jni/View.cpp
xbmc/android/jni/View.h

index af36d84..bd2e7dc 100644 (file)
  */
 
 #include "List.h"
-#include "jutils/jutils-details.hpp"
+#include "View.h"
 #include "ScanResult.h"
 #include "WifiConfiguration.h"
 #include "ApplicationInfo.h"
 
+#include "jutils/jutils-details.hpp"
+
 using namespace jni;
 
 template <typename T>
@@ -44,3 +46,4 @@ int CJNIList<T>::size()
 template class CJNIList<CJNIScanResult>;
 template class CJNIList<CJNIWifiConfiguration>;
 template class CJNIList<CJNIApplicationInfo>;
+template class CJNIList<CJNIViewInputDeviceMotionRange>;
index e45bb55..2667a97 100644 (file)
@@ -86,6 +86,18 @@ std::string CJNIViewInputDevice::getName() const
     "getName", "()Ljava/lang/String;"));
 }
 
+int CJNIViewInputDevice::getSources() const
+{
+  return call_method<int>(m_object,
+    "getSources", "()I");
+}
+
+const CJNIList<CJNIViewInputDeviceMotionRange> CJNIViewInputDevice::getMotionRanges() const
+{
+  return call_method<jhobject>(m_object,
+    "getMotionRanges", "()Ljava/util/List;");
+}
+
 const CJNIViewInputDeviceMotionRange CJNIViewInputDevice::getMotionRange(int axis) const
 {
   return call_method<jhobject>(m_object,
@@ -93,6 +105,13 @@ const CJNIViewInputDeviceMotionRange CJNIViewInputDevice::getMotionRange(int axi
     axis);
 }
 
+const CJNIViewInputDeviceMotionRange CJNIViewInputDevice::getMotionRange(int axis, int source) const
+{
+  return call_method<jhobject>(m_object,
+    "getMotionRange", "(II)Landroid/view/InputDevice$MotionRange;",
+    axis, source);
+}
+
 /************************************************************************/
 /************************************************************************/
 int CJNIView::SYSTEM_UI_FLAG_FULLSCREEN(0);
index 7adb129..1284024 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "JNIBase.h"
+#include "List.h"
 
 class CJNIViewInputDeviceMotionRange : public CJNIBase
 {
@@ -48,7 +49,10 @@ public:
   static const CJNIViewInputDevice getDevice(int id);
 
   std::string  getName() const;
+  int          getSources() const;
+  const CJNIList<CJNIViewInputDeviceMotionRange> getMotionRanges() const;
   const CJNIViewInputDeviceMotionRange getMotionRange(int axis) const;
+  const CJNIViewInputDeviceMotionRange getMotionRange(int axis, int source) const;
 
 private:
   CJNIViewInputDevice();