Allocate DC objects on the process heap, and removed WIN_DC_INFO

structure (based on a patch by Ken Coleman).
This commit is contained in:
Alexandre Julliard 2000-11-05 02:05:07 +00:00
parent 47f5f0006a
commit 2239abb9f9
64 changed files with 1150 additions and 1148 deletions

View File

@ -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;
}

View File

@ -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"

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -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 );

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -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)

View File

@ -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--;
}

View File

@ -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 =
{

View File

@ -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;
}

View File

@ -10,7 +10,6 @@
#include "gdi.h"
#include "heap.h"
#include "ldt.h"
#include "dc.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(driver);

View File

@ -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 );

View File

@ -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
{

View File

@ -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

View File

@ -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>

View File

@ -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;
}

View File

@ -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;

View File

@ -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 );

View File

@ -17,11 +17,11 @@
#include "wingdi.h"
#include "winerror.h"
#include "dc.h"
#include "gdi.h"
#include "debugtools.h"
#include "path.h"
DEFAULT_DEBUG_CHANNEL(gdi)
DEFAULT_DEBUG_CHANNEL(gdi);
/* Notes on the implementation
*
@ -104,14 +104,14 @@ BOOL WINAPI BeginPath(HDC hdc)
else
{
/* If path is already open, do nothing */
if(dc->w.path.state != PATH_Open)
if(dc->path.state != PATH_Open)
{
/* Make sure that path is empty */
PATH_EmptyPath(&dc->w.path);
PATH_EmptyPath(&dc->path);
/* Initialize variables for new path */
dc->w.path.newStroke=TRUE;
dc->w.path.state=PATH_Open;
dc->path.newStroke=TRUE;
dc->path.state=PATH_Open;
}
}
GDI_ReleaseObj( hdc );
@ -143,13 +143,13 @@ BOOL WINAPI EndPath(HDC hdc)
else
{
/* Check that path is currently being constructed */
if(dc->w.path.state!=PATH_Open)
if(dc->path.state!=PATH_Open)
{
SetLastError(ERROR_CAN_NOT_COMPLETE);
ret = FALSE;
}
/* Set flag to indicate that path is finished */
else dc->w.path.state=PATH_Closed;
else dc->path.state=PATH_Closed;
}
GDI_ReleaseObj( hdc );
return ret;
@ -187,7 +187,7 @@ BOOL WINAPI AbortPath( HDC hdc )
if(dc->funcs->pAbortPath)
ret = dc->funcs->pAbortPath(dc);
else /* Remove all entries from the path */
PATH_EmptyPath( &dc->w.path );
PATH_EmptyPath( &dc->path );
GDI_ReleaseObj( hdc );
return ret;
}
@ -219,7 +219,7 @@ BOOL WINAPI CloseFigure(HDC hdc)
else
{
/* Check that path is open */
if(dc->w.path.state!=PATH_Open)
if(dc->path.state!=PATH_Open)
{
SetLastError(ERROR_CAN_NOT_COMPLETE);
ret = FALSE;
@ -229,10 +229,10 @@ BOOL WINAPI CloseFigure(HDC hdc)
/* FIXME: Shouldn't we draw a line to the beginning of the
figure? */
/* Set PT_CLOSEFIGURE on the last entry and start a new stroke */
if(dc->w.path.numEntriesUsed)
if(dc->path.numEntriesUsed)
{
dc->w.path.pFlags[dc->w.path.numEntriesUsed-1]|=PT_CLOSEFIGURE;
dc->w.path.newStroke=TRUE;
dc->path.pFlags[dc->path.numEntriesUsed-1]|=PT_CLOSEFIGURE;
dc->path.newStroke=TRUE;
}
}
}
@ -265,7 +265,7 @@ INT WINAPI GetPath(HDC hdc, LPPOINT pPoints, LPBYTE pTypes,
if(!dc) return -1;
pPath = &dc->w.path;
pPath = &dc->path;
/* Check that path is closed */
if(pPath->state!=PATH_Closed)
@ -326,7 +326,7 @@ HRGN WINAPI PathToRegion(HDC hdc)
/* Get pointer to path */
if(!dc) return -1;
pPath = &dc->w.path;
pPath = &dc->path;
/* Check that path is closed */
if(pPath->state!=PATH_Closed) SetLastError(ERROR_CAN_NOT_COMPLETE);
@ -361,7 +361,7 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath)
}
/* Construct a region from the path and fill it */
if(PATH_PathToRegion(pPath, dc->w.polyFillMode, &hrgn))
if(PATH_PathToRegion(pPath, dc->polyFillMode, &hrgn))
{
/* Since PaintRgn interprets the region as being in logical coordinates
* but the points we store for the path are already in device
@ -436,12 +436,12 @@ BOOL WINAPI FillPath(HDC hdc)
bRet = dc->funcs->pFillPath(dc);
else
{
bRet = PATH_FillPath(dc, &dc->w.path);
bRet = PATH_FillPath(dc, &dc->path);
if(bRet)
{
/* FIXME: Should the path be emptied even if conversion
failed? */
PATH_EmptyPath(&dc->w.path);
PATH_EmptyPath(&dc->path);
}
}
GDI_ReleaseObj( hdc );
@ -474,7 +474,7 @@ BOOL WINAPI SelectClipPath(HDC hdc, INT iMode)
success = dc->funcs->pSelectClipPath(dc, iMode);
else
{
pPath = &dc->w.path;
pPath = &dc->path;
/* Check that path is closed */
if(pPath->state!=PATH_Closed)
@ -566,7 +566,7 @@ BOOL PATH_AssignGdiPath(GdiPath *pPathDest, const GdiPath *pPathSrc)
*/
BOOL PATH_MoveTo(DC *dc)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
/* Check that path is open */
if(pPath->state!=PATH_Open)
@ -588,7 +588,7 @@ BOOL PATH_MoveTo(DC *dc)
*/
BOOL PATH_LineTo(DC *dc, INT x, INT y)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT point, pointCurPos;
/* Check that path is open */
@ -605,8 +605,8 @@ BOOL PATH_LineTo(DC *dc, INT x, INT y)
if(pPath->newStroke)
{
pPath->newStroke=FALSE;
pointCurPos.x = dc->w.CursPosX;
pointCurPos.y = dc->w.CursPosY;
pointCurPos.x = dc->CursPosX;
pointCurPos.y = dc->CursPosY;
if(!LPtoDP(dc->hSelf, &pointCurPos, 1))
return FALSE;
if(!PATH_AddEntry(pPath, &pointCurPos, PT_MOVETO))
@ -628,7 +628,7 @@ BOOL PATH_LineTo(DC *dc, INT x, INT y)
*/
BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT corners[2], pointTemp;
FLOAT_POINT ellCorners[2];
@ -685,7 +685,7 @@ BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT e
*/
BOOL PATH_Rectangle(DC *dc, INT x1, INT y1, INT x2, INT y2)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT corners[2], pointTemp;
/* Check that path is open */
@ -751,7 +751,7 @@ BOOL PATH_Ellipse(DC *dc, INT x1, INT y1, INT x2, INT y2)
BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
INT xStart, INT yStart, INT xEnd, INT yEnd, INT lines)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
double angleStart, angleEnd, angleStartQuadrant, angleEndQuadrant=0.0;
/* Initialize angleEndQuadrant to silence gcc's warning */
double x, y;
@ -807,7 +807,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
angleEnd=atan2(y, x);
/* Make sure the end angle is "on the right side" of the start angle */
if(dc->w.ArcDirection==AD_CLOCKWISE)
if(dc->ArcDirection==AD_CLOCKWISE)
{
if(angleEnd<=angleStart)
{
@ -825,7 +825,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
if(dc->w.GraphicsMode==GM_COMPATIBLE)
if(dc->GraphicsMode==GM_COMPATIBLE)
{
corners[1].x--;
corners[1].y--;
@ -841,7 +841,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
if(start)
{
angleStartQuadrant=angleStart;
if(dc->w.ArcDirection==AD_CLOCKWISE)
if(dc->ArcDirection==AD_CLOCKWISE)
angleEndQuadrant=(floor(angleStart/M_PI_2)+1.0)*M_PI_2;
else
angleEndQuadrant=(ceil(angleStart/M_PI_2)-1.0)*M_PI_2;
@ -849,16 +849,16 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
else
{
angleStartQuadrant=angleEndQuadrant;
if(dc->w.ArcDirection==AD_CLOCKWISE)
if(dc->ArcDirection==AD_CLOCKWISE)
angleEndQuadrant+=M_PI_2;
else
angleEndQuadrant-=M_PI_2;
}
/* Have we reached the last part of the arc? */
if((dc->w.ArcDirection==AD_CLOCKWISE &&
if((dc->ArcDirection==AD_CLOCKWISE &&
angleEnd<angleEndQuadrant) ||
(dc->w.ArcDirection==AD_COUNTERCLOCKWISE &&
(dc->ArcDirection==AD_COUNTERCLOCKWISE &&
angleEnd>angleEndQuadrant))
{
/* Adjust the end angle for this quadrant */
@ -891,7 +891,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
BOOL PATH_PolyBezierTo(DC *dc, const POINT *pts, DWORD cbPoints)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@ -903,8 +903,8 @@ BOOL PATH_PolyBezierTo(DC *dc, const POINT *pts, DWORD cbPoints)
if(pPath->newStroke)
{
pPath->newStroke=FALSE;
pt.x = dc->w.CursPosX;
pt.y = dc->w.CursPosY;
pt.x = dc->CursPosX;
pt.y = dc->CursPosY;
if(!LPtoDP(dc->hSelf, &pt, 1))
return FALSE;
if(!PATH_AddEntry(pPath, &pt, PT_MOVETO))
@ -922,7 +922,7 @@ BOOL PATH_PolyBezierTo(DC *dc, const POINT *pts, DWORD cbPoints)
BOOL PATH_PolyBezier(DC *dc, const POINT *pts, DWORD cbPoints)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@ -941,7 +941,7 @@ BOOL PATH_PolyBezier(DC *dc, const POINT *pts, DWORD cbPoints)
BOOL PATH_Polyline(DC *dc, const POINT *pts, DWORD cbPoints)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@ -960,7 +960,7 @@ BOOL PATH_Polyline(DC *dc, const POINT *pts, DWORD cbPoints)
BOOL PATH_PolylineTo(DC *dc, const POINT *pts, DWORD cbPoints)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@ -972,8 +972,8 @@ BOOL PATH_PolylineTo(DC *dc, const POINT *pts, DWORD cbPoints)
if(pPath->newStroke)
{
pPath->newStroke=FALSE;
pt.x = dc->w.CursPosX;
pt.y = dc->w.CursPosY;
pt.x = dc->CursPosX;
pt.y = dc->CursPosY;
if(!LPtoDP(dc->hSelf, &pt, 1))
return FALSE;
if(!PATH_AddEntry(pPath, &pt, PT_MOVETO))
@ -993,7 +993,7 @@ BOOL PATH_PolylineTo(DC *dc, const POINT *pts, DWORD cbPoints)
BOOL PATH_Polygon(DC *dc, const POINT *pts, DWORD cbPoints)
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT pt;
INT i;
@ -1015,7 +1015,7 @@ BOOL PATH_Polygon(DC *dc, const POINT *pts, DWORD cbPoints)
BOOL PATH_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
UINT polygons )
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT pt, startpt;
INT poly, point, i;
@ -1040,7 +1040,7 @@ BOOL PATH_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
BOOL PATH_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
DWORD polylines )
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
POINT pt;
INT poly, point, i;
@ -1094,7 +1094,7 @@ static BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, I
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
if(dc->w.GraphicsMode==GM_COMPATIBLE)
if(dc->GraphicsMode==GM_COMPATIBLE)
{
corners[1].x--;
corners[1].y--;
@ -1452,7 +1452,7 @@ BOOL WINAPI FlattenPath(HDC hdc)
if(dc->funcs->pFlattenPath) ret = dc->funcs->pFlattenPath(dc);
else
{
GdiPath *pPath = &dc->w.path;
GdiPath *pPath = &dc->path;
if(pPath->state != PATH_Closed)
ret = PATH_FlattenPath(pPath);
}
@ -1538,9 +1538,9 @@ BOOL WINAPI StrokeAndFillPath(HDC hdc)
bRet = dc->funcs->pStrokeAndFillPath(dc);
else
{
bRet = PATH_FillPath(dc, &dc->w.path);
if(bRet) bRet = PATH_StrokePath(dc, &dc->w.path);
if(bRet) PATH_EmptyPath(&dc->w.path);
bRet = PATH_FillPath(dc, &dc->path);
if(bRet) bRet = PATH_StrokePath(dc, &dc->path);
if(bRet) PATH_EmptyPath(&dc->path);
}
GDI_ReleaseObj( hdc );
return bRet;
@ -1574,7 +1574,7 @@ BOOL WINAPI StrokePath(HDC hdc)
bRet = dc->funcs->pStrokePath(dc);
else
{
pPath = &dc->w.path;
pPath = &dc->path;
bRet = PATH_StrokePath(dc, pPath);
PATH_EmptyPath(pPath);
}

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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:

View File

@ -16,13 +16,13 @@
#include "bitmap.h"
#include "callback.h"
#include "color.h"
#include "dc.h"
#include "gdi.h"
#include "metafile.h"
#include "options.h"
#include "x11drv.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(bitblt)
DEFAULT_DEBUG_CHANNEL(bitblt);
#define DST 0 /* Destination drawable */
@ -859,13 +859,13 @@ static void BITBLT_GetSrcAreaStretch( DC *dcSrc, DC *dcDst,
visRectSrc->bottom - visRectSrc->top,
AllPlanes, ZPixmap );
XCREATEIMAGE( imageDst, rectDst.right - rectDst.left,
rectDst.bottom - rectDst.top, dcDst->w.bitsPerPixel );
rectDst.bottom - rectDst.top, dcDst->bitsPerPixel );
BITBLT_StretchImage( imageSrc, imageDst, widthSrc, heightSrc,
widthDst, heightDst, &rectSrc, &rectDst,
physDevDst->textPixel, dcDst->w.bitsPerPixel != 1 ?
physDevDst->textPixel, dcDst->bitsPerPixel != 1 ?
physDevDst->backgroundPixel :
physDevSrc->backgroundPixel,
dcDst->w.stretchBltMode );
dcDst->stretchBltMode );
XPutImage( display, pixmap, gc, imageDst, 0, 0, 0, 0,
rectDst.right - rectDst.left, rectDst.bottom - rectDst.top );
XDestroyImage( imageSrc );
@ -889,12 +889,12 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
X11DRV_PDEVICE *physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev;
X11DRV_PDEVICE *physDevDst = (X11DRV_PDEVICE *)dcDst->physDev;
if (dcSrc->w.bitsPerPixel == dcDst->w.bitsPerPixel)
if (dcSrc->bitsPerPixel == dcDst->bitsPerPixel)
{
if (!X11DRV_PALETTE_XPixelToPalette ||
(dcDst->w.bitsPerPixel == 1)) /* monochrome -> monochrome */
(dcDst->bitsPerPixel == 1)) /* monochrome -> monochrome */
{
if (dcDst->w.bitsPerPixel == 1)
if (dcDst->bitsPerPixel == 1)
{
/* MSDN says if StretchBlt must convert a bitmap from monochrome
to color or vice versa, the forground and background color of
@ -912,7 +912,7 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
}
else /* color -> color */
{
if (dcSrc->w.flags & DC_MEMORY)
if (dcSrc->flags & DC_MEMORY)
imageSrc = XGetImage( display, physDevSrc->drawable,
visRectSrc->left, visRectSrc->top,
width, height, AllPlanes, ZPixmap );
@ -936,7 +936,7 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
}
else
{
if (dcSrc->w.bitsPerPixel == 1) /* monochrome -> color */
if (dcSrc->bitsPerPixel == 1) /* monochrome -> color */
{
if (X11DRV_PALETTE_XPixelToPalette)
{
@ -960,7 +960,7 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
imageSrc = XGetImage( display, physDevSrc->drawable,
visRectSrc->left, visRectSrc->top,
width, height, AllPlanes, ZPixmap );
XCREATEIMAGE( imageDst, width, height, dcDst->w.bitsPerPixel );
XCREATEIMAGE( imageDst, width, height, dcDst->bitsPerPixel );
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
XPutPixel(imageDst, x, y, (XGetPixel(imageSrc,x,y) ==
@ -986,7 +986,7 @@ static void BITBLT_GetDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
INT height = visRectDst->bottom - visRectDst->top;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!X11DRV_PALETTE_XPixelToPalette || (dc->w.bitsPerPixel == 1) ||
if (!X11DRV_PALETTE_XPixelToPalette || (dc->bitsPerPixel == 1) ||
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
{
XCopyArea( display, physDev->drawable, pixmap, gc,
@ -997,7 +997,7 @@ static void BITBLT_GetDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
register INT x, y;
XImage *image;
if (dc->w.flags & DC_MEMORY)
if (dc->flags & DC_MEMORY)
image = XGetImage( display, physDev->drawable,
visRectDst->left, visRectDst->top,
width, height, AllPlanes, ZPixmap );
@ -1033,7 +1033,7 @@ static void BITBLT_PutDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
/* !X11DRV_PALETTE_PaletteToXPixel is _NOT_ enough */
if (!X11DRV_PALETTE_PaletteToXPixel || (dc->w.bitsPerPixel == 1) ||
if (!X11DRV_PALETTE_PaletteToXPixel || (dc->bitsPerPixel == 1) ||
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
{
XCopyArea( display, pixmap, physDev->drawable, gc, 0, 0,
@ -1079,7 +1079,7 @@ static BOOL BITBLT_GetVisRectangles( DC *dcDst, INT xDst, INT yDst,
rect.bottom = yDst + heightDst;
if (widthDst < 0) SWAP_INT32( &rect.left, &rect.right );
if (heightDst < 0) SWAP_INT32( &rect.top, &rect.bottom );
GetRgnBox( dcDst->w.hGCClipRgn, &clipRect );
GetRgnBox( dcDst->hGCClipRgn, &clipRect );
if (!IntersectRect( visRectDst, &rect, &clipRect )) return FALSE;
/* Get the source visible rectangle */
@ -1093,7 +1093,7 @@ static BOOL BITBLT_GetVisRectangles( DC *dcDst, INT xDst, INT yDst,
if (heightSrc < 0) SWAP_INT32( &rect.top, &rect.bottom );
/* Apparently the clipping and visible regions are only for output,
so just check against totalExtent here to avoid BadMatch errors */
if (!IntersectRect( visRectSrc, &rect, &dcSrc->w.totalExtent ))
if (!IntersectRect( visRectSrc, &rect, &dcSrc->totalExtent ))
return FALSE;
/* Intersect the rectangles */
@ -1186,8 +1186,8 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
/* Map the coordinates to device coords */
xDst = dcDst->w.DCOrgX + XLPTODP( dcDst, xDst );
yDst = dcDst->w.DCOrgY + YLPTODP( dcDst, yDst );
xDst = dcDst->DCOrgX + XLPTODP( dcDst, xDst );
yDst = dcDst->DCOrgY + YLPTODP( dcDst, yDst );
/* Here we have to round to integers, not truncate */
widthDst = MulDiv(widthDst, dcDst->vportExtX, dcDst->wndExtX);
@ -1200,12 +1200,12 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
dcDst->wndExtX, dcDst->wndExtY );
TRACE(" rectdst=%d,%d-%d,%d orgdst=%d,%d\n",
xDst, yDst, widthDst, heightDst,
dcDst->w.DCOrgX, dcDst->w.DCOrgY );
dcDst->DCOrgX, dcDst->DCOrgY );
if (useSrc)
{
xSrc = dcSrc->w.DCOrgX + XLPTODP( dcSrc, xSrc );
ySrc = dcSrc->w.DCOrgY + YLPTODP( dcSrc, ySrc );
xSrc = dcSrc->DCOrgX + XLPTODP( dcSrc, xSrc );
ySrc = dcSrc->DCOrgY + YLPTODP( dcSrc, ySrc );
widthSrc = widthSrc * dcSrc->vportExtX / dcSrc->wndExtX;
heightSrc = heightSrc * dcSrc->vportExtY / dcSrc->wndExtY;
fStretch = (widthSrc != widthDst) || (heightSrc != heightDst);
@ -1216,7 +1216,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
dcSrc->wndExtX, dcSrc->wndExtY );
TRACE(" rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n",
xSrc, ySrc, widthSrc, heightSrc,
dcSrc->w.DCOrgX, dcSrc->w.DCOrgY );
dcSrc->DCOrgX, dcSrc->DCOrgY );
if (!BITBLT_GetVisRectangles( dcDst, xDst, yDst, widthDst, heightDst,
dcSrc, xSrc, ySrc, widthSrc, heightSrc,
&visRectSrc, &visRectDst ))
@ -1244,7 +1244,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
if (!fStretch) switch(rop) /* A few optimisations */
{
case BLACKNESS: /* 0x00 */
if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
if ((dcDst->bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
XSetFunction( display, physDevDst->gc, GXclear );
else
{
@ -1257,7 +1257,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
return TRUE;
case DSTINVERT: /* 0x55 */
if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel ||
if ((dcDst->bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel ||
!perfect_graphics())
{
XSetFunction( display, physDevDst->gc, GXinvert );
@ -1302,9 +1302,9 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
return TRUE;
case SRCCOPY: /* 0xcc */
if (dcSrc->w.bitsPerPixel == dcDst->w.bitsPerPixel)
if (dcSrc->bitsPerPixel == dcDst->bitsPerPixel)
{
BOOL expose = !(dcSrc->w.flags & DC_MEMORY) && !(dcDst->w.flags & DC_MEMORY);
BOOL expose = !(dcSrc->flags & DC_MEMORY) && !(dcDst->flags & DC_MEMORY);
if ( expose ) XSetGraphicsExposures( display, physDevDst->gc, True );
XSetFunction( display, physDevDst->gc, GXcopy );
XCopyArea( display, physDevSrc->drawable,
@ -1314,9 +1314,9 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
if ( expose ) XSetGraphicsExposures( display, physDevDst->gc, False );
return TRUE;
}
if (dcSrc->w.bitsPerPixel == 1)
if (dcSrc->bitsPerPixel == 1)
{
BOOL expose = !(dcSrc->w.flags & DC_MEMORY) && !(dcDst->w.flags & DC_MEMORY);
BOOL expose = !(dcSrc->flags & DC_MEMORY) && !(dcDst->flags & DC_MEMORY);
XSetBackground( display, physDevDst->gc, physDevDst->textPixel );
XSetForeground( display, physDevDst->gc,
physDevDst->backgroundPixel );
@ -1339,7 +1339,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
return TRUE;
case WHITENESS: /* 0xff */
if ((dcDst->w.bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
if ((dcDst->bitsPerPixel == 1) || !X11DRV_PALETTE_PaletteToXPixel)
XSetFunction( display, physDevDst->gc, GXset );
else
{
@ -1356,11 +1356,11 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
tmpGC = XCreateGC( display, physDevDst->drawable, 0, NULL );
XSetGraphicsExposures( display, tmpGC, False );
pixmaps[DST] = XCreatePixmap( display, X11DRV_GetXRootWindow(), width, height,
dcDst->w.bitsPerPixel );
dcDst->bitsPerPixel );
if (useSrc)
{
pixmaps[SRC] = XCreatePixmap( display, X11DRV_GetXRootWindow(), width, height,
dcDst->w.bitsPerPixel );
dcDst->bitsPerPixel );
if (fStretch)
BITBLT_GetSrcAreaStretch( dcSrc, dcDst, pixmaps[SRC], tmpGC,
xSrc, ySrc, widthSrc, heightSrc,
@ -1386,7 +1386,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
if (!pixmaps[TMP])
pixmaps[TMP] = XCreatePixmap( display, X11DRV_GetXRootWindow(),
width, height,
dcDst->w.bitsPerPixel );
dcDst->bitsPerPixel );
/* fall through */
case OP_ARGS(DST,SRC):
case OP_ARGS(SRC,DST):
@ -1401,7 +1401,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
if (!pixmaps[TMP] && !fNullBrush)
pixmaps[TMP] = XCreatePixmap( display, X11DRV_GetXRootWindow(),
width, height,
dcDst->w.bitsPerPixel );
dcDst->bitsPerPixel );
/* fall through */
case OP_ARGS(PAT,DST):
case OP_ARGS(PAT,SRC):

View File

@ -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;

View File

@ -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)
{

View File

@ -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 );
}

View File

@ -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);
}
/***********************************************************************

View File

@ -30,7 +30,6 @@
#include "x11font.h"
#include "bitmap.h"
#include "gdi.h"
#include "dc.h"
#include "callback.h"
#include "metafile.h"
#include "palette.h"
@ -99,7 +98,7 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
val.background = X11DRV_PALETTE_XPixelToPalette[val.background];
}
val.function = X11DRV_XROPfunction[dc->w.ROPmode-1];
val.function = X11DRV_XROPfunction[dc->ROPmode-1];
/*
** Let's replace GXinvert by GXxor with (black xor white)
** This solves the selection color and leak problems in excel
@ -115,7 +114,7 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
{
case FillStippled:
case FillOpaqueStippled:
if (dc->w.backgroundMode==OPAQUE) val.fill_style = FillOpaqueStippled;
if (dc->backgroundMode==OPAQUE) val.fill_style = FillOpaqueStippled;
val.stipple = physDev->brush.pixmap;
mask = GCStipple;
break;
@ -147,9 +146,9 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
mask = 0;
break;
}
val.ts_x_origin = dc->w.DCOrgX + dc->w.brushOrgX;
val.ts_y_origin = dc->w.DCOrgY + dc->w.brushOrgY;
val.fill_rule = (dc->w.polyFillMode==WINDING) ? WindingRule : EvenOddRule;
val.ts_x_origin = dc->DCOrgX + dc->brushOrgX;
val.ts_y_origin = dc->DCOrgY + dc->brushOrgY;
val.fill_rule = (dc->polyFillMode==WINDING) ? WindingRule : EvenOddRule;
TSXChangeGC( display, gc,
GCFunction | GCForeground | GCBackground | GCFillStyle |
GCFillRule | GCTileStipXOrigin | GCTileStipYOrigin | mask,
@ -185,7 +184,7 @@ BOOL X11DRV_SetupGCForPen( DC * dc )
if (physDev->pen.style == PS_NULL) return FALSE;
switch (dc->w.ROPmode)
switch (dc->ROPmode)
{
case R2_BLACK :
val.foreground = BlackPixelOfScreen( X11DRV_GetXScreen() );
@ -206,7 +205,7 @@ BOOL X11DRV_SetupGCForPen( DC * dc )
break;
default :
val.foreground = physDev->pen.pixel;
val.function = X11DRV_XROPfunction[dc->w.ROPmode-1];
val.function = X11DRV_XROPfunction[dc->ROPmode-1];
}
val.background = physDev->backgroundPixel;
val.fill_style = FillSolid;
@ -216,7 +215,7 @@ BOOL X11DRV_SetupGCForPen( DC * dc )
{
TSXSetDashes( display, physDev->gc, 0, physDev->pen.dashes,
physDev->pen.dash_len );
val.line_style = (dc->w.backgroundMode == OPAQUE) ?
val.line_style = (dc->backgroundMode == OPAQUE) ?
LineDoubleDash : LineOnOffDash;
}
else val.line_style = LineSolid;
@ -298,10 +297,10 @@ X11DRV_LineTo( DC *dc, INT x, INT y )
/* Update the pixmap from the DIB section */
X11DRV_DIB_UpdateDIBSection(dc, FALSE);
TSXDrawLine(display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + XLPTODP( dc, dc->w.CursPosX ),
dc->w.DCOrgY + YLPTODP( dc, dc->w.CursPosY ),
dc->w.DCOrgX + XLPTODP( dc, x ),
dc->w.DCOrgY + YLPTODP( dc, y ) );
dc->DCOrgX + XLPTODP( dc, dc->CursPosX ),
dc->DCOrgY + YLPTODP( dc, dc->CursPosY ),
dc->DCOrgX + XLPTODP( dc, x ),
dc->DCOrgY + YLPTODP( dc, y ) );
/* Update the DIBSection from the pixmap */
X11DRV_DIB_UpdateDIBSection(dc, TRUE);
}
@ -343,7 +342,7 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
if ((left == right) || (top == bottom)
||(lines && ((right-left==1)||(bottom-top==1)))) return TRUE;
if( dc->w.ArcDirection == AD_CLOCKWISE )
if( dc->ArcDirection == AD_CLOCKWISE )
{ INT tmp = xstart; xstart = xend; xend = tmp;
tmp = ystart; ystart = yend; yend = tmp; }
@ -395,7 +394,7 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
TSXSetArcMode( display, physDev->gc,
(lines==1) ? ArcChord : ArcPieSlice);
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1, istart_angle, idiff_angle );
update = TRUE;
}
@ -404,20 +403,20 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
if (X11DRV_SetupGCForPen( dc )){
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1, istart_angle, idiff_angle );
if (lines) {
/* use the truncated values */
start_angle=(double)istart_angle*PI/64./180.;
end_angle=(double)(istart_angle+idiff_angle)*PI/64./180.;
/* calculate the endpoints and round correctly */
points[0].x = (int) floor(dc->w.DCOrgX + (right+left)/2.0 +
points[0].x = (int) floor(dc->DCOrgX + (right+left)/2.0 +
cos(start_angle) * (right-left-width*2+2) / 2. + 0.5);
points[0].y = (int) floor(dc->w.DCOrgY + (top+bottom)/2.0 -
points[0].y = (int) floor(dc->DCOrgY + (top+bottom)/2.0 -
sin(start_angle) * (bottom-top-width*2+2) / 2. + 0.5);
points[1].x = (int) floor(dc->w.DCOrgX + (right+left)/2.0 +
points[1].x = (int) floor(dc->DCOrgX + (right+left)/2.0 +
cos(end_angle) * (right-left-width*2+2) / 2. + 0.5);
points[1].y = (int) floor(dc->w.DCOrgY + (top+bottom)/2.0 -
points[1].y = (int) floor(dc->DCOrgY + (top+bottom)/2.0 -
sin(end_angle) * (bottom-top-width*2+2) / 2. + 0.5);
/* OK this stuff is optimized for Xfree86
@ -431,8 +430,8 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
if (lines == 2) {
INT dx1,dy1;
points[3] = points[1];
points[1].x = dc->w.DCOrgX + xcenter;
points[1].y = dc->w.DCOrgY + ycenter;
points[1].x = dc->DCOrgX + xcenter;
points[1].y = dc->DCOrgY + ycenter;
points[2] = points[1];
dx1=points[1].x-points[0].x;
dy1=points[1].y-points[0].y;
@ -550,14 +549,14 @@ X11DRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
if (X11DRV_SetupGCForBrush( dc ))
{
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1, 0, 360*64 );
update = TRUE;
}
if (X11DRV_SetupGCForPen( dc ))
{
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1, 0, 360*64 );
update = TRUE;
}
@ -619,15 +618,15 @@ X11DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
if (X11DRV_SetupGCForBrush( dc ))
{
TSXFillRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left + (width + 1) / 2,
dc->w.DCOrgY + top + (width + 1) / 2,
dc->DCOrgX + left + (width + 1) / 2,
dc->DCOrgY + top + (width + 1) / 2,
right-left-width-1, bottom-top-width-1);
update = TRUE;
}
if (X11DRV_SetupGCForPen( dc ))
{
TSXDrawRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right-left-1, bottom-top-1 );
update = TRUE;
}
@ -698,61 +697,61 @@ X11DRV_RoundRect( DC *dc, INT left, INT top, INT right,
if (ell_width > (right-left) )
if (ell_height > (bottom-top) )
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right - left - 1, bottom - top - 1,
0, 360 * 64 );
else{
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right - left - 1, ell_height, 0, 180 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left,
dc->w.DCOrgY + bottom - ell_height - 1,
dc->DCOrgX + left,
dc->DCOrgY + bottom - ell_height - 1,
right - left - 1, ell_height, 180 * 64,
180 * 64 );
}
else if (ell_height > (bottom-top) ){
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
ell_width, bottom - top - 1, 90 * 64, 180 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + right - ell_width -1, dc->w.DCOrgY + top,
dc->DCOrgX + right - ell_width -1, dc->DCOrgY + top,
ell_width, bottom - top - 1, 270 * 64, 180 * 64 );
}else{
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
ell_width, ell_height, 90 * 64, 90 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left,
dc->w.DCOrgY + bottom - ell_height - 1,
dc->DCOrgX + left,
dc->DCOrgY + bottom - ell_height - 1,
ell_width, ell_height, 180 * 64, 90 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + right - ell_width - 1,
dc->w.DCOrgY + bottom - ell_height - 1,
dc->DCOrgX + right - ell_width - 1,
dc->DCOrgY + bottom - ell_height - 1,
ell_width, ell_height, 270 * 64, 90 * 64 );
TSXFillArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + right - ell_width - 1,
dc->w.DCOrgY + top,
dc->DCOrgX + right - ell_width - 1,
dc->DCOrgY + top,
ell_width, ell_height, 0, 90 * 64 );
}
if (ell_width < right - left)
{
TSXFillRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left + (ell_width + 1) / 2,
dc->w.DCOrgY + top + 1,
dc->DCOrgX + left + (ell_width + 1) / 2,
dc->DCOrgY + top + 1,
right - left - ell_width - 1,
(ell_height + 1) / 2 - 1);
TSXFillRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left + (ell_width + 1) / 2,
dc->w.DCOrgY + bottom - (ell_height) / 2 - 1,
dc->DCOrgX + left + (ell_width + 1) / 2,
dc->DCOrgY + bottom - (ell_height) / 2 - 1,
right - left - ell_width - 1,
(ell_height) / 2 );
}
if (ell_height < bottom - top)
{
TSXFillRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left + 1,
dc->w.DCOrgY + top + (ell_height + 1) / 2,
dc->DCOrgX + left + 1,
dc->DCOrgY + top + (ell_height + 1) / 2,
right - left - 2,
bottom - top - ell_height - 1);
}
@ -771,65 +770,65 @@ X11DRV_RoundRect( DC *dc, INT left, INT top, INT right,
if (ell_width > (right-left) )
if (ell_height > (bottom-top) )
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right - left - 1, bottom -top - 1, 0 , 360 * 64 );
else{
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
right - left - 1, ell_height - 1, 0 , 180 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left,
dc->w.DCOrgY + bottom - ell_height,
dc->DCOrgX + left,
dc->DCOrgY + bottom - ell_height,
right - left - 1, ell_height - 1, 180 * 64 , 180 * 64 );
}
else if (ell_height > (bottom-top) ){
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
ell_width - 1 , bottom - top - 1, 90 * 64 , 180 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + right - ell_width,
dc->w.DCOrgY + top,
dc->DCOrgX + right - ell_width,
dc->DCOrgY + top,
ell_width - 1 , bottom - top - 1, 270 * 64 , 180 * 64 );
}else{
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
dc->DCOrgX + left, dc->DCOrgY + top,
ell_width - 1, ell_height - 1, 90 * 64, 90 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + bottom - ell_height,
dc->DCOrgX + left, dc->DCOrgY + bottom - ell_height,
ell_width - 1, ell_height - 1, 180 * 64, 90 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + right - ell_width,
dc->w.DCOrgY + bottom - ell_height,
dc->DCOrgX + right - ell_width,
dc->DCOrgY + bottom - ell_height,
ell_width - 1, ell_height - 1, 270 * 64, 90 * 64 );
TSXDrawArc( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + right - ell_width, dc->w.DCOrgY + top,
dc->DCOrgX + right - ell_width, dc->DCOrgY + top,
ell_width - 1, ell_height - 1, 0, 90 * 64 );
}
if (ell_width < right - left)
{
TSXDrawLine( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left + ell_width / 2,
dc->w.DCOrgY + top,
dc->w.DCOrgX + right - (ell_width+1) / 2,
dc->w.DCOrgY + top);
dc->DCOrgX + left + ell_width / 2,
dc->DCOrgY + top,
dc->DCOrgX + right - (ell_width+1) / 2,
dc->DCOrgY + top);
TSXDrawLine( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left + ell_width / 2 ,
dc->w.DCOrgY + bottom - 1,
dc->w.DCOrgX + right - (ell_width+1)/ 2,
dc->w.DCOrgY + bottom - 1);
dc->DCOrgX + left + ell_width / 2 ,
dc->DCOrgY + bottom - 1,
dc->DCOrgX + right - (ell_width+1)/ 2,
dc->DCOrgY + bottom - 1);
}
if (ell_height < bottom - top)
{
TSXDrawLine( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + right - 1,
dc->w.DCOrgY + top + ell_height / 2,
dc->w.DCOrgX + right - 1,
dc->w.DCOrgY + bottom - (ell_height+1) / 2);
dc->DCOrgX + right - 1,
dc->DCOrgY + top + ell_height / 2,
dc->DCOrgX + right - 1,
dc->DCOrgY + bottom - (ell_height+1) / 2);
TSXDrawLine( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left,
dc->w.DCOrgY + top + ell_height / 2,
dc->w.DCOrgX + left,
dc->w.DCOrgY + bottom - (ell_height+1) / 2);
dc->DCOrgX + left,
dc->DCOrgY + top + ell_height / 2,
dc->DCOrgX + left,
dc->DCOrgY + bottom - (ell_height+1) / 2);
}
update = TRUE;
}
@ -852,8 +851,8 @@ X11DRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
Pixel pixel;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
x = dc->w.DCOrgX + XLPTODP( dc, x );
y = dc->w.DCOrgY + YLPTODP( dc, y );
x = dc->DCOrgX + XLPTODP( dc, x );
y = dc->DCOrgY + YLPTODP( dc, y );
pixel = X11DRV_PALETTE_ToPhysical( dc, color );
TSXSetForeground( display, physDev->gc, pixel );
@ -879,10 +878,10 @@ X11DRV_GetPixel( DC *dc, INT x, INT y )
int pixel;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
x = dc->w.DCOrgX + XLPTODP( dc, x );
y = dc->w.DCOrgY + YLPTODP( dc, y );
x = dc->DCOrgX + XLPTODP( dc, x );
y = dc->DCOrgY + YLPTODP( dc, y );
EnterCriticalSection( &X11DRV_CritSection );
if (dc->w.flags & DC_MEMORY)
if (dc->flags & DC_MEMORY)
{
image = XGetImage( display, physDev->drawable, x, y, 1, 1,
AllPlanes, ZPixmap );
@ -892,7 +891,7 @@ X11DRV_GetPixel( DC *dc, INT x, INT y )
/* If we are reading from the screen, use a temporary copy */
/* to avoid a BadMatch error */
if (!pixmap) pixmap = XCreatePixmap( display, X11DRV_GetXRootWindow(),
1, 1, dc->w.bitsPerPixel );
1, 1, dc->bitsPerPixel );
XCopyArea( display, physDev->drawable, pixmap, BITMAP_colorGC,
x, y, 1, 1, 0, 0 );
image = XGetImage( display, pixmap, 0, 0, 1, 1, AllPlanes, ZPixmap );
@ -920,7 +919,7 @@ X11DRV_PaintRgn( DC *dc, HRGN hrgn )
/* Transform region into device co-ords */
if ( !REGION_LPTODP( hdc, tmpVisRgn, hrgn )
|| OffsetRgn( tmpVisRgn, dc->w.DCOrgX, dc->w.DCOrgY ) == ERROR) {
|| OffsetRgn( tmpVisRgn, dc->DCOrgX, dc->DCOrgY ) == ERROR) {
DeleteObject( tmpVisRgn );
return FALSE;
}
@ -936,7 +935,7 @@ X11DRV_PaintRgn( DC *dc, HRGN hrgn )
/* Fill the region */
GetRgnBox( dc->w.hGCClipRgn, &box );
GetRgnBox( dc->hGCClipRgn, &box );
if (X11DRV_SetupGCForBrush( dc ))
{
/* Update the pixmap from the DIB section */
@ -976,8 +975,8 @@ X11DRV_Polyline( DC *dc, const POINT* pt, INT count )
}
for (i = 0; i < count; i++)
{
points[i].x = dc->w.DCOrgX + XLPTODP( dc, pt[i].x );
points[i].y = dc->w.DCOrgY + YLPTODP( dc, pt[i].y );
points[i].x = dc->DCOrgX + XLPTODP( dc, pt[i].x );
points[i].y = dc->DCOrgY + YLPTODP( dc, pt[i].y );
}
if (X11DRV_SetupGCForPen ( dc ))
@ -1016,8 +1015,8 @@ X11DRV_Polygon( DC *dc, const POINT* pt, INT count )
}
for (i = 0; i < count; i++)
{
points[i].x = dc->w.DCOrgX + XLPTODP( dc, pt[i].x );
points[i].y = dc->w.DCOrgY + YLPTODP( dc, pt[i].y );
points[i].x = dc->DCOrgX + XLPTODP( dc, pt[i].x );
points[i].y = dc->DCOrgY + YLPTODP( dc, pt[i].y );
}
points[count] = points[0];
@ -1057,7 +1056,7 @@ X11DRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polygons)
/* FIXME: The points should be converted to device coords before */
/* creating the region. */
hrgn = CreatePolyPolygonRgn( pt, counts, polygons, dc->w.polyFillMode );
hrgn = CreatePolyPolygonRgn( pt, counts, polygons, dc->polyFillMode );
X11DRV_PaintRgn( dc, hrgn );
DeleteObject( hrgn );
@ -1081,8 +1080,8 @@ X11DRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polygons)
{
for (j = 0; j < counts[i]; j++)
{
points[j].x = dc->w.DCOrgX + XLPTODP( dc, pt->x );
points[j].y = dc->w.DCOrgY + YLPTODP( dc, pt->y );
points[j].x = dc->DCOrgX + XLPTODP( dc, pt->x );
points[j].y = dc->DCOrgY + YLPTODP( dc, pt->y );
pt++;
}
points[j] = points[0];
@ -1125,8 +1124,8 @@ X11DRV_PolyPolyline( DC *dc, const POINT* pt, const DWORD* counts, DWORD polylin
{
for (j = 0; j < counts[i]; j++)
{
points[j].x = dc->w.DCOrgX + XLPTODP( dc, pt->x );
points[j].y = dc->w.DCOrgY + YLPTODP( dc, pt->y );
points[j].x = dc->DCOrgX + XLPTODP( dc, pt->x );
points[j].y = dc->DCOrgY + YLPTODP( dc, pt->y );
pt++;
}
TSXDrawLines( display, physDev->drawable, physDev->gc,
@ -1236,7 +1235,7 @@ static BOOL X11DRV_DoFloodFill( const struct FloodFill_params *params )
DC *dc = params->dc;
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if (GetRgnBox( dc->w.hGCClipRgn, &rect ) == ERROR) return FALSE;
if (GetRgnBox( dc->hGCClipRgn, &rect ) == ERROR) return FALSE;
if (!(image = XGetImage( display, physDev->drawable,
rect.left,
@ -1253,8 +1252,8 @@ static BOOL X11DRV_DoFloodFill( const struct FloodFill_params *params )
/* ROP mode is always GXcopy for flood-fill */
XSetFunction( display, physDev->gc, GXcopy );
X11DRV_InternalFloodFill(image, dc,
XLPTODP(dc,params->x) + dc->w.DCOrgX - rect.left,
YLPTODP(dc,params->y) + dc->w.DCOrgY - rect.top,
XLPTODP(dc,params->x) + dc->DCOrgX - rect.left,
YLPTODP(dc,params->y) + dc->DCOrgY - rect.top,
rect.left,
rect.top,
X11DRV_PALETTE_ToPhysical( dc, params->color ),
@ -1304,8 +1303,8 @@ X11DRV_SetBkColor( DC *dc, COLORREF color )
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
COLORREF oldColor;
oldColor = dc->w.backgroundColor;
dc->w.backgroundColor = color;
oldColor = dc->backgroundColor;
dc->backgroundColor = color;
physDev->backgroundPixel = X11DRV_PALETTE_ToPhysical( dc, color );
@ -1321,8 +1320,8 @@ X11DRV_SetTextColor( DC *dc, COLORREF color )
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
COLORREF oldColor;
oldColor = dc->w.textColor;
dc->w.textColor = color;
oldColor = dc->textColor;
dc->textColor = color;
physDev->textPixel = X11DRV_PALETTE_ToPhysical( dc, color );
@ -1334,7 +1333,7 @@ X11DRV_SetTextColor( DC *dc, COLORREF color )
*/
BOOL X11DRV_GetDCOrgEx( DC *dc, LPPOINT lpp )
{
if (!(dc->w.flags & DC_MEMORY))
if (!(dc->flags & DC_MEMORY))
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *) dc->physDev;
Window root;

View File

@ -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 );

View File

@ -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) +

View File

@ -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;

View File

@ -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);
}

View File

@ -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 );

View File

@ -1,31 +0,0 @@
/*
* 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 */

View File

@ -84,17 +84,28 @@ typedef struct tagDeviceCaps
WORD colorRes; /* 108: color resolution */
} DeviceCaps;
typedef struct tagGDI_DRIVER
{
BOOL (*pInitialize)(void);
void (*pFinalize)(void);
} GDI_DRIVER;
typedef BOOL16 CALLBACK (*DCHOOKPROC)(HDC16,WORD,DWORD,LPARAM);
extern GDI_DRIVER *GDI_Driver;
/* Device independent DC information */
typedef struct
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;
int flags;
const DeviceCaps *devCaps;
@ -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 */

View File

@ -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 );
}

View File

@ -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;
}

View File

@ -5,12 +5,12 @@
*/
#include <stdlib.h>
#include "dc.h"
#include "region.h"
#include "debugtools.h"
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "gdi.h"
#include "region.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(clipping);
@ -22,20 +22,20 @@ DEFAULT_DEBUG_CHANNEL(clipping);
*/
void CLIPPING_UpdateGCRegion( DC * dc )
{
if (!dc->w.hGCClipRgn) dc->w.hGCClipRgn = CreateRectRgn( 0, 0, 0, 0 );
if (!dc->hGCClipRgn) dc->hGCClipRgn = CreateRectRgn( 0, 0, 0, 0 );
if (!dc->w.hVisRgn)
if (!dc->hVisRgn)
{
ERR("hVisRgn is zero. Please report this.\n" );
exit(1);
}
if (dc->w.flags & DC_DIRTY) ERR( "DC is dirty. Please report this.\n" );
if (dc->flags & DC_DIRTY) ERR( "DC is dirty. Please report this.\n" );
if (!dc->w.hClipRgn)
CombineRgn( dc->w.hGCClipRgn, dc->w.hVisRgn, 0, RGN_COPY );
if (!dc->hClipRgn)
CombineRgn( dc->hGCClipRgn, dc->hVisRgn, 0, RGN_COPY );
else
CombineRgn(dc->w.hGCClipRgn, dc->w.hClipRgn, dc->w.hVisRgn, RGN_AND);
CombineRgn(dc->hGCClipRgn, dc->hClipRgn, dc->hVisRgn, RGN_AND);
if (dc->funcs->pSetDeviceClipping) dc->funcs->pSetDeviceClipping( dc );
}
@ -80,8 +80,8 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
{
if (fnMode == RGN_COPY)
{
if (dc->w.hClipRgn) DeleteObject16( dc->w.hClipRgn );
dc->w.hClipRgn = 0;
if (dc->hClipRgn) DeleteObject16( dc->hClipRgn );
dc->hClipRgn = 0;
retval = SIMPLEREGION; /* Clip region == whole DC */
}
else
@ -93,19 +93,19 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
}
else
{
if (!dc->w.hClipRgn)
if (!dc->hClipRgn)
{
RECT rect;
GetRgnBox( dc->w.hVisRgn, &rect );
dc->w.hClipRgn = CreateRectRgnIndirect( &rect );
GetRgnBox( dc->hVisRgn, &rect );
dc->hClipRgn = CreateRectRgnIndirect( &rect );
}
OffsetRgn( dc->w.hClipRgn, -dc->w.DCOrgX, -dc->w.DCOrgY );
OffsetRgn( dc->hClipRgn, -dc->DCOrgX, -dc->DCOrgY );
if(fnMode == RGN_COPY)
retval = CombineRgn( dc->w.hClipRgn, hrgn, 0, fnMode );
retval = CombineRgn( dc->hClipRgn, hrgn, 0, fnMode );
else
retval = CombineRgn( dc->w.hClipRgn, dc->w.hClipRgn, hrgn, fnMode);
OffsetRgn( dc->w.hClipRgn, dc->w.DCOrgX, dc->w.DCOrgY );
retval = CombineRgn( dc->hClipRgn, dc->hClipRgn, hrgn, fnMode);
OffsetRgn( dc->hClipRgn, dc->DCOrgX, dc->DCOrgY );
}
CLIPPING_UpdateGCRegion( dc );
@ -126,9 +126,9 @@ INT16 WINAPI SelectVisRgn16( HDC16 hdc, HRGN16 hrgn )
TRACE("%04x %04x\n", hdc, hrgn );
dc->w.flags &= ~DC_DIRTY;
dc->flags &= ~DC_DIRTY;
retval = CombineRgn16( dc->w.hVisRgn, hrgn, 0, RGN_COPY );
retval = CombineRgn16( dc->hVisRgn, hrgn, 0, RGN_COPY );
CLIPPING_UpdateGCRegion( dc );
GDI_ReleaseObj( hdc );
return retval;
@ -157,8 +157,8 @@ INT WINAPI OffsetClipRgn( HDC hdc, INT x, INT y )
if(dc->funcs->pOffsetClipRgn)
ret = dc->funcs->pOffsetClipRgn( dc, x, y );
else if (dc->w.hClipRgn) {
ret = OffsetRgn( dc->w.hClipRgn, XLSTODS(dc,x), YLSTODS(dc,y));
else if (dc->hClipRgn) {
ret = OffsetRgn( dc->hClipRgn, XLSTODS(dc,x), YLSTODS(dc,y));
CLIPPING_UpdateGCRegion( dc );
}
GDI_ReleaseObj( hdc );
@ -175,7 +175,7 @@ INT16 WINAPI OffsetVisRgn16( HDC16 hdc, INT16 x, INT16 y )
DC * dc = DC_GetDCUpdate( hdc );
if (!dc) return ERROR;
TRACE("%04x %d,%d\n", hdc, x, y );
retval = OffsetRgn( dc->w.hVisRgn, x, y );
retval = OffsetRgn( dc->hVisRgn, x, y );
CLIPPING_UpdateGCRegion( dc );
GDI_ReleaseObj( hdc );
return retval;
@ -195,34 +195,34 @@ INT CLIPPING_IntersectClipRect( DC * dc, INT left, INT top,
HRGN newRgn;
INT ret;
left += dc->w.DCOrgX;
right += dc->w.DCOrgX;
top += dc->w.DCOrgY;
bottom += dc->w.DCOrgY;
left += dc->DCOrgX;
right += dc->DCOrgX;
top += dc->DCOrgY;
bottom += dc->DCOrgY;
if (!(newRgn = CreateRectRgn( left, top, right, bottom ))) return ERROR;
if (!dc->w.hClipRgn)
if (!dc->hClipRgn)
{
if( flags & CLIP_INTERSECT )
{
dc->w.hClipRgn = newRgn;
dc->hClipRgn = newRgn;
CLIPPING_UpdateGCRegion( dc );
return SIMPLEREGION;
}
else if( flags & CLIP_EXCLUDE )
{
dc->w.hClipRgn = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( dc->w.hClipRgn, dc->w.hVisRgn, 0, RGN_COPY );
dc->hClipRgn = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( dc->hClipRgn, dc->hVisRgn, 0, RGN_COPY );
}
else WARN("No hClipRgn and flags are %x\n",flags);
}
ret = CombineRgn( newRgn, dc->w.hClipRgn, newRgn,
ret = CombineRgn( newRgn, dc->hClipRgn, newRgn,
(flags & CLIP_EXCLUDE) ? RGN_DIFF : RGN_AND );
if (ret != ERROR)
{
if (!(flags & CLIP_KEEPRGN)) DeleteObject( dc->w.hClipRgn );
dc->w.hClipRgn = newRgn;
if (!(flags & CLIP_KEEPRGN)) DeleteObject( dc->hClipRgn );
dc->hClipRgn = newRgn;
CLIPPING_UpdateGCRegion( dc );
}
else DeleteObject( newRgn );
@ -318,10 +318,10 @@ INT CLIPPING_IntersectVisRect( DC * dc, INT left, INT top,
HRGN tempRgn, newRgn;
INT ret;
left += dc->w.DCOrgX;
right += dc->w.DCOrgX;
top += dc->w.DCOrgY;
bottom += dc->w.DCOrgY;
left += dc->DCOrgX;
right += dc->DCOrgX;
top += dc->DCOrgY;
bottom += dc->DCOrgY;
if (!(newRgn = CreateRectRgn( 0, 0, 0, 0 ))) return ERROR;
if (!(tempRgn = CreateRectRgn( left, top, right, bottom )))
@ -329,7 +329,7 @@ INT CLIPPING_IntersectVisRect( DC * dc, INT left, INT top,
DeleteObject( newRgn );
return ERROR;
}
ret = CombineRgn( newRgn, dc->w.hVisRgn, tempRgn,
ret = CombineRgn( newRgn, dc->hVisRgn, tempRgn,
exclude ? RGN_DIFF : RGN_AND );
DeleteObject( tempRgn );
@ -338,16 +338,16 @@ INT CLIPPING_IntersectVisRect( DC * dc, INT left, INT top,
RGNOBJ *newObj = (RGNOBJ*)GDI_GetObjPtr( newRgn, REGION_MAGIC);
if (newObj)
{
RGNOBJ *prevObj = (RGNOBJ*)GDI_GetObjPtr( dc->w.hVisRgn, REGION_MAGIC);
RGNOBJ *prevObj = (RGNOBJ*)GDI_GetObjPtr( dc->hVisRgn, REGION_MAGIC);
if (prevObj)
{
newObj->header.hNext = prevObj->header.hNext;
GDI_ReleaseObj( dc->w.hVisRgn );
GDI_ReleaseObj( dc->hVisRgn );
}
GDI_ReleaseObj( newRgn );
}
DeleteObject( dc->w.hVisRgn );
dc->w.hVisRgn = newRgn;
DeleteObject( dc->hVisRgn );
dc->hVisRgn = newRgn;
CLIPPING_UpdateGCRegion( dc );
}
else DeleteObject( newRgn );
@ -385,7 +385,7 @@ INT16 WINAPI IntersectVisRect16( HDC16 hdc, INT16 left, INT16 top,
INT16 right, INT16 bottom )
{
INT16 ret;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC * dc = DC_GetDCUpdate( hdc );
if (!dc) return ERROR;
left = XLPTODP( dc, left );
@ -420,10 +420,10 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y )
TRACE("%04x %d,%d\n", hdc, x, y );
if (!dc) return FALSE;
if (dc->w.hGCClipRgn)
if (dc->hGCClipRgn)
{
ret = PtInRegion( dc->w.hGCClipRgn, XLPTODP(dc,x) + dc->w.DCOrgX,
YLPTODP(dc,y) + dc->w.DCOrgY );
ret = PtInRegion( dc->hGCClipRgn, XLPTODP(dc,x) + dc->DCOrgX,
YLPTODP(dc,y) + dc->DCOrgY );
}
GDI_ReleaseObj( hdc );
return ret;
@ -437,20 +437,20 @@ BOOL16 WINAPI RectVisible16( HDC16 hdc, const RECT16* rect )
{
BOOL ret = FALSE;
RECT16 tmpRect;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCUpdate( hdc );
if (!dc) return FALSE;
TRACE("%04x %d,%dx%d,%d\n",
hdc, rect->left, rect->top, rect->right, rect->bottom );
if (dc->w.hGCClipRgn)
if (dc->hGCClipRgn)
{
/* copy rectangle to avoid overwriting by LPtoDP */
tmpRect = *rect;
LPtoDP16( hdc, (LPPOINT16)&tmpRect, 2 );
tmpRect.left += dc->w.DCOrgX;
tmpRect.right += dc->w.DCOrgX;
tmpRect.top += dc->w.DCOrgY;
tmpRect.bottom += dc->w.DCOrgY;
ret = RectInRegion16( dc->w.hGCClipRgn, &tmpRect );
tmpRect.left += dc->DCOrgX;
tmpRect.right += dc->DCOrgX;
tmpRect.top += dc->DCOrgY;
tmpRect.bottom += dc->DCOrgY;
ret = RectInRegion16( dc->hGCClipRgn, &tmpRect );
}
GDI_ReleaseObj( hdc );
return ret;
@ -474,13 +474,13 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect )
INT16 WINAPI GetClipBox16( HDC16 hdc, LPRECT16 rect )
{
int ret;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return ERROR;
ret = GetRgnBox16( dc->w.hGCClipRgn, rect );
rect->left -= dc->w.DCOrgX;
rect->right -= dc->w.DCOrgX;
rect->top -= dc->w.DCOrgY;
rect->bottom -= dc->w.DCOrgY;
ret = GetRgnBox16( dc->hGCClipRgn, rect );
rect->left -= dc->DCOrgX;
rect->right -= dc->DCOrgX;
rect->top -= dc->DCOrgY;
rect->bottom -= dc->DCOrgY;
DPtoLP16( hdc, (LPPOINT16)rect, 2 );
TRACE("%d,%d-%d,%d\n", rect->left,rect->top,rect->right,rect->bottom );
GDI_ReleaseObj( hdc );
@ -494,13 +494,13 @@ INT16 WINAPI GetClipBox16( HDC16 hdc, LPRECT16 rect )
INT WINAPI GetClipBox( HDC hdc, LPRECT rect )
{
INT ret;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return ERROR;
ret = GetRgnBox( dc->w.hGCClipRgn, rect );
rect->left -= dc->w.DCOrgX;
rect->right -= dc->w.DCOrgX;
rect->top -= dc->w.DCOrgY;
rect->bottom -= dc->w.DCOrgY;
ret = GetRgnBox( dc->hGCClipRgn, rect );
rect->left -= dc->DCOrgX;
rect->right -= dc->DCOrgX;
rect->top -= dc->DCOrgY;
rect->bottom -= dc->DCOrgY;
DPtoLP( hdc, (LPPOINT)rect, 2 );
GDI_ReleaseObj( hdc );
return ret;
@ -514,16 +514,16 @@ INT WINAPI GetClipRgn( HDC hdc, HRGN hRgn )
{
INT ret = -1;
DC * dc;
if (hRgn && (dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC )))
if (hRgn && (dc = DC_GetDCPtr( hdc )))
{
if( dc->w.hClipRgn )
if( dc->hClipRgn )
{
/* this assumes that dc->w.hClipRgn is in coordinates
/* this assumes that dc->hClipRgn is in coordinates
relative to the device (not DC origin) */
if( CombineRgn(hRgn, dc->w.hClipRgn, 0, RGN_COPY) != ERROR )
if( CombineRgn(hRgn, dc->hClipRgn, 0, RGN_COPY) != ERROR )
{
OffsetRgn( hRgn, -dc->w.DCOrgX, -dc->w.DCOrgY );
OffsetRgn( hRgn, -dc->DCOrgX, -dc->DCOrgY );
ret = 1;
}
}
@ -545,29 +545,29 @@ HRGN16 WINAPI SaveVisRgn16( HDC16 hdc )
if (!dc) return 0;
TRACE("%04x\n", hdc );
if (!(obj = (RGNOBJ *) GDI_GetObjPtr( dc->w.hVisRgn, REGION_MAGIC )))
if (!(obj = (RGNOBJ *) GDI_GetObjPtr( dc->hVisRgn, REGION_MAGIC )))
{
GDI_ReleaseObj( hdc );
return 0;
}
if (!(copy = CreateRectRgn( 0, 0, 0, 0 )))
{
GDI_ReleaseObj( dc->w.hVisRgn );
GDI_ReleaseObj( dc->hVisRgn );
GDI_ReleaseObj( hdc );
return 0;
}
CombineRgn( copy, dc->w.hVisRgn, 0, RGN_COPY );
CombineRgn( copy, dc->hVisRgn, 0, RGN_COPY );
if (!(copyObj = (RGNOBJ *) GDI_GetObjPtr( copy, REGION_MAGIC )))
{
DeleteObject( copy );
GDI_ReleaseObj( dc->w.hVisRgn );
GDI_ReleaseObj( dc->hVisRgn );
GDI_ReleaseObj( hdc );
return 0;
}
copyObj->header.hNext = obj->header.hNext;
obj->header.hNext = copy;
GDI_ReleaseObj( copy );
GDI_ReleaseObj( dc->w.hVisRgn );
GDI_ReleaseObj( dc->hVisRgn );
GDI_ReleaseObj( hdc );
return copy;
}
@ -580,21 +580,21 @@ INT16 WINAPI RestoreVisRgn16( HDC16 hdc )
{
HRGN saved;
RGNOBJ *obj, *savedObj;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
INT16 ret = ERROR;
if (!dc) return ERROR;
if (!dc->w.hVisRgn) goto done;
if (!dc->hVisRgn) goto done;
TRACE("%04x\n", hdc );
if (!(obj = (RGNOBJ *) GDI_GetObjPtr( dc->w.hVisRgn, REGION_MAGIC ))) goto done;
if (!(obj = (RGNOBJ *) GDI_GetObjPtr( dc->hVisRgn, REGION_MAGIC ))) goto done;
saved = obj->header.hNext;
GDI_ReleaseObj( dc->w.hVisRgn );
GDI_ReleaseObj( dc->hVisRgn );
if (!saved || !(savedObj = (RGNOBJ *) GDI_GetObjPtr( saved, REGION_MAGIC ))) goto done;
DeleteObject( dc->w.hVisRgn );
dc->w.hVisRgn = saved;
dc->w.flags &= ~DC_DIRTY;
DeleteObject( dc->hVisRgn );
dc->hVisRgn = saved;
dc->flags &= ~DC_DIRTY;
CLIPPING_UpdateGCRegion( dc );
ret = savedObj->rgn->type; /* FIXME */
GDI_ReleaseObj( saved );

View File

@ -9,7 +9,6 @@
#include <stdlib.h>
#include <string.h>
#include "dc.h"
#include "gdi.h"
#include "heap.h"
#include "debugtools.h"
@ -22,61 +21,6 @@
DEFAULT_DEBUG_CHANNEL(dc);
/***********************************************************************
* DC_Init_DC_INFO
*
* Fill the WIN_DC_INFO structure.
*/
static void DC_Init_DC_INFO( WIN_DC_INFO *win_dc_info )
{
win_dc_info->flags = 0;
win_dc_info->devCaps = NULL;
win_dc_info->hClipRgn = 0;
win_dc_info->hVisRgn = 0;
win_dc_info->hGCClipRgn = 0;
win_dc_info->hPen = GetStockObject( BLACK_PEN );
win_dc_info->hBrush = GetStockObject( WHITE_BRUSH );
win_dc_info->hFont = GetStockObject( SYSTEM_FONT );
win_dc_info->hBitmap = 0;
win_dc_info->hDevice = 0;
win_dc_info->hPalette = GetStockObject( DEFAULT_PALETTE );
win_dc_info->ROPmode = R2_COPYPEN;
win_dc_info->polyFillMode = ALTERNATE;
win_dc_info->stretchBltMode = BLACKONWHITE;
win_dc_info->relAbsMode = ABSOLUTE;
win_dc_info->backgroundMode = OPAQUE;
win_dc_info->backgroundColor = RGB( 255, 255, 255 );
win_dc_info->textColor = RGB( 0, 0, 0 );
win_dc_info->brushOrgX = 0;
win_dc_info->brushOrgY = 0;
win_dc_info->textAlign = TA_LEFT | TA_TOP | TA_NOUPDATECP;
win_dc_info->charExtra = 0;
win_dc_info->breakTotalExtra = 0;
win_dc_info->breakCount = 0;
win_dc_info->breakExtra = 0;
win_dc_info->breakRem = 0;
win_dc_info->bitsPerPixel = 1;
win_dc_info->MapMode = MM_TEXT;
win_dc_info->GraphicsMode = GM_COMPATIBLE;
win_dc_info->DCOrgX = 0;
win_dc_info->DCOrgY = 0;
win_dc_info->pAbortProc = NULL;
win_dc_info->CursPosX = 0;
win_dc_info->CursPosY = 0;
win_dc_info->ArcDirection = AD_COUNTERCLOCKWISE;
win_dc_info->xformWorld2Wnd.eM11 = 1.0f;
win_dc_info->xformWorld2Wnd.eM12 = 0.0f;
win_dc_info->xformWorld2Wnd.eM21 = 0.0f;
win_dc_info->xformWorld2Wnd.eM22 = 1.0f;
win_dc_info->xformWorld2Wnd.eDx = 0.0f;
win_dc_info->xformWorld2Wnd.eDy = 0.0f;
win_dc_info->xformWorld2Vport = win_dc_info->xformWorld2Wnd;
win_dc_info->xformVport2World = win_dc_info->xformWorld2Wnd;
win_dc_info->vport2WorldValid = TRUE;
PATH_InitGdiPath(&win_dc_info->path);
}
/***********************************************************************
* DC_AllocDC
@ -86,12 +30,13 @@ DC *DC_AllocDC( const DC_FUNCTIONS *funcs )
HDC hdc;
DC *dc;
if (!(dc = GDI_AllocObject( sizeof(DC), DC_MAGIC, &hdc ))) return NULL;
if (!(dc = GDI_AllocObject( sizeof(*dc), DC_MAGIC, &hdc ))) return NULL;
dc->hSelf = hdc;
dc->funcs = funcs;
dc->physDev = NULL;
dc->saveLevel = 0;
dc->dwHookData = 0L;
dc->dwHookData = 0;
dc->hookProc = NULL;
dc->hookThunk = NULL;
dc->wndOrgX = 0;
@ -102,9 +47,55 @@ DC *DC_AllocDC( const DC_FUNCTIONS *funcs )
dc->vportOrgY = 0;
dc->vportExtX = 1;
dc->vportExtY = 1;
DC_Init_DC_INFO( &dc->w );
dc->flags = 0;
dc->devCaps = NULL;
dc->hClipRgn = 0;
dc->hVisRgn = 0;
dc->hGCClipRgn = 0;
dc->hPen = GetStockObject( BLACK_PEN );
dc->hBrush = GetStockObject( WHITE_BRUSH );
dc->hFont = GetStockObject( SYSTEM_FONT );
dc->hBitmap = 0;
dc->hDevice = 0;
dc->hPalette = GetStockObject( DEFAULT_PALETTE );
dc->ROPmode = R2_COPYPEN;
dc->polyFillMode = ALTERNATE;
dc->stretchBltMode = BLACKONWHITE;
dc->relAbsMode = ABSOLUTE;
dc->backgroundMode = OPAQUE;
dc->backgroundColor = RGB( 255, 255, 255 );
dc->textColor = RGB( 0, 0, 0 );
dc->brushOrgX = 0;
dc->brushOrgY = 0;
dc->textAlign = TA_LEFT | TA_TOP | TA_NOUPDATECP;
dc->charExtra = 0;
dc->breakTotalExtra = 0;
dc->breakCount = 0;
dc->breakExtra = 0;
dc->breakRem = 0;
dc->totalExtent.left = 0;
dc->totalExtent.top = 0;
dc->totalExtent.right = 0;
dc->totalExtent.bottom = 0;
dc->bitsPerPixel = 1;
dc->MapMode = MM_TEXT;
dc->GraphicsMode = GM_COMPATIBLE;
dc->DCOrgX = 0;
dc->DCOrgY = 0;
dc->pAbortProc = NULL;
dc->CursPosX = 0;
dc->CursPosY = 0;
dc->ArcDirection = AD_COUNTERCLOCKWISE;
dc->xformWorld2Wnd.eM11 = 1.0f;
dc->xformWorld2Wnd.eM12 = 0.0f;
dc->xformWorld2Wnd.eM21 = 0.0f;
dc->xformWorld2Wnd.eM22 = 1.0f;
dc->xformWorld2Wnd.eDx = 0.0f;
dc->xformWorld2Wnd.eDy = 0.0f;
dc->xformWorld2Vport = dc->xformWorld2Wnd;
dc->xformVport2World = dc->xformWorld2Wnd;
dc->vport2WorldValid = TRUE;
PATH_InitGdiPath(&dc->path);
return dc;
}
@ -137,10 +128,10 @@ DC *DC_GetDCUpdate( HDC hdc )
{
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return NULL;
while (dc->w.flags & DC_DIRTY)
while (dc->flags & DC_DIRTY)
{
dc->w.flags &= ~DC_DIRTY;
if (!(dc->w.flags & (DC_SAVED | DC_MEMORY)))
dc->flags &= ~DC_DIRTY;
if (!(dc->flags & (DC_SAVED | DC_MEMORY)))
{
DCHOOKPROC proc = dc->hookThunk;
if (proc)
@ -164,11 +155,11 @@ DC *DC_GetDCUpdate( HDC hdc )
void DC_InitDC( DC* dc )
{
RealizeDefaultPalette16( dc->hSelf );
SetTextColor( dc->hSelf, dc->w.textColor );
SetBkColor( dc->hSelf, dc->w.backgroundColor );
SelectObject( dc->hSelf, dc->w.hPen );
SelectObject( dc->hSelf, dc->w.hBrush );
SelectObject( dc->hSelf, dc->w.hFont );
SetTextColor( dc->hSelf, dc->textColor );
SetBkColor( dc->hSelf, dc->backgroundColor );
SelectObject( dc->hSelf, dc->hPen );
SelectObject( dc->hSelf, dc->hBrush );
SelectObject( dc->hSelf, dc->hFont );
CLIPPING_UpdateGCRegion( dc );
}
@ -230,12 +221,12 @@ void DC_UpdateXforms( DC *dc )
scaleY * (FLOAT)dc->wndOrgY;
/* Combine with the world transformation */
CombineTransform( &dc->w.xformWorld2Vport, &dc->w.xformWorld2Wnd,
CombineTransform( &dc->xformWorld2Vport, &dc->xformWorld2Wnd,
&xformWnd2Vport );
/* Create inverse of world-to-viewport transformation */
dc->w.vport2WorldValid = DC_InvertXform( &dc->w.xformWorld2Vport,
&dc->w.xformVport2World );
dc->vport2WorldValid = DC_InvertXform( &dc->xformWorld2Vport,
&dc->xformVport2World );
}
@ -255,45 +246,45 @@ HDC16 WINAPI GetDCState16( HDC16 hdc )
}
TRACE("(%04x): returning %04x\n", hdc, handle );
newdc->w.flags = dc->w.flags | DC_SAVED;
newdc->w.devCaps = dc->w.devCaps;
newdc->w.hPen = dc->w.hPen;
newdc->w.hBrush = dc->w.hBrush;
newdc->w.hFont = dc->w.hFont;
newdc->w.hBitmap = dc->w.hBitmap;
newdc->w.hDevice = dc->w.hDevice;
newdc->w.hPalette = dc->w.hPalette;
newdc->w.totalExtent = dc->w.totalExtent;
newdc->w.bitsPerPixel = dc->w.bitsPerPixel;
newdc->w.ROPmode = dc->w.ROPmode;
newdc->w.polyFillMode = dc->w.polyFillMode;
newdc->w.stretchBltMode = dc->w.stretchBltMode;
newdc->w.relAbsMode = dc->w.relAbsMode;
newdc->w.backgroundMode = dc->w.backgroundMode;
newdc->w.backgroundColor = dc->w.backgroundColor;
newdc->w.textColor = dc->w.textColor;
newdc->w.brushOrgX = dc->w.brushOrgX;
newdc->w.brushOrgY = dc->w.brushOrgY;
newdc->w.textAlign = dc->w.textAlign;
newdc->w.charExtra = dc->w.charExtra;
newdc->w.breakTotalExtra = dc->w.breakTotalExtra;
newdc->w.breakCount = dc->w.breakCount;
newdc->w.breakExtra = dc->w.breakExtra;
newdc->w.breakRem = dc->w.breakRem;
newdc->w.MapMode = dc->w.MapMode;
newdc->w.GraphicsMode = dc->w.GraphicsMode;
newdc->flags = dc->flags | DC_SAVED;
newdc->devCaps = dc->devCaps;
newdc->hPen = dc->hPen;
newdc->hBrush = dc->hBrush;
newdc->hFont = dc->hFont;
newdc->hBitmap = dc->hBitmap;
newdc->hDevice = dc->hDevice;
newdc->hPalette = dc->hPalette;
newdc->totalExtent = dc->totalExtent;
newdc->bitsPerPixel = dc->bitsPerPixel;
newdc->ROPmode = dc->ROPmode;
newdc->polyFillMode = dc->polyFillMode;
newdc->stretchBltMode = dc->stretchBltMode;
newdc->relAbsMode = dc->relAbsMode;
newdc->backgroundMode = dc->backgroundMode;
newdc->backgroundColor = dc->backgroundColor;
newdc->textColor = dc->textColor;
newdc->brushOrgX = dc->brushOrgX;
newdc->brushOrgY = dc->brushOrgY;
newdc->textAlign = dc->textAlign;
newdc->charExtra = dc->charExtra;
newdc->breakTotalExtra = dc->breakTotalExtra;
newdc->breakCount = dc->breakCount;
newdc->breakExtra = dc->breakExtra;
newdc->breakRem = dc->breakRem;
newdc->MapMode = dc->MapMode;
newdc->GraphicsMode = dc->GraphicsMode;
#if 0
/* Apparently, the DC origin is not changed by [GS]etDCState */
newdc->w.DCOrgX = dc->w.DCOrgX;
newdc->w.DCOrgY = dc->w.DCOrgY;
newdc->DCOrgX = dc->DCOrgX;
newdc->DCOrgY = dc->DCOrgY;
#endif
newdc->w.CursPosX = dc->w.CursPosX;
newdc->w.CursPosY = dc->w.CursPosY;
newdc->w.ArcDirection = dc->w.ArcDirection;
newdc->w.xformWorld2Wnd = dc->w.xformWorld2Wnd;
newdc->w.xformWorld2Vport = dc->w.xformWorld2Vport;
newdc->w.xformVport2World = dc->w.xformVport2World;
newdc->w.vport2WorldValid = dc->w.vport2WorldValid;
newdc->CursPosX = dc->CursPosX;
newdc->CursPosY = dc->CursPosY;
newdc->ArcDirection = dc->ArcDirection;
newdc->xformWorld2Wnd = dc->xformWorld2Wnd;
newdc->xformWorld2Vport = dc->xformWorld2Vport;
newdc->xformVport2World = dc->xformVport2World;
newdc->vport2WorldValid = dc->vport2WorldValid;
newdc->wndOrgX = dc->wndOrgX;
newdc->wndOrgY = dc->wndOrgY;
newdc->wndExtX = dc->wndExtX;
@ -306,21 +297,22 @@ HDC16 WINAPI GetDCState16( HDC16 hdc )
newdc->hSelf = (HDC)handle;
newdc->saveLevel = 0;
PATH_InitGdiPath( &newdc->w.path );
PATH_InitGdiPath( &newdc->path );
newdc->w.pAbortProc = NULL;
newdc->pAbortProc = NULL;
newdc->hookThunk = NULL;
newdc->hookProc = 0;
/* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */
newdc->w.hGCClipRgn = newdc->w.hVisRgn = 0;
if (dc->w.hClipRgn)
newdc->hGCClipRgn = newdc->hVisRgn = 0;
if (dc->hClipRgn)
{
newdc->w.hClipRgn = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( newdc->w.hClipRgn, dc->w.hClipRgn, 0, RGN_COPY );
newdc->hClipRgn = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( newdc->hClipRgn, dc->hClipRgn, 0, RGN_COPY );
}
else
newdc->w.hClipRgn = 0;
newdc->hClipRgn = 0;
GDI_ReleaseObj( handle );
GDI_ReleaseObj( hdc );
return handle;
@ -334,13 +326,13 @@ void WINAPI SetDCState16( HDC16 hdc, HDC16 hdcs )
{
DC *dc, *dcs;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return;
if (!(dcs = (DC *) GDI_GetObjPtr( hdcs, DC_MAGIC )))
if (!(dc = GDI_GetObjPtr( hdc, DC_MAGIC ))) return;
if (!(dcs = GDI_GetObjPtr( hdcs, DC_MAGIC )))
{
GDI_ReleaseObj( hdc );
return;
}
if (!dcs->w.flags & DC_SAVED)
if (!dcs->flags & DC_SAVED)
{
GDI_ReleaseObj( hdc );
GDI_ReleaseObj( hdcs );
@ -348,39 +340,39 @@ void WINAPI SetDCState16( HDC16 hdc, HDC16 hdcs )
}
TRACE("%04x %04x\n", hdc, hdcs );
dc->w.flags = dcs->w.flags & ~DC_SAVED;
dc->w.devCaps = dcs->w.devCaps;
dc->w.hDevice = dcs->w.hDevice;
dc->w.totalExtent = dcs->w.totalExtent;
dc->w.ROPmode = dcs->w.ROPmode;
dc->w.polyFillMode = dcs->w.polyFillMode;
dc->w.stretchBltMode = dcs->w.stretchBltMode;
dc->w.relAbsMode = dcs->w.relAbsMode;
dc->w.backgroundMode = dcs->w.backgroundMode;
dc->w.backgroundColor = dcs->w.backgroundColor;
dc->w.textColor = dcs->w.textColor;
dc->w.brushOrgX = dcs->w.brushOrgX;
dc->w.brushOrgY = dcs->w.brushOrgY;
dc->w.textAlign = dcs->w.textAlign;
dc->w.charExtra = dcs->w.charExtra;
dc->w.breakTotalExtra = dcs->w.breakTotalExtra;
dc->w.breakCount = dcs->w.breakCount;
dc->w.breakExtra = dcs->w.breakExtra;
dc->w.breakRem = dcs->w.breakRem;
dc->w.MapMode = dcs->w.MapMode;
dc->w.GraphicsMode = dcs->w.GraphicsMode;
dc->flags = dcs->flags & ~DC_SAVED;
dc->devCaps = dcs->devCaps;
dc->hDevice = dcs->hDevice;
dc->totalExtent = dcs->totalExtent;
dc->ROPmode = dcs->ROPmode;
dc->polyFillMode = dcs->polyFillMode;
dc->stretchBltMode = dcs->stretchBltMode;
dc->relAbsMode = dcs->relAbsMode;
dc->backgroundMode = dcs->backgroundMode;
dc->backgroundColor = dcs->backgroundColor;
dc->textColor = dcs->textColor;
dc->brushOrgX = dcs->brushOrgX;
dc->brushOrgY = dcs->brushOrgY;
dc->textAlign = dcs->textAlign;
dc->charExtra = dcs->charExtra;
dc->breakTotalExtra = dcs->breakTotalExtra;
dc->breakCount = dcs->breakCount;
dc->breakExtra = dcs->breakExtra;
dc->breakRem = dcs->breakRem;
dc->MapMode = dcs->MapMode;
dc->GraphicsMode = dcs->GraphicsMode;
#if 0
/* Apparently, the DC origin is not changed by [GS]etDCState */
dc->w.DCOrgX = dcs->w.DCOrgX;
dc->w.DCOrgY = dcs->w.DCOrgY;
dc->DCOrgX = dcs->DCOrgX;
dc->DCOrgY = dcs->DCOrgY;
#endif
dc->w.CursPosX = dcs->w.CursPosX;
dc->w.CursPosY = dcs->w.CursPosY;
dc->w.ArcDirection = dcs->w.ArcDirection;
dc->w.xformWorld2Wnd = dcs->w.xformWorld2Wnd;
dc->w.xformWorld2Vport = dcs->w.xformWorld2Vport;
dc->w.xformVport2World = dcs->w.xformVport2World;
dc->w.vport2WorldValid = dcs->w.vport2WorldValid;
dc->CursPosX = dcs->CursPosX;
dc->CursPosY = dcs->CursPosY;
dc->ArcDirection = dcs->ArcDirection;
dc->xformWorld2Wnd = dcs->xformWorld2Wnd;
dc->xformWorld2Vport = dcs->xformWorld2Vport;
dc->xformVport2World = dcs->xformVport2World;
dc->vport2WorldValid = dcs->vport2WorldValid;
dc->wndOrgX = dcs->wndOrgX;
dc->wndOrgY = dcs->wndOrgY;
@ -391,27 +383,27 @@ void WINAPI SetDCState16( HDC16 hdc, HDC16 hdcs )
dc->vportExtX = dcs->vportExtX;
dc->vportExtY = dcs->vportExtY;
if (!(dc->w.flags & DC_MEMORY)) dc->w.bitsPerPixel = dcs->w.bitsPerPixel;
if (!(dc->flags & DC_MEMORY)) dc->bitsPerPixel = dcs->bitsPerPixel;
if (dcs->w.hClipRgn)
if (dcs->hClipRgn)
{
if (!dc->w.hClipRgn) dc->w.hClipRgn = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( dc->w.hClipRgn, dcs->w.hClipRgn, 0, RGN_COPY );
if (!dc->hClipRgn) dc->hClipRgn = CreateRectRgn( 0, 0, 0, 0 );
CombineRgn( dc->hClipRgn, dcs->hClipRgn, 0, RGN_COPY );
}
else
{
if (dc->w.hClipRgn) DeleteObject16( dc->w.hClipRgn );
dc->w.hClipRgn = 0;
if (dc->hClipRgn) DeleteObject16( dc->hClipRgn );
dc->hClipRgn = 0;
}
CLIPPING_UpdateGCRegion( dc );
SelectObject( hdc, dcs->w.hBitmap );
SelectObject( hdc, dcs->w.hBrush );
SelectObject( hdc, dcs->w.hFont );
SelectObject( hdc, dcs->w.hPen );
SetBkColor( hdc, dcs->w.backgroundColor);
SetTextColor( hdc, dcs->w.textColor);
GDISelectPalette16( hdc, dcs->w.hPalette, FALSE );
SelectObject( hdc, dcs->hBitmap );
SelectObject( hdc, dcs->hBrush );
SelectObject( hdc, dcs->hFont );
SelectObject( hdc, dcs->hPen );
SetBkColor( hdc, dcs->backgroundColor);
SetTextColor( hdc, dcs->textColor);
GDISelectPalette16( hdc, dcs->hPalette, FALSE );
GDI_ReleaseObj( hdcs );
GDI_ReleaseObj( hdc );
}
@ -458,7 +450,7 @@ INT WINAPI SaveDC( HDC hdc )
* SetDCState doesn't allow us to signal an error (which can happen
* when copying paths).
*/
if (!PATH_AssignGdiPath( &dcs->w.path, &dc->w.path ))
if (!PATH_AssignGdiPath( &dcs->path, &dc->path ))
{
GDI_ReleaseObj( hdc );
GDI_ReleaseObj( hdcs );
@ -520,7 +512,7 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
while (dc->saveLevel >= level)
{
HDC16 hdcs = dc->header.hNext;
if (!(dcs = (DC *) GDI_GetObjPtr( hdcs, DC_MAGIC )))
if (!(dcs = GDI_GetObjPtr( hdcs, DC_MAGIC )))
{
GDI_ReleaseObj( hdc );
return FALSE;
@ -529,7 +521,7 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
if (--dc->saveLevel < level)
{
SetDCState16( hdc, hdcs );
if (!PATH_AssignGdiPath( &dc->w.path, &dcs->w.path ))
if (!PATH_AssignGdiPath( &dc->path, &dcs->path ))
/* FIXME: This might not be quite right, since we're
* returning FALSE but still destroying the saved DC state */
success=FALSE;
@ -558,7 +550,7 @@ HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output,
if (!(funcs = DRIVER_FindDriver( buf ))) return 0;
if (!(dc = DC_AllocDC( funcs ))) return 0;
dc->w.flags = 0;
dc->flags = 0;
TRACE("(driver=%s, device=%s, output=%s): returning %04x\n",
debugstr_a(driver), debugstr_a(device), debugstr_a(output), dc->hSelf );
@ -656,7 +648,7 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
DC *dc, *origDC;
const DC_FUNCTIONS *funcs;
if ((origDC = (DC *)GDI_GetObjPtr( hdc, DC_MAGIC ))) funcs = origDC->funcs;
if ((origDC = GDI_GetObjPtr( hdc, DC_MAGIC ))) funcs = origDC->funcs;
else funcs = DRIVER_FindDriver( "DISPLAY" );
if (!funcs || !(dc = DC_AllocDC( funcs )))
@ -668,9 +660,9 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
TRACE("(%04x): returning %04x\n",
hdc, dc->hSelf );
dc->w.flags = DC_MEMORY;
dc->w.bitsPerPixel = 1;
dc->w.hBitmap = hPseudoStockBitmap;
dc->flags = DC_MEMORY;
dc->bitsPerPixel = 1;
dc->hBitmap = hPseudoStockBitmap;
/* Copy the driver-specific physical device info into
* the new DC. The driver may use this read-only info
@ -708,13 +700,13 @@ BOOL16 WINAPI DeleteDC16( HDC16 hdc )
*/
BOOL WINAPI DeleteDC( HDC hdc )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC * dc = GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE;
TRACE("%04x\n", hdc );
/* Call hook procedure to check whether is it OK to delete this DC */
if (dc->hookThunk && !(dc->w.flags & (DC_SAVED | DC_MEMORY)))
if (dc->hookThunk && !(dc->flags & (DC_SAVED | DC_MEMORY)))
{
DCHOOKPROC proc = dc->hookThunk;
if (proc)
@ -730,14 +722,14 @@ BOOL WINAPI DeleteDC( HDC hdc )
{
DC * dcs;
HDC16 hdcs = dc->header.hNext;
if (!(dcs = (DC *) GDI_GetObjPtr( hdcs, DC_MAGIC ))) break;
if (!(dcs = GDI_GetObjPtr( hdcs, DC_MAGIC ))) break;
dc->header.hNext = dcs->header.hNext;
dc->saveLevel--;
GDI_ReleaseObj( hdcs );
DeleteDC( hdcs );
}
if (!(dc->w.flags & DC_SAVED))
if (!(dc->flags & DC_SAVED))
{
SelectObject( hdc, GetStockObject(BLACK_PEN) );
SelectObject( hdc, GetStockObject(WHITE_BRUSH) );
@ -745,12 +737,12 @@ BOOL WINAPI DeleteDC( HDC hdc )
if (dc->funcs->pDeleteDC) dc->funcs->pDeleteDC(dc);
}
if (dc->w.hClipRgn) DeleteObject( dc->w.hClipRgn );
if (dc->w.hVisRgn) DeleteObject( dc->w.hVisRgn );
if (dc->w.hGCClipRgn) DeleteObject( dc->w.hGCClipRgn );
if (dc->w.pAbortProc) THUNK_Free( (FARPROC)dc->w.pAbortProc );
if (dc->hClipRgn) DeleteObject( dc->hClipRgn );
if (dc->hVisRgn) DeleteObject( dc->hVisRgn );
if (dc->hGCClipRgn) DeleteObject( dc->hGCClipRgn );
if (dc->pAbortProc) THUNK_Free( (FARPROC)dc->pAbortProc );
if (dc->hookThunk) THUNK_Free( (FARPROC)dc->hookThunk );
PATH_DestroyGdiPath(&dc->w.path);
PATH_DestroyGdiPath(&dc->path);
return GDI_FreeObject( hdc, dc );
}
@ -803,12 +795,10 @@ INT16 WINAPI GetDeviceCaps16( HDC16 hdc, INT16 cap )
*/
INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc;
INT ret = 0;
POINT pt;
if (!dc) return 0;
/* Device capabilities for the printer */
switch (cap)
{
@ -836,15 +826,16 @@ INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
if (((cap>=46) && (cap<88)) || ((cap>=92) && (cap<104)))
FIXME("(%04x,%d): unsupported DeviceCaps capability, will yield 0!\n",
hdc,cap );
ret = *(WORD *)(((char *)dc->w.devCaps) + cap);
if ((cap == NUMCOLORS) && (ret == 0xffff))
ret = -1;
if ((dc = DC_GetDCPtr( hdc )))
{
ret = *(WORD *)(((char *)dc->devCaps) + cap);
GDI_ReleaseObj( hdc );
if ((cap == NUMCOLORS) && (ret == 0xffff)) ret = -1;
}
break;
}
TRACE("(%04x,%d): returning %d\n", hdc, cap, ret );
GDI_ReleaseObj( hdc );
return ret;
}
@ -870,8 +861,8 @@ COLORREF WINAPI SetBkColor( HDC hdc, COLORREF color )
if (dc->funcs->pSetBkColor)
oldColor = dc->funcs->pSetBkColor(dc, color);
else {
oldColor = dc->w.backgroundColor;
dc->w.backgroundColor = color;
oldColor = dc->backgroundColor;
dc->backgroundColor = color;
}
GDI_ReleaseObj( hdc );
return oldColor;
@ -899,8 +890,8 @@ COLORREF WINAPI SetTextColor( HDC hdc, COLORREF color )
if (dc->funcs->pSetTextColor)
oldColor = dc->funcs->pSetTextColor(dc, color);
else {
oldColor = dc->w.textColor;
dc->w.textColor = color;
oldColor = dc->textColor;
dc->textColor = color;
}
GDI_ReleaseObj( hdc );
return oldColor;
@ -926,8 +917,8 @@ UINT WINAPI SetTextAlign( HDC hdc, UINT align )
if (dc->funcs->pSetTextAlign)
prevAlign = dc->funcs->pSetTextAlign(dc, align);
else {
prevAlign = dc->w.textAlign;
dc->w.textAlign = align;
prevAlign = dc->textAlign;
dc->textAlign = align;
}
GDI_ReleaseObj( hdc );
return prevAlign;
@ -941,12 +932,12 @@ BOOL WINAPI GetDCOrgEx( HDC hDC, LPPOINT lpp )
DC * dc;
if (!lpp) return FALSE;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return FALSE;
if (!(dc = DC_GetDCPtr( hDC ))) return FALSE;
lpp->x = lpp->y = 0;
if (dc->funcs->pGetDCOrgEx) dc->funcs->pGetDCOrgEx( dc, lpp );
lpp->x += dc->w.DCOrgX;
lpp->y += dc->w.DCOrgY;
lpp->x += dc->DCOrgX;
lpp->y += dc->DCOrgY;
GDI_ReleaseObj( hDC );
return TRUE;
}
@ -970,11 +961,11 @@ DWORD WINAPI GetDCOrg16( HDC16 hdc )
DWORD WINAPI SetDCOrg16( HDC16 hdc, INT16 x, INT16 y )
{
DWORD prevOrg;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return 0;
prevOrg = dc->w.DCOrgX | (dc->w.DCOrgY << 16);
dc->w.DCOrgX = x;
dc->w.DCOrgY = y;
prevOrg = dc->DCOrgX | (dc->DCOrgY << 16);
dc->DCOrgX = x;
dc->DCOrgY = y;
GDI_ReleaseObj( hdc );
return prevOrg;
}
@ -986,19 +977,18 @@ DWORD WINAPI SetDCOrg16( HDC16 hdc, INT16 x, INT16 y )
INT WINAPI SetGraphicsMode( HDC hdc, INT mode )
{
INT ret = 0;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
/* One would think that setting the graphics mode to GM_COMPATIBLE
* would also reset the world transformation matrix to the unity
* matrix. However, in Windows, this is not the case. This doesn't
* make a lot of sense to me, but that's the way it is.
*/
if (!dc) return 0;
if ((mode > 0) || (mode <= GM_LAST))
{
ret = dc->w.GraphicsMode;
dc->w.GraphicsMode = mode;
ret = dc->GraphicsMode;
dc->GraphicsMode = mode;
}
GDI_ReleaseObj( hdc );
return ret;
@ -1028,10 +1018,10 @@ INT WINAPI SetArcDirection( HDC hdc, INT nDirection )
return 0;
}
if ((dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC )))
if ((dc = DC_GetDCPtr( hdc )))
{
nOldDirection = dc->w.ArcDirection;
dc->w.ArcDirection = nDirection;
nOldDirection = dc->ArcDirection;
dc->ArcDirection = nDirection;
GDI_ReleaseObj( hdc );
}
return nOldDirection;
@ -1045,8 +1035,8 @@ BOOL WINAPI GetWorldTransform( HDC hdc, LPXFORM xform )
{
DC * dc;
if (!xform) return FALSE;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
*xform = dc->w.xformWorld2Wnd;
if (!(dc = DC_GetDCPtr( hdc ))) return FALSE;
*xform = dc->xformWorld2Wnd;
GDI_ReleaseObj( hdc );
return TRUE;
}
@ -1058,20 +1048,15 @@ BOOL WINAPI GetWorldTransform( HDC hdc, LPXFORM xform )
BOOL WINAPI SetWorldTransform( HDC hdc, const XFORM *xform )
{
BOOL ret = FALSE;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
SetLastError( ERROR_INVALID_HANDLE );
return FALSE;
}
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE;
if (!xform) goto done;
/* Check that graphics mode is GM_ADVANCED */
if (dc->w.GraphicsMode!=GM_ADVANCED) goto done;
if (dc->GraphicsMode!=GM_ADVANCED) goto done;
dc->w.xformWorld2Wnd = *xform;
dc->xformWorld2Wnd = *xform;
DC_UpdateXforms( dc );
ret = TRUE;
done:
@ -1106,35 +1091,31 @@ BOOL WINAPI ModifyWorldTransform( HDC hdc, const XFORM *xform,
DWORD iMode )
{
BOOL ret = FALSE;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
/* Check for illegal parameters */
if (!dc)
{
SetLastError( ERROR_INVALID_HANDLE );
return FALSE;
}
if (!dc) return FALSE;
if (!xform) goto done;
/* Check that graphics mode is GM_ADVANCED */
if (dc->w.GraphicsMode!=GM_ADVANCED) goto done;
if (dc->GraphicsMode!=GM_ADVANCED) goto done;
switch (iMode)
{
case MWT_IDENTITY:
dc->w.xformWorld2Wnd.eM11 = 1.0f;
dc->w.xformWorld2Wnd.eM12 = 0.0f;
dc->w.xformWorld2Wnd.eM21 = 0.0f;
dc->w.xformWorld2Wnd.eM22 = 1.0f;
dc->w.xformWorld2Wnd.eDx = 0.0f;
dc->w.xformWorld2Wnd.eDy = 0.0f;
dc->xformWorld2Wnd.eM11 = 1.0f;
dc->xformWorld2Wnd.eM12 = 0.0f;
dc->xformWorld2Wnd.eM21 = 0.0f;
dc->xformWorld2Wnd.eM22 = 1.0f;
dc->xformWorld2Wnd.eDx = 0.0f;
dc->xformWorld2Wnd.eDy = 0.0f;
break;
case MWT_LEFTMULTIPLY:
CombineTransform( &dc->w.xformWorld2Wnd, xform,
&dc->w.xformWorld2Wnd );
CombineTransform( &dc->xformWorld2Wnd, xform,
&dc->xformWorld2Wnd );
break;
case MWT_RIGHTMULTIPLY:
CombineTransform( &dc->w.xformWorld2Wnd, &dc->w.xformWorld2Wnd,
CombineTransform( &dc->xformWorld2Wnd, &dc->xformWorld2Wnd,
xform );
break;
default:
@ -1204,7 +1185,7 @@ extern WORD CALLBACK GDI_CallTo16_word_wwll(FARPROC16,WORD,WORD,LONG,LONG);
/* ### stop build ### */
BOOL16 WINAPI SetDCHook( HDC16 hdc, FARPROC16 hookProc, DWORD dwHookData )
{
DC *dc = (DC *)GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE;
/*
@ -1238,7 +1219,7 @@ BOOL16 WINAPI SetDCHook( HDC16 hdc, FARPROC16 hookProc, DWORD dwHookData )
*/
DWORD WINAPI GetDCHook( HDC16 hdc, FARPROC16 *phookProc )
{
DC *dc = (DC *)GDI_GetObjPtr( hdc, DC_MAGIC );
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return 0;
*phookProc = dc->hookProc;
GDI_ReleaseObj( hdc );
@ -1251,11 +1232,11 @@ DWORD WINAPI GetDCHook( HDC16 hdc, FARPROC16 *phookProc )
*/
WORD WINAPI SetHookFlags16(HDC16 hDC, WORD flags)
{
DC* dc = (DC*)GDI_GetObjPtr( hDC, DC_MAGIC );
DC *dc = DC_GetDCPtr( hDC );
if( dc )
{
WORD wRet = dc->w.flags & DC_DIRTY;
WORD wRet = dc->flags & DC_DIRTY;
/* "Undocumented Windows" info is slightly confusing.
*/
@ -1263,9 +1244,9 @@ WORD WINAPI SetHookFlags16(HDC16 hDC, WORD flags)
TRACE("hDC %04x, flags %04x\n",hDC,flags);
if( flags & DCHF_INVALIDATEVISRGN )
dc->w.flags |= DC_DIRTY;
dc->flags |= DC_DIRTY;
else if( flags & DCHF_VALIDATEVISRGN || !flags )
dc->w.flags &= ~DC_DIRTY;
dc->flags &= ~DC_DIRTY;
GDI_ReleaseObj( hDC );
return wRet;
}
@ -1382,9 +1363,11 @@ UINT WINAPI SetBoundsRect(HDC hdc, const RECT* rect, UINT flags)
*/
INT WINAPI GetRelAbs( HDC hdc, DWORD dwIgnore )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return 0;
return dc->w.relAbsMode;
INT ret = 0;
DC *dc = DC_GetDCPtr( hdc );
if (dc) ret = dc->relAbsMode;
GDI_ReleaseObj( hdc );
return ret;
}
/***********************************************************************

View File

@ -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)

View File

@ -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)
{

View File

@ -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;

View File

@ -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->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,9 +471,21 @@ BOOL GDI_FreeObject( HGDIOBJ handle, void *ptr )
if (handle < FIRST_STOCK_HANDLE)
{
object->wMagic = 0; /* Mark it as invalid */
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 );
return TRUE;
@ -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);

View File

@ -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,8 +784,8 @@ INT16 WINAPI UpdateColors16( HDC16 hDC )
HWND hWnd;
int size;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return 0;
size = dc->w.devCaps->sizePalette;
if (!(dc = DC_GetDCPtr( hDC ))) return 0;
size = dc->devCaps->sizePalette;
GDI_ReleaseObj( hDC );
hWnd = Callout.WindowFromDC( hDC );

View File

@ -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;

View File

@ -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"

View File

@ -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 )

View File

@ -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 );

View File

@ -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 );