Dynamically load the Xinerama and xf86vmode extensions
authorSam Lantinga <slouken@libsdl.org>
Mon, 28 Feb 2011 09:01:53 -0800
changeset 540835a63789c3f2
parent 5407 40c9d744e595
child 5409 30205e106bba
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
configure
configure.in
include/SDL_config.h.in
include/SDL_config_macosx.h
src/video/Xext/README
src/video/Xext/XME/xme.c
src/video/Xext/Xinerama/Xinerama.c
src/video/Xext/Xv/Xv.c
src/video/Xext/Xv/Xvlibint.h
src/video/Xext/Xxf86vm/XF86VMode.c
src/video/Xext/extensions/Xext.h
src/video/Xext/extensions/Xinerama.h
src/video/Xext/extensions/Xv.h
src/video/Xext/extensions/Xvlib.h
src/video/Xext/extensions/Xvproto.h
src/video/Xext/extensions/extutil.h
src/video/Xext/extensions/panoramiXext.h
src/video/Xext/extensions/panoramiXproto.h
src/video/Xext/extensions/xf86dga.h
src/video/Xext/extensions/xf86dga1.h
src/video/Xext/extensions/xf86dga1str.h
src/video/Xext/extensions/xf86dgastr.h
src/video/Xext/extensions/xf86vmode.h
src/video/Xext/extensions/xf86vmstr.h
src/video/x11/SDL_x11dyn.c
src/video/x11/SDL_x11dyn.h
src/video/x11/SDL_x11events.c
src/video/x11/SDL_x11modes.c
src/video/x11/SDL_x11modes.h
src/video/x11/SDL_x11sym.h
src/video/x11/SDL_x11video.h
     1.1 --- a/configure	Sun Feb 27 22:22:58 2011 -0800
     1.2 +++ b/configure	Mon Feb 28 09:01:53 2011 -0800
     1.3 @@ -1537,20 +1537,19 @@
     1.4    --enable-dummyaudio     support the dummy audio driver [default=yes]
     1.5    --enable-video-x11      use X11 video driver [default=yes]
     1.6    --enable-x11-shared     dynamically load X11 support [default=maybe]
     1.7 -  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]
     1.8 -  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]
     1.9    --enable-video-x11-xinerama
    1.10                            enable X11 Xinerama support [default=yes]
    1.11 -  --enable-video-x11-xshape
    1.12 -                          enable X11 XShape support [default=yes]
    1.13 +  --enable-video-x11-xinput
    1.14 +                          enable X11 XInput extension for manymouse, tablets,
    1.15 +                          etc [default=yes]
    1.16    --enable-video-x11-xrandr
    1.17                            enable X11 Xrandr extension for fullscreen
    1.18                            [default=yes]
    1.19 -  --enable-video-x11-xinput
    1.20 -                          enable X11 XInput extension for manymouse, tablets,
    1.21 -                          etc [default=yes]
    1.22    --enable-video-x11-scrnsaver
    1.23                            enable X11 screensaver extension [default=yes]
    1.24 +  --enable-video-x11-xshape
    1.25 +                          enable X11 XShape support [default=yes]
    1.26 +  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]
    1.27    --enable-video-cocoa    use Cocoa video driver [default=yes]
    1.28    --enable-video-directfb use DirectFB video driver [default=no]
    1.29    --enable-directfb-shared
    1.30 @@ -3770,13 +3769,13 @@
    1.31  else
    1.32    lt_cv_nm_interface="BSD nm"
    1.33    echo "int some_variable = 0;" > conftest.$ac_ext
    1.34 -  (eval echo "\"\$as_me:3773: $ac_compile\"" >&5)
    1.35 +  (eval echo "\"\$as_me:3772: $ac_compile\"" >&5)
    1.36    (eval "$ac_compile" 2>conftest.err)
    1.37    cat conftest.err >&5
    1.38 -  (eval echo "\"\$as_me:3776: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
    1.39 +  (eval echo "\"\$as_me:3775: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
    1.40    (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
    1.41    cat conftest.err >&5
    1.42 -  (eval echo "\"\$as_me:3779: output\"" >&5)
    1.43 +  (eval echo "\"\$as_me:3778: output\"" >&5)
    1.44    cat conftest.out >&5
    1.45    if $GREP 'External.*some_variable' conftest.out > /dev/null; then
    1.46      lt_cv_nm_interface="MS dumpbin"
    1.47 @@ -5003,7 +5002,7 @@
    1.48    ;;
    1.49  *-*-irix6*)
    1.50    # Find out which ABI we are using.
    1.51 -  echo '#line 5006 "configure"' > conftest.$ac_ext
    1.52 +  echo '#line 5005 "configure"' > conftest.$ac_ext
    1.53    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    1.54    (eval $ac_compile) 2>&5
    1.55    ac_status=$?
    1.56 @@ -7164,11 +7163,11 @@
    1.57     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    1.58     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1.59     -e 's:$: $lt_compiler_flag:'`
    1.60 -   (eval echo "\"\$as_me:7167: $lt_compile\"" >&5)
    1.61 +   (eval echo "\"\$as_me:7166: $lt_compile\"" >&5)
    1.62     (eval "$lt_compile" 2>conftest.err)
    1.63     ac_status=$?
    1.64     cat conftest.err >&5
    1.65 -   echo "$as_me:7171: \$? = $ac_status" >&5
    1.66 +   echo "$as_me:7170: \$? = $ac_status" >&5
    1.67     if (exit $ac_status) && test -s "$ac_outfile"; then
    1.68       # The compiler can only warn and ignore the option if not recognized
    1.69       # So say no if there are warnings other than the usual output.
    1.70 @@ -7503,11 +7502,11 @@
    1.71     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    1.72     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1.73     -e 's:$: $lt_compiler_flag:'`
    1.74 -   (eval echo "\"\$as_me:7506: $lt_compile\"" >&5)
    1.75 +   (eval echo "\"\$as_me:7505: $lt_compile\"" >&5)
    1.76     (eval "$lt_compile" 2>conftest.err)
    1.77     ac_status=$?
    1.78     cat conftest.err >&5
    1.79 -   echo "$as_me:7510: \$? = $ac_status" >&5
    1.80 +   echo "$as_me:7509: \$? = $ac_status" >&5
    1.81     if (exit $ac_status) && test -s "$ac_outfile"; then
    1.82       # The compiler can only warn and ignore the option if not recognized
    1.83       # So say no if there are warnings other than the usual output.
    1.84 @@ -7608,11 +7607,11 @@
    1.85     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    1.86     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1.87     -e 's:$: $lt_compiler_flag:'`
    1.88 -   (eval echo "\"\$as_me:7611: $lt_compile\"" >&5)
    1.89 +   (eval echo "\"\$as_me:7610: $lt_compile\"" >&5)
    1.90     (eval "$lt_compile" 2>out/conftest.err)
    1.91     ac_status=$?
    1.92     cat out/conftest.err >&5
    1.93 -   echo "$as_me:7615: \$? = $ac_status" >&5
    1.94 +   echo "$as_me:7614: \$? = $ac_status" >&5
    1.95     if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1.96     then
    1.97       # The compiler can only warn and ignore the option if not recognized
    1.98 @@ -7663,11 +7662,11 @@
    1.99     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   1.100     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   1.101     -e 's:$: $lt_compiler_flag:'`
   1.102 -   (eval echo "\"\$as_me:7666: $lt_compile\"" >&5)
   1.103 +   (eval echo "\"\$as_me:7665: $lt_compile\"" >&5)
   1.104     (eval "$lt_compile" 2>out/conftest.err)
   1.105     ac_status=$?
   1.106     cat out/conftest.err >&5
   1.107 -   echo "$as_me:7670: \$? = $ac_status" >&5
   1.108 +   echo "$as_me:7669: \$? = $ac_status" >&5
   1.109     if (exit $ac_status) && test -s out/conftest2.$ac_objext
   1.110     then
   1.111       # The compiler can only warn and ignore the option if not recognized
   1.112 @@ -10421,7 +10420,7 @@
   1.113    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   1.114    lt_status=$lt_dlunknown
   1.115    cat > conftest.$ac_ext <<_LT_EOF
   1.116 -#line 10424 "configure"
   1.117 +#line 10423 "configure"
   1.118  #include "confdefs.h"
   1.119  
   1.120  #if HAVE_DLFCN_H
   1.121 @@ -10517,7 +10516,7 @@
   1.122    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   1.123    lt_status=$lt_dlunknown
   1.124    cat > conftest.$ac_ext <<_LT_EOF
   1.125 -#line 10520 "configure"
   1.126 +#line 10519 "configure"
   1.127  #include "confdefs.h"
   1.128  
   1.129  #if HAVE_DLFCN_H
   1.130 @@ -14199,11 +14198,11 @@
   1.131     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   1.132     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   1.133     -e 's:$: $lt_compiler_flag:'`
   1.134 -   (eval echo "\"\$as_me:14202: $lt_compile\"" >&5)
   1.135 +   (eval echo "\"\$as_me:14201: $lt_compile\"" >&5)
   1.136     (eval "$lt_compile" 2>conftest.err)
   1.137     ac_status=$?
   1.138     cat conftest.err >&5
   1.139 -   echo "$as_me:14206: \$? = $ac_status" >&5
   1.140 +   echo "$as_me:14205: \$? = $ac_status" >&5
   1.141     if (exit $ac_status) && test -s "$ac_outfile"; then
   1.142       # The compiler can only warn and ignore the option if not recognized
   1.143       # So say no if there are warnings other than the usual output.
   1.144 @@ -14298,11 +14297,11 @@
   1.145     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   1.146     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   1.147     -e 's:$: $lt_compiler_flag:'`
   1.148 -   (eval echo "\"\$as_me:14301: $lt_compile\"" >&5)
   1.149 +   (eval echo "\"\$as_me:14300: $lt_compile\"" >&5)
   1.150     (eval "$lt_compile" 2>out/conftest.err)
   1.151     ac_status=$?
   1.152     cat out/conftest.err >&5
   1.153 -   echo "$as_me:14305: \$? = $ac_status" >&5
   1.154 +   echo "$as_me:14304: \$? = $ac_status" >&5
   1.155     if (exit $ac_status) && test -s out/conftest2.$ac_objext
   1.156     then
   1.157       # The compiler can only warn and ignore the option if not recognized
   1.158 @@ -14350,11 +14349,11 @@
   1.159     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   1.160     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   1.161     -e 's:$: $lt_compiler_flag:'`
   1.162 -   (eval echo "\"\$as_me:14353: $lt_compile\"" >&5)
   1.163 +   (eval echo "\"\$as_me:14352: $lt_compile\"" >&5)
   1.164     (eval "$lt_compile" 2>out/conftest.err)
   1.165     ac_status=$?
   1.166     cat out/conftest.err >&5
   1.167 -   echo "$as_me:14357: \$? = $ac_status" >&5
   1.168 +   echo "$as_me:14356: \$? = $ac_status" >&5
   1.169     if (exit $ac_status) && test -s out/conftest2.$ac_objext
   1.170     then
   1.171       # The compiler can only warn and ignore the option if not recognized
   1.172 @@ -24086,12 +24085,12 @@
   1.173                      x11_symbols_private=yes
   1.174                      x11_lib='/usr/X11R6/lib/libX11.6.dylib'
   1.175                      x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
   1.176 +                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
   1.177 +                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
   1.178 +                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
   1.179                      xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
   1.180 -                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
   1.181 -                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
   1.182 -                    xss_lib='/usr/X11R6/lib/libXss.6.dylib'
   1.183 -                    xdamage_lib='/usr/X11R6/lib/libXdamage.1.dylib'
   1.184 -                    xfixes_lib='/usr/X11R6/lib/libXfixes.3.dylib'
   1.185 +                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
   1.186 +                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
   1.187                      ;;
   1.188                  *-*-osf*)
   1.189                      x11_lib='libX11.so'
   1.190 @@ -24104,12 +24103,12 @@
   1.191                  *)
   1.192                      x11_lib=`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.193                      x11ext_lib=`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.194 +                    xinerama_lib=`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.195 +                    xinput_lib=`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.196 +                    xrandr_lib=`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.197                      xrender_lib=`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.198 -                    xrandr_lib=`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.199 -                    xinput_lib=`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.200                      xss_lib=`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.201 -                    xdamage_lib=`find_lib "libXdamage.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.202 -                    xfixes_lib=`find_lib "libXfixes.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.203 +                    xvidmode_lib=`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
   1.204                      ;;
   1.205              esac
   1.206  
   1.207 @@ -24160,34 +24159,6 @@
   1.208              fi
   1.209              have_video=yes
   1.210  
   1.211 -            # Check whether --enable-video-x11-vm was given.
   1.212 -if test "${enable_video_x11_vm+set}" = set; then
   1.213 -  enableval=$enable_video_x11_vm;
   1.214 -else
   1.215 -  enable_video_x11_vm=yes
   1.216 -fi
   1.217 -
   1.218 -            if test x$enable_video_x11_vm = xyes; then
   1.219 -                cat >>confdefs.h <<\_ACEOF
   1.220 -#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
   1.221 -_ACEOF
   1.222 -
   1.223 -                SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
   1.224 -            fi
   1.225 -            # Check whether --enable-video-x11-xv was given.
   1.226 -if test "${enable_video_x11_xv+set}" = set; then
   1.227 -  enableval=$enable_video_x11_xv;
   1.228 -else
   1.229 -  enable_video_x11_xv=yes
   1.230 -fi
   1.231 -
   1.232 -            if test x$enable_video_x11_xv = xyes; then
   1.233 -                cat >>confdefs.h <<\_ACEOF
   1.234 -#define SDL_VIDEO_DRIVER_X11_XV 1
   1.235 -_ACEOF
   1.236 -
   1.237 -                SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
   1.238 -            fi
   1.239              # Check whether --enable-video-x11-xinerama was given.
   1.240  if test "${enable_video_x11_xinerama+set}" = set; then
   1.241    enableval=$enable_video_x11_xinerama;
   1.242 @@ -24196,23 +24167,158 @@
   1.243  fi
   1.244  
   1.245              if test x$enable_video_x11_xinerama = xyes; then
   1.246 +                definitely_enable_video_x11_xinerama=no
   1.247 +                { echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5
   1.248 +echo $ECHO_N "checking for X11/extensions/Xinerama.h... $ECHO_C" >&6; }
   1.249 +if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then
   1.250 +  echo $ECHO_N "(cached) $ECHO_C" >&6
   1.251 +else
   1.252 +  cat >conftest.$ac_ext <<_ACEOF
   1.253 +/* confdefs.h.  */
   1.254 +_ACEOF
   1.255 +cat confdefs.h >>conftest.$ac_ext
   1.256 +cat >>conftest.$ac_ext <<_ACEOF
   1.257 +/* end confdefs.h.  */
   1.258 +#include <X11/Xlib.h>
   1.259 +
   1.260 +
   1.261 +#include <X11/extensions/Xinerama.h>
   1.262 +_ACEOF
   1.263 +rm -f conftest.$ac_objext
   1.264 +if { (ac_try="$ac_compile"
   1.265 +case "(($ac_try" in
   1.266 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.267 +  *) ac_try_echo=$ac_try;;
   1.268 +esac
   1.269 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.270 +  (eval "$ac_compile") 2>conftest.er1
   1.271 +  ac_status=$?
   1.272 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.273 +  rm -f conftest.er1
   1.274 +  cat conftest.err >&5
   1.275 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.276 +  (exit $ac_status); } && {
   1.277 +	 test -z "$ac_c_werror_flag" ||
   1.278 +	 test ! -s conftest.err
   1.279 +       } && test -s conftest.$ac_objext; then
   1.280 +  ac_cv_header_X11_extensions_Xinerama_h=yes
   1.281 +else
   1.282 +  echo "$as_me: failed program was:" >&5
   1.283 +sed 's/^/| /' conftest.$ac_ext >&5
   1.284 +
   1.285 +	ac_cv_header_X11_extensions_Xinerama_h=no
   1.286 +fi
   1.287 +
   1.288 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.289 +fi
   1.290 +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5
   1.291 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xinerama_h" >&6; }
   1.292 +if test $ac_cv_header_X11_extensions_Xinerama_h = yes; then
   1.293 +  have_xinerama_h_hdr=yes
   1.294 +else
   1.295 +  have_xinerama_h_hdr=no
   1.296 +fi
   1.297 +
   1.298 +
   1.299 +                if test x$have_xinerama_h_hdr = xyes; then
   1.300 +                    if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
   1.301 +                        echo "-- dynamic libXinerama -> $xinerama_lib"
   1.302 +                        cat >>confdefs.h <<_ACEOF
   1.303 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "$xinerama_lib"
   1.304 +_ACEOF
   1.305 +
   1.306 +                        definitely_enable_video_x11_xinerama=yes
   1.307 +                    else
   1.308 +                        { echo "$as_me:$LINENO: checking for XineramaQueryExtension in -lXinerama" >&5
   1.309 +echo $ECHO_N "checking for XineramaQueryExtension in -lXinerama... $ECHO_C" >&6; }
   1.310 +if test "${ac_cv_lib_Xinerama_XineramaQueryExtension+set}" = set; then
   1.311 +  echo $ECHO_N "(cached) $ECHO_C" >&6
   1.312 +else
   1.313 +  ac_check_lib_save_LIBS=$LIBS
   1.314 +LIBS="-lXinerama  $LIBS"
   1.315 +cat >conftest.$ac_ext <<_ACEOF
   1.316 +/* confdefs.h.  */
   1.317 +_ACEOF
   1.318 +cat confdefs.h >>conftest.$ac_ext
   1.319 +cat >>conftest.$ac_ext <<_ACEOF
   1.320 +/* end confdefs.h.  */
   1.321 +
   1.322 +/* Override any GCC internal prototype to avoid an error.
   1.323 +   Use char because int might match the return type of a GCC
   1.324 +   builtin and then its argument prototype would still apply.  */
   1.325 +#ifdef __cplusplus
   1.326 +extern "C"
   1.327 +#endif
   1.328 +char XineramaQueryExtension ();
   1.329 +int
   1.330 +main ()
   1.331 +{
   1.332 +return XineramaQueryExtension ();
   1.333 +  ;
   1.334 +  return 0;
   1.335 +}
   1.336 +_ACEOF
   1.337 +rm -f conftest.$ac_objext conftest$ac_exeext
   1.338 +if { (ac_try="$ac_link"
   1.339 +case "(($ac_try" in
   1.340 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.341 +  *) ac_try_echo=$ac_try;;
   1.342 +esac
   1.343 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.344 +  (eval "$ac_link") 2>conftest.er1
   1.345 +  ac_status=$?
   1.346 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.347 +  rm -f conftest.er1
   1.348 +  cat conftest.err >&5
   1.349 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.350 +  (exit $ac_status); } && {
   1.351 +	 test -z "$ac_c_werror_flag" ||
   1.352 +	 test ! -s conftest.err
   1.353 +       } && test -s conftest$ac_exeext &&
   1.354 +       $as_test_x conftest$ac_exeext; then
   1.355 +  ac_cv_lib_Xinerama_XineramaQueryExtension=yes
   1.356 +else
   1.357 +  echo "$as_me: failed program was:" >&5
   1.358 +sed 's/^/| /' conftest.$ac_ext >&5
   1.359 +
   1.360 +	ac_cv_lib_Xinerama_XineramaQueryExtension=no
   1.361 +fi
   1.362 +
   1.363 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
   1.364 +      conftest$ac_exeext conftest.$ac_ext
   1.365 +LIBS=$ac_check_lib_save_LIBS
   1.366 +fi
   1.367 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryExtension" >&5
   1.368 +echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryExtension" >&6; }
   1.369 +if test $ac_cv_lib_Xinerama_XineramaQueryExtension = yes; then
   1.370 +  have_xinerama_lib=yes
   1.371 +fi
   1.372 +
   1.373 +                        if test x$have_xinerama_lib = xyes ; then
   1.374 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
   1.375 +                            definitely_enable_video_x11_xinerama=yes
   1.376 +                        fi
   1.377 +                    fi
   1.378 +                fi
   1.379 +            fi
   1.380 +            if test x$definitely_enable_video_x11_xinerama = xyes; then
   1.381                  cat >>confdefs.h <<\_ACEOF
   1.382  #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
   1.383  _ACEOF
   1.384  
   1.385 -                SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
   1.386 -            fi
   1.387 -            # Check whether --enable-video-x11-xshape was given.
   1.388 -if test "${enable_video_x11_xshape+set}" = set; then
   1.389 -  enableval=$enable_video_x11_xshape;
   1.390 -else
   1.391 -  enable_video_x11_xshape=yes
   1.392 -fi
   1.393 -
   1.394 -            if test x$enable_video_x11_xshape = xyes; then
   1.395 -                { echo "$as_me:$LINENO: checking for X11/extensions/shape.h" >&5
   1.396 -echo $ECHO_N "checking for X11/extensions/shape.h... $ECHO_C" >&6; }
   1.397 -if test "${ac_cv_header_X11_extensions_shape_h+set}" = set; then
   1.398 +            fi
   1.399 +            # Check whether --enable-video-x11-xinput was given.
   1.400 +if test "${enable_video_x11_xinput+set}" = set; then
   1.401 +  enableval=$enable_video_x11_xinput;
   1.402 +else
   1.403 +  enable_video_x11_xinput=yes
   1.404 +fi
   1.405 +
   1.406 +            if test x$enable_video_x11_xinput = xyes; then
   1.407 +                definitely_enable_video_x11_xinput=no
   1.408 +                { echo "$as_me:$LINENO: checking for X11/extensions/XInput.h" >&5
   1.409 +echo $ECHO_N "checking for X11/extensions/XInput.h... $ECHO_C" >&6; }
   1.410 +if test "${ac_cv_header_X11_extensions_XInput_h+set}" = set; then
   1.411    echo $ECHO_N "(cached) $ECHO_C" >&6
   1.412  else
   1.413    cat >conftest.$ac_ext <<_ACEOF
   1.414 @@ -24224,51 +24330,131 @@
   1.415  #include <X11/Xlib.h>
   1.416  
   1.417  
   1.418 -#include <X11/extensions/shape.h>
   1.419 -_ACEOF
   1.420 -rm -f conftest.$ac_objext
   1.421 -if { (ac_try="$ac_compile"
   1.422 -case "(($ac_try" in
   1.423 -  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.424 -  *) ac_try_echo=$ac_try;;
   1.425 -esac
   1.426 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.427 -  (eval "$ac_compile") 2>conftest.er1
   1.428 -  ac_status=$?
   1.429 -  grep -v '^ *+' conftest.er1 >conftest.err
   1.430 -  rm -f conftest.er1
   1.431 -  cat conftest.err >&5
   1.432 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.433 -  (exit $ac_status); } && {
   1.434 -	 test -z "$ac_c_werror_flag" ||
   1.435 -	 test ! -s conftest.err
   1.436 -       } && test -s conftest.$ac_objext; then
   1.437 -  ac_cv_header_X11_extensions_shape_h=yes
   1.438 -else
   1.439 -  echo "$as_me: failed program was:" >&5
   1.440 -sed 's/^/| /' conftest.$ac_ext >&5
   1.441 -
   1.442 -	ac_cv_header_X11_extensions_shape_h=no
   1.443 -fi
   1.444 -
   1.445 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.446 -fi
   1.447 -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_shape_h" >&5
   1.448 -echo "${ECHO_T}$ac_cv_header_X11_extensions_shape_h" >&6; }
   1.449 -if test $ac_cv_header_X11_extensions_shape_h = yes; then
   1.450 -  have_shape_h_hdr=yes
   1.451 -else
   1.452 -  have_shape_h_hdr=no
   1.453 -fi
   1.454 -
   1.455 -
   1.456 -                if test x$have_shape_h_hdr = xyes; then
   1.457 -                    cat >>confdefs.h <<\_ACEOF
   1.458 -#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
   1.459 -_ACEOF
   1.460 -
   1.461 +#include <X11/extensions/XInput.h>
   1.462 +_ACEOF
   1.463 +rm -f conftest.$ac_objext
   1.464 +if { (ac_try="$ac_compile"
   1.465 +case "(($ac_try" in
   1.466 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.467 +  *) ac_try_echo=$ac_try;;
   1.468 +esac
   1.469 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.470 +  (eval "$ac_compile") 2>conftest.er1
   1.471 +  ac_status=$?
   1.472 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.473 +  rm -f conftest.er1
   1.474 +  cat conftest.err >&5
   1.475 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.476 +  (exit $ac_status); } && {
   1.477 +	 test -z "$ac_c_werror_flag" ||
   1.478 +	 test ! -s conftest.err
   1.479 +       } && test -s conftest.$ac_objext; then
   1.480 +  ac_cv_header_X11_extensions_XInput_h=yes
   1.481 +else
   1.482 +  echo "$as_me: failed program was:" >&5
   1.483 +sed 's/^/| /' conftest.$ac_ext >&5
   1.484 +
   1.485 +	ac_cv_header_X11_extensions_XInput_h=no
   1.486 +fi
   1.487 +
   1.488 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.489 +fi
   1.490 +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XInput_h" >&5
   1.491 +echo "${ECHO_T}$ac_cv_header_X11_extensions_XInput_h" >&6; }
   1.492 +if test $ac_cv_header_X11_extensions_XInput_h = yes; then
   1.493 +  have_xinput_h_hdr=yes
   1.494 +else
   1.495 +  have_xinput_h_hdr=no
   1.496 +fi
   1.497 +
   1.498 +
   1.499 +                if test x$have_xinput_h_hdr = xyes; then
   1.500 +                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
   1.501 +                        echo "-- dynamic libXi -> $xinput_lib"
   1.502 +                        cat >>confdefs.h <<_ACEOF
   1.503 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "$xinput_lib"
   1.504 +_ACEOF
   1.505 +
   1.506 +                        definitely_enable_video_x11_xinput=yes
   1.507 +                    else
   1.508 +                        { echo "$as_me:$LINENO: checking for XOpenDevice in -lXi" >&5
   1.509 +echo $ECHO_N "checking for XOpenDevice in -lXi... $ECHO_C" >&6; }
   1.510 +if test "${ac_cv_lib_Xi_XOpenDevice+set}" = set; then
   1.511 +  echo $ECHO_N "(cached) $ECHO_C" >&6
   1.512 +else
   1.513 +  ac_check_lib_save_LIBS=$LIBS
   1.514 +LIBS="-lXi  $LIBS"
   1.515 +cat >conftest.$ac_ext <<_ACEOF
   1.516 +/* confdefs.h.  */
   1.517 +_ACEOF
   1.518 +cat confdefs.h >>conftest.$ac_ext
   1.519 +cat >>conftest.$ac_ext <<_ACEOF
   1.520 +/* end confdefs.h.  */
   1.521 +
   1.522 +/* Override any GCC internal prototype to avoid an error.
   1.523 +   Use char because int might match the return type of a GCC
   1.524 +   builtin and then its argument prototype would still apply.  */
   1.525 +#ifdef __cplusplus
   1.526 +extern "C"
   1.527 +#endif
   1.528 +char XOpenDevice ();
   1.529 +int
   1.530 +main ()
   1.531 +{
   1.532 +return XOpenDevice ();
   1.533 +  ;
   1.534 +  return 0;
   1.535 +}
   1.536 +_ACEOF
   1.537 +rm -f conftest.$ac_objext conftest$ac_exeext
   1.538 +if { (ac_try="$ac_link"
   1.539 +case "(($ac_try" in
   1.540 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.541 +  *) ac_try_echo=$ac_try;;
   1.542 +esac
   1.543 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.544 +  (eval "$ac_link") 2>conftest.er1
   1.545 +  ac_status=$?
   1.546 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.547 +  rm -f conftest.er1
   1.548 +  cat conftest.err >&5
   1.549 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.550 +  (exit $ac_status); } && {
   1.551 +	 test -z "$ac_c_werror_flag" ||
   1.552 +	 test ! -s conftest.err
   1.553 +       } && test -s conftest$ac_exeext &&
   1.554 +       $as_test_x conftest$ac_exeext; then
   1.555 +  ac_cv_lib_Xi_XOpenDevice=yes
   1.556 +else
   1.557 +  echo "$as_me: failed program was:" >&5
   1.558 +sed 's/^/| /' conftest.$ac_ext >&5
   1.559 +
   1.560 +	ac_cv_lib_Xi_XOpenDevice=no
   1.561 +fi
   1.562 +
   1.563 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
   1.564 +      conftest$ac_exeext conftest.$ac_ext
   1.565 +LIBS=$ac_check_lib_save_LIBS
   1.566 +fi
   1.567 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xi_XOpenDevice" >&5
   1.568 +echo "${ECHO_T}$ac_cv_lib_Xi_XOpenDevice" >&6; }
   1.569 +if test $ac_cv_lib_Xi_XOpenDevice = yes; then
   1.570 +  have_xinput_lib=yes
   1.571 +fi
   1.572 +
   1.573 +                        if test x$have_xinput_lib = xyes ; then
   1.574 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
   1.575 +                            definitely_enable_video_x11_xinput=yes
   1.576 +                        fi
   1.577 +                    fi
   1.578                  fi
   1.579              fi
   1.580 +            if test x$definitely_enable_video_x11_xinput = xyes; then
   1.581 +                cat >>confdefs.h <<\_ACEOF
   1.582 +#define SDL_VIDEO_DRIVER_X11_XINPUT 1
   1.583 +_ACEOF
   1.584 +
   1.585 +            fi
   1.586              # Check whether --enable-video-x11-xrandr was given.
   1.587  if test "${enable_video_x11_xrandr+set}" = set; then
   1.588    enableval=$enable_video_x11_xrandr;
   1.589 @@ -24417,154 +24603,6 @@
   1.590  _ACEOF
   1.591  
   1.592              fi
   1.593 -            # Check whether --enable-video-x11-xinput was given.
   1.594 -if test "${enable_video_x11_xinput+set}" = set; then
   1.595 -  enableval=$enable_video_x11_xinput;
   1.596 -else
   1.597 -  enable_video_x11_xinput=yes
   1.598 -fi
   1.599 -
   1.600 -            if test x$enable_video_x11_xinput = xyes; then
   1.601 -                definitely_enable_video_x11_xinput=no
   1.602 -                { echo "$as_me:$LINENO: checking for X11/extensions/XInput.h" >&5
   1.603 -echo $ECHO_N "checking for X11/extensions/XInput.h... $ECHO_C" >&6; }
   1.604 -if test "${ac_cv_header_X11_extensions_XInput_h+set}" = set; then
   1.605 -  echo $ECHO_N "(cached) $ECHO_C" >&6
   1.606 -else
   1.607 -  cat >conftest.$ac_ext <<_ACEOF
   1.608 -/* confdefs.h.  */
   1.609 -_ACEOF
   1.610 -cat confdefs.h >>conftest.$ac_ext
   1.611 -cat >>conftest.$ac_ext <<_ACEOF
   1.612 -/* end confdefs.h.  */
   1.613 -#include <X11/Xlib.h>
   1.614 -
   1.615 -
   1.616 -#include <X11/extensions/XInput.h>
   1.617 -_ACEOF
   1.618 -rm -f conftest.$ac_objext
   1.619 -if { (ac_try="$ac_compile"
   1.620 -case "(($ac_try" in
   1.621 -  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.622 -  *) ac_try_echo=$ac_try;;
   1.623 -esac
   1.624 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.625 -  (eval "$ac_compile") 2>conftest.er1
   1.626 -  ac_status=$?
   1.627 -  grep -v '^ *+' conftest.er1 >conftest.err
   1.628 -  rm -f conftest.er1
   1.629 -  cat conftest.err >&5
   1.630 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.631 -  (exit $ac_status); } && {
   1.632 -	 test -z "$ac_c_werror_flag" ||
   1.633 -	 test ! -s conftest.err
   1.634 -       } && test -s conftest.$ac_objext; then
   1.635 -  ac_cv_header_X11_extensions_XInput_h=yes
   1.636 -else
   1.637 -  echo "$as_me: failed program was:" >&5
   1.638 -sed 's/^/| /' conftest.$ac_ext >&5
   1.639 -
   1.640 -	ac_cv_header_X11_extensions_XInput_h=no
   1.641 -fi
   1.642 -
   1.643 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.644 -fi
   1.645 -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XInput_h" >&5
   1.646 -echo "${ECHO_T}$ac_cv_header_X11_extensions_XInput_h" >&6; }
   1.647 -if test $ac_cv_header_X11_extensions_XInput_h = yes; then
   1.648 -  have_xinput_h_hdr=yes
   1.649 -else
   1.650 -  have_xinput_h_hdr=no
   1.651 -fi
   1.652 -
   1.653 -
   1.654 -                if test x$have_xinput_h_hdr = xyes; then
   1.655 -                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
   1.656 -                        echo "-- dynamic libXi -> $xinput_lib"
   1.657 -                        cat >>confdefs.h <<_ACEOF
   1.658 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "$xinput_lib"
   1.659 -_ACEOF
   1.660 -
   1.661 -                        definitely_enable_video_x11_xinput=yes
   1.662 -                    else
   1.663 -                        { echo "$as_me:$LINENO: checking for XOpenDevice in -lXi" >&5
   1.664 -echo $ECHO_N "checking for XOpenDevice in -lXi... $ECHO_C" >&6; }
   1.665 -if test "${ac_cv_lib_Xi_XOpenDevice+set}" = set; then
   1.666 -  echo $ECHO_N "(cached) $ECHO_C" >&6
   1.667 -else
   1.668 -  ac_check_lib_save_LIBS=$LIBS
   1.669 -LIBS="-lXi  $LIBS"
   1.670 -cat >conftest.$ac_ext <<_ACEOF
   1.671 -/* confdefs.h.  */
   1.672 -_ACEOF
   1.673 -cat confdefs.h >>conftest.$ac_ext
   1.674 -cat >>conftest.$ac_ext <<_ACEOF
   1.675 -/* end confdefs.h.  */
   1.676 -
   1.677 -/* Override any GCC internal prototype to avoid an error.
   1.678 -   Use char because int might match the return type of a GCC
   1.679 -   builtin and then its argument prototype would still apply.  */
   1.680 -#ifdef __cplusplus
   1.681 -extern "C"
   1.682 -#endif
   1.683 -char XOpenDevice ();
   1.684 -int
   1.685 -main ()
   1.686 -{
   1.687 -return XOpenDevice ();
   1.688 -  ;
   1.689 -  return 0;
   1.690 -}
   1.691 -_ACEOF
   1.692 -rm -f conftest.$ac_objext conftest$ac_exeext
   1.693 -if { (ac_try="$ac_link"
   1.694 -case "(($ac_try" in
   1.695 -  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.696 -  *) ac_try_echo=$ac_try;;
   1.697 -esac
   1.698 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.699 -  (eval "$ac_link") 2>conftest.er1
   1.700 -  ac_status=$?
   1.701 -  grep -v '^ *+' conftest.er1 >conftest.err
   1.702 -  rm -f conftest.er1
   1.703 -  cat conftest.err >&5
   1.704 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.705 -  (exit $ac_status); } && {
   1.706 -	 test -z "$ac_c_werror_flag" ||
   1.707 -	 test ! -s conftest.err
   1.708 -       } && test -s conftest$ac_exeext &&
   1.709 -       $as_test_x conftest$ac_exeext; then
   1.710 -  ac_cv_lib_Xi_XOpenDevice=yes
   1.711 -else
   1.712 -  echo "$as_me: failed program was:" >&5
   1.713 -sed 's/^/| /' conftest.$ac_ext >&5
   1.714 -
   1.715 -	ac_cv_lib_Xi_XOpenDevice=no
   1.716 -fi
   1.717 -
   1.718 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
   1.719 -      conftest$ac_exeext conftest.$ac_ext
   1.720 -LIBS=$ac_check_lib_save_LIBS
   1.721 -fi
   1.722 -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xi_XOpenDevice" >&5
   1.723 -echo "${ECHO_T}$ac_cv_lib_Xi_XOpenDevice" >&6; }
   1.724 -if test $ac_cv_lib_Xi_XOpenDevice = yes; then
   1.725 -  have_xinput_lib=yes
   1.726 -fi
   1.727 -
   1.728 -                        if test x$have_xinput_lib = xyes ; then
   1.729 -                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
   1.730 -                            definitely_enable_video_x11_xinput=yes
   1.731 -                        fi
   1.732 -                    fi
   1.733 -                fi
   1.734 -            fi
   1.735 -            if test x$definitely_enable_video_x11_xinput = xyes; then
   1.736 -                cat >>confdefs.h <<\_ACEOF
   1.737 -#define SDL_VIDEO_DRIVER_X11_XINPUT 1
   1.738 -_ACEOF
   1.739 -
   1.740 -            fi
   1.741              # Check whether --enable-video-x11-scrnsaver was given.
   1.742  if test "${enable_video_x11_scrnsaver+set}" = set; then
   1.743    enableval=$enable_video_x11_scrnsaver;
   1.744 @@ -24708,7 +24746,222 @@
   1.745              fi
   1.746              if test x$definitely_enable_video_x11_scrnsaver = xyes; then
   1.747                  cat >>confdefs.h <<\_ACEOF
   1.748 -#define SDL_VIDEO_DRIVER_X11_SCRNSAVER 1
   1.749 +#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
   1.750 +_ACEOF
   1.751 +
   1.752 +            fi
   1.753 +            # Check whether --enable-video-x11-xshape was given.
   1.754 +if test "${enable_video_x11_xshape+set}" = set; then
   1.755 +  enableval=$enable_video_x11_xshape;
   1.756 +else
   1.757 +  enable_video_x11_xshape=yes
   1.758 +fi
   1.759 +
   1.760 +            if test x$enable_video_x11_xshape = xyes; then
   1.761 +                { echo "$as_me:$LINENO: checking for X11/extensions/shape.h" >&5
   1.762 +echo $ECHO_N "checking for X11/extensions/shape.h... $ECHO_C" >&6; }
   1.763 +if test "${ac_cv_header_X11_extensions_shape_h+set}" = set; then
   1.764 +  echo $ECHO_N "(cached) $ECHO_C" >&6
   1.765 +else
   1.766 +  cat >conftest.$ac_ext <<_ACEOF
   1.767 +/* confdefs.h.  */
   1.768 +_ACEOF
   1.769 +cat confdefs.h >>conftest.$ac_ext
   1.770 +cat >>conftest.$ac_ext <<_ACEOF
   1.771 +/* end confdefs.h.  */
   1.772 +#include <X11/Xlib.h>
   1.773 +
   1.774 +
   1.775 +#include <X11/extensions/shape.h>
   1.776 +_ACEOF
   1.777 +rm -f conftest.$ac_objext
   1.778 +if { (ac_try="$ac_compile"
   1.779 +case "(($ac_try" in
   1.780 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.781 +  *) ac_try_echo=$ac_try;;
   1.782 +esac
   1.783 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.784 +  (eval "$ac_compile") 2>conftest.er1
   1.785 +  ac_status=$?
   1.786 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.787 +  rm -f conftest.er1
   1.788 +  cat conftest.err >&5
   1.789 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.790 +  (exit $ac_status); } && {
   1.791 +	 test -z "$ac_c_werror_flag" ||
   1.792 +	 test ! -s conftest.err
   1.793 +       } && test -s conftest.$ac_objext; then
   1.794 +  ac_cv_header_X11_extensions_shape_h=yes
   1.795 +else
   1.796 +  echo "$as_me: failed program was:" >&5
   1.797 +sed 's/^/| /' conftest.$ac_ext >&5
   1.798 +
   1.799 +	ac_cv_header_X11_extensions_shape_h=no
   1.800 +fi
   1.801 +
   1.802 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.803 +fi
   1.804 +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_shape_h" >&5
   1.805 +echo "${ECHO_T}$ac_cv_header_X11_extensions_shape_h" >&6; }
   1.806 +if test $ac_cv_header_X11_extensions_shape_h = yes; then
   1.807 +  have_shape_h_hdr=yes
   1.808 +else
   1.809 +  have_shape_h_hdr=no
   1.810 +fi
   1.811 +
   1.812 +
   1.813 +                if test x$have_shape_h_hdr = xyes; then
   1.814 +                    cat >>confdefs.h <<\_ACEOF
   1.815 +#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
   1.816 +_ACEOF
   1.817 +
   1.818 +                fi
   1.819 +            fi
   1.820 +            # Check whether --enable-video-x11-vm was given.
   1.821 +if test "${enable_video_x11_vm+set}" = set; then
   1.822 +  enableval=$enable_video_x11_vm;
   1.823 +else
   1.824 +  enable_video_x11_vm=yes
   1.825 +fi
   1.826 +
   1.827 +            if test x$enable_video_x11_vm = xyes; then
   1.828 +                definitely_enable_video_x11_vm=no
   1.829 +                { echo "$as_me:$LINENO: checking for X11/extensions/xf86vmode.h" >&5
   1.830 +echo $ECHO_N "checking for X11/extensions/xf86vmode.h... $ECHO_C" >&6; }
   1.831 +if test "${ac_cv_header_X11_extensions_xf86vmode_h+set}" = set; then
   1.832 +  echo $ECHO_N "(cached) $ECHO_C" >&6
   1.833 +else
   1.834 +  cat >conftest.$ac_ext <<_ACEOF
   1.835 +/* confdefs.h.  */
   1.836 +_ACEOF
   1.837 +cat confdefs.h >>conftest.$ac_ext
   1.838 +cat >>conftest.$ac_ext <<_ACEOF
   1.839 +/* end confdefs.h.  */
   1.840 +#include <X11/Xlib.h>
   1.841 +
   1.842 +
   1.843 +#include <X11/extensions/xf86vmode.h>
   1.844 +_ACEOF
   1.845 +rm -f conftest.$ac_objext
   1.846 +if { (ac_try="$ac_compile"
   1.847 +case "(($ac_try" in
   1.848 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.849 +  *) ac_try_echo=$ac_try;;
   1.850 +esac
   1.851 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.852 +  (eval "$ac_compile") 2>conftest.er1
   1.853 +  ac_status=$?
   1.854 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.855 +  rm -f conftest.er1
   1.856 +  cat conftest.err >&5
   1.857 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.858 +  (exit $ac_status); } && {
   1.859 +	 test -z "$ac_c_werror_flag" ||
   1.860 +	 test ! -s conftest.err
   1.861 +       } && test -s conftest.$ac_objext; then
   1.862 +  ac_cv_header_X11_extensions_xf86vmode_h=yes
   1.863 +else
   1.864 +  echo "$as_me: failed program was:" >&5
   1.865 +sed 's/^/| /' conftest.$ac_ext >&5
   1.866 +
   1.867 +	ac_cv_header_X11_extensions_xf86vmode_h=no
   1.868 +fi
   1.869 +
   1.870 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.871 +fi
   1.872 +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_xf86vmode_h" >&5
   1.873 +echo "${ECHO_T}$ac_cv_header_X11_extensions_xf86vmode_h" >&6; }
   1.874 +if test $ac_cv_header_X11_extensions_xf86vmode_h = yes; then
   1.875 +  have_vm_h_hdr=yes
   1.876 +else
   1.877 +  have_vm_h_hdr=no
   1.878 +fi
   1.879 +
   1.880 +
   1.881 +                if test x$have_vm_h_hdr = xyes; then
   1.882 +                    if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
   1.883 +                        echo "-- dynamic libXxf86vm -> $xvidmode_lib"
   1.884 +                        cat >>confdefs.h <<_ACEOF
   1.885 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "$xvidmode_lib"
   1.886 +_ACEOF
   1.887 +
   1.888 +                        definitely_enable_video_x11_vm=yes
   1.889 +                    else
   1.890 +                        { echo "$as_me:$LINENO: checking for XF86VidModeQueryVersion in -lXxf86vm" >&5
   1.891 +echo $ECHO_N "checking for XF86VidModeQueryVersion in -lXxf86vm... $ECHO_C" >&6; }
   1.892 +if test "${ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion+set}" = set; then
   1.893 +  echo $ECHO_N "(cached) $ECHO_C" >&6
   1.894 +else
   1.895 +  ac_check_lib_save_LIBS=$LIBS
   1.896 +LIBS="-lXxf86vm  $LIBS"
   1.897 +cat >conftest.$ac_ext <<_ACEOF
   1.898 +/* confdefs.h.  */
   1.899 +_ACEOF
   1.900 +cat confdefs.h >>conftest.$ac_ext
   1.901 +cat >>conftest.$ac_ext <<_ACEOF
   1.902 +/* end confdefs.h.  */
   1.903 +
   1.904 +/* Override any GCC internal prototype to avoid an error.
   1.905 +   Use char because int might match the return type of a GCC
   1.906 +   builtin and then its argument prototype would still apply.  */
   1.907 +#ifdef __cplusplus
   1.908 +extern "C"
   1.909 +#endif
   1.910 +char XF86VidModeQueryVersion ();
   1.911 +int
   1.912 +main ()
   1.913 +{
   1.914 +return XF86VidModeQueryVersion ();
   1.915 +  ;
   1.916 +  return 0;
   1.917 +}
   1.918 +_ACEOF
   1.919 +rm -f conftest.$ac_objext conftest$ac_exeext
   1.920 +if { (ac_try="$ac_link"
   1.921 +case "(($ac_try" in
   1.922 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.923 +  *) ac_try_echo=$ac_try;;
   1.924 +esac
   1.925 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   1.926 +  (eval "$ac_link") 2>conftest.er1
   1.927 +  ac_status=$?
   1.928 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.929 +  rm -f conftest.er1
   1.930 +  cat conftest.err >&5
   1.931 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.932 +  (exit $ac_status); } && {
   1.933 +	 test -z "$ac_c_werror_flag" ||
   1.934 +	 test ! -s conftest.err
   1.935 +       } && test -s conftest$ac_exeext &&
   1.936 +       $as_test_x conftest$ac_exeext; then
   1.937 +  ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion=yes
   1.938 +else
   1.939 +  echo "$as_me: failed program was:" >&5
   1.940 +sed 's/^/| /' conftest.$ac_ext >&5
   1.941 +
   1.942 +	ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion=no
   1.943 +fi
   1.944 +
   1.945 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
   1.946 +      conftest$ac_exeext conftest.$ac_ext
   1.947 +LIBS=$ac_check_lib_save_LIBS
   1.948 +fi
   1.949 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" >&5
   1.950 +echo "${ECHO_T}$ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" >&6; }
   1.951 +if test $ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion = yes; then
   1.952 +  have_vm_lib=yes
   1.953 +fi
   1.954 +
   1.955 +                        if test x$have_vm_lib = xyes ; then
   1.956 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
   1.957 +                            definitely_enable_video_x11_vm=yes
   1.958 +                        fi
   1.959 +                    fi
   1.960 +                fi
   1.961 +            fi
   1.962 +            if test x$definitely_enable_video_x11_vm = xyes; then
   1.963 +                cat >>confdefs.h <<\_ACEOF
   1.964 +#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
   1.965  _ACEOF
   1.966  
   1.967              fi
     2.1 --- a/configure.in	Sun Feb 27 22:22:58 2011 -0800
     2.2 +++ b/configure.in	Mon Feb 28 09:01:53 2011 -0800
     2.3 @@ -1095,12 +1095,12 @@
     2.4                      x11_symbols_private=yes
     2.5                      x11_lib='/usr/X11R6/lib/libX11.6.dylib'
     2.6                      x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
     2.7 +                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
     2.8 +                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
     2.9 +                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
    2.10                      xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
    2.11 -                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
    2.12 -                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
    2.13 -                    xss_lib='/usr/X11R6/lib/libXss.6.dylib'
    2.14 -                    xdamage_lib='/usr/X11R6/lib/libXdamage.1.dylib'
    2.15 -                    xfixes_lib='/usr/X11R6/lib/libXfixes.3.dylib'
    2.16 +                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
    2.17 +                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
    2.18                      ;;
    2.19                  *-*-osf*)
    2.20                      x11_lib='libX11.so'
    2.21 @@ -1113,12 +1113,12 @@
    2.22                  *)
    2.23                      x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.24                      x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.25 +                    xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.26 +                    xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.27 +                    xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.28                      xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.29 -                    xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.30 -                    xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.31                      xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.32 -                    xdamage_lib=[`find_lib "libXdamage.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.33 -                    xfixes_lib=[`find_lib "libXfixes.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.34 +                    xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.35                      ;;
    2.36              esac
    2.37  
    2.38 @@ -1158,40 +1158,60 @@
    2.39              fi
    2.40              have_video=yes
    2.41  
    2.42 -            AC_ARG_ENABLE(video-x11-vm,
    2.43 -AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
    2.44 -                          , enable_video_x11_vm=yes)
    2.45 -            if test x$enable_video_x11_vm = xyes; then
    2.46 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
    2.47 -                SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
    2.48 -            fi
    2.49 -            AC_ARG_ENABLE(video-x11-xv,
    2.50 -AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]),
    2.51 -                          , enable_video_x11_xv=yes)
    2.52 -            if test x$enable_video_x11_xv = xyes; then
    2.53 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV)
    2.54 -                SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
    2.55 -            fi
    2.56              AC_ARG_ENABLE(video-x11-xinerama,
    2.57  AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
    2.58                              , enable_video_x11_xinerama=yes)
    2.59              if test x$enable_video_x11_xinerama = xyes; then
    2.60 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
    2.61 -                SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
    2.62 -            fi
    2.63 -            AC_ARG_ENABLE(video-x11-xshape,
    2.64 -AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
    2.65 -                            , enable_video_x11_xshape=yes)
    2.66 -            if test x$enable_video_x11_xshape = xyes; then
    2.67 -                AC_CHECK_HEADER(X11/extensions/shape.h,
    2.68 -                                have_shape_h_hdr=yes,
    2.69 -                                have_shape_h_hdr=no,
    2.70 +                definitely_enable_video_x11_xinerama=no
    2.71 +                AC_CHECK_HEADER(X11/extensions/Xinerama.h,
    2.72 +                                have_xinerama_h_hdr=yes,
    2.73 +                                have_xinerama_h_hdr=no,
    2.74                                  [#include <X11/Xlib.h>
    2.75                                  ])
    2.76 -                if test x$have_shape_h_hdr = xyes; then
    2.77 -                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE)
    2.78 +                if test x$have_xinerama_h_hdr = xyes; then
    2.79 +                    if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
    2.80 +                        echo "-- dynamic libXinerama -> $xinerama_lib"
    2.81 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib")
    2.82 +                        definitely_enable_video_x11_xinerama=yes
    2.83 +                    else
    2.84 +                        AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
    2.85 +                        if test x$have_xinerama_lib = xyes ; then
    2.86 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
    2.87 +                            definitely_enable_video_x11_xinerama=yes
    2.88 +                        fi
    2.89 +                    fi
    2.90                  fi
    2.91              fi
    2.92 +            if test x$definitely_enable_video_x11_xinerama = xyes; then
    2.93 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
    2.94 +            fi
    2.95 +            AC_ARG_ENABLE(video-x11-xinput,
    2.96 +AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
    2.97 +                            , enable_video_x11_xinput=yes)
    2.98 +            if test x$enable_video_x11_xinput = xyes; then
    2.99 +                definitely_enable_video_x11_xinput=no
   2.100 +                AC_CHECK_HEADER(X11/extensions/XInput.h,
   2.101 +                                have_xinput_h_hdr=yes,
   2.102 +                                have_xinput_h_hdr=no,
   2.103 +                                [#include <X11/Xlib.h>
   2.104 +                                ])
   2.105 +                if test x$have_xinput_h_hdr = xyes; then
   2.106 +                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
   2.107 +                        echo "-- dynamic libXi -> $xinput_lib"
   2.108 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT, "$xinput_lib")
   2.109 +                        definitely_enable_video_x11_xinput=yes
   2.110 +                    else
   2.111 +                        AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
   2.112 +                        if test x$have_xinput_lib = xyes ; then
   2.113 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
   2.114 +                            definitely_enable_video_x11_xinput=yes
   2.115 +                        fi
   2.116 +                    fi
   2.117 +                fi
   2.118 +            fi
   2.119 +            if test x$definitely_enable_video_x11_xinput = xyes; then
   2.120 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT)
   2.121 +            fi
   2.122              AC_ARG_ENABLE(video-x11-xrandr,
   2.123  AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
   2.124                              , enable_video_x11_xrandr=yes)
   2.125 @@ -1219,33 +1239,6 @@
   2.126              if test x$definitely_enable_video_x11_xrandr = xyes; then
   2.127                  AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
   2.128              fi
   2.129 -            AC_ARG_ENABLE(video-x11-xinput,
   2.130 -AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
   2.131 -                            , enable_video_x11_xinput=yes)
   2.132 -            if test x$enable_video_x11_xinput = xyes; then
   2.133 -                definitely_enable_video_x11_xinput=no
   2.134 -                AC_CHECK_HEADER(X11/extensions/XInput.h,
   2.135 -                                have_xinput_h_hdr=yes,
   2.136 -                                have_xinput_h_hdr=no,
   2.137 -                                [#include <X11/Xlib.h>
   2.138 -                                ])
   2.139 -                if test x$have_xinput_h_hdr = xyes; then
   2.140 -                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
   2.141 -                        echo "-- dynamic libXi -> $xinput_lib"
   2.142 -                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT, "$xinput_lib")
   2.143 -                        definitely_enable_video_x11_xinput=yes
   2.144 -                    else
   2.145 -                        AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
   2.146 -                        if test x$have_xinput_lib = xyes ; then
   2.147 -                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
   2.148 -                            definitely_enable_video_x11_xinput=yes
   2.149 -                        fi
   2.150 -                    fi
   2.151 -                fi
   2.152 -            fi
   2.153 -            if test x$definitely_enable_video_x11_xinput = xyes; then
   2.154 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT)
   2.155 -            fi
   2.156              AC_ARG_ENABLE(video-x11-scrnsaver,
   2.157  AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
   2.158                              , enable_video_x11_scrnsaver=yes)
   2.159 @@ -1270,7 +1263,47 @@
   2.160                  fi
   2.161              fi
   2.162              if test x$definitely_enable_video_x11_scrnsaver = xyes; then
   2.163 -                AC_DEFINE(SDL_VIDEO_DRIVER_X11_SCRNSAVER)
   2.164 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER)
   2.165 +            fi
   2.166 +            AC_ARG_ENABLE(video-x11-xshape,
   2.167 +AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
   2.168 +                            , enable_video_x11_xshape=yes)
   2.169 +            if test x$enable_video_x11_xshape = xyes; then
   2.170 +                AC_CHECK_HEADER(X11/extensions/shape.h,
   2.171 +                                have_shape_h_hdr=yes,
   2.172 +                                have_shape_h_hdr=no,
   2.173 +                                [#include <X11/Xlib.h>
   2.174 +                                ])
   2.175 +                if test x$have_shape_h_hdr = xyes; then
   2.176 +                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE)
   2.177 +                fi
   2.178 +            fi
   2.179 +            AC_ARG_ENABLE(video-x11-vm,
   2.180 +AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
   2.181 +                            , enable_video_x11_vm=yes)
   2.182 +            if test x$enable_video_x11_vm = xyes; then
   2.183 +                definitely_enable_video_x11_vm=no
   2.184 +                AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
   2.185 +                                have_vm_h_hdr=yes,
   2.186 +                                have_vm_h_hdr=no,
   2.187 +                                [#include <X11/Xlib.h>
   2.188 +                                ])
   2.189 +                if test x$have_vm_h_hdr = xyes; then
   2.190 +                    if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
   2.191 +                        echo "-- dynamic libXxf86vm -> $xvidmode_lib"
   2.192 +                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib")
   2.193 +                        definitely_enable_video_x11_vm=yes
   2.194 +                    else
   2.195 +                        AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
   2.196 +                        if test x$have_vm_lib = xyes ; then
   2.197 +                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
   2.198 +                            definitely_enable_video_x11_vm=yes
   2.199 +                        fi
   2.200 +                    fi
   2.201 +                fi
   2.202 +            fi
   2.203 +            if test x$definitely_enable_video_x11_vm = xyes; then
   2.204 +                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE)
   2.205              fi
   2.206          fi
   2.207      fi
     3.1 --- a/include/SDL_config.h.in	Sun Feb 27 22:22:58 2011 -0800
     3.2 +++ b/include/SDL_config.h.in	Mon Feb 28 09:01:53 2011 -0800
     3.3 @@ -267,16 +267,17 @@
     3.4  #undef SDL_VIDEO_DRIVER_X11
     3.5  #undef SDL_VIDEO_DRIVER_X11_DYNAMIC
     3.6  #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
     3.7 +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA
     3.8 +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT
     3.9  #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
    3.10 -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT
    3.11  #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
    3.12 -#undef SDL_VIDEO_DRIVER_X11_VIDMODE
    3.13 +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE
    3.14  #undef SDL_VIDEO_DRIVER_X11_XINERAMA
    3.15 +#undef SDL_VIDEO_DRIVER_X11_XINPUT
    3.16  #undef SDL_VIDEO_DRIVER_X11_XRANDR
    3.17 -#undef SDL_VIDEO_DRIVER_X11_XINPUT
    3.18 -#undef SDL_VIDEO_DRIVER_X11_SCRNSAVER
    3.19 -#undef SDL_VIDEO_DRIVER_X11_XV
    3.20 +#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER
    3.21  #undef SDL_VIDEO_DRIVER_X11_XSHAPE
    3.22 +#undef SDL_VIDEO_DRIVER_X11_XVIDMODE
    3.23  
    3.24  #undef SDL_VIDEO_RENDER_D3D
    3.25  #undef SDL_VIDEO_RENDER_OGL
     4.1 --- a/include/SDL_config_macosx.h	Sun Feb 27 22:22:58 2011 -0800
     4.2 +++ b/include/SDL_config_macosx.h	Mon Feb 28 09:01:53 2011 -0800
     4.3 @@ -136,17 +136,17 @@
     4.4  #define SDL_VIDEO_DRIVER_X11 1
     4.5  #define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
     4.6  #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
     4.7 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
     4.8 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "/usr/X11R6/lib/libXi.6.dylib"
     4.9  #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
    4.10 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib"
    4.11 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "/usr/X11R6/lib/libXi.6.dylib"
    4.12 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.6.dylib"
    4.13 -#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
    4.14 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
    4.15 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
    4.16  #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
    4.17 +#define SDL_VIDEO_DRIVER_X11_XINPUT 1
    4.18  #define SDL_VIDEO_DRIVER_X11_XRANDR 1
    4.19 -#define SDL_VIDEO_DRIVER_X11_XINPUT 1
    4.20 -#define SDL_VIDEO_DRIVER_X11_SCRNSAVER 1
    4.21 -#define SDL_VIDEO_DRIVER_X11_XV 1
    4.22 +#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
    4.23  #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
    4.24 +#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
    4.25  
    4.26  #ifndef SDL_VIDEO_RENDER_OGL
    4.27  #define SDL_VIDEO_RENDER_OGL	1
     5.1 --- a/src/video/Xext/README	Sun Feb 27 22:22:58 2011 -0800
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,10 +0,0 @@
     5.4 -
     5.5 -The reason these libraries are built outside of the standard XFree86
     5.6 -tree is so that they can be linked as shared object code directly into
     5.7 -SDL without causing any symbol collisions with code in the application.
     5.8 -
     5.9 -You can't link static library code into shared libraries on non-x86
    5.10 -Linux platforms.  Since these libraries haven't become standard yet,
    5.11 -we'll just include them directly.
    5.12 -
    5.13 -These sources are synchronized with XFree86 4.2.1
     6.1 --- a/src/video/Xext/XME/xme.c	Sun Feb 27 22:22:58 2011 -0800
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,426 +0,0 @@
     6.4 -/*
     6.5 - * Copyright 1993-2001 by Xi Graphics, Inc.
     6.6 - * All Rights Reserved.
     6.7 - *
     6.8 - * Please see the LICENSE file accompanying this distribution for licensing 
     6.9 - * information. 
    6.10 - *
    6.11 - * Please send any bug fixes and modifications to src@xig.com.
    6.12 - *
    6.13 - * $XiGId: xme.c,v 1.2 2001/11/30 21:56:59 jon Exp $
    6.14 - *
    6.15 - */
    6.16 -
    6.17 -#define NEED_EVENTS
    6.18 -#define NEED_REPLIES
    6.19 -
    6.20 -/* Apparently some X11 systems can't include this multiple times... */
    6.21 -#ifndef SDL_INCLUDED_XLIBINT_H
    6.22 -#define SDL_INCLUDED_XLIBINT_H 1
    6.23 -#include <X11/Xlibint.h>
    6.24 -#endif
    6.25 -
    6.26 -#include <X11/Xthreads.h>
    6.27 -#include <X11/Xmd.h>
    6.28 -#include <X11/Xproto.h>
    6.29 -#include "../extensions/Xext.h"
    6.30 -#include "../extensions/extutil.h"
    6.31 -
    6.32 -/*****************************************************************************/
    6.33 -
    6.34 -
    6.35 -#define	XIGMISC_PROTOCOL_NAME 		     "XiG-SUNDRY-NONSTANDARD"
    6.36 -#define XIGMISC_MAJOR_VERSION	             2
    6.37 -#define XIGMISC_MINOR_VERSION 	             0
    6.38 -
    6.39 -#define XiGMiscNumberEvents	             0
    6.40 -
    6.41 -#define	X_XiGMiscQueryVersion		     0
    6.42 -#define	X_XiGMiscQueryViews		     1
    6.43 -#define X_XiGMiscQueryResolutions            2
    6.44 -#define X_XiGMiscChangeResolution            3
    6.45 -#define X_XiGMiscFullScreen                  4
    6.46 -
    6.47 -#define sz_xXiGMiscQueryVersionReq	     8
    6.48 -#define sz_xXiGMiscQueryViewsReq	     8
    6.49 -#define sz_xXiGMiscQueryResolutionsReq       8
    6.50 -#define sz_xXiGMiscChangeResolutionReq       16
    6.51 -#define sz_xXiGMiscFullScreenReq             16
    6.52 -
    6.53 -#define sz_xXiGMiscQueryVersionReply	     32
    6.54 -#define sz_xXiGMiscQueryViewsReply	     32
    6.55 -#define sz_xXiGMiscQueryResolutionsReply     32
    6.56 -#define sz_xXiGMiscQueryFullScreenReply      32
    6.57 -
    6.58 -/*******************************************************************/
    6.59 -
    6.60 -typedef struct
    6.61 -{
    6.62 -    CARD8 reqType;              /* always codes->major_opcode        */
    6.63 -    CARD8 xigmiscReqType;       /* always X_XiGMiscQueryVersion      */
    6.64 -    CARD16 length;
    6.65 -    CARD16 major;
    6.66 -    CARD16 minor;
    6.67 -} xXiGMiscQueryVersionReq;
    6.68 -
    6.69 -typedef struct
    6.70 -{
    6.71 -    CARD8 reqType;              /* always codes->major_opcode        */
    6.72 -    CARD8 xigmiscReqType;       /* always X_XiGMiscQueryViews        */
    6.73 -    CARD16 length;
    6.74 -    CARD8 screen;
    6.75 -    CARD8 pad0;
    6.76 -    CARD16 pad1;
    6.77 -} xXiGMiscQueryViewsReq;
    6.78 -
    6.79 -typedef struct
    6.80 -{
    6.81 -    CARD8 reqType;              /* always codes->major_opcode        */
    6.82 -    CARD8 xigmiscReqType;       /* always X_XiGMiscQueryResolutions  */
    6.83 -    CARD16 length;
    6.84 -    CARD8 screen;
    6.85 -    CARD8 view;
    6.86 -    CARD16 pad0;
    6.87 -} xXiGMiscQueryResolutionsReq;
    6.88 -
    6.89 -typedef struct
    6.90 -{
    6.91 -    CARD8 reqType;              /* always codes->major_opcode        */
    6.92 -    CARD8 xigmiscReqType;       /* always X_XiGMiscChangeResolution  */
    6.93 -    CARD16 length;
    6.94 -    CARD8 screen;
    6.95 -    CARD8 view;
    6.96 -    CARD16 pad0;
    6.97 -    CARD16 width;
    6.98 -    CARD16 height;
    6.99 -    INT32 refresh;
   6.100 -} xXiGMiscChangeResolutionReq;
   6.101 -
   6.102 -typedef struct
   6.103 -{
   6.104 -    CARD8 reqType;              /* always codes->major_opcode        */
   6.105 -    CARD8 xigmiscReqType;       /* always X_XiGMiscFullScreen        */
   6.106 -    CARD16 length;
   6.107 -    CARD8 screen;
   6.108 -    CARD8 pad0;
   6.109 -    CARD16 pad1;
   6.110 -    CARD32 window;
   6.111 -    CARD32 cmap;
   6.112 -} xXiGMiscFullScreenReq;
   6.113 -
   6.114 -/*******************************************************************/
   6.115 -
   6.116 -typedef struct
   6.117 -{
   6.118 -    BYTE type;                  /* X_Reply                           */
   6.119 -    CARD8 pad0;
   6.120 -    CARD16 sequenceNumber;
   6.121 -    CARD32 length;
   6.122 -    CARD16 major;
   6.123 -    CARD16 minor;
   6.124 -    CARD32 pad1;
   6.125 -    CARD32 pad2;
   6.126 -    CARD32 pad3;
   6.127 -    CARD32 pad4;
   6.128 -    CARD32 pad5;
   6.129 -} xXiGMiscQueryVersionReply;
   6.130 -
   6.131 -typedef struct
   6.132 -{
   6.133 -    BYTE type;                  /* X_Reply                           */
   6.134 -    CARD8 pad0;
   6.135 -    CARD16 sequenceNumber;
   6.136 -    CARD32 length;
   6.137 -    CARD32 nviews;
   6.138 -    CARD32 pad1;
   6.139 -    CARD32 pad2;
   6.140 -    CARD32 pad3;
   6.141 -    CARD32 pad4;
   6.142 -    CARD32 pad5;
   6.143 -} xXiGMiscQueryViewsReply;
   6.144 -
   6.145 -typedef struct
   6.146 -{
   6.147 -    BYTE type;                  /* X_Reply                           */
   6.148 -    CARD8 pad0;
   6.149 -    CARD16 sequenceNumber;
   6.150 -    CARD32 length;
   6.151 -    CARD16 active;
   6.152 -    CARD16 nresolutions;
   6.153 -    CARD32 pad1;
   6.154 -    CARD32 pad2;
   6.155 -    CARD32 pad3;
   6.156 -    CARD32 pad4;
   6.157 -    CARD32 pad5;
   6.158 -} xXiGMiscQueryResolutionsReply;
   6.159 -
   6.160 -typedef struct
   6.161 -{
   6.162 -    BYTE type;                  /* X_Reply                           */
   6.163 -    BOOL success;
   6.164 -    CARD16 sequenceNumber;
   6.165 -    CARD32 length;
   6.166 -    CARD32 pad1;
   6.167 -    CARD32 pad2;
   6.168 -    CARD32 pad3;
   6.169 -    CARD32 pad4;
   6.170 -    CARD32 pad5;
   6.171 -    CARD32 pad6;
   6.172 -} xXiGMiscFullScreenReply;
   6.173 -
   6.174 -/*******************************************************************/
   6.175 -
   6.176 -typedef struct
   6.177 -{
   6.178 -    INT16 x;
   6.179 -    INT16 y;
   6.180 -    CARD16 w;
   6.181 -    CARD16 h;
   6.182 -} XiGMiscViewInfo;
   6.183 -
   6.184 -typedef struct
   6.185 -{
   6.186 -    CARD16 width;
   6.187 -    CARD16 height;
   6.188 -    INT32 refresh;
   6.189 -} XiGMiscResolutionInfo;
   6.190 -
   6.191 -/*****************************************************************************/
   6.192 -
   6.193 -static XExtensionInfo *xigmisc_info = NULL;
   6.194 -static char *xigmisc_extension_name = XIGMISC_PROTOCOL_NAME;
   6.195 -
   6.196 -#define XiGMiscCheckExtension(dpy,i,val) \
   6.197 -  XextCheckExtension (dpy, i, xigmisc_extension_name, val)
   6.198 -#define XiGMiscSimpleCheckExtension(dpy,i) \
   6.199 -  XextSimpleCheckExtension (dpy, i, xigmisc_extension_name)
   6.200 -
   6.201 -#if defined(__STDC__) && !defined(UNIXCPP)
   6.202 -#define XiGMiscGetReq(name,req,info) GetReq (name, req); \
   6.203 -        req->reqType = info->codes->major_opcode; \
   6.204 -        req->xigmiscReqType = X_##name;
   6.205 -
   6.206 -#define XiGMiscGetReqExtra(name,n,req,info) GetReqExtra (name, n, req); \
   6.207 -        req->reqType = info->codes->major_opcode; \
   6.208 -        req->xigmicReqType = X_##name;
   6.209 -#else
   6.210 -#define XiGMiscGetReq(name,req,info) GetReq (name, req); \
   6.211 -        req->reqType = info->codes->major_opcode; \
   6.212 -        req->xigmiscReqType = X_/**/name;
   6.213 -#define XiGMiscGetReqExtra(name,n,req,info) GetReqExtra (name, n, req); \
   6.214 -        req->reqType = info->codes->major_opcode; \
   6.215 -        req->xigmiscReqType = X_/**/name;
   6.216 -#endif
   6.217 -
   6.218 -
   6.219 -
   6.220 -/*
   6.221 - * find_display - locate the display info block
   6.222 - */
   6.223 -static int XiGMiscCloseDisplay();
   6.224 -
   6.225 -static XExtensionHooks xigmisc_extension_hooks = {
   6.226 -    NULL,                       /* create_gc */
   6.227 -    NULL,                       /* copy_gc */
   6.228 -    NULL,                       /* flush_gc */
   6.229 -    NULL,                       /* free_gc */
   6.230 -    NULL,                       /* create_font */
   6.231 -    NULL,                       /* free_font */
   6.232 -    XiGMiscCloseDisplay,        /* close_display */
   6.233 -    NULL,                       /* wire_to_event */
   6.234 -    NULL,                       /* event_to_wire */
   6.235 -    NULL,                       /* error */
   6.236 -    NULL,                       /* error_string */
   6.237 -};
   6.238 -
   6.239 -
   6.240 -static
   6.241 -XEXT_GENERATE_CLOSE_DISPLAY(XiGMiscCloseDisplay, xigmisc_info)
   6.242 -     static XEXT_GENERATE_FIND_DISPLAY(XiGMiscFindDisplay, xigmisc_info,
   6.243 -                                       xigmisc_extension_name,
   6.244 -                                       &xigmisc_extension_hooks,
   6.245 -                                       XiGMiscNumberEvents, NULL)
   6.246 -/*****************************************************************************/
   6.247 -     Bool XiGMiscQueryVersion(Display * dpy, int *major, int *minor)
   6.248 -{
   6.249 -    int opcode, event, error;
   6.250 -    xXiGMiscQueryVersionReq *req;
   6.251 -    xXiGMiscQueryVersionReply rep;
   6.252 -    XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
   6.253 -
   6.254 -    if (!XQueryExtension(dpy, XIGMISC_PROTOCOL_NAME, &opcode, &event, &error))
   6.255 -        return xFalse;
   6.256 -
   6.257 -    XiGMiscCheckExtension(dpy, info, xFalse);
   6.258 -
   6.259 -    LockDisplay(dpy);
   6.260 -    XiGMiscGetReq(XiGMiscQueryVersion, req, info);
   6.261 -
   6.262 -    req->major = XIGMISC_MAJOR_VERSION;
   6.263 -    req->minor = XIGMISC_MINOR_VERSION;
   6.264 -
   6.265 -    if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
   6.266 -        UnlockDisplay(dpy);
   6.267 -        SyncHandle();
   6.268 -        return xFalse;
   6.269 -    }
   6.270 -
   6.271 -    *major = rep.major;
   6.272 -    *minor = rep.minor;
   6.273 -    UnlockDisplay(dpy);
   6.274 -    SyncHandle();
   6.275 -
   6.276 -    return xTrue;
   6.277 -}
   6.278 -
   6.279 -int
   6.280 -XiGMiscQueryViews(Display * dpy, int screen, XiGMiscViewInfo ** pviews)
   6.281 -{
   6.282 -    int n, size;
   6.283 -    XiGMiscViewInfo *views;
   6.284 -    xXiGMiscQueryViewsReq *req;
   6.285 -    xXiGMiscQueryViewsReply rep;
   6.286 -    XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
   6.287 -    XiGMiscCheckExtension(dpy, info, 0);
   6.288 -
   6.289 -    LockDisplay(dpy);
   6.290 -    XiGMiscGetReq(XiGMiscQueryViews, req, info);
   6.291 -    req->screen = screen;
   6.292 -
   6.293 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
   6.294 -        UnlockDisplay(dpy);
   6.295 -        SyncHandle();
   6.296 -        return 0;
   6.297 -    }
   6.298 -
   6.299 -    n = rep.nviews;
   6.300 -
   6.301 -    if (n > 0) {
   6.302 -        size = sizeof(XiGMiscViewInfo) * n;
   6.303 -        views = (XiGMiscViewInfo *) Xmalloc(size);
   6.304 -        if (!views) {
   6.305 -            _XEatData(dpy, (unsigned long) size);
   6.306 -            UnlockDisplay(dpy);
   6.307 -            SyncHandle();
   6.308 -            return 0;
   6.309 -        }
   6.310 -
   6.311 -        _XReadPad(dpy, (void *) views, size);
   6.312 -
   6.313 -        *pviews = views;
   6.314 -    }
   6.315 -
   6.316 -    UnlockDisplay(dpy);
   6.317 -    SyncHandle();
   6.318 -
   6.319 -    return n;
   6.320 -}
   6.321 -
   6.322 -int
   6.323 -XiGMiscQueryResolutions(Display * dpy, int screen, int view, int *pactive,
   6.324 -                        XiGMiscResolutionInfo ** presolutions)
   6.325 -{
   6.326 -    int n, size;
   6.327 -    XiGMiscResolutionInfo *resolutions;
   6.328 -    xXiGMiscQueryResolutionsReq *req;
   6.329 -    xXiGMiscQueryResolutionsReply rep;
   6.330 -    XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
   6.331 -    XiGMiscCheckExtension(dpy, info, 0);
   6.332 -
   6.333 -    LockDisplay(dpy);
   6.334 -    XiGMiscGetReq(XiGMiscQueryResolutions, req, info);
   6.335 -    req->screen = screen;
   6.336 -    req->view = view;
   6.337 -
   6.338 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
   6.339 -        UnlockDisplay(dpy);
   6.340 -        SyncHandle();
   6.341 -        return 0;
   6.342 -    }
   6.343 -
   6.344 -    n = rep.nresolutions;
   6.345 -
   6.346 -    if (n > 0) {
   6.347 -        size = sizeof(XiGMiscResolutionInfo) * n;
   6.348 -        resolutions = (XiGMiscResolutionInfo *) Xmalloc(size);
   6.349 -        if (!resolutions) {
   6.350 -            _XEatData(dpy, (unsigned long) size);
   6.351 -            UnlockDisplay(dpy);
   6.352 -            SyncHandle();
   6.353 -            return 0;
   6.354 -        }
   6.355 -
   6.356 -        _XReadPad(dpy, (void *) resolutions, size);
   6.357 -
   6.358 -        *presolutions = resolutions;
   6.359 -        *pactive = rep.active;
   6.360 -    }
   6.361 -
   6.362 -    UnlockDisplay(dpy);
   6.363 -    SyncHandle();
   6.364 -
   6.365 -    return n;
   6.366 -}
   6.367 -
   6.368 -void
   6.369 -XiGMiscChangeResolution(Display * dpy, int screen, int view, int width,
   6.370 -                        int height, int refresh)
   6.371 -{
   6.372 -    xXiGMiscChangeResolutionReq *req;
   6.373 -    XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
   6.374 -
   6.375 -    XiGMiscSimpleCheckExtension(dpy, info);
   6.376 -
   6.377 -    LockDisplay(dpy);
   6.378 -    XiGMiscGetReq(XiGMiscChangeResolution, req, info);
   6.379 -    req->screen = screen;
   6.380 -    req->view = view;
   6.381 -    req->width = width;
   6.382 -    req->height = height;
   6.383 -    req->refresh = refresh;
   6.384 -
   6.385 -    UnlockDisplay(dpy);
   6.386 -    SyncHandle();
   6.387 -}
   6.388 -
   6.389 -
   6.390 -Bool
   6.391 -XiGMiscFullScreen(Display * dpy, int screen, XID window, XID cmap)
   6.392 -{
   6.393 -    xXiGMiscFullScreenReq *req;
   6.394 -    xXiGMiscFullScreenReply rep;
   6.395 -    XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
   6.396 -
   6.397 -    XiGMiscCheckExtension(dpy, info, xFalse);
   6.398 -
   6.399 -    LockDisplay(dpy);
   6.400 -    XiGMiscGetReq(XiGMiscFullScreen, req, info);
   6.401 -    req->screen = screen;
   6.402 -    req->pad0 = 0;
   6.403 -    req->pad1 = 0;
   6.404 -    req->window = window;
   6.405 -    req->cmap = cmap;
   6.406 -
   6.407 -    if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
   6.408 -        UnlockDisplay(dpy);
   6.409 -        SyncHandle();
   6.410 -        return xFalse;
   6.411 -    }
   6.412 -
   6.413 -    UnlockDisplay(dpy);
   6.414 -    SyncHandle();
   6.415 -
   6.416 -    return (rep.success ? xTrue : xFalse);
   6.417 -}
   6.418 -
   6.419 -/* SDL addition from Ryan: free memory used by xme. */
   6.420 -void
   6.421 -XiGMiscDestroy(void)
   6.422 -{
   6.423 -    if (xigmisc_info) {
   6.424 -        XextDestroyExtension(xigmisc_info);
   6.425 -        xigmisc_info = NULL;
   6.426 -    }
   6.427 -}
   6.428 -
   6.429 -/* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/video/Xext/Xinerama/Xinerama.c	Sun Feb 27 22:22:58 2011 -0800
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,303 +0,0 @@
     7.4 -/* $Xorg: XPanoramiX.c,v 1.4 2000/08/17 19:45:51 cpqbld Exp $ */
     7.5 -/*****************************************************************
     7.6 -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
     7.7 -Permission is hereby granted, free of charge, to any person obtaining a copy
     7.8 -of this software and associated documentation files (the "Software"), to deal
     7.9 -in the Software without restriction, including without limitation the rights
    7.10 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    7.11 -copies of the Software.
    7.12 -
    7.13 -The above copyright notice and this permission notice shall be included in
    7.14 -all copies or substantial portions of the Software.
    7.15 -
    7.16 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    7.17 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    7.18 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
    7.19 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
    7.20 -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
    7.21 -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
    7.22 -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    7.23 -
    7.24 -Except as contained in this notice, the name of Digital Equipment Corporation
    7.25 -shall not be used in advertising or otherwise to promote the sale, use or other
    7.26 -dealings in this Software without prior written authorization from Digital
    7.27 -Equipment Corporation.
    7.28 -******************************************************************/
    7.29 -/* $XFree86: xc/lib/Xinerama/Xinerama.c,v 1.2 2001/07/23 17:20:28 dawes Exp $ */
    7.30 -
    7.31 -#define NEED_EVENTS
    7.32 -#define NEED_REPLIES
    7.33 -
    7.34 -/* Apparently some X11 systems can't include this multiple times... */
    7.35 -#ifndef SDL_INCLUDED_XLIBINT_H
    7.36 -#define SDL_INCLUDED_XLIBINT_H 1
    7.37 -#include <X11/Xlibint.h>
    7.38 -#endif
    7.39 -
    7.40 -#include <X11/Xutil.h>
    7.41 -#include "../extensions/Xext.h"
    7.42 -#include "../extensions/extutil.h"      /* in ../include */
    7.43 -#include "../extensions/panoramiXext.h"
    7.44 -#include "../extensions/panoramiXproto.h"       /* in ../include */
    7.45 -#include "../extensions/Xinerama.h"
    7.46 -
    7.47 -static XExtensionInfo _panoramiX_ext_info_data;
    7.48 -static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data;
    7.49 -static /* const */ char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME;
    7.50 -
    7.51 -#define PanoramiXCheckExtension(dpy,i,val) \
    7.52 -  XextCheckExtension (dpy, i, panoramiX_extension_name, val)
    7.53 -#define PanoramiXSimpleCheckExtension(dpy,i) \
    7.54 -  XextSimpleCheckExtension (dpy, i, panoramiX_extension_name)
    7.55 -
    7.56 -static int close_display();
    7.57 -static /* const */ XExtensionHooks panoramiX_extension_hooks = {
    7.58 -    NULL,                       /* create_gc */
    7.59 -    NULL,                       /* copy_gc */
    7.60 -    NULL,                       /* flush_gc */
    7.61 -    NULL,                       /* free_gc */
    7.62 -    NULL,                       /* create_font */
    7.63 -    NULL,                       /* free_font */
    7.64 -    close_display,              /* close_display */
    7.65 -    NULL,                       /* wire_to_event */
    7.66 -    NULL,                       /* event_to_wire */
    7.67 -    NULL,                       /* error */
    7.68 -    NULL,                       /* error_string */
    7.69 -};
    7.70 -
    7.71 -static
    7.72 -XEXT_GENERATE_FIND_DISPLAY(find_display, panoramiX_ext_info,
    7.73 -                           panoramiX_extension_name,
    7.74 -                           &panoramiX_extension_hooks, 0, NULL)
    7.75 -     static XEXT_GENERATE_CLOSE_DISPLAY(close_display, panoramiX_ext_info)
    7.76 -/****************************************************************************
    7.77 - *                                                                          *
    7.78 - *			    PanoramiX public interfaces                         *
    7.79 - *                                                                          *
    7.80 - ****************************************************************************/
    7.81 -     Bool SDL_NAME(XPanoramiXQueryExtension) (Display * dpy,
    7.82 -                                              int *event_basep,
    7.83 -                                              int *error_basep)
    7.84 -{
    7.85 -    XExtDisplayInfo *info = find_display(dpy);
    7.86 -
    7.87 -    if (XextHasExtension(info)) {
    7.88 -        *event_basep = info->codes->first_event;
    7.89 -        *error_basep = info->codes->first_error;
    7.90 -        return True;
    7.91 -    } else {
    7.92 -        return False;
    7.93 -    }
    7.94 -}
    7.95 -
    7.96 -
    7.97 -Status SDL_NAME(XPanoramiXQueryVersion) (Display * dpy,
    7.98 -                                         int *major_versionp,
    7.99 -                                         int *minor_versionp)
   7.100 -{
   7.101 -    XExtDisplayInfo *info = find_display(dpy);
   7.102 -    xPanoramiXQueryVersionReply rep;
   7.103 -    register xPanoramiXQueryVersionReq *req;
   7.104 -
   7.105 -    PanoramiXCheckExtension(dpy, info, 0);
   7.106 -
   7.107 -    LockDisplay(dpy);
   7.108 -    GetReq(PanoramiXQueryVersion, req);
   7.109 -    req->reqType = info->codes->major_opcode;
   7.110 -    req->panoramiXReqType = X_PanoramiXQueryVersion;
   7.111 -    req->clientMajor = PANORAMIX_MAJOR_VERSION;
   7.112 -    req->clientMinor = PANORAMIX_MINOR_VERSION;
   7.113 -    if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
   7.114 -        UnlockDisplay(dpy);
   7.115 -        SyncHandle();
   7.116 -        return 0;
   7.117 -    }
   7.118 -    *major_versionp = rep.majorVersion;
   7.119 -    *minor_versionp = rep.minorVersion;
   7.120 -    UnlockDisplay(dpy);
   7.121 -    SyncHandle();
   7.122 -    return 1;
   7.123 -}
   7.124 -
   7.125 -SDL_NAME(XPanoramiXInfo) * SDL_NAME(XPanoramiXAllocInfo) (void)
   7.126 -{
   7.127 -    return (SDL_NAME(XPanoramiXInfo) *)
   7.128 -        Xmalloc(sizeof(SDL_NAME(XPanoramiXInfo)));
   7.129 -}
   7.130 -
   7.131 -Status SDL_NAME(XPanoramiXGetState) (Display * dpy,
   7.132 -                                     Drawable drawable,
   7.133 -                                     SDL_NAME(XPanoramiXInfo) *
   7.134 -                                     panoramiX_info)
   7.135 -{
   7.136 -    XExtDisplayInfo *info = find_display(dpy);
   7.137 -    xPanoramiXGetStateReply rep;
   7.138 -    register xPanoramiXGetStateReq *req;
   7.139 -
   7.140 -    PanoramiXCheckExtension(dpy, info, 0);
   7.141 -
   7.142 -    LockDisplay(dpy);
   7.143 -    GetReq(PanoramiXGetState, req);
   7.144 -    req->reqType = info->codes->major_opcode;
   7.145 -    req->panoramiXReqType = X_PanoramiXGetState;
   7.146 -    req->window = drawable;
   7.147 -    if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
   7.148 -        UnlockDisplay(dpy);
   7.149 -        SyncHandle();
   7.150 -        return 0;
   7.151 -    }
   7.152 -    UnlockDisplay(dpy);
   7.153 -    SyncHandle();
   7.154 -    panoramiX_info->window = rep.window;
   7.155 -    panoramiX_info->State = rep.state;
   7.156 -    return 1;
   7.157 -}
   7.158 -
   7.159 -Status SDL_NAME(XPanoramiXGetScreenCount) (Display * dpy,
   7.160 -                                           Drawable drawable,
   7.161 -                                           SDL_NAME(XPanoramiXInfo) *
   7.162 -                                           panoramiX_info)
   7.163 -{
   7.164 -    XExtDisplayInfo *info = find_display(dpy);
   7.165 -    xPanoramiXGetScreenCountReply rep;
   7.166 -    register xPanoramiXGetScreenCountReq *req;
   7.167 -
   7.168 -    PanoramiXCheckExtension(dpy, info, 0);
   7.169 -
   7.170 -    LockDisplay(dpy);
   7.171 -    GetReq(PanoramiXGetScreenCount, req);
   7.172 -    req->reqType = info->codes->major_opcode;
   7.173 -    req->panoramiXReqType = X_PanoramiXGetScreenCount;
   7.174 -    req->window = drawable;
   7.175 -    if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
   7.176 -        UnlockDisplay(dpy);
   7.177 -        SyncHandle();
   7.178 -        return 0;
   7.179 -    }
   7.180 -    UnlockDisplay(dpy);
   7.181 -    SyncHandle();
   7.182 -    panoramiX_info->window = rep.window;
   7.183 -    panoramiX_info->ScreenCount = rep.ScreenCount;
   7.184 -    return 1;
   7.185 -}
   7.186 -
   7.187 -Status SDL_NAME(XPanoramiXGetScreenSize) (Display * dpy,
   7.188 -                                          Drawable drawable,
   7.189 -                                          int screen_num,
   7.190 -                                          SDL_NAME(XPanoramiXInfo) *
   7.191 -                                          panoramiX_info)
   7.192 -{
   7.193 -    XExtDisplayInfo *info = find_display(dpy);
   7.194 -    xPanoramiXGetScreenSizeReply rep;
   7.195 -    register xPanoramiXGetScreenSizeReq *req;
   7.196 -
   7.197 -    PanoramiXCheckExtension(dpy, info, 0);
   7.198 -
   7.199 -    LockDisplay(dpy);
   7.200 -    GetReq(PanoramiXGetScreenSize, req);
   7.201 -    req->reqType = info->codes->major_opcode;
   7.202 -    req->panoramiXReqType = X_PanoramiXGetScreenSize;
   7.203 -    req->window = drawable;
   7.204 -    req->screen = screen_num;   /* need to define */
   7.205 -    if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
   7.206 -        UnlockDisplay(dpy);
   7.207 -        SyncHandle();
   7.208 -        return 0;
   7.209 -    }
   7.210 -    UnlockDisplay(dpy);
   7.211 -    SyncHandle();
   7.212 -    panoramiX_info->window = rep.window;
   7.213 -    panoramiX_info->screen = rep.screen;
   7.214 -    panoramiX_info->width = rep.width;
   7.215 -    panoramiX_info->height = rep.height;
   7.216 -    return 1;
   7.217 -}
   7.218 -
   7.219 -/*******************************************************************\
   7.220 -  Alternate interface to make up for shortcomings in the original,
   7.221 -  namely, the omission of the screen origin.  The new interface is
   7.222 -  in the "Xinerama" namespace instead of "PanoramiX".
   7.223 -\*******************************************************************/
   7.224 -
   7.225 -Bool SDL_NAME(XineramaQueryExtension) (Display * dpy,
   7.226 -                                       int *event_base, int *error_base)
   7.227 -{
   7.228 -    return SDL_NAME(XPanoramiXQueryExtension) (dpy, event_base, error_base);
   7.229 -}
   7.230 -
   7.231 -Status SDL_NAME(XineramaQueryVersion) (Display * dpy, int *major, int *minor)
   7.232 -{
   7.233 -    return SDL_NAME(XPanoramiXQueryVersion) (dpy, major, minor);
   7.234 -}
   7.235 -
   7.236 -Bool SDL_NAME(XineramaIsActive) (Display * dpy)
   7.237 -{
   7.238 -    xXineramaIsActiveReply rep;
   7.239 -    xXineramaIsActiveReq *req;
   7.240 -    XExtDisplayInfo *info = find_display(dpy);
   7.241 -
   7.242 -    if (!XextHasExtension(info))
   7.243 -        return False;           /* server doesn't even have the extension */
   7.244 -
   7.245 -    LockDisplay(dpy);
   7.246 -    GetReq(XineramaIsActive, req);
   7.247 -    req->reqType = info->codes->major_opcode;
   7.248 -    req->panoramiXReqType = X_XineramaIsActive;
   7.249 -    if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
   7.250 -        UnlockDisplay(dpy);
   7.251 -        SyncHandle();
   7.252 -        return False;
   7.253 -    }
   7.254 -    UnlockDisplay(dpy);
   7.255 -    SyncHandle();
   7.256 -    return rep.state;
   7.257 -}
   7.258 -
   7.259 -#include <stdio.h>
   7.260 -
   7.261 -SDL_NAME(XineramaScreenInfo) *
   7.262 -SDL_NAME(XineramaQueryScreens) (Display * dpy, int *number)
   7.263 -{
   7.264 -    XExtDisplayInfo *info = find_display(dpy);
   7.265 -    xXineramaQueryScreensReply rep;
   7.266 -    xXineramaQueryScreensReq *req;
   7.267 -    SDL_NAME(XineramaScreenInfo) * scrnInfo = NULL;
   7.268 -
   7.269 -    PanoramiXCheckExtension(dpy, info, 0);
   7.270 -
   7.271 -    LockDisplay(dpy);
   7.272 -    GetReq(XineramaQueryScreens, req);
   7.273 -    req->reqType = info->codes->major_opcode;
   7.274 -    req->panoramiXReqType = X_XineramaQueryScreens;
   7.275 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
   7.276 -        UnlockDisplay(dpy);
   7.277 -        SyncHandle();
   7.278 -        return NULL;
   7.279 -    }
   7.280 -
   7.281 -    if (rep.number) {
   7.282 -        if ((scrnInfo =
   7.283 -             Xmalloc(sizeof(SDL_NAME(XineramaScreenInfo)) * rep.number))) {
   7.284 -            xXineramaScreenInfo scratch;
   7.285 -            int i;
   7.286 -
   7.287 -            for (i = 0; i < rep.number; i++) {
   7.288 -                _XRead(dpy, (char *) (&scratch), sz_XineramaScreenInfo);
   7.289 -                scrnInfo[i].screen_number = i;
   7.290 -                scrnInfo[i].x_org = scratch.x_org;
   7.291 -                scrnInfo[i].y_org = scratch.y_org;
   7.292 -                scrnInfo[i].width = scratch.width;
   7.293 -                scrnInfo[i].height = scratch.height;
   7.294 -            }
   7.295 -
   7.296 -            *number = rep.number;
   7.297 -        } else
   7.298 -            _XEatData(dpy, rep.length << 2);
   7.299 -    }
   7.300 -
   7.301 -    UnlockDisplay(dpy);
   7.302 -    SyncHandle();
   7.303 -    return scrnInfo;
   7.304 -}
   7.305 -
   7.306 -/* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/video/Xext/Xv/Xv.c	Sun Feb 27 22:22:58 2011 -0800
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,1097 +0,0 @@
     8.4 -/***********************************************************
     8.5 -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
     8.6 -and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
     8.7 -
     8.8 -                        All Rights Reserved
     8.9 -
    8.10 -Permission to use, copy, modify, and distribute this software and its 
    8.11 -documentation for any purpose and without fee is hereby granted, 
    8.12 -provided that the above copyright notice appear in all copies and that
    8.13 -both that copyright notice and this permission notice appear in 
    8.14 -supporting documentation, and that the names of Digital or MIT not be
    8.15 -used in advertising or publicity pertaining to distribution of the
    8.16 -software without specific, written prior permission.  
    8.17 -
    8.18 -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
    8.19 -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
    8.20 -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
    8.21 -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    8.22 -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
    8.23 -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    8.24 -SOFTWARE.
    8.25 -
    8.26 -******************************************************************/
    8.27 -/* $XFree86: xc/lib/Xv/Xv.c,v 1.15 2001/05/11 08:23:22 alanh Exp $ */
    8.28 -/*
    8.29 -** File: 
    8.30 -**
    8.31 -**   Xv.c --- Xv library extension module.
    8.32 -**
    8.33 -** Author: 
    8.34 -**
    8.35 -**   David Carver (Digital Workstation Engineering/Project Athena)
    8.36 -**
    8.37 -** Revisions:
    8.38 -**
    8.39 -**   26.06.91 Carver
    8.40 -**     - changed XvFreeAdaptors to XvFreeAdaptorInfo
    8.41 -**     - changed XvFreeEncodings to XvFreeEncodingInfo
    8.42 -**
    8.43 -**   11.06.91 Carver
    8.44 -**     - changed SetPortControl to SetPortAttribute
    8.45 -**     - changed GetPortControl to GetPortAttribute
    8.46 -**     - changed QueryBestSize
    8.47 -**
    8.48 -**   15.05.91 Carver
    8.49 -**     - version 2.0 upgrade
    8.50 -**
    8.51 -**   240.01.91 Carver
    8.52 -**     - version 1.4 upgrade
    8.53 -**
    8.54 -*/
    8.55 -
    8.56 -#include <stdio.h>
    8.57 -#include "Xvlibint.h"
    8.58 -#include "../extensions/Xext.h"
    8.59 -#include <X11/extensions/XShm.h>
    8.60 -#include "../extensions/extutil.h"
    8.61 -
    8.62 -static XExtensionInfo _xv_info_data;
    8.63 -static XExtensionInfo *xv_info = &_xv_info_data;
    8.64 -static char *xv_extension_name = XvName;
    8.65 -
    8.66 -#define XvCheckExtension(dpy, i, val) \
    8.67 -  XextCheckExtension(dpy, i, xv_extension_name, val)
    8.68 -
    8.69 -static char *xv_error_string();
    8.70 -static int xv_close_display();
    8.71 -static Bool xv_wire_to_event();
    8.72 -
    8.73 -static XExtensionHooks xv_extension_hooks = {
    8.74 -    NULL,                       /* create_gc */
    8.75 -    NULL,                       /* copy_gc */
    8.76 -    NULL,                       /* flush_gc */
    8.77 -    NULL,                       /* free_gc */
    8.78 -    NULL,                       /* create_font */
    8.79 -    NULL,                       /* free_font */
    8.80 -    xv_close_display,           /* close_display */
    8.81 -    xv_wire_to_event,           /* wire_to_event */
    8.82 -    NULL,                       /* event_to_wire */
    8.83 -    NULL,                       /* error */
    8.84 -    xv_error_string             /* error_string */
    8.85 -};
    8.86 -
    8.87 -
    8.88 -static char *xv_error_list[] = {
    8.89 -    "BadPort",                  /* XvBadPort     */
    8.90 -    "BadEncoding",              /* XvBadEncoding */
    8.91 -    "BadControl"                /* XvBadControl  */
    8.92 -};
    8.93 -
    8.94 -static
    8.95 -XEXT_GENERATE_CLOSE_DISPLAY(xv_close_display, xv_info)
    8.96 -     static XEXT_GENERATE_FIND_DISPLAY(xv_find_display, xv_info,
    8.97 -                                       xv_extension_name,
    8.98 -                                       &xv_extension_hooks, XvNumEvents, NULL)
    8.99 -     static XEXT_GENERATE_ERROR_STRING(xv_error_string, xv_extension_name,
   8.100 -                                       XvNumErrors, xv_error_list)
   8.101 -     int SDL_NAME(XvQueryExtension) (Display * dpy,
   8.102 -                                     unsigned int *p_version,
   8.103 -                                     unsigned int *p_revision,
   8.104 -                                     unsigned int *p_requestBase,
   8.105 -                                     unsigned int *p_eventBase,
   8.106 -                                     unsigned int *p_errorBase)
   8.107 -{
   8.108 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.109 -    xvQueryExtensionReq *req;
   8.110 -    xvQueryExtensionReply rep;
   8.111 -
   8.112 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.113 -
   8.114 -    LockDisplay(dpy);
   8.115 -
   8.116 -    XvGetReq(QueryExtension, req);
   8.117 -
   8.118 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
   8.119 -        UnlockDisplay(dpy);
   8.120 -        SyncHandle();
   8.121 -        return XvBadExtension;
   8.122 -    }
   8.123 -
   8.124 -    *p_version = rep.version;
   8.125 -    *p_revision = rep.revision;
   8.126 -    *p_requestBase = info->codes->major_opcode;
   8.127 -    *p_eventBase = info->codes->first_event;
   8.128 -    *p_errorBase = info->codes->first_error;
   8.129 -
   8.130 -    UnlockDisplay(dpy);
   8.131 -    SyncHandle();
   8.132 -
   8.133 -    return Success;
   8.134 -}
   8.135 -
   8.136 -int
   8.137 -SDL_NAME(XvQueryAdaptors) (Display * dpy,
   8.138 -                           Window window,
   8.139 -                           unsigned int *p_nAdaptors,
   8.140 -                           SDL_NAME(XvAdaptorInfo) ** p_pAdaptors)
   8.141 -{
   8.142 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.143 -    xvQueryAdaptorsReq *req;
   8.144 -    xvQueryAdaptorsReply rep;
   8.145 -    int size, ii, jj;
   8.146 -    char *name;
   8.147 -    SDL_NAME(XvAdaptorInfo) * pas, *pa;
   8.148 -    SDL_NAME(XvFormat) * pfs, *pf;
   8.149 -    char *buffer;
   8.150 -    union
   8.151 -    {
   8.152 -        char *buffer;
   8.153 -        char *string;
   8.154 -        xvAdaptorInfo *pa;
   8.155 -        xvFormat *pf;
   8.156 -    } u;
   8.157 -
   8.158 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.159 -
   8.160 -    LockDisplay(dpy);
   8.161 -
   8.162 -    XvGetReq(QueryAdaptors, req);
   8.163 -    req->window = window;
   8.164 -
   8.165 -    /* READ THE REPLY */
   8.166 -
   8.167 -    if (_XReply(dpy, (xReply *) & rep, 0, xFalse) == 0) {
   8.168 -        UnlockDisplay(dpy);
   8.169 -        SyncHandle();
   8.170 -        return (XvBadReply);
   8.171 -    }
   8.172 -
   8.173 -    size = rep.length << 2;
   8.174 -    if ((buffer = (char *) Xmalloc((unsigned) size)) == NULL) {
   8.175 -        UnlockDisplay(dpy);
   8.176 -        SyncHandle();
   8.177 -        return (XvBadAlloc);
   8.178 -    }
   8.179 -    _XRead(dpy, buffer, size);
   8.180 -
   8.181 -    u.buffer = buffer;
   8.182 -
   8.183 -    /* GET INPUT ADAPTORS */
   8.184 -
   8.185 -    if (rep.num_adaptors == 0) {
   8.186 -        pas = NULL;
   8.187 -    } else {
   8.188 -        size = rep.num_adaptors * sizeof(SDL_NAME(XvAdaptorInfo));
   8.189 -        if ((pas = (SDL_NAME(XvAdaptorInfo) *) Xmalloc(size)) == NULL) {
   8.190 -            Xfree(buffer);
   8.191 -            UnlockDisplay(dpy);
   8.192 -            SyncHandle();
   8.193 -            return (XvBadAlloc);
   8.194 -        }
   8.195 -    }
   8.196 -
   8.197 -    /* INIT ADAPTOR FIELDS */
   8.198 -
   8.199 -    pa = pas;
   8.200 -    for (ii = 0; ii < rep.num_adaptors; ii++) {
   8.201 -        pa->num_adaptors = 0;
   8.202 -        pa->name = (char *) NULL;
   8.203 -        pa->formats = (SDL_NAME(XvFormat) *) NULL;
   8.204 -        pa++;
   8.205 -    }
   8.206 -
   8.207 -    pa = pas;
   8.208 -    for (ii = 0; ii < rep.num_adaptors; ii++) {
   8.209 -        pa->type = u.pa->type;
   8.210 -        pa->base_id = u.pa->base_id;
   8.211 -        pa->num_ports = u.pa->num_ports;
   8.212 -        pa->num_formats = u.pa->num_formats;
   8.213 -        pa->num_adaptors = rep.num_adaptors - ii;
   8.214 -
   8.215 -        /* GET ADAPTOR NAME */
   8.216 -
   8.217 -        size = u.pa->name_size;
   8.218 -        u.buffer += (sz_xvAdaptorInfo + 3) & ~3;
   8.219 -
   8.220 -        if ((name = (char *) Xmalloc(size + 1)) == NULL) {
   8.221 -            SDL_NAME(XvFreeAdaptorInfo) (pas);
   8.222 -            Xfree(buffer);
   8.223 -            UnlockDisplay(dpy);
   8.224 -            SyncHandle();
   8.225 -            return (XvBadAlloc);
   8.226 -        }
   8.227 -        SDL_strlcpy(name, u.string, size);
   8.228 -        pa->name = name;
   8.229 -
   8.230 -        u.buffer += (size + 3) & ~3;
   8.231 -
   8.232 -        /* GET FORMATS */
   8.233 -
   8.234 -        size = pa->num_formats * sizeof(SDL_NAME(XvFormat));
   8.235 -        if ((pfs = (SDL_NAME(XvFormat) *) Xmalloc(size)) == NULL) {
   8.236 -            SDL_NAME(XvFreeAdaptorInfo) (pas);
   8.237 -            Xfree(buffer);
   8.238 -            UnlockDisplay(dpy);
   8.239 -            SyncHandle();
   8.240 -            return (XvBadAlloc);
   8.241 -        }
   8.242 -
   8.243 -        pf = pfs;
   8.244 -        for (jj = 0; jj < pa->num_formats; jj++) {
   8.245 -            pf->depth = u.pf->depth;
   8.246 -            pf->visual_id = u.pf->visual;
   8.247 -            pf++;
   8.248 -
   8.249 -            u.buffer += (sz_xvFormat + 3) & ~3;
   8.250 -        }
   8.251 -
   8.252 -        pa->formats = pfs;
   8.253 -
   8.254 -        pa++;
   8.255 -
   8.256 -    }
   8.257 -
   8.258 -    *p_nAdaptors = rep.num_adaptors;
   8.259 -    *p_pAdaptors = pas;
   8.260 -
   8.261 -    Xfree(buffer);
   8.262 -    UnlockDisplay(dpy);
   8.263 -    SyncHandle();
   8.264 -
   8.265 -    return (Success);
   8.266 -}
   8.267 -
   8.268 -
   8.269 -void SDL_NAME(XvFreeAdaptorInfo) (SDL_NAME(XvAdaptorInfo) * pAdaptors)
   8.270 -{
   8.271 -
   8.272 -    SDL_NAME(XvAdaptorInfo) * pa;
   8.273 -    int ii;
   8.274 -
   8.275 -    if (!pAdaptors)
   8.276 -        return;
   8.277 -
   8.278 -    pa = pAdaptors;
   8.279 -
   8.280 -    for (ii = 0; ii < pAdaptors->num_adaptors; ii++, pa++) {
   8.281 -        if (pa->name) {
   8.282 -            Xfree(pa->name);
   8.283 -        }
   8.284 -        if (pa->formats) {
   8.285 -            Xfree(pa->formats);
   8.286 -        }
   8.287 -    }
   8.288 -
   8.289 -    Xfree(pAdaptors);
   8.290 -}
   8.291 -
   8.292 -int
   8.293 -SDL_NAME(XvQueryEncodings) (Display * dpy,
   8.294 -                            XvPortID port,
   8.295 -                            unsigned int *p_nEncodings,
   8.296 -                            SDL_NAME(XvEncodingInfo) ** p_pEncodings)
   8.297 -{
   8.298 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.299 -    xvQueryEncodingsReq *req;
   8.300 -    xvQueryEncodingsReply rep;
   8.301 -    int size, jj;
   8.302 -    char *name;
   8.303 -    SDL_NAME(XvEncodingInfo) * pes, *pe;
   8.304 -    char *buffer;
   8.305 -    union
   8.306 -    {
   8.307 -        char *buffer;
   8.308 -        char *string;
   8.309 -        xvEncodingInfo *pe;
   8.310 -    } u;
   8.311 -
   8.312 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.313 -
   8.314 -    LockDisplay(dpy);
   8.315 -
   8.316 -    XvGetReq(QueryEncodings, req);
   8.317 -    req->port = port;
   8.318 -
   8.319 -    /* READ THE REPLY */
   8.320 -
   8.321 -    if (_XReply(dpy, (xReply *) & rep, 0, xFalse) == 0) {
   8.322 -        UnlockDisplay(dpy);
   8.323 -        SyncHandle();
   8.324 -        return (XvBadReply);
   8.325 -    }
   8.326 -
   8.327 -    size = rep.length << 2;
   8.328 -    if ((buffer = (char *) Xmalloc((unsigned) size)) == NULL) {
   8.329 -        UnlockDisplay(dpy);
   8.330 -        SyncHandle();
   8.331 -        return (XvBadAlloc);
   8.332 -    }
   8.333 -    _XRead(dpy, buffer, size);
   8.334 -
   8.335 -    u.buffer = buffer;
   8.336 -
   8.337 -    /* GET ENCODINGS */
   8.338 -
   8.339 -    size = rep.num_encodings * sizeof(SDL_NAME(XvEncodingInfo));
   8.340 -    if ((pes = (SDL_NAME(XvEncodingInfo) *) Xmalloc(size)) == NULL) {
   8.341 -        Xfree(buffer);
   8.342 -        UnlockDisplay(dpy);
   8.343 -        SyncHandle();
   8.344 -        return (XvBadAlloc);
   8.345 -    }
   8.346 -
   8.347 -    /* INITIALIZE THE ENCODING POINTER */
   8.348 -
   8.349 -    pe = pes;
   8.350 -    for (jj = 0; jj < rep.num_encodings; jj++) {
   8.351 -        pe->name = (char *) NULL;
   8.352 -        pe->num_encodings = 0;
   8.353 -        pe++;
   8.354 -    }
   8.355 -
   8.356 -    pe = pes;
   8.357 -    for (jj = 0; jj < rep.num_encodings; jj++) {
   8.358 -        pe->encoding_id = u.pe->encoding;
   8.359 -        pe->width = u.pe->width;
   8.360 -        pe->height = u.pe->height;
   8.361 -        pe->rate.numerator = u.pe->rate.numerator;
   8.362 -        pe->rate.denominator = u.pe->rate.denominator;
   8.363 -        pe->num_encodings = rep.num_encodings - jj;
   8.364 -
   8.365 -        size = u.pe->name_size;
   8.366 -        u.buffer += (sz_xvEncodingInfo + 3) & ~3;
   8.367 -
   8.368 -        if ((name = (char *) Xmalloc(size + 1)) == NULL) {
   8.369 -            Xfree(buffer);
   8.370 -            UnlockDisplay(dpy);
   8.371 -            SyncHandle();
   8.372 -            return (XvBadAlloc);
   8.373 -        }
   8.374 -        SDL_strlcpy(name, u.string, size);
   8.375 -        pe->name = name;
   8.376 -        pe++;
   8.377 -
   8.378 -        u.buffer += (size + 3) & ~3;
   8.379 -    }
   8.380 -
   8.381 -    *p_nEncodings = rep.num_encodings;
   8.382 -    *p_pEncodings = pes;
   8.383 -
   8.384 -    Xfree(buffer);
   8.385 -    UnlockDisplay(dpy);
   8.386 -    SyncHandle();
   8.387 -
   8.388 -    return (Success);
   8.389 -}
   8.390 -
   8.391 -void SDL_NAME(XvFreeEncodingInfo) (SDL_NAME(XvEncodingInfo) * pEncodings)
   8.392 -{
   8.393 -
   8.394 -    SDL_NAME(XvEncodingInfo) * pe;
   8.395 -    int ii;
   8.396 -
   8.397 -    if (!pEncodings)
   8.398 -        return;
   8.399 -
   8.400 -    pe = pEncodings;
   8.401 -
   8.402 -    for (ii = 0; ii < pEncodings->num_encodings; ii++, pe++) {
   8.403 -        if (pe->name)
   8.404 -            Xfree(pe->name);
   8.405 -    }
   8.406 -
   8.407 -    Xfree(pEncodings);
   8.408 -}
   8.409 -
   8.410 -int
   8.411 -SDL_NAME(XvPutVideo) (Display * dpy,
   8.412 -                      XvPortID port,
   8.413 -                      Drawable d,
   8.414 -                      GC gc,
   8.415 -                      int vx, int vy,
   8.416 -                      unsigned int vw, unsigned int vh,
   8.417 -                      int dx, int dy, unsigned int dw, unsigned int dh)
   8.418 -{
   8.419 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.420 -    xvPutVideoReq *req;
   8.421 -
   8.422 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.423 -
   8.424 -    LockDisplay(dpy);
   8.425 -
   8.426 -    FlushGC(dpy, gc);
   8.427 -
   8.428 -    XvGetReq(PutVideo, req);
   8.429 -
   8.430 -    req->port = port;
   8.431 -    req->drawable = d;
   8.432 -    req->gc = gc->gid;
   8.433 -    req->vid_x = vx;
   8.434 -    req->vid_y = vy;
   8.435 -    req->vid_w = vw;
   8.436 -    req->vid_h = vh;
   8.437 -    req->drw_x = dx;
   8.438 -    req->drw_y = dy;
   8.439 -    req->drw_w = dw;
   8.440 -    req->drw_h = dh;
   8.441 -
   8.442 -    UnlockDisplay(dpy);
   8.443 -    SyncHandle();
   8.444 -
   8.445 -    return Success;
   8.446 -}
   8.447 -
   8.448 -int
   8.449 -SDL_NAME(XvPutStill) (Display * dpy,
   8.450 -                      XvPortID port,
   8.451 -                      Drawable d,
   8.452 -                      GC gc,
   8.453 -                      int vx, int vy,
   8.454 -                      unsigned int vw, unsigned int vh,
   8.455 -                      int dx, int dy, unsigned int dw, unsigned int dh)
   8.456 -{
   8.457 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.458 -    xvPutStillReq *req;
   8.459 -
   8.460 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.461 -
   8.462 -    LockDisplay(dpy);
   8.463 -
   8.464 -    FlushGC(dpy, gc);
   8.465 -
   8.466 -    XvGetReq(PutStill, req);
   8.467 -    req->port = port;
   8.468 -    req->drawable = d;
   8.469 -    req->gc = gc->gid;
   8.470 -    req->vid_x = vx;
   8.471 -    req->vid_y = vy;
   8.472 -    req->vid_w = vw;
   8.473 -    req->vid_h = vh;
   8.474 -    req->drw_x = dx;
   8.475 -    req->drw_y = dy;
   8.476 -    req->drw_w = dw;
   8.477 -    req->drw_h = dh;
   8.478 -
   8.479 -    UnlockDisplay(dpy);
   8.480 -    SyncHandle();
   8.481 -
   8.482 -    return Success;
   8.483 -}
   8.484 -
   8.485 -int
   8.486 -SDL_NAME(XvGetVideo) (Display * dpy,
   8.487 -                      XvPortID port,
   8.488 -                      Drawable d,
   8.489 -                      GC gc,
   8.490 -                      int vx, int vy,
   8.491 -                      unsigned int vw, unsigned int vh,
   8.492 -                      int dx, int dy, unsigned int dw, unsigned int dh)
   8.493 -{
   8.494 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.495 -    xvGetVideoReq *req;
   8.496 -
   8.497 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.498 -
   8.499 -    LockDisplay(dpy);
   8.500 -
   8.501 -    FlushGC(dpy, gc);
   8.502 -
   8.503 -    XvGetReq(GetVideo, req);
   8.504 -    req->port = port;
   8.505 -    req->drawable = d;
   8.506 -    req->gc = gc->gid;
   8.507 -    req->vid_x = vx;
   8.508 -    req->vid_y = vy;
   8.509 -    req->vid_w = vw;
   8.510 -    req->vid_h = vh;
   8.511 -    req->drw_x = dx;
   8.512 -    req->drw_y = dy;
   8.513 -    req->drw_w = dw;
   8.514 -    req->drw_h = dh;
   8.515 -
   8.516 -    UnlockDisplay(dpy);
   8.517 -    SyncHandle();
   8.518 -
   8.519 -    return Success;
   8.520 -}
   8.521 -
   8.522 -int
   8.523 -SDL_NAME(XvGetStill) (Display * dpy,
   8.524 -                      XvPortID port,
   8.525 -                      Drawable d,
   8.526 -                      GC gc,
   8.527 -                      int vx, int vy,
   8.528 -                      unsigned int vw, unsigned int vh,
   8.529 -                      int dx, int dy, unsigned int dw, unsigned int dh)
   8.530 -{
   8.531 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.532 -    xvGetStillReq *req;
   8.533 -
   8.534 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.535 -
   8.536 -    LockDisplay(dpy);
   8.537 -
   8.538 -    FlushGC(dpy, gc);
   8.539 -
   8.540 -    XvGetReq(GetStill, req);
   8.541 -    req->port = port;
   8.542 -    req->drawable = d;
   8.543 -    req->gc = gc->gid;
   8.544 -    req->vid_x = vx;
   8.545 -    req->vid_y = vy;
   8.546 -    req->vid_w = vw;
   8.547 -    req->vid_h = vh;
   8.548 -    req->drw_x = dx;
   8.549 -    req->drw_y = dy;
   8.550 -    req->drw_w = dw;
   8.551 -    req->drw_h = dh;
   8.552 -
   8.553 -    UnlockDisplay(dpy);
   8.554 -    SyncHandle();
   8.555 -
   8.556 -    return Success;
   8.557 -}
   8.558 -
   8.559 -int SDL_NAME(XvStopVideo) (Display * dpy, XvPortID port, Drawable draw)
   8.560 -{
   8.561 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.562 -    xvStopVideoReq *req;
   8.563 -
   8.564 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.565 -
   8.566 -    LockDisplay(dpy);
   8.567 -
   8.568 -    XvGetReq(StopVideo, req);
   8.569 -    req->port = port;
   8.570 -    req->drawable = draw;
   8.571 -
   8.572 -    UnlockDisplay(dpy);
   8.573 -    SyncHandle();
   8.574 -
   8.575 -    return Success;
   8.576 -}
   8.577 -
   8.578 -int SDL_NAME(XvGrabPort) (Display * dpy, XvPortID port, Time time)
   8.579 -{
   8.580 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.581 -    int result;
   8.582 -    xvGrabPortReply rep;
   8.583 -    xvGrabPortReq *req;
   8.584 -
   8.585 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.586 -
   8.587 -    LockDisplay(dpy);
   8.588 -
   8.589 -    XvGetReq(GrabPort, req);
   8.590 -    req->port = port;
   8.591 -    req->time = time;
   8.592 -
   8.593 -    if (_XReply(dpy, (xReply *) & rep, 0, xTrue) == 0)
   8.594 -        rep.result = GrabSuccess;
   8.595 -
   8.596 -    result = rep.result;
   8.597 -
   8.598 -    UnlockDisplay(dpy);
   8.599 -    SyncHandle();
   8.600 -
   8.601 -    return result;
   8.602 -}
   8.603 -
   8.604 -int SDL_NAME(XvUngrabPort) (Display * dpy, XvPortID port, Time time)
   8.605 -{
   8.606 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.607 -    xvUngrabPortReq *req;
   8.608 -
   8.609 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.610 -
   8.611 -    LockDisplay(dpy);
   8.612 -
   8.613 -    XvGetReq(UngrabPort, req);
   8.614 -    req->port = port;
   8.615 -    req->time = time;
   8.616 -
   8.617 -    UnlockDisplay(dpy);
   8.618 -    SyncHandle();
   8.619 -
   8.620 -    return Success;
   8.621 -}
   8.622 -
   8.623 -int
   8.624 -SDL_NAME(XvSelectVideoNotify) (Display * dpy, Drawable drawable, Bool onoff)
   8.625 -{
   8.626 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.627 -    xvSelectVideoNotifyReq *req;
   8.628 -
   8.629 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.630 -
   8.631 -    LockDisplay(dpy);
   8.632 -
   8.633 -    XvGetReq(SelectVideoNotify, req);
   8.634 -    req->drawable = drawable;
   8.635 -    req->onoff = onoff;
   8.636 -
   8.637 -    UnlockDisplay(dpy);
   8.638 -    SyncHandle();
   8.639 -
   8.640 -    return Success;
   8.641 -}
   8.642 -
   8.643 -int SDL_NAME(XvSelectPortNotify) (Display * dpy, XvPortID port, Bool onoff)
   8.644 -{
   8.645 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.646 -    xvSelectPortNotifyReq *req;
   8.647 -
   8.648 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.649 -
   8.650 -    LockDisplay(dpy);
   8.651 -
   8.652 -    XvGetReq(SelectPortNotify, req);
   8.653 -    req->port = port;
   8.654 -    req->onoff = onoff;
   8.655 -
   8.656 -    UnlockDisplay(dpy);
   8.657 -    SyncHandle();
   8.658 -
   8.659 -    return Success;
   8.660 -}
   8.661 -
   8.662 -int
   8.663 -SDL_NAME(XvSetPortAttribute) (Display * dpy,
   8.664 -                              XvPortID port, Atom attribute, int value)
   8.665 -{
   8.666 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.667 -    xvSetPortAttributeReq *req;
   8.668 -
   8.669 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.670 -
   8.671 -    LockDisplay(dpy);
   8.672 -
   8.673 -    XvGetReq(SetPortAttribute, req);
   8.674 -    req->port = port;
   8.675 -    req->attribute = attribute;
   8.676 -    req->value = value;
   8.677 -
   8.678 -    UnlockDisplay(dpy);
   8.679 -    SyncHandle();
   8.680 -
   8.681 -    return (Success);
   8.682 -}
   8.683 -
   8.684 -int
   8.685 -SDL_NAME(XvGetPortAttribute) (Display * dpy,
   8.686 -                              XvPortID port, Atom attribute, int *p_value)
   8.687 -{
   8.688 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.689 -    xvGetPortAttributeReq *req;
   8.690 -    xvGetPortAttributeReply rep;
   8.691 -
   8.692 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.693 -
   8.694 -    LockDisplay(dpy);
   8.695 -
   8.696 -    XvGetReq(GetPortAttribute, req);
   8.697 -    req->port = port;
   8.698 -    req->attribute = attribute;
   8.699 -
   8.700 -    /* READ THE REPLY */
   8.701 -
   8.702 -    if (_XReply(dpy, (xReply *) & rep, 0, xFalse) == 0) {
   8.703 -        UnlockDisplay(dpy);
   8.704 -        SyncHandle();
   8.705 -        return (XvBadReply);
   8.706 -    }
   8.707 -
   8.708 -    *p_value = rep.value;
   8.709 -
   8.710 -    UnlockDisplay(dpy);
   8.711 -    SyncHandle();
   8.712 -
   8.713 -    return (Success);
   8.714 -}
   8.715 -
   8.716 -int
   8.717 -SDL_NAME(XvQueryBestSize) (Display * dpy,
   8.718 -                           XvPortID port,
   8.719 -                           Bool motion,
   8.720 -                           unsigned int vid_w,
   8.721 -                           unsigned int vid_h,
   8.722 -                           unsigned int drw_w,
   8.723 -                           unsigned int drw_h,
   8.724 -                           unsigned int *p_actual_width,
   8.725 -                           unsigned int *p_actual_height)
   8.726 -{
   8.727 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.728 -    xvQueryBestSizeReq *req;
   8.729 -    xvQueryBestSizeReply rep;
   8.730 -
   8.731 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.732 -
   8.733 -    LockDisplay(dpy);
   8.734 -
   8.735 -    XvGetReq(QueryBestSize, req);
   8.736 -    req->port = port;
   8.737 -    req->motion = motion;
   8.738 -    req->vid_w = vid_w;
   8.739 -    req->vid_h = vid_h;
   8.740 -    req->drw_w = drw_w;
   8.741 -    req->drw_h = drw_h;
   8.742 -
   8.743 -    /* READ THE REPLY */
   8.744 -
   8.745 -    if (_XReply(dpy, (xReply *) & rep, 0, xFalse) == 0) {
   8.746 -        UnlockDisplay(dpy);
   8.747 -        SyncHandle();
   8.748 -        return (XvBadReply);
   8.749 -    }
   8.750 -
   8.751 -    *p_actual_width = rep.actual_width;
   8.752 -    *p_actual_height = rep.actual_height;
   8.753 -
   8.754 -    UnlockDisplay(dpy);
   8.755 -    SyncHandle();
   8.756 -
   8.757 -    return (Success);
   8.758 -}
   8.759 -
   8.760 -
   8.761 -SDL_NAME(XvAttribute) *
   8.762 -SDL_NAME(XvQueryPortAttributes) (Display * dpy, XvPortID port, int *num)
   8.763 -{
   8.764 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.765 -    xvQueryPortAttributesReq *req;
   8.766 -    xvQueryPortAttributesReply rep;
   8.767 -    SDL_NAME(XvAttribute) * ret = NULL;
   8.768 -
   8.769 -    *num = 0;
   8.770 -
   8.771 -    XvCheckExtension(dpy, info, NULL);
   8.772 -
   8.773 -    LockDisplay(dpy);
   8.774 -
   8.775 -    XvGetReq(QueryPortAttributes, req);
   8.776 -    req->port = port;
   8.777 -
   8.778 -    /* READ THE REPLY */
   8.779 -
   8.780 -    if (_XReply(dpy, (xReply *) & rep, 0, xFalse) == 0) {
   8.781 -        UnlockDisplay(dpy);
   8.782 -        SyncHandle();
   8.783 -        return ret;
   8.784 -    }
   8.785 -
   8.786 -    if (rep.num_attributes) {
   8.787 -        int size =
   8.788 -            (rep.num_attributes * sizeof(SDL_NAME(XvAttribute))) +
   8.789 -            rep.text_size;
   8.790 -
   8.791 -        if ((ret = Xmalloc(size))) {
   8.792 -            char *marker = (char *) (&ret[rep.num_attributes]);
   8.793 -            xvAttributeInfo Info;
   8.794 -            int i;
   8.795 -
   8.796 -            for (i = 0; i < rep.num_attributes; i++) {
   8.797 -                _XRead(dpy, (char *) (&Info), sz_xvAttributeInfo);
   8.798 -                ret[i].flags = (int) Info.flags;
   8.799 -                ret[i].min_value = Info.min;
   8.800 -                ret[i].max_value = Info.max;
   8.801 -                ret[i].name = marker;
   8.802 -                _XRead(dpy, marker, Info.size);
   8.803 -                marker += Info.size;
   8.804 -                (*num)++;
   8.805 -            }
   8.806 -        } else
   8.807 -            _XEatData(dpy, rep.length << 2);
   8.808 -    }
   8.809 -
   8.810 -    UnlockDisplay(dpy);
   8.811 -    SyncHandle();
   8.812 -
   8.813 -    return ret;
   8.814 -}
   8.815 -
   8.816 -SDL_NAME(XvImageFormatValues) * SDL_NAME(XvListImageFormats) (Display * dpy,
   8.817 -                                                              XvPortID port,
   8.818 -                                                              int *num)
   8.819 -{
   8.820 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.821 -    xvListImageFormatsReq *req;
   8.822 -    xvListImageFormatsReply rep;
   8.823 -    SDL_NAME(XvImageFormatValues) * ret = NULL;
   8.824 -
   8.825 -    *num = 0;
   8.826 -
   8.827 -    XvCheckExtension(dpy, info, NULL);
   8.828 -
   8.829 -    LockDisplay(dpy);
   8.830 -
   8.831 -    XvGetReq(ListImageFormats, req);
   8.832 -    req->port = port;
   8.833 -
   8.834 -    /* READ THE REPLY */
   8.835 -
   8.836 -    if (_XReply(dpy, (xReply *) & rep, 0, xFalse) == 0) {
   8.837 -        UnlockDisplay(dpy);
   8.838 -        SyncHandle();
   8.839 -        return NULL;
   8.840 -    }
   8.841 -
   8.842 -    if (rep.num_formats) {
   8.843 -        int size = (rep.num_formats * sizeof(SDL_NAME(XvImageFormatValues)));
   8.844 -
   8.845 -        if ((ret = Xmalloc(size))) {
   8.846 -            xvImageFormatInfo Info;
   8.847 -            int i;
   8.848 -
   8.849 -            for (i = 0; i < rep.num_formats; i++) {
   8.850 -                _XRead(dpy, (char *) (&Info), sz_xvImageFormatInfo);
   8.851 -                ret[i].id = Info.id;
   8.852 -                ret[i].type = Info.type;
   8.853 -                ret[i].byte_order = Info.byte_order;
   8.854 -                memcpy(&(ret[i].guid[0]), &(Info.guid[0]), 16);
   8.855 -                ret[i].bits_per_pixel = Info.bpp;
   8.856 -                ret[i].format = Info.format;
   8.857 -                ret[i].num_planes = Info.num_planes;
   8.858 -                ret[i].depth = Info.depth;
   8.859 -                ret[i].red_mask = Info.red_mask;
   8.860 -                ret[i].green_mask = Info.green_mask;
   8.861 -                ret[i].blue_mask = Info.blue_mask;
   8.862 -                ret[i].y_sample_bits = Info.y_sample_bits;
   8.863 -                ret[i].u_sample_bits = Info.u_sample_bits;
   8.864 -                ret[i].v_sample_bits = Info.v_sample_bits;
   8.865 -                ret[i].horz_y_period = Info.horz_y_period;
   8.866 -                ret[i].horz_u_period = Info.horz_u_period;
   8.867 -                ret[i].horz_v_period = Info.horz_v_period;
   8.868 -                ret[i].vert_y_period = Info.vert_y_period;
   8.869 -                ret[i].vert_u_period = Info.vert_u_period;
   8.870 -                ret[i].vert_v_period = Info.vert_v_period;
   8.871 -                memcpy(&(ret[i].component_order[0]),
   8.872 -                       &(Info.comp_order[0]), 32);
   8.873 -                ret[i].scanline_order = Info.scanline_order;
   8.874 -                (*num)++;
   8.875 -            }
   8.876 -        } else
   8.877 -            _XEatData(dpy, rep.length << 2);
   8.878 -    }
   8.879 -
   8.880 -    UnlockDisplay(dpy);
   8.881 -    SyncHandle();
   8.882 -
   8.883 -    return ret;
   8.884 -}
   8.885 -
   8.886 -SDL_NAME(XvImage) * SDL_NAME(XvCreateImage) (Display * dpy,
   8.887 -                                             XvPortID port,
   8.888 -                                             int id,
   8.889 -                                             char *data,
   8.890 -                                             int width, int height)
   8.891 -{
   8.892 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.893 -    xvQueryImageAttributesReq *req;
   8.894 -    xvQueryImageAttributesReply rep;
   8.895 -    SDL_NAME(XvImage) * ret = NULL;
   8.896 -
   8.897 -    XvCheckExtension(dpy, info, NULL);
   8.898 -
   8.899 -    LockDisplay(dpy);
   8.900 -
   8.901 -    XvGetReq(QueryImageAttributes, req);
   8.902 -    req->id = id;
   8.903 -    req->port = port;
   8.904 -    req->width = width;
   8.905 -    req->height = height;
   8.906 -
   8.907 -    /* READ THE REPLY */
   8.908 -
   8.909 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
   8.910 -        UnlockDisplay(dpy);
   8.911 -        SyncHandle();
   8.912 -        return NULL;
   8.913 -    }
   8.914 -
   8.915 -    if ((ret =
   8.916 -         (SDL_NAME(XvImage) *) Xmalloc(sizeof(SDL_NAME(XvImage)) +
   8.917 -                                       (rep.num_planes << 3)))) {
   8.918 -        ret->id = id;
   8.919 -        ret->width = rep.width;
   8.920 -        ret->height = rep.height;
   8.921 -        ret->data_size = rep.data_size;
   8.922 -        ret->num_planes = rep.num_planes;
   8.923 -        ret->pitches = (int *) (&ret[1]);
   8.924 -        ret->offsets = ret->pitches + rep.num_planes;
   8.925 -        ret->data = data;
   8.926 -        ret->obdata = NULL;
   8.927 -        _XRead(dpy, (char *) (ret->pitches), rep.num_planes << 2);
   8.928 -        _XRead(dpy, (char *) (ret->offsets), rep.num_planes << 2);
   8.929 -    } else
   8.930 -        _XEatData(dpy, rep.length << 2);
   8.931 -
   8.932 -    UnlockDisplay(dpy);
   8.933 -    SyncHandle();
   8.934 -    return ret;
   8.935 -}
   8.936 -
   8.937 -SDL_NAME(XvImage) * SDL_NAME(XvShmCreateImage) (Display * dpy,
   8.938 -                                                XvPortID port,
   8.939 -                                                int id,
   8.940 -                                                char *data,
   8.941 -                                                int width,
   8.942 -                                                int height,
   8.943 -                                                XShmSegmentInfo * shminfo)
   8.944 -{
   8.945 -    SDL_NAME(XvImage) * ret;
   8.946 -
   8.947 -    ret = SDL_NAME(XvCreateImage) (dpy, port, id, data, width, height);
   8.948 -
   8.949 -    if (ret)
   8.950 -        ret->obdata = (XPointer) shminfo;
   8.951 -
   8.952 -    return ret;
   8.953 -}
   8.954 -
   8.955 -int SDL_NAME(XvPutImage) (Display * dpy,
   8.956 -                          XvPortID port,
   8.957 -                          Drawable d,
   8.958 -                          GC gc,
   8.959 -                          SDL_NAME(XvImage) * image,
   8.960 -                          int src_x,
   8.961 -                          int src_y,
   8.962 -                          unsigned int src_w,
   8.963 -                          unsigned int src_h,
   8.964 -                          int dest_x,
   8.965 -                          int dest_y,
   8.966 -                          unsigned int dest_w, unsigned int dest_h)
   8.967 -{
   8.968 -    XExtDisplayInfo *info = xv_find_display(dpy);
   8.969 -    xvPutImageReq *req;
   8.970 -    int len;
   8.971 -
   8.972 -    XvCheckExtension(dpy, info, XvBadExtension);
   8.973 -
   8.974 -    LockDisplay(dpy);
   8.975 -
   8.976 -    FlushGC(dpy, gc);
   8.977 -
   8.978 -    XvGetReq(PutImage, req);
   8.979 -
   8.980 -    req->port = port;
   8.981 -    req->drawable = d;
   8.982 -    req->gc = gc->gid;
   8.983 -    req->id = image->id;
   8.984 -    req->src_x = src_x;
   8.985 -    req->src_y = src_y;
   8.986 -    req->src_w = src_w;
   8.987 -    req->src_h = src_h;
   8.988 -    req->drw_x = dest_x;
   8.989 -    req->drw_y = dest_y;
   8.990 -    req->drw_w = dest_w;
   8.991 -    req->drw_h = dest_h;
   8.992 -    req->width = image->width;
   8.993 -    req->height = image->height;
   8.994 -
   8.995 -    len = (image->data_size + 3) >> 2;
   8.996 -    SetReqLen(req, len, len);
   8.997 -
   8.998 -    /* Yes it's kindof lame that we are sending the whole thing,
   8.999 -       but for video all of it may be needed even if displaying
  8.1000 -       only a subsection, and I don't want to go through the 
  8.1001 -       trouble of creating subregions to send */
  8.1002 -    Data(dpy, (char *) image->data, image->data_size);
  8.1003 -
  8.1004 -    UnlockDisplay(dpy);
  8.1005 -    SyncHandle();
  8.1006 -
  8.1007 -    return Success;
  8.1008 -}
  8.1009 -
  8.1010 -int SDL_NAME(XvShmPutImage) (Display * dpy,
  8.1011 -                             XvPortID port,
  8.1012 -                             Drawable d,
  8.1013 -                             GC gc,
  8.1014 -                             SDL_NAME(XvImage) * image,
  8.1015 -                             int src_x,
  8.1016 -                             int src_y,
  8.1017 -                             unsigned int src_w,
  8.1018 -                             unsigned int src_h,
  8.1019 -                             int dest_x,
  8.1020 -                             int dest_y,
  8.1021 -                             unsigned int dest_w,
  8.1022 -                             unsigned int dest_h, Bool send_event)
  8.1023 -{
  8.1024 -    XExtDisplayInfo *info = xv_find_display(dpy);
  8.1025 -    XShmSegmentInfo *shminfo = (XShmSegmentInfo *) image->obdata;
  8.1026 -    xvShmPutImageReq *req;
  8.1027 -
  8.1028 -    XvCheckExtension(dpy, info, XvBadExtension);
  8.1029 -
  8.1030 -    LockDisplay(dpy);
  8.1031 -
  8.1032 -    FlushGC(dpy, gc);
  8.1033 -
  8.1034 -    XvGetReq(ShmPutImage, req);
  8.1035 -
  8.1036 -    req->port = port;
  8.1037 -    req->drawable = d;
  8.1038 -    req->gc = gc->gid;
  8.1039 -    req->shmseg = shminfo->shmseg;
  8.1040 -    req->id = image->id;
  8.1041 -    req->src_x = src_x;
  8.1042 -    req->src_y = src_y;
  8.1043 -    req->src_w = src_w;
  8.1044 -    req->src_h = src_h;
  8.1045 -    req->drw_x = dest_x;
  8.1046 -    req->drw_y = dest_y;
  8.1047 -    req->drw_w = dest_w;
  8.1048 -    req->drw_h = dest_h;
  8.1049 -    req->offset = image->data - shminfo->shmaddr;
  8.1050 -    req->width = image->width;
  8.1051 -    req->height = image->height;
  8.1052 -    req->send_event = send_event;
  8.1053 -
  8.1054 -    UnlockDisplay(dpy);
  8.1055 -    SyncHandle();
  8.1056 -
  8.1057 -    return Success;
  8.1058 -}
  8.1059 -
  8.1060 -
  8.1061 -static Bool
  8.1062 -xv_wire_to_event(Display * dpy, XEvent * host, xEvent * wire)
  8.1063 -{
  8.1064 -    XExtDisplayInfo *info = xv_find_display(dpy);
  8.1065 -    SDL_NAME(XvEvent) * re = (SDL_NAME(XvEvent) *) host;
  8.1066 -    xvEvent *event = (xvEvent *) wire;
  8.1067 -
  8.1068 -    XvCheckExtension(dpy, info, False);
  8.1069 -
  8.1070 -    switch ((event->u.u.type & 0x7F) - info->codes->first_event) {
  8.1071 -    case XvVideoNotify:
  8.1072 -        re->xvvideo.type = event->u.u.type & 0x7f;
  8.1073 -        re->xvvideo.serial =
  8.1074 -            _XSetLastRequestRead(dpy, (xGenericReply *) event);
  8.1075 -        re->xvvideo.send_event = ((event->u.u.type & 0x80) != 0);
  8.1076 -        re->xvvideo.display = dpy;
  8.1077 -        re->xvvideo.time = event->u.videoNotify.time;
  8.1078 -        re->xvvideo.reason = event->u.videoNotify.reason;
  8.1079 -        re->xvvideo.drawable = event->u.videoNotify.drawable;
  8.1080 -        re->xvvideo.port_id = event->u.videoNotify.port;
  8.1081 -        break;
  8.1082 -    case XvPortNotify:
  8.1083 -        re->xvport.type = event->u.u.type & 0x7f;
  8.1084 -        re->xvport.serial =
  8.1085 -            _XSetLastRequestRead(dpy, (xGenericReply *) event);
  8.1086 -        re->xvport.send_event = ((event->u.u.type & 0x80) != 0);
  8.1087 -        re->xvport.display = dpy;
  8.1088 -        re->xvport.time = event->u.portNotify.time;
  8.1089 -        re->xvport.port_id = event->u.portNotify.port;
  8.1090 -        re->xvport.attribute = event->u.portNotify.attribute;
  8.1091 -        re->xvport.value = event->u.portNotify.value;
  8.1092 -        break;
  8.1093 -    default:
  8.1094 -        return False;
  8.1095 -    }
  8.1096 -
  8.1097 -    return (True);
  8.1098 -}
  8.1099 -
  8.1100 -/* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/video/Xext/Xv/Xvlibint.h	Sun Feb 27 22:22:58 2011 -0800
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,82 +0,0 @@
     9.4 -/***********************************************************
     9.5 -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
     9.6 -and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
     9.7 -
     9.8 -                        All Rights Reserved
     9.9 -
    9.10 -Permission to use, copy, modify, and distribute this software and its 
    9.11 -documentation for any purpose and without fee is hereby granted, 
    9.12 -provided that the above copyright notice appear in all copies and that
    9.13 -both that copyright notice and this permission notice appear in 
    9.14 -supporting documentation, and that the names of Digital or MIT not be
    9.15 -used in advertising or publicity pertaining to distribution of the
    9.16 -software without specific, written prior permission.  
    9.17 -
    9.18 -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
    9.19 -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
    9.20 -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
    9.21 -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    9.22 -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
    9.23 -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    9.24 -SOFTWARE.
    9.25 -
    9.26 -******************************************************************/
    9.27 -/* $XFree86: xc/lib/Xv/Xvlibint.h,v 1.5 2001/07/25 15:04:53 dawes Exp $ */
    9.28 -
    9.29 -#ifndef XVLIBINT_H
    9.30 -#define XVLIBINT_H
    9.31 -/*
    9.32 -** File: 
    9.33 -**
    9.34 -**   Xvlibint.h --- Xv library internal header file
    9.35 -**
    9.36 -** Author: 
    9.37 -**
    9.38 -**   David Carver (Digital Workstation Engineering/Project Athena)
    9.39 -**
    9.40 -** Revisions:
    9.41 -**
    9.42 -**   01.24.91 Carver
    9.43 -**     - version 1.4 upgrade
    9.44 -**
    9.45 -*/
    9.46 -
    9.47 -#define NEED_REPLIES
    9.48 -
    9.49 -/* Apparently some X11 systems can't include this multiple times... */
    9.50 -#ifndef SDL_INCLUDED_XLIBINT_H
    9.51 -#define SDL_INCLUDED_XLIBINT_H 1
    9.52 -#include <X11/Xlibint.h>
    9.53 -#endif
    9.54 -
    9.55 -#include "../extensions/Xvproto.h"
    9.56 -#include "../extensions/Xvlib.h"
    9.57 -
    9.58 -#if !defined(UNIXCPP)
    9.59 -#define XvGetReq(name, req) \
    9.60 -        WORD64ALIGN\
    9.61 -	if ((dpy->bufptr + SIZEOF(xv##name##Req)) > dpy->bufmax)\
    9.62 -		_XFlush(dpy);\
    9.63 -	req = (xv##name##Req *)(dpy->last_req = dpy->bufptr);\
    9.64 -	req->reqType = info->codes->major_opcode;\
    9.65 -        req->xvReqType = xv_##name; \
    9.66 -        req->length = (SIZEOF(xv##name##Req))>>2;\
    9.67 -	dpy->bufptr += SIZEOF(xv##name##Req);\
    9.68 -	dpy->request++
    9.69 -
    9.70 -#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
    9.71 -#define XvGetReq(name, req) \
    9.72 -        WORD64ALIGN\
    9.73 -	if ((dpy->bufptr + SIZEOF(xv/**/name/**/Req)) > dpy->bufmax)\
    9.74 -		_XFlush(dpy);\
    9.75 -	req = (xv/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
    9.76 -	req->reqType = info->codes->major_opcode;\
    9.77 -	req->xvReqType = xv_/**/name;\
    9.78 -	req->length = (SIZEOF(xv/**/name/**/Req))>>2;\
    9.79 -	dpy->bufptr += SIZEOF(xv/**/name/**/Req);\
    9.80 -	dpy->request++
    9.81 -#endif
    9.82 -
    9.83 -
    9.84 -#endif /* XVLIBINT_H */
    9.85 -/* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/video/Xext/Xxf86vm/XF86VMode.c	Sun Feb 27 22:22:58 2011 -0800
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,1263 +0,0 @@
    10.4 -/* $XConsortium: XF86VMode.c /main/2 1995/11/14 18:17:58 kaleb $ */
    10.5 -/* $XFree86: xc/lib/Xxf86vm/XF86VMode.c,v 3.32 2001/07/25 15:04:54 dawes Exp $ */
    10.6 -/*
    10.7 -
    10.8 -Copyright (c) 1995  Kaleb S. KEITHLEY
    10.9 -
   10.10 -Permission is hereby granted, free of charge, to any person obtaining
   10.11 -a copy of this software and associated documentation files (the
   10.12 -"Software"), to deal in the Software without restriction, including
   10.13 -without limitation the rights to use, copy, modify, merge, publish,
   10.14 -distribute, sublicense, and/or sell copies of the Software, and to
   10.15 -permit persons to whom the Software is furnished to do so, subject to
   10.16 -the following conditions:
   10.17 -
   10.18 -The above copyright notice and this permission notice shall be
   10.19 -included in all copies or substantial portions of the Software.
   10.20 -
   10.21 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   10.22 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   10.23 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   10.24 -IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES 
   10.25 -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
   10.26 -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
   10.27 -OTHER DEALINGS IN THE SOFTWARE.
   10.28 -
   10.29 -Except as contained in this notice, the name of Kaleb S. KEITHLEY 
   10.30 -shall not be used in advertising or otherwise to promote the sale, use 
   10.31 -or other dealings in this Software without prior written authorization
   10.32 -from Kaleb S. KEITHLEY.
   10.33 -
   10.34 -*/
   10.35 -/* $XConsortium: XF86VMode.c /main/4 1996/01/16 07:52:25 kaleb CHECKEDOUT $ */
   10.36 -
   10.37 -/* THIS IS NOT AN X CONSORTIUM STANDARD */
   10.38 -
   10.39 -#define NEED_EVENTS
   10.40 -#define NEED_REPLIES
   10.41 -
   10.42 -#ifndef XBUILD_IN_CLIENT
   10.43 -
   10.44 -/* Apparently some X11 systems can't include this multiple times... */
   10.45 -#ifndef SDL_INCLUDED_XLIBINT_H
   10.46 -#define SDL_INCLUDED_XLIBINT_H 1
   10.47 -#include <X11/Xlibint.h>
   10.48 -#endif
   10.49 -
   10.50 -#include "../extensions/xf86vmstr.h"
   10.51 -#include "../extensions/Xext.h"
   10.52 -#include "../extensions/extutil.h"
   10.53 -#else
   10.54 -#include "include/extensions/xf86vmstr.h"
   10.55 -#include "include/extensions/Xext.h"
   10.56 -#include "include/extensions/extutil.h"
   10.57 -#endif
   10.58 -
   10.59 -#ifdef DEBUG
   10.60 -#include <stdio.h>
   10.61 -#endif
   10.62 -
   10.63 -#ifndef MODE_BAD
   10.64 -#define MODE_BAD 255
   10.65 -#endif
   10.66 -
   10.67 -static XExtensionInfo _xf86vidmode_info_data;
   10.68 -static XExtensionInfo *xf86vidmode_info = &_xf86vidmode_info_data;
   10.69 -static char *xf86vidmode_extension_name = XF86VIDMODENAME;
   10.70 -
   10.71 -#define XF86VidModeCheckExtension(dpy,i,val) \
   10.72 -  XextCheckExtension (dpy, i, xf86vidmode_extension_name, val)
   10.73 -
   10.74 -/*****************************************************************************
   10.75 - *                                                                           *
   10.76 - *			   private utility routines                          *
   10.77 - *                                                                           *
   10.78 - *****************************************************************************/
   10.79 -
   10.80 -static XEXT_CLOSE_DISPLAY_PROTO(close_display);
   10.81 -static /* const */ XExtensionHooks xf86vidmode_extension_hooks = {
   10.82 -    NULL,                       /* create_gc */
   10.83 -    NULL,                       /* copy_gc */
   10.84 -    NULL,                       /* flush_gc */
   10.85 -    NULL,                       /* free_gc */
   10.86 -    NULL,                       /* create_font */
   10.87 -    NULL,                       /* free_font */
   10.88 -    close_display,              /* close_display */
   10.89 -    NULL,                       /* wire_to_event */
   10.90 -    NULL,                       /* event_to_wire */
   10.91 -    NULL,                       /* error */
   10.92 -    NULL,                       /* error_string */
   10.93 -};
   10.94 -
   10.95 -static
   10.96 -XEXT_GENERATE_FIND_DISPLAY(find_display, xf86vidmode_info,
   10.97 -                           xf86vidmode_extension_name,
   10.98 -                           &xf86vidmode_extension_hooks, 0, NULL)
   10.99 -     static XEXT_GENERATE_CLOSE_DISPLAY(close_display, xf86vidmode_info)
  10.100 -/*****************************************************************************
  10.101 - *                                                                           *
  10.102 - *		    public XFree86-VidMode Extension routines                *
  10.103 - *                                                                           *
  10.104 - *****************************************************************************/
  10.105 -  Bool
  10.106 -SDL_NAME(XF86VidModeQueryExtension) (dpy, event_basep, error_basep)
  10.107 -     Display *dpy;
  10.108 -     int *event_basep, *error_basep;
  10.109 -{
  10.110 -    XExtDisplayInfo *info = find_display(dpy);
  10.111 -
  10.112 -    if (XextHasExtension(info)) {
  10.113 -        *event_basep = info->codes->first_event;
  10.114 -        *error_basep = info->codes->first_error;
  10.115 -        return True;
  10.116 -    } else {
  10.117 -        return False;
  10.118 -    }
  10.119 -}
  10.120 -
  10.121 -Bool SDL_NAME(XF86VidModeQueryVersion) (dpy, majorVersion, minorVersion)
  10.122 -     Display *
  10.123 -         dpy;
  10.124 -     int *
  10.125 -         majorVersion;
  10.126 -     int *
  10.127 -         minorVersion;
  10.128 -{
  10.129 -    XExtDisplayInfo *info = find_display(dpy);
  10.130 -    xXF86VidModeQueryVersionReply rep;
  10.131 -    xXF86VidModeQueryVersionReq *req;
  10.132 -
  10.133 -    XF86VidModeCheckExtension(dpy, info, False);
  10.134 -
  10.135 -    LockDisplay(dpy);
  10.136 -    GetReq(XF86VidModeQueryVersion, req);
  10.137 -    req->reqType = info->codes->major_opcode;
  10.138 -    req->xf86vidmodeReqType = X_XF86VidModeQueryVersion;
  10.139 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
  10.140 -        UnlockDisplay(dpy);
  10.141 -        SyncHandle();
  10.142 -        return False;
  10.143 -    }
  10.144 -    *majorVersion = rep.majorVersion;
  10.145 -    *minorVersion = rep.minorVersion;
  10.146 -    UnlockDisplay(dpy);
  10.147 -    SyncHandle();
  10.148 -    if (*majorVersion >= 2)
  10.149 -        SDL_NAME(XF86VidModeSetClientVersion) (dpy);
  10.150 -    return True;
  10.151 -}
  10.152 -
  10.153 -Bool SDL_NAME(XF86VidModeSetClientVersion) (Display * dpy)
  10.154 -{
  10.155 -    XExtDisplayInfo *info = find_display(dpy);
  10.156 -    xXF86VidModeSetClientVersionReq *req;
  10.157 -
  10.158 -    XF86VidModeCheckExtension(dpy, info, False);
  10.159 -
  10.160 -    LockDisplay(dpy);
  10.161 -    GetReq(XF86VidModeSetClientVersion, req);
  10.162 -    req->reqType = info->codes->major_opcode;
  10.163 -    req->xf86vidmodeReqType = X_XF86VidModeSetClientVersion;
  10.164 -    req->major = XF86VIDMODE_MAJOR_VERSION;
  10.165 -    req->minor = XF86VIDMODE_MINOR_VERSION;
  10.166 -    UnlockDisplay(dpy);
  10.167 -    SyncHandle();
  10.168 -    return True;
  10.169 -}
  10.170 -
  10.171 -Bool
  10.172 -SDL_NAME(XF86VidModeSetGamma) (Display * dpy, int screen,
  10.173 -                               SDL_NAME(XF86VidModeGamma) * Gamma)
  10.174 -{
  10.175 -    XExtDisplayInfo *info = find_display(dpy);
  10.176 -    xXF86VidModeSetGammaReq *req;
  10.177 -
  10.178 -    XF86VidModeCheckExtension(dpy, info, False);
  10.179 -
  10.180 -    LockDisplay(dpy);
  10.181 -    GetReq(XF86VidModeSetGamma, req);
  10.182 -    req->reqType = info->codes->major_opcode;
  10.183 -    req->xf86vidmodeReqType = X_XF86VidModeSetGamma;
  10.184 -    req->screen = screen;
  10.185 -    req->red = (CARD32) (Gamma->red * 10000.);
  10.186 -    req->green = (CARD32) (Gamma->green * 10000.);
  10.187 -    req->blue = (CARD32) (Gamma->blue * 10000.);
  10.188 -    UnlockDisplay(dpy);
  10.189 -    SyncHandle();
  10.190 -    return True;
  10.191 -}
  10.192 -
  10.193 -Bool
  10.194 -SDL_NAME(XF86VidModeGetGamma) (Display * dpy, int screen,
  10.195 -                               SDL_NAME(XF86VidModeGamma) * Gamma)
  10.196 -{
  10.197 -    XExtDisplayInfo *info = find_display(dpy);
  10.198 -    xXF86VidModeGetGammaReply rep;
  10.199 -    xXF86VidModeGetGammaReq *req;
  10.200 -
  10.201 -    XF86VidModeCheckExtension(dpy, info, False);
  10.202 -
  10.203 -    LockDisplay(dpy);
  10.204 -    GetReq(XF86VidModeGetGamma, req);
  10.205 -    req->reqType = info->codes->major_opcode;
  10.206 -    req->xf86vidmodeReqType = X_XF86VidModeGetGamma;
  10.207 -    req->screen = screen;
  10.208 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
  10.209 -        UnlockDisplay(dpy);
  10.210 -        SyncHandle();
  10.211 -        return False;
  10.212 -    }
  10.213 -    Gamma->red = ((float) rep.red) / 10000.;
  10.214 -    Gamma->green = ((float) rep.green) / 10000.;
  10.215 -    Gamma->blue = ((float) rep.blue) / 10000.;
  10.216 -    UnlockDisplay(dpy);
  10.217 -    SyncHandle();
  10.218 -    return True;
  10.219 -}
  10.220 -
  10.221 -Bool SDL_NAME(XF86VidModeGetModeLine) (dpy, screen, dotclock, modeline)
  10.222 -     Display *
  10.223 -         dpy;
  10.224 -     int
  10.225 -         screen;
  10.226 -     int *
  10.227 -         dotclock;
  10.228 -SDL_NAME(XF86VidModeModeLine) * modeline;
  10.229 -{
  10.230 -    XExtDisplayInfo *info = find_display(dpy);
  10.231 -    xXF86VidModeGetModeLineReply rep;
  10.232 -    xXF86OldVidModeGetModeLineReply oldrep;
  10.233 -    xXF86VidModeGetModeLineReq *req;
  10.234 -    int majorVersion, minorVersion;
  10.235 -
  10.236 -    XF86VidModeCheckExtension(dpy, info, False);
  10.237 -    SDL_NAME(XF86VidModeQueryVersion) (dpy, &majorVersion, &minorVersion);
  10.238 -
  10.239 -    LockDisplay(dpy);
  10.240 -    GetReq(XF86VidModeGetModeLine, req);
  10.241 -    req->reqType = info->codes->major_opcode;
  10.242 -    req->xf86vidmodeReqType = X_XF86VidModeGetModeLine;
  10.243 -    req->screen = screen;
  10.244 -
  10.245 -    if (majorVersion < 2) {
  10.246 -        if (!_XReply(dpy, (xReply *) & oldrep,
  10.247 -                     (SIZEOF(xXF86OldVidModeGetModeLineReply) -
  10.248 -                      SIZEOF(xReply)) >> 2, xFalse)) {
  10.249 -            UnlockDisplay(dpy);
  10.250 -            SyncHandle();
  10.251 -            return False;
  10.252 -        }
  10.253 -        *dotclock = oldrep.dotclock;
  10.254 -        modeline->hdisplay = oldrep.hdisplay;
  10.255 -        modeline->hsyncstart = oldrep.hsyncstart;
  10.256 -        modeline->hsyncend = oldrep.hsyncend;
  10.257 -        modeline->htotal = oldrep.htotal;
  10.258 -        modeline->hskew = 0;
  10.259 -        modeline->vdisplay = oldrep.vdisplay;
  10.260 -        modeline->vsyncstart = oldrep.vsyncstart;
  10.261 -        modeline->vsyncend = oldrep.vsyncend;
  10.262 -        modeline->vtotal = oldrep.vtotal;
  10.263 -        modeline->flags = oldrep.flags;
  10.264 -        modeline->privsize = oldrep.privsize;
  10.265 -    } else {
  10.266 -        if (!_XReply(dpy, (xReply *) & rep,
  10.267 -                     (SIZEOF(xXF86VidModeGetModeLineReply) -
  10.268 -                      SIZEOF(xReply)) >> 2, xFalse)) {
  10.269 -            UnlockDisplay(dpy);
  10.270 -            SyncHandle();
  10.271 -            return False;
  10.272 -        }
  10.273 -        *dotclock = rep.dotclock;
  10.274 -        modeline->hdisplay = rep.hdisplay;
  10.275 -        modeline->hsyncstart = rep.hsyncstart;
  10.276 -        modeline->hsyncend = rep.hsyncend;
  10.277 -        modeline->htotal = rep.htotal;
  10.278 -        modeline->hskew = rep.hskew;
  10.279 -        modeline->vdisplay = rep.vdisplay;
  10.280 -        modeline->vsyncstart = rep.vsyncstart;
  10.281 -        modeline->vsyncend = rep.vsyncend;
  10.282 -        modeline->vtotal = rep.vtotal;
  10.283 -        modeline->flags = rep.flags;
  10.284 -        modeline->privsize = rep.privsize;
  10.285 -    }
  10.286 -
  10.287 -    if (modeline->privsize > 0) {
  10.288 -        if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) {
  10.289 -            _XEatData(dpy, (modeline->privsize) * sizeof(INT32));
  10.290 -            Xfree(modeline->private);
  10.291 -            return False;
  10.292 -        }
  10.293 -        _XRead(dpy, (char *) modeline->private,
  10.294 -               modeline->privsize * sizeof(INT32));
  10.295 -    } else {
  10.296 -        modeline->private = NULL;
  10.297 -    }
  10.298 -    UnlockDisplay(dpy);
  10.299 -    SyncHandle();
  10.300 -    return True;
  10.301 -}
  10.302 -
  10.303 -Bool
  10.304 -SDL_NAME(XF86VidModeGetAllModeLines) (dpy, screen, modecount, modelinesPtr)
  10.305 -     Display *dpy;
  10.306 -     int screen;
  10.307 -     int *modecount;
  10.308 -SDL_NAME(XF86VidModeModeInfo) *** modelinesPtr;
  10.309 -{
  10.310 -    XExtDisplayInfo *info = find_display(dpy);
  10.311 -    xXF86VidModeGetAllModeLinesReply rep;
  10.312 -    xXF86VidModeGetAllModeLinesReq *req;
  10.313 -    SDL_NAME(XF86VidModeModeInfo) * mdinfptr, **modelines;
  10.314 -    xXF86VidModeModeInfo xmdline;
  10.315 -    xXF86OldVidModeModeInfo oldxmdline;
  10.316 -    int i;
  10.317 -    int majorVersion, minorVersion;
  10.318 -    Bool protocolBug = False;
  10.319 -
  10.320 -    XF86VidModeCheckExtension(dpy, info, False);
  10.321 -
  10.322 -    /*
  10.323 -     * Note: There was a bug in the protocol implementation in versions
  10.324 -     * 0.x with x < 8 (the .private field wasn't being passed over the wire).
  10.325 -     * Check the server's version, and accept the old format if appropriate.
  10.326 -     */
  10.327 -
  10.328 -    SDL_NAME(XF86VidModeQueryVersion) (dpy, &majorVersion, &minorVersion);
  10.329 -    if (majorVersion == 0 && minorVersion < 8) {
  10.330 -        protocolBug = True;
  10.331 -#ifdef DEBUG
  10.332 -        fprintf(stderr, "XF86VidModeGetAllModeLines: Warning: Xserver is"
  10.333 -                "running an old version (%d.%d)\n", majorVersion,
  10.334 -                minorVersion);
  10.335 -#endif
  10.336 -    }
  10.337 -
  10.338 -    LockDisplay(dpy);
  10.339 -    GetReq(XF86VidModeGetAllModeLines, req);
  10.340 -    req->reqType = info->codes->major_opcode;
  10.341 -    req->xf86vidmodeReqType = X_XF86VidModeGetAllModeLines;
  10.342 -    req->screen = screen;
  10.343 -    if (!_XReply(dpy, (xReply *) & rep,
  10.344 -                 (SIZEOF(xXF86VidModeGetAllModeLinesReply) -
  10.345 -                  SIZEOF(xReply)) >> 2, xFalse)) {
  10.346 -        UnlockDisplay(dpy);
  10.347 -        SyncHandle();
  10.348 -        return False;
  10.349 -    }
  10.350 -
  10.351 -    *modecount = rep.modecount;
  10.352 -
  10.353 -    if (!
  10.354 -        (modelines =
  10.355 -         (SDL_NAME(XF86VidModeModeInfo) **) Xcalloc(rep.modecount,
  10.356 -                                                    sizeof(SDL_NAME
  10.357 -                                                           (XF86VidModeModeInfo)
  10.358 -                                                           *) +
  10.359 -                                                    sizeof(SDL_NAME
  10.360 -                                                           (XF86VidModeModeInfo)))))
  10.361 -    {
  10.362 -        if (majorVersion < 2)
  10.363 -            _XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo));
  10.364 -        else
  10.365 -            _XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
  10.366 -        Xfree(modelines);
  10.367 -        UnlockDisplay(dpy);
  10.368 -        SyncHandle();
  10.369 -        return False;
  10.370 -    }
  10.371 -    mdinfptr = (SDL_NAME(XF86VidModeModeInfo) *) ((char *) modelines
  10.372 -                                                  +
  10.373 -                                                  rep.modecount *
  10.374 -                                                  sizeof(SDL_NAME
  10.375 -                                                         (XF86VidModeModeInfo)
  10.376 -                                                         *));
  10.377 -
  10.378 -    for (i = 0; i < rep.modecount; i++) {
  10.379 -        modelines[i] = mdinfptr++;
  10.380 -        if (majorVersion < 2) {
  10.381 -            _XRead(dpy, (char *) &oldxmdline,
  10.382 -                   sizeof(xXF86OldVidModeModeInfo));
  10.383 -            modelines[i]->dotclock = oldxmdline.dotclock;
  10.384 -            modelines[i]->hdisplay = oldxmdline.hdisplay;
  10.385 -            modelines[i]->hsyncstart = oldxmdline.hsyncstart;
  10.386 -            modelines[i]->hsyncend = oldxmdline.hsyncend;
  10.387 -            modelines[i]->htotal = oldxmdline.htotal;
  10.388 -            modelines[i]->hskew = 0;
  10.389 -            modelines[i]->vdisplay = oldxmdline.vdisplay;
  10.390 -            modelines[i]->vsyncstart = oldxmdline.vsyncstart;
  10.391 -            modelines[i]->vsyncend = oldxmdline.vsyncend;
  10.392 -            modelines[i]->vtotal = oldxmdline.vtotal;
  10.393 -            modelines[i]->flags = oldxmdline.flags;
  10.394 -            if (protocolBug) {
  10.395 -                modelines[i]->privsize = 0;
  10.396 -                modelines[i]->private = NULL;
  10.397 -            } else {
  10.398 -                modelines[i]->privsize = oldxmdline.privsize;
  10.399 -                if (oldxmdline.privsize > 0) {
  10.400 -                    if (!(modelines[i]->private =
  10.401 -                          Xcalloc(oldxmdline.privsize, sizeof(INT32)))) {
  10.402 -                        _XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32));
  10.403 -                        Xfree(modelines[i]->private);
  10.404 -                    } else {
  10.405 -                        _XRead(dpy, (char *) modelines[i]->private,
  10.406 -                               oldxmdline.privsize * sizeof(INT32));
  10.407 -                    }
  10.408 -                } else {
  10.409 -                    modelines[i]->private = NULL;
  10.410 -                }
  10.411 -            }
  10.412 -        } else {
  10.413 -            _XRead(dpy, (char *) &xmdline, sizeof(xXF86VidModeModeInfo));
  10.414 -            modelines[i]->dotclock = xmdline.dotclock;
  10.415 -            modelines[i]->hdisplay = xmdline.hdisplay;
  10.416 -            modelines[i]->hsyncstart = xmdline.hsyncstart;
  10.417 -            modelines[i]->hsyncend = xmdline.hsyncend;
  10.418 -            modelines[i]->htotal = xmdline.htotal;
  10.419 -            modelines[i]->hskew = xmdline.hskew;
  10.420 -            modelines[i]->vdisplay = xmdline.vdisplay;
  10.421 -            modelines[i]->vsyncstart = xmdline.vsyncstart;
  10.422 -            modelines[i]->vsyncend = xmdline.vsyncend;
  10.423 -            modelines[i]->vtotal = xmdline.vtotal;
  10.424 -            modelines[i]->flags = xmdline.flags;
  10.425 -            if (protocolBug) {
  10.426 -                modelines[i]->privsize = 0;
  10.427 -                modelines[i]->private = NULL;
  10.428 -            } else {
  10.429 -                modelines[i]->privsize = xmdline.privsize;
  10.430 -                if (xmdline.privsize > 0) {
  10.431 -                    if (!(modelines[i]->private =
  10.432 -                          Xcalloc(xmdline.privsize, sizeof(INT32)))) {
  10.433 -                        _XEatData(dpy, (xmdline.privsize) * sizeof(INT32));
  10.434 -                        Xfree(modelines[i]->private);
  10.435 -                    } else {
  10.436 -                        _XRead(dpy, (char *) modelines[i]->private,
  10.437 -                               xmdline.privsize * sizeof(INT32));
  10.438 -                    }
  10.439 -                } else {
  10.440 -                    modelines[i]->private = NULL;
  10.441 -                }
  10.442 -            }
  10.443 -        }
  10.444 -    }
  10.445 -    *modelinesPtr = modelines;
  10.446 -    UnlockDisplay(dpy);
  10.447 -    SyncHandle();
  10.448 -    return True;
  10.449 -}
  10.450 -
  10.451 -/*
  10.452 - * GetReq replacement for use with VidMode protocols earlier than 2.0
  10.453 - */
  10.454 -#if !defined(UNIXCPP) || defined(ANSICPP)
  10.455 -#define GetOldReq(name, oldname, req) \
  10.456 -        WORD64ALIGN\
  10.457 -	if ((dpy->bufptr + SIZEOF(x##oldname##Req)) > dpy->bufmax)\
  10.458 -		_XFlush(dpy);\
  10.459 -	req = (x##oldname##Req *)(dpy->last_req = dpy->bufptr);\
  10.460 -	req->reqType = X_##name;\
  10.461 -	req->length = (SIZEOF(x##oldname##Req))>>2;\
  10.462 -	dpy->bufptr += SIZEOF(x##oldname##Req);\
  10.463 -	dpy->request++
  10.464 -
  10.465 -#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
  10.466 -#define GetOldReq(name, oldname, req) \
  10.467 -        WORD64ALIGN\
  10.468 -	if ((dpy->bufptr + SIZEOF(x/**/oldname/**/Req)) > dpy->bufmax)\
  10.469 -		_XFlush(dpy);\
  10.470 -	req = (x/**/oldname/**/Req *)(dpy->last_req = dpy->bufptr);\
  10.471 -	req->reqType = X_/**/name;\
  10.472 -	req->length = (SIZEOF(x/**/oldname/**/Req))>>2;\
  10.473 -	dpy->bufptr += SIZEOF(x/**/oldname/**/Req);\
  10.474 -	dpy->request++
  10.475 -#endif
  10.476 -
  10.477 -Bool
  10.478 -SDL_NAME(XF86VidModeAddModeLine) (dpy, screen, newmodeline, aftermodeline)
  10.479 -     Display *dpy;
  10.480 -     int screen;
  10.481 -SDL_NAME(XF86VidModeModeInfo) * newmodeline;
  10.482 -SDL_NAME(XF86VidModeModeInfo) * aftermodeline;
  10.483 -{
  10.484 -    XExtDisplayInfo *info = find_display(dpy);
  10.485 -    xXF86VidModeAddModeLineReq *req;
  10.486 -    xXF86OldVidModeAddModeLineReq *oldreq;
  10.487 -    int majorVersion, minorVersion;
  10.488 -
  10.489 -    XF86VidModeCheckExtension(dpy, info, False);
  10.490 -    SDL_NAME(XF86VidModeQueryVersion) (dpy, &majorVersion, &minorVersion);
  10.491 -
  10.492 -    LockDisplay(dpy);
  10.493 -    if (majorVersion < 2) {
  10.494 -        GetOldReq(XF86VidModeAddModeLine, XF86OldVidModeAddModeLine, oldreq);
  10.495 -        oldreq->reqType = info->codes->major_opcode;
  10.496 -        oldreq->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
  10.497 -        oldreq->screen = screen;
  10.498 -        oldreq->dotclock = newmodeline->dotclock;
  10.499 -        oldreq->hdisplay = newmodeline->hdisplay;
  10.500 -        oldreq->hsyncstart = newmodeline->hsyncstart;
  10.501 -        oldreq->hsyncend = newmodeline->hsyncend;
  10.502 -        oldreq->htotal = newmodeline->htotal;
  10.503 -        oldreq->vdisplay = newmodeline->vdisplay;
  10.504 -        oldreq->vsyncstart = newmodeline->vsyncstart;
  10.505 -        oldreq->vsyncend = newmodeline->vsyncend;
  10.506 -        oldreq->vtotal = newmodeline->vtotal;
  10.507 -        oldreq->flags = newmodeline->flags;
  10.508 -        oldreq->privsize = newmodeline->privsize;
  10.509 -        if (aftermodeline != NULL) {
  10.510 -            oldreq->after_dotclock = aftermodeline->dotclock;
  10.511 -            oldreq->after_hdisplay = aftermodeline->hdisplay;
  10.512 -            oldreq->after_hsyncstart = aftermodeline->hsyncstart;
  10.513 -            oldreq->after_hsyncend = aftermodeline->hsyncend;
  10.514 -            oldreq->after_htotal = aftermodeline->htotal;
  10.515 -            oldreq->after_vdisplay = aftermodeline->vdisplay;
  10.516 -            oldreq->after_vsyncstart = aftermodeline->vsyncstart;
  10.517 -            oldreq->after_vsyncend = aftermodeline->vsyncend;
  10.518 -            oldreq->after_vtotal = aftermodeline->vtotal;
  10.519 -            oldreq->after_flags = aftermodeline->flags;
  10.520 -        } else {
  10.521 -            oldreq->after_dotclock = 0;
  10.522 -            oldreq->after_hdisplay = 0;
  10.523 -            oldreq->after_hsyncstart = 0;
  10.524 -            oldreq->after_hsyncend = 0;
  10.525 -            oldreq->after_htotal = 0;
  10.526 -            oldreq->after_vdisplay = 0;
  10.527 -            oldreq->after_vsyncstart = 0;
  10.528 -            oldreq->after_vsyncend = 0;
  10.529 -            oldreq->after_vtotal = 0;
  10.530 -            oldreq->after_flags = 0;
  10.531 -        }
  10.532 -        if (newmodeline->privsize) {
  10.533 -            oldreq->length += newmodeline->privsize;
  10.534 -            Data32(dpy, (long *) newmodeline->private,
  10.535 -                   newmodeline->privsize * sizeof(INT32));
  10.536 -        }
  10.537 -    } else {
  10.538 -        GetReq(XF86VidModeAddModeLine, req);
  10.539 -        req->reqType = info->codes->major_opcode;
  10.540 -        req->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
  10.541 -        req->screen = screen;
  10.542 -        req->dotclock = newmodeline->dotclock;
  10.543 -        req->hdisplay = newmodeline->hdisplay;
  10.544 -        req->hsyncstart = newmodeline->hsyncstart;
  10.545 -        req->hsyncend = newmodeline->hsyncend;
  10.546 -        req->htotal = newmodeline->htotal;
  10.547 -        req->hskew = newmodeline->hskew;
  10.548 -        req->vdisplay = newmodeline->vdisplay;
  10.549 -        req->vsyncstart = newmodeline->vsyncstart;
  10.550 -        req->vsyncend = newmodeline->vsyncend;
  10.551 -        req->vtotal = newmodeline->vtotal;
  10.552 -        req->flags = newmodeline->flags;
  10.553 -        req->privsize = newmodeline->privsize;
  10.554 -        if (aftermodeline != NULL) {
  10.555 -            req->after_dotclock = aftermodeline->dotclock;
  10.556 -            req->after_hdisplay = aftermodeline->hdisplay;
  10.557 -            req->after_hsyncstart = aftermodeline->hsyncstart;
  10.558 -            req->after_hsyncend = aftermodeline->hsyncend;
  10.559 -            req->after_htotal = aftermodeline->htotal;
  10.560 -            req->after_hskew = aftermodeline->hskew;
  10.561 -            req->after_vdisplay = aftermodeline->vdisplay;
  10.562 -            req->after_vsyncstart = aftermodeline->vsyncstart;
  10.563 -            req->after_vsyncend = aftermodeline->vsyncend;
  10.564 -            req->after_vtotal = aftermodeline->vtotal;
  10.565 -            req->after_flags = aftermodeline->flags;
  10.566 -        } else {
  10.567 -            req->after_dotclock = 0;
  10.568 -            req->after_hdisplay = 0;
  10.569 -            req->after_hsyncstart = 0;
  10.570 -            req->after_hsyncend = 0;
  10.571 -            req->after_htotal = 0;
  10.572 -            req->after_hskew = 0;
  10.573 -            req->after_vdisplay = 0;
  10.574 -            req->after_vsyncstart = 0;
  10.575 -            req->after_vsyncend = 0;
  10.576 -            req->after_vtotal = 0;
  10.577 -            req->after_flags = 0;
  10.578 -        }
  10.579 -        if (newmodeline->privsize) {
  10.580 -            req->length += newmodeline->privsize;
  10.581 -            Data32(dpy, (long *) newmodeline->private,
  10.582 -                   newmodeline->privsize * sizeof(INT32));
  10.583 -        }
  10.584 -    }
  10.585 -    UnlockDisplay(dpy);
  10.586 -    SyncHandle();
  10.587 -    return True;
  10.588 -}
  10.589 -
  10.590 -Bool SDL_NAME(XF86VidModeDeleteModeLine) (dpy, screen, modeline)
  10.591 -     Display *
  10.592 -         dpy;
  10.593 -     int
  10.594 -         screen;
  10.595 -SDL_NAME(XF86VidModeModeInfo) * modeline;
  10.596 -{
  10.597 -    XExtDisplayInfo *info = find_display(dpy);
  10.598 -    xXF86VidModeDeleteModeLineReq *req;
  10.599 -    xXF86OldVidModeDeleteModeLineReq *oldreq;
  10.600 -    int majorVersion, minorVersion;
  10.601 -
  10.602 -    XF86VidModeCheckExtension(dpy, info, 0);
  10.603 -    SDL_NAME(XF86VidModeQueryVersion) (dpy, &majorVersion, &minorVersion);
  10.604 -
  10.605 -    LockDisplay(dpy);
  10.606 -    if (majorVersion < 2) {
  10.607 -        GetOldReq(XF86VidModeDeleteModeLine, XF86OldVidModeDeleteModeLine,
  10.608 -                  oldreq);
  10.609 -        oldreq->reqType = info->codes->major_opcode;
  10.610 -        oldreq->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
  10.611 -        oldreq->screen = screen;
  10.612 -        oldreq->dotclock = modeline->dotclock;
  10.613 -        oldreq->hdisplay = modeline->hdisplay;
  10.614 -        oldreq->hsyncstart = modeline->hsyncstart;
  10.615 -        oldreq->hsyncend = modeline->hsyncend;
  10.616 -        oldreq->htotal = modeline->htotal;
  10.617 -        oldreq->vdisplay = modeline->vdisplay;
  10.618 -        oldreq->vsyncstart = modeline->vsyncstart;
  10.619 -        oldreq->vsyncend = modeline->vsyncend;
  10.620 -        oldreq->vtotal = modeline->vtotal;
  10.621 -        oldreq->flags = modeline->flags;
  10.622 -        oldreq->privsize = modeline->privsize;
  10.623 -        if (modeline->privsize) {
  10.624 -            oldreq->length += modeline->privsize;
  10.625 -            Data32(dpy, (long *) modeline->private,
  10.626 -                   modeline->privsize * sizeof(INT32));
  10.627 -        }
  10.628 -    } else {
  10.629 -        GetReq(XF86VidModeDeleteModeLine, req);
  10.630 -        req->reqType = info->codes->major_opcode;
  10.631 -        req->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
  10.632 -        req->screen = screen;
  10.633 -        req->dotclock = modeline->dotclock;
  10.634 -        req->hdisplay = modeline->hdisplay;
  10.635 -        req->hsyncstart = modeline->hsyncstart;
  10.636 -        req->hsyncend = modeline->hsyncend;
  10.637 -        req->htotal = modeline->htotal;
  10.638 -        req->hskew = modeline->hskew;
  10.639 -        req->vdisplay = modeline->vdisplay;
  10.640 -        req->vsyncstart = modeline->vsyncstart;
  10.641 -        req->vsyncend = modeline->vsyncend;
  10.642 -        req->vtotal = modeline->vtotal;
  10.643 -        req->flags = modeline->flags;
  10.644 -        req->privsize = modeline->privsize;
  10.645 -        if (modeline->privsize) {
  10.646 -            req->length += modeline->privsize;
  10.647 -            Data32(dpy, (long *) modeline->private,
  10.648 -                   modeline->privsize * sizeof(INT32));
  10.649 -        }
  10.650 -    }
  10.651 -    UnlockDisplay(dpy);
  10.652 -    SyncHandle();
  10.653 -    return True;
  10.654 -}
  10.655 -
  10.656 -Bool SDL_NAME(XF86VidModeModModeLine) (dpy, screen, modeline)
  10.657 -     Display *
  10.658 -         dpy;
  10.659 -     int
  10.660 -         screen;
  10.661 -SDL_NAME(XF86VidModeModeLine) * modeline;
  10.662 -{
  10.663 -    XExtDisplayInfo *info = find_display(dpy);
  10.664 -    xXF86VidModeModModeLineReq *req;
  10.665 -    xXF86OldVidModeModModeLineReq *oldreq;
  10.666 -    int majorVersion, minorVersion;
  10.667 -
  10.668 -    XF86VidModeCheckExtension(dpy, info, 0);
  10.669 -    SDL_NAME(XF86VidModeQueryVersion) (dpy, &majorVersion, &minorVersion);
  10.670 -
  10.671 -    LockDisplay(dpy);
  10.672 -    if (majorVersion < 2) {
  10.673 -        GetOldReq(XF86VidModeModModeLine, XF86OldVidModeModModeLine, oldreq);
  10.674 -        oldreq->reqType = info->codes->major_opcode;
  10.675 -        oldreq->xf86vidmodeReqType = X_XF86VidModeModModeLine;
  10.676 -        oldreq->screen = screen;
  10.677 -        oldreq->hdisplay = modeline->hdisplay;
  10.678 -        oldreq->hsyncstart = modeline->hsyncstart;
  10.679 -        oldreq->hsyncend = modeline->hsyncend;
  10.680 -        oldreq->htotal = modeline->htotal;
  10.681 -        oldreq->vdisplay = modeline->vdisplay;
  10.682 -        oldreq->vsyncstart = modeline->vsyncstart;
  10.683 -        oldreq->vsyncend = modeline->vsyncend;
  10.684 -        oldreq->vtotal = modeline->vtotal;
  10.685 -        oldreq->flags = modeline->flags;
  10.686 -        oldreq->privsize = modeline->privsize;
  10.687 -        if (modeline->privsize) {
  10.688 -            oldreq->length += modeline->privsize;
  10.689 -            Data32(dpy, (long *) modeline->private,
  10.690 -                   modeline->privsize * sizeof(INT32));
  10.691 -        }
  10.692 -    } else {
  10.693 -        GetReq(XF86VidModeModModeLine, req);
  10.694 -        req->reqType = info->codes->major_opcode;
  10.695 -        req->xf86vidmodeReqType = X_XF86VidModeModModeLine;
  10.696 -        req->screen = screen;
  10.697 -        req->hdisplay = modeline->hdisplay;
  10.698 -        req->hsyncstart = modeline->hsyncstart;
  10.699 -        req->hsyncend = modeline->hsyncend;
  10.700 -        req->htotal = modeline->htotal;
  10.701 -        req->hskew = modeline->hskew;
  10.702 -        req->vdisplay = modeline->vdisplay;
  10.703 -        req->vsyncstart = modeline->vsyncstart;
  10.704 -        req->vsyncend = modeline->vsyncend;
  10.705 -        req->vtotal = modeline->vtotal;
  10.706 -        req->flags = modeline->flags;
  10.707 -        req->privsize = modeline->privsize;
  10.708 -        if (modeline->privsize) {
  10.709 -            req->length += modeline->privsize;
  10.710 -            Data32(dpy, (long *) modeline->private,
  10.711 -                   modeline->privsize * sizeof(INT32));
  10.712 -        }
  10.713 -    }
  10.714 -    UnlockDisplay(dpy);
  10.715 -    SyncHandle();
  10.716 -    return True;
  10.717 -}
  10.718 -
  10.719 -Status SDL_NAME(XF86VidModeValidateModeLine) (dpy, screen, modeline)
  10.720 -     Display *
  10.721 -         dpy;
  10.722 -     int
  10.723 -         screen;
  10.724 -SDL_NAME(XF86VidModeModeInfo) * modeline;
  10.725 -{
  10.726 -    XExtDisplayInfo *info = find_display(dpy);
  10.727 -    xXF86VidModeValidateModeLineReq *req;
  10.728 -    xXF86OldVidModeValidateModeLineReq *oldreq;
  10.729 -    xXF86VidModeValidateModeLineReply rep;
  10.730 -    int majorVersion, minorVersion;
  10.731 -
  10.732 -    XF86VidModeCheckExtension(dpy, info, 0);
  10.733 -    SDL_NAME(XF86VidModeQueryVersion) (dpy, &majorVersion, &minorVersion);
  10.734 -
  10.735 -    LockDisplay(dpy);
  10.736 -
  10.737 -    if (majorVersion < 2) {
  10.738 -        GetOldReq(XF86VidModeValidateModeLine,
  10.739 -                  XF86OldVidModeValidateModeLine, oldreq);
  10.740 -        oldreq->reqType = info->codes->major_opcode;
  10.741 -        oldreq->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
  10.742 -        oldreq->screen = screen;
  10.743 -        oldreq->dotclock = modeline->dotclock;
  10.744 -        oldreq->hdisplay = modeline->hdisplay;
  10.745 -        oldreq->hsyncstart = modeline->hsyncstart;
  10.746 -        oldreq->hsyncend = modeline->hsyncend;
  10.747 -        oldreq->htotal = modeline->htotal;
  10.748 -        oldreq->vdisplay = modeline->vdisplay;
  10.749 -        oldreq->vsyncstart = modeline->vsyncstart;
  10.750 -        oldreq->vsyncend = modeline->vsyncend;
  10.751 -        oldreq->vtotal = modeline->vtotal;
  10.752 -        oldreq->flags = modeline->flags;
  10.753 -        oldreq->privsize = modeline->privsize;
  10.754 -        if (modeline->privsize) {
  10.755 -            oldreq->length += modeline->privsize;
  10.756 -            Data32(dpy, (long *) modeline->private,
  10.757 -                   modeline->privsize * sizeof(INT32));
  10.758 -        }
  10.759 -    } else {
  10.760 -        GetReq(XF86VidModeValidateModeLine, req);
  10.761 -        req->reqType = info->codes->major_opcode;
  10.762 -        req->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
  10.763 -        req->screen = screen;
  10.764 -        req->dotclock = modeline->dotclock;
  10.765 -        req->hdisplay = modeline->hdisplay;
  10.766 -        req->hsyncstart = modeline->hsyncstart;
  10.767 -        req->hsyncend = modeline->hsyncend;
  10.768 -        req->htotal = modeline->htotal;
  10.769 -        req->hskew = modeline->hskew;
  10.770 -        req->vdisplay = modeline->vdisplay;
  10.771 -        req->vsyncstart = modeline->vsyncstart;
  10.772 -        req->vsyncend = modeline->vsyncend;
  10.773 -        req->vtotal = modeline->vtotal;
  10.774 -        req->flags = modeline->flags;
  10.775 -        req->privsize = modeline->privsize;
  10.776 -        if (modeline->privsize) {
  10.777 -            req->length += modeline->privsize;
  10.778 -            Data32(dpy, (long *) modeline->private,
  10.779 -                   modeline->privsize * sizeof(INT32));
  10.780 -        }
  10.781 -    }
  10.782 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
  10.783 -        UnlockDisplay(dpy);
  10.784 -        SyncHandle();
  10.785 -        return MODE_BAD;
  10.786 -    }
  10.787 -    UnlockDisplay(dpy);
  10.788 -    SyncHandle();
  10.789 -    return rep.status;
  10.790 -}
  10.791 -
  10.792 -Bool SDL_NAME(XF86VidModeSwitchMode) (dpy, screen, zoom)
  10.793 -     Display *
  10.794 -         dpy;
  10.795 -     int
  10.796 -         screen;
  10.797 -     int
  10.798 -         zoom;
  10.799 -{
  10.800 -    XExtDisplayInfo *info = find_display(dpy);
  10.801 -    xXF86VidModeSwitchModeReq *req;
  10.802 -
  10.803 -    XF86VidModeCheckExtension(dpy, info, False);
  10.804 -
  10.805 -    LockDisplay(dpy);
  10.806 -    GetReq(XF86VidModeSwitchMode, req);
  10.807 -    req->reqType = info->codes->major_opcode;
  10.808 -    req->xf86vidmodeReqType = X_XF86VidModeSwitchMode;
  10.809 -    req->screen = screen;
  10.810 -    req->zoom = zoom;
  10.811 -    UnlockDisplay(dpy);
  10.812 -    SyncHandle();
  10.813 -    return True;
  10.814 -}
  10.815 -
  10.816 -Bool SDL_NAME(XF86VidModeSwitchToMode) (dpy, screen, modeline)
  10.817 -     Display *
  10.818 -         dpy;
  10.819 -     int
  10.820 -         screen;
  10.821 -SDL_NAME(XF86VidModeModeInfo) * modeline;
  10.822 -{
  10.823 -    XExtDisplayInfo *info = find_display(dpy);
  10.824 -    xXF86VidModeSwitchToModeReq *req;
  10.825 -    xXF86OldVidModeSwitchToModeReq *oldreq;
  10.826 -    int majorVersion, minorVersion;
  10.827 -    Bool protocolBug = False;
  10.828 -
  10.829 -    XF86VidModeCheckExtension(dpy, info, False);
  10.830 -
  10.831 -    /*
  10.832 -     * Note: There was a bug in the protocol implementation in versions
  10.833 -     * 0.x with x < 8 (the .private field wasn't expected to be sent over
  10.834 -     * the wire).  Check the server's version, and accept the old format
  10.835 -     * if appropriate.
  10.836 -     */
  10.837 -
  10.838 -    SDL_NAME(XF86VidModeQueryVersion) (dpy, &majorVersion, &minorVersion);
  10.839 -    if (majorVersion == 0 && minorVersion < 8) {
  10.840 -        protocolBug = True;
  10.841 -#ifdef DEBUG
  10.842 -        fprintf(stderr, "XF86VidModeSwitchToMode: Warning: Xserver is"
  10.843 -                "running an old version (%d.%d)\n", majorVersion,
  10.844 -                minorVersion);
  10.845 -#endif
  10.846 -    }
  10.847 -
  10.848 -    LockDisplay(dpy);
  10.849 -    if (majorVersion < 2) {
  10.850 -        GetOldReq(XF86VidModeSwitchToMode, XF86OldVidModeSwitchToMode,
  10.851 -                  oldreq);
  10.852 -        oldreq->reqType = info->codes->major_opcode;
  10.853 -        oldreq->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
  10.854 -        oldreq->screen = screen;
  10.855 -        oldreq->dotclock = modeline->dotclock;
  10.856 -        oldreq->hdisplay = modeline->hdisplay;
  10.857 -        oldreq->hsyncstart = modeline->hsyncstart;
  10.858 -        oldreq->hsyncend = modeline->hsyncend;
  10.859 -        oldreq->htotal = modeline->htotal;
  10.860 -        oldreq->vdisplay = modeline->vdisplay;
  10.861 -        oldreq->vsyncstart = modeline->vsyncstart;
  10.862 -        oldreq->vsyncend = modeline->vsyncend;
  10.863 -        oldreq->vtotal = modeline->vtotal;
  10.864 -        oldreq->flags = modeline->flags;
  10.865 -        if (protocolBug) {
  10.866 -            oldreq->privsize = 0;
  10.867 -        } else {
  10.868 -            oldreq->privsize = modeline->privsize;
  10.869 -            if (modeline->privsize) {
  10.870 -                oldreq->length += modeline->privsize;
  10.871 -                Data32(dpy, (long *) modeline->private,
  10.872 -                       modeline->privsize * sizeof(INT32));
  10.873 -            }
  10.874 -        }
  10.875 -    } else {
  10.876 -        GetReq(XF86VidModeSwitchToMode, req);
  10.877 -        req->reqType = info->codes->major_opcode;
  10.878 -        req->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
  10.879 -        req->screen = screen;
  10.880 -        req->dotclock = modeline->dotclock;
  10.881 -        req->hdisplay = modeline->hdisplay;
  10.882 -        req->hsyncstart = modeline->hsyncstart;
  10.883 -        req->hsyncend = modeline->hsyncend;
  10.884 -        req->htotal = modeline->htotal;
  10.885 -        req->hskew = modeline->hskew;
  10.886 -        req->vdisplay = modeline->vdisplay;
  10.887 -        req->vsyncstart = modeline->vsyncstart;
  10.888 -        req->vsyncend = modeline->vsyncend;
  10.889 -        req->vtotal = modeline->vtotal;
  10.890 -        req->flags = modeline->flags;
  10.891 -        if (protocolBug) {
  10.892 -            req->privsize = 0;
  10.893 -        } else {
  10.894 -            req->privsize = modeline->privsize;
  10.895 -            if (modeline->privsize) {
  10.896 -                req->length += modeline->privsize;
  10.897 -                Data32(dpy, (long *) modeline->private,
  10.898 -                       modeline->privsize * sizeof(INT32));
  10.899 -            }
  10.900 -        }
  10.901 -    }
  10.902 -    UnlockDisplay(dpy);
  10.903 -    SyncHandle();
  10.904 -    return True;
  10.905 -}
  10.906 -
  10.907 -Bool SDL_NAME(XF86VidModeLockModeSwitch) (dpy, screen, lock)
  10.908 -     Display *
  10.909 -         dpy;
  10.910 -     int
  10.911 -         screen;
  10.912 -     int
  10.913 -         lock;
  10.914 -{
  10.915 -    XExtDisplayInfo *info = find_display(dpy);
  10.916 -    xXF86VidModeLockModeSwitchReq *req;
  10.917 -
  10.918 -    XF86VidModeCheckExtension(dpy, info, False);
  10.919 -
  10.920 -    LockDisplay(dpy);
  10.921 -    GetReq(XF86VidModeLockModeSwitch, req);
  10.922 -    req->reqType = info->codes->major_opcode;
  10.923 -    req->xf86vidmodeReqType = X_XF86VidModeLockModeSwitch;
  10.924 -    req->screen = screen;
  10.925 -    req->lock = lock;
  10.926 -    UnlockDisplay(dpy);
  10.927 -    SyncHandle();
  10.928 -    return True;
  10.929 -}
  10.930 -
  10.931 -Bool SDL_NAME(XF86VidModeGetMonitor) (dpy, screen, monitor)
  10.932 -     Display *
  10.933 -         dpy;
  10.934 -     int
  10.935 -         screen;
  10.936 -SDL_NAME(XF86VidModeMonitor) * monitor;
  10.937 -{
  10.938 -    XExtDisplayInfo *info = find_display(dpy);
  10.939 -    xXF86VidModeGetMonitorReply rep;
  10.940 -    xXF86VidModeGetMonitorReq *req;
  10.941 -    CARD32 syncrange;
  10.942 -    int i;
  10.943 -
  10.944 -    XF86VidModeCheckExtension(dpy, info, False);
  10.945 -
  10.946 -    LockDisplay(dpy);
  10.947 -    GetReq(XF86VidModeGetMonitor, req);
  10.948 -    req->reqType = info->codes->major_opcode;
  10.949 -    req->xf86vidmodeReqType = X_XF86VidModeGetMonitor;
  10.950 -    req->screen = screen;
  10.951 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
  10.952 -        UnlockDisplay(dpy);
  10.953 -        SyncHandle();
  10.954 -        return False;
  10.955 -    }
  10.956 -    monitor->nhsync = rep.nhsync;
  10.957 -    monitor->nvsync = rep.nvsync;
  10.958 -#if 0
  10.959 -    monitor->bandwidth = (float) rep.bandwidth / 1e6;
  10.960 -#endif
  10.961 -    if (rep.vendorLength) {
  10.962 -        if (!(monitor->vendor = (char *) Xcalloc(rep.vendorLength + 1, 1))) {
  10.963 -            _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
  10.964 -                      ((rep.vendorLength + 3) & ~3) +
  10.965 -                      ((rep.modelLength + 3) & ~3));
  10.966 -            UnlockDisplay(dpy);
  10.967 -            SyncHandle();
  10.968 -            return False;
  10.969 -        }
  10.970 -    } else {
  10.971 -        monitor->vendor = NULL;
  10.972 -    }
  10.973 -    if (rep.modelLength) {
  10.974 -        if (!(monitor->model = Xcalloc(rep.modelLength + 1, 1))) {
  10.975 -            _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
  10.976 -                      ((rep.vendorLength + 3) & ~3) +
  10.977 -                      ((rep.modelLength + 3) & ~3));
  10.978 -            if (monitor->vendor)
  10.979 -                Xfree(monitor->vendor);
  10.980 -            UnlockDisplay(dpy);
  10.981 -            SyncHandle();
  10.982 -            return False;
  10.983 -        }
  10.984 -    } else {
  10.985 -        monitor->model = NULL;
  10.986 -    }
  10.987 -    if (!
  10.988 -        (monitor->hsync =
  10.989 -         Xcalloc(rep.nhsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
  10.990 -        _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
  10.991 -                  ((rep.vendorLength + 3) & ~3) +
  10.992 -                  ((rep.modelLength + 3) & ~3));
  10.993 -
  10.994 -        if (monitor->vendor)
  10.995 -            Xfree(monitor->vendor);
  10.996 -        if (monitor->model)
  10.997 -            Xfree(monitor->model);
  10.998 -        UnlockDisplay(dpy);
  10.999 -        SyncHandle();
 10.1000 -        return False;
 10.1001 -    }
 10.1002 -    if (!
 10.1003 -        (monitor->vsync =
 10.1004 -         Xcalloc(rep.nvsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
 10.1005 -        _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
 10.1006 -                  ((rep.vendorLength + 3) & ~3) +
 10.1007 -                  ((rep.modelLength + 3) & ~3));
 10.1008 -        if (monitor->vendor)
 10.1009 -            Xfree(monitor->vendor);
 10.1010 -        if (monitor->model)
 10.1011 -            Xfree(monitor->model);
 10.1012 -        Xfree(monitor->hsync);
 10.1013 -        UnlockDisplay(dpy);
 10.1014 -        SyncHandle();
 10.1015 -        return False;
 10.1016 -    }
 10.1017 -    for (i = 0; i < rep.nhsync; i++) {
 10.1018 -        _XRead(dpy, (char *) &syncrange, 4);
 10.1019 -        monitor->hsync[i].lo = (float) (syncrange & 0xFFFF) / 100.0;
 10.1020 -        monitor->hsync[i].hi = (float) (syncrange >> 16) / 100.0;
 10.1021 -    }
 10.1022 -    for (i = 0; i < rep.nvsync; i++) {
 10.1023 -        _XRead(dpy, (char *) &syncrange, 4);
 10.1024 -        monitor->vsync[i].lo = (float) (syncrange & 0xFFFF) / 100.0;
 10.1025 -        monitor->vsync[i].hi = (float) (syncrange >> 16) / 100.0;
 10.1026 -    }
 10.1027 -    if (rep.vendorLength)
 10.1028 -        _XReadPad(dpy, monitor->vendor, rep.vendorLength);
 10.1029 -    else
 10.1030 -        monitor->vendor = "";
 10.1031 -    if (rep.modelLength)
 10.1032 -        _XReadPad(dpy, monitor->model, rep.modelLength);
 10.1033 -    else
 10.1034 -        monitor->model = "";
 10.1035 -
 10.1036 -    UnlockDisplay(dpy);
 10.1037 -    SyncHandle();
 10.1038 -    return True;
 10.1039 -}
 10.1040 -
 10.1041 -Bool SDL_NAME(XF86VidModeGetViewPort) (dpy, screen, x, y)
 10.1042 -     Display *
 10.1043 -         dpy;
 10.1044 -     int
 10.1045 -         screen;
 10.1046 -     int *
 10.1047 -     x, *
 10.1048 -         y;
 10.1049 -{
 10.1050 -    XExtDisplayInfo *info = find_display(dpy);
 10.1051 -    xXF86VidModeGetViewPortReply rep;
 10.1052 -    xXF86VidModeGetViewPortReq *req;
 10.1053 -    int majorVersion, minorVersion;
 10.1054 -    Bool protocolBug = False;
 10.1055 -
 10.1056 -    XF86VidModeCheckExtension(dpy, info, False);
 10.1057 -
 10.1058 -    /*
 10.1059 -     * Note: There was a bug in the protocol implementation in versions
 10.1060 -     * 0.x with x < 8 (no reply was sent, so the client would hang)
 10.1061 -     * Check the server's version, and don't wait for a reply with older
 10.1062 -     * versions.
 10.1063 -     */
 10.1064 -
 10.1065 -    SDL_NAME(XF86VidModeQueryVersion) (dpy, &majorVersion, &minorVersion);
 10.1066 -    if (majorVersion == 0 && minorVersion < 8) {
 10.1067 -        protocolBug = True;
 10.1068 -#ifdef DEBUG
 10.1069 -        fprintf(stderr, "XF86VidModeGetViewPort: Warning: Xserver is"
 10.1070 -                "running an old version (%d.%d)\n", majorVersion,
 10.1071 -                minorVersion);
 10.1072 -#endif
 10.1073 -    }
 10.1074 -    LockDisplay(dpy);
 10.1075 -    GetReq(XF86VidModeGetViewPort, req);
 10.1076 -    req->reqType = info->codes->major_opcode;
 10.1077 -    req->xf86vidmodeReqType = X_XF86VidModeGetViewPort;
 10.1078 -    req->screen = screen;
 10.1079 -    if (protocolBug) {
 10.1080 -        *x = 0;
 10.1081 -        *y = 0;
 10.1082 -    } else {
 10.1083 -        if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
 10.1084 -            UnlockDisplay(dpy);
 10.1085 -            SyncHandle();
 10.1086 -            return False;
 10.1087 -        }
 10.1088 -        *x = rep.x;
 10.1089 -        *y = rep.y;
 10.1090 -    }
 10.1091 -
 10.1092 -    UnlockDisplay(dpy);
 10.1093 -    SyncHandle();
 10.1094 -    return True;
 10.1095 -}
 10.1096 -
 10.1097 -Bool SDL_NAME(XF86VidModeSetViewPort) (dpy, screen, x, y)
 10.1098 -     Display *
 10.1099 -         dpy;
 10.1100 -     int
 10.1101 -         screen;
 10.1102 -     int
 10.1103 -         x,
 10.1104 -         y;
 10.1105 -{
 10.1106 -    XExtDisplayInfo *info = find_display(dpy);
 10.1107 -    xXF86VidModeSetViewPortReq *req;
 10.1108 -
 10.1109 -    XF86VidModeCheckExtension(dpy, info, False);
 10.1110 -
 10.1111 -    LockDisplay(dpy);
 10.1112 -    GetReq(XF86VidModeSetViewPort, req);
 10.1113 -    req->reqType = info->codes->major_opcode;
 10.1114 -    req->xf86vidmodeReqType = X_XF86VidModeSetViewPort;
 10.1115 -    req->screen = screen;
 10.1116 -    req->x = x;
 10.1117 -    req->y = y;
 10.1118 -
 10.1119 -    UnlockDisplay(dpy);
 10.1120 -    SyncHandle();
 10.1121 -    return True;
 10.1122 -}
 10.1123 -
 10.1124 -Bool
 10.1125 -SDL_NAME(XF86VidModeGetDotClocks) (dpy, screen,
 10.1126 -                                   flagsPtr, numclocksPtr, maxclocksPtr,
 10.1127 -                                   clocksPtr)
 10.1128 -     Display *dpy;
 10.1129 -     int screen;
 10.1130 -     int *flagsPtr, *numclocksPtr, *maxclocksPtr, *clocksPtr[];
 10.1131 -{
 10.1132 -    XExtDisplayInfo *info = find_display(dpy);
 10.1133 -    xXF86VidModeGetDotClocksReply rep;
 10.1134 -    xXF86VidModeGetDotClocksReq *req;
 10.1135 -    int i, *dotclocks;
 10.1136 -    CARD32 dotclk;
 10.1137 -
 10.1138 -    XF86VidModeCheckExtension(dpy, info, False);
 10.1139 -
 10.1140 -    LockDisplay(dpy);
 10.1141 -    GetReq(XF86VidModeGetDotClocks, req);
 10.1142 -    req->reqType = info->codes->major_opcode;
 10.1143 -    req->xf86vidmodeReqType = X_XF86VidModeGetDotClocks;
 10.1144 -    req->screen = screen;
 10.1145 -    if (!_XReply(dpy, (xReply *) & rep,
 10.1146 -                 (SIZEOF(xXF86VidModeGetDotClocksReply) -
 10.1147 -                  SIZEOF(xReply)) >> 2, xFalse)) {
 10.1148 -        UnlockDisplay(dpy);
 10.1149 -        SyncHandle();
 10.1150 -        return False;
 10.1151 -    }
 10.1152 -    *numclocksPtr = rep.clocks;
 10.1153 -    *maxclocksPtr = rep.maxclocks;
 10.1154 -    *flagsPtr = rep.flags;
 10.1155 -
 10.1156 -    if (!(dotclocks = (int *) Xcalloc(rep.clocks, sizeof(int)))) {
 10.1157 -        _XEatData(dpy, (rep.clocks) * 4);
 10.1158 -        Xfree(dotclocks);
 10.1159 -        UnlockDisplay(dpy);
 10.1160 -        SyncHandle();
 10.1161 -        return False;
 10.1162 -    }
 10.1163 -
 10.1164 -    for (i = 0; i < rep.clocks; i++) {
 10.1165 -        _XRead(dpy, (char *) &dotclk, 4);
 10.1166 -        dotclocks[i] = dotclk;
 10.1167 -    }
 10.1168 -    *clocksPtr = dotclocks;
 10.1169 -    UnlockDisplay(dpy);
 10.1170 -    SyncHandle();
 10.1171 -    return True;
 10.1172 -}
 10.1173 -
 10.1174 -Bool
 10.1175 -SDL_NAME(XF86VidModeSetGammaRamp) (Display * dpy,
 10.1176 -                                   int screen,
 10.1177 -                                   int size,
 10.1178 -                                   unsigned short *red,
 10.1179 -                                   unsigned short *green,
 10.1180 -                                   unsigned short *blue)
 10.1181 -{
 10.1182 -    int length = (size + 1) & ~1;
 10.1183 -    XExtDisplayInfo *info = find_display(dpy);
 10.1184 -    xXF86VidModeSetGammaRampReq *req;
 10.1185 -
 10.1186 -    XF86VidModeCheckExtension(dpy, info, False);
 10.1187 -    LockDisplay(dpy);
 10.1188 -    GetReq(XF86VidModeSetGammaRamp, req);
 10.1189 -    req->reqType = info->codes->major_opcode;
 10.1190 -    req->xf86vidmodeReqType = X_XF86VidModeSetGammaRamp;
 10.1191 -    req->screen = screen;
 10.1192 -    req->length += (length >> 1) * 3;
 10.1193 -    req->size = size;
 10.1194 -    _XSend(dpy, (char *) red, size * 2);
 10.1195 -    _XSend(dpy, (char *) green, size * 2);
 10.1196 -    _XSend(dpy, (char *) blue, size * 2);
 10.1197 -    UnlockDisplay(dpy);
 10.1198 -    SyncHandle();
 10.1199 -    return True;
 10.1200 -}
 10.1201 -
 10.1202 -
 10.1203 -Bool
 10.1204 -SDL_NAME(XF86VidModeGetGammaRamp) (Display * dpy,
 10.1205 -                                   int screen,
 10.1206 -                                   int size,
 10.1207 -                                   unsigned short *red,
 10.1208 -                                   unsigned short *green,
 10.1209 -                                   unsigned short *blue)
 10.1210 -{
 10.1211 -    XExtDisplayInfo *info = find_display(dpy);
 10.1212 -    xXF86VidModeGetGammaRampReq *req;
 10.1213 -    xXF86VidModeGetGammaRampReply rep;
 10.1214 -
 10.1215 -    XF86VidModeCheckExtension(dpy, info, False);
 10.1216 -
 10.1217 -    LockDisplay(dpy);
 10.1218 -    GetReq(XF86VidModeGetGammaRamp, req);
 10.1219 -    req->reqType = info->codes->major_opcode;
 10.1220 -    req->xf86vidmodeReqType = X_XF86VidModeGetGammaRamp;
 10.1221 -    req->screen = screen;
 10.1222 -    req->size = size;
 10.1223 -    if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
 10.1224 -        UnlockDisplay(dpy);
 10.1225 -        SyncHandle();
 10.1226 -        return False;
 10.1227 -    }
 10.1228 -    if (rep.size) {
 10.1229 -        _XRead(dpy, (char *) red, rep.size << 1);
 10.1230 -        _XRead(dpy, (char *) green, rep.size << 1);
 10.1231 -        _XRead(dpy, (char *) blue, rep.size << 1);
 10.1232 -    }
 10.1233 -
 10.1234 -    UnlockDisplay(dpy);
 10.1235 -    SyncHandle();
 10.1236 -    return True;
 10.1237 -}
 10.1238 -
 10.1239 -Bool SDL_NAME(XF86VidModeGetGammaRampSize) (Display * dpy,
 10.1240 -                                            int screen, int *size)
 10.1241 -{
 10.1242 -    XExtDisplayInfo *info = find_display(dpy);
 10.1243 -    xXF86VidModeGetGammaRampSizeReq *req;
 10.1244 -    xXF86VidModeGetGammaRampSizeReply rep;
 10.1245 -
 10.1246 -    *size = 0;
 10.1247 -
 10.1248 -    XF86VidModeCheckExtension(dpy, info, False);
 10.1249 -
 10.1250 -    LockDisplay(dpy);
 10.1251 -    GetReq(XF86VidModeGetGammaRampSize, req);
 10.1252 -    req->reqType = info->codes->major_opcode;
 10.1253 -    req->xf86vidmodeReqType = X_XF86VidModeGetGammaRampSize;
 10.1254 -    req->screen = screen;
 10.1255 -    if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
 10.1256 -        UnlockDisplay(dpy);
 10.1257 -        SyncHandle();
 10.1258 -        return False;
 10.1259 -    }
 10.1260 -    *size = rep.size;
 10.1261 -    UnlockDisplay(dpy);
 10.1262 -    SyncHandle();
 10.1263 -    return True;
 10.1264 -}
 10.1265 -
 10.1266 -/* vi: set ts=4 sw=4 expandtab: */
    11.1 --- a/src/video/Xext/extensions/Xext.h	Sun Feb 27 22:22:58 2011 -0800
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,46 +0,0 @@
    11.4 -/*
    11.5 -Copyright 1989, 1998  The Open Group
    11.6 -
    11.7 -Permission to use, copy, modify, distribute, and sell this software and its
    11.8 -documentation for any purpose is hereby granted without fee, provided that
    11.9 -the above copyright notice appear in all copies and that both that
   11.10 -copyright notice and this permission notice appear in supporting
   11.11 -documentation.
   11.12 -
   11.13 -The above copyright notice and this permission notice shall be included in
   11.14 -all copies or substantial portions of the Software.
   11.15 -
   11.16 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   11.17 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   11.18 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   11.19 -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
   11.20 -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   11.21 -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   11.22 -
   11.23 -Except as contained in this notice, the name of The Open Group shall not be
   11.24 -used in advertising or otherwise to promote the sale, use or other dealings
   11.25 -in this Software without prior written authorization from The Open Group.
   11.26 - */
   11.27 -/* $XFree86: xc/include/extensions/Xext.h,v 1.7 2005/01/27 03:03:09 dawes Exp $ */
   11.28 -
   11.29 -#ifndef _XEXT_H_
   11.30 -#define _XEXT_H_
   11.31 -
   11.32 -#include <X11/Xfuncproto.h>
   11.33 -
   11.34 -_XFUNCPROTOBEGIN
   11.35 -    typedef int (*XExtensionErrorHandler) (Display *, _Xconst char *,
   11.36 -                                           _Xconst char *);
   11.37 -
   11.38 -extern XExtensionErrorHandler
   11.39 -XSetExtensionErrorHandler(XExtensionErrorHandler handler);
   11.40 -
   11.41 -extern int XMissingExtension(Display * /* dpy */ ,
   11.42 -                             _Xconst char *     /* ext_name */
   11.43 -    );
   11.44 -
   11.45 -_XFUNCPROTOEND
   11.46 -#define X_EXTENSION_UNKNOWN "unknown"
   11.47 -#define X_EXTENSION_MISSING "missing"
   11.48 -#endif /* _XEXT_H_ */
   11.49 -/* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/video/Xext/extensions/Xinerama.h	Sun Feb 27 22:22:58 2011 -0800
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,37 +0,0 @@
    12.4 -/* $XFree86: xc/include/extensions/Xinerama.h,v 3.2 2000/03/01 01:04:20 dawes Exp $ */
    12.5 -
    12.6 -#ifndef _Xinerama_h
    12.7 -#define _Xinerama_h
    12.8 -
    12.9 -#include "SDL_name.h"
   12.10 -
   12.11 -typedef struct
   12.12 -{
   12.13 -    int screen_number;
   12.14 -    short x_org;
   12.15 -    short y_org;
   12.16 -    short width;
   12.17 -    short height;
   12.18 -} SDL_NAME(XineramaScreenInfo);
   12.19 -
   12.20 -Bool SDL_NAME(XineramaQueryExtension) (Display * dpy,
   12.21 -                                       int *event_base, int *error_base);
   12.22 -
   12.23 -Status SDL_NAME(XineramaQueryVersion) (Display * dpy, int *major, int *minor);
   12.24 -
   12.25 -Bool SDL_NAME(XineramaIsActive) (Display * dpy);
   12.26 -
   12.27 -
   12.28 -/* 
   12.29 -   Returns the number of heads and a pointer to an array of
   12.30 -   structures describing the position and size of the individual
   12.31 -   heads.  Returns NULL and number = 0 if Xinerama is not active.
   12.32 -  
   12.33 -   Returned array should be freed with XFree().
   12.34 -*/
   12.35 -
   12.36 -SDL_NAME(XineramaScreenInfo) *
   12.37 -SDL_NAME(XineramaQueryScreens) (Display * dpy, int *number);
   12.38 -
   12.39 -#endif /* _Xinerama_h */
   12.40 -/* vi: set ts=4 sw=4 expandtab: */
    13.1 --- a/src/video/Xext/extensions/Xv.h	Sun Feb 27 22:22:58 2011 -0800
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,129 +0,0 @@
    13.4 -/***********************************************************
    13.5 -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
    13.6 -and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
    13.7 -
    13.8 -                        All Rights Reserved
    13.9 -
   13.10 -Permission to use, copy, modify, and distribute this software and its 
   13.11 -documentation for any purpose and without fee is hereby granted, 
   13.12 -provided that the above copyright notice appear in all copies and that
   13.13 -both that copyright notice and this permission notice appear in 
   13.14 -supporting documentation, and that the names of Digital or MIT not be
   13.15 -used in advertising or publicity pertaining to distribution of the
   13.16 -software without specific, written prior permission.  
   13.17 -
   13.18 -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   13.19 -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
   13.20 -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
   13.21 -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
   13.22 -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
   13.23 -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
   13.24 -SOFTWARE.
   13.25 -
   13.26 -******************************************************************/
   13.27 -/* $XFree86: xc/include/extensions/Xv.h,v 1.5 1999/12/11 19:28:48 mvojkovi Exp $ */
   13.28 -
   13.29 -#ifndef XV_H
   13.30 -#define XV_H
   13.31 -/*
   13.32 -** File: 
   13.33 -**
   13.34 -**   Xv.h --- Xv shared library and server header file
   13.35 -**
   13.36 -** Author: 
   13.37 -**
   13.38 -**   David Carver (Digital Workstation Engineering/Project Athena)
   13.39 -**
   13.40 -** Revisions:
   13.41 -**
   13.42 -**   05.15.91 Carver
   13.43 -**     - version 2.0 upgrade
   13.44 -**
   13.45 -**   01.24.91 Carver
   13.46 -**     - version 1.4 upgrade
   13.47 -**
   13.48 -*/
   13.49 -
   13.50 -#include <X11/X.h>
   13.51 -
   13.52 -#define XvName "XVideo"
   13.53 -#define XvVersion 2
   13.54 -#define XvRevision 2
   13.55 -
   13.56 -/* Symbols */
   13.57 -
   13.58 -typedef XID XvPortID;
   13.59 -typedef XID XvEncodingID;
   13.60 -
   13.61 -#define XvNone 0
   13.62 -
   13.63 -#define XvInput          0
   13.64 -#define XvOutput         1
   13.65 -
   13.66 -#define XvInputMask      (1L<<XvInput)
   13.67 -#define XvOutputMask     (1L<<XvOutput)
   13.68 -#define XvVideoMask	 0x00000004
   13.69 -#define XvStillMask	 0x00000008
   13.70 -#define XvImageMask	 0x00000010
   13.71 -
   13.72 -/* These two are not client viewable */
   13.73 -#define XvPixmapMask	 0x00010000
   13.74 -#define XvWindowMask	 0x00020000
   13.75 -
   13.76 -
   13.77 -#define XvGettable	0x01
   13.78 -#define XvSettable	0x02
   13.79 -
   13.80 -#define XvRGB		0
   13.81 -#define XvYUV		1
   13.82 -
   13.83 -#define XvPacked	0
   13.84 -#define XvPlanar	1
   13.85 -
   13.86 -#define XvTopToBottom	0
   13.87 -#define XvBottomToTop	1
   13.88 -
   13.89 -
   13.90 -/* Events */
   13.91 -
   13.92 -#define XvVideoNotify 0
   13.93 -#define XvPortNotify 1
   13.94 -#define XvNumEvents 2
   13.95 -
   13.96 -/* Video Notify Reasons */
   13.97 -
   13.98 -#define XvStarted 0
   13.99 -#define XvStopped 1
  13.100 -#define XvBusy 2
  13.101 -#define XvPreempted 3
  13.102 -#define XvHardError 4
  13.103 -#define XvLastReason 4
  13.104 -
  13.105 -#define XvNumReasons (XvLastReason + 1)
  13.106 -
  13.107 -#define XvStartedMask     (1L<<XvStarted)
  13.108 -#define XvStoppedMask     (1L<<XvStopped)
  13.109 -#define XvBusyMask        (1L<<XvBusy)
  13.110 -#define XvPreemptedMask   (1L<<XvPreempted)
  13.111 -#define XvHardErrorMask   (1L<<XvHardError)
  13.112 -
  13.113 -#define XvAnyReasonMask   ((1L<<XvNumReasons) - 1)
  13.114 -#define XvNoReasonMask    0
  13.115 -
  13.116 -/* Errors */
  13.117 -
  13.118 -#define XvBadPort 0
  13.119 -#define XvBadEncoding 1
  13.120 -#define XvBadControl 2
  13.121 -#define XvNumErrors 3
  13.122 -
  13.123 -/* Status */
  13.124 -
  13.125 -#define XvBadExtension 1
  13.126 -#define XvAlreadyGrabbed 2
  13.127 -#define XvInvalidTime 3
  13.128 -#define XvBadReply 4
  13.129 -#define XvBadAlloc 5
  13.130 -
  13.131 -#endif /* XV_H */
  13.132 -/* vi: set ts=4 sw=4 expandtab: */
    14.1 --- a/src/video/Xext/extensions/Xvlib.h	Sun Feb 27 22:22:58 2011 -0800
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,455 +0,0 @@
    14.4 -/***********************************************************
    14.5 -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
    14.6 -and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
    14.7 -
    14.8 -                        All Rights Reserved
    14.9 -
   14.10 -Permission to use, copy, modify, and distribute this software and its 
   14.11 -documentation for any purpose and without fee is hereby granted, 
   14.12 -provided that the above copyright notice appear in all copies and that
   14.13 -both that copyright notice and this permission notice appear in 
   14.14 -supporting documentation, and that the names of Digital or MIT not be
   14.15 -used in advertising or publicity pertaining to distribution of the
   14.16 -software without specific, written prior permission.  
   14.17 -
   14.18 -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   14.19 -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
   14.20 -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
   14.21 -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
   14.22 -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
   14.23 -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
   14.24 -SOFTWARE.
   14.25 -
   14.26 -******************************************************************/
   14.27 -/* $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $ */
   14.28 -
   14.29 -#ifndef XVLIB_H
   14.30 -#define XVLIB_H
   14.31 -/*
   14.32 -** File: 
   14.33 -**
   14.34 -**   Xvlib.h --- Xv library public header file
   14.35 -**
   14.36 -** Author: 
   14.37 -**
   14.38 -**   David Carver (Digital Workstation Engineering/Project Athena)
   14.39 -**
   14.40 -** Revisions:
   14.41 -**
   14.42 -**   26.06.91 Carver
   14.43 -**     - changed XvFreeAdaptors to XvFreeAdaptorInfo
   14.44 -**     - changed XvFreeEncodings to XvFreeEncodingInfo
   14.45 -**
   14.46 -**   11.06.91 Carver
   14.47 -**     - changed SetPortControl to SetPortAttribute
   14.48 -**     - changed GetPortControl to GetPortAttribute
   14.49 -**     - changed QueryBestSize
   14.50 -**
   14.51 -**   05.15.91 Carver
   14.52 -**     - version 2.0 upgrade
   14.53 -**
   14.54 -**   01.24.91 Carver
   14.55 -**     - version 1.4 upgrade
   14.56 -**
   14.57 -*/
   14.58 -
   14.59 -#include <X11/Xfuncproto.h>
   14.60 -#include "Xv.h"
   14.61 -#include "SDL_name.h"
   14.62 -
   14.63 -typedef struct
   14.64 -{
   14.65 -    int numerator;
   14.66 -    int denominator;
   14.67 -} SDL_NAME(XvRational);
   14.68 -
   14.69 -typedef struct
   14.70 -{
   14.71 -    int flags;                  /* XvGettable, XvSettable */
   14.72 -    int min_value;
   14.73 -    int max_value;
   14.74 -    char *name;
   14.75 -} SDL_NAME(XvAttribute);
   14.76 -
   14.77 -typedef struct
   14.78 -{
   14.79 -    XvEncodingID encoding_id;
   14.80 -    char *name;
   14.81 -    unsigned long width;
   14.82 -    unsigned long height;
   14.83 -      SDL_NAME(XvRational) rate;
   14.84 -    unsigned long num_encodings;
   14.85 -} SDL_NAME(XvEncodingInfo);
   14.86 -
   14.87 -typedef struct
   14.88 -{
   14.89 -    char depth;
   14.90 -    unsigned long visual_id;
   14.91 -} SDL_NAME(XvFormat);
   14.92 -
   14.93 -typedef struct
   14.94 -{
   14.95 -    XvPortID base_id;
   14.96 -    unsigned long num_ports;
   14.97 -    char type;
   14.98 -    char *name;
   14.99 -    unsigned long num_formats;
  14.100 -      SDL_NAME(XvFormat) * formats;
  14.101 -    unsigned long num_adaptors;
  14.102 -} SDL_NAME(XvAdaptorInfo);
  14.103 -
  14.104 -typedef struct
  14.105 -{
  14.106 -    int type;
  14.107 -    unsigned long serial;       /* # of last request processed by server */
  14.108 -    Bool send_event;            /* true if this came from a SendEvent request */
  14.109 -    Display *display;           /* Display the event was read from */
  14.110 -    Drawable drawable;          /* drawable */
  14.111 -    unsigned long reason;       /* what generated this event */
  14.112 -    XvPortID port_id;           /* what port */
  14.113 -    Time time;                  /* milliseconds */
  14.114 -} SDL_NAME(XvVideoNotifyEvent);
  14.115 -
  14.116 -typedef struct
  14.117 -{
  14.118 -    int type;
  14.119 -    unsigned long serial;       /* # of last request processed by server */
  14.120 -    Bool send_event;            /* true if this came from a SendEvent request */
  14.121 -    Display *display;           /* Display the event was read from */
  14.122 -    XvPortID port_id;           /* what port */
  14.123 -    Time time;                  /* milliseconds */
  14.124 -    Atom attribute;             /* atom that identifies attribute */
  14.125 -    long value;                 /* value of attribute */
  14.126 -} SDL_NAME(XvPortNotifyEvent);
  14.127 -
  14.128 -typedef union
  14.129 -{
  14.130 -    int type;
  14.131 -      SDL_NAME(XvVideoNotifyEvent) xvvideo;
  14.132 -      SDL_NAME(XvPortNotifyEvent) xvport;
  14.133 -    long pad[24];
  14.134 -} SDL_NAME(XvEvent);
  14.135 -
  14.136 -typedef struct
  14.137 -{
  14.138 -    int id;                     /* Unique descriptor for the format */
  14.139 -    int type;                   /* XvRGB, XvYUV */
  14.140 -    int byte_order;             /* LSBFirst, MSBFirst */
  14.141 -    char guid[16];              /* Globally Unique IDentifier */
  14.142 -    int bits_per_pixel;
  14.143 -    int format;                 /* XvPacked, XvPlanar */
  14.144 -    int num_planes;
  14.145 -
  14.146 -    /* for RGB formats only */
  14.147 -    int depth;
  14.148 -    unsigned int red_mask;
  14.149 -    unsigned int green_mask;
  14.150 -    unsigned int blue_mask;
  14.151 -
  14.152 -    /* for YUV formats only */
  14.153 -    unsigned int y_sample_bits;
  14.154 -    unsigned int u_sample_bits;
  14.155 -    unsigned int v_sample_bits;
  14.156 -    unsigned int horz_y_period;
  14.157 -    unsigned int horz_u_period;
  14.158 -    unsigned int horz_v_period;
  14.159 -    unsigned int vert_y_period;
  14.160 -    unsigned int vert_u_period;
  14.161 -    unsigned int vert_v_period;
  14.162 -    char component_order[32];   /* eg. UYVY */
  14.163 -    int scanline_order;         /* XvTopToBottom, XvBottomToTop */
  14.164 -} SDL_NAME(XvImageFormatValues);
  14.165 -
  14.166 -typedef struct
  14.167 -{
  14.168 -    int id;
  14.169 -    int width, height;
  14.170 -    int data_size;              /* bytes */
  14.171 -    int num_planes;
  14.172 -    int *pitches;               /* bytes */
  14.173 -    int *offsets;               /* bytes */
  14.174 -    char *data;
  14.175 -    XPointer obdata;
  14.176 -} SDL_NAME(XvImage);
  14.177 -
  14.178 -_XFUNCPROTOBEGIN extern int SDL_NAME(XvQueryExtension) (
  14.179 -#if NeedFunctionPrototypes
  14.180 -                                                           Display *
  14.181 -                                                           /* display */ ,
  14.182 -                                                           unsigned int *
  14.183 -                                                           /* p_version */ ,
  14.184 -                                                           unsigned int *
  14.185 -                                                           /* p_revision */ ,
  14.186 -                                                           unsigned int *
  14.187 -                                                           /* p_requestBase */
  14.188 -                                                           , unsigned int *
  14.189 -                                                           /* p_eventBase */
  14.190 -                                                           , unsigned int *     /* p_errorBase */
  14.191 -#endif
  14.192 -    );
  14.193 -
  14.194 -extern int SDL_NAME(XvQueryAdaptors) (
  14.195 -#if NeedFunctionPrototypes
  14.196 -                                         Display * /* display */ ,
  14.197 -                                         Window /* window */ ,
  14.198 -                                         unsigned int * /* p_nAdaptors */ ,
  14.199 -                                         SDL_NAME(XvAdaptorInfo) **     /* p_pAdaptors */
  14.200 -#endif
  14.201 -    );
  14.202 -
  14.203 -extern int SDL_NAME(XvQueryEncodings) (
  14.204 -#if NeedFunctionPrototypes
  14.205 -                                          Display * /* display */ ,
  14.206 -                                          XvPortID /* port */ ,
  14.207 -                                          unsigned int * /* p_nEncoding */ ,
  14.208 -                                          SDL_NAME(XvEncodingInfo) **   /* p_pEncoding */
  14.209 -#endif
  14.210 -    );
  14.211 -
  14.212 -extern int SDL_NAME(XvPutVideo) (
  14.213 -#if NeedFunctionPrototypes
  14.214 -                                    Display * /* display */ ,
  14.215 -                                    XvPortID /* port */ ,
  14.216 -                                    Drawable /* d */ ,
  14.217 -                                    GC /* gc */ ,
  14.218 -                                    int /* vx */ ,
  14.219 -                                    int /* vy */ ,
  14.220 -                                    unsigned int /* vw */ ,
  14.221 -                                    unsigned int /* vh */ ,
  14.222 -                                    int /* dx */ ,
  14.223 -                                    int /* dy */ ,
  14.224 -                                    unsigned int /* dw */ ,
  14.225 -                                    unsigned int        /* dh */
  14.226 -#endif
  14.227 -    );
  14.228 -
  14.229 -extern int SDL_NAME(XvPutStill) (
  14.230 -#if NeedFunctionPrototypes
  14.231 -                                    Display * /* display */ ,
  14.232 -                                    XvPortID /* port */ ,
  14.233 -                                    Drawable /* d */ ,
  14.234 -                                    GC /* gc */ ,
  14.235 -                                    int /* vx */ ,
  14.236 -                                    int /* vy */ ,
  14.237 -                                    unsigned int /* vw */ ,
  14.238 -                                    unsigned int /* vh */ ,
  14.239 -                                    int /* dx */ ,
  14.240 -                                    int /* dy */ ,
  14.241 -                                    unsigned int /* dw */ ,
  14.242 -                                    unsigned int        /* dh */
  14.243 -#endif
  14.244 -    );
  14.245 -
  14.246 -extern int SDL_NAME(XvGetVideo) (
  14.247 -#if NeedFunctionPrototypes
  14.248 -                                    Display * /* display */ ,
  14.249 -                                    XvPortID /* port */ ,
  14.250 -                                    Drawable /* d */ ,
  14.251 -                                    GC /* gc */ ,
  14.252 -                                    int /* vx */ ,
  14.253 -                                    int /* vy */ ,
  14.254 -                                    unsigned int /* vw */ ,
  14.255 -                                    unsigned int /* vh */ ,
  14.256 -                                    int /* dx */ ,
  14.257 -                                    int /* dy */ ,
  14.258 -                                    unsigned int /* dw */ ,
  14.259 -                                    unsigned int        /* dh */
  14.260 -#endif
  14.261 -    );
  14.262 -
  14.263 -extern int SDL_NAME(XvGetStill) (
  14.264 -#if NeedFunctionPrototypes
  14.265 -                                    Display * /* display */ ,
  14.266 -                                    XvPortID /* port */ ,
  14.267 -                                    Drawable /* d */ ,
  14.268 -                                    GC /* gc */ ,
  14.269 -                                    int /* vx */ ,
  14.270 -                                    int /* vy */ ,
  14.271 -                                    unsigned int /* vw */ ,
  14.272 -                                    unsigned int /* vh */ ,
  14.273 -                                    int /* dx */ ,
  14.274 -                                    int /* dy */ ,
  14.275 -                                    unsigned int /* dw */ ,
  14.276 -                                    unsigned int        /* dh */
  14.277 -#endif
  14.278 -    );
  14.279 -
  14.280 -extern int SDL_NAME(XvStopVideo) (
  14.281 -#if NeedFunctionPrototypes
  14.282 -                                     Display * /* display */ ,
  14.283 -                                     XvPortID /* port */ ,
  14.284 -                                     Drawable   /* drawable */
  14.285 -#endif
  14.286 -    );
  14.287 -
  14.288 -extern int SDL_NAME(XvGrabPort) (
  14.289 -#if NeedFunctionPrototypes
  14.290 -                                    Display * /* display */ ,
  14.291 -                                    XvPortID /* port */ ,
  14.292 -                                    Time        /* time */
  14.293 -#endif
  14.294 -    );
  14.295 -
  14.296 -extern int SDL_NAME(XvUngrabPort) (
  14.297 -#if NeedFunctionPrototypes
  14.298 -                                      Display * /* display */ ,
  14.299 -                                      XvPortID /* port */ ,
  14.300 -                                      Time      /* time */
  14.301 -#endif
  14.302 -    );
  14.303 -
  14.304 -extern int SDL_NAME(XvSelectVideoNotify) (
  14.305 -#if NeedFunctionPrototypes
  14.306 -                                             Display * /* display */ ,
  14.307 -                                             Drawable /* drawable */ ,
  14.308 -                                             Bool       /* onoff */
  14.309 -#endif
  14.310 -    );
  14.311 -
  14.312 -extern int SDL_NAME(XvSelectPortNotify) (
  14.313 -#if NeedFunctionPrototypes
  14.314 -                                            Display * /* display */ ,
  14.315 -                                            XvPortID /* port */ ,
  14.316 -                                            Bool        /* onoff */
  14.317 -#endif
  14.318 -    );
  14.319 -
  14.320 -extern int SDL_NAME(XvSetPortAttribute) (
  14.321 -#if NeedFunctionPrototypes
  14.322 -                                            Display * /* display */ ,
  14.323 -                                            XvPortID /* port */ ,
  14.324 -                                            Atom /* attribute */ ,
  14.325 -                                            int /* value */
  14.326 -#endif
  14.327 -    );
  14.328 -
  14.329 -extern int SDL_NAME(XvGetPortAttribute) (
  14.330 -#if NeedFunctionPrototypes
  14.331 -                                            Display * /* display */ ,
  14.332 -                                            XvPortID /* port */ ,
  14.333 -                                            Atom /* attribute */ ,
  14.334 -                                            int *       /* p_value */
  14.335 -#endif
  14.336 -    );
  14.337 -
  14.338 -extern int SDL_NAME(XvQueryBestSize) (
  14.339 -#if NeedFunctionPrototypes
  14.340 -                                         Display * /* display */ ,
  14.341 -                                         XvPortID /* port */ ,
  14.342 -                                         Bool /* motion */ ,
  14.343 -                                         unsigned int /* vid_w */ ,
  14.344 -                                         unsigned int /* vid_h */ ,
  14.345 -                                         unsigned int /* drw_w */ ,
  14.346 -                                         unsigned int /* drw_h */ ,
  14.347 -                                         unsigned int * /* p_actual_width */
  14.348 -                                         , unsigned int *       /* p_actual_width */
  14.349 -#endif
  14.350 -    );
  14.351 -
  14.352 -extern
  14.353 -SDL_NAME(XvAttribute) *
  14.354 -SDL_NAME(XvQueryPortAttributes) (
  14.355 -#if NeedFunctionPrototypes
  14.356 -                                    Display * /* display */ ,
  14.357 -                                    XvPortID /* port */ ,
  14.358 -                                    int *       /* number */
  14.359 -#endif
  14.360 -    );
  14.361 -
  14.362 -
  14.363 -     extern void SDL_NAME(XvFreeAdaptorInfo) (
  14.364 -#if NeedFunctionPrototypes
  14.365 -                                                 SDL_NAME(XvAdaptorInfo) *      /* adaptors */
  14.366 -#endif
  14.367 -    );
  14.368 -
  14.369 -     extern void SDL_NAME(XvFreeEncodingInfo) (
  14.370 -#if NeedFunctionPrototypes
  14.371 -                                                  SDL_NAME(XvEncodingInfo) *    /* encodings */
  14.372 -#endif
  14.373 -    );
  14.374 -
  14.375 -
  14.376 -     extern SDL_NAME(XvImageFormatValues) * SDL_NAME(XvListImageFormats) (
  14.377 -#if NeedFunctionPrototypes
  14.378 -                                                                             Display
  14.379 -                                                                             *
  14.380 -                                                                             display,
  14.381 -                                                                             XvPortID
  14.382 -                                                                             port_id,
  14.383 -                                                                             int
  14.384 -                                                                             *count_return
  14.385 -#endif
  14.386 -    );
  14.387 -
  14.388 -     extern SDL_NAME(XvImage) * SDL_NAME(XvCreateImage) (
  14.389 -#if NeedFunctionPrototypes
  14.390 -                                                            Display *
  14.391 -                                                            display,
  14.392 -                                                            XvPortID port,
  14.393 -                                                            int id,
  14.394 -                                                            char *data,
  14.395 -                                                            int width,
  14.396 -                                                            int height
  14.397 -#endif
  14.398 -    );
  14.399 -
  14.400 -     extern int SDL_NAME(XvPutImage) (
  14.401 -#if NeedFunctionPrototypes
  14.402 -                                         Display * display,
  14.403 -                                         XvPortID id,
  14.404 -                                         Drawable d,
  14.405 -                                         GC gc,
  14.406 -                                         SDL_NAME(XvImage) * image,
  14.407 -                                         int src_x,
  14.408 -                                         int src_y,
  14.409 -                                         unsigned int src_w,
  14.410 -                                         unsigned int src_h,
  14.411 -                                         int dest_x,
  14.412 -                                         int dest_y,
  14.413 -                                         unsigned int dest_w,
  14.414 -                                         unsigned int dest_h
  14.415 -#endif
  14.416 -    );
  14.417 -
  14.418 -     extern int SDL_NAME(XvShmPutImage) (
  14.419 -#if NeedFunctionPrototypes
  14.420 -                                            Display * display,
  14.421 -                                            XvPortID id,
  14.422 -                                            Drawable d,
  14.423 -                                            GC gc,
  14.424 -                                            SDL_NAME(XvImage) * image,
  14.425 -                                            int src_x,
  14.426 -                                            int src_y,
  14.427 -                                            unsigned int src_w,
  14.428 -                                            unsigned int src_h,
  14.429 -                                            int dest_x,
  14.430 -                                            int dest_y,
  14.431 -                                            unsigned int dest_w,
  14.432 -                                            unsigned int dest_h,
  14.433 -                                            Bool send_event
  14.434 -#endif
  14.435 -    );
  14.436 -
  14.437 -#ifdef _XSHM_H_
  14.438 -
  14.439 -     extern SDL_NAME(XvImage) * SDL_NAME(XvShmCreateImage) (
  14.440 -#if NeedFunctionPrototypes
  14.441 -                                                               Display *
  14.442 -                                                               display,
  14.443 -                                                               XvPortID
  14.444 -                                                               port, int id,
  14.445 -                                                               char *data,
  14.446 -                                                               int width,
  14.447 -                                                               int height,
  14.448 -                                                               XShmSegmentInfo
  14.449 -                                                               * shminfo
  14.450 -#endif
  14.451 -    );
  14.452 -
  14.453 -#endif
  14.454 -
  14.455 -
  14.456 -_XFUNCPROTOEND
  14.457 -#endif /* XVLIB_H */
  14.458 -/* vi: set ts=4 sw=4 expandtab: */
    15.1 --- a/src/video/Xext/extensions/Xvproto.h	Sun Feb 27 22:22:58 2011 -0800
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,644 +0,0 @@
    15.4 -/***********************************************************
    15.5 -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
    15.6 -and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
    15.7 -
    15.8 -                        All Rights Reserved
    15.9 -
   15.10 -Permission to use, copy, modify, and distribute this software and its 
   15.11 -documentation for any purpose and without fee is hereby granted, 
   15.12 -provided that the above copyright notice appear in all copies and that
   15.13 -both that copyright notice and this permission notice appear in 
   15.14 -supporting documentation, and that the names of Digital or MIT not be
   15.15 -used in advertising or publicity pertaining to distribution of the
   15.16 -software without specific, written prior permission.  
   15.17 -
   15.18 -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   15.19 -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
   15.20 -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
   15.21 -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
   15.22 -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
   15.23 -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
   15.24 -SOFTWARE.
   15.25 -
   15.26 -******************************************************************/
   15.27 -/* $XFree86: xc/include/extensions/Xvproto.h,v 1.6 2001/05/07 21:37:12 tsi Exp $ */
   15.28 -
   15.29 -#ifndef XVPROTO_H
   15.30 -#define XVPROTO_H
   15.31 -/*
   15.32 -** File: 
   15.33 -**
   15.34 -**   Xvproto.h --- Xv protocol header file
   15.35 -**
   15.36 -** Author: 
   15.37 -**
   15.38 -**   David Carver (Digital Workstation Engineering/Project Athena)
   15.39 -**
   15.40 -** Revisions:
   15.41 -**
   15.42 -**   11.06.91 Carver
   15.43 -**     - changed SetPortControl to SetPortAttribute
   15.44 -**     - changed GetPortControl to GetPortAttribute
   15.45 -**     - changed QueryBestSize
   15.46 -**
   15.47 -**   15.05.91 Carver
   15.48 -**     - version 2.0 upgrade
   15.49 -**
   15.50 -**   24.01.91 Carver
   15.51 -**     - version 1.4 upgrade
   15.52 -**
   15.53 -*/
   15.54 -
   15.55 -#include <X11/Xmd.h>
   15.56 -
   15.57 -/* Symbols: These are undefined at the end of this file to restore the
   15.58 -   values they have in Xv.h */
   15.59 -
   15.60 -#define XvPortID CARD32
   15.61 -#define XvEncodingID CARD32
   15.62 -#define ShmSeg CARD32
   15.63 -#define VisualID CARD32
   15.64 -#define Drawable CARD32
   15.65 -#define GContext CARD32
   15.66 -#define Time CARD32
   15.67 -#define Atom CARD32
   15.68 -
   15.69 -/* Structures */
   15.70 -
   15.71 -typedef struct
   15.72 -{
   15.73 -    INT32 numerator B32;
   15.74 -    INT32 denominator B32;
   15.75 -} xvRational;
   15.76 -#define sz_xvRational 8
   15.77 -
   15.78 -typedef struct
   15.79 -{
   15.80 -    XvPortID base_id B32;
   15.81 -    CARD16 name_size B16;
   15.82 -    CARD16 num_ports B16;
   15.83 -    CARD16 num_formats B16;
   15.84 -    CARD8 type;
   15.85 -    CARD8 pad;
   15.86 -} xvAdaptorInfo;
   15.87 -#define sz_xvAdaptorInfo 12
   15.88 -
   15.89 -typedef struct
   15.90 -{
   15.91 -    XvEncodingID encoding B32;
   15.92 -    CARD16 name_size B16;
   15.93 -    CARD16 width B16, height B16;
   15.94 -    xvRational rate;
   15.95 -    CARD16 pad B16;
   15.96 -} xvEncodingInfo;
   15.97 -#define sz_xvEncodingInfo (12 + sz_xvRational)
   15.98 -
   15.99 -typedef struct
  15.100 -{
  15.101 -    VisualID visual B32;
  15.102 -    CARD8 depth;
  15.103 -    CARD8 pad1;
  15.104 -    CARD16 pad2 B16;
  15.105 -} xvFormat;
  15.106 -#define sz_xvFormat 8
  15.107 -
  15.108 -typedef struct
  15.109 -{
  15.110 -    CARD32 flags B32;
  15.111 -    INT32 min B32;
  15.112 -    INT32 max B32;
  15.113 -    CARD32 size B32;
  15.114 -} xvAttributeInfo;
  15.115 -#define sz_xvAttributeInfo 16
  15.116 -
  15.117 -typedef struct
  15.118 -{
  15.119 -    CARD32 id B32;
  15.120 -    CARD8 type;
  15.121 -    CARD8 byte_order;
  15.122 -    CARD16 pad1 B16;
  15.123 -    CARD8 guid[16];
  15.124 -    CARD8 bpp;
  15.125 -    CARD8 num_planes;
  15.126 -    CARD16 pad2 B16;
  15.127 -    CARD8 depth;
  15.128 -    CARD8 pad3;
  15.129 -    CARD16 pad4 B16;
  15.130 -    CARD32 red_mask B32;
  15.131 -    CARD32 green_mask B32;
  15.132 -    CARD32 blue_mask B32;
  15.133 -    CARD8 format;
  15.134 -    CARD8 pad5;
  15.135 -    CARD16 pad6 B16;
  15.136 -    CARD32 y_sample_bits B32;
  15.137 -    CARD32 u_sample_bits B32;
  15.138 -    CARD32 v_sample_bits B32;
  15.139 -    CARD32 horz_y_period B32;
  15.140 -    CARD32 horz_u_period B32;
  15.141 -    CARD32 horz_v_period B32;
  15.142 -    CARD32 vert_y_period B32;
  15.143 -    CARD32 vert_u_period B32;
  15.144 -    CARD32 vert_v_period B32;
  15.145 -    CARD8 comp_order[32];
  15.146 -    CARD8 scanline_order;
  15.147 -    CARD8 pad7;
  15.148 -    CARD16 pad8 B16;
  15.149 -    CARD32 pad9 B32;
  15.150 -    CARD32 pad10 B32;
  15.151 -} xvImageFormatInfo;
  15.152 -#define sz_xvImageFormatInfo 128
  15.153 -
  15.154 -
  15.155 -/* Requests */
  15.156 -
  15.157 -#define xv_QueryExtension                  0
  15.158 -#define	xv_QueryAdaptors                   1
  15.159 -#define	xv_QueryEncodings                  2
  15.160 -#define xv_GrabPort                        3
  15.161 -#define xv_UngrabPort                      4
  15.162 -#define xv_PutVideo                        5
  15.163 -#define xv_PutStill                        6
  15.164 -#define xv_GetVideo                        7
  15.165 -#define xv_GetStill                        8
  15.166 -#define xv_StopVideo                       9
  15.167 -#define xv_SelectVideoNotify              10
  15.168 -#define xv_SelectPortNotify               11
  15.169 -#define xv_QueryBestSize                  12
  15.170 -#define xv_SetPortAttribute               13
  15.171 -#define xv_GetPortAttribute               14
  15.172 -#define xv_QueryPortAttributes            15
  15.173 -#define xv_ListImageFormats               16
  15.174 -#define xv_QueryImageAttributes           17
  15.175 -#define xv_PutImage                       18
  15.176 -#define xv_ShmPutImage                    19
  15.177 -#define xv_LastRequest                    xv_ShmPutImage
  15.178 -
  15.179 -#define xvNumRequests                     (xv_LastRequest + 1)
  15.180 -
  15.181 -typedef struct
  15.182 -{
  15.183 -    CARD8 reqType;
  15.184 -    CARD8 xvReqType;
  15.185 -    CARD16 length B16;
  15.186 -} xvQueryExtensionReq;
  15.187 -#define sz_xvQueryExtensionReq 4
  15.188 -
  15.189 -typedef struct
  15.190 -{
  15.191 -    CARD8 reqType;
  15.192 -    CARD8 xvReqType;
  15.193 -    CARD16 length B16;
  15.194 -    CARD32 window B32;
  15.195 -} xvQueryAdaptorsReq;
  15.196 -#define sz_xvQueryAdaptorsReq 8
  15.197 -
  15.198 -typedef struct
  15.199 -{
  15.200 -    CARD8 reqType;
  15.201 -    CARD8 xvReqType;
  15.202 -    CARD16 length B16;
  15.203 -    CARD32 port B32;
  15.204 -} xvQueryEncodingsReq;
  15.205 -#define sz_xvQueryEncodingsReq 8
  15.206 -
  15.207 -typedef struct
  15.208 -{
  15.209 -    CARD8 reqType;
  15.210 -    CARD8 xvReqType;
  15.211 -    CARD16 length B16;
  15.212 -    XvPortID port B32;
  15.213 -    Drawable drawable B32;
  15.214 -    GContext gc B32;
  15.215 -    INT16 vid_x B16;
  15.216 -    INT16 vid_y B16;
  15.217 -    CARD16 vid_w B16;
  15.218 -    CARD16 vid_h B16;
  15.219 -    INT16 drw_x B16;
  15.220 -    INT16 drw_y B16;
  15.221 -    CARD16 drw_w B16;
  15.222 -    CARD16 drw_h B16;
  15.223 -} xvPutVideoReq;
  15.224 -#define sz_xvPutVideoReq 32
  15.225 -
  15.226 -typedef struct
  15.227 -{
  15.228 -    CARD8 reqType;
  15.229 -    CARD8 xvReqType;
  15.230 -    CARD16 length B16;
  15.231 -    XvPortID port B32;
  15.232 -    Drawable drawable B32;
  15.233 -    GContext gc B32;
  15.234 -    INT16 vid_x B16;
  15.235 -    INT16 vid_y B16;
  15.236 -    CARD16 vid_w B16;
  15.237 -    CARD16 vid_h B16;
  15.238 -    INT16 drw_x B16;
  15.239 -    INT16 drw_y B16;
  15.240 -    CARD16 drw_w B16;
  15.241 -    CARD16 drw_h B16;
  15.242 -} xvPutStillReq;
  15.243 -#define sz_xvPutStillReq 32
  15.244 -
  15.245 -typedef struct
  15.246 -{
  15.247 -    CARD8 reqType;
  15.248 -    CARD8 xvReqType;
  15.249 -    CARD16 length B16;
  15.250 -    XvPortID port B32;
  15.251 -    Drawable drawable B32;
  15.252 -    GContext gc B32;
  15.253 -    INT16 vid_x B16;
  15.254 -    INT16 vid_y B16;
  15.255 -    CARD16 vid_w B16;
  15.256 -    CARD16 vid_h B16;
  15.257 -    INT16 drw_x B16;
  15.258 -    INT16 drw_y B16;
  15.259 -    CARD16 drw_w B16;
  15.260 -    CARD16 drw_h B16;
  15.261 -} xvGetVideoReq;
  15.262 -#define sz_xvGetVideoReq 32
  15.263 -
  15.264 -typedef struct
  15.265 -{
  15.266 -    CARD8 reqType;
  15.267 -    CARD8 xvReqType;
  15.268 -    CARD16 length B16;
  15.269 -    XvPortID port B32;
  15.270 -    Drawable drawable B32;
  15.271 -    GContext gc B32;
  15.272 -    INT16 vid_x B16;
  15.273 -    INT16 vid_y B16;
  15.274 -    CARD16 vid_w B16;
  15.275 -    CARD16 vid_h B16;
  15.276 -    INT16 drw_x B16;
  15.277 -    INT16 drw_y B16;
  15.278 -    CARD16 drw_w B16;
  15.279 -    CARD16 drw_h B16;
  15.280 -} xvGetStillReq;
  15.281 -#define sz_xvGetStillReq 32
  15.282 -
  15.283 -typedef struct
  15.284 -{
  15.285 -    CARD8 reqType;
  15.286 -    CARD8 xvReqType;
  15.287 -    CARD16 length B16;
  15.288 -    XvPortID port B32;
  15.289 -    Time time B32;
  15.290 -} xvGrabPortReq;
  15.291 -#define sz_xvGrabPortReq 12
  15.292 -
  15.293 -typedef struct
  15.294 -{
  15.295 -    CARD8 reqType;
  15.296 -    CARD8 xvReqType;
  15.297 -    CARD16 length B16;
  15.298 -    XvPortID port B32;
  15.299 -    Time time B32;
  15.300 -} xvUngrabPortReq;
  15.301 -#define sz_xvUngrabPortReq 12
  15.302 -
  15.303 -typedef struct
  15.304 -{
  15.305 -    CARD8 reqType;
  15.306 -    CARD8 xvReqType;
  15.307 -    CARD16 length B16;
  15.308 -    Drawable drawable B32;
  15.309 -    BOOL onoff;
  15.310 -    CARD8 pad1;
  15.311 -    CARD16 pad2;
  15.312 -} xvSelectVideoNotifyReq;
  15.313 -#define sz_xvSelectVideoNotifyReq 12
  15.314 -
  15.315 -typedef struct
  15.316 -{
  15.317 -    CARD8 reqType;
  15.318 -    CARD8 xvReqType;
  15.319 -    CARD16 length B16;
  15.320 -    XvPortID port B32;
  15.321 -    BOOL onoff;
  15.322 -    CARD8 pad1;
  15.323 -    CARD16 pad2;
  15.324 -} xvSelectPortNotifyReq;
  15.325 -#define sz_xvSelectPortNotifyReq 12
  15.326 -
  15.327 -typedef struct
  15.328 -{
  15.329 -    CARD8 reqType;
  15.330 -    CARD8 xvReqType;
  15.331 -    CARD16 length B16;
  15.332 -    XvPortID port B32;
  15.333 -    Drawable drawable B32;
  15.334 -} xvStopVideoReq;
  15.335 -#define sz_xvStopVideoReq 12
  15.336 -
  15.337 -typedef struct
  15.338 -{
  15.339 -    CARD8 reqType;
  15.340 -    CARD8 xvReqType;
  15.341 -    CARD16 length B16;
  15.342 -    XvPortID port B32;
  15.343 -    Atom attribute B32;
  15.344 -    INT32 value B32;
  15.345 -} xvSetPortAttributeReq;
  15.346 -#define sz_xvSetPortAttributeReq 16
  15.347 -
  15.348 -typedef struct
  15.349 -{
  15.350 -    CARD8 reqType;
  15.351 -    CARD8 xvReqType;
  15.352 -    CARD16 length B16;
  15.353 -    XvPortID port B32;
  15.354 -    Atom attribute B32;
  15.355 -} xvGetPortAttributeReq;
  15.356 -#define sz_xvGetPortAttributeReq 12
  15.357 -
  15.358 -typedef struct
  15.359 -{
  15.360 -    CARD8 reqType;
  15.361 -    CARD8 xvReqType;
  15.362 -    CARD16 length B16;
  15.363 -    XvPortID port B32;
  15.364 -    CARD16 vid_w B16;
  15.365 -    CARD16 vid_h B16;
  15.366 -    CARD16 drw_w B16;
  15.367 -    CARD16 drw_h B16;
  15.368 -    CARD8 motion;
  15.369 -    CARD8 pad1;
  15.370 -    CARD16 pad2 B16;
  15.371 -} xvQueryBestSizeReq;
  15.372 -#define sz_xvQueryBestSizeReq 20
  15.373 -
  15.374 -typedef struct
  15.375 -{
  15.376 -    CARD8 reqType;
  15.377 -    CARD8 xvReqType;
  15.378 -    CARD16 length B16;
  15.379 -    XvPortID port B32;
  15.380 -} xvQueryPortAttributesReq;
  15.381 -#define sz_xvQueryPortAttributesReq 8
  15.382 -
  15.383 -typedef struct
  15.384 -{
  15.385 -    CARD8 reqType;
  15.386 -    CARD8 xvReqType;
  15.387 -    CARD16 length B16;
  15.388 -    XvPortID port B32;
  15.389 -    Drawable drawable B32;
  15.390 -    GContext gc B32;
  15.391 -    CARD32 id B32;
  15.392 -    INT16 src_x B16;
  15.393 -    INT16 src_y B16;
  15.394 -    CARD16 src_w B16;
  15.395 -    CARD16 src_h B16;
  15.396 -    INT16 drw_x B16;
  15.397 -    INT16 drw_y B16;
  15.398 -    CARD16 drw_w B16;
  15.399 -    CARD16 drw_h B16;
  15.400 -    CARD16 width B16;
  15.401 -    CARD16 height B16;
  15.402 -} xvPutImageReq;
  15.403 -#define sz_xvPutImageReq 40
  15.404 -
  15.405 -typedef struct
  15.406 -{
  15.407 -    CARD8 reqType;
  15.408 -    CARD8 xvReqType;
  15.409 -    CARD16 length B16;
  15.410 -    XvPortID port B32;
  15.411 -    Drawable drawable B32;
  15.412 -    GContext gc B32;
  15.413 -    ShmSeg shmseg B32;
  15.414 -    CARD32 id B32;
  15.415 -    CARD32 offset B32;
  15.416 -    INT16 src_x B16;
  15.417 -    INT16 src_y B16;
  15.418 -    CARD16 src_w B16;
  15.419 -    CARD16 src_h B16;
  15.420 -    INT16 drw_x B16;
  15.421 -    INT16 drw_y B16;
  15.422 -    CARD16 drw_w B16;
  15.423 -    CARD16 drw_h B16;
  15.424 -    CARD16 width B16;
  15.425 -    CARD16 height B16;
  15.426 -    CARD8 send_event;
  15.427 -    CARD8 pad1;
  15.428 -    CARD16 pad2 B16;
  15.429 -} xvShmPutImageReq;
  15.430 -#define sz_xvShmPutImageReq 52
  15.431 -
  15.432 -typedef struct
  15.433 -{
  15.434 -    CARD8 reqType;
  15.435 -    CARD8 xvReqType;
  15.436 -    CARD16 length B16;
  15.437 -    XvPortID port B32;
  15.438 -} xvListImageFormatsReq;
  15.439 -#define sz_xvListImageFormatsReq 8
  15.440 -
  15.441 -typedef struct
  15.442 -{
  15.443 -    CARD8 reqType;
  15.444 -    CARD8 xvReqType;
  15.445 -    CARD16 length B16;
  15.446 -    CARD32 port B32;
  15.447 -    CARD32 id B32;
  15.448 -    CARD16 width B16;
  15.449 -    CARD16 height B16;
  15.450 -} xvQueryImageAttributesReq;
  15.451 -#define sz_xvQueryImageAttributesReq 16
  15.452 -
  15.453 -
  15.454 -/* Replies */
  15.455 -
  15.456 -typedef struct _QueryExtensionReply
  15.457 -{
  15.458 -    BYTE type;                  /* X_Reply */
  15.459 -    CARD8 padb1;
  15.460 -    CARD16 sequenceNumber B16;
  15.461 -    CARD32 length B32;
  15.462 -    CARD16 version B16;
  15.463 -    CARD16 revision B16;
  15.464 -    CARD32 padl4 B32;
  15.465 -    CARD32 padl5 B32;
  15.466 -    CARD32 padl6 B32;
  15.467 -    CARD32 padl7 B32;
  15.468 -    CARD32 padl8 B32;
  15.469 -} xvQueryExtensionReply;
  15.470 -#define sz_xvQueryExtensionReply 32
  15.471 -
  15.472 -typedef struct _QueryAdaptorsReply
  15.473 -{
  15.474 -    BYTE type;                  /* X_Reply */
  15.475 -    CARD8 padb1;
  15.476 -    CARD16 sequenceNumber B16;
  15.477 -    CARD32 length B32;
  15.478 -    CARD16 num_adaptors B16;
  15.479 -    CARD16 pads3 B16;
  15.480 -    CARD32 padl4 B32;
  15.481 -    CARD32 padl5 B32;
  15.482 -    CARD32 padl6 B32;
  15.483 -    CARD32 padl7 B32;
  15.484 -    CARD32 padl8 B32;
  15.485 -} xvQueryAdaptorsReply;
  15.486 -#define sz_xvQueryAdaptorsReply 32
  15.487 -
  15.488 -typedef struct _QueryEncodingsReply
  15.489 -{
  15.490 -    BYTE type;                  /* X_Reply */
  15.491 -    CARD8 padb1;
  15.492 -    CARD16 sequenceNumber B16;
  15.493 -    CARD32 length B32;
  15.494 -    CARD16 num_encodings B16;
  15.495 -    CARD32 padl3 B32;
  15.496 -    CARD32 padl4 B32;
  15.497 -    CARD32 padl5 B32;
  15.498 -    CARD32 padl6 B32;
  15.499 -    CARD32 padl7 B32;
  15.500 -    CARD32 padl8 B32;
  15.501 -} xvQueryEncodingsReply;
  15.502 -#define sz_xvQueryEncodingsReply 32
  15.503 -
  15.504 -typedef struct
  15.505 -{
  15.506 -    BYTE type;                  /* X_Reply */
  15.507 -    BYTE result;
  15.508 -    CARD16 sequenceNumber B16;
  15.509 -    CARD32 length B32;          /* 0 */
  15.510 -    CARD32 padl3 B32;
  15.511 -    CARD32 padl4 B32;
  15.512 -    CARD32 padl5 B32;
  15.513 -    CARD32 padl6 B32;
  15.514 -    CARD32 padl7 B32;
  15.515 -    CARD32 padl8 B32;
  15.516 -} xvGrabPortReply;
  15.517 -#define sz_xvGrabPortReply 32
  15.518 -
  15.519 -typedef struct
  15.520 -{
  15.521 -    BYTE type;                  /* X_Reply */
  15.522 -    BYTE padb1;
  15.523 -    CARD16 sequenceNumber B16;
  15.524 -    CARD32 length B32;          /* 0 */
  15.525 -    INT32 value B32;
  15.526 -    CARD32 padl4 B32;
  15.527 -    CARD32 padl5 B32;
  15.528 -    CARD32 padl6 B32;
  15.529 -    CARD32 padl7 B32;
  15.530 -    CARD32 padl8 B32;
  15.531 -} xvGetPortAttributeReply;
  15.532 -#define sz_xvGetPortAttributeReply 32
  15.533 -
  15.534 -typedef struct
  15.535 -{
  15.536 -    BYTE type;                  /* X_Reply */
  15.537 -    BYTE padb1;
  15.538 -    CARD16 sequenceNumber B16;
  15.539 -    CARD32 length B32;          /* 0 */
  15.540 -    CARD16 actual_width B16;
  15.541 -    CARD16 actual_height B16;
  15.542 -    CARD32 padl4 B32;
  15.543 -    CARD32 padl5 B32;
  15.544 -    CARD32 padl6 B32;
  15.545 -    CARD32 padl7 B32;
  15.546 -    CARD32 padl8 B32;
  15.547 -} xvQueryBestSizeReply;
  15.548 -#define sz_xvQueryBestSizeReply 32
  15.549 -
  15.550 -typedef struct
  15.551 -{
  15.552 -    BYTE type;                  /* X_Reply */
  15.553 -    BYTE padb1;
  15.554 -    CARD16 sequenceNumber B16;
  15.555 -    CARD32 length B32;          /* 0 */
  15.556 -    CARD32 num_attributes B32;
  15.557 -    CARD32 text_size B32;
  15.558 -    CARD32 padl5 B32;
  15.559 -    CARD32 padl6 B32;
  15.560 -    CARD32 padl7 B32;
  15.561 -    CARD32 padl8 B32;
  15.562 -} xvQueryPortAttributesReply;
  15.563 -#define sz_xvQueryPortAttributesReply 32
  15.564 -
  15.565 -typedef struct
  15.566 -{
  15.567 -    BYTE type;                  /* X_Reply */
  15.568 -    BYTE padb1;
  15.569 -    CARD16 sequenceNumber B16;
  15.570 -    CARD32 length B32;
  15.571 -    CARD32 num_formats B32;
  15.572 -    CARD32 padl4 B32;
  15.573 -    CARD32 padl5 B32;
  15.574 -    CARD32 padl6 B32;
  15.575 -    CARD32 padl7 B32;
  15.576 -    CARD32 padl8 B32;
  15.577 -} xvListImageFormatsReply;
  15.578 -#define sz_xvListImageFormatsReply 32
  15.579 -
  15.580 -typedef struct
  15.581 -{
  15.582 -    BYTE type;                  /* X_Reply */
  15.583 -    BYTE padb1;
  15.584 -    CARD16 sequenceNumber B16;
  15.585 -    CARD32 length B32;
  15.586 -    CARD32 num_planes B32;
  15.587 -    CARD32 data_size B32;
  15.588 -    CARD16 width B16;
  15.589 -    CARD16 height B16;
  15.590 -    CARD32 padl6 B32;
  15.591 -    CARD32 padl7 B32;
  15.592 -    CARD32 padl8 B32;
  15.593 -} xvQueryImageAttributesReply;
  15.594 -#define sz_xvQueryImageAttributesReply 32
  15.595 -
  15.596 -/* DEFINE EVENT STRUCTURE */
  15.597 -
  15.598 -typedef struct
  15.599 -{
  15.600 -    union
  15.601 -    {
  15.602 -        struct
  15.603 -        {
  15.604 -            BYTE type;
  15.605 -            BYTE detail;
  15.606 -            CARD16 sequenceNumber B16;
  15.607 -        } u;
  15.608 -        struct
  15.609 -        {
  15.610 -            BYTE type;
  15.611 -            BYTE reason;
  15.612 -            CARD16 sequenceNumber B16;
  15.613 -            Time time B32;
  15.614 -            Drawable drawable B32;
  15.615 -            XvPortID port B32;
  15.616 -            CARD32 padl5 B32;
  15.617 -            CARD32 padl6 B32;
  15.618 -            CARD32 padl7 B32;
  15.619 -            CARD32 padl8 B32;
  15.620 -        } videoNotify;
  15.621 -        struct
  15.622 -        {
  15.623 -            BYTE type;
  15.624 -            BYTE padb1;
  15.625 -            CARD16 sequenceNumber B16;
  15.626 -            Time time B32;
  15.627 -            XvPortID port B32;
  15.628 -            Atom attribute B32;
  15.629 -            INT32 value B32;
  15.630 -            CARD32 padl6 B32;
  15.631 -            CARD32 padl7 B32;
  15.632 -            CARD32 padl8 B32;
  15.633 -        } portNotify;
  15.634 -    } u;
  15.635 -} xvEvent;
  15.636 -
  15.637 -#undef XvPortID
  15.638 -#undef XvEncodingID
  15.639 -#undef ShmSeg
  15.640 -#undef VisualID
  15.641 -#undef Drawable
  15.642 -#undef GContext
  15.643 -#undef Time
  15.644 -#undef Atom
  15.645 -
  15.646 -#endif /* XVPROTO_H */
  15.647 -/* vi: set ts=4 sw=4 expandtab: */
    16.1 --- a/src/video/Xext/extensions/extutil.h	Sun Feb 27 22:22:58 2011 -0800
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,230 +0,0 @@
    16.4 -/*
    16.5 - * $Xorg: extutil.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
    16.6 - *
    16.7 -Copyright 1989, 1998  The Open Group
    16.8 -
    16.9 -Permission to use, copy, modify, distribute, and sell this software and its
   16.10 -documentation for any purpose is hereby granted without fee, provided that
   16.11 -the above copyright notice appear in all copies and that both that
   16.12 -copyright notice and this permission notice appear in supporting
   16.13 -documentation.
   16.14 -
   16.15 -The above copyright notice and this permission notice shall be included in
   16.16 -all copies or substantial portions of the Software.
   16.17 -
   16.18 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   16.19 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   16.20 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
   16.21 -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
   16.22 -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   16.23 -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   16.24 -
   16.25 -Except as contained in this notice, the name of The Open Group shall not be
   16.26 -used in advertising or otherwise to promote the sale, use or other dealings
   16.27 -in this Software without prior written authorization from The Open Group.
   16.28 - *
   16.29 - * Author:  Jim Fulton, MIT The Open Group
   16.30 - * 
   16.31 - *                     Xlib Extension-Writing Utilities
   16.32 - *
   16.33 - * This package contains utilities for writing the client API for various
   16.34 - * protocol extensions.  THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
   16.35 - * ARE SUBJECT TO CHANGE!
   16.36 - */
   16.37 -/* $XFree86: xc/include/extensions/extutil.h,v 1.9 2001/12/14 19:53:28 dawes Exp $ */
   16.38 -
   16.39 -#ifndef _EXTUTIL_H_
   16.40 -#define _EXTUTIL_H_
   16.41 -
   16.42 -#include "SDL_stdinc.h"         /* For portable string functions */
   16.43 -
   16.44 -#include "./Xext.h"
   16.45 -
   16.46 -/*
   16.47 - * We need to keep a list of open displays since the Xlib display list isn't
   16.48 - * public.  We also have to per-display info in a separate block since it isn't
   16.49 - * stored directly in the Display structure.
   16.50 - */
   16.51 -typedef struct _XExtDisplayInfo
   16.52 -{
   16.53 -    struct _XExtDisplayInfo *next;      /* keep a linked list */
   16.54 -    Display *display;           /* which display this is */
   16.55 -    XExtCodes *codes;           /* the extension protocol codes */
   16.56 -    XPointer data;              /* extra data for extension to use */
   16.57 -} XExtDisplayInfo;
   16.58 -
   16.59 -typedef struct _XExtensionInfo
   16.60 -{
   16.61 -    XExtDisplayInfo *head;      /* start of list */
   16.62 -    XExtDisplayInfo *cur;       /* most recently used */
   16.63 -    int ndisplays;              /* number of displays */
   16.64 -} XExtensionInfo;
   16.65 -
   16.66 -typedef struct _XExtensionHooks
   16.67 -{
   16.68 -    int (*create_gc) (
   16.69 -#if NeedNestedPrototypes
   16.70 -                         Display * /* display */ ,
   16.71 -                         GC /* gc */ ,
   16.72 -                         XExtCodes *    /* codes */
   16.73 -#endif
   16.74 -        );
   16.75 -    int (*copy_gc) (
   16.76 -#if NeedNestedPrototypes
   16.77 -                       Display * /* display */ ,
   16.78 -                       GC /* gc */ ,
   16.79 -                       XExtCodes *      /* codes */
   16.80 -#endif
   16.81 -        );
   16.82 -    int (*flush_gc) (
   16.83 -#if NeedNestedPrototypes
   16.84 -                        Display * /* display */ ,
   16.85 -                        GC /* gc */ ,
   16.86 -                        XExtCodes *     /* codes */
   16.87 -#endif
   16.88 -        );
   16.89 -    int (*free_gc) (
   16.90 -#if NeedNestedPrototypes
   16.91 -                       Display * /* display */ ,
   16.92 -                       GC /* gc */ ,
   16.93 -                       XExtCodes *      /* codes */
   16.94 -#endif
   16.95 -        );
   16.96 -    int (*create_font) (
   16.97 -#if NeedNestedPrototypes
   16.98 -                           Display * /* display */ ,
   16.99 -                           XFontStruct * /* fs */ ,
  16.100 -                           XExtCodes *  /* codes */
  16.101 -#endif
  16.102 -        );
  16.103 -    int (*free_font) (
  16.104 -#if NeedNestedPrototypes
  16.105 -                         Display * /* display */ ,
  16.106 -                         XFontStruct * /* fs */ ,
  16.107 -                         XExtCodes *    /* codes */
  16.108 -#endif
  16.109 -        );
  16.110 -    int (*close_display) (
  16.111 -#if NeedNestedPrototypes
  16.112 -                             Display * /* display */ ,
  16.113 -                             XExtCodes *        /* codes */
  16.114 -#endif
  16.115 -        );
  16.116 -      Bool(*wire_to_event) (
  16.117 -#if NeedNestedPrototypes
  16.118 -                               Display * /* display */ ,
  16.119 -                               XEvent * /* re */ ,
  16.120 -                               xEvent * /* event */
  16.121 -#endif
  16.122 -        );
  16.123 -      Status(*event_to_wire) (
  16.124 -#if NeedNestedPrototypes
  16.125 -                                 Display * /* display */ ,
  16.126 -                                 XEvent * /* re */ ,
  16.127 -                                 xEvent *       /* event */
  16.128 -#endif
  16.129 -        );
  16.130 -    int (*error) (
  16.131 -#if NeedNestedPrototypes
  16.132 -                     Display * /* display */ ,
  16.133 -                     xError * /* err */ ,
  16.134 -                     XExtCodes * /* codes */ ,
  16.135 -                     int *      /* ret_code */
  16.136 -#endif
  16.137 -        );
  16.138 -    char *(*error_string) (
  16.139 -#if NeedNestedPrototypes
  16.140 -                              Display * /* display */ ,
  16.141 -                              int /* code */ ,
  16.142 -                              XExtCodes * /* codes */ ,
  16.143 -                              char * /* buffer */ ,
  16.144 -                              int       /* nbytes */
  16.145 -#endif
  16.146 -        );
  16.147 -} XExtensionHooks;
  16.148 -
  16.149 -extern XExtensionInfo *XextCreateExtension(
  16.150 -#if NeedFunctionPrototypes
  16.151 -                                              void
  16.152 -#endif
  16.153 -    );
  16.154 -extern void XextDestroyExtension(
  16.155 -#if NeedFunctionPrototypes
  16.156 -                                    XExtensionInfo *    /* info */
  16.157 -#endif
  16.158 -    );
  16.159 -extern XExtDisplayInfo *XextAddDisplay(
  16.160 -#if NeedFunctionPrototypes
  16.161 -                                          XExtensionInfo * /* extinfo */ ,
  16.162 -                                          Display * /* dpy */ ,
  16.163 -                                          char * /* ext_name */ ,
  16.164 -                                          XExtensionHooks * /* hooks */ ,
  16.165 -                                          int /* nevents */ ,
  16.166 -                                          XPointer      /* data */
  16.167 -#endif
  16.168 -    );
  16.169 -extern int XextRemoveDisplay(
  16.170 -#if NeedFunctionPrototypes
  16.171 -                                XExtensionInfo * /* extinfo */ ,
  16.172 -                                Display *       /* dpy */
  16.173 -#endif
  16.174 -    );
  16.175 -extern XExtDisplayInfo *XextFindDisplay(
  16.176 -#if NeedFunctionPrototypes
  16.177 -                                           XExtensionInfo * /* extinfo */ ,
  16.178 -                                           Display *    /* dpy */
  16.179 -#endif
  16.180 -    );
  16.181 -
  16.182 -#define XextHasExtension(i) ((i) && ((i)->codes))
  16.183 -#define XextCheckExtension(dpy,i,name,val) \
  16.184 -  if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return val; }
  16.185 -#define XextSimpleCheckExtension(dpy,i,name) \
  16.186 -  if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return; }
  16.187 -
  16.188 -
  16.189 -/*
  16.190 - * helper macros to generate code that is common to all extensions; caller
  16.191 - * should prefix it with static if extension source is in one file; this
  16.192 - * could be a utility function, but have to stack 6 unused arguments for 
  16.193 - * something that is called many, many times would be bad.
  16.194 - */
  16.195 -#define XEXT_GENERATE_FIND_DISPLAY(proc,extinfo,extname,hooks,nev,data) \
  16.196 -XExtDisplayInfo *proc (Display *dpy) \
  16.197 -{ \
  16.198 -    XExtDisplayInfo *dpyinfo; \
  16.199 -    if (!extinfo) { if (!(extinfo = XextCreateExtension())) return NULL; } \
  16.200 -    if (!(dpyinfo = XextFindDisplay (extinfo, dpy))) \
  16.201 -      dpyinfo = XextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \
  16.202 -    return dpyinfo; \
  16.203 -}
  16.204 -
  16.205 -#define XEXT_FIND_DISPLAY_PROTO(proc) \
  16.206 -	XExtDisplayInfo *proc(Display *dpy)
  16.207 -
  16.208 -#define XEXT_GENERATE_CLOSE_DISPLAY(proc,extinfo) \
  16.209 -int proc (Display *dpy, XExtCodes *codes) \
  16.210 -{ \
  16.211 -    return XextRemoveDisplay (extinfo, dpy); \
  16.212 -}
  16.213 -
  16.214 -#define XEXT_CLOSE_DISPLAY_PROTO(proc) \
  16.215 -	int proc(Display *dpy, XExtCodes *codes)
  16.216 -
  16.217 -#define XEXT_GENERATE_ERROR_STRING(proc,extname,nerr,errl) \
  16.218 -char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \
  16.219 -{  \
  16.220 -    code -= codes->first_error;  \
  16.221 -    if (code >= 0 && code < nerr) { \
  16.222 -	char tmp[256]; \
  16.223 -	SDL_snprintf (tmp, SDL_arraysize(tmp), "%s.%d", extname, code); \
  16.224 -	XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
  16.225 -	return buf; \
  16.226 -    } \
  16.227 -    return (char *)0; \
  16.228 -}
  16.229 -
  16.230 -#define XEXT_ERROR_STRING_PROTO(proc) \
  16.231 -	char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n)
  16.232 -#endif
  16.233 -/* vi: set ts=4 sw=4 expandtab: */
    17.1 --- a/src/video/Xext/extensions/panoramiXext.h	Sun Feb 27 22:22:58 2011 -0800
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,56 +0,0 @@
    17.4 -/* $Xorg: panoramiXext.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */
    17.5 -/*****************************************************************
    17.6 -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
    17.7 -Permission is hereby granted, free of charge, to any person obtaining a copy
    17.8 -of this software and associated documentation files (the "Software"), to deal
    17.9 -in the Software without restriction, including without limitation the rights
   17.10 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   17.11 -copies of the Software.
   17.12 -
   17.13 -The above copyright notice and this permission notice shall be included in
   17.14 -all copies or substantial portions of the Software.
   17.15 -
   17.16 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   17.17 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   17.18 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
   17.19 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
   17.20 -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
   17.21 -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   17.22 -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   17.23 -
   17.24 -Except as contained in this notice, the name of Digital Equipment Corporation
   17.25 -shall not be used in advertising or otherwise to promote the sale, use or other
   17.26 -dealings in this Software without prior written authorization from Digital
   17.27 -Equipment Corporation.
   17.28 -******************************************************************/
   17.29 -/*  
   17.30 - *	PanoramiX definitions
   17.31 - */
   17.32 -/* $XFree86: xc/include/extensions/panoramiXext.h,v 3.6 2001/01/17 17:53:22 dawes Exp $ */
   17.33 -
   17.34 -#include "SDL_name.h"
   17.35 -
   17.36 -/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
   17.37 -
   17.38 -#define PANORAMIX_MAJOR_VERSION         1       /* current version number */
   17.39 -#define PANORAMIX_MINOR_VERSION         1
   17.40 -
   17.41 -typedef struct
   17.42 -{
   17.43 -    Window window;              /* PanoramiX window - may not exist */
   17.44 -    int screen;
   17.45 -    int State;                  /* PanroamiXOff, PanoramiXOn */
   17.46 -    int width;                  /* width of this screen */
   17.47 -    int height;                 /* height of this screen */
   17.48 -    int ScreenCount;            /* real physical number of screens */
   17.49 -    XID eventMask;              /* selected events for this client */
   17.50 -} SDL_NAME(XPanoramiXInfo);
   17.51 -
   17.52 -extern
   17.53 -SDL_NAME(XPanoramiXInfo) *
   17.54 -SDL_NAME(XPanoramiXAllocInfo) (
   17.55 -#if NeedFunctionPrototypes
   17.56 -                                  void
   17.57 -#endif
   17.58 -    );
   17.59 -/* vi: set ts=4 sw=4 expandtab: */
    18.1 --- a/src/video/Xext/extensions/panoramiXproto.h	Sun Feb 27 22:22:58 2011 -0800
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,206 +0,0 @@
    18.4 -/* $Xorg: panoramiXproto.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */
    18.5 -/*****************************************************************
    18.6 -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
    18.7 -Permission is hereby granted, free of charge, to any person obtaining a copy
    18.8 -of this software and associated documentation files (the "Software"), to deal
    18.9 -in the Software without restriction, including without limitation the rights
   18.10 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   18.11 -copies of the Software.
   18.12 -
   18.13 -The above copyright notice and this permission notice shall be included in
   18.14 -all copies or substantial portions of the Software.
   18.15 -
   18.16 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   18.17 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   18.18 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
   18.19 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
   18.20 -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
   18.21 -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   18.22 -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   18.23 -
   18.24 -Except as contained in this notice, the name of Digital Equipment Corporation
   18.25 -shall not be used in advertising or otherwise to promote the sale, use or other
   18.26 -dealings in this Software without prior written authorization from Digital
   18.27 -Equipment Corporation.
   18.28 -******************************************************************/
   18.29 -/* $XFree86: xc/include/extensions/panoramiXproto.h,v 3.6 2001/01/17 17:53:22 dawes Exp $ */
   18.30 -
   18.31 -/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
   18.32 -
   18.33 -#ifndef _PANORAMIXPROTO_H_
   18.34 -#define _PANORAMIXPROTO_H_
   18.35 -
   18.36 -#define PANORAMIX_PROTOCOL_NAME "XINERAMA"
   18.37 -
   18.38 -#define X_PanoramiXQueryVersion		0
   18.39 -#define X_PanoramiXGetState		1
   18.40 -#define X_PanoramiXGetScreenCount	2
   18.41 -#define X_PanoramiXGetScreenSize	3
   18.42 -
   18.43 -#define X_XineramaIsActive		4
   18.44 -#define X_XineramaQueryScreens		5
   18.45 -
   18.46 -typedef struct _PanoramiXQueryVersion
   18.47 -{
   18.48 -    CARD8 reqType;              /* always PanoramiXReqCode */
   18.49 -    CARD8 panoramiXReqType;     /* always X_PanoramiXQueryVersion */
   18.50 -    CARD16 length B16;
   18.51 -    CARD8 clientMajor;
   18.52 -    CARD8 clientMinor;
   18.53 -    CARD16 unused B16;
   18.54 -} xPanoramiXQueryVersionReq;
   18.55 -
   18.56 -#define sz_xPanoramiXQueryVersionReq	8
   18.57 -
   18.58 -typedef struct
   18.59 -{
   18.60 -    CARD8 type;                 /* must be X_Reply */
   18.61 -    CARD8 pad1;                 /* unused       */
   18.62 -    CARD16 sequenceNumber B16;  /* last sequence number */
   18.63 -    CARD32 length B32;          /* 0 */
   18.64 -    CARD16 majorVersion B16;
   18.65 -    CARD16 minorVersion B16;
   18.66 -    CARD32 pad2 B32;            /* unused */
   18.67 -    CARD32 pad3 B32;            /* unused */
   18.68 -    CARD32 pad4 B32;            /* unused */
   18.69 -    CARD32 pad5 B32;            /* unused */
   18.70 -    CARD32 pad6 B32;            /* unused */
   18.71 -} xPanoramiXQueryVersionReply;
   18.72 -
   18.73 -#define sz_xPanoramiXQueryVersionReply	32
   18.74 -
   18.75 -
   18.76 -typedef struct _PanoramiXGetState
   18.77 -{
   18.78 -    CARD8 reqType;              /* always PanoramiXReqCode */
   18.79 -    CARD8 panoramiXReqType;     /* always X_PanoramiXGetState */
   18.80 -    CARD16 length B16;
   18.81 -    CARD32 window B32;
   18.82 -} xPanoramiXGetStateReq;
   18.83 -#define sz_xPanoramiXGetStateReq	8
   18.84 -
   18.85 -typedef struct
   18.86 -{
   18.87 -    BYTE type;
   18.88 -    BYTE state;
   18.89 -    CARD16 sequenceNumber B16;
   18.90 -    CARD32 length B32;
   18.91 -    CARD32 window B32;
   18.92 -    CARD32 pad1 B32;            /* unused */
   18.93 -    CARD32 pad2 B32;            /* unused */
   18.94 -    CARD32 pad3 B32;            /* unused */
   18.95 -    CARD32 pad4 B32;            /* unused */
   18.96 -    CARD32 pad5 B32;            /* unused */
   18.97 -} xPanoramiXGetStateReply;
   18.98 -
   18.99 -#define sz_panoramiXGetStateReply	32
  18.100 -
  18.101 -typedef struct _PanoramiXGetScreenCount
  18.102 -{
  18.103 -    CARD8 reqType;              /* always PanoramiXReqCode */
  18.104 -    CARD8 panoramiXReqType;     /* always X_PanoramiXGetScreenCount */
  18.105 -    CARD16 length B16;
  18.106 -    CARD32 window B32;
  18.107 -} xPanoramiXGetScreenCountReq;
  18.108 -#define sz_xPanoramiXGetScreenCountReq	8
  18.109 -
  18.110 -typedef struct
  18.111 -{
  18.112 -    BYTE type;
  18.113 -    BYTE ScreenCount;
  18.114 -    CARD16 sequenceNumber B16;
  18.115 -    CARD32 length B32;
  18.116 -    CARD32 window B32;
  18.117 -    CARD32 pad1 B32;            /* unused */
  18.118 -    CARD32 pad2 B32;            /* unused */
  18.119 -    CARD32 pad3 B32;            /* unused */
  18.120 -    CARD32 pad4 B32;            /* unused */
  18.121 -    CARD32 pad5 B32;            /* unused */
  18.122 -} xPanoramiXGetScreenCountReply;
  18.123 -#define sz_panoramiXGetScreenCountReply	32
  18.124 -
  18.125 -typedef struct _PanoramiXGetScreenSize
  18.126 -{
  18.127 -    CARD8 reqType;              /* always PanoramiXReqCode */
  18.128 -    CARD8 panoramiXReqType;     /* always X_PanoramiXGetState */
  18.129 -    CARD16 length B16;
  18.130 -    CARD32 window B32;
  18.131 -    CARD32 screen B32;
  18.132 -} xPanoramiXGetScreenSizeReq;
  18.133 -#define sz_xPanoramiXGetScreenSizeReq	12
  18.134 -
  18.135 -typedef struct
  18.136 -{
  18.137 -    BYTE type;
  18.138 -    CARD8 pad1;
  18.139 -    CARD16 sequenceNumber B16;
  18.140 -    CARD32 length B32;
  18.141 -    CARD32 width B32;
  18.142 -    CARD32 height B32;
  18.143 -    CARD32 window B32;
  18.144 -    CARD32 screen B32;
  18.145 -    CARD32 pad2 B32;            /* unused */
  18.146 -    CARD32 pad3 B32;            /* unused */
  18.147 -} xPanoramiXGetScreenSizeReply;
  18.148 -#define sz_panoramiXGetScreenSizeReply 32
  18.149 -
  18.150 -/************  Alternate protocol  ******************/
  18.151 -
  18.152 -typedef struct
  18.153 -{
  18.154 -    CARD8 reqType;
  18.155 -    CARD8 panoramiXReqType;
  18.156 -    CARD16 length B16;
  18.157 -} xXineramaIsActiveReq;
  18.158 -#define sz_xXineramaIsActiveReq 4
  18.159 -
  18.160 -typedef struct
  18.161 -{
  18.162 -    BYTE type;
  18.163 -    CARD8 pad1;
  18.164 -    CARD16 sequenceNumber B16;
  18.165 -    CARD32 length B32;
  18.166 -    CARD32 state B32;
  18.167 -    CARD32 pad2 B32;
  18.168 -    CARD32 pad3 B32;
  18.169 -    CARD32 pad4 B32;
  18.170 -    CARD32 pad5 B32;
  18.171 -    CARD32 pad6 B32;
  18.172 -} xXineramaIsActiveReply;
  18.173 -#define sz_XineramaIsActiveReply 32
  18.174 -
  18.175 -
  18.176 -typedef struct
  18.177 -{
  18.178 -    CARD8 reqType;
  18.179 -    CARD8 panoramiXReqType;
  18.180 -    CARD16 length B16;
  18.181 -} xXineramaQueryScreensReq;
  18.182 -#define sz_xXineramaQueryScreensReq 4
  18.183 -
  18.184 -typedef struct
  18.185 -{
  18.186 -    BYTE type;
  18.187 -    CARD8 pad1;
  18.188 -    CARD16 sequenceNumber B16;
  18.189 -    CARD32 length B32;
  18.190 -    CARD32 number B32;
  18.191 -    CARD32 pad2 B32;
  18.192 -    CARD32 pad3 B32;
  18.193 -    CARD32 pad4 B32;
  18.194 -    CARD32 pad5 B32;
  18.195 -    CARD32 pad6 B32;
  18.196 -} xXineramaQueryScreensReply;
  18.197 -#define sz_XineramaQueryScreensReply 32
  18.198 -
  18.199 -typedef struct
  18.200 -{
  18.201 -    INT16 x_org B16;
  18.202 -    INT16 y_org B16;
  18.203 -    CARD16 width B16;
  18.204 -    CARD16 height B16;
  18.205 -} xXineramaScreenInfo;
  18.206 -#define sz_XineramaScreenInfo 8
  18.207 -
  18.208 -#endif
  18.209 -/* vi: set ts=4 sw=4 expandtab: */
    19.1 --- a/src/video/Xext/extensions/xf86dga.h	Sun Feb 27 22:22:58 2011 -0800
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,221 +0,0 @@
    19.4 -/*
    19.5 -   Copyright (c) 1999  XFree86 Inc
    19.6 -*/
    19.7 -/* $XFree86: xc/include/extensions/xf86dga.h,v 3.21 2001/08/01 00:44:36 tsi Exp $ */
    19.8 -
    19.9 -#ifndef _XF86DGA_H_
   19.10 -#define _XF86DGA_H_
   19.11 -
   19.12 -#include <X11/Xfuncproto.h>
   19.13 -#include "xf86dga1.h"
   19.14 -#include "SDL_name.h"
   19.15 -
   19.16 -#define X_XDGAQueryVersion		0
   19.17 -
   19.18 -/* 1 through 9 are in xf86dga1.h */
   19.19 -
   19.20 -/* 10 and 11 are reserved to avoid conflicts with rogue DGA extensions */
   19.21 -
   19.22 -#define X_XDGAQueryModes		12
   19.23 -#define X_XDGASetMode			13
   19.24 -#define X_XDGASetViewport		14
   19.25 -#define X_XDGAInstallColormap		15
   19.26 -#define X_XDGASelectInput		16
   19.27 -#define X_XDGAFillRectangle		17
   19.28 -#define X_XDGACopyArea			18
   19.29 -#define X_XDGACopyTransparentArea	19
   19.30 -#define X_XDGAGetViewportStatus		20
   19.31 -#define X_XDGASync			21
   19.32 -#define X_XDGAOpenFramebuffer		22
   19.33 -#define X_XDGACloseFramebuffer		23
   19.34 -#define X_XDGASetClientVersion		24
   19.35 -#define X_XDGAChangePixmapMode		25
   19.36 -#define X_XDGACreateColormap		26
   19.37 -
   19.38 -
   19.39 -#define XDGAConcurrentAccess	0x00000001
   19.40 -#define XDGASolidFillRect	0x00000002
   19.41 -#define XDGABlitRect		0x00000004
   19.42 -#define XDGABlitTransRect	0x00000008
   19.43 -#define XDGAPixmap    		0x00000010
   19.44 -
   19.45 -#define XDGAInterlaced          0x00010000
   19.46 -#define XDGADoublescan          0x00020000
   19.47 -
   19.48 -#define XDGAFlipImmediate	0x00000001
   19.49 -#define XDGAFlipRetrace		0x00000002
   19.50 -
   19.51 -#define XDGANeedRoot		0x00000001
   19.52 -
   19.53 -#define XF86DGANumberEvents		7
   19.54 -
   19.55 -#define XDGAPixmapModeLarge		0
   19.56 -#define XDGAPixmapModeSmall		1
   19.57 -
   19.58 -#define XF86DGAClientNotLocal		0
   19.59 -#define XF86DGANoDirectVideoMode	1
   19.60 -#define XF86DGAScreenNotActive		2
   19.61 -#define XF86DGADirectNotActivated	3
   19.62 -#define XF86DGAOperationNotSupported	4
   19.63 -#define XF86DGANumberErrors		(XF86DGAOperationNotSupported + 1)
   19.64 -
   19.65 -
   19.66 -typedef struct
   19.67 -{
   19.68 -    int num;                    /* A unique identifier for the mode (num > 0) */
   19.69 -    char *name;                 /* name of mode given in the XF86Config */
   19.70 -    float verticalRefresh;
   19.71 -    int flags;                  /* DGA_CONCURRENT_ACCESS, etc... */
   19.72 -    int imageWidth;             /* linear accessible portion (pixels) */
   19.73 -    int imageHeight;
   19.74 -    int pixmapWidth;            /* Xlib accessible portion (pixels) */
   19.75 -    int pixmapHeight;           /* both fields ignored if no concurrent access */
   19.76 -    int bytesPerScanline;
   19.77 -    int byteOrder;              /* MSBFirst, LSBFirst */
   19.78 -    int depth;
   19.79 -    int bitsPerPixel;
   19.80 -    unsigned long redMask;
   19.81 -    unsigned long greenMask;
   19.82 -    unsigned long blueMask;
   19.83 -    short visualClass;
   19.84 -    int viewportWidth;
   19.85 -    int viewportHeight;
   19.86 -    int xViewportStep;          /* viewport position granularity */
   19.87 -    int yViewportStep;
   19.88 -    int maxViewportX;           /* max viewport origin */
   19.89 -    int maxViewportY;
   19.90 -    int viewportFlags;          /* types of page flipping possible */
   19.91 -    int reserved1;
   19.92 -    int reserved2;
   19.93 -} SDL_NAME(XDGAMode);
   19.94 -
   19.95 -
   19.96 -typedef struct
   19.97 -{
   19.98 -    SDL_NAME(XDGAMode) mode;
   19.99 -    unsigned char *data;
  19.100 -    Pixmap pixmap;
  19.101 -} SDL_NAME(XDGADevice);
  19.102 -
  19.103 -
  19.104 -#ifndef _XF86DGA_SERVER_
  19.105 -_XFUNCPROTOBEGIN typedef struct
  19.106 -{
  19.107 -    int type;
  19.108 -    unsigned long serial;
  19.109 -    Display *display;
  19.110 -    int screen;
  19.111 -    Time time;
  19.112 -    unsigned int state;
  19.113 -    unsigned int button;
  19.114 -} SDL_NAME(XDGAButtonEvent);
  19.115 -
  19.116 -typedef struct
  19.117 -{
  19.118 -    int type;
  19.119 -    unsigned long serial;
  19.120 -    Display *display;
  19.121 -    int screen;
  19.122 -    Time time;
  19.123 -    unsigned int state;
  19.124 -    unsigned int keycode;
  19.125 -} SDL_NAME(XDGAKeyEvent);
  19.126 -
  19.127 -typedef struct
  19.128 -{
  19.129 -    int type;
  19.130 -    unsigned long serial;
  19.131 -    Display *display;
  19.132 -    int screen;
  19.133 -    Time time;
  19.134 -    unsigned int state;
  19.135 -    int dx;
  19.136 -    int dy;
  19.137 -} SDL_NAME(XDGAMotionEvent);
  19.138 -
  19.139 -typedef union
  19.140 -{
  19.141 -    int type;
  19.142 -      SDL_NAME(XDGAButtonEvent) xbutton;
  19.143 -      SDL_NAME(XDGAKeyEvent) xkey;
  19.144 -      SDL_NAME(XDGAMotionEvent) xmotion;
  19.145 -    long pad[24];
  19.146 -} SDL_NAME(XDGAEvent);
  19.147 -
  19.148 -Bool SDL_NAME(XDGAQueryExtension) (Display * dpy,
  19.149 -                                   int *eventBase, int *erroBase);
  19.150 -
  19.151 -Bool SDL_NAME(XDGAQueryVersion) (Display * dpy,
  19.152 -                                 int *majorVersion, int *minorVersion);
  19.153 -
  19.154 -SDL_NAME(XDGAMode) * SDL_NAME(XDGAQueryModes) (Display * dpy,
  19.155 -                                               int screen, int *num);
  19.156 -
  19.157 -SDL_NAME(XDGADevice) * SDL_NAME(XDGASetMode) (Display * dpy,
  19.158 -                                              int screen, int mode);
  19.159 -
  19.160 -Bool
  19.161 -SDL_NAME(XDGAOpenFramebuffer) (Display * dpy, int screen);
  19.162 -
  19.163 -     void SDL_NAME(XDGACloseFramebuffer) (Display * dpy, int screen);
  19.164 -
  19.165 -     void SDL_NAME(XDGASetViewport) (Display * dpy,
  19.166 -                                     int screen, int x, int y, int flags);
  19.167 -
  19.168 -     void SDL_NAME(XDGAInstallColormap) (Display * dpy,
  19.169 -                                         int screen, Colormap cmap);
  19.170 -
  19.171 -Colormap
  19.172 -SDL_NAME(XDGACreateColormap) (Display * dpy,
  19.173 -                              int screen,
  19.174 -                              SDL_NAME(XDGADevice) * device, int alloc);
  19.175 -
  19.176 -     void SDL_NAME(XDGASelectInput) (Display * dpy, int screen,
  19.177 -                                     long event_mask);
  19.178 -
  19.179 -     void SDL_NAME(XDGAFillRectangle) (Display * dpy,
  19.180 -                                       int screen,
  19.181 -                                       int x,
  19.182 -                                       int y,
  19.183 -                                       unsigned int width,
  19.184 -                                       unsigned int height,
  19.185 -                                       unsigned long color);
  19.186 -
  19.187 -
  19.188 -     void SDL_NAME(XDGACopyArea) (Display * dpy,
  19.189 -                                  int screen,
  19.190 -                                  int srcx,
  19.191 -                                  int srcy,
  19.192 -                                  unsigned int width,
  19.193 -                                  unsigned int height, int dstx, int dsty);
  19.194 -
  19.195 -
  19.196 -     void SDL_NAME(XDGACopyTransparentArea) (Display * dpy,
  19.197 -                                             int screen,
  19.198 -                                             int srcx,
  19.199 -                                             int srcy,
  19.200 -                                             unsigned int width,
  19.201 -                                             unsigned int height,
  19.202 -                                             int dstx,
  19.203 -                                             int dsty, unsigned long key);
  19.204 -
  19.205 -     int SDL_NAME(XDGAGetViewportStatus) (Display * dpy, int screen);
  19.206 -
  19.207 -     void SDL_NAME(XDGASync) (Display * dpy, int screen);
  19.208 -
  19.209 -Bool
  19.210 -SDL_NAME(XDGASetClientVersion) (Display * dpy);
  19.211 -
  19.212 -     void SDL_NAME(XDGAChangePixmapMode) (Display * dpy,
  19.213 -                                          int screen, int *x, int *y,
  19.214 -                                          int mode);
  19.215 -
  19.216 -
  19.217 -     void SDL_NAME(XDGAKeyEventToXKeyEvent) (SDL_NAME(XDGAKeyEvent) * dk,
  19.218 -                                             XKeyEvent * xk);
  19.219 -
  19.220 -
  19.221 -_XFUNCPROTOEND
  19.222 -#endif /* _XF86DGA_SERVER_ */
  19.223 -#endif /* _XF86DGA_H_ */
  19.224 -/* vi: set ts=4 sw=4 expandtab: */
    20.1 --- a/src/video/Xext/extensions/xf86dga1.h	Sun Feb 27 22:22:58 2011 -0800
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,167 +0,0 @@
    20.4 -/* $XFree86: xc/include/extensions/xf86dga1.h,v 1.2 1999/04/17 07:05:41 dawes Exp $ */
    20.5 -/*
    20.6 -
    20.7 -Copyright (c) 1995  Jon Tombs
    20.8 -Copyright (c) 1995  XFree86 Inc
    20.9 -
   20.10 -*/
   20.11 -
   20.12 -/************************************************************************
   20.13 -
   20.14 -   THIS IS THE OLD DGA API AND IS OBSOLETE.  PLEASE DO NOT USE IT ANYMORE
   20.15 -
   20.16 -************************************************************************/
   20.17 -
   20.18 -#ifndef _XF86DGA1_H_
   20.19 -#define _XF86DGA1_H_
   20.20 -
   20.21 -#include <X11/Xfuncproto.h>
   20.22 -#include "SDL_name.h"
   20.23 -
   20.24 -#define X_XF86DGAQueryVersion		0
   20.25 -#define X_XF86DGAGetVideoLL		1
   20.26 -#define X_XF86DGADirectVideo		2
   20.27 -#define X_XF86DGAGetViewPortSize	3
   20.28 -#define X_XF86DGASetViewPort		4
   20.29 -#define X_XF86DGAGetVidPage		5
   20.30 -#define X_XF86DGASetVidPage		6
   20.31 -#define X_XF86DGAInstallColormap	7
   20.32 -#define X_XF86DGAQueryDirectVideo	8
   20.33 -#define X_XF86DGAViewPortChanged	9
   20.34 -
   20.35 -#define XF86DGADirectPresent		0x0001
   20.36 -#define XF86DGADirectGraphics		0x0002
   20.37 -#define XF86DGADirectMouse		0x0004
   20.38 -#define XF86DGADirectKeyb		0x0008
   20.39 -#define XF86DGAHasColormap		0x0100
   20.40 -#define XF86DGADirectColormap		0x0200
   20.41 -
   20.42 -
   20.43 -
   20.44 -
   20.45 -#ifndef _XF86DGA_SERVER_
   20.46 -
   20.47 -_XFUNCPROTOBEGIN Bool SDL_NAME(XF86DGAQueryVersion) (
   20.48 -#if NeedFunctionPrototypes
   20.49 -                                                        Display * /* dpy */ ,
   20.50 -                                                        int *
   20.51 -                                                        /* majorVersion */ ,
   20.52 -                                                        int *   /* minorVersion */
   20.53 -#endif
   20.54 -    );
   20.55 -
   20.56 -Bool SDL_NAME(XF86DGAQueryExtension) (
   20.57 -#if NeedFunctionPrototypes
   20.58 -                                         Display * /* dpy */ ,
   20.59 -                                         int * /* event_base */ ,
   20.60 -                                         int *  /* error_base */
   20.61 -#endif
   20.62 -    );
   20.63 -
   20.64 -Status SDL_NAME(XF86DGAGetVideoLL) (
   20.65 -#if NeedFunctionPrototypes
   20.66 -                                       Display * /* dpy */ ,
   20.67 -                                       int /* screen */ ,
   20.68 -                                       int * /* base addr */ ,
   20.69 -                                       int * /* width */ ,
   20.70 -                                       int * /* bank_size */ ,
   20.71 -                                       int *    /* ram_size */
   20.72 -#endif
   20.73 -    );
   20.74 -
   20.75 -Status SDL_NAME(XF86DGAGetVideo) (
   20.76 -#if NeedFunctionPrototypes
   20.77 -                                     Display * /* dpy */ ,
   20.78 -                                     int /* screen */ ,
   20.79 -                                     char ** /* base addr */ ,
   20.80 -                                     int * /* width */ ,
   20.81 -                                     int * /* bank_size */ ,
   20.82 -                                     int *      /* ram_size */
   20.83 -#endif
   20.84 -    );
   20.85 -
   20.86 -Status SDL_NAME(XF86DGADirectVideo) (
   20.87 -#if NeedFunctionPrototypes
   20.88 -                                        Display * /* dpy */ ,
   20.89 -                                        int /* screen */ ,
   20.90 -                                        int     /* enable */
   20.91 -#endif
   20.92 -    );
   20.93 -
   20.94 -Status SDL_NAME(XF86DGADirectVideoLL) (
   20.95 -#if NeedFunctionPrototypes
   20.96 -                                          Display * /* dpy */ ,
   20.97 -                                          int /* screen */ ,
   20.98 -                                          int   /* enable */
   20.99 -#endif
  20.100 -    );
  20.101 -
  20.102 -Status SDL_NAME(XF86DGAGetViewPortSize) (
  20.103 -#if NeedFunctionPrototypes
  20.104 -                                            Display * /* dpy */ ,
  20.105 -                                            int /* screen */ ,
  20.106 -                                            int * /* width */ ,
  20.107 -                                            int *       /* height */
  20.108 -#endif
  20.109 -    );
  20.110 -
  20.111 -Status SDL_NAME(XF86DGASetViewPort) (
  20.112 -#if NeedFunctionPrototypes
  20.113 -                                        Display * /* dpy */ ,
  20.114 -                                        int /* screen */ ,
  20.115 -                                        int x /* X */ ,
  20.116 -                                        int y   /* Y */
  20.117 -#endif
  20.118 -    );
  20.119 -
  20.120 -Status SDL_NAME(XF86DGAGetVidPage) (
  20.121 -#if NeedFunctionPrototypes
  20.122 -                                       Display * /* dpy */ ,
  20.123 -                                       int /* screen */ ,
  20.124 -                                       int *    /* vid page */
  20.125 -#endif
  20.126 -    );
  20.127 -
  20.128 -Status SDL_NAME(XF86DGASetVidPage) (
  20.129 -#if NeedFunctionPrototypes
  20.130 -                                       Display * /* dpy */ ,
  20.131 -                                       int /* screen */ ,
  20.132 -                                       int      /* vid page */
  20.133 -#endif
  20.134 -    );
  20.135 -
  20.136 -Status SDL_NAME(XF86DGAInstallColormap) (
  20.137 -#if NeedFunctionPrototypes
  20.138 -                                            Display * /* dpy */ ,
  20.139 -                                            int /* screen */ ,
  20.140 -                                            Colormap    /*Colormap */
  20.141 -#endif
  20.142 -    );
  20.143 -
  20.144 -int SDL_NAME(XF86DGAForkApp) (
  20.145 -#if NeedFunctionPrototypes
  20.146 -                                 int screen
  20.147 -#endif
  20.148 -    );
  20.149 -
  20.150 -Status SDL_NAME(XF86DGAQueryDirectVideo) (
  20.151 -#if NeedFunctionPrototypes
  20.152 -                                             Display * /* dpy */ ,
  20.153 -                                             int /* screen */ ,
  20.154 -                                             int *      /* flags */
  20.155 -#endif
  20.156 -    );
  20.157 -
  20.158 -Bool SDL_NAME(XF86DGAViewPortChanged) (
  20.159 -#if NeedFunctionPrototypes
  20.160 -                                          Display * /* dpy */ ,
  20.161 -                                          int /* screen */ ,
  20.162 -                                          int   /* n */
  20.163 -#endif
  20.164 -    );
  20.165 -
  20.166 -
  20.167 -_XFUNCPROTOEND
  20.168 -#endif /* _XF86DGA_SERVER_ */
  20.169 -#endif /* _XF86DGA1_H_ */
  20.170 -/* vi: set ts=4 sw=4 expandtab: */
    21.1 --- a/src/video/Xext/extensions/xf86dga1str.h	Sun Feb 27 22:22:58 2011 -0800
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,210 +0,0 @@
    21.4 -/* $XFree86: xc/include/extensions/xf86dga1str.h,v 1.2 1999/05/03 12:15:37 dawes Exp $ */
    21.5 -/*
    21.6 -
    21.7 -Copyright (c) 1995  Jon Tombs
    21.8 -Copyright (c) 1995  XFree86 Inc.
    21.9 -
   21.10 -*/
   21.11 -
   21.12 -#ifndef _XF86DGASTR1_H_
   21.13 -#define _XF86DGASTR1_H_
   21.14 -
   21.15 -typedef struct _XF86DGAQueryVersion
   21.16 -{
   21.17 -    CARD8 reqType;              /* always DGAReqCode */
   21.18 -    CARD8 dgaReqType;           /* always X_DGAQueryVersion */
   21.19 -    CARD16 length B16;
   21.20 -} xXF86DGAQueryVersionReq;
   21.21 -#define sz_xXF86DGAQueryVersionReq	4
   21.22 -
   21.23 -typedef struct
   21.24 -{
   21.25 -    BYTE type;                  /* X_Reply */
   21.26 -    BOOL pad1;
   21.27 -    CARD16 sequenceNumber B16;
   21.28 -    CARD32 length B32;
   21.29 -    CARD16 majorVersion B16;    /* major version of DGA protocol */
   21.30 -    CARD16 minorVersion B16;    /* minor version of DGA protocol */
   21.31 -    CARD32 pad2 B32;
   21.32 -    CARD32 pad3 B32;
   21.33 -    CARD32 pad4 B32;
   21.34 -    CARD32 pad5 B32;
   21.35 -    CARD32 pad6 B32;
   21.36 -} xXF86DGAQueryVersionReply;
   21.37 -#define sz_xXF86DGAQueryVersionReply	32
   21.38 -
   21.39 -typedef struct _XF86DGAGetVideoLL
   21.40 -{
   21.41 -    CARD8 reqType;              /* always DGAReqCode */
   21.42 -    CARD8 dgaReqType;           /* always X_XF86DGAGetVideoLL */
   21.43 -    CARD16 length B16;
   21.44 -    CARD16 screen B16;
   21.45 -    CARD16 pad B16;
   21.46 -} xXF86DGAGetVideoLLReq;
   21.47 -#define sz_xXF86DGAGetVideoLLReq	8
   21.48 -
   21.49 -typedef struct _XF86DGAInstallColormap
   21.50 -{
   21.51 -    CARD8 reqType;
   21.52 -    CARD8 dgaReqType;
   21.53 -    CARD16 length B16;
   21.54 -    CARD16 screen B16;
   21.55 -    CARD16 pad2;
   21.56 -    CARD32 id B32;              /* colormap. */
   21.57 -} xXF86DGAInstallColormapReq;
   21.58 -#define sz_xXF86DGAInstallColormapReq        12
   21.59 -
   21.60 -
   21.61 -typedef struct
   21.62 -{
   21.63 -    BYTE type;
   21.64 -    BOOL pad1;
   21.65 -    CARD16 sequenceNumber B16;
   21.66 -    CARD32 length B32;
   21.67 -    CARD32 offset B32;
   21.68 -    CARD32 width B32;
   21.69 -    CARD32 bank_size B32;
   21.70 -    CARD32 ram_size B32;
   21.71 -    CARD32 pad4 B32;
   21.72 -    CARD32 pad5 B32;
   21.73 -} xXF86DGAGetVideoLLReply;
   21.74 -#define sz_xXF86DGAGetVideoLLReply	32
   21.75 -
   21.76 -typedef struct _XF86DGADirectVideo
   21.77 -{
   21.78 -    CARD8 reqType;              /* always DGAReqCode */
   21.79 -    CARD8 dgaReqType;           /* always X_XF86DGADirectVideo */
   21.80 -    CARD16 length B16;
   21.81 -    CARD16 screen B16;
   21.82 -    CARD16 enable B16;
   21.83 -} xXF86DGADirectVideoReq;
   21.84 -#define sz_xXF86DGADirectVideoReq	8
   21.85 -
   21.86 -
   21.87 -typedef struct _XF86DGAGetViewPortSize
   21.88 -{
   21.89 -    CARD8 reqType;              /* always DGAReqCode */
   21.90 -    CARD8 dgaReqType;           /* always X_XF86DGAGetViewPort */
   21.91 -    CARD16 length B16;
   21.92 -    CARD16 screen B16;
   21.93 -    CARD16 pad B16;
   21.94 -} xXF86DGAGetViewPortSizeReq;
   21.95 -#define sz_xXF86DGAGetViewPortSizeReq	8
   21.96 -
   21.97 -typedef struct
   21.98 -{
   21.99 -    BYTE type;
  21.100 -    BOOL pad1;
  21.101 -    CARD16 sequenceNumber B16;
  21.102 -    CARD32 length B32;
  21.103 -    CARD32 width B32;
  21.104 -    CARD32 height B32;
  21.105 -    CARD32 pad2 B32;
  21.106 -    CARD32 pad3 B32;
  21.107 -    CARD32 pad4 B32;
  21.108 -    CARD32 pad5 B32;
  21.109 -} xXF86DGAGetViewPortSizeReply;
  21.110 -#define sz_xXF86DGAGetViewPortSizeReply	32
  21.111 -
  21.112 -typedef struct _XF86DGASetViewPort
  21.113 -{
  21.114 -    CARD8 reqType;              /* always DGAReqCode */
  21.115 -    CARD8 dgaReqType;           /* always X_XF86DGASetViewPort */
  21.116 -    CARD16 length B16;
  21.117 -    CARD16 screen B16;
  21.118 -    CARD16 pad B16;
  21.119 -    CARD32 x B32;
  21.120 -    CARD32 y B32;
  21.121 -} xXF86DGASetViewPortReq;
  21.122 -#define sz_xXF86DGASetViewPortReq	16
  21.123 -
  21.124 -typedef struct _XF86DGAGetVidPage
  21.125 -{
  21.126 -    CARD8 reqType;              /* always DGAReqCode */
  21.127 -    CARD8 dgaReqType;           /* always X_XF86DGAGetVidPage */
  21.128 -    CARD16 length B16;
  21.129 -    CARD16 screen B16;
  21.130 -    CARD16 pad B16;
  21.131 -} xXF86DGAGetVidPageReq;
  21.132 -#define sz_xXF86DGAGetVidPageReq	8
  21.133 -
  21.134 -typedef struct
  21.135 -{
  21.136 -    BYTE type;
  21.137 -    BOOL pad1;
  21.138 -    CARD16 sequenceNumber B16;
  21.139 -    CARD32 length B32;
  21.140 -    CARD32 vpage B32;
  21.141 -    CARD32 pad B32;
  21.142 -    CARD32 pad2 B32;
  21.143 -    CARD32 pad3 B32;
  21.144 -    CARD32 pad4 B32;
  21.145 -    CARD32 pad5 B32;
  21.146 -} xXF86DGAGetVidPageReply;
  21.147 -#define sz_xXF86DGAGetVidPageReply	32
  21.148 -
  21.149 -
  21.150 -typedef struct _XF86DGASetVidPage
  21.151 -{
  21.152 -    CARD8 reqType;              /* always DGAReqCode */
  21.153 -    CARD8 dgaReqType;           /* always X_XF86DGASetVidPage */
  21.154 -    CARD16 length B16;
  21.155 -    CARD16 screen B16;
  21.156 -    CARD16 vpage B16;
  21.157 -} xXF86DGASetVidPageReq;
  21.158 -#define sz_xXF86DGASetVidPageReq	8
  21.159 -
  21.160 -
  21.161 -typedef struct _XF86DGAQueryDirectVideo
  21.162 -{
  21.163 -    CARD8 reqType;              /* always DGAReqCode */
  21.164 -    CARD8 dgaReqType;           /* always X_DGAQueryVersion */
  21.165 -    CARD16 length B16;
  21.166 -    CARD16 screen B16;
  21.167 -    CARD16 pad B16;
  21.168 -} xXF86DGAQueryDirectVideoReq;
  21.169 -#define sz_xXF86DGAQueryDirectVideoReq	8
  21.170 -
  21.171 -typedef struct
  21.172 -{
  21.173 -    BYTE type;
  21.174 -    BOOL pad1;
  21.175 -    CARD16 sequenceNumber B16;
  21.176 -    CARD32 length B32;
  21.177 -    CARD32 flags B32;
  21.178 -    CARD32 pad B32;
  21.179 -    CARD32 pad2 B32;
  21.180 -    CARD32 pad3 B32;
  21.181 -    CARD32 pad4 B32;
  21.182 -    CARD32 pad5 B32;
  21.183 -} xXF86DGAQueryDirectVideoReply;
  21.184 -#define sz_xXF86DGAQueryDirectVideoReply 32
  21.185 -
  21.186 -
  21.187 -typedef struct _XF86DGAViewPortChanged
  21.188 -{
  21.189 -    CARD8 reqType;              /* always DGAReqCode */
  21.190 -    CARD8 dgaReqType;           /* always X_DGAQueryVersion */
  21.191 -    CARD16 length B16;
  21.192 -    CARD16 screen B16;
  21.193 -    CARD16 n B16;
  21.194 -} xXF86DGAViewPortChangedReq;
  21.195 -#define sz_xXF86DGAViewPortChangedReq	8
  21.196 -
  21.197 -typedef struct
  21.198 -{
  21.199 -    BYTE type;
  21.200 -    BOOL pad1;
  21.201 -    CARD16 sequenceNumber B16;
  21.202 -    CARD32 length B32;
  21.203 -    CARD32 result B32;
  21.204 -    CARD32 pad B32;
  21.205 -    CARD32 pad2 B32;
  21.206 -    CARD32 pad3 B32;
  21.207 -    CARD32 pad4 B32;
  21.208 -    CARD32 pad5 B32;
  21.209 -} xXF86DGAViewPortChangedReply;
  21.210 -#define sz_xXF86DGAViewPortChangedReply 32
  21.211 -
  21.212 -#endif /* _XF86DGASTR1_H_ */
  21.213 -/* vi: set ts=4 sw=4 expandtab: */
    22.1 --- a/src/video/Xext/extensions/xf86dgastr.h	Sun Feb 27 22:22:58 2011 -0800
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,372 +0,0 @@
    22.4 -/* $XFree86: xc/include/extensions/xf86dgastr.h,v 3.14 2001/08/01 00:44:36 tsi Exp $ */
    22.5 -/*
    22.6 -
    22.7 -Copyright (c) 1995  Jon Tombs
    22.8 -Copyright (c) 1995  XFree86 Inc.
    22.9 -
   22.10 -*/
   22.11 -
   22.12 -#ifndef _XF86DGASTR_H_
   22.13 -#define _XF86DGASTR_H_
   22.14 -
   22.15 -#include "xf86dga1str.h"
   22.16 -
   22.17 -#define XF86DGANAME "XFree86-DGA"
   22.18 -
   22.19 -#define XDGA_MAJOR_VERSION	2       /* current version numbers */
   22.20 -#define XDGA_MINOR_VERSION	0
   22.21 -
   22.22 -
   22.23 -typedef struct _XDGAQueryVersion
   22.24 -{
   22.25 -    CARD8 reqType;              /* always DGAReqCode */
   22.26 -    CARD8 dgaReqType;           /* always X_DGAQueryVersion */
   22.27 -    CARD16 length B16;
   22.28 -} xXDGAQueryVersionReq;
   22.29 -#define sz_xXDGAQueryVersionReq		4
   22.30 -
   22.31 -typedef struct
   22.32 -{
   22.33 -    BYTE type;                  /* X_Reply */
   22.34 -    BOOL pad1;
   22.35 -    CARD16 sequenceNumber B16;
   22.36 -    CARD32 length B32;
   22.37 -    CARD16 majorVersion B16;    /* major version of DGA protocol */
   22.38 -    CARD16 minorVersion B16;    /* minor version of DGA protocol */
   22.39 -    CARD32 pad2 B32;
   22.40 -    CARD32 pad3 B32;
   22.41 -    CARD32 pad4 B32;
   22.42 -    CARD32 pad5 B32;
   22.43 -    CARD32 pad6 B32;
   22.44 -} xXDGAQueryVersionReply;
   22.45 -#define sz_xXDGAQueryVersionReply	32
   22.46 -
   22.47 -typedef struct _XDGAQueryModes
   22.48 -{
   22.49 -    CARD8 reqType;
   22.50 -    CARD8 dgaReqType;
   22.51 -    CARD16 length B16;
   22.52 -    CARD32 screen B32;
   22.53 -} xXDGAQueryModesReq;
   22.54 -#define sz_xXDGAQueryModesReq		8
   22.55 -
   22.56 -typedef struct
   22.57 -{
   22.58 -    BYTE type;                  /* X_Reply */
   22.59 -    BOOL pad1;
   22.60 -    CARD16 sequenceNumber B16;
   22.61 -    CARD32 length B32;
   22.62 -    CARD32 number B32;          /* number of modes available */
   22.63 -    CARD32 pad2 B32;
   22.64 -    CARD32 pad3 B32;
   22.65 -    CARD32 pad4 B32;
   22.66 -    CARD32 pad5 B32;
   22.67 -    CARD32 pad6 B32;
   22.68 -} xXDGAQueryModesReply;
   22.69 -#define sz_xXDGAQueryModesReply	32
   22.70 -
   22.71 -
   22.72 -typedef struct _XDGASetMode
   22.73 -{
   22.74 -    CARD8 reqType;
   22.75 -    CARD8 dgaReqType;
   22.76 -    CARD16 length B16;
   22.77 -    CARD32 screen B32;
   22.78 -    CARD32 mode B32;            /* mode number to init */
   22.79 -    CARD32 pid B32;             /* Pixmap descriptor */
   22.80 -} xXDGASetModeReq;
   22.81 -#define sz_xXDGASetModeReq		16
   22.82 -
   22.83 -typedef struct
   22.84 -{
   22.85 -    BYTE type;                  /* X_Reply */
   22.86 -    BOOL pad1;
   22.87 -    CARD16 sequenceNumber B16;
   22.88 -    CARD32 length B32;
   22.89 -    CARD32 offset B32;          /* offset into framebuffer map */
   22.90 -    CARD32 flags B32;
   22.91 -    CARD32 pad2 B32;
   22.92 -    CARD32 pad3 B32;
   22.93 -    CARD32 pad4 B32;
   22.94 -    CARD32 pad5 B32;
   22.95 -} xXDGASetModeReply;
   22.96 -#define sz_xXDGASetModeReply	32
   22.97 -
   22.98 -typedef struct
   22.99 -{
  22.100 -    CARD8 byte_order;
  22.101 -    CARD8 depth;
  22.102 -    CARD16 num B16;
  22.103 -    CARD16 bpp B16;
  22.104 -    CARD16 name_size B16;
  22.105 -    CARD32 vsync_num B32;
  22.106 -    CARD32 vsync_den B32;
  22.107 -    CARD32 flags B32;
  22.108 -    CARD16 image_width B16;
  22.109 -    CARD16 image_height B16;
  22.110 -    CARD16 pixmap_width B16;
  22.111 -    CARD16 pixmap_height B16;
  22.112 -    CARD32 bytes_per_scanline B32;
  22.113 -    CARD32 red_mask B32;
  22.114 -    CARD32 green_mask B32;
  22.115 -    CARD32 blue_mask B32;
  22.116 -    CARD16 visual_class B16;
  22.117 -    CARD16 pad1 B16;
  22.118 -    CARD16 viewport_width B16;
  22.119 -    CARD16 viewport_height B16;
  22.120 -    CARD16 viewport_xstep B16;
  22.121 -    CARD16 viewport_ystep B16;
  22.122 -    CARD16 viewport_xmax B16;
  22.123 -    CARD16 viewport_ymax B16;
  22.124 -    CARD32 viewport_flags B32;
  22.125 -    CARD32 reserved1 B32;
  22.126 -    CARD32 reserved2 B32;
  22.127 -} xXDGAModeInfo;
  22.128 -#define sz_xXDGAModeInfo 72
  22.129 -
  22.130 -typedef struct _XDGAOpenFramebuffer
  22.131 -{
  22.132 -    CARD8 reqType;
  22.133 -    CARD8 dgaReqType;
  22.134 -    CARD16 length B16;
  22.135 -    CARD32 screen B32;
  22.136 -} xXDGAOpenFramebufferReq;
  22.137 -#define sz_xXDGAOpenFramebufferReq	8
  22.138 -
  22.139 -typedef struct
  22.140 -{
  22.141 -    BYTE type;                  /* X_Reply */
  22.142 -    BOOL pad1;
  22.143 -    CARD16 sequenceNumber B16;
  22.144 -    CARD32 length B32;          /* device name size if there is one */
  22.145 -    CARD32 mem1 B32;            /* physical memory */
  22.146 -    CARD32 mem2 B32;            /* spillover for _alpha_ */
  22.147 -    CARD32 size B32;            /* size of map in bytes */
  22.148 -    CARD32 offset B32;          /* optional offset into device */
  22.149 -    CARD32 extra B32;           /* extra info associated with the map */
  22.150 -    CARD32 pad2 B32;
  22.151 -} xXDGAOpenFramebufferReply;
  22.152 -#define sz_xXDGAOpenFramebufferReply	32
  22.153 -
  22.154 -
  22.155 -typedef struct _XDGACloseFramebuffer
  22.156 -{
  22.157 -    CARD8 reqType;
  22.158 -    CARD8 dgaReqType;
  22.159 -    CARD16 length B16;
  22.160 -    CARD32 screen B32;
  22.161 -} xXDGACloseFramebufferReq;
  22.162 -#define sz_xXDGACloseFramebufferReq	8
  22.163 -
  22.164 -
  22.165 -typedef struct _XDGASetViewport
  22.166 -{
  22.167 -    CARD8 reqType;
  22.168 -    CARD8 dgaReqType;
  22.169 -    CARD16 length B16;
  22.170 -    CARD32 screen B32;
  22.171 -    CARD16 x B16;
  22.172 -    CARD16 y B16;
  22.173 -    CARD32 flags B32;
  22.174 -} xXDGASetViewportReq;
  22.175 -#define sz_xXDGASetViewportReq	16
  22.176 -
  22.177 -
  22.178 -typedef struct _XDGAInstallColormap
  22.179 -{
  22.180 -    CARD8 reqType;
  22.181 -    CARD8 dgaReqType;
  22.182 -    CARD16 length B16;
  22.183 -    CARD32 screen B32;
  22.184 -    CARD32 cmap B32;
  22.185 -} xXDGAInstallColormapReq;
  22.186 -#define sz_xXDGAInstallColormapReq	12
  22.187 -
  22.188 -typedef struct _XDGASelectInput
  22.189 -{
  22.190 -    CARD8 reqType;
  22.191 -    CARD8 dgaReqType;
  22.192 -    CARD16 length B16;
  22.193 -    CARD32 screen B32;
  22.194 -    CARD32 mask B32;
  22.195 -} xXDGASelectInputReq;
  22.196 -#define sz_xXDGASelectInputReq	12
  22.197 -
  22.198 -typedef struct _XDGAFillRectangle
  22.199 -{
  22.200 -    CARD8 reqType;
  22.201 -    CARD8 dgaReqType;
  22.202 -    CARD16 length B16;
  22.203 -    CARD32 screen B32;
  22.204 -    CARD16 x B16;
  22.205 -    CARD16 y B16;
  22.206 -    CARD16 width B16;
  22.207 -    CARD16 height B16;
  22.208 -    CARD32 color B32;
  22.209 -} xXDGAFillRectangleReq;
  22.210 -#define sz_xXDGAFillRectangleReq	20
  22.211 -
  22.212 -
  22.213 -typedef struct _XDGACopyArea
  22.214 -{
  22.215 -    CARD8 reqType;
  22.216 -    CARD8 dgaReqType;
  22.217 -    CARD16 length B16;
  22.218 -    CARD32 screen B32;
  22.219 -    CARD16 srcx B16;
  22.220 -    CARD16 srcy B16;
  22.221 -    CARD16 width B16;
  22.222 -    CARD16 height B16;
  22.223 -    CARD16 dstx B16;
  22.224 -    CARD16 dsty B16;
  22.225 -} xXDGACopyAreaReq;
  22.226 -#define sz_xXDGACopyAreaReq	20
  22.227 -
  22.228 -typedef struct _XDGACopyTransparentArea
  22.229 -{
  22.230 -    CARD8 reqType;
  22.231 -    CARD8 dgaReqType;
  22.232 -    CARD16 length B16;
  22.233 -    CARD32 screen B32;
  22.234 -    CARD16 srcx B16;
  22.235 -    CARD16 srcy B16;
  22.236 -    CARD16 width B16;
  22.237 -    CARD16 height B16;
  22.238 -    CARD16 dstx B16;
  22.239 -    CARD16 dsty B16;
  22.240 -    CARD32 key B32;
  22.241 -} xXDGACopyTransparentAreaReq;
  22.242 -#define sz_xXDGACopyTransparentAreaReq	24
  22.243 -
  22.244 -
  22.245 -typedef struct _XDGAGetViewportStatus
  22.246 -{
  22.247 -    CARD8 reqType;
  22.248 -    CARD8 dgaReqType;
  22.249 -    CARD16 length B16;
  22.250 -    CARD32 screen B32;
  22.251 -} xXDGAGetViewportStatusReq;
  22.252 -#define sz_xXDGAGetViewportStatusReq	8
  22.253 -
  22.254 -typedef struct
  22.255 -{
  22.256 -    BYTE type;
  22.257 -    BOOL pad1;
  22.258 -    CARD16 sequenceNumber B16;
  22.259 -    CARD32 length B32;
  22.260 -    CARD32 status B32;
  22.261 -    CARD32 pad2 B32;
  22.262 -    CARD32 pad3 B32;
  22.263 -    CARD32 pad4 B32;
  22.264 -    CARD32 pad5 B32;
  22.265 -    CARD32 pad6 B32;
  22.266 -} xXDGAGetViewportStatusReply;
  22.267 -#define sz_xXDGAGetViewportStatusReply	32
  22.268 -
  22.269 -typedef struct _XDGASync
  22.270 -{
  22.271 -    CARD8 reqType;
  22.272 -    CARD8 dgaReqType;
  22.273 -    CARD16 length B16;
  22.274 -    CARD32 screen B32;
  22.275 -} xXDGASyncReq;
  22.276 -#define sz_xXDGASyncReq	8
  22.277 -
  22.278 -typedef struct
  22.279 -{
  22.280 -    BYTE type;
  22.281 -    BOOL pad1;
  22.282 -    CARD16 sequenceNumber B16;
  22.283 -    CARD32 length B32;
  22.284 -    CARD32 pad2 B32;
  22.285 -    CARD32 pad3 B32;
  22.286 -    CARD32 pad4 B32;
  22.287 -    CARD32 pad5 B32;
  22.288 -    CARD32 pad6 B32;
  22.289 -    CARD32 pad7 B32;
  22.290 -} xXDGASyncReply;
  22.291 -#define sz_xXDGASyncReply	32
  22.292 -
  22.293 -typedef struct _XDGASetClientVersion
  22.294 -{
  22.295 -    CARD8 reqType;
  22.296 -    CARD8 dgaReqType;
  22.297 -    CARD16 length B16;
  22.298 -    CARD16 major B16;
  22.299 -    CARD16 minor B16;
  22.300 -} xXDGASetClientVersionReq;
  22.301 -#define sz_xXDGASetClientVersionReq	8
  22.302 -
  22.303 -
  22.304 -typedef struct
  22.305 -{
  22.306 -    CARD8 reqType;
  22.307 -    CARD8 dgaReqType;
  22.308 -    CARD16 length B16;
  22.309 -    CARD32 screen B32;
  22.310 -    CARD16 x B16;
  22.311 -    CARD16 y B16;
  22.312 -    CARD32 flags B32;
  22.313 -} xXDGAChangePixmapModeReq;
  22.314 -#define sz_xXDGAChangePixmapModeReq	16
  22.315 -
  22.316 -typedef struct
  22.317 -{
  22.318 -    BYTE type;
  22.319 -    BOOL pad1;
  22.320 -    CARD16 sequenceNumber B16;
  22.321 -    CARD32 length B32;
  22.322 -    CARD16 x B16;
  22.323 -    CARD16 y B16;
  22.324 -    CARD32 pad3 B32;
  22.325 -    CARD32 pad4 B32;
  22.326 -    CARD32 pad5 B32;
  22.327 -    CARD32 pad6 B32;
  22.328 -    CARD32 pad7 B32;
  22.329 -} xXDGAChangePixmapModeReply;
  22.330 -#define sz_xXDGAChangePixmapModeReply	32
  22.331 -
  22.332 -typedef struct _XDGACreateColormap
  22.333 -{
  22.334 -    CARD8 reqType;
  22.335 -    CARD8 dgaReqType;
  22.336 -    CARD16 length B16;
  22.337 -    CARD32 screen B32;
  22.338 -    CARD32 id B32;
  22.339 -    CARD32 mode B32;
  22.340 -    CARD8 alloc;
  22.341 -    CARD8 pad1;
  22.342 -    CARD16 pad2;
  22.343 -} xXDGACreateColormapReq;
  22.344 -#define sz_xXDGACreateColormapReq	20
  22.345 -
  22.346 -
  22.347 -typedef struct
  22.348 -{
  22.349 -    union
  22.350 -    {
  22.351 -        struct
  22.352 -        {
  22.353 -            BYTE type;
  22.354 -            BYTE detail;
  22.355 -            CARD16 sequenceNumber B16;
  22.356 -        } u;
  22.357 -        struct
  22.358 -        {
  22.359 -            CARD32 pad0 B32;
  22.360 -            CARD32 time B32;
  22.361 -            INT16 dx B16;
  22.362 -            INT16 dy B16;
  22.363 -            INT16 screen B16;
  22.364 -            CARD16 state B16;
  22.365 -            CARD32 pad1 B32;
  22.366 -            CARD32 pad2 B32;
  22.367 -            CARD32 pad3 B32;
  22.368 -            CARD32 pad4 B32;
  22.369 -        } event;
  22.370 -    } u;
  22.371 -} dgaEvent;
  22.372 -
  22.373 -
  22.374 -#endif /* _XF86DGASTR_H_ */
  22.375 -/* vi: set ts=4 sw=4 expandtab: */
    23.1 --- a/src/video/Xext/extensions/xf86vmode.h	Sun Feb 27 22:22:58 2011 -0800
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,298 +0,0 @@
    23.4 -/* $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $ */
    23.5 -/*
    23.6 -
    23.7 -Copyright 1995  Kaleb S. KEITHLEY
    23.8 -
    23.9 -Permission is hereby granted, free of charge, to any person obtaining
   23.10 -a copy of this software and associated documentation files (the
   23.11 -"Software"), to deal in the Software without restriction, including
   23.12 -without limitation the rights to use, copy, modify, merge, publish,
   23.13 -distribute, sublicense, and/or sell copies of the Software, and to
   23.14 -permit persons to whom the Software is furnished to do so, subject to
   23.15 -the following conditions:
   23.16 -
   23.17 -The above copyright notice and this permission notice shall be
   23.18 -included in all copies or substantial portions of the Software.
   23.19 -
   23.20 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   23.21 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   23.22 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   23.23 -IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES 
   23.24 -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
   23.25 -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
   23.26 -OTHER DEALINGS IN THE SOFTWARE.
   23.27 -
   23.28 -Except as contained in this notice, the name of Kaleb S. KEITHLEY 
   23.29 -shall not be used in advertising or otherwise to promote the sale, use 
   23.30 -or other dealings in this Software without prior written authorization
   23.31 -from Kaleb S. KEITHLEY
   23.32 -
   23.33 -*/
   23.34 -/* $Xorg: xf86vmode.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $ */
   23.35 -
   23.36 -/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
   23.37 -
   23.38 -#ifndef _XF86VIDMODE_H_
   23.39 -#define _XF86VIDMODE_H_
   23.40 -
   23.41 -#include <X11/Xfuncproto.h>
   23.42 -#include <X11/Xmd.h>
   23.43 -#include "SDL_name.h"
   23.44 -
   23.45 -#define X_XF86VidModeQueryVersion	0
   23.46 -#define X_XF86VidModeGetModeLine	1
   23.47 -#define X_XF86VidModeModModeLine	2
   23.48 -#define X_XF86VidModeSwitchMode		3
   23.49 -#define X_XF86VidModeGetMonitor		4
   23.50 -#define X_XF86VidModeLockModeSwitch	5
   23.51 -#define X_XF86VidModeGetAllModeLines	6
   23.52 -#define X_XF86VidModeAddModeLine	7
   23.53 -#define X_XF86VidModeDeleteModeLine	8
   23.54 -#define X_XF86VidModeValidateModeLine	9
   23.55 -#define X_XF86VidModeSwitchToMode	10
   23.56 -#define X_XF86VidModeGetViewPort	11
   23.57 -#define X_XF86VidModeSetViewPort	12
   23.58 -/* new for version 2.x of this extension */
   23.59 -#define X_XF86VidModeGetDotClocks	13
   23.60 -#define X_XF86VidModeSetClientVersion	14
   23.61 -#define X_XF86VidModeSetGamma		15
   23.62 -#define X_XF86VidModeGetGamma		16
   23.63 -#define X_XF86VidModeGetGammaRamp	17
   23.64 -#define X_XF86VidModeSetGammaRamp	18
   23.65 -#define X_XF86VidModeGetGammaRampSize	19
   23.66 -
   23.67 -#define CLKFLAG_PROGRAMABLE		1
   23.68 -
   23.69 -#ifdef XF86VIDMODE_EVENTS
   23.70 -#define XF86VidModeNotify		0
   23.71 -#define XF86VidModeNumberEvents		(XF86VidModeNotify + 1)
   23.72 -
   23.73 -#define XF86VidModeNotifyMask		0x00000001
   23.74 -
   23.75 -#define XF86VidModeNonEvent		0
   23.76 -#define XF86VidModeModeChange		1
   23.77 -#else
   23.78 -#define XF86VidModeNumberEvents		0
   23.79 -#endif
   23.80 -
   23.81 -#define XF86VidModeBadClock		0
   23.82 -#define XF86VidModeBadHTimings		1
   23.83 -#define XF86VidModeBadVTimings		2
   23.84 -#define XF86VidModeModeUnsuitable	3
   23.85 -#define XF86VidModeExtensionDisabled	4
   23.86 -#define XF86VidModeClientNotLocal	5
   23.87 -#define XF86VidModeZoomLocked		6
   23.88 -#define XF86VidModeNumberErrors		(XF86VidModeZoomLocked + 1)
   23.89 -
   23.90 -#ifndef _XF86VIDMODE_SERVER_
   23.91 -
   23.92 -typedef struct
   23.93 -{
   23.94 -    unsigned short hdisplay;
   23.95 -    unsigned short hsyncstart;
   23.96 -    unsigned short hsyncend;
   23.97 -    unsigned short htotal;
   23.98 -    unsigned short hskew;
   23.99 -    unsigned short vdisplay;
  23.100 -    unsigned short vsyncstart;
  23.101 -    unsigned short vsyncend;
  23.102 -    unsigned short vtotal;
  23.103 -    unsigned int flags;
  23.104 -    int privsize;
  23.105 -#if defined(__cplusplus) || defined(c_plusplus)
  23.106 -    /* private is a C++ reserved word */
  23.107 -    INT32 *c_private;
  23.108 -#else
  23.109 -    INT32 *private;
  23.110 -#endif
  23.111 -} SDL_NAME(XF86VidModeModeLine);
  23.112 -
  23.113 -typedef struct
  23.114 -{
  23.115 -    unsigned int dotclock;
  23.116 -    unsigned short hdisplay;
  23.117 -    unsigned short hsyncstart;
  23.118 -    unsigned short hsyncend;
  23.119 -    unsigned short htotal;
  23.120 -    unsigned short hskew;
  23.121 -    unsigned short vdisplay;
  23.122 -    unsigned short vsyncstart;
  23.123 -    unsigned short vsyncend;
  23.124 -    unsigned short vtotal;
  23.125 -    unsigned int flags;
  23.126 -    int privsize;
  23.127 -#if defined(__cplusplus) || defined(c_plusplus)
  23.128 -    /* private is a C++ reserved word */
  23.129 -    INT32 *c_private;
  23.130 -#else
  23.131 -    INT32 *private;
  23.132 -#endif
  23.133 -} SDL_NAME(XF86VidModeModeInfo);
  23.134 -
  23.135 -typedef struct
  23.136 -{
  23.137 -    float hi;
  23.138 -    float lo;
  23.139 -} SDL_NAME(XF86VidModeSyncRange);
  23.140 -
  23.141 -typedef struct
  23.142 -{
  23.143 -    char *vendor;
  23.144 -    char *model;
  23.145 -    float EMPTY;
  23.146 -    unsigned char nhsync;
  23.147 -      SDL_NAME(XF86VidModeSyncRange) * hsync;
  23.148 -    unsigned char nvsync;
  23.149 -      SDL_NAME(XF86VidModeSyncRange) * vsync;
  23.150 -} SDL_NAME(XF86VidModeMonitor);
  23.151 -
  23.152 -typedef struct
  23.153 -{
  23.154 -    int type;                   /* of event */
  23.155 -    unsigned long serial;       /* # of last request processed by server */
  23.156 -    Bool send_event;            /* true if this came from a SendEvent req */
  23.157 -    Display *display;           /* Display the event was read from */
  23.158 -    Window root;                /* root window of event screen */
  23.159 -    int state;                  /* What happened */
  23.160 -    int kind;                   /* What happened */
  23.161 -    Bool forced;                /* extents of new region */
  23.162 -    Time time;                  /* event timestamp */
  23.163 -} SDL_NAME(XF86VidModeNotifyEvent);
  23.164 -
  23.165 -typedef struct
  23.166 -{
  23.167 -    float red;                  /* Red Gamma value */
  23.168 -    float green;                /* Green Gamma value */
  23.169 -    float blue;                 /* Blue Gamma value */
  23.170 -} SDL_NAME(XF86VidModeGamma);
  23.171 -
  23.172 -
  23.173 -#define SDL_XF86VidModeSelectNextMode(disp, scr) \
  23.174 -	SDL_NAME(XF86VidModeSwitchMode)(disp, scr, 1)
  23.175 -#define SDL_XF86VidModeSelectPrevMode(disp, scr) \
  23.176 -	SDL_NAME(XF86VidModeSwitchMode)(disp, scr, -1)
  23.177 -
  23.178 -_XFUNCPROTOBEGIN Bool SDL_NAME(XF86VidModeQueryVersion) (Display * /* dpy */ ,
  23.179 -                                                         int *
  23.180 -                                                         /* majorVersion */ ,
  23.181 -                                                         int *  /* minorVersion */
  23.182 -    );
  23.183 -
  23.184 -Bool SDL_NAME(XF86VidModeQueryExtension) (Display * /* dpy */ ,
  23.185 -                                          int * /* event_base */ ,
  23.186 -                                          int * /* error_base */
  23.187 -    );
  23.188 -
  23.189 -Bool SDL_NAME(XF86VidModeSetClientVersion) (Display *   /* dpy */
  23.190 -    );
  23.191 -
  23.192 -Bool SDL_NAME(XF86VidModeGetModeLine) (Display * /* dpy */ ,
  23.193 -                                       int /* screen */ ,
  23.194 -                                       int * /* dotclock */ ,
  23.195 -                                       SDL_NAME(XF86VidModeModeLine) *  /* modeline */
  23.196 -    );
  23.197 -
  23.198 -Bool SDL_NAME(XF86VidModeGetAllModeLines) (Display * /* dpy */ ,
  23.199 -                                           int /* screen */ ,
  23.200 -                                           int * /* modecount */ ,
  23.201 -                                           SDL_NAME(XF86VidModeModeInfo) ***    /* modelinesPtr */
  23.202 -    );
  23.203 -
  23.204 -Bool SDL_NAME(XF86VidModeAddModeLine) (Display * /* dpy */ ,
  23.205 -                                       int /* screen */ ,
  23.206 -                                       SDL_NAME(XF86VidModeModeInfo) *
  23.207 -                                       /* new modeline */ ,
  23.208 -                                       SDL_NAME(XF86VidModeModeInfo) *  /* after modeline */
  23.209 -    );
  23.210 -
  23.211 -Bool SDL_NAME(XF86VidModeDeleteModeLine) (Display * /* dpy */ ,
  23.212 -                                          int /* screen */ ,
  23.213 -                                          SDL_NAME(XF86VidModeModeInfo) *       /* modeline */
  23.214 -    );
  23.215 -
  23.216 -Bool SDL_NAME(XF86VidModeModModeLine) (Display * /* dpy */ ,
  23.217 -                                       int /* screen */ ,
  23.218 -                                       SDL_NAME(XF86VidModeModeLine) *  /* modeline */
  23.219 -    );
  23.220 -
  23.221 -Status SDL_NAME(XF86VidModeValidateModeLine) (Display * /* dpy */ ,
  23.222 -                                              int /* screen */ ,
  23.223 -                                              SDL_NAME(XF86VidModeModeInfo) *   /* modeline */
  23.224 -    );
  23.225 -
  23.226 -Bool SDL_NAME(XF86VidModeSwitchMode) (Display * /* dpy */ ,
  23.227 -                                      int /* screen */ ,
  23.228 -                                      int       /* zoom */
  23.229 -    );
  23.230 -
  23.231 -Bool SDL_NAME(XF86VidModeSwitchToMode) (Display * /* dpy */ ,
  23.232 -                                        int /* screen */ ,
  23.233 -                                        SDL_NAME(XF86VidModeModeInfo) * /* modeline */
  23.234 -    );
  23.235 -
  23.236 -Bool SDL_NAME(XF86VidModeLockModeSwitch) (Display * /* dpy */ ,
  23.237 -                                          int /* screen */ ,
  23.238 -                                          int   /* lock */
  23.239 -    );
  23.240 -
  23.241 -Bool SDL_NAME(XF86VidModeGetMonitor) (Display * /* dpy */ ,
  23.242 -                                      int /* screen */ ,
  23.243 -                                      SDL_NAME(XF86VidModeMonitor) *    /* monitor */
  23.244 -    );
  23.245 -
  23.246 -Bool SDL_NAME(XF86VidModeGetViewPort) (Display * /* dpy */ ,
  23.247 -                                       int /* screen */ ,
  23.248 -                                       int * /* x return */ ,
  23.249 -                                       int *    /* y return */
  23.250 -    );
  23.251 -
  23.252 -Bool SDL_NAME(XF86VidModeSetViewPort) (Display * /* dpy */ ,
  23.253 -                                       int /* screen */ ,
  23.254 -                                       int /* x */ ,
  23.255 -                                       int      /* y */
  23.256 -    );
  23.257 -
  23.258 -Bool SDL_NAME(XF86VidModeGetDotClocks) (Display * /* dpy */ ,
  23.259 -                                        int /* screen */ ,
  23.260 -                                        int * /* flags return */ ,
  23.261 -                                        int * /* number of clocks return */ ,
  23.262 -                                        int * /* max dot clock return */ ,
  23.263 -                                        int **  /* clocks return */
  23.264 -    );
  23.265 -
  23.266 -Bool SDL_NAME(XF86VidModeGetGamma) (Display * /* dpy */ ,
  23.267 -                                    int /* screen */ ,
  23.268 -                                    SDL_NAME(XF86VidModeGamma) *        /* Gamma */
  23.269 -    );
  23.270 -
  23.271 -Bool SDL_NAME(XF86VidModeSetGamma) (Display * /* dpy */ ,
  23.272 -                                    int /* screen */ ,
  23.273 -                                    SDL_NAME(XF86VidModeGamma) *        /* Gamma */
  23.274 -    );
  23.275 -
  23.276 -Bool SDL_NAME(XF86VidModeSetGammaRamp) (Display * /* dpy */ ,
  23.277 -                                        int /* screen */ ,
  23.278 -                                        int /* size */ ,
  23.279 -                                        unsigned short * /* red array */ ,
  23.280 -                                        unsigned short * /* green array */ ,
  23.281 -                                        unsigned short *        /* blue array */
  23.282 -    );
  23.283 -
  23.284 -Bool SDL_NAME(XF86VidModeGetGammaRamp) (Display * /* dpy */ ,
  23.285 -                                        int /* screen */ ,
  23.286 -                                        int /* size */ ,
  23.287 -                                        unsigned short * /* red array */ ,
  23.288 -                                        unsigned short * /* green array */ ,
  23.289 -                                        unsigned short *        /* blue array */
  23.290 -    );
  23.291 -
  23.292 -Bool SDL_NAME(XF86VidModeGetGammaRampSize) (Display * /* dpy */ ,
  23.293 -                                            int /* screen */ ,
  23.294 -                                            int *       /* size */
  23.295 -    );
  23.296 -
  23.297 -
  23.298 -_XFUNCPROTOEND
  23.299 -#endif
  23.300 -#endif
  23.301 -/* vi: set ts=4 sw=4 expandtab: */
    24.1 --- a/src/video/Xext/extensions/xf86vmstr.h	Sun Feb 27 22:22:58 2011 -0800
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,573 +0,0 @@
    24.4 -/* $XFree86: xc/include/extensions/xf86vmstr.h,v 3.27 2001/08/01 00:44:36 tsi Exp $ */
    24.5 -/*
    24.6 -
    24.7 -Copyright 1995  Kaleb S. KEITHLEY
    24.8 -
    24.9 -Permission is hereby granted, free of charge, to any person obtaining
   24.10 -a copy of this software and associated documentation files (the
   24.11 -"Software"), to deal in the Software without restriction, including
   24.12 -without limitation the rights to use, copy, modify, merge, publish,
   24.13 -distribute, sublicense, and/or sell copies of the Software, and to
   24.14 -permit persons to whom the Software is furnished to do so, subject to
   24.15 -the following conditions:
   24.16 -
   24.17 -The above copyright notice and this permission notice shall be
   24.18 -included in all copies or substantial portions of the Software.
   24.19 -
   24.20 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   24.21 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   24.22 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   24.23 -IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES 
   24.24 -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
   24.25 -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
   24.26 -OTHER DEALINGS IN THE SOFTWARE.
   24.27 -
   24.28 -Except as contained in this notice, the name of Kaleb S. KEITHLEY 
   24.29 -shall not be used in advertising or otherwise to promote the sale, use 
   24.30 -or other dealings in this Software without prior written authorization
   24.31 -from Kaleb S. KEITHLEY
   24.32 -
   24.33 -*/
   24.34 -/* $Xorg: xf86vmstr.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $ */
   24.35 -
   24.36 -/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
   24.37 -
   24.38 -#ifndef _XF86VIDMODESTR_H_
   24.39 -#define _XF86VIDMODESTR_H_
   24.40 -
   24.41 -#include "xf86vmode.h"
   24.42 -
   24.43 -#define XF86VIDMODENAME "XFree86-VidModeExtension"
   24.44 -
   24.45 -#define XF86VIDMODE_MAJOR_VERSION	2       /* current version numbers */
   24.46 -#define XF86VIDMODE_MINOR_VERSION	1
   24.47 -/*
   24.48 - * major version 0 == uses parameter-to-wire functions in XFree86 libXxf86vm.
   24.49 - * major version 1 == uses parameter-to-wire functions hard-coded in xvidtune
   24.50 - *                    client.
   24.51 - * major version 2 == uses new protocol version in XFree86 4.0.
   24.52 - */
   24.53 -
   24.54 -typedef struct _XF86VidModeQueryVersion
   24.55 -{
   24.56 -    CARD8 reqType;              /* always XF86VidModeReqCode */
   24.57 -    CARD8 xf86vidmodeReqType;   /* always X_XF86VidModeQueryVersion */
   24.58 -    CARD16 length B16;
   24.59 -} xXF86VidModeQueryVersionReq;
   24.60 -#define sz_xXF86VidModeQueryVersionReq	4
   24.61 -
   24.62 -typedef struct
   24.63 -{
   24.64 -    BYTE type;                  /* X_Reply */
   24.65 -    BOOL pad1;
   24.66 -    CARD16 sequenceNumber B16;
   24.67 -    CARD32 length B32;
   24.68 -    CARD16 majorVersion B16;    /* major version of XF86VidMode */
   24.69 -    CARD16 minorVersion B16;    /* minor version of XF86VidMode */
   24.70 -    CARD32 pad2 B32;
   24.71 -    CARD32 pad3 B32;
   24.72 -    CARD32 pad4 B32;
   24.73 -    CARD32 pad5 B32;
   24.74 -    CARD32 pad6 B32;
   24.75 -} xXF86VidModeQueryVersionReply;
   24.76 -#define sz_xXF86VidModeQueryVersionReply	32
   24.77 -
   24.78 -typedef struct _XF86VidModeGetModeLine
   24.79 -{
   24.80 -    CARD8 reqType;              /* always XF86VidModeReqCode */
   24.81 -    CARD8 xf86vidmodeReqType;
   24.82 -    CARD16 length B16;
   24.83 -    CARD16 screen B16;
   24.84 -    CARD16 pad B16;
   24.85 -} xXF86VidModeGetModeLineReq,
   24.86 -    xXF86VidModeGetAllModeLinesReq,
   24.87 -    xXF86VidModeGetMonitorReq,
   24.88 -    xXF86VidModeGetViewPortReq, xXF86VidModeGetDotClocksReq;
   24.89 -#define sz_xXF86VidModeGetModeLineReq		8
   24.90 -#define sz_xXF86VidModeGetAllModeLinesReq	8
   24.91 -#define sz_xXF86VidModeGetMonitorReq		8
   24.92 -#define sz_xXF86VidModeGetViewPortReq		8
   24.93 -#define sz_xXF86VidModeGetDotClocksReq		8
   24.94 -
   24.95 -typedef struct
   24.96 -{
   24.97 -    BYTE type;                  /* X_Reply */
   24.98 -    BOOL pad1;
   24.99 -    CARD16 sequenceNumber B16;
  24.100 -    CARD32 length B32;
  24.101 -    CARD32 dotclock B32;
  24.102 -    CARD16 hdisplay B16;
  24.103 -    CARD16 hsyncstart B16;
  24.104 -    CARD16 hsyncend B16;
  24.105 -    CARD16 htotal B16;
  24.106 -    CARD16 hskew B16;
  24.107 -    CARD16 vdisplay B16;
  24.108 -    CARD16 vsyncstart B16;
  24.109 -    CARD16 vsyncend B16;
  24.110 -    CARD16 vtotal B16;
  24.111 -    CARD16 pad2 B16;
  24.112 -    CARD32 flags B32;
  24.113 -    CARD32 reserved1 B32;
  24.114 -    CARD32 reserved2 B32;
  24.115 -    CARD32 reserved3 B32;
  24.116 -    CARD32 privsize B32;
  24.117 -} xXF86VidModeGetModeLineReply;
  24.118 -#define sz_xXF86VidModeGetModeLineReply	52
  24.119 -
  24.120 -/* 0.x version */
  24.121 -typedef struct
  24.122 -{
  24.123 -    BYTE type;                  /* X_Reply */
  24.124 -    BOOL pad1;
  24.125 -    CARD16 sequenceNumber B16;
  24.126 -    CARD32 length B32;
  24.127 -    CARD32 dotclock B32;
  24.128 -    CARD16 hdisplay B16;
  24.129 -    CARD16 hsyncstart B16;
  24.130 -    CARD16 hsyncend B16;
  24.131 -    CARD16 htotal B16;
  24.132 -    CARD16 vdisplay B16;
  24.133 -    CARD16 vsyncstart B16;
  24.134 -    CARD16 vsyncend B16;
  24.135 -    CARD16 vtotal B16;
  24.136 -    CARD32 flags B32;
  24.137 -    CARD32 privsize B32;
  24.138 -} xXF86OldVidModeGetModeLineReply;
  24.139 -#define sz_xXF86OldVidModeGetModeLineReply	36
  24.140 -
  24.141 -typedef struct
  24.142 -{
  24.143 -    CARD32 dotclock B32;
  24.144 -    CARD16 hdisplay B16;
  24.145 -    CARD16 hsyncstart B16;
  24.146 -    CARD16 hsyncend B16;
  24.147 -    CARD16 htotal B16;
  24.148 -    CARD32 hskew B16;
  24.149 -    CARD16 vdisplay B16;
  24.150 -    CARD16 vsyncstart B16;
  24.151 -    CARD16 vsyncend B16;
  24.152 -    CARD16 vtotal B16;
  24.153 -    CARD16 pad1 B16;
  24.154 -    CARD32 flags B32;
  24.155 -    CARD32 reserved1 B32;
  24.156 -    CARD32 reserved2 B32;
  24.157 -    CARD32 reserved3 B32;
  24.158 -    CARD32 privsize B32;
  24.159 -} xXF86VidModeModeInfo;
  24.160 -
  24.161 -/* 0.x version */
  24.162 -typedef struct
  24.163 -{
  24.164 -    CARD32 dotclock B32;
  24.165 -    CARD16 hdisplay B16;
  24.166 -    CARD16 hsyncstart B16;
  24.167 -    CARD16 hsyncend B16;
  24.168 -    CARD16 htotal B16;
  24.169 -    CARD16 vdisplay B16;
  24.170 -    CARD16 vsyncstart B16;
  24.171 -    CARD16 vsyncend B16;
  24.172 -    CARD16 vtotal B16;
  24.173 -    CARD32 flags B32;
  24.174 -    CARD32 privsize B32;
  24.175 -} xXF86OldVidModeModeInfo;
  24.176 -
  24.177 -typedef struct
  24.178 -{
  24.179 -    BYTE type;                  /* X_Reply */
  24.180 -    BOOL pad1;
  24.181 -    CARD16 sequenceNumber B16;
  24.182 -    CARD32 length B32;
  24.183 -    CARD32 modecount B32;
  24.184 -    CARD32 pad2 B32;
  24.185 -    CARD32 pad3 B32;
  24.186 -    CARD32 pad4 B32;
  24.187 -    CARD32 pad5 B32;
  24.188 -    CARD32 pad6 B32;
  24.189 -} xXF86VidModeGetAllModeLinesReply;
  24.190 -#define sz_xXF86VidModeGetAllModeLinesReply	32
  24.191 -
  24.192 -typedef struct _XF86VidModeAddModeLine
  24.193 -{
  24.194 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.195 -    CARD8 xf86vidmodeReqType;   /* always X_XF86VidModeAddMode */
  24.196 -    CARD16 length B16;
  24.197 -    CARD32 screen B32;          /* could be CARD16 but need the pad */
  24.198 -    CARD32 dotclock B32;
  24.199 -    CARD16 hdisplay B16;
  24.200 -    CARD16 hsyncstart B16;
  24.201 -    CARD16 hsyncend B16;
  24.202 -    CARD16 htotal B16;
  24.203 -    CARD16 hskew B16;
  24.204 -    CARD16 vdisplay B16;
  24.205 -    CARD16 vsyncstart B16;
  24.206 -    CARD16 vsyncend B16;
  24.207 -    CARD16 vtotal B16;
  24.208 -    CARD16 pad1 B16;
  24.209 -    CARD32 flags B32;
  24.210 -    CARD32 reserved1 B32;
  24.211 -    CARD32 reserved2 B32;
  24.212 -    CARD32 reserved3 B32;
  24.213 -    CARD32 privsize B32;
  24.214 -    CARD32 after_dotclock B32;
  24.215 -    CARD16 after_hdisplay B16;
  24.216 -    CARD16 after_hsyncstart B16;
  24.217 -    CARD16 after_hsyncend B16;
  24.218 -    CARD16 after_htotal B16;
  24.219 -    CARD16 after_hskew B16;
  24.220 -    CARD16 after_vdisplay B16;
  24.221 -    CARD16 after_vsyncstart B16;
  24.222 -    CARD16 after_vsyncend B16;
  24.223 -    CARD16 after_vtotal B16;
  24.224 -    CARD16 pad2 B16;
  24.225 -    CARD32 after_flags B32;
  24.226 -    CARD32 reserved4 B32;
  24.227 -    CARD32 reserved5 B32;
  24.228 -    CARD32 reserved6 B32;
  24.229 -} xXF86VidModeAddModeLineReq;
  24.230 -#define sz_xXF86VidModeAddModeLineReq	92
  24.231 -
  24.232 -/* 0.x version */
  24.233 -typedef struct _XF86OldVidModeAddModeLine
  24.234 -{
  24.235 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.236 -    CARD8 xf86vidmodeReqType;   /* always X_XF86VidModeAddMode */
  24.237 -    CARD16 length B16;
  24.238 -    CARD32 screen B32;          /* could be CARD16 but need the pad */
  24.239 -    CARD32 dotclock B32;
  24.240 -    CARD16 hdisplay B16;
  24.241 -    CARD16 hsyncstart B16;
  24.242 -    CARD16 hsyncend B16;
  24.243 -    CARD16 htotal B16;
  24.244 -    CARD16 vdisplay B16;
  24.245 -    CARD16 vsyncstart B16;
  24.246 -    CARD16 vsyncend B16;
  24.247 -    CARD16 vtotal B16;
  24.248 -    CARD32 flags B32;
  24.249 -    CARD32 privsize B32;
  24.250 -    CARD32 after_dotclock B32;
  24.251 -    CARD16 after_hdisplay B16;
  24.252 -    CARD16 after_hsyncstart B16;
  24.253 -    CARD16 after_hsyncend B16;
  24.254 -    CARD16 after_htotal B16;
  24.255 -    CARD16 after_vdisplay B16;
  24.256 -    CARD16 after_vsyncstart B16;
  24.257 -    CARD16 after_vsyncend B16;
  24.258 -    CARD16 after_vtotal B16;
  24.259 -    CARD32 after_flags B32;
  24.260 -} xXF86OldVidModeAddModeLineReq;
  24.261 -#define sz_xXF86OldVidModeAddModeLineReq	60
  24.262 -
  24.263 -typedef struct _XF86VidModeModModeLine
  24.264 -{
  24.265 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.266 -    CARD8 xf86vidmodeReqType;   /* always X_XF86VidModeModModeLine */
  24.267 -    CARD16 length B16;
  24.268 -    CARD32 screen B32;          /* could be CARD16 but need the pad */
  24.269 -    CARD16 hdisplay B16;
  24.270 -    CARD16 hsyncstart B16;
  24.271 -    CARD16 hsyncend B16;
  24.272 -    CARD16 htotal B16;
  24.273 -    CARD16 hskew B16;
  24.274 -    CARD16 vdisplay B16;
  24.275 -    CARD16 vsyncstart B16;
  24.276 -    CARD16 vsyncend B16;
  24.277 -    CARD16 vtotal B16;
  24.278 -    CARD16 pad1 B16;
  24.279 -    CARD32 flags B32;
  24.280 -    CARD32 reserved1 B32;
  24.281 -    CARD32 reserved2 B32;
  24.282 -    CARD32 reserved3 B32;
  24.283 -    CARD32 privsize B32;
  24.284 -} xXF86VidModeModModeLineReq;
  24.285 -#define sz_xXF86VidModeModModeLineReq	48
  24.286 -
  24.287 -/* 0.x version */
  24.288 -typedef struct _XF86OldVidModeModModeLine
  24.289 -{
  24.290 -    CARD8 reqType;              /* always XF86OldVidModeReqCode */
  24.291 -    CARD8 xf86vidmodeReqType;   /* always X_XF86OldVidModeModModeLine */
  24.292 -    CARD16 length B16;
  24.293 -    CARD32 screen B32;          /* could be CARD16 but need the pad */
  24.294 -    CARD16 hdisplay B16;
  24.295 -    CARD16 hsyncstart B16;
  24.296 -    CARD16 hsyncend B16;
  24.297 -    CARD16 htotal B16;
  24.298 -    CARD16 vdisplay B16;
  24.299 -    CARD16 vsyncstart B16;
  24.300 -    CARD16 vsyncend B16;
  24.301 -    CARD16 vtotal B16;
  24.302 -    CARD32 flags B32;
  24.303 -    CARD32 privsize B32;
  24.304 -} xXF86OldVidModeModModeLineReq;
  24.305 -#define sz_xXF86OldVidModeModModeLineReq	32
  24.306 -
  24.307 -typedef struct _XF86VidModeValidateModeLine
  24.308 -{
  24.309 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.310 -    CARD8 xf86vidmodeReqType;
  24.311 -    CARD16 length B16;
  24.312 -    CARD32 screen B32;          /* could be CARD16 but need the pad */
  24.313 -    CARD32 dotclock B32;
  24.314 -    CARD16 hdisplay B16;
  24.315 -    CARD16 hsyncstart B16;
  24.316 -    CARD16 hsyncend B16;
  24.317 -    CARD16 htotal B16;
  24.318 -    CARD16 hskew B16;
  24.319 -    CARD16 vdisplay B16;
  24.320 -    CARD16 vsyncstart B16;
  24.321 -    CARD16 vsyncend B16;
  24.322 -    CARD16 vtotal B16;
  24.323 -    CARD16 pad1 B16;
  24.324 -    CARD32 flags B32;
  24.325 -    CARD32 reserved1 B32;
  24.326 -    CARD32 reserved2 B32;
  24.327 -    CARD32 reserved3 B32;
  24.328 -    CARD32 privsize B32;
  24.329 -} xXF86VidModeDeleteModeLineReq,
  24.330 -    xXF86VidModeValidateModeLineReq, xXF86VidModeSwitchToModeReq;
  24.331 -#define sz_xXF86VidModeDeleteModeLineReq	52
  24.332 -#define sz_xXF86VidModeValidateModeLineReq	52
  24.333 -#define sz_xXF86VidModeSwitchToModeReq		52
  24.334 -
  24.335 -/* 0.x version */
  24.336 -typedef struct _XF86OldVidModeValidateModeLine
  24.337 -{
  24.338 -    CARD8 reqType;              /* always XF86OldVidModeReqCode */
  24.339 -    CARD8 xf86vidmodeReqType;
  24.340 -    CARD16 length B16;
  24.341 -    CARD32 screen B32;          /* could be CARD16 but need the pad */
  24.342 -    CARD32 dotclock B32;
  24.343 -    CARD16 hdisplay B16;
  24.344 -    CARD16 hsyncstart B16;
  24.345 -    CARD16 hsyncend B16;
  24.346 -    CARD16 htotal B16;
  24.347 -    CARD16 vdisplay B16;
  24.348 -    CARD16 vsyncstart B16;
  24.349 -    CARD16 vsyncend B16;
  24.350 -    CARD16 vtotal B16;
  24.351 -    CARD32 flags B32;
  24.352 -    CARD32 privsize B32;
  24.353 -} xXF86OldVidModeDeleteModeLineReq,
  24.354 -    xXF86OldVidModeValidateModeLineReq, xXF86OldVidModeSwitchToModeReq;
  24.355 -#define sz_xXF86OldVidModeDeleteModeLineReq	36
  24.356 -#define sz_xXF86OldVidModeValidateModeLineReq	36
  24.357 -#define sz_xXF86OldVidModeSwitchToModeReq	36
  24.358 -
  24.359 -typedef struct _XF86VidModeSwitchMode
  24.360 -{
  24.361 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.362 -    CARD8 xf86vidmodeReqType;   /* always X_XF86VidModeSwitchMode */
  24.363 -    CARD16 length B16;
  24.364 -    CARD16 screen B16;
  24.365 -    CARD16 zoom B16;
  24.366 -} xXF86VidModeSwitchModeReq;
  24.367 -#define sz_xXF86VidModeSwitchModeReq	8
  24.368 -
  24.369 -typedef struct _XF86VidModeLockModeSwitch
  24.370 -{
  24.371 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.372 -    CARD8 xf86vidmodeReqType;   /* always X_XF86VidModeLockModeSwitch */
  24.373 -    CARD16 length B16;
  24.374 -    CARD16 screen B16;
  24.375 -    CARD16 lock B16;
  24.376 -} xXF86VidModeLockModeSwitchReq;
  24.377 -#define sz_xXF86VidModeLockModeSwitchReq	8
  24.378 -
  24.379 -typedef struct
  24.380 -{
  24.381 -    BYTE type;                  /* X_Reply */
  24.382 -    BOOL pad1;
  24.383 -    CARD16 sequenceNumber B16;
  24.384 -    CARD32 length B32;
  24.385 -    CARD32 status B32;
  24.386 -    CARD32 pad2 B32;
  24.387 -    CARD32 pad3 B32;
  24.388 -    CARD32 pad4 B32;
  24.389 -    CARD32 pad5 B32;
  24.390 -    CARD32 pad6 B32;
  24.391 -} xXF86VidModeValidateModeLineReply;
  24.392 -#define sz_xXF86VidModeValidateModeLineReply	32
  24.393 -
  24.394 -typedef struct
  24.395 -{
  24.396 -    BYTE type;                  /* X_Reply */
  24.397 -    BOOL pad1;
  24.398 -    CARD16 sequenceNumber B16;
  24.399 -    CARD32 length B32;
  24.400 -    CARD8 vendorLength;
  24.401 -    CARD8 modelLength;
  24.402 -    CARD8 nhsync;
  24.403 -    CARD8 nvsync;
  24.404 -    CARD32 pad2 B32;
  24.405 -    CARD32 pad3 B32;
  24.406 -    CARD32 pad4 B32;
  24.407 -    CARD32 pad5 B32;
  24.408 -    CARD32 pad6 B32;
  24.409 -} xXF86VidModeGetMonitorReply;
  24.410 -#define sz_xXF86VidModeGetMonitorReply	32
  24.411 -
  24.412 -typedef struct
  24.413 -{
  24.414 -    BYTE type;
  24.415 -    BOOL pad1;
  24.416 -    CARD16 sequenceNumber B16;
  24.417 -    CARD32 length B32;
  24.418 -    CARD32 x B32;
  24.419 -    CARD32 y B32;
  24.420 -    CARD32 pad2 B32;
  24.421 -    CARD32 pad3 B32;
  24.422 -    CARD32 pad4 B32;
  24.423 -    CARD32 pad5 B32;
  24.424 -} xXF86VidModeGetViewPortReply;
  24.425 -#define sz_xXF86VidModeGetViewPortReply	32
  24.426 -
  24.427 -typedef struct _XF86VidModeSetViewPort
  24.428 -{
  24.429 -    CARD8 reqType;              /* always VidModeReqCode */
  24.430 -    CARD8 xf86vidmodeReqType;   /* always X_XF86VidModeSetViewPort */
  24.431 -    CARD16 length B16;
  24.432 -    CARD16 screen B16;
  24.433 -    CARD16 pad B16;
  24.434 -    CARD32 x B32;
  24.435 -    CARD32 y B32;
  24.436 -} xXF86VidModeSetViewPortReq;
  24.437 -#define sz_xXF86VidModeSetViewPortReq	16
  24.438 -
  24.439 -typedef struct
  24.440 -{
  24.441 -    BYTE type;
  24.442 -    BOOL pad1;
  24.443 -    CARD16 sequenceNumber B16;
  24.444 -    CARD32 length B32;
  24.445 -    CARD32 flags B32;
  24.446 -    CARD32 clocks B32;
  24.447 -    CARD32 maxclocks B32;
  24.448 -    CARD32 pad2 B32;
  24.449 -    CARD32 pad3 B32;
  24.450 -    CARD32 pad4 B32;
  24.451 -} xXF86VidModeGetDotClocksReply;
  24.452 -#define sz_xXF86VidModeGetDotClocksReply	32
  24.453 -
  24.454 -typedef struct _XF86VidModeSetClientVersion
  24.455 -{
  24.456 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.457 -    CARD8 xf86vidmodeReqType;
  24.458 -    CARD16 length B16;
  24.459 -    CARD16 major B16;
  24.460 -    CARD16 minor B16;
  24.461 -} xXF86VidModeSetClientVersionReq;
  24.462 -#define sz_xXF86VidModeSetClientVersionReq	8
  24.463 -
  24.464 -typedef struct _XF86VidModeGetGamma
  24.465 -{
  24.466 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.467 -    CARD8 xf86vidmodeReqType;
  24.468 -    CARD16 length B16;
  24.469 -    CARD16 screen B16;
  24.470 -    CARD16 pad B16;
  24.471 -    CARD32 pad1 B32;
  24.472 -    CARD32 pad2 B32;
  24.473 -    CARD32 pad3 B32;
  24.474 -    CARD32 pad4 B32;
  24.475 -    CARD32 pad5 B32;
  24.476 -    CARD32 pad6 B32;
  24.477 -} xXF86VidModeGetGammaReq;
  24.478 -#define sz_xXF86VidModeGetGammaReq		32
  24.479 -
  24.480 -typedef struct
  24.481 -{
  24.482 -    BYTE type;
  24.483 -    BOOL pad;
  24.484 -    CARD16 sequenceNumber B16;
  24.485 -    CARD32 length B32;
  24.486 -    CARD32 red B32;
  24.487 -    CARD32 green B32;
  24.488 -    CARD32 blue B32;
  24.489 -    CARD32 pad1 B32;
  24.490 -    CARD32 pad2 B32;
  24.491 -    CARD32 pad3 B32;
  24.492 -} xXF86VidModeGetGammaReply;
  24.493 -#define sz_xXF86VidModeGetGammaReply		32
  24.494 -
  24.495 -typedef struct _XF86VidModeSetGamma
  24.496 -{
  24.497 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.498 -    CARD8 xf86vidmodeReqType;
  24.499 -    CARD16 length B16;
  24.500 -    CARD16 screen B16;
  24.501 -    CARD16 pad B16;
  24.502 -    CARD32 red B32;
  24.503 -    CARD32 green B32;
  24.504 -    CARD32 blue B32;
  24.505 -    CARD32 pad1 B32;
  24.506 -    CARD32 pad2 B32;
  24.507 -    CARD32 pad3 B32;
  24.508 -} xXF86VidModeSetGammaReq;
  24.509 -#define sz_xXF86VidModeSetGammaReq		32
  24.510 -
  24.511 -
  24.512 -typedef struct _XF86VidModeSetGammaRamp
  24.513 -{
  24.514 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.515 -    CARD8 xf86vidmodeReqType;
  24.516 -    CARD16 length B16;
  24.517 -    CARD16 screen B16;
  24.518 -    CARD16 size B16;
  24.519 -} xXF86VidModeSetGammaRampReq;
  24.520 -#define sz_xXF86VidModeSetGammaRampReq             8
  24.521 -
  24.522 -typedef struct _XF86VidModeGetGammaRamp
  24.523 -{
  24.524 -    CARD8 reqType;              /* always XF86VidModeReqCode */
  24.525 -    CARD8 xf86vidmodeReqType;
  24.526 -    CARD16 length B16;
  24.527 -    CARD16 screen B16;
  24.528 -    CARD16 size B16;
  24.529 -} xXF86VidModeGetGammaRampReq;
  24.530 -#define sz_xXF86VidModeGetGammaRampReq             8
  24.531 -
  24.532 -typedef struct
  24.533 -{
  24.534 -    BYTE type;
  24.535 -    BOOL pad;
  24.536 -    CARD16 sequenceNumber B16;
  24.537 -    CARD32 length B32;
  24.538 -    CARD16 size B16;
  24.539 -    CARD16 pad0 B16;
  24.540 -    CARD32 pad1 B32;
  24.541 -    CARD32 pad2 B32;
  24.542 -    CARD32 pad3 B32;
  24.543 -    CARD32 pad4 B32;