Mercurial > emacs
comparison src/w16select.c @ 22749:14bde44d261c
(set_clipboard_data, get_clipboard_data, Fw16_set_clipboard_data,
Fw16_get_clipboard_data, Fx_selection_exists_p): Use CF_OEMTEXT instead
of CF_TEXT.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Mon, 13 Jul 1998 14:29:35 +0000 |
parents | 3537e1563a66 |
children | 37738fa8626a |
comparison
equal
deleted
inserted
replaced
22748:8d234814a5a6 | 22749:14bde44d261c |
---|---|
232 __dpmi_regs regs; | 232 __dpmi_regs regs; |
233 unsigned truelen; | 233 unsigned truelen; |
234 unsigned long xbuf_addr, buf_offset; | 234 unsigned long xbuf_addr, buf_offset; |
235 unsigned char *dp = Data, *dstart = dp; | 235 unsigned char *dp = Data, *dstart = dp; |
236 | 236 |
237 if (Format != CF_TEXT) | 237 if (Format != CF_OEMTEXT) |
238 return 0; | 238 return 0; |
239 | 239 |
240 /* need to know final size after '\r' chars are inserted (the | 240 /* need to know final size after '\r' chars are inserted (the |
241 standard CF_TEXT clipboard format uses CRLF line endings, | 241 standard CF_OEMTEXT clipboard format uses CRLF line endings, |
242 while Emacs uses just LF internally). */ | 242 while Emacs uses just LF internally). */ |
243 truelen = Size; | 243 truelen = Size; |
244 | 244 |
245 if (!Raw) | 245 if (!Raw) |
246 { | 246 { |
325 __dpmi_regs regs; | 325 __dpmi_regs regs; |
326 unsigned datalen = 0; | 326 unsigned datalen = 0; |
327 unsigned long xbuf_addr; | 327 unsigned long xbuf_addr; |
328 unsigned char *dp = Data; | 328 unsigned char *dp = Data; |
329 | 329 |
330 if (Format != CF_TEXT) | 330 if (Format != CF_OEMTEXT) |
331 return 0; | 331 return 0; |
332 | 332 |
333 if (Size == 0) | 333 if (Size == 0) |
334 return 0; | 334 return 0; |
335 | 335 |
474 | 474 |
475 if (!open_clipboard ()) | 475 if (!open_clipboard ()) |
476 goto error; | 476 goto error; |
477 | 477 |
478 ok = empty_clipboard () | 478 ok = empty_clipboard () |
479 && (ok1 = set_clipboard_data (CF_TEXT, src, nbytes, no_crlf_conversion)); | 479 && (ok1 = set_clipboard_data (CF_OEMTEXT, src, nbytes, no_crlf_conversion)); |
480 | 480 |
481 if (!no_crlf_conversion) | 481 if (!no_crlf_conversion) |
482 Vlast_coding_system_used = Qraw_text; | 482 Vlast_coding_system_used = Qraw_text; |
483 close_clipboard (); | 483 close_clipboard (); |
484 | 484 |
530 BLOCK_INPUT; | 530 BLOCK_INPUT; |
531 | 531 |
532 if (!open_clipboard ()) | 532 if (!open_clipboard ()) |
533 goto unblock; | 533 goto unblock; |
534 | 534 |
535 if ((data_size = get_clipboard_data_size (CF_TEXT)) == 0 || | 535 if ((data_size = get_clipboard_data_size (CF_OEMTEXT)) == 0 || |
536 (htext = (unsigned char *)xmalloc (data_size)) == 0) | 536 (htext = (unsigned char *)xmalloc (data_size)) == 0) |
537 goto closeclip; | 537 goto closeclip; |
538 | 538 |
539 /* need to know final size after '\r' chars are removed because | 539 /* need to know final size after '\r' chars are removed because |
540 we can't change the string size manually, and doing an extra | 540 we can't change the string size manually, and doing an extra |
541 copy is silly */ | 541 copy is silly */ |
542 if ((truelen = get_clipboard_data (CF_TEXT, htext, data_size, 0)) == 0) | 542 if ((truelen = get_clipboard_data (CF_OEMTEXT, htext, data_size, 0)) == 0) |
543 goto closeclip; | 543 goto closeclip; |
544 | 544 |
545 /* Do we need to decode it? */ | 545 /* Do we need to decode it? */ |
546 if (! NILP (buffer_defaults.enable_multibyte_characters)) | 546 if (! NILP (buffer_defaults.enable_multibyte_characters)) |
547 { | 547 { |
565 struct coding_system coding; | 565 struct coding_system coding; |
566 | 566 |
567 setup_coding_system | 567 setup_coding_system |
568 (Fcheck_coding_system (Vclipboard_coding_system), &coding); | 568 (Fcheck_coding_system (Vclipboard_coding_system), &coding); |
569 coding.mode |= CODING_MODE_LAST_BLOCK; | 569 coding.mode |= CODING_MODE_LAST_BLOCK; |
570 truelen = get_clipboard_data (CF_TEXT, htext, data_size, 1); | 570 truelen = get_clipboard_data (CF_OEMTEXT, htext, data_size, 1); |
571 bufsize = decoding_buffer_size (&coding, truelen); | 571 bufsize = decoding_buffer_size (&coding, truelen); |
572 buf = (unsigned char *) xmalloc (bufsize); | 572 buf = (unsigned char *) xmalloc (bufsize); |
573 decode_coding (&coding, htext, buf, truelen, bufsize); | 573 decode_coding (&coding, htext, buf, truelen, bufsize); |
574 truelen = (coding.fake_multibyte | 574 truelen = (coding.fake_multibyte |
575 ? multibyte_chars_in_text (buf, coding.produced) | 575 ? multibyte_chars_in_text (buf, coding.produced) |
631 { | 631 { |
632 Lisp_Object val = Qnil; | 632 Lisp_Object val = Qnil; |
633 | 633 |
634 if (open_clipboard ()) | 634 if (open_clipboard ()) |
635 { | 635 { |
636 if (get_clipboard_data_size (CF_TEXT)) | 636 if (get_clipboard_data_size (CF_OEMTEXT)) |
637 val = Qt; | 637 val = Qt; |
638 close_clipboard (); | 638 close_clipboard (); |
639 } | 639 } |
640 return val; | 640 return val; |
641 } | 641 } |