rpms/scim-chewing/devel scim-chewing-0.3.1-15.bz195416.patch, NONE, 1.1 scim-chewing.spec, 1.37, 1.38

Caius Chance (cchance) fedora-extras-commits at redhat.com
Thu Apr 24 06:35:25 UTC 2008


Author: cchance

Update of /cvs/pkgs/rpms/scim-chewing/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17292

Modified Files:
	scim-chewing.spec 
Added Files:
	scim-chewing-0.3.1-15.bz195416.patch 
Log Message:
* Wed Apr 09 2008 Caius Chance <cchance at redhat.com> 0.3.1-15.fc9
- Resolves: rhbz#195416 (Initial input mode configuration.)
- Modified patch naming in .spec file.



scim-chewing-0.3.1-15.bz195416.patch:

--- NEW FILE scim-chewing-0.3.1-15.bz195416.patch ---
diff -up scim-chewing-0.3.1/src/scim_chewing_config_entry.h.9-bz195416 scim-chewing-0.3.1/src/scim_chewing_config_entry.h
--- scim-chewing-0.3.1/src/scim_chewing_config_entry.h.9-bz195416	2006-05-31 01:06:34.000000000 +1000
+++ scim-chewing-0.3.1/src/scim_chewing_config_entry.h	2008-04-24 16:22:50.000000000 +1000
@@ -39,6 +39,9 @@
 #define SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_KEY \
 	"/IMEngine/Chewing/ChiEngKey"
 
+#define SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE \
+	"/IMEngine/Chewing/ChiEngMode"
+
 #define SCIM_CONFIG_IMENGINE_CHEWING_USE_CAPSLOCK \
 	"/IMEngine/Chewing/UseCapslock"
 
diff -up scim-chewing-0.3.1/src/scim_chewing_imengine.cpp.9-bz195416 scim-chewing-0.3.1/src/scim_chewing_imengine.cpp
--- scim-chewing-0.3.1/src/scim_chewing_imengine.cpp.9-bz195416	2008-04-24 16:22:50.000000000 +1000
+++ scim-chewing-0.3.1/src/scim_chewing_imengine.cpp	2008-04-24 16:25:55.000000000 +1000
@@ -35,7 +35,7 @@
   #define bind_textdomain_codeset(domain,codeset)
 #endif
 
-#define SCIM_PROP_CHIENG \
+#define SCIM_PROP_CHI_ENG_MODE \
 	"/IMEngine/Chinese/Chewing/ChiEngMode"
 #define SCIM_PROP_LETTER \
 	"/IMEngine/Chinese/Chewing/FullHalfLetter"
@@ -57,7 +57,7 @@ using namespace scim;
 static IMEngineFactoryPointer _scim_chewing_factory( 0 );
 static ConfigPointer _scim_config( 0 );
 
-static Property _chieng_property (SCIM_PROP_CHIENG, "");
+static Property _chieng_property (SCIM_PROP_CHI_ENG_MODE, "");
 static Property _letter_property (SCIM_PROP_LETTER, "");
 static Property _kbtype_property (SCIM_PROP_KBTYPE, "");
 //static Property _punct_property  (SCIM_PROP_PUNCT, _("Full/Half Punct"));
@@ -150,12 +150,20 @@ void ChewingIMEngineFactory::reload_conf
 			String( "Shift+Shift_R+KeyRelease" ) );
 	scim_string_to_key_list( m_chi_eng_keys, str );
 
-	// Load keyboard type
+	// Load input mode
     SCIM_DEBUG_IMENGINE( 2 ) <<
+        "Load input mode\n";
+        m_input_mode = m_config->read (
+			String( SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE ),
+			String( "Chi" ));
+
+	// Load keyboard type
+	SCIM_DEBUG_IMENGINE( 2 ) <<
         "Load keyboard type\n";
 	m_KeyboardType = m_config->read (
 			String( SCIM_CONFIG_IMENGINE_CHEWING_USER_KB_TYPE ),
 			String( "KB_DEFAULT" ));
+        
 
 	// SCIM_CONFIG_IMENGINE_CHEWING_USER_SELECTION_KEYS
 	m_selection_keys = m_config->read(
@@ -327,9 +335,9 @@ bool ChewingIMEngineInstance::process_ke
 
 	if ( match_key_event( m_factory->m_chi_eng_keys, key ) ) {
 		m_prev_key = key;
-		trigger_property( SCIM_PROP_CHIENG );
+		trigger_property( SCIM_PROP_CHI_ENG_MODE );
 		SCIM_DEBUG_IMENGINE( 2 ) <<
-			"Matcg Chi/Eng Key, End Process\n";
+			"Match Chi/Eng Key, End Process\n";
 		return true;
 	}
 	m_prev_key = key;
@@ -494,6 +502,14 @@ void ChewingIMEngineInstance::reset()
 	/* Configure Keyboard Type */
 	chewing_set_KBType( ctx, chewing_KBStr2Num( 
 				(char *) m_factory->m_KeyboardType.c_str() ));
+
+	/* Configure Chinese/English Input Mode */
+	int chieng_mode_flag;
+	if ( m_factory->m_input_mode == "Chi" )
+		chieng_mode_flag = 1;
+	else
+		chieng_mode_flag = 0;
+	chewing_set_ChiEngMode( ctx, chieng_mode_flag );
 	
 	/* Configure selection keys definition */
 	int i = 0;
@@ -531,9 +547,8 @@ void ChewingIMEngineInstance::focus_out(
 
 void ChewingIMEngineInstance::trigger_property( const String& property )
 {
-	if ( property == SCIM_PROP_CHIENG ) {
-		chewing_handle_Capslock( ctx );
-		commit( ctx->output );
+	if ( property == SCIM_PROP_CHI_ENG_MODE ) {
+		chewing_set_ChiEngMode( ctx, !chewing_get_ChiEngMode( ctx ) );
 	} else if ( property == SCIM_PROP_LETTER ) {
 		chewing_set_ShapeMode( ctx, !chewing_get_ShapeMode( ctx ) );
 	} else if ( property == SCIM_PROP_KBTYPE ) {
diff -up scim-chewing-0.3.1/src/scim_chewing_imengine.h.9-bz195416 scim-chewing-0.3.1/src/scim_chewing_imengine.h
--- scim-chewing-0.3.1/src/scim_chewing_imengine.h.9-bz195416	2008-04-24 16:22:50.000000000 +1000
+++ scim-chewing-0.3.1/src/scim_chewing_imengine.h	2008-04-24 16:22:50.000000000 +1000
@@ -60,6 +60,7 @@ private:
 	KeyEventList m_chi_eng_keys;
 	String m_KeyboardType;
 	String m_selection_keys;
+	String m_input_mode;
 	int m_selection_keys_num;
 	bool m_add_phrase_forward;
 	bool m_space_as_selection;
diff -up scim-chewing-0.3.1/src/scim_chewing_imengine_setup.cpp.9-bz195416 scim-chewing-0.3.1/src/scim_chewing_imengine_setup.cpp
--- scim-chewing-0.3.1/src/scim_chewing_imengine_setup.cpp.9-bz195416	2008-04-24 16:22:50.000000000 +1000
+++ scim-chewing-0.3.1/src/scim_chewing_imengine_setup.cpp	2008-04-24 16:22:50.000000000 +1000
@@ -140,6 +140,7 @@ static String __config_kb_type_data;
 static String __config_kb_type_data_translated;
 static String __config_selKey_type_data;
 static String __config_selKey_num_data;
+static String __config_chieng_mode_data;
 static bool __have_changed                 = false;
 
 // static GtkWidget    * __widget_use_capslock          = 0;
@@ -150,8 +151,10 @@ static GtkWidget    * __widget_kb_type =
 static GList *kb_type_list = 0;
 static GtkWidget    * __widget_selKey_type = 0;
 static GtkWidget    * __widget_selKey_num = 0;
+static GtkWidget    * __widget_chieng_mode = 0;
 static GList *selKey_type_list = 0;
 static GList *selKey_num_list = 0;
+static GList *chieng_mode_list = 0;
 // static GtkWidget    * __widget_show_candidate_comment= 0;
 static GtkTooltips  * __widget_tooltips              = 0;
 
@@ -408,12 +411,17 @@ static const char *builtin_selectkeys_nu
 	"5"
 };
 
+static const char *builtin_chieng_mode[] = {
+	"Chi",
+	"Eng"
+};
+
 static GtkWidget *create_keyboard_page()
 {
 	GtkWidget *table;
 	GtkWidget *label;
 
-	table = gtk_table_new (4, 5, FALSE);
+	table = gtk_table_new (5, 5, FALSE);
 	gtk_widget_show (table);
 
 	unsigned int i;
@@ -512,6 +520,40 @@ static GtkWidget *create_keyboard_page()
 		G_CALLBACK (on_default_editable_changed),
 		&(__config_selKey_type_data));
 
+	// Setup chieng_mode combo box
+	__widget_chieng_mode = gtk_combo_new();
+	gtk_widget_show (__widget_chieng_mode);
+
+	for (i = 0; 
+	     i < (sizeof(builtin_chieng_mode) / sizeof(builtin_chieng_mode[0])); 
+	     i++) {
+		chieng_mode_list = g_list_append(
+				chieng_mode_list,
+				(void *) builtin_chieng_mode[ i ] );
+	}
+	
+	gtk_combo_set_popdown_strings (GTK_COMBO (__widget_chieng_mode), chieng_mode_list);
+	g_list_free(chieng_mode_list);
+	gtk_combo_set_use_arrows (GTK_COMBO (__widget_chieng_mode), TRUE);
+	gtk_editable_set_editable (GTK_EDITABLE (GTK_ENTRY (GTK_COMBO (__widget_chieng_mode)->entry)), FALSE);
+	label = gtk_label_new (_("Initial trigger Chinese/English mode:"));
+	gtk_widget_show (label);
+	gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+	gtk_misc_set_padding (GTK_MISC (label), 4, 0);
+	gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1,
+			(GtkAttachOptions) (GTK_FILL),
+			(GtkAttachOptions) (GTK_FILL), 4, 4);
+	gtk_table_attach (GTK_TABLE (table), __widget_chieng_mode, 1, 2, i, i+1,
+			(GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
+			(GtkAttachOptions) (GTK_FILL), 4, 4);
+	gtk_tooltips_set_tip (__widget_tooltips, GTK_COMBO (__widget_chieng_mode)->entry,
+			_("Change the default Chinese/English mode on every trigger"), NULL);
+	g_signal_connect(
+		(gpointer) GTK_ENTRY(GTK_COMBO(__widget_chieng_mode)->entry), 
+		"changed",
+		G_CALLBACK (on_default_editable_changed),
+		&(__config_chieng_mode_data));
+
 	// Setup selKey_num combo box
 	__widget_selKey_num = gtk_combo_new();
 	gtk_widget_show (__widget_selKey_num);
@@ -725,6 +767,23 @@ void setup_widget_value()
 		GTK_ENTRY(GTK_COMBO(__widget_selKey_num)->entry),
 		builtin_selectkeys_num[index_selectkeys_num]
 	);
+
+	/* chieng_mode */
+	int index_chieng_mode =
+		sizeof(builtin_chieng_mode) / sizeof(builtin_chieng_mode[0]) - 1;
+	for ( ; index_chieng_mode >= 0;  index_chieng_mode--) {
+		if ( __config_chieng_mode_data ==
+			builtin_chieng_mode[index_chieng_mode]) {
+			break;
+		}
+	}
+	if (index_chieng_mode < 0)
+		index_chieng_mode = 0;
+	
+	gtk_entry_set_text (
+		GTK_ENTRY(GTK_COMBO(__widget_chieng_mode)->entry),
+		builtin_chieng_mode[index_chieng_mode]
+	);
 }
 
 void load_config( const ConfigPointer &config )
@@ -754,6 +813,10 @@ void load_config( const ConfigPointer &c
 			config->read( String( SCIM_CHEWING_SELECTION_KEYS_NUM ),
 					__config_selKey_num_data);
 
+		__config_chieng_mode_data =
+			config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE ),
+					__config_chieng_mode_data);
+
 		for (int i = 0; __config_keyboards[ i ].key; ++ i) {
 			__config_keyboards[ i ].data =
 				config->read( String( __config_keyboards [ i ].key ),
@@ -834,8 +897,21 @@ void save_config( const ConfigPointer &c
 		config->write (String (SCIM_CHEWING_SELECTION_KEYS_NUM),
 		               __config_selKey_num_data);
 
-//		config->write (String (SCIM_CONFIG_IMENGINE_CHEWING_SHOW_CANDIDATE_COMMENT),
-//				__config_show_candidate_comment);
+		// SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE
+		int index_chieng_mode =
+			sizeof(builtin_chieng_mode) / sizeof(builtin_chieng_mode[0]) - 1;
+		for ( ; index_chieng_mode >= 0; index_chieng_mode--) {
+			if (__config_chieng_mode_data ==
+			    builtin_chieng_mode[index_chieng_mode]) {
+				break;
+			}
+		}
+		if (index_chieng_mode < 0)
+			index_chieng_mode = 0;
+		__config_chieng_mode_data =
+			builtin_chieng_mode[index_chieng_mode];
+
+		config->write (String (SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE)		               , __config_chieng_mode_data);
 
 		for (int i = 0; __config_keyboards [i].key; ++ i) {
 			config->write (String (__config_keyboards [i].key),


Index: scim-chewing.spec
===================================================================
RCS file: /cvs/pkgs/rpms/scim-chewing/devel/scim-chewing.spec,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- scim-chewing.spec	8 Apr 2008 07:08:02 -0000	1.37
+++ scim-chewing.spec	24 Apr 2008 06:34:49 -0000	1.38
@@ -1,6 +1,6 @@
 Name:           scim-chewing
 Version:        0.3.1
-Release:        14%{?dist}
+Release:        15%{?dist}
 Summary:        Chewing Chinese input method for SCIM
 
 License:        GPL
@@ -20,6 +20,7 @@
 Patch6:         scim-chewing-0.3.1-11.bz200694.patch
 Patch7:         scim-chewing-0.3.1-13.gcc.patch
 Patch8:         scim-chewing-0.3.1-14.bz228428.patch
+Patch9:         scim-chewing-0.3.1-15.bz195416.patch
 
 %description
 This package provides Chewing Chinese input method for SCIM. 
@@ -27,15 +28,16 @@
 
 %prep
 %setup -q
-%patch0 -p1 -b .1-bz197556
-%patch1 -p1 -b .2-bz206125
-%patch2 -p1 -b .3-bz206112
-%patch3 -p1 -b .4-bz206120
-%patch4 -p1 -b .5-bz216581
-%patch5 -p1 -b .6-bz237924
-%patch6 -p1 -b .7-bz200694
-%patch7 -p1 -b .8-gcc
-%patch8 -p1 -b .9-bz228428
+%patch0 -p1 -b .0-bz197556
+%patch1 -p1 -b .1-bz206125
+%patch2 -p1 -b .2-bz206112
+%patch3 -p1 -b .3-bz206120
+%patch4 -p1 -b .4-bz216581
+%patch5 -p1 -b .5-bz237924
+%patch6 -p1 -b .6-bz200694
+%patch7 -p1 -b .7-gcc
+%patch8 -p1 -b .8-bz228428
+%patch9 -p1 -b .9-bz195416
 
 %build
 %configure --disable-static
@@ -65,7 +67,11 @@
 
 
 %changelog
-* Wed Apr 08 2008 Caius Chance <cchance at redhat.com> 0.3.1-14.fc9
+* Wed Apr 09 2008 Caius Chance <cchance at redhat.com> 0.3.1-15.fc9
+- Resolves: rhbz#195416 (Initial input mode configuration.)
+- Modified patch naming in .spec file.
+
+* Tue Apr 08 2008 Caius Chance <cchance at redhat.com> 0.3.1-14.fc9
 - Resolves: rhbz#228428 (Ctrl-v during preedit appears in buffer on Qt XIM.)
 
 * Wed Jan 13 2008 Caius Chance <cchance at redhat.com> 0.3.1-13.fc9




More information about the fedora-extras-commits mailing list