Commit d94475bd authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Added the possibility to use DGA 2.0.

parent 26e1e714
......@@ -130,10 +130,11 @@ then
then
AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
fi
dnl Check for XFree86 DGA extension
dnl Check for XFree86 DGA / DGA 2.0 extension
AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86dga.h)
if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
then
AC_CHECK_LIB(Xxf86dga,XDGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA2) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
fi
......
......@@ -15,6 +15,9 @@
/* Define if you have the Xxf86dga library (-lXxf86dga). */
#undef HAVE_LIBXXF86DGA
/* Define if you have the Xxf86dga library version 2.0 (-lXxf86dga). */
#undef HAVE_LIBXXF86DGA2
/* Define if you have the X Shm extension */
#undef HAVE_LIBXXSHM
......
......@@ -52,6 +52,9 @@
/* Define if you have the Xxf86dga library (-lXxf86dga). */
#undef HAVE_LIBXXF86DGA
/* Define if you have the Xxf86dga library version 2.0 (-lXxf86dga). */
#undef HAVE_LIBXXF86DGA2
/* Define if you have the X Shm extension */
#undef HAVE_LIBXXSHM
......
/*
* Thread safe wrappers around xf86dga2 calls.
* Always include this file instead of <X11/xf86dga2.h>.
* This file was generated automatically by tools/make_X11wrappers
*
* Copyright 1998 Kristian Nielsen
*/
#ifndef __WINE_TS_XF86DGA2_H
#define __WINE_TS_XF86DGA2_H
#include "config.h"
#ifndef X_DISPLAY_MISSING
#ifdef HAVE_LIBXXF86DGA2
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
extern Bool TSXDGAQueryVersion(Display*, int*, int*);
extern Bool TSXDGAQueryExtension(Display*, int*, int*);
extern XDGAMode* TSXDGAQueryModes(Display*, int, int*);
extern XDGADevice* TSXDGASetMode(Display*, int, int);
extern Bool TSXDGAOpenFramebuffer(Display*, int);
extern void TSXDGACloseFramebuffer(Display*, int);
extern void TSXDGASetViewport(Display*, int, int, int, int);
extern void TSXDGAInstallColormap(Display*, int, Colormap);
extern Colormap TSXDGACreateColormap(Display*, int, XDGADevice*, int);
extern void TSXDGASelectInput(Display*, int, long);
extern void TSXDGAFillRectangle(Display*, int, int, int, unsigned int, unsigned int, unsigned long);
extern void TSXDGACopyArea(Display*, int, int, int, unsigned int, unsigned int, int, int);
extern void TSXDGACopyTransparentArea(Display*, int, int, int, unsigned int, unsigned int, int, int, unsigned long);
extern int TSXDGAGetViewportStatus(Display*, int);
extern void TSXDGASync(Display*, int);
extern Bool TSXDGASetClientVersion(Display*);
extern void TSXDGAChangePixmapMode(Display*, int, int*, int*, int);
extern void TSXDGAKeyEventToXKeyEvent(XDGAKeyEvent*, XKeyEvent*);
#endif /* defined(HAVE_LIBXXF86DGA2) */
#endif /* !defined(X_DISPLAY_MISSING) */
#endif /* __WINE_TS_XF86DGA2_H */
......@@ -14,10 +14,10 @@
#
# This program expects to be run from Wine's main directory.
$X11_include_dir = "/usr/X11R6/include";
$X11_include_dir = "/usr/X11/include";
$outdir = "tsx11";
$wantfile = "$outdir/X11_calls";
@dolist = ("Xlib", "Xresource", "Xutil", "xpm", "XShm", "xf86dga", "xf86vmode");
@dolist = ("Xlib", "Xresource", "Xutil", "xpm", "XShm", "xf86dga", "xf86dga2", "xf86vmode");
# First read list of wanted function names.
......@@ -46,6 +46,7 @@ foreach $name (@dolist) {
$extensions_dir = "";
$pre_file = "";
$post_file = "";
$inc_name = $name;
if($name eq "Xutil" || $name eq "Xresource" || $name eq "XShm") {
$x11_incl = "#include <X11/Xlib.h>\n";
# For Xutil, we need X11/Xresource.h for XUniqueContext().
......@@ -57,6 +58,13 @@ foreach $name (@dolist) {
$pre_file = "#ifdef HAVE_LIBXXF86DGA\n";
$post_file = "#endif /* defined(HAVE_LIBXXF86DGA) */\n";
}
if($name eq "xf86dga2") {
$x11_incl = "#include <X11/Xlib.h>\n";
$extensions_dir = "extensions/";
$pre_file = "#ifdef HAVE_LIBXXF86DGA2\n";
$post_file = "#endif /* defined(HAVE_LIBXXF86DGA2) */\n";
$inc_name = "xf86dga";
}
if($name eq "XShm") {
$extensions_dir = "extensions/";
$pre_file = "#ifdef HAVE_LIBXXSHM\n";
......@@ -90,7 +98,7 @@ foreach $name (@dolist) {
#ifndef X_DISPLAY_MISSING
$pre_file
$x11_incl#include <X11/$extensions_dir$name.h>
$x11_incl#include <X11/$extensions_dir$inc_name.h>
END
......@@ -106,7 +114,7 @@ END
#ifndef X_DISPLAY_MISSING
$pre_file
$x11_incl#include <X11/$extensions_dir$name.h>
$x11_incl#include <X11/$extensions_dir$inc_name.h>
#include "debugtools.h"
#include "ts_$lcname.h"
......@@ -196,6 +204,25 @@ END
"Display*a0,int a1,int a2",
"a0,a1,a2"
);
} elsif($name eq "xf86dga2") {
output_fn_short("Bool", "XDGAQueryVersion", "Display*" ,"int*","int*");
output_fn_short("Bool", "XDGAQueryExtension", "Display*" ,"int*","int*");
output_fn_short("XDGAMode*", "XDGAQueryModes", "Display*" ,"int", "int*");
output_fn_short("XDGADevice*", "XDGASetMode", "Display*" ,"int","int");
output_fn_short("Bool", "XDGAOpenFramebuffer", "Display*" ,"int");
output_fn_short("void", "XDGACloseFramebuffer", "Display*" ,"int");
output_fn_short("void", "XDGASetViewport", "Display*" ,"int", "int", "int", "int");
output_fn_short("void", "XDGAInstallColormap", "Display*" , "int", "Colormap");
output_fn_short("Colormap", "XDGACreateColormap", "Display*" ,"int", "XDGADevice*", "int");
output_fn_short("void", "XDGASelectInput", "Display*" ,"int", "long");
output_fn_short("void", "XDGAFillRectangle", "Display*" ,"int", "int", "int", "unsigned int", "unsigned int", "unsigned long");
output_fn_short("void", "XDGACopyArea", "Display*" ,"int", "int", "int", "unsigned int", "unsigned int", "int", "int");
output_fn_short("void", "XDGACopyTransparentArea", "Display*" ,"int", "int", "int", "unsigned int", "unsigned int", "int", "int", "unsigned long");
output_fn_short("int", "XDGAGetViewportStatus", "Display*" ,"int");
output_fn_short("void", "XDGASync", "Display*" ,"int");
output_fn_short("Bool", "XDGASetClientVersion", "Display*");
output_fn_short("void", "XDGAChangePixmapMode", "Display*" ,"int", "int*", "int*", "int");
output_fn_short("void", "XDGAKeyEventToXKeyEvent", "XDGAKeyEvent*" ,"XKeyEvent*");
} elsif($name eq "xf86vmode") {
output_fn("XF86VidModeQueryVersion",Bool,
"Display*,int*,int*",
......@@ -383,6 +410,38 @@ sub output_fn {
$actuals);
}
sub output_fn_short {
# Example call:
# output_fn_sort("Bool", "XDGAQueryExtension", "Display *", "int *", "int *");
#
my ($result_type, $fn_name, @args) = @_;
my ($i, $proto, $formals, $actuals) = (0,
"$result_type TS$fn_name(",
"$result_type TS$fn_name(",
"");
while ($val = shift @args) {
$proto = $proto . $val;
$formals = $formals . $val . " a$i";
$actuals = $actuals . " a$i";
$i++;
if (@args) {
$proto = $proto . ", ";
$formals = $formals . ", ";
$actuals = $actuals . ", ";
}
}
$proto = $proto . ")";
$formals = $formals . ")";
raw_output_fn($fn_name,
$result_type =~ /^\s*void\s*$/ ? "" : "$result_type r",
$proto,
$formals,
$actuals);
}
sub raw_output_fn {
# Example call:
# output_fn("main", "int r", "int main(int, char **)", "int main(int a0, char **a1)", "a0, a1")
......
......@@ -7,6 +7,7 @@ MODULE = tsx11
C_SRCS = \
ts_xf86dga.c \
ts_xf86dga2.c \
ts_xf86vmode.c \
ts_xshm.c \
ts_xlib.c \
......
......@@ -197,3 +197,21 @@ XF86VidModeLockModeSwitch
XF86VidModeGetMonitor
XF86VidModeGetViewPort
XF86VidModeSetViewPort
XDGAQueryExtension
XDGAQueryVersion
XDGAQueryModes
XDGASetMode
XDGAOpenFramebuffer
XDGACloseFramebuffer
XDGASetViewport
XDGAInstallColormap
XDGACreateColormap
XDGASelectInput
XDGAFillRectangle
XDGACopyArea
XDGACopyTransparentArea
XDGAGetViewportStatus
XDGASync
XDGASetClientVersion
XDGAChangePixmapMode
XDGAKeyEventToXKeyEvent
/*
* Thread safe wrappers around xf86dga2 calls.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#include "config.h"
#ifndef X_DISPLAY_MISSING
#ifdef HAVE_LIBXXF86DGA2
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
#include "debugtools.h"
#include "ts_xf86dga2.h"
#include "x11drv.h"
DEFAULT_DEBUG_CHANNEL(x11)
Bool TSXDGAQueryVersion(Display* a0, int* a1, int* a2)
{
Bool r;
TRACE("Call XDGAQueryVersion\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XDGAQueryVersion( a0, a1, a2);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAQueryVersion\n");
return r;
}
Bool TSXDGAQueryExtension(Display* a0, int* a1, int* a2)
{
Bool r;
TRACE("Call XDGAQueryExtension\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XDGAQueryExtension( a0, a1, a2);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAQueryExtension\n");
return r;
}
XDGAMode* TSXDGAQueryModes(Display* a0, int a1, int* a2)
{
XDGAMode* r;
TRACE("Call XDGAQueryModes\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XDGAQueryModes( a0, a1, a2);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAQueryModes\n");
return r;
}
XDGADevice* TSXDGASetMode(Display* a0, int a1, int a2)
{
XDGADevice* r;
TRACE("Call XDGASetMode\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XDGASetMode( a0, a1, a2);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGASetMode\n");
return r;
}
Bool TSXDGAOpenFramebuffer(Display* a0, int a1)
{
Bool r;
TRACE("Call XDGAOpenFramebuffer\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XDGAOpenFramebuffer( a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAOpenFramebuffer\n");
return r;
}
void TSXDGACloseFramebuffer(Display* a0, int a1)
{
TRACE("Call XDGACloseFramebuffer\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGACloseFramebuffer( a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGACloseFramebuffer\n");
}
void TSXDGASetViewport(Display* a0, int a1, int a2, int a3, int a4)
{
TRACE("Call XDGASetViewport\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGASetViewport( a0, a1, a2, a3, a4);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGASetViewport\n");
}
void TSXDGAInstallColormap(Display* a0, int a1, Colormap a2)
{
TRACE("Call XDGAInstallColormap\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGAInstallColormap( a0, a1, a2);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAInstallColormap\n");
}
Colormap TSXDGACreateColormap(Display* a0, int a1, XDGADevice* a2, int a3)
{
Colormap r;
TRACE("Call XDGACreateColormap\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XDGACreateColormap( a0, a1, a2, a3);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGACreateColormap\n");
return r;
}
void TSXDGASelectInput(Display* a0, int a1, long a2)
{
TRACE("Call XDGASelectInput\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGASelectInput( a0, a1, a2);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGASelectInput\n");
}
void TSXDGAFillRectangle(Display* a0, int a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned long a6)
{
TRACE("Call XDGAFillRectangle\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGAFillRectangle( a0, a1, a2, a3, a4, a5, a6);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAFillRectangle\n");
}
void TSXDGACopyArea(Display* a0, int a1, int a2, int a3, unsigned int a4, unsigned int a5, int a6, int a7)
{
TRACE("Call XDGACopyArea\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGACopyArea( a0, a1, a2, a3, a4, a5, a6, a7);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGACopyArea\n");
}
void TSXDGACopyTransparentArea(Display* a0, int a1, int a2, int a3, unsigned int a4, unsigned int a5, int a6, int a7, unsigned long a8)
{
TRACE("Call XDGACopyTransparentArea\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGACopyTransparentArea( a0, a1, a2, a3, a4, a5, a6, a7, a8);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGACopyTransparentArea\n");
}
int TSXDGAGetViewportStatus(Display* a0, int a1)
{
int r;
TRACE("Call XDGAGetViewportStatus\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XDGAGetViewportStatus( a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAGetViewportStatus\n");
return r;
}
void TSXDGASync(Display* a0, int a1)
{
TRACE("Call XDGASync\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGASync( a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGASync\n");
}
Bool TSXDGASetClientVersion(Display* a0)
{
Bool r;
TRACE("Call XDGASetClientVersion\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XDGASetClientVersion( a0);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGASetClientVersion\n");
return r;
}
void TSXDGAChangePixmapMode(Display* a0, int a1, int* a2, int* a3, int a4)
{
TRACE("Call XDGAChangePixmapMode\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGAChangePixmapMode( a0, a1, a2, a3, a4);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAChangePixmapMode\n");
}
void TSXDGAKeyEventToXKeyEvent(XDGAKeyEvent* a0, XKeyEvent* a1)
{
TRACE("Call XDGAKeyEventToXKeyEvent\n");
EnterCriticalSection( &X11DRV_CritSection );
XDGAKeyEventToXKeyEvent( a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XDGAKeyEventToXKeyEvent\n");
}
#endif /* defined(HAVE_LIBXXF86DGA2) */
#endif /* !defined(X_DISPLAY_MISSING) */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment