]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
First attempt at copying to the clipboard -- doesn't seem to work.
authorBen Harris <bjh21@bjh21.me.uk>
Thu, 11 Mar 1999 23:23:45 +0000 (23:23 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Thu, 11 Mar 1999 23:23:45 +0000 (23:23 +0000)
Also a bug-fix in auto-scrolling when drag-selecting off the top.

[originally from svn r91]

macterm.c
putty.h

index 80ac88872483b292c3b92c6988e147cbf28ba41e..6141925e74bdb6647662f4b3289dba1c3ed5c04e 100644 (file)
--- a/macterm.c
+++ b/macterm.c
@@ -1,4 +1,4 @@
-/* $Id: macterm.c,v 1.1.2.17 1999/03/11 21:40:32 ben Exp $ */
+/* $Id: macterm.c,v 1.1.2.18 1999/03/11 23:23:45 ben Exp $ */
 /*
  * Copyright (c) 1999 Ben Harris
  * All rights reserved.
@@ -285,12 +285,26 @@ static void text_click(struct mac_session *s, EventRecord *event) {
                   MA_DRAG, col, row);
        if (row > rows - 1)
            term_scroll(0, row - (rows - 1));
-       else if (row < 0)
-           term_scroll(0, row);
+       else if (row <= 0)
+           term_scroll(0, row - 1);
     }
+    term_mouse(event->modifiers & shiftKey ? MB_EXTEND : MB_SELECT, MA_RELEASE,
+              col, row);
     lastwhen = TickCount();
 }
 
+void write_clip(void *data, int len) {
+    
+    if (ZeroScrap() != noErr)
+       return;
+    PutScrap(len, 'TEXT', data);
+}
+
+void get_clip(void **p, int *lenp) {
+
+    /* XXX: do something */
+}
+
 static pascal void mac_scrolltracker(ControlHandle control, short part) {
     struct mac_session *s;
 
diff --git a/putty.h b/putty.h
index 81a3b6b550e6b423bca476bec95526c39547896d..bd5eada9e792db9e188a1d700c1dcba578d84ca4 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -53,7 +53,11 @@ typedef struct mac_session *Context;
 typedef HDC Context;
 #endif /* not macintosh */
 
+#ifdef macintosh
+#define SEL_NL { 13 }
+#else
 #define SEL_NL { 13, 10 }
+#endif
 
 /*
  * Global variables. Most modules declare these `extern', but