Commit 00647af5 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Use the HDC from the gdi_physdev structure.

parent 6c951b7d
......@@ -542,7 +542,7 @@ static void get_colors(X11DRV_PDEVICE *physDevDst, X11DRV_PDEVICE *physDevSrc,
*fg = physDevDst->textPixel;
*bg = physDevDst->backgroundPixel;
if(physDevSrc->depth == 1) {
if(GetDIBColorTable(physDevSrc->hdc, 0, 2, rgb) == 2) {
if(GetDIBColorTable(physDevSrc->dev.hdc, 0, 2, rgb) == 2) {
DWORD logcolor;
logcolor = RGB(rgb[0].rgbRed, rgb[0].rgbGreen, rgb[0].rgbBlue);
*fg = X11DRV_PALETTE_ToPhysical( physDevDst, logcolor );
......@@ -918,7 +918,7 @@ static int BITBLT_GetSrcAreaStretch( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
BITBLT_StretchImage( imageSrc, imageDst, src->width, src->height,
dst->width, dst->height, &rectSrc, &rectDst,
fg, physDevDst->depth != 1 ? bg : physDevSrc->backgroundPixel,
image_pixel_mask( physDevSrc ), GetStretchBltMode(physDevDst->hdc) );
image_pixel_mask( physDevSrc ), GetStretchBltMode(physDevDst->dev.hdc) );
wine_tsx11_lock();
XPutImage( gdi_display, pixmap, gc, imageDst, 0, 0, 0, 0,
rectDst.right - rectDst.left, rectDst.bottom - rectDst.top );
......@@ -944,7 +944,7 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe
INT width = visRectSrc->right - visRectSrc->left;
INT height = visRectSrc->bottom - visRectSrc->top;
int fg, bg;
BOOL memdc = (GetObjectType(physDevSrc->hdc) == OBJ_MEMDC);
BOOL memdc = (GetObjectType(physDevSrc->dev.hdc) == OBJ_MEMDC);
if (physDevSrc->depth == physDevDst->depth)
{
......@@ -1074,7 +1074,7 @@ static int BITBLT_GetDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, GC gc, RECT
int exposures = 0;
INT width = visRectDst->right - visRectDst->left;
INT height = visRectDst->bottom - visRectDst->top;
BOOL memdc = (GetObjectType( physDev->hdc ) == OBJ_MEMDC);
BOOL memdc = (GetObjectType( physDev->dev.hdc ) == OBJ_MEMDC);
wine_tsx11_lock();
......@@ -1182,7 +1182,7 @@ static BOOL BITBLT_GetVisRectangles( X11DRV_PDEVICE *physDevDst, X11DRV_PDEVICE
rect.top = dst->y;
rect.right = dst->x + dst->width;
rect.bottom = dst->y + dst->height;
LPtoDP( physDevDst->hdc, (POINT *)&rect, 2 );
LPtoDP( physDevDst->dev.hdc, (POINT *)&rect, 2 );
dst->x = rect.left;
dst->y = rect.top;
dst->width = rect.right - rect.left;
......@@ -1207,7 +1207,7 @@ static BOOL BITBLT_GetVisRectangles( X11DRV_PDEVICE *physDevDst, X11DRV_PDEVICE
rect.top = src->y;
rect.right = src->x + src->width;
rect.bottom = src->y + src->height;
LPtoDP( physDevSrc->hdc, (POINT *)&rect, 2 );
LPtoDP( physDevSrc->dev.hdc, (POINT *)&rect, 2 );
src->x = rect.left;
src->y = rect.top;
src->width = rect.right - rect.left;
......@@ -1419,7 +1419,7 @@ BOOL CDECL X11DRV_PatBlt( PHYSDEV dev, INT x, INT y, INT width, INT height, DWOR
dst.y = y;
dst.width = width;
dst.height = height;
dst.layout = GetLayout( physDev->hdc );
dst.layout = GetLayout( dev->hdc );
if (rop & NOMIRRORBITMAP)
{
......@@ -1507,12 +1507,12 @@ BOOL CDECL X11DRV_StretchBlt( PHYSDEV dst_dev, INT xDst, INT yDst, INT widthDst,
src.y = ySrc;
src.width = widthSrc;
src.height = heightSrc;
src.layout = GetLayout( physDevSrc->hdc );
src.layout = GetLayout( src_dev->hdc );
dst.x = xDst;
dst.y = yDst;
dst.width = widthDst;
dst.height = heightDst;
dst.layout = GetLayout( physDevDst->hdc );
dst.layout = GetLayout( dst_dev->hdc );
if (rop & NOMIRRORBITMAP)
{
......@@ -1699,12 +1699,12 @@ BOOL CDECL X11DRV_AlphaBlend( PHYSDEV dst_dev, INT xDst, INT yDst, INT widthDst,
src.y = ySrc;
src.width = widthSrc;
src.height = heightSrc;
src.layout = GetLayout( physDevSrc->hdc );
src.layout = GetLayout( src_dev->hdc );
dst.x = xDst;
dst.y = yDst;
dst.width = widthDst;
dst.height = heightDst;
dst.layout = GetLayout( physDevDst->hdc );
dst.layout = GetLayout( dst_dev->hdc );
if (!BITBLT_GetVisRectangles( physDevDst, physDevSrc, &dst, &src )) return TRUE;
......
......@@ -259,7 +259,7 @@ HBRUSH CDECL X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
if (!GetObjectA( hbrush, sizeof(logbrush), &logbrush )) return 0;
TRACE("hdc=%p hbrush=%p\n", physDev->hdc,hbrush);
TRACE("hdc=%p hbrush=%p\n", dev->hdc, hbrush);
if (physDev->brush.pixmap)
{
......@@ -270,7 +270,7 @@ HBRUSH CDECL X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
}
physDev->brush.style = logbrush.lbStyle;
if (hbrush == GetStockObject( DC_BRUSH ))
logbrush.lbColor = GetDCBrushColor( physDev->hdc );
logbrush.lbColor = GetDCBrushColor( dev->hdc );
switch(logbrush.lbStyle)
{
......@@ -303,7 +303,7 @@ HBRUSH CDECL X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
if ((bmpInfo = GlobalLock( (HGLOBAL)logbrush.lbHatch )))
{
int size = bitmap_info_size( bmpInfo, logbrush.lbColor );
hBitmap = CreateDIBitmap( physDev->hdc, &bmpInfo->bmiHeader,
hBitmap = CreateDIBitmap( dev->hdc, &bmpInfo->bmiHeader,
CBM_INIT, ((char *)bmpInfo) + size,
bmpInfo,
(WORD)logbrush.lbColor );
......@@ -325,7 +325,7 @@ COLORREF CDECL X11DRV_SetDCBrushColor( PHYSDEV dev, COLORREF crColor )
{
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
if (GetCurrentObject(physDev->hdc, OBJ_BRUSH) == GetStockObject( DC_BRUSH ))
if (GetCurrentObject(dev->hdc, OBJ_BRUSH) == GetStockObject( DC_BRUSH ))
BRUSH_SelectSolidBrush( physDev, crColor );
return crColor;
......
......@@ -361,7 +361,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
BOOL invert = FALSE;
RGBQUAD table[2];
if (GetDIBColorTable( physDev->hdc, 0, 2, table ) == 2)
if (GetDIBColorTable( physDev->dev.hdc, 0, 2, table ) == 2)
invert = !colour_is_brighter(table[1], table[0]);
for (i = start; i < end; i++, rgb++)
......@@ -385,7 +385,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
BOOL invert = FALSE;
RGBQUAD table[2];
if (GetDIBColorTable( physDev->hdc, 0, 2, table ) == 2)
if (GetDIBColorTable( physDev->dev.hdc, 0, 2, table ) == 2)
invert = !colour_is_brighter(table[1], table[0]);
for (i = start; i < end; i++, rgb++)
......@@ -3853,7 +3853,7 @@ INT CDECL X11DRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx,
LONG width, height;
BOOL top_down;
POINT pt;
int rop = X11DRV_XROPfunction[GetROP2(physDev->hdc) - 1];
int rop = X11DRV_XROPfunction[GetROP2(dev->hdc) - 1];
if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height,
&descr.infoBpp, &descr.compression ) == -1)
......@@ -3864,7 +3864,7 @@ INT CDECL X11DRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx,
pt.x = xDest;
pt.y = yDest;
LPtoDP(physDev->hdc, &pt, 1);
LPtoDP(dev->hdc, &pt, 1);
if (!lines || (startscan >= height)) return 0;
if (!top_down && startscan + lines > height) lines = height - startscan;
......@@ -4117,7 +4117,7 @@ INT CDECL X11DRV_GetDIBits( PHYSDEV dev, HBITMAP hbitmap, UINT startscan, UINT l
if (physBitmap->pixmap_depth > 1)
{
GetPaletteEntries( GetCurrentObject( physDev->hdc, OBJ_PAL ), 0, 256, palette );
GetPaletteEntries( GetCurrentObject( dev->hdc, OBJ_PAL ), 0, 256, palette );
}
else
{
......@@ -4342,7 +4342,7 @@ void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physD
int* x11ColorMap;
int freeColorMap;
TRACE("(%p,%p,%d,%d,%d,%d,%d,%d)\n", physDevSrc->hdc, physDevDst->hdc,
TRACE("(%p,%p,%d,%d,%d,%d,%d,%d)\n", physDevSrc->dev.hdc, physDevDst->dev.hdc,
xSrc, ySrc, xDest, yDest, width, height);
/* this function is meant as an optimization for BitBlt,
* not to be called otherwise */
......@@ -4363,7 +4363,7 @@ void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physD
/* if the source bitmap is 8bpp or less, we're supposed to use the
* DC's palette for color conversion (not the DIB color table) */
if (dib.dsBm.bmBitsPixel <= 8) {
HPALETTE hPalette = GetCurrentObject( physDevSrc->hdc, OBJ_PAL );
HPALETTE hPalette = GetCurrentObject( physDevSrc->dev.hdc, OBJ_PAL );
if (!hPalette || (hPalette == GetStockObject(DEFAULT_PALETTE))) {
/* HACK: no palette has been set in the source DC,
* use the DIB colormap instead - this is necessary in some
......
......@@ -242,7 +242,7 @@ BOOL X11DRV_SetupGCForPatBlt( X11DRV_PDEVICE *physDev, GC gc, BOOL fMapColors )
val.background = X11DRV_PALETTE_XPixelToPalette[val.background];
}
val.function = X11DRV_XROPfunction[GetROP2(physDev->hdc)-1];
val.function = X11DRV_XROPfunction[GetROP2(physDev->dev.hdc)-1];
/*
** Let's replace GXinvert by GXxor with (black xor white)
** This solves the selection color and leak problems in excel
......@@ -259,7 +259,7 @@ BOOL X11DRV_SetupGCForPatBlt( X11DRV_PDEVICE *physDev, GC gc, BOOL fMapColors )
{
case FillStippled:
case FillOpaqueStippled:
if (GetBkMode(physDev->hdc)==OPAQUE) val.fill_style = FillOpaqueStippled;
if (GetBkMode(physDev->dev.hdc)==OPAQUE) val.fill_style = FillOpaqueStippled;
val.stipple = physDev->brush.pixmap;
mask = GCStipple;
break;
......@@ -290,10 +290,10 @@ BOOL X11DRV_SetupGCForPatBlt( X11DRV_PDEVICE *physDev, GC gc, BOOL fMapColors )
mask = 0;
break;
}
GetBrushOrgEx( physDev->hdc, &pt );
GetBrushOrgEx( physDev->dev.hdc, &pt );
val.ts_x_origin = physDev->dc_rect.left + pt.x;
val.ts_y_origin = physDev->dc_rect.top + pt.y;
val.fill_rule = (GetPolyFillMode(physDev->hdc) == WINDING) ? WindingRule : EvenOddRule;
val.fill_rule = (GetPolyFillMode(physDev->dev.hdc) == WINDING) ? WindingRule : EvenOddRule;
wine_tsx11_lock();
XChangeGC( gdi_display, gc,
GCFunction | GCForeground | GCBackground | GCFillStyle |
......@@ -326,7 +326,7 @@ BOOL X11DRV_SetupGCForBrush( X11DRV_PDEVICE *physDev )
static BOOL X11DRV_SetupGCForPen( X11DRV_PDEVICE *physDev )
{
XGCValues val;
UINT rop2 = GetROP2(physDev->hdc);
UINT rop2 = GetROP2(physDev->dev.hdc);
if (physDev->pen.style == PS_NULL) return FALSE;
......@@ -386,7 +386,7 @@ static BOOL X11DRV_SetupGCForPen( X11DRV_PDEVICE *physDev )
}
if (physDev->pen.dash_len)
val.line_style = ((GetBkMode(physDev->hdc) == OPAQUE) && (!physDev->pen.ext))
val.line_style = ((GetBkMode(physDev->dev.hdc) == OPAQUE) && (!physDev->pen.ext))
? LineDoubleDash : LineOnOffDash;
else
val.line_style = LineSolid;
......@@ -446,7 +446,7 @@ INT X11DRV_XWStoDS( X11DRV_PDEVICE *physDev, INT width )
pt[0].y = 0;
pt[1].x = width;
pt[1].y = 0;
LPtoDP( physDev->hdc, pt, 2 );
LPtoDP( physDev->dev.hdc, pt, 2 );
return pt[1].x - pt[0].x;
}
......@@ -463,7 +463,7 @@ INT X11DRV_YWStoDS( X11DRV_PDEVICE *physDev, INT height )
pt[0].y = 0;
pt[1].x = 0;
pt[1].y = height;
LPtoDP( physDev->hdc, pt, 2 );
LPtoDP( physDev->dev.hdc, pt, 2 );
return pt[1].y - pt[0].y;
}
......@@ -479,10 +479,10 @@ BOOL CDECL X11DRV_LineTo( PHYSDEV dev, INT x, INT y )
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod);
GetCurrentPositionEx( physDev->hdc, &pt[0] );
GetCurrentPositionEx( dev->hdc, &pt[0] );
pt[1].x = x;
pt[1].y = y;
LPtoDP( physDev->hdc, pt, 2 );
LPtoDP( dev->hdc, pt, 2 );
wine_tsx11_lock();
XDrawLine(gdi_display, physDev->drawable, physDev->gc,
......@@ -515,19 +515,19 @@ static BOOL X11DRV_DrawArc( PHYSDEV dev, INT left, INT top, INT right, INT botto
XPoint points[4];
BOOL update = FALSE;
POINT start, end;
RECT rc = get_device_rect( physDev->hdc, left, top, right, bottom );
RECT rc = get_device_rect( dev->hdc, left, top, right, bottom );
start.x = xstart;
start.y = ystart;
end.x = xend;
end.y = yend;
LPtoDP(physDev->hdc, &start, 1);
LPtoDP(physDev->hdc, &end, 1);
LPtoDP(dev->hdc, &start, 1);
LPtoDP(dev->hdc, &end, 1);
if ((rc.left == rc.right) || (rc.top == rc.bottom)
||(lines && ((rc.right-rc.left==1)||(rc.bottom-rc.top==1)))) return TRUE;
if (GetArcDirection( physDev->hdc ) == AD_CLOCKWISE)
if (GetArcDirection( dev->hdc ) == AD_CLOCKWISE)
{ POINT tmp = start; start = end; end = tmp; }
oldwidth = width = physDev->pen.width;
......@@ -695,7 +695,7 @@ BOOL CDECL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
INT width, oldwidth;
BOOL update = FALSE;
RECT rc = get_device_rect( physDev->hdc, left, top, right, bottom );
RECT rc = get_device_rect( dev->hdc, left, top, right, bottom );
if ((rc.left == rc.right) || (rc.top == rc.bottom)) return TRUE;
......@@ -753,7 +753,7 @@ BOOL CDECL X11DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT botto
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
INT width, oldwidth, oldjoinstyle;
BOOL update = FALSE;
RECT rc = get_device_rect( physDev->hdc, left, top, right, bottom );
RECT rc = get_device_rect( dev->hdc, left, top, right, bottom );
TRACE("(%d %d %d %d)\n", left, top, right, bottom);
......@@ -822,7 +822,7 @@ BOOL CDECL X11DRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
INT width, oldwidth, oldendcap;
BOOL update = FALSE;
POINT pts[2];
RECT rc = get_device_rect( physDev->hdc, left, top, right, bottom );
RECT rc = get_device_rect( dev->hdc, left, top, right, bottom );
TRACE("(%d %d %d %d %d %d\n",
left, top, right, bottom, ell_width, ell_height);
......@@ -835,7 +835,7 @@ BOOL CDECL X11DRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
pts[0].x = pts[0].y = 0;
pts[1].x = ell_width;
pts[1].y = ell_height;
LPtoDP(physDev->hdc, pts, 2);
LPtoDP(dev->hdc, pts, 2);
ell_width = max(abs( pts[1].x - pts[0].x ), 1);
ell_height = max(abs( pts[1].y - pts[0].y ), 1);
......@@ -1025,7 +1025,7 @@ COLORREF CDECL X11DRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
pt.x = x;
pt.y = y;
LPtoDP( physDev->hdc, &pt, 1 );
LPtoDP( dev->hdc, &pt, 1 );
pixel = X11DRV_PALETTE_ToPhysical( physDev, color );
/* Update the pixmap from the DIB section */
......@@ -1056,11 +1056,11 @@ COLORREF CDECL X11DRV_GetPixel( PHYSDEV dev, INT x, INT y )
XImage * image;
int pixel;
POINT pt;
BOOL memdc = (GetObjectType(physDev->hdc) == OBJ_MEMDC);
BOOL memdc = (GetObjectType(dev->hdc) == OBJ_MEMDC);
pt.x = x;
pt.y = y;
LPtoDP( physDev->hdc, &pt, 1 );
LPtoDP( dev->hdc, &pt, 1 );
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod);
......@@ -1109,7 +1109,7 @@ BOOL CDECL X11DRV_PaintRgn( PHYSDEV dev, HRGN hrgn )
{
unsigned int i;
XRectangle *rect;
RGNDATA *data = X11DRV_GetRegionData( hrgn, physDev->hdc );
RGNDATA *data = X11DRV_GetRegionData( hrgn, dev->hdc );
if (!data) return FALSE;
rect = (XRectangle *)data->Buffer;
......@@ -1146,7 +1146,7 @@ BOOL CDECL X11DRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
for (i = 0; i < count; i++)
{
POINT tmp = pt[i];
LPtoDP(physDev->hdc, &tmp, 1);
LPtoDP(dev->hdc, &tmp, 1);
points[i].x = physDev->dc_rect.left + tmp.x;
points[i].y = physDev->dc_rect.top + tmp.y;
}
......@@ -1184,7 +1184,7 @@ BOOL CDECL X11DRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
for (i = 0; i < count; i++)
{
POINT tmp = pt[i];
LPtoDP(physDev->hdc, &tmp, 1);
LPtoDP(dev->hdc, &tmp, 1);
points[i].x = physDev->dc_rect.left + tmp.x;
points[i].y = physDev->dc_rect.top + tmp.y;
}
......@@ -1229,7 +1229,7 @@ BOOL CDECL X11DRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts,
/* FIXME: The points should be converted to device coords before */
/* creating the region. */
hrgn = CreatePolyPolygonRgn( pt, counts, polygons, GetPolyFillMode( physDev->hdc ) );
hrgn = CreatePolyPolygonRgn( pt, counts, polygons, GetPolyFillMode( dev->hdc ) );
X11DRV_PaintRgn( dev, hrgn );
DeleteObject( hrgn );
......@@ -1255,7 +1255,7 @@ BOOL CDECL X11DRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts,
for (j = 0; j < counts[i]; j++)
{
POINT tmp = *pt;
LPtoDP(physDev->hdc, &tmp, 1);
LPtoDP(dev->hdc, &tmp, 1);
points[j].x = physDev->dc_rect.left + tmp.x;
points[j].y = physDev->dc_rect.top + tmp.y;
pt++;
......@@ -1302,7 +1302,7 @@ BOOL CDECL X11DRV_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* count
for (j = 0; j < counts[i]; j++)
{
POINT tmp = *pt;
LPtoDP(physDev->hdc, &tmp, 1);
LPtoDP(dev->hdc, &tmp, 1);
points[j].x = physDev->dc_rect.left + tmp.x;
points[j].y = physDev->dc_rect.top + tmp.y;
pt++;
......@@ -1410,7 +1410,7 @@ BOOL CDECL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT
pt.x = x;
pt.y = y;
LPtoDP( physDev->hdc, &pt, 1 );
LPtoDP( dev->hdc, &pt, 1 );
if (!PtInRegion( physDev->region, pt.x, pt.y )) return FALSE;
GetRgnBox( physDev->region, &rect );
......
......@@ -129,7 +129,6 @@ BOOL CDECL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCW
if (!physDev) return FALSE;
*pdev = physDev;
physDev->hdc = hdc;
if (GetObjectType( hdc ) == OBJ_MEMDC)
{
......@@ -187,8 +186,6 @@ BOOL CDECL X11DRV_DeleteDC( PHYSDEV dev )
*/
INT CDECL X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap )
{
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
switch(cap)
{
case DRIVERVERSION:
......@@ -262,7 +259,7 @@ INT CDECL X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap )
case LOGPIXELSY:
return log_pixels_y;
case CAPS1:
FIXME("(%p): CAPS1 is unimplemented, will return 0\n", physDev->hdc );
FIXME("(%p): CAPS1 is unimplemented, will return 0\n", dev->hdc );
/* please see wingdi.h for the possible bit-flag values that need
to be returned. */
return 0;
......@@ -279,7 +276,7 @@ INT CDECL X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap )
case BLTALIGNMENT:
return 0;
default:
FIXME("(%p): unsupported capability %d, will return 0\n", physDev->hdc, cap );
FIXME("(%p): unsupported capability %d, will return 0\n", dev->hdc, cap );
return 0;
}
}
......@@ -352,7 +349,7 @@ INT CDECL X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_da
XSetSubwindowMode( gdi_display, physDev->gc, data->mode );
wine_tsx11_unlock();
TRACE( "SET_DRAWABLE hdc %p drawable %lx gl_drawable %lx pf %u dc_rect %s drawable_rect %s\n",
physDev->hdc, physDev->drawable, physDev->gl_drawable, physDev->current_pf,
dev->hdc, physDev->drawable, physDev->gl_drawable, physDev->current_pf,
wine_dbgstr_rect(&physDev->dc_rect), wine_dbgstr_rect(&physDev->drawable_rect) );
return TRUE;
}
......@@ -389,7 +386,7 @@ INT CDECL X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_da
rect.top = event.xgraphicsexpose.y - physDev->dc_rect.top;
rect.right = rect.left + event.xgraphicsexpose.width;
rect.bottom = rect.top + event.xgraphicsexpose.height;
if (GetLayout( physDev->hdc ) & LAYOUT_RTL)
if (GetLayout( dev->hdc ) & LAYOUT_RTL)
mirror_rect( &physDev->dc_rect, &rect );
TRACE( "got %s count %d\n", wine_dbgstr_rect(&rect),
......
......@@ -658,7 +658,7 @@ static BOOL describeDrawable(X11DRV_PDEVICE *physDev) {
fmt = ConvertPixelFormatWGLtoGLX(gdi_display, physDev->current_pf, TRUE /* Offscreen */, &fmt_count);
if(!fmt) return FALSE;
TRACE(" HDC %p has:\n", physDev->hdc);
TRACE(" HDC %p has:\n", physDev->dev.hdc);
TRACE(" - iPixelFormat %d\n", fmt->iPixelFormat);
TRACE(" - Drawable %p\n", (void*) get_glxdrawable(physDev));
TRACE(" - FBCONFIG_ID 0x%x\n", fmt->fmt_id);
......@@ -1648,7 +1648,7 @@ static BOOL internal_SetPixelFormat(X11DRV_PDEVICE *physDev,
pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_DRAWABLE_TYPE, &value);
wine_tsx11_unlock();
hwnd = WindowFromDC(physDev->hdc);
hwnd = WindowFromDC(physDev->dev.hdc);
if(hwnd) {
if(!(value&GLX_WINDOW_BIT)) {
WARN("Pixel format %d is not compatible for window rendering\n", iPixelFormat);
......@@ -1749,7 +1749,7 @@ HGLRC CDECL X11DRV_wglCreateContext(PHYSDEV dev)
WineGLPixelFormat *fmt;
int hdcPF = physDev->current_pf;
int fmt_count = 0;
HDC hdc = physDev->hdc;
HDC hdc = dev->hdc;
TRACE("(%p)->(PF:%d)\n", hdc, hdcPF);
......@@ -1886,7 +1886,7 @@ BOOL CDECL X11DRV_wglMakeCurrent(PHYSDEV dev, HGLRC hglrc)
{
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
BOOL ret;
HDC hdc = physDev->hdc;
HDC hdc = dev->hdc;
DWORD type = GetObjectType(hdc);
Wine_GLContext *ctx = (Wine_GLContext *) hglrc;
......@@ -2004,8 +2004,8 @@ BOOL CDECL X11DRV_wglMakeContextCurrentARB( PHYSDEV draw_dev, PHYSDEV read_dev,
ctx->has_been_current = TRUE;
ctx->tid = GetCurrentThreadId();
ctx->hdc = pDrawDev->hdc;
ctx->read_hdc = pReadDev->hdc;
ctx->hdc = draw_dev->hdc;
ctx->read_hdc = read_dev->hdc;
ctx->drawables[0] = d_draw;
ctx->drawables[1] = d_read;
ctx->refresh_drawables = FALSE;
......@@ -2199,12 +2199,12 @@ BOOL CDECL X11DRV_wglUseFontBitmapsA(PHYSDEV dev, DWORD first, DWORD count, DWOR
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
Font fid = physDev->font;
TRACE("(%p, %d, %d, %d) using font %ld\n", physDev->hdc, first, count, listBase, fid);
TRACE("(%p, %d, %d, %d) using font %ld\n", dev->hdc, first, count, listBase, fid);
if (!has_opengl()) return FALSE;
if (fid == 0) {
return internal_wglUseFontBitmaps(physDev->hdc, first, count, listBase, GetGlyphOutlineA);
return internal_wglUseFontBitmaps(dev->hdc, first, count, listBase, GetGlyphOutlineA);
}
wine_tsx11_lock();
......@@ -2224,12 +2224,12 @@ BOOL CDECL X11DRV_wglUseFontBitmapsW(PHYSDEV dev, DWORD first, DWORD count, DWOR
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
Font fid = physDev->font;
TRACE("(%p, %d, %d, %d) using font %ld\n", physDev->hdc, first, count, listBase, fid);
TRACE("(%p, %d, %d, %d) using font %ld\n", dev->hdc, first, count, listBase, fid);
if (!has_opengl()) return FALSE;
if (fid == 0) {
return internal_wglUseFontBitmaps(physDev->hdc, first, count, listBase, GetGlyphOutlineW);
return internal_wglUseFontBitmaps(dev->hdc, first, count, listBase, GetGlyphOutlineW);
}
WARN("Using the glX API for the WCHAR variant - some characters may come out incorrectly !\n");
......@@ -2358,7 +2358,7 @@ HGLRC CDECL X11DRV_wglCreateContextAttribsARB(PHYSDEV dev, HGLRC hShareContext,
wine_tsx11_lock();
ret = alloc_context();
wine_tsx11_unlock();
ret->hdc = physDev->hdc;
ret->hdc = dev->hdc;
ret->fmt = fmt;
ret->vis = NULL; /* glXCreateContextAttribsARB requires a fbconfig instead of a visual */
ret->gl3_context = TRUE;
......@@ -2701,8 +2701,8 @@ HDC CDECL X11DRV_wglGetPbufferDCARB(PHYSDEV dev, HPBUFFERARB hPbuffer)
SetRect( &physDev->drawable_rect, 0, 0, object->width, object->height );
physDev->dc_rect = physDev->drawable_rect;
TRACE("(%p)->(%p)\n", hPbuffer, physDev->hdc);
return physDev->hdc;
TRACE("(%p)->(%p)\n", hPbuffer, dev->hdc);
return dev->hdc;
}
/**
......
......@@ -880,7 +880,7 @@ static inline BOOL colour_is_brighter(RGBQUAD c1, RGBQUAD c2)
*/
COLORREF X11DRV_PALETTE_GetColor( X11DRV_PDEVICE *physDev, COLORREF color )
{
HPALETTE hPal = GetCurrentObject(physDev->hdc, OBJ_PAL );
HPALETTE hPal = GetCurrentObject(physDev->dev.hdc, OBJ_PAL );
unsigned char spec_type = color >> 24;
unsigned idx = color & 0xffff;
PALETTEENTRY entry;
......@@ -901,7 +901,7 @@ COLORREF X11DRV_PALETTE_GetColor( X11DRV_PDEVICE *physDev, COLORREF color )
return RGB( entry.peRed, entry.peGreen, entry.peBlue );
case 0x10: /* DIBINDEX */
if( GetDIBColorTable( physDev->hdc, idx, 1, &quad ) != 1 ) {
if( GetDIBColorTable( physDev->dev.hdc, idx, 1, &quad ) != 1 ) {
WARN("DIBINDEX(%x) : idx %d is out of bounds, assuming black\n", color , idx);
return 0;
}
......@@ -924,7 +924,7 @@ COLORREF X11DRV_PALETTE_GetColor( X11DRV_PDEVICE *physDev, COLORREF color )
int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
{
WORD index = 0;
HPALETTE hPal = GetCurrentObject(physDev->hdc, OBJ_PAL );
HPALETTE hPal = GetCurrentObject(physDev->dev.hdc, OBJ_PAL );
unsigned char spec_type = color >> 24;
int *mapping = palette_get_mapping( hPal );
PALETTEENTRY entry;
......@@ -968,7 +968,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
int white = 1;
RGBQUAD table[2];
if (GetDIBColorTable( physDev->hdc, 0, 2, table ) == 2)
if (GetDIBColorTable( physDev->dev.hdc, 0, 2, table ) == 2)
{
if(!colour_is_brighter(table[1], table[0])) white = 0;
}
......@@ -1024,7 +1024,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
int white = 1;
RGBQUAD table[2];
if (GetDIBColorTable( physDev->hdc, 0, 2, table ) == 2)
if (GetDIBColorTable( physDev->dev.hdc, 0, 2, table ) == 2)
{
if(!colour_is_brighter(table[1], table[0]))
white = 0;
......@@ -1377,7 +1377,6 @@ UINT CDECL X11DRV_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count,
*/
COLORREF CDECL X11DRV_GetNearestColor( PHYSDEV dev, COLORREF color )
{
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
unsigned char spec_type = color >> 24;
COLORREF nearest;
......@@ -1389,7 +1388,7 @@ COLORREF CDECL X11DRV_GetNearestColor( PHYSDEV dev, COLORREF color )
UINT index;
PALETTEENTRY entry;
HPALETTE hpal = GetCurrentObject( physDev->hdc, OBJ_PAL );
HPALETTE hpal = GetCurrentObject( dev->hdc, OBJ_PAL );
if (!hpal) hpal = GetStockObject( DEFAULT_PALETTE );
......@@ -1420,10 +1419,9 @@ COLORREF CDECL X11DRV_GetNearestColor( PHYSDEV dev, COLORREF color )
*/
UINT CDECL X11DRV_RealizeDefaultPalette( PHYSDEV dev )
{
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
UINT ret = 0;
if (palette_size && GetObjectType(physDev->hdc) != OBJ_MEMDC)
if (palette_size && GetObjectType(dev->hdc) != OBJ_MEMDC)
{
/* lookup is needed to account for SetSystemPaletteUse() stuff */
int i, index, *mapping = palette_get_mapping( GetStockObject(DEFAULT_PALETTE) );
......
......@@ -80,7 +80,7 @@ HPEN CDECL X11DRV_SelectPen( PHYSDEV dev, HPEN hpen )
if (physDev->pen.width == 1) physDev->pen.width = 0; /* Faster */
if (hpen == GetStockObject( DC_PEN ))
logpen.lopnColor = GetDCPenColor( physDev->hdc );
logpen.lopnColor = GetDCPenColor( dev->hdc );
physDev->pen.pixel = X11DRV_PALETTE_ToPhysical( physDev, logpen.lopnColor );
switch(logpen.lopnStyle & PS_STYLE_MASK)
{
......@@ -131,7 +131,7 @@ COLORREF CDECL X11DRV_SetDCPenColor( PHYSDEV dev, COLORREF crColor )
{
X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
if (GetCurrentObject(physDev->hdc, OBJ_PEN) == GetStockObject( DC_PEN ))
if (GetCurrentObject(dev->hdc, OBJ_PEN) == GetStockObject( DC_PEN ))
physDev->pen.pixel = X11DRV_PALETTE_ToPhysical( physDev, crColor );
return crColor;
......
......@@ -62,7 +62,7 @@ BOOL CDECL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
rotated = TRUE;
TRACE("hdc=%p df=%04x %d,%d rc %s %s, %d flags=%d lpDx=%p\n",
physDev->hdc, (UINT16)physDev->font, x, y, wine_dbgstr_rect(lprect),
dev->hdc, (UINT16)physDev->font, x, y, wine_dbgstr_rect(lprect),
debugstr_wn (wstr, count), count, flags, lpDx);
/* Draw the rectangle */
......
......@@ -146,7 +146,6 @@ struct xrender_info;
typedef struct
{
struct gdi_physdev dev;
HDC hdc;
GC gc; /* X Window GC */
Drawable drawable;
RECT dc_rect; /* DC rectangle relative to drawable */
......
......@@ -3232,7 +3232,7 @@ HFONT CDECL X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
LOGFONTW logfont;
LOGFONT16 lf;
TRACE("hdc=%p, hfont=%p\n", physDev->hdc, hfont);
TRACE("hdc=%p, hfont=%p\n", dev->hdc, hfont);
if (!GetObjectW( hfont, sizeof(logfont), &logfont )) return HGDI_ERROR;
......@@ -3275,7 +3275,7 @@ HFONT CDECL X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
}
if (!lf.lfHeight)
lf.lfHeight = -(DEF_POINT_SIZE * GetDeviceCaps(physDev->hdc,LOGPIXELSY) + (72>>1)) / 72;
lf.lfHeight = -(DEF_POINT_SIZE * GetDeviceCaps(dev->hdc,LOGPIXELSY) + (72>>1)) / 72;
{
/* Fixup aliases before passing to RealizeFont */
......
......@@ -577,7 +577,7 @@ static Picture get_xrender_picture(X11DRV_PDEVICE *physDev)
physDev->dc_rect.left, physDev->dc_rect.top,
(XRectangle *)clip->Buffer, clip->rdh.nCount );
wine_tsx11_unlock();
TRACE("Allocing pict=%lx dc=%p drawable=%08lx\n", info->pict, physDev->hdc, physDev->drawable);
TRACE("Allocing pict=%lx dc=%p drawable=%08lx\n", info->pict, physDev->dev.hdc, physDev->drawable);
HeapFree( GetProcessHeap(), 0, clip );
}
......@@ -601,7 +601,7 @@ static Picture get_xrender_picture_source(X11DRV_PDEVICE *physDev, BOOL repeat)
wine_tsx11_unlock();
TRACE("Allocing pict_src=%lx dc=%p drawable=%08lx repeat=%u\n",
info->pict_src, physDev->hdc, physDev->drawable, pa.repeat);
info->pict_src, physDev->dev.hdc, physDev->drawable, pa.repeat);
}
return info->pict_src;
......@@ -792,14 +792,14 @@ static BOOL get_gasp_flags(X11DRV_PDEVICE *physDev, WORD *flags)
*flags = 0;
size = GetFontData(physDev->hdc, MS_GASP_TAG, 0, NULL, 0);
size = GetFontData(physDev->dev.hdc, MS_GASP_TAG, 0, NULL, 0);
if(size == GDI_ERROR)
return FALSE;
gasp = buffer = HeapAlloc(GetProcessHeap(), 0, size);
GetFontData(physDev->hdc, MS_GASP_TAG, 0, gasp, size);
GetFontData(physDev->dev.hdc, MS_GASP_TAG, 0, gasp, size);
GetTextMetricsW(physDev->hdc, &tm);
GetTextMetricsW(physDev->dev.hdc, &tm);
ppem = abs(X11DRV_YWStoDS(physDev, tm.tmAscent + tm.tmDescent - tm.tmInternalLeading));
gasp++;
......@@ -1062,7 +1062,7 @@ BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
lfsz.devsize.cx = X11DRV_XWStoDS( physDev, lfsz.lf.lfWidth );
lfsz.devsize.cy = X11DRV_YWStoDS( physDev, lfsz.lf.lfHeight );
GetTransform( physDev->hdc, 0x204, &lfsz.xform );
GetTransform( physDev->dev.hdc, 0x204, &lfsz.xform );
TRACE("font transform %f %f %f %f\n", lfsz.xform.eM11, lfsz.xform.eM12,
lfsz.xform.eM21, lfsz.xform.eM22);
......@@ -1202,13 +1202,13 @@ void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev)
XFlush( gdi_display );
if (info->pict)
{
TRACE("freeing pict = %lx dc = %p\n", info->pict, physDev->hdc);
TRACE("freeing pict = %lx dc = %p\n", info->pict, physDev->dev.hdc);
pXRenderFreePicture(gdi_display, info->pict);
info->pict = 0;
}
if(info->pict_src)
{
TRACE("freeing pict = %lx dc = %p\n", info->pict_src, physDev->hdc);
TRACE("freeing pict = %lx dc = %p\n", info->pict_src, physDev->dev.hdc);
pXRenderFreePicture(gdi_display, info->pict_src);
info->pict_src = 0;
}
......@@ -1261,20 +1261,20 @@ static void UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format)
break;
}
buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL, &identity);
buflen = GetGlyphOutlineW(physDev->dev.hdc, glyph, ggo_format, &gm, 0, NULL, &identity);
if(buflen == GDI_ERROR) {
if(format != AA_None) {
format = AA_None;
entry->aa_default = AA_None;
ggo_format = GGO_GLYPH_INDEX | GGO_BITMAP;
buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL, &identity);
buflen = GetGlyphOutlineW(physDev->dev.hdc, glyph, ggo_format, &gm, 0, NULL, &identity);
}
if(buflen == GDI_ERROR) {
WARN("GetGlyphOutlineW failed using default glyph\n");
buflen = GetGlyphOutlineW(physDev->hdc, 0, ggo_format, &gm, 0, NULL, &identity);
buflen = GetGlyphOutlineW(physDev->dev.hdc, 0, ggo_format, &gm, 0, NULL, &identity);
if(buflen == GDI_ERROR) {
WARN("GetGlyphOutlineW failed for default glyph trying for space\n");
buflen = GetGlyphOutlineW(physDev->hdc, 0x20, ggo_format, &gm, 0, NULL, &identity);
buflen = GetGlyphOutlineW(physDev->dev.hdc, 0x20, ggo_format, &gm, 0, NULL, &identity);
if(buflen == GDI_ERROR) {
ERR("GetGlyphOutlineW for all attempts unable to upload a glyph\n");
return;
......@@ -1356,7 +1356,7 @@ static void UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format)
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen);
GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, buflen, buf, &identity);
GetGlyphOutlineW(physDev->dev.hdc, glyph, ggo_format, &gm, buflen, buf, &identity);
formatEntry->realized[glyph] = TRUE;
TRACE("buflen = %d. Got metrics: %dx%d adv=%d,%d origin=%d,%d\n",
......
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