本文整理汇总了C++中UI_FUNC_IS_VALID函数的典型用法代码示例。如果您正苦于以下问题:C++ UI_FUNC_IS_VALID函数的具体用法?C++ UI_FUNC_IS_VALID怎么用?C++ UI_FUNC_IS_VALID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UI_FUNC_IS_VALID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FcitxUISetStatusVisable
FCITX_EXPORT_API
void FcitxUISetStatusVisable(FcitxInstance* instance, const char* name, boolean visible)
{
FcitxUIStatus *status = FcitxUIGetStatusByName(instance, name);
if (!status) {
FcitxUIComplexStatus *compstatus = FcitxUIGetComplexStatusByName(instance, name);
if (!compstatus)
return;
if (compstatus->visible != visible) {
compstatus->visible = visible;
if (UI_FUNC_IS_VALID(UpdateComplexStatus))
instance->ui->ui->UpdateComplexStatus(instance->ui->addonInstance, compstatus);
}
return;
}
if (status->visible != visible) {
status->visible = visible;
if (UI_FUNC_IS_VALID(UpdateStatus))
instance->ui->ui->UpdateStatus(instance->ui->addonInstance, status);
}
}
示例2: FcitxUIUpdateStatus
FCITX_EXPORT_API
void FcitxUIUpdateStatus(FcitxInstance* instance, const char* name)
{
FcitxLog(DEBUG, "Update Status for %s", name);
FcitxUIStatus *status = FcitxUIGetStatusByName(instance, name);
if (status != NULL) {
if (status->toggleStatus)
status->toggleStatus(status->arg);
if (UI_FUNC_IS_VALID(UpdateStatus))
instance->ui->ui->UpdateStatus(instance->ui->addonInstance , status);
}
else {
FcitxUIComplexStatus *compstatus = FcitxUIGetComplexStatusByName(instance, name);
if (!compstatus)
return;
if (compstatus->toggleStatus)
compstatus->toggleStatus(compstatus->arg);
if (UI_FUNC_IS_VALID(UpdateComplexStatus))
instance->ui->ui->UpdateComplexStatus(instance->ui->addonInstance , compstatus);
}
}
示例3: FcitxUIRegisterComplexStatus
FCITX_EXPORT_API
void FcitxUIRegisterComplexStatus(
struct _FcitxInstance* instance,
void* arg,
const char* name,
const char* shortDesc,
const char* longDesc,
void (*toggleStatus)(void *arg),
const char*(*getIconName)(void *arg)
)
{
FcitxUIComplexStatus compstatus;
memset(&compstatus, 0 , sizeof(FcitxUIComplexStatus));
compstatus.name = strdup(name);
compstatus.shortDescription = strdup(shortDesc);
compstatus.longDescription = strdup(longDesc);
compstatus.getIconName = getIconName;
compstatus.toggleStatus = toggleStatus;
compstatus.arg = arg;
compstatus.visible = true;
UT_array* uicompstats = &instance->uicompstats;
utarray_push_back(uicompstats, &compstatus);
if (UI_FUNC_IS_VALID(RegisterComplexStatus))
instance->ui->ui->RegisterComplexStatus(instance->ui->addonInstance, (FcitxUIComplexStatus*) utarray_back(uicompstats));
if (UI_FUNC_IS_VALID_FALLBACK(RegisterComplexStatus))
instance->uifallback->ui->RegisterComplexStatus(instance->uifallback->addonInstance, (FcitxUIComplexStatus*) utarray_back(uicompstats));
}
示例4: FcitxUIOnInputUnFocus
FCITX_EXPORT_API
void FcitxUIOnInputUnFocus(struct _FcitxInstance* instance)
{
if (UI_FUNC_IS_VALID(OnInputUnFocus))
instance->ui->ui->OnInputUnFocus(instance->ui->addonInstance);
FcitxInstanceProcessInputUnFocusHook(instance);
}
示例5: FcitxUISupportMainWindow
FCITX_EXPORT_API
boolean FcitxUISupportMainWindow(FcitxInstance* instance)
{
if (UI_FUNC_IS_VALID(MainWindowSizeHint))
return true;
else
return false;
}
示例6: FcitxUIRefreshStatus
FCITX_EXPORT_API
void FcitxUIRefreshStatus(FcitxInstance* instance, const char* name)
{
FcitxUIStatus *status = FcitxUIGetStatusByName(instance, name);
if (status != NULL) {
if (UI_FUNC_IS_VALID(UpdateStatus))
instance->ui->ui->UpdateStatus(instance->ui->addonInstance , status);
}
else {
FcitxUIComplexStatus *compstatus = FcitxUIGetComplexStatusByName(instance, name);
if (!compstatus)
return;
if (UI_FUNC_IS_VALID(UpdateComplexStatus))
instance->ui->ui->UpdateComplexStatus(instance->ui->addonInstance , compstatus);
}
}
示例7: FcitxUIOnTriggerOff
FCITX_EXPORT_API
void FcitxUIOnTriggerOff(FcitxInstance* instance)
{
if (UI_FUNC_IS_VALID(OnTriggerOff))
instance->ui->ui->OnTriggerOff(instance->ui->addonInstance);
FcitxInstanceProcessTriggerOffHook(instance);
instance->totaltime += difftime(time(NULL), instance->timeStart);
}
示例8: FcitxUIOnTriggerOn
FCITX_EXPORT_API
void FcitxUIOnTriggerOn(FcitxInstance* instance)
{
if (UI_FUNC_IS_VALID(OnTriggerOn))
instance->ui->ui->OnTriggerOn(instance->ui->addonInstance);
FcitxInstanceProcessTriggerOnHook(instance);
instance->timeStart = time(NULL);
FcitxInstanceShowInputSpeed(instance);
}
示例9: FcitxUISetStatusString
FCITX_EXPORT_API
void FcitxUISetStatusString(FcitxInstance* instance, const char* name, const char* shortDesc, const char* longDesc)
{
char** pShort = NULL, **pLong = NULL;
FcitxUIStatus *status = FcitxUIGetStatusByName(instance, name);
FcitxUIComplexStatus *compstatus = NULL;
if (!status) {
compstatus = FcitxUIGetComplexStatusByName(instance, name);
if (!compstatus)
return;
pShort = &compstatus->shortDescription;
pLong = &compstatus->longDescription;
}
else {
pShort = &status->shortDescription;
pLong = &status->longDescription;
}
if (*pShort)
free(*pShort);
if (*pLong)
free(*pLong);
*pShort = strdup(shortDesc);
*pLong = strdup(longDesc);
if (status){
if (UI_FUNC_IS_VALID(UpdateStatus))
instance->ui->ui->UpdateStatus(instance->ui->addonInstance, status);
}
else if (compstatus) {
if (UI_FUNC_IS_VALID(UpdateComplexStatus))
instance->ui->ui->UpdateComplexStatus(instance->ui->addonInstance, compstatus);
}
}
示例10: FcitxUIOnInputFocus
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);
}
示例11: FcitxUIRegisterMenu
FCITX_EXPORT_API
void FcitxUIRegisterMenu(FcitxInstance* instance, FcitxUIMenu* menu)
{
UT_array* uimenus = &instance->uimenus;
if (!menu)
return ;
menu->mark = -1;
menu->visible = true;
utarray_push_back(uimenus, &menu);
if (UI_FUNC_IS_VALID(RegisterMenu))
instance->ui->ui->RegisterMenu(instance->ui->addonInstance, menu);
if (UI_FUNC_IS_VALID_FALLBACK(RegisterMenu))
instance->uifallback->ui->RegisterMenu(instance->uifallback->addonInstance, menu);
}
示例12: FcitxUIUpdateInputWindowReal
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);
}
示例13: FcitxUIOnInputFocus
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);
}
示例14: FcitxUIUnRegisterMenu
FCITX_EXPORT_API
void FcitxUIUnRegisterMenu(FcitxInstance* instance, FcitxUIMenu* menu)
{
UT_array* uimenus = &instance->uimenus;
if (!menu)
return;
utarray_foreach(menup, uimenus, FcitxUIMenu*) {
if (*menup == menu) {
utarray_remove_quick(uimenus, utarray_eltidx(uimenus, menup));
if (UI_FUNC_IS_VALID(UnRegisterMenu))
instance->ui->ui->UnRegisterMenu(instance->ui->addonInstance, menu);
if (UI_FUNC_IS_VALID_FALLBACK(UnRegisterMenu))
instance->uifallback->ui->UnRegisterMenu(instance->uifallback->addonInstance, menu);
break;
}
}
}
示例15: FcitxUIOnInputFocus
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);
}