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.247 by root, Sat Jan 7 20:23:52 2006 UTC vs.
Revision 1.253 by root, Mon Jan 9 23:30:01 2006 UTC

867#endif 867#endif
868 /* nil */ ; 868 /* nil */ ;
869 } 869 }
870 } 870 }
871 871
872 if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_STR_LEN, kbuf, len, DT_END))) 872 if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_INT, keysym, DT_STR_LEN, kbuf, len, DT_END)))
873 return; 873 return;
874 874
875 if (len <= 0) 875 if (len <= 0)
876 return; /* not mapped */ 876 return; /* not mapped */
877 877
973 if (want_refresh) 973 if (want_refresh)
974 { 974 {
975 if (SHOULD_INVOKE (HOOK_LINE_UPDATE)) 975 if (SHOULD_INVOKE (HOOK_LINE_UPDATE))
976 { 976 {
977 int row = -view_start; 977 int row = -view_start;
978 int end_row = row + nrow;
978 979
979 while (row > -nsaved && ROW (row - 1).is_longer ()) 980 while (row > -nsaved && ROW (row - 1).is_longer ())
980 --row; 981 --row;
981 982
982 while (row < -view_start + nrow) 983 do
983 { 984 {
984 int start_row = row; 985 int start_row = row;
985 line_t *l; 986 line_t *l;
986 987
987 do 988 do
988 { 989 {
989 l = &ROW (row); 990 l = &ROW (row++);
990 991
991 if (!(l->f & LINE_FILTERED)) 992 if (l->f & LINE_FILTERED)
993 row++;
994 else
992 { 995 {
993 // line not filtered, mark it as filtered 996 // line not filtered, mark it as filtered
994 l->f |= LINE_FILTERED; 997 l->f |= LINE_FILTERED;
995 while (l->is_longer ()) 998 while (l->is_longer ())
996 { 999 {
1002 HOOK_INVOKE ((this, HOOK_LINE_UPDATE, DT_INT, start_row, DT_END)); 1005 HOOK_INVOKE ((this, HOOK_LINE_UPDATE, DT_INT, start_row, DT_END));
1003 1006
1004 break; 1007 break;
1005 } 1008 }
1006 } 1009 }
1007 while (l->is_longer ()); 1010 while (l->is_longer () && row < end_row);
1008
1009 row++;
1010 } 1011 }
1011 1012 while (++row < end_row);
1012 } 1013 }
1013 1014
1014 scr_refresh (refresh_type); 1015 scr_refresh (refresh_type);
1015 scrollbar_show (1); 1016 scrollbar_show (1);
1016#ifdef USE_XIM 1017#ifdef USE_XIM
1312 dDisp; 1313 dDisp;
1313 1314
1314 SET_R (this); 1315 SET_R (this);
1315 SET_LOCALE (locale); 1316 SET_LOCALE (locale);
1316 1317
1317#if defined(CURSOR_BLINK)
1318 if (OPTION (Opt_cursorBlink) && ev.type == KeyPress)
1319 {
1320 if (hidden_cursor)
1321 {
1322 hidden_cursor = 0;
1323 want_refresh = 1;
1324 }
1325
1326 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1327 }
1328#endif
1329
1330#if defined(POINTER_BLANK)
1331 if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0)
1332 {
1333 if (ev.type == MotionNotify
1334 || ev.type == ButtonPress
1335 || ev.type == ButtonRelease)
1336 if (hidden_pointer)
1337 pointer_unblank ();
1338
1339 if (ev.type == KeyPress && hidden_pointer == 0)
1340 pointer_blank ();
1341 }
1342#endif
1343
1344 Window unused_root, unused_child; 1318 Window unused_root, unused_child;
1345 int unused_root_x, unused_root_y; 1319 int unused_root_x, unused_root_y;
1346 unsigned int unused_mask; 1320 unsigned int unused_mask;
1347 1321
1348 switch (ev.type) 1322 switch (ev.type)
1355 1329
1356 break; 1330 break;
1357 1331
1358 case KeyRelease: 1332 case KeyRelease:
1359 { 1333 {
1360#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 1334#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 || ENABLE_PERL
1361 KeySym ks; 1335 KeySym keysym;
1362 1336
1363 ks = XLookupKeysym (&ev.xkey, ev.xkey.state & ShiftMask ? 1 : 0); // sorry, only shift supported :/ 1337 keysym = XLookupKeysym (&ev.xkey, ev.xkey.state & ShiftMask ? 1 : 0); // sorry, only shift supported :/
1364#endif 1338#endif
1365 1339
1366#if ENABLE_FRILLS || ISO_14755 1340#if ENABLE_FRILLS || ISO_14755
1367 // ISO 14755 support 1341 // ISO 14755 support
1368 if (iso14755buf) 1342 if (iso14755buf)
1373# endif 1347# endif
1374# if ISO_14755 1348# if ISO_14755
1375 // iso14755 part 5.2 handling: release time 1349 // iso14755 part 5.2 handling: release time
1376 // first: controls 1350 // first: controls
1377 if ((ev.xkey.state & ControlMask) 1351 if ((ev.xkey.state & ControlMask)
1378 && ((ks >= 0x40 && ks <= 0x5f) 1352 && ((keysym >= 0x40 && keysym <= 0x5f)
1379 || (ks >= 0x61 && ks <= 0x7f))) 1353 || (keysym >= 0x61 && keysym <= 0x7f)))
1380 { 1354 {
1381 iso14755buf = ISO_14755_51 | 0x2400 | (ks & 0x1f); 1355 iso14755buf = ISO_14755_51 | 0x2400 | (keysym & 0x1f);
1382 commit_iso14755 (); 1356 commit_iso14755 ();
1383 return; // case-break; 1357 goto skip_switch;
1384 } 1358 }
1385 1359
1386 for (unsigned short *i = iso14755_symtab; i[0]; i+= 2) 1360 for (unsigned short *i = iso14755_symtab; i[0]; i+= 2)
1387 if (i[0] == ks) 1361 if (i[0] == keysym)
1388 { 1362 {
1389 iso14755buf = ISO_14755_51 | i[1]; 1363 iso14755buf = ISO_14755_51 | i[1];
1390 commit_iso14755 (); 1364 commit_iso14755 ();
1391 return; // case-break; 1365 goto skip_switch;
1392 } 1366 }
1393 1367
1394 scr_bell (); 1368 scr_bell ();
1395# endif 1369# endif
1396 iso14755buf = 0; 1370 iso14755buf = 0;
1416 iso14755buf = 0; 1390 iso14755buf = 0;
1417 } 1391 }
1418#endif 1392#endif
1419 1393
1420 if (ev.xany.window == vt 1394 if (ev.xany.window == vt
1421 && HOOK_INVOKE ((this, HOOK_KEY_RELEASE, DT_XEVENT, &ev, DT_END))) 1395 && HOOK_INVOKE ((this, HOOK_KEY_RELEASE, DT_XEVENT, &ev, DT_INT, keysym, DT_END)))
1422 break; 1396 break;
1423 1397
1424#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1398#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1425 if (!(ev.xkey.state & ControlMask)) 1399 if (!(ev.xkey.state & ControlMask))
1426 slip_wheel_ev.stop (); 1400 slip_wheel_ev.stop ();
1427 else if (ks == XK_Control_L || ks == XK_Control_R) 1401 else if (keysym == XK_Control_L || keysym == XK_Control_R)
1428 mouse_slip_wheel_speed = 0; 1402 mouse_slip_wheel_speed = 0;
1429#endif 1403#endif
1430 break; 1404 break;
1431 } 1405 }
1432 1406
1742 refresh_limit = 0; 1716 refresh_limit = 0;
1743 scrollbar_show (1); 1717 scrollbar_show (1);
1744 } 1718 }
1745 break; 1719 break;
1746 } 1720 }
1721
1722skip_switch: ;
1723
1724#if defined(CURSOR_BLINK)
1725 if (OPTION (Opt_cursorBlink) && ev.type == KeyPress)
1726 {
1727 if (hidden_cursor)
1728 {
1729 hidden_cursor = 0;
1730 want_refresh = 1;
1731 }
1732
1733 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1734 }
1735#endif
1736
1737#if defined(POINTER_BLANK)
1738 if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0)
1739 {
1740 if (ev.type == MotionNotify
1741 || ev.type == ButtonPress
1742 || ev.type == ButtonRelease)
1743 if (hidden_pointer)
1744 pointer_unblank ();
1745
1746 if (ev.type == KeyPress && hidden_pointer == 0)
1747 pointer_blank ();
1748 }
1749#endif
1747} 1750}
1748 1751
1749void 1752void
1750rxvt_term::focus_in () 1753rxvt_term::focus_in ()
1751{ 1754{
4153 /* extra handling for values with state unkept */ 4156 /* extra handling for values with state unkept */
4154 switch (arg[i]) 4157 switch (arg[i])
4155 { 4158 {
4156#if ENABLE_STYLES 4159#if ENABLE_STYLES
4157 case 1021: 4160 case 1021:
4158 if (mode) 4161 set_option (Opt_intensityStyles, mode);
4159 SET_OPTION (Opt_intensityStyles);
4160 else
4161 CLR_OPTION (Opt_intensityStyles);
4162 4162
4163 scr_touch (true); 4163 scr_touch (true);
4164 break; 4164 break;
4165#endif 4165#endif
4166 case 1048: /* alternative cursor save */ 4166 case 1048: /* alternative cursor save */
4188 case 3: /* 80/132 */ 4188 case 3: /* 80/132 */
4189 if (priv_modes & PrivMode_132OK) 4189 if (priv_modes & PrivMode_132OK)
4190 set_widthheight (((state ? 132 : 80) * fwidth), height); 4190 set_widthheight (((state ? 132 : 80) * fwidth), height);
4191 break; 4191 break;
4192 case 4: /* smooth scrolling */ 4192 case 4: /* smooth scrolling */
4193 if (!state) 4193 set_option (Opt_jumpScroll, !state);
4194 SET_OPTION (Opt_jumpScroll);
4195 else
4196 CLR_OPTION (Opt_jumpScroll);
4197 break; 4194 break;
4198 case 5: /* reverse video */ 4195 case 5: /* reverse video */
4199 scr_rvideo_mode (state); 4196 scr_rvideo_mode (state);
4200 break; 4197 break;
4201 case 6: /* relative/absolute origins */ 4198 case 6: /* relative/absolute origins */
4242#if 0 4239#if 0
4243 case 1001: 4240 case 1001:
4244 break; /* X11 mouse highlighting */ 4241 break; /* X11 mouse highlighting */
4245#endif 4242#endif
4246 case 1010: /* scroll to bottom on TTY output inhibit */ 4243 case 1010: /* scroll to bottom on TTY output inhibit */
4247 if (!state) 4244 set_option (Opt_scrollTtyOutput, !state);
4248 SET_OPTION (Opt_scrollTtyOutput);
4249 else
4250 CLR_OPTION (Opt_scrollTtyOutput);
4251 break; 4245 break;
4252 case 1011: /* scroll to bottom on key press */ 4246 case 1011: /* scroll to bottom on key press */
4253 if (state) 4247 set_option (Opt_scrollTtyKeypress, state);
4254 SET_OPTION (Opt_scrollTtyKeypress);
4255 else
4256 CLR_OPTION (Opt_scrollTtyKeypress);
4257 break; 4248 break;
4258 case 1047: /* secondary screen w/ clearing last */ 4249 case 1047: /* secondary screen w/ clearing last */
4259 if (OPTION (Opt_secondaryScreen)) 4250 if (OPTION (Opt_secondaryScreen))
4260 if (current_screen != PRIMARY) 4251 if (current_screen != PRIMARY)
4261 scr_erase_screen (2); 4252 scr_erase_screen (2);
4471const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT 4462const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT
4472 4463
4473void 4464void
4474rxvt_term::tt_write (const char *data, unsigned int len) 4465rxvt_term::tt_write (const char *data, unsigned int len)
4475{ 4466{
4467 if (HOOK_INVOKE ((this, HOOK_TT_WRITE, DT_STR_LEN, data, len, DT_END)))
4468 return;
4469
4476 if (pty.pty < 0) 4470 if (pty.pty < 0)
4477 return; 4471 return;
4478 4472
4479 if (v_buflen == 0) 4473 if (v_buflen == 0)
4480 { 4474 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines