X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fselect-msw.c;h=7d11bd9b2f7faf1117f08af7d35900aff6d9e90d;hb=4f29597e4f3696a59bb08ffece07183c1568c4a5;hp=3096d542dcabb8bc4f2e72f6435f5417a5a450c9;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git- diff --git a/src/select-msw.c b/src/select-msw.c index 3096d54..7d11bd9 100644 --- a/src/select-msw.c +++ b/src/select-msw.c @@ -29,135 +29,183 @@ Boston, MA 02111-1307, USA. */ #include #include "lisp.h" +#include "frame.h" +#include "select.h" #include "console-msw.h" -DEFUN ("mswindows-set-clipboard", Fmswindows_set_clipboard, 1, 1, 0, /* -Copy STRING to the mswindows clipboard. -*/ - (string)) + +/* Do protocol to assert ourself as a selection owner. Under mswindows +this is easy, we just set the clipboard. */ +static Lisp_Object +mswindows_own_selection (Lisp_Object selection_name, + Lisp_Object selection_value) { - int rawsize, size, i; - unsigned char *src, *dst, *next; - HGLOBAL h = NULL; + Lisp_Object converted_value = get_local_selection (selection_name, QSTRING); + + if (!NILP (converted_value) && + CONSP (converted_value) && + EQ (XCAR (converted_value), QSTRING) && + /* pure mswindows behaviour only says we can own the selection + if it is the clipboard */ + EQ (selection_name, QCLIPBOARD)) + { + int rawsize, size, i; + unsigned char *src, *dst, *next; + HGLOBAL h = NULL; + struct frame *f = NULL; + struct gcpro gcpro1, gcpro2; + Lisp_Object string = XCDR (converted_value); - CHECK_STRING (string); + GCPRO2 (converted_value, string); - /* Calculate size with LFs converted to CRLFs because - * CF_TEXT format uses CRLF delimited ASCIIZ */ - src = XSTRING_DATA (string); - size = rawsize = XSTRING_LENGTH (string) + 1; - for (i=0; i