… | |
… | |
284 | delete [] pix_colors_focused; |
284 | delete [] pix_colors_focused; |
285 | #if OFF_FOCUS_FADING |
285 | #if OFF_FOCUS_FADING |
286 | delete [] pix_colors_unfocused; |
286 | delete [] pix_colors_unfocused; |
287 | #endif |
287 | #endif |
288 | |
288 | |
|
|
289 | #ifdef HAVE_BG_PIXMAP |
289 | bgPixmap.destroy (); |
290 | bgPixmap.destroy (); |
|
|
291 | #endif |
290 | displays.put (display); |
292 | displays.put (display); |
291 | |
293 | |
292 | scr_release (); |
294 | scr_release (); |
293 | |
295 | |
294 | /* clear all resources */ |
296 | /* clear all resources */ |
… | |
… | |
306 | delete envv; |
308 | delete envv; |
307 | delete argv; |
309 | delete argv; |
308 | |
310 | |
309 | #ifdef KEYSYM_RESOURCE |
311 | #ifdef KEYSYM_RESOURCE |
310 | delete keyboard; |
312 | delete keyboard; |
|
|
313 | #endif |
|
|
314 | #ifndef NO_RESOURCES |
|
|
315 | XrmDestroyDatabase (option_db); |
311 | #endif |
316 | #endif |
312 | } |
317 | } |
313 | |
318 | |
314 | // child has exited, usually destroys |
319 | // child has exited, usually destroys |
315 | void |
320 | void |
… | |
… | |
617 | void |
622 | void |
618 | rxvt_init () |
623 | rxvt_init () |
619 | { |
624 | { |
620 | ptytty::init (); |
625 | ptytty::init (); |
621 | |
626 | |
622 | if (!ev::ev_default_loop (0)) |
627 | if (!ev_default_loop (0)) |
623 | rxvt_fatal ("cannot initialise libev (bad value for LIBEV_METHODS?)\n"); |
628 | rxvt_fatal ("cannot initialise libev (bad value for LIBEV_METHODS?)\n"); |
624 | |
629 | |
625 | rxvt_environ = environ; |
630 | rxvt_environ = environ; |
626 | |
631 | |
627 | signal (SIGHUP, SIG_IGN); |
632 | signal (SIGHUP, SIG_IGN); |
628 | signal (SIGPIPE, SIG_IGN); |
633 | signal (SIGPIPE, SIG_IGN); |
629 | |
634 | |
630 | sig_handlers.sw_term.start (SIGTERM); ev::ev_unref (); |
635 | sig_handlers.sw_term.start (SIGTERM); ev_unref (); |
631 | sig_handlers.sw_int.start (SIGINT); ev::ev_unref (); |
636 | sig_handlers.sw_int.start (SIGINT); ev_unref (); |
632 | |
637 | |
633 | /* need to trap SIGURG for SVR4 (Unixware) rlogin */ |
638 | /* need to trap SIGURG for SVR4 (Unixware) rlogin */ |
634 | /* signal (SIGURG, SIG_DFL); */ |
639 | /* signal (SIGURG, SIG_DFL); */ |
635 | |
640 | |
636 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
641 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
… | |
… | |
974 | if (isdigit (*color)) |
979 | if (isdigit (*color)) |
975 | { |
980 | { |
976 | i = atoi (color); |
981 | i = atoi (color); |
977 | |
982 | |
978 | if (i >= 8 && i <= 15) |
983 | if (i >= 8 && i <= 15) |
|
|
984 | { |
979 | { /* bright colors */ |
985 | /* bright colors */ |
980 | i -= 8; |
|
|
981 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; |
986 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i - 8]; |
982 | goto done; |
987 | goto done; |
983 | } |
988 | } |
984 | |
989 | |
985 | if (i >= 0 && i <= 7) |
990 | if (i >= 0 && i <= 7) |
|
|
991 | { |
986 | { /* normal colors */ |
992 | /* normal colors */ |
987 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
993 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
988 | goto done; |
994 | goto done; |
989 | } |
995 | } |
990 | } |
996 | } |
991 | |
997 | |
… | |
… | |
996 | * so just keep gobbling up the colormap |
1002 | * so just keep gobbling up the colormap |
997 | */ |
1003 | */ |
998 | |
1004 | |
999 | pix_colors_focused[idx] = xcol; |
1005 | pix_colors_focused[idx] = xcol; |
1000 | |
1006 | |
1001 | /* XSetWindowAttributes attr; */ |
|
|
1002 | /* Cursor cursor; */ |
|
|
1003 | done: |
1007 | done: |
1004 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
1008 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
1005 | |
1009 | |
1006 | update_fade_color (idx); |
1010 | update_fade_color (idx); |
1007 | recolour_cursor (); |
1011 | recolour_cursor (); |
… | |
… | |
1031 | */ |
1035 | */ |
1032 | void |
1036 | void |
1033 | rxvt_term::set_colorfgbg () |
1037 | rxvt_term::set_colorfgbg () |
1034 | { |
1038 | { |
1035 | unsigned int i; |
1039 | unsigned int i; |
1036 | const char *xpmb = "\0"; |
1040 | const char *xpmb = ""; |
1037 | char fstr[sizeof ("default") + 1], bstr[sizeof ("default") + 1]; |
1041 | char fstr[sizeof ("default") + 1], bstr[sizeof ("default") + 1]; |
1038 | |
1042 | |
1039 | strcpy (fstr, "default"); |
1043 | strcpy (fstr, "default"); |
1040 | strcpy (bstr, "default"); |
1044 | strcpy (bstr, "default"); |
1041 | for (i = Color_Black; i <= Color_White; i++) |
1045 | for (i = Color_Black; i <= Color_White; i++) |
… | |
… | |
1741 | } |
1745 | } |
1742 | |
1746 | |
1743 | #ifdef HAVE_BG_PIXMAP |
1747 | #ifdef HAVE_BG_PIXMAP |
1744 | # if TRACE_PIXMAPS |
1748 | # if TRACE_PIXMAPS |
1745 | # undef update_background |
1749 | # undef update_background |
1746 | int rxvt_term::trace_update_background (const char* file, int line) |
1750 | int rxvt_term::trace_update_background (const char *file, int line) |
1747 | { |
1751 | { |
1748 | fprintf (stderr, "%s:%d:update_background()\n", file, line); |
1752 | fprintf (stderr, "%s:%d:update_background()\n", file, line); |
1749 | update_background (); |
1753 | update_background (); |
1750 | } |
1754 | } |
1751 | # endif |
1755 | # endif |
|
|
1756 | |
1752 | int |
1757 | int |
1753 | rxvt_term::update_background () |
1758 | rxvt_term::update_background () |
1754 | { |
1759 | { |
1755 | bgPixmap.invalidate (); |
1760 | bgPixmap.invalidate (); |
1756 | |
1761 | |