… | |
… | |
155 | cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), |
155 | cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), |
156 | #endif |
156 | #endif |
157 | #ifdef TEXT_BLINK |
157 | #ifdef TEXT_BLINK |
158 | text_blink_ev (this, &rxvt_term::text_blink_cb), |
158 | text_blink_ev (this, &rxvt_term::text_blink_cb), |
159 | #endif |
159 | #endif |
|
|
160 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
|
|
161 | cont_scroll_ev (this, &rxvt_term::cont_scroll_cb), |
|
|
162 | #endif |
|
|
163 | #ifdef SELECTION_SCROLLING |
|
|
164 | sel_scroll_ev (this, &rxvt_term::sel_scroll_cb), |
|
|
165 | #endif |
|
|
166 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
|
|
167 | slip_wheel_ev (this, &rxvt_term::slip_wheel_cb), |
|
|
168 | #endif |
160 | #ifdef POINTER_BLANK |
169 | #ifdef POINTER_BLANK |
161 | pointer_ev (this, &rxvt_term::pointer_cb), |
170 | pointer_ev (this, &rxvt_term::pointer_cb), |
162 | #endif |
171 | #endif |
163 | #ifdef USE_XIM |
172 | #ifdef USE_XIM |
164 | im_ev (this, &rxvt_term::im_cb), |
173 | im_ev (this, &rxvt_term::im_cb), |
165 | #endif |
174 | #endif |
166 | check_ev (this, &rxvt_term::check_cb), |
175 | check_ev (this, &rxvt_term::check_cb), |
|
|
176 | flush_ev (this, &rxvt_term::flush_cb), |
167 | destroy_ev (this, &rxvt_term::destroy_cb), |
177 | destroy_ev (this, &rxvt_term::destroy_cb), |
168 | pty_ev (this, &rxvt_term::pty_cb), |
178 | pty_ev (this, &rxvt_term::pty_cb), |
169 | incr_ev (this, &rxvt_term::incr_cb) |
179 | incr_ev (this, &rxvt_term::incr_cb) |
170 | { |
180 | { |
171 | cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; |
181 | cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; |
… | |
… | |
233 | XDestroyWindow (display->display, TermWin.parent[0]); |
243 | XDestroyWindow (display->display, TermWin.parent[0]); |
234 | } |
244 | } |
235 | |
245 | |
236 | // TODO: free pixcolours, colours should become part of rxvt_display |
246 | // TODO: free pixcolours, colours should become part of rxvt_display |
237 | |
247 | |
238 | delete PixColors; |
248 | delete PixColorsFocused; |
|
|
249 | #ifdef OFF_FOCUS_FADING |
|
|
250 | delete PixColorsUnFocused; |
|
|
251 | #endif |
239 | |
252 | |
240 | displays.put (display); |
253 | displays.put (display); |
241 | |
254 | |
242 | scr_release (); |
255 | scr_release (); |
243 | |
256 | |
… | |
… | |
285 | #ifdef CURSOR_BLINK |
298 | #ifdef CURSOR_BLINK |
286 | cursor_blink_ev.stop (); |
299 | cursor_blink_ev.stop (); |
287 | #endif |
300 | #endif |
288 | #ifdef TEXT_BLINK |
301 | #ifdef TEXT_BLINK |
289 | text_blink_ev.stop (); |
302 | text_blink_ev.stop (); |
|
|
303 | #endif |
|
|
304 | #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING |
|
|
305 | cont_scroll_ev.stop (); |
|
|
306 | #endif |
|
|
307 | #ifdef SELECTION_SCROLLING |
|
|
308 | sel_scroll_ev.stop (); |
290 | #endif |
309 | #endif |
291 | #ifdef POINTER_BLANK |
310 | #ifdef POINTER_BLANK |
292 | pointer_ev.stop (); |
311 | pointer_ev.stop (); |
293 | #endif |
312 | #endif |
294 | |
313 | |
… | |
… | |
740 | max_height = MAX_ROWS * TermWin.fheight; |
759 | max_height = MAX_ROWS * TermWin.fheight; |
741 | |
760 | |
742 | szHint.base_width = szHint.base_height = 2 * TermWin.int_bwidth; |
761 | szHint.base_width = szHint.base_height = 2 * TermWin.int_bwidth; |
743 | |
762 | |
744 | sb_w = mb_h = 0; |
763 | sb_w = mb_h = 0; |
745 | window_vt_x = window_vt_y = 0; |
764 | window_vt_x = window_vt_y = TermWin.int_bwidth; |
746 | |
765 | |
747 | if (scrollbar_visible ()) |
766 | if (scrollbar_visible ()) |
748 | { |
767 | { |
749 | sb_w = scrollbar_TotalWidth (); |
768 | sb_w = scrollbar_TotalWidth (); |
750 | szHint.base_width += sb_w; |
769 | szHint.base_width += sb_w; |
751 | if (! (Options & Opt_scrollBar_right)) |
770 | if (!(Options & Opt_scrollBar_right)) |
752 | window_vt_x = sb_w; |
771 | window_vt_x += sb_w; |
753 | } |
772 | } |
754 | |
773 | |
755 | if (menubar_visible ()) |
774 | if (menubar_visible ()) |
756 | { |
775 | { |
757 | mb_h = menuBar_TotalHeight (); |
776 | mb_h = menuBar_TotalHeight (); |
758 | szHint.base_height += mb_h; |
777 | szHint.base_height += mb_h; |
759 | window_vt_y = mb_h; |
778 | window_vt_y += mb_h; |
760 | } |
779 | } |
761 | |
780 | |
762 | szHint.width_inc = TermWin.fwidth; |
781 | szHint.width_inc = TermWin.fwidth; |
763 | szHint.height_inc = TermWin.fheight; |
782 | szHint.height_inc = TermWin.fheight; |
764 | szHint.min_width = szHint.base_width + szHint.width_inc; |
783 | szHint.min_width = szHint.base_width + szHint.width_inc; |
… | |
… | |
868 | resize_all_windows (0, 0, 0); |
887 | resize_all_windows (0, 0, 0); |
869 | scr_remap_chars (); |
888 | scr_remap_chars (); |
870 | scr_touch (true); |
889 | scr_touch (true); |
871 | } |
890 | } |
872 | |
891 | |
|
|
892 | for (unicode_t ch = 0x20; ch <= 0x7f; ch++) |
|
|
893 | TermWin.ascii_map [ch - 0x20] = fs->find_font (ch); |
|
|
894 | |
873 | return true; |
895 | return true; |
874 | } |
896 | } |
875 | } |
897 | } |
876 | |
898 | |
877 | return false; |
899 | return false; |
… | |
… | |
940 | i = atoi (color); |
962 | i = atoi (color); |
941 | if (i >= 8 && i <= 15) |
963 | if (i >= 8 && i <= 15) |
942 | { /* bright colors */ |
964 | { /* bright colors */ |
943 | i -= 8; |
965 | i -= 8; |
944 | # ifndef NO_BRIGHTCOLOR |
966 | # ifndef NO_BRIGHTCOLOR |
945 | PixColors[idx] = PixColors[minBrightCOLOR + i]; |
967 | PixColorsFocused[idx] = PixColorsFocused[minBrightCOLOR + i]; |
946 | SET_PIXCOLOR (idx); |
968 | SET_PIXCOLOR (idx); |
947 | goto Done; |
969 | goto Done; |
948 | # endif |
970 | # endif |
949 | |
971 | |
950 | } |
972 | } |
951 | if (i >= 0 && i <= 7) |
973 | if (i >= 0 && i <= 7) |
952 | { /* normal colors */ |
974 | { /* normal colors */ |
953 | PixColors[idx] = PixColors[minCOLOR + i]; |
975 | PixColorsFocused[idx] = PixColorsFocused[minCOLOR + i]; |
954 | SET_PIXCOLOR (idx); |
976 | SET_PIXCOLOR (idx); |
955 | goto Done; |
977 | goto Done; |
956 | } |
978 | } |
957 | } |
979 | } |
958 | |
980 | |
959 | if (!rXParseAllocColor (& xcol, color)) |
981 | if (!rXParseAllocColor (& xcol, color)) |
960 | return; |
982 | return; |
961 | |
983 | |
962 | /* XStoreColor (display->display, XCMAP, XColor*); */ |
984 | /* XStoreColor (display->display, display->cmap, XColor*); */ |
963 | |
985 | |
964 | /* |
986 | /* |
965 | * 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, |
966 | * so just keep gobbling up the colormap |
988 | * so just keep gobbling up the colormap |
967 | */ |
989 | */ |
… | |
… | |
970 | if (PixColors[idx] == PixColors[i]) |
992 | if (PixColors[idx] == PixColors[i]) |
971 | break; |
993 | break; |
972 | if (i > Color_White) |
994 | if (i > Color_White) |
973 | { |
995 | { |
974 | /* fprintf (stderr, "XFreeColors: PixColors [%d] = %lu\n", idx, PixColors [idx]); */ |
996 | /* fprintf (stderr, "XFreeColors: PixColors [%d] = %lu\n", idx, PixColors [idx]); */ |
975 | XFreeColors (display->display, XCMAP, (PixColors + idx), 1, |
997 | XFreeColors (display->display, display->cmap, (PixColors + idx), 1, |
976 | DisplayPlanes (display->display, display->screen)); |
998 | DisplayPlanes (display->display, display->screen)); |
977 | } |
999 | } |
978 | # endif |
1000 | # endif |
979 | |
1001 | |
980 | PixColors[idx] = xcol; |
1002 | PixColorsFocused[idx] = xcol; |
981 | SET_PIXCOLOR (idx); |
1003 | SET_PIXCOLOR (idx); |
982 | |
1004 | |
983 | /* XSetWindowAttributes attr; */ |
1005 | /* XSetWindowAttributes attr; */ |
984 | /* Cursor cursor; */ |
1006 | /* Cursor cursor; */ |
985 | Done: |
1007 | Done: |
|
|
1008 | #ifdef OFF_FOCUS_FADING |
|
|
1009 | PixColorsUnFocused[idx] = PixColorsFocused[idx].fade (display, atoi (rs[Rs_fade])); |
|
|
1010 | #endif |
986 | if (idx == Color_bg && ! (Options & Opt_transparent)) |
1011 | if (idx == Color_bg && ! (Options & Opt_transparent)) |
987 | XSetWindowBackground (display->display, TermWin.vt, |
1012 | XSetWindowBackground (display->display, TermWin.vt, PixColors[Color_bg]); |
988 | PixColors[Color_bg]); |
|
|
989 | |
1013 | |
990 | /* handle Color_BD, scrollbar background, etc. */ |
1014 | /* handle Color_BD, scrollbar background, etc. */ |
991 | |
1015 | |
992 | set_colorfgbg (); |
1016 | set_colorfgbg (); |
993 | recolour_cursor (); |
1017 | recolour_cursor (); |
… | |
… | |
1001 | void |
1025 | void |
1002 | rxvt_term::recolour_cursor () |
1026 | rxvt_term::recolour_cursor () |
1003 | { |
1027 | { |
1004 | XColor xcol[2]; |
1028 | XColor xcol[2]; |
1005 | |
1029 | |
1006 | 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]; |
1007 | 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]; |
1008 | XQueryColors (display->display, XCMAP, xcol, 2); |
1032 | XQueryColors (display->display, display->cmap, xcol, 2); |
1009 | XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1); |
1033 | XRecolorCursor (display->display, TermWin_cursor, xcol + 0, xcol + 1); |
1010 | } |
1034 | } |
1011 | |
1035 | |
1012 | /*----------------------------------------------------------------------*/ |
1036 | /*----------------------------------------------------------------------*/ |
1013 | /* |
1037 | /* |