Adding directive for osx sdk 10.5 in ClipBoardCocoa.mm
This commit is contained in:
parent
9fb299b153
commit
9ac1e82c82
1 changed files with 19 additions and 5 deletions
|
@ -16,6 +16,8 @@
|
||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "NasalClipboard.hxx"
|
#include "NasalClipboard.hxx"
|
||||||
|
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
|
@ -67,7 +69,11 @@ class ClipboardCocoa: public NasalClipboard
|
||||||
if( type == CLIPBOARD )
|
if( type == CLIPBOARD )
|
||||||
{
|
{
|
||||||
NSPasteboard* pboard = [NSPasteboard generalPasteboard];
|
NSPasteboard* pboard = [NSPasteboard generalPasteboard];
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||||
|
NSString* nstext = [pboard stringForType:NSStringPboardType];
|
||||||
|
#else // > 10.5
|
||||||
NSString* nstext = [pboard stringForType:NSPasteboardTypeString];
|
NSString* nstext = [pboard stringForType:NSPasteboardTypeString];
|
||||||
|
#endif // MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
return stdStringFromCocoa(nstext);
|
return stdStringFromCocoa(nstext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,8 +91,16 @@ class ClipboardCocoa: public NasalClipboard
|
||||||
{
|
{
|
||||||
NSPasteboard* pboard = [NSPasteboard generalPasteboard];
|
NSPasteboard* pboard = [NSPasteboard generalPasteboard];
|
||||||
NSString* nstext = stdStringToCocoa(text);
|
NSString* nstext = stdStringToCocoa(text);
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||||
|
NSString* type = NSStringPboardType;
|
||||||
|
NSArray* types = [NSArray arrayWithObjects: type, nil];
|
||||||
|
[pboard declareTypes:types owner:nil];
|
||||||
|
[pboard setString:nstext forType: NSStringPboardType];
|
||||||
|
#else // > 10.5
|
||||||
|
NSString* type = NSPasteboardTypeString;
|
||||||
[pboard clearContents];
|
[pboard clearContents];
|
||||||
[pboard setString:nstext forType:NSPasteboardTypeString];
|
[pboard setString:nstext forType:NSPasteboardTypeString];
|
||||||
|
#endif // MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue