void ToggleFullWidthState(void* arg) { FcitxFullWidthChar* fwchar = (FcitxFullWidthChar*)arg; FcitxProfile* profile = FcitxInstanceGetProfile(fwchar->owner); profile->bUseFullWidthChar = !profile->bUseFullWidthChar; FcitxProfileSave(profile); FcitxInstanceResetInput(fwchar->owner); }
FCITX_EXPORT_API void FcitxUIOnInputFocus(FcitxInstance* instance) { if (UI_FUNC_IS_VALID(OnInputFocus)) instance->ui->ui->OnInputFocus(instance->ui->addonInstance); FcitxInstanceProcessInputFocusHook(instance); FcitxInstanceResetInput(instance); boolean changed = FcitxInstanceUpdateCurrentIM(instance, false); if (instance->config->bShowInputWindowWhenFocusIn && changed) FcitxInstanceShowInputSpeed(instance); else FcitxUICloseInputWindow(instance); }
FCITX_EXPORT_API void FcitxUIOnInputFocus(FcitxInstance* instance) { if (UI_FUNC_IS_VALID(OnInputFocus)) instance->ui->ui->OnInputFocus(instance->ui->addonInstance); FcitxInstanceProcessInputFocusHook(instance); FcitxInstanceResetInput(instance); if (instance->config->firstAsInactive) { if (FcitxInstanceGetCurrentState(instance) == IS_ACTIVE) FcitxInstanceSwitchIM(instance, instance->lastIMIndex); else if (FcitxInstanceGetCurrentState(instance) == IS_ENG) { if (instance->iIMIndex != 0) instance->lastIMIndex = instance->iIMIndex; FcitxInstanceSwitchIMInternal(instance, 0, false); } } FcitxUICloseInputWindow(instance); }
FCITX_EXPORT_API void FcitxUIOnInputFocus(FcitxInstance* instance) { if (UI_FUNC_IS_VALID(OnInputFocus)) instance->ui->ui->OnInputFocus(instance->ui->addonInstance); FcitxInstanceProcessInputFocusHook(instance); FcitxInstanceResetInput(instance); boolean changed; if (instance->lastIC == instance->CurrentIC && instance->delayedIM) { FcitxInstanceSwitchIMByName(instance, instance->delayedIM); changed = true; } else { changed = FcitxInstanceUpdateCurrentIM(instance, false, false); } if (instance->config->bShowInputWindowWhenFocusIn && changed) FcitxInstanceShowInputSpeed(instance); else FcitxUICloseInputWindow(instance); }