// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
#include "NasalClipboard.hxx"
#include <simgear/debug/logstream.hxx>
if( type == CLIPBOARD )
{
- NSPasteboard* pboard = [NSPasteboard generalPasteboard];
- NSString* nstext = [pboard stringForType:NSPasteboardTypeString];
- return stdStringFromCocoa(nstext);
+ 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];
+ #endif // MAC_OS_X_VERSION_MIN_REQUIRED
+ return stdStringFromCocoa(nstext);
}
return "";
{
NSPasteboard* pboard = [NSPasteboard generalPasteboard];
NSString* nstext = stdStringToCocoa(text);
- [pboard clearContents];
- [pboard setString:nstext forType:NSPasteboardTypeString];
+ #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 setString:nstext forType:NSPasteboardTypeString];
+ #endif // MAC_OS_X_VERSION_MIN_REQUIRED
return true;
}