src/video/wincommon/SDL_lowvideo.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 29 May 2006 04:04:35 +0000
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
permissions -rw-r--r--
more tweaking indent options
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@1312
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1312
    13
    Lesser General Public License for more details.
slouken@0
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@252
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@1402
    22
#include "SDL_config.h"
slouken@0
    23
slouken@0
    24
#ifndef _SDL_lowvideo_h
slouken@0
    25
#define _SDL_lowvideo_h
slouken@0
    26
slouken@1433
    27
#define WIN32_LEAN_AND_MEAN
slouken@1433
    28
#include <windows.h>
slouken@0
    29
slouken@1465
    30
#ifndef SetClassLongPtr
slouken@1465
    31
#define SetClassLongPtr	SetClassLong
slouken@1465
    32
#endif
slouken@1465
    33
#ifndef GetWindowLongPtr
slouken@1465
    34
#define GetWindowLongPtr	GetWindowLong
slouken@1465
    35
#endif
slouken@1465
    36
#ifndef SetWindowLongPtr
slouken@1465
    37
#define SetWindowLongPtr	SetWindowLong
slouken@1465
    38
#endif
slouken@1472
    39
#ifndef GWLP_WNDPROC
slouken@1472
    40
#define GWLP_WNDPROC	GWL_WNDPROC
slouken@1472
    41
#endif
slouken@1481
    42
#ifndef GCLP_HICON
slouken@1481
    43
#define GCLP_HICON GCL_HICON
slouken@1481
    44
#endif
slouken@1465
    45
slouken@1361
    46
#include "../SDL_sysvideo.h"
slouken@0
    47
slouken@0
    48
/* Hidden "this" pointer for the video functions */
slouken@0
    49
#define _THIS	SDL_VideoDevice *this
slouken@0
    50
slouken@304
    51
#define WINDIB_FULLSCREEN()						\
slouken@304
    52
(									\
slouken@335
    53
	SDL_VideoSurface &&						\
slouken@1658
    54
	(SDL_VideoSurface->flags & SDL_FULLSCREEN) &&			\
slouken@1658
    55
	((SDL_VideoSurface->flags & SDL_INTERNALOPENGL) ||		\
slouken@1658
    56
	((SDL_strcmp(this->name, "windib") == 0) ||			\
slouken@1658
    57
	 (SDL_strcmp(this->name, "gapi") == 0)))			\
slouken@304
    58
)
slouken@13
    59
#define DDRAW_FULLSCREEN() 						\
slouken@0
    60
(									\
slouken@335
    61
	SDL_VideoSurface &&						\
slouken@1658
    62
	(SDL_VideoSurface->flags & SDL_FULLSCREEN) &&			\
slouken@1658
    63
	(SDL_VideoSurface->flags & SDL_INTERNALOPENGL) &&		\
slouken@1658
    64
	(SDL_strcmp(this->name, "directx") == 0)			\
slouken@0
    65
)
slouken@0
    66
slouken@325
    67
#define DINPUT_FULLSCREEN()	DDRAW_FULLSCREEN()
slouken@13
    68
slouken@0
    69
/* The main window -- and a function to set it for the audio */
slouken@453
    70
#ifdef _WIN32_WCE
slouken@453
    71
extern LPWSTR SDL_Appname;
slouken@453
    72
#else
slouken@453
    73
extern LPSTR SDL_Appname;
slouken@453
    74
#endif
slouken@0
    75
extern HINSTANCE SDL_Instance;
slouken@0
    76
extern HWND SDL_Window;
slouken@1280
    77
extern BOOL SDL_windowid;
slouken@0
    78
slouken@0
    79
/* Variables and functions exported to other parts of the native video
slouken@0
    80
   subsystem (SDL_sysevents.c)
slouken@0
    81
*/
slouken@1668
    82
extern void WIN_FlushMessageQueue();
slouken@1523
    83
slouken@0
    84
/* Called by windows message loop when system palette is available */
slouken@1662
    85
extern void (*WIN_RealizePalette) (_THIS);
slouken@0
    86
slouken@0
    87
/* Called by windows message loop when the system palette changes */
slouken@1662
    88
extern void (*WIN_PaletteChanged) (_THIS, HWND window);
slouken@0
    89
slouken@0
    90
/* Called by windows message loop when a portion of the screen needs update */
slouken@1662
    91
extern void (*WIN_WinPAINT) (_THIS, HDC hdc);
slouken@0
    92
slouken@0
    93
/* Called by windows message loop when the message isn't handled */
slouken@1668
    94
extern LONG(*HandleMessage) (_THIS, HWND hwnd, UINT msg, WPARAM wParam,
slouken@1668
    95
                             LPARAM lParam);
slouken@0
    96
slouken@0
    97
/* The window cursor (from SDL_sysmouse.c) */
slouken@0
    98
extern HCURSOR SDL_hcursor;
slouken@0
    99
slouken@0
   100
/* The bounds of the window in screen coordinates */
slouken@0
   101
extern RECT SDL_bounds;
slouken@0
   102
slouken@833
   103
/* The position of the window in windowed mode */
slouken@833
   104
extern int SDL_windowX;
slouken@833
   105
extern int SDL_windowY;
slouken@833
   106
slouken@0
   107
/* Flag -- SDL is performing a resize, rather than the user */
slouken@0
   108
extern int SDL_resizing;
slouken@0
   109
slouken@0
   110
/* Flag -- the mouse is in relative motion mode */
slouken@0
   111
extern int mouse_relative;
slouken@0
   112
slouken@304
   113
/* The GDI fullscreen mode currently active */
slouken@304
   114
#ifndef NO_CHANGEDISPLAYSETTINGS
slouken@1295
   115
extern DEVMODE SDL_desktop_mode;
slouken@304
   116
extern DEVMODE SDL_fullscreen_mode;
slouken@304
   117
#endif
slouken@304
   118
slouken@338
   119
/* The system gamma ramp for GDI modes */
slouken@338
   120
extern WORD *gamma_saved;
slouken@338
   121
slouken@0
   122
/* This is really from SDL_dx5audio.c */
slouken@1668
   123
extern void DX5_SoundFocus(HWND window);
slouken@0
   124
slouken@145
   125
/* DJM: This is really from SDL_sysevents.c, we need it in
slouken@145
   126
   GDL_CreateWindow as well */
slouken@1668
   127
LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam,
slouken@1668
   128
                            LPARAM lParam);
slouken@145
   129
slouken@1253
   130
/* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
slouken@1662
   131
typedef int (WINAPI * ToUnicodeFN) (UINT, UINT, PBYTE, LPWSTR, int, UINT);
slouken@1253
   132
slouken@1253
   133
extern ToUnicodeFN SDL_ToUnicode;
slouken@1253
   134
slouken@0
   135
#endif /* SDL_lowvideo_h */
slouken@1662
   136
/* vi: set ts=4 sw=4 expandtab: */