本文整理汇总了C++中HIME_module_main_functions类的典型用法代码示例。如果您正苦于以下问题:C++ HIME_module_main_functions类的具体用法?C++ HIME_module_main_functions怎么用?C++ HIME_module_main_functions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HIME_module_main_functions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: module_change_font_size
void module_change_font_size()
{
dbg("change_anthy_font_size\n");
GdkColor fg;
gdk_color_parse(*gmf.mf_hime_win_color_fg, &fg);
#if GTK_CHECK_VERSION(2,91,6)
GdkRGBA rgbfg;
gdk_rgba_parse(&rgbfg, gdk_color_to_string(&fg));
#endif
gmf.mf_change_win_bg(win_anthy);
gmf.mf_change_win_bg(event_box_anthy);
int i;
for(i=0; i < MAX_SEG_N; i++) {
GtkWidget *label = seg[i].label;
gmf.mf_set_label_font_size(label, *gmf.mf_hime_font_size);
if (*gmf.mf_hime_win_color_use) {
#if !GTK_CHECK_VERSION(2,91,6)
gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &fg);
#else
gtk_widget_override_color(label, GTK_STATE_FLAG_NORMAL, &rgbfg);
#endif
}
}
}
示例4:
gboolean
module_feedkey (int nKeyVal, int nKeyState)
{
if (!g_pChewingCtx)
return FALSE;
if (!g_himeModMainFuncs.mf_tsin_pho_mode ())
return FALSE;
hime_label_clear (MAX_SEG_NUM);
chewing_set_ShapeMode (g_pChewingCtx, g_himeModMainFuncs.mf_current_shape_mode());
if (nKeyState & (Mod1Mask|Mod4Mask|Mod5Mask|ControlMask))
return FALSE;
if (!hime_key_filter (&nKeyVal))
return FALSE;
if (!hime_buffer_commit ())
return FALSE;
if (!hime_buffer_label_show ())
return FALSE;
if (!hime_zuin_label_show ())
return FALSE;
module_show_win ();
return TRUE;
}
示例5: 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();
}
示例6: 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();
}
}
示例7: strcat
// FIXME: refine and chk
int
module_get_preedit (char *pszStr, HIME_PREEDIT_ATTR himePreeditAttr[],
int *pnCursor, int *pCompFlag)
{
char *pszTmpStr = NULL;
char *pszZuinStr = NULL;
int nIdx;
int nLength;
int nTotalLen = 0;
int nAttr = 0;
int nZuinLen = 0;
pszStr[0] = 0;
*pnCursor = 0;
himePreeditAttr[0].flag = HIME_PREEDIT_ATTR_FLAG_UNDERLINE;
himePreeditAttr[0].ofs0 = 0;
if (chewing_buffer_Len (g_pChewingCtx))
nAttr = 1;
for (nIdx = 0; nIdx < chewing_buffer_Len (g_pChewingCtx); nIdx++)
{
pszTmpStr = (char *)gtk_label_get_text (GTK_LABEL (g_pSeg[nIdx].label));
nLength = g_himeModMainFuncs.mf_utf8_str_N (pszTmpStr);
nTotalLen += nLength;
if (nIdx < chewing_cursor_Current (g_pChewingCtx))
*pnCursor += nLength;
#if 0
if (nIdx == chewing_cursor_Current (g_pChewingCtx))
{
himePreeditAttr[1].ofs0 = *pnCursor;
himePreeditAttr[1].ofs1 = *pnCursor + nLength;
himePreeditAttr[1].flag = HIME_PREEDIT_ATTR_FLAG_REVERSE;
nAttr++;
}
#endif
strcat (pszStr, pszTmpStr);
}
if (g_himeModMainFuncs.mf_hime_display_on_the_spot_key()) {
pszZuinStr = chewing_zuin_String (g_pChewingCtx, &nZuinLen);
strcat (pszStr, pszZuinStr);
free (pszZuinStr);
nTotalLen += nZuinLen;
}
himePreeditAttr[0].ofs1 = nTotalLen;
pCompFlag = 0;
return nAttr;
}
示例8: mouse_button_callback
static void mouse_button_callback( GtkWidget *widget,GdkEventButton *event, gpointer data)
{
// dbg("mouse_button_callback %d\n", event->button);
switch (event->button) {
case 1:
gmf.mf_toggle_win_sym();
break;
case 2:
gmf.mf_inmd_switch_popup_handler(widget, (GdkEvent *)event);
break;
case 3:
gmf.mf_exec_hime_setup();
break;
}
}
示例9: 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;
}
示例10: free
int
module_flush_input (void)
{
char *pszTmp;
if (chewing_buffer_Check (g_pChewingCtx))
{
pszTmp = chewing_buffer_String (g_pChewingCtx);
g_himeModMainFuncs.mf_send_text (pszTmp);
free (pszTmp);
}
chewing_Reset (g_pChewingCtx);
// FIXME: dirty workaround to reset the libchewing internal data
// it may impact the bEscCleanAllBuf setting
chewing_handle_Esc (g_pChewingCtx);
hime_label_clear (MAX_SEG_NUM);
if (*g_himeModMainFuncs.mf_hime_pop_up_win && is_empty())
module_hide_win();
return 0;
}
示例11:
gboolean
module_feedkey (int nKeyVal, int nKeyState)
{
if (!g_pChewingCtx)
return FALSE;
if (!g_himeModMainFuncs.mf_tsin_pho_mode ())
return FALSE;
hime_label_clear (MAX_SEG_NUM);
if (!hime_key_filter (&nKeyVal))
return FALSE;
if (!hime_zuin_label_show ())
return FALSE;
if (!hime_buffer_label_show ())
return FALSE;
if (!hime_buffer_commit ())
return FALSE;
module_show_win ();
return TRUE;
}
示例12: 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();
}
示例13: module_win_geom
void module_win_geom()
{
if (!win_anthy)
return;
gtk_window_get_position(GTK_WINDOW(win_anthy), gmf.mf_win_x, gmf.mf_win_y);
gmf.mf_get_win_size(win_anthy, gmf.mf_win_xl, gmf.mf_win_yl);
}
示例14: 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);
}
示例15: 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;
}
}