… | |
… | |
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 |
391 | #endif |
403 | |
392 | |
404 | refresh_limit = 1; |
393 | refresh_limit = 1; |
405 | refresh_type = SLOW_REFRESH; |
394 | refresh_type = SLOW_REFRESH; |
406 | prev_nrow = prev_ncol = 0; |
395 | prev_nrow = prev_ncol = 0; |
407 | #ifdef MULTICHAR_SET |
|
|
408 | # ifdef MULTICHAR_ENCODING |
|
|
409 | encoding_method = MULTICHAR_ENCODING; |
|
|
410 | # endif |
|
|
411 | multichar_decode = rxvt_euc2jis; |
|
|
412 | #endif |
|
|
413 | |
396 | |
414 | oldcursor.row = oldcursor.col = -1; |
397 | oldcursor.row = oldcursor.col = -1; |
415 | #ifdef XPM_BACKGROUND |
398 | #ifdef XPM_BACKGROUND |
416 | /* bgPixmap.w = bgPixmap.h = 0; */ |
399 | /* bgPixmap.w = bgPixmap.h = 0; */ |
417 | bgPixmap.x = bgPixmap.y = 50; |
400 | bgPixmap.x = bgPixmap.y = 50; |
… | |
… | |
598 | #endif |
581 | #endif |
599 | |
582 | |
600 | if (!rs[Rs_cutchars]) |
583 | if (!rs[Rs_cutchars]) |
601 | rs[Rs_cutchars] = CUTCHARS; |
584 | rs[Rs_cutchars] = CUTCHARS; |
602 | |
585 | |
603 | #ifdef ACS_ASCII |
|
|
604 | if (!rs[Rs_acs_chars]) |
|
|
605 | rs[Rs_acs_chars] = ACS_CHARS; |
|
|
606 | if ((i = STRLEN (rs[Rs_acs_chars])) < 0x20) |
|
|
607 | { |
|
|
608 | val = rxvt_realloc ((void *)rs[Rs_acs_chars], 0x20); |
|
|
609 | for (; i < 0x20; ) |
|
|
610 | val[i] = ' '; |
|
|
611 | rs[Rs_acs_chars] = val; |
|
|
612 | } |
|
|
613 | #endif |
|
|
614 | |
|
|
615 | #ifndef NO_BACKSPACE_KEY |
586 | #ifndef NO_BACKSPACE_KEY |
616 | if (!rs[Rs_backspace_key]) |
587 | if (!rs[Rs_backspace_key]) |
617 | # ifdef DEFAULT_BACKSPACE |
588 | # ifdef DEFAULT_BACKSPACE |
618 | key_backspace = DEFAULT_BACKSPACE; |
589 | key_backspace = DEFAULT_BACKSPACE; |
619 | # else |
590 | # else |
… | |
… | |
647 | { |
618 | { |
648 | rxvt_Str_trim ((char *)rs[Rs_answerbackstring]); |
619 | rxvt_Str_trim ((char *)rs[Rs_answerbackstring]); |
649 | rxvt_Str_escaped ((char *)rs[Rs_answerbackstring]); |
620 | rxvt_Str_escaped ((char *)rs[Rs_answerbackstring]); |
650 | } |
621 | } |
651 | |
622 | |
652 | if (rs[Rs_selectstyle]) |
|
|
653 | { |
|
|
654 | if (STRNCASECMP (rs[Rs_selectstyle], "oldword", 7) == 0) |
|
|
655 | selection_style = OLD_WORD_SELECT; |
|
|
656 | #ifndef NO_OLD_SELECTION |
|
|
657 | |
|
|
658 | else if (STRNCASECMP (rs[Rs_selectstyle], "old", 3) == 0) |
|
|
659 | selection_style = OLD_SELECT; |
|
|
660 | #endif |
|
|
661 | |
|
|
662 | } |
|
|
663 | |
|
|
664 | #ifdef HAVE_SCROLLBARS |
623 | #ifdef HAVE_SCROLLBARS |
665 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
624 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
666 | rs[Rs_scrollBar_thickness]); |
625 | rs[Rs_scrollBar_thickness]); |
667 | #endif |
626 | #endif |
668 | |
|
|
669 | TermWin.fontset = new rxvt_fontset (this); |
|
|
670 | TermWin.fontset->populate (rs[Rs_font]); |
|
|
671 | TermWin.fwidth = TermWin.fontset->base_font ()->width; |
|
|
672 | TermWin.fheight = TermWin.fontset->base_font ()->height; |
|
|
673 | TermWin.fbase = TermWin.fontset->base_font ()->ascent; |
|
|
674 | |
627 | |
675 | #ifdef XTERM_REVERSE_VIDEO |
628 | #ifdef XTERM_REVERSE_VIDEO |
676 | /* this is how xterm implements reverseVideo */ |
629 | /* this is how xterm implements reverseVideo */ |
677 | if (Options & Opt_reverseVideo) |
630 | if (Options & Opt_reverseVideo) |
678 | { |
631 | { |
… | |
… | |
802 | void |
755 | void |
803 | rxvt_term::set_locale (const char *locale) |
756 | rxvt_term::set_locale (const char *locale) |
804 | { |
757 | { |
805 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
758 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
806 | free (this->locale); |
759 | free (this->locale); |
807 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, "")); |
760 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, locale)); |
808 | SET_LOCALE (this->locale); |
761 | SET_LOCALE (this->locale); |
809 | mbstate.reset (); |
762 | mbstate.reset (); |
810 | #endif |
763 | #endif |
811 | #if HAVE_NL_LANGINFO |
764 | #if HAVE_NL_LANGINFO |
812 | free (codeset); |
765 | free (codeset); |
… | |
… | |
1137 | } |
1090 | } |
1138 | |
1091 | |
1139 | /* grab colors before netscape does */ |
1092 | /* grab colors before netscape does */ |
1140 | Get_Colours (); |
1093 | Get_Colours (); |
1141 | |
1094 | |
1142 | 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 | |
1143 | window_calc (0, 0); |
1102 | window_calc (0, 0); |
1144 | old_width = szHint.width; |
1103 | old_width = szHint.width; |
1145 | old_height = szHint.height; |
1104 | old_height = szHint.height; |
1146 | |
1105 | |
1147 | /* parent window - reverse video so we can see placement errors |
1106 | /* parent window - reverse video so we can see placement errors |
… | |
… | |
1173 | |
1132 | |
1174 | xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1133 | xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1175 | xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1134 | xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1176 | |
1135 | |
1177 | classHint.res_name = (char *)rs[Rs_name]; |
1136 | classHint.res_name = (char *)rs[Rs_name]; |
1178 | classHint.res_class = (char *)APL_CLASS; |
1137 | classHint.res_class = (char *)RESCLASS; |
1179 | |
1138 | |
1180 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1139 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1181 | wmHint.input = True; |
1140 | wmHint.input = True; |
1182 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1141 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1183 | : NormalState); |
1142 | : NormalState); |
… | |
… | |
1246 | |
1205 | |
1247 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1206 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1248 | if (menuBar_height ()) |
1207 | if (menuBar_height ()) |
1249 | { |
1208 | { |
1250 | menuBar.win = XCreateSimpleWindow (display->display, TermWin.parent[0], |
1209 | menuBar.win = XCreateSimpleWindow (display->display, TermWin.parent[0], |
1251 | window_vt_x, 0, |
1210 | window_vt_x, 0, |
1252 | TermWin_TotalWidth (), |
1211 | TermWin_TotalWidth (), |
1253 | menuBar_TotalHeight (), |
1212 | menuBar_TotalHeight (), |
1254 | 0, |
1213 | 0, |
1255 | PixColors[Color_fg], |
1214 | PixColors[Color_fg], |
1256 | PixColors[Color_scroll]); |
1215 | PixColors[Color_scroll]); |
|
|
1216 | |
1257 | #ifdef DEBUG_X |
1217 | #ifdef DEBUG_X |
1258 | XStoreName (display->display, menuBar.win, "menubar"); |
1218 | XStoreName (display->display, menuBar.win, "menubar"); |
1259 | #endif |
1219 | #endif |
1260 | |
1220 | |
|
|
1221 | menuBar.drawable = new rxvt_drawable (display, menuBar.win); |
|
|
1222 | |
1261 | XDefineCursor (display->display, menuBar.win, pointer_leftptr); |
1223 | XDefineCursor (display->display, menuBar.win, |
|
|
1224 | XCreateFontCursor (display->display, XC_left_ptr)); |
1262 | |
1225 | |
1263 | XSelectInput (display->display, menuBar.win, |
1226 | XSelectInput (display->display, menuBar.win, |
1264 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1227 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1265 | | Button1MotionMask)); |
1228 | | Button1MotionMask)); |
1266 | menubar_ev.start (display, menuBar.win); |
1229 | menubar_ev.start (display, menuBar.win); |
… | |
… | |
1289 | gcvalue.graphics_exposures = 1; |
1252 | gcvalue.graphics_exposures = 1; |
1290 | TermWin.gc = XCreateGC (display->display, TermWin.vt, |
1253 | TermWin.gc = XCreateGC (display->display, TermWin.vt, |
1291 | GCForeground | GCBackground |
1254 | GCForeground | GCBackground |
1292 | | GCGraphicsExposures, &gcvalue); |
1255 | | GCGraphicsExposures, &gcvalue); |
1293 | |
1256 | |
|
|
1257 | TermWin.drawable = new rxvt_drawable (display, TermWin.vt); |
|
|
1258 | |
1294 | #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) |
1259 | #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) |
1295 | gcvalue.foreground = PixColors[Color_topShadow]; |
1260 | gcvalue.foreground = PixColors[Color_topShadow]; |
1296 | topShadowGC = XCreateGC (display->display, TermWin.vt, |
1261 | topShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1297 | GCForeground, &gcvalue); |
|
|
1298 | gcvalue.foreground = PixColors[Color_bottomShadow]; |
1262 | gcvalue.foreground = PixColors[Color_bottomShadow]; |
1299 | botShadowGC = XCreateGC (display->display, TermWin.vt, |
1263 | botShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1300 | GCForeground, &gcvalue); |
|
|
1301 | gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg |
1264 | gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg : Color_scroll)]; |
1302 | : Color_scroll)]; |
|
|
1303 | scrollbarGC = XCreateGC (display->display, TermWin.vt, |
1265 | scrollbarGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1304 | GCForeground, &gcvalue); |
|
|
1305 | #endif |
1266 | #endif |
1306 | } |
1267 | } |
1307 | |
1268 | |
1308 | /*----------------------------------------------------------------------*/ |
1269 | /*----------------------------------------------------------------------*/ |
1309 | /* |
1270 | /* |