From 0b624384cd52be20e61284551d832b499d7b7707 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Sat, 14 Apr 2012 12:56:48 +0100 Subject: Imported Upstream version 2.1.8.20120216 --- Java/com_phidgets_EncoderPhidget.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Java/com_phidgets_EncoderPhidget.c (limited to 'Java/com_phidgets_EncoderPhidget.c') diff --git a/Java/com_phidgets_EncoderPhidget.c b/Java/com_phidgets_EncoderPhidget.c new file mode 100644 index 0000000..e46389e --- /dev/null +++ b/Java/com_phidgets_EncoderPhidget.c @@ -0,0 +1,31 @@ +#include "../stdafx.h" +#include "phidget_jni.h" +#include "com_phidgets_EncoderPhidget.h" +#include "../cphidgetencoder.h" + +EVENT_VARS(inputChange, InputChange) +EVENT_VARS(encoderPositionChange, EncoderPositionChange) + +JNI_LOAD(enc, Encoder) + EVENT_VAR_SETUP(enc, inputChange, InputChange, IZ, V) + EVENT_VAR_SETUP(enc, encoderPositionChange, EncoderPositionChange, III, V) +} + +EVENT_HANDLER_INDEXED(Encoder, inputChange, InputChange, + CPhidgetEncoder_set_OnInputChange_Handler, int) +EVENT_HANDLER_INDEXED2(Encoder, encoderPositionChange, EncoderPositionChange, + CPhidgetEncoder_set_OnPositionChange_Handler, int, int) + +JNI_CREATE(Encoder) +JNI_INDEXED_GETFUNC(Encoder, Position, Position, jint) +JNI_INDEXED_SETFUNC(Encoder, Position, Position, jint) +JNI_INDEXED_GETFUNCBOOL(Encoder, InputState, InputState) +JNI_GETFUNC(Encoder, EncoderCount, EncoderCount, jint) +JNI_GETFUNC(Encoder, InputCount, InputCount, jint) +JNI_INDEXED_GETFUNC(Encoder, IndexPosition, IndexPosition, jint) +JNI_INDEXED_GETFUNCBOOL(Encoder, Enabled, Enabled) +JNI_INDEXED_SETFUNC(Encoder, Enabled, Enabled, jboolean) + +//Deprecated +JNI_INDEXED_GETFUNC(Encoder, EncoderPosition, Position, jint) +JNI_INDEXED_SETFUNC(Encoder, EncoderPosition, Position, jint) -- cgit v1.2.3