本文整理汇总了C++中HIME_module_main_functions::mf_set_tsin_pho_mode方法的典型用法代码示例。如果您正苦于以下问题:C++ HIME_module_main_functions::mf_set_tsin_pho_mode方法的具体用法?C++ HIME_module_main_functions::mf_set_tsin_pho_mode怎么用?C++ HIME_module_main_functions::mf_set_tsin_pho_mode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HIME_module_main_functions
的用法示例。
在下文中一共展示了HIME_module_main_functions::mf_set_tsin_pho_mode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: module_init_win
int module_init_win(HIME_module_main_functions *funcs)
{
gmf = *funcs;
// dbg("module_init_win\n");
gmf.mf_set_tsin_pho_mode();
gmf.mf_set_win1_cb((cb_selec_by_idx_t)select_idx, prev_page, next_page);
if (win_anthy)
return TRUE;
if (anthy_init() == -1) {
GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Cannot init anthy. Please install anthy.");
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
return FALSE;
}
ac = anthy_create_context();
if (!ac) {
printf("anthy_create_context err\n");
return FALSE;
}
anthy_context_set_encoding(ac, ANTHY_UTF8_ENCODING);
win_anthy = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_has_resize_grip(GTK_WINDOW(win_anthy), FALSE);
gtk_window_set_default_size(GTK_WINDOW (win_anthy), 40, 50);
gtk_widget_realize (win_anthy);
gmf.mf_set_no_focus(win_anthy);
event_box_anthy = gtk_event_box_new();
gtk_event_box_set_visible_window (GTK_EVENT_BOX(event_box_anthy), FALSE);
gtk_container_add(GTK_CONTAINER(win_anthy), event_box_anthy);
GtkWidget *hbox_top = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER(event_box_anthy), hbox_top);
g_signal_connect(G_OBJECT(event_box_anthy),"button-press-event",
G_CALLBACK(mouse_button_callback), NULL);
if (!seg) {
int n=sizeof(SEG)*MAX_SEG_N;
seg=malloc(n);
bzero(seg, n);
}
int i;
for(i=0; i < MAX_SEG_N; i++) {
seg[i].label = gtk_label_new(NULL);
gtk_widget_show(seg[i].label);
gtk_box_pack_start (GTK_BOX (hbox_top), seg[i].label, FALSE, FALSE, 0);
}
gtk_widget_show_all(win_anthy);
gmf.mf_init_tsin_selection_win();
module_change_font_size();
if (!gmf.mf_phkbm->selkeyN)
gmf.mf_load_tab_pho_file();
module_hide_win();
return TRUE;
}
示例2: sizeof
int
module_init_win (HIME_module_main_functions *pFuncs)
{
GtkWidget *pErrDialog = NULL;
int nIdx;
int nSegSize = 0;
if (!pFuncs)
return FALSE;
g_himeModMainFuncs = *pFuncs;
g_himeModMainFuncs.mf_set_tsin_pho_mode ();
g_himeModMainFuncs.mf_set_win1_cb ((cb_selec_by_idx_t)select_idx,
prev_page,
next_page);
if (g_pWinChewing)
return TRUE;
if (!chewing_initialize ())
{
pErrDialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"chewing init failed");
gtk_dialog_run (GTK_DIALOG (pErrDialog));
gtk_widget_destroy (pErrDialog);
return FALSE;
}
g_pWinChewing = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_has_resize_grip (GTK_WINDOW (g_pWinChewing), FALSE);
gtk_window_set_default_size (GTK_WINDOW (g_pWinChewing), 32, 12);
gtk_widget_realize (g_pWinChewing);
g_himeModMainFuncs.mf_set_no_focus (g_pWinChewing);
g_pEvBoxChewing = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX(g_pEvBoxChewing), FALSE);
if (!g_pEvBoxChewing)
return FALSE;
gtk_container_add (GTK_CONTAINER (g_pWinChewing), g_pEvBoxChewing);
g_pHBoxChewing = gtk_hbox_new (FALSE, 0);
if (!g_pHBoxChewing)
return FALSE;
gtk_container_add (GTK_CONTAINER (g_pEvBoxChewing), g_pHBoxChewing);
// TODO: not sure if we need the mouse CB or not...
// if we add the CB here, then it seems that we have to use gdk
// it seems not so important...? do it later
//g_signal_connect (G_OBJECT (g_pEvBoxChewing), "button-press-event",
// G_CALLBACK (mouse_button_callback), NULL);
if (!g_pSeg)
{
nSegSize = sizeof (SEG) * MAX_SEG_NUM;
g_pSeg = malloc (nSegSize);
memset (g_pSeg, 0, nSegSize);
}
for (nIdx = 0; nIdx < MAX_SEG_NUM; nIdx++)
{
g_pSeg[nIdx].label = gtk_label_new (NULL);
gtk_widget_show (g_pSeg[nIdx].label);
gtk_box_pack_start (GTK_BOX (g_pHBoxChewing),
g_pSeg[nIdx].label,
FALSE,
FALSE,
0);
}
if (!g_himeModMainFuncs.mf_phkbm->selkeyN)
g_himeModMainFuncs.mf_load_tab_pho_file();
gtk_widget_show_all (g_pWinChewing);
g_himeModMainFuncs.mf_init_tsin_selection_win ();
module_change_font_size ();
module_hide_win ();
return TRUE;
}