- implementation of SetDeviceClipping
- coordinate system origin fix
This commit is contained in:
parent
db3aba29b6
commit
effc55ea83
|
@ -10,6 +10,7 @@ C_SRCS = \
|
|||
bitblt.c \
|
||||
bitmap.c \
|
||||
brush.c \
|
||||
clipping.c \
|
||||
color.c \
|
||||
driver.c \
|
||||
escape.c \
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* PostScript clipping functions
|
||||
*
|
||||
* Copyright 1999 Luc Tourangau
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gdi.h"
|
||||
#include "psdrv.h"
|
||||
#include "region.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(psdrv)
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_SetDeviceClipping
|
||||
*/
|
||||
VOID PSDRV_SetDeviceClipping( DC *dc )
|
||||
{
|
||||
CHAR szArrayName[] = "clippath";
|
||||
RGNOBJ *obj = (RGNOBJ *)GDI_GetObjPtr(dc->w.hGCClipRgn, REGION_MAGIC);
|
||||
if (!obj)
|
||||
{
|
||||
ERR_(psdrv)("Rgn is 0. Please report this.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
TRACE_(psdrv)("dc=%p", dc);
|
||||
|
||||
if (obj->rgn->numRects > 0)
|
||||
{
|
||||
INT i;
|
||||
RECT *pRect = obj->rgn->rects;
|
||||
|
||||
PSDRV_WriteArrayDef(dc, szArrayName, obj->rgn->numRects * 4);
|
||||
|
||||
for (i = 0; i < obj->rgn->numRects; i++, pRect++)
|
||||
{
|
||||
PSDRV_WriteArrayPut(dc, szArrayName, i * 4,
|
||||
pRect->left);
|
||||
PSDRV_WriteArrayPut(dc, szArrayName, i * 4 + 1,
|
||||
pRect->top);
|
||||
PSDRV_WriteArrayPut(dc, szArrayName, i * 4 + 2,
|
||||
pRect->right - pRect->left);
|
||||
PSDRV_WriteArrayPut(dc, szArrayName, i * 4 + 3,
|
||||
pRect->bottom - pRect->top);
|
||||
}
|
||||
}
|
||||
|
||||
PSDRV_WriteRectClip(dc, szArrayName);
|
||||
}
|
|
@ -149,10 +149,9 @@ static PSDRV_DEVMODEA DefaultDevmode =
|
|||
/* dmDriverVersion */ 0x001,
|
||||
/* dmSize */ sizeof(DEVMODEA),
|
||||
/* dmDriverExtra */ 0,
|
||||
/* dmFields */ DM_ORIENTATION | DM_PAPERSIZE | DM_PAPERLENGTH |
|
||||
DM_PAPERWIDTH | DM_SCALE | DM_COPIES |
|
||||
DM_DEFAULTSOURCE | DM_COLOR | DM_DUPLEX |
|
||||
DM_YRESOLUTION | DM_TTOPTION,
|
||||
/* dmFields */ DM_ORIENTATION | DM_PAPERSIZE | DM_SCALE |
|
||||
DM_COPIES | DM_DEFAULTSOURCE | DM_COLOR |
|
||||
DM_DUPLEX | DM_YRESOLUTION | DM_TTOPTION,
|
||||
{ /* u1 */
|
||||
{ /* s1 */
|
||||
/* dmOrientation */ DMORIENT_PORTRAIT,
|
||||
|
|
|
@ -161,12 +161,24 @@ static char psclip[] =
|
|||
static char pseoclip[] =
|
||||
"eoclip\n";
|
||||
|
||||
static char psrectclip[] =
|
||||
"%s rectclip\n";
|
||||
|
||||
static char pshatch[] =
|
||||
"hatch\n";
|
||||
|
||||
static char psrotate[] = /* ang */
|
||||
"%.1f rotate\n";
|
||||
|
||||
static char psarrayget[] =
|
||||
"%s %d get\n";
|
||||
|
||||
static char psarrayput[] =
|
||||
"%s %d %ld put\n";
|
||||
|
||||
static char psarraydef[] =
|
||||
"/%s %d array def\n";
|
||||
|
||||
char *PSDRV_ANSIVector[256] = {
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x00 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
@ -552,9 +564,6 @@ BOOL PSDRV_WriteSetColor(DC *dc, PSCOLOR *color)
|
|||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char buf[256];
|
||||
|
||||
if(PSDRV_CmpColor(&physDev->inkColor, color))
|
||||
return TRUE;
|
||||
|
||||
PSDRV_CopyColor(&physDev->inkColor, color);
|
||||
switch(color->type) {
|
||||
case PSCOLOR_RGB:
|
||||
|
@ -880,6 +889,38 @@ BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArrayGet(DC *dc, CHAR *pszArrayName, INT nIndex)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psarrayget, pszArrayName, nIndex);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArrayPut(DC *dc, CHAR *pszArrayName, INT nIndex, LONG lObject)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psarrayput, pszArrayName, nIndex, lObject);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteArrayDef(DC *dc, CHAR *pszArrayName, INT nSize)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psarraydef, pszArrayName, nSize);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
BOOL PSDRV_WriteRectClip(DC *dc, CHAR *pszArrayName)
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, psrectclip, pszArrayName);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
|
||||
BOOL PSDRV_WritePatternDict(DC *dc, BITMAP *bm, BYTE *bits)
|
||||
{
|
||||
|
|
|
@ -288,6 +288,7 @@ extern BOOL PSDRV_WriteGSave(DC *dc);
|
|||
extern BOOL PSDRV_WriteGRestore(DC *dc);
|
||||
extern BOOL PSDRV_WriteClosePath(DC *dc);
|
||||
extern BOOL PSDRV_WriteClip(DC *dc);
|
||||
extern BOOL PSDRV_WriteRectClip(DC *dc, CHAR *pszArrayName);
|
||||
extern BOOL PSDRV_WriteEOClip(DC *dc);
|
||||
extern BOOL PSDRV_WriteHatch(DC *dc);
|
||||
extern BOOL PSDRV_WriteRotate(DC *dc, float ang);
|
||||
|
@ -303,6 +304,8 @@ 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_Arc( DC *dc, INT left, INT top, INT right,
|
||||
INT bottom, INT xstart, INT ystart,
|
||||
|
@ -343,6 +346,7 @@ extern BOOL PSDRV_RoundRect(DC *dc, 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_StretchDIBits( DC *dc, INT xDst, INT yDst,
|
||||
|
|
Loading…
Reference in New Issue