TmpPhoto: gcin-tan-configure.diff
| File gcin-tan-configure.diff, 7.7 kB (added by anonymous, 1 year ago) |
|---|
-
gcin-1.3.5.pre4/Makefile
old new 33 33 gcin-icon.o gcin-setup-gtab.o gtab-list.o gcin-exec-script.o 34 34 35 35 OBJS_gcin_gb_toggle = gcin-gb-toggle.o gcin-conf.o util.o gcin-send.o 36 OBJS_gcin_tan_toggle = gcin-tan-toggle.o gcin-conf.o util.o gcin-send.o 36 37 OBJS_gcin_message = gcin-message.o gcin-conf.o util.o gcin-send.o 37 38 OBJS_pin_juyin = pin-juyin.o util.o pho-lookup.o locale.o pho-sym.o 38 39 … … 76 77 PROGS_SYM=trad2sim 77 78 PROGS_CV=kbmcv pin-juyin 78 79 80 ifeq ($(USE_TAN),Y) 81 CFLAGS += -DUSE_TAN=1 82 PROGS += gcin-tan-toggle 83 endif 84 79 85 all: $(PROGS) trad2sim $(DATA) $(PROGS_CV) gcin.spec 80 86 $(MAKE) -C data 81 87 $(MAKE) -C im-client … … 138 144 gcin-gb-toggle: $(OBJS_gcin_gb_toggle) 139 145 $(CC) -o $@ $(OBJS_gcin_gb_toggle) $(LDFLAGS) 140 146 147 gcin-tan-toggle: $(OBJS_gcin_tan_toggle) 148 $(CC) -o $@ $(OBJS_gcin_tan_toggle) $(LDFLAGS) 149 141 150 gcin-message: $(OBJS_gcin_message) 142 151 $(CC) -o $@ $(OBJS_gcin_message) $(LDFLAGS) 143 152 -
gcin-1.3.5.pre4/gcin-tan-toggle.c
old new 1 #include "gcin.h" 2 3 int main() 4 { 5 gdk_init(NULL, NULL); 6 send_gcin_message(GDK_DISPLAY(), "#gcin_tan_toggle"); 7 8 return 0; 9 } -
gcin-1.3.5.pre4/win-gtab.c
old new 184 184 } 185 185 186 186 void show_win_sym(); 187 #if USE_TAN 188 void show_win_tan(); 189 #endif 187 190 188 191 void move_win_gtab(int x, int y) 189 192 { … … 204 207 win_x = x; win_y = y; 205 208 206 209 show_win_sym(); 210 #if USE_TAN 211 show_win_tan(); 212 #endif 207 213 } 208 214 209 215 void set_gtab_input_method_name(char *s) … … 228 234 } 229 235 230 236 void create_win_sym(); 237 #if USE_TAN 238 void create_win_tan(); 239 #endif 231 240 void exec_gcin_setup(); 232 241 233 242 static void mouse_button_callback( GtkWidget *widget,GdkEventButton *event, gpointer data) … … 541 550 gtk_window_present(gwin_gtab); 542 551 543 552 show_win_sym(); 553 #if USE_TAN 554 show_win_tan(); 555 #endif 544 556 } 545 557 546 558 547 559 void hide_win_sym(); 560 #if USE_TAN 561 void hide_win_tan(); 562 #endif 548 563 void close_gtab_pho_win(); 549 564 550 565 void hide_win_gtab() … … 557 572 close_gtab_pho_win(); 558 573 559 574 hide_win_sym(); 575 #if USE_TAN 576 hide_win_tan(); 577 #endif 560 578 } 561 579 562 580 void minimize_win_gtab() -
gcin-1.3.5.pre4/win-sym.c
old new 5 5 #include "win-sym.h" 6 6 7 7 static GtkWidget *gwin_sym = NULL; 8 #if USE_TAN 9 static GtkWidget *gwin_tan = NULL; 10 #endif 8 11 static int cur_in_method; 9 12 10 13 typedef struct { … … 233 236 gtk_window_move(GTK_WINDOW(gwin_sym), wx, wy); 234 237 } 235 238 239 #if USE_TAN 240 void move_win_tan() 241 { 242 if (!gwin_tan) 243 return; 244 245 int wx, wy; 246 { 247 update_active_in_win_geom(); 248 249 wx = win_x; wy = win_y + win_yl; 250 } 251 252 int wintan_xl, wintan_yl; 253 get_win_size(gwin_tan, &wintan_xl, &wintan_yl); 254 255 if (wx + wintan_xl > dpy_xl) 256 wx = dpy_xl - wintan_xl; 257 if (wx < 0) 258 wx = 0; 259 260 { 261 if (wy + wintan_yl > dpy_yl) 262 wy = win_y - wintan_yl; 263 if (wy < 0) 264 wy = 0; 265 } 266 267 gtk_window_move(GTK_WINDOW(gwin_tan), wx, wy); 268 } 269 #endif 270 236 271 static gboolean win_sym_enabled=0; 272 #if USE_TAN 273 static gboolean win_tan_enabled=0; 274 #endif 237 275 238 276 void hide_win_sym() 239 277 { … … 243 281 gtk_widget_hide(gwin_sym); 244 282 } 245 283 284 #if USE_TAN 285 void hide_win_tan() 286 { 287 if (!gwin_tan) 288 return; 289 290 gtk_widget_hide(gwin_tan); 291 } 292 #endif 293 246 294 void show_win_sym() 247 295 { 248 296 if (!current_CS) … … 257 305 move_win_sym(gwin_sym); 258 306 } 259 307 308 #if USE_TAN 309 void show_win_tan() 310 { 311 if (!current_CS) 312 return; 313 314 if (!gwin_tan || !win_tan_enabled || current_CS->im_state == GCIN_STATE_DISABLED) 315 return; 316 317 gtk_widget_show_all(gwin_tan); 318 move_win_tan(gwin_tan); 319 } 320 #endif 260 321 261 322 void lookup_gtab(char *ch, char out[]); 262 323 void str_to_all_phokey_chars(char *b5_str, char *out); … … 289 350 gwin_sym = NULL; 290 351 } 291 352 353 #if USE_TAN 354 static void destroy_tan() 355 { 356 if (gwin_tan) 357 gtk_widget_destroy(gwin_tan); 358 gwin_tan = NULL; 359 } 360 #endif 292 361 293 362 gboolean button_scroll_event(GtkWidget *widget,GdkEventScroll *event, gpointer user_data) 294 363 { … … 413 482 return; 414 483 } 415 484 485 #if USE_TAN 486 void create_win_tan() 487 { 488 char gcin_dir[512]; 489 490 if (!current_CS) { 491 dbg("create_win_tan, null CS\n"); 492 return; 493 } 494 495 if (current_CS->in_method < 0) { 496 p_err("bad current_CS %d\n", current_CS->in_method); 497 } 498 499 if (cur_in_method != current_CS->in_method) 500 destroy_tan(); 501 502 win_tan_enabled^=1; 503 504 if (gwin_tan) { 505 if (win_tan_enabled) { 506 show_win_tan(gwin_tan); 507 } 508 else 509 hide_win_tan(gwin_tan); 510 511 return; 512 } 513 514 gwin_tan = gtk_window_new (GTK_WINDOW_TOPLEVEL); 515 cur_in_method = current_CS->in_method; 516 517 GtkWidget *vbox_top = gtk_vbox_new (FALSE, 0); 518 gtk_container_add (GTK_CONTAINER (gwin_tan), vbox_top); 519 520 gtk_container_set_border_width (GTK_CONTAINER (vbox_top), 0); 521 522 GtkWidget *image = gtk_image_new_from_file(get_gcin_conf_fname("gcin-tan", gcin_dir)); 523 gtk_box_pack_start (GTK_BOX (vbox_top), image, FALSE, FALSE, 0); 524 525 gtk_widget_realize (gwin_tan); 526 set_no_focus(gwin_tan); 527 528 if (win_tan_enabled) 529 gtk_widget_show_all(gwin_tan); 530 531 move_win_tan(gwin_tan); 532 return; 533 } 534 #endif 416 535 417 536 void change_win_sym_font_size() 418 537 {
