Commit 9c68faad authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Remove X_DC_INFO from DC and make it behave like any other PDEVICE.

parent 7129d9f6
......@@ -19,6 +19,7 @@
#include "ts_xlib.h"
#include <sys/signal.h>
#include <fcntl.h>
#include <string.h>
#include "windows.h"
#include "winerror.h"
......@@ -35,6 +36,7 @@
#include "compobj.h"
#include "spy.h"
#include "message.h"
#include "x11drv.h"
#ifdef HAVE_LIBXXF86DGA
#include "ts_xf86dga.h"
......
......@@ -25,6 +25,7 @@
#include "path.h"
#include "debug.h"
#include "winerror.h"
#include "x11drv.h"
/***********************************************************************
* LineTo16 (GDI.19)
......@@ -623,9 +624,11 @@ void WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
HPEN32 hOldPen, hnewPen;
INT32 oldDrawMode, oldBkMode;
INT32 left, top, right, bottom;
X11DRV_PDEVICE *physDev;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return;
physDev = (X11DRV_PDEVICE *)dc->physDev;
left = XLPTODP( dc, rc->left );
top = YLPTODP( dc, rc->top );
......@@ -641,10 +644,10 @@ void WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
oldBkMode = SetBkMode32(hdc, TRANSPARENT);
/* Hack: make sure the XORPEN operation has an effect */
dc->u.x.pen.pixel = (1 << screenDepth) - 1;
physDev->pen.pixel = (1 << screenDepth) - 1;
if (X11DRV_SetupGCForPen( dc ))
TSXDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
TSXDrawRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1 );
......
......@@ -17,6 +17,7 @@
#include "dc.h"
#include "gdi.h"
#include "xmalloc.h"
#include "x11drv.h"
#include "debug.h"
typedef enum WING_DITHER_TYPE
......@@ -262,9 +263,12 @@ BOOL16 WINAPI WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
/* destDC is a display DC, srcDC is a memory DC */
DC *dcDst, *dcSrc;
X11DRV_PDEVICE *physDevDst, *physDevSrc;
if (!(dcDst = (DC *)GDI_GetObjPtr( destDC, DC_MAGIC ))) return FALSE;
if (!(dcSrc = (DC *) GDI_GetObjPtr( srcDC, DC_MAGIC ))) return FALSE;
physDevDst = (X11DRV_PDEVICE *)dcDst->physDev;
physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev;
if (dcDst->w.flags & DC_DIRTY) CLIPPING_UpdateGCRegion( dcDst );
......@@ -275,10 +279,10 @@ BOOL16 WINAPI WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
widDest = widDest * dcDst->vportExtX / dcDst->wndExtX;
heiDest = heiDest * dcDst->vportExtY / dcDst->wndExtY;
TSXSetFunction( display, dcDst->u.x.gc, GXcopy );
TSXCopyArea( display, dcSrc->u.x.drawable,
dcDst->u.x.drawable, dcDst->u.x.gc,
xSrc, ySrc, widDest, heiDest, xDest, yDest );
TSXSetFunction( display, physDevDst->gc, GXcopy );
TSXCopyArea( display, physDevSrc->drawable,
physDevDst->drawable, physDevDst->gc,
xSrc, ySrc, widDest, heiDest, xDest, yDest );
return TRUE;
}
......@@ -58,6 +58,8 @@ HBITMAP32 X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP32 hbitmap,
HRGN32 hrgn;
HBITMAP32 prevHandle = dc->w.hBitmap;
X11DRV_PHYSBITMAP *pbitmap;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!(dc->w.flags & DC_MEMORY)) return 0;
......@@ -66,7 +68,7 @@ HBITMAP32 X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP32 hbitmap,
return 0;
if(bmp->DDBitmap->funcs != dc->funcs) {
WARN(bitmap, "Trying to select non-X11 DDB into an X11 dc\n");
WARN(x11drv, "Trying to select non-X11 DDB into an X11 dc\n");
return 0;
}
......@@ -87,15 +89,15 @@ HBITMAP32 X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP32 hbitmap,
dc->w.hVisRgn = hrgn;
}
dc->u.x.drawable = pbitmap->pixmap;
dc->w.hBitmap = hbitmap;
physDev->drawable = pbitmap->pixmap;
dc->w.hBitmap = hbitmap;
/* Change GC depth if needed */
if (dc->w.bitsPerPixel != bmp->bitmap.bmBitsPixel)
{
TSXFreeGC( display, dc->u.x.gc );
dc->u.x.gc = TSXCreateGC( display, dc->u.x.drawable, 0, NULL );
TSXFreeGC( display, physDev->gc );
physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL );
dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel;
DC_InitDC( dc );
}
......@@ -139,19 +141,18 @@ X11DRV_PHYSBITMAP *X11DRV_AllocBitmap( BITMAPOBJ *bmp )
X11DRV_PHYSBITMAP *pbitmap;
if(!(bmp->DDBitmap = HeapAlloc(GetProcessHeap(), 0, sizeof(DDBITMAP)))) {
WARN(bitmap, "Can't alloc DDBITMAP\n");
WARN(x11drv, "Can't alloc DDBITMAP\n");
return NULL;
}
if(!(pbitmap = HeapAlloc(GetProcessHeap(), 0,sizeof(X11DRV_PHYSBITMAP)))) {
WARN(bitmap, "Can't alloc X11DRV_PHYSBITMAP\n");
WARN(x11drv, "Can't alloc X11DRV_PHYSBITMAP\n");
HeapFree(GetProcessHeap(), 0, bmp->DDBitmap);
return NULL;
}
bmp->DDBitmap->physBitmap = pbitmap;
bmp->DDBitmap->funcs = DRIVER_FindDriver( "DISPLAY" );
return pbitmap;
}
......@@ -172,7 +173,7 @@ BOOL32 X11DRV_CreateBitmap( HBITMAP32 hbitmap )
BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
if(!bmp) {
WARN(bitmap, "Bad bitmap handle %08x\n", hbitmap);
WARN(x11drv, "Bad bitmap handle %08x\n", hbitmap);
return FALSE;
}
......@@ -180,6 +181,8 @@ BOOL32 X11DRV_CreateBitmap( HBITMAP32 hbitmap )
if (bmp->bitmap.bmPlanes != 1) return 0;
if ((bmp->bitmap.bmBitsPixel != 1) &&
(bmp->bitmap.bmBitsPixel != screenDepth)) {
ERR(x11drv, "Trying to make bitmap with planes=%d, bpp=%d\n",
bmp->bitmap.bmPlanes, bmp->bitmap.bmBitsPixel);
GDI_HEAP_UNLOCK( hbitmap );
return FALSE;
}
......@@ -194,7 +197,7 @@ BOOL32 X11DRV_CreateBitmap( HBITMAP32 hbitmap )
pbitmap->pixmap = TSXCreatePixmap(display, rootWindow, bmp->bitmap.bmWidth,
bmp->bitmap.bmHeight, bmp->bitmap.bmBitsPixel);
if (!pbitmap->pixmap) {
WARN(bitmap, "Can't create Pixmap\n");
WARN(x11drv, "Can't create Pixmap\n");
HeapFree(GetProcessHeap(), 0, bmp->DDBitmap->physBitmap);
HeapFree(GetProcessHeap(), 0, bmp->DDBitmap);
GDI_HEAP_UNLOCK( hbitmap );
......@@ -239,7 +242,7 @@ static LONG X11DRV_GetBitmapBits(BITMAPOBJ *bmp, void *buffer, LONG count)
LPBYTE tbuf;
int h, w, pad;
TRACE(x11drv, "(bmp=%p, buffer=%p, count=%lx)\n", bmp, buffer, count);
TRACE(x11drv, "(bmp=%p, buffer=%p, count=0x%lx)\n", bmp, buffer, count);
pad = BITMAP_GetPadding(bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel);
......@@ -340,7 +343,7 @@ static LONG X11DRV_GetBitmapBits(BITMAPOBJ *bmp, void *buffer, LONG count)
}
break;
default:
FIXME(bitmap, "Unhandled bits:%d\n", bmp->bitmap.bmBitsPixel);
FIXME(x11drv, "Unhandled bits:%d\n", bmp->bitmap.bmBitsPixel);
}
XDestroyImage( image );
LeaveCriticalSection( &X11DRV_CritSection );
......@@ -365,7 +368,7 @@ static LONG X11DRV_SetBitmapBits(BITMAPOBJ *bmp, void *bits, LONG count)
LPBYTE sbuf;
int w, h, pad;
TRACE(x11drv, "(bmp=%p, bits=%p, count=%lx)\n", bmp, bits, count);
TRACE(x11drv, "(bmp=%p, bits=%p, count=0x%lx)\n", bmp, bits, count);
pad = BITMAP_GetPadding(bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel);
......@@ -451,7 +454,7 @@ static LONG X11DRV_SetBitmapBits(BITMAPOBJ *bmp, void *bits, LONG count)
}
break;
default:
FIXME(bitmap, "Unhandled bits:%d\n", bmp->bitmap.bmBitsPixel);
FIXME(x11drv, "Unhandled bits:%d\n", bmp->bitmap.bmBitsPixel);
}
......@@ -475,7 +478,7 @@ LONG X11DRV_BitmapBits(HBITMAP32 hbitmap, void *bits, LONG count, WORD flags)
BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
LONG ret;
if(!bmp) {
WARN(bitmap, "Bad bitmap handle %08x\n", hbitmap);
WARN(x11drv, "Bad bitmap handle %08x\n", hbitmap);
return FALSE;
}
......@@ -484,7 +487,7 @@ LONG X11DRV_BitmapBits(HBITMAP32 hbitmap, void *bits, LONG count, WORD flags)
else if(flags == DDB_SET)
ret = X11DRV_SetBitmapBits(bmp, bits, count);
else {
ERR(bitmap, "Unknown flags value %d\n", flags);
ERR(x11drv, "Unknown flags value %d\n", flags);
ret = 0;
}
......
/*
* GDI brush objects
* X11DRV brush objects
*
* Copyright 1993, 1994 Alexandre Julliard
*/
......@@ -142,18 +142,20 @@ static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
*/
static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if ((dc->w.bitsPerPixel > 1) && (screenDepth <= 8) && !COLOR_IsSolid( color ))
{
/* Dithered brush */
dc->u.x.brush.pixmap = BRUSH_DitherColor( dc, color );
dc->u.x.brush.fillStyle = FillTiled;
dc->u.x.brush.pixel = 0;
physDev->brush.pixmap = BRUSH_DitherColor( dc, color );
physDev->brush.fillStyle = FillTiled;
physDev->brush.pixel = 0;
}
else
{
/* Solid brush */
dc->u.x.brush.pixel = COLOR_ToPhysical( dc, color );
dc->u.x.brush.fillStyle = FillSolid;
physDev->brush.pixel = COLOR_ToPhysical( dc, color );
physDev->brush.fillStyle = FillSolid;
}
}
......@@ -164,6 +166,7 @@ static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
static BOOL32 BRUSH_SelectPatternBrush( DC * dc, HBITMAP32 hbitmap )
{
X11DRV_PHYSBITMAP *pbitmap;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
BITMAPOBJ * bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
if (!bmp) return FALSE;
......@@ -181,28 +184,28 @@ static BOOL32 BRUSH_SelectPatternBrush( DC * dc, HBITMAP32 hbitmap )
if ((dc->w.bitsPerPixel == 1) && (bmp->bitmap.bmBitsPixel != 1))
{
/* Special case: a color pattern on a monochrome DC */
dc->u.x.brush.pixmap = TSXCreatePixmap( display, rootWindow, 8, 8, 1 );
physDev->brush.pixmap = TSXCreatePixmap( display, rootWindow, 8, 8, 1);
/* FIXME: should probably convert to monochrome instead */
TSXCopyPlane( display, pbitmap->pixmap, dc->u.x.brush.pixmap,
TSXCopyPlane( display, pbitmap->pixmap, physDev->brush.pixmap,
BITMAP_monoGC, 0, 0, 8, 8, 0, 0, 1 );
}
else
{
dc->u.x.brush.pixmap = TSXCreatePixmap( display, rootWindow,
8, 8, bmp->bitmap.bmBitsPixel );
TSXCopyArea( display, pbitmap->pixmap, dc->u.x.brush.pixmap,
physDev->brush.pixmap = TSXCreatePixmap( display, rootWindow,
8, 8, bmp->bitmap.bmBitsPixel );
TSXCopyArea( display, pbitmap->pixmap, physDev->brush.pixmap,
BITMAP_GC(bmp), 0, 0, 8, 8, 0, 0 );
}
if (bmp->bitmap.bmBitsPixel > 1)
{
dc->u.x.brush.fillStyle = FillTiled;
dc->u.x.brush.pixel = 0; /* Ignored */
physDev->brush.fillStyle = FillTiled;
physDev->brush.pixel = 0; /* Ignored */
}
else
{
dc->u.x.brush.fillStyle = FillOpaqueStippled;
dc->u.x.brush.pixel = -1; /* Special case (see DC_SetupGCForBrush) */
physDev->brush.fillStyle = FillOpaqueStippled;
physDev->brush.pixel = -1; /* Special case (see DC_SetupGCForBrush) */
}
GDI_HEAP_UNLOCK( hbitmap );
return TRUE;
......@@ -219,38 +222,19 @@ HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush )
HBITMAP16 hBitmap;
BITMAPINFO * bmpInfo;
HBRUSH16 prevHandle = dc->w.hBrush;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
TRACE(gdi, "hdc=%04x hbrush=%04x\n",
dc->hSelf,hbrush);
#ifdef NOTDEF
if (dc->header.wMagic == METAFILE_DC_MAGIC)
{
LOGBRUSH16 logbrush = { brush->logbrush.lbStyle,
brush->logbrush.lbColor,
brush->logbrush.lbHatch };
switch (brush->logbrush.lbStyle)
{
case BS_SOLID:
case BS_HATCHED:
case BS_HOLLOW:
if (!MF_CreateBrushIndirect( dc, hbrush, &logbrush )) return 0;
break;
case BS_PATTERN:
case BS_DIBPATTERN:
if (!MF_CreatePatternBrush( dc, hbrush, &logbrush )) return 0;
break;
}
return 1; /* FIXME? */
}
#endif
dc->w.hBrush = hbrush;
if (dc->u.x.brush.pixmap)
if (physDev->brush.pixmap)
{
TSXFreePixmap( display, dc->u.x.brush.pixmap );
dc->u.x.brush.pixmap = 0;
TSXFreePixmap( display, physDev->brush.pixmap );
physDev->brush.pixmap = 0;
}
dc->u.x.brush.style = brush->logbrush.lbStyle;
physDev->brush.style = brush->logbrush.lbStyle;
switch(brush->logbrush.lbStyle)
{
......@@ -265,10 +249,10 @@ HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush )
case BS_HATCHED:
TRACE(gdi, "BS_HATCHED\n" );
dc->u.x.brush.pixel = COLOR_ToPhysical( dc, brush->logbrush.lbColor );
dc->u.x.brush.pixmap = TSXCreateBitmapFromData( display, rootWindow,
physDev->brush.pixel = COLOR_ToPhysical( dc, brush->logbrush.lbColor );
physDev->brush.pixmap = TSXCreateBitmapFromData( display, rootWindow,
HatchBrushes[brush->logbrush.lbHatch], 8, 8 );
dc->u.x.brush.fillStyle = FillStippled;
physDev->brush.fillStyle = FillStippled;
break;
case BS_PATTERN:
......
......@@ -21,12 +21,13 @@
void X11DRV_SetDeviceClipping( DC * dc )
{
XRectangle *pXrect;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr(dc->w.hGCClipRgn, REGION_MAGIC);
if (!obj)
{
ERR(x11drv, "Rgn is 0. Please report this.\n");
return;
/*exit(1);*/
}
if (obj->rgn->numRects > 0)
......@@ -54,7 +55,7 @@ void X11DRV_SetDeviceClipping( DC * dc )
else
pXrect = NULL;
TSXSetClipRectangles( display, dc->u.x.gc, 0, 0,
TSXSetClipRectangles( display, physDev->gc, 0, 0,
pXrect, obj->rgn->numRects, YXBanded );
if(pXrect)
......
......@@ -1098,6 +1098,7 @@ INT32 X11DRV_SetDIBitsToDevice( DC *dc, INT32 xDest, INT32 yDest, DWORD cx,
DWORD width, oldcy = cy;
INT32 result;
int height, tmpheight;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height,
......@@ -1115,7 +1116,7 @@ INT32 X11DRV_SetDIBitsToDevice( DC *dc, INT32 xDest, INT32 yDest, DWORD cx,
if (!cx || !cy) return 0;
X11DRV_SetupGCForText( dc ); /* To have the correct colors */
TSXSetFunction(display, dc->u.x.gc, X11DRV_XROPfunction[dc->w.ROPmode-1]);
TSXSetFunction(display, physDev->gc, X11DRV_XROPfunction[dc->w.ROPmode-1]);
if (descr.infoBpp <= 8)
{
......@@ -1132,8 +1133,8 @@ INT32 X11DRV_SetDIBitsToDevice( DC *dc, INT32 xDest, INT32 yDest, DWORD cx,
descr.lines = tmpheight >= 0 ? lines : -lines;
descr.infoWidth = width;
descr.depth = dc->w.bitsPerPixel;
descr.drawable = dc->u.x.drawable;
descr.gc = dc->u.x.gc;
descr.drawable = physDev->drawable;
descr.gc = physDev->gc;
descr.xSrc = xSrc;
descr.ySrc = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy)
: ySrc - startscan;
......
......@@ -8,7 +8,8 @@
#include "x11drv.h"
#include "color.h"
#include "bitmap.h"
#include "winnt.h"
#include "debug.h"
static BOOL32 X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData );
......@@ -170,10 +171,13 @@ static BOOL32 X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
{
X11DRV_PDEVICE *physDev;
physDev = &dc->u.x; /* for now */
dc->physDev = physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(*physDev) );
if(!physDev) {
ERR(x11drv, "Can't allocate physDev\n");
return FALSE;
}
memset( physDev, 0, sizeof(*physDev) );
dc->physDev = physDev;
dc->w.devCaps = &X11DRV_DevCaps;
if (dc->w.flags & DC_MEMORY)
{
......@@ -227,6 +231,8 @@ static BOOL32 X11DRV_DeleteDC( DC *dc )
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
TSXFreeGC( display, physDev->gc );
HeapFree( GetProcessHeap(), 0, physDev );
dc->physDev = NULL;
return TRUE;
}
......
/*
* GDI pen objects
* X11DRV pen objects
*
* Copyright 1993 Alexandre Julliard
*/
......@@ -20,40 +20,41 @@ static const char PEN_alternate[] = { 1,1 }; /* FIXME */
HPEN32 X11DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
{
HPEN32 prevHandle = dc->w.hPen;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
dc->w.hPen = hpen;
dc->u.x.pen.style = pen->logpen.lopnStyle & PS_STYLE_MASK;
dc->u.x.pen.type = pen->logpen.lopnStyle & PS_TYPE_MASK;
dc->u.x.pen.endcap = pen->logpen.lopnStyle & PS_ENDCAP_MASK;
dc->u.x.pen.linejoin = pen->logpen.lopnStyle & PS_JOIN_MASK;
physDev->pen.style = pen->logpen.lopnStyle & PS_STYLE_MASK;
physDev->pen.type = pen->logpen.lopnStyle & PS_TYPE_MASK;
physDev->pen.endcap = pen->logpen.lopnStyle & PS_ENDCAP_MASK;
physDev->pen.linejoin = pen->logpen.lopnStyle & PS_JOIN_MASK;
dc->u.x.pen.width = (pen->logpen.lopnWidth.x * dc->vportExtX +
physDev->pen.width = (pen->logpen.lopnWidth.x * dc->vportExtX +
dc->wndExtX / 2) / dc->wndExtX;
if (dc->u.x.pen.width < 0) dc->u.x.pen.width = -dc->u.x.pen.width;
if (dc->u.x.pen.width == 1) dc->u.x.pen.width = 0; /* Faster */
dc->u.x.pen.pixel = COLOR_ToPhysical( dc, pen->logpen.lopnColor );
if (physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
if (physDev->pen.width == 1) physDev->pen.width = 0; /* Faster */
physDev->pen.pixel = COLOR_ToPhysical( dc, pen->logpen.lopnColor );
switch(pen->logpen.lopnStyle & PS_STYLE_MASK)
{
case PS_DASH:
dc->u.x.pen.dashes = (char *)PEN_dash;
dc->u.x.pen.dash_len = 2;
physDev->pen.dashes = (char *)PEN_dash;
physDev->pen.dash_len = 2;
break;
case PS_DOT:
dc->u.x.pen.dashes = (char *)PEN_dot;
dc->u.x.pen.dash_len = 2;
physDev->pen.dashes = (char *)PEN_dot;
physDev->pen.dash_len = 2;
break;
case PS_DASHDOT:
dc->u.x.pen.dashes = (char *)PEN_dashdot;
dc->u.x.pen.dash_len = 4;
physDev->pen.dashes = (char *)PEN_dashdot;
physDev->pen.dash_len = 4;
break;
case PS_DASHDOTDOT:
dc->u.x.pen.dashes = (char *)PEN_dashdotdot;
dc->u.x.pen.dash_len = 6;
physDev->pen.dashes = (char *)PEN_dashdotdot;
physDev->pen.dash_len = 6;
break;
case PS_ALTERNATE:
/* FIXME: should be alternating _pixels_ that are set */
dc->u.x.pen.dashes = (char *)PEN_alternate;
dc->u.x.pen.dash_len = 2;
physDev->pen.dashes = (char *)PEN_alternate;
physDev->pen.dash_len = 2;
break;
case PS_USERSTYLE:
/* FIXME */
......
......@@ -35,10 +35,11 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
RECT32 rect;
char dfBreakChar, lfUnderline, lfStrikeOut;
BOOL32 rotated = FALSE;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!X11DRV_SetupGCForText( dc )) return TRUE;
pfo = XFONT_GetFontObject( dc->u.x.font );
pfo = XFONT_GetFontObject( physDev->font );
font = pfo->fs;
if (pfo->lf.lfEscapement && pfo->lpX11Trans)
......@@ -48,7 +49,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
lfStrikeOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT) ? 1 : 0;
TRACE(text,"hdc=%04x df=%04x %d,%d %s, %d flags=%d lpDx=%p\n",
dc->hSelf, (UINT16)(dc->u.x.font), x, y,
dc->hSelf, (UINT16)(physDev->font), x, y,
debugstr_an (str, count), count, flags, lpDx);
/* some strings sent here end in a newline for whatever reason. I have no
......@@ -102,8 +103,8 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
if (flags & ETO_OPAQUE)
{
TSXSetForeground( display, dc->u.x.gc, dc->u.x.backgroundPixel );
TSXFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
TSXSetForeground( display, physDev->gc, physDev->backgroundPixel );
TSXFillRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + rect.left, dc->w.DCOrgY + rect.top,
rect.right-rect.left, rect.bottom-rect.top );
}
......@@ -195,8 +196,9 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
(y - ascent < rect.top) ||
(y + descent >= rect.bottom))
{
TSXSetForeground( display, dc->u.x.gc, dc->u.x.backgroundPixel );
TSXFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
TSXSetForeground( display, physDev->gc,
physDev->backgroundPixel );
TSXFillRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + x,
dc->w.DCOrgY + y - ascent,
width,
......@@ -207,12 +209,12 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
/* Draw the text (count > 0 verified) */
TSXSetForeground( display, dc->u.x.gc, dc->u.x.textPixel );
TSXSetForeground( display, physDev->gc, physDev->textPixel );
if (!dc->w.charExtra && !dc->w.breakExtra && !lpDx)
{
if(!rotated)
{
TSXDrawString( display, dc->u.x.drawable, dc->u.x.gc,
TSXDrawString( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + x, dc->w.DCOrgY + y, str, count );
}
else
......@@ -229,7 +231,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
int y_i = IROUND((double) (dc->w.DCOrgY + y) - offset *
pfo->lpX11Trans->b / 1000.0 );
TSXDrawString( display, dc->u.x.drawable, dc->u.x.gc,
TSXDrawString( display, physDev->drawable, physDev->gc,
x_i, y_i, &str[i], 1);
offset += (double) (font->per_char ?
font->per_char[char_metric_offset].attributes:
......@@ -293,7 +295,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
}
}
TSXDrawText( display, dc->u.x.drawable, dc->u.x.gc,
TSXDrawText( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + x, dc->w.DCOrgY + y, items, pitem - items );
HeapFree( GetProcessHeap(), 0, items );
}
......@@ -309,11 +311,11 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
if (!TSXGetFontProperty( font, XA_UNDERLINE_THICKNESS, &lineWidth ))
lineWidth = 0;
else if (lineWidth == 1) lineWidth = 0;
TSXSetLineAttributes( display, dc->u.x.gc, lineWidth,
LineSolid, CapRound, JoinBevel );
TSXDrawLine( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x, dc->w.DCOrgY + y + linePos,
dc->w.DCOrgX + x + width, dc->w.DCOrgY + y + linePos );
TSXSetLineAttributes( display, physDev->gc, lineWidth,
LineSolid, CapRound, JoinBevel );
TSXDrawLine( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + x, dc->w.DCOrgY + y + linePos,
dc->w.DCOrgX + x + width, dc->w.DCOrgY + y + linePos );
}
if (lfStrikeOut)
{
......@@ -322,9 +324,9 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
lineAscent = ascent / 2;
if (!TSXGetFontProperty( font, XA_STRIKEOUT_DESCENT, &lineDescent ))
lineDescent = -lineAscent * 2 / 3;
TSXSetLineAttributes( display, dc->u.x.gc, lineAscent + lineDescent,
TSXSetLineAttributes( display, physDev->gc, lineAscent + lineDescent,
LineSolid, CapRound, JoinBevel );
TSXDrawLine( display, dc->u.x.drawable, dc->u.x.gc,
TSXDrawLine( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + x, dc->w.DCOrgY + y - lineAscent,
dc->w.DCOrgX + x + width, dc->w.DCOrgY + y - lineAscent );
}
......
......@@ -2206,16 +2206,17 @@ HFONT32 X11DRV_FONT_SelectObject( DC* dc, HFONT32 hfont, FONTOBJ* font )
{
HFONT32 hPrevFont = 0;
LOGFONT16 lf;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if( CHECK_PFONT(dc->u.x.font) )
XFONT_ReleaseCacheEntry( __PFONT(dc->u.x.font) );
if( CHECK_PFONT(physDev->font) )
XFONT_ReleaseCacheEntry( __PFONT(physDev->font) );
/* FIXME: do we need to pass anything back from here? */
memcpy(&lf,&font->logfont,sizeof(lf));
lf.lfWidth = font->logfont.lfWidth * dc->vportExtX/dc->wndExtX;
lf.lfHeight = font->logfont.lfHeight* dc->vportExtY/dc->wndExtY;
dc->u.x.font = XFONT_RealizeFont( &lf );
physDev->font = XFONT_RealizeFont( &lf );
hPrevFont = dc->w.hFont;
dc->w.hFont = hfont;
......@@ -2268,7 +2269,8 @@ BOOL32 X11DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
BOOL32 X11DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
LPSIZE32 size )
{
fontObject* pfo = XFONT_GetFontObject( dc->u.x.font );
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
fontObject* pfo = XFONT_GetFontObject( physDev->font );
if( pfo ) {
if( !pfo->lpX11Trans ) {
int dir, ascent, descent;
......@@ -2307,9 +2309,11 @@ BOOL32 X11DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
*/
BOOL32 X11DRV_GetTextMetrics(DC *dc, TEXTMETRIC32A *metrics)
{
if( CHECK_PFONT(dc->u.x.font) )
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if( CHECK_PFONT(physDev->font) )
{
fontObject* pfo = __PFONT(dc->u.x.font);
fontObject* pfo = __PFONT(physDev->font);
XFONT_GetTextMetric( pfo, metrics );
return TRUE;
......@@ -2324,7 +2328,8 @@ BOOL32 X11DRV_GetTextMetrics(DC *dc, TEXTMETRIC32A *metrics)
BOOL32 X11DRV_GetCharWidth( DC *dc, UINT32 firstChar, UINT32 lastChar,
LPINT32 buffer )
{
fontObject* pfo = XFONT_GetFontObject( dc->u.x.font );
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
fontObject* pfo = XFONT_GetFontObject( physDev->font );
if( pfo )
{
......
......@@ -8,6 +8,8 @@
#define __WINE_BITMAP_H
#include "gdi.h"
#include "ts_xlib.h"
#include "ts_xutil.h"
/* Additional info for DIB section objects */
typedef struct
......
......@@ -3,6 +3,7 @@
#include "palette.h"
#include "gdi.h"
#include "x11drv.h"
#define COLOR_FIXED 0x0001 /* read-only colormap - have to use XAllocColor (if not virtual)*/
#define COLOR_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
......
......@@ -10,7 +10,6 @@
#include "windows.h"
#include "ldt.h"
#include "local.h"
#include "x11drv.h"
#include "path.h"
#include <math.h>
......@@ -139,8 +138,6 @@ typedef struct
BOOL32 vport2WorldValid; /* Is xformVport2World valid? */
} WIN_DC_INFO;
typedef X11DRV_PDEVICE X_DC_INFO; /* Temporary */
typedef struct tagDC
{
GDIOBJHDR header;
......@@ -161,14 +158,12 @@ typedef struct tagDC
INT32 vportExtY;
WIN_DC_INFO w;
union
{
X_DC_INFO x;
/* other devices (e.g. printer) */
} u;
} DC;
/* Device functions for the Wine driver interface */
typedef INT32 (*DEVICEFONTENUMPROC)(LPENUMLOGFONT16,LPNEWTEXTMETRIC16,UINT16,LPARAM);
typedef struct tagDC_FUNCS
{
BOOL32 (*pArc)(DC*,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32);
......@@ -432,11 +427,4 @@ extern BOOL32 DRIVER_RegisterDriver( LPCSTR name, const DC_FUNCTIONS *funcs );
extern const DC_FUNCTIONS *DRIVER_FindDriver( LPCSTR name );
extern BOOL32 DRIVER_UnregisterDriver( LPCSTR name );
extern BOOL32 DIB_Init(void);
extern Display * display;
extern Screen * screen;
extern Window rootWindow;
extern int screenWidth, screenHeight, screenDepth;
#endif /* __WINE_GDI_H */
......@@ -9,6 +9,7 @@
#include "ts_xutil.h"
#include "winbase.h"
#include "windows.h"
#include "gdi.h"
#include "xmalloc.h" /* for XCREATEIMAGE macro */
/* X physical pen */
......@@ -59,7 +60,6 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
#define BITMAP_GC(bmp) \
(((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
typedef INT32 (*DEVICEFONTENUMPROC)(LPENUMLOGFONT16,LPNEWTEXTMETRIC16,UINT16,LPARAM);
/* Wine driver X11 functions */
......@@ -158,6 +158,12 @@ extern BOOL32 X11DRV_SetupGCForText( struct tagDC *dc );
extern const int X11DRV_XROPfunction[];
extern Display * display;
extern Screen * screen;
extern Window rootWindow;
extern int screenWidth, screenHeight, screenDepth;
/* Xlib critical section */
extern CRITICAL_SECTION X11DRV_CritSection;
......
......@@ -8,7 +8,7 @@
#define __WINE_X11FONT_H
#include "gdi.h"
#include "x11drv.h"
#pragma pack(1)
/* this is a part of the font resource header, should
......
......@@ -34,6 +34,7 @@
#include "xmalloc.h"
#include "version.h"
#include "winnls.h"
#include "x11drv.h"
/* when adding new languages look at ole/ole2nls.c
* for proper iso name and Windows code (add 0x0400
......
......@@ -16,7 +16,7 @@
#include "cursoricon.h"
#include "color.h"
#include "debug.h"
#include "x11drv.h"
/***********************************************************************
* BITMAP_GetPadding
......
......@@ -14,6 +14,7 @@
#include "color.h"
#include "debug.h"
#include "xmalloc.h"
#include "x11drv.h"
/* Palette indexed mode:
......
......@@ -14,7 +14,7 @@
#include "debug.h"
#include "font.h"
#include "winerror.h"
#include "x11drv.h"
/***********************************************************************
* DC_Init_DC_INFO
......@@ -221,7 +221,6 @@ HDC16 WINAPI GetDCState( HDC16 hdc )
TRACE(dc, "(%04x): returning %04x\n", hdc, handle );
memset( &newdc->u.x, 0, sizeof(newdc->u.x) );
newdc->w.flags = dc->w.flags | DC_SAVED;
newdc->w.devCaps = dc->w.devCaps;
newdc->w.hPen = dc->w.hPen;
......@@ -854,15 +853,18 @@ UINT32 WINAPI SetTextAlign32( HDC32 hdc, UINT32 textAlign )
BOOL32 WINAPI GetDCOrgEx( HDC32 hDC, LPPOINT32 lpp )
{
DC * dc;
X11DRV_PDEVICE *physDev;
if (!lpp) return FALSE;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return FALSE;
physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!(dc->w.flags & DC_MEMORY))
{
Window root;
int w, h, border, depth;
/* FIXME: this is not correct for managed windows */
TSXGetGeometry( display, dc->u.x.drawable, &root,
TSXGetGeometry( display, physDev->drawable, &root,
&lpp->x, &lpp->y, &w, &h, &border, &depth );
}
else lpp->x = lpp->y = 0;
......
......@@ -16,7 +16,7 @@
#include "region.h"
#include "debug.h"
#include "gdi.h"
#include "x11drv.h"
/***********************************************************************
* GDI stock objects
......
......@@ -26,6 +26,7 @@
#include "heap.h"
#include "sysmetrics.h"
#include "debug.h"
#include "x11drv.h"
#define NB_DCE 5 /* Number of DCEs created at startup */
......@@ -522,12 +523,14 @@ static void DCE_OffsetVisRgn( HDC32 hDC, HRGN32 hVisRgn )
*/
static void DCE_SetDrawable( WND *wndPtr, DC *dc, WORD flags, BOOL32 bSetClipOrigin )
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!wndPtr) /* Get a DC for the whole screen */
{
dc->w.DCOrgX = 0;
dc->w.DCOrgY = 0;
dc->u.x.drawable = rootWindow;
TSXSetSubwindowMode( display, dc->u.x.gc, IncludeInferiors );
physDev->drawable = rootWindow;
TSXSetSubwindowMode( display, physDev->gc, IncludeInferiors );
}
else
{
......@@ -549,7 +552,7 @@ static void DCE_SetDrawable( WND *wndPtr, DC *dc, WORD flags, BOOL32 bSetClipOri
}
dc->w.DCOrgX -= wndPtr->rectWindow.left;
dc->w.DCOrgY -= wndPtr->rectWindow.top;
dc->u.x.drawable = wndPtr->window;
physDev->drawable = wndPtr->window;
#if 0
/* This is needed when we reuse a cached DC because
......@@ -558,7 +561,7 @@ static void DCE_SetDrawable( WND *wndPtr, DC *dc, WORD flags, BOOL32 bSetClipOri
*/
if( bSetClipOrigin )
TSXSetClipOrigin( display, dc->u.x.gc, dc->w.DCOrgX, dc->w.DCOrgY );
TSXSetClipOrigin( display, physDev->gc, dc->w.DCOrgX, dc->w.DCOrgY );
#endif
}
}
......
......@@ -20,6 +20,7 @@
#include "heap.h"
#include "debug.h"
#include "debugtools.h"
#include "x11drv.h"
Cursor DISPLAY_XCursor = None; /* Current X cursor */
......
......@@ -41,7 +41,7 @@
#include "dde_proc.h"
#include "winsock.h"
#include "mouse.h"
#include "x11drv.h"
#define NB_BUTTONS 3 /* Windows can handle 3 buttons */
......
......@@ -15,6 +15,7 @@
#include "bitmap.h"
#include "gdi.h"
#include "dc.h"
#include "x11drv.h"
#define MAX_DRAWLINES 8
......@@ -33,6 +34,7 @@ BOOL32 GRAPH_DrawLines( HDC32 hdc, LPPOINT32 pXY, INT32 N, HPEN32 hPen )
if( (dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC )) )
{
HPEN32 hPrevPen = 0;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if( hPen ) hPrevPen = SelectObject32( hdc, hPen );
if( X11DRV_SetupGCForPen( dc ) )
......@@ -48,7 +50,7 @@ BOOL32 GRAPH_DrawLines( HDC32 hdc, LPPOINT32 pXY, INT32 N, HPEN32 hPen )
l[i].y1 = pXY[j].y + dc->w.DCOrgY;
l[i].y2 = pXY[j + 1].y + dc->w.DCOrgY;
}
TSXDrawSegments( display, dc->u.x.drawable, dc->u.x.gc, l, N );
TSXDrawSegments( display, physDev->drawable, physDev->gc, l, N );
bRet = TRUE;
}
if( hPrevPen ) SelectObject32( hdc, hPrevPen );
......@@ -72,6 +74,7 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
DC *dc;
BOOL32 ret = TRUE;
X11DRV_PHYSBITMAP *pbitmap;
X11DRV_PDEVICE *physDev;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
......@@ -79,6 +82,7 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
GDI_HEAP_UNLOCK( hdc );
return FALSE;
}
physDev = (X11DRV_PDEVICE *)dc->physDev;
/* HACK for now */
if(!bmp->DDBitmap)
......@@ -87,12 +91,12 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
xdest += dc->w.DCOrgX; ydest += dc->w.DCOrgY;
TSXSetFunction( display, dc->u.x.gc, GXcopy );
TSXSetFunction( display, physDev->gc, GXcopy );
if (bmp->bitmap.bmBitsPixel == 1)
{
TSXSetForeground( display, dc->u.x.gc, dc->u.x.backgroundPixel );
TSXSetBackground( display, dc->u.x.gc, dc->u.x.textPixel );
TSXCopyPlane( display, pbitmap->pixmap, dc->u.x.drawable, dc->u.x.gc,
TSXSetForeground( display, physDev->gc, physDev->backgroundPixel );
TSXSetBackground( display, physDev->gc, physDev->textPixel );
TSXCopyPlane( display, pbitmap->pixmap, physDev->drawable, physDev->gc,
xsrc, ysrc, width, height, xdest, ydest, 1 );
}
else if (bmp->bitmap.bmBitsPixel == dc->w.bitsPerPixel)
......@@ -103,21 +107,25 @@ BOOL32 GRAPH_DrawBitmap( HDC32 hdc, HBITMAP32 hbitmap,
if( COLOR_GetMonoPlane(&plane) )
{
TSXSetForeground(display, dc->u.x.gc, dc->u.x.backgroundPixel);
TSXSetBackground(display, dc->u.x.gc, dc->u.x.textPixel);
TSXSetForeground( display, physDev->gc,
physDev->backgroundPixel );
TSXSetBackground( display, physDev->gc, physDev->textPixel );
}
else
{
TSXSetForeground(display, dc->u.x.gc, dc->u.x.textPixel);
TSXSetBackground(display, dc->u.x.gc, dc->u.x.backgroundPixel);
TSXSetForeground( display, physDev->gc, physDev->textPixel );
TSXSetBackground( display, physDev->gc,
physDev->backgroundPixel );
}
TSXCopyPlane( display, pbitmap->pixmap, dc->u.x.drawable, dc->u.x.gc,
xsrc, ysrc, width, height, xdest, ydest, plane );
TSXCopyPlane( display, pbitmap->pixmap, physDev->drawable,
physDev->gc, xsrc, ysrc, width, height, xdest, ydest,
plane );
}
else
{
TSXCopyArea( display, pbitmap->pixmap, dc->u.x.drawable,
dc->u.x.gc, xsrc, ysrc, width, height, xdest, ydest );
TSXCopyArea( display, pbitmap->pixmap, physDev->drawable,
physDev->gc, xsrc, ysrc, width, height, xdest,
ydest );
}
}
else
......@@ -170,9 +178,10 @@ void GRAPH_DrawGenericReliefRect(
HBRUSH32 hPrevBrush;
INT32 w, h;
RECT32 r = *rect;
X11DRV_PDEVICE *physDev;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return;
physDev = (X11DRV_PDEVICE *)dc->physDev;
OffsetRect32( &r, dc->w.DCOrgX, dc->w.DCOrgY);
h = rect->bottom - rect->top; w = rect->right - rect->left;
......@@ -182,12 +191,12 @@ void GRAPH_DrawGenericReliefRect(
{
INT32 i;
TSXSetFunction( display, dc->u.x.gc, GXcopy );
TSXSetFunction( display, physDev->gc, GXcopy );
for (i = 0; i < highlight_size; i++)
{
TSXFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
TSXFillRectangle( display, physDev->drawable, physDev->gc,
r.left + i, r.top, 1, h - i );
TSXFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
TSXFillRectangle( display, physDev->drawable, physDev->gc,
r.left, r.top + i, w - i, 1 );
}
}
......@@ -197,12 +206,12 @@ void GRAPH_DrawGenericReliefRect(
{
INT32 i;
TSXSetFunction( display, dc->u.x.gc, GXcopy );
TSXSetFunction( display, physDev->gc, GXcopy );
for (i = 0; i < shadow_size; i++)
{
TSXFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
TSXFillRectangle( display, physDev->drawable, physDev->gc,
r.right - i - 1, r.top + i, 1, h - i );
TSXFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
TSXFillRectangle( display, physDev->drawable, physDev->gc,
r.left + i, r.bottom - i - 1, w - i, 1 );
}
}
......@@ -224,10 +233,11 @@ void GRAPH_DrawRectangle( HDC32 hdc, INT32 x, INT32 y,
if( (dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC )) )
{
HPEN32 hPrevPen = 0;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if( hPen ) hPrevPen = SelectObject32( hdc, hPen );
if( X11DRV_SetupGCForPen( dc ) )
TSXDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
TSXDrawRectangle( display, physDev->drawable, physDev->gc,
x + dc->w.DCOrgX, y + dc->w.DCOrgY, w - 1, h - 1);
if( hPrevPen ) SelectObject32( hdc, hPrevPen );
GDI_HEAP_UNLOCK( hdc );
......@@ -242,8 +252,10 @@ BOOL32 GRAPH_SelectClipMask( HDC32 hdc, HBITMAP32 hMonoBitmap, INT32 x, INT32 y)
BITMAPOBJ *bmp = NULL;
DC *dc;
X11DRV_PHYSBITMAP *pbitmap = NULL;
X11DRV_PDEVICE *physDev;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
physDev = (X11DRV_PDEVICE *)dc->physDev;
if ( hMonoBitmap )
{
if ( !(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hMonoBitmap, BITMAP_MAGIC))
......@@ -257,10 +269,11 @@ BOOL32 GRAPH_SelectClipMask( HDC32 hdc, HBITMAP32 hMonoBitmap, INT32 x, INT32 y)
if(!bmp->DDBitmap)
X11DRV_CreateBitmap( hMonoBitmap );
pbitmap = bmp->DDBitmap->physBitmap;
TSXSetClipOrigin( display, dc->u.x.gc, dc->w.DCOrgX + x, dc->w.DCOrgY + y);
TSXSetClipOrigin( display, physDev->gc, dc->w.DCOrgX + x,
dc->w.DCOrgY + y );
}
TSXSetClipMask( display, dc->u.x.gc, (bmp) ? pbitmap->pixmap : None );
TSXSetClipMask( display, physDev->gc, (bmp) ? pbitmap->pixmap : None );
GDI_HEAP_UNLOCK( hdc );
GDI_HEAP_UNLOCK( hMonoBitmap );
......
......@@ -26,6 +26,7 @@
#include "debugtools.h"
#include "struct32.h"
#include "winerror.h"
#include "x11drv.h"
static INT16 captureHT = HTCLIENT;
static HWND32 captureWnd = 0;
......
......@@ -11,7 +11,7 @@
#include "mouse.h"
#include "debug.h"
#include "debugtools.h"
#include "x11drv.h"
static LPMOUSE_EVENT_PROC DefMouseEventProc = NULL;
......
......@@ -18,7 +18,7 @@
#include "graphics.h"
#include "sysmetrics.h"
#include "debug.h"
#include "x11drv.h"
/*************************************************************************
* ScrollWindow16 (USER.61)
......@@ -346,6 +346,7 @@ rect?rect->left:0, rect?rect->top:0, rect ?rect->right:0, rect ?rect->bottom:0,
((flags & SW_SCROLLCHILDREN) ? DCX_NOCLIPCHILDREN : 0) );
if( (dc = (DC *)GDI_GetObjPtr(hDC, DC_MAGIC)) )
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
POINT32 dst, src;
if( dx > 0 ) dst.x = (src.x = dc->w.DCOrgX + cliprc.left) + dx;
......@@ -358,13 +359,15 @@ rect?rect->left:0, rect?rect->top:0, rect ?rect->right:0, rect ?rect->bottom:0,
(cliprc.bottom - cliprc.top > abs(dy)))
{
if (bUpdate) /* handles non-Wine windows hanging over the scrolled area */
TSXSetGraphicsExposures( display, dc->u.x.gc, True );
TSXSetFunction( display, dc->u.x.gc, GXcopy );
TSXCopyArea( display, dc->u.x.drawable, dc->u.x.drawable, dc->u.x.gc,
src.x, src.y, cliprc.right - cliprc.left - abs(dx),
cliprc.bottom - cliprc.top - abs(dy), dst.x, dst.y );
TSXSetGraphicsExposures( display, physDev->gc, True );
TSXSetFunction( display, physDev->gc, GXcopy );
TSXCopyArea( display, physDev->drawable, physDev->drawable,
physDev->gc, src.x, src.y,
cliprc.right - cliprc.left - abs(dx),
cliprc.bottom - cliprc.top - abs(dy),
dst.x, dst.y );
if (bUpdate)
TSXSetGraphicsExposures( display, dc->u.x.gc, False );
TSXSetGraphicsExposures( display, physDev->gc, False );
}
if( dc->w.hVisRgn && bUpdate )
......
......@@ -10,6 +10,7 @@
#include "options.h"
#include "tweak.h"
#include "sysmetrics.h"
#include "x11drv.h"
short sysMetrics[SM_CMETRICS+1];
......
......@@ -25,6 +25,7 @@
#include "queue.h"
#include "shell.h"
#include "callback.h"
#include "x11drv.h"
/***********************************************************************
* GetFreeSystemResources (USER.284)
......
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