Updated Xcode project files for clipboard API
Fixed generation of SDL_revision.h when hg is in the path set up in .bash_profile
This commit is contained in:
parent
3ff2d236cd
commit
78efa56da5
3 changed files with 67 additions and 31 deletions
|
@ -23,20 +23,28 @@
|
|||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
static NSString *
|
||||
GetTextFormat(_THIS)
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
|
||||
return NSStringPboardType;
|
||||
#else
|
||||
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
||||
|
||||
if (data->osversion >= 0x1060) {
|
||||
return NSPasteboardTypeString;
|
||||
} else {
|
||||
return NSStringPboardType;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
Cocoa_SetClipboardText(_THIS, const char *text)
|
||||
{
|
||||
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
||||
NSAutoreleasePool *pool;
|
||||
NSPasteboard *pasteboard;
|
||||
NSString *format;
|
||||
|
||||
if (data->osversion >= 0x1060) {
|
||||
format = NSPasteboardTypeString;
|
||||
} else {
|
||||
format = NSStringPboardType;
|
||||
}
|
||||
NSString *format = GetTextFormat(_this);
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
|
@ -52,19 +60,12 @@ Cocoa_SetClipboardText(_THIS, const char *text)
|
|||
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 @@ Cocoa_GetClipboardText(_THIS)
|
|||
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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue