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.
slouken@1933
     1
/*
slouken@1933
     2
    SDL - Simple DirectMedia Layer
slouken@1933
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@1933
     4
slouken@1933
     5
    This library is free software; you can redistribute it and/or
slouken@1933
     6
    modify it under the terms of the GNU Lesser General Public
slouken@1933
     7
    License as published by the Free Software Foundation; either
slouken@1933
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@1933
     9
slouken@1933
    10
    This library is distributed in the hope that it will be useful,
slouken@1933
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@1933
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1933
    13
    Lesser General Public License for more details.
slouken@1933
    14
slouken@1933
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1933
    16
    License along with this library; if not, write to the Free Software
slouken@1933
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@1933
    18
slouken@1933
    19
    Sam Lantinga
slouken@1933
    20
    slouken@libsdl.org
slouken@1933
    21
*/
slouken@1933
    22
#include "SDL_config.h"
slouken@1933
    23
slouken@1933
    24
#ifndef _SDL_cocoawindow_h
slouken@1933
    25
#define _SDL_cocoawindow_h
slouken@1933
    26
slouken@1933
    27
typedef struct SDL_WindowData SDL_WindowData;
slouken@1933
    28
slouken@1936
    29
/* *INDENT-OFF* */
slouken@1933
    30
@interface Cocoa_WindowListener:NSResponder {
slouken@1933
    31
    SDL_WindowData *_data;
slouken@1933
    32
}
slouken@1933
    33
slouken@1933
    34
-(void) listen:(SDL_WindowData *) data;
slouken@1933
    35
-(void) close;
slouken@1933
    36
slouken@1933
    37
/* Window delegate functionality */
slouken@1933
    38
-(BOOL) windowShouldClose:(id) sender;
slouken@1933
    39
-(void) windowDidExpose:(NSNotification *) aNotification;
slouken@1933
    40
-(void) windowDidMove:(NSNotification *) aNotification;
slouken@1933
    41
-(void) windowDidResize:(NSNotification *) aNotification;
slouken@1933
    42
-(void) windowDidMiniaturize:(NSNotification *) aNotification;
slouken@1933
    43
-(void) windowDidDeminiaturize:(NSNotification *) aNotification;
slouken@1933
    44
-(void) windowDidBecomeKey:(NSNotification *) aNotification;
slouken@1933
    45
-(void) windowDidResignKey:(NSNotification *) aNotification;
slouken@1933
    46
-(void) windowDidHide:(NSNotification *) aNotification;
slouken@1933
    47
-(void) windowDidUnhide:(NSNotification *) aNotification;
slouken@1933
    48
slouken@1933
    49
/* Window event handling */
slouken@1933
    50
-(void) mouseDown:(NSEvent *) theEvent;
slouken@1933
    51
-(void) rightMouseDown:(NSEvent *) theEvent;
slouken@1933
    52
-(void) otherMouseDown:(NSEvent *) theEvent;
slouken@1933
    53
-(void) mouseUp:(NSEvent *) theEvent;
slouken@1933
    54
-(void) rightMouseUp:(NSEvent *) theEvent;
slouken@1933
    55
-(void) otherMouseUp:(NSEvent *) theEvent;
slouken@1933
    56
-(void) mouseMoved:(NSEvent *) theEvent;
slouken@1933
    57
-(void) scrollWheel:(NSEvent *) theEvent;
slouken@1933
    58
-(void) mouseEntered:(NSEvent *) theEvent;
slouken@1933
    59
-(void) mouseExited:(NSEvent *) theEvent;
slouken@1933
    60
-(void) keyDown:(NSEvent *) theEvent;
slouken@1933
    61
-(void) keyUp:(NSEvent *) theEvent;
slouken@1936
    62
@end
slouken@1936
    63
/* *INDENT-ON* */
slouken@1936
    64
slouken@1936
    65
struct SDL_WindowData
slouken@1933
    66
{
slouken@1933
    67
    SDL_WindowID windowID;
slouken@1933
    68
    NSWindow *window;
slouken@1951
    69
    SDL_bool created;
slouken@1933
    70
    Cocoa_WindowListener *listener;
slouken@1933
    71
    struct SDL_VideoData *videodata;
slouken@1933
    72
};
slouken@1933
    73
slouken@1933
    74
extern int Cocoa_CreateWindow(_THIS, SDL_Window * window);
slouken@1933
    75
extern int Cocoa_CreateWindowFrom(_THIS, SDL_Window * window,
slouken@1933
    76
                                  const void *data);
slouken@1933
    77
extern void Cocoa_SetWindowTitle(_THIS, SDL_Window * window);
slouken@1933
    78
extern void Cocoa_SetWindowPosition(_THIS, SDL_Window * window);
slouken@1933
    79
extern void Cocoa_SetWindowSize(_THIS, SDL_Window * window);
slouken@1933
    80
extern void Cocoa_ShowWindow(_THIS, SDL_Window * window);
slouken@1933
    81
extern void Cocoa_HideWindow(_THIS, SDL_Window * window);
slouken@1933
    82
extern void Cocoa_RaiseWindow(_THIS, SDL_Window * window);
slouken@1933
    83
extern void Cocoa_MaximizeWindow(_THIS, SDL_Window * window);
slouken@1933
    84
extern void Cocoa_MinimizeWindow(_THIS, SDL_Window * window);
slouken@1933
    85
extern void Cocoa_RestoreWindow(_THIS, SDL_Window * window);
slouken@1933
    86
extern void Cocoa_SetWindowGrab(_THIS, SDL_Window * window);
slouken@1933
    87
extern void Cocoa_DestroyWindow(_THIS, SDL_Window * window);
slouken@1933
    88
extern SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window,
slouken@1933
    89
                                      struct SDL_SysWMinfo *info);
slouken@1933
    90
slouken@1933
    91
#endif /* _SDL_cocoawindow_h */
slouken@1933
    92
slouken@1933
    93
/* vi: set ts=4 sw=4 expandtab: */