예제 #1
0
파일: ui.c 프로젝트: pkg-ime/fcitx
FCITX_EXPORT_API
void FcitxUIUpdateInputWindow(FcitxInstance *instance)
{
    instance->uiflag |= UI_UPDATE;

    if (FcitxMessagesIsMessageChanged(instance->input->msgClientPreedit))
        FcitxInstanceUpdatePreedit(instance, FcitxInstanceGetCurrentIC(instance));
}
예제 #2
0
파일: ui.c 프로젝트: hiroshiyui/fcitx
void FcitxUIUpdateInputWindowReal(FcitxInstance *instance)
{
    FcitxInputState* input = instance->input;
    FcitxInputContext* ic = FcitxInstanceGetCurrentIC(instance);
    FcitxCapacityFlags flags = CAPACITY_NONE;
    if (ic != NULL)
        flags = ic->contextCaps;

    if (flags & CAPACITY_CLIENT_SIDE_UI) {
        FcitxInstanceUpdateClientSideUI(instance, ic);
        return;
    }

    FcitxInstanceUpdatePreedit(instance, ic);

    boolean toshow = false;

    if (FcitxMessagesGetMessageCount(input->msgAuxUp) != 0
        || FcitxMessagesGetMessageCount(input->msgAuxDown) != 0)
        toshow = true;

    if (FcitxCandidateWordGetListSize(input->candList) > 1)
        toshow = true;

    if (FcitxCandidateWordGetListSize(input->candList) == 1
            && (!instance->config->bHideInputWindowWhenOnlyPreeditString
                || !instance->config->bHideInputWindowWhenOnlyOneCandidate))
        toshow = true;

    if (FcitxMessagesGetMessageCount(input->msgPreedit) != 0
            && !((flags & CAPACITY_PREEDIT) && instance->config->bHideInputWindowWhenOnlyPreeditString && instance->profile->bUsePreedit))
        toshow = true;

    if (!toshow) {
        if (UI_FUNC_IS_VALID(CloseInputWindow))
            instance->ui->ui->CloseInputWindow(instance->ui->addonInstance);
    } else
        FcitxUIShowInputWindow(instance);

    FcitxMessagesSetMessageChanged(input->msgAuxUp, false);
    FcitxMessagesSetMessageChanged(input->msgAuxDown, false);
    FcitxMessagesSetMessageChanged(input->msgPreedit, false);
    FcitxMessagesSetMessageChanged(input->msgClientPreedit, false);
}