From 049d62b35cd48dffa2a661bf82452f3694ffaaa2 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sun, 4 Oct 2009 21:08:38 +0000 Subject: (svn r17708) -Feature [FS#2053]: [OSX] Implement clipboard support for OS X. --- src/os/os2/os2.cpp | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'src/os/os2') diff --git a/src/os/os2/os2.cpp b/src/os/os2/os2.cpp index 06508b361..ead6f78c3 100644 --- a/src/os/os2/os2.cpp +++ b/src/os/os2/os2.cpp @@ -176,14 +176,7 @@ int CDECL main(int argc, char *argv[]) return ttd_main(argc, argv); } -/** - * Insert a chunk of text from the clipboard onto the textbuffer. Get TEXT clipboard - * and append this up to the maximum length (either absolute or screenlength). If maxlength - * is zero, we don't care about the screenlength but only about the physical length of the string - * @param tb Textbuf type to be changed - * @return Return true on successful change of Textbuf, or false otherwise - */ -bool InsertTextBufferClipboard(Textbuf *tb) +bool GetClipboardContents(char *buffer, size_t buff_len) { /* XXX -- Currently no clipboard support implemented with GCC */ #ifndef __INNOTEK_LIBC__ @@ -195,30 +188,7 @@ bool InsertTextBufferClipboard(Textbuf *tb) if (text != NULL) { - uint length = 0; - uint width = 0; - const char *i; - - for (i = text; IsValidAsciiChar(*i); i++) - { - uint w; - - if (tb->size + length + 1 > tb->maxsize) break; - - w = GetCharacterWidth(FS_NORMAL, (byte)*i); - if (tb->maxwidth != 0 && width + tb->width + w > tb->maxwidth) break; - - width += w; - length++; - } - - memmove(tb->buf + tb->caretpos + length, tb->buf + tb->caretpos, tb->size - tb->caretpos); - memcpy(tb->buf + tb->caretpos, text, length); - tb->width += width; - tb->caretxoffs += width; - tb->size += length; - tb->caretpos += length; - + ttd_strlcpy(buffer, text, buff_len); WinCloseClipbrd(hab); return true; } -- cgit v1.2.3-54-g00ecf