… | |
… | |
9 | * - extensive modifications |
9 | * - extensive modifications |
10 | * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> |
10 | * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> |
11 | * - extensive modifications |
11 | * - extensive modifications |
12 | * Copyright (c) 1999 D J Hawkey Jr <hawkeyd@visi.com> |
12 | * Copyright (c) 1999 D J Hawkey Jr <hawkeyd@visi.com> |
13 | * - QNX support |
13 | * - QNX support |
|
|
14 | * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com> |
14 | * |
15 | * |
15 | * This program is free software; you can redistribute it and/or modify |
16 | * This program is free software; you can redistribute it and/or modify |
16 | * it under the terms of the GNU General Public License as published by |
17 | * it under the terms of the GNU General Public License as published by |
17 | * the Free Software Foundation; either version 2 of the License, or |
18 | * the Free Software Foundation; either version 2 of the License, or |
18 | * (at your option) any later version. |
19 | * (at your option) any later version. |
… | |
… | |
398 | #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) |
399 | #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) |
399 | ks_bigfont = XK_greater; |
400 | ks_bigfont = XK_greater; |
400 | ks_smallfont = XK_less; |
401 | ks_smallfont = XK_less; |
401 | #endif |
402 | #endif |
402 | |
403 | |
403 | #ifdef GREEK_SUPPORT |
|
|
404 | ks_greekmodeswith = GREEK_KEYBOARD_MODESWITCH; |
|
|
405 | #endif |
|
|
406 | |
|
|
407 | refresh_limit = 1; |
404 | refresh_limit = 1; |
408 | refresh_type = SLOW_REFRESH; |
405 | refresh_type = SLOW_REFRESH; |
409 | prev_nrow = prev_ncol = 0; |
406 | prev_nrow = prev_ncol = 0; |
410 | #ifdef MULTICHAR_SET |
|
|
411 | # ifdef MULTICHAR_ENCODING |
|
|
412 | encoding_method = MULTICHAR_ENCODING; |
|
|
413 | # endif |
|
|
414 | multichar_decode = rxvt_euc2jis; |
|
|
415 | #endif |
|
|
416 | |
407 | |
417 | oldcursor.row = oldcursor.col = -1; |
408 | oldcursor.row = oldcursor.col = -1; |
418 | #ifdef XPM_BACKGROUND |
409 | #ifdef XPM_BACKGROUND |
419 | /* bgPixmap.w = bgPixmap.h = 0; */ |
410 | /* bgPixmap.w = bgPixmap.h = 0; */ |
420 | bgPixmap.x = bgPixmap.y = 50; |
411 | bgPixmap.x = bgPixmap.y = 50; |
… | |
… | |
666 | |
657 | |
667 | #ifdef HAVE_SCROLLBARS |
658 | #ifdef HAVE_SCROLLBARS |
668 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
659 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], |
669 | rs[Rs_scrollBar_thickness]); |
660 | rs[Rs_scrollBar_thickness]); |
670 | #endif |
661 | #endif |
671 | |
|
|
672 | TermWin.fontset = new rxvt_fontset (this); |
|
|
673 | TermWin.fontset->populate (rs[Rs_font]); |
|
|
674 | TermWin.fwidth = TermWin.fontset->base_font ()->width; |
|
|
675 | TermWin.fheight = TermWin.fontset->base_font ()->height; |
|
|
676 | TermWin.fbase = TermWin.fontset->base_font ()->ascent; |
|
|
677 | |
662 | |
678 | #ifdef XTERM_REVERSE_VIDEO |
663 | #ifdef XTERM_REVERSE_VIDEO |
679 | /* this is how xterm implements reverseVideo */ |
664 | /* this is how xterm implements reverseVideo */ |
680 | if (Options & Opt_reverseVideo) |
665 | if (Options & Opt_reverseVideo) |
681 | { |
666 | { |
… | |
… | |
805 | void |
790 | void |
806 | rxvt_term::set_locale (const char *locale) |
791 | rxvt_term::set_locale (const char *locale) |
807 | { |
792 | { |
808 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
793 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
809 | free (this->locale); |
794 | free (this->locale); |
810 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, "")); |
795 | this->locale = rxvt_strdup (setlocale (LC_CTYPE, locale)); |
811 | rxvt_set_locale (this->locale); |
796 | SET_LOCALE (this->locale); |
812 | mbstate.reset (); |
797 | mbstate.reset (); |
813 | #endif |
798 | #endif |
814 | #if HAVE_NL_LANGINFO |
799 | #if HAVE_NL_LANGINFO |
815 | free (codeset); |
800 | free (codeset); |
816 | codeset = strdup (nl_langinfo (CODESET)); |
801 | codeset = strdup (nl_langinfo (CODESET)); |
… | |
… | |
899 | if (menubar_visible ()) |
884 | if (menubar_visible ()) |
900 | { |
885 | { |
901 | PrivateModes |= PrivMode_menuBar; |
886 | PrivateModes |= PrivMode_menuBar; |
902 | SavedModes |= PrivMode_menuBar; |
887 | SavedModes |= PrivMode_menuBar; |
903 | } |
888 | } |
904 | |
|
|
905 | #ifdef GREEK_SUPPORT |
|
|
906 | greek_init (); |
|
|
907 | #endif |
|
|
908 | |
889 | |
909 | #ifdef CURSOR_BLINK |
890 | #ifdef CURSOR_BLINK |
910 | if (Options & Opt_cursorBlink) |
891 | if (Options & Opt_cursorBlink) |
911 | (void)gettimeofday (&lastcursorchange, NULL); |
892 | (void)gettimeofday (&lastcursorchange, NULL); |
912 | #endif |
893 | #endif |
… | |
… | |
1144 | } |
1125 | } |
1145 | |
1126 | |
1146 | /* grab colors before netscape does */ |
1127 | /* grab colors before netscape does */ |
1147 | Get_Colours (); |
1128 | Get_Colours (); |
1148 | |
1129 | |
1149 | 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 | |
1150 | window_calc (0, 0); |
1137 | window_calc (0, 0); |
1151 | old_width = szHint.width; |
1138 | old_width = szHint.width; |
1152 | old_height = szHint.height; |
1139 | old_height = szHint.height; |
1153 | |
1140 | |
1154 | /* parent window - reverse video so we can see placement errors |
1141 | /* parent window - reverse video so we can see placement errors |
… | |
… | |
1263 | PixColors[Color_scroll]); |
1250 | PixColors[Color_scroll]); |
1264 | #ifdef DEBUG_X |
1251 | #ifdef DEBUG_X |
1265 | XStoreName (display->display, menuBar.win, "menubar"); |
1252 | XStoreName (display->display, menuBar.win, "menubar"); |
1266 | #endif |
1253 | #endif |
1267 | |
1254 | |
1268 | XDefineCursor (display->display, menuBar.win, pointer_leftptr); |
1255 | XDefineCursor (display->display, menuBar.win, |
|
|
1256 | XCreateFontCursor (display->display, XC_left_ptr)); |
1269 | |
1257 | |
1270 | XSelectInput (display->display, menuBar.win, |
1258 | XSelectInput (display->display, menuBar.win, |
1271 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1259 | (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1272 | | Button1MotionMask)); |
1260 | | Button1MotionMask)); |
1273 | menubar_ev.start (display, menuBar.win); |
1261 | menubar_ev.start (display, menuBar.win); |