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.254 by root, Tue Nov 4 11:03:29 2008 UTC vs.
Revision 1.257 by root, Sun Apr 26 01:51:20 2009 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)
565 567
566 create_windows (argc, argv); 568 create_windows (argc, argv);
567 569
568 init_xlocale (); 570 init_xlocale ();
569 571
570 scr_reset (); // initialize screen 572 scr_poweron (); // initialize screen
571 573
572#if 0 574#if 0
573 XSynchronize (dpy, True); 575 XSynchronize (dpy, True);
574#endif 576#endif
575 577
1122 this->parent[0] = top; 1124 this->parent[0] = top;
1123 1125
1124 old_width = szHint.width; 1126 old_width = szHint.width;
1125 old_height = szHint.height; 1127 old_height = szHint.height;
1126 1128
1127 process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); 1129 set_title (rs [Rs_title]);
1128 process_xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); 1130 set_icon_name (rs [Rs_iconName]);
1129 1131
1130 classHint.res_name = (char *)rs[Rs_name]; 1132 classHint.res_name = (char *)rs[Rs_name];
1131 classHint.res_class = (char *)RESCLASS; 1133 classHint.res_class = (char *)RESCLASS;
1132 1134
1133 wmHint.flags = InputHint | StateHint | WindowGroupHint; 1135 wmHint.flags = InputHint | StateHint | WindowGroupHint;
1141# ifdef HAVE_AFTERIMAGE 1143# ifdef HAVE_AFTERIMAGE
1142 /* 1144 /*
1143 * set up icon hint 1145 * set up icon hint
1144 * rs [Rs_iconfile] is path to icon, asv has been created in init_resources 1146 * rs [Rs_iconfile] is path to icon, asv has been created in init_resources
1145 */ 1147 */
1148
1146 if (rs [Rs_iconfile] && asv) 1149 if (rs [Rs_iconfile])
1147 { 1150 {
1151 init_asv ();
1152
1148 ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL); 1153 ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL);
1149 if (im) 1154 if (asv && im)
1150 { 1155 {
1151 int w = im->width; 1156 int w = im->width;
1152 int h = im->height; 1157 int h = im->height;
1153 long* buffer = (long *)malloc ((2 + w * h) * sizeof (long)); 1158 long* buffer = (long *)malloc ((2 + w * h) * sizeof (long));
1154 ASImage *result = scale_asimage (asv, im, 1159 ASImage *result = scale_asimage (asv, im,
1165 for (unsigned int i = 0; i < w * h; ++i) 1170 for (unsigned int i = 0; i < w * h; ++i)
1166 buffer [i + 2] = asbuf [i]; 1171 buffer [i + 2] = asbuf [i];
1167 1172
1168 destroy_asimage (&result); 1173 destroy_asimage (&result);
1169 XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, 1174 XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1170 PropModeReplace, (const unsigned char*) buffer, 2 + w * h); 1175 PropModeReplace, (const unsigned char*) buffer, 2 + w * h);
1171 free (buffer); 1176 free (buffer);
1172 } 1177 }
1173 else 1178 else
1174 { 1179 {
1175 if (!buffer) 1180 if (!buffer)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines