diff options
author | 2011-09-21 12:02:47 +0900 | |
---|---|---|
committer | 2011-09-22 18:39:34 +0900 | |
commit | 0e1f656c1be7f2916cf57c94d99b001795856270 (patch) | |
tree | 97f2d04d944f2c13d1e95e8f90b9ff7287793c6b /native/src/proximity_info.h | |
parent | a35ea4cba88868a8c45b4d132d0c49b128f76927 (diff) | |
download | latinime-0e1f656c1be7f2916cf57c94d99b001795856270.tar.gz latinime-0e1f656c1be7f2916cf57c94d99b001795856270.tar.xz latinime-0e1f656c1be7f2916cf57c94d99b001795856270.zip |
Extend JNI interface to pass the key coordinate information
Change-Id: Iec0d1415d6abba43b775a014516b961b167597b7
Diffstat (limited to 'native/src/proximity_info.h')
-rw-r--r-- | native/src/proximity_info.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/native/src/proximity_info.h b/native/src/proximity_info.h index 75fc8fb63..834997fb9 100644 --- a/native/src/proximity_info.h +++ b/native/src/proximity_info.h @@ -35,7 +35,9 @@ public: ProximityInfo(const int maxProximityCharsSize, const int keyboardWidth, const int keybaordHeight, const int gridWidth, const int gridHeight, - const uint32_t *proximityCharsArray); + const uint32_t *proximityCharsArray, const int keyCount, const int32_t *keyXCoordinates, + const int32_t *keyYCoordinates, const int32_t *keyWidths, const int32_t *keyHeights, + const int32_t *keyCharCodes); ~ProximityInfo(); bool hasSpaceProximity(const int x, const int y) const; void setInputParams(const int* inputCodes, const int inputLength); @@ -51,7 +53,14 @@ public: } private: + // The max number of the keys in one keyboard layout + static const int MAX_KEY_COUNT_IN_A_KEYBOARD = 64; + // The upper limit of the char code in TOUCH_POSITION_CORRECTION_GROUP + static const int MAX_GROUPED_CHAR_CODE = 127; + int getStartIndexFromCoordinates(const int x, const int y) const; + void initializeCodeToGroup(); + void initializeCodeToKeyIndex(); const int MAX_PROXIMITY_CHARS_SIZE; const int KEYBOARD_WIDTH; const int KEYBOARD_HEIGHT; @@ -59,10 +68,18 @@ private: const int GRID_HEIGHT; const int CELL_WIDTH; const int CELL_HEIGHT; + const int KEY_COUNT; const int *mInputCodes; uint32_t *mProximityCharsArray; + int32_t mKeyXCoordinates[MAX_KEY_COUNT_IN_A_KEYBOARD]; + int32_t mKeyYCoordinates[MAX_KEY_COUNT_IN_A_KEYBOARD]; + int32_t mKeyWidths[MAX_KEY_COUNT_IN_A_KEYBOARD]; + int32_t mKeyHeights[MAX_KEY_COUNT_IN_A_KEYBOARD]; + int32_t mKeyCharCodes[MAX_KEY_COUNT_IN_A_KEYBOARD]; int mInputLength; unsigned short mPrimaryInputWord[MAX_WORD_LENGTH_INTERNAL]; + int mCodeToGroup[MAX_GROUPED_CHAR_CODE + 1]; + int mCodeToKeyIndex[MAX_GROUPED_CHAR_CODE + 1]; }; } // namespace latinime |