本文整理汇总了C++中HIME_module_main_functions::mf_hime_edit_display_ap_only方法的典型用法代码示例。如果您正苦于以下问题:C++ HIME_module_main_functions::mf_hime_edit_display_ap_only方法的具体用法?C++ HIME_module_main_functions::mf_hime_edit_display_ap_only怎么用?C++ HIME_module_main_functions::mf_hime_edit_display_ap_only使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HIME_module_main_functions
的用法示例。
在下文中一共展示了HIME_module_main_functions::mf_hime_edit_display_ap_only方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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_hime_edit_display_ap_only()?
*gmf.mf_win_y:*gmf.mf_win_y+*gmf.mf_win_yl;
gmf.mf_disp_selections(x, y);
}
示例2: disp_input
static void disp_input()
{
int i;
if (gmf.mf_hime_edit_display_ap_only())
return;
clear_seg_label();
int idx;
for(idx=i=0; i < jpN; i++) {
if (i==cursor) {
disp_keys(idx);
idx+=keysN;
cursor_markup(idx++, idx_hira_kata(jp[i], FALSE));
}
else
gtk_label_set_text(GTK_LABEL(seg[idx++].label), idx_hira_kata(jp[i], FALSE));
}
if (cursor==jpN) {
disp_keys(idx);
idx+=keysN;
cursor_markup(idx, " ");
}
minimize_win_anthy();
}
示例3:
// FIXME: the pos of g_pSeg[].label is not correct
static gboolean
hime_label_cand_show (char *pszWord, int nIdx)
{
int nX, nY;
int nFontWidth, nFontHeight;
g_himeModMainFuncs.mf_set_sele_text (chewing_cand_TotalChoice (g_pChewingCtx),
nIdx,
pszWord,
-1);
// find the position of the cand win
g_himeModMainFuncs.mf_get_widget_xy (g_pWinChewing,
g_pSeg[g_nCurrentCursorPos].label,
&nX, &nY);
gtk_pango_font_pixel_size_get (&nFontWidth, &nFontHeight);
nX += g_nCurrentCursorPos * nFontWidth;
nY = g_himeModMainFuncs.mf_hime_edit_display_ap_only () ?
*g_himeModMainFuncs.mf_win_y :
*g_himeModMainFuncs.mf_win_y + *g_himeModMainFuncs.mf_win_yl;
g_himeModMainFuncs.mf_disp_selections (nX, nY);
return TRUE;
}
示例4: module_show_win
void module_show_win()
{
if (gmf.mf_hime_edit_display_ap_only())
return;
if (!*gmf.mf_hime_pop_up_win || !is_empty() || *gmf.mf_force_show ) {
if (!module_win_visible())
gtk_widget_show(win_anthy);
gmf.mf_show_win_sym();
}
}
示例5: module_get_preedit
int module_get_preedit(char *str, HIME_PREEDIT_ATTR attr[], int *pcursor, int *comp_flag)
{
int i;
// dbg("anthy_get_preedit %d\n", cursor);
str[0]=0;
*pcursor=0;
attr[0].flag=HIME_PREEDIT_ATTR_FLAG_UNDERLINE;
attr[0].ofs0=0;
int attrN=0;
int ch_N=0;
if (state==STATE_CONVERT) {
if (segN)
attrN=1;
for(i=0; i < segN; i++) {
char *s = (char *)gtk_label_get_text(GTK_LABEL(seg[i].label));
int N = gmf.mf_utf8_str_N(s);
ch_N+=N;
if (i < cursor)
*pcursor+=N;
if (gmf.mf_hime_edit_display_ap_only() && i==cursor) {
attr[1].ofs0=*pcursor;
attr[1].ofs1=*pcursor+N;
attr[1].flag=HIME_PREEDIT_ATTR_FLAG_REVERSE;
attrN++;
}
strcat(str, s);
}
attr[0].ofs1 = ch_N;
} else {
if (jpN)
attrN=1;
keys[keysN]=0;
for(i=0;i < jpN; i++) {
char *s=idx_hira_kata(jp[i], FALSE);
int N = gmf.mf_utf8_str_N(s);
// dbg("%d]%s N:%d\n", i, s, N);
if (gmf.mf_hime_edit_display_ap_only() && i==cursor) {
strcat(str, keys);
ch_N+=keysN;
*pcursor = ch_N;
attr[1].ofs0=ch_N;
attr[1].ofs1=ch_N+N;
attr[1].flag=HIME_PREEDIT_ATTR_FLAG_REVERSE;
attrN++;
}
strcat(str, s);
ch_N+=N;
}
if (cursor==jpN) {
*pcursor = ch_N;
strcat(str, keys);
ch_N+=keysN;
}
attr[0].ofs1 = ch_N;
// dbg("cursor %d ch_N:%d '%s'\n", *pcursor, ch_N, str);
}
*comp_flag = keysN>0;
if (win_anthy && GTK_WIDGET_VISIBLE(win_anthy))
*comp_flag|=2;
if (segN || jpN)
*comp_flag|=4;
return attrN;
}