Removed the ts_xlib files.

This commit is contained in:
Alexandre Julliard 2003-11-21 21:50:59 +00:00
parent 64c0e2ac96
commit 15c64e704b
22 changed files with 11 additions and 497 deletions

View File

@ -30,7 +30,6 @@ C_SRCS = \
mouse.c \
scroll.c \
settings.c \
ts_xlib.c \
window.c \
winpos.c \
x11ddraw.c \

View File

@ -1,22 +0,0 @@
# This file contains the list of X11 calls that Wine uses and which must be
# protected by a critical section for multi-threaded use.
#
# To add a new call, put it on this list and run tools/make_X11wrappers.
# Also read the comments at the top of tools/make_X11wrappers.
#
XChangeProperty
XFree
XFreeFont
XGetAtomName
XGetFontProperty
XGetSelectionOwner
XGetWindowProperty
XKeycodeToKeysym
XKeysymToKeycode
XKeysymToString
XMapWindow
XQueryPointer
XQueryTree
XSetSelectionOwner
XSync
XUnmapWindow

View File

@ -20,8 +20,7 @@
#include "config.h"
#include <X11/cursorfont.h>
#include "ts_xlib.h"
#include <X11/Xlib.h>
#include "wine/winuser16.h"
#include "win.h"

View File

@ -23,8 +23,7 @@
#include "config.h"
#include <stdarg.h>
#include "ts_xlib.h"
#include <X11/Xlib.h>
#include "windef.h"
#include "winbase.h"

View File

@ -1,160 +0,0 @@
/*
* Thread safe wrappers around Xlib calls.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#include "config.h"
#ifdef HAVE_X11_XLIB_H
#include <X11/Xlib.h>
#include "ts_xlib.h"
char * TSXGetAtomName(Display* a0, Atom a1)
{
char * r;
wine_tsx11_lock();
r = XGetAtomName(a0, a1);
wine_tsx11_unlock();
return r;
}
char * TSXKeysymToString(KeySym a0)
{
char * r;
wine_tsx11_lock();
r = XKeysymToString(a0);
wine_tsx11_unlock();
return r;
}
Window TSXGetSelectionOwner(Display* a0, Atom a1)
{
Window r;
wine_tsx11_lock();
r = XGetSelectionOwner(a0, a1);
wine_tsx11_unlock();
return r;
}
KeySym TSXKeycodeToKeysym(Display* a0, unsigned int a1, int a2)
{
KeySym r;
wine_tsx11_lock();
r = XKeycodeToKeysym(a0, a1, a2);
wine_tsx11_unlock();
return r;
}
int TSXChangeProperty(Display* a0, Window a1, Atom a2, Atom a3, int a4, int a5, const unsigned char* a6, int a7)
{
int r;
wine_tsx11_lock();
r = XChangeProperty(a0, a1, a2, a3, a4, a5, a6, a7);
wine_tsx11_unlock();
return r;
}
int TSXFree(void* a0)
{
int r;
wine_tsx11_lock();
r = XFree(a0);
wine_tsx11_unlock();
return r;
}
int TSXFreeFont(Display* a0, XFontStruct* a1)
{
int r;
wine_tsx11_lock();
r = XFreeFont(a0, a1);
wine_tsx11_unlock();
return r;
}
int TSXGetFontProperty(XFontStruct* a0, Atom a1, unsigned long* a2)
{
int r;
wine_tsx11_lock();
r = XGetFontProperty(a0, a1, a2);
wine_tsx11_unlock();
return r;
}
int TSXGetWindowProperty(Display* a0, Window a1, Atom a2, long a3, long a4, int a5, Atom a6, Atom* a7, int* a8, unsigned long* a9, unsigned long* a10, unsigned char** a11)
{
int r;
wine_tsx11_lock();
r = XGetWindowProperty(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
wine_tsx11_unlock();
return r;
}
KeyCode TSXKeysymToKeycode(Display* a0, KeySym a1)
{
KeyCode r;
wine_tsx11_lock();
r = XKeysymToKeycode(a0, a1);
wine_tsx11_unlock();
return r;
}
int TSXMapWindow(Display* a0, Window a1)
{
int r;
wine_tsx11_lock();
r = XMapWindow(a0, a1);
wine_tsx11_unlock();
return r;
}
int TSXQueryPointer(Display* a0, Window a1, Window* a2, Window* a3, int* a4, int* a5, int* a6, int* a7, unsigned int* a8)
{
int r;
wine_tsx11_lock();
r = XQueryPointer(a0, a1, a2, a3, a4, a5, a6, a7, a8);
wine_tsx11_unlock();
return r;
}
int TSXQueryTree(Display* a0, Window a1, Window* a2, Window* a3, Window** a4, unsigned int* a5)
{
int r;
wine_tsx11_lock();
r = XQueryTree(a0, a1, a2, a3, a4, a5);
wine_tsx11_unlock();
return r;
}
int TSXSetSelectionOwner(Display* a0, Atom a1, Window a2, Time a3)
{
int r;
wine_tsx11_lock();
r = XSetSelectionOwner(a0, a1, a2, a3);
wine_tsx11_unlock();
return r;
}
int TSXSync(Display* a0, int a1)
{
int r;
wine_tsx11_lock();
r = XSync(a0, a1);
wine_tsx11_unlock();
return r;
}
int TSXUnmapWindow(Display* a0, Window a1)
{
int r;
wine_tsx11_lock();
r = XUnmapWindow(a0, a1);
wine_tsx11_unlock();
return r;
}
#endif /* defined(HAVE_X11_XLIB_H) */

View File

@ -1,41 +0,0 @@
/*
* Thread safe wrappers around Xlib calls.
* Always include this file instead of <X11/Xlib.h>.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#ifndef __WINE_TS_XLIB_H
#define __WINE_TS_XLIB_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#ifdef HAVE_X11_XLIB_H
#include <X11/Xlib.h>
extern void wine_tsx11_lock(void);
extern void wine_tsx11_unlock(void);
extern char * TSXGetAtomName(Display*, Atom);
extern char * TSXKeysymToString(KeySym);
extern Window TSXGetSelectionOwner(Display*, Atom);
extern KeySym TSXKeycodeToKeysym(Display*, unsigned int, int);
extern int TSXChangeProperty(Display*, Window, Atom, Atom, int, int, const unsigned char*, int);
extern int TSXFree(void*);
extern int TSXFreeFont(Display*, XFontStruct*);
extern int TSXGetFontProperty(XFontStruct*, Atom, unsigned long*);
extern int TSXGetWindowProperty(Display*, Window, Atom, long, long, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
extern KeyCode TSXKeysymToKeycode(Display*, KeySym);
extern int TSXMapWindow(Display*, Window);
extern int TSXQueryPointer(Display*, Window, Window*, Window*, int*, int*, int*, int*, unsigned int*);
extern int TSXQueryTree(Display*, Window, Window*, Window*, Window**, unsigned int*);
extern int TSXSetSelectionOwner(Display*, Atom, Window, Time);
extern int TSXSync(Display*, int);
extern int TSXUnmapWindow(Display*, Window);
#endif /* defined(HAVE_X11_XLIB_H) */
#endif /* __WINE_TS_XLIB_H */

View File

@ -21,10 +21,10 @@
#include "config.h"
#include <string.h>
#include <X11/Xlib.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ts_xlib.h"
#include "x11drv.h"
#include "x11ddraw.h"
#include "xvidmode.h"

View File

@ -33,7 +33,7 @@
# include <unistd.h>
#endif
#include <X11/cursorfont.h>
#include "ts_xlib.h"
#include <X11/Xlib.h>
#ifdef HAVE_XKB
#include <X11/XKBlib.h>
#endif

View File

@ -24,8 +24,7 @@
#ifdef HAVE_LIBXRANDR
#include "ts_xlib.h"
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include "x11drv.h"

View File

@ -43,7 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(xrender);
#ifdef HAVE_X11_EXTENSIONS_XRENDER_H
#include "ts_xlib.h"
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
static XRenderPictFormat *screen_format; /* format of screen */

View File

@ -20,14 +20,12 @@
#include "config.h"
#include <X11/Intrinsic.h>
#include "ts_xlib.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <X11/Intrinsic.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"

View File

@ -21,8 +21,6 @@
#include "config.h"
#include "ts_xlib.h"
#include <stdio.h>
#include <stdlib.h>
#include "gdi.h"

View File

@ -20,9 +20,8 @@
#include "config.h"
#include "ts_xlib.h"
#include <stdlib.h>
#include "bitmap.h"
#include "x11drv.h"
#include "wine/debug.h"

View File

@ -20,8 +20,6 @@
#include "config.h"
#include "ts_xlib.h"
#include <stdio.h>
#include "gdi.h"

View File

@ -20,8 +20,6 @@
#include "config.h"
#include "ts_xlib.h"
#include <math.h>
#include <stdarg.h>

View File

@ -20,7 +20,7 @@
#include "config.h"
#include "ts_xlib.h"
#include <X11/Xlib.h>
#ifdef HAVE_LIBXXSHM
#include <X11/extensions/XShm.h>
# ifdef HAVE_SYS_SHM_H

View File

@ -25,12 +25,6 @@
#include "config.h"
#include <X11/Intrinsic.h>
#include "ts_xlib.h"
#include <X11/Xresource.h>
#include <X11/Xutil.h>
#include <math.h>
#ifdef HAVE_FLOAT_H
# include <float.h>
@ -40,6 +34,7 @@
#define PI M_PI
#endif
#include <string.h>
#include <X11/Intrinsic.h>
#include "x11drv.h"
#include "x11font.h"

View File

@ -20,8 +20,6 @@
#include "config.h"
#include "ts_xlib.h"
#include <stdarg.h>
#include <string.h>

View File

@ -21,8 +21,6 @@
#include "config.h"
#include "wine/port.h"
#include "ts_xlib.h"
#include <stdlib.h>
#include <string.h>

View File

@ -20,8 +20,6 @@
#include "config.h"
#include "ts_xlib.h"
#include <stdlib.h>
#include <string.h>

View File

@ -20,10 +20,6 @@
#include "config.h"
#include <X11/Xatom.h>
#include "ts_xlib.h"
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>

View File

@ -1,235 +0,0 @@
#!/usr/bin/perl -w
# Create threads safe wrappers around X11 calls.
#
# Copyright 1998 Kristian Nielsen.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# FIXME: This does not do full C prototype parsing, but relies on
# knowledge on how the X11 include files are formatted. It will
# probably need to be modified for new include files. It also fails
# for certain prototypes (notably those with function pointer
# arguments or results), so these must be added manually. And it
# relies on a fixed location of X11 includes (/usr/X11R6/include/).
#
# This program expects to be run from Wine's main directory.
$X11_include_dir = "/usr/X11/include";
$outdir = "dlls/x11drv";
$wantfile = "$outdir/X11_calls";
@dolist = ("Xlib");
# First read list of wanted function names.
open(WANT, $wantfile) || die "open";
while(<WANT>) {
next if /^\s*\#/; # Skip comment lines.
next if /^\s*$/; # Skip empty lines.
if(/^\s*([a-zA-Z0-9_]+)\s*$/) {
$want{$1} = 1;
} else {
die "syntax error in file '$wantfile', in line '$_'";
}
}
close(WANT);
foreach $name (@dolist) {
$ucname = uc $name;
$lcname = lc $name;
$outfile = "/ts_$lcname";
open(OUTC, ">$outdir/$outfile.c") || die "open";
open(OUTH, ">$outdir/$outfile.h") || die "open";
$x11_incl = "";
$extensions_dir = "";
$pre_file = "#ifdef HAVE_X11_XLIB_H\n";
$post_file = "#endif /* defined(HAVE_X11_XLIB_H) */\n";
$inc_name = $name;
print OUTH <<END;
/*
* Thread safe wrappers around $name calls.
* Always include this file instead of <X11/$name.h>.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#ifndef __WINE_TS_$ucname\_H
#define __WINE_TS_$ucname\_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
$pre_file
$x11_incl#include <X11/$extensions_dir$inc_name.h>
extern void wine_tsx11_lock(void);
extern void wine_tsx11_unlock(void);
END
print OUTC <<END;
/*
* Thread safe wrappers around $name calls.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#include "config.h"
$pre_file
$x11_incl#include <X11/$extensions_dir$inc_name.h>
#include "ts_$lcname.h"
END
open(IN,
"echo \"$x11_incl#include <X11/$extensions_dir$name.h>\" | " .
"gcc -L$X11_include_dir -DNeedFunctionPrototypes -E - | " .
"grep -v '^[ \t]*\$)' |"
) || die "open";
PROTO: while(<IN>) {
if(m'extern\s+([^()]*)\b([a-zA-Z0-9_]+)\s*\(') {
$result_type = $1;
$fn_name = $2;
$result_type = "int" if $result_type =~ /^\s*$/;
@args = ();
while(<IN>) {
last if m'\)\s*;';
# Give up on vararg functions and function pointer args.
if(m'\.\.\.|\(\*\)') {
undef $fn_name;
last;
}
if(m'\s*([^,]*[^, \t])\s*(,?\n)') {
$args[$#args+1] = $1;
if ($1 =~ /char\s*\[/) { # small hack for XQueryKeymap
$args[$#args] = "char*";
}
}
}
# Skip if vararg, function pointer arg, or not needed.
next unless $fn_name;
next unless $want{$fn_name} && $want{$fn_name} == 1;
# Special case for no arguments (which is specified as "void").
if($#args == 0 && $args[0] eq "void") {
@args = ();
}
$proto = "";
$formals = "";
$actuals = "";
for($i = 0; $i <= $#args; $i++) {
$comma = $i < $#args ? ", " : "";
$proto .= "$args[$i]$comma";
$formals .= "$args[$i] a$i$comma";
$actuals .= "a$i$comma";
}
$proto = $formals = "void" if $#args == -1;
output_fn($fn_name, $result_type, $proto, $formals, $actuals);
}
}
print OUTH <<END;
$post_file
#endif /* __WINE_TS_$ucname\_H */
END
print OUTC "\n", $post_file;
}
foreach $i (keys %want) {
if($want{$i} == 1) {
print "Unresolved: $i\n";
}
}
sub output_fn {
# Example call:
# output_fn("main", "int", "int, char **", "int a0, char **a1", "a0, a1")
#
my ($fn_name, $result_type, $protos, $formals, $actuals) = @_;
return raw_output_fn($fn_name,
$result_type =~ /^\s*void\s*$/ ? "" : "$result_type r",
"$result_type TS$fn_name($protos)",
"$result_type TS$fn_name($formals)",
$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")
#
my ($fn_name, $resultdecl, $protodecl, $defdecl, $actuals) = @_;
return undef unless $want{$fn_name} && $want{$fn_name} == 1;
print OUTC "\n$defdecl\n";
print OUTH "extern $protodecl;\n";
# print OUTH "#define $fn_name TS$fn_name\n";
print OUTC "{\n";
print OUTC " $resultdecl;\n" if $resultdecl;
print OUTC " wine_tsx11_lock();\n";
print OUTC " ";
print OUTC "r = " if $resultdecl;
print OUTC "$fn_name($actuals);\n";
print OUTC " wine_tsx11_unlock();\n";
print OUTC " return r;\n" if $resultdecl;
print OUTC "}\n";
$want{$fn_name} = 2;
return 1;
}