src/video/x11/SDL_x11dyn.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 15 Dec 2009 08:11:06 +0000
changeset 3565 f43c8f688f77
parent 2859 99210400e8b9
child 3633 81dde1b00bf1
permissions -rw-r--r--
Fixed bug #906

Added better error reporting for OpenGL context creation failing.
slouken@1950
     1
/*
slouken@1950
     2
    SDL - Simple DirectMedia Layer
slouken@2859
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@1950
     4
slouken@1950
     5
    This library is free software; you can redistribute it and/or
slouken@1950
     6
    modify it under the terms of the GNU Library General Public
slouken@1950
     7
    License as published by the Free Software Foundation; either
slouken@1950
     8
    version 2 of the License, or (at your option) any later version.
slouken@1950
     9
slouken@1950
    10
    This library is distributed in the hope that it will be useful,
slouken@1950
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@1950
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1950
    13
    Library General Public License for more details.
slouken@1950
    14
slouken@1950
    15
    You should have received a copy of the GNU Library General Public
slouken@1950
    16
    License along with this library; if not, write to the Free
slouken@1950
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@1950
    18
slouken@1950
    19
    Sam Lantinga
slouken@1950
    20
    slouken@libsdl.org
slouken@1950
    21
*/
slouken@1950
    22
#include "SDL_config.h"
slouken@1950
    23
slouken@1950
    24
#ifndef _SDL_x11dyn_h
slouken@1950
    25
#define _SDL_x11dyn_h
slouken@1950
    26
slouken@1950
    27
#include <X11/Xlib.h>
slouken@1950
    28
#include <X11/Xutil.h>
slouken@1950
    29
#include <X11/Xatom.h>
slouken@1950
    30
#include <X11/Xlibint.h>
slouken@1950
    31
#include <X11/Xproto.h>
slouken@1950
    32
#include "../Xext/extensions/Xext.h"
slouken@1950
    33
#include "../Xext/extensions/extutil.h"
slouken@1950
    34
slouken@1950
    35
#ifndef NO_SHARED_MEMORY
slouken@1950
    36
#include <sys/ipc.h>
slouken@1950
    37
#include <sys/shm.h>
slouken@1950
    38
#include <X11/extensions/XShm.h>
slouken@1950
    39
#endif
slouken@1950
    40
slouken@1950
    41
#if SDL_VIDEO_DRIVER_X11_XRANDR
slouken@1950
    42
#include <X11/extensions/Xrandr.h>
slouken@1950
    43
#endif
slouken@1950
    44
icculus@2763
    45
#if SDL_VIDEO_DRIVER_X11_XINPUT
icculus@2763
    46
#include <X11/extensions/XInput.h>
icculus@2763
    47
#endif
icculus@2763
    48
slouken@1950
    49
/*
slouken@1950
    50
 * When using the "dynamic X11" functionality, we duplicate all the Xlib
slouken@1950
    51
 *  symbols that would be referenced by SDL inside of SDL itself.
slouken@1950
    52
 *  These duplicated symbols just serve as passthroughs to the functions
slouken@1950
    53
 *  in Xlib, that was dynamically loaded.
slouken@1950
    54
 *
slouken@1950
    55
 * This allows us to use Xlib as-is when linking against it directly, but
slouken@1950
    56
 *  also handles all the strange cases where there was code in the Xlib
slouken@1950
    57
 *  headers that may or may not exist or vary on a given platform.
slouken@1950
    58
 */
slouken@1950
    59
#ifdef __cplusplus
slouken@1950
    60
extern "C"
slouken@1950
    61
{
slouken@1950
    62
#endif
slouken@1950
    63
slouken@1950
    64
/* evil function signatures... */
slouken@1950
    65
    typedef Bool(*SDL_X11_XESetWireToEventRetType) (Display *, XEvent *,
slouken@1950
    66
                                                    xEvent *);
slouken@1950
    67
    typedef int (*SDL_X11_XSynchronizeRetType) (Display *);
slouken@1950
    68
    typedef Status(*SDL_X11_XESetEventToWireRetType) (Display *, XEvent *,
slouken@1950
    69
                                                      xEvent *);
slouken@1950
    70
slouken@1950
    71
    int SDL_X11_LoadSymbols(void);
slouken@1950
    72
    void SDL_X11_UnloadSymbols(void);
slouken@1950
    73
bob@2325
    74
/* That's really annoying...make these function pointers no matter what. */
slouken@1950
    75
#ifdef X_HAVE_UTF8_STRING
slouken@1950
    76
    extern XIC(*pXCreateIC) (XIM, ...);
bob@2325
    77
    extern char *(*pXGetICValues) (XIC, ...);
slouken@1950
    78
#endif
slouken@1950
    79
slouken@1950
    80
/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
slouken@1950
    81
#define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname;
slouken@1950
    82
#define SDL_X11_SYM(rc,fn,params,args,ret)
slouken@1950
    83
#include "SDL_x11sym.h"
slouken@1950
    84
#undef SDL_X11_MODULE
slouken@1950
    85
#undef SDL_X11_SYM
slouken@1950
    86
slouken@1950
    87
slouken@1950
    88
#ifdef __cplusplus
slouken@1950
    89
}
slouken@1950
    90
#endif
slouken@1950
    91
slouken@1950
    92
#endif                          /* !defined _SDL_x11dyn_h */
slouken@1950
    93
/* vi: set ts=4 sw=4 expandtab: */