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 5 5 .SUFFIXES: .c .o .E .pico 6 6 7 7 gcin_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.o8 gcin_pho_o = win-pho.o pho.o pho-util.o pho-sym.o table-update.o pho-dbg.o pho-play.o 9 gcin_gtab_o = gtab.o win-gtab.o gtab-util.o 10 10 11 11 GCIN_SO= gcin1.so 12 12 13 13 OBJS=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 16 15 17 16 OBJS_TSLEARN=tslearn.o util.o gcin-conf.o pho-util.o tsin-util.o gcin-send.o pho-sym.o \ 18 17 table-update.o locale.o gcin-settings.o … … 64 63 CFLAGS += -DGCIN_i18n_message=1 65 64 endif 66 65 66 ifeq ($(USE_TSIN),Y) 67 CFLAGS += -DUSE_TSIN=1 68 OBJS += $(gcin_tsin_o) 69 endif 70 71 ifeq ($(USE_PHO),Y) 72 CFLAGS += -DUSE_PHO=1 73 OBJS += $(gcin_pho_o) 74 endif 75 76 ifeq ($(USE_GTAB),Y) 77 CFLAGS += -DUSE_GTAB=1 78 OBJS += $(gcin_gtab_o) 79 endif 80 81 ifeq ($(USE_INT),Y) 82 CFLAGS += -DUSE_INTCODE=1 83 endif 84 67 85 im-srv = im-srv/im-srv.a 68 86 69 87 .c.E: … … 144 162 pin-juyin: $(OBJS_pin_juyin) 145 163 $(CC) -o $@ $(OBJS_pin_juyin) $(LDFLAGS) 146 164 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 165 gcin1_so= win-message.pico phrase.pico win-sym.pico win-inmd-switch.pico 166 167 ifeq ($(USE_PHO),Y) 168 gcin1_so += pinyin.pico win-pho-near.pico 169 endif 170 171 ifeq ($(USE_INT),Y) 172 gcin1_so += intcode.pico win-int.pico 173 endif 174 148 175 gcin1.so: $(gcin1_so) 149 176 $(CC) $(SO_FLAGS) -o $@ $(gcin1_so) $(LDFLAGS) 150 177 -
gcin-1.3.5.pre4/eve.c
old new 256 256 } 257 257 258 258 switch (cs->in_method) { 259 #if USE_PHO 259 260 case 3: 260 261 hide_win_pho(); 261 262 break; 263 #endif 264 #if USE_TSIN 262 265 case 6: 263 266 // flush_tsin_buffer(); 264 267 hide_win0(); 265 268 break; 269 #endif 270 #if USE_INTCODE 266 271 case 10: 267 272 hide_win_int(); 268 273 break; 274 #endif 275 #if USE_GTAB 269 276 default: 270 277 hide_win_gtab(); 278 #endif 271 279 } 272 280 273 281 reset_current_in_win_xy(); … … 291 299 } 292 300 293 301 switch (cs->in_method) { 302 #if USE_PHO 294 303 case 3: 295 304 show_win_pho(); 296 305 break; 306 #endif 307 #if USE_TSIN 297 308 case 6: 298 309 show_win0(); 299 310 break; 311 #endif 312 #if USE_INTCODE 300 313 case 10: 301 314 show_win_int(); 302 315 break; 316 #endif 317 #if USE_GTAB 303 318 default: 304 319 show_win_gtab(); 320 #endif 305 321 } 306 322 #if 0 307 323 show_win_stautus(); … … 338 354 current_in_win_x = x ; current_in_win_y = y; 339 355 340 356 switch (cs->in_method) { 357 #if USE_PHO 341 358 case 3: 342 359 move_win_pho(x, y); 343 360 break; 361 #endif 362 #if USE_TSIN 344 363 case 6: 345 364 move_win0(x, y); 346 365 break; 366 #endif 367 #if USE_INTCODE 347 368 case 10: 348 369 move_win_int(x, y); 349 370 break; 371 #endif 350 372 default: 351 373 if (!cs->in_method) 352 374 return; 375 #if USE_GTAB 353 376 move_win_gtab(x, y); 377 #endif 354 378 } 355 379 } 356 380 … … 463 487 #endif 464 488 465 489 switch (current_CS->in_method) { 490 #if USE_PHO 466 491 case 3: 467 492 win_pho_disp_half_full(); 468 493 break; 494 #endif 495 #if USE_TSIN 469 496 case 6: 470 497 win_tsin_disp_half_full(); 471 498 break; 499 #endif 472 500 default: 501 #if USE_GTAB 473 502 win_gtab_disp_half_full(); 503 #endif 474 504 break; 475 505 } 476 506 } … … 551 581 { 552 582 // dbg("update_active_in_win_geom\n"); 553 583 switch (current_CS->in_method) { 584 #if USE_PHO 554 585 case 3: 555 586 get_win_pho_geom(); 556 587 break; 588 #endif 589 #if USE_TSIN 557 590 case 6: 558 591 get_win0_geom(); 559 592 break; 593 #endif 594 #if USE_INTCODE 560 595 case 10: 561 596 break; 597 #endif 562 598 default: 599 #if USE_GTAB 563 600 get_win_gtab_geom(); 601 #endif 564 602 break; 565 603 } 566 604 } … … 638 676 639 677 640 678 switch (in_no) { 679 #if USE_PHO 641 680 case 3: 642 681 current_CS->in_method = in_no; 643 682 init_tab_pho(); 644 683 break; 684 #endif 685 #if USE_TSIN 645 686 case 6: 646 687 current_CS->in_method = in_no; 647 688 init_tab_pp(True); 648 689 break; 690 #endif 691 #if USE_INTCODE 649 692 case 10: 650 693 current_CS->in_method = in_no; 651 694 init_inter_code(True); 652 695 break; 696 #endif 653 697 default: 698 #if USE_GTAB 654 699 init_gtab(in_no, True); 655 700 if (!inmd[in_no].DefChars) 656 701 return FALSE; 657 702 current_CS->in_method = in_no; 658 703 show_win_gtab(); 704 #endif 659 705 break; 660 706 } 661 707 … … 832 878 } 833 879 834 880 switch(current_CS->in_method) { 881 #if USE_PHO 835 882 case 3: 836 883 return feedkey_pho(keysym, kev_state); 884 #endif 885 #if USE_TSIN 837 886 case 6: 838 887 return feedkey_pp(keysym, kev_state); 888 #endif 889 #if USE_INTCODE 839 890 case 10: 840 891 return feedkey_intcode(keysym); 892 #endif 893 #if USE_GTAB 841 894 default: 842 895 return feedkey_gtab(keysym, kev_state); 896 #endif 843 897 } 844 898 845 899 … … 856 910 if (current_CS->im_state == GCIN_STATE_DISABLED) 857 911 return FALSE; 858 912 913 #if USE_TSIN 859 914 switch(current_CS->in_method) { 860 915 case 6: 861 916 return feedkey_pp_release(keysym, kev_state); 862 917 } 918 #endif 863 919 864 920 return FALSE; 865 921 } -
gcin-1.3.5.pre4/gcin.c
old new 40 40 { 41 41 42 42 switch (default_input_method) { 43 #if USE_PHO 43 44 case 3: 44 45 create_win_pho(); 45 46 xim_arr[0].xim_xwin = xwin_pho; 46 47 break; 48 #endif 49 #if USE_TSIN 47 50 case 6: 48 51 create_win0(); 49 52 xim_arr[0].xim_xwin = xwin0; 50 53 break; 54 #endif 51 55 default: 56 #if USE_GTAB 52 57 create_win_gtab(); 53 58 xim_arr[0].xim_xwin = xwin_gtab; 59 #endif 54 60 break; 55 61 } 56 62 } -
gcin-1.3.5.pre4/tsin.c
old new 1180 1180 gboolean inph_typ_pho(char newkey); 1181 1181 1182 1182 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 } 1183 gint64 current_time(); 1190 1184 1191 1185 static void call_tsin_parse() 1192 1186 { … … 1196 1190 prbuf(); 1197 1191 } 1198 1192 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 } 1193 void case_inverse(int *xkey, int shift_m); 1208 1194 1209 1195 void pho_play(phokey_t key); 1210 1196 -
gcin-1.3.5.pre4/win-pho.c
old new 23 23 24 24 void move_win_pho(int x, int y); 25 25 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); 26 void get_win_size(GtkWidget *win, int *width, int *height); 39 27 40 return (width + current_in_win_x > dpy_xl || height + current_in_win_y > dpy_yl); 41 } 28 gboolean win_size_exceed(GtkWidget *win); 42 29 43 30 44 31 void disp_pho_sel(char *s) -
gcin-1.3.5.pre4/win0.c
old new 56 56 recreate_win0(); 57 57 } 58 58 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 } 59 void set_label_font_size(GtkWidget *label, int size); 71 60 72 61 /* there is a bug in gtk, if the widget is created and hasn't been processed by 73 62 gtk_main(), the coodinate of the widget is sometimes invalid. … … 129 118 130 119 131 120 132 gboolean b_use_full_space = TRUE;121 extern gboolean b_use_full_space; 133 122 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 } 123 void set_label_space(GtkWidget *label); 140 124 141 125 142 126 void disp_char(int index, char *ch) … … 409 393 } 410 394 } 411 395 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 } 396 void exec_gcin_setup(); 423 397 424 398 425 399 static void mouse_button_callback( GtkWidget *widget,GdkEventButton *event, gpointer data) … … 440 414 } 441 415 442 416 443 char file_pin_float[] = GCIN_ICON_DIR"/pin-float16.png";417 extern char file_pin_float[]; 444 418 445 419 static void set_currenet_IC_pin_image_pin() 446 420 { … … 478 452 tsin_toggle_eng_ch(); 479 453 } 480 454 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 } 455 void set_no_focus(GtkWidget *win); 491 456 492 457 493 458 void create_win0() … … 692 657 hide_win_sym(); 693 658 } 694 659 695 void bell() 696 { 697 #if 1 698 XBell(dpy, -97); 699 #else 700 gdk_beep(); 701 #endif 702 // abort(); 703 } 660 void bell(); 704 661 705 662 706 663 void change_tsin_font_size()
