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.34 by pcg, Tue Feb 24 00:02:44 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
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 {
762 * @ DISPLAY: in case we started with -display 747 * @ DISPLAY: in case we started with -display
763 * @ WINDOWID: X window id number of the window 748 * @ WINDOWID: X window id number of the window
764 * @ COLORTERM: terminal sub-name and also indicates its color 749 * @ COLORTERM: terminal sub-name and also indicates its color
765 * @ TERM: terminal name 750 * @ TERM: terminal name
766 * @ TERMINFO: path to terminfo directory 751 * @ TERMINFO: path to terminfo directory
752 * @ COLORFGBG: fg;bg color codes
767 */ 753 */
768 putenv (env_display); 754 putenv (env_display);
769 putenv (env_windowid); 755 putenv (env_windowid);
756 if (env_colorfgbg)
757 putenv (env_colorfgbg);
770 758
771#ifdef RXVT_TERMINFO 759#ifdef RXVT_TERMINFO
772 putenv ("TERMINFO=" RXVT_TERMINFO); 760 putenv ("TERMINFO=" RXVT_TERMINFO);
773#endif 761#endif
774 762
802void 790void
803rxvt_term::set_locale (const char *locale) 791rxvt_term::set_locale (const char *locale)
804{ 792{
805#if HAVE_XSETLOCALE || HAVE_SETLOCALE 793#if HAVE_XSETLOCALE || HAVE_SETLOCALE
806 free (this->locale); 794 free (this->locale);
807 this->locale = rxvt_strdup (setlocale (LC_CTYPE, "")); 795 this->locale = rxvt_strdup (setlocale (LC_CTYPE, locale));
796 SET_LOCALE (this->locale);
797 mbstate.reset ();
808#endif 798#endif
809#if HAVE_NL_LANGINFO 799#if HAVE_NL_LANGINFO
810 free (codeset); 800 free (codeset);
811 codeset = strdup (nl_langinfo (CODESET)); 801 codeset = strdup (nl_langinfo (CODESET));
812 enc_utf8 = !STRCASECMP (codeset, "UTF-8") 802 enc_utf8 = !STRCASECMP (codeset, "UTF-8")
894 if (menubar_visible ()) 884 if (menubar_visible ())
895 { 885 {
896 PrivateModes |= PrivMode_menuBar; 886 PrivateModes |= PrivMode_menuBar;
897 SavedModes |= PrivMode_menuBar; 887 SavedModes |= PrivMode_menuBar;
898 } 888 }
899
900#ifdef GREEK_SUPPORT
901 greek_init ();
902#endif
903 889
904#ifdef CURSOR_BLINK 890#ifdef CURSOR_BLINK
905 if (Options & Opt_cursorBlink) 891 if (Options & Opt_cursorBlink)
906 (void)gettimeofday (&lastcursorchange, NULL); 892 (void)gettimeofday (&lastcursorchange, NULL);
907#endif 893#endif
1139 } 1125 }
1140 1126
1141 /* grab colors before netscape does */ 1127 /* grab colors before netscape does */
1142 Get_Colours (); 1128 Get_Colours ();
1143 1129
1144 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
1145 window_calc (0, 0); 1137 window_calc (0, 0);
1146 old_width = szHint.width; 1138 old_width = szHint.width;
1147 old_height = szHint.height; 1139 old_height = szHint.height;
1148 1140
1149 /* parent window - reverse video so we can see placement errors 1141 /* parent window - reverse video so we can see placement errors
1258 PixColors[Color_scroll]); 1250 PixColors[Color_scroll]);
1259#ifdef DEBUG_X 1251#ifdef DEBUG_X
1260 XStoreName (display->display, menuBar.win, "menubar"); 1252 XStoreName (display->display, menuBar.win, "menubar");
1261#endif 1253#endif
1262 1254
1263 XDefineCursor (display->display, menuBar.win, pointer_leftptr); 1255 XDefineCursor (display->display, menuBar.win,
1256 XCreateFontCursor (display->display, XC_left_ptr));
1264 1257
1265 XSelectInput (display->display, menuBar.win, 1258 XSelectInput (display->display, menuBar.win,
1266 (ExposureMask | ButtonPressMask | ButtonReleaseMask 1259 (ExposureMask | ButtonPressMask | ButtonReleaseMask
1267 | Button1MotionMask)); 1260 | Button1MotionMask));
1268 menubar_ev.start (display, menuBar.win); 1261 menubar_ev.start (display, menuBar.win);
1360 case -1: 1353 case -1:
1361 rxvt_print_error ("can't fork"); 1354 rxvt_print_error ("can't fork");
1362 return -1; 1355 return -1;
1363 case 0: 1356 case 0:
1364 close (cfd); /* only keep tty_fd and STDERR open */ 1357 close (cfd); /* only keep tty_fd and STDERR open */
1358
1359 init_env ();
1365 1360
1366 if (rxvt_control_tty (tty_fd, ttydev) < 0) 1361 if (rxvt_control_tty (tty_fd, ttydev) < 0)
1367 rxvt_print_error ("could not obtain control of tty"); 1362 rxvt_print_error ("could not obtain control of tty");
1368 else 1363 else
1369 { 1364 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines