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.314 by sf-exg, Mon Jan 9 15:30:17 2012 UTC vs.
Revision 1.320 by sf-exg, Thu Jan 19 15:08:55 2012 UTC

38#include "init.h" 38#include "init.h"
39#include "keyboard.h" 39#include "keyboard.h"
40 40
41#include <limits> 41#include <limits>
42 42
43#include <csignal> 43#include <signal.h>
44 44
45#include <fcntl.h> 45#include <fcntl.h>
46 46
47#ifdef HAVE_XSETLOCALE 47#ifdef HAVE_XSETLOCALE
48# define X_LOCALE 48# define X_LOCALE
49# include <X11/Xlocale.h> 49# include <X11/Xlocale.h>
50#else 50#else
51# ifdef HAVE_SETLOCALE
52# include <clocale> 51# include <locale.h>
53# endif
54#endif 52#endif
55 53
56#ifdef HAVE_NL_LANGINFO 54#ifdef HAVE_NL_LANGINFO
57# include <langinfo.h> 55# include <langinfo.h>
58#endif 56#endif
852 850
853#if ENABLE_PERL 851#if ENABLE_PERL
854 rootwin_ev.start (display, display->root); 852 rootwin_ev.start (display, display->root);
855#endif 853#endif
856 854
857 set_colorfgbg (); 855 init_done = 1;
858 856
859 init_command (cmd_argv); 857 init_command (cmd_argv);
860 858
861 if (pty->pty >= 0) 859 if (pty->pty >= 0)
862 pty_ev.start (pty->pty, ev::READ); 860 pty_ev.start (pty->pty, ev::READ);
907void 905void
908rxvt_term::init_env () 906rxvt_term::init_env ()
909{ 907{
910 char *val; 908 char *val;
911 char *env_display; 909 char *env_display;
910 char *env_windowid;
911 char *env_colorfgbg;
912 char *env_term; 912 char *env_term;
913 913
914#ifdef DISPLAY_IS_IP 914#ifdef DISPLAY_IS_IP
915 /* Fixup display_name for export over pty to any interested terminal 915 /* Fixup display_name for export over pty to any interested terminal
916 * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number 916 * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number
934 934
935 env_display = (char *)rxvt_malloc (strlen (val) + 9); 935 env_display = (char *)rxvt_malloc (strlen (val) + 9);
936 936
937 sprintf (env_display, "DISPLAY=%s", val); 937 sprintf (env_display, "DISPLAY=%s", val);
938 938
939 env_windowid = (char *)rxvt_malloc (21);
939 sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent); 940 sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent);
940 941
941 /* add entries to the environment: 942 /* add entries to the environment:
942 * @ DISPLAY: in case we started with -display 943 * @ DISPLAY: in case we started with -display
943 * @ WINDOWID: X window id number of the window 944 * @ WINDOWID: X window id number of the window
947 * @ COLORFGBG: fg;bg color codes 948 * @ COLORFGBG: fg;bg color codes
948 */ 949 */
949 putenv (env_display); 950 putenv (env_display);
950 putenv (env_windowid); 951 putenv (env_windowid);
951 952
952 if (env_colorfgbg) 953 env_colorfgbg = get_colorfgbg ();
953 putenv (env_colorfgbg); 954 putenv (env_colorfgbg);
954 955
955#ifdef RXVT_TERMINFO 956#ifdef RXVT_TERMINFO
956 putenv ("TERMINFO=" RXVT_TERMINFO); 957 putenv ("TERMINFO=" RXVT_TERMINFO);
957#endif 958#endif
958 959
982void 983void
983rxvt_term::set_locale (const char *locale) 984rxvt_term::set_locale (const char *locale)
984{ 985{
985 set_environ (envv); 986 set_environ (envv);
986 987
987#if HAVE_XSETLOCALE || HAVE_SETLOCALE
988 free (this->locale); 988 free (this->locale);
989 this->locale = setlocale (LC_CTYPE, locale); 989 this->locale = setlocale (LC_CTYPE, locale);
990 990
991 if (!this->locale) 991 if (!this->locale)
992 { 992 {
1003 1003
1004 1004
1005 this->locale = strdup (this->locale); 1005 this->locale = strdup (this->locale);
1006 SET_LOCALE (this->locale); 1006 SET_LOCALE (this->locale);
1007 mbstate.reset (); 1007 mbstate.reset ();
1008#endif
1009 1008
1010#if HAVE_NL_LANGINFO 1009#if HAVE_NL_LANGINFO
1011 char *codeset = nl_langinfo (CODESET); 1010 char *codeset = nl_langinfo (CODESET);
1012 // /^UTF.?8/i 1011 // /^UTF.?8/i
1013 enc_utf8 = (codeset[0] == 'U' || codeset[0] == 'u') 1012 enc_utf8 = (codeset[0] == 'U' || codeset[0] == 'u')
1190/*----------------------------------------------------------------------*/ 1189/*----------------------------------------------------------------------*/
1191/* color aliases, fg/bg bright-bold */ 1190/* color aliases, fg/bg bright-bold */
1192void 1191void
1193rxvt_term::color_aliases (int idx) 1192rxvt_term::color_aliases (int idx)
1194{ 1193{
1195 if (rs[Rs_color + idx] && isdigit (* (rs[Rs_color + idx]))) 1194 if (rs[Rs_color + idx] && isdigit (*rs[Rs_color + idx]))
1196 { 1195 {
1197 int i = atoi (rs[Rs_color + idx]); 1196 int i = atoi (rs[Rs_color + idx]);
1198 1197
1199 if (i >= 8 && i <= 15) 1198 if (i >= 8 && i <= 15)
1200 /* bright colors */ 1199 /* bright colors */
1547 TermWin_cursor = XCreateFontCursor (dpy, XC_xterm); 1546 TermWin_cursor = XCreateFontCursor (dpy, XC_xterm);
1548 1547
1549 /* the vt window */ 1548 /* the vt window */
1550 vt = XCreateSimpleWindow (dpy, top, 1549 vt = XCreateSimpleWindow (dpy, top,
1551 window_vt_x, window_vt_y, 1550 window_vt_x, window_vt_y,
1552 width, height, 1551 vt_width, vt_height,
1553 0, 1552 0,
1554 pix_colors_focused[Color_fg], 1553 pix_colors_focused[Color_fg],
1555 pix_colors_focused[Color_bg]); 1554 pix_colors_focused[Color_bg]);
1556 1555
1557 attributes.bit_gravity = NorthWestGravity; 1556 attributes.bit_gravity = NorthWestGravity;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines