rpms/libchewing/F-9 libchewing-0.3.2.phraseChoiceRearward.patch, NONE, 1.1 import.log, 1.10, 1.11 libchewing-0.3.2.bz477690.patch, 1.3, 1.4 libchewing.spec, 1.27, 1.28 libchewing-0.3.2.phraseChoiceRearward, 1.1, NONE

Ding-Yi Chen dchen at fedoraproject.org
Fri Jun 26 06:49:19 UTC 2009


Author: dchen

Update of /cvs/pkgs/rpms/libchewing/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28064/F-9

Modified Files:
	import.log libchewing-0.3.2.bz477690.patch libchewing.spec 
Added Files:
	libchewing-0.3.2.phraseChoiceRearward.patch 
Removed Files:
	libchewing-0.3.2.phraseChoiceRearward 
Log Message:
Revised Revise phraseChoiceRearward.patch so the cursor wont move to left when pressing down key.

libchewing-0.3.2.phraseChoiceRearward.patch:

--- NEW FILE libchewing-0.3.2.phraseChoiceRearward.patch ---
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 
 	return KB_DEFAULT;
 }
 
-#ifdef ENABLE_DEBUG     
+#ifdef ENABLE_DEBUG
 static void TerminateDebug()
 {
 	DEBUG_OUT( "DEBUG: logging service is about to terminate.\n" );
 	if ( fp_g ) {
 		fclose( fp_g );
 	}
-}               
+}
 #endif
 
 int addTerminateService( void (*callback)() )
@@ -103,7 +103,7 @@ int addTerminateService( void (*callback
 CHEWING_API ChewingContext *chewing_new()
 {
 	ChewingContext *ctx;
-	
+
 	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(
 		dbg_path = FAILSAFE_OUTPUT;
 	        fp_g = fopen( dbg_path, "w+" );
 		if ( ! fp_g ) {
-			fprintf( stderr, 
+			fprintf( stderr,
 				"Failed to record debug message in file.\n"
 				"--> Output to stderr\n" );
 		}
@@ -237,14 +237,14 @@ CHEWING_API void chewing_Terminate()
 		if ( TerminateServices[ i ] ) {
 #ifdef ENABLE_DEBUG
 			/* Can't output to debug file because it's about to close */
-			fprintf( stderr, 
+			fprintf( stderr,
 				EMPHASIZE( "Terminating service #%d / %d" ) ".\n",
 				i, countTerminateService );
 #endif
 			(*TerminateServices[ i ])();
 		}
 	}
-	
+
 	/* XXX: should check if the services are really completed. */
 	bTerminateCompleted = 1;
 	return;
@@ -403,7 +403,7 @@ CHEWING_API void chewing_set_ChiEngMode(
 	ctx->data->bChiSym = ( mode == CHINESE_MODE ? 1 : 0 );
 }
 
-CHEWING_API int chewing_get_ChiEngMode( ChewingContext *ctx ) 
+CHEWING_API int chewing_get_ChiEngMode( ChewingContext *ctx )
 {
 	return ctx->data->bChiSym;
 }
@@ -413,7 +413,7 @@ CHEWING_API void chewing_set_ShapeMode( 
 	ctx->data->bFullShape = (mode == FULLSHAPE_MODE ? 1 : 0);
 }
 
-CHEWING_API int chewing_get_ShapeMode( ChewingContext *ctx ) 
+CHEWING_API int chewing_get_ShapeMode( ChewingContext *ctx )
 {
 	return ctx->data->bFullShape;
 }
@@ -435,7 +435,7 @@ static int DoSelect( ChewingData *pgdata
 			if ( pgdata->choiceInfo.isSymbol ) {
 				SymbolChoice( pgdata, num );
 			}
-			else { 
+			else {
 				/* change the select interval & selectStr & nSelect */
 				AddSelect( pgdata, num );
 				/* second, call choice module */
@@ -489,7 +489,7 @@ CHEWING_API int chewing_handle_Space( Ch
 		pgdata->chiSymbolBufLen = 0;
 		pgdata->chiSymbolCursor = 0;
 		keystrokeRtn = KEYSTROKE_COMMIT;
-	} 
+	}
 	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
 		if ( rtn == SYMBOL_KEY_ERROR ) {
 			keystrokeRtn = KEYSTROKE_IGNORE;
 			/*
-			 * If the key is not a printable symbol, 
+			 * If the key is not a printable symbol,
 			 * then it's wrong to commit it.
 			 */
 			bQuickCommit = 0;
-		} 
+		}
 		else {
 			keystrokeRtn = KEYSTROKE_ABSORB;
 		}
@@ -524,9 +524,9 @@ CHEWING_API int chewing_handle_Space( Ch
 		/* Quick commit */
 		else {
 			DEBUG_OUT(
-				"\t\tQuick commit buf[0]=%c\n", 
+				"\t\tQuick commit buf[0]=%c\n",
 				pgdata->chiSymbolBuf[ 0 ].s[ 0 ] );
-			pgo->commitStr[ 0 ] = pgdata->chiSymbolBuf[ 0 ]; 
+			pgo->commitStr[ 0 ] = pgdata->chiSymbolBuf[ 0 ];
 			pgo->nCommitStr = 1;
 			pgdata->chiSymbolBufLen = 0;
 			pgdata->chiSymbolCursor = 0;
@@ -643,7 +643,7 @@ CHEWING_API int chewing_handle_Enter( Ch
 		keystrokeRtn = KEYSTROKE_COMMIT;
 		WriteChiSymbolToBuf( pgo->commitStr, nCommitStr, pgdata );
 		AutoLearnPhrase( pgdata );
-		CleanAllBuf( pgdata );  
+		CleanAllBuf( pgdata );
 		pgo->nCommitStr = nCommitStr;
 	}
 
@@ -664,12 +664,12 @@ CHEWING_API int chewing_handle_Del( Chew
 	}
 
 	if ( ! pgdata->bSelect ) {
-		if ( 
-			! ZuinIsEntering( &( pgdata->zuinData ) ) && 
+		if (
+			! ZuinIsEntering( &( pgdata->zuinData ) ) &&
 			pgdata->chiSymbolCursor < pgdata->chiSymbolBufLen ) {
 			ChewingKillChar(
-				pgdata, 
-				pgdata->chiSymbolCursor, 
+				pgdata,
+				pgdata->chiSymbolCursor,
 				NONDECREASE_CURSOR );
 		}
 		CallPhrasing( pgdata );
@@ -696,7 +696,7 @@ CHEWING_API int chewing_handle_Backspace
 		}
 		else if ( pgdata->chiSymbolCursor > 0 ) {
 			ChewingKillChar(
-				pgdata, 
+				pgdata,
 				pgdata->chiSymbolCursor - 1,
 				DECREASE_CURSOR );
 		}
@@ -740,6 +740,7 @@ CHEWING_API int chewing_handle_Down( Che
 	int toSelect = 0;
 	int keystrokeRtn = KEYSTROKE_ABSORB;
 	int key_buf_cursor;
+	static int cursor_orig=-1;
 
 	CheckAndResetRange( pgdata );
 
@@ -757,12 +758,21 @@ CHEWING_API int chewing_handle_Down( Che
 
 	if ( toSelect ) {
 		if( ! pgdata->bSelect ) {
+			cursor_orig=pgdata->chiSymbolCursor;
 			ChoiceFirstAvail( pgdata );
 		}
 		else {
+			if ( pgdata->config.bPhraseChoiceRearward ){
+				int avail_willbe=(pgdata->availInfo.currentAvail>0)?
+					pgdata->availInfo.currentAvail-1: pgdata->availInfo.nAvail - 1;
+				pgdata->chiSymbolCursor=cursor_orig - pgdata->availInfo.avail[avail_willbe].len;
+				if (chewing_buffer_Len(ctx)>cursor_orig){
+				    pgdata->chiSymbolCursor++;
+				}
+			}
 			ChoiceNextAvail( pgdata );
 		}
-	} 
+	}
 	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
 
 	if ( ! ChewingIsEntering( pgdata ) ) {
 		keystrokeRtn = KEYSTROKE_IGNORE;
-	} 
+	}
 	if ( ! pgdata->bSelect ) {
 		/*  PointEnd locates (-9, +9) */
-		if ( 
-			! ZuinIsEntering( &( pgdata->zuinData ) ) && 
+		if (
+			! ZuinIsEntering( &( pgdata->zuinData ) ) &&
 			pgdata->chiSymbolCursor > 0 &&
 			pgdata->PointEnd > -9 ) {
 			if ( pgdata->PointStart == -1 )
@@ -797,7 +807,7 @@ CHEWING_API int chewing_handle_ShiftLeft
 				pgdata->PointEnd--;
 			}
 			if ( pgdata->PointEnd == 0 )
-				pgdata->PointStart = -1; 
+				pgdata->PointStart = -1;
 		}
 	}
 
@@ -822,8 +832,8 @@ CHEWING_API int chewing_handle_Left( Che
 			pgdata->choiceInfo.pageNo = pgdata->choiceInfo.nPage - 1;
 	}
 	else {
-		if ( 
-			! ZuinIsEntering( &( pgdata->zuinData ) ) && 
+		if (
+			! ZuinIsEntering( &( pgdata->zuinData ) ) &&
 			pgdata->chiSymbolCursor > 0 ) {
 			CheckAndResetRange( pgdata );
 			pgdata->chiSymbolCursor--;
@@ -842,13 +852,13 @@ CHEWING_API int chewing_handle_ShiftRigh
 
 	if ( ! ChewingIsEntering( pgdata ) ) {
 		keystrokeRtn = KEYSTROKE_IGNORE;
-	} 
+	}
 
 	if ( ! pgdata->bSelect ) {
 		/* PointEnd locates (-9, +9) */
-		if ( 
-			! ZuinIsEntering( &( pgdata->zuinData ) ) && 
-			pgdata->chiSymbolCursor < pgdata->chiSymbolBufLen && 
+		if (
+			! ZuinIsEntering( &( pgdata->zuinData ) ) &&
+			pgdata->chiSymbolCursor < pgdata->chiSymbolBufLen &&
 			pgdata->PointEnd < 9 ) {
 			if ( pgdata->PointStart == -1 )
 				pgdata->PointStart = pgdata->chiSymbolCursor;
@@ -858,7 +868,7 @@ CHEWING_API int chewing_handle_ShiftRigh
 			}
 			pgdata->chiSymbolCursor++;
 			if ( pgdata->PointEnd == 0 )
-				pgdata->PointStart = -1; 
+				pgdata->PointStart = -1;
 		}
 	}
 
@@ -883,9 +893,9 @@ CHEWING_API int chewing_handle_Right( Ch
 			pgdata->choiceInfo.pageNo = 0;
 	}
 	else {
-		if ( 
-			! ZuinIsEntering( &( pgdata->zuinData ) ) &&			
-			pgdata->chiSymbolCursor < pgdata->chiSymbolBufLen ) {			
+		if (
+			! ZuinIsEntering( &( pgdata->zuinData ) ) &&
+			pgdata->chiSymbolCursor < pgdata->chiSymbolBufLen ) {
 			CheckAndResetRange( pgdata );
 			pgdata->chiSymbolCursor++;
 		}
@@ -974,11 +984,11 @@ CHEWING_API int chewing_handle_Home( Che
 
 	CheckAndResetRange( pgdata );
 
-	if ( ! ChewingIsEntering( pgdata ) ) { 
+	if ( ! ChewingIsEntering( pgdata ) ) {
 		keystrokeRtn = KEYSTROKE_IGNORE;
-	} 
+	}
 	else if ( ! pgdata->bSelect ) {
-		pgdata->chiSymbolCursor = 0; 
+		pgdata->chiSymbolCursor = 0;
 	}
 	MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
 	return 0;
@@ -993,12 +1003,12 @@ CHEWING_API int chewing_handle_End( Chew
 	CheckAndResetRange( pgdata );
 
 	if ( ! ChewingIsEntering( pgdata ) ) {
-		keystrokeRtn = KEYSTROKE_IGNORE; 
-	} 
+		keystrokeRtn = KEYSTROKE_IGNORE;
+	}
 	else if ( ! pgdata->bSelect ) {
-		pgdata->chiSymbolCursor = pgdata->chiSymbolBufLen; 
-	} 
-	MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );       
+		pgdata->chiSymbolCursor = pgdata->chiSymbolBufLen;
+	}
+	MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
 	return 0;
 }
 
@@ -1013,9 +1023,9 @@ CHEWING_API int chewing_handle_PageUp( C
 	if ( ! ChewingIsEntering( pgdata ) ) {
 		keystrokeRtn = KEYSTROKE_IGNORE;
 	}
-	else if ( ! pgdata->bSelect ) { 
+	else if ( ! pgdata->bSelect ) {
 		pgdata->chiSymbolCursor = pgdata->chiSymbolBufLen;
-	} 
+	}
 	MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
 	return 0;
 }
@@ -1031,9 +1041,9 @@ CHEWING_API int chewing_handle_PageDown(
 	if ( ! ChewingIsEntering( pgdata ) ) {
 		keystrokeRtn = KEYSTROKE_IGNORE;
 	}
-	else if ( ! pgdata->bSelect ) { 
+	else if ( ! pgdata->bSelect ) {
 		pgdata->chiSymbolCursor = pgdata->chiSymbolBufLen;
-	} 
+	}
 	MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
 	return 0;
 }
@@ -1107,7 +1117,7 @@ CHEWING_API int chewing_handle_Default( 
 			DoSelect( pgdata, num );
 			goto End_keyproc;
 		}
-		
+
 		/* 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( 
 			rtn = ZuinPhoInput( &( pgdata->zuinData ), key );
 			DEBUG_OUT(
 				"\t\tChinese mode key, "
-				"ZuinPhoInput return value = %d\n", 
+				"ZuinPhoInput return value = %d\n",
 				rtn );
 			DEBUG_FLUSH;
-			
+
 			if ( rtn == ZUIN_KEY_ERROR )
 				rtn = SpecialSymbolInput( key, pgdata );
 			switch ( rtn ) {
@@ -1182,14 +1192,14 @@ CHEWING_API int chewing_handle_Default( 
 				case ZUIN_KEY_ERROR:
 				case ZUIN_IGNORE:
 					DEBUG_OUT(
-						"\t\tbefore isupper(key),key=%d\n", 
+						"\t\tbefore isupper(key),key=%d\n",
 						key );
 					/* change upper case into lower case */
-					if ( isupper( key ) ) 
+					if ( isupper( key ) )
 						key = tolower( key );
 
 					DEBUG_OUT(
-						"\t\tafter isupper(key),key=%d\n", 
+						"\t\tafter isupper(key),key=%d\n",
 						key );
 
 					/* see if buffer contains nothing */
@@ -1207,7 +1217,7 @@ CHEWING_API int chewing_handle_Default( 
 					if ( rtn == SYMBOL_KEY_ERROR ) {
 						keystrokeRtn = KEYSTROKE_IGNORE;
 						/*
-						 * If the key is not a printable symbol, 
+						 * If the key is not a printable symbol,
 						 * then it's wrong to commit it.
 						 */
 						bQuickCommit = 0;
@@ -1248,9 +1258,9 @@ End_keyproc:
 	/* Quick commit */
 	else {
 		DEBUG_OUT(
-				"\t\tQuick commit buf[0]=%c\n", 
+				"\t\tQuick commit buf[0]=%c\n",
 				pgdata->chiSymbolBuf[ 0 ].s[ 0 ] );
-		pgo->commitStr[ 0 ] = pgdata->chiSymbolBuf[ 0 ]; 
+		pgo->commitStr[ 0 ] = pgdata->chiSymbolBuf[ 0 ];
 		pgo->nCommitStr = 1;
 		pgdata->chiSymbolBufLen = 0;
 		pgdata->chiSymbolCursor = 0;
@@ -1309,12 +1319,12 @@ CHEWING_API int chewing_handle_CtrlNum( 
 
 	cursor = PhoneSeqCursor( pgdata );
 	if ( ! pgdata->config.bAddPhraseForward ) {
-		if ( 
-			newPhraseLen >= 1 && 
+		if (
+			newPhraseLen >= 1 &&
 			cursor + newPhraseLen - 1 <= pgdata->nPhoneSeq ) {
-			if ( NoSymbolBetween( 
-				pgdata, 
-				cursor, 
+			if ( NoSymbolBetween(
+				pgdata,
+				cursor,
 				cursor + newPhraseLen - 1 ) ) {
 				/* Manually add phrase to the user phrase database. */
 				memcpy( addPhoneSeq,
@@ -1328,10 +1338,10 @@ CHEWING_API int chewing_handle_CtrlNum( 
 
 
 				phraseState = UserUpdatePhrase( addPhoneSeq, addWordSeq );
-				SetUpdatePhraseMsg( 
-					pgdata, 
-					addWordSeq, 
-					newPhraseLen, 
+				SetUpdatePhraseMsg(
+					pgdata,
+					addWordSeq,
+					newPhraseLen,
 					phraseState );
 
 				/* Clear the breakpoint between the New Phrase */
@@ -1341,11 +1351,11 @@ CHEWING_API int chewing_handle_CtrlNum( 
 		}
 	}
 	else {
-		if ( 
-			newPhraseLen >= 1 && 
+		if (
+			newPhraseLen >= 1 &&
 			cursor - newPhraseLen >= 0 ) {
-			if ( NoSymbolBetween( pgdata, 
-			                      cursor, 
+			if ( NoSymbolBetween( pgdata,
+			                      cursor,
 			                      cursor - newPhraseLen ) ) {
 				/* Manually add phrase to the user phrase database. */
 				memcpy( addPhoneSeq,
@@ -1358,10 +1368,10 @@ CHEWING_API int chewing_handle_CtrlNum( 
 				           newPhraseLen, 1);
 
 				phraseState = UserUpdatePhrase( addPhoneSeq, addWordSeq );
-				SetUpdatePhraseMsg( 
-					pgdata, 
-					addWordSeq, 
-					newPhraseLen, 
+				SetUpdatePhraseMsg(
+					pgdata,
+					addWordSeq,
+					newPhraseLen,
 					phraseState );
 
 				/* Clear the breakpoint between the New Phrase */
@@ -1414,10 +1424,10 @@ CHEWING_API int chewing_handle_Numlock( 
 	ChewingOutput *pgo = ctx->output;
 	int rtn, QuickCommit = 0;
 	int keystrokeRtn = KEYSTROKE_ABSORB;
-	
+
 	if ( ! pgdata->bSelect ) {
 		/* If we're not selecting words, we should send out numeric
-		 * characters at once. 
+		 * characters at once.
 		 */
 		if ( pgdata->chiSymbolBufLen == 0 ) {
 			QuickCommit = 1;
@@ -1428,7 +1438,7 @@ CHEWING_API int chewing_handle_Numlock( 
 			keystrokeRtn = KEYSTROKE_IGNORE ;
 		}
 		else if ( QuickCommit ) {
-			pgo->commitStr[ 0 ] = pgdata->chiSymbolBuf[ 0 ]; 
+			pgo->commitStr[ 0 ] = pgdata->chiSymbolBuf[ 0 ];
 			pgo->nCommitStr = 1;
 			pgdata->chiSymbolBufLen = 0;
 			pgdata->chiSymbolCursor = 0;
@@ -1443,7 +1453,7 @@ CHEWING_API int chewing_handle_Numlock( 
 	else {
 		/* Otherwise, if we are selecting words, we use numeric keys
 		 * as selkey
-		 * and submit the words. 
+		 * and submit the words.
 		 */
 		int num = -1;
 		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
@@ -71,22 +71,44 @@ static void ChangeSelectIntervalAndBreak
 }
 
 /** @brief Loading all possible phrases after the cursor from long to short into AvailInfo structure.*/
-static void SetAvailInfo( 
-		AvailInfo *pai, const uint16 phoneSeq[], 
-		int nPhoneSeq, int begin, const int bSymbolArrBrkpt[] )
+static void SetAvailInfo(
+		AvailInfo *pai, const uint16 phoneSeq[],
+		int nPhoneSeq, int begin, const int bSymbolArrBrkpt[],
+		ChewingData *pgdata,int end)
 {
-	int end, pho_id;
+	int pho_id;
 	int diff;
 	uint16 userPhoneSeq[ MAX_PHONE_SEQ_LEN ];
 
 	pai->nAvail = 0;
 
-	for ( end = begin; end < nPhoneSeq; end++ ) {
-		diff = end - begin;
-		if ( diff > 0 && bSymbolArrBrkpt[ end ] ) 
-			break;
+	int i,head,head_tmp;
+	if ( pgdata->config.bPhraseChoiceRearward ){
+	        for (i=end;i>=begin;i--){
+			head=i;
+			if(bSymbolArrBrkpt[i])
+				break;
+		}
+		head_tmp=end;
+	}else{
+		head_tmp=head=begin;
+	}
 
-		pho_id = TreeFindPhrase( begin, end, phoneSeq );
+	int tail,tail_tmp;
+	if ( pgdata->config.bPhraseChoiceRearward ){
+		tail_tmp=tail=end;
+	}else{
+		for (i=begin;i<nPhoneSeq;i++){
+			if(bSymbolArrBrkpt[i])
+				break;
+			tail=i;
+		}
+		tail_tmp=begin;
+	}
+
+	while(head<=head_tmp && tail_tmp>=tail){
+		diff = tail_tmp - head_tmp;
+		pho_id = TreeFindPhrase( head_tmp, tail_tmp, phoneSeq );
 		if ( pho_id != -1 ) {
 			/* save it! */
 			pai->avail[ pai->nAvail ].len = diff + 1;
@@ -95,8 +117,8 @@ static void SetAvailInfo( 
 		}
 		else {
 			memcpy(
-				userPhoneSeq, 
-				&phoneSeq[ begin ], 
+				userPhoneSeq,
+				&phoneSeq[ head_tmp ],
 				sizeof( uint16 ) * ( diff + 1 ) ) ;
 			userPhoneSeq[ diff + 1 ] = 0;
 			if ( UserGetPhraseFirst( userPhoneSeq ) ) {
@@ -109,6 +131,12 @@ static void SetAvailInfo( 
 				pai->avail[ pai->nAvail ].id = -1;
 			}
 		}
+
+		if ( pgdata->config.bPhraseChoiceRearward ){
+			head_tmp--;
+		}else{
+			tail_tmp++;
+		}
 	}
 }
 
@@ -118,7 +146,7 @@ static int ChoiceTheSame( ChoiceInfo *pc
 	int i;
 
 	for ( i = 0; i < pci->nTotalChoice; i++ )
-		if ( ! memcmp( pci->totalChoiceStr[ i ], str, len ) ) 
+		if ( ! memcmp( pci->totalChoiceStr[ i ], str, len ) )
 			return 1;
 	return 0;
 }
@@ -138,7 +166,7 @@ static void SetChoiceInfo(
 	int len;
 	UserPhraseData *pUserPhraseData;
 	uint16 userPhoneSeq[ MAX_PHONE_SEQ_LEN ];
-	
+
 	/* Clears previous candidates. */
 	memset( pci->totalChoiceStr, '\0', sizeof(char) * MAX_CHOICE * MAX_PHRASE_LEN * MAX_UTF8_SIZE + 1);
 
@@ -150,9 +178,9 @@ static void SetChoiceInfo(
 	if ( len == 1 ) { /* single character */
 		GetCharFirst( &tempWord, phoneSeq[ cursor ] );
 		do {
-			if ( ChoiceTheSame( pci, tempWord.word, ueBytesFromChar( tempWord.word[0] ) * sizeof( char ) ) ) 
+			if ( ChoiceTheSame( pci, tempWord.word, ueBytesFromChar( tempWord.word[0] ) * sizeof( char ) ) )
 				continue;
-			memcpy( 
+			memcpy(
 				pci->totalChoiceStr[ pci->nTotalChoice ],
 				tempWord.word, ueBytesFromChar( tempWord.word[0] ) * sizeof( char ) );
 			assert(pci->nTotalChoice <= MAX_CHOICE);
@@ -165,9 +193,9 @@ static void SetChoiceInfo(
 		if ( pai->avail[ pai->currentAvail ].id != -1 ) {
 			GetPhraseFirst( &tempPhrase, pai->avail[ pai->currentAvail ].id );
 			do {
-				if ( ChoiceTheSame( 
-					pci, 
-					tempPhrase.phrase, 
+				if ( ChoiceTheSame(
+					pci,
+					tempPhrase.phrase,
 					len * ueBytesFromChar( tempPhrase.phrase[0] ) * sizeof( char ) ) ) {
 					continue;
 				}
@@ -183,9 +211,9 @@ static void SetChoiceInfo(
 		if ( pUserPhraseData ) {
 			do {
 				/* check if the phrase is already in the choice list */
-				if ( ChoiceTheSame( 
-					pci, 
-					pUserPhraseData->wordSeq, 
+				if ( ChoiceTheSame(
+					pci,
+					pUserPhraseData->wordSeq,
 					len * ueBytesFromChar( pUserPhraseData->wordSeq[0] ) * sizeof( char ) ) )
 					continue;
 				/* otherwise store it */
@@ -194,7 +222,7 @@ static void SetChoiceInfo(
 						pUserPhraseData->wordSeq,
 						len, 1);
 				pci->nTotalChoice++;
-			} while( ( pUserPhraseData = 
+			} while( ( pUserPhraseData =
 				UserGetPhraseNext( userPhoneSeq ) ) != NULL );
 		}
 
@@ -215,7 +243,9 @@ int ChoiceFirstAvail( ChewingData *pgdat
 	pgdata->choiceInfo.oldChiSymbolCursor = pgdata->chiSymbolCursor;
 
 	/* see if there is some word in the cursor position */
+	int end=pgdata->chiSymbolCursor;
 	if ( pgdata->chiSymbolBufLen == pgdata->chiSymbolCursor ) {
+		end--;
 		if ( pgdata->config.bPhraseChoiceRearward )
 			pgdata->chiSymbolCursor = pgdata->preferInterval[ pgdata->nPrefer - 1 ].from + CountSymbols( pgdata, pgdata->chiSymbolBufLen );
 		else
@@ -224,22 +254,23 @@ int ChoiceFirstAvail( ChewingData *pgdat
 
 	pgdata->bSelect = 1;
 
-	SetAvailInfo( 
-		&( pgdata->availInfo ), 
-		pgdata->phoneSeq, 
+	SetAvailInfo(
+		&( pgdata->availInfo ),
+		pgdata->phoneSeq,
 		pgdata->nPhoneSeq,
 		PhoneSeqCursor( pgdata ),
-		pgdata->bSymbolArrBrkpt );
+		pgdata->bSymbolArrBrkpt,
+		pgdata,end);
 
 	if ( ! pgdata->availInfo.nAvail )
 		return ChoiceEndChoice( pgdata );
 
 	pgdata->availInfo.currentAvail = pgdata->availInfo.nAvail - 1;
 	SetChoiceInfo(
-		&( pgdata->choiceInfo ), 
-		&( pgdata->availInfo ), 
-		pgdata->phoneSeq, 
-		PhoneSeqCursor( pgdata ), 
+		&( pgdata->choiceInfo ),
+		&( pgdata->availInfo ),
+		pgdata->phoneSeq,
+		PhoneSeqCursor( pgdata ),
 		pgdata->config.candPerPage );
 	return 0;
 }
@@ -249,24 +280,24 @@ int ChoicePrevAvail( ChewingData *pgdata
 	if (pgdata->choiceInfo.isSymbol) return 0;
 	if ( ++( pgdata->availInfo.currentAvail ) >= pgdata->availInfo.nAvail )
 		pgdata->availInfo.currentAvail = 0;
-	SetChoiceInfo( 
-		&( pgdata->choiceInfo ), 
-		&( pgdata->availInfo ), 
-		pgdata->phoneSeq, 
+	SetChoiceInfo(
+		&( pgdata->choiceInfo ),
+		&( pgdata->availInfo ),
+		pgdata->phoneSeq,
 		PhoneSeqCursor( pgdata ),
 		pgdata->config.candPerPage );
 	return 0;
 }
 
 /** @brief Return the next phrase not longer than the previous phrase. */
-int ChoiceNextAvail( ChewingData *pgdata ) 
+int ChoiceNextAvail( ChewingData *pgdata )
 {
 	if (pgdata->choiceInfo.isSymbol) return 0;
 	if ( --( pgdata->availInfo.currentAvail ) < 0 )
 		pgdata->availInfo.currentAvail = pgdata->availInfo.nAvail - 1;
 	SetChoiceInfo(
-		&( pgdata->choiceInfo ), 
-		&( pgdata->availInfo ), 
+		&( pgdata->choiceInfo ),
+		&( pgdata->availInfo ),
 		pgdata->phoneSeq,
 		PhoneSeqCursor( pgdata ),
 		pgdata->config.candPerPage );
@@ -292,17 +323,17 @@ static void ChangeUserData( ChewingData 
 	uint16 userPhoneSeq[ MAX_PHONE_SEQ_LEN ];
 	int len;
 
-	len = ueStrLen( pgdata->choiceInfo.totalChoiceStr[ selectNo ] ); 
+	len = ueStrLen( pgdata->choiceInfo.totalChoiceStr[ selectNo ] );
 	memcpy(
-		userPhoneSeq, 
-		&( pgdata->phoneSeq[ PhoneSeqCursor( pgdata ) ] ), 
+		userPhoneSeq,
+		&( pgdata->phoneSeq[ PhoneSeqCursor( pgdata ) ] ),
 		len * sizeof( uint16 ) );
 	userPhoneSeq[ len ] = 0;
 	UserUpdatePhrase( userPhoneSeq, pgdata->choiceInfo.totalChoiceStr[ selectNo ] );
 }
 
 /** @brief commit the selected phrase. */
-int ChoiceSelect( ChewingData *pgdata, int selectNo ) 
+int ChoiceSelect( ChewingData *pgdata, int selectNo )
 {
 	ChoiceInfo *pci = &( pgdata->choiceInfo );
 	AvailInfo *pai = &( pgdata->availInfo );


Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/libchewing/F-9/import.log,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- import.log	19 May 2009 08:06:49 -0000	1.10
+++ import.log	26 Jun 2009 06:48:48 -0000	1.11
@@ -8,3 +8,4 @@ libchewing-0_3_2-4_fc10:F-9:libchewing-0
 libchewing-0_3_2-6_fc10:F-9:libchewing-0.3.2-6.fc10.src.rpm:1235113916
 libchewing-0_3_2-8_fc10:F-9:libchewing-0.3.2-8.fc10.src.rpm:1240375994
 libchewing-0_3_2-9_fc11:F-9:libchewing-0.3.2-9.fc11.src.rpm:1242720345
+libchewing-0_3_2-11_fc11:F-9:libchewing-0.3.2-11.fc11.src.rpm:1245998888

libchewing-0.3.2.bz477690.patch:

Index: libchewing-0.3.2.bz477690.patch
===================================================================
RCS file: /cvs/pkgs/rpms/libchewing/F-9/libchewing-0.3.2.bz477690.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- libchewing-0.3.2.bz477690.patch	20 Feb 2009 07:13:07 -0000	1.3
+++ libchewing-0.3.2.bz477690.patch	26 Jun 2009 06:48:48 -0000	1.4
@@ -1,6 +1,6 @@
-diff -up ./data/Makefile.am.libpatch ./data/Makefile.am
---- ./data/Makefile.am.libpatch	2008-12-02 00:29:20.000000000 +1000
-+++ ./data/Makefile.am	2009-02-20 12:23:46.000000000 +1000
+diff -up ./data/Makefile.am.bz477690 ./data/Makefile.am
+--- ./data/Makefile.am.bz477690	2008-12-02 00:29:20.000000000 +1000
++++ ./data/Makefile.am	2009-05-20 14:24:31.000000000 +1000
 @@ -9,8 +9,11 @@ datas = \
  	us_freq.dat \
  	dict.dat \
@@ -24,9 +24,9 @@ diff -up ./data/Makefile.am.libpatch ./d
 +	    $(DESTDIR)/$(libdir)/chewing
 +
 +CLEANFILES = $(datas) $(datas_lib) gendata_stamp checkdata_stamp $(generated_header)
-diff -up ./src/Makefile.am.libpatch ./src/Makefile.am
---- ./src/Makefile.am.libpatch	2008-12-02 00:29:20.000000000 +1000
-+++ ./src/Makefile.am	2009-02-20 12:26:46.000000000 +1000
+diff -up ./src/Makefile.am.bz477690 ./src/Makefile.am
+--- ./src/Makefile.am.bz477690	2008-12-02 00:29:20.000000000 +1000
++++ ./src/Makefile.am	2009-05-20 14:24:31.000000000 +1000
 @@ -3,6 +3,7 @@ INCLUDES = \
  	-I$(top_srcdir)/include \
  	-I$(top_srcdir)/include/internal \
@@ -35,9 +35,9 @@ diff -up ./src/Makefile.am.libpatch ./sr
  	-DCHEWING_DATADIR=\"$(datadir)/chewing\"
  
  lib_LTLIBRARIES = libchewing.la
-diff -up ./src/tree.c.libpatch ./src/tree.c
---- ./src/tree.c.libpatch	2008-12-02 00:29:20.000000000 +1000
-+++ ./src/tree.c	2009-02-20 12:23:46.000000000 +1000
+diff -up ./src/tree.c.bz477690 ./src/tree.c
+--- ./src/tree.c.bz477690	2008-12-02 00:29:20.000000000 +1000
++++ ./src/tree.c	2009-05-20 14:24:31.000000000 +1000
 @@ -114,7 +114,8 @@ void InitTree( const char *prefix )
  	int i;
  #endif


Index: libchewing.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libchewing/F-9/libchewing.spec,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -p -r1.27 -r1.28
--- libchewing.spec	19 May 2009 08:06:49 -0000	1.27
+++ libchewing.spec	26 Jun 2009 06:48:48 -0000	1.28
@@ -1,7 +1,7 @@
 
 Name:           libchewing
 Version:        0.3.2
-Release:        9%{?dist}
+Release:        11%{?dist}
 Summary:        Intelligent phonetic input method library for Traditional Chinese
 
 Group:          System Environment/Libraries
@@ -18,13 +18,13 @@ Source:         http://chewing.csie.net/
 #Patch7: libchewing-0.3.0-9.bz200694.patch
 #Patch8: libchewing-0.3.0-11.bz195416.patch
 Patch9: libchewing-0.3.2.bz477690.patch
-Patch10: libchewing-0.3.2.phraseChoiceRearward
+Patch10: libchewing-0.3.2.phraseChoiceRearward.patch
 
 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 %define libchewing_python_dir %{python_sitearch}/%{name}
 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-root
-BuildRequires:  autoconf automake libtool
+BuildRequires:  autoconf automake libtool pkgconfig
 BuildRequires:  python-devel
 
 %description
@@ -59,9 +59,8 @@ library.
 %patch10 -p0 -b .phraseChoiceRearward
 
 %build
-#./autogen.sh
-#autoreconf -v
 export CFLAGS=-DLIBINSTDIR='\"%{_libdir}\" -g'
+autoreconf -ivf
 %configure --disable-static
 %{__make} RPM_CFLAGS="%{optflags}" %{_smp_mflags}
 
@@ -99,6 +98,14 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/*.so
 
 %changelog
+* Fri Jun 26 2009 Ding-Yi Chen <dchen at redhat dot com> - 0.3.2-11
+- Revise phraseChoiceRearward.patch so the cursor won't move to left
+  when repeatly press down key.
+
+* Wed May 20 2009 Ding-Yi Chen <dchen at redhat dot com> - 0.3.2-10
+- Need autoreconf and BuildRequires: pkgconfig to make changes in 
+  Makefile.am effective, thus actually fix [Bug 477960] libchewing multilib conflict.
+
 * Mon May 18 2009 Ding-Yi Chen <dchen at redhat dot com> - 0.3.2-9
 - Possible Fix of Bug 501220 - RFE: edit last preedit character from end of line
   Chewing upstream does not handle if phrase choice rearward is enabled.


--- libchewing-0.3.2.phraseChoiceRearward DELETED ---




More information about the fedora-extras-commits mailing list