#ifndef _JNI_UTILITY_H_
#define _JNI_UTILITY_H_
#if ENABLE(JAVA_BINDINGS)
#include <list.h>
#include <JavaVM/jni.h>
typedef enum {
invalid_type = 0,
void_type,
object_type,
boolean_type,
byte_type,
char_type,
short_type,
int_type,
long_type,
float_type,
double_type,
array_type
} JNIType;
namespace KJS {
namespace Bindings {
class JavaParameter;
const char *getCharactersFromJString(jstring aJString);
void releaseCharactersForJString(jstring aJString, const char *s);
const char *getCharactersFromJStringInEnv(JNIEnv *env, jstring aJString);
void releaseCharactersForJStringInEnv(JNIEnv *env, jstring aJString, const char *s);
const jchar *getUCharactersFromJStringInEnv(JNIEnv *env, jstring aJString);
void releaseUCharactersForJStringInEnv(JNIEnv *env, jstring aJString, const jchar *s);
JNIType JNITypeFromClassName(const char *name);
JNIType JNITypeFromPrimitiveType(char type);
const char *signatureFromPrimitiveType(JNIType type);
jvalue convertValueToJValue(ExecState *exec, JSValue *value, JNIType _JNIType, const char *javaClassName);
jvalue getJNIField(jobject obj, JNIType type, const char *name, const char *signature);
jmethodID getMethodID(jobject obj, const char *name, const char *sig);
jobject callJNIObjectMethod(jobject obj, const char *name, const char *sig, ... );
void callJNIVoidMethod(jobject obj, const char *name, const char *sig, ... );
jboolean callJNIBooleanMethod(jobject obj, const char *name, const char *sig, ... );
jboolean callJNIStaticBooleanMethod(jclass cls, const char *name, const char *sig, ... );
jbyte callJNIByteMethod(jobject obj, const char *name, const char *sig, ... );
jchar callJNICharMethod(jobject obj, const char *name, const char *sig, ... );
jshort callJNIShortMethod(jobject obj, const char *name, const char *sig, ... );
jint callJNIIntMethod(jobject obj, const char *name, const char *sig, ... );
jlong callJNILongMethod(jobject obj, const char *name, const char *sig, ... );
jfloat callJNIFloatMethod(jobject obj, const char *name, const char *sig, ... );
jdouble callJNIDoubleMethod(jobject obj, const char *name, const char *sig, ... );
jobject callJNIObjectMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
void callJNIVoidMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jboolean callJNIBooleanMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jbyte callJNIByteMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jchar callJNICharMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jshort callJNIShortMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jint callJNIIntMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jlong callJNILongMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jfloat callJNIFloatMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jdouble callJNIDoubleMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
jobject callJNIObjectMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
void callJNIVoidMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
jboolean callJNIBooleanMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
jbyte callJNIByteMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
jchar callJNICharMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
jshort callJNIShortMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
jint callJNIIntMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
jlong callJNILongMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
jfloat callJNIFloatMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
jdouble callJNIDoubleMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
JavaVM *getJavaVM();
void setJavaVM(JavaVM *javaVM);
JNIEnv *getJNIEnv();
bool dispatchJNICall(const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, JSValue *&exceptionDescription);
}
}
#endif // ENABLE(JAVA_BINDINGS)
#endif // _JNI_UTILITY_H_