src/video/windows/SDL_windowswindow.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 24 Feb 2014 22:49:30 -0800
changeset 8253 75ad8ebb3768
parent 8149 681eb46b8ac4
child 8817 13003597b6c4
child 8938 c73bac338b90
permissions -rw-r--r--
Make sure we don't clip the cursor while clicking on the window title bar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
     2
  Simple DirectMedia Layer
8149
681eb46b8ac4 Fixed bug 2374 - Update copyright for 2014...
Sam Lantinga <slouken@libsdl.org>
parents: 8093
diff changeset
     3
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
     7
  arising from the use of this software.
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    11
  freely, subject to the following restrictions:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5466
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
8093
b43765095a6f Make internal SDL sources include SDL_internal.h instead of SDL_config.h
Ryan C. Gordon <icculus@icculus.org>
parents: 8072
diff changeset
    21
#include "../../SDL_internal.h"
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4569
diff changeset
    23
#ifndef _SDL_windowswindow_h
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4569
diff changeset
    24
#define _SDL_windowswindow_h
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7941
diff changeset
    26
#if SDL_VIDEO_OPENGL_EGL   
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7941
diff changeset
    27
#include "../SDL_egl_c.h"
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7941
diff changeset
    28
#endif
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7941
diff changeset
    29
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
typedef struct
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    31
{
3685
64ce267332c6 Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents: 2970
diff changeset
    32
    SDL_Window *window;
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
    HWND hwnd;
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
    34
    HDC hdc;
5175
9b2e99ebd099 Added the Windows framebuffer implementation.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
    35
    HDC mdc;
9b2e99ebd099 Added the Windows framebuffer implementation.
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
    36
    HBITMAP hbm;
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
    WNDPROC wndproc;
1951
7177581dc9fa Initial work on X11 window code in.
Sam Lantinga <slouken@libsdl.org>
parents: 1933
diff changeset
    38
    SDL_bool created;
6973
ae30ec97694a Fixed 64-bit compile warnings on Visual C++
Sam Lantinga <slouken@libsdl.org>
parents: 6943
diff changeset
    39
    WPARAM mouse_button_flags;
7941
7c249ca44069 Fixed bug 2067 - Window size limit calculation issue when exiting fullscreen on Windows
Sam Lantinga <slouken@libsdl.org>
parents: 7762
diff changeset
    40
    BOOL expected_resize;
8253
75ad8ebb3768 Make sure we don't clip the cursor while clicking on the window title bar
Sam Lantinga <slouken@libsdl.org>
parents: 8149
diff changeset
    41
    SDL_bool in_title_click;
8038
e1f2a85d9dda Fixed windows build with conflict resolve
Sam Lantinga <slouken@libsdl.org>
parents: 8021
diff changeset
    42
    SDL_bool in_modal_loop;
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
    struct SDL_VideoData *videodata;
8021
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7941
diff changeset
    44
#if SDL_VIDEO_OPENGL_EGL  
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7941
diff changeset
    45
    EGLSurface egl_surface;
f96e12e0ade9 OpenGL ES support for Windows
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7941
diff changeset
    46
#endif
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    47
} SDL_WindowData;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    48
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    49
extern int WIN_CreateWindow(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    50
extern int WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    51
extern void WIN_SetWindowTitle(_THIS, SDL_Window * window);
2970
94b634c56455 Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
    52
extern void WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    53
extern void WIN_SetWindowPosition(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    54
extern void WIN_SetWindowSize(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
extern void WIN_ShowWindow(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    56
extern void WIN_HideWindow(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    57
extern void WIN_RaiseWindow(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    58
extern void WIN_MaximizeWindow(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    59
extern void WIN_MinimizeWindow(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    60
extern void WIN_RestoreWindow(_THIS, SDL_Window * window);
6422
fd0ac1b56115 Added SDL_SetWindowBordered() API.
Ryan C. Gordon <icculus@icculus.org>
parents: 6138
diff changeset
    61
extern void WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
5305
75f5ff92ad08 Fixed a host of issues with Windows fullscreen modes. Toggling fullscreen OpenGL works now in my test environment.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    62
extern void WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
5466
006883d5fa51 Gamma support is back!
Sam Lantinga <slouken@libsdl.org>
parents: 5398
diff changeset
    63
extern int WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
006883d5fa51 Gamma support is back!
Sam Lantinga <slouken@libsdl.org>
parents: 5398
diff changeset
    64
extern int WIN_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
6662
698c2e533a7e SDL no longer grabs the keyboard by default on X11.
Sam Lantinga <slouken@libsdl.org>
parents: 6430
diff changeset
    65
extern void WIN_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    66
extern void WIN_DestroyWindow(_THIS, SDL_Window * window);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    67
extern SDL_bool WIN_GetWindowWMInfo(_THIS, SDL_Window * window,
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    68
                                    struct SDL_SysWMinfo *info);
7089
257fc4e541e1 Send mouse leave updates for Windows and X11.
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6973
diff changeset
    69
extern void WIN_OnWindowEnter(_THIS, SDL_Window * window);
8072
9d8865351afd Setting the mouse in relative mode implies grabbing the mouse.
Sam Lantinga <slouken@libsdl.org>
parents: 8038
diff changeset
    70
extern void WIN_UpdateClipCursor(SDL_Window *window);
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    71
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4569
diff changeset
    72
#endif /* _SDL_windowswindow_h */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    73
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    74
/* vi: set ts=4 sw=4 expandtab: */