Mercurial > emacs
comparison src/xselect.c @ 83541:694bbb62a75d
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-371
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-372
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-373
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-374
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-375
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-376
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-377
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-378
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-379
Merge from erc--emacs--21
* emacs@sv.gnu.org/emacs--devo--0--patch-380
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-381
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-382
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-383
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-384
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-385
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-386
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-387
Fix ERC bug introduced in last patch
* emacs@sv.gnu.org/emacs--devo--0--patch-388
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-389
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-390
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-391
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-392
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-393
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-394
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-395
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-396
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-397
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-398
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-399
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-400
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-401
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-402
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-403
Rcirc update from Ryan Yeske
* emacs@sv.gnu.org/emacs--devo--0--patch-404
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-405
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-406
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-407
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-408
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-409
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-410
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-411
Miscellaneous tq-related fixes.
* emacs@sv.gnu.org/emacs--devo--0--patch-412
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-121
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-122
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-123
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-124
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-125
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-126
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-127
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-581
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 14 Oct 2006 16:56:21 +0000 |
parents | 02e39decdc84 237fcefd8610 |
children | 034f67f59091 |
comparison
equal
deleted
inserted
replaced
83540:0c89a85addc3 | 83541:694bbb62a75d |
---|---|
2707 UNBLOCK_INPUT; | 2707 UNBLOCK_INPUT; |
2708 | 2708 |
2709 return ret; | 2709 return ret; |
2710 } | 2710 } |
2711 | 2711 |
2712 /* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. | 2712 DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom, |
2713 TODO: Check if this client event really is a DND event? */ | 2713 Sx_register_dnd_atom, 1, 2, 0, |
2714 doc: /* Request that dnd events are made for ClientMessages with ATOM. | |
2715 ATOM can be a symbol or a string. The ATOM is interned on the display that | |
2716 FRAME is on. If FRAME is nil, the selected frame is used. */) | |
2717 (atom, frame) | |
2718 Lisp_Object atom, frame; | |
2719 { | |
2720 Atom x_atom; | |
2721 struct frame *f = check_x_frame (frame); | |
2722 size_t i; | |
2723 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | |
2724 | |
2725 | |
2726 if (SYMBOLP (atom)) | |
2727 x_atom = symbol_to_x_atom (dpyinfo, FRAME_X_DISPLAY (f), atom); | |
2728 else if (STRINGP (atom)) | |
2729 { | |
2730 BLOCK_INPUT; | |
2731 x_atom = XInternAtom (FRAME_X_DISPLAY (f), (char *) SDATA (atom), False); | |
2732 UNBLOCK_INPUT; | |
2733 } | |
2734 else | |
2735 error ("ATOM must be a symbol or a string"); | |
2736 | |
2737 for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) | |
2738 if (dpyinfo->x_dnd_atoms[i] == x_atom) | |
2739 return Qnil; | |
2740 | |
2741 if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size) | |
2742 { | |
2743 dpyinfo->x_dnd_atoms_size *= 2; | |
2744 dpyinfo->x_dnd_atoms = xrealloc (dpyinfo->x_dnd_atoms, | |
2745 sizeof (*dpyinfo->x_dnd_atoms) | |
2746 * dpyinfo->x_dnd_atoms_size); | |
2747 } | |
2748 | |
2749 dpyinfo->x_dnd_atoms[dpyinfo->x_dnd_atoms_length++] = x_atom; | |
2750 return Qnil; | |
2751 } | |
2752 | |
2753 /* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */ | |
2714 | 2754 |
2715 int | 2755 int |
2716 x_handle_dnd_message (f, event, dpyinfo, bufp) | 2756 x_handle_dnd_message (f, event, dpyinfo, bufp) |
2717 struct frame *f; | 2757 struct frame *f; |
2718 XClientMessageEvent *event; | 2758 XClientMessageEvent *event; |
2724 /* format 32 => size 5, format 16 => size 10, format 8 => size 20 */ | 2764 /* format 32 => size 5, format 16 => size 10, format 8 => size 20 */ |
2725 unsigned long size = 160/event->format; | 2765 unsigned long size = 160/event->format; |
2726 int x, y; | 2766 int x, y; |
2727 unsigned char *data = (unsigned char *) event->data.b; | 2767 unsigned char *data = (unsigned char *) event->data.b; |
2728 int idata[5]; | 2768 int idata[5]; |
2769 size_t i; | |
2770 | |
2771 for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) | |
2772 if (dpyinfo->x_dnd_atoms[i] == event->message_type) break; | |
2773 | |
2774 if (i == dpyinfo->x_dnd_atoms_length) return 0; | |
2729 | 2775 |
2730 XSETFRAME (frame, f); | 2776 XSETFRAME (frame, f); |
2731 | 2777 |
2732 /* On a 64 bit machine, the event->data.l array members are 64 bits (long), | 2778 /* On a 64 bit machine, the event->data.l array members are 64 bits (long), |
2733 but the x_property_data_to_lisp (or rather selection_data_to_lisp_data) | 2779 but the x_property_data_to_lisp (or rather selection_data_to_lisp_data) |
2897 defsubr (&Sx_rotate_cut_buffers_internal); | 2943 defsubr (&Sx_rotate_cut_buffers_internal); |
2898 #endif | 2944 #endif |
2899 | 2945 |
2900 defsubr (&Sx_get_atom_name); | 2946 defsubr (&Sx_get_atom_name); |
2901 defsubr (&Sx_send_client_message); | 2947 defsubr (&Sx_send_client_message); |
2948 defsubr (&Sx_register_dnd_atom); | |
2902 | 2949 |
2903 reading_selection_reply = Fcons (Qnil, Qnil); | 2950 reading_selection_reply = Fcons (Qnil, Qnil); |
2904 staticpro (&reading_selection_reply); | 2951 staticpro (&reading_selection_reply); |
2905 reading_selection_window = 0; | 2952 reading_selection_window = 0; |
2906 reading_which_selection = 0; | 2953 reading_which_selection = 0; |