Commit 2496c08b authored by Alexandre Julliard's avatar Alexandre Julliard

Get rid of a bunch of TSX functions.

parent b539a571
......@@ -4,77 +4,40 @@
# 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.
#
XAllocColor
XAllocColorCells
XBell
XChangeGC
XChangeProperty
XChangeWindowAttributes
XCopyArea
XCopyPlane
XCreateBitmapFromData
XCreateColormap
XCreatePixmap
XDefineCursor
XDeleteProperty
XDrawArc
XDrawLine
XDrawLines
XDrawRectangle
XDrawString16
XDrawText16
XFillArc
XFillPolygon
XFillRectangle
XFlush
XFree
XFreeColormap
XFreeColors
XFreeFont
XFreeFontNames
XFreePixmap
XGetAtomName
XGetFontProperty
XGetGeometry
XGetImage
XGetScreenSaver
XGetSelectionOwner
XGetWindowAttributes
XGetWindowProperty
XGrabPointer
XGrabServer
XInternAtom
XKeycodeToKeysym
XKeysymToKeycode
XKeysymToString
XListDepths
XListFonts
XLoadQueryFont
XMapWindow
XOpenDisplay
XOpenIM
XQueryColor
XQueryColors
XQueryPointer
XQueryTree
XReconfigureWMWindow
XRefreshKeyboardMapping
XSendEvent
XSetArcMode
XSetClipRectangles
XSetDashes
XSetForeground
XSetFunction
XSetGraphicsExposures
XSetLineAttributes
XSetScreenSaver
XSetSelectionOwner
XSetSubwindowMode
XStoreColor
XSync
XTextExtents16
XTextWidth16
XUngrabPointer
XUngrabServer
XUninstallColormap
XUnmapWindow
......@@ -1589,7 +1589,9 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(LPWINE_CLIPFORMAT lpData, Window w, A
/* Delete the property on the window now that we are done
* This will send a PropertyNotify event to the selection owner. */
TSXDeleteProperty(display,w,prop);
wine_tsx11_lock();
XDeleteProperty(display,w,prop);
wine_tsx11_unlock();
/* Free the retrieved property data */
HeapFree(GetProcessHeap(),0,val);
......
......@@ -852,13 +852,10 @@ static void EVENT_SelectionRequest( HWND hWnd, XSelectionRequestEvent *event, BO
}
else
{
if (TRACE_ON(clipboard))
{
TRACE_(clipboard)("Request for property %s (%ld) failed\n",
TSXGetAtomName(display, event->target), event->target);
}
}
}
END:
/* reply to sender
......@@ -874,7 +871,9 @@ END:
result.target = event->target;
result.time = event->time;
TRACE("Sending SelectionNotify event...\n");
TSXSendEvent(display,event->requestor,False,NoEventMask,(XEvent*)&result);
wine_tsx11_lock();
XSendEvent(display,event->requestor,False,NoEventMask,(XEvent*)&result);
wine_tsx11_unlock();
}
}
......
......@@ -1624,7 +1624,9 @@ void X11DRV_MappingNotify( XMappingEvent *event )
{
HWND hwnd;
TSXRefreshKeyboardMapping(event);
wine_tsx11_lock();
XRefreshKeyboardMapping(event);
wine_tsx11_unlock();
X11DRV_InitKeyboard( pKeyStateTable );
hwnd = GetFocus();
......@@ -2196,5 +2198,7 @@ found:
*/
void X11DRV_Beep(void)
{
TSXBell(thread_display(), 0);
wine_tsx11_lock();
XBell(thread_display(), 0);
wine_tsx11_unlock();
}
......@@ -162,7 +162,9 @@ static void update_cursor( HWND hwnd, Window win )
if (data->cursor_window != win)
{
data->cursor_window = win;
if (data->cursor) TSXDefineCursor( data->display, win, data->cursor );
wine_tsx11_lock();
if (data->cursor) XDefineCursor( data->display, win, data->cursor );
wine_tsx11_unlock();
}
}
......
......@@ -19,80 +19,43 @@
extern void wine_tsx11_lock(void);
extern void wine_tsx11_unlock(void);
extern XFontStruct * TSXLoadQueryFont(Display*, const char*);
extern XImage * TSXGetImage(Display*, Drawable, int, int, unsigned int, unsigned int, unsigned long, int);
extern Display * TSXOpenDisplay(const char*);
extern char * TSXGetAtomName(Display*, Atom);
extern char * TSXKeysymToString(KeySym);
extern Atom TSXInternAtom(Display*, const char*, int);
extern Colormap TSXCreateColormap(Display*, Window, Visual*, int);
extern Pixmap TSXCreatePixmap(Display*, Drawable, unsigned int, unsigned int, unsigned int);
extern Pixmap TSXCreateBitmapFromData(Display*, Drawable, const char*, unsigned int, unsigned int);
extern Window TSXGetSelectionOwner(Display*, Atom);
extern char ** TSXListFonts(Display*, const char*, int, int*);
extern KeySym TSXKeycodeToKeysym(Display*, unsigned int, int);
extern int * TSXListDepths(Display*, int, int*);
extern int TSXReconfigureWMWindow(Display*, Window, int, unsigned int, XWindowChanges*);
extern int TSXAllocColor(Display*, Colormap, XColor*);
extern int TSXAllocColorCells(Display*, Colormap, int, unsigned long*, unsigned int, unsigned long*, unsigned int);
extern int TSXBell(Display*, int);
extern int TSXChangeGC(Display*, GC, unsigned long, XGCValues*);
extern int TSXChangeProperty(Display*, Window, Atom, Atom, int, int, const unsigned char*, int);
extern int TSXChangeWindowAttributes(Display*, Window, unsigned long, XSetWindowAttributes*);
extern int TSXCopyArea(Display*, Drawable, Drawable, GC, int, int, unsigned int, unsigned int, int, int);
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 TSXDeleteProperty(Display*, Window, Atom);
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 TSXDrawLines(Display*, Drawable, GC, XPoint*, int, int);
extern int TSXDrawRectangle(Display*, Drawable, GC, int, int, unsigned int, unsigned int);
extern int TSXDrawString16(Display*, Drawable, GC, int, int, const XChar2b*, int);
extern int TSXDrawText16(Display*, Drawable, GC, int, int, XTextItem16*, int);
extern int TSXFillArc(Display*, Drawable, GC, int, int, unsigned int, unsigned int, int, int);
extern int TSXFillPolygon(Display*, Drawable, GC, XPoint*, int, int, int);
extern int TSXFillRectangle(Display*, Drawable, GC, int, int, unsigned int, unsigned int);
extern int TSXFlush(Display*);
extern int TSXFree(void*);
extern int TSXFreeColormap(Display*, Colormap);
extern int TSXFreeColors(Display*, Colormap, unsigned long*, int, unsigned long);
extern int TSXFreeFont(Display*, XFontStruct*);
extern int TSXFreeFontNames(char**);
extern int TSXFreePixmap(Display*, Pixmap);
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 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 TSXGetWindowAttributes(Display*, Window, XWindowAttributes*);
extern int TSXGrabPointer(Display*, Window, int, unsigned int, int, int, Window, Cursor, Time);
extern int TSXGrabServer(Display*);
extern KeyCode TSXKeysymToKeycode(Display*, KeySym);
extern int TSXMapWindow(Display*, Window);
extern int TSXQueryColor(Display*, Colormap, XColor*);
extern int TSXQueryColors(Display*, Colormap, XColor*, int);
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 TSXRefreshKeyboardMapping(XMappingEvent*);
extern int TSXSendEvent(Display*, Window, int, long, XEvent*);
extern int TSXSetArcMode(Display*, GC, int);
extern int TSXSetClipRectangles(Display*, GC, int, int, XRectangle*, int, int);
extern int TSXSetDashes(Display*, GC, int, const char*, int);
extern int TSXSetForeground(Display*, GC, unsigned long);
extern int TSXSetFunction(Display*, GC, int);
extern int TSXSetGraphicsExposures(Display*, GC, int);
extern int TSXSetLineAttributes(Display*, GC, unsigned int, int, int, int);
extern int TSXSetScreenSaver(Display*, int, int, int, int);
extern int TSXSetSelectionOwner(Display*, Atom, Window, Time);
extern int TSXSetSubwindowMode(Display*, GC, int);
extern int TSXStoreColor(Display*, Colormap, XColor*);
extern int TSXSync(Display*, int);
extern int TSXTextExtents16(XFontStruct*, const XChar2b*, int, int*, int*, int*, XCharStruct*);
extern int TSXTextWidth16(XFontStruct*, const XChar2b*, int);
extern int TSXUngrabPointer(Display*, Time);
extern int TSXUngrabServer(Display*);
extern int TSXUninstallColormap(Display*, Colormap);
extern int TSXUnmapWindow(Display*, Window);
extern XIM TSXOpenIM(Display*, struct _XrmHashBucketRec*, char*, char*);
#endif /* defined(HAVE_X11_XLIB_H) */
......
......@@ -1256,8 +1256,10 @@ void X11DRV_SetFocus( HWND hwnd )
if (!hwnd) /* If setting the focus to 0, uninstall the colormap */
{
wine_tsx11_lock();
if (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_PRIVATE)
TSXUninstallColormap( display, X11DRV_PALETTE_PaletteXColormap );
XUninstallColormap( display, X11DRV_PALETTE_PaletteXColormap );
wine_tsx11_unlock();
return;
}
......
......@@ -2205,8 +2205,11 @@ void X11DRV_ForceWindowRaise( HWND hwnd )
WND *ptr = WIN_FindWndPtr( list[i] );
if (!ptr) continue;
if (!IsRectEmpty( &ptr->rectWindow ) && get_whole_window(ptr))
TSXReconfigureWMWindow( display, get_whole_window(ptr), 0,
CWStackMode, &winChanges );
{
wine_tsx11_lock();
XReconfigureWMWindow( display, get_whole_window(ptr), 0, CWStackMode, &winChanges );
wine_tsx11_unlock();
}
WIN_ReleaseWndPtr( ptr );
}
}
......
......@@ -83,11 +83,15 @@ static LRESULT WINAPI GrabWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
win = root_window;
}
TSXGrabPointer(display, win, True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime);
wine_tsx11_lock();
XGrabPointer(display, win, True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime);
wine_tsx11_unlock();
}
else
{
TSXUngrabPointer(display, CurrentTime);
wine_tsx11_lock();
XUngrabPointer(display, CurrentTime);
wine_tsx11_unlock();
}
return 0;
......@@ -212,7 +216,12 @@ static DDHAL_DDSURFACECALLBACKS hal_ddsurfcallbacks = {
static DWORD PASCAL X11DRV_DDHAL_DestroyPalette(LPDDHAL_DESTROYPALETTEDATA data)
{
Colormap pal = data->lpDDPalette->u1.dwReserved1;
if (pal) TSXFreeColormap(gdi_display, pal);
if (pal)
{
wine_tsx11_lock();
XFreeColormap(gdi_display, pal);
wine_tsx11_unlock();
}
data->ddRVal = DD_OK;
return DDHAL_DRIVER_HANDLED;
}
......@@ -426,14 +435,16 @@ void X11DRV_DDHAL_SetPalEntries(Colormap pal, DWORD dwBase, DWORD dwNumEntries,
int n;
if (pal) {
wine_tsx11_lock();
c.flags = DoRed|DoGreen|DoBlue;
c.pixel = dwBase;
for (n=0; n<dwNumEntries; n++,c.pixel++) {
c.red = lpEntries[n].peRed << 8;
c.green = lpEntries[n].peGreen << 8;
c.blue = lpEntries[n].peBlue << 8;
TSXStoreColor(gdi_display, pal, &c);
XStoreColor(gdi_display, pal, &c);
}
TSXFlush(gdi_display); /* update display immediately */
XFlush(gdi_display); /* update display immediately */
wine_tsx11_unlock();
}
}
......@@ -309,7 +309,7 @@ static void process_attach(void)
/* Open display */
if (!(display = TSXOpenDisplay( NULL )))
if (!(display = XOpenDisplay( NULL )))
{
MESSAGE( "x11drv: Can't open display: %s\n", XDisplayName(NULL) );
ExitProcess(1);
......@@ -325,10 +325,10 @@ static void process_attach(void)
if (screen_depth) /* depth specified */
{
int depth_count, i;
int *depth_list = TSXListDepths(display, DefaultScreen(display), &depth_count);
int *depth_list = XListDepths(display, DefaultScreen(display), &depth_count);
for (i = 0; i < depth_count; i++)
if (depth_list[i] == screen_depth) break;
TSXFree( depth_list );
XFree( depth_list );
if (i >= depth_count)
{
MESSAGE( "x11drv: Depth %d not supported on this screen.\n", screen_depth );
......@@ -508,7 +508,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
BOOL X11DRV_GetScreenSaveActive(void)
{
int timeout, temp;
TSXGetScreenSaver(gdi_display, &timeout, &temp, &temp, &temp);
wine_tsx11_lock();
XGetScreenSaver(gdi_display, &timeout, &temp, &temp, &temp);
wine_tsx11_unlock();
return timeout != 0;
}
......@@ -522,11 +524,13 @@ void X11DRV_SetScreenSaveActive(BOOL bActivate)
int timeout, interval, prefer_blanking, allow_exposures;
static int last_timeout = 15 * 60;
TSXGetScreenSaver(gdi_display, &timeout, &interval, &prefer_blanking,
wine_tsx11_lock();
XGetScreenSaver(gdi_display, &timeout, &interval, &prefer_blanking,
&allow_exposures);
if (timeout) last_timeout = timeout;
timeout = bActivate ? last_timeout : 0;
TSXSetScreenSaver(gdi_display, timeout, interval, prefer_blanking,
XSetScreenSaver(gdi_display, timeout, interval, prefer_blanking,
allow_exposures);
wine_tsx11_unlock();
}
......@@ -145,9 +145,12 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
bmp->bitmap.bmHeight, bmp->bitmap.bmBitsPixel);
/* Create the pixmap */
if (!(bmp->physBitmap = (void *)TSXCreatePixmap(gdi_display, root_window,
wine_tsx11_lock();
bmp->physBitmap = (void *)XCreatePixmap(gdi_display, root_window,
bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
bmp->bitmap.bmBitsPixel)))
bmp->bitmap.bmBitsPixel);
wine_tsx11_unlock();
if (!bmp->physBitmap)
{
WARN("Can't create Pixmap\n");
GDI_ReleaseObj( hbitmap );
......
......@@ -185,21 +185,23 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
if(!bmp->physBitmap) goto done;
wine_tsx11_lock();
if ((dc->bitsPerPixel == 1) && (bmp->bitmap.bmBitsPixel != 1))
{
/* Special case: a color pattern on a monochrome DC */
physDev->brush.pixmap = TSXCreatePixmap( gdi_display, root_window, 8, 8, 1);
physDev->brush.pixmap = XCreatePixmap( gdi_display, root_window, 8, 8, 1);
/* FIXME: should probably convert to monochrome instead */
TSXCopyPlane( gdi_display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
XCopyPlane( gdi_display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
BITMAP_monoGC, 0, 0, 8, 8, 0, 0, 1 );
}
else
{
physDev->brush.pixmap = TSXCreatePixmap( gdi_display, root_window,
physDev->brush.pixmap = XCreatePixmap( gdi_display, root_window,
8, 8, bmp->bitmap.bmBitsPixel );
TSXCopyArea( gdi_display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
XCopyArea( gdi_display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
BITMAP_GC(bmp), 0, 0, 8, 8, 0, 0 );
}
wine_tsx11_unlock();
if (bmp->bitmap.bmBitsPixel > 1)
{
......@@ -254,8 +256,10 @@ HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush )
case BS_HATCHED:
TRACE("BS_HATCHED\n" );
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( physDev, logbrush.lbColor );
physDev->brush.pixmap = TSXCreateBitmapFromData( gdi_display, root_window,
wine_tsx11_lock();
physDev->brush.pixmap = XCreateBitmapFromData( gdi_display, root_window,
HatchBrushes[logbrush.lbHatch], 8, 8 );
wine_tsx11_unlock();
physDev->brush.fillStyle = FillStippled;
break;
......
......@@ -159,7 +159,9 @@ void X11DRV_StartGraphicsExposures( HDC hdc )
if (dc)
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
TSXSetGraphicsExposures( gdi_display, physDev->gc, True );
wine_tsx11_lock();
XSetGraphicsExposures( gdi_display, physDev->gc, True );
wine_tsx11_unlock();
physDev->exposures = 0;
GDI_ReleaseObj( hdc );
}
......@@ -186,7 +188,6 @@ void X11DRV_EndGraphicsExposures( HDC hdc, HRGN hrgn )
XSetGraphicsExposures( gdi_display, physDev->gc, False );
if (physDev->exposures)
{
XSync( gdi_display, False );
for (;;)
{
XWindowEvent( gdi_display, physDev->drawable, ~0, &event );
......
......@@ -625,18 +625,22 @@ X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bott
{
if (X11DRV_SetupGCForBrush( physDev ))
{
TSXFillRectangle( gdi_display, physDev->drawable, physDev->gc,
wine_tsx11_lock();
XFillRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left + (width + 1) / 2,
physDev->org.y + rc.top + (width + 1) / 2,
rc.right-rc.left-width-1, rc.bottom-rc.top-width-1);
wine_tsx11_unlock();
update = TRUE;
}
}
if (X11DRV_SetupGCForPen( physDev ))
{
TSXDrawRectangle( gdi_display, physDev->drawable, physDev->gc,
wine_tsx11_lock();
XDrawRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
rc.right-rc.left-1, rc.bottom-rc.top-1 );
wine_tsx11_unlock();
update = TRUE;
}
......@@ -1038,14 +1042,18 @@ X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count )
if (X11DRV_SetupGCForBrush( physDev ))
{
TSXFillPolygon( gdi_display, physDev->drawable, physDev->gc,
wine_tsx11_lock();
XFillPolygon( gdi_display, physDev->drawable, physDev->gc,
points, count+1, Complex, CoordModeOrigin);
wine_tsx11_unlock();
update = TRUE;
}
if (X11DRV_SetupGCForPen ( physDev ))
{
TSXDrawLines( gdi_display, physDev->drawable, physDev->gc,
wine_tsx11_lock();
XDrawLines( gdi_display, physDev->drawable, physDev->gc,
points, count+1, CoordModeOrigin );
wine_tsx11_unlock();
update = TRUE;
}
......@@ -1240,12 +1248,13 @@ X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color,
if (!PtVisible( physDev->hdc, x, y )) return FALSE;
if (GetRgnBox( dc->hGCClipRgn, &rect ) == ERROR) return FALSE;
if (!(image = TSXGetImage( gdi_display, physDev->drawable,
physDev->org.x + rect.left,
physDev->org.y + rect.top,
rect.right - rect.left,
rect.bottom - rect.top,
AllPlanes, ZPixmap ))) return FALSE;
wine_tsx11_lock();
image = XGetImage( gdi_display, physDev->drawable,
physDev->org.x + rect.left, physDev->org.y + rect.top,
rect.right - rect.left, rect.bottom - rect.top,
AllPlanes, ZPixmap );
wine_tsx11_unlock();
if (!image) return FALSE;
if (X11DRV_SetupGCForBrush( physDev ))
{
......
......@@ -152,11 +152,12 @@ int X11DRV_PALETTE_Init(void)
RegCloseKey(hkey);
}
wine_tsx11_lock();
if (private_color_map)
{
XSetWindowAttributes win_attr;
X11DRV_PALETTE_PaletteXColormap = TSXCreateColormap( gdi_display, root_window,
X11DRV_PALETTE_PaletteXColormap = XCreateColormap( gdi_display, root_window,
visual, AllocAll );
if (X11DRV_PALETTE_PaletteXColormap)
{
......@@ -169,21 +170,24 @@ int X11DRV_PALETTE_Init(void)
if( root_window != DefaultRootWindow(gdi_display) )
{
win_attr.colormap = X11DRV_PALETTE_PaletteXColormap;
TSXChangeWindowAttributes( gdi_display, root_window, CWColormap, &win_attr );
XChangeWindowAttributes( gdi_display, root_window, CWColormap, &win_attr );
}
break;
}
}
X11DRV_PALETTE_PaletteXColormap = TSXCreateColormap(gdi_display, root_window,
X11DRV_PALETTE_PaletteXColormap = XCreateColormap(gdi_display, root_window,
visual, AllocNone);
wine_tsx11_unlock();
break;
}
case StaticGray:
X11DRV_PALETTE_PaletteXColormap = TSXCreateColormap(gdi_display, root_window,
wine_tsx11_lock();
X11DRV_PALETTE_PaletteXColormap = XCreateColormap(gdi_display, root_window,
visual, AllocNone);
X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_FIXED;
X11DRV_PALETTE_Graymax = (1 << screen_depth)-1;
wine_tsx11_unlock();
break;
case TrueColor:
......@@ -193,24 +197,27 @@ int X11DRV_PALETTE_Init(void)
/* FIXME: hack to detect XFree32 XF_VGA16 ... We just have
* depths 1 and 4
*/
depths=TSXListDepths(gdi_display,DefaultScreen(gdi_display),&nrofdepths);
wine_tsx11_lock();
depths = XListDepths(gdi_display,DefaultScreen(gdi_display),&nrofdepths);
if ((nrofdepths==2) && ((depths[0]==4) || depths[1]==4)) {
monoPlane = 1;
for( white = palette_size - 1; !(white & 1); white >>= 1 )
monoPlane++;
X11DRV_PALETTE_PaletteFlags = (white & mask) ? X11DRV_PALETTE_WHITESET : 0;
X11DRV_PALETTE_PaletteXColormap = TSXCreateColormap(gdi_display, root_window,
X11DRV_PALETTE_PaletteXColormap = XCreateColormap(gdi_display, root_window,
visual, AllocNone);
TSXFree(depths);
break;
}
TSXFree(depths);
X11DRV_PALETTE_PaletteXColormap = TSXCreateColormap(gdi_display, root_window,
else
{
X11DRV_PALETTE_PaletteXColormap = XCreateColormap(gdi_display, root_window,
visual, AllocNone);
X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_FIXED;
X11DRV_PALETTE_ComputeShifts(visual->red_mask, &X11DRV_PALETTE_PRed, &X11DRV_PALETTE_LRed);
X11DRV_PALETTE_ComputeShifts(visual->green_mask, &X11DRV_PALETTE_PGreen, &X11DRV_PALETTE_LGreen);
X11DRV_PALETTE_ComputeShifts(visual->blue_mask, &X11DRV_PALETTE_PBlue, &X11DRV_PALETTE_LBlue);
}
XFree(depths);
wine_tsx11_unlock();
break;
}
}
......@@ -250,9 +257,13 @@ int X11DRV_PALETTE_Init(void)
void X11DRV_PALETTE_Cleanup(void)
{
if( COLOR_gapFilled )
TSXFreeColors(gdi_display, X11DRV_PALETTE_PaletteXColormap,
{
wine_tsx11_lock();
XFreeColors(gdi_display, X11DRV_PALETTE_PaletteXColormap,
(unsigned long*)(X11DRV_PALETTE_PaletteToXPixel + COLOR_gapStart),
COLOR_gapFilled, 0);
wine_tsx11_unlock();
}
}
/***********************************************************************
......@@ -796,8 +807,10 @@ COLORREF X11DRV_PALETTE_ToLogical(int pixel)
((X11DRV_PALETTE_XPixelToPalette)?X11DRV_PALETTE_XPixelToPalette[pixel]:pixel)) ) & 0x00ffffff;
}
wine_tsx11_lock();
color.pixel = pixel;
TSXQueryColor(gdi_display, X11DRV_PALETTE_PaletteXColormap, &color);
XQueryColor(gdi_display, X11DRV_PALETTE_PaletteXColormap, &color);
wine_tsx11_unlock();
return RGB(color.red >> 8, color.green >> 8, color.blue >> 8);
}
......
......@@ -2928,7 +2928,9 @@ void X11DRV_FONT_InitX11Metrics( void )
HKEY hkey;
x_pattern = TSXListFonts(gdi_display, "*", MAX_FONTS, &x_count );
wine_tsx11_lock();
x_pattern = XListFonts(gdi_display, "*", MAX_FONTS, &x_count );
wine_tsx11_unlock();
TRACE("Font Mapper: initializing %i x11 fonts\n", x_count);
if (x_count == MAX_FONTS)
......@@ -2988,7 +2990,8 @@ void X11DRV_FONT_InitX11Metrics( void )
}
}
TSXFreeFontNames(x_pattern);
wine_tsx11_lock();
XFreeFontNames(x_pattern);
/* check if we're dealing with X11 R6 server */
{
......@@ -2997,9 +3000,11 @@ void X11DRV_FONT_InitX11Metrics( void )
if( (x_fs = safe_XLoadQueryFont(gdi_display, buffer)) )
{
text_caps |= TC_SF_X_YINDEP;
TSXFreeFont(gdi_display, x_fs);
XFreeFont(gdi_display, x_fs);
}
}
wine_tsx11_unlock();
HeapFree(GetProcessHeap(), 0, buffer);
XFONT_WindowsNames();
......
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