src/video/cocoa/SDL_cocoawindow.m
author Sam Lantinga <slouken@libsdl.org>
Sun, 09 May 2010 20:47:22 -0700
changeset 4465 3e69e077cb95
parent 3688 6512cba48440
child 4484 9322f7db8603
permissions -rw-r--r--
Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.

Plus, this lets me start implementing cursor support.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2009 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #include "SDL_syswm.h"
    25 #include "../SDL_sysvideo.h"
    26 #include "../../events/SDL_keyboard_c.h"
    27 #include "../../events/SDL_mouse_c.h"
    28 #include "../../events/SDL_windowevents_c.h"
    29 
    30 #include "SDL_cocoavideo.h"
    31 
    32 static __inline__ void ConvertNSRect(NSRect *r)
    33 {
    34     r->origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - r->origin.y - r->size.height;
    35 }
    36 
    37 @implementation Cocoa_WindowListener
    38 
    39 - (void)listen:(SDL_WindowData *)data
    40 {
    41     NSNotificationCenter *center;
    42 
    43     _data = data;
    44 
    45     center = [NSNotificationCenter defaultCenter];
    46 
    47     [_data->nswindow setNextResponder:self];
    48     if ([_data->nswindow delegate] != nil) {
    49         [center addObserver:self selector:@selector(windowDisExpose:) name:NSWindowDidExposeNotification object:_data->nswindow];
    50         [center addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:_data->nswindow];
    51         [center addObserver:self selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:_data->nswindow];
    52         [center addObserver:self selector:@selector(windowDidMiniaturize:) name:NSWindowDidMiniaturizeNotification object:_data->nswindow];
    53         [center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:_data->nswindow];
    54         [center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:_data->nswindow];
    55         [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:_data->nswindow];
    56     } else {
    57         [_data->nswindow setDelegate:self];
    58     }
    59     [center addObserver:self selector:@selector(windowDidHide:) name:NSApplicationDidHideNotification object:NSApp];
    60     [center addObserver:self selector:@selector(windowDidUnhide:) name:NSApplicationDidUnhideNotification object:NSApp];
    61 
    62     [_data->nswindow setAcceptsMouseMovedEvents:YES];
    63 }
    64 
    65 - (void)close
    66 {
    67     NSNotificationCenter *center;
    68 
    69     center = [NSNotificationCenter defaultCenter];
    70 
    71     [_data->nswindow setNextResponder:nil];
    72     if ([_data->nswindow delegate] != self) {
    73         [center removeObserver:self name:NSWindowDidExposeNotification object:_data->nswindow];
    74         [center removeObserver:self name:NSWindowDidMoveNotification object:_data->nswindow];
    75         [center removeObserver:self name:NSWindowDidResizeNotification object:_data->nswindow];
    76         [center removeObserver:self name:NSWindowDidMiniaturizeNotification object:_data->nswindow];
    77         [center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:_data->nswindow];
    78         [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:_data->nswindow];
    79         [center removeObserver:self name:NSWindowDidResignKeyNotification object:_data->nswindow];
    80     } else {
    81         [_data->nswindow setDelegate:nil];
    82     }
    83     [center removeObserver:self name:NSApplicationDidHideNotification object:NSApp];
    84     [center removeObserver:self name:NSApplicationDidUnhideNotification object:NSApp];
    85 }
    86 
    87 - (BOOL)windowShouldClose:(id)sender
    88 {
    89     SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
    90     return NO;
    91 }
    92 
    93 - (void)windowDidExpose:(NSNotification *)aNotification
    94 {
    95     SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_EXPOSED, 0, 0);
    96 }
    97 
    98 - (void)windowDidMove:(NSNotification *)aNotification
    99 {
   100     int x, y;
   101     NSRect rect = [_data->nswindow contentRectForFrameRect:[_data->nswindow frame]];
   102     ConvertNSRect(&rect);
   103     x = (int)rect.origin.x;
   104     y = (int)rect.origin.y;
   105     SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MOVED, x, y);
   106 }
   107 
   108 - (void)windowDidResize:(NSNotification *)aNotification
   109 {
   110     int w, h;
   111     NSRect rect = [_data->nswindow contentRectForFrameRect:[_data->nswindow frame]];
   112     w = (int)rect.size.width;
   113     h = (int)rect.size.height;
   114     SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESIZED, w, h);
   115 }
   116 
   117 - (void)windowDidMiniaturize:(NSNotification *)aNotification
   118 {
   119     SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
   120 }
   121 
   122 - (void)windowDidDeminiaturize:(NSNotification *)aNotification
   123 {
   124     SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
   125 }
   126 
   127 - (void)windowDidBecomeKey:(NSNotification *)aNotification
   128 {
   129     /* We're going to get keyboard events, since we're key. */
   130     SDL_SetKeyboardFocus(_data->window);
   131 }
   132 
   133 - (void)windowDidResignKey:(NSNotification *)aNotification
   134 {
   135     /* Some other window will get mouse events, since we're not key. */
   136     if (SDL_GetMouseFocus() == _data->window) {
   137         SDL_SetMouseFocus(NULL);
   138     }
   139 
   140     /* Some other window will get keyboard events, since we're not key. */
   141     if (SDL_GetKeyboardFocus() == _data->window) {
   142         SDL_SetKeyboardFocus(NULL);
   143     }
   144 }
   145 
   146 - (void)windowDidHide:(NSNotification *)aNotification
   147 {
   148     SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
   149 }
   150 
   151 - (void)windowDidUnhide:(NSNotification *)aNotification
   152 {
   153     SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
   154 }
   155 
   156 - (void)mouseDown:(NSEvent *)theEvent
   157 {
   158     int button;
   159 
   160     switch ([theEvent buttonNumber]) {
   161     case 0:
   162         button = SDL_BUTTON_LEFT;
   163         break;
   164     case 1:
   165         button = SDL_BUTTON_RIGHT;
   166         break;
   167     case 2:
   168         button = SDL_BUTTON_MIDDLE;
   169         break;
   170     default:
   171         button = [theEvent buttonNumber];
   172         break;
   173     }
   174     SDL_SendMouseButton(SDL_PRESSED, button);
   175 }
   176 
   177 - (void)rightMouseDown:(NSEvent *)theEvent
   178 {
   179     [self mouseDown:theEvent];
   180 }
   181 
   182 - (void)otherMouseDown:(NSEvent *)theEvent
   183 {
   184     [self mouseDown:theEvent];
   185 }
   186 
   187 - (void)mouseUp:(NSEvent *)theEvent
   188 {
   189     int button;
   190 
   191     switch ([theEvent buttonNumber]) {
   192     case 0:
   193         button = SDL_BUTTON_LEFT;
   194         break;
   195     case 1:
   196         button = SDL_BUTTON_RIGHT;
   197         break;
   198     case 2:
   199         button = SDL_BUTTON_MIDDLE;
   200         break;
   201     default:
   202         button = [theEvent buttonNumber];
   203         break;
   204     }
   205     SDL_SendMouseButton(SDL_RELEASED, button);
   206 }
   207 
   208 - (void)rightMouseUp:(NSEvent *)theEvent
   209 {
   210     [self mouseUp:theEvent];
   211 }
   212 
   213 - (void)otherMouseUp:(NSEvent *)theEvent
   214 {
   215     [self mouseUp:theEvent];
   216 }
   217 
   218 - (void)mouseMoved:(NSEvent *)theEvent
   219 {
   220     SDL_Window *window = _data->window;
   221     NSPoint point;
   222 
   223     point = [theEvent locationInWindow];
   224     point.y = window->h - point.y;
   225     if ( point.x < 0 || point.x >= window->w ||
   226          point.y < 0 || point.y >= window->h ) {
   227         if (SDL_GetMouseFocus() == window) {
   228             SDL_SetMouseFocus(NULL);
   229         }
   230     } else {
   231         SDL_SetMouseFocus(_data->window);
   232         SDL_SendMouseMotion(0, (int)point.x, (int)point.y);
   233     }
   234 }
   235 
   236 - (void)mouseDragged:(NSEvent *)theEvent
   237 {
   238     [self mouseMoved:theEvent];
   239 }
   240 
   241 - (void)rightMouseDragged:(NSEvent *)theEvent
   242 {
   243     [self mouseMoved:theEvent];
   244 }
   245 
   246 - (void)otherMouseDragged:(NSEvent *)theEvent
   247 {
   248     [self mouseMoved:theEvent];
   249 }
   250 
   251 - (void)scrollWheel:(NSEvent *)theEvent
   252 {
   253     SDL_SendMouseWheel((int)([theEvent deltaX]+0.9f), (int)([theEvent deltaY]+0.9f));
   254 }
   255 
   256 @end
   257 
   258 @interface SDLWindow : NSWindow
   259 /* These are needed for borderless/fullscreen windows */
   260 - (BOOL)canBecomeKeyWindow;
   261 - (BOOL)canBecomeMainWindow;
   262 @end
   263 
   264 @implementation SDLWindow
   265 - (BOOL)canBecomeKeyWindow
   266 {
   267     return YES;
   268 }
   269 
   270 - (BOOL)canBecomeMainWindow
   271 {
   272     return YES;
   273 }
   274 @end
   275 
   276 static int
   277 SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created)
   278 {
   279     NSAutoreleasePool *pool;
   280     SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
   281     SDL_VideoDisplay *display = window->display;
   282     SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
   283     SDL_WindowData *data;
   284 
   285     /* Allocate the window data */
   286     data = (SDL_WindowData *) SDL_malloc(sizeof(*data));
   287     if (!data) {
   288         SDL_OutOfMemory();
   289         return -1;
   290     }
   291     data->window = window;
   292     data->nswindow = nswindow;
   293     data->created = created;
   294     data->display = displaydata->display;
   295     data->videodata = videodata;
   296 
   297     pool = [[NSAutoreleasePool alloc] init];
   298 
   299     /* Create an event listener for the window */
   300     data->listener = [[Cocoa_WindowListener alloc] init];
   301     [data->listener listen:data];
   302 
   303     /* Fill in the SDL window with the window data */
   304     {
   305         SDL_Rect bounds;
   306         NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
   307         ConvertNSRect(&rect);
   308         Cocoa_GetDisplayBounds(_this, display, &bounds);
   309         window->x = (int)rect.origin.x - bounds.x;
   310         window->y = (int)rect.origin.y - bounds.y;
   311         window->w = (int)rect.size.width;
   312         window->h = (int)rect.size.height;
   313     }
   314     if ([nswindow isVisible]) {
   315         window->flags |= SDL_WINDOW_SHOWN;
   316     } else {
   317         window->flags &= ~SDL_WINDOW_SHOWN;
   318     }
   319     {
   320         unsigned int style = [nswindow styleMask];
   321 
   322         if ((style & ~NSResizableWindowMask) == NSBorderlessWindowMask) {
   323             window->flags |= SDL_WINDOW_BORDERLESS;
   324         } else {
   325             window->flags &= ~SDL_WINDOW_BORDERLESS;
   326         }
   327         if (style & NSResizableWindowMask) {
   328             window->flags |= SDL_WINDOW_RESIZABLE;
   329         } else {
   330             window->flags &= ~SDL_WINDOW_RESIZABLE;
   331         }
   332     }
   333     if ([nswindow isZoomed]) {
   334         window->flags |= SDL_WINDOW_MAXIMIZED;
   335     } else {
   336         window->flags &= ~SDL_WINDOW_MAXIMIZED;
   337     }
   338     if ([nswindow isMiniaturized]) {
   339         window->flags |= SDL_WINDOW_MINIMIZED;
   340     } else {
   341         window->flags &= ~SDL_WINDOW_MINIMIZED;
   342     }
   343     if ([nswindow isKeyWindow]) {
   344         window->flags |= SDL_WINDOW_INPUT_FOCUS;
   345         SDL_SetKeyboardFocus(data->window);
   346 
   347         if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
   348             /* FIXME */
   349         }
   350     }
   351 
   352     /* All done! */
   353     [pool release];
   354     window->driverdata = data;
   355     return 0;
   356 }
   357 
   358 int
   359 Cocoa_CreateWindow(_THIS, SDL_Window * window)
   360 {
   361     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   362     NSWindow *nswindow;
   363     SDL_VideoDisplay *display = window->display;
   364     NSRect rect;
   365     SDL_Rect bounds;
   366     unsigned int style;
   367 
   368     Cocoa_GetDisplayBounds(_this, display, &bounds);
   369     if ((window->flags & SDL_WINDOW_FULLSCREEN)
   370         || window->x == SDL_WINDOWPOS_CENTERED) {
   371         rect.origin.x = bounds.x + (bounds.w - window->w) / 2;
   372     } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
   373         rect.origin.x = bounds.x;
   374     } else {
   375         rect.origin.x = bounds.x + window->x;
   376     }
   377     if ((window->flags & SDL_WINDOW_FULLSCREEN)
   378         || window->y == SDL_WINDOWPOS_CENTERED) {
   379         rect.origin.y = bounds.y + (bounds.h - window->h) / 2;
   380     } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
   381         rect.origin.y = bounds.y;
   382     } else {
   383         rect.origin.y = bounds.y + window->y;
   384     }
   385     rect.size.width = window->w;
   386     rect.size.height = window->h;
   387     ConvertNSRect(&rect);
   388 
   389     if (window->flags & SDL_WINDOW_BORDERLESS) {
   390         style = NSBorderlessWindowMask;
   391     } else {
   392         style = (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask);
   393     }
   394     if (window->flags & SDL_WINDOW_RESIZABLE) {
   395         style |= NSResizableWindowMask;
   396     }
   397 
   398     /* Figure out which screen to place this window */
   399     NSArray *screens = [NSScreen screens];
   400     NSScreen *screen = nil;
   401     NSScreen *candidate;
   402     int i, count = [screens count];
   403     for (i = 0; i < count; ++i) {
   404         candidate = [screens objectAtIndex:i];
   405         NSRect screenRect = [candidate frame];
   406         if (rect.origin.x >= screenRect.origin.x &&
   407             rect.origin.x < screenRect.origin.x + screenRect.size.width &&
   408             rect.origin.y >= screenRect.origin.y &&
   409             rect.origin.y < screenRect.origin.y + screenRect.size.height) {
   410             screen = candidate;
   411             rect.origin.x -= screenRect.origin.x;
   412             rect.origin.y -= screenRect.origin.y;
   413         }
   414     }
   415     nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:FALSE screen:screen];
   416 
   417     [pool release];
   418 
   419     if (SetupWindowData(_this, window, nswindow, SDL_TRUE) < 0) {
   420         [nswindow release];
   421         return -1;
   422     }
   423     return 0;
   424 }
   425 
   426 int
   427 Cocoa_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
   428 {
   429     NSAutoreleasePool *pool;
   430     NSWindow *nswindow = (NSWindow *) data;
   431     NSString *title;
   432 
   433     pool = [[NSAutoreleasePool alloc] init];
   434 
   435     /* Query the title from the existing window */
   436     title = [nswindow title];
   437     if (title) {
   438         window->title = SDL_strdup([title UTF8String]);
   439     }
   440 
   441     [pool release];
   442 
   443     return SetupWindowData(_this, window, nswindow, SDL_FALSE);
   444 }
   445 
   446 void
   447 Cocoa_SetWindowTitle(_THIS, SDL_Window * window)
   448 {
   449     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   450     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   451     NSString *string;
   452 
   453     if(window->title) {
   454         string = [[NSString alloc] initWithUTF8String:window->title];
   455     } else {
   456         string = [[NSString alloc] init];
   457     }
   458     [nswindow setTitle:string];
   459     [string release];
   460 
   461     [pool release];
   462 }
   463 
   464 void
   465 Cocoa_SetWindowPosition(_THIS, SDL_Window * window)
   466 {
   467     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   468     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   469     SDL_VideoDisplay *display = window->display;
   470     NSRect rect;
   471     SDL_Rect bounds;
   472 
   473     Cocoa_GetDisplayBounds(_this, display, &bounds);
   474     if ((window->flags & SDL_WINDOW_FULLSCREEN)
   475         || window->x == SDL_WINDOWPOS_CENTERED) {
   476         rect.origin.x = bounds.x + (bounds.w - window->w) / 2;
   477     } else {
   478         rect.origin.x = bounds.x + window->x;
   479     }
   480     if ((window->flags & SDL_WINDOW_FULLSCREEN)
   481         || window->y == SDL_WINDOWPOS_CENTERED) {
   482         rect.origin.y = bounds.y + (bounds.h - window->h) / 2;
   483     } else {
   484         rect.origin.y = bounds.y + window->y;
   485     }
   486     rect.size.width = window->w;
   487     rect.size.height = window->h;
   488     ConvertNSRect(&rect);
   489     rect = [nswindow frameRectForContentRect:rect];
   490     [nswindow setFrameOrigin:rect.origin];
   491     [pool release];
   492 }
   493 
   494 void
   495 Cocoa_SetWindowSize(_THIS, SDL_Window * window)
   496 {
   497     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   498     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   499     NSSize size;
   500 
   501     size.width = window->w;
   502     size.height = window->h;
   503     [nswindow setContentSize:size];
   504     [pool release];
   505 }
   506 
   507 void
   508 Cocoa_ShowWindow(_THIS, SDL_Window * window)
   509 {
   510     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   511     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   512 
   513     if (![nswindow isMiniaturized]) {
   514         [nswindow makeKeyAndOrderFront:nil];
   515     }
   516     [pool release];
   517 }
   518 
   519 void
   520 Cocoa_HideWindow(_THIS, SDL_Window * window)
   521 {
   522     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   523     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   524 
   525     [nswindow orderOut:nil];
   526     [pool release];
   527 }
   528 
   529 void
   530 Cocoa_RaiseWindow(_THIS, SDL_Window * window)
   531 {
   532     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   533     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   534 
   535     [nswindow makeKeyAndOrderFront:nil];
   536     [pool release];
   537 }
   538 
   539 void
   540 Cocoa_MaximizeWindow(_THIS, SDL_Window * window)
   541 {
   542     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   543     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   544 
   545     [nswindow zoom:nil];
   546     [pool release];
   547 }
   548 
   549 void
   550 Cocoa_MinimizeWindow(_THIS, SDL_Window * window)
   551 {
   552     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   553     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   554 
   555     [nswindow miniaturize:nil];
   556     [pool release];
   557 }
   558 
   559 void
   560 Cocoa_RestoreWindow(_THIS, SDL_Window * window)
   561 {
   562     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   563     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   564 
   565     if ([nswindow isMiniaturized]) {
   566         [nswindow deminiaturize:nil];
   567     } else if ([nswindow isZoomed]) {
   568         [nswindow zoom:nil];
   569     }
   570     [pool release];
   571 }
   572 
   573 void
   574 Cocoa_SetWindowGrab(_THIS, SDL_Window * window)
   575 {
   576     if ((window->flags & SDL_WINDOW_INPUT_GRABBED) &&
   577         (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
   578         /* FIXME: Grab mouse */
   579     } else {
   580         /* FIXME: Release mouse */
   581     }
   582 }
   583 
   584 void
   585 Cocoa_DestroyWindow(_THIS, SDL_Window * window)
   586 {
   587     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   588     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
   589 
   590     if (data) {
   591         [data->listener close];
   592         [data->listener release];
   593         if (data->created) {
   594             [data->nswindow close];
   595         }
   596         SDL_free(data);
   597     }
   598     [pool release];
   599 }
   600 
   601 SDL_bool
   602 Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
   603 {
   604     //NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
   605 
   606     if (info->version.major <= SDL_MAJOR_VERSION) {
   607         //info->window = nswindow;
   608         return SDL_TRUE;
   609     } else {
   610         SDL_SetError("Application not compiled with SDL %d.%d\n",
   611                      SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
   612         return SDL_FALSE;
   613     }
   614 }
   615 
   616 /* vi: set ts=4 sw=4 expandtab: */