Allocate DC objects on the process heap, and removed WIN_DC_INFO
structure (based on a patch by Ken Coleman).
diff --git a/graphics/bitblt.c b/graphics/bitblt.c
index 05372ae..3c20565 100644
--- a/graphics/bitblt.c
+++ b/graphics/bitblt.c
@@ -4,7 +4,7 @@
* Copyright 1993, 1994 Alexandre Julliard
*/
-#include "dc.h"
+#include "gdi.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(bitblt);
@@ -67,8 +67,8 @@
{
dcSrc = DC_GetDCPtr( hdcSrc );
TRACE("hdcSrc=%04x %d,%d %d bpp->hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
- hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
- hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
+ hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->bitsPerPixel : 0,
+ hdcDst, xDst, yDst, width, height, dcDst->bitsPerPixel, rop);
if (dcDst->funcs->pBitBlt)
ret = dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
dcSrc, xSrc, ySrc, rop );
@@ -112,8 +112,8 @@
TRACE("%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
- dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
- widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
+ dcSrc ? dcSrc->bitsPerPixel : 0, hdcDst, xDst, yDst,
+ widthDst, heightDst, dcDst->bitsPerPixel, rop );
if (dcSrc) {
if (dcDst->funcs->pStretchBlt)
diff --git a/graphics/enhmetafiledrv/graphics.c b/graphics/enhmetafiledrv/graphics.c
index f7459d4..afd06f6 100644
--- a/graphics/enhmetafiledrv/graphics.c
+++ b/graphics/enhmetafiledrv/graphics.c
@@ -8,12 +8,11 @@
#include <string.h>
#include "gdi.h"
-#include "dc.h"
#include "enhmetafiledrv.h"
#include "heap.h"
#include "debugtools.h"
-DEFAULT_DEBUG_CHANNEL(enhmetafile)
+DEFAULT_DEBUG_CHANNEL(enhmetafile);
/**********************************************************************
* EMFDRV_MoveToEx
@@ -48,10 +47,10 @@
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
return FALSE;
- bounds.left = min(x, dc->w.CursPosX);
- bounds.top = min(y, dc->w.CursPosY);
- bounds.right = max(x, dc->w.CursPosX);
- bounds.bottom = max(y, dc->w.CursPosY);
+ bounds.left = min(x, dc->CursPosX);
+ bounds.top = min(y, dc->CursPosY);
+ bounds.right = max(x, dc->CursPosX);
+ bounds.bottom = max(y, dc->CursPosY);
EMFDRV_UpdateBBox( dc, &bounds );
@@ -77,7 +76,7 @@
if(left > right) {temp = left; left = right; right = temp;}
if(top > bottom) {temp = top; top = bottom; bottom = temp;}
- if(dc->w.GraphicsMode == GM_COMPATIBLE) {
+ if(dc->GraphicsMode == GM_COMPATIBLE) {
right--;
bottom--;
}
@@ -212,7 +211,7 @@
if(left > right) {temp = left; left = right; right = temp;}
if(top > bottom) {temp = top; top = bottom; bottom = temp;}
- if(dc->w.GraphicsMode == GM_COMPATIBLE) {
+ if(dc->GraphicsMode == GM_COMPATIBLE) {
right--;
bottom--;
}
@@ -244,7 +243,7 @@
if(left > right) {temp = left; left = right; right = temp;}
if(top > bottom) {temp = top; top = bottom; bottom = temp;}
- if(dc->w.GraphicsMode == GM_COMPATIBLE) {
+ if(dc->GraphicsMode == GM_COMPATIBLE) {
right--;
bottom--;
}
@@ -275,7 +274,7 @@
if(left > right) {temp = left; left = right; right = temp;}
if(top > bottom) {temp = top; top = bottom; bottom = temp;}
- if(dc->w.GraphicsMode == GM_COMPATIBLE) {
+ if(dc->GraphicsMode == GM_COMPATIBLE) {
right--;
bottom--;
}
diff --git a/graphics/enhmetafiledrv/init.c b/graphics/enhmetafiledrv/init.c
index 82c6e1b..7b9a81f 100644
--- a/graphics/enhmetafiledrv/init.c
+++ b/graphics/enhmetafiledrv/init.c
@@ -4,9 +4,11 @@
* Copyright 1999 Huw D M Davies
*/
+#include <string.h>
+
#include "windef.h"
#include "wingdi.h"
-#include "dc.h"
+#include "gdi.h"
#include "heap.h"
#include "global.h"
#include "enhmetafile.h"
@@ -14,9 +16,7 @@
#include "wine/winestring.h"
#include "debugtools.h"
-#include <string.h>
-
-DEFAULT_DEBUG_CHANNEL(enhmetafile)
+DEFAULT_DEBUG_CHANNEL(enhmetafile);
static const DC_FUNCTIONS EMFDRV_Funcs =
{
diff --git a/graphics/enhmetafiledrv/objects.c b/graphics/enhmetafiledrv/objects.c
index cbfb59d..af61254 100644
--- a/graphics/enhmetafiledrv/objects.c
+++ b/graphics/enhmetafiledrv/objects.c
@@ -129,8 +129,8 @@
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
return FALSE;
- hOldBrush = dc->w.hBrush;
- dc->w.hBrush = hBrush;
+ hOldBrush = dc->hBrush;
+ dc->hBrush = hBrush;
return hOldBrush;
}
@@ -210,8 +210,8 @@
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
return FALSE;
- hOldFont = dc->w.hFont;
- dc->w.hFont = hFont;
+ hOldFont = dc->hFont;
+ dc->hFont = hFont;
return hOldFont;
}
@@ -271,8 +271,8 @@
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
return FALSE;
- hOldPen = dc->w.hPen;
- dc->w.hPen = hPen;
+ hOldPen = dc->hPen;
+ dc->hPen = hPen;
return hOldPen;
}
diff --git a/graphics/escape.c b/graphics/escape.c
index d4dd462..cc1b315 100644
--- a/graphics/escape.c
+++ b/graphics/escape.c
@@ -10,7 +10,6 @@
#include "gdi.h"
#include "heap.h"
#include "ldt.h"
-#include "dc.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(driver);
diff --git a/graphics/mapping.c b/graphics/mapping.c
index a23ca2f..e94ea7c 100644
--- a/graphics/mapping.c
+++ b/graphics/mapping.c
@@ -4,10 +4,10 @@
* Copyright 1993 Alexandre Julliard
*/
-#include "dc.h"
+#include "gdi.h"
#include "debugtools.h"
-DEFAULT_DEBUG_CHANNEL(gdi)
+DEFAULT_DEBUG_CHANNEL(gdi);
/***********************************************************************
@@ -17,10 +17,10 @@
*/
void MAPPING_FixIsotropic( DC * dc )
{
- double xdim = (double)dc->vportExtX * dc->w.devCaps->horzSize /
- (dc->w.devCaps->horzRes * dc->wndExtX);
- double ydim = (double)dc->vportExtY * dc->w.devCaps->vertSize /
- (dc->w.devCaps->vertRes * dc->wndExtY);
+ double xdim = (double)dc->vportExtX * dc->devCaps->horzSize /
+ (dc->devCaps->horzRes * dc->wndExtX);
+ double ydim = (double)dc->vportExtY * dc->devCaps->vertSize /
+ (dc->devCaps->vertRes * dc->wndExtY);
if (xdim > ydim)
{
dc->vportExtX = dc->vportExtX * fabs( ydim / xdim );
@@ -134,7 +134,7 @@
TRACE("%04x %d\n", hdc, mode );
- prevMode = dc->w.MapMode;
+ prevMode = dc->MapMode;
switch(mode)
{
case MM_TEXT:
@@ -146,38 +146,38 @@
case MM_LOMETRIC:
case MM_ISOTROPIC:
- dc->wndExtX = dc->w.devCaps->horzSize;
- dc->wndExtY = dc->w.devCaps->vertSize;
- dc->vportExtX = dc->w.devCaps->horzRes / 10;
- dc->vportExtY = dc->w.devCaps->vertRes / -10;
+ dc->wndExtX = dc->devCaps->horzSize;
+ dc->wndExtY = dc->devCaps->vertSize;
+ dc->vportExtX = dc->devCaps->horzRes / 10;
+ dc->vportExtY = dc->devCaps->vertRes / -10;
break;
case MM_HIMETRIC:
- dc->wndExtX = dc->w.devCaps->horzSize * 10;
- dc->wndExtY = dc->w.devCaps->vertSize * 10;
- dc->vportExtX = dc->w.devCaps->horzRes / 10;
- dc->vportExtY = dc->w.devCaps->vertRes / -10;
+ dc->wndExtX = dc->devCaps->horzSize * 10;
+ dc->wndExtY = dc->devCaps->vertSize * 10;
+ dc->vportExtX = dc->devCaps->horzRes / 10;
+ dc->vportExtY = dc->devCaps->vertRes / -10;
break;
case MM_LOENGLISH:
- dc->wndExtX = dc->w.devCaps->horzSize;
- dc->wndExtY = dc->w.devCaps->vertSize;
- dc->vportExtX = 254L * dc->w.devCaps->horzRes / 1000;
- dc->vportExtY = -254L * dc->w.devCaps->vertRes / 1000;
+ dc->wndExtX = dc->devCaps->horzSize;
+ dc->wndExtY = dc->devCaps->vertSize;
+ dc->vportExtX = 254L * dc->devCaps->horzRes / 1000;
+ dc->vportExtY = -254L * dc->devCaps->vertRes / 1000;
break;
case MM_HIENGLISH:
- dc->wndExtX = dc->w.devCaps->horzSize * 10;
- dc->wndExtY = dc->w.devCaps->vertSize * 10;
- dc->vportExtX = 254L * dc->w.devCaps->horzRes / 1000;
- dc->vportExtY = -254L * dc->w.devCaps->vertRes / 1000;
+ dc->wndExtX = dc->devCaps->horzSize * 10;
+ dc->wndExtY = dc->devCaps->vertSize * 10;
+ dc->vportExtX = 254L * dc->devCaps->horzRes / 1000;
+ dc->vportExtY = -254L * dc->devCaps->vertRes / 1000;
break;
case MM_TWIPS:
- dc->wndExtX = 144L * dc->w.devCaps->horzSize / 10;
- dc->wndExtY = 144L * dc->w.devCaps->vertSize / 10;
- dc->vportExtX = 254L * dc->w.devCaps->horzRes / 1000;
- dc->vportExtY = -254L * dc->w.devCaps->vertRes / 1000;
+ dc->wndExtX = 144L * dc->devCaps->horzSize / 10;
+ dc->wndExtY = 144L * dc->devCaps->vertSize / 10;
+ dc->vportExtX = 254L * dc->devCaps->horzRes / 1000;
+ dc->vportExtY = -254L * dc->devCaps->vertRes / 1000;
break;
case MM_ANISOTROPIC:
@@ -186,7 +186,7 @@
default:
goto done;
}
- dc->w.MapMode = mode;
+ dc->MapMode = mode;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
@@ -235,7 +235,7 @@
size->cx = dc->vportExtX;
size->cy = dc->vportExtY;
}
- if ((dc->w.MapMode != MM_ISOTROPIC) && (dc->w.MapMode != MM_ANISOTROPIC))
+ if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
goto done;
if (!x || !y)
{
@@ -244,7 +244,7 @@
}
dc->vportExtX = x;
dc->vportExtY = y;
- if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
+ if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
@@ -342,7 +342,7 @@
size->cx = dc->wndExtX;
size->cy = dc->wndExtY;
}
- if ((dc->w.MapMode != MM_ISOTROPIC) && (dc->w.MapMode != MM_ANISOTROPIC))
+ if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
goto done;
if (!x || !y)
{
@@ -351,7 +351,7 @@
}
dc->wndExtX = x;
dc->wndExtY = y;
- if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
+ if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
@@ -551,7 +551,7 @@
size->cx = dc->vportExtX;
size->cy = dc->vportExtY;
}
- if ((dc->w.MapMode != MM_ISOTROPIC) && (dc->w.MapMode != MM_ANISOTROPIC))
+ if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
goto done;
if (!xNum || !xDenom || !xNum || !yDenom)
{
@@ -562,7 +562,7 @@
dc->vportExtY = (dc->vportExtY * yNum) / yDenom;
if (dc->vportExtX == 0) dc->vportExtX = 1;
if (dc->vportExtY == 0) dc->vportExtY = 1;
- if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
+ if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
@@ -616,7 +616,7 @@
size->cx = dc->wndExtX;
size->cy = dc->wndExtY;
}
- if ((dc->w.MapMode != MM_ISOTROPIC) && (dc->w.MapMode != MM_ANISOTROPIC))
+ if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
goto done;
if (!xNum || !xDenom || !xNum || !yDenom)
{
@@ -627,7 +627,7 @@
dc->wndExtY = (dc->wndExtY * yNum) / yDenom;
if (dc->wndExtX == 0) dc->wndExtX = 1;
if (dc->wndExtY == 0) dc->wndExtY = 1;
- if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
+ if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
diff --git a/graphics/metafiledrv/bitblt.c b/graphics/metafiledrv/bitblt.c
index 21f30e9..844cda7 100644
--- a/graphics/metafiledrv/bitblt.c
+++ b/graphics/metafiledrv/bitblt.c
@@ -37,7 +37,7 @@
METARECORD *mr;
BITMAP16 BM;
- GetObject16(dcSrc->w.hBitmap, sizeof(BITMAP16), &BM);
+ GetObject16(dcSrc->hBitmap, sizeof(BITMAP16), &BM);
len = sizeof(METARECORD) + 12 * sizeof(INT16) + BM.bmWidthBytes * BM.bmHeight;
if (!(mr = HeapAlloc(GetProcessHeap(), 0, len)))
return FALSE;
@@ -48,7 +48,7 @@
*(mr->rdParm +10) = BM.bmPlanes;
*(mr->rdParm +11) = BM.bmBitsPixel;
TRACE("len = %ld rop=%lx \n",len,rop);
- if (GetBitmapBits(dcSrc->w.hBitmap,BM.bmWidthBytes * BM.bmHeight,
+ if (GetBitmapBits(dcSrc->hBitmap,BM.bmWidthBytes * BM.bmHeight,
mr->rdParm +12))
{
mr->rdSize = len / sizeof(INT16);
@@ -90,7 +90,7 @@
LPBITMAPINFOHEADER lpBMI;
WORD nBPP;
#endif
- GetObject16(dcSrc->w.hBitmap, sizeof(BITMAP16), &BM);
+ GetObject16(dcSrc->hBitmap, sizeof(BITMAP16), &BM);
#ifdef STRETCH_VIA_DIB
nBPP = BM.bmPlanes * BM.bmBitsPixel;
len = sizeof(METARECORD) + 10 * sizeof(INT16)
@@ -129,7 +129,7 @@
*(mr->rdParm +13) = BM.bmPlanes;
*(mr->rdParm +14) = BM.bmBitsPixel;
TRACE("len = %ld rop=%lx \n",len,rop);
- if (GetBitmapBits( dcSrc->w.hBitmap, BM.bmWidthBytes * BM.bmHeight,
+ if (GetBitmapBits( dcSrc->hBitmap, BM.bmWidthBytes * BM.bmHeight,
mr->rdParm +15))
#endif
{
diff --git a/graphics/metafiledrv/graphics.c b/graphics/metafiledrv/graphics.c
index 98e6879..79c911a 100644
--- a/graphics/metafiledrv/graphics.c
+++ b/graphics/metafiledrv/graphics.c
@@ -8,13 +8,12 @@
#include <string.h>
#include "gdi.h"
-#include "dc.h"
#include "region.h"
#include "metafiledrv.h"
#include "heap.h"
#include "debugtools.h"
-DEFAULT_DEBUG_CHANNEL(metafile)
+DEFAULT_DEBUG_CHANNEL(metafile);
/**********************************************************************
* MFDRV_MoveToEx
diff --git a/graphics/metafiledrv/init.c b/graphics/metafiledrv/init.c
index d155304..6f5c270 100644
--- a/graphics/metafiledrv/init.c
+++ b/graphics/metafiledrv/init.c
@@ -6,14 +6,14 @@
#include "windef.h"
#include "wine/winbase16.h"
-#include "dc.h"
+#include "gdi.h"
#include "heap.h"
#include "global.h"
#include "metafile.h"
#include "metafiledrv.h"
#include "debugtools.h"
-DEFAULT_DEBUG_CHANNEL(metafile)
+DEFAULT_DEBUG_CHANNEL(metafile);
#include <string.h>
diff --git a/graphics/metafiledrv/mapping.c b/graphics/metafiledrv/mapping.c
index 497ca26..4d89005 100644
--- a/graphics/metafiledrv/mapping.c
+++ b/graphics/metafiledrv/mapping.c
@@ -13,7 +13,7 @@
*/
INT MFDRV_SetMapMode( DC *dc, INT mode )
{
- INT prevMode = dc->w.MapMode;
+ INT prevMode = dc->MapMode;
MFDRV_MetaParam1( dc, META_SETMAPMODE, mode );
return prevMode;
}
diff --git a/graphics/metafiledrv/objects.c b/graphics/metafiledrv/objects.c
index 699eb70..b7158ec 100644
--- a/graphics/metafiledrv/objects.c
+++ b/graphics/metafiledrv/objects.c
@@ -184,7 +184,7 @@
static HFONT16 MFDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
FONTOBJ * font )
{
- HFONT16 prevHandle = dc->w.hFont;
+ HFONT16 prevHandle = dc->hFont;
if (MFDRV_CreateFontIndirect(dc, hfont, &(font->logfont)))
return prevHandle;
return 0;
@@ -219,7 +219,7 @@
static HPEN MFDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
{
LOGPEN16 logpen;
- HPEN prevHandle = dc->w.hPen;
+ HPEN prevHandle = dc->hPen;
logpen.lopnStyle = pen->logpen.lopnStyle;
logpen.lopnWidth.x = pen->logpen.lopnWidth.x;
diff --git a/graphics/painting.c b/graphics/painting.c
index 8b853ef..7b74c56 100644
--- a/graphics/painting.c
+++ b/graphics/painting.c
@@ -9,15 +9,15 @@
#include <string.h>
#include <stdlib.h>
-#include "dc.h"
+#include "windef.h"
+#include "wingdi.h"
+#include "winerror.h"
+#include "gdi.h"
#include "bitmap.h"
#include "heap.h"
#include "region.h"
#include "path.h"
#include "debugtools.h"
-#include "winerror.h"
-#include "windef.h"
-#include "wingdi.h"
DEFAULT_DEBUG_CHANNEL(gdi);
@@ -41,13 +41,13 @@
if(!dc) return FALSE;
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_LineTo(dc, x, y);
else
ret = dc->funcs->pLineTo && dc->funcs->pLineTo(dc,x,y);
if(ret) {
- dc->w.CursPosX = x;
- dc->w.CursPosY = y;
+ dc->CursPosX = x;
+ dc->CursPosY = y;
}
GDI_ReleaseObj( hdc );
return ret;
@@ -92,13 +92,13 @@
if(!dc) return FALSE;
if(pt) {
- pt->x = dc->w.CursPosX;
- pt->y = dc->w.CursPosY;
+ pt->x = dc->CursPosX;
+ pt->y = dc->CursPosY;
}
- dc->w.CursPosX = x;
- dc->w.CursPosY = y;
+ dc->CursPosX = x;
+ dc->CursPosY = y;
- if(PATH_IsPathOpen(dc->w.path)) ret = PATH_MoveTo(dc);
+ if(PATH_IsPathOpen(dc->path)) ret = PATH_MoveTo(dc);
else if (dc->funcs->pMoveToEx) ret = dc->funcs->pMoveToEx(dc,x,y,pt);
GDI_ReleaseObj( hdc );
return ret;
@@ -129,7 +129,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (dc)
{
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_Arc(dc, left, top, right, bottom, xstart, ystart, xend, yend,0);
else if (dc->funcs->pArc)
ret = dc->funcs->pArc(dc,left,top,right,bottom,xstart,ystart,xend,yend);
@@ -201,7 +201,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (!dc) return FALSE;
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_Arc(dc,left,top,right,bottom,xstart,ystart,xend,yend,2);
else if(dc->funcs->pPie)
ret = dc->funcs->pPie(dc,left,top,right,bottom,xstart,ystart,xend,yend);
@@ -233,7 +233,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (!dc) return FALSE;
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_Arc(dc,left,top,right,bottom,xstart,ystart,xend,yend,1);
else if(dc->funcs->pChord)
ret = dc->funcs->pChord(dc,left,top,right,bottom,xstart,ystart,xend,yend);
@@ -263,7 +263,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (!dc) return FALSE;
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_Ellipse(dc,left,top,right,bottom);
else if (dc->funcs->pEllipse)
ret = dc->funcs->pEllipse(dc,left,top,right,bottom);
@@ -293,7 +293,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (dc)
{
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_Rectangle(dc, left, top, right, bottom);
else if (dc->funcs->pRectangle)
ret = dc->funcs->pRectangle(dc,left,top,right,bottom);
@@ -324,7 +324,7 @@
if (dc)
{
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_RoundRect(dc,left,top,right,bottom,ell_width,ell_height);
else if (dc->funcs->pRoundRect)
ret = dc->funcs->pRoundRect(dc,left,top,right,bottom,ell_width,ell_height);
@@ -717,7 +717,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (dc)
{
- if (PATH_IsPathOpen(dc->w.path)) ret = PATH_Polyline(dc, pt, count);
+ if (PATH_IsPathOpen(dc->path)) ret = PATH_Polyline(dc, pt, count);
else if (dc->funcs->pPolyline) ret = dc->funcs->pPolyline(dc,pt,count);
GDI_ReleaseObj( hdc );
}
@@ -734,7 +734,7 @@
if(!dc) return FALSE;
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_PolylineTo(dc, pt, cCount);
else if(dc->funcs->pPolylineTo)
@@ -745,16 +745,16 @@
sizeof(POINT) * (cCount + 1) );
if (pts)
{
- pts[0].x = dc->w.CursPosX;
- pts[0].y = dc->w.CursPosY;
+ pts[0].x = dc->CursPosX;
+ pts[0].y = dc->CursPosY;
memcpy( pts + 1, pt, sizeof(POINT) * cCount );
ret = Polyline( hdc, pts, cCount + 1 );
HeapFree( GetProcessHeap(), 0, pts );
}
}
if(ret) {
- dc->w.CursPosX = pt[cCount-1].x;
- dc->w.CursPosY = pt[cCount-1].y;
+ dc->CursPosX = pt[cCount-1].x;
+ dc->CursPosY = pt[cCount-1].y;
}
GDI_ReleaseObj( hdc );
return ret;
@@ -787,7 +787,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (dc)
{
- if (PATH_IsPathOpen(dc->w.path)) ret = PATH_Polygon(dc, pt, count);
+ if (PATH_IsPathOpen(dc->path)) ret = PATH_Polygon(dc, pt, count);
else if (dc->funcs->pPolygon) ret = dc->funcs->pPolygon(dc,pt,count);
GDI_ReleaseObj( hdc );
}
@@ -836,7 +836,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (dc)
{
- if (PATH_IsPathOpen(dc->w.path)) ret = PATH_PolyPolygon(dc, pt, counts, polygons);
+ if (PATH_IsPathOpen(dc->path)) ret = PATH_PolyPolygon(dc, pt, counts, polygons);
else if (dc->funcs->pPolyPolygon) ret = dc->funcs->pPolyPolygon(dc,pt,counts,polygons);
GDI_ReleaseObj( hdc );
}
@@ -853,7 +853,7 @@
DC * dc = DC_GetDCUpdate( hdc );
if (dc)
{
- if (PATH_IsPathOpen(dc->w.path)) ret = PATH_PolyPolyline(dc, pt, counts, polylines);
+ if (PATH_IsPathOpen(dc->path)) ret = PATH_PolyPolyline(dc, pt, counts, polylines);
else if (dc->funcs->pPolyPolyline) ret = dc->funcs->pPolyPolyline(dc,pt,counts,polylines);
GDI_ReleaseObj( hdc );
}
@@ -955,7 +955,7 @@
if(!dc) return FALSE;
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_PolyBezier(dc, lppt, cPoints);
else if (dc->funcs->pPolyBezier)
ret = dc->funcs->pPolyBezier(dc, lppt, cPoints);
@@ -994,7 +994,7 @@
if(!dc) return FALSE;
- if(PATH_IsPathOpen(dc->w.path))
+ if(PATH_IsPathOpen(dc->path))
ret = PATH_PolyBezierTo(dc, lppt, cPoints);
else if(dc->funcs->pPolyBezierTo)
ret = dc->funcs->pPolyBezierTo(dc, lppt, cPoints);
@@ -1002,15 +1002,15 @@
POINT *pt;
pt = HeapAlloc( GetProcessHeap(), 0, sizeof(POINT) * (cPoints + 1) );
if(!pt) return FALSE;
- pt[0].x = dc->w.CursPosX;
- pt[0].y = dc->w.CursPosY;
+ pt[0].x = dc->CursPosX;
+ pt[0].y = dc->CursPosY;
memcpy(pt + 1, lppt, sizeof(POINT) * cPoints);
ret = PolyBezier(dc->hSelf, pt, cPoints+1);
HeapFree( GetProcessHeap(), 0, pt );
}
if(ret) {
- dc->w.CursPosX = lppt[cPoints-1].x;
- dc->w.CursPosY = lppt[cPoints-1].y;
+ dc->CursPosX = lppt[cPoints-1].x;
+ dc->CursPosY = lppt[cPoints-1].y;
}
GDI_ReleaseObj( hdc );
return ret;
@@ -1096,8 +1096,8 @@
}
/* if no moveto occurs, we will close the figure here */
- lastmove.x = dc->w.CursPosX;
- lastmove.y = dc->w.CursPosY;
+ lastmove.x = dc->CursPosX;
+ lastmove.y = dc->CursPosY;
/* now let's draw */
for( i = 0; i < cCount; i++ )
@@ -1105,8 +1105,8 @@
if( lpbTypes[i] == PT_MOVETO )
{
MoveToEx( hdc, lppt[i].x, lppt[i].y, NULL );
- lastmove.x = dc->w.CursPosX;
- lastmove.y = dc->w.CursPosY;
+ lastmove.x = dc->CursPosX;
+ lastmove.y = dc->CursPosY;
}
else if( lpbTypes[i] & PT_LINETO )
LineTo( hdc, lppt[i].x, lppt[i].y );
@@ -1120,7 +1120,7 @@
if( lpbTypes[i] & PT_CLOSEFIGURE )
{
- if( PATH_IsPathOpen( dc->w.path ) )
+ if( PATH_IsPathOpen( dc->path ) )
CloseFigure( hdc );
else
LineTo( hdc, lastmove.x, lastmove.y );
diff --git a/graphics/path.c b/graphics/path.c
index 51b0f3b..69f4b26 100644
--- a/graphics/path.c
+++ b/graphics/path.c
@@ -17,11 +17,11 @@
#include "wingdi.h"
#include "winerror.h"
-#include "dc.h"
+#include "gdi.h"
#include "debugtools.h"
#include "path.h"
-DEFAULT_DEBUG_CHANNEL(gdi)
+DEFAULT_DEBUG_CHANNEL(gdi);
/* Notes on the implementation
*
@@ -104,14 +104,14 @@
else
{
/* If path is already open, do nothing */
- if(dc->w.path.state != PATH_Open)
+ if(dc->path.state != PATH_Open)
{
/* Make sure that path is empty */
- PATH_EmptyPath(&dc->w.path);
+ PATH_EmptyPath(&dc->path);
/* Initialize variables for new path */
- dc->w.path.newStroke=TRUE;
- dc->w.path.state=PATH_Open;
+ dc->path.newStroke=TRUE;
+ dc->path.state=PATH_Open;
}
}
GDI_ReleaseObj( hdc );
@@ -143,13 +143,13 @@
else
{
/* Check that path is currently being constructed */
- if(dc->w.path.state!=PATH_Open)
+ if(dc->path.state!=PATH_Open)
{
SetLastError(ERROR_CAN_NOT_COMPLETE);
ret = FALSE;
}
/* Set flag to indicate that path is finished */
- else dc->w.path.state=PATH_Closed;
+ else dc->path.state=PATH_Closed;
}
GDI_ReleaseObj( hdc );
return ret;
@@ -187,7 +187,7 @@
if(dc->funcs->pAbortPath)
ret = dc->funcs->pAbortPath(dc);
else /* Remove all entries from the path */
- PATH_EmptyPath( &dc->w.path );
+ PATH_EmptyPath( &dc->path );
GDI_ReleaseObj( hdc );
return ret;
}
@@ -219,7 +219,7 @@
else
{
/* Check that path is open */
- if(dc->w.path.state!=PATH_Open)
+ if(dc->path.state!=PATH_Open)
{
SetLastError(ERROR_CAN_NOT_COMPLETE);
ret = FALSE;
@@ -229,10 +229,10 @@
/* FIXME: Shouldn't we draw a line to the beginning of the
figure? */
/* Set PT_CLOSEFIGURE on the last entry and start a new stroke */
- if(dc->w.path.numEntriesUsed)
+ if(dc->path.numEntriesUsed)
{
- dc->w.path.pFlags[dc->w.path.numEntriesUsed-1]|=PT_CLOSEFIGURE;
- dc->w.path.newStroke=TRUE;
+ dc->path.pFlags[dc->path.numEntriesUsed-1]|=PT_CLOSEFIGURE;
+ dc->path.newStroke=TRUE;
}
}
}
@@ -265,7 +265,7 @@
if(!dc) return -1;
- pPath = &dc->w.path;
+ pPath = &dc->path;
/* Check that path is closed */
if(pPath->state!=PATH_Closed)
@@ -326,7 +326,7 @@
/* Get pointer to path */
if(!dc) return -1;
- pPath = &dc->w.path;
+ pPath = &dc->path;
/* Check that path is closed */
if(pPath->state!=PATH_Closed) SetLastError(ERROR_CAN_NOT_COMPLETE);
@@ -361,7 +361,7 @@
}
/* Construct a region from the path and fill it */
- if(PATH_PathToRegion(pPath, dc->w.polyFillMode, &hrgn))
+ if(PATH_PathToRegion(pPath, dc->polyFillMode, &hrgn))
{
/* Since PaintRgn interprets the region as being in logical coordinates
* but the points we store for the path are already in device
@@ -436,12 +436,12 @@
bRet = dc->funcs->pFillPath(dc);
else
{
- bRet = PATH_FillPath(dc, &dc->w.path);
+ bRet = PATH_FillPath(dc, &dc->path);
if(bRet)
{
/* FIXME: Should the path be emptied even if conversion
failed? */
- PATH_EmptyPath(&dc->w.path);
+ PATH_EmptyPath(&dc->path);
}
}
GDI_ReleaseObj( hdc );
@@ -474,7 +474,7 @@
success = dc->funcs->pSelectClipPath(dc, iMode);
else
{
- pPath = &dc->w.path;
+ pPath = &dc->path;
/* Check that path is closed */
if(pPath->state!=PATH_Closed)
@@ -566,7 +566,7 @@
*/
BOOL PATH_MoveTo(DC *dc)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
/* Check that path is open */
if(pPath->state!=PATH_Open)
@@ -588,7 +588,7 @@
*/
BOOL PATH_LineTo(DC *dc, INT x, INT y)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT point, pointCurPos;
/* Check that path is open */
@@ -605,8 +605,8 @@
if(pPath->newStroke)
{
pPath->newStroke=FALSE;
- pointCurPos.x = dc->w.CursPosX;
- pointCurPos.y = dc->w.CursPosY;
+ pointCurPos.x = dc->CursPosX;
+ pointCurPos.y = dc->CursPosY;
if(!LPtoDP(dc->hSelf, &pointCurPos, 1))
return FALSE;
if(!PATH_AddEntry(pPath, &pointCurPos, PT_MOVETO))
@@ -628,7 +628,7 @@
*/
BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT corners[2], pointTemp;
FLOAT_POINT ellCorners[2];
@@ -685,7 +685,7 @@
*/
BOOL PATH_Rectangle(DC *dc, INT x1, INT y1, INT x2, INT y2)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT corners[2], pointTemp;
/* Check that path is open */
@@ -751,7 +751,7 @@
BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
INT xStart, INT yStart, INT xEnd, INT yEnd, INT lines)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
double angleStart, angleEnd, angleStartQuadrant, angleEndQuadrant=0.0;
/* Initialize angleEndQuadrant to silence gcc's warning */
double x, y;
@@ -807,7 +807,7 @@
angleEnd=atan2(y, x);
/* Make sure the end angle is "on the right side" of the start angle */
- if(dc->w.ArcDirection==AD_CLOCKWISE)
+ if(dc->ArcDirection==AD_CLOCKWISE)
{
if(angleEnd<=angleStart)
{
@@ -825,7 +825,7 @@
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
- if(dc->w.GraphicsMode==GM_COMPATIBLE)
+ if(dc->GraphicsMode==GM_COMPATIBLE)
{
corners[1].x--;
corners[1].y--;
@@ -841,7 +841,7 @@
if(start)
{
angleStartQuadrant=angleStart;
- if(dc->w.ArcDirection==AD_CLOCKWISE)
+ if(dc->ArcDirection==AD_CLOCKWISE)
angleEndQuadrant=(floor(angleStart/M_PI_2)+1.0)*M_PI_2;
else
angleEndQuadrant=(ceil(angleStart/M_PI_2)-1.0)*M_PI_2;
@@ -849,16 +849,16 @@
else
{
angleStartQuadrant=angleEndQuadrant;
- if(dc->w.ArcDirection==AD_CLOCKWISE)
+ if(dc->ArcDirection==AD_CLOCKWISE)
angleEndQuadrant+=M_PI_2;
else
angleEndQuadrant-=M_PI_2;
}
/* Have we reached the last part of the arc? */
- if((dc->w.ArcDirection==AD_CLOCKWISE &&
+ if((dc->ArcDirection==AD_CLOCKWISE &&
angleEnd<angleEndQuadrant) ||
- (dc->w.ArcDirection==AD_COUNTERCLOCKWISE &&
+ (dc->ArcDirection==AD_COUNTERCLOCKWISE &&
angleEnd>angleEndQuadrant))
{
/* Adjust the end angle for this quadrant */
@@ -891,7 +891,7 @@
BOOL PATH_PolyBezierTo(DC *dc, const POINT *pts, DWORD cbPoints)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@@ -903,8 +903,8 @@
if(pPath->newStroke)
{
pPath->newStroke=FALSE;
- pt.x = dc->w.CursPosX;
- pt.y = dc->w.CursPosY;
+ pt.x = dc->CursPosX;
+ pt.y = dc->CursPosY;
if(!LPtoDP(dc->hSelf, &pt, 1))
return FALSE;
if(!PATH_AddEntry(pPath, &pt, PT_MOVETO))
@@ -922,7 +922,7 @@
BOOL PATH_PolyBezier(DC *dc, const POINT *pts, DWORD cbPoints)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@@ -941,7 +941,7 @@
BOOL PATH_Polyline(DC *dc, const POINT *pts, DWORD cbPoints)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@@ -960,7 +960,7 @@
BOOL PATH_PolylineTo(DC *dc, const POINT *pts, DWORD cbPoints)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@@ -972,8 +972,8 @@
if(pPath->newStroke)
{
pPath->newStroke=FALSE;
- pt.x = dc->w.CursPosX;
- pt.y = dc->w.CursPosY;
+ pt.x = dc->CursPosX;
+ pt.y = dc->CursPosY;
if(!LPtoDP(dc->hSelf, &pt, 1))
return FALSE;
if(!PATH_AddEntry(pPath, &pt, PT_MOVETO))
@@ -993,7 +993,7 @@
BOOL PATH_Polygon(DC *dc, const POINT *pts, DWORD cbPoints)
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@@ -1015,7 +1015,7 @@
BOOL PATH_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
UINT polygons )
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT pt, startpt;
INT poly, point, i;
@@ -1040,7 +1040,7 @@
BOOL PATH_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
DWORD polylines )
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
POINT pt;
INT poly, point, i;
@@ -1094,7 +1094,7 @@
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
- if(dc->w.GraphicsMode==GM_COMPATIBLE)
+ if(dc->GraphicsMode==GM_COMPATIBLE)
{
corners[1].x--;
corners[1].y--;
@@ -1452,7 +1452,7 @@
if(dc->funcs->pFlattenPath) ret = dc->funcs->pFlattenPath(dc);
else
{
- GdiPath *pPath = &dc->w.path;
+ GdiPath *pPath = &dc->path;
if(pPath->state != PATH_Closed)
ret = PATH_FlattenPath(pPath);
}
@@ -1538,9 +1538,9 @@
bRet = dc->funcs->pStrokeAndFillPath(dc);
else
{
- bRet = PATH_FillPath(dc, &dc->w.path);
- if(bRet) bRet = PATH_StrokePath(dc, &dc->w.path);
- if(bRet) PATH_EmptyPath(&dc->w.path);
+ bRet = PATH_FillPath(dc, &dc->path);
+ if(bRet) bRet = PATH_StrokePath(dc, &dc->path);
+ if(bRet) PATH_EmptyPath(&dc->path);
}
GDI_ReleaseObj( hdc );
return bRet;
@@ -1574,7 +1574,7 @@
bRet = dc->funcs->pStrokePath(dc);
else
{
- pPath = &dc->w.path;
+ pPath = &dc->path;
bRet = PATH_StrokePath(dc, pPath);
PATH_EmptyPath(pPath);
}
diff --git a/graphics/win16drv/brush.c b/graphics/win16drv/brush.c
index 61a4fe3..c4b2154 100644
--- a/graphics/win16drv/brush.c
+++ b/graphics/win16drv/brush.c
@@ -16,10 +16,10 @@
BRUSHOBJ * brush )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
- HBRUSH16 prevHandle = dc->w.hBrush;
+ HBRUSH16 prevHandle = dc->hBrush;
int nSize;
LOGBRUSH16 lBrush16;
- dc->w.hBrush = hbrush;
+ dc->hBrush = hbrush;
lBrush16.lbStyle = brush->logbrush.lbStyle;
lBrush16.lbColor = brush->logbrush.lbColor;
lBrush16.lbHatch = brush->logbrush.lbHatch;
diff --git a/graphics/win16drv/font.c b/graphics/win16drv/font.c
index 770ccf3..3cc2418 100644
--- a/graphics/win16drv/font.c
+++ b/graphics/win16drv/font.c
@@ -12,7 +12,7 @@
#include "module.h"
#include "font.h"
#include "heap.h"
-#include "dc.h"
+#include "gdi.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(win16drv);
@@ -74,10 +74,10 @@
HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font)
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
- HPEN prevHandle = dc->w.hFont;
+ HPEN prevHandle = dc->hFont;
int nSize;
- dc->w.hFont = hfont;
+ dc->hFont = hfont;
TRACE("WIN16DRV_FONT_SelectObject '%s' h=%d\n",
font->logfont.lfFaceName, font->logfont.lfHeight);
diff --git a/graphics/win16drv/graphics.c b/graphics/win16drv/graphics.c
index c45f50e..c31f337 100644
--- a/graphics/win16drv/graphics.c
+++ b/graphics/win16drv/graphics.c
@@ -19,11 +19,11 @@
{
if (pt)
{
- pt->x = dc->w.CursPosX;
- pt->y = dc->w.CursPosY;
+ pt->x = dc->CursPosX;
+ pt->y = dc->CursPosY;
}
- dc->w.CursPosX = x;
- dc->w.CursPosY = y;
+ dc->CursPosX = x;
+ dc->CursPosY = y;
return TRUE;
}
@@ -36,18 +36,18 @@
BOOL bRet ;
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
POINT16 points[2];
- points[0].x = dc->w.DCOrgX + XLPTODP( dc, dc->w.CursPosX );
- points[0].y = dc->w.DCOrgY + YLPTODP( dc, dc->w.CursPosY );
- points[1].x = dc->w.DCOrgX + XLPTODP( dc, x );
- points[1].y = dc->w.DCOrgY + YLPTODP( dc, y );
+ points[0].x = dc->DCOrgX + XLPTODP( dc, dc->CursPosX );
+ points[0].y = dc->DCOrgY + YLPTODP( dc, dc->CursPosY );
+ points[1].x = dc->DCOrgX + XLPTODP( dc, x );
+ points[1].y = dc->DCOrgY + YLPTODP( dc, y );
bRet = PRTDRV_Output(physDev->segptrPDEVICE,
OS_POLYLINE, 2, points,
physDev->PenInfo,
NULL,
- win16drv_SegPtr_DrawMode, dc->w.hClipRgn);
+ win16drv_SegPtr_DrawMode, dc->hClipRgn);
- dc->w.CursPosX = x;
- dc->w.CursPosY = y;
+ dc->CursPosX = x;
+ dc->CursPosY = y;
return TRUE;
}
@@ -63,7 +63,7 @@
POINT16 points[2];
TRACE("In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n",
- left, top, dc->w.DCOrgX, dc->w.DCOrgY);
+ left, top, dc->DCOrgX, dc->DCOrgY);
TRACE("In WIN16DRV_Rectangle, VPortOrgX %d y %d\n",
dc->vportOrgX, dc->vportOrgY);
points[0].x = XLPTODP(dc, left);
@@ -75,7 +75,7 @@
OS_RECTANGLE, 2, points,
physDev->PenInfo,
physDev->BrushInfo,
- win16drv_SegPtr_DrawMode, dc->w.hClipRgn);
+ win16drv_SegPtr_DrawMode, dc->hClipRgn);
return bRet;
}
@@ -111,7 +111,7 @@
OS_WINDPOLYGON, count, points,
physDev->PenInfo,
physDev->BrushInfo,
- win16drv_SegPtr_DrawMode, dc->w.hClipRgn);
+ win16drv_SegPtr_DrawMode, dc->hClipRgn);
HeapFree( GetProcessHeap(), 0, points );
return bRet;
}
@@ -142,7 +142,7 @@
OS_POLYLINE, count, points,
physDev->PenInfo,
NULL,
- win16drv_SegPtr_DrawMode, dc->w.hClipRgn);
+ win16drv_SegPtr_DrawMode, dc->hClipRgn);
HeapFree( GetProcessHeap(), 0, points );
return bRet;
}
@@ -159,7 +159,7 @@
BOOL bRet = 0;
POINT16 points[2];
TRACE("In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n",
- left, top, dc->w.DCOrgX, dc->w.DCOrgY);
+ left, top, dc->DCOrgX, dc->DCOrgY);
TRACE("In WIN16DRV_Ellipse, VPortOrgX %d y %d\n",
dc->vportOrgX, dc->vportOrgY);
points[0].x = XLPTODP(dc, left);
@@ -172,7 +172,7 @@
OS_ELLIPSE, 2, points,
physDev->PenInfo,
physDev->BrushInfo,
- win16drv_SegPtr_DrawMode, dc->w.hClipRgn);
+ win16drv_SegPtr_DrawMode, dc->hClipRgn);
return bRet;
}
diff --git a/graphics/win16drv/init.c b/graphics/win16drv/init.c
index 6ee437c..73b4a65 100644
--- a/graphics/win16drv/init.c
+++ b/graphics/win16drv/init.c
@@ -16,9 +16,8 @@
#include "font.h"
#include "options.h"
#include "debugtools.h"
-#include "dc.h"
-DEFAULT_DEBUG_CHANNEL(win16drv)
+DEFAULT_DEBUG_CHANNEL(win16drv);
#define SUPPORT_REALIZED_FONTS 1
#include "pshpack1.h"
@@ -243,19 +242,19 @@
wRet = PRTDRV_Enable(printerDevCaps, GETGDIINFO, device, driver, output,NULL);
/* Add this to the DC */
- dc->w.devCaps = printerDevCaps;
- dc->w.hVisRgn = CreateRectRgn(0, 0, dc->w.devCaps->horzRes, dc->w.devCaps->vertRes);
- dc->w.bitsPerPixel = dc->w.devCaps->bitsPixel;
+ dc->devCaps = printerDevCaps;
+ dc->hVisRgn = CreateRectRgn(0, 0, dc->devCaps->horzRes, dc->devCaps->vertRes);
+ dc->bitsPerPixel = dc->devCaps->bitsPixel;
TRACE("Got devcaps width %d height %d bits %d planes %d\n",
- dc->w.devCaps->horzRes, dc->w.devCaps->vertRes,
- dc->w.devCaps->bitsPixel, dc->w.devCaps->planes);
+ dc->devCaps->horzRes, dc->devCaps->vertRes,
+ dc->devCaps->bitsPixel, dc->devCaps->planes);
/* Now we allocate enough memory for the PDEVICE structure */
/* The size of this varies between printer drivers */
/* This PDEVICE is used by the printer DRIVER not by the GDI so must */
/* be accessable from 16 bit code */
- nPDEVICEsize = dc->w.devCaps->pdeviceSize + sizeof(PDEVICE_HEADER);
+ nPDEVICEsize = dc->devCaps->pdeviceSize + sizeof(PDEVICE_HEADER);
/* TTD Shouldn't really do pointer arithmetic on segment points */
physDev->segptrPDEVICE = WIN16_GlobalLock16(GlobalAlloc16(GHND, nPDEVICEsize))+sizeof(PDEVICE_HEADER);
diff --git a/graphics/win16drv/pen.c b/graphics/win16drv/pen.c
index d6ad8b0..a925b51 100644
--- a/graphics/win16drv/pen.c
+++ b/graphics/win16drv/pen.c
@@ -17,10 +17,10 @@
HPEN WIN16DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
- HPEN prevHandle = dc->w.hPen;
+ HPEN prevHandle = dc->hPen;
int nSize;
LOGPEN16 lPen16;
- dc->w.hPen = hpen;
+ dc->hPen = hpen;
TRACE("In WIN16DRV_PEN_SelectObject\n");
lPen16.lopnStyle = pen->logpen.lopnStyle;
lPen16.lopnWidth.x = pen->logpen.lopnWidth.x;
diff --git a/graphics/win16drv/text.c b/graphics/win16drv/text.c
index 9b496dc..171b15e 100644
--- a/graphics/win16drv/text.c
+++ b/graphics/win16drv/text.c
@@ -7,7 +7,6 @@
#include <stdlib.h>
#include "win16drv.h"
-#include "dc.h"
#include "gdi.h"
#include "debugtools.h"
#include "winbase.h"
@@ -45,8 +44,8 @@
clipRect.left = 0;
clipRect.top = 0;
- clipRect.right = dc->w.devCaps->horzRes;
- clipRect.bottom = dc->w.devCaps->vertRes;
+ clipRect.right = dc->devCaps->horzRes;
+ clipRect.bottom = dc->devCaps->vertRes;
if (lprect) {
opaqueRect.left = lprect->left;
opaqueRect.top = lprect->top;
@@ -55,11 +54,11 @@
lpOpaqueRect = &opaqueRect;
}
- TRACE("textalign = %d\n", dc->w.textAlign);
+ TRACE("textalign = %d\n", dc->textAlign);
- if (dc->w.textAlign & TA_UPDATECP) {
- x = dc->w.CursPosX;
- y = dc->w.CursPosY;
+ if (dc->textAlign & TA_UPDATECP) {
+ x = dc->CursPosX;
+ y = dc->CursPosY;
}
x = XLPTODP( dc, x );
@@ -73,22 +72,22 @@
width = LOWORD(dwRet);
- switch( dc->w.textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER) ) {
+ switch( dc->textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER) ) {
case TA_LEFT:
- if (dc->w.textAlign & TA_UPDATECP)
- dc->w.CursPosX = XDPTOLP( dc, x + width );
+ if (dc->textAlign & TA_UPDATECP)
+ dc->CursPosX = XDPTOLP( dc, x + width );
break;
case TA_RIGHT:
x -= width;
- if (dc->w.textAlign & TA_UPDATECP)
- dc->w.CursPosX = XDPTOLP( dc, x );
+ if (dc->textAlign & TA_UPDATECP)
+ dc->CursPosX = XDPTOLP( dc, x );
break;
case TA_CENTER:
x -= width / 2;
break;
}
- switch( dc->w.textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE) ) {
+ switch( dc->textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE) ) {
case TA_TOP:
break;
case TA_BOTTOM:
diff --git a/graphics/x11drv/bitblt.c b/graphics/x11drv/bitblt.c
index c0e44e0..1d2e7af 100644
--- a/graphics/x11drv/bitblt.c
+++ b/graphics/x11drv/bitblt.c
@@ -16,13 +16,13 @@
#include "bitmap.h"
#include "callback.h"
#include "color.h"
-#include "dc.h"
+#include "gdi.h"
#include "metafile.h"
#include "options.h"
#include "x11drv.h"
#include "debugtools.h"
-DEFAULT_DEBUG_CHANNEL(bitblt)
+DEFAULT_DEBUG_CHANNEL(bitblt);
#define DST 0 /* Destination drawable */
@@ -859,13 +859,13 @@
visRectSrc->bottom - visRectSrc->top,
AllPlanes, ZPixmap );
XCREATEIMAGE( imageDst, rectDst.right - rectDst.left,
- rectDst.bottom - rectDst.top, dcDst->w.bitsPerPixel );
+ rectDst.bottom - rectDst.top, dcDst->bitsPerPixel );
BITBLT_StretchImage( imageSrc, imageDst, widthSrc, heightSrc,
widthDst, heightDst, &rectSrc, &rectDst,
- physDevDst->textPixel, dcDst->w.bitsPerPixel != 1 ?
+ physDevDst->textPixel, dcDst->bitsPerPixel != 1 ?
physDevDst->backgroundPixel :
physDevSrc->backgroundPixel,
- dcDst->w.stretchBltMode );
+ dcDst->stretchBltMode );
XPutImage( display, pixmap, gc, imageDst, 0, 0, 0, 0,
rectDst.right - rectDst.left, rectDst.bottom - rectDst.top );
XDestroyImage( imageSrc );
@@ -889,12 +889,12 @@
X11DRV_PDEVICE *physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev;
X11DRV_PDEVICE *physDevDst = (X11DRV_PDEVICE *)dcDst->physDev;
- if (dcSrc->w.bitsPerPixel == dcDst->w.bitsPerPixel)
+ if (dcSrc->bitsPerPixel == dcDst->bitsPerPixel)
{
if (!X11DRV_PALETTE_XPixelToPalette ||
- (dcDst->w.bitsPerPixel == 1)) /* monochrome -> monochrome */
+ (dcDst->bitsPerPixel == 1)) /* monochrome -> monochrome */
{
- if (dcDst->w.bitsPerPixel == 1)
+ if (dcDst->bitsPerPixel == 1)
{
/* MSDN says if StretchBlt must convert a bitmap from monochrome
to color or vice versa, the forground and background color of
@@ -912,7 +912,7 @@
}
else /* color -> color */
{
- if (dcSrc->w.flags & DC_MEMORY)
+ if (dcSrc->flags & DC_MEMORY)
imageSrc = XGetImage( display, physDevSrc->drawable,
visRectSrc->left, visRectSrc->top,
width, height, AllPlanes, ZPixmap );
@@ -936,7 +936,7 @@
}
else
{
- if (dcSrc->w.bitsPerPixel == 1) /* monochrome -> color */
+ if (dcSrc->bitsPerPixel == 1) /* monochrome -> color */
{
if (X11DRV_PALETTE_XPixelToPalette)
{
@@ -960,7 +960,7 @@
imageSrc = XGetImage( display, physDevSrc->drawable,
visRectSrc->left, visRectSrc->top,
width, height, AllPlanes, ZPixmap );
- XCREATEIMAGE( imageDst, width, height, dcDst->w.bitsPerPixel );
+ XCREATEIMAGE( imageDst, width, height, dcDst->bitsPerPixel );
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
XPutPixel(imageDst, x, y, (XGetPixel(imageSrc,x,y) ==
@@ -986,7 +986,7 @@
INT height = visRectDst->bottom - visRectDst->top;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
- if (!X11DRV_PALETTE_XPixelToPalette || (dc->w.bitsPerPixel == 1) ||
+ if (!X11DRV_PALETTE_XPixelToPalette || (dc->bitsPerPixel == 1) ||
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
{
XCopyArea( display, physDev->drawable, pixmap, gc,
@@ -997,7 +997,7 @@
register INT x, y;
XImage *image;
- if (dc->w.flags & DC_MEMORY)
+ if (dc->flags & DC_MEMORY)
image = XGetImage( display, physDev->drawable,
visRectDst->left, visRectDst->top,
width, height, AllPlanes, ZPixmap );
@@ -1033,7 +1033,7 @@
/* !X11DRV_PALETTE_PaletteToXPixel is _NOT_ enough */
- if (!X11DRV_PALETTE_PaletteToXPixel || (dc->w.bitsPerPixel == 1) ||
+ if (!X11DRV_PALETTE_PaletteToXPixel || (dc->bitsPerPixel == 1) ||
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
{
XCopyArea( display, pixmap, physDev->drawable, gc, 0, 0,
@@ -1079,7 +1079,7 @@
rect.bottom = yDst + heightDst;
if (widthDst < 0) SWAP_INT32( &rect.left, &rect.right );
if (heightDst < 0) SWAP_INT32( &rect.top, &rect.bottom );
- GetRgnBox( dcDst->w.hGCClipRgn, &clipRect );
+ GetRgnBox( dcDst->hGCClipRgn, &clipRect );
if (!IntersectRect( visRectDst, &rect, &clipRect )) return FALSE;
/* Get the source visible rectangle */
@@ -1093,7 +1093,7 @@
if (heightSrc < 0) SWAP_INT32( &rect.top, &rect.bottom );
/* Apparently the clipping and visible regions are only for output,
so just check against totalExtent here to avoid BadMatch errors */
- if (!IntersectRect( visRectSrc, &rect, &dcSrc->w.totalExtent ))
+ if (!IntersectRect( visRectSrc, &rect, &dcSrc->totalExtent ))
return FALSE;
/* Intersect the rectangles */
@@ -1186,8 +1186,8 @@
/* Map the coordinates to device coords */
- xDst = dcDst->w.DCOrgX + XLPTODP( dcDst, xDst );
- yDst = dcDst->w.DCOrgY + YLPTODP( dcDst, yDst );
+ xDst = dcDst->DCOrgX + XLPTODP( dcDst, xDst );
+ yDst = dcDst->DCOrgY + YLPTODP( dcDst, yDst );
/* Here we have to round to integers, not truncate */
widthDst = MulDiv(widthDst, dcDst->vportExtX, dcDst->wndExtX);
@@ -1200,12 +1200,12 @@
dcDst->wndExtX, dcDst->wndExtY );
TRACE(" rectdst=%d,%d-%d,%d orgdst=%d,%d\n",
xDst, yDst, widthDst, heightDst,
- dcDst->w.DCOrgX, dcDst->w.DCOrgY );
+ dcDst->DCOrgX, dcDst->DCOrgY );
if (useSrc)
{
- xSrc = dcSrc->w.DCOrgX + XLPTODP( dcSrc, xSrc );
- ySrc = dcSrc->w.DCOrgY + YLPTODP( dcSrc, ySrc );
+ xSrc = dcSrc->DCOrgX + XLPTODP( dcSrc, xSrc );
+ ySrc = dcSrc->DCOrgY + YLPTODP( dcSrc, ySrc );
widthSrc = widthSrc * dcSrc->vportExtX / dcSrc->wndExtX;
heightSrc = heightSrc * dcSrc->vportExtY / dcSrc->wndExtY;
fStretch = (widthSrc != widthDst) || (heightSrc != heightDst);
@@ -1216,7 +1216,7 @@
dcSrc->wndExtX, dcSrc->wndExtY );
TRACE(" rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n",
xSrc, ySrc, widthSrc, heightSrc,
- dcSrc->w.DCOrgX, dcSrc->w.DCOrgY );
+ dcSrc->DCOrgX, dcSrc->DCOrgY );
if (!BITBLT_GetVisRectangles( dcDst, xDst, yDst, widthDst, heightDst,
dcSrc, xSrc, ySrc, widthSrc, heightSrc,
&visRectSrc, &visRectDst ))
@@ -1244,7 +1244,7 @@
if (!fStretch) switch(rop) /* A few optimisations */
{
case BLACKNESS: /* 0x00 */
- if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
+ if ((dcDst->bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
XSetFunction( display, physDevDst->gc, GXclear );
else
{
@@ -1257,7 +1257,7 @@
return TRUE;
case DSTINVERT: /* 0x55 */
- if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel ||
+ if ((dcDst->bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel ||
!perfect_graphics())
{
XSetFunction( display, physDevDst->gc, GXinvert );
@@ -1302,9 +1302,9 @@
return TRUE;
case SRCCOPY: /* 0xcc */
- if (dcSrc->w.bitsPerPixel == dcDst->w.bitsPerPixel)
+ if (dcSrc->bitsPerPixel == dcDst->bitsPerPixel)
{
- BOOL expose = !(dcSrc->w.flags & DC_MEMORY) && !(dcDst->w.flags & DC_MEMORY);
+ BOOL expose = !(dcSrc->flags & DC_MEMORY) && !(dcDst->flags & DC_MEMORY);
if ( expose ) XSetGraphicsExposures( display, physDevDst->gc, True );
XSetFunction( display, physDevDst->gc, GXcopy );
XCopyArea( display, physDevSrc->drawable,
@@ -1314,9 +1314,9 @@
if ( expose ) XSetGraphicsExposures( display, physDevDst->gc, False );
return TRUE;
}
- if (dcSrc->w.bitsPerPixel == 1)
+ if (dcSrc->bitsPerPixel == 1)
{
- BOOL expose = !(dcSrc->w.flags & DC_MEMORY) && !(dcDst->w.flags & DC_MEMORY);
+ BOOL expose = !(dcSrc->flags & DC_MEMORY) && !(dcDst->flags & DC_MEMORY);
XSetBackground( display, physDevDst->gc, physDevDst->textPixel );
XSetForeground( display, physDevDst->gc,
physDevDst->backgroundPixel );
@@ -1339,7 +1339,7 @@
return TRUE;
case WHITENESS: /* 0xff */
- if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
+ if ((dcDst->bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
XSetFunction( display, physDevDst->gc, GXset );
else
{
@@ -1356,11 +1356,11 @@
tmpGC = XCreateGC( display, physDevDst->drawable, 0, NULL );
XSetGraphicsExposures( display, tmpGC, False );
pixmaps[DST] = XCreatePixmap( display, X11DRV_GetXRootWindow(), width, height,
- dcDst->w.bitsPerPixel );
+ dcDst->bitsPerPixel );
if (useSrc)
{
pixmaps[SRC] = XCreatePixmap( display, X11DRV_GetXRootWindow(), width, height,
- dcDst->w.bitsPerPixel );
+ dcDst->bitsPerPixel );
if (fStretch)
BITBLT_GetSrcAreaStretch( dcSrc, dcDst, pixmaps[SRC], tmpGC,
xSrc, ySrc, widthSrc, heightSrc,
@@ -1386,7 +1386,7 @@
if (!pixmaps[TMP])
pixmaps[TMP] = XCreatePixmap( display, X11DRV_GetXRootWindow(),
width, height,
- dcDst->w.bitsPerPixel );
+ dcDst->bitsPerPixel );
/* fall through */
case OP_ARGS(DST,SRC):
case OP_ARGS(SRC,DST):
@@ -1401,7 +1401,7 @@
if (!pixmaps[TMP] && !fNullBrush)
pixmaps[TMP] = XCreatePixmap( display, X11DRV_GetXRootWindow(),
width, height,
- dcDst->w.bitsPerPixel );
+ dcDst->bitsPerPixel );
/* fall through */
case OP_ARGS(PAT,DST):
case OP_ARGS(PAT,SRC):
diff --git a/graphics/x11drv/bitmap.c b/graphics/x11drv/bitmap.c
index 47c9fc6..181a268 100644
--- a/graphics/x11drv/bitmap.c
+++ b/graphics/x11drv/bitmap.c
@@ -14,7 +14,6 @@
#include <stdlib.h>
#include "gdi.h"
#include "callback.h"
-#include "dc.h"
#include "bitmap.h"
#include "heap.h"
#include "debugtools.h"
@@ -69,11 +68,11 @@
BITMAPOBJ * bmp )
{
HRGN hrgn;
- HBITMAP prevHandle = dc->w.hBitmap;
+ HBITMAP prevHandle = dc->hBitmap;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
- if (!(dc->w.flags & DC_MEMORY)) return 0;
+ if (!(dc->flags & DC_MEMORY)) return 0;
if(!bmp->physBitmap)
if(!X11DRV_CreateBitmap(hbitmap))
@@ -87,25 +86,25 @@
hrgn = CreateRectRgn(0, 0, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight);
if (!hrgn) return 0;
- dc->w.totalExtent.left = 0;
- dc->w.totalExtent.top = 0;
- dc->w.totalExtent.right = bmp->bitmap.bmWidth;
- dc->w.totalExtent.bottom = bmp->bitmap.bmHeight;
+ dc->totalExtent.left = 0;
+ dc->totalExtent.top = 0;
+ dc->totalExtent.right = bmp->bitmap.bmWidth;
+ dc->totalExtent.bottom = bmp->bitmap.bmHeight;
physDev->drawable = (Pixmap)bmp->physBitmap;
- dc->w.hBitmap = hbitmap;
+ dc->hBitmap = hbitmap;
SelectVisRgn16( dc->hSelf, hrgn );
DeleteObject( hrgn );
/* Change GC depth if needed */
- if (dc->w.bitsPerPixel != bmp->bitmap.bmBitsPixel)
+ if (dc->bitsPerPixel != bmp->bitmap.bmBitsPixel)
{
TSXFreeGC( display, physDev->gc );
physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL );
TSXSetGraphicsExposures( display, physDev->gc, False );
- dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel;
+ dc->bitsPerPixel = bmp->bitmap.bmBitsPixel;
DC_InitDC( dc );
}
return prevHandle;
diff --git a/graphics/x11drv/brush.c b/graphics/x11drv/brush.c
index 81e2c95..ee17da1 100644
--- a/graphics/x11drv/brush.c
+++ b/graphics/x11drv/brush.c
@@ -151,7 +151,7 @@
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
- if ((dc->w.bitsPerPixel > 1) && (X11DRV_GetDepth() <= 8) && !COLOR_IsSolid( color ))
+ if ((dc->bitsPerPixel > 1) && (X11DRV_GetDepth() <= 8) && !COLOR_IsSolid( color ))
{
/* Dithered brush */
physDev->brush.pixmap = BRUSH_DitherColor( dc, color );
@@ -186,7 +186,7 @@
goto done;
}
- if ((dc->w.bitsPerPixel == 1) && (bmp->bitmap.bmBitsPixel != 1))
+ 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);
@@ -228,13 +228,13 @@
{
HBITMAP16 hBitmap;
BITMAPINFO * bmpInfo;
- HBRUSH16 prevHandle = dc->w.hBrush;
+ HBRUSH16 prevHandle = dc->hBrush;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
TRACE("hdc=%04x hbrush=%04x\n",
dc->hSelf,hbrush);
- dc->w.hBrush = hbrush;
+ dc->hBrush = hbrush;
if (physDev->brush.pixmap)
{
diff --git a/graphics/x11drv/clipping.c b/graphics/x11drv/clipping.c
index 1d8dd28..0f30707 100644
--- a/graphics/x11drv/clipping.c
+++ b/graphics/x11drv/clipping.c
@@ -10,14 +10,14 @@
#include <stdio.h>
-#include "dc.h"
+#include "gdi.h"
#include "x11drv.h"
#include "region.h"
#include "debugtools.h"
#include "heap.h"
#include "local.h"
-DEFAULT_DEBUG_CHANNEL(x11drv)
+DEFAULT_DEBUG_CHANNEL(x11drv);
/***********************************************************************
* X11DRV_SetDeviceClipping
@@ -31,7 +31,7 @@
XRectangle *pXrect;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
- RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr(dc->w.hGCClipRgn, REGION_MAGIC);
+ RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr(dc->hGCClipRgn, REGION_MAGIC);
if (!obj)
{
ERR("Rgn is 0. Please report this.\n");
@@ -49,7 +49,7 @@
if(!pXrect)
{
WARN("Can't alloc buffer\n");
- GDI_ReleaseObj( dc->w.hGCClipRgn );
+ GDI_ReleaseObj( dc->hGCClipRgn );
return;
}
@@ -70,6 +70,6 @@
if(pXrect)
HeapFree( GetProcessHeap(), 0, pXrect );
- GDI_ReleaseObj( dc->w.hGCClipRgn );
+ GDI_ReleaseObj( dc->hGCClipRgn );
}
diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c
index 8be2d72..b1812bc 100644
--- a/graphics/x11drv/dib.c
+++ b/graphics/x11drv/dib.c
@@ -23,14 +23,14 @@
#include "bitmap.h"
#include "x11drv.h"
#include "debugtools.h"
-#include "dc.h"
+#include "gdi.h"
#include "color.h"
#include "callback.h"
#include "selectors.h"
#include "global.h"
-DEFAULT_DEBUG_CHANNEL(bitmap)
-DECLARE_DEBUG_CHANNEL(x11drv)
+DEFAULT_DEBUG_CHANNEL(bitmap);
+DECLARE_DEBUG_CHANNEL(x11drv);
static int bitmapDepthTable[] = { 8, 1, 32, 16, 24, 15, 4, 0 };
static int ximageDepthTable[] = { 0, 0, 0, 0, 0, 0, 0 };
@@ -2802,7 +2802,7 @@
if (!cx || !cy) return 0;
X11DRV_SetupGCForText( dc ); /* To have the correct colors */
- TSXSetFunction(display, physDev->gc, X11DRV_XROPfunction[dc->w.ROPmode-1]);
+ TSXSetFunction(display, physDev->gc, X11DRV_XROPfunction[dc->ROPmode-1]);
switch (descr.infoBpp)
{
@@ -2811,7 +2811,7 @@
case 8:
descr.colorMap = (RGBQUAD *)X11DRV_DIB_BuildColorMap(
coloruse == DIB_PAL_COLORS ? dc : NULL, coloruse,
- dc->w.bitsPerPixel, info, &descr.nColorMap );
+ dc->bitsPerPixel, info, &descr.nColorMap );
if (!descr.colorMap) return 0;
descr.rMask = descr.gMask = descr.bMask = 0;
break;
@@ -2842,14 +2842,14 @@
descr.palentry = NULL;
descr.lines = tmpheight >= 0 ? lines : -lines;
descr.infoWidth = width;
- descr.depth = dc->w.bitsPerPixel;
+ descr.depth = dc->bitsPerPixel;
descr.drawable = physDev->drawable;
descr.gc = physDev->gc;
descr.xSrc = xSrc;
descr.ySrc = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy)
: ySrc - startscan;
- descr.xDest = dc->w.DCOrgX + XLPTODP( dc, xDest );
- descr.yDest = dc->w.DCOrgY + YLPTODP( dc, yDest ) +
+ descr.xDest = dc->DCOrgX + XLPTODP( dc, xDest );
+ descr.yDest = dc->DCOrgY + YLPTODP( dc, yDest ) +
(tmpheight >= 0 ? oldcy-cy : 0);
descr.width = cx;
descr.height = cy;
@@ -2969,7 +2969,7 @@
(int)info->bmiHeader.biWidth, (int)info->bmiHeader.biHeight,
startscan );
- if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->w.hPalette, PALETTE_MAGIC )))
+ if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC )))
return 0;
if( lines > info->bmiHeader.biHeight ) lines = info->bmiHeader.biHeight;
@@ -3065,7 +3065,7 @@
info->bmiHeader.biCompression = 0;
done:
- GDI_ReleaseObj( dc->w.hPalette );
+ GDI_ReleaseObj( dc->hPalette );
return lines;
}
@@ -3292,9 +3292,9 @@
/* Ensure this is a Compatible DC that has a DIB section selected */
if (!dc) return;
- if (!(dc->w.flags & DC_MEMORY)) return;
+ if (!(dc->flags & DC_MEMORY)) return;
- X11DRV_DIB_UpdateDIBSection2(dc->w.hBitmap, toDIB);
+ X11DRV_DIB_UpdateDIBSection2(dc->hBitmap, toDIB);
}
/***********************************************************************
diff --git a/graphics/x11drv/graphics.c b/graphics/x11drv/graphics.c
index 39dde41..57726b0 100644
--- a/graphics/x11drv/graphics.c
+++ b/graphics/x11drv/graphics.c
@@ -30,7 +30,6 @@
#include "x11font.h"
#include "bitmap.h"
#include "gdi.h"
-#include "dc.h"
#include "callback.h"
#include "metafile.h"
#include "palette.h"
@@ -99,7 +98,7 @@
val.background = X11DRV_PALETTE_XPixelToPalette[val.background];
}
- val.function = X11DRV_XROPfunction[dc->w.ROPmode-1];
+ val.function = X11DRV_XROPfunction[dc->ROPmode-1];
/*
** Let's replace GXinvert by GXxor with (black xor white)
** This solves the selection color and leak problems in excel
@@ -115,7 +114,7 @@
{
case FillStippled:
case FillOpaqueStippled:
- if (dc->w.backgroundMode==OPAQUE) val.fill_style = FillOpaqueStippled;
+ if (dc->backgroundMode==OPAQUE) val.fill_style = FillOpaqueStippled;
val.stipple = physDev->brush.pixmap;
mask = GCStipple;
break;
@@ -147,9 +146,9 @@
mask = 0;
break;
}
- val.ts_x_origin = dc->w.DCOrgX + dc->w.brushOrgX;
- val.ts_y_origin = dc->w.DCOrgY + dc->w.brushOrgY;
- val.fill_rule = (dc->w.polyFillMode==WINDING) ? WindingRule : EvenOddRule;
+ val.ts_x_origin = dc->DCOrgX + dc->brushOrgX;
+ val.ts_y_origin = dc->DCOrgY + dc->brushOrgY;
+ val.fill_rule = (dc->polyFillMode==WINDING) ? WindingRule : EvenOddRule;
TSXChangeGC( display, gc,
GCFunction | GCForeground | GCBackground | GCFillStyle |
GCFillRule | GCTileStipXOrigin | GCTileStipYOrigin | mask,
@@ -185,7 +184,7 @@
if (physDev->pen.style == PS_NULL) return FALSE;
- switch (dc->w.ROPmode)
+ switch (dc->ROPmode)
{
case R2_BLACK :
val.foreground = BlackPixelOfScreen( X11DRV_GetXScreen() );
@@ -206,7 +205,7 @@
break;
default :
val.foreground = physDev->pen.pixel;
- val.function = X11DRV_XROPfunction[dc->w.ROPmode-1];
+ val.function = X11DRV_XROPfunction[dc->ROPmode-1];
}
val.background = physDev->backgroundPixel;
val.fill_style = FillSolid;
@@ -216,7 +215,7 @@
{
TSXSetDashes( display, physDev->gc, 0, physDev->pen.dashes,
physDev->pen.dash_len );
- val.line_style = (dc->w.backgroundMode == OPAQUE) ?
+ val.line_style = (dc->backgroundMode == OPAQUE) ?
LineDoubleDash : LineOnOffDash;
}
else val.line_style = LineSolid;
@@ -298,10 +297,10 @@
/* Update the pixmap from the DIB section */
X11DRV_DIB_UpdateDIBSection(dc, FALSE);
TSXDrawLine(display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + XLPTODP( dc, dc->w.CursPosX ),
- dc->w.DCOrgY + YLPTODP( dc, dc->w.CursPosY ),
- dc->w.DCOrgX + XLPTODP( dc, x ),
- dc->w.DCOrgY + YLPTODP( dc, y ) );
+ dc->DCOrgX + XLPTODP( dc, dc->CursPosX ),
+ dc->DCOrgY + YLPTODP( dc, dc->CursPosY ),
+ dc->DCOrgX + XLPTODP( dc, x ),
+ dc->DCOrgY + YLPTODP( dc, y ) );
/* Update the DIBSection from the pixmap */
X11DRV_DIB_UpdateDIBSection(dc, TRUE);
}
@@ -343,7 +342,7 @@
if ((left == right) || (top == bottom)
||(lines && ((right-left==1)||(bottom-top==1)))) return TRUE;
- if( dc->w.ArcDirection == AD_CLOCKWISE )
+ if( dc->ArcDirection == AD_CLOCKWISE )
{ INT tmp = xstart; xstart = xend; xend = tmp;
tmp = ystart; ystart = yend; yend = tmp; }
@@ -395,7 +394,7 @@
TSXSetArcMode( display, physDev->gc,
(lines==1) ? ArcChord : ArcPieSlice);
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1, istart_angle, idiff_angle );
update = TRUE;
}
@@ -404,20 +403,20 @@
if (X11DRV_SetupGCForPen( dc )){
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1, istart_angle, idiff_angle );
if (lines) {
/* use the truncated values */
start_angle=(double)istart_angle*PI/64./180.;
end_angle=(double)(istart_angle+idiff_angle)*PI/64./180.;
/* calculate the endpoints and round correctly */
- points[0].x = (int) floor(dc->w.DCOrgX + (right+left)/2.0 +
+ points[0].x = (int) floor(dc->DCOrgX + (right+left)/2.0 +
cos(start_angle) * (right-left-width*2+2) / 2. + 0.5);
- points[0].y = (int) floor(dc->w.DCOrgY + (top+bottom)/2.0 -
+ points[0].y = (int) floor(dc->DCOrgY + (top+bottom)/2.0 -
sin(start_angle) * (bottom-top-width*2+2) / 2. + 0.5);
- points[1].x = (int) floor(dc->w.DCOrgX + (right+left)/2.0 +
+ points[1].x = (int) floor(dc->DCOrgX + (right+left)/2.0 +
cos(end_angle) * (right-left-width*2+2) / 2. + 0.5);
- points[1].y = (int) floor(dc->w.DCOrgY + (top+bottom)/2.0 -
+ points[1].y = (int) floor(dc->DCOrgY + (top+bottom)/2.0 -
sin(end_angle) * (bottom-top-width*2+2) / 2. + 0.5);
/* OK this stuff is optimized for Xfree86
@@ -431,8 +430,8 @@
if (lines == 2) {
INT dx1,dy1;
points[3] = points[1];
- points[1].x = dc->w.DCOrgX + xcenter;
- points[1].y = dc->w.DCOrgY + ycenter;
+ points[1].x = dc->DCOrgX + xcenter;
+ points[1].y = dc->DCOrgY + ycenter;
points[2] = points[1];
dx1=points[1].x-points[0].x;
dy1=points[1].y-points[0].y;
@@ -550,14 +549,14 @@
if (X11DRV_SetupGCForBrush( dc ))
{
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1, 0, 360*64 );
update = TRUE;
}
if (X11DRV_SetupGCForPen( dc ))
{
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1, 0, 360*64 );
update = TRUE;
}
@@ -619,15 +618,15 @@
if (X11DRV_SetupGCForBrush( dc ))
{
TSXFillRectangle( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left + (width + 1) / 2,
- dc->w.DCOrgY + top + (width + 1) / 2,
+ dc->DCOrgX + left + (width + 1) / 2,
+ dc->DCOrgY + top + (width + 1) / 2,
right-left-width-1, bottom-top-width-1);
update = TRUE;
}
if (X11DRV_SetupGCForPen( dc ))
{
TSXDrawRectangle( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1 );
update = TRUE;
}
@@ -698,61 +697,61 @@
if (ell_width > (right-left) )
if (ell_height > (bottom-top) )
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right - left - 1, bottom - top - 1,
0, 360 * 64 );
else{
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right - left - 1, ell_height, 0, 180 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left,
- dc->w.DCOrgY + bottom - ell_height - 1,
+ dc->DCOrgX + left,
+ dc->DCOrgY + bottom - ell_height - 1,
right - left - 1, ell_height, 180 * 64,
180 * 64 );
}
else if (ell_height > (bottom-top) ){
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
ell_width, bottom - top - 1, 90 * 64, 180 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + right - ell_width -1, dc->w.DCOrgY + top,
+ dc->DCOrgX + right - ell_width -1, dc->DCOrgY + top,
ell_width, bottom - top - 1, 270 * 64, 180 * 64 );
}else{
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
ell_width, ell_height, 90 * 64, 90 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left,
- dc->w.DCOrgY + bottom - ell_height - 1,
+ dc->DCOrgX + left,
+ dc->DCOrgY + bottom - ell_height - 1,
ell_width, ell_height, 180 * 64, 90 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + right - ell_width - 1,
- dc->w.DCOrgY + bottom - ell_height - 1,
+ dc->DCOrgX + right - ell_width - 1,
+ dc->DCOrgY + bottom - ell_height - 1,
ell_width, ell_height, 270 * 64, 90 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + right - ell_width - 1,
- dc->w.DCOrgY + top,
+ dc->DCOrgX + right - ell_width - 1,
+ dc->DCOrgY + top,
ell_width, ell_height, 0, 90 * 64 );
}
if (ell_width < right - left)
{
TSXFillRectangle( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left + (ell_width + 1) / 2,
- dc->w.DCOrgY + top + 1,
+ dc->DCOrgX + left + (ell_width + 1) / 2,
+ dc->DCOrgY + top + 1,
right - left - ell_width - 1,
(ell_height + 1) / 2 - 1);
TSXFillRectangle( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left + (ell_width + 1) / 2,
- dc->w.DCOrgY + bottom - (ell_height) / 2 - 1,
+ dc->DCOrgX + left + (ell_width + 1) / 2,
+ dc->DCOrgY + bottom - (ell_height) / 2 - 1,
right - left - ell_width - 1,
(ell_height) / 2 );
}
if (ell_height < bottom - top)
{
TSXFillRectangle( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left + 1,
- dc->w.DCOrgY + top + (ell_height + 1) / 2,
+ dc->DCOrgX + left + 1,
+ dc->DCOrgY + top + (ell_height + 1) / 2,
right - left - 2,
bottom - top - ell_height - 1);
}
@@ -771,65 +770,65 @@
if (ell_width > (right-left) )
if (ell_height > (bottom-top) )
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right - left - 1, bottom -top - 1, 0 , 360 * 64 );
else{
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
right - left - 1, ell_height - 1, 0 , 180 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left,
- dc->w.DCOrgY + bottom - ell_height,
+ dc->DCOrgX + left,
+ dc->DCOrgY + bottom - ell_height,
right - left - 1, ell_height - 1, 180 * 64 , 180 * 64 );
}
else if (ell_height > (bottom-top) ){
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
ell_width - 1 , bottom - top - 1, 90 * 64 , 180 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + right - ell_width,
- dc->w.DCOrgY + top,
+ dc->DCOrgX + right - ell_width,
+ dc->DCOrgY + top,
ell_width - 1 , bottom - top - 1, 270 * 64 , 180 * 64 );
}else{
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + top,
+ dc->DCOrgX + left, dc->DCOrgY + top,
ell_width - 1, ell_height - 1, 90 * 64, 90 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left, dc->w.DCOrgY + bottom - ell_height,
+ dc->DCOrgX + left, dc->DCOrgY + bottom - ell_height,
ell_width - 1, ell_height - 1, 180 * 64, 90 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + right - ell_width,
- dc->w.DCOrgY + bottom - ell_height,
+ dc->DCOrgX + right - ell_width,
+ dc->DCOrgY + bottom - ell_height,
ell_width - 1, ell_height - 1, 270 * 64, 90 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + right - ell_width, dc->w.DCOrgY + top,
+ dc->DCOrgX + right - ell_width, dc->DCOrgY + top,
ell_width - 1, ell_height - 1, 0, 90 * 64 );
}
if (ell_width < right - left)
{
TSXDrawLine( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left + ell_width / 2,
- dc->w.DCOrgY + top,
- dc->w.DCOrgX + right - (ell_width+1) / 2,
- dc->w.DCOrgY + top);
+ dc->DCOrgX + left + ell_width / 2,
+ dc->DCOrgY + top,
+ dc->DCOrgX + right - (ell_width+1) / 2,
+ dc->DCOrgY + top);
TSXDrawLine( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left + ell_width / 2 ,
- dc->w.DCOrgY + bottom - 1,
- dc->w.DCOrgX + right - (ell_width+1)/ 2,
- dc->w.DCOrgY + bottom - 1);
+ dc->DCOrgX + left + ell_width / 2 ,
+ dc->DCOrgY + bottom - 1,
+ dc->DCOrgX + right - (ell_width+1)/ 2,
+ dc->DCOrgY + bottom - 1);
}
if (ell_height < bottom - top)
{
TSXDrawLine( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + right - 1,
- dc->w.DCOrgY + top + ell_height / 2,
- dc->w.DCOrgX + right - 1,
- dc->w.DCOrgY + bottom - (ell_height+1) / 2);
+ dc->DCOrgX + right - 1,
+ dc->DCOrgY + top + ell_height / 2,
+ dc->DCOrgX + right - 1,
+ dc->DCOrgY + bottom - (ell_height+1) / 2);
TSXDrawLine( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + left,
- dc->w.DCOrgY + top + ell_height / 2,
- dc->w.DCOrgX + left,
- dc->w.DCOrgY + bottom - (ell_height+1) / 2);
+ dc->DCOrgX + left,
+ dc->DCOrgY + top + ell_height / 2,
+ dc->DCOrgX + left,
+ dc->DCOrgY + bottom - (ell_height+1) / 2);
}
update = TRUE;
}
@@ -852,8 +851,8 @@
Pixel pixel;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
- x = dc->w.DCOrgX + XLPTODP( dc, x );
- y = dc->w.DCOrgY + YLPTODP( dc, y );
+ x = dc->DCOrgX + XLPTODP( dc, x );
+ y = dc->DCOrgY + YLPTODP( dc, y );
pixel = X11DRV_PALETTE_ToPhysical( dc, color );
TSXSetForeground( display, physDev->gc, pixel );
@@ -879,10 +878,10 @@
int pixel;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
- x = dc->w.DCOrgX + XLPTODP( dc, x );
- y = dc->w.DCOrgY + YLPTODP( dc, y );
+ x = dc->DCOrgX + XLPTODP( dc, x );
+ y = dc->DCOrgY + YLPTODP( dc, y );
EnterCriticalSection( &X11DRV_CritSection );
- if (dc->w.flags & DC_MEMORY)
+ if (dc->flags & DC_MEMORY)
{
image = XGetImage( display, physDev->drawable, x, y, 1, 1,
AllPlanes, ZPixmap );
@@ -892,7 +891,7 @@
/* If we are reading from the screen, use a temporary copy */
/* to avoid a BadMatch error */
if (!pixmap) pixmap = XCreatePixmap( display, X11DRV_GetXRootWindow(),
- 1, 1, dc->w.bitsPerPixel );
+ 1, 1, dc->bitsPerPixel );
XCopyArea( display, physDev->drawable, pixmap, BITMAP_colorGC,
x, y, 1, 1, 0, 0 );
image = XGetImage( display, pixmap, 0, 0, 1, 1, AllPlanes, ZPixmap );
@@ -920,7 +919,7 @@
/* Transform region into device co-ords */
if ( !REGION_LPTODP( hdc, tmpVisRgn, hrgn )
- || OffsetRgn( tmpVisRgn, dc->w.DCOrgX, dc->w.DCOrgY ) == ERROR) {
+ || OffsetRgn( tmpVisRgn, dc->DCOrgX, dc->DCOrgY ) == ERROR) {
DeleteObject( tmpVisRgn );
return FALSE;
}
@@ -936,7 +935,7 @@
/* Fill the region */
- GetRgnBox( dc->w.hGCClipRgn, &box );
+ GetRgnBox( dc->hGCClipRgn, &box );
if (X11DRV_SetupGCForBrush( dc ))
{
/* Update the pixmap from the DIB section */
@@ -976,8 +975,8 @@
}
for (i = 0; i < count; i++)
{
- points[i].x = dc->w.DCOrgX + XLPTODP( dc, pt[i].x );
- points[i].y = dc->w.DCOrgY + YLPTODP( dc, pt[i].y );
+ points[i].x = dc->DCOrgX + XLPTODP( dc, pt[i].x );
+ points[i].y = dc->DCOrgY + YLPTODP( dc, pt[i].y );
}
if (X11DRV_SetupGCForPen ( dc ))
@@ -1016,8 +1015,8 @@
}
for (i = 0; i < count; i++)
{
- points[i].x = dc->w.DCOrgX + XLPTODP( dc, pt[i].x );
- points[i].y = dc->w.DCOrgY + YLPTODP( dc, pt[i].y );
+ points[i].x = dc->DCOrgX + XLPTODP( dc, pt[i].x );
+ points[i].y = dc->DCOrgY + YLPTODP( dc, pt[i].y );
}
points[count] = points[0];
@@ -1057,7 +1056,7 @@
/* FIXME: The points should be converted to device coords before */
/* creating the region. */
- hrgn = CreatePolyPolygonRgn( pt, counts, polygons, dc->w.polyFillMode );
+ hrgn = CreatePolyPolygonRgn( pt, counts, polygons, dc->polyFillMode );
X11DRV_PaintRgn( dc, hrgn );
DeleteObject( hrgn );
@@ -1081,8 +1080,8 @@
{
for (j = 0; j < counts[i]; j++)
{
- points[j].x = dc->w.DCOrgX + XLPTODP( dc, pt->x );
- points[j].y = dc->w.DCOrgY + YLPTODP( dc, pt->y );
+ points[j].x = dc->DCOrgX + XLPTODP( dc, pt->x );
+ points[j].y = dc->DCOrgY + YLPTODP( dc, pt->y );
pt++;
}
points[j] = points[0];
@@ -1125,8 +1124,8 @@
{
for (j = 0; j < counts[i]; j++)
{
- points[j].x = dc->w.DCOrgX + XLPTODP( dc, pt->x );
- points[j].y = dc->w.DCOrgY + YLPTODP( dc, pt->y );
+ points[j].x = dc->DCOrgX + XLPTODP( dc, pt->x );
+ points[j].y = dc->DCOrgY + YLPTODP( dc, pt->y );
pt++;
}
TSXDrawLines( display, physDev->drawable, physDev->gc,
@@ -1236,7 +1235,7 @@
DC *dc = params->dc;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
- if (GetRgnBox( dc->w.hGCClipRgn, &rect ) == ERROR) return FALSE;
+ if (GetRgnBox( dc->hGCClipRgn, &rect ) == ERROR) return FALSE;
if (!(image = XGetImage( display, physDev->drawable,
rect.left,
@@ -1253,8 +1252,8 @@
/* ROP mode is always GXcopy for flood-fill */
XSetFunction( display, physDev->gc, GXcopy );
X11DRV_InternalFloodFill(image, dc,
- XLPTODP(dc,params->x) + dc->w.DCOrgX - rect.left,
- YLPTODP(dc,params->y) + dc->w.DCOrgY - rect.top,
+ XLPTODP(dc,params->x) + dc->DCOrgX - rect.left,
+ YLPTODP(dc,params->y) + dc->DCOrgY - rect.top,
rect.left,
rect.top,
X11DRV_PALETTE_ToPhysical( dc, params->color ),
@@ -1304,8 +1303,8 @@
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
COLORREF oldColor;
- oldColor = dc->w.backgroundColor;
- dc->w.backgroundColor = color;
+ oldColor = dc->backgroundColor;
+ dc->backgroundColor = color;
physDev->backgroundPixel = X11DRV_PALETTE_ToPhysical( dc, color );
@@ -1321,8 +1320,8 @@
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
COLORREF oldColor;
- oldColor = dc->w.textColor;
- dc->w.textColor = color;
+ oldColor = dc->textColor;
+ dc->textColor = color;
physDev->textPixel = X11DRV_PALETTE_ToPhysical( dc, color );
@@ -1334,7 +1333,7 @@
*/
BOOL X11DRV_GetDCOrgEx( DC *dc, LPPOINT lpp )
{
- if (!(dc->w.flags & DC_MEMORY))
+ if (!(dc->flags & DC_MEMORY))
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *) dc->physDev;
Window root;
diff --git a/graphics/x11drv/init.c b/graphics/x11drv/init.c
index 713a335..8521f65 100644
--- a/graphics/x11drv/init.c
+++ b/graphics/x11drv/init.c
@@ -243,45 +243,45 @@
return FALSE;
}
- dc->w.devCaps = &X11DRV_DevCaps;
- if (dc->w.flags & DC_MEMORY)
+ dc->devCaps = &X11DRV_DevCaps;
+ if (dc->flags & DC_MEMORY)
{
- BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( dc->w.hBitmap, BITMAP_MAGIC );
+ BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC );
if (!bmp)
{
HeapFree( GetProcessHeap(), 0, physDev );
return FALSE;
}
- if (!bmp->physBitmap) X11DRV_CreateBitmap( dc->w.hBitmap );
+ if (!bmp->physBitmap) X11DRV_CreateBitmap( dc->hBitmap );
physDev->drawable = (Pixmap)bmp->physBitmap;
physDev->gc = TSXCreateGC(display, physDev->drawable, 0, NULL);
- dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel;
+ dc->bitsPerPixel = bmp->bitmap.bmBitsPixel;
- dc->w.totalExtent.left = 0;
- dc->w.totalExtent.top = 0;
- dc->w.totalExtent.right = bmp->bitmap.bmWidth;
- dc->w.totalExtent.bottom = bmp->bitmap.bmHeight;
- dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
+ 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->w.hBitmap );
+ GDI_ReleaseObj( dc->hBitmap );
}
else
{
physDev->drawable = X11DRV_GetXRootWindow();
physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL );
- dc->w.bitsPerPixel = screen_depth;
+ dc->bitsPerPixel = screen_depth;
- dc->w.totalExtent.left = 0;
- dc->w.totalExtent.top = 0;
- dc->w.totalExtent.right = screen_width;
- dc->w.totalExtent.bottom = screen_height;
- dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
+ 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->w.hVisRgn)
+ if (!dc->hVisRgn)
{
TSXFreeGC( display, physDev->gc );
HeapFree( GetProcessHeap(), 0, physDev );
diff --git a/graphics/x11drv/palette.c b/graphics/x11drv/palette.c
index b749b52..fb77700 100644
--- a/graphics/x11drv/palette.c
+++ b/graphics/x11drv/palette.c
@@ -669,7 +669,7 @@
int X11DRV_PALETTE_ToPhysical( DC *dc, COLORREF color )
{
WORD index = 0;
- HPALETTE16 hPal = (dc)? dc->w.hPalette: GetStockObject(DEFAULT_PALETTE);
+ HPALETTE16 hPal = (dc)? dc->hPalette: GetStockObject(DEFAULT_PALETTE);
unsigned char spec_type = color >> 24;
PALETTEOBJ* palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hPal, PALETTE_MAGIC );
@@ -710,7 +710,7 @@
/* fall through to RGB */
case 0: /* RGB */
- if( dc && (dc->w.bitsPerPixel == 1) )
+ if( dc && (dc->bitsPerPixel == 1) )
{
GDI_ReleaseObj( hPal );
return (((color >> 16) & 0xff) +
@@ -745,7 +745,7 @@
{
if( !palPtr->mapping )
- WARN("Palette %04x is not realized\n", dc->w.hPalette);
+ WARN("Palette %04x is not realized\n", dc->hPalette);
switch(spec_type) /* we have to peruse DC and system palette */
{
@@ -754,7 +754,7 @@
/* fall through to RGB */
case 0: /* RGB */
- if( dc && (dc->w.bitsPerPixel == 1) )
+ if( dc && (dc->bitsPerPixel == 1) )
{
GDI_ReleaseObj( hPal );
return (((color >> 16) & 0xff) +
diff --git a/graphics/x11drv/pen.c b/graphics/x11drv/pen.c
index 694a89f..eb3af60 100644
--- a/graphics/x11drv/pen.c
+++ b/graphics/x11drv/pen.c
@@ -22,10 +22,10 @@
*/
HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
{
- HPEN prevHandle = dc->w.hPen;
+ HPEN prevHandle = dc->hPen;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
- dc->w.hPen = hpen;
+ dc->hPen = hpen;
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;
diff --git a/graphics/x11drv/text.c b/graphics/x11drv/text.c
index 15faa3f..5235635 100644
--- a/graphics/x11drv/text.c
+++ b/graphics/x11drv/text.c
@@ -15,7 +15,6 @@
#include "windef.h"
#include "winnls.h"
-#include "dc.h"
#include "gdi.h"
#include "heap.h"
#include "x11font.h"
@@ -72,10 +71,10 @@
lprect->right, lprect->bottom );
/* Setup coordinates */
- if (dc->w.textAlign & TA_UPDATECP)
+ if (dc->textAlign & TA_UPDATECP)
{
- x = dc->w.CursPosX;
- y = dc->w.CursPosY;
+ x = dc->CursPosX;
+ y = dc->CursPosY;
}
if (flags & (ETO_OPAQUE | ETO_CLIPPED)) /* there's a rectangle */
@@ -117,7 +116,7 @@
dibUpdateFlag = TRUE;
TSXSetForeground( display, physDev->gc, physDev->backgroundPixel );
TSXFillRectangle( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + rect.left, dc->w.DCOrgY + rect.top,
+ dc->DCOrgX + rect.left, dc->DCOrgY + rect.top,
rect.right-rect.left, rect.bottom-rect.top );
}
if (!count) goto END; /* Nothing more to do */
@@ -144,20 +143,20 @@
ywidth = pfo->lpX11Trans ? width * pfo->lpX11Trans->b /
pfo->lpX11Trans->pixelsize : 0;
- switch( dc->w.textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER) )
+ switch( dc->textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER) )
{
case TA_LEFT:
- if (dc->w.textAlign & TA_UPDATECP) {
- dc->w.CursPosX = XDPTOLP( dc, x + xwidth );
- dc->w.CursPosY = YDPTOLP( dc, y - ywidth );
+ if (dc->textAlign & TA_UPDATECP) {
+ dc->CursPosX = XDPTOLP( dc, x + xwidth );
+ dc->CursPosY = YDPTOLP( dc, y - ywidth );
}
break;
case TA_RIGHT:
x -= xwidth;
y += ywidth;
- if (dc->w.textAlign & TA_UPDATECP) {
- dc->w.CursPosX = XDPTOLP( dc, x );
- dc->w.CursPosY = YDPTOLP( dc, y );
+ if (dc->textAlign & TA_UPDATECP) {
+ dc->CursPosX = XDPTOLP( dc, x );
+ dc->CursPosY = YDPTOLP( dc, y );
}
break;
case TA_CENTER:
@@ -166,7 +165,7 @@
break;
}
- switch( dc->w.textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE) )
+ switch( dc->textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE) )
{
case TA_TOP:
x -= pfo->lpX11Trans ? ascent * pfo->lpX11Trans->c /
@@ -201,7 +200,7 @@
dibUpdateFlag = TRUE;
}
- if (dc->w.backgroundMode != TRANSPARENT)
+ if (dc->backgroundMode != TRANSPARENT)
{
/* If rectangle is opaque and clipped, do nothing */
if (!(flags & ETO_CLIPPED) || !(flags & ETO_OPAQUE))
@@ -217,8 +216,8 @@
TSXSetForeground( display, physDev->gc,
physDev->backgroundPixel );
TSXFillRectangle( display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + x,
- dc->w.DCOrgY + y - ascent,
+ dc->DCOrgX + x,
+ dc->DCOrgY + y - ascent,
width,
ascent + descent );
}
@@ -232,11 +231,11 @@
TSXSetForeground( display, physDev->gc, physDev->textPixel );
if(!rotated)
{
- if (!dc->w.charExtra && !dc->w.breakExtra && !lpDx)
+ if (!dc->charExtra && !dc->breakExtra && !lpDx)
{
X11DRV_cptable[pfo->fi->cptable].pDrawString(
pfo, display, physDev->drawable, physDev->gc,
- dc->w.DCOrgX + x, dc->w.DCOrgY + y, str2b, count );
+ dc->DCOrgX + x, dc->DCOrgY + y, str2b, count );
}
else /* Now the fun begins... */
{
@@ -295,9 +294,9 @@
do
{
- delta += dc->w.charExtra;
+ delta += dc->charExtra;
if (str2b[i].byte2 == (char)dfBreakChar)
- delta += dc->w.breakExtra;
+ delta += dc->breakExtra;
pitem->nchars++;
} while ((++i < count) && !delta);
pitem++;
@@ -306,7 +305,7 @@
X11DRV_cptable[pfo->fi->cptable].pDrawText( pfo, display,
physDev->drawable, physDev->gc,
- dc->w.DCOrgX + x, dc->w.DCOrgY + y, items, pitem - items );
+ dc->DCOrgX + x, dc->DCOrgY + y, items, pitem - items );
HeapFree( GetProcessHeap(), 0, items );
}
}
@@ -320,9 +319,9 @@
{
int char_metric_offset = str2b[i].byte2 + (str2b[i].byte1 << 8)
- font->min_char_or_byte2;
- int x_i = IROUND((double) (dc->w.DCOrgX + x) + offset *
+ int x_i = IROUND((double) (dc->DCOrgX + x) + offset *
pfo->lpX11Trans->a / pfo->lpX11Trans->pixelsize );
- int y_i = IROUND((double) (dc->w.DCOrgY + y) - offset *
+ int y_i = IROUND((double) (dc->DCOrgY + y) - offset *
pfo->lpX11Trans->b / pfo->lpX11Trans->pixelsize );
X11DRV_cptable[pfo->fi->cptable].pDrawString(
@@ -336,9 +335,9 @@
font->per_char[char_metric_offset].attributes:
font->min_bounds.attributes)
* pfo->lpX11Trans->pixelsize / 1000.0;
- offset += dc->w.charExtra;
+ offset += dc->charExtra;
if (str2b[i].byte2 == (char)dfBreakChar)
- offset += dc->w.breakExtra;
+ offset += dc->breakExtra;
}
}
}
@@ -358,8 +357,8 @@
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 );
+ dc->DCOrgX + x, dc->DCOrgY + y + linePos,
+ dc->DCOrgX + x + width, dc->DCOrgY + y + linePos );
}
if (lfStrikeOut)
{
@@ -371,8 +370,8 @@
TSXSetLineAttributes( display, physDev->gc, lineAscent + lineDescent,
LineSolid, CapRound, JoinBevel );
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 );
+ dc->DCOrgX + x, dc->DCOrgY + y - lineAscent,
+ dc->DCOrgX + x + width, dc->DCOrgY + y - lineAscent );
}
if (flags & ETO_CLIPPED)
@@ -408,8 +407,8 @@
int info_width;
X11DRV_cptable[pfo->fi->cptable].pTextExtents( pfo, p,
count, &dir, &ascent, &descent, &info_width );
- size->cx = abs((info_width + dc->w.breakRem + count *
- dc->w.charExtra) * dc->wndExtX / dc->vportExtX);
+ size->cx = abs((info_width + dc->breakRem + count *
+ dc->charExtra) * dc->wndExtX / dc->vportExtX);
size->cy = abs((pfo->fs->ascent + pfo->fs->descent) *
dc->wndExtY / dc->vportExtY);
} else {
@@ -425,7 +424,7 @@
TRACE("x = %f y = %f\n", x, y);
x *= pfo->lpX11Trans->pixelsize / 1000.0;
y *= pfo->lpX11Trans->pixelsize / 1000.0;
- size->cx = fabs((x + dc->w.breakRem + count * dc->w.charExtra) *
+ size->cx = fabs((x + dc->breakRem + count * dc->charExtra) *
dc->wndExtX / dc->vportExtX);
size->cy = fabs(y * dc->wndExtY / dc->vportExtY);
}
diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c
index ff68a19..6edcd23 100644
--- a/graphics/x11drv/xfont.c
+++ b/graphics/x11drv/xfont.c
@@ -3071,7 +3071,7 @@
lf.lfHeight = MIN_FONT_SIZE;
}
else
- lf.lfHeight = -(DEF_POINT_SIZE * dc->w.devCaps->logPixelsY + (72>>1)) / 72;
+ lf.lfHeight = -(DEF_POINT_SIZE * dc->devCaps->logPixelsY + (72>>1)) / 72;
{
/* Fixup aliases before passing to RealizeFont */
@@ -3103,8 +3103,8 @@
font->logfont.lfCharSet = charsetMatched;
}
- hPrevFont = dc->w.hFont;
- dc->w.hFont = hfont;
+ hPrevFont = dc->hFont;
+ dc->hFont = hfont;
LeaveCriticalSection( &crtsc_fonts_X11 );