Commit 3471f0f5 authored by Luc Tourangeau's avatar Luc Tourangeau Committed by Alexandre Julliard

Implemented invisible pens.

parent 1bb98605
...@@ -48,7 +48,7 @@ BOOL PSDRV_LineTo(DC *dc, INT x, INT y) ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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) ...@@ -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, ...@@ -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, ...@@ -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 ) ...@@ -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 ) ...@@ -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;
if(physDev->pen.width > 1) { /* dashes only for 0 or 1 pixel pens */
physDev->pen.dash = NULL; switch(physDev->pen.style) {
} else { case PS_DASH:
switch(pen->logpen.lopnStyle & PS_STYLE_MASK) { physDev->pen.dash = PEN_dash;
case PS_DASH: break;
physDev->pen.dash = PEN_dash;
break; case PS_DOT:
physDev->pen.dash = PEN_dot;
case PS_DOT: break;
physDev->pen.dash = PEN_dot;
break; case PS_DASHDOT:
physDev->pen.dash = PEN_dashdot;
case PS_DASHDOT: break;
physDev->pen.dash = PEN_dashdot;
break; case PS_DASHDOTDOT:
physDev->pen.dash = PEN_dashdotdot;
case PS_DASHDOTDOT: break;
physDev->pen.dash = PEN_dashdotdot;
break; case PS_ALTERNATE:
physDev->pen.dash = PEN_alternate;
case PS_ALTERNATE: break;
physDev->pen.dash = PEN_alternate;
break; default:
physDev->pen.dash = NULL;
default: }
physDev->pen.dash = NULL;
break; if ((physDev->pen.width > 1) && (physDev->pen.dash != NULL)) {
} physDev->pen.style = PS_SOLID;
} 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) ...@@ -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 { ...@@ -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, ...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment