… | |
… | |
394 | |
394 | |
395 | #ifndef NO_BRIGHTCOLOR |
395 | #ifndef NO_BRIGHTCOLOR |
396 | colorfgbg = DEFAULT_RSTYLE; |
396 | colorfgbg = DEFAULT_RSTYLE; |
397 | #endif |
397 | #endif |
398 | |
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 |
|
|
407 | |
|
|
408 | refresh_limit = 1; |
399 | refresh_limit = 1; |
409 | refresh_type = SLOW_REFRESH; |
400 | refresh_type = SLOW_REFRESH; |
410 | prev_nrow = prev_ncol = 0; |
401 | 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 | |
402 | |
418 | oldcursor.row = oldcursor.col = -1; |
403 | oldcursor.row = oldcursor.col = -1; |
419 | #ifdef XPM_BACKGROUND |
404 | #ifdef XPM_BACKGROUND |
420 | /* bgPixmap.w = bgPixmap.h = 0; */ |
405 | /* bgPixmap.w = bgPixmap.h = 0; */ |
421 | bgPixmap.x = bgPixmap.y = 50; |
406 | bgPixmap.x = bgPixmap.y = 50; |
… | |
… | |
602 | #endif |
587 | #endif |
603 | |
588 | |
604 | if (!rs[Rs_cutchars]) |
589 | if (!rs[Rs_cutchars]) |
605 | rs[Rs_cutchars] = CUTCHARS; |
590 | rs[Rs_cutchars] = CUTCHARS; |
606 | |
591 | |
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 |
592 | #ifndef NO_BACKSPACE_KEY |
620 | if (!rs[Rs_backspace_key]) |
593 | if (!rs[Rs_backspace_key]) |
621 | # ifdef DEFAULT_BACKSPACE |
594 | # ifdef DEFAULT_BACKSPACE |
622 | key_backspace = DEFAULT_BACKSPACE; |
595 | key_backspace = DEFAULT_BACKSPACE; |
623 | # else |
596 | # else |
… | |
… | |
667 | |
640 | |
668 | #ifdef HAVE_SCROLLBARS |
641 | #ifdef HAVE_SCROLLBARS |
669 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
642 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
670 | rs[Rs_scrollBar_thickness]); |
643 | rs[Rs_scrollBar_thickness]); |
671 | #endif |
644 | #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 | |
645 | |
679 | #ifdef XTERM_REVERSE_VIDEO |
646 | #ifdef XTERM_REVERSE_VIDEO |
680 | /* this is how xterm implements reverseVideo */ |
647 | /* this is how xterm implements reverseVideo */ |
681 | if (Options & Opt_reverseVideo) |
648 | if (Options & Opt_reverseVideo) |
682 | { |
649 | { |
… | |
… | |
806 | void |
773 | void |
807 | rxvt_term::set_locale (const char *locale) |
774 | rxvt_term::set_locale (const char *locale) |
808 | { |
775 | { |
809 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
776 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
810 | free (this->locale); |
777 | free (this->locale); |
811 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, "")); |
778 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, locale)); |
812 | SET_LOCALE (this->locale); |
779 | SET_LOCALE (this->locale); |
813 | mbstate.reset (); |
780 | mbstate.reset (); |
814 | #endif |
781 | #endif |
815 | #if HAVE_NL_LANGINFO |
782 | #if HAVE_NL_LANGINFO |
816 | free (codeset); |
783 | free (codeset); |
… | |
… | |
900 | if (menubar_visible ()) |
867 | if (menubar_visible ()) |
901 | { |
868 | { |
902 | PrivateModes |= PrivMode_menuBar; |
869 | PrivateModes |= PrivMode_menuBar; |
903 | SavedModes |= PrivMode_menuBar; |
870 | SavedModes |= PrivMode_menuBar; |
904 | } |
871 | } |
905 | |
|
|
906 | #ifdef GREEK_SUPPORT |
|
|
907 | greek_init (); |
|
|
908 | #endif |
|
|
909 | |
872 | |
910 | #ifdef CURSOR_BLINK |
873 | #ifdef CURSOR_BLINK |
911 | if (Options & Opt_cursorBlink) |
874 | if (Options & Opt_cursorBlink) |
912 | (void)gettimeofday (&lastcursorchange, NULL); |
875 | (void)gettimeofday (&lastcursorchange, NULL); |
913 | #endif |
876 | #endif |
… | |
… | |
1145 | } |
1108 | } |
1146 | |
1109 | |
1147 | /* grab colors before netscape does */ |
1110 | /* grab colors before netscape does */ |
1148 | Get_Colours (); |
1111 | Get_Colours (); |
1149 | |
1112 | |
1150 | change_font (1, NULL); |
1113 | if (!change_font (rs[Rs_font])) |
|
|
1114 | { |
|
|
1115 | fprintf (stderr, "unable to load a base font, please provide one using -fn fontname\n"); |
|
|
1116 | destroy (); |
|
|
1117 | return; |
|
|
1118 | } |
|
|
1119 | |
1151 | window_calc (0, 0); |
1120 | window_calc (0, 0); |
1152 | old_width = szHint.width; |
1121 | old_width = szHint.width; |
1153 | old_height = szHint.height; |
1122 | old_height = szHint.height; |
1154 | |
1123 | |
1155 | /* parent window - reverse video so we can see placement errors |
1124 | /* parent window - reverse video so we can see placement errors |
… | |
… | |
1181 | |
1150 | |
1182 | xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1151 | xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1183 | xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1152 | xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1184 | |
1153 | |
1185 | classHint.res_name = (char *)rs[Rs_name]; |
1154 | classHint.res_name = (char *)rs[Rs_name]; |
1186 | classHint.res_class = (char *)APL_CLASS; |
1155 | classHint.res_class = (char *)RESCLASS; |
1187 | |
1156 | |
1188 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1157 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1189 | wmHint.input = True; |
1158 | wmHint.input = True; |
1190 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1159 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1191 | : NormalState); |
1160 | : NormalState); |
… | |
… | |
1254 | |
1223 | |
1255 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1224 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1256 | if (menuBar_height ()) |
1225 | if (menuBar_height ()) |
1257 | { |
1226 | { |
1258 | menuBar.win = XCreateSimpleWindow (display->display, TermWin.parent[0], |
1227 | menuBar.win = XCreateSimpleWindow (display->display, TermWin.parent[0], |
1259 | window_vt_x, 0, |
1228 | window_vt_x, 0, |
1260 | TermWin_TotalWidth (), |
1229 | TermWin_TotalWidth (), |
1261 | menuBar_TotalHeight (), |
1230 | menuBar_TotalHeight (), |
1262 | 0, |
1231 | 0, |
1263 | PixColors[Color_fg], |
1232 | PixColors[Color_fg], |
1264 | PixColors[Color_scroll]); |
1233 | PixColors[Color_scroll]); |
|
|
1234 | |
1265 | #ifdef DEBUG_X |
1235 | #ifdef DEBUG_X |
1266 | XStoreName (display->display, menuBar.win, "menubar"); |
1236 | XStoreName (display->display, menuBar.win, "menubar"); |
1267 | #endif |
1237 | #endif |
1268 | |
1238 | |
|
|
1239 | menuBar.drawable = new rxvt_drawable (display, menuBar.win); |
|
|
1240 | |
1269 | XDefineCursor (display->display, menuBar.win, pointer_leftptr); |
1241 | XDefineCursor (display->display, menuBar.win, |
|
|
1242 | XCreateFontCursor (display->display, XC_left_ptr)); |
1270 | |
1243 | |
1271 | XSelectInput (display->display, menuBar.win, |
1244 | XSelectInput (display->display, menuBar.win, |
1272 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1245 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1273 | | Button1MotionMask)); |
1246 | | Button1MotionMask)); |
1274 | menubar_ev.start (display, menuBar.win); |
1247 | menubar_ev.start (display, menuBar.win); |
… | |
… | |
1297 | gcvalue.graphics_exposures = 1; |
1270 | gcvalue.graphics_exposures = 1; |
1298 | TermWin.gc = XCreateGC (display->display, TermWin.vt, |
1271 | TermWin.gc = XCreateGC (display->display, TermWin.vt, |
1299 | GCForeground | GCBackground |
1272 | GCForeground | GCBackground |
1300 | | GCGraphicsExposures, &gcvalue); |
1273 | | GCGraphicsExposures, &gcvalue); |
1301 | |
1274 | |
|
|
1275 | TermWin.drawable = new rxvt_drawable (display, TermWin.vt); |
|
|
1276 | |
1302 | #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) |
1277 | #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) |
1303 | gcvalue.foreground = PixColors[Color_topShadow]; |
1278 | gcvalue.foreground = PixColors[Color_topShadow]; |
1304 | topShadowGC = XCreateGC (display->display, TermWin.vt, |
1279 | topShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1305 | GCForeground, &gcvalue); |
|
|
1306 | gcvalue.foreground = PixColors[Color_bottomShadow]; |
1280 | gcvalue.foreground = PixColors[Color_bottomShadow]; |
1307 | botShadowGC = XCreateGC (display->display, TermWin.vt, |
1281 | botShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1308 | GCForeground, &gcvalue); |
|
|
1309 | gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg |
1282 | gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg : Color_scroll)]; |
1310 | : Color_scroll)]; |
|
|
1311 | scrollbarGC = XCreateGC (display->display, TermWin.vt, |
1283 | scrollbarGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1312 | GCForeground, &gcvalue); |
|
|
1313 | #endif |
1284 | #endif |
1314 | } |
1285 | } |
1315 | |
1286 | |
1316 | /*----------------------------------------------------------------------*/ |
1287 | /*----------------------------------------------------------------------*/ |
1317 | /* |
1288 | /* |