Merge "Step 30-A Constize gesture" into jb-mr1-dev

This commit is contained in:
Satoshi Kataoka 2012-08-15 02:39:31 -07:00 committed by Android (Google) Code Review
commit 4bf2c07034
7 changed files with 14 additions and 11 deletions

View file

@ -19,8 +19,8 @@
#include "dic_traverse_wrapper.h"
namespace latinime {
void *(*DicTraverseWrapper::sDicTraverseSessionFactoryMethod)(JNIEnv *env, jstring locale) = 0;
void *(*DicTraverseWrapper::sDicTraverseSessionFactoryMethod)(JNIEnv *, jstring) = 0;
void (*DicTraverseWrapper::sDicTraverseSessionReleaseMethod)(void *) = 0;
void (*DicTraverseWrapper::sDicTraverseSessionInitMethod)(
void *, Dictionary *, const int *, const int) = 0;
void *, const Dictionary *const, const int *, const int) = 0;
} // namespace latinime

View file

@ -34,7 +34,7 @@ class DicTraverseWrapper {
return 0;
}
static void initDicTraverseSession(void *traverseSession,
Dictionary *dictionary, const int *prevWord, const int prevWordLength) {
const Dictionary *const dictionary, const int *prevWord, const int prevWordLength) {
if (sDicTraverseSessionInitMethod) {
sDicTraverseSessionInitMethod(traverseSession, dictionary, prevWord, prevWordLength);
}
@ -45,11 +45,11 @@ class DicTraverseWrapper {
}
}
static void setTraverseSessionFactoryMethod(
void *(*factoryMethod)(JNIEnv *env, jstring locale)) {
void *(*factoryMethod)(JNIEnv *, jstring)) {
sDicTraverseSessionFactoryMethod = factoryMethod;
}
static void setTraverseSessionInitMethod(
void (*initMethod)(void *, Dictionary *, const int *, const int)) {
void (*initMethod)(void *, const Dictionary *const, const int *, const int)) {
sDicTraverseSessionInitMethod = initMethod;
}
static void setTraverseSessionReleaseMethod(void (*releaseMethod)(void *)) {
@ -58,7 +58,8 @@ class DicTraverseWrapper {
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(DicTraverseWrapper);
static void *(*sDicTraverseSessionFactoryMethod)(JNIEnv *, jstring);
static void (*sDicTraverseSessionInitMethod)(void *, Dictionary *, const int *, const int);
static void (*sDicTraverseSessionInitMethod)(
void *, const Dictionary *const, const int *, const int);
static void (*sDicTraverseSessionReleaseMethod)(void *);
};
int register_DicTraverseSession(JNIEnv *env);

View file

@ -60,7 +60,7 @@ int Dictionary::getSuggestions(ProximityInfo *proximityInfo, void *traverseSessi
int *codes, int codesSize, int *prevWordChars,
int prevWordLength, int commitPoint, bool isGesture,
bool useFullEditDistance, unsigned short *outWords,
int *frequencies, int *spaceIndices, int *outputTypes) {
int *frequencies, int *spaceIndices, int *outputTypes) const {
int result = 0;
if (isGesture) {
DicTraverseWrapper::initDicTraverseSession(

View file

@ -48,7 +48,7 @@ class Dictionary {
int *ycoordinates, int *times, int *pointerIds, int *codes, int codesSize,
int *prevWordChars, int prevWordLength, int commitPoint, bool isGesture,
bool useFullEditDistance, unsigned short *outWords,
int *frequencies, int *spaceIndices, int *outputTypes);
int *frequencies, int *spaceIndices, int *outputTypes) const;
int getBigrams(const int32_t *word, int length, int *codes, int codesSize,
unsigned short *outWords, int *frequencies, int *outputTypes) const;

View file

@ -39,7 +39,8 @@ class GestureDecoderWrapper : public IncrementalDecoderInterface {
int getSuggestions(ProximityInfo *pInfo, void *traverseSession, int *inputXs, int *inputYs,
int *times, int *pointerIds, int *codes, int inputSize, int commitPoint,
unsigned short *outWords, int *frequencies, int *outputIndices, int *outputTypes) {
unsigned short *outWords, int *frequencies, int *outputIndices,
int *outputTypes) const {
if (!mIncrementalDecoderInterface) {
return 0;
}

View file

@ -31,7 +31,7 @@ class IncrementalDecoderInterface {
virtual int getSuggestions(ProximityInfo *pInfo, void *traverseSession,
int *inputXs, int *inputYs, int *times, int *pointerIds, int *codes,
int inputSize, int commitPoint, unsigned short *outWords, int *frequencies,
int *outputIndices, int *outputTypes) = 0;
int *outputIndices, int *outputTypes) const = 0;
IncrementalDecoderInterface() { };
virtual ~IncrementalDecoderInterface() { };
private:

View file

@ -39,7 +39,8 @@ class IncrementalDecoderWrapper : public IncrementalDecoderInterface {
int getSuggestions(ProximityInfo *pInfo, void *traverseSession, int *inputXs, int *inputYs,
int *times, int *pointerIds, int *codes, int inputSize, int commitPoint,
unsigned short *outWords, int *frequencies, int *outputIndices, int *outputTypes) {
unsigned short *outWords, int *frequencies, int *outputIndices,
int *outputTypes) const {
if (!mIncrementalDecoderInterface) {
return 0;
}