ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/init.C
(Generate patch)

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.26 by pcg, Fri Feb 13 12:16:21 2004 UTC vs.
Revision 1.32 by pcg, Sun Feb 22 08:28:36 2004 UTC

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 407#ifdef MULTICHAR_SET
411# ifdef MULTICHAR_ENCODING 408# ifdef MULTICHAR_ENCODING
666 663
667#ifdef HAVE_SCROLLBARS 664#ifdef HAVE_SCROLLBARS
668 setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], 665 setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle],
669 rs[Rs_scrollBar_thickness]); 666 rs[Rs_scrollBar_thickness]);
670#endif 667#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 668
678#ifdef XTERM_REVERSE_VIDEO 669#ifdef XTERM_REVERSE_VIDEO
679 /* this is how xterm implements reverseVideo */ 670 /* this is how xterm implements reverseVideo */
680 if (Options & Opt_reverseVideo) 671 if (Options & Opt_reverseVideo)
681 { 672 {
762 * @ DISPLAY: in case we started with -display 753 * @ DISPLAY: in case we started with -display
763 * @ WINDOWID: X window id number of the window 754 * @ WINDOWID: X window id number of the window
764 * @ COLORTERM: terminal sub-name and also indicates its color 755 * @ COLORTERM: terminal sub-name and also indicates its color
765 * @ TERM: terminal name 756 * @ TERM: terminal name
766 * @ TERMINFO: path to terminfo directory 757 * @ TERMINFO: path to terminfo directory
758 * @ COLORFGBG: fg;bg color codes
767 */ 759 */
768 putenv (env_display); 760 putenv (env_display);
769 putenv (env_windowid); 761 putenv (env_windowid);
762 if (env_colorfgbg)
763 putenv (env_colorfgbg);
770 764
771#ifdef RXVT_TERMINFO 765#ifdef RXVT_TERMINFO
772 putenv ("TERMINFO=" RXVT_TERMINFO); 766 putenv ("TERMINFO=" RXVT_TERMINFO);
773#endif 767#endif
774 768
803rxvt_term::set_locale (const char *locale) 797rxvt_term::set_locale (const char *locale)
804{ 798{
805#if HAVE_XSETLOCALE || HAVE_SETLOCALE 799#if HAVE_XSETLOCALE || HAVE_SETLOCALE
806 free (this->locale); 800 free (this->locale);
807 this->locale = rxvt_strdup (setlocale (LC_CTYPE, "")); 801 this->locale = rxvt_strdup (setlocale (LC_CTYPE, ""));
802 SET_LOCALE (this->locale);
803 mbstate.reset ();
808#endif 804#endif
809#if HAVE_NL_LANGINFO 805#if HAVE_NL_LANGINFO
810 free (codeset); 806 free (codeset);
811 codeset = strdup (nl_langinfo (CODESET)); 807 codeset = strdup (nl_langinfo (CODESET));
812 enc_utf8 = !STRCASECMP (codeset, "UTF-8") 808 enc_utf8 = !STRCASECMP (codeset, "UTF-8")
894 if (menubar_visible ()) 890 if (menubar_visible ())
895 { 891 {
896 PrivateModes |= PrivMode_menuBar; 892 PrivateModes |= PrivMode_menuBar;
897 SavedModes |= PrivMode_menuBar; 893 SavedModes |= PrivMode_menuBar;
898 } 894 }
899
900#ifdef GREEK_SUPPORT
901 greek_init ();
902#endif
903 895
904#ifdef CURSOR_BLINK 896#ifdef CURSOR_BLINK
905 if (Options & Opt_cursorBlink) 897 if (Options & Opt_cursorBlink)
906 (void)gettimeofday (&lastcursorchange, NULL); 898 (void)gettimeofday (&lastcursorchange, NULL);
907#endif 899#endif
1139 } 1131 }
1140 1132
1141 /* grab colors before netscape does */ 1133 /* grab colors before netscape does */
1142 Get_Colours (); 1134 Get_Colours ();
1143 1135
1144 change_font (1, NULL); 1136 if (!change_font (rs[Rs_font]))
1137 {
1138 fprintf (stderr, "unable to load a base font, please provide one using -fn fontname\n");
1139 destroy ();
1140 return;
1141 }
1142
1145 window_calc (0, 0); 1143 window_calc (0, 0);
1146 old_width = szHint.width; 1144 old_width = szHint.width;
1147 old_height = szHint.height; 1145 old_height = szHint.height;
1148 1146
1149 /* parent window - reverse video so we can see placement errors 1147 /* parent window - reverse video so we can see placement errors
1361 rxvt_print_error ("can't fork"); 1359 rxvt_print_error ("can't fork");
1362 return -1; 1360 return -1;
1363 case 0: 1361 case 0:
1364 close (cfd); /* only keep tty_fd and STDERR open */ 1362 close (cfd); /* only keep tty_fd and STDERR open */
1365 1363
1364 init_env ();
1365
1366 if (rxvt_control_tty (tty_fd, ttydev) < 0) 1366 if (rxvt_control_tty (tty_fd, ttydev) < 0)
1367 rxvt_print_error ("could not obtain control of tty"); 1367 rxvt_print_error ("could not obtain control of tty");
1368 else 1368 else
1369 { 1369 {
1370 /* Reopen stdin, stdout and stderr over the tty file descriptor */ 1370 /* Reopen stdin, stdout and stderr over the tty file descriptor */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines