Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Updated Xcode project files for clipboard API

Fixed generation of SDL_revision.h when hg is in the path set up in .bash_profile
  • Loading branch information
slouken committed Jul 8, 2010
1 parent 1b9488e commit 59ea7142b5a85e3a6add3981d296e7291ac33683

File 3 of 3 in 59ea714

@@ -23,20 +23,28 @@

#include "SDL_cocoavideo.h"


int
Cocoa_SetClipboardText(_THIS, const char *text)
static NSString *
GetTextFormat(_THIS)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
return NSStringPboardType;
#else
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
NSAutoreleasePool *pool;
NSPasteboard *pasteboard;
NSString *format;

if (data->osversion >= 0x1060) {
format = NSPasteboardTypeString;
return NSPasteboardTypeString;
} else {
format = NSStringPboardType;
return NSStringPboardType;
}
#endif
}

int
Cocoa_SetClipboardText(_THIS, const char *text)
{
NSAutoreleasePool *pool;
NSPasteboard *pasteboard;
NSString *format = GetTextFormat(_this);

pool = [[NSAutoreleasePool alloc] init];

@@ -52,19 +60,12 @@
char *
Cocoa_GetClipboardText(_THIS)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
NSAutoreleasePool *pool;
NSPasteboard *pasteboard;
NSString *format;
NSString *format = GetTextFormat(_this);
NSString *available;
char *text;

if (data->osversion >= 0x1060) {
format = NSPasteboardTypeString;
} else {
format = NSStringPboardType;
}

pool = [[NSAutoreleasePool alloc] init];

pasteboard = [NSPasteboard generalPasteboard];
@@ -92,19 +93,12 @@
SDL_bool
Cocoa_HasClipboardText(_THIS)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
NSAutoreleasePool *pool;
NSPasteboard *pasteboard;
NSString *format;
NSString *format = GetTextFormat(_this);
NSString *available;
SDL_bool result;

if (data->osversion >= 0x1060) {
format = NSPasteboardTypeString;
} else {
format = NSStringPboardType;
}

pool = [[NSAutoreleasePool alloc] init];

pasteboard = [NSPasteboard generalPasteboard];

0 comments on commit 59ea714

Please sign in to comment.