ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.208 by root, Mon Jan 30 19:46:13 2006 UTC vs.
Revision 1.212 by root, Tue Jan 31 18:36:35 2006 UTC

368{ 368{
369 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) 369 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++)
370 (*t)->emergency_cleanup (); 370 (*t)->emergency_cleanup ();
371} 371}
372 372
373#if ENABLE_FRILLS 373#if !ENABLE_MINIMAL
374static void 374static void
375print_x_error (Display *dpy, XErrorEvent *event) 375print_x_error (Display *dpy, XErrorEvent *event)
376{ 376{
377 char buffer[BUFSIZ]; 377 char buffer[BUFSIZ];
378 char mesg[BUFSIZ]; 378 char mesg[BUFSIZ];
426 GET_R->allowedxerror = event->error_code; 426 GET_R->allowedxerror = event->error_code;
427 else 427 else
428 { 428 {
429 // GET_R is most likely not the terminal which caused the error, 429 // GET_R is most likely not the terminal which caused the error,
430 // so just output the error and continue 430 // so just output the error and continue
431#if ENABLE_FRILLS 431#if ENABLE_MINIMAL
432 old_xerror_handler (display, event);
433#else
432 print_x_error (display, event); 434 print_x_error (display, event);
433#else
434 old_xerror_handler (display, event);
435#endif 435#endif
436 } 436 }
437 437
438 return 0; 438 return 0;
439} 439}
887void 887void
888rxvt_term::set_window_color (int idx, const char *color) 888rxvt_term::set_window_color (int idx, const char *color)
889{ 889{
890 rxvt_color xcol; 890 rxvt_color xcol;
891 int i; 891 int i;
892 892
893 if (color == NULL || *color == '\0') 893 if (color == NULL || *color == '\0')
894 return; 894 return;
895
896 color = strdup (color);
897 allocated.push_back ((void *)color);
898 rs[Rs_color + idx] = color;
895 899
896 /* handle color aliases */ 900 /* handle color aliases */
897 if (isdigit (*color)) 901 if (isdigit (*color))
898 { 902 {
899 i = atoi (color); 903 i = atoi (color);
900 904
901 if (i >= 8 && i <= 15) 905 if (i >= 8 && i <= 15)
902 { /* bright colors */ 906 { /* bright colors */
903 i -= 8; 907 i -= 8;
904 pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; 908 pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i];
905 SET_PIXCOLOR (idx);
906 goto done; 909 goto done;
907 } 910 }
908 911
909 if (i >= 0 && i <= 7) 912 if (i >= 0 && i <= 7)
910 { /* normal colors */ 913 { /* normal colors */
911 pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; 914 pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i];
912 SET_PIXCOLOR (idx);
913 goto done; 915 goto done;
914 } 916 }
915 } 917 }
916 918
917 if (!set_color (xcol, color)) 919 set_color (xcol, color);
918 return;
919
920 /* XStoreColor (xdisp, display->cmap, XColor*); */
921 920
922 /* 921 /*
923 * FIXME: should free colors here, but no idea how to do it so instead, 922 * FIXME: should free colors here, but no idea how to do it so instead,
924 * so just keep gobbling up the colormap 923 * so just keep gobbling up the colormap
925 */ 924 */
926# if 0
927 for (i = Color_Black; i <= Color_White; i++)
928 if (pix_colors[idx] == pix_colors[i])
929 break;
930 if (i > Color_White)
931 {
932 /* fprintf (stderr, "XFreeColors: pix_colors [%d] = %lu\n", idx, pix_colors [idx]); */
933 XFreeColors (xdisp, display->cmap, (pix_colors + idx), 1,
934 DisplayPlanes (xdisp, display->screen));
935 }
936# endif
937 925
938 pix_colors_focused[idx] = xcol; 926 pix_colors_focused[idx] = xcol;
939 SET_PIXCOLOR (idx);
940 927
941 /* XSetWindowAttributes attr; */ 928 /* XSetWindowAttributes attr; */
942 /* Cursor cursor; */ 929 /* Cursor cursor; */
943done: 930done:
944 931
945#if OFF_FOCUS_FADING 932#if OFF_FOCUS_FADING
946 if (rs[Rs_fade]) 933 if (rs[Rs_fade])
947 pix_colors_unfocused[idx] = pix_colors_focused[idx].fade (this, atoi (rs[Rs_fade]), pix_colors[Color_fade]); 934 {
935 rgba c;
936 pix_colors [Color_fade].get (this, c);
937 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
938 }
948#endif 939#endif
949 940
950 /*TODO: handle Color_BD, scrollbar background, etc. */ 941 /*TODO: handle Color_BD, scrollbar background, etc. */
951 942
952 recolour_cursor (); 943 recolour_cursor ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines