1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: command.c |
2 | * File: command.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: command.C,v 1.8 2003/11/26 10:42:34 pcg Exp $ |
4 | * $Id: command.C,v 1.9 2003/11/27 10:12:10 pcg Exp $ |
5 | * |
5 | * |
6 | * All portions of code are copyright by their respective author/s. |
6 | * All portions of code are copyright by their respective author/s. |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
8 | * - original version |
8 | * - original version |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
… | |
… | |
704 | } |
704 | } |
705 | |
705 | |
706 | void |
706 | void |
707 | rxvt_term::blink_cb (time_watcher &w) |
707 | rxvt_term::blink_cb (time_watcher &w) |
708 | { |
708 | { |
|
|
709 | SET_R (this); |
|
|
710 | |
709 | w.at += BLINK_INTERVAL; |
711 | w.at += BLINK_INTERVAL; |
710 | hidden_cursor = !hidden_cursor; |
712 | hidden_cursor = !hidden_cursor; |
711 | want_refresh = 1; |
713 | want_refresh = 1; |
712 | flush (); |
714 | flush (); |
713 | } |
715 | } |
714 | |
716 | |
715 | void |
717 | void |
716 | rxvt_term::x_cb (io_watcher &w, short revents) |
718 | rxvt_term::x_cb (io_watcher &w, short revents) |
717 | { |
719 | { |
|
|
720 | SET_R (this); |
|
|
721 | |
718 | process_x_events (); |
722 | process_x_events (); |
719 | |
723 | |
720 | flush (); |
724 | flush (); |
721 | } |
725 | } |
722 | |
726 | |
… | |
… | |
792 | return true; |
796 | return true; |
793 | } |
797 | } |
794 | else if (n < 0 && errno == EAGAIN) |
798 | else if (n < 0 && errno == EAGAIN) |
795 | return false; |
799 | return false; |
796 | |
800 | |
797 | rxvt_clean_exit (); |
801 | destroy (); |
798 | exit (EXIT_FAILURE); /* bad order of events? */ |
|
|
799 | } |
802 | } |
800 | |
803 | |
801 | void |
804 | void |
802 | rxvt_term::pty_cb (io_watcher &w, short revents) |
805 | rxvt_term::pty_cb (io_watcher &w, short revents) |
803 | { |
806 | { |
|
|
807 | SET_R (this); |
|
|
808 | |
804 | // loop, but don't allow a single term to monopolize us |
809 | // loop, but don't allow a single term to monopolize us |
805 | // the number of loops is fully arbitrary, and thus wrong |
810 | // the number of loops is fully arbitrary, and thus wrong |
806 | for (int i = 7; i-- && pty_fill (); ) |
811 | for (int i = 7; i-- && pty_fill (); ) |
807 | { |
812 | { |
808 | //TODO: |
813 | //TODO: |
… | |
… | |
1043 | } |
1048 | } |
1044 | |
1049 | |
1045 | void |
1050 | void |
1046 | rxvt_term::pointer_cb (time_watcher &w) |
1051 | rxvt_term::pointer_cb (time_watcher &w) |
1047 | { |
1052 | { |
|
|
1053 | SET_R (this); |
|
|
1054 | |
1048 | pointer_blank (); |
1055 | pointer_blank (); |
1049 | } |
1056 | } |
1050 | #endif |
1057 | #endif |
1051 | |
1058 | |
1052 | /* INTPROTO */ |
1059 | /* INTPROTO */ |
… | |
… | |
1249 | break; |
1256 | break; |
1250 | |
1257 | |
1251 | case ClientMessage: |
1258 | case ClientMessage: |
1252 | if (ev->xclient.format == 32 |
1259 | if (ev->xclient.format == 32 |
1253 | && (Atom)ev->xclient.data.l[0] == R->xa[XA_WMDELETEWINDOW]) |
1260 | && (Atom)ev->xclient.data.l[0] == R->xa[XA_WMDELETEWINDOW]) |
1254 | exit(EXIT_SUCCESS); |
1261 | R->destroy (); |
1255 | #ifdef OFFIX_DND |
1262 | #ifdef OFFIX_DND |
1256 | /* OffiX Dnd (drag 'n' drop) protocol */ |
1263 | /* OffiX Dnd (drag 'n' drop) protocol */ |
1257 | if (ev->xclient.message_type == R->xa[XA_DNDPROTOCOL] |
1264 | else if (ev->xclient.message_type == R->xa[XA_DNDPROTOCOL] |
1258 | && (ev->xclient.data.l[0] == DndFile |
1265 | && (ev->xclient.data.l[0] == DndFile |
1259 | || ev->xclient.data.l[0] == DndDir |
1266 | || ev->xclient.data.l[0] == DndDir |
1260 | || ev->xclient.data.l[0] == DndLink)) { |
1267 | || ev->xclient.data.l[0] == DndLink)) { |
1261 | /* Get Dnd data */ |
1268 | /* Get Dnd data */ |
1262 | Atom ActualType; |
1269 | Atom ActualType; |