Commit 73b501d8 authored by Sam Lantinga's avatar Sam Lantinga

Dynamically load the Xinerama and xf86vmode extensions

This fixes a few bugs with different distributions:
http://bugs.freedesktop.org/show_bug.cgi?id=17431
http://bugs.gentoo.org/show_bug.cgi?id=246177
parent e32b25be
This diff is collapsed.
This diff is collapsed.
...@@ -267,16 +267,17 @@ ...@@ -267,16 +267,17 @@
#undef SDL_VIDEO_DRIVER_X11 #undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC #undef SDL_VIDEO_DRIVER_X11_DYNAMIC
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
#undef SDL_VIDEO_DRIVER_X11_VIDMODE #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE
#undef SDL_VIDEO_DRIVER_X11_XINERAMA #undef SDL_VIDEO_DRIVER_X11_XINERAMA
#undef SDL_VIDEO_DRIVER_X11_XRANDR
#undef SDL_VIDEO_DRIVER_X11_XINPUT #undef SDL_VIDEO_DRIVER_X11_XINPUT
#undef SDL_VIDEO_DRIVER_X11_SCRNSAVER #undef SDL_VIDEO_DRIVER_X11_XRANDR
#undef SDL_VIDEO_DRIVER_X11_XV #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER
#undef SDL_VIDEO_DRIVER_X11_XSHAPE #undef SDL_VIDEO_DRIVER_X11_XSHAPE
#undef SDL_VIDEO_DRIVER_X11_XVIDMODE
#undef SDL_VIDEO_RENDER_D3D #undef SDL_VIDEO_RENDER_D3D
#undef SDL_VIDEO_RENDER_OGL #undef SDL_VIDEO_RENDER_OGL
......
...@@ -136,17 +136,17 @@ ...@@ -136,17 +136,17 @@
#define SDL_VIDEO_DRIVER_X11 1 #define SDL_VIDEO_DRIVER_X11 1
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "/usr/X11R6/lib/libXi.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "/usr/X11R6/lib/libXi.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
#define SDL_VIDEO_DRIVER_X11_XINPUT 1 #define SDL_VIDEO_DRIVER_X11_XINPUT 1
#define SDL_VIDEO_DRIVER_X11_SCRNSAVER 1 #define SDL_VIDEO_DRIVER_X11_XRANDR 1
#define SDL_VIDEO_DRIVER_X11_XV 1 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
#ifndef SDL_VIDEO_RENDER_OGL #ifndef SDL_VIDEO_RENDER_OGL
#define SDL_VIDEO_RENDER_OGL 1 #define SDL_VIDEO_RENDER_OGL 1
......
The reason these libraries are built outside of the standard XFree86
tree is so that they can be linked as shared object code directly into
SDL without causing any symbol collisions with code in the application.
You can't link static library code into shared libraries on non-x86
Linux platforms. Since these libraries haven't become standard yet,
we'll just include them directly.
These sources are synchronized with XFree86 4.2.1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/***********************************************************
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/* $XFree86: xc/lib/Xv/Xvlibint.h,v 1.5 2001/07/25 15:04:53 dawes Exp $ */
#ifndef XVLIBINT_H
#define XVLIBINT_H
/*
** File:
**
** Xvlibint.h --- Xv library internal header file
**
** Author:
**
** David Carver (Digital Workstation Engineering/Project Athena)
**
** Revisions:
**
** 01.24.91 Carver
** - version 1.4 upgrade
**
*/
#define NEED_REPLIES
/* Apparently some X11 systems can't include this multiple times... */
#ifndef SDL_INCLUDED_XLIBINT_H
#define SDL_INCLUDED_XLIBINT_H 1
#include <X11/Xlibint.h>
#endif
#include "../extensions/Xvproto.h"
#include "../extensions/Xvlib.h"
#if !defined(UNIXCPP)
#define XvGetReq(name, req) \
WORD64ALIGN\
if ((dpy->bufptr + SIZEOF(xv##name##Req)) > dpy->bufmax)\
_XFlush(dpy);\
req = (xv##name##Req *)(dpy->last_req = dpy->bufptr);\
req->reqType = info->codes->major_opcode;\
req->xvReqType = xv_##name; \
req->length = (SIZEOF(xv##name##Req))>>2;\
dpy->bufptr += SIZEOF(xv##name##Req);\
dpy->request++
#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
#define XvGetReq(name, req) \
WORD64ALIGN\
if ((dpy->bufptr + SIZEOF(xv/**/name/**/Req)) > dpy->bufmax)\
_XFlush(dpy);\
req = (xv/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
req->reqType = info->codes->major_opcode;\
req->xvReqType = xv_/**/name;\
req->length = (SIZEOF(xv/**/name/**/Req))>>2;\
dpy->bufptr += SIZEOF(xv/**/name/**/Req);\
dpy->request++
#endif
#endif /* XVLIBINT_H */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/include/extensions/Xext.h,v 1.7 2005/01/27 03:03:09 dawes Exp $ */
#ifndef _XEXT_H_
#define _XEXT_H_
#include <X11/Xfuncproto.h>
_XFUNCPROTOBEGIN
typedef int (*XExtensionErrorHandler) (Display *, _Xconst char *,
_Xconst char *);
extern XExtensionErrorHandler
XSetExtensionErrorHandler(XExtensionErrorHandler handler);
extern int XMissingExtension(Display * /* dpy */ ,
_Xconst char * /* ext_name */
);
_XFUNCPROTOEND
#define X_EXTENSION_UNKNOWN "unknown"
#define X_EXTENSION_MISSING "missing"
#endif /* _XEXT_H_ */
/* vi: set ts=4 sw=4 expandtab: */
/* $XFree86: xc/include/extensions/Xinerama.h,v 3.2 2000/03/01 01:04:20 dawes Exp $ */
#ifndef _Xinerama_h
#define _Xinerama_h
#include "SDL_name.h"
typedef struct
{
int screen_number;
short x_org;
short y_org;
short width;
short height;
} SDL_NAME(XineramaScreenInfo);
Bool SDL_NAME(XineramaQueryExtension) (Display * dpy,
int *event_base, int *error_base);
Status SDL_NAME(XineramaQueryVersion) (Display * dpy, int *major, int *minor);
Bool SDL_NAME(XineramaIsActive) (Display * dpy);
/*
Returns the number of heads and a pointer to an array of
structures describing the position and size of the individual
heads. Returns NULL and number = 0 if Xinerama is not active.
Returned array should be freed with XFree().
*/
SDL_NAME(XineramaScreenInfo) *
SDL_NAME(XineramaQueryScreens) (Display * dpy, int *number);
#endif /* _Xinerama_h */
/* vi: set ts=4 sw=4 expandtab: */
/***********************************************************
Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/* $XFree86: xc/include/extensions/Xv.h,v 1.5 1999/12/11 19:28:48 mvojkovi Exp $ */
#ifndef XV_H
#define XV_H
/*
** File:
**
** Xv.h --- Xv shared library and server header file
**
** Author:
**
** David Carver (Digital Workstation Engineering/Project Athena)
**
** Revisions:
**
** 05.15.91 Carver
** - version 2.0 upgrade
**
** 01.24.91 Carver
** - version 1.4 upgrade
**
*/
#include <X11/X.h>
#define XvName "XVideo"
#define XvVersion 2
#define XvRevision 2
/* Symbols */
typedef XID XvPortID;
typedef XID XvEncodingID;
#define XvNone 0
#define XvInput 0
#define XvOutput 1
#define XvInputMask (1L<<XvInput)
#define XvOutputMask (1L<<XvOutput)
#define XvVideoMask 0x00000004
#define XvStillMask 0x00000008
#define XvImageMask 0x00000010
/* These two are not client viewable */
#define XvPixmapMask 0x00010000
#define XvWindowMask 0x00020000
#define XvGettable 0x01
#define XvSettable 0x02
#define XvRGB 0
#define XvYUV 1
#define XvPacked 0
#define XvPlanar 1
#define XvTopToBottom 0
#define XvBottomToTop 1
/* Events */
#define XvVideoNotify 0
#define XvPortNotify 1
#define XvNumEvents 2
/* Video Notify Reasons */
#define XvStarted 0
#define XvStopped 1
#define XvBusy 2
#define XvPreempted 3
#define XvHardError 4
#define XvLastReason 4
#define XvNumReasons (XvLastReason + 1)
#define XvStartedMask (1L<<XvStarted)
#define XvStoppedMask (1L<<XvStopped)
#define XvBusyMask (1L<<XvBusy)
#define XvPreemptedMask (1L<<XvPreempted)
#define XvHardErrorMask (1L<<XvHardError)
#define XvAnyReasonMask ((1L<<XvNumReasons) - 1)
#define XvNoReasonMask 0
/* Errors */
#define XvBadPort 0
#define XvBadEncoding 1
#define XvBadControl 2
#define XvNumErrors 3
/* Status */
#define XvBadExtension 1
#define XvAlreadyGrabbed 2
#define XvInvalidTime 3
#define XvBadReply 4
#define XvBadAlloc 5
#endif /* XV_H */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -609,7 +609,7 @@ gnome_screensaver_enable() ...@@ -609,7 +609,7 @@ gnome_screensaver_enable()
void void
X11_SuspendScreenSaver(_THIS) X11_SuspendScreenSaver(_THIS)
{ {
#if SDL_VIDEO_DRIVER_X11_SCRNSAVER #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
int dummy; int dummy;
int major_version, minor_version; int major_version, minor_version;
......
This diff is collapsed.
...@@ -36,7 +36,7 @@ typedef struct ...@@ -36,7 +36,7 @@ typedef struct
int use_vidmode; int use_vidmode;
#if SDL_VIDEO_DRIVER_X11_XINERAMA #if SDL_VIDEO_DRIVER_X11_XINERAMA
SDL_NAME(XineramaScreenInfo) xinerama_info; XineramaScreenInfo xinerama_info;
#endif #endif
#if SDL_VIDEO_DRIVER_X11_XRANDR #if SDL_VIDEO_DRIVER_X11_XRANDR
XRRScreenConfiguration *screen_config; XRRScreenConfiguration *screen_config;
...@@ -44,8 +44,8 @@ typedef struct ...@@ -44,8 +44,8 @@ typedef struct
Rotation saved_rotation; Rotation saved_rotation;
short saved_rate; short saved_rate;
#endif #endif
#if SDL_VIDEO_DRIVER_X11_VIDMODE #if SDL_VIDEO_DRIVER_X11_XVIDMODE
SDL_NAME(XF86VidModeModeInfo) saved_mode; XF86VidModeModeInfo saved_mode;
struct struct
{ {
int x, y; int x, y;
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment