TmpPhoto: gcin-disable-all-bug-free.diff

File gcin-disable-all-bug-free.diff, 17.4 kB (added by anonymous, 1 year ago)
  • gcin-1.3.5.pre4/Makefile

    old new  
    55.SUFFIXES:      .c .o .E .pico 
    66 
    77gcin_tsin_o = tsin.o tsin-util.o win0.o win1.o tsin-parse.o 
    8 gcin_pho_o = win-pho.o pho.o pho-util.o pho-sym.o table-update.o pho-dbg.o 
    9 gcin_gtab_o = gtab.o win-gtab.o gtab-util.o gtab-list.o 
     8gcin_pho_o = win-pho.o pho.o pho-util.o pho-sym.o table-update.o pho-dbg.o pho-play.o 
     9gcin_gtab_o = gtab.o win-gtab.o gtab-util.o 
    1010 
    1111GCIN_SO= gcin1.so 
    1212 
    1313OBJS=gcin.o eve.o util.o gcin-conf.o gcin-settings.o locale.o gcin-icon.o \ 
    14      gcin-switch.o gcin-exec-script.o $(GCIN_SO) pho-play.o \ 
    15      $(gcin_tsin_o) $(gcin_pho_o) $(gcin_gtab_o) 
     14     gcin-switch.o gcin-exec-script.o $(GCIN_SO) gtab-list.o gcin-common.o 
    1615 
    1716OBJS_TSLEARN=tslearn.o util.o gcin-conf.o pho-util.o tsin-util.o gcin-send.o pho-sym.o \ 
    1817             table-update.o locale.o gcin-settings.o 
     
    6463CFLAGS += -DGCIN_i18n_message=1 
    6564endif 
    6665 
     66ifeq ($(USE_TSIN),Y) 
     67CFLAGS += -DUSE_TSIN=1 
     68OBJS += $(gcin_tsin_o) 
     69endif 
     70 
     71ifeq ($(USE_PHO),Y) 
     72CFLAGS += -DUSE_PHO=1 
     73OBJS += $(gcin_pho_o) 
     74endif 
     75 
     76ifeq ($(USE_GTAB),Y) 
     77CFLAGS += -DUSE_GTAB=1 
     78OBJS += $(gcin_gtab_o) 
     79endif 
     80 
     81ifeq ($(USE_INT),Y) 
     82CFLAGS += -DUSE_INTCODE=1 
     83endif 
     84 
    6785im-srv = im-srv/im-srv.a 
    6886 
    6987.c.E: 
     
    144162pin-juyin:      $(OBJS_pin_juyin) 
    145163        $(CC) -o $@ $(OBJS_pin_juyin) $(LDFLAGS) 
    146164 
    147 gcin1_so= intcode.pico win-int.pico win-message.pico phrase.pico win-sym.pico win-inmd-switch.pico pinyin.pico win-pho-near.pico 
     165gcin1_so= win-message.pico phrase.pico win-sym.pico win-inmd-switch.pico 
     166 
     167ifeq ($(USE_PHO),Y) 
     168gcin1_so += pinyin.pico win-pho-near.pico 
     169endif  
     170 
     171ifeq ($(USE_INT),Y) 
     172gcin1_so += intcode.pico win-int.pico 
     173endif 
     174 
    148175gcin1.so: $(gcin1_so) 
    149176        $(CC) $(SO_FLAGS) -o $@ $(gcin1_so) $(LDFLAGS) 
    150177 
  • gcin-1.3.5.pre4/eve.c

    old new  
    256256  } 
    257257 
    258258  switch (cs->in_method) { 
     259#if USE_PHO 
    259260    case 3: 
    260261      hide_win_pho(); 
    261262      break; 
     263#endif 
     264#if USE_TSIN 
    262265    case 6: 
    263266//      flush_tsin_buffer(); 
    264267      hide_win0(); 
    265268      break; 
     269#endif 
     270#if USE_INTCODE 
    266271    case 10: 
    267272      hide_win_int(); 
    268273      break; 
     274#endif 
     275#if USE_GTAB 
    269276    default: 
    270277      hide_win_gtab(); 
     278#endif 
    271279  } 
    272280 
    273281  reset_current_in_win_xy(); 
     
    291299  } 
    292300 
    293301  switch (cs->in_method) { 
     302#if USE_PHO 
    294303    case 3: 
    295304      show_win_pho(); 
    296305      break; 
     306#endif 
     307#if USE_TSIN 
    297308    case 6: 
    298309      show_win0(); 
    299310      break; 
     311#endif 
     312#if USE_INTCODE 
    300313    case 10: 
    301314      show_win_int(); 
    302315      break; 
     316#endif 
     317#if USE_GTAB 
    303318    default: 
    304319      show_win_gtab(); 
     320#endif 
    305321  } 
    306322#if 0 
    307323  show_win_stautus(); 
     
    338354  current_in_win_x = x ; current_in_win_y = y; 
    339355 
    340356  switch (cs->in_method) { 
     357#if USE_PHO 
    341358    case 3: 
    342359      move_win_pho(x, y); 
    343360      break; 
     361#endif 
     362#if USE_TSIN 
    344363    case 6: 
    345364      move_win0(x, y); 
    346365      break; 
     366#endif 
     367#if USE_INTCODE 
    347368    case 10: 
    348369      move_win_int(x, y); 
    349370      break; 
     371#endif 
    350372    default: 
    351373      if (!cs->in_method) 
    352374        return; 
     375#if USE_GTAB 
    353376      move_win_gtab(x, y); 
     377#endif 
    354378  } 
    355379} 
    356380 
     
    463487#endif 
    464488 
    465489  switch (current_CS->in_method) { 
     490#if USE_PHO 
    466491    case 3: 
    467492      win_pho_disp_half_full(); 
    468493      break; 
     494#endif 
     495#if USE_TSIN 
    469496    case 6: 
    470497      win_tsin_disp_half_full(); 
    471498      break; 
     499#endif 
    472500    default: 
     501#if USE_GTAB 
    473502      win_gtab_disp_half_full(); 
     503#endif 
    474504      break; 
    475505  } 
    476506} 
     
    551581{ 
    552582//  dbg("update_active_in_win_geom\n"); 
    553583  switch (current_CS->in_method) { 
     584#if USE_PHO 
    554585    case 3: 
    555586      get_win_pho_geom(); 
    556587      break; 
     588#endif 
     589#if USE_TSIN 
    557590    case 6: 
    558591      get_win0_geom(); 
    559592      break; 
     593#endif 
     594#if USE_INTCODE 
    560595    case 10: 
    561596      break; 
     597#endif 
    562598    default: 
     599#if USE_GTAB 
    563600      get_win_gtab_geom(); 
     601#endif 
    564602      break; 
    565603  } 
    566604} 
     
    638676 
    639677 
    640678  switch (in_no) { 
     679#if USE_PHO 
    641680    case 3: 
    642681      current_CS->in_method = in_no; 
    643682      init_tab_pho(); 
    644683      break; 
     684#endif 
     685#if USE_TSIN 
    645686    case 6: 
    646687      current_CS->in_method = in_no; 
    647688      init_tab_pp(True); 
    648689      break; 
     690#endif 
     691#if USE_INTCODE 
    649692    case 10: 
    650693      current_CS->in_method = in_no; 
    651694      init_inter_code(True); 
    652695      break; 
     696#endif 
    653697    default: 
     698#if USE_GTAB 
    654699      init_gtab(in_no, True); 
    655700      if (!inmd[in_no].DefChars) 
    656701        return FALSE; 
    657702      current_CS->in_method = in_no; 
    658703      show_win_gtab(); 
     704#endif 
    659705      break; 
    660706  } 
    661707 
     
    832878  } 
    833879 
    834880  switch(current_CS->in_method) { 
     881#if USE_PHO 
    835882    case 3: 
    836883      return feedkey_pho(keysym, kev_state); 
     884#endif 
     885#if USE_TSIN 
    837886    case 6: 
    838887      return feedkey_pp(keysym, kev_state); 
     888#endif 
     889#if USE_INTCODE 
    839890    case 10: 
    840891      return feedkey_intcode(keysym); 
     892#endif 
     893#if USE_GTAB 
    841894    default: 
    842895      return feedkey_gtab(keysym, kev_state); 
     896#endif 
    843897  } 
    844898 
    845899 
     
    856910  if (current_CS->im_state == GCIN_STATE_DISABLED) 
    857911    return FALSE; 
    858912 
     913#if USE_TSIN 
    859914  switch(current_CS->in_method) { 
    860915    case 6: 
    861916      return feedkey_pp_release(keysym, kev_state); 
    862917  } 
     918#endif 
    863919 
    864920  return FALSE; 
    865921} 
  • gcin-1.3.5.pre4/gcin.c

    old new  
    4040{ 
    4141 
    4242  switch (default_input_method) { 
     43#if USE_PHO 
    4344    case 3: 
    4445      create_win_pho(); 
    4546      xim_arr[0].xim_xwin = xwin_pho; 
    4647      break; 
     48#endif 
     49#if USE_TSIN 
    4750    case 6: 
    4851      create_win0(); 
    4952      xim_arr[0].xim_xwin = xwin0; 
    5053      break; 
     54#endif 
    5155    default: 
     56#if USE_GTAB 
    5257      create_win_gtab(); 
    5358      xim_arr[0].xim_xwin = xwin_gtab; 
     59#endif 
    5460      break; 
    5561  } 
    5662} 
  • gcin-1.3.5.pre4/tsin.c

    old new  
    11801180gboolean inph_typ_pho(char newkey); 
    11811181 
    11821182 
    1183 gint64 current_time() 
    1184 
    1185   struct timeval tval; 
    1186  
    1187   gettimeofday(&tval, NULL); 
    1188   return (gint64)tval.tv_sec * 1000000 + tval.tv_usec; 
    1189 
     1183gint64 current_time(); 
    11901184 
    11911185static void call_tsin_parse() 
    11921186{ 
     
    11961190  prbuf(); 
    11971191} 
    11981192 
    1199 void case_inverse(int *xkey, int shift_m) 
    1200 
    1201   if (shift_m) { 
    1202     if (islower(*xkey)) 
    1203       *xkey-=0x20; 
    1204   } else 
    1205   if (isupper(*xkey)) 
    1206     *xkey+=0x20; 
    1207 
     1193void case_inverse(int *xkey, int shift_m); 
    12081194 
    12091195void pho_play(phokey_t key); 
    12101196 
  • gcin-1.3.5.pre4/win-pho.c

    old new  
    2323 
    2424void move_win_pho(int x, int y); 
    2525 
    26 void get_win_size(GtkWidget *win, int *width, int *height) 
    27 
    28   GtkRequisition sz; 
    29   gtk_widget_size_request(GTK_WIDGET(win), &sz); 
    30   *width = sz.width; 
    31   *height = sz.height; 
    32 
    33  
    34 gboolean win_size_exceed(GtkWidget *win) 
    35 
    36   int width, height; 
    37  
    38   get_win_size(win, &width, &height); 
     26void get_win_size(GtkWidget *win, int *width, int *height); 
    3927 
    40   return (width + current_in_win_x > dpy_xl || height + current_in_win_y > dpy_yl); 
    41 
     28gboolean win_size_exceed(GtkWidget *win); 
    4229 
    4330 
    4431void disp_pho_sel(char *s) 
  • gcin-1.3.5.pre4/win0.c

    old new  
    5656  recreate_win0(); 
    5757} 
    5858 
    59 void set_label_font_size(GtkWidget *label, int size) 
    60 
    61   if (!label) 
    62     return; 
    63  
    64   PangoContext *pango_context = gtk_widget_get_pango_context (label); 
    65   PangoFontDescription* font=pango_context_get_font_description 
    66        (pango_context); 
    67   pango_font_description_set_family(font, gcin_font_name); 
    68   pango_font_description_set_size(font, PANGO_SCALE * size); 
    69   gtk_widget_modify_font(label, font); 
    70 
     59void set_label_font_size(GtkWidget *label, int size); 
    7160 
    7261/* there is a bug in gtk, if the widget is created and hasn't been processed by 
    7362   gtk_main(), the coodinate of the widget is sometimes invalid. 
     
    129118 
    130119 
    131120 
    132 gboolean b_use_full_space = TRUE
     121extern gboolean b_use_full_space
    133122 
    134 // the width of ascii space in firefly song 
    135 void set_label_space(GtkWidget *label) 
    136 
    137   gtk_label_set_text(GTK_LABEL(label), " "); 
    138   return; 
    139 
     123void set_label_space(GtkWidget *label); 
    140124 
    141125 
    142126void disp_char(int index, char *ch) 
     
    409393  } 
    410394} 
    411395 
    412 void exec_gcin_setup() 
    413 
    414 #if DEBUG 
    415   dbg("exec gcin\n"); 
    416 #endif 
    417  
    418   char pidstr[32]; 
    419   sprintf(pidstr, "GCIN_PID=%d",getpid()); 
    420   putenv(pidstr); 
    421   system(GCIN_BIN_DIR"/gcin-setup &"); 
    422 
     396void exec_gcin_setup(); 
    423397 
    424398 
    425399static void mouse_button_callback( GtkWidget *widget,GdkEventButton *event, gpointer data) 
     
    440414} 
    441415 
    442416 
    443 char file_pin_float[] = GCIN_ICON_DIR"/pin-float16.png"
     417extern char file_pin_float[]
    444418 
    445419static void set_currenet_IC_pin_image_pin() 
    446420{ 
     
    478452  tsin_toggle_eng_ch(); 
    479453} 
    480454 
    481 void set_no_focus(GtkWidget *win) 
    482 
    483   gdk_window_set_override_redirect(win->window, TRUE); 
    484 #if GTK_MAJOR_VERSION >=2 && GTK_MINOR_VERSION >= 6 
    485   gtk_window_set_accept_focus(win, FALSE); 
    486 #endif 
    487 #if GTK_MAJOR_VERSION >=2 && GTK_MINOR_VERSION >= 6 
    488   gtk_window_set_focus_on_map (win, FALSE); 
    489 #endif 
    490 
     455void set_no_focus(GtkWidget *win); 
    491456 
    492457 
    493458void create_win0() 
     
    692657  hide_win_sym(); 
    693658} 
    694659 
    695 void bell() 
    696 
    697 #if 1 
    698   XBell(dpy, -97); 
    699 #else 
    700   gdk_beep(); 
    701 #endif 
    702 //  abort(); 
    703 
     660void bell(); 
    704661 
    705662 
    706663void change_tsin_font_size()