… | |
… | |
919 | #endif /* DEBUG_CMD */ |
919 | #endif /* DEBUG_CMD */ |
920 | tt_write (kbuf, (unsigned int)len); |
920 | tt_write (kbuf, (unsigned int)len); |
921 | } |
921 | } |
922 | /*}}} */ |
922 | /*}}} */ |
923 | |
923 | |
924 | #if MENUBAR_MAX || defined (KEYSYM_RESOURCE) |
924 | #if defined (KEYSYM_RESOURCE) |
925 | /*{{{ rxvt_cmd_write (), rxvt_cmd_getc () */ |
|
|
926 | /* attempt to `write' count to the input buffer */ |
|
|
927 | unsigned int |
925 | unsigned int |
928 | rxvt_term::cmd_write (const char *str, unsigned int count) |
926 | rxvt_term::cmd_write (const char *str, unsigned int count) |
929 | { |
927 | { |
930 | unsigned int n, s; |
928 | unsigned int n, s; |
931 | |
929 | |
… | |
… | |
1306 | make_current (); |
1304 | make_current (); |
1307 | |
1305 | |
1308 | dDisp; |
1306 | dDisp; |
1309 | |
1307 | |
1310 | if (ev.xany.window == vt |
1308 | if (ev.xany.window == vt |
|
|
1309 | && SHOULD_INVOKE (HOOK_X_EVENT) |
1311 | && HOOK_INVOKE ((this, HOOK_X_EVENT, DT_XEVENT, &ev, DT_END))) |
1310 | && HOOK_INVOKE ((this, HOOK_X_EVENT, DT_XEVENT, &ev, DT_END))) |
1312 | return; |
1311 | return; |
1313 | |
1312 | |
1314 | // for XQueryPointer |
1313 | // for XQueryPointer |
1315 | Window unused_root, unused_child; |
1314 | Window unused_root, unused_child; |
… | |
… | |
1586 | if (isScrollbarWindow (ev.xany.window)) |
1585 | if (isScrollbarWindow (ev.xany.window)) |
1587 | { |
1586 | { |
1588 | scrollBar.setIdle (); |
1587 | scrollBar.setIdle (); |
1589 | scrollbar_show (0); |
1588 | scrollbar_show (0); |
1590 | } |
1589 | } |
1591 | #ifdef MENUBAR |
|
|
1592 | if (menubar_visible () && isMenuBarWindow (ev.xany.window)) |
|
|
1593 | menubar_expose (); |
|
|
1594 | #endif |
|
|
1595 | |
1590 | |
1596 | #ifdef TRANSPARENT |
1591 | #ifdef TRANSPARENT |
1597 | if (am_transparent && ev.xany.window == parent[0]) |
1592 | if (am_transparent && ev.xany.window == parent[0]) |
1598 | XClearWindow (disp, ev.xany.window); |
1593 | XClearWindow (disp, ev.xany.window); |
1599 | #endif |
1594 | #endif |
… | |
… | |
1603 | case MotionNotify: |
1598 | case MotionNotify: |
1604 | #ifdef POINTER_BLANK |
1599 | #ifdef POINTER_BLANK |
1605 | if (hidden_pointer) |
1600 | if (hidden_pointer) |
1606 | pointer_unblank (); |
1601 | pointer_unblank (); |
1607 | #endif |
1602 | #endif |
1608 | #if MENUBAR |
|
|
1609 | if (isMenuBarWindow (ev.xany.window)) |
|
|
1610 | { |
|
|
1611 | menubar_control (ev.xbutton); |
|
|
1612 | break; |
|
|
1613 | } |
|
|
1614 | #endif |
|
|
1615 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1603 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1616 | break; |
1604 | break; |
1617 | |
1605 | |
1618 | if (ev.xany.window == vt) |
1606 | if (ev.xany.window == vt) |
1619 | { |
1607 | { |
|
|
1608 | if (SHOULD_INVOKE (HOOK_MOTION_NOTIFY) |
1620 | if (HOOK_INVOKE ((this, HOOK_MOTION_NOTIFY, DT_XEVENT, &ev, DT_END))) |
1609 | && HOOK_INVOKE ((this, HOOK_MOTION_NOTIFY, DT_XEVENT, &ev, DT_END))) |
1621 | ; // nop |
1610 | ; // nop |
1622 | else if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
1611 | else if (ev.xbutton.state & (Button1Mask | Button3Mask)) |
1623 | { |
1612 | { |
1624 | while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev)) |
1613 | while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev)) |
1625 | ; |
1614 | ; |
… | |
… | |
2096 | } |
2085 | } |
2097 | } |
2086 | } |
2098 | |
2087 | |
2099 | return; |
2088 | return; |
2100 | } |
2089 | } |
2101 | |
|
|
2102 | #if MENUBAR |
|
|
2103 | /* |
|
|
2104 | * Menubar window processing of button press |
|
|
2105 | */ |
|
|
2106 | if (isMenuBarWindow (ev.window)) |
|
|
2107 | menubar_control (ev); |
|
|
2108 | #endif |
|
|
2109 | } |
2090 | } |
2110 | |
2091 | |
2111 | void |
2092 | void |
2112 | rxvt_term::button_release (XButtonEvent &ev) |
2093 | rxvt_term::button_release (XButtonEvent &ev) |
2113 | { |
2094 | { |
… | |
… | |
2222 | } |
2203 | } |
2223 | break; |
2204 | break; |
2224 | #endif |
2205 | #endif |
2225 | } |
2206 | } |
2226 | } |
2207 | } |
2227 | #ifdef MENUBAR |
|
|
2228 | else if (isMenuBarWindow (ev.window)) |
|
|
2229 | menubar_control (ev); |
|
|
2230 | #endif |
|
|
2231 | } |
2208 | } |
2232 | |
2209 | |
2233 | #ifdef TRANSPARENT |
2210 | #ifdef TRANSPARENT |
2234 | #if TINTING |
2211 | #if TINTING |
2235 | /* taken from aterm-0.4.2 */ |
2212 | /* taken from aterm-0.4.2 */ |
… | |
… | |
2778 | } |
2755 | } |
2779 | |
2756 | |
2780 | // scr_add_lines only works for nlines <= nrow - 1. |
2757 | // scr_add_lines only works for nlines <= nrow - 1. |
2781 | if (nlines >= nrow - 1) |
2758 | if (nlines >= nrow - 1) |
2782 | { |
2759 | { |
|
|
2760 | if (!(SHOULD_INVOKE (HOOK_ADD_LINES) |
2783 | if (!HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END))) |
2761 | && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) |
2784 | scr_add_lines (buf, str - buf, nlines); |
2762 | scr_add_lines (buf, str - buf, nlines); |
2785 | |
2763 | |
2786 | nlines = 0; |
2764 | nlines = 0; |
2787 | str = buf; |
2765 | str = buf; |
2788 | eol = str + min (ncol, UBUFSIZ); |
2766 | eol = str + min (ncol, UBUFSIZ); |
… | |
… | |
2803 | |
2781 | |
2804 | seq_begin = cmdbuf_ptr; |
2782 | seq_begin = cmdbuf_ptr; |
2805 | ch = next_char (); |
2783 | ch = next_char (); |
2806 | } |
2784 | } |
2807 | |
2785 | |
|
|
2786 | if (!(SHOULD_INVOKE (HOOK_ADD_LINES) |
2808 | if (!HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END))) |
2787 | && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) |
2809 | scr_add_lines (buf, str - buf, nlines); |
2788 | scr_add_lines (buf, str - buf, nlines); |
2810 | |
2789 | |
2811 | /* |
2790 | /* |
2812 | * If there have been a lot of new lines, then update the screen |
2791 | * If there have been a lot of new lines, then update the screen |
2813 | * What the heck I'll cheat and only refresh less than every page-full. |
2792 | * What the heck I'll cheat and only refresh less than every page-full. |
… | |
… | |
3954 | |
3933 | |
3955 | case XTerm_logfile: |
3934 | case XTerm_logfile: |
3956 | // TODO, when secure mode? |
3935 | // TODO, when secure mode? |
3957 | break; |
3936 | break; |
3958 | |
3937 | |
3959 | #ifdef MENUBAR |
|
|
3960 | case URxvt_Menu: |
|
|
3961 | if (OPTION (Opt_insecure)) |
|
|
3962 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
|
|
3963 | break; |
|
|
3964 | #endif |
|
|
3965 | #if 0 |
3938 | #if 0 |
3966 | case Rxvt_dumpscreen: /* no error notices */ |
3939 | case Rxvt_dumpscreen: /* no error notices */ |
3967 | { |
3940 | { |
3968 | int fd; |
3941 | int fd; |
3969 | if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) |
3942 | if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) |
… | |
… | |
4086 | { 5, PrivMode_rVideo }, |
4059 | { 5, PrivMode_rVideo }, |
4087 | { 6, PrivMode_relOrigin }, |
4060 | { 6, PrivMode_relOrigin }, |
4088 | { 7, PrivMode_Autowrap }, |
4061 | { 7, PrivMode_Autowrap }, |
4089 | // 8, bi-directional support mode |
4062 | // 8, bi-directional support mode |
4090 | { 9, PrivMode_MouseX10 }, |
4063 | { 9, PrivMode_MouseX10 }, |
4091 | #ifdef menuBar_esc |
|
|
4092 | { menuBar_esc, PrivMode_menuBar }, |
|
|
4093 | #endif |
|
|
4094 | // 18, 19 printing-related |
4064 | // 18, 19 printing-related |
4095 | { 25, PrivMode_VisibleCursor }, |
4065 | { 25, PrivMode_VisibleCursor }, |
4096 | #ifdef scrollBar_esc |
4066 | #ifdef scrollBar_esc |
4097 | { scrollBar_esc, PrivMode_scrollBar }, |
4067 | { scrollBar_esc, PrivMode_scrollBar }, |
4098 | #endif |
4068 | #endif |
… | |
… | |
4193 | /* case 8: - auto repeat, can't do on a per window basis */ |
4163 | /* case 8: - auto repeat, can't do on a per window basis */ |
4194 | case 9: /* X10 mouse reporting */ |
4164 | case 9: /* X10 mouse reporting */ |
4195 | if (state) /* orthogonal */ |
4165 | if (state) /* orthogonal */ |
4196 | priv_modes &= ~PrivMode_MouseX11; |
4166 | priv_modes &= ~PrivMode_MouseX11; |
4197 | break; |
4167 | break; |
4198 | #ifdef menuBar_esc |
|
|
4199 | case menuBar_esc: |
|
|
4200 | #ifdef MENUBAR |
|
|
4201 | map_menuBar (state); |
|
|
4202 | #endif |
|
|
4203 | break; |
|
|
4204 | #endif |
|
|
4205 | #ifdef scrollBar_esc |
4168 | #ifdef scrollBar_esc |
4206 | case scrollBar_esc: |
4169 | case scrollBar_esc: |
4207 | if (scrollbar_mapping (state)) |
4170 | if (scrollbar_mapping (state)) |
4208 | { |
4171 | { |
4209 | resize_all_windows (0, 0, 0); |
4172 | resize_all_windows (0, 0, 0); |