Commit c559735b authored by Alexandre Julliard's avatar Alexandre Julliard

Renamed display to gdi_display where it is used for GDI operations, to

allow supporting multiple X connections.
parent 9d80a9fe
......@@ -55,7 +55,7 @@ static void set_context(IDirect3DDevice2Impl* This) {
This->surface->s.surface_desc.dwWidth,
This->surface->s.surface_desc.dwHeight);
#else
if (glXMakeCurrent(display,ddpriv->drawable, odev->ctx) == False) {
if (glXMakeCurrent(gdi_display,ddpriv->drawable, odev->ctx) == False) {
ERR("Error in setting current context (context %p drawable %ld)!\n",
odev->ctx, ddpriv->drawable);
}
......@@ -192,9 +192,9 @@ is_OpenGL(
XVisualInfo template;
template.visualid = XVisualIDFromVisual(visual);
vis = XGetVisualInfo(display, VisualIDMask, &template, &num);
vis = XGetVisualInfo(gdi_display, VisualIDMask, &template, &num);
odev->ctx = glXCreateContext(display, vis,
odev->ctx = glXCreateContext(gdi_display, vis,
NULL, GL_TRUE);
}
......@@ -263,7 +263,7 @@ static ULONG WINAPI MESA_IDirect3DDevice2Impl_Release(LPDIRECT3DDEVICE2 iface)
OSMesaDestroyContext(odev->ctx);
#else
ENTER_GL();
glXDestroyContext(display, odev->ctx);
glXDestroyContext(gdi_display, odev->ctx);
LEAVE_GL();
#endif
This->private = NULL;
......@@ -900,15 +900,15 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi
/* if (surface->s.backbuffer == NULL)
attributeList[3] = None; */
ENTER_GL();
xvis = glXChooseVisual(display,
DefaultScreen(display),
xvis = glXChooseVisual(gdi_display,
DefaultScreen(gdi_display),
attributeList);
if (xvis == NULL)
ERR("No visual found !\n");
else
TRACE("Visual found\n");
/* Create the context */
odev->ctx = glXCreateContext(display,
odev->ctx = glXCreateContext(gdi_display,
xvis,
NULL,
GL_TRUE);
......@@ -960,7 +960,7 @@ static ULONG WINAPI MESA_IDirect3DDeviceImpl_Release(LPDIRECT3DDEVICE iface)
OSMesaDestroyContext(odev->ctx);
#else
ENTER_GL();
glXDestroyContext(display, odev->ctx);
glXDestroyContext(gdi_display, odev->ctx);
LEAVE_GL();
#endif
This->private = NULL;
......
......@@ -84,7 +84,7 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
/* First, get the visual in use by the X11DRV */
template.visualid = XVisualIDFromVisual(X11DRV_GetVisual());
vis = XGetVisualInfo(display, VisualIDMask, &template, &num);
vis = XGetVisualInfo(gdi_display, VisualIDMask, &template, &num);
if (vis == NULL) {
ERR("NULL visual !!!\n");
......@@ -137,13 +137,13 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc) {
ENTER_GL();
/* A game (Half Life not to name it) deletes twice the same context. To prevent
crashes, run with our own error function enabled */
XSync(display, False);
XSync(gdi_display, False);
XGLErrorFlag = 0;
WineXHandler = XSetErrorHandler(XGLErrorHandler);
__TRY {
glXDestroyContext(display, ctx->ctx);
XSync(display, False);
XFlush(display);
glXDestroyContext(gdi_display, ctx->ctx);
XSync(gdi_display, False);
XFlush(gdi_display);
if (XGLErrorHandler == 0) free_context(ctx);
}
......@@ -308,7 +308,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc,
if (hglrc == NULL) {
ENTER_GL();
ret = glXMakeCurrent(display,
ret = glXMakeCurrent(gdi_display,
None,
NULL);
LEAVE_GL();
......@@ -326,13 +326,13 @@ BOOL WINAPI wglMakeCurrent(HDC hdc,
if (ctx->ctx == NULL) {
ENTER_GL();
ctx->ctx = glXCreateContext(display, ctx->vis, NULL, True);
ctx->ctx = glXCreateContext(gdi_display, ctx->vis, NULL, True);
LEAVE_GL();
TRACE(" created a delayed OpenGL context (%p)\n", ctx->ctx);
}
ENTER_GL();
ret = glXMakeCurrent(display,
ret = glXMakeCurrent(gdi_display,
physDev->drawable,
ctx->ctx);
LEAVE_GL();
......@@ -383,14 +383,14 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1,
} else {
if (org->ctx == NULL) {
ENTER_GL();
org->ctx = glXCreateContext(display, org->vis, NULL, True);
org->ctx = glXCreateContext(gdi_display, org->vis, NULL, True);
LEAVE_GL();
TRACE(" created a delayed OpenGL context (%p) for Wine context %p\n", org->ctx, org);
}
ENTER_GL();
/* Create the destination context with display lists shared */
dest->ctx = glXCreateContext(display, dest->vis, org->ctx, True);
dest->ctx = glXCreateContext(gdi_display, dest->vis, org->ctx, True);
LEAVE_GL();
TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx);
}
......@@ -468,7 +468,7 @@ static void process_attach(void) {
Window was created using the standard X11DRV visual, and glXMakeCurrent can't deal
with mismatched visuals. Note that the Root Window visual may not be double
buffered, so apps actually attempting to render this way may flicker */
if (TSXGetWindowAttributes( display, X11DRV_GetXRootWindow(), &win_attr ))
if (TSXGetWindowAttributes( gdi_display, X11DRV_GetXRootWindow(), &win_attr ))
{
rootVisual = win_attr.visual;
}
......@@ -476,13 +476,13 @@ static void process_attach(void) {
{
/* Get the default visual, since we can't seem to get the attributes from the
Root Window. Let's hope that the Root Window Visual matches the DefaultVisual */
rootVisual = DefaultVisual( display, DefaultScreen(display) );
rootVisual = DefaultVisual( gdi_display, DefaultScreen(gdi_display) );
}
template.visualid = XVisualIDFromVisual(rootVisual);
vis = XGetVisualInfo(display, VisualIDMask, &template, &num);
if (vis != NULL) default_cx = glXCreateContext(display, vis, 0, GL_TRUE);
if (default_cx != NULL) glXMakeCurrent(display, X11DRV_GetXRootWindow(), default_cx);
vis = XGetVisualInfo(gdi_display, VisualIDMask, &template, &num);
if (vis != NULL) default_cx = glXCreateContext(gdi_display, vis, 0, GL_TRUE);
if (default_cx != NULL) glXMakeCurrent(gdi_display, X11DRV_GetXRootWindow(), default_cx);
XFree(vis);
LEAVE_GL();
......@@ -494,7 +494,7 @@ static void process_attach(void) {
}
static void process_detach(void) {
glXDestroyContext(display, default_cx);
glXDestroyContext(gdi_display, default_cx);
}
/***********************************************************************
......
......@@ -162,7 +162,7 @@ static DDHAL_DDSURFACECALLBACKS hal_ddsurfcallbacks = {
static DWORD PASCAL X11DRV_DDHAL_DestroyPalette(LPDDHAL_DESTROYPALETTEDATA data)
{
Colormap pal = data->lpDDPalette->u1.dwReserved1;
if (pal) TSXFreeColormap(display, pal);
if (pal) TSXFreeColormap(gdi_display, pal);
data->ddRVal = DD_OK;
return DDHAL_DRIVER_HANDLED;
}
......@@ -386,8 +386,8 @@ void X11DRV_DDHAL_SetPalEntries(Colormap pal, DWORD dwBase, DWORD dwNumEntries,
c.red = lpEntries[n].peRed << 8;
c.green = lpEntries[n].peGreen << 8;
c.blue = lpEntries[n].peBlue << 8;
TSXStoreColor(display, pal, &c);
TSXStoreColor(gdi_display, pal, &c);
}
TSXFlush(display); /* update display immediate */
TSXFlush(gdi_display); /* update display immediately */
}
}
......@@ -413,7 +413,7 @@ static void process_attach(void)
}
/* initialize GDI */
if(!X11DRV_GDI_Initialize())
if(!X11DRV_GDI_Initialize( display ))
{
ERR( "Couldn't Initialize GDI.\n" );
ExitProcess(1);
......@@ -463,9 +463,6 @@ static void process_detach(void)
/* cleanup GDI */
X11DRV_GDI_Finalize();
/* close the display */
XCloseDisplay( display );
display = NULL;
/* restore TSX11 locking */
......@@ -504,7 +501,7 @@ BOOL WINAPI X11DRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved )
BOOL X11DRV_GetScreenSaveActive(void)
{
int timeout, temp;
TSXGetScreenSaver(display, &timeout, &temp, &temp, &temp);
TSXGetScreenSaver(gdi_display, &timeout, &temp, &temp, &temp);
return timeout != 0;
}
......@@ -516,9 +513,9 @@ BOOL X11DRV_GetScreenSaveActive(void)
void X11DRV_SetScreenSaveActive(BOOL bActivate)
{
if(bActivate)
TSXActivateScreenSaver(display);
TSXActivateScreenSaver(gdi_display);
else
TSXResetScreenSaver(display);
TSXResetScreenSaver(gdi_display);
}
/***********************************************************************
......@@ -529,7 +526,7 @@ void X11DRV_SetScreenSaveActive(BOOL bActivate)
int X11DRV_GetScreenSaveTimeout(void)
{
int timeout, temp;
TSXGetScreenSaver(display, &timeout, &temp, &temp, &temp);
TSXGetScreenSaver(gdi_display, &timeout, &temp, &temp, &temp);
return timeout;
}
......@@ -543,7 +540,7 @@ void X11DRV_SetScreenSaveTimeout(int nTimeout)
/* timeout is a 16bit entity (CARD16) in the protocol, so it should
* not get over 32767 or it will get negative. */
if (nTimeout>32767) nTimeout = 32767;
TSXSetScreenSaver(display, nTimeout, 60, DefaultBlanking, DefaultExposures);
TSXSetScreenSaver(gdi_display, nTimeout, 60, DefaultBlanking, DefaultExposures);
}
/***********************************************************************
......@@ -551,5 +548,5 @@ void X11DRV_SetScreenSaveTimeout(int nTimeout)
*/
BOOL X11DRV_IsSingleWindow(void)
{
return (root_window != DefaultRootWindow(display));
return (root_window != DefaultRootWindow(gdi_display));
}
......@@ -63,14 +63,14 @@ void X11DRV_XF86VM_Init(void)
if (xf86vm_major) return; /* already initialized? */
/* see if XVidMode is available */
if (!TSXF86VidModeQueryExtension(display, &xf86vm_event, &xf86vm_error)) return;
if (!TSXF86VidModeQueryVersion(display, &xf86vm_major, &xf86vm_minor)) return;
if (!TSXF86VidModeQueryExtension(gdi_display, &xf86vm_event, &xf86vm_error)) return;
if (!TSXF86VidModeQueryVersion(gdi_display, &xf86vm_major, &xf86vm_minor)) return;
/* if in desktop mode, don't use XVidMode */
if (X11DRV_GetXRootWindow() != DefaultRootWindow(display)) return;
if (root_window != DefaultRootWindow(gdi_display)) return;
/* retrieve modes */
if (!TSXF86VidModeGetAllModeLines(display, DefaultScreen(display), &nmodes,
if (!TSXF86VidModeGetAllModeLines(gdi_display, DefaultScreen(gdi_display), &nmodes,
&modes))
return;
......@@ -100,7 +100,7 @@ int X11DRV_XF86VM_GetCurrentMode(void)
if (!xf86vm_modes) return 0; /* no XVidMode */
TRACE("Querying XVidMode current mode\n");
TSXF86VidModeGetModeLine(display, DefaultScreen(display), &dotclock, &line);
TSXF86VidModeGetModeLine(gdi_display, DefaultScreen(gdi_display), &dotclock, &line);
convert_modeline(dotclock, &line, &cmode);
for (i=0; i<xf86vm_mode_count; i++)
if (memcmp(&xf86vm_modes[i], &cmode, sizeof(cmode)) == 0) {
......@@ -115,20 +115,20 @@ void X11DRV_XF86VM_SetCurrentMode(int mode)
{
if (!xf86vm_modes) return; /* no XVidMode */
TSXF86VidModeSwitchToMode(display, DefaultScreen(display), modes[mode]);
TSXF86VidModeSwitchToMode(gdi_display, DefaultScreen(gdi_display), modes[mode]);
#if 0 /* it is said that SetViewPort causes problems with some X servers */
TSXF86VidModeSetViewPort(display, DefaultScreen(display), 0, 0);
TSXF86VidModeSetViewPort(gdi_display, DefaultScreen(gdi_display), 0, 0);
#else
TSXWarpPointer(display, None, DefaultRootWindow(display), 0, 0, 0, 0, 0, 0);
TSXWarpPointer(gdi_display, None, DefaultRootWindow(gdi_display), 0, 0, 0, 0, 0, 0);
#endif
TSXSync(display, False);
TSXSync(gdi_display, False);
}
void X11DRV_XF86VM_SetExclusiveMode(int lock)
{
if (!xf86vm_modes) return; /* no XVidMode */
TSXF86VidModeLockModeSwitch(display, DefaultScreen(display), lock);
TSXF86VidModeLockModeSwitch(gdi_display, DefaultScreen(gdi_display), lock);
}
/* actual DirectDraw HAL stuff */
......@@ -245,7 +245,7 @@ BOOL X11DRV_XF86VM_GetGammaRamp(LPDDGAMMARAMP ramp)
if (xf86vm_major < 2) return FALSE; /* no gamma control */
wine_tsx11_lock();
ret = XF86VidModeGetGamma(display, DefaultScreen(display), &gamma);
ret = XF86VidModeGetGamma(gdi_display, DefaultScreen(gdi_display), &gamma);
wine_tsx11_unlock();
if (ret) {
GenerateRampFromGamma(ramp->red, gamma.red);
......@@ -268,7 +268,7 @@ BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp)
ComputeGammaFromRamp(ramp->blue, &gamma.blue)) {
Bool ret;
wine_tsx11_lock();
ret = XF86VidModeSetGamma(display, DefaultScreen(display), &gamma);
ret = XF86VidModeSetGamma(gdi_display, DefaultScreen(gdi_display), &gamma);
wine_tsx11_unlock();
return ret;
}
......
......@@ -33,29 +33,27 @@ GC BITMAP_monoGC = 0, BITMAP_colorGC = 0;
BOOL X11DRV_BITMAP_Init(void)
{
Pixmap tmpPixmap;
/* Create the necessary GCs */
if ((tmpPixmap = TSXCreatePixmap(display,
X11DRV_GetXRootWindow(),
1, 1,
1)))
wine_tsx11_lock();
if ((tmpPixmap = XCreatePixmap( gdi_display, root_window, 1, 1, 1 )))
{
BITMAP_monoGC = TSXCreateGC( display, tmpPixmap, 0, NULL );
TSXSetGraphicsExposures( display, BITMAP_monoGC, False );
TSXFreePixmap( display, tmpPixmap );
BITMAP_monoGC = XCreateGC( gdi_display, tmpPixmap, 0, NULL );
XSetGraphicsExposures( gdi_display, BITMAP_monoGC, False );
XFreePixmap( gdi_display, tmpPixmap );
}
if (X11DRV_GetDepth() != 1)
if (screen_depth != 1)
{
if ((tmpPixmap = TSXCreatePixmap(display, X11DRV_GetXRootWindow(),
1, 1, X11DRV_GetDepth())))
{
BITMAP_colorGC = TSXCreateGC( display, tmpPixmap, 0, NULL );
TSXSetGraphicsExposures( display, BITMAP_colorGC, False );
TSXFreePixmap( display, tmpPixmap );
}
if ((tmpPixmap = XCreatePixmap( gdi_display, root_window, 1, 1, screen_depth )))
{
BITMAP_colorGC = XCreateGC( gdi_display, tmpPixmap, 0, NULL );
XSetGraphicsExposures( gdi_display, BITMAP_colorGC, False );
XFreePixmap( gdi_display, tmpPixmap );
}
}
wine_tsx11_unlock();
return TRUE;
}
......@@ -99,9 +97,11 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
if (dc->bitsPerPixel != bmp->bitmap.bmBitsPixel)
{
TSXFreeGC( display, physDev->gc );
physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL );
TSXSetGraphicsExposures( display, physDev->gc, False );
wine_tsx11_lock();
XFreeGC( gdi_display, physDev->gc );
physDev->gc = XCreateGC( gdi_display, physDev->drawable, 0, NULL );
XSetGraphicsExposures( gdi_display, physDev->gc, False );
wine_tsx11_unlock();
dc->bitsPerPixel = bmp->bitmap.bmBitsPixel;
DC_InitDC( dc );
}
......@@ -134,8 +134,7 @@ BOOL X11DRV_CreateBitmap( HBITMAP hbitmap )
GDI_ReleaseObj( hbitmap );
return 0;
}
if ((bmp->bitmap.bmBitsPixel != 1) &&
(bmp->bitmap.bmBitsPixel != X11DRV_GetDepth()))
if ((bmp->bitmap.bmBitsPixel != 1) && (bmp->bitmap.bmBitsPixel != screen_depth))
{
ERR("Trying to make bitmap with planes=%d, bpp=%d\n",
bmp->bitmap.bmPlanes, bmp->bitmap.bmBitsPixel);
......@@ -147,7 +146,7 @@ BOOL X11DRV_CreateBitmap( HBITMAP hbitmap )
bmp->bitmap.bmHeight, bmp->bitmap.bmBitsPixel);
/* Create the pixmap */
if (!(bmp->physBitmap = (void *)TSXCreatePixmap(display, X11DRV_GetXRootWindow(),
if (!(bmp->physBitmap = (void *)TSXCreatePixmap(gdi_display, root_window,
bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
bmp->bitmap.bmBitsPixel)))
{
......@@ -191,7 +190,7 @@ static LONG X11DRV_GetBitmapBits(BITMAPOBJ *bmp, void *buffer, LONG count)
old_height = bmp->bitmap.bmHeight;
height = bmp->bitmap.bmHeight = count / bmp->bitmap.bmWidthBytes;
image = XGetImage( display, (Pixmap)bmp->physBitmap,
image = XGetImage( gdi_display, (Pixmap)bmp->physBitmap,
0, 0, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
AllPlanes, ZPixmap );
bmp->bitmap.bmHeight = old_height;
......@@ -313,7 +312,7 @@ static LONG X11DRV_SetBitmapBits(BITMAPOBJ *bmp, void *bits, LONG count)
height = count / bmp->bitmap.bmWidthBytes;
wine_tsx11_lock();
image = XCreateImage( display, X11DRV_GetVisual(), bmp->bitmap.bmBitsPixel, ZPixmap, 0, NULL,
image = XCreateImage( gdi_display, visual, bmp->bitmap.bmBitsPixel, ZPixmap, 0, NULL,
bmp->bitmap.bmWidth, height, 32, 0 );
if (!(image->data = (LPBYTE)malloc(image->bytes_per_line * height)))
{
......@@ -404,7 +403,7 @@ static LONG X11DRV_SetBitmapBits(BITMAPOBJ *bmp, void *bits, LONG count)
FIXME("Unhandled bits:%d\n", bmp->bitmap.bmBitsPixel);
}
XPutImage( display, (Pixmap)bmp->physBitmap, BITMAP_GC(bmp),
XPutImage( gdi_display, (Pixmap)bmp->physBitmap, BITMAP_GC(bmp),
image, 0, 0, 0, 0, bmp->bitmap.bmWidth, height );
XDestroyImage( image ); /* frees image->data too */
wine_tsx11_unlock();
......@@ -440,7 +439,7 @@ LONG X11DRV_BitmapBits(HBITMAP hbitmap, void *bits, LONG count, WORD flags)
*/
BOOL X11DRV_BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bmp )
{
TSXFreePixmap( display, (Pixmap)bmp->physBitmap );
TSXFreePixmap( gdi_display, (Pixmap)bmp->physBitmap );
bmp->physBitmap = NULL;
bmp->funcs = NULL;
return TRUE;
......@@ -463,7 +462,7 @@ HBITMAP X11DRV_BITMAP_CreateBitmapHeaderFromPixmap(Pixmap pixmap)
unsigned int depth, width, height;
/* Get the Pixmap dimensions and bit depth */
if ( 0 == TSXGetGeometry(display, pixmap, &root, &x, &y, &width, &height,
if ( 0 == TSXGetGeometry(gdi_display, pixmap, &root, &x, &y, &width, &height,
&border_width, &depth) )
goto END;
......
......@@ -92,18 +92,6 @@ static XImage *ditherImage = NULL;
/***********************************************************************
* BRUSH_Init
*
* Create the X image used for dithering.
*/
BOOL X11DRV_BRUSH_Init(void)
{
XCREATEIMAGE( ditherImage, MATRIX_SIZE, MATRIX_SIZE, X11DRV_GetDepth() );
return (ditherImage != NULL);
}
/***********************************************************************
* BRUSH_DitherColor
*/
static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
......@@ -112,6 +100,12 @@ static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
unsigned int x, y;
Pixmap pixmap;
if (!ditherImage)
{
ditherImage = X11DRV_DIB_CreateXImage( MATRIX_SIZE, MATRIX_SIZE, screen_depth );
if (!ditherImage) return 0;
}
wine_tsx11_lock();
if (color != prevColor)
{
......@@ -134,9 +128,8 @@ static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
prevColor = color;
}
pixmap = XCreatePixmap( display, X11DRV_GetXRootWindow(),
MATRIX_SIZE, MATRIX_SIZE, X11DRV_GetDepth() );
XPutImage( display, pixmap, BITMAP_colorGC, ditherImage, 0, 0,
pixmap = XCreatePixmap( gdi_display, root_window, MATRIX_SIZE, MATRIX_SIZE, screen_depth );
XPutImage( gdi_display, pixmap, BITMAP_colorGC, ditherImage, 0, 0,
0, 0, MATRIX_SIZE, MATRIX_SIZE );
wine_tsx11_unlock();
return pixmap;
......@@ -150,7 +143,7 @@ static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if ((dc->bitsPerPixel > 1) && (X11DRV_GetDepth() <= 8) && !COLOR_IsSolid( color ))
if ((dc->bitsPerPixel > 1) && (screen_depth <= 8) && !COLOR_IsSolid( color ))
{
/* Dithered brush */
physDev->brush.pixmap = BRUSH_DitherColor( dc, color );
......@@ -188,17 +181,17 @@ static BOOL BRUSH_SelectPatternBrush( DC * dc, HBITMAP hbitmap )
if ((dc->bitsPerPixel == 1) && (bmp->bitmap.bmBitsPixel != 1))
{
/* Special case: a color pattern on a monochrome DC */
physDev->brush.pixmap = TSXCreatePixmap( display, X11DRV_GetXRootWindow(), 8, 8, 1);
physDev->brush.pixmap = TSXCreatePixmap( gdi_display, root_window, 8, 8, 1);
/* FIXME: should probably convert to monochrome instead */
TSXCopyPlane( display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
BITMAP_monoGC, 0, 0, 8, 8, 0, 0, 1 );
TSXCopyPlane( gdi_display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
BITMAP_monoGC, 0, 0, 8, 8, 0, 0, 1 );
}
else
{
physDev->brush.pixmap = TSXCreatePixmap( display, X11DRV_GetXRootWindow(),
8, 8, bmp->bitmap.bmBitsPixel );
TSXCopyArea( display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
BITMAP_GC(bmp), 0, 0, 8, 8, 0, 0 );
physDev->brush.pixmap = TSXCreatePixmap( gdi_display, root_window,
8, 8, bmp->bitmap.bmBitsPixel );
TSXCopyArea( gdi_display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap,
BITMAP_GC(bmp), 0, 0, 8, 8, 0, 0 );
}
if (bmp->bitmap.bmBitsPixel > 1)
......@@ -237,7 +230,7 @@ HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
if (physDev->brush.pixmap)
{
TSXFreePixmap( display, physDev->brush.pixmap );
TSXFreePixmap( gdi_display, physDev->brush.pixmap );
physDev->brush.pixmap = 0;
}
physDev->brush.style = brush->logbrush.lbStyle;
......@@ -256,7 +249,7 @@ HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
case BS_HATCHED:
TRACE("BS_HATCHED\n" );
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( dc, brush->logbrush.lbColor );
physDev->brush.pixmap = TSXCreateBitmapFromData( display, X11DRV_GetXRootWindow(),
physDev->brush.pixmap = TSXCreateBitmapFromData( gdi_display, root_window,
HatchBrushes[brush->logbrush.lbHatch], 8, 8 );
physDev->brush.fillStyle = FillStippled;
break;
......
......@@ -63,7 +63,7 @@ void X11DRV_SetDeviceClipping( DC * dc )
else
pXrect = NULL;
TSXSetClipRectangles( display, physDev->gc, 0, 0,
TSXSetClipRectangles( gdi_display, physDev->gc, 0, 0,
pXrect, obj->rgn->numRects, YXBanded );
if(pXrect)
......
......@@ -168,30 +168,29 @@ DeviceCaps X11DRV_DevCaps = {
/* palette size */ 0,
/* ..etc */ 0, 0 };
Display *gdi_display; /* display to use for all GDI functions */
/**********************************************************************
* X11DRV_GDI_Initialize
*/
BOOL X11DRV_GDI_Initialize(void)
BOOL X11DRV_GDI_Initialize( Display *display )
{
Screen *screen = DefaultScreenOfDisplay(display);
gdi_display = display;
BITMAP_Driver = &X11DRV_BITMAP_Driver;
PALETTE_Driver = &X11DRV_PALETTE_Driver;
/* FIXME: colormap management should be merged with the X11DRV */
if( !X11DRV_DIB_Init() ) return FALSE;
if( !X11DRV_PALETTE_Init() ) return FALSE;
if( !X11DRV_OBM_Init() ) return FALSE;
/* Finish up device caps */
#if 0
TRACE("Height = %-4i pxl, %-4i mm, Width = %-4i pxl, %-4i mm\n",
HeightOfScreen(X11DRV_GetXScreen()), HeightMMOfScreen(X11DRV_GetXScreen()),
WidthOfScreen(X11DRV_GetXScreen()), WidthMMOfScreen(X11DRV_GetXScreen()) );
#endif
X11DRV_DevCaps.version = 0x300;
X11DRV_DevCaps.horzSize = WidthMMOfScreen(screen) * screen_width / WidthOfScreen(screen);
X11DRV_DevCaps.vertSize = HeightMMOfScreen(screen) * screen_height / HeightOfScreen(screen);
......@@ -214,10 +213,6 @@ BOOL X11DRV_GDI_Initialize(void)
if (!X11DRV_BITMAP_Init()) return FALSE;
/* Initialize brush dithering */
if (!X11DRV_BRUSH_Init()) return FALSE;
/* Initialize fonts and text caps */
if (!X11DRV_FONT_Init( &X11DRV_DevCaps )) return FALSE;
......@@ -230,7 +225,9 @@ BOOL X11DRV_GDI_Initialize(void)
*/
void X11DRV_GDI_Finalize(void)
{
X11DRV_PALETTE_Cleanup();
X11DRV_PALETTE_Cleanup();
XCloseDisplay( gdi_display );
gdi_display = NULL;
}
/**********************************************************************
......@@ -259,43 +256,40 @@ static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
}
if (!bmp->physBitmap) X11DRV_CreateBitmap( dc->hBitmap );
physDev->drawable = (Pixmap)bmp->physBitmap;
physDev->gc = TSXCreateGC(display, physDev->drawable, 0, NULL);
dc->bitsPerPixel = bmp->bitmap.bmBitsPixel;
physDev->gc = TSXCreateGC( gdi_display, physDev->drawable, 0, NULL );
dc->bitsPerPixel = bmp->bitmap.bmBitsPixel;
dc->totalExtent.left = 0;
dc->totalExtent.top = 0;
dc->totalExtent.right = bmp->bitmap.bmWidth;
dc->totalExtent.bottom = bmp->bitmap.bmHeight;
dc->hVisRgn = CreateRectRgnIndirect( &dc->totalExtent );
GDI_ReleaseObj( dc->hBitmap );
}
else
{
physDev->drawable = X11DRV_GetXRootWindow();
physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL );
dc->bitsPerPixel = screen_depth;
physDev->drawable = root_window;
physDev->gc = TSXCreateGC( gdi_display, physDev->drawable, 0, NULL );
dc->bitsPerPixel = screen_depth;
dc->totalExtent.left = 0;
dc->totalExtent.top = 0;
dc->totalExtent.right = screen_width;
dc->totalExtent.bottom = screen_height;
dc->hVisRgn = CreateRectRgnIndirect( &dc->totalExtent );
}
physDev->current_pf = 0;
physDev->used_visuals = 0;
if (!dc->hVisRgn)
if (!(dc->hVisRgn = CreateRectRgnIndirect( &dc->totalExtent )))
{
TSXFreeGC( display, physDev->gc );
TSXFreeGC( gdi_display, physDev->gc );
HeapFree( GetProcessHeap(), 0, physDev );
return FALSE;
}
TSXSetGraphicsExposures( display, physDev->gc, False );
TSXSetSubwindowMode( display, physDev->gc, IncludeInferiors );
wine_tsx11_lock();
XSetGraphicsExposures( gdi_display, physDev->gc, False );
XSetSubwindowMode( gdi_display, physDev->gc, IncludeInferiors );
XFlush( gdi_display );
wine_tsx11_unlock();
return TRUE;
}
......@@ -306,9 +300,11 @@ static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
static BOOL X11DRV_DeleteDC( DC *dc )
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
TSXFreeGC( display, physDev->gc );
wine_tsx11_lock();
XFreeGC( gdi_display, physDev->gc );
while (physDev->used_visuals-- > 0)
TSXFree(physDev->visuals[physDev->used_visuals]);
XFree(physDev->visuals[physDev->used_visuals]);
wine_tsx11_unlock();
HeapFree( GetProcessHeap(), 0, physDev );
dc->physDev = NULL;
return TRUE;
......
......@@ -260,12 +260,11 @@ static BOOL OBM_CreateBitmaps( char **data, BOOL color,
if (attrs == NULL) return FALSE;
attrs->valuemask = XpmColormap | XpmDepth | XpmColorSymbols | XpmHotspot;
attrs->colormap = X11DRV_PALETTE_PaletteXColormap;
attrs->depth = color ? X11DRV_GetDepth() : 1;
attrs->depth = color ? screen_depth : 1;
attrs->colorsymbols = (attrs->depth > 1) ? OBM_Colors : OBM_BlackAndWhite;
attrs->numsymbols = (attrs->depth > 1) ? NB_COLOR_SYMBOLS : 2;
err = TSXpmCreatePixmapFromData( display, X11DRV_GetXRootWindow(), data,
&pixmap, &pixmask, attrs );
err = TSXpmCreatePixmapFromData( gdi_display, root_window, data, &pixmap, &pixmask, attrs );
if (err != XpmSuccess)
{
HeapFree( GetProcessHeap(), 0, attrs );
......@@ -288,8 +287,8 @@ static BOOL OBM_CreateBitmaps( char **data, BOOL color,
HeapFree( GetProcessHeap(), 0, attrs );
if (pixmap && (!bitmap || !*bitmap)) TSXFreePixmap( display, pixmap );
if (pixmask && (!mask || !*mask)) TSXFreePixmap( display, pixmask );
if (pixmap && (!bitmap || !*bitmap)) TSXFreePixmap( gdi_display, pixmap );
if (pixmask && (!mask || !*mask)) TSXFreePixmap( gdi_display, pixmask );
if (bitmap && !*bitmap)
{
......
......@@ -123,13 +123,13 @@ int X11DRV_ChoosePixelFormat(DC *dc,
This command cannot be used as we need to use the default visual...
Let's hope it at least contains some OpenGL functionnalities
vis = glXChooseVisual(display, DefaultScreen(display), att_list);
vis = glXChooseVisual(gdi_display, DefaultScreen(gdi_display), att_list);
*/
int num;
XVisualInfo template;
template.visualid = XVisualIDFromVisual(visual);
vis = XGetVisualInfo(display, VisualIDMask, &template, &num);
vis = XGetVisualInfo(gdi_display, VisualIDMask, &template, &num);
TRACE("Found visual : %p - returns %d\n", vis, physDev->used_visuals + 1);
}
......@@ -178,9 +178,7 @@ int X11DRV_DescribePixelFormat(DC *dc,
/* Create a 'standard' X Visual */
ENTER_GL();
vis = glXChooseVisual(display,
DefaultScreen(display),
dblBuf);
vis = glXChooseVisual(gdi_display, DefaultScreen(gdi_display), dblBuf);
LEAVE_GL();
WARN("Uninitialized Visual. Creating standard (%p) !\n", vis);
......@@ -203,27 +201,27 @@ int X11DRV_DescribePixelFormat(DC *dc,
ppfd->dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_GENERIC_ACCELERATED;
/* Now the flags extraced from the Visual */
ENTER_GL();
glXGetConfig(display, vis, GLX_DOUBLEBUFFER, &value); if (value) ppfd->dwFlags |= PFD_DOUBLEBUFFER;
glXGetConfig(display, vis, GLX_STEREO, &value); if (value) ppfd->dwFlags |= PFD_STEREO;
glXGetConfig(gdi_display, vis, GLX_DOUBLEBUFFER, &value); if (value) ppfd->dwFlags |= PFD_DOUBLEBUFFER;
glXGetConfig(gdi_display, vis, GLX_STEREO, &value); if (value) ppfd->dwFlags |= PFD_STEREO;
/* Pixel type */
glXGetConfig(display, vis, GLX_RGBA, &value);
glXGetConfig(gdi_display, vis, GLX_RGBA, &value);
if (value)
ppfd->iPixelType = PFD_TYPE_RGBA;
else
ppfd->iPixelType = PFD_TYPE_COLORINDEX;
/* Color bits */
glXGetConfig(display, vis, GLX_BUFFER_SIZE, &value);
glXGetConfig(gdi_display, vis, GLX_BUFFER_SIZE, &value);
ppfd->cColorBits = value;
/* Red, green, blue and alpha bits / shifts */
if (ppfd->iPixelType == PFD_TYPE_RGBA) {
glXGetConfig(display, vis, GLX_RED_SIZE, &rb);
glXGetConfig(display, vis, GLX_GREEN_SIZE, &gb);
glXGetConfig(display, vis, GLX_BLUE_SIZE, &bb);
glXGetConfig(display, vis, GLX_ALPHA_SIZE, &ab);
glXGetConfig(gdi_display, vis, GLX_RED_SIZE, &rb);
glXGetConfig(gdi_display, vis, GLX_GREEN_SIZE, &gb);
glXGetConfig(gdi_display, vis, GLX_BLUE_SIZE, &bb);
glXGetConfig(gdi_display, vis, GLX_ALPHA_SIZE, &ab);
ppfd->cRedBits = rb;
ppfd->cRedShift = gb + bb + ab;
ppfd->cBlueBits = bb;
......@@ -245,7 +243,7 @@ int X11DRV_DescribePixelFormat(DC *dc,
/* Accums : to do ... */
/* Depth bits */
glXGetConfig(display, vis, GLX_DEPTH_SIZE, &value);
glXGetConfig(gdi_display, vis, GLX_DEPTH_SIZE, &value);
ppfd->cDepthBits = value;
LEAVE_GL();
......@@ -298,7 +296,7 @@ BOOL X11DRV_SwapBuffers(DC *dc) {
TRACE("(%p)\n", dc);
ENTER_GL();
glXSwapBuffers(display, physDev->drawable);
glXSwapBuffers(gdi_display, physDev->drawable);
LEAVE_GL();
return TRUE;
......
......@@ -115,8 +115,8 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
{
X11DRV_LockDIBSection( dc, DIB_Status_GdiMod, FALSE );
dibUpdateFlag = TRUE;
TSXSetForeground( display, physDev->gc, physDev->backgroundPixel );
TSXFillRectangle( display, physDev->drawable, physDev->gc,
TSXSetForeground( gdi_display, physDev->gc, physDev->backgroundPixel );
TSXFillRectangle( gdi_display, physDev->drawable, physDev->gc,
dc->DCOrgX + rect.left, dc->DCOrgY + rect.top,
rect.right-rect.left, rect.bottom-rect.top );
}
......@@ -213,9 +213,8 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
(y - ascent < rect.top) ||
(y + descent >= rect.bottom))
{
TSXSetForeground( display, physDev->gc,
physDev->backgroundPixel );
TSXFillRectangle( display, physDev->drawable, physDev->gc,
TSXSetForeground( gdi_display, physDev->gc, physDev->backgroundPixel );
TSXFillRectangle( gdi_display, physDev->drawable, physDev->gc,
dc->DCOrgX + x,
dc->DCOrgY + y - ascent,
width,
......@@ -228,13 +227,13 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
if (!(str2b = X11DRV_cptable[pfo->fi->cptable].punicode_to_char2b( pfo, wstr, count )))
goto FAIL;
TSXSetForeground( display, physDev->gc, physDev->textPixel );
TSXSetForeground( gdi_display, physDev->gc, physDev->textPixel );
if(!rotated)
{
if (!dc->charExtra && !dc->breakExtra && !lpDx)
{
X11DRV_cptable[pfo->fi->cptable].pDrawString(
pfo, display, physDev->drawable, physDev->gc,
pfo, gdi_display, physDev->drawable, physDev->gc,
dc->DCOrgX + x, dc->DCOrgY + y, str2b, count );
}
else /* Now the fun begins... */
......@@ -305,7 +304,7 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
}
}
X11DRV_cptable[pfo->fi->cptable].pDrawText( pfo, display,
X11DRV_cptable[pfo->fi->cptable].pDrawText( pfo, gdi_display,
physDev->drawable, physDev->gc,
dc->DCOrgX + x, dc->DCOrgY + y, items, pitem - items );
HeapFree( GetProcessHeap(), 0, items );
......@@ -327,7 +326,7 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
pfo->lpX11Trans->b / pfo->lpX11Trans->pixelsize );
X11DRV_cptable[pfo->fi->cptable].pDrawString(
pfo, display, physDev->drawable, physDev->gc,
pfo, gdi_display, physDev->drawable, physDev->gc,
x_i, y_i, &str2b[i], 1);
if (lpDx)
{
......@@ -358,9 +357,9 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
if (!TSXGetFontProperty( font, XA_UNDERLINE_THICKNESS, &lineWidth ))
lineWidth = 0;
else if (lineWidth == 1) lineWidth = 0;
TSXSetLineAttributes( display, physDev->gc, lineWidth,
TSXSetLineAttributes( gdi_display, physDev->gc, lineWidth,
LineSolid, CapRound, JoinBevel );
TSXDrawLine( display, physDev->drawable, physDev->gc,
TSXDrawLine( gdi_display, physDev->drawable, physDev->gc,
dc->DCOrgX + x, dc->DCOrgY + y + linePos,
dc->DCOrgX + x + width, dc->DCOrgY + y + linePos );
}
......@@ -371,9 +370,9 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
lineAscent = ascent / 2;
if (!TSXGetFontProperty( font, XA_STRIKEOUT_DESCENT, &lineDescent ))
lineDescent = -lineAscent * 2 / 3;
TSXSetLineAttributes( display, physDev->gc, lineAscent + lineDescent,
TSXSetLineAttributes( gdi_display, physDev->gc, lineAscent + lineDescent,
LineSolid, CapRound, JoinBevel );
TSXDrawLine( display, physDev->drawable, physDev->gc,
TSXDrawLine( gdi_display, physDev->drawable, physDev->gc,
dc->DCOrgX + x, dc->DCOrgY + y - lineAscent,
dc->DCOrgX + x + width, dc->DCOrgY + y - lineAscent );
}
......
......@@ -1007,7 +1007,7 @@ static void XFONT_GetLeading( const LPIFONTINFO16 pFI, const XFontStruct* x_fs,
if( pEL ) *pEL = 0;
if(XFT) {
Atom RAW_CAP_HEIGHT = TSXInternAtom(display, "RAW_CAP_HEIGHT", TRUE);
Atom RAW_CAP_HEIGHT = TSXInternAtom(gdi_display, "RAW_CAP_HEIGHT", TRUE);
if(TSXGetFontProperty((XFontStruct*)x_fs, RAW_CAP_HEIGHT, &height))
*pIL = XFT->ascent -
(INT)(XFT->pixelsize / 1000.0 * height);
......@@ -1981,10 +1981,10 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in
}
else lpstr = x_pattern[i];
if( (x_fs = TSXLoadQueryFont(display, lpstr)) )
if( (x_fs = TSXLoadQueryFont(gdi_display, lpstr)) )
{
XFONT_SetFontMetric( fi, fr, x_fs );
TSXFreeFont( display, x_fs );
TSXFreeFont( gdi_display, x_fs );
XFONT_FixupPointSize(fi);
......@@ -2648,7 +2648,7 @@ static fontObject* XFONT_GetCacheEntry(void)
if(fontCache[j].lpX11Trans)
HeapFree( GetProcessHeap(), 0, fontCache[j].lpX11Trans );
TSXFreeFont( display, fontCache[j].fs );
TSXFreeFont( gdi_display, fontCache[j].fs );
memset( fontCache + j, 0, sizeof(fontObject) );
return (fontCache + j);
......@@ -2719,7 +2719,7 @@ BOOL X11DRV_FONT_Init( DeviceCaps* pDevCaps )
res = XFONT_GetPointResolution( pDevCaps );
x_pattern = TSXListFonts(display, "*", MAX_FONTS, &x_count );
x_pattern = TSXListFonts(gdi_display, "*", MAX_FONTS, &x_count );
TRACE("Font Mapper: initializing %i fonts [logical dpi=%i, default dpi=%i]\n",
x_count, res, DefResolution);
......@@ -2778,10 +2778,10 @@ BOOL X11DRV_FONT_Init( DeviceCaps* pDevCaps )
{
XFontStruct* x_fs;
strcpy(buffer, "-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1");
if( (x_fs = TSXLoadQueryFont(display, buffer)) )
if( (x_fs = TSXLoadQueryFont(gdi_display, buffer)) )
{
XTextCaps |= TC_SF_X_YINDEP;
TSXFreeFont(display, x_fs);
TSXFreeFont(gdi_display, x_fs);
}
}
HeapFree(GetProcessHeap(), 0, buffer);
......@@ -2802,8 +2802,8 @@ BOOL X11DRV_FONT_Init( DeviceCaps* pDevCaps )
pDevCaps->textCaps = XTextCaps;
RAW_ASCENT = TSXInternAtom(display, "RAW_ASCENT", TRUE);
RAW_DESCENT = TSXInternAtom(display, "RAW_DESCENT", TRUE);
RAW_ASCENT = TSXInternAtom(gdi_display, "RAW_ASCENT", TRUE);
RAW_DESCENT = TSXInternAtom(gdi_display, "RAW_DESCENT", TRUE);
return TRUE;
}
......@@ -2818,7 +2818,7 @@ static BOOL XFONT_SetX11Trans( fontObject *pfo )
LFD* lfd;
TSXGetFontProperty( pfo->fs, XA_FONT, &nameAtom );
fontName = TSXGetAtomName( display, nameAtom );
fontName = TSXGetAtomName( gdi_display, nameAtom );
lfd = LFD_Parse(fontName);
if (!lfd)
{
......@@ -2910,7 +2910,7 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf,
do
{
LFD_ComposeLFD( pfo, fm.height, lpLFD, uRelaxLevel++ );
if( (pfo->fs = TSXLoadQueryFont( display, lpLFD )) ) break;
if( (pfo->fs = TSXLoadQueryFont( gdi_display, lpLFD )) ) break;
} while( uRelaxLevel );
......
......@@ -170,14 +170,12 @@ extern BOOL X11DRV_SwapBuffers(DC *dc) ;
/* X11 driver internal functions */
extern BOOL X11DRV_BITMAP_Init(void);
extern BOOL X11DRV_BRUSH_Init(void);
extern BOOL X11DRV_DIB_Init(void);
extern BOOL X11DRV_FONT_Init( struct tagDeviceCaps* );
extern BOOL X11DRV_OBM_Init(void);
struct tagBITMAPOBJ;
extern XImage *X11DRV_BITMAP_GetXImage( const struct tagBITMAPOBJ *bmp );
extern int X11DRV_DIB_GetXImageWidthBytes( int width, int depth );
extern XImage *X11DRV_DIB_CreateXImage( int width, int height, int depth );
extern HBITMAP X11DRV_BITMAP_CreateBitmapHeaderFromPixmap(Pixmap pixmap);
extern HGLOBAL X11DRV_DIB_CreateDIBFromPixmap(Pixmap pixmap, HDC hdc, BOOL bDeletePixmap);
extern HBITMAP X11DRV_BITMAP_CreateBitmapFromPixmap(Pixmap pixmap, BOOL bDeletePixmap);
......@@ -194,14 +192,6 @@ extern const int X11DRV_XROPfunction[];
extern void _XInitImageFuncPtrs(XImage *);
#define XCREATEIMAGE(image,width,height,bpp) \
{ \
int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
(image) = TSXCreateImage(display, X11DRV_GetVisual(), \
(bpp), ZPixmap, 0, calloc( (height), width_bytes ),\
(width), (height), 32, width_bytes ); \
}
/* exported dib functions for now */
/* Additional info for DIB section objects */
......@@ -277,9 +267,11 @@ extern INT X11DRV_DCICommand(INT cbInput, LPVOID lpInData, LPVOID lpOutData);
* X11 GDI driver
*/
BOOL X11DRV_GDI_Initialize(void);
BOOL X11DRV_GDI_Initialize( Display *display );
void X11DRV_GDI_Finalize(void);
extern Display *gdi_display; /* display to use for all GDI functions */
/* X11 GDI palette driver */
#define X11DRV_PALETTE_FIXED 0x0001 /* read-only colormap - have to use XAllocColor (if not virtual) */
......@@ -395,11 +387,6 @@ extern void X11DRV_WND_SurfaceCopy(struct tagWND *wndPtr, HDC hdc, INT dx, INT d
extern void X11DRV_WND_SetGravity(struct tagWND* wndPtr, int value );
extern BOOL X11DRV_WND_SetHostAttr(struct tagWND *wndPtr, INT haKey, INT value);
extern int X11DRV_EVENT_PrepareShmCompletion( Drawable dw );
extern void X11DRV_EVENT_WaitShmCompletion( int compl );
extern void X11DRV_EVENT_WaitShmCompletions( Drawable dw );
extern void X11DRV_EVENT_WaitReplaceShmCompletion( int *compl, Drawable dw );
extern void X11DRV_SetFocus( HWND hwnd );
#endif /* __WINE_X11DRV_H */
......@@ -837,7 +837,7 @@ void X11DRV_ReleaseClipboard(void)
{
PROPERTY *prop = prop_head;
prop_head = prop->next;
XFreePixmap( display, prop->pixmap );
XFreePixmap( gdi_display, prop->pixmap );
HeapFree( GetProcessHeap(), 0, prop );
}
}
......@@ -1234,7 +1234,7 @@ void X11DRV_CLIPBOARD_FreeResources( Atom property )
if ((*prop)->atom == property)
{
PROPERTY *next = (*prop)->next;
XFreePixmap( display, (*prop)->pixmap );
XFreePixmap( gdi_display, (*prop)->pixmap );
HeapFree( GetProcessHeap(), 0, *prop );
*prop = next;
}
......
......@@ -329,17 +329,17 @@ void X11DRV_WND_SurfaceCopy(WND* wndPtr, HDC hdc, INT dx, INT dy,
physDev = (X11DRV_PDEVICE *)dcPtr->physDev;
dst.x = (src.x = dcPtr->DCOrgX + rect->left) + dx;
dst.y = (src.y = dcPtr->DCOrgY + rect->top) + dy;
wine_tsx11_lock();
if (bUpdate) /* handles non-Wine windows hanging over the copied area */
TSXSetGraphicsExposures( display, physDev->gc, True );
TSXSetFunction( display, physDev->gc, GXcopy );
TSXCopyArea( display, physDev->drawable, physDev->drawable,
physDev->gc, src.x, src.y,
rect->right - rect->left,
rect->bottom - rect->top,
dst.x, dst.y );
XSetGraphicsExposures( gdi_display, physDev->gc, True );
XSetFunction( gdi_display, physDev->gc, GXcopy );
XCopyArea( gdi_display, physDev->drawable, physDev->drawable, physDev->gc,
src.x, src.y, rect->right - rect->left, rect->bottom - rect->top,
dst.x, dst.y );
if (bUpdate)
TSXSetGraphicsExposures( display, physDev->gc, False );
XSetGraphicsExposures( gdi_display, physDev->gc, False );
wine_tsx11_unlock();
GDI_ReleaseObj( hdc );
if (bUpdate) /* Make sure exposure events have been processed */
......
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