Mercurial > emacs
comparison src/xterm.c @ 6984:8e9465c13702
(XTread_socket): Delete the non-NEW_SELECTIONS code
and simplify the toolkit conditional for those cases.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 20 Apr 1994 09:01:18 +0000 |
parents | b18e5c09d7c3 |
children | 4ef78a2b2cee |
comparison
equal
deleted
inserted
replaced
6983:b18e5c09d7c3 | 6984:8e9465c13702 |
---|---|
16 You should have received a copy of the GNU General Public License | 16 You should have received a copy of the GNU General Public License |
17 along with GNU Emacs; see the file COPYING. If not, write to | 17 along with GNU Emacs; see the file COPYING. If not, write to |
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | 18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ |
19 | 19 |
20 /* Xt features made by Fred Pierresteguy. */ | 20 /* Xt features made by Fred Pierresteguy. */ |
21 | |
22 #define NEW_SELECTIONS | |
23 | 21 |
24 /* On 4.3 these lose if they come after xterm.h. */ | 22 /* On 4.3 these lose if they come after xterm.h. */ |
25 /* On HP-UX 8.0 signal.h loses if it comes after config.h. */ | 23 /* On HP-UX 8.0 signal.h loses if it comes after config.h. */ |
26 /* Putting these at the beginning seems to be standard for other .c files. */ | 24 /* Putting these at the beginning seems to be standard for other .c files. */ |
27 #include <stdio.h> | 25 #include <stdio.h> |
3467 } | 3465 } |
3468 #endif /* USE_X_TOOLKIT and HAVE_X11R5 */ | 3466 #endif /* USE_X_TOOLKIT and HAVE_X11R5 */ |
3469 } | 3467 } |
3470 break; | 3468 break; |
3471 | 3469 |
3472 #ifdef NEW_SELECTIONS | |
3473 case SelectionNotify: | 3470 case SelectionNotify: |
3474 #ifdef USE_X_TOOLKIT | 3471 #ifdef USE_X_TOOLKIT |
3475 if (x_window_to_frame (event.xselection.requestor)) | 3472 if (! x_window_to_frame (event.xselection.requestor)) |
3476 x_handle_selection_notify (&event); | |
3477 else | |
3478 goto OTHER; | 3473 goto OTHER; |
3479 #else /* not USE_X_TOOLKIT */ | 3474 #endif /* not USE_X_TOOLKIT */ |
3480 x_handle_selection_notify (&event); | 3475 x_handle_selection_notify (&event); |
3481 #endif /* not USE_X_TOOLKIT */ | |
3482 break; | 3476 break; |
3483 #endif /* NEW_SELECTIONS */ | |
3484 | 3477 |
3485 case SelectionClear: /* Someone has grabbed ownership. */ | 3478 case SelectionClear: /* Someone has grabbed ownership. */ |
3486 #ifdef NEW_SELECTIONS | 3479 #ifdef USE_X_TOOLKIT |
3480 if (! x_window_to_frame (event.xselectionclear.window)) | |
3481 goto OTHER; | |
3482 #endif /* USE_X_TOOLKIT */ | |
3487 { | 3483 { |
3488 #ifdef USE_X_TOOLKIT | |
3489 if (x_window_to_frame (event.xselectionclear.window)) | |
3490 { | |
3491 #endif /* USE_X_TOOLKIT */ | |
3492 XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event; | 3484 XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event; |
3493 | 3485 |
3494 if (numchars == 0) | 3486 if (numchars == 0) |
3495 abort (); | 3487 abort (); |
3496 | 3488 |
3500 SELECTION_EVENT_TIME (bufp) = eventp->time; | 3492 SELECTION_EVENT_TIME (bufp) = eventp->time; |
3501 bufp++; | 3493 bufp++; |
3502 | 3494 |
3503 count += 1; | 3495 count += 1; |
3504 numchars -= 1; | 3496 numchars -= 1; |
3497 } | |
3498 break; | |
3499 | |
3500 case SelectionRequest: /* Someone wants our selection. */ | |
3505 #ifdef USE_X_TOOLKIT | 3501 #ifdef USE_X_TOOLKIT |
3506 } | 3502 if (!x_window_to_frame (event.xselectionrequest.owner)) |
3507 else | |
3508 goto OTHER; | 3503 goto OTHER; |
3509 #endif /* USE_X_TOOLKIT */ | 3504 #endif /* USE_X_TOOLKIT */ |
3510 } | |
3511 #else /* not NEW_SELECTIONS */ | |
3512 x_disown_selection (event.xselectionclear.window, | |
3513 event.xselectionclear.selection, | |
3514 event.xselectionclear.time); | |
3515 #endif /* not NEW_SELECTIONS */ | |
3516 break; | |
3517 | |
3518 case SelectionRequest: /* Someone wants our selection. */ | |
3519 #ifdef NEW_SELECTIONS | |
3520 { | 3505 { |
3521 #ifdef USE_X_TOOLKIT | |
3522 if (x_window_to_frame (event.xselectionrequest.owner)) | |
3523 { | |
3524 #endif /* USE_X_TOOLKIT */ | |
3525 XSelectionRequestEvent *eventp = (XSelectionRequestEvent *) &event; | 3506 XSelectionRequestEvent *eventp = (XSelectionRequestEvent *) &event; |
3526 | 3507 |
3527 if (numchars == 0) | 3508 if (numchars == 0) |
3528 abort (); | 3509 abort (); |
3529 | 3510 |
3536 SELECTION_EVENT_TIME (bufp) = eventp->time; | 3517 SELECTION_EVENT_TIME (bufp) = eventp->time; |
3537 bufp++; | 3518 bufp++; |
3538 | 3519 |
3539 count += 1; | 3520 count += 1; |
3540 numchars -= 1; | 3521 numchars -= 1; |
3522 } | |
3523 break; | |
3524 | |
3525 case PropertyNotify: | |
3541 #ifdef USE_X_TOOLKIT | 3526 #ifdef USE_X_TOOLKIT |
3542 } | 3527 if (!x_any_window_to_frame (event.xproperty.window)) |
3543 else | |
3544 goto OTHER; | 3528 goto OTHER; |
3545 #endif /* USE_X_TOOLKIT */ | 3529 #endif /* not USE_X_TOOLKIT */ |
3546 } | |
3547 #else /* not NEW_SELECTIONS */ | |
3548 x_answer_selection_request (event); | |
3549 #endif /* not NEW_SELECTIONS */ | |
3550 break; | |
3551 | |
3552 case PropertyNotify: | |
3553 #ifdef NEW_SELECTIONS | |
3554 #ifdef USE_X_TOOLKIT | |
3555 if (x_any_window_to_frame (event.xproperty.window)) | |
3556 x_handle_property_notify (&event); | |
3557 else | |
3558 goto OTHER; | |
3559 #else /* not USE_X_TOOLKIT */ | |
3560 x_handle_property_notify (&event); | 3530 x_handle_property_notify (&event); |
3561 #endif /* not USE_X_TOOLKIT */ | |
3562 #else /* not NEW_SELECTIONS */ | |
3563 /* If we're being told about a root window property, then it's | |
3564 a cut buffer change. */ | |
3565 if (event.xproperty.window == ROOT_WINDOW) | |
3566 x_invalidate_cut_buffer_cache (&event.xproperty); | |
3567 | |
3568 /* Otherwise, we're probably handling an incremental | |
3569 selection transmission. */ | |
3570 else | |
3571 { | |
3572 /* If we were to do this synchronously, there'd be no worry | |
3573 about re-selecting. */ | |
3574 x_send_incremental (event); | |
3575 } | |
3576 #endif /* not NEW_SELECTIONS */ | |
3577 break; | 3531 break; |
3578 | 3532 |
3579 case ReparentNotify: | 3533 case ReparentNotify: |
3580 f = x_window_to_frame (event.xreparent.window); | 3534 f = x_window_to_frame (event.xreparent.window); |
3581 if (f) | 3535 if (f) |
3591 f->async_visible = 1; | 3545 f->async_visible = 1; |
3592 f->async_iconified = 0; | 3546 f->async_iconified = 0; |
3593 SET_FRAME_GARBAGED (f); | 3547 SET_FRAME_GARBAGED (f); |
3594 } | 3548 } |
3595 else | 3549 else |
3596 { | 3550 dumprectangle (x_window_to_frame (event.xexpose.window), |
3597 dumprectangle (x_window_to_frame (event.xexpose.window), | 3551 event.xexpose.x, event.xexpose.y, |
3598 event.xexpose.x, event.xexpose.y, | 3552 event.xexpose.width, event.xexpose.height); |
3599 event.xexpose.width, event.xexpose.height); | |
3600 } | |
3601 } | 3553 } |
3602 else | 3554 else |
3603 { | 3555 { |
3604 struct scroll_bar *bar | 3556 struct scroll_bar *bar |
3605 = x_window_to_scroll_bar (event.xexpose.window); | 3557 = x_window_to_scroll_bar (event.xexpose.window); |
3703 goto OTHER; | 3655 goto OTHER; |
3704 #endif /* USE_X_TOOLKIT */ | 3656 #endif /* USE_X_TOOLKIT */ |
3705 break; | 3657 break; |
3706 | 3658 |
3707 case MapNotify: | 3659 case MapNotify: |
3660 /* We use x_top_window_to_frame because map events can come | |
3661 for subwindows and they don't mean that the frame is visible. */ | |
3708 f = x_top_window_to_frame (event.xmap.window); | 3662 f = x_top_window_to_frame (event.xmap.window); |
3709 if (f) | 3663 if (f) |
3710 { | 3664 { |
3711 f->async_visible = 1; | 3665 f->async_visible = 1; |
3712 f->async_iconified = 0; | 3666 f->async_iconified = 0; |
3716 SET_FRAME_GARBAGED (f); | 3670 SET_FRAME_GARBAGED (f); |
3717 } | 3671 } |
3718 #ifdef USE_X_TOOLKIT | 3672 #ifdef USE_X_TOOLKIT |
3719 goto OTHER; | 3673 goto OTHER; |
3720 #endif /* USE_X_TOOLKIT */ | 3674 #endif /* USE_X_TOOLKIT */ |
3721 break; | 3675 break; |
3722 | 3676 |
3723 /* Turn off processing if we become fully obscured. */ | 3677 /* Turn off processing if we become fully obscured. */ |
3724 case VisibilityNotify: | 3678 case VisibilityNotify: |
3725 break; | 3679 break; |
3726 | 3680 |