src/video/uikit/SDL_uikitview.m
branchiOS-improvements
changeset 9501 574db299498f
parent 9499 6fe9b44b2d84
child 9503 bff6f1fecc5d
     1.1 --- a/src/video/uikit/SDL_uikitview.m	Wed Jul 23 01:33:59 2014 -0300
     1.2 +++ b/src/video/uikit/SDL_uikitview.m	Wed Jul 23 03:05:31 2014 -0300
     1.3 @@ -37,7 +37,19 @@
     1.4  
     1.5  void _uikit_keyboard_init();
     1.6  
     1.7 -@implementation SDL_uikitview
     1.8 +@implementation SDL_uikitview {
     1.9 +
    1.10 +    SDL_TouchID touchId;
    1.11 +    UITouch *leftFingerDown;
    1.12 +#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
    1.13 +    UITouch *finger[MAX_SIMULTANEOUS_TOUCHES];
    1.14 +#endif
    1.15 +
    1.16 +#if SDL_IPHONE_KEYBOARD
    1.17 +    UITextField *textField;
    1.18 +#endif
    1.19 +
    1.20 +}
    1.21  
    1.22  - (void)dealloc
    1.23  {
    1.24 @@ -66,7 +78,7 @@
    1.25      CGPoint point = [touch locationInView: self];
    1.26  
    1.27      if (normalize) {
    1.28 -        CGRect bounds = [self bounds];
    1.29 +        CGRect bounds = self.bounds;
    1.30          point.x /= bounds.size.width;
    1.31          point.y /= bounds.size.height;
    1.32      }
    1.33 @@ -122,7 +134,7 @@
    1.34  
    1.35          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
    1.36  #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
    1.37 -        SDL_SendTouch(touchId, (long)touch,
    1.38 +        SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
    1.39                        SDL_FALSE, locationInView.x, locationInView.y, 1.0f);
    1.40  #else
    1.41          int i;
    1.42 @@ -160,7 +172,7 @@
    1.43  
    1.44          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
    1.45  #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
    1.46 -        SDL_SendTouchMotion(touchId, (long)touch,
    1.47 +        SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch),
    1.48                              locationInView.x, locationInView.y, 1.0f);
    1.49  #else
    1.50          int i;
    1.51 @@ -180,14 +192,9 @@
    1.52  */
    1.53  #if SDL_IPHONE_KEYBOARD
    1.54  
    1.55 -@synthesize textInputRect = textInputRect;
    1.56 -@synthesize keyboardHeight = keyboardHeight;
    1.57 -
    1.58 -/* Is the iPhone virtual keyboard visible onscreen? */
    1.59 -- (BOOL)keyboardVisible
    1.60 -{
    1.61 -    return keyboardVisible;
    1.62 -}
    1.63 +@synthesize textInputRect;
    1.64 +@synthesize keyboardHeight;
    1.65 +@synthesize keyboardVisible;
    1.66  
    1.67  /* Set ourselves up as a UITextFieldDelegate */
    1.68  - (void)initializeKeyboard
    1.69 @@ -337,7 +344,7 @@
    1.70          return 0;
    1.71      }
    1.72  
    1.73 -    return view.keyboardVisible;
    1.74 +    return view.isKeyboardVisible;
    1.75  }
    1.76  
    1.77