|
|
|
@ -1,7 +1,15 @@
|
|
|
|
|
diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
--- ./src/chewingio.c.phraseChoiceRearward 2008-12-02 00:29:20.000000000 +1000
|
|
|
|
|
+++ ./src/chewingio.c 2009-06-26 15:58:08.000000000 +1000
|
|
|
|
|
@@ -75,14 +75,14 @@ CHEWING_API int chewing_KBStr2Num( char
|
|
|
|
|
+++ ./src/chewingio.c 2009-07-31 17:17:06.000000000 +1000
|
|
|
|
|
@@ -20,6 +20,7 @@
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
+#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
#include "chewing-utf8-util.h"
|
|
|
|
|
#include "global.h"
|
|
|
|
|
@@ -75,14 +76,14 @@ CHEWING_API int chewing_KBStr2Num( char
|
|
|
|
|
return KB_DEFAULT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -18,7 +26,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
int addTerminateService( void (*callback)() )
|
|
|
|
|
@@ -103,7 +103,7 @@ int addTerminateService( void (*callback
|
|
|
|
|
@@ -103,7 +104,7 @@ int addTerminateService( void (*callback
|
|
|
|
|
CHEWING_API ChewingContext *chewing_new()
|
|
|
|
|
{
|
|
|
|
|
ChewingContext *ctx;
|
|
|
|
@ -27,7 +35,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
ChewingData *internal_data = ALC( ChewingData, 1 );
|
|
|
|
|
ChewingOutput *internal_output = ALC( ChewingOutput, 1 );
|
|
|
|
|
ctx = ALC( ChewingContext, 1 );
|
|
|
|
|
@@ -159,7 +159,7 @@ CHEWING_API int chewing_Init(
|
|
|
|
|
@@ -159,7 +160,7 @@ CHEWING_API int chewing_Init(
|
|
|
|
|
dbg_path = FAILSAFE_OUTPUT;
|
|
|
|
|
fp_g = fopen( dbg_path, "w+" );
|
|
|
|
|
if ( ! fp_g ) {
|
|
|
|
@ -36,7 +44,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
"Failed to record debug message in file.\n"
|
|
|
|
|
"--> Output to stderr\n" );
|
|
|
|
|
}
|
|
|
|
|
@@ -237,14 +237,14 @@ CHEWING_API void chewing_Terminate()
|
|
|
|
|
@@ -237,14 +238,14 @@ CHEWING_API void chewing_Terminate()
|
|
|
|
|
if ( TerminateServices[ i ] ) {
|
|
|
|
|
#ifdef ENABLE_DEBUG
|
|
|
|
|
/* Can't output to debug file because it's about to close */
|
|
|
|
@ -53,7 +61,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
/* XXX: should check if the services are really completed. */
|
|
|
|
|
bTerminateCompleted = 1;
|
|
|
|
|
return;
|
|
|
|
|
@@ -403,7 +403,7 @@ CHEWING_API void chewing_set_ChiEngMode(
|
|
|
|
|
@@ -403,7 +404,7 @@ CHEWING_API void chewing_set_ChiEngMode(
|
|
|
|
|
ctx->data->bChiSym = ( mode == CHINESE_MODE ? 1 : 0 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,7 +70,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
{
|
|
|
|
|
return ctx->data->bChiSym;
|
|
|
|
|
}
|
|
|
|
|
@@ -413,7 +413,7 @@ CHEWING_API void chewing_set_ShapeMode(
|
|
|
|
|
@@ -413,7 +414,7 @@ CHEWING_API void chewing_set_ShapeMode(
|
|
|
|
|
ctx->data->bFullShape = (mode == FULLSHAPE_MODE ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -71,7 +79,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
{
|
|
|
|
|
return ctx->data->bFullShape;
|
|
|
|
|
}
|
|
|
|
|
@@ -435,7 +435,7 @@ static int DoSelect( ChewingData *pgdata
|
|
|
|
|
@@ -435,7 +436,7 @@ static int DoSelect( ChewingData *pgdata
|
|
|
|
|
if ( pgdata->choiceInfo.isSymbol ) {
|
|
|
|
|
SymbolChoice( pgdata, num );
|
|
|
|
|
}
|
|
|
|
@ -80,7 +88,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
/* change the select interval & selectStr & nSelect */
|
|
|
|
|
AddSelect( pgdata, num );
|
|
|
|
|
/* second, call choice module */
|
|
|
|
|
@@ -489,7 +489,7 @@ CHEWING_API int chewing_handle_Space( Ch
|
|
|
|
|
@@ -489,7 +490,7 @@ CHEWING_API int chewing_handle_Space( Ch
|
|
|
|
|
pgdata->chiSymbolBufLen = 0;
|
|
|
|
|
pgdata->chiSymbolCursor = 0;
|
|
|
|
|
keystrokeRtn = KEYSTROKE_COMMIT;
|
|
|
|
@ -89,7 +97,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
else if ( pgdata->bChiSym != CHINESE_MODE ) {
|
|
|
|
|
/* see if buffer contains nothing */
|
|
|
|
|
if ( pgdata->chiSymbolBufLen == 0 ) {
|
|
|
|
|
@@ -507,11 +507,11 @@ CHEWING_API int chewing_handle_Space( Ch
|
|
|
|
|
@@ -507,11 +508,11 @@ CHEWING_API int chewing_handle_Space( Ch
|
|
|
|
|
if ( rtn == SYMBOL_KEY_ERROR ) {
|
|
|
|
|
keystrokeRtn = KEYSTROKE_IGNORE;
|
|
|
|
|
/*
|
|
|
|
@ -103,7 +111,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
else {
|
|
|
|
|
keystrokeRtn = KEYSTROKE_ABSORB;
|
|
|
|
|
}
|
|
|
|
|
@@ -524,9 +524,9 @@ CHEWING_API int chewing_handle_Space( Ch
|
|
|
|
|
@@ -524,9 +525,9 @@ CHEWING_API int chewing_handle_Space( Ch
|
|
|
|
|
/* Quick commit */
|
|
|
|
|
else {
|
|
|
|
|
DEBUG_OUT(
|
|
|
|
@ -115,7 +123,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
pgo->nCommitStr = 1;
|
|
|
|
|
pgdata->chiSymbolBufLen = 0;
|
|
|
|
|
pgdata->chiSymbolCursor = 0;
|
|
|
|
|
@@ -643,7 +643,7 @@ CHEWING_API int chewing_handle_Enter( Ch
|
|
|
|
|
@@ -643,7 +644,7 @@ CHEWING_API int chewing_handle_Enter( Ch
|
|
|
|
|
keystrokeRtn = KEYSTROKE_COMMIT;
|
|
|
|
|
WriteChiSymbolToBuf( pgo->commitStr, nCommitStr, pgdata );
|
|
|
|
|
AutoLearnPhrase( pgdata );
|
|
|
|
@ -124,7 +132,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
pgo->nCommitStr = nCommitStr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -664,12 +664,12 @@ CHEWING_API int chewing_handle_Del( Chew
|
|
|
|
|
@@ -664,12 +665,12 @@ CHEWING_API int chewing_handle_Del( Chew
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( ! pgdata->bSelect ) {
|
|
|
|
@ -141,7 +149,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
NONDECREASE_CURSOR );
|
|
|
|
|
}
|
|
|
|
|
CallPhrasing( pgdata );
|
|
|
|
|
@@ -696,7 +696,7 @@ CHEWING_API int chewing_handle_Backspace
|
|
|
|
|
@@ -696,7 +697,7 @@ CHEWING_API int chewing_handle_Backspace
|
|
|
|
|
}
|
|
|
|
|
else if ( pgdata->chiSymbolCursor > 0 ) {
|
|
|
|
|
ChewingKillChar(
|
|
|
|
@ -150,7 +158,13 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
pgdata->chiSymbolCursor - 1,
|
|
|
|
|
DECREASE_CURSOR );
|
|
|
|
|
}
|
|
|
|
|
@@ -740,6 +740,7 @@ CHEWING_API int chewing_handle_Down( Che
|
|
|
|
|
@@ -735,11 +736,12 @@ CHEWING_API int chewing_handle_Up( Chewi
|
|
|
|
|
|
|
|
|
|
CHEWING_API int chewing_handle_Down( ChewingContext *ctx )
|
|
|
|
|
{
|
|
|
|
|
- ChewingData *pgdata = ctx->data;
|
|
|
|
|
+ ChewingData *pgdata = ctx->data;
|
|
|
|
|
ChewingOutput *pgo = ctx->output;
|
|
|
|
|
int toSelect = 0;
|
|
|
|
|
int keystrokeRtn = KEYSTROKE_ABSORB;
|
|
|
|
|
int key_buf_cursor;
|
|
|
|
@ -158,10 +172,12 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
|
|
|
|
|
CheckAndResetRange( pgdata );
|
|
|
|
|
|
|
|
|
|
@@ -757,12 +758,21 @@ CHEWING_API int chewing_handle_Down( Che
|
|
|
|
|
@@ -756,13 +758,22 @@ CHEWING_API int chewing_handle_Down( Che
|
|
|
|
|
toSelect = 1;
|
|
|
|
|
|
|
|
|
|
if ( toSelect ) {
|
|
|
|
|
if( ! pgdata->bSelect ) {
|
|
|
|
|
- if( ! pgdata->bSelect ) {
|
|
|
|
|
+ if( ! pgdata->bSelect ) {
|
|
|
|
|
+ cursor_orig=pgdata->chiSymbolCursor;
|
|
|
|
|
ChoiceFirstAvail( pgdata );
|
|
|
|
|
}
|
|
|
|
@ -181,7 +197,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
else if ( pgdata->symbolKeyBuf[ key_buf_cursor ] ) {
|
|
|
|
|
/* Open Symbol Choice List */
|
|
|
|
|
if ( ! pgdata->choiceInfo.isSymbol )
|
|
|
|
|
@@ -782,11 +792,11 @@ CHEWING_API int chewing_handle_ShiftLeft
|
|
|
|
|
@@ -782,11 +793,11 @@ CHEWING_API int chewing_handle_ShiftLeft
|
|
|
|
|
|
|
|
|
|
if ( ! ChewingIsEntering( pgdata ) ) {
|
|
|
|
|
keystrokeRtn = KEYSTROKE_IGNORE;
|
|
|
|
@ -196,7 +212,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
pgdata->chiSymbolCursor > 0 &&
|
|
|
|
|
pgdata->PointEnd > -9 ) {
|
|
|
|
|
if ( pgdata->PointStart == -1 )
|
|
|
|
|
@@ -797,7 +807,7 @@ CHEWING_API int chewing_handle_ShiftLeft
|
|
|
|
|
@@ -797,7 +808,7 @@ CHEWING_API int chewing_handle_ShiftLeft
|
|
|
|
|
pgdata->PointEnd--;
|
|
|
|
|
}
|
|
|
|
|
if ( pgdata->PointEnd == 0 )
|
|
|
|
@ -205,7 +221,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -822,8 +832,8 @@ CHEWING_API int chewing_handle_Left( Che
|
|
|
|
|
@@ -822,8 +833,8 @@ CHEWING_API int chewing_handle_Left( Che
|
|
|
|
|
pgdata->choiceInfo.pageNo = pgdata->choiceInfo.nPage - 1;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -216,7 +232,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
pgdata->chiSymbolCursor > 0 ) {
|
|
|
|
|
CheckAndResetRange( pgdata );
|
|
|
|
|
pgdata->chiSymbolCursor--;
|
|
|
|
|
@@ -842,13 +852,13 @@ CHEWING_API int chewing_handle_ShiftRigh
|
|
|
|
|
@@ -842,13 +853,13 @@ CHEWING_API int chewing_handle_ShiftRigh
|
|
|
|
|
|
|
|
|
|
if ( ! ChewingIsEntering( pgdata ) ) {
|
|
|
|
|
keystrokeRtn = KEYSTROKE_IGNORE;
|
|
|
|
@ -234,7 +250,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
pgdata->PointEnd < 9 ) {
|
|
|
|
|
if ( pgdata->PointStart == -1 )
|
|
|
|
|
pgdata->PointStart = pgdata->chiSymbolCursor;
|
|
|
|
|
@@ -858,7 +868,7 @@ CHEWING_API int chewing_handle_ShiftRigh
|
|
|
|
|
@@ -858,7 +869,7 @@ CHEWING_API int chewing_handle_ShiftRigh
|
|
|
|
|
}
|
|
|
|
|
pgdata->chiSymbolCursor++;
|
|
|
|
|
if ( pgdata->PointEnd == 0 )
|
|
|
|
@ -243,7 +259,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -883,9 +893,9 @@ CHEWING_API int chewing_handle_Right( Ch
|
|
|
|
|
@@ -883,9 +894,9 @@ CHEWING_API int chewing_handle_Right( Ch
|
|
|
|
|
pgdata->choiceInfo.pageNo = 0;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -256,7 +272,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
CheckAndResetRange( pgdata );
|
|
|
|
|
pgdata->chiSymbolCursor++;
|
|
|
|
|
}
|
|
|
|
|
@@ -974,11 +984,11 @@ CHEWING_API int chewing_handle_Home( Che
|
|
|
|
|
@@ -974,11 +985,11 @@ CHEWING_API int chewing_handle_Home( Che
|
|
|
|
|
|
|
|
|
|
CheckAndResetRange( pgdata );
|
|
|
|
|
|
|
|
|
@ -271,7 +287,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
}
|
|
|
|
|
MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
|
|
|
|
|
return 0;
|
|
|
|
|
@@ -993,12 +1003,12 @@ CHEWING_API int chewing_handle_End( Chew
|
|
|
|
|
@@ -993,12 +1004,12 @@ CHEWING_API int chewing_handle_End( Chew
|
|
|
|
|
CheckAndResetRange( pgdata );
|
|
|
|
|
|
|
|
|
|
if ( ! ChewingIsEntering( pgdata ) ) {
|
|
|
|
@ -289,7 +305,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1013,9 +1023,9 @@ CHEWING_API int chewing_handle_PageUp( C
|
|
|
|
|
@@ -1013,9 +1024,9 @@ CHEWING_API int chewing_handle_PageUp( C
|
|
|
|
|
if ( ! ChewingIsEntering( pgdata ) ) {
|
|
|
|
|
keystrokeRtn = KEYSTROKE_IGNORE;
|
|
|
|
|
}
|
|
|
|
@ -301,7 +317,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
@@ -1031,9 +1041,9 @@ CHEWING_API int chewing_handle_PageDown(
|
|
|
|
|
@@ -1031,9 +1042,9 @@ CHEWING_API int chewing_handle_PageDown(
|
|
|
|
|
if ( ! ChewingIsEntering( pgdata ) ) {
|
|
|
|
|
keystrokeRtn = KEYSTROKE_IGNORE;
|
|
|
|
|
}
|
|
|
|
@ -313,7 +329,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
@@ -1107,7 +1117,7 @@ CHEWING_API int chewing_handle_Default(
|
|
|
|
|
@@ -1107,7 +1118,7 @@ CHEWING_API int chewing_handle_Default(
|
|
|
|
|
DoSelect( pgdata, num );
|
|
|
|
|
goto End_keyproc;
|
|
|
|
|
}
|
|
|
|
@ -322,7 +338,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
/* Otherwise, use 'j' and 'k' for paging in selection mode */
|
|
|
|
|
DEBUG_OUT(
|
|
|
|
|
"\t\tchecking paging key, got '%c'\n",
|
|
|
|
|
@@ -1163,10 +1173,10 @@ CHEWING_API int chewing_handle_Default(
|
|
|
|
|
@@ -1163,10 +1174,10 @@ CHEWING_API int chewing_handle_Default(
|
|
|
|
|
rtn = ZuinPhoInput( &( pgdata->zuinData ), key );
|
|
|
|
|
DEBUG_OUT(
|
|
|
|
|
"\t\tChinese mode key, "
|
|
|
|
@ -335,7 +351,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
if ( rtn == ZUIN_KEY_ERROR )
|
|
|
|
|
rtn = SpecialSymbolInput( key, pgdata );
|
|
|
|
|
switch ( rtn ) {
|
|
|
|
|
@@ -1182,14 +1192,14 @@ CHEWING_API int chewing_handle_Default(
|
|
|
|
|
@@ -1182,14 +1193,14 @@ CHEWING_API int chewing_handle_Default(
|
|
|
|
|
case ZUIN_KEY_ERROR:
|
|
|
|
|
case ZUIN_IGNORE:
|
|
|
|
|
DEBUG_OUT(
|
|
|
|
@ -353,7 +369,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
key );
|
|
|
|
|
|
|
|
|
|
/* see if buffer contains nothing */
|
|
|
|
|
@@ -1207,7 +1217,7 @@ CHEWING_API int chewing_handle_Default(
|
|
|
|
|
@@ -1207,7 +1218,7 @@ CHEWING_API int chewing_handle_Default(
|
|
|
|
|
if ( rtn == SYMBOL_KEY_ERROR ) {
|
|
|
|
|
keystrokeRtn = KEYSTROKE_IGNORE;
|
|
|
|
|
/*
|
|
|
|
@ -362,7 +378,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
* then it's wrong to commit it.
|
|
|
|
|
*/
|
|
|
|
|
bQuickCommit = 0;
|
|
|
|
|
@@ -1248,9 +1258,9 @@ End_keyproc:
|
|
|
|
|
@@ -1248,9 +1259,9 @@ End_keyproc:
|
|
|
|
|
/* Quick commit */
|
|
|
|
|
else {
|
|
|
|
|
DEBUG_OUT(
|
|
|
|
@ -374,7 +390,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
pgo->nCommitStr = 1;
|
|
|
|
|
pgdata->chiSymbolBufLen = 0;
|
|
|
|
|
pgdata->chiSymbolCursor = 0;
|
|
|
|
|
@@ -1309,12 +1319,12 @@ CHEWING_API int chewing_handle_CtrlNum(
|
|
|
|
|
@@ -1309,12 +1320,12 @@ CHEWING_API int chewing_handle_CtrlNum(
|
|
|
|
|
|
|
|
|
|
cursor = PhoneSeqCursor( pgdata );
|
|
|
|
|
if ( ! pgdata->config.bAddPhraseForward ) {
|
|
|
|
@ -392,7 +408,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
cursor + newPhraseLen - 1 ) ) {
|
|
|
|
|
/* Manually add phrase to the user phrase database. */
|
|
|
|
|
memcpy( addPhoneSeq,
|
|
|
|
|
@@ -1328,10 +1338,10 @@ CHEWING_API int chewing_handle_CtrlNum(
|
|
|
|
|
@@ -1328,10 +1339,10 @@ CHEWING_API int chewing_handle_CtrlNum(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
phraseState = UserUpdatePhrase( addPhoneSeq, addWordSeq );
|
|
|
|
@ -407,7 +423,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
phraseState );
|
|
|
|
|
|
|
|
|
|
/* Clear the breakpoint between the New Phrase */
|
|
|
|
|
@@ -1341,11 +1351,11 @@ CHEWING_API int chewing_handle_CtrlNum(
|
|
|
|
|
@@ -1341,11 +1352,11 @@ CHEWING_API int chewing_handle_CtrlNum(
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -423,7 +439,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
cursor - newPhraseLen ) ) {
|
|
|
|
|
/* Manually add phrase to the user phrase database. */
|
|
|
|
|
memcpy( addPhoneSeq,
|
|
|
|
|
@@ -1358,10 +1368,10 @@ CHEWING_API int chewing_handle_CtrlNum(
|
|
|
|
|
@@ -1358,10 +1369,10 @@ CHEWING_API int chewing_handle_CtrlNum(
|
|
|
|
|
newPhraseLen, 1);
|
|
|
|
|
|
|
|
|
|
phraseState = UserUpdatePhrase( addPhoneSeq, addWordSeq );
|
|
|
|
@ -438,7 +454,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
phraseState );
|
|
|
|
|
|
|
|
|
|
/* Clear the breakpoint between the New Phrase */
|
|
|
|
|
@@ -1414,10 +1424,10 @@ CHEWING_API int chewing_handle_Numlock(
|
|
|
|
|
@@ -1414,10 +1425,10 @@ CHEWING_API int chewing_handle_Numlock(
|
|
|
|
|
ChewingOutput *pgo = ctx->output;
|
|
|
|
|
int rtn, QuickCommit = 0;
|
|
|
|
|
int keystrokeRtn = KEYSTROKE_ABSORB;
|
|
|
|
@ -451,7 +467,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
*/
|
|
|
|
|
if ( pgdata->chiSymbolBufLen == 0 ) {
|
|
|
|
|
QuickCommit = 1;
|
|
|
|
|
@@ -1428,7 +1438,7 @@ CHEWING_API int chewing_handle_Numlock(
|
|
|
|
|
@@ -1428,7 +1439,7 @@ CHEWING_API int chewing_handle_Numlock(
|
|
|
|
|
keystrokeRtn = KEYSTROKE_IGNORE ;
|
|
|
|
|
}
|
|
|
|
|
else if ( QuickCommit ) {
|
|
|
|
@ -460,7 +476,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
pgo->nCommitStr = 1;
|
|
|
|
|
pgdata->chiSymbolBufLen = 0;
|
|
|
|
|
pgdata->chiSymbolCursor = 0;
|
|
|
|
|
@@ -1443,7 +1453,7 @@ CHEWING_API int chewing_handle_Numlock(
|
|
|
|
|
@@ -1443,7 +1454,7 @@ CHEWING_API int chewing_handle_Numlock(
|
|
|
|
|
else {
|
|
|
|
|
/* Otherwise, if we are selecting words, we use numeric keys
|
|
|
|
|
* as selkey
|
|
|
|
@ -471,7 +487,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c
|
|
|
|
|
if ( key > '0' && key < '9' )
|
|
|
|
|
diff -up ./src/choice.c.phraseChoiceRearward ./src/choice.c
|
|
|
|
|
--- ./src/choice.c.phraseChoiceRearward 2008-12-02 00:29:20.000000000 +1000
|
|
|
|
|
+++ ./src/choice.c 2009-06-26 15:59:23.000000000 +1000
|
|
|
|
|
+++ ./src/choice.c 2009-07-31 17:16:57.000000000 +1000
|
|
|
|
|
@@ -71,22 +71,44 @@ static void ChangeSelectIntervalAndBreak
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -520,7 +536,7 @@ diff -up ./src/choice.c.phraseChoiceRearward ./src/choice.c
|
|
|
|
|
+ tail_tmp=begin;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ while(head<=head_tmp && tail_tmp>=tail){
|
|
|
|
|
+ while(head<=head_tmp && tail_tmp<=tail){
|
|
|
|
|
+ diff = tail_tmp - head_tmp;
|
|
|
|
|
+ pho_id = TreeFindPhrase( head_tmp, tail_tmp, phoneSeq );
|
|
|
|
|
if ( pho_id != -1 ) {
|
|
|
|
@ -559,7 +575,13 @@ diff -up ./src/choice.c.phraseChoiceRearward ./src/choice.c
|
|
|
|
|
return 1;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
@@ -138,7 +166,7 @@ static void SetChoiceInfo(
|
|
|
|
|
@@ -133,12 +161,12 @@ static void SetChoiceInfo(
|
|
|
|
|
ChoiceInfo *pci,AvailInfo *pai, uint16 *phoneSeq, int cursor,
|
|
|
|
|
int candPerPage )
|
|
|
|
|
{
|
|
|
|
|
- Word tempWord;
|
|
|
|
|
+ Word tempWord;
|
|
|
|
|
Phrase tempPhrase;
|
|
|
|
|
int len;
|
|
|
|
|
UserPhraseData *pUserPhraseData;
|
|
|
|
|
uint16 userPhoneSeq[ MAX_PHONE_SEQ_LEN ];
|
|
|
|
|