Removed some more TSX11 functions and files.

This commit is contained in:
Alexandre Julliard 2002-09-24 18:36:51 +00:00
parent b5bb32c09a
commit e9119c198d
23 changed files with 185 additions and 655 deletions

View File

@ -23,7 +23,8 @@
#ifdef HAVE_LIBXXF86DGA2 #ifdef HAVE_LIBXXF86DGA2
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xf86dga2.h" #include <X11/extensions/xf86dga.h>
#include "x11drv.h" #include "x11drv.h"
#include "x11ddraw.h" #include "x11ddraw.h"
#include "dga2.h" #include "dga2.h"
@ -75,25 +76,31 @@ void X11DRV_XF86DGA2_Init(void)
if (!usedga) return; if (!usedga) return;
if (!TSXDGAQueryExtension(gdi_display, &dga_event, &dga_error)) return; wine_tsx11_lock();
ok = XDGAQueryExtension(gdi_display, &dga_event, &dga_error);
if (ok)
{
X11DRV_expect_error(gdi_display, DGA2ErrorHandler, NULL); X11DRV_expect_error(gdi_display, DGA2ErrorHandler, NULL);
ok = TSXDGAQueryVersion(gdi_display, &major, &minor); ok = XDGAQueryVersion(gdi_display, &major, &minor);
if (X11DRV_check_error()) ok = FALSE; if (X11DRV_check_error()) ok = FALSE;
}
wine_tsx11_unlock();
if (!ok) return; if (!ok) return;
if (major < 2) return; /* only bother with DGA 2+ */ if (major < 2) return; /* only bother with DGA 2+ */
/* test that it works */ /* test that it works */
if (!TSXDGAOpenFramebuffer(gdi_display, DefaultScreen(gdi_display))) { wine_tsx11_lock();
WARN("disabling XF86DGA2 (insufficient permissions?)\n"); if ((ok = XDGAOpenFramebuffer(gdi_display, DefaultScreen(gdi_display))))
return; {
} XDGACloseFramebuffer(gdi_display, DefaultScreen(gdi_display));
TSXDGACloseFramebuffer(gdi_display, DefaultScreen(gdi_display));
/* retrieve modes */ /* retrieve modes */
modes = TSXDGAQueryModes(gdi_display, DefaultScreen(gdi_display), &nmodes); modes = XDGAQueryModes(gdi_display, DefaultScreen(gdi_display), &nmodes);
if (!modes) return; if (!modes) ok = FALSE;
}
else WARN("disabling XF86DGA2 (insufficient permissions?)\n");
wine_tsx11_unlock();
if (!ok) return;
TRACE("DGA modes: count=%d\n", nmodes); TRACE("DGA modes: count=%d\n", nmodes);
@ -128,18 +135,19 @@ static DWORD PASCAL X11DRV_XF86DGA2_SetMode(LPDDHAL_SETMODEDATA data)
Display *display = gdi_display; Display *display = gdi_display;
data->ddRVal = DD_OK; data->ddRVal = DD_OK;
wine_tsx11_lock();
if (data->dwModeIndex) { if (data->dwModeIndex) {
/* enter DGA */ /* enter DGA */
XDGADevice *new_dev = NULL; XDGADevice *new_dev = NULL;
if (dga_dev || TSXDGAOpenFramebuffer(display, DefaultScreen(display))) if (dga_dev || XDGAOpenFramebuffer(display, DefaultScreen(display)))
new_dev = TSXDGASetMode(display, DefaultScreen(display), modes[data->dwModeIndex-1].num); new_dev = XDGASetMode(display, DefaultScreen(display), modes[data->dwModeIndex-1].num);
if (new_dev) { if (new_dev) {
TSXDGASetViewport(display, DefaultScreen(display), 0, 0, XDGAFlipImmediate); XDGASetViewport(display, DefaultScreen(display), 0, 0, XDGAFlipImmediate);
if (dga_dev) { if (dga_dev) {
VirtualFree(dga_dev->data, 0, MEM_RELEASE); VirtualFree(dga_dev->data, 0, MEM_RELEASE);
TSXFree(dga_dev); XFree(dga_dev);
} else { } else {
TSXDGASelectInput(display, DefaultScreen(display), XDGASelectInput(display, DefaultScreen(display),
KeyPressMask|KeyReleaseMask| KeyPressMask|KeyReleaseMask|
ButtonPressMask|ButtonReleaseMask| ButtonPressMask|ButtonReleaseMask|
PointerMotionMask); PointerMotionMask);
@ -157,7 +165,7 @@ static DWORD PASCAL X11DRV_XF86DGA2_SetMode(LPDDHAL_SETMODEDATA data)
} }
else { else {
ERR("failed\n"); ERR("failed\n");
if (!dga_dev) TSXDGACloseFramebuffer(display, DefaultScreen(display)); if (!dga_dev) XDGACloseFramebuffer(display, DefaultScreen(display));
data->ddRVal = DDERR_GENERIC; data->ddRVal = DDERR_GENERIC;
} }
} }
@ -165,14 +173,15 @@ static DWORD PASCAL X11DRV_XF86DGA2_SetMode(LPDDHAL_SETMODEDATA data)
/* exit DGA */ /* exit DGA */
X11DRV_DD_IsDirect = FALSE; X11DRV_DD_IsDirect = FALSE;
X11DRV_DDHAL_SwitchMode(0, NULL, NULL); X11DRV_DDHAL_SwitchMode(0, NULL, NULL);
TSXDGASetMode(display, DefaultScreen(display), 0); XDGASetMode(display, DefaultScreen(display), 0);
VirtualFree(dga_dev->data, 0, MEM_RELEASE); VirtualFree(dga_dev->data, 0, MEM_RELEASE);
X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_ABSOLUTE); X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_ABSOLUTE);
X11DRV_EVENT_SetDGAStatus(0, -1); X11DRV_EVENT_SetDGAStatus(0, -1);
TSXFree(dga_dev); XFree(dga_dev);
TSXDGACloseFramebuffer(display, DefaultScreen(display)); XDGACloseFramebuffer(display, DefaultScreen(display));
dga_dev = NULL; dga_dev = NULL;
} }
wine_tsx11_unlock();
return DDHAL_DRIVER_HANDLED; return DDHAL_DRIVER_HANDLED;
} }
@ -198,7 +207,10 @@ static DWORD PASCAL X11DRV_XF86DGA2_CreateSurface(LPDDHAL_CREATESURFACEDATA data
static DWORD PASCAL X11DRV_XF86DGA2_CreatePalette(LPDDHAL_CREATEPALETTEDATA data) static DWORD PASCAL X11DRV_XF86DGA2_CreatePalette(LPDDHAL_CREATEPALETTEDATA data)
{ {
Display *display = gdi_display; Display *display = gdi_display;
data->lpDDPalette->u1.dwReserved1 = TSXDGACreateColormap(display, DefaultScreen(display), dga_dev, AllocAll); wine_tsx11_lock();
data->lpDDPalette->u1.dwReserved1 = XDGACreateColormap(display, DefaultScreen(display),
dga_dev, AllocAll);
wine_tsx11_unlock();
if (data->lpColorTable) if (data->lpColorTable)
X11DRV_DDHAL_SetPalEntries(data->lpDDPalette->u1.dwReserved1, 0, 256, X11DRV_DDHAL_SetPalEntries(data->lpDDPalette->u1.dwReserved1, 0, 256,
data->lpColorTable); data->lpColorTable);
@ -211,10 +223,12 @@ static DWORD PASCAL X11DRV_XF86DGA2_Flip(LPDDHAL_FLIPDATA data)
Display *display = gdi_display; Display *display = gdi_display;
if (data->lpSurfCurr == X11DRV_DD_Primary) { if (data->lpSurfCurr == X11DRV_DD_Primary) {
DWORD ofs = data->lpSurfCurr->lpGbl->fpVidMem - dga_mem.fpStart; DWORD ofs = data->lpSurfCurr->lpGbl->fpVidMem - dga_mem.fpStart;
TSXDGASetViewport(display, DefaultScreen(display), wine_tsx11_lock();
XDGASetViewport(display, DefaultScreen(display),
(ofs % dga_dev->mode.bytesPerScanline)*8/dga_dev->mode.bitsPerPixel, (ofs % dga_dev->mode.bytesPerScanline)*8/dga_dev->mode.bitsPerPixel,
ofs / dga_dev->mode.bytesPerScanline, ofs / dga_dev->mode.bytesPerScanline,
XDGAFlipImmediate); XDGAFlipImmediate);
wine_tsx11_unlock();
} }
data->ddRVal = DD_OK; data->ddRVal = DD_OK;
return DDHAL_DRIVER_HANDLED; return DDHAL_DRIVER_HANDLED;
@ -224,8 +238,11 @@ static DWORD PASCAL X11DRV_XF86DGA2_SetPalette(LPDDHAL_SETPALETTEDATA data)
{ {
Display *display = gdi_display; Display *display = gdi_display;
if ((data->lpDDSurface == X11DRV_DD_Primary) && if ((data->lpDDSurface == X11DRV_DD_Primary) &&
data->lpDDPalette && data->lpDDPalette->u1.dwReserved1) { data->lpDDPalette && data->lpDDPalette->u1.dwReserved1)
TSXDGAInstallColormap(display, DefaultScreen(display), data->lpDDPalette->u1.dwReserved1); {
wine_tsx11_lock();
XDGAInstallColormap(display, DefaultScreen(display), data->lpDDPalette->u1.dwReserved1);
wine_tsx11_unlock();
} }
data->ddRVal = DD_OK; data->ddRVal = DD_OK;
return DDHAL_DRIVER_HANDLED; return DDHAL_DRIVER_HANDLED;

View File

@ -25,9 +25,10 @@
#include <X11/keysym.h> #include <X11/keysym.h>
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xutil.h" #include <X11/Xresource.h>
#include <X11/Xutil.h>
#ifdef HAVE_LIBXXF86DGA2 #ifdef HAVE_LIBXXF86DGA2
#include "ts_xf86dga2.h" #include <X11/extensions/xf86dga.h>
#endif #endif
#include <assert.h> #include <assert.h>
@ -261,8 +262,10 @@ static void EVENT_ProcessEvent( XEvent *event )
} }
#endif #endif
if (TSXFindContext( display, event->xany.window, winContext, (char **)&hWnd ) != 0) wine_tsx11_lock();
if (XFindContext( display, event->xany.window, winContext, (char **)&hWnd ) != 0)
hWnd = 0; /* Not for a registered window */ hWnd = 0; /* Not for a registered window */
wine_tsx11_unlock();
if ( !hWnd && event->xany.window != root_window if ( !hWnd && event->xany.window != root_window
&& event->type != PropertyNotify && event->type != PropertyNotify
@ -506,8 +509,16 @@ static void EVENT_FocusOut( HWND hwnd, XFocusChangeEvent *event )
/* don't reset the foreground window, if the window which is /* don't reset the foreground window, if the window which is
getting the focus is a Wine window */ getting the focus is a Wine window */
TSXGetInputFocus( thread_display(), &focus_win, &revert ); wine_tsx11_lock();
if (!focus_win || TSXFindContext( thread_display(), focus_win, winContext, (char **)&hwnd_tmp )) XGetInputFocus( thread_display(), &focus_win, &revert );
if (focus_win)
{
if (XFindContext( thread_display(), focus_win, winContext, (char **)&hwnd_tmp ) != 0)
focus_win = 0;
}
wine_tsx11_unlock();
if (!focus_win)
{ {
/* Abey : 6-Oct-99. Check again if the focus out window is the /* Abey : 6-Oct-99. Check again if the focus out window is the
Foreground window, because in most cases the messages sent Foreground window, because in most cases the messages sent
@ -1389,9 +1400,13 @@ static void EVENT_ClientMessage( HWND hWnd, XClientMessageEvent *event )
Window root, child; Window root, child;
int root_x, root_y, child_x, child_y; int root_x, root_y, child_x, child_y;
unsigned int u; unsigned int u;
TSXQueryPointer( event->display, root_window, &root, &child,
wine_tsx11_lock();
XQueryPointer( event->display, root_window, &root, &child,
&root_x, &root_y, &child_x, &child_y, &u); &root_x, &root_y, &child_x, &child_y, &u);
if (TSXFindContext( event->display, child, winContext, (char **)&hWnd ) != 0) return; if (XFindContext( event->display, child, winContext, (char **)&hWnd ) != 0) hWnd = 0;
wine_tsx11_unlock();
if (!hWnd) return;
if (event->data.l[0] == DndFile || event->data.l[0] == DndFiles) if (event->data.l[0] == DndFile || event->data.l[0] == DndFiles)
EVENT_DropFromOffiX(hWnd, event); EVENT_DropFromOffiX(hWnd, event);
else if (event->data.l[0] == DndURL) else if (event->data.l[0] == DndURL)

View File

@ -29,7 +29,8 @@
#include <X11/keysym.h> #include <X11/keysym.h>
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xutil.h" #include <X11/Xresource.h>
#include <X11/Xutil.h>
#ifdef HAVE_XKB #ifdef HAVE_XKB
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#endif #endif
@ -779,11 +780,12 @@ static const WORD nonchar_key_scan[256] =
/* Returns the Windows virtual key code associated with the X event <e> */ /* Returns the Windows virtual key code associated with the X event <e> */
/* x11 lock must be held */
static WORD EVENT_event_to_vkey( XKeyEvent *e) static WORD EVENT_event_to_vkey( XKeyEvent *e)
{ {
KeySym keysym; KeySym keysym;
TSXLookupString(e, NULL, 0, &keysym, NULL); XLookupString(e, NULL, 0, &keysym, NULL);
if ((keysym >= 0xFFAE) && (keysym <= 0xFFB9) && (keysym != 0xFFAF) if ((keysym >= 0xFFAE) && (keysym <= 0xFFB9) && (keysym != 0xFFAF)
&& (e->state & NumLockMask)) && (e->state & NumLockMask))
@ -934,7 +936,9 @@ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event )
if ((event->keycode >> 8) == 0x10) if ((event->keycode >> 8) == 0x10)
event->keycode=(event->keycode & 0xff); event->keycode=(event->keycode & 0xff);
ascii_chars = TSXLookupString(event, Str, sizeof(Str), &keysym, NULL); wine_tsx11_lock();
ascii_chars = XLookupString(event, Str, sizeof(Str), &keysym, NULL);
wine_tsx11_unlock();
/* Ignore some unwanted events */ /* Ignore some unwanted events */
if (keysym == XK_ISO_Prev_Group || if (keysym == XK_ISO_Prev_Group ||
@ -970,7 +974,9 @@ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event )
keysym, ksname, ascii_chars, Str[0] & 0xff, Str); keysym, ksname, ascii_chars, Str[0] & 0xff, Str);
} }
wine_tsx11_lock();
vkey = EVENT_event_to_vkey(event); vkey = EVENT_event_to_vkey(event);
wine_tsx11_unlock();
TRACE_(key)("keycode 0x%x converted to vkey 0x%x\n", TRACE_(key)("keycode 0x%x converted to vkey 0x%x\n",
event->keycode, vkey); event->keycode, vkey);
@ -1024,6 +1030,7 @@ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event )
* Called from X11DRV_InitKeyboard * Called from X11DRV_InitKeyboard
* This routine walks through the defined keyboard layouts and selects * This routine walks through the defined keyboard layouts and selects
* whichever matches most closely. * whichever matches most closely.
* X11 lock must be held.
*/ */
static void static void
X11DRV_KEYBOARD_DetectLayout (void) X11DRV_KEYBOARD_DetectLayout (void)
@ -1054,7 +1061,7 @@ X11DRV_KEYBOARD_DetectLayout (void)
for (keyc = min_keycode; keyc <= max_keycode; keyc++) { for (keyc = min_keycode; keyc <= max_keycode; keyc++) {
/* get data for keycode from X server */ /* get data for keycode from X server */
for (i = 0; i < syms; i++) { for (i = 0; i < syms; i++) {
keysym = TSXKeycodeToKeysym (display, keyc, i); keysym = XKeycodeToKeysym (display, keyc, i);
/* Allow both one-byte and two-byte national keysyms */ /* Allow both one-byte and two-byte national keysyms */
if ((keysym < 0x8000) && (keysym != ' ')) if ((keysym < 0x8000) && (keysym != ' '))
ckey[i] = keysym & 0xFF; ckey[i] = keysym & 0xFF;
@ -1140,8 +1147,8 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
pKeyStateTable = key_state_table; pKeyStateTable = key_state_table;
#ifdef HAVE_XKB
wine_tsx11_lock(); wine_tsx11_lock();
#ifdef HAVE_XKB
is_xkb = XkbQueryExtension(display, is_xkb = XkbQueryExtension(display,
&xkb_opcode, &xkb_event, &xkb_error, &xkb_opcode, &xkb_event, &xkb_error,
&xkb_major, &xkb_minor); &xkb_major, &xkb_minor);
@ -1149,15 +1156,15 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
/* we have XKB, approximate Windows behaviour */ /* we have XKB, approximate Windows behaviour */
XkbSetDetectableAutoRepeat(display, True, NULL); XkbSetDetectableAutoRepeat(display, True, NULL);
} }
wine_tsx11_unlock();
#endif #endif
TSXDisplayKeycodes(display, &min_keycode, &max_keycode); XDisplayKeycodes(display, &min_keycode, &max_keycode);
ksp = TSXGetKeyboardMapping(display, min_keycode, ksp = XGetKeyboardMapping(display, min_keycode,
max_keycode + 1 - min_keycode, &keysyms_per_keycode); max_keycode + 1 - min_keycode, &keysyms_per_keycode);
/* We are only interested in keysyms_per_keycode. /* We are only interested in keysyms_per_keycode.
There is no need to hold a local copy of the keysyms table */ There is no need to hold a local copy of the keysyms table */
TSXFree(ksp); XFree(ksp);
mmp = TSXGetModifierMapping(display);
mmp = XGetModifierMapping(display);
kcp = mmp->modifiermap; kcp = mmp->modifiermap;
for (i = 0; i < 8; i += 1) /* There are 8 modifier keys */ for (i = 0; i < 8; i += 1) /* There are 8 modifier keys */
{ {
@ -1169,14 +1176,14 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
int k; int k;
for (k = 0; k < keysyms_per_keycode; k += 1) for (k = 0; k < keysyms_per_keycode; k += 1)
if (TSXKeycodeToKeysym(display, *kcp, k) == XK_Num_Lock) if (XKeycodeToKeysym(display, *kcp, k) == XK_Num_Lock)
{ {
NumLockMask = 1 << i; NumLockMask = 1 << i;
TRACE_(key)("NumLockMask is %x\n", NumLockMask); TRACE_(key)("NumLockMask is %x\n", NumLockMask);
} }
} }
} }
TSXFreeModifiermap(mmp); XFreeModifiermap(mmp);
/* Detect the keyboard layout */ /* Detect the keyboard layout */
X11DRV_KEYBOARD_DetectLayout(); X11DRV_KEYBOARD_DetectLayout();
@ -1194,7 +1201,7 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
for (keyc = min_keycode; keyc <= max_keycode; keyc++) for (keyc = min_keycode; keyc <= max_keycode; keyc++)
{ {
e2.keycode = (KeyCode)keyc; e2.keycode = (KeyCode)keyc;
TSXLookupString(&e2, NULL, 0, &keysym, NULL); XLookupString(&e2, NULL, 0, &keysym, NULL);
vkey = 0; scan = 0; vkey = 0; scan = 0;
if (keysym) /* otherwise, keycode not used */ if (keysym) /* otherwise, keycode not used */
{ {
@ -1211,7 +1218,7 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
/* we seem to need to search the layout-dependent scancodes */ /* we seem to need to search the layout-dependent scancodes */
int maxlen=0,maxval=-1,ok; int maxlen=0,maxval=-1,ok;
for (i=0; i<syms; i++) { for (i=0; i<syms; i++) {
keysym = TSXKeycodeToKeysym(display, keyc, i); keysym = XKeycodeToKeysym(display, keyc, i);
if ((keysym<0x800) && (keysym!=' ')) { if ((keysym<0x800) && (keysym!=' ')) {
ckey[i] = keysym & 0xFF; ckey[i] = keysym & 0xFF;
} else { } else {
@ -1240,7 +1247,7 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
/* (most Winelib apps ought to be able to work without layout tables!) */ /* (most Winelib apps ought to be able to work without layout tables!) */
for (i = 0; (i < keysyms_per_keycode) && (!vkey); i++) for (i = 0; (i < keysyms_per_keycode) && (!vkey); i++)
{ {
keysym = TSXLookupKeysym(&e2, i); keysym = XLookupKeysym(&e2, i);
if ((keysym >= VK_0 && keysym <= VK_9) if ((keysym >= VK_0 && keysym <= VK_9)
|| (keysym >= VK_A && keysym <= VK_Z)) { || (keysym >= VK_A && keysym <= VK_Z)) {
vkey = keysym; vkey = keysym;
@ -1249,7 +1256,7 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
for (i = 0; (i < keysyms_per_keycode) && (!vkey); i++) for (i = 0; (i < keysyms_per_keycode) && (!vkey); i++)
{ {
keysym = TSXLookupKeysym(&e2, i); keysym = XLookupKeysym(&e2, i);
switch (keysym) switch (keysym)
{ {
case ';': vkey = VK_OEM_1; break; case ';': vkey = VK_OEM_1; break;
@ -1288,8 +1295,8 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
{ {
char *ksname; char *ksname;
keysym = TSXLookupKeysym(&e2, i); keysym = XLookupKeysym(&e2, i);
ksname = TSXKeysymToString(keysym); ksname = XKeysymToString(keysym);
if (!ksname) if (!ksname)
ksname = "NoSymbol"; ksname = "NoSymbol";
DPRINTF( "%lX (%s) ", keysym, ksname); DPRINTF( "%lX (%s) ", keysym, ksname);
@ -1306,8 +1313,8 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
for (scan = 0x60, keyc = min_keycode; keyc <= max_keycode; keyc++) for (scan = 0x60, keyc = min_keycode; keyc <= max_keycode; keyc++)
if (keyc2vkey[keyc]&&!keyc2scan[keyc]) { if (keyc2vkey[keyc]&&!keyc2scan[keyc]) {
char *ksname; char *ksname;
keysym = TSXKeycodeToKeysym(display, keyc, 0); keysym = XKeycodeToKeysym(display, keyc, 0);
ksname = TSXKeysymToString(keysym); ksname = XKeysymToString(keysym);
if (!ksname) ksname = "NoSymbol"; if (!ksname) ksname = "NoSymbol";
/* should make sure the scancode is unassigned here, but >=0x60 currently always is */ /* should make sure the scancode is unassigned here, but >=0x60 currently always is */
@ -1317,12 +1324,13 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
} }
/* Now store one keycode for each modifier. Used to simulate keypresses. */ /* Now store one keycode for each modifier. Used to simulate keypresses. */
kcControl = TSXKeysymToKeycode(display, XK_Control_L); kcControl = XKeysymToKeycode(display, XK_Control_L);
kcAlt = TSXKeysymToKeycode(display, XK_Alt_L); kcAlt = XKeysymToKeycode(display, XK_Alt_L);
if (!kcAlt) kcAlt = TSXKeysymToKeycode(display, XK_Meta_L); if (!kcAlt) kcAlt = XKeysymToKeycode(display, XK_Meta_L);
kcShift = TSXKeysymToKeycode(display, XK_Shift_L); kcShift = XKeysymToKeycode(display, XK_Shift_L);
kcNumLock = TSXKeysymToKeycode(display, XK_Num_Lock); kcNumLock = XKeysymToKeycode(display, XK_Num_Lock);
kcCapsLock = TSXKeysymToKeycode(display, XK_Caps_Lock); kcCapsLock = XKeysymToKeycode(display, XK_Caps_Lock);
wine_tsx11_unlock();
} }
@ -1432,6 +1440,8 @@ UINT X11DRV_MapVirtualKey(UINT wCode, UINT wMapType)
/* LockMask should behave exactly like caps lock - upercase /* LockMask should behave exactly like caps lock - upercase
* the letter keys and thats about it. */ * the letter keys and thats about it. */
wine_tsx11_lock();
e.keycode = 0; e.keycode = 0;
/* We exit on the first keycode found, to speed up the thing. */ /* We exit on the first keycode found, to speed up the thing. */
for (keyc=min_keycode; (keyc<=max_keycode) && (!e.keycode) ; keyc++) for (keyc=min_keycode; (keyc<=max_keycode) && (!e.keycode) ; keyc++)
@ -1447,22 +1457,27 @@ UINT X11DRV_MapVirtualKey(UINT wCode, UINT wMapType)
} }
if ((wCode>=VK_NUMPAD0) && (wCode<=VK_NUMPAD9)) if ((wCode>=VK_NUMPAD0) && (wCode<=VK_NUMPAD9))
e.keycode = TSXKeysymToKeycode(e.display, wCode-VK_NUMPAD0+XK_KP_0); e.keycode = XKeysymToKeycode(e.display, wCode-VK_NUMPAD0+XK_KP_0);
if (wCode==VK_DECIMAL) if (wCode==VK_DECIMAL)
e.keycode = TSXKeysymToKeycode(e.display, XK_KP_Decimal); e.keycode = XKeysymToKeycode(e.display, XK_KP_Decimal);
if (!e.keycode) if (!e.keycode)
{ {
WARN("Unknown virtual key %X !!! \n", wCode); WARN("Unknown virtual key %X !!! \n", wCode);
wine_tsx11_unlock();
return 0; /* whatever */ return 0; /* whatever */
} }
TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode); TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
if (TSXLookupString(&e, s, 2, &keysym, NULL)) if (XLookupString(&e, s, 2, &keysym, NULL))
{
wine_tsx11_unlock();
returnMVK (*s); returnMVK (*s);
}
TRACE("returning no ANSI.\n"); TRACE("returning no ANSI.\n");
wine_tsx11_unlock();
return 0; return 0;
} }
@ -1715,6 +1730,7 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
TRACE_(key)("(%04X, %04X) : faked state = %X\n", TRACE_(key)("(%04X, %04X) : faked state = %X\n",
virtKey, scanCode, e.state); virtKey, scanCode, e.state);
wine_tsx11_lock();
/* We exit on the first keycode found, to speed up the thing. */ /* We exit on the first keycode found, to speed up the thing. */
for (keyc=min_keycode; (keyc<=max_keycode) && (!e.keycode) ; keyc++) for (keyc=min_keycode; (keyc<=max_keycode) && (!e.keycode) ; keyc++)
{ /* Find a keycode that could have generated this virtual key */ { /* Find a keycode that could have generated this virtual key */
@ -1729,19 +1745,22 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
} }
if ((virtKey>=VK_NUMPAD0) && (virtKey<=VK_NUMPAD9)) if ((virtKey>=VK_NUMPAD0) && (virtKey<=VK_NUMPAD9))
e.keycode = TSXKeysymToKeycode(e.display, virtKey-VK_NUMPAD0+XK_KP_0); e.keycode = XKeysymToKeycode(e.display, virtKey-VK_NUMPAD0+XK_KP_0);
if (virtKey==VK_DECIMAL) if (virtKey==VK_DECIMAL)
e.keycode = TSXKeysymToKeycode(e.display, XK_KP_Decimal); e.keycode = XKeysymToKeycode(e.display, XK_KP_Decimal);
if (!e.keycode) if (!e.keycode)
{ {
WARN("Unknown virtual key %X !!! \n",virtKey); WARN("Unknown virtual key %X !!! \n",virtKey);
wine_tsx11_unlock();
return virtKey; /* whatever */ return virtKey; /* whatever */
} }
else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode); else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
ret = TSXLookupString(&e, (LPVOID)lpChar, 2, &keysym, NULL); ret = XLookupString(&e, (LPVOID)lpChar, 2, &keysym, NULL);
wine_tsx11_unlock();
if (ret == 0) if (ret == 0)
{ {
BYTE dead_char; BYTE dead_char;

View File

@ -22,7 +22,7 @@
#include "ts_xlib.h" #include "ts_xlib.h"
#ifdef HAVE_LIBXXF86DGA2 #ifdef HAVE_LIBXXF86DGA2
#include "ts_xf86dga2.h" #include <X11/extensions/xf86dga.h>
#endif #endif
#include "windef.h" #include "windef.h"

View File

@ -23,7 +23,6 @@
#include "config.h" #include "config.h"
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xutil.h"
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"

View File

@ -25,7 +25,8 @@
#include <stdlib.h> #include <stdlib.h>
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xutil.h" #include <X11/Xresource.h>
#include <X11/Xutil.h>
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"
@ -398,10 +399,11 @@ void X11DRV_set_wm_hints( Display *display, WND *win )
PropModeReplace, (char*)&mwm_hints, sizeof(mwm_hints)/sizeof(long) ); PropModeReplace, (char*)&mwm_hints, sizeof(mwm_hints)/sizeof(long) );
} }
wm_hints = XAllocWMHints();
wine_tsx11_unlock(); wine_tsx11_unlock();
/* wm hints */ /* wm hints */
if ((wm_hints = TSXAllocWMHints())) if (wm_hints)
{ {
wm_hints->flags = InputHint | StateHint | WindowGroupHint; wm_hints->flags = InputHint | StateHint | WindowGroupHint;
wm_hints->input = !(win->dwStyle & WS_DISABLED); wm_hints->input = !(win->dwStyle & WS_DISABLED);
@ -1214,14 +1216,18 @@ HICON X11DRV_SetWindowIcon( HWND hwnd, HICON icon, BOOL small )
if (wndPtr->dwExStyle & WS_EX_MANAGED) if (wndPtr->dwExStyle & WS_EX_MANAGED)
{ {
Window win = get_whole_window(wndPtr); Window win = get_whole_window(wndPtr);
XWMHints* wm_hints = TSXGetWMHints( display, win ); XWMHints* wm_hints;
if (!wm_hints) wm_hints = TSXAllocWMHints(); wine_tsx11_lock();
if (!(wm_hints = XGetWMHints( display, win ))) wm_hints = XAllocWMHints();
wine_tsx11_unlock();
if (wm_hints) if (wm_hints)
{ {
set_icon_hints( display, wndPtr, wm_hints ); set_icon_hints( display, wndPtr, wm_hints );
TSXSetWMHints( display, win, wm_hints ); wine_tsx11_lock();
TSXFree( wm_hints ); XSetWMHints( display, win, wm_hints );
XFree( wm_hints );
wine_tsx11_unlock();
} }
} }
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );

View File

@ -22,7 +22,6 @@
#include "config.h" #include "config.h"
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xutil.h"
#ifdef HAVE_LIBXSHAPE #ifdef HAVE_LIBXSHAPE
#include <X11/IntrinsicP.h> #include <X11/IntrinsicP.h>
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>

View File

@ -33,7 +33,6 @@
#endif #endif
#include <X11/cursorfont.h> #include <X11/cursorfont.h>
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xutil.h"
#include "winbase.h" #include "winbase.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
@ -276,13 +275,13 @@ static void setup_opengl_visual( Display *display )
/* In order to support OpenGL or D3D, we require a double-buffered /* In order to support OpenGL or D3D, we require a double-buffered
* visual */ * visual */
wine_tsx11_lock();
if (glXQueryExtension(display, &err_base, &evt_base) == True) { if (glXQueryExtension(display, &err_base, &evt_base) == True) {
int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16,GLX_DOUBLEBUFFER,None}; int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16,GLX_DOUBLEBUFFER,None};
ENTER_GL();
desktop_vi = glXChooseVisual(display, DefaultScreen(display), dblBuf); desktop_vi = glXChooseVisual(display, DefaultScreen(display), dblBuf);
LEAVE_GL();
} }
wine_tsx11_unlock();
if (desktop_vi != NULL) { if (desktop_vi != NULL) {
visual = desktop_vi->visual; visual = desktop_vi->visual;

View File

@ -24,8 +24,14 @@
#include <string.h> #include <string.h>
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xf86vmode.h"
#ifdef HAVE_LIBXXF86VM
#define XMD_H
#include "basetsd.h"
#include <X11/extensions/xf86vmode.h>
#endif /* HAVE_LIBXXF86VM */
#include "x11drv.h" #include "x11drv.h"
#include "x11ddraw.h" #include "x11ddraw.h"
#include "xvidmode.h" #include "xvidmode.h"
@ -111,29 +117,31 @@ void X11DRV_XF86VM_Init(void)
if (!usexvidmode) return; if (!usexvidmode) return;
/* see if XVidMode is available */ /* see if XVidMode is available */
if (!TSXF86VidModeQueryExtension(gdi_display, &xf86vm_event, &xf86vm_error)) return; wine_tsx11_lock();
ok = !XF86VidModeQueryExtension(gdi_display, &xf86vm_event, &xf86vm_error);
if (ok)
{
X11DRV_expect_error(gdi_display, XVidModeErrorHandler, NULL); X11DRV_expect_error(gdi_display, XVidModeErrorHandler, NULL);
ok = TSXF86VidModeQueryVersion(gdi_display, &xf86vm_major, &xf86vm_minor); ok = XF86VidModeQueryVersion(gdi_display, &xf86vm_major, &xf86vm_minor);
if (X11DRV_check_error()) ok = FALSE; if (X11DRV_check_error()) ok = FALSE;
if (!ok) return; }
if (ok)
{
#ifdef X_XF86VidModeSetGammaRamp #ifdef X_XF86VidModeSetGammaRamp
if (xf86vm_major > 2 || (xf86vm_major == 2 && xf86vm_minor >= 1)) if (xf86vm_major > 2 || (xf86vm_major == 2 && xf86vm_minor >= 1))
{ {
wine_tsx11_lock();
XF86VidModeGetGammaRampSize(gdi_display, DefaultScreen(gdi_display), XF86VidModeGetGammaRampSize(gdi_display, DefaultScreen(gdi_display),
&xf86vm_gammaramp_size); &xf86vm_gammaramp_size);
wine_tsx11_unlock();
if (xf86vm_gammaramp_size == 256) if (xf86vm_gammaramp_size == 256)
xf86vm_use_gammaramp = TRUE; xf86vm_use_gammaramp = TRUE;
} }
#endif #endif
/* retrieve modes */ /* retrieve modes */
if (!TSXF86VidModeGetAllModeLines(gdi_display, DefaultScreen(gdi_display), &nmodes, ok = XF86VidModeGetAllModeLines(gdi_display, DefaultScreen(gdi_display), &nmodes, &modes);
&modes)) }
return; wine_tsx11_unlock();
if (!ok) return;
TRACE("XVidMode modes: count=%d\n", nmodes); TRACE("XVidMode modes: count=%d\n", nmodes);
@ -143,7 +151,6 @@ void X11DRV_XF86VM_Init(void)
/* convert modes to DDHALMODEINFO format */ /* convert modes to DDHALMODEINFO format */
for (i=0; i<nmodes; i++) for (i=0; i<nmodes; i++)
convert_modeinfo(modes[i], &xf86vm_modes[i]); convert_modeinfo(modes[i], &xf86vm_modes[i]);
TRACE("Enabling XVidMode\n"); TRACE("Enabling XVidMode\n");
} }
@ -161,7 +168,9 @@ int X11DRV_XF86VM_GetCurrentMode(void)
if (!xf86vm_modes) return 0; /* no XVidMode */ if (!xf86vm_modes) return 0; /* no XVidMode */
TRACE("Querying XVidMode current mode\n"); TRACE("Querying XVidMode current mode\n");
TSXF86VidModeGetModeLine(gdi_display, DefaultScreen(gdi_display), &dotclock, &line); wine_tsx11_lock();
XF86VidModeGetModeLine(gdi_display, DefaultScreen(gdi_display), &dotclock, &line);
wine_tsx11_unlock();
convert_modeline(dotclock, &line, &cmode); convert_modeline(dotclock, &line, &cmode);
for (i=0; i<xf86vm_mode_count; i++) for (i=0; i<xf86vm_mode_count; i++)
if (memcmp(&xf86vm_modes[i], &cmode, sizeof(cmode)) == 0) { if (memcmp(&xf86vm_modes[i], &cmode, sizeof(cmode)) == 0) {
@ -176,20 +185,24 @@ void X11DRV_XF86VM_SetCurrentMode(int mode)
{ {
if (!xf86vm_modes) return; /* no XVidMode */ if (!xf86vm_modes) return; /* no XVidMode */
TSXF86VidModeSwitchToMode(gdi_display, DefaultScreen(gdi_display), modes[mode]); wine_tsx11_lock();
XF86VidModeSwitchToMode(gdi_display, DefaultScreen(gdi_display), modes[mode]);
#if 0 /* it is said that SetViewPort causes problems with some X servers */ #if 0 /* it is said that SetViewPort causes problems with some X servers */
TSXF86VidModeSetViewPort(gdi_display, DefaultScreen(gdi_display), 0, 0); XF86VidModeSetViewPort(gdi_display, DefaultScreen(gdi_display), 0, 0);
#else #else
TSXWarpPointer(gdi_display, None, DefaultRootWindow(gdi_display), 0, 0, 0, 0, 0, 0); XWarpPointer(gdi_display, None, DefaultRootWindow(gdi_display), 0, 0, 0, 0, 0, 0);
#endif #endif
TSXSync(gdi_display, False); XSync(gdi_display, False);
wine_tsx11_unlock();
} }
void X11DRV_XF86VM_SetExclusiveMode(int lock) void X11DRV_XF86VM_SetExclusiveMode(int lock)
{ {
if (!xf86vm_modes) return; /* no XVidMode */ if (!xf86vm_modes) return; /* no XVidMode */
TSXF86VidModeLockModeSwitch(gdi_display, DefaultScreen(gdi_display), lock); wine_tsx11_lock();
XF86VidModeLockModeSwitch(gdi_display, DefaultScreen(gdi_display), lock);
wine_tsx11_unlock();
} }
/* actual DirectDraw HAL stuff */ /* actual DirectDraw HAL stuff */

View File

@ -22,7 +22,6 @@
#include "config.h" #include "config.h"
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xutil.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -561,4 +560,3 @@ Pixmap X11DRV_BITMAP_Pixmap(HBITMAP hbitmap)
} }
return pixmap; return pixmap;
} }

View File

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

View File

@ -28,7 +28,8 @@
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include "ts_xlib.h" #include "ts_xlib.h"
#include "ts_xutil.h" #include <X11/Xresource.h>
#include <X11/Xutil.h>
#include <math.h> #include <math.h>
#ifdef HAVE_FLOAT_H #ifdef HAVE_FLOAT_H
@ -1271,7 +1272,9 @@ X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color,
X11DRV_UnlockDIBSection(physDev, TRUE); X11DRV_UnlockDIBSection(physDev, TRUE);
} }
TSXDestroyImage( image ); wine_tsx11_lock();
XDestroyImage( image );
wine_tsx11_unlock();
return TRUE; return TRUE;
} }

View File

@ -1,36 +0,0 @@
/*
* Thread safe wrappers around xf86dga2 calls.
* Always include this file instead of <X11/xf86dga2.h>.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#ifndef __WINE_TS_XF86DGA2_H
#define __WINE_TS_XF86DGA2_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#ifdef HAVE_LIBXXF86DGA2
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
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);
#endif /* defined(HAVE_LIBXXF86DGA2) */
#endif /* __WINE_TS_XF86DGA2_H */

View File

@ -1,36 +0,0 @@
/*
* Thread safe wrappers around xf86vmode calls.
* Always include this file instead of <X11/xf86vmode.h>.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#ifndef __WINE_TS_XF86VMODE_H
#define __WINE_TS_XF86VMODE_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#include "windef.h"
#ifdef HAVE_LIBXXF86VM
#define XMD_H
#include "basetsd.h"
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern Bool TSXF86VidModeQueryVersion(Display*,int*,int*);
extern Bool TSXF86VidModeQueryExtension(Display*,int*,int*);
extern Bool TSXF86VidModeGetModeLine(Display*,int,int*,XF86VidModeModeLine*);
extern Bool TSXF86VidModeGetAllModeLines(Display*,int,int*,XF86VidModeModeInfo***);
extern Bool TSXF86VidModeSwitchToMode(Display*,int,XF86VidModeModeInfo*);
extern Bool TSXF86VidModeLockModeSwitch(Display*,int,int);
extern Bool TSXF86VidModeSetViewPort(Display*,int,int,int);
#endif /* defined(HAVE_LIBXXF86VM) */
#endif /* __WINE_TS_XF86VMODE_H */

View File

@ -20,7 +20,6 @@ extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void); extern void (*wine_tsx11_unlock)(void);
extern XFontStruct * TSXLoadQueryFont(Display*, const char*); extern XFontStruct * TSXLoadQueryFont(Display*, const char*);
extern XModifierKeymap * TSXGetModifierMapping(Display*);
extern XImage * TSXGetImage(Display*, Drawable, int, int, unsigned int, unsigned int, unsigned long, int); extern XImage * TSXGetImage(Display*, Drawable, int, int, unsigned int, unsigned int, unsigned long, int);
extern Display * TSXOpenDisplay(const char*); extern Display * TSXOpenDisplay(const char*);
extern char * TSXGetAtomName(Display*, Atom); extern char * TSXGetAtomName(Display*, Atom);
@ -32,8 +31,6 @@ extern Pixmap TSXCreateBitmapFromData(Display*, Drawable, const char*, unsigne
extern Window TSXGetSelectionOwner(Display*, Atom); extern Window TSXGetSelectionOwner(Display*, Atom);
extern char ** TSXListFonts(Display*, const char*, int, int*); extern char ** TSXListFonts(Display*, const char*, int, int*);
extern KeySym TSXKeycodeToKeysym(Display*, unsigned int, int); extern KeySym TSXKeycodeToKeysym(Display*, unsigned int, int);
extern KeySym TSXLookupKeysym(XKeyEvent*, int);
extern KeySym * TSXGetKeyboardMapping(Display*, unsigned int, int, int*);
extern int * TSXListDepths(Display*, int, int*); extern int * TSXListDepths(Display*, int, int*);
extern int TSXReconfigureWMWindow(Display*, Window, int, unsigned int, XWindowChanges*); extern int TSXReconfigureWMWindow(Display*, Window, int, unsigned int, XWindowChanges*);
extern int TSXAllocColor(Display*, Colormap, XColor*); extern int TSXAllocColor(Display*, Colormap, XColor*);
@ -46,7 +43,6 @@ extern int TSXCopyArea(Display*, Drawable, Drawable, GC, int, int, unsigned int
extern int TSXCopyPlane(Display*, Drawable, Drawable, GC, int, int, unsigned int, unsigned int, int, int, unsigned long); extern int TSXCopyPlane(Display*, Drawable, Drawable, GC, int, int, unsigned int, unsigned int, int, int, unsigned long);
extern int TSXDefineCursor(Display*, Window, Cursor); extern int TSXDefineCursor(Display*, Window, Cursor);
extern int TSXDeleteProperty(Display*, Window, Atom); extern int TSXDeleteProperty(Display*, Window, Atom);
extern int TSXDisplayKeycodes(Display*, int*, int*);
extern int TSXDrawArc(Display*, Drawable, GC, int, int, unsigned int, unsigned int, int, int); extern int TSXDrawArc(Display*, Drawable, GC, int, int, unsigned int, unsigned int, int, int);
extern int TSXDrawLine(Display*, Drawable, GC, int, int, int, int); extern int TSXDrawLine(Display*, Drawable, GC, int, int, int, int);
extern int TSXDrawLines(Display*, Drawable, GC, XPoint*, int, int); extern int TSXDrawLines(Display*, Drawable, GC, XPoint*, int, int);
@ -62,11 +58,9 @@ extern int TSXFreeColormap(Display*, Colormap);
extern int TSXFreeColors(Display*, Colormap, unsigned long*, int, unsigned long); extern int TSXFreeColors(Display*, Colormap, unsigned long*, int, unsigned long);
extern int TSXFreeFont(Display*, XFontStruct*); extern int TSXFreeFont(Display*, XFontStruct*);
extern int TSXFreeFontNames(char**); extern int TSXFreeFontNames(char**);
extern int TSXFreeModifiermap(XModifierKeymap*);
extern int TSXFreePixmap(Display*, Pixmap); extern int TSXFreePixmap(Display*, Pixmap);
extern int TSXGetFontProperty(XFontStruct*, Atom, unsigned long*); extern int TSXGetFontProperty(XFontStruct*, Atom, unsigned long*);
extern int TSXGetGeometry(Display*, Drawable, Window*, int*, int*, unsigned int*, unsigned int*, unsigned int*, unsigned int*); extern int TSXGetGeometry(Display*, Drawable, Window*, int*, int*, unsigned int*, unsigned int*, unsigned int*, unsigned int*);
extern int TSXGetInputFocus(Display*, Window*, int*);
extern int TSXGetScreenSaver(Display*, int*, int*, int*, int*); extern int TSXGetScreenSaver(Display*, int*, int*, int*, int*);
extern int TSXGetWindowProperty(Display*, Window, Atom, long, long, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**); extern int TSXGetWindowProperty(Display*, Window, Atom, long, long, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
extern int TSXGetWindowAttributes(Display*, Window, XWindowAttributes*); extern int TSXGetWindowAttributes(Display*, Window, XWindowAttributes*);
@ -98,7 +92,6 @@ extern int TSXUngrabPointer(Display*, Time);
extern int TSXUngrabServer(Display*); extern int TSXUngrabServer(Display*);
extern int TSXUninstallColormap(Display*, Colormap); extern int TSXUninstallColormap(Display*, Colormap);
extern int TSXUnmapWindow(Display*, Window); extern int TSXUnmapWindow(Display*, Window);
extern int TSXWarpPointer(Display*, Window, Window, int, int, unsigned int, unsigned int, int, int);
extern XIM TSXOpenIM(Display*, struct _XrmHashBucketRec*, char*, char*); extern XIM TSXOpenIM(Display*, struct _XrmHashBucketRec*, char*, char*);
#endif /* defined(HAVE_X11_XLIB_H) */ #endif /* defined(HAVE_X11_XLIB_H) */

View File

@ -1,33 +0,0 @@
/*
* Thread safe wrappers around Xutil calls.
* Always include this file instead of <X11/Xutil.h>.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#ifndef __WINE_TS_XUTIL_H
#define __WINE_TS_XUTIL_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>
#include <X11/Xresource.h>
#include <X11/Xutil.h>
extern void (*wine_tsx11_lock)(void);
extern void (*wine_tsx11_unlock)(void);
extern XWMHints * TSXAllocWMHints(void);
extern int TSXFindContext(Display*, XID, XContext, XPointer*);
extern XWMHints * TSXGetWMHints(Display*, Window);
extern int TSXLookupString(XKeyEvent*, char*, int, KeySym*, XComposeStatus*);
extern int TSXSetWMHints(Display*, Window, XWMHints*);
extern int TSXDestroyImage(struct _XImage *);
#endif /* defined(HAVE_X11_XLIB_H) */
#endif /* __WINE_TS_XUTIL_H */

View File

@ -30,7 +30,7 @@
$X11_include_dir = "/usr/X11/include"; $X11_include_dir = "/usr/X11/include";
$outdir = "tsx11"; $outdir = "tsx11";
$wantfile = "$outdir/X11_calls"; $wantfile = "$outdir/X11_calls";
@dolist = ("Xlib", "Xutil", "xf86dga2", "xf86vmode"); @dolist = ("Xlib");
# First read list of wanted function names. # First read list of wanted function names.
@ -60,23 +60,6 @@ foreach $name (@dolist) {
$pre_file = "#ifdef HAVE_X11_XLIB_H\n"; $pre_file = "#ifdef HAVE_X11_XLIB_H\n";
$post_file = "#endif /* defined(HAVE_X11_XLIB_H) */\n"; $post_file = "#endif /* defined(HAVE_X11_XLIB_H) */\n";
$inc_name = $name; $inc_name = $name;
if($name eq "Xutil") {
# For Xutil, we need X11/Xresource.h for XUniqueContext().
$x11_incl = "#include <X11/Xlib.h>\n#include <X11/Xresource.h>\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 "xf86vmode") {
$x11_incl = "#include <X11/Xlib.h>\n";
$extensions_dir = "extensions/";
$pre_file = "#include \"windef.h\"\n#ifdef HAVE_LIBXXF86VM\n#define XMD_H\n#include \"basetsd.h\"\n";
$post_file = "#endif /* defined(HAVE_LIBXXF86VM) */\n";
}
print OUTH <<END; print OUTH <<END;
/* /*
@ -117,55 +100,6 @@ $x11_incl#include <X11/$extensions_dir$inc_name.h>
END END
if($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");
} elsif($name eq "xf86vmode") {
output_fn("XF86VidModeQueryVersion",Bool,
"Display*,int*,int*",
"Display*a0,int*a1,int*a2",
"a0,a1,a2"
);
output_fn("XF86VidModeQueryExtension",Bool,
"Display*,int*,int*",
"Display*a0,int*a1,int*a2",
"a0,a2,a2"
);
output_fn("XF86VidModeGetModeLine",Bool,
"Display*,int,int*,XF86VidModeModeLine*",
"Display*a0,int a1,int*a2,XF86VidModeModeLine*a3",
"a0,a1,a2,a3"
);
output_fn("XF86VidModeGetAllModeLines",Bool,
"Display*,int,int*,XF86VidModeModeInfo***",
"Display*a0,int a1,int*a2,XF86VidModeModeInfo***a3",
"a0,a1,a2,a3"
);
output_fn("XF86VidModeSwitchToMode",Bool,
"Display*,int,XF86VidModeModeInfo*",
"Display*a0,int a1,XF86VidModeModeInfo*a2",
"a0,a1,a2"
);
output_fn("XF86VidModeLockModeSwitch",Bool,
"Display*,int,int",
"Display*a0,int a1,int a2",
"a0,a1,a2"
);
output_fn("XF86VidModeSetViewPort",Bool,
"Display*,int,int,int",
"Display*a0,int a1,int a2,int a3",
"a0,a1,a2,a3"
);
} else {
open(IN, open(IN,
"echo \"$x11_incl#include <X11/$extensions_dir$name.h>\" | " . "echo \"$x11_incl#include <X11/$extensions_dir$name.h>\" | " .
"gcc -L$X11_include_dir -DNeedFunctionPrototypes -E - | " . "gcc -L$X11_include_dir -DNeedFunctionPrototypes -E - | " .
@ -213,12 +147,6 @@ END
output_fn($fn_name, $result_type, $proto, $formals, $actuals); output_fn($fn_name, $result_type, $proto, $formals, $actuals);
} }
} }
}
if ($name eq "Xutil") {
output_fn("XDestroyImage", "int",
"struct _XImage *", "struct _XImage *a0", "a0");
}
print OUTH <<END; print OUTH <<END;

View File

@ -11,10 +11,7 @@ EXTRALIBS = $(X_LIBS) $(XLIB)
C_SRCS = \ C_SRCS = \
locking.c \ locking.c \
ts_xf86dga2.c \ ts_xlib.c
ts_xf86vmode.c \
ts_xlib.c \
ts_xutil.c
all: libwine_tsx11.$(LIBEXT) all: libwine_tsx11.$(LIBEXT)

View File

@ -6,7 +6,6 @@
# #
XAllocColor XAllocColor
XAllocColorCells XAllocColorCells
XAllocWMHints
XBell XBell
XChangeGC XChangeGC
XChangeProperty XChangeProperty
@ -16,55 +15,30 @@ XCopyPlane
XCreateBitmapFromData XCreateBitmapFromData
XCreateColormap XCreateColormap
XCreatePixmap XCreatePixmap
XDGACloseFramebuffer
XDGACreateColormap
XDGAInstallColormap
XDGAOpenFramebuffer
XDGAQueryExtension
XDGAQueryModes
XDGAQueryVersion
XDGASelectInput
XDGASetMode
XDGASetViewport
XDefineCursor XDefineCursor
XDeleteProperty XDeleteProperty
XDestroyImage
XDisplayKeycodes
XDrawArc XDrawArc
XDrawLine XDrawLine
XDrawLines XDrawLines
XDrawRectangle XDrawRectangle
XDrawString16 XDrawString16
XDrawText16 XDrawText16
XF86VidModeGetAllModeLines
XF86VidModeGetModeLine
XF86VidModeLockModeSwitch
XF86VidModeQueryExtension
XF86VidModeQueryVersion
XF86VidModeSetViewPort
XF86VidModeSwitchToMode
XFillArc XFillArc
XFillPolygon XFillPolygon
XFillRectangle XFillRectangle
XFindContext
XFlush XFlush
XFree XFree
XFreeColormap XFreeColormap
XFreeColors XFreeColors
XFreeFont XFreeFont
XFreeFontNames XFreeFontNames
XFreeModifiermap
XFreePixmap XFreePixmap
XGetAtomName XGetAtomName
XGetFontProperty XGetFontProperty
XGetGeometry XGetGeometry
XGetImage XGetImage
XGetInputFocus
XGetKeyboardMapping
XGetModifierMapping
XGetScreenSaver XGetScreenSaver
XGetSelectionOwner XGetSelectionOwner
XGetWMHints
XGetWindowAttributes XGetWindowAttributes
XGetWindowProperty XGetWindowProperty
XGrabPointer XGrabPointer
@ -76,8 +50,6 @@ XKeysymToString
XListDepths XListDepths
XListFonts XListFonts
XLoadQueryFont XLoadQueryFont
XLookupKeysym
XLookupString
XMapWindow XMapWindow
XOpenDisplay XOpenDisplay
XOpenIM XOpenIM
@ -98,7 +70,6 @@ XSetLineAttributes
XSetScreenSaver XSetScreenSaver
XSetSelectionOwner XSetSelectionOwner
XSetSubwindowMode XSetSubwindowMode
XSetWMHints
XStoreColor XStoreColor
XSync XSync
XTextExtents16 XTextExtents16
@ -107,4 +78,3 @@ XUngrabPointer
XUngrabServer XUngrabServer
XUninstallColormap XUninstallColormap
XUnmapWindow XUnmapWindow
XWarpPointer

View File

@ -1,100 +0,0 @@
/*
* Thread safe wrappers around xf86dga2 calls.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#include "config.h"
#ifdef HAVE_LIBXXF86DGA2
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
#include "ts_xf86dga2.h"
Bool TSXDGAQueryVersion(Display* a0, int* a1, int* a2)
{
Bool r;
wine_tsx11_lock();
r = XDGAQueryVersion( a0, a1, a2);
wine_tsx11_unlock();
return r;
}
Bool TSXDGAQueryExtension(Display* a0, int* a1, int* a2)
{
Bool r;
wine_tsx11_lock();
r = XDGAQueryExtension( a0, a1, a2);
wine_tsx11_unlock();
return r;
}
XDGAMode* TSXDGAQueryModes(Display* a0, int a1, int* a2)
{
XDGAMode* r;
wine_tsx11_lock();
r = XDGAQueryModes( a0, a1, a2);
wine_tsx11_unlock();
return r;
}
XDGADevice* TSXDGASetMode(Display* a0, int a1, int a2)
{
XDGADevice* r;
wine_tsx11_lock();
r = XDGASetMode( a0, a1, a2);
wine_tsx11_unlock();
return r;
}
Bool TSXDGAOpenFramebuffer(Display* a0, int a1)
{
Bool r;
wine_tsx11_lock();
r = XDGAOpenFramebuffer( a0, a1);
wine_tsx11_unlock();
return r;
}
void TSXDGACloseFramebuffer(Display* a0, int a1)
{
wine_tsx11_lock();
XDGACloseFramebuffer( a0, a1);
wine_tsx11_unlock();
}
void TSXDGASetViewport(Display* a0, int a1, int a2, int a3, int a4)
{
wine_tsx11_lock();
XDGASetViewport( a0, a1, a2, a3, a4);
wine_tsx11_unlock();
}
void TSXDGAInstallColormap(Display* a0, int a1, Colormap a2)
{
wine_tsx11_lock();
XDGAInstallColormap( a0, a1, a2);
wine_tsx11_unlock();
}
Colormap TSXDGACreateColormap(Display* a0, int a1, XDGADevice* a2, int a3)
{
Colormap r;
wine_tsx11_lock();
r = XDGACreateColormap( a0, a1, a2, a3);
wine_tsx11_unlock();
return r;
}
void TSXDGASelectInput(Display* a0, int a1, long a2)
{
wine_tsx11_lock();
XDGASelectInput( a0, a1, a2);
wine_tsx11_unlock();
}
#endif /* defined(HAVE_LIBXXF86DGA2) */

View File

@ -1,84 +0,0 @@
/*
* Thread safe wrappers around xf86vmode calls.
* This file was generated automatically by tools/make_X11wrappers
* DO NOT EDIT!
*/
#include "config.h"
#include "windef.h"
#ifdef HAVE_LIBXXF86VM
#define XMD_H
#include "basetsd.h"
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
#include "ts_xf86vmode.h"
Bool TSXF86VidModeQueryVersion(Display*a0,int*a1,int*a2)
{
Bool r;
wine_tsx11_lock();
r = XF86VidModeQueryVersion(a0,a1,a2);
wine_tsx11_unlock();
return r;
}
Bool TSXF86VidModeQueryExtension(Display*a0,int*a1,int*a2)
{
Bool r;
wine_tsx11_lock();
r = XF86VidModeQueryExtension(a0,a2,a2);
wine_tsx11_unlock();
return r;
}
Bool TSXF86VidModeGetModeLine(Display*a0,int a1,int*a2,XF86VidModeModeLine*a3)
{
Bool r;
wine_tsx11_lock();
r = XF86VidModeGetModeLine(a0,a1,a2,a3);
wine_tsx11_unlock();
return r;
}
Bool TSXF86VidModeGetAllModeLines(Display*a0,int a1,int*a2,XF86VidModeModeInfo***a3)
{
Bool r;
wine_tsx11_lock();
r = XF86VidModeGetAllModeLines(a0,a1,a2,a3);
wine_tsx11_unlock();
return r;
}
Bool TSXF86VidModeSwitchToMode(Display*a0,int a1,XF86VidModeModeInfo*a2)
{
Bool r;
wine_tsx11_lock();
r = XF86VidModeSwitchToMode(a0,a1,a2);
wine_tsx11_unlock();
return r;
}
Bool TSXF86VidModeLockModeSwitch(Display*a0,int a1,int a2)
{
Bool r;
wine_tsx11_lock();
r = XF86VidModeLockModeSwitch(a0,a1,a2);
wine_tsx11_unlock();
return r;
}
Bool TSXF86VidModeSetViewPort(Display*a0,int a1,int a2,int a3)
{
Bool r;
wine_tsx11_lock();
r = XF86VidModeSetViewPort(a0,a1,a2,a3);
wine_tsx11_unlock();
return r;
}
#endif /* defined(HAVE_LIBXXF86VM) */

View File

@ -22,15 +22,6 @@ XFontStruct * TSXLoadQueryFont(Display* a0, const char* a1)
return r; return r;
} }
XModifierKeymap * TSXGetModifierMapping(Display* a0)
{
XModifierKeymap * r;
wine_tsx11_lock();
r = XGetModifierMapping(a0);
wine_tsx11_unlock();
return r;
}
XImage * TSXGetImage(Display* a0, Drawable a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned long a6, int a7) XImage * TSXGetImage(Display* a0, Drawable a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned long a6, int a7)
{ {
XImage * r; XImage * r;
@ -130,24 +121,6 @@ KeySym TSXKeycodeToKeysym(Display* a0, unsigned int a1, int a2)
return r; return r;
} }
KeySym TSXLookupKeysym(XKeyEvent* a0, int a1)
{
KeySym r;
wine_tsx11_lock();
r = XLookupKeysym(a0, a1);
wine_tsx11_unlock();
return r;
}
KeySym * TSXGetKeyboardMapping(Display* a0, unsigned int a1, int a2, int* a3)
{
KeySym * r;
wine_tsx11_lock();
r = XGetKeyboardMapping(a0, a1, a2, a3);
wine_tsx11_unlock();
return r;
}
int * TSXListDepths(Display* a0, int a1, int* a2) int * TSXListDepths(Display* a0, int a1, int* a2)
{ {
int * r; int * r;
@ -256,15 +229,6 @@ int TSXDeleteProperty(Display* a0, Window a1, Atom a2)
return r; return r;
} }
int TSXDisplayKeycodes(Display* a0, int* a1, int* a2)
{
int r;
wine_tsx11_lock();
r = XDisplayKeycodes(a0, a1, a2);
wine_tsx11_unlock();
return r;
}
int TSXDrawArc(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8) int TSXDrawArc(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8)
{ {
int r; int r;
@ -400,15 +364,6 @@ int TSXFreeFontNames(char** a0)
return r; return r;
} }
int TSXFreeModifiermap(XModifierKeymap* a0)
{
int r;
wine_tsx11_lock();
r = XFreeModifiermap(a0);
wine_tsx11_unlock();
return r;
}
int TSXFreePixmap(Display* a0, Pixmap a1) int TSXFreePixmap(Display* a0, Pixmap a1)
{ {
int r; int r;
@ -436,15 +391,6 @@ int TSXGetGeometry(Display* a0, Drawable a1, Window* a2, int* a3, int* a4, uns
return r; return r;
} }
int TSXGetInputFocus(Display* a0, Window* a1, int* a2)
{
int r;
wine_tsx11_lock();
r = XGetInputFocus(a0, a1, a2);
wine_tsx11_unlock();
return r;
}
int TSXGetScreenSaver(Display* a0, int* a1, int* a2, int* a3, int* a4) int TSXGetScreenSaver(Display* a0, int* a1, int* a2, int* a3, int* a4)
{ {
int r; int r;
@ -724,15 +670,6 @@ int TSXUnmapWindow(Display* a0, Window a1)
return r; return r;
} }
int TSXWarpPointer(Display* a0, Window a1, Window a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8)
{
int r;
wine_tsx11_lock();
r = XWarpPointer(a0, a1, a2, a3, a4, a5, a6, a7, a8);
wine_tsx11_unlock();
return r;
}
XIM TSXOpenIM(Display* a0, struct _XrmHashBucketRec* a1, char* a2, char* a3) XIM TSXOpenIM(Display* a0, struct _XrmHashBucketRec* a1, char* a2, char* a3)
{ {
XIM r; XIM r;

View File

@ -1,73 +0,0 @@
/*
* Thread safe wrappers around Xutil 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 <X11/Xresource.h>
#include <X11/Xutil.h>
#include "ts_xutil.h"
XWMHints * TSXAllocWMHints(void)
{
XWMHints * r;
wine_tsx11_lock();
r = XAllocWMHints();
wine_tsx11_unlock();
return r;
}
int TSXFindContext(Display* a0, XID a1, XContext a2, XPointer* a3)
{
int r;
wine_tsx11_lock();
r = XFindContext(a0, a1, a2, a3);
wine_tsx11_unlock();
return r;
}
XWMHints * TSXGetWMHints(Display* a0, Window a1)
{
XWMHints * r;
wine_tsx11_lock();
r = XGetWMHints(a0, a1);
wine_tsx11_unlock();
return r;
}
int TSXLookupString(XKeyEvent* a0, char* a1, int a2, KeySym* a3, XComposeStatus* a4)
{
int r;
wine_tsx11_lock();
r = XLookupString(a0, a1, a2, a3, a4);
wine_tsx11_unlock();
return r;
}
int TSXSetWMHints(Display* a0, Window a1, XWMHints* a2)
{
int r;
wine_tsx11_lock();
r = XSetWMHints(a0, a1, a2);
wine_tsx11_unlock();
return r;
}
int TSXDestroyImage(struct _XImage *a0)
{
int r;
wine_tsx11_lock();
r = XDestroyImage(a0);
wine_tsx11_unlock();
return r;
}
#endif /* defined(HAVE_X11_XLIB_H) */