am 9b392364: Cleanup headers.

* commit '9b392364b7c59a143e66a8ef1d1149a47843d124':
  Cleanup headers.
main
Ken Wakasa 2012-08-08 01:40:01 -07:00 committed by Android Git Automerger
commit 66bbf38aab
4 changed files with 9 additions and 12 deletions

View File

@ -16,8 +16,6 @@
#define LOG_TAG "LatinIME: jni: ProximityInfo"
#include <string>
#include "com_android_inputmethod_keyboard_ProximityInfo.h"
#include "jni.h"
#include "jni_common.h"
@ -26,14 +24,13 @@
namespace latinime {
static jlong latinime_Keyboard_setProximityInfo(JNIEnv *env, jobject object,
jstring localejStr, jint maxProximityCharsSize, jint displayWidth, jint displayHeight,
jstring localeJStr, jint maxProximityCharsSize, jint displayWidth, jint displayHeight,
jint gridWidth, jint gridHeight, jint mostCommonkeyWidth, jintArray proximityCharsArray,
jint keyCount, jintArray keyXCoordinateArray, jintArray keyYCoordinateArray,
jintArray keyWidthArray, jintArray keyHeightArray, jintArray keyCharCodeArray,
jfloatArray sweetSpotCenterXArray, jfloatArray sweetSpotCenterYArray,
jfloatArray sweetSpotRadiusArray) {
const char *localeStrPtr = env->GetStringUTFChars(localejStr, 0);
const std::string localeStr(localeStrPtr);
const char *localeCStr = env->GetStringUTFChars(localeJStr, 0);
jint *proximityChars = env->GetIntArrayElements(proximityCharsArray, 0);
jint *keyXCoordinates = safeGetIntArrayElements(env, keyXCoordinateArray);
jint *keyYCoordinates = safeGetIntArrayElements(env, keyYCoordinateArray);
@ -44,7 +41,7 @@ static jlong latinime_Keyboard_setProximityInfo(JNIEnv *env, jobject object,
jfloat *sweetSpotCenterYs = safeGetFloatArrayElements(env, sweetSpotCenterYArray);
jfloat *sweetSpotRadii = safeGetFloatArrayElements(env, sweetSpotRadiusArray);
ProximityInfo *proximityInfo = new ProximityInfo(
localeStr, maxProximityCharsSize, displayWidth, displayHeight, gridWidth, gridHeight,
localeCStr, maxProximityCharsSize, displayWidth, displayHeight, gridWidth, gridHeight,
mostCommonkeyWidth, (const int32_t*)proximityChars, keyCount,
(const int32_t*)keyXCoordinates, (const int32_t*)keyYCoordinates,
(const int32_t*)keyWidths, (const int32_t*)keyHeights, (const int32_t*)keyCharCodes,
@ -59,7 +56,7 @@ static jlong latinime_Keyboard_setProximityInfo(JNIEnv *env, jobject object,
safeReleaseIntArrayElements(env, keyYCoordinateArray, keyYCoordinates);
safeReleaseIntArrayElements(env, keyXCoordinateArray, keyXCoordinates);
env->ReleaseIntArrayElements(proximityCharsArray, proximityChars, 0);
env->ReleaseStringUTFChars(localejStr, localeStrPtr);
env->ReleaseStringUTFChars(localeJStr, localeCStr);
return (jlong)proximityInfo;
}

View File

@ -16,6 +16,8 @@
#define LOG_TAG "LatinIME: jni"
#include <cassert>
#include "com_android_inputmethod_keyboard_ProximityInfo.h"
#include "com_android_inputmethod_latin_BinaryDictionary.h"
#include "com_android_inputmethod_latin_NativeUtils.h"
@ -23,8 +25,6 @@
#include "jni.h"
#include "jni_common.h"
#include <cassert>
using namespace latinime;
/*

View File

@ -36,7 +36,7 @@ inline void copyOrFillZero(void *to, const void *from, size_t size) {
}
}
ProximityInfo::ProximityInfo(const std::string localeStr, const int maxProximityCharsSize,
ProximityInfo::ProximityInfo(const char *localeCStr, const int maxProximityCharsSize,
const int keyboardWidth, const int keyboardHeight, const int gridWidth,
const int gridHeight, const int mostCommonKeyWidth,
const int32_t *proximityCharsArray, const int keyCount, const int32_t *keyXCoordinates,
@ -52,7 +52,7 @@ ProximityInfo::ProximityInfo(const std::string localeStr, const int maxProximity
HAS_TOUCH_POSITION_CORRECTION_DATA(keyCount > 0 && keyXCoordinates && keyYCoordinates
&& keyWidths && keyHeights && keyCharCodes && sweetSpotCenterXs
&& sweetSpotCenterYs && sweetSpotRadii),
mLocaleStr(localeStr) {
mLocaleStr(localeCStr) {
const int proximityGridLength = GRID_WIDTH * GRID_HEIGHT * MAX_PROXIMITY_CHARS_SIZE;
if (DEBUG_PROXIMITY_INFO) {
AKLOGI("Create proximity info array %d", proximityGridLength);

View File

@ -28,7 +28,7 @@ class Correction;
class ProximityInfo {
public:
ProximityInfo(const std::string localeStr, const int maxProximityCharsSize,
ProximityInfo(const char *localeCStr, const int maxProximityCharsSize,
const int keyboardWidth, const int keyboardHeight, const int gridWidth,
const int gridHeight, const int mostCommonkeyWidth,
const int32_t *proximityCharsArray, const int keyCount, const int32_t *keyXCoordinates,