Implemented invisible pens.
This commit is contained in:
parent
1bb9860547
commit
3471f0f527
|
@ -48,7 +48,7 @@ BOOL PSDRV_LineTo(DC *dc, INT x, INT y)
|
||||||
PSDRV_WriteMoveTo(dc, XLPTODP(dc, dc->w.CursPosX),
|
PSDRV_WriteMoveTo(dc, XLPTODP(dc, dc->w.CursPosX),
|
||||||
YLPTODP(dc, dc->w.CursPosY));
|
YLPTODP(dc, dc->w.CursPosY));
|
||||||
PSDRV_WriteLineTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
|
PSDRV_WriteLineTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
|
||||||
PSDRV_WriteStroke(dc);
|
PSDRV_DrawLine(dc);
|
||||||
|
|
||||||
dc->w.CursPosX = x;
|
dc->w.CursPosX = x;
|
||||||
dc->w.CursPosY = y;
|
dc->w.CursPosY = y;
|
||||||
|
@ -73,7 +73,7 @@ BOOL PSDRV_Rectangle( DC *dc, INT left, INT top, INT right,
|
||||||
|
|
||||||
PSDRV_Brush(dc,0);
|
PSDRV_Brush(dc,0);
|
||||||
PSDRV_SetPen(dc);
|
PSDRV_SetPen(dc);
|
||||||
PSDRV_WriteStroke(dc);
|
PSDRV_DrawLine(dc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ BOOL PSDRV_RoundRect( DC *dc, INT left, INT top, INT right,
|
||||||
|
|
||||||
PSDRV_Brush(dc,0);
|
PSDRV_Brush(dc,0);
|
||||||
PSDRV_SetPen(dc);
|
PSDRV_SetPen(dc);
|
||||||
PSDRV_WriteStroke(dc);
|
PSDRV_DrawLine(dc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ static BOOL PSDRV_DrawArc( DC *dc, INT left, INT top,
|
||||||
PSDRV_Brush(dc,0);
|
PSDRV_Brush(dc,0);
|
||||||
}
|
}
|
||||||
PSDRV_SetPen(dc);
|
PSDRV_SetPen(dc);
|
||||||
PSDRV_WriteStroke(dc);
|
PSDRV_DrawLine(dc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,11 +213,12 @@ BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom)
|
||||||
w = XLSTODS(dc, (right - left));
|
w = XLSTODS(dc, (right - left));
|
||||||
h = YLSTODS(dc, (bottom - top));
|
h = YLSTODS(dc, (bottom - top));
|
||||||
|
|
||||||
|
PSDRV_WriteNewPath(dc);
|
||||||
PSDRV_WriteArc(dc, x, y, w, h, 0.0, 360.0);
|
PSDRV_WriteArc(dc, x, y, w, h, 0.0, 360.0);
|
||||||
PSDRV_WriteClosePath(dc);
|
PSDRV_WriteClosePath(dc);
|
||||||
PSDRV_Brush(dc,0);
|
PSDRV_Brush(dc,0);
|
||||||
PSDRV_SetPen(dc);
|
PSDRV_SetPen(dc);
|
||||||
PSDRV_WriteStroke(dc);
|
PSDRV_DrawLine(dc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +243,7 @@ BOOL PSDRV_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PSDRV_SetPen(dc);
|
PSDRV_SetPen(dc);
|
||||||
PSDRV_WriteStroke(dc);
|
PSDRV_DrawLine(dc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +283,7 @@ BOOL PSDRV_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
|
||||||
else /* WINDING */
|
else /* WINDING */
|
||||||
PSDRV_Brush(dc, 0);
|
PSDRV_Brush(dc, 0);
|
||||||
PSDRV_SetPen(dc);
|
PSDRV_SetPen(dc);
|
||||||
PSDRV_WriteStroke(dc);
|
PSDRV_DrawLine(dc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,3 +314,17 @@ COLORREF PSDRV_SetPixel( DC *dc, INT x, INT y, COLORREF color )
|
||||||
PSDRV_WriteFill( dc );
|
PSDRV_WriteFill( dc );
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* PSDRV_DrawLine
|
||||||
|
*/
|
||||||
|
VOID PSDRV_DrawLine( DC *dc )
|
||||||
|
{
|
||||||
|
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||||
|
|
||||||
|
if (physDev->pen.style == PS_NULL)
|
||||||
|
PSDRV_WriteNewPath(dc);
|
||||||
|
else
|
||||||
|
PSDRV_WriteStroke(dc);
|
||||||
|
}
|
||||||
|
|
|
@ -33,36 +33,37 @@ extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
|
||||||
physDev->pen.width = -physDev->pen.width;
|
physDev->pen.width = -physDev->pen.width;
|
||||||
|
|
||||||
PSDRV_CreateColor(physDev, &physDev->pen.color, pen->logpen.lopnColor);
|
PSDRV_CreateColor(physDev, &physDev->pen.color, pen->logpen.lopnColor);
|
||||||
|
physDev->pen.style = pen->logpen.lopnStyle & PS_STYLE_MASK;
|
||||||
|
|
||||||
|
switch(physDev->pen.style) {
|
||||||
|
case PS_DASH:
|
||||||
|
physDev->pen.dash = PEN_dash;
|
||||||
|
break;
|
||||||
|
|
||||||
if(physDev->pen.width > 1) { /* dashes only for 0 or 1 pixel pens */
|
case PS_DOT:
|
||||||
physDev->pen.dash = NULL;
|
physDev->pen.dash = PEN_dot;
|
||||||
} else {
|
break;
|
||||||
switch(pen->logpen.lopnStyle & PS_STYLE_MASK) {
|
|
||||||
case PS_DASH:
|
|
||||||
physDev->pen.dash = PEN_dash;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PS_DOT:
|
case PS_DASHDOT:
|
||||||
physDev->pen.dash = PEN_dot;
|
physDev->pen.dash = PEN_dashdot;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PS_DASHDOT:
|
case PS_DASHDOTDOT:
|
||||||
physDev->pen.dash = PEN_dashdot;
|
physDev->pen.dash = PEN_dashdotdot;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PS_DASHDOTDOT:
|
case PS_ALTERNATE:
|
||||||
physDev->pen.dash = PEN_dashdotdot;
|
physDev->pen.dash = PEN_alternate;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PS_ALTERNATE:
|
default:
|
||||||
physDev->pen.dash = PEN_alternate;
|
physDev->pen.dash = NULL;
|
||||||
break;
|
}
|
||||||
|
|
||||||
default:
|
if ((physDev->pen.width > 1) && (physDev->pen.dash != NULL)) {
|
||||||
physDev->pen.dash = NULL;
|
physDev->pen.style = PS_SOLID;
|
||||||
break;
|
physDev->pen.dash = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
physDev->pen.set = FALSE;
|
physDev->pen.set = FALSE;
|
||||||
return prevpen;
|
return prevpen;
|
||||||
|
@ -78,11 +79,13 @@ BOOL PSDRV_SetPen(DC *dc)
|
||||||
{
|
{
|
||||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||||
|
|
||||||
PSDRV_WriteSetColor(dc, &physDev->pen.color);
|
if (physDev->pen.style != PS_NULL) {
|
||||||
|
PSDRV_WriteSetColor(dc, &physDev->pen.color);
|
||||||
if(!physDev->pen.set) {
|
|
||||||
PSDRV_WriteSetPen(dc);
|
if(!physDev->pen.set) {
|
||||||
physDev->pen.set = TRUE;
|
PSDRV_WriteSetPen(dc);
|
||||||
|
physDev->pen.set = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -205,6 +205,7 @@ typedef struct {
|
||||||
} PSBRUSH;
|
} PSBRUSH;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
INT style;
|
||||||
INT width;
|
INT width;
|
||||||
char *dash;
|
char *dash;
|
||||||
PSCOLOR color;
|
PSCOLOR color;
|
||||||
|
@ -369,7 +370,7 @@ extern DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
|
||||||
LPCSTR lpszPort,
|
LPCSTR lpszPort,
|
||||||
WORD fwCapability, LPSTR lpszOutput,
|
WORD fwCapability, LPSTR lpszOutput,
|
||||||
LPDEVMODEA lpdm);
|
LPDEVMODEA lpdm);
|
||||||
|
VOID PSDRV_DrawLine( DC *dc );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue