zenilib: zenilib/jni/external/sdl/src/video/cocoa/SDL_cocoawindow.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_cocoawindow.h
Go to the documentation of this file.
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21 #include "SDL_config.h"
22
23 #ifndef _SDL_cocoawindow_h
24 #define _SDL_cocoawindow_h
25
26 #import <Cocoa/Cocoa.h>
27
28 typedef struct SDL_WindowData SDL_WindowData;
29
30 @interface Cocoa_WindowListener : NSResponder <NSWindowDelegate> {
31 SDL_WindowData *_data;
32 BOOL observingVisible;
33 BOOL wasCtrlLeft;
34 BOOL wasVisible;
35 }
36
37 -(void) listen:(SDL_WindowData *) data;
38 -(void) pauseVisibleObservation;
39 -(void) resumeVisibleObservation;
40 -(void) close;
41
42 /* Window delegate functionality */
43 -(BOOL) windowShouldClose:(id) sender;
44 -(void) windowDidExpose:(NSNotification *) aNotification;
45 -(void) windowDidMove:(NSNotification *) aNotification;
46 -(void) windowDidResize:(NSNotification *) aNotification;
47 -(void) windowDidMiniaturize:(NSNotification *) aNotification;
48 -(void) windowDidDeminiaturize:(NSNotification *) aNotification;
49 -(void) windowDidBecomeKey:(NSNotification *) aNotification;
50 -(void) windowDidResignKey:(NSNotification *) aNotification;
51
52 /* Window event handling */
53 -(void) mouseDown:(NSEvent *) theEvent;
54 -(void) rightMouseDown:(NSEvent *) theEvent;
55 -(void) otherMouseDown:(NSEvent *) theEvent;
56 -(void) mouseUp:(NSEvent *) theEvent;
57 -(void) rightMouseUp:(NSEvent *) theEvent;
58 -(void) otherMouseUp:(NSEvent *) theEvent;
59 -(void) mouseMoved:(NSEvent *) theEvent;
60 -(void) mouseDragged:(NSEvent *) theEvent;
61 -(void) rightMouseDragged:(NSEvent *) theEvent;
62 -(void) otherMouseDragged:(NSEvent *) theEvent;
63 -(void) scrollWheel:(NSEvent *) theEvent;
64 -(void) touchesBeganWithEvent:(NSEvent *) theEvent;
65 -(void) touchesMovedWithEvent:(NSEvent *) theEvent;
66 -(void) touchesEndedWithEvent:(NSEvent *) theEvent;
67 -(void) touchesCancelledWithEvent:(NSEvent *) theEvent;
68
69 /* Touch event handling */
70 typedef enum {
71 COCOA_TOUCH_DOWN,
72 COCOA_TOUCH_UP,
73 COCOA_TOUCH_MOVE,
74 COCOA_TOUCH_CANCELLED
75 } cocoaTouchType;
76 -(void) handleTouches:(cocoaTouchType)type withEvent:(NSEvent*) event;
77
78 @end
79 /* *INDENT-ON* */
80
81 @class SDLOpenGLContext;
82
83 struct SDL_WindowData
84 {
85 SDL_Window *window;
86 NSWindow *nswindow;
87 NSMutableArray *nscontexts;
88 SDL_bool created;
89 Cocoa_WindowListener *listener;
90 struct SDL_VideoData *videodata;
91 };
92
93 extern int Cocoa_CreateWindow(_THIS, SDL_Window * window);
94 extern int Cocoa_CreateWindowFrom(_THIS, SDL_Window * window,
95 const void *data);
96 extern void Cocoa_SetWindowTitle(_THIS, SDL_Window * window);
97 extern void Cocoa_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
98 extern void Cocoa_SetWindowPosition(_THIS, SDL_Window * window);
99 extern void Cocoa_SetWindowSize(_THIS, SDL_Window * window);
100 extern void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window);
101 extern void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window * window);
102 extern void Cocoa_ShowWindow(_THIS, SDL_Window * window);
103 extern void Cocoa_HideWindow(_THIS, SDL_Window * window);
104 extern void Cocoa_RaiseWindow(_THIS, SDL_Window * window);
105 extern void Cocoa_MaximizeWindow(_THIS, SDL_Window * window);
106 extern void Cocoa_MinimizeWindow(_THIS, SDL_Window * window);
107 extern void Cocoa_RestoreWindow(_THIS, SDL_Window * window);
108 extern void Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
109 extern void Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
110 extern int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
111 extern int Cocoa_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
112 extern void Cocoa_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
113 extern void Cocoa_DestroyWindow(_THIS, SDL_Window * window);
114 extern SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window,
115 struct SDL_SysWMinfo *info);
116
117 #endif /* _SDL_cocoawindow_h */
118
119 /* vi: set ts=4 sw=4 expandtab: */
Cocoa_CreateWindowFrom
int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
SDL_WindowData::nscontexts
NSMutableArray * nscontexts
Definition: SDL_cocoawindow.h:87
void
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
Definition: glew.h:1824
Cocoa_MinimizeWindow
void Cocoa_MinimizeWindow(_THIS, SDL_Window *window)
Cocoa_SetWindowIcon
void Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
Cocoa_SetWindowMaximumSize
void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window)
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:116
Cocoa_SetWindowBordered
void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
Cocoa_WindowListener::observingVisible
BOOL observingVisible
Definition: SDL_cocoawindow.h:32
Cocoa_WindowListener
Definition: SDL_cocoawindow.h:30
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
Cocoa_WindowListener::wasCtrlLeft
BOOL wasCtrlLeft
Definition: SDL_cocoawindow.h:33
Cocoa_SetWindowTitle
void Cocoa_SetWindowTitle(_THIS, SDL_Window *window)
Cocoa_WindowListener::COCOA_TOUCH_MOVE
Definition: SDL_cocoawindow.h:73
SDL_WindowData::window
SDL_Window * window
Definition: SDL_cocoawindow.h:85
display
char * display
Definition: visualinfo.c:85
Cocoa_SetWindowPosition
void Cocoa_SetWindowPosition(_THIS, SDL_Window *window)
SDL_config.h
SDL_WindowData
Definition: SDL_androidwindow.h:33
Cocoa_RestoreWindow
void Cocoa_RestoreWindow(_THIS, SDL_Window *window)
Cocoa_ShowWindow
void Cocoa_ShowWindow(_THIS, SDL_Window *window)
SDL_SysWMinfo
Definition: SDL_syswm.h:159
SDL_WindowData::listener
Cocoa_WindowListener * listener
Definition: SDL_cocoawindow.h:89
_THIS
#define _THIS
Definition: SDL_alsa_audio.h:31
SDL_WindowData::videodata
struct SDL_VideoData * videodata
Definition: SDL_cocoawindow.h:90
Cocoa_SetWindowGammaRamp
int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window *window, const Uint16 *ramp)
Cocoa_DestroyWindow
void Cocoa_DestroyWindow(_THIS, SDL_Window *window)
Cocoa_RaiseWindow
void Cocoa_RaiseWindow(_THIS, SDL_Window *window)
Cocoa_GetWindowWMInfo
SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
Cocoa_WindowListener::COCOA_TOUCH_UP
Definition: SDL_cocoawindow.h:72
Cocoa_WindowListener::_data
SDL_WindowData * _data
Definition: SDL_cocoawindow.h:31
Cocoa_SetWindowFullscreen
void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
SDL_WindowData::nswindow
NSWindow * nswindow
Definition: SDL_cocoawindow.h:86
SDL_VideoDisplay
Definition: SDL_sysvideo.h:113
Cocoa_CreateWindow
int Cocoa_CreateWindow(_THIS, SDL_Window *window)
Cocoa_GetWindowGammaRamp
int Cocoa_GetWindowGammaRamp(_THIS, SDL_Window *window, Uint16 *ramp)
Cocoa_WindowListener::wasVisible
BOOL wasVisible
Definition: SDL_cocoawindow.h:34
SDL_Window
Definition: SDL_sysvideo.h:71
Cocoa_SetWindowSize
void Cocoa_SetWindowSize(_THIS, SDL_Window *window)
Cocoa_WindowListener::COCOA_TOUCH_DOWN
Definition: SDL_cocoawindow.h:71
SDL_VideoData
Definition: SDL_androidvideo.h:35
SDL_WindowData::created
SDL_bool created
Definition: SDL_cocoawindow.h:88
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:137
Cocoa_HideWindow
void Cocoa_HideWindow(_THIS, SDL_Window *window)
Cocoa_SetWindowGrab
void Cocoa_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
Cocoa_MaximizeWindow
void Cocoa_MaximizeWindow(_THIS, SDL_Window *window)
Cocoa_SetWindowMinimumSize
void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window)
BOOL
typedef BOOL(WINAPI *PFNWGLSETSTEREOEMITTERSTATE3DLPROC)(HDC hDC