Add config check and thread safe wrappers for the XRender library.

This commit is contained in:
Huw D M Davies 2001-09-14 01:04:25 +00:00 committed by Alexandre Julliard
parent 123d266965
commit ff453fcd38
8 changed files with 547 additions and 191 deletions

467
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -176,7 +176,7 @@ then
]
)
dnl *** All three of the following tests require X11/Xlib.h
dnl *** All of the following tests require X11/Xlib.h
AC_CHECK_HEADERS(X11/Xlib.h,
[
dnl *** Check for X keyboard extension
@ -261,6 +261,19 @@ then
AC_MSG_WARN([XVideo extension not found !!])
)
dnl *** Check for XRender extension
AC_CHECK_HEADERS(X11/extensions/Xrender.h,
[ dnl *** If X11/extensions/Xrender.h exists...
AC_CHECK_LIB(Xrender, XRenderQueryExtension,
[ AC_DEFINE(HAVE_LIBXRENDER, 1, [Define if you have the XRender extension library])
X_PRE_LIBS="$X_PRE_LIBS -lXrender"
],,
$X_LIBS -lXext -lX11 $X_EXTRA_LIBS
)
],
AC_MSG_WARN([XRender extension not found !!])
)
]
) dnl *** End of X11/Xlib.h check

View File

@ -187,6 +187,9 @@
/* Define if you have the <X11/extensions/XShm.h> header file. */
#undef HAVE_X11_EXTENSIONS_XSHM_H
/* Define if you have the <X11/extensions/Xrender.h> header file. */
#undef HAVE_X11_EXTENSIONS_XRENDER_H
/* Define if you have the <X11/extensions/Xvlib.h> header file. */
#undef HAVE_X11_EXTENSIONS_XVLIB_H
@ -454,6 +457,9 @@
/* Define if the X libraries support XVideo */
#undef HAVE_XVIDEO
/* Define if you have the XRender extension library */
#undef HAVE_LIBXRENDER
/* Define if OpenGL is present on the system */
#undef HAVE_OPENGL

38
include/ts_xrender.h Normal file
View File

@ -0,0 +1,38 @@
/*
* Thread safe wrappers around Xrender calls.
* Always include this file instead of <X11/Xrender.h>.
* This file was generated automatically by tools/make_X11wrappers
*
* Copyright 1998 Kristian Nielsen
*/
#ifndef __WINE_TS_XRENDER_H
#define __WINE_TS_XRENDER_H
#include "config.h"
#ifdef HAVE_LIBXRENDER
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern void TSXRenderAddGlyphs(Display*,GlyphSet,Glyph*,XGlyphInfo*,int,char*,int);
extern void TSXRenderCompositeString8(Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,char*,int);
extern void TSXRenderCompositeString16(Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,unsigned short*,int);
extern void TSXRenderCompositeString32(Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,unsigned int*,int);
extern GlyphSet TSXRenderCreateGlyphSet(Display*,XRenderPictFormat*);
extern Picture TSXRenderCreatePicture(Display*,Drawable,XRenderPictFormat*,unsigned long,XRenderPictureAttributes*);
extern void TSXRenderFillRectangle(Display*,int,Picture,XRenderColor*,int,int,unsigned int, unsigned int);
extern XRenderPictFormat* TSXRenderFindFormat(Display*,unsigned long,XRenderPictFormat*,int);
extern XRenderPictFormat* TSXRenderFindVisualFormat(Display*,Visual*);
extern void TSXRenderFreeGlyphSet(Display*,GlyphSet);
extern void TSXRenderFreePicture(Display*,Picture);
extern void TSXRenderSetPictureClipRectangles(Display*,Picture,int,int,XRectangle*,int);
extern Bool TSXRenderQueryExtension(Display*,int*,int*);
#endif /* defined(HAVE_LIBXRENDER) */
#endif /* __WINE_TS_XRENDER_H */

View File

@ -17,7 +17,7 @@
$X11_include_dir = "/usr/X11/include";
$outdir = "tsx11";
$wantfile = "$outdir/X11_calls";
@dolist = ("Xlib", "Xresource", "Xutil", "xpm", "XShm", "xf86dga", "xf86dga2", "xf86vmode", "shape", "xvideo");
@dolist = ("Xlib", "Xresource", "Xutil", "xpm", "XShm", "xf86dga", "xf86dga2", "xf86vmode", "shape", "xvideo", "Xrender");
# First read list of wanted function names.
@ -93,6 +93,12 @@ foreach $name (@dolist) {
$post_file = "#endif /* defined(HAVE_XVIDEO) */\n";
$inc_name = "Xvlib";
}
if($name eq "Xrender") {
$x11_incl = "#include <X11/Xlib.h>\n";
$extensions_dir = "extensions/";
$pre_file = "#ifdef HAVE_LIBXRENDER\n";
$post_file = "#endif /* defined(HAVE_LIBXRENDER) */\n";
}
print OUTH <<END;
@ -328,6 +334,73 @@ output_fn_short("XvImage *", "XvShmCreateImage", "Display*", "XvPortID", "int",
"Display*a0,int a1,int a2,int a3",
"a0,a1,a2,a3"
);
} elsif($name eq "Xrender") {
output_fn("XRenderAddGlyphs","void",
"Display*,GlyphSet,Glyph*,XGlyphInfo*,int,char*,int",
"Display*a0,GlyphSet a1,Glyph*a2,XGlyphInfo*a3,int a4,char*a5,int a6",
"a0,a1,a2,a3,a4,a5,a6"
);
output_fn("XRenderCompositeString8","void",
"Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,char*,int",
"Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,char*a10,int a11",
"a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11"
);
output_fn("XRenderCompositeString16","void",
"Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,unsigned short*,int",
"Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,unsigned short*a10,int a11",
"a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11"
);
output_fn("XRenderCompositeString32","void",
"Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,unsigned int*,int",
"Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,unsigned int*a10,int a11",
"a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11"
);
output_fn("XRenderCreateGlyphSet",GlyphSet,
"Display*,XRenderPictFormat*",
"Display*a0,XRenderPictFormat*a1",
"a0,a1"
);
output_fn("XRenderCreatePicture",Picture,
"Display*,Drawable,XRenderPictFormat*,unsigned long,XRenderPictureAttributes*",
"Display*a0,Drawable a1,XRenderPictFormat*a2,unsigned long a3,XRenderPictureAttributes*a4",
"a0,a1,a2,a3,a4"
);
output_fn("XRenderFillRectangle","void",
"Display*,int,Picture,XRenderColor*,int,int,unsigned int, unsigned int",
"Display*a0,int a1,Picture a2,XRenderColor*a3,int a4,int a5,unsigned int a6,unsigned int a7",
"a0,a1,a2,a3,a4,a5,a6,a7"
);
output_fn("XRenderFindFormat","XRenderPictFormat*",
"Display*,unsigned long,XRenderPictFormat*,int",
"Display*a0,unsigned long a1,XRenderPictFormat*a2,int a3",
"a0,a1,a2,a3"
);
output_fn("XRenderFindVisualFormat","XRenderPictFormat*",
"Display*,Visual*",
"Display*a0,Visual*a1",
"a0,a1"
);
output_fn("XRenderFreeGlyphSet","void",
"Display*,GlyphSet",
"Display*a0,GlyphSet a1",
"a0,a1"
);
output_fn("XRenderFreePicture","void",
"Display*,Picture",
"Display*a0,Picture a1",
"a0,a1"
);
output_fn("XRenderSetPictureClipRectangles","void",
"Display*,Picture,int,int,XRectangle*,int",
"Display*a0,Picture a1,int a2,int a3,XRectangle* a4,int a5",
"a0,a1,a2,a3,a4,a5"
);
output_fn("XRenderQueryExtension",Bool,
"Display*,int*,int*",
"Display*a0,int*a1,int*a2",
"a0,a1,a2"
);
} else {
open(IN,
"echo \"$x11_incl#include <X11/$extensions_dir$name.h>\" | " .
@ -404,6 +477,10 @@ output_fn_short("XvImage *", "XvShmCreateImage", "Display*", "XvPortID", "int",
"struct _XImage *, long",
"struct _XImage *a0, long a1", "a0, a1");
output_fn("XUniqueContext", "XContext", "void", "void", "");
output_fn("XDeleteContext", "int",
"Display*,XID,XContext",
"Display*a0,XID a1,XContext a2",
"a0,a1,a2");
}
print OUTH <<END;

View File

@ -16,6 +16,7 @@ C_SRCS = \
ts_xf86vmode.c \
ts_xshm.c \
ts_xlib.c \
ts_xrender.c \
ts_xresource.c \
ts_xvideo.c \
ts_xutil.c \

View File

@ -251,3 +251,16 @@ XvCreateImage
XvPutImage
XvShmPutImage
XvShmCreateImage
XRenderAddGlyphs
XRenderCompositeString16
XRenderCompositeString32
XRenderCompositeString8
XRenderCreateGlyphSet
XRenderCreatePicture
XRenderFillRectangle
XRenderFindFormat
XRenderFindVisualFormat
XRenderFreeGlyphSet
XRenderFreePicture
XRenderQueryExtension
XRenderSetPictureClipRectangles

119
tsx11/ts_xrender.c Normal file
View File

@ -0,0 +1,119 @@
/*
* Thread safe wrappers around Xrender calls.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#include "config.h"
#ifdef HAVE_LIBXRENDER
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
#include "ts_xrender.h"
void TSXRenderAddGlyphs(Display*a0,GlyphSet a1,Glyph*a2,XGlyphInfo*a3,int a4,char*a5,int a6)
{
wine_tsx11_lock();
XRenderAddGlyphs(a0,a1,a2,a3,a4,a5,a6);
wine_tsx11_unlock();
}
void TSXRenderCompositeString8(Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,char*a10,int a11)
{
wine_tsx11_lock();
XRenderCompositeString8(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11);
wine_tsx11_unlock();
}
void TSXRenderCompositeString16(Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,unsigned short*a10,int a11)
{
wine_tsx11_lock();
XRenderCompositeString16(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11);
wine_tsx11_unlock();
}
void TSXRenderCompositeString32(Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,unsigned int*a10,int a11)
{
wine_tsx11_lock();
XRenderCompositeString32(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11);
wine_tsx11_unlock();
}
GlyphSet TSXRenderCreateGlyphSet(Display*a0,XRenderPictFormat*a1)
{
GlyphSet r;
wine_tsx11_lock();
r = XRenderCreateGlyphSet(a0,a1);
wine_tsx11_unlock();
return r;
}
Picture TSXRenderCreatePicture(Display*a0,Drawable a1,XRenderPictFormat*a2,unsigned long a3,XRenderPictureAttributes*a4)
{
Picture r;
wine_tsx11_lock();
r = XRenderCreatePicture(a0,a1,a2,a3,a4);
wine_tsx11_unlock();
return r;
}
void TSXRenderFillRectangle(Display*a0,int a1,Picture a2,XRenderColor*a3,int a4,int a5,unsigned int a6,unsigned int a7)
{
wine_tsx11_lock();
XRenderFillRectangle(a0,a1,a2,a3,a4,a5,a6,a7);
wine_tsx11_unlock();
}
XRenderPictFormat* TSXRenderFindFormat(Display*a0,unsigned long a1,XRenderPictFormat*a2,int a3)
{
XRenderPictFormat* r;
wine_tsx11_lock();
r = XRenderFindFormat(a0,a1,a2,a3);
wine_tsx11_unlock();
return r;
}
XRenderPictFormat* TSXRenderFindVisualFormat(Display*a0,Visual*a1)
{
XRenderPictFormat* r;
wine_tsx11_lock();
r = XRenderFindVisualFormat(a0,a1);
wine_tsx11_unlock();
return r;
}
void TSXRenderFreeGlyphSet(Display*a0,GlyphSet a1)
{
wine_tsx11_lock();
XRenderFreeGlyphSet(a0,a1);
wine_tsx11_unlock();
}
void TSXRenderFreePicture(Display*a0,Picture a1)
{
wine_tsx11_lock();
XRenderFreePicture(a0,a1);
wine_tsx11_unlock();
}
void TSXRenderSetPictureClipRectangles(Display*a0,Picture a1,int a2,int a3,XRectangle* a4,int a5)
{
wine_tsx11_lock();
XRenderSetPictureClipRectangles(a0,a1,a2,a3,a4,a5);
wine_tsx11_unlock();
}
Bool TSXRenderQueryExtension(Display*a0,int*a1,int*a2)
{
Bool r;
wine_tsx11_lock();
r = XRenderQueryExtension(a0,a1,a2);
wine_tsx11_unlock();
return r;
}
#endif /* defined(HAVE_LIBXRENDER) */