void message_cb(char *message) { void sim_output(); // FIXME void trad_output(); // FIXME // dbg("message '%s'\n", message); /* TODO: rewrite the mess with case() ? */ if (!strcmp(message, CHANGE_FONT_SIZE)) { change_font_size(); } else if (!strcmp(message, GB_OUTPUT_TOGGLE)) { cb_trad_sim_toggle(); #if TRAY_ENABLED update_item_active_all(); #endif } else if (!strcmp(message, SIM_OUTPUT_TOGGLE)) { sim_output(); #if TRAY_ENABLED disp_tray_icon(); update_item_active_all(); #endif } else if (!strcmp(message, TRAD_OUTPUT_TOGGLE)) { trad_output(); #if TRAY_ENABLED disp_tray_icon(); update_item_active_all(); #endif } else if (!strcmp(message, KBM_TOGGLE)) { kbm_toggle(); } else if (strstr(message, "#hime_message")) { execute_message(message); } else #if TRAY_ENABLED if (!strcmp(message, UPDATE_TRAY)) { disp_tray_icon(); } else #endif if (!strcmp(message, RELOAD_TSIN_DB)) { reload_tsin_db(); } else if (!strcmp(message, HIME_EXIT_MESSAGE)) { do_exit(); } else reload_data(); }
gboolean tray_button_press_event_cb (GtkStatusIcon *status_icon, GdkEventButton * event, gpointer userdata) { switch (event->button) { case 1: if (event->state & GDK_SHIFT_MASK) inmd_switch_popup_handler(NULL, (GdkEvent *)event); else toggle_im_enabled(); break; case 2: #if 0 inmd_switch_popup_handler(NULL, (GdkEvent *)event); #else kbm_toggle(); dbg("win_kbm_on %d\n", win_kbm_on); update_item_active_all(); #endif break; case 3: if (!tray_menu) tray_menu = create_tray_menu(mitems); gtk_menu_popup(GTK_MENU(tray_menu), NULL, NULL, gtk_status_icon_position_menu, tray_icon, event->button, event->time); break; } return TRUE; }
static void cb_activate_state(GtkStatusIcon *status_icon, gpointer user_data) { // dbg("cb_activate\n"); if (gcin_tray_hf_win_kbm) { kbm_toggle(); update_item_active_all(); } else toggle_half_full_char_sub(); }
static void reload_data() { dbg("reload_data\n"); load_setttings(); if (current_method_type()==method_type_TSIN) set_wselkey(pho_selkey); // load_tsin_db(); change_win0_style(); change_win1_font(); change_win_gtab_style(); // change_win_pho_style(); load_tab_pho_file(); change_tsin_color(); update_win_kbm_inited(); destroy_inmd_menu(); load_gtab_list(TRUE); update_item_active_all(); #if 0 gcb_main(); #endif }