… | |
… | |
399 | #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) |
399 | #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) |
400 | ks_bigfont = XK_greater; |
400 | ks_bigfont = XK_greater; |
401 | ks_smallfont = XK_less; |
401 | ks_smallfont = XK_less; |
402 | #endif |
402 | #endif |
403 | |
403 | |
404 | #ifdef GREEK_SUPPORT |
|
|
405 | ks_greekmodeswith = GREEK_KEYBOARD_MODESWITCH; |
|
|
406 | #endif |
|
|
407 | |
|
|
408 | refresh_limit = 1; |
404 | refresh_limit = 1; |
409 | refresh_type = SLOW_REFRESH; |
405 | refresh_type = SLOW_REFRESH; |
410 | prev_nrow = prev_ncol = 0; |
406 | 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 | |
407 | |
418 | oldcursor.row = oldcursor.col = -1; |
408 | oldcursor.row = oldcursor.col = -1; |
419 | #ifdef XPM_BACKGROUND |
409 | #ifdef XPM_BACKGROUND |
420 | /* bgPixmap.w = bgPixmap.h = 0; */ |
410 | /* bgPixmap.w = bgPixmap.h = 0; */ |
421 | bgPixmap.x = bgPixmap.y = 50; |
411 | bgPixmap.x = bgPixmap.y = 50; |
… | |
… | |
667 | |
657 | |
668 | #ifdef HAVE_SCROLLBARS |
658 | #ifdef HAVE_SCROLLBARS |
669 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
659 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
670 | rs[Rs_scrollBar_thickness]); |
660 | rs[Rs_scrollBar_thickness]); |
671 | #endif |
661 | #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 | |
662 | |
679 | #ifdef XTERM_REVERSE_VIDEO |
663 | #ifdef XTERM_REVERSE_VIDEO |
680 | /* this is how xterm implements reverseVideo */ |
664 | /* this is how xterm implements reverseVideo */ |
681 | if (Options & Opt_reverseVideo) |
665 | if (Options & Opt_reverseVideo) |
682 | { |
666 | { |
… | |
… | |
806 | void |
790 | void |
807 | rxvt_term::set_locale (const char *locale) |
791 | rxvt_term::set_locale (const char *locale) |
808 | { |
792 | { |
809 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
793 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
810 | free (this->locale); |
794 | free (this->locale); |
811 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, "")); |
795 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, locale)); |
812 | SET_LOCALE (this->locale); |
796 | SET_LOCALE (this->locale); |
813 | mbstate.reset (); |
797 | mbstate.reset (); |
814 | #endif |
798 | #endif |
815 | #if HAVE_NL_LANGINFO |
799 | #if HAVE_NL_LANGINFO |
816 | free (codeset); |
800 | free (codeset); |
… | |
… | |
900 | if (menubar_visible ()) |
884 | if (menubar_visible ()) |
901 | { |
885 | { |
902 | PrivateModes |= PrivMode_menuBar; |
886 | PrivateModes |= PrivMode_menuBar; |
903 | SavedModes |= PrivMode_menuBar; |
887 | SavedModes |= PrivMode_menuBar; |
904 | } |
888 | } |
905 | |
|
|
906 | #ifdef GREEK_SUPPORT |
|
|
907 | greek_init (); |
|
|
908 | #endif |
|
|
909 | |
889 | |
910 | #ifdef CURSOR_BLINK |
890 | #ifdef CURSOR_BLINK |
911 | if (Options & Opt_cursorBlink) |
891 | if (Options & Opt_cursorBlink) |
912 | (void)gettimeofday (&lastcursorchange, NULL); |
892 | (void)gettimeofday (&lastcursorchange, NULL); |
913 | #endif |
893 | #endif |
… | |
… | |
1145 | } |
1125 | } |
1146 | |
1126 | |
1147 | /* grab colors before netscape does */ |
1127 | /* grab colors before netscape does */ |
1148 | Get_Colours (); |
1128 | Get_Colours (); |
1149 | |
1129 | |
1150 | change_font (1, NULL); |
1130 | if (!change_font (rs[Rs_font])) |
|
|
1131 | { |
|
|
1132 | fprintf (stderr, "unable to load a base font, please provide one using -fn fontname\n"); |
|
|
1133 | destroy (); |
|
|
1134 | return; |
|
|
1135 | } |
|
|
1136 | |
1151 | window_calc (0, 0); |
1137 | window_calc (0, 0); |
1152 | old_width = szHint.width; |
1138 | old_width = szHint.width; |
1153 | old_height = szHint.height; |
1139 | old_height = szHint.height; |
1154 | |
1140 | |
1155 | /* parent window - reverse video so we can see placement errors |
1141 | /* parent window - reverse video so we can see placement errors |
… | |
… | |
1181 | |
1167 | |
1182 | xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1168 | xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1183 | xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1169 | xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1184 | |
1170 | |
1185 | classHint.res_name = (char *)rs[Rs_name]; |
1171 | classHint.res_name = (char *)rs[Rs_name]; |
1186 | classHint.res_class = (char *)APL_CLASS; |
1172 | classHint.res_class = (char *)RESCLASS; |
1187 | |
1173 | |
1188 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1174 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1189 | wmHint.input = True; |
1175 | wmHint.input = True; |
1190 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1176 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1191 | : NormalState); |
1177 | : NormalState); |
… | |
… | |
1254 | |
1240 | |
1255 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1241 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1256 | if (menuBar_height ()) |
1242 | if (menuBar_height ()) |
1257 | { |
1243 | { |
1258 | menuBar.win = XCreateSimpleWindow (display->display, TermWin.parent[0], |
1244 | menuBar.win = XCreateSimpleWindow (display->display, TermWin.parent[0], |
1259 | window_vt_x, 0, |
1245 | window_vt_x, 0, |
1260 | TermWin_TotalWidth (), |
1246 | TermWin_TotalWidth (), |
1261 | menuBar_TotalHeight (), |
1247 | menuBar_TotalHeight (), |
1262 | 0, |
1248 | 0, |
1263 | PixColors[Color_fg], |
1249 | PixColors[Color_fg], |
1264 | PixColors[Color_scroll]); |
1250 | PixColors[Color_scroll]); |
|
|
1251 | |
1265 | #ifdef DEBUG_X |
1252 | #ifdef DEBUG_X |
1266 | XStoreName (display->display, menuBar.win, "menubar"); |
1253 | XStoreName (display->display, menuBar.win, "menubar"); |
1267 | #endif |
1254 | #endif |
1268 | |
1255 | |
|
|
1256 | menuBar.drawable = new rxvt_drawable (display, menuBar.win); |
|
|
1257 | |
1269 | XDefineCursor (display->display, menuBar.win, pointer_leftptr); |
1258 | XDefineCursor (display->display, menuBar.win, |
|
|
1259 | XCreateFontCursor (display->display, XC_left_ptr)); |
1270 | |
1260 | |
1271 | XSelectInput (display->display, menuBar.win, |
1261 | XSelectInput (display->display, menuBar.win, |
1272 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1262 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1273 | | Button1MotionMask)); |
1263 | | Button1MotionMask)); |
1274 | menubar_ev.start (display, menuBar.win); |
1264 | menubar_ev.start (display, menuBar.win); |
… | |
… | |
1297 | gcvalue.graphics_exposures = 1; |
1287 | gcvalue.graphics_exposures = 1; |
1298 | TermWin.gc = XCreateGC (display->display, TermWin.vt, |
1288 | TermWin.gc = XCreateGC (display->display, TermWin.vt, |
1299 | GCForeground | GCBackground |
1289 | GCForeground | GCBackground |
1300 | | GCGraphicsExposures, &gcvalue); |
1290 | | GCGraphicsExposures, &gcvalue); |
1301 | |
1291 | |
|
|
1292 | TermWin.drawable = new rxvt_drawable (display, TermWin.vt); |
|
|
1293 | |
1302 | #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) |
1294 | #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) |
1303 | gcvalue.foreground = PixColors[Color_topShadow]; |
1295 | gcvalue.foreground = PixColors[Color_topShadow]; |
1304 | topShadowGC = XCreateGC (display->display, TermWin.vt, |
1296 | topShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1305 | GCForeground, &gcvalue); |
|
|
1306 | gcvalue.foreground = PixColors[Color_bottomShadow]; |
1297 | gcvalue.foreground = PixColors[Color_bottomShadow]; |
1307 | botShadowGC = XCreateGC (display->display, TermWin.vt, |
1298 | botShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1308 | GCForeground, &gcvalue); |
|
|
1309 | gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg |
1299 | gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg : Color_scroll)]; |
1310 | : Color_scroll)]; |
|
|
1311 | scrollbarGC = XCreateGC (display->display, TermWin.vt, |
1300 | scrollbarGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); |
1312 | GCForeground, &gcvalue); |
|
|
1313 | #endif |
1301 | #endif |
1314 | } |
1302 | } |
1315 | |
1303 | |
1316 | /*----------------------------------------------------------------------*/ |
1304 | /*----------------------------------------------------------------------*/ |
1317 | /* |
1305 | /* |