src/video/cocoa/SDL_cocoawindow.h
author Sam Lantinga <slouken@libsdl.org>
Thu, 27 Jul 2006 06:53:23 +0000
changeset 1951 7177581dc9fa
parent 1936 83946ee0ff1f
child 1956 ba0d62354872
permissions -rw-r--r--
Initial work on X11 window code in.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2006 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 #ifndef _SDL_cocoawindow_h
    25 #define _SDL_cocoawindow_h
    26 
    27 typedef struct SDL_WindowData SDL_WindowData;
    28 
    29 /* *INDENT-OFF* */
    30 @interface Cocoa_WindowListener:NSResponder {
    31     SDL_WindowData *_data;
    32 }
    33 
    34 -(void) listen:(SDL_WindowData *) data;
    35 -(void) close;
    36 
    37 /* Window delegate functionality */
    38 -(BOOL) windowShouldClose:(id) sender;
    39 -(void) windowDidExpose:(NSNotification *) aNotification;
    40 -(void) windowDidMove:(NSNotification *) aNotification;
    41 -(void) windowDidResize:(NSNotification *) aNotification;
    42 -(void) windowDidMiniaturize:(NSNotification *) aNotification;
    43 -(void) windowDidDeminiaturize:(NSNotification *) aNotification;
    44 -(void) windowDidBecomeKey:(NSNotification *) aNotification;
    45 -(void) windowDidResignKey:(NSNotification *) aNotification;
    46 -(void) windowDidHide:(NSNotification *) aNotification;
    47 -(void) windowDidUnhide:(NSNotification *) aNotification;
    48 
    49 /* Window event handling */
    50 -(void) mouseDown:(NSEvent *) theEvent;
    51 -(void) rightMouseDown:(NSEvent *) theEvent;
    52 -(void) otherMouseDown:(NSEvent *) theEvent;
    53 -(void) mouseUp:(NSEvent *) theEvent;
    54 -(void) rightMouseUp:(NSEvent *) theEvent;
    55 -(void) otherMouseUp:(NSEvent *) theEvent;
    56 -(void) mouseMoved:(NSEvent *) theEvent;
    57 -(void) scrollWheel:(NSEvent *) theEvent;
    58 -(void) mouseEntered:(NSEvent *) theEvent;
    59 -(void) mouseExited:(NSEvent *) theEvent;
    60 -(void) keyDown:(NSEvent *) theEvent;
    61 -(void) keyUp:(NSEvent *) theEvent;
    62 @end
    63 /* *INDENT-ON* */
    64 
    65 struct SDL_WindowData
    66 {
    67     SDL_WindowID windowID;
    68     NSWindow *window;
    69     SDL_bool created;
    70     Cocoa_WindowListener *listener;
    71     struct SDL_VideoData *videodata;
    72 };
    73 
    74 extern int Cocoa_CreateWindow(_THIS, SDL_Window * window);
    75 extern int Cocoa_CreateWindowFrom(_THIS, SDL_Window * window,
    76                                   const void *data);
    77 extern void Cocoa_SetWindowTitle(_THIS, SDL_Window * window);
    78 extern void Cocoa_SetWindowPosition(_THIS, SDL_Window * window);
    79 extern void Cocoa_SetWindowSize(_THIS, SDL_Window * window);
    80 extern void Cocoa_ShowWindow(_THIS, SDL_Window * window);
    81 extern void Cocoa_HideWindow(_THIS, SDL_Window * window);
    82 extern void Cocoa_RaiseWindow(_THIS, SDL_Window * window);
    83 extern void Cocoa_MaximizeWindow(_THIS, SDL_Window * window);
    84 extern void Cocoa_MinimizeWindow(_THIS, SDL_Window * window);
    85 extern void Cocoa_RestoreWindow(_THIS, SDL_Window * window);
    86 extern void Cocoa_SetWindowGrab(_THIS, SDL_Window * window);
    87 extern void Cocoa_DestroyWindow(_THIS, SDL_Window * window);
    88 extern SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window,
    89                                       struct SDL_SysWMinfo *info);
    90 
    91 #endif /* _SDL_cocoawindow_h */
    92 
    93 /* vi: set ts=4 sw=4 expandtab: */