xwords/xwords4/android/andutils.h
ehouse 68079d3590 Add ability to open utf8-formatted dicts and to display bitmap tiles
(though poorly.)  Both required processing in the jni that isn't
possible (e.g. because no libiconv included) so I created callbacks
into java from the dict building code.  Add ability to download dicts,
to select them, to add and remove players and make them robots or
human.  Robot-vs-robot game doesn't work well (robots trade a lot and
server_do seems not to be getting called enough) but will soon.
Coalesce penMove events.  Implement game list menuitems like delete,
copy, etc.
2010-01-25 02:49:14 +00:00

41 lines
1.4 KiB
C

#ifndef _ANDUTILS_H_
#define _ANDUTILS_H_
#include <jni.h>
#include "comtypes.h"
#include "mempool.h"
#include "dictnry.h"
XP_U32 and_ntohl(XP_U32 l);
XP_U16 and_ntohs(XP_U16 l);
XP_U32 and_htonl(XP_U32 l);
XP_U16 and_htons(XP_U16 l);
bool getInt( JNIEnv* env, jobject obj, const char* name, int* result );
bool setInt( JNIEnv* env, jobject obj, const char* name, int value );
bool getBool( JNIEnv* env, jobject obj, const char* name, XP_Bool* result );
bool setBool( JNIEnv* env, jobject obj, const char* name, bool value );
bool setString( JNIEnv* env, jobject obj, const char* name, const XP_UCHAR* value );
bool getString( JNIEnv* env, jobject jlp, const char* name, XP_UCHAR* buf,
int bufLen );
bool getObject( JNIEnv* env, jobject obj, const char* name, const char* sig,
jobject* ret );
jintArray makeIntArray( JNIEnv *env, int size, const jint* vals );
int getIntFromArray( JNIEnv* env, jintArray arr, bool del );
jbooleanArray makeBooleanArray( JNIEnv *env, int size, const jboolean* vals );
jobjectArray makeStringArray( JNIEnv *env, int size, const XP_UCHAR** vals );
jstring streamToJString( MPFORMAL JNIEnv* env, XWStreamCtxt* stream );
jobjectArray makeBitmapsArray( JNIEnv* env, const XP_Bitmaps* bitmaps );
/* Note: jmethodID can be cached. Should not look up more than once. */
jmethodID getMethodID( JNIEnv* env, jobject obj, const char* proc,
const char* sig );
#endif