From 7028cbe09c688437910a25623098762bf0fa592d Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 28 Mar 2016 22:28:34 +1000 Subject: Move Irrlicht to src/others. --- .../source/Irrlicht/MacOSX/OSXClipboard.mm | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/others/irrlicht-1.8.1/source/Irrlicht/MacOSX/OSXClipboard.mm (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/MacOSX/OSXClipboard.mm') diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/MacOSX/OSXClipboard.mm b/src/others/irrlicht-1.8.1/source/Irrlicht/MacOSX/OSXClipboard.mm new file mode 100644 index 0000000..d549911 --- /dev/null +++ b/src/others/irrlicht-1.8.1/source/Irrlicht/MacOSX/OSXClipboard.mm @@ -0,0 +1,36 @@ +// Copyright (C) 2005-2006 Etienne Petitjean +// Copyright (C) 2007-2012 Christian Stehno +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in Irrlicht.h + +#include "OSXClipboard.h" +#import + +void OSXCopyToClipboard(const char *text) +{ + NSString *str; + NSPasteboard *board; + + if ((text != NULL) && (strlen(text) > 0)) + { + str = [NSString stringWithCString:text encoding:NSWindowsCP1252StringEncoding]; + board = [NSPasteboard generalPasteboard]; + [board declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:NSApp]; + [board setString:str forType:NSStringPboardType]; + } +} + +char* OSXCopyFromClipboard() +{ + NSString* str; + NSPasteboard* board; + char* result; + + result = NULL; + board = [NSPasteboard generalPasteboard]; + str = [board stringForType:NSStringPboardType]; + if (str != nil) + result = (char*)[str cStringUsingEncoding:NSWindowsCP1252StringEncoding]; + return (result); +} + -- cgit v1.1