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.45 by pcg, Sat Feb 21 20:33:39 2004 UTC vs.
Revision 1.53 by pcg, Sun Feb 22 12:34:53 2004 UTC

25 * - extensive modifications 25 * - extensive modifications
26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> 26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org>
27 * Copyright (c) 2001 Marius Gedminas 27 * Copyright (c) 2001 Marius Gedminas
28 * - Ctrl/Mod4+Tab works like Meta+Tab (options) 28 * - Ctrl/Mod4+Tab works like Meta+Tab (options)
29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> 29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org>
30 * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com>
30 * 31 *
31 * This program is free software; you can redistribute it and/or modify 32 * This program is free software; you can redistribute it and/or modify
32 * it under the terms of the GNU General Public License as published by 33 * it under the terms of the GNU General Public License as published by
33 * the Free Software Foundation; either version 2 of the License, or 34 * the Free Software Foundation; either version 2 of the License, or
34 * (at your option) any later version. 35 * (at your option) any later version.
55 56
56/*{{{ Convert the keypress event into a string */ 57/*{{{ Convert the keypress event into a string */
57void 58void
58rxvt_term::lookup_key (XKeyEvent &ev) 59rxvt_term::lookup_key (XKeyEvent &ev)
59{ 60{
60 int ctrl, meta, shft, len; 61 int ctrl, meta, shft, len;
61 unsigned int newlen; 62 unsigned int newlen;
62 KeySym keysym; 63 KeySym keysym;
63#ifdef DEBUG_CMD 64#ifdef DEBUG_CMD
64 static int debug_key = 1; /* accessible by a debugger only */ 65 static int debug_key = 1; /* accessible by a debugger only */
65#endif 66#endif
66 int valid_keysym; 67 int valid_keysym;
67 unsigned char kbuf[KBUFSZ]; 68 unsigned char kbuf[KBUFSZ];
68 69
69 /* 70 /*
70 * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an 71 * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an
71 * escape sequence to toggle the Keypad. 72 * escape sequence to toggle the Keypad.
88 if (Input_Context) 89 if (Input_Context)
89 { 90 {
90 Status status_return; 91 Status status_return;
91 92
92#ifdef X_HAVE_UTF8_STRING 93#ifdef X_HAVE_UTF8_STRING
93 if (enc_utf8 && 0) 94 if (enc_utf8 && 0) // currently disabled, doesn't seem to work, nor is useful
94 len = Xutf8LookupString (Input_Context, &ev, (char *)kbuf, 95 len = Xutf8LookupString (Input_Context, &ev, (char *)kbuf,
95 KBUFSZ, &keysym, &status_return); 96 KBUFSZ, &keysym, &status_return);
96 else 97 else
97#endif 98#endif
98
99 { 99 {
100 wchar_t wkbuf[KBUFSZ + 1]; 100 wchar_t wkbuf[KBUFSZ + 1];
101 101
102 // the XOpenIM manpage lies about hardcoding the locale 102 // the XOpenIM manpage lies about hardcoding the locale
103 // at the point of XOpenIM, so temporarily switch locales 103 // at the point of XOpenIM, so temporarily switch locales
108 KBUFSZ, &keysym, &status_return); 108 KBUFSZ, &keysym, &status_return);
109 if (rs[Rs_imLocale]) 109 if (rs[Rs_imLocale])
110 SET_LOCALE (locale); 110 SET_LOCALE (locale);
111 111
112 if (status_return == XLookupChars 112 if (status_return == XLookupChars
113 || status_return == XLookupBoth) 113 || status_return == XLookupBoth)
114 { 114 {
115 wkbuf[len] = 0; 115 wkbuf[len] = 0;
116 len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ); 116 len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ);
117 if (len < 0) 117 if (len < 0)
118 len = 0; 118 len = 0;
120 else 120 else
121 len = 0; 121 len = 0;
122 } 122 }
123 123
124 valid_keysym = status_return == XLookupKeySym 124 valid_keysym = status_return == XLookupKeySym
125 || status_return == XLookupBoth; 125 || status_return == XLookupBoth;
126 } 126 }
127 else 127 else
128#endif 128#endif
129
130 { 129 {
131 len = XLookupString (&ev, (char *)kbuf, KBUFSZ, &keysym, &compose); 130 len = XLookupString (&ev, (char *)kbuf, KBUFSZ, &keysym, &compose);
132 valid_keysym = !len; 131 valid_keysym = keysym != NoSymbol;
133 } 132 }
134 133
135 if (valid_keysym) 134 if (valid_keysym)
136 { 135 {
137 /* for some backwards compatibility */ 136 /* for some backwards compatibility */
142 if (meta) 141 if (meta)
143# endif 142# endif
144 { 143 {
145 if (keysym == ks_bigfont) 144 if (keysym == ks_bigfont)
146 { 145 {
147 change_font (0, FONT_UP); 146 change_font (FONT_UP);
148 return; 147 return;
149 } 148 }
150 else if (keysym == ks_smallfont) 149 else if (keysym == ks_smallfont)
151 { 150 {
152 change_font (0, FONT_DN); 151 change_font (FONT_DN);
153 return; 152 return;
154 } 153 }
155 } 154 }
156#endif 155#endif
157 156
162 { 161 {
163#else 162#else
164 if (IS_SCROLL_MOD) 163 if (IS_SCROLL_MOD)
165 { 164 {
166#endif 165#endif
167 int lnsppg; 166 int lnsppg;
168 167
169#ifdef PAGING_CONTEXT_LINES 168#ifdef PAGING_CONTEXT_LINES
170 lnsppg = TermWin.nrow - PAGING_CONTEXT_LINES; 169 lnsppg = TermWin.nrow - PAGING_CONTEXT_LINES;
171#else 170#else
172 lnsppg = TermWin.nrow * 4 / 5; 171 lnsppg = TermWin.nrow * 4 / 5;
210 scr_move_to (1, 0); 209 scr_move_to (1, 0);
211 return; 210 return;
212 } 211 }
213 } 212 }
214#endif 213#endif
215
216 } 214 }
217 215
218 if (shft) 216 if (shft)
219 { 217 {
220 /* Shift + F1 - F10 generates F11 - F20 */ 218 /* Shift + F1 - F10 generates F11 - F20 */
231 case XK_Insert: /* Shift+Insert = paste mouse selection */ 229 case XK_Insert: /* Shift+Insert = paste mouse selection */
232 selection_request (ev.time, 0, 0); 230 selection_request (ev.time, 0, 0);
233 return; 231 return;
234 /* rxvt extras */ 232 /* rxvt extras */
235 case XK_KP_Add: /* Shift+KP_Add = bigger font */ 233 case XK_KP_Add: /* Shift+KP_Add = bigger font */
236 change_font (0, FONT_UP); 234 change_font (FONT_UP);
237 return; 235 return;
238 case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ 236 case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */
239 change_font (0, FONT_DN); 237 change_font (FONT_DN);
240 return; 238 return;
241 } 239 }
242 } 240 }
243 } 241 }
244#ifdef PRINTPIPE 242#ifdef PRINTPIPE
245 if (keysym == XK_Print) 243 if (keysym == XK_Print)
246 { 244 {
247 scr_printscreen (ctrl | shft); 245 scr_printscreen (ctrl | shft);
248 return;
249 }
250#endif
251#ifdef GREEK_SUPPORT
252 if (keysym == ks_greekmodeswith)
253 {
254 greek_mode = !greek_mode;
255 if (greek_mode)
256 {
257 xterm_seq (XTerm_title,
258 (greek_getmode () == GREEK_ELOT928
259 ? "[Greek: iso]" : "[Greek: ibm]"), CHAR_ST);
260 greek_reset ();
261 }
262 else
263 xterm_seq (XTerm_title, APL_NAME "-" VERSION, CHAR_ST);
264 return; 246 return;
265 } 247 }
266#endif 248#endif
267 249
268 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 250 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
286 tt_write (kbuf0, l); 268 tt_write (kbuf0, l);
287 return; 269 return;
288 } 270 }
289 else 271 else
290#endif 272#endif
291
292 { 273 {
293 newlen = 1; 274 newlen = 1;
294 switch (keysym) 275 switch (keysym)
295 { 276 {
296#ifndef NO_BACKSPACE_KEY 277#ifndef NO_BACKSPACE_KEY
349#endif 330#endif
350 newlen = 0; 331 newlen = 0;
351 } 332 }
352 break; 333 break;
353 334
354
355#ifdef XK_KP_Left 335#ifdef XK_KP_Left
356 case XK_KP_Up: /* \033Ox or standard */ 336 case XK_KP_Up: /* \033Ox or standard */
357 case XK_KP_Down: /* \033Or or standard */ 337 case XK_KP_Down: /* \033Or or standard */
358 case XK_KP_Right: /* \033Ov or standard */ 338 case XK_KP_Right: /* \033Ov or standard */
359 case XK_KP_Left: /* \033Ot or standard */ 339 case XK_KP_Left: /* \033Ot or standard */
360 if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) 340 if ((PrivateModes & PrivMode_aplKP) ? !shft : shft)
361 { 341 {
362 STRCPY (kbuf, "\033OZ"); 342 STRCPY (kbuf, "\033OZ");
363 kbuf[2] = ("txvr"[keysym - XK_KP_Left]); 343 kbuf[2] = "txvr"[keysym - XK_KP_Left];
364 break; 344 break;
365 } 345 }
366 else 346 else
367 /* translate to std. cursor key */ 347 /* translate to std. cursor key */
368 keysym = XK_Left + (keysym - XK_KP_Left); 348 keysym = XK_Left + (keysym - XK_KP_Left);
371 case XK_Up: /* "\033[A" */ 351 case XK_Up: /* "\033[A" */
372 case XK_Down: /* "\033[B" */ 352 case XK_Down: /* "\033[B" */
373 case XK_Right: /* "\033[C" */ 353 case XK_Right: /* "\033[C" */
374 case XK_Left: /* "\033[D" */ 354 case XK_Left: /* "\033[D" */
375 STRCPY (kbuf, "\033[Z"); 355 STRCPY (kbuf, "\033[Z");
376 kbuf[2] = ("DACB"[keysym - XK_Left]); 356 kbuf[2] = "DACB"[keysym - XK_Left];
377 /* do Shift first */ 357 /* do Shift first */
378 if (shft) 358 if (shft)
379 kbuf[2] = ("dacb"[keysym - XK_Left]); 359 kbuf[2] = "dacb"[keysym - XK_Left];
380 else if (ctrl) 360 else if (ctrl)
381 { 361 {
382 kbuf[1] = 'O'; 362 kbuf[1] = 'O';
383 kbuf[2] = ("dacb"[keysym - XK_Left]); 363 kbuf[2] = "dacb"[keysym - XK_Left];
384 } 364 }
385 else if (PrivateModes & PrivMode_aplCUR) 365 else if (PrivateModes & PrivMode_aplCUR)
386 kbuf[1] = 'O'; 366 kbuf[1] = 'O';
387#ifdef MULTICHAR_SET 367#ifdef MULTICHAR_SET
388 //TODO: ?? 368 //TODO: ??
482 STRCPY (kbuf, "\033OP"); 462 STRCPY (kbuf, "\033OP");
483 kbuf[2] += (keysym - XK_KP_F1); 463 kbuf[2] += (keysym - XK_KP_F1);
484 break; 464 break;
485 465
486 case XK_KP_Multiply: /* "\033Oj" : "*" */ 466 case XK_KP_Multiply: /* "\033Oj" : "*" */
487 case XK_KP_Add: /* "\033Ok" : "+" */ 467 case XK_KP_Add: /* "\033Ok" : "+" */
488 case XK_KP_Separator: /* "\033Ol" : "," */ 468 case XK_KP_Separator: /* "\033Ol" : "," */
489 case XK_KP_Subtract: /* "\033Om" : "-" */ 469 case XK_KP_Subtract: /* "\033Om" : "-" */
490 case XK_KP_Decimal: /* "\033On" : "." */ 470 case XK_KP_Decimal: /* "\033On" : "." */
491 case XK_KP_Divide: /* "\033Oo" : "/" */ 471 case XK_KP_Divide: /* "\033Oo" : "/" */
492 case XK_KP_0: /* "\033Op" : "0" */ 472 case XK_KP_0: /* "\033Op" : "0" */
642 for (ch = kbuf; ch < kbuf + len; ch++) 622 for (ch = kbuf; ch < kbuf + len; ch++)
643 *ch |= 0x80; 623 *ch |= 0x80;
644 meta = 0; 624 meta = 0;
645 } 625 }
646#endif 626#endif
647#ifdef GREEK_SUPPORT
648 if (greek_mode)
649 len = greek_xlat (kbuf, len);
650#endif
651 /* nil */ ; 627 /* nil */ ;
652 } 628 }
653 } 629 }
654 630
655 if (len <= 0) 631 if (len <= 0)
1428 } 1404 }
1429#ifdef MENUBAR 1405#ifdef MENUBAR
1430 if (menubar_visible () && isMenuBarWindow (ev.xany.window)) 1406 if (menubar_visible () && isMenuBarWindow (ev.xany.window))
1431 menubar_expose (); 1407 menubar_expose ();
1432#endif 1408#endif
1433#ifdef RXVT_GRAPHICS
1434 Gr_expose (ev.xany.window);
1435#endif
1436
1437 } 1409 }
1438 break; 1410 break;
1439 1411
1440 case MotionNotify: 1412 case MotionNotify:
1441#ifdef POINTER_BLANK 1413#ifdef POINTER_BLANK
1594 /* 1566 /*
1595 * VT window processing of button press 1567 * VT window processing of button press
1596 */ 1568 */
1597 if (ev.window == TermWin.vt) 1569 if (ev.window == TermWin.vt)
1598 { 1570 {
1599#if RXVT_GRAPHICS
1600 if (ev.subwindow != None)
1601 rxvt_Gr_ButtonPress (ev.x, ev.y);
1602 else
1603#endif
1604
1605 {
1606 clickintime = ev.time - MEvent.time < MULTICLICK_TIME; 1571 clickintime = ev.time - MEvent.time < MULTICLICK_TIME;
1607 if (reportmode) 1572 if (reportmode)
1573 {
1574 /* mouse report from vt window */
1575 /* save the xbutton state (for ButtonRelease) */
1576 MEvent.state = ev.state;
1577#ifdef MOUSE_REPORT_DOUBLECLICK
1578 if (ev.button == MEvent.button && clickintime)
1608 { 1579 {
1609 /* mouse report from vt window */ 1580 /* same button, within alloted time */
1610 /* save the xbutton state (for ButtonRelease) */ 1581 MEvent.clicks++;
1611 MEvent.state = ev.state; 1582 if (MEvent.clicks > 1)
1612#ifdef MOUSE_REPORT_DOUBLECLICK
1613 if (ev.button == MEvent.button && clickintime)
1614 { 1583 {
1615 /* same button, within alloted time */
1616 MEvent.clicks++;
1617 if (MEvent.clicks > 1)
1618 {
1619 /* only report double clicks */ 1584 /* only report double clicks */
1620 MEvent.clicks = 2; 1585 MEvent.clicks = 2;
1621 mouse_report (ev); 1586 mouse_report (ev);
1622 1587
1623 /* don't report the release */ 1588 /* don't report the release */
1624 MEvent.clicks = 0; 1589 MEvent.clicks = 0;
1625 MEvent.button = AnyButton; 1590 MEvent.button = AnyButton;
1626 }
1627 } 1591 }
1628 else
1629 {
1630 /* different button, or time expired */
1631 MEvent.clicks = 1;
1632 MEvent.button = ev.button;
1633 mouse_report (ev);
1634 }
1635#else
1636 MEvent.button = ev.button;
1637 mouse_report (ev);
1638#endif /* MOUSE_REPORT_DOUBLECLICK */
1639
1640 } 1592 }
1641 else 1593 else
1642 { 1594 {
1595 /* different button, or time expired */
1596 MEvent.clicks = 1;
1597 MEvent.button = ev.button;
1598 mouse_report (ev);
1599 }
1600#else
1601 MEvent.button = ev.button;
1602 mouse_report (ev);
1603#endif /* MOUSE_REPORT_DOUBLECLICK */
1604
1605 }
1606 else
1607 {
1643 if (ev.button != MEvent.button) 1608 if (ev.button != MEvent.button)
1644 MEvent.clicks = 0; 1609 MEvent.clicks = 0;
1645 switch (ev.button) 1610 switch (ev.button)
1646 { 1611 {
1647 case Button1: 1612 case Button1:
1648 /* allow shift+left click to extend selection */ 1613 /* allow shift+left click to extend selection */
1649 if (ev.state & ShiftMask && ! (PrivateModes & PrivMode_mouse_report)) 1614 if (ev.state & ShiftMask && ! (PrivateModes & PrivMode_mouse_report))
1650 { 1615 {
1651 if (MEvent.button == Button1 && clickintime)
1652 selection_rotate (ev.x, ev.y);
1653 else
1654 selection_extend (ev.x, ev.y, 1);
1655 }
1656 else
1657 {
1658 if (MEvent.button == Button1 && clickintime)
1659 MEvent.clicks++;
1660 else
1661 MEvent.clicks = 1;
1662
1663 selection_click (MEvent.clicks, ev.x, ev.y);
1664 }
1665
1666 MEvent.button = Button1;
1667 break;
1668
1669 case Button3:
1670 if (MEvent.button == Button3 && clickintime) 1616 if (MEvent.button == Button1 && clickintime)
1671 selection_rotate (ev.x, ev.y); 1617 selection_rotate (ev.x, ev.y);
1672 else 1618 else
1673 selection_extend (ev.x, ev.y, 1); 1619 selection_extend (ev.x, ev.y, 1);
1620 }
1621 else
1622 {
1623 if (MEvent.button == Button1 && clickintime)
1624 MEvent.clicks++;
1625 else
1626 MEvent.clicks = 1;
1627
1628 selection_click (MEvent.clicks, ev.x, ev.y);
1629 }
1630
1631 MEvent.button = Button1;
1632 break;
1633
1634 case Button3:
1635 if (MEvent.button == Button3 && clickintime)
1636 selection_rotate (ev.x, ev.y);
1637 else
1638 selection_extend (ev.x, ev.y, 1);
1674 MEvent.button = Button3; 1639 MEvent.button = Button3;
1675 break; 1640 break;
1676 }
1677 } 1641 }
1642 }
1678 MEvent.time = ev.time; 1643 MEvent.time = ev.time;
1679 return; 1644 return;
1680 }
1681 } 1645 }
1682 1646
1683 /* 1647 /*
1684 * Scrollbar window processing of button press 1648 * Scrollbar window processing of button press
1685 */ 1649 */
1850#ifdef SELECTION_SCROLLING 1814#ifdef SELECTION_SCROLLING
1851 pending_scroll_selection=0; 1815 pending_scroll_selection=0;
1852#endif 1816#endif
1853 if (ev.window == TermWin.vt) 1817 if (ev.window == TermWin.vt)
1854 { 1818 {
1855#ifdef RXVT_GRAPHICS
1856 if (ev.subwindow != None)
1857 rxvt_Gr_ButtonRelease (ev.x, ev.y);
1858 else
1859#endif
1860
1861 {
1862 if (reportmode) 1819 if (reportmode)
1820 {
1821 /* mouse report from vt window */
1822 /* don't report release of wheel "buttons" */
1823 if (ev.button >= 4)
1824 return;
1825#ifdef MOUSE_REPORT_DOUBLECLICK
1826 /* only report the release of 'slow' single clicks */
1827 if (MEvent.button != AnyButton
1828 && (ev.button != MEvent.button
1829 || (ev.time - MEvent.time
1830 > MULTICLICK_TIME / 2)))
1863 { 1831 {
1864 /* mouse report from vt window */
1865 /* don't report release of wheel "buttons" */
1866 if (ev.button >= 4)
1867 return;
1868#ifdef MOUSE_REPORT_DOUBLECLICK
1869 /* only report the release of 'slow' single clicks */
1870 if (MEvent.button != AnyButton
1871 && (ev.button != MEvent.button
1872 || (ev.time - MEvent.time
1873 > MULTICLICK_TIME / 2)))
1874 {
1875 MEvent.clicks = 0; 1832 MEvent.clicks = 0;
1876 MEvent.button = AnyButton;
1877 mouse_report (ev);
1878 }
1879#else /* MOUSE_REPORT_DOUBLECLICK */
1880 MEvent.button = AnyButton; 1833 MEvent.button = AnyButton;
1881 mouse_report (ev); 1834 mouse_report (ev);
1835 }
1836#else /* MOUSE_REPORT_DOUBLECLICK */
1837 MEvent.button = AnyButton;
1838 mouse_report (ev);
1882#endif /* MOUSE_REPORT_DOUBLECLICK */ 1839#endif /* MOUSE_REPORT_DOUBLECLICK */
1883 return; 1840 return;
1884 } 1841 }
1885 /* 1842 /*
1886 * dumb hack to compensate for the failure of click-and-drag 1843 * dumb hack to compensate for the failure of click-and-drag
1887 * when overriding mouse reporting 1844 * when overriding mouse reporting
1888 */ 1845 */
1889 if (PrivateModes & PrivMode_mouse_report 1846 if (PrivateModes & PrivMode_mouse_report
1890 && bypass_keystate 1847 && bypass_keystate
1891 && ev.button == Button1 && MEvent.clicks <= 1) 1848 && ev.button == Button1 && MEvent.clicks <= 1)
1892 selection_extend (ev.x, ev.y, 0); 1849 selection_extend (ev.x, ev.y, 0);
1893 1850
1894 switch (ev.button) 1851 switch (ev.button)
1852 {
1853 case Button1:
1854 case Button3:
1855 selection_make (ev.time);
1856 break;
1857 case Button2:
1858 selection_request (ev.time, ev.x, ev.y);
1859 break;
1860#ifdef MOUSE_WHEEL
1861 case Button4:
1862 case Button5:
1895 { 1863 {
1896 case Button1: 1864 int i;
1897 case Button3: 1865 page_dirn v;
1898 selection_make (ev.time); 1866
1867 v = (ev.button == Button4) ? UP : DN;
1868 if (ev.state & ShiftMask)
1899 break; 1869 i = 1;
1900 case Button2: 1870 else if ((Options & Opt_mouseWheelScrollPage))
1901 selection_request (ev.time, ev.x, ev.y); 1871 i = TermWin.nrow - 1;
1872 else
1902 break; 1873 i = 5;
1903#ifdef MOUSE_WHEEL 1874# ifdef MOUSE_SLIP_WHEELING
1904 case Button4: 1875 if (ev.state & ControlMask)
1905 case Button5:
1906 { 1876 {
1907 int i;
1908 page_dirn v;
1909
1910 v = (ev.button == Button4) ? UP : DN;
1911 if (ev.state & ShiftMask)
1912 i = 1;
1913 else if ((Options & Opt_mouseWheelScrollPage))
1914 i = TermWin.nrow - 1;
1915 else
1916 i = 5;
1917# ifdef MOUSE_SLIP_WHEELING
1918 if (ev.state & ControlMask)
1919 {
1920 mouse_slip_wheel_speed += (v ? -1 : 1); 1877 mouse_slip_wheel_speed += (v ? -1 : 1);
1921 mouse_slip_wheel_delay = SCROLLBAR_CONTINUOUS_DELAY; 1878 mouse_slip_wheel_delay = SCROLLBAR_CONTINUOUS_DELAY;
1922 } 1879 }
1923# endif 1880# endif
1924# ifdef JUMP_MOUSE_WHEEL 1881# ifdef JUMP_MOUSE_WHEEL
1882 scr_page (v, i);
1883 scr_refresh (SMOOTH_REFRESH);
1884 scrollbar_show (1);
1885# else
1886 while (i--)
1887 {
1925 scr_page (v, i); 1888 scr_page (v, 1);
1926 scr_refresh (SMOOTH_REFRESH); 1889 scr_refresh (SMOOTH_REFRESH);
1927 scrollbar_show (1); 1890 scrollbar_show (1);
1928# else
1929 while (i--)
1930 {
1931 scr_page (v, 1);
1932 scr_refresh (SMOOTH_REFRESH);
1933 scrollbar_show (1);
1934 } 1891 }
1935# endif 1892# endif
1936 1893
1937 }
1938 break;
1939#endif
1940
1941 } 1894 }
1895 break;
1896#endif
1897
1942 } 1898 }
1943 } 1899 }
1944#ifdef MENUBAR 1900#ifdef MENUBAR
1945 else if (isMenuBarWindow (ev.window)) 1901 else if (isMenuBarWindow (ev.window))
1946 menubar_control (ev); 1902 menubar_control (ev);
2738 break; 2694 break;
2739#endif 2695#endif
2740 case 8: /* unofficial extension */ 2696 case 8: /* unofficial extension */
2741 xterm_seq (XTerm_title, APL_NAME "-" VERSION, CHAR_ST); 2697 xterm_seq (XTerm_title, APL_NAME "-" VERSION, CHAR_ST);
2742 break; 2698 break;
2699
2700 case XTerm_locale: /* unofficial extension */
2701 tt_printf ("%-.250s\n", locale);
2702 break;
2743 } 2703 }
2744 break; 2704 break;
2745 2705
2746 case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */ 2706 case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */
2747 switch (arg[0]) 2707 switch (arg[0])
3015 * 19 = change underlined character color 2975 * 19 = change underlined character color
3016 * 46 = change logfile (not implemented) 2976 * 46 = change logfile (not implemented)
3017 * 50 = change font 2977 * 50 = change font
3018 * 2978 *
3019 * rxvt extensions: 2979 * rxvt extensions:
2980 * 9 = change locale (NYI)
3020 * 10 = menu (may change in future) 2981 * 10 = menu (may change in future)
3021 * 20 = bg pixmap 2982 * 20 = bg pixmap
3022 * 39 = change default fg color 2983 * 39 = change default fg color
3023 * 49 = change default bg color 2984 * 49 = change default bg color
3024 * 55 = dump scrollback buffer and all of screen 2985 * 55 = dump scrollback buffer and all of screen
3115 set_window_color (Color_bg, str); 3076 set_window_color (Color_bg, str);
3116 break; 3077 break;
3117 case XTerm_logfile: 3078 case XTerm_logfile:
3118 break; 3079 break;
3119 case XTerm_font: 3080 case XTerm_font:
3120 change_font (0, str); 3081 change_font (str);
3082 break;
3083 case XTerm_locale:
3084 set_locale (str);
3085 im_cb ();
3121 break; 3086 break;
3122#if 0 3087#if 0
3123 case XTerm_dumpscreen: /* no error notices */ 3088 case XTerm_dumpscreen: /* no error notices */
3124 { 3089 {
3125 int fd; 3090 int fd;
3476void 3441void
3477rxvt_term::process_graphics () 3442rxvt_term::process_graphics ()
3478{ 3443{
3479 unsigned char ch, cmd = cmd_getc (); 3444 unsigned char ch, cmd = cmd_getc ();
3480 3445
3481#ifndef RXVT_GRAPHICS
3482 if (cmd == 'Q') 3446 if (cmd == 'Q')
3483 { /* query graphics */ 3447 { /* query graphics */
3484 tt_printf ("\033G0\n"); /* no graphics */ 3448 tt_printf ("\033G0\n"); /* no graphics */
3485 return; 3449 return;
3486 } 3450 }
3487 /* swallow other graphics sequences until terminating ':' */ 3451 /* swallow other graphics sequences until terminating ':' */
3488 do 3452 do
3489 ch = cmd_getc (); 3453 ch = cmd_getc ();
3490 while (ch != ':'); 3454 while (ch != ':');
3491#else
3492 unsigned int nargs;
3493 int args[NGRX_PTS];
3494 unsigned char *text = NULL;
3495
3496 if (cmd == 'Q')
3497 { /* query graphics */
3498 tt_printf ("\033G1\n"); /* yes, graphics (color) */
3499 return;
3500 }
3501 for (nargs = 0; nargs < (sizeof (args) / sizeof (args[0])) - 1;)
3502 {
3503 int neg;
3504
3505 ch = cmd_getc ();
3506 neg = (ch == '-');
3507 if (neg || ch == '+')
3508 ch = cmd_getc ();
3509
3510 for (args[nargs] = 0; isdigit (ch); ch = cmd_getc ())
3511 args[nargs] = args[nargs] * 10 + (ch - '0');
3512 if (neg)
3513 args[nargs] = -args[nargs];
3514
3515 nargs++;
3516 args[nargs] = 0;
3517 if (ch != ';')
3518 break;
3519 }
3520
3521 if ((cmd == 'T') && (nargs >= 5))
3522 {
3523 int i, len = args[4];
3524
3525 text = (unsigned char *)rxvt_malloc ((len + 1) * sizeof (char));
3526
3527 if (text != NULL)
3528 {
3529 for (i = 0; i < len; i++)
3530 text[i] = cmd_getc ();
3531 text[len] = '\0';
3532 }
3533 }
3534 Gr_do_graphics (cmd, nargs, args, text);
3535#endif
3536} 3455}
3537/*}}} */ 3456/*}}} */
3538 3457
3539/* ------------------------------------------------------------------------- */ 3458/* ------------------------------------------------------------------------- */
3540 3459

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines