comparison src/video/cocoa/SDL_cocoaevents.m @ 3120:1282a042d530

Temporary workaround for building on 64-bit Mac OS X
author Sam Lantinga <slouken@libsdl.org>
date Thu, 07 May 2009 12:27:42 +0000
parents 54fac87e1f34
children 05d83835f41b 00cace2d9080
comparison
equal deleted inserted replaced
3119:f78ed7625325 3120:1282a042d530
18 18
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 #include "SDL_config.h" 22 #include "SDL_config.h"
23 #include "SDL_timer.h"
23 24
24 #include "SDL_cocoavideo.h" 25 #include "SDL_cocoavideo.h"
25 #include "../../events/SDL_events_c.h" 26 #include "../../events/SDL_events_c.h"
27
26 28
27 /* setAppleMenu disappeared from the headers in 10.4 */ 29 /* setAppleMenu disappeared from the headers in 10.4 */
28 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 30 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
29 @interface NSApplication(NSAppleMenu) 31 @interface NSApplication(NSAppleMenu)
30 - (void)setAppleMenu:(NSMenu *)menu; 32 - (void)setAppleMenu:(NSMenu *)menu;
163 Cocoa_PumpEvents(_THIS) 165 Cocoa_PumpEvents(_THIS)
164 { 166 {
165 NSAutoreleasePool *pool; 167 NSAutoreleasePool *pool;
166 168
167 /* Update activity every 30 seconds to prevent screensaver */ 169 /* Update activity every 30 seconds to prevent screensaver */
170 /* FIXME: This define isn't available with 64-bit Mac OS X? */
171 #ifdef UsrActivity
168 if (_this->suspend_screensaver) { 172 if (_this->suspend_screensaver) {
169 SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; 173 SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
170 Uint32 now = SDL_GetTicks(); 174 Uint32 now = SDL_GetTicks();
171 if (!data->screensaver_activity || 175 if (!data->screensaver_activity ||
172 (int)(now-data->screensaver_activity) >= 30000) { 176 (int)(now-data->screensaver_activity) >= 30000) {
173 UpdateSystemActivity(UsrActivity); 177 UpdateSystemActivity(UsrActivity);
174 data->screensaver_activity = now; 178 data->screensaver_activity = now;
175 } 179 }
176 } 180 }
181 #endif
177 182
178 pool = [[NSAutoreleasePool alloc] init]; 183 pool = [[NSAutoreleasePool alloc] init];
179 while ([NSApp isRunning]) { 184 while ([NSApp isRunning]) {
180 NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ]; 185 NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
181 if ( event == nil ) { 186 if ( event == nil ) {