annotate src/select-msw.c @ 416:ebe98a74bd68 r21-2-16

Import from CVS: tag r21-2-16
author cvs
date Mon, 13 Aug 2007 11:22:23 +0200
parents da8ed4261e83
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
1 /* mswindows selection processing for XEmacs
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
2 Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
3
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
4 This file is part of XEmacs.
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
5
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
9 later version.
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
10
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
14 for more details.
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
15
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
20
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
21 /* Synched up with: Not synched with FSF. */
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
22
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
23 /* Authorship:
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
24
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
25 Written by Kevin Gallo for FSF Emacs.
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 249
diff changeset
26 Rewritten for mswindows by Jonathan Harris, December 1997 for 21.0.
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
27 */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
28
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
29
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
30 #include <config.h>
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
31 #include "lisp.h"
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
32 #include "select.h"
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
33
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
34 #include "console-msw.h"
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
35
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
36 DEFUN ("mswindows-set-clipboard", Fmswindows_set_clipboard, 1, 1, 0, /*
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
37 Copy STRING to the mswindows clipboard.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
38 */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
39 (string))
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
40 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
41 int rawsize, size, i;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
42 unsigned char *src, *dst, *next;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
43 HGLOBAL h = NULL;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
44
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
45 CHECK_STRING (string);
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
46
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
47 /* Calculate size with LFs converted to CRLFs because
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
48 * CF_TEXT format uses CRLF delimited ASCIIZ */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
49 src = XSTRING_DATA (string);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
50 size = rawsize = XSTRING_LENGTH (string) + 1;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
51 for (i=0; i<rawsize; i++)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
52 if (src[i] == '\n')
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
53 size++;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
54
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
55 if (!OpenClipboard (NULL))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
56 return Qnil;
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
57
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
58 if (!EmptyClipboard () ||
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
59 (h = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, size)) == NULL ||
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
60 (dst = (unsigned char *) GlobalLock (h)) == NULL)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
61 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
62 if (h != NULL) GlobalFree (h);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
63 CloseClipboard ();
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
64 return Qnil;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
65 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
66
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
67 /* Convert LFs to CRLFs */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
68 do
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
69 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
70 /* copy next line or remaining bytes including '\0' */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
71 next = memccpy (dst, src, '\n', rawsize);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
72 if (next)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
73 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
74 /* copied one line ending with '\n' */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
75 int copied = next - dst;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
76 rawsize -= copied;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
77 src += copied;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
78 /* insert '\r' before '\n' */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
79 next[-1] = '\r';
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
80 next[0] = '\n';
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
81 dst = next+1;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
82 }
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
83 }
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
84 while (next);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
85
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
86 GlobalUnlock (h);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
87
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
88 i = (SetClipboardData (CF_TEXT, h) != NULL);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
89
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
90 CloseClipboard ();
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
91 GlobalFree (h);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
92
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
93 return i ? Qt : Qnil;
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
94 }
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
95
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
96 /* Do protocol to assert ourself as a selection owner. Under mswindows
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
97 this is easy, we just set the clipboard. */
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
98 static Lisp_Object
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
99 mswindows_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
100 {
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
101 Lisp_Object converted_value = get_local_selection (selection_name, QSTRING);
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
102 if (!NILP (converted_value) &&
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
103 CONSP (converted_value) &&
416
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
104 EQ (XCAR (converted_value), QSTRING) &&
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
105 /* pure mswindows behaviour only says we can own the selection
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
106 if it is the clipboard */
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
107 EQ (selection_name, QCLIPBOARD))
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
108 Fmswindows_set_clipboard (XCDR (converted_value));
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
109
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
110 return Qnil;
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
111 }
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
112
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
113 DEFUN ("mswindows-get-clipboard", Fmswindows_get_clipboard, 0, 0, 0, /*
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
114 Return the contents of the mswindows clipboard.
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
115 */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
116 ())
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 288
diff changeset
117 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
118 HANDLE h;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
119 unsigned char *src, *dst, *next;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
120 Lisp_Object ret = Qnil;
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
121
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
122 if (!OpenClipboard (NULL))
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
123 return Qnil;
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
124
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
125 if ((h = GetClipboardData (CF_TEXT)) != NULL &&
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
126 (src = (unsigned char *) GlobalLock (h)) != NULL)
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
127 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
128 int i;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
129 int size, rawsize;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
130 size = rawsize = strlen (src);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
131
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
132 for (i=0; i<rawsize; i++)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
133 if (src[i] == '\r' && src[i+1] == '\n')
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
134 size--;
404
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents: 400
diff changeset
135
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
136 /* Convert CRLFs to LFs */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
137 ret = make_uninit_string (size);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
138 dst = XSTRING_DATA (ret);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
139 do
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
140 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
141 /* copy next line or remaining bytes excluding '\0' */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
142 next = memccpy (dst, src, '\r', rawsize);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
143 if (next)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
144 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
145 /* copied one line ending with '\r' */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
146 int copied = next - dst;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
147 rawsize -= copied;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
148 src += copied;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
149 if (*src == '\n')
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
150 dst += copied - 1; /* overwrite '\r' */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
151 else
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
152 dst += copied;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
153 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
154 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
155 while (next);
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
156
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
157 GlobalUnlock (h);
404
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents: 400
diff changeset
158 }
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 288
diff changeset
159
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
160 CloseClipboard ();
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 404
diff changeset
161
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
162 return ret;
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 288
diff changeset
163 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 288
diff changeset
164
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
165 static Lisp_Object
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
166 mswindows_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
167 {
416
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
168 if (EQ (selection_symbol, QCLIPBOARD))
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
169 return Fmswindows_get_clipboard ();
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
170 else
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
171 return Qnil;
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
172 }
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
173
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
174 DEFUN ("mswindows-selection-exists-p", Fmswindows_selection_exists_p, 0, 0, 0, /*
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
175 Whether there is an MS-Windows selection.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
176 */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
177 ())
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 288
diff changeset
178 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
179 return IsClipboardFormatAvailable (CF_TEXT) ? Qt : Qnil;
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 288
diff changeset
180 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 288
diff changeset
181
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
182 DEFUN ("mswindows-delete-selection", Fmswindows_delete_selection, 0, 0, 0, /*
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
183 Remove the current MS-Windows selection from the clipboard.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
184 */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
185 ())
404
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents: 400
diff changeset
186 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
187 return EmptyClipboard () ? Qt : Qnil;
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 278
diff changeset
188 }
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 278
diff changeset
189
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
190 static void
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
191 mswindows_disown_selection (Lisp_Object selection, Lisp_Object timeval)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
192 {
416
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
193 if (EQ (selection, QCLIPBOARD))
ebe98a74bd68 Import from CVS: tag r21-2-16
cvs
parents: 414
diff changeset
194 Fmswindows_delete_selection ();
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
195 }
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
196
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
197
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
198 /************************************************************************/
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
199 /* initialization */
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
200 /************************************************************************/
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
201
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
202 void
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
203 console_type_create_select_mswindows (void)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
204 {
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
205 CONSOLE_HAS_METHOD (mswindows, own_selection);
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
206 CONSOLE_HAS_METHOD (mswindows, disown_selection);
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
207 CONSOLE_HAS_METHOD (mswindows, get_foreign_selection);
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
208 }
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
209
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
210 void
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
211 syms_of_select_mswindows (void)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
212 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
213 DEFSUBR (Fmswindows_set_clipboard);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
214 DEFSUBR (Fmswindows_get_clipboard);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
215 DEFSUBR (Fmswindows_selection_exists_p);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
216 DEFSUBR (Fmswindows_delete_selection);
221
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
217 }
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
218
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
219 void
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
220 vars_of_select_mswindows (void)
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
221 {
6c0ae1f9357f Import from CVS: tag r20-4b9
cvs
parents:
diff changeset
222 }