本文整理汇总了C++中GCIN_module_main_functions::mf_clear_sele方法的典型用法代码示例。如果您正苦于以下问题:C++ GCIN_module_main_functions::mf_clear_sele方法的具体用法?C++ GCIN_module_main_functions::mf_clear_sele怎么用?C++ GCIN_module_main_functions::mf_clear_sele使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GCIN_module_main_functions
的用法示例。
在下文中一共展示了GCIN_module_main_functions::mf_clear_sele方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: disp_select
static void disp_select()
{
// puts("disp_select");
gmf.mf_clear_sele();
int endn = pageidx + gmf.mf_phkbm->selkeyN;
if (endn > seg[cursor].selN)
endn = seg[cursor].selN;
int i;
for(i=pageidx; i<endn; i++) {
char buf[256];
anthy_get_segment(ac, cursor, i, buf, sizeof(buf));
// printf("%d %s\n", i, buf);
gmf.mf_set_sele_text(seg[cursor].selN, i - pageidx, buf, -1);
}
if (pageidx)
gmf.mf_disp_arrow_up();
if (i < seg[cursor].selN)
gmf.mf_disp_arrow_down();
int x,y;
gmf.mf_get_widget_xy(win_anthy, seg[cursor].label, &x, &y);
// printf("%x cusor %d %d\n", win_anthy, cursor, x);
y = gmf.mf_gcin_edit_display_ap_only()?
*gmf.mf_win_y:*gmf.mf_win_y+*gmf.mf_win_yl;
gmf.mf_disp_selections(x, y);
}
示例2: memset
//.........这里部分代码省略.........
case XK_Left:
case XK_KP_Left:
chewing_handle_Left (g_pChewingCtx);
break;
case XK_Right:
case XK_KP_Right:
chewing_handle_Right (g_pChewingCtx);
break;
#if 0
case XK_Shift_L:
chewing_handle_ShiftLeft (g_pChewingCtx);
break;
case XK_Shift_R:
chewing_handle_ShiftRight (g_pChewingCtx);
break;
#endif
case XK_Tab:
chewing_handle_Tab (g_pChewingCtx);
break;
default:
if (nKeyVal > 32 && nKeyVal < 127)
chewing_handle_Default (g_pChewingCtx, nKeyVal);
break;
}
gcin_label_clear (MAX_SEG_NUM);
g_nCurrentCursorPos = chewing_cursor_Current (g_pChewingCtx);
if (g_nCurrentCursorPos < 0 || g_nCurrentCursorPos > MAX_SEG_NUM)
return FALSE;
// zuin symbols
pszTmp = chewing_zuin_String (g_pChewingCtx, &nZuinLen);
if (pszTmp)
{
for (nBufIdx = 0; nBufIdx < nZuinLen; nBufIdx++)
{
memcpy (szWord, pszTmp + nBufIdx * 3, 3);
for (nPhoIdx = 0; nPhoIdx < 3; nPhoIdx++)
if (strstr (g_gcinModMainFuncs.mf_pho_chars[nPhoIdx], szWord) != NULL)
gcin_label_show (szWord, nPhoIdx + chewing_buffer_Len (g_pChewingCtx) + 1);
}
free (pszTmp);
}
// check if the composing is valid or not
if (chewing_buffer_Check (g_pChewingCtx))
{
g_gcinModMainFuncs.mf_hide_selections_win ();
pszTmp = chewing_buffer_String (g_pChewingCtx);
// init cand_no
chewing_cand_Enumerate (g_pChewingCtx);
g_gcinModMainFuncs.mf_clear_sele ();
if (chewing_cand_TotalChoice (g_pChewingCtx))
{
nIdx = 0;
while (chewing_cand_hasNext (g_pChewingCtx))
{
pszChewingCand = chewing_cand_String (g_pChewingCtx);
if (nIdx > chewing_get_candPerPage (g_pChewingCtx) - 1)
break;
gcin_label_cand_show (pszChewingCand, nIdx++);
free (pszChewingCand);
}
}
for (nIdx = 0; nIdx < chewing_buffer_Len (g_pChewingCtx); nIdx++)
{
memcpy (szWord, pszTmp + (nIdx * 3), 3);
gcin_label_show (szWord, nIdx);
}
free (pszTmp);
}
if (chewing_commit_Check (g_pChewingCtx))
{
pszTmp = chewing_commit_String (g_pChewingCtx);
g_gcinModMainFuncs.mf_send_text (pszTmp);
// FIXME: workaround for repeated commit
// it impacts the bEscCleanAllBuf setting!
chewing_handle_Esc (g_pChewingCtx);
free (pszTmp);
}
module_show_win ();
return TRUE;
}
示例3: module_feedkey
gboolean module_feedkey(int kv, int kvstate)
{
int lkv = tolower(kv);
int shift_m=(kvstate&ShiftMask) > 0;
// printf("%x %c %d\n", kv, kv, shift_m);
if (kvstate & ControlMask)
return FALSE;
if (kvstate & (Mod1Mask|Mod4Mask|Mod5Mask))
return FALSE;
if (kv==XK_Shift_L||kv==XK_Shift_R) {
key_press_time = gmf.mf_current_time();
}
if (!gmf.mf_tsin_pho_mode())
return 0;
gboolean b_is_empty = is_empty();
switch (kv) {
case XK_F7:
if (is_empty())
return FALSE;
state = STATE_ROMANJI;
if (state_hira_kata != STATE_kata)
state_hira_kata = STATE_kata;
else
state_hira_kata = STATE_hira;
disp_input();
return TRUE;
case XK_F8:
if (is_empty())
return FALSE;
state = STATE_ROMANJI;
if (state_hira_kata != STATE_half_kata)
state_hira_kata = STATE_half_kata;
else
state_hira_kata = STATE_hira;
disp_input();
return TRUE;
case XK_F11:
system("kasumi &");
return TRUE;
case XK_F12:
system("kasumi -a &");
return TRUE;
case XK_Up:
if (b_is_empty)
return FALSE;
if (state==STATE_SELECT) {
int N = page_N();
gmf.mf_tss->pho_menu_idx--;
if (gmf.mf_tss->pho_menu_idx < 0)
gmf.mf_tss->pho_menu_idx = N - 1;
disp_select();
}
return TRUE;
case XK_Down:
if (b_is_empty)
return FALSE;
if (state==STATE_CONVERT) {
state = STATE_SELECT;
gmf.mf_tss->sel_pho = TRUE;
// puts("STATE_SELECT");
disp_select();
} else
if (state==STATE_SELECT) {
int N = page_N();
gmf.mf_tss->pho_menu_idx=(gmf.mf_tss->pho_menu_idx+1)% N;
disp_select();
}
return TRUE;
case XK_Return:
if (b_is_empty)
return FALSE;
if (state==STATE_SELECT) {
if (select_idx(gmf.mf_tss->pho_menu_idx))
goto send;
return TRUE;
}
send:
return module_flush_input();
case XK_Escape:
if (state==STATE_SELECT) {
state = STATE_CONVERT;
gmf.mf_tss->sel_pho = FALSE;
gmf.mf_clear_sele();
}
else
if (state==STATE_CONVERT)
goto rom;
return FALSE;
case XK_BackSpace:
if (b_is_empty) {
state_hira_kata = STATE_hira;
return FALSE;
}
gmf.mf_hide_selections_win();
//.........这里部分代码省略.........