src/video/cocoa/SDL_cocoawindow.h
changeset 1933 7ee5297340f7
child 1936 83946ee0ff1f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.h	Mon Jul 24 05:03:02 2006 +0000
     1.3 @@ -0,0 +1,89 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2006 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#ifndef _SDL_cocoawindow_h
    1.28 +#define _SDL_cocoawindow_h
    1.29 +
    1.30 +typedef struct SDL_WindowData SDL_WindowData;
    1.31 +
    1.32 +@interface Cocoa_WindowListener:NSResponder {
    1.33 +    SDL_WindowData *_data;
    1.34 +}
    1.35 +
    1.36 +-(void) listen:(SDL_WindowData *) data;
    1.37 +-(void) close;
    1.38 +
    1.39 +/* Window delegate functionality */
    1.40 +-(BOOL) windowShouldClose:(id) sender;
    1.41 +-(void) windowDidExpose:(NSNotification *) aNotification;
    1.42 +-(void) windowDidMove:(NSNotification *) aNotification;
    1.43 +-(void) windowDidResize:(NSNotification *) aNotification;
    1.44 +-(void) windowDidMiniaturize:(NSNotification *) aNotification;
    1.45 +-(void) windowDidDeminiaturize:(NSNotification *) aNotification;
    1.46 +-(void) windowDidBecomeKey:(NSNotification *) aNotification;
    1.47 +-(void) windowDidResignKey:(NSNotification *) aNotification;
    1.48 +-(void) windowDidHide:(NSNotification *) aNotification;
    1.49 +-(void) windowDidUnhide:(NSNotification *) aNotification;
    1.50 +
    1.51 +/* Window event handling */
    1.52 +-(void) mouseDown:(NSEvent *) theEvent;
    1.53 +-(void) rightMouseDown:(NSEvent *) theEvent;
    1.54 +-(void) otherMouseDown:(NSEvent *) theEvent;
    1.55 +-(void) mouseUp:(NSEvent *) theEvent;
    1.56 +-(void) rightMouseUp:(NSEvent *) theEvent;
    1.57 +-(void) otherMouseUp:(NSEvent *) theEvent;
    1.58 +-(void) mouseMoved:(NSEvent *) theEvent;
    1.59 +-(void) scrollWheel:(NSEvent *) theEvent;
    1.60 +-(void) mouseEntered:(NSEvent *) theEvent;
    1.61 +-(void) mouseExited:(NSEvent *) theEvent;
    1.62 +-(void) keyDown:(NSEvent *) theEvent;
    1.63 +-(void) keyUp:(NSEvent *) theEvent;
    1.64 +@end struct SDL_WindowData
    1.65 +{
    1.66 +    SDL_WindowID windowID;
    1.67 +    NSWindow *window;
    1.68 +    BOOL created;
    1.69 +    Cocoa_WindowListener *listener;
    1.70 +    struct SDL_VideoData *videodata;
    1.71 +};
    1.72 +
    1.73 +extern int Cocoa_CreateWindow(_THIS, SDL_Window * window);
    1.74 +extern int Cocoa_CreateWindowFrom(_THIS, SDL_Window * window,
    1.75 +                                  const void *data);
    1.76 +extern void Cocoa_SetWindowTitle(_THIS, SDL_Window * window);
    1.77 +extern void Cocoa_SetWindowPosition(_THIS, SDL_Window * window);
    1.78 +extern void Cocoa_SetWindowSize(_THIS, SDL_Window * window);
    1.79 +extern void Cocoa_ShowWindow(_THIS, SDL_Window * window);
    1.80 +extern void Cocoa_HideWindow(_THIS, SDL_Window * window);
    1.81 +extern void Cocoa_RaiseWindow(_THIS, SDL_Window * window);
    1.82 +extern void Cocoa_MaximizeWindow(_THIS, SDL_Window * window);
    1.83 +extern void Cocoa_MinimizeWindow(_THIS, SDL_Window * window);
    1.84 +extern void Cocoa_RestoreWindow(_THIS, SDL_Window * window);
    1.85 +extern void Cocoa_SetWindowGrab(_THIS, SDL_Window * window);
    1.86 +extern void Cocoa_DestroyWindow(_THIS, SDL_Window * window);
    1.87 +extern SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window,
    1.88 +                                      struct SDL_SysWMinfo *info);
    1.89 +
    1.90 +#endif /* _SDL_cocoawindow_h */
    1.91 +
    1.92 +/* vi: set ts=4 sw=4 expandtab: */