Commit 2239abb9 authored by Alexandre Julliard's avatar Alexandre Julliard

Allocate DC objects on the process heap, and removed WIN_DC_INFO

structure (based on a patch by Ken Coleman).
parent 47f5f000
......@@ -22,13 +22,12 @@
#include "winreg.h"
#include "debugtools.h"
#include "gdi.h"
#include "dc.h"
#include "callback.h"
#include "options.h"
#include "heap.h"
#include "file.h"
DEFAULT_DEBUG_CHANNEL(print)
DEFAULT_DEBUG_CHANNEL(print);
static char PrinterModel[] = "Printer Model";
static char DefaultDevMode[] = "Default DevMode";
......@@ -242,7 +241,7 @@ BOOL16 WINAPI QueryAbort16(HDC16 hdc, INT16 reserved)
return FALSE;
}
if (dc->w.pAbortProc) ret = dc->w.pAbortProc(hdc, 0);
if (dc->pAbortProc) ret = dc->pAbortProc(hdc, 0);
GDI_ReleaseObj( hdc );
return ret;
}
......@@ -270,8 +269,8 @@ INT WINAPI SetAbortProc(HDC hdc, ABORTPROC abrtprc)
{
DC *dc = DC_GetDCPtr( hdc );
if(dc->w.pAbortProc) THUNK_Free((FARPROC)dc->w.pAbortProc);
dc->w.pAbortProc = abrtprc;
if(dc->pAbortProc) THUNK_Free((FARPROC)dc->pAbortProc);
dc->pAbortProc = abrtprc;
GDI_ReleaseObj( hdc );
return TRUE;
}
......
......@@ -10,7 +10,6 @@
#include "config.h"
#include "debugtools.h"
#include "gdi.h"
#include "dc.h"
#include "windef.h"
#include "winerror.h"
#include "wine_gl.h"
......
......@@ -5,7 +5,7 @@
*/
#include "bitmap.h"
#include "dc.h"
#include "gdi.h"
#include "ttydrv.h"
#include "winbase.h"
#include "debugtools.h"
......@@ -124,7 +124,7 @@ HBITMAP TTYDRV_DC_BITMAP_SelectObject(DC *dc, HBITMAP hbitmap, BITMAPOBJ *bitmap
TRACE("(%p, 0x%04x, %p)\n", dc, hbitmap, bitmap);
if(!(dc->w.flags & DC_MEMORY))
if(!(dc->flags & DC_MEMORY))
return 0;
/* Assure that the bitmap device dependent */
......@@ -136,14 +136,14 @@ HBITMAP TTYDRV_DC_BITMAP_SelectObject(DC *dc, HBITMAP hbitmap, BITMAPOBJ *bitmap
return 0;
}
dc->w.totalExtent.left = 0;
dc->w.totalExtent.top = 0;
dc->w.totalExtent.right = bitmap->bitmap.bmWidth;
dc->w.totalExtent.bottom = bitmap->bitmap.bmHeight;
dc->totalExtent.left = 0;
dc->totalExtent.top = 0;
dc->totalExtent.right = bitmap->bitmap.bmWidth;
dc->totalExtent.bottom = bitmap->bitmap.bmHeight;
/* FIXME: Should be done in the common code instead */
if(dc->w.hVisRgn) {
SetRectRgn(dc->w.hVisRgn, 0, 0,
if(dc->hVisRgn) {
SetRectRgn(dc->hVisRgn, 0, 0,
bitmap->bitmap.bmWidth, bitmap->bitmap.bmHeight);
} else {
HRGN hrgn;
......@@ -151,11 +151,11 @@ HBITMAP TTYDRV_DC_BITMAP_SelectObject(DC *dc, HBITMAP hbitmap, BITMAPOBJ *bitmap
if(!(hrgn = CreateRectRgn(0, 0, bitmap->bitmap.bmWidth, bitmap->bitmap.bmHeight)))
return 0;
dc->w.hVisRgn = hrgn;
dc->hVisRgn = hrgn;
}
hPreviousBitmap = dc->w.hBitmap;
dc->w.hBitmap = hbitmap;
hPreviousBitmap = dc->hBitmap;
dc->hBitmap = hbitmap;
return hPreviousBitmap;
}
......
......@@ -8,7 +8,6 @@
#include "gdi.h"
#include "bitmap.h"
#include "dc.h"
#include "palette.h"
#include "ttydrv.h"
#include "winbase.h"
......@@ -214,36 +213,36 @@ BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
}
physDev = (TTYDRV_PDEVICE *) dc->physDev;
dc->w.devCaps = &TTYDRV_DC_DevCaps;
dc->devCaps = &TTYDRV_DC_DevCaps;
if(dc->w.flags & DC_MEMORY){
if(dc->flags & DC_MEMORY){
physDev->window = NULL;
physDev->cellWidth = 1;
physDev->cellHeight = 1;
TTYDRV_DC_CreateBitmap(dc->w.hBitmap);
bmp = (BITMAPOBJ *) GDI_GetObjPtr(dc->w.hBitmap, BITMAP_MAGIC);
TTYDRV_DC_CreateBitmap(dc->hBitmap);
bmp = (BITMAPOBJ *) GDI_GetObjPtr(dc->hBitmap, BITMAP_MAGIC);
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->window = TTYDRV_GetRootWindow();
physDev->cellWidth = cell_width;
physDev->cellHeight = cell_height;
dc->w.bitsPerPixel = 1;
dc->w.totalExtent.left = 0;
dc->w.totalExtent.top = 0;
dc->w.totalExtent.right = cell_width * screen_cols;
dc->w.totalExtent.bottom = cell_height * screen_rows;
dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
dc->bitsPerPixel = 1;
dc->totalExtent.left = 0;
dc->totalExtent.top = 0;
dc->totalExtent.right = cell_width * screen_cols;
dc->totalExtent.bottom = cell_height * screen_rows;
dc->hVisRgn = CreateRectRgnIndirect( &dc->totalExtent );
}
return TRUE;
......
......@@ -7,7 +7,7 @@
#include "config.h"
#include "wine/winestring.h"
#include "dc.h"
#include "gdi.h"
#include "heap.h"
#include "debugtools.h"
#include "ttydrv.h"
......@@ -84,10 +84,10 @@ BOOL TTYDRV_DC_LineTo(DC *dc, INT x, INT y)
if(!physDev->window)
return FALSE;
row1 = (dc->w.DCOrgY + XLPTODP(dc, dc->w.CursPosY)) / physDev->cellHeight;
col1 = (dc->w.DCOrgX + XLPTODP(dc, dc->w.CursPosX)) / physDev->cellWidth;
row2 = (dc->w.DCOrgY + XLPTODP(dc, y)) / physDev->cellHeight;
col2 = (dc->w.DCOrgX + XLPTODP(dc, x)) / physDev->cellWidth;
row1 = (dc->DCOrgY + XLPTODP(dc, dc->CursPosY)) / physDev->cellHeight;
col1 = (dc->DCOrgX + XLPTODP(dc, dc->CursPosX)) / physDev->cellWidth;
row2 = (dc->DCOrgY + XLPTODP(dc, y)) / physDev->cellHeight;
col2 = (dc->DCOrgX + XLPTODP(dc, x)) / physDev->cellWidth;
if(row1 > row2) {
INT tmp = row1;
......@@ -195,10 +195,10 @@ BOOL TTYDRV_DC_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
if(!physDev->window)
return FALSE;
row1 = (dc->w.DCOrgY + XLPTODP(dc, top)) / physDev->cellHeight;
col1 = (dc->w.DCOrgX + XLPTODP(dc, left)) / physDev->cellWidth;
row2 = (dc->w.DCOrgY + XLPTODP(dc, bottom)) / physDev->cellHeight;
col2 = (dc->w.DCOrgX + XLPTODP(dc, right)) / physDev->cellWidth;
row1 = (dc->DCOrgY + XLPTODP(dc, top)) / physDev->cellHeight;
col1 = (dc->DCOrgX + XLPTODP(dc, left)) / physDev->cellWidth;
row2 = (dc->DCOrgY + XLPTODP(dc, bottom)) / physDev->cellHeight;
col2 = (dc->DCOrgX + XLPTODP(dc, right)) / physDev->cellWidth;
if(row1 > row2) {
INT tmp = row1;
......@@ -259,8 +259,8 @@ COLORREF TTYDRV_DC_SetBkColor(DC *dc, COLORREF color)
TRACE("(%p, 0x%08lx)\n", dc, color);
oldColor = dc->w.backgroundColor;
dc->w.backgroundColor = color;
oldColor = dc->backgroundColor;
dc->backgroundColor = color;
return oldColor;
}
......@@ -279,8 +279,8 @@ COLORREF TTYDRV_DC_SetPixel(DC *dc, INT x, INT y, COLORREF color)
if(!physDev->window)
return FALSE;
row = (dc->w.DCOrgY + XLPTODP(dc, y)) / physDev->cellHeight;
col = (dc->w.DCOrgX + XLPTODP(dc, x)) / physDev->cellWidth;
row = (dc->DCOrgY + XLPTODP(dc, y)) / physDev->cellHeight;
col = (dc->DCOrgX + XLPTODP(dc, x)) / physDev->cellWidth;
mvwaddch(physDev->window, row, col, ACS_BULLET);
wrefresh(physDev->window);
......@@ -302,8 +302,8 @@ COLORREF TTYDRV_DC_SetTextColor(DC *dc, COLORREF color)
TRACE("(%p, 0x%08lx)\n", dc, color);
oldColor = dc->w.textColor;
dc->w.textColor = color;
oldColor = dc->textColor;
dc->textColor = color;
return oldColor;
}
......@@ -373,25 +373,25 @@ BOOL TTYDRV_DC_ExtTextOut(DC *dc, INT x, INT y, UINT flags,
return FALSE;
/* FIXME: Is this really correct? */
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);
y = YLPTODP(dc, y);
row = (dc->w.DCOrgY + y) / physDev->cellHeight;
col = (dc->w.DCOrgX + x) / physDev->cellWidth;
row = (dc->DCOrgY + y) / physDev->cellHeight;
col = (dc->DCOrgX + x) / physDev->cellWidth;
ascii = HeapAlloc( GetProcessHeap(), 0, count+1 );
lstrcpynWtoA(ascii, str, count+1);
mvwaddnstr(physDev->window, row, col, ascii, count);
HeapFree( GetProcessHeap(), 0, ascii );
wrefresh(physDev->window);
if(dc->w.textAlign & TA_UPDATECP) {
dc->w.CursPosX += count * physDev->cellWidth;
dc->w.CursPosY += physDev->cellHeight;
if(dc->textAlign & TA_UPDATECP) {
dc->CursPosX += count * physDev->cellWidth;
dc->CursPosY += physDev->cellHeight;
}
return TRUE;
......
......@@ -6,7 +6,6 @@
#include "bitmap.h"
#include "brush.h"
#include "dc.h"
#include "font.h"
#include "gdi.h"
#include "pen.h"
......@@ -30,8 +29,8 @@ static HBRUSH TTYDRV_DC_BRUSH_SelectObject(DC *dc, HBRUSH hbrush, BRUSHOBJ *brus
TRACE("(%p, 0x%04x, %p)\n", dc, hbrush, brush);
hPreviousBrush = dc->w.hBrush;
dc->w.hBrush = hbrush;
hPreviousBrush = dc->hBrush;
dc->hBrush = hbrush;
return hPreviousBrush;
}
......@@ -45,8 +44,8 @@ static HFONT TTYDRV_DC_FONT_SelectObject(DC* dc, HFONT hfont, FONTOBJ *font)
TRACE("(%p, 0x%04x, %p)\n", dc, hfont, font);
hPreviousFont = dc->w.hFont;
dc->w.hFont = hfont;
hPreviousFont = dc->hFont;
dc->hFont = hfont;
return hPreviousFont;
}
......@@ -60,8 +59,8 @@ static HPEN TTYDRV_DC_PEN_SelectObject(DC *dc, HBRUSH hpen, PENOBJ *pen)
TRACE("(%p, 0x%04x, %p)\n", dc, hpen, pen);
hPreviousPen = dc->w.hPen;
dc->w.hPen = hpen;
hPreviousPen = dc->hPen;
dc->hPen = hpen;
return hPreviousPen;
}
......
......@@ -40,8 +40,6 @@ struct DIDEVICEOBJECTDATA;
* TTY GDI driver
*/
extern struct tagGDI_DRIVER TTYDRV_GDI_Driver;
extern BOOL TTYDRV_GDI_Initialize(void);
extern void TTYDRV_GDI_Finalize(void);
......
......@@ -7,7 +7,7 @@
#include "config.h"
#include "class.h"
#include "dc.h"
#include "gdi.h"
#include "heap.h"
#include "ttydrv.h"
#include "win.h"
......@@ -232,15 +232,15 @@ void TTYDRV_WND_SetDrawable(WND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigi
/* FIXME: Should be done in the common code instead */
if(!wndPtr) {
dc->w.DCOrgX = 0;
dc->w.DCOrgY = 0;
dc->DCOrgX = 0;
dc->DCOrgY = 0;
} else {
if(flags & DCX_WINDOW) {
dc->w.DCOrgX = wndPtr->rectWindow.left;
dc->w.DCOrgY = wndPtr->rectWindow.top;
dc->DCOrgX = wndPtr->rectWindow.left;
dc->DCOrgY = wndPtr->rectWindow.top;
} else {
dc->w.DCOrgX = wndPtr->rectClient.left;
dc->w.DCOrgY = wndPtr->rectClient.top;
dc->DCOrgX = wndPtr->rectClient.left;
dc->DCOrgY = wndPtr->rectClient.top;
}
}
GDI_ReleaseObj( hdc );
......
......@@ -18,11 +18,11 @@ DEFAULT_DEBUG_CHANNEL(psdrv)
*/
HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
{
HBRUSH prevbrush = dc->w.hBrush;
HBRUSH prevbrush = dc->hBrush;
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
TRACE("hbrush = %08x\n", hbrush);
dc->w.hBrush = hbrush;
dc->hBrush = hbrush;
switch(brush->logbrush.lbStyle) {
......@@ -62,7 +62,7 @@ static BOOL PSDRV_SetBrush(DC *dc)
{
BOOL ret = TRUE;
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
BRUSHOBJ *brush = (BRUSHOBJ *)GDI_GetObjPtr( dc->w.hBrush, BRUSH_MAGIC );
BRUSHOBJ *brush = (BRUSHOBJ *)GDI_GetObjPtr( dc->hBrush, BRUSH_MAGIC );
if(!brush) {
ERR("Can't get BRUSHOBJ\n");
......@@ -84,7 +84,7 @@ static BOOL PSDRV_SetBrush(DC *dc)
}
physDev->brush.set = TRUE;
GDI_ReleaseObj( dc->w.hBrush );
GDI_ReleaseObj( dc->hBrush );
return TRUE;
}
......@@ -124,7 +124,7 @@ static BOOL PSDRV_Clip(DC *dc, BOOL EO)
BOOL PSDRV_Brush(DC *dc, BOOL EO)
{
BOOL ret = TRUE;
BRUSHOBJ *brush = (BRUSHOBJ *)GDI_GetObjPtr( dc->w.hBrush, BRUSH_MAGIC );
BRUSHOBJ *brush = (BRUSHOBJ *)GDI_GetObjPtr( dc->hBrush, BRUSH_MAGIC );
PSDRV_PDEVICE *physDev = dc->physDev;
if(!brush) {
......@@ -224,7 +224,7 @@ BOOL PSDRV_Brush(DC *dc, BOOL EO)
break;
}
GDI_ReleaseObj( dc->w.hBrush );
GDI_ReleaseObj( dc->hBrush );
return ret;
}
......
......@@ -23,12 +23,12 @@ VOID PSDRV_SetDeviceClipping( DC *dc )
TRACE("hdc=%04x\n", dc->hSelf);
if (dc->w.hGCClipRgn == 0) {
if (dc->hGCClipRgn == 0) {
ERR("Rgn is 0. Please report this.\n");
return;
}
size = GetRegionData(dc->w.hGCClipRgn, 0, NULL);
size = GetRegionData(dc->hGCClipRgn, 0, NULL);
if(!size) {
ERR("Invalid region\n");
return;
......@@ -40,7 +40,7 @@ VOID PSDRV_SetDeviceClipping( DC *dc )
return;
}
GetRegionData(dc->w.hGCClipRgn, size, rgndata);
GetRegionData(dc->hGCClipRgn, size, rgndata);
PSDRV_WriteInitClip(dc);
......
......@@ -109,8 +109,8 @@ COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color )
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
COLORREF oldColor;
oldColor = dc->w.backgroundColor;
dc->w.backgroundColor = color;
oldColor = dc->backgroundColor;
dc->backgroundColor = color;
PSDRV_CreateColor(physDev, &physDev->bkColor, color);
......@@ -126,8 +126,8 @@ COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color )
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
COLORREF oldColor;
oldColor = dc->w.textColor;
dc->w.textColor = color;
oldColor = dc->textColor;
dc->textColor = color;
PSDRV_CreateColor(physDev, &physDev->font.color, color);
physDev->font.set = FALSE;
......
......@@ -27,8 +27,8 @@ INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
physDev->job.banding = TRUE;
r->left = 0;
r->top = 0;
r->right = dc->w.devCaps->horzRes;
r->bottom = dc->w.devCaps->vertRes;
r->right = dc->devCaps->horzRes;
r->bottom = dc->devCaps->vertRes;
TRACE("NEXTBAND returning %d,%d - %d,%d\n", r->left,
r->top, r->right, r->bottom );
return 1;
......@@ -127,8 +127,8 @@ INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
{
POINT16 *p = (POINT16 *)PTR_SEG_TO_LIN(lpOutData);
p->x = dc->w.devCaps->horzRes;
p->y = dc->w.devCaps->vertRes;
p->x = dc->devCaps->horzRes;
p->y = dc->devCaps->vertRes;
TRACE("GETPHYSPAGESIZE: returning %dx%d\n", p->x, p->y);
return 1;
}
......
......@@ -8,11 +8,10 @@
#include "winspool.h"
#include "psdrv.h"
#include "debugtools.h"
#include "dc.h"
#include "gdi.h"
#include "winerror.h"
DEFAULT_DEBUG_CHANNEL(psdrv)
DEFAULT_DEBUG_CHANNEL(psdrv);
/***********************************************************************
......@@ -21,7 +20,7 @@ DEFAULT_DEBUG_CHANNEL(psdrv)
HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
FONTOBJ *font )
{
HFONT16 prevfont = dc->w.hFont;
HFONT16 prevfont = dc->hFont;
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
LOGFONT16 *lf = &(font->logfont);
BOOL bd = FALSE, it = FALSE;
......@@ -34,7 +33,7 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
TRACE("FaceName = '%s' Height = %d Italic = %d Weight = %d\n",
lf->lfFaceName, lf->lfHeight, lf->lfItalic, lf->lfWeight);
dc->w.hFont = hfont;
dc->hFont = hfont;
if(lf->lfItalic)
it = TRUE;
......@@ -143,8 +142,8 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
physDev->font.tm.tmPitchAndFamily |= TMPF_DEVICE;
physDev->font.tm.tmCharSet = ANSI_CHARSET;
physDev->font.tm.tmOverhang = 0;
physDev->font.tm.tmDigitizedAspectX = dc->w.devCaps->logPixelsY;
physDev->font.tm.tmDigitizedAspectY = dc->w.devCaps->logPixelsX;
physDev->font.tm.tmDigitizedAspectX = dc->devCaps->logPixelsY;
physDev->font.tm.tmDigitizedAspectY = dc->devCaps->logPixelsX;
physDev->font.set = FALSE;
......@@ -301,8 +300,8 @@ static UINT PSDRV_GetFontMetric(HDC hdc, AFM *pafm, NEWTEXTMETRIC16 *pTM,
pTM->tmDescent = -pafm->Descender * scale;
pTM->tmInternalLeading = (pafm->FullAscender - pafm->Ascender) * scale;
pTM->tmMaxCharWidth = pafm->CharWidths[77] * scale;
pTM->tmDigitizedAspectX = dc->w.devCaps->logPixelsY;
pTM->tmDigitizedAspectY = dc->w.devCaps->logPixelsX;
pTM->tmDigitizedAspectX = dc->devCaps->logPixelsY;
pTM->tmDigitizedAspectY = dc->devCaps->logPixelsX;
*(INT*)&pTM->tmFirstChar = 32;
......
......@@ -28,8 +28,8 @@ BOOL PSDRV_LineTo(DC *dc, INT x, INT y)
TRACE("%d %d\n", x, y);
PSDRV_SetPen(dc);
PSDRV_WriteMoveTo(dc, XLPTODP(dc, dc->w.CursPosX),
YLPTODP(dc, dc->w.CursPosY));
PSDRV_WriteMoveTo(dc, XLPTODP(dc, dc->CursPosX),
YLPTODP(dc, dc->CursPosY));
PSDRV_WriteLineTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
PSDRV_DrawLine(dc);
......@@ -259,7 +259,7 @@ BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
PSDRV_WriteClosePath(dc);
}
if(dc->w.polyFillMode == ALTERNATE)
if(dc->polyFillMode == ALTERNATE)
PSDRV_Brush(dc, 1);
else /* WINDING */
PSDRV_Brush(dc, 0);
......
......@@ -347,12 +347,12 @@ static BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
/* etc */
dc->w.devCaps = devCaps;
dc->devCaps = devCaps;
dc->w.hVisRgn = CreateRectRgn(0, 0, dc->w.devCaps->horzRes,
dc->w.devCaps->vertRes);
dc->hVisRgn = CreateRectRgn(0, 0, dc->devCaps->horzRes,
dc->devCaps->vertRes);
dc->w.hFont = PSDRV_DefaultFont;
dc->hFont = PSDRV_DefaultFont;
physDev->job.output = output ?
HEAP_strdupA( PSDRV_Heap, 0, output ) :
HEAP_strdupA( PSDRV_Heap, 0, "LPT1:" ); /* HACK */
......@@ -372,7 +372,7 @@ static BOOL PSDRV_DeleteDC( DC *dc )
HeapFree( PSDRV_Heap, 0, physDev->Devmode );
HeapFree( PSDRV_Heap, 0, physDev->job.output );
HeapFree( PSDRV_Heap, 0, (void *)dc->w.devCaps );
HeapFree( PSDRV_Heap, 0, (void *)dc->devCaps );
HeapFree( PSDRV_Heap, 0, physDev );
dc->physDev = NULL;
......
......@@ -22,11 +22,11 @@ static char PEN_alternate[] = "1";
*/
extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
{
HPEN prevpen = dc->w.hPen;
HPEN prevpen = dc->hPen;
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
TRACE("hpen = %08x colour = %08lx\n", hpen, pen->logpen.lopnColor);
dc->w.hPen = hpen;
dc->hPen = hpen;
physDev->pen.width = XLSTODS(dc, pen->logpen.lopnWidth.x);
if(physDev->pen.width < 0)
......
......@@ -310,12 +310,12 @@ INT PSDRV_WriteHeader( DC *dc, LPCSTR title )
if(physDev->Devmode->dmPublic.u1.s1.dmOrientation == DMORIENT_LANDSCAPE) {
/* BBox co-ords are in default user co-ord system so urx < ury even in
landscape mode */
urx = (int) (dc->w.devCaps->vertSize * 72.0 / 25.4);
ury = (int) (dc->w.devCaps->horzSize * 72.0 / 25.4);
urx = (int) (dc->devCaps->vertSize * 72.0 / 25.4);
ury = (int) (dc->devCaps->horzSize * 72.0 / 25.4);
orient = "Landscape";
} else {
urx = (int) (dc->w.devCaps->horzSize * 72.0 / 25.4);
ury = (int) (dc->w.devCaps->vertSize * 72.0 / 25.4);
urx = (int) (dc->devCaps->horzSize * 72.0 / 25.4);
ury = (int) (dc->devCaps->vertSize * 72.0 / 25.4);
orient = "Portrait";
}
......@@ -440,8 +440,8 @@ INT PSDRV_WriteNewPage( DC *dc )
if(physDev->Devmode->dmPublic.u1.s1.dmOrientation == DMORIENT_LANDSCAPE) {
if(physDev->pi->ppd->LandscapeOrientation == -90) {
xtrans = dc->w.devCaps->vertRes;
ytrans = dc->w.devCaps->horzRes;
xtrans = dc->devCaps->vertRes;
ytrans = dc->devCaps->horzRes;
rotation = 90;
} else {
xtrans = ytrans = 0;
......@@ -449,12 +449,12 @@ INT PSDRV_WriteNewPage( DC *dc )
}
} else {
xtrans = 0;
ytrans = dc->w.devCaps->vertRes;
ytrans = dc->devCaps->vertRes;
rotation = 0;
}
sprintf(buf, psnewpage, name, physDev->job.PageNo,
dc->w.devCaps->logPixelsX, dc->w.devCaps->logPixelsY,
dc->devCaps->logPixelsX, dc->devCaps->logPixelsY,
xtrans, ytrans, rotation);
if( WriteSpool16( physDev->job.hJob, buf, strlen(buf) ) !=
......@@ -957,8 +957,8 @@ BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits)
sprintf(buf, start, w, h, w, h);
PSDRV_WriteSpool(dc, buf, strlen(buf));
PSDRV_WriteIndexColorSpaceBegin(dc, 1);
map[0] = dc->w.textColor;
map[1] = dc->w.backgroundColor;
map[0] = dc->textColor;
map[1] = dc->backgroundColor;
PSDRV_WriteRGB(dc, map, 2);
PSDRV_WriteIndexColorSpaceEnd(dc);
ptr = buf;
......
......@@ -87,9 +87,9 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
return FALSE;
}
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);
......@@ -99,10 +99,10 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
sz.cx = XLSTODS(dc, sz.cx);
sz.cy = YLSTODS(dc, sz.cy);
switch(dc->w.textAlign & (TA_LEFT | TA_CENTER | TA_RIGHT) ) {
switch(dc->textAlign & (TA_LEFT | TA_CENTER | TA_RIGHT) ) {
case TA_LEFT:
if(dc->w.textAlign & TA_UPDATECP)
dc->w.CursPosX = XDPTOLP(dc, x + sz.cx);
if(dc->textAlign & TA_UPDATECP)
dc->CursPosX = XDPTOLP(dc, x + sz.cx);
break;
case TA_CENTER:
......@@ -111,12 +111,12 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
case TA_RIGHT:
x -= sz.cx;
if(dc->w.textAlign & TA_UPDATECP)
dc->w.CursPosX = XDPTOLP(dc, x);
if(dc->textAlign & TA_UPDATECP)
dc->CursPosX = XDPTOLP(dc, x);
break;
}
switch(dc->w.textAlign & (TA_TOP | TA_BASELINE | TA_BOTTOM) ) {
switch(dc->textAlign & (TA_TOP | TA_BASELINE | TA_BOTTOM) ) {
case TA_TOP:
y += physDev->font.tm.tmAscent;
break;
......@@ -132,7 +132,7 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
memcpy(strbuf, str, count * sizeof(WCHAR));
*(strbuf + count) = '\0';
if ((dc->w.backgroundMode != TRANSPARENT) && (bDrawBackground != FALSE))
if ((dc->backgroundMode != TRANSPARENT) && (bDrawBackground != FALSE))
{
PSDRV_WriteGSave(dc);
PSDRV_WriteNewPath(dc);
......
......@@ -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 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
{
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 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
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)
......
......@@ -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 @@ EMFDRV_LineTo( DC *dc, INT x, INT y )
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 @@ EMFDRV_ArcChordPie( DC *dc, INT left, INT top, INT right, INT bottom,
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 @@ EMFDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
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 @@ EMFDRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
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 @@ EMFDRV_RoundRect( DC *dc, INT left, INT top, INT right,
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--;
}
......
......@@ -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 =
{
......
......@@ -129,8 +129,8 @@ static HBRUSH EMFDRV_BRUSH_SelectObject(DC *dc, HBRUSH hBrush )
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 @@ static HFONT EMFDRV_FONT_SelectObject( DC * dc, HFONT hFont )
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 @@ static HPEN EMFDRV_PEN_SelectObject(DC *dc, HPEN hPen )
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
return FALSE;
hOldPen = dc->w.hPen;
dc->w.hPen = hPen;
hOldPen = dc->hPen;
dc->hPen = hPen;
return hOldPen;
}
......
......@@ -10,7 +10,6 @@
#include "gdi.h"
#include "heap.h"
#include "ldt.h"
#include "dc.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(driver);
......
......@@ -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 @@ DEFAULT_DEBUG_CHANNEL(gdi)
*/
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 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
TRACE("%04x %d\n", hdc, mode );
prevMode = dc->w.MapMode;
prevMode = dc->MapMode;
switch(mode)
{
case MM_TEXT:
......@@ -146,38 +146,38 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
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 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
default:
goto done;
}
dc->w.MapMode = mode;
dc->MapMode = mode;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc );
......@@ -235,7 +235,7 @@ BOOL WINAPI SetViewportExtEx( HDC hdc, INT x, INT y, LPSIZE size )
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 @@ BOOL WINAPI SetViewportExtEx( HDC hdc, INT x, INT y, LPSIZE size )
}
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 @@ BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
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 @@ BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
}
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 @@ BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom,
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 @@ BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom,
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 @@ BOOL WINAPI ScaleWindowExtEx( HDC hdc, INT xNum, INT xDenom,
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 @@ BOOL WINAPI ScaleWindowExtEx( HDC hdc, INT xNum, INT xDenom,
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 );
......
......@@ -37,7 +37,7 @@ BOOL MFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst, INT width, INT height,
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 @@ BOOL MFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst, INT width, INT height,
*(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 @@ BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
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 @@ BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
*(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
{
......
......@@ -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
......
......@@ -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>
......
......@@ -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;
}
......
......@@ -184,7 +184,7 @@ static BOOL MFDRV_CreateFontIndirect(DC *dc, HFONT16 hFont, LOGFONT16 *logfont)
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 BOOL MFDRV_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN16 *logpen)
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;
......
......@@ -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 @@ BOOL WINAPI LineTo( HDC hdc, INT x, INT y )
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 @@ BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, LPPOINT pt )
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 @@ BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right,
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 @@ BOOL WINAPI Pie( HDC hdc, INT left, INT top,
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 @@ BOOL WINAPI Chord( HDC hdc, INT left, INT top,
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 @@ BOOL WINAPI Ellipse( HDC hdc, INT left, INT top,
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 @@ BOOL WINAPI Rectangle( HDC hdc, INT left, INT top,
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 @@ BOOL WINAPI RoundRect( HDC hdc, INT left, INT top, INT right,
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 @@ BOOL WINAPI Polyline( HDC hdc, const POINT* pt, INT count )
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 @@ BOOL WINAPI PolylineTo( HDC hdc, const POINT* pt, DWORD cCount )
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 @@ BOOL WINAPI PolylineTo( HDC hdc, const POINT* pt, DWORD cCount )
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 @@ BOOL WINAPI Polygon( HDC hdc, const POINT* pt, INT count )
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 @@ BOOL WINAPI PolyPolygon( HDC hdc, const POINT* pt, const INT* counts,
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 @@ BOOL WINAPI PolyPolyline( HDC hdc, const POINT* pt, const DWORD* counts,
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 @@ BOOL WINAPI PolyBezier( HDC hdc, const POINT* lppt, DWORD cPoints )
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 @@ BOOL WINAPI PolyBezierTo( HDC hdc, const POINT* lppt, DWORD cPoints )
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 @@ BOOL WINAPI PolyBezierTo( HDC hdc, const POINT* lppt, DWORD cPoints )
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 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
}
/* 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 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
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 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
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 );
......
......@@ -16,10 +16,10 @@ HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
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;
......
......@@ -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 @@ BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics )
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);
......
......@@ -19,11 +19,11 @@ WIN16DRV_MoveToEx(DC *dc,INT x,INT y,LPPOINT pt)
{
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 @@ WIN16DRV_LineTo( DC *dc, INT x, INT y )
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 @@ WIN16DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
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 @@ WIN16DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
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 @@ WIN16DRV_Polygon(DC *dc, const POINT* pt, INT count )
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 @@ WIN16DRV_Polyline(DC *dc, const POINT* pt, INT count )
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 @@ WIN16DRV_Ellipse(DC *dc, INT left, INT top, INT right, INT bottom)
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 @@ WIN16DRV_Ellipse(DC *dc, INT left, INT top, INT right, INT bottom)
OS_ELLIPSE, 2, points,
physDev->PenInfo,
physDev->BrushInfo,
win16drv_SegPtr_DrawMode, dc->w.hClipRgn);
win16drv_SegPtr_DrawMode, dc->hClipRgn);
return bRet;
}
......
......@@ -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 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
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);
......
......@@ -17,10 +17,10 @@ DEFAULT_DEBUG_CHANNEL(win16drv)
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;
......
......@@ -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 @@ BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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:
......
......@@ -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 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
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 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
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;
......
......@@ -151,7 +151,7 @@ static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
{
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 @@ static BOOL BRUSH_SelectPatternBrush( DC * dc, HBITMAP hbitmap )
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 @@ HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
{
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)
{
......
......@@ -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 @@ void X11DRV_SetDeviceClipping( DC * dc )
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 @@ void X11DRV_SetDeviceClipping( DC * dc )
if(!pXrect)
{
WARN("Can't alloc buffer\n");
GDI_ReleaseObj( dc->w.hGCClipRgn );
GDI_ReleaseObj( dc->hGCClipRgn );
return;
}
......@@ -70,6 +70,6 @@ void X11DRV_SetDeviceClipping( DC * dc )
if(pXrect)
HeapFree( GetProcessHeap(), 0, pXrect );
GDI_ReleaseObj( dc->w.hGCClipRgn );
GDI_ReleaseObj( dc->hGCClipRgn );
}
......@@ -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 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
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 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
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 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
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 X11DRV_DIB_GetDIBits(
(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 @@ INT X11DRV_DIB_GetDIBits(
info->bmiHeader.biCompression = 0;
done:
GDI_ReleaseObj( dc->w.hPalette );
GDI_ReleaseObj( dc->hPalette );
return lines;
}
......@@ -3292,9 +3292,9 @@ void X11DRV_DIB_UpdateDIBSection(DC *dc, BOOL toDIB)
/* 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);
}
/***********************************************************************
......
......@@ -243,45 +243,45 @@ static BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
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 );
......
......@@ -669,7 +669,7 @@ COLORREF X11DRV_PALETTE_ToLogical(int pixel)
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 @@ int X11DRV_PALETTE_ToPhysical( DC *dc, COLORREF color )
/* 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 @@ int X11DRV_PALETTE_ToPhysical( DC *dc, COLORREF color )
{
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 @@ int X11DRV_PALETTE_ToPhysical( DC *dc, COLORREF color )
/* 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) +
......
......@@ -22,10 +22,10 @@ static const char PEN_alternate[] = { 1,1 }; /* FIXME */
*/
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;
......
......@@ -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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
{
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
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 @@ BOOL X11DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
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 @@ BOOL X11DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
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);
}
......
......@@ -3071,7 +3071,7 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont, FONTOBJ* font )
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 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont, FONTOBJ* font )
font->logfont.lfCharSet = charsetMatched;
}
hPrevFont = dc->w.hFont;
dc->w.hFont = hfont;
hPrevFont = dc->hFont;
dc->hFont = hfont;
LeaveCriticalSection( &crtsc_fonts_X11 );
......
/*
* GDI Device Context function prototypes
*
* Copyright 1994 Alexandre Julliard
*
*/
#ifndef __WINE_DC_H
#define __WINE_DC_H
#include "gdi.h"
#define CLIP_INTERSECT 0x0001
#define CLIP_EXCLUDE 0x0002
#define CLIP_KEEPRGN 0x0004
extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs );
extern DC * DC_GetDCPtr( HDC hdc );
extern DC * DC_GetDCUpdate( HDC hdc );
extern void DC_InitDC( DC * dc );
extern void DC_UpdateXforms( DC * dc );
/* objects/clipping.c */
INT CLIPPING_IntersectClipRect( DC * dc, INT left, INT top,
INT right, INT bottom, UINT flags );
INT CLIPPING_IntersectVisRect( DC * dc, INT left, INT top,
INT right, INT bottom, BOOL exclude );
extern void CLIPPING_UpdateGCRegion( DC * dc );
#endif /* __WINE_DC_H */
......@@ -84,17 +84,28 @@ typedef struct tagDeviceCaps
WORD colorRes; /* 108: color resolution */
} DeviceCaps;
typedef struct tagGDI_DRIVER
typedef BOOL16 CALLBACK (*DCHOOKPROC)(HDC16,WORD,DWORD,LPARAM);
typedef struct tagDC
{
BOOL (*pInitialize)(void);
void (*pFinalize)(void);
} GDI_DRIVER;
GDIOBJHDR header;
HDC hSelf; /* Handle to this DC */
const struct tagDC_FUNCS *funcs; /* DC function table */
void *physDev; /* Physical device (driver-specific) */
INT saveLevel;
DWORD dwHookData;
FARPROC16 hookProc; /* the original SEGPTR ... */
DCHOOKPROC hookThunk; /* ... and the thunk to call it */
extern GDI_DRIVER *GDI_Driver;
INT wndOrgX; /* Window origin */
INT wndOrgY;
INT wndExtX; /* Window extent */
INT wndExtY;
INT vportOrgX; /* Viewport origin */
INT vportOrgY;
INT vportExtX; /* Viewport extent */
INT vportExtY;
/* Device independent DC information */
typedef struct
{
int flags;
const DeviceCaps *devCaps;
......@@ -107,7 +118,7 @@ typedef struct
HBITMAP16 hBitmap;
HANDLE16 hDevice;
HPALETTE16 hPalette;
GdiPath path;
WORD ROPmode;
......@@ -142,32 +153,6 @@ typedef struct
XFORM xformWorld2Vport; /* World-to-viewport transformation */
XFORM xformVport2World; /* Inverse of the above transformation */
BOOL vport2WorldValid; /* Is xformVport2World valid? */
} WIN_DC_INFO;
typedef BOOL16 CALLBACK (*DCHOOKPROC)(HDC16,WORD,DWORD,LPARAM);
typedef struct tagDC
{
GDIOBJHDR header;
HDC hSelf; /* Handle to this DC */
const struct tagDC_FUNCS *funcs; /* DC function table */
void *physDev; /* Physical device (driver-specific) */
INT saveLevel;
DWORD dwHookData;
FARPROC16 hookProc; /* the original SEGPTR ... */
DCHOOKPROC hookThunk; /* ... and the thunk to call it */
INT wndOrgX; /* Window origin */
INT wndOrgY;
INT wndExtX; /* Window extent */
INT wndExtY;
INT vportOrgX; /* Viewport origin */
INT vportOrgY;
INT vportExtX; /* Viewport extent */
INT vportExtY;
WIN_DC_INFO w;
} DC;
/* Device functions for the Wine driver interface */
......@@ -359,18 +344,18 @@ static inline BOOL WINE_UNUSED INTERNAL_DPTOLP_FLOAT(DC *dc, FLOAT_POINT *point)
FLOAT x, y;
/* Check that the viewport-to-world transformation is valid */
if (!dc->w.vport2WorldValid)
if (!dc->vport2WorldValid)
return FALSE;
/* Perform the transformation */
x = point->x;
y = point->y;
point->x = x * dc->w.xformVport2World.eM11 +
y * dc->w.xformVport2World.eM21 +
dc->w.xformVport2World.eDx;
point->y = x * dc->w.xformVport2World.eM12 +
y * dc->w.xformVport2World.eM22 +
dc->w.xformVport2World.eDy;
point->x = x * dc->xformVport2World.eM11 +
y * dc->xformVport2World.eM21 +
dc->xformVport2World.eDx;
point->y = x * dc->xformVport2World.eM12 +
y * dc->xformVport2World.eM22 +
dc->xformVport2World.eDy;
return TRUE;
}
......@@ -405,12 +390,12 @@ static inline void WINE_UNUSED INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point)
/* Perform the transformation */
x = point->x;
y = point->y;
point->x = x * dc->w.xformWorld2Vport.eM11 +
y * dc->w.xformWorld2Vport.eM21 +
dc->w.xformWorld2Vport.eDx;
point->y = x * dc->w.xformWorld2Vport.eM12 +
y * dc->w.xformWorld2Vport.eM22 +
dc->w.xformWorld2Vport.eDy;
point->x = x * dc->xformWorld2Vport.eM11 +
y * dc->xformWorld2Vport.eM21 +
dc->xformWorld2Vport.eDx;
point->y = x * dc->xformWorld2Vport.eM12 +
y * dc->xformWorld2Vport.eM22 +
dc->xformWorld2Vport.eDy;
}
/* Performs a world-to-viewport transformation on the specified point (which
......@@ -466,5 +451,22 @@ extern BOOL DRIVER_GetDriverName( LPCSTR device, LPSTR driver, DWORD size );
extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut );
extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs );
extern DC * DC_GetDCPtr( HDC hdc );
extern DC * DC_GetDCUpdate( HDC hdc );
extern void DC_InitDC( DC * dc );
extern void DC_UpdateXforms( DC * dc );
#define CLIP_INTERSECT 0x0001
#define CLIP_EXCLUDE 0x0002
#define CLIP_KEEPRGN 0x0004
/* objects/clipping.c */
INT CLIPPING_IntersectClipRect( DC * dc, INT left, INT top,
INT right, INT bottom, UINT flags );
INT CLIPPING_IntersectVisRect( DC * dc, INT left, INT top,
INT right, INT bottom, BOOL exclude );
extern void CLIPPING_UpdateGCRegion( DC * dc );
#endif /* __WINE_GDI_H */
......@@ -10,7 +10,6 @@
#include "wine/winbase16.h"
#include "gdi.h"
#include "dc.h"
#include "bitmap.h"
#include "heap.h"
#include "global.h"
......@@ -185,7 +184,7 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height)
if (!width || !height)
hbmpRet = CreateBitmap( 1, 1, 1, 1, NULL );
else
hbmpRet = CreateBitmap( width, height, 1, dc->w.bitsPerPixel, NULL );
hbmpRet = CreateBitmap( width, height, 1, dc->bitsPerPixel, NULL );
if(dc->funcs->pCreateBitmap)
dc->funcs->pCreateBitmap( hbmpRet );
}
......
......@@ -313,11 +313,11 @@ HBRUSH WINAPI CreateSolidBrush( COLORREF color )
DWORD WINAPI SetBrushOrg16( HDC16 hdc, INT16 x, INT16 y )
{
DWORD retval;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE;
retval = dc->w.brushOrgX | (dc->w.brushOrgY << 16);
dc->w.brushOrgX = x;
dc->w.brushOrgY = y;
retval = dc->brushOrgX | (dc->brushOrgY << 16);
dc->brushOrgX = x;
dc->brushOrgY = y;
GDI_ReleaseObj( hdc );
return retval;
}
......@@ -328,16 +328,16 @@ DWORD WINAPI SetBrushOrg16( HDC16 hdc, INT16 x, INT16 y )
*/
BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE;
if (oldorg)
{
oldorg->x = dc->w.brushOrgX;
oldorg->y = dc->w.brushOrgY;
oldorg->x = dc->brushOrgX;
oldorg->y = dc->brushOrgY;
}
dc->w.brushOrgX = x;
dc->w.brushOrgY = y;
dc->brushOrgX = x;
dc->brushOrgY = y;
GDI_ReleaseObj( hdc );
return TRUE;
}
......
......@@ -8,7 +8,6 @@
#include "winbase.h"
#include "winerror.h"
#include "gdi.h"
#include "dc.h"
#define COLORREF16 COLORREF /*hack*/
......@@ -16,7 +15,7 @@
func_type WINAPI func_name( HDC16 hdc ) \
{ \
func_type ret = 0; \
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); \
DC * dc = DC_GetDCPtr( hdc ); \
if (dc) \
{ \
ret = dc->dc_field; \
......@@ -34,7 +33,7 @@ func_type##16 WINAPI func_name##16( HDC16 hdc ) \
func_type WINAPI func_name( HDC hdc ) \
{ \
func_type ret = 0; \
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); \
DC * dc = DC_GetDCPtr( hdc ); \
if (dc) \
{ \
ret = dc->dc_field; \
......@@ -47,7 +46,7 @@ func_type WINAPI func_name( HDC hdc ) \
func_type WINAPI func_name( HDC16 hdc ) \
{ \
func_type ret = 0; \
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); \
DC * dc = DC_GetDCPtr( hdc ); \
if (dc) \
{ \
ret = MAKELONG( dc->ret_x, dc->ret_y ); \
......@@ -63,7 +62,7 @@ func_type WINAPI func_name( HDC16 hdc ) \
#define DC_GET_VAL_EX( func_name, ret_x, ret_y, type ) \
BOOL16 WINAPI func_name##16( HDC16 hdc, LP##type##16 pt ) \
{ \
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); \
DC * dc = DC_GetDCPtr( hdc ); \
if (!dc) return FALSE; \
((LPPOINT16)pt)->x = dc->ret_x; \
((LPPOINT16)pt)->y = dc->ret_y; \
......@@ -73,7 +72,7 @@ BOOL16 WINAPI func_name##16( HDC16 hdc, LP##type##16 pt ) \
\
BOOL WINAPI func_name( HDC hdc, LP##type pt ) \
{ \
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); \
DC * dc = DC_GetDCPtr( hdc ); \
if (!dc) return FALSE; \
((LPPOINT)pt)->x = dc->ret_x; \
((LPPOINT)pt)->y = dc->ret_y; \
......@@ -110,72 +109,72 @@ INT WINAPI func_name( HDC hdc, INT mode ) \
* SetBkMode (GDI.2) (GDI32.306)
*
*/
DC_SET_MODE( SetBkMode, w.backgroundMode, TRANSPARENT, OPAQUE )
DC_SET_MODE( SetBkMode, backgroundMode, TRANSPARENT, OPAQUE )
/***********************************************************************
* SetROP2 (GDI.4) (GDI32.331)
*/
DC_SET_MODE( SetROP2, w.ROPmode, R2_BLACK, R2_WHITE )
DC_SET_MODE( SetROP2, ROPmode, R2_BLACK, R2_WHITE )
/***********************************************************************
* SetRelAbs (GDI.5) (GDI32.333)
*/
DC_SET_MODE( SetRelAbs, w.relAbsMode, ABSOLUTE, RELATIVE )
DC_SET_MODE( SetRelAbs, relAbsMode, ABSOLUTE, RELATIVE )
/***********************************************************************
* SetPolyFillMode (GDI.6) (GDI32.330)
*/
DC_SET_MODE( SetPolyFillMode, w.polyFillMode, ALTERNATE, WINDING )
DC_SET_MODE( SetPolyFillMode, polyFillMode, ALTERNATE, WINDING )
/***********************************************************************
* SetStretchBltMode (GDI.7) (GDI32.334)
*/
DC_SET_MODE( SetStretchBltMode, w.stretchBltMode, BLACKONWHITE, HALFTONE )
DC_SET_MODE( SetStretchBltMode, stretchBltMode, BLACKONWHITE, HALFTONE )
/***********************************************************************
* GetBkColor (GDI.75) (GDI32.145)
*/
DC_GET_VAL( COLORREF, GetBkColor, w.backgroundColor )
DC_GET_VAL( COLORREF, GetBkColor, backgroundColor )
/***********************************************************************
* GetBkMode (GDI.76) (GDI32.146)
*/
DC_GET_VAL( INT, GetBkMode, w.backgroundMode )
DC_GET_VAL( INT, GetBkMode, backgroundMode )
/***********************************************************************
* GetCurrentPosition16 (GDI.78)
*/
DC_GET_X_Y( DWORD, GetCurrentPosition16, w.CursPosX, w.CursPosY )
DC_GET_X_Y( DWORD, GetCurrentPosition16, CursPosX, CursPosY )
/***********************************************************************
* GetMapMode (GDI.81) (GDI32.196)
*/
DC_GET_VAL( INT, GetMapMode, w.MapMode )
DC_GET_VAL( INT, GetMapMode, MapMode )
/***********************************************************************
* GetPolyFillMode (GDI.84) (GDI32.213)
*/
DC_GET_VAL( INT, GetPolyFillMode, w.polyFillMode )
DC_GET_VAL( INT, GetPolyFillMode, polyFillMode )
/***********************************************************************
* GetROP2 (GDI.85) (GDI32.214)
*/
DC_GET_VAL( INT, GetROP2, w.ROPmode )
DC_GET_VAL( INT, GetROP2, ROPmode )
/***********************************************************************
* GetRelAbs16 (GDI.86)
*/
DC_GET_VAL_16( INT16, GetRelAbs16, w.relAbsMode )
DC_GET_VAL_16( INT16, GetRelAbs16, relAbsMode )
/***********************************************************************
* GetStretchBltMode (GDI.88) (GDI32.221)
*/
DC_GET_VAL( INT, GetStretchBltMode, w.stretchBltMode )
DC_GET_VAL( INT, GetStretchBltMode, stretchBltMode )
/***********************************************************************
* GetTextColor (GDI.90) (GDI32.227)
*/
DC_GET_VAL( COLORREF, GetTextColor, w.textColor )
DC_GET_VAL( COLORREF, GetTextColor, textColor )
/***********************************************************************
* GetViewportExt16 (GDI.94)
......@@ -200,47 +199,47 @@ DC_GET_X_Y( DWORD, GetWindowOrg16, wndOrgX, wndOrgY )
/***********************************************************************
* InquireVisRgn16 (GDI.131)
*/
DC_GET_VAL_16( HRGN16, InquireVisRgn16, w.hVisRgn )
DC_GET_VAL_16( HRGN16, InquireVisRgn16, hVisRgn )
/***********************************************************************
* GetClipRgn16 (GDI.173)
*/
DC_GET_VAL_16( HRGN16, GetClipRgn16, w.hClipRgn )
DC_GET_VAL_16( HRGN16, GetClipRgn16, hClipRgn )
/***********************************************************************
* GetBrushOrg16 (GDI.149)
*/
DC_GET_X_Y( DWORD, GetBrushOrg16, w.brushOrgX, w.brushOrgY )
DC_GET_X_Y( DWORD, GetBrushOrg16, brushOrgX, brushOrgY )
/***********************************************************************
* GetTextAlign (GDI.345) (GDI32,224)
*/
DC_GET_VAL( UINT, GetTextAlign, w.textAlign )
DC_GET_VAL( UINT, GetTextAlign, textAlign )
/***********************************************************************
* GetCurLogFont16 (GDI.411)
*/
DC_GET_VAL_16( HFONT16, GetCurLogFont16, w.hFont )
DC_GET_VAL_16( HFONT16, GetCurLogFont16, hFont )
/***********************************************************************
* GetArcDirection (GDI.524) (GDI32.141)
*/
DC_GET_VAL( INT, GetArcDirection, w.ArcDirection )
DC_GET_VAL( INT, GetArcDirection, ArcDirection )
/***********************************************************************
* GetGraphicsMode (GDI32.188)
*/
DC_GET_VAL( INT, GetGraphicsMode, w.GraphicsMode)
DC_GET_VAL( INT, GetGraphicsMode, GraphicsMode)
/***********************************************************************
* GetBrushOrgEx (GDI.469) (GDI32.148)
*/
DC_GET_VAL_EX( GetBrushOrgEx, w.brushOrgX, w.brushOrgY, POINT ) /* */
DC_GET_VAL_EX( GetBrushOrgEx, brushOrgX, brushOrgY, POINT ) /* */
/***********************************************************************
* GetCurrentPositionEx (GDI.470) (GDI32.167)
*/
DC_GET_VAL_EX( GetCurrentPositionEx, w.CursPosX, w.CursPosY, POINT )
DC_GET_VAL_EX( GetCurrentPositionEx, CursPosX, CursPosY, POINT )
/***********************************************************************
* GetViewportExtEx (GDI.472 GDI32.239)
......
......@@ -10,7 +10,7 @@
#include "winbase.h"
#include "bitmap.h"
#include "callback.h"
#include "dc.h"
#include "gdi.h"
#include "debugtools.h"
#include "palette.h"
......@@ -312,7 +312,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries,
if (!(dc = DC_GetDCUpdate( hdc ))) return 0;
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->w.hPalette, PALETTE_MAGIC )))
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC )))
{
GDI_ReleaseObj( hdc );
return 0;
......@@ -320,10 +320,10 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries,
/* Transfer color info */
if (dc->w.bitsPerPixel <= 8) {
if (dc->bitsPerPixel <= 8) {
palEntry = palette->logpalette.palPalEntry + startpos;
if (startpos + entries > (1 << dc->w.bitsPerPixel))
entries = (1 << dc->w.bitsPerPixel) - startpos;
if (startpos + entries > (1 << dc->bitsPerPixel))
entries = (1 << dc->bitsPerPixel) - startpos;
if (startpos + entries > palette->logpalette.palNumEntries)
entries = palette->logpalette.palNumEntries - startpos;
......@@ -337,7 +337,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries,
} else {
entries = 0;
}
GDI_ReleaseObj( dc->w.hPalette );
GDI_ReleaseObj( dc->hPalette );
GDI_ReleaseObj( hdc );
return entries;
}
......@@ -364,7 +364,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries,
if (!(dc = DC_GetDCUpdate( hdc ))) return 0;
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->w.hPalette, PALETTE_MAGIC )))
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC )))
{
GDI_ReleaseObj( hdc );
return 0;
......@@ -372,10 +372,10 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries,
/* Transfer color info */
if (dc->w.bitsPerPixel <= 8) {
if (dc->bitsPerPixel <= 8) {
palEntry = palette->logpalette.palPalEntry + startpos;
if (startpos + entries > (1 << dc->w.bitsPerPixel)) {
entries = (1 << dc->w.bitsPerPixel) - startpos;
if (startpos + entries > (1 << dc->bitsPerPixel)) {
entries = (1 << dc->bitsPerPixel) - startpos;
}
for (end = colors + entries; colors < end; palEntry++, colors++)
{
......@@ -387,7 +387,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries,
} else {
entries = 0;
}
GDI_ReleaseObj( dc->w.hPalette );
GDI_ReleaseObj( dc->hPalette );
GDI_ReleaseObj( hdc );
return entries;
}
......@@ -485,7 +485,7 @@ INT WINAPI GetDIBits(
GDI_ReleaseObj( hdc );
return 0;
}
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->w.hPalette, PALETTE_MAGIC )))
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC )))
{
GDI_ReleaseObj( hdc );
GDI_ReleaseObj( hbitmap );
......@@ -548,7 +548,7 @@ INT WINAPI GetDIBits(
}
}
GDI_ReleaseObj( dc->w.hPalette );
GDI_ReleaseObj( dc->hPalette );
if (bits && lines)
{
......
......@@ -14,11 +14,11 @@
#include "options.h"
#include "debugtools.h"
#include "winerror.h"
#include "dc.h"
#include "gdi.h"
#include "winnls.h"
DEFAULT_DEBUG_CHANNEL(font)
DECLARE_DEBUG_CHANNEL(gdi)
DEFAULT_DEBUG_CHANNEL(font);
DECLARE_DEBUG_CHANNEL(gdi);
#define ENUM_UNICODE 0x00000001
......@@ -726,9 +726,9 @@ INT16 WINAPI GetTextCharacterExtra16( HDC16 hdc )
INT WINAPI GetTextCharacterExtra( HDC hdc )
{
INT ret;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return 0;
ret = abs( (dc->w.charExtra * dc->wndExtX + dc->vportExtX / 2)
ret = abs( (dc->charExtra * dc->wndExtX + dc->vportExtX / 2)
/ dc->vportExtX );
GDI_ReleaseObj( hdc );
return ret;
......@@ -757,8 +757,8 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
else
{
extra = (extra * dc->vportExtX + dc->wndExtX / 2) / dc->wndExtX;
prev = (dc->w.charExtra * dc->wndExtX + dc->vportExtX / 2) / dc->vportExtX;
dc->w.charExtra = abs(extra);
prev = (dc->charExtra * dc->wndExtX + dc->vportExtX / 2) / dc->vportExtX;
dc->charExtra = abs(extra);
}
GDI_ReleaseObj( hdc );
return prev;
......@@ -788,17 +788,17 @@ BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks )
{
extra = abs((extra * dc->vportExtX + dc->wndExtX / 2) / dc->wndExtX);
if (!extra) breaks = 0;
dc->w.breakTotalExtra = extra;
dc->w.breakCount = breaks;
dc->breakTotalExtra = extra;
dc->breakCount = breaks;
if (breaks)
{
dc->w.breakExtra = extra / breaks;
dc->w.breakRem = extra - (dc->w.breakCount * dc->w.breakExtra);
dc->breakExtra = extra / breaks;
dc->breakRem = extra - (dc->breakCount * dc->breakExtra);
}
else
{
dc->w.breakExtra = 0;
dc->w.breakRem = 0;
dc->breakExtra = 0;
dc->breakRem = 0;
}
}
GDI_ReleaseObj( hdc );
......@@ -822,10 +822,10 @@ INT WINAPI GetTextFaceA( HDC hdc, INT count, LPSTR name )
FONTOBJ *font;
INT ret = 0;
DC * dc = (DC *) DC_GetDCPtr( hdc );
DC * dc = DC_GetDCPtr( hdc );
if (!dc) return 0;
if ((font = (FONTOBJ *) GDI_GetObjPtr( dc->w.hFont, FONT_MAGIC )))
if ((font = (FONTOBJ *) GDI_GetObjPtr( dc->hFont, FONT_MAGIC )))
{
if (name)
{
......@@ -833,7 +833,7 @@ INT WINAPI GetTextFaceA( HDC hdc, INT count, LPSTR name )
ret = strlen(name);
}
else ret = strlen(font->logfont.lfFaceName) + 1;
GDI_ReleaseObj( dc->w.hFont );
GDI_ReleaseObj( dc->hFont );
}
GDI_ReleaseObj( hdc );
return ret;
......
......@@ -17,7 +17,6 @@
#include "bitmap.h"
#include "brush.h"
#include "dc.h"
#include "font.h"
#include "heap.h"
#include "options.h"
......@@ -31,9 +30,6 @@
DEFAULT_DEBUG_CHANNEL(gdi);
/**********************************************************************/
GDI_DRIVER *GDI_Driver = NULL;
/***********************************************************************
* GDI stock objects
......@@ -366,6 +362,38 @@ BOOL GDI_Init(void)
return TRUE;
}
#define FIRST_LARGE_HANDLE 16
#define MAX_LARGE_HANDLES ((GDI_HEAP_SIZE - FIRST_LARGE_HANDLE) >> 2)
static GDIOBJHDR *large_handles[MAX_LARGE_HANDLES];
static int next_large_handle;
/***********************************************************************
* alloc_large_heap
*
* Allocate a GDI handle from the large heap. Helper for GDI_AllocObject
*/
inline static GDIOBJHDR *alloc_large_heap( WORD size, HGDIOBJ *handle )
{
int i;
GDIOBJHDR *obj;
for (i = next_large_handle + 1; i < MAX_LARGE_HANDLES; i++)
if (!large_handles[i]) goto found;
for (i = 0; i <= next_large_handle; i++)
if (!large_handles[i]) goto found;
*handle = 0;
return NULL;
found:
if ((obj = HeapAlloc( GetProcessHeap(), 0, size )))
{
large_handles[i] = obj;
*handle = (i + FIRST_LARGE_HANDLE) << 2;
next_large_handle = i;
}
return obj;
}
/***********************************************************************
* GDI_AllocObject
......@@ -376,18 +404,36 @@ void *GDI_AllocObject( WORD size, WORD magic, HGDIOBJ *handle )
GDIOBJHDR *obj;
_EnterSysLevel( &GDI_level );
if (!(*handle = LOCAL_Alloc( GDI_HeapSel, LMEM_MOVEABLE, size )))
switch(magic)
{
_LeaveSysLevel( &GDI_level );
return NULL;
/* allocate DCs on the larger heap */
case DC_MAGIC:
case DISABLED_DC_MAGIC:
case META_DC_MAGIC:
case METAFILE_MAGIC:
case METAFILE_DC_MAGIC:
case ENHMETAFILE_MAGIC:
case ENHMETAFILE_DC_MAGIC:
if (!(obj = alloc_large_heap( size, handle ))) goto error;
break;
default:
if (!(*handle = LOCAL_Alloc( GDI_HeapSel, LMEM_MOVEABLE, size ))) goto error;
assert( *handle & 2 );
obj = (GDIOBJHDR *)LOCAL_Lock( GDI_HeapSel, *handle );
break;
}
obj = (GDIOBJHDR *)LOCAL_Lock( GDI_HeapSel, *handle );
obj->hNext = 0;
obj->wMagic = magic|OBJECT_NOSYSTEM;
obj->dwCount = ++count;
TRACE_SEC( *handle, "enter" );
return obj;
error:
_LeaveSysLevel( &GDI_level );
*handle = 0;
return NULL;
}
......@@ -401,6 +447,7 @@ void *GDI_ReallocObject( WORD size, HGDIOBJ handle, void *object )
{
HGDIOBJ new_handle;
assert( handle & 2 ); /* no realloc for large handles */
LOCAL_Unlock( GDI_HeapSel, handle );
if (!(new_handle = LOCAL_ReAlloc( GDI_HeapSel, handle, size, LMEM_MOVEABLE )))
{
......@@ -424,8 +471,20 @@ BOOL GDI_FreeObject( HGDIOBJ handle, void *ptr )
if (handle < FIRST_STOCK_HANDLE)
{
object->wMagic = 0; /* Mark it as invalid */
LOCAL_Unlock( GDI_HeapSel, handle );
LOCAL_Free( GDI_HeapSel, handle );
if (handle & 2) /* GDI heap handle */
{
LOCAL_Unlock( GDI_HeapSel, handle );
LOCAL_Free( GDI_HeapSel, handle );
}
else /* large heap handle */
{
int i = (handle >> 2) - FIRST_LARGE_HANDLE;
if (i >= 0 && large_handles[i])
{
HeapFree( GetProcessHeap(), 0, large_handles[i] );
large_handles[i] = NULL;
}
}
}
TRACE_SEC( handle, "leave" );
_LeaveSysLevel( &GDI_level );
......@@ -452,7 +511,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic )
if (ptr && (magic != MAGIC_DONTCARE)
&& (GDIMAGIC(ptr->wMagic) != magic)) ptr = NULL;
}
else
else if (handle & 2) /* GDI heap handle */
{
ptr = (GDIOBJHDR *)LOCAL_Lock( GDI_HeapSel, handle );
if (ptr &&
......@@ -462,6 +521,15 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic )
ptr = NULL;
}
}
else /* large heap handle */
{
int i = (handle >> 2) - FIRST_LARGE_HANDLE;
if (i >= 0)
{
ptr = large_handles[i];
if (ptr && (magic != MAGIC_DONTCARE) && (GDIMAGIC(ptr->wMagic) != magic)) ptr = NULL;
}
}
if (!ptr)
{
......@@ -480,7 +548,7 @@ void *GDI_GetObjPtr( HGDIOBJ handle, WORD magic )
*/
void GDI_ReleaseObj( HGDIOBJ handle )
{
if (handle < FIRST_STOCK_HANDLE) LOCAL_Unlock( GDI_HeapSel, handle );
if (handle < FIRST_STOCK_HANDLE && (handle & 2)) LOCAL_Unlock( GDI_HeapSel, handle );
TRACE_SEC( handle, "leave" );
_LeaveSysLevel( &GDI_level );
}
......@@ -778,11 +846,11 @@ HANDLE WINAPI GetCurrentObject(HDC hdc,UINT type)
if (dc)
{
switch (type) {
case OBJ_PEN: ret = dc->w.hPen; break;
case OBJ_BRUSH: ret = dc->w.hBrush; break;
case OBJ_PAL: ret = dc->w.hPalette; break;
case OBJ_FONT: ret = dc->w.hFont; break;
case OBJ_BITMAP: ret = dc->w.hBitmap; break;
case OBJ_PEN: ret = dc->hPen; break;
case OBJ_BRUSH: ret = dc->hBrush; break;
case OBJ_PAL: ret = dc->hPalette; break;
case OBJ_FONT: ret = dc->hFont; break;
case OBJ_BITMAP: ret = dc->hBitmap; break;
default:
/* the SDK only mentions those above */
FIXME("(%08x,%d): unknown type.\n",hdc,type);
......
......@@ -17,7 +17,6 @@
#include "wine/winuser16.h"
#include "gdi.h"
#include "color.h"
#include "dc.h"
#include "palette.h"
#include "debugtools.h"
#include "callback.h"
......@@ -484,22 +483,22 @@ UINT WINAPI GetSystemPaletteEntries(
TRACE("hdc=%04x,start=%i,count=%i\n", hdc,start,count);
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
if (!entries)
{
count = dc->w.devCaps->sizePalette;
count = dc->devCaps->sizePalette;
goto done;
}
if (start >= dc->w.devCaps->sizePalette)
if (start >= dc->devCaps->sizePalette)
{
count = 0;
goto done;
}
if (start+count >= dc->w.devCaps->sizePalette)
count = dc->w.devCaps->sizePalette - start;
if (start+count >= dc->devCaps->sizePalette)
count = dc->devCaps->sizePalette - start;
for (i = 0; i < count; i++)
{
*(COLORREF*)(entries + i) = COLOR_GetSystemPaletteEntry( start + i );
......@@ -576,9 +575,9 @@ COLORREF WINAPI GetNearestColor(
DC *dc;
PALETTEOBJ *palObj;
if ( (dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC )) )
if ( (dc = DC_GetDCPtr( hdc )) )
{
HPALETTE hpal = (dc->w.hPalette)? dc->w.hPalette : GetStockObject( DEFAULT_PALETTE );
HPALETTE hpal = (dc->hPalette)? dc->hPalette : GetStockObject( DEFAULT_PALETTE );
palObj = GDI_GetObjPtr( hpal, PALETTE_MAGIC );
if (!palObj) {
GDI_ReleaseObj( hdc );
......@@ -649,8 +648,8 @@ HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpal, WORD wBkg)
return 0;
}
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
prev = dc->w.hPalette;
dc->w.hPalette = hpal;
prev = dc->hPalette;
dc->hPalette = hpal;
GDI_ReleaseObj( hdc );
if (!wBkg) hPrimaryPalette = hpal;
return prev;
......@@ -670,29 +669,29 @@ UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
TRACE("%04x...\n", hdc );
if(dc->w.hPalette != hLastRealizedPalette )
if(dc->hPalette != hLastRealizedPalette )
{
if( dc->w.hPalette == GetStockObject( DEFAULT_PALETTE )) {
if( dc->hPalette == GetStockObject( DEFAULT_PALETTE )) {
realized = RealizeDefaultPalette16( hdc );
GDI_ReleaseObj( hdc );
return (UINT16)realized;
}
palPtr = (PALETTEOBJ *) GDI_GetObjPtr( dc->w.hPalette, PALETTE_MAGIC );
palPtr = (PALETTEOBJ *) GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC );
if (!palPtr) {
GDI_ReleaseObj( hdc );
FIXME("invalid selected palette %04x\n",dc->w.hPalette);
FIXME("invalid selected palette %04x\n",dc->hPalette);
return 0;
}
realized = PALETTE_Driver->
pSetMapping(palPtr,0,palPtr->logpalette.palNumEntries,
(dc->w.hPalette != hPrimaryPalette) ||
(dc->w.hPalette == GetStockObject( DEFAULT_PALETTE )));
hLastRealizedPalette = dc->w.hPalette;
GDI_ReleaseObj( dc->w.hPalette );
(dc->hPalette != hPrimaryPalette) ||
(dc->hPalette == GetStockObject( DEFAULT_PALETTE )));
hLastRealizedPalette = dc->hPalette;
GDI_ReleaseObj( dc->hPalette );
}
else TRACE(" skipping (hLastRealizedPalette = %04x)\n",
hLastRealizedPalette);
......@@ -716,7 +715,7 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc )
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
if (!(dc->w.flags & DC_MEMORY))
if (!(dc->flags & DC_MEMORY))
{
palPtr = (PALETTEOBJ*)GDI_GetObjPtr( GetStockObject(DEFAULT_PALETTE), PALETTE_MAGIC );
if (palPtr)
......@@ -735,10 +734,10 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc )
*/
BOOL16 WINAPI IsDCCurrentPalette16(HDC16 hDC)
{
DC* dc = (DC *)GDI_GetObjPtr( hDC, DC_MAGIC );
DC *dc = DC_GetDCPtr( hDC );
if (dc)
{
BOOL bRet = dc->w.hPalette == hPrimaryPalette;
BOOL bRet = dc->hPalette == hPrimaryPalette;
GDI_ReleaseObj( hDC );
return bRet;
}
......@@ -785,9 +784,9 @@ INT16 WINAPI UpdateColors16( HDC16 hDC )
HWND hWnd;
int size;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return 0;
size = dc->w.devCaps->sizePalette;
GDI_ReleaseObj( hDC );
if (!(dc = DC_GetDCPtr( hDC ))) return 0;
size = dc->devCaps->sizePalette;
GDI_ReleaseObj( hDC );
hWnd = Callout.WindowFromDC( hDC );
/* Docs say that we have to remap current drawable pixel by pixel
......
......@@ -88,7 +88,7 @@ SOFTWARE.
#include "debugtools.h"
#include "region.h"
#include "heap.h"
#include "dc.h"
#include "gdi.h"
DEFAULT_DEBUG_CHANNEL(region);
......@@ -1164,7 +1164,7 @@ BOOL REGION_LPTODP( HDC hdc, HRGN hDest, HRGN hSrc )
hdc, hDest, hSrc) ;
if (!dc) return ret;
if (dc->w.MapMode == MM_TEXT) /* Requires only a translation */
if (dc->MapMode == MM_TEXT) /* Requires only a translation */
{
if( CombineRgn( hDest, hSrc, 0, RGN_COPY ) == ERROR ) goto done;
OffsetRgn( hDest, dc->vportOrgX - dc->wndOrgX,
......@@ -2937,7 +2937,7 @@ INT WINAPI GetRandomRgn(HDC hDC, HRGN hRgn, DWORD dwCode)
POINT org;
if (!dc) return -1;
CombineRgn (hRgn, dc->w.hVisRgn, 0, RGN_COPY);
CombineRgn (hRgn, dc->hVisRgn, 0, RGN_COPY);
/*
* On Windows NT/2000,
* the region returned is in screen coordinates.
......@@ -2949,8 +2949,8 @@ INT WINAPI GetRandomRgn(HDC hDC, HRGN hRgn, DWORD dwCode)
GetDCOrgEx(hDC, &org);
else
org.x = org.y = 0;
org.x -= dc->w.DCOrgX;
org.y -= dc->w.DCOrgY;
org.x -= dc->DCOrgX;
org.y -= dc->DCOrgY;
OffsetRgn (hRgn, org.x, org.y);
GDI_ReleaseObj( hDC );
return 1;
......
......@@ -12,7 +12,6 @@
#include "wine/winuser16.h"
#include "winbase.h"
#include "winerror.h"
#include "dc.h"
#include "gdi.h"
#include "heap.h"
#include "debugtools.h"
......
......@@ -599,9 +599,9 @@ HRGN DCE_GetVisRgn( HWND hwnd, WORD flags, HWND hwndChild, WORD cflags )
static void DCE_OffsetVisRgn( HDC hDC, HRGN hVisRgn )
{
DC *dc;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return;
if (!(dc = DC_GetDCPtr( hDC ))) return;
OffsetRgn( hVisRgn, dc->w.DCOrgX, dc->w.DCOrgY );
OffsetRgn( hVisRgn, dc->DCOrgX, dc->DCOrgY );
GDI_ReleaseObj( hDC );
}
......@@ -798,16 +798,16 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
dce->DCXflags = dcxFlags | (flags & DCX_WINDOWPAINT) | DCX_DCEBUSY;
hdc = dce->hDC;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC )))
if (!(dc = DC_GetDCPtr( hdc )))
{
hdc = 0;
goto END;
}
bUpdateVisRgn = bUpdateVisRgn || (dc->w.flags & DC_DIRTY);
bUpdateVisRgn = bUpdateVisRgn || (dc->flags & DC_DIRTY);
/* recompute visible region */
wndPtr->pDriver->pSetDrawable( wndPtr, hdc, flags, bUpdateClipOrigin );
dc->w.flags &= ~DC_DIRTY;
dc->flags &= ~DC_DIRTY;
GDI_ReleaseObj( hdc );
if( bUpdateVisRgn )
......
......@@ -13,14 +13,13 @@
#include "wingdi.h"
#include "wine/winuser16.h"
#include "winuser.h"
#include "dc.h"
#include "win.h"
#include "gdi.h"
#include "dce.h"
#include "region.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(scroll)
DEFAULT_DEBUG_CHANNEL(scroll);
/*************************************************************************
* ScrollWindow16 (USER.61)
......@@ -122,7 +121,7 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
OffsetRect( &rSrc, -dx, -dy );
IntersectRect( &rSrc, &rSrc, &rect );
if(dc->w.hVisRgn)
if(dc->hVisRgn)
{
if (!IsRectEmpty(&rSrc))
{
......@@ -153,9 +152,9 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
HRGN hrgn2;
hrgn2 = CreateRectRgnIndirect( &rect );
OffsetRgn( hrgn2, dc->w.DCOrgX, dc->w.DCOrgY );
CombineRgn( hrgn2, hrgn2, dc->w.hVisRgn, RGN_AND );
OffsetRgn( hrgn2, -dc->w.DCOrgX, -dc->w.DCOrgY );
OffsetRgn( hrgn2, dc->DCOrgX, dc->DCOrgY );
CombineRgn( hrgn2, hrgn2, dc->hVisRgn, RGN_AND );
OffsetRgn( hrgn2, -dc->DCOrgX, -dc->DCOrgY );
SetRectRgn( hrgn, rClip.left, rClip.top,
rClip.right, rClip.bottom );
CombineRgn( hrgn, hrgn, hrgn2, RGN_AND );
......@@ -293,10 +292,10 @@ rc.left, rc.top, rc.right, rc.bottom, (UINT16)flags );
if( (dc = DC_GetDCPtr(hDC)) )
{
OffsetRgn( hrgnTemp, dc->w.DCOrgX, dc->w.DCOrgY );
CombineRgn( hrgnTemp, hrgnTemp, dc->w.hVisRgn,
OffsetRgn( hrgnTemp, dc->DCOrgX, dc->DCOrgY );
CombineRgn( hrgnTemp, hrgnTemp, dc->hVisRgn,
RGN_AND );
OffsetRgn( hrgnTemp, -dc->w.DCOrgX, -dc->w.DCOrgY );
OffsetRgn( hrgnTemp, -dc->DCOrgX, -dc->DCOrgY );
CombineRgn( hrgnUpdate, hrgnTemp, hrgnClip,
RGN_AND );
OffsetRgn( hrgnTemp, dx, dy );
......
......@@ -20,7 +20,7 @@
#include "bitmap.h"
#include "debugtools.h"
#include "dce.h"
#include "dc.h"
#include "gdi.h"
#include "options.h"
#include "message.h"
#include "heap.h"
......@@ -877,8 +877,8 @@ void X11DRV_WND_SurfaceCopy(WND* wndPtr, HDC hdc, INT dx, INT dy,
if (!dcPtr) return;
physDev = (X11DRV_PDEVICE *)dcPtr->physDev;
dst.x = (src.x = dcPtr->w.DCOrgX + rect->left) + dx;
dst.y = (src.y = dcPtr->w.DCOrgY + rect->top) + dy;
dst.x = (src.x = dcPtr->DCOrgX + rect->left) + dx;
dst.y = (src.y = dcPtr->DCOrgY + rect->top) + dy;
if (bUpdate) /* handles non-Wine windows hanging over the copied area */
TSXSetGraphicsExposures( display, physDev->gc, True );
......@@ -913,8 +913,8 @@ void X11DRV_WND_SetDrawable(WND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigi
physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!wndPtr) /* Get a DC for the whole screen */
{
dc->w.DCOrgX = 0;
dc->w.DCOrgY = 0;
dc->DCOrgX = 0;
dc->DCOrgY = 0;
physDev->drawable = X11DRV_GetXRootWindow();
TSXSetSubwindowMode( display, physDev->gc, IncludeInferiors );
}
......@@ -931,36 +931,36 @@ void X11DRV_WND_SetDrawable(WND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigi
* modify the origin and reset the clipping. When the clipping is set,
* it is moved according to the new DC origin.
*/
if ( (wndPtr->class->style & (CS_OWNDC | CS_CLASSDC)) && (dc->w.hClipRgn > 0))
if ( (wndPtr->class->style & (CS_OWNDC | CS_CLASSDC)) && (dc->hClipRgn > 0))
{
dcOrgXCopy = dc->w.DCOrgX;
dcOrgYCopy = dc->w.DCOrgY;
dcOrgXCopy = dc->DCOrgX;
dcOrgYCopy = dc->DCOrgY;
offsetClipRgn = TRUE;
}
if (flags & DCX_WINDOW)
{
dc->w.DCOrgX = wndPtr->rectWindow.left;
dc->w.DCOrgY = wndPtr->rectWindow.top;
dc->DCOrgX = wndPtr->rectWindow.left;
dc->DCOrgY = wndPtr->rectWindow.top;
}
else
{
dc->w.DCOrgX = wndPtr->rectClient.left;
dc->w.DCOrgY = wndPtr->rectClient.top;
dc->DCOrgX = wndPtr->rectClient.left;
dc->DCOrgY = wndPtr->rectClient.top;
}
while (!X11DRV_WND_GetXWindow(wndPtr))
{
wndPtr = wndPtr->parent;
dc->w.DCOrgX += wndPtr->rectClient.left;
dc->w.DCOrgY += wndPtr->rectClient.top;
dc->DCOrgX += wndPtr->rectClient.left;
dc->DCOrgY += wndPtr->rectClient.top;
}
dc->w.DCOrgX -= wndPtr->rectWindow.left;
dc->w.DCOrgY -= wndPtr->rectWindow.top;
dc->DCOrgX -= wndPtr->rectWindow.left;
dc->DCOrgY -= wndPtr->rectWindow.top;
/* reset the clip region, according to the new origin */
if ( offsetClipRgn )
{
OffsetRgn(dc->w.hClipRgn, dc->w.DCOrgX - dcOrgXCopy,dc->w.DCOrgY - dcOrgYCopy);
OffsetRgn(dc->hClipRgn, dc->DCOrgX - dcOrgXCopy,dc->DCOrgY - dcOrgYCopy);
}
physDev->drawable = X11DRV_WND_GetXWindow(wndPtr);
......@@ -972,7 +972,7 @@ void X11DRV_WND_SetDrawable(WND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigi
*/
if( bSetClipOrigin )
TSXSetClipOrigin( display, physDev->gc, dc->w.DCOrgX, dc->w.DCOrgY );
TSXSetClipOrigin( display, physDev->gc, dc->DCOrgX, dc->DCOrgY );
#endif
}
GDI_ReleaseObj( hdc );
......
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