diff options
Diffstat (limited to 'src/wkb-ibus-config-eet.c')
-rw-r--r-- | src/wkb-ibus-config-eet.c | 478 |
1 files changed, 475 insertions, 3 deletions
diff --git a/src/wkb-ibus-config-eet.c b/src/wkb-ibus-config-eet.c index 68d5573..7e80933 100644 --- a/src/wkb-ibus-config-eet.c +++ b/src/wkb-ibus-config-eet.c @@ -39,6 +39,8 @@ static Eet_Data_Descriptor *_hotkey_edd; static Eet_Data_Descriptor *_panel_edd; static Eet_Data_Descriptor *_engine_edd; static Eet_Data_Descriptor *_hangul_edd; +static Eet_Data_Descriptor *_pinyin_edd; +static Eet_Data_Descriptor *_bopomofo_edd; static Eet_Data_Descriptor *_weekeyboard_edd; /* @@ -750,14 +752,447 @@ _config_hangul_new(struct _config_section *parent) /* * NO SCHEMA AVAILABLE. BASED ON THE SOURCE CODE */ +struct _config_pinyin +{ + struct _config_section base; + + Eina_Bool autocommit; + Eina_Bool commaperiodpage; + Eina_Bool correctpinyin; + Eina_Bool correctpinyin_gn_ng; + Eina_Bool correctpinyin_iou_iu; + Eina_Bool correctpinyin_mg_ng; + Eina_Bool correctpinyin_on_ong; + Eina_Bool correctpinyin_uei_ui; + Eina_Bool correctpinyin_uen_un; + Eina_Bool correctpinyin_ue_ve; + Eina_Bool correctpinyin_v_u; + Eina_Bool ctrlswitch; + const char *dictionaries; + Eina_Bool doublepinyin; + int doublepinyinschema; + Eina_Bool dynamicadjust; + Eina_Bool fuzzypinyin; + Eina_Bool fuzzypinyin_an_ang; + Eina_Bool fuzzypinyin_ang_an; + Eina_Bool fuzzypinyin_c_ch; + Eina_Bool fuzzypinyin_ch_c; + Eina_Bool fuzzypinyin_en_eng; + Eina_Bool fuzzypinyin_eng_en; + Eina_Bool fuzzypinyin_f_h; + Eina_Bool fuzzypinyin_g_k; + Eina_Bool fuzzypinyin_h_f; + Eina_Bool fuzzypinyin_ing_in; + Eina_Bool fuzzypinyin_in_ing; + Eina_Bool fuzzypinyin_k_g; + Eina_Bool fuzzypinyin_l_n; + Eina_Bool fuzzypinyin_l_r; + Eina_Bool fuzzypinyin_n_l; + Eina_Bool fuzzypinyin_r_l; + Eina_Bool fuzzypinyin_sh_s; + Eina_Bool fuzzypinyin_s_sh; + Eina_Bool fuzzypinyin_zh_z; + Eina_Bool fuzzypinyin_z_zh; + Eina_Bool incompletepinyin; + Eina_Bool initchinese; + Eina_Bool initfull; + Eina_Bool initfullpunct; + Eina_Bool initsimplifiedchinese; + int lookuptableorientation; + int lookuptablepagesize; + Eina_Bool minusequalpage; + Eina_Bool shiftselectcandidate; + Eina_Bool specialphrases; +}; + +static Eet_Data_Descriptor * +_config_pinyin_edd_new(void) +{ + Eet_Data_Descriptor *edd; + Eet_Data_Descriptor_Class eddc; + + EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, struct _config_pinyin); + edd = eet_data_descriptor_stream_new(&eddc); + + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "AutoCommit", autocommit, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CommaPeriodPage", commaperiodpage, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin", correctpinyin, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin_GN_NG", correctpinyin_gn_ng, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin_IOU_IU", correctpinyin_iou_iu, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin_MG_NG", correctpinyin_mg_ng, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin_ON_ONG", correctpinyin_on_ong, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin_UEI_UI", correctpinyin_uei_ui, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin_UEN_UN", correctpinyin_uen_un, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin_UE_VE", correctpinyin_ue_ve, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CorrectPinyin_V_U", correctpinyin_v_u, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "CtrlSwitch", ctrlswitch, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "Dictionaries", dictionaries, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "DoublePinyin", doublepinyin, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "DoublePinyinSchema", doublepinyinschema, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "DynamicAdjust", dynamicadjust, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin", fuzzypinyin, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_AN_ANG", fuzzypinyin_an_ang, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_ANG_AN", fuzzypinyin_ang_an, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_C_CH", fuzzypinyin_c_ch, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_CH_C", fuzzypinyin_ch_c, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_EN_ENG", fuzzypinyin_en_eng, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_ENG_EN", fuzzypinyin_eng_en, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_F_H", fuzzypinyin_f_h, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_G_K", fuzzypinyin_g_k, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_H_F", fuzzypinyin_h_f, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_ING_IN", fuzzypinyin_ing_in, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_IN_ING", fuzzypinyin_in_ing, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_K_G", fuzzypinyin_k_g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_L_N", fuzzypinyin_l_n, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_L_R", fuzzypinyin_l_r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_N_L", fuzzypinyin_n_l, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_R_L", fuzzypinyin_r_l, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_SH_S", fuzzypinyin_sh_s, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_S_SH", fuzzypinyin_s_sh, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_ZH_Z", fuzzypinyin_zh_z, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "FuzzyPinyin_Z_ZH", fuzzypinyin_z_zh, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "IncompletePinyin", incompletepinyin, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "InitChinese", initchinese, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "InitFull", initfull, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "InitFullPunct", initfullpunct, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "InitSimplifiedChinese", initsimplifiedchinese, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "LookupTableOrientation", lookuptableorientation, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "LookupTablePageSize", lookuptablepagesize, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "MinusEqualPage", minusequalpage, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "ShiftSelectCandidate", shiftselectcandidate, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_pinyin, "SpecialPhrases", specialphrases, EET_T_UCHAR); + + return edd; +} + +static void +_config_pinyin_set_defaults(struct _config_section *base) +{ + struct _config_pinyin *pinyin = (struct _config_pinyin *) base; + + pinyin->autocommit = EINA_FALSE; + pinyin->commaperiodpage = EINA_TRUE; + pinyin->correctpinyin = EINA_TRUE; + pinyin->correctpinyin_gn_ng = EINA_TRUE; + pinyin->correctpinyin_iou_iu = EINA_TRUE; + pinyin->correctpinyin_mg_ng = EINA_TRUE; + pinyin->correctpinyin_on_ong = EINA_TRUE; + pinyin->correctpinyin_uei_ui = EINA_TRUE; + pinyin->correctpinyin_uen_un = EINA_TRUE; + pinyin->correctpinyin_ue_ve = EINA_TRUE; + pinyin->correctpinyin_v_u = EINA_TRUE; + pinyin->ctrlswitch = EINA_FALSE; + pinyin->dictionaries = eina_stringshare_add("2"); + pinyin->doublepinyin = EINA_FALSE; + pinyin->doublepinyinschema = 0; + pinyin->dynamicadjust = EINA_TRUE; + pinyin->fuzzypinyin = EINA_FALSE; + pinyin->fuzzypinyin_an_ang = EINA_TRUE; + pinyin->fuzzypinyin_ang_an = EINA_TRUE; + pinyin->fuzzypinyin_c_ch = EINA_TRUE; + pinyin->fuzzypinyin_ch_c = EINA_FALSE; + pinyin->fuzzypinyin_en_eng = EINA_TRUE; + pinyin->fuzzypinyin_eng_en = EINA_TRUE; + pinyin->fuzzypinyin_f_h = EINA_TRUE; + pinyin->fuzzypinyin_g_k = EINA_FALSE; + pinyin->fuzzypinyin_h_f = EINA_FALSE; + pinyin->fuzzypinyin_ing_in = EINA_TRUE; + pinyin->fuzzypinyin_in_ing = EINA_TRUE; + pinyin->fuzzypinyin_k_g = EINA_TRUE; + pinyin->fuzzypinyin_l_n = EINA_TRUE; + pinyin->fuzzypinyin_l_r = EINA_FALSE; + pinyin->fuzzypinyin_n_l = EINA_FALSE; + pinyin->fuzzypinyin_r_l = EINA_FALSE; + pinyin->fuzzypinyin_sh_s = EINA_FALSE; + pinyin->fuzzypinyin_s_sh = EINA_TRUE; + pinyin->fuzzypinyin_zh_z = EINA_FALSE; + pinyin->fuzzypinyin_z_zh = EINA_TRUE; + pinyin->incompletepinyin = EINA_TRUE; + pinyin->initchinese = EINA_TRUE; + pinyin->initfull = EINA_FALSE; + pinyin->initfullpunct = EINA_TRUE; + pinyin->initsimplifiedchinese = EINA_TRUE; + pinyin->lookuptableorientation = 0; + pinyin->lookuptablepagesize = 5; + pinyin->minusequalpage = EINA_TRUE; + pinyin->shiftselectcandidate = EINA_FALSE; + pinyin->specialphrases = EINA_TRUE; +} + +#define _config_pinyin_update NULL; + +static void +_config_pinyin_section_init(struct _config_section *base) +{ + _config_section_add_key_bool(base, pinyin, autocommit); + _config_section_add_key_bool(base, pinyin, commaperiodpage); + _config_section_add_key_bool(base, pinyin, correctpinyin); + _config_section_add_key_bool(base, pinyin, correctpinyin_gn_ng); + _config_section_add_key_bool(base, pinyin, correctpinyin_iou_iu); + _config_section_add_key_bool(base, pinyin, correctpinyin_mg_ng); + _config_section_add_key_bool(base, pinyin, correctpinyin_on_ong); + _config_section_add_key_bool(base, pinyin, correctpinyin_uei_ui); + _config_section_add_key_bool(base, pinyin, correctpinyin_uen_un); + _config_section_add_key_bool(base, pinyin, correctpinyin_ue_ve); + _config_section_add_key_bool(base, pinyin, correctpinyin_v_u); + _config_section_add_key_bool(base, pinyin, ctrlswitch); + _config_section_add_key_string(base, pinyin, dictionaries); + _config_section_add_key_bool(base, pinyin, doublepinyin); + _config_section_add_key_int(base, pinyin, doublepinyinschema); + _config_section_add_key_bool(base, pinyin, dynamicadjust); + _config_section_add_key_bool(base, pinyin, fuzzypinyin); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_an_ang); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_ang_an); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_c_ch); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_ch_c); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_en_eng); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_eng_en); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_f_h); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_g_k); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_h_f); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_ing_in); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_in_ing); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_k_g); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_l_n); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_l_r); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_n_l); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_r_l); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_sh_s); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_s_sh); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_zh_z); + _config_section_add_key_bool(base, pinyin, fuzzypinyin_z_zh); + _config_section_add_key_bool(base, pinyin, incompletepinyin); + _config_section_add_key_bool(base, pinyin, initchinese); + _config_section_add_key_bool(base, pinyin, initfull); + _config_section_add_key_bool(base, pinyin, initfullpunct); + _config_section_add_key_bool(base, pinyin, initsimplifiedchinese); + _config_section_add_key_int(base, pinyin, lookuptableorientation); + _config_section_add_key_int(base, pinyin, lookuptablepagesize); + _config_section_add_key_bool(base, pinyin, minusequalpage); + _config_section_add_key_bool(base, pinyin, shiftselectcandidate); + _config_section_add_key_bool(base, pinyin, specialphrases); +} + +static struct _config_section * +_config_pinyin_new(struct _config_section *parent) +{ + struct _config_pinyin *conf = calloc(1, sizeof(*conf)); + struct _config_section *base = (struct _config_section *) conf; + + _config_section_init(base, pinyin, parent); + return base; +} + +/* + * NO SCHEMA AVAILABLE. BASED ON THE SOURCE CODE + */ +struct _config_bopomofo +{ + struct _config_section base; + + int auxiliaryselectkey_f; + int auxiliaryselectkey_kp; + int bopomofokeyboardmapping; + Eina_Bool ctrlswitch; + const char *dictionaries; + Eina_Bool dynamicadjust; + Eina_Bool enterkey; + Eina_Bool fuzzypinyin; + Eina_Bool fuzzypinyin_an_ang; + Eina_Bool fuzzypinyin_ang_an; + Eina_Bool fuzzypinyin_c_ch; + Eina_Bool fuzzypinyin_ch_c; + Eina_Bool fuzzypinyin_en_eng; + Eina_Bool fuzzypinyin_eng_en; + Eina_Bool fuzzypinyin_f_h; + Eina_Bool fuzzypinyin_g_k; + Eina_Bool fuzzypinyin_h_f; + Eina_Bool fuzzypinyin_ing_in; + Eina_Bool fuzzypinyin_in_ing; + Eina_Bool fuzzypinyin_k_g; + Eina_Bool fuzzypinyin_l_n; + Eina_Bool fuzzypinyin_l_r; + Eina_Bool fuzzypinyin_n_l; + Eina_Bool fuzzypinyin_r_l; + Eina_Bool fuzzypinyin_sh_s; + Eina_Bool fuzzypinyin_s_sh; + Eina_Bool fuzzypinyin_zh_z; + Eina_Bool fuzzypinyin_z_zh; + int guidekey; + Eina_Bool incompletepinyin; + Eina_Bool initchinese; + Eina_Bool initfull; + Eina_Bool initfullpunct; + Eina_Bool initsimplifiedchinese; + int lookuptableorientation; + int lookuptablepagesize; + int selectkeys; + Eina_Bool specialphrases; +}; + +static Eet_Data_Descriptor * +_config_bopomofo_edd_new(void) +{ + Eet_Data_Descriptor *edd; + Eet_Data_Descriptor_Class eddc; + + EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, struct _config_bopomofo); + edd = eet_data_descriptor_stream_new(&eddc); + + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "AuxiliarySelectKey_F", auxiliaryselectkey_f, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "AuxiliarySelectKey_KP", auxiliaryselectkey_kp, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "BopomofoKeyboardMapping", bopomofokeyboardmapping, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "CtrlSwitch", ctrlswitch, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "Dictionaries", dictionaries, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "DynamicAdjust", dynamicadjust, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "EnterKey", enterkey, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin", fuzzypinyin, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_AN_ANG", fuzzypinyin_an_ang, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_ANG_AN", fuzzypinyin_ang_an, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_C_CH", fuzzypinyin_c_ch, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_CH_C", fuzzypinyin_ch_c, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_EN_ENG", fuzzypinyin_en_eng, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_ENG_EN", fuzzypinyin_eng_en, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_F_H", fuzzypinyin_f_h, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_G_K", fuzzypinyin_g_k, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_H_F", fuzzypinyin_h_f, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_ING_IN", fuzzypinyin_ing_in, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_IN_ING", fuzzypinyin_in_ing, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_K_G", fuzzypinyin_k_g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_L_N", fuzzypinyin_l_n, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_L_R", fuzzypinyin_l_r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_N_L", fuzzypinyin_n_l, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_R_L", fuzzypinyin_r_l, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_SH_S", fuzzypinyin_sh_s, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_S_SH", fuzzypinyin_s_sh, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_ZH_Z", fuzzypinyin_zh_z, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "FuzzyPinyin_Z_ZH", fuzzypinyin_z_zh, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "GuideKey", guidekey, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "IncompletePinyin", incompletepinyin, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "InitChinese", initchinese, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "InitFull", initfull, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "InitFullPunct", initfullpunct, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "InitSimplifiedChinese", initsimplifiedchinese, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "LookupTableOrientation", lookuptableorientation, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "LookupTablePageSize", lookuptablepagesize, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "SelectKeys", selectkeys, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct _config_bopomofo, "SpecialPhrases", specialphrases, EET_T_UCHAR); + + return edd; +} + +static void +_config_bopomofo_set_defaults(struct _config_section *base) +{ + struct _config_bopomofo *bopomofo = (struct _config_bopomofo *) base; + + bopomofo->auxiliaryselectkey_f = 1; + bopomofo->auxiliaryselectkey_kp = 1; + bopomofo->bopomofokeyboardmapping = 0; + bopomofo->ctrlswitch = EINA_FALSE; + bopomofo->dictionaries = eina_stringshare_add("2"); + bopomofo->dynamicadjust = EINA_TRUE; + bopomofo->enterkey = EINA_TRUE; + bopomofo->fuzzypinyin = EINA_TRUE; + bopomofo->fuzzypinyin_an_ang = EINA_TRUE; + bopomofo->fuzzypinyin_ang_an = EINA_FALSE; + bopomofo->fuzzypinyin_c_ch = EINA_TRUE; + bopomofo->fuzzypinyin_ch_c = EINA_FALSE; + bopomofo->fuzzypinyin_en_eng = EINA_TRUE; + bopomofo->fuzzypinyin_eng_en = EINA_TRUE; + bopomofo->fuzzypinyin_f_h = EINA_TRUE; + bopomofo->fuzzypinyin_g_k = EINA_FALSE; + bopomofo->fuzzypinyin_h_f = EINA_FALSE; + bopomofo->fuzzypinyin_ing_in = EINA_TRUE; + bopomofo->fuzzypinyin_in_ing = EINA_TRUE; + bopomofo->fuzzypinyin_k_g = EINA_TRUE; + bopomofo->fuzzypinyin_l_n = EINA_TRUE; + bopomofo->fuzzypinyin_l_r = EINA_FALSE; + bopomofo->fuzzypinyin_n_l = EINA_FALSE; + bopomofo->fuzzypinyin_r_l = EINA_FALSE; + bopomofo->fuzzypinyin_sh_s = EINA_FALSE; + bopomofo->fuzzypinyin_s_sh = EINA_TRUE; + bopomofo->fuzzypinyin_zh_z = EINA_FALSE; + bopomofo->fuzzypinyin_z_zh = EINA_TRUE; + bopomofo->guidekey = 1; + bopomofo->incompletepinyin = EINA_FALSE; + bopomofo->initchinese = EINA_TRUE; + bopomofo->initfull = EINA_FALSE; + bopomofo->initfullpunct = EINA_TRUE; + bopomofo->initsimplifiedchinese = EINA_TRUE; + bopomofo->lookuptableorientation = 0; + bopomofo->lookuptablepagesize = 5; + bopomofo->selectkeys = 0; + bopomofo->specialphrases = EINA_TRUE; +} + +#define _config_bopomofo_update NULL; + +static void +_config_bopomofo_section_init(struct _config_section *base) +{ + _config_section_add_key_int(base, bopomofo, auxiliaryselectkey_f); + _config_section_add_key_int(base, bopomofo, auxiliaryselectkey_kp); + _config_section_add_key_int(base, bopomofo, bopomofokeyboardmapping); + _config_section_add_key_bool(base, bopomofo, ctrlswitch); + _config_section_add_key_string(base, bopomofo, dictionaries); + _config_section_add_key_bool(base, bopomofo, dynamicadjust); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_an_ang); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_ang_an); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_c_ch); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_ch_c); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_en_eng); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_eng_en); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_f_h); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_g_k); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_h_f); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_ing_in); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_in_ing); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_k_g); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_l_n); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_l_r); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_n_l); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_r_l); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_sh_s); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_s_sh); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_zh_z); + _config_section_add_key_bool(base, bopomofo, fuzzypinyin_z_zh); + _config_section_add_key_int(base, bopomofo, guidekey); + _config_section_add_key_bool(base, bopomofo, incompletepinyin); + _config_section_add_key_bool(base, bopomofo, initchinese); + _config_section_add_key_bool(base, bopomofo, initfull); + _config_section_add_key_bool(base, bopomofo, initfullpunct); + _config_section_add_key_bool(base, bopomofo, initsimplifiedchinese); + _config_section_add_key_int(base, bopomofo, lookuptableorientation); + _config_section_add_key_int(base, bopomofo, lookuptablepagesize); + _config_section_add_key_int(base, bopomofo, selectkeys); + _config_section_add_key_bool(base, bopomofo, specialphrases); +} + +static struct _config_section * +_config_bopomofo_new(struct _config_section *parent) +{ + struct _config_bopomofo *conf = calloc(1, sizeof(*conf)); + struct _config_section *base = (struct _config_section *) conf; + + _config_section_init(base, bopomofo, parent); + return base; +} + +/* + * NO SCHEMA AVAILABLE. BASED ON THE SOURCE CODE + */ struct _config_engine { struct _config_section base; struct _config_section *hangul; + struct _config_section *pinyin; + struct _config_section *bopomofo; }; static Eet_Data_Descriptor * -_config_engine_edd_new(Eet_Data_Descriptor *hangul_edd) +_config_engine_edd_new(Eet_Data_Descriptor *hangul_edd, Eet_Data_Descriptor *pinyin_edd, Eet_Data_Descriptor *bopomofo_edd) { Eet_Data_Descriptor *edd; Eet_Data_Descriptor_Class eddc; @@ -766,12 +1201,38 @@ _config_engine_edd_new(Eet_Data_Descriptor *hangul_edd) edd = eet_data_descriptor_stream_new(&eddc); EET_DATA_DESCRIPTOR_ADD_SUB(edd, struct _config_engine, "Hangul", hangul, hangul_edd); + EET_DATA_DESCRIPTOR_ADD_SUB(edd, struct _config_engine, "Pinyin", pinyin, pinyin_edd); + EET_DATA_DESCRIPTOR_ADD_SUB(edd, struct _config_engine, "Bopomofo", bopomofo, bopomofo_edd); return edd; } #define _config_engine_set_defaults NULL; -#define _config_engine_update NULL; + +static Eina_Bool +_config_engine_update(struct _config_section *base) +{ + struct _config_engine *conf = (struct _config_engine *) base; + + if (conf->pinyin && conf->bopomofo) + return EINA_FALSE; + + INF("Updating 'engine' section"); + + if (!conf->pinyin) + { + conf->pinyin = _config_pinyin_new(base); + _config_section_set_defaults(conf->pinyin); + } + + if (!conf->bopomofo) + { + conf->bopomofo = _config_bopomofo_new(base); + _config_section_set_defaults(conf->bopomofo); + } + + return EINA_TRUE; +} static void _config_engine_section_init(struct _config_section *base) @@ -779,6 +1240,8 @@ _config_engine_section_init(struct _config_section *base) struct _config_engine *conf = (struct _config_engine *) base; _config_section_init(conf->hangul, hangul, base); + _config_section_init(conf->pinyin, pinyin, base); + _config_section_init(conf->bopomofo, bopomofo, base); } static struct _config_section * @@ -789,6 +1252,9 @@ _config_engine_new(struct _config_section *parent) _config_section_init(base, engine, parent); conf->hangul = _config_hangul_new(base); + conf->pinyin = _config_pinyin_new(base); + conf->bopomofo = _config_bopomofo_new(base); + return base; } @@ -1204,7 +1670,9 @@ _config_eet_init(const char *path, Eldbus_Service_Interface *iface) _general_edd = _config_general_edd_new(_hotkey_edd); _panel_edd = _config_panel_edd_new(); _hangul_edd = _config_hangul_edd_new(); - _engine_edd = _config_engine_edd_new(_hangul_edd); + _pinyin_edd = _config_pinyin_edd_new(); + _bopomofo_edd = _config_bopomofo_edd_new(); + _engine_edd = _config_engine_edd_new(_hangul_edd, _pinyin_edd, _bopomofo_edd); _ibus_edd = _config_ibus_edd_new(_general_edd, _panel_edd, _engine_edd); _weekeyboard_edd = _config_weekeyboard_edd_new(); @@ -1263,6 +1731,8 @@ wkb_ibus_config_eet_free(struct wkb_ibus_config_eet *config_eet) eet_data_descriptor_free(_general_edd); eet_data_descriptor_free(_panel_edd); eet_data_descriptor_free(_hangul_edd); + eet_data_descriptor_free(_pinyin_edd); + eet_data_descriptor_free(_bopomofo_edd); eet_data_descriptor_free(_engine_edd); eet_data_descriptor_free(_ibus_edd); eet_data_descriptor_free(_weekeyboard_edd); @@ -1271,6 +1741,8 @@ wkb_ibus_config_eet_free(struct wkb_ibus_config_eet *config_eet) _general_edd = NULL; _panel_edd = NULL; _hangul_edd = NULL; + _pinyin_edd = NULL; + _bopomofo_edd = NULL; _engine_edd = NULL; _ibus_edd = NULL; _weekeyboard_edd = NULL; |