comparison src/video/uikit/SDL_uikitevents.m @ 2449:4a07dc228e93 gsoc2008_iphone

comments and trivials
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Sat, 16 Aug 2008 00:14:35 +0000
parents 491958a6c881
children
comparison
equal deleted inserted replaced
2448:e060950cbf30 2449:4a07dc228e93
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 23
24 /* Being a null driver, there's no event stream. We just define stubs for
25 most of the API. */
26
27 #include "SDL.h" 24 #include "SDL.h"
28 #include "../../events/SDL_sysevents.h" 25 #include "../../events/SDL_sysevents.h"
29 #include "../../events/SDL_events_c.h" 26 #include "../../events/SDL_events_c.h"
30 27
31 #include "SDL_uikitvideo.h" 28 #include "SDL_uikitvideo.h"
32 #include "SDL_uikitevents.h" 29 #include "SDL_uikitevents.h"
33 30
34 #import <Foundation/Foundation.h> 31 #import <Foundation/Foundation.h>
35 #include "jump.h" 32 #include "jumphack.h"
36 33
37 void 34 void
38 UIKit_PumpEvents(_THIS) 35 UIKit_PumpEvents(_THIS)
39 { 36 {
40 /* 37 /*
45 42
46 This doesn't give the SDL user's application time to respond to an SDL_Quit event. 43 This doesn't give the SDL user's application time to respond to an SDL_Quit event.
47 So what we do is that in the UIApplicationDelegate class (SDLUIApplicationDelegate), 44 So what we do is that in the UIApplicationDelegate class (SDLUIApplicationDelegate),
48 when the delegate receives the ApplicationWillTerminate message, we execute 45 when the delegate receives the ApplicationWillTerminate message, we execute
49 a longjmp statement to get back here, preventing an immediate exit. 46 a longjmp statement to get back here, preventing an immediate exit.
50
51 */ 47 */
52 if (setjmp(*jump_env()) != 0) { 48 if (setjmp(*jump_env()) == 0) {
53 //NSLog(@"Bam! We're back"); 49 /* if we're setting the jump, rather than jumping back */
54 }
55 else {
56 SInt32 result; 50 SInt32 result;
57 do { 51 do {
58 result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE); 52 result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE);
59 } while(result == kCFRunLoopRunHandledSource); 53 } while(result == kCFRunLoopRunHandledSource);
60
61 } 54 }
62 55
63 } 56 }
64 57
65 /* vi: set ts=4 sw=4 expandtab: */ 58 /* vi: set ts=4 sw=4 expandtab: */