rpms/libchewing/devel 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.32, 1.33 libchewing-0.3.2.phraseChoiceRearward, 1.1, NONE

Ding-Yi Chen dchen at fedoraproject.org
Wed May 20 07:09:28 UTC 2009


Author: dchen

Update of /cvs/pkgs/rpms/libchewing/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27858/devel

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:
Need autoreconf and BuildRequires: pkgconfig to make changes in Makefile.am effective

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-05-18 18:02:15.000000000 +1000
@@ -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_last=-1;
 
 	CheckAndResetRange( pgdata );
 
@@ -757,9 +758,15 @@ CHEWING_API int chewing_handle_Down( Che
 
 	if ( toSelect ) {
 		if( ! pgdata->bSelect ) {
+			cursor_last=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_last -pgdata->availInfo.avail[avail_willbe].len;
+			}
 			ChoiceNextAvail( pgdata );
 		}
 	} 
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-05-18 17:56:32.000000000 +1000
@@ -73,20 +73,42 @@ 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[] )
+		int nPhoneSeq, int begin, const int bSymbolArrBrkpt[],
+		ChewingData *pgdata)
 {
 	int end, pho_id;
 	int diff;
 	uint16 userPhoneSeq[ MAX_PHONE_SEQ_LEN ];
 
 	pai->nAvail = 0;
+	
+	int i,head,head_tmp;
+	if ( pgdata->config.bPhraseChoiceRearward ){
+		for (i=nPhoneSeq-1;i>=begin;i--){
+			head=i;
+			if(bSymbolArrBrkpt[i])
+				break;
+		}
+		head_tmp=nPhoneSeq-1;
+	}else{
+		head_tmp=head=begin;
+	}
 
-	for ( end = begin; end < nPhoneSeq; end++ ) {
-		diff = end - begin;
-		if ( diff > 0 && bSymbolArrBrkpt[ end ] ) 
-			break;
+	int tail,tail_tmp;
+	if ( pgdata->config.bPhraseChoiceRearward ){
+		tail_tmp=tail=nPhoneSeq-1;
+	}else{
+		for (i=begin;i<nPhoneSeq;i++){
+			if(bSymbolArrBrkpt[i])
+				break;
+			tail=i;
+		}
+		tail_tmp=begin;
+	}
 
-		pho_id = TreeFindPhrase( begin, end, phoneSeq );
+	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;
@@ -96,7 +118,7 @@ static void SetAvailInfo( 
 		else {
 			memcpy(
 				userPhoneSeq, 
-				&phoneSeq[ begin ], 
+				&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++;
+		}
 	}
 }
 
@@ -229,7 +257,8 @@ int ChoiceFirstAvail( ChewingData *pgdat
 		pgdata->phoneSeq, 
 		pgdata->nPhoneSeq,
 		PhoneSeqCursor( pgdata ),
-		pgdata->bSymbolArrBrkpt );
+		pgdata->bSymbolArrBrkpt,
+		pgdata);
 
 	if ( ! pgdata->availInfo.nAvail )
 		return ChoiceEndChoice( pgdata );


Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/libchewing/devel/import.log,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- import.log	19 May 2009 07:59:16 -0000	1.10
+++ import.log	20 May 2009 07:08:57 -0000	1.11
@@ -8,3 +8,4 @@ libchewing-0_3_2-4_fc10:HEAD:libchewing-
 libchewing-0_3_2-6_fc10:HEAD:libchewing-0.3.2-6.fc10.src.rpm:1235113283
 libchewing-0_3_2-8_fc10:HEAD:libchewing-0.3.2-8.fc10.src.rpm:1240375796
 libchewing-0_3_2-9_fc11:HEAD:libchewing-0.3.2-9.fc11.src.rpm:1242719923
+libchewing-0_3_2-10_fc11:HEAD:libchewing-0.3.2-10.fc11.src.rpm:1242803240

libchewing-0.3.2.bz477690.patch:

Index: libchewing-0.3.2.bz477690.patch
===================================================================
RCS file: /cvs/pkgs/rpms/libchewing/devel/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:01:57 -0000	1.3
+++ libchewing-0.3.2.bz477690.patch	20 May 2009 07:08:57 -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/devel/libchewing.spec,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- libchewing.spec	19 May 2009 07:59:16 -0000	1.32
+++ libchewing.spec	20 May 2009 07:08:57 -0000	1.33
@@ -1,7 +1,7 @@
 
 Name:           libchewing
 Version:        0.3.2
-Release:        9%{?dist}
+Release:        10%{?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,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/*.so
 
 %changelog
+* Wed May 20 2009 Ding-Yi Chen <dchen at redhat dot com> - 0.3.2-10
+- Need autoreconf to make changes in Makefile.am effective.
+
 * 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