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.245 by ayin, Sun Jan 27 16:52:13 2008 UTC vs.
Revision 1.254 by root, Tue Nov 4 11:03:29 2008 UTC

267 NULL, // Color_underline 267 NULL, // Color_underline
268#endif 268#endif
269#ifdef OPTION_HC 269#ifdef OPTION_HC
270 NULL, 270 NULL,
271#endif 271#endif
272#ifdef HAVE_SCROLLBARS
273 COLOR_SCROLLBAR, 272 COLOR_SCROLLBAR,
274#endif
275#ifdef RXVT_SCROLLBAR 273#ifdef RXVT_SCROLLBAR
276 COLOR_SCROLLTROUGH, 274 COLOR_SCROLLTROUGH,
277#endif 275#endif
278#if ENABLE_TRANSPARENCY 276#if ENABLE_TRANSPARENCY
279 NULL, 277 NULL,
461 459
462 /* no point having a scrollbar without having any scrollback! */ 460 /* no point having a scrollbar without having any scrollback! */
463 if (!saveLines) 461 if (!saveLines)
464 set_option (Opt_scrollBar, 0); 462 set_option (Opt_scrollBar, 0);
465 463
466#ifdef PRINTPIPE
467 if (!rs[Rs_print_pipe])
468 rs[Rs_print_pipe] = PRINTPIPE;
469#endif
470
471 if (!rs[Rs_cutchars]) 464 if (!rs[Rs_cutchars])
472 rs[Rs_cutchars] = CUTCHARS; 465 rs[Rs_cutchars] = CUTCHARS;
473 466
474#ifndef NO_BACKSPACE_KEY 467#ifndef NO_BACKSPACE_KEY
475 if (!rs[Rs_backspace_key]) 468 if (!rs[Rs_backspace_key])
487# else 480# else
488 rs[Rs_delete_key] = "\033[3~"; 481 rs[Rs_delete_key] = "\033[3~";
489# endif 482# endif
490#endif 483#endif
491 484
492#ifdef HAVE_SCROLLBARS 485 scrollBar.setup (this);
493 setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]);
494#endif
495 486
496#ifdef XTERM_REVERSE_VIDEO 487#ifdef XTERM_REVERSE_VIDEO
497 /* this is how xterm implements reverseVideo */ 488 /* this is how xterm implements reverseVideo */
498 if (option (Opt_reverseVideo)) 489 if (option (Opt_reverseVideo))
499 { 490 {
543{ 534{
544 this->envv = envv; 535 this->envv = envv;
545 536
546 SET_R (this); 537 SET_R (this);
547 set_locale (""); 538 set_locale ("");
548 set_environ (envv); // few things in X do not call setlocale :( 539 set_environ (envv); // a few things in X do not call setlocale :(
549 540
550 init_vars (); 541 init_vars ();
551 542
552 init_secondary (); 543 init_secondary ();
553 544
555 546
556#ifdef KEYSYM_RESOURCE 547#ifdef KEYSYM_RESOURCE
557 keyboard->register_done (); 548 keyboard->register_done ();
558#endif 549#endif
559 550
560#ifdef HAVE_SCROLLBARS 551 if (const char *path = rs[Rs_chdir])
552 if (*path) // ignored if empty
553 {
554 if (*path != '/')
555 rxvt_fatal ("specified shell working directory must start with a slash, aborting.\n");
556
557 if (chdir (path))
558 rxvt_fatal ("unable to change into specified shell working directory, aborting.\n");
559 }
560
561 if (option (Opt_scrollBar)) 561 if (option (Opt_scrollBar))
562 scrollBar.setIdle (); /* set existence for size calculations */ 562 scrollBar.state = STATE_IDLE; /* set existence for size calculations */
563#endif
564 563
565 pty = ptytty::create (); 564 pty = ptytty::create ();
566 565
567 create_windows (argc, argv); 566 create_windows (argc, argv);
568 567
572 571
573#if 0 572#if 0
574 XSynchronize (dpy, True); 573 XSynchronize (dpy, True);
575#endif 574#endif
576 575
577#ifdef HAVE_SCROLLBARS
578 if (option (Opt_scrollBar)) 576 if (option (Opt_scrollBar))
579 resize_scrollbar (); /* create and map scrollbar */ 577 scrollBar.resize (); /* create and map scrollbar */
580#endif
581#ifdef HAVE_BG_PIXMAP 578#ifdef HAVE_BG_PIXMAP
582 { 579 {
583 bgPixmap.set_target (this); 580 bgPixmap.set_target (this);
584 bgPixmap.invalidate (); 581 bgPixmap.invalidate ();
585 582
840 run_command (argv); 837 run_command (argv);
841} 838}
842 839
843/*----------------------------------------------------------------------*/ 840/*----------------------------------------------------------------------*/
844void 841void
845rxvt_term::Get_Colours () 842rxvt_term::get_colours ()
846{ 843{
847 int i; 844 int i;
848 845
849#ifdef OFF_FOCUS_FADING 846#ifdef OFF_FOCUS_FADING
850 pix_colors = pix_colors_focused; 847 pix_colors = pix_colors_focused;
1067 Window top, parent; 1064 Window top, parent;
1068 1065
1069 dLocal (Display *, dpy); 1066 dLocal (Display *, dpy);
1070 1067
1071 /* grab colors before netscape does */ 1068 /* grab colors before netscape does */
1072 Get_Colours (); 1069 get_colours ();
1073 1070
1074 if (!set_fonts ()) 1071 if (!set_fonts ())
1075 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); 1072 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n");
1076 1073
1077 parent = display->root; 1074 parent = display->root;
1138 wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState; 1135 wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState;
1139 wmHint.window_group = top; 1136 wmHint.window_group = top;
1140 1137
1141 XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc, 1138 XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc,
1142 &szHint, &wmHint, &classHint); 1139 &szHint, &wmHint, &classHint);
1140#if ENABLE_EWMH
1141# ifdef HAVE_AFTERIMAGE
1142 /*
1143 * set up icon hint
1144 * rs [Rs_iconfile] is path to icon, asv has been created in init_resources
1145 */
1146 if (rs [Rs_iconfile] && asv)
1147 {
1148 ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL);
1149 if (im)
1150 {
1151 int w = im->width;
1152 int h = im->height;
1153 long* buffer = (long *)malloc ((2 + w * h) * sizeof (long));
1154 ASImage *result = scale_asimage (asv, im,
1155 w, h, ASA_ARGB32,
1156 100, ASIMAGE_QUALITY_DEFAULT);
1157 destroy_asimage (&im);
1158
1159 if (buffer && result)
1160 {
1161 ARGB32 *asbuf = result->alt.argb32;
1162 buffer [0] = w;
1163 buffer [1] = h;
1164
1165 for (unsigned int i = 0; i < w * h; ++i)
1166 buffer [i + 2] = asbuf [i];
1167
1168 destroy_asimage (&result);
1169 XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1170 PropModeReplace, (const unsigned char*) buffer, 2 + w * h);
1171 free (buffer);
1172 }
1173 else
1174 {
1175 if (!buffer)
1176 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n");
1177
1178 if (!result)
1179 rxvt_warn ("Icon image transformation to ARGB failed, continuing without.\n");
1180 }
1181 }
1182 else
1183 rxvt_warn ("Loading image icon failed, continuing without.\n");
1184 }
1185# endif
1186#endif
1143 1187
1144#if ENABLE_FRILLS 1188#if ENABLE_FRILLS
1145 if (mwmhints.flags) 1189 if (mwmhints.flags)
1146 XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, 1190 XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32,
1147 PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); 1191 PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS);
1532 signal (SIGTSTP, SIG_IGN); 1576 signal (SIGTSTP, SIG_IGN);
1533 signal (SIGTTIN, SIG_IGN); 1577 signal (SIGTTIN, SIG_IGN);
1534 signal (SIGTTOU, SIG_IGN); 1578 signal (SIGTTOU, SIG_IGN);
1535#endif /* SIGTSTP */ 1579#endif /* SIGTSTP */
1536 1580
1537 // unblock signals (signals are blocked by iom.C
1538 sigset_t ss;
1539 sigemptyset (&ss);
1540 sigprocmask (SIG_SETMASK, &ss, 0);
1541
1542 /* command interpreter path */ 1581 /* command interpreter path */
1543 if (argv) 1582 if (argv)
1544 { 1583 {
1545# ifdef DEBUG_CMD 1584# ifdef DEBUG_CMD
1546 int i; 1585 int i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines