2323#include "ibus-chewing-preedit.h"
2424#include "ibus-chewing-lookup-table.h"
2525#include "ibus-chewing-util.h"
26- #include "maker-dialog-util.h"
2726#include "ibus-chewing-engine-private.h"
2827#include <chewing.h>
2928#include <glib.h>
@@ -569,7 +568,7 @@ void ibus_chewing_engine_refresh_property(IBusChewingEngine *self,
569568#ifndef UNIT_TEST
570569 IBUS_CHEWING_LOG (DEBUG , "refresh_property(%s) status=%x" , prop_name , self -> statusFlags );
571570
572- if (STRING_EQUALS (prop_name , "InputMode" )) {
571+ if (g_strcmp0 (prop_name , "InputMode" ) == 0 ) {
573572
574573 ibus_property_set_label (self -> InputMode ,
575574 ibus_chewing_pre_edit_get_chi_eng_mode (self -> icPreEdit )
@@ -585,7 +584,7 @@ void ibus_chewing_engine_refresh_property(IBusChewingEngine *self,
585584
586585 ibus_engine_update_property (IBUS_ENGINE (self ), self -> InputMode );
587586
588- } else if (STRING_EQUALS (prop_name , "AlnumSize" )) {
587+ } else if (g_strcmp0 (prop_name , "AlnumSize" ) == 0 ) {
589588
590589 ibus_property_set_label (self -> AlnumSize , chewing_get_ShapeMode (self -> icPreEdit -> context )
591590 ? self -> AlnumSize_label_full
@@ -601,7 +600,7 @@ void ibus_chewing_engine_refresh_property(IBusChewingEngine *self,
601600 if (self -> statusFlags & ENGINE_FLAG_PROPERTIES_REGISTERED )
602601 ibus_engine_update_property (IBUS_ENGINE (self ), self -> AlnumSize );
603602
604- } else if (STRING_EQUALS (prop_name , "setup_prop" )) {
603+ } else if (g_strcmp0 (prop_name , "setup_prop" ) == 0 ) {
605604#if IBUS_CHECK_VERSION (1 , 5 , 0 )
606605 ibus_property_set_symbol (self -> setup_prop , self -> setup_prop_symbol );
607606#endif
@@ -650,11 +649,11 @@ static IBusProperty *ibus_chewing_engine_get_ibus_property_by_name(IBusChewingEn
650649 g_return_val_if_fail (self != NULL , (IBusProperty * )0 );
651650 g_return_val_if_fail (IBUS_IS_CHEWING_ENGINE (self ), (IBusProperty * )0 );
652651 {
653- if (STRING_EQUALS (prop_name , "InputMode" )) {
652+ if (g_strcmp0 (prop_name , "InputMode" ) == 0 ) {
654653 return self -> InputMode ;
655- } else if (STRING_EQUALS (prop_name , "AlnumSize" )) {
654+ } else if (g_strcmp0 (prop_name , "AlnumSize" ) == 0 ) {
656655 return self -> AlnumSize ;
657- } else if (STRING_EQUALS (prop_name , "setup_prop" )) {
656+ } else if (g_strcmp0 (prop_name , "setup_prop" ) == 0 ) {
658657 return self -> setup_prop ;
659658 }
660659 IBUS_CHEWING_LOG (MSG , "get_ibus_property_by_name(%s): NULL is returned" , prop_name );
@@ -1017,7 +1016,7 @@ void commit_text(IBusChewingEngine *self) {
10171016gboolean ibus_chewing_engine_process_key_event (IBusEngine * engine , KSym keySym , guint keycode ,
10181017 KeyModifiers unmaskedMod ) {
10191018 IBUS_CHEWING_LOG (MSG , "******** process_key_event(-,%x(%s),%x,%x) %s" , keySym ,
1020- key_sym_get_name (keySym ), keycode , unmaskedMod ,
1019+ ibus_keyval_name (keySym ), keycode , unmaskedMod ,
10211020 modifiers_to_string (unmaskedMod ));
10221021
10231022 IBusChewingEngine * self = IBUS_CHEWING_ENGINE (engine );
@@ -1081,17 +1080,17 @@ void ibus_chewing_engine_property_activate(IBusEngine *engine, const gchar *prop
10811080 IBUS_CHEWING_LOG (INFO , "property_activate(-, %s, %u)" , prop_name , prop_state );
10821081 IBusChewingEngine * self = IBUS_CHEWING_ENGINE (engine );
10831082
1084- if (STRING_EQUALS (prop_name , "InputMode" )) {
1083+ if (g_strcmp0 (prop_name , "InputMode" ) == 0 ) {
10851084 /* Toggle Chinese <-> English */
10861085 ibus_chewing_pre_edit_toggle_chi_eng_mode (self -> icPreEdit );
10871086 IBUS_CHEWING_LOG (INFO , "property_activate chinese=%d" , is_chinese_mode (self ));
10881087 ibus_chewing_engine_refresh_property (self , prop_name );
1089- } else if (STRING_EQUALS (prop_name , "AlnumSize" )) {
1088+ } else if (g_strcmp0 (prop_name , "AlnumSize" ) == 0 ) {
10901089 /* Toggle Full <-> Half */
10911090 ibus_chewing_pre_edit_toggle_full_half_mode (self -> icPreEdit );
10921091 IBUS_CHEWING_LOG (INFO , "property_activate fullwidth=%d" , is_fullwidth_mode (self ));
10931092 ibus_chewing_engine_refresh_property (self , prop_name );
1094- } else if (STRING_EQUALS (prop_name , "setup_prop" )) {
1093+ } else if (g_strcmp0 (prop_name , "setup_prop" ) == 0 ) {
10951094 /* open preferences window */
10961095 char * argv [] = {QUOTE_ME (LIBEXEC_DIR ) "/ibus-setup-chewing" , NULL };
10971096 g_spawn_async (NULL , argv , NULL , G_SPAWN_DEFAULT , NULL , NULL , NULL , NULL );
@@ -1103,15 +1102,15 @@ void ibus_chewing_engine_property_activate(IBusEngine *engine, const gchar *prop
11031102
11041103char ibus_chewing_engine_get_default_english_case (IBusChewingEngine * self ) {
11051104 char * prop = self -> prop_default_english_case ;
1106- return STRING_EQUALS (prop , "lowercase" ) ? 'l' : STRING_EQUALS (prop , "uppercase" ) ? 'u' : 'n' ;
1105+ return g_strcmp0 (prop , "lowercase" ) == 0 ? 'l' : g_strcmp0 (prop , "uppercase" ) == 0 ? 'u' : 'n' ;
11071106}
11081107
11091108char ibus_chewing_engine_get_chinese_english_toggle_key (IBusChewingEngine * self ) {
11101109 char * prop = self -> prop_chi_eng_mode_toggle ;
1111- return STRING_EQUALS (prop , "caps_lock" ) ? 'c'
1112- : STRING_EQUALS (prop , "shift" ) ? 's'
1113- : STRING_EQUALS (prop , "shift_l" ) ? 'l'
1114- : STRING_EQUALS (prop , "shift_r" ) ? 'r'
1110+ return g_strcmp0 (prop , "caps_lock" ) == 0 ? 'c'
1111+ : g_strcmp0 (prop , "shift" ) == 0 ? 's'
1112+ : g_strcmp0 (prop , "shift_l" ) == 0 ? 'l'
1113+ : g_strcmp0 (prop , "shift_r" ) == 0 ? 'r'
11151114 : 'n' ;
11161115 return 'n' ;
11171116}
0 commit comments