… | |
… | |
171 | #endif |
171 | #endif |
172 | #ifdef USE_XIM |
172 | #ifdef USE_XIM |
173 | im_ev (this, &rxvt_term::im_cb), |
173 | im_ev (this, &rxvt_term::im_cb), |
174 | #endif |
174 | #endif |
175 | check_ev (this, &rxvt_term::check_cb), |
175 | check_ev (this, &rxvt_term::check_cb), |
|
|
176 | flush_ev (this, &rxvt_term::flush_cb), |
176 | destroy_ev (this, &rxvt_term::destroy_cb), |
177 | destroy_ev (this, &rxvt_term::destroy_cb), |
177 | pty_ev (this, &rxvt_term::pty_cb), |
178 | pty_ev (this, &rxvt_term::pty_cb), |
178 | incr_ev (this, &rxvt_term::incr_cb) |
179 | incr_ev (this, &rxvt_term::incr_cb) |
179 | { |
180 | { |
180 | cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; |
181 | cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; |
… | |
… | |
242 | XDestroyWindow (display->display, TermWin.parent[0]); |
243 | XDestroyWindow (display->display, TermWin.parent[0]); |
243 | } |
244 | } |
244 | |
245 | |
245 | // TODO: free pixcolours, colours should become part of rxvt_display |
246 | // TODO: free pixcolours, colours should become part of rxvt_display |
246 | |
247 | |
247 | delete PixColors; |
248 | delete PixColorsFocused; |
|
|
249 | #ifdef OFF_FOCUS_FADING |
|
|
250 | delete PixColorsUnFocused; |
|
|
251 | #endif |
248 | |
252 | |
249 | displays.put (display); |
253 | displays.put (display); |
250 | |
254 | |
251 | scr_release (); |
255 | scr_release (); |
252 | |
256 | |
… | |
… | |
883 | resize_all_windows (0, 0, 0); |
887 | resize_all_windows (0, 0, 0); |
884 | scr_remap_chars (); |
888 | scr_remap_chars (); |
885 | scr_touch (true); |
889 | scr_touch (true); |
886 | } |
890 | } |
887 | |
891 | |
|
|
892 | for (unicode_t ch = 0x20; ch <= 0x7f; ch++) |
|
|
893 | TermWin.ascii_map [ch - 0x20] = fs->find_font (ch); |
|
|
894 | |
888 | return true; |
895 | return true; |
889 | } |
896 | } |
890 | } |
897 | } |
891 | |
898 | |
892 | return false; |
899 | return false; |
… | |
… | |
955 | i = atoi (color); |
962 | i = atoi (color); |
956 | if (i >= 8 && i <= 15) |
963 | if (i >= 8 && i <= 15) |
957 | { /* bright colors */ |
964 | { /* bright colors */ |
958 | i -= 8; |
965 | i -= 8; |
959 | # ifndef NO_BRIGHTCOLOR |
966 | # ifndef NO_BRIGHTCOLOR |
960 | PixColors[idx] = PixColors[minBrightCOLOR + i]; |
967 | PixColorsFocused[idx] = PixColorsFocused[minBrightCOLOR + i]; |
961 | SET_PIXCOLOR (idx); |
968 | SET_PIXCOLOR (idx); |
962 | goto Done; |
969 | goto Done; |
963 | # endif |
970 | # endif |
964 | |
971 | |
965 | } |
972 | } |
966 | if (i >= 0 && i <= 7) |
973 | if (i >= 0 && i <= 7) |
967 | { /* normal colors */ |
974 | { /* normal colors */ |
968 | PixColors[idx] = PixColors[minCOLOR + i]; |
975 | PixColorsFocused[idx] = PixColorsFocused[minCOLOR + i]; |
969 | SET_PIXCOLOR (idx); |
976 | SET_PIXCOLOR (idx); |
970 | goto Done; |
977 | goto Done; |
971 | } |
978 | } |
972 | } |
979 | } |
973 | |
980 | |
974 | if (!rXParseAllocColor (& xcol, color)) |
981 | if (!rXParseAllocColor (& xcol, color)) |
975 | return; |
982 | return; |
976 | |
983 | |
977 | /* XStoreColor (display->display, XCMAP, XColor*); */ |
984 | /* XStoreColor (display->display, display->cmap, XColor*); */ |
978 | |
985 | |
979 | /* |
986 | /* |
980 | * FIXME: should free colors here, but no idea how to do it so instead, |
987 | * FIXME: should free colors here, but no idea how to do it so instead, |
981 | * so just keep gobbling up the colormap |
988 | * so just keep gobbling up the colormap |
982 | */ |
989 | */ |
… | |
… | |
985 | if (PixColors[idx] == PixColors[i]) |
992 | if (PixColors[idx] == PixColors[i]) |
986 | break; |
993 | break; |
987 | if (i > Color_White) |
994 | if (i > Color_White) |
988 | { |
995 | { |
989 | /* fprintf (stderr, "XFreeColors: PixColors [%d] = %lu\n", idx, PixColors [idx]); */ |
996 | /* fprintf (stderr, "XFreeColors: PixColors [%d] = %lu\n", idx, PixColors [idx]); */ |
990 | XFreeColors (display->display, XCMAP, (PixColors + idx), 1, |
997 | XFreeColors (display->display, display->cmap, (PixColors + idx), 1, |
991 | DisplayPlanes (display->display, display->screen)); |
998 | DisplayPlanes (display->display, display->screen)); |
992 | } |
999 | } |
993 | # endif |
1000 | # endif |
994 | |
1001 | |
995 | PixColors[idx] = xcol; |
1002 | PixColorsFocused[idx] = xcol; |
996 | SET_PIXCOLOR (idx); |
1003 | SET_PIXCOLOR (idx); |
997 | |
1004 | |
998 | /* XSetWindowAttributes attr; */ |
1005 | /* XSetWindowAttributes attr; */ |
999 | /* Cursor cursor; */ |
1006 | /* Cursor cursor; */ |
1000 | Done: |
1007 | Done: |
|
|
1008 | #ifdef OFF_FOCUS_FADING |
|
|
1009 | PixColorsUnFocused[idx] = PixColorsFocused[idx].fade (display, atoi (rs[Rs_fade])); |
|
|
1010 | #endif |
1001 | if (idx == Color_bg && ! (Options & Opt_transparent)) |
1011 | if (idx == Color_bg && ! (Options & Opt_transparent)) |
1002 | XSetWindowBackground (display->display, TermWin.vt, |
1012 | XSetWindowBackground (display->display, TermWin.vt, PixColors[Color_bg]); |
1003 | PixColors[Color_bg]); |
|
|
1004 | |
1013 | |
1005 | /* handle Color_BD, scrollbar background, etc. */ |
1014 | /* handle Color_BD, scrollbar background, etc. */ |
1006 | |
1015 | |
1007 | set_colorfgbg (); |
1016 | set_colorfgbg (); |
1008 | recolour_cursor (); |
1017 | recolour_cursor (); |
… | |
… | |
1016 | void |
1025 | void |
1017 | rxvt_term::recolour_cursor () |
1026 | rxvt_term::recolour_cursor () |
1018 | { |
1027 | { |
1019 | XColor xcol[2]; |
1028 | XColor xcol[2]; |
1020 | |
1029 | |
1021 | xcol[0].pixel = ISSET_PIXCOLOR (Color_pointer_fg) ? PixColors[Color_pointer_fg] : PixColors[Color_fg]; |
1030 | xcol[0].pixel = ISSET_PIXCOLOR (Color_pointer_fg) ? PixColorsFocused[Color_pointer_fg] : PixColorsFocused[Color_fg]; |
1022 | xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) ? PixColors[Color_pointer_bg] : PixColors[Color_bg]; |
1031 | xcol[1].pixel = ISSET_PIXCOLOR (Color_pointer_bg) ? PixColorsFocused[Color_pointer_bg] : PixColorsFocused[Color_bg]; |
1023 | XQueryColors (display->display, XCMAP, xcol, 2); |
1032 | XQueryColors (display->display, display->cmap, xcol, 2); |
1024 | XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1); |
1033 | XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1); |
1025 | } |
1034 | } |
1026 | |
1035 | |
1027 | /*----------------------------------------------------------------------*/ |
1036 | /*----------------------------------------------------------------------*/ |
1028 | /* |
1037 | /* |