… | |
… | |
131 | XK_KP_Space, 0x2422, |
131 | XK_KP_Space, 0x2422, |
132 | #endif |
132 | #endif |
133 | 0, |
133 | 0, |
134 | }; |
134 | }; |
135 | |
135 | |
136 | void |
136 | void ecb_cold |
137 | rxvt_term::iso14755_54 (int x, int y) |
137 | rxvt_term::iso14755_54 (int x, int y) |
138 | { |
138 | { |
139 | x = Pixel2Col (x); |
139 | x = Pixel2Col (x); |
140 | y = Pixel2Row (y); |
140 | y = Pixel2Row (y); |
141 | |
141 | |
… | |
… | |
158 | |
158 | |
159 | x--; |
159 | x--; |
160 | } |
160 | } |
161 | } |
161 | } |
162 | |
162 | |
163 | void |
163 | void ecb_cold |
164 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
164 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
165 | { |
165 | { |
166 | rxvt_fontset *fs = FONTSET (r); |
166 | rxvt_fontset *fs = FONTSET (r); |
167 | wchar_t *chr, *alloc, ch2, **fname; |
167 | wchar_t *chr, *alloc, ch2, **fname; |
168 | int len; |
168 | int len; |
… | |
… | |
254 | delete [] alloc; |
254 | delete [] alloc; |
255 | # endif |
255 | # endif |
256 | } |
256 | } |
257 | #endif |
257 | #endif |
258 | |
258 | |
259 | void |
259 | void ecb_cold |
260 | rxvt_term::commit_iso14755 () |
260 | rxvt_term::commit_iso14755 () |
261 | { |
261 | { |
262 | wchar_t ch = iso14755buf & ISO_14755_MASK; |
262 | wchar_t ch = iso14755buf & ISO_14755_MASK; |
263 | |
263 | |
264 | if (iso14755buf & ISO_14755_51) |
264 | if (iso14755buf & ISO_14755_51) |
… | |
… | |
282 | } |
282 | } |
283 | |
283 | |
284 | iso14755buf = 0; |
284 | iso14755buf = 0; |
285 | } |
285 | } |
286 | |
286 | |
287 | static int |
287 | static int ecb_cold |
288 | hex_keyval (XKeyEvent &ev) |
288 | hex_keyval (XKeyEvent &ev) |
289 | { |
289 | { |
290 | // check whether this event corresponds to a hex digit |
290 | // check whether this event corresponds to a hex digit |
291 | // if the modifiers had not been pressed. |
291 | // if the modifiers had not been pressed. |
292 | for (int index = 0; index < 8; index++) |
292 | for (int index = 0; index < 8; index++) |
… | |
… | |
301 | |
301 | |
302 | return -1; |
302 | return -1; |
303 | } |
303 | } |
304 | #endif |
304 | #endif |
305 | |
305 | |
306 | static inline KeySym |
306 | static inline KeySym ecb_cold |
307 | translate_keypad (KeySym keysym, bool kp) |
307 | translate_keypad (KeySym keysym, bool kp) |
308 | { |
308 | { |
309 | #ifdef XK_KP_Home |
309 | #ifdef XK_KP_Home |
310 | static const KeySym keypadtrans[] = { |
310 | static const KeySym keypadtrans[] = { |
311 | XK_KP_7, // XK_KP_Home |
311 | XK_KP_7, // XK_KP_Home |
… | |
… | |
337 | # endif |
337 | # endif |
338 | #endif |
338 | #endif |
339 | return keysym; |
339 | return keysym; |
340 | } |
340 | } |
341 | |
341 | |
342 | static inline int |
342 | static inline int ecb_cold |
343 | map_function_key (KeySym keysym) |
343 | map_function_key (KeySym keysym) |
344 | { |
344 | { |
345 | int param = 0; |
345 | int param = 0; |
346 | |
346 | |
347 | if (IN_RANGE_INC (keysym, XK_F1, XK_F35)) |
347 | if (IN_RANGE_INC (keysym, XK_F1, XK_F35)) |
… | |
… | |
396 | break; |
396 | break; |
397 | } |
397 | } |
398 | return param; |
398 | return param; |
399 | } |
399 | } |
400 | |
400 | |
401 | void |
401 | void ecb_cold |
402 | rxvt_term::key_press (XKeyEvent &ev) |
402 | rxvt_term::key_press (XKeyEvent &ev) |
403 | { |
403 | { |
404 | int ctrl, meta, shft, len; |
404 | int ctrl, meta, shft, len; |
405 | KeySym keysym; |
405 | KeySym keysym; |
406 | int valid_keysym; |
406 | int valid_keysym; |
… | |
… | |
855 | } |
855 | } |
856 | |
856 | |
857 | tt_write (kbuf, (unsigned int)len); |
857 | tt_write (kbuf, (unsigned int)len); |
858 | } |
858 | } |
859 | |
859 | |
860 | void |
860 | void ecb_cold |
861 | rxvt_term::key_release (XKeyEvent &ev) |
861 | rxvt_term::key_release (XKeyEvent &ev) |
862 | { |
862 | { |
863 | #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 || ENABLE_PERL |
863 | #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 || ENABLE_PERL |
864 | KeySym keysym; |
864 | KeySym keysym; |
865 | |
865 | |
… | |
… | |
1219 | pty_write (); |
1219 | pty_write (); |
1220 | |
1220 | |
1221 | refresh_check (); |
1221 | refresh_check (); |
1222 | } |
1222 | } |
1223 | |
1223 | |
1224 | void |
1224 | void ecb_cold |
1225 | rxvt_term::pointer_unblank () |
1225 | rxvt_term::pointer_unblank () |
1226 | { |
1226 | { |
1227 | XDefineCursor (dpy, vt, TermWin_cursor); |
1227 | XDefineCursor (dpy, vt, TermWin_cursor); |
1228 | recolour_cursor (); |
1228 | recolour_cursor (); |
1229 | |
1229 | |
… | |
… | |
1234 | pointer_ev.start (pointerBlankDelay); |
1234 | pointer_ev.start (pointerBlankDelay); |
1235 | #endif |
1235 | #endif |
1236 | } |
1236 | } |
1237 | |
1237 | |
1238 | #ifdef POINTER_BLANK |
1238 | #ifdef POINTER_BLANK |
1239 | void |
1239 | void ecb_cold |
1240 | rxvt_term::pointer_blank () |
1240 | rxvt_term::pointer_blank () |
1241 | { |
1241 | { |
1242 | if (!option (Opt_pointerBlank)) |
1242 | if (!option (Opt_pointerBlank)) |
1243 | return; |
1243 | return; |
1244 | |
1244 | |
… | |
… | |
1246 | XFlush (dpy); |
1246 | XFlush (dpy); |
1247 | |
1247 | |
1248 | hidden_pointer = 1; |
1248 | hidden_pointer = 1; |
1249 | } |
1249 | } |
1250 | |
1250 | |
1251 | void |
1251 | void ecb_cold |
1252 | rxvt_term::pointer_cb (ev::timer &w, int revents) |
1252 | rxvt_term::pointer_cb (ev::timer &w, int revents) |
1253 | { |
1253 | { |
1254 | make_current (); |
1254 | make_current (); |
1255 | |
1255 | |
1256 | pointer_blank (); |
1256 | pointer_blank (); |
… | |
… | |
1348 | 32 + x, |
1348 | 32 + x, |
1349 | 32 + y); |
1349 | 32 + y); |
1350 | } |
1350 | } |
1351 | |
1351 | |
1352 | /*{{{ process an X event */ |
1352 | /*{{{ process an X event */ |
1353 | void |
1353 | void ecb_hot |
1354 | rxvt_term::x_cb (XEvent &ev) |
1354 | rxvt_term::x_cb (XEvent &ev) |
1355 | { |
1355 | { |
1356 | make_current (); |
1356 | make_current (); |
1357 | |
1357 | |
1358 | dLocal (Display *, dpy); |
1358 | dLocal (Display *, dpy); |
… | |
… | |
1713 | |
1713 | |
1714 | refresh_check (); |
1714 | refresh_check (); |
1715 | } |
1715 | } |
1716 | |
1716 | |
1717 | #if ENABLE_FRILLS |
1717 | #if ENABLE_FRILLS |
1718 | void |
1718 | void ecb_cold |
1719 | rxvt_term::set_urgency (bool enable) |
1719 | rxvt_term::set_urgency (bool enable) |
1720 | { |
1720 | { |
1721 | if (enable == urgency_hint) |
1721 | if (enable == urgency_hint) |
1722 | return; |
1722 | return; |
1723 | |
1723 | |
… | |
… | |
1729 | XFree (h); |
1729 | XFree (h); |
1730 | } |
1730 | } |
1731 | } |
1731 | } |
1732 | #endif |
1732 | #endif |
1733 | |
1733 | |
1734 | void |
1734 | void ecb_cold |
1735 | rxvt_term::focus_in () |
1735 | rxvt_term::focus_in () |
1736 | { |
1736 | { |
1737 | if (!focus) |
1737 | if (!focus) |
1738 | { |
1738 | { |
1739 | focus = 1; |
1739 | focus = 1; |
… | |
… | |
1764 | |
1764 | |
1765 | HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); |
1765 | HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); |
1766 | } |
1766 | } |
1767 | } |
1767 | } |
1768 | |
1768 | |
1769 | void |
1769 | void ecb_cold |
1770 | rxvt_term::focus_out () |
1770 | rxvt_term::focus_out () |
1771 | { |
1771 | { |
1772 | if (focus) |
1772 | if (focus) |
1773 | { |
1773 | { |
1774 | focus = 0; |
1774 | focus = 0; |
… | |
… | |
1807 | |
1807 | |
1808 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1808 | HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); |
1809 | } |
1809 | } |
1810 | } |
1810 | } |
1811 | |
1811 | |
1812 | void |
1812 | void ecb_cold |
1813 | rxvt_term::update_fade_color (unsigned int idx) |
1813 | rxvt_term::update_fade_color (unsigned int idx) |
1814 | { |
1814 | { |
1815 | #if OFF_FOCUS_FADING |
1815 | #if OFF_FOCUS_FADING |
1816 | if (rs[Rs_fade]) |
1816 | if (rs[Rs_fade]) |
1817 | { |
1817 | { |
… | |
… | |
1821 | } |
1821 | } |
1822 | #endif |
1822 | #endif |
1823 | } |
1823 | } |
1824 | |
1824 | |
1825 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1825 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1826 | void |
1826 | void ecb_hot |
1827 | rxvt_term::rootwin_cb (XEvent &ev) |
1827 | rxvt_term::rootwin_cb (XEvent &ev) |
1828 | { |
1828 | { |
1829 | make_current (); |
1829 | make_current (); |
1830 | |
1830 | |
1831 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
1831 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
… | |
… | |
2215 | } |
2215 | } |
2216 | } |
2216 | } |
2217 | |
2217 | |
2218 | /*}}} */ |
2218 | /*}}} */ |
2219 | |
2219 | |
2220 | void |
2220 | void ecb_hot |
2221 | rxvt_term::cmd_parse () |
2221 | rxvt_term::cmd_parse () |
2222 | { |
2222 | { |
2223 | wchar_t ch = NOCHAR; |
2223 | wchar_t ch = NOCHAR; |
2224 | char *seq_begin; // remember start of esc-sequence here |
2224 | char *seq_begin; // remember start of esc-sequence here |
2225 | |
2225 | |
… | |
… | |
2344 | } |
2344 | } |
2345 | } |
2345 | } |
2346 | } |
2346 | } |
2347 | |
2347 | |
2348 | // read the next character |
2348 | // read the next character |
2349 | wchar_t |
2349 | wchar_t ecb_hot |
2350 | rxvt_term::next_char () NOTHROW |
2350 | rxvt_term::next_char () NOTHROW |
2351 | { |
2351 | { |
2352 | while (cmdbuf_ptr < cmdbuf_endp) |
2352 | while (cmdbuf_ptr < cmdbuf_endp) |
2353 | { |
2353 | { |
2354 | // assume 7-bit to be ascii ALWAYS |
2354 | // assume 7-bit to be ascii ALWAYS |
… | |
… | |
2378 | |
2378 | |
2379 | return NOCHAR; |
2379 | return NOCHAR; |
2380 | } |
2380 | } |
2381 | |
2381 | |
2382 | // read the next octet |
2382 | // read the next octet |
2383 | uint32_t |
2383 | uint32_t ecb_hot |
2384 | rxvt_term::next_octet () NOTHROW |
2384 | rxvt_term::next_octet () NOTHROW |
2385 | { |
2385 | { |
2386 | return cmdbuf_ptr < cmdbuf_endp |
2386 | return cmdbuf_ptr < cmdbuf_endp |
2387 | ? (unsigned char)*cmdbuf_ptr++ |
2387 | ? (unsigned char)*cmdbuf_ptr++ |
2388 | : NOCHAR; |
2388 | : NOCHAR; |
2389 | } |
2389 | } |
2390 | |
2390 | |
2391 | static class out_of_input out_of_input; |
2391 | static class out_of_input out_of_input; |
2392 | |
2392 | |
2393 | wchar_t |
2393 | wchar_t ecb_hot |
2394 | rxvt_term::cmd_getc () THROW ((class out_of_input)) |
2394 | rxvt_term::cmd_getc () THROW ((class out_of_input)) |
2395 | { |
2395 | { |
2396 | wchar_t c = next_char (); |
2396 | wchar_t c = next_char (); |
2397 | |
2397 | |
2398 | if (c == NOCHAR) |
2398 | if (c == NOCHAR) |
2399 | throw out_of_input; |
2399 | throw out_of_input; |
2400 | |
2400 | |
2401 | return c; |
2401 | return c; |
2402 | } |
2402 | } |
2403 | |
2403 | |
2404 | uint32_t |
2404 | uint32_t ecb_hot |
2405 | rxvt_term::cmd_get8 () THROW ((class out_of_input)) |
2405 | rxvt_term::cmd_get8 () THROW ((class out_of_input)) |
2406 | { |
2406 | { |
2407 | uint32_t c = next_octet (); |
2407 | uint32_t c = next_octet (); |
2408 | |
2408 | |
2409 | if (c == NOCHAR) |
2409 | if (c == NOCHAR) |
… | |
… | |
2413 | } |
2413 | } |
2414 | |
2414 | |
2415 | /*{{{ print pipe */ |
2415 | /*{{{ print pipe */ |
2416 | /*----------------------------------------------------------------------*/ |
2416 | /*----------------------------------------------------------------------*/ |
2417 | #ifdef PRINTPIPE |
2417 | #ifdef PRINTPIPE |
2418 | FILE * |
2418 | FILE * ecb_cold |
2419 | rxvt_term::popen_printer () |
2419 | rxvt_term::popen_printer () |
2420 | { |
2420 | { |
2421 | FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w"); |
2421 | FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w"); |
2422 | |
2422 | |
2423 | if (stream == NULL) |
2423 | if (stream == NULL) |
2424 | rxvt_warn ("can't open printer pipe, not printing.\n"); |
2424 | rxvt_warn ("can't open printer pipe, not printing.\n"); |
2425 | |
2425 | |
2426 | return stream; |
2426 | return stream; |
2427 | } |
2427 | } |
2428 | |
2428 | |
2429 | int |
2429 | int ecb_cold |
2430 | rxvt_term::pclose_printer (FILE *stream) |
2430 | rxvt_term::pclose_printer (FILE *stream) |
2431 | { |
2431 | { |
2432 | fflush (stream); |
2432 | fflush (stream); |
2433 | return pclose (stream); |
2433 | return pclose (stream); |
2434 | } |
2434 | } |
2435 | |
2435 | |
2436 | /* |
2436 | /* |
2437 | * simulate attached vt100 printer |
2437 | * simulate attached vt100 printer |
2438 | */ |
2438 | */ |
2439 | void |
2439 | void ecb_cold |
2440 | rxvt_term::process_print_pipe () |
2440 | rxvt_term::process_print_pipe () |
2441 | { |
2441 | { |
2442 | FILE *fd = popen_printer (); |
2442 | FILE *fd = popen_printer (); |
2443 | |
2443 | |
2444 | if (!fd) |
2444 | if (!fd) |
… | |
… | |
2499 | C1_DCS, C1_PU1, C1_PU2, C1_STS, C1_CCH, C1_MW , C1_SPA, C1_EPA, |
2499 | C1_DCS, C1_PU1, C1_PU2, C1_STS, C1_CCH, C1_MW , C1_SPA, C1_EPA, |
2500 | C1_SOS, C1_59 , C1_SCI, C1_CSI, CS_ST , C1_OSC, C1_PM , C1_APC, |
2500 | C1_SOS, C1_59 , C1_SCI, C1_CSI, CS_ST , C1_OSC, C1_PM , C1_APC, |
2501 | }; |
2501 | }; |
2502 | |
2502 | |
2503 | /*{{{ process non-printing single characters */ |
2503 | /*{{{ process non-printing single characters */ |
2504 | void |
2504 | void ecb_hot |
2505 | rxvt_term::process_nonprinting (unicode_t ch) |
2505 | rxvt_term::process_nonprinting (unicode_t ch) |
2506 | { |
2506 | { |
2507 | switch (ch) |
2507 | switch (ch) |
2508 | { |
2508 | { |
2509 | case C0_ESC: |
2509 | case C0_ESC: |
… | |
… | |
2555 | } |
2555 | } |
2556 | /*}}} */ |
2556 | /*}}} */ |
2557 | |
2557 | |
2558 | |
2558 | |
2559 | /*{{{ process VT52 escape sequences */ |
2559 | /*{{{ process VT52 escape sequences */ |
2560 | void |
2560 | void ecb_cold |
2561 | rxvt_term::process_escape_vt52 (unicode_t ch) |
2561 | rxvt_term::process_escape_vt52 (unicode_t ch) |
2562 | { |
2562 | { |
2563 | int row, col; |
2563 | int row, col; |
2564 | |
2564 | |
2565 | switch (ch) |
2565 | switch (ch) |
… | |
… | |
2615 | } |
2615 | } |
2616 | /*}}} */ |
2616 | /*}}} */ |
2617 | |
2617 | |
2618 | |
2618 | |
2619 | /*{{{ process escape sequences */ |
2619 | /*{{{ process escape sequences */ |
2620 | void |
2620 | void ecb_hot |
2621 | rxvt_term::process_escape_seq () |
2621 | rxvt_term::process_escape_seq () |
2622 | { |
2622 | { |
2623 | unicode_t ch = cmd_getc (); |
2623 | unicode_t ch = cmd_getc (); |
2624 | |
2624 | |
2625 | if (priv_modes & PrivMode_vt52) |
2625 | if (priv_modes & PrivMode_vt52) |
… | |
… | |
2777 | make_byte (0,0,1,1,0,0,0,0), /* h, i, j, k, l, m, n, o, */ |
2777 | make_byte (0,0,1,1,0,0,0,0), /* h, i, j, k, l, m, n, o, */ |
2778 | make_byte (0,0,0,0,0,0,0,0), /* p, q, r, s, t, u, v, w, */ |
2778 | make_byte (0,0,0,0,0,0,0,0), /* p, q, r, s, t, u, v, w, */ |
2779 | make_byte (0,0,0,0,0,0,0,0), /* x, y, z, {, |, }, ~, */ |
2779 | make_byte (0,0,0,0,0,0,0,0), /* x, y, z, {, |, }, ~, */ |
2780 | }; |
2780 | }; |
2781 | |
2781 | |
2782 | void |
2782 | void ecb_hot |
2783 | rxvt_term::process_csi_seq () |
2783 | rxvt_term::process_csi_seq () |
2784 | { |
2784 | { |
2785 | unicode_t ch, priv, i; |
2785 | unicode_t ch, priv, i; |
2786 | unsigned int nargs, p; |
2786 | unsigned int nargs, p; |
2787 | int n, ndef; |
2787 | int n, ndef; |
… | |
… | |
3596 | * 's' = save |
3596 | * 's' = save |
3597 | * 'r' = restore |
3597 | * 'r' = restore |
3598 | * 't' = toggle |
3598 | * 't' = toggle |
3599 | * so no need for fancy checking |
3599 | * so no need for fancy checking |
3600 | */ |
3600 | */ |
3601 | int |
3601 | int ecb_cold |
3602 | rxvt_term::privcases (int mode, unsigned long bit) |
3602 | rxvt_term::privcases (int mode, unsigned long bit) |
3603 | { |
3603 | { |
3604 | int state; |
3604 | int state; |
3605 | |
3605 | |
3606 | if (mode == 's') |
3606 | if (mode == 's') |
… | |
… | |
3826 | } |
3826 | } |
3827 | } |
3827 | } |
3828 | /*}}} */ |
3828 | /*}}} */ |
3829 | |
3829 | |
3830 | /*{{{ process sgr sequences */ |
3830 | /*{{{ process sgr sequences */ |
3831 | void |
3831 | void ecb_hot |
3832 | rxvt_term::process_sgr_mode (unsigned int nargs, const int *arg) |
3832 | rxvt_term::process_sgr_mode (unsigned int nargs, const int *arg) |
3833 | { |
3833 | { |
3834 | unsigned int i; |
3834 | unsigned int i; |
3835 | short rendset; |
3835 | short rendset; |
3836 | int rendstyle; |
3836 | int rendstyle; |