… | |
… | |
293 | ncol = 80; |
293 | ncol = 80; |
294 | nrow = 24; |
294 | nrow = 24; |
295 | int_bwidth = INTERNALBORDERWIDTH; |
295 | int_bwidth = INTERNALBORDERWIDTH; |
296 | ext_bwidth = EXTERNALBORDERWIDTH; |
296 | ext_bwidth = EXTERNALBORDERWIDTH; |
297 | lineSpace = LINESPACE; |
297 | lineSpace = LINESPACE; |
|
|
298 | letterSpace = LETTERSPACE; |
298 | saveLines = SAVELINES; |
299 | saveLines = SAVELINES; |
299 | |
300 | |
300 | refresh_type = SLOW_REFRESH; |
301 | refresh_type = SLOW_REFRESH; |
301 | |
302 | |
302 | oldcursor.row = oldcursor.col = -1; |
303 | oldcursor.row = oldcursor.col = -1; |
… | |
… | |
307 | set_option (Opt_skipScroll); |
308 | set_option (Opt_skipScroll); |
308 | set_option (Opt_secondaryScreen); |
309 | set_option (Opt_secondaryScreen); |
309 | set_option (Opt_secondaryScroll); |
310 | set_option (Opt_secondaryScroll); |
310 | set_option (Opt_pastableTabs); |
311 | set_option (Opt_pastableTabs); |
311 | set_option (Opt_intensityStyles); |
312 | set_option (Opt_intensityStyles); |
|
|
313 | set_option (Opt_iso14755); |
312 | set_option (Opt_iso14755_52); |
314 | set_option (Opt_iso14755_52); |
313 | set_option (Opt_buffered); |
315 | set_option (Opt_buffered); |
314 | } |
316 | } |
315 | |
317 | |
316 | static void |
318 | static void |
… | |
… | |
392 | #if XFT |
394 | #if XFT |
393 | if (rs[Rs_depth]) |
395 | if (rs[Rs_depth]) |
394 | select_visual (strtol (rs[Rs_depth], 0, 0)); |
396 | select_visual (strtol (rs[Rs_depth], 0, 0)); |
395 | #endif |
397 | #endif |
396 | |
398 | |
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); |
399 | free (r_argv); |
403 | |
400 | |
404 | for (int i = NUM_RESOURCES; i--; ) |
401 | for (int i = NUM_RESOURCES; i--; ) |
405 | if (rs [i] == resval_undef) |
402 | if (rs [i] == resval_undef) |
406 | rs [i] = 0; |
403 | rs [i] = 0; |
|
|
404 | |
|
|
405 | #ifdef HAVE_AFTERIMAGE |
|
|
406 | set_application_name ((char *)rs[Rs_name]); |
|
|
407 | set_output_threshold (OUTPUT_LEVEL_WARNING); |
|
|
408 | #endif |
407 | |
409 | |
408 | #if ENABLE_PERL |
410 | #if ENABLE_PERL |
409 | if (!rs[Rs_perl_ext_1]) |
411 | if (!rs[Rs_perl_ext_1]) |
410 | rs[Rs_perl_ext_1] = "default"; |
412 | rs[Rs_perl_ext_1] = "default"; |
411 | |
413 | |
… | |
… | |
423 | */ |
425 | */ |
424 | if (cmd_argv && cmd_argv[0]) |
426 | if (cmd_argv && cmd_argv[0]) |
425 | { |
427 | { |
426 | if (!rs[Rs_title]) |
428 | if (!rs[Rs_title]) |
427 | rs[Rs_title] = rxvt_basename (cmd_argv[0]); |
429 | rs[Rs_title] = rxvt_basename (cmd_argv[0]); |
|
|
430 | |
428 | if (!rs[Rs_iconName]) |
431 | if (!rs[Rs_iconName]) |
429 | rs[Rs_iconName] = rs[Rs_title]; |
432 | rs[Rs_iconName] = rs[Rs_title]; |
430 | } |
433 | } |
431 | else |
434 | else |
432 | { |
435 | { |
433 | if (!rs[Rs_title]) |
436 | if (!rs[Rs_title]) |
434 | rs[Rs_title] = rs[Rs_name]; |
437 | rs[Rs_title] = rs[Rs_name]; |
|
|
438 | |
435 | if (!rs[Rs_iconName]) |
439 | if (!rs[Rs_iconName]) |
436 | rs[Rs_iconName] = rs[Rs_name]; |
440 | rs[Rs_iconName] = rs[Rs_name]; |
437 | } |
441 | } |
438 | |
442 | |
439 | if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0) |
443 | if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0) |
… | |
… | |
446 | if (rs[Rs_ext_bwidth] && (i = atoi (rs[Rs_ext_bwidth])) >= 0) |
450 | if (rs[Rs_ext_bwidth] && (i = atoi (rs[Rs_ext_bwidth])) >= 0) |
447 | ext_bwidth = min (i, std::numeric_limits<int16_t>::max ()); |
451 | ext_bwidth = min (i, std::numeric_limits<int16_t>::max ()); |
448 | |
452 | |
449 | if (rs[Rs_lineSpace] && (i = atoi (rs[Rs_lineSpace])) >= 0) |
453 | if (rs[Rs_lineSpace] && (i = atoi (rs[Rs_lineSpace])) >= 0) |
450 | lineSpace = min (i, std::numeric_limits<int16_t>::max ()); |
454 | lineSpace = min (i, std::numeric_limits<int16_t>::max ()); |
|
|
455 | |
|
|
456 | if (rs[Rs_letterSpace]) |
|
|
457 | letterSpace = atoi (rs[Rs_letterSpace]); |
451 | #endif |
458 | #endif |
452 | |
459 | |
453 | #ifdef POINTER_BLANK |
460 | #ifdef POINTER_BLANK |
454 | if (rs[Rs_pointerBlankDelay] && (i = atoi (rs[Rs_pointerBlankDelay])) >= 0) |
461 | if (rs[Rs_pointerBlankDelay] && (i = atoi (rs[Rs_pointerBlankDelay])) >= 0) |
455 | pointerBlankDelay = i; |
462 | pointerBlankDelay = i; |
… | |
… | |
565 | |
572 | |
566 | create_windows (argc, argv); |
573 | create_windows (argc, argv); |
567 | |
574 | |
568 | init_xlocale (); |
575 | init_xlocale (); |
569 | |
576 | |
570 | scr_reset (); // initialize screen |
577 | scr_poweron (); // initialize screen |
571 | |
578 | |
572 | #if 0 |
579 | #if 0 |
573 | XSynchronize (dpy, True); |
580 | XSynchronize (dpy, True); |
574 | #endif |
581 | #endif |
575 | |
582 | |
… | |
… | |
1122 | this->parent[0] = top; |
1129 | this->parent[0] = top; |
1123 | |
1130 | |
1124 | old_width = szHint.width; |
1131 | old_width = szHint.width; |
1125 | old_height = szHint.height; |
1132 | old_height = szHint.height; |
1126 | |
1133 | |
1127 | process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1134 | set_title (rs [Rs_title]); |
1128 | process_xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1135 | set_icon_name (rs [Rs_iconName]); |
1129 | |
1136 | |
1130 | classHint.res_name = (char *)rs[Rs_name]; |
1137 | classHint.res_name = (char *)rs[Rs_name]; |
1131 | classHint.res_class = (char *)RESCLASS; |
1138 | classHint.res_class = (char *)RESCLASS; |
1132 | |
1139 | |
1133 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
1140 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
… | |
… | |
1141 | # ifdef HAVE_AFTERIMAGE |
1148 | # ifdef HAVE_AFTERIMAGE |
1142 | /* |
1149 | /* |
1143 | * set up icon hint |
1150 | * set up icon hint |
1144 | * rs [Rs_iconfile] is path to icon, asv has been created in init_resources |
1151 | * rs [Rs_iconfile] is path to icon, asv has been created in init_resources |
1145 | */ |
1152 | */ |
|
|
1153 | |
1146 | if (rs [Rs_iconfile] && asv) |
1154 | if (rs [Rs_iconfile]) |
1147 | { |
1155 | { |
|
|
1156 | init_asv (); |
|
|
1157 | |
1148 | ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL); |
1158 | ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL); |
1149 | if (im) |
1159 | if (asv && im) |
1150 | { |
1160 | { |
1151 | int w = im->width; |
1161 | int w = im->width; |
1152 | int h = im->height; |
1162 | int h = im->height; |
1153 | long* buffer = (long *)malloc ((2 + w * h) * sizeof (long)); |
1163 | long *buffer = (long *)malloc ((2 + w * h) * sizeof (long)); |
1154 | ASImage *result = scale_asimage (asv, im, |
1164 | ASImage *result = scale_asimage (asv, im, |
1155 | w, h, ASA_ARGB32, |
1165 | w, h, ASA_ARGB32, |
1156 | 100, ASIMAGE_QUALITY_DEFAULT); |
1166 | 100, ASIMAGE_QUALITY_DEFAULT); |
1157 | destroy_asimage (&im); |
1167 | destroy_asimage (&im); |
1158 | |
1168 | |
… | |
… | |
1165 | for (unsigned int i = 0; i < w * h; ++i) |
1175 | for (unsigned int i = 0; i < w * h; ++i) |
1166 | buffer [i + 2] = asbuf [i]; |
1176 | buffer [i + 2] = asbuf [i]; |
1167 | |
1177 | |
1168 | destroy_asimage (&result); |
1178 | destroy_asimage (&result); |
1169 | XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1179 | XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32, |
1170 | PropModeReplace, (const unsigned char*) buffer, 2 + w * h); |
1180 | PropModeReplace, (const unsigned char *) buffer, 2 + w * h); |
1171 | free (buffer); |
1181 | free (buffer); |
1172 | } |
1182 | } |
1173 | else |
1183 | else |
1174 | { |
1184 | { |
1175 | if (!buffer) |
1185 | if (!buffer) |
… | |
… | |
1596 | const char *argv0, *shell; |
1606 | const char *argv0, *shell; |
1597 | |
1607 | |
1598 | if ((shell = getenv ("SHELL")) == NULL || *shell == '\0') |
1608 | if ((shell = getenv ("SHELL")) == NULL || *shell == '\0') |
1599 | shell = "/bin/sh"; |
1609 | shell = "/bin/sh"; |
1600 | |
1610 | |
1601 | argv0 = (const char *)rxvt_basename (shell); |
1611 | argv0 = rxvt_basename (shell); |
1602 | |
1612 | |
1603 | if (option (Opt_loginShell)) |
1613 | if (option (Opt_loginShell)) |
1604 | { |
1614 | { |
1605 | login = (char *)rxvt_malloc (strlen (argv0) + 2); |
1615 | login = (char *)rxvt_malloc (strlen (argv0) + 2); |
1606 | |
1616 | |