ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.177 by root, Mon Dec 13 07:18:52 2004 UTC vs.
Revision 1.190 by root, Mon Jan 17 00:59:23 2005 UTC

48#include "../config.h" /* NECESSARY */ 48#include "../config.h" /* NECESSARY */
49#include "rxvt.h" /* NECESSARY */ 49#include "rxvt.h" /* NECESSARY */
50#include "version.h" 50#include "version.h"
51#include "command.h" 51#include "command.h"
52 52
53#ifdef KEYSYM_RESOURCE
54# include "keyboard.h"
55#endif
56
53#include <wchar.h> 57#include <cwchar>
54#include <signal.h> 58#include <csignal>
55 59
56/*----------------------------------------------------------------------*/ 60/*----------------------------------------------------------------------*/
57 61
58#define IS_CONTROL(ch) !((ch) & 0xffffff60UL) 62#define IS_CONTROL(ch) !((ch) & 0xffffff60UL)
59 63
344 valid_keysym = keysym != NoSymbol; 348 valid_keysym = keysym != NoSymbol;
345 } 349 }
346 350
347 if (valid_keysym) 351 if (valid_keysym)
348 { 352 {
353#ifdef KEYSYM_RESOURCE
354 if (keyboard->dispatch (this, keysym, ev.state))
355 return;
356#endif
357
349 if (TermWin.saveLines) 358 if (TermWin.saveLines)
350 { 359 {
351#ifdef UNSHIFTED_SCROLLKEYS 360#ifdef UNSHIFTED_SCROLLKEYS
352 if (!ctrl && !meta) 361 if (!ctrl && !meta)
353#else 362#else
487 } 496 }
488#endif 497#endif
489 498
490 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 499 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
491 { 500 {
492#ifdef KEYSYM_RESOURCE
493 if (! (shft | ctrl) && Keysym_map[keysym & 0xFF] != NULL)
494 {
495 unsigned int l;
496 const unsigned char *kbuf0;
497
498 kbuf0 = (Keysym_map[keysym & 0xFF]);
499 l = (unsigned int)*kbuf0++;
500
501 /* escape prefix */
502 if (meta
503# ifdef META8_OPTION
504 && meta_char == C0_ESC
505# endif
506 )
507 {
508 const unsigned char ch = C0_ESC;
509 tt_write (&ch, 1);
510 }
511
512 tt_write (kbuf0, l);
513 return;
514 }
515 else
516#endif
517 { 501 {
518 newlen = 1; 502 newlen = 1;
519 switch (keysym) 503 switch (keysym)
520 { 504 {
521#ifndef NO_BACKSPACE_KEY 505#ifndef NO_BACKSPACE_KEY
788#undef FKEY 772#undef FKEY
789 default: 773 default:
790 newlen = 0; 774 newlen = 0;
791 break; 775 break;
792 } 776 }
777
793 if (newlen) 778 if (newlen)
794 len = strlen (kbuf); 779 len = strlen (kbuf);
795 } 780 }
796 781
797 /* 782 /*
805 } 790 }
806 else if (ctrl && keysym == XK_minus) 791 else if (ctrl && keysym == XK_minus)
807 { 792 {
808 len = 1; 793 len = 1;
809 kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */ 794 kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */
795 }
796 else if (keysym == XK_ISO_Left_Tab)
797 {
798 strcpy (kbuf, "\033[Z");
799 len = 3;
810 } 800 }
811 else 801 else
812 { 802 {
813#ifdef META8_OPTION 803#ifdef META8_OPTION
814 /* set 8-bit on */ 804 /* set 8-bit on */
873#endif /* DEBUG_CMD */ 863#endif /* DEBUG_CMD */
874 tt_write (kbuf, (unsigned int)len); 864 tt_write (kbuf, (unsigned int)len);
875} 865}
876/*}}} */ 866/*}}} */
877 867
878#if (MENUBAR_MAX) 868#if MENUBAR_MAX || defined (KEYSYM_RESOURCE)
879/*{{{ rxvt_cmd_write (), rxvt_cmd_getc () */ 869/*{{{ rxvt_cmd_write (), rxvt_cmd_getc () */
880/* attempt to `write' count to the input buffer */ 870/* attempt to `write' count to the input buffer */
881unsigned int 871unsigned int
882rxvt_term::cmd_write (const unsigned char *str, unsigned int count) 872rxvt_term::cmd_write (const unsigned char *str, unsigned int count)
883{ 873{
906 896
907 cmd_parse (); 897 cmd_parse ();
908 898
909 return 0; 899 return 0;
910} 900}
911#endif /* MENUBAR_MAX */ 901#endif
912 902
913void 903void
914rxvt_term::flush () 904rxvt_term::flush ()
915{ 905{
916 flush_ev.stop (); 906 flush_ev.stop ();
1017{ 1007{
1018 if (mouse_slip_wheel_speed == 0 1008 if (mouse_slip_wheel_speed == 0
1019 || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) 1009 || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed)
1020 : scr_page (UP, mouse_slip_wheel_speed)) 1010 : scr_page (UP, mouse_slip_wheel_speed))
1021 { 1011 {
1012 if (TermWin.view_start == TermWin.nscrolled ||
1013 TermWin.view_start == 0)
1014 mouse_slip_wheel_speed = 0;
1015
1022 refresh_type |= SMOOTH_REFRESH; 1016 refresh_type |= SMOOTH_REFRESH;
1023 want_refresh = 1; 1017 want_refresh = 1;
1024 w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); 1018 w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY);
1025 } 1019 }
1026} 1020}
1089rxvt_term::pointer_blank () 1083rxvt_term::pointer_blank ()
1090{ 1084{
1091 if (! (options & Opt_pointerBlank)) 1085 if (! (options & Opt_pointerBlank))
1092 return; 1086 return;
1093 1087
1094 XDefineCursor (display->display, TermWin.vt, blank_cursor); 1088 XDefineCursor (display->display, TermWin.vt, display->blank_cursor);
1095 XFlush (display->display); 1089 XFlush (display->display);
1096 1090
1097 hidden_pointer = 1; 1091 hidden_pointer = 1;
1098} 1092}
1099 1093
1668 case PropertyNotify: 1662 case PropertyNotify:
1669 /* 1663 /*
1670 * if user used some Esetroot compatible prog to set the root bg, 1664 * if user used some Esetroot compatible prog to set the root bg,
1671 * use the property to determine the pixmap. We use it later on. 1665 * use the property to determine the pixmap. We use it later on.
1672 */ 1666 */
1673 if (xa[XA_XROOTPMAPID] == 0)
1674 xa[XA_XROOTPMAPID] = XInternAtom (display->display, "_XROOTPMAP_ID", False);
1675
1676 if (ev.xproperty.atom != xa[XA_XROOTPMAPID]) 1667 if (ev.xproperty.atom != xa[XA_XROOTPMAP_ID]
1668 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID])
1677 return; 1669 return;
1678 1670
1679 /* FALLTHROUGH */ 1671 /* FALLTHROUGH */
1680 case ReparentNotify: 1672 case ReparentNotify:
1681 if ((options & Opt_transparent) && check_our_parents () && am_transparent) 1673 if ((options & Opt_transparent) && check_our_parents () && am_transparent)
1753 { 1745 {
1754 case Button1: 1746 case Button1:
1755 /* allow meta + click to select rectangular areas */ 1747 /* allow meta + click to select rectangular areas */
1756 /* should be done in screen.C */ 1748 /* should be done in screen.C */
1757#if ENABLE_FRILLS 1749#if ENABLE_FRILLS
1758 selection.rect = !! (ev.state & ModMetaMask); 1750 selection.rect = !!(ev.state & ModMetaMask);
1759#else 1751#else
1760 selection.rect = false; 1752 selection.rect = false;
1761#endif 1753#endif
1762 1754
1763 /* allow shift+left click to extend selection */ 1755 /* allow shift+left click to extend selection */
2351 /* 2343 /*
2352 * Make the frame window set by the window manager have 2344 * Make the frame window set by the window manager have
2353 * the root background. Some window managers put multiple nested frame 2345 * the root background. Some window managers put multiple nested frame
2354 * windows for each client, so we have to take care about that. 2346 * windows for each client, so we have to take care about that.
2355 */ 2347 */
2356 i = (xa[XA_XROOTPMAPID] 2348 i = (xa[XA_XROOTPMAP_ID]
2357 && XGetWindowProperty (display->display, display->root, xa[XA_XROOTPMAPID], 2349 && XGetWindowProperty (display->display, display->root, xa[XA_XROOTPMAP_ID],
2358 0L, 1L, False, XA_PIXMAP, &atype, &aformat, 2350 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
2359 &nitems, &bytes_after, &prop) == Success); 2351 &nitems, &bytes_after, &prop) == Success);
2360 2352
2361 if (!i || prop == NULL) 2353 if (!i || prop == NULL)
2362 i = (xa[XA_XSETROOTID] 2354 i = (xa[XA_ESETROOT_PMAP_ID]
2363 && XGetWindowProperty (display->display, display->root, xa[XA_XSETROOTID], 2355 && XGetWindowProperty (display->display, display->root, xa[XA_ESETROOT_PMAP_ID],
2364 0L, 1L, False, XA_PIXMAP, &atype, &aformat, 2356 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
2365 &nitems, &bytes_after, &prop) == Success); 2357 &nitems, &bytes_after, &prop) == Success);
2366 2358
2367 if (!i || prop == NULL 2359 if (!i || prop == NULL
2368#if TINTING 2360#if TINTING
2709 if (len == (size_t)-1) 2701 if (len == (size_t)-1)
2710 return *cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through 2702 return *cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through
2711 2703
2712 // assume wchar == unicode 2704 // assume wchar == unicode
2713 cmdbuf_ptr += len; 2705 cmdbuf_ptr += len;
2714 return wc; 2706 return wc & UNICODE_MASK;
2715 } 2707 }
2716 2708
2717 return NOCHAR; 2709 return NOCHAR;
2718} 2710}
2719 2711
3836 if (query) 3828 if (query)
3837 tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp); 3829 tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp);
3838 else 3830 else
3839 { 3831 {
3840 set_locale (str); 3832 set_locale (str);
3833 pty.set_utf8_mode (enc_utf8);
3841# ifdef USE_XIM 3834# ifdef USE_XIM
3842 im_cb (); 3835 im_cb ();
3843# endif 3836# endif
3844 } 3837 }
3845 break; 3838 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines