Changed the GDI driver interface to pass an opaque PHYSDEV pointer
instead of a DC structure. Removed some direct accesses to the DC structure from the drivers. Got rid the bitmap driver.
This commit is contained in:
parent
c4912ecd5f
commit
e21c15e39d
|
@ -27,12 +27,10 @@ C_SRCS = \
|
|||
mfdrv/objects.c \
|
||||
mfdrv/text.c \
|
||||
printdrv.c \
|
||||
win16drv/brush.c \
|
||||
win16drv/font.c \
|
||||
win16drv/graphics.c \
|
||||
win16drv/init.c \
|
||||
win16drv/objects.c \
|
||||
win16drv/pen.c \
|
||||
win16drv/prtdrv.c \
|
||||
win16drv/text.c \
|
||||
wing.c
|
||||
|
|
|
@ -96,6 +96,8 @@ static struct graphics_driver *create_driver( HMODULE module )
|
|||
GET_FUNC(FrameRgn);
|
||||
GET_FUNC(GetCharWidth);
|
||||
GET_FUNC(GetDCOrgEx);
|
||||
GET_FUNC(GetDIBColorTable);
|
||||
GET_FUNC(GetDIBits);
|
||||
GET_FUNC(GetDeviceCaps);
|
||||
GET_FUNC(GetDeviceGammaRamp);
|
||||
GET_FUNC(GetPixel);
|
||||
|
@ -127,12 +129,17 @@ static struct graphics_driver *create_driver( HMODULE module )
|
|||
GET_FUNC(SaveDC);
|
||||
GET_FUNC(ScaleViewportExt);
|
||||
GET_FUNC(ScaleWindowExt);
|
||||
GET_FUNC(SelectBitmap);
|
||||
GET_FUNC(SelectBrush);
|
||||
GET_FUNC(SelectClipPath);
|
||||
GET_FUNC(SelectClipRgn);
|
||||
GET_FUNC(SelectObject);
|
||||
GET_FUNC(SelectFont);
|
||||
GET_FUNC(SelectPalette);
|
||||
GET_FUNC(SelectPen);
|
||||
GET_FUNC(SetBkColor);
|
||||
GET_FUNC(SetBkMode);
|
||||
GET_FUNC(SetDIBColorTable);
|
||||
GET_FUNC(SetDIBits);
|
||||
GET_FUNC(SetDIBitsToDevice);
|
||||
GET_FUNC(SetDeviceClipping);
|
||||
GET_FUNC(SetDeviceGammaRamp);
|
||||
|
|
|
@ -23,78 +23,78 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
|
||||
|
||||
INT EMFDRV_SaveDC( DC *dc )
|
||||
INT EMFDRV_SaveDC( PHYSDEV dev )
|
||||
{
|
||||
EMRSAVEDC emr;
|
||||
emr.emr.iType = EMR_SAVEDC;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_RestoreDC( DC *dc, INT level )
|
||||
BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level )
|
||||
{
|
||||
EMRRESTOREDC emr;
|
||||
emr.emr.iType = EMR_RESTOREDC;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.iRelative = level;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
UINT EMFDRV_SetTextAlign( DC *dc, UINT align )
|
||||
UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align )
|
||||
{
|
||||
EMRSETTEXTALIGN emr;
|
||||
emr.emr.iType = EMR_SETTEXTALIGN;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.iMode = align;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
INT EMFDRV_SetBkMode( DC *dc, INT mode )
|
||||
INT EMFDRV_SetBkMode( PHYSDEV dev, INT mode )
|
||||
{
|
||||
EMRSETBKMODE emr;
|
||||
emr.emr.iType = EMR_SETBKMODE;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.iMode = mode;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
INT EMFDRV_SetROP2( DC *dc, INT rop )
|
||||
INT EMFDRV_SetROP2( PHYSDEV dev, INT rop )
|
||||
{
|
||||
EMRSETROP2 emr;
|
||||
emr.emr.iType = EMR_SETROP2;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.iMode = rop;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
INT EMFDRV_SetPolyFillMode( DC *dc, INT mode )
|
||||
INT EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode )
|
||||
{
|
||||
EMRSETPOLYFILLMODE emr;
|
||||
emr.emr.iType = EMR_SETPOLYFILLMODE;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.iMode = mode;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
INT EMFDRV_SetStretchBltMode( DC *dc, INT mode )
|
||||
INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
|
||||
{
|
||||
EMRSETSTRETCHBLTMODE emr;
|
||||
emr.emr.iType = EMR_SETSTRETCHBLTMODE;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.iMode = mode;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
INT EMFDRV_SetMapMode( DC *dc, INT mode )
|
||||
INT EMFDRV_SetMapMode( PHYSDEV dev, INT mode )
|
||||
{
|
||||
EMRSETMAPMODE emr;
|
||||
emr.emr.iType = EMR_SETMAPMODE;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.iMode = mode;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
INT EMFDRV_ExcludeClipRect( DC *dc, INT left, INT top, INT right, INT bottom )
|
||||
INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
||||
{
|
||||
EMREXCLUDECLIPRECT emr;
|
||||
emr.emr.iType = EMR_EXCLUDECLIPRECT;
|
||||
|
@ -103,10 +103,10 @@ INT EMFDRV_ExcludeClipRect( DC *dc, INT left, INT top, INT right, INT bottom )
|
|||
emr.rclClip.top = top;
|
||||
emr.rclClip.right = right;
|
||||
emr.rclClip.bottom = bottom;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
INT EMFDRV_IntersectClipRect( DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
EMRINTERSECTCLIPRECT emr;
|
||||
emr.emr.iType = EMR_INTERSECTCLIPRECT;
|
||||
|
@ -115,20 +115,20 @@ INT EMFDRV_IntersectClipRect( DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
emr.rclClip.top = top;
|
||||
emr.rclClip.right = right;
|
||||
emr.rclClip.bottom = bottom;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
INT EMFDRV_OffsetClipRgn( DC *dc, INT x, INT y )
|
||||
INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
EMROFFSETCLIPRGN emr;
|
||||
emr.emr.iType = EMR_OFFSETCLIPRGN;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.ptlOffset.x = x;
|
||||
emr.ptlOffset.y = y;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
DWORD EMFDRV_SetMapperFlags( DC *dc, DWORD flags )
|
||||
DWORD EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )
|
||||
{
|
||||
EMRSETMAPPERFLAGS emr;
|
||||
|
||||
|
@ -136,50 +136,50 @@ DWORD EMFDRV_SetMapperFlags( DC *dc, DWORD flags )
|
|||
emr.emr.nSize = sizeof(emr);
|
||||
emr.dwFlags = flags;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_AbortPath( DC *dc )
|
||||
BOOL EMFDRV_AbortPath( PHYSDEV dev )
|
||||
{
|
||||
EMRABORTPATH emr;
|
||||
|
||||
emr.emr.iType = EMR_ABORTPATH;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_BeginPath( DC *dc )
|
||||
BOOL EMFDRV_BeginPath( PHYSDEV dev )
|
||||
{
|
||||
EMRBEGINPATH emr;
|
||||
|
||||
emr.emr.iType = EMR_BEGINPATH;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_CloseFigure( DC *dc )
|
||||
BOOL EMFDRV_CloseFigure( PHYSDEV dev )
|
||||
{
|
||||
EMRCLOSEFIGURE emr;
|
||||
|
||||
emr.emr.iType = EMR_CLOSEFIGURE;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_EndPath( DC *dc )
|
||||
BOOL EMFDRV_EndPath( PHYSDEV dev )
|
||||
{
|
||||
EMRENDPATH emr;
|
||||
|
||||
emr.emr.iType = EMR_ENDPATH;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_FillPath( DC *dc )
|
||||
BOOL EMFDRV_FillPath( PHYSDEV dev )
|
||||
{
|
||||
EMRFILLPATH emr;
|
||||
|
||||
|
@ -190,20 +190,20 @@ BOOL EMFDRV_FillPath( DC *dc )
|
|||
emr.rclBounds.top = 0;
|
||||
emr.rclBounds.right = 0;
|
||||
emr.rclBounds.bottom = 0;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_FlattenPath( DC *dc )
|
||||
BOOL EMFDRV_FlattenPath( PHYSDEV dev )
|
||||
{
|
||||
EMRFLATTENPATH emr;
|
||||
|
||||
emr.emr.iType = EMR_FLATTENPATH;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_SelectClipPath( DC *dc, INT iMode )
|
||||
BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode )
|
||||
{
|
||||
EMRSELECTCLIPPATH emr;
|
||||
|
||||
|
@ -211,10 +211,10 @@ BOOL EMFDRV_SelectClipPath( DC *dc, INT iMode )
|
|||
emr.emr.nSize = sizeof(emr);
|
||||
emr.iMode = iMode;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_StrokeAndFillPath( DC *dc )
|
||||
BOOL EMFDRV_StrokeAndFillPath( PHYSDEV dev )
|
||||
{
|
||||
EMRSTROKEANDFILLPATH emr;
|
||||
|
||||
|
@ -225,10 +225,10 @@ BOOL EMFDRV_StrokeAndFillPath( DC *dc )
|
|||
emr.rclBounds.top = 0;
|
||||
emr.rclBounds.right = 0;
|
||||
emr.rclBounds.bottom = 0;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_StrokePath( DC *dc )
|
||||
BOOL EMFDRV_StrokePath( PHYSDEV dev )
|
||||
{
|
||||
EMRSTROKEPATH emr;
|
||||
|
||||
|
@ -239,15 +239,15 @@ BOOL EMFDRV_StrokePath( DC *dc )
|
|||
emr.rclBounds.top = 0;
|
||||
emr.rclBounds.right = 0;
|
||||
emr.rclBounds.bottom = 0;
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_WidenPath( DC *dc )
|
||||
BOOL EMFDRV_WidenPath( PHYSDEV dev )
|
||||
{
|
||||
EMRWIDENPATH emr;
|
||||
|
||||
emr.emr.iType = EMR_WIDENPATH;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
|
|
@ -29,109 +29,114 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
HDC hdc;
|
||||
DC *dc;
|
||||
ENHMETAHEADER *emh; /* Pointer to enhanced metafile header */
|
||||
UINT nextHandle; /* Next handle number */
|
||||
HFILE hFile; /* HFILE for disk based MetaFile */
|
||||
} EMFDRV_PDEVICE;
|
||||
|
||||
|
||||
extern BOOL EMFDRV_WriteRecord( DC *dc, EMR *emr );
|
||||
extern int EMFDRV_AddHandleDC( DC *dc );
|
||||
extern void EMFDRV_UpdateBBox( DC *dc, RECTL *rect );
|
||||
extern DWORD EMFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush );
|
||||
extern BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr );
|
||||
extern int EMFDRV_AddHandleDC( PHYSDEV dev );
|
||||
extern void EMFDRV_UpdateBBox( PHYSDEV dev, RECTL *rect );
|
||||
extern DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush );
|
||||
|
||||
/* Metafile driver functions */
|
||||
extern BOOL EMFDRV_AbortPath( DC *dc );
|
||||
extern BOOL EMFDRV_Arc( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL EMFDRV_AbortPath( PHYSDEV dev );
|
||||
extern BOOL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart, INT xend,
|
||||
INT yend );
|
||||
extern BOOL EMFDRV_BeginPath( DC *dc );
|
||||
extern BOOL EMFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst,
|
||||
INT width, INT height, DC *dcSrc,
|
||||
extern BOOL EMFDRV_BeginPath( PHYSDEV dev );
|
||||
extern BOOL EMFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst,
|
||||
INT width, INT height, PHYSDEV devSrc,
|
||||
INT xSrc, INT ySrc, DWORD rop );
|
||||
extern BOOL EMFDRV_Chord( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart, INT xend,
|
||||
INT yend );
|
||||
extern BOOL EMFDRV_CloseFigure( DC *dc );
|
||||
extern BOOL EMFDRV_Ellipse( DC *dc, INT left, INT top,
|
||||
extern BOOL EMFDRV_CloseFigure( PHYSDEV dev );
|
||||
extern BOOL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top,
|
||||
INT right, INT bottom );
|
||||
extern BOOL EMFDRV_EndPath( DC *dc );
|
||||
extern INT EMFDRV_ExcludeClipRect( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL EMFDRV_EndPath( PHYSDEV dev );
|
||||
extern INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom );
|
||||
extern BOOL EMFDRV_ExtFloodFill( DC *dc, INT x, INT y,
|
||||
extern BOOL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y,
|
||||
COLORREF color, UINT fillType );
|
||||
extern BOOL EMFDRV_ExtTextOut( DC *dc, INT x, INT y,
|
||||
extern BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
|
||||
UINT flags, const RECT *lprect, LPCSTR str,
|
||||
UINT count, const INT *lpDx );
|
||||
extern BOOL EMFDRV_FillPath( DC *dc );
|
||||
extern BOOL EMFDRV_FillRgn( DC *dc, HRGN hrgn, HBRUSH hbrush );
|
||||
extern BOOL EMFDRV_FlattenPath( DC *dc );
|
||||
extern BOOL EMFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT width,
|
||||
extern BOOL EMFDRV_FillPath( PHYSDEV dev );
|
||||
extern BOOL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush );
|
||||
extern BOOL EMFDRV_FlattenPath( PHYSDEV dev );
|
||||
extern BOOL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width,
|
||||
INT height );
|
||||
extern INT EMFDRV_IntersectClipRect( DC *dc, INT left, INT top, INT right,
|
||||
extern INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom );
|
||||
extern BOOL EMFDRV_InvertRgn( DC *dc, HRGN hrgn );
|
||||
extern BOOL EMFDRV_LineTo( DC *dc, INT x, INT y );
|
||||
extern BOOL EMFDRV_MoveTo( DC *dc, INT x, INT y );
|
||||
extern INT EMFDRV_OffsetClipRgn( DC *dc, INT x, INT y );
|
||||
extern BOOL EMFDRV_OffsetViewportOrg( DC *dc, INT x, INT y );
|
||||
extern BOOL EMFDRV_OffsetWindowOrg( DC *dc, INT x, INT y );
|
||||
extern BOOL EMFDRV_PaintRgn( DC *dc, HRGN hrgn );
|
||||
extern BOOL EMFDRV_PatBlt( DC *dc, INT left, INT top,
|
||||
extern BOOL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn );
|
||||
extern BOOL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL EMFDRV_MoveTo( PHYSDEV dev, INT x, INT y );
|
||||
extern INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL EMFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn );
|
||||
extern BOOL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top,
|
||||
INT width, INT height, DWORD rop );
|
||||
extern BOOL EMFDRV_Pie( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart, INT xend,
|
||||
INT yend );
|
||||
extern BOOL EMFDRV_PolyPolygon( DC *dc, const POINT* pt,
|
||||
extern BOOL EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt,
|
||||
const INT* counts, UINT polys);
|
||||
extern BOOL EMFDRV_PolyPolyline( DC *dc, const POINT* pt,
|
||||
extern BOOL EMFDRV_PolyPolyline( PHYSDEV dev, const POINT* pt,
|
||||
const DWORD* counts, DWORD polys);
|
||||
extern BOOL EMFDRV_Polygon( DC *dc, const POINT* pt, INT count );
|
||||
extern BOOL EMFDRV_Polyline( DC *dc, const POINT* pt,INT count);
|
||||
extern BOOL EMFDRV_Rectangle( DC *dc, INT left, INT top,
|
||||
extern BOOL EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count );
|
||||
extern BOOL EMFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count);
|
||||
extern BOOL EMFDRV_Rectangle( PHYSDEV dev, INT left, INT top,
|
||||
INT right, INT bottom);
|
||||
extern BOOL EMFDRV_RestoreDC( DC *dc, INT level );
|
||||
extern BOOL EMFDRV_RoundRect( DC *dc, INT left, INT top,
|
||||
extern BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level );
|
||||
extern BOOL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top,
|
||||
INT right, INT bottom, INT ell_width,
|
||||
INT ell_height );
|
||||
extern INT EMFDRV_SaveDC( DC *dc );
|
||||
extern BOOL EMFDRV_ScaleViewportExt( DC *dc, INT xNum,
|
||||
extern INT EMFDRV_SaveDC( PHYSDEV dev );
|
||||
extern BOOL EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum,
|
||||
INT xDenom, INT yNum, INT yDenom );
|
||||
extern BOOL EMFDRV_ScaleWindowExt( DC *dc, INT xNum, INT xDenom,
|
||||
extern BOOL EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom,
|
||||
INT yNum, INT yDenom );
|
||||
extern BOOL EMFDRV_SelectClipPath( DC *dc, INT iMode );
|
||||
extern HGDIOBJ EMFDRV_SelectObject( DC *dc, HGDIOBJ handle );
|
||||
extern COLORREF EMFDRV_SetBkColor( DC *dc, COLORREF color );
|
||||
extern INT EMFDRV_SetBkMode( DC *dc, INT mode );
|
||||
extern INT EMFDRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest,
|
||||
extern HBITMAP EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle );
|
||||
extern HBRUSH EMFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle );
|
||||
extern BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode );
|
||||
extern HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT handle );
|
||||
extern HPEN EMFDRV_SelectPen( PHYSDEV dev, HPEN handle );
|
||||
extern COLORREF EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color );
|
||||
extern INT EMFDRV_SetBkMode( PHYSDEV dev, INT mode );
|
||||
extern INT EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest,
|
||||
DWORD cx, DWORD cy, INT xSrc,
|
||||
INT ySrc, UINT startscan, UINT lines,
|
||||
LPCVOID bits, const BITMAPINFO *info,
|
||||
UINT coloruse );
|
||||
extern INT EMFDRV_SetMapMode( DC *dc, INT mode );
|
||||
extern DWORD EMFDRV_SetMapperFlags( DC *dc, DWORD flags );
|
||||
extern COLORREF EMFDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
|
||||
extern INT EMFDRV_SetPolyFillMode( DC *dc, INT mode );
|
||||
extern INT EMFDRV_SetROP2( DC *dc, INT rop );
|
||||
extern INT EMFDRV_SetStretchBltMode( DC *dc, INT mode );
|
||||
extern UINT EMFDRV_SetTextAlign( DC *dc, UINT align );
|
||||
extern COLORREF EMFDRV_SetTextColor( DC *dc, COLORREF color );
|
||||
extern BOOL EMFDRV_SetViewportExt( DC *dc, INT x, INT y );
|
||||
extern BOOL EMFDRV_SetViewportOrg( DC *dc, INT x, INT y );
|
||||
extern BOOL EMFDRV_SetWindowExt( DC *dc, INT x, INT y );
|
||||
extern BOOL EMFDRV_SetWindowOrg( DC *dc, INT x, INT y );
|
||||
extern BOOL EMFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst,
|
||||
extern INT EMFDRV_SetMapMode( PHYSDEV dev, INT mode );
|
||||
extern DWORD EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags );
|
||||
extern COLORREF EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color );
|
||||
extern INT EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode );
|
||||
extern INT EMFDRV_SetROP2( PHYSDEV dev, INT rop );
|
||||
extern INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode );
|
||||
extern UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align );
|
||||
extern COLORREF EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color );
|
||||
extern BOOL EMFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL EMFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst,
|
||||
DC *dcSrc, INT xSrc, INT ySrc,
|
||||
PHYSDEV devSrc, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, DWORD rop );
|
||||
extern INT EMFDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
|
||||
extern INT EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc,
|
||||
const void *bits, const BITMAPINFO *info,
|
||||
UINT wUsage, DWORD dwRop );
|
||||
extern BOOL EMFDRV_StrokeAndFillPath( DC *dc );
|
||||
extern BOOL EMFDRV_StrokePath( DC *dc );
|
||||
extern BOOL EMFDRV_WidenPath( DC *dc );
|
||||
extern BOOL EMFDRV_StrokeAndFillPath( PHYSDEV dev );
|
||||
extern BOOL EMFDRV_StrokePath( PHYSDEV dev );
|
||||
extern BOOL EMFDRV_WidenPath( PHYSDEV dev );
|
||||
|
||||
|
||||
#endif /* __WINE_METAFILEDRV_H */
|
||||
|
|
|
@ -31,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
|
|||
* EMFDRV_MoveTo
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_MoveTo(DC *dc, INT x, INT y)
|
||||
EMFDRV_MoveTo(PHYSDEV dev, INT x, INT y)
|
||||
{
|
||||
EMRMOVETOEX emr;
|
||||
|
||||
|
@ -40,24 +40,26 @@ EMFDRV_MoveTo(DC *dc, INT x, INT y)
|
|||
emr.ptl.x = x;
|
||||
emr.ptl.y = y;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* EMFDRV_LineTo
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_LineTo( DC *dc, INT x, INT y )
|
||||
EMFDRV_LineTo( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
EMRLINETO emr;
|
||||
RECTL bounds;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
emr.emr.iType = EMR_LINETO;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.ptl.x = x;
|
||||
emr.ptl.y = y;
|
||||
|
||||
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
|
||||
if(!EMFDRV_WriteRecord( dev, &emr.emr ))
|
||||
return FALSE;
|
||||
|
||||
bounds.left = min(x, dc->CursPosX);
|
||||
|
@ -65,7 +67,7 @@ EMFDRV_LineTo( DC *dc, INT x, INT y )
|
|||
bounds.right = max(x, dc->CursPosX);
|
||||
bounds.bottom = max(y, dc->CursPosY);
|
||||
|
||||
EMFDRV_UpdateBBox( dc, &bounds );
|
||||
EMFDRV_UpdateBBox( dev, &bounds );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -75,7 +77,7 @@ EMFDRV_LineTo( DC *dc, INT x, INT y )
|
|||
* EMFDRV_ArcChordPie
|
||||
*/
|
||||
static BOOL
|
||||
EMFDRV_ArcChordPie( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend, DWORD iType )
|
||||
{
|
||||
INT temp, xCentre, yCentre, i;
|
||||
|
@ -83,6 +85,8 @@ EMFDRV_ArcChordPie( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
double xinterStart, yinterStart, xinterEnd, yinterEnd;
|
||||
EMRARC emr;
|
||||
RECTL bounds;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if(left == right || top == bottom) return FALSE;
|
||||
|
||||
|
@ -167,9 +171,9 @@ EMFDRV_ArcChordPie( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
if(bounds.top > yCentre) bounds.top = yCentre;
|
||||
else if(bounds.bottom < yCentre) bounds.right = yCentre;
|
||||
}
|
||||
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
|
||||
if(!EMFDRV_WriteRecord( dev, &emr.emr ))
|
||||
return FALSE;
|
||||
EMFDRV_UpdateBBox( dc, &bounds );
|
||||
EMFDRV_UpdateBBox( dev, &bounds );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -178,10 +182,10 @@ EMFDRV_ArcChordPie( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* EMFDRV_Arc
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_Arc( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return EMFDRV_ArcChordPie( dc, left, top, right, bottom, xstart, ystart,
|
||||
return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
|
||||
xend, yend, EMR_ARC );
|
||||
}
|
||||
|
||||
|
@ -189,10 +193,10 @@ EMFDRV_Arc( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* EMFDRV_Pie
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_Pie( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return EMFDRV_ArcChordPie( dc, left, top, right, bottom, xstart, ystart,
|
||||
return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
|
||||
xend, yend, EMR_PIE );
|
||||
}
|
||||
|
||||
|
@ -201,10 +205,10 @@ EMFDRV_Pie( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* EMFDRV_Chord
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_Chord( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return EMFDRV_ArcChordPie( dc, left, top, right, bottom, xstart, ystart,
|
||||
return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
|
||||
xend, yend, EMR_CHORD );
|
||||
}
|
||||
|
||||
|
@ -212,10 +216,12 @@ EMFDRV_Chord( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* EMFDRV_Ellipse
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
|
||||
EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
||||
{
|
||||
EMRELLIPSE emr;
|
||||
INT temp;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("%d,%d - %d,%d\n", left, top, right, bottom);
|
||||
|
||||
|
@ -236,18 +242,20 @@ EMFDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
|
|||
emr.rclBox.right = right;
|
||||
emr.rclBox.bottom = bottom;
|
||||
|
||||
EMFDRV_UpdateBBox( dc, &emr.rclBox );
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
EMFDRV_UpdateBBox( dev, &emr.rclBox );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* EMFDRV_Rectangle
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
EMRRECTANGLE emr;
|
||||
INT temp;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("%d,%d - %d,%d\n", left, top, right, bottom);
|
||||
|
||||
|
@ -268,19 +276,21 @@ EMFDRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
emr.rclBox.right = right;
|
||||
emr.rclBox.bottom = bottom;
|
||||
|
||||
EMFDRV_UpdateBBox( dc, &emr.rclBox );
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
EMFDRV_UpdateBBox( dev, &emr.rclBox );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* EMFDRV_RoundRect
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
||||
EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom, INT ell_width, INT ell_height )
|
||||
{
|
||||
EMRROUNDRECT emr;
|
||||
INT temp;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if(left == right || top == bottom) return FALSE;
|
||||
|
||||
|
@ -301,15 +311,15 @@ EMFDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
emr.szlCorner.cx = ell_width;
|
||||
emr.szlCorner.cy = ell_height;
|
||||
|
||||
EMFDRV_UpdateBBox( dc, &emr.rclBox );
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
EMFDRV_UpdateBBox( dev, &emr.rclBox );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* EMFDRV_SetPixel
|
||||
*/
|
||||
COLORREF
|
||||
EMFDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
||||
EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -321,7 +331,7 @@ EMFDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
|||
* Helper for EMFDRV_Poly{line|gon}
|
||||
*/
|
||||
static BOOL
|
||||
EMFDRV_Polylinegon( DC *dc, const POINT* pt, INT count, DWORD iType )
|
||||
EMFDRV_Polylinegon( PHYSDEV dev, const POINT* pt, INT count, DWORD iType )
|
||||
{
|
||||
EMRPOLYLINE *emr;
|
||||
DWORD size;
|
||||
|
@ -351,9 +361,9 @@ EMFDRV_Polylinegon( DC *dc, const POINT* pt, INT count, DWORD iType )
|
|||
emr->cptl = count;
|
||||
memcpy(emr->aptl, pt, count * sizeof(POINTL));
|
||||
|
||||
ret = EMFDRV_WriteRecord( dc, &emr->emr );
|
||||
ret = EMFDRV_WriteRecord( dev, &emr->emr );
|
||||
if(ret)
|
||||
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
|
||||
EMFDRV_UpdateBBox( dev, &emr->rclBounds );
|
||||
HeapFree( GetProcessHeap(), 0, emr );
|
||||
return ret;
|
||||
}
|
||||
|
@ -363,19 +373,19 @@ EMFDRV_Polylinegon( DC *dc, const POINT* pt, INT count, DWORD iType )
|
|||
* EMFDRV_Polyline
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_Polyline( DC *dc, const POINT* pt, INT count )
|
||||
EMFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
|
||||
{
|
||||
return EMFDRV_Polylinegon( dc, pt, count, EMR_POLYLINE );
|
||||
return EMFDRV_Polylinegon( dev, pt, count, EMR_POLYLINE );
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* EMFDRV_Polygon
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_Polygon( DC *dc, const POINT* pt, INT count )
|
||||
EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
|
||||
{
|
||||
if(count < 2) return FALSE;
|
||||
return EMFDRV_Polylinegon( dc, pt, count, EMR_POLYGON );
|
||||
return EMFDRV_Polylinegon( dev, pt, count, EMR_POLYGON );
|
||||
}
|
||||
|
||||
|
||||
|
@ -385,7 +395,7 @@ EMFDRV_Polygon( DC *dc, const POINT* pt, INT count )
|
|||
* Helper for EMFDRV_PolyPoly{line|gon}
|
||||
*/
|
||||
static BOOL
|
||||
EMFDRV_PolyPolylinegon( DC *dc, const POINT* pt, const INT* counts, UINT polys,
|
||||
EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys,
|
||||
DWORD iType)
|
||||
{
|
||||
EMRPOLYPOLYLINE *emr;
|
||||
|
@ -421,9 +431,9 @@ EMFDRV_PolyPolylinegon( DC *dc, const POINT* pt, const INT* counts, UINT polys,
|
|||
emr->cptl = cptl;
|
||||
memcpy(emr->aPolyCounts, counts, polys * sizeof(DWORD));
|
||||
memcpy(emr->aPolyCounts + polys, pt, cptl * sizeof(POINTL));
|
||||
ret = EMFDRV_WriteRecord( dc, &emr->emr );
|
||||
ret = EMFDRV_WriteRecord( dev, &emr->emr );
|
||||
if(ret)
|
||||
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
|
||||
EMFDRV_UpdateBBox( dev, &emr->rclBounds );
|
||||
HeapFree( GetProcessHeap(), 0, emr );
|
||||
return ret;
|
||||
}
|
||||
|
@ -432,9 +442,9 @@ EMFDRV_PolyPolylinegon( DC *dc, const POINT* pt, const INT* counts, UINT polys,
|
|||
* EMFDRV_PolyPolyline
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_PolyPolyline(DC *dc, const POINT* pt, const DWORD* counts, DWORD polys)
|
||||
EMFDRV_PolyPolyline(PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polys)
|
||||
{
|
||||
return EMFDRV_PolyPolylinegon( dc, pt, (INT *)counts, polys,
|
||||
return EMFDRV_PolyPolylinegon( dev, pt, (INT *)counts, polys,
|
||||
EMR_POLYPOLYLINE );
|
||||
}
|
||||
|
||||
|
@ -442,9 +452,9 @@ EMFDRV_PolyPolyline(DC *dc, const POINT* pt, const DWORD* counts, DWORD polys)
|
|||
* EMFDRV_PolyPolygon
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polys )
|
||||
EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys )
|
||||
{
|
||||
return EMFDRV_PolyPolylinegon( dc, pt, counts, polys, EMR_POLYPOLYGON );
|
||||
return EMFDRV_PolyPolylinegon( dev, pt, counts, polys, EMR_POLYPOLYGON );
|
||||
}
|
||||
|
||||
|
||||
|
@ -452,7 +462,7 @@ EMFDRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polys )
|
|||
* EMFDRV_ExtFloodFill
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_ExtFloodFill( DC *dc, INT x, INT y, COLORREF color, UINT fillType )
|
||||
EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType )
|
||||
{
|
||||
EMREXTFLOODFILL emr;
|
||||
|
||||
|
@ -463,20 +473,20 @@ EMFDRV_ExtFloodFill( DC *dc, INT x, INT y, COLORREF color, UINT fillType )
|
|||
emr.crColor = color;
|
||||
emr.iMode = fillType;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* EMFDRV_FillRgn
|
||||
*/
|
||||
BOOL EMFDRV_FillRgn( DC *dc, HRGN hrgn, HBRUSH hbrush )
|
||||
BOOL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush )
|
||||
{
|
||||
EMRFILLRGN *emr;
|
||||
DWORD size, rgnsize, index;
|
||||
BOOL ret;
|
||||
|
||||
index = EMFDRV_CreateBrushIndirect( dc, hbrush );
|
||||
index = EMFDRV_CreateBrushIndirect( dev, hbrush );
|
||||
if(!index) return FALSE;
|
||||
|
||||
rgnsize = GetRegionData( hrgn, 0, NULL );
|
||||
|
@ -494,22 +504,22 @@ BOOL EMFDRV_FillRgn( DC *dc, HRGN hrgn, HBRUSH hbrush )
|
|||
emr->cbRgnData = rgnsize;
|
||||
emr->ihBrush = index;
|
||||
|
||||
ret = EMFDRV_WriteRecord( dc, &emr->emr );
|
||||
ret = EMFDRV_WriteRecord( dev, &emr->emr );
|
||||
if(ret)
|
||||
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
|
||||
EMFDRV_UpdateBBox( dev, &emr->rclBounds );
|
||||
HeapFree( GetProcessHeap(), 0, emr );
|
||||
return ret;
|
||||
}
|
||||
/*********************************************************************
|
||||
* EMFDRV_FrameRgn
|
||||
*/
|
||||
BOOL EMFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
|
||||
BOOL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
|
||||
{
|
||||
EMRFRAMERGN *emr;
|
||||
DWORD size, rgnsize, index;
|
||||
BOOL ret;
|
||||
|
||||
index = EMFDRV_CreateBrushIndirect( dc, hbrush );
|
||||
index = EMFDRV_CreateBrushIndirect( dev, hbrush );
|
||||
if(!index) return FALSE;
|
||||
|
||||
rgnsize = GetRegionData( hrgn, 0, NULL );
|
||||
|
@ -529,9 +539,9 @@ BOOL EMFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
|
|||
emr->szlStroke.cx = width;
|
||||
emr->szlStroke.cy = height;
|
||||
|
||||
ret = EMFDRV_WriteRecord( dc, &emr->emr );
|
||||
ret = EMFDRV_WriteRecord( dev, &emr->emr );
|
||||
if(ret)
|
||||
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
|
||||
EMFDRV_UpdateBBox( dev, &emr->rclBounds );
|
||||
HeapFree( GetProcessHeap(), 0, emr );
|
||||
return ret;
|
||||
}
|
||||
|
@ -541,7 +551,7 @@ BOOL EMFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
|
|||
*
|
||||
* Helper for EMFDRV_{Paint|Invert}Rgn
|
||||
*/
|
||||
static BOOL EMFDRV_PaintInvertRgn( DC *dc, HRGN hrgn, DWORD iType )
|
||||
static BOOL EMFDRV_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType )
|
||||
{
|
||||
EMRINVERTRGN *emr;
|
||||
DWORD size, rgnsize;
|
||||
|
@ -562,9 +572,9 @@ static BOOL EMFDRV_PaintInvertRgn( DC *dc, HRGN hrgn, DWORD iType )
|
|||
emr->rclBounds.bottom = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.bottom - 1;
|
||||
emr->cbRgnData = rgnsize;
|
||||
|
||||
ret = EMFDRV_WriteRecord( dc, &emr->emr );
|
||||
ret = EMFDRV_WriteRecord( dev, &emr->emr );
|
||||
if(ret)
|
||||
EMFDRV_UpdateBBox( dc, &emr->rclBounds );
|
||||
EMFDRV_UpdateBBox( dev, &emr->rclBounds );
|
||||
HeapFree( GetProcessHeap(), 0, emr );
|
||||
return ret;
|
||||
}
|
||||
|
@ -573,25 +583,25 @@ static BOOL EMFDRV_PaintInvertRgn( DC *dc, HRGN hrgn, DWORD iType )
|
|||
* EMFDRV_PaintRgn
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_PaintRgn( DC *dc, HRGN hrgn )
|
||||
EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn )
|
||||
{
|
||||
return EMFDRV_PaintInvertRgn( dc, hrgn, EMR_PAINTRGN );
|
||||
return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_PAINTRGN );
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* EMFDRV_InvertRgn
|
||||
*/
|
||||
BOOL
|
||||
EMFDRV_InvertRgn( DC *dc, HRGN hrgn )
|
||||
EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn )
|
||||
{
|
||||
return EMFDRV_PaintInvertRgn( dc, hrgn, EMR_INVERTRGN );
|
||||
return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_INVERTRGN );
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* EMFDRV_SetBkColor
|
||||
*/
|
||||
COLORREF
|
||||
EMFDRV_SetBkColor( DC *dc, COLORREF color )
|
||||
EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color )
|
||||
{
|
||||
EMRSETBKCOLOR emr;
|
||||
|
||||
|
@ -599,7 +609,7 @@ EMFDRV_SetBkColor( DC *dc, COLORREF color )
|
|||
emr.emr.nSize = sizeof(emr);
|
||||
emr.crColor = color;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
|
||||
}
|
||||
|
||||
|
||||
|
@ -607,7 +617,7 @@ EMFDRV_SetBkColor( DC *dc, COLORREF color )
|
|||
* EMFDRV_SetTextColor
|
||||
*/
|
||||
COLORREF
|
||||
EMFDRV_SetTextColor( DC *dc, COLORREF color )
|
||||
EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color )
|
||||
{
|
||||
EMRSETTEXTCOLOR emr;
|
||||
|
||||
|
@ -615,5 +625,5 @@ EMFDRV_SetTextColor( DC *dc, COLORREF color )
|
|||
emr.emr.nSize = sizeof(emr);
|
||||
emr.crColor = color;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
|
|||
EMFDRV_Chord, /* pChord */
|
||||
EMFDRV_CloseFigure, /* pCloseFigure */
|
||||
NULL, /* pCreateBitmap */
|
||||
NULL, /* no implementation */ /* pCreateDC */
|
||||
NULL, /* pCreateDC */
|
||||
NULL, /* pCreateDIBSection */
|
||||
NULL, /* no implementation */ /* pDeleteDC */
|
||||
NULL, /* pDeleteDC */
|
||||
NULL, /* pDeleteObject */
|
||||
NULL, /* pDescribePixelFormat */
|
||||
NULL, /* pDeviceCapabilities */
|
||||
|
@ -64,9 +64,11 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
|
|||
EMFDRV_FrameRgn, /* pFrameRgn */
|
||||
NULL, /* pGetCharWidth */
|
||||
NULL, /* pGetDCOrgEx */
|
||||
NULL, /* pGetDIBColorTable */
|
||||
NULL, /* pGetDIBits */
|
||||
NULL, /* pGetDeviceCaps */
|
||||
NULL, /* pGetDeviceGammaRamp */
|
||||
NULL, /* no implementation */ /* pGetPixel */
|
||||
NULL, /* pGetPixel */
|
||||
NULL, /* pGetPixelFormat */
|
||||
NULL, /* pGetTextExtentPoint */
|
||||
NULL, /* pGetTextMetrics */
|
||||
|
@ -95,15 +97,20 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
|
|||
EMFDRV_SaveDC, /* pSaveDC */
|
||||
EMFDRV_ScaleViewportExt, /* pScaleViewportExt */
|
||||
EMFDRV_ScaleWindowExt, /* pScaleWindowExt */
|
||||
EMFDRV_SelectBitmap, /* pSelectBitmap */
|
||||
EMFDRV_SelectBrush, /* pSelectBrush */
|
||||
EMFDRV_SelectClipPath, /* pSelectClipPath */
|
||||
NULL, /* pSelectClipRgn */
|
||||
EMFDRV_SelectObject, /* pSelectObject */
|
||||
EMFDRV_SelectFont, /* pSelectFont */
|
||||
NULL, /* pSelectPalette */
|
||||
EMFDRV_SelectPen, /* pSelectPen */
|
||||
EMFDRV_SetBkColor, /* pSetBkColor */
|
||||
EMFDRV_SetBkMode, /* pSetBkMode */
|
||||
NULL, /* pSetDIBColorTable */
|
||||
NULL, /* pSetDIBits */
|
||||
NULL, /* pSetDIBitsToDevice */
|
||||
NULL, /* pSetDeviceClipping */
|
||||
NULL, /* pSetDeviceGammaRamp */
|
||||
NULL, /* pSetDIBitsToDevice */
|
||||
EMFDRV_SetMapMode, /* pSetMapMode */
|
||||
EMFDRV_SetMapperFlags, /* pSetMapperFlags */
|
||||
NULL, /* pSetPixel */
|
||||
|
@ -134,9 +141,10 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
|
|||
/**********************************************************************
|
||||
* EMFDRV_DeleteDC
|
||||
*/
|
||||
static BOOL EMFDRV_DeleteDC( DC *dc )
|
||||
static BOOL EMFDRV_DeleteDC( PHYSDEV dev )
|
||||
{
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dc->physDev;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (physDev->emh) HeapFree( GetProcessHeap(), 0, physDev->emh );
|
||||
HeapFree( GetProcessHeap(), 0, physDev );
|
||||
|
@ -151,11 +159,11 @@ static BOOL EMFDRV_DeleteDC( DC *dc )
|
|||
*
|
||||
* Warning: this function can change the pointer to the metafile header.
|
||||
*/
|
||||
BOOL EMFDRV_WriteRecord( DC *dc, EMR *emr )
|
||||
BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr )
|
||||
{
|
||||
DWORD len;
|
||||
ENHMETAHEADER *emh;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dc->physDev;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
|
||||
physDev->emh->nBytes += emr->nSize;
|
||||
physDev->emh->nRecords++;
|
||||
|
@ -179,9 +187,9 @@ BOOL EMFDRV_WriteRecord( DC *dc, EMR *emr )
|
|||
/******************************************************************
|
||||
* EMFDRV_UpdateBBox
|
||||
*/
|
||||
void EMFDRV_UpdateBBox( DC *dc, RECTL *rect )
|
||||
void EMFDRV_UpdateBBox( PHYSDEV dev, RECTL *rect )
|
||||
{
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dc->physDev;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
RECTL *bounds = &physDev->emh->rclBounds;
|
||||
|
||||
if(bounds->left > bounds->right) {/* first rect */
|
||||
|
@ -202,9 +210,9 @@ void EMFDRV_UpdateBBox( DC *dc, RECTL *rect )
|
|||
* If we do someday, we'll need to maintain a table to re-use deleted
|
||||
* handles.
|
||||
*/
|
||||
int EMFDRV_AddHandleDC( DC *dc )
|
||||
int EMFDRV_AddHandleDC( PHYSDEV dev )
|
||||
{
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dc->physDev;
|
||||
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
||||
physDev->emh->nHandles++;
|
||||
return physDev->nextHandle++;
|
||||
}
|
||||
|
@ -276,7 +284,9 @@ HDC WINAPI CreateEnhMetaFileW(
|
|||
GDI_FreeObject( dc->hSelf, dc );
|
||||
return 0;
|
||||
}
|
||||
dc->physDev = physDev;
|
||||
dc->physDev = (PHYSDEV)physDev;
|
||||
physDev->hdc = dc->hSelf;
|
||||
physDev->dc = dc;
|
||||
|
||||
if(description) { /* App name\0Title\0\0 */
|
||||
length = lstrlenW(description);
|
||||
|
@ -338,11 +348,11 @@ HDC WINAPI CreateEnhMetaFileW(
|
|||
{
|
||||
if ((hFile = CreateFileW(filename, GENERIC_WRITE | GENERIC_READ, 0,
|
||||
NULL, CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE) {
|
||||
EMFDRV_DeleteDC( dc );
|
||||
EMFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
if (!WriteFile( hFile, (LPSTR)physDev->emh, size, NULL, NULL )) {
|
||||
EMFDRV_DeleteDC( dc );
|
||||
EMFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
physDev->hFile = hFile;
|
||||
|
@ -379,7 +389,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
|
|||
emr.nPalEntries = 0;
|
||||
emr.offPalEntries = 0;
|
||||
emr.nSizeLast = emr.emr.nSize;
|
||||
EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
EMFDRV_WriteRecord( dc->physDev, &emr.emr );
|
||||
|
||||
/* Update rclFrame if not initialized in CreateEnhMetaFile */
|
||||
if(physDev->emh->rclFrame.left > physDev->emh->rclFrame.right) {
|
||||
|
@ -398,7 +408,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
|
|||
if (SetFilePointer(physDev->hFile, 0, NULL, FILE_BEGIN) != 0)
|
||||
{
|
||||
CloseHandle( physDev->hFile );
|
||||
EMFDRV_DeleteDC( dc );
|
||||
EMFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -406,7 +416,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
|
|||
sizeof(*physDev->emh), NULL, NULL))
|
||||
{
|
||||
CloseHandle( physDev->hFile );
|
||||
EMFDRV_DeleteDC( dc );
|
||||
EMFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
HeapFree( GetProcessHeap(), 0, physDev->emh );
|
||||
|
@ -421,6 +431,6 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
|
|||
|
||||
hmf = EMF_Create_HENHMETAFILE( physDev->emh, (physDev->hFile != 0) );
|
||||
physDev->emh = NULL; /* So it won't be deleted */
|
||||
EMFDRV_DeleteDC( dc );
|
||||
EMFDRV_DeleteDC( dc->physDev );
|
||||
return hmf;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "enhmfdrv/enhmetafiledrv.h"
|
||||
|
||||
BOOL EMFDRV_SetViewportExt( DC *dc, INT cx, INT cy )
|
||||
BOOL EMFDRV_SetViewportExt( PHYSDEV dev, INT cx, INT cy )
|
||||
{
|
||||
EMRSETVIEWPORTEXTEX emr;
|
||||
|
||||
|
@ -29,10 +29,10 @@ BOOL EMFDRV_SetViewportExt( DC *dc, INT cx, INT cy )
|
|||
emr.szlExtent.cx = cx;
|
||||
emr.szlExtent.cy = cy;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_SetWindowExt( DC *dc, INT cx, INT cy )
|
||||
BOOL EMFDRV_SetWindowExt( PHYSDEV dev, INT cx, INT cy )
|
||||
{
|
||||
EMRSETWINDOWEXTEX emr;
|
||||
|
||||
|
@ -41,10 +41,10 @@ BOOL EMFDRV_SetWindowExt( DC *dc, INT cx, INT cy )
|
|||
emr.szlExtent.cx = cx;
|
||||
emr.szlExtent.cy = cy;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_SetViewportOrg( DC *dc, INT x, INT y )
|
||||
BOOL EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
EMRSETVIEWPORTORGEX emr;
|
||||
|
||||
|
@ -53,10 +53,10 @@ BOOL EMFDRV_SetViewportOrg( DC *dc, INT x, INT y )
|
|||
emr.ptlOrigin.x = x;
|
||||
emr.ptlOrigin.y = y;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_SetWindowOrg( DC *dc, INT x, INT y )
|
||||
BOOL EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
EMRSETWINDOWORGEX emr;
|
||||
|
||||
|
@ -65,10 +65,10 @@ BOOL EMFDRV_SetWindowOrg( DC *dc, INT x, INT y )
|
|||
emr.ptlOrigin.x = x;
|
||||
emr.ptlOrigin.y = y;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_ScaleViewportExt( DC *dc, INT xNum, INT xDenom, INT yNum,
|
||||
BOOL EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
|
||||
INT yDenom )
|
||||
{
|
||||
EMRSCALEVIEWPORTEXTEX emr;
|
||||
|
@ -80,10 +80,10 @@ BOOL EMFDRV_ScaleViewportExt( DC *dc, INT xNum, INT xDenom, INT yNum,
|
|||
emr.yNum = yNum;
|
||||
emr.yDenom = yDenom;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
BOOL EMFDRV_ScaleWindowExt( DC *dc, INT xNum, INT xDenom, INT yNum,
|
||||
BOOL EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
|
||||
INT yDenom )
|
||||
{
|
||||
EMRSCALEWINDOWEXTEX emr;
|
||||
|
@ -95,7 +95,7 @@ BOOL EMFDRV_ScaleWindowExt( DC *dc, INT xNum, INT xDenom, INT yNum,
|
|||
emr.yNum = yNum;
|
||||
emr.yDenom = yDenom;
|
||||
|
||||
return EMFDRV_WriteRecord( dc, &emr.emr );
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
|
||||
|
||||
/***********************************************************************
|
||||
* EMFDRV_BITMAP_SelectObject
|
||||
* EMFDRV_SelectBitmap
|
||||
*/
|
||||
static HBITMAP EMFDRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap )
|
||||
HBITMAP EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ static HBITMAP EMFDRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap )
|
|||
/***********************************************************************
|
||||
* EMFDRV_CreateBrushIndirect
|
||||
*/
|
||||
DWORD EMFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush )
|
||||
DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush )
|
||||
{
|
||||
DWORD index = 0;
|
||||
LOGBRUSH logbrush;
|
||||
|
@ -55,10 +55,10 @@ DWORD EMFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush )
|
|||
EMRCREATEBRUSHINDIRECT emr;
|
||||
emr.emr.iType = EMR_CREATEBRUSHINDIRECT;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.ihBrush = index = EMFDRV_AddHandleDC( dc );
|
||||
emr.ihBrush = index = EMFDRV_AddHandleDC( dev );
|
||||
emr.lb = logbrush;
|
||||
|
||||
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
|
||||
if(!EMFDRV_WriteRecord( dev, &emr.emr ))
|
||||
index = 0;
|
||||
}
|
||||
break;
|
||||
|
@ -80,7 +80,7 @@ DWORD EMFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush )
|
|||
if(!emr) break;
|
||||
emr->emr.iType = EMR_CREATEDIBPATTERNBRUSHPT;
|
||||
emr->emr.nSize = size;
|
||||
emr->ihBrush = index = EMFDRV_AddHandleDC( dc );
|
||||
emr->ihBrush = index = EMFDRV_AddHandleDC( dev );
|
||||
emr->iUsage = LOWORD(logbrush.lbColor);
|
||||
emr->offBmi = sizeof(EMRCREATEDIBPATTERNBRUSHPT);
|
||||
emr->cbBmi = biSize;
|
||||
|
@ -88,7 +88,7 @@ DWORD EMFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush )
|
|||
memcpy((char *)emr + sizeof(EMRCREATEDIBPATTERNBRUSHPT), info,
|
||||
biSize + bmSize );
|
||||
|
||||
if(!EMFDRV_WriteRecord( dc, &emr->emr ))
|
||||
if(!EMFDRV_WriteRecord( dev, &emr->emr ))
|
||||
index = 0;
|
||||
HeapFree( GetProcessHeap(), 0, emr );
|
||||
GlobalUnlock16(logbrush.lbHatch);
|
||||
|
@ -108,13 +108,12 @@ DWORD EMFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush )
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* EMFDRV_BRUSH_SelectObject
|
||||
* EMFDRV_SelectBrush
|
||||
*/
|
||||
static HBRUSH EMFDRV_BRUSH_SelectObject(DC *dc, HBRUSH hBrush )
|
||||
HBRUSH EMFDRV_SelectBrush(PHYSDEV dev, HBRUSH hBrush )
|
||||
{
|
||||
EMRSELECTOBJECT emr;
|
||||
DWORD index;
|
||||
HBRUSH hOldBrush;
|
||||
int i;
|
||||
|
||||
/* If the object is a stock brush object, do not need to create it.
|
||||
|
@ -130,25 +129,20 @@ static HBRUSH EMFDRV_BRUSH_SelectObject(DC *dc, HBRUSH hBrush )
|
|||
goto found;
|
||||
}
|
||||
}
|
||||
if (!(index = EMFDRV_CreateBrushIndirect(dc, hBrush ))) return 0;
|
||||
if (!(index = EMFDRV_CreateBrushIndirect(dev, hBrush ))) return 0;
|
||||
|
||||
found:
|
||||
emr.emr.iType = EMR_SELECTOBJECT;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.ihObject = index;
|
||||
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
|
||||
return FALSE;
|
||||
|
||||
hOldBrush = dc->hBrush;
|
||||
dc->hBrush = hBrush;
|
||||
return hOldBrush;
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr ) ? hBrush : 0;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* EMFDRV_CreateFontIndirect
|
||||
*/
|
||||
static BOOL EMFDRV_CreateFontIndirect(DC *dc, HFONT hFont )
|
||||
static BOOL EMFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont )
|
||||
{
|
||||
DWORD index = 0;
|
||||
EMREXTCREATEFONTINDIRECTW emr;
|
||||
|
@ -158,7 +152,7 @@ static BOOL EMFDRV_CreateFontIndirect(DC *dc, HFONT hFont )
|
|||
|
||||
emr.emr.iType = EMR_EXTCREATEFONTINDIRECTW;
|
||||
emr.emr.nSize = (sizeof(emr) + 3) / 4 * 4;
|
||||
emr.ihFont = index = EMFDRV_AddHandleDC( dc );
|
||||
emr.ihFont = index = EMFDRV_AddHandleDC( dev );
|
||||
emr.elfw.elfFullName[0] = '\0';
|
||||
emr.elfw.elfStyle[0] = '\0';
|
||||
emr.elfw.elfVersion = 0;
|
||||
|
@ -179,16 +173,16 @@ static BOOL EMFDRV_CreateFontIndirect(DC *dc, HFONT hFont )
|
|||
emr.elfw.elfPanose.bMidline = PAN_NO_FIT;
|
||||
emr.elfw.elfPanose.bXHeight = PAN_NO_FIT;
|
||||
|
||||
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
|
||||
if(!EMFDRV_WriteRecord( dev, &emr.emr ))
|
||||
index = 0;
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* EMFDRV_FONT_SelectObject
|
||||
* EMFDRV_SelectFont
|
||||
*/
|
||||
static HFONT EMFDRV_FONT_SelectObject( DC * dc, HFONT hFont )
|
||||
HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT hFont )
|
||||
{
|
||||
EMRSELECTOBJECT emr;
|
||||
DWORD index;
|
||||
|
@ -208,15 +202,14 @@ static HFONT EMFDRV_FONT_SelectObject( DC * dc, HFONT hFont )
|
|||
goto found;
|
||||
}
|
||||
}
|
||||
if (!(index = EMFDRV_CreateFontIndirect(dc, hFont ))) return GDI_ERROR;
|
||||
if (!(index = EMFDRV_CreateFontIndirect(dev, hFont ))) return GDI_ERROR;
|
||||
found:
|
||||
emr.emr.iType = EMR_SELECTOBJECT;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.ihObject = index;
|
||||
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
|
||||
if(!EMFDRV_WriteRecord( dev, &emr.emr ))
|
||||
return GDI_ERROR;
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -224,7 +217,7 @@ static HFONT EMFDRV_FONT_SelectObject( DC * dc, HFONT hFont )
|
|||
/******************************************************************
|
||||
* EMFDRV_CreatePenIndirect
|
||||
*/
|
||||
static HPEN EMFDRV_CreatePenIndirect(DC *dc, HPEN hPen )
|
||||
static HPEN EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen )
|
||||
{
|
||||
EMRCREATEPEN emr;
|
||||
DWORD index = 0;
|
||||
|
@ -233,21 +226,20 @@ static HPEN EMFDRV_CreatePenIndirect(DC *dc, HPEN hPen )
|
|||
|
||||
emr.emr.iType = EMR_CREATEPEN;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.ihPen = index = EMFDRV_AddHandleDC( dc );
|
||||
emr.ihPen = index = EMFDRV_AddHandleDC( dev );
|
||||
|
||||
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
|
||||
if(!EMFDRV_WriteRecord( dev, &emr.emr ))
|
||||
index = 0;
|
||||
return index;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* EMFDRV_PEN_SelectObject
|
||||
* EMFDRV_SelectPen
|
||||
*/
|
||||
static HPEN EMFDRV_PEN_SelectObject(DC *dc, HPEN hPen )
|
||||
HPEN EMFDRV_SelectPen(PHYSDEV dev, HPEN hPen )
|
||||
{
|
||||
EMRSELECTOBJECT emr;
|
||||
DWORD index;
|
||||
HPEN hOldPen;
|
||||
int i;
|
||||
|
||||
/* If the object is a stock pen object, do not need to create it.
|
||||
|
@ -264,48 +256,10 @@ static HPEN EMFDRV_PEN_SelectObject(DC *dc, HPEN hPen )
|
|||
goto found;
|
||||
}
|
||||
}
|
||||
if (!(index = EMFDRV_CreatePenIndirect(dc, hPen ))) return 0;
|
||||
if (!(index = EMFDRV_CreatePenIndirect(dev, hPen ))) return 0;
|
||||
found:
|
||||
emr.emr.iType = EMR_SELECTOBJECT;
|
||||
emr.emr.nSize = sizeof(emr);
|
||||
emr.ihObject = index;
|
||||
if(!EMFDRV_WriteRecord( dc, &emr.emr ))
|
||||
return FALSE;
|
||||
|
||||
hOldPen = dc->hPen;
|
||||
dc->hPen = hPen;
|
||||
return hOldPen;
|
||||
return EMFDRV_WriteRecord( dev, &emr.emr ) ? hPen : 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* EMFDRV_SelectObject
|
||||
*/
|
||||
HGDIOBJ EMFDRV_SelectObject( DC *dc, HGDIOBJ handle )
|
||||
{
|
||||
GDIOBJHDR * ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
|
||||
HGDIOBJ ret = 0;
|
||||
|
||||
if (!ptr) return 0;
|
||||
TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
|
||||
|
||||
switch(GDIMAGIC(ptr->wMagic))
|
||||
{
|
||||
case PEN_MAGIC:
|
||||
ret = EMFDRV_PEN_SelectObject( dc, handle );
|
||||
break;
|
||||
case BRUSH_MAGIC:
|
||||
ret = EMFDRV_BRUSH_SelectObject( dc, handle );
|
||||
break;
|
||||
case FONT_MAGIC:
|
||||
ret = EMFDRV_FONT_SelectObject( dc, handle );
|
||||
break;
|
||||
case BITMAP_MAGIC:
|
||||
ret = EMFDRV_BITMAP_SelectObject( dc, handle );
|
||||
break;
|
||||
}
|
||||
GDI_ReleaseObj( handle );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -30,11 +30,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(metafile);
|
|||
/***********************************************************************
|
||||
* MFDRV_PatBlt
|
||||
*/
|
||||
BOOL MFDRV_PatBlt( DC *dc, INT left, INT top,
|
||||
INT width, INT height, DWORD rop )
|
||||
BOOL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, DWORD rop )
|
||||
{
|
||||
MFDRV_MetaParam6( dc, META_PATBLT, left, top, width, height,
|
||||
HIWORD(rop), LOWORD(rop) );
|
||||
MFDRV_MetaParam6( dev, META_PATBLT, left, top, width, height, HIWORD(rop), LOWORD(rop) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -42,13 +40,15 @@ BOOL MFDRV_PatBlt( DC *dc, INT left, INT top,
|
|||
/***********************************************************************
|
||||
* MFDRV_BitBlt
|
||||
*/
|
||||
BOOL MFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst, INT width, INT height,
|
||||
DC *dcSrc, INT xSrc, INT ySrc, DWORD rop )
|
||||
BOOL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height,
|
||||
PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop )
|
||||
{
|
||||
BOOL ret;
|
||||
DWORD len;
|
||||
METARECORD *mr;
|
||||
BITMAP16 BM;
|
||||
METAFILEDRV_PDEVICE *physDevSrc = (METAFILEDRV_PDEVICE *)devSrc;
|
||||
DC *dcSrc = physDevSrc->dc;
|
||||
|
||||
GetObject16(dcSrc->hBitmap, sizeof(BITMAP16), &BM);
|
||||
len = sizeof(METARECORD) + 12 * sizeof(INT16) + BM.bmWidthBytes * BM.bmHeight;
|
||||
|
@ -72,7 +72,7 @@ BOOL MFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst, INT width, INT height,
|
|||
*(mr->rdParm + 4) = width;
|
||||
*(mr->rdParm + 5) = yDst;
|
||||
*(mr->rdParm + 6) = xDst;
|
||||
ret = MFDRV_WriteRecord( dcDst, mr, mr->rdSize * 2);
|
||||
ret = MFDRV_WriteRecord( devDst, mr, mr->rdSize * 2);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
|
@ -91,14 +91,16 @@ BOOL MFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst, INT width, INT height,
|
|||
#define STRETCH_VIA_DIB
|
||||
#undef STRETCH_VIA_DIB
|
||||
|
||||
BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, DC *dcSrc, INT xSrc, INT ySrc,
|
||||
BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, DWORD rop )
|
||||
{
|
||||
BOOL ret;
|
||||
DWORD len;
|
||||
METARECORD *mr;
|
||||
BITMAP16 BM;
|
||||
METAFILEDRV_PDEVICE *physDevSrc = (METAFILEDRV_PDEVICE *)devSrc;
|
||||
DC *dcSrc = physDevSrc->dc;
|
||||
#ifdef STRETCH_VIA_DIB
|
||||
LPBITMAPINFOHEADER lpBMI;
|
||||
WORD nBPP;
|
||||
|
@ -157,7 +159,7 @@ BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
|
|||
*(mr->rdParm + 7) = widthDst;
|
||||
*(mr->rdParm + 8) = yDst;
|
||||
*(mr->rdParm + 9) = xDst;
|
||||
ret = MFDRV_WriteRecord( dcDst, mr, mr->rdSize * 2);
|
||||
ret = MFDRV_WriteRecord( devDst, mr, mr->rdSize * 2);
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
|
@ -169,7 +171,7 @@ BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
|
|||
/***********************************************************************
|
||||
* MFDRV_StretchDIBits
|
||||
*/
|
||||
INT MFDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
|
||||
INT MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, INT xSrc, INT ySrc, INT widthSrc,
|
||||
INT heightSrc, const void *bits,
|
||||
const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
|
||||
|
@ -201,7 +203,7 @@ INT MFDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
|
|||
mr->rdParm[10] = (INT16)xDst;
|
||||
memcpy(mr->rdParm + 11, info, infosize);
|
||||
memcpy(mr->rdParm + 11 + infosize / 2, bits, imagesize);
|
||||
MFDRV_WriteRecord( dc, mr, mr->rdSize * 2 );
|
||||
MFDRV_WriteRecord( dev, mr, mr->rdSize * 2 );
|
||||
HeapFree( GetProcessHeap(), 0, mr );
|
||||
return heightSrc;
|
||||
}
|
||||
|
@ -210,7 +212,7 @@ INT MFDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
|
|||
/***********************************************************************
|
||||
* MFDRV_SetDIBitsToDeivce
|
||||
*/
|
||||
INT MFDRV_SetDIBitsToDevice( DC *dc, INT xDst, INT yDst, DWORD cx,
|
||||
INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD cx,
|
||||
DWORD cy, INT xSrc, INT ySrc, UINT startscan,
|
||||
UINT lines, LPCVOID bits, const BITMAPINFO *info,
|
||||
UINT coloruse )
|
||||
|
@ -241,7 +243,7 @@ INT MFDRV_SetDIBitsToDevice( DC *dc, INT xDst, INT yDst, DWORD cx,
|
|||
mr->rdParm[8] = (INT16)xDst;
|
||||
memcpy(mr->rdParm + 9, info, infosize);
|
||||
memcpy(mr->rdParm + 9 + infosize / 2, bits, imagesize);
|
||||
MFDRV_WriteRecord( dc, mr, mr->rdSize * 2 );
|
||||
MFDRV_WriteRecord( dev, mr, mr->rdSize * 2 );
|
||||
HeapFree( GetProcessHeap(), 0, mr );
|
||||
return lines;
|
||||
}
|
||||
|
|
|
@ -20,126 +20,126 @@
|
|||
|
||||
#include "mfdrv/metafiledrv.h"
|
||||
|
||||
INT MFDRV_SaveDC( DC *dc )
|
||||
INT MFDRV_SaveDC( PHYSDEV dev )
|
||||
{
|
||||
return MFDRV_MetaParam0( dc, META_SAVEDC );
|
||||
return MFDRV_MetaParam0( dev, META_SAVEDC );
|
||||
}
|
||||
|
||||
BOOL MFDRV_RestoreDC( DC *dc, INT level )
|
||||
BOOL MFDRV_RestoreDC( PHYSDEV dev, INT level )
|
||||
{
|
||||
if(level != -1) return FALSE;
|
||||
return MFDRV_MetaParam1( dc, META_RESTOREDC, level );
|
||||
return MFDRV_MetaParam1( dev, META_RESTOREDC, level );
|
||||
}
|
||||
|
||||
UINT MFDRV_SetTextAlign( DC *dc, UINT align )
|
||||
UINT MFDRV_SetTextAlign( PHYSDEV dev, UINT align )
|
||||
{
|
||||
return MFDRV_MetaParam1( dc, META_SETTEXTALIGN, (WORD)align);
|
||||
return MFDRV_MetaParam1( dev, META_SETTEXTALIGN, (WORD)align);
|
||||
}
|
||||
|
||||
INT MFDRV_SetBkMode( DC *dc, INT mode )
|
||||
INT MFDRV_SetBkMode( PHYSDEV dev, INT mode )
|
||||
{
|
||||
return MFDRV_MetaParam1( dc, META_SETBKMODE, (WORD)mode);
|
||||
return MFDRV_MetaParam1( dev, META_SETBKMODE, (WORD)mode);
|
||||
}
|
||||
|
||||
INT MFDRV_SetROP2( DC *dc, INT rop )
|
||||
INT MFDRV_SetROP2( PHYSDEV dev, INT rop )
|
||||
{
|
||||
return MFDRV_MetaParam1( dc, META_SETROP2, (WORD)rop);
|
||||
return MFDRV_MetaParam1( dev, META_SETROP2, (WORD)rop);
|
||||
}
|
||||
|
||||
INT MFDRV_SetRelAbs( DC *dc, INT mode )
|
||||
INT MFDRV_SetRelAbs( PHYSDEV dev, INT mode )
|
||||
{
|
||||
return MFDRV_MetaParam1( dc, META_SETRELABS, (WORD)mode);
|
||||
return MFDRV_MetaParam1( dev, META_SETRELABS, (WORD)mode);
|
||||
}
|
||||
|
||||
INT MFDRV_SetPolyFillMode( DC *dc, INT mode )
|
||||
INT MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode )
|
||||
{
|
||||
return MFDRV_MetaParam1( dc, META_SETPOLYFILLMODE, (WORD)mode);
|
||||
return MFDRV_MetaParam1( dev, META_SETPOLYFILLMODE, (WORD)mode);
|
||||
}
|
||||
|
||||
INT MFDRV_SetStretchBltMode( DC *dc, INT mode )
|
||||
INT MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
|
||||
{
|
||||
return MFDRV_MetaParam1( dc, META_SETSTRETCHBLTMODE, (WORD)mode);
|
||||
return MFDRV_MetaParam1( dev, META_SETSTRETCHBLTMODE, (WORD)mode);
|
||||
}
|
||||
|
||||
INT MFDRV_IntersectClipRect( DC *dc, INT left, INT top, INT right, INT bottom )
|
||||
INT MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
||||
{
|
||||
return MFDRV_MetaParam4( dc, META_INTERSECTCLIPRECT, left, top, right,
|
||||
return MFDRV_MetaParam4( dev, META_INTERSECTCLIPRECT, left, top, right,
|
||||
bottom );
|
||||
}
|
||||
|
||||
INT MFDRV_ExcludeClipRect( DC *dc, INT left, INT top, INT right, INT bottom )
|
||||
INT MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
||||
{
|
||||
return MFDRV_MetaParam4( dc, META_EXCLUDECLIPRECT, left, top, right,
|
||||
return MFDRV_MetaParam4( dev, META_EXCLUDECLIPRECT, left, top, right,
|
||||
bottom );
|
||||
}
|
||||
|
||||
INT MFDRV_OffsetClipRgn( DC *dc, INT x, INT y )
|
||||
INT MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
return MFDRV_MetaParam2( dc, META_OFFSETCLIPRGN, x, y );
|
||||
return MFDRV_MetaParam2( dev, META_OFFSETCLIPRGN, x, y );
|
||||
}
|
||||
|
||||
INT MFDRV_SetTextJustification( DC *dc, INT extra, INT breaks )
|
||||
INT MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks )
|
||||
{
|
||||
return MFDRV_MetaParam2( dc, META_SETTEXTJUSTIFICATION, extra, breaks );
|
||||
return MFDRV_MetaParam2( dev, META_SETTEXTJUSTIFICATION, extra, breaks );
|
||||
}
|
||||
|
||||
INT MFDRV_SetTextCharacterExtra( DC *dc, INT extra )
|
||||
INT MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra )
|
||||
{
|
||||
return MFDRV_MetaParam1( dc, META_SETTEXTCHAREXTRA, extra );
|
||||
return MFDRV_MetaParam1( dev, META_SETTEXTCHAREXTRA, extra );
|
||||
}
|
||||
|
||||
DWORD MFDRV_SetMapperFlags( DC *dc, DWORD flags )
|
||||
DWORD MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )
|
||||
{
|
||||
return MFDRV_MetaParam2( dc, META_SETMAPPERFLAGS, HIWORD(flags),
|
||||
return MFDRV_MetaParam2( dev, META_SETMAPPERFLAGS, HIWORD(flags),
|
||||
LOWORD(flags) );
|
||||
}
|
||||
|
||||
BOOL MFDRV_AbortPath( DC *dc )
|
||||
BOOL MFDRV_AbortPath( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_BeginPath( DC *dc )
|
||||
BOOL MFDRV_BeginPath( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_CloseFigure( DC *dc )
|
||||
BOOL MFDRV_CloseFigure( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_EndPath( DC *dc )
|
||||
BOOL MFDRV_EndPath( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_FillPath( DC *dc )
|
||||
BOOL MFDRV_FillPath( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_FlattenPath( DC *dc )
|
||||
BOOL MFDRV_FlattenPath( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_SelectClipPath( DC *dc, INT iMode )
|
||||
BOOL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_StrokeAndFillPath( DC *dc )
|
||||
BOOL MFDRV_StrokeAndFillPath( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_StrokePath( DC *dc )
|
||||
BOOL MFDRV_StrokePath( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL MFDRV_WidenPath( DC *dc )
|
||||
BOOL MFDRV_WidenPath( PHYSDEV dev )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -32,18 +32,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(metafile);
|
|||
* MFDRV_MoveTo
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_MoveTo(DC *dc, INT x, INT y)
|
||||
MFDRV_MoveTo(PHYSDEV dev, INT x, INT y)
|
||||
{
|
||||
return MFDRV_MetaParam2(dc,META_MOVETO,x,y);
|
||||
return MFDRV_MetaParam2(dev,META_MOVETO,x,y);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MFDRV_LineTo
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_LineTo( DC *dc, INT x, INT y )
|
||||
MFDRV_LineTo( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
return MFDRV_MetaParam2(dc, META_LINETO, x, y);
|
||||
return MFDRV_MetaParam2(dev, META_LINETO, x, y);
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,10 +51,10 @@ MFDRV_LineTo( DC *dc, INT x, INT y )
|
|||
* MFDRV_Arc
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_Arc( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return MFDRV_MetaParam8(dc, META_ARC, left, top, right, bottom,
|
||||
return MFDRV_MetaParam8(dev, META_ARC, left, top, right, bottom,
|
||||
xstart, ystart, xend, yend);
|
||||
}
|
||||
|
||||
|
@ -63,10 +63,10 @@ MFDRV_Arc( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* MFDRV_Pie
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_Pie( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
MFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return MFDRV_MetaParam8(dc, META_PIE, left, top, right, bottom,
|
||||
return MFDRV_MetaParam8(dev, META_PIE, left, top, right, bottom,
|
||||
xstart, ystart, xend, yend);
|
||||
}
|
||||
|
||||
|
@ -75,10 +75,10 @@ MFDRV_Pie( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* MFDRV_Chord
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_Chord( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return MFDRV_MetaParam8(dc, META_CHORD, left, top, right, bottom,
|
||||
return MFDRV_MetaParam8(dev, META_CHORD, left, top, right, bottom,
|
||||
xstart, ystart, xend, yend);
|
||||
}
|
||||
|
||||
|
@ -86,28 +86,28 @@ MFDRV_Chord( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* MFDRV_Ellipse
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
|
||||
MFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
||||
{
|
||||
return MFDRV_MetaParam4(dc, META_ELLIPSE, left, top, right, bottom);
|
||||
return MFDRV_MetaParam4(dev, META_ELLIPSE, left, top, right, bottom);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MFDRV_Rectangle
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
MFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
return MFDRV_MetaParam4(dc, META_RECTANGLE, left, top, right, bottom);
|
||||
return MFDRV_MetaParam4(dev, META_RECTANGLE, left, top, right, bottom);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MFDRV_RoundRect
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
||||
MFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom, INT ell_width, INT ell_height )
|
||||
{
|
||||
return MFDRV_MetaParam6(dc, META_ROUNDRECT, left, top, right, bottom,
|
||||
return MFDRV_MetaParam6(dev, META_ROUNDRECT, left, top, right, bottom,
|
||||
ell_width, ell_height);
|
||||
}
|
||||
|
||||
|
@ -115,9 +115,9 @@ MFDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
* MFDRV_SetPixel
|
||||
*/
|
||||
COLORREF
|
||||
MFDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
||||
MFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
|
||||
{
|
||||
return MFDRV_MetaParam4(dc, META_SETPIXEL, x, y,HIWORD(color),
|
||||
return MFDRV_MetaParam4(dev, META_SETPIXEL, x, y,HIWORD(color),
|
||||
LOWORD(color));
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ MFDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
|||
/******************************************************************
|
||||
* MFDRV_MetaPoly - implements Polygon and Polyline
|
||||
*/
|
||||
static BOOL MFDRV_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count)
|
||||
static BOOL MFDRV_MetaPoly(PHYSDEV dev, short func, LPPOINT16 pt, short count)
|
||||
{
|
||||
BOOL ret;
|
||||
DWORD len;
|
||||
|
@ -139,7 +139,7 @@ static BOOL MFDRV_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count)
|
|||
mr->rdFunction = func;
|
||||
*(mr->rdParm) = count;
|
||||
memcpy(mr->rdParm + 1, pt, count * 4);
|
||||
ret = MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
HeapFree( GetProcessHeap(), 0, mr);
|
||||
return ret;
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ static BOOL MFDRV_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count)
|
|||
* MFDRV_Polyline
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_Polyline( DC *dc, const POINT* pt, INT count )
|
||||
MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
|
||||
{
|
||||
register int i;
|
||||
LPPOINT16 pt16;
|
||||
|
@ -158,7 +158,7 @@ MFDRV_Polyline( DC *dc, const POINT* pt, INT count )
|
|||
pt16 = (LPPOINT16)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count );
|
||||
if(!pt16) return FALSE;
|
||||
for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i]));
|
||||
ret = MFDRV_MetaPoly(dc, META_POLYLINE, pt16, count);
|
||||
ret = MFDRV_MetaPoly(dev, META_POLYLINE, pt16, count);
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, pt16 );
|
||||
return ret;
|
||||
|
@ -169,7 +169,7 @@ MFDRV_Polyline( DC *dc, const POINT* pt, INT count )
|
|||
* MFDRV_Polygon
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_Polygon( DC *dc, const POINT* pt, INT count )
|
||||
MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
|
||||
{
|
||||
register int i;
|
||||
LPPOINT16 pt16;
|
||||
|
@ -178,7 +178,7 @@ MFDRV_Polygon( DC *dc, const POINT* pt, INT count )
|
|||
pt16 = (LPPOINT16) HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count );
|
||||
if(!pt16) return FALSE;
|
||||
for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i]));
|
||||
ret = MFDRV_MetaPoly(dc, META_POLYGON, pt16, count);
|
||||
ret = MFDRV_MetaPoly(dev, META_POLYGON, pt16, count);
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, pt16 );
|
||||
return ret;
|
||||
|
@ -189,7 +189,7 @@ MFDRV_Polygon( DC *dc, const POINT* pt, INT count )
|
|||
* MFDRV_PolyPolygon
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polygons)
|
||||
MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygons)
|
||||
{
|
||||
int i,j;
|
||||
LPPOINT16 pt16;
|
||||
|
@ -201,7 +201,7 @@ MFDRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polygons)
|
|||
sizeof(POINT16) * counts[i] );
|
||||
if(!pt16) return FALSE;
|
||||
for (j=counts[i];j--;) CONV_POINT32TO16(&(curpt[j]),&(pt16[j]));
|
||||
ret = MFDRV_MetaPoly(dc, META_POLYGON, pt16, counts[i]);
|
||||
ret = MFDRV_MetaPoly(dev, META_POLYGON, pt16, counts[i]);
|
||||
HeapFree( GetProcessHeap(), 0, pt16 );
|
||||
if (!ret)
|
||||
return FALSE;
|
||||
|
@ -215,9 +215,9 @@ MFDRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polygons)
|
|||
* MFDRV_ExtFloodFill
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_ExtFloodFill( DC *dc, INT x, INT y, COLORREF color, UINT fillType )
|
||||
MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType )
|
||||
{
|
||||
return MFDRV_MetaParam4(dc,META_FLOODFILL,x,y,HIWORD(color),
|
||||
return MFDRV_MetaParam4(dev,META_FLOODFILL,x,y,HIWORD(color),
|
||||
LOWORD(color));
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,7 @@ MFDRV_ExtFloodFill( DC *dc, INT x, INT y, COLORREF color, UINT fillType )
|
|||
* For explanation of the format of the record see MF_Play_MetaCreateRegion in
|
||||
* objects/metafile.c
|
||||
*/
|
||||
static INT16 MFDRV_CreateRegion(DC *dc, HRGN hrgn)
|
||||
static INT16 MFDRV_CreateRegion(PHYSDEV dev, HRGN hrgn)
|
||||
{
|
||||
DWORD len;
|
||||
METARECORD *mr;
|
||||
|
@ -298,7 +298,7 @@ static INT16 MFDRV_CreateRegion(DC *dc, HRGN hrgn)
|
|||
mr->rdParm[10] = rgndata->rdh.rcBound.bottom;
|
||||
mr->rdFunction = META_CREATEREGION;
|
||||
mr->rdSize = len / 2;
|
||||
ret = MFDRV_WriteRecord( dc, mr, mr->rdSize * 2 );
|
||||
ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2 );
|
||||
HeapFree( GetProcessHeap(), 0, mr );
|
||||
HeapFree( GetProcessHeap(), 0, rgndata );
|
||||
if(!ret)
|
||||
|
@ -306,7 +306,7 @@ static INT16 MFDRV_CreateRegion(DC *dc, HRGN hrgn)
|
|||
WARN("MFDRV_WriteRecord failed\n");
|
||||
return -1;
|
||||
}
|
||||
return MFDRV_AddHandleDC( dc );
|
||||
return MFDRV_AddHandleDC( dev );
|
||||
}
|
||||
|
||||
|
||||
|
@ -314,13 +314,13 @@ static INT16 MFDRV_CreateRegion(DC *dc, HRGN hrgn)
|
|||
* MFDRV_PaintRgn
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_PaintRgn( DC *dc, HRGN hrgn )
|
||||
MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn )
|
||||
{
|
||||
INT16 index;
|
||||
index = MFDRV_CreateRegion( dc, hrgn );
|
||||
index = MFDRV_CreateRegion( dev, hrgn );
|
||||
if(index == -1)
|
||||
return FALSE;
|
||||
return MFDRV_MetaParam1( dc, META_PAINTREGION, index );
|
||||
return MFDRV_MetaParam1( dev, META_PAINTREGION, index );
|
||||
}
|
||||
|
||||
|
||||
|
@ -328,13 +328,13 @@ MFDRV_PaintRgn( DC *dc, HRGN hrgn )
|
|||
* MFDRV_InvertRgn
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_InvertRgn( DC *dc, HRGN hrgn )
|
||||
MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn )
|
||||
{
|
||||
INT16 index;
|
||||
index = MFDRV_CreateRegion( dc, hrgn );
|
||||
index = MFDRV_CreateRegion( dev, hrgn );
|
||||
if(index == -1)
|
||||
return FALSE;
|
||||
return MFDRV_MetaParam1( dc, META_INVERTREGION, index );
|
||||
return MFDRV_MetaParam1( dev, META_INVERTREGION, index );
|
||||
}
|
||||
|
||||
|
||||
|
@ -342,32 +342,32 @@ MFDRV_InvertRgn( DC *dc, HRGN hrgn )
|
|||
* MFDRV_FillRgn
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_FillRgn( DC *dc, HRGN hrgn, HBRUSH hbrush )
|
||||
MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush )
|
||||
{
|
||||
INT16 iRgn, iBrush;
|
||||
iRgn = MFDRV_CreateRegion( dc, hrgn );
|
||||
iRgn = MFDRV_CreateRegion( dev, hrgn );
|
||||
if(iRgn == -1)
|
||||
return FALSE;
|
||||
iBrush = MFDRV_CreateBrushIndirect( dc, hbrush );
|
||||
iBrush = MFDRV_CreateBrushIndirect( dev, hbrush );
|
||||
if(iBrush == -1)
|
||||
return FALSE;
|
||||
return MFDRV_MetaParam2( dc, META_FILLREGION, iRgn, iBrush );
|
||||
return MFDRV_MetaParam2( dev, META_FILLREGION, iRgn, iBrush );
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* MFDRV_FrameRgn
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT x, INT y )
|
||||
MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y )
|
||||
{
|
||||
INT16 iRgn, iBrush;
|
||||
iRgn = MFDRV_CreateRegion( dc, hrgn );
|
||||
iRgn = MFDRV_CreateRegion( dev, hrgn );
|
||||
if(iRgn == -1)
|
||||
return FALSE;
|
||||
iBrush = MFDRV_CreateBrushIndirect( dc, hbrush );
|
||||
iBrush = MFDRV_CreateBrushIndirect( dev, hbrush );
|
||||
if(iBrush == -1)
|
||||
return FALSE;
|
||||
return MFDRV_MetaParam4( dc, META_FRAMEREGION, iRgn, iBrush, x, y );
|
||||
return MFDRV_MetaParam4( dev, META_FRAMEREGION, iRgn, iBrush, x, y );
|
||||
}
|
||||
|
||||
|
||||
|
@ -375,9 +375,10 @@ MFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT x, INT y )
|
|||
* MFDRV_SetBkColor
|
||||
*/
|
||||
COLORREF
|
||||
MFDRV_SetBkColor( DC *dc, COLORREF color )
|
||||
MFDRV_SetBkColor( PHYSDEV dev, COLORREF color )
|
||||
{
|
||||
return MFDRV_MetaParam2(dc, META_SETBKCOLOR, HIWORD(color), LOWORD(color));
|
||||
return MFDRV_MetaParam2(dev, META_SETBKCOLOR, HIWORD(color),
|
||||
LOWORD(color)) ? color : CLR_INVALID;
|
||||
}
|
||||
|
||||
|
||||
|
@ -385,10 +386,10 @@ MFDRV_SetBkColor( DC *dc, COLORREF color )
|
|||
* MFDRV_SetTextColor
|
||||
*/
|
||||
COLORREF
|
||||
MFDRV_SetTextColor( DC *dc, COLORREF color )
|
||||
MFDRV_SetTextColor( PHYSDEV dev, COLORREF color )
|
||||
{
|
||||
return MFDRV_MetaParam2(dc, META_SETTEXTCOLOR, HIWORD(color),
|
||||
LOWORD(color));
|
||||
return MFDRV_MetaParam2(dev, META_SETTEXTCOLOR, HIWORD(color),
|
||||
LOWORD(color)) ? color : CLR_INVALID;
|
||||
}
|
||||
|
||||
|
||||
|
@ -398,7 +399,7 @@ MFDRV_SetTextColor( DC *dc, COLORREF color )
|
|||
* approximations to them using lines, we need this stub function.
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_PolyBezier( DC *dc, const POINT *pts, DWORD count )
|
||||
MFDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -409,7 +410,7 @@ MFDRV_PolyBezier( DC *dc, const POINT *pts, DWORD count )
|
|||
* approximations to them using lines, we need this stub function.
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_PolyBezierTo( DC *dc, const POINT *pts, DWORD count )
|
||||
MFDRV_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD count )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ static const DC_FUNCTIONS MFDRV_Funcs =
|
|||
MFDRV_Chord, /* pChord */
|
||||
MFDRV_CloseFigure, /* pCloseFigure */
|
||||
NULL, /* pCreateBitmap */
|
||||
NULL, /* no implementation */ /* pCreateDC */
|
||||
NULL, /* pCreateDC */
|
||||
NULL, /* pCreateDIBSection */
|
||||
NULL, /* no implementation */ /* pDeleteDC */
|
||||
NULL, /* pDeleteDC */
|
||||
NULL, /* pDeleteObject */
|
||||
NULL, /* pDescribePixelFormat */
|
||||
NULL, /* pDeviceCapabilities */
|
||||
|
@ -65,9 +65,11 @@ static const DC_FUNCTIONS MFDRV_Funcs =
|
|||
MFDRV_FrameRgn, /* pFrameRgn */
|
||||
NULL, /* pGetCharWidth */
|
||||
NULL, /* pGetDCOrgEx */
|
||||
NULL, /* pGetDIBColorTable */
|
||||
NULL, /* pGetDIBits */
|
||||
NULL, /* pGetDeviceCaps */
|
||||
NULL, /* pGetDeviceGammaRamp */
|
||||
NULL, /* no implementation */ /* pGetPixel */
|
||||
NULL, /* pGetPixel */
|
||||
NULL, /* pGetPixelFormat */
|
||||
NULL, /* pGetTextExtentPoint */
|
||||
NULL, /* pGetTextMetrics */
|
||||
|
@ -96,15 +98,20 @@ static const DC_FUNCTIONS MFDRV_Funcs =
|
|||
MFDRV_SaveDC, /* pSaveDC */
|
||||
MFDRV_ScaleViewportExt, /* pScaleViewportExt */
|
||||
MFDRV_ScaleWindowExt, /* pScaleWindowExt */
|
||||
MFDRV_SelectBitmap, /* pSelectBitmap */
|
||||
MFDRV_SelectBrush, /* pSelectBrush */
|
||||
MFDRV_SelectClipPath, /* pSelectClipPath */
|
||||
NULL, /* pSelectClipRgn */
|
||||
MFDRV_SelectObject, /* pSelectObject */
|
||||
MFDRV_SelectFont, /* pSelectFont */
|
||||
NULL, /* pSelectPalette */
|
||||
MFDRV_SelectPen, /* pSelectPen */
|
||||
MFDRV_SetBkColor, /* pSetBkColor */
|
||||
MFDRV_SetBkMode, /* pSetBkMode */
|
||||
NULL, /* pSetDIBColorTable */
|
||||
NULL, /* pSetDIBits */
|
||||
MFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */
|
||||
NULL, /* pSetDeviceClipping */
|
||||
NULL, /* pSetDeviceGammaRamp */
|
||||
MFDRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */
|
||||
MFDRV_SetMapMode, /* pSetMapMode */
|
||||
MFDRV_SetMapperFlags, /* pSetMapperFlags */
|
||||
MFDRV_SetPixel, /* pSetPixel */
|
||||
|
@ -150,7 +157,9 @@ static DC *MFDRV_AllocMetaFile(void)
|
|||
GDI_FreeObject( dc->hSelf, dc );
|
||||
return NULL;
|
||||
}
|
||||
dc->physDev = physDev;
|
||||
dc->physDev = (PHYSDEV)physDev;
|
||||
physDev->hdc = dc->hSelf;
|
||||
physDev->dc = dc;
|
||||
|
||||
if (!(physDev->mh = HeapAlloc( GetProcessHeap(), 0, sizeof(*physDev->mh) )))
|
||||
{
|
||||
|
@ -176,9 +185,10 @@ static DC *MFDRV_AllocMetaFile(void)
|
|||
/**********************************************************************
|
||||
* MFDRV_DeleteDC
|
||||
*/
|
||||
static BOOL MFDRV_DeleteDC( DC *dc )
|
||||
static BOOL MFDRV_DeleteDC( PHYSDEV dev )
|
||||
{
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (physDev->mh) HeapFree( GetProcessHeap(), 0, physDev->mh );
|
||||
HeapFree( GetProcessHeap(), 0, physDev );
|
||||
|
@ -216,12 +226,12 @@ HDC16 WINAPI CreateMetaFile16(
|
|||
physDev->mh->mtType = METAFILE_DISK;
|
||||
if ((hFile = CreateFileA(filename, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE) {
|
||||
MFDRV_DeleteDC( dc );
|
||||
MFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
if (!WriteFile( hFile, (LPSTR)physDev->mh, sizeof(*physDev->mh), NULL,
|
||||
NULL )) {
|
||||
MFDRV_DeleteDC( dc );
|
||||
MFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
physDev->hFile = hFile;
|
||||
|
@ -286,23 +296,23 @@ static DC *MFDRV_CloseMetaFile( HDC hdc )
|
|||
* in SDK Knowledgebase Q99334.
|
||||
*/
|
||||
|
||||
if (!MFDRV_MetaParam0(dc, META_EOF))
|
||||
if (!MFDRV_MetaParam0(dc->physDev, META_EOF))
|
||||
{
|
||||
MFDRV_DeleteDC( dc );
|
||||
MFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (physDev->mh->mtType == METAFILE_DISK) /* disk based metafile */
|
||||
{
|
||||
if (SetFilePointer(physDev->hFile, 0, NULL, FILE_BEGIN) != 0) {
|
||||
MFDRV_DeleteDC( dc );
|
||||
MFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
|
||||
physDev->mh->mtType = METAFILE_MEMORY; /* This is what windows does */
|
||||
if (!WriteFile(physDev->hFile, (LPSTR)physDev->mh,
|
||||
sizeof(*physDev->mh), NULL, NULL)) {
|
||||
MFDRV_DeleteDC( dc );
|
||||
MFDRV_DeleteDC( dc->physDev );
|
||||
return 0;
|
||||
}
|
||||
CloseHandle(physDev->hFile);
|
||||
|
@ -331,7 +341,7 @@ HMETAFILE16 WINAPI CloseMetaFile16(
|
|||
hmf = MF_Create_HMETAFILE16( physDev->mh );
|
||||
|
||||
physDev->mh = NULL; /* So it won't be deleted */
|
||||
MFDRV_DeleteDC( dc );
|
||||
MFDRV_DeleteDC( dc->physDev );
|
||||
return hmf;
|
||||
}
|
||||
|
||||
|
@ -359,7 +369,7 @@ HMETAFILE WINAPI CloseMetaFile(
|
|||
hmf = MF_Create_HMETAFILE( physDev->mh );
|
||||
|
||||
physDev->mh = NULL; /* So it won't be deleted */
|
||||
MFDRV_DeleteDC( dc );
|
||||
MFDRV_DeleteDC( dc->physDev );
|
||||
return hmf;
|
||||
}
|
||||
|
||||
|
@ -369,11 +379,11 @@ HMETAFILE WINAPI CloseMetaFile(
|
|||
*
|
||||
* Warning: this function can change the pointer to the metafile header.
|
||||
*/
|
||||
BOOL MFDRV_WriteRecord( DC *dc, METARECORD *mr, DWORD rlen)
|
||||
BOOL MFDRV_WriteRecord( PHYSDEV dev, METARECORD *mr, DWORD rlen)
|
||||
{
|
||||
DWORD len;
|
||||
METAHEADER *mh;
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
|
||||
switch(physDev->mh->mtType)
|
||||
{
|
||||
|
@ -404,21 +414,21 @@ BOOL MFDRV_WriteRecord( DC *dc, METARECORD *mr, DWORD rlen)
|
|||
* MFDRV_MetaParam0
|
||||
*/
|
||||
|
||||
BOOL MFDRV_MetaParam0(DC *dc, short func)
|
||||
BOOL MFDRV_MetaParam0(PHYSDEV dev, short func)
|
||||
{
|
||||
char buffer[8];
|
||||
METARECORD *mr = (METARECORD *)&buffer;
|
||||
|
||||
mr->rdSize = 3;
|
||||
mr->rdFunction = func;
|
||||
return MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* MFDRV_MetaParam1
|
||||
*/
|
||||
BOOL MFDRV_MetaParam1(DC *dc, short func, short param1)
|
||||
BOOL MFDRV_MetaParam1(PHYSDEV dev, short func, short param1)
|
||||
{
|
||||
char buffer[8];
|
||||
METARECORD *mr = (METARECORD *)&buffer;
|
||||
|
@ -426,14 +436,14 @@ BOOL MFDRV_MetaParam1(DC *dc, short func, short param1)
|
|||
mr->rdSize = 4;
|
||||
mr->rdFunction = func;
|
||||
*(mr->rdParm) = param1;
|
||||
return MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* MFDRV_MetaParam2
|
||||
*/
|
||||
BOOL MFDRV_MetaParam2(DC *dc, short func, short param1, short param2)
|
||||
BOOL MFDRV_MetaParam2(PHYSDEV dev, short func, short param1, short param2)
|
||||
{
|
||||
char buffer[10];
|
||||
METARECORD *mr = (METARECORD *)&buffer;
|
||||
|
@ -442,7 +452,7 @@ BOOL MFDRV_MetaParam2(DC *dc, short func, short param1, short param2)
|
|||
mr->rdFunction = func;
|
||||
*(mr->rdParm) = param2;
|
||||
*(mr->rdParm + 1) = param1;
|
||||
return MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -450,7 +460,7 @@ BOOL MFDRV_MetaParam2(DC *dc, short func, short param1, short param2)
|
|||
* MFDRV_MetaParam4
|
||||
*/
|
||||
|
||||
BOOL MFDRV_MetaParam4(DC *dc, short func, short param1, short param2,
|
||||
BOOL MFDRV_MetaParam4(PHYSDEV dev, short func, short param1, short param2,
|
||||
short param3, short param4)
|
||||
{
|
||||
char buffer[14];
|
||||
|
@ -462,7 +472,7 @@ BOOL MFDRV_MetaParam4(DC *dc, short func, short param1, short param2,
|
|||
*(mr->rdParm + 1) = param3;
|
||||
*(mr->rdParm + 2) = param2;
|
||||
*(mr->rdParm + 3) = param1;
|
||||
return MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -470,7 +480,7 @@ BOOL MFDRV_MetaParam4(DC *dc, short func, short param1, short param2,
|
|||
* MFDRV_MetaParam6
|
||||
*/
|
||||
|
||||
BOOL MFDRV_MetaParam6(DC *dc, short func, short param1, short param2,
|
||||
BOOL MFDRV_MetaParam6(PHYSDEV dev, short func, short param1, short param2,
|
||||
short param3, short param4, short param5, short param6)
|
||||
{
|
||||
char buffer[18];
|
||||
|
@ -484,14 +494,14 @@ BOOL MFDRV_MetaParam6(DC *dc, short func, short param1, short param2,
|
|||
*(mr->rdParm + 3) = param3;
|
||||
*(mr->rdParm + 4) = param2;
|
||||
*(mr->rdParm + 5) = param1;
|
||||
return MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* MFDRV_MetaParam8
|
||||
*/
|
||||
BOOL MFDRV_MetaParam8(DC *dc, short func, short param1, short param2,
|
||||
BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2,
|
||||
short param3, short param4, short param5,
|
||||
short param6, short param7, short param8)
|
||||
{
|
||||
|
@ -508,7 +518,7 @@ BOOL MFDRV_MetaParam8(DC *dc, short func, short param1, short param2,
|
|||
*(mr->rdParm + 5) = param3;
|
||||
*(mr->rdParm + 6) = param2;
|
||||
*(mr->rdParm + 7) = param1;
|
||||
return MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -519,9 +529,9 @@ BOOL MFDRV_MetaParam8(DC *dc, short func, short param1, short param2,
|
|||
* If we do someday, we'll need to maintain a table to re-use deleted
|
||||
* handles.
|
||||
*/
|
||||
int MFDRV_AddHandleDC( DC *dc )
|
||||
int MFDRV_AddHandleDC( PHYSDEV dev )
|
||||
{
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
physDev->mh->mtNoObjects++;
|
||||
return physDev->nextHandle++;
|
||||
}
|
||||
|
|
|
@ -25,10 +25,11 @@
|
|||
/***********************************************************************
|
||||
* MFDRV_SetMapMode
|
||||
*/
|
||||
INT MFDRV_SetMapMode( DC *dc, INT mode )
|
||||
INT MFDRV_SetMapMode( PHYSDEV dev, INT mode )
|
||||
{
|
||||
INT prevMode = dc->MapMode;
|
||||
MFDRV_MetaParam1( dc, META_SETMAPMODE, mode );
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
INT prevMode = GetMapMode( physDev->hdc );
|
||||
MFDRV_MetaParam1( dev, META_SETMAPMODE, mode );
|
||||
return prevMode;
|
||||
}
|
||||
|
||||
|
@ -36,9 +37,9 @@ INT MFDRV_SetMapMode( DC *dc, INT mode )
|
|||
/***********************************************************************
|
||||
* MFDRV_SetViewportExt
|
||||
*/
|
||||
BOOL MFDRV_SetViewportExt( DC *dc, INT x, INT y )
|
||||
BOOL MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
MFDRV_MetaParam2( dc, META_SETVIEWPORTEXT, x, y );
|
||||
MFDRV_MetaParam2( dev, META_SETVIEWPORTEXT, x, y );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -46,9 +47,9 @@ BOOL MFDRV_SetViewportExt( DC *dc, INT x, INT y )
|
|||
/***********************************************************************
|
||||
* MFDRV_SetViewportOrg
|
||||
*/
|
||||
BOOL MFDRV_SetViewportOrg( DC *dc, INT x, INT y )
|
||||
BOOL MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
MFDRV_MetaParam2( dc, META_SETVIEWPORTORG, x, y );
|
||||
MFDRV_MetaParam2( dev, META_SETVIEWPORTORG, x, y );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -56,9 +57,9 @@ BOOL MFDRV_SetViewportOrg( DC *dc, INT x, INT y )
|
|||
/***********************************************************************
|
||||
* MFDRV_SetWindowExt
|
||||
*/
|
||||
BOOL MFDRV_SetWindowExt( DC *dc, INT x, INT y )
|
||||
BOOL MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
MFDRV_MetaParam2( dc, META_SETWINDOWEXT, x, y );
|
||||
MFDRV_MetaParam2( dev, META_SETWINDOWEXT, x, y );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -66,9 +67,9 @@ BOOL MFDRV_SetWindowExt( DC *dc, INT x, INT y )
|
|||
/***********************************************************************
|
||||
* MFDRV_SetWindowOrg
|
||||
*/
|
||||
BOOL MFDRV_SetWindowOrg( DC *dc, INT x, INT y )
|
||||
BOOL MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
MFDRV_MetaParam2( dc, META_SETWINDOWORG, x, y );
|
||||
MFDRV_MetaParam2( dev, META_SETWINDOWORG, x, y );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -76,9 +77,9 @@ BOOL MFDRV_SetWindowOrg( DC *dc, INT x, INT y )
|
|||
/***********************************************************************
|
||||
* MFDRV_OffsetViewportOrg
|
||||
*/
|
||||
BOOL MFDRV_OffsetViewportOrg( DC *dc, INT x, INT y )
|
||||
BOOL MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
MFDRV_MetaParam2( dc, META_OFFSETVIEWPORTORG, x, y );
|
||||
MFDRV_MetaParam2( dev, META_OFFSETVIEWPORTORG, x, y );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -86,9 +87,9 @@ BOOL MFDRV_OffsetViewportOrg( DC *dc, INT x, INT y )
|
|||
/***********************************************************************
|
||||
* MFDRV_OffsetWindowOrg
|
||||
*/
|
||||
BOOL MFDRV_OffsetWindowOrg( DC *dc, INT x, INT y )
|
||||
BOOL MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
MFDRV_MetaParam2( dc, META_OFFSETWINDOWORG, x, y );
|
||||
MFDRV_MetaParam2( dev, META_OFFSETWINDOWORG, x, y );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -96,10 +97,9 @@ BOOL MFDRV_OffsetWindowOrg( DC *dc, INT x, INT y )
|
|||
/***********************************************************************
|
||||
* MFDRV_ScaleViewportExt
|
||||
*/
|
||||
BOOL MFDRV_ScaleViewportExt( DC *dc, INT xNum, INT xDenom,
|
||||
INT yNum, INT yDenom )
|
||||
BOOL MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom )
|
||||
{
|
||||
MFDRV_MetaParam4( dc, META_SCALEVIEWPORTEXT, xNum, xDenom, yNum, yDenom );
|
||||
MFDRV_MetaParam4( dev, META_SCALEVIEWPORTEXT, xNum, xDenom, yNum, yDenom );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -107,10 +107,9 @@ BOOL MFDRV_ScaleViewportExt( DC *dc, INT xNum, INT xDenom,
|
|||
/***********************************************************************
|
||||
* MFDRV_ScaleWindowExt
|
||||
*/
|
||||
BOOL MFDRV_ScaleWindowExt( DC *dc, INT xNum, INT xDenom,
|
||||
INT yNum, INT yDenom )
|
||||
BOOL MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom )
|
||||
{
|
||||
MFDRV_MetaParam4( dc, META_SCALEWINDOWEXT, xNum, xDenom, yNum, yDenom );
|
||||
MFDRV_MetaParam4( dev, META_SCALEWINDOWEXT, xNum, xDenom, yNum, yDenom );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,120 +29,125 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
HDC hdc;
|
||||
DC *dc;
|
||||
METAHEADER *mh; /* Pointer to metafile header */
|
||||
UINT nextHandle; /* Next handle number */
|
||||
HFILE hFile; /* HFILE for disk based MetaFile */
|
||||
} METAFILEDRV_PDEVICE;
|
||||
|
||||
|
||||
extern BOOL MFDRV_MetaParam0(DC *dc, short func);
|
||||
extern BOOL MFDRV_MetaParam1(DC *dc, short func, short param1);
|
||||
extern BOOL MFDRV_MetaParam2(DC *dc, short func, short param1, short param2);
|
||||
extern BOOL MFDRV_MetaParam4(DC *dc, short func, short param1, short param2,
|
||||
extern BOOL MFDRV_MetaParam0(PHYSDEV dev, short func);
|
||||
extern BOOL MFDRV_MetaParam1(PHYSDEV dev, short func, short param1);
|
||||
extern BOOL MFDRV_MetaParam2(PHYSDEV dev, short func, short param1, short param2);
|
||||
extern BOOL MFDRV_MetaParam4(PHYSDEV dev, short func, short param1, short param2,
|
||||
short param3, short param4);
|
||||
extern BOOL MFDRV_MetaParam6(DC *dc, short func, short param1, short param2,
|
||||
extern BOOL MFDRV_MetaParam6(PHYSDEV dev, short func, short param1, short param2,
|
||||
short param3, short param4, short param5,
|
||||
short param6);
|
||||
extern BOOL MFDRV_MetaParam8(DC *dc, short func, short param1, short param2,
|
||||
extern BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2,
|
||||
short param3, short param4, short param5,
|
||||
short param6, short param7, short param8);
|
||||
extern BOOL MFDRV_WriteRecord(DC *dc, METARECORD *mr, DWORD rlen);
|
||||
extern int MFDRV_AddHandleDC( DC *dc );
|
||||
extern INT16 MFDRV_CreateBrushIndirect( DC *dc, HBRUSH hBrush );
|
||||
extern BOOL MFDRV_WriteRecord(PHYSDEV dev, METARECORD *mr, DWORD rlen);
|
||||
extern int MFDRV_AddHandleDC( PHYSDEV dev );
|
||||
extern INT16 MFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush );
|
||||
|
||||
/* Metafile driver functions */
|
||||
|
||||
extern BOOL MFDRV_AbortPath( DC *dc );
|
||||
extern BOOL MFDRV_Arc( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
extern BOOL MFDRV_AbortPath( PHYSDEV dev );
|
||||
extern BOOL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend );
|
||||
extern BOOL MFDRV_BeginPath( DC *dc );
|
||||
extern BOOL MFDRV_BitBlt( DC *dcDst, INT xDst, INT yDst, INT width,
|
||||
INT height, DC *dcSrc, INT xSrc, INT ySrc,
|
||||
extern BOOL MFDRV_BeginPath( PHYSDEV dev );
|
||||
extern BOOL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width,
|
||||
INT height, PHYSDEV devSrc, INT xSrc, INT ySrc,
|
||||
DWORD rop );
|
||||
extern BOOL MFDRV_Chord( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart, INT xend,
|
||||
INT yend );
|
||||
extern BOOL MFDRV_CloseFigure( DC *dc );
|
||||
extern BOOL MFDRV_Ellipse( DC *dc, INT left, INT top,
|
||||
extern BOOL MFDRV_CloseFigure( PHYSDEV dev );
|
||||
extern BOOL MFDRV_Ellipse( PHYSDEV dev, INT left, INT top,
|
||||
INT right, INT bottom );
|
||||
extern BOOL MFDRV_EndPath( DC *dc );
|
||||
extern INT MFDRV_ExcludeClipRect( DC *dc, INT left, INT top, INT right, INT
|
||||
extern BOOL MFDRV_EndPath( PHYSDEV dev );
|
||||
extern INT MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT
|
||||
bottom );
|
||||
extern BOOL MFDRV_ExtFloodFill( DC *dc, INT x, INT y,
|
||||
extern BOOL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y,
|
||||
COLORREF color, UINT fillType );
|
||||
extern BOOL MFDRV_ExtTextOut( DC *dc, INT x, INT y,
|
||||
extern BOOL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
|
||||
UINT flags, const RECT *lprect, LPCWSTR str,
|
||||
UINT count, const INT *lpDx );
|
||||
extern BOOL MFDRV_FillPath( DC *dc );
|
||||
extern BOOL MFDRV_FillRgn( DC *dc, HRGN hrgn, HBRUSH hbrush );
|
||||
extern BOOL MFDRV_FlattenPath( DC *dc );
|
||||
extern BOOL MFDRV_FrameRgn( DC *dc, HRGN hrgn, HBRUSH hbrush, INT x, INT y );
|
||||
extern INT MFDRV_IntersectClipRect( DC *dc, INT left, INT top, INT right, INT
|
||||
extern BOOL MFDRV_FillPath( PHYSDEV dev );
|
||||
extern BOOL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush );
|
||||
extern BOOL MFDRV_FlattenPath( PHYSDEV dev );
|
||||
extern BOOL MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y );
|
||||
extern INT MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT
|
||||
bottom );
|
||||
extern BOOL MFDRV_InvertRgn( DC *dc, HRGN hrgn );
|
||||
extern BOOL MFDRV_LineTo( DC *dc, INT x, INT y );
|
||||
extern BOOL MFDRV_MoveTo( DC *dc, INT x, INT y );
|
||||
extern INT MFDRV_OffsetClipRgn( DC *dc, INT x, INT y );
|
||||
extern BOOL MFDRV_OffsetViewportOrg( DC *dc, INT x, INT y );
|
||||
extern BOOL MFDRV_OffsetWindowOrg( DC *dc, INT x, INT y );
|
||||
extern BOOL MFDRV_PaintRgn( DC *dc, HRGN hrgn );
|
||||
extern BOOL MFDRV_PatBlt( DC *dc, INT left, INT top, INT width, INT height,
|
||||
extern BOOL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn );
|
||||
extern BOOL MFDRV_LineTo( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL MFDRV_MoveTo( PHYSDEV dev, INT x, INT y );
|
||||
extern INT MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn );
|
||||
extern BOOL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height,
|
||||
DWORD rop );
|
||||
extern BOOL MFDRV_Pie( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL MFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart, INT xend,
|
||||
INT yend );
|
||||
extern BOOL MFDRV_PolyBezier( DC *dc, const POINT* pt, DWORD count );
|
||||
extern BOOL MFDRV_PolyBezierTo( DC *dc, const POINT* pt, DWORD count );
|
||||
extern BOOL MFDRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts,
|
||||
extern BOOL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count );
|
||||
extern BOOL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count );
|
||||
extern BOOL MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts,
|
||||
UINT polygons);
|
||||
extern BOOL MFDRV_Polygon( DC *dc, const POINT* pt, INT count );
|
||||
extern BOOL MFDRV_Polyline( DC *dc, const POINT* pt,INT count);
|
||||
extern BOOL MFDRV_Rectangle( DC *dc, INT left, INT top,
|
||||
extern BOOL MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count );
|
||||
extern BOOL MFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count);
|
||||
extern BOOL MFDRV_Rectangle( PHYSDEV dev, INT left, INT top,
|
||||
INT right, INT bottom);
|
||||
extern BOOL MFDRV_RestoreDC( DC *dc, INT level );
|
||||
extern BOOL MFDRV_RoundRect( DC *dc, INT left, INT top,
|
||||
extern BOOL MFDRV_RestoreDC( PHYSDEV dev, INT level );
|
||||
extern BOOL MFDRV_RoundRect( PHYSDEV dev, INT left, INT top,
|
||||
INT right, INT bottom, INT ell_width,
|
||||
INT ell_height );
|
||||
extern INT MFDRV_SaveDC( DC *dc );
|
||||
extern BOOL MFDRV_ScaleViewportExt( DC *dc, INT xNum, INT xDenom, INT yNum,
|
||||
extern INT MFDRV_SaveDC( PHYSDEV dev );
|
||||
extern BOOL MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
|
||||
INT yDenom );
|
||||
extern BOOL MFDRV_ScaleWindowExt( DC *dc, INT xNum, INT xDenom, INT yNum,
|
||||
extern BOOL MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
|
||||
INT yDenom );
|
||||
extern BOOL MFDRV_SelectClipPath( DC *dc, INT iMode );
|
||||
extern HGDIOBJ MFDRV_SelectObject( DC *dc, HGDIOBJ handle );
|
||||
extern COLORREF MFDRV_SetBkColor( DC *dc, COLORREF color );
|
||||
extern INT MFDRV_SetBkMode( DC *dc, INT mode );
|
||||
extern INT MFDRV_SetMapMode( DC *dc, INT mode );
|
||||
extern DWORD MFDRV_SetMapperFlags( DC *dc, DWORD flags );
|
||||
extern COLORREF MFDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
|
||||
extern INT MFDRV_SetPolyFillMode( DC *dc, INT mode );
|
||||
extern INT MFDRV_SetROP2( DC *dc, INT rop );
|
||||
extern INT MFDRV_SetRelAbs( DC *dc, INT mode );
|
||||
extern INT MFDRV_SetStretchBltMode( DC *dc, INT mode );
|
||||
extern UINT MFDRV_SetTextAlign( DC *dc, UINT align );
|
||||
extern INT MFDRV_SetTextCharacterExtra( DC *dc, INT extra );
|
||||
extern COLORREF MFDRV_SetTextColor( DC *dc, COLORREF color );
|
||||
extern INT MFDRV_SetTextJustification( DC *dc, INT extra, INT breaks );
|
||||
extern BOOL MFDRV_SetViewportExt( DC *dc, INT x, INT y );
|
||||
extern BOOL MFDRV_SetViewportOrg( DC *dc, INT x, INT y );
|
||||
extern BOOL MFDRV_SetWindowExt( DC *dc, INT x, INT y );
|
||||
extern BOOL MFDRV_SetWindowOrg( DC *dc, INT x, INT y );
|
||||
extern BOOL MFDRV_StretchBlt( DC *dcDst, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, DC *dcSrc, INT xSrc, INT ySrc,
|
||||
extern HBITMAP MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle );
|
||||
extern HBRUSH MFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle );
|
||||
extern BOOL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode );
|
||||
extern HFONT MFDRV_SelectFont( PHYSDEV dev, HFONT handle );
|
||||
extern HPEN MFDRV_SelectPen( PHYSDEV dev, HPEN handle );
|
||||
extern COLORREF MFDRV_SetBkColor( PHYSDEV dev, COLORREF color );
|
||||
extern INT MFDRV_SetBkMode( PHYSDEV dev, INT mode );
|
||||
extern INT MFDRV_SetMapMode( PHYSDEV dev, INT mode );
|
||||
extern DWORD MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags );
|
||||
extern COLORREF MFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color );
|
||||
extern INT MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode );
|
||||
extern INT MFDRV_SetROP2( PHYSDEV dev, INT rop );
|
||||
extern INT MFDRV_SetRelAbs( PHYSDEV dev, INT mode );
|
||||
extern INT MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode );
|
||||
extern UINT MFDRV_SetTextAlign( PHYSDEV dev, UINT align );
|
||||
extern INT MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra );
|
||||
extern COLORREF MFDRV_SetTextColor( PHYSDEV dev, COLORREF color );
|
||||
extern INT MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks );
|
||||
extern BOOL MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, DWORD rop );
|
||||
extern BOOL MFDRV_PaintRgn( DC *dc, HRGN hrgn );
|
||||
extern INT MFDRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
|
||||
extern BOOL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn );
|
||||
extern INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx,
|
||||
DWORD cy, INT xSrc, INT ySrc,
|
||||
UINT startscan, UINT lines, LPCVOID bits,
|
||||
const BITMAPINFO *info, UINT coloruse );
|
||||
extern INT MFDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
|
||||
extern INT MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, const void *bits,
|
||||
const BITMAPINFO *info, UINT wUsage,
|
||||
DWORD dwRop );
|
||||
extern BOOL MFDRV_StrokeAndFillPath( DC *dc );
|
||||
extern BOOL MFDRV_StrokePath( DC *dc );
|
||||
extern BOOL MFDRV_WidenPath( DC *dc );
|
||||
extern BOOL MFDRV_StrokeAndFillPath( PHYSDEV dev );
|
||||
extern BOOL MFDRV_StrokePath( PHYSDEV dev );
|
||||
extern BOOL MFDRV_WidenPath( PHYSDEV dev );
|
||||
|
||||
#endif /* __WINE_METAFILEDRV_H */
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(metafile);
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* MFDRV_BITMAP_SelectObject
|
||||
* MFDRV_SelectBitmap
|
||||
*/
|
||||
static HBITMAP MFDRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap )
|
||||
HBITMAP MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -43,12 +43,13 @@ static HBITMAP MFDRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap )
|
|||
* MFDRV_CreateBrushIndirect
|
||||
*/
|
||||
|
||||
INT16 MFDRV_CreateBrushIndirect(DC *dc, HBRUSH hBrush )
|
||||
INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush )
|
||||
{
|
||||
INT16 index = -1;
|
||||
DWORD size;
|
||||
METARECORD *mr;
|
||||
LOGBRUSH logbrush;
|
||||
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
|
||||
|
||||
if (!GetObjectA( hBrush, sizeof(logbrush), &logbrush )) return -1;
|
||||
|
||||
|
@ -103,7 +104,7 @@ INT16 MFDRV_CreateBrushIndirect(DC *dc, HBRUSH hBrush )
|
|||
info->bmiHeader.biBitCount = 1;
|
||||
bits = ((BYTE *)info) + sizeof(BITMAPINFO) + sizeof(RGBQUAD);
|
||||
|
||||
GetDIBits(dc->hSelf, logbrush.lbHatch, 0, bm.bmHeight,
|
||||
GetDIBits(physDev->hdc, logbrush.lbHatch, 0, bm.bmHeight,
|
||||
bits, info, DIB_RGB_COLORS);
|
||||
*(DWORD *)info->bmiColors = 0;
|
||||
*(DWORD *)(info->bmiColors + 1) = 0xffffff;
|
||||
|
@ -137,8 +138,8 @@ INT16 MFDRV_CreateBrushIndirect(DC *dc, HBRUSH hBrush )
|
|||
FIXME("Unkonwn brush style %x\n", logbrush.lbStyle);
|
||||
return -1;
|
||||
}
|
||||
index = MFDRV_AddHandleDC( dc );
|
||||
if(!MFDRV_WriteRecord( dc, mr, mr->rdSize * 2))
|
||||
index = MFDRV_AddHandleDC( dev );
|
||||
if(!MFDRV_WriteRecord( dev, mr, mr->rdSize * 2))
|
||||
index = -1;
|
||||
HeapFree(GetProcessHeap(), 0, mr);
|
||||
done:
|
||||
|
@ -147,27 +148,27 @@ done:
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* MFDRV_BRUSH_SelectObject
|
||||
* MFDRV_SelectBrush
|
||||
*/
|
||||
static HBRUSH MFDRV_BRUSH_SelectObject( DC *dc, HBRUSH hbrush )
|
||||
HBRUSH MFDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
|
||||
{
|
||||
INT16 index;
|
||||
METARECORD mr;
|
||||
|
||||
index = MFDRV_CreateBrushIndirect( dc, hbrush );
|
||||
index = MFDRV_CreateBrushIndirect( dev, hbrush );
|
||||
if(index == -1) return 0;
|
||||
|
||||
mr.rdSize = sizeof(mr) / 2;
|
||||
mr.rdFunction = META_SELECTOBJECT;
|
||||
mr.rdParm[0] = index;
|
||||
return MFDRV_WriteRecord( dc, &mr, mr.rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, &mr, mr.rdSize * 2) ? hbrush : 0;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* MFDRV_CreateFontIndirect
|
||||
*/
|
||||
|
||||
static BOOL MFDRV_CreateFontIndirect(DC *dc, HFONT16 hFont, LOGFONT16 *logfont)
|
||||
static BOOL MFDRV_CreateFontIndirect(PHYSDEV dev, HFONT16 hFont, LOGFONT16 *logfont)
|
||||
{
|
||||
int index;
|
||||
char buffer[sizeof(METARECORD) - 2 + sizeof(LOGFONT16)];
|
||||
|
@ -176,34 +177,33 @@ static BOOL MFDRV_CreateFontIndirect(DC *dc, HFONT16 hFont, LOGFONT16 *logfont)
|
|||
mr->rdSize = (sizeof(METARECORD) + sizeof(LOGFONT16) - 2) / 2;
|
||||
mr->rdFunction = META_CREATEFONTINDIRECT;
|
||||
memcpy(&(mr->rdParm), logfont, sizeof(LOGFONT16));
|
||||
if (!(MFDRV_WriteRecord( dc, mr, mr->rdSize * 2))) return FALSE;
|
||||
if (!(MFDRV_WriteRecord( dev, mr, mr->rdSize * 2))) return FALSE;
|
||||
|
||||
mr->rdSize = sizeof(METARECORD) / 2;
|
||||
mr->rdFunction = META_SELECTOBJECT;
|
||||
|
||||
if ((index = MFDRV_AddHandleDC( dc )) == -1) return FALSE;
|
||||
if ((index = MFDRV_AddHandleDC( dev )) == -1) return FALSE;
|
||||
*(mr->rdParm) = index;
|
||||
return MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MFDRV_FONT_SelectObject
|
||||
* MFDRV_SelectFont
|
||||
*/
|
||||
static HFONT MFDRV_FONT_SelectObject( DC * dc, HFONT hfont )
|
||||
HFONT MFDRV_SelectFont( PHYSDEV dev, HFONT hfont )
|
||||
{
|
||||
LOGFONT16 lf16;
|
||||
|
||||
if (!GetObject16( hfont, sizeof(lf16), &lf16 )) return GDI_ERROR;
|
||||
if (MFDRV_CreateFontIndirect(dc, hfont, &lf16))
|
||||
return FALSE;
|
||||
if (MFDRV_CreateFontIndirect(dev, hfont, &lf16)) return 0;
|
||||
return GDI_ERROR;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* MFDRV_CreatePenIndirect
|
||||
*/
|
||||
static BOOL MFDRV_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN16 *logpen)
|
||||
static BOOL MFDRV_CreatePenIndirect(PHYSDEV dev, HPEN16 hPen, LOGPEN16 *logpen)
|
||||
{
|
||||
int index;
|
||||
char buffer[sizeof(METARECORD) - 2 + sizeof(*logpen)];
|
||||
|
@ -212,45 +212,25 @@ static BOOL MFDRV_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN16 *logpen)
|
|||
mr->rdSize = (sizeof(METARECORD) + sizeof(*logpen) - 2) / 2;
|
||||
mr->rdFunction = META_CREATEPENINDIRECT;
|
||||
memcpy(&(mr->rdParm), logpen, sizeof(*logpen));
|
||||
if (!(MFDRV_WriteRecord( dc, mr, mr->rdSize * 2))) return FALSE;
|
||||
if (!(MFDRV_WriteRecord( dev, mr, mr->rdSize * 2))) return FALSE;
|
||||
|
||||
mr->rdSize = sizeof(METARECORD) / 2;
|
||||
mr->rdFunction = META_SELECTOBJECT;
|
||||
|
||||
if ((index = MFDRV_AddHandleDC( dc )) == -1) return FALSE;
|
||||
if ((index = MFDRV_AddHandleDC( dev )) == -1) return FALSE;
|
||||
*(mr->rdParm) = index;
|
||||
return MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MFDRV_PEN_SelectObject
|
||||
* MFDRV_SelectPen
|
||||
*/
|
||||
static HPEN MFDRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
||||
HPEN MFDRV_SelectPen( PHYSDEV dev, HPEN hpen )
|
||||
{
|
||||
LOGPEN16 logpen;
|
||||
HPEN prevHandle = dc->hPen;
|
||||
|
||||
if (!GetObject16( hpen, sizeof(logpen), &logpen )) return 0;
|
||||
if (MFDRV_CreatePenIndirect( dc, hpen, &logpen )) return prevHandle;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MFDRV_SelectObject
|
||||
*/
|
||||
HGDIOBJ MFDRV_SelectObject( DC *dc, HGDIOBJ handle )
|
||||
{
|
||||
TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
|
||||
|
||||
switch(GetObjectType( handle ))
|
||||
{
|
||||
case OBJ_PEN: return MFDRV_PEN_SelectObject( dc, handle );
|
||||
case OBJ_BRUSH: return MFDRV_BRUSH_SelectObject( dc, handle );
|
||||
case OBJ_BITMAP: return MFDRV_BITMAP_SelectObject( dc, handle );
|
||||
case OBJ_FONT: return MFDRV_FONT_SelectObject( dc, handle );
|
||||
case OBJ_REGION: return (HGDIOBJ)SelectClipRgn( dc->hSelf, handle );
|
||||
}
|
||||
if (MFDRV_CreatePenIndirect( dev, hpen, &logpen )) return hpen;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(metafile);
|
|||
/******************************************************************
|
||||
* MFDRV_MetaExtTextOut
|
||||
*/
|
||||
static BOOL MFDRV_MetaExtTextOut(DC*dc, short x, short y, UINT16 flags,
|
||||
static BOOL MFDRV_MetaExtTextOut( PHYSDEV dev, short x, short y, UINT16 flags,
|
||||
const RECT16 *rect, LPCSTR str, short count,
|
||||
const INT16 *lpDx)
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ static BOOL MFDRV_MetaExtTextOut(DC*dc, short x, short y, UINT16 flags,
|
|||
if (lpDx)
|
||||
memcpy(mr->rdParm + (rect ? 8 : 4) + ((count + 1) >> 1),lpDx,
|
||||
count*sizeof(INT16));
|
||||
ret = MFDRV_WriteRecord( dc, mr, mr->rdSize * 2);
|
||||
ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
|
||||
HeapFree( GetProcessHeap(), 0, mr);
|
||||
return ret;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ static BOOL MFDRV_MetaExtTextOut(DC*dc, short x, short y, UINT16 flags,
|
|||
* MFDRV_ExtTextOut
|
||||
*/
|
||||
BOOL
|
||||
MFDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||
MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR str, UINT count,
|
||||
const INT *lpDx )
|
||||
{
|
||||
|
@ -91,8 +91,7 @@ MFDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
len = WideCharToMultiByte( CP_ACP, 0, str, count, NULL, 0, NULL, NULL );
|
||||
ascii = HeapAlloc( GetProcessHeap(), 0, len );
|
||||
WideCharToMultiByte( CP_ACP, 0, str, count, ascii, len, NULL, NULL );
|
||||
ret = MFDRV_MetaExtTextOut(dc,x,y,flags,lprect?&rect16:NULL,ascii,len,
|
||||
lpdx16);
|
||||
ret = MFDRV_MetaExtTextOut(dev,x,y,flags,lprect?&rect16:NULL,ascii,len,lpdx16);
|
||||
HeapFree( GetProcessHeap(), 0, ascii );
|
||||
if (lpdx16) HeapFree( GetProcessHeap(), 0, lpdx16 );
|
||||
return ret;
|
||||
|
|
|
@ -94,7 +94,7 @@ INT WINAPI StartDocA(HDC hdc, const DOCINFOA* doc)
|
|||
|
||||
if(!dc) return SP_ERROR;
|
||||
|
||||
if (dc->funcs->pStartDoc) ret = dc->funcs->pStartDoc( dc, doc );
|
||||
if (dc->funcs->pStartDoc) ret = dc->funcs->pStartDoc( dc->physDev, doc );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ INT WINAPI EndDoc(HDC hdc)
|
|||
DC *dc = DC_GetDCPtr( hdc );
|
||||
if(!dc) return SP_ERROR;
|
||||
|
||||
if (dc->funcs->pEndDoc) ret = dc->funcs->pEndDoc( dc );
|
||||
if (dc->funcs->pEndDoc) ret = dc->funcs->pEndDoc( dc->physDev );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ INT WINAPI StartPage(HDC hdc)
|
|||
if(!dc) return SP_ERROR;
|
||||
|
||||
if(dc->funcs->pStartPage)
|
||||
ret = dc->funcs->pStartPage( dc );
|
||||
ret = dc->funcs->pStartPage( dc->physDev );
|
||||
else
|
||||
FIXME("stub\n");
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
@ -199,7 +199,7 @@ INT WINAPI EndPage(HDC hdc)
|
|||
DC *dc = DC_GetDCPtr( hdc );
|
||||
if(!dc) return SP_ERROR;
|
||||
|
||||
if (dc->funcs->pEndPage) ret = dc->funcs->pEndPage( dc );
|
||||
if (dc->funcs->pEndPage) ret = dc->funcs->pEndPage( dc->physDev );
|
||||
GDI_ReleaseObj( hdc );
|
||||
if (!QueryAbort16( hdc, 0 ))
|
||||
{
|
||||
|
@ -226,7 +226,7 @@ INT WINAPI AbortDoc(HDC hdc)
|
|||
DC *dc = DC_GetDCPtr( hdc );
|
||||
if(!dc) return SP_ERROR;
|
||||
|
||||
if (dc->funcs->pAbortDoc) ret = dc->funcs->pAbortDoc( dc );
|
||||
if (dc->funcs->pAbortDoc) ret = dc->funcs->pAbortDoc( dc->physDev );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* GDI brush objects - win16drv
|
||||
*
|
||||
* Copyright 1997 John Harvey
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "win16drv/win16drv.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(win16drv);
|
||||
|
||||
HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
HBRUSH16 prevHandle = dc->hBrush;
|
||||
int nSize;
|
||||
LOGBRUSH16 lBrush16;
|
||||
|
||||
if (!GetObject16( hbrush, sizeof(lBrush16), &lBrush16 )) return 0;
|
||||
|
||||
dc->hBrush = hbrush;
|
||||
if ( physDev->BrushInfo )
|
||||
{
|
||||
TRACE("UnRealizing BrushInfo\n");
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
|
||||
physDev->BrushInfo,
|
||||
physDev->BrushInfo, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
|
||||
&lBrush16, 0, 0);
|
||||
physDev->BrushInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
|
||||
}
|
||||
|
||||
|
||||
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
|
||||
&lBrush16,
|
||||
physDev->BrushInfo,
|
||||
win16drv_SegPtr_TextXForm);
|
||||
|
||||
return prevHandle;
|
||||
}
|
|
@ -33,15 +33,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(win16drv);
|
|||
/***********************************************************************
|
||||
* WIN16DRV_GetTextExtentPoint
|
||||
*/
|
||||
BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR wstr, INT count,
|
||||
BOOL WIN16DRV_GetTextExtentPoint( PHYSDEV dev, LPCWSTR wstr, INT count,
|
||||
LPSIZE size )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
DWORD dwRet, len;
|
||||
char *str;
|
||||
|
||||
TRACE("%04x %s %d %p\n",
|
||||
dc->hSelf, debugstr_wn(wstr, count), count, size);
|
||||
TRACE("%04x %s %d %p\n", physDev->hdc, debugstr_wn(wstr, count), count, size);
|
||||
|
||||
|
||||
len = WideCharToMultiByte( CP_ACP, 0, wstr, count, NULL, 0, NULL, NULL );
|
||||
|
@ -63,11 +63,11 @@ BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR wstr, INT count,
|
|||
/***********************************************************************
|
||||
* WIN16DRV_GetTextMetrics
|
||||
*/
|
||||
BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics )
|
||||
BOOL WIN16DRV_GetTextMetrics( PHYSDEV dev, TEXTMETRICW *metrics )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
|
||||
TRACE("%04x \n", dc->hSelf);
|
||||
TRACE("%04x \n", physDev->hdc);
|
||||
|
||||
FONT_TextMetric16ToW( &physDev->tm, metrics );
|
||||
|
||||
|
@ -85,9 +85,13 @@ BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont)
|
||||
/***********************************************************************
|
||||
* WIN16DRV_SelectFont
|
||||
*/
|
||||
HFONT WIN16DRV_SelectFont( PHYSDEV dev, HFONT hfont)
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
int nSize;
|
||||
|
||||
if (!GetObject16( hfont, sizeof(physDev->lf), &physDev->lf ))
|
||||
|
@ -163,16 +167,14 @@ HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont)
|
|||
/***********************************************************************
|
||||
* WIN16DRV_GetCharWidth
|
||||
*/
|
||||
BOOL WIN16DRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
|
||||
BOOL WIN16DRV_GetCharWidth( PHYSDEV dev, UINT firstChar, UINT lastChar,
|
||||
LPINT buffer )
|
||||
{
|
||||
int i;
|
||||
WORD wRet;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
TRACE("%d - %d into %p\n",
|
||||
firstChar, lastChar, buffer );
|
||||
TRACE("%d - %d into %p\n", firstChar, lastChar, buffer );
|
||||
|
||||
wRet = PRTDRV_GetCharWidth( physDev->segptrPDEVICE, buffer, firstChar,
|
||||
lastChar, physDev->FontInfo,
|
||||
|
|
|
@ -29,11 +29,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(win16drv);
|
|||
* WIN16DRV_LineTo
|
||||
*/
|
||||
BOOL
|
||||
WIN16DRV_LineTo( DC *dc, INT x, INT y )
|
||||
WIN16DRV_LineTo( PHYSDEV dev, INT x, INT y )
|
||||
{
|
||||
BOOL bRet ;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
POINT16 points[2];
|
||||
|
||||
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 );
|
||||
|
@ -54,9 +56,10 @@ WIN16DRV_LineTo( DC *dc, INT x, INT y )
|
|||
* WIN16DRV_Rectangle
|
||||
*/
|
||||
BOOL
|
||||
WIN16DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
WIN16DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL bRet = 0;
|
||||
POINT16 points[2];
|
||||
|
||||
|
@ -84,9 +87,10 @@ WIN16DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
* WIN16DRV_Polygon
|
||||
*/
|
||||
BOOL
|
||||
WIN16DRV_Polygon(DC *dc, const POINT* pt, INT count )
|
||||
WIN16DRV_Polygon(PHYSDEV dev, const POINT* pt, INT count )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL bRet = 0;
|
||||
LPPOINT16 points;
|
||||
int i;
|
||||
|
@ -119,9 +123,10 @@ WIN16DRV_Polygon(DC *dc, const POINT* pt, INT count )
|
|||
* WIN16DRV_Polyline
|
||||
*/
|
||||
BOOL
|
||||
WIN16DRV_Polyline(DC *dc, const POINT* pt, INT count )
|
||||
WIN16DRV_Polyline(PHYSDEV dev, const POINT* pt, INT count )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL bRet = 0;
|
||||
LPPOINT16 points;
|
||||
int i;
|
||||
|
@ -151,15 +156,15 @@ WIN16DRV_Polyline(DC *dc, const POINT* pt, INT count )
|
|||
* WIN16DRV_Ellipse
|
||||
*/
|
||||
BOOL
|
||||
WIN16DRV_Ellipse(DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
WIN16DRV_Ellipse(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL bRet = 0;
|
||||
POINT16 points[2];
|
||||
TRACE("In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n",
|
||||
left, top, dc->DCOrgX, dc->DCOrgY);
|
||||
TRACE("In WIN16DRV_Ellipse, VPortOrgX %d y %d\n",
|
||||
dc->vportOrgX, dc->vportOrgY);
|
||||
|
||||
TRACE("In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n", 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);
|
||||
points[0].y = YLPTODP(dc, top);
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ LPDRAWMODE win16drv_DrawModeP;
|
|||
|
||||
static BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
||||
LPCSTR output, const DEVMODEA* initData );
|
||||
static INT WIN16DRV_GetDeviceCaps( DC *dc, INT cap );
|
||||
static INT WIN16DRV_ExtEscape( DC *dc, INT escape, INT in_count, LPCVOID in_data,
|
||||
static INT WIN16DRV_GetDeviceCaps( PHYSDEV dev, INT cap );
|
||||
static INT WIN16DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_data,
|
||||
INT out_count, LPVOID out_data );
|
||||
|
||||
static const DC_FUNCTIONS WIN16DRV_Funcs =
|
||||
|
@ -92,6 +92,8 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
|
|||
NULL, /* pFrameRgn */
|
||||
WIN16DRV_GetCharWidth, /* pGetCharWidth */
|
||||
NULL, /* pGetDCOrgEx */
|
||||
NULL, /* pGetDIBColorTable */
|
||||
NULL, /* pGetDIBits */
|
||||
WIN16DRV_GetDeviceCaps, /* pGetDeviceCaps */
|
||||
NULL, /* pGetDeviceGammaRamp */
|
||||
NULL, /* pGetPixel */
|
||||
|
@ -123,15 +125,20 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
|
|||
NULL, /* pSaveDC */
|
||||
NULL, /* pScaleViewportExtEx */
|
||||
NULL, /* pScaleWindowExtEx */
|
||||
WIN16DRV_SelectBitmap, /* pSelectBitmap */
|
||||
WIN16DRV_SelectBrush, /* pSelectBrush */
|
||||
NULL, /* pSelectClipPath */
|
||||
NULL, /* pSelectClipRgn */
|
||||
WIN16DRV_SelectObject, /* pSelectObject */
|
||||
WIN16DRV_SelectFont, /* pSelectFont */
|
||||
NULL, /* pSelectPalette */
|
||||
WIN16DRV_SelectPen, /* pSelectPen */
|
||||
NULL, /* pSetBkColor */
|
||||
NULL, /* pSetBkMode */
|
||||
NULL, /* pSetDIBColorTable */
|
||||
NULL, /* pSetDIBits */
|
||||
NULL, /* pSetDIBitsToDevice */
|
||||
NULL, /* pSetDeviceClipping */
|
||||
NULL, /* pSetDeviceGammaRamp */
|
||||
NULL, /* pSetDIBitsToDevice */
|
||||
NULL, /* pSetMapMode */
|
||||
NULL, /* pSetMapperFlags */
|
||||
NULL, /* pSetPixel */
|
||||
|
@ -242,7 +249,9 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
|
|||
|
||||
physDev = (WIN16DRV_PDEVICE *)HeapAlloc( GetProcessHeap(), 0, sizeof(*physDev) );
|
||||
if (!physDev) return FALSE;
|
||||
dc->physDev = physDev;
|
||||
dc->physDev = (PHYSDEV)physDev;
|
||||
physDev->hdc = dc->hSelf;
|
||||
physDev->dc = dc;
|
||||
|
||||
pLPD = LoadPrinterDriver(driver);
|
||||
if (pLPD == NULL)
|
||||
|
@ -305,11 +314,10 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WIN16DRV_PatBlt( struct tagDC *dc, INT left, INT top,
|
||||
INT width, INT height, DWORD rop )
|
||||
BOOL WIN16DRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, DWORD rop )
|
||||
{
|
||||
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
BOOL bRet = 0;
|
||||
|
||||
bRet = PRTDRV_StretchBlt( physDev->segptrPDEVICE, left, top, width, height, (SEGPTR)NULL, 0, 0, width, height,
|
||||
|
@ -322,12 +330,12 @@ BOOL WIN16DRV_PatBlt( struct tagDC *dc, INT left, INT top,
|
|||
/***********************************************************************
|
||||
* WIN16DRV_GetDeviceCaps
|
||||
*/
|
||||
static INT WIN16DRV_GetDeviceCaps( DC *dc, INT cap )
|
||||
static INT WIN16DRV_GetDeviceCaps( PHYSDEV dev, INT cap )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
if (cap >= PHYSICALWIDTH || (cap % 2))
|
||||
{
|
||||
FIXME("(%04x): unsupported capability %d, will return 0\n", dc->hSelf, cap );
|
||||
FIXME("(%04x): unsupported capability %d, will return 0\n", physDev->hdc, cap );
|
||||
return 0;
|
||||
}
|
||||
return *((WORD *)&physDev->DevCaps + (cap / 2));
|
||||
|
@ -337,7 +345,7 @@ static INT WIN16DRV_GetDeviceCaps( DC *dc, INT cap )
|
|||
/***********************************************************************
|
||||
* WIN16DRV_ExtEscape
|
||||
*/
|
||||
static INT WIN16DRV_ExtEscape( DC *dc, INT escape, INT in_count, LPCVOID in_data,
|
||||
static INT WIN16DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_data,
|
||||
INT out_count, LPVOID out_data )
|
||||
{
|
||||
#if 0
|
||||
|
|
|
@ -31,21 +31,70 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdi);
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* WIN16DRV_SelectObject
|
||||
* WIN16DRV_SelectBitmap
|
||||
*/
|
||||
HGDIOBJ WIN16DRV_SelectObject( DC *dc, HGDIOBJ handle )
|
||||
HBITMAP WIN16DRV_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
|
||||
{
|
||||
TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
|
||||
|
||||
switch(GetObjectType( handle ))
|
||||
{
|
||||
case OBJ_PEN: return WIN16DRV_PEN_SelectObject( dc, handle );
|
||||
case OBJ_BRUSH: return WIN16DRV_BRUSH_SelectObject( dc, handle );
|
||||
case OBJ_FONT: return WIN16DRV_FONT_SelectObject( dc, handle );
|
||||
case OBJ_REGION: return (HGDIOBJ)SelectClipRgn( dc->hSelf, handle );
|
||||
case OBJ_BITMAP:
|
||||
FIXME("BITMAP not implemented\n");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* WIN16DRV_SelectBrush
|
||||
*/
|
||||
HBRUSH WIN16DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
int nSize;
|
||||
LOGBRUSH16 lBrush16;
|
||||
|
||||
if (!GetObject16( hbrush, sizeof(lBrush16), &lBrush16 )) return 0;
|
||||
|
||||
if ( physDev->BrushInfo )
|
||||
{
|
||||
TRACE("UnRealizing BrushInfo\n");
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
|
||||
physDev->BrushInfo,
|
||||
physDev->BrushInfo, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH, &lBrush16, 0, 0);
|
||||
physDev->BrushInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
|
||||
}
|
||||
|
||||
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
|
||||
&lBrush16, physDev->BrushInfo, win16drv_SegPtr_TextXForm);
|
||||
return hbrush;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* WIN16DRV_SelectPen
|
||||
*/
|
||||
HPEN WIN16DRV_SelectPen( PHYSDEV dev, HPEN hpen )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
int nSize;
|
||||
LOGPEN16 lPen16;
|
||||
|
||||
if (!GetObject16( hpen, sizeof(lPen16), &lPen16 )) return 0;
|
||||
|
||||
if ( physDev->PenInfo )
|
||||
{
|
||||
TRACE("UnRealizing PenInfo\n");
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN,
|
||||
physDev->PenInfo,
|
||||
physDev->PenInfo, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_PEN, &lPen16, 0, 0);
|
||||
physDev->PenInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
|
||||
}
|
||||
|
||||
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_PEN,
|
||||
&lPen16, physDev->PenInfo, 0);
|
||||
return hpen;
|
||||
}
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* GDI pen objects
|
||||
*
|
||||
* Copyright 1997 John Harvey
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "win16drv/win16drv.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(win16drv);
|
||||
|
||||
/***********************************************************************
|
||||
* PEN_SelectObject
|
||||
*/
|
||||
HPEN WIN16DRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
HPEN prevHandle = dc->hPen;
|
||||
int nSize;
|
||||
LOGPEN16 lPen16;
|
||||
|
||||
if (!GetObject16( hpen, sizeof(lPen16), &lPen16 )) return 0;
|
||||
|
||||
dc->hPen = hpen;
|
||||
|
||||
if ( physDev->PenInfo )
|
||||
{
|
||||
TRACE("UnRealizing PenInfo\n");
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN,
|
||||
physDev->PenInfo,
|
||||
physDev->PenInfo, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_PEN,
|
||||
&lPen16, 0, 0);
|
||||
physDev->PenInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
|
||||
}
|
||||
|
||||
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_PEN,
|
||||
&lPen16,
|
||||
physDev->PenInfo,
|
||||
0);
|
||||
|
||||
return prevHandle;
|
||||
}
|
||||
|
|
@ -31,11 +31,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(win16drv);
|
|||
/***********************************************************************
|
||||
* WIN16DRV_ExtTextOut
|
||||
*/
|
||||
BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||
BOOL WIN16DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR wstr, UINT count,
|
||||
const INT *lpDx )
|
||||
{
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL bRet = 1;
|
||||
RECT16 clipRect;
|
||||
RECT16 opaqueRect;
|
||||
|
|
|
@ -205,6 +205,8 @@ typedef struct
|
|||
LPFONTINFO16 FontInfo; /* Current font realized by printer driver */
|
||||
LPLOGBRUSH16 BrushInfo; /* Current brush realized by printer driver */
|
||||
LPLOGPEN16 PenInfo; /* Current pen realized by printer driver */
|
||||
HDC hdc;
|
||||
DC *dc;
|
||||
DeviceCaps DevCaps; /* Device caps */
|
||||
} WIN16DRV_PDEVICE;
|
||||
|
||||
|
@ -257,26 +259,27 @@ extern WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer,
|
|||
/* Wine driver functions */
|
||||
|
||||
extern const DC_FUNCTIONS *WIN16DRV_Init(void);
|
||||
extern BOOL WIN16DRV_GetCharWidth( struct tagDC *dc, UINT firstChar, UINT lastChar,
|
||||
LPINT buffer );
|
||||
extern BOOL WIN16DRV_GetCharWidth( PHYSDEV dev, UINT firstChar, UINT lastChar, LPINT buffer );
|
||||
|
||||
extern BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
|
||||
extern BOOL WIN16DRV_GetTextExtentPoint( PHYSDEV dev, LPCWSTR str, INT count,
|
||||
LPSIZE size );
|
||||
extern BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics );
|
||||
extern BOOL WIN16DRV_GetTextMetrics( PHYSDEV dev, TEXTMETRICW *metrics );
|
||||
|
||||
extern BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||
extern BOOL WIN16DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR str, UINT count,
|
||||
const INT *lpDx );
|
||||
extern BOOL WIN16DRV_LineTo( DC *dc, INT x, INT y );
|
||||
extern BOOL WIN16DRV_Polygon(DC *dc, const POINT* pt, INT count );
|
||||
extern BOOL WIN16DRV_Polyline(DC *dc, const POINT* pt, INT count );
|
||||
extern BOOL WIN16DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom);
|
||||
extern HGDIOBJ WIN16DRV_SelectObject( DC *dc, HGDIOBJ handle );
|
||||
extern BOOL WIN16DRV_PatBlt( struct tagDC *dc, INT left, INT top,
|
||||
extern BOOL WIN16DRV_LineTo( PHYSDEV dev, INT x, INT y );
|
||||
extern BOOL WIN16DRV_Polygon(PHYSDEV dev, const POINT* pt, INT count );
|
||||
extern BOOL WIN16DRV_Polyline(PHYSDEV dev, const POINT* pt, INT count );
|
||||
extern BOOL WIN16DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom);
|
||||
extern HBITMAP WIN16DRV_SelectBitmap( PHYSDEV dev, HBITMAP handle );
|
||||
extern HBRUSH WIN16DRV_SelectBrush( PHYSDEV dev, HBRUSH handle );
|
||||
extern HFONT WIN16DRV_SelectFont( PHYSDEV dev, HFONT handle );
|
||||
extern HPEN WIN16DRV_SelectPen( PHYSDEV dev, HPEN handle );
|
||||
extern BOOL WIN16DRV_PatBlt( PHYSDEV dev, INT left, INT top,
|
||||
INT width, INT height, DWORD rop );
|
||||
extern BOOL WIN16DRV_Ellipse(DC *dc, INT left, INT top, INT right, INT bottom);
|
||||
extern BOOL WIN16DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
|
||||
DEVICEFONTENUMPROC proc, LPARAM lp );
|
||||
extern BOOL WIN16DRV_Ellipse(PHYSDEV dev, INT left, INT top, INT right, INT bottom);
|
||||
extern BOOL WIN16DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf, DEVICEFONTENUMPROC proc, LPARAM lp );
|
||||
|
||||
extern INT WIN16DRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
|
||||
LPDEVMODEA lpdmOutput,
|
||||
|
@ -287,10 +290,6 @@ extern DWORD WIN16DRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
|
|||
LPCSTR lpszPort, WORD fwCapability,
|
||||
LPSTR lpszOutput, LPDEVMODEA lpdm);
|
||||
|
||||
extern HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush );
|
||||
extern HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont );
|
||||
extern HPEN WIN16DRV_PEN_SelectObject( DC * dc, HPEN hpen );
|
||||
|
||||
/*
|
||||
* Wine 16bit driver global variables
|
||||
*/
|
||||
|
|
|
@ -136,23 +136,29 @@ static LONG TTYDRV_DC_GetBitmapBits(BITMAPOBJ *bitmap, void *bits, LONG count)
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_BITMAP_SelectObject
|
||||
* TTYDRV_SelectBitmap (TTYDRV.@)
|
||||
*/
|
||||
HBITMAP TTYDRV_DC_BITMAP_SelectObject(DC *dc, HBITMAP hbitmap, BITMAPOBJ *bitmap)
|
||||
HBITMAP TTYDRV_SelectBitmap(TTYDRV_PDEVICE *physDev, HBITMAP hbitmap)
|
||||
{
|
||||
HBITMAP hPreviousBitmap;
|
||||
DC *dc = physDev->dc;
|
||||
BITMAPOBJ *bitmap;
|
||||
|
||||
TRACE("(%p, 0x%04x, %p)\n", dc, hbitmap, bitmap);
|
||||
TRACE("(%p, 0x%04x)\n", dc, hbitmap);
|
||||
|
||||
if(!(dc->flags & DC_MEMORY))
|
||||
return 0;
|
||||
|
||||
if (!(bitmap = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) return 0;
|
||||
/* Assure that the bitmap device dependent */
|
||||
if(!bitmap->physBitmap && !TTYDRV_DC_CreateBitmap(hbitmap))
|
||||
{
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(bitmap->funcs != dc->funcs) {
|
||||
ERR("Trying to select a non-TTY DDB into a TTY DC\n");
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -169,15 +175,14 @@ HBITMAP TTYDRV_DC_BITMAP_SelectObject(DC *dc, HBITMAP hbitmap, BITMAPOBJ *bitmap
|
|||
HRGN hrgn;
|
||||
|
||||
if(!(hrgn = CreateRectRgn(0, 0, bitmap->bitmap.bmWidth, bitmap->bitmap.bmHeight)))
|
||||
{
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
return 0;
|
||||
|
||||
}
|
||||
dc->hVisRgn = hrgn;
|
||||
}
|
||||
|
||||
hPreviousBitmap = dc->hBitmap;
|
||||
dc->hBitmap = hbitmap;
|
||||
|
||||
return hPreviousBitmap;
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
return hbitmap;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -194,95 +199,25 @@ static LONG TTYDRV_DC_SetBitmapBits(BITMAPOBJ *bitmap, void *bits, LONG count)
|
|||
* TTYDRV_BITMAP_CreateDIBSection
|
||||
*/
|
||||
HBITMAP TTYDRV_BITMAP_CreateDIBSection(
|
||||
DC *dc, BITMAPINFO *bmi, UINT usage,
|
||||
TTYDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage,
|
||||
LPVOID *bits, HANDLE section, DWORD offset)
|
||||
{
|
||||
FIXME("(%p, %p, %u, %p, 0x%04x, %ld): stub\n",
|
||||
dc, bmi, usage, bits, section, offset);
|
||||
FIXME("(%x, %p, %u, %p, 0x%04x, %ld): stub\n",
|
||||
physDev->hdc, bmi, usage, bits, section, offset);
|
||||
|
||||
return (HBITMAP) NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_BITMAP_DeleteDIBSection
|
||||
*/
|
||||
void TTYDRV_BITMAP_DeleteDIBSection(BITMAPOBJ *bmp)
|
||||
{
|
||||
FIXME("(%p): stub\n", bmp);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_BITMAP_SetDIBColorTable
|
||||
*/
|
||||
UINT TTYDRV_BITMAP_SetDIBColorTable(BITMAPOBJ *bmp, DC *dc, UINT start, UINT count, const RGBQUAD *colors)
|
||||
{
|
||||
FIXME("(%p): stub\n", bmp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_BITMAP_GetDIBColorTable
|
||||
*/
|
||||
UINT TTYDRV_BITMAP_GetDIBColorTable(BITMAPOBJ *bmp, DC *dc, UINT start, UINT count, RGBQUAD *colors)
|
||||
{
|
||||
FIXME("(%p): stub\n", bmp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_BITMAP_Lock
|
||||
*/
|
||||
INT TTYDRV_BITMAP_Lock(BITMAPOBJ *bmp, INT req, BOOL lossy)
|
||||
{
|
||||
FIXME("(%p): stub\n", bmp);
|
||||
return DIB_Status_None;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_BITMAP_Unlock
|
||||
*/
|
||||
void TTYDRV_BITMAP_Unlock(BITMAPOBJ *bmp, BOOL commit)
|
||||
{
|
||||
FIXME("(%p): stub\n", bmp);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_BITMAP_GetDIBits
|
||||
*/
|
||||
INT TTYDRV_BITMAP_GetDIBits(
|
||||
BITMAPOBJ *bmp, DC *dc, UINT startscan, UINT lines,
|
||||
LPVOID bits, BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap)
|
||||
{
|
||||
FIXME("(%p, %p, %u, %u, %p, %p, %u, 0x%04x): stub\n",
|
||||
bmp, dc, startscan, lines, bits, info, coloruse, hbitmap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_BITMAP_SetDIBits
|
||||
*/
|
||||
INT TTYDRV_BITMAP_SetDIBits(
|
||||
BITMAPOBJ *bmp, DC *dc, UINT startscan, UINT lines,
|
||||
LPCVOID bits, const BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap)
|
||||
{
|
||||
FIXME("(%p, %p, %u, %u, %p, %p, %u, 0x%04x): stub\n",
|
||||
bmp, dc, startscan, lines, bits, info, coloruse, hbitmap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_SetDIBitsToDevice
|
||||
*/
|
||||
INT TTYDRV_DC_SetDIBitsToDevice(DC *dc, INT xDest, INT yDest, DWORD cx,
|
||||
INT TTYDRV_DC_SetDIBitsToDevice(TTYDRV_PDEVICE *physDev, INT xDest, INT yDest, DWORD cx,
|
||||
DWORD cy, INT xSrc, INT ySrc,
|
||||
UINT startscan, UINT lines, LPCVOID bits,
|
||||
const BITMAPINFO *info, UINT coloruse)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %ld, %ld, %d, %d, %u, %u, %p, %p, %u): stub\n",
|
||||
dc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse);
|
||||
FIXME("(%x, %d, %d, %ld, %ld, %d, %d, %u, %u, %p, %p, %u): stub\n",
|
||||
physDev->hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -31,17 +31,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
|
|||
|
||||
/**********************************************************************/
|
||||
|
||||
BITMAP_DRIVER TTYDRV_BITMAP_Driver =
|
||||
{
|
||||
TTYDRV_BITMAP_SetDIBits,
|
||||
TTYDRV_BITMAP_GetDIBits,
|
||||
TTYDRV_BITMAP_DeleteDIBSection,
|
||||
TTYDRV_BITMAP_SetDIBColorTable,
|
||||
TTYDRV_BITMAP_GetDIBColorTable,
|
||||
TTYDRV_BITMAP_Lock,
|
||||
TTYDRV_BITMAP_Unlock
|
||||
};
|
||||
|
||||
PALETTE_DRIVER TTYDRV_PALETTE_Driver =
|
||||
{
|
||||
TTYDRV_PALETTE_SetMapping,
|
||||
|
@ -56,7 +45,6 @@ const DC_FUNCTIONS *TTYDRV_DC_Funcs = NULL; /* hack */
|
|||
*/
|
||||
BOOL TTYDRV_GDI_Initialize(void)
|
||||
{
|
||||
BITMAP_Driver = &TTYDRV_BITMAP_Driver;
|
||||
PALETTE_Driver = &TTYDRV_PALETTE_Driver;
|
||||
|
||||
return TTYDRV_PALETTE_Initialize();
|
||||
|
@ -84,6 +72,8 @@ BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
|
|||
return FALSE;
|
||||
}
|
||||
physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||
physDev->hdc = dc->hSelf;
|
||||
physDev->dc = dc;
|
||||
|
||||
if(dc->flags & DC_MEMORY){
|
||||
physDev->window = NULL;
|
||||
|
@ -121,13 +111,12 @@ BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_DeleteDC
|
||||
*/
|
||||
BOOL TTYDRV_DC_DeleteDC(DC *dc)
|
||||
BOOL TTYDRV_DC_DeleteDC(TTYDRV_PDEVICE *physDev)
|
||||
{
|
||||
TRACE("(%p)\n", dc);
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, dc->physDev );
|
||||
dc->physDev = NULL;
|
||||
TRACE("(%x)\n", physDev->hdc);
|
||||
|
||||
physDev->dc->physDev = NULL;
|
||||
HeapFree( GetProcessHeap(), 0, physDev );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -135,7 +124,7 @@ BOOL TTYDRV_DC_DeleteDC(DC *dc)
|
|||
/***********************************************************************
|
||||
* GetDeviceCaps (TTYDRV.@)
|
||||
*/
|
||||
INT TTYDRV_GetDeviceCaps( DC *dc, INT cap )
|
||||
INT TTYDRV_GetDeviceCaps( TTYDRV_PDEVICE *physDev, INT cap )
|
||||
{
|
||||
switch(cap)
|
||||
{
|
||||
|
@ -209,7 +198,7 @@ INT TTYDRV_GetDeviceCaps( DC *dc, INT cap )
|
|||
case BTLALIGNMENT:
|
||||
return 0;
|
||||
default:
|
||||
FIXME("(%04x): unsupported capability %d, will return 0\n", dc->hSelf, cap );
|
||||
FIXME("(%04x): unsupported capability %d, will return 0\n", physDev->hdc, cap );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -218,7 +207,7 @@ INT TTYDRV_GetDeviceCaps( DC *dc, INT cap )
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_SetDeviceClipping
|
||||
*/
|
||||
void TTYDRV_DC_SetDeviceClipping(DC *dc)
|
||||
void TTYDRV_DC_SetDeviceClipping(TTYDRV_PDEVICE *physDev)
|
||||
{
|
||||
TRACE("(%p)\n", dc);
|
||||
TRACE("(%x)\n", physDev->hdc);
|
||||
}
|
||||
|
|
|
@ -30,69 +30,63 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_Arc
|
||||
*/
|
||||
BOOL TTYDRV_DC_Arc(DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
BOOL TTYDRV_DC_Arc(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
||||
dc, left, top, right, bottom, xstart, ystart, xend, yend);
|
||||
|
||||
FIXME("(%x, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
||||
physDev->hdc, left, top, right, bottom, xstart, ystart, xend, yend);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_Chord
|
||||
*/
|
||||
BOOL TTYDRV_DC_Chord(DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
BOOL TTYDRV_DC_Chord(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
||||
dc, left, top, right, bottom, xstart, ystart, xend, yend);
|
||||
|
||||
FIXME("(%x, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
||||
physDev->hdc, left, top, right, bottom, xstart, ystart, xend, yend);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_Ellipse
|
||||
*/
|
||||
BOOL TTYDRV_DC_Ellipse(DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
BOOL TTYDRV_DC_Ellipse(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %d, %d): stub\n",
|
||||
dc, left, top, right, bottom);
|
||||
|
||||
FIXME("(%x, %d, %d, %d, %d): stub\n", physDev->hdc, left, top, right, bottom);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_ExtFloodFill
|
||||
*/
|
||||
BOOL TTYDRV_DC_ExtFloodFill(DC *dc, INT x, INT y,
|
||||
BOOL TTYDRV_DC_ExtFloodFill(TTYDRV_PDEVICE *physDev, INT x, INT y,
|
||||
COLORREF color, UINT fillType)
|
||||
{
|
||||
FIXME("(%p, %d, %d, 0x%08lx, %u): stub\n", dc, x, y, color, fillType);
|
||||
|
||||
FIXME("(%x, %d, %d, 0x%08lx, %u): stub\n", physDev->hdc, x, y, color, fillType);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_GetPixel
|
||||
*/
|
||||
COLORREF TTYDRV_DC_GetPixel(DC *dc, INT x, INT y)
|
||||
COLORREF TTYDRV_DC_GetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y)
|
||||
{
|
||||
FIXME("(%p, %d, %d): stub\n", dc, x, y);
|
||||
|
||||
FIXME("(%x, %d, %d): stub\n", physDev->hdc, x, y);
|
||||
return RGB(0,0,0); /* FIXME: Always returns black */
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_LineTo
|
||||
*/
|
||||
BOOL TTYDRV_DC_LineTo(DC *dc, INT x, INT y)
|
||||
BOOL TTYDRV_DC_LineTo(TTYDRV_PDEVICE *physDev, INT x, INT y)
|
||||
{
|
||||
#ifdef WINE_CURSES
|
||||
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||
INT row1, col1, row2, col2;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("(%p, %d, %d)\n", dc, x, y);
|
||||
TRACE("(%x, %d, %d)\n", physDev->hdc, x, y);
|
||||
|
||||
if(!physDev->window)
|
||||
return FALSE;
|
||||
|
@ -126,7 +120,7 @@ BOOL TTYDRV_DC_LineTo(DC *dc, INT x, INT y)
|
|||
|
||||
return TRUE;
|
||||
#else /* defined(WINE_CURSES) */
|
||||
FIXME("(%p, %d, %d): stub\n", dc, x, y);
|
||||
FIXME("(%x, %d, %d): stub\n", physDev->hdc, x, y);
|
||||
|
||||
return TRUE;
|
||||
#endif /* defined(WINE_CURSES) */
|
||||
|
@ -135,61 +129,56 @@ BOOL TTYDRV_DC_LineTo(DC *dc, INT x, INT y)
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_PaintRgn
|
||||
*/
|
||||
BOOL TTYDRV_DC_PaintRgn(DC *dc, HRGN hrgn)
|
||||
BOOL TTYDRV_DC_PaintRgn(TTYDRV_PDEVICE *physDev, HRGN hrgn)
|
||||
{
|
||||
FIXME("(%p, 0x%04x): stub\n", dc, hrgn);
|
||||
|
||||
FIXME("(%x, 0x%04x): stub\n", physDev->hdc, hrgn);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_Pie
|
||||
*/
|
||||
BOOL TTYDRV_DC_Pie(DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
BOOL TTYDRV_DC_Pie(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
||||
dc, left, top, right, bottom, xstart, ystart, xend, yend);
|
||||
|
||||
FIXME("(%x, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
||||
physDev->hdc, left, top, right, bottom, xstart, ystart, xend, yend);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_Polygon
|
||||
*/
|
||||
BOOL TTYDRV_DC_Polygon(DC *dc, const POINT* pt, INT count)
|
||||
BOOL TTYDRV_DC_Polygon(TTYDRV_PDEVICE *physDev, const POINT* pt, INT count)
|
||||
{
|
||||
FIXME("(%p, %p, %d): stub\n", dc, pt, count);
|
||||
|
||||
FIXME("(%x, %p, %d): stub\n", physDev->hdc, pt, count);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_Polyline
|
||||
*/
|
||||
BOOL TTYDRV_DC_Polyline(DC *dc, const POINT* pt, INT count)
|
||||
BOOL TTYDRV_DC_Polyline(TTYDRV_PDEVICE *physDev, const POINT* pt, INT count)
|
||||
{
|
||||
FIXME("(%p, %p, %d): stub\n", dc, pt, count);
|
||||
|
||||
FIXME("(%x, %p, %d): stub\n", physDev->hdc, pt, count);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_PolyPolygon
|
||||
*/
|
||||
BOOL TTYDRV_DC_PolyPolygon(DC *dc, const POINT* pt, const INT* counts, UINT polygons)
|
||||
BOOL TTYDRV_DC_PolyPolygon(TTYDRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons)
|
||||
{
|
||||
FIXME("(%p, %p, %p, %u): stub\n", dc, pt, counts, polygons);
|
||||
|
||||
FIXME("(%x, %p, %p, %u): stub\n", physDev->hdc, pt, counts, polygons);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_PolyPolyline
|
||||
*/
|
||||
BOOL TTYDRV_DC_PolyPolyline(DC *dc, const POINT* pt, const DWORD* counts, DWORD polylines)
|
||||
BOOL TTYDRV_DC_PolyPolyline(TTYDRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines)
|
||||
{
|
||||
FIXME("(%p, %p, %p, %lu): stub\n", dc, pt, counts, polylines);
|
||||
FIXME("(%x, %p, %p, %lu): stub\n", physDev->hdc, pt, counts, polylines);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -197,13 +186,13 @@ BOOL TTYDRV_DC_PolyPolyline(DC *dc, const POINT* pt, const DWORD* counts, DWORD
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_Rectangle
|
||||
*/
|
||||
BOOL TTYDRV_DC_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
BOOL TTYDRV_DC_Rectangle(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
#ifdef WINE_CURSES
|
||||
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||
INT row1, col1, row2, col2;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("(%p, %d, %d, %d, %d)\n", dc, left, top, right, bottom);
|
||||
TRACE("(%x, %d, %d, %d, %d)\n", physDev->hdc, left, top, right, bottom);
|
||||
|
||||
if(!physDev->window)
|
||||
return FALSE;
|
||||
|
@ -245,7 +234,7 @@ BOOL TTYDRV_DC_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
|
||||
return TRUE;
|
||||
#else /* defined(WINE_CURSES) */
|
||||
FIXME("(%p, %d, %d, %d, %d): stub\n", dc, left, top, right, bottom);
|
||||
FIXME("(%x, %d, %d, %d, %d): stub\n", physDev->hdc, left, top, right, bottom);
|
||||
|
||||
return TRUE;
|
||||
#endif /* defined(WINE_CURSES) */
|
||||
|
@ -254,40 +243,25 @@ BOOL TTYDRV_DC_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_RoundRect
|
||||
*/
|
||||
BOOL TTYDRV_DC_RoundRect(DC *dc, INT left, INT top, INT right,
|
||||
BOOL TTYDRV_DC_RoundRect(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT ell_width, INT ell_height)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %d, %d, %d, %d): stub\n",
|
||||
dc, left, top, right, bottom, ell_width, ell_height);
|
||||
FIXME("(%x, %d, %d, %d, %d, %d, %d): stub\n",
|
||||
physDev->hdc, left, top, right, bottom, ell_width, ell_height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_SetBkColor
|
||||
*/
|
||||
COLORREF TTYDRV_DC_SetBkColor(DC *dc, COLORREF color)
|
||||
{
|
||||
COLORREF oldColor;
|
||||
|
||||
TRACE("(%p, 0x%08lx)\n", dc, color);
|
||||
|
||||
oldColor = dc->backgroundColor;
|
||||
dc->backgroundColor = color;
|
||||
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_SetPixel
|
||||
*/
|
||||
COLORREF TTYDRV_DC_SetPixel(DC *dc, INT x, INT y, COLORREF color)
|
||||
COLORREF TTYDRV_DC_SetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y, COLORREF color)
|
||||
{
|
||||
#ifdef WINE_CURSES
|
||||
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||
INT row, col;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("(%p, %d, %d, 0x%08lx)\n", dc, x, y, color);
|
||||
TRACE("(%x, %d, %d, 0x%08lx)\n", physDev->hdc, x, y, color);
|
||||
|
||||
if(!physDev->window)
|
||||
return FALSE;
|
||||
|
@ -300,69 +274,45 @@ COLORREF TTYDRV_DC_SetPixel(DC *dc, INT x, INT y, COLORREF color)
|
|||
|
||||
return RGB(0,0,0); /* FIXME: Always returns black */
|
||||
#else /* defined(WINE_CURSES) */
|
||||
FIXME("(%p, %d, %d, 0x%08lx): stub\n", dc, x, y, color);
|
||||
FIXME("(%x, %d, %d, 0x%08lx): stub\n", physDev->hdc, x, y, color);
|
||||
|
||||
return RGB(0,0,0); /* FIXME: Always returns black */
|
||||
#endif /* defined(WINE_CURSES) */
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_SetTextColor
|
||||
*/
|
||||
COLORREF TTYDRV_DC_SetTextColor(DC *dc, COLORREF color)
|
||||
{
|
||||
COLORREF oldColor;
|
||||
|
||||
TRACE("(%p, 0x%08lx)\n", dc, color);
|
||||
|
||||
oldColor = dc->textColor;
|
||||
dc->textColor = color;
|
||||
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_BitBlt
|
||||
*/
|
||||
BOOL TTYDRV_DC_BitBlt(DC *dcDst, INT xDst, INT yDst,
|
||||
INT width, INT height, DC *dcSrc,
|
||||
BOOL TTYDRV_DC_BitBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
||||
INT width, INT height, TTYDRV_PDEVICE *physDevSrc,
|
||||
INT xSrc, INT ySrc, DWORD rop)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %d, %d, %p, %d, %d, %lu): stub\n",
|
||||
dcDst, xDst, yDst, width, height,
|
||||
dcSrc, xSrc, ySrc, rop
|
||||
);
|
||||
|
||||
FIXME("(%x, %d, %d, %d, %d, %x, %d, %d, %lu): stub\n",
|
||||
physDevDst->hdc, xDst, yDst, width, height, physDevSrc->hdc, xSrc, ySrc, rop );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_PatBlt
|
||||
*/
|
||||
BOOL TTYDRV_DC_PatBlt(DC *dc, INT left, INT top,
|
||||
BOOL TTYDRV_DC_PatBlt(TTYDRV_PDEVICE *physDev, INT left, INT top,
|
||||
INT width, INT height, DWORD rop)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %d, %d, %lu): stub\n",
|
||||
dc, left, top, width, height, rop
|
||||
);
|
||||
|
||||
|
||||
FIXME("(%x, %d, %d, %d, %d, %lu): stub\n", physDev->hdc, left, top, width, height, rop );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_StretchBlt
|
||||
*/
|
||||
BOOL TTYDRV_DC_StretchBlt(DC *dcDst, INT xDst, INT yDst,
|
||||
BOOL TTYDRV_DC_StretchBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst,
|
||||
DC *dcSrc, INT xSrc, INT ySrc,
|
||||
TTYDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, DWORD rop)
|
||||
{
|
||||
FIXME("(%p, %d, %d, %d, %d, %p, %d, %d, %d, %d, %lu): stub\n",
|
||||
dcDst, xDst, yDst, widthDst, heightDst,
|
||||
dcSrc, xSrc, ySrc, widthSrc, heightSrc, rop
|
||||
);
|
||||
FIXME("(%x, %d, %d, %d, %d, %x, %d, %d, %d, %d, %lu): stub\n",
|
||||
physDevDst->hdc, xDst, yDst, widthDst, heightDst,
|
||||
physDevSrc->hdc, xSrc, ySrc, widthSrc, heightSrc, rop );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -370,18 +320,18 @@ BOOL TTYDRV_DC_StretchBlt(DC *dcDst, INT xDst, INT yDst,
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_ExtTextOut
|
||||
*/
|
||||
BOOL TTYDRV_DC_ExtTextOut(DC *dc, INT x, INT y, UINT flags,
|
||||
BOOL TTYDRV_DC_ExtTextOut(TTYDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
const RECT *lpRect, LPCWSTR str, UINT count,
|
||||
const INT *lpDx)
|
||||
{
|
||||
#ifdef WINE_CURSES
|
||||
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||
INT row, col;
|
||||
LPSTR ascii;
|
||||
DWORD len;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("(%p, %d, %d, 0x%08x, %p, %s, %d, %p)\n",
|
||||
dc, x, y, flags, lpRect, debugstr_wn(str, count), count, lpDx);
|
||||
TRACE("(%x, %d, %d, 0x%08x, %p, %s, %d, %p)\n",
|
||||
physDev->hdc, x, y, flags, lpRect, debugstr_wn(str, count), count, lpDx);
|
||||
|
||||
if(!physDev->window)
|
||||
return FALSE;
|
||||
|
@ -411,8 +361,8 @@ BOOL TTYDRV_DC_ExtTextOut(DC *dc, INT x, INT y, UINT flags,
|
|||
|
||||
return TRUE;
|
||||
#else /* defined(WINE_CURSES) */
|
||||
FIXME("(%p, %d, %d, 0x%08x, %p, %s, %d, %p): stub\n",
|
||||
dc, x, y, flags, lpRect, debugstr_wn(str,count), count, lpDx);
|
||||
FIXME("(%x, %d, %d, 0x%08x, %p, %s, %d, %p): stub\n",
|
||||
physDev->hdc, x, y, flags, lpRect, debugstr_wn(str,count), count, lpDx);
|
||||
|
||||
return TRUE;
|
||||
#endif /* defined(WINE_CURSES) */
|
||||
|
@ -421,13 +371,12 @@ BOOL TTYDRV_DC_ExtTextOut(DC *dc, INT x, INT y, UINT flags,
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_GetCharWidth
|
||||
*/
|
||||
BOOL TTYDRV_DC_GetCharWidth(DC *dc, UINT firstChar, UINT lastChar,
|
||||
BOOL TTYDRV_DC_GetCharWidth(TTYDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar,
|
||||
LPINT buffer)
|
||||
{
|
||||
UINT c;
|
||||
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||
|
||||
FIXME("(%p, %u, %u, %p): semistub\n", dc, firstChar, lastChar, buffer);
|
||||
FIXME("(%x, %u, %u, %p): semistub\n", physDev->hdc, firstChar, lastChar, buffer);
|
||||
|
||||
for(c=firstChar; c<=lastChar; c++) {
|
||||
buffer[c-firstChar] = physDev->cellWidth;
|
||||
|
@ -439,12 +388,10 @@ BOOL TTYDRV_DC_GetCharWidth(DC *dc, UINT firstChar, UINT lastChar,
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_GetTextExtentPoint
|
||||
*/
|
||||
BOOL TTYDRV_DC_GetTextExtentPoint(DC *dc, LPCWSTR str, INT count,
|
||||
BOOL TTYDRV_DC_GetTextExtentPoint(TTYDRV_PDEVICE *physDev, LPCWSTR str, INT count,
|
||||
LPSIZE size)
|
||||
{
|
||||
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||
|
||||
TRACE("(%p, %s, %d, %p)\n", dc, debugstr_wn(str, count), count, size);
|
||||
TRACE("(%x, %s, %d, %p)\n", physDev->hdc, debugstr_wn(str, count), count, size);
|
||||
|
||||
size->cx = count * physDev->cellWidth;
|
||||
size->cy = physDev->cellHeight;
|
||||
|
@ -455,11 +402,9 @@ BOOL TTYDRV_DC_GetTextExtentPoint(DC *dc, LPCWSTR str, INT count,
|
|||
/***********************************************************************
|
||||
* TTYDRV_DC_GetTextMetrics
|
||||
*/
|
||||
BOOL TTYDRV_DC_GetTextMetrics(DC *dc, LPTEXTMETRICW lptm)
|
||||
BOOL TTYDRV_DC_GetTextMetrics(TTYDRV_PDEVICE *physDev, LPTEXTMETRICW lptm)
|
||||
{
|
||||
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||
|
||||
TRACE("(%p, %p)\n", dc, lptm);
|
||||
TRACE("(%x, %p)\n", physDev->hdc, lptm);
|
||||
|
||||
lptm->tmHeight = physDev->cellHeight;
|
||||
lptm->tmAscent = 0;
|
||||
|
|
|
@ -29,88 +29,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
|
|||
|
||||
/**********************************************************************/
|
||||
|
||||
extern HBITMAP TTYDRV_DC_BITMAP_SelectObject(DC *dc, HBITMAP hbitmap, BITMAPOBJ *bitmap);
|
||||
extern BOOL TTYDRV_DC_BITMAP_DeleteObject(HBITMAP hbitmap, BITMAPOBJ *bitmap);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_BRUSH_SelectObject
|
||||
* TTYDRV_SelectFont (TTYDRV.@)
|
||||
*/
|
||||
static HBRUSH TTYDRV_DC_BRUSH_SelectObject(DC *dc, HBRUSH hbrush)
|
||||
HFONT TTYDRV_SelectFont(TTYDRV_PDEVICE *physDev, HFONT hfont)
|
||||
{
|
||||
HBRUSH hPreviousBrush;
|
||||
|
||||
TRACE("(%p, 0x%04x)\n", dc, hbrush);
|
||||
|
||||
hPreviousBrush = dc->hBrush;
|
||||
dc->hBrush = hbrush;
|
||||
|
||||
return hPreviousBrush;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_FONT_SelectObject
|
||||
*/
|
||||
static HFONT TTYDRV_DC_FONT_SelectObject(DC* dc, HFONT hfont)
|
||||
{
|
||||
TRACE("(%p, 0x%04x)\n", dc, hfont);
|
||||
TRACE("(%x, 0x%04x)\n", physDev->hdc, hfont);
|
||||
|
||||
return TRUE; /* Use device font */
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_PEN_SelectObject
|
||||
*/
|
||||
static HPEN TTYDRV_DC_PEN_SelectObject(DC *dc, HBRUSH hpen)
|
||||
{
|
||||
HPEN hPreviousPen;
|
||||
|
||||
TRACE("(%p, 0x%04x)\n", dc, hpen);
|
||||
|
||||
hPreviousPen = dc->hPen;
|
||||
dc->hPen = hpen;
|
||||
|
||||
return hPreviousPen;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_SelectObject
|
||||
*/
|
||||
HGDIOBJ TTYDRV_DC_SelectObject(DC *dc, HGDIOBJ handle)
|
||||
{
|
||||
GDIOBJHDR *ptr = GDI_GetObjPtr(handle, MAGIC_DONTCARE);
|
||||
HGDIOBJ result = 0;
|
||||
|
||||
if(!ptr) return 0;
|
||||
|
||||
switch(GDIMAGIC(ptr->wMagic))
|
||||
{
|
||||
case BITMAP_MAGIC:
|
||||
result = TTYDRV_DC_BITMAP_SelectObject(dc, handle, (BITMAPOBJ *) ptr);
|
||||
break;
|
||||
case BRUSH_MAGIC:
|
||||
result = TTYDRV_DC_BRUSH_SelectObject(dc, handle);
|
||||
break;
|
||||
case FONT_MAGIC:
|
||||
result = TTYDRV_DC_FONT_SelectObject(dc, handle);
|
||||
break;
|
||||
case PEN_MAGIC:
|
||||
result = TTYDRV_DC_PEN_SelectObject(dc, handle);
|
||||
break;
|
||||
case REGION_MAGIC:
|
||||
/* FIXME: Shouldn't be handled here */
|
||||
result = (HGDIOBJ) SelectClipRgn(dc->hSelf, handle);
|
||||
break;
|
||||
default:
|
||||
ERR("handle (0x%04x) has unknown magic (0x%04x)\n",
|
||||
handle, GDIMAGIC(ptr->wMagic));
|
||||
}
|
||||
|
||||
GDI_ReleaseObj(handle);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_DC_DeleteObject
|
||||
*/
|
||||
|
@ -133,8 +64,7 @@ BOOL TTYDRV_DC_DeleteObject(HGDIOBJ handle)
|
|||
result = TRUE;
|
||||
break;
|
||||
default:
|
||||
ERR("handle (0x%04x) has unknown magic (0x%04x)\n",
|
||||
handle, GDIMAGIC(ptr->wMagic));
|
||||
ERR("handle (0x%04x) has unknown magic (0x%04x)\n", handle, GDIMAGIC(ptr->wMagic));
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
|
||||
struct tagBITMAPOBJ;
|
||||
struct tagCLASS;
|
||||
struct tagDC;
|
||||
struct tagDESKTOP;
|
||||
struct tagPALETTEOBJ;
|
||||
struct tagWND;
|
||||
|
@ -56,24 +55,9 @@ struct tagWINDOWPOS;
|
|||
* TTY GDI driver
|
||||
*/
|
||||
|
||||
extern BOOL TTYDRV_GDI_Initialize(void);
|
||||
|
||||
/* TTY GDI bitmap driver */
|
||||
|
||||
extern HBITMAP TTYDRV_BITMAP_CreateDIBSection(struct tagDC *dc, BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset);
|
||||
extern INT TTYDRV_BITMAP_SetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap);
|
||||
extern INT TTYDRV_BITMAP_GetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan, UINT lines, LPVOID bits, BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap);
|
||||
extern void TTYDRV_BITMAP_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
|
||||
extern UINT TTYDRV_BITMAP_SetDIBColorTable(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,const RGBQUAD *);
|
||||
extern UINT TTYDRV_BITMAP_GetDIBColorTable(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,RGBQUAD *);
|
||||
extern INT TTYDRV_BITMAP_Lock(struct tagBITMAPOBJ *,INT,BOOL);
|
||||
extern void TTYDRV_BITMAP_Unlock(struct tagBITMAPOBJ *,BOOL);
|
||||
|
||||
#ifndef WINE_CURSES
|
||||
typedef struct { int dummy; } WINDOW;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
HDC hdc;
|
||||
DC *dc;
|
||||
WINDOW *window;
|
||||
int cellWidth;
|
||||
int cellHeight;
|
||||
|
@ -83,42 +67,50 @@ typedef struct {
|
|||
int dummy; /* FIXME: Remove later */
|
||||
} TTYDRV_PHYSBITMAP;
|
||||
|
||||
extern BOOL TTYDRV_GDI_Initialize(void);
|
||||
|
||||
/* TTY GDI bitmap driver */
|
||||
|
||||
extern HBITMAP TTYDRV_BITMAP_CreateDIBSection(TTYDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset);
|
||||
extern void TTYDRV_BITMAP_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
|
||||
|
||||
#ifndef WINE_CURSES
|
||||
typedef struct { int dummy; } WINDOW;
|
||||
#endif
|
||||
|
||||
extern BOOL TTYDRV_DC_CreateBitmap(HBITMAP hbitmap);
|
||||
|
||||
extern BOOL TTYDRV_DC_Arc(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
|
||||
extern BOOL TTYDRV_DC_Arc(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
|
||||
extern LONG TTYDRV_DC_BitmapBits(HBITMAP hbitmap, void *bits, LONG count, WORD flags);
|
||||
extern BOOL TTYDRV_DC_CreateBitmap(HBITMAP hbitmap);
|
||||
extern BOOL TTYDRV_DC_CreateDC(struct tagDC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODEA *initData);
|
||||
extern BOOL TTYDRV_DC_DeleteDC(struct tagDC *dc);
|
||||
extern BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODEA *initData);
|
||||
extern BOOL TTYDRV_DC_DeleteDC(TTYDRV_PDEVICE *physDev);
|
||||
extern BOOL TTYDRV_DC_DeleteObject(HGDIOBJ handle);
|
||||
extern BOOL TTYDRV_DC_BitBlt(struct tagDC *dcDst, INT xDst, INT yDst, INT width, INT height, struct tagDC *dcSrc, INT xSrc, INT ySrc, DWORD rop);
|
||||
extern BOOL TTYDRV_DC_Chord(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
|
||||
extern BOOL TTYDRV_DC_Ellipse(struct tagDC *dc, INT left, INT top, INT right, INT bottom);
|
||||
extern INT TTYDRV_DC_Escape(struct tagDC *dc, INT nEscape, INT cbInput, SEGPTR lpInData, SEGPTR lpOutData);
|
||||
extern BOOL TTYDRV_DC_ExtFloodFill(struct tagDC *dc, INT x, INT y, COLORREF color, UINT fillType);
|
||||
extern BOOL TTYDRV_DC_ExtTextOut(struct tagDC *dc, INT x, INT y, UINT flags, const RECT *lpRect, LPCWSTR str, UINT count, const INT *lpDx);
|
||||
extern BOOL TTYDRV_DC_GetCharWidth(struct tagDC *dc, UINT firstChar, UINT lastChar, LPINT buffer);
|
||||
extern COLORREF TTYDRV_DC_GetPixel(struct tagDC *dc, INT x, INT y);
|
||||
extern BOOL TTYDRV_DC_BitBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT width, INT height, TTYDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, DWORD rop);
|
||||
extern BOOL TTYDRV_DC_Chord(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
|
||||
extern BOOL TTYDRV_DC_Ellipse(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom);
|
||||
extern INT TTYDRV_DC_Escape(TTYDRV_PDEVICE *physDev, INT nEscape, INT cbInput, SEGPTR lpInData, SEGPTR lpOutData);
|
||||
extern BOOL TTYDRV_DC_ExtFloodFill(TTYDRV_PDEVICE *physDev, INT x, INT y, COLORREF color, UINT fillType);
|
||||
extern BOOL TTYDRV_DC_ExtTextOut(TTYDRV_PDEVICE *physDev, INT x, INT y, UINT flags, const RECT *lpRect, LPCWSTR str, UINT count, const INT *lpDx);
|
||||
extern BOOL TTYDRV_DC_GetCharWidth(TTYDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, LPINT buffer);
|
||||
extern COLORREF TTYDRV_DC_GetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y);
|
||||
|
||||
extern BOOL TTYDRV_DC_GetTextExtentPoint(struct tagDC *dc, LPCWSTR str, INT count, LPSIZE size);
|
||||
extern BOOL TTYDRV_DC_GetTextMetrics(struct tagDC *dc, TEXTMETRICW *metrics);
|
||||
extern BOOL TTYDRV_DC_LineTo(struct tagDC *dc, INT x, INT y);
|
||||
extern BOOL TTYDRV_DC_PaintRgn(struct tagDC *dc, HRGN hrgn);
|
||||
extern BOOL TTYDRV_DC_PatBlt(struct tagDC *dc, INT left, INT top, INT width, INT height, DWORD rop);
|
||||
extern BOOL TTYDRV_DC_Pie(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
|
||||
extern BOOL TTYDRV_DC_Polygon(struct tagDC *dc, const POINT* pt, INT count);
|
||||
extern BOOL TTYDRV_DC_Polyline(struct tagDC *dc, const POINT* pt, INT count);
|
||||
extern BOOL TTYDRV_DC_PolyPolygon(struct tagDC *dc, const POINT* pt, const INT* counts, UINT polygons);
|
||||
extern BOOL TTYDRV_DC_PolyPolyline(struct tagDC *dc, const POINT* pt, const DWORD* counts, DWORD polylines);
|
||||
extern BOOL TTYDRV_DC_Rectangle(struct tagDC *dc, INT left, INT top, INT right, INT bottom);
|
||||
extern BOOL TTYDRV_DC_RoundRect(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height);
|
||||
extern void TTYDRV_DC_SetDeviceClipping(struct tagDC *dc);
|
||||
extern HGDIOBJ TTYDRV_DC_SelectObject(struct tagDC *dc, HGDIOBJ handle);
|
||||
extern COLORREF TTYDRV_DC_SetBkColor(struct tagDC *dc, COLORREF color);
|
||||
extern COLORREF TTYDRV_DC_SetPixel(struct tagDC *dc, INT x, INT y, COLORREF color);
|
||||
extern COLORREF TTYDRV_DC_SetTextColor(struct tagDC *dc, COLORREF color);
|
||||
extern BOOL TTYDRV_DC_StretchBlt(struct tagDC *dcDst, INT xDst, INT yDst, INT widthDst, INT heightDst, struct tagDC *dcSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop);
|
||||
INT TTYDRV_DC_SetDIBitsToDevice(struct tagDC *dc, INT xDest, INT yDest, DWORD cx, DWORD cy, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse);
|
||||
extern BOOL TTYDRV_DC_GetTextExtentPoint(TTYDRV_PDEVICE *physDev, LPCWSTR str, INT count, LPSIZE size);
|
||||
extern BOOL TTYDRV_DC_GetTextMetrics(TTYDRV_PDEVICE *physDev, TEXTMETRICW *metrics);
|
||||
extern BOOL TTYDRV_DC_LineTo(TTYDRV_PDEVICE *physDev, INT x, INT y);
|
||||
extern BOOL TTYDRV_DC_PaintRgn(TTYDRV_PDEVICE *physDev, HRGN hrgn);
|
||||
extern BOOL TTYDRV_DC_PatBlt(TTYDRV_PDEVICE *physDev, INT left, INT top, INT width, INT height, DWORD rop);
|
||||
extern BOOL TTYDRV_DC_Pie(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
|
||||
extern BOOL TTYDRV_DC_Polygon(TTYDRV_PDEVICE *physDev, const POINT* pt, INT count);
|
||||
extern BOOL TTYDRV_DC_Polyline(TTYDRV_PDEVICE *physDev, const POINT* pt, INT count);
|
||||
extern BOOL TTYDRV_DC_PolyPolygon(TTYDRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons);
|
||||
extern BOOL TTYDRV_DC_PolyPolyline(TTYDRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines);
|
||||
extern BOOL TTYDRV_DC_Rectangle(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom);
|
||||
extern BOOL TTYDRV_DC_RoundRect(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height);
|
||||
extern void TTYDRV_DC_SetDeviceClipping(TTYDRV_PDEVICE *physDev);
|
||||
extern COLORREF TTYDRV_DC_SetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y, COLORREF color);
|
||||
extern BOOL TTYDRV_DC_StretchBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT widthDst, INT heightDst, TTYDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop);
|
||||
INT TTYDRV_DC_SetDIBitsToDevice(TTYDRV_PDEVICE *physDev, INT xDest, INT yDest, DWORD cx, DWORD cy, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse);
|
||||
|
||||
/* TTY GDI palette driver */
|
||||
|
||||
|
|
|
@ -37,12 +37,11 @@ debug_channels (ttydrv)
|
|||
@ cdecl Polyline(ptr ptr long) TTYDRV_DC_Polyline
|
||||
@ cdecl Rectangle(ptr long long long long) TTYDRV_DC_Rectangle
|
||||
@ cdecl RoundRect(ptr long long long long long long) TTYDRV_DC_RoundRect
|
||||
@ cdecl SelectObject(ptr long) TTYDRV_DC_SelectObject
|
||||
@ cdecl SetBkColor(ptr long) TTYDRV_DC_SetBkColor
|
||||
@ cdecl SetDeviceClipping(ptr) TTYDRV_DC_SetDeviceClipping
|
||||
@ cdecl SelectBitmap(ptr long) TTYDRV_SelectBitmap
|
||||
@ cdecl SelectFont(ptr long) TTYDRV_SelectFont
|
||||
@ cdecl SetDIBitsToDevice(ptr long long long long long long long long ptr ptr long) TTYDRV_DC_SetDIBitsToDevice
|
||||
@ cdecl SetDeviceClipping(ptr) TTYDRV_DC_SetDeviceClipping
|
||||
@ cdecl SetPixel(ptr long long long) TTYDRV_DC_SetPixel
|
||||
@ cdecl SetTextColor(ptr long) TTYDRV_DC_SetTextColor
|
||||
@ cdecl StretchBlt(ptr long long long long ptr long long long long long) TTYDRV_DC_StretchBlt
|
||||
|
||||
# USER driver
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "config.h"
|
||||
|
||||
#include "dinput.h"
|
||||
#include "gdi.h"
|
||||
#include "ttydrv.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
|
|
@ -30,16 +30,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
*
|
||||
* PSDRV_PatBlt
|
||||
*/
|
||||
BOOL PSDRV_PatBlt(DC *dc, INT x, INT y, INT width, INT height, DWORD dwRop)
|
||||
BOOL PSDRV_PatBlt(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, DWORD dwRop)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
switch(dwRop) {
|
||||
case PATCOPY:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteRectangle(dc, XLPTODP(dc, x), YLPTODP(dc, y),
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteRectangle(physDev, XLPTODP(dc, x), YLPTODP(dc, y),
|
||||
XLSTODS(dc, width), YLSTODS(dc, height));
|
||||
PSDRV_Brush(dc, FALSE);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_Brush(physDev, FALSE);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
return TRUE;
|
||||
|
||||
case BLACKNESS:
|
||||
|
@ -47,14 +48,14 @@ BOOL PSDRV_PatBlt(DC *dc, INT x, INT y, INT width, INT height, DWORD dwRop)
|
|||
{
|
||||
PSCOLOR pscol;
|
||||
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteRectangle(dc, XLPTODP(dc, x), YLPTODP(dc, y),
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteRectangle(physDev, XLPTODP(dc, x), YLPTODP(dc, y),
|
||||
XLSTODS(dc, width), YLSTODS(dc, height));
|
||||
PSDRV_CreateColor( physDev, &pscol, (dwRop == BLACKNESS) ?
|
||||
RGB(0,0,0) : RGB(0xff,0xff,0xff) );
|
||||
PSDRV_WriteSetColor(dc, &pscol);
|
||||
PSDRV_WriteFill(dc);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteSetColor(physDev, &pscol);
|
||||
PSDRV_WriteFill(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
return TRUE;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -19,13 +19,65 @@
|
|||
*/
|
||||
|
||||
#include "psdrv.h"
|
||||
#include "wine/debug.h"
|
||||
#include "bitmap.h"
|
||||
#include "winbase.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
||||
|
||||
|
||||
/* Return the width of a DIB bitmap in bytes. DIB bitmap data is 32-bit aligned. */
|
||||
inline static int get_dib_width_bytes( int width, int depth )
|
||||
{
|
||||
int words;
|
||||
|
||||
switch(depth)
|
||||
{
|
||||
case 1: words = (width + 31) / 32; break;
|
||||
case 4: words = (width + 7) / 8; break;
|
||||
case 8: words = (width + 3) / 4; break;
|
||||
case 15:
|
||||
case 16: words = (width + 1) / 2; break;
|
||||
case 24: words = (width * 3 + 3)/4; break;
|
||||
default:
|
||||
WARN("(%d): Unsupported depth\n", depth );
|
||||
/* fall through */
|
||||
case 32: words = width; break;
|
||||
}
|
||||
return 4 * words;
|
||||
}
|
||||
|
||||
/* get the bitmap info from either an INFOHEADER or COREHEADER bitmap */
|
||||
static BOOL get_bitmap_info( const void *ptr, LONG *width, LONG *height, WORD *bpp, WORD *compr )
|
||||
{
|
||||
const BITMAPINFOHEADER *header = ptr;
|
||||
|
||||
switch(header->biSize)
|
||||
{
|
||||
case sizeof(BITMAPCOREHEADER):
|
||||
{
|
||||
const BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)header;
|
||||
*width = core->bcWidth;
|
||||
*height = core->bcHeight;
|
||||
*bpp = core->bcBitCount;
|
||||
*compr = 0;
|
||||
}
|
||||
return TRUE;
|
||||
case sizeof(BITMAPINFOHEADER):
|
||||
case sizeof(BITMAPV4HEADER):
|
||||
case sizeof(BITMAPV5HEADER):
|
||||
/* V4 and V5 structures are a superset of the INFOHEADER structure */
|
||||
*width = header->biWidth;
|
||||
*height = header->biHeight;
|
||||
*bpp = header->biBitCount;
|
||||
*compr = header->biCompression;
|
||||
return TRUE;
|
||||
default:
|
||||
ERR("(%ld): unknown/wrong size for header\n", header->biSize );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* PSDRV_WriteImageHeader
|
||||
*
|
||||
|
@ -35,7 +87,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
* Uses level 2 PostScript
|
||||
*/
|
||||
|
||||
static BOOL PSDRV_WriteImageHeader(DC *dc, const BITMAPINFO *info, INT xDst,
|
||||
static BOOL PSDRV_WriteImageHeader(PSDRV_PDEVICE *physDev, const BITMAPINFO *info, INT xDst,
|
||||
INT yDst, INT widthDst, INT heightDst,
|
||||
INT widthSrc, INT heightSrc)
|
||||
{
|
||||
|
@ -44,36 +96,36 @@ static BOOL PSDRV_WriteImageHeader(DC *dc, const BITMAPINFO *info, INT xDst,
|
|||
|
||||
switch(info->bmiHeader.biBitCount) {
|
||||
case 8:
|
||||
PSDRV_WriteIndexColorSpaceBegin(dc, 255);
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 255);
|
||||
for(i = 0; i < 256; i++) {
|
||||
map[i] = info->bmiColors[i].rgbRed |
|
||||
info->bmiColors[i].rgbGreen << 8 |
|
||||
info->bmiColors[i].rgbBlue << 16;
|
||||
}
|
||||
PSDRV_WriteRGB(dc, map, 256);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dc);
|
||||
PSDRV_WriteRGB(physDev, map, 256);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
PSDRV_WriteIndexColorSpaceBegin(dc, 15);
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 15);
|
||||
for(i = 0; i < 16; i++) {
|
||||
map[i] = info->bmiColors[i].rgbRed |
|
||||
info->bmiColors[i].rgbGreen << 8 |
|
||||
info->bmiColors[i].rgbBlue << 16;
|
||||
}
|
||||
PSDRV_WriteRGB(dc, map, 16);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dc);
|
||||
PSDRV_WriteRGB(physDev, map, 16);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
PSDRV_WriteIndexColorSpaceBegin(dc, 1);
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 1);
|
||||
for(i = 0; i < 2; i++) {
|
||||
map[i] = info->bmiColors[i].rgbRed |
|
||||
info->bmiColors[i].rgbGreen << 8 |
|
||||
info->bmiColors[i].rgbBlue << 16;
|
||||
}
|
||||
PSDRV_WriteRGB(dc, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dc);
|
||||
PSDRV_WriteRGB(physDev, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
|
@ -84,7 +136,7 @@ static BOOL PSDRV_WriteImageHeader(DC *dc, const BITMAPINFO *info, INT xDst,
|
|||
PSCOLOR pscol;
|
||||
pscol.type = PSCOLOR_RGB;
|
||||
pscol.value.rgb.r = pscol.value.rgb.g = pscol.value.rgb.b = 0.0;
|
||||
PSDRV_WriteSetColor(dc, &pscol);
|
||||
PSDRV_WriteSetColor(physDev, &pscol);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -94,7 +146,7 @@ static BOOL PSDRV_WriteImageHeader(DC *dc, const BITMAPINFO *info, INT xDst,
|
|||
break;
|
||||
}
|
||||
|
||||
PSDRV_WriteImageDict(dc, info->bmiHeader.biBitCount, xDst, yDst,
|
||||
PSDRV_WriteImageDict(physDev, info->bmiHeader.biBitCount, xDst, yDst,
|
||||
widthDst, heightDst, widthSrc, heightSrc, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -109,26 +161,26 @@ static BOOL PSDRV_WriteImageHeader(DC *dc, const BITMAPINFO *info, INT xDst,
|
|||
* bit depths.
|
||||
* Compression not implemented.
|
||||
*/
|
||||
INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
|
||||
INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT widthDst,
|
||||
INT heightDst, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, const void *bits,
|
||||
const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
|
||||
{
|
||||
DWORD fullSrcWidth;
|
||||
INT widthbytes, fullSrcHeight;
|
||||
LONG fullSrcWidth, fullSrcHeight;
|
||||
INT widthbytes;
|
||||
WORD bpp, compression;
|
||||
const char *ptr;
|
||||
INT line;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("%08x (%d,%d %dx%d) -> (%d,%d %dx%d)\n", dc->hSelf,
|
||||
TRACE("%08x (%d,%d %dx%d) -> (%d,%d %dx%d)\n", physDev->hdc,
|
||||
xSrc, ySrc, widthSrc, heightSrc, xDst, yDst, widthDst, heightDst);
|
||||
|
||||
DIB_GetBitmapInfo((const BITMAPINFOHEADER *)info, &fullSrcWidth,
|
||||
&fullSrcHeight, &bpp, &compression);
|
||||
if (!get_bitmap_info( info, &fullSrcWidth, &fullSrcHeight, &bpp, &compression )) return FALSE;
|
||||
|
||||
widthbytes = DIB_GetDIBWidthBytes(fullSrcWidth, bpp);
|
||||
widthbytes = get_dib_width_bytes(fullSrcWidth, bpp);
|
||||
|
||||
TRACE("full size=%ldx%d bpp=%d compression=%d\n", fullSrcWidth,
|
||||
TRACE("full size=%ldx%ld bpp=%d compression=%d\n", fullSrcWidth,
|
||||
fullSrcHeight, bpp, compression);
|
||||
|
||||
|
||||
|
@ -145,71 +197,71 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
|
|||
switch(bpp) {
|
||||
|
||||
case 1:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteImageHeader(dc, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
ptr = bits;
|
||||
ptr += (ySrc * widthbytes);
|
||||
if(xSrc & 7)
|
||||
FIXME("This won't work...\n");
|
||||
for(line = 0; line < heightSrc; line++, ptr += widthbytes)
|
||||
PSDRV_WriteBytes(dc, ptr + xSrc/8, (widthSrc+7)/8);
|
||||
PSDRV_WriteBytes(physDev, ptr + xSrc/8, (widthSrc+7)/8);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteImageHeader(dc, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
ptr = bits;
|
||||
ptr += (ySrc * widthbytes);
|
||||
if(xSrc & 1)
|
||||
FIXME("This won't work...\n");
|
||||
for(line = 0; line < heightSrc; line++, ptr += widthbytes)
|
||||
PSDRV_WriteBytes(dc, ptr + xSrc/2, (widthSrc+1)/2);
|
||||
PSDRV_WriteBytes(physDev, ptr + xSrc/2, (widthSrc+1)/2);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteImageHeader(dc, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
ptr = bits;
|
||||
ptr += (ySrc * widthbytes);
|
||||
for(line = 0; line < heightSrc; line++, ptr += widthbytes)
|
||||
PSDRV_WriteBytes(dc, ptr + xSrc, widthSrc);
|
||||
PSDRV_WriteBytes(physDev, ptr + xSrc, widthSrc);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
case 16:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteImageHeader(dc, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
|
||||
ptr = bits;
|
||||
ptr += (ySrc * widthbytes);
|
||||
for(line = 0; line < heightSrc; line++, ptr += widthbytes)
|
||||
PSDRV_WriteDIBits16(dc, (WORD *)ptr + xSrc, widthSrc);
|
||||
PSDRV_WriteDIBits16(physDev, (WORD *)ptr + xSrc, widthSrc);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteImageHeader(dc, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
|
||||
ptr = bits;
|
||||
ptr += (ySrc * widthbytes);
|
||||
for(line = 0; line < heightSrc; line++, ptr += widthbytes)
|
||||
PSDRV_WriteDIBits24(dc, ptr + xSrc * 3, widthSrc);
|
||||
PSDRV_WriteDIBits24(physDev, ptr + xSrc * 3, widthSrc);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteImageHeader(dc, info, xDst, yDst, widthDst, heightDst,
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
|
||||
widthSrc, heightSrc);
|
||||
|
||||
ptr = bits;
|
||||
ptr += (ySrc * widthbytes);
|
||||
for(line = 0; line < heightSrc; line++, ptr += widthbytes)
|
||||
PSDRV_WriteDIBits32(dc, ptr + xSrc * 3, widthSrc);
|
||||
PSDRV_WriteDIBits32(physDev, ptr + xSrc * 3, widthSrc);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -217,8 +269,8 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
|
|||
return FALSE;
|
||||
|
||||
}
|
||||
PSDRV_WriteSpool(dc, ">\n", 2); /* End-of-Data for /HexASCIIDecodeFilter */
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteSpool(physDev, ">\n", 2); /* End-of-Data for /HexASCIIDecodeFilter */
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,18 +25,15 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_BRUSH_SelectObject
|
||||
* PSDRV_SelectBrush (WINEPS.@)
|
||||
*/
|
||||
HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
||||
HBRUSH PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush )
|
||||
{
|
||||
LOGBRUSH logbrush;
|
||||
HBRUSH prevbrush = dc->hBrush;
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if (!GetObjectA( hbrush, sizeof(logbrush), &logbrush )) return 0;
|
||||
|
||||
TRACE("hbrush = %08x\n", hbrush);
|
||||
dc->hBrush = hbrush;
|
||||
|
||||
switch(logbrush.lbStyle) {
|
||||
|
||||
|
@ -61,7 +58,7 @@ HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
|||
}
|
||||
|
||||
physDev->brush.set = FALSE;
|
||||
return prevbrush;
|
||||
return hbrush;
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,13 +67,12 @@ HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
|||
* PSDRV_SetBrush
|
||||
*
|
||||
*/
|
||||
static BOOL PSDRV_SetBrush(DC *dc)
|
||||
static BOOL PSDRV_SetBrush(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
LOGBRUSH logbrush;
|
||||
BOOL ret = TRUE;
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if (!GetObjectA( dc->hBrush, sizeof(logbrush), &logbrush ))
|
||||
if (!GetObjectA( GetCurrentObject(physDev->hdc,OBJ_BRUSH), sizeof(logbrush), &logbrush ))
|
||||
{
|
||||
ERR("Can't get BRUSHOBJ\n");
|
||||
return FALSE;
|
||||
|
@ -85,7 +81,7 @@ static BOOL PSDRV_SetBrush(DC *dc)
|
|||
switch (logbrush.lbStyle) {
|
||||
case BS_SOLID:
|
||||
case BS_HATCHED:
|
||||
PSDRV_WriteSetColor(dc, &physDev->brush.color);
|
||||
PSDRV_WriteSetColor(physDev, &physDev->brush.color);
|
||||
break;
|
||||
|
||||
case BS_NULL:
|
||||
|
@ -106,12 +102,12 @@ static BOOL PSDRV_SetBrush(DC *dc)
|
|||
* PSDRV_Fill
|
||||
*
|
||||
*/
|
||||
static BOOL PSDRV_Fill(DC *dc, BOOL EO)
|
||||
static BOOL PSDRV_Fill(PSDRV_PDEVICE *physDev, BOOL EO)
|
||||
{
|
||||
if(!EO)
|
||||
return PSDRV_WriteFill(dc);
|
||||
return PSDRV_WriteFill(physDev);
|
||||
else
|
||||
return PSDRV_WriteEOFill(dc);
|
||||
return PSDRV_WriteEOFill(physDev);
|
||||
}
|
||||
|
||||
|
||||
|
@ -120,12 +116,12 @@ static BOOL PSDRV_Fill(DC *dc, BOOL EO)
|
|||
* PSDRV_Clip
|
||||
*
|
||||
*/
|
||||
static BOOL PSDRV_Clip(DC *dc, BOOL EO)
|
||||
static BOOL PSDRV_Clip(PSDRV_PDEVICE *physDev, BOOL EO)
|
||||
{
|
||||
if(!EO)
|
||||
return PSDRV_WriteClip(dc);
|
||||
return PSDRV_WriteClip(physDev);
|
||||
else
|
||||
return PSDRV_WriteEOClip(dc);
|
||||
return PSDRV_WriteEOClip(physDev);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -133,13 +129,12 @@ static BOOL PSDRV_Clip(DC *dc, BOOL EO)
|
|||
* PSDRV_Brush
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_Brush(DC *dc, BOOL EO)
|
||||
BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO)
|
||||
{
|
||||
LOGBRUSH logbrush;
|
||||
BOOL ret = TRUE;
|
||||
PSDRV_PDEVICE *physDev = dc->physDev;
|
||||
|
||||
if (!GetObjectA( dc->hBrush, sizeof(logbrush), &logbrush ))
|
||||
if (!GetObjectA( GetCurrentObject(physDev->hdc,OBJ_BRUSH), sizeof(logbrush), &logbrush ))
|
||||
{
|
||||
ERR("Can't get BRUSHOBJ\n");
|
||||
return FALSE;
|
||||
|
@ -147,55 +142,55 @@ BOOL PSDRV_Brush(DC *dc, BOOL EO)
|
|||
|
||||
switch (logbrush.lbStyle) {
|
||||
case BS_SOLID:
|
||||
PSDRV_SetBrush(dc);
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_Fill(dc, EO);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_SetBrush(physDev);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Fill(physDev, EO);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
break;
|
||||
|
||||
case BS_HATCHED:
|
||||
PSDRV_SetBrush(dc);
|
||||
PSDRV_SetBrush(physDev);
|
||||
|
||||
switch(logbrush.lbHatch) {
|
||||
case HS_VERTICAL:
|
||||
case HS_CROSS:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_Clip(dc, EO);
|
||||
PSDRV_WriteHatch(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Clip(physDev, EO);
|
||||
PSDRV_WriteHatch(physDev);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
if(logbrush.lbHatch == HS_VERTICAL)
|
||||
break;
|
||||
/* else fallthrough for HS_CROSS */
|
||||
|
||||
case HS_HORIZONTAL:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_Clip(dc, EO);
|
||||
PSDRV_WriteRotate(dc, 90.0);
|
||||
PSDRV_WriteHatch(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Clip(physDev, EO);
|
||||
PSDRV_WriteRotate(physDev, 90.0);
|
||||
PSDRV_WriteHatch(physDev);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
break;
|
||||
|
||||
case HS_FDIAGONAL:
|
||||
case HS_DIAGCROSS:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_Clip(dc, EO);
|
||||
PSDRV_WriteRotate(dc, -45.0);
|
||||
PSDRV_WriteHatch(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Clip(physDev, EO);
|
||||
PSDRV_WriteRotate(physDev, -45.0);
|
||||
PSDRV_WriteHatch(physDev);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
if(logbrush.lbHatch == HS_FDIAGONAL)
|
||||
break;
|
||||
/* else fallthrough for HS_DIAGCROSS */
|
||||
|
||||
case HS_BDIAGONAL:
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_Clip(dc, EO);
|
||||
PSDRV_WriteRotate(dc, 45.0);
|
||||
PSDRV_WriteHatch(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_Clip(physDev, EO);
|
||||
PSDRV_WriteRotate(physDev, 45.0);
|
||||
PSDRV_WriteHatch(physDev);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -219,10 +214,10 @@ BOOL PSDRV_Brush(DC *dc, BOOL EO)
|
|||
GetBitmapBits(logbrush.lbHatch, bm.bmWidthBytes * bm.bmHeight, bits);
|
||||
|
||||
if(physDev->pi->ppd->LanguageLevel > 1) {
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WritePatternDict(dc, &bm, bits);
|
||||
PSDRV_Fill(dc, EO);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WritePatternDict(physDev, &bm, bits);
|
||||
PSDRV_Fill(physDev, EO);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
} else {
|
||||
FIXME("Trying to set a pattern brush on a level 1 printer\n");
|
||||
ret = FALSE;
|
||||
|
|
|
@ -28,13 +28,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
/***********************************************************************
|
||||
* PSDRV_SetDeviceClipping
|
||||
*/
|
||||
VOID PSDRV_SetDeviceClipping( DC *dc )
|
||||
VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
CHAR szArrayName[] = "clippath";
|
||||
DWORD size;
|
||||
RGNDATA *rgndata;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("hdc=%04x\n", dc->hSelf);
|
||||
TRACE("hdc=%04x\n", physDev->hdc);
|
||||
|
||||
if (dc->hGCClipRgn == 0) {
|
||||
ERR("Rgn is 0. Please report this.\n");
|
||||
|
@ -55,20 +56,20 @@ VOID PSDRV_SetDeviceClipping( DC *dc )
|
|||
|
||||
GetRegionData(dc->hGCClipRgn, size, rgndata);
|
||||
|
||||
PSDRV_WriteInitClip(dc);
|
||||
PSDRV_WriteInitClip(physDev);
|
||||
|
||||
/* check for NULL region */
|
||||
if (rgndata->rdh.nCount == 0)
|
||||
{
|
||||
/* set an empty clip path. */
|
||||
PSDRV_WriteRectClip(dc, 0, 0, 0, 0);
|
||||
PSDRV_WriteRectClip(physDev, 0, 0, 0, 0);
|
||||
}
|
||||
/* optimize when it is a simple region */
|
||||
else if (rgndata->rdh.nCount == 1)
|
||||
{
|
||||
RECT *pRect = (RECT *)rgndata->Buffer;
|
||||
|
||||
PSDRV_WriteRectClip(dc, pRect->left, pRect->top,
|
||||
PSDRV_WriteRectClip(physDev, pRect->left, pRect->top,
|
||||
pRect->right - pRect->left,
|
||||
pRect->bottom - pRect->top);
|
||||
}
|
||||
|
@ -77,21 +78,21 @@ VOID PSDRV_SetDeviceClipping( DC *dc )
|
|||
INT i;
|
||||
RECT *pRect = (RECT *)rgndata->Buffer;
|
||||
|
||||
PSDRV_WriteArrayDef(dc, szArrayName, rgndata->rdh.nCount * 4);
|
||||
PSDRV_WriteArrayDef(physDev, szArrayName, rgndata->rdh.nCount * 4);
|
||||
|
||||
for (i = 0; i < rgndata->rdh.nCount; i++, pRect++)
|
||||
{
|
||||
PSDRV_WriteArrayPut(dc, szArrayName, i * 4,
|
||||
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4,
|
||||
pRect->left);
|
||||
PSDRV_WriteArrayPut(dc, szArrayName, i * 4 + 1,
|
||||
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 1,
|
||||
pRect->top);
|
||||
PSDRV_WriteArrayPut(dc, szArrayName, i * 4 + 2,
|
||||
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 2,
|
||||
pRect->right - pRect->left);
|
||||
PSDRV_WriteArrayPut(dc, szArrayName, i * 4 + 3,
|
||||
PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 3,
|
||||
pRect->bottom - pRect->top);
|
||||
}
|
||||
|
||||
PSDRV_WriteRectClip2(dc, szArrayName);
|
||||
PSDRV_WriteRectClip2(physDev, szArrayName);
|
||||
}
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, rgndata );
|
||||
|
|
|
@ -117,33 +117,20 @@ void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
|
|||
/***********************************************************************
|
||||
* PSDRV_SetBkColor
|
||||
*/
|
||||
COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color )
|
||||
COLORREF PSDRV_SetBkColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
COLORREF oldColor;
|
||||
|
||||
oldColor = dc->backgroundColor;
|
||||
dc->backgroundColor = color;
|
||||
|
||||
PSDRV_CreateColor(physDev, &physDev->bkColor, color);
|
||||
|
||||
return oldColor;
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_SetTextColor
|
||||
*/
|
||||
COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color )
|
||||
COLORREF PSDRV_SetTextColor( PSDRV_PDEVICE *physDev, COLORREF color )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
COLORREF oldColor;
|
||||
|
||||
oldColor = dc->textColor;
|
||||
dc->textColor = color;
|
||||
|
||||
PSDRV_CreateColor(physDev, &physDev->font.color, color);
|
||||
physDev->font.set = FALSE;
|
||||
return oldColor;
|
||||
return color;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,11 +30,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
/**********************************************************************
|
||||
* ExtEscape (WINEPS.@)
|
||||
*/
|
||||
INT PSDRV_ExtEscape( DC *dc, INT nEscape, INT cbInput, LPCVOID in_data,
|
||||
INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID in_data,
|
||||
INT cbOutput, LPVOID out_data )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
switch(nEscape)
|
||||
{
|
||||
case QUERYESCSUPPORT:
|
||||
|
@ -84,7 +82,7 @@ INT PSDRV_ExtEscape( DC *dc, INT nEscape, INT cbInput, LPCVOID in_data,
|
|||
r->bottom = 0;
|
||||
TRACE("NEXTBAND rect to 0,0 - 0,0\n" );
|
||||
physDev->job.banding = FALSE;
|
||||
return EndPage( dc->hSelf );
|
||||
return EndPage( physDev->hdc );
|
||||
}
|
||||
|
||||
case SETCOPYCOUNT:
|
||||
|
@ -223,16 +221,14 @@ INT PSDRV_ExtEscape( DC *dc, INT nEscape, INT cbInput, LPCVOID in_data,
|
|||
/************************************************************************
|
||||
* PSDRV_StartPage
|
||||
*/
|
||||
INT PSDRV_StartPage( DC *dc )
|
||||
INT PSDRV_StartPage( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if(!physDev->job.OutOfPage) {
|
||||
FIXME("Already started a page?\n");
|
||||
return 1;
|
||||
}
|
||||
physDev->job.PageNo++;
|
||||
if(!PSDRV_WriteNewPage( dc ))
|
||||
if(!PSDRV_WriteNewPage( physDev ))
|
||||
return 0;
|
||||
physDev->job.OutOfPage = FALSE;
|
||||
return 1;
|
||||
|
@ -242,15 +238,13 @@ INT PSDRV_StartPage( DC *dc )
|
|||
/************************************************************************
|
||||
* PSDRV_EndPage
|
||||
*/
|
||||
INT PSDRV_EndPage( DC *dc )
|
||||
INT PSDRV_EndPage( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if(physDev->job.OutOfPage) {
|
||||
FIXME("Already ended a page?\n");
|
||||
return 1;
|
||||
}
|
||||
if(!PSDRV_WriteEndPage( dc ))
|
||||
if(!PSDRV_WriteEndPage( physDev ))
|
||||
return 0;
|
||||
physDev->job.OutOfPage = TRUE;
|
||||
return 1;
|
||||
|
@ -260,10 +254,8 @@ INT PSDRV_EndPage( DC *dc )
|
|||
/************************************************************************
|
||||
* PSDRV_StartDoc
|
||||
*/
|
||||
INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc )
|
||||
INT PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOA *doc )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if(physDev->job.hJob) {
|
||||
FIXME("hJob != 0. Now what?\n");
|
||||
return 0;
|
||||
|
@ -274,8 +266,7 @@ INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc )
|
|||
physDev->job.output = HeapAlloc( PSDRV_Heap, 0, strlen(doc->lpszOutput)+1 );
|
||||
strcpy( physDev->job.output, doc->lpszOutput );
|
||||
}
|
||||
physDev->job.hJob = OpenJob16(physDev->job.output, doc->lpszDocName,
|
||||
dc->hSelf);
|
||||
physDev->job.hJob = OpenJob16(physDev->job.output, doc->lpszDocName, physDev->hdc );
|
||||
if(!physDev->job.hJob) {
|
||||
WARN("OpenJob failed\n");
|
||||
return 0;
|
||||
|
@ -283,7 +274,7 @@ INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc )
|
|||
physDev->job.banding = FALSE;
|
||||
physDev->job.OutOfPage = TRUE;
|
||||
physDev->job.PageNo = 0;
|
||||
if(!PSDRV_WriteHeader( dc, doc->lpszDocName ))
|
||||
if(!PSDRV_WriteHeader( physDev, doc->lpszDocName ))
|
||||
return 0;
|
||||
|
||||
return physDev->job.hJob;
|
||||
|
@ -293,10 +284,8 @@ INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc )
|
|||
/************************************************************************
|
||||
* PSDRV_EndDoc
|
||||
*/
|
||||
INT PSDRV_EndDoc( DC *dc )
|
||||
INT PSDRV_EndDoc( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if(!physDev->job.hJob) {
|
||||
FIXME("hJob == 0. Now what?\n");
|
||||
return 0;
|
||||
|
@ -304,9 +293,9 @@ INT PSDRV_EndDoc( DC *dc )
|
|||
|
||||
if(!physDev->job.OutOfPage) {
|
||||
WARN("Somebody forgot a EndPage\n");
|
||||
PSDRV_EndPage( dc );
|
||||
PSDRV_EndPage( physDev );
|
||||
}
|
||||
if(!PSDRV_WriteFooter( dc ))
|
||||
if(!PSDRV_WriteFooter( physDev ))
|
||||
return 0;
|
||||
|
||||
if( CloseJob16( physDev->job.hJob ) == SP_ERROR ) {
|
||||
|
|
|
@ -138,12 +138,11 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_FONT_SelectObject
|
||||
* PSDRV_SelectFont (WINEPS.@)
|
||||
*/
|
||||
HFONT PSDRV_FONT_SelectObject( DC * dc, HFONT hfont )
|
||||
HFONT PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont )
|
||||
{
|
||||
LOGFONTW lf;
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
BOOL bd = FALSE, it = FALSE;
|
||||
AFMLISTENTRY *afmle;
|
||||
FONTFAMILY *family;
|
||||
|
@ -257,7 +256,7 @@ HFONT PSDRV_FONT_SelectObject( DC * dc, HFONT hfont )
|
|||
|
||||
physDev->font.afm = afmle->afm;
|
||||
/* stock fonts ignore the mapping mode */
|
||||
if (!is_stock_font( hfont )) lf.lfHeight = INTERNAL_YWSTODS(dc, lf.lfHeight);
|
||||
if (!is_stock_font( hfont )) lf.lfHeight = INTERNAL_YWSTODS(physDev->dc, lf.lfHeight);
|
||||
ScaleFont(physDev->font.afm, lf.lfHeight,
|
||||
&(physDev->font), &(physDev->font.tm));
|
||||
|
||||
|
@ -274,10 +273,8 @@ HFONT PSDRV_FONT_SelectObject( DC * dc, HFONT hfont )
|
|||
/***********************************************************************
|
||||
* PSDRV_GetTextMetrics
|
||||
*/
|
||||
BOOL PSDRV_GetTextMetrics(DC *dc, TEXTMETRICW *metrics)
|
||||
BOOL PSDRV_GetTextMetrics(PSDRV_PDEVICE *physDev, TEXTMETRICW *metrics)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
memcpy(metrics, &(physDev->font.tm), sizeof(physDev->font.tm));
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -324,9 +321,9 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm)
|
|||
/***********************************************************************
|
||||
* PSDRV_GetTextExtentPoint
|
||||
*/
|
||||
BOOL PSDRV_GetTextExtentPoint(DC *dc, LPCWSTR str, INT count, LPSIZE size)
|
||||
BOOL PSDRV_GetTextExtentPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count, LPSIZE size)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
int i;
|
||||
float width = 0.0;
|
||||
|
||||
|
@ -349,9 +346,8 @@ BOOL PSDRV_GetTextExtentPoint(DC *dc, LPCWSTR str, INT count, LPSIZE size)
|
|||
/***********************************************************************
|
||||
* PSDRV_GetCharWidth
|
||||
*/
|
||||
BOOL PSDRV_GetCharWidth(DC *dc, UINT firstChar, UINT lastChar, LPINT buffer)
|
||||
BOOL PSDRV_GetCharWidth(PSDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, LPINT buffer)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
UINT i;
|
||||
|
||||
TRACE("U+%.4X U+%.4X\n", firstChar, lastChar);
|
||||
|
@ -376,14 +372,12 @@ BOOL PSDRV_GetCharWidth(DC *dc, UINT firstChar, UINT lastChar, LPINT buffer)
|
|||
/***********************************************************************
|
||||
* PSDRV_SetFont
|
||||
*/
|
||||
BOOL PSDRV_SetFont( DC *dc )
|
||||
BOOL PSDRV_SetFont( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
PSDRV_WriteSetColor(dc, &physDev->font.color);
|
||||
PSDRV_WriteSetColor(physDev, &physDev->font.color);
|
||||
if(physDev->font.set) return TRUE;
|
||||
|
||||
PSDRV_WriteSetFont(dc);
|
||||
PSDRV_WriteSetFont(physDev);
|
||||
physDev->font.set = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -38,16 +38,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
|||
/***********************************************************************
|
||||
* PSDRV_LineTo
|
||||
*/
|
||||
BOOL PSDRV_LineTo(DC *dc, INT x, INT y)
|
||||
BOOL PSDRV_LineTo(PSDRV_PDEVICE *physDev, INT x, INT y)
|
||||
{
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("%d %d\n", x, y);
|
||||
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteMoveTo(dc, INTERNAL_XWPTODP(dc, dc->CursPosX, dc->CursPosY),
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_WriteMoveTo(physDev, INTERNAL_XWPTODP(dc, dc->CursPosX, dc->CursPosY),
|
||||
INTERNAL_YWPTODP(dc, dc->CursPosX, dc->CursPosY));
|
||||
PSDRV_WriteLineTo(dc, INTERNAL_XWPTODP(dc, x, y),
|
||||
PSDRV_WriteLineTo(physDev, INTERNAL_XWPTODP(dc, x, y),
|
||||
INTERNAL_YWPTODP(dc, x, y));
|
||||
PSDRV_DrawLine(dc);
|
||||
PSDRV_DrawLine(physDev);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -56,21 +58,20 @@ BOOL PSDRV_LineTo(DC *dc, INT x, INT y)
|
|||
/***********************************************************************
|
||||
* PSDRV_Rectangle
|
||||
*/
|
||||
BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
|
||||
INT bottom )
|
||||
BOOL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom )
|
||||
{
|
||||
INT width;
|
||||
INT height;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("%d %d - %d %d\n", left, top, right, bottom);
|
||||
width = INTERNAL_XWSTODS(dc, right - left);
|
||||
height = INTERNAL_YWSTODS(dc, bottom - top);
|
||||
PSDRV_WriteRectangle(dc, INTERNAL_XWPTODP(dc, left, top),
|
||||
INTERNAL_YWPTODP(dc, left, top),
|
||||
width, height);
|
||||
PSDRV_Brush(dc,0);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
PSDRV_WriteRectangle(physDev, INTERNAL_XWPTODP(dc, left, top),
|
||||
INTERNAL_YWPTODP(dc, left, top), width, height);
|
||||
PSDRV_Brush(physDev,0);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_DrawLine(physDev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -78,9 +79,11 @@ BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
|
|||
/***********************************************************************
|
||||
* PSDRV_RoundRect
|
||||
*/
|
||||
BOOL PSDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
||||
BOOL PSDRV_RoundRect( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT ell_width, INT ell_height )
|
||||
{
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
left = XLPTODP( dc, left );
|
||||
right = XLPTODP( dc, right );
|
||||
top = YLPTODP( dc, top );
|
||||
|
@ -94,23 +97,23 @@ BOOL PSDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
if(ell_width > right - left) ell_width = right - left;
|
||||
if(ell_height > bottom - top) ell_height = bottom - top;
|
||||
|
||||
PSDRV_WriteMoveTo( dc, left, top + ell_height/2 );
|
||||
PSDRV_WriteArc( dc, left + ell_width/2, top + ell_height/2, ell_width,
|
||||
PSDRV_WriteMoveTo( physDev, left, top + ell_height/2 );
|
||||
PSDRV_WriteArc( physDev, left + ell_width/2, top + ell_height/2, ell_width,
|
||||
ell_height, 90.0, 180.0);
|
||||
PSDRV_WriteLineTo( dc, right - ell_width/2, top );
|
||||
PSDRV_WriteArc( dc, right - ell_width/2, top + ell_height/2, ell_width,
|
||||
PSDRV_WriteLineTo( physDev, right - ell_width/2, top );
|
||||
PSDRV_WriteArc( physDev, right - ell_width/2, top + ell_height/2, ell_width,
|
||||
ell_height, 0.0, 90.0);
|
||||
PSDRV_WriteLineTo( dc, right, bottom - ell_height/2 );
|
||||
PSDRV_WriteArc( dc, right - ell_width/2, bottom - ell_height/2, ell_width,
|
||||
PSDRV_WriteLineTo( physDev, right, bottom - ell_height/2 );
|
||||
PSDRV_WriteArc( physDev, right - ell_width/2, bottom - ell_height/2, ell_width,
|
||||
ell_height, -90.0, 0.0);
|
||||
PSDRV_WriteLineTo( dc, right - ell_width/2, bottom);
|
||||
PSDRV_WriteArc( dc, left + ell_width/2, bottom - ell_height/2, ell_width,
|
||||
PSDRV_WriteLineTo( physDev, right - ell_width/2, bottom);
|
||||
PSDRV_WriteArc( physDev, left + ell_width/2, bottom - ell_height/2, ell_width,
|
||||
ell_height, 180.0, -90.0);
|
||||
PSDRV_WriteClosePath( dc );
|
||||
PSDRV_WriteClosePath( physDev );
|
||||
|
||||
PSDRV_Brush(dc,0);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
PSDRV_Brush(physDev,0);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_DrawLine(physDev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -119,12 +122,11 @@ BOOL PSDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
*
|
||||
* Does the work of Arc, Chord and Pie. lines is 0, 1 or 2 respectively.
|
||||
*/
|
||||
static BOOL PSDRV_DrawArc( DC *dc, INT left, INT top,
|
||||
INT right, INT bottom,
|
||||
INT xstart, INT ystart,
|
||||
INT xend, INT yend,
|
||||
int lines )
|
||||
static BOOL PSDRV_DrawArc( PSDRV_PDEVICE *physDev, INT left, INT top,
|
||||
INT right, INT bottom, INT xstart, INT ystart,
|
||||
INT xend, INT yend, int lines )
|
||||
{
|
||||
DC *dc = physDev->dc;
|
||||
INT x, y, h, w;
|
||||
double start_angle, end_angle, ratio;
|
||||
|
||||
|
@ -148,17 +150,17 @@ static BOOL PSDRV_DrawArc( DC *dc, INT left, INT top,
|
|||
end_angle *= 180.0 / PI;
|
||||
|
||||
if(lines == 2) /* pie */
|
||||
PSDRV_WriteMoveTo(dc, x, y);
|
||||
PSDRV_WriteMoveTo(physDev, x, y);
|
||||
else
|
||||
PSDRV_WriteNewPath( dc );
|
||||
PSDRV_WriteNewPath( physDev );
|
||||
|
||||
PSDRV_WriteArc(dc, x, y, w, h, start_angle, end_angle);
|
||||
PSDRV_WriteArc(physDev, x, y, w, h, start_angle, end_angle);
|
||||
if(lines == 1 || lines == 2) { /* chord or pie */
|
||||
PSDRV_WriteClosePath(dc);
|
||||
PSDRV_Brush(dc,0);
|
||||
PSDRV_WriteClosePath(physDev);
|
||||
PSDRV_Brush(physDev,0);
|
||||
}
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_DrawLine(physDev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -166,41 +168,39 @@ static BOOL PSDRV_DrawArc( DC *dc, INT left, INT top,
|
|||
/***********************************************************************
|
||||
* PSDRV_Arc
|
||||
*/
|
||||
BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
BOOL PSDRV_Arc( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return PSDRV_DrawArc( dc, left, top, right, bottom, xstart, ystart,
|
||||
xend, yend, 0 );
|
||||
return PSDRV_DrawArc( physDev, left, top, right, bottom, xstart, ystart, xend, yend, 0 );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_Chord
|
||||
*/
|
||||
BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
BOOL PSDRV_Chord( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return PSDRV_DrawArc( dc, left, top, right, bottom, xstart, ystart,
|
||||
xend, yend, 1 );
|
||||
return PSDRV_DrawArc( physDev, left, top, right, bottom, xstart, ystart, xend, yend, 1 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_Pie
|
||||
*/
|
||||
BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
BOOL PSDRV_Pie( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return PSDRV_DrawArc( dc, left, top, right, bottom, xstart, ystart,
|
||||
xend, yend, 2 );
|
||||
return PSDRV_DrawArc( physDev, left, top, right, bottom, xstart, ystart, xend, yend, 2 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_Ellipse
|
||||
*/
|
||||
BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
BOOL PSDRV_Ellipse( PSDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
INT x, y, w, h;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("%d %d - %d %d\n", left, top, right, bottom);
|
||||
|
||||
|
@ -210,12 +210,12 @@ BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
w = XLSTODS(dc, (right - left));
|
||||
h = YLSTODS(dc, (bottom - top));
|
||||
|
||||
PSDRV_WriteNewPath(dc);
|
||||
PSDRV_WriteArc(dc, x, y, w, h, 0.0, 360.0);
|
||||
PSDRV_WriteClosePath(dc);
|
||||
PSDRV_Brush(dc,0);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
PSDRV_WriteArc(physDev, x, y, w, h, 0.0, 360.0);
|
||||
PSDRV_WriteClosePath(physDev);
|
||||
PSDRV_Brush(physDev,0);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_DrawLine(physDev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -223,24 +223,26 @@ BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
/***********************************************************************
|
||||
* PSDRV_PolyPolyline
|
||||
*/
|
||||
BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
|
||||
BOOL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const DWORD* counts,
|
||||
DWORD polylines )
|
||||
{
|
||||
DWORD polyline, line;
|
||||
const POINT* pt;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
pt = pts;
|
||||
for(polyline = 0; polyline < polylines; polyline++) {
|
||||
PSDRV_WriteMoveTo(dc, INTERNAL_XWPTODP(dc, pt->x, pt->y), INTERNAL_YWPTODP(dc, pt->x, pt->y));
|
||||
PSDRV_WriteMoveTo(physDev, INTERNAL_XWPTODP(dc, pt->x, pt->y), INTERNAL_YWPTODP(dc, pt->x, pt->y));
|
||||
pt++;
|
||||
for(line = 1; line < counts[polyline]; line++) {
|
||||
PSDRV_WriteLineTo(dc, INTERNAL_XWPTODP(dc, pt->x, pt->y), INTERNAL_YWPTODP(dc, pt->x, pt->y));
|
||||
PSDRV_WriteLineTo(physDev, INTERNAL_XWPTODP(dc, pt->x, pt->y), INTERNAL_YWPTODP(dc, pt->x, pt->y));
|
||||
pt++;
|
||||
}
|
||||
}
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_DrawLine(physDev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -248,39 +250,41 @@ BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
|
|||
/***********************************************************************
|
||||
* PSDRV_Polyline
|
||||
*/
|
||||
BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count )
|
||||
BOOL PSDRV_Polyline( PSDRV_PDEVICE *physDev, const POINT* pt, INT count )
|
||||
{
|
||||
return PSDRV_PolyPolyline( dc, pt, (LPDWORD) &count, 1 );
|
||||
return PSDRV_PolyPolyline( physDev, pt, (LPDWORD) &count, 1 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_PolyPolygon
|
||||
*/
|
||||
BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
|
||||
BOOL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const INT* counts,
|
||||
UINT polygons )
|
||||
{
|
||||
DWORD polygon, line;
|
||||
const POINT* pt;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
pt = pts;
|
||||
for(polygon = 0; polygon < polygons; polygon++) {
|
||||
PSDRV_WriteMoveTo(dc, INTERNAL_XWPTODP(dc, pt->x, pt->y), INTERNAL_YWPTODP(dc, pt->x, pt->y));
|
||||
PSDRV_WriteMoveTo(physDev, INTERNAL_XWPTODP(dc, pt->x, pt->y), INTERNAL_YWPTODP(dc, pt->x, pt->y));
|
||||
pt++;
|
||||
for(line = 1; line < counts[polygon]; line++) {
|
||||
PSDRV_WriteLineTo(dc, INTERNAL_XWPTODP(dc, pt->x, pt->y), INTERNAL_YWPTODP(dc, pt->x, pt->y));
|
||||
PSDRV_WriteLineTo(physDev, INTERNAL_XWPTODP(dc, pt->x, pt->y), INTERNAL_YWPTODP(dc, pt->x, pt->y));
|
||||
pt++;
|
||||
}
|
||||
PSDRV_WriteClosePath(dc);
|
||||
PSDRV_WriteClosePath(physDev);
|
||||
}
|
||||
|
||||
if(dc->polyFillMode == ALTERNATE)
|
||||
PSDRV_Brush(dc, 1);
|
||||
if(GetPolyFillMode( physDev->hdc ) == ALTERNATE)
|
||||
PSDRV_Brush(physDev, 1);
|
||||
else /* WINDING */
|
||||
PSDRV_Brush(dc, 0);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_DrawLine(dc);
|
||||
PSDRV_Brush(physDev, 0);
|
||||
PSDRV_SetPen(physDev);
|
||||
PSDRV_DrawLine(physDev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -288,27 +292,27 @@ BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
|
|||
/***********************************************************************
|
||||
* PSDRV_Polygon
|
||||
*/
|
||||
BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count )
|
||||
BOOL PSDRV_Polygon( PSDRV_PDEVICE *physDev, const POINT* pt, INT count )
|
||||
{
|
||||
return PSDRV_PolyPolygon( dc, pt, &count, 1 );
|
||||
return PSDRV_PolyPolygon( physDev, pt, &count, 1 );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_SetPixel
|
||||
*/
|
||||
COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
||||
COLORREF PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
PSCOLOR pscolor;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
x = INTERNAL_XWPTODP(dc, x, y);
|
||||
y = INTERNAL_YWPTODP(dc, x, y);
|
||||
|
||||
PSDRV_WriteRectangle( dc, x, y, 0, 0 );
|
||||
PSDRV_WriteRectangle( physDev, x, y, 0, 0 );
|
||||
PSDRV_CreateColor( physDev, &pscolor, color );
|
||||
PSDRV_WriteSetColor( dc, &pscolor );
|
||||
PSDRV_WriteFill( dc );
|
||||
PSDRV_WriteSetColor( physDev, &pscolor );
|
||||
PSDRV_WriteFill( physDev );
|
||||
return color;
|
||||
}
|
||||
|
||||
|
@ -316,12 +320,10 @@ COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
|||
/***********************************************************************
|
||||
* PSDRV_DrawLine
|
||||
*/
|
||||
VOID PSDRV_DrawLine( DC *dc )
|
||||
VOID PSDRV_DrawLine( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if (physDev->pen.style == PS_NULL)
|
||||
PSDRV_WriteNewPath(dc);
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
else
|
||||
PSDRV_WriteStroke(dc);
|
||||
PSDRV_WriteStroke(physDev);
|
||||
}
|
||||
|
|
|
@ -171,7 +171,9 @@ BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
|||
physDev = (PSDRV_PDEVICE *)HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY,
|
||||
sizeof(*physDev) );
|
||||
if (!physDev) return FALSE;
|
||||
dc->physDev = physDev;
|
||||
dc->physDev = (PHYSDEV)physDev;
|
||||
physDev->hdc = dc->hSelf;
|
||||
physDev->dc = dc;
|
||||
|
||||
physDev->pi = pi;
|
||||
|
||||
|
@ -251,16 +253,14 @@ BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
|||
/**********************************************************************
|
||||
* PSDRV_DeleteDC
|
||||
*/
|
||||
BOOL PSDRV_DeleteDC( DC *dc )
|
||||
BOOL PSDRV_DeleteDC( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
HeapFree( PSDRV_Heap, 0, physDev->Devmode );
|
||||
HeapFree( PSDRV_Heap, 0, physDev->job.output );
|
||||
physDev->dc->physDev = NULL;
|
||||
HeapFree( PSDRV_Heap, 0, physDev );
|
||||
dc->physDev = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -342,9 +342,8 @@ static void get_phys_page_size( const PSDRV_PDEVICE *pdev, POINT *p )
|
|||
/***********************************************************************
|
||||
* GetDeviceCaps (WINEPS.@)
|
||||
*/
|
||||
INT PSDRV_GetDeviceCaps( DC *dc, INT cap )
|
||||
INT PSDRV_GetDeviceCaps( PSDRV_PDEVICE *physDev, INT cap )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = dc->physDev;
|
||||
POINT pt;
|
||||
|
||||
switch(cap)
|
||||
|
@ -427,7 +426,7 @@ INT PSDRV_GetDeviceCaps( DC *dc, INT cap )
|
|||
case BTLALIGNMENT:
|
||||
return 0;
|
||||
default:
|
||||
FIXME("(%04x): unsupported capability %d, will return 0\n", dc->hSelf, cap );
|
||||
FIXME("(%04x): unsupported capability %d, will return 0\n", physDev->hdc, cap );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,46 +24,10 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_BITMAP_SelectObject
|
||||
* PSDRV_SelectBitmap (WINEPS.@)
|
||||
*/
|
||||
static HBITMAP PSDRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap )
|
||||
HBITMAP PSDRV_SelectBitmap( PSDRV_PDEVICE *physDev, HBITMAP hbitmap )
|
||||
{
|
||||
FIXME("stub\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_SelectObject
|
||||
*/
|
||||
HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle )
|
||||
{
|
||||
HGDIOBJ ret = 0;
|
||||
|
||||
TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
|
||||
|
||||
switch(GetObjectType( handle ))
|
||||
{
|
||||
case OBJ_PEN:
|
||||
ret = PSDRV_PEN_SelectObject( dc, handle );
|
||||
break;
|
||||
case OBJ_BRUSH:
|
||||
ret = PSDRV_BRUSH_SelectObject( dc, handle );
|
||||
break;
|
||||
case OBJ_BITMAP:
|
||||
ret = PSDRV_BITMAP_SelectObject( dc, handle );
|
||||
break;
|
||||
case OBJ_FONT:
|
||||
ret = PSDRV_FONT_SelectObject( dc, handle );
|
||||
break;
|
||||
case OBJ_REGION:
|
||||
ret = (HGDIOBJ)SelectClipRgn( dc->hSelf, handle );
|
||||
break;
|
||||
case 0: /* invalid handle */
|
||||
break;
|
||||
default:
|
||||
ERR("Unknown object type %ld\n", GetObjectType(handle) );
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -30,21 +30,17 @@ static char PEN_dashdotdot[] = "40 20 20 20 20 20"; /* ---- -- -- ---- */
|
|||
static char PEN_alternate[] = "1";
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_PEN_SelectObject
|
||||
* PSDRV_SelectPen (WINEPS.@)
|
||||
*/
|
||||
HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
||||
HPEN PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
|
||||
{
|
||||
LOGPEN logpen;
|
||||
HPEN prevpen = dc->hPen;
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if (!GetObjectA( hpen, sizeof(logpen), &logpen )) return 0;
|
||||
|
||||
TRACE("hpen = %08x colour = %08lx\n", hpen, logpen.lopnColor);
|
||||
|
||||
dc->hPen = hpen;
|
||||
|
||||
physDev->pen.width = INTERNAL_XWSTODS(dc, logpen.lopnWidth.x);
|
||||
physDev->pen.width = INTERNAL_XWSTODS(physDev->dc, logpen.lopnWidth.x);
|
||||
if(physDev->pen.width < 0)
|
||||
physDev->pen.width = -physDev->pen.width;
|
||||
|
||||
|
@ -82,7 +78,7 @@ HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
|||
}
|
||||
|
||||
physDev->pen.set = FALSE;
|
||||
return prevpen;
|
||||
return hpen;
|
||||
}
|
||||
|
||||
|
||||
|
@ -91,15 +87,13 @@ HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
|||
* PSDRV_SetPen
|
||||
*
|
||||
*/
|
||||
BOOL PSDRV_SetPen(DC *dc)
|
||||
BOOL PSDRV_SetPen(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if (physDev->pen.style != PS_NULL) {
|
||||
PSDRV_WriteSetColor(dc, &physDev->pen.color);
|
||||
PSDRV_WriteSetColor(physDev, &physDev->pen.color);
|
||||
|
||||
if(!physDev->pen.set) {
|
||||
PSDRV_WriteSetPen(dc);
|
||||
PSDRV_WriteSetPen(physDev);
|
||||
physDev->pen.set = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
189
dlls/wineps/ps.c
189
dlls/wineps/ps.c
|
@ -188,12 +188,10 @@ static char psarraydef[] =
|
|||
"/%s %d array def\n";
|
||||
|
||||
|
||||
int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch)
|
||||
int PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPSTR lpData, WORD cch)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if(physDev->job.OutOfPage) { /* Will get here after NEWFRAME Escape */
|
||||
if( !PSDRV_StartPage(dc) )
|
||||
if( !PSDRV_StartPage(physDev) )
|
||||
return FALSE;
|
||||
}
|
||||
return WriteSpool16( physDev->job.hJob, lpData, cch );
|
||||
|
@ -221,9 +219,8 @@ INT PSDRV_WriteFeature(HANDLE16 hJob, char *feature, char *value,
|
|||
|
||||
|
||||
|
||||
INT PSDRV_WriteHeader( DC *dc, LPCSTR title )
|
||||
INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char *buf, *orient;
|
||||
INPUTSLOT *slot;
|
||||
PAGESIZE *page;
|
||||
|
@ -296,9 +293,8 @@ INT PSDRV_WriteHeader( DC *dc, LPCSTR title )
|
|||
}
|
||||
|
||||
|
||||
INT PSDRV_WriteFooter( DC *dc )
|
||||
INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char *buf;
|
||||
|
||||
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psfooter) + 100 );
|
||||
|
@ -321,10 +317,8 @@ INT PSDRV_WriteFooter( DC *dc )
|
|||
|
||||
|
||||
|
||||
INT PSDRV_WriteEndPage( DC *dc )
|
||||
INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if( WriteSpool16( physDev->job.hJob, psendpage, sizeof(psendpage)-1 ) !=
|
||||
sizeof(psendpage)-1 ) {
|
||||
WARN("WriteSpool error\n");
|
||||
|
@ -336,9 +330,8 @@ INT PSDRV_WriteEndPage( DC *dc )
|
|||
|
||||
|
||||
|
||||
INT PSDRV_WriteNewPage( DC *dc )
|
||||
INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char *buf;
|
||||
char name[100];
|
||||
signed int xtrans, ytrans, rotation;
|
||||
|
@ -382,49 +375,49 @@ INT PSDRV_WriteNewPage( DC *dc )
|
|||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y)
|
||||
BOOL PSDRV_WriteMoveTo(PSDRV_PDEVICE *physDev, INT x, INT y)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psmoveto, x, y);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y)
|
||||
BOOL PSDRV_WriteLineTo(PSDRV_PDEVICE *physDev, INT x, INT y)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, pslineto, x, y);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WriteStroke(DC *dc)
|
||||
BOOL PSDRV_WriteStroke(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psstroke, sizeof(psstroke)-1);
|
||||
return PSDRV_WriteSpool(physDev, psstroke, sizeof(psstroke)-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
|
||||
BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
|
||||
INT height)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psrectangle, x, y, width, height, -width);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRRectangle(DC *dc, INT x, INT y, INT width,
|
||||
BOOL PSDRV_WriteRRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
|
||||
INT height)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psrrectangle, x, y, width, height, -width);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h, double ang1,
|
||||
BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h, double ang1,
|
||||
double ang2)
|
||||
{
|
||||
char buf[256];
|
||||
|
@ -432,12 +425,11 @@ BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h, double ang1,
|
|||
/* Make angles -ve and swap order because we're working with an upside
|
||||
down y-axis */
|
||||
sprintf(buf, psarc, x, y, w, h, -ang2, -ang1);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteSetFont(DC *dc)
|
||||
BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char *buf;
|
||||
|
||||
buf = (char *)HeapAlloc( PSDRV_Heap, 0,
|
||||
|
@ -452,14 +444,13 @@ BOOL PSDRV_WriteSetFont(DC *dc)
|
|||
physDev->font.size, -physDev->font.size,
|
||||
-physDev->font.escapement);
|
||||
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color)
|
||||
BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char buf[256];
|
||||
|
||||
PSDRV_CopyColor(&physDev->inkColor, color);
|
||||
|
@ -467,11 +458,11 @@ BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color)
|
|||
case PSCOLOR_RGB:
|
||||
sprintf(buf, pssetrgbcolor, color->value.rgb.r, color->value.rgb.g,
|
||||
color->value.rgb.b);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
|
||||
case PSCOLOR_GRAY:
|
||||
sprintf(buf, pssetgray, color->value.gray.i);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
|
||||
default:
|
||||
ERR("Unkonwn colour type %d\n", color->type);
|
||||
|
@ -481,23 +472,22 @@ BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteSetPen(DC *dc)
|
||||
BOOL PSDRV_WriteSetPen(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char buf[256];
|
||||
|
||||
sprintf(buf, pssetlinewidth, physDev->pen.width);
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
|
||||
if(physDev->pen.dash) {
|
||||
sprintf(buf, pssetdash, physDev->pen.dash, 0);
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteGlyphShow(DC *dc, LPCWSTR str, INT count)
|
||||
BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count)
|
||||
{
|
||||
char buf[128];
|
||||
int i;
|
||||
|
@ -507,8 +497,7 @@ BOOL PSDRV_WriteGlyphShow(DC *dc, LPCWSTR str, INT count)
|
|||
LPCSTR name;
|
||||
int l;
|
||||
|
||||
name = PSDRV_UVMetrics(str[i],
|
||||
((PSDRV_PDEVICE *)dc->physDev)->font.afm)->N->sz;
|
||||
name = PSDRV_UVMetrics(str[i], physDev->font.afm)->N->sz;
|
||||
l = snprintf(buf, sizeof(buf), psglyphshow, name);
|
||||
|
||||
if (l < sizeof(psglyphshow) - 2 || l > sizeof(buf) - 1)
|
||||
|
@ -517,84 +506,84 @@ BOOL PSDRV_WriteGlyphShow(DC *dc, LPCWSTR str, INT count)
|
|||
continue;
|
||||
}
|
||||
|
||||
PSDRV_WriteSpool(dc, buf, l);
|
||||
PSDRV_WriteSpool(physDev, buf, l);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteFill(DC *dc)
|
||||
BOOL PSDRV_WriteFill(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psfill, sizeof(psfill)-1);
|
||||
return PSDRV_WriteSpool(physDev, psfill, sizeof(psfill)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteEOFill(DC *dc)
|
||||
BOOL PSDRV_WriteEOFill(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, pseofill, sizeof(pseofill)-1);
|
||||
return PSDRV_WriteSpool(physDev, pseofill, sizeof(pseofill)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteGSave(DC *dc)
|
||||
BOOL PSDRV_WriteGSave(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psgsave, sizeof(psgsave)-1);
|
||||
return PSDRV_WriteSpool(physDev, psgsave, sizeof(psgsave)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteGRestore(DC *dc)
|
||||
BOOL PSDRV_WriteGRestore(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psgrestore, sizeof(psgrestore)-1);
|
||||
return PSDRV_WriteSpool(physDev, psgrestore, sizeof(psgrestore)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteNewPath(DC *dc)
|
||||
BOOL PSDRV_WriteNewPath(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psnewpath, sizeof(psnewpath)-1);
|
||||
return PSDRV_WriteSpool(physDev, psnewpath, sizeof(psnewpath)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteClosePath(DC *dc)
|
||||
BOOL PSDRV_WriteClosePath(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psclosepath, sizeof(psclosepath)-1);
|
||||
return PSDRV_WriteSpool(physDev, psclosepath, sizeof(psclosepath)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteClip(DC *dc)
|
||||
BOOL PSDRV_WriteClip(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psclip, sizeof(psclip)-1);
|
||||
return PSDRV_WriteSpool(physDev, psclip, sizeof(psclip)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteEOClip(DC *dc)
|
||||
BOOL PSDRV_WriteEOClip(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, pseoclip, sizeof(pseoclip)-1);
|
||||
return PSDRV_WriteSpool(physDev, pseoclip, sizeof(pseoclip)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteInitClip(DC *dc)
|
||||
BOOL PSDRV_WriteInitClip(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psinitclip, sizeof(psinitclip)-1);
|
||||
return PSDRV_WriteSpool(physDev, psinitclip, sizeof(psinitclip)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteHatch(DC *dc)
|
||||
BOOL PSDRV_WriteHatch(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, pshatch, sizeof(pshatch)-1);
|
||||
return PSDRV_WriteSpool(physDev, pshatch, sizeof(pshatch)-1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRotate(DC *dc, float ang)
|
||||
BOOL PSDRV_WriteRotate(PSDRV_PDEVICE *physDev, float ang)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
sprintf(buf, psrotate, ang);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size)
|
||||
BOOL PSDRV_WriteIndexColorSpaceBegin(PSDRV_PDEVICE *physDev, int size)
|
||||
{
|
||||
char buf[256];
|
||||
sprintf(buf, "[/Indexed /DeviceRGB %d\n<\n", size);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc)
|
||||
BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev)
|
||||
{
|
||||
char buf[] = ">\n] setcolorspace\n";
|
||||
return PSDRV_WriteSpool(dc, buf, sizeof(buf) - 1);
|
||||
return PSDRV_WriteSpool(physDev, buf, sizeof(buf) - 1);
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number)
|
||||
BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number)
|
||||
{
|
||||
char *buf = HeapAlloc(PSDRV_Heap, 0, number * 7 + 1), *ptr;
|
||||
int i;
|
||||
|
@ -606,13 +595,13 @@ BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number)
|
|||
((i & 0x7) == 0x7) || (i == number - 1) ? '\n' : ' ');
|
||||
ptr += 7;
|
||||
}
|
||||
PSDRV_WriteSpool(dc, buf, number * 7);
|
||||
PSDRV_WriteSpool(physDev, buf, number * 7);
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
|
||||
BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst, INT widthSrc,
|
||||
INT heightSrc, char *bits)
|
||||
{
|
||||
|
@ -631,7 +620,7 @@ BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
|
|||
sprintf(buf, start, xDst, yDst, widthDst, heightDst, widthSrc, heightSrc,
|
||||
(depth < 8) ? depth : 8, widthSrc, -heightSrc, heightSrc);
|
||||
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
|
||||
switch(depth) {
|
||||
case 8:
|
||||
|
@ -651,13 +640,13 @@ BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
|
|||
break;
|
||||
}
|
||||
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
|
||||
if(!bits)
|
||||
PSDRV_WriteSpool(dc, end, sizeof(end) - 1);
|
||||
PSDRV_WriteSpool(physDev, end, sizeof(end) - 1);
|
||||
else {
|
||||
sprintf(buf, endbits, bits);
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
|
@ -665,7 +654,7 @@ BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
|
|||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number)
|
||||
BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, int number)
|
||||
{
|
||||
char *buf = HeapAlloc(PSDRV_Heap, 0, number * 3 + 1);
|
||||
char *ptr;
|
||||
|
@ -678,13 +667,13 @@ BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number)
|
|||
((i & 0xf) == 0xf) || (i == number - 1) ? '\n' : ' ');
|
||||
ptr += 3;
|
||||
}
|
||||
PSDRV_WriteSpool(dc, buf, number * 3);
|
||||
PSDRV_WriteSpool(physDev, buf, number * 3);
|
||||
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number)
|
||||
BOOL PSDRV_WriteDIBits16(PSDRV_PDEVICE *physDev, const WORD *words, int number)
|
||||
{
|
||||
char *buf = HeapAlloc(PSDRV_Heap, 0, number * 7 + 1);
|
||||
char *ptr;
|
||||
|
@ -707,13 +696,13 @@ BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number)
|
|||
((i & 0x7) == 0x7) || (i == number - 1) ? '\n' : ' ');
|
||||
ptr += 7;
|
||||
}
|
||||
PSDRV_WriteSpool(dc, buf, number * 7);
|
||||
PSDRV_WriteSpool(physDev, buf, number * 7);
|
||||
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number)
|
||||
BOOL PSDRV_WriteDIBits24(PSDRV_PDEVICE *physDev, const BYTE *bits, int number)
|
||||
{
|
||||
char *buf = HeapAlloc(PSDRV_Heap, 0, number * 7 + 1);
|
||||
char *ptr;
|
||||
|
@ -727,13 +716,13 @@ BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number)
|
|||
((i & 0x7) == 0x7) || (i == number - 1) ? '\n' : ' ');
|
||||
ptr += 7;
|
||||
}
|
||||
PSDRV_WriteSpool(dc, buf, number * 7);
|
||||
PSDRV_WriteSpool(physDev, buf, number * 7);
|
||||
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number)
|
||||
BOOL PSDRV_WriteDIBits32(PSDRV_PDEVICE *physDev, const BYTE *bits, int number)
|
||||
{
|
||||
char *buf = HeapAlloc(PSDRV_Heap, 0, number * 7 + 1);
|
||||
char *ptr;
|
||||
|
@ -747,53 +736,53 @@ BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number)
|
|||
((i & 0x7) == 0x7) || (i == number - 1) ? '\n' : ' ');
|
||||
ptr += 7;
|
||||
}
|
||||
PSDRV_WriteSpool(dc, buf, number * 7);
|
||||
PSDRV_WriteSpool(physDev, buf, number * 7);
|
||||
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArrayGet(DC *dc, CHAR *pszArrayName, INT nIndex)
|
||||
BOOL PSDRV_WriteArrayGet(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nIndex)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psarrayget, pszArrayName, nIndex);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArrayPut(DC *dc, CHAR *pszArrayName, INT nIndex, LONG lObject)
|
||||
BOOL PSDRV_WriteArrayPut(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nIndex, LONG lObject)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psarrayput, pszArrayName, nIndex, lObject);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArrayDef(DC *dc, CHAR *pszArrayName, INT nSize)
|
||||
BOOL PSDRV_WriteArrayDef(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nSize)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psarraydef, pszArrayName, nSize);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRectClip(DC *dc, INT x, INT y, INT w, INT h)
|
||||
BOOL PSDRV_WriteRectClip(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psrectclip, x, y, w, h);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRectClip2(DC *dc, CHAR *pszArrayName)
|
||||
BOOL PSDRV_WriteRectClip2(PSDRV_PDEVICE *physDev, CHAR *pszArrayName)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psrectclip2, pszArrayName);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
return PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits)
|
||||
BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits)
|
||||
{
|
||||
char start[] = "<<\n /PaintType 1\n /PatternType 1\n /TilingType 1\n "
|
||||
"/BBox [0 0 %d %d]\n /XStep %d\n /YStep %d\n /PaintProc {\n begin\n";
|
||||
|
@ -808,12 +797,12 @@ BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits)
|
|||
|
||||
buf = HeapAlloc(PSDRV_Heap, 0, sizeof(start) + 100);
|
||||
sprintf(buf, start, w, h, w, h);
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
PSDRV_WriteIndexColorSpaceBegin(dc, 1);
|
||||
map[0] = dc->textColor;
|
||||
map[1] = dc->backgroundColor;
|
||||
PSDRV_WriteRGB(dc, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(dc);
|
||||
PSDRV_WriteSpool(physDev, buf, strlen(buf));
|
||||
PSDRV_WriteIndexColorSpaceBegin(physDev, 1);
|
||||
map[0] = GetTextColor( physDev->hdc );
|
||||
map[1] = GetBkColor( physDev->hdc );
|
||||
PSDRV_WriteRGB(physDev, map, 2);
|
||||
PSDRV_WriteIndexColorSpaceEnd(physDev);
|
||||
ptr = buf;
|
||||
for(y = h-1; y >= 0; y--) {
|
||||
for(x = 0; x < w/8; x++) {
|
||||
|
@ -821,8 +810,8 @@ BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits)
|
|||
ptr += 2;
|
||||
}
|
||||
}
|
||||
PSDRV_WriteImageDict(dc, 1, 0, 0, 8, 8, 8, 8, buf);
|
||||
PSDRV_WriteSpool(dc, end, sizeof(end) - 1);
|
||||
PSDRV_WriteImageDict(physDev, 1, 0, 0, 8, 8, 8, 8, buf);
|
||||
PSDRV_WriteSpool(physDev, end, sizeof(end) - 1);
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -267,6 +267,8 @@ typedef struct {
|
|||
} JOB;
|
||||
|
||||
typedef struct {
|
||||
HDC hdc;
|
||||
DC *dc;
|
||||
PSFONT font; /* Current PS font */
|
||||
PSPEN pen;
|
||||
PSBRUSH brush;
|
||||
|
@ -327,13 +329,10 @@ extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm,
|
|||
extern void PSDRV_FreeAFMList( FONTFAMILY *head );
|
||||
|
||||
extern BOOL WINAPI PSDRV_Init(HINSTANCE hinst, DWORD reason, LPVOID reserved);
|
||||
extern HFONT PSDRV_FONT_SelectObject( DC *dc, HFONT hfont );
|
||||
extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen );
|
||||
extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush );
|
||||
|
||||
extern BOOL PSDRV_Brush(DC *dc, BOOL EO);
|
||||
extern BOOL PSDRV_SetFont( DC *dc );
|
||||
extern BOOL PSDRV_SetPen( DC *dc );
|
||||
extern BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO);
|
||||
extern BOOL PSDRV_SetFont( PSDRV_PDEVICE *physDev );
|
||||
extern BOOL PSDRV_SetPen( PSDRV_PDEVICE *physDev );
|
||||
|
||||
extern BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2);
|
||||
extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
|
||||
|
@ -341,98 +340,95 @@ extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
|
|||
COLORREF wincolor );
|
||||
extern char PSDRV_UnicodeToANSI(int u);
|
||||
|
||||
extern INT PSDRV_WriteHeader( DC *dc, LPCSTR title );
|
||||
extern INT PSDRV_WriteFooter( DC *dc );
|
||||
extern INT PSDRV_WriteNewPage( DC *dc );
|
||||
extern INT PSDRV_WriteEndPage( DC *dc );
|
||||
extern BOOL PSDRV_WriteMoveTo(DC *dc, INT x, INT y);
|
||||
extern BOOL PSDRV_WriteLineTo(DC *dc, INT x, INT y);
|
||||
extern BOOL PSDRV_WriteStroke(DC *dc);
|
||||
extern BOOL PSDRV_WriteRectangle(DC *dc, INT x, INT y, INT width,
|
||||
extern INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title );
|
||||
extern INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev );
|
||||
extern INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev );
|
||||
extern INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev );
|
||||
extern BOOL PSDRV_WriteMoveTo(PSDRV_PDEVICE *physDev, INT x, INT y);
|
||||
extern BOOL PSDRV_WriteLineTo(PSDRV_PDEVICE *physDev, INT x, INT y);
|
||||
extern BOOL PSDRV_WriteStroke(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
|
||||
INT height);
|
||||
extern BOOL PSDRV_WriteRRectangle(DC *dc, INT x, INT y, INT width,
|
||||
extern BOOL PSDRV_WriteRRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
|
||||
INT height);
|
||||
extern BOOL PSDRV_WriteSetFont(DC *dc);
|
||||
extern BOOL PSDRV_WriteGlyphShow(DC *dc, LPCWSTR str, INT count);
|
||||
extern BOOL PSDRV_WriteSetPen(DC *dc);
|
||||
extern BOOL PSDRV_WriteArc(DC *dc, INT x, INT y, INT w, INT h,
|
||||
extern BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count);
|
||||
extern BOOL PSDRV_WriteSetPen(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h,
|
||||
double ang1, double ang2);
|
||||
extern BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color);
|
||||
extern BOOL PSDRV_WriteSetBrush(DC *dc);
|
||||
extern BOOL PSDRV_WriteFill(DC *dc);
|
||||
extern BOOL PSDRV_WriteEOFill(DC *dc);
|
||||
extern BOOL PSDRV_WriteGSave(DC *dc);
|
||||
extern BOOL PSDRV_WriteGRestore(DC *dc);
|
||||
extern BOOL PSDRV_WriteNewPath(DC *dc);
|
||||
extern BOOL PSDRV_WriteClosePath(DC *dc);
|
||||
extern BOOL PSDRV_WriteInitClip(DC *dc);
|
||||
extern BOOL PSDRV_WriteClip(DC *dc);
|
||||
extern BOOL PSDRV_WriteRectClip(DC *dc, INT x, INT y, INT w, INT h);
|
||||
extern BOOL PSDRV_WriteRectClip2(DC *dc, CHAR *pszArrayName);
|
||||
extern BOOL PSDRV_WriteEOClip(DC *dc);
|
||||
extern BOOL PSDRV_WriteHatch(DC *dc);
|
||||
extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
|
||||
extern BOOL PSDRV_WriteIndexColorSpaceBegin(DC *dc, int size);
|
||||
extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
|
||||
extern BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number);
|
||||
extern BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
|
||||
extern BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color);
|
||||
extern BOOL PSDRV_WriteSetBrush(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteFill(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteEOFill(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteGSave(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteGRestore(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteNewPath(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteClosePath(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteInitClip(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteClip(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteRectClip(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h);
|
||||
extern BOOL PSDRV_WriteRectClip2(PSDRV_PDEVICE *physDev, CHAR *pszArrayName);
|
||||
extern BOOL PSDRV_WriteEOClip(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteHatch(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteRotate(PSDRV_PDEVICE *physDev, float ang);
|
||||
extern BOOL PSDRV_WriteIndexColorSpaceBegin(PSDRV_PDEVICE *physDev, int size);
|
||||
extern BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev);
|
||||
extern BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number);
|
||||
extern BOOL PSDRV_WriteImageDict(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst, INT widthSrc,
|
||||
INT heightSrc, char *bits);
|
||||
extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
|
||||
extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
|
||||
extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
|
||||
extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
|
||||
extern int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch);
|
||||
extern BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits);
|
||||
extern BOOL PSDRV_WriteArrayPut(DC *dc, CHAR *pszArrayName, INT nIndex, LONG lCoord);
|
||||
extern BOOL PSDRV_WriteArrayDef(DC *dc, CHAR *pszArrayName, INT nSize);
|
||||
extern BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, int number);
|
||||
extern BOOL PSDRV_WriteDIBits16(PSDRV_PDEVICE *physDev, const WORD *words, int number);
|
||||
extern BOOL PSDRV_WriteDIBits24(PSDRV_PDEVICE *physDev, const BYTE *bits, int number);
|
||||
extern BOOL PSDRV_WriteDIBits32(PSDRV_PDEVICE *physDev, const BYTE *bits, int number);
|
||||
extern int PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPSTR lpData, WORD cch);
|
||||
extern BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits);
|
||||
extern BOOL PSDRV_WriteArrayPut(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nIndex, LONG lCoord);
|
||||
extern BOOL PSDRV_WriteArrayDef(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nSize);
|
||||
|
||||
extern BOOL PSDRV_Arc( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL PSDRV_Arc( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart,
|
||||
INT xend, INT yend );
|
||||
extern BOOL PSDRV_Chord( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL PSDRV_Chord( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart,
|
||||
INT xend, INT yend );
|
||||
extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL PSDRV_Ellipse( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom );
|
||||
extern INT PSDRV_EndDoc( DC *dc );
|
||||
extern INT PSDRV_EndPage( DC *dc );
|
||||
extern INT PSDRV_EndDoc( PSDRV_PDEVICE *physDev );
|
||||
extern INT PSDRV_EndPage( PSDRV_PDEVICE *physDev );
|
||||
extern BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
|
||||
DEVICEFONTENUMPROC proc, LPARAM lp );
|
||||
extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
|
||||
SEGPTR lpInData, SEGPTR lpOutData );
|
||||
extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||
extern BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR str, UINT count,
|
||||
const INT *lpDx );
|
||||
extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
|
||||
extern BOOL PSDRV_GetCharWidth( PSDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar,
|
||||
LPINT buffer );
|
||||
extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
|
||||
extern BOOL PSDRV_GetTextExtentPoint( PSDRV_PDEVICE *physDev, LPCWSTR str, INT count,
|
||||
LPSIZE size );
|
||||
extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics );
|
||||
extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
|
||||
extern BOOL PSDRV_PatBlt( DC *dc, INT x, INT y, INT width, INT height, DWORD
|
||||
extern BOOL PSDRV_GetTextMetrics( PSDRV_PDEVICE *physDev, TEXTMETRICW *metrics );
|
||||
extern BOOL PSDRV_LineTo( PSDRV_PDEVICE *physDev, INT x, INT y );
|
||||
extern BOOL PSDRV_PatBlt( PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height, DWORD
|
||||
dwRop);
|
||||
extern BOOL PSDRV_Pie( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL PSDRV_Pie( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart,
|
||||
INT xend, INT yend );
|
||||
extern BOOL PSDRV_Polygon( DC *dc, const POINT* pt, INT count );
|
||||
extern BOOL PSDRV_Polyline( DC *dc, const POINT* pt, INT count );
|
||||
extern BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
|
||||
extern BOOL PSDRV_Polygon( PSDRV_PDEVICE *physDev, const POINT* pt, INT count );
|
||||
extern BOOL PSDRV_Polyline( PSDRV_PDEVICE *physDev, const POINT* pt, INT count );
|
||||
extern BOOL PSDRV_PolyPolygon( PSDRV_PDEVICE *physDev, const POINT* pts, const INT* counts,
|
||||
UINT polygons );
|
||||
extern BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
|
||||
extern BOOL PSDRV_PolyPolyline( PSDRV_PDEVICE *physDev, const POINT* pts, const DWORD* counts,
|
||||
DWORD polylines );
|
||||
extern BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL PSDRV_Rectangle( PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom );
|
||||
extern BOOL PSDRV_RoundRect(DC *dc, INT left, INT top, INT right,
|
||||
extern BOOL PSDRV_RoundRect(PSDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT ell_width, INT ell_height);
|
||||
extern HGDIOBJ PSDRV_SelectObject( DC *dc, HGDIOBJ handle );
|
||||
extern COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color );
|
||||
extern VOID PSDRV_SetDeviceClipping( DC *dc );
|
||||
extern COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color );
|
||||
extern COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color );
|
||||
extern INT PSDRV_StartDoc( DC *dc, const DOCINFOA *doc );
|
||||
extern INT PSDRV_StartPage( DC *dc );
|
||||
extern INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst,
|
||||
extern COLORREF PSDRV_SetBkColor( PSDRV_PDEVICE *physDev, COLORREF color );
|
||||
extern VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev );
|
||||
extern COLORREF PSDRV_SetPixel( PSDRV_PDEVICE *physDev, INT x, INT y, COLORREF color );
|
||||
extern COLORREF PSDRV_SetTextColor( PSDRV_PDEVICE *physDev, COLORREF color );
|
||||
extern INT PSDRV_StartDoc( PSDRV_PDEVICE *physDev, const DOCINFOA *doc );
|
||||
extern INT PSDRV_StartPage( PSDRV_PDEVICE *physDev );
|
||||
extern INT PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst, INT xSrc,
|
||||
INT ySrc, INT widthSrc, INT heightSrc,
|
||||
const void *bits, const BITMAPINFO *info,
|
||||
|
@ -447,7 +443,7 @@ extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
|
|||
LPCSTR lpszPort,
|
||||
WORD fwCapability, LPSTR lpszOutput,
|
||||
LPDEVMODEA lpdm);
|
||||
VOID PSDRV_DrawLine( DC *dc );
|
||||
VOID PSDRV_DrawLine( PSDRV_PDEVICE *physDev );
|
||||
INT PSDRV_GlyphListInit(void);
|
||||
const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName);
|
||||
VOID PSDRV_IndexGlyphList(void);
|
||||
|
|
|
@ -24,27 +24,27 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
|
||||
|
||||
static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
|
||||
static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, LPCWSTR str, UINT count,
|
||||
BOOL bDrawBackground, const INT *lpDx);
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_ExtTextOut
|
||||
*/
|
||||
BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||
BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR str, UINT count,
|
||||
const INT *lpDx )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
BOOL bResult = TRUE;
|
||||
BOOL bClipped = FALSE;
|
||||
BOOL bOpaque = FALSE;
|
||||
RECT rect;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("(x=%d, y=%d, flags=0x%08x, str=%s, count=%d, lpDx=%p)\n", x, y,
|
||||
flags, debugstr_wn(str, count), count, lpDx);
|
||||
|
||||
/* write font if not already written */
|
||||
PSDRV_SetFont(dc);
|
||||
PSDRV_SetFont(physDev);
|
||||
|
||||
/* set clipping and/or draw background */
|
||||
if ((flags & (ETO_CLIPPED | ETO_OPAQUE)) && (lprect != NULL))
|
||||
|
@ -54,31 +54,31 @@ BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
rect.top = INTERNAL_YWPTODP(dc, lprect->left, lprect->top);
|
||||
rect.bottom = INTERNAL_YWPTODP(dc, lprect->right, lprect->bottom);
|
||||
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteRectangle(dc, rect.left, rect.top, rect.right - rect.left,
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteRectangle(physDev, rect.left, rect.top, rect.right - rect.left,
|
||||
rect.bottom - rect.top);
|
||||
|
||||
if (flags & ETO_OPAQUE)
|
||||
{
|
||||
bOpaque = TRUE;
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteSetColor(dc, &physDev->bkColor);
|
||||
PSDRV_WriteFill(dc);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteSetColor(physDev, &physDev->bkColor);
|
||||
PSDRV_WriteFill(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
}
|
||||
|
||||
if (flags & ETO_CLIPPED)
|
||||
{
|
||||
bClipped = TRUE;
|
||||
PSDRV_WriteClip(dc);
|
||||
PSDRV_WriteClip(physDev);
|
||||
}
|
||||
|
||||
bResult = PSDRV_Text(dc, x, y, str, count, !(bClipped && bOpaque), lpDx);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
bResult = PSDRV_Text(physDev, x, y, str, count, !(bClipped && bOpaque), lpDx);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
}
|
||||
else
|
||||
{
|
||||
bResult = PSDRV_Text(dc, x, y, str, count, TRUE, lpDx);
|
||||
bResult = PSDRV_Text(physDev, x, y, str, count, TRUE, lpDx);
|
||||
}
|
||||
|
||||
return bResult;
|
||||
|
@ -87,12 +87,13 @@ BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
/***********************************************************************
|
||||
* PSDRV_Text
|
||||
*/
|
||||
static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
|
||||
static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, LPCWSTR str, UINT count,
|
||||
BOOL bDrawBackground, const INT *lpDx)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
LPWSTR strbuf;
|
||||
SIZE sz;
|
||||
DC *dc = physDev->dc;
|
||||
UINT align = GetTextAlign( physDev->hdc );
|
||||
|
||||
if (!count)
|
||||
return TRUE;
|
||||
|
@ -103,7 +104,7 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if(dc->textAlign & TA_UPDATECP) {
|
||||
if(align & TA_UPDATECP) {
|
||||
x = dc->CursPosX;
|
||||
y = dc->CursPosY;
|
||||
}
|
||||
|
@ -111,12 +112,12 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
|
|||
x = INTERNAL_XWPTODP(dc, x, y);
|
||||
y = INTERNAL_YWPTODP(dc, x, y);
|
||||
|
||||
GetTextExtentPoint32W(dc->hSelf, str, count, &sz);
|
||||
GetTextExtentPoint32W(physDev->hdc, str, count, &sz);
|
||||
if(lpDx) {
|
||||
SIZE tmpsz;
|
||||
INT i;
|
||||
/* Get the width of the last char and add on all the offsets */
|
||||
GetTextExtentPoint32W(dc->hSelf, str + count - 1, 1, &tmpsz);
|
||||
GetTextExtentPoint32W(physDev->hdc, str + count - 1, 1, &tmpsz);
|
||||
for(i = 0; i < count-1; i++)
|
||||
tmpsz.cx += lpDx[i];
|
||||
sz.cx = tmpsz.cx; /* sz.cy remains untouched */
|
||||
|
@ -124,10 +125,10 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
|
|||
|
||||
sz.cx = INTERNAL_XWSTODS(dc, sz.cx);
|
||||
sz.cy = INTERNAL_YWSTODS(dc, sz.cy);
|
||||
TRACE("textAlign = %x\n", dc->textAlign);
|
||||
switch(dc->textAlign & (TA_LEFT | TA_CENTER | TA_RIGHT) ) {
|
||||
TRACE("textAlign = %x\n", align);
|
||||
switch(align & (TA_LEFT | TA_CENTER | TA_RIGHT) ) {
|
||||
case TA_LEFT:
|
||||
if(dc->textAlign & TA_UPDATECP) {
|
||||
if(align & TA_UPDATECP) {
|
||||
dc->CursPosX = INTERNAL_XDPTOWP(dc, x + sz.cx, y);
|
||||
}
|
||||
break;
|
||||
|
@ -138,13 +139,13 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
|
|||
|
||||
case TA_RIGHT:
|
||||
x -= sz.cx;
|
||||
if(dc->textAlign & TA_UPDATECP) {
|
||||
if(align & TA_UPDATECP) {
|
||||
dc->CursPosX = INTERNAL_XDPTOWP(dc, x, y);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch(dc->textAlign & (TA_TOP | TA_BASELINE | TA_BOTTOM) ) {
|
||||
switch(align & (TA_TOP | TA_BASELINE | TA_BOTTOM) ) {
|
||||
case TA_TOP:
|
||||
y += physDev->font.tm.tmAscent;
|
||||
break;
|
||||
|
@ -160,22 +161,22 @@ 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->backgroundMode != TRANSPARENT) && (bDrawBackground != FALSE))
|
||||
if ((GetBkMode( physDev->hdc ) != TRANSPARENT) && bDrawBackground)
|
||||
{
|
||||
PSDRV_WriteGSave(dc);
|
||||
PSDRV_WriteNewPath(dc);
|
||||
PSDRV_WriteRectangle(dc, x, y - physDev->font.tm.tmAscent, sz.cx,
|
||||
PSDRV_WriteGSave(physDev);
|
||||
PSDRV_WriteNewPath(physDev);
|
||||
PSDRV_WriteRectangle(physDev, x, y - physDev->font.tm.tmAscent, sz.cx,
|
||||
physDev->font.tm.tmAscent +
|
||||
physDev->font.tm.tmDescent);
|
||||
PSDRV_WriteSetColor(dc, &physDev->bkColor);
|
||||
PSDRV_WriteFill(dc);
|
||||
PSDRV_WriteGRestore(dc);
|
||||
PSDRV_WriteSetColor(physDev, &physDev->bkColor);
|
||||
PSDRV_WriteFill(physDev);
|
||||
PSDRV_WriteGRestore(physDev);
|
||||
}
|
||||
|
||||
PSDRV_WriteMoveTo(dc, x, y);
|
||||
PSDRV_WriteMoveTo(physDev, x, y);
|
||||
|
||||
if(!lpDx)
|
||||
PSDRV_WriteGlyphShow(dc, strbuf, lstrlenW(strbuf));
|
||||
PSDRV_WriteGlyphShow(physDev, strbuf, lstrlenW(strbuf));
|
||||
else {
|
||||
INT i;
|
||||
float dx = 0.0, dy = 0.0;
|
||||
|
@ -183,13 +184,13 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
|
|||
float sin_theta = sin(physDev->font.escapement * M_PI / 1800.0);
|
||||
for(i = 0; i < count-1; i++) {
|
||||
TRACE("lpDx[%d] = %d\n", i, lpDx[i]);
|
||||
PSDRV_WriteGlyphShow(dc, &strbuf[i], 1);
|
||||
PSDRV_WriteGlyphShow(physDev, &strbuf[i], 1);
|
||||
dx += lpDx[i] * cos_theta;
|
||||
dy -= lpDx[i] * sin_theta;
|
||||
PSDRV_WriteMoveTo(dc, x + INTERNAL_XWSTODS(dc, dx),
|
||||
PSDRV_WriteMoveTo(physDev, x + INTERNAL_XWSTODS(dc, dx),
|
||||
y + INTERNAL_YWSTODS(dc, dy));
|
||||
}
|
||||
PSDRV_WriteGlyphShow(dc, &strbuf[i], 1);
|
||||
PSDRV_WriteGlyphShow(physDev, &strbuf[i], 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -210,56 +211,56 @@ static BOOL PSDRV_Text(DC *dc, INT x, INT y, LPCWSTR str, UINT count,
|
|||
|
||||
/* Get the width of the text */
|
||||
|
||||
PSDRV_GetTextExtentPoint(dc, strbuf, lstrlenW(strbuf), &size);
|
||||
PSDRV_GetTextExtentPoint(physDev, strbuf, lstrlenW(strbuf), &size);
|
||||
size.cx = INTERNAL_XWSTODS(dc, size.cx);
|
||||
|
||||
/* Do the underline */
|
||||
|
||||
if (physDev->font.tm.tmUnderlined) {
|
||||
PSDRV_WriteNewPath(dc); /* will be closed by WriteRectangle */
|
||||
PSDRV_WriteNewPath(physDev); /* will be closed by WriteRectangle */
|
||||
if (escapement != 0) /* rotated text */
|
||||
{
|
||||
PSDRV_WriteGSave(dc); /* save the graphics state */
|
||||
PSDRV_WriteMoveTo(dc, x, y); /* move to the start */
|
||||
PSDRV_WriteGSave(physDev); /* save the graphics state */
|
||||
PSDRV_WriteMoveTo(physDev, x, y); /* move to the start */
|
||||
|
||||
/* temporarily rotate the coord system */
|
||||
PSDRV_WriteRotate(dc, -escapement/10);
|
||||
PSDRV_WriteRotate(physDev, -escapement/10);
|
||||
|
||||
/* draw the underline relative to the starting point */
|
||||
PSDRV_WriteRRectangle(dc, 0, (INT)pos, size.cx, (INT)thick);
|
||||
PSDRV_WriteRRectangle(physDev, 0, (INT)pos, size.cx, (INT)thick);
|
||||
}
|
||||
else
|
||||
PSDRV_WriteRectangle(dc, x, y + (INT)pos, size.cx, (INT)thick);
|
||||
PSDRV_WriteRectangle(physDev, x, y + (INT)pos, size.cx, (INT)thick);
|
||||
|
||||
PSDRV_WriteFill(dc);
|
||||
PSDRV_WriteFill(physDev);
|
||||
|
||||
if (escapement != 0) /* rotated text */
|
||||
PSDRV_WriteGRestore(dc); /* restore the graphics state */
|
||||
PSDRV_WriteGRestore(physDev); /* restore the graphics state */
|
||||
}
|
||||
|
||||
/* Do the strikeout */
|
||||
|
||||
if (physDev->font.tm.tmStruckOut) {
|
||||
pos = -physDev->font.tm.tmAscent / 2;
|
||||
PSDRV_WriteNewPath(dc); /* will be closed by WriteRectangle */
|
||||
PSDRV_WriteNewPath(physDev); /* will be closed by WriteRectangle */
|
||||
if (escapement != 0) /* rotated text */
|
||||
{
|
||||
PSDRV_WriteGSave(dc); /* save the graphics state */
|
||||
PSDRV_WriteMoveTo(dc, x, y); /* move to the start */
|
||||
PSDRV_WriteGSave(physDev); /* save the graphics state */
|
||||
PSDRV_WriteMoveTo(physDev, x, y); /* move to the start */
|
||||
|
||||
/* temporarily rotate the coord system */
|
||||
PSDRV_WriteRotate(dc, -escapement/10);
|
||||
PSDRV_WriteRotate(physDev, -escapement/10);
|
||||
|
||||
/* draw the underline relative to the starting point */
|
||||
PSDRV_WriteRRectangle(dc, 0, (INT)pos, size.cx, (INT)thick);
|
||||
PSDRV_WriteRRectangle(physDev, 0, (INT)pos, size.cx, (INT)thick);
|
||||
}
|
||||
else
|
||||
PSDRV_WriteRectangle(dc, x, y + (INT)pos, size.cx, (INT)thick);
|
||||
PSDRV_WriteRectangle(physDev, x, y + (INT)pos, size.cx, (INT)thick);
|
||||
|
||||
PSDRV_WriteFill(dc);
|
||||
PSDRV_WriteFill(physDev);
|
||||
|
||||
if (escapement != 0) /* rotated text */
|
||||
PSDRV_WriteGRestore(dc); /* restore the graphics state */
|
||||
PSDRV_WriteGRestore(physDev); /* restore the graphics state */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,10 @@ debug_channels (psdrv)
|
|||
@ cdecl Polyline(ptr ptr long) PSDRV_Polyline
|
||||
@ cdecl Rectangle(ptr long long long long) PSDRV_Rectangle
|
||||
@ cdecl RoundRect(ptr long long long long long long) PSDRV_RoundRect
|
||||
@ cdecl SelectObject(ptr long) PSDRV_SelectObject
|
||||
@ cdecl SelectBitmap(ptr long) PSDRV_SelectBitmap
|
||||
@ cdecl SelectBrush(ptr long) PSDRV_SelectBrush
|
||||
@ cdecl SelectFont(ptr long) PSDRV_SelectFont
|
||||
@ cdecl SelectPen(ptr long) PSDRV_SelectPen
|
||||
@ cdecl SetBkColor(ptr long) PSDRV_SetBkColor
|
||||
@ cdecl SetDeviceClipping(ptr) PSDRV_SetDeviceClipping
|
||||
@ cdecl SetPixel(ptr long long long) PSDRV_SetPixel
|
||||
|
|
|
@ -26,11 +26,13 @@ debug_channels (bitblt bitmap clipboard cursor dinput event font gdi graphics
|
|||
@ cdecl DescribePixelFormat(ptr long long ptr) X11DRV_DescribePixelFormat
|
||||
@ cdecl Ellipse(ptr long long long long) X11DRV_Ellipse
|
||||
@ cdecl EnumDeviceFonts(long ptr ptr long) X11DRV_EnumDeviceFonts
|
||||
@ cdecl ExtFloodFill(ptr long long long long) X11DRV_ExtFloodFill
|
||||
@ cdecl ExtEscape(ptr long long ptr long ptr) X11DRV_ExtEscape
|
||||
@ cdecl ExtFloodFill(ptr long long long long) X11DRV_ExtFloodFill
|
||||
@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr) X11DRV_ExtTextOut
|
||||
@ cdecl GetCharWidth(ptr long long ptr) X11DRV_GetCharWidth
|
||||
@ cdecl GetDCOrgEx(ptr ptr) X11DRV_GetDCOrgEx
|
||||
@ cdecl GetDIBColorTable(ptr long long ptr) X11DRV_GetDIBColorTable
|
||||
@ cdecl GetDIBits(ptr long long long ptr ptr long) X11DRV_GetDIBits
|
||||
@ cdecl GetDeviceCaps(ptr long) X11DRV_GetDeviceCaps
|
||||
@ cdecl GetDeviceGammaRamp(ptr ptr) X11DRV_GetDeviceGammaRamp
|
||||
@ cdecl GetPixel(ptr long long) X11DRV_GetPixel
|
||||
|
@ -47,8 +49,13 @@ debug_channels (bitblt bitmap clipboard cursor dinput event font gdi graphics
|
|||
@ cdecl Polyline(ptr ptr long) X11DRV_Polyline
|
||||
@ cdecl Rectangle(ptr long long long long) X11DRV_Rectangle
|
||||
@ cdecl RoundRect(ptr long long long long long long) X11DRV_RoundRect
|
||||
@ cdecl SelectObject(ptr long) X11DRV_SelectObject
|
||||
@ cdecl SelectBitmap(ptr long) X11DRV_SelectBitmap
|
||||
@ cdecl SelectBrush(ptr long) X11DRV_SelectBrush
|
||||
@ cdecl SelectFont(ptr long) X11DRV_SelectFont
|
||||
@ cdecl SelectPen(ptr long) X11DRV_SelectPen
|
||||
@ cdecl SetBkColor(ptr long) X11DRV_SetBkColor
|
||||
@ cdecl SetDIBColorTable(ptr long long ptr) X11DRV_SetDIBColorTable
|
||||
@ cdecl SetDIBits(ptr long long long ptr ptr long) X11DRV_SetDIBits
|
||||
@ cdecl SetDIBitsToDevice(ptr long long long long long long long long ptr ptr long) X11DRV_SetDIBitsToDevice
|
||||
@ cdecl SetDeviceClipping(ptr) X11DRV_SetDeviceClipping
|
||||
@ cdecl SetDeviceGammaRamp(ptr ptr) X11DRV_SetDeviceGammaRamp
|
||||
|
|
|
@ -301,16 +301,15 @@ void X11DRV_XRender_Finalize(void)
|
|||
/***********************************************************************
|
||||
* X11DRV_XRender_SelectFont
|
||||
*/
|
||||
BOOL X11DRV_XRender_SelectFont(DC *dc, HFONT hfont)
|
||||
BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
LFANDSIZE lfsz;
|
||||
|
||||
GetObjectW(hfont, sizeof(lfsz.lf), &lfsz.lf);
|
||||
TRACE("h=%ld w=%ld weight=%ld it=%d charset=%d name=%s\n",
|
||||
lfsz.lf.lfHeight, lfsz.lf.lfWidth, lfsz.lf.lfWeight,
|
||||
lfsz.lf.lfItalic, lfsz.lf.lfCharSet, debugstr_w(lfsz.lf.lfFaceName));
|
||||
lfsz.xform = dc->xformWorld2Vport;
|
||||
lfsz.xform = physDev->dc->xformWorld2Vport;
|
||||
lfsz_calc_hash(&lfsz);
|
||||
|
||||
if(!physDev->xrender)
|
||||
|
@ -326,10 +325,8 @@ BOOL X11DRV_XRender_SelectFont(DC *dc, HFONT hfont)
|
|||
/***********************************************************************
|
||||
* X11DRV_XRender_DeleteDC
|
||||
*/
|
||||
void X11DRV_XRender_DeleteDC(DC *dc)
|
||||
void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE *physDev)
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if(physDev->xrender->tile_pict)
|
||||
TSXRenderFreePicture(gdi_display, physDev->xrender->tile_pict);
|
||||
|
||||
|
@ -337,7 +334,7 @@ void X11DRV_XRender_DeleteDC(DC *dc)
|
|||
TSXFreePixmap(gdi_display, physDev->xrender->tile_xpm);
|
||||
|
||||
if(physDev->xrender->pict) {
|
||||
TRACE("freeing pict = %lx dc = %p\n", physDev->xrender->pict, dc);
|
||||
TRACE("freeing pict = %lx dc = %p\n", physDev->xrender->pict, physDev->dc);
|
||||
TSXRenderFreePicture(gdi_display, physDev->xrender->pict);
|
||||
}
|
||||
|
||||
|
@ -356,21 +353,18 @@ void X11DRV_XRender_DeleteDC(DC *dc)
|
|||
* drawable changes. However at the moment we delete the pict at the end of
|
||||
* every ExtTextOut so this is basically a NOP.
|
||||
*/
|
||||
void X11DRV_XRender_UpdateDrawable(DC *dc)
|
||||
void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev)
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if(physDev->xrender->pict) {
|
||||
TRACE("freeing pict %08lx from dc %p\n", physDev->xrender->pict, dc);
|
||||
TRACE("freeing pict %08lx from dc %p\n", physDev->xrender->pict, physDev->dc);
|
||||
TSXRenderFreePicture(gdi_display, physDev->xrender->pict);
|
||||
}
|
||||
physDev->xrender->pict = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static BOOL UploadGlyph(DC *dc, WCHAR glyph)
|
||||
static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, WCHAR glyph)
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
int buflen;
|
||||
char *buf;
|
||||
Glyph gid;
|
||||
|
@ -397,13 +391,13 @@ static BOOL UploadGlyph(DC *dc, WCHAR glyph)
|
|||
ggo_format = GGO_BITMAP;
|
||||
}
|
||||
|
||||
buflen = GetGlyphOutlineW(dc->hSelf, glyph, ggo_format, &gm, 0, NULL,
|
||||
buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL,
|
||||
NULL);
|
||||
if(buflen == GDI_ERROR)
|
||||
return FALSE;
|
||||
|
||||
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen);
|
||||
GetGlyphOutlineW(dc->hSelf, glyph, ggo_format, &gm, buflen, buf, NULL);
|
||||
GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, buflen, buf, NULL);
|
||||
|
||||
TRACE("buflen = %d. Got metrics: %dx%d adv=%d,%d origin=%ld,%ld\n",
|
||||
buflen,
|
||||
|
@ -477,14 +471,13 @@ static BOOL UploadGlyph(DC *dc, WCHAR glyph)
|
|||
/***********************************************************************
|
||||
* X11DRV_XRender_ExtTextOut
|
||||
*/
|
||||
BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||
BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR wstr, UINT count,
|
||||
const INT *lpDx )
|
||||
{
|
||||
XRenderColor col;
|
||||
int idx;
|
||||
TEXTMETRICW tm;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
RGNOBJ *obj;
|
||||
XRectangle *pXrect;
|
||||
SIZE sz;
|
||||
|
@ -495,22 +488,22 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
XGCValues xgcval;
|
||||
LOGFONTW lf;
|
||||
int render_op = PictOpOver;
|
||||
HDC hdc = physDev->hdc;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("%04x, %d, %d, %08x, %p, %s, %d, %p)\n", dc->hSelf, x, y, flags,
|
||||
TRACE("%04x, %d, %d, %08x, %p, %s, %d, %p)\n", hdc, x, y, flags,
|
||||
lprect, debugstr_wn(wstr, count), count, lpDx);
|
||||
if(lprect)
|
||||
TRACE("rect: %d,%d - %d,%d\n", lprect->left, lprect->top, lprect->right,
|
||||
lprect->bottom);
|
||||
TRACE("align = %x bkmode = %x mapmode = %x\n", dc->textAlign,
|
||||
dc->backgroundMode,
|
||||
dc->MapMode);
|
||||
TRACE("align = %x bkmode = %x mapmode = %x\n", dc->textAlign, GetBkMode(hdc), dc->MapMode);
|
||||
|
||||
if(dc->textAlign & TA_UPDATECP) {
|
||||
x = dc->CursPosX;
|
||||
y = dc->CursPosY;
|
||||
}
|
||||
|
||||
GetObjectW(GetCurrentObject(dc->hSelf, OBJ_FONT), sizeof(lf), &lf);
|
||||
GetObjectW(GetCurrentObject(hdc, OBJ_FONT), sizeof(lf), &lf);
|
||||
if(lf.lfEscapement != 0) {
|
||||
cosEsc = cos(lf.lfEscapement * M_PI / 1800);
|
||||
sinEsc = sin(lf.lfEscapement * M_PI / 1800);
|
||||
|
@ -522,7 +515,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
if(flags & (ETO_CLIPPED | ETO_OPAQUE)) {
|
||||
if(!lprect) {
|
||||
if(flags & ETO_CLIPPED) return FALSE;
|
||||
GetTextExtentPointW(dc->hSelf, wstr, count, &sz);
|
||||
GetTextExtentPointW(hdc, wstr, count, &sz);
|
||||
done_extents = TRUE;
|
||||
rc.left = x;
|
||||
rc.top = y;
|
||||
|
@ -547,7 +540,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
TSXChangeGC( gdi_display, physDev->gc,
|
||||
GCFunction | GCBackground | GCFillStyle, &xgcval );
|
||||
|
||||
X11DRV_LockDIBSection( dc, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_LockDIBSection( physDev, DIB_Status_GdiMod, FALSE );
|
||||
|
||||
if(flags & ETO_OPAQUE) {
|
||||
TSXSetForeground( gdi_display, physDev->gc, physDev->backgroundPixel );
|
||||
|
@ -557,7 +550,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
}
|
||||
|
||||
if(count == 0) {
|
||||
X11DRV_UnlockDIBSection( dc, TRUE );
|
||||
X11DRV_UnlockDIBSection( physDev, TRUE );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -572,7 +565,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
width += lpDx[idx];
|
||||
} else {
|
||||
if(!done_extents) {
|
||||
GetTextExtentPointW(dc->hSelf, wstr, count, &sz);
|
||||
GetTextExtentPointW(hdc, wstr, count, &sz);
|
||||
done_extents = TRUE;
|
||||
}
|
||||
width = sz.cx;
|
||||
|
@ -581,7 +574,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
xwidth = width * cosEsc;
|
||||
ywidth = width * sinEsc;
|
||||
|
||||
GetTextMetricsW(dc->hSelf, &tm);
|
||||
GetTextMetricsW(hdc, &tm);
|
||||
|
||||
switch( dc->textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER) ) {
|
||||
case TA_LEFT:
|
||||
|
@ -623,7 +616,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
|
||||
if (flags & ETO_CLIPPED)
|
||||
{
|
||||
SaveVisRgn16( dc->hSelf );
|
||||
SaveVisRgn16( hdc );
|
||||
CLIPPING_IntersectVisRect( dc, rc.left, rc.top, rc.right,
|
||||
rc.bottom, FALSE );
|
||||
}
|
||||
|
@ -691,7 +684,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
|
||||
GDI_ReleaseObj( dc->hGCClipRgn );
|
||||
|
||||
if(dc->backgroundMode != TRANSPARENT) {
|
||||
if(GetBkMode(hdc) != TRANSPARENT) {
|
||||
if(!((flags & ETO_CLIPPED) && (flags & ETO_OPAQUE))) {
|
||||
if(!(flags & ETO_OPAQUE) || x < rc.left || x + width >= rc.right ||
|
||||
y - tm.tmAscent < rc.top || y + tm.tmDescent >= rc.bottom) {
|
||||
|
@ -751,7 +744,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
for(idx = 0; idx < count; idx++) {
|
||||
if(wstr[idx] >= physDev->xrender->cacheEntry->nrealized ||
|
||||
physDev->xrender->cacheEntry->realized[wstr[idx]] == FALSE) {
|
||||
UploadGlyph(dc, wstr[idx]);
|
||||
UploadGlyph(physDev, wstr[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -764,7 +757,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
physDev->xrender->pict,
|
||||
physDev->xrender->cacheEntry->font_format,
|
||||
physDev->xrender->cacheEntry->glyphset,
|
||||
0, 0, dc->DCOrgX + x, dc->DCOrgY + y, wstr,
|
||||
0, 0, dc->DCOrgX + x, dc->DCOrgY + y, (unsigned short *)wstr,
|
||||
count);
|
||||
|
||||
else {
|
||||
|
@ -777,7 +770,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
physDev->xrender->cacheEntry->glyphset,
|
||||
0, 0, dc->DCOrgX + x + xoff,
|
||||
dc->DCOrgY + y + yoff,
|
||||
wstr + idx, 1);
|
||||
(unsigned short *)wstr + idx, 1);
|
||||
offset += INTERNAL_XWSTODS(dc, lpDx[idx]);
|
||||
xoff = offset * cosEsc;
|
||||
yoff = offset * sinEsc;
|
||||
|
@ -791,9 +784,9 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
|
||||
|
||||
if (flags & ETO_CLIPPED)
|
||||
RestoreVisRgn16( dc->hSelf );
|
||||
RestoreVisRgn16( hdc );
|
||||
|
||||
X11DRV_UnlockDIBSection( dc, TRUE );
|
||||
X11DRV_UnlockDIBSection( physDev, TRUE );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -811,19 +804,19 @@ void X11DRV_XRender_Finalize(void)
|
|||
return;
|
||||
}
|
||||
|
||||
BOOL X11DRV_XRender_SelectFont(DC *dc, HFONT hfont)
|
||||
BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
|
||||
{
|
||||
assert(0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void X11DRV_XRender_DeleteDC(DC *dc)
|
||||
void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE *physDev)
|
||||
{
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
|
||||
BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||
BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR wstr, UINT count,
|
||||
const INT *lpDx )
|
||||
{
|
||||
|
@ -831,7 +824,7 @@ BOOL X11DRV_XRender_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void X11DRV_XRender_UpdateDrawable(DC *dc)
|
||||
void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev)
|
||||
{
|
||||
assert(0);
|
||||
return;
|
||||
|
|
|
@ -365,7 +365,7 @@ BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp)
|
|||
* the stuff in graphics/x11drv/ has been moved to dlls/x11drv, so that
|
||||
* they can include xvidmode.h directly
|
||||
*/
|
||||
BOOL X11DRV_GetDeviceGammaRamp(DC *dc, LPVOID ramp)
|
||||
BOOL X11DRV_GetDeviceGammaRamp(X11DRV_PDEVICE *physDev, LPVOID ramp)
|
||||
{
|
||||
#ifdef HAVE_LIBXXF86VM
|
||||
return X11DRV_XF86VM_GetGammaRamp(ramp);
|
||||
|
@ -381,7 +381,7 @@ BOOL X11DRV_GetDeviceGammaRamp(DC *dc, LPVOID ramp)
|
|||
* the stuff in graphics/x11drv/ has been moved to dlls/x11drv, so that
|
||||
* they can include xvidmode.h directly
|
||||
*/
|
||||
BOOL X11DRV_SetDeviceGammaRamp(DC *dc, LPVOID ramp)
|
||||
BOOL X11DRV_SetDeviceGammaRamp(X11DRV_PDEVICE *physDev, LPVOID ramp)
|
||||
{
|
||||
#ifdef HAVE_LIBXXF86VM
|
||||
return X11DRV_XF86VM_SetGammaRamp(ramp);
|
||||
|
|
|
@ -48,7 +48,7 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top,
|
|||
if (dc->funcs->pPatBlt)
|
||||
{
|
||||
TRACE("%04x %d,%d %dx%d %06lx\n", hdc, left, top, width, height, rop );
|
||||
bRet = dc->funcs->pPatBlt( dc, left, top, width, height, rop );
|
||||
bRet = dc->funcs->pPatBlt( dc->physDev, left, top, width, height, rop );
|
||||
}
|
||||
GDI_ReleaseObj( hdc );
|
||||
return bRet;
|
||||
|
@ -84,8 +84,8 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
|
|||
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 );
|
||||
ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height,
|
||||
dcSrc->physDev, xSrc, ySrc, rop );
|
||||
if (dcSrc) GDI_ReleaseObj( hdcSrc );
|
||||
GDI_ReleaseObj( hdcDst );
|
||||
}
|
||||
|
@ -131,8 +131,9 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
|
|||
|
||||
if (dcSrc) {
|
||||
if (dcDst->funcs->pStretchBlt)
|
||||
ret = dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
|
||||
dcSrc, xSrc, ySrc, widthSrc, heightSrc, rop );
|
||||
ret = dcDst->funcs->pStretchBlt( dcDst->physDev, xDst, yDst, widthDst, heightDst,
|
||||
dcSrc->physDev, xSrc, ySrc, widthSrc, heightSrc,
|
||||
rop );
|
||||
GDI_ReleaseObj( hdcSrc );
|
||||
}
|
||||
GDI_ReleaseObj( hdcDst );
|
||||
|
|
|
@ -348,7 +348,7 @@ INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
|
|||
if (dc)
|
||||
{
|
||||
if (dc->funcs->pExtEscape)
|
||||
ret = dc->funcs->pExtEscape( dc, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
|
||||
ret = dc->funcs->pExtEscape( dc->physDev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -144,7 +144,7 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
|
|||
if (!dc) return 0;
|
||||
if (dc->funcs->pSetMapMode)
|
||||
{
|
||||
prevMode = dc->funcs->pSetMapMode( dc, mode );
|
||||
prevMode = dc->funcs->pSetMapMode( dc->physDev, mode );
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ BOOL WINAPI SetViewportExtEx( HDC hdc, INT x, INT y, LPSIZE size )
|
|||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pSetViewportExt)
|
||||
{
|
||||
ret = dc->funcs->pSetViewportExt( dc, x, y );
|
||||
ret = dc->funcs->pSetViewportExt( dc->physDev, x, y );
|
||||
goto done;
|
||||
}
|
||||
if (size)
|
||||
|
@ -297,7 +297,7 @@ BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
|
|||
DC * dc = DC_GetDCPtr( hdc );
|
||||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pSetViewportOrg)
|
||||
ret = dc->funcs->pSetViewportOrg( dc, x, y );
|
||||
ret = dc->funcs->pSetViewportOrg( dc->physDev, x, y );
|
||||
else
|
||||
{
|
||||
if (pt)
|
||||
|
@ -347,7 +347,7 @@ BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
|
|||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pSetWindowExt)
|
||||
{
|
||||
ret = dc->funcs->pSetWindowExt( dc, x, y );
|
||||
ret = dc->funcs->pSetWindowExt( dc->physDev, x, y );
|
||||
goto done;
|
||||
}
|
||||
if (size)
|
||||
|
@ -403,7 +403,7 @@ BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
|
|||
BOOL ret = TRUE;
|
||||
DC * dc = DC_GetDCPtr( hdc );
|
||||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pSetWindowOrg) ret = dc->funcs->pSetWindowOrg( dc, x, y );
|
||||
if (dc->funcs->pSetWindowOrg) ret = dc->funcs->pSetWindowOrg( dc->physDev, x, y );
|
||||
else
|
||||
{
|
||||
if (pt)
|
||||
|
@ -452,7 +452,7 @@ BOOL WINAPI OffsetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt)
|
|||
DC * dc = DC_GetDCPtr( hdc );
|
||||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pOffsetViewportOrg)
|
||||
ret = dc->funcs->pOffsetViewportOrg( dc, x, y );
|
||||
ret = dc->funcs->pOffsetViewportOrg( dc->physDev, x, y );
|
||||
else
|
||||
{
|
||||
if (pt)
|
||||
|
@ -501,7 +501,7 @@ BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
|
|||
DC * dc = DC_GetDCPtr( hdc );
|
||||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pOffsetWindowOrg)
|
||||
ret = dc->funcs->pOffsetWindowOrg( dc, x, y );
|
||||
ret = dc->funcs->pOffsetWindowOrg( dc->physDev, x, y );
|
||||
else
|
||||
{
|
||||
if (pt)
|
||||
|
@ -556,7 +556,7 @@ BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom,
|
|||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pScaleViewportExt)
|
||||
{
|
||||
ret = dc->funcs->pScaleViewportExt( dc, xNum, xDenom, yNum, yDenom );
|
||||
ret = dc->funcs->pScaleViewportExt( dc->physDev, xNum, xDenom, yNum, yDenom );
|
||||
goto done;
|
||||
}
|
||||
if (size)
|
||||
|
@ -621,7 +621,7 @@ BOOL WINAPI ScaleWindowExtEx( HDC hdc, INT xNum, INT xDenom,
|
|||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pScaleWindowExt)
|
||||
{
|
||||
ret = dc->funcs->pScaleWindowExt( dc, xNum, xDenom, yNum, yDenom );
|
||||
ret = dc->funcs->pScaleWindowExt( dc->physDev, xNum, xDenom, yNum, yDenom );
|
||||
goto done;
|
||||
}
|
||||
if (size)
|
||||
|
|
|
@ -57,7 +57,7 @@ BOOL WINAPI LineTo( HDC hdc, INT x, INT y )
|
|||
if(PATH_IsPathOpen(dc->path))
|
||||
ret = PATH_LineTo(dc, x, y);
|
||||
else
|
||||
ret = dc->funcs->pLineTo && dc->funcs->pLineTo(dc,x,y);
|
||||
ret = dc->funcs->pLineTo && dc->funcs->pLineTo(dc->physDev,x,y);
|
||||
if(ret) {
|
||||
dc->CursPosX = x;
|
||||
dc->CursPosY = y;
|
||||
|
@ -110,7 +110,7 @@ BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, LPPOINT pt )
|
|||
dc->CursPosY = y;
|
||||
|
||||
if(PATH_IsPathOpen(dc->path)) ret = PATH_MoveTo(dc);
|
||||
else if (dc->funcs->pMoveTo) ret = dc->funcs->pMoveTo(dc,x,y);
|
||||
else if (dc->funcs->pMoveTo) ret = dc->funcs->pMoveTo(dc->physDev,x,y);
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right,
|
|||
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);
|
||||
ret = dc->funcs->pArc(dc->physDev,left,top,right,bottom,xstart,ystart,xend,yend);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -164,7 +164,7 @@ BOOL WINAPI ArcTo( HDC hdc,
|
|||
|
||||
if(dc->funcs->pArcTo)
|
||||
{
|
||||
result = dc->funcs->pArcTo( dc, left, top, right, bottom,
|
||||
result = dc->funcs->pArcTo( dc->physDev, left, top, right, bottom,
|
||||
xstart, ystart, xend, yend );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return result;
|
||||
|
@ -215,7 +215,7 @@ BOOL WINAPI Pie( HDC hdc, INT left, INT top,
|
|||
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);
|
||||
ret = dc->funcs->pPie(dc->physDev,left,top,right,bottom,xstart,ystart,xend,yend);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
|
@ -247,7 +247,7 @@ BOOL WINAPI Chord( HDC hdc, INT left, INT top,
|
|||
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);
|
||||
ret = dc->funcs->pChord(dc->physDev,left,top,right,bottom,xstart,ystart,xend,yend);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
|
@ -277,7 +277,7 @@ BOOL WINAPI Ellipse( HDC hdc, INT left, INT top,
|
|||
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);
|
||||
ret = dc->funcs->pEllipse(dc->physDev,left,top,right,bottom);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
|
@ -307,7 +307,7 @@ BOOL WINAPI Rectangle( HDC hdc, INT left, INT top,
|
|||
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);
|
||||
ret = dc->funcs->pRectangle(dc->physDev,left,top,right,bottom);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -338,7 +338,7 @@ BOOL WINAPI RoundRect( HDC hdc, INT left, INT top, INT right,
|
|||
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);
|
||||
ret = dc->funcs->pRoundRect(dc->physDev,left,top,right,bottom,ell_width,ell_height);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -362,7 +362,7 @@ COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color )
|
|||
DC * dc = DC_GetDCUpdate( hdc );
|
||||
if (dc)
|
||||
{
|
||||
if (dc->funcs->pSetPixel) ret = dc->funcs->pSetPixel(dc,x,y,color);
|
||||
if (dc->funcs->pSetPixel) ret = dc->funcs->pSetPixel(dc->physDev,x,y,color);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -379,7 +379,7 @@ BOOL WINAPI SetPixelV( HDC hdc, INT x, INT y, COLORREF color )
|
|||
{
|
||||
if (dc->funcs->pSetPixel)
|
||||
{
|
||||
dc->funcs->pSetPixel(dc,x,y,color);
|
||||
dc->funcs->pSetPixel(dc->physDev,x,y,color);
|
||||
ret = TRUE;
|
||||
}
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
@ -409,7 +409,7 @@ COLORREF WINAPI GetPixel( HDC hdc, INT x, INT y )
|
|||
/* FIXME: should this be in the graphics driver? */
|
||||
if (PtVisible( hdc, x, y ))
|
||||
{
|
||||
if (dc->funcs->pGetPixel) ret = dc->funcs->pGetPixel(dc,x,y);
|
||||
if (dc->funcs->pGetPixel) ret = dc->funcs->pGetPixel(dc->physDev,x,y);
|
||||
}
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ INT WINAPI ChoosePixelFormat( HDC hdc, const LPPIXELFORMATDESCRIPTOR ppfd )
|
|||
if (!dc) return 0;
|
||||
|
||||
if (!dc->funcs->pChoosePixelFormat) FIXME(" :stub\n");
|
||||
else ret = dc->funcs->pChoosePixelFormat(dc,ppfd);
|
||||
else ret = dc->funcs->pChoosePixelFormat(dc->physDev,ppfd);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
|
@ -468,7 +468,7 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat,
|
|||
if (!dc) return 0;
|
||||
|
||||
if (!dc->funcs->pSetPixelFormat) FIXME(" :stub\n");
|
||||
else bRet = dc->funcs->pSetPixelFormat(dc,iPixelFormat,ppfd);
|
||||
else bRet = dc->funcs->pSetPixelFormat(dc->physDev,iPixelFormat,ppfd);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return bRet;
|
||||
|
@ -496,7 +496,7 @@ INT WINAPI GetPixelFormat( HDC hdc )
|
|||
if (!dc) return 0;
|
||||
|
||||
if (!dc->funcs->pGetPixelFormat) FIXME(" :stub\n");
|
||||
else ret = dc->funcs->pGetPixelFormat(dc);
|
||||
else ret = dc->funcs->pGetPixelFormat(dc->physDev);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
|
@ -534,7 +534,7 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes,
|
|||
ppfd->nVersion = 1;
|
||||
ret = 3;
|
||||
}
|
||||
else ret = dc->funcs->pDescribePixelFormat(dc,iPixelFormat,nBytes,ppfd);
|
||||
else ret = dc->funcs->pDescribePixelFormat(dc->physDev,iPixelFormat,nBytes,ppfd);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
|
@ -564,7 +564,7 @@ BOOL WINAPI SwapBuffers( HDC hdc )
|
|||
FIXME(" :stub\n");
|
||||
bRet = TRUE;
|
||||
}
|
||||
else bRet = dc->funcs->pSwapBuffers(dc);
|
||||
else bRet = dc->funcs->pSwapBuffers(dc->physDev);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return bRet;
|
||||
|
@ -589,7 +589,7 @@ BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn )
|
|||
DC * dc = DC_GetDCUpdate( hdc );
|
||||
if (dc)
|
||||
{
|
||||
if (dc->funcs->pPaintRgn) ret = dc->funcs->pPaintRgn(dc,hrgn);
|
||||
if (dc->funcs->pPaintRgn) ret = dc->funcs->pPaintRgn(dc->physDev,hrgn);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -616,7 +616,7 @@ BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush )
|
|||
|
||||
if (!dc) return FALSE;
|
||||
if(dc->funcs->pFillRgn)
|
||||
retval = dc->funcs->pFillRgn(dc, hrgn, hbrush);
|
||||
retval = dc->funcs->pFillRgn(dc->physDev, hrgn, hbrush);
|
||||
else if ((prevBrush = SelectObject( hdc, hbrush )))
|
||||
{
|
||||
retval = PaintRgn( hdc, hrgn );
|
||||
|
@ -648,7 +648,7 @@ BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush,
|
|||
|
||||
if (!dc) return FALSE;
|
||||
if(dc->funcs->pFrameRgn)
|
||||
ret = dc->funcs->pFrameRgn( dc, hrgn, hbrush, nWidth, nHeight );
|
||||
ret = dc->funcs->pFrameRgn( dc->physDev, hrgn, hbrush, nWidth, nHeight );
|
||||
else
|
||||
{
|
||||
HRGN tmp = CreateRectRgn( 0, 0, 0, 0 );
|
||||
|
@ -688,7 +688,7 @@ BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn )
|
|||
if (!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pInvertRgn)
|
||||
retval = dc->funcs->pInvertRgn( dc, hrgn );
|
||||
retval = dc->funcs->pInvertRgn( dc->physDev, hrgn );
|
||||
else
|
||||
{
|
||||
prevBrush = SelectObject( hdc, GetStockObject(BLACK_BRUSH) );
|
||||
|
@ -729,7 +729,7 @@ BOOL WINAPI Polyline( HDC hdc, const POINT* pt, INT count )
|
|||
if (dc)
|
||||
{
|
||||
if (PATH_IsPathOpen(dc->path)) ret = PATH_Polyline(dc, pt, count);
|
||||
else if (dc->funcs->pPolyline) ret = dc->funcs->pPolyline(dc,pt,count);
|
||||
else if (dc->funcs->pPolyline) ret = dc->funcs->pPolyline(dc->physDev,pt,count);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -749,7 +749,7 @@ BOOL WINAPI PolylineTo( HDC hdc, const POINT* pt, DWORD cCount )
|
|||
ret = PATH_PolylineTo(dc, pt, cCount);
|
||||
|
||||
else if(dc->funcs->pPolylineTo)
|
||||
ret = dc->funcs->pPolylineTo(dc, pt, cCount);
|
||||
ret = dc->funcs->pPolylineTo(dc->physDev, pt, cCount);
|
||||
|
||||
else { /* do it using Polyline */
|
||||
POINT *pts = HeapAlloc( GetProcessHeap(), 0,
|
||||
|
@ -799,7 +799,7 @@ BOOL WINAPI Polygon( HDC hdc, const POINT* pt, INT count )
|
|||
if (dc)
|
||||
{
|
||||
if (PATH_IsPathOpen(dc->path)) ret = PATH_Polygon(dc, pt, count);
|
||||
else if (dc->funcs->pPolygon) ret = dc->funcs->pPolygon(dc,pt,count);
|
||||
else if (dc->funcs->pPolygon) ret = dc->funcs->pPolygon(dc->physDev,pt,count);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -848,7 +848,7 @@ BOOL WINAPI PolyPolygon( HDC hdc, const POINT* pt, const INT* counts,
|
|||
if (dc)
|
||||
{
|
||||
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);
|
||||
else if (dc->funcs->pPolyPolygon) ret = dc->funcs->pPolyPolygon(dc->physDev,pt,counts,polygons);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -865,7 +865,7 @@ BOOL WINAPI PolyPolyline( HDC hdc, const POINT* pt, const DWORD* counts,
|
|||
if (dc)
|
||||
{
|
||||
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);
|
||||
else if (dc->funcs->pPolyPolyline) ret = dc->funcs->pPolyPolyline(dc->physDev,pt,counts,polylines);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -891,7 +891,7 @@ BOOL WINAPI ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color,
|
|||
DC * dc = DC_GetDCUpdate( hdc );
|
||||
if (dc)
|
||||
{
|
||||
if (dc->funcs->pExtFloodFill) ret = dc->funcs->pExtFloodFill(dc,x,y,color,fillType);
|
||||
if (dc->funcs->pExtFloodFill) ret = dc->funcs->pExtFloodFill(dc->physDev,x,y,color,fillType);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -969,7 +969,7 @@ BOOL WINAPI PolyBezier( HDC hdc, const POINT* lppt, DWORD cPoints )
|
|||
if(PATH_IsPathOpen(dc->path))
|
||||
ret = PATH_PolyBezier(dc, lppt, cPoints);
|
||||
else if (dc->funcs->pPolyBezier)
|
||||
ret = dc->funcs->pPolyBezier(dc, lppt, cPoints);
|
||||
ret = dc->funcs->pPolyBezier(dc->physDev, lppt, cPoints);
|
||||
else /* We'll convert it into line segments and draw them using Polyline */
|
||||
{
|
||||
POINT *Pts;
|
||||
|
@ -1008,7 +1008,7 @@ BOOL WINAPI PolyBezierTo( HDC hdc, const POINT* lppt, DWORD cPoints )
|
|||
if(PATH_IsPathOpen(dc->path))
|
||||
ret = PATH_PolyBezierTo(dc, lppt, cPoints);
|
||||
else if(dc->funcs->pPolyBezierTo)
|
||||
ret = dc->funcs->pPolyBezierTo(dc, lppt, cPoints);
|
||||
ret = dc->funcs->pPolyBezierTo(dc->physDev, lppt, cPoints);
|
||||
else { /* We'll do it using PolyBezier */
|
||||
POINT *pt;
|
||||
pt = HeapAlloc( GetProcessHeap(), 0, sizeof(POINT) * (cPoints + 1) );
|
||||
|
@ -1044,7 +1044,7 @@ BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, F
|
|||
|
||||
if(dc->funcs->pAngleArc)
|
||||
{
|
||||
result = dc->funcs->pAngleArc( dc, x, y, dwRadius, eStartAngle, eSweepAngle );
|
||||
result = dc->funcs->pAngleArc( dc->physDev, x, y, dwRadius, eStartAngle, eSweepAngle );
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return result;
|
||||
|
@ -1089,7 +1089,7 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
|
|||
|
||||
if(dc->funcs->pPolyDraw)
|
||||
{
|
||||
result = dc->funcs->pPolyDraw( dc, lppt, lpbTypes, cCount );
|
||||
result = dc->funcs->pPolyDraw( dc->physDev, lppt, lpbTypes, cCount );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ BOOL WINAPI BeginPath(HDC hdc)
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pBeginPath)
|
||||
ret = dc->funcs->pBeginPath(dc);
|
||||
ret = dc->funcs->pBeginPath(dc->physDev);
|
||||
else
|
||||
{
|
||||
/* If path is already open, do nothing */
|
||||
|
@ -154,7 +154,7 @@ BOOL WINAPI EndPath(HDC hdc)
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pEndPath)
|
||||
ret = dc->funcs->pEndPath(dc);
|
||||
ret = dc->funcs->pEndPath(dc->physDev);
|
||||
else
|
||||
{
|
||||
/* Check that path is currently being constructed */
|
||||
|
@ -200,7 +200,7 @@ BOOL WINAPI AbortPath( HDC hdc )
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pAbortPath)
|
||||
ret = dc->funcs->pAbortPath(dc);
|
||||
ret = dc->funcs->pAbortPath(dc->physDev);
|
||||
else /* Remove all entries from the path */
|
||||
PATH_EmptyPath( &dc->path );
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
@ -230,7 +230,7 @@ BOOL WINAPI CloseFigure(HDC hdc)
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pCloseFigure)
|
||||
ret = dc->funcs->pCloseFigure(dc);
|
||||
ret = dc->funcs->pCloseFigure(dc->physDev);
|
||||
else
|
||||
{
|
||||
/* Check that path is open */
|
||||
|
@ -366,7 +366,7 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath)
|
|||
HRGN hrgn;
|
||||
|
||||
if(dc->funcs->pFillPath)
|
||||
return dc->funcs->pFillPath(dc);
|
||||
return dc->funcs->pFillPath(dc->physDev);
|
||||
|
||||
/* Check that path is closed */
|
||||
if(pPath->state!=PATH_Closed)
|
||||
|
@ -448,7 +448,7 @@ BOOL WINAPI FillPath(HDC hdc)
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pFillPath)
|
||||
bRet = dc->funcs->pFillPath(dc);
|
||||
bRet = dc->funcs->pFillPath(dc->physDev);
|
||||
else
|
||||
{
|
||||
bRet = PATH_FillPath(dc, &dc->path);
|
||||
|
@ -486,7 +486,7 @@ BOOL WINAPI SelectClipPath(HDC hdc, INT iMode)
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pSelectClipPath)
|
||||
success = dc->funcs->pSelectClipPath(dc, iMode);
|
||||
success = dc->funcs->pSelectClipPath(dc->physDev, iMode);
|
||||
else
|
||||
{
|
||||
pPath = &dc->path;
|
||||
|
@ -1464,7 +1464,7 @@ BOOL WINAPI FlattenPath(HDC hdc)
|
|||
|
||||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pFlattenPath) ret = dc->funcs->pFlattenPath(dc);
|
||||
if(dc->funcs->pFlattenPath) ret = dc->funcs->pFlattenPath(dc->physDev);
|
||||
else
|
||||
{
|
||||
GdiPath *pPath = &dc->path;
|
||||
|
@ -1487,7 +1487,7 @@ static BOOL PATH_StrokePath(DC *dc, GdiPath *pPath)
|
|||
BOOL ret = TRUE;
|
||||
|
||||
if(dc->funcs->pStrokePath)
|
||||
return dc->funcs->pStrokePath(dc);
|
||||
return dc->funcs->pStrokePath(dc->physDev);
|
||||
|
||||
if(pPath->state != PATH_Closed)
|
||||
return FALSE;
|
||||
|
@ -1581,7 +1581,7 @@ BOOL WINAPI StrokeAndFillPath(HDC hdc)
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pStrokeAndFillPath)
|
||||
bRet = dc->funcs->pStrokeAndFillPath(dc);
|
||||
bRet = dc->funcs->pStrokeAndFillPath(dc->physDev);
|
||||
else
|
||||
{
|
||||
bRet = PATH_FillPath(dc, &dc->path);
|
||||
|
@ -1617,7 +1617,7 @@ BOOL WINAPI StrokePath(HDC hdc)
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pStrokePath)
|
||||
bRet = dc->funcs->pStrokePath(dc);
|
||||
bRet = dc->funcs->pStrokePath(dc->physDev);
|
||||
else
|
||||
{
|
||||
pPath = &dc->path;
|
||||
|
@ -1651,7 +1651,7 @@ BOOL WINAPI WidenPath(HDC hdc)
|
|||
if(!dc) return FALSE;
|
||||
|
||||
if(dc->funcs->pWidenPath)
|
||||
ret = dc->funcs->pWidenPath(dc);
|
||||
ret = dc->funcs->pWidenPath(dc->physDev);
|
||||
|
||||
FIXME("stub\n");
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
|
|
@ -856,7 +856,7 @@ static void BITBLT_StretchImage( XImage *srcImage, XImage *dstImage,
|
|||
* Retrieve an area from the source DC, stretching and mapping all the
|
||||
* pixels to Windows colors.
|
||||
*/
|
||||
static int BITBLT_GetSrcAreaStretch( DC *dcSrc, DC *dcDst,
|
||||
static int BITBLT_GetSrcAreaStretch( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
|
||||
Pixmap pixmap, GC gc,
|
||||
INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc,
|
||||
|
@ -865,8 +865,7 @@ static int BITBLT_GetSrcAreaStretch( DC *dcSrc, DC *dcDst,
|
|||
RECT *visRectSrc, RECT *visRectDst )
|
||||
{
|
||||
XImage *imageSrc, *imageDst;
|
||||
X11DRV_PDEVICE *physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev;
|
||||
X11DRV_PDEVICE *physDevDst = (X11DRV_PDEVICE *)dcDst->physDev;
|
||||
DC *dcDst = physDevDst->dc;
|
||||
|
||||
RECT rectSrc = *visRectSrc;
|
||||
RECT rectDst = *visRectDst;
|
||||
|
@ -912,16 +911,16 @@ static int BITBLT_GetSrcAreaStretch( DC *dcSrc, DC *dcDst,
|
|||
* Retrieve an area from the source DC, mapping all the
|
||||
* pixels to Windows colors.
|
||||
*/
|
||||
static int BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
|
||||
INT xSrc, INT ySrc, RECT *visRectSrc )
|
||||
static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
|
||||
Pixmap pixmap, GC gc, INT xSrc, INT ySrc, RECT *visRectSrc )
|
||||
{
|
||||
XImage *imageSrc, *imageDst;
|
||||
register INT x, y;
|
||||
int exposures = 0;
|
||||
INT width = visRectSrc->right - visRectSrc->left;
|
||||
INT height = visRectSrc->bottom - visRectSrc->top;
|
||||
X11DRV_PDEVICE *physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev;
|
||||
X11DRV_PDEVICE *physDevDst = (X11DRV_PDEVICE *)dcDst->physDev;
|
||||
DC *dcSrc = physDevSrc->dc;
|
||||
DC *dcDst = physDevDst->dc;
|
||||
|
||||
if (dcSrc->bitsPerPixel == dcDst->bitsPerPixel)
|
||||
{
|
||||
|
@ -1018,14 +1017,13 @@ static int BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
|
|||
* Retrieve an area from the destination DC, mapping all the
|
||||
* pixels to Windows colors.
|
||||
*/
|
||||
static int BITBLT_GetDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
|
||||
static int BITBLT_GetDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, GC gc, RECT *visRectDst)
|
||||
{
|
||||
int exposures = 0;
|
||||
INT width = visRectDst->right - visRectDst->left;
|
||||
INT height = visRectDst->bottom - visRectDst->top;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if (!X11DRV_PALETTE_XPixelToPalette || (dc->bitsPerPixel == 1) ||
|
||||
if (!X11DRV_PALETTE_XPixelToPalette || (physDev->dc->bitsPerPixel == 1) ||
|
||||
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
|
||||
{
|
||||
XCopyArea( gdi_display, physDev->drawable, pixmap, gc,
|
||||
|
@ -1037,7 +1035,7 @@ static int BITBLT_GetDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
|
|||
register INT x, y;
|
||||
XImage *image;
|
||||
|
||||
if (dc->flags & DC_MEMORY)
|
||||
if (physDev->dc->flags & DC_MEMORY)
|
||||
image = XGetImage( gdi_display, physDev->drawable,
|
||||
visRectDst->left, visRectDst->top,
|
||||
width, height, AllPlanes, ZPixmap );
|
||||
|
@ -1067,19 +1065,18 @@ static int BITBLT_GetDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
|
|||
* Put an area back into the destination DC, mapping the pixel
|
||||
* colors to X pixels.
|
||||
*/
|
||||
static int BITBLT_PutDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
|
||||
static int BITBLT_PutDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, RECT *visRectDst)
|
||||
{
|
||||
int exposures = 0;
|
||||
INT width = visRectDst->right - visRectDst->left;
|
||||
INT height = visRectDst->bottom - visRectDst->top;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
/* !X11DRV_PALETTE_PaletteToXPixel is _NOT_ enough */
|
||||
|
||||
if (!X11DRV_PALETTE_PaletteToXPixel || (dc->bitsPerPixel == 1) ||
|
||||
if (!X11DRV_PALETTE_PaletteToXPixel || (physDev->dc->bitsPerPixel == 1) ||
|
||||
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
|
||||
{
|
||||
XCopyArea( gdi_display, pixmap, physDev->drawable, gc, 0, 0,
|
||||
XCopyArea( gdi_display, pixmap, physDev->drawable, physDev->gc, 0, 0,
|
||||
width, height, visRectDst->left, visRectDst->top );
|
||||
exposures++;
|
||||
}
|
||||
|
@ -1094,7 +1091,7 @@ static int BITBLT_PutDstArea(DC *dc, Pixmap pixmap, GC gc, RECT *visRectDst)
|
|||
XPutPixel( image, x, y,
|
||||
X11DRV_PALETTE_PaletteToXPixel[XGetPixel( image, x, y )]);
|
||||
}
|
||||
XPutImage( gdi_display, physDev->drawable, gc, image, 0, 0,
|
||||
XPutImage( gdi_display, physDev->drawable, physDev->gc, image, 0, 0,
|
||||
visRectDst->left, visRectDst->top, width, height );
|
||||
XDestroyImage( image );
|
||||
}
|
||||
|
@ -1198,9 +1195,9 @@ static BOOL BITBLT_GetVisRectangles( DC *dcDst, INT xDst, INT yDst,
|
|||
*
|
||||
* Implementation of PatBlt(), BitBlt() and StretchBlt().
|
||||
*/
|
||||
static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
||||
static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst,
|
||||
DC *dcSrc, INT xSrc, INT ySrc,
|
||||
X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc,
|
||||
DWORD rop )
|
||||
{
|
||||
|
@ -1210,8 +1207,8 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
const BYTE *opcode;
|
||||
Pixmap pixmaps[3] = { 0, 0, 0 }; /* pixmaps for DST, SRC, TMP */
|
||||
GC tmpGC = 0;
|
||||
X11DRV_PDEVICE *physDevSrc = NULL;
|
||||
X11DRV_PDEVICE *physDevDst = (X11DRV_PDEVICE *)dcDst->physDev;
|
||||
DC *dcSrc = physDevSrc ? physDevSrc->dc : NULL;
|
||||
DC *dcDst = physDevDst->dc;
|
||||
|
||||
/* compensate for off-by-one shifting for negative widths and heights */
|
||||
if (widthDst < 0)
|
||||
|
@ -1223,7 +1220,6 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
if (heightSrc < 0)
|
||||
++ySrc;
|
||||
|
||||
if(dcSrc) physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev;
|
||||
usePat = (((rop >> 4) & 0x0f0000) != (rop & 0x0f0000));
|
||||
useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000));
|
||||
useDst = (((rop >> 1) & 0x550000) != (rop & 0x550000));
|
||||
|
@ -1332,7 +1328,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
|
||||
case PATINVERT: /* 0x5a */
|
||||
if (perfect_graphics()) break;
|
||||
if (X11DRV_SetupGCForBrush( dcDst ))
|
||||
if (X11DRV_SetupGCForBrush( physDevDst ))
|
||||
{
|
||||
wine_tsx11_lock();
|
||||
XSetFunction( gdi_display, physDevDst->gc, GXxor );
|
||||
|
@ -1344,7 +1340,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
|
||||
case 0xa50065:
|
||||
if (perfect_graphics()) break;
|
||||
if (X11DRV_SetupGCForBrush( dcDst ))
|
||||
if (X11DRV_SetupGCForBrush( physDevDst ))
|
||||
{
|
||||
wine_tsx11_lock();
|
||||
XSetFunction( gdi_display, physDevDst->gc, GXequiv );
|
||||
|
@ -1384,7 +1380,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
break;
|
||||
|
||||
case PATCOPY: /* 0xf0 */
|
||||
if (!X11DRV_SetupGCForBrush( dcDst )) return TRUE;
|
||||
if (!X11DRV_SetupGCForBrush( physDevDst )) return TRUE;
|
||||
wine_tsx11_lock();
|
||||
XSetFunction( gdi_display, physDevDst->gc, GXcopy );
|
||||
XFillRectangle( gdi_display, physDevDst->drawable, physDevDst->gc,
|
||||
|
@ -1421,17 +1417,17 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
pixmaps[SRC] = XCreatePixmap( gdi_display, root_window, width, height,
|
||||
dcDst->bitsPerPixel );
|
||||
if (fStretch)
|
||||
BITBLT_GetSrcAreaStretch( dcSrc, dcDst, pixmaps[SRC], tmpGC,
|
||||
BITBLT_GetSrcAreaStretch( physDevSrc, physDevDst, pixmaps[SRC], tmpGC,
|
||||
xSrc, ySrc, widthSrc, heightSrc,
|
||||
xDst, yDst, widthDst, heightDst,
|
||||
&visRectSrc, &visRectDst );
|
||||
else
|
||||
BITBLT_GetSrcArea( dcSrc, dcDst, pixmaps[SRC], tmpGC,
|
||||
BITBLT_GetSrcArea( physDevSrc, physDevDst, pixmaps[SRC], tmpGC,
|
||||
xSrc, ySrc, &visRectSrc );
|
||||
}
|
||||
|
||||
if (useDst) BITBLT_GetDstArea( dcDst, pixmaps[DST], tmpGC, &visRectDst );
|
||||
if (usePat) fNullBrush = !X11DRV_SetupGCForPatBlt( dcDst, tmpGC, TRUE );
|
||||
if (useDst) BITBLT_GetDstArea( physDevDst, pixmaps[DST], tmpGC, &visRectDst );
|
||||
if (usePat) fNullBrush = !X11DRV_SetupGCForPatBlt( physDevDst, tmpGC, TRUE );
|
||||
else fNullBrush = FALSE;
|
||||
destUsed = FALSE;
|
||||
|
||||
|
@ -1472,8 +1468,8 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
}
|
||||
}
|
||||
XSetFunction( gdi_display, physDevDst->gc, GXcopy );
|
||||
physDevDst->exposures += BITBLT_PutDstArea( dcDst, pixmaps[destUsed ? DST : SRC],
|
||||
physDevDst->gc, &visRectDst );
|
||||
physDevDst->exposures += BITBLT_PutDstArea( physDevDst, pixmaps[destUsed ? DST : SRC],
|
||||
&visRectDst );
|
||||
XFreePixmap( gdi_display, pixmaps[DST] );
|
||||
if (pixmaps[SRC]) XFreePixmap( gdi_display, pixmaps[SRC] );
|
||||
if (pixmaps[TMP]) XFreePixmap( gdi_display, pixmaps[TMP] );
|
||||
|
@ -1486,14 +1482,13 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
/***********************************************************************
|
||||
* X11DRV_PatBlt
|
||||
*/
|
||||
BOOL X11DRV_PatBlt( DC *dc, INT left, INT top,
|
||||
INT width, INT height, DWORD rop )
|
||||
BOOL X11DRV_PatBlt( X11DRV_PDEVICE *physDev, INT left, INT top, INT width, INT height, DWORD rop )
|
||||
{
|
||||
BOOL result;
|
||||
|
||||
X11DRV_LockDIBSection( dc, DIB_Status_GdiMod, FALSE );
|
||||
result = BITBLT_InternalStretchBlt( dc, left, top, width, height, NULL, 0, 0, 0, 0, rop );
|
||||
X11DRV_UnlockDIBSection( dc, TRUE );
|
||||
X11DRV_LockDIBSection( physDev, DIB_Status_GdiMod, FALSE );
|
||||
result = BITBLT_InternalStretchBlt( physDev, left, top, width, height, NULL, 0, 0, 0, 0, rop );
|
||||
X11DRV_UnlockDIBSection( physDev, TRUE );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1501,13 +1496,15 @@ BOOL X11DRV_PatBlt( DC *dc, INT left, INT top,
|
|||
/***********************************************************************
|
||||
* X11DRV_BitBlt
|
||||
*/
|
||||
BOOL X11DRV_BitBlt( DC *dcDst, INT xDst, INT yDst,
|
||||
INT width, INT height, DC *dcSrc,
|
||||
BOOL X11DRV_BitBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
||||
INT width, INT height, X11DRV_PDEVICE *physDevSrc,
|
||||
INT xSrc, INT ySrc, DWORD rop )
|
||||
{
|
||||
BOOL result = FALSE;
|
||||
INT sSrc, sDst;
|
||||
RECT visRectDst, visRectSrc;
|
||||
DC *dcSrc = physDevSrc->dc;
|
||||
DC *dcDst = physDevDst->dc;
|
||||
|
||||
if (((rop >> 16) & 0x55) == ((rop >> 17) & 0x55)) {
|
||||
/* FIXME: seems the ROP doesn't include destination;
|
||||
|
@ -1515,8 +1512,8 @@ BOOL X11DRV_BitBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
* we can pass TRUE instead of FALSE to CoerceDIBSection(dcDst...),
|
||||
* which may avoid a copy in some situations */
|
||||
}
|
||||
sDst = X11DRV_LockDIBSection( dcDst, DIB_Status_None, FALSE );
|
||||
sSrc = X11DRV_LockDIBSection( dcSrc, DIB_Status_None, FALSE );
|
||||
sDst = X11DRV_LockDIBSection( physDevDst, DIB_Status_None, FALSE );
|
||||
sSrc = X11DRV_LockDIBSection( physDevSrc, DIB_Status_None, FALSE );
|
||||
|
||||
if ((sSrc == DIB_Status_AppMod) && (rop == SRCCOPY) &&
|
||||
(dcSrc->bitsPerPixel == dcDst->bitsPerPixel))
|
||||
|
@ -1545,22 +1542,22 @@ BOOL X11DRV_BitBlt( DC *dcDst, INT xDst, INT yDst,
|
|||
if (sDst == DIB_Status_AppMod) {
|
||||
FIXME("potential optimization - client-side DIB copy\n");
|
||||
}
|
||||
X11DRV_CoerceDIBSection( dcDst, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_CoerceDIBSection( physDevDst, DIB_Status_GdiMod, FALSE );
|
||||
|
||||
X11DRV_DIB_CopyDIBSection( dcSrc, dcDst, xSrc, ySrc, xDst, yDst, width, height );
|
||||
X11DRV_DIB_CopyDIBSection( physDevSrc, physDevDst, xSrc, ySrc, xDst, yDst, width, height );
|
||||
result = TRUE;
|
||||
goto END;
|
||||
}
|
||||
|
||||
X11DRV_CoerceDIBSection( dcDst, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_CoerceDIBSection( dcSrc, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_CoerceDIBSection( physDevDst, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_CoerceDIBSection( physDevSrc, DIB_Status_GdiMod, FALSE );
|
||||
|
||||
result = BITBLT_InternalStretchBlt( dcDst, xDst, yDst, width, height,
|
||||
dcSrc, xSrc, ySrc, width, height, rop );
|
||||
result = BITBLT_InternalStretchBlt( physDevDst, xDst, yDst, width, height,
|
||||
physDevSrc, xSrc, ySrc, width, height, rop );
|
||||
|
||||
END:
|
||||
X11DRV_UnlockDIBSection( dcSrc, FALSE );
|
||||
X11DRV_UnlockDIBSection( dcDst, TRUE );
|
||||
X11DRV_UnlockDIBSection( physDevSrc, FALSE );
|
||||
X11DRV_UnlockDIBSection( physDevDst, TRUE );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -1569,21 +1566,21 @@ END:
|
|||
/***********************************************************************
|
||||
* X11DRV_StretchBlt
|
||||
*/
|
||||
BOOL X11DRV_StretchBlt( DC *dcDst, INT xDst, INT yDst,
|
||||
BOOL X11DRV_StretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst,
|
||||
DC *dcSrc, INT xSrc, INT ySrc,
|
||||
X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, DWORD rop )
|
||||
{
|
||||
BOOL result;
|
||||
|
||||
X11DRV_LockDIBSection( dcDst, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_LockDIBSection( dcSrc, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_LockDIBSection( physDevDst, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_LockDIBSection( physDevSrc, DIB_Status_GdiMod, FALSE );
|
||||
|
||||
result = BITBLT_InternalStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
|
||||
dcSrc, xSrc, ySrc, widthSrc, heightSrc, rop );
|
||||
result = BITBLT_InternalStretchBlt( physDevDst, xDst, yDst, widthDst, heightDst,
|
||||
physDevSrc, xSrc, ySrc, widthSrc, heightSrc, rop );
|
||||
|
||||
X11DRV_UnlockDIBSection( dcSrc, FALSE );
|
||||
X11DRV_UnlockDIBSection( dcDst, TRUE );
|
||||
X11DRV_UnlockDIBSection( physDevSrc, FALSE );
|
||||
X11DRV_UnlockDIBSection( physDevDst, TRUE );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,14 +74,13 @@ BOOL X11DRV_BITMAP_Init(void)
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_BITMAP_SelectObject
|
||||
* X11DRV_SelectBitmap (X11DRV.@)
|
||||
*/
|
||||
HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap )
|
||||
HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
|
||||
{
|
||||
BITMAPOBJ *bmp;
|
||||
HRGN hrgn;
|
||||
HBITMAP prevHandle = dc->hBitmap;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (!(dc->flags & DC_MEMORY)) return 0;
|
||||
if (hbitmap == dc->hBitmap) return hbitmap; /* nothing to do */
|
||||
|
@ -141,7 +140,7 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap )
|
|||
DC_InitDC( dc );
|
||||
}
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
return prevHandle;
|
||||
return hbitmap;
|
||||
}
|
||||
|
||||
|
||||
|
@ -481,6 +480,7 @@ BOOL X11DRV_BITMAP_DeleteObject( HBITMAP hbitmap )
|
|||
TSXFreePixmap( gdi_display, (Pixmap)bmp->physBitmap );
|
||||
bmp->physBitmap = NULL;
|
||||
bmp->funcs = NULL;
|
||||
if (bmp->dib) X11DRV_DIB_DeleteDIBSection( bmp );
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -154,9 +154,9 @@ static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
|
|||
/***********************************************************************
|
||||
* BRUSH_SelectSolidBrush
|
||||
*/
|
||||
static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
|
||||
static void BRUSH_SelectSolidBrush( X11DRV_PDEVICE *physDev, COLORREF color )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if ((dc->bitsPerPixel > 1) && (screen_depth <= 8) && !COLOR_IsSolid( color ))
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
|
|||
else
|
||||
{
|
||||
/* Solid brush */
|
||||
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( dc, color );
|
||||
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( physDev, color );
|
||||
physDev->brush.fillStyle = FillSolid;
|
||||
}
|
||||
}
|
||||
|
@ -177,10 +177,10 @@ static void BRUSH_SelectSolidBrush( DC *dc, COLORREF color )
|
|||
/***********************************************************************
|
||||
* BRUSH_SelectPatternBrush
|
||||
*/
|
||||
static BOOL BRUSH_SelectPatternBrush( DC * dc, HBITMAP hbitmap )
|
||||
static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
BITMAPOBJ * bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
|
||||
if (!bmp) return FALSE;
|
||||
|
||||
|
@ -229,21 +229,17 @@ static BOOL BRUSH_SelectPatternBrush( DC * dc, HBITMAP hbitmap )
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* BRUSH_SelectObject
|
||||
* X11DRV_SelectBrush (X11DRV.@)
|
||||
*/
|
||||
HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
||||
HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush )
|
||||
{
|
||||
LOGBRUSH logbrush;
|
||||
HBITMAP16 hBitmap;
|
||||
BITMAPINFO * bmpInfo;
|
||||
HBRUSH16 prevHandle = dc->hBrush;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
if (!GetObjectA( hbrush, sizeof(logbrush), &logbrush )) return 0;
|
||||
|
||||
TRACE("hdc=%04x hbrush=%04x\n", dc->hSelf,hbrush);
|
||||
|
||||
dc->hBrush = hbrush;
|
||||
TRACE("hdc=%04x hbrush=%04x\n", physDev->hdc,hbrush);
|
||||
|
||||
if (physDev->brush.pixmap)
|
||||
{
|
||||
|
@ -260,12 +256,12 @@ HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
|||
|
||||
case BS_SOLID:
|
||||
TRACE("BS_SOLID\n" );
|
||||
BRUSH_SelectSolidBrush( dc, logbrush.lbColor );
|
||||
BRUSH_SelectSolidBrush( physDev, logbrush.lbColor );
|
||||
break;
|
||||
|
||||
case BS_HATCHED:
|
||||
TRACE("BS_HATCHED\n" );
|
||||
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( dc, logbrush.lbColor );
|
||||
physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( physDev, logbrush.lbColor );
|
||||
physDev->brush.pixmap = TSXCreateBitmapFromData( gdi_display, root_window,
|
||||
HatchBrushes[logbrush.lbHatch], 8, 8 );
|
||||
physDev->brush.fillStyle = FillStippled;
|
||||
|
@ -273,7 +269,7 @@ HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
|||
|
||||
case BS_PATTERN:
|
||||
TRACE("BS_PATTERN\n");
|
||||
BRUSH_SelectPatternBrush( dc, (HBRUSH16)logbrush.lbHatch );
|
||||
BRUSH_SelectPatternBrush( physDev, (HBRUSH16)logbrush.lbHatch );
|
||||
break;
|
||||
|
||||
case BS_DIBPATTERN:
|
||||
|
@ -281,17 +277,16 @@ HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
|||
if ((bmpInfo = (BITMAPINFO *) GlobalLock16( (HGLOBAL16)logbrush.lbHatch )))
|
||||
{
|
||||
int size = DIB_BitmapInfoSize( bmpInfo, logbrush.lbColor );
|
||||
hBitmap = CreateDIBitmap( dc->hSelf, &bmpInfo->bmiHeader,
|
||||
hBitmap = CreateDIBitmap( physDev->hdc, &bmpInfo->bmiHeader,
|
||||
CBM_INIT, ((char *)bmpInfo) + size,
|
||||
bmpInfo,
|
||||
(WORD)logbrush.lbColor );
|
||||
BRUSH_SelectPatternBrush( dc, hBitmap );
|
||||
BRUSH_SelectPatternBrush( physDev, hBitmap );
|
||||
DeleteObject( hBitmap );
|
||||
GlobalUnlock16( (HGLOBAL16)logbrush.lbHatch );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return prevHandle;
|
||||
return hbrush;
|
||||
}
|
||||
|
|
|
@ -38,10 +38,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
|
|||
*
|
||||
* Could write using GetRegionData but this would be slower.
|
||||
*/
|
||||
void X11DRV_SetDeviceClipping( DC * dc )
|
||||
void X11DRV_SetDeviceClipping( X11DRV_PDEVICE *physDev )
|
||||
{
|
||||
XRectangle *pXrect;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr(dc->hGCClipRgn, REGION_MAGIC);
|
||||
if (!obj)
|
||||
|
@ -96,7 +96,7 @@ void X11DRV_SetDrawable( HDC hdc, Drawable drawable, int mode, int org_x, int or
|
|||
DC *dc = DC_GetDCPtr( hdc );
|
||||
if (dc)
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = dc->physDev;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
/*
|
||||
* This function change the coordinate system (DCOrgX,DCOrgY)
|
||||
* values. When it moves the origin, other data like the current clipping
|
||||
|
@ -114,7 +114,7 @@ void X11DRV_SetDrawable( HDC hdc, Drawable drawable, int mode, int org_x, int or
|
|||
physDev->drawable = drawable;
|
||||
TSXSetSubwindowMode( gdi_display, physDev->gc, mode );
|
||||
if(physDev->xrender)
|
||||
X11DRV_XRender_UpdateDrawable(dc);
|
||||
X11DRV_XRender_UpdateDrawable( physDev );
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ void X11DRV_StartGraphicsExposures( HDC hdc )
|
|||
DC *dc = DC_GetDCPtr( hdc );
|
||||
if (dc)
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = dc->physDev;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
TSXSetGraphicsExposures( gdi_display, physDev->gc, True );
|
||||
physDev->exposures = 0;
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
@ -151,7 +151,7 @@ void X11DRV_EndGraphicsExposures( HDC hdc, HRGN hrgn )
|
|||
if (dc)
|
||||
{
|
||||
XEvent event;
|
||||
X11DRV_PDEVICE *physDev = dc->physDev;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
SetRectRgn( hrgn, 0, 0, 0, 0 );
|
||||
wine_tsx11_lock();
|
||||
|
|
|
@ -54,7 +54,7 @@ static int XShmErrorFlag = 0;
|
|||
/* This structure holds the arguments for DIB_SetImageBits() */
|
||||
typedef struct
|
||||
{
|
||||
struct tagDC *dc;
|
||||
X11DRV_PDEVICE *physDev;
|
||||
LPCVOID bits;
|
||||
XImage *image;
|
||||
PALETTEENTRY *palentry;
|
||||
|
@ -143,7 +143,7 @@ XImage *X11DRV_DIB_CreateXImage( int width, int height, int depth )
|
|||
* Fills the color map of a bitmap palette. Should not be called
|
||||
* for a >8-bit deep bitmap.
|
||||
*/
|
||||
int *X11DRV_DIB_GenColorMap( DC *dc, int *colorMapping,
|
||||
int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
|
||||
WORD coloruse, WORD depth, BOOL quads,
|
||||
const void *colorPtr, int start, int end )
|
||||
{
|
||||
|
@ -165,7 +165,7 @@ int *X11DRV_DIB_GenColorMap( DC *dc, int *colorMapping,
|
|||
rgb->rgbBlue > 255*3/2);
|
||||
else
|
||||
for (i = start; i < end; i++, rgb++)
|
||||
colorMapping[i] = X11DRV_PALETTE_ToPhysical( dc, RGB(rgb->rgbRed,
|
||||
colorMapping[i] = X11DRV_PALETTE_ToPhysical( physDev, RGB(rgb->rgbRed,
|
||||
rgb->rgbGreen,
|
||||
rgb->rgbBlue));
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ int *X11DRV_DIB_GenColorMap( DC *dc, int *colorMapping,
|
|||
rgb->rgbtBlue > 255*3/2);
|
||||
else
|
||||
for (i = start; i < end; i++, rgb++)
|
||||
colorMapping[i] = X11DRV_PALETTE_ToPhysical( dc, RGB(rgb->rgbtRed,
|
||||
colorMapping[i] = X11DRV_PALETTE_ToPhysical( physDev, RGB(rgb->rgbtRed,
|
||||
rgb->rgbtGreen,
|
||||
rgb->rgbtBlue));
|
||||
}
|
||||
|
@ -190,10 +190,10 @@ int *X11DRV_DIB_GenColorMap( DC *dc, int *colorMapping,
|
|||
WORD * index = (WORD *)colorPtr;
|
||||
|
||||
for (i = start; i < end; i++, index++)
|
||||
colorMapping[i] = X11DRV_PALETTE_ToPhysical( dc, PALETTEINDEX(*index) );
|
||||
colorMapping[i] = X11DRV_PALETTE_ToPhysical( physDev, PALETTEINDEX(*index) );
|
||||
} else {
|
||||
for (i = start; i < end; i++)
|
||||
colorMapping[i] = X11DRV_PALETTE_ToPhysical( dc, PALETTEINDEX(i) );
|
||||
colorMapping[i] = X11DRV_PALETTE_ToPhysical( physDev, PALETTEINDEX(i) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ int *X11DRV_DIB_GenColorMap( DC *dc, int *colorMapping,
|
|||
* Build the color map from the bitmap palette. Should not be called
|
||||
* for a >8-bit deep bitmap.
|
||||
*/
|
||||
int *X11DRV_DIB_BuildColorMap( DC *dc, WORD coloruse, WORD depth,
|
||||
int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse, WORD depth,
|
||||
const BITMAPINFO *info, int *nColors )
|
||||
{
|
||||
int colors;
|
||||
|
@ -240,7 +240,7 @@ int *X11DRV_DIB_BuildColorMap( DC *dc, WORD coloruse, WORD depth,
|
|||
return NULL;
|
||||
|
||||
*nColors = colors;
|
||||
return X11DRV_DIB_GenColorMap( dc, colorMapping, coloruse, depth,
|
||||
return X11DRV_DIB_GenColorMap( physDev, colorMapping, coloruse, depth,
|
||||
isInfo, colorPtr, 0, colors);
|
||||
}
|
||||
|
||||
|
@ -2939,7 +2939,7 @@ static void X11DRV_DIB_SetImageBits_RLE8( int lines, const BYTE *bits,
|
|||
*/
|
||||
static void X11DRV_DIB_SetImageBits_16( int lines, const BYTE *srcbits,
|
||||
DWORD srcwidth, DWORD dstwidth, int left,
|
||||
DC *dc, DWORD rSrc, DWORD gSrc, DWORD bSrc,
|
||||
X11DRV_PDEVICE *physDev, DWORD rSrc, DWORD gSrc, DWORD bSrc,
|
||||
XImage *bmpImage, DWORD linebytes )
|
||||
{
|
||||
DWORD x;
|
||||
|
@ -3185,7 +3185,7 @@ static void X11DRV_DIB_SetImageBits_16( int lines, const BYTE *srcbits,
|
|||
((srcval >> bShift2) & 0x07);
|
||||
XPutPixel(bmpImage, x, h,
|
||||
X11DRV_PALETTE_ToPhysical
|
||||
(dc, RGB(red,green,blue)));
|
||||
(physDev, RGB(red,green,blue)));
|
||||
}
|
||||
srcbits += linebytes;
|
||||
}
|
||||
|
@ -3528,7 +3528,7 @@ static void X11DRV_DIB_GetImageBits_16( int lines, BYTE *dstbits,
|
|||
*/
|
||||
static void X11DRV_DIB_SetImageBits_24( int lines, const BYTE *srcbits,
|
||||
DWORD srcwidth, DWORD dstwidth, int left,
|
||||
DC *dc,
|
||||
X11DRV_PDEVICE *physDev,
|
||||
DWORD rSrc, DWORD gSrc, DWORD bSrc,
|
||||
XImage *bmpImage, DWORD linebytes )
|
||||
{
|
||||
|
@ -3675,7 +3675,7 @@ static void X11DRV_DIB_SetImageBits_24( int lines, const BYTE *srcbits,
|
|||
for (x = left; x < dstwidth+left; x++) {
|
||||
XPutPixel(bmpImage, x, h,
|
||||
X11DRV_PALETTE_ToPhysical
|
||||
(dc, RGB(srcbyte[2], srcbyte[1], srcbyte[0])));
|
||||
(physDev, RGB(srcbyte[2], srcbyte[1], srcbyte[0])));
|
||||
srcbyte+=3;
|
||||
}
|
||||
srcbits += linebytes;
|
||||
|
@ -3906,7 +3906,7 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits,
|
|||
*/
|
||||
static void X11DRV_DIB_SetImageBits_32(int lines, const BYTE *srcbits,
|
||||
DWORD srcwidth, DWORD dstwidth, int left,
|
||||
DC *dc,
|
||||
X11DRV_PDEVICE *physDev,
|
||||
DWORD rSrc, DWORD gSrc, DWORD bSrc,
|
||||
XImage *bmpImage,
|
||||
DWORD linebytes)
|
||||
|
@ -4156,7 +4156,7 @@ static void X11DRV_DIB_SetImageBits_32(int lines, const BYTE *srcbits,
|
|||
green=(srcvalue >> gShift) & 0xff;
|
||||
blue= (srcvalue >> bShift) & 0xff;
|
||||
XPutPixel(bmpImage, x, h, X11DRV_PALETTE_ToPhysical
|
||||
(dc, RGB(red,green,blue)));
|
||||
(physDev, RGB(red,green,blue)));
|
||||
}
|
||||
srcbits += linebytes;
|
||||
}
|
||||
|
@ -4554,21 +4554,21 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
|
|||
case 16:
|
||||
X11DRV_DIB_SetImageBits_16( descr->lines, descr->bits,
|
||||
descr->infoWidth, descr->width,
|
||||
descr->xSrc, descr->dc,
|
||||
descr->xSrc, descr->physDev,
|
||||
descr->rMask, descr->gMask, descr->bMask,
|
||||
bmpImage, descr->dibpitch);
|
||||
break;
|
||||
case 24:
|
||||
X11DRV_DIB_SetImageBits_24( descr->lines, descr->bits,
|
||||
descr->infoWidth, descr->width,
|
||||
descr->xSrc, descr->dc,
|
||||
descr->xSrc, descr->physDev,
|
||||
descr->rMask, descr->gMask, descr->bMask,
|
||||
bmpImage, descr->dibpitch);
|
||||
break;
|
||||
case 32:
|
||||
X11DRV_DIB_SetImageBits_32( descr->lines, descr->bits,
|
||||
descr->infoWidth, descr->width,
|
||||
descr->xSrc, descr->dc,
|
||||
descr->xSrc, descr->physDev,
|
||||
descr->rMask, descr->gMask, descr->bMask,
|
||||
bmpImage, descr->dibpitch);
|
||||
break;
|
||||
|
@ -4732,7 +4732,7 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
|
|||
* X11DRV_SetDIBitsToDevice
|
||||
*
|
||||
*/
|
||||
INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
|
||||
INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDest, DWORD cx,
|
||||
DWORD cy, INT xSrc, INT ySrc,
|
||||
UINT startscan, UINT lines, LPCVOID bits,
|
||||
const BITMAPINFO *info, UINT coloruse )
|
||||
|
@ -4741,8 +4741,7 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
|
|||
DWORD width, oldcy = cy;
|
||||
INT result;
|
||||
int height, tmpheight;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height,
|
||||
&descr.infoBpp, &descr.compression ) == -1)
|
||||
|
@ -4758,7 +4757,7 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
|
|||
if (xSrc + cx >= width) cx = width - xSrc;
|
||||
if (!cx || !cy) return 0;
|
||||
|
||||
X11DRV_SetupGCForText( dc ); /* To have the correct colors */
|
||||
X11DRV_SetupGCForText( physDev ); /* To have the correct colors */
|
||||
TSXSetFunction(gdi_display, physDev->gc, X11DRV_XROPfunction[dc->ROPmode-1]);
|
||||
|
||||
switch (descr.infoBpp)
|
||||
|
@ -4767,7 +4766,7 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
|
|||
case 4:
|
||||
case 8:
|
||||
descr.colorMap = (RGBQUAD *)X11DRV_DIB_BuildColorMap(
|
||||
coloruse == DIB_PAL_COLORS ? dc : NULL, coloruse,
|
||||
coloruse == DIB_PAL_COLORS ? physDev : NULL, coloruse,
|
||||
dc->bitsPerPixel, info, &descr.nColorMap );
|
||||
if (!descr.colorMap) return 0;
|
||||
descr.rMask = descr.gMask = descr.bMask = 0;
|
||||
|
@ -4789,7 +4788,7 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
|
|||
break;
|
||||
}
|
||||
|
||||
descr.dc = dc;
|
||||
descr.physDev = physDev;
|
||||
descr.bits = bits;
|
||||
descr.image = NULL;
|
||||
descr.palentry = NULL;
|
||||
|
@ -4817,18 +4816,17 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx,
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_DIB_SetDIBits
|
||||
* X11DRV_SetDIBits (X11DRV.@)
|
||||
*/
|
||||
INT X11DRV_DIB_SetDIBits(
|
||||
BITMAPOBJ *bmp, DC *dc, UINT startscan,
|
||||
UINT lines, LPCVOID bits, const BITMAPINFO *info,
|
||||
UINT coloruse, HBITMAP hbitmap)
|
||||
INT X11DRV_SetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan,
|
||||
UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse )
|
||||
{
|
||||
X11DRV_DIB_IMAGEBITS_DESCR descr;
|
||||
BITMAPOBJ *bmp;
|
||||
int height, tmpheight;
|
||||
INT result;
|
||||
|
||||
descr.dc = dc;
|
||||
descr.physDev = physDev;
|
||||
|
||||
if (DIB_GetBitmapInfo( &info->bmiHeader, &descr.infoWidth, &height,
|
||||
&descr.infoBpp, &descr.compression ) == -1)
|
||||
|
@ -4839,6 +4837,8 @@ INT X11DRV_DIB_SetDIBits(
|
|||
if (!lines || (startscan >= height))
|
||||
return 0;
|
||||
|
||||
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) return 0;
|
||||
|
||||
if (startscan + lines > height) lines = height - startscan;
|
||||
|
||||
switch (descr.infoBpp)
|
||||
|
@ -4847,10 +4847,14 @@ INT X11DRV_DIB_SetDIBits(
|
|||
case 4:
|
||||
case 8:
|
||||
descr.colorMap = (RGBQUAD *)X11DRV_DIB_BuildColorMap(
|
||||
coloruse == DIB_PAL_COLORS ? descr.dc : NULL, coloruse,
|
||||
coloruse == DIB_PAL_COLORS ? descr.physDev : NULL, coloruse,
|
||||
bmp->bitmap.bmBitsPixel,
|
||||
info, &descr.nColorMap );
|
||||
if (!descr.colorMap) return 0;
|
||||
if (!descr.colorMap)
|
||||
{
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
return 0;
|
||||
}
|
||||
descr.rMask = descr.gMask = descr.bMask = 0;
|
||||
break;
|
||||
case 15:
|
||||
|
@ -4895,30 +4899,37 @@ INT X11DRV_DIB_SetDIBits(
|
|||
|
||||
if (descr.colorMap) HeapFree(GetProcessHeap(), 0, descr.colorMap);
|
||||
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
return result;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_DIB_GetDIBits
|
||||
* X11DRV_GetDIBits (X11DRV.@)
|
||||
*/
|
||||
INT X11DRV_DIB_GetDIBits(
|
||||
BITMAPOBJ *bmp, DC *dc, UINT startscan,
|
||||
UINT lines, LPVOID bits, BITMAPINFO *info,
|
||||
UINT coloruse, HBITMAP hbitmap)
|
||||
INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, UINT lines,
|
||||
LPVOID bits, BITMAPINFO *info, UINT coloruse )
|
||||
{
|
||||
X11DRV_DIBSECTION *dib = (X11DRV_DIBSECTION *) bmp->dib;
|
||||
X11DRV_DIBSECTION *dib;
|
||||
X11DRV_DIB_IMAGEBITS_DESCR descr;
|
||||
PALETTEOBJ * palette;
|
||||
BITMAPOBJ *bmp;
|
||||
int height;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC )))
|
||||
return 0;
|
||||
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
|
||||
{
|
||||
GDI_ReleaseObj( dc->hPalette );
|
||||
return 0;
|
||||
}
|
||||
dib = (X11DRV_DIBSECTION *) bmp->dib;
|
||||
|
||||
TRACE("%u scanlines of (%i,%i) -> (%i,%i) starting from %u\n",
|
||||
lines, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
|
||||
(int)info->bmiHeader.biWidth, (int)info->bmiHeader.biHeight,
|
||||
startscan );
|
||||
|
||||
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC )))
|
||||
return 0;
|
||||
|
||||
if( lines > bmp->bitmap.bmHeight ) lines = bmp->bitmap.bmHeight;
|
||||
|
||||
height = info->bmiHeader.biHeight;
|
||||
|
@ -4971,7 +4982,7 @@ INT X11DRV_DIB_GetDIBits(
|
|||
X11DRV_CreateBitmap(hbitmap);
|
||||
|
||||
|
||||
descr.dc = dc;
|
||||
descr.physDev = physDev;
|
||||
descr.palentry = palette->logpalette.palPalEntry;
|
||||
descr.bits = bits;
|
||||
descr.image = NULL;
|
||||
|
@ -5020,7 +5031,7 @@ INT X11DRV_DIB_GetDIBits(
|
|||
|
||||
done:
|
||||
GDI_ReleaseObj( dc->hPalette );
|
||||
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
return lines;
|
||||
}
|
||||
|
||||
|
@ -5061,7 +5072,7 @@ static void X11DRV_DIB_DoCopyDIBSection(BITMAPOBJ *bmp, BOOL toDIB,
|
|||
&descr.infoBpp, &descr.compression ) == -1)
|
||||
return;
|
||||
|
||||
descr.dc = NULL;
|
||||
descr.physDev = NULL;
|
||||
descr.palentry = NULL;
|
||||
descr.image = dib->image;
|
||||
descr.colorMap = colorMap;
|
||||
|
@ -5122,13 +5133,13 @@ static void X11DRV_DIB_DoCopyDIBSection(BITMAPOBJ *bmp, BOOL toDIB,
|
|||
/***********************************************************************
|
||||
* X11DRV_DIB_CopyDIBSection
|
||||
*/
|
||||
void X11DRV_DIB_CopyDIBSection(DC *dcSrc, DC *dcDst,
|
||||
DWORD xSrc, DWORD ySrc,
|
||||
DWORD xDest, DWORD yDest,
|
||||
void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
|
||||
DWORD xSrc, DWORD ySrc, DWORD xDest, DWORD yDest,
|
||||
DWORD width, DWORD height)
|
||||
{
|
||||
BITMAPOBJ *bmp;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dcDst->physDev;
|
||||
DC *dcSrc = physDevSrc->dc;
|
||||
DC *dcDst = physDevDst->dc;
|
||||
int nColorMap = 0, *colorMap = NULL, aColorMap = FALSE;
|
||||
|
||||
TRACE("(%p,%p,%ld,%ld,%ld,%ld,%ld,%ld)\n", dcSrc, dcDst,
|
||||
|
@ -5167,7 +5178,7 @@ void X11DRV_DIB_CopyDIBSection(DC *dcSrc, DC *dcDst,
|
|||
colorMap = dib->colorMap;
|
||||
nColorMap = dib->nColorMap;
|
||||
} else {
|
||||
colorMap = X11DRV_DIB_BuildColorMap( dcSrc, (WORD)-1,
|
||||
colorMap = X11DRV_DIB_BuildColorMap( physDevSrc, (WORD)-1,
|
||||
bmp->dib->dsBm.bmBitsPixel,
|
||||
(BITMAPINFO*)&(bmp->dib->dsBmih),
|
||||
&nColorMap );
|
||||
|
@ -5176,7 +5187,7 @@ void X11DRV_DIB_CopyDIBSection(DC *dcSrc, DC *dcDst,
|
|||
}
|
||||
/* perform the copy */
|
||||
X11DRV_DIB_DoCopyDIBSection(bmp, FALSE, colorMap, nColorMap,
|
||||
physDev->drawable, xSrc, ySrc, xDest, yDest,
|
||||
physDevDst->drawable, xSrc, ySrc, xDest, yDest,
|
||||
width, height);
|
||||
/* free color mapping */
|
||||
if (aColorMap)
|
||||
|
@ -5534,32 +5545,32 @@ void X11DRV_UnlockDIBSection2(HBITMAP hBmp, BOOL commit)
|
|||
/***********************************************************************
|
||||
* X11DRV_CoerceDIBSection
|
||||
*/
|
||||
INT X11DRV_CoerceDIBSection(DC *dc, INT req, BOOL lossy)
|
||||
INT X11DRV_CoerceDIBSection(X11DRV_PDEVICE *physDev, INT req, BOOL lossy)
|
||||
{
|
||||
if (!dc) return DIB_Status_None;
|
||||
return X11DRV_CoerceDIBSection2( dc->hBitmap, req, lossy );
|
||||
if (!physDev) return DIB_Status_None;
|
||||
return X11DRV_CoerceDIBSection2( physDev->dc->hBitmap, req, lossy );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_LockDIBSection
|
||||
*/
|
||||
INT X11DRV_LockDIBSection(DC *dc, INT req, BOOL lossy)
|
||||
INT X11DRV_LockDIBSection(X11DRV_PDEVICE *physDev, INT req, BOOL lossy)
|
||||
{
|
||||
if (!dc) return DIB_Status_None;
|
||||
if (!(dc->flags & DC_MEMORY)) return DIB_Status_None;
|
||||
if (!physDev) return DIB_Status_None;
|
||||
if (!(physDev->dc->flags & DC_MEMORY)) return DIB_Status_None;
|
||||
|
||||
return X11DRV_LockDIBSection2( dc->hBitmap, req, lossy );
|
||||
return X11DRV_LockDIBSection2( physDev->dc->hBitmap, req, lossy );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_UnlockDIBSection
|
||||
*/
|
||||
void X11DRV_UnlockDIBSection(DC *dc, BOOL commit)
|
||||
void X11DRV_UnlockDIBSection(X11DRV_PDEVICE *physDev, BOOL commit)
|
||||
{
|
||||
if (!dc) return;
|
||||
if (!(dc->flags & DC_MEMORY)) return;
|
||||
if (!physDev) return;
|
||||
if (!(physDev->dc->flags & DC_MEMORY)) return;
|
||||
|
||||
X11DRV_UnlockDIBSection2( dc->hBitmap, commit );
|
||||
X11DRV_UnlockDIBSection2( physDev->dc->hBitmap, commit );
|
||||
}
|
||||
|
||||
|
||||
|
@ -5633,7 +5644,7 @@ static XImage *X11DRV_XShmCreateImage( int width, int height, int bpp,
|
|||
* X11DRV_DIB_CreateDIBSection
|
||||
*/
|
||||
HBITMAP X11DRV_DIB_CreateDIBSection(
|
||||
DC *dc, BITMAPINFO *bmi, UINT usage,
|
||||
X11DRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage,
|
||||
LPVOID *bits, HANDLE section,
|
||||
DWORD offset, DWORD ovr_pitch)
|
||||
{
|
||||
|
@ -5694,7 +5705,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
|
|||
|
||||
/* Create Color Map */
|
||||
if (bm.bmBits && bm.bmBitsPixel <= 8)
|
||||
colorMap = X11DRV_DIB_BuildColorMap( usage == DIB_PAL_COLORS? dc : NULL,
|
||||
colorMap = X11DRV_DIB_BuildColorMap( usage == DIB_PAL_COLORS? physDev : NULL,
|
||||
usage, bm.bmBitsPixel, bmi, &nColorMap );
|
||||
|
||||
/* Allocate Memory for DIB and fill structure */
|
||||
|
@ -5738,7 +5749,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
|
|||
/* Create Device Dependent Bitmap and add DIB pointer */
|
||||
if (dib)
|
||||
{
|
||||
res = CreateDIBitmap(dc->hSelf, bi, 0, NULL, bmi, usage);
|
||||
res = CreateDIBitmap(physDev->hdc, bi, 0, NULL, bmi, usage);
|
||||
if (res)
|
||||
{
|
||||
bmp = (BITMAPOBJ *) GDI_GetObjPtr(res, BITMAP_MAGIC);
|
||||
|
@ -5843,11 +5854,16 @@ void X11DRV_DIB_DeleteDIBSection(BITMAPOBJ *bmp)
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_DIB_SetDIBColorTable
|
||||
* X11DRV_SetDIBColorTable (X11DRV.@)
|
||||
*/
|
||||
UINT X11DRV_DIB_SetDIBColorTable(BITMAPOBJ *bmp, DC *dc, UINT start, UINT count, const RGBQUAD *colors)
|
||||
UINT X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, const RGBQUAD *colors )
|
||||
{
|
||||
X11DRV_DIBSECTION *dib = (X11DRV_DIBSECTION *) bmp->dib;
|
||||
BITMAPOBJ * bmp;
|
||||
X11DRV_DIBSECTION *dib;
|
||||
UINT ret = 0;
|
||||
|
||||
if (!(bmp = (BITMAPOBJ*)GDI_GetObjPtr( physDev->dc->hBitmap, BITMAP_MAGIC ))) return 0;
|
||||
dib = (X11DRV_DIBSECTION *) bmp->dib;
|
||||
|
||||
if (dib && dib->colorMap) {
|
||||
UINT end = count + start;
|
||||
|
@ -5858,21 +5874,27 @@ UINT X11DRV_DIB_SetDIBColorTable(BITMAPOBJ *bmp, DC *dc, UINT start, UINT count,
|
|||
* of the bitmap object.
|
||||
*/
|
||||
X11DRV_DIB_Lock(bmp, DIB_Status_AppMod, FALSE);
|
||||
X11DRV_DIB_GenColorMap( dc, dib->colorMap, DIB_RGB_COLORS,
|
||||
X11DRV_DIB_GenColorMap( physDev, dib->colorMap, DIB_RGB_COLORS,
|
||||
dib->dibSection.dsBm.bmBitsPixel,
|
||||
TRUE, colors, start, end );
|
||||
X11DRV_DIB_Unlock(bmp, TRUE);
|
||||
return end - start;
|
||||
ret = end - start;
|
||||
}
|
||||
return 0;
|
||||
GDI_ReleaseObj( physDev->dc->hBitmap );
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_DIB_GetDIBColorTable
|
||||
* X11DRV_GetDIBColorTable (X11DRV.@)
|
||||
*/
|
||||
UINT X11DRV_DIB_GetDIBColorTable(BITMAPOBJ *bmp, DC *dc, UINT start, UINT count, RGBQUAD *colors)
|
||||
UINT X11DRV_GetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, RGBQUAD *colors )
|
||||
{
|
||||
X11DRV_DIBSECTION *dib = (X11DRV_DIBSECTION *) bmp->dib;
|
||||
BITMAPOBJ * bmp;
|
||||
X11DRV_DIBSECTION *dib;
|
||||
UINT ret = 0;
|
||||
|
||||
if (!(bmp = (BITMAPOBJ*)GDI_GetObjPtr( physDev->dc->hBitmap, BITMAP_MAGIC ))) return 0;
|
||||
dib = (X11DRV_DIBSECTION *) bmp->dib;
|
||||
|
||||
if (dib && dib->colorMap) {
|
||||
UINT i, end = count + start;
|
||||
|
@ -5884,9 +5906,10 @@ UINT X11DRV_DIB_GetDIBColorTable(BITMAPOBJ *bmp, DC *dc, UINT start, UINT count,
|
|||
colors->rgbRed = GetRValue(col);
|
||||
colors->rgbReserved = 0;
|
||||
}
|
||||
return end-start;
|
||||
ret = end-start;
|
||||
}
|
||||
return 0;
|
||||
GDI_ReleaseObj( physDev->dc->hBitmap );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -81,12 +81,12 @@ const int X11DRV_XROPfunction[16] =
|
|||
* If fMapColors is TRUE, X pixels are mapped to Windows colors.
|
||||
* Return FALSE if brush is BS_NULL, TRUE otherwise.
|
||||
*/
|
||||
BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
|
||||
BOOL X11DRV_SetupGCForPatBlt( X11DRV_PDEVICE *physDev, GC gc, BOOL fMapColors )
|
||||
{
|
||||
XGCValues val;
|
||||
unsigned long mask;
|
||||
Pixmap pixmap = 0;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (physDev->brush.style == BS_NULL) return FALSE;
|
||||
if (physDev->brush.pixel == -1)
|
||||
|
@ -126,7 +126,7 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
|
|||
{
|
||||
case FillStippled:
|
||||
case FillOpaqueStippled:
|
||||
if (dc->backgroundMode==OPAQUE) val.fill_style = FillOpaqueStippled;
|
||||
if (GetBkMode(dc->hSelf)==OPAQUE) val.fill_style = FillOpaqueStippled;
|
||||
val.stipple = physDev->brush.pixmap;
|
||||
mask = GCStipple;
|
||||
break;
|
||||
|
@ -159,7 +159,7 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
|
|||
}
|
||||
val.ts_x_origin = dc->DCOrgX + dc->brushOrgX;
|
||||
val.ts_y_origin = dc->DCOrgY + dc->brushOrgY;
|
||||
val.fill_rule = (dc->polyFillMode==WINDING) ? WindingRule : EvenOddRule;
|
||||
val.fill_rule = (GetPolyFillMode(physDev->hdc) == WINDING) ? WindingRule : EvenOddRule;
|
||||
TSXChangeGC( gdi_display, gc,
|
||||
GCFunction | GCForeground | GCBackground | GCFillStyle |
|
||||
GCFillRule | GCTileStipXOrigin | GCTileStipYOrigin | mask,
|
||||
|
@ -175,10 +175,9 @@ BOOL X11DRV_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
|
|||
* Setup physDev->gc for drawing operations using current brush.
|
||||
* Return FALSE if brush is BS_NULL, TRUE otherwise.
|
||||
*/
|
||||
BOOL X11DRV_SetupGCForBrush( DC * dc )
|
||||
BOOL X11DRV_SetupGCForBrush( X11DRV_PDEVICE *physDev )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
return X11DRV_SetupGCForPatBlt( dc, physDev->gc, FALSE );
|
||||
return X11DRV_SetupGCForPatBlt( physDev, physDev->gc, FALSE );
|
||||
}
|
||||
|
||||
|
||||
|
@ -188,10 +187,10 @@ BOOL X11DRV_SetupGCForBrush( DC * dc )
|
|||
* Setup physDev->gc for drawing operations using current pen.
|
||||
* Return FALSE if pen is PS_NULL, TRUE otherwise.
|
||||
*/
|
||||
BOOL X11DRV_SetupGCForPen( DC * dc )
|
||||
BOOL X11DRV_SetupGCForPen( X11DRV_PDEVICE *physDev )
|
||||
{
|
||||
XGCValues val;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (physDev->pen.style == PS_NULL) return FALSE;
|
||||
|
||||
|
@ -225,8 +224,7 @@ BOOL X11DRV_SetupGCForPen( DC * dc )
|
|||
(physDev->pen.style != PS_INSIDEFRAME))
|
||||
{
|
||||
TSXSetDashes( gdi_display, physDev->gc, 0, physDev->pen.dashes, physDev->pen.dash_len );
|
||||
val.line_style = (dc->backgroundMode == OPAQUE) ?
|
||||
LineDoubleDash : LineOnOffDash;
|
||||
val.line_style = (GetBkMode(dc->hSelf) == OPAQUE) ? LineDoubleDash : LineOnOffDash;
|
||||
}
|
||||
else val.line_style = LineSolid;
|
||||
val.line_width = physDev->pen.width;
|
||||
|
@ -271,9 +269,8 @@ BOOL X11DRV_SetupGCForPen( DC * dc )
|
|||
* Setup physDev->gc for text drawing operations.
|
||||
* Return FALSE if the font is null, TRUE otherwise.
|
||||
*/
|
||||
BOOL X11DRV_SetupGCForText( DC * dc )
|
||||
BOOL X11DRV_SetupGCForText( X11DRV_PDEVICE *physDev )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
XFontStruct* xfs = XFONT_GetFontStruct( physDev->font );
|
||||
|
||||
if( xfs )
|
||||
|
@ -299,15 +296,15 @@ BOOL X11DRV_SetupGCForText( DC * dc )
|
|||
* X11DRV_LineTo
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_LineTo( DC *dc, INT x, INT y )
|
||||
X11DRV_LineTo( X11DRV_PDEVICE *physDev, INT x, INT y )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
POINT start;
|
||||
POINT end;
|
||||
|
||||
if (X11DRV_SetupGCForPen( dc )) {
|
||||
if (X11DRV_SetupGCForPen( physDev )) {
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
start.x = dc->CursPosX;
|
||||
start.y = dc->CursPosY;
|
||||
|
@ -323,7 +320,7 @@ X11DRV_LineTo( DC *dc, INT x, INT y )
|
|||
dc->DCOrgY + end.y);
|
||||
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, TRUE);
|
||||
X11DRV_UnlockDIBSection(physDev, TRUE);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -338,7 +335,7 @@ X11DRV_LineTo( DC *dc, INT x, INT y )
|
|||
*
|
||||
*/
|
||||
static BOOL
|
||||
X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
|
||||
X11DRV_DrawArc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart,
|
||||
INT xend, INT yend, INT lines )
|
||||
{
|
||||
|
@ -346,7 +343,7 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
|
|||
INT width, oldwidth, oldendcap;
|
||||
double start_angle, end_angle;
|
||||
XPoint points[4];
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL update = FALSE;
|
||||
|
||||
left = XLPTODP( dc, left );
|
||||
|
@ -407,11 +404,11 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
|
|||
if (idiff_angle <= 0) idiff_angle += 360 * 64;
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
/* Fill arc with brush if Chord() or Pie() */
|
||||
|
||||
if ((lines > 0) && X11DRV_SetupGCForBrush( dc )) {
|
||||
if ((lines > 0) && X11DRV_SetupGCForBrush( physDev )) {
|
||||
TSXSetArcMode( gdi_display, physDev->gc, (lines==1) ? ArcChord : ArcPieSlice);
|
||||
TSXFillArc( gdi_display, physDev->drawable, physDev->gc,
|
||||
dc->DCOrgX + left, dc->DCOrgY + top,
|
||||
|
@ -421,7 +418,7 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
|
|||
|
||||
/* Draw arc and lines */
|
||||
|
||||
if (X11DRV_SetupGCForPen( dc )){
|
||||
if (X11DRV_SetupGCForPen( physDev )){
|
||||
TSXDrawArc( gdi_display, physDev->drawable, physDev->gc,
|
||||
dc->DCOrgX + left, dc->DCOrgY + top,
|
||||
right-left-1, bottom-top-1, istart_angle, idiff_angle );
|
||||
|
@ -485,7 +482,7 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
|
|||
}
|
||||
|
||||
/* Update the DIBSection of the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, update);
|
||||
X11DRV_UnlockDIBSection(physDev, update);
|
||||
|
||||
physDev->pen.width = oldwidth;
|
||||
physDev->pen.endcap = oldendcap;
|
||||
|
@ -497,10 +494,10 @@ X11DRV_DrawArc( DC *dc, INT left, INT top, INT right,
|
|||
* X11DRV_Arc
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_Arc( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
X11DRV_Arc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return X11DRV_DrawArc( dc, left, top, right, bottom,
|
||||
return X11DRV_DrawArc( physDev, left, top, right, bottom,
|
||||
xstart, ystart, xend, yend, 0 );
|
||||
}
|
||||
|
||||
|
@ -509,10 +506,10 @@ X11DRV_Arc( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* X11DRV_Pie
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_Pie( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
X11DRV_Pie( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return X11DRV_DrawArc( dc, left, top, right, bottom,
|
||||
return X11DRV_DrawArc( physDev, left, top, right, bottom,
|
||||
xstart, ystart, xend, yend, 2 );
|
||||
}
|
||||
|
||||
|
@ -520,10 +517,10 @@ X11DRV_Pie( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* X11DRV_Chord
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_Chord( DC *dc, INT left, INT top, INT right, INT bottom,
|
||||
X11DRV_Chord( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend )
|
||||
{
|
||||
return X11DRV_DrawArc( dc, left, top, right, bottom,
|
||||
return X11DRV_DrawArc( physDev, left, top, right, bottom,
|
||||
xstart, ystart, xend, yend, 1 );
|
||||
}
|
||||
|
||||
|
@ -532,10 +529,10 @@ X11DRV_Chord( DC *dc, INT left, INT top, INT right, INT bottom,
|
|||
* X11DRV_Ellipse
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
|
||||
X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom )
|
||||
{
|
||||
INT width, oldwidth;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL update = FALSE;
|
||||
|
||||
left = XLPTODP( dc, left );
|
||||
|
@ -564,16 +561,16 @@ X11DRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
|
|||
physDev->pen.width = width;
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
if (X11DRV_SetupGCForBrush( dc ))
|
||||
if (X11DRV_SetupGCForBrush( physDev ))
|
||||
{
|
||||
TSXFillArc( gdi_display, physDev->drawable, physDev->gc,
|
||||
dc->DCOrgX + left, dc->DCOrgY + top,
|
||||
right-left-1, bottom-top-1, 0, 360*64 );
|
||||
update = TRUE;
|
||||
}
|
||||
if (X11DRV_SetupGCForPen( dc ))
|
||||
if (X11DRV_SetupGCForPen( physDev ))
|
||||
{
|
||||
TSXDrawArc( gdi_display, physDev->drawable, physDev->gc,
|
||||
dc->DCOrgX + left, dc->DCOrgY + top,
|
||||
|
@ -582,7 +579,7 @@ X11DRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
|
|||
}
|
||||
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, update);
|
||||
X11DRV_UnlockDIBSection(physDev, update);
|
||||
|
||||
physDev->pen.width = oldwidth;
|
||||
return TRUE;
|
||||
|
@ -593,10 +590,10 @@ X11DRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
|
|||
* X11DRV_Rectangle
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
||||
X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom)
|
||||
{
|
||||
INT width, oldwidth, oldjoinstyle;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL update = FALSE;
|
||||
|
||||
TRACE("(%d %d %d %d)\n",
|
||||
|
@ -632,10 +629,10 @@ X11DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
physDev->pen.linejoin = PS_JOIN_MITER;
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
if ((right > left + width) && (bottom > top + width))
|
||||
if (X11DRV_SetupGCForBrush( dc ))
|
||||
if (X11DRV_SetupGCForBrush( physDev ))
|
||||
{
|
||||
TSXFillRectangle( gdi_display, physDev->drawable, physDev->gc,
|
||||
dc->DCOrgX + left + (width + 1) / 2,
|
||||
|
@ -643,7 +640,7 @@ X11DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
right-left-width-1, bottom-top-width-1);
|
||||
update = TRUE;
|
||||
}
|
||||
if (X11DRV_SetupGCForPen( dc ))
|
||||
if (X11DRV_SetupGCForPen( physDev ))
|
||||
{
|
||||
TSXDrawRectangle( gdi_display, physDev->drawable, physDev->gc,
|
||||
dc->DCOrgX + left, dc->DCOrgY + top,
|
||||
|
@ -652,7 +649,7 @@ X11DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
}
|
||||
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, update);
|
||||
X11DRV_UnlockDIBSection(physDev, update);
|
||||
|
||||
physDev->pen.width = oldwidth;
|
||||
physDev->pen.linejoin = oldjoinstyle;
|
||||
|
@ -663,11 +660,11 @@ X11DRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
|
|||
* X11DRV_RoundRect
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
||||
X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT ell_width, INT ell_height )
|
||||
{
|
||||
INT width, oldwidth, oldendcap;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL update = FALSE;
|
||||
|
||||
TRACE("(%d %d %d %d %d %d\n",
|
||||
|
@ -710,10 +707,10 @@ X11DRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
physDev->pen.endcap = PS_ENDCAP_SQUARE;
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
wine_tsx11_lock();
|
||||
if (X11DRV_SetupGCForBrush( dc ))
|
||||
if (X11DRV_SetupGCForBrush( physDev ))
|
||||
{
|
||||
if (ell_width > (right-left) )
|
||||
if (ell_height > (bottom-top) )
|
||||
|
@ -787,7 +784,8 @@ X11DRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
* BTW this stuff is optimized for an Xfree86 server
|
||||
* read the comments inside the X11DRV_DrawArc function
|
||||
*/
|
||||
if (X11DRV_SetupGCForPen(dc)) {
|
||||
if (X11DRV_SetupGCForPen( physDev ))
|
||||
{
|
||||
if (ell_width > (right-left) )
|
||||
if (ell_height > (bottom-top) )
|
||||
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
|
||||
|
@ -855,7 +853,7 @@ X11DRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
}
|
||||
wine_tsx11_unlock();
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, update);
|
||||
X11DRV_UnlockDIBSection(physDev, update);
|
||||
|
||||
physDev->pen.width = oldwidth;
|
||||
physDev->pen.endcap = oldendcap;
|
||||
|
@ -867,17 +865,17 @@ X11DRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
|||
* X11DRV_SetPixel
|
||||
*/
|
||||
COLORREF
|
||||
X11DRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
||||
X11DRV_SetPixel( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color )
|
||||
{
|
||||
Pixel pixel;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
x = dc->DCOrgX + INTERNAL_XWPTODP( dc, x, y );
|
||||
y = dc->DCOrgY + INTERNAL_YWPTODP( dc, x, y );
|
||||
pixel = X11DRV_PALETTE_ToPhysical( dc, color );
|
||||
pixel = X11DRV_PALETTE_ToPhysical( physDev, color );
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
/* inefficient but simple... */
|
||||
wine_tsx11_lock();
|
||||
|
@ -887,7 +885,7 @@ X11DRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
|||
wine_tsx11_unlock();
|
||||
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, TRUE);
|
||||
X11DRV_UnlockDIBSection(physDev, TRUE);
|
||||
|
||||
return X11DRV_PALETTE_ToLogical(pixel);
|
||||
}
|
||||
|
@ -897,15 +895,15 @@ X11DRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
|||
* X11DRV_GetPixel
|
||||
*/
|
||||
COLORREF
|
||||
X11DRV_GetPixel( DC *dc, INT x, INT y )
|
||||
X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y )
|
||||
{
|
||||
static Pixmap pixmap = 0;
|
||||
XImage * image;
|
||||
int pixel;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
x = dc->DCOrgX + INTERNAL_XWPTODP( dc, x, y );
|
||||
y = dc->DCOrgY + INTERNAL_YWPTODP( dc, x, y );
|
||||
|
@ -930,7 +928,7 @@ X11DRV_GetPixel( DC *dc, INT x, INT y )
|
|||
wine_tsx11_unlock();
|
||||
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, FALSE);
|
||||
X11DRV_UnlockDIBSection(physDev, FALSE);
|
||||
|
||||
return X11DRV_PALETTE_ToLogical(pixel);
|
||||
}
|
||||
|
@ -940,12 +938,12 @@ X11DRV_GetPixel( DC *dc, INT x, INT y )
|
|||
* X11DRV_PaintRgn
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_PaintRgn( DC *dc, HRGN hrgn )
|
||||
X11DRV_PaintRgn( X11DRV_PDEVICE *physDev, HRGN hrgn )
|
||||
{
|
||||
RECT box;
|
||||
HRGN tmpVisRgn, prevVisRgn;
|
||||
HDC hdc = dc->hSelf; /* FIXME: should not mix dc/hdc this way */
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
HDC hdc = physDev->hdc; /* FIXME: should not mix dc/hdc this way */
|
||||
|
||||
if (!(tmpVisRgn = CreateRectRgn( 0, 0, 0, 0 ))) return FALSE;
|
||||
|
||||
|
@ -968,17 +966,17 @@ X11DRV_PaintRgn( DC *dc, HRGN hrgn )
|
|||
/* Fill the region */
|
||||
|
||||
GetRgnBox( dc->hGCClipRgn, &box );
|
||||
if (X11DRV_SetupGCForBrush( dc ))
|
||||
if (X11DRV_SetupGCForBrush( physDev ))
|
||||
{
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
TSXFillRectangle( gdi_display, physDev->drawable, physDev->gc,
|
||||
box.left, box.top,
|
||||
box.right-box.left, box.bottom-box.top );
|
||||
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, TRUE);
|
||||
X11DRV_UnlockDIBSection(physDev, TRUE);
|
||||
}
|
||||
|
||||
/* Restore the visible region */
|
||||
|
@ -991,12 +989,12 @@ X11DRV_PaintRgn( DC *dc, HRGN hrgn )
|
|||
* X11DRV_Polyline
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_Polyline( DC *dc, const POINT* pt, INT count )
|
||||
X11DRV_Polyline( X11DRV_PDEVICE *physDev, const POINT* pt, INT count )
|
||||
{
|
||||
INT oldwidth;
|
||||
register int i;
|
||||
XPoint *points;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if((oldwidth = physDev->pen.width) == 0) physDev->pen.width = 1;
|
||||
|
||||
|
@ -1011,16 +1009,16 @@ X11DRV_Polyline( DC *dc, const POINT* pt, INT count )
|
|||
points[i].y = dc->DCOrgY + INTERNAL_YWPTODP( dc, pt[i].x, pt[i].y );
|
||||
}
|
||||
|
||||
if (X11DRV_SetupGCForPen ( dc ))
|
||||
if (X11DRV_SetupGCForPen ( physDev ))
|
||||
{
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
TSXDrawLines( gdi_display, physDev->drawable, physDev->gc,
|
||||
points, count, CoordModeOrigin );
|
||||
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, TRUE);
|
||||
X11DRV_UnlockDIBSection(physDev, TRUE);
|
||||
}
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, points );
|
||||
|
@ -1033,11 +1031,11 @@ X11DRV_Polyline( DC *dc, const POINT* pt, INT count )
|
|||
* X11DRV_Polygon
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_Polygon( DC *dc, const POINT* pt, INT count )
|
||||
X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count )
|
||||
{
|
||||
register int i;
|
||||
XPoint *points;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
BOOL update = FALSE;
|
||||
|
||||
if (!(points = HeapAlloc( GetProcessHeap(), 0, sizeof(XPoint) * (count+1) )))
|
||||
|
@ -1053,15 +1051,15 @@ X11DRV_Polygon( DC *dc, const POINT* pt, INT count )
|
|||
points[count] = points[0];
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
if (X11DRV_SetupGCForBrush( dc ))
|
||||
if (X11DRV_SetupGCForBrush( physDev ))
|
||||
{
|
||||
TSXFillPolygon( gdi_display, physDev->drawable, physDev->gc,
|
||||
points, count+1, Complex, CoordModeOrigin);
|
||||
update = TRUE;
|
||||
}
|
||||
if (X11DRV_SetupGCForPen ( dc ))
|
||||
if (X11DRV_SetupGCForPen ( physDev ))
|
||||
{
|
||||
TSXDrawLines( gdi_display, physDev->drawable, physDev->gc,
|
||||
points, count+1, CoordModeOrigin );
|
||||
|
@ -1069,7 +1067,7 @@ X11DRV_Polygon( DC *dc, const POINT* pt, INT count )
|
|||
}
|
||||
|
||||
/* Update the DIBSection from the pixmap */
|
||||
X11DRV_UnlockDIBSection(dc, update);
|
||||
X11DRV_UnlockDIBSection(physDev, update);
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, points );
|
||||
return TRUE;
|
||||
|
@ -1080,27 +1078,27 @@ X11DRV_Polygon( DC *dc, const POINT* pt, INT count )
|
|||
* X11DRV_PolyPolygon
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polygons)
|
||||
X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons)
|
||||
{
|
||||
HRGN hrgn;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
/* FIXME: The points should be converted to device coords before */
|
||||
/* creating the region. */
|
||||
|
||||
hrgn = CreatePolyPolygonRgn( pt, counts, polygons, dc->polyFillMode );
|
||||
X11DRV_PaintRgn( dc, hrgn );
|
||||
hrgn = CreatePolyPolygonRgn( pt, counts, polygons, GetPolyFillMode( physDev->hdc ) );
|
||||
X11DRV_PaintRgn( physDev, hrgn );
|
||||
DeleteObject( hrgn );
|
||||
|
||||
/* Draw the outline of the polygons */
|
||||
|
||||
if (X11DRV_SetupGCForPen ( dc ))
|
||||
if (X11DRV_SetupGCForPen ( physDev ))
|
||||
{
|
||||
int i, j, max = 0;
|
||||
XPoint *points;
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
for (i = 0; i < polygons; i++) if (counts[i] > max) max = counts[i];
|
||||
if (!(points = HeapAlloc( GetProcessHeap(), 0, sizeof(XPoint) * (max+1) )))
|
||||
|
@ -1122,7 +1120,7 @@ X11DRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polygons)
|
|||
}
|
||||
|
||||
/* Update the DIBSection of the dc's bitmap */
|
||||
X11DRV_UnlockDIBSection(dc, TRUE);
|
||||
X11DRV_UnlockDIBSection(physDev, TRUE);
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, points );
|
||||
}
|
||||
|
@ -1134,17 +1132,17 @@ X11DRV_PolyPolygon( DC *dc, const POINT* pt, const INT* counts, UINT polygons)
|
|||
* X11DRV_PolyPolyline
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_PolyPolyline( DC *dc, const POINT* pt, const DWORD* counts, DWORD polylines )
|
||||
X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (X11DRV_SetupGCForPen ( dc ))
|
||||
if (X11DRV_SetupGCForPen ( physDev ))
|
||||
{
|
||||
int i, j, max = 0;
|
||||
XPoint *points;
|
||||
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
for (i = 0; i < polylines; i++) if (counts[i] > max) max = counts[i];
|
||||
if (!(points = HeapAlloc( GetProcessHeap(), 0, sizeof(XPoint) * max )))
|
||||
|
@ -1165,7 +1163,7 @@ X11DRV_PolyPolyline( DC *dc, const POINT* pt, const DWORD* counts, DWORD polylin
|
|||
}
|
||||
|
||||
/* Update the DIBSection of the dc's bitmap */
|
||||
X11DRV_UnlockDIBSection(dc, TRUE);
|
||||
X11DRV_UnlockDIBSection(physDev, TRUE);
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, points );
|
||||
}
|
||||
|
@ -1180,12 +1178,11 @@ X11DRV_PolyPolyline( DC *dc, const POINT* pt, const DWORD* counts, DWORD polylin
|
|||
* (xorg,yorg) is the origin of the X image relative to the drawable.
|
||||
* (x,y) is relative to the origin of the X image.
|
||||
*/
|
||||
static void X11DRV_InternalFloodFill(XImage *image, DC *dc,
|
||||
static void X11DRV_InternalFloodFill(XImage *image, X11DRV_PDEVICE *physDev,
|
||||
int x, int y,
|
||||
int xOrg, int yOrg,
|
||||
Pixel pixel, WORD fillType )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
int left, right;
|
||||
|
||||
#define TO_FLOOD(x,y) ((fillType == FLOODFILLBORDER) ? \
|
||||
|
@ -1220,7 +1217,7 @@ static void X11DRV_InternalFloodFill(XImage *image, DC *dc,
|
|||
while ((x < right) && !TO_FLOOD(x,y)) x++;
|
||||
if (x >= right) break;
|
||||
while ((x < right) && TO_FLOOD(x,y)) x++;
|
||||
X11DRV_InternalFloodFill(image, dc, x-1, y,
|
||||
X11DRV_InternalFloodFill(image, physDev, x-1, y,
|
||||
xOrg, yOrg, pixel, fillType );
|
||||
}
|
||||
}
|
||||
|
@ -1235,7 +1232,7 @@ static void X11DRV_InternalFloodFill(XImage *image, DC *dc,
|
|||
while ((x < right) && !TO_FLOOD(x,y)) x++;
|
||||
if (x >= right) break;
|
||||
while ((x < right) && TO_FLOOD(x,y)) x++;
|
||||
X11DRV_InternalFloodFill(image, dc, x-1, y,
|
||||
X11DRV_InternalFloodFill(image, physDev, x-1, y,
|
||||
xOrg, yOrg, pixel, fillType );
|
||||
}
|
||||
}
|
||||
|
@ -1247,12 +1244,12 @@ static void X11DRV_InternalFloodFill(XImage *image, DC *dc,
|
|||
* X11DRV_ExtFloodFill
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_ExtFloodFill( DC *dc, INT x, INT y, COLORREF color,
|
||||
X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color,
|
||||
UINT fillType )
|
||||
{
|
||||
XImage *image;
|
||||
RECT rect;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("X11DRV_ExtFloodFill %d,%d %06lx %d\n", x, y, color, fillType );
|
||||
|
||||
|
@ -1266,23 +1263,23 @@ X11DRV_ExtFloodFill( DC *dc, INT x, INT y, COLORREF color,
|
|||
rect.bottom - rect.top,
|
||||
AllPlanes, ZPixmap ))) return FALSE;
|
||||
|
||||
if (X11DRV_SetupGCForBrush( dc ))
|
||||
if (X11DRV_SetupGCForBrush( physDev ))
|
||||
{
|
||||
/* Update the pixmap from the DIB section */
|
||||
X11DRV_LockDIBSection(dc, DIB_Status_GdiMod, FALSE);
|
||||
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||
|
||||
/* ROP mode is always GXcopy for flood-fill */
|
||||
wine_tsx11_lock();
|
||||
XSetFunction( gdi_display, physDev->gc, GXcopy );
|
||||
X11DRV_InternalFloodFill(image, dc,
|
||||
X11DRV_InternalFloodFill(image, physDev,
|
||||
XLPTODP(dc,x) + dc->DCOrgX - rect.left,
|
||||
YLPTODP(dc,y) + dc->DCOrgY - rect.top,
|
||||
rect.left, rect.top,
|
||||
X11DRV_PALETTE_ToPhysical( dc, color ),
|
||||
X11DRV_PALETTE_ToPhysical( physDev, color ),
|
||||
fillType );
|
||||
wine_tsx11_unlock();
|
||||
/* Update the DIBSection of the dc's bitmap */
|
||||
X11DRV_UnlockDIBSection(dc, TRUE);
|
||||
X11DRV_UnlockDIBSection(physDev, TRUE);
|
||||
}
|
||||
|
||||
TSXDestroyImage( image );
|
||||
|
@ -1293,44 +1290,29 @@ X11DRV_ExtFloodFill( DC *dc, INT x, INT y, COLORREF color,
|
|||
* X11DRV_SetBkColor
|
||||
*/
|
||||
COLORREF
|
||||
X11DRV_SetBkColor( DC *dc, COLORREF color )
|
||||
X11DRV_SetBkColor( X11DRV_PDEVICE *physDev, COLORREF color )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
COLORREF oldColor;
|
||||
|
||||
oldColor = dc->backgroundColor;
|
||||
dc->backgroundColor = color;
|
||||
|
||||
physDev->backgroundPixel = X11DRV_PALETTE_ToPhysical( dc, color );
|
||||
|
||||
return oldColor;
|
||||
physDev->backgroundPixel = X11DRV_PALETTE_ToPhysical( physDev, color );
|
||||
return color;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* X11DRV_SetTextColor
|
||||
*/
|
||||
COLORREF
|
||||
X11DRV_SetTextColor( DC *dc, COLORREF color )
|
||||
X11DRV_SetTextColor( X11DRV_PDEVICE *physDev, COLORREF color )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
COLORREF oldColor;
|
||||
|
||||
oldColor = dc->textColor;
|
||||
dc->textColor = color;
|
||||
|
||||
physDev->textPixel = X11DRV_PALETTE_ToPhysical( dc, color );
|
||||
|
||||
return oldColor;
|
||||
physDev->textPixel = X11DRV_PALETTE_ToPhysical( physDev, color );
|
||||
return color;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_GetDCOrgEx
|
||||
*/
|
||||
BOOL X11DRV_GetDCOrgEx( DC *dc, LPPOINT lpp )
|
||||
BOOL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp )
|
||||
{
|
||||
if (!(dc->flags & DC_MEMORY))
|
||||
if (!(physDev->dc->flags & DC_MEMORY))
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *) dc->physDev;
|
||||
Window root;
|
||||
int x, y, w, h, border, depth;
|
||||
|
||||
|
|
|
@ -36,17 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
|
|||
|
||||
const DC_FUNCTIONS *X11DRV_DC_Funcs = NULL; /* hack */
|
||||
|
||||
BITMAP_DRIVER X11DRV_BITMAP_Driver =
|
||||
{
|
||||
X11DRV_DIB_SetDIBits,
|
||||
X11DRV_DIB_GetDIBits,
|
||||
X11DRV_DIB_DeleteDIBSection,
|
||||
X11DRV_DIB_SetDIBColorTable,
|
||||
X11DRV_DIB_GetDIBColorTable,
|
||||
X11DRV_DIB_Lock,
|
||||
X11DRV_DIB_Unlock
|
||||
};
|
||||
|
||||
PALETTE_DRIVER X11DRV_PALETTE_Driver =
|
||||
{
|
||||
X11DRV_PALETTE_SetMapping,
|
||||
|
@ -74,7 +63,6 @@ BOOL X11DRV_GDI_Initialize( Display *display )
|
|||
Screen *screen = DefaultScreenOfDisplay(display);
|
||||
|
||||
gdi_display = display;
|
||||
BITMAP_Driver = &X11DRV_BITMAP_Driver;
|
||||
PALETTE_Driver = &X11DRV_PALETTE_Driver;
|
||||
|
||||
palette_size = X11DRV_PALETTE_Init();
|
||||
|
@ -114,12 +102,14 @@ BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
|||
|
||||
if (!X11DRV_DC_Funcs) X11DRV_DC_Funcs = dc->funcs; /* hack */
|
||||
|
||||
dc->physDev = physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
sizeof(*physDev) );
|
||||
physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev) );
|
||||
if(!physDev) {
|
||||
ERR("Can't allocate physDev\n");
|
||||
return FALSE;
|
||||
}
|
||||
dc->physDev = (PHYSDEV)physDev;
|
||||
physDev->hdc = dc->hSelf;
|
||||
physDev->dc = dc; /* FIXME */
|
||||
|
||||
if (dc->flags & DC_MEMORY)
|
||||
{
|
||||
|
@ -172,12 +162,12 @@ BOOL X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
|||
/**********************************************************************
|
||||
* X11DRV_DeleteDC
|
||||
*/
|
||||
BOOL X11DRV_DeleteDC( DC *dc )
|
||||
BOOL X11DRV_DeleteDC( X11DRV_PDEVICE *physDev )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if(physDev->xrender)
|
||||
X11DRV_XRender_DeleteDC(dc);
|
||||
X11DRV_XRender_DeleteDC( physDev );
|
||||
wine_tsx11_lock();
|
||||
XFreeGC( gdi_display, physDev->gc );
|
||||
while (physDev->used_visuals-- > 0)
|
||||
|
@ -192,7 +182,7 @@ BOOL X11DRV_DeleteDC( DC *dc )
|
|||
/***********************************************************************
|
||||
* GetDeviceCaps (X11DRV.@)
|
||||
*/
|
||||
INT X11DRV_GetDeviceCaps( DC *dc, INT cap )
|
||||
INT X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap )
|
||||
{
|
||||
switch(cap)
|
||||
{
|
||||
|
@ -254,7 +244,7 @@ INT X11DRV_GetDeviceCaps( DC *dc, INT cap )
|
|||
case LOGPIXELSY:
|
||||
return log_pixels_y;
|
||||
case CAPS1:
|
||||
FIXME("(%04x): CAPS1 is unimplemented, will return 0\n", dc->hSelf );
|
||||
FIXME("(%04x): CAPS1 is unimplemented, will return 0\n", physDev->hdc );
|
||||
/* please see wingdi.h for the possible bit-flag values that need
|
||||
to be returned. also, see
|
||||
http://msdn.microsoft.com/library/ddkdoc/win95ddk/graphcnt_1m0p.htm */
|
||||
|
@ -275,7 +265,7 @@ INT X11DRV_GetDeviceCaps( DC *dc, INT cap )
|
|||
case BTLALIGNMENT:
|
||||
return 0;
|
||||
default:
|
||||
FIXME("(%04x): unsupported capability %d, will return 0\n", dc->hSelf, cap );
|
||||
FIXME("(%04x): unsupported capability %d, will return 0\n", physDev->hdc, cap );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -284,11 +274,9 @@ INT X11DRV_GetDeviceCaps( DC *dc, INT cap )
|
|||
/**********************************************************************
|
||||
* ExtEscape (X11DRV.@)
|
||||
*/
|
||||
INT X11DRV_ExtEscape( DC *dc, INT escape, INT in_count, LPCVOID in_data,
|
||||
INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID in_data,
|
||||
INT out_count, LPVOID out_data )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
|
||||
switch(escape)
|
||||
{
|
||||
case QUERYESCSUPPORT:
|
||||
|
|
|
@ -29,25 +29,6 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_SelectObject
|
||||
*/
|
||||
HGDIOBJ X11DRV_SelectObject( DC *dc, HGDIOBJ handle )
|
||||
{
|
||||
TRACE("hdc=%04x %04x\n", dc->hSelf, handle );
|
||||
|
||||
switch(GetObjectType( handle ))
|
||||
{
|
||||
case OBJ_PEN: return X11DRV_PEN_SelectObject( dc, handle );
|
||||
case OBJ_BRUSH: return X11DRV_BRUSH_SelectObject( dc, handle );
|
||||
case OBJ_BITMAP: return X11DRV_BITMAP_SelectObject( dc, handle );
|
||||
case OBJ_FONT: return X11DRV_FONT_SelectObject( dc, handle );
|
||||
case OBJ_REGION: return (HGDIOBJ)SelectClipRgn( dc->hSelf, handle );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_DeleteObject
|
||||
*/
|
||||
|
|
|
@ -765,8 +765,9 @@ COLORREF X11DRV_PALETTE_ToLogical(int pixel)
|
|||
*
|
||||
* Return the physical color closest to 'color'.
|
||||
*/
|
||||
int X11DRV_PALETTE_ToPhysical( DC *dc, COLORREF color )
|
||||
int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
|
||||
{
|
||||
DC *dc = physDev ? physDev->dc : NULL;
|
||||
WORD index = 0;
|
||||
HPALETTE16 hPal = (dc)? dc->hPalette: GetStockObject(DEFAULT_PALETTE);
|
||||
unsigned char spec_type = color >> 24;
|
||||
|
|
|
@ -32,17 +32,15 @@ static const char PEN_dashdotdot[] = { 12,4,4,4,4,4 };
|
|||
static const char PEN_alternate[] = { 1,1 };
|
||||
|
||||
/***********************************************************************
|
||||
* PEN_SelectObject
|
||||
* X11DRV_SelectPen (X11DRV.@)
|
||||
*/
|
||||
HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
||||
HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen )
|
||||
{
|
||||
LOGPEN logpen;
|
||||
HPEN prevHandle = dc->hPen;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if (!GetObjectA( hpen, sizeof(logpen), &logpen )) return 0;
|
||||
|
||||
dc->hPen = hpen;
|
||||
physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK;
|
||||
physDev->pen.type = logpen.lopnStyle & PS_TYPE_MASK;
|
||||
physDev->pen.endcap = logpen.lopnStyle & PS_ENDCAP_MASK;
|
||||
|
@ -52,7 +50,7 @@ HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
|||
dc->xformWorld2Vport.eM11 * 0.5);
|
||||
if (physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
|
||||
if (physDev->pen.width == 1) physDev->pen.width = 0; /* Faster */
|
||||
physDev->pen.pixel = X11DRV_PALETTE_ToPhysical( dc, logpen.lopnColor );
|
||||
physDev->pen.pixel = X11DRV_PALETTE_ToPhysical( physDev, logpen.lopnColor );
|
||||
switch(logpen.lopnStyle & PS_STYLE_MASK)
|
||||
{
|
||||
case PS_DASH:
|
||||
|
@ -79,6 +77,5 @@ HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
|||
FIXME("PS_USERSTYLE is not supported\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return prevHandle;
|
||||
return hpen;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(text);
|
|||
* X11DRV_ExtTextOut
|
||||
*/
|
||||
BOOL
|
||||
X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||
X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR wstr, UINT count,
|
||||
const INT *lpDx )
|
||||
{
|
||||
|
@ -55,18 +55,17 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
RECT rect;
|
||||
char dfBreakChar, lfUnderline, lfStrikeOut;
|
||||
BOOL rotated = FALSE;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
XChar2b *str2b = NULL;
|
||||
BOOL dibUpdateFlag = FALSE;
|
||||
BOOL result = TRUE;
|
||||
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
if(dc->gdiFont)
|
||||
return X11DRV_XRender_ExtTextOut(dc, x, y, flags, lprect, wstr, count,
|
||||
return X11DRV_XRender_ExtTextOut(physDev, x, y, flags, lprect, wstr, count,
|
||||
lpDx);
|
||||
|
||||
|
||||
if (!X11DRV_SetupGCForText( dc )) return TRUE;
|
||||
if (!X11DRV_SetupGCForText( physDev )) return TRUE;
|
||||
|
||||
pfo = XFONT_GetFontObject( physDev->font );
|
||||
font = pfo->fs;
|
||||
|
@ -104,7 +103,7 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
SIZE sz;
|
||||
if (flags & ETO_CLIPPED) /* Can't clip with no rectangle */
|
||||
return FALSE;
|
||||
if (!X11DRV_GetTextExtentPoint( dc, wstr, count, &sz ))
|
||||
if (!X11DRV_GetTextExtentPoint( physDev, wstr, count, &sz ))
|
||||
return FALSE;
|
||||
rect.left = INTERNAL_XWPTODP( dc, x, y );
|
||||
rect.right = INTERNAL_XWPTODP( dc, x+sz.cx, y+sz.cy );
|
||||
|
@ -132,7 +131,7 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
|
||||
if (flags & ETO_OPAQUE)
|
||||
{
|
||||
X11DRV_LockDIBSection( dc, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_LockDIBSection( physDev, DIB_Status_GdiMod, FALSE );
|
||||
dibUpdateFlag = TRUE;
|
||||
TSXSetForeground( gdi_display, physDev->gc, physDev->backgroundPixel );
|
||||
TSXFillRectangle( gdi_display, physDev->drawable, physDev->gc,
|
||||
|
@ -151,7 +150,7 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
else
|
||||
{
|
||||
SIZE sz;
|
||||
if (!X11DRV_GetTextExtentPoint( dc, wstr, count, &sz ))
|
||||
if (!X11DRV_GetTextExtentPoint( physDev, wstr, count, &sz ))
|
||||
return FALSE;
|
||||
width = INTERNAL_XWSTODS(dc, sz.cx);
|
||||
}
|
||||
|
@ -215,11 +214,11 @@ X11DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
|||
|
||||
if (!dibUpdateFlag)
|
||||
{
|
||||
X11DRV_LockDIBSection( dc, DIB_Status_GdiMod, FALSE );
|
||||
X11DRV_LockDIBSection( physDev, DIB_Status_GdiMod, FALSE );
|
||||
dibUpdateFlag = TRUE;
|
||||
}
|
||||
|
||||
if (dc->backgroundMode != TRANSPARENT)
|
||||
if (GetBkMode( physDev->hdc ) != TRANSPARENT)
|
||||
{
|
||||
/* If rectangle is opaque and clipped, do nothing */
|
||||
if (!(flags & ETO_CLIPPED) || !(flags & ETO_OPAQUE))
|
||||
|
@ -406,7 +405,7 @@ FAIL:
|
|||
result = FALSE;
|
||||
|
||||
END:
|
||||
if (dibUpdateFlag) X11DRV_UnlockDIBSection( dc, TRUE );
|
||||
if (dibUpdateFlag) X11DRV_UnlockDIBSection( physDev, TRUE );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -414,10 +413,10 @@ END:
|
|||
/***********************************************************************
|
||||
* X11DRV_GetTextExtentPoint
|
||||
*/
|
||||
BOOL X11DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
|
||||
BOOL X11DRV_GetTextExtentPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count,
|
||||
LPSIZE size )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
fontObject* pfo = XFONT_GetFontObject( physDev->font );
|
||||
|
||||
TRACE("%s %d\n", debugstr_wn(str,count), count);
|
||||
|
|
|
@ -3182,13 +3182,13 @@ LPIFONTINFO16 XFONT_GetFontInfo( X_PHYSFONT pFont )
|
|||
* *
|
||||
***********************************************************************/
|
||||
/***********************************************************************
|
||||
* X11DRV_FONT_SelectObject
|
||||
* X11DRV_SelectFont (X11DRV.@)
|
||||
*/
|
||||
HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont )
|
||||
HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont )
|
||||
{
|
||||
LOGFONTW logfont;
|
||||
LOGFONT16 lf;
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
DC *dc = physDev->dc;
|
||||
|
||||
TRACE("dc=%p, hfont=%04x\n", dc, hfont);
|
||||
|
||||
|
@ -3197,7 +3197,7 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont )
|
|||
TRACE("dc->gdiFont = %p\n", dc->gdiFont);
|
||||
|
||||
if(dc->gdiFont && X11DRV_XRender_Installed) {
|
||||
X11DRV_XRender_SelectFont(dc, hfont);
|
||||
X11DRV_XRender_SelectFont(physDev, hfont);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -3326,9 +3326,8 @@ BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
|
|||
/***********************************************************************
|
||||
* X11DRV_GetTextMetrics
|
||||
*/
|
||||
BOOL X11DRV_GetTextMetrics(DC *dc, TEXTMETRICW *metrics)
|
||||
BOOL X11DRV_GetTextMetrics(X11DRV_PDEVICE *physDev, TEXTMETRICW *metrics)
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
TEXTMETRICA tmA;
|
||||
|
||||
if( CHECK_PFONT(physDev->font) )
|
||||
|
@ -3345,10 +3344,9 @@ BOOL X11DRV_GetTextMetrics(DC *dc, TEXTMETRICW *metrics)
|
|||
/***********************************************************************
|
||||
* X11DRV_GetCharWidth
|
||||
*/
|
||||
BOOL X11DRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
|
||||
BOOL X11DRV_GetCharWidth( X11DRV_PDEVICE *physDev, UINT firstChar, UINT lastChar,
|
||||
LPINT buffer )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
fontObject* pfo = XFONT_GetFontObject( physDev->font );
|
||||
|
||||
if( pfo )
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
|
||||
#include "gdi.h"
|
||||
|
||||
struct tagGDI_BITMAP_DRIVER;
|
||||
|
||||
/* Flags used for BitmapBits. We only use the first two at the moment */
|
||||
|
||||
#define DDB_SET 1
|
||||
|
@ -48,19 +46,6 @@ typedef struct tagBITMAPOBJ
|
|||
SEGPTR segptr_bits; /* segptr to DIB bits */
|
||||
} BITMAPOBJ;
|
||||
|
||||
typedef struct tagBITMAP_DRIVER
|
||||
{
|
||||
INT (*pSetDIBits)(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,LPCVOID,const BITMAPINFO *,UINT,HBITMAP);
|
||||
INT (*pGetDIBits)(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,LPVOID,BITMAPINFO *,UINT,HBITMAP);
|
||||
VOID (*pDeleteDIBSection)(struct tagBITMAPOBJ *);
|
||||
UINT (*pSetDIBColorTable)(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,const RGBQUAD *);
|
||||
UINT (*pGetDIBColorTable)(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,RGBQUAD *);
|
||||
INT (*pLockDIB)(struct tagBITMAPOBJ *,INT,BOOL);
|
||||
VOID (*pUnlockDIB)(struct tagBITMAPOBJ *,BOOL);
|
||||
} BITMAP_DRIVER;
|
||||
|
||||
extern BITMAP_DRIVER *BITMAP_Driver;
|
||||
|
||||
/* objects/bitmap.c */
|
||||
extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
|
||||
extern INT BITMAP_GetObject( BITMAPOBJ * bmp, INT count, LPVOID buffer );
|
||||
|
@ -77,7 +62,6 @@ extern int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width,
|
|||
extern HBITMAP DIB_CreateDIBSection( HDC hdc, BITMAPINFO *bmi, UINT usage, LPVOID *bits,
|
||||
HANDLE section, DWORD offset, DWORD ovr_pitch );
|
||||
extern void DIB_UpdateDIBSection( DC *dc, BOOL toDIB );
|
||||
extern void DIB_DeleteDIBSection( BITMAPOBJ *bmp );
|
||||
extern void DIB_SelectDIBSection( DC *dc, BITMAPOBJ *bmp );
|
||||
extern HGLOBAL DIB_CreateDIBFromBitmap(HDC hdc, HBITMAP hBmp);
|
||||
|
||||
|
|
201
include/gdi.h
201
include/gdi.h
|
@ -62,12 +62,14 @@ typedef struct tagGDIOBJHDR
|
|||
|
||||
typedef struct tagGdiFont *GdiFont;
|
||||
|
||||
typedef struct { int opaque; } *PHYSDEV; /* PHYSDEV is an opaque pointer */
|
||||
|
||||
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) */
|
||||
PHYSDEV physDev; /* Physical device (driver-specific) */
|
||||
INT saveLevel;
|
||||
DWORD dwHookData;
|
||||
FARPROC16 hookProc; /* the original SEGPTR ... */
|
||||
|
@ -138,108 +140,113 @@ typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONTEXW,LPNEWTEXTMETRICEXW,DWORD,
|
|||
|
||||
typedef struct tagDC_FUNCS
|
||||
{
|
||||
INT (*pAbortDoc)(DC*);
|
||||
BOOL (*pAbortPath)(DC*);
|
||||
BOOL (*pAngleArc)(DC*,INT,INT,DWORD,FLOAT,FLOAT);
|
||||
BOOL (*pArc)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
|
||||
BOOL (*pArcTo)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
|
||||
BOOL (*pBeginPath)(DC*);
|
||||
BOOL (*pBitBlt)(DC*,INT,INT,INT,INT,DC*,INT,INT,DWORD);
|
||||
INT (*pAbortDoc)(PHYSDEV);
|
||||
BOOL (*pAbortPath)(PHYSDEV);
|
||||
BOOL (*pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT);
|
||||
BOOL (*pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
|
||||
BOOL (*pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
|
||||
BOOL (*pBeginPath)(PHYSDEV);
|
||||
BOOL (*pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD);
|
||||
LONG (*pBitmapBits)(HBITMAP,void*,LONG,WORD);
|
||||
INT (*pChoosePixelFormat)(DC*,const PIXELFORMATDESCRIPTOR *);
|
||||
BOOL (*pChord)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
|
||||
BOOL (*pCloseFigure)(DC*);
|
||||
INT (*pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *);
|
||||
BOOL (*pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
|
||||
BOOL (*pCloseFigure)(PHYSDEV);
|
||||
BOOL (*pCreateBitmap)(HBITMAP);
|
||||
BOOL (*pCreateDC)(DC*,LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
|
||||
HBITMAP (*pCreateDIBSection)(DC *,BITMAPINFO *,UINT,LPVOID *,HANDLE,
|
||||
DWORD,DWORD);
|
||||
BOOL (*pDeleteDC)(DC*);
|
||||
BOOL (*pCreateDC)(DC *,LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
|
||||
HBITMAP (*pCreateDIBSection)(PHYSDEV,BITMAPINFO *,UINT,LPVOID *,HANDLE,DWORD,DWORD);
|
||||
BOOL (*pDeleteDC)(PHYSDEV);
|
||||
BOOL (*pDeleteObject)(HGDIOBJ);
|
||||
INT (*pDescribePixelFormat)(DC *,INT,UINT,PIXELFORMATDESCRIPTOR *);
|
||||
INT (*pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *);
|
||||
DWORD (*pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA);
|
||||
BOOL (*pEllipse)(DC*,INT,INT,INT,INT);
|
||||
INT (*pEndDoc)(DC*);
|
||||
INT (*pEndPage)(DC*);
|
||||
BOOL (*pEndPath)(DC*);
|
||||
BOOL (*pEllipse)(PHYSDEV,INT,INT,INT,INT);
|
||||
INT (*pEndDoc)(PHYSDEV);
|
||||
INT (*pEndPage)(PHYSDEV);
|
||||
BOOL (*pEndPath)(PHYSDEV);
|
||||
BOOL (*pEnumDeviceFonts)(HDC,LPLOGFONTW,DEVICEFONTENUMPROC,LPARAM);
|
||||
INT (*pExcludeClipRect)(DC*,INT,INT,INT,INT);
|
||||
INT (*pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
|
||||
INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
|
||||
INT (*pExtEscape)(DC*,INT,INT,LPCVOID,INT,LPVOID);
|
||||
BOOL (*pExtFloodFill)(DC*,INT,INT,COLORREF,UINT);
|
||||
BOOL (*pExtTextOut)(DC*,INT,INT,UINT,const RECT*,LPCWSTR,UINT,
|
||||
const INT*);
|
||||
BOOL (*pFillPath)(DC*);
|
||||
BOOL (*pFillRgn)(DC*,HRGN,HBRUSH);
|
||||
BOOL (*pFlattenPath)(DC*);
|
||||
BOOL (*pFrameRgn)(DC*,HRGN,HBRUSH,INT,INT);
|
||||
BOOL (*pGetCharWidth)(DC*,UINT,UINT,LPINT);
|
||||
BOOL (*pGetDCOrgEx)(DC*,LPPOINT);
|
||||
INT (*pGetDeviceCaps)(DC*,INT);
|
||||
BOOL (*pGetDeviceGammaRamp)(DC*,LPVOID);
|
||||
COLORREF (*pGetPixel)(DC*,INT,INT);
|
||||
INT (*pGetPixelFormat)(DC*);
|
||||
BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE);
|
||||
BOOL (*pGetTextMetrics)(DC*,TEXTMETRICW*);
|
||||
INT (*pIntersectClipRect)(DC*,INT,INT,INT,INT);
|
||||
BOOL (*pInvertRgn)(DC*,HRGN);
|
||||
BOOL (*pLineTo)(DC*,INT,INT);
|
||||
BOOL (*pMoveTo)(DC*,INT,INT);
|
||||
INT (*pOffsetClipRgn)(DC*,INT,INT);
|
||||
BOOL (*pOffsetViewportOrg)(DC*,INT,INT);
|
||||
BOOL (*pOffsetWindowOrg)(DC*,INT,INT);
|
||||
BOOL (*pPaintRgn)(DC*,HRGN);
|
||||
BOOL (*pPatBlt)(DC*,INT,INT,INT,INT,DWORD);
|
||||
BOOL (*pPie)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
|
||||
BOOL (*pPolyBezier)(DC*,const POINT*,DWORD);
|
||||
BOOL (*pPolyBezierTo)(DC*,const POINT*,DWORD);
|
||||
BOOL (*pPolyDraw)(DC*,const POINT*,const BYTE *,DWORD);
|
||||
BOOL (*pPolyPolygon)(DC*,const POINT*,const INT*,UINT);
|
||||
BOOL (*pPolyPolyline)(DC*,const POINT*,const DWORD*,DWORD);
|
||||
BOOL (*pPolygon)(DC*,const POINT*,INT);
|
||||
BOOL (*pPolyline)(DC*,const POINT*,INT);
|
||||
BOOL (*pPolylineTo)(DC*,const POINT*,INT);
|
||||
UINT (*pRealizePalette)(DC*);
|
||||
BOOL (*pRectangle)(DC*,INT,INT,INT,INT);
|
||||
BOOL (*pRestoreDC)(DC*,INT);
|
||||
BOOL (*pRoundRect)(DC*,INT,INT,INT,INT,INT,INT);
|
||||
INT (*pSaveDC)(DC*);
|
||||
BOOL (*pScaleViewportExt)(DC*,INT,INT,INT,INT);
|
||||
BOOL (*pScaleWindowExt)(DC*,INT,INT,INT,INT);
|
||||
BOOL (*pSelectClipPath)(DC*,INT);
|
||||
INT (*pSelectClipRgn)(DC*,HRGN);
|
||||
HANDLE (*pSelectObject)(DC*,HANDLE);
|
||||
HPALETTE (*pSelectPalette)(DC*,HPALETTE,BOOL);
|
||||
COLORREF (*pSetBkColor)(DC*,COLORREF);
|
||||
INT (*pSetBkMode)(DC*,INT);
|
||||
VOID (*pSetDeviceClipping)(DC*);
|
||||
BOOL (*pSetDeviceGammaRamp)(DC*,LPVOID);
|
||||
INT (*pSetDIBitsToDevice)(DC*,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,
|
||||
LPCVOID,const BITMAPINFO*,UINT);
|
||||
INT (*pSetMapMode)(DC*,INT);
|
||||
DWORD (*pSetMapperFlags)(DC*,DWORD);
|
||||
COLORREF (*pSetPixel)(DC*,INT,INT,COLORREF);
|
||||
BOOL (*pSetPixelFormat)(DC*,INT,const PIXELFORMATDESCRIPTOR *);
|
||||
INT (*pSetPolyFillMode)(DC*,INT);
|
||||
INT (*pSetROP2)(DC*,INT);
|
||||
INT (*pSetRelAbs)(DC*,INT);
|
||||
INT (*pSetStretchBltMode)(DC*,INT);
|
||||
UINT (*pSetTextAlign)(DC*,UINT);
|
||||
INT (*pSetTextCharacterExtra)(DC*,INT);
|
||||
DWORD (*pSetTextColor)(DC*,DWORD);
|
||||
INT (*pSetTextJustification)(DC*,INT,INT);
|
||||
BOOL (*pSetViewportExt)(DC*,INT,INT);
|
||||
BOOL (*pSetViewportOrg)(DC*,INT,INT);
|
||||
BOOL (*pSetWindowExt)(DC*,INT,INT);
|
||||
BOOL (*pSetWindowOrg)(DC*,INT,INT);
|
||||
INT (*pStartDoc)(DC*,const DOCINFOA*);
|
||||
INT (*pStartPage)(DC*);
|
||||
BOOL (*pStretchBlt)(DC*,INT,INT,INT,INT,DC*,INT,INT,INT,INT,DWORD);
|
||||
INT (*pStretchDIBits)(DC*,INT,INT,INT,INT,INT,INT,INT,INT,
|
||||
const void *,const BITMAPINFO *,UINT,DWORD);
|
||||
BOOL (*pStrokeAndFillPath)(DC*);
|
||||
BOOL (*pStrokePath)(DC*);
|
||||
BOOL (*pSwapBuffers)(DC*);
|
||||
BOOL (*pWidenPath)(DC*);
|
||||
INT (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
|
||||
BOOL (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
|
||||
BOOL (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
|
||||
BOOL (*pFillPath)(PHYSDEV);
|
||||
BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
|
||||
BOOL (*pFlattenPath)(PHYSDEV);
|
||||
BOOL (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT);
|
||||
BOOL (*pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT);
|
||||
BOOL (*pGetDCOrgEx)(PHYSDEV,LPPOINT);
|
||||
UINT (*pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*);
|
||||
INT (*pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT);
|
||||
INT (*pGetDeviceCaps)(PHYSDEV,INT);
|
||||
BOOL (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID);
|
||||
COLORREF (*pGetPixel)(PHYSDEV,INT,INT);
|
||||
INT (*pGetPixelFormat)(PHYSDEV);
|
||||
BOOL (*pGetTextExtentPoint)(PHYSDEV,LPCWSTR,INT,LPSIZE);
|
||||
BOOL (*pGetTextMetrics)(PHYSDEV,TEXTMETRICW*);
|
||||
INT (*pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT);
|
||||
BOOL (*pInvertRgn)(PHYSDEV,HRGN);
|
||||
BOOL (*pLineTo)(PHYSDEV,INT,INT);
|
||||
BOOL (*pMoveTo)(PHYSDEV,INT,INT);
|
||||
INT (*pOffsetClipRgn)(PHYSDEV,INT,INT);
|
||||
BOOL (*pOffsetViewportOrg)(PHYSDEV,INT,INT);
|
||||
BOOL (*pOffsetWindowOrg)(PHYSDEV,INT,INT);
|
||||
BOOL (*pPaintRgn)(PHYSDEV,HRGN);
|
||||
BOOL (*pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD);
|
||||
BOOL (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
|
||||
BOOL (*pPolyBezier)(PHYSDEV,const POINT*,DWORD);
|
||||
BOOL (*pPolyBezierTo)(PHYSDEV,const POINT*,DWORD);
|
||||
BOOL (*pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD);
|
||||
BOOL (*pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT);
|
||||
BOOL (*pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD);
|
||||
BOOL (*pPolygon)(PHYSDEV,const POINT*,INT);
|
||||
BOOL (*pPolyline)(PHYSDEV,const POINT*,INT);
|
||||
BOOL (*pPolylineTo)(PHYSDEV,const POINT*,INT);
|
||||
UINT (*pRealizePalette)(PHYSDEV);
|
||||
BOOL (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
|
||||
BOOL (*pRestoreDC)(PHYSDEV,INT);
|
||||
BOOL (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT);
|
||||
INT (*pSaveDC)(PHYSDEV);
|
||||
BOOL (*pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT);
|
||||
BOOL (*pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT);
|
||||
HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP);
|
||||
HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH);
|
||||
BOOL (*pSelectClipPath)(PHYSDEV,INT);
|
||||
INT (*pSelectClipRgn)(PHYSDEV,HRGN);
|
||||
HFONT (*pSelectFont)(PHYSDEV,HFONT);
|
||||
HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
|
||||
HPEN (*pSelectPen)(PHYSDEV,HPEN);
|
||||
COLORREF (*pSetBkColor)(PHYSDEV,COLORREF);
|
||||
INT (*pSetBkMode)(PHYSDEV,INT);
|
||||
UINT (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*);
|
||||
INT (*pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
|
||||
INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,
|
||||
const BITMAPINFO*,UINT);
|
||||
VOID (*pSetDeviceClipping)(PHYSDEV);
|
||||
BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID);
|
||||
INT (*pSetMapMode)(PHYSDEV,INT);
|
||||
DWORD (*pSetMapperFlags)(PHYSDEV,DWORD);
|
||||
COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF);
|
||||
BOOL (*pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *);
|
||||
INT (*pSetPolyFillMode)(PHYSDEV,INT);
|
||||
INT (*pSetROP2)(PHYSDEV,INT);
|
||||
INT (*pSetRelAbs)(PHYSDEV,INT);
|
||||
INT (*pSetStretchBltMode)(PHYSDEV,INT);
|
||||
UINT (*pSetTextAlign)(PHYSDEV,UINT);
|
||||
INT (*pSetTextCharacterExtra)(PHYSDEV,INT);
|
||||
DWORD (*pSetTextColor)(PHYSDEV,DWORD);
|
||||
INT (*pSetTextJustification)(PHYSDEV,INT,INT);
|
||||
BOOL (*pSetViewportExt)(PHYSDEV,INT,INT);
|
||||
BOOL (*pSetViewportOrg)(PHYSDEV,INT,INT);
|
||||
BOOL (*pSetWindowExt)(PHYSDEV,INT,INT);
|
||||
BOOL (*pSetWindowOrg)(PHYSDEV,INT,INT);
|
||||
INT (*pStartDoc)(PHYSDEV,const DOCINFOA*);
|
||||
INT (*pStartPage)(PHYSDEV);
|
||||
BOOL (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD);
|
||||
INT (*pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *,
|
||||
const BITMAPINFO*,UINT,DWORD);
|
||||
BOOL (*pStrokeAndFillPath)(PHYSDEV);
|
||||
BOOL (*pStrokePath)(PHYSDEV);
|
||||
BOOL (*pSwapBuffers)(PHYSDEV);
|
||||
BOOL (*pWidenPath)(PHYSDEV);
|
||||
} DC_FUNCTIONS;
|
||||
|
||||
/* DC hook codes */
|
||||
|
|
118
include/x11drv.h
118
include/x11drv.h
|
@ -45,8 +45,6 @@
|
|||
|
||||
struct tagBITMAPOBJ;
|
||||
struct tagCURSORICONINFO;
|
||||
struct tagDC;
|
||||
struct tagDeviceCaps;
|
||||
struct tagPALETTEOBJ;
|
||||
struct tagWINDOWPOS;
|
||||
|
||||
|
@ -80,6 +78,8 @@ typedef struct tagXRENDERINFO *XRENDERINFO;
|
|||
/* X physical device */
|
||||
typedef struct
|
||||
{
|
||||
HDC hdc;
|
||||
DC *dc; /* direct pointer to DC, should go away */
|
||||
GC gc; /* X Window GC */
|
||||
Drawable drawable;
|
||||
X_PHYSFONT font;
|
||||
|
@ -105,77 +105,75 @@ extern unsigned int X11DRV_server_startticks;
|
|||
|
||||
/* Wine driver X11 functions */
|
||||
|
||||
extern BOOL X11DRV_BitBlt( struct tagDC *dcDst, INT xDst, INT yDst,
|
||||
INT width, INT height, struct tagDC *dcSrc,
|
||||
extern BOOL X11DRV_BitBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
||||
INT width, INT height, X11DRV_PDEVICE *physDevSrc,
|
||||
INT xSrc, INT ySrc, DWORD rop );
|
||||
extern BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
|
||||
DEVICEFONTENUMPROC dfeproc, LPARAM lp );
|
||||
extern BOOL X11DRV_GetCharWidth( struct tagDC *dc, UINT firstChar,
|
||||
extern BOOL X11DRV_GetCharWidth( X11DRV_PDEVICE *physDev, UINT firstChar,
|
||||
UINT lastChar, LPINT buffer );
|
||||
extern BOOL X11DRV_GetDCOrgEx( struct tagDC *dc, LPPOINT lpp );
|
||||
extern BOOL X11DRV_GetTextExtentPoint( struct tagDC *dc, LPCWSTR str,
|
||||
extern BOOL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp );
|
||||
extern BOOL X11DRV_GetTextExtentPoint( X11DRV_PDEVICE *physDev, LPCWSTR str,
|
||||
INT count, LPSIZE size );
|
||||
extern BOOL X11DRV_GetTextMetrics(struct tagDC *dc, TEXTMETRICW *metrics);
|
||||
extern BOOL X11DRV_PatBlt( struct tagDC *dc, INT left, INT top,
|
||||
extern BOOL X11DRV_GetTextMetrics(X11DRV_PDEVICE *physDev, TEXTMETRICW *metrics);
|
||||
extern BOOL X11DRV_PatBlt( X11DRV_PDEVICE *physDev, INT left, INT top,
|
||||
INT width, INT height, DWORD rop );
|
||||
extern VOID X11DRV_SetDeviceClipping(struct tagDC *dc);
|
||||
extern BOOL X11DRV_StretchBlt( struct tagDC *dcDst, INT xDst, INT yDst,
|
||||
extern VOID X11DRV_SetDeviceClipping(X11DRV_PDEVICE *physDev);
|
||||
extern BOOL X11DRV_StretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
||||
INT widthDst, INT heightDst,
|
||||
struct tagDC *dcSrc, INT xSrc, INT ySrc,
|
||||
X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc,
|
||||
INT widthSrc, INT heightSrc, DWORD rop );
|
||||
extern BOOL X11DRV_LineTo( struct tagDC *dc, INT x, INT y);
|
||||
extern BOOL X11DRV_Arc( struct tagDC *dc, INT left, INT top, INT right,
|
||||
extern BOOL X11DRV_LineTo( X11DRV_PDEVICE *physDev, INT x, INT y);
|
||||
extern BOOL X11DRV_Arc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart, INT xend,
|
||||
INT yend );
|
||||
extern BOOL X11DRV_Pie( struct tagDC *dc, INT left, INT top, INT right,
|
||||
extern BOOL X11DRV_Pie( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart, INT xend,
|
||||
INT yend );
|
||||
extern BOOL X11DRV_Chord( struct tagDC *dc, INT left, INT top,
|
||||
extern BOOL X11DRV_Chord( X11DRV_PDEVICE *physDev, INT left, INT top,
|
||||
INT right, INT bottom, INT xstart,
|
||||
INT ystart, INT xend, INT yend );
|
||||
extern BOOL X11DRV_Ellipse( struct tagDC *dc, INT left, INT top,
|
||||
extern BOOL X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top,
|
||||
INT right, INT bottom );
|
||||
extern BOOL X11DRV_Rectangle(struct tagDC *dc, INT left, INT top,
|
||||
extern BOOL X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top,
|
||||
INT right, INT bottom);
|
||||
extern BOOL X11DRV_RoundRect( struct tagDC *dc, INT left, INT top,
|
||||
extern BOOL X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top,
|
||||
INT right, INT bottom, INT ell_width,
|
||||
INT ell_height );
|
||||
extern COLORREF X11DRV_SetPixel( struct tagDC *dc, INT x, INT y,
|
||||
extern COLORREF X11DRV_SetPixel( X11DRV_PDEVICE *physDev, INT x, INT y,
|
||||
COLORREF color );
|
||||
extern COLORREF X11DRV_GetPixel( struct tagDC *dc, INT x, INT y);
|
||||
extern BOOL X11DRV_PaintRgn( struct tagDC *dc, HRGN hrgn );
|
||||
extern BOOL X11DRV_Polyline( struct tagDC *dc,const POINT* pt,INT count);
|
||||
extern BOOL X11DRV_Polygon( struct tagDC *dc, const POINT* pt, INT count );
|
||||
extern BOOL X11DRV_PolyPolygon( struct tagDC *dc, const POINT* pt,
|
||||
extern COLORREF X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y);
|
||||
extern BOOL X11DRV_PaintRgn( X11DRV_PDEVICE *physDev, HRGN hrgn );
|
||||
extern BOOL X11DRV_Polyline( X11DRV_PDEVICE *physDev,const POINT* pt,INT count);
|
||||
extern BOOL X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count );
|
||||
extern BOOL X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt,
|
||||
const INT* counts, UINT polygons);
|
||||
extern BOOL X11DRV_PolyPolyline( struct tagDC *dc, const POINT* pt,
|
||||
extern BOOL X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt,
|
||||
const DWORD* counts, DWORD polylines);
|
||||
|
||||
extern HGDIOBJ X11DRV_SelectObject( struct tagDC *dc, HGDIOBJ handle );
|
||||
|
||||
extern COLORREF X11DRV_SetBkColor( struct tagDC *dc, COLORREF color );
|
||||
extern COLORREF X11DRV_SetTextColor( struct tagDC *dc, COLORREF color );
|
||||
extern BOOL X11DRV_ExtFloodFill( struct tagDC *dc, INT x, INT y,
|
||||
extern COLORREF X11DRV_SetBkColor( X11DRV_PDEVICE *physDev, COLORREF color );
|
||||
extern COLORREF X11DRV_SetTextColor( X11DRV_PDEVICE *physDev, COLORREF color );
|
||||
extern BOOL X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y,
|
||||
COLORREF color, UINT fillType );
|
||||
extern BOOL X11DRV_ExtTextOut( struct tagDC *dc, INT x, INT y,
|
||||
extern BOOL X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y,
|
||||
UINT flags, const RECT *lprect,
|
||||
LPCWSTR str, UINT count, const INT *lpDx );
|
||||
extern BOOL X11DRV_CreateBitmap( HBITMAP hbitmap );
|
||||
extern BOOL X11DRV_DeleteObject( HGDIOBJ handle );
|
||||
extern LONG X11DRV_BitmapBits( HBITMAP hbitmap, void *bits, LONG count,
|
||||
WORD flags );
|
||||
extern INT X11DRV_SetDIBitsToDevice( struct tagDC *dc, INT xDest,
|
||||
extern INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest,
|
||||
INT yDest, DWORD cx, DWORD cy,
|
||||
INT xSrc, INT ySrc,
|
||||
UINT startscan, UINT lines,
|
||||
LPCVOID bits, const BITMAPINFO *info,
|
||||
UINT coloruse );
|
||||
extern INT X11DRV_DeviceBitmapBits( struct tagDC *dc, HBITMAP hbitmap,
|
||||
extern INT X11DRV_DeviceBitmapBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap,
|
||||
WORD fGet, UINT startscan,
|
||||
UINT lines, LPSTR bits,
|
||||
LPBITMAPINFO info, UINT coloruse );
|
||||
extern BOOL X11DRV_GetDeviceGammaRamp( struct tagDC *dc, LPVOID ramp );
|
||||
extern BOOL X11DRV_SetDeviceGammaRamp( struct tagDC *dc, LPVOID ramp );
|
||||
extern BOOL X11DRV_GetDeviceGammaRamp( X11DRV_PDEVICE *physDev, LPVOID ramp );
|
||||
extern BOOL X11DRV_SetDeviceGammaRamp( X11DRV_PDEVICE *physDev, LPVOID ramp );
|
||||
|
||||
/* OpenGL / X11 driver functions */
|
||||
extern int X11DRV_ChoosePixelFormat(DC *dc, const PIXELFORMATDESCRIPTOR *pppfd) ;
|
||||
|
@ -188,10 +186,6 @@ extern BOOL X11DRV_SwapBuffers(DC *dc) ;
|
|||
|
||||
extern BOOL X11DRV_BITMAP_Init(void);
|
||||
extern int X11DRV_FONT_Init( int *log_pixels_x, int *log_pixels_y );
|
||||
extern HBRUSH X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush );
|
||||
extern HFONT X11DRV_FONT_SelectObject( DC * dc, HFONT hfont );
|
||||
extern HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen );
|
||||
extern HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap );
|
||||
extern BOOL X11DRV_BITMAP_DeleteObject( HBITMAP hbitmap );
|
||||
|
||||
struct tagBITMAPOBJ;
|
||||
|
@ -207,10 +201,10 @@ extern void X11DRV_SetDrawable( HDC hdc, Drawable drawable, int mode, int org_x,
|
|||
extern void X11DRV_StartGraphicsExposures( HDC hdc );
|
||||
extern void X11DRV_EndGraphicsExposures( HDC hdc, HRGN hrgn );
|
||||
|
||||
extern BOOL X11DRV_SetupGCForPatBlt( struct tagDC *dc, GC gc, BOOL fMapColors );
|
||||
extern BOOL X11DRV_SetupGCForBrush( struct tagDC *dc );
|
||||
extern BOOL X11DRV_SetupGCForPen( struct tagDC *dc );
|
||||
extern BOOL X11DRV_SetupGCForText( struct tagDC *dc );
|
||||
extern BOOL X11DRV_SetupGCForPatBlt( X11DRV_PDEVICE *physDev, GC gc, BOOL fMapColors );
|
||||
extern BOOL X11DRV_SetupGCForBrush( X11DRV_PDEVICE *physDev );
|
||||
extern BOOL X11DRV_SetupGCForPen( X11DRV_PDEVICE *physDev );
|
||||
extern BOOL X11DRV_SetupGCForText( X11DRV_PDEVICE *physDev );
|
||||
|
||||
extern const int X11DRV_XROPfunction[];
|
||||
|
||||
|
@ -219,12 +213,12 @@ extern void _XInitImageFuncPtrs(XImage *);
|
|||
extern BOOL X11DRV_XRender_Installed;
|
||||
extern void X11DRV_XRender_Init(void);
|
||||
extern void X11DRV_XRender_Finalize(void);
|
||||
extern BOOL X11DRV_XRender_SelectFont(struct tagDC*, HFONT);
|
||||
extern void X11DRV_XRender_DeleteDC(struct tagDC*);
|
||||
extern BOOL X11DRV_XRender_ExtTextOut(DC *dc, INT x, INT y, UINT flags,
|
||||
extern BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE*, HFONT);
|
||||
extern void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE*);
|
||||
extern BOOL X11DRV_XRender_ExtTextOut(X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
||||
const RECT *lprect, LPCWSTR wstr,
|
||||
UINT count, const INT *lpDx);
|
||||
extern void X11DRV_XRender_UpdateDrawable(DC *dc);
|
||||
extern void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev);
|
||||
|
||||
/* exported dib functions for now */
|
||||
|
||||
|
@ -258,36 +252,24 @@ typedef struct
|
|||
|
||||
} X11DRV_DIBSECTION;
|
||||
|
||||
extern int *X11DRV_DIB_BuildColorMap( struct tagDC *dc, WORD coloruse,
|
||||
extern int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse,
|
||||
WORD depth, const BITMAPINFO *info,
|
||||
int *nColors );
|
||||
extern INT X11DRV_CoerceDIBSection(struct tagDC *dc,INT,BOOL);
|
||||
extern INT X11DRV_LockDIBSection(struct tagDC *dc,INT,BOOL);
|
||||
extern void X11DRV_UnlockDIBSection(struct tagDC *dc,BOOL);
|
||||
extern INT X11DRV_CoerceDIBSection(X11DRV_PDEVICE *physDev,INT,BOOL);
|
||||
extern INT X11DRV_LockDIBSection(X11DRV_PDEVICE *physDev,INT,BOOL);
|
||||
extern void X11DRV_UnlockDIBSection(X11DRV_PDEVICE *physDev,BOOL);
|
||||
extern INT X11DRV_CoerceDIBSection2(HBITMAP bmp,INT,BOOL);
|
||||
extern INT X11DRV_LockDIBSection2(HBITMAP bmp,INT,BOOL);
|
||||
extern void X11DRV_UnlockDIBSection2(HBITMAP bmp,BOOL);
|
||||
|
||||
extern HBITMAP X11DRV_DIB_CreateDIBSection(struct tagDC *dc, BITMAPINFO *bmi, UINT usage,
|
||||
extern HBITMAP X11DRV_DIB_CreateDIBSection(X11DRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage,
|
||||
LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch);
|
||||
|
||||
extern struct tagBITMAP_DRIVER X11DRV_BITMAP_Driver;
|
||||
|
||||
extern INT X11DRV_DIB_SetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan,
|
||||
UINT lines, LPCVOID bits, const BITMAPINFO *info,
|
||||
UINT coloruse, HBITMAP hbitmap);
|
||||
extern INT X11DRV_DIB_GetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan,
|
||||
UINT lines, LPVOID bits, BITMAPINFO *info,
|
||||
UINT coloruse, HBITMAP hbitmap);
|
||||
extern void X11DRV_DIB_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
|
||||
extern UINT X11DRV_DIB_SetDIBColorTable(struct tagBITMAPOBJ *,struct tagDC*,UINT,UINT,const RGBQUAD *);
|
||||
extern UINT X11DRV_DIB_GetDIBColorTable(struct tagBITMAPOBJ *,struct tagDC*,UINT,UINT,RGBQUAD *);
|
||||
extern INT X11DRV_DIB_Coerce(struct tagBITMAPOBJ *,INT,BOOL);
|
||||
extern INT X11DRV_DIB_Lock(struct tagBITMAPOBJ *,INT,BOOL);
|
||||
extern void X11DRV_DIB_Unlock(struct tagBITMAPOBJ *,BOOL);
|
||||
void X11DRV_DIB_CopyDIBSection(DC *dcSrc, DC *dcDst,
|
||||
DWORD xSrc, DWORD ySrc,
|
||||
DWORD xDest, DWORD yDest,
|
||||
void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
|
||||
DWORD xSrc, DWORD ySrc, DWORD xDest, DWORD yDest,
|
||||
DWORD width, DWORD height);
|
||||
struct _DCICMD;
|
||||
extern INT X11DRV_DCICommand(INT cbInput, const struct _DCICMD *lpCmd, LPVOID lpOutData);
|
||||
|
@ -321,7 +303,7 @@ extern int X11DRV_PALETTE_Init(void);
|
|||
extern void X11DRV_PALETTE_Cleanup(void);
|
||||
|
||||
extern COLORREF X11DRV_PALETTE_ToLogical(int pixel);
|
||||
extern int X11DRV_PALETTE_ToPhysical(struct tagDC *dc, COLORREF color);
|
||||
extern int X11DRV_PALETTE_ToPhysical(X11DRV_PDEVICE *physDev, COLORREF color);
|
||||
|
||||
extern struct tagPALETTE_DRIVER X11DRV_PALETTE_Driver;
|
||||
|
||||
|
|
|
@ -25,13 +25,12 @@
|
|||
#include "wine/winbase16.h"
|
||||
#include "gdi.h"
|
||||
#include "bitmap.h"
|
||||
#include "selectors.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wine/winuser16.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(bitmap);
|
||||
|
||||
BITMAP_DRIVER *BITMAP_Driver = NULL;
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* BITMAP_GetWidthBytes
|
||||
|
@ -426,8 +425,26 @@ BOOL BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bmp )
|
|||
if( bmp->bitmap.bmBits )
|
||||
HeapFree( GetProcessHeap(), 0, bmp->bitmap.bmBits );
|
||||
|
||||
DIB_DeleteDIBSection( bmp );
|
||||
if (bmp->dib)
|
||||
{
|
||||
DIBSECTION *dib = bmp->dib;
|
||||
|
||||
if (dib->dsBm.bmBits)
|
||||
{
|
||||
if (dib->dshSection)
|
||||
{
|
||||
SYSTEM_INFO SystemInfo;
|
||||
GetSystemInfo( &SystemInfo );
|
||||
UnmapViewOfFile( (char *)dib->dsBm.bmBits -
|
||||
(dib->dsOffset % SystemInfo.dwAllocationGranularity) );
|
||||
}
|
||||
else if (!dib->dsOffset)
|
||||
VirtualFree(dib->dsBm.bmBits, 0L, MEM_RELEASE );
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, dib);
|
||||
bmp->dib = NULL;
|
||||
if (bmp->segptr_bits) SELECTOR_FreeBlock( SELECTOROF(bmp->segptr_bits) );
|
||||
}
|
||||
return GDI_FreeObject( hbitmap, bmp );
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ void CLIPPING_UpdateGCRegion( DC * dc )
|
|||
CombineRgn( dc->hGCClipRgn, dc->hVisRgn, 0, RGN_COPY );
|
||||
else
|
||||
CombineRgn(dc->hGCClipRgn, dc->hClipRgn, dc->hVisRgn, RGN_AND);
|
||||
if (dc->funcs->pSetDeviceClipping) dc->funcs->pSetDeviceClipping( dc );
|
||||
if (dc->funcs->pSetDeviceClipping) dc->funcs->pSetDeviceClipping( dc->physDev );
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,7 +170,7 @@ INT WINAPI OffsetClipRgn( HDC hdc, INT x, INT y )
|
|||
TRACE("%04x %d,%d\n", hdc, x, y );
|
||||
|
||||
if(dc->funcs->pOffsetClipRgn)
|
||||
ret = dc->funcs->pOffsetClipRgn( dc, x, y );
|
||||
ret = dc->funcs->pOffsetClipRgn( dc->physDev, x, y );
|
||||
else if (dc->hClipRgn) {
|
||||
ret = OffsetRgn( dc->hClipRgn, XLSTODS(dc,x), YLSTODS(dc,y));
|
||||
CLIPPING_UpdateGCRegion( dc );
|
||||
|
@ -267,7 +267,7 @@ INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top,
|
|||
TRACE("%04x %dx%d,%dx%d\n", hdc, left, top, right, bottom );
|
||||
|
||||
if(dc->funcs->pExcludeClipRect)
|
||||
ret = dc->funcs->pExcludeClipRect( dc, left, top, right, bottom );
|
||||
ret = dc->funcs->pExcludeClipRect( dc->physDev, left, top, right, bottom );
|
||||
else {
|
||||
left = XLPTODP( dc, left );
|
||||
right = XLPTODP( dc, right );
|
||||
|
@ -304,7 +304,7 @@ INT WINAPI IntersectClipRect( HDC hdc, INT left, INT top,
|
|||
TRACE("%04x %dx%d,%dx%d\n", hdc, left, top, right, bottom );
|
||||
|
||||
if(dc->funcs->pIntersectClipRect)
|
||||
ret = dc->funcs->pIntersectClipRect( dc, left, top, right, bottom );
|
||||
ret = dc->funcs->pIntersectClipRect( dc->physDev, left, top, right, bottom );
|
||||
else {
|
||||
left = XLPTODP( dc, left );
|
||||
right = XLPTODP( dc, right );
|
||||
|
|
46
objects/dc.c
46
objects/dc.c
|
@ -451,7 +451,7 @@ INT WINAPI SaveDC( HDC hdc )
|
|||
|
||||
if(dc->funcs->pSaveDC)
|
||||
{
|
||||
ret = dc->funcs->pSaveDC( dc );
|
||||
ret = dc->funcs->pSaveDC( dc->physDev );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return ret;
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
|
|||
if(!dc) return FALSE;
|
||||
if(dc->funcs->pRestoreDC)
|
||||
{
|
||||
success = dc->funcs->pRestoreDC( dc, level );
|
||||
success = dc->funcs->pRestoreDC( dc->physDev, level );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return success;
|
||||
}
|
||||
|
@ -781,7 +781,7 @@ BOOL WINAPI DeleteDC( HDC hdc )
|
|||
SelectObject( hdc, GetStockObject(SYSTEM_FONT) );
|
||||
SelectObject( hdc, GetStockObject(DEFAULT_BITMAP) );
|
||||
funcs = dc->funcs;
|
||||
if (dc->funcs->pDeleteDC) dc->funcs->pDeleteDC(dc);
|
||||
if (dc->funcs->pDeleteDC) dc->funcs->pDeleteDC(dc->physDev);
|
||||
}
|
||||
|
||||
if (dc->hClipRgn) DeleteObject( dc->hClipRgn );
|
||||
|
@ -847,7 +847,7 @@ INT WINAPI GetDeviceCaps( HDC hdc, INT cap )
|
|||
|
||||
if ((dc = DC_GetDCPtr( hdc )))
|
||||
{
|
||||
if (dc->funcs->pGetDeviceCaps) ret = dc->funcs->pGetDeviceCaps( dc, cap );
|
||||
if (dc->funcs->pGetDeviceCaps) ret = dc->funcs->pGetDeviceCaps( dc->physDev, cap );
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
@ -871,13 +871,18 @@ COLORREF WINAPI SetBkColor( HDC hdc, COLORREF color )
|
|||
COLORREF oldColor;
|
||||
DC * dc = DC_GetDCPtr( hdc );
|
||||
|
||||
if (!dc) return 0x80000000;
|
||||
if (dc->funcs->pSetBkColor)
|
||||
oldColor = dc->funcs->pSetBkColor(dc, color);
|
||||
else {
|
||||
if (!dc) return CLR_INVALID;
|
||||
oldColor = dc->backgroundColor;
|
||||
dc->backgroundColor = color;
|
||||
if (dc->funcs->pSetBkColor)
|
||||
{
|
||||
color = dc->funcs->pSetBkColor(dc->physDev, color);
|
||||
if (color == CLR_INVALID) /* don't change it */
|
||||
{
|
||||
color = oldColor;
|
||||
oldColor = CLR_INVALID;
|
||||
}
|
||||
}
|
||||
dc->backgroundColor = color;
|
||||
GDI_ReleaseObj( hdc );
|
||||
return oldColor;
|
||||
}
|
||||
|
@ -900,13 +905,18 @@ COLORREF WINAPI SetTextColor( HDC hdc, COLORREF color )
|
|||
COLORREF oldColor;
|
||||
DC * dc = DC_GetDCPtr( hdc );
|
||||
|
||||
if (!dc) return 0x80000000;
|
||||
if (dc->funcs->pSetTextColor)
|
||||
oldColor = dc->funcs->pSetTextColor(dc, color);
|
||||
else {
|
||||
if (!dc) return CLR_INVALID;
|
||||
oldColor = dc->textColor;
|
||||
dc->textColor = color;
|
||||
if (dc->funcs->pSetTextColor)
|
||||
{
|
||||
color = dc->funcs->pSetTextColor(dc->physDev, color);
|
||||
if (color == CLR_INVALID) /* don't change it */
|
||||
{
|
||||
color = oldColor;
|
||||
oldColor = CLR_INVALID;
|
||||
}
|
||||
}
|
||||
dc->textColor = color;
|
||||
GDI_ReleaseObj( hdc );
|
||||
return oldColor;
|
||||
}
|
||||
|
@ -929,7 +939,7 @@ UINT WINAPI SetTextAlign( HDC hdc, UINT align )
|
|||
DC *dc = DC_GetDCPtr( hdc );
|
||||
if (!dc) return 0x0;
|
||||
if (dc->funcs->pSetTextAlign)
|
||||
prevAlign = dc->funcs->pSetTextAlign(dc, align);
|
||||
prevAlign = dc->funcs->pSetTextAlign(dc->physDev, align);
|
||||
else {
|
||||
prevAlign = dc->textAlign;
|
||||
dc->textAlign = align;
|
||||
|
@ -949,7 +959,7 @@ BOOL WINAPI GetDCOrgEx( HDC hDC, LPPOINT lpp )
|
|||
if (!(dc = DC_GetDCPtr( hDC ))) return FALSE;
|
||||
|
||||
lpp->x = lpp->y = 0;
|
||||
if (dc->funcs->pGetDCOrgEx) dc->funcs->pGetDCOrgEx( dc, lpp );
|
||||
if (dc->funcs->pGetDCOrgEx) dc->funcs->pGetDCOrgEx( dc->physDev, lpp );
|
||||
lpp->x += dc->DCOrgX;
|
||||
lpp->y += dc->DCOrgY;
|
||||
GDI_ReleaseObj( hDC );
|
||||
|
@ -1296,7 +1306,7 @@ BOOL WINAPI GetDeviceGammaRamp(HDC hDC, LPVOID ptr)
|
|||
if( dc )
|
||||
{
|
||||
if (dc->funcs->pGetDeviceGammaRamp)
|
||||
ret = dc->funcs->pGetDeviceGammaRamp(dc, ptr);
|
||||
ret = dc->funcs->pGetDeviceGammaRamp(dc->physDev, ptr);
|
||||
GDI_ReleaseObj( hDC );
|
||||
}
|
||||
return ret;
|
||||
|
@ -1313,7 +1323,7 @@ BOOL WINAPI SetDeviceGammaRamp(HDC hDC, LPVOID ptr)
|
|||
if( dc )
|
||||
{
|
||||
if (dc->funcs->pSetDeviceGammaRamp)
|
||||
ret = dc->funcs->pSetDeviceGammaRamp(dc, ptr);
|
||||
ret = dc->funcs->pSetDeviceGammaRamp(dc->physDev, ptr);
|
||||
GDI_ReleaseObj( hDC );
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -40,7 +40,7 @@ INT WINAPI SetBkMode( HDC hdc, INT mode )
|
|||
}
|
||||
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
|
||||
if (dc->funcs->pSetBkMode)
|
||||
ret = dc->funcs->pSetBkMode( dc, mode );
|
||||
ret = dc->funcs->pSetBkMode( dc->physDev, mode );
|
||||
else
|
||||
{
|
||||
ret = dc->backgroundMode;
|
||||
|
@ -65,7 +65,7 @@ INT WINAPI SetROP2( HDC hdc, INT mode )
|
|||
}
|
||||
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
|
||||
if (dc->funcs->pSetROP2)
|
||||
ret = dc->funcs->pSetROP2( dc, mode );
|
||||
ret = dc->funcs->pSetROP2( dc->physDev, mode );
|
||||
else
|
||||
{
|
||||
ret = dc->ROPmode;
|
||||
|
@ -90,7 +90,7 @@ INT WINAPI SetRelAbs( HDC hdc, INT mode )
|
|||
}
|
||||
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
|
||||
if (dc->funcs->pSetRelAbs)
|
||||
ret = dc->funcs->pSetRelAbs( dc, mode );
|
||||
ret = dc->funcs->pSetRelAbs( dc->physDev, mode );
|
||||
else
|
||||
{
|
||||
ret = dc->relAbsMode;
|
||||
|
@ -115,7 +115,7 @@ INT WINAPI SetPolyFillMode( HDC hdc, INT mode )
|
|||
}
|
||||
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
|
||||
if (dc->funcs->pSetPolyFillMode)
|
||||
ret = dc->funcs->pSetPolyFillMode( dc, mode );
|
||||
ret = dc->funcs->pSetPolyFillMode( dc->physDev, mode );
|
||||
else
|
||||
{
|
||||
ret = dc->polyFillMode;
|
||||
|
@ -140,7 +140,7 @@ INT WINAPI SetStretchBltMode( HDC hdc, INT mode )
|
|||
}
|
||||
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
|
||||
if (dc->funcs->pSetStretchBltMode)
|
||||
ret = dc->funcs->pSetStretchBltMode( dc, mode );
|
||||
ret = dc->funcs->pSetStretchBltMode( dc->physDev, mode );
|
||||
else
|
||||
{
|
||||
ret = dc->stretchBltMode;
|
||||
|
|
|
@ -173,7 +173,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
|
|||
|
||||
if(dc->funcs->pStretchDIBits)
|
||||
{
|
||||
heightSrc = dc->funcs->pStretchDIBits(dc, xDst, yDst, widthDst,
|
||||
heightSrc = dc->funcs->pStretchDIBits(dc->physDev, xDst, yDst, widthDst,
|
||||
heightDst, xSrc, ySrc, widthSrc,
|
||||
heightSrc, bits, info, wUsage, dwRop);
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
@ -264,25 +264,15 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
|
|||
UINT coloruse )
|
||||
{
|
||||
DC *dc;
|
||||
BITMAPOBJ *bitmap;
|
||||
INT result;
|
||||
INT result = 0;
|
||||
|
||||
/* Check parameters */
|
||||
if (!(dc = DC_GetDCUpdate( hdc ))) return 0;
|
||||
|
||||
if (!(bitmap = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
|
||||
{
|
||||
if (dc->funcs->pSetDIBits)
|
||||
result = dc->funcs->pSetDIBits(dc->physDev, hbitmap, startscan, lines, bits, info, coloruse);
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
return 0;
|
||||
}
|
||||
|
||||
result = BITMAP_Driver->pSetDIBits(bitmap, dc, startscan,
|
||||
lines, bits, info,
|
||||
coloruse, hbitmap);
|
||||
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -314,7 +304,7 @@ INT WINAPI SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx,
|
|||
if (!(dc = DC_GetDCUpdate( hdc ))) return 0;
|
||||
|
||||
if(dc->funcs->pSetDIBitsToDevice)
|
||||
ret = dc->funcs->pSetDIBitsToDevice( dc, xDest, yDest, cx, cy, xSrc,
|
||||
ret = dc->funcs->pSetDIBitsToDevice( dc->physDev, xDest, yDest, cx, cy, xSrc,
|
||||
ySrc, startscan, lines, bits,
|
||||
info, coloruse );
|
||||
else {
|
||||
|
@ -338,24 +328,16 @@ UINT16 WINAPI SetDIBColorTable16( HDC16 hdc, UINT16 startpos, UINT16 entries,
|
|||
/***********************************************************************
|
||||
* SetDIBColorTable (GDI32.@)
|
||||
*/
|
||||
UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries,
|
||||
RGBQUAD *colors )
|
||||
UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *colors )
|
||||
{
|
||||
DC * dc;
|
||||
BITMAPOBJ * bmp;
|
||||
UINT result;
|
||||
UINT result = 0;
|
||||
|
||||
if (!(dc = DC_GetDCUpdate( hdc ))) return 0;
|
||||
|
||||
if (!(bmp = (BITMAPOBJ*)GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC )))
|
||||
{
|
||||
GDI_ReleaseObj( hdc );
|
||||
return 0;
|
||||
}
|
||||
if (dc->funcs->pSetDIBColorTable)
|
||||
result = dc->funcs->pSetDIBColorTable(dc->physDev, startpos, entries, colors);
|
||||
|
||||
result = BITMAP_Driver->pSetDIBColorTable(bmp, dc, startpos, entries, colors);
|
||||
|
||||
GDI_ReleaseObj( dc->hBitmap );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return result;
|
||||
}
|
||||
|
@ -372,24 +354,16 @@ UINT16 WINAPI GetDIBColorTable16( HDC16 hdc, UINT16 startpos, UINT16 entries,
|
|||
/***********************************************************************
|
||||
* GetDIBColorTable (GDI32.@)
|
||||
*/
|
||||
UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries,
|
||||
RGBQUAD *colors )
|
||||
UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *colors )
|
||||
{
|
||||
DC * dc;
|
||||
BITMAPOBJ * bmp;
|
||||
UINT result;
|
||||
UINT result = 0;
|
||||
|
||||
if (!(dc = DC_GetDCUpdate( hdc ))) return 0;
|
||||
|
||||
if (!(bmp = (BITMAPOBJ*)GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC )))
|
||||
{
|
||||
GDI_ReleaseObj( hdc );
|
||||
return 0;
|
||||
}
|
||||
if (dc->funcs->pGetDIBColorTable)
|
||||
result = dc->funcs->pGetDIBColorTable(dc->physDev, startpos, entries, colors);
|
||||
|
||||
result = BITMAP_Driver->pGetDIBColorTable(bmp, dc, startpos, entries, colors);
|
||||
|
||||
GDI_ReleaseObj( dc->hBitmap );
|
||||
GDI_ReleaseObj( hdc );
|
||||
return result;
|
||||
}
|
||||
|
@ -747,7 +721,8 @@ INT WINAPI GetDIBits(
|
|||
}
|
||||
}
|
||||
/* Otherwise, get bits from the XImage */
|
||||
else if(!BITMAP_Driver->pGetDIBits(bmp, dc, startscan, lines, bits, info, coloruse, hbitmap))
|
||||
else if (!dc->funcs->pGetDIBits ||
|
||||
!dc->funcs->pGetDIBits(dc->physDev, hbitmap, startscan, lines, bits, info, coloruse))
|
||||
{
|
||||
GDI_ReleaseObj( hdc );
|
||||
GDI_ReleaseObj( hbitmap );
|
||||
|
@ -949,7 +924,7 @@ HBITMAP DIB_CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage,
|
|||
|
||||
if ((dc = DC_GetDCPtr( hdc )))
|
||||
{
|
||||
hbitmap = dc->funcs->pCreateDIBSection(dc, bmi, usage, bits, section, offset, ovr_pitch);
|
||||
hbitmap = dc->funcs->pCreateDIBSection(dc->physDev, bmi, usage, bits, section, offset, ovr_pitch);
|
||||
GDI_ReleaseObj(hdc);
|
||||
}
|
||||
|
||||
|
@ -969,36 +944,6 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage,
|
|||
return DIB_CreateDIBSection(hdc, bmi, usage, bits, section, offset, 0);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DIB_DeleteDIBSection
|
||||
*/
|
||||
void DIB_DeleteDIBSection( BITMAPOBJ *bmp )
|
||||
{
|
||||
if (bmp && bmp->dib)
|
||||
{
|
||||
DIBSECTION *dib = bmp->dib;
|
||||
|
||||
if (dib->dsBm.bmBits)
|
||||
{
|
||||
if (dib->dshSection)
|
||||
{
|
||||
SYSTEM_INFO SystemInfo;
|
||||
GetSystemInfo( &SystemInfo );
|
||||
UnmapViewOfFile( (char *)dib->dsBm.bmBits -
|
||||
(dib->dsOffset % SystemInfo.dwAllocationGranularity) );
|
||||
}
|
||||
else if (!dib->dsOffset)
|
||||
VirtualFree(dib->dsBm.bmBits, 0L, MEM_RELEASE );
|
||||
}
|
||||
|
||||
BITMAP_Driver->pDeleteDIBSection(bmp);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, dib);
|
||||
bmp->dib = NULL;
|
||||
if (bmp->segptr_bits) SELECTOR_FreeBlock( SELECTOROF(bmp->segptr_bits) );
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DIB_CreateDIBFromBitmap
|
||||
* Allocates a packed DIB and copies the bitmap data into it.
|
||||
|
|
|
@ -901,7 +901,7 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
|
|||
DC * dc = DC_GetDCPtr( hdc );
|
||||
if (!dc) return 0;
|
||||
if (dc->funcs->pSetTextCharacterExtra)
|
||||
prev = dc->funcs->pSetTextCharacterExtra( dc, extra );
|
||||
prev = dc->funcs->pSetTextCharacterExtra( dc->physDev, extra );
|
||||
else
|
||||
{
|
||||
extra = (extra * dc->vportExtX + dc->wndExtX / 2) / dc->wndExtX;
|
||||
|
@ -931,7 +931,7 @@ BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks )
|
|||
DC * dc = DC_GetDCPtr( hdc );
|
||||
if (!dc) return FALSE;
|
||||
if (dc->funcs->pSetTextJustification)
|
||||
ret = dc->funcs->pSetTextJustification( dc, extra, breaks );
|
||||
ret = dc->funcs->pSetTextJustification( dc->physDev, extra, breaks );
|
||||
else
|
||||
{
|
||||
extra = abs((extra * dc->vportExtX + dc->wndExtX / 2) / dc->wndExtX);
|
||||
|
@ -1080,7 +1080,7 @@ BOOL WINAPI GetTextExtentPoint32W(
|
|||
if(dc->gdiFont)
|
||||
ret = WineEngGetTextExtentPoint(dc->gdiFont, str, count, size);
|
||||
else if(dc->funcs->pGetTextExtentPoint)
|
||||
ret = dc->funcs->pGetTextExtentPoint( dc, str, count, size );
|
||||
ret = dc->funcs->pGetTextExtentPoint( dc->physDev, str, count, size );
|
||||
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
||||
|
@ -1233,7 +1233,7 @@ BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
|
|||
if (dc->gdiFont)
|
||||
ret = WineEngGetTextMetrics(dc->gdiFont, metrics);
|
||||
else if (dc->funcs->pGetTextMetrics)
|
||||
ret = dc->funcs->pGetTextMetrics( dc, metrics );
|
||||
ret = dc->funcs->pGetTextMetrics( dc->physDev, metrics );
|
||||
|
||||
if (ret)
|
||||
{
|
||||
|
@ -1533,7 +1533,7 @@ BOOL WINAPI GetCharWidth32W( HDC hdc, UINT firstChar, UINT lastChar,
|
|||
if (dc->gdiFont)
|
||||
ret = WineEngGetCharWidth( dc->gdiFont, firstChar, lastChar, buffer );
|
||||
else if (dc->funcs->pGetCharWidth)
|
||||
ret = dc->funcs->pGetCharWidth( dc, firstChar, lastChar, buffer);
|
||||
ret = dc->funcs->pGetCharWidth( dc->physDev, firstChar, lastChar, buffer);
|
||||
|
||||
if (ret)
|
||||
{
|
||||
|
@ -1607,7 +1607,7 @@ DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag )
|
|||
DWORD ret = 0;
|
||||
if(!dc) return 0;
|
||||
if(dc->funcs->pSetMapperFlags)
|
||||
ret = dc->funcs->pSetMapperFlags( dc, dwFlag );
|
||||
ret = dc->funcs->pSetMapperFlags( dc->physDev, dwFlag );
|
||||
else
|
||||
FIXME("(0x%04x, 0x%08lx): stub - harmless\n", hDC, dwFlag);
|
||||
GDI_ReleaseObj( hDC );
|
||||
|
|
|
@ -1156,8 +1156,8 @@ static HGDIOBJ FONT_SelectObject(DC *dc, HGDIOBJ hFont)
|
|||
dc->gdiFont = WineEngCreateFontInstance(hFont);
|
||||
}
|
||||
|
||||
if(dc->funcs->pSelectObject)
|
||||
ret = dc->funcs->pSelectObject(dc, hFont);
|
||||
if(dc->funcs->pSelectFont)
|
||||
ret = dc->funcs->pSelectFont(dc->physDev, hFont);
|
||||
|
||||
if(ret && dc->gdiFont) {
|
||||
dc->gdiFont = 0;
|
||||
|
@ -1188,16 +1188,39 @@ HGDIOBJ16 WINAPI SelectObject16( HDC16 hdc, HGDIOBJ16 handle )
|
|||
HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ handle )
|
||||
{
|
||||
HGDIOBJ ret = 0;
|
||||
DC * dc = DC_GetDCUpdate( hdc );
|
||||
DC * dc = DC_GetDCPtr( hdc );
|
||||
if (!dc) return 0;
|
||||
TRACE("hdc=%04x %04x\n", hdc, handle );
|
||||
|
||||
/* Fonts get a rather different treatment so we'll handle them
|
||||
separately */
|
||||
if(GetObjectType(handle) == OBJ_FONT)
|
||||
switch(GetObjectType( handle ))
|
||||
{
|
||||
case OBJ_BITMAP:
|
||||
ret = dc->hBitmap;
|
||||
if (dc->funcs->pSelectBitmap) handle = dc->funcs->pSelectBitmap( dc->physDev, handle );
|
||||
if (handle) dc->hBitmap = handle;
|
||||
else ret = 0;
|
||||
break;
|
||||
case OBJ_BRUSH:
|
||||
ret = dc->hBrush;
|
||||
if (dc->funcs->pSelectBrush) handle = dc->funcs->pSelectBrush( dc->physDev, handle );
|
||||
if (handle) dc->hBrush = handle;
|
||||
else ret = 0;
|
||||
break;
|
||||
case OBJ_PEN:
|
||||
ret = dc->hPen;
|
||||
if (dc->funcs->pSelectPen) handle = dc->funcs->pSelectPen( dc->physDev, handle );
|
||||
if (handle) dc->hPen = handle;
|
||||
else ret = 0;
|
||||
break;
|
||||
case OBJ_FONT:
|
||||
ret = FONT_SelectObject(dc, handle);
|
||||
else if (dc->funcs->pSelectObject)
|
||||
ret = dc->funcs->pSelectObject( dc, handle );
|
||||
break;
|
||||
case OBJ_REGION:
|
||||
GDI_ReleaseObj( hdc );
|
||||
return (HGDIOBJ)SelectClipRgn( hdc, handle );
|
||||
}
|
||||
GDI_ReleaseObj( hdc );
|
||||
|
||||
if (ret && ret != handle)
|
||||
|
|
|
@ -169,7 +169,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
|
|||
if (dc)
|
||||
{
|
||||
if(dc->funcs->pExtTextOut)
|
||||
ret = dc->funcs->pExtTextOut(dc,x,y,flags,lprect,str,count,lpDx);
|
||||
ret = dc->funcs->pExtTextOut(dc->physDev,x,y,flags,lprect,str,count,lpDx);
|
||||
GDI_ReleaseObj( hdc );
|
||||
}
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue