From 12064f2245cc984088046829c49e6fa9311c6e56 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 11 Mar 1999 23:23:45 +0000 Subject: [PATCH] First attempt at copying to the clipboard -- doesn't seem to work. Also a bug-fix in auto-scrolling when drag-selecting off the top. [originally from svn r91] --- macterm.c | 20 +++++++++++++++++--- putty.h | 4 ++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/macterm.c b/macterm.c index 80ac8887..6141925e 100644 --- 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 81a3b6b5..bd5eada9 100644 --- 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 -- 2.45.2