示例#1
0
文件: AutoEng.c 项目: areslp/fcitx
static void
AutoEngGetSpellHint(FcitxAutoEngState *autoEngState)
{
    FcitxCandidateWordList *candList;
    if (autoEngState->config.disableSpell)
        return;
    candList = InvokeVaArgs(autoEngState->owner, FCITX_SPELL, GET_CANDWORDS,
                            NULL, autoEngState->buf, NULL,
                            (void*)(long)autoEngState->config.maxHintLength,
                            "en", "cus", AutoEngGetCandWordCb, autoEngState);
    if (candList) {
        FcitxInputState *input = FcitxInstanceGetInputState(autoEngState->owner);
        FcitxCandidateWordList *iList = FcitxInputStateGetCandidateList(input);
        FcitxCandidateWordSetChooseAndModifier(
            iList, DIGIT_STR_CHOOSE,
            cmodtable[autoEngState->config.chooseModifier]);
        FcitxCandidateWordMerge(iList, candList, -1);
        FcitxCandidateWordFreeList(candList);
    }
}
示例#2
0
文件: AutoEng.c 项目: gt945/fcitx
static void
AutoEngGetSpellHint(FcitxAutoEngState *autoEngState)
{
    FcitxCandidateWordList *candList;
    if (autoEngState->config.disableSpell)
        return;
    candList = FcitxSpellGetCandWords(autoEngState->owner, NULL,
                                      autoEngState->buf, NULL,
                                      autoEngState->config.maxHintLength,
                                      "en", "cus", AutoEngGetCandWordCb,
                                      autoEngState);
    if (candList) {
        FcitxInputState *input = FcitxInstanceGetInputState(autoEngState->owner);
        FcitxCandidateWordList *iList = FcitxInputStateGetCandidateList(input);
        FcitxCandidateWordSetOverrideDefaultHighlight(iList, false);
        FcitxCandidateWordSetChooseAndModifier(
            iList, DIGIT_STR_CHOOSE,
            cmodtable[autoEngState->config.chooseModifier]);
        FcitxCandidateWordMerge(iList, candList, -1);
        FcitxCandidateWordFreeList(candList);
    }
}