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.252 by root, Sun Jun 15 13:54:15 2008 UTC vs.
Revision 1.256 by root, Wed Nov 5 12:28:15 2008 UTC

392#if XFT 392#if XFT
393 if (rs[Rs_depth]) 393 if (rs[Rs_depth])
394 select_visual (strtol (rs[Rs_depth], 0, 0)); 394 select_visual (strtol (rs[Rs_depth], 0, 0));
395#endif 395#endif
396 396
397#ifdef HAVE_AFTERIMAGE
398 set_application_name ((char*)rs[Rs_name]);
399 set_output_threshold (OUTPUT_LEVEL_WARNING);
400 asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL);
401#endif
402 free (r_argv); 397 free (r_argv);
403 398
404 for (int i = NUM_RESOURCES; i--; ) 399 for (int i = NUM_RESOURCES; i--; )
405 if (rs [i] == resval_undef) 400 if (rs [i] == resval_undef)
406 rs [i] = 0; 401 rs [i] = 0;
402
403#ifdef HAVE_AFTERIMAGE
404 set_application_name ((char *)rs[Rs_name]);
405 set_output_threshold (OUTPUT_LEVEL_WARNING);
406#endif
407 407
408#if ENABLE_PERL 408#if ENABLE_PERL
409 if (!rs[Rs_perl_ext_1]) 409 if (!rs[Rs_perl_ext_1])
410 rs[Rs_perl_ext_1] = "default"; 410 rs[Rs_perl_ext_1] = "default";
411 411
423 */ 423 */
424 if (cmd_argv && cmd_argv[0]) 424 if (cmd_argv && cmd_argv[0])
425 { 425 {
426 if (!rs[Rs_title]) 426 if (!rs[Rs_title])
427 rs[Rs_title] = rxvt_basename (cmd_argv[0]); 427 rs[Rs_title] = rxvt_basename (cmd_argv[0]);
428
428 if (!rs[Rs_iconName]) 429 if (!rs[Rs_iconName])
429 rs[Rs_iconName] = rs[Rs_title]; 430 rs[Rs_iconName] = rs[Rs_title];
430 } 431 }
431 else 432 else
432 { 433 {
433 if (!rs[Rs_title]) 434 if (!rs[Rs_title])
434 rs[Rs_title] = rs[Rs_name]; 435 rs[Rs_title] = rs[Rs_name];
436
435 if (!rs[Rs_iconName]) 437 if (!rs[Rs_iconName])
436 rs[Rs_iconName] = rs[Rs_name]; 438 rs[Rs_iconName] = rs[Rs_name];
437 } 439 }
438 440
439 if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0) 441 if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0)
458#endif 460#endif
459 461
460 /* no point having a scrollbar without having any scrollback! */ 462 /* no point having a scrollbar without having any scrollback! */
461 if (!saveLines) 463 if (!saveLines)
462 set_option (Opt_scrollBar, 0); 464 set_option (Opt_scrollBar, 0);
463
464#ifdef PRINTPIPE
465 if (!rs[Rs_print_pipe])
466 rs[Rs_print_pipe] = PRINTPIPE;
467#endif
468 465
469 if (!rs[Rs_cutchars]) 466 if (!rs[Rs_cutchars])
470 rs[Rs_cutchars] = CUTCHARS; 467 rs[Rs_cutchars] = CUTCHARS;
471 468
472#ifndef NO_BACKSPACE_KEY 469#ifndef NO_BACKSPACE_KEY
570 567
571 create_windows (argc, argv); 568 create_windows (argc, argv);
572 569
573 init_xlocale (); 570 init_xlocale ();
574 571
575 scr_reset (); // initialize screen 572 scr_poweron (); // initialize screen
576 573
577#if 0 574#if 0
578 XSynchronize (dpy, True); 575 XSynchronize (dpy, True);
579#endif 576#endif
580 577
1140 wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState; 1137 wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState;
1141 wmHint.window_group = top; 1138 wmHint.window_group = top;
1142 1139
1143 XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc, 1140 XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc,
1144 &szHint, &wmHint, &classHint); 1141 &szHint, &wmHint, &classHint);
1142#if ENABLE_EWMH
1143# ifdef HAVE_AFTERIMAGE
1144 /*
1145 * set up icon hint
1146 * rs [Rs_iconfile] is path to icon, asv has been created in init_resources
1147 */
1148
1149 if (rs [Rs_iconfile])
1150 {
1151 init_asv ();
1152
1153 ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL);
1154 if (asv && im)
1155 {
1156 int w = im->width;
1157 int h = im->height;
1158 long* buffer = (long *)malloc ((2 + w * h) * sizeof (long));
1159 ASImage *result = scale_asimage (asv, im,
1160 w, h, ASA_ARGB32,
1161 100, ASIMAGE_QUALITY_DEFAULT);
1162 destroy_asimage (&im);
1163
1164 if (buffer && result)
1165 {
1166 ARGB32 *asbuf = result->alt.argb32;
1167 buffer [0] = w;
1168 buffer [1] = h;
1169
1170 for (unsigned int i = 0; i < w * h; ++i)
1171 buffer [i + 2] = asbuf [i];
1172
1173 destroy_asimage (&result);
1174 XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1175 PropModeReplace, (const unsigned char*) buffer, 2 + w * h);
1176 free (buffer);
1177 }
1178 else
1179 {
1180 if (!buffer)
1181 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n");
1182
1183 if (!result)
1184 rxvt_warn ("Icon image transformation to ARGB failed, continuing without.\n");
1185 }
1186 }
1187 else
1188 rxvt_warn ("Loading image icon failed, continuing without.\n");
1189 }
1190# endif
1191#endif
1145 1192
1146#if ENABLE_FRILLS 1193#if ENABLE_FRILLS
1147 if (mwmhints.flags) 1194 if (mwmhints.flags)
1148 XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, 1195 XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32,
1149 PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); 1196 PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines