aboutsummaryrefslogtreecommitdiffstats
path: root/Java/com_phidgets_EncoderPhidget.c
blob: e46389e97dfc49780de6f6fe156f9155cb3aa5b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)