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.138 by root, Wed Jan 11 02:24:12 2006 UTC vs.
Revision 1.143 by root, Mon Jan 16 15:00:20 2006 UTC

256 bgPixmap.pixmap = None; 256 bgPixmap.pixmap = None;
257#endif 257#endif
258 258
259 last_bot = last_state = -1; 259 last_bot = last_state = -1;
260 260
261#ifdef MENUBAR
262 menu_readonly = 1;
263# if ! (MENUBAR_MAX > 1)
264 CurrentBar = &BarList;
265# endif /* (MENUBAR_MAX > 1) */
266#endif
267
268 return true; 261 return true;
269} 262}
270 263
271void 264void
272rxvt_term::init_secondary () 265rxvt_term::init_secondary ()
339 rs[Rs_name] = rxvt_r_basename (argv[0]); 332 rs[Rs_name] = rxvt_r_basename (argv[0]);
340 333
341 /* 334 /*
342 * Open display, get options/resources and create the window 335 * Open display, get options/resources and create the window
343 */ 336 */
344 {
345 TEMP_ENV;
346 337
347 if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) 338 if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL)
348 rs[Rs_display_name] = ":0"; 339 rs[Rs_display_name] = ":0";
349 340
350 get_options (r_argc, r_argv); 341 get_options (r_argc, r_argv);
351 342
352 if (!(display = displays.get (rs[Rs_display_name]))) 343 if (!(display = displays.get (rs[Rs_display_name])))
353 rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); 344 rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]);
354 }
355 345
356 extract_resources (); 346 extract_resources ();
347
357 free (r_argv); 348 free (r_argv);
358 349
359 /* 350 /*
360 * set any defaults not already set 351 * set any defaults not already set
361 */ 352 */
580 * This should support all European type languages. 571 * This should support all European type languages.
581 */ 572 */
582void 573void
583rxvt_term::set_locale (const char *locale) 574rxvt_term::set_locale (const char *locale)
584{ 575{
585 TEMP_ENV; 576 set_environ (envv);
586 577
587#if HAVE_XSETLOCALE || HAVE_SETLOCALE 578#if HAVE_XSETLOCALE || HAVE_SETLOCALE
588 free (this->locale); 579 free (this->locale);
589 this->locale = setlocale (LC_CTYPE, locale); 580 this->locale = setlocale (LC_CTYPE, locale);
590 581
621} 612}
622 613
623void 614void
624rxvt_term::init_xlocale () 615rxvt_term::init_xlocale ()
625{ 616{
626 TEMP_ENV; 617 set_environ (envv);
627 618
628#ifdef USE_XIM 619#ifdef USE_XIM
629 if (!locale) 620 if (!locale)
630 rxvt_warn ("setting locale failed, working without locale support.\n"); 621 rxvt_warn ("setting locale failed, working without locale support.\n");
631 else 622 else
672 if (strcmp (key_backspace, "DEC") == 0) 663 if (strcmp (key_backspace, "DEC") == 0)
673 priv_modes |= PrivMode_HaveBackSpace; 664 priv_modes |= PrivMode_HaveBackSpace;
674#endif 665#endif
675 666
676 /* add value for scrollBar */ 667 /* add value for scrollBar */
677 if (scrollbar_visible ()) 668 if (scrollBar.state)
678 { 669 {
679 priv_modes |= PrivMode_scrollBar; 670 priv_modes |= PrivMode_scrollBar;
680 SavedModes |= PrivMode_scrollBar; 671 SavedModes |= PrivMode_scrollBar;
681 }
682
683 if (menubar_visible ())
684 {
685 priv_modes |= PrivMode_menuBar;
686 SavedModes |= PrivMode_menuBar;
687 } 672 }
688 673
689 run_command (argv); 674 run_command (argv);
690} 675}
691 676
759 if (!rs[Rs_color + Color_pointer_bg]) pix_colors[Color_pointer_bg] = pix_colors[Color_bg]; 744 if (!rs[Rs_color + Color_pointer_bg]) pix_colors[Color_pointer_bg] = pix_colors[Color_bg];
760 if (!rs[Rs_color + Color_border] ) pix_colors[Color_border] = pix_colors[Color_fg]; 745 if (!rs[Rs_color + Color_border] ) pix_colors[Color_border] = pix_colors[Color_fg];
761 } 746 }
762 747
763 /* 748 /*
764 * get scrollBar/menuBar shadow colors 749 * get scrollBar shadow colors
765 * 750 *
766 * The calculations of topShadow/bottomShadow values are adapted 751 * The calculations of topShadow/bottomShadow values are adapted
767 * from the fvwm window manager. 752 * from the fvwm window manager.
768 */ 753 */
769#ifdef KEEP_SCROLLCOLOR 754#ifdef KEEP_SCROLLCOLOR
924#if ENABLE_FRILLS 909#if ENABLE_FRILLS
925 Atom prop = None; 910 Atom prop = None;
926 MWMHints mwmhints; 911 MWMHints mwmhints;
927#endif 912#endif
928 XGCValues gcvalue; 913 XGCValues gcvalue;
929 long vt_emask;
930 XSetWindowAttributes attributes; 914 XSetWindowAttributes attributes;
931 XWindowAttributes gattr; 915 XWindowAttributes gattr;
932 Window top, parent; 916 Window top, parent;
933 dDisp; 917 dDisp;
934 918
1074#endif 1058#endif
1075 1059
1076 /* vt cursor: Black-on-White is standard, but this is more popular */ 1060 /* vt cursor: Black-on-White is standard, but this is more popular */
1077 TermWin_cursor = XCreateFontCursor (disp, XC_xterm); 1061 TermWin_cursor = XCreateFontCursor (disp, XC_xterm);
1078 1062
1079#if defined(HAVE_SCROLLBARS) || defined(MENUBAR) 1063#ifdef HAVE_SCROLLBARS
1080 /* cursor (menuBar/scrollBar): Black-on-White */ 1064 /* cursor scrollBar: Black-on-White */
1081 leftptr_cursor = XCreateFontCursor (disp, XC_left_ptr); 1065 leftptr_cursor = XCreateFontCursor (disp, XC_left_ptr);
1082#endif 1066#endif
1083 1067
1084 /* the vt window */ 1068 /* the vt window */
1085 vt = XCreateSimpleWindow (disp, top, 1069 vt = XCreateSimpleWindow (disp, top,
1097 attributes.bit_gravity = NorthWestGravity; 1081 attributes.bit_gravity = NorthWestGravity;
1098 XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes); 1082 XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes);
1099 1083
1100 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; 1084 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
1101 1085
1102 if (OPTION (Opt_pointerBlank) 1086 if (OPTION (Opt_pointerBlank))
1103#ifdef ENABLE_PERL
1104 || perl.self
1105#endif
1106 )
1107 vt_emask |= PointerMotionMask; 1087 vt_emask |= PointerMotionMask;
1108 else 1088 else
1109 vt_emask |= Button1MotionMask | Button3MotionMask; 1089 vt_emask |= Button1MotionMask | Button3MotionMask;
1110 1090
1111 XSelectInput (disp, vt, vt_emask); 1091 vt_select_input ();
1092
1112 vt_ev.start (display, vt); 1093 vt_ev.start (display, vt);
1113
1114#if defined(MENUBAR) && (MENUBAR_MAX > 1)
1115 if (menuBar_height ())
1116 {
1117 menuBar.win = XCreateSimpleWindow (disp, top,
1118 window_vt_x, 0,
1119 width,
1120 menuBar_TotalHeight (),
1121 0,
1122 pix_colors_focused[Color_fg],
1123 pix_colors_focused[Color_scroll]);
1124
1125#ifdef DEBUG_X
1126 XStoreName (disp, menuBar.win, "menubar");
1127#endif
1128
1129 menuBar.drawable = new rxvt_drawable (display, menuBar.win);
1130
1131 XDefineCursor (disp, menuBar.win,
1132 XCreateFontCursor (disp, XC_left_ptr));
1133
1134 XSelectInput (disp, menuBar.win,
1135 (ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask));
1136 menubar_ev.start (display, menuBar.win);
1137 }
1138#endif
1139 1094
1140#ifdef XPM_BACKGROUND 1095#ifdef XPM_BACKGROUND
1141 if (rs[Rs_backgroundPixmap] != NULL 1096 if (rs[Rs_backgroundPixmap] != NULL
1142 && ! OPTION (Opt_transparent)) 1097 && ! OPTION (Opt_transparent))
1143 { 1098 {
1162 GCForeground | GCBackground | GCGraphicsExposures, 1117 GCForeground | GCBackground | GCGraphicsExposures,
1163 &gcvalue); 1118 &gcvalue);
1164 1119
1165 drawable = new rxvt_drawable (display, vt); 1120 drawable = new rxvt_drawable (display, vt);
1166 1121
1167#if defined(MENUBAR) || defined(RXVT_SCROLLBAR) 1122#ifdef RXVT_SCROLLBAR
1168 gcvalue.foreground = pix_colors[Color_topShadow]; 1123 gcvalue.foreground = pix_colors[Color_topShadow];
1169 topShadowGC = XCreateGC (disp, vt, GCForeground, &gcvalue); 1124 topShadowGC = XCreateGC (disp, vt, GCForeground, &gcvalue);
1170 gcvalue.foreground = pix_colors[Color_bottomShadow]; 1125 gcvalue.foreground = pix_colors[Color_bottomShadow];
1171 botShadowGC = XCreateGC (disp, vt, GCForeground, &gcvalue); 1126 botShadowGC = XCreateGC (disp, vt, GCForeground, &gcvalue);
1172 gcvalue.foreground = pix_colors[ (display->depth <= 2 ? Color_fg : Color_scroll)]; 1127 gcvalue.foreground = pix_colors[ (display->depth <= 2 ? Color_fg : Color_scroll)];
1412 * the slave. 1367 * the slave.
1413 */ 1368 */
1414void 1369void
1415rxvt_term::run_command (const char *const *argv) 1370rxvt_term::run_command (const char *const *argv)
1416{ 1371{
1417 TEMP_ENV; // not very temporary...
1418
1419#if ENABLE_FRILLS 1372#if ENABLE_FRILLS
1420 if (rs[Rs_pty_fd]) 1373 if (rs[Rs_pty_fd])
1421 { 1374 {
1422 pty.pty = atoi (rs[Rs_pty_fd]); 1375 pty.pty = atoi (rs[Rs_pty_fd]);
1423 1376

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines