Use a consistent source code format in src/video/uikit
authorKees Bakker <kees@ijzerbout.nl>
Tue, 27 Sep 2011 22:51:26 +0200
changeset 6003fddf81967e2d
parent 6002 0c0aaaa1e5ed
child 6004 d15b5cdd3b12
Use a consistent source code format in src/video/uikit

For example:
* Opening bracket of a method/function on a new line at column 0
* space after "if", "while", etc
src/video/uikit/SDL_uikitappdelegate.h
src/video/uikit/SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitevents.m
src/video/uikit/SDL_uikitopengles.m
src/video/uikit/SDL_uikitopenglview.h
src/video/uikit/SDL_uikitopenglview.m
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitview.m
src/video/uikit/SDL_uikitviewcontroller.m
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/src/video/uikit/SDL_uikitappdelegate.h	Tue Sep 27 21:07:09 2011 +0200
     1.2 +++ b/src/video/uikit/SDL_uikitappdelegate.h	Tue Sep 27 22:51:26 2011 +0200
     1.3 @@ -22,11 +22,11 @@
     1.4  #import <UIKit/UIKit.h>
     1.5  #import "SDL_uikitopenglview.h"
     1.6  
     1.7 -@interface SDLUIKitDelegate:NSObject<UIApplicationDelegate> {
     1.8 +@interface SDLUIKitDelegate : NSObject<UIApplicationDelegate> {
     1.9  }
    1.10  
    1.11 -+(SDLUIKitDelegate *)sharedAppDelegate;
    1.12 -+(NSString *)getAppDelegateClassName;
    1.13 ++ (SDLUIKitDelegate *)sharedAppDelegate;
    1.14 ++ (NSString *)getAppDelegateClassName;
    1.15  
    1.16  @end
    1.17  
     2.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Tue Sep 27 21:07:09 2011 +0200
     2.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Tue Sep 27 22:51:26 2011 +0200
     2.3 @@ -37,15 +37,15 @@
     2.4  static int forward_argc;
     2.5  static char **forward_argv;
     2.6  
     2.7 -int main(int argc, char **argv) {
     2.8 -
     2.9 +int main(int argc, char **argv)
    2.10 +{
    2.11      int i;
    2.12      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    2.13  
    2.14      /* store arguments */
    2.15      forward_argc = argc;
    2.16      forward_argv = (char **)malloc((argc+1) * sizeof(char *));
    2.17 -    for (i=0; i<argc; i++) {
    2.18 +    for (i = 0; i < argc; i++) {
    2.19          forward_argv[i] = malloc( (strlen(argv[i])+1) * sizeof(char));
    2.20          strcpy(forward_argv[i], argv[i]);
    2.21      }
    2.22 @@ -58,7 +58,8 @@
    2.23      return 0;
    2.24  }
    2.25  
    2.26 -static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, const char *newValue) {
    2.27 +static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, const char *newValue)
    2.28 +{
    2.29      SDL_assert(SDL_strcmp(name, SDL_HINT_IDLE_TIMER_DISABLED) == 0);
    2.30  
    2.31      BOOL disable = (*newValue != '0');
    2.32 @@ -68,24 +69,27 @@
    2.33  @implementation SDLUIKitDelegate
    2.34  
    2.35  /* convenience method */
    2.36 -+(SDLUIKitDelegate *)sharedAppDelegate {
    2.37 ++ (SDLUIKitDelegate *)sharedAppDelegate
    2.38 +{
    2.39      /* the delegate is set in UIApplicationMain(), which is garaunteed to be called before this method */
    2.40      return (SDLUIKitDelegate *)[[UIApplication sharedApplication] delegate];
    2.41  }
    2.42  
    2.43 -+(NSString *)getAppDelegateClassName {
    2.44 ++ (NSString *)getAppDelegateClassName
    2.45 +{
    2.46      /* subclassing notice: when you subclass this appdelegate, make sure to add a category to override
    2.47         this method and return the actual name of the delegate */
    2.48      return @"SDLUIKitDelegate";
    2.49  }
    2.50  
    2.51 -- (id)init {
    2.52 +- (id)init
    2.53 +{
    2.54      self = [super init];
    2.55      return self;
    2.56  }
    2.57  
    2.58 -- (void)postFinishLaunch {
    2.59 -
    2.60 +- (void)postFinishLaunch
    2.61 +{
    2.62      /* register a callback for the idletimer hint */
    2.63      SDL_SetHint(SDL_HINT_IDLE_TIMER_DISABLED, "0");
    2.64      SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged);
    2.65 @@ -95,7 +99,7 @@
    2.66  
    2.67      /* free the memory we used to hold copies of argc and argv */
    2.68      int i;
    2.69 -    for (i=0; i<forward_argc; i++) {
    2.70 +    for (i = 0; i < forward_argc; i++) {
    2.71          free(forward_argv[i]);
    2.72      }
    2.73      free(forward_argv);
    2.74 @@ -104,8 +108,8 @@
    2.75      exit(exit_status);
    2.76  }
    2.77  
    2.78 -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    2.79 -
    2.80 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    2.81 +{
    2.82      /* Set working directory to resource path */
    2.83      [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];
    2.84  
    2.85 @@ -114,8 +118,8 @@
    2.86      return YES;
    2.87  }
    2.88  
    2.89 -- (void)applicationWillTerminate:(UIApplication *)application {
    2.90 -
    2.91 +- (void)applicationWillTerminate:(UIApplication *)application
    2.92 +{
    2.93      SDL_SendQuit();
    2.94       /* hack to prevent automatic termination.  See SDL_uikitevents.m for details */
    2.95      longjmp(*(jump_env()), 1);
     3.1 --- a/src/video/uikit/SDL_uikitevents.m	Tue Sep 27 21:07:09 2011 +0200
     3.2 +++ b/src/video/uikit/SDL_uikitevents.m	Tue Sep 27 22:51:26 2011 +0200
     3.3 @@ -47,7 +47,7 @@
     3.4          SInt32 result;
     3.5          do {
     3.6              result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE);
     3.7 -        } while(result == kCFRunLoopRunHandledSource);
     3.8 +        } while (result == kCFRunLoopRunHandledSource);
     3.9      }
    3.10  }
    3.11  
     4.1 --- a/src/video/uikit/SDL_uikitopengles.m	Tue Sep 27 21:07:09 2011 +0200
     4.2 +++ b/src/video/uikit/SDL_uikitopengles.m	Tue Sep 27 22:51:26 2011 +0200
     4.3 @@ -47,7 +47,6 @@
     4.4  */
     4.5  int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
     4.6  {
     4.7 -
     4.8      if (context) {
     4.9          SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
    4.10          [data->view setCurrentContext];
    4.11 @@ -78,10 +77,10 @@
    4.12  
    4.13  void UIKit_GL_SwapWindow(_THIS, SDL_Window * window)
    4.14  {
    4.15 -    #ifdef SDL_POWER_UIKIT
    4.16 +#ifdef SDL_POWER_UIKIT
    4.17      // Check once a frame to see if we should turn off the battery monitor.
    4.18      SDL_UIKit_UpdateBatteryMonitoring();
    4.19 -    #endif
    4.20 +#endif
    4.21  
    4.22      SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
    4.23  
    4.24 @@ -106,13 +105,13 @@
    4.25      UIWindow *uiwindow = data->uiwindow;
    4.26  
    4.27      /* construct our view, passing in SDL's OpenGL configuration data */
    4.28 -    view = [[SDL_uikitopenglview alloc] initWithFrame: [uiwindow bounds] \
    4.29 -                                    retainBacking: _this->gl_config.retained_backing \
    4.30 -                                    rBits: _this->gl_config.red_size \
    4.31 -                                    gBits: _this->gl_config.green_size \
    4.32 -                                    bBits: _this->gl_config.blue_size \
    4.33 -                                    aBits: _this->gl_config.alpha_size \
    4.34 -                                    depthBits: _this->gl_config.depth_size \
    4.35 +    view = [[SDL_uikitopenglview alloc] initWithFrame: [uiwindow bounds]
    4.36 +                                    retainBacking: _this->gl_config.retained_backing
    4.37 +                                    rBits: _this->gl_config.red_size
    4.38 +                                    gBits: _this->gl_config.green_size
    4.39 +                                    bBits: _this->gl_config.blue_size
    4.40 +                                    aBits: _this->gl_config.alpha_size
    4.41 +                                    depthBits: _this->gl_config.depth_size
    4.42                                      majorVersion: _this->gl_config.major_version];
    4.43  
    4.44      data->view = view;
     5.1 --- a/src/video/uikit/SDL_uikitopenglview.h	Tue Sep 27 21:07:09 2011 +0200
     5.2 +++ b/src/video/uikit/SDL_uikitopenglview.h	Tue Sep 27 22:51:26 2011 +0200
     5.3 @@ -54,12 +54,12 @@
     5.4  - (void)setCurrentContext;
     5.5  
     5.6  - (id)initWithFrame:(CGRect)frame
     5.7 -    retainBacking:(BOOL)retained \
     5.8 -    rBits:(int)rBits \
     5.9 -    gBits:(int)gBits \
    5.10 -    bBits:(int)bBits \
    5.11 -    aBits:(int)aBits \
    5.12 -    depthBits:(int)depthBits \
    5.13 +    retainBacking:(BOOL)retained
    5.14 +    rBits:(int)rBits
    5.15 +    gBits:(int)gBits
    5.16 +    bBits:(int)bBits
    5.17 +    aBits:(int)aBits
    5.18 +    depthBits:(int)depthBits
    5.19      majorVersion:(int)majorVersion;
    5.20  
    5.21  - (void)updateFrame;
     6.1 --- a/src/video/uikit/SDL_uikitopenglview.m	Tue Sep 27 21:07:09 2011 +0200
     6.2 +++ b/src/video/uikit/SDL_uikitopenglview.m	Tue Sep 27 22:51:26 2011 +0200
     6.3 @@ -35,20 +35,21 @@
     6.4  
     6.5  @synthesize context;
     6.6  
     6.7 -+ (Class)layerClass {
     6.8 ++ (Class)layerClass
     6.9 +{
    6.10      return [CAEAGLLayer class];
    6.11  }
    6.12  
    6.13 -- (id)initWithFrame:(CGRect)frame \
    6.14 -      retainBacking:(BOOL)retained \
    6.15 -      rBits:(int)rBits \
    6.16 -      gBits:(int)gBits \
    6.17 -      bBits:(int)bBits \
    6.18 -      aBits:(int)aBits \
    6.19 -      depthBits:(int)depthBits \
    6.20 -      majorVersion:(int)majorVersion \
    6.21 +- (id)initWithFrame:(CGRect)frame
    6.22 +      retainBacking:(BOOL)retained
    6.23 +      rBits:(int)rBits
    6.24 +      gBits:(int)gBits
    6.25 +      bBits:(int)bBits
    6.26 +      aBits:(int)aBits
    6.27 +      depthBits:(int)depthBits
    6.28 +      majorVersion:(int)majorVersion
    6.29  {
    6.30 -    NSString *colorFormat=nil;
    6.31 +    NSString *colorFormat = nil;
    6.32      BOOL useDepthBuffer;
    6.33  
    6.34      if (rBits == 8 && gBits == 8 && bBits == 8) {
    6.35 @@ -116,7 +117,7 @@
    6.36              glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
    6.37          }
    6.38  
    6.39 -        if(glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
    6.40 +        if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
    6.41              return NO;
    6.42          }
    6.43          /* end create buffers */
    6.44 @@ -131,7 +132,8 @@
    6.45      return self;
    6.46  }
    6.47  
    6.48 -- (void)updateFrame {
    6.49 +- (void)updateFrame
    6.50 +{
    6.51      glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
    6.52      glBindRenderbufferOES(GL_RENDERBUFFER_OES, 0);
    6.53      glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, 0);
    6.54 @@ -156,22 +158,26 @@
    6.55          self.contentScaleFactor = [UIScreen mainScreen].scale;
    6.56  }
    6.57  
    6.58 -- (void)setCurrentContext {
    6.59 +- (void)setCurrentContext
    6.60 +{
    6.61      [EAGLContext setCurrentContext:context];
    6.62  }
    6.63  
    6.64  
    6.65 -- (void)swapBuffers {
    6.66 +- (void)swapBuffers
    6.67 +{
    6.68      glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
    6.69      [context presentRenderbuffer:GL_RENDERBUFFER_OES];
    6.70  }
    6.71  
    6.72  
    6.73 -- (void)layoutSubviews {
    6.74 +- (void)layoutSubviews
    6.75 +{
    6.76      [EAGLContext setCurrentContext:context];
    6.77  }
    6.78  
    6.79 -- (void)destroyFramebuffer {
    6.80 +- (void)destroyFramebuffer
    6.81 +{
    6.82      glDeleteFramebuffersOES(1, &viewFramebuffer);
    6.83      viewFramebuffer = 0;
    6.84      glDeleteRenderbuffersOES(1, &viewRenderbuffer);
    6.85 @@ -184,7 +190,8 @@
    6.86  }
    6.87  
    6.88  
    6.89 -- (void)dealloc {
    6.90 +- (void)dealloc
    6.91 +{
    6.92      [self destroyFramebuffer];
    6.93      if ([EAGLContext currentContext] == context) {
    6.94          [EAGLContext setCurrentContext:nil];
     7.1 --- a/src/video/uikit/SDL_uikitvideo.m	Tue Sep 27 21:07:09 2011 +0200
     7.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Tue Sep 27 22:51:26 2011 +0200
     7.3 @@ -52,7 +52,7 @@
     7.4  static int
     7.5  UIKit_Available(void)
     7.6  {
     7.7 -    return (1);
     7.8 +    return 1;
     7.9  }
    7.10  
    7.11  static void UIKit_DeleteDevice(SDL_VideoDevice * device)
     8.1 --- a/src/video/uikit/SDL_uikitview.m	Tue Sep 27 21:07:09 2011 +0200
     8.2 +++ b/src/video/uikit/SDL_uikitview.m	Tue Sep 27 22:51:26 2011 +0200
     8.3 @@ -33,12 +33,13 @@
     8.4  
     8.5  @implementation SDL_uikitview
     8.6  
     8.7 -- (void)dealloc {
     8.8 +- (void)dealloc
     8.9 +{
    8.10      [super dealloc];
    8.11  }
    8.12  
    8.13 -- (id)initWithFrame:(CGRect)frame {
    8.14 -
    8.15 +- (id)initWithFrame:(CGRect)frame
    8.16 +{
    8.17      self = [super initWithFrame: frame];
    8.18  
    8.19  #if SDL_IPHONE_KEYBOARD
    8.20 @@ -72,8 +73,8 @@
    8.21  
    8.22  }
    8.23  
    8.24 -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    8.25 -
    8.26 +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    8.27 +{
    8.28      NSEnumerator *enumerator = [touches objectEnumerator];
    8.29      UITouch *touch = (UITouch*)[enumerator nextObject];
    8.30  
    8.31 @@ -89,36 +90,35 @@
    8.32  
    8.33  #ifdef FIXED_MULTITOUCH
    8.34      while(touch) {
    8.35 -      CGPoint locationInView = [touch locationInView: self];
    8.36 -
    8.37 +        CGPoint locationInView = [touch locationInView: self];
    8.38  
    8.39  #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
    8.40 -      //FIXME: TODO: Using touch as the fingerId is potentially dangerous
    8.41 -      //It is also much more efficient than storing the UITouch pointer
    8.42 -      //and comparing it to the incoming event.
    8.43 -      SDL_SendFingerDown(touchId,(long)touch,
    8.44 -                 SDL_TRUE,locationInView.x,locationInView.y,
    8.45 -                 1);
    8.46 +        //FIXME: TODO: Using touch as the fingerId is potentially dangerous
    8.47 +        //It is also much more efficient than storing the UITouch pointer
    8.48 +        //and comparing it to the incoming event.
    8.49 +        SDL_SendFingerDown(touchId, (long)touch,
    8.50 +                           SDL_TRUE, locationInView.x, locationInView.y,
    8.51 +                           1);
    8.52  #else
    8.53 -      int i;
    8.54 -      for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
    8.55 -        if(finger[i] == NULL) {
    8.56 -          finger[i] = touch;
    8.57 -          SDL_SendFingerDown(touchId,i,
    8.58 -                 SDL_TRUE,locationInView.x,locationInView.y,
    8.59 -                 1);
    8.60 -          break;
    8.61 +        int i;
    8.62 +        for(i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
    8.63 +            if (finger[i] == NULL) {
    8.64 +                finger[i] = touch;
    8.65 +                SDL_SendFingerDown(touchId, i,
    8.66 +                                   SDL_TRUE, locationInView.x, locationInView.y,
    8.67 +                                   1);
    8.68 +                break;
    8.69 +            }
    8.70          }
    8.71 -      }
    8.72  #endif
    8.73  
    8.74 -      touch = (UITouch*)[enumerator nextObject];
    8.75 +        touch = (UITouch*)[enumerator nextObject];
    8.76      }
    8.77  #endif
    8.78  }
    8.79  
    8.80 -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    8.81 -
    8.82 +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    8.83 +{
    8.84      NSEnumerator *enumerator = [touches objectEnumerator];
    8.85      UITouch *touch = (UITouch*)[enumerator nextObject];
    8.86  
    8.87 @@ -129,32 +129,32 @@
    8.88  
    8.89  #ifdef FIXED_MULTITOUCH
    8.90      while(touch) {
    8.91 -      CGPoint locationInView = [touch locationInView: self];
    8.92 -
    8.93 +        CGPoint locationInView = [touch locationInView: self];
    8.94  
    8.95  #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
    8.96 -      SDL_SendFingerDown(touchId,(long)touch,
    8.97 -                 SDL_FALSE,locationInView.x,locationInView.y,
    8.98 -                 1);
    8.99 +        SDL_SendFingerDown(touchId, (long)touch,
   8.100 +                           SDL_FALSE, locationInView.x, locationInView.y,
   8.101 +                           1);
   8.102  #else
   8.103 -      int i;
   8.104 -      for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
   8.105 -        if(finger[i] == touch) {
   8.106 -          SDL_SendFingerDown(touchId,i,
   8.107 -                 SDL_FALSE,locationInView.x,locationInView.y,
   8.108 -                 1);
   8.109 -          finger[i] = NULL;
   8.110 -          break;
   8.111 +        int i;
   8.112 +        for (i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
   8.113 +            if (finger[i] == touch) {
   8.114 +                SDL_SendFingerDown(touchId, i,
   8.115 +                                   SDL_FALSE, locationInView.x, locationInView.y,
   8.116 +                                   1);
   8.117 +                finger[i] = NULL;
   8.118 +                break;
   8.119 +            }
   8.120          }
   8.121 -      }
   8.122  #endif
   8.123  
   8.124 -      touch = (UITouch*)[enumerator nextObject];
   8.125 +        touch = (UITouch*)[enumerator nextObject];
   8.126      }
   8.127  #endif
   8.128  }
   8.129  
   8.130 -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
   8.131 +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
   8.132 +{
   8.133      /*
   8.134          this can happen if the user puts more than 5 touches on the screen
   8.135          at once, or perhaps in other circumstances.  Usually (it seems)
   8.136 @@ -163,8 +163,8 @@
   8.137      [self touchesEnded: touches withEvent: event];
   8.138  }
   8.139  
   8.140 -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
   8.141 -
   8.142 +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
   8.143 +{
   8.144      NSEnumerator *enumerator = [touches objectEnumerator];
   8.145      UITouch *touch = (UITouch*)[enumerator nextObject];
   8.146  
   8.147 @@ -177,26 +177,25 @@
   8.148  
   8.149  #ifdef FIXED_MULTITOUCH
   8.150      while(touch) {
   8.151 -      CGPoint locationInView = [touch locationInView: self];
   8.152 -
   8.153 +        CGPoint locationInView = [touch locationInView: self];
   8.154  
   8.155  #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
   8.156 -      SDL_SendTouchMotion(touchId,(long)touch,
   8.157 -                  SDL_FALSE,locationInView.x,locationInView.y,
   8.158 -                  1);
   8.159 +        SDL_SendTouchMotion(touchId, (long)touch,
   8.160 +                            SDL_FALSE, locationInView.x, locationInView.y,
   8.161 +                            1);
   8.162  #else
   8.163 -      int i;
   8.164 -      for(i = 0;i < MAX_SIMULTANEOUS_TOUCHES;i++) {
   8.165 -        if(finger[i] == touch) {
   8.166 -          SDL_SendTouchMotion(touchId,i,
   8.167 -                  SDL_FALSE,locationInView.x,locationInView.y,
   8.168 -                  1);
   8.169 -          break;
   8.170 +        int i;
   8.171 +        for (i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
   8.172 +            if (finger[i] == touch) {
   8.173 +                SDL_SendTouchMotion(touchId, i,
   8.174 +                                    SDL_FALSE, locationInView.x, locationInView.y,
   8.175 +                                    1);
   8.176 +                break;
   8.177 +            }
   8.178          }
   8.179 -      }
   8.180  #endif
   8.181  
   8.182 -      touch = (UITouch*)[enumerator nextObject];
   8.183 +        touch = (UITouch*)[enumerator nextObject];
   8.184      }
   8.185  #endif
   8.186  }
   8.187 @@ -207,13 +206,14 @@
   8.188  #if SDL_IPHONE_KEYBOARD
   8.189  
   8.190  /* Is the iPhone virtual keyboard visible onscreen? */
   8.191 -- (BOOL)keyboardVisible {
   8.192 +- (BOOL)keyboardVisible
   8.193 +{
   8.194      return keyboardVisible;
   8.195  }
   8.196  
   8.197  /* Set ourselves up as a UITextFieldDelegate */
   8.198 -- (void)initializeKeyboard {
   8.199 -
   8.200 +- (void)initializeKeyboard
   8.201 +{
   8.202      textField = [[UITextField alloc] initWithFrame: CGRectZero];
   8.203      textField.delegate = self;
   8.204      /* placeholder so there is something to delete! */
   8.205 @@ -236,20 +236,22 @@
   8.206  }
   8.207  
   8.208  /* reveal onscreen virtual keyboard */
   8.209 -- (void)showKeyboard {
   8.210 +- (void)showKeyboard
   8.211 +{
   8.212      keyboardVisible = YES;
   8.213      [textField becomeFirstResponder];
   8.214  }
   8.215  
   8.216  /* hide onscreen virtual keyboard */
   8.217 -- (void)hideKeyboard {
   8.218 +- (void)hideKeyboard
   8.219 +{
   8.220      keyboardVisible = NO;
   8.221      [textField resignFirstResponder];
   8.222  }
   8.223  
   8.224  /* UITextFieldDelegate method.  Invoked when user types something. */
   8.225 -- (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
   8.226 -
   8.227 +- (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
   8.228 +{
   8.229      if ([string length] == 0) {
   8.230          /* it wants to replace text with nothing, ie a delete */
   8.231          SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_DELETE);
   8.232 @@ -259,7 +261,7 @@
   8.233          /* go through all the characters in the string we've been sent
   8.234             and convert them to key presses */
   8.235          int i;
   8.236 -        for (i=0; i<[string length]; i++) {
   8.237 +        for (i = 0; i < [string length]; i++) {
   8.238  
   8.239              unichar c = [string characterAtIndex: i];
   8.240  
   8.241 @@ -295,7 +297,8 @@
   8.242  }
   8.243  
   8.244  /* Terminates the editing session */
   8.245 -- (BOOL)textFieldShouldReturn:(UITextField*)_textField {
   8.246 +- (BOOL)textFieldShouldReturn:(UITextField*)_textField
   8.247 +{
   8.248      SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
   8.249      [self hideKeyboard];
   8.250      return YES;
   8.251 @@ -308,8 +311,8 @@
   8.252  /* iPhone keyboard addition functions */
   8.253  #if SDL_IPHONE_KEYBOARD
   8.254  
   8.255 -int SDL_iPhoneKeyboardShow(SDL_Window * window) {
   8.256 -
   8.257 +int SDL_iPhoneKeyboardShow(SDL_Window * window)
   8.258 +{
   8.259      SDL_WindowData *data;
   8.260      SDL_uikitview *view;
   8.261  
   8.262 @@ -331,8 +334,8 @@
   8.263      }
   8.264  }
   8.265  
   8.266 -int SDL_iPhoneKeyboardHide(SDL_Window * window) {
   8.267 -
   8.268 +int SDL_iPhoneKeyboardHide(SDL_Window * window)
   8.269 +{
   8.270      SDL_WindowData *data;
   8.271      SDL_uikitview *view;
   8.272  
   8.273 @@ -354,8 +357,8 @@
   8.274      }
   8.275  }
   8.276  
   8.277 -SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) {
   8.278 -
   8.279 +SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window)
   8.280 +{
   8.281      SDL_WindowData *data;
   8.282      SDL_uikitview *view;
   8.283  
   8.284 @@ -376,8 +379,8 @@
   8.285      }
   8.286  }
   8.287  
   8.288 -int SDL_iPhoneKeyboardToggle(SDL_Window * window) {
   8.289 -
   8.290 +int SDL_iPhoneKeyboardToggle(SDL_Window * window)
   8.291 +{
   8.292      SDL_WindowData *data;
   8.293      SDL_uikitview *view;
   8.294  
   8.295 @@ -408,21 +411,25 @@
   8.296  
   8.297  /* stubs, used if compiled without keyboard support */
   8.298  
   8.299 -int SDL_iPhoneKeyboardShow(SDL_Window * window) {
   8.300 +int SDL_iPhoneKeyboardShow(SDL_Window * window)
   8.301 +{
   8.302      SDL_SetError("Not compiled with keyboard support");
   8.303      return -1;
   8.304  }
   8.305  
   8.306 -int SDL_iPhoneKeyboardHide(SDL_Window * window) {
   8.307 +int SDL_iPhoneKeyboardHide(SDL_Window * window)
   8.308 +{
   8.309      SDL_SetError("Not compiled with keyboard support");
   8.310      return -1;
   8.311  }
   8.312  
   8.313 -SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) {
   8.314 +SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window)
   8.315 +{
   8.316      return 0;
   8.317  }
   8.318  
   8.319 -int SDL_iPhoneKeyboardToggle(SDL_Window * window) {
   8.320 +int SDL_iPhoneKeyboardToggle(SDL_Window * window)
   8.321 +{
   8.322      SDL_SetError("Not compiled with keyboard support");
   8.323      return -1;
   8.324  }
     9.1 --- a/src/video/uikit/SDL_uikitviewcontroller.m	Tue Sep 27 21:07:09 2011 +0200
     9.2 +++ b/src/video/uikit/SDL_uikitviewcontroller.m	Tue Sep 27 22:51:26 2011 +0200
     9.3 @@ -33,7 +33,8 @@
     9.4  
     9.5  @implementation SDL_uikitviewcontroller
     9.6  
     9.7 -- (id)initWithSDLWindow:(SDL_Window *)_window {
     9.8 +- (id)initWithSDLWindow:(SDL_Window *)_window
     9.9 +{
    9.10      if ((self = [self init]) == nil) {
    9.11          return nil;
    9.12      }
    9.13 @@ -41,7 +42,8 @@
    9.14      return self;
    9.15  }
    9.16  
    9.17 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient {
    9.18 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient
    9.19 +{
    9.20      const char *orientationsCString;
    9.21      if ((orientationsCString = SDL_GetHint(SDL_HINT_ORIENTATIONS)) != NULL) {
    9.22          BOOL rotate = NO;
    9.23 @@ -96,12 +98,14 @@
    9.24      return NO;  // Nothing else is acceptable.
    9.25  }
    9.26  
    9.27 -- (void)loadView  {
    9.28 +- (void)loadView
    9.29 +{
    9.30      // do nothing.
    9.31  }
    9.32  
    9.33  // Send a resized event when the orientation changes.
    9.34 -- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
    9.35 +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
    9.36 +{
    9.37      if ((self->window->flags & SDL_WINDOW_RESIZABLE) == 0) {
    9.38          return;   // don't care, we're just flipping over in this case.
    9.39      }
    10.1 --- a/src/video/uikit/SDL_uikitwindow.m	Tue Sep 27 21:07:09 2011 +0200
    10.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Tue Sep 27 22:51:26 2011 +0200
    10.3 @@ -183,7 +183,8 @@
    10.4  }
    10.5  
    10.6  void
    10.7 -UIKit_DestroyWindow(_THIS, SDL_Window * window) {
    10.8 +UIKit_DestroyWindow(_THIS, SDL_Window * window)
    10.9 +{
   10.10      SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
   10.11      if (data) {
   10.12          [data->viewcontroller release];