Started work on the new X11 driver.
authorSam Lantinga <slouken@libsdl.org>
Wed, 26 Jul 2006 06:34:54 +0000
changeset 1950a344e42bce3b
parent 1949 44b6f09a07d8
child 1951 7177581dc9fa
Started work on the new X11 driver.
src/video/x11/SDL_x11dyn.c
src/video/x11/SDL_x11dyn.h
src/video/x11/SDL_x11keyboard.c
src/video/x11/SDL_x11keyboard.h
src/video/x11/SDL_x11modes.c
src/video/x11/SDL_x11modes.h
src/video/x11/SDL_x11mouse.c
src/video/x11/SDL_x11mouse.h
src/video/x11/SDL_x11sym.h
src/video/x11/SDL_x11video.c
src/video/x11/SDL_x11video.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/video/x11/SDL_x11dyn.c	Wed Jul 26 06:34:54 2006 +0000
     1.3 @@ -0,0 +1,184 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2004 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Library General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Library General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Library General Public
    1.19 +    License along with this library; if not, write to the Free
    1.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#define DEBUG_DYNAMIC_X11 0
    1.28 +
    1.29 +#include "SDL_x11dyn.h"
    1.30 +
    1.31 +#if DEBUG_DYNAMIC_X11
    1.32 +#include <stdio.h>
    1.33 +#endif
    1.34 +
    1.35 +#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
    1.36 +
    1.37 +#include "SDL_name.h"
    1.38 +#include "SDL_loadso.h"
    1.39 +
    1.40 +typedef struct
    1.41 +{
    1.42 +    void *lib;
    1.43 +    const char *libname;
    1.44 +} x11dynlib;
    1.45 +
    1.46 +#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC
    1.47 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC NULL
    1.48 +#endif
    1.49 +#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
    1.50 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT NULL
    1.51 +#endif
    1.52 +#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
    1.53 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER NULL
    1.54 +#endif
    1.55 +#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
    1.56 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR NULL
    1.57 +#endif
    1.58 +
    1.59 +static x11dynlib x11libs[] = {
    1.60 +    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC},
    1.61 +    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT},
    1.62 +    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER},
    1.63 +    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR},
    1.64 +};
    1.65 +
    1.66 +static void
    1.67 +X11_GetSym(const char *fnname, int *rc, void **fn)
    1.68 +{
    1.69 +    int i;
    1.70 +    for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
    1.71 +        if (x11libs[i].lib != NULL) {
    1.72 +            *fn = SDL_LoadFunction(x11libs[i].lib, fnname);
    1.73 +            if (*fn != NULL)
    1.74 +                break;
    1.75 +        }
    1.76 +    }
    1.77 +
    1.78 +#if DEBUG_DYNAMIC_X11
    1.79 +    if (*fn != NULL)
    1.80 +        printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname,
    1.81 +               *fn);
    1.82 +    else
    1.83 +        printf("X11: Symbol '%s' NOT FOUND!\n", fnname);
    1.84 +#endif
    1.85 +
    1.86 +    if (*fn == NULL)
    1.87 +        *rc = 0;                /* kill this module. */
    1.88 +}
    1.89 +
    1.90 +
    1.91 +/* Define all the function pointers and wrappers... */
    1.92 +#define SDL_X11_MODULE(modname)
    1.93 +#define SDL_X11_SYM(rc,fn,params,args,ret) \
    1.94 +	static rc (*p##fn) params = NULL; \
    1.95 +	rc fn params { ret p##fn args ; }
    1.96 +#include "SDL_x11sym.h"
    1.97 +#undef SDL_X11_MODULE
    1.98 +#undef SDL_X11_SYM
    1.99 +#endif /* SDL_VIDEO_DRIVER_X11_DYNAMIC */
   1.100 +
   1.101 +/* Annoying varargs entry point... */
   1.102 +#ifdef X_HAVE_UTF8_STRING
   1.103 +XIC(*pXCreateIC) (XIM,...) = NULL;
   1.104 +#endif
   1.105 +
   1.106 +/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
   1.107 +#define SDL_X11_MODULE(modname) int SDL_X11_HAVE_##modname = 1;
   1.108 +#define SDL_X11_SYM(rc,fn,params,args,ret)
   1.109 +#include "SDL_x11sym.h"
   1.110 +#undef SDL_X11_MODULE
   1.111 +#undef SDL_X11_SYM
   1.112 +
   1.113 +
   1.114 +static int x11_load_refcount = 0;
   1.115 +
   1.116 +void
   1.117 +SDL_X11_UnloadSymbols(void)
   1.118 +{
   1.119 +#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
   1.120 +    /* Don't actually unload if more than one module is using the libs... */
   1.121 +    if (x11_load_refcount > 0) {
   1.122 +        if (--x11_load_refcount == 0) {
   1.123 +            int i;
   1.124 +
   1.125 +            /* set all the function pointers to NULL. */
   1.126 +#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1;
   1.127 +#define SDL_X11_SYM(rc,fn,params,args,ret) p##fn = NULL;
   1.128 +#include "SDL_x11sym.h"
   1.129 +#undef SDL_X11_MODULE
   1.130 +#undef SDL_X11_SYM
   1.131 +
   1.132 +#ifdef X_HAVE_UTF8_STRING
   1.133 +            pXCreateIC = NULL;
   1.134 +#endif
   1.135 +
   1.136 +            for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
   1.137 +                if (x11libs[i].lib != NULL) {
   1.138 +                    SDL_UnloadObject(x11libs[i].lib);
   1.139 +                    x11libs[i].lib = NULL;
   1.140 +                }
   1.141 +            }
   1.142 +        }
   1.143 +    }
   1.144 +#endif
   1.145 +}
   1.146 +
   1.147 +/* returns non-zero if all needed symbols were loaded. */
   1.148 +int
   1.149 +SDL_X11_LoadSymbols(void)
   1.150 +{
   1.151 +    int rc = 1;                 /* always succeed if not using Dynamic X11 stuff. */
   1.152 +
   1.153 +#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
   1.154 +    /* deal with multiple modules (dga, x11, etc) needing these symbols... */
   1.155 +    if (x11_load_refcount++ == 0) {
   1.156 +        int i;
   1.157 +        int *thismod = NULL;
   1.158 +        for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
   1.159 +            if (x11libs[i].libname != NULL) {
   1.160 +                x11libs[i].lib = SDL_LoadObject(x11libs[i].libname);
   1.161 +            }
   1.162 +        }
   1.163 +#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
   1.164 +#define SDL_X11_SYM(a,fn,x,y,z) X11_GetSym(#fn,thismod,(void**)&p##fn);
   1.165 +#include "SDL_x11sym.h"
   1.166 +#undef SDL_X11_MODULE
   1.167 +#undef SDL_X11_SYM
   1.168 +
   1.169 +#ifdef X_HAVE_UTF8_STRING
   1.170 +        X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8, (void **) &pXCreateIC);
   1.171 +#endif
   1.172 +
   1.173 +        if (!SDL_X11_HAVE_BASEXLIB) {   /* some required symbol didn't load. */
   1.174 +            SDL_X11_UnloadSymbols();    /* in case something got loaded... */
   1.175 +            rc = 0;
   1.176 +        }
   1.177 +    }
   1.178 +#else
   1.179 +#ifdef X_HAVE_UTF8_STRING
   1.180 +    pXCreateIC = XCreateIC;
   1.181 +#endif
   1.182 +#endif
   1.183 +
   1.184 +    return rc;
   1.185 +}
   1.186 +
   1.187 +/* vi: set ts=4 sw=4 expandtab: */
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/video/x11/SDL_x11dyn.h	Wed Jul 26 06:34:54 2006 +0000
     2.3 @@ -0,0 +1,89 @@
     2.4 +/*
     2.5 +    SDL - Simple DirectMedia Layer
     2.6 +    Copyright (C) 1997-2004 Sam Lantinga
     2.7 +
     2.8 +    This library is free software; you can redistribute it and/or
     2.9 +    modify it under the terms of the GNU Library General Public
    2.10 +    License as published by the Free Software Foundation; either
    2.11 +    version 2 of the License, or (at your option) any later version.
    2.12 +
    2.13 +    This library is distributed in the hope that it will be useful,
    2.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.16 +    Library General Public License for more details.
    2.17 +
    2.18 +    You should have received a copy of the GNU Library General Public
    2.19 +    License along with this library; if not, write to the Free
    2.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2.21 +
    2.22 +    Sam Lantinga
    2.23 +    slouken@libsdl.org
    2.24 +*/
    2.25 +#include "SDL_config.h"
    2.26 +
    2.27 +#ifndef _SDL_x11dyn_h
    2.28 +#define _SDL_x11dyn_h
    2.29 +
    2.30 +#include <X11/Xlib.h>
    2.31 +#include <X11/Xutil.h>
    2.32 +#include <X11/Xatom.h>
    2.33 +#include <X11/Xlibint.h>
    2.34 +#include <X11/Xproto.h>
    2.35 +
    2.36 +#include "../Xext/extensions/Xext.h"
    2.37 +#include "../Xext/extensions/extutil.h"
    2.38 +
    2.39 +#ifndef NO_SHARED_MEMORY
    2.40 +#include <sys/ipc.h>
    2.41 +#include <sys/shm.h>
    2.42 +#include <X11/extensions/XShm.h>
    2.43 +#endif
    2.44 +
    2.45 +#if SDL_VIDEO_DRIVER_X11_XRANDR
    2.46 +#include <X11/extensions/Xrandr.h>
    2.47 +#endif
    2.48 +
    2.49 +/*
    2.50 + * When using the "dynamic X11" functionality, we duplicate all the Xlib
    2.51 + *  symbols that would be referenced by SDL inside of SDL itself.
    2.52 + *  These duplicated symbols just serve as passthroughs to the functions
    2.53 + *  in Xlib, that was dynamically loaded.
    2.54 + *
    2.55 + * This allows us to use Xlib as-is when linking against it directly, but
    2.56 + *  also handles all the strange cases where there was code in the Xlib
    2.57 + *  headers that may or may not exist or vary on a given platform.
    2.58 + */
    2.59 +#ifdef __cplusplus
    2.60 +extern "C"
    2.61 +{
    2.62 +#endif
    2.63 +
    2.64 +/* evil function signatures... */
    2.65 +    typedef Bool(*SDL_X11_XESetWireToEventRetType) (Display *, XEvent *,
    2.66 +                                                    xEvent *);
    2.67 +    typedef int (*SDL_X11_XSynchronizeRetType) (Display *);
    2.68 +    typedef Status(*SDL_X11_XESetEventToWireRetType) (Display *, XEvent *,
    2.69 +                                                      xEvent *);
    2.70 +
    2.71 +    int SDL_X11_LoadSymbols(void);
    2.72 +    void SDL_X11_UnloadSymbols(void);
    2.73 +
    2.74 +/* That's really annoying...make this a function pointer no matter what. */
    2.75 +#ifdef X_HAVE_UTF8_STRING
    2.76 +    extern XIC(*pXCreateIC) (XIM, ...);
    2.77 +#endif
    2.78 +
    2.79 +/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
    2.80 +#define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname;
    2.81 +#define SDL_X11_SYM(rc,fn,params,args,ret)
    2.82 +#include "SDL_x11sym.h"
    2.83 +#undef SDL_X11_MODULE
    2.84 +#undef SDL_X11_SYM
    2.85 +
    2.86 +
    2.87 +#ifdef __cplusplus
    2.88 +}
    2.89 +#endif
    2.90 +
    2.91 +#endif                          /* !defined _SDL_x11dyn_h */
    2.92 +/* vi: set ts=4 sw=4 expandtab: */
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/video/x11/SDL_x11keyboard.c	Wed Jul 26 06:34:54 2006 +0000
     3.3 @@ -0,0 +1,46 @@
     3.4 +/*
     3.5 +    SDL - Simple DirectMedia Layer
     3.6 +    Copyright (C) 1997-2006 Sam Lantinga
     3.7 +
     3.8 +    This library is free software; you can redistribute it and/or
     3.9 +    modify it under the terms of the GNU Lesser General Public
    3.10 +    License as published by the Free Software Foundation; either
    3.11 +    version 2.1 of the License, or (at your option) any later version.
    3.12 +
    3.13 +    This library is distributed in the hope that it will be useful,
    3.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.16 +    Lesser General Public License for more details.
    3.17 +
    3.18 +    You should have received a copy of the GNU Lesser General Public
    3.19 +    License along with this library; if not, write to the Free Software
    3.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    3.21 +
    3.22 +    Sam Lantinga
    3.23 +    slouken@libsdl.org
    3.24 +*/
    3.25 +#include "SDL_config.h"
    3.26 +
    3.27 +#include "SDL_x11video.h"
    3.28 +
    3.29 +#include "../../events/SDL_keyboard_c.h"
    3.30 +
    3.31 +void
    3.32 +X11_InitKeyboard(_THIS)
    3.33 +{
    3.34 +    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    3.35 +    SDL_Keyboard keyboard;
    3.36 +
    3.37 +    SDL_zero(keyboard);
    3.38 +    data->keyboard = SDL_AddKeyboard(&keyboard, -1);
    3.39 +}
    3.40 +
    3.41 +void
    3.42 +X11_QuitKeyboard(_THIS)
    3.43 +{
    3.44 +    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    3.45 +
    3.46 +    SDL_DelKeyboard(data->keyboard);
    3.47 +}
    3.48 +
    3.49 +/* vi: set ts=4 sw=4 expandtab: */
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/video/x11/SDL_x11keyboard.h	Wed Jul 26 06:34:54 2006 +0000
     4.3 @@ -0,0 +1,32 @@
     4.4 +/*
     4.5 +    SDL - Simple DirectMedia Layer
     4.6 +    Copyright (C) 1997-2006 Sam Lantinga
     4.7 +
     4.8 +    This library is free software; you can redistribute it and/or
     4.9 +    modify it under the terms of the GNU Lesser General Public
    4.10 +    License as published by the Free Software Foundation; either
    4.11 +    version 2.1 of the License, or (at your option) any later version.
    4.12 +
    4.13 +    This library is distributed in the hope that it will be useful,
    4.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.16 +    Lesser General Public License for more details.
    4.17 +
    4.18 +    You should have received a copy of the GNU Lesser General Public
    4.19 +    License along with this library; if not, write to the Free Software
    4.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    4.21 +
    4.22 +    Sam Lantinga
    4.23 +    slouken@libsdl.org
    4.24 +*/
    4.25 +#include "SDL_config.h"
    4.26 +
    4.27 +#ifndef _SDL_x11keyboard_h
    4.28 +#define _SDL_x11keyboard_h
    4.29 +
    4.30 +extern void X11_InitKeyboard(_THIS);
    4.31 +extern void X11_QuitKeyboard(_THIS);
    4.32 +
    4.33 +#endif /* _SDL_x11keyboard_h */
    4.34 +
    4.35 +/* vi: set ts=4 sw=4 expandtab: */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/src/video/x11/SDL_x11modes.c	Wed Jul 26 06:34:54 2006 +0000
     5.3 @@ -0,0 +1,139 @@
     5.4 +/*
     5.5 +    SDL - Simple DirectMedia Layer
     5.6 +    Copyright (C) 1997-2006 Sam Lantinga
     5.7 +
     5.8 +    This library is free software; you can redistribute it and/or
     5.9 +    modify it under the terms of the GNU Lesser General Public
    5.10 +    License as published by the Free Software Foundation; either
    5.11 +    version 2.1 of the License, or (at your option) any later version.
    5.12 +
    5.13 +    This library is distributed in the hope that it will be useful,
    5.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.16 +    Lesser General Public License for more details.
    5.17 +
    5.18 +    You should have received a copy of the GNU Lesser General Public
    5.19 +    License along with this library; if not, write to the Free Software
    5.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    5.21 +
    5.22 +    Sam Lantinga
    5.23 +    slouken@libsdl.org
    5.24 +*/
    5.25 +#include "SDL_config.h"
    5.26 +
    5.27 +#include "SDL_x11video.h"
    5.28 +
    5.29 +
    5.30 +static int
    5.31 +get_visualinfo(Display * display, int screen, XVisualInfo * vinfo)
    5.32 +{
    5.33 +    const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID");
    5.34 +    int use_directcolor = 1;
    5.35 +    int depth;
    5.36 +
    5.37 +    /* Look for an exact visual, if requested */
    5.38 +    if (visual_id) {
    5.39 +        XVisualInfo *vi, template;
    5.40 +        int nvis;
    5.41 +
    5.42 +        SDL_zero(template);
    5.43 +        template.visualid = SDL_strtol(visual_id, NULL, 0);
    5.44 +        vi = XGetVisualInfo(display, VisualIDMask, &template, &nvis);
    5.45 +        if (vi) {
    5.46 +            *vinfo = *vi;
    5.47 +            XFree(vi);
    5.48 +            return 0;
    5.49 +        }
    5.50 +    }
    5.51 +
    5.52 +    depth = DefaultDepth(display, screen);
    5.53 +    if ((use_directcolor &&
    5.54 +         XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) ||
    5.55 +        XMatchVisualInfo(display, screen, depth, TrueColor, vinfo) ||
    5.56 +        XMatchVisualInfo(display, screen, depth, PseudoColor, vinfo) ||
    5.57 +        XMatchVisualInfo(display, screen, depth, StaticColor, vinfo)) {
    5.58 +        return 0;
    5.59 +    }
    5.60 +    return -1;
    5.61 +}
    5.62 +
    5.63 +void
    5.64 +X11_InitModes(_THIS)
    5.65 +{
    5.66 +    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    5.67 +    int screen;
    5.68 +    int n;
    5.69 +    XPixmapFormatValues *p;
    5.70 +
    5.71 +    p = XListPixmapFormats(data->display, &n);
    5.72 +    for (screen = 0; screen < ScreenCount(data->display); ++screen) {
    5.73 +        XVisualInfo vinfo;
    5.74 +        int i, bpp;
    5.75 +        Uint32 Rmask, Gmask, Bmask, Amask;
    5.76 +        SDL_VideoDisplay display;
    5.77 +        SDL_DisplayData *displaydata;
    5.78 +        SDL_DisplayMode mode;
    5.79 +
    5.80 +        if (get_visualinfo(data->display, screen, &vinfo) < 0) {
    5.81 +            continue;
    5.82 +        }
    5.83 +
    5.84 +        bpp = vinfo.depth;
    5.85 +        for (i = 0; i < n; ++i) {
    5.86 +            if (p[i].depth == vinfo.depth) {
    5.87 +                bpp = p[i].bits_per_pixel;
    5.88 +                break;
    5.89 +            }
    5.90 +        }
    5.91 +        Rmask = vinfo.visual->red_mask;
    5.92 +        Gmask = vinfo.visual->green_mask;
    5.93 +        Bmask = vinfo.visual->blue_mask;
    5.94 +        if (vinfo.depth == 32) {
    5.95 +            Amask = (0xFFFFFFFF & ~(Rmask | Gmask | Bmask));
    5.96 +        } else {
    5.97 +            Amask = 0;
    5.98 +        }
    5.99 +        mode.format =
   5.100 +            SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
   5.101 +        mode.w = DisplayWidth(data->display, screen);
   5.102 +        mode.h = DisplayHeight(data->display, screen);
   5.103 +        mode.refresh_rate = 0;
   5.104 +        mode.driverdata = NULL;
   5.105 +
   5.106 +        displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
   5.107 +        if (!displaydata) {
   5.108 +            continue;
   5.109 +        }
   5.110 +        displaydata->screen = screen;
   5.111 +        displaydata->visual = vinfo.visual;
   5.112 +
   5.113 +        SDL_zero(display);
   5.114 +        display.desktop_mode = mode;
   5.115 +        display.current_mode = mode;
   5.116 +        display.driverdata = displaydata;
   5.117 +        SDL_AddVideoDisplay(&display);
   5.118 +    }
   5.119 +    XFree(p);
   5.120 +}
   5.121 +
   5.122 +void
   5.123 +X11_GetDisplayModes(_THIS)
   5.124 +{
   5.125 +    SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
   5.126 +    SDL_DisplayMode mode;
   5.127 +    //SDL_AddDisplayMode(_this->current_display, &mode);
   5.128 +}
   5.129 +
   5.130 +int
   5.131 +X11_SetDisplayMode(_THIS, SDL_DisplayMode * mode)
   5.132 +{
   5.133 +    //SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata;
   5.134 +    return -1;
   5.135 +}
   5.136 +
   5.137 +void
   5.138 +X11_QuitModes(_THIS)
   5.139 +{
   5.140 +}
   5.141 +
   5.142 +/* vi: set ts=4 sw=4 expandtab: */
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/src/video/x11/SDL_x11modes.h	Wed Jul 26 06:34:54 2006 +0000
     6.3 @@ -0,0 +1,46 @@
     6.4 +/*
     6.5 +    SDL - Simple DirectMedia Layer
     6.6 +    Copyright (C) 1997-2006 Sam Lantinga
     6.7 +
     6.8 +    This library is free software; you can redistribute it and/or
     6.9 +    modify it under the terms of the GNU Lesser General Public
    6.10 +    License as published by the Free Software Foundation; either
    6.11 +    version 2.1 of the License, or (at your option) any later version.
    6.12 +
    6.13 +    This library is distributed in the hope that it will be useful,
    6.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.16 +    Lesser General Public License for more details.
    6.17 +
    6.18 +    You should have received a copy of the GNU Lesser General Public
    6.19 +    License along with this library; if not, write to the Free Software
    6.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    6.21 +
    6.22 +    Sam Lantinga
    6.23 +    slouken@libsdl.org
    6.24 +*/
    6.25 +#include "SDL_config.h"
    6.26 +
    6.27 +#ifndef _SDL_x11modes_h
    6.28 +#define _SDL_x11modes_h
    6.29 +
    6.30 +typedef struct
    6.31 +{
    6.32 +    int screen;
    6.33 +    Visual *visual;
    6.34 +} SDL_DisplayData;
    6.35 +
    6.36 +//typedef struct
    6.37 +//{
    6.38 +//    TCHAR DeviceName[32];
    6.39 +//    DEVMODE DeviceMode;
    6.40 +//} SDL_DisplayModeData;
    6.41 +
    6.42 +extern void X11_InitModes(_THIS);
    6.43 +extern void X11_GetDisplayModes(_THIS);
    6.44 +extern int X11_SetDisplayMode(_THIS, SDL_DisplayMode * mode);
    6.45 +extern void X11_QuitModes(_THIS);
    6.46 +
    6.47 +#endif /* _SDL_x11modes_h */
    6.48 +
    6.49 +/* vi: set ts=4 sw=4 expandtab: */
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/video/x11/SDL_x11mouse.c	Wed Jul 26 06:34:54 2006 +0000
     7.3 @@ -0,0 +1,46 @@
     7.4 +/*
     7.5 +    SDL - Simple DirectMedia Layer
     7.6 +    Copyright (C) 1997-2006 Sam Lantinga
     7.7 +
     7.8 +    This library is free software; you can redistribute it and/or
     7.9 +    modify it under the terms of the GNU Lesser General Public
    7.10 +    License as published by the Free Software Foundation; either
    7.11 +    version 2.1 of the License, or (at your option) any later version.
    7.12 +
    7.13 +    This library is distributed in the hope that it will be useful,
    7.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    7.16 +    Lesser General Public License for more details.
    7.17 +
    7.18 +    You should have received a copy of the GNU Lesser General Public
    7.19 +    License along with this library; if not, write to the Free Software
    7.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    7.21 +
    7.22 +    Sam Lantinga
    7.23 +    slouken@libsdl.org
    7.24 +*/
    7.25 +#include "SDL_config.h"
    7.26 +
    7.27 +#include "SDL_x11video.h"
    7.28 +
    7.29 +#include "../../events/SDL_mouse_c.h"
    7.30 +
    7.31 +void
    7.32 +X11_InitMouse(_THIS)
    7.33 +{
    7.34 +    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    7.35 +    SDL_Mouse mouse;
    7.36 +
    7.37 +    SDL_zero(mouse);
    7.38 +    data->mouse = SDL_AddMouse(&mouse, -1);
    7.39 +}
    7.40 +
    7.41 +void
    7.42 +X11_QuitMouse(_THIS)
    7.43 +{
    7.44 +    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    7.45 +
    7.46 +    SDL_DelMouse(data->mouse);
    7.47 +}
    7.48 +
    7.49 +/* vi: set ts=4 sw=4 expandtab: */
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/video/x11/SDL_x11mouse.h	Wed Jul 26 06:34:54 2006 +0000
     8.3 @@ -0,0 +1,32 @@
     8.4 +/*
     8.5 +    SDL - Simple DirectMedia Layer
     8.6 +    Copyright (C) 1997-2006 Sam Lantinga
     8.7 +
     8.8 +    This library is free software; you can redistribute it and/or
     8.9 +    modify it under the terms of the GNU Lesser General Public
    8.10 +    License as published by the Free Software Foundation; either
    8.11 +    version 2.1 of the License, or (at your option) any later version.
    8.12 +
    8.13 +    This library is distributed in the hope that it will be useful,
    8.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    8.16 +    Lesser General Public License for more details.
    8.17 +
    8.18 +    You should have received a copy of the GNU Lesser General Public
    8.19 +    License along with this library; if not, write to the Free Software
    8.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    8.21 +
    8.22 +    Sam Lantinga
    8.23 +    slouken@libsdl.org
    8.24 +*/
    8.25 +#include "SDL_config.h"
    8.26 +
    8.27 +#ifndef _SDL_x11mouse_h
    8.28 +#define _SDL_x11mouse_h
    8.29 +
    8.30 +extern void X11_InitMouse(_THIS);
    8.31 +extern void X11_QuitMouse(_THIS);
    8.32 +
    8.33 +#endif /* _SDL_x11mouse_h */
    8.34 +
    8.35 +/* vi: set ts=4 sw=4 expandtab: */
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/src/video/x11/SDL_x11sym.h	Wed Jul 26 06:34:54 2006 +0000
     9.3 @@ -0,0 +1,518 @@
     9.4 +/*
     9.5 +    SDL - Simple DirectMedia Layer
     9.6 +    Copyright (C) 1997-2004 Sam Lantinga
     9.7 +
     9.8 +    This library is free software; you can redistribute it and/or
     9.9 +    modify it under the terms of the GNU Library General Public
    9.10 +    License as published by the Free Software Foundation; either
    9.11 +    version 2 of the License, or (at your option) any later version.
    9.12 +
    9.13 +    This library is distributed in the hope that it will be useful,
    9.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    9.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    9.16 +    Library General Public License for more details.
    9.17 +
    9.18 +    You should have received a copy of the GNU Library General Public
    9.19 +    License along with this library; if not, write to the Free
    9.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    9.21 +
    9.22 +    Sam Lantinga
    9.23 +    slouken@libsdl.org
    9.24 +*/
    9.25 +
    9.26 +SDL_X11_MODULE(BASEXLIB)
    9.27 +    SDL_X11_SYM(XClassHint *, XAllocClassHint, (void), (), return)
    9.28 +    SDL_X11_SYM(Status, XAllocColor, (Display * a, Colormap b, XColor * c),
    9.29 +            (a, b, c), return) SDL_X11_SYM(XSizeHints *, XAllocSizeHints,
    9.30 +                                           (void), (),
    9.31 +                                           return) SDL_X11_SYM(XWMHints *,
    9.32 +                                                               XAllocWMHints,
    9.33 +                                                               (void), (),
    9.34 +                                                               return)
    9.35 +    SDL_X11_SYM(int, XChangePointerControl,
    9.36 +            (Display * a, Bool b, Bool c, int d, int e, int f), (a, b, c, d,
    9.37 +                                                             e, f),
    9.38 +            return) SDL_X11_SYM(int, XChangeProperty, (Display * a,
    9.39 +                                                       Window b, Atom c,
    9.40 +                                                       Atom d, int e, int f,
    9.41 +                                                       _Xconst unsigned char
    9.42 +                                                       *g, int h), (a, b, c,
    9.43 +                                                                    d, e, f,
    9.44 +                                                                    g, h),
    9.45 +                                return) SDL_X11_SYM(int,
    9.46 +                                                    XChangeWindowAttributes,
    9.47 +                                                    (Display * a, Window b,
    9.48 +                                                     unsigned long c,
    9.49 +                                                     XSetWindowAttributes *
    9.50 +                                                     d), (a, b, c, d), return)
    9.51 +    SDL_X11_SYM(Bool, XCheckTypedEvent, (Display * a, int b, XEvent * c),
    9.52 +            (a, b, c), return) SDL_X11_SYM(int, XClearWindow, (Display * a,
    9.53 +                                                               Window b),
    9.54 +                                           (a, b), return) SDL_X11_SYM(int,
    9.55 +                                                                       XCloseDisplay,
    9.56 +                                                                       (Display
    9.57 +                                                                        *
    9.58 +                                                                        a),
    9.59 +                                                                       (a),
    9.60 +                                                                       return)
    9.61 +    SDL_X11_SYM(Colormap, XCreateColormap,
    9.62 +            (Display * a, Window b, Visual * c, int d), (a, b, c, d),
    9.63 +            return) SDL_X11_SYM(Cursor, XCreatePixmapCursor, (Display * a,
    9.64 +                                                              Pixmap b,
    9.65 +                                                              Pixmap c,
    9.66 +                                                              XColor * d,
    9.67 +                                                              XColor * e,
    9.68 +                                                              unsigned int
    9.69 +                                                              f,
    9.70 +                                                              unsigned int
    9.71 +                                                              g), (a, b, c,
    9.72 +                                                                   d, e, f,
    9.73 +                                                                   g),
    9.74 +                                return) SDL_X11_SYM(GC, XCreateGC,
    9.75 +                                                    (Display * a,
    9.76 +                                                     Drawable b,
    9.77 +                                                     unsigned long c,
    9.78 +                                                     XGCValues * d), (a, b,
    9.79 +                                                                      c,
    9.80 +                                                                      d),
    9.81 +                                                    return)
    9.82 +    SDL_X11_SYM(XImage *, XCreateImage,
    9.83 +            (Display * a, Visual * b, unsigned int c, int d, int e, char *f,
    9.84 +         unsigned int g, unsigned int h, int i, int j), (a, b, c, d, e,
    9.85 +                                                     f, g, h, i, j),
    9.86 +return) SDL_X11_SYM(Pixmap, XCreatePixmap, (Display * a,
    9.87 +Drawable b,
    9.88 +unsigned int c,
    9.89 +unsigned int d,
    9.90 +unsigned int e), (a,
    9.91 +      b,
    9.92 +      c,
    9.93 +      d,
    9.94 +      e),
    9.95 +return) SDL_X11_SYM(Pixmap,
    9.96 +XCreatePixmapFromBitmapData,
    9.97 +(Display * a,
    9.98 +Drawable b, char *c,
    9.99 +unsigned int d,
   9.100 +unsigned int e,
   9.101 +unsigned long f, unsigned long g, unsigned int h), (a, b, c, d, e, f, g, h), return)
   9.102 +    SDL_X11_SYM(Window, XCreateSimpleWindow,
   9.103 +            (Display * a, Window b, int c, int d, unsigned int e,
   9.104 +         unsigned int f, unsigned int g, unsigned long h,
   9.105 +         unsigned long i), (a, b, c, d, e, f, g, h, i),
   9.106 +return) SDL_X11_SYM(Window, XCreateWindow, (Display * a,
   9.107 +Window b, int c,
   9.108 +int d,
   9.109 +unsigned int e,
   9.110 +unsigned int f,
   9.111 +unsigned int g,
   9.112 +int h,
   9.113 +unsigned int i,
   9.114 +Visual * j,
   9.115 +unsigned long k,
   9.116 +XSetWindowAttributes
   9.117 +* l), (a, b, c, d,
   9.118 +      e, f, g, h,
   9.119 +      i, j, k, l),
   9.120 +return) SDL_X11_SYM(int, XDefineCursor, (Display * a, Window b, Cursor c), (a, b, c), return)
   9.121 +    SDL_X11_SYM(int, XDeleteProperty, (Display * a, Window b, Atom c), (a, b, c),
   9.122 +            return) SDL_X11_SYM(int, XDestroyWindow, (Display * a,
   9.123 +                                                      Window b), (a, b),
   9.124 +                                return) SDL_X11_SYM(char *, XDisplayName,
   9.125 +                                                    (_Xconst char *a), (a),
   9.126 +                                                    return)
   9.127 +    SDL_X11_SYM(int, XEventsQueued, (Display * a, int b), (a, b),
   9.128 +            return) SDL_X11_SYM(Bool, XFilterEvent, (XEvent * event,
   9.129 +                                                     Window w), (event, w),
   9.130 +                                return) SDL_X11_SYM(int, XFlush,
   9.131 +                                                    (Display * a), (a),
   9.132 +                                                    return)
   9.133 +    SDL_X11_SYM(int, XFree, (void *a), (a), return) SDL_X11_SYM(int,
   9.134 +                                                                XFreeColormap,
   9.135 +                                                                (Display *
   9.136 +                                                                 a,
   9.137 +                                                                 Colormap
   9.138 +                                                                 b), (a, b),
   9.139 +                                                                return)
   9.140 +    SDL_X11_SYM(int, XFreeColors,
   9.141 +            (Display * a, Colormap b, unsigned long *c, int d, unsigned long e),
   9.142 +            (a, b, c, d, e), return) SDL_X11_SYM(int, XFreeCursor,
   9.143 +                                                 (Display * a, Cursor b),
   9.144 +                                                 (a, b), return)
   9.145 +    SDL_X11_SYM(int, XFreeGC, (Display * a, GC b), (a, b),
   9.146 +            return) SDL_X11_SYM(int, XFreeModifiermap,
   9.147 +                                (XModifierKeymap * a), (a),
   9.148 +                                return) SDL_X11_SYM(int, XFreePixmap,
   9.149 +                                                    (Display * a,
   9.150 +                                                     Pixmap b), (a, b),
   9.151 +                                                    return)
   9.152 +    SDL_X11_SYM(int, XGetErrorDatabaseText,
   9.153 +            (Display * a, _Xconst char *b, _Xconst char *c, _Xconst char *d,
   9.154 +         char *e, int f), (a, b, c, d, e, f),
   9.155 +return) SDL_X11_SYM(XModifierKeymap *, XGetModifierMapping, (Display * a), (a), return) SDL_X11_SYM(int, XGetPointerControl,
   9.156 +                                            (Display * a, int *b, int *c,
   9.157 +                                             int *d), (a, b, c, d), return)
   9.158 +    SDL_X11_SYM(int, XGetScreenSaver,
   9.159 +            (Display * a, int *b, int *c, int *d, int *e), (a, b, c, d, e),
   9.160 +            return) SDL_X11_SYM(XVisualInfo *, XGetVisualInfo, (Display * a,
   9.161 +                                                                long b,
   9.162 +                                                                XVisualInfo
   9.163 +                                                                * c,
   9.164 +                                                                int *d), (a,
   9.165 +                                                                          b,
   9.166 +                                                                          c,
   9.167 +                                                                          d),
   9.168 +                                return) SDL_X11_SYM(XWMHints *,
   9.169 +                                                    XGetWMHints,
   9.170 +                                                    (Display * a,
   9.171 +                                                     Window b), (a, b),
   9.172 +                                                    return)
   9.173 +    SDL_X11_SYM(Status, XGetWindowAttributes,
   9.174 +            (Display * a, Window b, XWindowAttributes * c), (a, b, c),
   9.175 +            return) SDL_X11_SYM(int, XGrabKeyboard, (Display * a, Window b,
   9.176 +                                                     Bool c, int d, int e,
   9.177 +                                                     Time f), (a, b, c, d,
   9.178 +                                                               e, f),
   9.179 +                                return) SDL_X11_SYM(int, XGrabPointer,
   9.180 +                                                    (Display * a, Window b,
   9.181 +                                                     Bool c,
   9.182 +                                                     unsigned int d, int e,
   9.183 +                                                     int f, Window g,
   9.184 +                                                     Cursor h, Time i), (a,
   9.185 +                                                                         b,
   9.186 +                                                                         c,
   9.187 +                                                                         d,
   9.188 +                                                                         e,
   9.189 +                                                                         f,
   9.190 +                                                                         g,
   9.191 +                                                                         h,
   9.192 +                                                                         i),
   9.193 +                                                    return)
   9.194 +    SDL_X11_SYM(Status, XIconifyWindow, (Display * a, Window b, int c),
   9.195 +            (a, b, c), return) SDL_X11_SYM(int, XInstallColormap,
   9.196 +                                           (Display * a, Colormap b), (a,
   9.197 +                                                                       b),
   9.198 +                                           return) SDL_X11_SYM(KeyCode,
   9.199 +                                                               XKeysymToKeycode,
   9.200 +                                                               (Display *
   9.201 +                                                                a,
   9.202 +                                                                KeySym b),
   9.203 +                                                               (a, b), return)
   9.204 +    SDL_X11_SYM(Atom, XInternAtom, (Display * a, _Xconst char *b, Bool c),
   9.205 +            (a, b, c), return) SDL_X11_SYM(XPixmapFormatValues *,
   9.206 +                                           XListPixmapFormats, (Display * a,
   9.207 +                                                                int *b), (a,
   9.208 +                                                                          b),
   9.209 +                                           return) SDL_X11_SYM(int,
   9.210 +                                                               XLookupString,
   9.211 +                                                               (XKeyEvent *
   9.212 +                                                                a, char *b,
   9.213 +                                                                int c,
   9.214 +                                                                KeySym * d,
   9.215 +                                                                XComposeStatus
   9.216 +                                                                * e), (a,
   9.217 +                                                                       b,
   9.218 +                                                                       c,
   9.219 +                                                                       d,
   9.220 +                                                                       e),
   9.221 +                                                               return)
   9.222 +    SDL_X11_SYM(int, XMapRaised, (Display * a, Window b), (a, b),
   9.223 +            return) SDL_X11_SYM(int, XMapWindow, (Display * a, Window b),
   9.224 +                                (a, b), return) SDL_X11_SYM(int,
   9.225 +                                                            XMaskEvent,
   9.226 +                                                            (Display * a,
   9.227 +                                                             long b,
   9.228 +                                                             XEvent * c),
   9.229 +                                                            (a, b, c), return)
   9.230 +    SDL_X11_SYM(Status, XMatchVisualInfo,
   9.231 +            (Display * a, int b, int c, int d, XVisualInfo * e), (a, b, c, d, e),
   9.232 +            return) SDL_X11_SYM(int, XMissingExtension, (Display * a,
   9.233 +                                                         _Xconst char *b),
   9.234 +                                (a, b), return) SDL_X11_SYM(int,
   9.235 +                                                            XMoveResizeWindow,
   9.236 +                                                            (Display * a,
   9.237 +                                                             Window b,
   9.238 +                                                             int c, int d,
   9.239 +                                                             unsigned int
   9.240 +                                                             e,
   9.241 +                                                             unsigned int
   9.242 +                                                             f), (a, b, c,
   9.243 +                                                                  d, e, f),
   9.244 +                                                            return)
   9.245 +    SDL_X11_SYM(int, XMoveWindow, (Display * a, Window b, int c, int d),
   9.246 +            (a, b, c, d), return) SDL_X11_SYM(int, XNextEvent, (Display * a,
   9.247 +                                                                XEvent * b),
   9.248 +                                              (a, b),
   9.249 +                                              return) SDL_X11_SYM(Display
   9.250 +                                                                  *,
   9.251 +                                                                  XOpenDisplay,
   9.252 +                                                                  (_Xconst
   9.253 +                                                                   char
   9.254 +                                                                   *a),
   9.255 +                                                                  (a), return)
   9.256 +    SDL_X11_SYM(int, XPeekEvent, (Display * a, XEvent * b), (a, b),
   9.257 +            return) SDL_X11_SYM(int, XPending, (Display * a), (a),
   9.258 +                                return) SDL_X11_SYM(int, XPutImage,
   9.259 +                                                    (Display * a,
   9.260 +                                                     Drawable b, GC c,
   9.261 +                                                     XImage * d, int e,
   9.262 +                                                     int f, int g, int h,
   9.263 +                                                     unsigned int i,
   9.264 +                                                     unsigned int j), (a,
   9.265 +                                                                       b,
   9.266 +                                                                       c,
   9.267 +                                                                       d,
   9.268 +                                                                       e,
   9.269 +                                                                       f,
   9.270 +                                                                       g,
   9.271 +                                                                       h,
   9.272 +                                                                       i,
   9.273 +                                                                       j),
   9.274 +                                                    return)
   9.275 +    SDL_X11_SYM(int, XQueryColors, (Display * a, Colormap b, XColor * c, int d),
   9.276 +            (a, b, c, d), return) SDL_X11_SYM(int, XQueryKeymap,
   9.277 +                                              (Display * a, char *b), (a,
   9.278 +                                                                       b),
   9.279 +                                              return) SDL_X11_SYM(Bool,
   9.280 +                                                                  XQueryPointer,
   9.281 +                                                                  (Display
   9.282 +                                                                   * a,
   9.283 +                                                                   Window
   9.284 +                                                                   b,
   9.285 +                                                                   Window *
   9.286 +                                                                   c,
   9.287 +                                                                   Window *
   9.288 +                                                                   d,
   9.289 +                                                                   int *e,
   9.290 +                                                                   int *f,
   9.291 +                                                                   int *g,
   9.292 +                                                                   int *h,
   9.293 +                                                                   unsigned
   9.294 +                                                                   int *i),
   9.295 +                                                                  (a, b, c,
   9.296 +                                                                   d, e, f,
   9.297 +                                                                   g, h,
   9.298 +                                                                   i), return)
   9.299 +    SDL_X11_SYM(int, XRaiseWindow, (Display * a, Window b), (a, b),
   9.300 +            return) SDL_X11_SYM(int, XReparentWindow, (Display * a,
   9.301 +                                                       Window b, Window c,
   9.302 +                                                       int d, int e), (a, b,
   9.303 +                                                                       c, d,
   9.304 +                                                                       e),
   9.305 +                                return) SDL_X11_SYM(int, XResizeWindow,
   9.306 +                                                    (Display * a, Window b,
   9.307 +                                                     unsigned int c,
   9.308 +                                                     unsigned int d), (a,
   9.309 +                                                                       b,
   9.310 +                                                                       c,
   9.311 +                                                                       d),
   9.312 +                                                    return)
   9.313 +    SDL_X11_SYM(int, XSelectInput, (Display * a, Window b, long c), (a, b, c),
   9.314 +            return) SDL_X11_SYM(Status, XSendEvent, (Display * a, Window b,
   9.315 +                                                     Bool c, long d,
   9.316 +                                                     XEvent * e), (a, b, c,
   9.317 +                                                                   d, e),
   9.318 +                                return) SDL_X11_SYM(int, XSetClassHint,
   9.319 +                                                    (Display * a, Window b,
   9.320 +                                                     XClassHint * c), (a,
   9.321 +                                                                       b,
   9.322 +                                                                       c),
   9.323 +                                                    return)
   9.324 +    SDL_X11_SYM(XErrorHandler, XSetErrorHandler, (XErrorHandler a), (a),
   9.325 +            return) SDL_X11_SYM(XIOErrorHandler, XSetIOErrorHandler,
   9.326 +                                (XIOErrorHandler a), (a),
   9.327 +                                return) SDL_X11_SYM(int, XSetScreenSaver,
   9.328 +                                                    (Display * a, int b,
   9.329 +                                                     int c, int d, int e),
   9.330 +                                                    (a, b, c, d, e), return)
   9.331 +    SDL_X11_SYM(int, XSetTransientForHint, (Display * a, Window b, Window c),
   9.332 +            (a, b, c), return) SDL_X11_SYM(int, XSetWMHints, (Display * a,
   9.333 +                                                              Window b,
   9.334 +                                                              XWMHints * c),
   9.335 +                                           (a, b, c),
   9.336 +                                           return) SDL_X11_SYM(void,
   9.337 +                                                               XSetTextProperty,
   9.338 +                                                               (Display *
   9.339 +                                                                a,
   9.340 +                                                                Window b,
   9.341 +                                                                XTextProperty
   9.342 +                                                                * c,
   9.343 +                                                                Atom d),
   9.344 +                                                               (a, b, c, d),)
   9.345 +SDL_X11_SYM(void, XSetWMNormalHints, (Display * a, Window b, XSizeHints * c),
   9.346 +            (a, b, c),)
   9.347 +SDL_X11_SYM(Status, XSetWMProtocols,
   9.348 +            (Display * a, Window b, Atom * c, int d), (a, b, c, d), return)
   9.349 +SDL_X11_SYM(int, XSetWindowBackground,
   9.350 +            (Display * a, Window b, unsigned long c), (a, b, c), return)
   9.351 +SDL_X11_SYM(int, XSetWindowBackgroundPixmap,
   9.352 +            (Display * a, Window b, Pixmap c), (a, b, c), return)
   9.353 +SDL_X11_SYM(int, XSetWindowColormap, (Display * a, Window b, Colormap c),
   9.354 +            (a, b, c), return)
   9.355 +SDL_X11_SYM(int, XStoreColors, (Display * a, Colormap b, XColor * c, int d),
   9.356 +            (a, b, c, d), return)
   9.357 +SDL_X11_SYM(Status, XStringListToTextProperty,
   9.358 +            (char **a, int b, XTextProperty * c), (a, b, c), return)
   9.359 +SDL_X11_SYM(int, XSync, (Display * a, Bool b), (a, b), return)
   9.360 +SDL_X11_SYM(int, XUngrabKeyboard, (Display * a, Time b), (a, b), return)
   9.361 +SDL_X11_SYM(int, XUngrabPointer, (Display * a, Time b), (a, b), return)
   9.362 +SDL_X11_SYM(int, XUnmapWindow, (Display * a, Window b), (a, b), return)
   9.363 +SDL_X11_SYM(int, XWarpPointer,
   9.364 +            (Display * a, Window b, Window c, int d, int e, unsigned int f,
   9.365 +             unsigned int g, int h, int i), (a, b, c, d, e, f, g, h, i),
   9.366 +            return)
   9.367 +SDL_X11_SYM(VisualID, XVisualIDFromVisual, (Visual * a), (a), return)
   9.368 +SDL_X11_SYM(XExtDisplayInfo *, XextAddDisplay,
   9.369 +            (XExtensionInfo * a, Display * b, char *c, XExtensionHooks * d,
   9.370 +             int e, XPointer f), (a, b, c, d, e, f), return)
   9.371 +SDL_X11_SYM(XExtensionInfo *, XextCreateExtension, (void), (), return)
   9.372 +SDL_X11_SYM(void, XextDestroyExtension, (XExtensionInfo * a), (a),)
   9.373 +SDL_X11_SYM(XExtDisplayInfo *, XextFindDisplay,
   9.374 +            (XExtensionInfo * a, Display * b), (a, b), return)
   9.375 +SDL_X11_SYM(int, XextRemoveDisplay, (XExtensionInfo * a, Display * b),
   9.376 +            (a, b), return)
   9.377 +SDL_X11_SYM(Bool, XQueryExtension,
   9.378 +            (Display * a, _Xconst char *b, int *c, int *d, int *e), (a, b, c,
   9.379 +                                                                     d, e),
   9.380 +            return)
   9.381 +SDL_X11_SYM(char *, XDisplayString, (Display * a), (a), return)
   9.382 +SDL_X11_SYM(int, XGetErrorText, (Display * a, int b, char *c, int d),
   9.383 +            (a, b, c, d), return)
   9.384 +SDL_X11_SYM(void, _XEatData, (Display * a, unsigned long b), (a, b),)
   9.385 +SDL_X11_SYM(void, _XFlush, (Display * a), (a),)
   9.386 +SDL_X11_SYM(void, _XFlushGCCache, (Display * a, GC b), (a, b),)
   9.387 +SDL_X11_SYM(int, _XRead, (Display * a, char *b, long c), (a, b, c), return)
   9.388 +SDL_X11_SYM(void, _XReadPad, (Display * a, char *b, long c), (a, b, c),)
   9.389 +SDL_X11_SYM(void, _XSend, (Display * a, _Xconst char *b, long c), (a, b, c),)
   9.390 +SDL_X11_SYM(Status, _XReply, (Display * a, xReply * b, int c, Bool d),
   9.391 +            (a, b, c, d), return)
   9.392 +SDL_X11_SYM(unsigned long, _XSetLastRequestRead,
   9.393 +            (Display * a, xGenericReply * b), (a, b), return)
   9.394 +SDL_X11_SYM(SDL_X11_XSynchronizeRetType, XSynchronize, (Display * a, Bool b),
   9.395 +            (a, b), return)
   9.396 +SDL_X11_SYM(SDL_X11_XESetWireToEventRetType, XESetWireToEvent,
   9.397 +            (Display * a, int b, SDL_X11_XESetWireToEventRetType c), (a, b,
   9.398 +                                                                      c),
   9.399 +            return)
   9.400 +SDL_X11_SYM(SDL_X11_XESetEventToWireRetType, XESetEventToWire,
   9.401 +            (Display * a, int b, SDL_X11_XESetEventToWireRetType c), (a, b,
   9.402 +                                                                      c),
   9.403 +            return)
   9.404 +SDL_X11_SYM(XExtensionErrorHandler, XSetExtensionErrorHandler,
   9.405 +            (XExtensionErrorHandler a), (a), return)
   9.406 +#if NeedWidePrototypes
   9.407 +SDL_X11_SYM(KeySym, XKeycodeToKeysym, (Display * a, unsigned int b, int c),
   9.408 +            (a, b, c), return)
   9.409 +#else
   9.410 +SDL_X11_SYM(KeySym, XKeycodeToKeysym, (Display * a, KeyCode b, int c),
   9.411 +            (a, b, c), return)
   9.412 +#endif
   9.413 +#ifdef X_HAVE_UTF8_STRING
   9.414 +SDL_X11_MODULE(UTF8)
   9.415 +SDL_X11_SYM(int, Xutf8TextListToTextProperty,
   9.416 +            (Display * a, char **b, int c, XICCEncodingStyle d,
   9.417 +             XTextProperty * e), (a, b, c, d, e), return)
   9.418 +SDL_X11_SYM(int, Xutf8LookupString,
   9.419 +            (XIC a, XKeyPressedEvent * b, char *c, int d, KeySym * e,
   9.420 +             Status * f), (a, b, c, d, e, f), return)
   9.421 +/*SDL_X11_SYM(XIC,XCreateIC,(XIM, ...),return)  !!! ARGH! */
   9.422 +SDL_X11_SYM(void, XDestroyIC, (XIC a), (a),)
   9.423 +SDL_X11_SYM(void, XSetICFocus, (XIC a), (a),)
   9.424 +SDL_X11_SYM(void, XUnsetICFocus, (XIC a), (a),)
   9.425 +SDL_X11_SYM(XIM, XOpenIM,
   9.426 +            (Display * a, struct _XrmHashBucketRec * b, char *c, char *d),
   9.427 +            (a, b, c, d), return)
   9.428 +SDL_X11_SYM(Status, XCloseIM, (XIM a), (a), return)
   9.429 +#endif
   9.430 +#ifndef NO_SHARED_MEMORY
   9.431 +SDL_X11_MODULE(SHM)
   9.432 +SDL_X11_SYM(Status, XShmAttach, (Display * a, XShmSegmentInfo * b), (a, b),
   9.433 +            return)
   9.434 +SDL_X11_SYM(Status, XShmDetach, (Display * a, XShmSegmentInfo * b), (a, b),
   9.435 +            return)
   9.436 +SDL_X11_SYM(Status, XShmPutImage,
   9.437 +            (Display * a, Drawable b, GC c, XImage * d, int e, int f, int g,
   9.438 +             int h, unsigned int i, unsigned int j, Bool k), (a, b, c, d, e,
   9.439 +                                                              f, g, h, i, j,
   9.440 +                                                              k), return)
   9.441 +SDL_X11_SYM(XImage *, XShmCreateImage,
   9.442 +            (Display * a, Visual * b, unsigned int c, int d, char *e,
   9.443 +             XShmSegmentInfo * f, unsigned int g, unsigned int h), (a, b, c,
   9.444 +                                                                    d, e, f,
   9.445 +                                                                    g, h),
   9.446 +            return)
   9.447 +SDL_X11_SYM(Bool, XShmQueryExtension, (Display * a), (a), return)
   9.448 +#endif
   9.449 +/*
   9.450 + * Not required...these only exist in code in headers on some 64-bit platforms,
   9.451 + *  and are removed via macros elsewhere, so it's safe for them to be missing.
   9.452 + */
   9.453 +#ifdef LONG64
   9.454 +SDL_X11_MODULE(IO_32BIT)
   9.455 +SDL_X11_SYM(int, _XData32,
   9.456 +            (Display * dpy, register long *data, unsigned len), (dpy, data,
   9.457 +                                                                 len), return)
   9.458 +SDL_X11_SYM(void, _XRead32, (Display * dpy, register long *data, long len),
   9.459 +            (dpy, data, len),)
   9.460 +#endif
   9.461 +/*
   9.462 + * These only show up on some variants of Unix.
   9.463 + */
   9.464 +#if defined(__osf__)
   9.465 +SDL_X11_MODULE(OSF_ENTRY_POINTS)
   9.466 +SDL_X11_SYM(void, _SmtBufferOverflow,
   9.467 +            (Display * dpy, register smtDisplayPtr p), (dpy, p),)
   9.468 +SDL_X11_SYM(void, _SmtIpError,
   9.469 +            (Display * dpy, register smtDisplayPtr p, int i), (dpy, p, i),)
   9.470 +SDL_X11_SYM(int, ipAllocateData, (ChannelPtr a, IPCard b, IPDataPtr * c),
   9.471 +            (a, b, c), return)
   9.472 +SDL_X11_SYM(int, ipUnallocateAndSendData, (ChannelPtr a, IPCard b), (a, b),
   9.473 +            return)
   9.474 +#endif
   9.475 +/* Xrandr support. */
   9.476 +#if SDL_VIDEO_DRIVER_X11_XRANDR
   9.477 +SDL_X11_MODULE(XRANDR)
   9.478 +SDL_X11_SYM(Status, XRRQueryVersion,
   9.479 +            (Display * dpy, int *major_versionp, int *minor_versionp), (dpy,
   9.480 +                                                                        major_versionp,
   9.481 +                                                                        minor_versionp),
   9.482 +            return)
   9.483 +SDL_X11_SYM(XRRScreenConfiguration *, XRRGetScreenInfo,
   9.484 +            (Display * dpy, Drawable draw), (dpy, draw), return)
   9.485 +SDL_X11_SYM(SizeID, XRRConfigCurrentConfiguration,
   9.486 +            (XRRScreenConfiguration * config, Rotation * rotation), (config,
   9.487 +                                                                     rotation),
   9.488 +            return)
   9.489 +SDL_X11_SYM(XRRScreenSize *, XRRConfigSizes,
   9.490 +            (XRRScreenConfiguration * config, int *nsizes), (config, nsizes),
   9.491 +            return)
   9.492 +SDL_X11_SYM(short *, XRRConfigRates,
   9.493 +            (XRRScreenConfiguration * config, int sizeID, int *nrates),
   9.494 +            (config, sizeID, nrates), return)
   9.495 +SDL_X11_SYM(Status, XRRSetScreenConfig,
   9.496 +            (Display * dpy, XRRScreenConfiguration * config, Drawable draw,
   9.497 +             int size_index, Rotation rotation, Time timestamp), (dpy,
   9.498 +                                                                  config,
   9.499 +                                                                  draw,
   9.500 +                                                                  size_index,
   9.501 +                                                                  rotation,
   9.502 +                                                                  timestamp),
   9.503 +            return)
   9.504 +SDL_X11_SYM(void, XRRFreeScreenConfigInfo, (XRRScreenConfiguration * config),
   9.505 +            (config),)
   9.506 +#endif
   9.507 +/* DPMS support */
   9.508 +#if SDL_VIDEO_DRIVER_X11_DPMS
   9.509 +SDL_X11_MODULE(DPMS)
   9.510 +SDL_X11_SYM(Status, DPMSQueryExtension,
   9.511 +            (Display * dpy, int *major_versionp, int *minor_versionp), (dpy,
   9.512 +                                                                        major_versionp,
   9.513 +                                                                        minor_versionp),
   9.514 +            return)
   9.515 +SDL_X11_SYM(Status, DPMSInfo, (Display * dpy, CARD16 * state, BOOL * onoff),
   9.516 +            (dpy, state, onoff), return)
   9.517 +SDL_X11_SYM(Status, DPMSEnable, (Display * dpy), (dpy), return)
   9.518 +SDL_X11_SYM(Status, DPMSDisable, (Display * dpy), (dpy), return)
   9.519 +#endif
   9.520 +/* end of SDL_x11sym.h ... */
   9.521 +/* vi: set ts=4 sw=4 expandtab: */
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/src/video/x11/SDL_x11video.c	Wed Jul 26 06:34:54 2006 +0000
    10.3 @@ -0,0 +1,196 @@
    10.4 +/*
    10.5 +    SDL - Simple DirectMedia Layer
    10.6 +    Copyright (C) 1997-2006 Sam Lantinga
    10.7 +
    10.8 +    This library is free software; you can redistribute it and/or
    10.9 +    modify it under the terms of the GNU Lesser General Public
   10.10 +    License as published by the Free Software Foundation; either
   10.11 +    version 2.1 of the License, or (at your option) any later version.
   10.12 +
   10.13 +    This library is distributed in the hope that it will be useful,
   10.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   10.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   10.16 +    Lesser General Public License for more details.
   10.17 +
   10.18 +    You should have received a copy of the GNU Lesser General Public
   10.19 +    License along with this library; if not, write to the Free Software
   10.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   10.21 +
   10.22 +    Sam Lantinga
   10.23 +    slouken@libsdl.org
   10.24 +*/
   10.25 +#include "SDL_config.h"
   10.26 +
   10.27 +#include "SDL_video.h"
   10.28 +#include "SDL_mouse.h"
   10.29 +#include "../SDL_sysvideo.h"
   10.30 +#include "../SDL_pixels_c.h"
   10.31 +
   10.32 +#include "SDL_x11video.h"
   10.33 +//#include "SDL_d3drender.h"
   10.34 +//#include "SDL_gdirender.h"
   10.35 +
   10.36 +/* Initialization/Query functions */
   10.37 +static int X11_VideoInit(_THIS);
   10.38 +static void X11_VideoQuit(_THIS);
   10.39 +
   10.40 +/* X11 driver bootstrap functions */
   10.41 +
   10.42 +static int
   10.43 +X11_Available(void)
   10.44 +{
   10.45 +    Display *display = NULL;
   10.46 +    if (SDL_X11_LoadSymbols()) {
   10.47 +        display = XOpenDisplay(NULL);
   10.48 +        if (display != NULL) {
   10.49 +            XCloseDisplay(display);
   10.50 +        }
   10.51 +        SDL_X11_UnloadSymbols();
   10.52 +    }
   10.53 +    return (display != NULL);
   10.54 +}
   10.55 +
   10.56 +static void
   10.57 +X11_DeleteDevice(SDL_VideoDevice * device)
   10.58 +{
   10.59 +    SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
   10.60 +
   10.61 +    if (data->display) {
   10.62 +        XCloseDisplay(data->display);
   10.63 +    }
   10.64 +    SDL_free(device->driverdata);
   10.65 +    SDL_free(device);
   10.66 +
   10.67 +    SDL_X11_UnloadSymbols();
   10.68 +}
   10.69 +
   10.70 +static SDL_VideoDevice *
   10.71 +X11_CreateDevice(int devindex)
   10.72 +{
   10.73 +    SDL_VideoDevice *device;
   10.74 +    SDL_VideoData *data;
   10.75 +    const char *display = NULL; /* Use the DISPLAY environment variable */
   10.76 +
   10.77 +    if (!SDL_X11_LoadSymbols()) {
   10.78 +        return NULL;
   10.79 +    }
   10.80 +
   10.81 +    /* Initialize all variables that we clean on shutdown */
   10.82 +    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
   10.83 +    if (device) {
   10.84 +        data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
   10.85 +    }
   10.86 +    if (!device || !data) {
   10.87 +        SDL_OutOfMemory();
   10.88 +        if (device) {
   10.89 +            SDL_free(device);
   10.90 +        }
   10.91 +        return NULL;
   10.92 +    }
   10.93 +    device->driverdata = data;
   10.94 +
   10.95 +    /* FIXME: Do we need this?
   10.96 +       if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) ||
   10.97 +       (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) {
   10.98 +       local_X11 = 1;
   10.99 +       } else {
  10.100 +       local_X11 = 0;
  10.101 +       }
  10.102 +     */
  10.103 +    data->display = XOpenDisplay(display);
  10.104 +#if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC)
  10.105 +    /* On Tru64 if linking without -lX11, it fails and you get following message.
  10.106 +     * Xlib: connection to ":0.0" refused by server
  10.107 +     * Xlib: XDM authorization key matches an existing client!
  10.108 +     *
  10.109 +     * It succeeds if retrying 1 second later
  10.110 +     * or if running xhost +localhost on shell.
  10.111 +     */
  10.112 +    if (data->display == NULL) {
  10.113 +        SDL_Delay(1000);
  10.114 +        data->display = XOpenDisplay(display);
  10.115 +    }
  10.116 +#endif
  10.117 +    if (data->display == NULL) {
  10.118 +        SDL_free(device);
  10.119 +        SDL_SetError("Couldn't open X11 display");
  10.120 +        return NULL;
  10.121 +    }
  10.122 +#ifdef X11_DEBUG
  10.123 +    XSynchronize(data->display, True);
  10.124 +#endif
  10.125 +
  10.126 +    /* Set the function pointers */
  10.127 +    device->VideoInit = X11_VideoInit;
  10.128 +    device->VideoQuit = X11_VideoQuit;
  10.129 +    device->GetDisplayModes = X11_GetDisplayModes;
  10.130 +    device->SetDisplayMode = X11_SetDisplayMode;
  10.131 +//    device->SetDisplayGammaRamp = X11_SetDisplayGammaRamp;
  10.132 +//    device->GetDisplayGammaRamp = X11_GetDisplayGammaRamp;
  10.133 +//    device->PumpEvents = X11_PumpEvents;
  10.134 +
  10.135 +/*
  10.136 +    device->CreateWindow = X11_CreateWindow;
  10.137 +    device->CreateWindowFrom = X11_CreateWindowFrom;
  10.138 +    device->SetWindowTitle = X11_SetWindowTitle;
  10.139 +    device->SetWindowPosition = X11_SetWindowPosition;
  10.140 +    device->SetWindowSize = X11_SetWindowSize;
  10.141 +    device->ShowWindow = X11_ShowWindow;
  10.142 +    device->HideWindow = X11_HideWindow;
  10.143 +    device->RaiseWindow = X11_RaiseWindow;
  10.144 +    device->MaximizeWindow = X11_MaximizeWindow;
  10.145 +    device->MinimizeWindow = X11_MinimizeWindow;
  10.146 +    device->RestoreWindow = X11_RestoreWindow;
  10.147 +    device->SetWindowGrab = X11_SetWindowGrab;
  10.148 +    device->DestroyWindow = X11_DestroyWindow;
  10.149 +    device->GetWindowWMInfo = X11_GetWindowWMInfo;
  10.150 +#ifdef SDL_VIDEO_OPENGL
  10.151 +    device->GL_LoadLibrary = X11_GL_LoadLibrary;
  10.152 +    device->GL_GetProcAddress = X11_GL_GetProcAddress;
  10.153 +    device->GL_CreateContext = X11_GL_CreateContext;
  10.154 +    device->GL_MakeCurrent = X11_GL_MakeCurrent;
  10.155 +    device->GL_SetSwapInterval = X11_GL_SetSwapInterval;
  10.156 +    device->GL_GetSwapInterval = X11_GL_GetSwapInterval;
  10.157 +    device->GL_SwapWindow = X11_GL_SwapWindow;
  10.158 +    device->GL_DeleteContext = X11_GL_DeleteContext;
  10.159 +#endif
  10.160 +*/
  10.161 +
  10.162 +    device->free = X11_DeleteDevice;
  10.163 +
  10.164 +    return device;
  10.165 +}
  10.166 +
  10.167 +VideoBootStrap X11_bootstrap = {
  10.168 +    "x11", "SDL X11 video driver",
  10.169 +    X11_Available, X11_CreateDevice
  10.170 +};
  10.171 +
  10.172 +
  10.173 +int
  10.174 +X11_VideoInit(_THIS)
  10.175 +{
  10.176 +    X11_InitModes(_this);
  10.177 +
  10.178 +//#if SDL_VIDEO_RENDER_D3D
  10.179 +//    D3D_AddRenderDriver(_this);
  10.180 +//#endif
  10.181 +//#if SDL_VIDEO_RENDER_GDI
  10.182 +//    GDI_AddRenderDriver(_this);
  10.183 +//#endif
  10.184 +
  10.185 +    X11_InitKeyboard(_this);
  10.186 +    X11_InitMouse(_this);
  10.187 +
  10.188 +    return 0;
  10.189 +}
  10.190 +
  10.191 +void
  10.192 +X11_VideoQuit(_THIS)
  10.193 +{
  10.194 +    X11_QuitModes(_this);
  10.195 +    X11_QuitKeyboard(_this);
  10.196 +    X11_QuitMouse(_this);
  10.197 +}
  10.198 +
  10.199 +/* vim: set ts=4 sw=4 expandtab: */
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/src/video/x11/SDL_x11video.h	Wed Jul 26 06:34:54 2006 +0000
    11.3 @@ -0,0 +1,70 @@
    11.4 +/*
    11.5 +    SDL - Simple DirectMedia Layer
    11.6 +    Copyright (C) 1997-2006 Sam Lantinga
    11.7 +
    11.8 +    This library is free software; you can redistribute it and/or
    11.9 +    modify it under the terms of the GNU Lesser General Public
   11.10 +    License as published by the Free Software Foundation; either
   11.11 +    version 2.1 of the License, or (at your option) any later version.
   11.12 +
   11.13 +    This library is distributed in the hope that it will be useful,
   11.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   11.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   11.16 +    Lesser General Public License for more details.
   11.17 +
   11.18 +    You should have received a copy of the GNU Lesser General Public
   11.19 +    License along with this library; if not, write to the Free Software
   11.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   11.21 +
   11.22 +    Sam Lantinga
   11.23 +    slouken@libsdl.org
   11.24 +*/
   11.25 +#include "SDL_config.h"
   11.26 +
   11.27 +#ifndef _SDL_x11video_h
   11.28 +#define _SDL_x11video_h
   11.29 +
   11.30 +#include "../SDL_sysvideo.h"
   11.31 +
   11.32 +#include <X11/Xlib.h>
   11.33 +#include <X11/Xutil.h>
   11.34 +#include <X11/Xatom.h>
   11.35 +
   11.36 +//#include "SDL_x11events.h"
   11.37 +//#include "SDL_x11gamma.h"
   11.38 +#include "SDL_x11keyboard.h"
   11.39 +#include "SDL_x11modes.h"
   11.40 +#include "SDL_x11mouse.h"
   11.41 +//#include "SDL_x11opengl.h"
   11.42 +//#include "SDL_x11window.h"
   11.43 +
   11.44 +#if SDL_VIDEO_DRIVER_X11_XINERAMA
   11.45 +#include "../Xext/extensions/Xinerama.h"
   11.46 +#endif
   11.47 +#if SDL_VIDEO_DRIVER_X11_XRANDR
   11.48 +#include <X11/extensions/Xrandr.h>
   11.49 +#endif
   11.50 +#if SDL_VIDEO_DRIVER_X11_VIDMODE
   11.51 +#include "../Xext/extensions/xf86vmode.h"
   11.52 +#endif
   11.53 +#if SDL_VIDEO_DRIVER_X11_XME
   11.54 +#include "../Xext/extensions/xme.h"
   11.55 +#endif
   11.56 +#if SDL_VIDEO_DRIVER_X11_DPMS
   11.57 +#include <X11/extensions/dpms.h>
   11.58 +#endif
   11.59 +
   11.60 +#include "SDL_x11dyn.h"
   11.61 +
   11.62 +/* Private display data */
   11.63 +
   11.64 +typedef struct SDL_VideoData
   11.65 +{
   11.66 +    Display *display;
   11.67 +    int mouse;
   11.68 +    int keyboard;
   11.69 +} SDL_VideoData;
   11.70 +
   11.71 +#endif /* _SDL_x11video_h */
   11.72 +
   11.73 +/* vi: set ts=4 sw=4 expandtab: */