aboutsummaryrefslogtreecommitdiffstats
path: root/src/w16select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w16select.c')
-rw-r--r--src/w16select.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/w16select.c b/src/w16select.c
index d5aae1b2e5c..03f63bedf0d 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -1,6 +1,6 @@
1/* 16-bit Windows Selection processing for emacs on MS-Windows 1/* 16-bit Windows Selection processing for emacs on MS-Windows
2 2
3Copyright (C) 1996-1997, 2001-2011 Free Software Foundation, Inc. 3Copyright (C) 1996-1997, 2001-2012 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -110,11 +110,11 @@ identify_winoldap_version (void)
110 <> 1700H: AL = Major version number 110 <> 1700H: AL = Major version number
111 AH = Minor version number */ 111 AH = Minor version number */
112 regs.x.ax = 0x1700; 112 regs.x.ax = 0x1700;
113 __dpmi_int(0x2f, &regs); 113 __dpmi_int (0x2f, &regs);
114 return regs.x.ax; 114 return regs.x.ax;
115} 115}
116 116
117/* Open the clipboard, return non-zero if successfull. */ 117/* Open the clipboard, return non-zero if successful. */
118unsigned 118unsigned
119open_clipboard (void) 119open_clipboard (void)
120{ 120{
@@ -133,11 +133,11 @@ open_clipboard (void)
133 Return Values AX == 0: Clipboard already open 133 Return Values AX == 0: Clipboard already open
134 <> 0: Clipboard opened */ 134 <> 0: Clipboard opened */
135 regs.x.ax = 0x1701; 135 regs.x.ax = 0x1701;
136 __dpmi_int(0x2f, &regs); 136 __dpmi_int (0x2f, &regs);
137 return regs.x.ax; 137 return regs.x.ax;
138} 138}
139 139
140/* Empty clipboard, return non-zero if successfull. */ 140/* Empty clipboard, return non-zero if successful. */
141unsigned 141unsigned
142empty_clipboard (void) 142empty_clipboard (void)
143{ 143{
@@ -147,7 +147,7 @@ empty_clipboard (void)
147 Return Values AX == 0: Error occurred 147 Return Values AX == 0: Error occurred
148 <> 0: OK, Clipboard emptied */ 148 <> 0: OK, Clipboard emptied */
149 regs.x.ax = 0x1702; 149 regs.x.ax = 0x1702;
150 __dpmi_int(0x2f, &regs); 150 __dpmi_int (0x2f, &regs);
151 return regs.x.ax; 151 return regs.x.ax;
152} 152}
153 153
@@ -207,7 +207,7 @@ free_xfer_buf (void)
207 } 207 }
208} 208}
209 209
210/* Copy data into the clipboard, return zero if successfull. */ 210/* Copy data into the clipboard, return zero if successful. */
211unsigned 211unsigned
212set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw) 212set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
213{ 213{
@@ -294,7 +294,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
294 regs.x.cx = truelen & 0xffff; 294 regs.x.cx = truelen & 0xffff;
295 regs.x.es = xbuf_addr >> 4; 295 regs.x.es = xbuf_addr >> 4;
296 regs.x.bx = xbuf_addr & 15; 296 regs.x.bx = xbuf_addr & 15;
297 __dpmi_int(0x2f, &regs); 297 __dpmi_int (0x2f, &regs);
298 298
299 free_xfer_buf (); 299 free_xfer_buf ();
300 300
@@ -320,7 +320,7 @@ get_clipboard_data_size (unsigned Format)
320 the clipboard. */ 320 the clipboard. */
321 regs.x.ax = 0x1704; 321 regs.x.ax = 0x1704;
322 regs.x.dx = Format; 322 regs.x.dx = Format;
323 __dpmi_int(0x2f, &regs); 323 __dpmi_int (0x2f, &regs);
324 return ( (((unsigned)regs.x.dx) << 16) | regs.x.ax); 324 return ( (((unsigned)regs.x.dx) << 16) | regs.x.ax);
325} 325}
326 326
@@ -353,7 +353,7 @@ get_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
353 regs.x.dx = Format; 353 regs.x.dx = Format;
354 regs.x.es = xbuf_addr >> 4; 354 regs.x.es = xbuf_addr >> 4;
355 regs.x.bx = xbuf_addr & 15; 355 regs.x.bx = xbuf_addr & 15;
356 __dpmi_int(0x2f, &regs); 356 __dpmi_int (0x2f, &regs);
357 if (regs.x.ax != 0) 357 if (regs.x.ax != 0)
358 { 358 {
359 unsigned char null_char = '\0'; 359 unsigned char null_char = '\0';
@@ -405,7 +405,7 @@ get_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
405 return (unsigned) (dp - (unsigned char *)Data - 1); 405 return (unsigned) (dp - (unsigned char *)Data - 1);
406} 406}
407 407
408/* Close clipboard, return non-zero if successfull. */ 408/* Close clipboard, return non-zero if successful. */
409unsigned 409unsigned
410close_clipboard (void) 410close_clipboard (void)
411{ 411{
@@ -415,7 +415,7 @@ close_clipboard (void)
415 Return Values AX == 0: Error occurred 415 Return Values AX == 0: Error occurred
416 <> 0: OK */ 416 <> 0: OK */
417 regs.x.ax = 0x1708; 417 regs.x.ax = 0x1708;
418 __dpmi_int(0x2f, &regs); 418 __dpmi_int (0x2f, &regs);
419 return regs.x.ax; 419 return regs.x.ax;
420} 420}
421 421
@@ -432,7 +432,7 @@ clipboard_compact (unsigned Size)
432 regs.x.ax = 0x1709; 432 regs.x.ax = 0x1709;
433 regs.x.si = Size >> 16; 433 regs.x.si = Size >> 16;
434 regs.x.cx = Size & 0xffff; 434 regs.x.cx = Size & 0xffff;
435 __dpmi_int(0x2f, &regs); 435 __dpmi_int (0x2f, &regs);
436 return ((unsigned)regs.x.dx << 16) | regs.x.ax; 436 return ((unsigned)regs.x.dx << 16) | regs.x.ax;
437} 437}
438 438
@@ -637,14 +637,17 @@ DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_dat
637/* Support checking for a clipboard selection. */ 637/* Support checking for a clipboard selection. */
638 638
639DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p, 639DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
640 0, 1, 0, 640 0, 2, 0,
641 doc: /* Whether there is an owner for the given X Selection. 641 doc: /* Whether there is an owner for the given X selection.
642The arg should be the name of the selection in question, typically one of 642SELECTION should be the name of the selection in question, typically
643the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. 643one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects
644\(Those are literal upper-case symbol names, since that's what X expects.) 644these literal upper-case names.) The symbol nil is the same as
645For convenience, the symbol nil is the same as `PRIMARY', 645`PRIMARY', and t is the same as `SECONDARY'.
646and t is the same as `SECONDARY'. */) 646
647 (Lisp_Object selection) 647TERMINAL should be a terminal object or a frame specifying the X
648server to query. If omitted or nil, that stands for the selected
649frame's display, or the first available X display. */)
650 (Lisp_Object selection, Lisp_Object terminal)
648{ 651{
649 CHECK_SYMBOL (selection); 652 CHECK_SYMBOL (selection);
650 653
@@ -730,4 +733,3 @@ After the communication, this variable is set to nil. */);
730} 733}
731 734
732#endif /* MSDOS */ 735#endif /* MSDOS */
733