… | |
… | |
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 | |
… | |
… | |
1587 | if (isScrollbarWindow (ev.xany.window)) |
1585 | if (isScrollbarWindow (ev.xany.window)) |
1588 | { |
1586 | { |
1589 | scrollBar.setIdle (); |
1587 | scrollBar.setIdle (); |
1590 | scrollbar_show (0); |
1588 | scrollbar_show (0); |
1591 | } |
1589 | } |
1592 | #ifdef MENUBAR |
|
|
1593 | if (menubar_visible () && isMenuBarWindow (ev.xany.window)) |
|
|
1594 | menubar_expose (); |
|
|
1595 | #endif |
|
|
1596 | |
1590 | |
1597 | #ifdef TRANSPARENT |
1591 | #ifdef TRANSPARENT |
1598 | if (am_transparent && ev.xany.window == parent[0]) |
1592 | if (am_transparent && ev.xany.window == parent[0]) |
1599 | XClearWindow (disp, ev.xany.window); |
1593 | XClearWindow (disp, ev.xany.window); |
1600 | #endif |
1594 | #endif |
… | |
… | |
1603 | |
1597 | |
1604 | case MotionNotify: |
1598 | case MotionNotify: |
1605 | #ifdef POINTER_BLANK |
1599 | #ifdef POINTER_BLANK |
1606 | if (hidden_pointer) |
1600 | if (hidden_pointer) |
1607 | pointer_unblank (); |
1601 | pointer_unblank (); |
1608 | #endif |
|
|
1609 | #if MENUBAR |
|
|
1610 | if (isMenuBarWindow (ev.xany.window)) |
|
|
1611 | { |
|
|
1612 | menubar_control (ev.xbutton); |
|
|
1613 | break; |
|
|
1614 | } |
|
|
1615 | #endif |
1602 | #endif |
1616 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1603 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1617 | break; |
1604 | break; |
1618 | |
1605 | |
1619 | if (ev.xany.window == vt) |
1606 | if (ev.xany.window == vt) |
… | |
… | |
2098 | } |
2085 | } |
2099 | } |
2086 | } |
2100 | |
2087 | |
2101 | return; |
2088 | return; |
2102 | } |
2089 | } |
2103 | |
|
|
2104 | #if MENUBAR |
|
|
2105 | /* |
|
|
2106 | * Menubar window processing of button press |
|
|
2107 | */ |
|
|
2108 | if (isMenuBarWindow (ev.window)) |
|
|
2109 | menubar_control (ev); |
|
|
2110 | #endif |
|
|
2111 | } |
2090 | } |
2112 | |
2091 | |
2113 | void |
2092 | void |
2114 | rxvt_term::button_release (XButtonEvent &ev) |
2093 | rxvt_term::button_release (XButtonEvent &ev) |
2115 | { |
2094 | { |
… | |
… | |
2224 | } |
2203 | } |
2225 | break; |
2204 | break; |
2226 | #endif |
2205 | #endif |
2227 | } |
2206 | } |
2228 | } |
2207 | } |
2229 | #ifdef MENUBAR |
|
|
2230 | else if (isMenuBarWindow (ev.window)) |
|
|
2231 | menubar_control (ev); |
|
|
2232 | #endif |
|
|
2233 | } |
2208 | } |
2234 | |
2209 | |
2235 | #ifdef TRANSPARENT |
2210 | #ifdef TRANSPARENT |
2236 | #if TINTING |
2211 | #if TINTING |
2237 | /* taken from aterm-0.4.2 */ |
2212 | /* taken from aterm-0.4.2 */ |
… | |
… | |
2780 | } |
2755 | } |
2781 | |
2756 | |
2782 | // scr_add_lines only works for nlines <= nrow - 1. |
2757 | // scr_add_lines only works for nlines <= nrow - 1. |
2783 | if (nlines >= nrow - 1) |
2758 | if (nlines >= nrow - 1) |
2784 | { |
2759 | { |
|
|
2760 | if (!(SHOULD_INVOKE (HOOK_ADD_LINES) |
2785 | 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)))) |
2786 | scr_add_lines (buf, str - buf, nlines); |
2762 | scr_add_lines (buf, str - buf, nlines); |
2787 | |
2763 | |
2788 | nlines = 0; |
2764 | nlines = 0; |
2789 | str = buf; |
2765 | str = buf; |
2790 | eol = str + min (ncol, UBUFSIZ); |
2766 | eol = str + min (ncol, UBUFSIZ); |
… | |
… | |
2805 | |
2781 | |
2806 | seq_begin = cmdbuf_ptr; |
2782 | seq_begin = cmdbuf_ptr; |
2807 | ch = next_char (); |
2783 | ch = next_char (); |
2808 | } |
2784 | } |
2809 | |
2785 | |
|
|
2786 | if (!(SHOULD_INVOKE (HOOK_ADD_LINES) |
2810 | 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)))) |
2811 | scr_add_lines (buf, str - buf, nlines); |
2788 | scr_add_lines (buf, str - buf, nlines); |
2812 | |
2789 | |
2813 | /* |
2790 | /* |
2814 | * 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 |
2815 | * 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. |
… | |
… | |
3956 | |
3933 | |
3957 | case XTerm_logfile: |
3934 | case XTerm_logfile: |
3958 | // TODO, when secure mode? |
3935 | // TODO, when secure mode? |
3959 | break; |
3936 | break; |
3960 | |
3937 | |
3961 | #ifdef MENUBAR |
|
|
3962 | case URxvt_Menu: |
|
|
3963 | if (OPTION (Opt_insecure)) |
|
|
3964 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
|
|
3965 | break; |
|
|
3966 | #endif |
|
|
3967 | #if 0 |
3938 | #if 0 |
3968 | case Rxvt_dumpscreen: /* no error notices */ |
3939 | case Rxvt_dumpscreen: /* no error notices */ |
3969 | { |
3940 | { |
3970 | int fd; |
3941 | int fd; |
3971 | 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) |
… | |
… | |
4088 | { 5, PrivMode_rVideo }, |
4059 | { 5, PrivMode_rVideo }, |
4089 | { 6, PrivMode_relOrigin }, |
4060 | { 6, PrivMode_relOrigin }, |
4090 | { 7, PrivMode_Autowrap }, |
4061 | { 7, PrivMode_Autowrap }, |
4091 | // 8, bi-directional support mode |
4062 | // 8, bi-directional support mode |
4092 | { 9, PrivMode_MouseX10 }, |
4063 | { 9, PrivMode_MouseX10 }, |
4093 | #ifdef menuBar_esc |
|
|
4094 | { menuBar_esc, PrivMode_menuBar }, |
|
|
4095 | #endif |
|
|
4096 | // 18, 19 printing-related |
4064 | // 18, 19 printing-related |
4097 | { 25, PrivMode_VisibleCursor }, |
4065 | { 25, PrivMode_VisibleCursor }, |
4098 | #ifdef scrollBar_esc |
4066 | #ifdef scrollBar_esc |
4099 | { scrollBar_esc, PrivMode_scrollBar }, |
4067 | { scrollBar_esc, PrivMode_scrollBar }, |
4100 | #endif |
4068 | #endif |
… | |
… | |
4195 | /* 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 */ |
4196 | case 9: /* X10 mouse reporting */ |
4164 | case 9: /* X10 mouse reporting */ |
4197 | if (state) /* orthogonal */ |
4165 | if (state) /* orthogonal */ |
4198 | priv_modes &= ~PrivMode_MouseX11; |
4166 | priv_modes &= ~PrivMode_MouseX11; |
4199 | break; |
4167 | break; |
4200 | #ifdef menuBar_esc |
|
|
4201 | case menuBar_esc: |
|
|
4202 | #ifdef MENUBAR |
|
|
4203 | map_menuBar (state); |
|
|
4204 | #endif |
|
|
4205 | break; |
|
|
4206 | #endif |
|
|
4207 | #ifdef scrollBar_esc |
4168 | #ifdef scrollBar_esc |
4208 | case scrollBar_esc: |
4169 | case scrollBar_esc: |
4209 | if (scrollbar_mapping (state)) |
4170 | if (scrollbar_mapping (state)) |
4210 | { |
4171 | { |
4211 | resize_all_windows (0, 0, 0); |
4172 | resize_all_windows (0, 0, 0); |