… | |
… | |
384 | TermWin.ext_bwidth = EXTERNALBORDERWIDTH; |
384 | TermWin.ext_bwidth = EXTERNALBORDERWIDTH; |
385 | TermWin.lineSpace = LINESPACE; |
385 | TermWin.lineSpace = LINESPACE; |
386 | TermWin.saveLines = SAVELINES; |
386 | TermWin.saveLines = SAVELINES; |
387 | numPixColors = TOTAL_COLORS; |
387 | numPixColors = TOTAL_COLORS; |
388 | |
388 | |
389 | #ifndef NO_NEW_SELECTION |
|
|
390 | selection_style = NEW_SELECT; |
|
|
391 | #else |
|
|
392 | selection_style = OLD_SELECT; |
|
|
393 | #endif |
|
|
394 | |
|
|
395 | #ifndef NO_BRIGHTCOLOR |
389 | #ifndef NO_BRIGHTCOLOR |
396 | colorfgbg = DEFAULT_RSTYLE; |
390 | colorfgbg = DEFAULT_RSTYLE; |
397 | #endif |
|
|
398 | |
|
|
399 | #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) |
|
|
400 | ks_bigfont = XK_greater; |
|
|
401 | ks_smallfont = XK_less; |
|
|
402 | #endif |
|
|
403 | |
|
|
404 | #ifdef GREEK_SUPPORT |
|
|
405 | ks_greekmodeswith = GREEK_KEYBOARD_MODESWITCH; |
|
|
406 | #endif |
391 | #endif |
407 | |
392 | |
408 | refresh_limit = 1; |
393 | refresh_limit = 1; |
409 | refresh_type = SLOW_REFRESH; |
394 | refresh_type = SLOW_REFRESH; |
410 | prev_nrow = prev_ncol = 0; |
395 | prev_nrow = prev_ncol = 0; |
411 | #ifdef MULTICHAR_SET |
|
|
412 | # ifdef MULTICHAR_ENCODING |
|
|
413 | encoding_method = MULTICHAR_ENCODING; |
|
|
414 | # endif |
|
|
415 | multichar_decode = rxvt_euc2jis; |
|
|
416 | #endif |
|
|
417 | |
396 | |
418 | oldcursor.row = oldcursor.col = -1; |
397 | oldcursor.row = oldcursor.col = -1; |
419 | #ifdef XPM_BACKGROUND |
398 | #ifdef XPM_BACKGROUND |
420 | /* bgPixmap.w = bgPixmap.h = 0; */ |
399 | /* bgPixmap.w = bgPixmap.h = 0; */ |
421 | bgPixmap.x = bgPixmap.y = 50; |
400 | bgPixmap.x = bgPixmap.y = 50; |
… | |
… | |
602 | #endif |
581 | #endif |
603 | |
582 | |
604 | if (!rs[Rs_cutchars]) |
583 | if (!rs[Rs_cutchars]) |
605 | rs[Rs_cutchars] = CUTCHARS; |
584 | rs[Rs_cutchars] = CUTCHARS; |
606 | |
585 | |
607 | #ifdef ACS_ASCII |
|
|
608 | if (!rs[Rs_acs_chars]) |
|
|
609 | rs[Rs_acs_chars] = ACS_CHARS; |
|
|
610 | if ((i = STRLEN (rs[Rs_acs_chars])) < 0x20) |
|
|
611 | { |
|
|
612 | val = rxvt_realloc ((void *)rs[Rs_acs_chars], 0x20); |
|
|
613 | for (; i < 0x20; ) |
|
|
614 | val[i] = ' '; |
|
|
615 | rs[Rs_acs_chars] = val; |
|
|
616 | } |
|
|
617 | #endif |
|
|
618 | |
|
|
619 | #ifndef NO_BACKSPACE_KEY |
586 | #ifndef NO_BACKSPACE_KEY |
620 | if (!rs[Rs_backspace_key]) |
587 | if (!rs[Rs_backspace_key]) |
621 | # ifdef DEFAULT_BACKSPACE |
588 | # ifdef DEFAULT_BACKSPACE |
622 | key_backspace = DEFAULT_BACKSPACE; |
589 | key_backspace = DEFAULT_BACKSPACE; |
623 | # else |
590 | # else |
… | |
… | |
651 | { |
618 | { |
652 | rxvt_Str_trim ((char *)rs[Rs_answerbackstring]); |
619 | rxvt_Str_trim ((char *)rs[Rs_answerbackstring]); |
653 | rxvt_Str_escaped ((char *)rs[Rs_answerbackstring]); |
620 | rxvt_Str_escaped ((char *)rs[Rs_answerbackstring]); |
654 | } |
621 | } |
655 | |
622 | |
656 | if (rs[Rs_selectstyle]) |
|
|
657 | { |
|
|
658 | if (STRNCASECMP (rs[Rs_selectstyle], "oldword", 7) == 0) |
|
|
659 | selection_style = OLD_WORD_SELECT; |
|
|
660 | #ifndef NO_OLD_SELECTION |
|
|
661 | |
|
|
662 | else if (STRNCASECMP (rs[Rs_selectstyle], "old", 3) == 0) |
|
|
663 | selection_style = OLD_SELECT; |
|
|
664 | #endif |
|
|
665 | |
|
|
666 | } |
|
|
667 | |
|
|
668 | #ifdef HAVE_SCROLLBARS |
623 | #ifdef HAVE_SCROLLBARS |
669 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
624 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
670 | rs[Rs_scrollBar_thickness]); |
625 | rs[Rs_scrollBar_thickness]); |
671 | #endif |
626 | #endif |
672 | |
|
|
673 | TermWin.fontset = new rxvt_fontset (this); |
|
|
674 | TermWin.fontset->populate (rs[Rs_font]); |
|
|
675 | TermWin.fwidth = TermWin.fontset->base_font ()->width; |
|
|
676 | TermWin.fheight = TermWin.fontset->base_font ()->height; |
|
|
677 | TermWin.fbase = TermWin.fontset->base_font ()->ascent; |
|
|
678 | |
627 | |
679 | #ifdef XTERM_REVERSE_VIDEO |
628 | #ifdef XTERM_REVERSE_VIDEO |
680 | /* this is how xterm implements reverseVideo */ |
629 | /* this is how xterm implements reverseVideo */ |
681 | if (Options & Opt_reverseVideo) |
630 | if (Options & Opt_reverseVideo) |
682 | { |
631 | { |
… | |
… | |
806 | void |
755 | void |
807 | rxvt_term::set_locale (const char *locale) |
756 | rxvt_term::set_locale (const char *locale) |
808 | { |
757 | { |
809 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
758 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
810 | free (this->locale); |
759 | free (this->locale); |
811 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, "")); |
760 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, locale)); |
812 | SET_LOCALE (this->locale); |
761 | SET_LOCALE (this->locale); |
813 | mbstate.reset (); |
762 | mbstate.reset (); |
814 | #endif |
763 | #endif |
815 | #if HAVE_NL_LANGINFO |
764 | #if HAVE_NL_LANGINFO |
816 | free (codeset); |
765 | free (codeset); |
… | |
… | |
900 | if (menubar_visible ()) |
849 | if (menubar_visible ()) |
901 | { |
850 | { |
902 | PrivateModes |= PrivMode_menuBar; |
851 | PrivateModes |= PrivMode_menuBar; |
903 | SavedModes |= PrivMode_menuBar; |
852 | SavedModes |= PrivMode_menuBar; |
904 | } |
853 | } |
905 | |
|
|
906 | #ifdef GREEK_SUPPORT |
|
|
907 | greek_init (); |
|
|
908 | #endif |
|
|
909 | |
854 | |
910 | #ifdef CURSOR_BLINK |
855 | #ifdef CURSOR_BLINK |
911 | if (Options & Opt_cursorBlink) |
856 | if (Options & Opt_cursorBlink) |
912 | (void)gettimeofday (&lastcursorchange, NULL); |
857 | (void)gettimeofday (&lastcursorchange, NULL); |
913 | #endif |
858 | #endif |
… | |
… | |
1145 | } |
1090 | } |
1146 | |
1091 | |
1147 | /* grab colors before netscape does */ |
1092 | /* grab colors before netscape does */ |
1148 | Get_Colours (); |
1093 | Get_Colours (); |
1149 | |
1094 | |
1150 | change_font (1, NULL); |
1095 | if (!change_font (rs[Rs_font])) |
|
|
1096 | { |
|
|
1097 | fprintf (stderr, "unable to load a base font, please provide one using -fn fontname\n"); |
|
|
1098 | destroy (); |
|
|
1099 | return; |
|
|
1100 | } |
|
|
1101 | |
1151 | window_calc (0, 0); |
1102 | window_calc (0, 0); |
1152 | old_width = szHint.width; |
1103 | old_width = szHint.width; |
1153 | old_height = szHint.height; |
1104 | old_height = szHint.height; |
1154 | |
1105 | |
1155 | /* parent window - reverse video so we can see placement errors |
1106 | /* parent window - reverse video so we can see placement errors |
… | |
… | |
1181 | |
1132 | |
1182 | xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1133 | xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1183 | xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1134 | xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1184 | |
1135 | |
1185 | classHint.res_name = (char *)rs[Rs_name]; |
1136 | classHint.res_name = (char *)rs[Rs_name]; |
1186 | classHint.res_class = (char *)APL_CLASS; |
1137 | classHint.res_class = (char *)RESCLASS; |
1187 | |
1138 | |
1188 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1139 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1189 | wmHint.input = True; |
1140 | wmHint.input = True; |
1190 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1141 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1191 | : NormalState); |
1142 | : NormalState); |
… | |
… | |
1254 | |
1205 | |
1255 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1206 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1256 | if (menuBar_height ()) |
1207 | if (menuBar_height ()) |
1257 | { |
1208 | { |
1258 | menuBar.win = XCreateSimpleWindow (display->display, TermWin.parent[0], |
1209 | menuBar.win = XCreateSimpleWindow (display->display, TermWin.parent[0], |
1259 | window_vt_x, 0, |
1210 | window_vt_x, 0, |
1260 | TermWin_TotalWidth (), |
1211 | TermWin_TotalWidth (), |
1261 | menuBar_TotalHeight (), |
1212 | menuBar_TotalHeight (), |
1262 | 0, |
1213 | 0, |
1263 | PixColors[Color_fg], |
1214 | PixColors[Color_fg], |
1264 | PixColors[Color_scroll]); |
1215 | PixColors[Color_scroll]); |
|
|
1216 | |
1265 | #ifdef DEBUG_X |
1217 | #ifdef DEBUG_X |
1266 | XStoreName (display->display, menuBar.win, "menubar"); |
1218 | XStoreName (display->display, menuBar.win, "menubar"); |
1267 | #endif |
1219 | #endif |
1268 | |
1220 | |
|
|
1221 | menuBar.drawable = new rxvt_drawable (display, menuBar.win); |
|
|
1222 | |
1269 | XDefineCursor (display->display, menuBar.win, pointer_leftptr); |
1223 | XDefineCursor (display->display, menuBar.win, |
|
|
1224 | XCreateFontCursor (display->display, XC_left_ptr)); |
1270 | |
1225 | |
1271 | XSelectInput (display->display, menuBar.win, |
1226 | XSelectInput (display->display, menuBar.win, |
1272 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1227 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1273 | | Button1MotionMask)); |
1228 | | Button1MotionMask)); |
1274 | menubar_ev.start (display, menuBar.win); |
1229 | menubar_ev.start (display, menuBar.win); |
… | |
… | |
1297 | gcvalue.graphics_exposures = 1; |
1252 | gcvalue.graphics_exposures = 1; |
1298 | TermWin.gc = XCreateGC (display->display, TermWin.vt, |
1253 | TermWin.gc = XCreateGC (display->display, TermWin.vt, |
1299 | GCForeground | GCBackground |
1254 | GCForeground | GCBackground |
1300 | | GCGraphicsExposures, &gcvalue); |
1255 | | GCGraphicsExposures, &gcvalue); |
1301 | |
1256 | |
|
|
1257 | TermWin.drawable = new rxvt_drawable (display, TermWin.vt); |
|
|
1258 | |
1302 | #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) |
1259 | #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) |
1303 | gcvalue.foreground = PixColors[Color_topShadow]; |
1260 | gcvalue.foreground = PixColors[Color_topShadow]; |
1304 | topShadowGC = XCreateGC (display->display, TermWin.vt, |
1261 | topShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1305 | GCForeground, &gcvalue); |
|
|
1306 | gcvalue.foreground = PixColors[Color_bottomShadow]; |
1262 | gcvalue.foreground = PixColors[Color_bottomShadow]; |
1307 | botShadowGC = XCreateGC (display->display, TermWin.vt, |
1263 | botShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1308 | GCForeground, &gcvalue); |
|
|
1309 | gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg |
1264 | gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg : Color_scroll)]; |
1310 | : Color_scroll)]; |
|
|
1311 | scrollbarGC = XCreateGC (display->display, TermWin.vt, |
1265 | scrollbarGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1312 | GCForeground, &gcvalue); |
|
|
1313 | #endif |
1266 | #endif |
1314 | } |
1267 | } |
1315 | |
1268 | |
1316 | /*----------------------------------------------------------------------*/ |
1269 | /*----------------------------------------------------------------------*/ |
1317 | /* |
1270 | /* |