/* 16-bit Windows Selection processing for emacs on MS-Windows
Copyright (C) 1996, 1997, 2001 Free Software Foundation.
-
+
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
#include "buffer.h"
#include "charset.h"
#include "coding.h"
+#include "composite.h"
/* If ever some function outside this file will need to call any
clipboard-related function, the following prototypes and constants
empty_clipboard ()
{
__dpmi_regs regs;
-
+
/* Calls Int 2Fh/AX=1702h
Return Values AX == 0: Error occurred
<> 0: OK, Clipboard emptied */
the next loop by an additional test. */
register unsigned char *lcdp =
last_clipboard_text == NULL ? &null_char : last_clipboard_text;
-
+
/* Copy data from low memory, remove CR
characters before LF if needed. */
_farsetsel (_dos_ds);
Lisp_Object string, frame;
{
unsigned ok = 1, put_status = 0;
- int nbytes;
+ int nbytes, charset_info, no_crlf_conversion;
unsigned char *src, *dst = NULL;
- int charset_info;
- int no_crlf_conversion;
CHECK_STRING (string);
BLOCK_INPUT;
- nbytes = STRING_BYTES (XSTRING (string));
- src = XSTRING (string)->data;
+ nbytes = SBYTES (string);
+ src = SDATA (string);
/* Since we are now handling multilingual text, we must consider
encoding text for the clipboard. */
- charset_info = find_charset_in_text (src, XSTRING (string)->size, nbytes,
+ charset_info = find_charset_in_text (src, SCHARS (string), nbytes,
NULL, Qnil);
if (charset_info == 0)
&& !NILP (Ffboundp (coding.pre_write_conversion)))
{
string = run_pre_post_conversion_on_str (string, &coding, 1);
- src = XSTRING (string)->data;
- nbytes = STRING_BYTES (XSTRING (string));
+ src = SDATA (string);
+ nbytes = SBYTES (string);
}
coding.src_multibyte = 1;
coding.dst_multibyte = 0;
unsigned data_size, truelen;
unsigned char *htext;
Lisp_Object ret = Qnil;
- int no_crlf_conversion;
- int require_encoding = 0;
+ int no_crlf_conversion, require_encoding = 0;
if (NILP (frame))
frame = Fselected_frame ();
coding.dst_multibyte = 1;
Vnext_selection_coding_system = Qnil;
coding.mode |= CODING_MODE_LAST_BLOCK;
+ /* We explicitely disable composition handling because selection
+ data should not contain any composition sequence. */
+ coding.composing = COMPOSITION_DISABLED;
truelen = get_clipboard_data (CF_OEMTEXT, htext, data_size, 1);
bufsize = decoding_buffer_size (&coding, truelen);
buf = (unsigned char *) xmalloc (bufsize);
unblock:
UNBLOCK_INPUT;
-
+
done:
-
+
return (ret);
}
return Qnil;
}
-void
+void
syms_of_win16select ()
{
defsubr (&Sw16_set_clipboard_data);