aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/MacOSX/OSXClipboard.mm
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 17:24:39 +1000
committerDavid Walter Seikel2013-01-13 17:24:39 +1000
commit393b5cd1dc438872af89d334ef6e5fcc59f27d47 (patch)
tree6a14521219942a08a1b95cb2f5a923a9edd60f63 /libraries/irrlicht-1.8/source/Irrlicht/MacOSX/OSXClipboard.mm
parentAdd a note about rasters suggested start up code. (diff)
downloadSledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.zip
SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.gz
SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.bz2
SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.xz
Added Irrlicht 1.8, but without all the Windows binaries.
Diffstat (limited to '')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/MacOSX/OSXClipboard.mm36
1 files changed, 36 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/MacOSX/OSXClipboard.mm b/libraries/irrlicht-1.8/source/Irrlicht/MacOSX/OSXClipboard.mm
new file mode 100644
index 0000000..d549911
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/MacOSX/OSXClipboard.mm
@@ -0,0 +1,36 @@
1// Copyright (C) 2005-2006 Etienne Petitjean
2// Copyright (C) 2007-2012 Christian Stehno
3// This file is part of the "Irrlicht Engine".
4// For conditions of distribution and use, see copyright notice in Irrlicht.h
5
6#include "OSXClipboard.h"
7#import <Cocoa/Cocoa.h>
8
9void OSXCopyToClipboard(const char *text)
10{
11 NSString *str;
12 NSPasteboard *board;
13
14 if ((text != NULL) && (strlen(text) > 0))
15 {
16 str = [NSString stringWithCString:text encoding:NSWindowsCP1252StringEncoding];
17 board = [NSPasteboard generalPasteboard];
18 [board declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:NSApp];
19 [board setString:str forType:NSStringPboardType];
20 }
21}
22
23char* OSXCopyFromClipboard()
24{
25 NSString* str;
26 NSPasteboard* board;
27 char* result;
28
29 result = NULL;
30 board = [NSPasteboard generalPasteboard];
31 str = [board stringForType:NSStringPboardType];
32 if (str != nil)
33 result = (char*)[str cStringUsingEncoding:NSWindowsCP1252StringEncoding];
34 return (result);
35}
36