… | |
… | |
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 |
… | |
… | |
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; |
… | |
… | |
877 | return; |
885 | return; |
878 | |
886 | |
879 | if (len <= 0) |
887 | if (len <= 0) |
880 | return; /* not mapped */ |
888 | return; /* not mapped */ |
881 | |
889 | |
882 | if (OPTION (Opt_scrollTtyKeypress)) |
890 | if (option (Opt_scrollTtyKeypress)) |
883 | if (view_start) |
891 | if (view_start) |
884 | { |
892 | { |
885 | view_start = 0; |
893 | view_start = 0; |
886 | want_refresh = 1; |
894 | want_refresh = 1; |
887 | } |
895 | } |
… | |
… | |
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"); |
… | |
… | |
1178 | |
1186 | |
1179 | #if LINUX_YIELD_HACK |
1187 | #if LINUX_YIELD_HACK |
1180 | static struct event_handler |
1188 | static struct event_handler |
1181 | { |
1189 | { |
1182 | check_watcher yield_ev; |
1190 | check_watcher yield_ev; |
1183 | |
1191 | |
1184 | void yield_cb (check_watcher &w) |
1192 | void yield_cb (check_watcher &w) |
1185 | { |
1193 | { |
1186 | // this should really be sched_yield(), but the linux guys thought |
1194 | // this should really be sched_yield(), but the linux guys thought |
1187 | // that giving a process calling sched_yield () less cpu time than |
1195 | // 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 |
1196 | // ones with high nice levels is a useful thing to do. It surely is is |
… | |
… | |
1232 | } |
1240 | } |
1233 | else |
1241 | else |
1234 | { |
1242 | { |
1235 | pty_ev.stop (); |
1243 | pty_ev.stop (); |
1236 | |
1244 | |
1237 | if (!OPTION (Opt_hold)) |
1245 | if (!option (Opt_hold)) |
1238 | destroy (); |
1246 | destroy (); |
1239 | } |
1247 | } |
1240 | |
1248 | |
1241 | return false; |
1249 | return false; |
1242 | } |
1250 | } |
1243 | |
1251 | |
1244 | void |
1252 | void |
1245 | rxvt_term::pty_cb (io_watcher &w, short revents) |
1253 | rxvt_term::pty_cb (io_watcher &w, short revents) |
… | |
… | |
1263 | recolour_cursor (); |
1271 | recolour_cursor (); |
1264 | |
1272 | |
1265 | #ifdef POINTER_BLANK |
1273 | #ifdef POINTER_BLANK |
1266 | hidden_pointer = 0; |
1274 | hidden_pointer = 0; |
1267 | |
1275 | |
1268 | if (OPTION (Opt_pointerBlank)) |
1276 | if (option (Opt_pointerBlank)) |
1269 | pointer_ev.start (NOW + pointerBlankDelay); |
1277 | pointer_ev.start (NOW + pointerBlankDelay); |
1270 | #endif |
1278 | #endif |
1271 | } |
1279 | } |
1272 | |
1280 | |
1273 | #ifdef POINTER_BLANK |
1281 | #ifdef POINTER_BLANK |
1274 | void |
1282 | void |
1275 | rxvt_term::pointer_blank () |
1283 | rxvt_term::pointer_blank () |
1276 | { |
1284 | { |
1277 | if (!OPTION (Opt_pointerBlank)) |
1285 | if (!option (Opt_pointerBlank)) |
1278 | return; |
1286 | return; |
1279 | |
1287 | |
1280 | XDefineCursor (dpy, vt, display->blank_cursor); |
1288 | XDefineCursor (dpy, vt, display->blank_cursor); |
1281 | XFlush (dpy); |
1289 | XFlush (dpy); |
1282 | |
1290 | |
… | |
… | |
1458 | break; |
1466 | break; |
1459 | } |
1467 | } |
1460 | break; |
1468 | break; |
1461 | |
1469 | |
1462 | case FocusIn: |
1470 | case FocusIn: |
|
|
1471 | if (ev.xfocus.detail != NotifyInferior |
|
|
1472 | && ev.xfocus.detail != NotifyPointer |
|
|
1473 | && ev.xfocus.mode != NotifyGrab) |
1463 | focus_in (); |
1474 | focus_in (); |
1464 | break; |
1475 | break; |
1465 | |
1476 | |
1466 | case FocusOut: |
1477 | case FocusOut: |
|
|
1478 | if (ev.xfocus.detail != NotifyInferior |
|
|
1479 | && ev.xfocus.detail != NotifyPointer |
|
|
1480 | && ev.xfocus.mode != NotifyGrab) |
1467 | focus_out (); |
1481 | focus_out (); |
1468 | break; |
1482 | break; |
1469 | |
1483 | |
1470 | case ConfigureNotify: |
1484 | case ConfigureNotify: |
1471 | if (ev.xconfigure.window == parent[0]) |
1485 | if (ev.xconfigure.window == parent[0]) |
1472 | { |
1486 | { |
… | |
… | |
1475 | |
1489 | |
1476 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1490 | if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) |
1477 | { |
1491 | { |
1478 | seen_resize = 1; |
1492 | seen_resize = 1; |
1479 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1493 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
|
|
1494 | #ifdef XPM_BACKGROUND |
|
|
1495 | if (!option (Opt_transparent) && bgPixmap.auto_resize) |
|
|
1496 | { |
|
|
1497 | resize_pixmap (); |
|
|
1498 | scr_touch (true); |
|
|
1499 | } |
|
|
1500 | #endif |
1480 | } |
1501 | } |
1481 | |
1502 | |
1482 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1503 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1483 | |
1504 | |
1484 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1505 | #ifdef TRANSPARENT |
1485 | if (OPTION (Opt_transparent)) |
1506 | if (option (Opt_transparent)) |
1486 | check_our_parents (); |
1507 | check_our_parents (); |
1487 | #endif |
1508 | #endif |
1488 | } |
1509 | } |
1489 | break; |
1510 | break; |
1490 | |
1511 | |
… | |
… | |
1679 | } |
1700 | } |
1680 | break; |
1701 | break; |
1681 | } |
1702 | } |
1682 | |
1703 | |
1683 | #if defined(CURSOR_BLINK) |
1704 | #if defined(CURSOR_BLINK) |
1684 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1705 | if (option (Opt_cursorBlink) && ev.type == KeyPress) |
1685 | { |
1706 | { |
1686 | if (hidden_cursor) |
1707 | if (hidden_cursor) |
1687 | { |
1708 | { |
1688 | hidden_cursor = 0; |
1709 | hidden_cursor = 0; |
1689 | want_refresh = 1; |
1710 | want_refresh = 1; |
… | |
… | |
1692 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1713 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1693 | } |
1714 | } |
1694 | #endif |
1715 | #endif |
1695 | |
1716 | |
1696 | #if defined(POINTER_BLANK) |
1717 | #if defined(POINTER_BLANK) |
1697 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1718 | if (option (Opt_pointerBlank) && pointerBlankDelay > 0) |
1698 | { |
1719 | { |
1699 | if (ev.type == MotionNotify |
1720 | if (ev.type == MotionNotify |
1700 | || ev.type == ButtonPress |
1721 | || ev.type == ButtonPress |
1701 | || ev.type == ButtonRelease) |
1722 | || ev.type == ButtonRelease) |
1702 | if (hidden_pointer) |
1723 | if (hidden_pointer) |
… | |
… | |
1724 | IMSetPosition (); |
1745 | IMSetPosition (); |
1725 | XSetICFocus (Input_Context); |
1746 | XSetICFocus (Input_Context); |
1726 | } |
1747 | } |
1727 | #endif |
1748 | #endif |
1728 | #if CURSOR_BLINK |
1749 | #if CURSOR_BLINK |
1729 | if (OPTION (Opt_cursorBlink)) |
1750 | if (option (Opt_cursorBlink)) |
1730 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1751 | cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); |
1731 | #endif |
1752 | #endif |
1732 | #if OFF_FOCUS_FADING |
1753 | #if OFF_FOCUS_FADING |
1733 | if (rs[Rs_fade]) |
1754 | if (rs[Rs_fade]) |
1734 | { |
1755 | { |
1735 | pix_colors = pix_colors_focused; |
1756 | pix_colors = pix_colors_focused; |
1736 | scr_recolour (); |
1757 | scr_recolour (); |
|
|
1758 | } |
|
|
1759 | #endif |
|
|
1760 | #if ENABLE_FRILLS |
|
|
1761 | if (option (Opt_urgentOnBell)) |
|
|
1762 | { |
|
|
1763 | XWMHints *h; |
|
|
1764 | |
|
|
1765 | h = XGetWMHints(dpy, parent[0]); |
|
|
1766 | if (h != NULL) |
|
|
1767 | { |
|
|
1768 | h->flags &= ~XUrgencyHint; |
|
|
1769 | XSetWMHints(dpy, parent[0], h); |
|
|
1770 | } |
1737 | } |
1771 | } |
1738 | #endif |
1772 | #endif |
1739 | } |
1773 | } |
1740 | } |
1774 | } |
1741 | |
1775 | |
… | |
… | |
1761 | #if USE_XIM |
1795 | #if USE_XIM |
1762 | if (Input_Context != NULL) |
1796 | if (Input_Context != NULL) |
1763 | XUnsetICFocus (Input_Context); |
1797 | XUnsetICFocus (Input_Context); |
1764 | #endif |
1798 | #endif |
1765 | #if CURSOR_BLINK |
1799 | #if CURSOR_BLINK |
1766 | if (OPTION (Opt_cursorBlink)) |
1800 | if (option (Opt_cursorBlink)) |
1767 | cursor_blink_ev.stop (); |
1801 | cursor_blink_ev.stop (); |
1768 | hidden_cursor = 0; |
1802 | hidden_cursor = 0; |
1769 | #endif |
1803 | #endif |
1770 | #if OFF_FOCUS_FADING |
1804 | #if OFF_FOCUS_FADING |
1771 | if (rs[Rs_fade]) |
1805 | if (rs[Rs_fade]) |
… | |
… | |
1788 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1822 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
1789 | } |
1823 | } |
1790 | #endif |
1824 | #endif |
1791 | } |
1825 | } |
1792 | |
1826 | |
1793 | #if TRANSPARENT |
1827 | #if TRANSPARENT || ENABLE_PERL |
1794 | void |
1828 | void |
1795 | rxvt_term::rootwin_cb (XEvent &ev) |
1829 | rxvt_term::rootwin_cb (XEvent &ev) |
1796 | { |
1830 | { |
1797 | make_current (); |
1831 | make_current (); |
1798 | |
1832 | |
|
|
1833 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
|
|
1834 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
|
|
1835 | return; |
|
|
1836 | |
|
|
1837 | # if TRANSPARENT |
1799 | switch (ev.type) |
1838 | switch (ev.type) |
1800 | { |
1839 | { |
1801 | case PropertyNotify: |
1840 | case PropertyNotify: |
1802 | /* |
1841 | /* |
1803 | * if user used some Esetroot compatible prog to set the root bg, |
1842 | * if user used some Esetroot compatible prog to set the root bg, |
… | |
… | |
1807 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1846 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1808 | return; |
1847 | return; |
1809 | |
1848 | |
1810 | /* FALLTHROUGH */ |
1849 | /* FALLTHROUGH */ |
1811 | case ReparentNotify: |
1850 | case ReparentNotify: |
1812 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1851 | if (option (Opt_transparent)) |
1813 | want_refresh = want_full_refresh = 1; |
1852 | check_our_parents (); |
1814 | break; |
1853 | break; |
1815 | } |
1854 | } |
|
|
1855 | # endif |
1816 | } |
1856 | } |
1817 | #endif |
1857 | #endif |
1818 | |
1858 | |
1819 | void |
1859 | void |
1820 | rxvt_term::button_press (XButtonEvent &ev) |
1860 | rxvt_term::button_press (XButtonEvent &ev) |
… | |
… | |
2148 | selection_make (ev.time); |
2188 | selection_make (ev.time); |
2149 | break; |
2189 | break; |
2150 | |
2190 | |
2151 | case Button2: |
2191 | case Button2: |
2152 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2192 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2153 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); |
2193 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); |
2154 | break; |
2194 | break; |
2155 | |
2195 | |
2156 | #ifdef MOUSE_WHEEL |
2196 | #ifdef MOUSE_WHEEL |
2157 | case Button4: |
2197 | case Button4: |
2158 | case Button5: |
2198 | case Button5: |
… | |
… | |
2162 | |
2202 | |
2163 | v = ev.button == Button4 ? UP : DN; |
2203 | v = ev.button == Button4 ? UP : DN; |
2164 | |
2204 | |
2165 | if (ev.state & ShiftMask) |
2205 | if (ev.state & ShiftMask) |
2166 | i = 1; |
2206 | i = 1; |
2167 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2207 | else if (option (Opt_mouseWheelScrollPage)) |
2168 | i = nrow - 1; |
2208 | i = nrow - 1; |
2169 | else |
2209 | else |
2170 | i = 5; |
2210 | i = 5; |
2171 | |
2211 | |
2172 | # ifdef MOUSE_SLIP_WHEELING |
2212 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2193 | break; |
2233 | break; |
2194 | #endif |
2234 | #endif |
2195 | } |
2235 | } |
2196 | } |
2236 | } |
2197 | } |
2237 | } |
2198 | |
|
|
2199 | #ifdef TRANSPARENT |
|
|
2200 | #if TINTING |
|
|
2201 | /* taken from aterm-0.4.2 */ |
|
|
2202 | |
|
|
2203 | typedef uint32_t RUINT32T; |
|
|
2204 | |
|
|
2205 | void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm) |
|
|
2206 | { |
|
|
2207 | int sh_r, sh_g, sh_b; |
|
|
2208 | RUINT32T mask_r, mask_g, mask_b; |
|
|
2209 | RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b; |
|
|
2210 | unsigned int lower_lim_r, lower_lim_g, lower_lim_b; |
|
|
2211 | unsigned int upper_lim_r, upper_lim_g, upper_lim_b; |
|
|
2212 | int i; |
|
|
2213 | |
|
|
2214 | Visual *visual = term->visual; |
|
|
2215 | |
|
|
2216 | if( visual->c_class != TrueColor || srcImage->format != ZPixmap ) return ; |
|
|
2217 | |
|
|
2218 | /* for convenience */ |
|
|
2219 | mask_r = visual->red_mask; |
|
|
2220 | mask_g = visual->green_mask; |
|
|
2221 | mask_b = visual->blue_mask; |
|
|
2222 | |
|
|
2223 | /* boring lookup table pre-initialization */ |
|
|
2224 | switch (srcImage->bits_per_pixel) { |
|
|
2225 | case 15: |
|
|
2226 | if ((mask_r != 0x7c00) || |
|
|
2227 | (mask_g != 0x03e0) || |
|
|
2228 | (mask_b != 0x001f)) |
|
|
2229 | return; |
|
|
2230 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+32+32)); |
|
|
2231 | lookup_r = lookup; |
|
|
2232 | lookup_g = lookup+32; |
|
|
2233 | lookup_b = lookup+32+32; |
|
|
2234 | sh_r = 10; |
|
|
2235 | sh_g = 5; |
|
|
2236 | sh_b = 0; |
|
|
2237 | break; |
|
|
2238 | case 16: |
|
|
2239 | if ((mask_r != 0xf800) || |
|
|
2240 | (mask_g != 0x07e0) || |
|
|
2241 | (mask_b != 0x001f)) |
|
|
2242 | return; |
|
|
2243 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+64+32)); |
|
|
2244 | lookup_r = lookup; |
|
|
2245 | lookup_g = lookup+32; |
|
|
2246 | lookup_b = lookup+32+64; |
|
|
2247 | sh_r = 11; |
|
|
2248 | sh_g = 5; |
|
|
2249 | sh_b = 0; |
|
|
2250 | break; |
|
|
2251 | case 24: |
|
|
2252 | if ((mask_r != 0xff0000) || |
|
|
2253 | (mask_g != 0x00ff00) || |
|
|
2254 | (mask_b != 0x0000ff)) |
|
|
2255 | return; |
|
|
2256 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256)); |
|
|
2257 | lookup_r = lookup; |
|
|
2258 | lookup_g = lookup+256; |
|
|
2259 | lookup_b = lookup+256+256; |
|
|
2260 | sh_r = 16; |
|
|
2261 | sh_g = 8; |
|
|
2262 | sh_b = 0; |
|
|
2263 | break; |
|
|
2264 | case 32: |
|
|
2265 | if ((mask_r != 0xff0000) || |
|
|
2266 | (mask_g != 0x00ff00) || |
|
|
2267 | (mask_b != 0x0000ff)) |
|
|
2268 | return; |
|
|
2269 | lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256)); |
|
|
2270 | lookup_r = lookup; |
|
|
2271 | lookup_g = lookup+256; |
|
|
2272 | lookup_b = lookup+256+256; |
|
|
2273 | sh_r = 16; |
|
|
2274 | sh_g = 8; |
|
|
2275 | sh_b = 0; |
|
|
2276 | break; |
|
|
2277 | default: |
|
|
2278 | return; /* we do not support this color depth */ |
|
|
2279 | } |
|
|
2280 | |
|
|
2281 | /* prepare limits for color transformation (each channel is handled separately) */ |
|
|
2282 | if (shade < 0) { |
|
|
2283 | shade = -shade; |
|
|
2284 | if (shade < 0) shade = 0; |
|
|
2285 | if (shade > 100) shade = 100; |
|
|
2286 | |
|
|
2287 | lower_lim_r = 65535-rm; |
|
|
2288 | lower_lim_g = 65535-gm; |
|
|
2289 | lower_lim_b = 65535-bm; |
|
|
2290 | |
|
|
2291 | lower_lim_r = 65535-(unsigned int)(((RUINT32T)lower_lim_r)*((RUINT32T)shade)/100); |
|
|
2292 | lower_lim_g = 65535-(unsigned int)(((RUINT32T)lower_lim_g)*((RUINT32T)shade)/100); |
|
|
2293 | lower_lim_b = 65535-(unsigned int)(((RUINT32T)lower_lim_b)*((RUINT32T)shade)/100); |
|
|
2294 | |
|
|
2295 | upper_lim_r = upper_lim_g = upper_lim_b = 65535; |
|
|
2296 | } else { |
|
|
2297 | if (shade < 0) shade = 0; |
|
|
2298 | if (shade > 100) shade = 100; |
|
|
2299 | |
|
|
2300 | lower_lim_r = lower_lim_g = lower_lim_b = 0; |
|
|
2301 | |
|
|
2302 | upper_lim_r = (unsigned int)((((RUINT32T)rm)*((RUINT32T)shade))/100); |
|
|
2303 | upper_lim_g = (unsigned int)((((RUINT32T)gm)*((RUINT32T)shade))/100); |
|
|
2304 | upper_lim_b = (unsigned int)((((RUINT32T)bm)*((RUINT32T)shade))/100); |
|
|
2305 | } |
|
|
2306 | |
|
|
2307 | /* switch red and blue bytes if necessary, we need it for some weird XServers like XFree86 3.3.3.1 */ |
|
|
2308 | if ((srcImage->bits_per_pixel == 24) && (mask_r >= 0xFF0000 )) |
|
|
2309 | { |
|
|
2310 | unsigned int tmp; |
|
|
2311 | |
|
|
2312 | tmp = lower_lim_r; |
|
|
2313 | lower_lim_r = lower_lim_b; |
|
|
2314 | lower_lim_b = tmp; |
|
|
2315 | |
|
|
2316 | tmp = upper_lim_r; |
|
|
2317 | upper_lim_r = upper_lim_b; |
|
|
2318 | upper_lim_b = tmp; |
|
|
2319 | } |
|
|
2320 | |
|
|
2321 | /* fill our lookup tables */ |
|
|
2322 | for (i = 0; i <= mask_r>>sh_r; i++) |
|
|
2323 | { |
|
|
2324 | RUINT32T tmp; |
|
|
2325 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_r-lower_lim_r)); |
|
|
2326 | tmp += ((RUINT32T)(mask_r>>sh_r))*((RUINT32T)lower_lim_r); |
|
|
2327 | lookup_r[i] = (tmp/65535)<<sh_r; |
|
|
2328 | } |
|
|
2329 | for (i = 0; i <= mask_g>>sh_g; i++) |
|
|
2330 | { |
|
|
2331 | RUINT32T tmp; |
|
|
2332 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_g-lower_lim_g)); |
|
|
2333 | tmp += ((RUINT32T)(mask_g>>sh_g))*((RUINT32T)lower_lim_g); |
|
|
2334 | lookup_g[i] = (tmp/65535)<<sh_g; |
|
|
2335 | } |
|
|
2336 | for (i = 0; i <= mask_b>>sh_b; i++) |
|
|
2337 | { |
|
|
2338 | RUINT32T tmp; |
|
|
2339 | tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_b-lower_lim_b)); |
|
|
2340 | tmp += ((RUINT32T)(mask_b>>sh_b))*((RUINT32T)lower_lim_b); |
|
|
2341 | lookup_b[i] = (tmp/65535)<<sh_b; |
|
|
2342 | } |
|
|
2343 | |
|
|
2344 | /* apply table to input image (replacing colors by newly calculated ones) */ |
|
|
2345 | switch (srcImage->bits_per_pixel) |
|
|
2346 | { |
|
|
2347 | case 15: |
|
|
2348 | { |
|
|
2349 | unsigned short *p1, *pf, *p, *pl; |
|
|
2350 | p1 = (unsigned short *) srcImage->data; |
|
|
2351 | pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2352 | while (p1 < pf) |
|
|
2353 | { |
|
|
2354 | p = p1; |
|
|
2355 | pl = p1 + srcImage->width; |
|
|
2356 | for (; p < pl; p++) |
|
|
2357 | { |
|
|
2358 | *p = lookup_r[(*p & 0x7c00)>>10] | |
|
|
2359 | lookup_g[(*p & 0x03e0)>> 5] | |
|
|
2360 | lookup_b[(*p & 0x001f)]; |
|
|
2361 | } |
|
|
2362 | p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2363 | } |
|
|
2364 | break; |
|
|
2365 | } |
|
|
2366 | case 16: |
|
|
2367 | { |
|
|
2368 | unsigned short *p1, *pf, *p, *pl; |
|
|
2369 | p1 = (unsigned short *) srcImage->data; |
|
|
2370 | pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2371 | while (p1 < pf) |
|
|
2372 | { |
|
|
2373 | p = p1; |
|
|
2374 | pl = p1 + srcImage->width; |
|
|
2375 | for (; p < pl; p++) |
|
|
2376 | { |
|
|
2377 | *p = lookup_r[(*p & 0xf800)>>11] | |
|
|
2378 | lookup_g[(*p & 0x07e0)>> 5] | |
|
|
2379 | lookup_b[(*p & 0x001f)]; |
|
|
2380 | } |
|
|
2381 | p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2382 | } |
|
|
2383 | break; |
|
|
2384 | } |
|
|
2385 | case 24: |
|
|
2386 | { |
|
|
2387 | unsigned char *p1, *pf, *p, *pl; |
|
|
2388 | p1 = (unsigned char *) srcImage->data; |
|
|
2389 | pf = (unsigned char *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2390 | while (p1 < pf) |
|
|
2391 | { |
|
|
2392 | p = p1; |
|
|
2393 | pl = p1 + srcImage->width * 3; |
|
|
2394 | for (; p < pl; p += 3) |
|
|
2395 | { |
|
|
2396 | p[0] = lookup_r[(p[0] & 0xff0000)>>16]; |
|
|
2397 | p[1] = lookup_r[(p[1] & 0x00ff00)>> 8]; |
|
|
2398 | p[2] = lookup_r[(p[2] & 0x0000ff)]; |
|
|
2399 | } |
|
|
2400 | p1 = (unsigned char *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2401 | } |
|
|
2402 | break; |
|
|
2403 | } |
|
|
2404 | case 32: |
|
|
2405 | { |
|
|
2406 | RUINT32T *p1, *pf, *p, *pl; |
|
|
2407 | p1 = (RUINT32T *) srcImage->data; |
|
|
2408 | pf = (RUINT32T *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); |
|
|
2409 | |
|
|
2410 | while (p1 < pf) |
|
|
2411 | { |
|
|
2412 | p = p1; |
|
|
2413 | pl = p1 + srcImage->width; |
|
|
2414 | for (; p < pl; p++) |
|
|
2415 | { |
|
|
2416 | *p = lookup_r[(*p & 0xff0000)>>16] | |
|
|
2417 | lookup_g[(*p & 0x00ff00)>> 8] | |
|
|
2418 | lookup_b[(*p & 0x0000ff)] | |
|
|
2419 | (*p & ~0xffffff); |
|
|
2420 | } |
|
|
2421 | p1 = (RUINT32T *) ((char *) p1 + srcImage->bytes_per_line); |
|
|
2422 | } |
|
|
2423 | break; |
|
|
2424 | } |
|
|
2425 | } |
|
|
2426 | |
|
|
2427 | free (lookup); |
|
|
2428 | } |
|
|
2429 | #endif |
|
|
2430 | |
|
|
2431 | /* |
|
|
2432 | * Check our parents are still who we think they are. |
|
|
2433 | * Do transparency updates if required |
|
|
2434 | */ |
|
|
2435 | int |
|
|
2436 | rxvt_term::check_our_parents () |
|
|
2437 | { |
|
|
2438 | int i, pchanged, aformat, have_pixmap, rootdepth; |
|
|
2439 | unsigned long nitems, bytes_after; |
|
|
2440 | Atom atype; |
|
|
2441 | unsigned char *prop = NULL; |
|
|
2442 | Window root, oldp, *list; |
|
|
2443 | Pixmap rootpixmap = None; |
|
|
2444 | XWindowAttributes wattr, wrootattr; |
|
|
2445 | |
|
|
2446 | pchanged = 0; |
|
|
2447 | |
|
|
2448 | if (!OPTION (Opt_transparent)) |
|
|
2449 | return pchanged; /* Don't try any more */ |
|
|
2450 | |
|
|
2451 | XGetWindowAttributes (dpy, display->root, &wrootattr); |
|
|
2452 | rootdepth = wrootattr.depth; |
|
|
2453 | |
|
|
2454 | XGetWindowAttributes (dpy, parent[0], &wattr); |
|
|
2455 | |
|
|
2456 | if (rootdepth != wattr.depth) |
|
|
2457 | { |
|
|
2458 | if (am_transparent) |
|
|
2459 | { |
|
|
2460 | pchanged = 1; |
|
|
2461 | XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]); |
|
|
2462 | am_transparent = am_pixmap_trans = 0; |
|
|
2463 | } |
|
|
2464 | |
|
|
2465 | return pchanged; /* Don't try any more */ |
|
|
2466 | } |
|
|
2467 | |
|
|
2468 | /* Get all X ops out of the queue so that our information is up-to-date. */ |
|
|
2469 | XSync (dpy, False); |
|
|
2470 | |
|
|
2471 | /* |
|
|
2472 | * Make the frame window set by the window manager have |
|
|
2473 | * the root background. Some window managers put multiple nested frame |
|
|
2474 | * windows for each client, so we have to take care about that. |
|
|
2475 | */ |
|
|
2476 | i = (xa[XA_XROOTPMAP_ID] |
|
|
2477 | && XGetWindowProperty (dpy, display->root, xa[XA_XROOTPMAP_ID], |
|
|
2478 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
2479 | &nitems, &bytes_after, &prop) == Success); |
|
|
2480 | |
|
|
2481 | if (!i || prop == NULL) |
|
|
2482 | i = (xa[XA_ESETROOT_PMAP_ID] |
|
|
2483 | && XGetWindowProperty (dpy, display->root, xa[XA_ESETROOT_PMAP_ID], |
|
|
2484 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
|
|
2485 | &nitems, &bytes_after, &prop) == Success); |
|
|
2486 | |
|
|
2487 | if (!i || prop == NULL |
|
|
2488 | #if TINTING |
|
|
2489 | || !ISSET_PIXCOLOR (Color_tint) |
|
|
2490 | #endif |
|
|
2491 | ) |
|
|
2492 | have_pixmap = 0; |
|
|
2493 | else |
|
|
2494 | { |
|
|
2495 | have_pixmap = 1; |
|
|
2496 | rootpixmap = *(Pixmap *)prop; |
|
|
2497 | XFree (prop); |
|
|
2498 | } |
|
|
2499 | |
|
|
2500 | if (have_pixmap) |
|
|
2501 | { |
|
|
2502 | /* |
|
|
2503 | * Copy display->root pixmap transparency |
|
|
2504 | */ |
|
|
2505 | int sx, sy, nx, ny; |
|
|
2506 | unsigned int nw, nh; |
|
|
2507 | Window cr; |
|
|
2508 | XImage *image; |
|
|
2509 | GC gc; |
|
|
2510 | XGCValues gcvalue; |
|
|
2511 | |
|
|
2512 | XTranslateCoordinates (dpy, parent[0], display->root, |
|
|
2513 | 0, 0, &sx, &sy, &cr); |
|
|
2514 | nw = (unsigned int)szHint.width; |
|
|
2515 | nh = (unsigned int)szHint.height; |
|
|
2516 | nx = ny = 0; |
|
|
2517 | |
|
|
2518 | if (sx < 0) |
|
|
2519 | { |
|
|
2520 | nw += sx; |
|
|
2521 | nx = -sx; |
|
|
2522 | sx = 0; |
|
|
2523 | } |
|
|
2524 | |
|
|
2525 | if (sy < 0) |
|
|
2526 | { |
|
|
2527 | nh += sy; |
|
|
2528 | ny = -sy; |
|
|
2529 | sy = 0; |
|
|
2530 | } |
|
|
2531 | |
|
|
2532 | min_it (nw, (unsigned int) (wrootattr.width - sx)); |
|
|
2533 | min_it (nh, (unsigned int) (wrootattr.height - sy)); |
|
|
2534 | |
|
|
2535 | XSync (dpy, False); |
|
|
2536 | allowedxerror = -1; |
|
|
2537 | image = XGetImage (dpy, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
|
|
2538 | |
|
|
2539 | /* XXX: handle BadMatch - usually because we're outside the pixmap */ |
|
|
2540 | /* XXX: may need a delay here? */ |
|
|
2541 | allowedxerror = 0; |
|
|
2542 | |
|
|
2543 | if (image == NULL) |
|
|
2544 | { |
|
|
2545 | if (am_transparent && am_pixmap_trans) |
|
|
2546 | { |
|
|
2547 | pchanged = 1; |
|
|
2548 | if (pixmap != None) |
|
|
2549 | { |
|
|
2550 | XFreePixmap (dpy, pixmap); |
|
|
2551 | pixmap = None; |
|
|
2552 | } |
|
|
2553 | } |
|
|
2554 | |
|
|
2555 | am_pixmap_trans = 0; |
|
|
2556 | } |
|
|
2557 | else |
|
|
2558 | { |
|
|
2559 | if (pixmap != None) |
|
|
2560 | XFreePixmap (dpy, pixmap); |
|
|
2561 | |
|
|
2562 | #if TINTING |
|
|
2563 | if (ISSET_PIXCOLOR (Color_tint)) |
|
|
2564 | { |
|
|
2565 | int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
|
|
2566 | |
|
|
2567 | rgba c; |
|
|
2568 | pix_colors_focused [Color_tint].get (c); |
|
|
2569 | |
|
|
2570 | ShadeXImage (this, image, shade, c.r, c.g, c.b); |
|
|
2571 | } |
|
|
2572 | #endif |
|
|
2573 | |
|
|
2574 | pixmap = XCreatePixmap (dpy, vt, szHint.width, szHint.height, image->depth); |
|
|
2575 | gc = XCreateGC (dpy, vt, 0UL, &gcvalue); |
|
|
2576 | XPutImage (dpy, pixmap, gc, image, 0, 0, |
|
|
2577 | nx, ny, image->width, image->height); |
|
|
2578 | XFreeGC (dpy, gc); |
|
|
2579 | XDestroyImage (image); |
|
|
2580 | XSetWindowBackgroundPixmap (dpy, parent[0], pixmap); |
|
|
2581 | XClearWindow (dpy, parent[0]); |
|
|
2582 | |
|
|
2583 | if (!am_transparent || !am_pixmap_trans) |
|
|
2584 | pchanged = 1; |
|
|
2585 | |
|
|
2586 | am_transparent = am_pixmap_trans = 1; |
|
|
2587 | } |
|
|
2588 | } |
|
|
2589 | |
|
|
2590 | if (am_pixmap_trans) |
|
|
2591 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
|
|
2592 | else |
|
|
2593 | { |
|
|
2594 | unsigned int n; |
|
|
2595 | /* |
|
|
2596 | * InheritPixmap transparency |
|
|
2597 | */ |
|
|
2598 | for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++) |
|
|
2599 | { |
|
|
2600 | oldp = parent[i]; |
|
|
2601 | XQueryTree (dpy, parent[i - 1], &root, &parent[i], &list, &n); |
|
|
2602 | XFree (list); |
|
|
2603 | |
|
|
2604 | if (parent[i] == display->root) |
|
|
2605 | { |
|
|
2606 | if (oldp != None) |
|
|
2607 | pchanged = 1; |
|
|
2608 | |
|
|
2609 | break; |
|
|
2610 | } |
|
|
2611 | |
|
|
2612 | if (oldp != parent[i]) |
|
|
2613 | pchanged = 1; |
|
|
2614 | } |
|
|
2615 | |
|
|
2616 | n = 0; |
|
|
2617 | |
|
|
2618 | if (pchanged) |
|
|
2619 | for (; n < (unsigned int)i; n++) |
|
|
2620 | { |
|
|
2621 | XGetWindowAttributes (dpy, parent[n], &wattr); |
|
|
2622 | |
|
|
2623 | if (wattr.depth != rootdepth || wattr.c_class == InputOnly) |
|
|
2624 | { |
|
|
2625 | n = (int) (sizeof (parent) / sizeof (Window)) + 1; |
|
|
2626 | break; |
|
|
2627 | } |
|
|
2628 | } |
|
|
2629 | |
|
|
2630 | if (n > (sizeof (parent) / sizeof (parent[0]))) |
|
|
2631 | { |
|
|
2632 | XSetWindowBackground (dpy, parent[0], pix_colors_focused[Color_border]); |
|
|
2633 | XSetWindowBackground (dpy, vt, pix_colors_focused[Color_bg]); |
|
|
2634 | am_transparent = 0; |
|
|
2635 | /* XXX: also turn off Opt_transparent? */ |
|
|
2636 | } |
|
|
2637 | else |
|
|
2638 | { |
|
|
2639 | for (n = 0; n < (unsigned int)i; n++) |
|
|
2640 | { |
|
|
2641 | XSetWindowBackgroundPixmap (dpy, parent[n], ParentRelative); |
|
|
2642 | XClearWindow (dpy, parent[n]); |
|
|
2643 | } |
|
|
2644 | |
|
|
2645 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
|
|
2646 | am_transparent = 1; |
|
|
2647 | } |
|
|
2648 | |
|
|
2649 | for (; i < (int) (sizeof (parent) / sizeof (Window)); i++) |
|
|
2650 | parent[i] = None; |
|
|
2651 | } |
|
|
2652 | |
|
|
2653 | if (scrollBar.win) |
|
|
2654 | { |
|
|
2655 | XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); |
|
|
2656 | scrollBar.setIdle (); |
|
|
2657 | scrollbar_show (0); |
|
|
2658 | } |
|
|
2659 | |
|
|
2660 | if (am_transparent) |
|
|
2661 | { |
|
|
2662 | want_refresh = want_full_refresh = 1; |
|
|
2663 | if (am_pixmap_trans) |
|
|
2664 | flush (); |
|
|
2665 | } |
|
|
2666 | |
|
|
2667 | return pchanged; |
|
|
2668 | } |
|
|
2669 | #endif |
|
|
2670 | |
2238 | |
2671 | /*}}} */ |
2239 | /*}}} */ |
2672 | |
2240 | |
2673 | bool |
2241 | bool |
2674 | rxvt_term::cmd_parse () |
2242 | rxvt_term::cmd_parse () |
… | |
… | |
2723 | if (ch == C0_LF) |
2291 | if (ch == C0_LF) |
2724 | nlines++; |
2292 | nlines++; |
2725 | |
2293 | |
2726 | refresh_count++; |
2294 | refresh_count++; |
2727 | |
2295 | |
2728 | if (!OPTION (Opt_jumpScroll) |
2296 | if (!option (Opt_jumpScroll) |
2729 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2297 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2730 | { |
2298 | { |
2731 | refreshnow = true; |
2299 | refreshnow = true; |
2732 | refresh_count = 0; |
2300 | refresh_count = 0; |
2733 | ch = NOCHAR; |
2301 | ch = NOCHAR; |
… | |
… | |
2773 | * the number of pages between refreshes is refresh_limit, which |
2341 | * the number of pages between refreshes is refresh_limit, which |
2774 | * is incremented here because we must be doing flat-out scrolling. |
2342 | * is incremented here because we must be doing flat-out scrolling. |
2775 | */ |
2343 | */ |
2776 | if (refreshnow) |
2344 | if (refreshnow) |
2777 | { |
2345 | { |
2778 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2346 | if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2779 | refresh_limit++; |
2347 | refresh_limit++; |
2780 | else |
2348 | else |
2781 | { |
2349 | { |
2782 | flag = true; |
2350 | flag = true; |
2783 | //TODO: due to popular request, implement "skipscroll" option here |
2351 | //TODO: due to popular request, implement "skipscroll" option here |
… | |
… | |
2940 | { |
2508 | { |
2941 | if ((buf[len++] = cmd_getc ()) == 'i') |
2509 | if ((buf[len++] = cmd_getc ()) == 'i') |
2942 | break; /* done = 1 */ |
2510 | break; /* done = 1 */ |
2943 | } |
2511 | } |
2944 | } |
2512 | } |
2945 | |
2513 | |
2946 | for (i = 0; i < len; i++) |
2514 | for (i = 0; i < len; i++) |
2947 | if (putc (buf[i], fd) == EOF) |
2515 | if (putc (buf[i], fd) == EOF) |
2948 | { |
2516 | { |
2949 | done = 1; |
2517 | done = 1; |
2950 | break; |
2518 | break; |
… | |
… | |
3449 | break; |
3017 | break; |
3450 | case 6: /* CPR requested */ |
3018 | case 6: /* CPR requested */ |
3451 | scr_report_position (); |
3019 | scr_report_position (); |
3452 | break; |
3020 | break; |
3453 | case 7: /* unofficial extension */ |
3021 | case 7: /* unofficial extension */ |
3454 | if (OPTION (Opt_insecure)) |
3022 | if (option (Opt_insecure)) |
3455 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3023 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3456 | break; |
3024 | break; |
3457 | case 8: /* unofficial extension */ |
3025 | case 8: /* unofficial extension */ |
3458 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3026 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3459 | break; |
3027 | break; |
… | |
… | |
3623 | break; |
3191 | break; |
3624 | case 20: /* report icon label */ |
3192 | case 20: /* report icon label */ |
3625 | { |
3193 | { |
3626 | char *s; |
3194 | char *s; |
3627 | XGetIconName (dpy, parent[0], &s); |
3195 | XGetIconName (dpy, parent[0], &s); |
3628 | tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3196 | tt_printf ("\033]L%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3629 | XFree (s); |
3197 | XFree (s); |
3630 | } |
3198 | } |
3631 | break; |
3199 | break; |
3632 | case 21: /* report window title */ |
3200 | case 21: /* report window title */ |
3633 | { |
3201 | { |
3634 | char *s; |
3202 | char *s; |
3635 | XFetchName (dpy, parent[0], &s); |
3203 | XFetchName (dpy, parent[0], &s); |
3636 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3204 | tt_printf ("\033]l%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3637 | XFree (s); |
3205 | XFree (s); |
3638 | } |
3206 | } |
3639 | break; |
3207 | break; |
3640 | } |
3208 | } |
3641 | } |
3209 | } |
… | |
… | |
3668 | seen_esc = true; |
3236 | seen_esc = true; |
3669 | continue; |
3237 | continue; |
3670 | } |
3238 | } |
3671 | else if (ch == C0_BEL || ch == CHAR_ST) |
3239 | else if (ch == C0_BEL || ch == CHAR_ST) |
3672 | break; |
3240 | break; |
|
|
3241 | else if (ch == C0_SYN) |
|
|
3242 | ch = cmd_get8 (); |
3673 | else if (ch < 0x20) |
3243 | else if (ch < 0x20) |
3674 | return NULL; /* other control character - exit */ |
3244 | return NULL; /* other control character - exit */ |
3675 | |
3245 | |
3676 | seen_esc = false; |
3246 | seen_esc = false; |
3677 | |
3247 | |
3678 | if (n >= STRING_MAX - 1) |
3248 | if (n >= STRING_MAX - 1) |
3679 | // stop at some sane length |
3249 | // stop at some sane length |
3680 | return NULL; |
3250 | return NULL; |
3681 | |
3251 | |
3682 | if (ch == C0_SYN) |
|
|
3683 | string[n++] = cmd_get8 (); |
|
|
3684 | else |
|
|
3685 | string[n++] = ch; |
3252 | string[n++] = ch; |
3686 | } |
3253 | } |
3687 | |
3254 | |
3688 | string[n++] = '\0'; |
3255 | string[n++] = '\0'; |
3689 | |
3256 | |
3690 | ends_how = (ch == 0x5c ? C0_ESC : ch); |
3257 | ends_how = (ch == 0x5c ? C0_ESC : ch); |
… | |
… | |
3769 | int saveop = op; |
3336 | int saveop = op; |
3770 | |
3337 | |
3771 | dLocal (Display *, dpy); |
3338 | dLocal (Display *, dpy); |
3772 | |
3339 | |
3773 | assert (str != NULL); |
3340 | assert (str != NULL); |
3774 | |
3341 | |
3775 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3342 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3776 | return; |
3343 | return; |
3777 | |
3344 | |
3778 | switch (op) |
3345 | switch (op) |
3779 | { |
3346 | { |
… | |
… | |
3914 | #ifdef XPM_BACKGROUND |
3481 | #ifdef XPM_BACKGROUND |
3915 | resize_pixmap (); |
3482 | resize_pixmap (); |
3916 | scr_touch (true); |
3483 | scr_touch (true); |
3917 | #endif |
3484 | #endif |
3918 | } |
3485 | } |
|
|
3486 | #if TRANSPARENT && defined(HAVE_AFTERIMAGE) |
|
|
3487 | if (option (Opt_transparent)) |
|
|
3488 | check_our_parents (); |
|
|
3489 | #endif |
3919 | } |
3490 | } |
3920 | break; |
3491 | break; |
3921 | |
3492 | |
3922 | case Rxvt_restoreFG: |
3493 | case Rxvt_restoreFG: |
3923 | set_window_color (Color_fg, str); |
3494 | set_window_color (Color_fg, str); |
… | |
… | |
3950 | case URxvt_italicFont: |
3521 | case URxvt_italicFont: |
3951 | case URxvt_boldItalicFont: |
3522 | case URxvt_boldItalicFont: |
3952 | #endif |
3523 | #endif |
3953 | if (query) |
3524 | if (query) |
3954 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3525 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3955 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3526 | option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3956 | ? fontset[op - URxvt_font]->fontdesc : "", |
3527 | ? fontset[op - URxvt_font]->fontdesc : "", |
3957 | resp); |
3528 | resp); |
3958 | else |
3529 | else |
3959 | { |
3530 | { |
3960 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3531 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3974 | break; |
3545 | break; |
3975 | |
3546 | |
3976 | #if !ENABLE_MINIMAL |
3547 | #if !ENABLE_MINIMAL |
3977 | case URxvt_locale: |
3548 | case URxvt_locale: |
3978 | if (query) |
3549 | if (query) |
3979 | tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); |
3550 | tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); |
3980 | else |
3551 | else |
3981 | { |
3552 | { |
3982 | set_locale (str); |
3553 | set_locale (str); |
3983 | pty->set_utf8_mode (enc_utf8); |
3554 | pty->set_utf8_mode (enc_utf8); |
3984 | init_xlocale (); |
3555 | init_xlocale (); |
… | |
… | |
4125 | scr_touch (true); |
3696 | scr_touch (true); |
4126 | break; |
3697 | break; |
4127 | #endif |
3698 | #endif |
4128 | case 1048: /* alternative cursor save */ |
3699 | case 1048: /* alternative cursor save */ |
4129 | case 1049: |
3700 | case 1049: |
4130 | if (OPTION (Opt_secondaryScreen)) |
3701 | if (option (Opt_secondaryScreen)) |
4131 | if (mode == 0) |
3702 | if (mode == 0) |
4132 | scr_cursor (RESTORE); |
3703 | scr_cursor (RESTORE); |
4133 | else if (mode == 1) |
3704 | else if (mode == 1) |
4134 | scr_cursor (SAVE); |
3705 | scr_cursor (SAVE); |
4135 | break; |
3706 | break; |
… | |
… | |
4200 | break; |
3771 | break; |
4201 | case 1011: /* scroll to bottom on key press */ |
3772 | case 1011: /* scroll to bottom on key press */ |
4202 | set_option (Opt_scrollTtyKeypress, state); |
3773 | set_option (Opt_scrollTtyKeypress, state); |
4203 | break; |
3774 | break; |
4204 | case 1047: /* secondary screen w/ clearing last */ |
3775 | case 1047: /* secondary screen w/ clearing last */ |
4205 | if (OPTION (Opt_secondaryScreen)) |
3776 | if (option (Opt_secondaryScreen)) |
4206 | if (current_screen != PRIMARY) |
3777 | if (current_screen != PRIMARY) |
4207 | scr_erase_screen (2); |
3778 | scr_erase_screen (2); |
4208 | scr_change_screen (state); |
3779 | scr_change_screen (state); |
4209 | break; |
3780 | break; |
4210 | case 1049: /* secondary screen w/ clearing first */ |
3781 | case 1049: /* secondary screen w/ clearing first */ |
4211 | scr_change_screen (state); |
3782 | scr_change_screen (state); |
4212 | if (OPTION (Opt_secondaryScreen)) |
3783 | if (option (Opt_secondaryScreen)) |
4213 | if (current_screen != PRIMARY) |
3784 | if (current_screen != PRIMARY) |
4214 | scr_erase_screen (2); |
3785 | scr_erase_screen (2); |
4215 | break; |
3786 | break; |
4216 | default: |
3787 | default: |
4217 | break; |
3788 | break; |