146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/*
246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    SDL - Simple DirectMedia Layer
346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Copyright (C) 1997-2003  Sam Lantinga
446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    This library is free software; you can redistribute it and/or
646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    modify it under the terms of the GNU Library General Public
746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    License as published by the Free Software Foundation; either
846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    version 2 of the License, or (at your option) any later version.
946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
1046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    This library is distributed in the hope that it will be useful,
1146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    but WITHOUT ANY WARRANTY; without even the implied warranty of
1246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Library General Public License for more details.
1446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
1546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    You should have received a copy of the GNU Library General Public
1646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    License along with this library; if not, write to the Free
1746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
1946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Sam Lantinga
2046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    slouken@libsdl.org
2146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner*/
2246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "SDL_config.h"
2346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
2446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/*
2546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    @file   SDL_QuartzVideo.h
2646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    @author Darrell Walisser, Max Horn, et al.
2746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
2846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    @abstract SDL video driver for Mac OS X.
2946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
3046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    @discussion
3146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
3246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    TODO
3346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Hardware Cursor support with NSCursor instead of Carbon
3446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Keyboard repeat/mouse speed adjust (if needed)
3546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Multiple monitor support (currently only main display)
3646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Accelerated blitting support
3746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Fix white OpenGL window on minimize (fixed) (update: broken again on 10.2)
3846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Find out what events should be sent/ignored if window is minimized
3946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Find a way to deal with external resolution/depth switch while app is running
4046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Check accuracy of QZ_SetGamma()
4146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Problems:
4246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - OGL not working in full screen with software renderer
4346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - SetColors sets palette correctly but clears framebuffer
4446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Crash in CG after several mode switches (I think this has been fixed)
4546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Retained windows don't draw their title bar quite right (OS Bug) (not using retained windows)
4646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Cursor in 8 bit modes is screwy (might just be Radeon PCI bug) (update: not just Radeon)
4746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner        - Warping cursor delays mouse events for a fraction of a second,
4846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner          there is a hack around this that helps a bit
4946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner*/
5046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
5146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Needs to be first, so QuickTime.h doesn't include glext.h (10.4) */
5246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "SDL_opengl.h"
5346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
5446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <Cocoa/Cocoa.h>
5546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <Carbon/Carbon.h>
5646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <QuickTime/QuickTime.h>
5746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <OpenGL/OpenGL.h>	/* For CGL functions and types */
5846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <IOKit/IOKitLib.h>	/* For powersave handling */
5946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <pthread.h>
6046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
6146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "SDL_thread.h"
6246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "SDL_video.h"
6346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "SDL_error.h"
6446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "SDL_timer.h"
6546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "SDL_loadso.h"
6646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "SDL_syswm.h"
6746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "../SDL_sysvideo.h"
6846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "../SDL_pixels_c.h"
6946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include "../../events/SDL_events_c.h"
7046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
7146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/*
7246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    This is a workaround to directly access NSOpenGLContext's CGL context
7346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    We need this to check for errors NSOpenGLContext doesn't support
7446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner*/
7546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner@interface NSOpenGLContext (CGLContextAccess)
7646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner- (CGLContextObj) cglContext;
7746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner@end
7846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
7946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
8046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Main driver structure to store required state information */
8146be48730333120a7b939116cef075e61c12c703David 'Digit' Turnertypedef struct SDL_PrivateVideoData {
8246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
8346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    BOOL               allow_screensaver;  /* 0 == disable screensaver */
8446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    CGDirectDisplayID  display;            /* 0 == main display (only support single display) */
8546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    CFDictionaryRef    mode;               /* current mode of the display */
8646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    CFDictionaryRef    save_mode;          /* original mode of the display */
8746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    CFArrayRef         mode_list;          /* list of available fullscreen modes */
8846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    CGDirectPaletteRef palette;            /* palette of an 8-bit display */
8946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    NSOpenGLContext    *gl_context;        /* OpenGL rendering context */
9046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint32             width, height, bpp; /* frequently used data about the display */
9146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint32             flags;              /* flags for current mode, for teardown purposes */
9246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint32             video_set;          /* boolean; indicates if video was set correctly */
9346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint32             warp_flag;          /* boolean; notify to event loop that a warp just occured */
9446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint32             warp_ticks;         /* timestamp when the warp occured */
9546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    NSWindow           *window;            /* Cocoa window to implement the SDL window */
9646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    NSQuickDrawView    *view;              /* the window's view; draw 2D and OpenGL into this view */
9746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    SDL_Surface        *resize_icon;       /* icon for the resize badge, we have to draw it by hand */
9846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    SDL_GrabMode       current_grab_mode;  /* default value is SDL_GRAB_OFF */
9946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    SDL_Rect           **client_mode_list; /* resolution list to pass back to client */
10046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    SDLKey             keymap[256];        /* Mac OS X to SDL key mapping */
10146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint32             current_mods;       /* current keyboard modifiers, to track modifier state */
10246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    NSText             *field_edit;        /* a field editor for keyboard composition processing */
10346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint32             last_virtual_button;/* last virtual mouse button pressed */
10446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    io_connect_t       power_connection;   /* used with IOKit to detect wake from sleep */
10546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint8              expect_mouse_up;    /* used to determine when to send mouse up events */
10646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint8              grab_state;         /* used to manage grab behavior */
10746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    NSPoint            cursor_loc;         /* saved cursor coords, for activate/deactivate when grabbed */
10846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    BOOL               cursor_should_be_visible;     /* tells if cursor is supposed to be visible (SDL_ShowCursor) */
10946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    BOOL               cursor_visible;     /* tells if cursor is *actually* visible or not */
11046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint8*             sw_buffers[2];      /* pointers to the two software buffers for double-buffer emulation */
11146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    SDL_Thread         *thread;            /* thread for async updates to the screen */
11246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    SDL_sem            *sem1, *sem2;       /* synchronization for async screen updates */
11346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Uint8              *current_buffer;    /* the buffer being copied to the screen */
11446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    BOOL               quit_thread;        /* used to quit the async blitting thread */
11546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    SInt32             system_version;     /* used to dis-/enable workarounds depending on the system version */
11646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
11746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    ImageDescriptionHandle yuv_idh;
11846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    MatrixRecordPtr        yuv_matrix;
11946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    DecompressorComponent  yuv_codec;
12046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    ImageSequence          yuv_seq;
12146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    PlanarPixmapInfoYUV420 *yuv_pixmap;
12246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    Sint16                  yuv_width, yuv_height;
12346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    CGrafPtr                yuv_port;
12446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
12546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    void *opengl_library;    /* dynamically loaded OpenGL library. */
12646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner} SDL_PrivateVideoData;
12746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
12846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define _THIS    SDL_VideoDevice *this
12946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define display_id (this->hidden->display)
13046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define mode (this->hidden->mode)
13146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define save_mode (this->hidden->save_mode)
13246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define allow_screensaver (this->hidden->allow_screensaver)
13346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define mode_list (this->hidden->mode_list)
13446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define palette (this->hidden->palette)
13546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define gl_context (this->hidden->gl_context)
13646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define device_width (this->hidden->width)
13746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define device_height (this->hidden->height)
13846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define device_bpp (this->hidden->bpp)
13946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define mode_flags (this->hidden->flags)
14046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define qz_window (this->hidden->window)
14146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define window_view (this->hidden->view)
14246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define video_set (this->hidden->video_set)
14346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define warp_ticks (this->hidden->warp_ticks)
14446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define warp_flag (this->hidden->warp_flag)
14546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define resize_icon (this->hidden->resize_icon)
14646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define current_grab_mode (this->hidden->current_grab_mode)
14746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define client_mode_list (this->hidden->client_mode_list)
14846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define keymap (this->hidden->keymap)
14946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define current_mods (this->hidden->current_mods)
15046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define field_edit (this->hidden->field_edit)
15146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define last_virtual_button (this->hidden->last_virtual_button)
15246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define power_connection (this->hidden->power_connection)
15346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define expect_mouse_up (this->hidden->expect_mouse_up)
15446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define grab_state (this->hidden->grab_state)
15546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define cursor_loc (this->hidden->cursor_loc)
15646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define cursor_should_be_visible (this->hidden->cursor_should_be_visible)
15746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define cursor_visible (this->hidden->cursor_visible)
15846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define sw_buffers (this->hidden->sw_buffers)
15946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define thread (this->hidden->thread)
16046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define sem1 (this->hidden->sem1)
16146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define sem2 (this->hidden->sem2)
16246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define current_buffer (this->hidden->current_buffer)
16346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define quit_thread (this->hidden->quit_thread)
16446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define system_version (this->hidden->system_version)
16546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define opengl_library (this->hidden->opengl_library)
16646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
16746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* grab states - the input is in one of these states */
16846be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerenum {
16946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    QZ_UNGRABBED = 0,
17046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    QZ_VISIBLE_GRAB,
17146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    QZ_INVISIBLE_GRAB
17246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner};
17346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
17446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* grab actions - these can change the grabbed state */
17546be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerenum {
17646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    QZ_ENABLE_GRAB = 0,
17746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    QZ_DISABLE_GRAB,
17846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    QZ_HIDECURSOR,
17946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner    QZ_SHOWCURSOR
18046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner};
18146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
18246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Gamma Functions */
18346be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint    QZ_SetGamma          (_THIS, float red, float green, float blue);
18446be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint    QZ_GetGamma          (_THIS, float *red, float *green, float *blue);
18546be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint    QZ_SetGammaRamp      (_THIS, Uint16 *ramp);
18646be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint    QZ_GetGammaRamp      (_THIS, Uint16 *ramp);
18746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
18846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* OpenGL functions */
18946be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint    QZ_SetupOpenGL       (_THIS, int bpp, Uint32 flags);
19046be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid   QZ_TearDownOpenGL    (_THIS);
19146be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid*  QZ_GL_GetProcAddress (_THIS, const char *proc);
19246be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint    QZ_GL_GetAttribute   (_THIS, SDL_GLattr attrib, int* value);
19346be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint    QZ_GL_MakeCurrent    (_THIS);
19446be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid   QZ_GL_SwapBuffers    (_THIS);
19546be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint    QZ_GL_LoadLibrary    (_THIS, const char *location);
19646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
19746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Cursor and Mouse functions */
19846be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_FreeWMCursor     (_THIS, WMcursor *cursor);
19946be48730333120a7b939116cef075e61c12c703David 'Digit' TurnerWMcursor*    QZ_CreateWMCursor   (_THIS, Uint8 *data, Uint8 *mask,
20046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner                                  int w, int h, int hot_x, int hot_y);
20146be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint          QZ_ShowWMCursor     (_THIS, WMcursor *cursor);
20246be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_WarpWMCursor     (_THIS, Uint16 x, Uint16 y);
20346be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_MoveWMCursor     (_THIS, int x, int y);
20446be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_CheckMouseMode   (_THIS);
20546be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_UpdateMouse      (_THIS);
20646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
20746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Event functions */
20846be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_InitOSKeymap     (_THIS);
20946be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_PumpEvents       (_THIS);
21046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
21146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Window Manager functions */
21246be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_SetCaption       (_THIS, const char *title, const char *icon);
21346be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_SetIcon          (_THIS, SDL_Surface *icon, Uint8 *mask);
21446be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint          QZ_IconifyWindow    (_THIS);
21546be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_SetWindowPos     (_THIS, int  x, int  y);
21646be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_GetWindowPos     (_THIS, int  *px, int  *py);
21746be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint          QZ_IsWindowVisible  (_THIS, int  recenter);
21846be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint          QZ_GetMonitorDPI    (_THIS, int  *xDpi, int *yDpi);
21946be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint          QZ_GetMonitorRect   (_THIS, SDL_Rect  *rect);
22046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
22146be48730333120a7b939116cef075e61c12c703David 'Digit' TurnerSDL_GrabMode QZ_GrabInput        (_THIS, SDL_GrabMode grab_mode);
22246be48730333120a7b939116cef075e61c12c703David 'Digit' Turnerint          QZ_GetWMInfo        (_THIS, SDL_SysWMinfo *info);
22346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
22446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* YUV functions */
22546be48730333120a7b939116cef075e61c12c703David 'Digit' TurnerSDL_Overlay* QZ_CreateYUVOverlay (_THIS, int width, int height,
22646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner                                         Uint32 format, SDL_Surface *display);
22746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
22846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner
22946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Private functions (used internally) */
23046be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_PrivateWarpCursor (_THIS, int x, int y);
23146be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_ChangeGrabState (_THIS, int action);
23246be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_RegisterForSleepNotifications (_THIS);
23346be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_PrivateGlobalToLocal (_THIS, NSPoint *p);
23446be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_PrivateCocoaToSDL (_THIS, NSPoint *p);
23546be48730333120a7b939116cef075e61c12c703David 'Digit' TurnerBOOL         QZ_IsMouseInWindow (_THIS);
23646be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_DoActivate (_THIS);
23746be48730333120a7b939116cef075e61c12c703David 'Digit' Turnervoid         QZ_DoDeactivate (_THIS);
238