include/SDL_syswm.h
author Jørgen P. Tjernø <jorgen@uberent.com>
Tue, 30 Sep 2014 11:20:50 -0700
changeset 9153 b0a76d1f4a56
parent 9099 5bbfdfa38bfc
child 9422 286c854c1d5b
child 9521 4c218c80b34d
permissions -rw-r--r--
Mac: Fix build with clang from Xcode 6.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     2
  Simple DirectMedia Layer
8149
681eb46b8ac4 Fixed bug 2374 - Update copyright for 2014...
Sam Lantinga <slouken@libsdl.org>
parents: 8134
diff changeset
     3
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
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: 5262
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: 5262
diff changeset
     7
  arising from the use of this software.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
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: 5262
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: 5262
diff changeset
    11
  freely, subject to the following restrictions:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
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: 5262
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: 5262
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: 5262
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
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: 5262
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: 5262
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    20
*/
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    21
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
    22
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    23
 *  \file SDL_syswm.h
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    24
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    25
 *  Include file for SDL custom system window manager hooks.
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
    26
 */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    27
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    28
#ifndef _SDL_syswm_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
#define _SDL_syswm_h
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
1356
67114343400d *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
    31
#include "SDL_stdinc.h"
1358
c71e05b4dc2e More header massaging... works great on Windows. ;-)
Sam Lantinga <slouken@libsdl.org>
parents: 1356
diff changeset
    32
#include "SDL_error.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: 1760
diff changeset
    33
#include "SDL_video.h"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    34
#include "SDL_version.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    35
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    36
#include "begin_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    37
/* Set up for C function definitions, even when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    38
#ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    39
extern "C" {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    40
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    41
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    42
/**
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    43
 *  \file SDL_syswm.h
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
    44
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    45
 *  Your application has access to a special type of event ::SDL_SYSWMEVENT,
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    46
 *  which contains window-manager specific information and arrives whenever
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    47
 *  an unhandled window event occurs.  This event is ignored by default, but
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    48
 *  you can enable it with SDL_EventState().
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
    49
 */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    50
#ifdef SDL_PROTOTYPES_ONLY
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    51
struct SDL_SysWMinfo;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    52
#else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    53
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
    54
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
8968
47decd0106f8 Apply WIN32_LEAN_AND_MEAN redefine fix to SDL_syswm.h too.
Jørgen P. Tjernø <jorgen@uberent.com>
parents: 8812
diff changeset
    55
#ifndef WIN32_LEAN_AND_MEAN
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    56
#define WIN32_LEAN_AND_MEAN
8968
47decd0106f8 Apply WIN32_LEAN_AND_MEAN redefine fix to SDL_syswm.h too.
Jørgen P. Tjernø <jorgen@uberent.com>
parents: 8812
diff changeset
    57
#endif
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    58
#include <windows.h>
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    59
#endif
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    60
8463
98dbf81ed5e9 WinRT: made SDL's inner WinRT CoreWindow be accessible to non-C++/CX code, in theory
David Ludwig <dludwig@pobox.com>
parents: 8439
diff changeset
    61
#if defined(SDL_VIDEO_DRIVER_WINRT)
8527
e3807733fad5 WinRT: made SDL_GetWindowWMInfo return window data in a slightly easier-to-use format
David Ludwig <dludwig@pobox.com>
parents: 8500
diff changeset
    62
#include <Inspectable.h>
8463
98dbf81ed5e9 WinRT: made SDL's inner WinRT CoreWindow be accessible to non-C++/CX code, in theory
David Ludwig <dludwig@pobox.com>
parents: 8439
diff changeset
    63
#endif
98dbf81ed5e9 WinRT: made SDL's inner WinRT CoreWindow be accessible to non-C++/CX code, in theory
David Ludwig <dludwig@pobox.com>
parents: 8439
diff changeset
    64
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1358
diff changeset
    65
/* This is the structure for custom window manager events */
1626
a80e1e0880b8 Fixed bug #176
Sam Lantinga <slouken@libsdl.org>
parents: 1487
diff changeset
    66
#if defined(SDL_VIDEO_DRIVER_X11)
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    67
#if defined(__APPLE__) && defined(__MACH__)
1487
dc6b59e925a2 Cleaning up warnings on MacOS X
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
    68
/* conflicts with Quickdraw.h */
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    69
#define Cursor X11Cursor
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    70
#endif
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    71
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    72
#include <X11/Xlib.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    73
#include <X11/Xatom.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    74
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    75
#if defined(__APPLE__) && defined(__MACH__)
1487
dc6b59e925a2 Cleaning up warnings on MacOS X
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
    76
/* matches the re-define above */
1133
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    77
#undef Cursor
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    78
#endif
609c060fd2a2 The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails:
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
    79
4899
5d529386db73 attached is a patch to support DirectFB in include/SDL_syswm.h. It
Sam Lantinga <slouken@libsdl.org>
parents: 4895
diff changeset
    80
#endif /* defined(SDL_VIDEO_DRIVER_X11) */
5d529386db73 attached is a patch to support DirectFB in include/SDL_syswm.h. It
Sam Lantinga <slouken@libsdl.org>
parents: 4895
diff changeset
    81
5d529386db73 attached is a patch to support DirectFB in include/SDL_syswm.h. It
Sam Lantinga <slouken@libsdl.org>
parents: 4895
diff changeset
    82
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
5199
164f20ba08eb Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents: 5065
diff changeset
    83
#include <directfb.h>
4899
5d529386db73 attached is a patch to support DirectFB in include/SDL_syswm.h. It
Sam Lantinga <slouken@libsdl.org>
parents: 4895
diff changeset
    84
#endif
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    85
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    86
#if defined(SDL_VIDEO_DRIVER_COCOA)
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    87
#ifdef __OBJC__
8812
b0f96c169c97 SDL_opengl: Fix Mac build for SDK 10.9 too.
Jørgen P. Tjernø <jorgen@uberent.com>
parents: 8799
diff changeset
    88
@class NSWindow;
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    89
#else
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    90
typedef struct _NSWindow NSWindow;
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    91
#endif
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    92
#endif
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
    93
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
    94
#if defined(SDL_VIDEO_DRIVER_UIKIT)
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
    95
#ifdef __OBJC__
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
    96
#include <UIKit/UIKit.h>
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
    97
#else
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
    98
typedef struct _UIWindow UIWindow;
8305
3d522e6d4ae1 added UIViewController pointer to SDL_SysWMinfo for iOS
David Ludwig <dludwig@pobox.com>
parents: 6138
diff changeset
    99
typedef struct _UIViewController UIViewController;
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   100
#endif
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   101
#endif
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   102
8799
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   103
#if defined(SDL_VIDEO_DRIVER_ANDROID)
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   104
typedef struct ANativeWindow ANativeWindow;
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   105
typedef void *EGLSurface;
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   106
#endif
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   107
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   108
/**
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   109
 *  These are the various supported windowing subsystems
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   110
 */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   111
typedef enum
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   112
{
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   113
    SDL_SYSWM_UNKNOWN,
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   114
    SDL_SYSWM_WINDOWS,
4899
5d529386db73 attached is a patch to support DirectFB in include/SDL_syswm.h. It
Sam Lantinga <slouken@libsdl.org>
parents: 4895
diff changeset
   115
    SDL_SYSWM_X11,
5d529386db73 attached is a patch to support DirectFB in include/SDL_syswm.h. It
Sam Lantinga <slouken@libsdl.org>
parents: 4895
diff changeset
   116
    SDL_SYSWM_DIRECTFB,
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   117
    SDL_SYSWM_COCOA,
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   118
    SDL_SYSWM_UIKIT,
8134
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   119
    SDL_SYSWM_WAYLAND,
8153
3e43c73ac79b Added Mir video target (thanks, Brandon!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
   120
    SDL_SYSWM_MIR,
8799
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   121
    SDL_SYSWM_WINRT,
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   122
    SDL_SYSWM_ANDROID
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   123
} SDL_SYSWM_TYPE;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   124
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   125
/**
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   126
 *  The custom event structure.
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   127
 */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   128
struct SDL_SysWMmsg
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   129
{
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   130
    SDL_version version;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   131
    SDL_SYSWM_TYPE subsystem;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   132
    union
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   133
    {
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
   134
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   135
        struct {
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   136
            HWND hwnd;                  /**< The window for the message */
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   137
            UINT msg;                   /**< The type of message */
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   138
            WPARAM wParam;              /**< WORD message parameter */
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   139
            LPARAM lParam;              /**< LONG message parameter */
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   140
        } win;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   141
#endif
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   142
#if defined(SDL_VIDEO_DRIVER_X11)
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   143
        struct {
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   144
            XEvent event;
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   145
        } x11;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   146
#endif
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   147
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   148
        struct {
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   149
            DFBEvent event;
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   150
        } dfb;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   151
#endif
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   152
#if defined(SDL_VIDEO_DRIVER_COCOA)
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   153
        struct
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   154
        {
9153
b0a76d1f4a56 Mac: Fix build with clang from Xcode 6.
Jørgen P. Tjernø <jorgen@uberent.com>
parents: 9099
diff changeset
   155
            /* Latest version of Xcode clang complains about empty structs in C v. C++:
b0a76d1f4a56 Mac: Fix build with clang from Xcode 6.
Jørgen P. Tjernø <jorgen@uberent.com>
parents: 9099
diff changeset
   156
                 error: empty struct has size 0 in C, size 1 in C++
b0a76d1f4a56 Mac: Fix build with clang from Xcode 6.
Jørgen P. Tjernø <jorgen@uberent.com>
parents: 9099
diff changeset
   157
             */
b0a76d1f4a56 Mac: Fix build with clang from Xcode 6.
Jørgen P. Tjernø <jorgen@uberent.com>
parents: 9099
diff changeset
   158
            int dummy;
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   159
            /* No Cocoa window events yet */
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   160
        } cocoa;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   161
#endif
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   162
#if defined(SDL_VIDEO_DRIVER_UIKIT)
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   163
        struct
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   164
        {
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   165
            /* No UIKit window events yet */
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   166
        } uikit;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   167
#endif
5063
5680976fb37a You can't have an empty union in the structure...
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
   168
        /* Can't have an empty union */
5680976fb37a You can't have an empty union in the structure...
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
   169
        int dummy;
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   170
    } msg;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   171
};
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   172
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   173
/**
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   174
 *  The custom window manager information structure.
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   175
 *
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   176
 *  When this structure is returned, it holds information about which
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   177
 *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   178
 */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   179
struct SDL_SysWMinfo
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   180
{
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   181
    SDL_version version;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   182
    SDL_SYSWM_TYPE subsystem;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   183
    union
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   184
    {
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 5056
diff changeset
   185
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   186
        struct
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   187
        {
4903
f50c7996d925 Documentation clarification
Sam Lantinga <slouken@libsdl.org>
parents: 4902
diff changeset
   188
            HWND window;                /**< The window handle */
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   189
        } win;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   190
#endif
8411
aca0591bc58f WinRT: provided access, via SDL_GetWindowWMInfo, to SDL's WinRT CoreWindow
David Ludwig <dludwig@pobox.com>
parents: 8305
diff changeset
   191
#if defined(SDL_VIDEO_DRIVER_WINRT)
aca0591bc58f WinRT: provided access, via SDL_GetWindowWMInfo, to SDL's WinRT CoreWindow
David Ludwig <dludwig@pobox.com>
parents: 8305
diff changeset
   192
        struct
aca0591bc58f WinRT: provided access, via SDL_GetWindowWMInfo, to SDL's WinRT CoreWindow
David Ludwig <dludwig@pobox.com>
parents: 8305
diff changeset
   193
        {
8527
e3807733fad5 WinRT: made SDL_GetWindowWMInfo return window data in a slightly easier-to-use format
David Ludwig <dludwig@pobox.com>
parents: 8500
diff changeset
   194
            IInspectable * window;      /**< The WinRT CoreWindow */
8411
aca0591bc58f WinRT: provided access, via SDL_GetWindowWMInfo, to SDL's WinRT CoreWindow
David Ludwig <dludwig@pobox.com>
parents: 8305
diff changeset
   195
        } winrt;
aca0591bc58f WinRT: provided access, via SDL_GetWindowWMInfo, to SDL's WinRT CoreWindow
David Ludwig <dludwig@pobox.com>
parents: 8305
diff changeset
   196
#endif
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   197
#if defined(SDL_VIDEO_DRIVER_X11)
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   198
        struct
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   199
        {
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   200
            Display *display;           /**< The X11 display */
4903
f50c7996d925 Documentation clarification
Sam Lantinga <slouken@libsdl.org>
parents: 4902
diff changeset
   201
            Window window;              /**< The X11 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: 1760
diff changeset
   202
        } x11;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   203
#endif
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   204
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
4899
5d529386db73 attached is a patch to support DirectFB in include/SDL_syswm.h. It
Sam Lantinga <slouken@libsdl.org>
parents: 4895
diff changeset
   205
        struct
5d529386db73 attached is a patch to support DirectFB in include/SDL_syswm.h. It
Sam Lantinga <slouken@libsdl.org>
parents: 4895
diff changeset
   206
        {
4903
f50c7996d925 Documentation clarification
Sam Lantinga <slouken@libsdl.org>
parents: 4902
diff changeset
   207
            IDirectFB *dfb;             /**< The directfb main interface */
f50c7996d925 Documentation clarification
Sam Lantinga <slouken@libsdl.org>
parents: 4902
diff changeset
   208
            IDirectFBWindow *window;    /**< The directfb window handle */
f50c7996d925 Documentation clarification
Sam Lantinga <slouken@libsdl.org>
parents: 4902
diff changeset
   209
            IDirectFBSurface *surface;  /**< The directfb client surface */
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   210
        } dfb;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   211
#endif
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   212
#if defined(SDL_VIDEO_DRIVER_COCOA)
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   213
        struct
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   214
        {
9099
5bbfdfa38bfc Better check for __has_feature
Sam Lantinga <slouken@libsdl.org>
parents: 9094
diff changeset
   215
#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
9034
d6464107048c Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8968
diff changeset
   216
            NSWindow __unsafe_unretained *window; /* The Cocoa window */
d6464107048c Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8968
diff changeset
   217
#else
d6464107048c Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8968
diff changeset
   218
            NSWindow *window;                     /* The Cocoa window */
d6464107048c Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8968
diff changeset
   219
#endif
4900
69d9db65f248 Merged the Windows custom window system hooks into the union used by X11.
Sam Lantinga <slouken@libsdl.org>
parents: 4899
diff changeset
   220
        } cocoa;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   221
#endif
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   222
#if defined(SDL_VIDEO_DRIVER_UIKIT)
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   223
        struct
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   224
        {
9099
5bbfdfa38bfc Better check for __has_feature
Sam Lantinga <slouken@libsdl.org>
parents: 9094
diff changeset
   225
#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
9034
d6464107048c Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8968
diff changeset
   226
            UIWindow __unsafe_unretained *window; /* The UIKit window */
d6464107048c Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8968
diff changeset
   227
#else
d6464107048c Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8968
diff changeset
   228
            UIWindow *window;                     /* The UIKit window */
d6464107048c Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Ryan C. Gordon <icculus@icculus.org>
parents: 8968
diff changeset
   229
#endif
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   230
        } uikit;
5065
7e4c7790700e Fixed compile error on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents: 5063
diff changeset
   231
#endif
8134
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   232
#if defined(SDL_VIDEO_DRIVER_WAYLAND)
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   233
        struct
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   234
        {
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   235
            struct wl_display *display;            /**< Wayland display */
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   236
            struct wl_surface *surface;            /**< Wayland surface */
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   237
            struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   238
        } wl;
7c9192be51a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Gabriel Jacobo <gabomdq@gmail.com>
parents: 8062
diff changeset
   239
#endif
8155
cf0eda3f5e35 Added some SysWM bits for Mir.
Ryan C. Gordon <icculus@icculus.org>
parents: 8153
diff changeset
   240
#if defined(SDL_VIDEO_DRIVER_MIR)
cf0eda3f5e35 Added some SysWM bits for Mir.
Ryan C. Gordon <icculus@icculus.org>
parents: 8153
diff changeset
   241
        struct
cf0eda3f5e35 Added some SysWM bits for Mir.
Ryan C. Gordon <icculus@icculus.org>
parents: 8153
diff changeset
   242
        {
8731
ede9d13dad21 Revert MIR_CFLAGS to SDL_CFLAGS. Use forward declaration for the real fix. (We shouldn't expose mir headers!)
Brandon Schaefer <brandon.schaefer@canonical.com>
parents: 8603
diff changeset
   243
            struct MirConnection *connection;  /**< Mir display server connection */
ede9d13dad21 Revert MIR_CFLAGS to SDL_CFLAGS. Use forward declaration for the real fix. (We shouldn't expose mir headers!)
Brandon Schaefer <brandon.schaefer@canonical.com>
parents: 8603
diff changeset
   244
            struct MirSurface *surface;  /**< Mir surface */
8155
cf0eda3f5e35 Added some SysWM bits for Mir.
Ryan C. Gordon <icculus@icculus.org>
parents: 8153
diff changeset
   245
        } mir;
cf0eda3f5e35 Added some SysWM bits for Mir.
Ryan C. Gordon <icculus@icculus.org>
parents: 8153
diff changeset
   246
#endif
cf0eda3f5e35 Added some SysWM bits for Mir.
Ryan C. Gordon <icculus@icculus.org>
parents: 8153
diff changeset
   247
8799
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   248
#if defined(SDL_VIDEO_DRIVER_ANDROID)
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   249
        struct
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   250
        {
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   251
            ANativeWindow *window;
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   252
            EGLSurface surface;
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   253
        } android;
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   254
#endif
e2fd743d84ea Added a way to get the native Android window and EGL context
Sam Lantinga <slouken@libsdl.org>
parents: 8744
diff changeset
   255
5063
5680976fb37a You can't have an empty union in the structure...
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
   256
        /* Can't have an empty union */
5680976fb37a You can't have an empty union in the structure...
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
   257
        int dummy;
5056
8b7988f42fcb Added the ability to get the UIKit window through the SDL API.
Sam Lantinga <slouken@libsdl.org>
parents: 4903
diff changeset
   258
    } info;
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   259
};
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   260
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   261
#endif /* SDL_PROTOTYPES_ONLY */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   262
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   263
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   264
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   265
/* Function prototypes */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   266
/**
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   267
 *  \brief This function allows access to driver-dependent window information.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   268
 *
4530
4069c65b01f2 Fixed typo in the documentation
Sam Lantinga <slouken@libsdl.org>
parents: 4510
diff changeset
   269
 *  \param window The window about which information is being requested
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   270
 *  \param info This structure must be initialized with the SDL version, and is
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   271
 *              then filled in with information about the given window.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   272
 *
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   273
 *  \return SDL_TRUE if the function is implemented and the version member of
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   274
 *          the \c info struct is valid, SDL_FALSE otherwise.
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   275
 *
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   276
 *  You typically use this function like this:
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   277
 *  \code
4895
fd27410a5db0 Fixed documentation typo
Sam Lantinga <slouken@libsdl.org>
parents: 4530
diff changeset
   278
 *  SDL_SysWMinfo info;
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   279
 *  SDL_VERSION(&info.version);
7455
0a988affc7e7 Fixed code example for SDL_GetWindowWMInfo()
Sam Lantinga <slouken@libsdl.org>
parents: 7282
diff changeset
   280
 *  if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
3407
d3baf5ac4e37 Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents: 3274
diff changeset
   281
 *  \endcode
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   282
 */
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: 3407
diff changeset
   283
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(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: 1760
diff changeset
   284
                                                     SDL_SysWMinfo * info);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   285
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   286
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   287
/* Ends C function definitions when using C++ */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   288
#ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   289
}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   290
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   291
#include "close_code.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   292
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   293
#endif /* _SDL_syswm_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: 1760
diff changeset
   294
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
   295
/* vi: set ts=4 sw=4 expandtab: */