本文整理汇总了C++中HIME_module_main_functions::mf_hide_selections_win方法的典型用法代码示例。如果您正苦于以下问题:C++ HIME_module_main_functions::mf_hide_selections_win方法的具体用法?C++ HIME_module_main_functions::mf_hide_selections_win怎么用?C++ HIME_module_main_functions::mf_hide_selections_win使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HIME_module_main_functions
的用法示例。
在下文中一共展示了HIME_module_main_functions::mf_hide_selections_win方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
module_hide_win (void)
{
gtk_widget_hide (g_pWinChewing);
g_himeModMainFuncs.mf_hide_selections_win ();
g_himeModMainFuncs.mf_hide_win_sym ();
}
示例2: module_feedkey_release
int module_feedkey_release(KeySym xkey, int kbstate)
{
switch (xkey) {
case XK_Shift_L:
case XK_Shift_R:
if (
( (*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_Shift) ||
(*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_ShiftL
&& xkey == XK_Shift_L) ||
(*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_ShiftR
&& xkey == XK_Shift_R))
&& gmf.mf_current_time() - key_press_time < 300000) {
#if WIN32
if (!*gmf.test_mode)
#endif
{
module_flush_input();
key_press_time = 0;
gmf.mf_hide_selections_win();
gmf.mf_tsin_set_eng_ch(!gmf.mf_tsin_pho_mode());
}
return 1;
} else
return 0;
default:
return 0;
}
}
示例3: select_idx
static gboolean select_idx(int c)
{
int idx = pageidx + c;
if (idx < seg[cursor].selN) {
char buf[256];
anthy_get_segment(ac, cursor, idx, buf, sizeof(buf));
struct anthy_segment_stat ss;
anthy_get_segment_stat(ac, cursor, &ss);
int len = ss.seg_len;
gtk_label_set_text(GTK_LABEL(seg[cursor].label), buf);
seg[cursor].selidx = idx;
int sidx = get_sel_seg_with_ofs(seg[cursor].ofs);
if (sidx==sel_segN) {
sel_segN++;
}
if (sel_seg[sidx].sel_str)
free(sel_seg[sidx].sel_str);
dbg("select_idx idx:%d sidx:%d %s\n", idx, sidx, buf);
sel_seg[sidx].sel_str = strdup(buf);
sel_seg[sidx].ofs = seg[cursor].ofs;
sel_seg[sidx].len = len;
state = STATE_CONVERT;
gmf.mf_hide_selections_win();
return (segN==1);
}
return FALSE;
}
示例4: module_hide_win
void module_hide_win()
{
if (state == STATE_SELECT) {
state = STATE_CONVERT;
gmf.mf_hide_selections_win();
}
gtk_widget_hide(win_anthy);
gmf.mf_hide_win_sym();
}
示例5: module_flush_input
int module_flush_input()
{
gmf.mf_hide_selections_win();
int val;
if (state==STATE_CONVERT) {
val = TRUE;
send_seg();
} else {
val = send_jp();
}
// dbg("cursor %d\n", cursor);
clear_all();
return val;
}
示例6: select_idx
static gboolean select_idx(int c)
{
int idx = pageidx + c;
if (idx < seg[cursor].selN) {
char buf[256];
anthy_get_segment(ac, cursor, idx, buf, sizeof(buf));
gtk_label_set_text(GTK_LABEL(seg[cursor].label), buf);
seg[cursor].selidx = idx;
state = STATE_CONVERT;
gmf.mf_hide_selections_win();
return (segN==1);
}
return FALSE;
}
示例7: module_feedkey_release
int module_feedkey_release(KeySym xkey, int kbstate)
{
switch (xkey) {
case XK_Shift_L:
case XK_Shift_R:
if (
( (*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_Shift) ||
(*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_ShiftL
&& xkey == XK_Shift_L) ||
(*gmf.mf_tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_ShiftR
&& xkey == XK_Shift_R))
&& key_press_alt) {
module_flush_input();
key_press_alt = FALSE;
gmf.mf_hide_selections_win();
gmf.mf_tsin_set_eng_ch(!gmf.mf_tsin_pho_mode());
return 1;
} else
return 0;
default:
return 0;
}
}
示例8: 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();
//.........这里部分代码省略.........
示例9: 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;
}
hime_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_himeModMainFuncs.mf_pho_chars[nPhoIdx], szWord) != NULL)
hime_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_himeModMainFuncs.mf_hide_selections_win ();
pszTmp = chewing_buffer_String (g_pChewingCtx);
// init cand_no
chewing_cand_Enumerate (g_pChewingCtx);
g_himeModMainFuncs.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;
hime_label_cand_show (pszChewingCand, nIdx++);
free (pszChewingCand);
}
}
for (nIdx = 0; nIdx < chewing_buffer_Len (g_pChewingCtx); nIdx++)
{
memcpy (szWord, pszTmp + (nIdx * 3), 3);
hime_label_show (szWord, nIdx);
}
free (pszTmp);
}
if (chewing_commit_Check (g_pChewingCtx))
{
pszTmp = chewing_commit_String (g_pChewingCtx);
g_himeModMainFuncs.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;
}
示例10: if
static gboolean
hime_buffer_label_show (void)
{
char *pszTmp = NULL;
char *pszWord = NULL;
char *pszChewingCand = NULL;
char *pHead = NULL;
int nIdx = 0;
int nPos = 0;
int nWordSize = 0;
pszWord = (char *) realloc (pszWord, 8);
if (!pszWord)
return FALSE;
memset (pszWord, 0x00, 8);
// check if the composing is valid or not
if (chewing_buffer_Check (g_pChewingCtx))
{
g_himeModMainFuncs.mf_hide_selections_win ();
pszTmp = chewing_buffer_String (g_pChewingCtx);
// init cand_no
chewing_cand_Enumerate (g_pChewingCtx);
g_himeModMainFuncs.mf_clear_sele ();
if (chewing_cand_TotalChoice (g_pChewingCtx))
{
while (chewing_cand_hasNext (g_pChewingCtx))
{
pszChewingCand = chewing_cand_String (g_pChewingCtx);
if (nIdx > chewing_get_candPerPage (g_pChewingCtx) - 1)
break;
hime_label_cand_show (pszChewingCand, nIdx++);
free (pszChewingCand);
}
}
for (nPos = 0, pHead = pszTmp, nIdx = 0; nPos < strlen (pszTmp); nPos += nWordSize, pHead += nWordSize)
{
if (!((*pHead) & 0x80)) // 1 byte utf-8 data
nWordSize = 1;
else if (((*pHead) & 0xf0) == 0xc0) // 2 bytes utf-8 data
nWordSize = 2;
else if (((*pHead) & 0xf0) == 0xe0) // 3 bytes utf-8 data
nWordSize = 3;
else if (((*pHead) & 0xf0) == 0xf0) // 4 bytes utf-8 data
nWordSize = 4;
memset (pszWord, 0x00, 8);
memcpy (pszWord, pHead, nWordSize);
hime_label_show (pszWord, nIdx++);
}
// if chewing_buffer_Check is not zero,
// it means that the chewing_buffer_String must have val,
// so we could free the ptr here
free (pszTmp);
}
free (pszWord);
return TRUE;
}