diff --git a/capi/src/lib.rs b/capi/src/lib.rs index 31981e74..c22c22ed 100644 --- a/capi/src/lib.rs +++ b/capi/src/lib.rs @@ -988,6 +988,14 @@ pub mod globals { /// Returns whether the automatic learning is enabled or disabled. pub use super::io::chewing_get_autoLearn; + pub use super::io::chewing_config_has_option; + + pub use super::io::chewing_config_get_int; + pub use super::io::chewing_config_set_int; + + pub use super::io::chewing_config_get_str; + pub use super::io::chewing_config_set_str; + pub use super::public::MAX_CHI_SYMBOL_LEN; pub use super::public::MIN_CHI_SYMBOL_LEN; diff --git a/fuzzer/src/bin/fuzzer.rs b/fuzzer/src/bin/fuzzer.rs index 90228c47..8cfeda3e 100644 --- a/fuzzer/src/bin/fuzzer.rs +++ b/fuzzer/src/bin/fuzzer.rs @@ -11,9 +11,10 @@ use chewing_capi::{ chewing_cand_TotalPage, chewing_cand_hasNext, chewing_set_candPerPage, }, globals::{ - chewing_set_addPhraseDirection, chewing_set_autoLearn, chewing_set_autoShiftCur, - chewing_set_easySymbolInput, chewing_set_escCleanAllBuf, chewing_set_maxChiSymbolLen, - chewing_set_phraseChoiceRearward, chewing_set_spaceAsSelection, + chewing_config_set_int, chewing_set_addPhraseDirection, chewing_set_autoLearn, + chewing_set_autoShiftCur, chewing_set_easySymbolInput, chewing_set_escCleanAllBuf, + chewing_set_maxChiSymbolLen, chewing_set_phraseChoiceRearward, + chewing_set_spaceAsSelection, }, input::*, layout::chewing_set_KBType, @@ -186,6 +187,24 @@ pub fn main() -> Result<()> { .clamp(0, 1) .into(), ); + chewing_config_set_int( + ctx, + c"chewing.enable_fullwidth_toggle_key".as_ptr(), + ops.next() + .transpose()? + .unwrap_or_default() + .clamp(0, 1) + .into(), + ); + chewing_config_set_int( + ctx, + c"chewing.conversion_engine".as_ptr(), + ops.next() + .transpose()? + .unwrap_or_default() + .clamp(0, 2) + .into(), + ); while let Some(Ok(op)) = ops.next() { use ChewingHandle::*;