… | |
… | |
500 | # if ISO_14755 |
500 | # if ISO_14755 |
501 | iso14755_51 (0); |
501 | iso14755_51 (0); |
502 | # endif |
502 | # endif |
503 | return; |
503 | return; |
504 | } |
504 | } |
|
|
505 | else if (keysym == XK_BackSpace) |
|
|
506 | { |
|
|
507 | iso14755buf = ((iso14755buf & ISO_14755_MASK) >> 4) | ISO_14755_51; |
|
|
508 | # if ISO_14755 |
|
|
509 | iso14755_51 (iso14755buf & ISO_14755_MASK); |
|
|
510 | # endif |
|
|
511 | return; |
|
|
512 | } |
505 | else if ((hv = hex_keyval (ev)) >= 0) |
513 | else if ((hv = hex_keyval (ev)) >= 0) |
506 | { |
514 | { |
507 | iso14755buf = ((iso14755buf << 4) & ISO_14755_MASK) |
515 | iso14755buf = ((iso14755buf << 4) & ISO_14755_MASK) |
508 | | hv | ISO_14755_51; |
516 | | hv | ISO_14755_51; |
509 | # if ISO_14755 |
517 | # if ISO_14755 |
… | |
… | |
511 | # endif |
519 | # endif |
512 | return; |
520 | return; |
513 | } |
521 | } |
514 | else |
522 | else |
515 | { |
523 | { |
516 | # if ENABLE_OVERLAY |
524 | # if ISO_14755 |
517 | scr_overlay_off (); |
525 | scr_overlay_off (); |
518 | # endif |
526 | # endif |
519 | iso14755buf = 0; |
527 | iso14755buf = 0; |
520 | } |
528 | } |
521 | } |
529 | } |
522 | else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) |
530 | else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) |
523 | || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) |
531 | || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) |
524 | if (!(iso14755buf & ISO_14755_STARTED)) |
532 | if (!(iso14755buf & ISO_14755_STARTED)) |
525 | { |
533 | { |
526 | iso14755buf |= ISO_14755_STARTED; |
534 | iso14755buf |= ISO_14755_STARTED; |
527 | # if ENABLE_OVERLAY |
535 | # if ISO_14755 |
528 | scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); |
536 | scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); |
529 | scr_overlay_set (0, 0, "ISO 14755 mode"); |
537 | scr_overlay_set (0, 0, "ISO 14755 mode"); |
530 | # endif |
538 | # endif |
531 | } |
539 | } |
532 | #endif |
540 | #endif |
533 | |
541 | |
534 | #ifdef PRINTPIPE |
542 | #ifdef PRINTPIPE |
535 | if (keysym == XK_Print) |
543 | if (keysym == XK_Print) |
536 | { |
544 | { |
537 | scr_printscreen (ctrl | shft); |
545 | scr_printscreen (ctrl | shft); |
538 | return; |
546 | return; |
… | |
… | |
720 | |
728 | |
721 | case XK_Find: |
729 | case XK_Find: |
722 | strcpy (kbuf, "\033[1~"); |
730 | strcpy (kbuf, "\033[1~"); |
723 | break; |
731 | break; |
724 | |
732 | |
725 | #ifdef XK_KP_End |
733 | #ifdef XK_KP_Insert |
726 | case XK_KP_Insert: |
734 | case XK_KP_Insert: |
727 | /* allow shift to override */ |
735 | /* allow shift to override */ |
728 | if ((priv_modes & PrivMode_aplKP) ? !shft : shft) |
736 | if ((priv_modes & PrivMode_aplKP) ? !shft : shft) |
729 | { |
737 | { |
730 | strcpy (kbuf, "\033Op"); |
738 | strcpy (kbuf, "\033Op"); |
… | |
… | |
926 | #if ENABLE_FRILLS || ISO_14755 |
934 | #if ENABLE_FRILLS || ISO_14755 |
927 | // ISO 14755 support |
935 | // ISO 14755 support |
928 | if (iso14755buf) |
936 | if (iso14755buf) |
929 | if (iso14755buf & ISO_14755_52) |
937 | if (iso14755buf & ISO_14755_52) |
930 | { |
938 | { |
931 | # if ENABLE_OVERLAY |
939 | # if ISO_14755 |
932 | scr_overlay_off (); |
940 | scr_overlay_off (); |
933 | # endif |
941 | # endif |
934 | # if ISO_14755 |
942 | # if ISO_14755 |
935 | // iso14755 part 5.2 handling: release time |
943 | // iso14755 part 5.2 handling: release time |
936 | // first: controls |
944 | // first: controls |
… | |
… | |
959 | |
967 | |
960 | return; |
968 | return; |
961 | } |
969 | } |
962 | else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask)) |
970 | else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask)) |
963 | { |
971 | { |
964 | # if ENABLE_OVERLAY |
972 | # if ISO_14755 |
965 | scr_overlay_off (); |
973 | scr_overlay_off (); |
966 | # endif |
974 | # endif |
967 | if (iso14755buf & ISO_14755_51) |
975 | if (iso14755buf & ISO_14755_51) |
968 | commit_iso14755 (); |
976 | commit_iso14755 (); |
969 | #if ISO_14755 |
977 | #if ISO_14755 |
970 | else if (iso14755buf & ISO_14755_STARTED) |
978 | else if (option (Opt_iso14755_52) && iso14755buf & ISO_14755_STARTED) |
971 | { |
979 | { |
972 | iso14755buf = ISO_14755_52; // iso14755 part 5.2: remember empty begin/end pair |
980 | iso14755buf = ISO_14755_52; // iso14755 part 5.2: remember empty begin/end pair |
973 | |
981 | |
974 | scr_overlay_new (0, -1, sizeof ("KEYCAP PICTURE INSERT MODE") - 1, 1); |
982 | scr_overlay_new (0, -1, sizeof ("KEYCAP PICTURE INSERT MODE") - 1, 1); |
975 | scr_overlay_set (0, 0, "KEYCAP PICTURE INSERT MODE"); |
983 | scr_overlay_set (0, 0, "KEYCAP PICTURE INSERT MODE"); |
… | |
… | |
1027 | void |
1035 | void |
1028 | rxvt_term::flush () |
1036 | rxvt_term::flush () |
1029 | { |
1037 | { |
1030 | flush_ev.stop (); |
1038 | flush_ev.stop (); |
1031 | |
1039 | |
1032 | #ifdef TRANSPARENT |
1040 | #ifdef ENABLE_TRANSPARENCY |
1033 | if (want_full_refresh) |
1041 | if (want_full_refresh) |
1034 | { |
1042 | { |
1035 | want_full_refresh = 0; |
1043 | want_full_refresh = 0; |
1036 | scr_clear (); |
1044 | scr_clear (); |
1037 | scr_touch (false); |
1045 | scr_touch (false); |
… | |
… | |
1102 | void |
1110 | void |
1103 | rxvt_term::flush_cb (time_watcher &w) |
1111 | rxvt_term::flush_cb (time_watcher &w) |
1104 | { |
1112 | { |
1105 | make_current (); |
1113 | make_current (); |
1106 | |
1114 | |
1107 | refresh_limit = 1; |
|
|
1108 | refresh_count = 0; |
1115 | refresh_count = 0; |
1109 | flush (); |
1116 | flush (); |
1110 | } |
1117 | } |
1111 | |
1118 | |
1112 | #ifdef CURSOR_BLINK |
1119 | #ifdef CURSOR_BLINK |
… | |
… | |
1178 | |
1185 | |
1179 | #if LINUX_YIELD_HACK |
1186 | #if LINUX_YIELD_HACK |
1180 | static struct event_handler |
1187 | static struct event_handler |
1181 | { |
1188 | { |
1182 | check_watcher yield_ev; |
1189 | check_watcher yield_ev; |
1183 | |
1190 | |
1184 | void yield_cb (check_watcher &w) |
1191 | void yield_cb (check_watcher &w) |
1185 | { |
1192 | { |
1186 | // this should really be sched_yield(), but the linux guys thought |
1193 | // this should really be sched_yield(), but the linux guys thought |
1187 | // that giving a process calling sched_yield () less cpu time than |
1194 | // that giving a process calling sched_yield () less cpu time than |
1188 | // ones with high nice levels is a useful thing to do. It surely is is |
1195 | // ones with high nice levels is a useful thing to do. It surely is is |
… | |
… | |
1235 | pty_ev.stop (); |
1242 | pty_ev.stop (); |
1236 | |
1243 | |
1237 | if (!option (Opt_hold)) |
1244 | if (!option (Opt_hold)) |
1238 | destroy (); |
1245 | destroy (); |
1239 | } |
1246 | } |
1240 | |
1247 | |
1241 | return false; |
1248 | return false; |
1242 | } |
1249 | } |
1243 | |
1250 | |
1244 | void |
1251 | void |
1245 | rxvt_term::pty_cb (io_watcher &w, short revents) |
1252 | rxvt_term::pty_cb (io_watcher &w, short revents) |
… | |
… | |
1426 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
1433 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
1427 | focus_out (); |
1434 | focus_out (); |
1428 | } |
1435 | } |
1429 | #endif |
1436 | #endif |
1430 | } |
1437 | } |
1431 | break; |
|
|
1432 | |
|
|
1433 | case MappingNotify: |
|
|
1434 | XRefreshKeyboardMapping (&ev.xmapping); |
|
|
1435 | break; |
1438 | break; |
1436 | |
1439 | |
1437 | /* |
1440 | /* |
1438 | * XXX: this is not the _current_ arrangement |
1441 | * XXX: this is not the _current_ arrangement |
1439 | * Here's my conclusion: |
1442 | * Here's my conclusion: |
… | |
… | |
1481 | |
1484 | |
1482 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1485 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1483 | { |
1486 | { |
1484 | seen_resize = 1; |
1487 | seen_resize = 1; |
1485 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1488 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
|
|
1489 | #ifdef HAVE_BG_PIXMAP |
|
|
1490 | /* TODO: replace with update_pixmap() that should unify transparency and bg image handling ! */ |
|
|
1491 | if (!option (Opt_transparent) && bgPixmap.window_size_sensitive ()) |
|
|
1492 | { |
|
|
1493 | resize_pixmap (); |
|
|
1494 | scr_touch (true); |
|
|
1495 | } |
|
|
1496 | #endif |
1486 | } |
1497 | } |
1487 | |
1498 | |
1488 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1499 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1489 | |
1500 | |
1490 | #ifdef TRANSPARENT |
1501 | #ifdef ENABLE_TRANSPARENCY |
1491 | if (option (Opt_transparent)) |
1502 | if (option (Opt_transparent)) |
1492 | check_our_parents (); |
1503 | check_our_parents (); |
1493 | #endif |
1504 | #endif |
1494 | } |
1505 | } |
1495 | break; |
1506 | break; |
… | |
… | |
1529 | text_blink_ev.stop (); |
1540 | text_blink_ev.stop (); |
1530 | #endif |
1541 | #endif |
1531 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1542 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1532 | break; |
1543 | break; |
1533 | |
1544 | |
1534 | #ifdef TRANSPARENT |
1545 | #ifdef ENABLE_TRANSPARENCY |
1535 | case ReparentNotify: |
1546 | case ReparentNotify: |
1536 | rootwin_cb (ev); |
1547 | rootwin_cb (ev); |
1537 | break; |
1548 | break; |
1538 | #endif /* TRANSPARENT */ |
1549 | #endif /* ENABLE_TRANSPARENCY */ |
1539 | |
1550 | |
1540 | case GraphicsExpose: |
1551 | case GraphicsExpose: |
1541 | case Expose: |
1552 | case Expose: |
1542 | if (ev.xany.window == vt) |
1553 | if (ev.xany.window == vt) |
1543 | { |
1554 | { |
… | |
… | |
1567 | { |
1578 | { |
1568 | scrollBar.setIdle (); |
1579 | scrollBar.setIdle (); |
1569 | scrollbar_show (0); |
1580 | scrollbar_show (0); |
1570 | } |
1581 | } |
1571 | |
1582 | |
1572 | #ifdef TRANSPARENT |
1583 | #ifdef ENABLE_TRANSPARENCY |
1573 | if (am_transparent && ev.xany.window == parent[0]) |
1584 | if (am_transparent && ev.xany.window == parent[0]) |
1574 | XClearWindow (dpy, ev.xany.window); |
1585 | XClearWindow (dpy, ev.xany.window); |
1575 | #endif |
1586 | #endif |
1576 | } |
1587 | } |
1577 | break; |
1588 | break; |
… | |
… | |
1678 | &ev.xbutton.x, &ev.xbutton.y, |
1689 | &ev.xbutton.x, &ev.xbutton.y, |
1679 | &unused_mask); |
1690 | &unused_mask); |
1680 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1691 | scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, |
1681 | scrollbar_size ()); |
1692 | scrollbar_size ()); |
1682 | want_refresh = 1; |
1693 | want_refresh = 1; |
1683 | refresh_limit = 0; |
|
|
1684 | scrollbar_show (1); |
1694 | scrollbar_show (1); |
1685 | } |
1695 | } |
1686 | break; |
1696 | break; |
1687 | } |
1697 | } |
1688 | |
1698 | |
… | |
… | |
1770 | |
1780 | |
1771 | #if ENABLE_FRILLS || ISO_14755 |
1781 | #if ENABLE_FRILLS || ISO_14755 |
1772 | if (iso14755buf) |
1782 | if (iso14755buf) |
1773 | { |
1783 | { |
1774 | iso14755buf = 0; |
1784 | iso14755buf = 0; |
1775 | # if ENABLE_OVERLAY |
1785 | # if ISO_14755 |
1776 | scr_overlay_off (); |
1786 | scr_overlay_off (); |
1777 | # endif |
1787 | # endif |
1778 | } |
1788 | } |
1779 | #endif |
1789 | #endif |
1780 | #if USE_XIM |
1790 | #if USE_XIM |
… | |
… | |
1807 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1817 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1808 | } |
1818 | } |
1809 | #endif |
1819 | #endif |
1810 | } |
1820 | } |
1811 | |
1821 | |
1812 | #if TRANSPARENT || ENABLE_PERL |
1822 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1813 | void |
1823 | void |
1814 | rxvt_term::rootwin_cb (XEvent &ev) |
1824 | rxvt_term::rootwin_cb (XEvent &ev) |
1815 | { |
1825 | { |
1816 | make_current (); |
1826 | make_current (); |
1817 | |
1827 | |
1818 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1828 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1819 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
1829 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
1820 | return; |
1830 | return; |
1821 | |
1831 | |
1822 | # if TRANSPARENT |
1832 | # if ENABLE_TRANSPARENCY |
1823 | switch (ev.type) |
1833 | switch (ev.type) |
1824 | { |
1834 | { |
1825 | case PropertyNotify: |
1835 | case PropertyNotify: |
1826 | /* |
1836 | /* |
1827 | * if user used some Esetroot compatible prog to set the root bg, |
1837 | * if user used some Esetroot compatible prog to set the root bg, |
… | |
… | |
1831 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1841 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1832 | return; |
1842 | return; |
1833 | |
1843 | |
1834 | /* FALLTHROUGH */ |
1844 | /* FALLTHROUGH */ |
1835 | case ReparentNotify: |
1845 | case ReparentNotify: |
1836 | if (option (Opt_transparent) && check_our_parents () && am_transparent) |
1846 | if (option (Opt_transparent)) |
1837 | want_refresh = want_full_refresh = 1; |
1847 | check_our_parents (); |
1838 | break; |
1848 | break; |
1839 | } |
1849 | } |
1840 | # endif |
1850 | # endif |
1841 | } |
1851 | } |
1842 | #endif |
1852 | #endif |
… | |
… | |
2219 | #endif |
2229 | #endif |
2220 | } |
2230 | } |
2221 | } |
2231 | } |
2222 | } |
2232 | } |
2223 | |
2233 | |
2224 | #ifdef TRANSPARENT |
|
|
2225 | #if TINTING |
|
|
2226 | /* taken from aterm-0.4.2 */ |
|
|
2227 | |
|
|
2228 | typedef uint32_t RUINT32T; |
|
|
2229 | |
|
|
2230 | void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm) |
|
|
2231 | { |
|
|
2232 | int sh_r, sh_g, sh_b; |
|
|
2233 | RUINT32T mask_r, mask_g, mask_b; |
|
|
2234 | RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b; |
|
|
2235 | unsigned int lower_lim_r, lower_lim_g, lower_lim_b; |
|
|
2236 | unsigned int upper_lim_r, upper_lim_g, upper_lim_b; |
|
|
2237 | int i; |
|
|
2238 | |
|
|
2239 | Visual *visual = term->visual; |
|
|
2240 | |
|
|
2241 | if( visual->c_class != TrueColor || srcImage->format != ZPixmap ) return ; |
|
|
2242 | |
|
|
2243 | /* for convenience */ |
|
|
2244 | mask_r = visual->red_mask; |
|
|
2245 | mask_g = visual->green_mask; |
|
|
2246 | mask_b = visual->blue_mask; |
|
|
2247 | |
|
|
2248 | /* boring lookup table pre-initialization */ |
|
|
2249 | switch (srcImage->bits_per_pixel) { |
|
|
2250 | case 15: |
|
|
2251 | if ((mask_r != 0x7c00) || |
|
|
2252 | (mask_g != 0x03e0) || |
|
|
2253 | (mask_b != 0x001f)) |
|
|
2254 | return; |
|
|
2255 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+32+32)); |
|
|
2256 | lookup_r = lookup; |
|
|
2257 | lookup_g = lookup+32; |
|
|
2258 | lookup_b = lookup+32+32; |
|
|
2259 | sh_r = 10; |
|
|
2260 | sh_g = 5; |
|
|
2261 | sh_b = 0; |
|
|
2262 | break; |
|
|
2263 | case 16: |
|
|
2264 | if ((mask_r != 0xf800) || |
|
|
2265 | (mask_g != 0x07e0) || |
|
|
2266 | (mask_b != 0x001f)) |
|
|
2267 | return; |
|
|
2268 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+64+32)); |
|
|
2269 | lookup_r = lookup; |
|
|
2270 | lookup_g = lookup+32; |
|
|
2271 | lookup_b = lookup+32+64; |
|
|
2272 | sh_r = 11; |
|
|
2273 | sh_g = 5; |
|
|
2274 | sh_b = 0; |
|
|
2275 | break; |
|
|
2276 | case 24: |
|
|
2277 | if ((mask_r != 0xff0000) || |
|
|
2278 | (mask_g != 0x00ff00) || |
|
|
2279 | (mask_b != 0x0000ff)) |
|
|
2280 | return; |
|
|
2281 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256)); |
|
|
2282 | lookup_r = lookup; |
|
|
2283 | lookup_g = lookup+256; |
|
|
2284 | lookup_b = lookup+256+256; |
|
|
2285 | sh_r = 16; |
|
|
2286 | sh_g = 8; |
|
|
2287 | sh_b = 0; |
|
|
2288 | break; |
|
|
2289 | case 32: |
|
|
2290 | if ((mask_r != 0xff0000) || |
|
|
2291 | (mask_g != 0x00ff00) || |
|
|
2292 | (mask_b != 0x0000ff)) |
|
|
2293 | return; |
|
|
2294 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256)); |
|
|
2295 | lookup_r = lookup; |
|
|
2296 | lookup_g = lookup+256; |
|
|
2297 | lookup_b = lookup+256+256; |
|
|
2298 | sh_r = 16; |
|
|
2299 | sh_g = 8; |
|
|
2300 | sh_b = 0; |
|
|
2301 | break; |
|
|
2302 | default: |
|
|
2303 | return; /* we do not support this color depth */ |
|
|
2304 | } |
|
|
2305 | |
|
|
2306 | /* prepare limits for color transformation (each channel is handled separately) */ |
|
|
2307 | if (shade < 0) { |
|
|
2308 | shade = -shade; |
|
|
2309 | if (shade < 0) shade = 0; |
|
|
2310 | if (shade > 100) shade = 100; |
|
|
2311 | |
|
|
2312 | lower_lim_r = 65535-rm; |
|
|
2313 | lower_lim_g = 65535-gm; |
|
|
2314 | lower_lim_b = 65535-bm; |
|
|
2315 | |
|
|
2316 | lower_lim_r = 65535-(unsigned int)(((RUINT32T)lower_lim_r)*((RUINT32T)shade)/100); |
|
|
2317 | lower_lim_g = 65535-(unsigned int)(((RUINT32T)lower_lim_g)*((RUINT32T)shade)/100); |
|
|
2318 | lower_lim_b = 65535-(unsigned int)(((RUINT32T)lower_lim_b)*((RUINT32T)shade)/100); |
|
|
2319 | |
|
|
2320 | upper_lim_r = upper_lim_g = upper_lim_b = 65535; |
|
|
2321 | } else { |
|
|
2322 | if (shade < 0) shade = 0; |
|
|
2323 | if (shade > 100) shade = 100; |
|
|
2324 | |
|
|
2325 | lower_lim_r = lower_lim_g = lower_lim_b = 0; |
|
|
2326 | |
|
|
2327 | upper_lim_r = (unsigned int)((((RUINT32T)rm)*((RUINT32T)shade))/100); |
|
|
2328 | upper_lim_g = (unsigned int)((((RUINT32T)gm)*((RUINT32T)shade))/100); |
|
|
2329 | upper_lim_b = (unsigned int)((((RUINT32T)bm)*((RUINT32T)shade))/100); |
|
|
2330 | } |
|
|
2331 | |
|
|
2332 | /* switch red and blue bytes if necessary, we need it for some weird XServers like XFree86 3.3.3.1 */ |
|
|
2333 | if ((srcImage->bits_per_pixel == 24) && (mask_r >= 0xFF0000 )) |
|
|
2334 | { |
|
|
2335 | unsigned int tmp; |
|
|
2336 | |
|
|
2337 | tmp = lower_lim_r; |
|
|
2338 | lower_lim_r = lower_lim_b; |
|
|
2339 | lower_lim_b = tmp; |
|
|
2340 | |
|
|
2341 | tmp = upper_lim_r; |
|
|
2342 | upper_lim_r = upper_lim_b; |
|
|
2343 | upper_lim_b = tmp; |
|
|
2344 | } |
|
|
2345 | |
|
|
2346 | /* fill our lookup tables */ |
|
|
2347 | for (i = 0; i <= mask_r>>sh_r; i++) |
|
|
2348 | { |
|
|
2349 | RUINT32T tmp; |
|
|
2350 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_r-lower_lim_r)); |
|
|
2351 | tmp += ((RUINT32T)(mask_r>>sh_r))*((RUINT32T)lower_lim_r); |
|
|
2352 | lookup_r[i] = (tmp/65535)<<sh_r; |
|
|
2353 | } |
|
|
2354 | for (i = 0; i <= mask_g>>sh_g; i++) |
|
|
2355 | { |
|
|
2356 | RUINT32T tmp; |
|
|
2357 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_g-lower_lim_g)); |
|
|
2358 | tmp += ((RUINT32T)(mask_g>>sh_g))*((RUINT32T)lower_lim_g); |
|
|
2359 | lookup_g[i] = (tmp/65535)<<sh_g; |
|
|
2360 | } |
|
|
2361 | for (i = 0; i <= mask_b>>sh_b; i++) |
|
|
2362 | { |
|
|
2363 | RUINT32T tmp; |
|
|
2364 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_b-lower_lim_b)); |
|
|
2365 | tmp += ((RUINT32T)(mask_b>>sh_b))*((RUINT32T)lower_lim_b); |
|
|
2366 | lookup_b[i] = (tmp/65535)<<sh_b; |
|
|
2367 | } |
|
|
2368 | |
|
|
2369 | /* apply table to input image (replacing colors by newly calculated ones) */ |
|
|
2370 | switch (srcImage->bits_per_pixel) |
|
|
2371 | { |
|
|
2372 | case 15: |
|
|
2373 | { |
|
|
2374 | unsigned short *p1, *pf, *p, *pl; |
|
|
2375 | p1 = (unsigned short *) srcImage->data; |
|
|
2376 | pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2377 | while (p1 < pf) |
|
|
2378 | { |
|
|
2379 | p = p1; |
|
|
2380 | pl = p1 + srcImage->width; |
|
|
2381 | for (; p < pl; p++) |
|
|
2382 | { |
|
|
2383 | *p = lookup_r[(*p & 0x7c00)>>10] | |
|
|
2384 | lookup_g[(*p & 0x03e0)>> 5] | |
|
|
2385 | lookup_b[(*p & 0x001f)]; |
|
|
2386 | } |
|
|
2387 | p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2388 | } |
|
|
2389 | break; |
|
|
2390 | } |
|
|
2391 | case 16: |
|
|
2392 | { |
|
|
2393 | unsigned short *p1, *pf, *p, *pl; |
|
|
2394 | p1 = (unsigned short *) srcImage->data; |
|
|
2395 | pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2396 | while (p1 < pf) |
|
|
2397 | { |
|
|
2398 | p = p1; |
|
|
2399 | pl = p1 + srcImage->width; |
|
|
2400 | for (; p < pl; p++) |
|
|
2401 | { |
|
|
2402 | *p = lookup_r[(*p & 0xf800)>>11] | |
|
|
2403 | lookup_g[(*p & 0x07e0)>> 5] | |
|
|
2404 | lookup_b[(*p & 0x001f)]; |
|
|
2405 | } |
|
|
2406 | p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2407 | } |
|
|
2408 | break; |
|
|
2409 | } |
|
|
2410 | case 24: |
|
|
2411 | { |
|
|
2412 | unsigned char *p1, *pf, *p, *pl; |
|
|
2413 | p1 = (unsigned char *) srcImage->data; |
|
|
2414 | pf = (unsigned char *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2415 | while (p1 < pf) |
|
|
2416 | { |
|
|
2417 | p = p1; |
|
|
2418 | pl = p1 + srcImage->width * 3; |
|
|
2419 | for (; p < pl; p += 3) |
|
|
2420 | { |
|
|
2421 | p[0] = lookup_r[(p[0] & 0xff0000)>>16]; |
|
|
2422 | p[1] = lookup_r[(p[1] & 0x00ff00)>> 8]; |
|
|
2423 | p[2] = lookup_r[(p[2] & 0x0000ff)]; |
|
|
2424 | } |
|
|
2425 | p1 = (unsigned char *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2426 | } |
|
|
2427 | break; |
|
|
2428 | } |
|
|
2429 | case 32: |
|
|
2430 | { |
|
|
2431 | RUINT32T *p1, *pf, *p, *pl; |
|
|
2432 | p1 = (RUINT32T *) srcImage->data; |
|
|
2433 | pf = (RUINT32T *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2434 | |
|
|
2435 | while (p1 < pf) |
|
|
2436 | { |
|
|
2437 | p = p1; |
|
|
2438 | pl = p1 + srcImage->width; |
|
|
2439 | for (; p < pl; p++) |
|
|
2440 | { |
|
|
2441 | *p = lookup_r[(*p & 0xff0000)>>16] | |
|
|
2442 | lookup_g[(*p & 0x00ff00)>> 8] | |
|
|
2443 | lookup_b[(*p & 0x0000ff)] | |
|
|
2444 | (*p & ~0xffffff); |
|
|
2445 | } |
|
|
2446 | p1 = (RUINT32T *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2447 | } |
|
|
2448 | break; |
|
|
2449 | } |
|
|
2450 | } |
|
|
2451 | |
|
|
2452 | free (lookup); |
|
|
2453 | } |
|
|
2454 | #endif |
|
|
2455 | |
|
|
2456 | /* |
|
|
2457 | * Check our parents are still who we think they are. |
|
|
2458 | * Do transparency updates if required |
|
|
2459 | */ |
|
|
2460 | int |
|
|
2461 | rxvt_term::check_our_parents () |
|
|
2462 | { |
|
|
2463 | int i, pchanged, aformat, have_pixmap, rootdepth; |
|
|
2464 | unsigned long nitems, bytes_after; |
|
|
2465 | Atom atype; |
|
|
2466 | unsigned char *prop = NULL; |
|
|
2467 | Window root, oldp, *list; |
|
|
2468 | Pixmap rootpixmap = None; |
|
|
2469 | XWindowAttributes wattr, wrootattr; |
|
|
2470 | |
|
|
2471 | pchanged = 0; |
|
|
2472 | |
|
|
2473 | if (!option (Opt_transparent)) |
|
|
2474 | return pchanged; /* Don't try any more */ |
|
|
2475 | |
|
|
2476 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
|
|
2477 | rootdepth = wrootattr.depth; |
|
|
2478 | |
|
|
2479 | XGetWindowAttributes (dpy, parent[0], &wattr); |
|
|
2480 | |
|
|
2481 | if (rootdepth != wattr.depth) |
|
|
2482 | { |
|
|
2483 | if (am_transparent) |
|
|
2484 | { |
|
|
2485 | pchanged = 1; |
|
|
2486 | XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]); |
|
|
2487 | am_transparent = am_pixmap_trans = 0; |
|
|
2488 | } |
|
|
2489 | |
|
|
2490 | return pchanged; /* Don't try any more */ |
|
|
2491 | } |
|
|
2492 | |
|
|
2493 | /* Get all X ops out of the queue so that our information is up-to-date. */ |
|
|
2494 | XSync (dpy, False); |
|
|
2495 | |
|
|
2496 | /* |
|
|
2497 | * Make the frame window set by the window manager have |
|
|
2498 | * the root background. Some window managers put multiple nested frame |
|
|
2499 | * windows for each client, so we have to take care about that. |
|
|
2500 | */ |
|
|
2501 | i = (xa[XA_XROOTPMAP_ID] |
|
|
2502 | && XGetWindowProperty (dpy, display->root, xa[XA_XROOTPMAP_ID], |
|
|
2503 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
2504 | &nitems, &bytes_after, &prop) == Success); |
|
|
2505 | |
|
|
2506 | if (!i || prop == NULL) |
|
|
2507 | i = (xa[XA_ESETROOT_PMAP_ID] |
|
|
2508 | && XGetWindowProperty (dpy, display->root, xa[XA_ESETROOT_PMAP_ID], |
|
|
2509 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
2510 | &nitems, &bytes_after, &prop) == Success); |
|
|
2511 | |
|
|
2512 | if (!i || prop == NULL |
|
|
2513 | #if TINTING |
|
|
2514 | || !ISSET_PIXCOLOR (Color_tint) |
|
|
2515 | #endif |
|
|
2516 | ) |
|
|
2517 | have_pixmap = 0; |
|
|
2518 | else |
|
|
2519 | { |
|
|
2520 | have_pixmap = 1; |
|
|
2521 | rootpixmap = *(Pixmap *)prop; |
|
|
2522 | XFree (prop); |
|
|
2523 | } |
|
|
2524 | |
|
|
2525 | if (have_pixmap) |
|
|
2526 | { |
|
|
2527 | /* |
|
|
2528 | * Copy display->root pixmap transparency |
|
|
2529 | */ |
|
|
2530 | int sx, sy, nx, ny; |
|
|
2531 | unsigned int nw, nh; |
|
|
2532 | Window cr; |
|
|
2533 | XImage *image; |
|
|
2534 | GC gc; |
|
|
2535 | XGCValues gcvalue; |
|
|
2536 | |
|
|
2537 | XTranslateCoordinates (dpy, parent[0], display->root, |
|
|
2538 | 0, 0, &sx, &sy, &cr); |
|
|
2539 | nw = (unsigned int)szHint.width; |
|
|
2540 | nh = (unsigned int)szHint.height; |
|
|
2541 | nx = ny = 0; |
|
|
2542 | |
|
|
2543 | if (sx < 0) |
|
|
2544 | { |
|
|
2545 | nw += sx; |
|
|
2546 | nx = -sx; |
|
|
2547 | sx = 0; |
|
|
2548 | } |
|
|
2549 | |
|
|
2550 | if (sy < 0) |
|
|
2551 | { |
|
|
2552 | nh += sy; |
|
|
2553 | ny = -sy; |
|
|
2554 | sy = 0; |
|
|
2555 | } |
|
|
2556 | |
|
|
2557 | min_it (nw, (unsigned int) (wrootattr.width - sx)); |
|
|
2558 | min_it (nh, (unsigned int) (wrootattr.height - sy)); |
|
|
2559 | |
|
|
2560 | XSync (dpy, False); |
|
|
2561 | allowedxerror = -1; |
|
|
2562 | image = XGetImage (dpy, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
|
|
2563 | |
|
|
2564 | /* XXX: handle BadMatch - usually because we're outside the pixmap */ |
|
|
2565 | /* XXX: may need a delay here? */ |
|
|
2566 | allowedxerror = 0; |
|
|
2567 | |
|
|
2568 | if (image == NULL) |
|
|
2569 | { |
|
|
2570 | if (am_transparent && am_pixmap_trans) |
|
|
2571 | { |
|
|
2572 | pchanged = 1; |
|
|
2573 | if (pixmap != None) |
|
|
2574 | { |
|
|
2575 | XFreePixmap (dpy, pixmap); |
|
|
2576 | pixmap = None; |
|
|
2577 | } |
|
|
2578 | } |
|
|
2579 | |
|
|
2580 | am_pixmap_trans = 0; |
|
|
2581 | } |
|
|
2582 | else |
|
|
2583 | { |
|
|
2584 | if (pixmap != None) |
|
|
2585 | XFreePixmap (dpy, pixmap); |
|
|
2586 | |
|
|
2587 | #if TINTING |
|
|
2588 | if (ISSET_PIXCOLOR (Color_tint)) |
|
|
2589 | { |
|
|
2590 | int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
|
|
2591 | |
|
|
2592 | rgba c; |
|
|
2593 | pix_colors_focused [Color_tint].get (c); |
|
|
2594 | |
|
|
2595 | ShadeXImage (this, image, shade, c.r, c.g, c.b); |
|
|
2596 | } |
|
|
2597 | #endif |
|
|
2598 | |
|
|
2599 | pixmap = XCreatePixmap (dpy, vt, szHint.width, szHint.height, image->depth); |
|
|
2600 | gc = XCreateGC (dpy, vt, 0UL, &gcvalue); |
|
|
2601 | XPutImage (dpy, pixmap, gc, image, 0, 0, |
|
|
2602 | nx, ny, image->width, image->height); |
|
|
2603 | XFreeGC (dpy, gc); |
|
|
2604 | XDestroyImage (image); |
|
|
2605 | XSetWindowBackgroundPixmap (dpy, parent[0], pixmap); |
|
|
2606 | XClearWindow (dpy, parent[0]); |
|
|
2607 | |
|
|
2608 | if (!am_transparent || !am_pixmap_trans) |
|
|
2609 | pchanged = 1; |
|
|
2610 | |
|
|
2611 | am_transparent = am_pixmap_trans = 1; |
|
|
2612 | } |
|
|
2613 | } |
|
|
2614 | |
|
|
2615 | if (am_pixmap_trans) |
|
|
2616 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
|
|
2617 | else |
|
|
2618 | { |
|
|
2619 | unsigned int n; |
|
|
2620 | /* |
|
|
2621 | * InheritPixmap transparency |
|
|
2622 | */ |
|
|
2623 | for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++) |
|
|
2624 | { |
|
|
2625 | oldp = parent[i]; |
|
|
2626 | XQueryTree (dpy, parent[i - 1], &root, &parent[i], &list, &n); |
|
|
2627 | XFree (list); |
|
|
2628 | |
|
|
2629 | if (parent[i] == display->root) |
|
|
2630 | { |
|
|
2631 | if (oldp != None) |
|
|
2632 | pchanged = 1; |
|
|
2633 | |
|
|
2634 | break; |
|
|
2635 | } |
|
|
2636 | |
|
|
2637 | if (oldp != parent[i]) |
|
|
2638 | pchanged = 1; |
|
|
2639 | } |
|
|
2640 | |
|
|
2641 | n = 0; |
|
|
2642 | |
|
|
2643 | if (pchanged) |
|
|
2644 | for (; n < (unsigned int)i; n++) |
|
|
2645 | { |
|
|
2646 | XGetWindowAttributes (dpy, parent[n], &wattr); |
|
|
2647 | |
|
|
2648 | if (wattr.depth != rootdepth || wattr.c_class == InputOnly) |
|
|
2649 | { |
|
|
2650 | n = (int) (sizeof (parent) / sizeof (Window)) + 1; |
|
|
2651 | break; |
|
|
2652 | } |
|
|
2653 | } |
|
|
2654 | |
|
|
2655 | if (n > (sizeof (parent) / sizeof (parent[0]))) |
|
|
2656 | { |
|
|
2657 | XSetWindowBackground (dpy, parent[0], pix_colors_focused[Color_border]); |
|
|
2658 | XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]); |
|
|
2659 | am_transparent = 0; |
|
|
2660 | /* XXX: also turn off Opt_transparent? */ |
|
|
2661 | } |
|
|
2662 | else |
|
|
2663 | { |
|
|
2664 | for (n = 0; n < (unsigned int)i; n++) |
|
|
2665 | { |
|
|
2666 | XSetWindowBackgroundPixmap (dpy, parent[n], ParentRelative); |
|
|
2667 | XClearWindow (dpy, parent[n]); |
|
|
2668 | } |
|
|
2669 | |
|
|
2670 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
|
|
2671 | am_transparent = 1; |
|
|
2672 | } |
|
|
2673 | |
|
|
2674 | for (; i < (int) (sizeof (parent) / sizeof (Window)); i++) |
|
|
2675 | parent[i] = None; |
|
|
2676 | } |
|
|
2677 | |
|
|
2678 | if (scrollBar.win) |
|
|
2679 | { |
|
|
2680 | XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); |
|
|
2681 | scrollBar.setIdle (); |
|
|
2682 | scrollbar_show (0); |
|
|
2683 | } |
|
|
2684 | |
|
|
2685 | if (am_transparent) |
|
|
2686 | { |
|
|
2687 | want_refresh = want_full_refresh = 1; |
|
|
2688 | if (am_pixmap_trans) |
|
|
2689 | flush (); |
|
|
2690 | } |
|
|
2691 | |
|
|
2692 | return pchanged; |
|
|
2693 | } |
|
|
2694 | #endif |
|
|
2695 | |
|
|
2696 | /*}}} */ |
2234 | /*}}} */ |
2697 | |
2235 | |
2698 | bool |
2236 | bool |
2699 | rxvt_term::cmd_parse () |
2237 | rxvt_term::cmd_parse () |
2700 | { |
2238 | { |
… | |
… | |
2748 | if (ch == C0_LF) |
2286 | if (ch == C0_LF) |
2749 | nlines++; |
2287 | nlines++; |
2750 | |
2288 | |
2751 | refresh_count++; |
2289 | refresh_count++; |
2752 | |
2290 | |
2753 | if (!option (Opt_jumpScroll) |
2291 | if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) |
2754 | || (refresh_count >= refresh_limit * (nrow - 1))) |
|
|
2755 | { |
2292 | { |
2756 | refreshnow = true; |
|
|
2757 | refresh_count = 0; |
2293 | refresh_count = 0; |
|
|
2294 | |
|
|
2295 | if (!option (Opt_skipScroll) || io_manager::now () > NOW + 1. / 60.) |
|
|
2296 | { |
|
|
2297 | refreshnow = true; |
2758 | ch = NOCHAR; |
2298 | ch = NOCHAR; |
2759 | break; |
2299 | break; |
|
|
2300 | } |
2760 | } |
2301 | } |
2761 | |
2302 | |
2762 | // scr_add_lines only works for nlines <= nrow - 1. |
2303 | // scr_add_lines only works for nlines <= nrow - 1. |
2763 | if (nlines >= nrow - 1) |
2304 | if (nlines >= nrow - 1) |
2764 | { |
2305 | { |
… | |
… | |
2792 | && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) |
2333 | && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) |
2793 | scr_add_lines (buf, str - buf, nlines); |
2334 | scr_add_lines (buf, str - buf, nlines); |
2794 | |
2335 | |
2795 | /* |
2336 | /* |
2796 | * If there have been a lot of new lines, then update the screen |
2337 | * If there have been a lot of new lines, then update the screen |
2797 | * What the heck I'll cheat and only refresh less than every page-full. |
2338 | * What the heck we'll cheat and only refresh less than every page-full. |
2798 | * the number of pages between refreshes is refresh_limit, which |
2339 | * if skipScroll is enabled. |
2799 | * is incremented here because we must be doing flat-out scrolling. |
|
|
2800 | */ |
2340 | */ |
2801 | if (refreshnow) |
2341 | if (refreshnow) |
2802 | { |
2342 | { |
2803 | if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
|
|
2804 | refresh_limit++; |
|
|
2805 | else |
|
|
2806 | { |
|
|
2807 | flag = true; |
2343 | flag = true; |
2808 | //TODO: due to popular request, implement "skipscroll" option here |
|
|
2809 | scr_refresh (); |
2344 | scr_refresh (); |
2810 | want_refresh = 1; |
2345 | want_refresh = 1; |
2811 | } |
|
|
2812 | } |
2346 | } |
2813 | |
2347 | |
2814 | } |
2348 | } |
2815 | else |
2349 | else |
2816 | { |
2350 | { |
… | |
… | |
2965 | { |
2499 | { |
2966 | if ((buf[len++] = cmd_getc ()) == 'i') |
2500 | if ((buf[len++] = cmd_getc ()) == 'i') |
2967 | break; /* done = 1 */ |
2501 | break; /* done = 1 */ |
2968 | } |
2502 | } |
2969 | } |
2503 | } |
2970 | |
2504 | |
2971 | for (i = 0; i < len; i++) |
2505 | for (i = 0; i < len; i++) |
2972 | if (putc (buf[i], fd) == EOF) |
2506 | if (putc (buf[i], fd) == EOF) |
2973 | { |
2507 | { |
2974 | done = 1; |
2508 | done = 1; |
2975 | break; |
2509 | break; |
… | |
… | |
3037 | process_dcs_seq (); |
2571 | process_dcs_seq (); |
3038 | break; |
2572 | break; |
3039 | case 0x9b: /* CSI */ |
2573 | case 0x9b: /* CSI */ |
3040 | process_csi_seq (); |
2574 | process_csi_seq (); |
3041 | break; |
2575 | break; |
3042 | case 0x9d: /* CSI */ |
2576 | case 0x9d: /* OSC */ |
3043 | process_osc_seq (); |
2577 | process_osc_seq (); |
3044 | break; |
2578 | break; |
3045 | #endif |
2579 | #endif |
3046 | } |
2580 | } |
3047 | } |
2581 | } |
… | |
… | |
3275 | unicode_t ch, priv, i; |
2809 | unicode_t ch, priv, i; |
3276 | unsigned int nargs, p; |
2810 | unsigned int nargs, p; |
3277 | int n, ndef; |
2811 | int n, ndef; |
3278 | int arg[ESC_ARGS]; |
2812 | int arg[ESC_ARGS]; |
3279 | |
2813 | |
3280 | for (nargs = ESC_ARGS; nargs > 0;) |
2814 | memset (arg, 0, sizeof (arg)); |
3281 | arg[--nargs] = 0; |
2815 | nargs = 0; |
3282 | |
2816 | |
3283 | priv = 0; |
2817 | priv = 0; |
3284 | ch = cmd_getc (); |
2818 | ch = cmd_getc (); |
3285 | if (ch >= '<' && ch <= '?') |
2819 | if (ch >= '<' && ch <= '?') |
3286 | { /* '<' '=' '>' '?' */ |
2820 | { /* '<' '=' '>' '?' */ |
… | |
… | |
3330 | switch (priv) |
2864 | switch (priv) |
3331 | { |
2865 | { |
3332 | case '>': |
2866 | case '>': |
3333 | if (ch == CSI_DA) /* secondary device attributes */ |
2867 | if (ch == CSI_DA) /* secondary device attributes */ |
3334 | { |
2868 | { |
3335 | // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, |
2869 | // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt, |
3336 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2870 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
3337 | // |
2871 | // |
3338 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2872 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
3339 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
2873 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
3340 | // that we do not support xterm mouse reporting (should be 95 when we do). |
2874 | // that we do not support xterm mouse reporting (should be 95 when we do). |
… | |
… | |
3793 | int saveop = op; |
3327 | int saveop = op; |
3794 | |
3328 | |
3795 | dLocal (Display *, dpy); |
3329 | dLocal (Display *, dpy); |
3796 | |
3330 | |
3797 | assert (str != NULL); |
3331 | assert (str != NULL); |
3798 | |
3332 | |
3799 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3333 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3800 | return; |
3334 | return; |
3801 | |
3335 | |
3802 | switch (op) |
3336 | switch (op) |
3803 | { |
3337 | { |
… | |
… | |
3898 | break; |
3432 | break; |
3899 | case URxvt_Color_IT: |
3433 | case URxvt_Color_IT: |
3900 | process_color_seq (op, Color_IT, str, resp); |
3434 | process_color_seq (op, Color_IT, str, resp); |
3901 | break; |
3435 | break; |
3902 | #endif |
3436 | #endif |
3903 | #if TRANSPARENT && TINTING |
3437 | #if ENABLE_TRANSPARENCY && TINTING |
3904 | case URxvt_Color_tint: |
3438 | case URxvt_Color_tint: |
3905 | process_color_seq (op, Color_tint, str, resp); |
3439 | process_color_seq (op, Color_tint, str, resp); |
3906 | |
3440 | |
3907 | check_our_parents (); |
3441 | check_our_parents (); |
3908 | |
3442 | |
… | |
… | |
3910 | want_full_refresh = want_refresh = 1; |
3444 | want_full_refresh = want_refresh = 1; |
3911 | |
3445 | |
3912 | break; |
3446 | break; |
3913 | #endif |
3447 | #endif |
3914 | |
3448 | |
|
|
3449 | #if XPM_BACKGROUND |
3915 | case Rxvt_Pixmap: |
3450 | case Rxvt_Pixmap: |
3916 | { |
3451 | { |
3917 | if (*str != ';') |
3452 | if (*str != ';') |
3918 | { |
3453 | { |
3919 | #if XPM_BACKGROUND |
|
|
3920 | scale_pixmap (""); /* reset to default scaling */ |
3454 | bgPixmap.handle_geometry (""); /* reset to default scaling */ |
3921 | set_bgPixmap (str); /* change pixmap */ |
3455 | set_bgPixmap (str); /* change pixmap */ |
3922 | scr_touch (true); |
3456 | scr_touch (true); |
3923 | #endif |
|
|
3924 | } |
3457 | } |
3925 | |
3458 | |
3926 | int changed = 0; |
3459 | int changed = 0; |
3927 | |
3460 | |
3928 | while ((str = strchr (str, ';')) != NULL) |
3461 | while ((str = strchr (str, ';')) != NULL) |
3929 | { |
3462 | { |
3930 | str++; |
3463 | str++; |
3931 | #if XPM_BACKGROUND |
3464 | changed += bgPixmap.handle_geometry (str); |
3932 | changed += scale_pixmap (str); |
|
|
3933 | #endif |
|
|
3934 | } |
3465 | } |
3935 | |
3466 | |
3936 | if (changed) |
3467 | if (changed) |
3937 | { |
3468 | { |
3938 | #ifdef XPM_BACKGROUND |
|
|
3939 | resize_pixmap (); |
3469 | resize_pixmap (); |
3940 | scr_touch (true); |
3470 | scr_touch (true); |
3941 | #endif |
|
|
3942 | } |
3471 | } |
|
|
3472 | #if ENABLE_TRANSPARENCY && defined(HAVE_AFTERIMAGE) |
|
|
3473 | if (option (Opt_transparent)) |
|
|
3474 | check_our_parents (); |
|
|
3475 | #endif |
3943 | } |
3476 | } |
3944 | break; |
3477 | break; |
|
|
3478 | #endif |
3945 | |
3479 | |
3946 | case Rxvt_restoreFG: |
3480 | case Rxvt_restoreFG: |
3947 | set_window_color (Color_fg, str); |
3481 | set_window_color (Color_fg, str); |
3948 | break; |
3482 | break; |
3949 | case Rxvt_restoreBG: |
3483 | case Rxvt_restoreBG: |