src/video/cocoa/SDL_cocoawindow.m
changeset 4925 514f811a4887
parent 4915 834ce48a19c2
child 4927 d716dff4b13e
equal deleted inserted replaced
4924:455c0dad84df 4925:514f811a4887
    59     }
    59     }
    60     [center addObserver:self selector:@selector(windowDidHide:) name:NSApplicationDidHideNotification object:NSApp];
    60     [center addObserver:self selector:@selector(windowDidHide:) name:NSApplicationDidHideNotification object:NSApp];
    61     [center addObserver:self selector:@selector(windowDidUnhide:) name:NSApplicationDidUnhideNotification object:NSApp];
    61     [center addObserver:self selector:@selector(windowDidUnhide:) name:NSApplicationDidUnhideNotification object:NSApp];
    62 
    62 
    63     [_data->nswindow setAcceptsMouseMovedEvents:YES];
    63     [_data->nswindow setAcceptsMouseMovedEvents:YES];
       
    64 #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
    64     [[_data->nswindow contentView] setAcceptsTouchEvents:YES];
    65     [[_data->nswindow contentView] setAcceptsTouchEvents:YES];
       
    66 #endif
    65 }
    67 }
    66 
    68 
    67 - (void)close
    69 - (void)close
    68 {
    70 {
    69     NSNotificationCenter *center;
    71     NSNotificationCenter *center;
   291     [self handleTouches:COCOA_TOUCH_CANCELLED withEvent:theEvent];
   293     [self handleTouches:COCOA_TOUCH_CANCELLED withEvent:theEvent];
   292 }
   294 }
   293 
   295 
   294 - (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
   296 - (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
   295 {
   297 {
       
   298 #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
   296     NSSet *touches = 0;
   299     NSSet *touches = 0;
   297     NSEnumerator *enumerator;
   300     NSEnumerator *enumerator;
   298     NSTouch *touch;
   301     NSTouch *touch;
   299 
   302 
   300     switch (type) {
   303     switch (type) {
   352             break;
   355             break;
   353         }
   356         }
   354         
   357         
   355         touch = (NSTouch*)[enumerator nextObject];
   358         touch = (NSTouch*)[enumerator nextObject];
   356     }
   359     }
       
   360 #endif /* MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 */
   357 }
   361 }
   358 
   362 
   359 @end
   363 @end
   360 
   364 
   361 @interface SDLWindow : NSWindow
   365 @interface SDLWindow : NSWindow