Mercurial > hg > xemacs-beta
comparison src/select-x.c @ 2620:5e906dd5c3e9
[xemacs-hg @ 2005-02-28 20:21:43 by aidan]
(Revised) General X11 selection cleanup. Content negotiation for incoming
data, UTF8_STRING support, the ability to paste images (purely cosmetic at
this point), TIMESTAMP as one of the selection types offered,
author | aidan |
---|---|
date | Mon, 28 Feb 2005 20:21:50 +0000 |
parents | 935833be8506 |
children | 48facb601f29 |
comparison
equal
deleted
inserted
replaced
2619:935833be8506 | 2620:5e906dd5c3e9 |
---|---|
235 CHECK_SYMBOL (selection_name); | 235 CHECK_SYMBOL (selection_name); |
236 selection_atom = symbol_to_x_atom (d, selection_name, 0); | 236 selection_atom = symbol_to_x_atom (d, selection_name, 0); |
237 | 237 |
238 XSetSelectionOwner (display, selection_atom, selecting_window, thyme); | 238 XSetSelectionOwner (display, selection_atom, selecting_window, thyme); |
239 | 239 |
240 /* We do NOT use time_to_lisp() here any more, like we used to. | 240 /* [[ We do NOT use time_to_lisp() here any more, like we used to. |
241 That assumed equivalence of time_t and Time, which is not | 241 That assumed equivalence of time_t and Time, which is not |
242 necessarily the case (e.g. under OSF on the Alphas, where | 242 necessarily the case (e.g. under OSF on the Alphas, where |
243 Time is a 64-bit quantity and time_t is a 32-bit quantity). | 243 Time is a 64-bit quantity and time_t is a 32-bit quantity).]] |
244 | 244 |
245 Opaque pointers are the clean way to go here. | 245 This is wrong--on Digital Unix, time_t is a sixty-four-bit quantity, |
246 */ | 246 and Time is, as the X protocol dictates, a thirty-two-bit quantity. |
247 | |
248 [[ Opaque pointers are the clean way to go here. ]] | |
249 | |
250 Again, I disagree--the Lisp selection infrastructure needs to be | |
251 able to manipulate the selection timestamps if it is, as we want | |
252 it to, to be able to do most of the work. Though I have moved the | |
253 conversion to lisp to get-xemacs-selection-timestamp. -- Aidan. */ | |
254 | |
247 selection_time = make_opaque (&thyme, sizeof (thyme)); | 255 selection_time = make_opaque (&thyme, sizeof (thyme)); |
248 | 256 |
249 #ifdef MOTIF_CLIPBOARDS | 257 #ifdef MOTIF_CLIPBOARDS |
250 hack_motif_clipboard_selection (selection_atom, selection_value, | 258 hack_motif_clipboard_selection (selection_atom, selection_value, |
251 thyme, display, selecting_window, owned_p); | 259 thyme, display, selecting_window, owned_p); |
615 #if 0 /* #### MULTIPLE doesn't work yet */ | 623 #if 0 /* #### MULTIPLE doesn't work yet */ |
616 if (EQ (target_symbol, QMULTIPLE)) | 624 if (EQ (target_symbol, QMULTIPLE)) |
617 target_symbol = fetch_multiple_target (event); | 625 target_symbol = fetch_multiple_target (event); |
618 #endif | 626 #endif |
619 | 627 |
620 temp_obj = Fget_selection_timestamp (selection_symbol); | 628 temp_obj = get_selection_raw_time (selection_symbol); |
621 | 629 |
622 if (NILP (temp_obj)) | 630 if (NILP (temp_obj)) |
623 { | 631 { |
624 /* We don't appear to have the selection. */ | 632 /* We don't appear to have the selection. */ |
625 x_decline_selection_request (event); | 633 x_decline_selection_request (event); |
663 | 671 |
664 x_reply_selection_request (event, format, data, size, type); | 672 x_reply_selection_request (event, format, data, size, type); |
665 successful_p = Qt; | 673 successful_p = Qt; |
666 /* Tell x_selection_request_lisp_error() it's cool. */ | 674 /* Tell x_selection_request_lisp_error() it's cool. */ |
667 event->type = 0; | 675 event->type = 0; |
668 xfree (data, Rawbyte *); | 676 /* Data need not have been allocated; cf. select-convert-to-delete in |
677 lisp/select.el . */ | |
678 if ((Rawbyte *)0 != data) | |
679 { | |
680 xfree (data, Rawbyte *); | |
681 } | |
669 } | 682 } |
670 | 683 |
671 unbind_to (count); | 684 unbind_to (count); |
672 | 685 |
673 DONE_LABEL: | 686 DONE_LABEL: |
703 Lisp_Object selection_symbol, local_selection_time_lisp; | 716 Lisp_Object selection_symbol, local_selection_time_lisp; |
704 Time local_selection_time; | 717 Time local_selection_time; |
705 | 718 |
706 selection_symbol = x_atom_to_symbol (d, selection); | 719 selection_symbol = x_atom_to_symbol (d, selection); |
707 | 720 |
708 local_selection_time_lisp = Fget_selection_timestamp (selection_symbol); | 721 local_selection_time_lisp = get_selection_raw_time (selection_symbol); |
709 | 722 |
710 /* We don't own the selection, so that's fine. */ | 723 /* We don't own the selection, so that's fine. */ |
711 if (NILP (local_selection_time_lisp)) | 724 if (NILP (local_selection_time_lisp)) |
712 return; | 725 return; |
713 | 726 |